@redsift/design-system 11.5.0 → 11.6.0-muiv5-alpha.1
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 +4 -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 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../src/components/icon-button/styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { StyledButton } from '../button';\nimport { IconButtonVariant, StyledIconButtonProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledIconButton = styled(StyledButton)<StyledIconButtonProps>`\n ${({ $variant }) => css`\n padding: ${$variant === IconButtonVariant.secondary ? '8px' : '9px'};\n `};\n\n ${({ $isLoading }) =>\n $isLoading\n ? css`\n & > .redsift-shield {\n position: relative;\n }\n `\n : ''}\n`;\n"],"names":["StyledIconButton","styled","StyledButton","_ref","$variant","css","IconButtonVariant","secondary","_ref2","$isLoading"],"mappings":";;;;AAIA;AACA;AACA;MACaA,gBAAgB,GAAGC,MAAM,CAACC,YAAY,CAAyB,CAAA;AAC5E,EAAA,EAAIC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,QAAAA;AAAS,GAAC,GAAAD,IAAA,CAAA;AAAA,EAAA,OAAKE,GAAI,CAAA;AAC1B,aAAeD,EAAAA,QAAQ,KAAKE,iBAAiB,CAACC,SAAS,GAAG,KAAK,GAAG,KAAM,CAAA;AACxE,EAAG,CAAA,CAAA;AAAA,CAAC,CAAA;AACJ;AACA,EAAA,EAAIC,KAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,UAAAA;AAAW,GAAC,GAAAD,KAAA,CAAA;EAAA,OACfC,UAAU,GACNJ,GAAI,CAAA;AACZ;AACA;AACA;AACA,QAAA,CAAS,GACD,EAAE,CAAA;AAAA,CAAC,CAAA;AACX;;;;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { ButtonsColorPalette, Theme } from '../../types/colors.js';
|
|
3
|
+
import { IconProps } from '../icon/types.js';
|
|
4
|
+
import { ValueOf } from '../../types/helpers.js';
|
|
5
|
+
import { StylingProps } from '../../types/styles.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Component variant.
|
|
9
|
+
*/
|
|
10
|
+
declare const IconButtonVariant: {
|
|
11
|
+
readonly primary: "primary";
|
|
12
|
+
readonly secondary: "secondary";
|
|
13
|
+
readonly unstyled: "unstyled";
|
|
14
|
+
};
|
|
15
|
+
type IconButtonVariant = ValueOf<typeof IconButtonVariant>;
|
|
16
|
+
/**
|
|
17
|
+
* Component color.
|
|
18
|
+
*/
|
|
19
|
+
type IconButtonColor = ButtonsColorPalette;
|
|
20
|
+
/**
|
|
21
|
+
* Component props.
|
|
22
|
+
*/
|
|
23
|
+
interface IconButtonProps extends ComponentProps<'button'>, StylingProps {
|
|
24
|
+
/** Color variant. */
|
|
25
|
+
color?: IconButtonColor;
|
|
26
|
+
/**
|
|
27
|
+
* Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />
|
|
28
|
+
* Can also be a ReactElement.
|
|
29
|
+
*/
|
|
30
|
+
icon: IconProps['icon'];
|
|
31
|
+
/** Props to forward to the icon. */
|
|
32
|
+
iconProps?: Omit<IconProps, 'ref' | 'icon'>;
|
|
33
|
+
/** Whether the component is active or not. */
|
|
34
|
+
isActive?: boolean;
|
|
35
|
+
/** Whether the component is disabled or not. */
|
|
36
|
+
isDisabled?: boolean;
|
|
37
|
+
/** Whether the component is hovered or not. */
|
|
38
|
+
isHovered?: boolean;
|
|
39
|
+
/** Whether the component is in a loading state or not. */
|
|
40
|
+
isLoading?: boolean;
|
|
41
|
+
/** Theme. */
|
|
42
|
+
theme?: Theme;
|
|
43
|
+
/** Button variant. */
|
|
44
|
+
variant?: IconButtonVariant;
|
|
45
|
+
}
|
|
46
|
+
type StyledIconButtonProps = Omit<IconButtonProps, 'icon'> & {
|
|
47
|
+
$color: IconButtonProps['color'];
|
|
48
|
+
$isActive: IconButtonProps['isActive'];
|
|
49
|
+
$isDisabled: IconButtonProps['isDisabled'];
|
|
50
|
+
$isHovered: IconButtonProps['isHovered'];
|
|
51
|
+
$isLoading: IconButtonProps['isLoading'];
|
|
52
|
+
$theme: IconButtonProps['theme'];
|
|
53
|
+
$variant: IconButtonProps['variant'];
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { IconButtonColor, IconButtonProps, IconButtonVariant, StyledIconButtonProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component variant.
|
|
3
|
+
*/
|
|
4
|
+
const IconButtonVariant = {
|
|
5
|
+
primary: 'primary',
|
|
6
|
+
secondary: 'secondary',
|
|
7
|
+
unstyled: 'unstyled'
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Component color.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Component props.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export { IconButtonVariant };
|
|
19
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/components/icon-button/types.ts"],"sourcesContent":["import { ComponentProps } from 'react';\nimport { ButtonsColorPalette, StylingProps, Theme, ValueOf } from '../../types';\nimport { IconProps } from '../icon';\n\n/**\n * Component variant.\n */\nexport const IconButtonVariant = {\n primary: 'primary',\n secondary: 'secondary',\n unstyled: 'unstyled',\n} as const;\nexport type IconButtonVariant = ValueOf<typeof IconButtonVariant>;\n\n/**\n * Component color.\n */\nexport type IconButtonColor = ButtonsColorPalette;\n\n/**\n * Component props.\n */\nexport interface IconButtonProps extends ComponentProps<'button'>, StylingProps {\n /** Color variant. */\n color?: IconButtonColor;\n /**\n * Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />\n * Can also be a ReactElement.\n */\n icon: IconProps['icon'];\n /** Props to forward to the icon. */\n iconProps?: Omit<IconProps, 'ref' | 'icon'>;\n /** Whether the component is active or not. */\n isActive?: boolean;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Whether the component is hovered or not. */\n isHovered?: boolean;\n /** Whether the component is in a loading state or not. */\n isLoading?: boolean;\n /** Theme. */\n theme?: Theme;\n /** Button variant. */\n variant?: IconButtonVariant;\n}\n\nexport type StyledIconButtonProps = Omit<IconButtonProps, 'icon'> & {\n $color: IconButtonProps['color'];\n $isActive: IconButtonProps['isActive'];\n $isDisabled: IconButtonProps['isDisabled'];\n $isHovered: IconButtonProps['isHovered'];\n $isLoading: IconButtonProps['isLoading'];\n $theme: IconButtonProps['theme'];\n $variant: IconButtonProps['variant'];\n};\n"],"names":["IconButtonVariant","primary","secondary","unstyled"],"mappings":"AAIA;AACA;AACA;AACO,MAAMA,iBAAiB,GAAG;AAC/BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,SAAS,EAAE,WAAW;AACtBC,EAAAA,QAAQ,EAAE,UAAA;AACZ,EAAU;;AAGV;AACA;AACA;;AAGA;AACA;AACA;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IconButtonLinkProps } from './types.js';
|
|
2
|
+
import { Comp } from '../../types/helpers.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The IconButtonLink is a semantic link that looks like an icon button.
|
|
6
|
+
*
|
|
7
|
+
* For a semantic button that looks like an icon button, please use the IconButton component.
|
|
8
|
+
* For a semantic link that looks like a link, please use the Link component.
|
|
9
|
+
* For a semantic button that looks like a link, please use the LinkButton component.
|
|
10
|
+
*/
|
|
11
|
+
declare const IconButtonLink: Comp<IconButtonLinkProps, HTMLAnchorElement>;
|
|
12
|
+
|
|
13
|
+
export { IconButtonLink };
|
|
@@ -0,0 +1,76 @@
|
|
|
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 { StyledGradientBorder } from '../gradient-border/index.js';
|
|
5
|
+
import { StyledIconButton } from '../icon-button/styles.js';
|
|
6
|
+
import { IconButtonVariant } from '../icon-button/types.js';
|
|
7
|
+
import { useTheme } from '../theme/useTheme.js';
|
|
8
|
+
import { ButtonsColorPalette } from '../../types/colors.js';
|
|
9
|
+
import { ConditionalWrapper } from '../conditional-wrapper/ConditionalWrapper.js';
|
|
10
|
+
import { Icon } from '../icon/Icon.js';
|
|
11
|
+
|
|
12
|
+
const _excluded = ["as", "className", "color", "href", "icon", "iconProps", "isActive", "isDisabled", "isHovered", "target", "theme", "variant"];
|
|
13
|
+
const COMPONENT_NAME = 'IconButtonLink';
|
|
14
|
+
const CLASSNAME = 'redsift-icon-button-link';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The IconButtonLink is a semantic link that looks like an icon button.
|
|
18
|
+
*
|
|
19
|
+
* For a semantic button that looks like an icon button, please use the IconButton component.
|
|
20
|
+
* For a semantic link that looks like a link, please use the Link component.
|
|
21
|
+
* For a semantic button that looks like a link, please use the LinkButton component.
|
|
22
|
+
*/
|
|
23
|
+
const IconButtonLink = /*#__PURE__*/forwardRef((props, ref) => {
|
|
24
|
+
const {
|
|
25
|
+
as,
|
|
26
|
+
className,
|
|
27
|
+
color: propsColor,
|
|
28
|
+
href,
|
|
29
|
+
icon,
|
|
30
|
+
iconProps,
|
|
31
|
+
isActive,
|
|
32
|
+
isDisabled,
|
|
33
|
+
isHovered,
|
|
34
|
+
target,
|
|
35
|
+
theme: propsTheme,
|
|
36
|
+
variant: propsVariant
|
|
37
|
+
} = props,
|
|
38
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
39
|
+
const theme = useTheme(propsTheme);
|
|
40
|
+
const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
|
|
41
|
+
const variant = Object.values(IconButtonVariant).includes(propsVariant) ? propsVariant : 'unstyled';
|
|
42
|
+
const isGradient = color === ButtonsColorPalette.radar;
|
|
43
|
+
return /*#__PURE__*/React__default.createElement(ConditionalWrapper, {
|
|
44
|
+
condition: isGradient && variant === IconButtonVariant.secondary,
|
|
45
|
+
wrapper: children => /*#__PURE__*/React__default.createElement(StyledGradientBorder, {
|
|
46
|
+
$color: color,
|
|
47
|
+
$isActive: isActive,
|
|
48
|
+
$isDisabled: isDisabled,
|
|
49
|
+
$isHovered: isHovered,
|
|
50
|
+
$theme: theme
|
|
51
|
+
}, children)
|
|
52
|
+
}, /*#__PURE__*/React__default.createElement(StyledIconButton, _extends({
|
|
53
|
+
as: as || 'a',
|
|
54
|
+
role: "link",
|
|
55
|
+
tabIndex: !isDisabled ? 0 : undefined
|
|
56
|
+
}, forwardedProps, {
|
|
57
|
+
$color: color,
|
|
58
|
+
$isActive: isActive,
|
|
59
|
+
$isDisabled: isDisabled,
|
|
60
|
+
$isGradient: isGradient,
|
|
61
|
+
$isHovered: isHovered,
|
|
62
|
+
$theme: theme,
|
|
63
|
+
$variant: variant,
|
|
64
|
+
className: classNames(IconButtonLink.className, className),
|
|
65
|
+
href: !isDisabled ? href : undefined,
|
|
66
|
+
ref: ref,
|
|
67
|
+
target: target
|
|
68
|
+
}), /*#__PURE__*/React__default.createElement(Icon, _extends({}, iconProps, {
|
|
69
|
+
icon: icon
|
|
70
|
+
}))));
|
|
71
|
+
});
|
|
72
|
+
IconButtonLink.className = CLASSNAME;
|
|
73
|
+
IconButtonLink.displayName = COMPONENT_NAME;
|
|
74
|
+
|
|
75
|
+
export { IconButtonLink };
|
|
76
|
+
//# sourceMappingURL=IconButtonLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButtonLink.js","sources":["../../../src/components/icon-button-link/IconButtonLink.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport classNames from 'classnames';\nimport { Comp, ButtonsColorPalette } from '../../types';\nimport { Icon } from '../icon';\nimport { IconButtonLinkProps } from './types';\nimport { useTheme } from '../theme';\nimport { ConditionalWrapper } from '../conditional-wrapper';\nimport { StyledGradientBorder } from '../gradient-border';\nimport { StyledIconButton } from '../icon-button/styles';\nimport { IconButtonVariant } from '../icon-button/types';\n\nconst COMPONENT_NAME = 'IconButtonLink';\nconst CLASSNAME = 'redsift-icon-button-link';\n\n/**\n * The IconButtonLink is a semantic link that looks like an icon button.\n *\n * For a semantic button that looks like an icon button, please use the IconButton component.\n * For a semantic link that looks like a link, please use the Link component.\n * For a semantic button that looks like a link, please use the LinkButton component.\n */\nexport const IconButtonLink: Comp<IconButtonLinkProps, HTMLAnchorElement> = forwardRef((props, ref) => {\n const {\n as,\n className,\n color: propsColor,\n href,\n icon,\n iconProps,\n isActive,\n isDisabled,\n isHovered,\n target,\n theme: propsTheme,\n variant: propsVariant,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : 'primary';\n const variant = Object.values(IconButtonVariant).includes(propsVariant!) ? propsVariant : 'unstyled';\n const isGradient = color === ButtonsColorPalette.radar;\n\n return (\n <ConditionalWrapper\n condition={isGradient && variant === IconButtonVariant.secondary}\n wrapper={(children) => (\n <StyledGradientBorder\n $color={color}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isHovered={isHovered}\n $theme={theme}\n >\n {children}\n </StyledGradientBorder>\n )}\n >\n <StyledIconButton\n as={(as || 'a') as any}\n role=\"link\"\n tabIndex={!isDisabled ? 0 : undefined}\n {...forwardedProps}\n $color={color}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isGradient={isGradient}\n $isHovered={isHovered}\n $theme={theme}\n $variant={variant}\n className={classNames(IconButtonLink.className, className)}\n href={!isDisabled ? href : undefined}\n ref={ref as RefObject<HTMLAnchorElement>}\n target={target}\n >\n <Icon {...iconProps} icon={icon} />\n </StyledIconButton>\n </ConditionalWrapper>\n );\n});\nIconButtonLink.className = CLASSNAME;\nIconButtonLink.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","IconButtonLink","forwardRef","props","ref","as","className","color","propsColor","href","icon","iconProps","isActive","isDisabled","isHovered","target","theme","propsTheme","variant","propsVariant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","IconButtonVariant","isGradient","radar","React","createElement","ConditionalWrapper","condition","secondary","wrapper","children","StyledGradientBorder","$color","$isActive","$isDisabled","$isHovered","$theme","StyledIconButton","_extends","role","tabIndex","undefined","$isGradient","$variant","classNames","Icon","displayName"],"mappings":";;;;;;;;;;;;AAWA,MAAMA,cAAc,GAAG,gBAAgB,CAAA;AACvC,MAAMC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B,MAAAA,MAAM,EAAE3B,KAAAA;AAAM,KAAA,EAEbqB,QACmB,CAAA;AACtB,GAAA,eAEFN,cAAA,CAAAC,aAAA,CAACY,gBAAgB,EAAAC,QAAA,CAAA;IACfxC,EAAE,EAAGA,EAAE,IAAI,GAAY;AACvByC,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,QAAQ,EAAE,CAAClC,UAAU,GAAG,CAAC,GAAGmC,SAAAA;AAAU,GAAA,EAClC5B,cAAc,EAAA;AAClBmB,IAAAA,MAAM,EAAEhC,KAAM;AACdiC,IAAAA,SAAS,EAAE5B,QAAS;AACpB6B,IAAAA,WAAW,EAAE5B,UAAW;AACxBoC,IAAAA,WAAW,EAAEpB,UAAW;AACxBa,IAAAA,UAAU,EAAE5B,SAAU;AACtB6B,IAAAA,MAAM,EAAE3B,KAAM;AACdkC,IAAAA,QAAQ,EAAEhC,OAAQ;IAClBZ,SAAS,EAAE6C,UAAU,CAAClD,cAAc,CAACK,SAAS,EAAEA,SAAS,CAAE;AAC3DG,IAAAA,IAAI,EAAE,CAACI,UAAU,GAAGJ,IAAI,GAAGuC,SAAU;AACrC5C,IAAAA,GAAG,EAAEA,GAAoC;AACzCW,IAAAA,MAAM,EAAEA,MAAAA;GAERgB,CAAAA,eAAAA,cAAA,CAAAC,aAAA,CAACoB,IAAI,EAAAP,QAAA,KAAKlC,SAAS,EAAA;AAAED,IAAAA,IAAI,EAAEA,IAAAA;GAAO,CAAA,CAClB,CACA,CAAC,CAAA;AAEzB,CAAC,EAAC;AACFT,cAAc,CAACK,SAAS,GAAGN,SAAS,CAAA;AACpCC,cAAc,CAACoD,WAAW,GAAGtD,cAAc;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LinkProps } from '../link/types.js';
|
|
2
|
+
import { IconButtonProps } from '../icon-button/types.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Component props.
|
|
6
|
+
*/
|
|
7
|
+
interface IconButtonLinkProps extends Omit<LinkProps, 'color'>, Pick<IconButtonProps, 'icon' | 'iconProps' | 'color' | 'isActive' | 'isDisabled' | 'isHovered' | 'variant' | 'theme'> {
|
|
8
|
+
}
|
|
9
|
+
type StyledIconButtonLinkProps = Omit<IconButtonLinkProps, 'isActive' | 'isDisabled' | 'variant' | 'color' | 'size'> & {
|
|
10
|
+
$isActive: IconButtonLinkProps['isActive'];
|
|
11
|
+
$isDisabled: IconButtonLinkProps['isDisabled'];
|
|
12
|
+
$isHovered: IconButtonLinkProps['isHovered'];
|
|
13
|
+
$variant: IconButtonLinkProps['variant'];
|
|
14
|
+
$theme: IconButtonLinkProps['theme'];
|
|
15
|
+
$color: IconButtonLinkProps['color'];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { IconButtonLinkProps, StyledIconButtonLinkProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ItemProps } from './types.js';
|
|
2
|
+
import { Comp } from '../../types/helpers.js';
|
|
3
|
+
|
|
4
|
+
declare const RenderedListboxItem: Comp<Omit<ItemProps, 'value'> & Required<Pick<ItemProps, 'value'>>, HTMLElement>;
|
|
5
|
+
/**
|
|
6
|
+
* The Item component.
|
|
7
|
+
*/
|
|
8
|
+
declare const Item: Comp<ItemProps, HTMLElement>;
|
|
9
|
+
|
|
10
|
+
export { Item, RenderedListboxItem };
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default, { forwardRef, useRef, useContext } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { StyledItem } from './styles.js';
|
|
5
|
+
import { useListboxItem } from '../listbox/useListboxItem.js';
|
|
6
|
+
import { useMenuItem } from './useMenuItem.js';
|
|
7
|
+
import { mdiCheckboxMarked, mdiCheckboxBlankOutline } from '@redsift/icons';
|
|
8
|
+
import { StyledGradientBorder } from '../gradient-border/index.js';
|
|
9
|
+
import { FocusWithinGroupContext } from '../focus-within-group/context.js';
|
|
10
|
+
import { useTheme } from '../theme/useTheme.js';
|
|
11
|
+
import { ButtonsColorPalette } from '../../types/colors.js';
|
|
12
|
+
import { ConditionalWrapper } from '../conditional-wrapper/ConditionalWrapper.js';
|
|
13
|
+
import { Flexbox } from '../flexbox/Flexbox.js';
|
|
14
|
+
import { Icon } from '../icon/Icon.js';
|
|
15
|
+
import { Text } from '../text/Text.js';
|
|
16
|
+
import { useId } from '../../utils/useId.js';
|
|
17
|
+
import { isComponent } from '../../utils/isComponent.js';
|
|
18
|
+
|
|
19
|
+
const _excluded = ["borderRadius", "children", "className", "color", "defaultSelected", "id", "isActive", "isDisabled", "isHovered", "isSelected", "hasBorder", "hasCheckbox", "theme", "value"],
|
|
20
|
+
_excluded2 = ["borderRadius", "children", "className", "color", "hasBorder", "id", "isActive", "isDisabled", "isHovered", "theme", "onClick"];
|
|
21
|
+
const COMPONENT_NAME = 'Item';
|
|
22
|
+
const CLASSNAME = 'redsift-item';
|
|
23
|
+
const RenderedListboxItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
24
|
+
const {
|
|
25
|
+
borderRadius = '0',
|
|
26
|
+
children,
|
|
27
|
+
className,
|
|
28
|
+
color: propsColor,
|
|
29
|
+
defaultSelected,
|
|
30
|
+
id: propsId,
|
|
31
|
+
isActive,
|
|
32
|
+
isDisabled: propsIsDisabled,
|
|
33
|
+
isHovered,
|
|
34
|
+
isSelected: propsIsSelected,
|
|
35
|
+
hasBorder,
|
|
36
|
+
hasCheckbox,
|
|
37
|
+
theme: propsTheme,
|
|
38
|
+
value
|
|
39
|
+
} = props,
|
|
40
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
41
|
+
const id = propsId !== null && propsId !== void 0 ? propsId : value;
|
|
42
|
+
const _ref = useRef();
|
|
43
|
+
const divRef = ref !== null && ref !== void 0 ? ref : _ref;
|
|
44
|
+
const {
|
|
45
|
+
tabIndex,
|
|
46
|
+
isFocused,
|
|
47
|
+
isSelected,
|
|
48
|
+
isDisabled,
|
|
49
|
+
handleKeyDown,
|
|
50
|
+
handleClick
|
|
51
|
+
} = useListboxItem({
|
|
52
|
+
domElementRef: divRef,
|
|
53
|
+
value,
|
|
54
|
+
id,
|
|
55
|
+
isDisabled: propsIsDisabled,
|
|
56
|
+
propsIsSelected: propsIsSelected !== null && propsIsSelected !== void 0 ? propsIsSelected : defaultSelected
|
|
57
|
+
});
|
|
58
|
+
const theme = useTheme(propsTheme);
|
|
59
|
+
const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
|
|
60
|
+
const isGradient = color === ButtonsColorPalette.radar;
|
|
61
|
+
return /*#__PURE__*/React__default.createElement(ConditionalWrapper, {
|
|
62
|
+
condition: isGradient,
|
|
63
|
+
wrapper: children => /*#__PURE__*/React__default.createElement(StyledGradientBorder, {
|
|
64
|
+
$borderRadius: borderRadius,
|
|
65
|
+
$color: color,
|
|
66
|
+
$isActive: isActive,
|
|
67
|
+
$isDisabled: isDisabled,
|
|
68
|
+
$isHovered: isHovered,
|
|
69
|
+
$theme: theme,
|
|
70
|
+
width: "auto"
|
|
71
|
+
}, children)
|
|
72
|
+
}, /*#__PURE__*/React__default.createElement(StyledItem, _extends({
|
|
73
|
+
role: "option"
|
|
74
|
+
}, forwardedProps, {
|
|
75
|
+
id: id,
|
|
76
|
+
$borderRadius: borderRadius,
|
|
77
|
+
$color: color,
|
|
78
|
+
$hasBorder: hasBorder,
|
|
79
|
+
$hasCheckbox: hasCheckbox,
|
|
80
|
+
$isActive: isActive || isSelected,
|
|
81
|
+
$isDisabled: isDisabled,
|
|
82
|
+
$isGradient: isGradient,
|
|
83
|
+
$isHovered: isHovered || isFocused,
|
|
84
|
+
$theme: theme,
|
|
85
|
+
"aria-selected": isSelected,
|
|
86
|
+
"aria-disabled": isDisabled,
|
|
87
|
+
className: classNames(Item.className, className),
|
|
88
|
+
onClick: isDisabled ? undefined : handleClick,
|
|
89
|
+
ref: divRef,
|
|
90
|
+
onKeyDown: handleKeyDown,
|
|
91
|
+
tabIndex: tabIndex
|
|
92
|
+
}), hasCheckbox ? /*#__PURE__*/React__default.createElement(Flexbox, null, isSelected ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
93
|
+
color: isDisabled ? 'grey' : color,
|
|
94
|
+
icon: mdiCheckboxMarked
|
|
95
|
+
}) : /*#__PURE__*/React__default.createElement(Icon, {
|
|
96
|
+
color: "question",
|
|
97
|
+
icon: mdiCheckboxBlankOutline
|
|
98
|
+
}), children ? children : /*#__PURE__*/React__default.createElement(Text, null, value)) : children !== null && children !== void 0 ? children : value));
|
|
99
|
+
});
|
|
100
|
+
const RenderedMenuItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
101
|
+
const {
|
|
102
|
+
borderRadius = '0',
|
|
103
|
+
children,
|
|
104
|
+
className,
|
|
105
|
+
color: propsColor,
|
|
106
|
+
hasBorder,
|
|
107
|
+
id: propsId,
|
|
108
|
+
isActive,
|
|
109
|
+
isDisabled: propsIsDisabled,
|
|
110
|
+
isHovered,
|
|
111
|
+
theme: propsTheme,
|
|
112
|
+
onClick
|
|
113
|
+
} = props,
|
|
114
|
+
forwardedProps = _objectWithoutProperties(props, _excluded2);
|
|
115
|
+
const [_id] = useId();
|
|
116
|
+
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
117
|
+
const _ref = useRef();
|
|
118
|
+
const divRef = ref !== null && ref !== void 0 ? ref : _ref;
|
|
119
|
+
const linkRef = useRef(null);
|
|
120
|
+
const isLinkMenuItem = isComponent('Link')(children);
|
|
121
|
+
const {
|
|
122
|
+
tabIndex,
|
|
123
|
+
isFocused,
|
|
124
|
+
isDisabled,
|
|
125
|
+
handleKeyDown,
|
|
126
|
+
handleClick
|
|
127
|
+
} = useMenuItem({
|
|
128
|
+
domElementRef: divRef,
|
|
129
|
+
id,
|
|
130
|
+
isDisabled: propsIsDisabled,
|
|
131
|
+
onClick: onClick,
|
|
132
|
+
isLinkMenuItem,
|
|
133
|
+
linkRef
|
|
134
|
+
});
|
|
135
|
+
const theme = useTheme(propsTheme);
|
|
136
|
+
const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
|
|
137
|
+
const isGradient = color === ButtonsColorPalette.radar;
|
|
138
|
+
return /*#__PURE__*/React__default.createElement(ConditionalWrapper, {
|
|
139
|
+
condition: isGradient,
|
|
140
|
+
wrapper: children => /*#__PURE__*/React__default.createElement(StyledGradientBorder, {
|
|
141
|
+
$borderRadius: borderRadius,
|
|
142
|
+
$color: color,
|
|
143
|
+
$isActive: isActive,
|
|
144
|
+
$isDisabled: isDisabled,
|
|
145
|
+
$isHovered: isHovered,
|
|
146
|
+
$theme: theme,
|
|
147
|
+
width: "auto"
|
|
148
|
+
}, children)
|
|
149
|
+
}, /*#__PURE__*/React__default.createElement(StyledItem, _extends({
|
|
150
|
+
as: "li",
|
|
151
|
+
role: isLinkMenuItem ? 'none' : 'menuitem'
|
|
152
|
+
}, forwardedProps, {
|
|
153
|
+
id: id,
|
|
154
|
+
$borderRadius: borderRadius,
|
|
155
|
+
$color: color,
|
|
156
|
+
$hasBorder: hasBorder,
|
|
157
|
+
$hasCheckbox: false,
|
|
158
|
+
$isActive: isActive,
|
|
159
|
+
$isDisabled: isDisabled,
|
|
160
|
+
$isGradient: isGradient,
|
|
161
|
+
$isHovered: isHovered || isFocused,
|
|
162
|
+
$theme: theme,
|
|
163
|
+
"aria-disabled": isDisabled,
|
|
164
|
+
className: classNames(Item.className, className),
|
|
165
|
+
onClick: isDisabled ? undefined : handleClick,
|
|
166
|
+
ref: divRef,
|
|
167
|
+
onKeyDown: handleKeyDown,
|
|
168
|
+
tabIndex: tabIndex
|
|
169
|
+
}), isLinkMenuItem ? /*#__PURE__*/React__default.cloneElement(children, {
|
|
170
|
+
role: 'menuitem',
|
|
171
|
+
ref: linkRef
|
|
172
|
+
}) : children));
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The Item component.
|
|
177
|
+
*/
|
|
178
|
+
const Item = /*#__PURE__*/forwardRef((props, ref) => {
|
|
179
|
+
const {
|
|
180
|
+
value
|
|
181
|
+
} = props;
|
|
182
|
+
const focusContext = useContext(FocusWithinGroupContext);
|
|
183
|
+
const isListbox = focusContext.state.listRole === 'listbox';
|
|
184
|
+
if (!focusContext.state.filter) {
|
|
185
|
+
return isListbox ? /*#__PURE__*/React__default.createElement(RenderedListboxItem, _extends({}, props, {
|
|
186
|
+
value: props.value,
|
|
187
|
+
ref: ref
|
|
188
|
+
})) : /*#__PURE__*/React__default.createElement(RenderedMenuItem, _extends({}, props, {
|
|
189
|
+
ref: ref
|
|
190
|
+
}));
|
|
191
|
+
}
|
|
192
|
+
const {
|
|
193
|
+
value: filterValue,
|
|
194
|
+
type,
|
|
195
|
+
caseSensitive
|
|
196
|
+
} = focusContext.state.filter;
|
|
197
|
+
if (!filterValue) {
|
|
198
|
+
return isListbox ? /*#__PURE__*/React__default.createElement(RenderedListboxItem, _extends({}, props, {
|
|
199
|
+
value: props.value,
|
|
200
|
+
ref: ref
|
|
201
|
+
})) : /*#__PURE__*/React__default.createElement(RenderedMenuItem, _extends({}, props, {
|
|
202
|
+
ref: ref
|
|
203
|
+
}));
|
|
204
|
+
} else if (caseSensitive && (type === 'startsWith' && value.startsWith(filterValue) || type === 'contains' && value.includes(filterValue) || type === 'endsWith' && value.endsWith(filterValue))) {
|
|
205
|
+
return isListbox ? /*#__PURE__*/React__default.createElement(RenderedListboxItem, _extends({}, props, {
|
|
206
|
+
value: props.value,
|
|
207
|
+
ref: ref
|
|
208
|
+
})) : /*#__PURE__*/React__default.createElement(RenderedMenuItem, _extends({}, props, {
|
|
209
|
+
ref: ref
|
|
210
|
+
}));
|
|
211
|
+
} else if (!caseSensitive && (type === 'startsWith' && value.toLowerCase().startsWith(filterValue.toLowerCase()) || type === 'contains' && value.toLowerCase().includes(filterValue.toLowerCase()) || type === 'endsWith' && value.toLowerCase().endsWith(filterValue.toLowerCase()))) {
|
|
212
|
+
return isListbox ? /*#__PURE__*/React__default.createElement(RenderedListboxItem, _extends({}, props, {
|
|
213
|
+
value: props.value,
|
|
214
|
+
ref: ref
|
|
215
|
+
})) : /*#__PURE__*/React__default.createElement(RenderedMenuItem, _extends({}, props, {
|
|
216
|
+
ref: ref
|
|
217
|
+
}));
|
|
218
|
+
}
|
|
219
|
+
return null;
|
|
220
|
+
});
|
|
221
|
+
Item.className = CLASSNAME;
|
|
222
|
+
Item.displayName = COMPONENT_NAME;
|
|
223
|
+
|
|
224
|
+
export { Item, RenderedListboxItem };
|
|
225
|
+
//# sourceMappingURL=Item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Item.js","sources":["../../../src/components/item/Item.tsx"],"sourcesContent":["import React, { forwardRef, RefObject, useContext, useRef } from 'react';\nimport classNames from 'classnames';\nimport { ButtonsColorPalette, Comp } from '../../types';\nimport { ItemProps } from './types';\nimport { StyledItem } from './styles';\nimport { useListboxItem } from '../listbox/useListboxItem';\nimport { FocusWithinGroupContext } from '../focus-within-group';\nimport { useMenuItem } from './useMenuItem';\nimport { isComponent, useId } from '../../utils';\nimport { useTheme } from '../theme';\nimport { Flexbox } from '../flexbox';\nimport { Icon } from '../icon';\nimport { Text } from '../text';\nimport { mdiCheckboxBlankOutline, mdiCheckboxMarked } from '@redsift/icons';\nimport { ConditionalWrapper } from '../conditional-wrapper';\nimport { StyledGradientBorder } from '../gradient-border';\n\nconst COMPONENT_NAME = 'Item';\nconst CLASSNAME = 'redsift-item';\n\nexport const RenderedListboxItem: Comp<Omit<ItemProps, 'value'> & Required<Pick<ItemProps, 'value'>>, HTMLElement> =\n forwardRef((props, ref) => {\n const {\n borderRadius = '0',\n children,\n className,\n color: propsColor,\n defaultSelected,\n id: propsId,\n isActive,\n isDisabled: propsIsDisabled,\n isHovered,\n isSelected: propsIsSelected,\n hasBorder,\n hasCheckbox,\n theme: propsTheme,\n value,\n ...forwardedProps\n } = props;\n const id = propsId ?? value;\n const _ref = useRef<HTMLElement>();\n const divRef = ref ?? _ref;\n\n const { tabIndex, isFocused, isSelected, isDisabled, handleKeyDown, handleClick } = useListboxItem({\n domElementRef: divRef as RefObject<Element>,\n value,\n id,\n isDisabled: propsIsDisabled!,\n propsIsSelected: propsIsSelected ?? defaultSelected,\n });\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : 'primary';\n const isGradient = color === ButtonsColorPalette.radar;\n\n return (\n <ConditionalWrapper\n condition={isGradient}\n wrapper={(children) => (\n <StyledGradientBorder\n $borderRadius={borderRadius}\n $color={color}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isHovered={isHovered}\n $theme={theme}\n width=\"auto\"\n >\n {children}\n </StyledGradientBorder>\n )}\n >\n <StyledItem\n role=\"option\"\n {...forwardedProps}\n id={id}\n $borderRadius={borderRadius}\n $color={color}\n $hasBorder={hasBorder}\n $hasCheckbox={hasCheckbox}\n $isActive={isActive || isSelected}\n $isDisabled={isDisabled}\n $isGradient={isGradient}\n $isHovered={isHovered || isFocused}\n $theme={theme}\n aria-selected={isSelected}\n aria-disabled={isDisabled}\n className={classNames(Item.className, className)}\n onClick={isDisabled ? undefined : handleClick}\n ref={divRef as RefObject<HTMLElement>}\n onKeyDown={handleKeyDown}\n tabIndex={tabIndex}\n >\n {hasCheckbox ? (\n <Flexbox>\n {isSelected ? (\n <Icon color={isDisabled ? 'grey' : color} icon={mdiCheckboxMarked} />\n ) : (\n <Icon color=\"question\" icon={mdiCheckboxBlankOutline} />\n )}\n {children ? children : <Text>{value}</Text>}\n </Flexbox>\n ) : (\n children ?? value\n )}\n </StyledItem>\n </ConditionalWrapper>\n );\n });\n\nconst RenderedMenuItem: Comp<Omit<ItemProps, 'value'>, HTMLElement> = forwardRef((props, ref) => {\n const {\n borderRadius = '0',\n children,\n className,\n color: propsColor,\n hasBorder,\n id: propsId,\n isActive,\n isDisabled: propsIsDisabled,\n isHovered,\n theme: propsTheme,\n onClick,\n ...forwardedProps\n } = props;\n const [_id] = useId();\n const id = propsId ?? _id;\n const _ref = useRef<HTMLElement>();\n const divRef = ref ?? _ref;\n const linkRef = useRef<HTMLAnchorElement>(null);\n\n const isLinkMenuItem = isComponent('Link')(children);\n const { tabIndex, isFocused, isDisabled, handleKeyDown, handleClick } = useMenuItem({\n domElementRef: divRef as RefObject<Element>,\n id,\n isDisabled: propsIsDisabled!,\n onClick: onClick as any,\n isLinkMenuItem,\n linkRef,\n });\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : 'primary';\n const isGradient = color === ButtonsColorPalette.radar;\n\n return (\n <ConditionalWrapper\n condition={isGradient}\n wrapper={(children) => (\n <StyledGradientBorder\n $borderRadius={borderRadius}\n $color={color}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isHovered={isHovered}\n $theme={theme}\n width=\"auto\"\n >\n {children}\n </StyledGradientBorder>\n )}\n >\n <StyledItem\n as=\"li\"\n role={isLinkMenuItem ? 'none' : 'menuitem'}\n {...forwardedProps}\n id={id}\n $borderRadius={borderRadius}\n $color={color}\n $hasBorder={hasBorder}\n $hasCheckbox={false}\n $isActive={isActive}\n $isDisabled={isDisabled}\n $isGradient={isGradient}\n $isHovered={isHovered || isFocused}\n $theme={theme}\n aria-disabled={isDisabled}\n className={classNames(Item.className, className)}\n onClick={isDisabled ? undefined : handleClick}\n ref={divRef}\n onKeyDown={handleKeyDown}\n tabIndex={tabIndex}\n >\n {isLinkMenuItem\n ? React.cloneElement(children, {\n role: 'menuitem',\n ref: linkRef,\n })\n : children}\n </StyledItem>\n </ConditionalWrapper>\n );\n});\n\n/**\n * The Item component.\n */\nexport const Item: Comp<ItemProps, HTMLElement> = forwardRef((props, ref) => {\n const { value } = props;\n const focusContext = useContext(FocusWithinGroupContext);\n const isListbox = focusContext.state.listRole === 'listbox';\n\n if (!focusContext.state.filter) {\n return isListbox ? (\n <RenderedListboxItem {...props} value={props.value!} ref={ref} />\n ) : (\n <RenderedMenuItem {...props} ref={ref} />\n );\n }\n\n const { value: filterValue, type, caseSensitive } = focusContext.state.filter;\n\n if (!filterValue) {\n return isListbox ? (\n <RenderedListboxItem {...props} value={props.value!} ref={ref} />\n ) : (\n <RenderedMenuItem {...props} ref={ref} />\n );\n } else if (\n caseSensitive &&\n ((type === 'startsWith' && value!.startsWith(filterValue)) ||\n (type === 'contains' && value!.includes(filterValue)) ||\n (type === 'endsWith' && value!.endsWith(filterValue)))\n ) {\n return isListbox ? (\n <RenderedListboxItem {...props} value={props.value!} ref={ref} />\n ) : (\n <RenderedMenuItem {...props} ref={ref} />\n );\n } else if (\n !caseSensitive &&\n ((type === 'startsWith' && value!.toLowerCase().startsWith(filterValue.toLowerCase())) ||\n (type === 'contains' && value!.toLowerCase().includes(filterValue.toLowerCase())) ||\n (type === 'endsWith' && value!.toLowerCase().endsWith(filterValue.toLowerCase())))\n ) {\n return isListbox ? (\n <RenderedListboxItem {...props} value={props.value!} ref={ref} />\n ) : (\n <RenderedMenuItem {...props} ref={ref} />\n );\n }\n\n return null;\n});\nItem.className = CLASSNAME;\nItem.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","RenderedListboxItem","forwardRef","props","ref","borderRadius","children","className","color","propsColor","defaultSelected","id","propsId","isActive","isDisabled","propsIsDisabled","isHovered","isSelected","propsIsSelected","hasBorder","hasCheckbox","theme","propsTheme","value","forwardedProps","_objectWithoutProperties","_excluded","_ref","useRef","divRef","tabIndex","isFocused","handleKeyDown","handleClick","useListboxItem","domElementRef","useTheme","Object","values","ButtonsColorPalette","includes","isGradient","radar","React","createElement","ConditionalWrapper","condition","wrapper","StyledGradientBorder","$borderRadius","$color","$isActive","$isDisabled","$isHovered","$theme","width","StyledItem","_extends","role","$hasBorder","$hasCheckbox","$isGradient","classNames","Item","onClick","undefined","onKeyDown","Flexbox","Icon","icon","mdiCheckboxMarked","mdiCheckboxBlankOutline","Text","RenderedMenuItem","_excluded2","_id","useId","linkRef","isLinkMenuItem","isComponent","useMenuItem","as","cloneElement","focusContext","useContext","FocusWithinGroupContext","isListbox","state","listRole","filter","filterValue","type","caseSensitive","startsWith","endsWith","toLowerCase","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,cAAc,GAAG,MAAM,CAAA;AAC7B,MAAMC,SAAS,GAAG,cAAc,CAAA;AAEzB,MAAMC,mBAAqG,gBAChHC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACzB,MAAM;AACJC,MAAAA,YAAY,GAAG,GAAG;MAClBC,QAAQ;MACRC,SAAS;AACTC,MAAAA,KAAK,EAAEC,UAAU;MACjBC,eAAe;AACfC,MAAAA,EAAE,EAAEC,OAAO;MACXC,QAAQ;AACRC,MAAAA,UAAU,EAAEC,eAAe;MAC3BC,SAAS;AACTC,MAAAA,UAAU,EAAEC,eAAe;MAC3BC,SAAS;MACTC,WAAW;AACXC,MAAAA,KAAK,EAAEC,UAAU;AACjBC,MAAAA,KAAAA;AAEF,KAAC,GAAGpB,KAAK;AADJqB,IAAAA,cAAc,GAAAC,wBAAA,CACftB,KAAK,EAAAuB,SAAA,CAAA,CAAA;EACT,MAAMf,EAAE,GAAGC,OAAO,KAAA,IAAA,IAAPA,OAAO,KAAPA,KAAAA,CAAAA,GAAAA,OAAO,GAAIW,KAAK,CAAA;AAC3B,EAAA,MAAMI,IAAI,GAAGC,MAAM,EAAe,CAAA;EAClC,MAAMC,MAAM,GAAGzB,GAAG,KAAA,IAAA,IAAHA,GAAG,KAAHA,KAAAA,CAAAA,GAAAA,GAAG,GAAIuB,IAAI,CAAA;EAE1B,MAAM;IAAEG,QAAQ;IAAEC,SAAS;IAAEd,UAAU;IAAEH,UAAU;IAAEkB,aAAa;AAAEC,IAAAA,WAAAA;GAAa,GAAGC,cAAc,CAAC;AACjGC,IAAAA,aAAa,EAAEN,MAA4B;IAC3CN,KAAK;IACLZ,EAAE;AACFG,IAAAA,UAA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IpE,KAAK,CAAEwE,WAAW,EAAE,CAACvD,QAAQ,CAACkD,WAAW,CAACK,WAAW,EAAE,CAAE,IAChFJ,IAAI,KAAK,UAAU,IAAIpE,KAAK,CAAEwE,WAAW,EAAE,CAACD,QAAQ,CAACJ,WAAW,CAACK,WAAW,EAAE,CAAE,CAAC,EACpF;IACA,OAAOT,SAAS,gBACd3C,cAAA,CAAAC,aAAA,CAAC3C,mBAAmB,EAAAwD,QAAA,CAAA,EAAA,EAAKtD,KAAK,EAAA;MAAEoB,KAAK,EAAEpB,KAAK,CAACoB,KAAO;AAACnB,MAAAA,GAAG,EAAEA,GAAAA;KAAM,CAAA,CAAC,gBAEjEuC,cAAA,CAAAC,aAAA,CAAC6B,gBAAgB,EAAAhB,QAAA,CAAA,EAAA,EAAKtD,KAAK,EAAA;AAAEC,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CACzC,CAAA;AACH,GAAA;AAEA,EAAA,OAAO,IAAI,CAAA;AACb,CAAC,EAAC;AACF2D,IAAI,CAACxD,SAAS,GAAGP,SAAS,CAAA;AAC1B+D,IAAI,CAACiC,WAAW,GAAGjG,cAAc;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as styled_components from 'styled-components';
|
|
2
|
+
import { ItemProps } from './types.js';
|
|
3
|
+
import { Theme } from '../../types/colors.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Component style.
|
|
7
|
+
*/
|
|
8
|
+
declare const StyledItem: styled_components.StyledComponent<"div", any, Omit<ItemProps, "color" | "onClick" | "value"> & {
|
|
9
|
+
$borderRadius: string | undefined;
|
|
10
|
+
$color: string | undefined;
|
|
11
|
+
$hasBorder: boolean | undefined;
|
|
12
|
+
$hasCheckbox: boolean | undefined;
|
|
13
|
+
$isActive: boolean | undefined;
|
|
14
|
+
$isDisabled: boolean | undefined;
|
|
15
|
+
$isGradient: boolean;
|
|
16
|
+
$isHovered: boolean | undefined;
|
|
17
|
+
$theme: Theme | undefined;
|
|
18
|
+
}, never>;
|
|
19
|
+
|
|
20
|
+
export { StyledItem };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { baseContainer } from '../shared/styles.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Component style.
|
|
6
|
+
*/
|
|
7
|
+
const StyledItem = styled.div`
|
|
8
|
+
min-height: 36px;
|
|
9
|
+
position: relative;
|
|
10
|
+
width: 100%;
|
|
11
|
+
padding: 8px 16px;
|
|
12
|
+
|
|
13
|
+
${baseContainer}
|
|
14
|
+
|
|
15
|
+
align-items: center;
|
|
16
|
+
background: none;
|
|
17
|
+
border: none;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
|
|
21
|
+
> a {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
text-decoration: none;
|
|
25
|
+
color: inherit;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
${_ref => {
|
|
29
|
+
let {
|
|
30
|
+
$color,
|
|
31
|
+
$isActive,
|
|
32
|
+
$isDisabled,
|
|
33
|
+
$isGradient,
|
|
34
|
+
$isHovered,
|
|
35
|
+
$hasBorder,
|
|
36
|
+
$theme
|
|
37
|
+
} = _ref;
|
|
38
|
+
return css`
|
|
39
|
+
${!$isGradient ? css`
|
|
40
|
+
background-color: var(
|
|
41
|
+
--redsift-color-${$theme}-components-buttons-secondary-button-${$isDisabled ? 'grey' : $color}-background-${$isActive ? 'active' : $isHovered || $isDisabled ? 'hover' : 'default'}
|
|
42
|
+
);
|
|
43
|
+
` : css`
|
|
44
|
+
background: var(
|
|
45
|
+
--redsift-color-${$theme}-components-buttons-secondary-button-${$isDisabled ? 'grey' : $color}-background-${$isActive ? 'active' : $isHovered || $isDisabled ? 'hover' : 'default'}
|
|
46
|
+
);
|
|
47
|
+
`}
|
|
48
|
+
|
|
49
|
+
${$hasBorder ? css`
|
|
50
|
+
border: 1px solid
|
|
51
|
+
var(
|
|
52
|
+
--redsift-color-${$theme}-components-buttons-secondary-button-${$isDisabled ? 'grey' : $color}-text-${$isActive ? 'active' : $isHovered || $isDisabled ? 'hover' : 'default'}
|
|
53
|
+
);
|
|
54
|
+
` : ''}
|
|
55
|
+
`;
|
|
56
|
+
}}
|
|
57
|
+
|
|
58
|
+
&:hover {
|
|
59
|
+
outline: none;
|
|
60
|
+
|
|
61
|
+
${_ref2 => {
|
|
62
|
+
let {
|
|
63
|
+
$color,
|
|
64
|
+
$isDisabled,
|
|
65
|
+
$isGradient,
|
|
66
|
+
$hasBorder,
|
|
67
|
+
$theme
|
|
68
|
+
} = _ref2;
|
|
69
|
+
return css`
|
|
70
|
+
cursor: ${$isDisabled ? 'default' : 'pointer'};
|
|
71
|
+
|
|
72
|
+
${!$isDisabled ? css`
|
|
73
|
+
${!$isGradient ? css`
|
|
74
|
+
background-color: var(
|
|
75
|
+
--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-background-hover
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
${$hasBorder ? css`
|
|
79
|
+
border: 1px solid
|
|
80
|
+
var(--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-text-hover);
|
|
81
|
+
` : ''}
|
|
82
|
+
` : css`
|
|
83
|
+
background: var(
|
|
84
|
+
--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-background-hover
|
|
85
|
+
);
|
|
86
|
+
`}
|
|
87
|
+
` : ''}
|
|
88
|
+
`;
|
|
89
|
+
}};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:active {
|
|
93
|
+
outline: none;
|
|
94
|
+
|
|
95
|
+
${_ref3 => {
|
|
96
|
+
let {
|
|
97
|
+
$color,
|
|
98
|
+
$hasBorder,
|
|
99
|
+
$isHovered,
|
|
100
|
+
$isDisabled,
|
|
101
|
+
$isGradient,
|
|
102
|
+
$theme
|
|
103
|
+
} = _ref3;
|
|
104
|
+
return css`
|
|
105
|
+
${!$isDisabled ? css`
|
|
106
|
+
${!$isGradient ? css`
|
|
107
|
+
background-color: var(
|
|
108
|
+
--redsift-color-${$theme}-components-buttons-secondary-button-${$isDisabled ? 'grey' : $color}-background-${$isHovered ? 'hover' : 'active'}
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
${$hasBorder ? css`
|
|
112
|
+
border: 1px solid
|
|
113
|
+
var(
|
|
114
|
+
--redsift-color-${$theme}-components-buttons-secondary-button-${$isDisabled ? 'grey' : $color}-text-${$isHovered ? 'hover' : 'active'}
|
|
115
|
+
);
|
|
116
|
+
` : ''}
|
|
117
|
+
` : css`
|
|
118
|
+
background: var(
|
|
119
|
+
--redsift-color-${$theme}-components-buttons-secondary-button-${$isDisabled ? 'grey' : $color}-background-${$isHovered ? 'hover' : 'active'}
|
|
120
|
+
);
|
|
121
|
+
`}
|
|
122
|
+
` : ''}
|
|
123
|
+
`;
|
|
124
|
+
}};
|
|
125
|
+
}
|
|
126
|
+
`;
|
|
127
|
+
|
|
128
|
+
export { StyledItem };
|
|
129
|
+
//# sourceMappingURL=styles.js.map
|