Skip to content

Commit

Permalink
Merge pull request #80 from perimetre/7.2.0
Browse files Browse the repository at this point in the history
7.2.0
  • Loading branch information
AssisrMatheus authored Aug 9, 2022
2 parents be701e2 + 6d956cd commit d5f9d23
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 3 additions & 1 deletion src/components/CheckboxRadioInput/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ FileType.args = {
accept: 'pdf',
help: 'Only .pdf files allowed'
};

export const InitialDescription = Template.bind({});
InitialDescription.args = {
initialFilesDescription: 'image.png'
};
7 changes: 6 additions & 1 deletion src/components/DragFileUploadInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export type DragFileUploadInputProps = Omit<React.InputHTMLAttributes<HTMLInputE
* The translation object
*/
translations?: DragFileUploadTranslations;
/**
* The initial description to show in the input when it is loaded
*/
initialFilesDescription?: string;
};

export const DragFileUploadInput = forwardRef<DragFileUploadInputRef, DragFileUploadInputProps>(
Expand All @@ -67,6 +71,7 @@ export const DragFileUploadInput = forwardRef<DragFileUploadInputRef, DragFileUp
onError,
onReset: onResetProps,
translations: translationsProps,
initialFilesDescription,
...props
}: DragFileUploadInputProps,
ref
Expand All @@ -81,7 +86,7 @@ export const DragFileUploadInput = forwardRef<DragFileUploadInputRef, DragFileUp
// Create a state for whether or not the user is currently dragging
const [isDragging, setIsDragging] = useState(false);

const [filesDescription, setFilesDescription] = useState<string | undefined>();
const [filesDescription, setFilesDescription] = useState<string | undefined>(initialFilesDescription);
const [error, setError] = useState<string | undefined>();

// Create a reference of the container element
Expand Down

0 comments on commit d5f9d23

Please sign in to comment.