@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { ComboboxInputProps } from "./types.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
/**
|
|
5
|
+
* Multiple-select combobox (presentational, controlled — no react-hook-form).
|
|
6
|
+
* Selected values are rendered as removable chips. Uses downshift's
|
|
7
|
+
* useMultipleSelection + useCombobox.
|
|
8
|
+
*
|
|
9
|
+
* With a `name`, one hidden input per selected value carries the selection, so
|
|
10
|
+
* a native form post sends it without JavaScript. The visible text input stays
|
|
11
|
+
* unnamed.
|
|
12
|
+
*
|
|
13
|
+
* The `id` and the ARIA props go to the text input; `aria-label` or
|
|
14
|
+
* `aria-labelledby` names the list too. Removing the focused chip moves focus
|
|
15
|
+
* to the chip that takes its place, or to the input when no chip is left.
|
|
16
|
+
*
|
|
17
|
+
* @param {ComboboxInputProps} props - The component props
|
|
18
|
+
* @returns {React.ReactElement} - Rendered MultipleCombobox component
|
|
19
|
+
*
|
|
20
|
+
* `import { MultipleCombobox } from "@canonical/react-ds-global-form";`
|
|
21
|
+
*/
|
|
22
|
+
declare const MultipleCombobox: ({ id, className, style, name, options, value, onChange, disabled, placeholder, openOnReset, valueKey, convertItemToString, convertValueToItem, filterItems, onInputValueChangeFactory, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-errormessage": ariaErrorMessage, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, }: ComboboxInputProps) => React.ReactElement;
|
|
23
|
+
export default MultipleCombobox;
|
|
24
|
+
//# sourceMappingURL=MultipleCombobox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipleCombobox.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/MultipleCombobox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AASrD,OAAO,cAAc,CAAC;AAItB;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,gBAAgB,iYAsBnB,kBAAkB,KAAG,KAAK,CAAC,YAqR7B,CAAC;eAMa,gBAAgB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Option } from "
|
|
2
|
-
import { convertItemToString as defaultConvertItemToString
|
|
1
|
+
import type { Option } from "../../../subcomponent/types.js";
|
|
2
|
+
import { convertItemToString as defaultConvertItemToString } from "./utils/index.js";
|
|
3
3
|
import "./styles.css";
|
|
4
4
|
/**
|
|
5
5
|
* Single-select combobox (presentational, controlled — no react-hook-form).
|
|
@@ -10,8 +10,16 @@ import "./styles.css";
|
|
|
10
10
|
*
|
|
11
11
|
* The forwarded ref (the field's ref when bound) is merged with the internal
|
|
12
12
|
* input ref so focus management still works.
|
|
13
|
+
*
|
|
14
|
+
* With a `name`, a hidden input carries the selected value, so a native form
|
|
15
|
+
* post sends it without JavaScript. The visible text input stays unnamed, so
|
|
16
|
+
* the value is posted once.
|
|
17
|
+
*
|
|
18
|
+
* The `id` and the ARIA props go to the text input; `aria-label` or
|
|
19
|
+
* `aria-labelledby` names the list too.
|
|
13
20
|
*/
|
|
14
|
-
export declare const SingleCombobox: import("react").ForwardRefExoticComponent<import("
|
|
21
|
+
export declare const SingleCombobox: import("react").ForwardRefExoticComponent<import("../../../subcomponent/types.js").BaseProps & import("../../../subcomponent/types.js").OptionsProps & {
|
|
22
|
+
name?: string;
|
|
15
23
|
disabled?: boolean;
|
|
16
24
|
placeholder?: string;
|
|
17
25
|
valueKey?: keyof Option;
|
|
@@ -19,7 +27,7 @@ export declare const SingleCombobox: import("react").ForwardRefExoticComponent<i
|
|
|
19
27
|
isMultiple?: boolean;
|
|
20
28
|
filterItems?: (options: Option[], inputValue: string) => Option[];
|
|
21
29
|
convertItemToString?: typeof defaultConvertItemToString;
|
|
22
|
-
convertValueToItem?:
|
|
30
|
+
convertValueToItem?: import("./types.js").ConvertValueToItem;
|
|
23
31
|
onInputValueChangeFactory?: (setItems: React.Dispatch<React.SetStateAction<Option[]>>) => ({ inputValue }: {
|
|
24
32
|
inputValue: string;
|
|
25
33
|
}) => void;
|
|
@@ -27,6 +35,13 @@ export declare const SingleCombobox: import("react").ForwardRefExoticComponent<i
|
|
|
27
35
|
value?: string | string[];
|
|
28
36
|
onChange?: (value: string | string[] | undefined) => void;
|
|
29
37
|
onBlur?: () => void;
|
|
38
|
+
} & {
|
|
39
|
+
"aria-describedby"?: string | undefined;
|
|
40
|
+
"aria-errormessage"?: string | undefined;
|
|
41
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
42
|
+
"aria-label"?: string | undefined;
|
|
43
|
+
"aria-labelledby"?: string | undefined;
|
|
44
|
+
"aria-required"?: ("false" | "true" | boolean) | undefined;
|
|
30
45
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
31
46
|
export default SingleCombobox;
|
|
32
47
|
//# sourceMappingURL=SingleCombobox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SingleCombobox.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/SingleCombobox.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAK7D,OAAO,EACL,mBAAmB,IAAI,0BAA0B,EAMlD,MAAM,kBAAkB,CAAC;AAC1B,OAAO,cAAc,CAAC;AAItB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;oDAoL1B,CAAC;eAEa,cAAc"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { ListProps } from "./types.js";
|
|
3
3
|
import "./styles.css";
|
|
4
|
-
declare const List: ({ className, style, items, getMenuProps, getItemProps, highlightedIndex, convertItemToString, fieldValue, valueKey, isOpen, }: ListProps) => React.ReactElement;
|
|
4
|
+
declare const List: ({ className, style, items, getMenuProps, getItemProps, highlightedIndex, convertItemToString, fieldValue, valueKey, isOpen, "aria-label": ariaLabel, }: ListProps) => React.ReactElement;
|
|
5
5
|
export default List;
|
|
6
6
|
//# sourceMappingURL=List.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,cAAc,CAAC;AAItB,QAAA,MAAM,IAAI,2JAYP,SAAS,KAAG,KAAK,CAAC,YAsEpB,CAAC;eAEa,IAAI"}
|
package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,cAAc,YAAY,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UseComboboxPropGetters } from "downshift";
|
|
2
2
|
import type React from "react";
|
|
3
|
-
import type { Option } from "
|
|
3
|
+
import type { Option } from "../../../../../subcomponent/types.js";
|
|
4
4
|
import type * as utils from "../../utils/index.js";
|
|
5
5
|
export type ListProps = {
|
|
6
6
|
className?: string;
|
|
@@ -14,5 +14,6 @@ export type ListProps = {
|
|
|
14
14
|
fieldValue: string | string[] | undefined;
|
|
15
15
|
valueKey: keyof Option;
|
|
16
16
|
isOpen: boolean;
|
|
17
|
+
"aria-label"?: string;
|
|
17
18
|
};
|
|
18
19
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/types.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,KAAK,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAEnD,MAAM,MAAM,SAAS,GAAG;IAEtB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,KAAK,EAAE,MAAM,EAAE,CAAC;IAEhB,YAAY,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC;IAE7D,YAAY,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC;IAE7D,gBAAgB,EAAE,MAAM,CAAC;IAEzB,mBAAmB,EAAE,OAAO,KAAK,CAAC,mBAAmB,CAAC;IAEtD,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IAG1C,QAAQ,EAAE,MAAM,MAAM,CAAC;IAGvB,MAAM,EAAE,OAAO,CAAC;IAGhB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
@@ -7,6 +7,6 @@ import "./styles.css";
|
|
|
7
7
|
*
|
|
8
8
|
* `import { ResetButton } from "@canonical/react-ds-global-form";`
|
|
9
9
|
*/
|
|
10
|
-
declare const ResetButton: ({ id, className, messages, style, onClick, }: ResetButtonProps) => React.ReactElement;
|
|
10
|
+
declare const ResetButton: ({ id, className, messages, style, disabled, onClick, }: ResetButtonProps) => React.ReactElement;
|
|
11
11
|
export default ResetButton;
|
|
12
12
|
//# sourceMappingURL=ResetButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResetButton.d.ts","sourceRoot":"","sources":["../../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/ResetButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,cAAc,CAAC;AAMtB;;;;;GAKG;AACH,QAAA,MAAM,WAAW,2DAOd,gBAAgB,KAAG,KAAK,CAAC,YAc3B,CAAC;eAEa,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,mBAAmB;IAElC,KAAK,EAAE,MAAM,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAE/B,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAG5B,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAG/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAChE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAEhC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/messages.ts"],"names":[],"mappings":";IACE,KAAK;IACL,KAAK;IACL,MAAM,UAAU,MAAM"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { BaseProps, Option, OptionsProps } from "../../../subcomponent/types.js";
|
|
2
|
+
import type * as utils from "./utils/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a value to its option. It may answer at once or through a promise,
|
|
5
|
+
* for example to fetch the label of a value that is not in `options`.
|
|
6
|
+
*/
|
|
7
|
+
export type ConvertValueToItem = (value: string, items: Option[], valueKey: keyof Option) => Option | null | Promise<Option | null>;
|
|
8
|
+
/** Controlled value props — supplied by the field tier, or directly when standalone. */
|
|
9
|
+
type ControlledProps = {
|
|
10
|
+
value?: string | string[];
|
|
11
|
+
onChange?: (value: string | string[] | undefined) => void;
|
|
12
|
+
onBlur?: () => void;
|
|
13
|
+
};
|
|
14
|
+
type CommonProps = {
|
|
15
|
+
/**
|
|
16
|
+
* Name of the hidden input that carries each selected value, so the value
|
|
17
|
+
* posts in a plain HTML submission. The visible text input stays unnamed.
|
|
18
|
+
*/
|
|
19
|
+
name?: string;
|
|
20
|
+
/** Whether the input is disabled */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
valueKey?: keyof Option;
|
|
24
|
+
openOnReset?: boolean;
|
|
25
|
+
/** When enabled, allows selecting multiple values (rendered as chips). */
|
|
26
|
+
isMultiple?: boolean;
|
|
27
|
+
filterItems?: (options: Option[], inputValue: string) => Option[];
|
|
28
|
+
convertItemToString?: typeof utils.convertItemToString;
|
|
29
|
+
/**
|
|
30
|
+
* Resolves the controlled value to its option. The default looks it up in
|
|
31
|
+
* `options` synchronously, so a server render shows the selection at once.
|
|
32
|
+
* While a returned promise is pending nothing is shown as selected; if the
|
|
33
|
+
* value changes meanwhile, the stale answer is discarded.
|
|
34
|
+
*/
|
|
35
|
+
convertValueToItem?: ConvertValueToItem;
|
|
36
|
+
onInputValueChangeFactory?: (setItems: React.Dispatch<React.SetStateAction<Option[]>>) => ({ inputValue }: {
|
|
37
|
+
inputValue: string;
|
|
38
|
+
}) => void;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The accessibility wiring of the text input. The field tier supplies the
|
|
42
|
+
* label, description and error references; standalone, `aria-label` or
|
|
43
|
+
* `aria-labelledby` names the combobox. Its name also names the list.
|
|
44
|
+
*/
|
|
45
|
+
type InputAriaProps = Pick<React.AriaAttributes, "aria-label" | "aria-labelledby" | "aria-describedby" | "aria-errormessage" | "aria-invalid" | "aria-required">;
|
|
46
|
+
/**
|
|
47
|
+
* Props for the presentational Combobox (controlled, no react-hook-form). The
|
|
48
|
+
* `id` is the text input's, so a `<label for>` reaches it.
|
|
49
|
+
*/
|
|
50
|
+
export type ComboboxInputProps = BaseProps & OptionsProps & CommonProps & ControlledProps & InputAriaProps;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,MAAM,EACN,YAAY,EACb,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,EAAE,MAAM,MAAM,KACnB,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAE5C,wFAAwF;AACxF,KAAK,eAAe,GAAG;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,KAAK,IAAI,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,EAAE,MAAM,MAAM,CAAC;IAExB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IAElE,mBAAmB,CAAC,EAAE,OAAO,KAAK,CAAC,mBAAmB,CAAC;IAEvD;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC,yBAAyB,CAAC,EAAE,CAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,KACrD,CAAC,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF;;;;GAIG;AACH,KAAK,cAAc,GAAG,IAAI,CACxB,KAAK,CAAC,cAAc,EAClB,YAAY,GACZ,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,GACnB,cAAc,GACd,eAAe,CAClB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GACxC,YAAY,GACZ,WAAW,GACX,eAAe,GACf,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertItemToString.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/utils/convertItemToString.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAEhE,iBAAS,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAExD;eAEc,mBAAmB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Option } from "
|
|
1
|
+
import type { Option } from "../../../../subcomponent/types.js";
|
|
2
2
|
declare function convertValueToItem(value: string, items: Option[], valueKey?: keyof Option): Option | null;
|
|
3
3
|
export default convertValueToItem;
|
|
4
4
|
//# sourceMappingURL=convertValueToItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertValueToItem.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/utils/convertValueToItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAGhE,iBAAS,kBAAkB,CACzB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,GAAE,MAAM,MAAkB,GACjC,MAAM,GAAG,IAAI,CAEf;eAEc,kBAAkB"}
|
package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/filterItems.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterItems.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/utils/filterItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAEhE,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAMlE;eAEc,WAAW"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as convertItemToString } from "./convertItemToString.js";
|
|
2
|
+
export { default as convertValueToItem } from "./convertValueToItem.js";
|
|
3
|
+
export { default as filterItems } from "./filterItems.js";
|
|
4
|
+
export { default as isPromise } from "./isPromise.js";
|
|
5
|
+
export { default as settleLookup } from "./settleLookup.js";
|
|
6
|
+
export { default as stopPageMovesAtEnds } from "./stopPageMovesAtEnds.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPromise.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/utils/isPromise.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,iBAAS,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,CAEhE;eAEc,SAAS"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Option } from "../../../../subcomponent/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Makes a lookup safe to await: a rejected promise answers `null` (not found)
|
|
4
|
+
* instead of becoming an unhandled rejection. A synchronous answer is kept.
|
|
5
|
+
*/
|
|
6
|
+
declare function settleLookup(answer: Option | null | Promise<Option | null>): Option | null | Promise<Option | null>;
|
|
7
|
+
export default settleLookup;
|
|
8
|
+
//# sourceMappingURL=settleLookup.d.ts.map
|
package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/settleLookup.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settleLookup.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/utils/settleLookup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAGhE;;;GAGG;AACH,iBAAS,YAAY,CACnB,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAC7C,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAExC;eAEc,YAAY"}
|
package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/stopPageMovesAtEnds.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type UseComboboxState, type UseComboboxStateChangeOptions } from "downshift";
|
|
2
|
+
import type { Option } from "../../../../subcomponent/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* A downshift state reducer that stops a PageUp or PageDown move at the first
|
|
5
|
+
* or the last item, as the WAI-ARIA listbox pattern asks, where downshift
|
|
6
|
+
* wraps it to the other end. A highlight outside the list starts from the
|
|
7
|
+
* matching end, as downshift's does. `count` is the number of items listed.
|
|
8
|
+
* Every other change passes through.
|
|
9
|
+
* @note Pure.
|
|
10
|
+
*/
|
|
11
|
+
declare function stopPageMovesAtEnds(state: UseComboboxState<Option>, { type, changes }: UseComboboxStateChangeOptions<Option>, count: number): Partial<UseComboboxState<Option>>;
|
|
12
|
+
export default stopPageMovesAtEnds;
|
|
13
|
+
//# sourceMappingURL=stopPageMovesAtEnds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stopPageMovesAtEnds.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/_work_in_progress/subcomponent/ComboboxInput/utils/stopPageMovesAtEnds.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,6BAA6B,EAEnC,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAIhE;;;;;;;GAOG;AACH,iBAAS,mBAAmB,CAC1B,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAC/B,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,6BAA6B,CAAC,MAAM,CAAC,EACxD,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAcnC;eAEc,mBAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RatingInput.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/RatingInput/RatingInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,cAAc,CAAC;AAOtB;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,6HAarB,gBAAgB,KAAG,YAoErB,CAAC;eAEa,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/RatingInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxD,mBAAmB,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/subcomponent/RatingInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,8EAA8E;AAC9E,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvisibleWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/InvisibleWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhE;;;;;;;;;GASG;AACH,QAAA,MAAM,gBAAgB,GAAI,cAAc,SAAS,cAAc,kHAO5D,YAAY,CAAC,cAAc,CAAC,KAAG,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"InvisibleWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/InvisibleWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhE;;;;;;;;;GASG;AACH,QAAA,MAAM,gBAAgB,GAAI,cAAc,SAAS,cAAc,kHAO5D,YAAY,CAAC,cAAc,CAAC,KAAG,KAAK,CAAC,YAiBvC,CAAC;eAEa,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/ToggleWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,cAAc,CAAC;AACtB,OAAO,qBAAqB,CAAC;AAI7B;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,aAAa,GAAI,cAAc,SAAS,cAAc,wNAkBzD,YAAY,CAAC,cAAc,CAAC,KAAG,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"ToggleWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/ToggleWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,cAAc,CAAC;AACtB,OAAO,qBAAqB,CAAC;AAI7B;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,aAAa,GAAI,cAAc,SAAS,cAAc,wNAkBzD,YAAY,CAAC,cAAc,CAAC,KAAG,KAAK,CAAC,YA4EvC,CAAC;eAEa,aAAa"}
|
|
@@ -7,6 +7,6 @@ import "./styles.css";
|
|
|
7
7
|
*
|
|
8
8
|
* `import { Wrapper } from "@canonical/react-ds-global-form";`
|
|
9
9
|
*/
|
|
10
|
-
declare const Wrapper: <ComponentProps extends BaseInputProps>({ id, className, style, name, Component, description, label, isOptional, requiredIndicator, registerProps: userRegisterProps, nestedRegisterProps, unregisterOnUnmount, mockLabel, ...otherProps }: WrapperProps<ComponentProps>) => React.ReactElement;
|
|
10
|
+
declare const Wrapper: <ComponentProps extends BaseInputProps>({ id, className, style, name, Component, description, label, isOptional, requiredIndicator, registerProps: userRegisterProps, nestedRegisterProps, unregisterOnUnmount, descriptionPosition, mockLabel, errorSlot, ...otherProps }: WrapperProps<ComponentProps>) => React.ReactElement;
|
|
11
11
|
export default Wrapper;
|
|
12
12
|
//# sourceMappingURL=Wrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/Wrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/Wrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,cAAc,CAAC;AAKtB;;;;;GAKG;AACH,QAAA,MAAM,OAAO,GAAI,cAAc,SAAS,cAAc,sOAmBnD,YAAY,CAAC,cAAc,CAAC,KAAG,KAAK,CAAC,YA2DvC,CAAC;eAEa,OAAO"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ComponentType } from "react";
|
|
2
|
+
import type { BaseInputProps, Middleware } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Builds the component a middleware renders around the field's input.
|
|
5
|
+
* `useSettings` is a hook: it returns the settings of the newest middleware at
|
|
6
|
+
* the same place in the field's `middleware` list, so the component keeps
|
|
7
|
+
* working with fresh settings without being rebuilt.
|
|
8
|
+
*/
|
|
9
|
+
export type MiddlewareBuilder<Settings, Constraint extends BaseInputProps> = <Props extends Constraint>(Component: ComponentType<Props>, useSettings: () => Settings) => ComponentType<Props>;
|
|
10
|
+
/** A middleware for any field whose props extend `Constraint`. */
|
|
11
|
+
export type ConfiguredMiddleware<Constraint extends BaseInputProps> = <Props extends Constraint>(Component: ComponentType<Props>) => ComponentType<Props>;
|
|
12
|
+
/** The settings of the field's current middleware, by place in its list. */
|
|
13
|
+
declare const MiddlewareSettingsContext: import("react").Context<readonly unknown[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Turns a middleware builder into a factory taking settings.
|
|
16
|
+
*
|
|
17
|
+
* Fields compare middleware made by the same factory by their builder, not by
|
|
18
|
+
* identity, so a factory called inline (`middleware={[addAudit(url)]}`) gives
|
|
19
|
+
* the same component on every render: the input does not remount and keeps
|
|
20
|
+
* its state, and the component reads the newest settings through
|
|
21
|
+
* `useSettings`. Called outside a field, the middleware uses the settings it
|
|
22
|
+
* was made with.
|
|
23
|
+
*
|
|
24
|
+
* @param build - Builds the component from the wrapped one.
|
|
25
|
+
* @returns A factory making a middleware from settings.
|
|
26
|
+
* @note Impure: the factory records each middleware it makes, with its builder
|
|
27
|
+
* and settings, in a module-level `WeakMap` that fields read.
|
|
28
|
+
*
|
|
29
|
+
* `import { createMiddleware } from "@canonical/react-ds-global-form";`
|
|
30
|
+
*/
|
|
31
|
+
export default function createMiddleware<Settings, Constraint extends BaseInputProps = BaseInputProps>(build: MiddlewareBuilder<Settings, Constraint>): (settings: Settings) => ConfiguredMiddleware<Constraint>;
|
|
32
|
+
/** Whether two middleware lists build the same components in the same order. */
|
|
33
|
+
export declare const isSameMiddleware: <ComponentProps>(current: Middleware<ComponentProps>[], next: Middleware<ComponentProps>[]) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Applies the middleware to the component, the first one outermost. A
|
|
36
|
+
* middleware made by `createMiddleware` reads its settings from
|
|
37
|
+
* `MiddlewareSettingsContext`, which the field provides.
|
|
38
|
+
*/
|
|
39
|
+
export declare const composeMiddleware: <ComponentProps>(middleware: Middleware<ComponentProps>[], Component: ComponentType<ComponentProps>) => ComponentType<ComponentProps>;
|
|
40
|
+
/** The settings of each middleware in the list, by place. */
|
|
41
|
+
export declare const readMiddlewareSettings: <ComponentProps>(middleware: Middleware<ComponentProps>[]) => unknown[];
|
|
42
|
+
export { MiddlewareSettingsContext };
|
|
43
|
+
//# sourceMappingURL=createMiddleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createMiddleware.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/createMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,EAAE,UAAU,SAAS,cAAc,IAAI,CAC3E,KAAK,SAAS,UAAU,EAExB,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,EAC/B,WAAW,EAAE,MAAM,QAAQ,KACxB,aAAa,CAAC,KAAK,CAAC,CAAC;AAE1B,kEAAkE;AAClE,MAAM,MAAM,oBAAoB,CAAC,UAAU,SAAS,cAAc,IAAI,CACpE,KAAK,SAAS,UAAU,EAExB,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,KAC5B,aAAa,CAAC,KAAK,CAAC,CAAC;AAU1B,4EAA4E;AAC5E,QAAA,MAAM,yBAAyB,6CAAwC,CAAC;AAExE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,QAAQ,EACR,UAAU,SAAS,cAAc,GAAG,cAAc,EAElD,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,GAC7C,CAAC,QAAQ,EAAE,QAAQ,KAAK,oBAAoB,CAAC,UAAU,CAAC,CAU1D;AAMD,gFAAgF;AAChF,eAAO,MAAM,gBAAgB,GAAI,cAAc,WACpC,UAAU,CAAC,cAAc,CAAC,EAAE,QAC/B,UAAU,CAAC,cAAc,CAAC,EAAE,KACjC,OAKC,CAAC;AA2BL;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,cAAc,cAClC,UAAU,CAAC,cAAc,CAAC,EAAE,aAC7B,aAAa,CAAC,cAAc,CAAC,KACvC,aAAa,CAAC,cAAc,CAShB,CAAC;AAEhB,6DAA6D;AAC7D,eAAO,MAAM,sBAAsB,GAAI,cAAc,cACvC,UAAU,CAAC,cAAc,CAAC,EAAE,KACvC,OAAO,EAA+D,CAAC;AAE1E,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -2,6 +2,8 @@ import { type RegisterOptions } from "react-hook-form";
|
|
|
2
2
|
type UseFieldWrapperOptions = {
|
|
3
3
|
label?: string;
|
|
4
4
|
isOptional?: boolean;
|
|
5
|
+
/** Whether the field renders a description, so the input may reference it. */
|
|
6
|
+
hasDescription?: boolean;
|
|
5
7
|
userRegisterProps?: RegisterOptions;
|
|
6
8
|
nestedRegisterProps?: RegisterOptions;
|
|
7
9
|
unregisterOnUnmount?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/common/Wrapper/hooks/useFieldWrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AAQvE,KAAK,sBAAsB,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,eAAe,CAAC;IACpC,mBAAmB,CAAC,EAAE,eAAe,CAAC;IACtC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,eAAe,SACb,MAAM,YACH,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useFieldWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/common/Wrapper/hooks/useFieldWrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AAQvE,KAAK,sBAAsB,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,eAAe,CAAC;IACpC,mBAAmB,CAAC,EAAE,eAAe,CAAC;IACtC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,eAAe,SACb,MAAM,YACH,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDhC,CAAC;eACa,eAAe"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { ConditionalDisplayProps } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Adds the `condition` prop to a field component. The field renders only while
|
|
5
|
+
* `condition(values)` returns `true`, re-evaluated whenever a form value
|
|
6
|
+
* changes. A hidden field is not rendered, and unless `unregisterOnUnmount`
|
|
7
|
+
* is `false` its value is dropped, so it is not submitted. Without a
|
|
8
|
+
* `condition` the field always renders.
|
|
9
|
+
*/
|
|
10
|
+
declare const withConditionalDisplay: <Props extends object>(WrappedComponent: React.ComponentType<Props>) => React.ComponentType<Props & ConditionalDisplayProps>;
|
|
5
11
|
export default withConditionalDisplay;
|
|
6
12
|
//# sourceMappingURL=withConditionalDisplay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withConditionalDisplay.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/withConditionalDisplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"withConditionalDisplay.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/withConditionalDisplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE3D;;;;;;GAMG;AACH,QAAA,MAAM,sBAAsB,GAAI,KAAK,SAAS,MAAM,oBAChC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,KAC3C,KAAK,CAAC,aAAa,CAAC,KAAK,GAAG,uBAAuB,CAerD,CAAC;eAEa,sBAAsB"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { BaseInputProps, BaseWrapperProps,
|
|
3
|
-
type WrappedComponentPropsInternal<ComponentProps extends BaseInputProps> = Omit<WrappedComponentProps<ComponentProps>, "Component"
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
declare const withWrapper: <ComponentProps extends BaseInputProps, ComponentWrapperProps extends BaseWrapperProps<ComponentProps> = WrapperProps<ComponentProps>>(Component: React.ComponentType<ComponentProps>, options?: Partial<ComponentWrapperProps>, Wrapper?: React.ComponentType<WrapperProps<ComponentProps>>) => (props: "WrapperComponent" | "className" | "condition" | "controlLabel" | "description" | "id" | "isOptional" | "label" | "labelPosition" | "middleware" | "mockLabel" | "nestedRegisterProps" | "requiredIndicator" | "style" | "unregisterOnUnmount" | Exclude<Exclude<keyof ComponentProps, "Component">, "Component"> extends infer T extends keyof WrappedComponentProps<WrappedComponentPropsInternal<ComponentProps>> ? { [P in T]: WrappedComponentProps<WrappedComponentPropsInternal<ComponentProps>>[P]; } : never) => React.ReactElement<WrappedComponentPropsInternal<ComponentProps>, string | React.JSXElementConstructor<any>> | null;
|
|
2
|
+
import type { BaseInputProps, BaseWrapperProps, WrappedComponentProps, WrapperProps } from "../types.js";
|
|
3
|
+
type WrappedComponentPropsInternal<ComponentProps extends BaseInputProps> = Omit<WrappedComponentProps<ComponentProps>, "Component" | "condition">;
|
|
4
|
+
declare const withWrapper: <ComponentProps extends BaseInputProps, ComponentWrapperProps extends BaseWrapperProps<ComponentProps> = WrapperProps<ComponentProps>>(Component: React.ComponentType<ComponentProps>, options?: Partial<ComponentWrapperProps>, Wrapper?: React.ComponentType<WrapperProps<ComponentProps>>) => React.ComponentType<WrappedComponentPropsInternal<ComponentProps> & import("../types.js").ConditionalDisplayProps>;
|
|
7
5
|
export default withWrapper;
|
|
8
6
|
//# sourceMappingURL=withWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/withWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"withWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/common/Wrapper/withWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACb,MAAM,aAAa,CAAC;AAUrB,KAAK,6BAA6B,CAAC,cAAc,SAAS,cAAc,IACtE,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC,CAAC;AAEzE,QAAA,MAAM,WAAW,GACf,cAAc,SAAS,cAAc,EACrC,qBAAqB,SACnB,gBAAgB,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC,cAAc,CAAC,aAEtD,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,YACpC,OAAO,CAAC,qBAAqB,CAAC,YAC/B,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,uHAgD3D,CAAC;eAEa,WAAW"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
-
import type { RegisterOptions } from "react-hook-form";
|
|
2
|
+
import type { FieldValues, RegisterOptions } from "react-hook-form";
|
|
3
3
|
import type { RequiredIndicator } from "../subcomponent/Field/Label/types.js";
|
|
4
4
|
import type { BaseProps } from "../subcomponent/types.js";
|
|
5
5
|
export type BaseInputProps = BaseProps & {
|
|
@@ -42,12 +42,28 @@ export type WrapperProps<ComponentProps> = BaseWrapperProps<ComponentProps> & {
|
|
|
42
42
|
labelPosition?: "before" | "after";
|
|
43
43
|
isOptional?: boolean;
|
|
44
44
|
requiredIndicator?: RequiredIndicator;
|
|
45
|
+
descriptionPosition?: "leading" | "trailing";
|
|
45
46
|
nestedRegisterProps?: RegisterOptions;
|
|
46
47
|
unregisterOnUnmount?: boolean;
|
|
47
48
|
mockLabel?: boolean;
|
|
49
|
+
errorSlot?: "payload" | "input";
|
|
48
50
|
} & ComponentProps;
|
|
49
51
|
export type Middleware<ComponentProps> = (Component: React.ComponentType<ComponentProps>) => React.ComponentType<ComponentProps>;
|
|
50
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Decides whether a field renders, from the current values of the whole form.
|
|
54
|
+
* Return `true` to render the field, `false` to hide it.
|
|
55
|
+
*/
|
|
56
|
+
export type Condition = (values: FieldValues) => boolean;
|
|
57
|
+
/** The `condition` prop every built-in field accepts. */
|
|
58
|
+
export type ConditionalDisplayProps = {
|
|
59
|
+
/**
|
|
60
|
+
* Renders the field only while this returns `true`. It receives every form
|
|
61
|
+
* value and runs again whenever one changes. A hidden field is not rendered,
|
|
62
|
+
* and unless `unregisterOnUnmount` is `false` its value is dropped, so it is
|
|
63
|
+
* not submitted.
|
|
64
|
+
*/
|
|
65
|
+
condition?: Condition;
|
|
66
|
+
};
|
|
51
67
|
export type WrapperHOCAdditionalProps<ComponentProps extends BaseInputProps, ComponentWrapperProps extends BaseWrapperProps<ComponentProps> = WrapperProps<ComponentProps>> = {
|
|
52
68
|
/**
|
|
53
69
|
* middleware to apply to the input
|
|
@@ -57,10 +73,6 @@ export type WrapperHOCAdditionalProps<ComponentProps extends BaseInputProps, Com
|
|
|
57
73
|
* An optional wrapper component to render around the input.
|
|
58
74
|
*/
|
|
59
75
|
WrapperComponent?: React.ComponentType<ComponentWrapperProps>;
|
|
60
|
-
|
|
61
|
-
* A condition to determine whether to render the component or not.
|
|
62
|
-
*/
|
|
63
|
-
condition?: Condition;
|
|
64
|
-
};
|
|
76
|
+
} & ConditionalDisplayProps;
|
|
65
77
|
export type WrappedComponentProps<ComponentProps extends BaseInputProps, ComponentWrapperProps extends BaseWrapperProps<ComponentProps> = WrapperProps<ComponentProps>> = ComponentWrapperProps & WrapperHOCAdditionalProps<ComponentProps, ComponentWrapperProps>;
|
|
66
78
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAO1D,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,UAAU,CAGpB,wBAAwB,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,IACvD,cAAc,GAAG,wBAAwB,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,CAG1B,wBAAwB,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,IACvD,UAAU,CAAC,wBAAwB,CAAC,GAAG,gBAAgB,CAAC;AAE5D,MAAM,MAAM,gBAAgB,CAAC,cAAc,IAAI,SAAS,GAAG;IAEzD,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,cAAc,IAAI,gBAAgB,CAAC,cAAc,CAAC,GAAG;IAE5E,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,KAAK,CAAC,EAAE,MAAM,CAAC;IAMf,YAAY,CAAC,EAAE,MAAM,CAAC;IAOtB,aAAa,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAGnC,UAAU,CAAC,EAAE,OAAO,CAAC;IAIrB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAKtC,mBAAmB,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAG7C,mBAAmB,CAAC,EAAE,eAAe,CAAC;IAGtC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAI9B,SAAS,CAAC,EAAE,OAAO,CAAC;IAMpB,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CACjC,GAAG,cAAc,CAAC;AAEnB,MAAM,MAAM,UAAU,CAAC,cAAc,IAAI,CACvC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,KAC3C,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;AAEzC;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC;AAEzD,yDAAyD;AACzD,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,yBAAyB,CACnC,cAAc,SAAS,cAAc,EACrC,qBAAqB,SACnB,gBAAgB,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC,cAAc,CAAC,IAC/D;IACF;;QAEI;IACJ,UAAU,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;IAE1C;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;CAC/D,GAAG,uBAAuB,CAAC;AAE5B,MAAM,MAAM,qBAAqB,CAC/B,cAAc,SAAS,cAAc,EACrC,qBAAqB,SACnB,gBAAgB,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC,cAAc,CAAC,IAC/D,qBAAqB,GACvB,yBAAyB,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC"}
|
|
@@ -10,6 +10,6 @@ import "./styles.css";
|
|
|
10
10
|
*
|
|
11
11
|
* `import { Choices } from "@canonical/react-ds-global-form";`
|
|
12
12
|
*/
|
|
13
|
-
export declare const Choices: ({ id, className, style, name, isMultiple, disabled, layout, columns, options, value, onChange, }: ChoicesPresentationProps) => React.ReactElement;
|
|
13
|
+
export declare const Choices: ({ id, className, style, name, isMultiple, disabled, layout, columns, options, value, onChange, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, }: ChoicesPresentationProps) => React.ReactElement;
|
|
14
14
|
export default Choices;
|
|
15
15
|
//# sourceMappingURL=Choices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Choices.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/ChoicesField/Choices.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,cAAc,CAAC;AAItB;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"Choices.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/ChoicesField/Choices.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,cAAc,CAAC;AAItB;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,6KAcjB,wBAAwB,KAAG,KAAK,CAAC,YAqDnC,CAAC;eAEa,OAAO"}
|