@flipdish/ui-library 0.59.0 → 0.60.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/README.md +3 -3
- package/dist/components/atoms/AppStoreButton/index.d.ts.map +1 -1
- package/dist/components/atoms/BrandButtons/AppStoreButton/AppStoreButton.cjs +1 -1
- package/dist/components/atoms/BrandButtons/AppStoreButton/AppStoreButton.js +1 -1
- package/dist/components/atoms/BrandButtons/AppStoreButton/components/AppStoreBadgeLink.cjs.map +1 -0
- package/dist/components/atoms/BrandButtons/AppStoreButton/components/AppStoreBadgeLink.d.ts.map +1 -0
- package/dist/components/atoms/BrandButtons/AppStoreButton/components/AppStoreBadgeLink.js.map +1 -0
- package/dist/components/atoms/BrandButtons/AppStoreButton/{AppStoreButtonsOutline.cjs → components/AppStoreButtonsOutline.cjs} +1 -1
- package/dist/components/atoms/BrandButtons/AppStoreButton/components/AppStoreButtonsOutline.cjs.map +1 -0
- package/dist/components/atoms/BrandButtons/AppStoreButton/components/AppStoreButtonsOutline.d.ts.map +1 -0
- package/dist/components/atoms/BrandButtons/AppStoreButton/{AppStoreButtonsOutline.js → components/AppStoreButtonsOutline.js} +1 -1
- package/dist/components/atoms/BrandButtons/AppStoreButton/components/AppStoreButtonsOutline.js.map +1 -0
- package/dist/components/atoms/BrandButtons/SocialButton/SocialButton.cjs +1 -1
- package/dist/components/atoms/BrandButtons/SocialButton/SocialButton.js +1 -1
- package/dist/components/atoms/BrandButtons/SocialButton/components/SocialLogos.cjs.map +1 -0
- package/dist/components/atoms/BrandButtons/SocialButton/components/SocialLogos.d.ts.map +1 -0
- package/dist/components/atoms/BrandButtons/SocialButton/components/SocialLogos.js.map +1 -0
- package/dist/components/atoms/BrandButtons/index.cjs +1 -1
- package/dist/components/atoms/BrandButtons/index.d.ts +1 -1
- package/dist/components/atoms/BrandButtons/index.d.ts.map +1 -1
- package/dist/components/atoms/BrandButtons/index.js +1 -1
- package/dist/components/atoms/Button/index.cjs +6 -163
- package/dist/components/atoms/Button/index.cjs.map +1 -1
- package/dist/components/atoms/Button/index.d.ts +14 -117
- package/dist/components/atoms/Button/index.d.ts.map +1 -1
- package/dist/components/atoms/Button/index.js +6 -163
- package/dist/components/atoms/Button/index.js.map +1 -1
- package/dist/components/atoms/Buttons/Button/Button.cjs +168 -0
- package/dist/components/atoms/Buttons/Button/Button.cjs.map +1 -0
- package/dist/components/atoms/Buttons/Button/Button.d.ts +116 -0
- package/dist/components/atoms/Buttons/Button/Button.d.ts.map +1 -0
- package/dist/components/atoms/Buttons/Button/Button.js +165 -0
- package/dist/components/atoms/Buttons/Button/Button.js.map +1 -0
- package/dist/{native/components/atoms → components/atoms/Buttons}/Button/Button.styles.d.ts +1 -1
- package/dist/components/atoms/Buttons/Button/Button.styles.d.ts.map +1 -0
- package/dist/components/atoms/{Button → Buttons/Button}/components/ButtonIcon.cjs +1 -1
- package/dist/components/atoms/Buttons/Button/components/ButtonIcon.cjs.map +1 -0
- package/dist/components/atoms/{Button → Buttons/Button}/components/ButtonIcon.d.ts +1 -1
- package/dist/components/atoms/Buttons/Button/components/ButtonIcon.d.ts.map +1 -0
- package/dist/components/atoms/{Button → Buttons/Button}/components/ButtonIcon.js +1 -1
- package/dist/components/atoms/Buttons/Button/components/ButtonIcon.js.map +1 -0
- package/dist/components/atoms/Buttons/Button/components/ButtonSpinner.cjs.map +1 -0
- package/dist/components/atoms/Buttons/Button/components/ButtonSpinner.d.ts.map +1 -0
- package/dist/components/atoms/Buttons/Button/components/ButtonSpinner.js.map +1 -0
- package/dist/components/atoms/Buttons/Button/hooks/useLoadingLinkPress.cjs +61 -0
- package/dist/components/atoms/Buttons/Button/hooks/useLoadingLinkPress.cjs.map +1 -0
- package/dist/components/atoms/Buttons/Button/hooks/useLoadingLinkPress.d.ts +27 -0
- package/dist/components/atoms/Buttons/Button/hooks/useLoadingLinkPress.d.ts.map +1 -0
- package/dist/components/atoms/Buttons/Button/hooks/useLoadingLinkPress.js +59 -0
- package/dist/components/atoms/Buttons/Button/hooks/useLoadingLinkPress.js.map +1 -0
- package/dist/components/atoms/Buttons/CloseButton/CloseButton.cjs +31 -0
- package/dist/components/atoms/Buttons/CloseButton/CloseButton.cjs.map +1 -0
- package/dist/components/atoms/Buttons/CloseButton/CloseButton.d.ts +19 -0
- package/dist/components/atoms/Buttons/CloseButton/CloseButton.d.ts.map +1 -0
- package/dist/components/atoms/Buttons/CloseButton/CloseButton.js +29 -0
- package/dist/components/atoms/Buttons/CloseButton/CloseButton.js.map +1 -0
- package/dist/components/atoms/Buttons/CopyButton/CopyButton.cjs +27 -0
- package/dist/components/atoms/Buttons/CopyButton/CopyButton.cjs.map +1 -0
- package/dist/components/atoms/Buttons/CopyButton/CopyButton.d.ts +28 -0
- package/dist/components/atoms/Buttons/CopyButton/CopyButton.d.ts.map +1 -0
- package/dist/components/atoms/Buttons/CopyButton/CopyButton.js +25 -0
- package/dist/components/atoms/Buttons/CopyButton/CopyButton.js.map +1 -0
- package/dist/components/atoms/Buttons/IconButton/IconButton.cjs +59 -0
- package/dist/components/atoms/Buttons/IconButton/IconButton.cjs.map +1 -0
- package/dist/components/atoms/Buttons/IconButton/IconButton.d.ts +65 -0
- package/dist/components/atoms/Buttons/IconButton/IconButton.d.ts.map +1 -0
- package/dist/components/atoms/Buttons/IconButton/IconButton.js +56 -0
- package/dist/components/atoms/Buttons/IconButton/IconButton.js.map +1 -0
- package/dist/components/atoms/Buttons/index.cjs +14 -0
- package/dist/components/atoms/Buttons/index.cjs.map +1 -0
- package/dist/components/atoms/Buttons/index.d.ts +18 -0
- package/dist/components/atoms/Buttons/index.d.ts.map +1 -0
- package/dist/components/atoms/Buttons/index.js +5 -0
- package/dist/components/atoms/Buttons/index.js.map +1 -0
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.js +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/components/CheckboxBase.cjs.map +1 -0
- package/dist/components/atoms/Checkboxes/Checkbox/components/CheckboxBase.d.ts.map +1 -0
- package/dist/components/atoms/Checkboxes/Checkbox/components/CheckboxBase.js.map +1 -0
- package/dist/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.cjs +2 -2
- package/dist/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.cjs.map +1 -1
- package/dist/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.js +1 -1
- package/dist/components/atoms/Checkboxes/index.cjs +1 -1
- package/dist/components/atoms/Checkboxes/index.d.ts +2 -2
- package/dist/components/atoms/Checkboxes/index.d.ts.map +1 -1
- package/dist/components/atoms/Checkboxes/index.js +1 -1
- package/dist/components/atoms/CloseButton/index.cjs +3 -26
- package/dist/components/atoms/CloseButton/index.cjs.map +1 -1
- package/dist/components/atoms/CloseButton/index.d.ts +5 -18
- package/dist/components/atoms/CloseButton/index.d.ts.map +1 -1
- package/dist/components/atoms/CloseButton/index.js +3 -26
- package/dist/components/atoms/CloseButton/index.js.map +1 -1
- package/dist/components/atoms/CopyButton/index.cjs +3 -21
- package/dist/components/atoms/CopyButton/index.cjs.map +1 -1
- package/dist/components/atoms/CopyButton/index.d.ts +5 -27
- package/dist/components/atoms/CopyButton/index.d.ts.map +1 -1
- package/dist/components/atoms/CopyButton/index.js +3 -21
- package/dist/components/atoms/CopyButton/index.js.map +1 -1
- package/dist/components/atoms/Input/index.cjs +13 -84
- package/dist/components/atoms/Input/index.cjs.map +1 -1
- package/dist/components/atoms/Input/index.d.ts +20 -70
- package/dist/components/atoms/Input/index.d.ts.map +1 -1
- package/dist/components/atoms/Input/index.js +11 -82
- package/dist/components/atoms/Input/index.js.map +1 -1
- package/dist/components/atoms/Inputs/Input/Input.cjs +89 -0
- package/dist/components/atoms/Inputs/Input/Input.cjs.map +1 -0
- package/dist/components/atoms/Inputs/Input/Input.d.ts +74 -0
- package/dist/components/atoms/Inputs/Input/Input.d.ts.map +1 -0
- package/dist/components/atoms/Inputs/Input/Input.js +85 -0
- package/dist/components/atoms/Inputs/Input/Input.js.map +1 -0
- package/dist/components/atoms/Inputs/SearchInput/SearchInput.cjs +60 -0
- package/dist/components/atoms/Inputs/SearchInput/SearchInput.cjs.map +1 -0
- package/dist/components/atoms/Inputs/SearchInput/SearchInput.d.ts +47 -0
- package/dist/components/atoms/Inputs/SearchInput/SearchInput.d.ts.map +1 -0
- package/dist/components/atoms/Inputs/SearchInput/SearchInput.js +58 -0
- package/dist/components/atoms/Inputs/SearchInput/SearchInput.js.map +1 -0
- package/dist/components/atoms/Inputs/TextArea/TextArea.cjs +41 -0
- package/dist/components/atoms/Inputs/TextArea/TextArea.cjs.map +1 -0
- package/dist/components/atoms/Inputs/TextArea/TextArea.d.ts +51 -0
- package/dist/components/atoms/Inputs/TextArea/TextArea.d.ts.map +1 -0
- package/dist/components/atoms/Inputs/TextArea/TextArea.js +38 -0
- package/dist/components/atoms/Inputs/TextArea/TextArea.js.map +1 -0
- package/dist/components/atoms/Inputs/components/HintText.cjs.map +1 -0
- package/dist/components/atoms/Inputs/components/HintText.d.ts.map +1 -0
- package/dist/components/atoms/Inputs/components/HintText.js.map +1 -0
- package/dist/components/atoms/Inputs/components/Label.cjs.map +1 -0
- package/dist/components/atoms/Inputs/components/Label.d.ts.map +1 -0
- package/dist/components/atoms/Inputs/components/Label.js.map +1 -0
- package/dist/components/atoms/Inputs/index.cjs +19 -0
- package/dist/components/atoms/Inputs/index.cjs.map +1 -0
- package/dist/components/atoms/Inputs/index.d.ts +19 -0
- package/dist/components/atoms/Inputs/index.d.ts.map +1 -0
- package/dist/components/atoms/Inputs/index.js +6 -0
- package/dist/components/atoms/Inputs/index.js.map +1 -0
- package/dist/components/atoms/Radios/RadioButton/RadioButton.cjs +1 -1
- package/dist/components/atoms/Radios/RadioButton/RadioButton.js +1 -1
- package/dist/components/atoms/Radios/RadioButton/components/RadioButtonBase.cjs.map +1 -0
- package/dist/components/atoms/Radios/RadioButton/components/RadioButtonBase.d.ts.map +1 -0
- package/dist/components/atoms/Radios/RadioButton/components/RadioButtonBase.js.map +1 -0
- package/dist/components/atoms/Radios/index.cjs +2 -2
- package/dist/components/atoms/Radios/index.d.ts +2 -2
- package/dist/components/atoms/Radios/index.d.ts.map +1 -1
- package/dist/components/atoms/Radios/index.js +1 -1
- package/dist/components/atoms/SearchInput/index.cjs +3 -52
- package/dist/components/atoms/SearchInput/index.cjs.map +1 -1
- package/dist/components/atoms/SearchInput/index.d.ts +5 -43
- package/dist/components/atoms/SearchInput/index.d.ts.map +1 -1
- package/dist/components/atoms/SearchInput/index.js +3 -52
- package/dist/components/atoms/SearchInput/index.js.map +1 -1
- package/dist/components/atoms/Slider/index.cjs +3 -3
- package/dist/components/atoms/Slider/index.cjs.map +1 -1
- package/dist/components/atoms/Slider/index.js +1 -1
- package/dist/components/atoms/UtilityButton/index.cjs +6 -51
- package/dist/components/atoms/UtilityButton/index.cjs.map +1 -1
- package/dist/components/atoms/UtilityButton/index.d.ts +12 -54
- package/dist/components/atoms/UtilityButton/index.d.ts.map +1 -1
- package/dist/components/atoms/UtilityButton/index.js +6 -51
- package/dist/components/atoms/UtilityButton/index.js.map +1 -1
- package/dist/components/atoms/VerificationCodeInput/index.cjs +96 -0
- package/dist/components/atoms/VerificationCodeInput/index.cjs.map +1 -0
- package/dist/components/atoms/VerificationCodeInput/index.d.ts +70 -0
- package/dist/components/atoms/VerificationCodeInput/index.d.ts.map +1 -0
- package/dist/components/atoms/VerificationCodeInput/index.js +93 -0
- package/dist/components/atoms/VerificationCodeInput/index.js.map +1 -0
- package/dist/components/forms/fields/FormInput/index.cjs +2 -2
- package/dist/components/forms/fields/FormInput/index.d.ts +1 -1
- package/dist/components/forms/fields/FormInput/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormInput/index.js +1 -1
- package/dist/components/forms/fields/FormRadioCardGroup/index.cjs +2 -2
- package/dist/components/forms/fields/FormRadioCardGroup/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormRadioCardGroup/index.js +1 -1
- package/dist/components/forms/fields/FormRadioGroup/index.cjs +2 -2
- package/dist/components/forms/fields/FormRadioGroup/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormRadioGroup/index.js +1 -1
- package/dist/components/forms/fields/FormSlider/index.cjs +2 -2
- package/dist/components/forms/fields/FormSlider/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormSlider/index.js +1 -1
- package/dist/components/forms/fields/FormTextArea/index.cjs +2 -2
- package/dist/components/forms/fields/FormTextArea/index.d.ts +2 -2
- package/dist/components/forms/fields/FormTextArea/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormTextArea/index.js +1 -1
- package/dist/components/molecules/Paginations/Pagination/Pagination.cjs +2 -2
- package/dist/components/molecules/Paginations/Pagination/Pagination.cjs.map +1 -1
- package/dist/components/molecules/Paginations/Pagination/Pagination.js +1 -1
- package/dist/components/molecules/Select/index.d.ts +1 -1
- package/dist/components/molecules/Selects/MultiSelect/MultiSelect.cjs +3 -3
- package/dist/components/molecules/Selects/MultiSelect/MultiSelect.cjs.map +1 -1
- package/dist/components/molecules/Selects/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/molecules/Selects/Select/Select.cjs +4 -4
- package/dist/components/molecules/Selects/Select/Select.cjs.map +1 -1
- package/dist/components/molecules/Selects/Select/Select.d.ts +1 -1
- package/dist/components/molecules/Selects/Select/Select.d.ts.map +1 -1
- package/dist/components/molecules/Selects/Select/Select.js +3 -3
- package/dist/components/molecules/Selects/Select/{Combobox.cjs → components/Combobox.cjs} +8 -8
- package/dist/components/molecules/Selects/Select/components/Combobox.cjs.map +1 -0
- package/dist/components/molecules/Selects/Select/{Combobox.d.ts → components/Combobox.d.ts} +1 -1
- package/dist/components/molecules/Selects/Select/components/Combobox.d.ts.map +1 -0
- package/dist/components/molecules/Selects/Select/{Combobox.js → components/Combobox.js} +6 -6
- package/dist/components/molecules/Selects/Select/components/Combobox.js.map +1 -0
- package/dist/components/molecules/Selects/Select/{Popover.cjs → components/Popover.cjs} +1 -1
- package/dist/components/molecules/Selects/Select/components/Popover.cjs.map +1 -0
- package/dist/components/molecules/Selects/Select/components/Popover.d.ts.map +1 -0
- package/dist/components/molecules/Selects/Select/{Popover.js → components/Popover.js} +1 -1
- package/dist/components/molecules/Selects/Select/components/Popover.js.map +1 -0
- package/dist/components/molecules/Tags/Tag/Tag.cjs +3 -3
- package/dist/components/molecules/Tags/Tag/Tag.js +3 -3
- package/dist/components/molecules/Tags/Tag/{TagAvatar.cjs → components/TagAvatar.cjs} +1 -1
- package/dist/components/molecules/Tags/Tag/components/TagAvatar.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tag/components/TagAvatar.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tag/{TagAvatar.js → components/TagAvatar.js} +1 -1
- package/dist/components/molecules/Tags/Tag/components/TagAvatar.js.map +1 -0
- package/dist/components/molecules/Tags/Tag/{TagCheckbox.cjs → components/TagCheckbox.cjs} +1 -1
- package/dist/components/molecules/Tags/Tag/components/TagCheckbox.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tag/{TagCheckbox.d.ts → components/TagCheckbox.d.ts} +1 -1
- package/dist/components/molecules/Tags/Tag/components/TagCheckbox.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tag/{TagCheckbox.js → components/TagCheckbox.js} +1 -1
- package/dist/components/molecules/Tags/Tag/components/TagCheckbox.js.map +1 -0
- package/dist/components/molecules/Tags/Tag/{TagCloseX.cjs → components/TagCloseX.cjs} +1 -1
- package/dist/components/molecules/Tags/Tag/components/TagCloseX.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tag/{TagCloseX.d.ts → components/TagCloseX.d.ts} +1 -1
- package/dist/components/molecules/Tags/Tag/components/TagCloseX.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tag/{TagCloseX.js → components/TagCloseX.js} +1 -1
- package/dist/components/molecules/Tags/Tag/components/TagCloseX.js.map +1 -0
- package/dist/components/molecules/Tags/index.cjs +2 -2
- package/dist/components/molecules/Tags/index.d.ts +1 -1
- package/dist/components/molecules/Tags/index.d.ts.map +1 -1
- package/dist/components/molecules/Tags/index.js +1 -1
- package/dist/components/molecules/TextArea/index.cjs +5 -30
- package/dist/components/molecules/TextArea/index.cjs.map +1 -1
- package/dist/components/molecules/TextArea/index.d.ts +7 -47
- package/dist/components/molecules/TextArea/index.d.ts.map +1 -1
- package/dist/components/molecules/TextArea/index.js +5 -30
- package/dist/components/molecules/TextArea/index.js.map +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.cjs +5 -89
- package/dist/components/molecules/VerificationCodeInput/index.cjs.map +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.d.ts +9 -69
- package/dist/components/molecules/VerificationCodeInput/index.d.ts.map +1 -1
- package/dist/components/molecules/VerificationCodeInput/index.js +5 -89
- package/dist/components/molecules/VerificationCodeInput/index.js.map +1 -1
- package/dist/components/organisms/ColorPicker/components/ColorPickerField.cjs +2 -2
- package/dist/components/organisms/ColorPicker/components/ColorPickerField.cjs.map +1 -1
- package/dist/components/organisms/ColorPicker/components/ColorPickerField.js +1 -1
- package/dist/components/organisms/DatePickers/DatePicker/DatePicker.cjs +3 -3
- package/dist/components/organisms/DatePickers/DatePicker/DatePicker.cjs.map +1 -1
- package/dist/components/organisms/DatePickers/DatePicker/DatePicker.js +2 -2
- package/dist/components/organisms/DatePickers/DatePicker/{Calendar.cjs → components/Calendar.cjs} +2 -2
- package/dist/components/organisms/DatePickers/DatePicker/components/Calendar.cjs.map +1 -0
- package/dist/components/organisms/DatePickers/DatePicker/components/Calendar.d.ts.map +1 -0
- package/dist/components/organisms/DatePickers/DatePicker/{Calendar.js → components/Calendar.js} +2 -2
- package/dist/components/organisms/DatePickers/DatePicker/components/Calendar.js.map +1 -0
- package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.cjs +2 -2
- package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.cjs.map +1 -1
- package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.js +1 -1
- package/dist/components/organisms/DatePickers/components/InputDate.cjs +1 -1
- package/dist/components/organisms/DatePickers/components/InputDate.js +1 -1
- package/dist/components/organisms/HeaderNavigation/index.cjs +2 -2
- package/dist/components/organisms/HeaderNavigation/index.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/index.js +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.cjs +2 -2
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.cjs.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.js +1 -1
- package/dist/components/organisms/TextEditor/index.cjs +3 -3
- package/dist/components/organisms/TextEditor/index.cjs.map +1 -1
- package/dist/components/organisms/TextEditor/index.d.ts +1 -1
- package/dist/components/organisms/TextEditor/index.d.ts.map +1 -1
- package/dist/components/organisms/TextEditor/index.js +1 -1
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.cjs +35 -8
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.cjs.map +1 -1
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.d.ts +5 -5
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.d.ts.map +1 -1
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.js +36 -9
- package/dist/hooks/__internal__/useDebouncedSearch/useDebouncedSearch.js.map +1 -1
- package/dist/native/components/atoms/Button/index.d.ts +14 -65
- package/dist/native/components/atoms/Button/index.d.ts.map +1 -1
- package/dist/native/components/atoms/Button/index.js +6 -145
- package/dist/native/components/atoms/Button/index.js.map +1 -1
- package/dist/native/components/atoms/Buttons/Button/Button.d.ts +66 -0
- package/dist/native/components/atoms/Buttons/Button/Button.d.ts.map +1 -0
- package/dist/native/components/atoms/Buttons/Button/Button.js +149 -0
- package/dist/native/components/atoms/Buttons/Button/Button.js.map +1 -0
- package/dist/{components/atoms → native/components/atoms/Buttons}/Button/Button.styles.d.ts +1 -1
- package/dist/native/components/atoms/Buttons/Button/Button.styles.d.ts.map +1 -0
- package/dist/native/components/atoms/{Button → Buttons/Button}/Button.styles.js +1 -1
- package/dist/native/components/atoms/Buttons/Button/Button.styles.js.map +1 -0
- package/dist/native/components/atoms/Buttons/index.d.ts +4 -0
- package/dist/native/components/atoms/Buttons/index.d.ts.map +1 -0
- package/dist/native/components/atoms/Buttons/index.js +2 -0
- package/dist/native/components/atoms/Buttons/index.js.map +1 -0
- package/dist/native/components/atoms/Inputs/index.d.ts +12 -0
- package/dist/native/components/atoms/VerificationCodeInput/index.d.ts +12 -0
- package/package.json +1 -1
- package/dist/components/atoms/BrandButtons/AppStoreButton/AppStoreBadgeLink.cjs.map +0 -1
- package/dist/components/atoms/BrandButtons/AppStoreButton/AppStoreBadgeLink.d.ts.map +0 -1
- package/dist/components/atoms/BrandButtons/AppStoreButton/AppStoreBadgeLink.js.map +0 -1
- package/dist/components/atoms/BrandButtons/AppStoreButton/AppStoreButtonsOutline.cjs.map +0 -1
- package/dist/components/atoms/BrandButtons/AppStoreButton/AppStoreButtonsOutline.d.ts.map +0 -1
- package/dist/components/atoms/BrandButtons/AppStoreButton/AppStoreButtonsOutline.js.map +0 -1
- package/dist/components/atoms/BrandButtons/SocialButton/SocialLogos.cjs.map +0 -1
- package/dist/components/atoms/BrandButtons/SocialButton/SocialLogos.d.ts.map +0 -1
- package/dist/components/atoms/BrandButtons/SocialButton/SocialLogos.js.map +0 -1
- package/dist/components/atoms/Button/Button.styles.d.ts.map +0 -1
- package/dist/components/atoms/Button/components/ButtonIcon.cjs.map +0 -1
- package/dist/components/atoms/Button/components/ButtonIcon.d.ts.map +0 -1
- package/dist/components/atoms/Button/components/ButtonIcon.js.map +0 -1
- package/dist/components/atoms/Button/components/ButtonSpinner.cjs.map +0 -1
- package/dist/components/atoms/Button/components/ButtonSpinner.d.ts.map +0 -1
- package/dist/components/atoms/Button/components/ButtonSpinner.js.map +0 -1
- package/dist/components/atoms/Checkboxes/Checkbox/CheckboxBase.cjs.map +0 -1
- package/dist/components/atoms/Checkboxes/Checkbox/CheckboxBase.d.ts.map +0 -1
- package/dist/components/atoms/Checkboxes/Checkbox/CheckboxBase.js.map +0 -1
- package/dist/components/atoms/Input/components/HintText.cjs.map +0 -1
- package/dist/components/atoms/Input/components/HintText.d.ts.map +0 -1
- package/dist/components/atoms/Input/components/HintText.js.map +0 -1
- package/dist/components/atoms/Input/components/Label.cjs.map +0 -1
- package/dist/components/atoms/Input/components/Label.d.ts.map +0 -1
- package/dist/components/atoms/Input/components/Label.js.map +0 -1
- package/dist/components/atoms/Radios/RadioButton/RadioButtonBase.cjs.map +0 -1
- package/dist/components/atoms/Radios/RadioButton/RadioButtonBase.d.ts.map +0 -1
- package/dist/components/atoms/Radios/RadioButton/RadioButtonBase.js.map +0 -1
- package/dist/components/molecules/Selects/Select/Combobox.cjs.map +0 -1
- package/dist/components/molecules/Selects/Select/Combobox.d.ts.map +0 -1
- package/dist/components/molecules/Selects/Select/Combobox.js.map +0 -1
- package/dist/components/molecules/Selects/Select/Popover.cjs.map +0 -1
- package/dist/components/molecules/Selects/Select/Popover.d.ts.map +0 -1
- package/dist/components/molecules/Selects/Select/Popover.js.map +0 -1
- package/dist/components/molecules/Tags/Tag/TagAvatar.cjs.map +0 -1
- package/dist/components/molecules/Tags/Tag/TagAvatar.d.ts.map +0 -1
- package/dist/components/molecules/Tags/Tag/TagAvatar.js.map +0 -1
- package/dist/components/molecules/Tags/Tag/TagCheckbox.cjs.map +0 -1
- package/dist/components/molecules/Tags/Tag/TagCheckbox.d.ts.map +0 -1
- package/dist/components/molecules/Tags/Tag/TagCheckbox.js.map +0 -1
- package/dist/components/molecules/Tags/Tag/TagCloseX.cjs.map +0 -1
- package/dist/components/molecules/Tags/Tag/TagCloseX.d.ts.map +0 -1
- package/dist/components/molecules/Tags/Tag/TagCloseX.js.map +0 -1
- package/dist/components/organisms/DatePickers/DatePicker/Calendar.cjs.map +0 -1
- package/dist/components/organisms/DatePickers/DatePicker/Calendar.d.ts.map +0 -1
- package/dist/components/organisms/DatePickers/DatePicker/Calendar.js.map +0 -1
- package/dist/native/components/atoms/Button/Button.styles.d.ts.map +0 -1
- package/dist/native/components/atoms/Button/Button.styles.js.map +0 -1
- /package/dist/components/atoms/BrandButtons/AppStoreButton/{AppStoreBadgeLink.cjs → components/AppStoreBadgeLink.cjs} +0 -0
- /package/dist/components/atoms/BrandButtons/AppStoreButton/{AppStoreBadgeLink.d.ts → components/AppStoreBadgeLink.d.ts} +0 -0
- /package/dist/components/atoms/BrandButtons/AppStoreButton/{AppStoreBadgeLink.js → components/AppStoreBadgeLink.js} +0 -0
- /package/dist/components/atoms/BrandButtons/AppStoreButton/{AppStoreButtonsOutline.d.ts → components/AppStoreButtonsOutline.d.ts} +0 -0
- /package/dist/components/atoms/BrandButtons/SocialButton/{SocialLogos.cjs → components/SocialLogos.cjs} +0 -0
- /package/dist/components/atoms/BrandButtons/SocialButton/{SocialLogos.d.ts → components/SocialLogos.d.ts} +0 -0
- /package/dist/components/atoms/BrandButtons/SocialButton/{SocialLogos.js → components/SocialLogos.js} +0 -0
- /package/dist/components/atoms/{Button → Buttons/Button}/components/ButtonSpinner.cjs +0 -0
- /package/dist/components/atoms/{Button → Buttons/Button}/components/ButtonSpinner.d.ts +0 -0
- /package/dist/components/atoms/{Button → Buttons/Button}/components/ButtonSpinner.js +0 -0
- /package/dist/components/atoms/Checkboxes/Checkbox/{CheckboxBase.cjs → components/CheckboxBase.cjs} +0 -0
- /package/dist/components/atoms/Checkboxes/Checkbox/{CheckboxBase.d.ts → components/CheckboxBase.d.ts} +0 -0
- /package/dist/components/atoms/Checkboxes/Checkbox/{CheckboxBase.js → components/CheckboxBase.js} +0 -0
- /package/dist/components/atoms/{Input → Inputs}/components/HintText.cjs +0 -0
- /package/dist/components/atoms/{Input → Inputs}/components/HintText.d.ts +0 -0
- /package/dist/components/atoms/{Input → Inputs}/components/HintText.js +0 -0
- /package/dist/components/atoms/{Input → Inputs}/components/Label.cjs +0 -0
- /package/dist/components/atoms/{Input → Inputs}/components/Label.d.ts +0 -0
- /package/dist/components/atoms/{Input → Inputs}/components/Label.js +0 -0
- /package/dist/components/atoms/Radios/RadioButton/{RadioButtonBase.cjs → components/RadioButtonBase.cjs} +0 -0
- /package/dist/components/atoms/Radios/RadioButton/{RadioButtonBase.d.ts → components/RadioButtonBase.d.ts} +0 -0
- /package/dist/components/atoms/Radios/RadioButton/{RadioButtonBase.js → components/RadioButtonBase.js} +0 -0
- /package/dist/components/molecules/Selects/Select/{Popover.d.ts → components/Popover.d.ts} +0 -0
- /package/dist/components/molecules/Tags/Tag/{TagAvatar.d.ts → components/TagAvatar.d.ts} +0 -0
- /package/dist/components/organisms/DatePickers/DatePicker/{Calendar.d.ts → components/Calendar.d.ts} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var RadioButtonBase = require('./RadioButton/components/RadioButtonBase.cjs');
|
|
3
4
|
var RadioButton = require('./RadioButton/RadioButton.cjs');
|
|
4
|
-
var RadioButtonBase = require('./RadioButton/RadioButtonBase.cjs');
|
|
5
5
|
var RadioGroup = require('./RadioGroup/RadioGroup.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.RadioButton = RadioButton.RadioButton;
|
|
10
9
|
exports.RadioButtonBase = RadioButtonBase.RadioButtonBase;
|
|
10
|
+
exports.RadioButton = RadioButton.RadioButton;
|
|
11
11
|
exports.RadioGroup = RadioGroup.RadioGroup;
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* Each member's implementation, stories and docs live in its own folder (`RadioButton/RadioButton.tsx`), never as
|
|
8
8
|
* `index.tsx`: the `exports` wildcard would make that folder a public path.
|
|
9
9
|
*/
|
|
10
|
+
export type { RadioButtonBaseProps } from './RadioButton/components/RadioButtonBase';
|
|
11
|
+
export { RadioButtonBase } from './RadioButton/components/RadioButtonBase';
|
|
10
12
|
export type { RadioButtonProps } from './RadioButton/RadioButton';
|
|
11
13
|
export { RadioButton } from './RadioButton/RadioButton';
|
|
12
|
-
export type { RadioButtonBaseProps } from './RadioButton/RadioButtonBase';
|
|
13
|
-
export { RadioButtonBase } from './RadioButton/RadioButtonBase';
|
|
14
14
|
export type { RadioGroupProps } from './RadioGroup/RadioGroup';
|
|
15
15
|
export { RadioGroup } from './RadioGroup/RadioGroup';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Radios/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Radios/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
export { RadioButtonBase } from './RadioButton/components/RadioButtonBase.js';
|
|
1
2
|
export { RadioButton } from './RadioButton/RadioButton.js';
|
|
2
|
-
export { RadioButtonBase } from './RadioButton/RadioButtonBase.js';
|
|
3
3
|
export { RadioGroup } from './RadioGroup/RadioGroup.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,58 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var uiIcons = require('@flipdish/ui-icons');
|
|
5
|
-
var Input = require('@flipdish/ui-library/components/atoms/Input');
|
|
6
|
-
var LoadingIndicator = require('@flipdish/ui-library/components/atoms/LoadingIndicator');
|
|
7
|
-
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
8
|
-
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
9
|
-
var reactAriaComponents = require('react-aria-components');
|
|
10
|
-
var useDebouncedSearch = require('../../../hooks/__internal__/useDebouncedSearch/useDebouncedSearch.cjs');
|
|
11
|
-
var useHotkeyHint = require('../../../hooks/__internal__/useHotkeyHint/useHotkeyHint.cjs');
|
|
3
|
+
var Inputs = require('@flipdish/ui-library/components/atoms/Inputs');
|
|
12
4
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
md: { input: 'py-2 pr-9 pl-10 text-md', icon: 'left-3 size-5', clear: 'right-2', shortcut: 'pr-2' },
|
|
16
|
-
lg: { input: 'py-2.5 pr-9.5 pl-10.5 text-md', icon: 'left-3.5 size-5', clear: 'right-2.5', shortcut: 'pr-2.5' },
|
|
17
|
-
});
|
|
18
|
-
/**
|
|
19
|
-
* A search box with a magnifier, a clear button once it holds text, and Escape to clear. Use it
|
|
20
|
-
* wherever typing filters a list or table; for a field that collects a value, use `Input`.
|
|
21
|
-
*
|
|
22
|
-
* @summary search box that filters as you type and clears in one press
|
|
23
|
-
*/
|
|
24
|
-
const SearchInput = ({ label, hint, placeholder, size = 'md', clearLabel = 'Clear search', isLoading = false, debounce, shortcut, className, wrapperClassName, inputClassName, ref, 'data-testid': dataTestId, ...props }) => {
|
|
25
|
-
const inputTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'search-input', rootName: 'search-input' });
|
|
26
|
-
const shortcutLabel = useHotkeyHint.useHotkeyHint(shortcut === true ? 'mod+k' : shortcut || null);
|
|
27
|
-
const { onChange, onSubmit, onClear, defaultValue, ...fieldProps } = props;
|
|
28
|
-
const draft = useDebouncedSearch.useDebouncedSearch({
|
|
29
|
-
value: props.value ?? '',
|
|
30
|
-
initialValue: defaultValue,
|
|
31
|
-
onChange: (next) => onChange?.(next),
|
|
32
|
-
delay: debounce ?? 0,
|
|
33
|
-
});
|
|
34
|
-
// With `debounce` the field shows its draft and commits through the hook; without it the props reach the field untouched.
|
|
35
|
-
// The draft already starts from `defaultValue`, so the field gets only `value`, never both.
|
|
36
|
-
const debouncedProps = {
|
|
37
|
-
...fieldProps,
|
|
38
|
-
value: draft.draft,
|
|
39
|
-
onChange: draft.change,
|
|
40
|
-
onSubmit: (value) => {
|
|
41
|
-
draft.submit();
|
|
42
|
-
onSubmit?.(value);
|
|
43
|
-
},
|
|
44
|
-
onClear: () => {
|
|
45
|
-
draft.clear();
|
|
46
|
-
onClear?.();
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
return (jsxRuntime.jsx(reactAriaComponents.SearchField, { "aria-label": label ? undefined : placeholder, ...(debounce === undefined ? props : debouncedProps), className: cx.cx('group/search flex h-max w-full flex-col items-start gap-1.5', className), children: ({ isInvalid, isDisabled }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label && jsxRuntime.jsx(Input.Label, { isInvalid: isInvalid, children: label }), jsxRuntime.jsxs(reactAriaComponents.Group, { isDisabled: isDisabled, isInvalid: isInvalid, className: ({ isFocusWithin }) => cx.cx('relative flex w-full items-center rounded-lg bg-primary shadow-xs ring-1 ring-primary transition-shadow duration-100 ease-linear ring-inset', isFocusWithin && !isDisabled && 'ring-2 ring-brand', isDisabled && 'cursor-not-allowed opacity-50', isInvalid && 'ring-error_subtle', isInvalid && isFocusWithin && 'ring-2 ring-error', wrapperClassName), children: [isLoading ? (
|
|
50
|
-
// In the magnifier's slot, with its size classes, so the field does not shift; the input's `aria-busy` carries the state.
|
|
51
|
-
jsxRuntime.jsx("span", { "aria-hidden": "true", "data-testid": testIdUtils.joinTestId(inputTestId, 'loading'), className: cx.cx('pointer-events-none absolute flex items-center justify-center', sizes[size].icon), children: jsxRuntime.jsx(LoadingIndicator.LoadingIndicator, { size: "xs" }) })) : (jsxRuntime.jsx(uiIcons.SearchLg, { "aria-hidden": "true", className: cx.cx('pointer-events-none absolute text-fg-quaternary', sizes[size].icon) })), jsxRuntime.jsx(reactAriaComponents.Input, { ref: ref, "data-testid": inputTestId, placeholder: placeholder, "aria-busy": isLoading || undefined, className: cx.cx(
|
|
52
|
-
// The browser draws its own cancel control on a search input; the clear button below replaces it.
|
|
53
|
-
'm-0 w-full bg-transparent text-primary ring-0 outline-hidden placeholder:text-placeholder disabled:cursor-not-allowed [&::-webkit-search-cancel-button]:hidden', sizes[size].input, inputClassName) }), jsxRuntime.jsx(reactAriaComponents.Button, { "aria-label": clearLabel, "data-testid": testIdUtils.joinTestId(inputTestId, 'clear'), className: cx.cx('absolute flex cursor-pointer items-center justify-center rounded-md p-1 text-fg-quaternary outline-focus-ring transition duration-100 ease-linear group-data-empty/search:hidden group-data-disabled/search:hidden group-data-readonly/search:hidden hover:text-fg-quaternary_hover focus-visible:outline-2', sizes[size].clear), children: jsxRuntime.jsx(uiIcons.XClose, { "aria-hidden": "true", className: "size-4 stroke-[2.25px]" }) }), shortcut && (jsxRuntime.jsx("div", { className: cx.cx('pointer-events-none absolute inset-y-0.5 right-0.5 z-10 hidden items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8 group-data-empty/search:md:flex', sizes[size].shortcut), children: jsxRuntime.jsx("span", { "aria-hidden": "true", className: "rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset", children: shortcutLabel }) }))] }), hint && jsxRuntime.jsx(Input.HintText, { isInvalid: isInvalid, children: hint })] })) }));
|
|
54
|
-
};
|
|
55
|
-
SearchInput.displayName = 'SearchInput';
|
|
5
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Inputs`. Removed in the next major. */
|
|
6
|
+
const SearchInput = Inputs.SearchInput;
|
|
56
7
|
|
|
57
8
|
exports.SearchInput = SearchInput;
|
|
58
9
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/SearchInput/index.tsx"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/SearchInput/index.tsx"],"sourcesContent":[null],"names":["SearchInputNext"],"mappings":";;;;AAMA;AACO,MAAM,WAAW,GAAGA;;"}
|
|
@@ -1,47 +1,9 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
export interface SearchInputProps extends Omit<AriaSearchFieldProps, 'children' | 'className' | 'style'> {
|
|
4
|
-
/** Visible label above the field. Without one, pass `aria-label`; the placeholder alone does not name the field once it holds a value. */
|
|
5
|
-
label?: string;
|
|
6
|
-
/** Helper text under the field. */
|
|
7
|
-
hint?: ReactNode;
|
|
8
|
-
/** Placeholder shown while the field is empty. */
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
/** Height, padding and text size. */
|
|
11
|
-
size?: 'sm' | 'md' | 'lg';
|
|
12
|
-
/** Accessible name of the clear button. */
|
|
13
|
-
clearLabel?: string;
|
|
14
|
-
/** A search is running: a spinner takes the magnifier's place and the input is `aria-busy`, so results stay readable. */
|
|
15
|
-
isLoading?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Commits typing to `onChange` only once it pauses for this many milliseconds, with Enter and the clear button committing at
|
|
18
|
-
* once. The field keeps its own draft meanwhile; a `value` changed elsewhere, by Back or a reset, replaces the draft.
|
|
19
|
-
*/
|
|
20
|
-
debounce?: number;
|
|
21
|
-
/**
|
|
22
|
-
* Keyboard shortcut hint shown while the field is empty. `true` shows the search shortcut (⌘K on
|
|
23
|
-
* macOS, Ctrl K elsewhere); a shortcut such as `mod+j` is drawn for the user's platform.
|
|
24
|
-
*/
|
|
25
|
-
shortcut?: string | boolean;
|
|
26
|
-
/** Extra classes merged onto the outer field. */
|
|
27
|
-
className?: string;
|
|
28
|
-
/** Extra classes merged onto the bordered group around the input. */
|
|
29
|
-
wrapperClassName?: string;
|
|
30
|
-
/** Extra classes merged onto the `<input>`. */
|
|
31
|
-
inputClassName?: string;
|
|
32
|
-
/** Ref forwarded to the `<input>`. */
|
|
33
|
-
ref?: Ref<HTMLInputElement>;
|
|
34
|
-
/** Overrides the `<input>`'s `data-testid` (defaults to `fd-search-input`). The clear button derives `<root>--clear`. */
|
|
35
|
-
'data-testid'?: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* A search box with a magnifier, a clear button once it holds text, and Escape to clear. Use it
|
|
39
|
-
* wherever typing filters a list or table; for a field that collects a value, use `Input`.
|
|
40
|
-
*
|
|
41
|
-
* @summary search box that filters as you type and clears in one press
|
|
42
|
-
*/
|
|
1
|
+
import { type SearchInputProps as SearchInputPropsNext } from '@flipdish/ui-library/components/atoms/Inputs';
|
|
2
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Inputs`. Removed in the next major. */
|
|
43
3
|
export declare const SearchInput: {
|
|
44
|
-
({ label, hint, placeholder, size, clearLabel, isLoading, debounce, shortcut, className, wrapperClassName, inputClassName, ref, "data-testid": dataTestId, ...props }:
|
|
4
|
+
({ label, hint, placeholder, size, clearLabel, isLoading, debounce, shortcut, className, wrapperClassName, inputClassName, ref, "data-testid": dataTestId, ...props }: SearchInputPropsNext): import("react").JSX.Element;
|
|
45
5
|
displayName: string;
|
|
46
6
|
};
|
|
7
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Inputs`. Removed in the next major. */
|
|
8
|
+
export type SearchInputProps = SearchInputPropsNext;
|
|
47
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/SearchInput/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/SearchInput/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAkC,KAAK,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAE7I,yGAAyG;AACzG,eAAO,MAAM,WAAW;;;CAAkB,CAAC;AAC3C,yGAAyG;AACzG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC"}
|
|
@@ -1,56 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SearchLg, XClose } from '@flipdish/ui-icons';
|
|
3
|
-
import { Label, HintText } from '@flipdish/ui-library/components/atoms/Input';
|
|
4
|
-
import { LoadingIndicator } from '@flipdish/ui-library/components/atoms/LoadingIndicator';
|
|
5
|
-
import { sortCx, cx } from '@flipdish/ui-library/utilities/cx';
|
|
6
|
-
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
7
|
-
import { SearchField, Group, Input, Button } from 'react-aria-components';
|
|
8
|
-
import { useDebouncedSearch } from '../../../hooks/__internal__/useDebouncedSearch/useDebouncedSearch.js';
|
|
9
|
-
import { useHotkeyHint } from '../../../hooks/__internal__/useHotkeyHint/useHotkeyHint.js';
|
|
1
|
+
import { SearchInput as SearchInput$1 } from '@flipdish/ui-library/components/atoms/Inputs';
|
|
10
2
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
md: { input: 'py-2 pr-9 pl-10 text-md', icon: 'left-3 size-5', clear: 'right-2', shortcut: 'pr-2' },
|
|
14
|
-
lg: { input: 'py-2.5 pr-9.5 pl-10.5 text-md', icon: 'left-3.5 size-5', clear: 'right-2.5', shortcut: 'pr-2.5' },
|
|
15
|
-
});
|
|
16
|
-
/**
|
|
17
|
-
* A search box with a magnifier, a clear button once it holds text, and Escape to clear. Use it
|
|
18
|
-
* wherever typing filters a list or table; for a field that collects a value, use `Input`.
|
|
19
|
-
*
|
|
20
|
-
* @summary search box that filters as you type and clears in one press
|
|
21
|
-
*/
|
|
22
|
-
const SearchInput = ({ label, hint, placeholder, size = 'md', clearLabel = 'Clear search', isLoading = false, debounce, shortcut, className, wrapperClassName, inputClassName, ref, 'data-testid': dataTestId, ...props }) => {
|
|
23
|
-
const inputTestId = useResolvedTestId({ testId: dataTestId, segment: 'search-input', rootName: 'search-input' });
|
|
24
|
-
const shortcutLabel = useHotkeyHint(shortcut === true ? 'mod+k' : shortcut || null);
|
|
25
|
-
const { onChange, onSubmit, onClear, defaultValue, ...fieldProps } = props;
|
|
26
|
-
const draft = useDebouncedSearch({
|
|
27
|
-
value: props.value ?? '',
|
|
28
|
-
initialValue: defaultValue,
|
|
29
|
-
onChange: (next) => onChange?.(next),
|
|
30
|
-
delay: debounce ?? 0,
|
|
31
|
-
});
|
|
32
|
-
// With `debounce` the field shows its draft and commits through the hook; without it the props reach the field untouched.
|
|
33
|
-
// The draft already starts from `defaultValue`, so the field gets only `value`, never both.
|
|
34
|
-
const debouncedProps = {
|
|
35
|
-
...fieldProps,
|
|
36
|
-
value: draft.draft,
|
|
37
|
-
onChange: draft.change,
|
|
38
|
-
onSubmit: (value) => {
|
|
39
|
-
draft.submit();
|
|
40
|
-
onSubmit?.(value);
|
|
41
|
-
},
|
|
42
|
-
onClear: () => {
|
|
43
|
-
draft.clear();
|
|
44
|
-
onClear?.();
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
return (jsx(SearchField, { "aria-label": label ? undefined : placeholder, ...(debounce === undefined ? props : debouncedProps), className: cx('group/search flex h-max w-full flex-col items-start gap-1.5', className), children: ({ isInvalid, isDisabled }) => (jsxs(Fragment, { children: [label && jsx(Label, { isInvalid: isInvalid, children: label }), jsxs(Group, { isDisabled: isDisabled, isInvalid: isInvalid, className: ({ isFocusWithin }) => cx('relative flex w-full items-center rounded-lg bg-primary shadow-xs ring-1 ring-primary transition-shadow duration-100 ease-linear ring-inset', isFocusWithin && !isDisabled && 'ring-2 ring-brand', isDisabled && 'cursor-not-allowed opacity-50', isInvalid && 'ring-error_subtle', isInvalid && isFocusWithin && 'ring-2 ring-error', wrapperClassName), children: [isLoading ? (
|
|
48
|
-
// In the magnifier's slot, with its size classes, so the field does not shift; the input's `aria-busy` carries the state.
|
|
49
|
-
jsx("span", { "aria-hidden": "true", "data-testid": joinTestId(inputTestId, 'loading'), className: cx('pointer-events-none absolute flex items-center justify-center', sizes[size].icon), children: jsx(LoadingIndicator, { size: "xs" }) })) : (jsx(SearchLg, { "aria-hidden": "true", className: cx('pointer-events-none absolute text-fg-quaternary', sizes[size].icon) })), jsx(Input, { ref: ref, "data-testid": inputTestId, placeholder: placeholder, "aria-busy": isLoading || undefined, className: cx(
|
|
50
|
-
// The browser draws its own cancel control on a search input; the clear button below replaces it.
|
|
51
|
-
'm-0 w-full bg-transparent text-primary ring-0 outline-hidden placeholder:text-placeholder disabled:cursor-not-allowed [&::-webkit-search-cancel-button]:hidden', sizes[size].input, inputClassName) }), jsx(Button, { "aria-label": clearLabel, "data-testid": joinTestId(inputTestId, 'clear'), className: cx('absolute flex cursor-pointer items-center justify-center rounded-md p-1 text-fg-quaternary outline-focus-ring transition duration-100 ease-linear group-data-empty/search:hidden group-data-disabled/search:hidden group-data-readonly/search:hidden hover:text-fg-quaternary_hover focus-visible:outline-2', sizes[size].clear), children: jsx(XClose, { "aria-hidden": "true", className: "size-4 stroke-[2.25px]" }) }), shortcut && (jsx("div", { className: cx('pointer-events-none absolute inset-y-0.5 right-0.5 z-10 hidden items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8 group-data-empty/search:md:flex', sizes[size].shortcut), children: jsx("span", { "aria-hidden": "true", className: "rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset", children: shortcutLabel }) }))] }), hint && jsx(HintText, { isInvalid: isInvalid, children: hint })] })) }));
|
|
52
|
-
};
|
|
53
|
-
SearchInput.displayName = 'SearchInput';
|
|
3
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Inputs`. Removed in the next major. */
|
|
4
|
+
const SearchInput = SearchInput$1;
|
|
54
5
|
|
|
55
6
|
export { SearchInput };
|
|
56
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/SearchInput/index.tsx"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/SearchInput/index.tsx"],"sourcesContent":[null],"names":["SearchInputNext"],"mappings":";;AAMA;AACO,MAAM,WAAW,GAAGA;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var
|
|
4
|
+
var Inputs = require('@flipdish/ui-library/components/atoms/Inputs');
|
|
5
5
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
6
6
|
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
7
7
|
var React = require('react');
|
|
@@ -29,7 +29,7 @@ const Slider = ({ labelPosition = 'default', minValue = 0, maxValue = 100, label
|
|
|
29
29
|
const hintId = React.useId();
|
|
30
30
|
// react-aria's slider has no description slot, so the hint is linked to the thumbs by id.
|
|
31
31
|
const describedBy = ariaIds_utils.joinIds(ariaDescribedBy, hint && hintId);
|
|
32
|
-
return (jsxRuntime.jsxs(reactAriaComponents.Slider, { ...rest, minValue, maxValue, formatOptions: formatOptions ?? defaultFormatOptions, "aria-describedby": describedBy, "data-testid": sliderTestId, className: (state) => cx.cx('flex flex-col gap-1.5', typeof className === 'function' ? className(state) : className), children: [label ? jsxRuntime.jsx(
|
|
32
|
+
return (jsxRuntime.jsxs(reactAriaComponents.Slider, { ...rest, minValue, maxValue, formatOptions: formatOptions ?? defaultFormatOptions, "aria-describedby": describedBy, "data-testid": sliderTestId, className: (state) => cx.cx('flex flex-col gap-1.5', typeof className === 'function' ? className(state) : className), children: [label ? jsxRuntime.jsx(Inputs.Label, { children: label }) : null, jsxRuntime.jsx(reactAriaComponents.SliderTrack, { className: cx.cx('relative h-6 w-full', labelPosition === 'bottom' && 'mb-8', labelPosition === 'top-floating' && label && 'mt-9'), "data-testid": testIdUtils.joinTestId(sliderTestId, 'track'), children: ({ state: { values, getThumbValue, getThumbPercent, getFormattedValue } }) => {
|
|
33
33
|
const left = values.length === 1 ? 0 : getThumbPercent(0);
|
|
34
34
|
const width = values.length === 1 ? getThumbPercent(0) : getThumbPercent(1) - left;
|
|
35
35
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { className: "absolute top-1/2 h-2 w-full -translate-y-1/2 rounded-full bg-quaternary" }), jsxRuntime.jsx("span", { className: "absolute top-1/2 h-2 w-full -translate-y-1/2 rounded-full bg-brand-solid", style: {
|
|
@@ -40,7 +40,7 @@ const Slider = ({ labelPosition = 'default', minValue = 0, maxValue = 100, label
|
|
|
40
40
|
// biome-ignore lint/suspicious/noArrayIndexKey: static, ordered list of thumbs
|
|
41
41
|
, { index: index, isInvalid: isInvalid, "data-testid": testIdUtils.joinTestId(sliderTestId, `thumb-${index}`), className: ({ isFocusVisible, isDragging }) => cx.cx('top-1/2 box-border size-6 cursor-grab rounded-full bg-slider-handle-bg shadow-md ring-2 ring-slider-handle-border ring-inset', isFocusVisible && 'outline-2 outline-offset-2 outline-focus-ring', isDragging && 'cursor-grabbing'), children: jsxRuntime.jsx(reactAriaComponents.SliderOutput, { className: cx.cx('whitespace-nowrap', styles[labelPosition]), "data-testid": testIdUtils.joinTestId(sliderTestId, `output-${index}`), children: labelFormatter ? labelFormatter(getThumbValue(index)) : getFormattedValue(getThumbValue(index) / 100) }) }, index));
|
|
42
42
|
})] }));
|
|
43
|
-
} }), hint ? jsxRuntime.jsx(
|
|
43
|
+
} }), hint ? jsxRuntime.jsx(Inputs.HintText, { id: hintId, children: hint }) : null] }));
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
exports.Slider = Slider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/Slider/index.tsx"],"sourcesContent":[null],"names":["sortCx","useResolvedTestId","useId","joinIds","_jsxs","AriaSlider","cx","_jsx","Label","AriaSliderTrack","joinTestId","_Fragment","AriaSliderThumb","AriaSliderOutput","HintText"],"mappings":";;;;;;;;;;AAeA,MAAM,MAAM,GAAGA,SAAM,CAAC;AACpB,IAAA,OAAO,EAAE,QAAQ;AACjB,IAAA,MAAM,EAAE,4FAA4F;AACpG,IAAA,cAAc,EACZ,wKAAwK;AAC3K,CAAA,CAAC;AAiBF;;;;;AAKG;AACI,MAAM,MAAM,GAAG,CAAC,EACrB,aAAa,GAAG,SAAS,EACzB,QAAQ,GAAG,CAAC,EACZ,QAAQ,GAAG,GAAG,EACd,KAAK,EACL,IAAI,EACJ,cAAc,EACd,SAAS,EACT,aAAa,EACb,SAAS,EACT,kBAAkB,EAAE,eAAe,EACnC,aAAa,EAAE,UAAU,EACzB,GAAG,IAAI,EACK,KAAI;;AAEhB,IAAA,MAAM,oBAAoB,GAA6B;AACrD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,qBAAqB,EAAE,CAAC;KACzB;AACD,IAAA,MAAM,YAAY,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACrG,IAAA,MAAM,MAAM,GAAGC,WAAK,EAAE;;IAEtB,MAAM,WAAW,GAAGC,qBAAO,CAAC,eAAe,EAAE,IAAI,IAAI,MAAM,CAAC;IAE5D,QACEC,eAAA,CAACC,0BAAU,EAAA,EAAA,GACL,IAAI,EACF,QAAQ,EAAE,QAAQ,EACxB,aAAa,EAAE,aAAa,IAAI,oBAAoB,EAAA,kBAAA,EAClC,WAAW,EAAA,aAAA,EAChB,YAAY,EACzB,SAAS,EAAE,CAAC,KAAK,KAAKC,KAAE,CAAC,uBAAuB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,aAEhH,KAAK,GAAGC,cAAA,CAACC,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/Slider/index.tsx"],"sourcesContent":[null],"names":["sortCx","useResolvedTestId","useId","joinIds","_jsxs","AriaSlider","cx","_jsx","Label","AriaSliderTrack","joinTestId","_Fragment","AriaSliderThumb","AriaSliderOutput","HintText"],"mappings":";;;;;;;;;;AAeA,MAAM,MAAM,GAAGA,SAAM,CAAC;AACpB,IAAA,OAAO,EAAE,QAAQ;AACjB,IAAA,MAAM,EAAE,4FAA4F;AACpG,IAAA,cAAc,EACZ,wKAAwK;AAC3K,CAAA,CAAC;AAiBF;;;;;AAKG;AACI,MAAM,MAAM,GAAG,CAAC,EACrB,aAAa,GAAG,SAAS,EACzB,QAAQ,GAAG,CAAC,EACZ,QAAQ,GAAG,GAAG,EACd,KAAK,EACL,IAAI,EACJ,cAAc,EACd,SAAS,EACT,aAAa,EACb,SAAS,EACT,kBAAkB,EAAE,eAAe,EACnC,aAAa,EAAE,UAAU,EACzB,GAAG,IAAI,EACK,KAAI;;AAEhB,IAAA,MAAM,oBAAoB,GAA6B;AACrD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,qBAAqB,EAAE,CAAC;KACzB;AACD,IAAA,MAAM,YAAY,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACrG,IAAA,MAAM,MAAM,GAAGC,WAAK,EAAE;;IAEtB,MAAM,WAAW,GAAGC,qBAAO,CAAC,eAAe,EAAE,IAAI,IAAI,MAAM,CAAC;IAE5D,QACEC,eAAA,CAACC,0BAAU,EAAA,EAAA,GACL,IAAI,EACF,QAAQ,EAAE,QAAQ,EACxB,aAAa,EAAE,aAAa,IAAI,oBAAoB,EAAA,kBAAA,EAClC,WAAW,EAAA,aAAA,EAChB,YAAY,EACzB,SAAS,EAAE,CAAC,KAAK,KAAKC,KAAE,CAAC,uBAAuB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,aAEhH,KAAK,GAAGC,cAAA,CAACC,YAAK,cAAE,KAAK,EAAA,CAAS,GAAG,IAAI,EAEtCD,cAAA,CAACE,+BAAe,EAAA,EACd,SAAS,EAAEH,KAAE,CAAC,qBAAqB,EAAE,aAAa,KAAK,QAAQ,IAAI,MAAM,EAAE,aAAa,KAAK,cAAc,IAAI,KAAK,IAAI,MAAM,CAAC,EAAA,aAAA,EAClHI,sBAAU,CAAC,YAAY,EAAE,OAAO,CAAC,EAAA,QAAA,EAE7C,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,EAAE,KAAI;AAC5E,oBAAA,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC;oBACzD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI;AAElF,oBAAA,QACEN,eAAA,CAAAO,mBAAA,EAAA,EAAA,QAAA,EAAA,CACEJ,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,yEAAyE,EAAA,CAAG,EAC5FA,cAAA,CAAA,MAAA,EAAA,EACE,SAAS,EAAC,0EAA0E,EACpF,KAAK,EAAE;AACL,oCAAA,IAAI,EAAE,CAAA,EAAG,IAAI,GAAG,GAAG,CAAA,CAAA,CAAG;AACtB,oCAAA,KAAK,EAAE,CAAA,EAAG,KAAK,GAAG,GAAG,CAAA,CAAA,CAAG;iCACzB,EAAA,CACD,EACD,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAI;gCACvB,QACEA,eAACK;;oCAGC,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EAAA,aAAA,EACPF,sBAAU,CAAC,YAAY,EAAE,CAAA,MAAA,EAAS,KAAK,EAAE,CAAC,EACvD,SAAS,EAAE,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,KACxCJ,KAAE,CACA,8HAA8H,EAC9H,cAAc,IAAI,+CAA+C,EACjE,UAAU,IAAI,iBAAiB,CAChC,EAAA,QAAA,EAGHC,eAACM,gCAAgB,EAAA,EACf,SAAS,EAAEP,KAAE,CAAC,mBAAmB,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,EAAA,aAAA,EAC5CI,sBAAU,CAAC,YAAY,EAAE,CAAA,OAAA,EAAU,KAAK,EAAE,CAAC,EAAA,QAAA,EAEvD,cAAc,GAAG,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GAAG,iBAAiB,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,EAAA,CACrF,IAjBd,KAAK,CAkBM;4BAEtB,CAAC,CAAC,CAAA,EAAA,CACD;gBAEP,CAAC,EAAA,CACe,EACjB,IAAI,GAAGH,cAAA,CAACO,eAAQ,EAAA,EAAC,EAAE,EAAE,MAAM,EAAA,QAAA,EAAG,IAAI,EAAA,CAAY,GAAG,IAAI,CAAA,EAAA,CAC3C;AAEjB;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { Label, HintText } from '@flipdish/ui-library/components/atoms/
|
|
2
|
+
import { Label, HintText } from '@flipdish/ui-library/components/atoms/Inputs';
|
|
3
3
|
import { sortCx, cx } from '@flipdish/ui-library/utilities/cx';
|
|
4
4
|
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
5
5
|
import { useId } from 'react';
|
|
@@ -1,57 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
6
|
-
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var reactAriaComponents = require('react-aria-components');
|
|
9
|
-
var componentGuard_utils = require('../../../utilities/__internal__/componentGuardUtils/componentGuard.utils.cjs');
|
|
3
|
+
var Buttons = require('@flipdish/ui-library/components/atoms/Buttons');
|
|
4
|
+
var IconButton = require('../Buttons/IconButton/IconButton.cjs');
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Compact icon-only button for toolbar, table, and card actions that should not
|
|
17
|
-
* compete visually with primary calls-to-action. Renders as a `<button>` by
|
|
18
|
-
* default; pass `href` to render as an `<a>` tag.
|
|
19
|
-
*
|
|
20
|
-
* @summary compact icon-only button for toolbar actions
|
|
21
|
-
*/
|
|
22
|
-
const ButtonUtility = ({ tooltip, className, isDisabled, icon: Icon, size = 'sm', color = 'secondary', tooltipPlacement = 'top', 'data-testid': dataTestId, ...otherProps }) => {
|
|
23
|
-
const buttonUtilityTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'button-utility', rootName: 'button-utility' });
|
|
24
|
-
const href = 'href' in otherProps ? otherProps.href : undefined;
|
|
25
|
-
const Component = href ? reactAriaComponents.Link : reactAriaComponents.Button;
|
|
26
|
-
let props = {};
|
|
27
|
-
if (href) {
|
|
28
|
-
// react-aria writes `href=""` on the span for an `href` key that is present but undefined, so a disabled link drops the key.
|
|
29
|
-
const { href: _href, ...withoutHref } = otherProps;
|
|
30
|
-
props = {
|
|
31
|
-
...(isDisabled ? withoutHref : otherProps),
|
|
32
|
-
// Without it react-aria keeps the span focusable and still fires `onPress`.
|
|
33
|
-
isDisabled,
|
|
34
|
-
// Since anchor elements do not support the `disabled` attribute and state,
|
|
35
|
-
// we need to specify `data-rac` and `data-disabled` in order to be able
|
|
36
|
-
// to use the `disabled:` selector in classes.
|
|
37
|
-
...(isDisabled ? { 'data-rac': true, 'data-disabled': true } : {}),
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
props = {
|
|
42
|
-
...otherProps,
|
|
43
|
-
type: otherProps.type || 'button',
|
|
44
|
-
isDisabled,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
const content = (jsxRuntime.jsxs(Component, { "aria-label": tooltip, ...props, "data-testid": buttonUtilityTestId, className: cx.cx('group relative inline-flex h-max cursor-pointer items-center justify-center rounded-md p-1.5 outline-focus-ring transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50', styles[color],
|
|
48
|
-
// Icon styles
|
|
49
|
-
'*:data-icon:pointer-events-none *:data-icon:shrink-0 *:data-icon:text-current *:data-icon:transition-inherit-all', size === 'xs' ? '*:data-icon:size-4' : '*:data-icon:size-5', className), children: [componentGuard_utils.isReactComponent(Icon) && jsxRuntime.jsx(Icon, { "data-icon": true }), React.isValidElement(Icon) && Icon] }));
|
|
50
|
-
if (tooltip) {
|
|
51
|
-
return (jsxRuntime.jsx(Tooltip.Tooltip, { title: tooltip, placement: tooltipPlacement, isDisabled: isDisabled, offset: size === 'xs' ? 4 : 6, children: content }));
|
|
52
|
-
}
|
|
53
|
-
return content;
|
|
54
|
-
};
|
|
6
|
+
/** @deprecated Use `IconButton` from `@flipdish/ui-library/components/atoms/Buttons`, which requires a `tooltip` or an `aria-label`. Removed in the next major. */
|
|
7
|
+
const ButtonUtility = Buttons.IconButton;
|
|
8
|
+
/** @deprecated Not exported from `@flipdish/ui-library/components/atoms/Buttons`. Removed in the next major. */
|
|
9
|
+
const styles = IconButton.styles;
|
|
55
10
|
|
|
56
11
|
exports.ButtonUtility = ButtonUtility;
|
|
57
12
|
exports.styles = styles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/UtilityButton/index.tsx"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/atoms/UtilityButton/index.tsx"],"sourcesContent":[null],"names":["IconButtonNext","stylesNext"],"mappings":";;;;;AAcA;AACO,MAAM,aAAa,GAAGA;AAO7B;AACO,MAAM,MAAM,GAAsBC;;;"}
|
|
@@ -1,55 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/** The size variant of the button */
|
|
14
|
-
size?: 'xs' | 'sm';
|
|
15
|
-
/** The color variant of the button */
|
|
16
|
-
color?: 'secondary' | 'tertiary';
|
|
17
|
-
/** The icon to display in the button */
|
|
18
|
-
icon?: FC<{
|
|
19
|
-
className?: string;
|
|
20
|
-
}> | ReactNode;
|
|
21
|
-
/** The tooltip to display when hovering over the button */
|
|
22
|
-
tooltip?: string;
|
|
23
|
-
/** The placement of the tooltip */
|
|
24
|
-
tooltipPlacement?: Placement;
|
|
25
|
-
/** Overrides the `data-testid` (defaults to `fd-button-utility`). */
|
|
26
|
-
'data-testid'?: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Props for the button variant (non-link)
|
|
30
|
-
*/
|
|
31
|
-
export interface ButtonProps extends CommonProps, DetailedHTMLProps<Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'slot'>, HTMLButtonElement> {
|
|
32
|
-
/** Slot name for react-aria component */
|
|
33
|
-
slot?: AriaButtonProps['slot'];
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Props for the link variant (anchor tag)
|
|
37
|
-
*/
|
|
38
|
-
interface LinkProps extends CommonProps, DetailedHTMLProps<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'color'>, HTMLAnchorElement> {
|
|
39
|
-
/** Options for the configured client side router. */
|
|
40
|
-
routerOptions?: AriaLinkProps['routerOptions'];
|
|
41
|
-
/** Runs on a press of the link, alongside the navigation. */
|
|
42
|
-
onPress?: AriaLinkProps['onPress'];
|
|
43
|
-
}
|
|
44
|
-
/** Union type of button and link props */
|
|
45
|
-
export type Props = ButtonProps | LinkProps;
|
|
46
|
-
/**
|
|
47
|
-
* Compact icon-only button for toolbar, table, and card actions that should not
|
|
48
|
-
* compete visually with primary calls-to-action. Renders as a `<button>` by
|
|
49
|
-
* default; pass `href` to render as an `<a>` tag.
|
|
50
|
-
*
|
|
51
|
-
* @summary compact icon-only button for toolbar actions
|
|
52
|
-
*/
|
|
53
|
-
export declare const ButtonUtility: ({ tooltip, className, isDisabled, icon: Icon, size, color, tooltipPlacement, "data-testid": dataTestId, ...otherProps }: Props) => import("react").JSX.Element;
|
|
54
|
-
export {};
|
|
1
|
+
import { IconButton as IconButtonNext } from '@flipdish/ui-library/components/atoms/Buttons';
|
|
2
|
+
import { type ButtonProps as ButtonPropsNext, type CommonProps as CommonPropsNext, type Props as PropsNext, styles as stylesNext } from '../Buttons/IconButton/IconButton';
|
|
3
|
+
/** @deprecated Use `IconButton` from `@flipdish/ui-library/components/atoms/Buttons`, which requires a `tooltip` or an `aria-label`. Removed in the next major. */
|
|
4
|
+
export declare const ButtonUtility: (props: PropsNext) => ReturnType<typeof IconButtonNext>;
|
|
5
|
+
/** @deprecated Use `IconButtonProps` from `@flipdish/ui-library/components/atoms/Buttons`. Removed in the next major. */
|
|
6
|
+
export type Props = PropsNext;
|
|
7
|
+
/** @deprecated Not exported from `@flipdish/ui-library/components/atoms/Buttons`. Removed in the next major. */
|
|
8
|
+
export type ButtonProps = ButtonPropsNext;
|
|
9
|
+
/** @deprecated Not exported from `@flipdish/ui-library/components/atoms/Buttons`. Removed in the next major. */
|
|
10
|
+
export type CommonProps = CommonPropsNext;
|
|
11
|
+
/** @deprecated Not exported from `@flipdish/ui-library/components/atoms/Buttons`. Removed in the next major. */
|
|
12
|
+
export declare const styles: typeof stylesNext;
|
|
55
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/UtilityButton/index.tsx"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/UtilityButton/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAE7F,OAAO,EACL,KAAK,WAAW,IAAI,eAAe,EACnC,KAAK,WAAW,IAAI,eAAe,EACnC,KAAK,KAAK,IAAI,SAAS,EACvB,MAAM,IAAI,UAAU,EACrB,MAAM,kCAAkC,CAAC;AAE1C,mKAAmK;AACnK,eAAO,MAAM,aAAa,EAAqB,CAAC,KAAK,EAAE,SAAS,KAAK,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACvG,yHAAyH;AACzH,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC;AAC9B,gHAAgH;AAChH,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC;AAC1C,gHAAgH;AAChH,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC;AAC1C,gHAAgH;AAChH,eAAO,MAAM,MAAM,EAAE,OAAO,UAAuB,CAAC"}
|
|
@@ -1,55 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
4
|
-
import { useResolvedTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
5
|
-
import { isValidElement } from 'react';
|
|
6
|
-
import { Link, Button } from 'react-aria-components';
|
|
7
|
-
import { isReactComponent } from '../../../utilities/__internal__/componentGuardUtils/componentGuard.utils.js';
|
|
1
|
+
import { IconButton } from '@flipdish/ui-library/components/atoms/Buttons';
|
|
2
|
+
import { styles as styles$1 } from '../Buttons/IconButton/IconButton.js';
|
|
8
3
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Compact icon-only button for toolbar, table, and card actions that should not
|
|
15
|
-
* compete visually with primary calls-to-action. Renders as a `<button>` by
|
|
16
|
-
* default; pass `href` to render as an `<a>` tag.
|
|
17
|
-
*
|
|
18
|
-
* @summary compact icon-only button for toolbar actions
|
|
19
|
-
*/
|
|
20
|
-
const ButtonUtility = ({ tooltip, className, isDisabled, icon: Icon, size = 'sm', color = 'secondary', tooltipPlacement = 'top', 'data-testid': dataTestId, ...otherProps }) => {
|
|
21
|
-
const buttonUtilityTestId = useResolvedTestId({ testId: dataTestId, segment: 'button-utility', rootName: 'button-utility' });
|
|
22
|
-
const href = 'href' in otherProps ? otherProps.href : undefined;
|
|
23
|
-
const Component = href ? Link : Button;
|
|
24
|
-
let props = {};
|
|
25
|
-
if (href) {
|
|
26
|
-
// react-aria writes `href=""` on the span for an `href` key that is present but undefined, so a disabled link drops the key.
|
|
27
|
-
const { href: _href, ...withoutHref } = otherProps;
|
|
28
|
-
props = {
|
|
29
|
-
...(isDisabled ? withoutHref : otherProps),
|
|
30
|
-
// Without it react-aria keeps the span focusable and still fires `onPress`.
|
|
31
|
-
isDisabled,
|
|
32
|
-
// Since anchor elements do not support the `disabled` attribute and state,
|
|
33
|
-
// we need to specify `data-rac` and `data-disabled` in order to be able
|
|
34
|
-
// to use the `disabled:` selector in classes.
|
|
35
|
-
...(isDisabled ? { 'data-rac': true, 'data-disabled': true } : {}),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
props = {
|
|
40
|
-
...otherProps,
|
|
41
|
-
type: otherProps.type || 'button',
|
|
42
|
-
isDisabled,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
const content = (jsxs(Component, { "aria-label": tooltip, ...props, "data-testid": buttonUtilityTestId, className: cx('group relative inline-flex h-max cursor-pointer items-center justify-center rounded-md p-1.5 outline-focus-ring transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50', styles[color],
|
|
46
|
-
// Icon styles
|
|
47
|
-
'*:data-icon:pointer-events-none *:data-icon:shrink-0 *:data-icon:text-current *:data-icon:transition-inherit-all', size === 'xs' ? '*:data-icon:size-4' : '*:data-icon:size-5', className), children: [isReactComponent(Icon) && jsx(Icon, { "data-icon": true }), isValidElement(Icon) && Icon] }));
|
|
48
|
-
if (tooltip) {
|
|
49
|
-
return (jsx(Tooltip, { title: tooltip, placement: tooltipPlacement, isDisabled: isDisabled, offset: size === 'xs' ? 4 : 6, children: content }));
|
|
50
|
-
}
|
|
51
|
-
return content;
|
|
52
|
-
};
|
|
4
|
+
/** @deprecated Use `IconButton` from `@flipdish/ui-library/components/atoms/Buttons`, which requires a `tooltip` or an `aria-label`. Removed in the next major. */
|
|
5
|
+
const ButtonUtility = IconButton;
|
|
6
|
+
/** @deprecated Not exported from `@flipdish/ui-library/components/atoms/Buttons`. Removed in the next major. */
|
|
7
|
+
const styles = styles$1;
|
|
53
8
|
|
|
54
9
|
export { ButtonUtility, styles };
|
|
55
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/UtilityButton/index.tsx"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/UtilityButton/index.tsx"],"sourcesContent":[null],"names":["IconButtonNext","stylesNext"],"mappings":";;;AAcA;AACO,MAAM,aAAa,GAAGA;AAO7B;AACO,MAAM,MAAM,GAAsBC;;"}
|