From 6d956cd0b11fd386151f2d125335baa9010d6e09 Mon Sep 17 00:00:00 2001 From: AssisrMatheus Date: Tue, 9 Aug 2022 15:42:17 -0400 Subject: [PATCH] feat: adds initialFilesDescription to fileupload --- CHANGELOG.md | 6 ++++++ package.json | 2 +- src/components/CheckboxRadioInput/index.css | 4 +++- .../DragFileUploadInput/DragFileUploadInput.stories.tsx | 5 +++++ src/components/DragFileUploadInput/index.tsx | 7 ++++++- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a37f8a..44b96a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +## [7.2.0] 2022-08-09 + +### Changes + +- DragFileUploadInput now also expects an initialFilesDescription property + ## [7.1.1] 2022-08-03 ### Fixed diff --git a/package.json b/package.json index 102da9f..8c899c7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@perimetre/ui", "description": "A component library made by @perimetre", - "version": "7.1.1", + "version": "7.2.0", "repository": { "type": "git", "url": "git+https://github.com/perimetre/ui.git" diff --git a/src/components/CheckboxRadioInput/index.css b/src/components/CheckboxRadioInput/index.css index 937bc28..211489e 100644 --- a/src/components/CheckboxRadioInput/index.css +++ b/src/components/CheckboxRadioInput/index.css @@ -16,7 +16,9 @@ @apply appearance-none inline-block align-middle select-none cursor-pointer shrink-0 bg-white border-gray-400 transition-colors; /* Don't allow the browser to do any color adjustments */ - color-adjust: exact; + /* Color adjust is now deprecated and should be print-color-adjust */ + /* stylelint-disable-next-line property-no-unknown */ + print-color-adjust: exact; /* The background origin should consider the entire box */ background-origin: border-box; diff --git a/src/components/DragFileUploadInput/DragFileUploadInput.stories.tsx b/src/components/DragFileUploadInput/DragFileUploadInput.stories.tsx index ef5acb8..ef744e9 100644 --- a/src/components/DragFileUploadInput/DragFileUploadInput.stories.tsx +++ b/src/components/DragFileUploadInput/DragFileUploadInput.stories.tsx @@ -48,3 +48,8 @@ FileType.args = { accept: 'pdf', help: 'Only .pdf files allowed' }; + +export const InitialDescription = Template.bind({}); +InitialDescription.args = { + initialFilesDescription: 'image.png' +}; diff --git a/src/components/DragFileUploadInput/index.tsx b/src/components/DragFileUploadInput/index.tsx index 98df940..e459b67 100644 --- a/src/components/DragFileUploadInput/index.tsx +++ b/src/components/DragFileUploadInput/index.tsx @@ -51,6 +51,10 @@ export type DragFileUploadInputProps = Omit( @@ -67,6 +71,7 @@ export const DragFileUploadInput = forwardRef(); + const [filesDescription, setFilesDescription] = useState(initialFilesDescription); const [error, setError] = useState(); // Create a reference of the container element