@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { type LinkProps, type PolymorphicComponent, type PolymorphicRef, type SpiritLinkProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useLinkStyleProps } from './useLinkStyleProps';\n\nconst defaultProps = {\n elementType: 'a',\n color: 'primary',\n hasVisitedStyleAllowed: false,\n underlined: 'hover',\n};\n\nconst _Link = <E extends ElementType = 'a', C = void>(\n props: SpiritLinkProps<E, C>,\n ref: PolymorphicRef<E>,\n): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = defaultProps.elementType, children, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { classProps, props: modifiedProps } = useLinkStyleProps(restProps);\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps, styleProps, otherProps });\n\n return (\n <Component {...otherProps} {...mergedStyleProps}
|
|
1
|
+
{"version":3,"file":"Link.js","sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useLinkClick, useStyleProps } from '../../hooks';\nimport { type LinkProps, type PolymorphicComponent, type PolymorphicRef, type SpiritLinkProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useLinkStyleProps } from './useLinkStyleProps';\n\nconst defaultProps = {\n elementType: 'a',\n color: 'primary',\n hasVisitedStyleAllowed: false,\n underlined: 'hover',\n};\n\nconst _Link = <E extends ElementType = 'a', C = void>(\n props: SpiritLinkProps<E, C>,\n ref: PolymorphicRef<E>,\n): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = defaultProps.elementType, children, routerOptions, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { classProps, props: modifiedProps } = useLinkStyleProps(restProps);\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps, styleProps, otherProps });\n\n const handleClick = useLinkClick({ ...restProps, routerOptions });\n\n return (\n <Component {...otherProps} {...mergedStyleProps} onClick={handleClick} ref={ref}>\n {children}\n </Component>\n );\n};\n\nconst Link = forwardRef<HTMLAnchorElement, SpiritLinkProps<'a', void>>(_Link) as unknown as PolymorphicComponent<\n 'a',\n LinkProps<void>\n>;\n\nLink.spiritComponent = 'Link';\nLink.displayName = 'Link';\n\nexport default Link;\n"],"names":["defaultProps","_Link","props","ref","propsWithDefaults","elementType","children","routerOptions","restProps","Component","classProps","modifiedProps","useLinkStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","handleClick","useLinkClick","jsx","Link","forwardRef"],"mappings":";;;;;;;AAQA,MAAMA,IAAe;AAAA,EACnB,aAAa;AAAA,EACb,OAAO;AAAA,EACP,wBAAwB;AAAA,EACxB,YAAY;AACd,GAEMC,IAAQ,CACZC,GACAC,MACgB;AAChB,QAAMC,IAAoB,EAAE,GAAGJ,GAAc,GAAGE,EAAA,GAC1C,EAAE,aAAAG,IAAcL,EAAa,aAAa,UAAAM,GAAU,eAAAC,GAAe,GAAGC,MAAcJ,GAEpFK,IAAYJ,GAEZ,EAAE,YAAAK,GAAY,OAAOC,EAAA,IAAkBC,EAAkBJ,CAAS,GAClE,EAAE,YAAAK,GAAY,OAAOC,EAAA,IAAeC,EAAcJ,CAAa,GAC/DK,IAAmBC,EAAgBR,GAAW,EAAE,YAAAC,GAAY,YAAAG,GAAY,YAAAC,GAAY,GAEpFI,IAAcC,EAAa,EAAE,GAAGX,GAAW,eAAAD,GAAe;AAEhE,SACE,gBAAAa,EAACX,KAAW,GAAGK,GAAa,GAAGE,GAAkB,SAASE,GAAa,KAAAf,GACpE,UAAAG,GACH;AAEJ,GAEMe,IAAOC,EAA0DrB,CAAK;AAK5EoB,EAAK,kBAAkB;AACvBA,EAAK,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkStyleProps.cjs","sources":["../../../src/components/Link/useLinkStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type LinkProps, type LinkStyleProps, UNDERLINED_OPTIONS } from '../../types';\n\nexport function useLinkStyleProps<C = void>(props: LinkStyleProps<C>) {\n const { color, hasVisitedStyleAllowed, isDisabled, underlined, ...restProps } = props;\n\n const linkClass = useClassNamePrefix('link');\n const linkColorClass = `${linkClass}-${color}`;\n const linkDisabledClass = `${linkClass}-disabled`;\n const linkUnderlinedClass = `${linkClass}-underlined`;\n const linkNotUnderlinedClass = `${linkClass}-not-underlined`;\n const linkVisitedStyleAllowedClass = `${linkClass}-allow-visited-style`;\n\n const className = classNames(linkColorClass, {\n [linkDisabledClass]: isDisabled,\n [linkUnderlinedClass]: underlined === UNDERLINED_OPTIONS.ALWAYS,\n [linkNotUnderlinedClass]: underlined === UNDERLINED_OPTIONS.NEVER,\n [linkVisitedStyleAllowedClass]: hasVisitedStyleAllowed,\n });\n\n return {\n classProps: className,\n props: restProps as Partial<LinkProps<C>>,\n };\n}\n"],"names":["useLinkStyleProps","props","color","hasVisitedStyleAllowed","isDisabled","underlined","restProps","linkClass","useClassNamePrefix","linkColorClass","linkDisabledClass","linkUnderlinedClass","linkNotUnderlinedClass","linkVisitedStyleAllowedClass","classNames","UNDERLINED_OPTIONS"],"mappings":"gMAIO,SAASA,EAA4BC,
|
|
1
|
+
{"version":3,"file":"useLinkStyleProps.cjs","sources":["../../../src/components/Link/useLinkStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type LinkProps, type LinkStyleProps, UNDERLINED_OPTIONS } from '../../types';\n\nexport function useLinkStyleProps<C = void>(props: Omit<LinkStyleProps<C>, 'routerOptions'>) {\n const { color, hasVisitedStyleAllowed, isDisabled, underlined, ...restProps } = props;\n\n const linkClass = useClassNamePrefix('link');\n const linkColorClass = `${linkClass}-${color}`;\n const linkDisabledClass = `${linkClass}-disabled`;\n const linkUnderlinedClass = `${linkClass}-underlined`;\n const linkNotUnderlinedClass = `${linkClass}-not-underlined`;\n const linkVisitedStyleAllowedClass = `${linkClass}-allow-visited-style`;\n\n const className = classNames(linkColorClass, {\n [linkDisabledClass]: isDisabled,\n [linkUnderlinedClass]: underlined === UNDERLINED_OPTIONS.ALWAYS,\n [linkNotUnderlinedClass]: underlined === UNDERLINED_OPTIONS.NEVER,\n [linkVisitedStyleAllowedClass]: hasVisitedStyleAllowed,\n });\n\n return {\n classProps: className,\n props: restProps as Partial<LinkProps<C>>,\n };\n}\n"],"names":["useLinkStyleProps","props","color","hasVisitedStyleAllowed","isDisabled","underlined","restProps","linkClass","useClassNamePrefix","linkColorClass","linkDisabledClass","linkUnderlinedClass","linkNotUnderlinedClass","linkVisitedStyleAllowedClass","classNames","UNDERLINED_OPTIONS"],"mappings":"gMAIO,SAASA,EAA4BC,EAAiD,CAC3F,KAAM,CAAE,MAAAC,EAAO,uBAAAC,EAAwB,WAAAC,EAAY,WAAAC,EAAY,GAAGC,GAAcL,EAE1EM,EAAYC,EAAAA,mBAAmB,MAAM,EACrCC,EAAiB,GAAGF,CAAS,IAAIL,CAAK,GACtCQ,EAAoB,GAAGH,CAAS,YAChCI,EAAsB,GAAGJ,CAAS,cAClCK,EAAyB,GAAGL,CAAS,kBACrCM,EAA+B,GAAGN,CAAS,uBASjD,MAAO,CACL,WARgBO,EAAWL,EAAgB,CAC3C,CAACC,CAAiB,EAAGN,EACrB,CAACO,CAAmB,EAAGN,IAAeU,EAAAA,mBAAmB,OACzD,CAACH,CAAsB,EAAGP,IAAeU,EAAAA,mBAAmB,MAC5D,CAACF,CAA4B,EAAGV,CAAA,CACjC,EAIC,MAAOG,CAAA,CAEX"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LinkProps, LinkStyleProps } from '../../types';
|
|
2
|
-
export declare function useLinkStyleProps<C = void>(props: LinkStyleProps<C>): {
|
|
2
|
+
export declare function useLinkStyleProps<C = void>(props: Omit<LinkStyleProps<C>, 'routerOptions'>): {
|
|
3
3
|
classProps: string;
|
|
4
4
|
props: Partial<LinkProps<C>>;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkStyleProps.js","sources":["../../../src/components/Link/useLinkStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type LinkProps, type LinkStyleProps, UNDERLINED_OPTIONS } from '../../types';\n\nexport function useLinkStyleProps<C = void>(props: LinkStyleProps<C>) {\n const { color, hasVisitedStyleAllowed, isDisabled, underlined, ...restProps } = props;\n\n const linkClass = useClassNamePrefix('link');\n const linkColorClass = `${linkClass}-${color}`;\n const linkDisabledClass = `${linkClass}-disabled`;\n const linkUnderlinedClass = `${linkClass}-underlined`;\n const linkNotUnderlinedClass = `${linkClass}-not-underlined`;\n const linkVisitedStyleAllowedClass = `${linkClass}-allow-visited-style`;\n\n const className = classNames(linkColorClass, {\n [linkDisabledClass]: isDisabled,\n [linkUnderlinedClass]: underlined === UNDERLINED_OPTIONS.ALWAYS,\n [linkNotUnderlinedClass]: underlined === UNDERLINED_OPTIONS.NEVER,\n [linkVisitedStyleAllowedClass]: hasVisitedStyleAllowed,\n });\n\n return {\n classProps: className,\n props: restProps as Partial<LinkProps<C>>,\n };\n}\n"],"names":["useLinkStyleProps","props","color","hasVisitedStyleAllowed","isDisabled","underlined","restProps","linkClass","useClassNamePrefix","linkColorClass","linkDisabledClass","linkUnderlinedClass","linkNotUnderlinedClass","linkVisitedStyleAllowedClass","classNames","UNDERLINED_OPTIONS"],"mappings":";;;AAIO,SAASA,EAA4BC,
|
|
1
|
+
{"version":3,"file":"useLinkStyleProps.js","sources":["../../../src/components/Link/useLinkStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type LinkProps, type LinkStyleProps, UNDERLINED_OPTIONS } from '../../types';\n\nexport function useLinkStyleProps<C = void>(props: Omit<LinkStyleProps<C>, 'routerOptions'>) {\n const { color, hasVisitedStyleAllowed, isDisabled, underlined, ...restProps } = props;\n\n const linkClass = useClassNamePrefix('link');\n const linkColorClass = `${linkClass}-${color}`;\n const linkDisabledClass = `${linkClass}-disabled`;\n const linkUnderlinedClass = `${linkClass}-underlined`;\n const linkNotUnderlinedClass = `${linkClass}-not-underlined`;\n const linkVisitedStyleAllowedClass = `${linkClass}-allow-visited-style`;\n\n const className = classNames(linkColorClass, {\n [linkDisabledClass]: isDisabled,\n [linkUnderlinedClass]: underlined === UNDERLINED_OPTIONS.ALWAYS,\n [linkNotUnderlinedClass]: underlined === UNDERLINED_OPTIONS.NEVER,\n [linkVisitedStyleAllowedClass]: hasVisitedStyleAllowed,\n });\n\n return {\n classProps: className,\n props: restProps as Partial<LinkProps<C>>,\n };\n}\n"],"names":["useLinkStyleProps","props","color","hasVisitedStyleAllowed","isDisabled","underlined","restProps","linkClass","useClassNamePrefix","linkColorClass","linkDisabledClass","linkUnderlinedClass","linkNotUnderlinedClass","linkVisitedStyleAllowedClass","classNames","UNDERLINED_OPTIONS"],"mappings":";;;AAIO,SAASA,EAA4BC,GAAiD;AAC3F,QAAM,EAAE,OAAAC,GAAO,wBAAAC,GAAwB,YAAAC,GAAY,YAAAC,GAAY,GAAGC,MAAcL,GAE1EM,IAAYC,EAAmB,MAAM,GACrCC,IAAiB,GAAGF,CAAS,IAAIL,CAAK,IACtCQ,IAAoB,GAAGH,CAAS,aAChCI,IAAsB,GAAGJ,CAAS,eAClCK,IAAyB,GAAGL,CAAS,mBACrCM,IAA+B,GAAGN,CAAS;AASjD,SAAO;AAAA,IACL,YARgBO,EAAWL,GAAgB;AAAA,MAC3C,CAACC,CAAiB,GAAGN;AAAA,MACrB,CAACO,CAAmB,GAAGN,MAAeU,EAAmB;AAAA,MACzD,CAACH,CAAsB,GAAGP,MAAeU,EAAmB;AAAA,MAC5D,CAACF,CAA4B,GAAGV;AAAA,IAAA,CACjC;AAAA,IAIC,OAAOG;AAAA,EAAA;AAEX;"}
|
|
@@ -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"),q=require("react"),L=require("../../hooks/styleProps.cjs"),S=require("../../hooks/useI18n.cjs"),C=require("../../hooks/useLinkClick.cjs"),b=require("../../utils/mergeStyleProps.cjs"),h=require("../VisuallyHidden/VisuallyHidden.cjs"),f=require("./usePaginationStyleProps.cjs"),j=(a,l)=>{const{t:c}=S.useI18n(),{elementType:u="a",accessibilityLabel:p,isCurrent:n,pageNumber:t,routerOptions:P,...r}=a,d=p||`${c("pagination.goToPage")} ${t}`,i=u,{classProps:g}=f.usePaginationStyleProps({isCurrent:n}),{styleProps:y,props:o}=L.useStyleProps(r),k=b.mergeStyleProps(i,{classProps:g.link,styleProps:y,otherProps:o}),m=C.useLinkClick({...r,routerOptions:P});return e.jsxs(i,{...n&&{"aria-current":"page"},...o,...k,onClick:m,ref:l,children:[e.jsx(h.default,{children:d}),e.jsx("span",{"aria-hidden":"true",children:t})]})},s=q.forwardRef(j);s.spiritComponent="PaginationLink";s.displayName="PaginationLink";exports.default=s;
|
|
2
2
|
//# sourceMappingURL=PaginationLink.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationLink.cjs","sources":["../../../src/components/Pagination/PaginationLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useI18n, useStyleProps } from '../../hooks';\nimport { type PolymorphicComponent, type PolymorphicRef, type SpiritPaginationLinkProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { usePaginationStyleProps } from './usePaginationStyleProps';\n\nconst _PaginationLink = <E extends ElementType = 'a'>(props: SpiritPaginationLinkProps<E>, ref: PolymorphicRef<E>) => {\n const { t } = useI18n();\n const { elementType = 'a', accessibilityLabel, isCurrent, pageNumber, ...restProps } = props;\n const visuallyHiddenLabel = accessibilityLabel || `${t('pagination.goToPage')} ${pageNumber}`;\n\n const Component = elementType as ElementType;\n\n const { classProps } = usePaginationStyleProps({ isCurrent });\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link, styleProps, otherProps });\n\n return (\n <Component
|
|
1
|
+
{"version":3,"file":"PaginationLink.cjs","sources":["../../../src/components/Pagination/PaginationLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useI18n, useLinkClick, useStyleProps } from '../../hooks';\nimport { type PolymorphicComponent, type PolymorphicRef, type SpiritPaginationLinkProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { usePaginationStyleProps } from './usePaginationStyleProps';\n\nconst _PaginationLink = <E extends ElementType = 'a'>(props: SpiritPaginationLinkProps<E>, ref: PolymorphicRef<E>) => {\n const { t } = useI18n();\n const { elementType = 'a', accessibilityLabel, isCurrent, pageNumber, routerOptions, ...restProps } = props;\n const visuallyHiddenLabel = accessibilityLabel || `${t('pagination.goToPage')} ${pageNumber}`;\n\n const Component = elementType as ElementType;\n\n const { classProps } = usePaginationStyleProps({ isCurrent });\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link, styleProps, otherProps });\n\n const handleClick = useLinkClick({ ...restProps, routerOptions });\n\n return (\n <Component\n {...(isCurrent && { 'aria-current': 'page' })}\n {...otherProps}\n {...mergedStyleProps}\n onClick={handleClick}\n ref={ref}\n >\n <VisuallyHidden>{visuallyHiddenLabel}</VisuallyHidden>\n <span aria-hidden=\"true\">{pageNumber}</span>\n </Component>\n );\n};\n\nconst PaginationLink = forwardRef<HTMLAnchorElement, SpiritPaginationLinkProps<'a'>>(\n _PaginationLink,\n) as unknown as PolymorphicComponent<'a', SpiritPaginationLinkProps<ElementType>>;\n\nPaginationLink.spiritComponent = 'PaginationLink';\nPaginationLink.displayName = 'PaginationLink';\n\nexport default PaginationLink;\n"],"names":["_PaginationLink","props","ref","t","useI18n","elementType","accessibilityLabel","isCurrent","pageNumber","routerOptions","restProps","visuallyHiddenLabel","Component","classProps","usePaginationStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","handleClick","useLinkClick","jsxs","jsx","VisuallyHidden","PaginationLink","forwardRef"],"mappings":"kbASMA,EAAkB,CAA8BC,EAAqCC,IAA2B,CACpH,KAAM,CAAE,EAAAC,CAAA,EAAMC,UAAA,EACR,CAAE,YAAAC,EAAc,IAAK,mBAAAC,EAAoB,UAAAC,EAAW,WAAAC,EAAY,cAAAC,EAAe,GAAGC,CAAA,EAAcT,EAChGU,EAAsBL,GAAsB,GAAGH,EAAE,qBAAqB,CAAC,IAAIK,CAAU,GAErFI,EAAYP,EAEZ,CAAE,WAAAQ,CAAA,EAAeC,0BAAwB,CAAE,UAAAP,EAAW,EACtD,CAAA,WAAEQ,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcP,CAAS,EAC3DQ,EAAmBC,kBAAgBP,EAAW,CAAE,WAAYC,EAAW,KAAA,WAAME,EAAY,WAAAC,EAAY,EAErGI,EAAcC,EAAAA,aAAa,CAAE,GAAGX,EAAW,cAAAD,EAAe,EAEhE,OACEa,EAAAA,KAACV,EAAA,CACE,GAAIL,GAAa,CAAE,eAAgB,MAAA,EACnC,GAAGS,EACH,GAAGE,EACJ,QAASE,EACT,IAAAlB,EAEA,SAAA,CAAAqB,EAAAA,IAACC,EAAAA,SAAgB,SAAAb,CAAA,CAAoB,EACrCY,EAAAA,IAAC,OAAA,CAAK,cAAY,OAAQ,SAAAf,CAAA,CAAW,CAAA,CAAA,CAAA,CAG3C,EAEMiB,EAAiBC,EAAAA,WACrB1B,CACF,EAEAyB,EAAe,gBAAkB,iBACjCA,EAAe,YAAc"}
|
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useStyleProps as
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import { jsxs as k, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as L } from "react";
|
|
4
|
+
import { useStyleProps as h } from "../../hooks/styleProps.js";
|
|
5
|
+
import { useI18n as C } from "../../hooks/useI18n.js";
|
|
6
|
+
import { useLinkClick as b } from "../../hooks/useLinkClick.js";
|
|
7
|
+
import { mergeStyleProps as S } from "../../utils/mergeStyleProps.js";
|
|
8
|
+
import x from "../VisuallyHidden/VisuallyHidden.js";
|
|
9
|
+
import { usePaginationStyleProps as j } from "./usePaginationStyleProps.js";
|
|
10
|
+
const H = (a, p) => {
|
|
11
|
+
const { t: l } = C(), { elementType: c = "a", accessibilityLabel: m, isCurrent: o, pageNumber: r, routerOptions: u, ...i } = a, P = m || `${l("pagination.goToPage")} ${r}`, n = c, { classProps: d } = j({ isCurrent: o }), { styleProps: g, props: t } = h(i), f = S(n, { classProps: d.link, styleProps: g, otherProps: t }), y = b({ ...i, routerOptions: u });
|
|
12
|
+
return /* @__PURE__ */ k(
|
|
13
|
+
n,
|
|
14
|
+
{
|
|
15
|
+
...o && { "aria-current": "page" },
|
|
16
|
+
...t,
|
|
17
|
+
...f,
|
|
18
|
+
onClick: y,
|
|
19
|
+
ref: p,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ e(x, { children: P }),
|
|
22
|
+
/* @__PURE__ */ e("span", { "aria-hidden": "true", children: r })
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}, s = L(
|
|
27
|
+
H
|
|
17
28
|
);
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
s.spiritComponent = "PaginationLink";
|
|
30
|
+
s.displayName = "PaginationLink";
|
|
20
31
|
export {
|
|
21
|
-
|
|
32
|
+
s as default
|
|
22
33
|
};
|
|
23
34
|
//# sourceMappingURL=PaginationLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationLink.js","sources":["../../../src/components/Pagination/PaginationLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useI18n, useStyleProps } from '../../hooks';\nimport { type PolymorphicComponent, type PolymorphicRef, type SpiritPaginationLinkProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { usePaginationStyleProps } from './usePaginationStyleProps';\n\nconst _PaginationLink = <E extends ElementType = 'a'>(props: SpiritPaginationLinkProps<E>, ref: PolymorphicRef<E>) => {\n const { t } = useI18n();\n const { elementType = 'a', accessibilityLabel, isCurrent, pageNumber, ...restProps } = props;\n const visuallyHiddenLabel = accessibilityLabel || `${t('pagination.goToPage')} ${pageNumber}`;\n\n const Component = elementType as ElementType;\n\n const { classProps } = usePaginationStyleProps({ isCurrent });\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link, styleProps, otherProps });\n\n return (\n <Component
|
|
1
|
+
{"version":3,"file":"PaginationLink.js","sources":["../../../src/components/Pagination/PaginationLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useI18n, useLinkClick, useStyleProps } from '../../hooks';\nimport { type PolymorphicComponent, type PolymorphicRef, type SpiritPaginationLinkProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { usePaginationStyleProps } from './usePaginationStyleProps';\n\nconst _PaginationLink = <E extends ElementType = 'a'>(props: SpiritPaginationLinkProps<E>, ref: PolymorphicRef<E>) => {\n const { t } = useI18n();\n const { elementType = 'a', accessibilityLabel, isCurrent, pageNumber, routerOptions, ...restProps } = props;\n const visuallyHiddenLabel = accessibilityLabel || `${t('pagination.goToPage')} ${pageNumber}`;\n\n const Component = elementType as ElementType;\n\n const { classProps } = usePaginationStyleProps({ isCurrent });\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link, styleProps, otherProps });\n\n const handleClick = useLinkClick({ ...restProps, routerOptions });\n\n return (\n <Component\n {...(isCurrent && { 'aria-current': 'page' })}\n {...otherProps}\n {...mergedStyleProps}\n onClick={handleClick}\n ref={ref}\n >\n <VisuallyHidden>{visuallyHiddenLabel}</VisuallyHidden>\n <span aria-hidden=\"true\">{pageNumber}</span>\n </Component>\n );\n};\n\nconst PaginationLink = forwardRef<HTMLAnchorElement, SpiritPaginationLinkProps<'a'>>(\n _PaginationLink,\n) as unknown as PolymorphicComponent<'a', SpiritPaginationLinkProps<ElementType>>;\n\nPaginationLink.spiritComponent = 'PaginationLink';\nPaginationLink.displayName = 'PaginationLink';\n\nexport default PaginationLink;\n"],"names":["_PaginationLink","props","ref","t","useI18n","elementType","accessibilityLabel","isCurrent","pageNumber","routerOptions","restProps","visuallyHiddenLabel","Component","classProps","usePaginationStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","handleClick","useLinkClick","jsxs","jsx","VisuallyHidden","PaginationLink","forwardRef"],"mappings":";;;;;;;;;AASA,MAAMA,IAAkB,CAA8BC,GAAqCC,MAA2B;AACpH,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,EAAE,aAAAC,IAAc,KAAK,oBAAAC,GAAoB,WAAAC,GAAW,YAAAC,GAAY,eAAAC,GAAe,GAAGC,EAAA,IAAcT,GAChGU,IAAsBL,KAAsB,GAAGH,EAAE,qBAAqB,CAAC,IAAIK,CAAU,IAErFI,IAAYP,GAEZ,EAAE,YAAAQ,EAAA,IAAeC,EAAwB,EAAE,WAAAP,GAAW,GACtD,EAAE,YAAAQ,GAAY,OAAOC,EAAA,IAAeC,EAAcP,CAAS,GAC3DQ,IAAmBC,EAAgBP,GAAW,EAAE,YAAYC,EAAW,MAAM,YAAAE,GAAY,YAAAC,GAAY,GAErGI,IAAcC,EAAa,EAAE,GAAGX,GAAW,eAAAD,GAAe;AAEhE,SACE,gBAAAa;AAAA,IAACV;AAAA,IAAA;AAAA,MACE,GAAIL,KAAa,EAAE,gBAAgB,OAAA;AAAA,MACnC,GAAGS;AAAA,MACH,GAAGE;AAAA,MACJ,SAASE;AAAA,MACT,KAAAlB;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAqB,EAACC,KAAgB,UAAAb,EAAA,CAAoB;AAAA,QACrC,gBAAAY,EAAC,QAAA,EAAK,eAAY,QAAQ,UAAAf,EAAA,CAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG3C,GAEMiB,IAAiBC;AAAA,EACrB1B;AACF;AAEAyB,EAAe,kBAAkB;AACjCA,EAAe,cAAc;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),N=require("classnames"),R=require("react"),f=require("../../hooks/styleProps.cjs"),q=require("../../hooks/useAriaIdRefs.cjs"),j=require("../Field/HelperText.cjs"),S=require("../Field/Label.cjs"),_=require("./useRadioStyleProps.cjs"),g=(a,o)=>{const{classProps:e,props:l}=_.useRadioStyleProps(a),{"aria-describedby":c="",helperText:d,id:r,isChecked:u,isDisabled:n,label:p,onChange:y,value:m,...b}=l,{styleProps:i,props:P}=f.useStyleProps(b),[h,x]=q.useAriaDescribedBy(c);return s.jsxs("div",{style:i.style,className:N(e.root,i.className),children:[s.jsx("input",{...P,...h,type:"radio",id:r,className:e.input,disabled:n,checked:u,onChange:y,value:m,ref:o}),s.jsxs("div",{className:e.text,children:[s.jsx(S.default,{UNSAFE_className:e.label,htmlFor:r,children:p}),s.jsx(j.default,{UNSAFE_className:e.helperText,id:`${r}__helperText`,registerAria:x,helperText:d})]})]})},t=R.forwardRef(g);t.spiritComponent="Radio";t.displayName="Radio";exports.default=t;
|
|
2
2
|
//# sourceMappingURL=Radio.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.cjs","sources":["../../../src/components/Radio/Radio.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 SpiritRadioProps } from '../../types';\nimport { HelperText, Label
|
|
1
|
+
{"version":3,"file":"Radio.cjs","sources":["../../../src/components/Radio/Radio.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 SpiritRadioProps } from '../../types';\nimport { HelperText, Label } from '../Field';\nimport { useRadioStyleProps } from './useRadioStyleProps';\n\nconst _Radio = (props: SpiritRadioProps, ref: ForwardedRef<HTMLInputElement>): JSX.Element => {\n const { classProps, props: modifiedProps } = useRadioStyleProps(props);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n helperText,\n id,\n isChecked,\n isDisabled,\n label,\n onChange,\n value,\n ...restProps\n } = modifiedProps;\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n\n return (\n <div style={styleProps.style} className={classNames(classProps.root, styleProps.className)}>\n <input\n {...otherProps}\n {...ariaDescribedByProp}\n type=\"radio\"\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n checked={isChecked}\n onChange={onChange}\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 <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n </div>\n </div>\n );\n};\n\nconst Radio = forwardRef<HTMLInputElement, SpiritRadioProps>(_Radio) as ForwardRefComponent<\n HTMLInputElement,\n SpiritRadioProps\n>;\n\nRadio.spiritComponent = 'Radio';\nRadio.displayName = 'Radio';\n\nexport default Radio;\n"],"names":["_Radio","props","ref","classProps","modifiedProps","useRadioStyleProps","ariaDescribedBy","helperText","id","isChecked","isDisabled","label","onChange","value","restProps","styleProps","otherProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","jsxs","classNames","jsx","Label","HelperText","Radio","forwardRef"],"mappings":"uYASMA,EAAS,CAACC,EAAyBC,IAAqD,CAC5F,KAAM,CAAE,WAAAC,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,mBAAmBJ,CAAK,EAC/D,CACJ,mBAAoBK,EAAkB,GACtC,WAAAC,EACA,GAAAC,EACA,UAAAC,EACA,WAAAC,EACA,MAAAC,EACA,SAAAC,EACA,MAAAC,EACA,GAAGC,CAAA,EACDV,EACE,CAAA,WAAEW,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcH,CAAS,EAE3D,CAACI,EAAqBC,CAAQ,EAAIC,EAAAA,mBAAmBd,CAAe,EAE1E,OACEe,EAAAA,KAAC,MAAA,CAAI,MAAON,EAAW,MAAO,UAAWO,EAAWnB,EAAW,KAAMY,EAAW,SAAS,EACvF,SAAA,CAAAQ,EAAAA,IAAC,QAAA,CACE,GAAGP,EACH,GAAGE,EACJ,KAAK,QACL,GAAAV,EACA,UAAWL,EAAW,MACtB,SAAUO,EACV,QAASD,EACT,SAAAG,EACA,MAAAC,EACA,IAAAX,CAAA,CAAA,EAEFmB,EAAAA,KAAC,MAAA,CAAI,UAAWlB,EAAW,KACzB,SAAA,CAAAoB,MAACC,EAAAA,SAAM,iBAAkBrB,EAAW,MAAO,QAASK,EACjD,SAAAG,EACH,EACAY,EAAAA,IAACE,EAAAA,QAAA,CACC,iBAAkBtB,EAAW,WAC7B,GAAI,GAAGK,CAAE,eACT,aAAcW,EACd,WAAAZ,CAAA,CAAA,CACF,CAAA,CACF,CAAA,EACF,CAEJ,EAEMmB,EAAQC,EAAAA,WAA+C3B,CAAM,EAKnE0B,EAAM,gBAAkB,QACxBA,EAAM,YAAc"}
|
|
@@ -1,55 +1,54 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as i, jsx as
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
2
|
+
import { jsxs as i, jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import P from "classnames";
|
|
4
|
+
import { forwardRef as R } from "react";
|
|
5
5
|
import { useStyleProps as _ } from "../../hooks/styleProps.js";
|
|
6
|
-
import { useAriaDescribedBy as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const { classProps: e, props: p } = v(a), {
|
|
6
|
+
import { useAriaDescribedBy as A } from "../../hooks/useAriaIdRefs.js";
|
|
7
|
+
import D from "../Field/HelperText.js";
|
|
8
|
+
import S from "../Field/Label.js";
|
|
9
|
+
import { useRadioStyleProps as T } from "./useRadioStyleProps.js";
|
|
10
|
+
const g = (a, l) => {
|
|
11
|
+
const { classProps: e, props: p } = T(a), {
|
|
13
12
|
"aria-describedby": d = "",
|
|
14
13
|
helperText: m,
|
|
15
|
-
id:
|
|
14
|
+
id: r,
|
|
16
15
|
isChecked: c,
|
|
17
16
|
isDisabled: n,
|
|
18
17
|
label: f,
|
|
19
18
|
onChange: h,
|
|
20
|
-
value:
|
|
21
|
-
...
|
|
22
|
-
} = p, { styleProps: o, props:
|
|
23
|
-
return /* @__PURE__ */ i("div", { style: o.style, className:
|
|
24
|
-
/* @__PURE__ */
|
|
19
|
+
value: y,
|
|
20
|
+
...b
|
|
21
|
+
} = p, { styleProps: o, props: u } = _(b), [N, x] = A(d);
|
|
22
|
+
return /* @__PURE__ */ i("div", { style: o.style, className: P(e.root, o.className), children: [
|
|
23
|
+
/* @__PURE__ */ s(
|
|
25
24
|
"input",
|
|
26
25
|
{
|
|
27
|
-
...
|
|
28
|
-
...
|
|
26
|
+
...u,
|
|
27
|
+
...N,
|
|
29
28
|
type: "radio",
|
|
30
|
-
id:
|
|
29
|
+
id: r,
|
|
31
30
|
className: e.input,
|
|
32
31
|
disabled: n,
|
|
33
32
|
checked: c,
|
|
34
33
|
onChange: h,
|
|
35
|
-
value:
|
|
34
|
+
value: y,
|
|
36
35
|
ref: l
|
|
37
36
|
}
|
|
38
37
|
),
|
|
39
38
|
/* @__PURE__ */ i("div", { className: e.text, children: [
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
39
|
+
/* @__PURE__ */ s(S, { UNSAFE_className: e.label, htmlFor: r, children: f }),
|
|
40
|
+
/* @__PURE__ */ s(
|
|
41
|
+
D,
|
|
43
42
|
{
|
|
44
43
|
UNSAFE_className: e.helperText,
|
|
45
|
-
id: `${
|
|
44
|
+
id: `${r}__helperText`,
|
|
46
45
|
registerAria: x,
|
|
47
46
|
helperText: m
|
|
48
47
|
}
|
|
49
48
|
)
|
|
50
49
|
] })
|
|
51
50
|
] });
|
|
52
|
-
}, t =
|
|
51
|
+
}, t = R(g);
|
|
53
52
|
t.spiritComponent = "Radio";
|
|
54
53
|
t.displayName = "Radio";
|
|
55
54
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sources":["../../../src/components/Radio/Radio.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 SpiritRadioProps } from '../../types';\nimport { HelperText, Label
|
|
1
|
+
{"version":3,"file":"Radio.js","sources":["../../../src/components/Radio/Radio.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 SpiritRadioProps } from '../../types';\nimport { HelperText, Label } from '../Field';\nimport { useRadioStyleProps } from './useRadioStyleProps';\n\nconst _Radio = (props: SpiritRadioProps, ref: ForwardedRef<HTMLInputElement>): JSX.Element => {\n const { classProps, props: modifiedProps } = useRadioStyleProps(props);\n const {\n 'aria-describedby': ariaDescribedBy = '',\n helperText,\n id,\n isChecked,\n isDisabled,\n label,\n onChange,\n value,\n ...restProps\n } = modifiedProps;\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n\n return (\n <div style={styleProps.style} className={classNames(classProps.root, styleProps.className)}>\n <input\n {...otherProps}\n {...ariaDescribedByProp}\n type=\"radio\"\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n checked={isChecked}\n onChange={onChange}\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 <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helperText`}\n registerAria={register}\n helperText={helperText}\n />\n </div>\n </div>\n );\n};\n\nconst Radio = forwardRef<HTMLInputElement, SpiritRadioProps>(_Radio) as ForwardRefComponent<\n HTMLInputElement,\n SpiritRadioProps\n>;\n\nRadio.spiritComponent = 'Radio';\nRadio.displayName = 'Radio';\n\nexport default Radio;\n"],"names":["_Radio","props","ref","classProps","modifiedProps","useRadioStyleProps","ariaDescribedBy","helperText","id","isChecked","isDisabled","label","onChange","value","restProps","styleProps","otherProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","jsxs","classNames","jsx","Label","HelperText","Radio","forwardRef"],"mappings":";;;;;;;;;AASA,MAAMA,IAAS,CAACC,GAAyBC,MAAqD;AAC5F,QAAM,EAAE,YAAAC,GAAY,OAAOC,EAAA,IAAkBC,EAAmBJ,CAAK,GAC/D;AAAA,IACJ,oBAAoBK,IAAkB;AAAA,IACtC,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDV,GACE,EAAE,YAAAW,GAAY,OAAOC,EAAA,IAAeC,EAAcH,CAAS,GAE3D,CAACI,GAAqBC,CAAQ,IAAIC,EAAmBd,CAAe;AAE1E,SACE,gBAAAe,EAAC,OAAA,EAAI,OAAON,EAAW,OAAO,WAAWO,EAAWnB,EAAW,MAAMY,EAAW,SAAS,GACvF,UAAA;AAAA,IAAA,gBAAAQ;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGP;AAAA,QACH,GAAGE;AAAA,QACJ,MAAK;AAAA,QACL,IAAAV;AAAA,QACA,WAAWL,EAAW;AAAA,QACtB,UAAUO;AAAA,QACV,SAASD;AAAA,QACT,UAAAG;AAAA,QACA,OAAAC;AAAA,QACA,KAAAX;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAAmB,EAAC,OAAA,EAAI,WAAWlB,EAAW,MACzB,UAAA;AAAA,MAAA,gBAAAoB,EAACC,KAAM,kBAAkBrB,EAAW,OAAO,SAASK,GACjD,UAAAG,GACH;AAAA,MACA,gBAAAY;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,kBAAkBtB,EAAW;AAAA,UAC7B,IAAI,GAAGK,CAAE;AAAA,UACT,cAAcW;AAAA,UACd,YAAAZ;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAAA,CACF;AAAA,EAAA,GACF;AAEJ,GAEMmB,IAAQC,EAA+C3B,CAAM;AAKnE0B,EAAM,kBAAkB;AACxBA,EAAM,cAAc;"}
|
|
@@ -4,7 +4,7 @@ import { isDirectionHorizontal as b } from "../../constants/direction.js";
|
|
|
4
4
|
import { Position as t } from "../../constants/position.js";
|
|
5
5
|
import { useResizeObserver as D } from "../../hooks/useResizeObserver.js";
|
|
6
6
|
import { debounce as m } from "../../utils/debounce.js";
|
|
7
|
-
import {
|
|
7
|
+
import { EDGE_DETECTION_INACCURACY_PX as E, DEBOUNCE_DELAY as S } from "./constants.js";
|
|
8
8
|
const h = ({
|
|
9
9
|
viewportReference: e,
|
|
10
10
|
contentReference: s,
|
|
@@ -24,16 +24,16 @@ const h = ({
|
|
|
24
24
|
const o = b(a), r = o ? t.LEFT : t.TOP, p = o ? t.RIGHT : t.BOTTOM, i = A();
|
|
25
25
|
if (!i)
|
|
26
26
|
return;
|
|
27
|
-
const u = i[r] <= -1 *
|
|
27
|
+
const u = i[r] <= -1 * E, d = i[p] >= E;
|
|
28
28
|
u !== c && T(u), d !== l && P(d);
|
|
29
|
-
}, O = C(m(n,
|
|
29
|
+
}, O = C(m(n, S), [n]);
|
|
30
30
|
return D({
|
|
31
31
|
ref: e,
|
|
32
32
|
onResize: O
|
|
33
33
|
}), g(n, []), {
|
|
34
34
|
isScrolledAtEnd: l,
|
|
35
35
|
isScrolledAtStart: c,
|
|
36
|
-
onScroll: m(n,
|
|
36
|
+
onScroll: m(n, S)
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
export {
|
|
@@ -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"),j=require("classnames"),_=require("react"),u=require("../../constants/dictionaries.cjs"),A=require("../../hooks/styleProps.cjs"),R=require("../../hooks/useAriaIdRefs.cjs"),g=require("../Field/HelperText.cjs"),D=require("../Field/Label.cjs"),F=require("../Field/ValidationText.cjs"),I=require("../Field/useValidationTextRole.cjs"),M=require("../Icon/Icon.cjs"),V=require("./useSelectStyleProps.cjs"),z=(p,x)=>{const{"aria-describedby":S="",children:m,hasValidationIcon:b,helperText:q,id:i,isDisabled:a,isFluid:N,isLabelHidden:h,isRequired:l,label:y,size:o=u.Sizes.MEDIUM,validationState:t,validationText:c,...T}=p,{classProps:s}=V.useSelectStyleProps({isDisabled:a,isFluid:N,isLabelHidden:h,isRequired:l,size:o,validationState:t}),{styleProps:n,props:v}=A.useStyleProps(T),[P,d]=R.useAriaDescribedBy(S),f=I.useValidationTextRole({validationState:t,validationText:c});return e.jsxs("div",{...n,className:j(s.root,n.className),children:[e.jsx(D.default,{htmlFor:i,UNSAFE_className:s.label,children:y}),e.jsxs("div",{className:s.container,children:[e.jsx("select",{...v,...P,id:i,className:s.input,disabled:a,required:l,ref:x,children:m}),e.jsx("div",{className:s.icon,children:e.jsx(M.default,{name:"chevron-down",boxSize:o===u.Sizes.SMALL?16:20})})]}),e.jsx(g.default,{UNSAFE_className:s.helperText,id:`${i}__helperText`,registerAria:d,helperText:q}),t&&e.jsx(F.default,{UNSAFE_className:s.validationText,...b&&{hasValidationStateIcon:t},id:`${i}__validationText`,validationText:c,registerAria:d,role:f})]})},r=_.forwardRef(z);r.spiritComponent="Select";r.displayName="Select";exports.default=r;
|
|
2
2
|
//# sourceMappingURL=Select.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.cjs","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { Sizes } from '../../constants';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritSelectProps } from '../../types';\nimport { HelperText, Label, ValidationText
|
|
1
|
+
{"version":3,"file":"Select.cjs","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { Sizes } from '../../constants';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritSelectProps } from '../../types';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { Icon } from '../Icon';\nimport { useSelectStyleProps } from './useSelectStyleProps';\n\nconst _Select = (props: SpiritSelectProps, ref: ForwardedRef<HTMLSelectElement>) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n children,\n hasValidationIcon,\n helperText,\n id,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n label,\n size = Sizes.MEDIUM,\n validationState,\n validationText,\n ...restProps\n } = props;\n const { classProps } = useSelectStyleProps({\n hasValidationIcon,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n size,\n validationState,\n });\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <div {...styleProps} className={classNames(classProps.root, styleProps.className)}>\n <Label htmlFor={id} UNSAFE_className={classProps.label}>\n {label}\n </Label>\n <div className={classProps.container}>\n <select\n {...transferProps}\n {...ariaDescribedByProp}\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n required={isRequired}\n ref={ref}\n >\n {children}\n </select>\n <div className={classProps.icon}>\n <Icon name=\"chevron-down\" boxSize={size === Sizes.SMALL ? 16 : 20} />\n </div>\n </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}__validationText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n );\n};\n\nconst Select = forwardRef<HTMLSelectElement, SpiritSelectProps>(_Select) as ForwardRefComponent<\n HTMLSelectElement,\n SpiritSelectProps\n>;\n\nSelect.spiritComponent = 'Select';\nSelect.displayName = 'Select';\n\nexport default Select;\n"],"names":["_Select","props","ref","ariaDescribedBy","children","hasValidationIcon","helperText","id","isDisabled","isFluid","isLabelHidden","isRequired","label","size","Sizes","validationState","validationText","restProps","classProps","useSelectStyleProps","styleProps","transferProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","Icon","HelperText","ValidationText","Select","forwardRef"],"mappings":"6iBAYMA,EAAU,CAACC,EAA0BC,IAAyC,CAClF,KAAM,CACJ,mBAAoBC,EAAkB,GACtC,SAAAC,EACA,kBAAAC,EACA,WAAAC,EACA,GAAAC,EACA,WAAAC,EACA,QAAAC,EACA,cAAAC,EACA,WAAAC,EACA,MAAAC,EACA,KAAAC,EAAOC,EAAAA,MAAM,OACb,gBAAAC,EACA,eAAAC,EACA,GAAGC,CAAA,EACDhB,EACE,CAAE,WAAAiB,CAAA,EAAeC,sBAAoB,CAEzC,WAAAX,EACA,QAAAC,EACA,cAAAC,EACA,WAAAC,EACA,KAAAE,EACA,gBAAAE,CAAA,CACD,EACK,CAAA,WAAEK,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,cAAcL,CAAS,EAC9D,CAACM,EAAqBC,CAAQ,EAAIC,EAAAA,mBAAmBtB,CAAe,EACpEuB,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAZ,EACA,eAAAC,CAAA,CACD,EAED,OACEY,OAAC,MAAA,CAAK,GAAGR,EAAY,UAAWS,EAAWX,EAAW,KAAME,EAAW,SAAS,EAC9E,SAAA,CAAAU,MAACC,EAAAA,SAAM,QAASxB,EAAI,iBAAkBW,EAAW,MAC9C,SAAAN,EACH,EACAgB,EAAAA,KAAC,MAAA,CAAI,UAAWV,EAAW,UACzB,SAAA,CAAAY,EAAAA,IAAC,SAAA,CACE,GAAGT,EACH,GAAGE,EACJ,GAAAhB,EACA,UAAWW,EAAW,MACtB,SAAUV,EACV,SAAUG,EACV,IAAAT,EAEC,SAAAE,CAAA,CAAA,EAEH0B,EAAAA,IAAC,MAAA,CAAI,UAAWZ,EAAW,KACzB,SAAAY,EAAAA,IAACE,EAAAA,QAAA,CAAK,KAAK,eAAe,QAASnB,IAASC,EAAAA,MAAM,MAAQ,GAAK,GAAI,CAAA,CACrE,CAAA,EACF,EACAgB,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBf,EAAW,WAC7B,GAAI,GAAGX,CAAE,eACT,aAAciB,EACd,WAAAlB,CAAA,CAAA,EAEDS,GACCe,EAAAA,IAACI,EAAAA,QAAA,CACC,iBAAkBhB,EAAW,eAC5B,GAAIb,GAAqB,CAAE,uBAAwBU,CAAA,EACpD,GAAI,GAAGR,CAAE,mBACT,eAAAS,EACA,aAAcQ,EACd,KAAME,CAAA,CAAA,CACR,EAEJ,CAEJ,EAEMS,EAASC,EAAAA,WAAiDpC,CAAO,EAKvEmC,EAAO,gBAAkB,SACzBA,EAAO,YAAc"}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as m, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
3
|
+
import D from "classnames";
|
|
4
|
+
import { forwardRef as F } from "react";
|
|
5
5
|
import { Sizes as n } from "../../constants/dictionaries.js";
|
|
6
6
|
import { useStyleProps as E } from "../../hooks/styleProps.js";
|
|
7
|
-
import { useAriaDescribedBy as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
const j = (f, S) => {
|
|
7
|
+
import { useAriaDescribedBy as I } from "../../hooks/useAriaIdRefs.js";
|
|
8
|
+
import L from "../Field/HelperText.js";
|
|
9
|
+
import R from "../Field/Label.js";
|
|
10
|
+
import U from "../Field/ValidationText.js";
|
|
11
|
+
import { useValidationTextRole as V } from "../Field/useValidationTextRole.js";
|
|
12
|
+
import g from "../Icon/Icon.js";
|
|
13
|
+
import { useSelectStyleProps as z } from "./useSelectStyleProps.js";
|
|
14
|
+
const B = (f, S) => {
|
|
16
15
|
const {
|
|
17
16
|
"aria-describedby": x = "",
|
|
18
|
-
children:
|
|
19
|
-
hasValidationIcon:
|
|
20
|
-
helperText:
|
|
17
|
+
children: N,
|
|
18
|
+
hasValidationIcon: b,
|
|
19
|
+
helperText: h,
|
|
21
20
|
id: r,
|
|
22
21
|
isDisabled: t,
|
|
23
|
-
isFluid:
|
|
22
|
+
isFluid: u,
|
|
24
23
|
isLabelHidden: T,
|
|
25
24
|
isRequired: o,
|
|
26
25
|
label: v,
|
|
@@ -28,57 +27,57 @@ const j = (f, S) => {
|
|
|
28
27
|
validationState: s,
|
|
29
28
|
validationText: l,
|
|
30
29
|
...y
|
|
31
|
-
} = f, { classProps: e } =
|
|
30
|
+
} = f, { classProps: e } = z({
|
|
32
31
|
isDisabled: t,
|
|
33
|
-
isFluid:
|
|
32
|
+
isFluid: u,
|
|
34
33
|
isLabelHidden: T,
|
|
35
34
|
isRequired: o,
|
|
36
35
|
size: a,
|
|
37
36
|
validationState: s
|
|
38
|
-
}), { styleProps: c, props:
|
|
37
|
+
}), { styleProps: c, props: _ } = E(y), [A, d] = I(x), P = V({
|
|
39
38
|
validationState: s,
|
|
40
39
|
validationText: l
|
|
41
40
|
});
|
|
42
|
-
return /* @__PURE__ */ m("div", { ...c, className:
|
|
43
|
-
/* @__PURE__ */ i(
|
|
41
|
+
return /* @__PURE__ */ m("div", { ...c, className: D(e.root, c.className), children: [
|
|
42
|
+
/* @__PURE__ */ i(R, { htmlFor: r, UNSAFE_className: e.label, children: v }),
|
|
44
43
|
/* @__PURE__ */ m("div", { className: e.container, children: [
|
|
45
44
|
/* @__PURE__ */ i(
|
|
46
45
|
"select",
|
|
47
46
|
{
|
|
47
|
+
..._,
|
|
48
48
|
...A,
|
|
49
|
-
...P,
|
|
50
49
|
id: r,
|
|
51
50
|
className: e.input,
|
|
52
51
|
disabled: t,
|
|
53
52
|
required: o,
|
|
54
53
|
ref: S,
|
|
55
|
-
children:
|
|
54
|
+
children: N
|
|
56
55
|
}
|
|
57
56
|
),
|
|
58
|
-
/* @__PURE__ */ i("div", { className: e.icon, children: /* @__PURE__ */ i(
|
|
57
|
+
/* @__PURE__ */ i("div", { className: e.icon, children: /* @__PURE__ */ i(g, { name: "chevron-down", boxSize: a === n.SMALL ? 16 : 20 }) })
|
|
59
58
|
] }),
|
|
60
59
|
/* @__PURE__ */ i(
|
|
61
|
-
|
|
60
|
+
L,
|
|
62
61
|
{
|
|
63
62
|
UNSAFE_className: e.helperText,
|
|
64
63
|
id: `${r}__helperText`,
|
|
65
64
|
registerAria: d,
|
|
66
|
-
helperText:
|
|
65
|
+
helperText: h
|
|
67
66
|
}
|
|
68
67
|
),
|
|
69
68
|
s && /* @__PURE__ */ i(
|
|
70
|
-
|
|
69
|
+
U,
|
|
71
70
|
{
|
|
72
71
|
UNSAFE_className: e.validationText,
|
|
73
|
-
...
|
|
72
|
+
...b && { hasValidationStateIcon: s },
|
|
74
73
|
id: `${r}__validationText`,
|
|
75
74
|
validationText: l,
|
|
76
75
|
registerAria: d,
|
|
77
|
-
role:
|
|
76
|
+
role: P
|
|
78
77
|
}
|
|
79
78
|
)
|
|
80
79
|
] });
|
|
81
|
-
}, p =
|
|
80
|
+
}, p = F(B);
|
|
82
81
|
p.spiritComponent = "Select";
|
|
83
82
|
p.displayName = "Select";
|
|
84
83
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { Sizes } from '../../constants';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritSelectProps } from '../../types';\nimport { HelperText, Label, ValidationText
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ForwardedRef, forwardRef } from 'react';\nimport { Sizes } from '../../constants';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritSelectProps } from '../../types';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { Icon } from '../Icon';\nimport { useSelectStyleProps } from './useSelectStyleProps';\n\nconst _Select = (props: SpiritSelectProps, ref: ForwardedRef<HTMLSelectElement>) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n children,\n hasValidationIcon,\n helperText,\n id,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n label,\n size = Sizes.MEDIUM,\n validationState,\n validationText,\n ...restProps\n } = props;\n const { classProps } = useSelectStyleProps({\n hasValidationIcon,\n isDisabled,\n isFluid,\n isLabelHidden,\n isRequired,\n size,\n validationState,\n });\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n return (\n <div {...styleProps} className={classNames(classProps.root, styleProps.className)}>\n <Label htmlFor={id} UNSAFE_className={classProps.label}>\n {label}\n </Label>\n <div className={classProps.container}>\n <select\n {...transferProps}\n {...ariaDescribedByProp}\n id={id}\n className={classProps.input}\n disabled={isDisabled}\n required={isRequired}\n ref={ref}\n >\n {children}\n </select>\n <div className={classProps.icon}>\n <Icon name=\"chevron-down\" boxSize={size === Sizes.SMALL ? 16 : 20} />\n </div>\n </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}__validationText`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n )}\n </div>\n );\n};\n\nconst Select = forwardRef<HTMLSelectElement, SpiritSelectProps>(_Select) as ForwardRefComponent<\n HTMLSelectElement,\n SpiritSelectProps\n>;\n\nSelect.spiritComponent = 'Select';\nSelect.displayName = 'Select';\n\nexport default Select;\n"],"names":["_Select","props","ref","ariaDescribedBy","children","hasValidationIcon","helperText","id","isDisabled","isFluid","isLabelHidden","isRequired","label","size","Sizes","validationState","validationText","restProps","classProps","useSelectStyleProps","styleProps","transferProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","jsxs","classNames","jsx","Label","Icon","HelperText","ValidationText","Select","forwardRef"],"mappings":";;;;;;;;;;;;;AAYA,MAAMA,IAAU,CAACC,GAA0BC,MAAyC;AAClF,QAAM;AAAA,IACJ,oBAAoBC,IAAkB;AAAA,IACtC,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC,IAAOC,EAAM;AAAA,IACb,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDhB,GACE,EAAE,YAAAiB,EAAA,IAAeC,EAAoB;AAAA,IAEzC,YAAAX;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,MAAAE;AAAA,IACA,iBAAAE;AAAA,EAAA,CACD,GACK,EAAE,YAAAK,GAAY,OAAOC,EAAA,IAAkBC,EAAcL,CAAS,GAC9D,CAACM,GAAqBC,CAAQ,IAAIC,EAAmBtB,CAAe,GACpEuB,IAAqBC,EAAsB;AAAA,IAC/C,iBAAAZ;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD;AAED,SACE,gBAAAY,EAAC,OAAA,EAAK,GAAGR,GAAY,WAAWS,EAAWX,EAAW,MAAME,EAAW,SAAS,GAC9E,UAAA;AAAA,IAAA,gBAAAU,EAACC,KAAM,SAASxB,GAAI,kBAAkBW,EAAW,OAC9C,UAAAN,GACH;AAAA,IACA,gBAAAgB,EAAC,OAAA,EAAI,WAAWV,EAAW,WACzB,UAAA;AAAA,MAAA,gBAAAY;AAAA,QAAC;AAAA,QAAA;AAAA,UACE,GAAGT;AAAA,UACH,GAAGE;AAAA,UACJ,IAAAhB;AAAA,UACA,WAAWW,EAAW;AAAA,UACtB,UAAUV;AAAA,UACV,UAAUG;AAAA,UACV,KAAAT;AAAA,UAEC,UAAAE;AAAA,QAAA;AAAA,MAAA;AAAA,MAEH,gBAAA0B,EAAC,OAAA,EAAI,WAAWZ,EAAW,MACzB,UAAA,gBAAAY,EAACE,GAAA,EAAK,MAAK,gBAAe,SAASnB,MAASC,EAAM,QAAQ,KAAK,IAAI,EAAA,CACrE;AAAA,IAAA,GACF;AAAA,IACA,gBAAAgB;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,kBAAkBf,EAAW;AAAA,QAC7B,IAAI,GAAGX,CAAE;AAAA,QACT,cAAciB;AAAA,QACd,YAAAlB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDS,KACC,gBAAAe;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,kBAAkBhB,EAAW;AAAA,QAC5B,GAAIb,KAAqB,EAAE,wBAAwBU,EAAA;AAAA,QACpD,IAAI,GAAGR,CAAE;AAAA,QACT,gBAAAS;AAAA,QACA,cAAcQ;AAAA,QACd,MAAME;AAAA,MAAA;AAAA,IAAA;AAAA,EACR,GAEJ;AAEJ,GAEMS,IAASC,EAAiDpC,CAAO;AAKvEmC,EAAO,kBAAkB;AACzBA,EAAO,cAAc;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),V=require("classnames"),I=require("react"),E=require("../../hooks/styleProps.cjs"),F=require("../../hooks/useAriaIdRefs.cjs"),$=require("../Field/HelperText.cjs"),U=require("../Field/Label.cjs"),B=require("../Field/ValidationText.cjs"),L=require("../Field/useValidationTextRole.cjs"),M=require("./constants.cjs"),C=require("./useSliderStyleProps.cjs"),O={...M.SLIDER_DEFAULT_PROPS},w=(m,y)=>{const b={...O,...m},{"aria-describedby":T,hasValidationIcon:h,helperText:N,id:t,isDisabled:l,label:_,max:n,min:i,step:f,validationState:r,validationText:c,value:d,...q}=b,{classProps:e,props:v}=C.useSliderStyleProps({...q,isDisabled:l,validationState:r}),{styleProps:u,props:R}=E.useStyleProps(v),[g,p]=F.useAriaDescribedBy(T),A=L.useValidationTextRole({validationState:r,validationText:c}),S="--slider-position",x=a=>`${Math.round(100*(a-i)/(n-i))}%`,j=a=>{const{target:P}=a,{value:D}=P;P.style.setProperty(S,x(Number(D)))};return s.jsxs("div",{...u,...R,className:V(e.root,u.className),children:[s.jsx(U.default,{htmlFor:t,UNSAFE_className:e.label,children:_}),s.jsx("input",{...g,className:e.input,id:t,onInput:j,style:{[S]:`${x(d)}`},type:"range",min:i,max:n,step:f,value:d,disabled:l,ref:y}),s.jsx($.default,{UNSAFE_className:e.helperText,helperText:N,id:`${t}__helperText`,registerAria:p}),r&&s.jsx(B.default,{UNSAFE_className:e.validationText,...h&&{hasValidationStateIcon:r},id:`${t}__validationText`,registerAria:p,validationText:c,role:A})]})},o=I.forwardRef(w);o.spiritComponent="Slider";o.displayName="Slider";exports.default=o;
|
|
2
2
|
//# sourceMappingURL=Slider.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.cjs","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type CSSProperties, type ChangeEvent, type FormEvent, type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritSliderProps } from '../../types';\nimport { HelperText, Label, ValidationText
|
|
1
|
+
{"version":3,"file":"Slider.cjs","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type CSSProperties, type ChangeEvent, type FormEvent, type ForwardedRef, forwardRef } from 'react';\nimport { useAriaDescribedBy, useStyleProps } from '../../hooks';\nimport { type ForwardRefComponent, type SpiritSliderProps } from '../../types';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { SLIDER_DEFAULT_PROPS } from './constants';\nimport { useSliderStyleProps } from './useSliderStyleProps';\n\nconst defaultProps = {\n ...SLIDER_DEFAULT_PROPS,\n};\n\nconst _Slider = (props: SpiritSliderProps, ref: ForwardedRef<HTMLInputElement>) => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const {\n 'aria-describedby': ariaDescribedBy,\n hasValidationIcon,\n helperText,\n id,\n isDisabled,\n label,\n max,\n min,\n step,\n validationState,\n validationText,\n value,\n ...restProps\n } = propsWithDefaults;\n\n const { classProps, props: modifiedProps } = useSliderStyleProps({\n ...restProps,\n isDisabled,\n validationState,\n });\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const [ariaDescribedByProp, register] = useAriaDescribedBy(ariaDescribedBy);\n const validationTextRole = useValidationTextRole({\n validationState,\n validationText,\n });\n\n const CSSVariable = '--slider-position';\n\n const getSliderPosition = (num: number) => `${Math.round((100 * (num - min)) / (max - min))}%`;\n\n const handleInput = (event: FormEvent<HTMLInputElement>) => {\n const { target } = event as ChangeEvent<HTMLInputElement>;\n const { value: inputValue } = target;\n\n target.style.setProperty(CSSVariable, getSliderPosition(Number(inputValue)));\n };\n\n return (\n <div {...styleProps} {...otherProps} className={classNames(classProps.root, styleProps.className)}>\n <Label htmlFor={id} UNSAFE_className={classProps.label}>\n {label}\n </Label>\n <input\n {...ariaDescribedByProp}\n className={classProps.input}\n id={id}\n onInput={handleInput}\n style={{ [CSSVariable]: `${getSliderPosition(value)}` } as CSSProperties}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={value}\n disabled={isDisabled}\n ref={ref}\n />\n <HelperText\n UNSAFE_className={classProps.helperText}\n helperText={helperText}\n id={`${id}__helperText`}\n registerAria={register}\n />\n {validationState && (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__validationText`}\n registerAria={register}\n validationText={validationText}\n role={validationTextRole}\n />\n )}\n </div>\n );\n};\n\nconst Slider = forwardRef<HTMLInputElement, SpiritSliderProps>(_Slider) as ForwardRefComponent<\n HTMLInputElement,\n SpiritSliderProps\n>;\n\nSlider.spiritComponent = 'Slider';\nSlider.displayName = 'Slider';\n\nexport default Slider;\n"],"names":["defaultProps","SLIDER_DEFAULT_PROPS","_Slider","props","ref","propsWithDefaults","ariaDescribedBy","hasValidationIcon","helperText","id","isDisabled","label","max","min","step","validationState","validationText","value","restProps","classProps","modifiedProps","useSliderStyleProps","styleProps","otherProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","CSSVariable","getSliderPosition","num","handleInput","event","target","inputValue","jsxs","classNames","jsx","Label","HelperText","ValidationText","Slider","forwardRef"],"mappings":"8fAWMA,EAAe,CACnB,GAAGC,EAAAA,oBACL,EAEMC,EAAU,CAACC,EAA0BC,IAAwC,CACjF,MAAMC,EAAoB,CAAE,GAAGL,EAAc,GAAGG,CAAA,EAC1C,CACJ,mBAAoBG,EACpB,kBAAAC,EACA,WAAAC,EACA,GAAAC,EACA,WAAAC,EACA,MAAAC,EACA,IAAAC,EACA,IAAAC,EACA,KAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,MAAAC,EACA,GAAGC,CAAA,EACDb,EAEE,CAAE,WAAAc,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,oBAAoB,CAC/D,GAAGH,EACH,WAAAR,EACA,gBAAAK,CAAA,CACD,EACK,CAAA,WAAEO,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcJ,CAAa,EAC/D,CAACK,EAAqBC,CAAQ,EAAIC,EAAAA,mBAAmBrB,CAAe,EACpEsB,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAd,EACA,eAAAC,CAAA,CACD,EAEKc,EAAc,oBAEdC,EAAqBC,GAAgB,GAAG,KAAK,MAAO,KAAOA,EAAMnB,IAASD,EAAMC,EAAI,CAAC,IAErFoB,EAAeC,GAAuC,CAC1D,KAAM,CAAE,OAAAC,GAAWD,EACb,CAAE,MAAOE,CAAA,EAAeD,EAE9BA,EAAO,MAAM,YAAYL,EAAaC,EAAkB,OAAOK,CAAU,CAAC,CAAC,CAC7E,EAEA,OACEC,EAAAA,KAAC,MAAA,CAAK,GAAGf,EAAa,GAAGC,EAAY,UAAWe,EAAWnB,EAAW,KAAMG,EAAW,SAAS,EAC9F,SAAA,CAAAiB,MAACC,EAAAA,SAAM,QAAS/B,EAAI,iBAAkBU,EAAW,MAC9C,SAAAR,EACH,EACA4B,EAAAA,IAAC,QAAA,CACE,GAAGd,EACJ,UAAWN,EAAW,MACtB,GAAAV,EACA,QAASwB,EACT,MAAO,CAAE,CAACH,CAAW,EAAG,GAAGC,EAAkBd,CAAK,CAAC,EAAA,EACnD,KAAK,QACL,IAAAJ,EACA,IAAAD,EACA,KAAAE,EACA,MAAAG,EACA,SAAUP,EACV,IAAAN,CAAA,CAAA,EAEFmC,EAAAA,IAACE,EAAAA,QAAA,CACC,iBAAkBtB,EAAW,WAC7B,WAAAX,EACA,GAAI,GAAGC,CAAE,eACT,aAAciB,CAAA,CAAA,EAEfX,GACCwB,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBvB,EAAW,eAC5B,GAAIZ,GAAqB,CAAE,uBAAwBQ,CAAA,EACpD,GAAI,GAAGN,CAAE,mBACT,aAAciB,EACd,eAAAV,EACA,KAAMY,CAAA,CAAA,CACR,EAEJ,CAEJ,EAEMe,EAASC,EAAAA,WAAgD1C,CAAO,EAKtEyC,EAAO,gBAAkB,SACzBA,EAAO,YAAc"}
|