@canonical/react-ds-global-form 0.45.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 +14 -9
- 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 +38 -31
- 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/withToggleWrapper.d.ts +2 -2
- package/dist/types/lib/common/Wrapper/withToggleWrapper.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/CheckboxField/CheckboxField.d.ts +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/SwitchField/SwitchField.d.ts +1 -1
- 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/Field.d.ts +9 -5
- package/dist/types/lib/pattern/Field/Field.d.ts.map +1 -1
- package/dist/types/lib/pattern/Field/types.d.ts +69 -45
- 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 +23 -18
- 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
package/README.md
CHANGED
|
@@ -26,6 +26,8 @@ Each component brings its own stylesheet when you import it. The package stylesh
|
|
|
26
26
|
import "@canonical/react-ds-global-form/dist/esm/index.css";
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
Testing with Jest? `@canonical/react-ds-global`'s [Testing with Jest](../ds-global/README.md#testing-with-jest) section covers the ESM transform, the stylesheet stub and the mapper entries that this package needs too.
|
|
30
|
+
|
|
29
31
|
### How component CSS reaches the page
|
|
30
32
|
|
|
31
33
|
This package puts CSS on the page two ways. `dist/esm/index.css` — the file the snippet above imports — is the package-level stylesheet: the `--form-*` token block, the field grid, the shared input chrome, and `density.css`, which sizes every control to the context and density cell on the root. Each component module then imports its own stylesheet (`import "./styles.css"`), so importing a component is what puts that component's CSS on the page; a bundler collects those imports into the application's CSS. Nothing here is injected at runtime, and a component you never import ships no CSS.
|
|
@@ -58,7 +60,7 @@ An application's own **unlayered** CSS now beats every rule in this package, wha
|
|
|
58
60
|
|
|
59
61
|
This package renders more native elements than any other: `<input>` in a dozen types, `<select>`, `<textarea>`, `<label>`, `<legend>`, `<fieldset>`, `<button>`. A component that renders a native element is responsible for that element's box — its margin, its width, its `min-width`, its `box-sizing` — and for `::placeholder` where it renders a text input. Anything a component leaves undeclared is filled in by whatever else the host page loads, and on a page that also runs another framework that is a visible bug rather than a default. Declaring the box is being done as its own change; until it lands, treat "the control looks right on our own page" as a weaker guarantee than it sounds.
|
|
60
62
|
|
|
61
|
-
Nothing in this package portals: no `createPortal`, no `appendChild`, no `<dialog>`. The two surfaces that escape their container — the combobox list (`ComboboxInput/common/List/List.tsx:42`) and the colour picker's swatch panel (`ColorInput/ColorInput.tsx:198`) — use the Popover API, which promotes an element to the top layer for painting but leaves it where it is in the DOM. So they stay inside the `.ds` subtree their caller marks, and the element-level layers `@canonical/styles` scopes to that subtree still reach them.
|
|
63
|
+
Nothing in this package portals: no `createPortal`, no `appendChild`, no `<dialog>`. The two surfaces that escape their container — the combobox list (`_work_in_progress/subcomponent/ComboboxInput/common/List/List.tsx:42`) and the colour picker's swatch panel (`_work_in_progress/subcomponent/ColorInput/ColorInput.tsx:198`) — use the Popover API, which promotes an element to the top layer for painting but leaves it where it is in the DOM. So they stay inside the `.ds` subtree their caller marks, and the element-level layers `@canonical/styles` scopes to that subtree still reach them.
|
|
62
64
|
|
|
63
65
|
### Transitions read the motion tokens
|
|
64
66
|
|
|
@@ -146,12 +148,16 @@ The `Field` component uses `inputType` to select the appropriate input component
|
|
|
146
148
|
| `checkbox` | Checkbox | Boolean toggle |
|
|
147
149
|
| `range` | Range | Slider input |
|
|
148
150
|
| `select` | Select | Dropdown selection |
|
|
149
|
-
| `
|
|
151
|
+
| `choices`, `rich-choices` | Choices | Radio buttons or checkboxes |
|
|
150
152
|
| `combobox` | Combobox | Searchable dropdown |
|
|
151
153
|
| `hidden` | Hidden | Hidden input |
|
|
152
154
|
| `custom` | Your component | Pass via `CustomComponent` prop |
|
|
153
155
|
|
|
154
|
-
|
|
156
|
+
Built-in fields provide form binding and field chrome. Custom fields are rendered directly and own their binding and chrome.
|
|
157
|
+
|
|
158
|
+
`FieldProps` is a discriminated union. When migrating from the previously unchecked type, preserve literal `inputType` values with `satisfies FieldProps[]`, provide `options` for selects (use `[]` when middleware supplies them) and a `label` or `controlLabel` for toggles. Extend it with a type intersection rather than `interface extends FieldProps`; use `FieldProps<CustomProps>` for a custom component with additional required props. Custom-field declarations require TypeScript 5.5 or newer: although `NoInfer` was introduced in 5.4, the reserved-prop conditional does not resolve correctly in 5.4.
|
|
159
|
+
|
|
160
|
+
Built-in `Field` variants determine the native input type from `inputType`; do not pass a separate native `type` prop. Custom components may define their own `type` prop.
|
|
155
161
|
|
|
156
162
|
### Custom Fields
|
|
157
163
|
|
|
@@ -169,7 +175,7 @@ import { MyColorPicker } from "./MyColorPicker";
|
|
|
169
175
|
/>
|
|
170
176
|
```
|
|
171
177
|
|
|
172
|
-
Custom components must
|
|
178
|
+
Custom components receive the supplied props except `inputType`, `CustomComponent` and React's `key`. They must implement any needed registration, labels, errors, conditions and middleware themselves; `withWrapper` is internal. JSX checks the custom component's props. For typed maps, use `FieldProps<MyCustomProps>[]`; a map with different custom components needs a union of those types and narrowing before rendering each custom variant. See the Creating Custom Fields guide for an example.
|
|
173
179
|
|
|
174
180
|
### Standalone Inputs
|
|
175
181
|
|
|
@@ -200,6 +206,7 @@ Middleware are higher-order components that wrap fields to add functionality. Th
|
|
|
200
206
|
name="country"
|
|
201
207
|
inputType="select"
|
|
202
208
|
label="Country"
|
|
209
|
+
options={[]}
|
|
203
210
|
middleware={[addRESTOptions("/api/countries")]}
|
|
204
211
|
/>
|
|
205
212
|
```
|
|
@@ -216,6 +223,7 @@ import { addRESTOptions } from "@canonical/react-ds-global-form";
|
|
|
216
223
|
<Field
|
|
217
224
|
name="category"
|
|
218
225
|
inputType="select"
|
|
226
|
+
options={[]}
|
|
219
227
|
middleware={[
|
|
220
228
|
addRESTOptions("/api/categories", {
|
|
221
229
|
transformData: (data) => data.categories,
|
|
@@ -252,14 +260,11 @@ Fields can conditionally render based on other field values:
|
|
|
252
260
|
name="company"
|
|
253
261
|
inputType="text"
|
|
254
262
|
label="Company"
|
|
255
|
-
condition={
|
|
256
|
-
["accountType"],
|
|
257
|
-
([type]) => type === "business",
|
|
258
|
-
]}
|
|
263
|
+
condition={({ accountType }) => accountType === "business"}
|
|
259
264
|
/>
|
|
260
265
|
```
|
|
261
266
|
|
|
262
|
-
The field only
|
|
267
|
+
`condition` receives every form value and runs again whenever one changes. The field renders only while it returns `true`; a hidden field is not rendered, and unless `unregisterOnUnmount` is `false` its value is dropped, so it is not submitted.
|
|
263
268
|
|
|
264
269
|
## Storybook
|
|
265
270
|
|
package/dist/esm/density.css
CHANGED
|
@@ -38,8 +38,11 @@
|
|
|
38
38
|
* Controls no longer carry `.p` — the density system supplies the body font tier
|
|
39
39
|
* (font-size / weight / family) here. */
|
|
40
40
|
/* NB `.ds.input.textarea` is EXCLUDED: the textarea seats intrinsically (its own
|
|
41
|
-
* rule below) and must keep its multi-row min-height.
|
|
42
|
-
|
|
41
|
+
* rule below) and must keep its multi-row min-height. `.ds.input.file-upload`
|
|
42
|
+
* is EXCLUDED too: it is a stack of a drop area and a file list, not one
|
|
43
|
+
* control box, so it takes no density cell. */
|
|
44
|
+
:is(.comfortable, .dense, .app, .site, .docs)
|
|
45
|
+
.ds.input:not(.textarea, .file-upload) {
|
|
43
46
|
box-sizing: border-box;
|
|
44
47
|
/* Same effective line-height the target-baseline uses (single source of the
|
|
45
48
|
fallback chain), so a bare context class keeps a valid box height too. */
|
|
@@ -48,12 +51,6 @@
|
|
|
48
51
|
min-block-size: var(--density-box-height);
|
|
49
52
|
align-items: flex-start;
|
|
50
53
|
justify-content: flex-start;
|
|
51
|
-
/* Kill the UA BOTTOM padding only. Do NOT zero padding-block-start here: this
|
|
52
|
-
selector is more specific (0,4,0) than the placement rule below (0,2,0), so a
|
|
53
|
-
`padding-block: 0` shorthand would out-specify and WIPE the placement's
|
|
54
|
-
`padding-block-start: var(--space-before)` — leaving the label pinned to the
|
|
55
|
-
box top (off the baseline). The placement rule owns the start. */
|
|
56
|
-
padding-block-end: 0;
|
|
57
54
|
|
|
58
55
|
/* Body font tier — what `.p` used to supply. */
|
|
59
56
|
font-size: var(--typography-text-primary-font-size);
|
|
@@ -64,7 +61,7 @@
|
|
|
64
61
|
* child, top-reference it so the input's own space-before governs. Needs to beat
|
|
65
62
|
* the TextInput's `.ds.input.text { align-items: stretch }` (0,3,0). */
|
|
66
63
|
:is(.comfortable, .dense, .app, .site, .docs) .ds.input.text,
|
|
67
|
-
:is(.comfortable, .dense, .app, .site, .docs) .ds.input {
|
|
64
|
+
:is(.comfortable, .dense, .app, .site, .docs) .ds.input:not(.file-upload) {
|
|
68
65
|
align-items: flex-start;
|
|
69
66
|
}
|
|
70
67
|
|
|
@@ -105,18 +102,13 @@
|
|
|
105
102
|
* so `.editorial` composes with density with no specificity war. `:is()` (not
|
|
106
103
|
* `:where()`) still gives the control seat the specificity to beat a control's own
|
|
107
104
|
* centring (e.g. the Button's `align-items: center`). */
|
|
108
|
-
/* Body font tier for the field label
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
/* Body font tier for the field label plus the toggle control row (its own
|
|
106
|
+
line metrics must match the label's so the control row centres exactly),
|
|
107
|
+
which lost `.p`. The description and the error read the secondary ramp,
|
|
108
|
+
so they stay out of this seat. Scoped to just these (NOT the headings,
|
|
109
|
+
which keep their own tier). */
|
|
112
110
|
:is(.comfortable, .dense, .app, .site, .docs)
|
|
113
|
-
|
|
114
|
-
.ds.field-label,
|
|
115
|
-
.ds.field-description,
|
|
116
|
-
.ds.field-error,
|
|
117
|
-
.ds.field-toggle,
|
|
118
|
-
.ds.option
|
|
119
|
-
) {
|
|
111
|
+
:is(.ds.field-label, .ds.field-toggle, .ds.option) {
|
|
120
112
|
font-size: var(--typography-text-primary-font-size);
|
|
121
113
|
font-family: var(--typography-text-primary-font-family);
|
|
122
114
|
}
|
|
@@ -159,7 +151,7 @@
|
|
|
159
151
|
* rule wins for the text family. Direct chromes (select/date/time) and the
|
|
160
152
|
* textarea keep the previous model until their own cutover pass. */
|
|
161
153
|
:is(.comfortable, .dense, .app, .site, .docs)
|
|
162
|
-
|
|
154
|
+
.ds.input:is(.text, .number, .password, .phone) {
|
|
163
155
|
/* The COMPOSITE chrome family — every wrapper with an inner <input> leaf
|
|
164
156
|
(text, number, password, phone). One selector, one seat: the wrapper is
|
|
165
157
|
the box, the leaf carries the line. */
|
|
@@ -212,12 +204,15 @@
|
|
|
212
204
|
block-size: auto;
|
|
213
205
|
min-block-size: 0;
|
|
214
206
|
padding-block-end: var(--seat-after);
|
|
215
|
-
/* Stretch (not the box rule's flex-start): a prefix/suffix
|
|
216
|
-
|
|
217
|
-
own
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
207
|
+
/* Stretch (not the box rule's flex-start): a prefix/suffix spans the
|
|
208
|
+
leaf's column. An affix that must pair with the VALUE takes the leaf's
|
|
209
|
+
own seat — the number input's unit slots read --seat-line-floored and
|
|
210
|
+
--seat-before in NumberInput/styles.css (end pad 0, like the leaf), so
|
|
211
|
+
their text rides the value's line box; a plain `align-items: center` on
|
|
212
|
+
the full stretch would float them above the seated text (the pad split
|
|
213
|
+
is asymmetric: seat-before ≠ seat-after). The old fixed-height model
|
|
214
|
+
needed flex-start to top-pin the crushed leaf; the intrinsic leaf
|
|
215
|
+
seats itself, so stretch is safe again. */
|
|
221
216
|
align-items: stretch;
|
|
222
217
|
}
|
|
223
218
|
:is(.comfortable, .dense, .app, .site, .docs)
|
|
@@ -347,7 +342,7 @@
|
|
|
347
342
|
* --end-nudge already lands its bottom on the grid. Adding a density fill on top
|
|
348
343
|
* would double-pad. Prose bottom rhythm belongs to the engine / `.editorial`. */
|
|
349
344
|
:is(.comfortable, .dense, .app, .site, .docs)
|
|
350
|
-
|
|
345
|
+
:is(.ds.field-label, .ds.field-description, .ds.field-error) {
|
|
351
346
|
padding-block-end: max(
|
|
352
347
|
0px,
|
|
353
348
|
calc(
|
package/dist/esm/index.css
CHANGED
|
@@ -121,6 +121,10 @@
|
|
|
121
121
|
|
|
122
122
|
--form-input-background: var(--color-foreground-input);
|
|
123
123
|
--form-input-color: var(--color-text);
|
|
124
|
+
/* Mask text (the native date/time segments and separators) reads the muted
|
|
125
|
+
* token while the input is empty; a real value restores --form-input-color.
|
|
126
|
+
* See the date/datetime sheets for the WebKit segment selectors. */
|
|
127
|
+
--form-input-color-mask: var(--color-text-muted);
|
|
124
128
|
--form-input-font-size: var(--typography-text-primary-font-size);
|
|
125
129
|
--form-input-line-height: var(--typography-text-primary-line-height);
|
|
126
130
|
|
|
@@ -140,15 +144,30 @@
|
|
|
140
144
|
|
|
141
145
|
/* ── Description ────────────────────────────────────────────────── */
|
|
142
146
|
|
|
143
|
-
/*
|
|
144
|
-
supporting text, so it takes the smaller secondary size, not the primary
|
|
145
|
-
body size. Colour is already the muted token. */
|
|
147
|
+
/* Subordinate supporting text: reads the SECONDARY type ramp. */
|
|
146
148
|
--form-description-font-size: var(--typography-text-secondary-font-size);
|
|
149
|
+
--form-description-font-weight: var(
|
|
150
|
+
--typography-text-secondary-font-weight
|
|
151
|
+
);
|
|
152
|
+
--form-description-line-height: var(
|
|
153
|
+
--typography-text-secondary-line-height-dimension
|
|
154
|
+
);
|
|
155
|
+
--form-description-letter-spacing: var(
|
|
156
|
+
--typography-text-secondary-letter-spacing
|
|
157
|
+
);
|
|
147
158
|
--form-description-color: var(--color-text-muted);
|
|
148
159
|
|
|
149
160
|
/* ── Error ──────────────────────────────────────────────────────── */
|
|
150
161
|
|
|
151
|
-
|
|
162
|
+
/* Status message: reads the SECONDARY type ramp like the description. */
|
|
163
|
+
--form-error-font-size: var(--typography-text-secondary-font-size);
|
|
164
|
+
--form-error-font-weight: var(--typography-text-secondary-font-weight);
|
|
165
|
+
--form-error-line-height: var(
|
|
166
|
+
--typography-text-secondary-line-height-dimension
|
|
167
|
+
);
|
|
168
|
+
--form-error-letter-spacing: var(
|
|
169
|
+
--typography-text-secondary-letter-spacing
|
|
170
|
+
);
|
|
152
171
|
--form-error-color: var(--modifier-color-text, var(--color-text-error));
|
|
153
172
|
|
|
154
173
|
/* ── State colors ───────────────────────────────────────────────── */
|
|
@@ -160,7 +179,7 @@
|
|
|
160
179
|
/* Design review (15/07): a disabled control shows no border. Default the
|
|
161
180
|
* disabled border to transparent; a theme wanting a visible disabled border
|
|
162
181
|
* can still override this token (e.g. back to `--disabled--color-border`). */
|
|
163
|
-
--form-input-border-color-disabled:
|
|
182
|
+
--form-input-border-color-disabled: var(--color-border-disabled);
|
|
164
183
|
|
|
165
184
|
/* ── Focus ring ─────────────────────────────────────────────────── */
|
|
166
185
|
|
|
@@ -313,11 +332,7 @@
|
|
|
313
332
|
* carry the disabled affordance instead. */
|
|
314
333
|
&:disabled,
|
|
315
334
|
&:has(input:disabled) {
|
|
316
|
-
border-color: var(--form-input-border-color-disabled);
|
|
317
|
-
border-top-color: var(--form-input-border-color-disabled);
|
|
318
|
-
border-right-color: var(--form-input-border-color-disabled);
|
|
319
335
|
border-bottom-color: var(--form-input-border-color-disabled);
|
|
320
|
-
border-left-color: var(--form-input-border-color-disabled);
|
|
321
336
|
background-color: var(--form-input-background-disabled);
|
|
322
337
|
color: var(--form-input-color-disabled);
|
|
323
338
|
cursor: not-allowed;
|
|
@@ -333,11 +348,11 @@
|
|
|
333
348
|
*
|
|
334
349
|
* EXCEPTION — the borderless choices fieldset. A choices group (radios/checkboxes)
|
|
335
350
|
* has no single input border to paint (each option is its own borderless control),
|
|
336
|
-
* so its
|
|
351
|
+
* so its label (a `.ds.field-label`) is the ONLY place an error can be shown
|
|
337
352
|
* without lighting up every option box. Such a group renders its Wrapper label as
|
|
338
|
-
* a `<
|
|
339
|
-
* label — a normal field's `<label>` is untouched. */
|
|
340
|
-
.danger >
|
|
353
|
+
* plain text, not a `<label>` (the `mockLabel` path), so the recolour is SCOPED
|
|
354
|
+
* to a non-`<label>` field label — a normal field's `<label>` is untouched. */
|
|
355
|
+
.danger > .ds.field-label:not(label) {
|
|
341
356
|
color: var(--form-error-color);
|
|
342
357
|
|
|
343
358
|
/* The required "*" marker recolours WITH the label (it pins its own colour to
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import bindField from "
|
|
2
|
-
import withWrapper from "
|
|
1
|
+
import bindField from "../../../common/bindField/index.js";
|
|
2
|
+
import withWrapper from "../../../common/Wrapper/withWrapper.js";
|
|
3
3
|
import { ColorInput } from "../../subcomponent/ColorInput/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* ColorInput bound to react-hook-form (controlled), wrapped with field chrome.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorField.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/component/ColorField/ColorField.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oCAAoC,CAAC;AAC3D,OAAO,WAAW,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAGpE;;;;;;GAMG;AACH,eAAe,WAAW,CACxB,SAAS,CAAkB,UAAU,EAAE,YAAY,EAAE;IACnD,YAAY,EAAE,SAAS;CACxB,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/component/ColorField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/component/ColorField/types.ts"],"names":[],"mappings":""}
|
package/dist/esm/lib/{component → _work_in_progress/component}/ComboboxField/ComboboxField.js
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import bindField from "
|
|
2
|
-
import withWrapper from "
|
|
1
|
+
import bindField from "../../../common/bindField/index.js";
|
|
2
|
+
import withWrapper from "../../../common/Wrapper/withWrapper.js";
|
|
3
3
|
import { ComboboxInput } from "../../subcomponent/ComboboxInput/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* ComboboxInput bound to react-hook-form (controlled), wrapped with field chrome.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxField.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/component/ComboboxField/ComboboxField.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oCAAoC,CAAC;AAC3D,OAAO,WAAW,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAG1E;;;;;;;;GAQG;AACH,eAAe,WAAW,CACxB,SAAS,CAAqB,aAAa,EAAE,YAAY,CAAC,CAC3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/component/ComboboxField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/component/ComboboxField/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import bindField from "
|
|
2
|
-
import withWrapper from "
|
|
1
|
+
import bindField from "../../../common/bindField/index.js";
|
|
2
|
+
import withWrapper from "../../../common/Wrapper/withWrapper.js";
|
|
3
3
|
import { RatingInput } from "../../subcomponent/RatingInput/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* RatingInput bound to react-hook-form (controlled), wrapped with the field
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RatingField.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/component/RatingField/RatingField.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oCAAoC,CAAC;AAC3D,OAAO,WAAW,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAGtE;;;;;;;;GAQG;AACH,eAAe,WAAW,CACxB,SAAS,CAAmB,WAAW,EAAE,YAAY,CAAC,CACvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/component/RatingField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/component/RatingField/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorInput.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/ColorInput/ColorInput.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,GAA8B;IAC7C,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,mBAAmB;CAC1B,CAAC;AAEF,MAAM,aAAa,GAA8B;IAC/C,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;CACR,CAAC;AAEF,SAAS,iBAAiB,CAAC,KAAa,EAAE,OAAoB;IAC5D,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAoB;IAC5C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAE/C,MAAM,eAAe,GAAG;IACtB,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;CACV,CAAC;AAEF,MAAM,iBAAiB,GAAgB,CAAC,MAAM,CAAC,CAAC;AA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QAAQ,EAAE,QAAQ,KACd,UAAU,aAEb,gBAAgB,IAAI,CACnB,eACE,SAAS,EAAC,eAAe,EACzB,KAAK,EAAE,EAAE,eAAe,EAAE,YAAY,EAAE,iBAC5B,MAAM,GAClB,CACH,EACD,eAAM,SAAS,EAAC,aAAa,YAAE,YAAY,GAAQ,IAC5C,EAET,eAAK,GAAG,EAAE,UAAU,EAAE,OAAO,EAAC,QAAQ,EAAC,SAAS,EAAC,eAAe,aAC9D,cAAK,SAAS,EAAC,aAAa,EAAC,IAAI,EAAC,SAAS,gBAAY,gBAAgB,YACpE,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACvB,iBAEE,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE;gCACT,QAAQ;gCACR,KAAK,CAAC,WAAW,EAAE,KAAK,YAAY,CAAC,WAAW,EAAE;oCAChD,UAAU;6BACb;iCACE,MAAM,CAAC,OAAO,CAAC;iCACf,IAAI,CAAC,GAAG,CAAC,EACZ,KAAK,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,EACjC,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,mBACxB,KAAK,CAAC,WAAW,EAAE,KAAK,YAAY,CAAC,WAAW,EAAE,gBACrD,KAAK,EACjB,QAAQ,EAAE,QAAQ,IAdb,KAAK,CAeV,CACH,CAAC,GACE,EAEL,WAAW,IACR,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/ColorInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/ColorInput/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxInput.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/ComboboxInput.tsx"],"names":[],"mappings":";AAAA,kDAAkD;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CACrC,SAAS,aAAa,CACpB,EAAE,SAAS,EAAE,UAAU,GAAG,KAAK,EAAE,GAAG,UAAU,EAAE,EAChD,GAAG;IAEH,MAAM,iBAAiB,GAAG,CAAC,qBAAqB,EAAE,SAAS,CAAC;SACzD,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,KAAC,gBAAgB,IAAC,SAAS,EAAE,iBAAiB,KAAM,UAAU,GAAI,CAAC;IAC5E,CAAC;IACD,OAAO,CACL,KAAC,cAAc,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,iBAAiB,KAAM,UAAU,GAAI,CAC3E,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCombobox, useMultipleSelection } from "downshift";
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { List, ResetButton } from "./common/index.js";
|
|
5
|
+
import { VALUE_KEY } from "./constants.js";
|
|
6
|
+
import messages from "./messages.js";
|
|
7
|
+
import { convertItemToString as defaultConvertItemToString, convertValueToItem as defaultConvertValueToItem, filterItems as defaultFilterItems, isPromise, settleLookup, stopPageMovesAtEnds, } from "./utils/index.js";
|
|
8
|
+
import "./styles.css";
|
|
9
|
+
const componentCssClassName = "ds form-combobox";
|
|
10
|
+
/**
|
|
11
|
+
* Multiple-select combobox (presentational, controlled — no react-hook-form).
|
|
12
|
+
* Selected values are rendered as removable chips. Uses downshift's
|
|
13
|
+
* useMultipleSelection + useCombobox.
|
|
14
|
+
*
|
|
15
|
+
* With a `name`, one hidden input per selected value carries the selection, so
|
|
16
|
+
* a native form post sends it without JavaScript. The visible text input stays
|
|
17
|
+
* unnamed.
|
|
18
|
+
*
|
|
19
|
+
* The `id` and the ARIA props go to the text input; `aria-label` or
|
|
20
|
+
* `aria-labelledby` names the list too. Removing the focused chip moves focus
|
|
21
|
+
* to the chip that takes its place, or to the input when no chip is left.
|
|
22
|
+
*
|
|
23
|
+
* @param {ComboboxInputProps} props - The component props
|
|
24
|
+
* @returns {React.ReactElement} - Rendered MultipleCombobox component
|
|
25
|
+
*
|
|
26
|
+
* `import { MultipleCombobox } from "@canonical/react-ds-global-form";`
|
|
27
|
+
*/
|
|
28
|
+
const MultipleCombobox = ({ id, className, style, name, options, value, onChange, disabled = false, placeholder, openOnReset = false, valueKey = VALUE_KEY, convertItemToString = defaultConvertItemToString, convertValueToItem = defaultConvertValueToItem, filterItems = defaultFilterItems, onInputValueChangeFactory, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-errormessage": ariaErrorMessage, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, }) => {
|
|
29
|
+
const values = value;
|
|
30
|
+
// The lookup for the first value runs once, while rendering, so synchronous
|
|
31
|
+
// answers are shown as chips in the server render. Promises are kept for the
|
|
32
|
+
// mount effect to await instead of looking the values up twice. A rejected
|
|
33
|
+
// lookup counts as not found.
|
|
34
|
+
const [initialLookups] = useState(() => (values ?? []).map((val) => settleLookup(convertValueToItem(val, options, valueKey))));
|
|
35
|
+
const pendingInitialLookups = useRef(initialLookups.some(isPromise) ? initialLookups : null);
|
|
36
|
+
// State for selected items and filtered items
|
|
37
|
+
const [selectedItems, setSelectedItems] = useState(() => initialLookups.some(isPromise)
|
|
38
|
+
? []
|
|
39
|
+
: initialLookups.filter(isOption));
|
|
40
|
+
const [items, setItems] = useState(options);
|
|
41
|
+
// The chips on screen, read by the sync effect without re-running it.
|
|
42
|
+
const selectedItemsRef = useRef(selectedItems);
|
|
43
|
+
selectedItemsRef.current = selectedItems;
|
|
44
|
+
// Whether chips are hidden while lookups are pending.
|
|
45
|
+
const isPendingRef = useRef(false);
|
|
46
|
+
// Values an asynchronous lookup could not resolve, so a re-run caused by a
|
|
47
|
+
// new `options` or `convertValueToItem` does not fetch them again.
|
|
48
|
+
const unresolvedRef = useRef(new Set());
|
|
49
|
+
const previousValuesRef = useRef(values);
|
|
50
|
+
// Keep selectedItems in sync with the controlled value — on mount and on every
|
|
51
|
+
// change. Must clear as well as populate: an empty/undefined `value` (e.g. after
|
|
52
|
+
// reset) has to drive `selectedItems` back to [], otherwise a later re-render
|
|
53
|
+
// that re-supplies the previous array would resurrect the cleared chips.
|
|
54
|
+
// A value that already has a chip (the user just picked it) is not looked up
|
|
55
|
+
// again. Latest wins: a value changed while its lookups are pending runs the
|
|
56
|
+
// cleanup, which discards the stale answers. While they are pending no chip is
|
|
57
|
+
// shown; the hidden inputs already carry the values.
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
const previousValues = previousValuesRef.current;
|
|
60
|
+
previousValuesRef.current = values;
|
|
61
|
+
// Uncontrolled, the chips are the user's own: a new `options` must not
|
|
62
|
+
// clear them.
|
|
63
|
+
if (values === undefined && previousValues === undefined) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const currentValues = values ?? [];
|
|
67
|
+
const unresolved = unresolvedRef.current;
|
|
68
|
+
for (const val of unresolved) {
|
|
69
|
+
if (!currentValues.includes(val)) {
|
|
70
|
+
unresolved.delete(val);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const shown = new Map(selectedItemsRef.current.map((item) => [String(item[valueKey]), item]));
|
|
74
|
+
const lookups = pendingInitialLookups.current ??
|
|
75
|
+
currentValues.map((val) => shown.get(val) ??
|
|
76
|
+
(unresolved.has(val)
|
|
77
|
+
? null
|
|
78
|
+
: settleLookup(convertValueToItem(val, options, valueKey))));
|
|
79
|
+
pendingInitialLookups.current = null;
|
|
80
|
+
if (!lookups.some(isPromise)) {
|
|
81
|
+
isPendingRef.current = false;
|
|
82
|
+
setSelectedItems(lookups.filter(isOption));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
let isStale = false;
|
|
86
|
+
isPendingRef.current = true;
|
|
87
|
+
setSelectedItems([]);
|
|
88
|
+
(async () => {
|
|
89
|
+
const resolved = await Promise.all(lookups);
|
|
90
|
+
if (!isStale) {
|
|
91
|
+
resolved.forEach((item, index) => {
|
|
92
|
+
if (!item && isPromise(lookups[index])) {
|
|
93
|
+
unresolved.add(currentValues[index]);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
isPendingRef.current = false;
|
|
97
|
+
setSelectedItems(resolved.filter(isOption));
|
|
98
|
+
}
|
|
99
|
+
})();
|
|
100
|
+
return () => {
|
|
101
|
+
isStale = true;
|
|
102
|
+
};
|
|
103
|
+
}, [values, convertValueToItem, options, valueKey]);
|
|
104
|
+
// Downshift's useMultipleSelection hook for managing multiple selections
|
|
105
|
+
const { getSelectedItemProps, getDropdownProps, addSelectedItem, removeSelectedItem, setActiveIndex, } = useMultipleSelection({
|
|
106
|
+
selectedItems,
|
|
107
|
+
onSelectedItemsChange: ({ selectedItems: newSelectedItems }) => {
|
|
108
|
+
setSelectedItems(newSelectedItems);
|
|
109
|
+
// Emit [] (never undefined) when the list empties: with a react-hook-form
|
|
110
|
+
// Controller that has a defaultValue, onChange(undefined) reverts the field
|
|
111
|
+
// to that default, resurrecting the removed chips. [] clears cleanly.
|
|
112
|
+
const picked = newSelectedItems.map((item) => item[valueKey]);
|
|
113
|
+
// While lookups are pending no chip is shown, so a pick adds to the
|
|
114
|
+
// value instead of replacing the values still being looked up. Only a
|
|
115
|
+
// controlled value can be pending.
|
|
116
|
+
const newValue = isPendingRef.current
|
|
117
|
+
? [...new Set([...values, ...picked])]
|
|
118
|
+
: picked;
|
|
119
|
+
onChange?.(newValue);
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
// Default onInputValueChangeFactory: filters items locally
|
|
123
|
+
const defaultOnInputValueChangeFactory = useCallback(() => ({ inputValue }) => {
|
|
124
|
+
setItems(filterItems(options, inputValue));
|
|
125
|
+
}, [filterItems, options]);
|
|
126
|
+
// Use provided onInputValueChangeFactory or default
|
|
127
|
+
const onInputValueChange = onInputValueChangeFactory
|
|
128
|
+
? onInputValueChangeFactory(setItems)
|
|
129
|
+
: defaultOnInputValueChangeFactory();
|
|
130
|
+
// Downshift's useCombobox hook for combobox functionality
|
|
131
|
+
const { isOpen, openMenu, getMenuProps, getInputProps, getItemProps, highlightedIndex, setInputValue, // Function to set input value
|
|
132
|
+
} = useCombobox({
|
|
133
|
+
items,
|
|
134
|
+
inputId: id,
|
|
135
|
+
labelId: ariaLabelledBy,
|
|
136
|
+
stateReducer: (state, actionAndChanges) => stopPageMovesAtEnds(state, actionAndChanges, items.length),
|
|
137
|
+
// The selection lives in useMultipleSelection, not here. Pinning this to
|
|
138
|
+
// null stops useCombobox remembering the last pick: otherwise picking that
|
|
139
|
+
// option again (after removing its chip) is not a change and is ignored.
|
|
140
|
+
selectedItem: null,
|
|
141
|
+
onInputValueChange,
|
|
142
|
+
onSelectedItemChange: ({ selectedItem }) => {
|
|
143
|
+
if (selectedItem &&
|
|
144
|
+
!selectedItems.some((item) => item[valueKey] === selectedItem[valueKey])) {
|
|
145
|
+
addSelectedItem(selectedItem);
|
|
146
|
+
setInputValue(""); // Clear input after selection
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
itemToString: convertItemToString,
|
|
150
|
+
});
|
|
151
|
+
const inputRef = useRef(null);
|
|
152
|
+
// Reset function to clear selections and input. Emits [] (not undefined) so a
|
|
153
|
+
// react-hook-form Controller with a defaultValue stores the cleared state
|
|
154
|
+
// rather than falling back to its default and repopulating the chips. Focus
|
|
155
|
+
// returns to the input, as in the single combobox.
|
|
156
|
+
const resetSelection = useCallback(() => {
|
|
157
|
+
setSelectedItems([]);
|
|
158
|
+
setInputValue("");
|
|
159
|
+
onChange?.([]);
|
|
160
|
+
inputRef.current?.focus();
|
|
161
|
+
if (openOnReset) {
|
|
162
|
+
openMenu();
|
|
163
|
+
}
|
|
164
|
+
}, [onChange, setInputValue, openOnReset, openMenu]);
|
|
165
|
+
// A chip removed while it holds focus becomes the active chip first, so
|
|
166
|
+
// focus moves to the chip that takes its place, or to the input when none
|
|
167
|
+
// is left, instead of falling back to the page.
|
|
168
|
+
const removeChip = (event, selectedItem, index) => {
|
|
169
|
+
if (event.currentTarget === document.activeElement) {
|
|
170
|
+
// The last chip leaves the active index at -1 either way, so downshift
|
|
171
|
+
// would not move focus: move it to the input here.
|
|
172
|
+
if (selectedItems.length === 1) {
|
|
173
|
+
inputRef.current?.focus();
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
setActiveIndex(index);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
removeSelectedItem(selectedItem);
|
|
180
|
+
};
|
|
181
|
+
// Uncontrolled, the chips are the values to post.
|
|
182
|
+
const postedValues = (values ?? selectedItems.map((item) => String(item[valueKey]))).filter(Boolean);
|
|
183
|
+
return (_jsxs("div", { style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), children: [_jsx("div", { className: "selected-items", children: selectedItems.map((selectedItem, index) => (_jsxs("button", { type: "button", ...getSelectedItemProps({ selectedItem, index }), "aria-label": messages.remove(convertItemToString(selectedItem)), disabled: disabled, onClick: (event) => removeChip(event, selectedItem, index), className: "chip", children: [convertItemToString(selectedItem), _jsx("span", { className: "remove-icon", "aria-hidden": "true", children: "\u00D7" })] }, index))) }), _jsxs("div", { className: "ds input combobox-input chrome", children: [_jsx("input", { className: "p", ...getInputProps({
|
|
184
|
+
...getDropdownProps({ preventKeyAction: isOpen, ref: inputRef }),
|
|
185
|
+
"aria-label": ariaLabel,
|
|
186
|
+
"aria-describedby": ariaDescribedBy,
|
|
187
|
+
"aria-errormessage": ariaErrorMessage,
|
|
188
|
+
"aria-invalid": ariaInvalid,
|
|
189
|
+
"aria-required": ariaRequired,
|
|
190
|
+
}), placeholder: placeholder, disabled: disabled }), _jsx(ResetButton, { disabled: disabled, onClick: resetSelection })] }), _jsx(List, { "aria-label": ariaLabel, isOpen: isOpen, getMenuProps: getMenuProps, getItemProps: getItemProps, items: items, highlightedIndex: highlightedIndex, convertItemToString: convertItemToString, valueKey: valueKey, fieldValue: selectedItems.map((item) => String(item[valueKey])) }), name
|
|
191
|
+
? postedValues.map((postedValue) => (_jsx("input", { type: "hidden", name: name, value: postedValue }, postedValue)))
|
|
192
|
+
: null] }));
|
|
193
|
+
};
|
|
194
|
+
function isOption(item) {
|
|
195
|
+
return Boolean(item);
|
|
196
|
+
}
|
|
197
|
+
export default MultipleCombobox;
|
|
198
|
+
//# sourceMappingURL=MultipleCombobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipleCombobox.js","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/MultipleCombobox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,QAAQ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