@canonical/react-ds-global-form 0.47.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -6
- package/dist/esm/density.css +23 -28
- package/dist/esm/index.css +28 -13
- package/dist/esm/lib/{component → _work_in_progress/component}/ColorField/ColorField.js +2 -2
- package/dist/esm/lib/_work_in_progress/component/ColorField/ColorField.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/component/ColorField/index.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/component/ColorField/types.js.map +1 -0
- package/dist/esm/lib/{component → _work_in_progress/component}/ComboboxField/ComboboxField.js +2 -2
- package/dist/esm/lib/_work_in_progress/component/ComboboxField/ComboboxField.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/component/ComboboxField/index.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/component/ComboboxField/types.js.map +1 -0
- package/dist/esm/lib/{component → _work_in_progress/component}/RatingField/RatingField.js +2 -2
- package/dist/esm/lib/_work_in_progress/component/RatingField/RatingField.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/component/RatingField/index.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/component/RatingField/types.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ColorInput/ColorInput.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ColorInput/index.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ColorInput/types.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/ComboboxInput.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/MultipleCombobox.js +198 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/MultipleCombobox.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/SingleCombobox.js +120 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/SingleCombobox.js.map +1 -0
- package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/List.js +16 -4
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/List.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/index.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/types.js.map +1 -0
- package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/ResetButton.js +2 -2
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/ResetButton.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/index.js.map +1 -0
- package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/styles.css +3 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/types.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/index.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/constants.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/index.js.map +1 -0
- package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/messages.js +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/messages.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/types.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/convertItemToString.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/convertValueToItem.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/filterItems.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/index.js +7 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/index.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/isPromise.js +6 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/isPromise.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/settleLookup.js +10 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/settleLookup.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/stopPageMovesAtEnds.js +25 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/stopPageMovesAtEnds.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/RatingInput/RatingInput.js.map +1 -0
- package/dist/esm/lib/_work_in_progress/subcomponent/RatingInput/index.js.map +1 -0
- package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/styles.css +7 -7
- package/dist/esm/lib/_work_in_progress/subcomponent/RatingInput/types.js.map +1 -0
- package/dist/esm/lib/common/Wrapper/InvisibleWrapper.js +3 -1
- package/dist/esm/lib/common/Wrapper/InvisibleWrapper.js.map +1 -1
- package/dist/esm/lib/common/Wrapper/ToggleWrapper.css +0 -6
- package/dist/esm/lib/common/Wrapper/ToggleWrapper.js +2 -1
- package/dist/esm/lib/common/Wrapper/ToggleWrapper.js.map +1 -1
- package/dist/esm/lib/common/Wrapper/Wrapper.js +10 -6
- package/dist/esm/lib/common/Wrapper/Wrapper.js.map +1 -1
- package/dist/esm/lib/common/Wrapper/createMiddleware.js +70 -0
- package/dist/esm/lib/common/Wrapper/createMiddleware.js.map +1 -0
- package/dist/esm/lib/common/Wrapper/hooks/useFieldWrapper.js +2 -2
- package/dist/esm/lib/common/Wrapper/hooks/useFieldWrapper.js.map +1 -1
- package/dist/esm/lib/common/Wrapper/withConditionalDisplay.js +17 -12
- package/dist/esm/lib/common/Wrapper/withConditionalDisplay.js.map +1 -1
- package/dist/esm/lib/common/Wrapper/withWrapper.js +16 -10
- package/dist/esm/lib/common/Wrapper/withWrapper.js.map +1 -1
- package/dist/esm/lib/component/ChoicesField/Choices.js +2 -2
- package/dist/esm/lib/component/ChoicesField/Choices.js.map +1 -1
- package/dist/esm/lib/component/ChoicesField/ChoicesField.js +3 -2
- package/dist/esm/lib/component/ChoicesField/ChoicesField.js.map +1 -1
- package/dist/esm/lib/component/ChoicesField/styles.css +3 -65
- package/dist/esm/lib/component/DateTimeField/DateTimeField.js +2 -1
- package/dist/esm/lib/component/DateTimeField/DateTimeField.js.map +1 -1
- package/dist/esm/lib/component/FileUploadField/FileUploadField.js +45 -41
- package/dist/esm/lib/component/FileUploadField/FileUploadField.js.map +1 -1
- package/dist/esm/lib/component/FileUploadField/fileUploadRules.js +39 -0
- package/dist/esm/lib/component/FileUploadField/fileUploadRules.js.map +1 -0
- package/dist/esm/lib/component/FileUploadField/styles.css +30 -0
- package/dist/esm/lib/component/RichChoicesField/RichChoices.js +2 -2
- package/dist/esm/lib/component/RichChoicesField/RichChoices.js.map +1 -1
- package/dist/esm/lib/component/RichChoicesField/RichChoicesField.js +2 -2
- package/dist/esm/lib/component/index.js +5 -4
- package/dist/esm/lib/component/index.js.map +1 -1
- package/dist/esm/lib/index.js.map +1 -1
- package/dist/esm/lib/pattern/Field/Field.js +3 -3
- package/dist/esm/lib/pattern/Field/Field.js.map +1 -1
- package/dist/esm/lib/subcomponent/DateInput/styles.css +16 -0
- package/dist/esm/lib/subcomponent/DateTimeInput/styles.css +24 -7
- package/dist/esm/lib/subcomponent/Field/Description/Description.js +1 -3
- package/dist/esm/lib/subcomponent/Field/Description/Description.js.map +1 -1
- package/dist/esm/lib/subcomponent/Field/Description/styles.css +4 -0
- package/dist/esm/lib/subcomponent/Field/Error/Error.js +4 -4
- package/dist/esm/lib/subcomponent/Field/Error/Error.js.map +1 -1
- package/dist/esm/lib/subcomponent/Field/Error/styles.css +8 -0
- package/dist/esm/lib/subcomponent/Field/Label/styles.css +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/FileUploadInput.js +119 -64
- package/dist/esm/lib/subcomponent/FileUploadInput/FileUploadInput.js.map +1 -1
- package/dist/esm/lib/subcomponent/FileUploadInput/common/FileItem/FileItem.js +52 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/common/FileItem/FileItem.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/common/FileItem/index.js +2 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/common/FileItem/index.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/common/FileItem/types.js +2 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/common/FileItem/types.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/common/Thumbnail/Thumbnail.js +40 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/common/Thumbnail/Thumbnail.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/common/Thumbnail/index.js +2 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/common/Thumbnail/index.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/common/Thumbnail/types.js +2 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/common/Thumbnail/types.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/constants.js +3 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/constants.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/hooks/index.js +3 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/hooks/index.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/hooks/useFileUploads.js +148 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/hooks/useFileUploads.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/hooks/useObjectUrl.js +22 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/hooks/useObjectUrl.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/messages.js +25 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/messages.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/styles.css +255 -94
- package/dist/esm/lib/subcomponent/FileUploadInput/utils/formatFileSize.js +21 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/utils/formatFileSize.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/utils/getFileMessage.js +20 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/utils/getFileMessage.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/utils/index.js +4 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/utils/index.js.map +1 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/utils/matchesAccept.js +26 -0
- package/dist/esm/lib/subcomponent/FileUploadInput/utils/matchesAccept.js.map +1 -0
- package/dist/esm/lib/subcomponent/NumberInput/NumberInput.js +1 -1
- package/dist/esm/lib/subcomponent/NumberInput/NumberInput.js.map +1 -1
- package/dist/esm/lib/subcomponent/NumberInput/styles.css +17 -0
- package/dist/esm/lib/subcomponent/PasswordInput/styles.css +7 -1
- package/dist/esm/lib/subcomponent/PhoneInput/PhoneInput.js +8 -2
- package/dist/esm/lib/subcomponent/PhoneInput/PhoneInput.js.map +1 -1
- package/dist/esm/lib/subcomponent/RadioInput/styles.css +15 -13
- package/dist/esm/lib/subcomponent/TextInput/TextInput.js +3 -1
- package/dist/esm/lib/subcomponent/TextInput/TextInput.js.map +1 -1
- package/dist/esm/lib/subcomponent/index.js +5 -5
- package/dist/esm/lib/subcomponent/index.js.map +1 -1
- package/dist/esm/lib/utils/hooks/useFieldAriaProperties.js +6 -4
- package/dist/esm/lib/utils/hooks/useFieldAriaProperties.js.map +1 -1
- package/dist/esm/lib/utils/hooks/useOptionAriaProperties.js +3 -3
- package/dist/esm/lib/utils/hooks/useOptionAriaProperties.js.map +1 -1
- package/dist/esm/lib/utils/middleware/addRESTOptions.js +99 -39
- package/dist/esm/lib/utils/middleware/addRESTOptions.js.map +1 -1
- package/dist/esm/lib/utils/middleware/addRESTValidation.js +246 -32
- package/dist/esm/lib/utils/middleware/addRESTValidation.js.map +1 -1
- package/dist/esm/lib/utils/middleware/index.js +1 -0
- package/dist/esm/lib/utils/middleware/index.js.map +1 -1
- package/dist/esm/testing/expectNoAxeViolations.js +30 -0
- package/dist/esm/testing/expectNoAxeViolations.js.map +1 -0
- package/dist/types/lib/{component → _work_in_progress/component}/ColorField/ColorField.d.ts +7 -12
- package/dist/types/lib/_work_in_progress/component/ColorField/ColorField.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/component/ColorField/index.d.ts.map +1 -0
- package/dist/types/lib/{component → _work_in_progress/component}/ColorField/types.d.ts +1 -1
- package/dist/types/lib/_work_in_progress/component/ColorField/types.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/component/ComboboxField/ComboboxField.d.ts +53 -0
- package/dist/types/lib/_work_in_progress/component/ComboboxField/ComboboxField.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/component/ComboboxField/index.d.ts.map +1 -0
- package/dist/types/lib/{component → _work_in_progress/component}/ComboboxField/types.d.ts +1 -1
- package/dist/types/lib/_work_in_progress/component/ComboboxField/types.d.ts.map +1 -0
- package/dist/types/lib/{component → _work_in_progress/component}/RatingField/RatingField.d.ts +7 -12
- package/dist/types/lib/_work_in_progress/component/RatingField/RatingField.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/component/RatingField/index.d.ts.map +1 -0
- package/dist/types/lib/{component → _work_in_progress/component}/RatingField/types.d.ts +1 -1
- package/dist/types/lib/_work_in_progress/component/RatingField/types.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ColorInput/ColorInput.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ColorInput/index.d.ts.map +1 -0
- package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/types.d.ts +1 -1
- package/dist/types/lib/_work_in_progress/subcomponent/ColorInput/types.d.ts.map +1 -0
- package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/ComboboxInput.d.ts +13 -5
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/ComboboxInput.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/MultipleCombobox.d.ts +24 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/MultipleCombobox.d.ts.map +1 -0
- package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/SingleCombobox.d.ts +19 -4
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/SingleCombobox.d.ts.map +1 -0
- package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/List.d.ts +1 -1
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/List.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/index.d.ts.map +1 -0
- package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/types.d.ts +2 -1
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/types.d.ts.map +1 -0
- package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/ResetButton.d.ts +1 -1
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/ResetButton.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/index.d.ts.map +1 -0
- package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/types.d.ts +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/types.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/index.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/constants.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/index.d.ts.map +1 -0
- package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/messages.d.ts +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/messages.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/types.d.ts +52 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/types.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/convertItemToString.d.ts +4 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/convertItemToString.d.ts.map +1 -0
- package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/utils/convertValueToItem.d.ts +1 -1
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/convertValueToItem.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/filterItems.d.ts +4 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/filterItems.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/index.d.ts +7 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/index.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/isPromise.d.ts +4 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/isPromise.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/settleLookup.d.ts +8 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/settleLookup.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/stopPageMovesAtEnds.d.ts +13 -0
- package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/stopPageMovesAtEnds.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/RatingInput/RatingInput.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/RatingInput/index.d.ts.map +1 -0
- package/dist/types/lib/_work_in_progress/subcomponent/RatingInput/types.d.ts.map +1 -0
- package/dist/types/lib/common/Wrapper/InvisibleWrapper.d.ts.map +1 -1
- package/dist/types/lib/common/Wrapper/ToggleWrapper.d.ts.map +1 -1
- package/dist/types/lib/common/Wrapper/Wrapper.d.ts +1 -1
- package/dist/types/lib/common/Wrapper/Wrapper.d.ts.map +1 -1
- package/dist/types/lib/common/Wrapper/createMiddleware.d.ts +43 -0
- package/dist/types/lib/common/Wrapper/createMiddleware.d.ts.map +1 -0
- package/dist/types/lib/common/Wrapper/hooks/useFieldWrapper.d.ts +2 -0
- package/dist/types/lib/common/Wrapper/hooks/useFieldWrapper.d.ts.map +1 -1
- package/dist/types/lib/common/Wrapper/withConditionalDisplay.d.ts +9 -3
- package/dist/types/lib/common/Wrapper/withConditionalDisplay.d.ts.map +1 -1
- package/dist/types/lib/common/Wrapper/withWrapper.d.ts +3 -5
- package/dist/types/lib/common/Wrapper/withWrapper.d.ts.map +1 -1
- package/dist/types/lib/common/types.d.ts +19 -7
- package/dist/types/lib/common/types.d.ts.map +1 -1
- package/dist/types/lib/component/ChoicesField/Choices.d.ts +1 -1
- package/dist/types/lib/component/ChoicesField/Choices.d.ts.map +1 -1
- package/dist/types/lib/component/ChoicesField/ChoicesField.d.ts +9 -13
- package/dist/types/lib/component/ChoicesField/ChoicesField.d.ts.map +1 -1
- package/dist/types/lib/component/ChoicesField/types.d.ts +2 -2
- package/dist/types/lib/component/ChoicesField/types.d.ts.map +1 -1
- package/dist/types/lib/component/DateField/DateField.d.ts +6 -11
- package/dist/types/lib/component/DateTimeField/DateTimeField.d.ts +7 -11
- package/dist/types/lib/component/DateTimeField/DateTimeField.d.ts.map +1 -1
- package/dist/types/lib/component/FileUploadField/FileUploadField.d.ts +299 -19
- package/dist/types/lib/component/FileUploadField/FileUploadField.d.ts.map +1 -1
- package/dist/types/lib/component/FileUploadField/fileUploadRules.d.ts +24 -0
- package/dist/types/lib/component/FileUploadField/fileUploadRules.d.ts.map +1 -0
- package/dist/types/lib/component/HiddenField/HiddenField.d.ts +6 -11
- package/dist/types/lib/component/NumberField/NumberField.d.ts +6 -11
- package/dist/types/lib/component/PasswordField/PasswordField.d.ts +6 -11
- package/dist/types/lib/component/PhoneField/PhoneField.d.ts +7 -11
- package/dist/types/lib/component/RangeField/RangeField.d.ts +6 -11
- package/dist/types/lib/component/RichChoicesField/RichChoices.d.ts +1 -1
- package/dist/types/lib/component/RichChoicesField/RichChoices.d.ts.map +1 -1
- package/dist/types/lib/component/RichChoicesField/RichChoicesField.d.ts +8 -13
- package/dist/types/lib/component/RichChoicesField/types.d.ts +2 -2
- package/dist/types/lib/component/RichChoicesField/types.d.ts.map +1 -1
- package/dist/types/lib/component/SelectField/SelectField.d.ts +6 -11
- package/dist/types/lib/component/TextField/TextField.d.ts +6 -11
- package/dist/types/lib/component/TextareaField/TextareaField.d.ts +6 -11
- package/dist/types/lib/component/TimeField/TimeField.d.ts +6 -11
- package/dist/types/lib/component/index.d.ts +3 -3
- package/dist/types/lib/component/index.d.ts.map +1 -1
- package/dist/types/lib/index.d.ts +1 -1
- package/dist/types/lib/index.d.ts.map +1 -1
- package/dist/types/lib/pattern/Field/types.d.ts +4 -4
- package/dist/types/lib/pattern/Field/types.d.ts.map +1 -1
- package/dist/types/lib/subcomponent/Field/Description/Description.d.ts.map +1 -1
- package/dist/types/lib/subcomponent/Field/Error/Error.d.ts.map +1 -1
- package/dist/types/lib/subcomponent/FileUploadInput/FileUploadInput.d.ts +25 -4
- package/dist/types/lib/subcomponent/FileUploadInput/FileUploadInput.d.ts.map +1 -1
- package/dist/types/lib/subcomponent/FileUploadInput/common/FileItem/FileItem.d.ts +15 -0
- package/dist/types/lib/subcomponent/FileUploadInput/common/FileItem/FileItem.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/common/FileItem/index.d.ts +3 -0
- package/dist/types/lib/subcomponent/FileUploadInput/common/FileItem/index.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/common/FileItem/types.d.ts +28 -0
- package/dist/types/lib/subcomponent/FileUploadInput/common/FileItem/types.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/common/Thumbnail/Thumbnail.d.ts +14 -0
- package/dist/types/lib/subcomponent/FileUploadInput/common/Thumbnail/Thumbnail.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/common/Thumbnail/index.d.ts +3 -0
- package/dist/types/lib/subcomponent/FileUploadInput/common/Thumbnail/index.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/common/Thumbnail/types.d.ts +9 -0
- package/dist/types/lib/subcomponent/FileUploadInput/common/Thumbnail/types.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/constants.d.ts +3 -0
- package/dist/types/lib/subcomponent/FileUploadInput/constants.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/hooks/index.d.ts +3 -0
- package/dist/types/lib/subcomponent/FileUploadInput/hooks/index.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/hooks/useFileUploads.d.ts +33 -0
- package/dist/types/lib/subcomponent/FileUploadInput/hooks/useFileUploads.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/hooks/useObjectUrl.d.ts +8 -0
- package/dist/types/lib/subcomponent/FileUploadInput/hooks/useObjectUrl.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/index.d.ts +1 -1
- package/dist/types/lib/subcomponent/FileUploadInput/index.d.ts.map +1 -1
- package/dist/types/lib/subcomponent/FileUploadInput/messages.d.ts +4 -0
- package/dist/types/lib/subcomponent/FileUploadInput/messages.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/types.d.ts +165 -8
- package/dist/types/lib/subcomponent/FileUploadInput/types.d.ts.map +1 -1
- package/dist/types/lib/subcomponent/FileUploadInput/utils/formatFileSize.d.ts +7 -0
- package/dist/types/lib/subcomponent/FileUploadInput/utils/formatFileSize.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/utils/getFileMessage.d.ts +14 -0
- package/dist/types/lib/subcomponent/FileUploadInput/utils/getFileMessage.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/utils/index.d.ts +5 -0
- package/dist/types/lib/subcomponent/FileUploadInput/utils/index.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/FileUploadInput/utils/matchesAccept.d.ts +10 -0
- package/dist/types/lib/subcomponent/FileUploadInput/utils/matchesAccept.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/PhoneInput/PhoneInput.d.ts +12 -0
- package/dist/types/lib/subcomponent/PhoneInput/PhoneInput.d.ts.map +1 -1
- package/dist/types/lib/subcomponent/PhoneInput/types.d.ts +11 -2
- package/dist/types/lib/subcomponent/PhoneInput/types.d.ts.map +1 -1
- package/dist/types/lib/subcomponent/TextInput/TextInput.d.ts +2 -0
- package/dist/types/lib/subcomponent/TextInput/TextInput.d.ts.map +1 -1
- package/dist/types/lib/subcomponent/index.d.ts +7 -7
- package/dist/types/lib/subcomponent/index.d.ts.map +1 -1
- package/dist/types/lib/subcomponent/types.d.ts +6 -0
- package/dist/types/lib/subcomponent/types.d.ts.map +1 -1
- package/dist/types/lib/utils/hooks/useFieldAriaProperties.d.ts +2 -1
- package/dist/types/lib/utils/hooks/useFieldAriaProperties.d.ts.map +1 -1
- package/dist/types/lib/utils/hooks/useOptionAriaProperties.d.ts +3 -2
- package/dist/types/lib/utils/hooks/useOptionAriaProperties.d.ts.map +1 -1
- package/dist/types/lib/utils/middleware/addRESTOptions.d.ts +37 -4
- package/dist/types/lib/utils/middleware/addRESTOptions.d.ts.map +1 -1
- package/dist/types/lib/utils/middleware/addRESTValidation.d.ts +38 -3
- package/dist/types/lib/utils/middleware/addRESTValidation.d.ts.map +1 -1
- package/dist/types/lib/utils/middleware/index.d.ts +2 -0
- package/dist/types/lib/utils/middleware/index.d.ts.map +1 -1
- package/dist/types/testing/expectNoAxeViolations.d.ts +10 -0
- package/dist/types/testing/expectNoAxeViolations.d.ts.map +1 -0
- package/package.json +18 -17
- package/dist/esm/lib/component/ColorField/ColorField.js.map +0 -1
- package/dist/esm/lib/component/ColorField/index.js.map +0 -1
- package/dist/esm/lib/component/ColorField/types.js.map +0 -1
- package/dist/esm/lib/component/ComboboxField/ComboboxField.js.map +0 -1
- package/dist/esm/lib/component/ComboboxField/index.js.map +0 -1
- package/dist/esm/lib/component/ComboboxField/types.js.map +0 -1
- package/dist/esm/lib/component/RatingField/RatingField.js.map +0 -1
- package/dist/esm/lib/component/RatingField/index.js.map +0 -1
- package/dist/esm/lib/component/RatingField/types.js.map +0 -1
- package/dist/esm/lib/subcomponent/ColorInput/ColorInput.js.map +0 -1
- package/dist/esm/lib/subcomponent/ColorInput/index.js.map +0 -1
- package/dist/esm/lib/subcomponent/ColorInput/types.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/ComboboxInput.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/MultipleCombobox.js +0 -84
- package/dist/esm/lib/subcomponent/ComboboxInput/MultipleCombobox.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/SingleCombobox.js +0 -67
- package/dist/esm/lib/subcomponent/ComboboxInput/SingleCombobox.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/common/List/List.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/common/List/index.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/common/List/types.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/common/ResetButton/ResetButton.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/common/ResetButton/index.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/common/ResetButton/types.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/common/index.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/constants.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/index.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/messages.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/types.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/utils/convertItemToString.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/utils/convertValueToItem.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/utils/filterItems.js.map +0 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/utils/index.js +0 -4
- package/dist/esm/lib/subcomponent/ComboboxInput/utils/index.js.map +0 -1
- package/dist/esm/lib/subcomponent/RatingInput/RatingInput.js.map +0 -1
- package/dist/esm/lib/subcomponent/RatingInput/index.js.map +0 -1
- package/dist/esm/lib/subcomponent/RatingInput/types.js.map +0 -1
- package/dist/types/lib/component/ColorField/ColorField.d.ts.map +0 -1
- package/dist/types/lib/component/ColorField/index.d.ts.map +0 -1
- package/dist/types/lib/component/ColorField/types.d.ts.map +0 -1
- package/dist/types/lib/component/ComboboxField/ComboboxField.d.ts +0 -56
- package/dist/types/lib/component/ComboboxField/ComboboxField.d.ts.map +0 -1
- package/dist/types/lib/component/ComboboxField/index.d.ts.map +0 -1
- package/dist/types/lib/component/ComboboxField/types.d.ts.map +0 -1
- package/dist/types/lib/component/RatingField/RatingField.d.ts.map +0 -1
- package/dist/types/lib/component/RatingField/index.d.ts.map +0 -1
- package/dist/types/lib/component/RatingField/types.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ColorInput/ColorInput.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ColorInput/index.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ColorInput/types.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/ComboboxInput.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/MultipleCombobox.d.ts +0 -16
- package/dist/types/lib/subcomponent/ComboboxInput/MultipleCombobox.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/SingleCombobox.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/common/List/List.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/common/List/index.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/common/List/types.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/common/ResetButton/ResetButton.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/common/ResetButton/index.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/common/ResetButton/types.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/common/index.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/constants.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/index.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/messages.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/types.d.ts +0 -27
- package/dist/types/lib/subcomponent/ComboboxInput/types.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/utils/convertItemToString.d.ts +0 -4
- package/dist/types/lib/subcomponent/ComboboxInput/utils/convertItemToString.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/utils/convertValueToItem.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/utils/filterItems.d.ts +0 -4
- package/dist/types/lib/subcomponent/ComboboxInput/utils/filterItems.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/ComboboxInput/utils/index.d.ts +0 -4
- package/dist/types/lib/subcomponent/ComboboxInput/utils/index.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/RatingInput/RatingInput.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/RatingInput/index.d.ts.map +0 -1
- package/dist/types/lib/subcomponent/RatingInput/types.d.ts.map +0 -1
- /package/dist/esm/lib/{component → _work_in_progress/component}/ColorField/index.js +0 -0
- /package/dist/esm/lib/{component → _work_in_progress/component}/ColorField/types.js +0 -0
- /package/dist/esm/lib/{component → _work_in_progress/component}/ComboboxField/index.js +0 -0
- /package/dist/esm/lib/{component → _work_in_progress/component}/ComboboxField/types.js +0 -0
- /package/dist/esm/lib/{component → _work_in_progress/component}/RatingField/index.js +0 -0
- /package/dist/esm/lib/{component → _work_in_progress/component}/RatingField/types.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/ColorInput.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/index.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/styles.css +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/types.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/ComboboxInput.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/index.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/styles.css +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/types.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/index.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/types.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/index.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/constants.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/index.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/styles.css +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/types.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/utils/convertItemToString.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/utils/convertValueToItem.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/utils/filterItems.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/RatingInput.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/index.js +0 -0
- /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/types.js +0 -0
- /package/dist/types/lib/{component → _work_in_progress/component}/ColorField/index.d.ts +0 -0
- /package/dist/types/lib/{component → _work_in_progress/component}/ComboboxField/index.d.ts +0 -0
- /package/dist/types/lib/{component → _work_in_progress/component}/RatingField/index.d.ts +0 -0
- /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/ColorInput.d.ts +0 -0
- /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/index.d.ts +0 -0
- /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/index.d.ts +0 -0
- /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/index.d.ts +0 -0
- /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/index.d.ts +0 -0
- /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/constants.d.ts +0 -0
- /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/index.d.ts +0 -0
- /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/RatingInput.d.ts +0 -0
- /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/index.d.ts +0 -0
- /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/types.d.ts +0 -0
|
@@ -16,14 +16,31 @@
|
|
|
16
16
|
display: none;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
&,
|
|
20
|
+
&::-webkit-datetime-edit-text,
|
|
21
|
+
&::-webkit-datetime-edit-month-field,
|
|
22
|
+
&::-webkit-datetime-edit-day-field,
|
|
23
|
+
&::-webkit-datetime-edit-year-field,
|
|
24
|
+
&::-webkit-datetime-edit-hour-field,
|
|
25
|
+
&::-webkit-datetime-edit-minute-field,
|
|
26
|
+
&::-webkit-datetime-edit-ampm-field {
|
|
27
|
+
color: var(--form-input-color-mask);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:valid,
|
|
31
|
+
&:valid::-webkit-datetime-edit-text,
|
|
32
|
+
&:valid::-webkit-datetime-edit-month-field,
|
|
33
|
+
&:valid::-webkit-datetime-edit-day-field,
|
|
34
|
+
&:valid::-webkit-datetime-edit-year-field,
|
|
35
|
+
&:valid::-webkit-datetime-edit-hour-field,
|
|
36
|
+
&:valid::-webkit-datetime-edit-minute-field,
|
|
37
|
+
&:valid::-webkit-datetime-edit-ampm-field {
|
|
38
|
+
color: var(--form-input-color);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* NOTE (design review) — native-<input type="datetime-local"> limit
|
|
20
42
|
* parked for Diana:
|
|
21
|
-
*
|
|
22
|
-
* placeholder attribute (so `:placeholder-shown` never matches), and
|
|
23
|
-
* `::-webkit-datetime-edit` colours the whole edit region — mask AND typed
|
|
24
|
-
* value — with no empty-state selector, and Firefox ignores it. Needs a
|
|
25
|
-
* custom (non-native) control or a JS empty-state hook.
|
|
26
|
-
* 2. Calendar/clock indicator → pragma icon: no calendar/clock glyph exists in
|
|
43
|
+
* Calendar/clock indicator → pragma icon: no calendar/clock glyph exists in
|
|
27
44
|
* @canonical/ds-assets to mask onto `::-webkit-calendar-picker-indicator`,
|
|
28
45
|
* and that pseudo-element is WebKit/Chromium-only (Firefox draws its own,
|
|
29
46
|
* unstyleable). Needs a new ds-assets glyph + Chrome/Safari-only styling, or
|
|
@@ -8,9 +8,7 @@ const componentCssClassName = "ds field-description";
|
|
|
8
8
|
* `import { Description } from "@canonical/react-ds-global-form";`
|
|
9
9
|
*/
|
|
10
10
|
const Description = ({ id, children, className, style, }) => {
|
|
11
|
-
return (_jsx("p", { id: id, style: style, className: [componentCssClassName, "
|
|
12
|
-
.filter(Boolean)
|
|
13
|
-
.join(" "), children: children }));
|
|
11
|
+
return (_jsx("p", { id: id, style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), children: children }));
|
|
14
12
|
};
|
|
15
13
|
/**
|
|
16
14
|
* @implements ds:global.subcomponent.field-description
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../../../../src/lib/subcomponent/Field/Description/Description.tsx"],"names":[],"mappings":";AAGA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,GAAG,CAAC,EACnB,EAAE,EACF,QAAQ,EACR,SAAS,EACT,KAAK,GACY,EAAsB,EAAE;IACzC,OAAO,CACL,YACE,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../../../../src/lib/subcomponent/Field/Description/Description.tsx"],"names":[],"mappings":";AAGA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,GAAG,CAAC,EACnB,EAAE,EACF,QAAQ,EACR,SAAS,EACT,KAAK,GACY,EAAsB,EAAE;IACzC,OAAO,CACL,YACE,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,YAEtE,QAAQ,GACP,CACL,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,eAAe,WAAW,CAAC"}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
@layer ds.components.global {
|
|
4
4
|
.ds.field-description {
|
|
5
5
|
color: var(--form-description-color);
|
|
6
|
+
font-size: var(--form-description-font-size);
|
|
7
|
+
font-weight: var(--form-description-font-weight);
|
|
8
|
+
line-height: var(--form-description-line-height);
|
|
9
|
+
letter-spacing: var(--form-description-letter-spacing);
|
|
6
10
|
/* Align to the field edge like the label (no side padding by default), not
|
|
7
11
|
* to the input's inner padding. Overridable via the shared variable. */
|
|
8
12
|
padding-inline: var(--form-label-padding-inline, 0);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/* @canonical/generator-ds 0.9.0-experimental.9 */
|
|
3
|
+
import { Icon } from "@canonical/react-ds-global";
|
|
2
4
|
import "./styles.css";
|
|
3
5
|
const componentCssClassName = "ds field-error";
|
|
4
6
|
/**
|
|
@@ -8,9 +10,7 @@ const componentCssClassName = "ds field-error";
|
|
|
8
10
|
* `import { Error } from "@canonical/react-ds-global-form";`
|
|
9
11
|
*/
|
|
10
12
|
const FieldError = ({ id, children, className, style, }) => {
|
|
11
|
-
return (
|
|
12
|
-
.filter(Boolean)
|
|
13
|
-
.join(" "), role: "alert", children: children }));
|
|
13
|
+
return (_jsxs("p", { id: id, style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), role: "alert", children: [_jsx(Icon, { icon: "error" }), children] }));
|
|
14
14
|
};
|
|
15
15
|
export default FieldError;
|
|
16
16
|
//# sourceMappingURL=Error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Error.js","sourceRoot":"","sources":["../../../../../../src/lib/subcomponent/Field/Error/Error.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Error.js","sourceRoot":"","sources":["../../../../../../src/lib/subcomponent/Field/Error/Error.tsx"],"names":[],"mappings":";AAAA,kDAAkD;AAElD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAGlD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,EAClB,EAAE,EACF,QAAQ,EACR,SAAS,EACT,KAAK,GACM,EAAsB,EAAE;IACnC,OAAO,CACL,aACE,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,IAAI,EAAC,OAAO,aAIZ,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,EACpB,QAAQ,IACP,CACL,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -3,8 +3,16 @@
|
|
|
3
3
|
@layer ds.components.global {
|
|
4
4
|
.ds.field-error {
|
|
5
5
|
color: var(--form-error-color);
|
|
6
|
+
font-size: var(--form-error-font-size);
|
|
7
|
+
font-weight: var(--form-error-font-weight);
|
|
8
|
+
line-height: var(--form-error-line-height);
|
|
9
|
+
letter-spacing: var(--form-error-letter-spacing);
|
|
6
10
|
/* Align to the field edge like the label (no side padding by default), not
|
|
7
11
|
* to the input's inner padding. Overridable via the shared variable. */
|
|
8
12
|
padding-inline: var(--form-label-padding-inline, 0);
|
|
13
|
+
|
|
14
|
+
& > .ds.icon {
|
|
15
|
+
margin-inline-end: var(--space-050);
|
|
16
|
+
}
|
|
9
17
|
}
|
|
10
18
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
.ds.field-label {
|
|
5
5
|
font-weight: var(--form-label-font-weight, normal);
|
|
6
6
|
color: var(--form-label-color);
|
|
7
|
+
font-size: var(--form-label-font-size);
|
|
7
8
|
/* No side padding by default — the label aligns to the field edge, not the
|
|
8
9
|
* input's inner padding. Overridable via the variable. */
|
|
9
10
|
padding-inline: var(--form-label-padding-inline, 0);
|
|
@@ -1,85 +1,140 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Button } from "@canonical/react-ds-global";
|
|
3
|
+
import { useCallback, useEffect, useId, useMemo, useRef, useState, } from "react";
|
|
4
|
+
import { FileItem } from "./common/FileItem/index.js";
|
|
5
|
+
import { useFileUploads } from "./hooks/index.js";
|
|
6
|
+
import defaultMessages from "./messages.js";
|
|
7
|
+
import { getFileMessage } from "./utils/index.js";
|
|
3
8
|
import "./styles.css";
|
|
4
9
|
const componentCssClassName = "ds input file-upload";
|
|
10
|
+
const EMPTY = [];
|
|
5
11
|
/**
|
|
6
|
-
* Presentational file upload input
|
|
7
|
-
*
|
|
8
|
-
* field tier supplies the binding.
|
|
12
|
+
* Presentational file upload input: a drop area, with a button that opens the
|
|
13
|
+
* file picker, and the list of chosen files. Controlled via `value`/`onChange`
|
|
14
|
+
* (no react-hook-form); the field tier supplies the binding.
|
|
15
|
+
*
|
|
16
|
+
* Each file's tile shows its name, optional size and an image thumbnail, and
|
|
17
|
+
* any warning or error under it: `accept` and `maxSize` violations, the
|
|
18
|
+
* `validateFile` result, and a failed upload. With an `upload` function the
|
|
19
|
+
* input is live: it sends each valid file as soon as it is chosen and shows
|
|
20
|
+
* its progress, then its result for a moment. Closing a running upload cancels
|
|
21
|
+
* it and removes the file; a failed upload can be retried. Without `upload` it
|
|
22
|
+
* only lists the files. An image's thumbnail shows the whole image on hover.
|
|
23
|
+
*
|
|
24
|
+
* `showDropArea` and `showFileList` turn the two halves off. The field-level
|
|
25
|
+
* `error` shows whether or not the drop area does. While `error` is set or
|
|
26
|
+
* `aria-invalid` is true, the drop area carries the `error` Criticality
|
|
27
|
+
* class, so its border and fill read the error colours. Without the drop
|
|
28
|
+
* area, the file actions carry the field's `aria-describedby`.
|
|
29
|
+
*
|
|
30
|
+
* The native file `<input>` sits beside the drop area, not inside it, and
|
|
31
|
+
* carries the `id`, `name` and `required`, so a `<label for>` reaches it and
|
|
32
|
+
* the selection posts without scripting. Its files are kept in step with
|
|
33
|
+
* `value`, including files added by drag and drop. A plain HTML submission
|
|
34
|
+
* only sends files when the form has `enctype="multipart/form-data"`. Live
|
|
35
|
+
* upload needs scripting; without it the files post with the form.
|
|
9
36
|
* @returns {React.ReactElement} - Rendered FileUploadInput
|
|
10
37
|
*
|
|
11
38
|
* `import { FileUploadInput } from "@canonical/react-ds-global-form";`
|
|
12
39
|
*
|
|
13
40
|
* @implements ds:global.subcomponent.file_upload_input
|
|
14
41
|
*/
|
|
15
|
-
export const FileUploadInput = ({ id, className,
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
maxSize, maxFiles, multiple = false, disabled = false, ...otherProps }) => {
|
|
42
|
+
export const FileUploadInput = ({ id, className, value, onChange, accept, maxSize,
|
|
43
|
+
// The field reads `maxFiles` as a validation rule; the input does not drop
|
|
44
|
+
// files over the limit. Destructured so it is not spread onto the root.
|
|
45
|
+
maxFiles, multiple = false, disabled = false, name, required, upload, validateFile, showFileSize = true, showDropArea = true, showFileList = true, error, onUploadStatusChange, messages: messageOverrides, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-errormessage": ariaErrorMessage, ...otherProps }) => {
|
|
20
46
|
const inputRef = useRef(null);
|
|
21
47
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
const baseId = useId();
|
|
49
|
+
const buttonId = `${baseId}-choose`;
|
|
50
|
+
const files = Array.isArray(value) ? value : EMPTY;
|
|
51
|
+
const messages = useMemo(() => ({ ...defaultMessages, ...messageOverrides }), [messageOverrides]);
|
|
52
|
+
// A stable key per File object, for list keys and message ids, so the same
|
|
53
|
+
// file name chosen twice still gets two distinct tiles.
|
|
54
|
+
const fileKeys = useRef({ next: 0, keys: new WeakMap() });
|
|
55
|
+
const keyOf = (file) => {
|
|
56
|
+
const { keys } = fileKeys.current;
|
|
57
|
+
let key = keys.get(file);
|
|
58
|
+
if (key === undefined) {
|
|
59
|
+
key = fileKeys.current.next++;
|
|
60
|
+
keys.set(file, key);
|
|
61
|
+
}
|
|
62
|
+
return key;
|
|
63
|
+
};
|
|
64
|
+
const validationOf = useCallback((file) => getFileMessage(file, { accept, maxSize, validateFile }, messages), [accept, maxSize, validateFile, messages]);
|
|
65
|
+
const uploads = useFileUploads(files, {
|
|
66
|
+
upload,
|
|
67
|
+
canUpload: (file) => validationOf(file)?.level !== "error",
|
|
68
|
+
onSummaryChange: onUploadStatusChange,
|
|
69
|
+
});
|
|
70
|
+
// Mirror the controlled files into the native input, so a plain submission
|
|
71
|
+
// posts them and `required` sees them, whichever way they were added.
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
const input = inputRef.current;
|
|
74
|
+
if (!input || typeof DataTransfer === "undefined")
|
|
75
|
+
return;
|
|
76
|
+
const transfer = new DataTransfer();
|
|
77
|
+
for (const file of files)
|
|
78
|
+
transfer.items.add(file);
|
|
79
|
+
input.files = transfer.files;
|
|
80
|
+
}, [files]);
|
|
81
|
+
const addFiles = (incoming) => {
|
|
82
|
+
const added = Array.from(incoming);
|
|
83
|
+
onChange?.(multiple ? [...files, ...added] : added.slice(0, 1));
|
|
84
|
+
};
|
|
85
|
+
const removeFile = (file) => {
|
|
86
|
+
onChange?.(files.filter((chosen) => chosen !== file));
|
|
87
|
+
};
|
|
88
|
+
const handleDragOver = (event) => {
|
|
89
|
+
event.preventDefault();
|
|
90
|
+
if (!disabled)
|
|
40
91
|
setIsDragOver(true);
|
|
92
|
+
};
|
|
93
|
+
const handleDragLeave = (event) => {
|
|
94
|
+
// Moving onto a child (the text or the button) is not leaving the area.
|
|
95
|
+
if (event.currentTarget.contains(event.relatedTarget)) {
|
|
96
|
+
return;
|
|
41
97
|
}
|
|
42
|
-
}, [disabled]);
|
|
43
|
-
const handleDragLeave = useCallback(() => {
|
|
44
98
|
setIsDragOver(false);
|
|
45
|
-
}
|
|
46
|
-
const handleDrop =
|
|
47
|
-
|
|
99
|
+
};
|
|
100
|
+
const handleDrop = (event) => {
|
|
101
|
+
event.preventDefault();
|
|
48
102
|
setIsDragOver(false);
|
|
49
|
-
if (!disabled &&
|
|
50
|
-
addFiles(
|
|
51
|
-
}
|
|
52
|
-
}, [disabled, addFiles]);
|
|
53
|
-
const handleClick = useCallback(() => {
|
|
54
|
-
if (!disabled) {
|
|
55
|
-
inputRef.current?.click();
|
|
56
|
-
}
|
|
57
|
-
}, [disabled]);
|
|
58
|
-
const handleInputChange = useCallback((e) => {
|
|
59
|
-
if (e.target.files && e.target.files.length > 0) {
|
|
60
|
-
addFiles(e.target.files);
|
|
61
|
-
e.target.value = "";
|
|
103
|
+
if (!disabled && event.dataTransfer.files.length > 0) {
|
|
104
|
+
addFiles(event.dataTransfer.files);
|
|
62
105
|
}
|
|
63
|
-
}
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
-
|
|
106
|
+
};
|
|
107
|
+
const handleInputChange = (event) => {
|
|
108
|
+
if (event.target.files && event.target.files.length > 0) {
|
|
109
|
+
addFiles(event.target.files);
|
|
110
|
+
event.target.value = "";
|
|
68
111
|
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
112
|
+
};
|
|
113
|
+
// A disabled input draws no file list.
|
|
114
|
+
const fileListShown = showFileList && !disabled && files.length > 0;
|
|
115
|
+
// In single-file mode the drop area hides once a file is chosen and returns
|
|
116
|
+
// when the file is removed. It stays when the file list is not drawn, since
|
|
117
|
+
// nothing else could then remove the file.
|
|
118
|
+
const dropAreaShown = showDropArea && (multiple || files.length === 0 || !fileListShown);
|
|
119
|
+
// The group holds the drop area and the field error, and shows while either
|
|
120
|
+
// does: the error stays when the drop area is off or hidden.
|
|
121
|
+
const groupShown = dropAreaShown || Boolean(error);
|
|
122
|
+
// Without the Choose file button, the file actions carry the field's
|
|
123
|
+
// description and error, so the button that takes focus announces them.
|
|
124
|
+
const fieldDescribedBy = dropAreaShown ? undefined : ariaDescribedBy;
|
|
125
|
+
const isInvalid = Boolean(error) || ariaInvalid === true || ariaInvalid === "true";
|
|
126
|
+
return (_jsxs("div", { ...otherProps, className: [componentCssClassName, disabled && "disabled", className]
|
|
127
|
+
.filter(Boolean)
|
|
128
|
+
.join(" "), children: [groupShown && (_jsxs("div", { className: "drop-area-group", children: [dropAreaShown && (_jsxs("div", { className: [
|
|
129
|
+
"drop-area",
|
|
130
|
+
isDragOver && "drag-over",
|
|
131
|
+
isInvalid && "error",
|
|
132
|
+
]
|
|
133
|
+
.filter(Boolean)
|
|
134
|
+
.join(" "), onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [_jsx("span", { className: "drop-area-text", children: messages.dropAreaText() }), _jsx(Button, { type: "button", id: buttonId, importance: "secondary", icon: "upload", disabled: disabled, onClick: () => inputRef.current?.click(), "aria-labelledby": ariaLabelledBy ? `${ariaLabelledBy} ${buttonId}` : undefined, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-errormessage": ariaErrorMessage, children: messages.chooseFile(multiple) })] })), error] })), _jsx("input", { ref: inputRef, id: id, type: "file", name: name, required: required, accept: accept, multiple: multiple, disabled: disabled, onChange: handleInputChange, tabIndex: -1, "aria-hidden": "true" }), fileListShown && (_jsx("ul", { className: "file-list", children: files.map((file) => {
|
|
135
|
+
const key = keyOf(file);
|
|
136
|
+
return (_jsx(FileItem, { file: file, messageId: `${baseId}-file-${key}-message`, fieldDescribedBy: fieldDescribedBy, validation: validationOf(file), live: Boolean(upload), upload: uploads.states.get(file), showFileSize: showFileSize, messages: messages, onRemove: removeFile, onRetry: uploads.retry }, key));
|
|
137
|
+
}) }))] }));
|
|
75
138
|
};
|
|
76
|
-
/** Format bytes into a human-readable string. */
|
|
77
|
-
function formatFileSize(bytes) {
|
|
78
|
-
if (bytes < 1024)
|
|
79
|
-
return `${bytes} B`;
|
|
80
|
-
if (bytes < 1024 * 1024)
|
|
81
|
-
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
82
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
83
|
-
}
|
|
84
139
|
export default FileUploadInput;
|
|
85
140
|
//# sourceMappingURL=FileUploadInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploadInput.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/FileUploadInput/FileUploadInput.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FileUploadInput.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/FileUploadInput/FileUploadInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,eAAe,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAErD,MAAM,KAAK,GAAW,EAAE,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;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G,CAAC,IAAI,CAAC,EAChC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,OAAO,CAAC,KAAK,IAVjB,GAAG,CAWR,CACH,CAAC;gBACJ,CAAC,CAAC,GACC,CACN,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Icon, Spinner } from "@canonical/react-ds-global";
|
|
3
|
+
import useObjectUrl from "../../hooks/useObjectUrl.js";
|
|
4
|
+
import { Thumbnail } from "../Thumbnail/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* One chosen file: its tile (thumbnail, name, size, upload status, retry and
|
|
7
|
+
* remove) and the warning or error message under it. The message comes from
|
|
8
|
+
* the file's validation or its failed upload; an `accept`, `maxSize` or
|
|
9
|
+
* `validateFile` error wins, then an upload failure, then a warning.
|
|
10
|
+
*
|
|
11
|
+
* The tile carries the message's Criticality class (`warning` or `error`), so
|
|
12
|
+
* its surface, text, icons and action buttons read the matching colour
|
|
13
|
+
* channels.
|
|
14
|
+
*/
|
|
15
|
+
const FileItem = ({ file, messageId, fieldDescribedBy, validation, live, upload, showFileSize, messages, onRemove, onRetry, }) => {
|
|
16
|
+
const isUploading = upload?.status === "uploading";
|
|
17
|
+
const isFailed = upload?.status === "failed";
|
|
18
|
+
const isImage = file.type.startsWith("image/");
|
|
19
|
+
// Created here, not in the thumbnail, so the thumbnail and its preview share
|
|
20
|
+
// one URL.
|
|
21
|
+
const imageUrl = useObjectUrl(isImage ? file : undefined);
|
|
22
|
+
const uploadMessage = isFailed
|
|
23
|
+
? { level: "error", message: messages.uploadFailed(file, upload.reason) }
|
|
24
|
+
: undefined;
|
|
25
|
+
const message = validation?.level === "error" ? validation : (uploadMessage ?? validation);
|
|
26
|
+
const describedBy = message ? messageId : undefined;
|
|
27
|
+
const actionDescribedBy = [describedBy, fieldDescribedBy].filter(Boolean).join(" ") || undefined;
|
|
28
|
+
// The status holds the progress and one glyph: the spinner while the file
|
|
29
|
+
// uploads, then the result icon until the result stops showing.
|
|
30
|
+
let status = null;
|
|
31
|
+
if (upload?.status === "uploading") {
|
|
32
|
+
status = (_jsxs(_Fragment, { children: [_jsx("span", { className: "upload-progress", children: messages.progress(upload.progress) }), _jsx(Spinner, { "aria-label": messages.statusUploading(file.name) })] }));
|
|
33
|
+
}
|
|
34
|
+
else if (upload?.showResult) {
|
|
35
|
+
let icon = "success-fill";
|
|
36
|
+
let label = messages.statusUploaded(file.name);
|
|
37
|
+
if (upload.status === "failed") {
|
|
38
|
+
icon = "error-fill";
|
|
39
|
+
label = messages.statusFailed(file.name);
|
|
40
|
+
}
|
|
41
|
+
else if (message?.level === "warning") {
|
|
42
|
+
icon = "warning-fill";
|
|
43
|
+
label = messages.statusUploadedWithWarning(file.name);
|
|
44
|
+
}
|
|
45
|
+
status = (_jsxs(_Fragment, { children: [_jsx("span", { className: "upload-progress", children: messages.progress(upload.status === "failed" ? upload.progress : 1) }), _jsx(Icon, { icon: icon, "aria-label": label })] }));
|
|
46
|
+
}
|
|
47
|
+
return (_jsxs("li", { className: ["file-item", message?.level].filter(Boolean).join(" "), "aria-describedby": describedBy, children: [_jsxs("div", { className: "tile", children: [isImage && _jsx(Thumbnail, { url: imageUrl }), _jsxs("div", { className: "tile-details", children: [_jsxs("div", { className: "file-info", children: [_jsx("span", { className: "file-name", title: file.name, children: file.name }), showFileSize && (_jsx("span", { className: "file-size", children: messages.fileSize(file.size) }))] }), _jsxs("div", { className: "status-and-actions", children: [live && (_jsx("span", { className: "file-status", "aria-live": "polite", children: status })), _jsxs("div", { className: "file-actions", children: [isFailed && (_jsx(Button, { type: "button", importance: "tertiary", icon: "change-version", className: "file-action", "aria-label": messages.retryUpload(file.name), "aria-describedby": actionDescribedBy, onClick: () => onRetry(file) })), _jsx(Button, { type: "button", importance: "tertiary", icon: "close", className: "file-action", "aria-label": isUploading
|
|
48
|
+
? messages.cancelUpload(file.name)
|
|
49
|
+
: messages.remove(file.name), "aria-describedby": actionDescribedBy, onClick: () => onRemove(file) })] })] })] })] }), message && (_jsxs("p", { className: "file-message", id: messageId, children: [_jsx(Icon, { icon: message.level === "error" ? "error" : "warning", "aria-label": messages.messageLevel(message.level) }), _jsx("span", { className: "message-text", children: message.message })] }))] }));
|
|
50
|
+
};
|
|
51
|
+
export default FileItem;
|
|
52
|
+
//# sourceMappingURL=FileItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileItem.js","sourceRoot":"","sources":["../../../../../../../src/lib/subcomponent/FileUploadInput/common/FileItem/FileItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,YAAY,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD;;;;;;;;;GASG;AACH,MAAM,QAAQ,GAAG,CAAC,EAChB,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,OAAO,GACO,EAAsB,EAAE;IACtC,MAAM,WAAW,GAAG,MAAM,EAAE,MAAM,KAAK,WAAW,CAAC;IACnD,MAAM,QAAQ,GAAG,MAAM,EAAE,MAAM,KAAK,QAAQ,CAAC;IAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC/C,6EAA6E;IAC7E,WAAW;IACX,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAE1D,MAAM,aAAa,GAA4B,QAAQ;QAC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CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,sBACzB,iBAAiB,EACnC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAC5B,CACH,EAGD,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,UAAU,EAAC,UAAU,EACrB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,aAAa,gBAErB,WAAW;oDACT,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;oDAClC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,sBAEd,iBAAiB,EACnC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAC7B,IACE,IACF,IACF,IACF,EACL,OAAO,IAAI,CACV,aAAG,SAAS,EAAC,cAAc,EAAC,EAAE,EAAE,SAAS,aACvC,KAAC,IAAI,IACH,IAAI,EAAE,OAAO,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,gBACzC,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,GAChD,EACF,eAAM,SAAS,EAAC,cAAc,YAAE,OAAO,CAAC,OAAO,GAAQ,IACrD,CACL,IACE,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/lib/subcomponent/FileUploadInput/common/FileItem/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/lib/subcomponent/FileUploadInput/common/FileItem/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { withTooltip } from "@canonical/react-ds-global";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
/**
|
|
5
|
+
* The image URL for the preview. The tooltip's message is fixed when the
|
|
6
|
+
* tooltip is made, so the per-file URL reaches it through context, which
|
|
7
|
+
* carries across the tooltip's portal.
|
|
8
|
+
*/
|
|
9
|
+
const PreviewUrl = createContext(undefined);
|
|
10
|
+
/**
|
|
11
|
+
* The whole image, uncropped. Decorative, like the thumbnail it enlarges: the
|
|
12
|
+
* file name on the tile already names the file, so a text alternative would
|
|
13
|
+
* only repeat it.
|
|
14
|
+
*/
|
|
15
|
+
const Preview = () => {
|
|
16
|
+
const url = useContext(PreviewUrl);
|
|
17
|
+
return url ? _jsx("img", { src: url, alt: "" }) : null;
|
|
18
|
+
};
|
|
19
|
+
/** The 60×36 thumbnail box, filled edge to edge by the image. */
|
|
20
|
+
const ThumbnailBox = ({ url }) => (_jsx("span", { className: "thumbnail", children: url && _jsx("img", { src: url, alt: "" }) }));
|
|
21
|
+
const PreviewedThumbnailBox = withTooltip(ThumbnailBox, _jsx(Preview, {}), {
|
|
22
|
+
className: "thumbnail-preview",
|
|
23
|
+
messageElementClassName: "file-upload-preview",
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* A file's image thumbnail. Hovering it shows the whole image in a tooltip,
|
|
27
|
+
* since the thumbnail crops it to fill its box. The preview reuses the
|
|
28
|
+
* thumbnail's object URL, and appears only once that URL exists.
|
|
29
|
+
*
|
|
30
|
+
* The thumbnail takes no keyboard focus: the preview only enlarges a
|
|
31
|
+
* decorative image, and a stop on every image tile would slow keyboard
|
|
32
|
+
* movement through the list.
|
|
33
|
+
*/
|
|
34
|
+
const Thumbnail = ({ url }) => {
|
|
35
|
+
if (!url)
|
|
36
|
+
return _jsx(ThumbnailBox, {});
|
|
37
|
+
return (_jsx(PreviewUrl.Provider, { value: url, children: _jsx(PreviewedThumbnailBox, { url: url }) }));
|
|
38
|
+
};
|
|
39
|
+
export default Thumbnail;
|
|
40
|
+
//# sourceMappingURL=Thumbnail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Thumbnail.js","sourceRoot":"","sources":["../../../../../../../src/lib/subcomponent/FileUploadInput/common/Thumbnail/Thumbnail.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD;;;;GAIG;AACH,MAAM,UAAU,GAAG,aAAa,CAAqB,SAAS,CAAC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,OAAO,GAAG,GAA8B,EAAE;IAC9C,MAAM,GAAG,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IACnC,OAAO,GAAG,CAAC,CAAC,CAAC,cAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/C,CAAC,CAAC;AAEF,iEAAiE;AACjE,MAAM,YAAY,GAAG,CAAC,EAAE,GAAG,EAAkB,EAAsB,EAAE,CAAC,CACpE,eAAM,SAAS,EAAC,WAAW,YAAE,GAAG,IAAI,cAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAC,EAAE,GAAG,GAAQ,CACrE,CAAC;AAEF,MAAM,qBAAqB,GAAG,WAAW,CAAC,YAAY,EAAE,KAAC,OAAO,KAAG,EAAE;IACnE,SAAS,EAAE,mBAAmB;IAC9B,uBAAuB,EAAE,qBAAqB;CAC/C,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,EAAkB,EAAsB,EAAE;IAChE,IAAI,CAAC,GAAG;QAAE,OAAO,KAAC,YAAY,KAAG,CAAC;IAClC,OAAO,CACL,KAAC,UAAU,CAAC,QAAQ,IAAC,KAAK,EAAE,GAAG,YAC7B,KAAC,qBAAqB,IAAC,GAAG,EAAE,GAAG,GAAI,GACf,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/lib/subcomponent/FileUploadInput/common/Thumbnail/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/lib/subcomponent/FileUploadInput/common/Thumbnail/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/FileUploadInput/constants.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/lib/subcomponent/FileUploadInput/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|