@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,20 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { useStyleProps as
|
|
6
|
-
import { useAriaDescribedBy as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const b = { ...k, ...x }, {
|
|
2
|
+
import { jsxs as I, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import R from "classnames";
|
|
4
|
+
import { forwardRef as U } from "react";
|
|
5
|
+
import { useStyleProps as $ } from "../../hooks/styleProps.js";
|
|
6
|
+
import { useAriaDescribedBy as B } from "../../hooks/useAriaIdRefs.js";
|
|
7
|
+
import L from "../Field/HelperText.js";
|
|
8
|
+
import j from "../Field/Label.js";
|
|
9
|
+
import C from "../Field/ValidationText.js";
|
|
10
|
+
import { useValidationTextRole as w } from "../Field/useValidationTextRole.js";
|
|
11
|
+
import { SLIDER_DEFAULT_PROPS as H } from "./constants.js";
|
|
12
|
+
import { useSliderStyleProps as M } from "./useSliderStyleProps.js";
|
|
13
|
+
const O = {
|
|
14
|
+
...H
|
|
15
|
+
}, W = (x, P) => {
|
|
16
|
+
const b = { ...O, ...x }, {
|
|
18
17
|
"aria-describedby": h,
|
|
19
18
|
hasValidationIcon: y,
|
|
20
19
|
helperText: N,
|
|
@@ -28,23 +27,23 @@ const k = {
|
|
|
28
27
|
validationText: n,
|
|
29
28
|
value: p,
|
|
30
29
|
...v
|
|
31
|
-
} = b, { classProps: e, props: A } =
|
|
30
|
+
} = b, { classProps: e, props: A } = M({
|
|
32
31
|
...v,
|
|
33
32
|
isDisabled: a,
|
|
34
33
|
validationState: r
|
|
35
|
-
}), { styleProps: d, props: D } =
|
|
34
|
+
}), { styleProps: d, props: D } = $(A), [g, m] = B(h), V = w({
|
|
36
35
|
validationState: r,
|
|
37
36
|
validationText: n
|
|
38
37
|
}), c = "--slider-position", u = (i) => `${Math.round(100 * (i - s) / (l - s))}%`, E = (i) => {
|
|
39
38
|
const { target: f } = i, { value: F } = f;
|
|
40
39
|
f.style.setProperty(c, u(Number(F)));
|
|
41
40
|
};
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */ o(
|
|
41
|
+
return /* @__PURE__ */ I("div", { ...d, ...D, className: R(e.root, d.className), children: [
|
|
42
|
+
/* @__PURE__ */ o(j, { htmlFor: t, UNSAFE_className: e.label, children: T }),
|
|
44
43
|
/* @__PURE__ */ o(
|
|
45
44
|
"input",
|
|
46
45
|
{
|
|
47
|
-
...
|
|
46
|
+
...g,
|
|
48
47
|
className: e.input,
|
|
49
48
|
id: t,
|
|
50
49
|
onInput: E,
|
|
@@ -59,7 +58,7 @@ const k = {
|
|
|
59
58
|
}
|
|
60
59
|
),
|
|
61
60
|
/* @__PURE__ */ o(
|
|
62
|
-
|
|
61
|
+
L,
|
|
63
62
|
{
|
|
64
63
|
UNSAFE_className: e.helperText,
|
|
65
64
|
helperText: N,
|
|
@@ -68,7 +67,7 @@ const k = {
|
|
|
68
67
|
}
|
|
69
68
|
),
|
|
70
69
|
r && /* @__PURE__ */ o(
|
|
71
|
-
|
|
70
|
+
C,
|
|
72
71
|
{
|
|
73
72
|
UNSAFE_className: e.validationText,
|
|
74
73
|
...y && { hasValidationStateIcon: r },
|
|
@@ -79,7 +78,7 @@ const k = {
|
|
|
79
78
|
}
|
|
80
79
|
)
|
|
81
80
|
] });
|
|
82
|
-
}, S =
|
|
81
|
+
}, S = U(W);
|
|
83
82
|
S.spiritComponent = "Slider";
|
|
84
83
|
S.displayName = "Slider";
|
|
85
84
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.js","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.js","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":";;;;;;;;;;;;AAWA,MAAMA,IAAe;AAAA,EACnB,GAAGC;AACL,GAEMC,IAAU,CAACC,GAA0BC,MAAwC;AACjF,QAAMC,IAAoB,EAAE,GAAGL,GAAc,GAAGG,EAAA,GAC1C;AAAA,IACJ,oBAAoBG;AAAA,IACpB,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,KAAAC;AAAA,IACA,KAAAC;AAAA,IACA,MAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDb,GAEE,EAAE,YAAAc,GAAY,OAAOC,EAAA,IAAkBC,EAAoB;AAAA,IAC/D,GAAGH;AAAA,IACH,YAAAR;AAAA,IACA,iBAAAK;AAAA,EAAA,CACD,GACK,EAAE,YAAAO,GAAY,OAAOC,EAAA,IAAeC,EAAcJ,CAAa,GAC/D,CAACK,GAAqBC,CAAQ,IAAIC,EAAmBrB,CAAe,GACpEsB,IAAqBC,EAAsB;AAAA,IAC/C,iBAAAd;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD,GAEKc,IAAc,qBAEdC,IAAoB,CAACC,MAAgB,GAAG,KAAK,MAAO,OAAOA,IAAMnB,MAASD,IAAMC,EAAI,CAAC,KAErFoB,IAAc,CAACC,MAAuC;AAC1D,UAAM,EAAE,QAAAC,MAAWD,GACb,EAAE,OAAOE,EAAA,IAAeD;AAE9B,IAAAA,EAAO,MAAM,YAAYL,GAAaC,EAAkB,OAAOK,CAAU,CAAC,CAAC;AAAA,EAC7E;AAEA,SACE,gBAAAC,EAAC,OAAA,EAAK,GAAGf,GAAa,GAAGC,GAAY,WAAWe,EAAWnB,EAAW,MAAMG,EAAW,SAAS,GAC9F,UAAA;AAAA,IAAA,gBAAAiB,EAACC,KAAM,SAAS/B,GAAI,kBAAkBU,EAAW,OAC9C,UAAAR,GACH;AAAA,IACA,gBAAA4B;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGd;AAAA,QACJ,WAAWN,EAAW;AAAA,QACtB,IAAAV;AAAA,QACA,SAASwB;AAAA,QACT,OAAO,EAAE,CAACH,CAAW,GAAG,GAAGC,EAAkBd,CAAK,CAAC,GAAA;AAAA,QACnD,MAAK;AAAA,QACL,KAAAJ;AAAA,QACA,KAAAD;AAAA,QACA,MAAAE;AAAA,QACA,OAAAG;AAAA,QACA,UAAUP;AAAA,QACV,KAAAN;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,gBAAAmC;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,kBAAkBtB,EAAW;AAAA,QAC7B,YAAAX;AAAA,QACA,IAAI,GAAGC,CAAE;AAAA,QACT,cAAciB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEfX,KACC,gBAAAwB;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,kBAAkBvB,EAAW;AAAA,QAC5B,GAAIZ,KAAqB,EAAE,wBAAwBQ,EAAA;AAAA,QACpD,IAAI,GAAGN,CAAE;AAAA,QACT,cAAciB;AAAA,QACd,gBAAAV;AAAA,QACA,MAAMY;AAAA,MAAA;AAAA,IAAA;AAAA,EACR,GAEJ;AAEJ,GAEMe,IAASC,EAAgD1C,CAAO;AAKtEyC,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 n=require("react/jsx-runtime"),S=require("classnames"),T=require("react"),b=require("../../hooks/styleProps.cjs"),f=require("../../hooks/useLinkClick.cjs"),q=require("../../utils/mergeStyleProps.cjs"),C=require("./useTabsStyleProps.cjs"),L={itemProps:{}},g=(i,l)=>{const c={...L,...i},{elementType:a="a",children:p,itemProps:u={},routerOptions:m,...e}=c,{href:P}=e,t=a,{classProps:r}=C.useTabsStyleProps(),{styleProps:o,props:y}=b.useStyleProps(u),d=q.mergeStyleProps(t,{classProps:r.link}),k=f.useLinkClick({...e,routerOptions:m});return n.jsx("li",{...o,...y,className:S(r.item,o.className),role:"presentation",children:n.jsx(t,{...e,...d,href:P,onClick:k,ref:l,children:p})})},s=T.forwardRef(g);s.spiritComponent="TabLink";s.displayName="TabLink";exports.default=s;
|
|
2
2
|
//# sourceMappingURL=TabLink.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabLink.cjs","sources":["../../../src/components/Tabs/TabLink.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useStyleProps } from '../../hooks';\nimport {\n type PolymorphicComponent,\n type PolymorphicRef,\n type SpiritTabLinkProps,\n type TabLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useTabsStyleProps } from './useTabsStyleProps';\n\nconst defaultProps: TabLinkProps = {\n itemProps: {},\n};\n\nconst _TabLink = <E extends ElementType = 'a'>(props: SpiritTabLinkProps<E>, ref: PolymorphicRef<E>): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = 'a', children, itemProps = {}, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { classProps } = useTabsStyleProps();\n const { styleProps: itemStyleProps, props: itemTransferProps } = useStyleProps(itemProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link });\n\n return (\n <li\n {...itemStyleProps}\n {...itemTransferProps}\n className={classNames(classProps.item, itemStyleProps.className)}\n role=\"presentation\"\n >\n <Component {...restProps} {...mergedStyleProps} ref={ref}>\n {children}\n </Component>\n </li>\n );\n};\n\nconst TabLink = forwardRef<HTMLAnchorElement, SpiritTabLinkProps<'a'>>(_TabLink) as unknown as PolymorphicComponent<\n 'a',\n TabLinkProps\n>;\n\nTabLink.spiritComponent = 'TabLink';\nTabLink.displayName = 'TabLink';\n\nexport default TabLink;\n"],"names":["defaultProps","_TabLink","props","ref","propsWithDefaults","elementType","children","itemProps","restProps","Component","classProps","useTabsStyleProps","itemStyleProps","itemTransferProps","useStyleProps","mergedStyleProps","mergeStyleProps","jsx","classNames","TabLink","forwardRef"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TabLink.cjs","sources":["../../../src/components/Tabs/TabLink.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useLinkClick, useStyleProps } from '../../hooks';\nimport {\n type PolymorphicComponent,\n type PolymorphicRef,\n type SpiritTabLinkProps,\n type TabLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useTabsStyleProps } from './useTabsStyleProps';\n\nconst defaultProps: TabLinkProps = {\n itemProps: {},\n};\n\nconst _TabLink = <E extends ElementType = 'a'>(props: SpiritTabLinkProps<E>, ref: PolymorphicRef<E>): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = 'a', children, itemProps = {}, routerOptions, ...restProps } = propsWithDefaults;\n const { href } = restProps;\n\n const Component = elementType as ElementType;\n\n const { classProps } = useTabsStyleProps();\n const { styleProps: itemStyleProps, props: itemTransferProps } = useStyleProps(itemProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link });\n\n const handleClick = useLinkClick({ ...restProps, routerOptions });\n\n return (\n <li\n {...itemStyleProps}\n {...itemTransferProps}\n className={classNames(classProps.item, itemStyleProps.className)}\n role=\"presentation\"\n >\n <Component {...restProps} {...mergedStyleProps} href={href} onClick={handleClick} ref={ref}>\n {children}\n </Component>\n </li>\n );\n};\n\nconst TabLink = forwardRef<HTMLAnchorElement, SpiritTabLinkProps<'a'>>(_TabLink) as unknown as PolymorphicComponent<\n 'a',\n TabLinkProps\n>;\n\nTabLink.spiritComponent = 'TabLink';\nTabLink.displayName = 'TabLink';\n\nexport default TabLink;\n"],"names":["defaultProps","_TabLink","props","ref","propsWithDefaults","elementType","children","itemProps","routerOptions","restProps","href","Component","classProps","useTabsStyleProps","itemStyleProps","itemTransferProps","useStyleProps","mergedStyleProps","mergeStyleProps","handleClick","useLinkClick","jsx","classNames","TabLink","forwardRef"],"mappings":"6WAcMA,EAA6B,CACjC,UAAW,CAAA,CACb,EAEMC,EAAW,CAA8BC,EAA8BC,IAAwC,CACnH,MAAMC,EAAoB,CAAE,GAAGJ,EAAc,GAAGE,CAAA,EAC1C,CAAE,YAAAG,EAAc,IAAK,SAAAC,EAAU,UAAAC,EAAY,CAAA,EAAI,cAAAC,EAAe,GAAGC,CAAA,EAAcL,EAC/E,CAAE,KAAAM,GAASD,EAEXE,EAAYN,EAEZ,CAAE,WAAAO,CAAA,EAAeC,oBAAA,EACjB,CAAE,WAAYC,EAAgB,MAAOC,CAAA,EAAsBC,EAAAA,cAAcT,CAAS,EAClFU,EAAmBC,EAAAA,gBAAgBP,EAAW,CAAE,WAAYC,EAAW,KAAM,EAE7EO,EAAcC,EAAAA,aAAa,CAAE,GAAGX,EAAW,cAAAD,EAAe,EAEhE,OACEa,EAAAA,IAAC,KAAA,CACE,GAAGP,EACH,GAAGC,EACJ,UAAWO,EAAWV,EAAW,KAAME,EAAe,SAAS,EAC/D,KAAK,eAEL,SAAAO,EAAAA,IAACV,EAAA,CAAW,GAAGF,EAAY,GAAGQ,EAAkB,KAAAP,EAAY,QAASS,EAAa,IAAAhB,EAC/E,SAAAG,CAAA,CACH,CAAA,CAAA,CAGN,EAEMiB,EAAUC,EAAAA,WAAuDvB,CAAQ,EAK/EsB,EAAQ,gBAAkB,UAC1BA,EAAQ,YAAc"}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { useStyleProps as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import y from "classnames";
|
|
4
|
+
import { forwardRef as T } from "react";
|
|
5
|
+
import { useStyleProps as b } from "../../hooks/styleProps.js";
|
|
6
|
+
import { useLinkClick as h } from "../../hooks/useLinkClick.js";
|
|
7
|
+
import { mergeStyleProps as C } from "../../utils/mergeStyleProps.js";
|
|
8
|
+
import { useTabsStyleProps as L } from "./useTabsStyleProps.js";
|
|
9
|
+
const S = {
|
|
9
10
|
itemProps: {}
|
|
10
|
-
},
|
|
11
|
-
const m = { ...
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
}, N = (n, p) => {
|
|
12
|
+
const m = { ...S, ...n }, { elementType: l = "a", children: a, itemProps: c = {}, routerOptions: f, ...s } = m, { href: P } = s, o = l, { classProps: r } = L(), { styleProps: e, props: u } = b(c), k = C(o, { classProps: r.link }), d = h({ ...s, routerOptions: f });
|
|
13
|
+
return /* @__PURE__ */ t(
|
|
13
14
|
"li",
|
|
14
15
|
{
|
|
15
16
|
...e,
|
|
16
|
-
...
|
|
17
|
-
className:
|
|
17
|
+
...u,
|
|
18
|
+
className: y(r.item, e.className),
|
|
18
19
|
role: "presentation",
|
|
19
|
-
children: /* @__PURE__ */
|
|
20
|
+
children: /* @__PURE__ */ t(o, { ...s, ...k, href: P, onClick: d, ref: p, children: a })
|
|
20
21
|
}
|
|
21
22
|
);
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
}, i = T(N);
|
|
24
|
+
i.spiritComponent = "TabLink";
|
|
25
|
+
i.displayName = "TabLink";
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
+
i as default
|
|
27
28
|
};
|
|
28
29
|
//# sourceMappingURL=TabLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabLink.js","sources":["../../../src/components/Tabs/TabLink.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useStyleProps } from '../../hooks';\nimport {\n type PolymorphicComponent,\n type PolymorphicRef,\n type SpiritTabLinkProps,\n type TabLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useTabsStyleProps } from './useTabsStyleProps';\n\nconst defaultProps: TabLinkProps = {\n itemProps: {},\n};\n\nconst _TabLink = <E extends ElementType = 'a'>(props: SpiritTabLinkProps<E>, ref: PolymorphicRef<E>): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = 'a', children, itemProps = {}, ...restProps } = propsWithDefaults;\n\n const Component = elementType as ElementType;\n\n const { classProps } = useTabsStyleProps();\n const { styleProps: itemStyleProps, props: itemTransferProps } = useStyleProps(itemProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link });\n\n return (\n <li\n {...itemStyleProps}\n {...itemTransferProps}\n className={classNames(classProps.item, itemStyleProps.className)}\n role=\"presentation\"\n >\n <Component {...restProps} {...mergedStyleProps} ref={ref}>\n {children}\n </Component>\n </li>\n );\n};\n\nconst TabLink = forwardRef<HTMLAnchorElement, SpiritTabLinkProps<'a'>>(_TabLink) as unknown as PolymorphicComponent<\n 'a',\n TabLinkProps\n>;\n\nTabLink.spiritComponent = 'TabLink';\nTabLink.displayName = 'TabLink';\n\nexport default TabLink;\n"],"names":["defaultProps","_TabLink","props","ref","propsWithDefaults","elementType","children","itemProps","restProps","Component","classProps","useTabsStyleProps","itemStyleProps","itemTransferProps","useStyleProps","mergedStyleProps","mergeStyleProps","jsx","classNames","TabLink","forwardRef"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TabLink.js","sources":["../../../src/components/Tabs/TabLink.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React, { type ElementType, forwardRef } from 'react';\nimport { useLinkClick, useStyleProps } from '../../hooks';\nimport {\n type PolymorphicComponent,\n type PolymorphicRef,\n type SpiritTabLinkProps,\n type TabLinkProps,\n} from '../../types';\nimport { mergeStyleProps } from '../../utils';\nimport { useTabsStyleProps } from './useTabsStyleProps';\n\nconst defaultProps: TabLinkProps = {\n itemProps: {},\n};\n\nconst _TabLink = <E extends ElementType = 'a'>(props: SpiritTabLinkProps<E>, ref: PolymorphicRef<E>): JSX.Element => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { elementType = 'a', children, itemProps = {}, routerOptions, ...restProps } = propsWithDefaults;\n const { href } = restProps;\n\n const Component = elementType as ElementType;\n\n const { classProps } = useTabsStyleProps();\n const { styleProps: itemStyleProps, props: itemTransferProps } = useStyleProps(itemProps);\n const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link });\n\n const handleClick = useLinkClick({ ...restProps, routerOptions });\n\n return (\n <li\n {...itemStyleProps}\n {...itemTransferProps}\n className={classNames(classProps.item, itemStyleProps.className)}\n role=\"presentation\"\n >\n <Component {...restProps} {...mergedStyleProps} href={href} onClick={handleClick} ref={ref}>\n {children}\n </Component>\n </li>\n );\n};\n\nconst TabLink = forwardRef<HTMLAnchorElement, SpiritTabLinkProps<'a'>>(_TabLink) as unknown as PolymorphicComponent<\n 'a',\n TabLinkProps\n>;\n\nTabLink.spiritComponent = 'TabLink';\nTabLink.displayName = 'TabLink';\n\nexport default TabLink;\n"],"names":["defaultProps","_TabLink","props","ref","propsWithDefaults","elementType","children","itemProps","routerOptions","restProps","href","Component","classProps","useTabsStyleProps","itemStyleProps","itemTransferProps","useStyleProps","mergedStyleProps","mergeStyleProps","handleClick","useLinkClick","jsx","classNames","TabLink","forwardRef"],"mappings":";;;;;;;;AAcA,MAAMA,IAA6B;AAAA,EACjC,WAAW,CAAA;AACb,GAEMC,IAAW,CAA8BC,GAA8BC,MAAwC;AACnH,QAAMC,IAAoB,EAAE,GAAGJ,GAAc,GAAGE,EAAA,GAC1C,EAAE,aAAAG,IAAc,KAAK,UAAAC,GAAU,WAAAC,IAAY,CAAA,GAAI,eAAAC,GAAe,GAAGC,EAAA,IAAcL,GAC/E,EAAE,MAAAM,MAASD,GAEXE,IAAYN,GAEZ,EAAE,YAAAO,EAAA,IAAeC,EAAA,GACjB,EAAE,YAAYC,GAAgB,OAAOC,EAAA,IAAsBC,EAAcT,CAAS,GAClFU,IAAmBC,EAAgBP,GAAW,EAAE,YAAYC,EAAW,MAAM,GAE7EO,IAAcC,EAAa,EAAE,GAAGX,GAAW,eAAAD,GAAe;AAEhE,SACE,gBAAAa;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGP;AAAA,MACH,GAAGC;AAAA,MACJ,WAAWO,EAAWV,EAAW,MAAME,EAAe,SAAS;AAAA,MAC/D,MAAK;AAAA,MAEL,UAAA,gBAAAO,EAACV,GAAA,EAAW,GAAGF,GAAY,GAAGQ,GAAkB,MAAAP,GAAY,SAASS,GAAa,KAAAhB,GAC/E,UAAAG,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN,GAEMiB,IAAUC,EAAuDvB,CAAQ;AAK/EsB,EAAQ,kBAAkB;AAC1BA,EAAQ,cAAc;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={NEUTRAL:"neutral"};exports.TagColorsExtended=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={NEUTRAL:"neutral",SELECTED:"selected"};exports.TagColorsExtended=e;
|
|
2
2
|
//# sourceMappingURL=constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","sources":["../../../src/components/Tag/constants.ts"],"sourcesContent":["export const TagColorsExtended = {\n NEUTRAL: 'neutral',\n} as const;\n"],"names":["TagColorsExtended"],"mappings":"gFAAO,MAAMA,EAAoB,CAC/B,QAAS,
|
|
1
|
+
{"version":3,"file":"constants.cjs","sources":["../../../src/components/Tag/constants.ts"],"sourcesContent":["export const TagColorsExtended = {\n NEUTRAL: 'neutral',\n SELECTED: 'selected',\n} as const;\n"],"names":["TagColorsExtended"],"mappings":"gFAAO,MAAMA,EAAoB,CAC/B,QAAS,UACT,SAAU,UACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../src/components/Tag/constants.ts"],"sourcesContent":["export const TagColorsExtended = {\n NEUTRAL: 'neutral',\n} as const;\n"],"names":["TagColorsExtended"],"mappings":"AAAO,MAAMA,IAAoB;AAAA,EAC/B,SAAS;
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../src/components/Tag/constants.ts"],"sourcesContent":["export const TagColorsExtended = {\n NEUTRAL: 'neutral',\n SELECTED: 'selected',\n} as const;\n"],"names":["TagColorsExtended"],"mappings":"AAAO,MAAMA,IAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,UAAU;AACZ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("@alma-oss/spirit-design-tokens"),g=require("classnames"),y=require("../../constants/colors.cjs"),o=require("../../constants/dictionaries.cjs"),T=require("../../hooks/useClassNamePrefix.cjs"),d=(s,e)=>{if(!s)return{};const n=Object.keys($.emotionColors).includes(s)?`${y.ColorPrefixes.EMOTION}-`:"",r=e?o.Intensity.SUBTLE:o.Intensity.BASIC,a=e?o.Intensity.SUBTLE:o.Intensity.BASIC,t=e?o.Intensity.BASIC:o.Intensity.SUBTLE;return{[`border-${n}${s}-${r}`]:!0,[`bg-${n}${s}-${a}`]:!0,[`text-${n}${s}-${t}`]:!0}};function I(s){const{color:e,isDisabled:i,isSubtle:n,size:r,...a}=s,t=T.useClassNamePrefix("Tag"),c=`${t}--${e}`,l=`${t}--disabled`,u=`${t}--${r}`,C=`${t}--subtle`;return{classProps:g(t,{[c]:e,[l]:i,[u]:r,[C]:n,...!i&&d(e,n)}),props:a}}exports.useTagStyleProps=I;
|
|
2
2
|
//# sourceMappingURL=useTagStyleProps.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTagStyleProps.cjs","sources":["../../../src/components/Tag/useTagStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { type ElementType } from 'react';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type SpiritTagProps } from '../../types';\n\nexport interface TagStyles {\n /** className props */\n classProps: string;\n /** props to be passed to the element */\n props: Partial<SpiritTagProps>;\n}\n\nexport function useTagStyleProps<E extends ElementType = 'span', C = void, S = void>(\n props: SpiritTagProps<E, C, S>,\n): TagStyles {\n const { color, isSubtle, size, ...modifiedProps } = props;\n\n const TagClass = useClassNamePrefix('Tag');\n const TagColorClass = `${TagClass}--${color}`;\n const TagSizeClass = `${TagClass}--${size}`;\n const TagSubtleClass = `${TagClass}--subtle`;\n const classProps = classNames(TagClass, {\n [TagColorClass]: color,\n [TagSizeClass]: size,\n [TagSubtleClass]: isSubtle,\n });\n\n return {\n classProps,\n props: modifiedProps as Partial<SpiritTagProps>,\n };\n}\n"],"names":["
|
|
1
|
+
{"version":3,"file":"useTagStyleProps.cjs","sources":["../../../src/components/Tag/useTagStyleProps.ts"],"sourcesContent":["import { emotionColors } from '@alma-oss/spirit-design-tokens';\nimport classNames from 'classnames';\nimport { type ElementType } from 'react';\nimport { Intensity } from '../../constants';\nimport { ColorPrefixes } from '../../constants/colors';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type SpiritTagProps } from '../../types';\n\nexport interface TagStyles {\n /** className props */\n classProps: string;\n /** props to be passed to the element */\n props: Partial<SpiritTagProps>;\n}\n\nconst getColorClasses = (color: string | undefined, isSubtle: boolean | undefined) => {\n if (!color) {\n return {};\n }\n\n const isEmotionColor = Object.keys(emotionColors).includes(color);\n const prefix = isEmotionColor ? `${ColorPrefixes.EMOTION}-` : '';\n const borderIntensity = isSubtle ? Intensity.SUBTLE : Intensity.BASIC;\n const backgroundIntensity = isSubtle ? Intensity.SUBTLE : Intensity.BASIC;\n const textIntensity = isSubtle ? Intensity.BASIC : Intensity.SUBTLE;\n\n return {\n [`border-${prefix}${color}-${borderIntensity}`]: true,\n [`bg-${prefix}${color}-${backgroundIntensity}`]: true,\n [`text-${prefix}${color}-${textIntensity}`]: true,\n };\n};\n\nexport function useTagStyleProps<E extends ElementType = 'span', C = void, S = void>(\n props: SpiritTagProps<E, C, S>,\n): TagStyles {\n const { color, isDisabled, isSubtle, size, ...modifiedProps } = props;\n\n const TagClass = useClassNamePrefix('Tag');\n const TagColorClass = `${TagClass}--${color}`;\n const TagDisabledClass = `${TagClass}--disabled`;\n const TagSizeClass = `${TagClass}--${size}`;\n const TagSubtleClass = `${TagClass}--subtle`;\n const classProps = classNames(TagClass, {\n [TagColorClass]: color,\n [TagDisabledClass]: isDisabled,\n [TagSizeClass]: size,\n [TagSubtleClass]: isSubtle,\n ...(!isDisabled && getColorClasses(color as string | undefined, isSubtle as boolean | undefined)),\n });\n\n return {\n classProps,\n props: modifiedProps as Partial<SpiritTagProps>,\n };\n}\n"],"names":["getColorClasses","color","isSubtle","prefix","emotionColors","ColorPrefixes","borderIntensity","Intensity","backgroundIntensity","textIntensity","useTagStyleProps","props","isDisabled","size","modifiedProps","TagClass","useClassNamePrefix","TagColorClass","TagDisabledClass","TagSizeClass","TagSubtleClass","classNames"],"mappings":"gSAeMA,EAAkB,CAACC,EAA2BC,IAAkC,CACpF,GAAI,CAACD,EACH,MAAO,CAAA,EAIT,MAAME,EADiB,OAAO,KAAKC,EAAAA,aAAa,EAAE,SAASH,CAAK,EAChC,GAAGI,EAAAA,cAAc,OAAO,IAAM,GACxDC,EAAkBJ,EAAWK,EAAAA,UAAU,OAASA,EAAAA,UAAU,MAC1DC,EAAsBN,EAAWK,EAAAA,UAAU,OAASA,EAAAA,UAAU,MAC9DE,EAAgBP,EAAWK,EAAAA,UAAU,MAAQA,EAAAA,UAAU,OAE7D,MAAO,CACL,CAAC,UAAUJ,CAAM,GAAGF,CAAK,IAAIK,CAAe,EAAE,EAAG,GACjD,CAAC,MAAMH,CAAM,GAAGF,CAAK,IAAIO,CAAmB,EAAE,EAAG,GACjD,CAAC,QAAQL,CAAM,GAAGF,CAAK,IAAIQ,CAAa,EAAE,EAAG,EAAA,CAEjD,EAEO,SAASC,EACdC,EACW,CACX,KAAM,CAAE,MAAAV,EAAO,WAAAW,EAAY,SAAAV,EAAU,KAAAW,EAAM,GAAGC,GAAkBH,EAE1DI,EAAWC,EAAAA,mBAAmB,KAAK,EACnCC,EAAgB,GAAGF,CAAQ,KAAKd,CAAK,GACrCiB,EAAmB,GAAGH,CAAQ,aAC9BI,EAAe,GAAGJ,CAAQ,KAAKF,CAAI,GACnCO,EAAiB,GAAGL,CAAQ,WASlC,MAAO,CACL,WATiBM,EAAWN,EAAU,CACtC,CAACE,CAAa,EAAGhB,EACjB,CAACiB,CAAgB,EAAGN,EACpB,CAACO,CAAY,EAAGN,EAChB,CAACO,CAAc,EAAGlB,EAClB,GAAI,CAACU,GAAcZ,EAAgBC,EAA6BC,CAA+B,CAAA,CAChG,EAIC,MAAOY,CAAA,CAEX"}
|
|
@@ -1,17 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { emotionColors as $ } from "@alma-oss/spirit-design-tokens";
|
|
2
|
+
import p from "classnames";
|
|
3
|
+
import { ColorPrefixes as u } from "../../constants/colors.js";
|
|
4
|
+
import { Intensity as r } from "../../constants/dictionaries.js";
|
|
5
|
+
import { useClassNamePrefix as f } from "../../hooks/useClassNamePrefix.js";
|
|
6
|
+
const T = (s, t) => {
|
|
7
|
+
if (!s)
|
|
8
|
+
return {};
|
|
9
|
+
const e = Object.keys($).includes(s) ? `${u.EMOTION}-` : "", n = t ? r.SUBTLE : r.BASIC, a = t ? r.SUBTLE : r.BASIC, o = t ? r.BASIC : r.SUBTLE;
|
|
5
10
|
return {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
[`border-${e}${s}-${n}`]: !0,
|
|
12
|
+
[`bg-${e}${s}-${a}`]: !0,
|
|
13
|
+
[`text-${e}${s}-${o}`]: !0
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
function y(s) {
|
|
17
|
+
const { color: t, isDisabled: i, isSubtle: e, size: n, ...a } = s, o = f("Tag"), l = `${o}--${t}`, c = `${o}--disabled`, m = `${o}--${n}`, C = `${o}--subtle`;
|
|
18
|
+
return {
|
|
19
|
+
classProps: p(o, {
|
|
20
|
+
[l]: t,
|
|
21
|
+
[c]: i,
|
|
22
|
+
[m]: n,
|
|
23
|
+
[C]: e,
|
|
24
|
+
...!i && T(t, e)
|
|
10
25
|
}),
|
|
11
|
-
props:
|
|
26
|
+
props: a
|
|
12
27
|
};
|
|
13
28
|
}
|
|
14
29
|
export {
|
|
15
|
-
|
|
30
|
+
y as useTagStyleProps
|
|
16
31
|
};
|
|
17
32
|
//# sourceMappingURL=useTagStyleProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTagStyleProps.js","sources":["../../../src/components/Tag/useTagStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { type ElementType } from 'react';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type SpiritTagProps } from '../../types';\n\nexport interface TagStyles {\n /** className props */\n classProps: string;\n /** props to be passed to the element */\n props: Partial<SpiritTagProps>;\n}\n\nexport function useTagStyleProps<E extends ElementType = 'span', C = void, S = void>(\n props: SpiritTagProps<E, C, S>,\n): TagStyles {\n const { color, isSubtle, size, ...modifiedProps } = props;\n\n const TagClass = useClassNamePrefix('Tag');\n const TagColorClass = `${TagClass}--${color}`;\n const TagSizeClass = `${TagClass}--${size}`;\n const TagSubtleClass = `${TagClass}--subtle`;\n const classProps = classNames(TagClass, {\n [TagColorClass]: color,\n [TagSizeClass]: size,\n [TagSubtleClass]: isSubtle,\n });\n\n return {\n classProps,\n props: modifiedProps as Partial<SpiritTagProps>,\n };\n}\n"],"names":["
|
|
1
|
+
{"version":3,"file":"useTagStyleProps.js","sources":["../../../src/components/Tag/useTagStyleProps.ts"],"sourcesContent":["import { emotionColors } from '@alma-oss/spirit-design-tokens';\nimport classNames from 'classnames';\nimport { type ElementType } from 'react';\nimport { Intensity } from '../../constants';\nimport { ColorPrefixes } from '../../constants/colors';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type SpiritTagProps } from '../../types';\n\nexport interface TagStyles {\n /** className props */\n classProps: string;\n /** props to be passed to the element */\n props: Partial<SpiritTagProps>;\n}\n\nconst getColorClasses = (color: string | undefined, isSubtle: boolean | undefined) => {\n if (!color) {\n return {};\n }\n\n const isEmotionColor = Object.keys(emotionColors).includes(color);\n const prefix = isEmotionColor ? `${ColorPrefixes.EMOTION}-` : '';\n const borderIntensity = isSubtle ? Intensity.SUBTLE : Intensity.BASIC;\n const backgroundIntensity = isSubtle ? Intensity.SUBTLE : Intensity.BASIC;\n const textIntensity = isSubtle ? Intensity.BASIC : Intensity.SUBTLE;\n\n return {\n [`border-${prefix}${color}-${borderIntensity}`]: true,\n [`bg-${prefix}${color}-${backgroundIntensity}`]: true,\n [`text-${prefix}${color}-${textIntensity}`]: true,\n };\n};\n\nexport function useTagStyleProps<E extends ElementType = 'span', C = void, S = void>(\n props: SpiritTagProps<E, C, S>,\n): TagStyles {\n const { color, isDisabled, isSubtle, size, ...modifiedProps } = props;\n\n const TagClass = useClassNamePrefix('Tag');\n const TagColorClass = `${TagClass}--${color}`;\n const TagDisabledClass = `${TagClass}--disabled`;\n const TagSizeClass = `${TagClass}--${size}`;\n const TagSubtleClass = `${TagClass}--subtle`;\n const classProps = classNames(TagClass, {\n [TagColorClass]: color,\n [TagDisabledClass]: isDisabled,\n [TagSizeClass]: size,\n [TagSubtleClass]: isSubtle,\n ...(!isDisabled && getColorClasses(color as string | undefined, isSubtle as boolean | undefined)),\n });\n\n return {\n classProps,\n props: modifiedProps as Partial<SpiritTagProps>,\n };\n}\n"],"names":["getColorClasses","color","isSubtle","prefix","emotionColors","ColorPrefixes","borderIntensity","Intensity","backgroundIntensity","textIntensity","useTagStyleProps","props","isDisabled","size","modifiedProps","TagClass","useClassNamePrefix","TagColorClass","TagDisabledClass","TagSizeClass","TagSubtleClass","classNames"],"mappings":";;;;;AAeA,MAAMA,IAAkB,CAACC,GAA2BC,MAAkC;AACpF,MAAI,CAACD;AACH,WAAO,CAAA;AAIT,QAAME,IADiB,OAAO,KAAKC,CAAa,EAAE,SAASH,CAAK,IAChC,GAAGI,EAAc,OAAO,MAAM,IACxDC,IAAkBJ,IAAWK,EAAU,SAASA,EAAU,OAC1DC,IAAsBN,IAAWK,EAAU,SAASA,EAAU,OAC9DE,IAAgBP,IAAWK,EAAU,QAAQA,EAAU;AAE7D,SAAO;AAAA,IACL,CAAC,UAAUJ,CAAM,GAAGF,CAAK,IAAIK,CAAe,EAAE,GAAG;AAAA,IACjD,CAAC,MAAMH,CAAM,GAAGF,CAAK,IAAIO,CAAmB,EAAE,GAAG;AAAA,IACjD,CAAC,QAAQL,CAAM,GAAGF,CAAK,IAAIQ,CAAa,EAAE,GAAG;AAAA,EAAA;AAEjD;AAEO,SAASC,EACdC,GACW;AACX,QAAM,EAAE,OAAAV,GAAO,YAAAW,GAAY,UAAAV,GAAU,MAAAW,GAAM,GAAGC,MAAkBH,GAE1DI,IAAWC,EAAmB,KAAK,GACnCC,IAAgB,GAAGF,CAAQ,KAAKd,CAAK,IACrCiB,IAAmB,GAAGH,CAAQ,cAC9BI,IAAe,GAAGJ,CAAQ,KAAKF,CAAI,IACnCO,IAAiB,GAAGL,CAAQ;AASlC,SAAO;AAAA,IACL,YATiBM,EAAWN,GAAU;AAAA,MACtC,CAACE,CAAa,GAAGhB;AAAA,MACjB,CAACiB,CAAgB,GAAGN;AAAA,MACpB,CAACO,CAAY,GAAGN;AAAA,MAChB,CAACO,CAAc,GAAGlB;AAAA,MAClB,GAAI,CAACU,KAAcZ,EAAgBC,GAA6BC,CAA+B;AAAA,IAAA,CAChG;AAAA,IAIC,OAAOY;AAAA,EAAA;AAEX;"}
|
|
@@ -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 S=require("react/jsx-runtime"),r=require("react"),j=require("../../common/utilities/warning.cjs"),f=require("../../utils/string.cjs"),V=require("../CharacterCounter/useCharacterCounterState.cjs"),_=require("../TextFieldBase/TextFieldBase.cjs"),b=require("./constants.cjs"),E=require("./useAdjustHeight.cjs"),I=(e,a)=>e===!0||a!==void 0,w=e=>e===void 0?b.TEXTAREA_MAX_SAFE_LENGTH:e,F=(e,a)=>{const{onInput:x,isAutoResizing:m,autoResizingMaxHeight:v=400,counterThreshold:t,hasCounter:u,onChange:s,value:i,defaultValue:l,helperText:T,isDisabled:A,id:p,...n}=e,c=r.useRef(a),{adjustHeightOnAutoresize:C,onInput:L}=E.useAdjustHeight({elementReference:c,onInput:x,isAutoResizing:m,maxHeight:v}),R=f.normalizeStringValue(i),q=f.normalizeStringValue(l),{counterProps:H,handleChange:z}=V.useCharacterCounterState({value:R,defaultValue:q,counterThreshold:t,hasCounter:u,onChange:s}),d=I(u,t),h=d?w(n.maxLength):void 0,M=d?z:s,g=r.useRef(!1);return r.useEffect(()=>{t!==void 0&&n.maxLength!==void 0&&n.maxLength<t&&!g.current&&(g.current=!0,j.default(!1,"TextArea: `maxLength` should be greater than or equal to `counterThreshold` to keep visible counter and hard input limit aligned."))},[t,n.maxLength]),S.jsx(_.default,{id:p,isMultiline:!0,ref:c,onInput:L,onFocus:C,onChange:M,value:i,defaultValue:l,helperText:T,isDisabled:A,counterProps:H,...n,...h!==void 0&&{maxLength:h}})},o=r.forwardRef(F);o.spiritComponent="TextArea";o.displayName="TextArea";exports.default=o;
|
|
2
2
|
//# sourceMappingURL=TextArea.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.cjs","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ForwardedRef, type RefObject, forwardRef, useRef } from 'react';\nimport { type ForwardRefComponent, type SpiritTextAreaProps } from '../../types';\nimport { TextFieldBase } from '../TextFieldBase';\nimport { useAdjustHeight } from './useAdjustHeight';\n\nconst _TextArea = (props: SpiritTextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>): JSX.Element => {\n const {
|
|
1
|
+
{"version":3,"file":"TextArea.cjs","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ForwardedRef, type RefObject, forwardRef, useEffect, useRef } from 'react';\nimport { warning } from '../../common/utilities';\nimport { type ForwardRefComponent, type SpiritTextAreaProps } from '../../types';\nimport { normalizeStringValue } from '../../utils';\nimport { useCharacterCounterState } from '../CharacterCounter';\nimport { TextFieldBase } from '../TextFieldBase';\nimport { TEXTAREA_MAX_SAFE_LENGTH } from './constants';\nimport { useAdjustHeight } from './useAdjustHeight';\n\nconst isCounterActive = (hasCounter: boolean | undefined, counterThreshold: number | undefined): boolean =>\n hasCounter === true || counterThreshold !== undefined;\n\nconst resolveCounterNativeMaxLength = (consumerMaxLength: number | undefined): number =>\n consumerMaxLength === undefined ? TEXTAREA_MAX_SAFE_LENGTH : consumerMaxLength;\n\nconst _TextArea = (props: SpiritTextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>): JSX.Element => {\n const {\n onInput,\n isAutoResizing,\n autoResizingMaxHeight = 400,\n counterThreshold,\n hasCounter,\n onChange,\n value,\n defaultValue,\n helperText,\n isDisabled,\n id,\n ...restProps\n } = props;\n\n const elementReference = useRef(ref);\n const { adjustHeightOnAutoresize, onInput: onInputHandler } = useAdjustHeight({\n elementReference,\n onInput,\n isAutoResizing,\n maxHeight: autoResizingMaxHeight,\n });\n\n const normalizedValue = normalizeStringValue(value);\n const normalizedDefaultValue = normalizeStringValue(defaultValue);\n\n const { counterProps, handleChange } = useCharacterCounterState({\n value: normalizedValue,\n defaultValue: normalizedDefaultValue,\n counterThreshold,\n hasCounter,\n onChange,\n });\n\n const counterOn = isCounterActive(hasCounter, counterThreshold);\n const nativeMaxLength = counterOn ? resolveCounterNativeMaxLength(restProps.maxLength) : undefined;\n const changeHandler = counterOn ? handleChange : onChange;\n\n const didWarnMaxLengthLowerThanThresholdRef = useRef(false);\n useEffect(() => {\n if (\n counterThreshold !== undefined &&\n restProps.maxLength !== undefined &&\n restProps.maxLength < counterThreshold &&\n !didWarnMaxLengthLowerThanThresholdRef.current\n ) {\n didWarnMaxLengthLowerThanThresholdRef.current = true;\n warning(\n false,\n 'TextArea: `maxLength` should be greater than or equal to `counterThreshold` to keep visible counter and hard input limit aligned.',\n );\n }\n }, [counterThreshold, restProps.maxLength]);\n\n return (\n <TextFieldBase\n id={id}\n isMultiline\n ref={elementReference as RefObject<HTMLTextAreaElement>}\n onInput={onInputHandler}\n onFocus={adjustHeightOnAutoresize}\n onChange={changeHandler}\n value={value}\n defaultValue={defaultValue}\n helperText={helperText}\n isDisabled={isDisabled}\n counterProps={counterProps}\n {...restProps}\n {...(nativeMaxLength !== undefined && { maxLength: nativeMaxLength })}\n />\n );\n};\n\nconst TextArea = forwardRef<HTMLTextAreaElement, SpiritTextAreaProps>(_TextArea) as ForwardRefComponent<\n HTMLTextAreaElement,\n SpiritTextAreaProps\n>;\n\nTextArea.spiritComponent = 'TextArea';\nTextArea.displayName = 'TextArea';\n\nexport default TextArea;\n"],"names":["isCounterActive","hasCounter","counterThreshold","resolveCounterNativeMaxLength","consumerMaxLength","TEXTAREA_MAX_SAFE_LENGTH","_TextArea","props","ref","onInput","isAutoResizing","autoResizingMaxHeight","onChange","value","defaultValue","helperText","isDisabled","id","restProps","elementReference","useRef","adjustHeightOnAutoresize","onInputHandler","useAdjustHeight","normalizedValue","normalizeStringValue","normalizedDefaultValue","counterProps","handleChange","useCharacterCounterState","counterOn","nativeMaxLength","changeHandler","didWarnMaxLengthLowerThanThresholdRef","useEffect","warning","jsx","TextFieldBase","TextArea","forwardRef"],"mappings":"mbAWMA,EAAkB,CAACC,EAAiCC,IACxDD,IAAe,IAAQC,IAAqB,OAExCC,EAAiCC,GACrCA,IAAsB,OAAYC,EAAAA,yBAA2BD,EAEzDE,EAAY,CAACC,EAA4BC,IAAwD,CACrG,KAAM,CACJ,QAAAC,EACA,eAAAC,EACA,sBAAAC,EAAwB,IACxB,iBAAAT,EACA,WAAAD,EACA,SAAAW,EACA,MAAAC,EACA,aAAAC,EACA,WAAAC,EACA,WAAAC,EACA,GAAAC,EACA,GAAGC,CAAA,EACDX,EAEEY,EAAmBC,EAAAA,OAAOZ,CAAG,EAC7B,CAAE,yBAAAa,EAA0B,QAASC,CAAA,EAAmBC,EAAAA,gBAAgB,CAC5E,iBAAAJ,EACA,QAAAV,EACA,eAAAC,EACA,UAAWC,CAAA,CACZ,EAEKa,EAAkBC,EAAAA,qBAAqBZ,CAAK,EAC5Ca,EAAyBD,EAAAA,qBAAqBX,CAAY,EAE1D,CAAE,aAAAa,EAAc,aAAAC,CAAA,EAAiBC,2BAAyB,CAC9D,MAAOL,EACP,aAAcE,EACd,iBAAAxB,EACA,WAAAD,EACA,SAAAW,CAAA,CACD,EAEKkB,EAAY9B,EAAgBC,EAAYC,CAAgB,EACxD6B,EAAkBD,EAAY3B,EAA8Be,EAAU,SAAS,EAAI,OACnFc,EAAgBF,EAAYF,EAAehB,EAE3CqB,EAAwCb,EAAAA,OAAO,EAAK,EAC1Dc,OAAAA,EAAAA,UAAU,IAAM,CAEZhC,IAAqB,QACrBgB,EAAU,YAAc,QACxBA,EAAU,UAAYhB,GACtB,CAAC+B,EAAsC,UAEvCA,EAAsC,QAAU,GAChDE,EAAAA,QACE,GACA,mIAAA,EAGN,EAAG,CAACjC,EAAkBgB,EAAU,SAAS,CAAC,EAGxCkB,EAAAA,IAACC,EAAAA,QAAA,CACC,GAAApB,EACA,YAAW,GACX,IAAKE,EACL,QAASG,EACT,QAASD,EACT,SAAUW,EACV,MAAAnB,EACA,aAAAC,EACA,WAAAC,EACA,WAAAC,EACA,aAAAW,EACC,GAAGT,EACH,GAAIa,IAAoB,QAAa,CAAE,UAAWA,CAAA,CAAgB,CAAA,CAGzE,EAEMO,EAAWC,EAAAA,WAAqDjC,CAAS,EAK/EgC,EAAS,gBAAkB,WAC3BA,EAAS,YAAc"}
|
|
@@ -1,29 +1,65 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
x,
|
|
2
|
+
import { jsx as V } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as I, useRef as m, useEffect as _ } from "react";
|
|
4
|
+
import b from "../../common/utilities/warning.js";
|
|
5
|
+
import { normalizeStringValue as c } from "../../utils/string.js";
|
|
6
|
+
import { useCharacterCounterState as j } from "../CharacterCounter/useCharacterCounterState.js";
|
|
7
|
+
import w from "../TextFieldBase/TextFieldBase.js";
|
|
8
|
+
import { TEXTAREA_MAX_SAFE_LENGTH as F } from "./constants.js";
|
|
9
|
+
import { useAdjustHeight as N } from "./useAdjustHeight.js";
|
|
10
|
+
const S = (e, o) => e === !0 || o !== void 0, D = (e) => e === void 0 ? F : e, O = (e, o) => {
|
|
11
|
+
const {
|
|
12
|
+
onInput: g,
|
|
13
|
+
isAutoResizing: p,
|
|
14
|
+
autoResizingMaxHeight: x = 400,
|
|
15
|
+
counterThreshold: t,
|
|
16
|
+
hasCounter: r,
|
|
17
|
+
onChange: a,
|
|
18
|
+
value: i,
|
|
19
|
+
defaultValue: s,
|
|
20
|
+
helperText: T,
|
|
21
|
+
isDisabled: v,
|
|
22
|
+
id: A,
|
|
23
|
+
...n
|
|
24
|
+
} = e, u = m(o), { adjustHeightOnAutoresize: L, onInput: C } = N({
|
|
25
|
+
elementReference: u,
|
|
26
|
+
onInput: g,
|
|
27
|
+
isAutoResizing: p,
|
|
28
|
+
maxHeight: x
|
|
29
|
+
}), H = c(i), R = c(s), { counterProps: z, handleChange: E } = j({
|
|
30
|
+
value: H,
|
|
31
|
+
defaultValue: R,
|
|
32
|
+
counterThreshold: t,
|
|
33
|
+
hasCounter: r,
|
|
34
|
+
onChange: a
|
|
35
|
+
}), l = S(r, t), d = l ? D(n.maxLength) : void 0, M = l ? E : a, h = m(!1);
|
|
36
|
+
return _(() => {
|
|
37
|
+
t !== void 0 && n.maxLength !== void 0 && n.maxLength < t && !h.current && (h.current = !0, b(
|
|
38
|
+
!1,
|
|
39
|
+
"TextArea: `maxLength` should be greater than or equal to `counterThreshold` to keep visible counter and hard input limit aligned."
|
|
40
|
+
));
|
|
41
|
+
}, [t, n.maxLength]), /* @__PURE__ */ V(
|
|
42
|
+
w,
|
|
15
43
|
{
|
|
44
|
+
id: A,
|
|
16
45
|
isMultiline: !0,
|
|
17
|
-
ref:
|
|
18
|
-
onInput:
|
|
19
|
-
onFocus:
|
|
20
|
-
|
|
46
|
+
ref: u,
|
|
47
|
+
onInput: C,
|
|
48
|
+
onFocus: L,
|
|
49
|
+
onChange: M,
|
|
50
|
+
value: i,
|
|
51
|
+
defaultValue: s,
|
|
52
|
+
helperText: T,
|
|
53
|
+
isDisabled: v,
|
|
54
|
+
counterProps: z,
|
|
55
|
+
...n,
|
|
56
|
+
...d !== void 0 && { maxLength: d }
|
|
21
57
|
}
|
|
22
58
|
);
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
59
|
+
}, f = I(O);
|
|
60
|
+
f.spiritComponent = "TextArea";
|
|
61
|
+
f.displayName = "TextArea";
|
|
26
62
|
export {
|
|
27
|
-
|
|
63
|
+
f as default
|
|
28
64
|
};
|
|
29
65
|
//# sourceMappingURL=TextArea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ForwardedRef, type RefObject, forwardRef, useRef } from 'react';\nimport { type ForwardRefComponent, type SpiritTextAreaProps } from '../../types';\nimport { TextFieldBase } from '../TextFieldBase';\nimport { useAdjustHeight } from './useAdjustHeight';\n\nconst _TextArea = (props: SpiritTextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>): JSX.Element => {\n const {
|
|
1
|
+
{"version":3,"file":"TextArea.js","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ForwardedRef, type RefObject, forwardRef, useEffect, useRef } from 'react';\nimport { warning } from '../../common/utilities';\nimport { type ForwardRefComponent, type SpiritTextAreaProps } from '../../types';\nimport { normalizeStringValue } from '../../utils';\nimport { useCharacterCounterState } from '../CharacterCounter';\nimport { TextFieldBase } from '../TextFieldBase';\nimport { TEXTAREA_MAX_SAFE_LENGTH } from './constants';\nimport { useAdjustHeight } from './useAdjustHeight';\n\nconst isCounterActive = (hasCounter: boolean | undefined, counterThreshold: number | undefined): boolean =>\n hasCounter === true || counterThreshold !== undefined;\n\nconst resolveCounterNativeMaxLength = (consumerMaxLength: number | undefined): number =>\n consumerMaxLength === undefined ? TEXTAREA_MAX_SAFE_LENGTH : consumerMaxLength;\n\nconst _TextArea = (props: SpiritTextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>): JSX.Element => {\n const {\n onInput,\n isAutoResizing,\n autoResizingMaxHeight = 400,\n counterThreshold,\n hasCounter,\n onChange,\n value,\n defaultValue,\n helperText,\n isDisabled,\n id,\n ...restProps\n } = props;\n\n const elementReference = useRef(ref);\n const { adjustHeightOnAutoresize, onInput: onInputHandler } = useAdjustHeight({\n elementReference,\n onInput,\n isAutoResizing,\n maxHeight: autoResizingMaxHeight,\n });\n\n const normalizedValue = normalizeStringValue(value);\n const normalizedDefaultValue = normalizeStringValue(defaultValue);\n\n const { counterProps, handleChange } = useCharacterCounterState({\n value: normalizedValue,\n defaultValue: normalizedDefaultValue,\n counterThreshold,\n hasCounter,\n onChange,\n });\n\n const counterOn = isCounterActive(hasCounter, counterThreshold);\n const nativeMaxLength = counterOn ? resolveCounterNativeMaxLength(restProps.maxLength) : undefined;\n const changeHandler = counterOn ? handleChange : onChange;\n\n const didWarnMaxLengthLowerThanThresholdRef = useRef(false);\n useEffect(() => {\n if (\n counterThreshold !== undefined &&\n restProps.maxLength !== undefined &&\n restProps.maxLength < counterThreshold &&\n !didWarnMaxLengthLowerThanThresholdRef.current\n ) {\n didWarnMaxLengthLowerThanThresholdRef.current = true;\n warning(\n false,\n 'TextArea: `maxLength` should be greater than or equal to `counterThreshold` to keep visible counter and hard input limit aligned.',\n );\n }\n }, [counterThreshold, restProps.maxLength]);\n\n return (\n <TextFieldBase\n id={id}\n isMultiline\n ref={elementReference as RefObject<HTMLTextAreaElement>}\n onInput={onInputHandler}\n onFocus={adjustHeightOnAutoresize}\n onChange={changeHandler}\n value={value}\n defaultValue={defaultValue}\n helperText={helperText}\n isDisabled={isDisabled}\n counterProps={counterProps}\n {...restProps}\n {...(nativeMaxLength !== undefined && { maxLength: nativeMaxLength })}\n />\n );\n};\n\nconst TextArea = forwardRef<HTMLTextAreaElement, SpiritTextAreaProps>(_TextArea) as ForwardRefComponent<\n HTMLTextAreaElement,\n SpiritTextAreaProps\n>;\n\nTextArea.spiritComponent = 'TextArea';\nTextArea.displayName = 'TextArea';\n\nexport default TextArea;\n"],"names":["isCounterActive","hasCounter","counterThreshold","resolveCounterNativeMaxLength","consumerMaxLength","TEXTAREA_MAX_SAFE_LENGTH","_TextArea","props","ref","onInput","isAutoResizing","autoResizingMaxHeight","onChange","value","defaultValue","helperText","isDisabled","id","restProps","elementReference","useRef","adjustHeightOnAutoresize","onInputHandler","useAdjustHeight","normalizedValue","normalizeStringValue","normalizedDefaultValue","counterProps","handleChange","useCharacterCounterState","counterOn","nativeMaxLength","changeHandler","didWarnMaxLengthLowerThanThresholdRef","useEffect","warning","jsx","TextFieldBase","TextArea","forwardRef"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAkB,CAACC,GAAiCC,MACxDD,MAAe,MAAQC,MAAqB,QAExCC,IAAgC,CAACC,MACrCA,MAAsB,SAAYC,IAA2BD,GAEzDE,IAAY,CAACC,GAA4BC,MAAwD;AACrG,QAAM;AAAA,IACJ,SAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,uBAAAC,IAAwB;AAAA,IACxB,kBAAAT;AAAA,IACA,YAAAD;AAAA,IACA,UAAAW;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,IAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDX,GAEEY,IAAmBC,EAAOZ,CAAG,GAC7B,EAAE,0BAAAa,GAA0B,SAASC,EAAA,IAAmBC,EAAgB;AAAA,IAC5E,kBAAAJ;AAAA,IACA,SAAAV;AAAA,IACA,gBAAAC;AAAA,IACA,WAAWC;AAAA,EAAA,CACZ,GAEKa,IAAkBC,EAAqBZ,CAAK,GAC5Ca,IAAyBD,EAAqBX,CAAY,GAE1D,EAAE,cAAAa,GAAc,cAAAC,EAAA,IAAiBC,EAAyB;AAAA,IAC9D,OAAOL;AAAA,IACP,cAAcE;AAAA,IACd,kBAAAxB;AAAA,IACA,YAAAD;AAAA,IACA,UAAAW;AAAA,EAAA,CACD,GAEKkB,IAAY9B,EAAgBC,GAAYC,CAAgB,GACxD6B,IAAkBD,IAAY3B,EAA8Be,EAAU,SAAS,IAAI,QACnFc,IAAgBF,IAAYF,IAAehB,GAE3CqB,IAAwCb,EAAO,EAAK;AAC1D,SAAAc,EAAU,MAAM;AACd,IACEhC,MAAqB,UACrBgB,EAAU,cAAc,UACxBA,EAAU,YAAYhB,KACtB,CAAC+B,EAAsC,YAEvCA,EAAsC,UAAU,IAChDE;AAAA,MACE;AAAA,MACA;AAAA,IAAA;AAAA,EAGN,GAAG,CAACjC,GAAkBgB,EAAU,SAAS,CAAC,GAGxC,gBAAAkB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAApB;AAAA,MACA,aAAW;AAAA,MACX,KAAKE;AAAA,MACL,SAASG;AAAA,MACT,SAASD;AAAA,MACT,UAAUW;AAAA,MACV,OAAAnB;AAAA,MACA,cAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAW;AAAA,MACC,GAAGT;AAAA,MACH,GAAIa,MAAoB,UAAa,EAAE,WAAWA,EAAA;AAAA,IAAgB;AAAA,EAAA;AAGzE,GAEMO,IAAWC,EAAqDjC,CAAS;AAK/EgC,EAAS,kBAAkB;AAC3BA,EAAS,cAAc;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.cjs","sources":["../../../src/components/TextArea/constants.ts"],"sourcesContent":["// Default/fallback native maxLength when the character counter is enabled and no consumer maxLength is provided.\n// Helps prevent pathological input length in the browser without capping explicit consumer-provided maxLength values.\nexport const TEXTAREA_MAX_SAFE_LENGTH = 10000;\n"],"names":["TEXTAREA_MAX_SAFE_LENGTH"],"mappings":"gFAEO,MAAMA,EAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TEXTAREA_MAX_SAFE_LENGTH = 10000;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../src/components/TextArea/constants.ts"],"sourcesContent":["// Default/fallback native maxLength when the character counter is enabled and no consumer maxLength is provided.\n// Helps prevent pathological input length in the browser without capping explicit consumer-provided maxLength values.\nexport const TEXTAREA_MAX_SAFE_LENGTH = 10000;\n"],"names":["TEXTAREA_MAX_SAFE_LENGTH"],"mappings":"AAEO,MAAMA,IAA2B;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),j=require("classnames"),x=require("react"),B=require("../../constants/dictionaries.cjs"),_=require("../../hooks/styleProps.cjs"),v=require("../../hooks/useAriaIdRefs.cjs"),A=require("../CharacterCounter/CharacterCounter.cjs"),E=require("../Field/HelperText.cjs"),R=require("../Field/Label.cjs"),w=require("../Field/ValidationText.cjs"),I=require("../Field/useValidationTextRole.cjs"),U=require("../Flex/Flex.cjs"),V=require("./TextFieldBaseInput.cjs"),C=require("./useTextFieldBaseStyleProps.cjs"),D=require("./withPasswordToggle.cjs"),M=x.forwardRef(D.default(V.default)),z=(T,m)=>{const{"aria-describedby":h="",counterProps:i,hasValidationIcon:f,helperText:n,id:t,label:q,size:c=B.Sizes.MEDIUM,validationState:s,validationText:a,...F}=T,{classProps:r,props:P}=C.useTextFieldBaseStyleProps({id:t,size:c,validationState:s,...F}),{styleProps:d,props:g}=_.useStyleProps(P),[y,o]=v.useAriaDescribedBy(h),N=I.useValidationTextRole({validationState:s,validationText:a}),S=n||s&&a,u=e.jsx(E.default,{UNSAFE_className:r.helperText,id:`${t}__helper-text`,registerAria:o,helperText:n}),p=s?e.jsx(w.default,{UNSAFE_className:r.validationText,elementType:"span",...f&&{hasValidationStateIcon:s},id:`${t}__validation-text`,validationText:a,registerAria:o,role:N}):null,b=i?e.jsx(A.default,{...i,id:t,registerAria:o,UNSAFE_className:r.counter}):null;return e.jsxs("div",{...d,className:j(r.root,d.className),children:[e.jsx(R.default,{htmlFor:t,UNSAFE_className:r.label,children:q}),e.jsx(M,{...g,...y,id:t,ref:m,size:c}),i?e.jsxs(U.default,{direction:"horizontal",isWrapping:!1,alignmentX:"space-between",alignmentY:"top",children:[S?e.jsxs("div",{children:[p,u]}):null,b]}):e.jsxs(e.Fragment,{children:[u,p]})]})},l=x.forwardRef(z);l.spiritComponent="TextFieldBase";l.displayName="TextFieldBase";exports.default=l;
|
|
2
2
|
//# sourceMappingURL=TextFieldBase.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldBase.cjs","sources":["../../../src/components/TextFieldBase/TextFieldBase.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 {\n type ForwardRefComponent,\n type SpiritTextFieldBaseProps,\n type TextFieldBasePasswordToggleProps,\n} from '../../types';\nimport { HelperText, Label, ValidationText
|
|
1
|
+
{"version":3,"file":"TextFieldBase.cjs","sources":["../../../src/components/TextFieldBase/TextFieldBase.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 {\n type ForwardRefComponent,\n type SpiritTextFieldBaseProps,\n type TextFieldBasePasswordToggleProps,\n} from '../../types';\nimport { CharacterCounter } from '../CharacterCounter';\nimport { HelperText, Label, ValidationText } from '../Field';\nimport { useValidationTextRole } from '../Field/useValidationTextRole';\nimport { Flex } from '../Flex';\nimport TextFieldBaseInput from './TextFieldBaseInput';\nimport { useTextFieldBaseStyleProps } from './useTextFieldBaseStyleProps';\nimport withPasswordToggle from './withPasswordToggle';\n\nconst TextFieldBaseInputWithPasswordToggle = forwardRef(\n withPasswordToggle<TextFieldBasePasswordToggleProps>(TextFieldBaseInput),\n);\n\nconst _TextFieldBase = (props: SpiritTextFieldBaseProps, ref: ForwardedRef<HTMLInputElement | HTMLTextAreaElement>) => {\n const {\n 'aria-describedby': ariaDescribedBy = '',\n counterProps,\n hasValidationIcon,\n helperText,\n id,\n label,\n size = Sizes.MEDIUM,\n validationState,\n validationText,\n ...restProps\n } = props;\n const { classProps, props: modifiedProps } = useTextFieldBaseStyleProps({\n id,\n size,\n validationState,\n ...restProps,\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 hasTextContent = helperText || (validationState && validationText);\n\n const helperTextElement = (\n <HelperText\n UNSAFE_className={classProps.helperText}\n id={`${id}__helper-text`}\n registerAria={register}\n helperText={helperText}\n />\n );\n\n const validationTextElement = validationState ? (\n <ValidationText\n UNSAFE_className={classProps.validationText}\n elementType=\"span\"\n {...(hasValidationIcon && { hasValidationStateIcon: validationState })}\n id={`${id}__validation-text`}\n validationText={validationText}\n registerAria={register}\n role={validationTextRole}\n />\n ) : null;\n\n const counterElement = counterProps ? (\n <CharacterCounter {...counterProps} id={id} registerAria={register} UNSAFE_className={classProps.counter} />\n ) : null;\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 <TextFieldBaseInputWithPasswordToggle {...otherProps} {...ariaDescribedByProp} id={id} ref={ref} size={size} />\n {counterProps ? (\n <Flex direction=\"horizontal\" isWrapping={false} alignmentX=\"space-between\" alignmentY=\"top\">\n {hasTextContent ? (\n <div>\n {/* In counter layout, put validation first so the status message stays visually closest to the counter row. */}\n {validationTextElement}\n {helperTextElement}\n </div>\n ) : null}\n {counterElement}\n </Flex>\n ) : (\n <>\n {/* Without counter, keep the default field text flow: helper first, then validation. */}\n {helperTextElement}\n {validationTextElement}\n </>\n )}\n </div>\n );\n};\n\nconst TextFieldBase = forwardRef<HTMLInputElement | HTMLTextAreaElement, SpiritTextFieldBaseProps>(\n _TextFieldBase,\n) as ForwardRefComponent<HTMLInputElement | HTMLTextAreaElement, SpiritTextFieldBaseProps>;\n\nTextFieldBase.spiritComponent = 'TextFieldBase';\nTextFieldBase.displayName = 'TextFieldBase';\n\nexport default TextFieldBase;\n"],"names":["TextFieldBaseInputWithPasswordToggle","forwardRef","withPasswordToggle","TextFieldBaseInput","_TextFieldBase","props","ref","ariaDescribedBy","counterProps","hasValidationIcon","helperText","id","label","size","Sizes","validationState","validationText","restProps","classProps","modifiedProps","useTextFieldBaseStyleProps","styleProps","otherProps","useStyleProps","ariaDescribedByProp","register","useAriaDescribedBy","validationTextRole","useValidationTextRole","hasTextContent","helperTextElement","jsx","HelperText","validationTextElement","ValidationText","counterElement","CharacterCounter","jsxs","classNames","Label","Flex","Fragment","TextFieldBase"],"mappings":"srBAmBMA,EAAuCC,EAAAA,WAC3CC,EAAAA,QAAqDC,EAAAA,OAAkB,CACzE,EAEMC,EAAiB,CAACC,EAAiCC,IAA8D,CACrH,KAAM,CACJ,mBAAoBC,EAAkB,GACtC,aAAAC,EACA,kBAAAC,EACA,WAAAC,EACA,GAAAC,EACA,MAAAC,EACA,KAAAC,EAAOC,EAAAA,MAAM,OACb,gBAAAC,EACA,eAAAC,EACA,GAAGC,CAAA,EACDZ,EACE,CAAE,WAAAa,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,2BAA2B,CACtE,GAAAT,EACA,KAAAE,EACA,gBAAAE,EACA,GAAGE,CAAA,CACJ,EACK,CAAA,WAAEI,EAAY,MAAOC,CAAA,EAAeC,EAAAA,cAAcJ,CAAa,EAC/D,CAACK,EAAqBC,CAAQ,EAAIC,EAAAA,mBAAmBnB,CAAe,EACpEoB,EAAqBC,EAAAA,sBAAsB,CAC/C,gBAAAb,EACA,eAAAC,CAAA,CACD,EAEKa,EAAiBnB,GAAeK,GAAmBC,EAEnDc,EACJC,EAAAA,IAACC,EAAAA,QAAA,CACC,iBAAkBd,EAAW,WAC7B,GAAI,GAAGP,CAAE,gBACT,aAAcc,EACd,WAAAf,CAAA,CAAA,EAIEuB,EAAwBlB,EAC5BgB,EAAAA,IAACG,EAAAA,QAAA,CACC,iBAAkBhB,EAAW,eAC7B,YAAY,OACX,GAAIT,GAAqB,CAAE,uBAAwBM,CAAA,EACpD,GAAI,GAAGJ,CAAE,oBACT,eAAAK,EACA,aAAcS,EACd,KAAME,CAAA,CAAA,EAEN,KAEEQ,EAAiB3B,EACrBuB,EAAAA,IAACK,EAAAA,QAAA,CAAkB,GAAG5B,EAAc,GAAAG,EAAQ,aAAcc,EAAU,iBAAkBP,EAAW,OAAA,CAAS,EACxG,KAEJ,OACEmB,OAAC,MAAA,CAAK,GAAGhB,EAAY,UAAWiB,EAAWpB,EAAW,KAAMG,EAAW,SAAS,EAC9E,SAAA,CAAAU,MAACQ,EAAAA,SAAM,QAAS5B,EAAI,iBAAkBO,EAAW,MAC9C,SAAAN,EACH,EACAmB,MAAC/B,GAAsC,GAAGsB,EAAa,GAAGE,EAAqB,GAAAb,EAAQ,IAAAL,EAAU,KAAAO,EAAY,EAC5GL,EACC6B,EAAAA,KAACG,EAAAA,QAAA,CAAK,UAAU,aAAa,WAAY,GAAO,WAAW,gBAAgB,WAAW,MACnF,SAAA,CAAAX,SACE,MAAA,CAEE,SAAA,CAAAI,EACAH,CAAA,CAAA,CACH,EACE,KACHK,CAAA,CAAA,CACH,EAEAE,EAAAA,KAAAI,EAAAA,SAAA,CAEG,SAAA,CAAAX,EACAG,CAAA,CAAA,CACH,CAAA,EAEJ,CAEJ,EAEMS,EAAgBzC,EAAAA,WACpBG,CACF,EAEAsC,EAAc,gBAAkB,gBAChCA,EAAc,YAAc"}
|