@flipdish/ui-library 0.58.1 → 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/Badge/index.cjs +15 -59
- package/dist/components/atoms/Badge/index.cjs.map +1 -1
- package/dist/components/atoms/Badge/index.d.ts +22 -98
- package/dist/components/atoms/Badge/index.d.ts.map +1 -1
- package/dist/components/atoms/Badge/index.js +15 -59
- package/dist/components/atoms/Badge/index.js.map +1 -1
- package/dist/components/atoms/Badges/Badge/Badge.cjs +71 -0
- package/dist/components/atoms/Badges/Badge/Badge.cjs.map +1 -0
- package/dist/components/atoms/Badges/Badge/Badge.d.ts +99 -0
- package/dist/components/atoms/Badges/Badge/Badge.d.ts.map +1 -0
- package/dist/components/atoms/Badges/Badge/Badge.js +63 -0
- package/dist/components/atoms/Badges/Badge/Badge.js.map +1 -0
- package/dist/components/atoms/{Badge → Badges/Badge}/Badge.styles.cjs +1 -1
- package/dist/components/atoms/Badges/Badge/Badge.styles.cjs.map +1 -0
- package/dist/components/atoms/{Badge → Badges/Badge}/Badge.styles.d.ts +1 -1
- package/dist/components/atoms/Badges/Badge/Badge.styles.d.ts.map +1 -0
- package/dist/components/atoms/{Badge → Badges/Badge}/Badge.styles.js +1 -1
- package/dist/components/atoms/Badges/Badge/Badge.styles.js.map +1 -0
- package/dist/components/atoms/Badges/Badge/badge.types.cjs.map +1 -0
- package/dist/components/atoms/Badges/Badge/badge.types.d.ts.map +1 -0
- package/dist/components/atoms/Badges/Badge/badge.types.js.map +1 -0
- package/dist/components/atoms/{Badge → Badges/Badge/utilities}/badge.utils.d.ts +2 -2
- package/dist/components/atoms/Badges/Badge/utilities/badge.utils.d.ts.map +1 -0
- package/dist/components/atoms/Badges/BadgeGroup/BadgeGroup.cjs +116 -0
- package/dist/components/atoms/Badges/BadgeGroup/BadgeGroup.cjs.map +1 -0
- package/dist/components/atoms/Badges/BadgeGroup/BadgeGroup.d.ts +38 -0
- package/dist/components/atoms/Badges/BadgeGroup/BadgeGroup.d.ts.map +1 -0
- package/dist/components/atoms/Badges/BadgeGroup/BadgeGroup.js +114 -0
- package/dist/components/atoms/Badges/BadgeGroup/BadgeGroup.js.map +1 -0
- package/dist/components/atoms/Badges/index.cjs +16 -0
- package/dist/components/atoms/Badges/index.cjs.map +1 -0
- package/dist/components/atoms/Badges/index.d.ts +16 -0
- package/dist/components/atoms/Badges/index.d.ts.map +1 -0
- package/dist/components/atoms/Badges/index.js +3 -0
- package/dist/components/atoms/Badges/index.js.map +1 -0
- 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/components/atoms/{Button → 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 +5 -5
- package/dist/components/forms/fields/FormRadioCardGroup/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormRadioCardGroup/index.d.ts +3 -3
- package/dist/components/forms/fields/FormRadioCardGroup/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormRadioCardGroup/index.js +4 -4
- 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/layouts/PageHubLayout/components/PageHubLayoutSectionNav.cjs +2 -2
- package/dist/components/layouts/PageHubLayout/components/PageHubLayoutSectionNav.cjs.map +1 -1
- package/dist/components/layouts/PageHubLayout/components/PageHubLayoutSectionNav.js +1 -1
- package/dist/components/molecules/ActivityFeed/index.cjs +2 -2
- package/dist/components/molecules/ActivityFeed/index.cjs.map +1 -1
- package/dist/components/molecules/ActivityFeed/index.d.ts +1 -1
- package/dist/components/molecules/ActivityFeed/index.d.ts.map +1 -1
- package/dist/components/molecules/ActivityFeed/index.js +1 -1
- package/dist/components/molecules/BadgeGroup/index.cjs +3 -110
- package/dist/components/molecules/BadgeGroup/index.cjs.map +1 -1
- package/dist/components/molecules/BadgeGroup/index.d.ts +5 -37
- package/dist/components/molecules/BadgeGroup/index.d.ts.map +1 -1
- package/dist/components/molecules/BadgeGroup/index.js +3 -110
- package/dist/components/molecules/BadgeGroup/index.js.map +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/RadioCards/RadioCardAvatar/RadioCardAvatar.cjs +37 -0
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.cjs.map +1 -0
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.d.ts +33 -0
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.d.ts.map +1 -0
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.js +35 -0
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.js.map +1 -0
- package/dist/components/molecules/{RadioGroup → RadioCards/RadioCardAvatar}/hooks/useCommitOnPress.cjs +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.cjs.map +1 -0
- package/dist/components/molecules/{RadioGroup → RadioCards/RadioCardAvatar}/hooks/useCommitOnPress.d.ts +6 -6
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.d.ts.map +1 -0
- package/dist/components/molecules/{RadioGroup → RadioCards/RadioCardAvatar}/hooks/useCommitOnPress.js +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.js.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupRadioButton.cjs → RadioCards/RadioCardBullet/RadioCardBullet.cjs} +3 -3
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.cjs.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupRadioButton.d.ts → RadioCards/RadioCardBullet/RadioCardBullet.d.ts} +5 -5
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.d.ts.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupRadioButton.js → RadioCards/RadioCardBullet/RadioCardBullet.js} +3 -3
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.js.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupCheckbox.cjs → RadioCards/RadioCardCheck/RadioCardCheck.cjs} +4 -4
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.cjs.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupCheckbox.d.ts → RadioCards/RadioCardCheck/RadioCardCheck.d.ts} +6 -7
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.d.ts.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupCheckbox.js → RadioCards/RadioCardCheck/RadioCardCheck.js} +4 -4
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.js.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupIconSimple.cjs → RadioCards/RadioCardIcon/RadioCardIcon.cjs} +3 -3
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.cjs.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupIconSimple.d.ts → RadioCards/RadioCardIcon/RadioCardIcon.d.ts} +5 -6
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.d.ts.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupIconSimple.js → RadioCards/RadioCardIcon/RadioCardIcon.js} +3 -3
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.js.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupIconCard.cjs → RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.cjs} +5 -5
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.cjs.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupIconCard.d.ts → RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.d.ts} +3 -3
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.d.ts.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupIconCard.js → RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.js} +4 -4
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.js.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupPaymentIcon.cjs → RadioCards/RadioCardPayment/RadioCardPayment.cjs} +3 -3
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.cjs.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupPaymentIcon.d.ts → RadioCards/RadioCardPayment/RadioCardPayment.d.ts} +3 -3
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.d.ts.map +1 -0
- package/dist/components/molecules/{RadioGroup/components/RadioGroupPaymentIcon.js → RadioCards/RadioCardPayment/RadioCardPayment.js} +3 -3
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.js.map +1 -0
- package/dist/components/molecules/{RadioGroup → RadioCards}/hooks/useOptionIds.cjs.map +1 -1
- package/dist/components/molecules/{RadioGroup → RadioCards}/hooks/useOptionIds.d.ts.map +1 -1
- package/dist/components/molecules/{RadioGroup → RadioCards}/hooks/useOptionIds.js.map +1 -1
- package/dist/components/molecules/RadioCards/index.cjs +18 -0
- package/dist/components/molecules/RadioCards/index.cjs.map +1 -0
- package/dist/components/molecules/RadioCards/index.d.ts +23 -0
- package/dist/components/molecules/RadioCards/index.d.ts.map +1 -0
- package/dist/components/molecules/RadioCards/index.js +7 -0
- package/dist/components/molecules/RadioCards/index.js.map +1 -0
- package/dist/components/molecules/{RadioGroup/radioGroup.types.d.ts → RadioCards/radioCards.types.d.ts} +12 -10
- package/dist/components/molecules/RadioCards/radioCards.types.d.ts.map +1 -0
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.cjs +2 -7
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.d.ts +2 -7
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.js +2 -7
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.js.map +1 -1
- package/dist/components/molecules/RadioGroup/index.cjs +26 -14
- package/dist/components/molecules/RadioGroup/index.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/index.d.ts +25 -8
- package/dist/components/molecules/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/index.js +23 -7
- package/dist/components/molecules/RadioGroup/index.js.map +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/Tabs/index.cjs +2 -2
- package/dist/components/molecules/Tabs/index.cjs.map +1 -1
- package/dist/components/molecules/Tabs/index.js +1 -1
- 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/Calendar/components/CalendarHeader.cjs +2 -2
- package/dist/components/organisms/Calendar/components/CalendarHeader.cjs.map +1 -1
- package/dist/components/organisms/Calendar/components/CalendarHeader.js +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/components/NavItem.cjs +2 -2
- package/dist/components/organisms/HeaderNavigation/components/NavItem.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/NavItem.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/PageHeader/components/PageHeaderTabNav.cjs +2 -2
- package/dist/components/organisms/PageHeader/components/PageHeaderTabNav.cjs.map +1 -1
- package/dist/components/organisms/PageHeader/components/PageHeaderTabNav.js +1 -1
- package/dist/components/organisms/SidebarNavigation/components/NavItem.cjs +2 -2
- package/dist/components/organisms/SidebarNavigation/components/NavItem.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/NavItem.js +1 -1
- package/dist/components/organisms/Table/index.cjs +2 -2
- package/dist/components/organisms/Table/index.cjs.map +1 -1
- package/dist/components/organisms/Table/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/Badge/index.d.ts +20 -97
- package/dist/native/components/atoms/Badge/index.d.ts.map +1 -1
- package/dist/native/components/atoms/Badge/index.js +17 -62
- package/dist/native/components/atoms/Badge/index.js.map +1 -1
- package/dist/native/components/atoms/Badges/Badge/Badge.d.ts +98 -0
- package/dist/native/components/atoms/Badges/Badge/Badge.d.ts.map +1 -0
- package/dist/native/components/atoms/Badges/Badge/Badge.js +66 -0
- package/dist/native/components/atoms/Badges/Badge/Badge.js.map +1 -0
- package/dist/native/components/atoms/{Badge → Badges/Badge}/Badge.styles.d.ts +1 -1
- package/dist/native/components/atoms/Badges/Badge/Badge.styles.d.ts.map +1 -0
- package/dist/native/components/atoms/{Badge → Badges/Badge}/Badge.styles.js +1 -1
- package/dist/native/components/atoms/Badges/Badge/Badge.styles.js.map +1 -0
- package/dist/native/components/atoms/Badges/Badge/badge.types.d.ts.map +1 -0
- package/dist/native/components/atoms/Badges/Badge/badge.types.js.map +1 -0
- package/dist/native/components/atoms/{Badge → Badges/Badge/utilities}/badge.utils.d.ts +2 -2
- package/dist/native/components/atoms/Badges/Badge/utilities/badge.utils.d.ts.map +1 -0
- package/dist/native/components/atoms/{Badge → Badges/Badge/utilities}/badge.utils.js +1 -1
- package/dist/native/components/atoms/Badges/Badge/utilities/badge.utils.js.map +1 -0
- package/dist/native/components/atoms/Badges/index.d.ts +5 -0
- package/dist/native/components/atoms/Badges/index.d.ts.map +1 -0
- package/dist/native/components/atoms/Badges/index.js +2 -0
- package/dist/native/components/atoms/Badges/index.js.map +1 -0
- 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/native/components/atoms/{Button → 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/dist/native/components/molecules/RadioCards/index.d.ts +12 -0
- package/package.json +1 -1
- package/dist/components/atoms/Badge/Badge.styles.cjs.map +0 -1
- package/dist/components/atoms/Badge/Badge.styles.d.ts.map +0 -1
- package/dist/components/atoms/Badge/Badge.styles.js.map +0 -1
- package/dist/components/atoms/Badge/badge.types.cjs.map +0 -1
- package/dist/components/atoms/Badge/badge.types.d.ts.map +0 -1
- package/dist/components/atoms/Badge/badge.types.js.map +0 -1
- package/dist/components/atoms/Badge/badge.utils.d.ts.map +0 -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/RadioGroup/components/RadioGroupAvatarCard.cjs +0 -39
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.cjs.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.d.ts +0 -32
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.d.ts.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.js +0 -37
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.js.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupCheckbox.cjs.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupCheckbox.d.ts.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupCheckbox.js.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconCard.cjs.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconCard.d.ts.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconCard.js.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconSimple.cjs.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconSimple.d.ts.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconSimple.js.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupPaymentIcon.cjs.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupPaymentIcon.d.ts.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupPaymentIcon.js.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupRadioButton.cjs.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupRadioButton.d.ts.map +0 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupRadioButton.js.map +0 -1
- package/dist/components/molecules/RadioGroup/hooks/useCommitOnPress.cjs.map +0 -1
- package/dist/components/molecules/RadioGroup/hooks/useCommitOnPress.d.ts.map +0 -1
- package/dist/components/molecules/RadioGroup/hooks/useCommitOnPress.js.map +0 -1
- package/dist/components/molecules/RadioGroup/radioGroup.types.d.ts.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/Badge/Badge.styles.d.ts.map +0 -1
- package/dist/native/components/atoms/Badge/Badge.styles.js.map +0 -1
- package/dist/native/components/atoms/Badge/badge.types.d.ts.map +0 -1
- package/dist/native/components/atoms/Badge/badge.types.js.map +0 -1
- package/dist/native/components/atoms/Badge/badge.utils.d.ts.map +0 -1
- package/dist/native/components/atoms/Badge/badge.utils.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/{Badge → Badges/Badge}/badge.types.cjs +0 -0
- /package/dist/components/atoms/{Badge → Badges/Badge}/badge.types.d.ts +0 -0
- /package/dist/components/atoms/{Badge → Badges/Badge}/badge.types.js +0 -0
- /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/{RadioGroup → RadioCards}/hooks/useOptionIds.cjs +0 -0
- /package/dist/components/molecules/{RadioGroup → RadioCards}/hooks/useOptionIds.d.ts +0 -0
- /package/dist/components/molecules/{RadioGroup → RadioCards}/hooks/useOptionIds.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
- /package/dist/native/components/atoms/{Badge → Badges/Badge}/badge.types.d.ts +0 -0
- /package/dist/native/components/atoms/{Badge → Badges/Badge}/badge.types.js +0 -0
|
@@ -1,86 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { HelpCircle, InfoCircle, EyeOff, Eye } from '@flipdish/ui-icons';
|
|
3
|
-
import { Tooltip, TooltipTrigger } from '@flipdish/ui-library/components/atoms/Tooltip';
|
|
4
|
-
import { sortCx, cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
|
-
import { useResolvedTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
6
|
-
import { createContext, useState, useContext } from 'react';
|
|
7
|
-
import { Group, Input as Input$1, Button, TextField as TextField$1 } from 'react-aria-components';
|
|
8
|
-
import { useHotkeyHint } from '../../../hooks/__internal__/useHotkeyHint/useHotkeyHint.js';
|
|
9
|
-
import { HintText } from './components/HintText.js';
|
|
10
|
-
import { Label } from './components/Label.js';
|
|
1
|
+
import { HintText as HintText$1, Input as Input$1, InputBase as InputBase$1, Label as Label$1, TextField as TextField$1 } from '@flipdish/ui-library/components/atoms/Inputs';
|
|
11
2
|
|
|
12
|
-
/**
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const context = useContext(TextFieldContext);
|
|
23
|
-
const inputSize = context?.size || size;
|
|
24
|
-
const sizes = sortCx({
|
|
25
|
-
sm: {
|
|
26
|
-
root: cx('px-3 py-2 text-sm', hasLeadingIcon && 'pl-9', hasTrailingIcon && 'pr-9'),
|
|
27
|
-
iconLeading: 'left-3 size-4 stroke-[2.25px]',
|
|
28
|
-
iconTrailing: 'right-3',
|
|
29
|
-
shortcut: 'pr-1.5',
|
|
30
|
-
},
|
|
31
|
-
md: {
|
|
32
|
-
root: cx('px-3 py-2 text-md', hasLeadingIcon && 'pl-10', hasTrailingIcon && 'pr-9'),
|
|
33
|
-
iconLeading: 'left-3 size-5',
|
|
34
|
-
iconTrailing: 'right-3',
|
|
35
|
-
shortcut: 'pr-2',
|
|
36
|
-
},
|
|
37
|
-
lg: {
|
|
38
|
-
root: cx('px-3.5 py-2.5 text-md', hasLeadingIcon && 'pl-10.5', hasTrailingIcon && 'pr-9.5'),
|
|
39
|
-
iconLeading: 'left-3.5 size-5',
|
|
40
|
-
iconTrailing: 'right-3.5',
|
|
41
|
-
shortcut: 'pr-2.5',
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
return (jsxs(Group, { isDisabled, isInvalid, ref: groupRef, className: ({ isFocusWithin, isDisabled, isInvalid }) => cx('group/input relative flex w-full flex-row place-content-center place-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',
|
|
45
|
-
// Disabled state styles
|
|
46
|
-
isDisabled && 'cursor-not-allowed opacity-50', 'group-disabled:cursor-not-allowed group-disabled:opacity-50',
|
|
47
|
-
// Invalid state styles
|
|
48
|
-
isInvalid && 'ring-error_subtle', 'group-invalid:ring-error_subtle',
|
|
49
|
-
// Invalid state with focus-within styles
|
|
50
|
-
isInvalid && isFocusWithin && 'ring-2 ring-error', isFocusWithin && 'group-invalid:ring-2 group-invalid:ring-error', context?.wrapperClassName, wrapperClassName), children: [Icon && (jsx(Icon, { className: cx('pointer-events-none absolute text-fg-quaternary', sizes[inputSize].iconLeading, context?.iconClassName, iconClassName) })), jsx(Input$1, { ...inputProps, ref: ref, "data-testid": inputTestId, required: isRequired, type: type === 'password' && isPasswordVisible ? 'text' : type, placeholder: placeholder, className: cx('m-0 w-full bg-transparent text-primary ring-0 outline-hidden placeholder:text-placeholder autofill:rounded-lg autofill:text-primary disabled:cursor-not-allowed', sizes[inputSize].root, context?.inputClassName, inputClassName) }), tooltip && type !== 'password' && (jsx(Tooltip, { title: tooltip, placement: "top", children: jsx(TooltipTrigger, { "aria-label": "More information", className: cx('absolute cursor-pointer text-fg-quaternary transition duration-100 ease-linear group-invalid/input:hidden hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName), children: jsx(HelpCircle, { className: "size-4 stroke-[2.25px]" }) }) })), type !== 'password' && (jsx(InfoCircle, { className: cx('pointer-events-none absolute hidden size-4 stroke-[2.25px] text-fg-error-secondary group-invalid/input:block', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName) })), type === 'password' && (jsx(Button, { "aria-label": "Toggle password visibility", onClick: () => setIsPasswordVisible(!isPasswordVisible), className: cx('absolute flex cursor-pointer items-center justify-center text-fg-quaternary transition duration-100 ease-linear hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover focus:outline-hidden', sizes[inputSize].iconTrailing), children: isPasswordVisible ? jsx(EyeOff, { className: "size-4 stroke-[2.25px]" }) : jsx(Eye, { 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 md:flex', sizes[inputSize].shortcut), children: jsx("span", { "aria-hidden": "true", className: "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset", children: shortcutLabel }) }))] }));
|
|
51
|
-
};
|
|
52
|
-
InputBase.displayName = 'InputBase';
|
|
53
|
-
const TextFieldContext = createContext({});
|
|
54
|
-
/** Wrapper around react-aria-components' `TextField` that shares `size` and the class-name props with a nested `InputBase` through context. */
|
|
55
|
-
const TextField = ({ className, size = 'md', inputClassName, wrapperClassName, iconClassName, tooltipClassName, ...props }) => {
|
|
56
|
-
return (jsx(TextFieldContext.Provider, { value: { inputClassName, wrapperClassName, iconClassName, tooltipClassName, size }, children: jsx(TextField$1, { ...props, "data-input-wrapper": true, "data-input-size": size, className: (state) => cx('group flex h-max w-full flex-col items-start justify-start gap-1.5', typeof className === 'function' ? className(state) : className) }) }));
|
|
57
|
-
};
|
|
58
|
-
TextField.displayName = 'TextField';
|
|
59
|
-
/**
|
|
60
|
-
* A single-line text field for collecting user input. Composes a label,
|
|
61
|
-
* an input group with optional leading icon and trailing adornments
|
|
62
|
-
* (tooltip, error indicator, password toggle, shortcut badge), and
|
|
63
|
-
* optional hint text.
|
|
64
|
-
*
|
|
65
|
-
* @summary text field for collecting a single line of user input
|
|
66
|
-
*/
|
|
67
|
-
const Input = ({ size = 'md', placeholder, icon: Icon, label, hint, shortcut, hideRequiredIndicator, className, ref, groupRef, tooltip, iconClassName, inputClassName, wrapperClassName, tooltipClassName, type = 'text', 'data-testid': dataTestId, ...props }) => {
|
|
68
|
-
return (jsx(TextField, { "aria-label": !label ? placeholder : undefined, ...props, size: size, className: className, children: ({ isRequired, isInvalid }) => (jsxs(Fragment, { children: [label && (jsx(Label, { isRequired: hideRequiredIndicator ? !hideRequiredIndicator : isRequired, isInvalid: isInvalid, children: label })), jsx(InputBase, { ref,
|
|
69
|
-
groupRef,
|
|
70
|
-
size,
|
|
71
|
-
placeholder,
|
|
72
|
-
icon: Icon,
|
|
73
|
-
shortcut,
|
|
74
|
-
isInvalid,
|
|
75
|
-
iconClassName,
|
|
76
|
-
inputClassName,
|
|
77
|
-
wrapperClassName,
|
|
78
|
-
tooltipClassName,
|
|
79
|
-
tooltip,
|
|
80
|
-
type,
|
|
81
|
-
'data-testid': dataTestId }), hint && jsx(HintText, { isInvalid: isInvalid, children: hint })] })) }));
|
|
82
|
-
};
|
|
83
|
-
Input.displayName = 'Input';
|
|
3
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Inputs`. Removed in the next major. */
|
|
4
|
+
const Input = Input$1;
|
|
5
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Inputs`. Removed in the next major. */
|
|
6
|
+
const InputBase = InputBase$1;
|
|
7
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Inputs`. Removed in the next major. */
|
|
8
|
+
const TextField = TextField$1;
|
|
9
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Inputs`. Removed in the next major. */
|
|
10
|
+
const Label = Label$1;
|
|
11
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Inputs`. Removed in the next major. */
|
|
12
|
+
const HintText = HintText$1;
|
|
84
13
|
|
|
85
14
|
export { HintText, Input, InputBase, Label, TextField };
|
|
86
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Input/index.tsx"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Input/index.tsx"],"sourcesContent":[null],"names":["InputNext","InputBaseNext","TextFieldNext","LabelNext","HintTextNext"],"mappings":";;AAgBA;AACO,MAAM,KAAK,GAAGA;AACrB;AACO,MAAM,SAAS,GAAGC;AACzB;AACO,MAAM,SAAS,GAAGC;AACzB;AACO,MAAM,KAAK,GAAqBC;AACvC;AACO,MAAM,QAAQ,GAAwBC;;"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var uiIcons = require('@flipdish/ui-icons');
|
|
5
|
+
var Tooltip = require('@flipdish/ui-library/components/atoms/Tooltip');
|
|
6
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
7
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
8
|
+
var React = require('react');
|
|
9
|
+
var reactAriaComponents = require('react-aria-components');
|
|
10
|
+
var useHotkeyHint = require('../../../../hooks/__internal__/useHotkeyHint/useHotkeyHint.cjs');
|
|
11
|
+
var HintText = require('../components/HintText.cjs');
|
|
12
|
+
var Label = require('../components/Label.cjs');
|
|
13
|
+
|
|
14
|
+
/** Bare input group with icon, tooltip and shortcut adornments but no label or hint; `Input` composes it inside a `TextField`. */
|
|
15
|
+
const InputBase = ({ ref, tooltip, shortcut, groupRef, size = 'md', isInvalid, isDisabled, isRequired, icon: Icon, placeholder, wrapperClassName, tooltipClassName, inputClassName, iconClassName, type = 'text', 'data-testid': dataTestId, ...inputProps }) => {
|
|
16
|
+
const shortcutLabel = useHotkeyHint.useHotkeyHint(shortcut === true ? 'mod+k' : shortcut || null);
|
|
17
|
+
const [isPasswordVisible, setIsPasswordVisible] = React.useState(false);
|
|
18
|
+
const inputTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'input', rootName: 'input' });
|
|
19
|
+
// Check if the input has a leading icon or a trailing adornment (tooltip, invalid
|
|
20
|
+
// indicator, or the password visibility toggle) so we can reserve right-side padding.
|
|
21
|
+
const hasTrailingIcon = Boolean(tooltip) || Boolean(isInvalid) || type === 'password';
|
|
22
|
+
const hasLeadingIcon = Icon;
|
|
23
|
+
// If the input is inside a `TextFieldContext`, use its context to simplify applying styles
|
|
24
|
+
const context = React.useContext(TextFieldContext);
|
|
25
|
+
const inputSize = context?.size || size;
|
|
26
|
+
// A wrapping `TextField` can make the group invalid without the prop; the `group-invalid` classes keep the error icon's space then.
|
|
27
|
+
const sizes = cx.sortCx({
|
|
28
|
+
sm: {
|
|
29
|
+
root: cx.cx('px-3 py-2 text-sm', hasLeadingIcon && 'pl-9', hasTrailingIcon ? 'pr-9' : 'group-invalid/input:pr-9'),
|
|
30
|
+
iconLeading: 'left-3 size-4 stroke-[2.25px]',
|
|
31
|
+
iconTrailing: 'right-3',
|
|
32
|
+
shortcut: cx.cx('pr-1.5', hasTrailingIcon ? 'right-7' : 'right-0.5 group-invalid/input:right-7'),
|
|
33
|
+
},
|
|
34
|
+
md: {
|
|
35
|
+
root: cx.cx('px-3 py-2 text-md', hasLeadingIcon && 'pl-10', hasTrailingIcon ? 'pr-9' : 'group-invalid/input:pr-9'),
|
|
36
|
+
iconLeading: 'left-3 size-5',
|
|
37
|
+
iconTrailing: 'right-3',
|
|
38
|
+
shortcut: cx.cx('pr-2', hasTrailingIcon ? 'right-7' : 'right-0.5 group-invalid/input:right-7'),
|
|
39
|
+
},
|
|
40
|
+
lg: {
|
|
41
|
+
root: cx.cx('px-3.5 py-2.5 text-md', hasLeadingIcon && 'pl-10.5', hasTrailingIcon ? 'pr-9.5' : 'group-invalid/input:pr-9.5'),
|
|
42
|
+
iconLeading: 'left-3.5 size-5',
|
|
43
|
+
iconTrailing: 'right-3.5',
|
|
44
|
+
shortcut: cx.cx('pr-2.5', hasTrailingIcon ? 'right-7.5' : 'right-0.5 group-invalid/input:right-7.5'),
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
return (jsxRuntime.jsxs(reactAriaComponents.Group, { isDisabled, isInvalid, ref: groupRef, className: ({ isFocusWithin, isDisabled, isInvalid }) => cx.cx('group/input relative flex w-full flex-row place-content-center place-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',
|
|
48
|
+
// Disabled state styles
|
|
49
|
+
isDisabled && 'cursor-not-allowed opacity-50', 'group-disabled:cursor-not-allowed group-disabled:opacity-50',
|
|
50
|
+
// Invalid state styles
|
|
51
|
+
isInvalid && 'ring-error_subtle', 'group-invalid:ring-error_subtle',
|
|
52
|
+
// Invalid state with focus-within styles
|
|
53
|
+
isInvalid && isFocusWithin && 'ring-2 ring-error', isFocusWithin && 'group-invalid:ring-2 group-invalid:ring-error', context?.wrapperClassName, wrapperClassName), children: [Icon && (jsxRuntime.jsx(Icon, { className: cx.cx('pointer-events-none absolute text-fg-quaternary', sizes[inputSize].iconLeading, context?.iconClassName, iconClassName) })), jsxRuntime.jsx(reactAriaComponents.Input, { ...inputProps, ref: ref, "data-testid": inputTestId, required: isRequired, type: type === 'password' && isPasswordVisible ? 'text' : type, placeholder: placeholder, className: cx.cx('m-0 w-full bg-transparent text-primary ring-0 outline-hidden placeholder:text-placeholder autofill:rounded-lg autofill:text-primary disabled:cursor-not-allowed', sizes[inputSize].root, context?.inputClassName, inputClassName) }), tooltip && type !== 'password' && (jsxRuntime.jsx(Tooltip.Tooltip, { title: tooltip, placement: "top", children: jsxRuntime.jsx(Tooltip.TooltipTrigger, { "aria-label": "More information", className: cx.cx('absolute cursor-pointer text-fg-quaternary transition duration-100 ease-linear group-invalid/input:hidden hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName), children: jsxRuntime.jsx(uiIcons.HelpCircle, { className: "size-4 stroke-[2.25px]" }) }) })), type !== 'password' && (jsxRuntime.jsx(uiIcons.InfoCircle, { className: cx.cx('pointer-events-none absolute hidden size-4 stroke-[2.25px] text-fg-error-secondary group-invalid/input:block', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName) })), type === 'password' && (jsxRuntime.jsx(reactAriaComponents.Button, { "aria-label": "Toggle password visibility", onClick: () => setIsPasswordVisible(!isPasswordVisible), className: cx.cx('absolute flex cursor-pointer items-center justify-center text-fg-quaternary transition duration-100 ease-linear hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover focus:outline-hidden', sizes[inputSize].iconTrailing), children: isPasswordVisible ? jsxRuntime.jsx(uiIcons.EyeOff, { className: "size-4 stroke-[2.25px]" }) : jsxRuntime.jsx(uiIcons.Eye, { className: "size-4 stroke-[2.25px]" }) })), shortcut && (jsxRuntime.jsx("div", { className: cx.cx('pointer-events-none absolute inset-y-0.5 z-10 hidden items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8 md:flex', sizes[inputSize].shortcut), children: jsxRuntime.jsx("span", { "aria-hidden": "true", className: "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset", children: shortcutLabel }) }))] }));
|
|
54
|
+
};
|
|
55
|
+
InputBase.displayName = 'InputBase';
|
|
56
|
+
const TextFieldContext = React.createContext({});
|
|
57
|
+
/** Wrapper around react-aria-components' `TextField` that shares `size` and the class-name props with a nested `InputBase` through context. */
|
|
58
|
+
const TextField = ({ className, size = 'md', inputClassName, wrapperClassName, iconClassName, tooltipClassName, ...props }) => {
|
|
59
|
+
return (jsxRuntime.jsx(TextFieldContext.Provider, { value: { inputClassName, wrapperClassName, iconClassName, tooltipClassName, size }, children: jsxRuntime.jsx(reactAriaComponents.TextField, { ...props, "data-input-wrapper": true, "data-input-size": size, className: (state) => cx.cx('group flex h-max w-full flex-col items-start justify-start gap-1.5', typeof className === 'function' ? className(state) : className) }) }));
|
|
60
|
+
};
|
|
61
|
+
TextField.displayName = 'TextField';
|
|
62
|
+
/**
|
|
63
|
+
* A single-line text field for collecting user input. Reach for it for a short value such as a name, an email or a
|
|
64
|
+
* password; to filter a list use `SearchInput`, and for several lines `TextArea`.
|
|
65
|
+
*
|
|
66
|
+
* @summary text field for collecting a single line of user input
|
|
67
|
+
*/
|
|
68
|
+
const Input = ({ size = 'md', placeholder, icon: Icon, label, hint, shortcut, hideRequiredIndicator, className, ref, groupRef, tooltip, iconClassName, inputClassName, wrapperClassName, tooltipClassName, type = 'text', 'data-testid': dataTestId, ...props }) => {
|
|
69
|
+
return (jsxRuntime.jsx(TextField, { "aria-label": !label ? placeholder : undefined, ...props, size: size, className: className, children: ({ isRequired, isInvalid }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label && (jsxRuntime.jsx(Label.Label, { isRequired: hideRequiredIndicator ? !hideRequiredIndicator : isRequired, isInvalid: isInvalid, children: label })), jsxRuntime.jsx(InputBase, { ref,
|
|
70
|
+
groupRef,
|
|
71
|
+
size,
|
|
72
|
+
placeholder,
|
|
73
|
+
icon: Icon,
|
|
74
|
+
shortcut,
|
|
75
|
+
isInvalid,
|
|
76
|
+
iconClassName,
|
|
77
|
+
inputClassName,
|
|
78
|
+
wrapperClassName,
|
|
79
|
+
tooltipClassName,
|
|
80
|
+
tooltip,
|
|
81
|
+
type,
|
|
82
|
+
'data-testid': dataTestId }), hint && jsxRuntime.jsx(HintText.HintText, { isInvalid: isInvalid, children: hint })] })) }));
|
|
83
|
+
};
|
|
84
|
+
Input.displayName = 'Input';
|
|
85
|
+
|
|
86
|
+
exports.Input = Input;
|
|
87
|
+
exports.InputBase = InputBase;
|
|
88
|
+
exports.TextField = TextField;
|
|
89
|
+
//# sourceMappingURL=Input.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.cjs","sources":["../../../../../src/components/atoms/Inputs/Input/Input.tsx"],"sourcesContent":[null],"names":["useHotkeyHint","useState","useResolvedTestId","useContext","sortCx","cx","_jsxs","AriaGroup","_jsx","AriaInput","Tooltip","TooltipTrigger","HelpCircle","InfoCircle","AriaButton","EyeOff","Eye","createContext","AriaTextField","_Fragment","Label","HintText"],"mappings":";;;;;;;;;;;;;AAkDA;MACa,SAAS,GAAG,CAAC,EACxB,GAAG,EACH,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,IAAI,GAAG,IAAI,EACX,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,EAAE,IAAI,EACV,WAAW,EACX,gBAAgB,EAChB,gB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MAAM,EACb,aAAa,EAAE,UAAU,EACzB,GAAG,KAAK,EACG,KAAI;AACf,IAAA,QACEG,cAAA,CAAC,SAAS,EAAA,EAAA,YAAA,EAAa,CAAC,KAAK,GAAG,WAAW,GAAG,SAAS,EAAA,GAAM,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAA,QAAA,EACjG,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,MACzBF,eAAA,CAAAa,mBAAA,EAAA,EAAA,QAAA,EAAA,CACG,KAAK,KACJX,cAAA,CAACY,WAAK,EAAA,EAAC,UAAU,EAAE,qBAAqB,GAAG,CAAC,qBAAqB,GAAG,UAAU,EAAE,SAAS,EAAE,SAAS,EAAA,QAAA,EACjG,KAAK,EAAA,CACA,CACT,EAEDZ,cAAA,CAAC,SAAS,IAEN,GAAG;oBACH,QAAQ;oBACR,IAAI;oBACJ,WAAW;AACX,oBAAA,IAAI,EAAE,IAAI;oBACV,QAAQ;oBACR,SAAS;oBACT,aAAa;oBACb,cAAc;oBACd,gBAAgB;oBAChB,gBAAgB;oBAChB,OAAO;oBACP,IAAI;AACJ,oBAAA,aAAa,EAAE,UAAU,EAAA,CAE3B,EAED,IAAI,IAAIA,eAACa,iBAAQ,EAAA,EAAC,SAAS,EAAE,SAAS,YAAG,IAAI,EAAA,CAAY,IACzD,CACJ,EAAA,CACS;AAEhB;AAEA,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type ComponentType, type HTMLAttributes, type ReactNode, type Ref } from 'react';
|
|
2
|
+
import type { InputProps as AriaInputProps, TextFieldProps as AriaTextFieldProps } from 'react-aria-components';
|
|
3
|
+
export interface InputBaseProps extends Omit<AriaInputProps, 'size'> {
|
|
4
|
+
/** Tooltip message on hover. */
|
|
5
|
+
tooltip?: string;
|
|
6
|
+
/** Whether the input is invalid. */
|
|
7
|
+
isInvalid?: boolean;
|
|
8
|
+
/** Whether the input is disabled. */
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
/** Whether the input is required. */
|
|
11
|
+
isRequired?: boolean;
|
|
12
|
+
/** Sets the input height, padding and text size. */
|
|
13
|
+
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
/** Placeholder text. */
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/** Class name for the icon. */
|
|
17
|
+
iconClassName?: string;
|
|
18
|
+
/** Class name for the input. */
|
|
19
|
+
inputClassName?: string;
|
|
20
|
+
/** Class name for the input wrapper. */
|
|
21
|
+
wrapperClassName?: string;
|
|
22
|
+
/** Class name for the tooltip. */
|
|
23
|
+
tooltipClassName?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Keyboard shortcut to display. `true` shows the search shortcut (⌘K on macOS, Ctrl K elsewhere). A
|
|
26
|
+
* shortcut (`⌘J`, `mod+j`, `Ctrl+J`) is drawn for the user's platform; text that is not a shortcut is shown
|
|
27
|
+
* as written.
|
|
28
|
+
*/
|
|
29
|
+
shortcut?: string | boolean;
|
|
30
|
+
/** Ref forwarded to the underlying `<input>`. */
|
|
31
|
+
ref?: Ref<HTMLInputElement>;
|
|
32
|
+
/** Ref forwarded to the group `<div>` that wraps the input, icon and adornments. */
|
|
33
|
+
groupRef?: Ref<HTMLDivElement>;
|
|
34
|
+
/** Icon component to display on the left side of the input. */
|
|
35
|
+
icon?: ComponentType<HTMLAttributes<HTMLOrSVGElement>>;
|
|
36
|
+
/** Overrides the `data-testid` applied to the underlying `<input>` (defaults to `fd-input`). */
|
|
37
|
+
'data-testid'?: string;
|
|
38
|
+
}
|
|
39
|
+
/** Bare input group with icon, tooltip and shortcut adornments but no label or hint; `Input` composes it inside a `TextField`. */
|
|
40
|
+
export declare const InputBase: {
|
|
41
|
+
({ ref, tooltip, shortcut, groupRef, size, isInvalid, isDisabled, isRequired, icon: Icon, placeholder, wrapperClassName, tooltipClassName, inputClassName, iconClassName, type, "data-testid": dataTestId, ...inputProps }: InputBaseProps): import("react").JSX.Element;
|
|
42
|
+
displayName: string;
|
|
43
|
+
};
|
|
44
|
+
interface TextFieldContextProps extends Partial<Pick<InputBaseProps, 'size' | 'wrapperClassName' | 'inputClassName' | 'iconClassName' | 'tooltipClassName'>> {
|
|
45
|
+
}
|
|
46
|
+
export interface TextFieldProps extends AriaTextFieldProps, TextFieldContextProps {
|
|
47
|
+
}
|
|
48
|
+
/** Wrapper around react-aria-components' `TextField` that shares `size` and the class-name props with a nested `InputBase` through context. */
|
|
49
|
+
export declare const TextField: {
|
|
50
|
+
({ className, size, inputClassName, wrapperClassName, iconClassName, tooltipClassName, ...props }: TextFieldProps): import("react").JSX.Element;
|
|
51
|
+
displayName: string;
|
|
52
|
+
};
|
|
53
|
+
export interface InputProps extends AriaTextFieldProps, Pick<InputBaseProps, 'ref' | 'placeholder' | 'icon' | 'shortcut' | 'tooltip' | 'groupRef' | 'size' | 'wrapperClassName' | 'inputClassName' | 'iconClassName' | 'tooltipClassName'> {
|
|
54
|
+
/** Label text for the input */
|
|
55
|
+
label?: string;
|
|
56
|
+
/** Helper text displayed below the input */
|
|
57
|
+
hint?: ReactNode;
|
|
58
|
+
/** Whether to hide required indicator from label */
|
|
59
|
+
hideRequiredIndicator?: boolean;
|
|
60
|
+
/** Applied to the underlying `<input>` (not the wrapper). Defaults to `fd-input`. */
|
|
61
|
+
'data-testid'?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A single-line text field for collecting user input. Reach for it for a short value such as a name, an email or a
|
|
65
|
+
* password; to filter a list use `SearchInput`, and for several lines `TextArea`.
|
|
66
|
+
*
|
|
67
|
+
* @summary text field for collecting a single line of user input
|
|
68
|
+
*/
|
|
69
|
+
export declare const Input: {
|
|
70
|
+
({ size, placeholder, icon: Icon, label, hint, shortcut, hideRequiredIndicator, className, ref, groupRef, tooltip, iconClassName, inputClassName, wrapperClassName, tooltipClassName, type, "data-testid": dataTestId, ...props }: InputProps): import("react").JSX.Element;
|
|
71
|
+
displayName: string;
|
|
72
|
+
};
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Inputs/Input/Input.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,aAAa,EAAiB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAwB,MAAM,OAAO,CAAC;AAC/H,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAMhH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC;IAClE,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,iDAAiD;IACjD,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,oFAAoF;IACpF,QAAQ,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC/B,+DAA+D;IAC/D,IAAI,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACvD,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,kIAAkI;AAClI,eAAO,MAAM,SAAS;gOAkBnB,cAAc;;CAoJhB,CAAC;AAIF,UAAU,qBACR,SAAQ,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,eAAe,GAAG,kBAAkB,CAAC,CAAC;CAAG;AAIjI,MAAM,WAAW,cAAe,SAAQ,kBAAkB,EAAE,qBAAqB;CAAG;AAEpF,+IAA+I;AAC/I,eAAO,MAAM,SAAS;uGAQnB,cAAc;;CAahB,CAAC;AAIF,MAAM,WAAW,UACf,SAAQ,kBAAkB,EACxB,IAAI,CACF,cAAc,EACZ,KAAK,GACL,aAAa,GACb,MAAM,GACN,UAAU,GACV,SAAS,GACT,UAAU,GACV,MAAM,GACN,kBAAkB,GAClB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,CACrB;IACH,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,oDAAoD;IACpD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,KAAK;uOAmBf,UAAU;;CAmCZ,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { HelpCircle, InfoCircle, EyeOff, Eye } from '@flipdish/ui-icons';
|
|
3
|
+
import { Tooltip, TooltipTrigger } from '@flipdish/ui-library/components/atoms/Tooltip';
|
|
4
|
+
import { sortCx, cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
|
+
import { useResolvedTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
6
|
+
import { createContext, useState, useContext } from 'react';
|
|
7
|
+
import { Group, Input as Input$1, Button, TextField as TextField$1 } from 'react-aria-components';
|
|
8
|
+
import { useHotkeyHint } from '../../../../hooks/__internal__/useHotkeyHint/useHotkeyHint.js';
|
|
9
|
+
import { HintText } from '../components/HintText.js';
|
|
10
|
+
import { Label } from '../components/Label.js';
|
|
11
|
+
|
|
12
|
+
/** Bare input group with icon, tooltip and shortcut adornments but no label or hint; `Input` composes it inside a `TextField`. */
|
|
13
|
+
const InputBase = ({ ref, tooltip, shortcut, groupRef, size = 'md', isInvalid, isDisabled, isRequired, icon: Icon, placeholder, wrapperClassName, tooltipClassName, inputClassName, iconClassName, type = 'text', 'data-testid': dataTestId, ...inputProps }) => {
|
|
14
|
+
const shortcutLabel = useHotkeyHint(shortcut === true ? 'mod+k' : shortcut || null);
|
|
15
|
+
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
|
16
|
+
const inputTestId = useResolvedTestId({ testId: dataTestId, segment: 'input', rootName: 'input' });
|
|
17
|
+
// Check if the input has a leading icon or a trailing adornment (tooltip, invalid
|
|
18
|
+
// indicator, or the password visibility toggle) so we can reserve right-side padding.
|
|
19
|
+
const hasTrailingIcon = Boolean(tooltip) || Boolean(isInvalid) || type === 'password';
|
|
20
|
+
const hasLeadingIcon = Icon;
|
|
21
|
+
// If the input is inside a `TextFieldContext`, use its context to simplify applying styles
|
|
22
|
+
const context = useContext(TextFieldContext);
|
|
23
|
+
const inputSize = context?.size || size;
|
|
24
|
+
// A wrapping `TextField` can make the group invalid without the prop; the `group-invalid` classes keep the error icon's space then.
|
|
25
|
+
const sizes = sortCx({
|
|
26
|
+
sm: {
|
|
27
|
+
root: cx('px-3 py-2 text-sm', hasLeadingIcon && 'pl-9', hasTrailingIcon ? 'pr-9' : 'group-invalid/input:pr-9'),
|
|
28
|
+
iconLeading: 'left-3 size-4 stroke-[2.25px]',
|
|
29
|
+
iconTrailing: 'right-3',
|
|
30
|
+
shortcut: cx('pr-1.5', hasTrailingIcon ? 'right-7' : 'right-0.5 group-invalid/input:right-7'),
|
|
31
|
+
},
|
|
32
|
+
md: {
|
|
33
|
+
root: cx('px-3 py-2 text-md', hasLeadingIcon && 'pl-10', hasTrailingIcon ? 'pr-9' : 'group-invalid/input:pr-9'),
|
|
34
|
+
iconLeading: 'left-3 size-5',
|
|
35
|
+
iconTrailing: 'right-3',
|
|
36
|
+
shortcut: cx('pr-2', hasTrailingIcon ? 'right-7' : 'right-0.5 group-invalid/input:right-7'),
|
|
37
|
+
},
|
|
38
|
+
lg: {
|
|
39
|
+
root: cx('px-3.5 py-2.5 text-md', hasLeadingIcon && 'pl-10.5', hasTrailingIcon ? 'pr-9.5' : 'group-invalid/input:pr-9.5'),
|
|
40
|
+
iconLeading: 'left-3.5 size-5',
|
|
41
|
+
iconTrailing: 'right-3.5',
|
|
42
|
+
shortcut: cx('pr-2.5', hasTrailingIcon ? 'right-7.5' : 'right-0.5 group-invalid/input:right-7.5'),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
return (jsxs(Group, { isDisabled, isInvalid, ref: groupRef, className: ({ isFocusWithin, isDisabled, isInvalid }) => cx('group/input relative flex w-full flex-row place-content-center place-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',
|
|
46
|
+
// Disabled state styles
|
|
47
|
+
isDisabled && 'cursor-not-allowed opacity-50', 'group-disabled:cursor-not-allowed group-disabled:opacity-50',
|
|
48
|
+
// Invalid state styles
|
|
49
|
+
isInvalid && 'ring-error_subtle', 'group-invalid:ring-error_subtle',
|
|
50
|
+
// Invalid state with focus-within styles
|
|
51
|
+
isInvalid && isFocusWithin && 'ring-2 ring-error', isFocusWithin && 'group-invalid:ring-2 group-invalid:ring-error', context?.wrapperClassName, wrapperClassName), children: [Icon && (jsx(Icon, { className: cx('pointer-events-none absolute text-fg-quaternary', sizes[inputSize].iconLeading, context?.iconClassName, iconClassName) })), jsx(Input$1, { ...inputProps, ref: ref, "data-testid": inputTestId, required: isRequired, type: type === 'password' && isPasswordVisible ? 'text' : type, placeholder: placeholder, className: cx('m-0 w-full bg-transparent text-primary ring-0 outline-hidden placeholder:text-placeholder autofill:rounded-lg autofill:text-primary disabled:cursor-not-allowed', sizes[inputSize].root, context?.inputClassName, inputClassName) }), tooltip && type !== 'password' && (jsx(Tooltip, { title: tooltip, placement: "top", children: jsx(TooltipTrigger, { "aria-label": "More information", className: cx('absolute cursor-pointer text-fg-quaternary transition duration-100 ease-linear group-invalid/input:hidden hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName), children: jsx(HelpCircle, { className: "size-4 stroke-[2.25px]" }) }) })), type !== 'password' && (jsx(InfoCircle, { className: cx('pointer-events-none absolute hidden size-4 stroke-[2.25px] text-fg-error-secondary group-invalid/input:block', sizes[inputSize].iconTrailing, context?.tooltipClassName, tooltipClassName) })), type === 'password' && (jsx(Button, { "aria-label": "Toggle password visibility", onClick: () => setIsPasswordVisible(!isPasswordVisible), className: cx('absolute flex cursor-pointer items-center justify-center text-fg-quaternary transition duration-100 ease-linear hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover focus:outline-hidden', sizes[inputSize].iconTrailing), children: isPasswordVisible ? jsx(EyeOff, { className: "size-4 stroke-[2.25px]" }) : jsx(Eye, { className: "size-4 stroke-[2.25px]" }) })), shortcut && (jsx("div", { className: cx('pointer-events-none absolute inset-y-0.5 z-10 hidden items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8 md:flex', sizes[inputSize].shortcut), children: jsx("span", { "aria-hidden": "true", className: "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset", children: shortcutLabel }) }))] }));
|
|
52
|
+
};
|
|
53
|
+
InputBase.displayName = 'InputBase';
|
|
54
|
+
const TextFieldContext = createContext({});
|
|
55
|
+
/** Wrapper around react-aria-components' `TextField` that shares `size` and the class-name props with a nested `InputBase` through context. */
|
|
56
|
+
const TextField = ({ className, size = 'md', inputClassName, wrapperClassName, iconClassName, tooltipClassName, ...props }) => {
|
|
57
|
+
return (jsx(TextFieldContext.Provider, { value: { inputClassName, wrapperClassName, iconClassName, tooltipClassName, size }, children: jsx(TextField$1, { ...props, "data-input-wrapper": true, "data-input-size": size, className: (state) => cx('group flex h-max w-full flex-col items-start justify-start gap-1.5', typeof className === 'function' ? className(state) : className) }) }));
|
|
58
|
+
};
|
|
59
|
+
TextField.displayName = 'TextField';
|
|
60
|
+
/**
|
|
61
|
+
* A single-line text field for collecting user input. Reach for it for a short value such as a name, an email or a
|
|
62
|
+
* password; to filter a list use `SearchInput`, and for several lines `TextArea`.
|
|
63
|
+
*
|
|
64
|
+
* @summary text field for collecting a single line of user input
|
|
65
|
+
*/
|
|
66
|
+
const Input = ({ size = 'md', placeholder, icon: Icon, label, hint, shortcut, hideRequiredIndicator, className, ref, groupRef, tooltip, iconClassName, inputClassName, wrapperClassName, tooltipClassName, type = 'text', 'data-testid': dataTestId, ...props }) => {
|
|
67
|
+
return (jsx(TextField, { "aria-label": !label ? placeholder : undefined, ...props, size: size, className: className, children: ({ isRequired, isInvalid }) => (jsxs(Fragment, { children: [label && (jsx(Label, { isRequired: hideRequiredIndicator ? !hideRequiredIndicator : isRequired, isInvalid: isInvalid, children: label })), jsx(InputBase, { ref,
|
|
68
|
+
groupRef,
|
|
69
|
+
size,
|
|
70
|
+
placeholder,
|
|
71
|
+
icon: Icon,
|
|
72
|
+
shortcut,
|
|
73
|
+
isInvalid,
|
|
74
|
+
iconClassName,
|
|
75
|
+
inputClassName,
|
|
76
|
+
wrapperClassName,
|
|
77
|
+
tooltipClassName,
|
|
78
|
+
tooltip,
|
|
79
|
+
type,
|
|
80
|
+
'data-testid': dataTestId }), hint && jsx(HintText, { isInvalid: isInvalid, children: hint })] })) }));
|
|
81
|
+
};
|
|
82
|
+
Input.displayName = 'Input';
|
|
83
|
+
|
|
84
|
+
export { Input, InputBase, TextField };
|
|
85
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../../../src/components/atoms/Inputs/Input/Input.tsx"],"sourcesContent":[null],"names":["_jsxs","AriaGroup","_jsx","AriaInput","AriaButton","AriaTextField","_Fragment"],"mappings":";;;;;;;;;;;AAkDA;MACa,SAAS,GAAG,CAAC,EACxB,GAAG,EACH,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,IAAI,GAAG,IAAI,EACX,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,EAAE,IAAI,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,IAAI,GAAG,MAAM,EACb,aAAa,EAAE,UAAU,EACzB,GAAG,UAAU,EACE,KAAI;AACnB,IAAA,MAAM,aAAa,GAAG,aAAa,CAAC,QAAQ,KAAK,IAAI,GAAG,OAAO,GAAG,QAAQ,IAAI,IAAI,CAAC;IACnF,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;AACjE,IAAA,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;;;AAIlG,IAAA,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,IAAI,KAAK,UAAU;IACrF,MAAM,cAAc,GAAG,IAAI;;AAG3B,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC;AAE5C,IAAA,MAAM,SAAS,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI;;IAGvC,MAAM,KAAK,GAAG,MAAM,CAAC;AACnB,QAAA,EAAE,EAAE;AACF,YAAA,IAA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,EAAE,SAAS,YAAG,IAAI,EAAA,CAAY,IACzD,CACJ,EAAA,CACS;AAEhB;AAEA,KAAK,CAAC,WAAW,GAAG,OAAO;;"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var uiIcons = require('@flipdish/ui-icons');
|
|
5
|
+
var LoadingIndicator = require('@flipdish/ui-library/components/atoms/LoadingIndicator');
|
|
6
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
7
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
8
|
+
var reactAriaComponents = require('react-aria-components');
|
|
9
|
+
var useDebouncedSearch = require('../../../../hooks/__internal__/useDebouncedSearch/useDebouncedSearch.cjs');
|
|
10
|
+
var useHotkeyHint = require('../../../../hooks/__internal__/useHotkeyHint/useHotkeyHint.cjs');
|
|
11
|
+
var HintText = require('../components/HintText.cjs');
|
|
12
|
+
var Label = require('../components/Label.cjs');
|
|
13
|
+
|
|
14
|
+
const sizes = cx.sortCx({
|
|
15
|
+
sm: { input: 'py-2 pr-9 pl-9 text-sm', icon: 'left-3 size-4 stroke-[2.25px]', clear: 'right-2', shortcut: 'pr-1.5' },
|
|
16
|
+
md: { input: 'py-2 pr-9 pl-10 text-md', icon: 'left-3 size-5', clear: 'right-2', shortcut: 'pr-2' },
|
|
17
|
+
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' },
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* A search box with a magnifier, a clear button once it holds text, and Escape to clear. Use it
|
|
21
|
+
* wherever typing filters a list or table; for a field that collects a value, use `Input`.
|
|
22
|
+
*
|
|
23
|
+
* @summary search box that filters as you type and clears in one press
|
|
24
|
+
*/
|
|
25
|
+
const SearchInput = ({ label, hint, placeholder, size = 'md', clearLabel = 'Clear search', isLoading = false, debounce, shortcut, className, wrapperClassName, inputClassName, ref, 'data-testid': dataTestId, ...props }) => {
|
|
26
|
+
const inputTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'search-input', rootName: 'search-input' });
|
|
27
|
+
const shortcutLabel = useHotkeyHint.useHotkeyHint(shortcut === true ? 'mod+k' : shortcut || null);
|
|
28
|
+
const { value, defaultValue, onChange, onSubmit, onClear, onKeyDown, ...fieldProps } = props;
|
|
29
|
+
const draft = useDebouncedSearch.useDebouncedSearch({ value, initialValue: defaultValue, onChange: (next) => onChange?.(next), delay: debounce });
|
|
30
|
+
// The draft owns the text in both modes, so turning `debounce` on or off keeps the query; a controlled field without
|
|
31
|
+
// `debounce` shows its owner's value as given. The draft starts from `defaultValue`, so the field gets only `value`.
|
|
32
|
+
const fieldValue = debounce === undefined && value !== undefined ? value : draft.draft;
|
|
33
|
+
// React Aria cancels Enter's form submission whenever it has `onSubmit`, so the field gets one only when the caller passes one.
|
|
34
|
+
const handleSubmit = onSubmit &&
|
|
35
|
+
((next) => {
|
|
36
|
+
draft.submit();
|
|
37
|
+
onSubmit(next);
|
|
38
|
+
});
|
|
39
|
+
const handleKeyDown = (event) => {
|
|
40
|
+
if (event.key === 'Enter')
|
|
41
|
+
draft.submit();
|
|
42
|
+
onKeyDown?.(event);
|
|
43
|
+
};
|
|
44
|
+
const handleClear = () => {
|
|
45
|
+
draft.clear();
|
|
46
|
+
onClear?.();
|
|
47
|
+
};
|
|
48
|
+
return (jsxRuntime.jsx(reactAriaComponents.SearchField, { "aria-label": label ? undefined : placeholder, ...fieldProps, value: fieldValue, onChange: draft.change, onSubmit: handleSubmit,
|
|
49
|
+
// Only when there can be a draft to commit: React Aria stops every key from bubbling past a handler, and a read-only field
|
|
50
|
+
// otherwise has none, so Escape still reaches an enclosing modal.
|
|
51
|
+
onKeyDown: debounce !== undefined && !fieldProps.isReadOnly ? handleKeyDown : onKeyDown, onClear: handleClear, 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(Label.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 ? (
|
|
52
|
+
// In the magnifier's slot, with its size classes, so the field does not shift; the input's `aria-busy` carries the state.
|
|
53
|
+
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(
|
|
54
|
+
// The browser draws its own cancel control on a search input; the clear button below replaces it.
|
|
55
|
+
'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(HintText.HintText, { isInvalid: isInvalid, children: hint })] })) }));
|
|
56
|
+
};
|
|
57
|
+
SearchInput.displayName = 'SearchInput';
|
|
58
|
+
|
|
59
|
+
exports.SearchInput = SearchInput;
|
|
60
|
+
//# sourceMappingURL=SearchInput.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.cjs","sources":["../../../../../src/components/atoms/Inputs/SearchInput/SearchInput.tsx"],"sourcesContent":[null],"names":["sortCx","useResolvedTestId","useHotkeyHint","useDebouncedSearch","_jsx","AriaSearchField","cx","_jsxs","_Fragment","Label","AriaGroup","joinTestId","LoadingIndicator","SearchLg","AriaInput","AriaButton","XClose","HintText"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,KAAK,GAAGA,SAAM,CAAC;AACnB,IAAA,EAAE,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,IAAI,EAAE,+BAA+B,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE;AACpH,IAAA,EAAE,EAAE,EAAE,KAAK,EAAE,yBAAyB,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE;AACnG,IAAA,EAAE,EAAE,EAAE,KAAK,EAAE,+BAA+B,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ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AC,WAAW,GAAG,aAAa;;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
|
+
import type { SearchFieldProps as AriaSearchFieldProps } from 'react-aria-components';
|
|
3
|
+
export interface SearchInputProps extends Omit<AriaSearchFieldProps, 'children' | 'className' | 'style'> {
|
|
4
|
+
/** Visible label above the field. Without one the field is named by `aria-label`, or failing that by its `placeholder`. */
|
|
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
|
+
*/
|
|
43
|
+
export declare const SearchInput: {
|
|
44
|
+
({ label, hint, placeholder, size, clearLabel, isLoading, debounce, shortcut, className, wrapperClassName, inputClassName, ref, "data-testid": dataTestId, ...props }: SearchInputProps): import("react").JSX.Element;
|
|
45
|
+
displayName: string;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=SearchInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Inputs/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAatF,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;IACtG,2HAA2H;IAC3H,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yHAAyH;IACzH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sCAAsC;IACtC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,yHAAyH;IACzH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW;2KAerB,gBAAgB;;CAgHlB,CAAC"}
|