@alma-oss/spirit-web-react 4.4.2 → 4.5.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/CHANGELOG.md +51 -0
- package/DEPRECATIONS.md +2 -2
- package/README.md +135 -6
- package/dist/bundles/web-react.umd.js +1731 -624
- package/dist/bundles/web-react.umd.js.map +1 -1
- package/dist/bundles/web-react.umd.min.js +1 -1
- package/dist/bundles/web-react.umd.min.js.map +1 -1
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.js +19 -19
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/ButtonLink/ButtonLink.cjs +1 -1
- package/dist/components/ButtonLink/ButtonLink.cjs.map +1 -1
- package/dist/components/ButtonLink/ButtonLink.d.ts +2 -2
- package/dist/components/ButtonLink/ButtonLink.js +23 -18
- package/dist/components/ButtonLink/ButtonLink.js.map +1 -1
- package/dist/components/ButtonLink/useButtonLinkStyleProps.cjs.map +1 -1
- package/dist/components/ButtonLink/useButtonLinkStyleProps.d.ts +9 -9
- package/dist/components/ButtonLink/useButtonLinkStyleProps.js.map +1 -1
- package/dist/components/Card/CardLink.cjs +1 -1
- package/dist/components/Card/CardLink.cjs.map +1 -1
- package/dist/components/Card/CardLink.d.ts +2 -2
- package/dist/components/Card/CardLink.js +10 -15
- package/dist/components/Card/CardLink.js.map +1 -1
- package/dist/components/CharacterCounter/CharacterCounter.cjs +2 -0
- package/dist/components/CharacterCounter/CharacterCounter.cjs.map +1 -0
- package/dist/components/CharacterCounter/CharacterCounter.d.ts +7 -0
- package/dist/components/CharacterCounter/CharacterCounter.js +23 -0
- package/dist/components/CharacterCounter/CharacterCounter.js.map +1 -0
- package/dist/components/CharacterCounter/constants.cjs +2 -0
- package/dist/components/CharacterCounter/constants.cjs.map +1 -0
- package/dist/components/CharacterCounter/constants.d.ts +1 -0
- package/dist/components/CharacterCounter/constants.js +5 -0
- package/dist/components/CharacterCounter/constants.js.map +1 -0
- package/dist/components/CharacterCounter/index.cjs +2 -0
- package/dist/components/CharacterCounter/index.d.ts +3 -0
- package/dist/components/CharacterCounter/index.js +7 -0
- package/dist/components/{UNSTABLE_Attachment → CharacterCounter}/index.js.map +1 -1
- package/dist/components/CharacterCounter/types.d.ts +6 -0
- package/dist/components/CharacterCounter/useCharacterCounterState.cjs +2 -0
- package/dist/components/CharacterCounter/useCharacterCounterState.cjs.map +1 -0
- package/dist/components/CharacterCounter/useCharacterCounterState.d.ts +25 -0
- package/dist/components/CharacterCounter/useCharacterCounterState.js +66 -0
- package/dist/components/CharacterCounter/useCharacterCounterState.js.map +1 -0
- package/dist/components/CharacterCounter.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +58 -54
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/ControlButton/useControlButtonStyleProps.cjs.map +1 -1
- package/dist/components/ControlButton/useControlButtonStyleProps.js.map +1 -1
- package/dist/components/Dropdown/DropdownPopover.cjs.map +1 -1
- package/dist/components/Dropdown/DropdownPopover.d.ts +2 -2
- package/dist/components/Dropdown/DropdownPopover.js.map +1 -1
- package/dist/components/Field/index.cjs +1 -1
- package/dist/components/Field/index.d.ts +0 -2
- package/dist/components/Field/index.js +2 -4
- package/dist/components/Field/index.js.map +1 -1
- package/dist/components/Field/types.d.ts +1 -1
- package/dist/components/FieldGroup/FieldGroup.cjs +1 -1
- package/dist/components/FieldGroup/FieldGroup.cjs.map +1 -1
- package/dist/components/FieldGroup/FieldGroup.js +15 -16
- package/dist/components/FieldGroup/FieldGroup.js.map +1 -1
- package/dist/components/FileUploader/FileUploaderInput.cjs +1 -1
- package/dist/components/FileUploader/FileUploaderInput.cjs.map +1 -1
- package/dist/components/FileUploader/FileUploaderInput.js +36 -35
- package/dist/components/FileUploader/FileUploaderInput.js.map +1 -1
- package/dist/components/Header/HeaderDialogLink.cjs +1 -1
- package/dist/components/Header/HeaderDialogLink.cjs.map +1 -1
- package/dist/components/Header/HeaderDialogLink.js +18 -17
- package/dist/components/Header/HeaderDialogLink.js.map +1 -1
- package/dist/components/Header/HeaderLink.cjs +1 -1
- package/dist/components/Header/HeaderLink.cjs.map +1 -1
- package/dist/components/Header/HeaderLink.js +16 -15
- package/dist/components/Header/HeaderLink.js.map +1 -1
- package/dist/components/InputDetails/InputDetails.cjs +2 -0
- package/dist/components/InputDetails/InputDetails.cjs.map +1 -0
- package/dist/components/InputDetails/InputDetails.d.ts +7 -0
- package/dist/components/InputDetails/InputDetails.js +21 -0
- package/dist/components/InputDetails/InputDetails.js.map +1 -0
- package/dist/components/InputDetails/index.cjs +2 -0
- package/dist/components/InputDetails/index.cjs.map +1 -0
- package/dist/components/InputDetails/index.d.ts +2 -0
- package/dist/components/InputDetails/index.js +7 -0
- package/dist/components/InputDetails/index.js.map +1 -0
- package/dist/components/InputDetails/useInputDetailsStyleProps.cjs +2 -0
- package/dist/components/InputDetails/useInputDetailsStyleProps.cjs.map +1 -0
- package/dist/components/InputDetails/useInputDetailsStyleProps.d.ts +7 -0
- package/dist/components/InputDetails/useInputDetailsStyleProps.js +11 -0
- package/dist/components/InputDetails/useInputDetailsStyleProps.js.map +1 -0
- package/dist/components/InputDetails.d.ts +2 -0
- package/dist/components/Link/Link.cjs +1 -1
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.js +10 -9
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/Link/useLinkStyleProps.cjs.map +1 -1
- package/dist/components/Link/useLinkStyleProps.d.ts +1 -1
- package/dist/components/Link/useLinkStyleProps.js.map +1 -1
- package/dist/components/Pagination/PaginationLink.cjs +1 -1
- package/dist/components/Pagination/PaginationLink.cjs.map +1 -1
- package/dist/components/Pagination/PaginationLink.js +29 -18
- package/dist/components/Pagination/PaginationLink.js.map +1 -1
- package/dist/components/Radio/Radio.cjs +1 -1
- package/dist/components/Radio/Radio.cjs.map +1 -1
- package/dist/components/Radio/Radio.js +24 -25
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/ScrollView/useScrollPosition.js +4 -4
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.cjs.map +1 -1
- package/dist/components/Select/Select.js +28 -29
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Slider/Slider.cjs +1 -1
- package/dist/components/Slider/Slider.cjs.map +1 -1
- package/dist/components/Slider/Slider.js +23 -24
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Tabs/TabLink.cjs +1 -1
- package/dist/components/Tabs/TabLink.cjs.map +1 -1
- package/dist/components/Tabs/TabLink.js +18 -17
- package/dist/components/Tabs/TabLink.js.map +1 -1
- package/dist/components/Tag/constants.cjs +1 -1
- package/dist/components/Tag/constants.cjs.map +1 -1
- package/dist/components/Tag/constants.d.ts +1 -0
- package/dist/components/Tag/constants.js +4 -3
- package/dist/components/Tag/constants.js.map +1 -1
- package/dist/components/Tag/useTagStyleProps.cjs +1 -1
- package/dist/components/Tag/useTagStyleProps.cjs.map +1 -1
- package/dist/components/Tag/useTagStyleProps.js +25 -10
- package/dist/components/Tag/useTagStyleProps.js.map +1 -1
- package/dist/components/TextArea/TextArea.cjs +1 -1
- package/dist/components/TextArea/TextArea.cjs.map +1 -1
- package/dist/components/TextArea/TextArea.js +57 -21
- package/dist/components/TextArea/TextArea.js.map +1 -1
- package/dist/components/TextArea/constants.cjs +2 -0
- package/dist/components/TextArea/constants.cjs.map +1 -0
- package/dist/components/TextArea/constants.d.ts +1 -0
- package/dist/components/TextArea/constants.js +5 -0
- package/dist/components/TextArea/constants.js.map +1 -0
- package/dist/components/TextFieldBase/TextFieldBase.cjs +1 -1
- package/dist/components/TextFieldBase/TextFieldBase.cjs.map +1 -1
- package/dist/components/TextFieldBase/TextFieldBase.js +69 -59
- package/dist/components/TextFieldBase/TextFieldBase.js.map +1 -1
- package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.cjs +1 -1
- package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.cjs.map +1 -1
- package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.d.ts +1 -0
- package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.js +11 -10
- package/dist/components/TextFieldBase/useTextFieldBaseStyleProps.js.map +1 -1
- package/dist/components/Toggle/Toggle.cjs +1 -1
- package/dist/components/Toggle/Toggle.cjs.map +1 -1
- package/dist/components/Toggle/Toggle.js +59 -55
- package/dist/components/Toggle/Toggle.js.map +1 -1
- package/dist/components/UNSTABLE_File/UNSTABLE_File.cjs +2 -0
- package/dist/components/UNSTABLE_File/UNSTABLE_File.cjs.map +1 -0
- package/dist/components/UNSTABLE_File/UNSTABLE_File.d.ts +8 -0
- package/dist/components/UNSTABLE_File/UNSTABLE_File.js +88 -0
- package/dist/components/UNSTABLE_File/UNSTABLE_File.js.map +1 -0
- package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.cjs +2 -0
- package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.cjs.map +1 -0
- package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.d.ts +8 -0
- package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.js +29 -0
- package/dist/components/UNSTABLE_File/UNSTABLE_FileImagePreview.js.map +1 -0
- package/dist/components/UNSTABLE_File/constants.cjs +2 -0
- package/dist/components/UNSTABLE_File/constants.cjs.map +1 -0
- package/dist/components/UNSTABLE_File/constants.d.ts +9 -0
- package/dist/components/UNSTABLE_File/constants.js +13 -0
- package/dist/components/UNSTABLE_File/constants.js.map +1 -0
- package/dist/components/UNSTABLE_File/index.cjs +2 -0
- package/dist/components/UNSTABLE_File/index.cjs.map +1 -0
- package/dist/components/UNSTABLE_File/index.d.ts +6 -0
- package/dist/components/UNSTABLE_File/index.js +16 -0
- package/dist/components/UNSTABLE_File/index.js.map +1 -0
- package/dist/components/UNSTABLE_File/types.d.ts +48 -0
- package/dist/components/UNSTABLE_File/useFileImageStyles.cjs +2 -0
- package/dist/components/UNSTABLE_File/useFileImageStyles.cjs.map +1 -0
- package/dist/components/UNSTABLE_File/useFileImageStyles.d.ts +19 -0
- package/dist/components/UNSTABLE_File/useFileImageStyles.js +21 -0
- package/dist/components/UNSTABLE_File/useFileImageStyles.js.map +1 -0
- package/dist/components/UNSTABLE_File/useFileStyleProps.cjs +2 -0
- package/dist/components/UNSTABLE_File/useFileStyleProps.cjs.map +1 -0
- package/dist/components/UNSTABLE_File/useFileStyleProps.d.ts +20 -0
- package/dist/components/UNSTABLE_File/useFileStyleProps.js +29 -0
- package/dist/components/UNSTABLE_File/useFileStyleProps.js.map +1 -0
- package/dist/components/UNSTABLE_File.d.ts +2 -0
- package/dist/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.cjs +1 -1
- package/dist/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.cjs.map +1 -1
- package/dist/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.js +129 -112
- package/dist/components/UNSTABLE_FileUpload/UNSTABLE_FileUpload.js.map +1 -1
- package/dist/components/UNSTABLE_FileUpload/types.d.ts +6 -3
- package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.cjs +1 -1
- package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.cjs.map +1 -1
- package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.d.ts +2 -3
- package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.js +18 -16
- package/dist/components/UNSTABLE_FileUpload/useFileUploadStyleProps.js.map +1 -1
- package/dist/components/UNSTABLE_Picker/PickerContext.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/PickerContext.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/PickerContext.d.ts +3 -0
- package/dist/components/UNSTABLE_Picker/PickerContext.js +9 -0
- package/dist/components/UNSTABLE_Picker/PickerContext.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/PickerPopoverContext.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/PickerPopoverContext.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/PickerPopoverContext.d.ts +3 -0
- package/dist/components/UNSTABLE_Picker/PickerPopoverContext.js +16 -0
- package/dist/components/UNSTABLE_Picker/PickerPopoverContext.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.d.ts +4 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.js +204 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_Picker.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.d.ts +7 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.js +14 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerGroup.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.d.ts +7 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.js +32 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerItem.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.d.ts +7 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.js +64 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_PickerTag.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.d.ts +4 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.js +40 -0
- package/dist/components/UNSTABLE_Picker/UNSTABLE_UncontrolledPicker.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/constants.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/constants.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/constants.d.ts +6 -0
- package/dist/components/UNSTABLE_Picker/constants.js +11 -0
- package/dist/components/UNSTABLE_Picker/constants.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/index.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/index.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/index.d.ts +11 -0
- package/dist/components/UNSTABLE_Picker/index.js +26 -0
- package/dist/components/UNSTABLE_Picker/index.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/types.d.ts +91 -0
- package/dist/components/UNSTABLE_Picker/usePickerId.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/usePickerId.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/usePickerId.d.ts +8 -0
- package/dist/components/UNSTABLE_Picker/usePickerId.js +15 -0
- package/dist/components/UNSTABLE_Picker/usePickerId.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.d.ts +11 -0
- package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.js +27 -0
- package/dist/components/UNSTABLE_Picker/usePickerPopoverTabOutToTrigger.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.d.ts +13 -0
- package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.js +95 -0
- package/dist/components/UNSTABLE_Picker/usePickerSelectionGridKeyboard.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/usePickerStyleProps.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/usePickerStyleProps.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/usePickerStyleProps.d.ts +21 -0
- package/dist/components/UNSTABLE_Picker/usePickerStyleProps.js +29 -0
- package/dist/components/UNSTABLE_Picker/usePickerStyleProps.js.map +1 -0
- package/dist/components/UNSTABLE_Picker/utils.cjs +2 -0
- package/dist/components/UNSTABLE_Picker/utils.cjs.map +1 -0
- package/dist/components/UNSTABLE_Picker/utils.d.ts +10 -0
- package/dist/components/UNSTABLE_Picker/utils.js +41 -0
- package/dist/components/UNSTABLE_Picker/utils.js.map +1 -0
- package/dist/components/UNSTABLE_Picker.d.ts +2 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.js +523 -498
- package/dist/components/index.js.map +1 -1
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +43 -40
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/selection.cjs +2 -0
- package/dist/constants/selection.cjs.map +1 -0
- package/dist/constants/selection.d.ts +2 -0
- package/dist/constants/selection.js +6 -0
- package/dist/constants/selection.js.map +1 -0
- package/dist/context/RouterContext.cjs +2 -0
- package/dist/context/RouterContext.cjs.map +1 -0
- package/dist/context/RouterContext.d.ts +16 -0
- package/dist/context/RouterContext.js +12 -0
- package/dist/context/RouterContext.js.map +1 -0
- package/dist/context/index.cjs +1 -1
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.js +11 -7
- package/dist/context/index.js.map +1 -1
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +5 -1
- package/dist/hooks/index.js +54 -40
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useAriaIdRefs.cjs +2 -0
- package/dist/hooks/useAriaIdRefs.cjs.map +1 -0
- package/dist/hooks/useAriaIdRefs.d.ts +11 -0
- package/dist/hooks/useAriaIdRefs.js +23 -0
- package/dist/hooks/useAriaIdRefs.js.map +1 -0
- package/dist/hooks/useControlledModeGuard.cjs +2 -0
- package/dist/hooks/useControlledModeGuard.cjs.map +1 -0
- package/dist/hooks/useControlledModeGuard.d.ts +10 -0
- package/dist/hooks/useControlledModeGuard.js +33 -0
- package/dist/hooks/useControlledModeGuard.js.map +1 -0
- package/dist/hooks/useDebouncedValue.cjs +2 -0
- package/dist/hooks/useDebouncedValue.cjs.map +1 -0
- package/dist/hooks/useDebouncedValue.d.ts +1 -0
- package/dist/hooks/useDebouncedValue.js +17 -0
- package/dist/hooks/useDebouncedValue.js.map +1 -0
- package/dist/hooks/useLinkClick.cjs +2 -0
- package/dist/hooks/useLinkClick.cjs.map +1 -0
- package/dist/hooks/useLinkClick.d.ts +4 -0
- package/dist/hooks/useLinkClick.js +15 -0
- package/dist/hooks/useLinkClick.js.map +1 -0
- package/dist/hooks/useSelectionState.cjs +2 -0
- package/dist/hooks/useSelectionState.cjs.map +1 -0
- package/dist/hooks/useSelectionState.d.ts +17 -0
- package/dist/hooks/useSelectionState.js +41 -0
- package/dist/hooks/useSelectionState.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +722 -673
- package/dist/index.js.map +1 -1
- package/dist/translations/defaults.cjs +1 -1
- package/dist/translations/defaults.cjs.map +1 -1
- package/dist/translations/defaults.d.ts +17 -0
- package/dist/translations/defaults.js +17 -0
- package/dist/translations/defaults.js.map +1 -1
- package/dist/types/button.d.ts +3 -2
- package/dist/types/card.cjs.map +1 -1
- package/dist/types/card.d.ts +5 -7
- package/dist/types/card.js.map +1 -1
- package/dist/types/checkbox.d.ts +2 -2
- package/dist/types/controlButton.d.ts +2 -3
- package/dist/types/header.d.ts +3 -3
- package/dist/types/index.d.ts +1 -0
- package/dist/types/inputDetails.d.ts +9 -0
- package/dist/types/link.cjs.map +1 -1
- package/dist/types/link.d.ts +2 -2
- package/dist/types/link.js.map +1 -1
- package/dist/types/pagination.d.ts +4 -4
- package/dist/types/shared/index.cjs.map +1 -1
- package/dist/types/shared/index.d.ts +1 -0
- package/dist/types/shared/index.js.map +1 -1
- package/dist/types/shared/inputs.d.ts +3 -0
- package/dist/types/shared/router.d.ts +3 -0
- package/dist/types/tabs.d.ts +2 -2
- package/dist/types/tag.d.ts +1 -0
- package/dist/types/textArea.d.ts +26 -5
- package/dist/types/textFieldBase.d.ts +5 -2
- package/dist/types/toggle.d.ts +2 -2
- package/dist/utils/debounce.cjs +1 -1
- package/dist/utils/debounce.cjs.map +1 -1
- package/dist/utils/debounce.d.ts +4 -1
- package/dist/utils/debounce.js +11 -8
- package/dist/utils/debounce.js.map +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +36 -33
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/router.cjs +2 -0
- package/dist/utils/router.cjs.map +1 -0
- package/dist/utils/router.d.ts +12 -0
- package/dist/utils/router.js +10 -0
- package/dist/utils/router.js.map +1 -0
- package/dist/utils/string.cjs +1 -1
- package/dist/utils/string.cjs.map +1 -1
- package/dist/utils/string.d.ts +1 -0
- package/dist/utils/string.js +10 -9
- package/dist/utils/string.js.map +1 -1
- package/package.json +38 -23
- package/dist/components/Field/useAriaIds.cjs +0 -2
- package/dist/components/Field/useAriaIds.cjs.map +0 -1
- package/dist/components/Field/useAriaIds.d.ts +0 -8
- package/dist/components/Field/useAriaIds.js +0 -15
- package/dist/components/Field/useAriaIds.js.map +0 -1
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.cjs +0 -2
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.cjs.map +0 -1
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.d.ts +0 -8
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.js +0 -42
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_Attachment.js.map +0 -1
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.cjs +0 -2
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.cjs.map +0 -1
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.d.ts +0 -8
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.js +0 -30
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentActionButton.js.map +0 -1
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.cjs +0 -2
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.cjs.map +0 -1
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.d.ts +0 -8
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.js +0 -29
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.js.map +0 -1
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.cjs +0 -2
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.cjs.map +0 -1
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.d.ts +0 -8
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.js +0 -29
- package/dist/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.js.map +0 -1
- package/dist/components/UNSTABLE_Attachment/constants.cjs +0 -2
- package/dist/components/UNSTABLE_Attachment/constants.cjs.map +0 -1
- package/dist/components/UNSTABLE_Attachment/constants.d.ts +0 -9
- package/dist/components/UNSTABLE_Attachment/constants.js +0 -13
- package/dist/components/UNSTABLE_Attachment/constants.js.map +0 -1
- package/dist/components/UNSTABLE_Attachment/index.cjs +0 -2
- package/dist/components/UNSTABLE_Attachment/index.d.ts +0 -8
- package/dist/components/UNSTABLE_Attachment/index.js +0 -20
- package/dist/components/UNSTABLE_Attachment/types.d.ts +0 -42
- package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.cjs +0 -2
- package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.cjs.map +0 -1
- package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.d.ts +0 -18
- package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.js +0 -22
- package/dist/components/UNSTABLE_Attachment/useAttachmentImageStyles.js.map +0 -1
- package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.cjs +0 -2
- package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.cjs.map +0 -1
- package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.d.ts +0 -21
- package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.js +0 -24
- package/dist/components/UNSTABLE_Attachment/useAttachmentStyleProps.js.map +0 -1
- package/dist/components/UNSTABLE_Attachment.d.ts +0 -2
- package/dist/hooks/useAriaDescribedBy.cjs +0 -2
- package/dist/hooks/useAriaDescribedBy.cjs.map +0 -1
- package/dist/hooks/useAriaDescribedBy.d.ts +0 -5
- package/dist/hooks/useAriaDescribedBy.js +0 -7
- package/dist/hooks/useAriaDescribedBy.js.map +0 -1
- /package/dist/components/{UNSTABLE_Attachment → CharacterCounter}/index.cjs.map +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState as f, useCallback as R, useEffect as h } from "react";
|
|
3
|
+
import { useStyleProps as v } from "../../hooks/styleProps.js";
|
|
4
|
+
import { useControlledModeGuard as E } from "../../hooks/useControlledModeGuard.js";
|
|
5
|
+
import { useDebouncedValue as S } from "../../hooks/useDebouncedValue.js";
|
|
6
|
+
import { defaultLabels as b } from "../../translations/defaults.js";
|
|
7
|
+
import { replaceTranslationParams as m } from "../../translations/replaceTranslationParams.js";
|
|
8
|
+
import { CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS as _ } from "./constants.js";
|
|
9
|
+
const i = b.textArea.counter, M = (t, e) => e !== void 0 ? `${t}/${e}` : String(t), P = (t, e) => {
|
|
10
|
+
if (e === void 0)
|
|
11
|
+
return m(i.charactersEntered, { count: t });
|
|
12
|
+
if (t === 0)
|
|
13
|
+
return m(i.canEnterUpTo, { maxLength: e });
|
|
14
|
+
if (t > e) {
|
|
15
|
+
const s = t - e, n = s === 1 ? i.characterOverLimit : i.charactersOverLimit;
|
|
16
|
+
return m(n, { count: s });
|
|
17
|
+
}
|
|
18
|
+
const r = e - t, a = r === 1 ? i.characterRemaining : i.charactersRemaining;
|
|
19
|
+
return m(a, { count: r });
|
|
20
|
+
}, U = (t) => {
|
|
21
|
+
const { value: e, defaultValue: r, counterThreshold: a, hasCounter: s, onChange: n } = t, c = e !== void 0;
|
|
22
|
+
E({
|
|
23
|
+
componentName: "useCharacterCounterState",
|
|
24
|
+
value: e,
|
|
25
|
+
defaultValue: r
|
|
26
|
+
});
|
|
27
|
+
const [C, d] = f(
|
|
28
|
+
() => c ? e.length : r?.length ?? 0
|
|
29
|
+
), u = c ? e.length : C, o = s === !0 || a !== void 0, p = R(
|
|
30
|
+
(l) => {
|
|
31
|
+
!c && o && d(l.target.value.length), n?.(l);
|
|
32
|
+
},
|
|
33
|
+
[c, o, n]
|
|
34
|
+
);
|
|
35
|
+
return {
|
|
36
|
+
counterProps: o ? {
|
|
37
|
+
counterThreshold: a,
|
|
38
|
+
currentLength: u,
|
|
39
|
+
hasCounter: s
|
|
40
|
+
} : void 0,
|
|
41
|
+
handleChange: p
|
|
42
|
+
};
|
|
43
|
+
}, D = (t) => {
|
|
44
|
+
const { counterThreshold: e, currentLength: r, hasCounter: a, id: s, registerAria: n, ...c } = t, { styleProps: C, props: d } = v(c), u = a === !0 || e !== void 0, o = `${s}__counterScreenReaderMessage`, p = M(r, e), g = P(r, e), l = S(
|
|
45
|
+
g,
|
|
46
|
+
_
|
|
47
|
+
);
|
|
48
|
+
return h(() => {
|
|
49
|
+
if (u)
|
|
50
|
+
return n({ add: o }), () => {
|
|
51
|
+
n({ remove: o });
|
|
52
|
+
};
|
|
53
|
+
}, [u, o, n]), {
|
|
54
|
+
debouncedScreenReaderMessage: l,
|
|
55
|
+
isVisible: u,
|
|
56
|
+
screenReaderMessageId: o,
|
|
57
|
+
styleProps: C,
|
|
58
|
+
transferProps: d,
|
|
59
|
+
visibleCounterText: p
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
D as useCharacterCounter,
|
|
64
|
+
U as useCharacterCounterState
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=useCharacterCounterState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCharacterCounterState.js","sources":["../../../src/components/CharacterCounter/useCharacterCounterState.ts"],"sourcesContent":["'use client';\n\nimport { type ChangeEvent, useCallback, useEffect, useState } from 'react';\nimport { type StylePropsResult, useControlledModeGuard, useDebouncedValue, useStyleProps } from '../../hooks';\nimport { defaultLabels, replaceTranslationParams } from '../../translations';\nimport { type TextAreaCounterRenderProps } from '../../types';\nimport { CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS } from './constants';\nimport { type CharacterCounterProps } from './types';\n\n/** Return value of the useCharacterCounterState hook */\nexport interface CharacterCounterState {\n /** Props to pass to CharacterCounter, or undefined when counter is hidden */\n counterProps: TextAreaCounterRenderProps | undefined;\n /** Change handler that updates internal length and calls the provided onChange */\n handleChange: (event: ChangeEvent<HTMLTextAreaElement>) => void;\n}\n\n/** Props for the useCharacterCounterState hook */\nexport interface UseCharacterCounterStateProps {\n /** Character threshold shown after the slash in the counter (e.g. `5/200`); implicitly enables the counter */\n counterThreshold?: number;\n /** Initial value when uncontrolled */\n defaultValue?: string;\n /** Whether to show the character counter; automatically true when `counterThreshold` is set */\n hasCounter?: boolean;\n /** Called when the textarea value changes */\n onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;\n /** Controlled value (takes precedence over defaultValue) */\n value?: string;\n}\n\n/** Return value of the `useCharacterCounter` hook (visible + screen reader presentation for `CharacterCounter`). */\nexport interface UseCharacterCounterResult {\n debouncedScreenReaderMessage: string;\n isVisible: boolean;\n screenReaderMessageId: string;\n styleProps: StylePropsResult['styleProps'];\n transferProps: StylePropsResult['props'];\n visibleCounterText: string;\n}\n\nconst COUNTER_LABELS = defaultLabels.textArea.counter;\n\n/**\n * Builds the visible counter label (`current/max` or count only).\n *\n * @param currentLength - Current number of characters.\n * @param counterThreshold - When set, label includes a slash and this max; when omitted, only the count is shown.\n * @returns {string} Formatted string for the aria-hidden counter element.\n */\nconst getCharacterCounterVisibleText = (currentLength: number, counterThreshold: number | undefined): string =>\n counterThreshold !== undefined ? `${currentLength}/${counterThreshold}` : String(currentLength);\n\n/**\n * Builds the polite live-region message for assistive technologies (remaining, over limit, count-only, etc.).\n *\n * @param currentLength - Current number of characters.\n * @param counterThreshold - When set, messages relate to this max; when omitted, only “characters entered” copy is used.\n * @returns {string} Localized screen reader string (not debounced).\n */\nconst getCharacterCounterScreenReaderMessage = (\n currentLength: number,\n counterThreshold: number | undefined,\n): string => {\n if (counterThreshold === undefined) {\n return replaceTranslationParams(COUNTER_LABELS.charactersEntered, { count: currentLength });\n }\n\n if (currentLength === 0) {\n return replaceTranslationParams(COUNTER_LABELS.canEnterUpTo, { maxLength: counterThreshold });\n }\n\n if (currentLength > counterThreshold) {\n const overCount = currentLength - counterThreshold;\n const template = overCount === 1 ? COUNTER_LABELS.characterOverLimit : COUNTER_LABELS.charactersOverLimit;\n\n return replaceTranslationParams(template, { count: overCount });\n }\n\n const remaining = counterThreshold - currentLength;\n const template = remaining === 1 ? COUNTER_LABELS.characterRemaining : COUNTER_LABELS.charactersRemaining;\n\n return replaceTranslationParams(template, { count: remaining });\n};\n\n/**\n * Tracks textarea length for `TextArea` and exposes `counterProps` plus a change handler when the counter is active.\n *\n * @param props - Controlled/uncontrolled value and counter flags; see {@link UseCharacterCounterStateProps}.\n * @returns {CharacterCounterState} Counter props for `CharacterCounter` (if visible) and textarea `onChange` handler.\n */\nexport const useCharacterCounterState = (props: UseCharacterCounterStateProps): CharacterCounterState => {\n const { value, defaultValue, counterThreshold, hasCounter, onChange } = props;\n const isControlled = value !== undefined;\n\n useControlledModeGuard({\n componentName: 'useCharacterCounterState',\n value,\n defaultValue,\n });\n\n const [internalLength, setInternalLength] = useState(() =>\n isControlled ? value.length : (defaultValue?.length ?? 0),\n );\n\n const currentLength = isControlled ? value.length : internalLength;\n const isCounterVisible = hasCounter === true || counterThreshold !== undefined;\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLTextAreaElement>) => {\n if (!isControlled && isCounterVisible) {\n setInternalLength(event.target.value.length);\n }\n onChange?.(event);\n },\n [isControlled, isCounterVisible, onChange],\n );\n\n const counterProps: TextAreaCounterRenderProps | undefined = isCounterVisible\n ? {\n counterThreshold,\n currentLength,\n hasCounter,\n }\n : undefined;\n\n return {\n counterProps,\n handleChange,\n };\n};\n\n/**\n * Presentation hook for `CharacterCounter`: style props, visible text, debounced screen reader text, and ARIA id registration.\n *\n * @param props - Full `CharacterCounterProps` including `id` and `registerAria`.\n * @returns {UseCharacterCounterResult} Values to render the visible counter and `VisuallyHidden` live region.\n */\nexport const useCharacterCounter = (props: CharacterCounterProps): UseCharacterCounterResult => {\n const { counterThreshold, currentLength, hasCounter, id, registerAria, ...restProps } = props;\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n const isVisible = hasCounter === true || counterThreshold !== undefined;\n const screenReaderMessageId = `${id}__counterScreenReaderMessage`;\n const visibleCounterText = getCharacterCounterVisibleText(currentLength, counterThreshold);\n const screenReaderMessage = getCharacterCounterScreenReaderMessage(currentLength, counterThreshold);\n const debouncedScreenReaderMessage = useDebouncedValue(\n screenReaderMessage,\n CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS,\n );\n\n useEffect(() => {\n if (isVisible) {\n registerAria({ add: screenReaderMessageId });\n\n return () => {\n registerAria({ remove: screenReaderMessageId });\n };\n }\n\n return undefined;\n }, [isVisible, screenReaderMessageId, registerAria]);\n\n return {\n debouncedScreenReaderMessage,\n isVisible,\n screenReaderMessageId,\n styleProps,\n transferProps,\n visibleCounterText,\n };\n};\n"],"names":["COUNTER_LABELS","defaultLabels","getCharacterCounterVisibleText","currentLength","counterThreshold","getCharacterCounterScreenReaderMessage","replaceTranslationParams","overCount","template","remaining","useCharacterCounterState","props","value","defaultValue","hasCounter","onChange","isControlled","useControlledModeGuard","internalLength","setInternalLength","useState","isCounterVisible","handleChange","useCallback","event","useCharacterCounter","id","registerAria","restProps","styleProps","transferProps","useStyleProps","isVisible","screenReaderMessageId","visibleCounterText","screenReaderMessage","debouncedScreenReaderMessage","useDebouncedValue","CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS","useEffect"],"mappings":";;;;;;;;AAyCA,MAAMA,IAAiBC,EAAc,SAAS,SASxCC,IAAiC,CAACC,GAAuBC,MAC7DA,MAAqB,SAAY,GAAGD,CAAa,IAAIC,CAAgB,KAAK,OAAOD,CAAa,GAS1FE,IAAyC,CAC7CF,GACAC,MACW;AACX,MAAIA,MAAqB;AACvB,WAAOE,EAAyBN,EAAe,mBAAmB,EAAE,OAAOG,GAAe;AAG5F,MAAIA,MAAkB;AACpB,WAAOG,EAAyBN,EAAe,cAAc,EAAE,WAAWI,GAAkB;AAG9F,MAAID,IAAgBC,GAAkB;AACpC,UAAMG,IAAYJ,IAAgBC,GAC5BI,IAAWD,MAAc,IAAIP,EAAe,qBAAqBA,EAAe;AAEtF,WAAOM,EAAyBE,GAAU,EAAE,OAAOD,GAAW;AAAA,EAChE;AAEA,QAAME,IAAYL,IAAmBD,GAC/BK,IAAWC,MAAc,IAAIT,EAAe,qBAAqBA,EAAe;AAEtF,SAAOM,EAAyBE,GAAU,EAAE,OAAOC,GAAW;AAChE,GAQaC,IAA2B,CAACC,MAAgE;AACvG,QAAM,EAAE,OAAAC,GAAO,cAAAC,GAAc,kBAAAT,GAAkB,YAAAU,GAAY,UAAAC,MAAaJ,GAClEK,IAAeJ,MAAU;AAE/B,EAAAK,EAAuB;AAAA,IACrB,eAAe;AAAA,IACf,OAAAL;AAAA,IACA,cAAAC;AAAA,EAAA,CACD;AAED,QAAM,CAACK,GAAgBC,CAAiB,IAAIC;AAAA,IAAS,MACnDJ,IAAeJ,EAAM,SAAUC,GAAc,UAAU;AAAA,EAAA,GAGnDV,IAAgBa,IAAeJ,EAAM,SAASM,GAC9CG,IAAmBP,MAAe,MAAQV,MAAqB,QAE/DkB,IAAeC;AAAA,IACnB,CAACC,MAA4C;AAC3C,MAAI,CAACR,KAAgBK,KACnBF,EAAkBK,EAAM,OAAO,MAAM,MAAM,GAE7CT,IAAWS,CAAK;AAAA,IAClB;AAAA,IACA,CAACR,GAAcK,GAAkBN,CAAQ;AAAA,EAAA;AAW3C,SAAO;AAAA,IACL,cAT2DM,IACzD;AAAA,MACE,kBAAAjB;AAAA,MACA,eAAAD;AAAA,MACA,YAAAW;AAAA,IAAA,IAEF;AAAA,IAIF,cAAAQ;AAAA,EAAA;AAEJ,GAQaG,IAAsB,CAACd,MAA4D;AAC9F,QAAM,EAAE,kBAAAP,GAAkB,eAAAD,GAAe,YAAAW,GAAY,IAAAY,GAAI,cAAAC,GAAc,GAAGC,MAAcjB,GAClF,EAAE,YAAAkB,GAAY,OAAOC,EAAA,IAAkBC,EAAcH,CAAS,GAC9DI,IAAYlB,MAAe,MAAQV,MAAqB,QACxD6B,IAAwB,GAAGP,CAAE,gCAC7BQ,IAAqBhC,EAA+BC,GAAeC,CAAgB,GACnF+B,IAAsB9B,EAAuCF,GAAeC,CAAgB,GAC5FgC,IAA+BC;AAAA,IACnCF;AAAA,IACAG;AAAA,EAAA;AAGF,SAAAC,EAAU,MAAM;AACd,QAAIP;AACF,aAAAL,EAAa,EAAE,KAAKM,GAAuB,GAEpC,MAAM;AACX,QAAAN,EAAa,EAAE,QAAQM,GAAuB;AAAA,MAChD;AAAA,EAIJ,GAAG,CAACD,GAAWC,GAAuBN,CAAY,CAAC,GAE5C;AAAA,IACL,8BAAAS;AAAA,IACA,WAAAJ;AAAA,IACA,uBAAAC;AAAA,IACA,YAAAJ;AAAA,IACA,eAAAC;AAAA,IACA,oBAAAI;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),j=require("classnames"),k=require("react"),C=require("../../hooks/styleProps.cjs"),d=require("../../hooks/useAriaIdRefs.cjs"),R=require("../Field/HelperText.cjs"),g=require("../Field/Label.cjs"),V=require("../Field/ValidationText.cjs"),F=require("../Field/useValidationTextRole.cjs"),I=require("../InputDetails/InputDetails.cjs"),$=require("./useCheckboxStyleProps.cjs"),B=(n,u)=>{const{classProps:s,props:p}=$.useCheckboxStyleProps(n),{"aria-describedby":x="","aria-details":h,details:a,hasValidationIcon:b,helperText:y,id:t,isChecked:m,isDisabled:q,isRequired:P,label:N,validationState:i,validationText:l,value:T,...f}=p,{styleProps:o,props:v}=C.useStyleProps(f),[A,c]=d.useAriaDescribedBy(x),[D,S]=d.useAriaDetails(h),_=F.useValidationTextRole({validationState:i,validationText:l});return e.jsxs("div",{style:o.style,className:j(s.root,o.className),children:[e.jsx("input",{...v,...A,...D,type:"checkbox",id:t,className:s.input,disabled:q,required:P,checked:m,value:T,ref:u}),e.jsxs("div",{className:s.text,children:[e.jsx(g.default,{UNSAFE_className:s.label,htmlFor:t,children:N}),a&&e.jsx(I.default,{id:`${t}-details`,registerAriaDetails:S,children:a}),e.jsx(R.default,{UNSAFE_className:s.helperText,id:`${t}__helperText`,registerAria:c,helperText:y}),i&&e.jsx(V.default,{UNSAFE_className:s.validationText,id:`${t}__validationText`,...b&&{hasValidationStateIcon:i},validationText:l,registerAria:c,role:_})]})]})},r=k.forwardRef(B);r.spiritComponent="Checkbox";r.displayName="Checkbox";exports.default=r;
|
|
2
2
|
//# sourceMappingURL=Checkbox.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.cjs","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritCheckboxProps } from '../../types';\nimport { HelperText, Label, ValidationText
|
|
1
|
+
{"version":3,"file":"Checkbox.cjs","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useAriaDetails, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritCheckboxProps } from '../../types';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { InputDetails } from '../InputDetails';\nimport { useCheckboxStyleProps } from './useCheckboxStyleProps';\n\nconst _Checkbox = (props: SpiritCheckboxProps, ref: ForwardedRef<HTMLInputElement>): JSX.Element => {\n const { classProps, props: modifiedProps } = useCheckboxStyleProps(props);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n 'aria-details': ariaDetailsAttr,\n details,\n hasValidationIcon,\n helperText,\n id,\n isChecked,\n isDisabled,\n isRequired,\n label,\n validationState,\n validationText,\n value,\n ...restProps\n } = modifiedProps;\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const [ariaDetailsProp, registerDetails] = useAriaDetails(ariaDetailsAttr);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <div style={styleProps.style} className={classNames(classProps.root, styleProps.className)}>\n <input\n {...otherProps}\n {...ariaDescribedByProp}\n {...ariaDetailsProp}\n type=\"checkbox\"\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n required={isRequired}\n checked={isChecked}\n value={value}\n ref={ref}\n />\n <div className={classProps.text}>\n <Label UNSAFE_className={classProps.label} htmlFor={id}>\n {label}\n </Label>\n {details && (\n <InputDetails id={`${id}-details`} registerAriaDetails={registerDetails}>\n {details}\n </InputDetails>\n )}\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n id={`${id}__validationText`}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n </div>\n );\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, SpiritCheckboxProps>(_Checkbox) as ForwardRefComponent<\n HTMLInputElement,\n SpiritCheckboxProps\n>;\n\nCheckbox.spiritComponent = 'Checkbox';\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["_Checkbox","props","ref","classProps","modifiedProps","useCheckboxStyleProps","ariaDescribedBy","ariaDetailsAttr","details","hasValidationIcon","helperText","id","isChecked","isDisabled","isRequired","label","validationState","validationText","value","restProps","styleProps","otherProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","ariaDetailsProp","registerDetails","useAriaDetails","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","InputDetails","HelperText","ValidationText","Checkbox","forwardRef"],"mappings":"ihBAWMA,EAAY,CAACC,EAA4BC,IAAqD,CAClG,KAAM,CAAE,WAAAC,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,sBAAsBJ,CAAK,EAClE,CACJ,mBAAoBK,EAAkB,GACtC,eAAgBC,EAChB,QAAAC,EACA,kBAAAC,EACA,WAAAC,EACA,GAAAC,EACA,UAAAC,EACA,WAAAC,EACA,WAAAC,EACA,MAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,MAAAC,EACA,GAAGC,CAAA,EACDf,EACE,CAAA,WAAEgB,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcH,CAAS,EAC3D,CAACI,EAAqBC,CAAQ,EAAIC,EAAAA,mBAAmBnB,CAAe,EACpE,CAACoB,EAAiBC,CAAe,EAAIC,EAAAA,eAAerB,CAAe,EACnEsB,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAd,EACA,eAAAC,CAAA,CACD,EAED,OACEc,EAAAA,KAAC,MAAA,CAAI,MAAOX,EAAW,MAAO,UAAWY,EAAW7B,EAAW,KAAMiB,EAAW,SAAS,EACvF,SAAA,CAAAa,EAAAA,IAAC,QAAA,CACE,GAAGZ,EACH,GAAGE,EACH,GAAGG,EACJ,KAAK,WACL,GAAAf,EACA,UAAWR,EAAW,MACtB,SAAUU,EACV,SAAUC,EACV,QAASF,EACT,MAAAM,EACA,IAAAhB,CAAA,CAAA,EAEF6B,EAAAA,KAAC,MAAA,CAAI,UAAW5B,EAAW,KACzB,SAAA,CAAA8B,MAACC,EAAAA,SAAM,iBAAkB/B,EAAW,MAAO,QAASQ,EACjD,SAAAI,EACH,EACCP,SACE2B,EAAAA,QAAA,CAAa,GAAI,GAAGxB,CAAE,WAAY,oBAAqBgB,EACrD,SAAAnB,CAAA,CACH,EAEFyB,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBjC,EAAW,WAC7B,GAAI,GAAGQ,CAAE,eACT,aAAca,EACd,WAAAd,CAAA,CAAA,EAEDM,GACCiB,EAAAA,IAACI,EAAAA,QAAA,CACC,iBAAkBlC,EAAW,eAC7B,GAAI,GAAGQ,CAAE,mBACR,GAAIF,GAAqB,CAAE,uBAAwBO,CAAA,EACpD,eAAAC,EACA,aAAcO,EACd,KAAMK,CAAA,CAAA,CACR,CAAA,CAEJ,CAAA,EACF,CAEJ,EAEMS,EAAWC,EAAAA,WAAkDvC,CAAS,EAK5EsC,EAAS,gBAAkB,WAC3BA,EAAS,YAAc"}
|
|
@@ -1,77 +1,81 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { useStyleProps as
|
|
6
|
-
import { useAriaDescribedBy as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useCheckboxStyleProps as
|
|
13
|
-
const
|
|
14
|
-
const { classProps: e, props:
|
|
15
|
-
"aria-describedby":
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import S from "classnames";
|
|
4
|
+
import { forwardRef as g } from "react";
|
|
5
|
+
import { useStyleProps as F } from "../../hooks/styleProps.js";
|
|
6
|
+
import { useAriaDescribedBy as R, useAriaDetails as V } from "../../hooks/useAriaIdRefs.js";
|
|
7
|
+
import B from "../Field/HelperText.js";
|
|
8
|
+
import E from "../Field/Label.js";
|
|
9
|
+
import I from "../Field/ValidationText.js";
|
|
10
|
+
import { useValidationTextRole as U } from "../Field/useValidationTextRole.js";
|
|
11
|
+
import $ from "../InputDetails/InputDetails.js";
|
|
12
|
+
import { useCheckboxStyleProps as j } from "./useCheckboxStyleProps.js";
|
|
13
|
+
const q = (p, m) => {
|
|
14
|
+
const { classProps: e, props: n } = j(p), {
|
|
15
|
+
"aria-describedby": x = "",
|
|
16
|
+
"aria-details": h,
|
|
17
|
+
details: s,
|
|
18
|
+
hasValidationIcon: b,
|
|
19
|
+
helperText: f,
|
|
20
|
+
id: i,
|
|
21
|
+
isChecked: u,
|
|
22
|
+
isDisabled: N,
|
|
23
|
+
isRequired: y,
|
|
24
|
+
label: D,
|
|
25
|
+
validationState: t,
|
|
26
|
+
validationText: a,
|
|
27
|
+
value: T,
|
|
28
|
+
...A
|
|
29
|
+
} = n, { styleProps: o, props: P } = F(A), [k, l] = R(x), [v, _] = V(h), C = U({
|
|
30
|
+
validationState: t,
|
|
31
|
+
validationText: a
|
|
30
32
|
});
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ c("div", { style: o.style, className: S(e.root, o.className), children: [
|
|
34
|
+
/* @__PURE__ */ r(
|
|
33
35
|
"input",
|
|
34
36
|
{
|
|
35
|
-
...k,
|
|
36
37
|
...P,
|
|
38
|
+
...k,
|
|
39
|
+
...v,
|
|
37
40
|
type: "checkbox",
|
|
38
|
-
id:
|
|
41
|
+
id: i,
|
|
39
42
|
className: e.input,
|
|
40
|
-
disabled:
|
|
41
|
-
required:
|
|
42
|
-
checked:
|
|
43
|
-
value:
|
|
43
|
+
disabled: N,
|
|
44
|
+
required: y,
|
|
45
|
+
checked: u,
|
|
46
|
+
value: T,
|
|
44
47
|
ref: m
|
|
45
48
|
}
|
|
46
49
|
),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */ s
|
|
50
|
-
|
|
50
|
+
/* @__PURE__ */ c("div", { className: e.text, children: [
|
|
51
|
+
/* @__PURE__ */ r(E, { UNSAFE_className: e.label, htmlFor: i, children: D }),
|
|
52
|
+
s && /* @__PURE__ */ r($, { id: `${i}-details`, registerAriaDetails: _, children: s }),
|
|
53
|
+
/* @__PURE__ */ r(
|
|
54
|
+
B,
|
|
51
55
|
{
|
|
52
56
|
UNSAFE_className: e.helperText,
|
|
53
|
-
id: `${
|
|
54
|
-
registerAria:
|
|
55
|
-
helperText:
|
|
57
|
+
id: `${i}__helperText`,
|
|
58
|
+
registerAria: l,
|
|
59
|
+
helperText: f
|
|
56
60
|
}
|
|
57
61
|
),
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
t && /* @__PURE__ */ r(
|
|
63
|
+
I,
|
|
60
64
|
{
|
|
61
65
|
UNSAFE_className: e.validationText,
|
|
62
|
-
id: `${
|
|
63
|
-
...
|
|
64
|
-
validationText:
|
|
65
|
-
registerAria:
|
|
66
|
-
role:
|
|
66
|
+
id: `${i}__validationText`,
|
|
67
|
+
...b && { hasValidationStateIcon: t },
|
|
68
|
+
validationText: a,
|
|
69
|
+
registerAria: l,
|
|
70
|
+
role: C
|
|
67
71
|
}
|
|
68
72
|
)
|
|
69
73
|
] })
|
|
70
74
|
] });
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
}, d = g(q);
|
|
76
|
+
d.spiritComponent = "Checkbox";
|
|
77
|
+
d.displayName = "Checkbox";
|
|
74
78
|
export {
|
|
75
|
-
|
|
79
|
+
d as default
|
|
76
80
|
};
|
|
77
81
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritCheckboxProps } from '../../types';\nimport { HelperText, Label, ValidationText
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useAriaDetails, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritCheckboxProps } from '../../types';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { InputDetails } from '../InputDetails';\nimport { useCheckboxStyleProps } from './useCheckboxStyleProps';\n\nconst _Checkbox = (props: SpiritCheckboxProps, ref: ForwardedRef<HTMLInputElement>): JSX.Element => {\n const { classProps, props: modifiedProps } = useCheckboxStyleProps(props);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n 'aria-details': ariaDetailsAttr,\n details,\n hasValidationIcon,\n helperText,\n id,\n isChecked,\n isDisabled,\n isRequired,\n label,\n validationState,\n validationText,\n value,\n ...restProps\n } = modifiedProps;\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const [ariaDetailsProp, registerDetails] = useAriaDetails(ariaDetailsAttr);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <div style={styleProps.style} className={classNames(classProps.root, styleProps.className)}>\n <input\n {...otherProps}\n {...ariaDescribedByProp}\n {...ariaDetailsProp}\n type=\"checkbox\"\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n required={isRequired}\n checked={isChecked}\n value={value}\n ref={ref}\n />\n <div className={classProps.text}>\n <Label UNSAFE_className={classProps.label} htmlFor={id}>\n {label}\n </Label>\n {details && (\n <InputDetails id={`${id}-details`} registerAriaDetails={registerDetails}>\n {details}\n </InputDetails>\n )}\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n id={`${id}__validationText`}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n </div>\n );\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, SpiritCheckboxProps>(_Checkbox) as ForwardRefComponent<\n HTMLInputElement,\n SpiritCheckboxProps\n>;\n\nCheckbox.spiritComponent = 'Checkbox';\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["_Checkbox","props","ref","classProps","modifiedProps","useCheckboxStyleProps","ariaDescribedBy","ariaDetailsAttr","details","hasValidationIcon","helperText","id","isChecked","isDisabled","isRequired","label","validationState","validationText","value","restProps","styleProps","otherProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","ariaDetailsProp","registerDetails","useAriaDetails","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","InputDetails","HelperText","ValidationText","Checkbox","forwardRef"],"mappings":";;;;;;;;;;;;AAWA,MAAMA,IAAY,CAACC,GAA4BC,MAAqD;AAClG,QAAM,EAAE,YAAAC,GAAY,OAAOC,EAAA,IAAkBC,EAAsBJ,CAAK,GAClE;AAAA,IACJ,oBAAoBK,IAAkB;AAAA,IACtC,gBAAgBC;AAAA,IAChB,SAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDf,GACE,EAAE,YAAAgB,GAAY,OAAOC,EAAA,IAAeC,EAAcH,CAAS,GAC3D,CAACI,GAAqBC,CAAQ,IAAIC,EAAmBnB,CAAe,GACpE,CAACoB,GAAiBC,CAAe,IAAIC,EAAerB,CAAe,GACnEsB,IAAqBC,EAAsB;AAAA,IAC/C,iBAAAd;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD;AAED,SACE,gBAAAc,EAAC,OAAA,EAAI,OAAOX,EAAW,OAAO,WAAWY,EAAW7B,EAAW,MAAMiB,EAAW,SAAS,GACvF,UAAA;AAAA,IAAA,gBAAAa;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGZ;AAAA,QACH,GAAGE;AAAA,QACH,GAAGG;AAAA,QACJ,MAAK;AAAA,QACL,IAAAf;AAAA,QACA,WAAWR,EAAW;AAAA,QACtB,UAAUU;AAAA,QACV,UAAUC;AAAA,QACV,SAASF;AAAA,QACT,OAAAM;AAAA,QACA,KAAAhB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAA6B,EAAC,OAAA,EAAI,WAAW5B,EAAW,MACzB,UAAA;AAAA,MAAA,gBAAA8B,EAACC,KAAM,kBAAkB/B,EAAW,OAAO,SAASQ,GACjD,UAAAI,GACH;AAAA,MACCP,uBACE2B,GAAA,EAAa,IAAI,GAAGxB,CAAE,YAAY,qBAAqBgB,GACrD,UAAAnB,EAAA,CACH;AAAA,MAEF,gBAAAyB;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,kBAAkBjC,EAAW;AAAA,UAC7B,IAAI,GAAGQ,CAAE;AAAA,UACT,cAAca;AAAA,UACd,YAAAd;AAAA,QAAA;AAAA,MAAA;AAAA,MAEDM,KACC,gBAAAiB;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,kBAAkBlC,EAAW;AAAA,UAC7B,IAAI,GAAGQ,CAAE;AAAA,UACR,GAAIF,KAAqB,EAAE,wBAAwBO,EAAA;AAAA,UACpD,gBAAAC;AAAA,UACA,cAAcO;AAAA,UACd,MAAMK;AAAA,QAAA;AAAA,MAAA;AAAA,IACR,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ,GAEMS,IAAWC,EAAkDvC,CAAS;AAK5EsC,EAAS,kBAAkB;AAC3BA,EAAS,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useControlButtonStyleProps.cjs","sources":["../../../src/components/ControlButton/useControlButtonStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix, useSymmetry } from '../../hooks';\nimport { type
|
|
1
|
+
{"version":3,"file":"useControlButtonStyleProps.cjs","sources":["../../../src/components/ControlButton/useControlButtonStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix, useSymmetry } from '../../hooks';\nimport { type ControlButtonStyleProps, type SizeExtendedDictionaryType } from '../../types';\nimport { applySize, compose } from '../../utils';\n\nconst getControlButtonSizeClassname = <S = void>(className: string, size: SizeExtendedDictionaryType | S): string =>\n compose(applySize<SizeExtendedDictionaryType | S>(size))(className);\n\nexport function useControlButtonStyleProps<S = void>(props: ControlButtonStyleProps<S>) {\n const { isDisabled, isSubtle, isSymmetrical, size, ...restProps } = props;\n\n const controlButtonClass = useClassNamePrefix('ControlButton');\n const controlButtonBackgroundClass = `${controlButtonClass}--hasBackground`;\n const controlButtonDisabledClass = `${controlButtonClass}--disabled`;\n const dynamicColorBackgroundInteractiveClass = useClassNamePrefix('dynamic-color-background-interactive');\n const dynamicColorBorderClass = useClassNamePrefix('dynamic-color-border');\n const accessibilityTapTargetClass = useClassNamePrefix('accessibility-tap-target');\n\n const { symmetricalClassName } = useSymmetry(controlButtonClass, isSymmetrical);\n\n const classProps = classNames(\n controlButtonClass,\n getControlButtonSizeClassname(controlButtonClass, size as SizeExtendedDictionaryType | S),\n dynamicColorBackgroundInteractiveClass,\n accessibilityTapTargetClass,\n {\n [controlButtonDisabledClass]: isDisabled,\n [controlButtonBackgroundClass]: !isSubtle,\n [dynamicColorBorderClass]: !isSubtle,\n },\n symmetricalClassName,\n );\n\n return {\n classProps,\n props: restProps,\n };\n}\n"],"names":["getControlButtonSizeClassname","className","size","compose","applySize","useControlButtonStyleProps","props","isDisabled","isSubtle","isSymmetrical","restProps","controlButtonClass","useClassNamePrefix","controlButtonBackgroundClass","controlButtonDisabledClass","dynamicColorBackgroundInteractiveClass","dynamicColorBorderClass","accessibilityTapTargetClass","symmetricalClassName","useSymmetry","classNames"],"mappings":"mRAKMA,EAAgC,CAAWC,EAAmBC,IAClEC,EAAAA,QAAQC,EAAAA,UAA0CF,CAAI,CAAC,EAAED,CAAS,EAE7D,SAASI,EAAqCC,EAAmC,CACtF,KAAM,CAAE,WAAAC,EAAY,SAAAC,EAAU,cAAAC,EAAe,KAAAP,EAAM,GAAGQ,GAAcJ,EAE9DK,EAAqBC,EAAAA,mBAAmB,eAAe,EACvDC,EAA+B,GAAGF,CAAkB,kBACpDG,EAA6B,GAAGH,CAAkB,aAClDI,EAAyCH,EAAAA,mBAAmB,sCAAsC,EAClGI,EAA0BJ,EAAAA,mBAAmB,sBAAsB,EACnEK,EAA8BL,EAAAA,mBAAmB,0BAA0B,EAE3E,CAAE,qBAAAM,CAAA,EAAyBC,cAAYR,EAAoBF,CAAa,EAe9E,MAAO,CACL,WAdiBW,EACjBT,EACAX,EAA8BW,EAAoBT,CAAsC,EACxFa,EACAE,EACA,CACE,CAACH,CAA0B,EAAGP,EAC9B,CAACM,CAA4B,EAAG,CAACL,EACjC,CAACQ,CAAuB,EAAG,CAACR,CAAA,EAE9BU,CAAA,EAKA,MAAOR,CAAA,CAEX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useControlButtonStyleProps.js","sources":["../../../src/components/ControlButton/useControlButtonStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix, useSymmetry } from '../../hooks';\nimport { type
|
|
1
|
+
{"version":3,"file":"useControlButtonStyleProps.js","sources":["../../../src/components/ControlButton/useControlButtonStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix, useSymmetry } from '../../hooks';\nimport { type ControlButtonStyleProps, type SizeExtendedDictionaryType } from '../../types';\nimport { applySize, compose } from '../../utils';\n\nconst getControlButtonSizeClassname = <S = void>(className: string, size: SizeExtendedDictionaryType | S): string =>\n compose(applySize<SizeExtendedDictionaryType | S>(size))(className);\n\nexport function useControlButtonStyleProps<S = void>(props: ControlButtonStyleProps<S>) {\n const { isDisabled, isSubtle, isSymmetrical, size, ...restProps } = props;\n\n const controlButtonClass = useClassNamePrefix('ControlButton');\n const controlButtonBackgroundClass = `${controlButtonClass}--hasBackground`;\n const controlButtonDisabledClass = `${controlButtonClass}--disabled`;\n const dynamicColorBackgroundInteractiveClass = useClassNamePrefix('dynamic-color-background-interactive');\n const dynamicColorBorderClass = useClassNamePrefix('dynamic-color-border');\n const accessibilityTapTargetClass = useClassNamePrefix('accessibility-tap-target');\n\n const { symmetricalClassName } = useSymmetry(controlButtonClass, isSymmetrical);\n\n const classProps = classNames(\n controlButtonClass,\n getControlButtonSizeClassname(controlButtonClass, size as SizeExtendedDictionaryType | S),\n dynamicColorBackgroundInteractiveClass,\n accessibilityTapTargetClass,\n {\n [controlButtonDisabledClass]: isDisabled,\n [controlButtonBackgroundClass]: !isSubtle,\n [dynamicColorBorderClass]: !isSubtle,\n },\n symmetricalClassName,\n );\n\n return {\n classProps,\n props: restProps,\n };\n}\n"],"names":["getControlButtonSizeClassname","className","size","compose","applySize","useControlButtonStyleProps","props","isDisabled","isSubtle","isSymmetrical","restProps","controlButtonClass","useClassNamePrefix","controlButtonBackgroundClass","controlButtonDisabledClass","dynamicColorBackgroundInteractiveClass","dynamicColorBorderClass","accessibilityTapTargetClass","symmetricalClassName","useSymmetry","classNames"],"mappings":";;;;;AAKA,MAAMA,IAAgC,CAAWC,GAAmBC,MAClEC,EAAQC,EAA0CF,CAAI,CAAC,EAAED,CAAS;AAE7D,SAASI,EAAqCC,GAAmC;AACtF,QAAM,EAAE,YAAAC,GAAY,UAAAC,GAAU,eAAAC,GAAe,MAAAP,GAAM,GAAGQ,MAAcJ,GAE9DK,IAAqBC,EAAmB,eAAe,GACvDC,IAA+B,GAAGF,CAAkB,mBACpDG,IAA6B,GAAGH,CAAkB,cAClDI,IAAyCH,EAAmB,sCAAsC,GAClGI,IAA0BJ,EAAmB,sBAAsB,GACnEK,IAA8BL,EAAmB,0BAA0B,GAE3E,EAAE,sBAAAM,EAAA,IAAyBC,EAAYR,GAAoBF,CAAa;AAe9E,SAAO;AAAA,IACL,YAdiBW;AAAA,MACjBT;AAAA,MACAX,EAA8BW,GAAoBT,CAAsC;AAAA,MACxFa;AAAA,MACAE;AAAA,MACA;AAAA,QACE,CAACH,CAA0B,GAAGP;AAAA,QAC9B,CAACM,CAA4B,GAAG,CAACL;AAAA,QACjC,CAACQ,CAAuB,GAAG,CAACR;AAAA,MAAA;AAAA,MAE9BU;AAAA,IAAA;AAAA,IAKA,OAAOR;AAAA,EAAA;AAEX;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownPopover.cjs","sources":["../../../src/components/Dropdown/DropdownPopover.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { type
|
|
1
|
+
{"version":3,"file":"DropdownPopover.cjs","sources":["../../../src/components/Dropdown/DropdownPopover.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { type SpiritDivElementProps } from '../../types';\nimport { useDropdownContext } from './DropdownContext';\nimport { useDropdownAriaProps } from './useDropdownAriaProps';\nimport { useDropdownStyleProps } from './useDropdownStyleProps';\n\ninterface DropdownPopoverProps extends SpiritDivElementProps {}\n\nconst DropdownPopover = (props: DropdownPopoverProps) => {\n const { children, ...rest } = props;\n const { id, isOpen, onToggle, fullWidthMode, placement } = useDropdownContext();\n const { classProps, props: modifiedProps } = useDropdownStyleProps({ isOpen, ...rest });\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const { contentProps } = useDropdownAriaProps({ id, isOpen, toggleHandler: onToggle, placement, fullWidthMode });\n\n return (\n <div\n className={classNames(classProps.popover, styleProps.className)}\n style={styleProps.style}\n {...contentProps}\n {...otherProps}\n >\n {children}\n </div>\n );\n};\n\nDropdownPopover.spiritComponent = 'DropdownPopover';\n\nexport default DropdownPopover;\n"],"names":["DropdownPopover","props","children","rest","id","isOpen","onToggle","fullWidthMode","placement","useDropdownContext","classProps","modifiedProps","useDropdownStyleProps","styleProps","otherProps","useStyleProps","contentProps","useDropdownAriaProps","jsx","classNames"],"mappings":"kVAYMA,EAAmBC,GAAgC,CACvD,KAAM,CAAE,SAAAC,EAAU,GAAGC,CAAA,EAASF,EACxB,CAAE,GAAAG,EAAI,OAAAC,EAAQ,SAAAC,EAAU,cAAAC,EAAe,UAAAC,CAAA,EAAcC,qBAAA,EACrD,CAAE,WAAAC,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,sBAAsB,CAAE,OAAAP,EAAQ,GAAGF,EAAM,EAChF,CAAA,WAAEU,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcJ,CAAa,EAC/D,CAAE,aAAAK,CAAA,EAAiBC,EAAAA,qBAAqB,CAAE,GAAAb,EAAI,OAAAC,EAAQ,cAAeC,EAAU,UAAAE,EAAW,cAAAD,EAAe,EAE/G,OACEW,EAAAA,IAAC,MAAA,CACC,UAAWC,EAAWT,EAAW,QAASG,EAAW,SAAS,EAC9D,MAAOA,EAAW,MACjB,GAAGG,EACH,GAAGF,EAEH,SAAAZ,CAAA,CAAA,CAGP,EAEAF,EAAgB,gBAAkB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
interface DropdownPopoverProps extends
|
|
2
|
+
import { SpiritDivElementProps } from '../../types';
|
|
3
|
+
interface DropdownPopoverProps extends SpiritDivElementProps {
|
|
4
4
|
}
|
|
5
5
|
declare const DropdownPopover: {
|
|
6
6
|
(props: DropdownPopoverProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownPopover.js","sources":["../../../src/components/Dropdown/DropdownPopover.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { type
|
|
1
|
+
{"version":3,"file":"DropdownPopover.js","sources":["../../../src/components/Dropdown/DropdownPopover.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { type SpiritDivElementProps } from '../../types';\nimport { useDropdownContext } from './DropdownContext';\nimport { useDropdownAriaProps } from './useDropdownAriaProps';\nimport { useDropdownStyleProps } from './useDropdownStyleProps';\n\ninterface DropdownPopoverProps extends SpiritDivElementProps {}\n\nconst DropdownPopover = (props: DropdownPopoverProps) => {\n const { children, ...rest } = props;\n const { id, isOpen, onToggle, fullWidthMode, placement } = useDropdownContext();\n const { classProps, props: modifiedProps } = useDropdownStyleProps({ isOpen, ...rest });\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const { contentProps } = useDropdownAriaProps({ id, isOpen, toggleHandler: onToggle, placement, fullWidthMode });\n\n return (\n <div\n className={classNames(classProps.popover, styleProps.className)}\n style={styleProps.style}\n {...contentProps}\n {...otherProps}\n >\n {children}\n </div>\n );\n};\n\nDropdownPopover.spiritComponent = 'DropdownPopover';\n\nexport default DropdownPopover;\n"],"names":["DropdownPopover","props","children","rest","id","isOpen","onToggle","fullWidthMode","placement","useDropdownContext","classProps","modifiedProps","useDropdownStyleProps","styleProps","otherProps","useStyleProps","contentProps","useDropdownAriaProps","jsx","classNames"],"mappings":";;;;;;;AAYA,MAAMA,IAAkB,CAACC,MAAgC;AACvD,QAAM,EAAE,UAAAC,GAAU,GAAGC,EAAA,IAASF,GACxB,EAAE,IAAAG,GAAI,QAAAC,GAAQ,UAAAC,GAAU,eAAAC,GAAe,WAAAC,EAAA,IAAcC,EAAA,GACrD,EAAE,YAAAC,GAAY,OAAOC,EAAA,IAAkBC,EAAsB,EAAE,QAAAP,GAAQ,GAAGF,GAAM,GAChF,EAAE,YAAAU,GAAY,OAAOC,EAAA,IAAeC,EAAcJ,CAAa,GAC/D,EAAE,cAAAK,EAAA,IAAiBC,EAAqB,EAAE,IAAAb,GAAI,QAAAC,GAAQ,eAAeC,GAAU,WAAAE,GAAW,eAAAD,GAAe;AAE/G,SACE,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAWT,EAAW,SAASG,EAAW,SAAS;AAAA,MAC9D,OAAOA,EAAW;AAAA,MACjB,GAAGG;AAAA,MACH,GAAGF;AAAA,MAEH,UAAAZ;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAF,EAAgB,kBAAkB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./HelperText.cjs"),t=require("./Label.cjs"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./HelperText.cjs"),t=require("./Label.cjs"),r=require("./ValidationText.cjs");exports.HelperText=e.default;exports.Label=t.default;exports.ValidationText=r.default;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { default as a } from "./HelperText.js";
|
|
2
2
|
import { default as o } from "./Label.js";
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as d } from "./ValidationText.js";
|
|
3
|
+
import { default as l } from "./ValidationText.js";
|
|
5
4
|
export {
|
|
6
5
|
a as HelperText,
|
|
7
6
|
o as Label,
|
|
8
|
-
|
|
9
|
-
s as useAriaIds
|
|
7
|
+
l as ValidationText
|
|
10
8
|
};
|
|
11
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
import { RegisterType } from '../../hooks/useAriaIdRefs';
|
|
2
3
|
import { ChildrenProps, StyleProps, TransferProps, ValidationTextProp } from '../../types';
|
|
3
|
-
import { RegisterType } from './useAriaIds';
|
|
4
4
|
export interface FieldElementTypeProps<E extends ElementType = 'div'> {
|
|
5
5
|
elementType?: E;
|
|
6
6
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),N=require("classnames"),S=require("../../hooks/styleProps.cjs"),j=require("../../hooks/useAriaIdRefs.cjs"),v=require("../Field/HelperText.cjs"),_=require("../Field/ValidationText.cjs"),F=require("../Field/useValidationTextRole.cjs"),g=require("../VisuallyHidden/VisuallyHidden.cjs"),A=require("./useFieldGroupStyleProps.cjs"),d=n=>{const{"aria-describedby":u="",children:c,helperText:p,hasValidationIcon:x,id:r,isDisabled:y,isFluid:T,isLabelHidden:b,isRequired:h,label:t,validationState:i,validationText:l,...m}=n,{classProps:s}=A.useFieldGroupStyleProps({isFluid:T,isRequired:h,validationState:i}),{styleProps:a,props:q}=S.useStyleProps(m),[P,o]=j.useAriaDescribedBy(u),f=F.useValidationTextRole({validationState:i,validationText:l});return e.jsxs("fieldset",{...q,...a,...P,className:N(s.root,a.className),disabled:y,children:[e.jsx(g.default,{elementType:"legend",children:t}),!b&&e.jsx("div",{className:s.label,"aria-hidden":"true",children:t}),e.jsx("div",{className:s.fields,children:c}),e.jsx(v.default,{UNSAFE_className:s.helperText,id:`${r}__helperText`,registerAria:o,helperText:p}),i&&e.jsx(_.default,{UNSAFE_className:s.validationText,...x&&{hasValidationStateIcon:i},id:`${r}__helperText`,validationText:l,registerAria:o,role:f})]})};d.spiritComponent="FieldGroup";exports.default=d;
|
|
2
2
|
//# sourceMappingURL=FieldGroup.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldGroup.cjs","sources":["../../../src/components/FieldGroup/FieldGroup.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type SpiritFieldGroupProps } from '../../types';\nimport { HelperText, ValidationText
|
|
1
|
+
{"version":3,"file":"FieldGroup.cjs","sources":["../../../src/components/FieldGroup/FieldGroup.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type SpiritFieldGroupProps } from '../../types';\nimport { HelperText, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { useFieldGroupStyleProps } from './useFieldGroupStyleProps';\n\nconst FieldGroup = (props: SpiritFieldGroupProps) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n children,\n helperText,\n hasValidationIcon,\n id,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n label,\n validationState,\n validationText,\n ...rest\n } = props;\n\n const { classProps } = useFieldGroupStyleProps({ hasValidationIcon, isFluid, isRequired, validationState });\n const { styleProps, props: transferProps } = useStyleProps(rest);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <fieldset\n {...transferProps}\n {...styleProps}\n {...ariaDescribedByProp}\n className={classNames(classProps.root, styleProps.className)}\n disabled={isDisabled}\n >\n <VisuallyHidden elementType=\"legend\">{label}</VisuallyHidden>\n {!isLabelHidden && (\n <div className={classProps.label} aria-hidden=\"true\">\n {label}\n </div>\n )}\n <div className={classProps.fields}>{children}</div>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__helperText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </fieldset>\n );\n};\n\nFieldGroup.spiritComponent = 'FieldGroup';\n\nexport default FieldGroup;\n"],"names":["FieldGroup","props","ariaDescribedBy","children","helperText","hasValidationIcon","id","isDisabled","isFluid","isLabelHidden","isRequired","label","validationState","validationText","rest","classProps","useFieldGroupStyleProps","styleProps","transferProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","VisuallyHidden","HelperText","ValidationText"],"mappings":"oeAWMA,EAAcC,GAAiC,CACnD,KAAM,CACJ,mBAAoBC,EAAkB,GACtC,SAAAC,EACA,WAAAC,EACA,kBAAAC,EACA,GAAAC,EACA,WAAAC,EACA,QAAAC,EACA,cAAAC,EACA,WAAAC,EACA,MAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,GAAGC,CAAA,EACDb,EAEE,CAAE,WAAAc,GAAeC,EAAAA,wBAAwB,CAAqB,QAAAR,EAAS,WAAAE,EAAY,gBAAAE,EAAiB,EACpG,CAAA,WAAEK,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,cAAcL,CAAI,EACzD,CAACM,EAAqBC,CAAQ,EAAIC,EAAAA,mBAAmBpB,CAAe,EACpEqB,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAZ,EACA,eAAAC,CAAA,CACD,EAED,OACEY,EAAAA,KAAC,WAAA,CACE,GAAGP,EACH,GAAGD,EACH,GAAGG,EACJ,UAAWM,EAAWX,EAAW,KAAME,EAAW,SAAS,EAC3D,SAAUV,EAEV,SAAA,CAAAoB,EAAAA,IAACC,EAAAA,QAAA,CAAe,YAAY,SAAU,SAAAjB,EAAM,EAC3C,CAACF,GACAkB,EAAAA,IAAC,MAAA,CAAI,UAAWZ,EAAW,MAAO,cAAY,OAC3C,SAAAJ,CAAA,CACH,EAEFgB,EAAAA,IAAC,MAAA,CAAI,UAAWZ,EAAW,OAAS,SAAAZ,EAAS,EAC7CwB,EAAAA,IAACE,EAAAA,QAAA,CACC,iBAAkBd,EAAW,WAC7B,GAAI,GAAGT,CAAE,eACT,aAAce,EACd,WAAAjB,CAAA,CAAA,EAEDQ,GACCe,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBf,EAAW,eAC5B,GAAIV,GAAqB,CAAE,uBAAwBO,CAAA,EACpD,GAAI,GAAGN,CAAE,eACT,eAAAO,EACA,aAAcQ,EACd,KAAME,CAAA,CAAA,CACR,CAAA,CAAA,CAIR,EAEAvB,EAAW,gBAAkB"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as v, jsx as i } from "react/jsx-runtime";
|
|
3
3
|
import F from "classnames";
|
|
4
4
|
import { useStyleProps as P } from "../../hooks/styleProps.js";
|
|
5
|
-
import { useAriaDescribedBy as S } from "../../hooks/
|
|
5
|
+
import { useAriaDescribedBy as S } from "../../hooks/useAriaIdRefs.js";
|
|
6
6
|
import _ from "../Field/HelperText.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
const H = (d) => {
|
|
7
|
+
import A from "../Field/ValidationText.js";
|
|
8
|
+
import { useValidationTextRole as V } from "../Field/useValidationTextRole.js";
|
|
9
|
+
import g from "../VisuallyHidden/VisuallyHidden.js";
|
|
10
|
+
import { useFieldGroupStyleProps as D } from "./useFieldGroupStyleProps.js";
|
|
11
|
+
const B = (d) => {
|
|
13
12
|
const {
|
|
14
13
|
"aria-describedby": n = "",
|
|
15
14
|
children: p,
|
|
@@ -24,20 +23,20 @@ const H = (d) => {
|
|
|
24
23
|
validationState: r,
|
|
25
24
|
validationText: a,
|
|
26
25
|
...T
|
|
27
|
-
} = d, { classProps: e } =
|
|
26
|
+
} = d, { classProps: e } = D({ isFluid: f, isRequired: h, validationState: r }), { styleProps: o, props: b } = P(T), [y, l] = S(n), N = V({
|
|
28
27
|
validationState: r,
|
|
29
28
|
validationText: a
|
|
30
29
|
});
|
|
31
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ v(
|
|
32
31
|
"fieldset",
|
|
33
32
|
{
|
|
34
33
|
...b,
|
|
35
34
|
...o,
|
|
36
|
-
...
|
|
35
|
+
...y,
|
|
37
36
|
className: F(e.root, o.className),
|
|
38
37
|
disabled: u,
|
|
39
38
|
children: [
|
|
40
|
-
/* @__PURE__ */ i(
|
|
39
|
+
/* @__PURE__ */ i(g, { elementType: "legend", children: t }),
|
|
41
40
|
!x && /* @__PURE__ */ i("div", { className: e.label, "aria-hidden": "true", children: t }),
|
|
42
41
|
/* @__PURE__ */ i("div", { className: e.fields, children: p }),
|
|
43
42
|
/* @__PURE__ */ i(
|
|
@@ -50,22 +49,22 @@ const H = (d) => {
|
|
|
50
49
|
}
|
|
51
50
|
),
|
|
52
51
|
r && /* @__PURE__ */ i(
|
|
53
|
-
|
|
52
|
+
A,
|
|
54
53
|
{
|
|
55
54
|
UNSAFE_className: e.validationText,
|
|
56
55
|
...c && { hasValidationStateIcon: r },
|
|
57
56
|
id: `${s}__helperText`,
|
|
58
57
|
validationText: a,
|
|
59
58
|
registerAria: l,
|
|
60
|
-
role:
|
|
59
|
+
role: N
|
|
61
60
|
}
|
|
62
61
|
)
|
|
63
62
|
]
|
|
64
63
|
}
|
|
65
64
|
);
|
|
66
65
|
};
|
|
67
|
-
|
|
66
|
+
B.spiritComponent = "FieldGroup";
|
|
68
67
|
export {
|
|
69
|
-
|
|
68
|
+
B as default
|
|
70
69
|
};
|
|
71
70
|
//# sourceMappingURL=FieldGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldGroup.js","sources":["../../../src/components/FieldGroup/FieldGroup.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type SpiritFieldGroupProps } from '../../types';\nimport { HelperText, ValidationText
|
|
1
|
+
{"version":3,"file":"FieldGroup.js","sources":["../../../src/components/FieldGroup/FieldGroup.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type SpiritFieldGroupProps } from '../../types';\nimport { HelperText, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { useFieldGroupStyleProps } from './useFieldGroupStyleProps';\n\nconst FieldGroup = (props: SpiritFieldGroupProps) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n children,\n helperText,\n hasValidationIcon,\n id,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n label,\n validationState,\n validationText,\n ...rest\n } = props;\n\n const { classProps } = useFieldGroupStyleProps({ hasValidationIcon, isFluid, isRequired, validationState });\n const { styleProps, props: transferProps } = useStyleProps(rest);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <fieldset\n {...transferProps}\n {...styleProps}\n {...ariaDescribedByProp}\n className={classNames(classProps.root, styleProps.className)}\n disabled={isDisabled}\n >\n <VisuallyHidden elementType=\"legend\">{label}</VisuallyHidden>\n {!isLabelHidden && (\n <div className={classProps.label} aria-hidden=\"true\">\n {label}\n </div>\n )}\n <div className={classProps.fields}>{children}</div>\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__helperText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </fieldset>\n );\n};\n\nFieldGroup.spiritComponent = 'FieldGroup';\n\nexport default FieldGroup;\n"],"names":["FieldGroup","props","ariaDescribedBy","children","helperText","hasValidationIcon","id","isDisabled","isFluid","isLabelHidden","isRequired","label","validationState","validationText","rest","classProps","useFieldGroupStyleProps","styleProps","transferProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","VisuallyHidden","HelperText","ValidationText"],"mappings":";;;;;;;;;;AAWA,MAAMA,IAAa,CAACC,MAAiC;AACnD,QAAM;AAAA,IACJ,oBAAoBC,IAAkB;AAAA,IACtC,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,IAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDb,GAEE,EAAE,YAAAc,MAAeC,EAAwB,EAAqB,SAAAR,GAAS,YAAAE,GAAY,iBAAAE,GAAiB,GACpG,EAAE,YAAAK,GAAY,OAAOC,EAAA,IAAkBC,EAAcL,CAAI,GACzD,CAACM,GAAqBC,CAAQ,IAAIC,EAAmBpB,CAAe,GACpEqB,IAAqBC,EAAsB;AAAA,IAC/C,iBAAAZ;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD;AAED,SACE,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGP;AAAA,MACH,GAAGD;AAAA,MACH,GAAGG;AAAA,MACJ,WAAWM,EAAWX,EAAW,MAAME,EAAW,SAAS;AAAA,MAC3D,UAAUV;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAAoB,EAACC,GAAA,EAAe,aAAY,UAAU,UAAAjB,GAAM;AAAA,QAC3C,CAACF,KACA,gBAAAkB,EAAC,OAAA,EAAI,WAAWZ,EAAW,OAAO,eAAY,QAC3C,UAAAJ,EAAA,CACH;AAAA,QAEF,gBAAAgB,EAAC,OAAA,EAAI,WAAWZ,EAAW,QAAS,UAAAZ,GAAS;AAAA,QAC7C,gBAAAwB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,kBAAkBd,EAAW;AAAA,YAC7B,IAAI,GAAGT,CAAE;AAAA,YACT,cAAce;AAAA,YACd,YAAAjB;AAAA,UAAA;AAAA,QAAA;AAAA,QAEDQ,KACC,gBAAAe;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,kBAAkBf,EAAW;AAAA,YAC5B,GAAIV,KAAqB,EAAE,wBAAwBO,EAAA;AAAA,YACpD,IAAI,GAAGN,CAAE;AAAA,YACT,gBAAAO;AAAA,YACA,cAAcQ;AAAA,YACd,MAAME;AAAA,UAAA;AAAA,QAAA;AAAA,MACR;AAAA,IAAA;AAAA,EAAA;AAIR;AAEAvB,EAAW,kBAAkB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),Q=require("classnames"),x=require("react"),z=require("../../hooks/styleProps.cjs"),w=require("../../hooks/
|
|
1
|
+
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),Q=require("classnames"),x=require("react"),z=require("../../hooks/styleProps.cjs"),w=require("../../hooks/useAriaIdRefs.cjs"),G=require("../Field/HelperText.cjs"),D=require("../Field/Label.cjs"),J=require("../Field/ValidationText.cjs"),K=require("../Field/useValidationTextRole.cjs"),W=require("../Icon/Icon.cjs"),g=require("./constants.cjs"),X=require("./useFileUploaderInput.cjs"),Y=require("./useFileUploaderStyleProps.cjs"),v=b=>{const[i,F]=x.useState(!1),{accept:o,"aria-describedby":T="",dropZoneRef:f,hasValidationIcon:h,helperText:E,iconName:I="upload",id:t,inputRef:N,isDisabled:r,isLabelHidden:S,isMultiple:n,isRequired:_,label:q,labelText:U,linkText:y,maxFileSize:L=g.DEFAULT_FILE_SIZE_LIMIT,maxUploadedFiles:j=g.DEFAULT_FILE_QUEUE_LIMIT,name:A,onError:P,queueLimitBehavior:l="none",validationState:a,validationText:d,...u}=b,{isDisabledByQueueLimitBehavior:p,isDragging:R,isDropZoneHidden:B,onChange:M,onDragEnter:V,onDragLeave:Z,onDragOver:H,onDrop:O}=X.useFileUploaderInput({accept:o,isMultiple:n,maxFileSize:L,maxUploadedFiles:j,onError:P,queueLimitBehavior:l}),{classProps:s}=Y.useFileUploaderStyleProps({isDisabled:r,isDisabledByQueueLimitBehavior:p,isDragAndDropSupported:i,isDragging:R,isDropZoneHidden:B,isLabelHidden:S,isRequired:_,queueLimitBehavior:l,validationState:a}),{styleProps:c,props:$}=z.useStyleProps(u),[k,m]=w.useAriaDescribedBy(T),C=K.useValidationTextRole({validationState:a,validationText:d});return x.useEffect(()=>{F("draggable"in document.createElement("span"))},[]),e.jsxs("div",{...$,...c,onDragOver:!r&&i?H:void 0,onDragEnter:!r&&i?V:void 0,onDragLeave:!r&&i?Z:void 0,onDrop:!r&&i?O:void 0,className:Q(s.input.root,c.className),children:[e.jsx(D.default,{htmlFor:t,UNSAFE_className:s.input.label,children:q}),e.jsx("input",{...k,type:"file",accept:o,id:t,ref:N,name:A,className:s.input.input,onChange:M,multiple:n,disabled:r||p,...u}),e.jsxs("div",{ref:f,className:s.input.dropZone.root,children:[e.jsx(W.default,{name:I,"aria-hidden":"true"}),e.jsxs(D.default,{htmlFor:t,UNSAFE_className:s.input.dropZone.label,children:[e.jsx("span",{className:s.input.link,children:y})," ",e.jsx("span",{className:s.input.dropLabel,children:U})]}),e.jsx(G.default,{UNSAFE_className:s.input.helper,id:`${t}__helperText`,registerAria:m,helperText:E})]}),a&&e.jsx(J.default,{UNSAFE_className:s.input.validationText,elementType:"span",...h&&{hasValidationStateIcon:a},id:`${t}__validationText`,validationText:d,registerAria:m,role:C})]})};v.spiritComponent="FileUploaderInput";exports.default=v;
|
|
2
2
|
//# sourceMappingURL=FileUploaderInput.cjs.map
|