@redsift/design-system 11.5.0 → 11.6.0-muiv5-alpha.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/_virtual/_rollupPluginBabelHelpers.js +133 -0
- package/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/_virtual/jsx-runtime.js +4 -0
- package/_virtual/jsx-runtime.js.map +1 -0
- package/_virtual/react-jsx-runtime.development.js +4 -0
- package/_virtual/react-jsx-runtime.development.js.map +1 -0
- package/_virtual/react-jsx-runtime.production.min.js +4 -0
- package/_virtual/react-jsx-runtime.production.min.js.map +1 -0
- package/components/alert/Alert.d.ts +9 -0
- package/components/alert/Alert.js +117 -0
- package/components/alert/Alert.js.map +1 -0
- package/components/alert/intl/en-US.json.js +7 -0
- package/components/alert/intl/en-US.json.js.map +1 -0
- package/components/alert/intl/fr-FR.json.js +7 -0
- package/components/alert/intl/fr-FR.json.js.map +1 -0
- package/components/alert/intl/index.js +10 -0
- package/components/alert/intl/index.js.map +1 -0
- package/components/alert/styles.js +54 -0
- package/components/alert/styles.js.map +1 -0
- package/components/alert/types.d.ts +49 -0
- package/components/alert/types.js +20 -0
- package/components/alert/types.js.map +1 -0
- package/components/app-bar/AppBar.d.ts +9 -0
- package/components/app-bar/AppBar.js +95 -0
- package/components/app-bar/AppBar.js.map +1 -0
- package/components/app-bar/intl/en-US.json.js +9 -0
- package/components/app-bar/intl/en-US.json.js.map +1 -0
- package/components/app-bar/intl/fr-FR.json.js +9 -0
- package/components/app-bar/intl/fr-FR.json.js.map +1 -0
- package/components/app-bar/intl/index.js +10 -0
- package/components/app-bar/intl/index.js.map +1 -0
- package/components/app-bar/styles.js +139 -0
- package/components/app-bar/styles.js.map +1 -0
- package/components/app-bar/types.d.ts +31 -0
- package/components/app-container/AppContainer.d.ts +11 -0
- package/components/app-container/AppContainer.js +117 -0
- package/components/app-container/AppContainer.js.map +1 -0
- package/components/app-container/context.d.ts +6 -0
- package/components/app-container/context.js +6 -0
- package/components/app-container/context.js.map +1 -0
- package/components/app-container/styles.js +30 -0
- package/components/app-container/styles.js.map +1 -0
- package/components/app-container/types.d.ts +51 -0
- package/components/app-content/AppContent.d.ts +9 -0
- package/components/app-content/AppContent.js +42 -0
- package/components/app-content/AppContent.js.map +1 -0
- package/components/app-content/styles.js +54 -0
- package/components/app-content/styles.js.map +1 -0
- package/components/app-content/types.d.ts +19 -0
- package/components/app-side-panel/AppSidePanel.d.ts +9 -0
- package/components/app-side-panel/AppSidePanel.js +86 -0
- package/components/app-side-panel/AppSidePanel.js.map +1 -0
- package/components/app-side-panel/intl/en-US.json.js +9 -0
- package/components/app-side-panel/intl/en-US.json.js.map +1 -0
- package/components/app-side-panel/intl/fr-FR.json.js +9 -0
- package/components/app-side-panel/intl/fr-FR.json.js.map +1 -0
- package/components/app-side-panel/intl/index.js +10 -0
- package/components/app-side-panel/intl/index.js.map +1 -0
- package/components/app-side-panel/styles.js +183 -0
- package/components/app-side-panel/styles.js.map +1 -0
- package/components/app-side-panel/types.d.ts +39 -0
- package/components/app-side-panel/types.js +15 -0
- package/components/app-side-panel/types.js.map +1 -0
- package/components/app-side-panel/useAppSidePanel.d.ts +6 -0
- package/components/app-side-panel/useAppSidePanel.js +23 -0
- package/components/app-side-panel/useAppSidePanel.js.map +1 -0
- package/components/badge/Badge.d.ts +9 -0
- package/components/badge/Badge.js +44 -0
- package/components/badge/Badge.js.map +1 -0
- package/components/badge/styles.js +93 -0
- package/components/badge/styles.js.map +1 -0
- package/components/badge/types.d.ts +37 -0
- package/components/badge/types.js +14 -0
- package/components/badge/types.js.map +1 -0
- package/components/breadcrumb-item/BreadcrumbItem.d.ts +9 -0
- package/components/breadcrumb-item/BreadcrumbItem.js +47 -0
- package/components/breadcrumb-item/BreadcrumbItem.js.map +1 -0
- package/components/breadcrumb-item/styles.js +48 -0
- package/components/breadcrumb-item/styles.js.map +1 -0
- package/components/breadcrumb-item/types.d.ts +23 -0
- package/components/breadcrumbs/Breadcrumbs.d.ts +13 -0
- package/components/breadcrumbs/Breadcrumbs.js +61 -0
- package/components/breadcrumbs/Breadcrumbs.js.map +1 -0
- package/components/breadcrumbs/styles.js +38 -0
- package/components/breadcrumbs/styles.js.map +1 -0
- package/components/breadcrumbs/types.d.ts +19 -0
- package/components/button/Button.d.ts +13 -0
- package/components/button/Button.js +92 -0
- package/components/button/Button.js.map +1 -0
- package/components/button/styles.d.ts +20 -0
- package/components/button/styles.js +219 -0
- package/components/button/styles.js.map +1 -0
- package/components/button/types.d.ts +67 -0
- package/components/button/types.js +19 -0
- package/components/button/types.js.map +1 -0
- package/components/button-group/ButtonGroup.d.ts +9 -0
- package/components/button-group/ButtonGroup.js +67 -0
- package/components/button-group/ButtonGroup.js.map +1 -0
- package/components/button-group/styles.js +103 -0
- package/components/button-group/styles.js.map +1 -0
- package/components/button-group/types.d.ts +36 -0
- package/components/button-group/types.js +19 -0
- package/components/button-group/types.js.map +1 -0
- package/components/button-link/ButtonLink.d.ts +13 -0
- package/components/button-link/ButtonLink.js +85 -0
- package/components/button-link/ButtonLink.js.map +1 -0
- package/components/button-link/types.d.ts +18 -0
- package/components/card/Card.d.ts +13 -0
- package/components/card/Card.js +81 -0
- package/components/card/Card.js.map +1 -0
- package/components/card/intl/en-US.json.js +9 -0
- package/components/card/intl/en-US.json.js.map +1 -0
- package/components/card/intl/fr-FR.json.js +9 -0
- package/components/card/intl/fr-FR.json.js.map +1 -0
- package/components/card/intl/index.js +10 -0
- package/components/card/intl/index.js.map +1 -0
- package/components/card/styles.js +63 -0
- package/components/card/styles.js.map +1 -0
- package/components/card/types.d.ts +25 -0
- package/components/card-actions/CardActions.d.ts +9 -0
- package/components/card-actions/CardActions.js +33 -0
- package/components/card-actions/CardActions.js.map +1 -0
- package/components/card-actions/styles.js +15 -0
- package/components/card-actions/styles.js.map +1 -0
- package/components/card-actions/types.d.ts +11 -0
- package/components/card-body/CardBody.d.ts +9 -0
- package/components/card-body/CardBody.js +28 -0
- package/components/card-body/CardBody.js.map +1 -0
- package/components/card-body/styles.js +18 -0
- package/components/card-body/styles.js.map +1 -0
- package/components/card-body/types.d.ts +11 -0
- package/components/card-header/CardHeader.d.ts +9 -0
- package/components/card-header/CardHeader.js +56 -0
- package/components/card-header/CardHeader.js.map +1 -0
- package/components/card-header/styles.js +31 -0
- package/components/card-header/styles.js.map +1 -0
- package/components/card-header/types.d.ts +28 -0
- package/components/checkbox/Checkbox.d.ts +11 -0
- package/components/checkbox/Checkbox.js +135 -0
- package/components/checkbox/Checkbox.js.map +1 -0
- package/components/checkbox/styles.js +113 -0
- package/components/checkbox/styles.js.map +1 -0
- package/components/checkbox/types.d.ts +60 -0
- package/components/checkbox-group/CheckboxGroup.d.ts +10 -0
- package/components/checkbox-group/CheckboxGroup.js +101 -0
- package/components/checkbox-group/CheckboxGroup.js.map +1 -0
- package/components/checkbox-group/context.js +6 -0
- package/components/checkbox-group/context.js.map +1 -0
- package/components/checkbox-group/styles.js +78 -0
- package/components/checkbox-group/styles.js.map +1 -0
- package/components/checkbox-group/types.d.ts +72 -0
- package/components/checkbox-group/types.js +18 -0
- package/components/checkbox-group/types.js.map +1 -0
- package/components/conditional-wrapper/ConditionalWrapper.d.ts +6 -0
- package/components/conditional-wrapper/ConditionalWrapper.js +13 -0
- package/components/conditional-wrapper/ConditionalWrapper.js.map +1 -0
- package/components/conditional-wrapper/types.d.ts +10 -0
- package/components/detailed-card/DetailedCard.d.ts +15 -0
- package/components/detailed-card/DetailedCard.js +170 -0
- package/components/detailed-card/DetailedCard.js.map +1 -0
- package/components/detailed-card/intl/en-US.json.js +7 -0
- package/components/detailed-card/intl/en-US.json.js.map +1 -0
- package/components/detailed-card/intl/fr-FR.json.js +7 -0
- package/components/detailed-card/intl/fr-FR.json.js.map +1 -0
- package/components/detailed-card/intl/index.js +10 -0
- package/components/detailed-card/intl/index.js.map +1 -0
- package/components/detailed-card/styles.js +49 -0
- package/components/detailed-card/styles.js.map +1 -0
- package/components/detailed-card/types.d.ts +40 -0
- package/components/detailed-card-collapsible-section-items/DetailedCardCollapsibleSectionItems.d.ts +9 -0
- package/components/detailed-card-collapsible-section-items/DetailedCardCollapsibleSectionItems.js +33 -0
- package/components/detailed-card-collapsible-section-items/DetailedCardCollapsibleSectionItems.js.map +1 -0
- package/components/detailed-card-collapsible-section-items/styles.js +35 -0
- package/components/detailed-card-collapsible-section-items/styles.js.map +1 -0
- package/components/detailed-card-collapsible-section-items/types.d.ts +16 -0
- package/components/detailed-card-header/DetailedCardHeader.d.ts +9 -0
- package/components/detailed-card-header/DetailedCardHeader.js +45 -0
- package/components/detailed-card-header/DetailedCardHeader.js.map +1 -0
- package/components/detailed-card-header/styles.js +26 -0
- package/components/detailed-card-header/styles.js.map +1 -0
- package/components/detailed-card-header/types.d.ts +20 -0
- package/components/detailed-card-section/DetailedCardSection.d.ts +9 -0
- package/components/detailed-card-section/DetailedCardSection.js +90 -0
- package/components/detailed-card-section/DetailedCardSection.js.map +1 -0
- package/components/detailed-card-section/intl/en-US.json.js +9 -0
- package/components/detailed-card-section/intl/en-US.json.js.map +1 -0
- package/components/detailed-card-section/intl/fr-FR.json.js +9 -0
- package/components/detailed-card-section/intl/fr-FR.json.js.map +1 -0
- package/components/detailed-card-section/intl/index.js +10 -0
- package/components/detailed-card-section/intl/index.js.map +1 -0
- package/components/detailed-card-section/styles.js +69 -0
- package/components/detailed-card-section/styles.js.map +1 -0
- package/components/detailed-card-section/types.d.ts +27 -0
- package/components/detailed-card-section-item/DetailedCardSectionItem.d.ts +9 -0
- package/components/detailed-card-section-item/DetailedCardSectionItem.js +64 -0
- package/components/detailed-card-section-item/DetailedCardSectionItem.js.map +1 -0
- package/components/detailed-card-section-item/styles.js +34 -0
- package/components/detailed-card-section-item/styles.js.map +1 -0
- package/components/detailed-card-section-item/types.d.ts +35 -0
- package/components/flexbox/Flexbox.d.ts +9 -0
- package/components/flexbox/Flexbox.js +44 -0
- package/components/flexbox/Flexbox.js.map +1 -0
- package/components/flexbox/styles.js +54 -0
- package/components/flexbox/styles.js.map +1 -0
- package/components/flexbox/types.d.ts +24 -0
- package/components/focus-within-group/FocusWithinGroup.d.ts +41 -0
- package/components/focus-within-group/FocusWithinGroup.js +91 -0
- package/components/focus-within-group/FocusWithinGroup.js.map +1 -0
- package/components/focus-within-group/context.d.ts +7 -0
- package/components/focus-within-group/context.js +21 -0
- package/components/focus-within-group/context.js.map +1 -0
- package/components/focus-within-group/reducer.d.ts +5 -0
- package/components/focus-within-group/reducer.js +419 -0
- package/components/focus-within-group/reducer.js.map +1 -0
- package/components/focus-within-group/types.d.ts +143 -0
- package/components/focus-within-group/types.js +42 -0
- package/components/focus-within-group/types.js.map +1 -0
- package/components/focus-within-group/useFocusOnList.d.ts +5 -0
- package/components/focus-within-group/useFocusOnList.js +44 -0
- package/components/focus-within-group/useFocusOnList.js.map +1 -0
- package/components/focus-within-group/useFocusOnListItem.d.ts +39 -0
- package/components/focus-within-group/useFocusOnListItem.js +148 -0
- package/components/focus-within-group/useFocusOnListItem.js.map +1 -0
- package/components/gradient-border/index.d.ts +14 -0
- package/components/gradient-border/index.js +38 -0
- package/components/gradient-border/index.js.map +1 -0
- package/components/grid/Grid.d.ts +13 -0
- package/components/grid/Grid.js +45 -0
- package/components/grid/Grid.js.map +1 -0
- package/components/grid/styles.js +55 -0
- package/components/grid/styles.js.map +1 -0
- package/components/grid/types.d.ts +22 -0
- package/components/grid-item/GridItem.d.ts +9 -0
- package/components/grid-item/GridItem.js +28 -0
- package/components/grid-item/GridItem.js.map +1 -0
- package/components/grid-item/styles.js +16 -0
- package/components/grid-item/styles.js.map +1 -0
- package/components/grid-item/types.d.ts +11 -0
- package/components/heading/Heading.d.ts +9 -0
- package/components/heading/Heading.js +50 -0
- package/components/heading/Heading.js.map +1 -0
- package/components/heading/styles.js +67 -0
- package/components/heading/styles.js.map +1 -0
- package/components/heading/types.d.ts +62 -0
- package/components/heading/types.js +26 -0
- package/components/heading/types.js.map +1 -0
- package/components/icon/Icon.d.ts +10 -0
- package/components/icon/Icon.js +116 -0
- package/components/icon/Icon.js.map +1 -0
- package/components/icon/styles.js +84 -0
- package/components/icon/styles.js.map +1 -0
- package/components/icon/types.d.ts +57 -0
- package/components/icon/types.js +18 -0
- package/components/icon/types.js.map +1 -0
- package/components/icon-button/IconButton.d.ts +12 -0
- package/components/icon-button/IconButton.js +81 -0
- package/components/icon-button/IconButton.js.map +1 -0
- package/components/icon-button/styles.js +31 -0
- package/components/icon-button/styles.js.map +1 -0
- package/components/icon-button/types.d.ts +56 -0
- package/components/icon-button/types.js +19 -0
- package/components/icon-button/types.js.map +1 -0
- package/components/icon-button-link/IconButtonLink.d.ts +13 -0
- package/components/icon-button-link/IconButtonLink.js +76 -0
- package/components/icon-button-link/IconButtonLink.js.map +1 -0
- package/components/icon-button-link/types.d.ts +18 -0
- package/components/item/Item.d.ts +10 -0
- package/components/item/Item.js +225 -0
- package/components/item/Item.js.map +1 -0
- package/components/item/styles.d.ts +20 -0
- package/components/item/styles.js +129 -0
- package/components/item/styles.js.map +1 -0
- package/components/item/types.d.ts +59 -0
- package/components/item/useMenuItem.js +55 -0
- package/components/item/useMenuItem.js.map +1 -0
- package/components/link/Link.d.ts +14 -0
- package/components/link/Link.js +67 -0
- package/components/link/Link.js.map +1 -0
- package/components/link/styles.d.ts +15 -0
- package/components/link/styles.js +145 -0
- package/components/link/styles.js.map +1 -0
- package/components/link/types.d.ts +40 -0
- package/components/link-button/LinkButton.d.ts +13 -0
- package/components/link-button/LinkButton.js +66 -0
- package/components/link-button/LinkButton.js.map +1 -0
- package/components/link-button/types.d.ts +13 -0
- package/components/listbox/ActiveDescendantListbox.d.ts +8 -0
- package/components/listbox/ActiveDescendantListbox.js +74 -0
- package/components/listbox/ActiveDescendantListbox.js.map +1 -0
- package/components/listbox/Listbox.d.ts +10 -0
- package/components/listbox/Listbox.js +110 -0
- package/components/listbox/Listbox.js.map +1 -0
- package/components/listbox/RovingTabindexListbox.d.ts +8 -0
- package/components/listbox/RovingTabindexListbox.js +30 -0
- package/components/listbox/RovingTabindexListbox.js.map +1 -0
- package/components/listbox/context.d.ts +7 -0
- package/components/listbox/context.js +15 -0
- package/components/listbox/context.js.map +1 -0
- package/components/listbox/reducer.d.ts +5 -0
- package/components/listbox/reducer.js +45 -0
- package/components/listbox/reducer.js.map +1 -0
- package/components/listbox/styles.js +44 -0
- package/components/listbox/styles.js.map +1 -0
- package/components/listbox/types.d.ts +101 -0
- package/components/listbox/types.js +32 -0
- package/components/listbox/types.js.map +1 -0
- package/components/listbox/useListboxItem.d.ts +12 -0
- package/components/listbox/useListboxItem.js +90 -0
- package/components/listbox/useListboxItem.js.map +1 -0
- package/components/number/Number.d.ts +9 -0
- package/components/number/Number.js +105 -0
- package/components/number/Number.js.map +1 -0
- package/components/number/styles.js +10 -0
- package/components/number/styles.js.map +1 -0
- package/components/number/types.d.ts +63 -0
- package/components/number-field/NumberField.d.ts +10 -0
- package/components/number-field/NumberField.js +216 -0
- package/components/number-field/NumberField.js.map +1 -0
- package/components/number-field/styles.js +240 -0
- package/components/number-field/styles.js.map +1 -0
- package/components/number-field/types.d.ts +74 -0
- package/components/number-field/types.js +14 -0
- package/components/number-field/types.js.map +1 -0
- package/components/pill/Pill.d.ts +9 -0
- package/components/pill/Pill.js +93 -0
- package/components/pill/Pill.js.map +1 -0
- package/components/pill/styles.js +305 -0
- package/components/pill/styles.js.map +1 -0
- package/components/pill/types.d.ts +47 -0
- package/components/pill/types.js +15 -0
- package/components/pill/types.js.map +1 -0
- package/components/progress-bar/ProgressBar.d.ts +9 -0
- package/components/progress-bar/ProgressBar.js +35 -0
- package/components/progress-bar/ProgressBar.js.map +1 -0
- package/components/progress-bar/styles.js +38 -0
- package/components/progress-bar/styles.js.map +1 -0
- package/components/progress-bar/types.d.ts +20 -0
- package/components/radio/Radio.d.ts +11 -0
- package/components/radio/Radio.js +128 -0
- package/components/radio/Radio.js.map +1 -0
- package/components/radio/styles.js +113 -0
- package/components/radio/styles.js.map +1 -0
- package/components/radio/types.d.ts +58 -0
- package/components/radio-group/RadioGroup.d.ts +10 -0
- package/components/radio-group/RadioGroup.js +89 -0
- package/components/radio-group/RadioGroup.js.map +1 -0
- package/components/radio-group/context.js +6 -0
- package/components/radio-group/context.js.map +1 -0
- package/components/radio-group/styles.js +78 -0
- package/components/radio-group/styles.js.map +1 -0
- package/components/radio-group/types.d.ts +68 -0
- package/components/radio-group/types.js +18 -0
- package/components/radio-group/types.js.map +1 -0
- package/components/shared/styles.d.ts +17 -0
- package/components/shared/styles.js +250 -0
- package/components/shared/styles.js.map +1 -0
- package/components/shield/Shield.d.ts +9 -0
- package/components/shield/Shield.js +136 -0
- package/components/shield/Shield.js.map +1 -0
- package/components/shield/styles.js +71 -0
- package/components/shield/styles.js.map +1 -0
- package/components/shield/types.d.ts +52 -0
- package/components/shield/types.js +25 -0
- package/components/shield/types.js.map +1 -0
- package/components/side-navigation-menu/SideNavigationMenu.d.ts +9 -0
- package/components/side-navigation-menu/SideNavigationMenu.js +367 -0
- package/components/side-navigation-menu/SideNavigationMenu.js.map +1 -0
- package/components/side-navigation-menu/context.js +6 -0
- package/components/side-navigation-menu/context.js.map +1 -0
- package/components/side-navigation-menu/reducer.js +26 -0
- package/components/side-navigation-menu/reducer.js.map +1 -0
- package/components/side-navigation-menu/styles.js +196 -0
- package/components/side-navigation-menu/styles.js.map +1 -0
- package/components/side-navigation-menu/types.d.ts +72 -0
- package/components/side-navigation-menu/types.js +21 -0
- package/components/side-navigation-menu/types.js.map +1 -0
- package/components/side-navigation-menu-bar/SideNavigationMenuBar.d.ts +9 -0
- package/components/side-navigation-menu-bar/SideNavigationMenuBar.js +217 -0
- package/components/side-navigation-menu-bar/SideNavigationMenuBar.js.map +1 -0
- package/components/side-navigation-menu-bar/context.js +6 -0
- package/components/side-navigation-menu-bar/context.js.map +1 -0
- package/components/side-navigation-menu-bar/styles.js +89 -0
- package/components/side-navigation-menu-bar/styles.js.map +1 -0
- package/components/side-navigation-menu-bar/types.d.ts +65 -0
- package/components/side-navigation-menu-bar/types.js +22 -0
- package/components/side-navigation-menu-bar/types.js.map +1 -0
- package/components/side-navigation-menu-bar/useSideNavigationMenuBar.d.ts +9 -0
- package/components/side-navigation-menu-bar/useSideNavigationMenuBar.js +70 -0
- package/components/side-navigation-menu-bar/useSideNavigationMenuBar.js.map +1 -0
- package/components/side-navigation-menu-item/SideNavigationMenuItem.d.ts +9 -0
- package/components/side-navigation-menu-item/SideNavigationMenuItem.js +115 -0
- package/components/side-navigation-menu-item/SideNavigationMenuItem.js.map +1 -0
- package/components/side-navigation-menu-item/styles.js +174 -0
- package/components/side-navigation-menu-item/styles.js.map +1 -0
- package/components/side-navigation-menu-item/types.d.ts +51 -0
- package/components/skeleton/Skeleton.d.ts +15 -0
- package/components/skeleton/Skeleton.js +42 -0
- package/components/skeleton/Skeleton.js.map +1 -0
- package/components/skeleton/styles.js +84 -0
- package/components/skeleton/styles.js.map +1 -0
- package/components/skeleton/types.d.ts +18 -0
- package/components/skeleton-circle/SkeletonCircle.d.ts +9 -0
- package/components/skeleton-circle/SkeletonCircle.js +36 -0
- package/components/skeleton-circle/SkeletonCircle.js.map +1 -0
- package/components/skeleton-circle/styles.js +26 -0
- package/components/skeleton-circle/styles.js.map +1 -0
- package/components/skeleton-circle/types.d.ts +12 -0
- package/components/skeleton-text/SkeletonText.d.ts +9 -0
- package/components/skeleton-text/SkeletonText.js +42 -0
- package/components/skeleton-text/SkeletonText.js.map +1 -0
- package/components/skeleton-text/styles.js +39 -0
- package/components/skeleton-text/styles.js.map +1 -0
- package/components/skeleton-text/types.d.ts +36 -0
- package/components/skeleton-text/types.js +20 -0
- package/components/skeleton-text/types.js.map +1 -0
- package/components/spinner/Spinner.d.ts +9 -0
- package/components/spinner/Spinner.js +82 -0
- package/components/spinner/Spinner.js.map +1 -0
- package/components/spinner/images/spinner-grey-l1.svg.js +4 -0
- package/components/spinner/images/spinner-grey-l1.svg.js.map +1 -0
- package/components/spinner/images/spinner-grey-l2.svg.js +4 -0
- package/components/spinner/images/spinner-grey-l2.svg.js.map +1 -0
- package/components/spinner/images/spinner-grey-l3.svg.js +4 -0
- package/components/spinner/images/spinner-grey-l3.svg.js.map +1 -0
- package/components/spinner/images/spinner-primary-n.svg.js +4 -0
- package/components/spinner/images/spinner-primary-n.svg.js.map +1 -0
- package/components/spinner/intl/en-US.json.js +7 -0
- package/components/spinner/intl/en-US.json.js.map +1 -0
- package/components/spinner/intl/fr-FR.json.js +7 -0
- package/components/spinner/intl/fr-FR.json.js.map +1 -0
- package/components/spinner/intl/index.js +10 -0
- package/components/spinner/intl/index.js.map +1 -0
- package/components/spinner/styles.js +13 -0
- package/components/spinner/styles.js.map +1 -0
- package/components/spinner/types.d.ts +38 -0
- package/components/spinner/types.js +16 -0
- package/components/spinner/types.js.map +1 -0
- package/components/switch/Switch.d.ts +11 -0
- package/components/switch/Switch.js +137 -0
- package/components/switch/Switch.js.map +1 -0
- package/components/switch/styles.js +187 -0
- package/components/switch/styles.js.map +1 -0
- package/components/switch/types.d.ts +58 -0
- package/components/switch-group/SwitchGroup.d.ts +10 -0
- package/components/switch-group/SwitchGroup.js +101 -0
- package/components/switch-group/SwitchGroup.js.map +1 -0
- package/components/switch-group/context.js +6 -0
- package/components/switch-group/context.js.map +1 -0
- package/components/switch-group/styles.js +78 -0
- package/components/switch-group/styles.js.map +1 -0
- package/components/switch-group/types.d.ts +72 -0
- package/components/switch-group/types.js +18 -0
- package/components/switch-group/types.js.map +1 -0
- package/components/text/Text.d.ts +9 -0
- package/components/text/Text.js +51 -0
- package/components/text/Text.js.map +1 -0
- package/components/text/styles.js +112 -0
- package/components/text/styles.js.map +1 -0
- package/components/text/types.d.ts +73 -0
- package/components/text/types.js +34 -0
- package/components/text/types.js.map +1 -0
- package/components/text-area/TextArea.d.ts +10 -0
- package/components/text-area/TextArea.js +165 -0
- package/components/text-area/TextArea.js.map +1 -0
- package/components/text-area/styles.js +240 -0
- package/components/text-area/styles.js.map +1 -0
- package/components/text-area/types.d.ts +28 -0
- package/components/text-area/types.js +14 -0
- package/components/text-area/types.js.map +1 -0
- package/components/text-field/TextField.d.ts +10 -0
- package/components/text-field/TextField.js +197 -0
- package/components/text-field/TextField.js.map +1 -0
- package/components/text-field/intl/en-US.json.js +8 -0
- package/components/text-field/intl/en-US.json.js.map +1 -0
- package/components/text-field/intl/fr-FR.json.js +8 -0
- package/components/text-field/intl/fr-FR.json.js.map +1 -0
- package/components/text-field/intl/index.js +10 -0
- package/components/text-field/intl/index.js.map +1 -0
- package/components/text-field/styles.d.ts +22 -0
- package/components/text-field/styles.js +252 -0
- package/components/text-field/styles.js.map +1 -0
- package/components/text-field/types.d.ts +99 -0
- package/components/text-field/types.js +18 -0
- package/components/text-field/types.js.map +1 -0
- package/components/theme/context.d.ts +11 -0
- package/components/theme/context.js +7 -0
- package/components/theme/context.js.map +1 -0
- package/components/theme/useTheme.d.ts +5 -0
- package/components/theme/useTheme.js +13 -0
- package/components/theme/useTheme.js.map +1 -0
- package/hooks/useBoundingRect.d.ts +8 -0
- package/hooks/useBoundingRect.js +17 -0
- package/hooks/useBoundingRect.js.map +1 -0
- package/hooks/useComputeNumberOfRows.d.ts +15 -0
- package/hooks/useComputeNumberOfRows.js +40 -0
- package/hooks/useComputeNumberOfRows.js.map +1 -0
- package/hooks/useIsLoaded.d.ts +5 -0
- package/hooks/useIsLoaded.js +14 -0
- package/hooks/useIsLoaded.js.map +1 -0
- package/hooks/useWindowSize.d.ts +8 -0
- package/hooks/useWindowSize.js +42 -0
- package/hooks/useWindowSize.js.map +1 -0
- package/index.d.ts +157 -4667
- package/index.js +121 -24514
- package/index.js.map +1 -1
- package/package.json +11 -3
- package/packages/popovers/src/components/tooltip/Tooltip.js +62 -0
- package/packages/popovers/src/components/tooltip/Tooltip.js.map +1 -0
- package/packages/popovers/src/components/tooltip/context.js +6 -0
- package/packages/popovers/src/components/tooltip/context.js.map +1 -0
- package/packages/popovers/src/components/tooltip/types.js +28 -0
- package/packages/popovers/src/components/tooltip/types.js.map +1 -0
- package/packages/popovers/src/components/tooltip/useTooltip.js +78 -0
- package/packages/popovers/src/components/tooltip/useTooltip.js.map +1 -0
- package/packages/popovers/src/components/tooltip/useTooltipContext.js +13 -0
- package/packages/popovers/src/components/tooltip/useTooltipContext.js.map +1 -0
- package/packages/popovers/src/components/tooltip-content/TooltipContent.js +80 -0
- package/packages/popovers/src/components/tooltip-content/TooltipContent.js.map +1 -0
- package/packages/popovers/src/components/tooltip-content/styles.js +128 -0
- package/packages/popovers/src/components/tooltip-content/styles.js.map +1 -0
- package/packages/popovers/src/components/tooltip-trigger/TooltipTrigger.js +47 -0
- package/packages/popovers/src/components/tooltip-trigger/TooltipTrigger.js.map +1 -0
- package/react-aria/internationalized/date/DateFormatter.d.ts +25 -0
- package/react-aria/internationalized/date/DateFormatter.js +187 -0
- package/react-aria/internationalized/date/DateFormatter.js.map +1 -0
- package/react-aria/internationalized/message/MessageDictionary.d.ts +7 -0
- package/react-aria/internationalized/message/MessageDictionary.js +82 -0
- package/react-aria/internationalized/message/MessageDictionary.js.map +1 -0
- package/react-aria/internationalized/message/MessageFormatter.js +38 -0
- package/react-aria/internationalized/message/MessageFormatter.js.map +1 -0
- package/react-aria/internationalized/number/NumberFormatter.d.ts +6 -0
- package/react-aria/internationalized/number/NumberFormatter.js +222 -0
- package/react-aria/internationalized/number/NumberFormatter.js.map +1 -0
- package/react-aria/internationalized/number/NumberParser.js +288 -0
- package/react-aria/internationalized/number/NumberParser.js.map +1 -0
- package/react-aria/internationalized/string/LocalizedStringDictionary.d.ts +21 -0
- package/react-aria/internationalized/string/LocalizedStringDictionary.js +118 -0
- package/react-aria/internationalized/string/LocalizedStringDictionary.js.map +1 -0
- package/react-aria/internationalized/string/LocalizedStringFormatter.d.ts +21 -0
- package/react-aria/internationalized/string/LocalizedStringFormatter.js +70 -0
- package/react-aria/internationalized/string/LocalizedStringFormatter.js.map +1 -0
- package/react-aria/react-aria/button/useButton.js +95 -0
- package/react-aria/react-aria/button/useButton.js.map +1 -0
- package/react-aria/react-aria/focus/focusSafely.js +33 -0
- package/react-aria/react-aria/focus/focusSafely.js.map +1 -0
- package/react-aria/react-aria/focus/useFocusRing.js +57 -0
- package/react-aria/react-aria/focus/useFocusRing.js.map +1 -0
- package/react-aria/react-aria/focus/useFocusable.js +47 -0
- package/react-aria/react-aria/focus/useFocusable.js.map +1 -0
- package/react-aria/react-aria/form/useFormValidation.js +112 -0
- package/react-aria/react-aria/form/useFormValidation.js.map +1 -0
- package/react-aria/react-aria/i18n/context.d.ts +19 -0
- package/react-aria/react-aria/i18n/context.js +41 -0
- package/react-aria/react-aria/i18n/context.js.map +1 -0
- package/react-aria/react-aria/i18n/useCollator.d.ts +8 -0
- package/react-aria/react-aria/i18n/useCollator.js +25 -0
- package/react-aria/react-aria/i18n/useCollator.js.map +1 -0
- package/react-aria/react-aria/i18n/useDateFormatter.d.ts +13 -0
- package/react-aria/react-aria/i18n/useDateFormatter.js +39 -0
- package/react-aria/react-aria/i18n/useDateFormatter.js.map +1 -0
- package/react-aria/react-aria/i18n/useDefaultLocale.d.ts +10 -0
- package/react-aria/react-aria/i18n/useDefaultLocale.js +67 -0
- package/react-aria/react-aria/i18n/useDefaultLocale.js.map +1 -0
- package/react-aria/react-aria/i18n/useFilter.d.ts +15 -0
- package/react-aria/react-aria/i18n/useFilter.js +58 -0
- package/react-aria/react-aria/i18n/useFilter.js.map +1 -0
- package/react-aria/react-aria/i18n/useListFormatter.d.ts +8 -0
- package/react-aria/react-aria/i18n/useListFormatter.js +20 -0
- package/react-aria/react-aria/i18n/useListFormatter.js.map +1 -0
- package/react-aria/react-aria/i18n/useLocalizedStringFormatter.d.ts +15 -0
- package/react-aria/react-aria/i18n/useLocalizedStringFormatter.js +38 -0
- package/react-aria/react-aria/i18n/useLocalizedStringFormatter.js.map +1 -0
- package/react-aria/react-aria/i18n/useMessageFormatter.d.ts +13 -0
- package/react-aria/react-aria/i18n/useMessageFormatter.js +32 -0
- package/react-aria/react-aria/i18n/useMessageFormatter.js.map +1 -0
- package/react-aria/react-aria/i18n/useNumberFormatter.d.ts +10 -0
- package/react-aria/react-aria/i18n/useNumberFormatter.js +21 -0
- package/react-aria/react-aria/i18n/useNumberFormatter.js.map +1 -0
- package/react-aria/react-aria/i18n/utils.js +49 -0
- package/react-aria/react-aria/i18n/utils.js.map +1 -0
- package/react-aria/react-aria/interactions/context.js +20 -0
- package/react-aria/react-aria/interactions/context.js.map +1 -0
- package/react-aria/react-aria/interactions/createEventHandler.js +48 -0
- package/react-aria/react-aria/interactions/createEventHandler.js.map +1 -0
- package/react-aria/react-aria/interactions/textSelection.js +85 -0
- package/react-aria/react-aria/interactions/textSelection.js.map +1 -0
- package/react-aria/react-aria/interactions/useFocus.js +53 -0
- package/react-aria/react-aria/interactions/useFocus.js.map +1 -0
- package/react-aria/react-aria/interactions/useFocusVisible.js +236 -0
- package/react-aria/react-aria/interactions/useFocusVisible.js.map +1 -0
- package/react-aria/react-aria/interactions/useFocusWithin.js +65 -0
- package/react-aria/react-aria/interactions/useFocusWithin.js.map +1 -0
- package/react-aria/react-aria/interactions/useKeyboard.js +27 -0
- package/react-aria/react-aria/interactions/useKeyboard.js.map +1 -0
- package/react-aria/react-aria/interactions/usePress.js +769 -0
- package/react-aria/react-aria/interactions/usePress.js.map +1 -0
- package/react-aria/react-aria/interactions/useScrollWheel.js +31 -0
- package/react-aria/react-aria/interactions/useScrollWheel.js.map +1 -0
- package/react-aria/react-aria/interactions/utils.js +116 -0
- package/react-aria/react-aria/interactions/utils.js.map +1 -0
- package/react-aria/react-aria/label/useField.js +42 -0
- package/react-aria/react-aria/label/useField.js.map +1 -0
- package/react-aria/react-aria/label/useLabel.js +42 -0
- package/react-aria/react-aria/label/useLabel.js.map +1 -0
- package/react-aria/react-aria/live-announcer/LiveAnnouncer.js +121 -0
- package/react-aria/react-aria/live-announcer/LiveAnnouncer.js.map +1 -0
- package/react-aria/react-aria/numberfield/intl/en-US.json.js +11 -0
- package/react-aria/react-aria/numberfield/intl/en-US.json.js.map +1 -0
- package/react-aria/react-aria/numberfield/intl/fr-FR.json.js +11 -0
- package/react-aria/react-aria/numberfield/intl/fr-FR.json.js.map +1 -0
- package/react-aria/react-aria/numberfield/intl/index.js +10 -0
- package/react-aria/react-aria/numberfield/intl/index.js.map +1 -0
- package/react-aria/react-aria/numberfield/useNumberField.js +294 -0
- package/react-aria/react-aria/numberfield/useNumberField.js.map +1 -0
- package/react-aria/react-aria/spinbutton/intl/en-US.json.js +7 -0
- package/react-aria/react-aria/spinbutton/intl/en-US.json.js.map +1 -0
- package/react-aria/react-aria/spinbutton/intl/fr-FR.json.js +7 -0
- package/react-aria/react-aria/spinbutton/intl/fr-FR.json.js.map +1 -0
- package/react-aria/react-aria/spinbutton/intl/index.js +10 -0
- package/react-aria/react-aria/spinbutton/intl/index.js.map +1 -0
- package/react-aria/react-aria/spinbutton/useSpinButton.js +168 -0
- package/react-aria/react-aria/spinbutton/useSpinButton.js.map +1 -0
- package/react-aria/react-aria/ssr/SSRProvider.d.ts +22 -0
- package/react-aria/react-aria/ssr/SSRProvider.js +157 -0
- package/react-aria/react-aria/ssr/SSRProvider.js.map +1 -0
- package/react-aria/react-aria/textfield/useFormattedTextField.js +142 -0
- package/react-aria/react-aria/textfield/useFormattedTextField.js.map +1 -0
- package/react-aria/react-aria/textfield/useTextField.js +156 -0
- package/react-aria/react-aria/textfield/useTextField.js.map +1 -0
- package/react-aria/react-aria/utils/chain.js +33 -0
- package/react-aria/react-aria/utils/chain.js.map +1 -0
- package/react-aria/react-aria/utils/domHelpers.js +14 -0
- package/react-aria/react-aria/utils/domHelpers.js.map +1 -0
- package/react-aria/react-aria/utils/filterDOMProps.js +45 -0
- package/react-aria/react-aria/utils/filterDOMProps.js.map +1 -0
- package/react-aria/react-aria/utils/focusWithoutScrolling.js +88 -0
- package/react-aria/react-aria/utils/focusWithoutScrolling.js.map +1 -0
- package/react-aria/react-aria/utils/isVirtualEvent.js +51 -0
- package/react-aria/react-aria/utils/isVirtualEvent.js.map +1 -0
- package/react-aria/react-aria/utils/mergeProps.js +48 -0
- package/react-aria/react-aria/utils/mergeProps.js.map +1 -0
- package/react-aria/react-aria/utils/openLink.js +55 -0
- package/react-aria/react-aria/utils/openLink.js.map +1 -0
- package/react-aria/react-aria/utils/platform.js +69 -0
- package/react-aria/react-aria/utils/platform.js.map +1 -0
- package/react-aria/react-aria/utils/runAfterTransition.js +100 -0
- package/react-aria/react-aria/utils/runAfterTransition.js.map +1 -0
- package/react-aria/react-aria/utils/useDeepMemo.js +16 -0
- package/react-aria/react-aria/utils/useDeepMemo.js.map +1 -0
- package/react-aria/react-aria/utils/useEffectEvent.js +31 -0
- package/react-aria/react-aria/utils/useEffectEvent.js.map +1 -0
- package/react-aria/react-aria/utils/useEvent.js +21 -0
- package/react-aria/react-aria/utils/useEvent.js.map +1 -0
- package/react-aria/react-aria/utils/useFormReset.js +23 -0
- package/react-aria/react-aria/utils/useFormReset.js.map +1 -0
- package/react-aria/react-aria/utils/useGlobalListeners.js +44 -0
- package/react-aria/react-aria/utils/useGlobalListeners.js.map +1 -0
- package/react-aria/react-aria/utils/useId.js +86 -0
- package/react-aria/react-aria/utils/useId.js.map +1 -0
- package/react-aria/react-aria/utils/useLabels.js +39 -0
- package/react-aria/react-aria/utils/useLabels.js.map +1 -0
- package/react-aria/react-aria/utils/useLayoutEffect.js +21 -0
- package/react-aria/react-aria/utils/useLayoutEffect.js.map +1 -0
- package/react-aria/react-aria/utils/useSyncRef.js +29 -0
- package/react-aria/react-aria/utils/useSyncRef.js.map +1 -0
- package/react-aria/react-aria/utils/useValueEffect.js +52 -0
- package/react-aria/react-aria/utils/useValueEffect.js.map +1 -0
- package/react-aria/react-stately/form/useFormValidationState.js +191 -0
- package/react-aria/react-stately/form/useFormValidationState.js.map +1 -0
- package/react-aria/react-stately/numberfield/useNumberFieldState.js +196 -0
- package/react-aria/react-stately/numberfield/useNumberFieldState.js.map +1 -0
- package/react-aria/react-stately/utils/number.js +56 -0
- package/react-aria/react-stately/utils/number.js.map +1 -0
- package/react-aria/react-stately/utils/useControlledState.js +68 -0
- package/react-aria/react-stately/utils/useControlledState.js.map +1 -0
- package/react-aria/react-types/shared/locale.d.ts +3 -0
- package/types/colors.d.ts +102 -0
- package/types/colors.js +64 -0
- package/types/colors.js.map +1 -0
- package/types/fonts.d.ts +12 -0
- package/types/fonts.js +10 -0
- package/types/fonts.js.map +1 -0
- package/types/helpers.d.ts +23 -0
- package/types/products.d.ts +40 -0
- package/types/products.js +38 -0
- package/types/products.js.map +1 -0
- package/types/styles.d.ts +283 -0
- package/types/styles.js +161 -0
- package/types/styles.js.map +1 -0
- package/utils/filterComponents.d.ts +12 -0
- package/utils/filterComponents.js +24 -0
- package/utils/filterComponents.js.map +1 -0
- package/utils/getTextWidth.d.ts +6 -0
- package/utils/getTextWidth.js +32 -0
- package/utils/getTextWidth.js.map +1 -0
- package/utils/isComponent.d.ts +12 -0
- package/utils/isComponent.js +15 -0
- package/utils/isComponent.js.map +1 -0
- package/utils/partitionComponents.d.ts +10 -0
- package/utils/partitionComponents.js +26 -0
- package/utils/partitionComponents.js.map +1 -0
- package/utils/redsift-design-tokens.d.ts +1389 -0
- package/utils/redsift-design-tokens.js +1391 -0
- package/utils/redsift-design-tokens.js.map +1 -0
- package/utils/useId.d.ts +6 -0
- package/utils/useId.js +42 -0
- package/utils/useId.js.map +1 -0
- package/utils/warnIfNoAccessibleLabelFound.d.ts +11 -0
- package/utils/warnIfNoAccessibleLabelFound.js +20 -0
- package/utils/warnIfNoAccessibleLabelFound.js.map +1 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { ValueOf } from '../../types/helpers.js';
|
|
3
|
+
import { StylingProps } from '../../types/styles.js';
|
|
4
|
+
import { Theme } from '../../types/colors.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Context props.
|
|
8
|
+
*/
|
|
9
|
+
type SwitchGroupState = {
|
|
10
|
+
/** Adds a value to the set of selected values. */
|
|
11
|
+
addValue(value: string): void;
|
|
12
|
+
/** Whether the switch group is disabled or not. */
|
|
13
|
+
readonly isDisabled: boolean;
|
|
14
|
+
/** Whether the switch group is read only or not. */
|
|
15
|
+
readonly isReadOnly: boolean;
|
|
16
|
+
/** Removes a value from the set of selected values. */
|
|
17
|
+
removeValue(value: string): void;
|
|
18
|
+
/** Sets the selected values. */
|
|
19
|
+
setValue(value: string[]): void;
|
|
20
|
+
/** Current selected values. */
|
|
21
|
+
readonly value: readonly string[];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Component orientation.
|
|
25
|
+
*/
|
|
26
|
+
declare const SwitchGroupOrientation: {
|
|
27
|
+
readonly horizontal: "horizontal";
|
|
28
|
+
readonly vertical: "vertical";
|
|
29
|
+
};
|
|
30
|
+
type SwitchGroupOrientation = ValueOf<typeof SwitchGroupOrientation>;
|
|
31
|
+
/**
|
|
32
|
+
* Component props.
|
|
33
|
+
*/
|
|
34
|
+
interface SwitchGroupProps extends Omit<ComponentProps<'div'>, 'onChange'>, StylingProps {
|
|
35
|
+
/**
|
|
36
|
+
* Default selected values.
|
|
37
|
+
* Used for uncontrolled version.
|
|
38
|
+
*/
|
|
39
|
+
defaultValues?: string[];
|
|
40
|
+
/** Description of the switch group. */
|
|
41
|
+
description?: string;
|
|
42
|
+
/** Whether the component is disabled or not. */
|
|
43
|
+
isDisabled?: boolean;
|
|
44
|
+
/** Whether the component is invalid or not. */
|
|
45
|
+
isInvalid?: boolean;
|
|
46
|
+
/** Whether the component is read only or not. */
|
|
47
|
+
isReadOnly?: boolean;
|
|
48
|
+
/** Whether the component is required or not. */
|
|
49
|
+
isRequired?: boolean;
|
|
50
|
+
/** Label of the switch group. */
|
|
51
|
+
label?: string;
|
|
52
|
+
/** Method to handle component change. */
|
|
53
|
+
onChange?(values: string[]): void;
|
|
54
|
+
/** Method to handle component change. */
|
|
55
|
+
orientation?: SwitchGroupOrientation;
|
|
56
|
+
/** Theme. */
|
|
57
|
+
theme?: Theme;
|
|
58
|
+
/**
|
|
59
|
+
* Currently selected values.
|
|
60
|
+
* Used for controlled version.
|
|
61
|
+
*/
|
|
62
|
+
value?: string[];
|
|
63
|
+
}
|
|
64
|
+
type StyledSwitchGroupProps = Omit<SwitchGroupProps, 'isDisabled' | 'isInvalid' | 'isReadOnly' | 'orientation' | 'isRequired'> & {
|
|
65
|
+
$isDisabled: SwitchGroupProps['isDisabled'];
|
|
66
|
+
$isInvalid: SwitchGroupProps['isInvalid'];
|
|
67
|
+
$isReadOnly: SwitchGroupProps['isReadOnly'];
|
|
68
|
+
$orientation: SwitchGroupProps['orientation'];
|
|
69
|
+
$theme: SwitchGroupProps['theme'];
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export { StyledSwitchGroupProps, SwitchGroupOrientation, SwitchGroupProps, SwitchGroupState };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context props.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Component orientation.
|
|
7
|
+
*/
|
|
8
|
+
const SwitchGroupOrientation = {
|
|
9
|
+
horizontal: 'horizontal',
|
|
10
|
+
vertical: 'vertical'
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Component props.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export { SwitchGroupOrientation };
|
|
18
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/components/switch-group/types.ts"],"sourcesContent":["import { ComponentProps } from 'react';\nimport { ValueOf, StylingProps, Theme } from '../../types';\n\n/**\n * Context props.\n */\nexport type SwitchGroupState = {\n /** Adds a value to the set of selected values. */\n addValue(value: string): void;\n /** Whether the switch group is disabled or not. */\n readonly isDisabled: boolean;\n /** Whether the switch group is read only or not. */\n readonly isReadOnly: boolean;\n /** Removes a value from the set of selected values. */\n removeValue(value: string): void;\n /** Sets the selected values. */\n setValue(value: string[]): void;\n /** Current selected values. */\n readonly value: readonly string[];\n};\n\n/**\n * Component orientation.\n */\nexport const SwitchGroupOrientation = {\n horizontal: 'horizontal',\n vertical: 'vertical',\n} as const;\nexport type SwitchGroupOrientation = ValueOf<typeof SwitchGroupOrientation>;\n\n/**\n * Component props.\n */\nexport interface SwitchGroupProps extends Omit<ComponentProps<'div'>, 'onChange'>, StylingProps {\n /**\n * Default selected values.\n * Used for uncontrolled version.\n */\n defaultValues?: string[];\n /** Description of the switch group. */\n description?: string;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Whether the component is invalid or not. */\n isInvalid?: boolean;\n /** Whether the component is read only or not. */\n isReadOnly?: boolean;\n /** Whether the component is required or not. */\n isRequired?: boolean;\n /** Label of the switch group. */\n label?: string;\n /** Method to handle component change. */\n onChange?(values: string[]): void;\n /** Method to handle component change. */\n orientation?: SwitchGroupOrientation;\n /** Theme. */\n theme?: Theme;\n /**\n * Currently selected values.\n * Used for controlled version.\n */\n value?: string[];\n}\n\nexport type StyledSwitchGroupProps = Omit<\n SwitchGroupProps,\n 'isDisabled' | 'isInvalid' | 'isReadOnly' | 'orientation' | 'isRequired'\n> & {\n $isDisabled: SwitchGroupProps['isDisabled'];\n $isInvalid: SwitchGroupProps['isInvalid'];\n $isReadOnly: SwitchGroupProps['isReadOnly'];\n $orientation: SwitchGroupProps['orientation'];\n $theme: SwitchGroupProps['theme'];\n};\n"],"names":["SwitchGroupOrientation","horizontal","vertical"],"mappings":"AAGA;AACA;AACA;;AAgBA;AACA;AACA;AACO,MAAMA,sBAAsB,GAAG;AACpCC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,QAAQ,EAAE,UAAA;AACZ,EAAU;;AAGV;AACA;AACA;;;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { StyledText } from './styles.js';
|
|
5
|
+
import { FontFamily } from '../../types/fonts.js';
|
|
6
|
+
import { useTheme } from '../theme/useTheme.js';
|
|
7
|
+
|
|
8
|
+
const _excluded = ["as", "children", "className", "color", "fontFamily", "fontSize", "fontWeight", "lineHeight", "noWrap", "theme", "variant"];
|
|
9
|
+
const COMPONENT_NAME = 'Text';
|
|
10
|
+
const CLASSNAME = 'redsift-text';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The Text component.
|
|
14
|
+
*/
|
|
15
|
+
const Text = /*#__PURE__*/forwardRef((props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
as,
|
|
18
|
+
children,
|
|
19
|
+
className,
|
|
20
|
+
color,
|
|
21
|
+
fontFamily = FontFamily.poppins,
|
|
22
|
+
fontSize,
|
|
23
|
+
fontWeight,
|
|
24
|
+
lineHeight,
|
|
25
|
+
noWrap,
|
|
26
|
+
theme: propsTheme,
|
|
27
|
+
variant
|
|
28
|
+
} = props,
|
|
29
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
30
|
+
const theme = useTheme(propsTheme);
|
|
31
|
+
return /*#__PURE__*/React__default.createElement(StyledText, _extends({
|
|
32
|
+
as: as
|
|
33
|
+
}, forwardedProps, {
|
|
34
|
+
className: classNames(Text.className, className),
|
|
35
|
+
ref: ref,
|
|
36
|
+
$as: as,
|
|
37
|
+
$color: color,
|
|
38
|
+
$fontFamily: fontFamily,
|
|
39
|
+
$fontSize: fontSize,
|
|
40
|
+
$fontWeight: fontWeight,
|
|
41
|
+
$lineHeight: lineHeight,
|
|
42
|
+
$noWrap: noWrap,
|
|
43
|
+
$theme: theme,
|
|
44
|
+
$variant: variant
|
|
45
|
+
}), children);
|
|
46
|
+
});
|
|
47
|
+
Text.className = CLASSNAME;
|
|
48
|
+
Text.displayName = COMPONENT_NAME;
|
|
49
|
+
|
|
50
|
+
export { Text };
|
|
51
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.js","sources":["../../../src/components/text/Text.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\nimport { Comp, FontFamily } from '../../types';\nimport { StyledText } from './styles';\nimport { TextProps } from './types';\nimport { useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'Text';\nconst CLASSNAME = 'redsift-text';\n\n/**\n * The Text component.\n */\nexport const Text: Comp<TextProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n as,\n children,\n className,\n color,\n fontFamily = FontFamily.poppins,\n fontSize,\n fontWeight,\n lineHeight,\n noWrap,\n theme: propsTheme,\n variant,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n\n return (\n <StyledText\n as={as}\n {...forwardedProps}\n className={classNames(Text.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n $as={as}\n $color={color}\n $fontFamily={fontFamily}\n $fontSize={fontSize}\n $fontWeight={fontWeight}\n $lineHeight={lineHeight}\n $noWrap={noWrap}\n $theme={theme}\n $variant={variant}\n >\n {children}\n </StyledText>\n );\n});\nText.className = CLASSNAME;\nText.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","Text","forwardRef","props","ref","as","children","className","color","fontFamily","FontFamily","poppins","fontSize","fontWeight","lineHeight","noWrap","theme","propsTheme","variant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","React","createElement","StyledText","_extends","classNames","$as","$color","$fontFamily","$fontSize","$fontWeight","$lineHeight","$noWrap","$theme","$variant","displayName"],"mappings":";;;;;;;;AAOA,MAAMA,cAAc,GAAG,MAAM,CAAA;AAC7B,MAAMC,SAAS,GAAG,cAAc,CAAA;;AAEhC;AACA;AACA;AACO,MAAMC,IAAqC,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC9E,MAAM;MACJC,EAAE;MACFC,QAAQ;MACRC,SAAS;MACTC,KAAK;MACLC,UAAU,GAAGC,UAAU,CAACC,OAAO;MAC/BC,QAAQ;MACRC,UAAU;MACVC,UAAU;MACVC,MAAM;AACNC,MAAAA,KAAK,EAAEC,UAAU;AACjBC,MAAAA,OAAAA;AAEF,KAAC,GAAGf,KAAK;AADJgB,IAAAA,cAAc,GAAAC,wBAAA,CACfjB,KAAK,EAAAkB,SAAA,CAAA,CAAA;AAET,EAAA,MAAML,KAAK,GAAGM,QAAQ,CAACL,UAAU,CAAC,CAAA;AAElC,EAAA,oBACEM,cAAA,CAAAC,aAAA,CAACC,UAAU,EAAAC,QAAA,CAAA;AACTrB,IAAAA,EAAE,EAAEA,EAAAA;AAAG,GAAA,EACHc,cAAc,EAAA;IAClBZ,SAAS,EAAEoB,UAAU,CAAC1B,IAAI,CAACM,SAAS,EAAEA,SAAS,CAAE;AACjDH,IAAAA,GAAG,EAAEA,GAAiC;AACtCwB,IAAAA,GAAG,EAAEvB,EAAG;AACRwB,IAAAA,MAAM,EAAErB,KAAM;AACdsB,IAAAA,WAAW,EAAErB,UAAW;AACxBsB,IAAAA,SAAS,EAAEnB,QAAS;AACpBoB,IAAAA,WAAW,EAAEnB,UAAW;AACxBoB,IAAAA,WAAW,EAAEnB,UAAW;AACxBoB,IAAAA,OAAO,EAAEnB,MAAO;AAChBoB,IAAAA,MAAM,EAAEnB,KAAM;AACdoB,IAAAA,QAAQ,EAAElB,OAAAA;AAAQ,GAAA,CAAA,EAEjBZ,QACS,CAAC,CAAA;AAEjB,CAAC,EAAC;AACFL,IAAI,CAACM,SAAS,GAAGP,SAAS,CAAA;AAC1BC,IAAI,CAACoC,WAAW,GAAGtC,cAAc;;;;"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { TextComponent, TextVariant } from './types.js';
|
|
3
|
+
import { NotificationsColorPalette, NeutralColorPalette, ProductColorPalette } from '../../types/colors.js';
|
|
4
|
+
import { baseStyling } from '../shared/styles.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Component style.
|
|
8
|
+
*/
|
|
9
|
+
const StyledText = styled.span`
|
|
10
|
+
${baseStyling}
|
|
11
|
+
|
|
12
|
+
${_ref => {
|
|
13
|
+
let {
|
|
14
|
+
$color
|
|
15
|
+
} = _ref;
|
|
16
|
+
return $color && $color === 'radar' ? css`
|
|
17
|
+
background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);
|
|
18
|
+
background-clip: text;
|
|
19
|
+
color: transparent;
|
|
20
|
+
` : Object.keys(NotificationsColorPalette).indexOf($color) !== -1 ? css`
|
|
21
|
+
color: var(--redsift-color-notifications-${$color}-primary);
|
|
22
|
+
` : Object.keys(NeutralColorPalette).indexOf($color) !== -1 ? css`
|
|
23
|
+
color: var(--redsift-color-neutral-${$color});
|
|
24
|
+
` : Object.keys(ProductColorPalette).indexOf($color) !== -1 ? css`
|
|
25
|
+
color: var(--redsift-color-product-${$color});
|
|
26
|
+
` : css`
|
|
27
|
+
color: ${$color || css`inherit`};
|
|
28
|
+
`;
|
|
29
|
+
}}
|
|
30
|
+
|
|
31
|
+
${_ref2 => {
|
|
32
|
+
let {
|
|
33
|
+
$as
|
|
34
|
+
} = _ref2;
|
|
35
|
+
return css`
|
|
36
|
+
${$as === TextComponent.i || $as === TextComponent.cite || $as === TextComponent.em ? css`
|
|
37
|
+
font-style: italic;
|
|
38
|
+
` : $as === TextComponent.sub ? css`
|
|
39
|
+
vertical-align: sub;
|
|
40
|
+
` : $as === TextComponent.sup ? css`
|
|
41
|
+
vertical-align: super;
|
|
42
|
+
` : $as === TextComponent.mark ? css`
|
|
43
|
+
color: var(--redsift-color-neutral-x-dark-grey);
|
|
44
|
+
` : ''}
|
|
45
|
+
`;
|
|
46
|
+
}}
|
|
47
|
+
|
|
48
|
+
${_ref3 => {
|
|
49
|
+
let {
|
|
50
|
+
$as,
|
|
51
|
+
$fontFamily,
|
|
52
|
+
$fontSize,
|
|
53
|
+
$fontWeight,
|
|
54
|
+
$lineHeight,
|
|
55
|
+
$variant
|
|
56
|
+
} = _ref3;
|
|
57
|
+
return !$variant ? css`
|
|
58
|
+
${$fontFamily ? css`
|
|
59
|
+
font-family: var(--redsift-typography-font-family-${$fontFamily});
|
|
60
|
+
` : ''}
|
|
61
|
+
${$fontSize ? css`
|
|
62
|
+
font-size: ${$fontSize};
|
|
63
|
+
` : ''}
|
|
64
|
+
${$fontWeight ? css`
|
|
65
|
+
font-weight: ${$fontWeight};
|
|
66
|
+
` : ''}
|
|
67
|
+
${$lineHeight ? css`
|
|
68
|
+
line-height: ${$lineHeight};
|
|
69
|
+
` : ''}
|
|
70
|
+
${$as === TextComponent.b ? css`
|
|
71
|
+
font-weight: ${$fontWeight ? $fontWeight : 'var(--redsift-typography-font-weight-bold)'};
|
|
72
|
+
` : $as === TextComponent.sup || $as === TextComponent.sub ? css`
|
|
73
|
+
font-size: ${$fontSize ? $fontSize : '12px'};
|
|
74
|
+
` : ''}
|
|
75
|
+
` : $variant === TextVariant.inherit ? css`
|
|
76
|
+
font-family: ${$fontFamily ? css`var(--redsift-typography-font-family-${$fontFamily})` : css`inherit`};
|
|
77
|
+
font-size: ${$fontSize ? $fontSize : $as === TextComponent.sup || $as === TextComponent.sub ? '12px' : css`inherit`};
|
|
78
|
+
font-weight: ${$fontWeight ? $fontWeight : $as === TextComponent.b ? 'var(--redsift-typography-font-weight-bold)' : 'inherit'};
|
|
79
|
+
line-height: ${$lineHeight ? $lineHeight : css`inherit`};
|
|
80
|
+
text-transform: inherit;
|
|
81
|
+
` : css`
|
|
82
|
+
font-family: ${$fontFamily ? css`var(--redsift-typography-font-family-${$fontFamily})` : css`var(--redsift-typography-${$variant}-font-family)`};
|
|
83
|
+
font-size: ${$fontSize ? $fontSize : css`var(--redsift-typography-${$variant}-font-size)`};
|
|
84
|
+
font-weight: ${$fontWeight ? $fontWeight : css`var(--redsift-typography-${$variant}-font-weight)`};
|
|
85
|
+
line-height: ${$lineHeight ? $lineHeight : css`var(--redsift-typography-${$variant}-line-height)`};
|
|
86
|
+
text-transform: var(--redsift-typography-${$variant}-text-transform);
|
|
87
|
+
`;
|
|
88
|
+
}}
|
|
89
|
+
|
|
90
|
+
${_ref4 => {
|
|
91
|
+
let {
|
|
92
|
+
$noWrap
|
|
93
|
+
} = _ref4;
|
|
94
|
+
return $noWrap ? css`
|
|
95
|
+
overflow: hidden;
|
|
96
|
+
text-overflow: ellipsis;
|
|
97
|
+
white-space: nowrap;
|
|
98
|
+
` : '';
|
|
99
|
+
}}
|
|
100
|
+
|
|
101
|
+
${_ref5 => {
|
|
102
|
+
let {
|
|
103
|
+
wordBreak
|
|
104
|
+
} = _ref5;
|
|
105
|
+
return wordBreak ? css`
|
|
106
|
+
word-break: ${wordBreak};
|
|
107
|
+
` : '';
|
|
108
|
+
}}
|
|
109
|
+
`;
|
|
110
|
+
|
|
111
|
+
export { StyledText };
|
|
112
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../src/components/text/styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { NotificationsColorPalette, NeutralColorPalette, ProductColorPalette } from '../../types';\nimport { baseStyling } from '../shared';\nimport { StyledTextProps, TextComponent, TextVariant } from './types';\n\n/**\n * Component style.\n */\nexport const StyledText = styled.span<StyledTextProps>`\n ${baseStyling}\n\n ${({ $color }) =>\n $color && $color === 'radar'\n ? css`\n background: linear-gradient(90deg, #51b78e 0%, #0081c3 100%);\n background-clip: text;\n color: transparent;\n `\n : Object.keys(NotificationsColorPalette).indexOf($color!) !== -1\n ? css`\n color: var(--redsift-color-notifications-${$color}-primary);\n `\n : Object.keys(NeutralColorPalette).indexOf($color!) !== -1\n ? css`\n color: var(--redsift-color-neutral-${$color});\n `\n : Object.keys(ProductColorPalette).indexOf($color!) !== -1\n ? css`\n color: var(--redsift-color-product-${$color});\n `\n : css`\n color: ${$color || css`inherit`};\n `}\n\n ${({ $as }) => css`\n ${$as === TextComponent.i || $as === TextComponent.cite || $as === TextComponent.em\n ? css`\n font-style: italic;\n `\n : $as === TextComponent.sub\n ? css`\n vertical-align: sub;\n `\n : $as === TextComponent.sup\n ? css`\n vertical-align: super;\n `\n : $as === TextComponent.mark\n ? css`\n color: var(--redsift-color-neutral-x-dark-grey);\n `\n : ''}\n `}\n\n ${({ $as, $fontFamily, $fontSize, $fontWeight, $lineHeight, $variant }) =>\n !$variant\n ? css`\n ${$fontFamily\n ? css`\n font-family: var(--redsift-typography-font-family-${$fontFamily});\n `\n : ''}\n ${$fontSize\n ? css`\n font-size: ${$fontSize};\n `\n : ''}\n ${$fontWeight\n ? css`\n font-weight: ${$fontWeight};\n `\n : ''}\n ${$lineHeight\n ? css`\n line-height: ${$lineHeight};\n `\n : ''}\n ${$as === TextComponent.b\n ? css`\n font-weight: ${$fontWeight ? $fontWeight : 'var(--redsift-typography-font-weight-bold)'};\n `\n : $as === TextComponent.sup || $as === TextComponent.sub\n ? css`\n font-size: ${$fontSize ? $fontSize : '12px'};\n `\n : ''}\n `\n : $variant === TextVariant.inherit\n ? css`\n font-family: ${$fontFamily ? css`var(--redsift-typography-font-family-${$fontFamily})` : css`inherit`};\n font-size: ${$fontSize\n ? $fontSize\n : $as === TextComponent.sup || $as === TextComponent.sub\n ? '12px'\n : css`inherit`};\n font-weight: ${$fontWeight\n ? $fontWeight\n : $as === TextComponent.b\n ? 'var(--redsift-typography-font-weight-bold)'\n : 'inherit'};\n line-height: ${$lineHeight ? $lineHeight : css`inherit`};\n text-transform: inherit;\n `\n : css`\n font-family: ${$fontFamily\n ? css`var(--redsift-typography-font-family-${$fontFamily})`\n : css`var(--redsift-typography-${$variant}-font-family)`};\n font-size: ${$fontSize ? $fontSize : css`var(--redsift-typography-${$variant}-font-size)`};\n font-weight: ${$fontWeight ? $fontWeight : css`var(--redsift-typography-${$variant}-font-weight)`};\n line-height: ${$lineHeight ? $lineHeight : css`var(--redsift-typography-${$variant}-line-height)`};\n text-transform: var(--redsift-typography-${$variant}-text-transform);\n `}\n \n ${({ $noWrap }) =>\n $noWrap\n ? css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `\n : ''}\n\n ${({ wordBreak }) =>\n wordBreak\n ? css`\n word-break: ${wordBreak};\n `\n : ''}\n`;\n"],"names":["StyledText","styled","span","baseStyling","_ref","$color","css","Object","keys","NotificationsColorPalette","indexOf","NeutralColorPalette","ProductColorPalette","_ref2","$as","TextComponent","i","cite","em","sub","sup","mark","_ref3","$fontFamily","$fontSize","$fontWeight","$lineHeight","$variant","b","TextVariant","inherit","_ref4","$noWrap","_ref5","wordBreak"],"mappings":";;;;;AAKA;AACA;AACA;AACaA,MAAAA,UAAU,GAAGC,MAAM,CAACC,IAAsB,CAAA;AACvD,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA,EAAA,EAAIC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAD,IAAA,CAAA;AAAA,EAAA,OACXC,MAAM,IAAIA,MAAM,KAAK,OAAO,GACxBC,GAAI,CAAA;AACZ;AACA;AACA;AACA,QAAA,CAAS,GACDC,MAAM,CAACC,IAAI,CAACC,yBAAyB,CAAC,CAACC,OAAO,CAACL,MAAO,CAAC,KAAK,CAAC,CAAC,GAC9DC,GAAI,CAAA;AACZ,mDAAA,EAAqDD,MAAO,CAAA;AAC5D,QAAA,CAAS,GACDE,MAAM,CAACC,IAAI,CAACG,mBAAmB,CAAC,CAACD,OAAO,CAACL,MAAO,CAAC,KAAK,CAAC,CAAC,GACxDC,GAAI,CAAA;AACZ,6CAAA,EAA+CD,MAAO,CAAA;AACtD,QAAA,CAAS,GACDE,MAAM,CAACC,IAAI,CAACI,mBAAmB,CAAC,CAACF,OAAO,CAACL,MAAO,CAAC,KAAK,CAAC,CAAC,GACxDC,GAAI,CAAA;AACZ,6CAAA,EAA+CD,MAAO,CAAA;AACtD,QAAA,C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AA2BqB,yBAAAA,EAAAA,QAAS,CAAe,aAAA,CAAA,CAAA;AACrE,qBAAA,EAAuBH,SAAS,GAAGA,SAAS,GAAGlB,GAAI,CAAA,yBAAA,EAA2BqB,QAAS,CAAa,WAAA,CAAA,CAAA;AACpG,uBAAA,EAAyBF,WAAW,GAAGA,WAAW,GAAGnB,GAAI,CAAA,yBAAA,EAA2BqB,QAAS,CAAe,aAAA,CAAA,CAAA;AAC5G,uBAAA,EAAyBD,WAAW,GAAGA,WAAW,GAAGpB,GAAI,CAAA,yBAAA,EAA2BqB,QAAS,CAAe,aAAA,CAAA,CAAA;AAC5G,mDAAA,EAAqDA,QAAS,CAAA;AAC9D,QAAS,CAAA,CAAA;AAAA,CAAC,CAAA;AACV;AACA,EAAA,EAAII,KAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,OAAAA;AAAQ,GAAC,GAAAD,KAAA,CAAA;EAAA,OACZC,OAAO,GACH1B,GAAI,CAAA;AACZ;AACA;AACA;AACA,QAAA,CAAS,GACD,EAAE,CAAA;AAAA,CAAC,CAAA;AACX;AACA,EAAA,EAAI2B,KAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,SAAAA;AAAU,GAAC,GAAAD,KAAA,CAAA;EAAA,OACdC,SAAS,GACL5B,GAAI,CAAA;AACZ,sBAAA,EAAwB4B,SAAU,CAAA;AAClC,QAAA,CAAS,GACD,EAAE,CAAA;AAAA,CAAC,CAAA;AACX;;;;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { ValueOf } from '../../types/helpers.js';
|
|
3
|
+
import { StylingProps } from '../../types/styles.js';
|
|
4
|
+
import { NotificationsColorPalette, NeutralColorPalette, Theme } from '../../types/colors.js';
|
|
5
|
+
import { FontFamily } from '../../types/fonts.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Component variant.
|
|
9
|
+
*/
|
|
10
|
+
declare const TextVariant: {
|
|
11
|
+
readonly body: "body";
|
|
12
|
+
readonly button: "button";
|
|
13
|
+
readonly caption: "caption";
|
|
14
|
+
readonly helper: "helper";
|
|
15
|
+
readonly inherit: "inherit";
|
|
16
|
+
};
|
|
17
|
+
type TextVariant = ValueOf<typeof TextVariant>;
|
|
18
|
+
declare const TextComponent: {
|
|
19
|
+
readonly p: "p";
|
|
20
|
+
readonly b: "b";
|
|
21
|
+
readonly i: "i";
|
|
22
|
+
readonly u: "u";
|
|
23
|
+
readonly abbr: "abbr";
|
|
24
|
+
readonly cite: "cite";
|
|
25
|
+
readonly del: "del";
|
|
26
|
+
readonly em: "em";
|
|
27
|
+
readonly ins: "ins";
|
|
28
|
+
readonly kbd: "kbd";
|
|
29
|
+
readonly mark: "mark";
|
|
30
|
+
readonly s: "s";
|
|
31
|
+
readonly samp: "samp";
|
|
32
|
+
readonly sub: "sub";
|
|
33
|
+
readonly sup: "sup";
|
|
34
|
+
};
|
|
35
|
+
type TextComponent = ValueOf<typeof TextComponent>;
|
|
36
|
+
/**
|
|
37
|
+
* Component props.
|
|
38
|
+
*/
|
|
39
|
+
interface TextProps extends ComponentProps<'span'>, StylingProps {
|
|
40
|
+
/** Override component. */
|
|
41
|
+
as?: TextComponent;
|
|
42
|
+
/** Color variant. Either from color palette or hex or rgb strings. */
|
|
43
|
+
color?: NotificationsColorPalette | NeutralColorPalette | 'radar' | (string & {});
|
|
44
|
+
/** Font family. */
|
|
45
|
+
fontFamily?: FontFamily;
|
|
46
|
+
/** Font size. */
|
|
47
|
+
fontSize?: string;
|
|
48
|
+
/** Font weight. */
|
|
49
|
+
fontWeight?: string;
|
|
50
|
+
/** Line height. */
|
|
51
|
+
lineHeight?: string;
|
|
52
|
+
/** Whether the text will truncate with a text overflow ellipsis or wrap. */
|
|
53
|
+
noWrap?: boolean;
|
|
54
|
+
/** Theme. */
|
|
55
|
+
theme?: Theme;
|
|
56
|
+
/** Variant. */
|
|
57
|
+
variant?: TextVariant;
|
|
58
|
+
/** Word break CSS properties */
|
|
59
|
+
wordBreak?: string;
|
|
60
|
+
}
|
|
61
|
+
type StyledTextProps = Omit<TextProps, 'as' | 'color' | 'fontFamily' | 'fontSize' | 'lineHeight' | 'noWrap' | 'variant'> & {
|
|
62
|
+
$as: TextProps['as'];
|
|
63
|
+
$color: TextProps['color'];
|
|
64
|
+
$fontFamily?: TextProps['fontFamily'];
|
|
65
|
+
$fontSize: TextProps['fontSize'];
|
|
66
|
+
$fontWeight: TextProps['fontWeight'];
|
|
67
|
+
$lineHeight: TextProps['lineHeight'];
|
|
68
|
+
$noWrap: TextProps['noWrap'];
|
|
69
|
+
$variant: TextProps['variant'];
|
|
70
|
+
$theme: TextProps['theme'];
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { StyledTextProps, TextComponent, TextProps, TextVariant };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component variant.
|
|
3
|
+
*/
|
|
4
|
+
const TextVariant = {
|
|
5
|
+
body: 'body',
|
|
6
|
+
button: 'button',
|
|
7
|
+
caption: 'caption',
|
|
8
|
+
helper: 'helper',
|
|
9
|
+
inherit: 'inherit'
|
|
10
|
+
};
|
|
11
|
+
const TextComponent = {
|
|
12
|
+
p: 'p',
|
|
13
|
+
b: 'b',
|
|
14
|
+
i: 'i',
|
|
15
|
+
u: 'u',
|
|
16
|
+
abbr: 'abbr',
|
|
17
|
+
cite: 'cite',
|
|
18
|
+
del: 'del',
|
|
19
|
+
em: 'em',
|
|
20
|
+
ins: 'ins',
|
|
21
|
+
kbd: 'kbd',
|
|
22
|
+
mark: 'mark',
|
|
23
|
+
s: 's',
|
|
24
|
+
samp: 'samp',
|
|
25
|
+
sub: 'sub',
|
|
26
|
+
sup: 'sup'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Component props.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
export { TextComponent, TextVariant };
|
|
34
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/components/text/types.ts"],"sourcesContent":["import { ComponentProps } from 'react';\nimport { NotificationsColorPalette, FontFamily, NeutralColorPalette, StylingProps, ValueOf, Theme } from '../../types';\n\n/**\n * Component variant.\n */\nexport const TextVariant = {\n body: 'body',\n button: 'button',\n caption: 'caption',\n helper: 'helper',\n inherit: 'inherit',\n} as const;\nexport type TextVariant = ValueOf<typeof TextVariant>;\n\nexport const TextComponent = {\n p: 'p',\n b: 'b',\n i: 'i',\n u: 'u',\n abbr: 'abbr',\n cite: 'cite',\n del: 'del',\n em: 'em',\n ins: 'ins',\n kbd: 'kbd',\n mark: 'mark',\n s: 's',\n samp: 'samp',\n sub: 'sub',\n sup: 'sup',\n} as const;\nexport type TextComponent = ValueOf<typeof TextComponent>;\n\n/**\n * Component props.\n */\nexport interface TextProps extends ComponentProps<'span'>, StylingProps {\n /** Override component. */\n as?: TextComponent;\n /** Color variant. Either from color palette or hex or rgb strings. */\n color?: NotificationsColorPalette | NeutralColorPalette | 'radar' | (string & {});\n /** Font family. */\n fontFamily?: FontFamily;\n /** Font size. */\n fontSize?: string;\n /** Font weight. */\n fontWeight?: string;\n /** Line height. */\n lineHeight?: string;\n /** Whether the text will truncate with a text overflow ellipsis or wrap. */\n noWrap?: boolean;\n /** Theme. */\n theme?: Theme;\n /** Variant. */\n variant?: TextVariant;\n /** Word break CSS properties */\n wordBreak?: string;\n}\n\nexport type StyledTextProps = Omit<\n TextProps,\n 'as' | 'color' | 'fontFamily' | 'fontSize' | 'lineHeight' | 'noWrap' | 'variant'\n> & {\n $as: TextProps['as'];\n $color: TextProps['color'];\n $fontFamily?: TextProps['fontFamily'];\n $fontSize: TextProps['fontSize'];\n $fontWeight: TextProps['fontWeight'];\n $lineHeight: TextProps['lineHeight'];\n $noWrap: TextProps['noWrap'];\n $variant: TextProps['variant'];\n $theme: TextProps['theme'];\n};\n"],"names":["TextVariant","body","button","caption","helper","inherit","TextComponent","p","b","i","u","abbr","cite","del","em","ins","kbd","mark","s","samp","sub","sup"],"mappings":"AAGA;AACA;AACA;AACO,MAAMA,WAAW,GAAG;AACzBC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,OAAO,EAAE,SAAA;AACX,EAAU;AAGH,MAAMC,aAAa,GAAG;AAC3BC,EAAAA,CAAC,EAAE,GAAG;AACNC,EAAAA,CAAC,EAAE,GAAG;AACNC,EAAAA,CAAC,EAAE,GAAG;AACNC,EAAAA,CAAC,EAAE,GAAG;AACNC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,EAAE,EAAE,IAAI;AACRC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,CAAC,EAAE,GAAG;AACNC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,GAAG,EAAE,KAAA;AACP,EAAU;;AAGV;AACA;AACA;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TextAreaProps } from './types.js';
|
|
2
|
+
import { Comp } from '../../types/helpers.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The TextArea component.
|
|
6
|
+
* Can be used as controlled or uncontrolled.
|
|
7
|
+
*/
|
|
8
|
+
declare const TextArea: Comp<TextAreaProps, HTMLDivElement>;
|
|
9
|
+
|
|
10
|
+
export { TextArea };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default, { forwardRef, useState, useCallback, useEffect } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound.js';
|
|
5
|
+
import { TextAreaVariant } from './types.js';
|
|
6
|
+
import { StyledTextArea } from './styles.js';
|
|
7
|
+
import { useFocusRing } from '../../react-aria/react-aria/focus/useFocusRing.js';
|
|
8
|
+
import { useFocusWithin } from '../../react-aria/react-aria/interactions/useFocusWithin.js';
|
|
9
|
+
import { useComputeNumberOfRows } from '../../hooks/useComputeNumberOfRows.js';
|
|
10
|
+
import { useTheme } from '../theme/useTheme.js';
|
|
11
|
+
import { ButtonsColorPalette } from '../../types/colors.js';
|
|
12
|
+
import { useId } from '../../utils/useId.js';
|
|
13
|
+
import { Icon } from '../icon/Icon.js';
|
|
14
|
+
import { Flexbox } from '../flexbox/Flexbox.js';
|
|
15
|
+
|
|
16
|
+
const _excluded = ["aria-label", "aria-labelledby", "after", "autoFocus", "className", "color", "defaultValue", "forceColor", "isColored", "isDisabled", "isInvalid", "isReadOnly", "isRequired", "label", "leftIcon", "minimumRows", "name", "onBlur", "onChange", "onFocus", "placeholder", "textareaProps", "textareaRef", "theme", "value", "variant", "width"];
|
|
17
|
+
const COMPONENT_NAME = 'TextArea';
|
|
18
|
+
const CLASSNAME = 'redsift-text-area';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The TextArea component.
|
|
22
|
+
* Can be used as controlled or uncontrolled.
|
|
23
|
+
*/
|
|
24
|
+
const TextArea = /*#__PURE__*/forwardRef((props, ref) => {
|
|
25
|
+
const {
|
|
26
|
+
'aria-label': ariaLabel,
|
|
27
|
+
'aria-labelledby': ariaLabelledby,
|
|
28
|
+
after,
|
|
29
|
+
autoFocus,
|
|
30
|
+
className,
|
|
31
|
+
color: propsColor,
|
|
32
|
+
defaultValue = '',
|
|
33
|
+
forceColor,
|
|
34
|
+
isColored = true,
|
|
35
|
+
isDisabled,
|
|
36
|
+
isInvalid,
|
|
37
|
+
isReadOnly,
|
|
38
|
+
isRequired,
|
|
39
|
+
label,
|
|
40
|
+
leftIcon,
|
|
41
|
+
minimumRows,
|
|
42
|
+
name,
|
|
43
|
+
onBlur: onBlurProps,
|
|
44
|
+
onChange,
|
|
45
|
+
onFocus: onFocusProps,
|
|
46
|
+
placeholder,
|
|
47
|
+
textareaProps,
|
|
48
|
+
textareaRef: propsTextareaRef,
|
|
49
|
+
theme: propsTheme,
|
|
50
|
+
value: propsValue,
|
|
51
|
+
variant = TextAreaVariant.default,
|
|
52
|
+
width = '100%'
|
|
53
|
+
} = props,
|
|
54
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
55
|
+
const theme = useTheme(propsTheme);
|
|
56
|
+
const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : isColored ? 'primary' : 'grey';
|
|
57
|
+
const isGradient = color === ButtonsColorPalette.radar;
|
|
58
|
+
const _textareaRef = React__default.useRef(null);
|
|
59
|
+
const textareaRef = propsTextareaRef !== null && propsTextareaRef !== void 0 ? propsTextareaRef : _textareaRef;
|
|
60
|
+
const {
|
|
61
|
+
isFocusVisible,
|
|
62
|
+
isFocused,
|
|
63
|
+
focusProps: {
|
|
64
|
+
onFocus,
|
|
65
|
+
onBlur
|
|
66
|
+
}
|
|
67
|
+
} = useFocusRing({
|
|
68
|
+
autoFocus
|
|
69
|
+
});
|
|
70
|
+
const [isFocusWithin, setFocusWithin] = useState(Boolean(autoFocus));
|
|
71
|
+
const {
|
|
72
|
+
focusWithinProps
|
|
73
|
+
} = useFocusWithin({
|
|
74
|
+
onFocusWithinChange: isFocusWithin => setFocusWithin(isFocusWithin)
|
|
75
|
+
});
|
|
76
|
+
const [value, setValue] = useState(defaultValue);
|
|
77
|
+
const isControlled = propsValue !== null && propsValue !== undefined;
|
|
78
|
+
const [labelId] = useId();
|
|
79
|
+
warnIfNoAccessibleLabelFound(props, [label], 'TextArea');
|
|
80
|
+
const handleChange = useCallback(event => {
|
|
81
|
+
if (isDisabled || isReadOnly) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (onChange) {
|
|
85
|
+
onChange(event.target.value, name, event);
|
|
86
|
+
} else {
|
|
87
|
+
setValue(event.target.value);
|
|
88
|
+
}
|
|
89
|
+
}, [onChange]);
|
|
90
|
+
const {
|
|
91
|
+
rows,
|
|
92
|
+
recomputeNumberOfRows
|
|
93
|
+
} = useComputeNumberOfRows(minimumRows || 4);
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
// Recompute the number of rows for the first rendering
|
|
96
|
+
if (textareaRef && textareaRef.current) {
|
|
97
|
+
recomputeNumberOfRows(textareaRef.current);
|
|
98
|
+
}
|
|
99
|
+
}, [textareaRef, recomputeNumberOfRows, value]);
|
|
100
|
+
return /*#__PURE__*/React__default.createElement(StyledTextArea, _extends({
|
|
101
|
+
width: width
|
|
102
|
+
}, focusWithinProps, forwardedProps, {
|
|
103
|
+
$hasContent: isFocusWithin || Boolean(isControlled ? propsValue : value) || Boolean(placeholder),
|
|
104
|
+
$hasLeftIcon: Boolean(leftIcon),
|
|
105
|
+
$color: color,
|
|
106
|
+
$isGradient: isGradient,
|
|
107
|
+
$isDisabled: isDisabled,
|
|
108
|
+
$isFocusVisible: isFocusVisible,
|
|
109
|
+
$isInvalid: isInvalid || isRequired && !(isControlled ? propsValue : value),
|
|
110
|
+
$isRequired: isRequired,
|
|
111
|
+
$isFocused: Boolean(isFocused || forceColor),
|
|
112
|
+
$theme: theme,
|
|
113
|
+
$variant: variant,
|
|
114
|
+
className: classNames(TextArea.className, className),
|
|
115
|
+
ref: ref
|
|
116
|
+
}), /*#__PURE__*/React__default.createElement("fieldset", {
|
|
117
|
+
"aria-hidden": "true",
|
|
118
|
+
className: `${TextArea.className}-text-area-wrapper__fieldset`
|
|
119
|
+
}, /*#__PURE__*/React__default.createElement("legend", {
|
|
120
|
+
id: labelId,
|
|
121
|
+
className: `${TextArea.className}-text-area-wrapper-fieldset__legend`
|
|
122
|
+
}, label ? /*#__PURE__*/React__default.createElement("span", null, label) : null)), label ? /*#__PURE__*/React__default.createElement("label", {
|
|
123
|
+
className: `${TextArea.className}__label`
|
|
124
|
+
}, /*#__PURE__*/React__default.createElement("span", null, label)) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
125
|
+
className: `${TextArea.className}__text-area-wrapper`
|
|
126
|
+
}, leftIcon ? /*#__PURE__*/React__default.createElement(Icon, _extends({
|
|
127
|
+
color: isDisabled ? 'question' : 'black'
|
|
128
|
+
}, leftIcon, {
|
|
129
|
+
"aria-hidden": "true",
|
|
130
|
+
className: "left"
|
|
131
|
+
})) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
132
|
+
className: `${TextArea.className}-text-area-wrapper__text-area`
|
|
133
|
+
}, /*#__PURE__*/React__default.createElement("textarea", _extends({}, textareaProps, {
|
|
134
|
+
onBlur: event => {
|
|
135
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
136
|
+
onBlurProps === null || onBlurProps === void 0 ? void 0 : onBlurProps(event);
|
|
137
|
+
},
|
|
138
|
+
onFocus: event => {
|
|
139
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
140
|
+
onFocusProps === null || onFocusProps === void 0 ? void 0 : onFocusProps(event);
|
|
141
|
+
},
|
|
142
|
+
"aria-disabled": isDisabled,
|
|
143
|
+
"aria-invalid": isInvalid || isRequired && !(isControlled ? propsValue : value),
|
|
144
|
+
"aria-label": ariaLabel,
|
|
145
|
+
"aria-labelledby": ariaLabelledby || (label ? labelId : undefined),
|
|
146
|
+
"aria-readonly": isReadOnly,
|
|
147
|
+
"aria-required": isRequired,
|
|
148
|
+
autoFocus: autoFocus,
|
|
149
|
+
disabled: isDisabled,
|
|
150
|
+
name: name,
|
|
151
|
+
onChange: handleChange,
|
|
152
|
+
placeholder: placeholder,
|
|
153
|
+
ref: textareaRef,
|
|
154
|
+
value: isControlled ? propsValue : value,
|
|
155
|
+
rows: rows
|
|
156
|
+
}))), after ? /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
157
|
+
className: `${TextArea.className}-text-area-wrapper__toolbar`,
|
|
158
|
+
gap: "8px"
|
|
159
|
+
}, typeof after === 'function' ? after(isControlled ? propsValue : value, isDisabled, isInvalid || isRequired && !(isControlled ? propsValue : value), isRequired) : after) : null));
|
|
160
|
+
});
|
|
161
|
+
TextArea.className = CLASSNAME;
|
|
162
|
+
TextArea.displayName = COMPONENT_NAME;
|
|
163
|
+
|
|
164
|
+
export { TextArea };
|
|
165
|
+
//# sourceMappingURL=TextArea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextArea.js","sources":["../../../src/components/text-area/TextArea.tsx"],"sourcesContent":["import React, {\n ComponentProps,\n FocusEvent,\n forwardRef,\n MutableRefObject,\n useCallback,\n useEffect,\n useState,\n} from 'react';\nimport classNames from 'classnames';\nimport { useFocusRing } from '../../react-aria/react-aria/focus';\nimport { useFocusWithin } from '../../react-aria/react-aria/interactions';\nimport { ButtonsColorPalette, Comp } from '../../types';\nimport { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound';\nimport { TextAreaProps, TextAreaVariant } from './types';\nimport { StyledTextArea } from './styles';\nimport { Icon } from '../../components/icon';\nimport { useTheme } from '../theme';\nimport { useComputeNumberOfRows } from '../../hooks';\nimport { useId } from '../../utils';\nimport { Flexbox } from '../flexbox';\n\nconst COMPONENT_NAME = 'TextArea';\nconst CLASSNAME = 'redsift-text-area';\n\n/**\n * The TextArea component.\n * Can be used as controlled or uncontrolled.\n */\nexport const TextArea: Comp<TextAreaProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n after,\n autoFocus,\n className,\n color: propsColor,\n defaultValue = '',\n forceColor,\n isColored = true,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n label,\n leftIcon,\n minimumRows,\n name,\n onBlur: onBlurProps,\n onChange,\n onFocus: onFocusProps,\n placeholder,\n textareaProps,\n textareaRef: propsTextareaRef,\n theme: propsTheme,\n value: propsValue,\n variant = TextAreaVariant.default,\n width = '100%',\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : isColored ? 'primary' : 'grey';\n const isGradient = color === ButtonsColorPalette.radar;\n\n const _textareaRef = React.useRef(null);\n const textareaRef = propsTextareaRef ?? _textareaRef;\n\n const {\n isFocusVisible,\n isFocused,\n focusProps: { onFocus, onBlur },\n } = useFocusRing({\n autoFocus,\n });\n const [isFocusWithin, setFocusWithin] = useState(Boolean(autoFocus));\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: (isFocusWithin) => setFocusWithin(isFocusWithin),\n });\n\n const [value, setValue] = useState(defaultValue);\n const isControlled = propsValue !== null && propsValue !== undefined;\n\n const [labelId] = useId();\n\n warnIfNoAccessibleLabelFound(props as ComponentProps<'label'>, [label], 'TextArea');\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (onChange) {\n onChange(event.target.value, name, event);\n } else {\n setValue(event.target.value);\n }\n },\n [onChange]\n );\n\n const { rows, recomputeNumberOfRows } = useComputeNumberOfRows(minimumRows || 4);\n useEffect(() => {\n // Recompute the number of rows for the first rendering\n if (textareaRef && textareaRef.current) {\n recomputeNumberOfRows(textareaRef.current);\n }\n }, [textareaRef, recomputeNumberOfRows, value]);\n\n return (\n <StyledTextArea\n width={width}\n {...focusWithinProps}\n {...forwardedProps}\n $hasContent={isFocusWithin || Boolean(isControlled ? propsValue : value) || Boolean(placeholder)}\n $hasLeftIcon={Boolean(leftIcon)}\n $color={color}\n $isGradient={isGradient}\n $isDisabled={isDisabled}\n $isFocusVisible={isFocusVisible}\n $isInvalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n $isRequired={isRequired}\n $isFocused={Boolean(isFocused || forceColor)}\n $theme={theme}\n $variant={variant}\n className={classNames(TextArea.className, className)}\n ref={ref as MutableRefObject<HTMLDivElement>}\n >\n <fieldset aria-hidden=\"true\" className={`${TextArea.className}-text-area-wrapper__fieldset`}>\n <legend id={labelId} className={`${TextArea.className}-text-area-wrapper-fieldset__legend`}>\n {label ? <span>{label}</span> : null}\n </legend>\n </fieldset>\n {label ? (\n <label className={`${TextArea.className}__label`}>\n <span>{label}</span>\n </label>\n ) : null}\n <div className={`${TextArea.className}__text-area-wrapper`}>\n {leftIcon ? (\n <Icon color={isDisabled ? 'question' : 'black'} {...leftIcon} aria-hidden=\"true\" className=\"left\" />\n ) : null}\n <div className={`${TextArea.className}-text-area-wrapper__text-area`}>\n <textarea\n {...textareaProps}\n onBlur={(event) => {\n onBlur?.(event);\n onBlurProps?.(event as unknown as FocusEvent<HTMLDivElement, Element>);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n onFocusProps?.(event as unknown as FocusEvent<HTMLDivElement, Element>);\n }}\n aria-disabled={isDisabled}\n aria-invalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby || (label ? labelId : undefined)}\n aria-readonly={isReadOnly}\n aria-required={isRequired}\n autoFocus={autoFocus}\n disabled={isDisabled}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n ref={textareaRef as MutableRefObject<HTMLTextAreaElement>}\n value={isControlled ? propsValue : value}\n rows={rows}\n />\n </div>\n {after ? (\n <Flexbox className={`${TextArea.className}-text-area-wrapper__toolbar`} gap=\"8px\">\n {typeof after === 'function'\n ? after(\n isControlled ? propsValue : value,\n isDisabled,\n isInvalid || (isRequired && !(isControlled ? propsValue : value)),\n isRequired\n )\n : after}\n </Flexbox>\n ) : null}\n </div>\n </StyledTextArea>\n );\n});\nTextArea.className = CLASSNAME;\nTextArea.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","TextArea","forwardRef","props","ref","ariaLabel","ariaLabelledby","after","autoFocus","className","color","propsColor","defaultValue","forceColor","isColored","isDisabled","isInvalid","isReadOnly","isRequired","label","leftIcon","minimumRows","name","onBlur","onBlurProps","onChange","onFocus","onFocusProps","placeholder","textareaProps","textareaRef","propsTextareaRef","theme","propsTheme","value","propsValue","variant","TextAreaVariant","default","width","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","isGradient","radar","_textareaRef","React","useRef","isFocusVisible","isFocused","focusProps","useFocusRing","isFocusWithin","setFocusWithin","useState","Boolean","focusWithinProps","useFocusWithin","onFocusWithinChange","setValue","isControlled","undefined","labelId","useId","warnIfNoAccessibleLabelFound","handleChange","useCallback","event","target","rows","recomputeNumberOfRows","useComputeNumberOfRows","useEffect","current","createElement","StyledTextArea","_extends","$hasContent","$hasLeftIcon","$color","$isGradient","$isDisabled","$isFocusVisible","$isInvalid","$isRequired","$isFocused","$theme","$variant","classNames","id","Icon","disabled","Flexbox","gap","displayName"],"mappings":";;;;;;;;;;;;;;;;AAsBA,MAAMA,cAAc,GAAG,UAAU,CAAA;AACjC,MAAMC,SAAS,GAAG,mBAAmB,CAAA;;AAErC;AACA;AACA;AACA;AACO,MAAMC,QAA6C,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACtF,MAAM;AACJ,MAAA,YAAY,EAAEC,SAAS;AACvB,MAAA,iBAAiB,EAAEC,cAAc;MACjCC,KAAK;MACLC,SAAS;MACTC,SAAS;AACTC,MAAAA,KAAK,EAAEC,UAAU;AACjBC,MAAAA,YAAY,GAAG,EAAE;MACjBC,UAAU;AACVC,MAAAA,SAAS,GAAG,IAAI;MAChBC,UAAU;MACVC,SAAS;MACTC,UAAU;MACVC,UAAU;MACVC,KAAK;MACLC,QAAQ;MACRC,WAAW;MACXC,IAAI;AACJC,MAAAA,MAAM,EAAEC,WAAW;MACnBC,QAAQ;AACRC,MAAAA,OAAO,EAAEC,YAAY;MACrBC,WAAW;MACXC,aAAa;AACbC,MAAAA,W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