@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,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 n=require("react/jsx-runtime"),q=require("react"),x=require("../../context/PropsContext.cjs"),g=require("../../hooks/styleProps.cjs"),b=require("../../utils/mergeStyleProps.cjs"),C=require("../Spinner/Spinner.cjs"),h=require("./useButtonProps.cjs"),j=require("./useButtonStyleProps.cjs"),p={color:"primary",isBlock:!1,isDisabled:!1,isLoading:!1,isSymmetrical:!1,size:"medium",type:"button",elementType:"button"},_=(s,l)=>{const{elementType:u}=s,i=x.useContextProps(s),{elementType:c,children:m,...y}=i,P=u??c??p.elementType,a={...p,...y},{elementType:R,...e}=a,o=P,{buttonProps:d}=h.useButtonProps(e),{classProps:f,props:S}=j.useButtonStyleProps(e),{styleProps:T,props:r}=g.useStyleProps(S),B=b.mergeStyleProps(o,{classProps:f,styleProps:T,otherProps:r});return n.jsxs(o,{...r,...d,ref:l,...B,children:[m,e.isLoading&&n.jsx(C.default,{})]})},t=q.forwardRef(_);t.spiritComponent="Button";t.displayName="Button";exports.default=t;
|
|
2
2
|
//# sourceMappingURL=Button.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useContextProps } from '../../context';\nimport { useStyleProps } from '../../hooks';\nimport { type ButtonProps, type PolymorphicComponent, type PolymorphicRef, type SpiritButtonProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { Spinner } from '../Spinner';\nimport { useButtonProps } from './useButtonProps';\nimport { useButtonStyleProps } from './useButtonStyleProps';\n\nconst defaultProps = {\n color: 'primary',\n /**\n * @deprecated \"isBlock\" property will be removed in the next major version. Please read component's README for more information.\n * @see https://jira.almacareer.tech/browse/DS-1897\n */\n isBlock: false,\n isDisabled: false,\n isLoading: false,\n isSymmetrical: false,\n size: 'medium',\n type: 'button',\n elementType: 'button',\n};\n\nconst _Button = <E extends ElementType = 'button', C = void, S = void>(\n props: SpiritButtonProps<E, C, S>,\n ref: PolymorphicRef<E>,\n) => {\n const
|
|
1
|
+
{"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useContextProps } from '../../context';\nimport { useStyleProps } from '../../hooks';\nimport { type ButtonProps, type PolymorphicComponent, type PolymorphicRef, type SpiritButtonProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { Spinner } from '../Spinner';\nimport { useButtonProps } from './useButtonProps';\nimport { useButtonStyleProps } from './useButtonStyleProps';\n\nconst defaultProps = {\n color: 'primary',\n /**\n * @deprecated \"isBlock\" property will be removed in the next major version. Please read component's README for more information.\n * @see https://jira.almacareer.tech/browse/DS-1897\n */\n isBlock: false,\n isDisabled: false,\n isLoading: false,\n isSymmetrical: false,\n size: 'medium',\n type: 'button',\n elementType: 'button',\n};\n\nconst _Button = <E extends ElementType = 'button', C = void, S = void>(\n props: SpiritButtonProps<E, C, S>,\n ref: PolymorphicRef<E>,\n) => {\n const { elementType: propsElementType } = props;\n const contextProps = useContextProps(props);\n const { elementType: contextElementType, children, ...restFromContext } = contextProps;\n const elementType = (propsElementType ?? contextElementType ?? defaultProps.elementType) as ElementType;\n const propsWithDefaults = { ...defaultProps, ...restFromContext };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- `elementType` must be omitted from `restProps`: the root tag is chosen by the polymorphic `elementType` resolved above (explicit prop, then Stack context, then default). The duplicate key from `defaultProps` inside `propsWithDefaults` is only peeled off so it is not passed to hooks or the DOM.\n const { elementType: _elementType, ...restProps } = propsWithDefaults;\n const Component = elementType as ElementType;\n\n const { buttonProps } = useButtonProps(restProps);\n const { classProps, props: modifiedProps } = useButtonStyleProps(restProps);\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps, styleProps, otherProps });\n\n return (\n <Component {...otherProps} {...buttonProps} ref={ref} {...mergedStyleProps}>\n {children}\n {restProps.isLoading && <Spinner />}\n </Component>\n );\n};\n\nconst Button = forwardRef<HTMLButtonElement, SpiritButtonProps<'button', void, void>>(\n _Button,\n) as unknown as PolymorphicComponent<'button', ButtonProps<void, void>>;\n\nButton.spiritComponent = 'Button';\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["defaultProps","_Button","props","ref","propsElementType","contextProps","useContextProps","contextElementType","children","restFromContext","elementType","propsWithDefaults","_elementType","restProps","Component","buttonProps","useButtonProps","classProps","modifiedProps","useButtonStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","jsxs","jsx","Spinner","Button","forwardRef"],"mappings":"+ZAWMA,EAAe,CACnB,MAAO,UAKP,QAAS,GACT,WAAY,GACZ,UAAW,GACX,cAAe,GACf,KAAM,SACN,KAAM,SACN,YAAa,QACf,EAEMC,EAAU,CACdC,EACAC,IACG,CACH,KAAM,CAAE,YAAaC,CAAA,EAAqBF,EACpCG,EAAeC,EAAAA,gBAAgBJ,CAAK,EACpC,CAAE,YAAaK,EAAoB,SAAAC,EAAU,GAAGC,GAAoBJ,EACpEK,EAAeN,GAAoBG,GAAsBP,EAAa,YACtEW,EAAoB,CAAE,GAAGX,EAAc,GAAGS,CAAA,EAE1C,CAAE,YAAaG,EAAc,GAAGC,GAAcF,EAC9CG,EAAYJ,EAEZ,CAAE,YAAAK,CAAA,EAAgBC,EAAAA,eAAeH,CAAS,EAC1C,CAAE,WAAAI,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,oBAAoBN,CAAS,EACpE,CAAA,WAAEO,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcJ,CAAa,EAC/DK,EAAmBC,EAAAA,gBAAgBV,EAAW,CAAE,WAAAG,EAAA,WAAYG,EAAY,WAAAC,EAAY,EAE1F,OACEI,EAAAA,KAACX,GAAW,GAAGO,EAAa,GAAGN,EAAa,IAAAZ,EAAW,GAAGoB,EACvD,SAAA,CAAAf,EACAK,EAAU,WAAaa,MAACC,EAAAA,QAAA,CAAA,CAAQ,CAAA,EACnC,CAEJ,EAEMC,EAASC,EAAAA,WACb5B,CACF,EAEA2B,EAAO,gBAAkB,SACzBA,EAAO,YAAc"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useContextProps as
|
|
5
|
-
import { useStyleProps as
|
|
6
|
-
import { mergeStyleProps as
|
|
7
|
-
import
|
|
8
|
-
import { useButtonProps as
|
|
9
|
-
import { useButtonStyleProps as
|
|
10
|
-
const
|
|
2
|
+
import { jsxs as B, jsx as S } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as b } from "react";
|
|
4
|
+
import { useContextProps as g } from "../../context/PropsContext.js";
|
|
5
|
+
import { useStyleProps as h } from "../../hooks/styleProps.js";
|
|
6
|
+
import { mergeStyleProps as C } from "../../utils/mergeStyleProps.js";
|
|
7
|
+
import j from "../Spinner/Spinner.js";
|
|
8
|
+
import { useButtonProps as D } from "./useButtonProps.js";
|
|
9
|
+
import { useButtonStyleProps as E } from "./useButtonStyleProps.js";
|
|
10
|
+
const r = {
|
|
11
11
|
color: "primary",
|
|
12
12
|
/**
|
|
13
13
|
* @deprecated "isBlock" property will be removed in the next major version. Please read component's README for more information.
|
|
@@ -20,18 +20,18 @@ const e = {
|
|
|
20
20
|
size: "medium",
|
|
21
21
|
type: "button",
|
|
22
22
|
elementType: "button"
|
|
23
|
-
},
|
|
24
|
-
const i =
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
}, L = (t, p) => {
|
|
24
|
+
const { elementType: m } = t, i = g(t), { elementType: l, children: c, ...u } = i, f = m ?? l ?? r.elementType, y = { ...r, ...u }, { elementType: _, ...e } = y, o = f, { buttonProps: a } = D(e), { classProps: P, props: d } = E(e), { styleProps: T, props: s } = h(d), x = C(o, { classProps: P, styleProps: T, otherProps: s });
|
|
25
|
+
return /* @__PURE__ */ B(o, { ...s, ...a, ref: p, ...x, children: [
|
|
26
|
+
c,
|
|
27
|
+
e.isLoading && /* @__PURE__ */ S(j, {})
|
|
28
28
|
] });
|
|
29
|
-
},
|
|
30
|
-
|
|
29
|
+
}, n = b(
|
|
30
|
+
L
|
|
31
31
|
);
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
n.spiritComponent = "Button";
|
|
33
|
+
n.displayName = "Button";
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
n as default
|
|
36
36
|
};
|
|
37
37
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useContextProps } from '../../context';\nimport { useStyleProps } from '../../hooks';\nimport { type ButtonProps, type PolymorphicComponent, type PolymorphicRef, type SpiritButtonProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { Spinner } from '../Spinner';\nimport { useButtonProps } from './useButtonProps';\nimport { useButtonStyleProps } from './useButtonStyleProps';\n\nconst defaultProps = {\n color: 'primary',\n /**\n * @deprecated \"isBlock\" property will be removed in the next major version. Please read component's README for more information.\n * @see https://jira.almacareer.tech/browse/DS-1897\n */\n isBlock: false,\n isDisabled: false,\n isLoading: false,\n isSymmetrical: false,\n size: 'medium',\n type: 'button',\n elementType: 'button',\n};\n\nconst _Button = <E extends ElementType = 'button', C = void, S = void>(\n props: SpiritButtonProps<E, C, S>,\n ref: PolymorphicRef<E>,\n) => {\n const
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useContextProps } from '../../context';\nimport { useStyleProps } from '../../hooks';\nimport { type ButtonProps, type PolymorphicComponent, type PolymorphicRef, type SpiritButtonProps } from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { Spinner } from '../Spinner';\nimport { useButtonProps } from './useButtonProps';\nimport { useButtonStyleProps } from './useButtonStyleProps';\n\nconst defaultProps = {\n color: 'primary',\n /**\n * @deprecated \"isBlock\" property will be removed in the next major version. Please read component's README for more information.\n * @see https://jira.almacareer.tech/browse/DS-1897\n */\n isBlock: false,\n isDisabled: false,\n isLoading: false,\n isSymmetrical: false,\n size: 'medium',\n type: 'button',\n elementType: 'button',\n};\n\nconst _Button = <E extends ElementType = 'button', C = void, S = void>(\n props: SpiritButtonProps<E, C, S>,\n ref: PolymorphicRef<E>,\n) => {\n const { elementType: propsElementType } = props;\n const contextProps = useContextProps(props);\n const { elementType: contextElementType, children, ...restFromContext } = contextProps;\n const elementType = (propsElementType ?? contextElementType ?? defaultProps.elementType) as ElementType;\n const propsWithDefaults = { ...defaultProps, ...restFromContext };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- `elementType` must be omitted from `restProps`: the root tag is chosen by the polymorphic `elementType` resolved above (explicit prop, then Stack context, then default). The duplicate key from `defaultProps` inside `propsWithDefaults` is only peeled off so it is not passed to hooks or the DOM.\n const { elementType: _elementType, ...restProps } = propsWithDefaults;\n const Component = elementType as ElementType;\n\n const { buttonProps } = useButtonProps(restProps);\n const { classProps, props: modifiedProps } = useButtonStyleProps(restProps);\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps, styleProps, otherProps });\n\n return (\n <Component {...otherProps} {...buttonProps} ref={ref} {...mergedStyleProps}>\n {children}\n {restProps.isLoading && <Spinner />}\n </Component>\n );\n};\n\nconst Button = forwardRef<HTMLButtonElement, SpiritButtonProps<'button', void, void>>(\n _Button,\n) as unknown as PolymorphicComponent<'button', ButtonProps<void, void>>;\n\nButton.spiritComponent = 'Button';\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["defaultProps","_Button","props","ref","propsElementType","contextProps","useContextProps","contextElementType","children","restFromContext","elementType","propsWithDefaults","_elementType","restProps","Component","buttonProps","useButtonProps","classProps","modifiedProps","useButtonStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","jsxs","jsx","Spinner","Button","forwardRef"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAe;AAAA,EACnB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKP,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,eAAe;AAAA,EACf,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AACf,GAEMC,IAAU,CACdC,GACAC,MACG;AACH,QAAM,EAAE,aAAaC,EAAA,IAAqBF,GACpCG,IAAeC,EAAgBJ,CAAK,GACpC,EAAE,aAAaK,GAAoB,UAAAC,GAAU,GAAGC,MAAoBJ,GACpEK,IAAeN,KAAoBG,KAAsBP,EAAa,aACtEW,IAAoB,EAAE,GAAGX,GAAc,GAAGS,EAAA,GAE1C,EAAE,aAAaG,GAAc,GAAGC,MAAcF,GAC9CG,IAAYJ,GAEZ,EAAE,aAAAK,EAAA,IAAgBC,EAAeH,CAAS,GAC1C,EAAE,YAAAI,GAAY,OAAOC,EAAA,IAAkBC,EAAoBN,CAAS,GACpE,EAAE,YAAAO,GAAY,OAAOC,EAAA,IAAeC,EAAcJ,CAAa,GAC/DK,IAAmBC,EAAgBV,GAAW,EAAE,YAAAG,GAAY,YAAAG,GAAY,YAAAC,GAAY;AAE1F,SACE,gBAAAI,EAACX,KAAW,GAAGO,GAAa,GAAGN,GAAa,KAAAZ,GAAW,GAAGoB,GACvD,UAAA;AAAA,IAAAf;AAAA,IACAK,EAAU,aAAa,gBAAAa,EAACC,GAAA,CAAA,CAAQ;AAAA,EAAA,GACnC;AAEJ,GAEMC,IAASC;AAAA,EACb5B;AACF;AAEA2B,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
|
|
1
|
+
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react/jsx-runtime"),f=require("react"),S=require("../../hooks/styleProps.cjs"),B=require("../../hooks/useLinkClick.cjs"),q=require("../../utils/mergeStyleProps.cjs"),C=require("../Spinner/Spinner.cjs"),g=require("./useButtonLinkProps.cjs"),h=require("./useButtonLinkStyleProps.cjs"),l={color:"primary",elementType:"a",isBlock:!1,isDisabled:!1,isLoading:!1,isSymmetrical:!1,size:"medium"},b=(u,c)=>{const t={...l,...u},{elementType:p=l.elementType,children:a,routerOptions:P,...e}=t,o=p,{buttonLinkProps:n}=g.useButtonLinkProps(t),{classProps:d,props:k}=h.useButtonLinkStyleProps(e),{styleProps:m,props:r}=S.useStyleProps(k),y=q.mergeStyleProps(o,{classProps:d,styleProps:m,otherProps:r}),L=B.useLinkClick({...e,routerOptions:P,onClick:n.onClick});return i.jsxs(o,{...r,...n,...y,onClick:L,ref:c,children:[a,e.isLoading&&i.jsx(C.default,{})]})},s=f.forwardRef(b);s.spiritComponent="ButtonLink";s.displayName="ButtonLink";exports.default=s;
|
|
2
2
|
//# sourceMappingURL=ButtonLink.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonLink.cjs","sources":["../../../src/components/ButtonLink/ButtonLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useStyleProps } from '../../hooks';\nimport {\n type ButtonProps,\n type ButtonSizesType,\n type PolymorphicComponent,\n type PolymorphicRef,\n type SpiritButtonLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { Spinner } from '../Spinner';\nimport { useButtonLinkProps } from './useButtonLinkProps';\nimport { useButtonLinkStyleProps } from './useButtonLinkStyleProps';\n\nconst defaultProps = {\n color: 'primary',\n elementType: 'a',\n /**\n * @deprecated \"isBlock\" property will be removed in the next major version. Please read component's README for more information.\n * @see https://jira.almacareer.tech/browse/DS-1897\n */\n isBlock: false,\n isDisabled: false,\n isLoading: false,\n isSymmetrical: false,\n size: 'medium' as ButtonSizesType,\n};\n\nconst _ButtonLink = <E extends ElementType = 'a', C = void, S = void>(\n props: SpiritButtonLinkProps<E, C, S>,\n ref: PolymorphicRef<E>,\n) => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = defaultProps.elementType, children, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { buttonLinkProps } = useButtonLinkProps(propsWithDefaults);\n const { classProps, props: modifiedProps } = useButtonLinkStyleProps(restProps);\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps, styleProps, otherProps });\n\n return (\n <Component {...otherProps} {...buttonLinkProps} {...mergedStyleProps} ref={ref}>\n {children}\n {restProps.isLoading && <Spinner />}\n </Component>\n );\n};\n\nconst ButtonLink = forwardRef<HTMLAnchorElement, SpiritButtonLinkProps<'a', void, void>>(\n _ButtonLink,\n) as unknown as PolymorphicComponent<'a', Omit<ButtonProps<void, void>, 'type'
|
|
1
|
+
{"version":3,"file":"ButtonLink.cjs","sources":["../../../src/components/ButtonLink/ButtonLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useLinkClick, useStyleProps } from '../../hooks';\nimport {\n type ButtonProps,\n type ButtonSizesType,\n type PolymorphicComponent,\n type PolymorphicRef,\n type RouterLinkProps,\n type SpiritButtonLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { Spinner } from '../Spinner';\nimport { useButtonLinkProps } from './useButtonLinkProps';\nimport { useButtonLinkStyleProps } from './useButtonLinkStyleProps';\n\nconst defaultProps = {\n color: 'primary',\n elementType: 'a',\n /**\n * @deprecated \"isBlock\" property will be removed in the next major version. Please read component's README for more information.\n * @see https://jira.almacareer.tech/browse/DS-1897\n */\n isBlock: false,\n isDisabled: false,\n isLoading: false,\n isSymmetrical: false,\n size: 'medium' as ButtonSizesType,\n};\n\nconst _ButtonLink = <E extends ElementType = 'a', C = void, S = void>(\n props: SpiritButtonLinkProps<E, C, S>,\n ref: PolymorphicRef<E>,\n) => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = defaultProps.elementType, children, routerOptions, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { buttonLinkProps } = useButtonLinkProps(propsWithDefaults);\n const { classProps, props: modifiedProps } = useButtonLinkStyleProps(restProps);\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps, styleProps, otherProps });\n\n const handleClick = useLinkClick({\n ...restProps,\n routerOptions,\n onClick: buttonLinkProps.onClick,\n });\n\n return (\n <Component {...otherProps} {...buttonLinkProps} {...mergedStyleProps} onClick={handleClick} ref={ref}>\n {children}\n {restProps.isLoading && <Spinner />}\n </Component>\n );\n};\n\nconst ButtonLink = forwardRef<HTMLAnchorElement, SpiritButtonLinkProps<'a', void, void>>(\n _ButtonLink,\n) as unknown as PolymorphicComponent<'a', Omit<ButtonProps<void, void>, 'type'> & RouterLinkProps>;\n\nButtonLink.spiritComponent = 'ButtonLink';\nButtonLink.displayName = 'ButtonLink';\n\nexport default ButtonLink;\n"],"names":["defaultProps","_ButtonLink","props","ref","propsWithDefaults","elementType","children","routerOptions","restProps","Component","buttonLinkProps","useButtonLinkProps","classProps","modifiedProps","useButtonLinkStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","handleClick","useLinkClick","jsxs","jsx","Spinner","ButtonLink","forwardRef"],"mappings":"qaAiBMA,EAAe,CACnB,MAAO,UACP,YAAa,IAKb,QAAS,GACT,WAAY,GACZ,UAAW,GACX,cAAe,GACf,KAAM,QACR,EAEMC,EAAc,CAClBC,EACAC,IACG,CACH,MAAMC,EAAoB,CAAE,GAAGJ,EAAc,GAAGE,CAAA,EAC1C,CAAE,YAAAG,EAAcL,EAAa,YAAa,SAAAM,EAAU,cAAAC,EAAe,GAAGC,GAAcJ,EAEpFK,EAAYJ,EAEZ,CAAE,gBAAAK,CAAA,EAAoBC,EAAAA,mBAAmBP,CAAiB,EAC1D,CAAE,WAAAQ,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,wBAAwBN,CAAS,EACxE,CAAA,WAAEO,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcJ,CAAa,EAC/DK,EAAmBC,EAAAA,gBAAgBV,EAAW,CAAE,WAAAG,EAAA,WAAYG,EAAY,WAAAC,EAAY,EAEpFI,EAAcC,EAAAA,aAAa,CAC/B,GAAGb,EACH,cAAAD,EACA,QAASG,EAAgB,OAAA,CAC1B,EAED,OACEY,OAACb,EAAA,CAAW,GAAGO,EAAa,GAAGN,EAAkB,GAAGQ,EAAkB,QAASE,EAAa,IAAAjB,EACzF,SAAA,CAAAG,EACAE,EAAU,WAAae,MAACC,EAAAA,QAAA,CAAA,CAAQ,CAAA,EACnC,CAEJ,EAEMC,EAAaC,EAAAA,WACjBzB,CACF,EAEAwB,EAAW,gBAAkB,aAC7BA,EAAW,YAAc"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ButtonProps, PolymorphicComponent } from '../../types';
|
|
2
|
-
declare const ButtonLink: PolymorphicComponent<"a", Omit<ButtonProps<void, void>, "type"
|
|
1
|
+
import { ButtonProps, PolymorphicComponent, RouterLinkProps } from '../../types';
|
|
2
|
+
declare const ButtonLink: PolymorphicComponent<"a", Omit<ButtonProps<void, void>, "type"> & RouterLinkProps>;
|
|
3
3
|
export default ButtonLink;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useStyleProps as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
2
|
+
import { jsxs as y, jsx as L } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as B } from "react";
|
|
4
|
+
import { useStyleProps as C } from "../../hooks/styleProps.js";
|
|
5
|
+
import { useLinkClick as S } from "../../hooks/useLinkClick.js";
|
|
6
|
+
import { mergeStyleProps as h } from "../../utils/mergeStyleProps.js";
|
|
7
|
+
import g from "../Spinner/Spinner.js";
|
|
8
|
+
import { useButtonLinkProps as x } from "./useButtonLinkProps.js";
|
|
9
|
+
import { useButtonLinkStyleProps as T } from "./useButtonLinkStyleProps.js";
|
|
10
|
+
const n = {
|
|
10
11
|
color: "primary",
|
|
11
12
|
elementType: "a",
|
|
12
13
|
/**
|
|
@@ -18,18 +19,22 @@ const r = {
|
|
|
18
19
|
isLoading: !1,
|
|
19
20
|
isSymmetrical: !1,
|
|
20
21
|
size: "medium"
|
|
21
|
-
},
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
}, b = (p, l) => {
|
|
23
|
+
const t = { ...n, ...p }, { elementType: m = n.elementType, children: c, routerOptions: a, ...o } = t, s = m, { buttonLinkProps: e } = x(t), { classProps: u, props: f } = T(o), { styleProps: d, props: r } = C(f), k = h(s, { classProps: u, styleProps: d, otherProps: r }), P = S({
|
|
24
|
+
...o,
|
|
25
|
+
routerOptions: a,
|
|
26
|
+
onClick: e.onClick
|
|
27
|
+
});
|
|
28
|
+
return /* @__PURE__ */ y(s, { ...r, ...e, ...k, onClick: P, ref: l, children: [
|
|
29
|
+
c,
|
|
30
|
+
o.isLoading && /* @__PURE__ */ L(g, {})
|
|
26
31
|
] });
|
|
27
|
-
},
|
|
28
|
-
|
|
32
|
+
}, i = B(
|
|
33
|
+
b
|
|
29
34
|
);
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
i.spiritComponent = "ButtonLink";
|
|
36
|
+
i.displayName = "ButtonLink";
|
|
32
37
|
export {
|
|
33
|
-
|
|
38
|
+
i as default
|
|
34
39
|
};
|
|
35
40
|
//# sourceMappingURL=ButtonLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonLink.js","sources":["../../../src/components/ButtonLink/ButtonLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useStyleProps } from '../../hooks';\nimport {\n type ButtonProps,\n type ButtonSizesType,\n type PolymorphicComponent,\n type PolymorphicRef,\n type SpiritButtonLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { Spinner } from '../Spinner';\nimport { useButtonLinkProps } from './useButtonLinkProps';\nimport { useButtonLinkStyleProps } from './useButtonLinkStyleProps';\n\nconst defaultProps = {\n color: 'primary',\n elementType: 'a',\n /**\n * @deprecated \"isBlock\" property will be removed in the next major version. Please read component's README for more information.\n * @see https://jira.almacareer.tech/browse/DS-1897\n */\n isBlock: false,\n isDisabled: false,\n isLoading: false,\n isSymmetrical: false,\n size: 'medium' as ButtonSizesType,\n};\n\nconst _ButtonLink = <E extends ElementType = 'a', C = void, S = void>(\n props: SpiritButtonLinkProps<E, C, S>,\n ref: PolymorphicRef<E>,\n) => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = defaultProps.elementType, children, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { buttonLinkProps } = useButtonLinkProps(propsWithDefaults);\n const { classProps, props: modifiedProps } = useButtonLinkStyleProps(restProps);\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps, styleProps, otherProps });\n\n return (\n <Component {...otherProps} {...buttonLinkProps} {...mergedStyleProps} ref={ref}>\n {children}\n {restProps.isLoading && <Spinner />}\n </Component>\n );\n};\n\nconst ButtonLink = forwardRef<HTMLAnchorElement, SpiritButtonLinkProps<'a', void, void>>(\n _ButtonLink,\n) as unknown as PolymorphicComponent<'a', Omit<ButtonProps<void, void>, 'type'
|
|
1
|
+
{"version":3,"file":"ButtonLink.js","sources":["../../../src/components/ButtonLink/ButtonLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useLinkClick, useStyleProps } from '../../hooks';\nimport {\n type ButtonProps,\n type ButtonSizesType,\n type PolymorphicComponent,\n type PolymorphicRef,\n type RouterLinkProps,\n type SpiritButtonLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { Spinner } from '../Spinner';\nimport { useButtonLinkProps } from './useButtonLinkProps';\nimport { useButtonLinkStyleProps } from './useButtonLinkStyleProps';\n\nconst defaultProps = {\n color: 'primary',\n elementType: 'a',\n /**\n * @deprecated \"isBlock\" property will be removed in the next major version. Please read component's README for more information.\n * @see https://jira.almacareer.tech/browse/DS-1897\n */\n isBlock: false,\n isDisabled: false,\n isLoading: false,\n isSymmetrical: false,\n size: 'medium' as ButtonSizesType,\n};\n\nconst _ButtonLink = <E extends ElementType = 'a', C = void, S = void>(\n props: SpiritButtonLinkProps<E, C, S>,\n ref: PolymorphicRef<E>,\n) => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = defaultProps.elementType, children, routerOptions, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { buttonLinkProps } = useButtonLinkProps(propsWithDefaults);\n const { classProps, props: modifiedProps } = useButtonLinkStyleProps(restProps);\n const { styleProps, props: otherProps } = useStyleProps(modifiedProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps, styleProps, otherProps });\n\n const handleClick = useLinkClick({\n ...restProps,\n routerOptions,\n onClick: buttonLinkProps.onClick,\n });\n\n return (\n <Component {...otherProps} {...buttonLinkProps} {...mergedStyleProps} onClick={handleClick} ref={ref}>\n {children}\n {restProps.isLoading && <Spinner />}\n </Component>\n );\n};\n\nconst ButtonLink = forwardRef<HTMLAnchorElement, SpiritButtonLinkProps<'a', void, void>>(\n _ButtonLink,\n) as unknown as PolymorphicComponent<'a', Omit<ButtonProps<void, void>, 'type'> & RouterLinkProps>;\n\nButtonLink.spiritComponent = 'ButtonLink';\nButtonLink.displayName = 'ButtonLink';\n\nexport default ButtonLink;\n"],"names":["defaultProps","_ButtonLink","props","ref","propsWithDefaults","elementType","children","routerOptions","restProps","Component","buttonLinkProps","useButtonLinkProps","classProps","modifiedProps","useButtonLinkStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","handleClick","useLinkClick","jsxs","jsx","Spinner","ButtonLink","forwardRef"],"mappings":";;;;;;;;;AAiBA,MAAMA,IAAe;AAAA,EACnB,OAAO;AAAA,EACP,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,EAKb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,eAAe;AAAA,EACf,MAAM;AACR,GAEMC,IAAc,CAClBC,GACAC,MACG;AACH,QAAMC,IAAoB,EAAE,GAAGJ,GAAc,GAAGE,EAAA,GAC1C,EAAE,aAAAG,IAAcL,EAAa,aAAa,UAAAM,GAAU,eAAAC,GAAe,GAAGC,MAAcJ,GAEpFK,IAAYJ,GAEZ,EAAE,iBAAAK,EAAA,IAAoBC,EAAmBP,CAAiB,GAC1D,EAAE,YAAAQ,GAAY,OAAOC,EAAA,IAAkBC,EAAwBN,CAAS,GACxE,EAAE,YAAAO,GAAY,OAAOC,EAAA,IAAeC,EAAcJ,CAAa,GAC/DK,IAAmBC,EAAgBV,GAAW,EAAE,YAAAG,GAAY,YAAAG,GAAY,YAAAC,GAAY,GAEpFI,IAAcC,EAAa;AAAA,IAC/B,GAAGb;AAAA,IACH,eAAAD;AAAA,IACA,SAASG,EAAgB;AAAA,EAAA,CAC1B;AAED,SACE,gBAAAY,EAACb,GAAA,EAAW,GAAGO,GAAa,GAAGN,GAAkB,GAAGQ,GAAkB,SAASE,GAAa,KAAAjB,GACzF,UAAA;AAAA,IAAAG;AAAA,IACAE,EAAU,aAAa,gBAAAe,EAACC,GAAA,CAAA,CAAQ;AAAA,EAAA,GACnC;AAEJ,GAEMC,IAAaC;AAAA,EACjBzB;AACF;AAEAwB,EAAW,kBAAkB;AAC7BA,EAAW,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useButtonLinkStyleProps.cjs","sources":["../../../src/components/ButtonLink/useButtonLinkStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { warning } from '../../common/utilities';\nimport { useClassNamePrefix, useDeprecationMessage, useSymmetry } from '../../hooks';\nimport { type ButtonColor, type
|
|
1
|
+
{"version":3,"file":"useButtonLinkStyleProps.cjs","sources":["../../../src/components/ButtonLink/useButtonLinkStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { warning } from '../../common/utilities';\nimport { useClassNamePrefix, useDeprecationMessage, useSymmetry } from '../../hooks';\nimport { type ButtonColor, type ButtonLinkStyleProps, type ButtonSize } from '../../types';\nimport { applyColor, applySize } from '../../utils/classname';\nimport { compose } from '../../utils/compose';\n\n// `${componentClassName}--${color}`;\nconst getButtonLinkColorClassname = <C = void>(className: string, color: ButtonColor<C>): string =>\n compose(applyColor<ButtonColor<C>>(color))(className);\n\nconst getButtonLinkSizeClassname = <S = void>(className: string, size: ButtonSize<S>): string =>\n compose(applySize<ButtonSize<S>>(size))(className);\n\nexport function useButtonLinkStyleProps<C = void, S = void>(props: Omit<ButtonLinkStyleProps<C, S>, 'routerOptions'>) {\n const { color, isBlock, isDisabled, isLoading, isSymmetrical, size, ...restProps } = props;\n\n // @see https://jira.almacareer.tech/browse/DS-1897\n useDeprecationMessage({\n method: 'custom',\n trigger: !!isBlock,\n componentName: 'ButtonLink',\n customText:\n \"The `isBlock` property will be deleted in the next major release. Please read component's documentation for more information.\",\n });\n\n const buttonClass = useClassNamePrefix('Button');\n const buttonBlockClass = `${buttonClass}--block`;\n const buttonDisabledClass = `${buttonClass}--disabled`;\n const buttonLoadingClass = `${buttonClass}--loading`;\n\n const { isSymmetricalActive, symmetricalClassName } = useSymmetry(buttonClass, isSymmetrical);\n\n if (isBlock && isSymmetricalActive) {\n warning(false, 'isBlock and isSymmetrical props are mutually exclusive');\n }\n\n // @deprecated \"isBlock\" will be removed in the next major version. Please read component's documentation for more information.\n const shouldApplyBlock = () => isBlock && !isSymmetricalActive;\n\n const classProps = classNames(\n buttonClass,\n getButtonLinkColorClassname(buttonClass, color as ButtonColor<C>),\n getButtonLinkSizeClassname(buttonClass, size as ButtonSize<S>),\n {\n [buttonBlockClass]: shouldApplyBlock(),\n [buttonDisabledClass]: isDisabled || isLoading,\n [buttonLoadingClass]: isLoading,\n },\n symmetricalClassName,\n );\n\n return {\n classProps,\n props: restProps,\n };\n}\n"],"names":["getButtonLinkColorClassname","className","color","compose","applyColor","getButtonLinkSizeClassname","size","applySize","useButtonLinkStyleProps","props","isBlock","isDisabled","isLoading","isSymmetrical","restProps","useDeprecationMessage","buttonClass","useClassNamePrefix","buttonBlockClass","buttonDisabledClass","buttonLoadingClass","isSymmetricalActive","symmetricalClassName","useSymmetry","warning","shouldApplyBlock","classNames"],"mappings":"sXAQMA,EAA8B,CAAWC,EAAmBC,IAChEC,EAAAA,QAAQC,EAAAA,WAA2BF,CAAK,CAAC,EAAED,CAAS,EAEhDI,EAA6B,CAAWJ,EAAmBK,IAC/DH,EAAAA,QAAQI,EAAAA,UAAyBD,CAAI,CAAC,EAAEL,CAAS,EAE5C,SAASO,EAA4CC,EAA0D,CACpH,KAAM,CAAE,MAAAP,EAAO,QAAAQ,EAAS,WAAAC,EAAY,UAAAC,EAAW,cAAAC,EAAe,KAAAP,EAAM,GAAGQ,CAAA,EAAcL,EAGrFM,wBAAsB,CACpB,OAAQ,SACR,QAAS,CAAC,CAACL,EACX,cAAe,aACf,WACE,+HAAA,CACH,EAED,MAAMM,EAAcC,EAAAA,mBAAmB,QAAQ,EACzCC,EAAmB,GAAGF,CAAW,UACjCG,EAAsB,GAAGH,CAAW,aACpCI,EAAqB,GAAGJ,CAAW,YAEnC,CAAE,oBAAAK,EAAqB,qBAAAC,CAAA,EAAyBC,EAAAA,YAAYP,EAAaH,CAAa,EAExFH,GAAWW,GACbG,EAAAA,QAAQ,GAAO,wDAAwD,EAIzE,MAAMC,EAAmB,IAAMf,GAAW,CAACW,EAc3C,MAAO,CACL,WAbiBK,EACjBV,EACAhB,EAA4BgB,EAAad,CAAuB,EAChEG,EAA2BW,EAAaV,CAAqB,EAC7D,CACE,CAACY,CAAgB,EAAGO,EAAA,EACpB,CAACN,CAAmB,EAAGR,GAAcC,EACrC,CAACQ,CAAkB,EAAGR,CAAA,EAExBU,CAAA,EAKA,MAAOR,CAAA,CAEX"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function useButtonLinkStyleProps<C = void, S = void>(props:
|
|
1
|
+
import { ButtonLinkStyleProps } from '../../types';
|
|
2
|
+
export declare function useButtonLinkStyleProps<C = void, S = void>(props: Omit<ButtonLinkStyleProps<C, S>, 'routerOptions'>): {
|
|
3
3
|
classProps: string;
|
|
4
4
|
props: {
|
|
5
|
-
children?: React.ReactNode
|
|
6
|
-
|
|
7
|
-
UNSAFE_className?: string;
|
|
8
|
-
UNSAFE_style?: React.CSSProperties;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
onClick?: ((event: import('../..').ClickEvent) => void) | undefined;
|
|
9
7
|
margin?: import('../..').SingleOrResponsive<"auto" | `space-${number}`> | undefined;
|
|
10
8
|
marginTop?: import('../..').SingleOrResponsive<"auto" | `space-${number}`> | undefined;
|
|
11
9
|
marginRight?: import('../..').SingleOrResponsive<"auto" | `space-${number}`> | undefined;
|
|
@@ -13,8 +11,10 @@ export declare function useButtonLinkStyleProps<C = void, S = void>(props: Butto
|
|
|
13
11
|
marginLeft?: import('../..').SingleOrResponsive<"auto" | `space-${number}`> | undefined;
|
|
14
12
|
marginX?: import('../..').SingleOrResponsive<"auto" | `space-${number}`> | undefined;
|
|
15
13
|
marginY?: import('../..').SingleOrResponsive<"auto" | `space-${number}`> | undefined;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
theme?: import('../..').ThemeNameType | undefined;
|
|
15
|
+
UNSAFE_className?: string | undefined;
|
|
16
|
+
UNSAFE_style?: React.CSSProperties | undefined;
|
|
17
|
+
hideOn?: (import('../..').BreakpointToken | import('../..').BreakpointToken[]) | undefined;
|
|
18
|
+
hideFrom?: import('../..').BreakpointToken | undefined;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useButtonLinkStyleProps.js","sources":["../../../src/components/ButtonLink/useButtonLinkStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { warning } from '../../common/utilities';\nimport { useClassNamePrefix, useDeprecationMessage, useSymmetry } from '../../hooks';\nimport { type ButtonColor, type
|
|
1
|
+
{"version":3,"file":"useButtonLinkStyleProps.js","sources":["../../../src/components/ButtonLink/useButtonLinkStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { warning } from '../../common/utilities';\nimport { useClassNamePrefix, useDeprecationMessage, useSymmetry } from '../../hooks';\nimport { type ButtonColor, type ButtonLinkStyleProps, type ButtonSize } from '../../types';\nimport { applyColor, applySize } from '../../utils/classname';\nimport { compose } from '../../utils/compose';\n\n// `${componentClassName}--${color}`;\nconst getButtonLinkColorClassname = <C = void>(className: string, color: ButtonColor<C>): string =>\n compose(applyColor<ButtonColor<C>>(color))(className);\n\nconst getButtonLinkSizeClassname = <S = void>(className: string, size: ButtonSize<S>): string =>\n compose(applySize<ButtonSize<S>>(size))(className);\n\nexport function useButtonLinkStyleProps<C = void, S = void>(props: Omit<ButtonLinkStyleProps<C, S>, 'routerOptions'>) {\n const { color, isBlock, isDisabled, isLoading, isSymmetrical, size, ...restProps } = props;\n\n // @see https://jira.almacareer.tech/browse/DS-1897\n useDeprecationMessage({\n method: 'custom',\n trigger: !!isBlock,\n componentName: 'ButtonLink',\n customText:\n \"The `isBlock` property will be deleted in the next major release. Please read component's documentation for more information.\",\n });\n\n const buttonClass = useClassNamePrefix('Button');\n const buttonBlockClass = `${buttonClass}--block`;\n const buttonDisabledClass = `${buttonClass}--disabled`;\n const buttonLoadingClass = `${buttonClass}--loading`;\n\n const { isSymmetricalActive, symmetricalClassName } = useSymmetry(buttonClass, isSymmetrical);\n\n if (isBlock && isSymmetricalActive) {\n warning(false, 'isBlock and isSymmetrical props are mutually exclusive');\n }\n\n // @deprecated \"isBlock\" will be removed in the next major version. Please read component's documentation for more information.\n const shouldApplyBlock = () => isBlock && !isSymmetricalActive;\n\n const classProps = classNames(\n buttonClass,\n getButtonLinkColorClassname(buttonClass, color as ButtonColor<C>),\n getButtonLinkSizeClassname(buttonClass, size as ButtonSize<S>),\n {\n [buttonBlockClass]: shouldApplyBlock(),\n [buttonDisabledClass]: isDisabled || isLoading,\n [buttonLoadingClass]: isLoading,\n },\n symmetricalClassName,\n );\n\n return {\n classProps,\n props: restProps,\n };\n}\n"],"names":["getButtonLinkColorClassname","className","color","compose","applyColor","getButtonLinkSizeClassname","size","applySize","useButtonLinkStyleProps","props","isBlock","isDisabled","isLoading","isSymmetrical","restProps","useDeprecationMessage","buttonClass","useClassNamePrefix","buttonBlockClass","buttonDisabledClass","buttonLoadingClass","isSymmetricalActive","symmetricalClassName","useSymmetry","warning","shouldApplyBlock","classNames"],"mappings":";;;;;;;AAQA,MAAMA,IAA8B,CAAWC,GAAmBC,MAChEC,EAAQC,EAA2BF,CAAK,CAAC,EAAED,CAAS,GAEhDI,IAA6B,CAAWJ,GAAmBK,MAC/DH,EAAQI,EAAyBD,CAAI,CAAC,EAAEL,CAAS;AAE5C,SAASO,EAA4CC,GAA0D;AACpH,QAAM,EAAE,OAAAP,GAAO,SAAAQ,GAAS,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,MAAAP,GAAM,GAAGQ,EAAA,IAAcL;AAGrF,EAAAM,EAAsB;AAAA,IACpB,QAAQ;AAAA,IACR,SAAS,CAAC,CAACL;AAAA,IACX,eAAe;AAAA,IACf,YACE;AAAA,EAAA,CACH;AAED,QAAMM,IAAcC,EAAmB,QAAQ,GACzCC,IAAmB,GAAGF,CAAW,WACjCG,IAAsB,GAAGH,CAAW,cACpCI,IAAqB,GAAGJ,CAAW,aAEnC,EAAE,qBAAAK,GAAqB,sBAAAC,EAAA,IAAyBC,EAAYP,GAAaH,CAAa;AAE5F,EAAIH,KAAWW,KACbG,EAAQ,IAAO,wDAAwD;AAIzE,QAAMC,IAAmB,MAAMf,KAAW,CAACW;AAc3C,SAAO;AAAA,IACL,YAbiBK;AAAA,MACjBV;AAAA,MACAhB,EAA4BgB,GAAad,CAAuB;AAAA,MAChEG,EAA2BW,GAAaV,CAAqB;AAAA,MAC7D;AAAA,QACE,CAACY,CAAgB,GAAGO,EAAA;AAAA,QACpB,CAACN,CAAmB,GAAGR,KAAcC;AAAA,QACrC,CAACQ,CAAkB,GAAGR;AAAA,MAAA;AAAA,MAExBU;AAAA,IAAA;AAAA,IAKA,OAAOR;AAAA,EAAA;AAEX;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),y=require("react"),m=require("../../hooks/styleProps.cjs"),
|
|
1
|
+
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),y=require("react"),m=require("../../hooks/styleProps.cjs"),C=require("../../utils/mergeStyleProps.cjs"),S=require("./useCardStyleProps.cjs"),f={elementType:"a"},g=(o,n)=>{const l={...f,...o},{elementType:p,children:c,href:i,...u}=l,s=p,{classProps:a}=S.useCardStyleProps(),{styleProps:r,props:t}=m.useStyleProps(u),P=C.mergeStyleProps(s,{classProps:a.link,styleProps:r,otherProps:t});return d.jsx(s,{...t,...r,...P,href:i,ref:n,children:c})},e=y.forwardRef(g);e.spiritComponent="CardLink";e.displayName="CardLink";exports.default=e;
|
|
2
2
|
//# sourceMappingURL=CardLink.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardLink.cjs","sources":["../../../src/components/Card/CardLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { type PolymorphicComponent
|
|
1
|
+
{"version":3,"file":"CardLink.cjs","sources":["../../../src/components/Card/CardLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useStyleProps } from '../../hooks';\nimport {\n type CardLinkProps,\n type PolymorphicComponent,\n type PolymorphicRef,\n type SpiritCardLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useCardStyleProps } from './useCardStyleProps';\n\nconst defaultProps = {\n elementType: 'a',\n};\n\nconst _CardLink = <E extends ElementType = 'a'>(props: SpiritCardLinkProps<E>, ref: PolymorphicRef<E>): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType, children, href, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { classProps } = useCardStyleProps();\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link, styleProps, otherProps });\n\n return (\n <Component {...otherProps} {...styleProps} {...mergedStyleProps} href={href} ref={ref}>\n {children}\n </Component>\n );\n};\n\nconst CardLink = forwardRef<HTMLAnchorElement, SpiritCardLinkProps<'a'>>(_CardLink) as unknown as PolymorphicComponent<\n 'a',\n CardLinkProps\n>;\n\nCardLink.spiritComponent = 'CardLink';\nCardLink.displayName = 'CardLink';\n\nexport default CardLink;\n"],"names":["defaultProps","_CardLink","props","ref","propsWithDefaults","elementType","children","href","restProps","Component","classProps","useCardStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","jsx","CardLink","forwardRef"],"mappings":"2SAaMA,EAAe,CACnB,YAAa,GACf,EAEMC,EAAY,CAA8BC,EAA+BC,IAAwC,CACrH,MAAMC,EAAoB,CAAE,GAAGJ,EAAc,GAAGE,CAAA,EAC1C,CAAE,YAAAG,EAAa,SAAAC,EAAU,KAAAC,EAAM,GAAGC,GAAcJ,EAEhDK,EAAYJ,EAEZ,CAAE,WAAAK,CAAA,EAAeC,oBAAA,EACjB,CAAA,WAAEC,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcN,CAAS,EAC3DO,EAAmBC,kBAAgBP,EAAW,CAAE,WAAYC,EAAW,KAAA,WAAME,EAAY,WAAAC,EAAY,EAE3G,OACEI,MAACR,EAAA,CAAW,GAAGI,EAAa,GAAGD,EAAa,GAAGG,EAAkB,KAAAR,EAAY,IAAAJ,EAC1E,SAAAG,CAAA,CACH,CAEJ,EAEMY,EAAWC,EAAAA,WAAwDlB,CAAS,EAKlFiB,EAAS,gBAAkB,WAC3BA,EAAS,YAAc"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const CardLink: PolymorphicComponent<"a",
|
|
1
|
+
import { CardLinkProps, PolymorphicComponent } from '../../types';
|
|
2
|
+
declare const CardLink: PolymorphicComponent<"a", CardLinkProps>;
|
|
3
3
|
export default CardLink;
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as f } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef as P } from "react";
|
|
4
|
-
import { useStyleProps as
|
|
5
|
-
import { mergeStyleProps as
|
|
4
|
+
import { useStyleProps as u } from "../../hooks/styleProps.js";
|
|
5
|
+
import { mergeStyleProps as y } from "../../utils/mergeStyleProps.js";
|
|
6
6
|
import { useCardStyleProps as C } from "./useCardStyleProps.js";
|
|
7
|
-
const
|
|
7
|
+
const k = {
|
|
8
8
|
elementType: "a"
|
|
9
|
-
},
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = l, { classProps: c } = C(), { styleProps: r, props: s } = y(a), d = u(e, { classProps: c.link, styleProps: r, otherProps: s });
|
|
16
|
-
return /* @__PURE__ */ f(e, { ...s, ...r, ...d, href: i, ref: n, children: m });
|
|
17
|
-
}, t = P(k);
|
|
18
|
-
t.spiritComponent = "CardLink";
|
|
19
|
-
t.displayName = "CardLink";
|
|
9
|
+
}, h = (t, p) => {
|
|
10
|
+
const n = { ...k, ...t }, { elementType: i, children: m, href: l, ...a } = n, r = i, { classProps: c } = C(), { styleProps: o, props: s } = u(a), d = y(r, { classProps: c.link, styleProps: o, otherProps: s });
|
|
11
|
+
return /* @__PURE__ */ f(r, { ...s, ...o, ...d, href: l, ref: p, children: m });
|
|
12
|
+
}, e = P(h);
|
|
13
|
+
e.spiritComponent = "CardLink";
|
|
14
|
+
e.displayName = "CardLink";
|
|
20
15
|
export {
|
|
21
|
-
|
|
16
|
+
e as default
|
|
22
17
|
};
|
|
23
18
|
//# sourceMappingURL=CardLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardLink.js","sources":["../../../src/components/Card/CardLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { type PolymorphicComponent
|
|
1
|
+
{"version":3,"file":"CardLink.js","sources":["../../../src/components/Card/CardLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useStyleProps } from '../../hooks';\nimport {\n type CardLinkProps,\n type PolymorphicComponent,\n type PolymorphicRef,\n type SpiritCardLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useCardStyleProps } from './useCardStyleProps';\n\nconst defaultProps = {\n elementType: 'a',\n};\n\nconst _CardLink = <E extends ElementType = 'a'>(props: SpiritCardLinkProps<E>, ref: PolymorphicRef<E>): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType, children, href, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { classProps } = useCardStyleProps();\n const { styleProps, props: otherProps } = useStyleProps(restProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link, styleProps, otherProps });\n\n return (\n <Component {...otherProps} {...styleProps} {...mergedStyleProps} href={href} ref={ref}>\n {children}\n </Component>\n );\n};\n\nconst CardLink = forwardRef<HTMLAnchorElement, SpiritCardLinkProps<'a'>>(_CardLink) as unknown as PolymorphicComponent<\n 'a',\n CardLinkProps\n>;\n\nCardLink.spiritComponent = 'CardLink';\nCardLink.displayName = 'CardLink';\n\nexport default CardLink;\n"],"names":["defaultProps","_CardLink","props","ref","propsWithDefaults","elementType","children","href","restProps","Component","classProps","useCardStyleProps","styleProps","otherProps","useStyleProps","mergedStyleProps","mergeStyleProps","jsx","CardLink","forwardRef"],"mappings":";;;;;;AAaA,MAAMA,IAAe;AAAA,EACnB,aAAa;AACf,GAEMC,IAAY,CAA8BC,GAA+BC,MAAwC;AACrH,QAAMC,IAAoB,EAAE,GAAGJ,GAAc,GAAGE,EAAA,GAC1C,EAAE,aAAAG,GAAa,UAAAC,GAAU,MAAAC,GAAM,GAAGC,MAAcJ,GAEhDK,IAAYJ,GAEZ,EAAE,YAAAK,EAAA,IAAeC,EAAA,GACjB,EAAE,YAAAC,GAAY,OAAOC,EAAA,IAAeC,EAAcN,CAAS,GAC3DO,IAAmBC,EAAgBP,GAAW,EAAE,YAAYC,EAAW,MAAM,YAAAE,GAAY,YAAAC,GAAY;AAE3G,SACE,gBAAAI,EAACR,GAAA,EAAW,GAAGI,GAAa,GAAGD,GAAa,GAAGG,GAAkB,MAAAR,GAAY,KAAAJ,GAC1E,UAAAG,EAAA,CACH;AAEJ,GAEMY,IAAWC,EAAwDlB,CAAS;AAKlFiB,EAAS,kBAAkB;AAC3BA,EAAS,cAAc;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),c=require("../VisuallyHidden/VisuallyHidden.cjs"),l=require("./useCharacterCounterState.cjs"),r=t=>{const{debouncedScreenReaderMessage:s,isVisible:i,screenReaderMessageId:a,styleProps:n,transferProps:u,visibleCounterText:o}=l.useCharacterCounter(t);return i?e.jsxs(e.Fragment,{children:[e.jsx("div",{...u,...n,"aria-hidden":"true",children:o}),e.jsx(c.default,{id:a,"aria-live":"polite","aria-atomic":"true",children:s})]}):null};r.spiritComponent="CharacterCounter";exports.default=r;
|
|
2
|
+
//# sourceMappingURL=CharacterCounter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CharacterCounter.cjs","sources":["../../../src/components/CharacterCounter/CharacterCounter.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { type CharacterCounterProps } from './types';\nimport { useCharacterCounter } from './useCharacterCounterState';\n\nconst CharacterCounter = (props: CharacterCounterProps) => {\n const {\n debouncedScreenReaderMessage,\n isVisible,\n screenReaderMessageId,\n styleProps,\n transferProps,\n visibleCounterText,\n } = useCharacterCounter(props);\n\n return isVisible ? (\n <>\n <div {...transferProps} {...styleProps} aria-hidden=\"true\">\n {visibleCounterText}\n </div>\n <VisuallyHidden id={screenReaderMessageId} aria-live=\"polite\" aria-atomic=\"true\">\n {debouncedScreenReaderMessage}\n </VisuallyHidden>\n </>\n ) : null;\n};\n\nCharacterCounter.spiritComponent = 'CharacterCounter';\n\nexport default CharacterCounter;\n"],"names":["CharacterCounter","props","debouncedScreenReaderMessage","isVisible","screenReaderMessageId","styleProps","transferProps","visibleCounterText","useCharacterCounter","jsxs","Fragment","jsx","VisuallyHidden"],"mappings":"4PAOMA,EAAoBC,GAAiC,CACzD,KAAM,CACJ,6BAAAC,EACA,UAAAC,EACA,sBAAAC,EACA,WAAAC,EACA,cAAAC,EACA,mBAAAC,CAAA,EACEC,EAAAA,oBAAoBP,CAAK,EAE7B,OAAOE,EACLM,EAAAA,KAAAC,EAAAA,SAAA,CACE,SAAA,CAAAC,MAAC,OAAK,GAAGL,EAAgB,GAAGD,EAAY,cAAY,OACjD,SAAAE,EACH,EACAI,EAAAA,IAACC,EAAAA,SAAe,GAAIR,EAAuB,YAAU,SAAS,cAAY,OACvE,SAAAF,CAAA,CACH,CAAA,CAAA,CACF,EACE,IACN,EAEAF,EAAiB,gBAAkB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as d, Fragment as c, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import l from "../VisuallyHidden/VisuallyHidden.js";
|
|
4
|
+
import { useCharacterCounter as u } from "./useCharacterCounterState.js";
|
|
5
|
+
const m = (r) => {
|
|
6
|
+
const {
|
|
7
|
+
debouncedScreenReaderMessage: t,
|
|
8
|
+
isVisible: i,
|
|
9
|
+
screenReaderMessageId: s,
|
|
10
|
+
styleProps: a,
|
|
11
|
+
transferProps: n,
|
|
12
|
+
visibleCounterText: o
|
|
13
|
+
} = u(r);
|
|
14
|
+
return i ? /* @__PURE__ */ d(c, { children: [
|
|
15
|
+
/* @__PURE__ */ e("div", { ...n, ...a, "aria-hidden": "true", children: o }),
|
|
16
|
+
/* @__PURE__ */ e(l, { id: s, "aria-live": "polite", "aria-atomic": "true", children: t })
|
|
17
|
+
] }) : null;
|
|
18
|
+
};
|
|
19
|
+
m.spiritComponent = "CharacterCounter";
|
|
20
|
+
export {
|
|
21
|
+
m as default
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=CharacterCounter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CharacterCounter.js","sources":["../../../src/components/CharacterCounter/CharacterCounter.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { type CharacterCounterProps } from './types';\nimport { useCharacterCounter } from './useCharacterCounterState';\n\nconst CharacterCounter = (props: CharacterCounterProps) => {\n const {\n debouncedScreenReaderMessage,\n isVisible,\n screenReaderMessageId,\n styleProps,\n transferProps,\n visibleCounterText,\n } = useCharacterCounter(props);\n\n return isVisible ? (\n <>\n <div {...transferProps} {...styleProps} aria-hidden=\"true\">\n {visibleCounterText}\n </div>\n <VisuallyHidden id={screenReaderMessageId} aria-live=\"polite\" aria-atomic=\"true\">\n {debouncedScreenReaderMessage}\n </VisuallyHidden>\n </>\n ) : null;\n};\n\nCharacterCounter.spiritComponent = 'CharacterCounter';\n\nexport default CharacterCounter;\n"],"names":["CharacterCounter","props","debouncedScreenReaderMessage","isVisible","screenReaderMessageId","styleProps","transferProps","visibleCounterText","useCharacterCounter","jsxs","Fragment","jsx","VisuallyHidden"],"mappings":";;;;AAOA,MAAMA,IAAmB,CAACC,MAAiC;AACzD,QAAM;AAAA,IACJ,8BAAAC;AAAA,IACA,WAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,IACEC,EAAoBP,CAAK;AAE7B,SAAOE,IACL,gBAAAM,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC,EAAC,SAAK,GAAGL,GAAgB,GAAGD,GAAY,eAAY,QACjD,UAAAE,GACH;AAAA,IACA,gBAAAI,EAACC,KAAe,IAAIR,GAAuB,aAAU,UAAS,eAAY,QACvE,UAAAF,EAAA,CACH;AAAA,EAAA,EAAA,CACF,IACE;AACN;AAEAF,EAAiB,kBAAkB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.cjs","sources":["../../../src/components/CharacterCounter/constants.ts"],"sourcesContent":["/** Debounce delay (ms) for screen reader message updates in the character counter */\nexport const CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS = 500;\n"],"names":["CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS"],"mappings":"gFACO,MAAMA,EAA8C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS = 500;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../src/components/CharacterCounter/constants.ts"],"sourcesContent":["/** Debounce delay (ms) for screen reader message updates in the character counter */\nexport const CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS = 500;\n"],"names":["CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS"],"mappings":"AACO,MAAMA,IAA8C;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./CharacterCounter.cjs"),t=require("./useCharacterCounterState.cjs");exports.CharacterCounter=e.default;exports.useCharacterCounterState=t.useCharacterCounterState;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),P=require("../../hooks/styleProps.cjs"),R=require("../../hooks/useControlledModeGuard.cjs"),v=require("../../hooks/useDebouncedValue.cjs"),S=require("../../translations/defaults.cjs"),d=require("../../translations/replaceTranslationParams.cjs"),E=require("./constants.cjs"),u=S.defaultLabels.textArea.counter,f=(t,e)=>e!==void 0?`${t}/${e}`:String(t),b=(t,e)=>{if(e===void 0)return d.replaceTranslationParams(u.charactersEntered,{count:t});if(t===0)return d.replaceTranslationParams(u.canEnterUpTo,{maxLength:e});if(t>e){const a=t-e,n=a===1?u.characterOverLimit:u.charactersOverLimit;return d.replaceTranslationParams(n,{count:a})}const r=e-t,o=r===1?u.characterRemaining:u.charactersRemaining;return d.replaceTranslationParams(o,{count:r})},M=t=>{const{value:e,defaultValue:r,counterThreshold:o,hasCounter:a,onChange:n}=t,c=e!==void 0;R.useControlledModeGuard({componentName:"useCharacterCounterState",value:e,defaultValue:r});const[C,g]=m.useState(()=>c?e.length:r?.length??0),i=c?e.length:C,s=a===!0||o!==void 0,p=m.useCallback(l=>{!c&&s&&g(l.target.value.length),n?.(l)},[c,s,n]);return{counterProps:s?{counterThreshold:o,currentLength:i,hasCounter:a}:void 0,handleChange:p}},T=t=>{const{counterThreshold:e,currentLength:r,hasCounter:o,id:a,registerAria:n,...c}=t,{styleProps:C,props:g}=P.useStyleProps(c),i=o===!0||e!==void 0,s=`${a}__counterScreenReaderMessage`,p=f(r,e),h=b(r,e),l=v.useDebouncedValue(h,E.CHARACTER_COUNTER_SCREEN_READER_DEBOUNCE_MS);return m.useEffect(()=>{if(i)return n({add:s}),()=>{n({remove:s})}},[i,s,n]),{debouncedScreenReaderMessage:l,isVisible:i,screenReaderMessageId:s,styleProps:C,transferProps:g,visibleCounterText:p}};exports.useCharacterCounter=T;exports.useCharacterCounterState=M;
|
|
2
|
+
//# sourceMappingURL=useCharacterCounterState.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCharacterCounterState.cjs","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":"wYAyCMA,EAAiBC,EAAAA,cAAc,SAAS,QASxCC,EAAiC,CAACC,EAAuBC,IAC7DA,IAAqB,OAAY,GAAGD,CAAa,IAAIC,CAAgB,GAAK,OAAOD,CAAa,EAS1FE,EAAyC,CAC7CF,EACAC,IACW,CACX,GAAIA,IAAqB,OACvB,OAAOE,EAAAA,yBAAyBN,EAAe,kBAAmB,CAAE,MAAOG,EAAe,EAG5F,GAAIA,IAAkB,EACpB,OAAOG,EAAAA,yBAAyBN,EAAe,aAAc,CAAE,UAAWI,EAAkB,EAG9F,GAAID,EAAgBC,EAAkB,CACpC,MAAMG,EAAYJ,EAAgBC,EAC5BI,EAAWD,IAAc,EAAIP,EAAe,mBAAqBA,EAAe,oBAEtF,OAAOM,EAAAA,yBAAyBE,EAAU,CAAE,MAAOD,EAAW,CAChE,CAEA,MAAME,EAAYL,EAAmBD,EAC/BK,EAAWC,IAAc,EAAIT,EAAe,mBAAqBA,EAAe,oBAEtF,OAAOM,EAAAA,yBAAyBE,EAAU,CAAE,MAAOC,EAAW,CAChE,EAQaC,EAA4BC,GAAgE,CACvG,KAAM,CAAE,MAAAC,EAAO,aAAAC,EAAc,iBAAAT,EAAkB,WAAAU,EAAY,SAAAC,GAAaJ,EAClEK,EAAeJ,IAAU,OAE/BK,yBAAuB,CACrB,cAAe,2BACf,MAAAL,EACA,aAAAC,CAAA,CACD,EAED,KAAM,CAACK,EAAgBC,CAAiB,EAAIC,EAAAA,SAAS,IACnDJ,EAAeJ,EAAM,OAAUC,GAAc,QAAU,CAAA,EAGnDV,EAAgBa,EAAeJ,EAAM,OAASM,EAC9CG,EAAmBP,IAAe,IAAQV,IAAqB,OAE/DkB,EAAeC,EAAAA,YAClBC,GAA4C,CACvC,CAACR,GAAgBK,GACnBF,EAAkBK,EAAM,OAAO,MAAM,MAAM,EAE7CT,IAAWS,CAAK,CAClB,EACA,CAACR,EAAcK,EAAkBN,CAAQ,CAAA,EAW3C,MAAO,CACL,aAT2DM,EACzD,CACE,iBAAAjB,EACA,cAAAD,EACA,WAAAW,CAAA,EAEF,OAIF,aAAAQ,CAAA,CAEJ,EAQaG,EAAuBd,GAA4D,CAC9F,KAAM,CAAE,iBAAAP,EAAkB,cAAAD,EAAe,WAAAW,EAAY,GAAAY,EAAI,aAAAC,EAAc,GAAGC,GAAcjB,EAClF,CAAA,WAAEkB,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,cAAcH,CAAS,EAC9DI,EAAYlB,IAAe,IAAQV,IAAqB,OACxD6B,EAAwB,GAAGP,CAAE,+BAC7BQ,EAAqBhC,EAA+BC,EAAeC,CAAgB,EACnF+B,EAAsB9B,EAAuCF,EAAeC,CAAgB,EAC5FgC,EAA+BC,EAAAA,kBACnCF,EACAG,EAAAA,2CAAA,EAGFC,OAAAA,EAAAA,UAAU,IAAM,CACd,GAAIP,EACF,OAAAL,EAAa,CAAE,IAAKM,EAAuB,EAEpC,IAAM,CACXN,EAAa,CAAE,OAAQM,EAAuB,CAChD,CAIJ,EAAG,CAACD,EAAWC,EAAuBN,CAAY,CAAC,EAE5C,CACL,6BAAAS,EACA,UAAAJ,EACA,sBAAAC,EAAA,WACAJ,EACA,cAAAC,EACA,mBAAAI,CAAA,CAEJ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { StylePropsResult } from '../../hooks';
|
|
3
|
+
import { TextAreaCounterRenderProps } from '../../types';
|
|
4
|
+
import { CharacterCounterProps } from './types';
|
|
5
|
+
export interface CharacterCounterState {
|
|
6
|
+
counterProps: TextAreaCounterRenderProps | undefined;
|
|
7
|
+
handleChange: (event: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface UseCharacterCounterStateProps {
|
|
10
|
+
counterThreshold?: number;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
hasCounter?: boolean;
|
|
13
|
+
onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
14
|
+
value?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface UseCharacterCounterResult {
|
|
17
|
+
debouncedScreenReaderMessage: string;
|
|
18
|
+
isVisible: boolean;
|
|
19
|
+
screenReaderMessageId: string;
|
|
20
|
+
styleProps: StylePropsResult['styleProps'];
|
|
21
|
+
transferProps: StylePropsResult['props'];
|
|
22
|
+
visibleCounterText: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const useCharacterCounterState: (props: UseCharacterCounterStateProps) => CharacterCounterState;
|
|
25
|
+
export declare const useCharacterCounter: (props: CharacterCounterProps) => UseCharacterCounterResult;
|