@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,167 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { sortCx, cx } from '@flipdish/ui-library/utilities/cx';
|
|
4
|
-
import { useResolvedTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
5
|
-
import { Link, Button as Button$1 } from 'react-aria-components';
|
|
6
|
-
import { ButtonIcon } from './components/ButtonIcon.js';
|
|
7
|
-
import { ButtonSpinner } from './components/ButtonSpinner.js';
|
|
1
|
+
import { Button as Button$1 } from '@flipdish/ui-library/components/atoms/Buttons';
|
|
2
|
+
import { styles as styles$1 } from '../Buttons/Button/Button.js';
|
|
8
3
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// When button is used within `InputGroup`
|
|
14
|
-
'in-data-input-wrapper:shadow-xs in-data-input-wrapper:focus:!z-50 in-data-input-wrapper:in-data-leading:-mr-px in-data-input-wrapper:in-data-leading:rounded-r-none in-data-input-wrapper:in-data-leading:before:rounded-r-none in-data-input-wrapper:in-data-trailing:-ml-px in-data-input-wrapper:in-data-trailing:rounded-l-none in-data-input-wrapper:in-data-trailing:before:rounded-l-none',
|
|
15
|
-
// Disabled styles
|
|
16
|
-
'disabled:cursor-not-allowed disabled:opacity-50 in-data-input-wrapper:disabled:opacity-100',
|
|
17
|
-
// Same as `icon` but for SSR icons that cannot be passed to the client as functions.
|
|
18
|
-
'*:data-icon:pointer-events-none *:data-icon:size-5 *:data-icon:shrink-0 *:data-icon:transition-inherit-all',
|
|
19
|
-
].join(' '),
|
|
20
|
-
icon: 'pointer-events-none size-5 shrink-0 transition-inherit-all',
|
|
21
|
-
},
|
|
22
|
-
sizes: {
|
|
23
|
-
xs: {
|
|
24
|
-
root: [
|
|
25
|
-
'gap-1 rounded-lg px-2.5 py-1.5 text-sm font-semibold before:rounded-[7px] data-icon-only:p-2',
|
|
26
|
-
'in-data-input-wrapper:px-3.5 in-data-input-wrapper:py-2.5 in-data-input-wrapper:data-icon-only:p-2.5',
|
|
27
|
-
'*:data-icon:size-4 *:data-icon:stroke-[2.25px]',
|
|
28
|
-
].join(' '),
|
|
29
|
-
linkRoot: 'gap-1 *:data-text:underline-offset-3',
|
|
30
|
-
},
|
|
31
|
-
sm: {
|
|
32
|
-
root: [
|
|
33
|
-
'gap-1 rounded-lg px-3 py-2 text-sm font-semibold before:rounded-[7px] data-icon-only:p-2',
|
|
34
|
-
'in-data-input-wrapper:px-3.5 in-data-input-wrapper:py-2.5 in-data-input-wrapper:data-icon-only:p-2.5',
|
|
35
|
-
].join(' '),
|
|
36
|
-
linkRoot: 'gap-1 *:data-text:underline-offset-3',
|
|
37
|
-
},
|
|
38
|
-
md: {
|
|
39
|
-
root: [
|
|
40
|
-
'gap-1 rounded-lg px-3.5 py-2.5 text-sm font-semibold before:rounded-[7px] data-icon-only:p-2.5',
|
|
41
|
-
'in-data-input-wrapper:gap-1.5 in-data-input-wrapper:px-4 in-data-input-wrapper:text-md in-data-input-wrapper:data-icon-only:p-3',
|
|
42
|
-
].join(' '),
|
|
43
|
-
linkRoot: 'gap-1 *:data-text:underline-offset-4',
|
|
44
|
-
},
|
|
45
|
-
lg: {
|
|
46
|
-
root: 'gap-1.5 rounded-lg px-4 py-2.5 text-md font-semibold before:rounded-[7px] data-icon-only:p-3',
|
|
47
|
-
linkRoot: 'gap-1.5 *:data-text:underline-offset-4',
|
|
48
|
-
},
|
|
49
|
-
xl: {
|
|
50
|
-
root: 'gap-1.5 rounded-lg px-4.5 py-3 text-md font-semibold before:rounded-[7px] data-icon-only:p-3.5',
|
|
51
|
-
linkRoot: 'gap-1.5 *:data-text:underline-offset-4',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
colors: {
|
|
55
|
-
primary: {
|
|
56
|
-
root: [
|
|
57
|
-
'bg-brand-solid text-white shadow-xs-skeuomorphic ring-1 ring-transparent ring-inset hover:bg-brand-solid_hover data-loading:bg-brand-solid_hover',
|
|
58
|
-
// Inner border gradient
|
|
59
|
-
'before:absolute before:inset-px before:border before:border-white/12 before:mask-b-from-0%',
|
|
60
|
-
// Icon styles
|
|
61
|
-
'*:data-icon:text-white/60 hover:*:data-icon:text-white/70',
|
|
62
|
-
].join(' '),
|
|
63
|
-
},
|
|
64
|
-
secondary: {
|
|
65
|
-
root: [
|
|
66
|
-
'bg-primary text-secondary shadow-xs-skeuomorphic ring-1 ring-primary ring-inset hover:bg-primary_hover hover:text-secondary_hover data-loading:bg-primary_hover',
|
|
67
|
-
// Icon styles
|
|
68
|
-
'*:data-icon:text-fg-quaternary hover:*:data-icon:text-fg-quaternary_hover',
|
|
69
|
-
].join(' '),
|
|
70
|
-
},
|
|
71
|
-
tertiary: {
|
|
72
|
-
root: [
|
|
73
|
-
'text-tertiary hover:bg-primary_hover hover:text-tertiary_hover data-loading:bg-primary_hover',
|
|
74
|
-
// Icon styles
|
|
75
|
-
'*:data-icon:text-fg-quaternary hover:*:data-icon:text-fg-quaternary_hover',
|
|
76
|
-
].join(' '),
|
|
77
|
-
},
|
|
78
|
-
'link-color': {
|
|
79
|
-
root: [
|
|
80
|
-
'justify-normal rounded p-0! text-brand-secondary hover:text-brand-secondary_hover',
|
|
81
|
-
// Inner text underline
|
|
82
|
-
'*:data-text:underline *:data-text:decoration-transparent hover:*:data-text:decoration-fg-brand-secondary_alt',
|
|
83
|
-
// Icon styles
|
|
84
|
-
'*:data-icon:text-fg-brand-secondary_alt hover:*:data-icon:text-fg-brand-secondary_hover',
|
|
85
|
-
].join(' '),
|
|
86
|
-
},
|
|
87
|
-
'link-gray': {
|
|
88
|
-
root: [
|
|
89
|
-
'justify-normal rounded p-0! text-tertiary hover:text-tertiary_hover',
|
|
90
|
-
// Inner text underline
|
|
91
|
-
'*:data-text:underline *:data-text:decoration-transparent hover:*:data-text:decoration-fg-quaternary',
|
|
92
|
-
// Icon styles
|
|
93
|
-
'*:data-icon:text-fg-quaternary hover:*:data-icon:text-fg-quaternary_hover',
|
|
94
|
-
].join(' '),
|
|
95
|
-
},
|
|
96
|
-
'primary-destructive': {
|
|
97
|
-
root: [
|
|
98
|
-
'bg-error-solid text-white shadow-xs-skeuomorphic ring-1 ring-transparent outline-error ring-inset hover:bg-error-solid_hover data-loading:bg-error-solid_hover',
|
|
99
|
-
// Inner border gradient
|
|
100
|
-
'before:absolute before:inset-px before:border before:border-white/12 before:mask-b-from-0%',
|
|
101
|
-
// Icon styles
|
|
102
|
-
'*:data-icon:text-white/60 hover:*:data-icon:text-white/70',
|
|
103
|
-
].join(' '),
|
|
104
|
-
},
|
|
105
|
-
'secondary-destructive': {
|
|
106
|
-
root: [
|
|
107
|
-
'bg-primary text-error-primary shadow-xs-skeuomorphic ring-1 ring-error_subtle outline-error ring-inset hover:bg-error-primary hover:text-error-primary_hover data-loading:bg-error-primary',
|
|
108
|
-
// Icon styles
|
|
109
|
-
'*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary',
|
|
110
|
-
].join(' '),
|
|
111
|
-
},
|
|
112
|
-
'tertiary-destructive': {
|
|
113
|
-
root: [
|
|
114
|
-
'text-error-primary outline-error hover:bg-error-primary hover:text-error-primary_hover data-loading:bg-error-primary',
|
|
115
|
-
// Icon styles
|
|
116
|
-
'*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary',
|
|
117
|
-
].join(' '),
|
|
118
|
-
},
|
|
119
|
-
'link-destructive': {
|
|
120
|
-
root: [
|
|
121
|
-
'justify-normal rounded p-0! text-error-primary outline-error hover:text-error-primary_hover',
|
|
122
|
-
// Inner text underline
|
|
123
|
-
'*:data-text:underline *:data-text:decoration-transparent *:data-text:underline-offset-2 hover:*:data-text:decoration-current',
|
|
124
|
-
// Icon styles
|
|
125
|
-
'*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary',
|
|
126
|
-
].join(' '),
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
});
|
|
130
|
-
/**
|
|
131
|
-
* Triggers an action or navigates to a destination: a native `<button>` by default, or an
|
|
132
|
-
* `<a>` when `href` is provided. For navigation-only actions, prefer a link styled with one of
|
|
133
|
-
* the `link-*` colors.
|
|
134
|
-
*
|
|
135
|
-
* @summary action trigger or navigation control
|
|
136
|
-
*/
|
|
137
|
-
const Button = ({ size = 'sm', color = 'primary', children, className, noTextPadding, iconLeading: IconLeading, iconTrailing: IconTrailing, isDisabled: disabled, isLoading: loading, isSuccess, showTextWhileLoading, 'data-testid': dataTestId, ...props }) => {
|
|
138
|
-
const href = 'href' in props ? props.href : undefined;
|
|
139
|
-
const buttonTestId = useResolvedTestId({ testId: dataTestId, segment: 'button', rootName: 'button' });
|
|
140
|
-
const hasChildren = children !== null && children !== undefined;
|
|
141
|
-
const isIcon = (IconLeading || IconTrailing) && !hasChildren;
|
|
142
|
-
const showSuccess = isSuccess && !loading;
|
|
143
|
-
const isLinkType = ['link-gray', 'link-color', 'link-destructive'].includes(color);
|
|
144
|
-
noTextPadding = isLinkType || noTextPadding;
|
|
145
|
-
const commonChildren = (jsxs(Fragment, { children: [jsx(ButtonIcon, { icon: showSuccess ? Check : IconLeading, slot: showSuccess ? 'success' : 'leading', className: styles.common.icon }), loading && (jsx(ButtonSpinner, { className: cx(styles.common.icon, !showTextWhileLoading && 'absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2') })), hasChildren && (jsx("span", { "data-text": true, className: cx('transition-inherit-all', !noTextPadding && 'px-0.5'), children: children })), !showSuccess && jsx(ButtonIcon, { icon: IconTrailing, slot: "trailing", className: styles.common.icon })] }));
|
|
146
|
-
const commonProps = {
|
|
147
|
-
'data-loading': loading ? true : undefined,
|
|
148
|
-
'data-icon-only': isIcon ? true : undefined,
|
|
149
|
-
'data-testid': buttonTestId,
|
|
150
|
-
...props,
|
|
151
|
-
isDisabled: disabled,
|
|
152
|
-
className: cx(styles.common.root, styles.sizes[size].root, styles.colors[color].root, isLinkType && styles.sizes[size].linkRoot, (loading || (href && (disabled || loading))) && 'pointer-events-none',
|
|
153
|
-
// If in `loading` state, hide everything except the loading icon (and text if `showTextWhileLoading` is true).
|
|
154
|
-
// Use `opacity-0` (not `invisible`) for the hidden label so it stays in the accessibility tree and the
|
|
155
|
-
// button keeps a discernible accessible name for screen readers while loading.
|
|
156
|
-
loading && (showTextWhileLoading ? '[&>*:not([data-icon=loading]):not([data-text])]:hidden' : '[&>*:not([data-icon=loading])]:opacity-0'), className),
|
|
157
|
-
children: commonChildren,
|
|
158
|
-
};
|
|
159
|
-
if ('href' in commonProps) {
|
|
160
|
-
const { href: _, ...linkProps } = commonProps;
|
|
161
|
-
return jsx(Link, { ...linkProps, ...(disabled ? {} : { href }) });
|
|
162
|
-
}
|
|
163
|
-
return jsx(Button$1, { ...commonProps, type: commonProps.type || 'button', isPending: loading });
|
|
164
|
-
};
|
|
4
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Buttons`. Removed in the next major. */
|
|
5
|
+
const Button = Button$1;
|
|
6
|
+
/** @deprecated Not exported from `@flipdish/ui-library/components/atoms/Buttons`. Removed in the next major. */
|
|
7
|
+
const styles = styles$1;
|
|
165
8
|
|
|
166
9
|
export { Button, styles };
|
|
167
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":[null],"names":["ButtonNext","stylesNext"],"mappings":";;;AAaA;AACO,MAAM,MAAM,GAAsBA;AASzC;AACO,MAAM,MAAM,GAAsBC;;"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var uiIcons = require('@flipdish/ui-icons');
|
|
5
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
6
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
7
|
+
var reactAriaComponents = require('react-aria-components');
|
|
8
|
+
var ButtonIcon = require('./components/ButtonIcon.cjs');
|
|
9
|
+
var ButtonSpinner = require('./components/ButtonSpinner.cjs');
|
|
10
|
+
var useLoadingLinkPress = require('./hooks/useLoadingLinkPress.cjs');
|
|
11
|
+
|
|
12
|
+
const styles = cx.sortCx({
|
|
13
|
+
common: {
|
|
14
|
+
root: [
|
|
15
|
+
'group relative inline-flex h-max cursor-pointer items-center justify-center whitespace-nowrap outline-brand transition duration-100 ease-linear before:absolute focus-visible:outline-2 focus-visible:outline-offset-2',
|
|
16
|
+
// When button is used within `InputGroup`
|
|
17
|
+
'in-data-input-wrapper:shadow-xs in-data-input-wrapper:focus:!z-50 in-data-input-wrapper:in-data-leading:-mr-px in-data-input-wrapper:in-data-leading:rounded-r-none in-data-input-wrapper:in-data-leading:before:rounded-r-none in-data-input-wrapper:in-data-trailing:-ml-px in-data-input-wrapper:in-data-trailing:rounded-l-none in-data-input-wrapper:in-data-trailing:before:rounded-l-none',
|
|
18
|
+
// Disabled styles
|
|
19
|
+
'disabled:cursor-not-allowed disabled:opacity-50 in-data-input-wrapper:disabled:opacity-100',
|
|
20
|
+
// Same as `icon` but for SSR icons that cannot be passed to the client as functions.
|
|
21
|
+
'*:data-icon:pointer-events-none *:data-icon:size-5 *:data-icon:shrink-0 *:data-icon:transition-inherit-all',
|
|
22
|
+
].join(' '),
|
|
23
|
+
icon: 'pointer-events-none size-5 shrink-0 transition-inherit-all',
|
|
24
|
+
},
|
|
25
|
+
sizes: {
|
|
26
|
+
xs: {
|
|
27
|
+
root: [
|
|
28
|
+
'gap-1 rounded-lg px-2.5 py-1.5 text-sm font-semibold before:rounded-[7px] data-icon-only:p-2',
|
|
29
|
+
'in-data-input-wrapper:px-3.5 in-data-input-wrapper:py-2.5 in-data-input-wrapper:data-icon-only:p-2.5',
|
|
30
|
+
'*:data-icon:size-4 *:data-icon:stroke-[2.25px]',
|
|
31
|
+
].join(' '),
|
|
32
|
+
linkRoot: 'gap-1 *:data-text:underline-offset-3',
|
|
33
|
+
},
|
|
34
|
+
sm: {
|
|
35
|
+
root: [
|
|
36
|
+
'gap-1 rounded-lg px-3 py-2 text-sm font-semibold before:rounded-[7px] data-icon-only:p-2',
|
|
37
|
+
'in-data-input-wrapper:px-3.5 in-data-input-wrapper:py-2.5 in-data-input-wrapper:data-icon-only:p-2.5',
|
|
38
|
+
].join(' '),
|
|
39
|
+
linkRoot: 'gap-1 *:data-text:underline-offset-3',
|
|
40
|
+
},
|
|
41
|
+
md: {
|
|
42
|
+
root: [
|
|
43
|
+
'gap-1 rounded-lg px-3.5 py-2.5 text-sm font-semibold before:rounded-[7px] data-icon-only:p-2.5',
|
|
44
|
+
'in-data-input-wrapper:gap-1.5 in-data-input-wrapper:px-4 in-data-input-wrapper:text-md in-data-input-wrapper:data-icon-only:p-3',
|
|
45
|
+
].join(' '),
|
|
46
|
+
linkRoot: 'gap-1 *:data-text:underline-offset-4',
|
|
47
|
+
},
|
|
48
|
+
lg: {
|
|
49
|
+
root: 'gap-1.5 rounded-lg px-4 py-2.5 text-md font-semibold before:rounded-[7px] data-icon-only:p-3',
|
|
50
|
+
linkRoot: 'gap-1.5 *:data-text:underline-offset-4',
|
|
51
|
+
},
|
|
52
|
+
xl: {
|
|
53
|
+
root: 'gap-1.5 rounded-lg px-4.5 py-3 text-md font-semibold before:rounded-[7px] data-icon-only:p-3.5',
|
|
54
|
+
linkRoot: 'gap-1.5 *:data-text:underline-offset-4',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
colors: {
|
|
58
|
+
primary: {
|
|
59
|
+
root: [
|
|
60
|
+
'bg-brand-solid text-white shadow-xs-skeuomorphic ring-1 ring-transparent ring-inset hover:bg-brand-solid_hover data-loading:bg-brand-solid_hover',
|
|
61
|
+
// Inner border gradient
|
|
62
|
+
'before:absolute before:inset-px before:border before:border-white/12 before:mask-b-from-0%',
|
|
63
|
+
// Icon styles
|
|
64
|
+
'*:data-icon:text-white/60 hover:*:data-icon:text-white/70',
|
|
65
|
+
].join(' '),
|
|
66
|
+
},
|
|
67
|
+
secondary: {
|
|
68
|
+
root: [
|
|
69
|
+
'bg-primary text-secondary shadow-xs-skeuomorphic ring-1 ring-primary ring-inset hover:bg-primary_hover hover:text-secondary_hover data-loading:bg-primary_hover',
|
|
70
|
+
// Icon styles
|
|
71
|
+
'*:data-icon:text-fg-quaternary hover:*:data-icon:text-fg-quaternary_hover',
|
|
72
|
+
].join(' '),
|
|
73
|
+
},
|
|
74
|
+
tertiary: {
|
|
75
|
+
root: [
|
|
76
|
+
'text-tertiary hover:bg-primary_hover hover:text-tertiary_hover data-loading:bg-primary_hover',
|
|
77
|
+
// Icon styles
|
|
78
|
+
'*:data-icon:text-fg-quaternary hover:*:data-icon:text-fg-quaternary_hover',
|
|
79
|
+
].join(' '),
|
|
80
|
+
},
|
|
81
|
+
'link-color': {
|
|
82
|
+
root: [
|
|
83
|
+
'justify-normal rounded p-0! text-brand-secondary hover:text-brand-secondary_hover',
|
|
84
|
+
// Inner text underline
|
|
85
|
+
'*:data-text:underline *:data-text:decoration-transparent hover:*:data-text:decoration-fg-brand-secondary_alt',
|
|
86
|
+
// Icon styles
|
|
87
|
+
'*:data-icon:text-fg-brand-secondary_alt hover:*:data-icon:text-fg-brand-secondary_hover',
|
|
88
|
+
].join(' '),
|
|
89
|
+
},
|
|
90
|
+
'link-gray': {
|
|
91
|
+
root: [
|
|
92
|
+
'justify-normal rounded p-0! text-tertiary hover:text-tertiary_hover',
|
|
93
|
+
// Inner text underline
|
|
94
|
+
'*:data-text:underline *:data-text:decoration-transparent hover:*:data-text:decoration-fg-quaternary',
|
|
95
|
+
// Icon styles
|
|
96
|
+
'*:data-icon:text-fg-quaternary hover:*:data-icon:text-fg-quaternary_hover',
|
|
97
|
+
].join(' '),
|
|
98
|
+
},
|
|
99
|
+
'primary-destructive': {
|
|
100
|
+
root: [
|
|
101
|
+
'bg-error-solid text-white shadow-xs-skeuomorphic ring-1 ring-transparent outline-error ring-inset hover:bg-error-solid_hover data-loading:bg-error-solid_hover',
|
|
102
|
+
// Inner border gradient
|
|
103
|
+
'before:absolute before:inset-px before:border before:border-white/12 before:mask-b-from-0%',
|
|
104
|
+
// Icon styles
|
|
105
|
+
'*:data-icon:text-white/60 hover:*:data-icon:text-white/70',
|
|
106
|
+
].join(' '),
|
|
107
|
+
},
|
|
108
|
+
'secondary-destructive': {
|
|
109
|
+
root: [
|
|
110
|
+
'bg-primary text-error-primary shadow-xs-skeuomorphic ring-1 ring-error_subtle outline-error ring-inset hover:bg-error-primary hover:text-error-primary_hover data-loading:bg-error-primary',
|
|
111
|
+
// Icon styles
|
|
112
|
+
'*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary',
|
|
113
|
+
].join(' '),
|
|
114
|
+
},
|
|
115
|
+
'tertiary-destructive': {
|
|
116
|
+
root: [
|
|
117
|
+
'text-error-primary outline-error hover:bg-error-primary hover:text-error-primary_hover data-loading:bg-error-primary',
|
|
118
|
+
// Icon styles
|
|
119
|
+
'*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary',
|
|
120
|
+
].join(' '),
|
|
121
|
+
},
|
|
122
|
+
'link-destructive': {
|
|
123
|
+
root: [
|
|
124
|
+
'justify-normal rounded p-0! text-error-primary outline-error hover:text-error-primary_hover',
|
|
125
|
+
// Inner text underline
|
|
126
|
+
'*:data-text:underline *:data-text:decoration-transparent *:data-text:underline-offset-2 hover:*:data-text:decoration-current',
|
|
127
|
+
// Icon styles
|
|
128
|
+
'*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary',
|
|
129
|
+
].join(' '),
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
function Button({ size = 'sm', color = 'primary', children, className, noTextPadding, iconLeading: IconLeading, iconTrailing: IconTrailing, isDisabled: disabled, isLoading: loading, isSuccess, showTextWhileLoading, 'data-testid': dataTestId, ...props }) {
|
|
134
|
+
// Declared as overloads, not a typed const: docgen cannot name a re-exported const typed by call signatures, so the family index would lose it.
|
|
135
|
+
const href = 'href' in props ? props.href : undefined;
|
|
136
|
+
const buttonTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'button', rootName: 'button' });
|
|
137
|
+
const loadingLinkPress = useLoadingLinkPress.useLoadingLinkPress(Boolean(loading && !disabled), 'href' in props ? props : {});
|
|
138
|
+
const hasChildren = children !== null && children !== undefined;
|
|
139
|
+
const isIcon = (IconLeading || IconTrailing) && !hasChildren;
|
|
140
|
+
const showSuccess = isSuccess && !loading;
|
|
141
|
+
const isLinkType = ['link-gray', 'link-color', 'link-destructive'].includes(color);
|
|
142
|
+
noTextPadding = isLinkType || noTextPadding;
|
|
143
|
+
const commonChildren = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ButtonIcon.ButtonIcon, { icon: showSuccess ? uiIcons.Check : IconLeading, slot: showSuccess ? 'success' : 'leading', className: styles.common.icon }), loading && (jsxRuntime.jsx(ButtonSpinner.ButtonSpinner, { className: cx.cx(styles.common.icon, !showTextWhileLoading && 'absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2') })), hasChildren && (jsxRuntime.jsx("span", { "data-text": true, className: cx.cx('transition-inherit-all', !noTextPadding && 'px-0.5'), children: children })), !showSuccess && jsxRuntime.jsx(ButtonIcon.ButtonIcon, { icon: IconTrailing, slot: "trailing", className: styles.common.icon })] }));
|
|
144
|
+
const commonProps = {
|
|
145
|
+
'data-loading': loading ? true : undefined,
|
|
146
|
+
'data-icon-only': isIcon ? true : undefined,
|
|
147
|
+
'data-testid': buttonTestId,
|
|
148
|
+
...props,
|
|
149
|
+
isDisabled: disabled,
|
|
150
|
+
className: cx.cx(styles.common.root, styles.sizes[size].root, styles.colors[color].root, isLinkType && styles.sizes[size].linkRoot, (loading || (href && (disabled || loading))) && 'pointer-events-none',
|
|
151
|
+
// If in `loading` state, hide everything except the loading icon (and text if `showTextWhileLoading` is true).
|
|
152
|
+
// Use `opacity-0` (not `invisible`) for the hidden label so it stays in the accessibility tree and the
|
|
153
|
+
// button keeps a discernible accessible name for screen readers while loading.
|
|
154
|
+
loading && (showTextWhileLoading ? '[&>*:not([data-icon=loading]):not([data-text])]:hidden' : '[&>*:not([data-icon=loading])]:opacity-0'), className),
|
|
155
|
+
children: commonChildren,
|
|
156
|
+
};
|
|
157
|
+
// The destination picks the element, not the `href` key, so `href={undefined}` from a conditional link stays a button.
|
|
158
|
+
if ('href' in commonProps && href) {
|
|
159
|
+
const { href: _, ...linkProps } = commonProps;
|
|
160
|
+
return jsxRuntime.jsx(reactAriaComponents.Link, { ...linkProps, ...(disabled ? {} : { href }), ...loadingLinkPress });
|
|
161
|
+
}
|
|
162
|
+
const { href: _, ...buttonProps } = commonProps;
|
|
163
|
+
return jsxRuntime.jsx(reactAriaComponents.Button, { ...buttonProps, type: buttonProps.type || 'button', isPending: loading });
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
exports.Button = Button;
|
|
167
|
+
exports.styles = styles;
|
|
168
|
+
//# sourceMappingURL=Button.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.cjs","sources":["../../../../../src/components/atoms/Buttons/Button/Button.tsx"],"sourcesContent":[null],"names":["sortCx","useResolvedTestId","useLoadingLinkPress","_jsxs","_Fragment","_jsx","ButtonIcon","Check","ButtonSpinner","cx","AriaLink","AriaButton"],"mappings":";;;;;;;;;;;AAYO,MAAM,MAAM,GAAGA,SAAM,CAAC;AAC3B,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE;YACJ,wNAAwN;;YAExN,kYAAkY;;YAElY,4FAA4F;;YAE5F,4GAA4G;SAC7G,CAAC,IAAI,CAAC,GAAG,CAAC;AACX,QAAA,IAAI,EAAE,4DAA4D;AACnE,KAAA;AACD,IAAA,KAAK,EAAE;AACL,QAAA,EAAE,EAAE;AACF,YAAA,IAAI,EAAE;gBACJ,8FAA8F;gBAC9F,sGAAsG;gBACtG,gDAAgD;aACjD,CAAC,IAAI,CAAC,GAAG,CAAC;AACX,YAAA,QAAQ,EAAE,sCAAsC;AACjD,SAAA;AACD,QAAA,EAAE,EAAE;AACF,YAAA,IAAI,EAAE;gBACJ,0FAA0F;gBAC1F,sGAAsG;aACvG,CAAC,IAAI,CAAC,GAAG,CAAC;AACX,YAAA,QAAQ,EAAE,sCAAsC;AACjD,SAAA;AACD,QAAA,EAAE,EAAE;AACF,YAAA,IAAI,EAAE;gBACJ,gGAAgG;gBAChG,iIAAiI;aAClI,CAAC,IAAI,CAAC,GAAG,CAAC;AACX,YAAA,QAAQ,EAAE,sCAAsC;AACjD,SAAA;AACD,QAAA,EAAE,EAAE;AACF,YAAA,IAAI,EAAE,8FAA8F;AACpG,YAAA,QAAQ,EAAE,wCAAwC;AACnD,SAAA;AACD,QAAA,EAAE,EAAE;AACF,YAAA,IAAI,EAAE,gGAAgG;AACtG,YAAA,QAAQ,EAAE,wCAAwC;AACnD,SAAA;AACF,KAAA;AAED,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE;gBACJ,kJAAkJ;;gBAElJ,4FAA4F;;gBAE5F,2DAA2D;aAC5D,CAAC,IAAI,CAAC,GAAG,CAAC;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,WAAW;QAC7C,OAAOJ,cAAA,CAACK,wBAAQ,EAAA,EAAA,GAAK,SAAS,MAAO,QAAQ,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAA,GAAM,gBAAgB,EAAA,CAAI;IAC1F;IAEA,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,WAAW,EAAE,GAAG,WAAkF;AACtH,IAAA,OAAOL,eAACM,0BAAU,EAAA,EAAA,GAAK,WAAW,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,IAAI,QAAQ,EAAE,SAAS,EAAE,OAAO,GAAI;AAChG;;;"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { FC, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { ButtonProps as AriaButtonProps, LinkProps as AriaLinkProps } from 'react-aria-components';
|
|
3
|
+
export declare const styles: {
|
|
4
|
+
common: {
|
|
5
|
+
root: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
};
|
|
8
|
+
sizes: {
|
|
9
|
+
xs: {
|
|
10
|
+
root: string;
|
|
11
|
+
linkRoot: string;
|
|
12
|
+
};
|
|
13
|
+
sm: {
|
|
14
|
+
root: string;
|
|
15
|
+
linkRoot: string;
|
|
16
|
+
};
|
|
17
|
+
md: {
|
|
18
|
+
root: string;
|
|
19
|
+
linkRoot: string;
|
|
20
|
+
};
|
|
21
|
+
lg: {
|
|
22
|
+
root: string;
|
|
23
|
+
linkRoot: string;
|
|
24
|
+
};
|
|
25
|
+
xl: {
|
|
26
|
+
root: string;
|
|
27
|
+
linkRoot: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
colors: {
|
|
31
|
+
primary: {
|
|
32
|
+
root: string;
|
|
33
|
+
};
|
|
34
|
+
secondary: {
|
|
35
|
+
root: string;
|
|
36
|
+
};
|
|
37
|
+
tertiary: {
|
|
38
|
+
root: string;
|
|
39
|
+
};
|
|
40
|
+
'link-color': {
|
|
41
|
+
root: string;
|
|
42
|
+
};
|
|
43
|
+
'link-gray': {
|
|
44
|
+
root: string;
|
|
45
|
+
};
|
|
46
|
+
'primary-destructive': {
|
|
47
|
+
root: string;
|
|
48
|
+
};
|
|
49
|
+
'secondary-destructive': {
|
|
50
|
+
root: string;
|
|
51
|
+
};
|
|
52
|
+
'tertiary-destructive': {
|
|
53
|
+
root: string;
|
|
54
|
+
};
|
|
55
|
+
'link-destructive': {
|
|
56
|
+
root: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Common props shared between button and anchor variants
|
|
62
|
+
*/
|
|
63
|
+
export interface CommonProps {
|
|
64
|
+
/** Disables the button and shows a disabled state */
|
|
65
|
+
isDisabled?: boolean;
|
|
66
|
+
/** Shows a loading spinner and disables the button */
|
|
67
|
+
isLoading?: boolean;
|
|
68
|
+
/** Shows a check in place of the button's icons, to confirm the action finished; `isLoading` takes precedence. */
|
|
69
|
+
isSuccess?: boolean;
|
|
70
|
+
/** The size variant of the button */
|
|
71
|
+
size?: keyof typeof styles.sizes;
|
|
72
|
+
/** The color variant of the button */
|
|
73
|
+
color?: keyof typeof styles.colors;
|
|
74
|
+
/** Icon component or element to show before the text */
|
|
75
|
+
iconLeading?: FC<{
|
|
76
|
+
className?: string;
|
|
77
|
+
}> | ReactNode;
|
|
78
|
+
/** Icon component or element to show after the text */
|
|
79
|
+
iconTrailing?: FC<{
|
|
80
|
+
className?: string;
|
|
81
|
+
}> | ReactNode;
|
|
82
|
+
/** Removes horizontal padding from the text content */
|
|
83
|
+
noTextPadding?: boolean;
|
|
84
|
+
/** When true, keeps the text visible during loading state */
|
|
85
|
+
showTextWhileLoading?: boolean;
|
|
86
|
+
/** Overrides the `data-testid`. Defaults to `fd-button` (or `<parent>--button` inside a test-id context). */
|
|
87
|
+
'data-testid'?: string;
|
|
88
|
+
/** Label content rendered between the leading and trailing icons. */
|
|
89
|
+
children?: ReactNode;
|
|
90
|
+
/** Extra classes merged onto the root `<button>` or `<a>`. */
|
|
91
|
+
className?: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Props for the button variant (non-link)
|
|
95
|
+
*/
|
|
96
|
+
export interface ButtonProps extends CommonProps, Omit<AriaButtonProps, 'children' | 'className'> {
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Props for the link variant (anchor tag)
|
|
100
|
+
*/
|
|
101
|
+
export interface LinkProps extends CommonProps, Omit<AriaLinkProps, 'children' | 'className'> {
|
|
102
|
+
/** Destination URL; setting it renders an `<a>` instead of a `<button>`. */
|
|
103
|
+
href: NonNullable<AriaLinkProps['href']>;
|
|
104
|
+
}
|
|
105
|
+
/** Union type of button and link props */
|
|
106
|
+
export type Props = ButtonProps | LinkProps;
|
|
107
|
+
/**
|
|
108
|
+
* Triggers an action or navigates to a destination: a native `<button>` by default, or an
|
|
109
|
+
* `<a>` when `href` is provided. For navigation-only actions, prefer a link styled with one of
|
|
110
|
+
* the `link-*` colors.
|
|
111
|
+
*
|
|
112
|
+
* @summary action trigger or navigation control
|
|
113
|
+
*/
|
|
114
|
+
export declare function Button(props: LinkProps): ReactElement<LinkProps>;
|
|
115
|
+
export declare function Button(props: ButtonProps): ReactElement<ButtonProps>;
|
|
116
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Buttons/Button/Button.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAMxG,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHjB,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,WAA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