@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,90 @@
|
|
|
1
|
+
import { useContext, useCallback, useEffect } from 'react';
|
|
2
|
+
import { ListboxContext } from './context.js';
|
|
3
|
+
import { ListboxActionType } from './types.js';
|
|
4
|
+
import { useFocusOnListItem } from '../focus-within-group/useFocusOnListItem.js';
|
|
5
|
+
|
|
6
|
+
function useListboxItem(props) {
|
|
7
|
+
var _context$state, _context$state$select;
|
|
8
|
+
const {
|
|
9
|
+
domElementRef,
|
|
10
|
+
value,
|
|
11
|
+
id,
|
|
12
|
+
isDisabled,
|
|
13
|
+
propsIsSelected
|
|
14
|
+
} = props;
|
|
15
|
+
const {
|
|
16
|
+
tabIndex,
|
|
17
|
+
isFocused,
|
|
18
|
+
handleKeyDown: handleFocusKeyDown,
|
|
19
|
+
handleClick: handleFocusClick
|
|
20
|
+
} = useFocusOnListItem({
|
|
21
|
+
domElementRef,
|
|
22
|
+
isDisabled: isDisabled,
|
|
23
|
+
id,
|
|
24
|
+
value
|
|
25
|
+
});
|
|
26
|
+
const context = useContext(ListboxContext);
|
|
27
|
+
const handleKeyDown = useCallback(event => {
|
|
28
|
+
handleFocusKeyDown(event);
|
|
29
|
+
const code = event.code;
|
|
30
|
+
if (code === 'Enter' || code === 'Space') {
|
|
31
|
+
if (context.state.selectionMode === 'multiple') {
|
|
32
|
+
context.dispatch({
|
|
33
|
+
type: ListboxActionType.TOGGLE,
|
|
34
|
+
payload: {
|
|
35
|
+
value,
|
|
36
|
+
activedescendant: [id, value]
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
} else {
|
|
40
|
+
context.dispatch({
|
|
41
|
+
type: ListboxActionType.SET,
|
|
42
|
+
payload: {
|
|
43
|
+
values: [value],
|
|
44
|
+
activedescendant: [id, value]
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, []);
|
|
50
|
+
const handleClick = useCallback(() => {
|
|
51
|
+
handleFocusClick();
|
|
52
|
+
if (context.state.selectionMode === 'multiple') {
|
|
53
|
+
if (value) {
|
|
54
|
+
context.dispatch({
|
|
55
|
+
type: ListboxActionType.TOGGLE,
|
|
56
|
+
payload: {
|
|
57
|
+
value,
|
|
58
|
+
activedescendant: [id, value]
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
context.dispatch({
|
|
64
|
+
type: ListboxActionType.SET,
|
|
65
|
+
payload: {
|
|
66
|
+
values: [value],
|
|
67
|
+
activedescendant: [id, value]
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}, [value]);
|
|
72
|
+
const isSelected = propsIsSelected !== null && propsIsSelected !== void 0 ? propsIsSelected : (context === null || context === void 0 ? void 0 : (_context$state = context.state) === null || _context$state === void 0 ? void 0 : (_context$state$select = _context$state.selectedValues) === null || _context$state$select === void 0 ? void 0 : _context$state$select.find(selectedValue => selectedValue === value)) !== undefined;
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (isFocused && domElementRef.current) {
|
|
75
|
+
var _current;
|
|
76
|
+
(_current = domElementRef.current) === null || _current === void 0 ? void 0 : _current.focus();
|
|
77
|
+
}
|
|
78
|
+
}, [isFocused]);
|
|
79
|
+
return {
|
|
80
|
+
tabIndex,
|
|
81
|
+
isFocused,
|
|
82
|
+
isSelected,
|
|
83
|
+
isDisabled,
|
|
84
|
+
handleKeyDown,
|
|
85
|
+
handleClick
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { useListboxItem };
|
|
90
|
+
//# sourceMappingURL=useListboxItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useListboxItem.js","sources":["../../../src/components/listbox/useListboxItem.ts"],"sourcesContent":["import { useCallback, useContext, useEffect, RefObject, KeyboardEvent } from 'react';\nimport { ListboxContext } from './context';\nimport { ListboxActionType, UseListboxItemProps } from './types';\nimport { useFocusOnListItem } from '../focus-within-group';\n\nexport function useListboxItem(props: {\n domElementRef: RefObject<Element>;\n value: string;\n id?: string;\n isDisabled?: boolean;\n propsIsSelected?: boolean;\n}): UseListboxItemProps {\n const { domElementRef, value, id, isDisabled, propsIsSelected } = props;\n\n const {\n tabIndex,\n isFocused,\n handleKeyDown: handleFocusKeyDown,\n handleClick: handleFocusClick,\n } = useFocusOnListItem({ domElementRef, isDisabled: isDisabled!, id, value });\n\n const context = useContext(ListboxContext);\n\n const handleKeyDown = useCallback((event: KeyboardEvent) => {\n handleFocusKeyDown(event);\n const code = event.code;\n if (code === 'Enter' || code === 'Space') {\n if (context.state.selectionMode === 'multiple') {\n context.dispatch({\n type: ListboxActionType.TOGGLE,\n payload: { value, activedescendant: [id!, value] },\n });\n } else {\n context.dispatch({\n type: ListboxActionType.SET,\n payload: {\n values: [value],\n activedescendant: [id!, value],\n },\n });\n }\n }\n }, []);\n\n const handleClick = useCallback(() => {\n handleFocusClick();\n if (context.state.selectionMode === 'multiple') {\n if (value) {\n context.dispatch({\n type: ListboxActionType.TOGGLE,\n payload: { value, activedescendant: [id!, value] },\n });\n }\n } else {\n context.dispatch({\n type: ListboxActionType.SET,\n payload: {\n values: [value],\n activedescendant: [id!, value],\n },\n });\n }\n }, [value]);\n\n const isSelected =\n propsIsSelected ?? context?.state?.selectedValues?.find((selectedValue) => selectedValue === value) !== undefined;\n\n useEffect(() => {\n if (isFocused && domElementRef.current) {\n (domElementRef as RefObject<SVGElement | HTMLElement>).current?.focus();\n }\n }, [isFocused]);\n\n return {\n tabIndex,\n isFocused,\n isSelected,\n isDisabled,\n handleKeyDown,\n handleClick,\n };\n}\n"],"names":["useListboxItem","props","_context$state","_context$state$select","domElementRef","value","id","isDisabled","propsIsSelected","tabIndex","isFocused","handleKeyDown","handleFocusKeyDown","handleClick","handleFocusClick","useFocusOnListItem","context","useContext","ListboxContext","useCallback","event","code","state","selectionMode","dispatch","type","ListboxActionType","TOGGLE","payload","activedescendant","SET","values","isSelected","selectedValues","find","selectedValue","undefined","useEffect","current","_current","focus"],"mappings":";;;;;AAKO,SAASA,cAAcA,CAACC,KAM9B,EAAuB;EAAA,IAAAC,cAAA,EAAAC,qBAAA,CAAA;EACtB,MAAM;IAAEC,aAAa;IAAEC,KAAK;IAAEC,EAAE;IAAEC,UAAU;AAAEC,IAAAA,eAAAA;AAAgB,GAAC,GAAGP,KAAK,CAAA;EAEvE,MAAM;IACJQ,QAAQ;IACRC,SAAS;AACTC,IAAA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AAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAA9DA,QAAA,CAAgEC,KAAK,EAAE,CAAA;AACzE,KAAA;AACF,GAAC,EAAE,CAAC9B,SAAS,CAAC,CAAC,CAAA;EAEf,OAAO;IACLD,QAAQ;IACRC,SAAS;IACTsB,UAAU;IACVzB,UAAU;IACVI,aAAa;AACbE,IAAAA,WAAAA;GACD,CAAA;AACH;;;;"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { StyledNumber } from './styles.js';
|
|
5
|
+
import { useNumberFormatter } from '../../react-aria/react-aria/i18n/useNumberFormatter.js';
|
|
6
|
+
import { useTheme } from '../theme/useTheme.js';
|
|
7
|
+
|
|
8
|
+
const _excluded = ["as", "className", "color", "compactDisplay", "currency", "currencyDisplay", "currencySign", "fontSize", "fontFamily", "fontWeight", "lineHeight", "localeMatcher", "maximumFractionDigits", "maximumSignificantDigits", "minimumFractionDigits", "minimumIntegerDigits", "minimumSignificantDigits", "notation", "noWrap", "numberingSystem", "roundingIncrement", "roundingMode", "roundingPriority", "signDisplay", "theme", "trailingZeroDisplay", "type", "unit", "unitDisplay", "useGrouping", "value", "variant"];
|
|
9
|
+
const COMPONENT_NAME = 'Number';
|
|
10
|
+
const CLASSNAME = 'redsift-number';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The Number component.
|
|
14
|
+
*/
|
|
15
|
+
const Number = /*#__PURE__*/forwardRef((props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
as,
|
|
18
|
+
className,
|
|
19
|
+
color,
|
|
20
|
+
compactDisplay = 'short',
|
|
21
|
+
currency,
|
|
22
|
+
currencyDisplay = 'symbol',
|
|
23
|
+
currencySign = 'standard',
|
|
24
|
+
fontSize,
|
|
25
|
+
fontFamily,
|
|
26
|
+
fontWeight,
|
|
27
|
+
lineHeight,
|
|
28
|
+
localeMatcher = 'best fit',
|
|
29
|
+
maximumFractionDigits,
|
|
30
|
+
maximumSignificantDigits,
|
|
31
|
+
minimumFractionDigits,
|
|
32
|
+
minimumIntegerDigits,
|
|
33
|
+
minimumSignificantDigits,
|
|
34
|
+
notation = 'standard',
|
|
35
|
+
noWrap,
|
|
36
|
+
numberingSystem,
|
|
37
|
+
roundingIncrement,
|
|
38
|
+
roundingMode = 'halfExpand',
|
|
39
|
+
roundingPriority = 'auto',
|
|
40
|
+
signDisplay = 'auto',
|
|
41
|
+
theme: propsTheme,
|
|
42
|
+
trailingZeroDisplay = 'auto',
|
|
43
|
+
type = 'decimal',
|
|
44
|
+
unit,
|
|
45
|
+
unitDisplay = 'short',
|
|
46
|
+
useGrouping,
|
|
47
|
+
value,
|
|
48
|
+
variant
|
|
49
|
+
} = props,
|
|
50
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
51
|
+
const formatter = useNumberFormatter(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
52
|
+
compactDisplay,
|
|
53
|
+
currency,
|
|
54
|
+
currencyDisplay,
|
|
55
|
+
currencySign,
|
|
56
|
+
localeMatcher
|
|
57
|
+
}, maximumFractionDigits !== undefined && {
|
|
58
|
+
maximumFractionDigits
|
|
59
|
+
}), maximumSignificantDigits !== undefined && {
|
|
60
|
+
maximumSignificantDigits
|
|
61
|
+
}), minimumFractionDigits !== undefined && {
|
|
62
|
+
minimumFractionDigits
|
|
63
|
+
}), minimumIntegerDigits !== undefined && {
|
|
64
|
+
minimumIntegerDigits
|
|
65
|
+
}), minimumSignificantDigits !== undefined && {
|
|
66
|
+
minimumSignificantDigits
|
|
67
|
+
}), {}, {
|
|
68
|
+
notation,
|
|
69
|
+
numberingSystem,
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
roundingIncrement,
|
|
72
|
+
// @ts-ignore
|
|
73
|
+
roundingMode,
|
|
74
|
+
// @ts-ignore
|
|
75
|
+
roundingPriority,
|
|
76
|
+
signDisplay,
|
|
77
|
+
style: type,
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
trailingZeroDisplay,
|
|
80
|
+
unit,
|
|
81
|
+
unitDisplay,
|
|
82
|
+
useGrouping
|
|
83
|
+
}));
|
|
84
|
+
const theme = useTheme(propsTheme);
|
|
85
|
+
return /*#__PURE__*/React__default.createElement(StyledNumber, _extends({
|
|
86
|
+
as: as
|
|
87
|
+
}, forwardedProps, {
|
|
88
|
+
$as: as,
|
|
89
|
+
className: classNames(Number.className, className),
|
|
90
|
+
ref: ref,
|
|
91
|
+
$color: color,
|
|
92
|
+
$lineHeight: lineHeight,
|
|
93
|
+
$fontSize: fontSize,
|
|
94
|
+
$fontFamily: fontFamily,
|
|
95
|
+
$fontWeight: fontWeight,
|
|
96
|
+
$noWrap: noWrap,
|
|
97
|
+
$theme: theme,
|
|
98
|
+
$variant: variant
|
|
99
|
+
}), formatter.format(value));
|
|
100
|
+
});
|
|
101
|
+
Number.className = CLASSNAME;
|
|
102
|
+
Number.displayName = COMPONENT_NAME;
|
|
103
|
+
|
|
104
|
+
export { Number };
|
|
105
|
+
//# sourceMappingURL=Number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Number.js","sources":["../../../src/components/number/Number.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport { useNumberFormatter } from '../../react-aria/react-aria/i18n';\nimport classNames from 'classnames';\nimport { Comp } from '../../types';\nimport { StyledNumber } from './styles';\nimport { NumberProps } from './types';\nimport { useTheme } from '../theme';\n\nconst COMPONENT_NAME = 'Number';\nconst CLASSNAME = 'redsift-number';\n\n/**\n * The Number component.\n */\nexport const Number: Comp<NumberProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n as,\n className,\n color,\n compactDisplay = 'short',\n currency,\n currencyDisplay = 'symbol',\n currencySign = 'standard',\n fontSize,\n fontFamily,\n fontWeight,\n lineHeight,\n localeMatcher = 'best fit',\n maximumFractionDigits,\n maximumSignificantDigits,\n minimumFractionDigits,\n minimumIntegerDigits,\n minimumSignificantDigits,\n notation = 'standard',\n noWrap,\n numberingSystem,\n roundingIncrement,\n roundingMode = 'halfExpand',\n roundingPriority = 'auto',\n signDisplay = 'auto',\n theme: propsTheme,\n trailingZeroDisplay = 'auto',\n type = 'decimal',\n unit,\n unitDisplay = 'short',\n useGrouping,\n value,\n variant,\n ...forwardedProps\n } = props;\n const formatter = useNumberFormatter({\n compactDisplay,\n currency,\n currencyDisplay,\n currencySign,\n localeMatcher,\n ...(maximumFractionDigits !== undefined && { maximumFractionDigits }),\n ...(maximumSignificantDigits !== undefined && {\n maximumSignificantDigits,\n }),\n ...(minimumFractionDigits !== undefined && { minimumFractionDigits }),\n ...(minimumIntegerDigits !== undefined && { minimumIntegerDigits }),\n ...(minimumSignificantDigits !== undefined && {\n minimumSignificantDigits,\n }),\n notation,\n numberingSystem,\n // @ts-ignore\n roundingIncrement,\n // @ts-ignore\n roundingMode,\n // @ts-ignore\n roundingPriority,\n signDisplay,\n style: type,\n // @ts-ignore\n trailingZeroDisplay,\n unit,\n unitDisplay,\n useGrouping,\n });\n\n const theme = useTheme(propsTheme);\n\n return (\n <StyledNumber\n as={as}\n {...forwardedProps}\n $as={as}\n className={classNames(Number.className, className)}\n ref={ref as RefObject<HTMLDivElement>}\n $color={color}\n $lineHeight={lineHeight}\n $fontSize={fontSize}\n $fontFamily={fontFamily}\n $fontWeight={fontWeight}\n $noWrap={noWrap}\n $theme={theme}\n $variant={variant}\n >\n {formatter.format(value)}\n </StyledNumber>\n );\n});\nNumber.className = CLASSNAME;\nNumber.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","Number","forwardRef","props","ref","as","className","color","compactDisplay","currency","currencyDisplay","currencySign","fontSize","fontFamily","fontWeight","lineHeight","localeMatcher","maximumFractionDigits","maximumSignificantDigits","minimumFractionDigits","minimumIntegerDigits","minimumSignificantDigits","notation","noWrap","numberingSystem","roundingIncrement","roundingMode","roundingPriority","signDisplay","theme","propsTheme","trailingZeroDisplay","type","unit","unitDisplay","useGrouping","value","variant","forwardedProps","_objectWithoutProperties","_excluded","formatter","useNumberFormatter","_objectSpread","undefined","style","useTheme","React","createElement","StyledNumber","_extends","$as","classNames","$color","$lineHeight","$fontSize","$fontFamily","$fontWeight","$noWrap","$theme","$variant","format","displayName"],"mappings":";;;;;;;;AAQA,MAAMA,cAAc,GAAG,QAAQ,CAAA;AAC/B,MAAMC,SAAS,GAAG,gBAAgB,CAAA;;AAElC;AACA;AACA;AACO,MAAMC,MAAyC,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAClF,MAAM;MACJC,EAAE;MACFC,SAAS;MACTC,KAAK;AACLC,MAAAA,cAAc,GAAG,OAAO;MACxBC,QAAQ;AACRC,MAAAA,eAAe,GAAG,QAAQ;AAC1BC,MAAAA,YAAY,GAAG,UAAU;MACzBC,QAAQ;MACRC,UAAU;MACVC,UAAU;MACVC,UAAU;AACVC,MAAAA,aAAa,GAAG,UAAU;MAC1BC,qBAAqB;MACrBC,wBAAwB;MACxBC,qBAAqB;MACrBC,oBAAoB;MACpBC,wBAAwB;AACxBC,MAAAA,QAAQ,GAAG,UAAU;MACrBC,MAAM;MACNC,eAAe;MACfC,iBAAiB;AACjBC,MAAAA,YAAY,GAAG,YAAY;AAC3BC,MAAAA,gBAAgB,GAAG,MAAM;AACzBC,MAAAA,WAAW,GAAG,MAAM;AACpBC,MAAAA,KAAK,EAAEC,UAAU;AACjBC,MAAAA,mBAAmB,GAAG,MAAM;AAC5BC,MAAAA,IAAI,GAAG,SAAS;MAChBC,IAAI;AACJC,MAAAA,WAAW,GAAG,OAAO;MACrBC,WAAW;MACXC,KAAK;AACLC,MAAAA,OAAAA;AAEF,KAAC,GAAGlC,KAAK;AADJmC,IAAAA,cAAc,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AiC;AACtCiD,IAAAA,MAAM,EAAE9C,KAAM;AACd+C,IAAAA,WAAW,EAAEvC,UAAW;AACxBwC,IAAAA,SAAS,EAAE3C,QAAS;AACpB4C,IAAAA,WAAW,EAAE3C,UAAW;AACxB4C,IAAAA,WAAW,EAAE3C,UAAW;AACxB4C,IAAAA,OAAO,EAAEnC,MAAO;AAChBoC,IAAAA,MAAM,EAAE9B,KAAM;AACd+B,IAAAA,QAAQ,EAAEvB,OAAAA;AAAQ,GAAA,CAAA,EAEjBI,SAAS,CAACoB,MAAM,CAACzB,KAAK,CACX,CAAC,CAAA;AAEnB,CAAC,EAAC;AACFnC,MAAM,CAACK,SAAS,GAAGN,SAAS,CAAA;AAC5BC,MAAM,CAAC6D,WAAW,GAAG/D,cAAc;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../src/components/number/styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { StyledText } from '../text/styles';\nimport { StyledNumberProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledNumber = styled(StyledText)<StyledNumberProps>``;\n"],"names":["StyledNumber","styled","StyledText"],"mappings":";;;AAIA;AACA;AACA;MACaA,YAAY,GAAGC,MAAM,CAACC,UAAU,CAAqB,CAAC;;;;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { TextProps } from '../text/types.js';
|
|
2
|
+
|
|
3
|
+
interface NumberFormatOptions {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Component props.
|
|
7
|
+
*/
|
|
8
|
+
interface NumberProps extends TextProps {
|
|
9
|
+
/** Value. */
|
|
10
|
+
value: number;
|
|
11
|
+
/** The formatting style to use. */
|
|
12
|
+
type?: 'decimal' | 'currency' | 'percent' | 'unit';
|
|
13
|
+
/** Only used when notation is 'compact'. */
|
|
14
|
+
compactDisplay?: 'short' | 'long';
|
|
15
|
+
/** The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as "USD" for the US dollar, "EUR" for the euro, or "CNY" for the Chinese RMB */
|
|
16
|
+
currency?: string;
|
|
17
|
+
/** How to display the currency in currency formatting. */
|
|
18
|
+
currencyDisplay?: 'symbol' | 'narrowSymbol' | 'code' | 'name';
|
|
19
|
+
/** In many locales, accounting format means to wrap the number with parentheses instead of appending a minus sign. */
|
|
20
|
+
currencySign?: 'standard' | 'accounting';
|
|
21
|
+
/** The locale matching algorithm to use. */
|
|
22
|
+
localeMatcher?: 'best fit' | 'lookup';
|
|
23
|
+
/** The formatting that should be displayed for the number. */
|
|
24
|
+
notation?: 'standard' | 'scientific' | 'engineering' | 'compact';
|
|
25
|
+
/** Overrides default numbering system for the current locale. */
|
|
26
|
+
numberingSystem?: string;
|
|
27
|
+
/** When to display the sign for the number. */
|
|
28
|
+
signDisplay?: 'auto' | 'always' | 'exceptZero' | 'never';
|
|
29
|
+
/** The unit to use in unit formatting. */
|
|
30
|
+
unit?: string;
|
|
31
|
+
/** The unit formatting style to use in unit formatting. */
|
|
32
|
+
unitDisplay?: 'long' | 'short' | 'narrow';
|
|
33
|
+
/** Whether to use grouping separators. */
|
|
34
|
+
useGrouping?: boolean;
|
|
35
|
+
/** Options for rounding modes. */
|
|
36
|
+
roundingMode?: 'ceil' | 'floor' | 'expand' | 'trunc' | 'halfCeil' | 'halfFloor' | 'halfExpand' | 'halfTrunc' | 'halfEven';
|
|
37
|
+
/** Specify how rounding conflicts will be resolved. */
|
|
38
|
+
roundingPriority?: 'auto' | 'morePrecision' | 'lessPrecision';
|
|
39
|
+
/** Specifies the rounding-increment precision. */
|
|
40
|
+
roundingIncrement?: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000;
|
|
41
|
+
/** A string expressing the strategy for displaying trailing zeros on whole numbers. */
|
|
42
|
+
trailingZeroDisplay?: 'auto' | 'stripIfInteger';
|
|
43
|
+
/** The minimum number of integer digits to use. A value with a smaller number of integer digits than this number will be left-padded with zeros (to the specified length) when formatted. */
|
|
44
|
+
minimumIntegerDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
|
|
45
|
+
/** The minimum number of fraction digits to use. */
|
|
46
|
+
minimumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
47
|
+
/** The maximum number of fraction digits to use. */
|
|
48
|
+
maximumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
49
|
+
/** The minimum number of significant digits to use. */
|
|
50
|
+
minimumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
|
|
51
|
+
/** The maximum number of significant digits to use. */
|
|
52
|
+
maximumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
|
|
53
|
+
}
|
|
54
|
+
type StyledNumberProps = Omit<NumberProps, 'as' | 'color' | 'fontFamily' | 'fontSize' | 'value' | 'variant'> & {
|
|
55
|
+
$color: NumberProps['color'];
|
|
56
|
+
$fontFamily: NumberProps['fontFamily'];
|
|
57
|
+
$fontSize: NumberProps['fontSize'];
|
|
58
|
+
$fontWeight: NumberProps['fontWeight'];
|
|
59
|
+
$variant: NumberProps['variant'];
|
|
60
|
+
$theme: NumberProps['theme'];
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export { NumberFormatOptions, NumberProps, StyledNumberProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NumberFieldProps } from './types.js';
|
|
2
|
+
import { Comp } from '../../types/helpers.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The NumberField component.
|
|
6
|
+
* Can be used as controlled or uncontrolled.
|
|
7
|
+
*/
|
|
8
|
+
declare const NumberField: Comp<NumberFieldProps, HTMLDivElement>;
|
|
9
|
+
|
|
10
|
+
export { NumberField };
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default, { forwardRef, useRef, useState } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound.js';
|
|
5
|
+
import { NumberFieldVariant } from './types.js';
|
|
6
|
+
import { StyledNumberField } from './styles.js';
|
|
7
|
+
import { mdiMenuUp, mdiMenuDown } from '@redsift/icons';
|
|
8
|
+
import { StyledIconButton } from '../icon-button/styles.js';
|
|
9
|
+
import { useLocale } from '../../react-aria/react-aria/i18n/context.js';
|
|
10
|
+
import { useNumberFieldState } from '../../react-aria/react-stately/numberfield/useNumberFieldState.js';
|
|
11
|
+
import { useNumberField } from '../../react-aria/react-aria/numberfield/useNumberField.js';
|
|
12
|
+
import { useButton } from '../../react-aria/react-aria/button/useButton.js';
|
|
13
|
+
import { useFocusRing } from '../../react-aria/react-aria/focus/useFocusRing.js';
|
|
14
|
+
import { useFocusWithin } from '../../react-aria/react-aria/interactions/useFocusWithin.js';
|
|
15
|
+
import { useTheme } from '../theme/useTheme.js';
|
|
16
|
+
import { Icon } from '../icon/Icon.js';
|
|
17
|
+
import { Flexbox } from '../flexbox/Flexbox.js';
|
|
18
|
+
|
|
19
|
+
const _excluded = ["autoFocus", "className", "decrementAriaLabel", "defaultValue", "formatOptions", "id", "incrementAriaLabel", "inputProps", "inputRef", "isColored", "isDisabled", "isInvalid", "isReadOnly", "isRequired", "isWheelDisabled", "label", "leftIcon", "maxValue", "minValue", "onBlur", "onChange", "onFocus", "onFocusChange", "onKeyDown", "onKeyUp", "placeholder", "step", "theme", "value", "variant"];
|
|
20
|
+
const COMPONENT_NAME = 'NumberField';
|
|
21
|
+
const CLASSNAME = 'redsift-number-field';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The NumberField component.
|
|
25
|
+
* Can be used as controlled or uncontrolled.
|
|
26
|
+
*/
|
|
27
|
+
const NumberField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
28
|
+
const {
|
|
29
|
+
autoFocus,
|
|
30
|
+
className,
|
|
31
|
+
decrementAriaLabel,
|
|
32
|
+
defaultValue,
|
|
33
|
+
formatOptions,
|
|
34
|
+
id,
|
|
35
|
+
incrementAriaLabel,
|
|
36
|
+
inputProps: propsInputProps,
|
|
37
|
+
inputRef: propsInputRef,
|
|
38
|
+
isColored = true,
|
|
39
|
+
isDisabled,
|
|
40
|
+
isInvalid,
|
|
41
|
+
isReadOnly,
|
|
42
|
+
isRequired,
|
|
43
|
+
isWheelDisabled,
|
|
44
|
+
label,
|
|
45
|
+
leftIcon,
|
|
46
|
+
maxValue,
|
|
47
|
+
minValue,
|
|
48
|
+
onBlur: onBlurProps,
|
|
49
|
+
onChange: propsOnChange,
|
|
50
|
+
onFocus: onFocusProps,
|
|
51
|
+
onFocusChange,
|
|
52
|
+
onKeyDown,
|
|
53
|
+
onKeyUp,
|
|
54
|
+
placeholder,
|
|
55
|
+
step,
|
|
56
|
+
theme: propsTheme,
|
|
57
|
+
value,
|
|
58
|
+
variant = NumberFieldVariant.default
|
|
59
|
+
} = props,
|
|
60
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
61
|
+
const numberFieldProps = {
|
|
62
|
+
id,
|
|
63
|
+
isDisabled,
|
|
64
|
+
isReadOnly,
|
|
65
|
+
isRequired,
|
|
66
|
+
minValue,
|
|
67
|
+
maxValue,
|
|
68
|
+
step,
|
|
69
|
+
autoFocus,
|
|
70
|
+
label,
|
|
71
|
+
formatOptions,
|
|
72
|
+
onBlur: onBlurProps,
|
|
73
|
+
onFocus: onFocusProps,
|
|
74
|
+
onFocusChange,
|
|
75
|
+
onKeyDown,
|
|
76
|
+
onKeyUp,
|
|
77
|
+
value,
|
|
78
|
+
defaultValue,
|
|
79
|
+
onChange: propsOnChange
|
|
80
|
+
};
|
|
81
|
+
const theme = useTheme(propsTheme);
|
|
82
|
+
const {
|
|
83
|
+
locale
|
|
84
|
+
} = useLocale();
|
|
85
|
+
const state = useNumberFieldState(_objectSpread2({
|
|
86
|
+
locale
|
|
87
|
+
}, numberFieldProps));
|
|
88
|
+
const _inputRef = React__default.useRef(null);
|
|
89
|
+
const inputRef = propsInputRef !== null && propsInputRef !== void 0 ? propsInputRef : _inputRef;
|
|
90
|
+
const {
|
|
91
|
+
labelProps,
|
|
92
|
+
groupProps,
|
|
93
|
+
inputProps,
|
|
94
|
+
incrementButtonProps,
|
|
95
|
+
decrementButtonProps
|
|
96
|
+
} = useNumberField(_objectSpread2({
|
|
97
|
+
decrementAriaLabel,
|
|
98
|
+
incrementAriaLabel,
|
|
99
|
+
isWheelDisabled
|
|
100
|
+
}, numberFieldProps), state, inputRef);
|
|
101
|
+
const incrementButtonRef = useRef(null);
|
|
102
|
+
const {
|
|
103
|
+
buttonProps: incrementButtonForwardedProps
|
|
104
|
+
} = useButton(incrementButtonProps, incrementButtonRef);
|
|
105
|
+
const decrementButtonRef = useRef(null);
|
|
106
|
+
const {
|
|
107
|
+
buttonProps: decrementButtonForwardedProps
|
|
108
|
+
} = useButton(decrementButtonProps, decrementButtonRef);
|
|
109
|
+
const {
|
|
110
|
+
isFocusVisible,
|
|
111
|
+
isFocused,
|
|
112
|
+
focusProps: {
|
|
113
|
+
onFocus,
|
|
114
|
+
onBlur
|
|
115
|
+
}
|
|
116
|
+
} = useFocusRing({
|
|
117
|
+
autoFocus
|
|
118
|
+
});
|
|
119
|
+
const [isFocusWithin, setFocusWithin] = useState(Boolean(autoFocus));
|
|
120
|
+
const {
|
|
121
|
+
focusWithinProps
|
|
122
|
+
} = useFocusWithin({
|
|
123
|
+
onFocusWithinChange: isFocusWithin => setFocusWithin(isFocusWithin)
|
|
124
|
+
});
|
|
125
|
+
warnIfNoAccessibleLabelFound(props, [label], 'NumberField');
|
|
126
|
+
return /*#__PURE__*/React__default.createElement(StyledNumberField, _extends({}, forwardedProps, focusWithinProps, {
|
|
127
|
+
$hasContent: isFocusWithin || Boolean(inputProps.value !== undefined && inputProps.value !== '') || Boolean(placeholder),
|
|
128
|
+
$hasLeftIcon: Boolean(leftIcon),
|
|
129
|
+
$isColored: isColored,
|
|
130
|
+
$isDisabled: isDisabled,
|
|
131
|
+
$isFocusVisible: isFocusVisible,
|
|
132
|
+
$isInvalid: isInvalid || isRequired && !(inputProps.value !== undefined),
|
|
133
|
+
$isRequired: isRequired,
|
|
134
|
+
$isFocused: isFocused,
|
|
135
|
+
$theme: theme,
|
|
136
|
+
$variant: variant,
|
|
137
|
+
className: classNames(NumberField.className, className),
|
|
138
|
+
ref: ref
|
|
139
|
+
}), label ? /*#__PURE__*/React__default.createElement("label", _extends({}, labelProps, {
|
|
140
|
+
className: `${NumberField.className}__label`
|
|
141
|
+
}), /*#__PURE__*/React__default.createElement("span", null, label)) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
142
|
+
className: `${NumberField.className}__input-wrapper`
|
|
143
|
+
}, leftIcon ? /*#__PURE__*/React__default.createElement(Icon, _extends({
|
|
144
|
+
color: isDisabled ? 'question' : 'black'
|
|
145
|
+
}, leftIcon, {
|
|
146
|
+
"aria-hidden": "true",
|
|
147
|
+
className: "left"
|
|
148
|
+
})) : null, /*#__PURE__*/React__default.createElement(Flexbox, _extends({}, groupProps, {
|
|
149
|
+
flexDirection: "row",
|
|
150
|
+
gap: "0",
|
|
151
|
+
width: "100%"
|
|
152
|
+
}), /*#__PURE__*/React__default.createElement("input", _extends({}, propsInputProps, inputProps, {
|
|
153
|
+
onChange: event => {
|
|
154
|
+
if (propsOnChange) {
|
|
155
|
+
propsOnChange(Number(event.target.value));
|
|
156
|
+
} else {
|
|
157
|
+
var _inputProps$onChange;
|
|
158
|
+
(_inputProps$onChange = inputProps.onChange) === null || _inputProps$onChange === void 0 ? void 0 : _inputProps$onChange.call(inputProps, event);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
onBlur: event => {
|
|
162
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
163
|
+
onBlurProps === null || onBlurProps === void 0 ? void 0 : onBlurProps(event);
|
|
164
|
+
},
|
|
165
|
+
onFocus: event => {
|
|
166
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
167
|
+
onFocusProps === null || onFocusProps === void 0 ? void 0 : onFocusProps(event);
|
|
168
|
+
},
|
|
169
|
+
placeholder: placeholder ? `${placeholder}` : undefined,
|
|
170
|
+
className: `${NumberField.className}-input-wrapper__input`,
|
|
171
|
+
ref: inputRef,
|
|
172
|
+
width: "100%"
|
|
173
|
+
})), /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
174
|
+
className: `${NumberField.className}-input-wrapper__toolbar`,
|
|
175
|
+
flexDirection: "column",
|
|
176
|
+
gap: "0"
|
|
177
|
+
}, /*#__PURE__*/React__default.createElement(StyledIconButton, _extends({
|
|
178
|
+
$color: "grey",
|
|
179
|
+
$isActive: false,
|
|
180
|
+
$isDisabled: isDisabled,
|
|
181
|
+
$isGradient: false,
|
|
182
|
+
$isHovered: false,
|
|
183
|
+
$isLoading: false,
|
|
184
|
+
$variant: variant === NumberFieldVariant.underline ? 'unstyled' : 'secondary',
|
|
185
|
+
$theme: theme
|
|
186
|
+
}, incrementButtonForwardedProps, {
|
|
187
|
+
className: `${NumberField.className}-input-wrapper-toolbar__increment-button`
|
|
188
|
+
}), /*#__PURE__*/React__default.createElement(Icon, {
|
|
189
|
+
icon: mdiMenuUp,
|
|
190
|
+
color: isDisabled ? undefined : 'grey'
|
|
191
|
+
})), /*#__PURE__*/React__default.createElement(StyledIconButton, _extends({
|
|
192
|
+
$color: "grey",
|
|
193
|
+
$isActive: false,
|
|
194
|
+
$isDisabled: isDisabled,
|
|
195
|
+
$isGradient: false,
|
|
196
|
+
$isHovered: false,
|
|
197
|
+
$isLoading: false,
|
|
198
|
+
$variant: variant === NumberFieldVariant.underline ? 'unstyled' : 'secondary',
|
|
199
|
+
$theme: theme
|
|
200
|
+
}, decrementButtonForwardedProps, {
|
|
201
|
+
className: `${NumberField.className}-input-wrapper-toolbar__decrement-button`
|
|
202
|
+
}), /*#__PURE__*/React__default.createElement(Icon, {
|
|
203
|
+
icon: mdiMenuDown,
|
|
204
|
+
color: isDisabled ? undefined : 'grey'
|
|
205
|
+
})))), /*#__PURE__*/React__default.createElement("fieldset", {
|
|
206
|
+
"aria-hidden": "true",
|
|
207
|
+
className: `${NumberField.className}-input-wrapper__fieldset`
|
|
208
|
+
}, /*#__PURE__*/React__default.createElement("legend", {
|
|
209
|
+
className: `${NumberField.className}-input-wrapper-fieldset__legend`
|
|
210
|
+
}, label ? /*#__PURE__*/React__default.createElement("span", null, label) : null))));
|
|
211
|
+
});
|
|
212
|
+
NumberField.className = CLASSNAME;
|
|
213
|
+
NumberField.displayName = COMPONENT_NAME;
|
|
214
|
+
|
|
215
|
+
export { NumberField };
|
|
216
|
+
//# sourceMappingURL=NumberField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberField.js","sources":["../../../src/components/number-field/NumberField.tsx"],"sourcesContent":["import React, { ComponentProps, forwardRef, MutableRefObject, useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport { useFocusRing } from '../../react-aria/react-aria/focus';\nimport { useFocusWithin } from '../../react-aria/react-aria/interactions';\nimport { useNumberFieldState } from '../../react-aria/react-stately/numberfield';\nimport { useNumberField } from '../../react-aria/react-aria/numberfield';\nimport { useButton } from '../../react-aria/react-aria/button';\nimport { Comp } from '../../types';\nimport { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound';\nimport { NumberFieldProps, NumberFieldVariant } from './types';\nimport { StyledNumberField } from './styles';\nimport { Icon } from '../../components/icon';\nimport { mdiMenuDown, mdiMenuUp } from '@redsift/icons';\nimport { Flexbox } from '../flexbox';\nimport { useTheme } from '../theme';\nimport { StyledIconButton } from '../icon-button/styles';\nimport { useLocale } from '../../react-aria/react-aria/i18n';\n\nconst COMPONENT_NAME = 'NumberField';\nconst CLASSNAME = 'redsift-number-field';\n\n/**\n * The NumberField component.\n * Can be used as controlled or uncontrolled.\n */\nexport const NumberField: Comp<NumberFieldProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n autoFocus,\n className,\n decrementAriaLabel,\n defaultValue,\n formatOptions,\n id,\n incrementAriaLabel,\n inputProps: propsInputProps,\n inputRef: propsInputRef,\n isColored = true,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n isWheelDisabled,\n label,\n leftIcon,\n maxValue,\n minValue,\n onBlur: onBlurProps,\n onChange: propsOnChange,\n onFocus: onFocusProps,\n onFocusChange,\n onKeyDown,\n onKeyUp,\n placeholder,\n step,\n theme: propsTheme,\n value,\n variant = NumberFieldVariant.default,\n ...forwardedProps\n } = props;\n\n const numberFieldProps = {\n id,\n isDisabled,\n isReadOnly,\n isRequired,\n minValue,\n maxValue,\n step,\n autoFocus,\n label,\n formatOptions,\n onBlur: onBlurProps,\n onFocus: onFocusProps,\n onFocusChange,\n onKeyDown,\n onKeyUp,\n value,\n defaultValue,\n onChange: propsOnChange,\n };\n\n const theme = useTheme(propsTheme);\n\n const { locale } = useLocale();\n const state = useNumberFieldState({ locale, ...numberFieldProps });\n const _inputRef = React.useRef(null);\n const inputRef = propsInputRef ?? _inputRef;\n const { labelProps, groupProps, inputProps, incrementButtonProps, decrementButtonProps } = useNumberField(\n {\n decrementAriaLabel,\n incrementAriaLabel,\n isWheelDisabled,\n ...numberFieldProps,\n },\n state,\n inputRef\n );\n\n const incrementButtonRef = useRef<HTMLButtonElement>(null);\n const { buttonProps: incrementButtonForwardedProps } = useButton(incrementButtonProps, incrementButtonRef);\n const decrementButtonRef = useRef<HTMLButtonElement>(null);\n const { buttonProps: decrementButtonForwardedProps } = useButton(decrementButtonProps, decrementButtonRef);\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 warnIfNoAccessibleLabelFound(props as ComponentProps<'label'>, [label], 'NumberField');\n\n return (\n <StyledNumberField\n {...forwardedProps}\n {...focusWithinProps}\n $hasContent={\n isFocusWithin || Boolean(inputProps.value !== undefined && inputProps.value !== '') || Boolean(placeholder)\n }\n $hasLeftIcon={Boolean(leftIcon)}\n $isColored={isColored}\n $isDisabled={isDisabled}\n $isFocusVisible={isFocusVisible}\n $isInvalid={isInvalid || (isRequired && !(inputProps.value !== undefined))}\n $isRequired={isRequired}\n $isFocused={isFocused}\n $theme={theme}\n $variant={variant}\n className={classNames(NumberField.className, className)}\n ref={ref as MutableRefObject<HTMLDivElement>}\n >\n {label ? (\n <label {...labelProps} className={`${NumberField.className}__label`}>\n <span>{label}</span>\n </label>\n ) : null}\n <div className={`${NumberField.className}__input-wrapper`}>\n {leftIcon ? (\n <Icon color={isDisabled ? 'question' : 'black'} {...leftIcon} aria-hidden=\"true\" className=\"left\" />\n ) : null}\n <Flexbox {...groupProps} flexDirection=\"row\" gap=\"0\" width=\"100%\">\n <input\n {...propsInputProps}\n {...inputProps}\n onChange={(event) => {\n if (propsOnChange) {\n propsOnChange(Number(event.target.value));\n } else {\n inputProps.onChange?.(event);\n }\n }}\n onBlur={(event) => {\n onBlur?.(event);\n onBlurProps?.(event);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n onFocusProps?.(event);\n }}\n placeholder={placeholder ? `${placeholder}` : undefined}\n className={`${NumberField.className}-input-wrapper__input`}\n ref={inputRef as MutableRefObject<HTMLInputElement>}\n width=\"100%\"\n />\n <Flexbox className={`${NumberField.className}-input-wrapper__toolbar`} flexDirection=\"column\" gap=\"0\">\n <StyledIconButton\n $color=\"grey\"\n $isActive={false}\n $isDisabled={isDisabled}\n $isGradient={false}\n $isHovered={false}\n $isLoading={false}\n $variant={variant === NumberFieldVariant.underline ? 'unstyled' : 'secondary'}\n $theme={theme}\n {...incrementButtonForwardedProps}\n className={`${NumberField.className}-input-wrapper-toolbar__increment-button`}\n >\n <Icon icon={mdiMenuUp} color={isDisabled ? undefined : 'grey'} />\n </StyledIconButton>\n <StyledIconButton\n $color=\"grey\"\n $isActive={false}\n $isDisabled={isDisabled}\n $isGradient={false}\n $isHovered={false}\n $isLoading={false}\n $variant={variant === NumberFieldVariant.underline ? 'unstyled' : 'secondary'}\n $theme={theme}\n {...decrementButtonForwardedProps}\n className={`${NumberField.className}-input-wrapper-toolbar__decrement-button`}\n >\n <Icon icon={mdiMenuDown} color={isDisabled ? undefined : 'grey'} />\n </StyledIconButton>\n </Flexbox>\n </Flexbox>\n <fieldset aria-hidden=\"true\" className={`${NumberField.className}-input-wrapper__fieldset`}>\n <legend className={`${NumberField.className}-input-wrapper-fieldset__legend`}>\n {label ? <span>{label}</span> : null}\n </legend>\n </fieldset>\n </div>\n </StyledNumberField>\n );\n});\nNumberField.className = CLASSNAME;\nNumberField.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","NumberField","forwardRef","props","ref","autoFocus","className","decrementAriaLabel","defaultValue","formatOptions","id","incrementAriaLabel","inputProps","propsInputProps","inputRef","propsInputRef","isColored","isDisabled","isInvalid","isReadOnly","isRequired","isWheelDisabled","label","leftIcon","maxValue","minValue","onBlur","onBlurProps","onChange","propsOnChange","onFocus","onFocusProps","onFocusChange","onKeyDown","onKeyUp","placeholder","step","theme","propsTheme","value","variant","NumberFieldVariant","default","forwardedProps","_objectWithoutProperties","_excluded","numberFieldProps","useTheme","locale","useLocale","state","useNumberFieldState","_objectSpread","_inputRef","React","useRef","labelProps","groupProps","incrementButtonProps","decrementButtonProps","useNumberField","incrementButtonRef","buttonProps","incrementButtonForwardedProps","useButton","decrementButtonRef","decrementButtonForwardedProps","isFocusVisible","isFocused","focusProps","useFocusRing","isFocusWithin","setFocusWithin","useState","Boolean","focusWithinProps","useFocusWithin","onFocusWithinChange","warnIfNoAccessibleLabelFound","createElement","StyledNumberField","_extends","$hasContent","undefined","$hasLeftIcon","$isColored","$isDisabled","$isFocusVisible","$isInvalid","$isRequired","$isFocused","$theme","$variant","classNames","Icon","color","Flexbox","flexDirection","gap","width","event","Number","target","_inputProps$onChange","call","StyledIconButton","$color","$isActive","$isGradient","$isHovered","$isLoading","underline","icon","mdiMenuUp","mdiMenuDown","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,cAAc,GAAG,aAAa,CAAA;AACpC,MAAMC,SAAS,GAAG,sBAAsB,CAAA;;AAExC;AACA;AACA;AACA;AACO,MAAMC,WAAmD,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC5F,MAAM;MACJC,SAAS;MACTC,SAAS;MACTC,kBAAkB;MAClBC,YAAY;MACZC,aAAa;MACbC,EAAE;MACFC,kBAAkB;AAClBC,MAAAA,UAAU,EAAEC,eAAe;AAC3BC,MAAAA,QAAQ,EAAEC,aAAa;AACvBC,MAAAA,SAAS,GAAG,IAAI;MAChBC,UAAU;MACVC,SAAS;MACTC,UAAU;MACVC,UAAU;MACVC,eAAe;MACfC,KAAK;MACLC,QAAQ;MACRC,QAAQ;MACRC,QAAQ;AACRC,MAAAA,MAAM,EAAEC,WAAW;AACnBC,MAAAA,QAAQ,EAAEC,aAAa;AACvBC,MAAAA,OAAO,EAAEC,YAAY;MACrBC,aAAa;MACbC,SAAS;MACTC,OAAO;MACPC,WAAW;MACXC,IAAI;AACJC,MAAAA,KAAK,EAAEC,UAAU;MACjBC,KAAK;MACLC,OAAO,G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