@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,29 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as a, jsx as s } from "react/jsx-runtime";
|
|
3
|
-
import p from "classnames";
|
|
4
|
-
import { useStyleProps as c } from "../../hooks/styleProps.js";
|
|
5
|
-
import l from "../Icon/Icon.js";
|
|
6
|
-
import u from "../VisuallyHidden/VisuallyHidden.js";
|
|
7
|
-
import { useAttachmentStyleProps as d } from "./useAttachmentStyleProps.js";
|
|
8
|
-
const o = (r) => {
|
|
9
|
-
const { children: e, ...m } = r, { classProps: n } = d(), { styleProps: t, props: i } = c(m);
|
|
10
|
-
return /* @__PURE__ */ a(
|
|
11
|
-
"button",
|
|
12
|
-
{
|
|
13
|
-
type: "button",
|
|
14
|
-
...i,
|
|
15
|
-
...t,
|
|
16
|
-
className: p(n.button, t.className),
|
|
17
|
-
children: [
|
|
18
|
-
/* @__PURE__ */ s(u, { children: e }),
|
|
19
|
-
/* @__PURE__ */ s(l, { name: "close", "aria-hidden": "true" })
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
o.spiritComponent = "UNSTABLE_AttachmentDismissButton";
|
|
25
|
-
o.displayName = "UNSTABLE_AttachmentDismissButton";
|
|
26
|
-
export {
|
|
27
|
-
o as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=UNSTABLE_AttachmentDismissButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UNSTABLE_AttachmentDismissButton.js","sources":["../../../src/components/UNSTABLE_Attachment/UNSTABLE_AttachmentDismissButton.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useStyleProps } from '../../hooks';\nimport { Icon } from '../Icon';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { type SpiritUnstableAttachmentDismissButtonProps } from './types';\nimport { useAttachmentStyleProps } from './useAttachmentStyleProps';\n\nconst UNSTABLE_AttachmentDismissButton = (props: SpiritUnstableAttachmentDismissButtonProps) => {\n const { children, ...restProps } = props;\n const { classProps } = useAttachmentStyleProps();\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n\n return (\n <button\n type=\"button\"\n {...transferProps}\n {...styleProps}\n className={classNames(classProps.button, styleProps.className)}\n >\n <VisuallyHidden>{children}</VisuallyHidden>\n <Icon name=\"close\" aria-hidden=\"true\" />\n </button>\n );\n};\n\nUNSTABLE_AttachmentDismissButton.spiritComponent = 'UNSTABLE_AttachmentDismissButton';\nUNSTABLE_AttachmentDismissButton.displayName = 'UNSTABLE_AttachmentDismissButton';\n\nexport default UNSTABLE_AttachmentDismissButton;\n"],"names":["UNSTABLE_AttachmentDismissButton","props","children","restProps","classProps","useAttachmentStyleProps","styleProps","transferProps","useStyleProps","jsxs","classNames","jsx","VisuallyHidden","Icon"],"mappings":";;;;;;;AAUA,MAAMA,IAAmC,CAACC,MAAsD;AAC9F,QAAM,EAAE,UAAAC,GAAU,GAAGC,EAAA,IAAcF,GAC7B,EAAE,YAAAG,EAAA,IAAeC,EAAA,GACjB,EAAE,YAAAC,GAAY,OAAOC,EAAA,IAAkBC,EAAcL,CAAS;AAEpE,SACE,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACJ,GAAGF;AAAA,MACH,GAAGD;AAAA,MACJ,WAAWI,EAAWN,EAAW,QAAQE,EAAW,SAAS;AAAA,MAE7D,UAAA;AAAA,QAAA,gBAAAK,EAACC,KAAgB,UAAAV,GAAS;AAAA,QAC1B,gBAAAS,EAACE,GAAA,EAAK,MAAK,SAAQ,eAAY,OAAA,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG5C;AAEAb,EAAiC,kBAAkB;AACnDA,EAAiC,cAAc;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),S=require("classnames"),g=require("../../constants/media.cjs"),y=require("../../hooks/styleProps.cjs"),a=require("./constants.cjs"),N=require("./useAttachmentStyleProps.cjs"),h={meta:void 0,imageObjectFit:g.ObjectFit.COVER},t=o=>{const i={...h,...o},{label:c,imagePreview:n,meta:l,imageObjectFit:m,...u}=i,{classProps:e}=N.useAttachmentStyleProps({meta:l,imageObjectFit:m}),p=e.imageCropStyles??{},A=e.attachmentStyles??{},{styleProps:s,props:P}=y.useStyleProps(u);return r.jsx("span",{...P,...s,className:S(e.image,s.className),children:r.jsx("img",{src:n,width:a.DEFAULT_ATTACHMENT_IMAGE_DIMENSION,height:a.DEFAULT_ATTACHMENT_IMAGE_DIMENSION,alt:c,style:{...p,...A}})})};t.spiritComponent="UNSTABLE_AttachmentImagePreview";t.displayName="UNSTABLE_AttachmentImagePreview";exports.default=t;
|
|
2
|
-
//# sourceMappingURL=UNSTABLE_AttachmentImagePreview.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UNSTABLE_AttachmentImagePreview.cjs","sources":["../../../src/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { ObjectFit } from '../../constants';\nimport { useStyleProps } from '../../hooks';\nimport { DEFAULT_ATTACHMENT_IMAGE_DIMENSION } from './constants';\nimport { type SpiritUnstableAttachmentImagePreviewProps } from './types';\nimport { useAttachmentStyleProps } from './useAttachmentStyleProps';\n\nconst defaultProps: Partial<SpiritUnstableAttachmentImagePreviewProps> = {\n meta: undefined,\n imageObjectFit: ObjectFit.COVER,\n};\n\nconst UNSTABLE_AttachmentImagePreview = (props: SpiritUnstableAttachmentImagePreviewProps) => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { label, imagePreview, meta, imageObjectFit, ...restProps } = propsWithDefaults;\n const { classProps } = useAttachmentStyleProps({ meta, imageObjectFit });\n const imageCropStyles = classProps.imageCropStyles ?? {};\n const attachmentStyles = classProps.attachmentStyles ?? {};\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n\n return (\n <span {...transferProps} {...styleProps} className={classNames(classProps.image, styleProps.className)}>\n <img\n src={imagePreview}\n width={DEFAULT_ATTACHMENT_IMAGE_DIMENSION}\n height={DEFAULT_ATTACHMENT_IMAGE_DIMENSION}\n alt={label}\n style={{ ...imageCropStyles, ...attachmentStyles }}\n />\n </span>\n );\n};\n\nUNSTABLE_AttachmentImagePreview.spiritComponent = 'UNSTABLE_AttachmentImagePreview';\nUNSTABLE_AttachmentImagePreview.displayName = 'UNSTABLE_AttachmentImagePreview';\n\nexport default UNSTABLE_AttachmentImagePreview;\n"],"names":["defaultProps","ObjectFit","UNSTABLE_AttachmentImagePreview","props","propsWithDefaults","label","imagePreview","meta","imageObjectFit","restProps","classProps","useAttachmentStyleProps","imageCropStyles","attachmentStyles","styleProps","transferProps","useStyleProps","jsx","classNames","DEFAULT_ATTACHMENT_IMAGE_DIMENSION"],"mappings":"6UAUMA,EAAmE,CACvE,KAAM,OACN,eAAgBC,EAAAA,UAAU,KAC5B,EAEMC,EAAmCC,GAAqD,CAC5F,MAAMC,EAAoB,CAAE,GAAGJ,EAAc,GAAGG,CAAA,EAC1C,CAAE,MAAAE,EAAO,aAAAC,EAAc,KAAAC,EAAM,eAAAC,EAAgB,GAAGC,GAAcL,EAC9D,CAAE,WAAAM,CAAA,EAAeC,EAAAA,wBAAwB,CAAE,KAAAJ,EAAM,eAAAC,EAAgB,EACjEI,EAAkBF,EAAW,iBAAmB,CAAA,EAChDG,EAAmBH,EAAW,kBAAoB,CAAA,EAClD,CAAA,WAAEI,EAAY,MAAOC,CAAA,EAAkBC,EAAAA,cAAcP,CAAS,EAEpE,OACEQ,EAAAA,IAAC,OAAA,CAAM,GAAGF,EAAgB,GAAGD,EAAY,UAAWI,EAAWR,EAAW,MAAOI,EAAW,SAAS,EACnG,SAAAG,EAAAA,IAAC,MAAA,CACC,IAAKX,EACL,MAAOa,EAAAA,mCACP,OAAQA,EAAAA,mCACR,IAAKd,EACL,MAAO,CAAE,GAAGO,EAAiB,GAAGC,CAAA,CAAiB,CAAA,EAErD,CAEJ,EAEAX,EAAgC,gBAAkB,kCAClDA,EAAgC,YAAc"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { SpiritUnstableAttachmentImagePreviewProps } from './types';
|
|
3
|
-
declare const UNSTABLE_AttachmentImagePreview: {
|
|
4
|
-
(props: SpiritUnstableAttachmentImagePreviewProps): React.JSX.Element;
|
|
5
|
-
spiritComponent: string;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export default UNSTABLE_AttachmentImagePreview;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
-
import P from "classnames";
|
|
4
|
-
import { ObjectFit as f } from "../../constants/media.js";
|
|
5
|
-
import { useStyleProps as N } from "../../hooks/styleProps.js";
|
|
6
|
-
import { DEFAULT_ATTACHMENT_IMAGE_DIMENSION as r } from "./constants.js";
|
|
7
|
-
import { useAttachmentStyleProps as S } from "./useAttachmentStyleProps.js";
|
|
8
|
-
const y = {
|
|
9
|
-
meta: void 0,
|
|
10
|
-
imageObjectFit: f.COVER
|
|
11
|
-
}, a = (m) => {
|
|
12
|
-
const o = { ...y, ...m }, { label: i, imagePreview: c, meta: p, imageObjectFit: l, ...n } = o, { classProps: t } = S({ meta: p, imageObjectFit: l }), g = t.imageCropStyles ?? {}, h = t.attachmentStyles ?? {}, { styleProps: e, props: A } = N(n);
|
|
13
|
-
return /* @__PURE__ */ s("span", { ...A, ...e, className: P(t.image, e.className), children: /* @__PURE__ */ s(
|
|
14
|
-
"img",
|
|
15
|
-
{
|
|
16
|
-
src: c,
|
|
17
|
-
width: r,
|
|
18
|
-
height: r,
|
|
19
|
-
alt: i,
|
|
20
|
-
style: { ...g, ...h }
|
|
21
|
-
}
|
|
22
|
-
) });
|
|
23
|
-
};
|
|
24
|
-
a.spiritComponent = "UNSTABLE_AttachmentImagePreview";
|
|
25
|
-
a.displayName = "UNSTABLE_AttachmentImagePreview";
|
|
26
|
-
export {
|
|
27
|
-
a as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=UNSTABLE_AttachmentImagePreview.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UNSTABLE_AttachmentImagePreview.js","sources":["../../../src/components/UNSTABLE_Attachment/UNSTABLE_AttachmentImagePreview.tsx"],"sourcesContent":["'use client';\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport { ObjectFit } from '../../constants';\nimport { useStyleProps } from '../../hooks';\nimport { DEFAULT_ATTACHMENT_IMAGE_DIMENSION } from './constants';\nimport { type SpiritUnstableAttachmentImagePreviewProps } from './types';\nimport { useAttachmentStyleProps } from './useAttachmentStyleProps';\n\nconst defaultProps: Partial<SpiritUnstableAttachmentImagePreviewProps> = {\n meta: undefined,\n imageObjectFit: ObjectFit.COVER,\n};\n\nconst UNSTABLE_AttachmentImagePreview = (props: SpiritUnstableAttachmentImagePreviewProps) => {\n const propsWithDefaults = { ...defaultProps, ...props };\n const { label, imagePreview, meta, imageObjectFit, ...restProps } = propsWithDefaults;\n const { classProps } = useAttachmentStyleProps({ meta, imageObjectFit });\n const imageCropStyles = classProps.imageCropStyles ?? {};\n const attachmentStyles = classProps.attachmentStyles ?? {};\n const { styleProps, props: transferProps } = useStyleProps(restProps);\n\n return (\n <span {...transferProps} {...styleProps} className={classNames(classProps.image, styleProps.className)}>\n <img\n src={imagePreview}\n width={DEFAULT_ATTACHMENT_IMAGE_DIMENSION}\n height={DEFAULT_ATTACHMENT_IMAGE_DIMENSION}\n alt={label}\n style={{ ...imageCropStyles, ...attachmentStyles }}\n />\n </span>\n );\n};\n\nUNSTABLE_AttachmentImagePreview.spiritComponent = 'UNSTABLE_AttachmentImagePreview';\nUNSTABLE_AttachmentImagePreview.displayName = 'UNSTABLE_AttachmentImagePreview';\n\nexport default UNSTABLE_AttachmentImagePreview;\n"],"names":["defaultProps","ObjectFit","UNSTABLE_AttachmentImagePreview","props","propsWithDefaults","label","imagePreview","meta","imageObjectFit","restProps","classProps","useAttachmentStyleProps","imageCropStyles","attachmentStyles","styleProps","transferProps","useStyleProps","jsx","classNames","DEFAULT_ATTACHMENT_IMAGE_DIMENSION"],"mappings":";;;;;;;AAUA,MAAMA,IAAmE;AAAA,EACvE,MAAM;AAAA,EACN,gBAAgBC,EAAU;AAC5B,GAEMC,IAAkC,CAACC,MAAqD;AAC5F,QAAMC,IAAoB,EAAE,GAAGJ,GAAc,GAAGG,EAAA,GAC1C,EAAE,OAAAE,GAAO,cAAAC,GAAc,MAAAC,GAAM,gBAAAC,GAAgB,GAAGC,MAAcL,GAC9D,EAAE,YAAAM,EAAA,IAAeC,EAAwB,EAAE,MAAAJ,GAAM,gBAAAC,GAAgB,GACjEI,IAAkBF,EAAW,mBAAmB,CAAA,GAChDG,IAAmBH,EAAW,oBAAoB,CAAA,GAClD,EAAE,YAAAI,GAAY,OAAOC,EAAA,IAAkBC,EAAcP,CAAS;AAEpE,SACE,gBAAAQ,EAAC,QAAA,EAAM,GAAGF,GAAgB,GAAGD,GAAY,WAAWI,EAAWR,EAAW,OAAOI,EAAW,SAAS,GACnG,UAAA,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAKX;AAAA,MACL,OAAOa;AAAA,MACP,QAAQA;AAAA,MACR,KAAKd;AAAA,MACL,OAAO,EAAE,GAAGO,GAAiB,GAAGC,EAAA;AAAA,IAAiB;AAAA,EAAA,GAErD;AAEJ;AAEAX,EAAgC,kBAAkB;AAClDA,EAAgC,cAAc;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=54,T="file",e="edit",A={TOP:"--file-uploader-attachment-image-top",LEFT:"--file-uploader-attachment-image-left",WIDTH:"--file-uploader-attachment-image-width",HEIGHT:"--file-uploader-attachment-image-height"};exports.AttachmentCropCSS=A;exports.DEFAULT_ATTACHMENT_ACTION_BUTTON_ICON_NAME=e;exports.DEFAULT_ATTACHMENT_ICON_NAME=T;exports.DEFAULT_ATTACHMENT_IMAGE_DIMENSION=t;
|
|
2
|
-
//# sourceMappingURL=constants.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","sources":["../../../src/components/UNSTABLE_Attachment/constants.ts"],"sourcesContent":["export const DEFAULT_ATTACHMENT_IMAGE_DIMENSION = 54; // px; @see: Attachment image dimension defined in _FileUploaderAttachment.scss\n\nexport const DEFAULT_ATTACHMENT_ICON_NAME = 'file';\n\nexport const DEFAULT_ATTACHMENT_ACTION_BUTTON_ICON_NAME = 'edit';\n\nexport const AttachmentCropCSS = {\n TOP: '--file-uploader-attachment-image-top',\n LEFT: '--file-uploader-attachment-image-left',\n WIDTH: '--file-uploader-attachment-image-width',\n HEIGHT: '--file-uploader-attachment-image-height',\n} as const;\n"],"names":["DEFAULT_ATTACHMENT_IMAGE_DIMENSION","DEFAULT_ATTACHMENT_ICON_NAME","DEFAULT_ATTACHMENT_ACTION_BUTTON_ICON_NAME","AttachmentCropCSS"],"mappings":"gFAAO,MAAMA,EAAqC,GAErCC,EAA+B,OAE/BC,EAA6C,OAE7CC,EAAoB,CAC/B,IAAK,uCACL,KAAM,wCACN,MAAO,yCACP,OAAQ,yCACV"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_ATTACHMENT_IMAGE_DIMENSION = 54;
|
|
2
|
-
export declare const DEFAULT_ATTACHMENT_ICON_NAME = "file";
|
|
3
|
-
export declare const DEFAULT_ATTACHMENT_ACTION_BUTTON_ICON_NAME = "edit";
|
|
4
|
-
export declare const AttachmentCropCSS: {
|
|
5
|
-
readonly TOP: "--file-uploader-attachment-image-top";
|
|
6
|
-
readonly LEFT: "--file-uploader-attachment-image-left";
|
|
7
|
-
readonly WIDTH: "--file-uploader-attachment-image-width";
|
|
8
|
-
readonly HEIGHT: "--file-uploader-attachment-image-height";
|
|
9
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const t = 54, e = "file", T = "edit", a = {
|
|
2
|
-
TOP: "--file-uploader-attachment-image-top",
|
|
3
|
-
LEFT: "--file-uploader-attachment-image-left",
|
|
4
|
-
WIDTH: "--file-uploader-attachment-image-width",
|
|
5
|
-
HEIGHT: "--file-uploader-attachment-image-height"
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
a as AttachmentCropCSS,
|
|
9
|
-
T as DEFAULT_ATTACHMENT_ACTION_BUTTON_ICON_NAME,
|
|
10
|
-
e as DEFAULT_ATTACHMENT_ICON_NAME,
|
|
11
|
-
t as DEFAULT_ATTACHMENT_IMAGE_DIMENSION
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../src/components/UNSTABLE_Attachment/constants.ts"],"sourcesContent":["export const DEFAULT_ATTACHMENT_IMAGE_DIMENSION = 54; // px; @see: Attachment image dimension defined in _FileUploaderAttachment.scss\n\nexport const DEFAULT_ATTACHMENT_ICON_NAME = 'file';\n\nexport const DEFAULT_ATTACHMENT_ACTION_BUTTON_ICON_NAME = 'edit';\n\nexport const AttachmentCropCSS = {\n TOP: '--file-uploader-attachment-image-top',\n LEFT: '--file-uploader-attachment-image-left',\n WIDTH: '--file-uploader-attachment-image-width',\n HEIGHT: '--file-uploader-attachment-image-height',\n} as const;\n"],"names":["DEFAULT_ATTACHMENT_IMAGE_DIMENSION","DEFAULT_ATTACHMENT_ICON_NAME","DEFAULT_ATTACHMENT_ACTION_BUTTON_ICON_NAME","AttachmentCropCSS"],"mappings":"AAAO,MAAMA,IAAqC,IAErCC,IAA+B,QAE/BC,IAA6C,QAE7CC,IAAoB;AAAA,EAC/B,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./UNSTABLE_Attachment.cjs"),A=require("./UNSTABLE_AttachmentActionButton.cjs"),T=require("./UNSTABLE_AttachmentDismissButton.cjs"),n=require("./UNSTABLE_AttachmentImagePreview.cjs"),s=require("./useAttachmentImageStyles.cjs"),N=require("./useAttachmentStyleProps.cjs"),t=require("./constants.cjs");exports.UNSTABLE_Attachment=e.default;exports.UNSTABLE_AttachmentActionButton=A.default;exports.UNSTABLE_AttachmentDismissButton=T.default;exports.UNSTABLE_AttachmentImagePreview=n.default;exports.useAttachmentImageStyles=s.useAttachmentImageStyles;exports.useAttachmentStyleProps=N.useAttachmentStyleProps;exports.AttachmentCropCSS=t.AttachmentCropCSS;exports.DEFAULT_ATTACHMENT_ACTION_BUTTON_ICON_NAME=t.DEFAULT_ATTACHMENT_ACTION_BUTTON_ICON_NAME;exports.DEFAULT_ATTACHMENT_ICON_NAME=t.DEFAULT_ATTACHMENT_ICON_NAME;exports.DEFAULT_ATTACHMENT_IMAGE_DIMENSION=t.DEFAULT_ATTACHMENT_IMAGE_DIMENSION;
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { default as UNSTABLE_Attachment } from './UNSTABLE_Attachment';
|
|
2
|
-
export { default as UNSTABLE_AttachmentActionButton } from './UNSTABLE_AttachmentActionButton';
|
|
3
|
-
export { default as UNSTABLE_AttachmentDismissButton } from './UNSTABLE_AttachmentDismissButton';
|
|
4
|
-
export { default as UNSTABLE_AttachmentImagePreview } from './UNSTABLE_AttachmentImagePreview';
|
|
5
|
-
export * from './useAttachmentImageStyles';
|
|
6
|
-
export * from './useAttachmentStyleProps';
|
|
7
|
-
export * from './constants';
|
|
8
|
-
export * from './types';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { default as A } from "./UNSTABLE_Attachment.js";
|
|
2
|
-
import { default as T } from "./UNSTABLE_AttachmentActionButton.js";
|
|
3
|
-
import { default as a } from "./UNSTABLE_AttachmentDismissButton.js";
|
|
4
|
-
import { default as N } from "./UNSTABLE_AttachmentImagePreview.js";
|
|
5
|
-
import { useAttachmentImageStyles as E } from "./useAttachmentImageStyles.js";
|
|
6
|
-
import { useAttachmentStyleProps as f } from "./useAttachmentStyleProps.js";
|
|
7
|
-
import { AttachmentCropCSS as c, DEFAULT_ATTACHMENT_ACTION_BUTTON_ICON_NAME as p, DEFAULT_ATTACHMENT_ICON_NAME as u, DEFAULT_ATTACHMENT_IMAGE_DIMENSION as S } from "./constants.js";
|
|
8
|
-
export {
|
|
9
|
-
c as AttachmentCropCSS,
|
|
10
|
-
p as DEFAULT_ATTACHMENT_ACTION_BUTTON_ICON_NAME,
|
|
11
|
-
u as DEFAULT_ATTACHMENT_ICON_NAME,
|
|
12
|
-
S as DEFAULT_ATTACHMENT_IMAGE_DIMENSION,
|
|
13
|
-
A as UNSTABLE_Attachment,
|
|
14
|
-
T as UNSTABLE_AttachmentActionButton,
|
|
15
|
-
a as UNSTABLE_AttachmentDismissButton,
|
|
16
|
-
N as UNSTABLE_AttachmentImagePreview,
|
|
17
|
-
E as useAttachmentImageStyles,
|
|
18
|
-
f as useAttachmentStyleProps
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ElementType, ReactNode } from 'react';
|
|
2
|
-
import { ObjectFit } from '../../constants';
|
|
3
|
-
import { PolymorphicComponentProps } from '../../types';
|
|
4
|
-
import { SpiritButtonElementProps, SpiritSpanElementProps } from '../../types/shared';
|
|
5
|
-
export interface UnstableFileMetadata {
|
|
6
|
-
[key: string | number]: unknown;
|
|
7
|
-
}
|
|
8
|
-
export type UnstableAttachmentItem = {
|
|
9
|
-
id: string;
|
|
10
|
-
label: string;
|
|
11
|
-
previewUrl?: string;
|
|
12
|
-
meta?: UnstableFileMetadata;
|
|
13
|
-
};
|
|
14
|
-
export interface UnstableAttachmentActionButtonProps extends SpiritButtonElementProps {
|
|
15
|
-
}
|
|
16
|
-
export interface UnstableAttachmentDismissButtonProps extends SpiritButtonElementProps {
|
|
17
|
-
}
|
|
18
|
-
export interface UnstableAttachmentImagePreviewProps extends SpiritSpanElementProps {
|
|
19
|
-
imagePreview: string;
|
|
20
|
-
label: string;
|
|
21
|
-
meta?: UnstableFileMetadata;
|
|
22
|
-
imageObjectFit?: (typeof ObjectFit)[keyof typeof ObjectFit];
|
|
23
|
-
}
|
|
24
|
-
export interface UnstableAttachmentBaseProps {
|
|
25
|
-
editText?: string;
|
|
26
|
-
iconName?: string;
|
|
27
|
-
id: string;
|
|
28
|
-
isFluid?: boolean;
|
|
29
|
-
label: string;
|
|
30
|
-
onDismiss: () => void;
|
|
31
|
-
onChange?: () => void;
|
|
32
|
-
removeText?: string;
|
|
33
|
-
previewSlot?: ReactNode;
|
|
34
|
-
}
|
|
35
|
-
export type SpiritUnstableAttachmentProps<E extends ElementType = 'li'> = PolymorphicComponentProps<E, UnstableAttachmentBaseProps>;
|
|
36
|
-
export type UnstableAttachmentProps = SpiritUnstableAttachmentProps<'li'>;
|
|
37
|
-
export interface SpiritUnstableAttachmentActionButtonProps extends UnstableAttachmentActionButtonProps {
|
|
38
|
-
}
|
|
39
|
-
export interface SpiritUnstableAttachmentDismissButtonProps extends UnstableAttachmentDismissButtonProps {
|
|
40
|
-
}
|
|
41
|
-
export interface SpiritUnstableAttachmentImagePreviewProps extends UnstableAttachmentImagePreviewProps {
|
|
42
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./constants.cjs"),h=["x","y","cropWidth","cropHeight","originalWidth","originalHeight"];function s(t){return t!=null&&h.every(e=>t[e]!=null)}function u(t){const{x:e,y:n,cropWidth:i,cropHeight:a,originalWidth:c,originalHeight:S}=t,r=a>i?o.DEFAULT_ATTACHMENT_IMAGE_DIMENSION/i:o.DEFAULT_ATTACHMENT_IMAGE_DIMENSION/a;return{[o.AttachmentCropCSS.TOP]:`-${Math.round(n*r)}px`,[o.AttachmentCropCSS.LEFT]:`-${Math.round(e*r)}px`,[o.AttachmentCropCSS.WIDTH]:`${Math.round(c*r)}px`,[o.AttachmentCropCSS.HEIGHT]:`${Math.round(S*r)}px`}}function C(t,e){const n=s(t);return{imageCropCSS:n?u(t):void 0,imageObjectFitCSS:e?{"--file-uploader-attachment-image-object-fit":e}:void 0,hasCoordsInMeta:n}}exports.useAttachmentImageStyles=C;
|
|
2
|
-
//# sourceMappingURL=useAttachmentImageStyles.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachmentImageStyles.cjs","sources":["../../../src/components/UNSTABLE_Attachment/useAttachmentImageStyles.ts"],"sourcesContent":["import { type CSSProperties } from 'react';\nimport { AttachmentCropCSS, DEFAULT_ATTACHMENT_IMAGE_DIMENSION } from './constants';\nimport { type UnstableFileMetadata } from './types';\n\nexport type AttachmentImageCropCSS = {\n [AttachmentCropCSS.TOP]?: string;\n [AttachmentCropCSS.LEFT]?: string;\n [AttachmentCropCSS.WIDTH]?: string;\n [AttachmentCropCSS.HEIGHT]?: string;\n} & CSSProperties;\n\nexport type AttachmentImageObjectFit = {\n '--file-uploader-attachment-image-object-fit': string;\n};\n\ntype AttachmentImageCropMeta = {\n x: number;\n y: number;\n cropWidth: number;\n cropHeight: number;\n originalWidth: number;\n originalHeight: number;\n};\n\nexport interface AttachmentImageStylesResult {\n imageCropCSS?: AttachmentImageCropCSS;\n imageObjectFitCSS?: AttachmentImageObjectFit;\n hasCoordsInMeta: boolean;\n}\n\nconst CROP_META_KEYS = ['x', 'y', 'cropWidth', 'cropHeight', 'originalWidth', 'originalHeight'] as const;\n\n/**\n * Type guard: true when meta has all required crop coordinate keys with non-null values.\n *\n * @param meta - Optional file metadata.\n * @returns {boolean} True when meta is AttachmentImageCropMeta (has x, y, cropWidth, cropHeight, originalWidth, originalHeight).\n */\nfunction hasValidCropMeta(meta: UnstableFileMetadata | undefined): meta is AttachmentImageCropMeta {\n return meta != null && CROP_META_KEYS.every((key) => meta[key] != null);\n}\n\n/**\n * Builds CSS custom properties for cropping the attachment image from validated meta coords.\n *\n * @param meta - Valid crop metadata (all coords present).\n * @returns {AttachmentImageCropCSS} CSS object with --file-uploader-attachment-image-* variables.\n */\nfunction computeCropCSS(meta: AttachmentImageCropMeta): AttachmentImageCropCSS {\n const { x, y, cropWidth, cropHeight, originalWidth, originalHeight } = meta;\n const scale =\n cropHeight > cropWidth\n ? DEFAULT_ATTACHMENT_IMAGE_DIMENSION / cropWidth\n : DEFAULT_ATTACHMENT_IMAGE_DIMENSION / cropHeight;\n\n return {\n [AttachmentCropCSS.TOP]: `-${Math.round(y * scale)}px`,\n [AttachmentCropCSS.LEFT]: `-${Math.round(x * scale)}px`,\n [AttachmentCropCSS.WIDTH]: `${Math.round(originalWidth * scale)}px`,\n [AttachmentCropCSS.HEIGHT]: `${Math.round(originalHeight * scale)}px`,\n };\n}\n\n/**\n * Computes CSS for attachment image: crop (from meta coords) and object-fit variable.\n *\n * @param meta - Optional file metadata; when it contains crop coords, imageCropCSS is set.\n * @param imageObjectFit - Optional object-fit value for the CSS variable.\n * @returns {AttachmentImageStylesResult} imageCropCSS, imageObjectFitCSS, and hasCoordsInMeta flag.\n */\nexport function useAttachmentImageStyles(\n meta?: UnstableFileMetadata,\n imageObjectFit?: string,\n): AttachmentImageStylesResult {\n const hasCoordsInMeta = hasValidCropMeta(meta);\n const imageCropCSS = hasCoordsInMeta ? computeCropCSS(meta) : undefined;\n const imageObjectFitCSS = imageObjectFit\n ? { '--file-uploader-attachment-image-object-fit': imageObjectFit }\n : undefined;\n\n return { imageCropCSS, imageObjectFitCSS, hasCoordsInMeta };\n}\n"],"names":["CROP_META_KEYS","hasValidCropMeta","meta","key","computeCropCSS","x","y","cropWidth","cropHeight","originalWidth","originalHeight","scale","DEFAULT_ATTACHMENT_IMAGE_DIMENSION","AttachmentCropCSS","useAttachmentImageStyles","imageObjectFit","hasCoordsInMeta"],"mappings":"mHA8BMA,EAAiB,CAAC,IAAK,IAAK,YAAa,aAAc,gBAAiB,gBAAgB,EAQ9F,SAASC,EAAiBC,EAAyE,CACjG,OAAOA,GAAQ,MAAQF,EAAe,MAAOG,GAAQD,EAAKC,CAAG,GAAK,IAAI,CACxE,CAQA,SAASC,EAAeF,EAAuD,CAC7E,KAAM,CAAE,EAAAG,EAAG,EAAAC,EAAG,UAAAC,EAAW,WAAAC,EAAY,cAAAC,EAAe,eAAAC,GAAmBR,EACjES,EACJH,EAAaD,EACTK,EAAAA,mCAAqCL,EACrCK,EAAAA,mCAAqCJ,EAE3C,MAAO,CACL,CAACK,EAAAA,kBAAkB,GAAG,EAAG,IAAI,KAAK,MAAMP,EAAIK,CAAK,CAAC,KAClD,CAACE,EAAAA,kBAAkB,IAAI,EAAG,IAAI,KAAK,MAAMR,EAAIM,CAAK,CAAC,KACnD,CAACE,EAAAA,kBAAkB,KAAK,EAAG,GAAG,KAAK,MAAMJ,EAAgBE,CAAK,CAAC,KAC/D,CAACE,EAAAA,kBAAkB,MAAM,EAAG,GAAG,KAAK,MAAMH,EAAiBC,CAAK,CAAC,IAAA,CAErE,CASO,SAASG,EACdZ,EACAa,EAC6B,CAC7B,MAAMC,EAAkBf,EAAiBC,CAAI,EAM7C,MAAO,CAAE,aALYc,EAAkBZ,EAAeF,CAAI,EAAI,OAKvC,kBAJGa,EACtB,CAAE,8CAA+CA,GACjD,OAEsC,gBAAAC,CAAA,CAC5C"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
import { AttachmentCropCSS } from './constants';
|
|
3
|
-
import { UnstableFileMetadata } from './types';
|
|
4
|
-
export type AttachmentImageCropCSS = {
|
|
5
|
-
[AttachmentCropCSS.TOP]?: string;
|
|
6
|
-
[AttachmentCropCSS.LEFT]?: string;
|
|
7
|
-
[AttachmentCropCSS.WIDTH]?: string;
|
|
8
|
-
[AttachmentCropCSS.HEIGHT]?: string;
|
|
9
|
-
} & CSSProperties;
|
|
10
|
-
export type AttachmentImageObjectFit = {
|
|
11
|
-
'--file-uploader-attachment-image-object-fit': string;
|
|
12
|
-
};
|
|
13
|
-
export interface AttachmentImageStylesResult {
|
|
14
|
-
imageCropCSS?: AttachmentImageCropCSS;
|
|
15
|
-
imageObjectFitCSS?: AttachmentImageObjectFit;
|
|
16
|
-
hasCoordsInMeta: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare function useAttachmentImageStyles(meta?: UnstableFileMetadata, imageObjectFit?: string): AttachmentImageStylesResult;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AttachmentCropCSS as n, DEFAULT_ATTACHMENT_IMAGE_DIMENSION as c } from "./constants.js";
|
|
2
|
-
const u = ["x", "y", "cropWidth", "cropHeight", "originalWidth", "originalHeight"];
|
|
3
|
-
function S(t) {
|
|
4
|
-
return t != null && u.every((o) => t[o] != null);
|
|
5
|
-
}
|
|
6
|
-
function s(t) {
|
|
7
|
-
const { x: o, y: i, cropWidth: e, cropHeight: a, originalWidth: h, originalHeight: p } = t, r = a > e ? c / e : c / a;
|
|
8
|
-
return {
|
|
9
|
-
[n.TOP]: `-${Math.round(i * r)}px`,
|
|
10
|
-
[n.LEFT]: `-${Math.round(o * r)}px`,
|
|
11
|
-
[n.WIDTH]: `${Math.round(h * r)}px`,
|
|
12
|
-
[n.HEIGHT]: `${Math.round(p * r)}px`
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function d(t, o) {
|
|
16
|
-
const i = S(t);
|
|
17
|
-
return { imageCropCSS: i ? s(t) : void 0, imageObjectFitCSS: o ? { "--file-uploader-attachment-image-object-fit": o } : void 0, hasCoordsInMeta: i };
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
d as useAttachmentImageStyles
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=useAttachmentImageStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachmentImageStyles.js","sources":["../../../src/components/UNSTABLE_Attachment/useAttachmentImageStyles.ts"],"sourcesContent":["import { type CSSProperties } from 'react';\nimport { AttachmentCropCSS, DEFAULT_ATTACHMENT_IMAGE_DIMENSION } from './constants';\nimport { type UnstableFileMetadata } from './types';\n\nexport type AttachmentImageCropCSS = {\n [AttachmentCropCSS.TOP]?: string;\n [AttachmentCropCSS.LEFT]?: string;\n [AttachmentCropCSS.WIDTH]?: string;\n [AttachmentCropCSS.HEIGHT]?: string;\n} & CSSProperties;\n\nexport type AttachmentImageObjectFit = {\n '--file-uploader-attachment-image-object-fit': string;\n};\n\ntype AttachmentImageCropMeta = {\n x: number;\n y: number;\n cropWidth: number;\n cropHeight: number;\n originalWidth: number;\n originalHeight: number;\n};\n\nexport interface AttachmentImageStylesResult {\n imageCropCSS?: AttachmentImageCropCSS;\n imageObjectFitCSS?: AttachmentImageObjectFit;\n hasCoordsInMeta: boolean;\n}\n\nconst CROP_META_KEYS = ['x', 'y', 'cropWidth', 'cropHeight', 'originalWidth', 'originalHeight'] as const;\n\n/**\n * Type guard: true when meta has all required crop coordinate keys with non-null values.\n *\n * @param meta - Optional file metadata.\n * @returns {boolean} True when meta is AttachmentImageCropMeta (has x, y, cropWidth, cropHeight, originalWidth, originalHeight).\n */\nfunction hasValidCropMeta(meta: UnstableFileMetadata | undefined): meta is AttachmentImageCropMeta {\n return meta != null && CROP_META_KEYS.every((key) => meta[key] != null);\n}\n\n/**\n * Builds CSS custom properties for cropping the attachment image from validated meta coords.\n *\n * @param meta - Valid crop metadata (all coords present).\n * @returns {AttachmentImageCropCSS} CSS object with --file-uploader-attachment-image-* variables.\n */\nfunction computeCropCSS(meta: AttachmentImageCropMeta): AttachmentImageCropCSS {\n const { x, y, cropWidth, cropHeight, originalWidth, originalHeight } = meta;\n const scale =\n cropHeight > cropWidth\n ? DEFAULT_ATTACHMENT_IMAGE_DIMENSION / cropWidth\n : DEFAULT_ATTACHMENT_IMAGE_DIMENSION / cropHeight;\n\n return {\n [AttachmentCropCSS.TOP]: `-${Math.round(y * scale)}px`,\n [AttachmentCropCSS.LEFT]: `-${Math.round(x * scale)}px`,\n [AttachmentCropCSS.WIDTH]: `${Math.round(originalWidth * scale)}px`,\n [AttachmentCropCSS.HEIGHT]: `${Math.round(originalHeight * scale)}px`,\n };\n}\n\n/**\n * Computes CSS for attachment image: crop (from meta coords) and object-fit variable.\n *\n * @param meta - Optional file metadata; when it contains crop coords, imageCropCSS is set.\n * @param imageObjectFit - Optional object-fit value for the CSS variable.\n * @returns {AttachmentImageStylesResult} imageCropCSS, imageObjectFitCSS, and hasCoordsInMeta flag.\n */\nexport function useAttachmentImageStyles(\n meta?: UnstableFileMetadata,\n imageObjectFit?: string,\n): AttachmentImageStylesResult {\n const hasCoordsInMeta = hasValidCropMeta(meta);\n const imageCropCSS = hasCoordsInMeta ? computeCropCSS(meta) : undefined;\n const imageObjectFitCSS = imageObjectFit\n ? { '--file-uploader-attachment-image-object-fit': imageObjectFit }\n : undefined;\n\n return { imageCropCSS, imageObjectFitCSS, hasCoordsInMeta };\n}\n"],"names":["CROP_META_KEYS","hasValidCropMeta","meta","key","computeCropCSS","x","y","cropWidth","cropHeight","originalWidth","originalHeight","scale","DEFAULT_ATTACHMENT_IMAGE_DIMENSION","AttachmentCropCSS","useAttachmentImageStyles","imageObjectFit","hasCoordsInMeta"],"mappings":";AA8BA,MAAMA,IAAiB,CAAC,KAAK,KAAK,aAAa,cAAc,iBAAiB,gBAAgB;AAQ9F,SAASC,EAAiBC,GAAyE;AACjG,SAAOA,KAAQ,QAAQF,EAAe,MAAM,CAACG,MAAQD,EAAKC,CAAG,KAAK,IAAI;AACxE;AAQA,SAASC,EAAeF,GAAuD;AAC7E,QAAM,EAAE,GAAAG,GAAG,GAAAC,GAAG,WAAAC,GAAW,YAAAC,GAAY,eAAAC,GAAe,gBAAAC,MAAmBR,GACjES,IACJH,IAAaD,IACTK,IAAqCL,IACrCK,IAAqCJ;AAE3C,SAAO;AAAA,IACL,CAACK,EAAkB,GAAG,GAAG,IAAI,KAAK,MAAMP,IAAIK,CAAK,CAAC;AAAA,IAClD,CAACE,EAAkB,IAAI,GAAG,IAAI,KAAK,MAAMR,IAAIM,CAAK,CAAC;AAAA,IACnD,CAACE,EAAkB,KAAK,GAAG,GAAG,KAAK,MAAMJ,IAAgBE,CAAK,CAAC;AAAA,IAC/D,CAACE,EAAkB,MAAM,GAAG,GAAG,KAAK,MAAMH,IAAiBC,CAAK,CAAC;AAAA,EAAA;AAErE;AASO,SAASG,EACdZ,GACAa,GAC6B;AAC7B,QAAMC,IAAkBf,EAAiBC,CAAI;AAM7C,SAAO,EAAE,cALYc,IAAkBZ,EAAeF,CAAI,IAAI,QAKvC,mBAJGa,IACtB,EAAE,+CAA+CA,MACjD,QAEsC,iBAAAC,EAAA;AAC5C;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("classnames"),u=require("../../hooks/useClassNamePrefix.cjs"),h=require("./useAttachmentImageStyles.cjs"),C=e=>{const t=u.useClassNamePrefix("Attachment"),a=`${t}--fluid`,n=`${t}__name`,c=`${t}__action`,m=`${t}__image`,o=`${t}__slot`,{imageCropCSS:l,imageObjectFitCSS:s,hasCoordsInMeta:i}=h.useAttachmentImageStyles(e?.meta,e?.imageObjectFit);return{classProps:{root:r(t,{[a]:e?.isFluid}),button:c,name:n,image:m,slot:o,...i&&{imageCropStyles:l},...s&&{attachmentStyles:s}}}};exports.useAttachmentStyleProps=C;
|
|
2
|
-
//# sourceMappingURL=useAttachmentStyleProps.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachmentStyleProps.cjs","sources":["../../../src/components/UNSTABLE_Attachment/useAttachmentStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { type ObjectFit } from '../../constants';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type StyleProps } from '../../types';\nimport { type UnstableFileMetadata } from './types';\nimport {\n type AttachmentImageCropCSS,\n type AttachmentImageObjectFit,\n useAttachmentImageStyles,\n} from './useAttachmentImageStyles';\n\nexport interface AttachmentStyleProps extends StyleProps {\n imageObjectFit?: (typeof ObjectFit)[keyof typeof ObjectFit];\n isFluid?: boolean;\n meta?: UnstableFileMetadata;\n}\n\nexport interface AttachmentStyle {\n /** className props */\n classProps: {\n root: string;\n button: string;\n name: string;\n image: string;\n slot: string;\n imageCropStyles?: AttachmentImageCropCSS;\n attachmentStyles?: AttachmentImageObjectFit;\n };\n}\n\nexport const useAttachmentStyleProps = (props?: AttachmentStyleProps): AttachmentStyle => {\n const AttachmentClass = useClassNamePrefix('Attachment');\n const AttachmentFluidClass = `${AttachmentClass}--fluid`;\n const AttachmentNameClass = `${AttachmentClass}__name`;\n const AttachmentButtonClass = `${AttachmentClass}__action`;\n const AttachmentImageClass = `${AttachmentClass}__image`;\n const AttachmentSlotClass = `${AttachmentClass}__slot`;\n\n const { imageCropCSS, imageObjectFitCSS, hasCoordsInMeta } = useAttachmentImageStyles(\n props?.meta,\n props?.imageObjectFit,\n );\n\n return {\n classProps: {\n root: classNames(AttachmentClass, { [AttachmentFluidClass]: props?.isFluid }),\n button: AttachmentButtonClass,\n name: AttachmentNameClass,\n image: AttachmentImageClass,\n slot: AttachmentSlotClass,\n ...(hasCoordsInMeta && { imageCropStyles: imageCropCSS }),\n ...(imageObjectFitCSS && { attachmentStyles: imageObjectFitCSS }),\n },\n };\n};\n"],"names":["useAttachmentStyleProps","props","AttachmentClass","useClassNamePrefix","AttachmentFluidClass","AttachmentNameClass","AttachmentButtonClass","AttachmentImageClass","AttachmentSlotClass","imageCropCSS","imageObjectFitCSS","hasCoordsInMeta","useAttachmentImageStyles","classNames"],"mappings":"0MA8BaA,EAA2BC,GAAkD,CACxF,MAAMC,EAAkBC,EAAAA,mBAAmB,YAAY,EACjDC,EAAuB,GAAGF,CAAe,UACzCG,EAAsB,GAAGH,CAAe,SACxCI,EAAwB,GAAGJ,CAAe,WAC1CK,EAAuB,GAAGL,CAAe,UACzCM,EAAsB,GAAGN,CAAe,SAExC,CAAE,aAAAO,EAAc,kBAAAC,EAAmB,gBAAAC,CAAA,EAAoBC,EAAAA,yBAC3DX,GAAO,KACPA,GAAO,cAAA,EAGT,MAAO,CACL,WAAY,CACV,KAAMY,EAAWX,EAAiB,CAAE,CAACE,CAAoB,EAAGH,GAAO,QAAS,EAC5E,OAAQK,EACR,KAAMD,EACN,MAAOE,EACP,KAAMC,EACN,GAAIG,GAAmB,CAAE,gBAAiBF,CAAA,EAC1C,GAAIC,GAAqB,CAAE,iBAAkBA,CAAA,CAAkB,CACjE,CAEJ"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ObjectFit } from '../../constants';
|
|
2
|
-
import { StyleProps } from '../../types';
|
|
3
|
-
import { UnstableFileMetadata } from './types';
|
|
4
|
-
import { AttachmentImageCropCSS, AttachmentImageObjectFit } from './useAttachmentImageStyles';
|
|
5
|
-
export interface AttachmentStyleProps extends StyleProps {
|
|
6
|
-
imageObjectFit?: (typeof ObjectFit)[keyof typeof ObjectFit];
|
|
7
|
-
isFluid?: boolean;
|
|
8
|
-
meta?: UnstableFileMetadata;
|
|
9
|
-
}
|
|
10
|
-
export interface AttachmentStyle {
|
|
11
|
-
classProps: {
|
|
12
|
-
root: string;
|
|
13
|
-
button: string;
|
|
14
|
-
name: string;
|
|
15
|
-
image: string;
|
|
16
|
-
slot: string;
|
|
17
|
-
imageCropStyles?: AttachmentImageCropCSS;
|
|
18
|
-
attachmentStyles?: AttachmentImageObjectFit;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export declare const useAttachmentStyleProps: (props?: AttachmentStyleProps) => AttachmentStyle;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import r from "classnames";
|
|
2
|
-
import { useClassNamePrefix as C } from "../../hooks/useClassNamePrefix.js";
|
|
3
|
-
import { useAttachmentImageStyles as h } from "./useAttachmentImageStyles.js";
|
|
4
|
-
const g = (s) => {
|
|
5
|
-
const t = C("Attachment"), a = `${t}--fluid`, m = `${t}__name`, o = `${t}__action`, n = `${t}__image`, c = `${t}__slot`, { imageCropCSS: l, imageObjectFitCSS: e, hasCoordsInMeta: i } = h(
|
|
6
|
-
s?.meta,
|
|
7
|
-
s?.imageObjectFit
|
|
8
|
-
);
|
|
9
|
-
return {
|
|
10
|
-
classProps: {
|
|
11
|
-
root: r(t, { [a]: s?.isFluid }),
|
|
12
|
-
button: o,
|
|
13
|
-
name: m,
|
|
14
|
-
image: n,
|
|
15
|
-
slot: c,
|
|
16
|
-
...i && { imageCropStyles: l },
|
|
17
|
-
...e && { attachmentStyles: e }
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
g as useAttachmentStyleProps
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=useAttachmentStyleProps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachmentStyleProps.js","sources":["../../../src/components/UNSTABLE_Attachment/useAttachmentStyleProps.ts"],"sourcesContent":["import classNames from 'classnames';\nimport { type ObjectFit } from '../../constants';\nimport { useClassNamePrefix } from '../../hooks';\nimport { type StyleProps } from '../../types';\nimport { type UnstableFileMetadata } from './types';\nimport {\n type AttachmentImageCropCSS,\n type AttachmentImageObjectFit,\n useAttachmentImageStyles,\n} from './useAttachmentImageStyles';\n\nexport interface AttachmentStyleProps extends StyleProps {\n imageObjectFit?: (typeof ObjectFit)[keyof typeof ObjectFit];\n isFluid?: boolean;\n meta?: UnstableFileMetadata;\n}\n\nexport interface AttachmentStyle {\n /** className props */\n classProps: {\n root: string;\n button: string;\n name: string;\n image: string;\n slot: string;\n imageCropStyles?: AttachmentImageCropCSS;\n attachmentStyles?: AttachmentImageObjectFit;\n };\n}\n\nexport const useAttachmentStyleProps = (props?: AttachmentStyleProps): AttachmentStyle => {\n const AttachmentClass = useClassNamePrefix('Attachment');\n const AttachmentFluidClass = `${AttachmentClass}--fluid`;\n const AttachmentNameClass = `${AttachmentClass}__name`;\n const AttachmentButtonClass = `${AttachmentClass}__action`;\n const AttachmentImageClass = `${AttachmentClass}__image`;\n const AttachmentSlotClass = `${AttachmentClass}__slot`;\n\n const { imageCropCSS, imageObjectFitCSS, hasCoordsInMeta } = useAttachmentImageStyles(\n props?.meta,\n props?.imageObjectFit,\n );\n\n return {\n classProps: {\n root: classNames(AttachmentClass, { [AttachmentFluidClass]: props?.isFluid }),\n button: AttachmentButtonClass,\n name: AttachmentNameClass,\n image: AttachmentImageClass,\n slot: AttachmentSlotClass,\n ...(hasCoordsInMeta && { imageCropStyles: imageCropCSS }),\n ...(imageObjectFitCSS && { attachmentStyles: imageObjectFitCSS }),\n },\n };\n};\n"],"names":["useAttachmentStyleProps","props","AttachmentClass","useClassNamePrefix","AttachmentFluidClass","AttachmentNameClass","AttachmentButtonClass","AttachmentImageClass","AttachmentSlotClass","imageCropCSS","imageObjectFitCSS","hasCoordsInMeta","useAttachmentImageStyles","classNames"],"mappings":";;;AA8BO,MAAMA,IAA0B,CAACC,MAAkD;AACxF,QAAMC,IAAkBC,EAAmB,YAAY,GACjDC,IAAuB,GAAGF,CAAe,WACzCG,IAAsB,GAAGH,CAAe,UACxCI,IAAwB,GAAGJ,CAAe,YAC1CK,IAAuB,GAAGL,CAAe,WACzCM,IAAsB,GAAGN,CAAe,UAExC,EAAE,cAAAO,GAAc,mBAAAC,GAAmB,iBAAAC,EAAA,IAAoBC;AAAA,IAC3DX,GAAO;AAAA,IACPA,GAAO;AAAA,EAAA;AAGT,SAAO;AAAA,IACL,YAAY;AAAA,MACV,MAAMY,EAAWX,GAAiB,EAAE,CAACE,CAAoB,GAAGH,GAAO,SAAS;AAAA,MAC5E,QAAQK;AAAA,MACR,MAAMD;AAAA,MACN,OAAOE;AAAA,MACP,MAAMC;AAAA,MACN,GAAIG,KAAmB,EAAE,iBAAiBF,EAAA;AAAA,MAC1C,GAAIC,KAAqB,EAAE,kBAAkBA,EAAA;AAAA,IAAkB;AAAA,EACjE;AAEJ;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAriaDescribedBy.cjs","sources":["../../src/hooks/useAriaDescribedBy.ts"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nexport const useAriaDescribedBy = (ids: string[]) =>\n useMemo(() => (ids.length ? { 'aria-describedby': ids.join(' ') } : {}), [ids]);\n"],"names":["useAriaDescribedBy","ids","useMemo"],"mappings":"sHAIaA,EAAsBC,GACjCC,EAAAA,QAAQ,IAAOD,EAAI,OAAS,CAAE,mBAAoBA,EAAI,KAAK,GAAG,CAAA,EAAM,CAAA,EAAK,CAACA,CAAG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAriaDescribedBy.js","sources":["../../src/hooks/useAriaDescribedBy.ts"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nexport const useAriaDescribedBy = (ids: string[]) =>\n useMemo(() => (ids.length ? { 'aria-describedby': ids.join(' ') } : {}), [ids]);\n"],"names":["useAriaDescribedBy","ids","useMemo"],"mappings":";;AAIO,MAAMA,IAAqB,CAACC,MACjCC,EAAQ,MAAOD,EAAI,SAAS,EAAE,oBAAoBA,EAAI,KAAK,GAAG,EAAA,IAAM,CAAA,GAAK,CAACA,CAAG,CAAC;"}
|
|
File without changes
|