@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,21 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useEffectEvent } from './useEffectEvent.js';
|
|
3
|
+
|
|
4
|
+
/* eslint-disable prefer-const */
|
|
5
|
+
function useEvent(ref, event, handler, options) {
|
|
6
|
+
let handleEvent = useEffectEvent(handler);
|
|
7
|
+
let isDisabled = handler == null;
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (isDisabled || !ref.current) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
let element = ref.current;
|
|
13
|
+
element.addEventListener(event, handleEvent, options);
|
|
14
|
+
return () => {
|
|
15
|
+
element.removeEventListener(event, handleEvent, options);
|
|
16
|
+
};
|
|
17
|
+
}, [ref, event, options, isDisabled, handleEvent]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { useEvent };
|
|
21
|
+
//# sourceMappingURL=useEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEvent.js","sources":["../../../../src/react-aria/react-aria/utils/useEvent.ts"],"sourcesContent":["/* eslint-disable prefer-const */\n// @ts-nocheck\n/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { RefObject, useEffect } from 'react';\nimport { useEffectEvent } from './useEffectEvent';\n\nexport function useEvent<K extends keyof GlobalEventHandlersEventMap>(\n ref: RefObject<EventTarget>,\n event: K | (string & {}),\n handler?: (this: Document, ev: GlobalEventHandlersEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n) {\n let handleEvent = useEffectEvent(handler);\n let isDisabled = handler == null;\n\n useEffect(() => {\n if (isDisabled || !ref.current) {\n return;\n }\n\n let element = ref.current;\n element.addEventListener(event, handleEvent as EventListener, options);\n return () => {\n element.removeEventListener(event, handleEvent as EventListener, options);\n };\n }, [ref, event, options, isDisabled, handleEvent]);\n}\n"],"names":["useEvent","ref","event","handler","options","handleEvent","useEffectEvent","isDisabled","useEffect","current","element","addEventListener","removeEventListener"],"mappings":";;;AAAA;AAiBO,SAASA,QAAQA,CACtBC,GAA2B,EAC3BC,KAAwB,EACxBC,OAAqE,EACrEC,OAA2C,EAC3C;AACA,EAAA,IAAIC,WAAW,GAAGC,cAAc,CAACH,OAAO,CAAC,CAAA;AACzC,EAAA,IAAII,UAAU,GAAGJ,OAAO,IAAI,IAAI,CAAA;AAEhCK,EAAAA,SAAS,CAAC,MAAM;AACd,IAAA,IAAID,UAAU,IAAI,CAACN,GAAG,CAACQ,OAAO,EAAE;AAC9B,MAAA,OAAA;AACF,KAAA;AAEA,IAAA,IAAIC,OAAO,GAAGT,GAAG,CAACQ,OAAO,CAAA;IACzBC,OAAO,CAACC,gBAAgB,CAACT,KAAK,EAAEG,WAAW,EAAmBD,OAAO,CAAC,CAAA;AACtE,IAAA,OAAO,MAAM;MACXM,OAAO,CAACE,mBAAmB,CAACV,KAAK,EAAEG,WAAW,EAAmBD,OAAO,CAAC,CAAA;KAC1E,CAAA;AACH,GAAC,EAAE,CAACH,GAAG,EAAEC,KAAK,EAAEE,OAAO,EAAEG,UAAU,EAAEF,WAAW,CAAC,CAAC,CAAA;AACpD;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
2
|
+
import { useEffectEvent } from './useEffectEvent.js';
|
|
3
|
+
|
|
4
|
+
/* eslint-disable prefer-const */
|
|
5
|
+
function useFormReset(ref, initialValue, onReset) {
|
|
6
|
+
let resetValue = useRef(initialValue);
|
|
7
|
+
let handleReset = useEffectEvent(() => {
|
|
8
|
+
if (onReset) {
|
|
9
|
+
onReset(resetValue.current);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
var _ref$current;
|
|
14
|
+
let form = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.form;
|
|
15
|
+
form === null || form === void 0 ? void 0 : form.addEventListener('reset', handleReset);
|
|
16
|
+
return () => {
|
|
17
|
+
form === null || form === void 0 ? void 0 : form.removeEventListener('reset', handleReset);
|
|
18
|
+
};
|
|
19
|
+
}, [ref, handleReset]);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { useFormReset };
|
|
23
|
+
//# sourceMappingURL=useFormReset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormReset.js","sources":["../../../../src/react-aria/react-aria/utils/useFormReset.ts"],"sourcesContent":["/* eslint-disable prefer-const */\n// @ts-nocheck\n/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { RefObject, useEffect, useRef } from 'react';\nimport { useEffectEvent } from './useEffectEvent';\n\nexport function useFormReset<T>(\n ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>,\n initialValue: T,\n onReset: (value: T) => void\n) {\n let resetValue = useRef(initialValue);\n let handleReset = useEffectEvent(() => {\n if (onReset) {\n onReset(resetValue.current);\n }\n });\n\n useEffect(() => {\n let form = ref?.current?.form;\n form?.addEventListener('reset', handleReset);\n return () => {\n form?.removeEventListener('reset', handleReset);\n };\n }, [ref, handleReset]);\n}\n"],"names":["useFormReset","ref","initialValue","onReset","resetValue","useRef","handleReset","useEffectEvent","current","useEffect","_ref$current","form","addEventListener","removeEventListener"],"mappings":";;;AAAA;AAgBO,SAASA,YAAYA,CAC1BC,GAA0E,EAC1EC,YAAe,EACfC,OAA2B,EAC3B;AACA,EAAA,IAAIC,UAAU,GAAGC,MAAM,CAACH,YAAY,CAAC,CAAA;AACrC,EAAA,IAAII,WAAW,GAAGC,cAAc,CAAC,MAAM;AACrC,IAAA,IAAIJ,OAAO,EAAE;AACXA,MAAAA,OAAO,CAACC,UAAU,CAACI,OAAO,CAAC,CAAA;AAC7B,KAAA;AACF,GAAC,CAAC,CAAA;AAEFC,EAAAA,SAAS,CAAC,MAAM;AAAA,IAAA,IAAAC,YAAA,CAAA;AACd,IAAA,IAAIC,IAAI,GAAGV,GAAG,KAAHA,IAAAA,IAAAA,GAAG,wBAAAS,YAAA,GAAHT,GAAG,CAAEO,OAAO,MAAAE,IAAAA,IAAAA,YAAA,KAAZA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,YAAA,CAAcC,IAAI,CAAA;IAC7BA,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAJA,IAAI,CAAEC,gBAAgB,CAAC,OAAO,EAAEN,WAAW,CAAC,CAAA;AAC5C,IAAA,OAAO,MAAM;MACXK,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAJA,IAAI,CAAEE,mBAAmB,CAAC,OAAO,EAAEP,WAAW,CAAC,CAAA;KAChD,CAAA;AACH,GAAC,EAAE,CAACL,GAAG,EAAEK,WAAW,CAAC,CAAC,CAAA;AACxB;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useRef, useCallback, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable prefer-const */
|
|
4
|
+
function useGlobalListeners() {
|
|
5
|
+
let globalListeners = useRef(new Map());
|
|
6
|
+
let addGlobalListener = useCallback((eventTarget, type, listener, options) => {
|
|
7
|
+
// Make sure we remove the listener after it is called with the `once` option.
|
|
8
|
+
let fn = options !== null && options !== void 0 && options.once ? function () {
|
|
9
|
+
globalListeners.current.delete(listener);
|
|
10
|
+
listener(...arguments);
|
|
11
|
+
} : listener;
|
|
12
|
+
globalListeners.current.set(listener, {
|
|
13
|
+
type,
|
|
14
|
+
eventTarget,
|
|
15
|
+
fn,
|
|
16
|
+
options
|
|
17
|
+
});
|
|
18
|
+
eventTarget.addEventListener(type, listener, options);
|
|
19
|
+
}, []);
|
|
20
|
+
let removeGlobalListener = useCallback((eventTarget, type, listener, options) => {
|
|
21
|
+
var _globalListeners$curr;
|
|
22
|
+
let fn = ((_globalListeners$curr = globalListeners.current.get(listener)) === null || _globalListeners$curr === void 0 ? void 0 : _globalListeners$curr.fn) || listener;
|
|
23
|
+
eventTarget.removeEventListener(type, fn, options);
|
|
24
|
+
globalListeners.current.delete(listener);
|
|
25
|
+
}, []);
|
|
26
|
+
let removeAllGlobalListeners = useCallback(() => {
|
|
27
|
+
globalListeners.current.forEach((value, key) => {
|
|
28
|
+
removeGlobalListener(value.eventTarget, value.type, key, value.options);
|
|
29
|
+
});
|
|
30
|
+
}, [removeGlobalListener]);
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line arrow-body-style
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
return removeAllGlobalListeners;
|
|
35
|
+
}, [removeAllGlobalListeners]);
|
|
36
|
+
return {
|
|
37
|
+
addGlobalListener,
|
|
38
|
+
removeGlobalListener,
|
|
39
|
+
removeAllGlobalListeners
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { useGlobalListeners };
|
|
44
|
+
//# sourceMappingURL=useGlobalListeners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGlobalListeners.js","sources":["../../../../src/react-aria/react-aria/utils/useGlobalListeners.ts"],"sourcesContent":["/* eslint-disable prefer-const */\n// @ts-nocheck\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useCallback, useEffect, useRef } from 'react';\n\ninterface GlobalListeners {\n addGlobalListener<K extends keyof DocumentEventMap>(\n el: EventTarget,\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ): void;\n addGlobalListener(\n el: EventTarget,\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions\n ): void;\n removeGlobalListener<K extends keyof DocumentEventMap>(\n el: EventTarget,\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | EventListenerOptions\n ): void;\n removeGlobalListener(\n el: EventTarget,\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions\n ): void;\n removeAllGlobalListeners(): void;\n}\n\nexport function useGlobalListeners(): GlobalListeners {\n let globalListeners = useRef(new Map());\n let addGlobalListener = useCallback((eventTarget, type, listener, options) => {\n // Make sure we remove the listener after it is called with the `once` option.\n let fn = options?.once\n ? (...args) => {\n globalListeners.current.delete(listener);\n listener(...args);\n }\n : listener;\n globalListeners.current.set(listener, { type, eventTarget, fn, options });\n eventTarget.addEventListener(type, listener, options);\n }, []);\n let removeGlobalListener = useCallback((eventTarget, type, listener, options) => {\n let fn = globalListeners.current.get(listener)?.fn || listener;\n eventTarget.removeEventListener(type, fn, options);\n globalListeners.current.delete(listener);\n }, []);\n let removeAllGlobalListeners = useCallback(() => {\n globalListeners.current.forEach((value, key) => {\n removeGlobalListener(value.eventTarget, value.type, key, value.options);\n });\n }, [removeGlobalListener]);\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return removeAllGlobalListeners;\n }, [removeAllGlobalListeners]);\n\n return { addGlobalListener, removeGlobalListener, removeAllGlobalListeners };\n}\n"],"names":["useGlobalListeners","globalListeners","useRef","Map","addGlobalListener","useCallback","eventTarget","type","listener","options","fn","once","current","delete","arguments","set","addEventListener","removeGlobalListener","_globalListeners$curr","get","removeEventListener","removeAllGl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CAAC,CAAA;GACzC,EAAE,EAAE,CAAC,CAAA;AACN,EAAA,IAAIa,wBAAwB,GAAGhB,WAAW,CAAC,MAAM;IAC/CJ,eAAe,CAACW,OAAO,CAACU,OAAO,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;AAC9CP,MAAAA,oBAAoB,CAACM,KAAK,CAACjB,WAAW,EAAEiB,KAAK,CAAChB,IAAI,EAAEiB,GAAG,EAAED,KAAK,CAACd,OAAO,CAAC,CAAA;AACzE,KAAC,CAAC,CAAA;AACJ,GAAC,EAAE,CAACQ,oBAAoB,CAAC,CAAC,CAAA;;AAE1B;AACAQ,EAAAA,SAAS,CAAC,MAAM;AACd,IAAA,OAAOJ,wBAAwB,CAAA;AACjC,GAAC,EAAE,CAACA,wBAAwB,CAAC,CAAC,CAAA;EAE9B,OAAO;IAAEjB,iBAAiB;IAAEa,oBAAoB;AAAEI,IAAAA,wBAAAA;GAA0B,CAAA;AAC9E;;;;"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
2
|
+
import { useLayoutEffect } from './useLayoutEffect.js';
|
|
3
|
+
import { useSSRSafeId } from '../ssr/SSRProvider.js';
|
|
4
|
+
import { useValueEffect } from './useValueEffect.js';
|
|
5
|
+
|
|
6
|
+
/* eslint-disable prefer-const */
|
|
7
|
+
|
|
8
|
+
// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing
|
|
9
|
+
let canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
10
|
+
let idsUpdaterMap = new Map();
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* If a default is not provided, generate an id.
|
|
14
|
+
* @param defaultId - Default component id.
|
|
15
|
+
*/
|
|
16
|
+
function useId(defaultId) {
|
|
17
|
+
let [value, setValue] = useState(defaultId);
|
|
18
|
+
let nextId = useRef(null);
|
|
19
|
+
let res = useSSRSafeId(value);
|
|
20
|
+
let updateValue = useCallback(val => {
|
|
21
|
+
nextId.current = val;
|
|
22
|
+
}, []);
|
|
23
|
+
if (canUseDOM) {
|
|
24
|
+
idsUpdaterMap.set(res, updateValue);
|
|
25
|
+
}
|
|
26
|
+
useLayoutEffect(() => {
|
|
27
|
+
let r = res;
|
|
28
|
+
return () => {
|
|
29
|
+
idsUpdaterMap.delete(r);
|
|
30
|
+
};
|
|
31
|
+
}, [res]);
|
|
32
|
+
|
|
33
|
+
// This cannot cause an infinite loop because the ref is updated first.
|
|
34
|
+
// eslint-disable-next-line
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
let newId = nextId.current;
|
|
37
|
+
if (newId) {
|
|
38
|
+
nextId.current = null;
|
|
39
|
+
setValue(newId);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return res;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Merges two ids.
|
|
47
|
+
* Different ids will trigger a side-effect and re-render components hooked up with `useId`.
|
|
48
|
+
*/
|
|
49
|
+
function mergeIds(idA, idB) {
|
|
50
|
+
if (idA === idB) {
|
|
51
|
+
return idA;
|
|
52
|
+
}
|
|
53
|
+
let setIdA = idsUpdaterMap.get(idA);
|
|
54
|
+
if (setIdA) {
|
|
55
|
+
setIdA(idB);
|
|
56
|
+
return idB;
|
|
57
|
+
}
|
|
58
|
+
let setIdB = idsUpdaterMap.get(idB);
|
|
59
|
+
if (setIdB) {
|
|
60
|
+
setIdB(idA);
|
|
61
|
+
return idA;
|
|
62
|
+
}
|
|
63
|
+
return idB;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Used to generate an id, and after render, check if that id is rendered so we know
|
|
68
|
+
* if we can use it in places such as labelledby.
|
|
69
|
+
* @param depArray - When to recalculate if the id is in the DOM.
|
|
70
|
+
*/
|
|
71
|
+
function useSlotId() {
|
|
72
|
+
let depArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
73
|
+
let id = useId();
|
|
74
|
+
let [resolvedId, setResolvedId] = useValueEffect(id);
|
|
75
|
+
let updateId = useCallback(() => {
|
|
76
|
+
setResolvedId(function* () {
|
|
77
|
+
yield id;
|
|
78
|
+
yield document.getElementById(id) ? id : undefined;
|
|
79
|
+
});
|
|
80
|
+
}, [id, setResolvedId]);
|
|
81
|
+
useLayoutEffect(updateId, [id, updateId, ...depArray]);
|
|
82
|
+
return resolvedId;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { mergeIds, useId, useSlotId };
|
|
86
|
+
//# sourceMappingURL=useId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useId.js","sources":["../../../../src/react-aria/react-aria/utils/useId.ts"],"sourcesContent":["/* eslint-disable prefer-const */\n// @ts-nocheck\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useLayoutEffect } from './useLayoutEffect';\nimport { useSSRSafeId } from '../ssr';\nimport { useValueEffect } from './';\n\n// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing\nlet canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nlet idsUpdaterMap: Map<string, (v: string) => void> = new Map();\n\n/**\n * If a default is not provided, generate an id.\n * @param defaultId - Default component id.\n */\nexport function useId(defaultId?: string): string {\n let [value, setValue] = useState(defaultId);\n let nextId = useRef(null);\n\n let res = useSSRSafeId(value);\n\n let updateValue = useCallback((val) => {\n nextId.current = val;\n }, []);\n\n if (canUseDOM) {\n idsUpdaterMap.set(res, updateValue);\n }\n\n useLayoutEffect(() => {\n let r = res;\n return () => {\n idsUpdaterMap.delete(r);\n };\n }, [res]);\n\n // This cannot cause an infinite loop because the ref is updated first.\n // eslint-disable-next-line\n useEffect(() => {\n let newId = nextId.current;\n if (newId) {\n nextId.current = null;\n setValue(newId);\n }\n });\n\n return res;\n}\n\n/**\n * Merges two ids.\n * Different ids will trigger a side-effect and re-render components hooked up with `useId`.\n */\nexport function mergeIds(idA: string, idB: string): string {\n if (idA === idB) {\n return idA;\n }\n\n let setIdA = idsUpdaterMap.get(idA);\n if (setIdA) {\n setIdA(idB);\n return idB;\n }\n\n let setIdB = idsUpdaterMap.get(idB);\n if (setIdB) {\n setIdB(idA);\n return idA;\n }\n\n return idB;\n}\n\n/**\n * Used to generate an id, and after render, check if that id is rendered so we know\n * if we can use it in places such as labelledby.\n * @param depArray - When to recalculate if the id is in the DOM.\n */\nexport function useSlotId(depArray: ReadonlyArray<any> = []): string {\n let id = useId();\n let [resolvedId, setResolvedId] = useValueEffect(id);\n let updateId = useCallback(() => {\n setResolvedId(function* () {\n yield id;\n\n yield document.getElementById(id) ? id : undefined;\n });\n }, [id, setResolvedId]);\n\n useLayoutEffect(updateId, [id, updateId, ...depArray]);\n\n return resolvedId;\n}\n"],"names":["canUseDOM","Boolean","window","document","createElement","idsUpdaterMap","Map","useId","defaultId","value","setValue","useState","nextId","useRef","res","useSSRSafeId","updateValue","useCallback","val","current","set","useLayoutEffect","r","delete","useEffect","newId","mergeIds","idA","idB","setIdA","get","setIdB","useSlotId","depArray","arguments","length","undefined","id","resolvedId","setResolvedId","useValueEffect","updateId","getElementById"],"mappings":";;;;;AAAA;;AAoBA;AACA,IAAIA,SAAS,GAAGC,OAAO,CAAC,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,QAAQ,IAAID,MAAM,CAACC,QAAQ,CAACC,aAAa,CAAC,CAAA;AAE1G,IAAIC,aAA+C,GAAG,IAAIC,GAAG,EAAE,CAAA;;AAE/D;AACA;AACA;AACA;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|
|
6
|
+
* Merges aria-label and aria-labelledby into aria-labelledby when both exist.
|
|
7
|
+
* @param props - Aria label props.
|
|
8
|
+
* @param defaultLabel - Default value for aria-label when not present.
|
|
9
|
+
*/
|
|
10
|
+
function useLabels(props, defaultLabel) {
|
|
11
|
+
let {
|
|
12
|
+
id,
|
|
13
|
+
'aria-label': label,
|
|
14
|
+
'aria-labelledby': labelledBy
|
|
15
|
+
} = props;
|
|
16
|
+
|
|
17
|
+
// If there is both an aria-label and aria-labelledby,
|
|
18
|
+
// combine them by pointing to the element itself.
|
|
19
|
+
id = useId(id);
|
|
20
|
+
if (labelledBy && label) {
|
|
21
|
+
let ids = new Set([id, ...labelledBy.trim().split(/\s+/)]);
|
|
22
|
+
labelledBy = [...ids].join(' ');
|
|
23
|
+
} else if (labelledBy) {
|
|
24
|
+
labelledBy = labelledBy.trim().split(/\s+/).join(' ');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// If no labels are provided, use the default
|
|
28
|
+
if (!label && !labelledBy && defaultLabel) {
|
|
29
|
+
label = defaultLabel;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
id,
|
|
33
|
+
'aria-label': label,
|
|
34
|
+
'aria-labelledby': labelledBy
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { useLabels };
|
|
39
|
+
//# sourceMappingURL=useLabels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLabels.js","sources":["../../../../src/react-aria/react-aria/utils/useLabels.ts"],"sourcesContent":["/* eslint-disable prefer-const */\n// @ts-nocheck\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { AriaLabelingProps, DOMProps } from '../../react-types/shared';\nimport { useId } from './useId';\n\n/**\n * Merges aria-label and aria-labelledby into aria-labelledby when both exist.\n * @param props - Aria label props.\n * @param defaultLabel - Default value for aria-label when not present.\n */\nexport function useLabels(props: DOMProps & AriaLabelingProps, defaultLabel?: string): DOMProps & AriaLabelingProps {\n let { id, 'aria-label': label, 'aria-labelledby': labelledBy } = props;\n\n // If there is both an aria-label and aria-labelledby,\n // combine them by pointing to the element itself.\n id = useId(id);\n if (labelledBy && label) {\n let ids = new Set([id, ...labelledBy.trim().split(/\\s+/)]);\n labelledBy = [...ids].join(' ');\n } else if (labelledBy) {\n labelledBy = labelledBy.trim().split(/\\s+/).join(' ');\n }\n\n // If no labels are provided, use the default\n if (!label && !labelledBy && defaultLabel) {\n label = defaultLabel;\n }\n\n return {\n id,\n 'aria-label': label,\n 'aria-labelledby': labelledBy,\n };\n}\n"],"names":["useLabels","props","defaultLabel","id","label","labelledBy","useId","ids","Set","trim","split","join"],"mappings":";;AAAA;;AAiBA;AACA;AACA;AACA;AACA;AACO,SAASA,SAASA,CAACC,KAAmC,EAAEC,YAAqB,EAAgC;EAClH,IAAI;IAAEC,EAAE;AAAE,IAAA,YAAY,EAAEC,KAAK;AAAE,IAAA,iBAAiB,EAAEC,UAAAA;AAAW,GAAC,GAAGJ,KAAK,CAAA;;AAEtE;AACA;AACAE,EAAAA,EAAE,GAAGG,KAAK,CAACH,EAAE,CAAC,CAAA;EACd,IAAIE,UAAU,IAAID,KAAK,EAAE;IACvB,IAAIG,GAAG,GAAG,IAAIC,GAAG,CAAC,CAACL,EAAE,EAAE,GAAGE,UAAU,CAACI,IAAI,EAAE,CAACC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC1DL,UAAU,GAAG,CAAC,GAAGE,GAAG,CAAC,CAACI,IAAI,CAAC,GAAG,CAAC,CAAA;GAChC,MAAM,IAAIN,UAAU,EAAE;AACrBA,IAAAA,UAAU,GAAGA,UAAU,CAACI,IAAI,EAAE,CAACC,KAAK,CAAC,KAAK,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAA;AACvD,GAAA;;AAEA;AACA,EAAA,IAAI,CAACP,KAAK,IAAI,CAACC,UAAU,IAAIH,YAAY,EAAE;AACzCE,IAAAA,KAAK,GAAGF,YAAY,CAAA;AACtB,GAAA;EAEA,OAAO;IACLC,EAAE;AACF,IAAA,YAAY,EAAEC,KAAK;AACnB,IAAA,iBAAiB,EAAEC,UAAAA;GACpB,CAAA;AACH;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
// During SSR, React emits a warning when calling useLayoutEffect.
|
|
16
|
+
// Since neither useLayoutEffect nor useEffect run on the server,
|
|
17
|
+
// we can suppress this by replace it with a noop on the server.
|
|
18
|
+
const useLayoutEffect = typeof document !== 'undefined' ? React__default.useLayoutEffect : () => {};
|
|
19
|
+
|
|
20
|
+
export { useLayoutEffect };
|
|
21
|
+
//# sourceMappingURL=useLayoutEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLayoutEffect.js","sources":["../../../../src/react-aria/react-aria/utils/useLayoutEffect.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React from 'react';\n\n// During SSR, React emits a warning when calling useLayoutEffect.\n// Since neither useLayoutEffect nor useEffect run on the server,\n// we can suppress this by replace it with a noop on the server.\nexport const useLayoutEffect = typeof document !== 'undefined'\n ? React.useLayoutEffect\n : () => {};\n"],"names":["useLayoutEffect","document","React"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACaA,MAAAA,eAAe,GAAG,OAAOC,QAAQ,KAAK,WAAW,GAC1DC,cAAK,CAACF,eAAe,GACrB,MAAM;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useLayoutEffect } from './useLayoutEffect.js';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
// Syncs ref from context with ref passed to hook
|
|
15
|
+
function useSyncRef(context, ref) {
|
|
16
|
+
useLayoutEffect(() => {
|
|
17
|
+
if (context && context.ref && ref) {
|
|
18
|
+
context.ref.current = ref.current;
|
|
19
|
+
return () => {
|
|
20
|
+
if (context.ref) {
|
|
21
|
+
context.ref.current = null;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { useSyncRef };
|
|
29
|
+
//# sourceMappingURL=useSyncRef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSyncRef.js","sources":["../../../../src/react-aria/react-aria/utils/useSyncRef.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {MutableRefObject, RefObject} from 'react';\nimport {useLayoutEffect} from './';\n\ninterface ContextValue<T> {\n ref?: MutableRefObject<T | null>\n}\n\n// Syncs ref from context with ref passed to hook\nexport function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<T>) {\n useLayoutEffect(() => {\n if (context && context.ref && ref) {\n context.ref.current = ref.current;\n return () => {\n if (context.ref) {\n context.ref.current = null;\n }\n };\n }\n });\n}\n"],"names":["useSyncRef","context","ref","useLayoutEffect","current"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACO,SAASA,UAAUA,CAAIC,OAAgC,EAAEC,GAAkB,EAAE;AAClFC,EAAAA,eAAe,CAAC,MAAM;AACpB,IAAA,IAAIF,OAAO,IAAIA,OAAO,CAACC,GAAG,IAAIA,GAAG,EAAE;AACjCD,MAAAA,OAAO,CAACC,GAAG,CAACE,OAAO,GAAGF,GAAG,CAACE,OAAO,CAAA;AACjC,MAAA,OAAO,MAAM;QACX,IAAIH,OAAO,CAACC,GAAG,EAAE;AACfD,UAAAA,OAAO,CAACC,GAAG,CAACE,OAAO,GAAG,IAAI,CAAA;AAC5B,SAAA;OACD,CAAA;AACH,KAAA;AACF,GAAC,CAAC,CAAA;AACJ;;;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useState, useRef } from 'react';
|
|
2
|
+
import { useEffectEvent } from './useEffectEvent.js';
|
|
3
|
+
import { useLayoutEffect } from './useLayoutEffect.js';
|
|
4
|
+
|
|
5
|
+
/* eslint-disable prefer-const */
|
|
6
|
+
// This hook works like `useState`, but when setting the value, you pass a generator function
|
|
7
|
+
// that can yield multiple values. Each yielded value updates the state and waits for the next
|
|
8
|
+
// layout effect, then continues the generator. This allows sequential updates to state to be
|
|
9
|
+
// written linearly.
|
|
10
|
+
function useValueEffect(defaultValue) {
|
|
11
|
+
let [value, setValue] = useState(defaultValue);
|
|
12
|
+
let effect = useRef(null);
|
|
13
|
+
|
|
14
|
+
// Store the function in a ref so we can always access the current version
|
|
15
|
+
// which has the proper `value` in scope.
|
|
16
|
+
let nextRef = useEffectEvent(() => {
|
|
17
|
+
if (!effect.current) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
// Run the generator to the next yield.
|
|
21
|
+
let newValue = effect.current.next();
|
|
22
|
+
|
|
23
|
+
// If the generator is done, reset the effect.
|
|
24
|
+
if (newValue.done) {
|
|
25
|
+
effect.current = null;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// If the value is the same as the current value,
|
|
30
|
+
// then continue to the next yield. Otherwise,
|
|
31
|
+
// set the value in state and wait for the next layout effect.
|
|
32
|
+
if (value === newValue.value) {
|
|
33
|
+
nextRef();
|
|
34
|
+
} else {
|
|
35
|
+
setValue(newValue.value);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
useLayoutEffect(() => {
|
|
39
|
+
// If there is an effect currently running, continue to the next yield.
|
|
40
|
+
if (effect.current) {
|
|
41
|
+
nextRef();
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
let queue = useEffectEvent(fn => {
|
|
45
|
+
effect.current = fn(value);
|
|
46
|
+
nextRef();
|
|
47
|
+
});
|
|
48
|
+
return [value, queue];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { useValueEffect };
|
|
52
|
+
//# sourceMappingURL=useValueEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useValueEffect.js","sources":["../../../../src/react-aria/react-aria/utils/useValueEffect.ts"],"sourcesContent":["/* eslint-disable prefer-const */\n// @ts-nocheck\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { Dispatch, MutableRefObject, useRef, useState } from 'react';\nimport { useEffectEvent, useLayoutEffect } from './';\n\ntype SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;\n\n// This hook works like `useState`, but when setting the value, you pass a generator function\n// that can yield multiple values. Each yielded value updates the state and waits for the next\n// layout effect, then continues the generator. This allows sequential updates to state to be\n// written linearly.\nexport function useValueEffect<S>(defaultValue: S | (() => S)): [S, Dispatch<SetValueAction<S>>] {\n let [value, setValue] = useState(defaultValue);\n let effect: MutableRefObject<Generator<S> | null> = useRef<Generator<S> | null>(null);\n\n // Store the function in a ref so we can always access the current version\n // which has the proper `value` in scope.\n let nextRef = useEffectEvent(() => {\n if (!effect.current) {\n return;\n }\n // Run the generator to the next yield.\n let newValue = effect.current.next();\n\n // If the generator is done, reset the effect.\n if (newValue.done) {\n effect.current = null;\n return;\n }\n\n // If the value is the same as the current value,\n // then continue to the next yield. Otherwise,\n // set the value in state and wait for the next layout effect.\n if (value === newValue.value) {\n nextRef();\n } else {\n setValue(newValue.value);\n }\n });\n\n useLayoutEffect(() => {\n // If there is an effect currently running, continue to the next yield.\n if (effect.current) {\n nextRef();\n }\n });\n\n let queue = useEffectEvent((fn) => {\n effect.current = fn(value);\n nextRef();\n });\n\n return [value, queue];\n}\n"],"names":["useValueEffect","defaultValue","value","setValue","useState","effect","useRef","nextRef","useEffectEvent","current","newValue","next","done","useLayoutEffect","queue","fn"],"mappings":";;;;AAAA;AAoBA;AACA;AACA;AACA;AACO,SAASA,cAAcA,CAAIC,YAA2B,EAAoC;EAC/F,IAAI,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAACH,YAAY,CAAC,CAAA;AAC9C,EAAA,IAAII,MAA6C,GAAGC,MAAM,CAAsB,IAAI,CAAC,CAAA;;AAErF;AACA;AACA,EAAA,IAAIC,OAAO,GAAGC,cAAc,CAAC,MAAM;AACjC,IAAA,IAAI,CAACH,MAAM,CAACI,OAAO,EAAE;AACnB,MAAA,OAAA;AACF,KAAA;AACA;IACA,IAAIC,QAAQ,GAAGL,MAAM,CAACI,OAAO,CAACE,IAAI,EAAE,CAAA;;AAEpC;IACA,IAAID,QAAQ,CAACE,IAAI,EAAE;MACjBP,MAAM,CAACI,OAAO,GAAG,IAAI,CAAA;AACrB,MAAA,OAAA;AACF,KAAA;;AAEA;AACA;AACA;AACA,IAAA,IAAIP,KAAK,KAAKQ,QAAQ,CAACR,KAAK,EAAE;AAC5BK,MAAAA,OAAO,EAAE,CAAA;AACX,KAAC,MAAM;AACLJ,MAAAA,QAAQ,CAACO,QAAQ,CAACR,KAAK,CAAC,CAAA;AAC1B,KAAA;AACF,GAAC,CAAC,CAAA;AAEFW,EAAAA,eAAe,CAAC,MAAM;AACpB;IACA,IAAIR,MAAM,CAACI,OAAO,EAAE;AAClBF,MAAAA,OAAO,EAAE,CAAA;AACX,KAAA;AACF,GAAC,CAAC,CAAA;AAEF,EAAA,IAAIO,KAAK,GAAGN,cAAc,CAAEO,EAAE,IAAK;AACjCV,IAAAA,MAAM,CAACI,OAAO,GAAGM,EAAE,CAACb,KAAK,CAAC,CAAA;AAC1BK,IAAAA,OAAO,EAAE,CAAA;AACX,GAAC,CAAC,CAAA;AAEF,EAAA,OAAO,CAACL,KAAK,EAAEY,KAAK,CAAC,CAAA;AACvB;;;;"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { useMemo, useContext, useState, useRef, useEffect, createContext } from 'react';
|
|
3
|
+
|
|
4
|
+
const VALID_VALIDITY_STATE = {
|
|
5
|
+
badInput: false,
|
|
6
|
+
customError: false,
|
|
7
|
+
patternMismatch: false,
|
|
8
|
+
rangeOverflow: false,
|
|
9
|
+
rangeUnderflow: false,
|
|
10
|
+
stepMismatch: false,
|
|
11
|
+
tooLong: false,
|
|
12
|
+
tooShort: false,
|
|
13
|
+
typeMismatch: false,
|
|
14
|
+
valueMissing: false,
|
|
15
|
+
valid: true
|
|
16
|
+
};
|
|
17
|
+
const CUSTOM_VALIDITY_STATE = _objectSpread2(_objectSpread2({}, VALID_VALIDITY_STATE), {}, {
|
|
18
|
+
customError: true,
|
|
19
|
+
valid: false
|
|
20
|
+
});
|
|
21
|
+
const DEFAULT_VALIDATION_RESULT = {
|
|
22
|
+
isInvalid: false,
|
|
23
|
+
validationDetails: VALID_VALIDITY_STATE,
|
|
24
|
+
validationErrors: []
|
|
25
|
+
};
|
|
26
|
+
const FormValidationContext = /*#__PURE__*/createContext({});
|
|
27
|
+
const privateValidationStateProp = '__formValidationState' + Date.now();
|
|
28
|
+
function useFormValidationState(props) {
|
|
29
|
+
// Private prop for parent components to pass state to children.
|
|
30
|
+
if (props[privateValidationStateProp]) {
|
|
31
|
+
let {
|
|
32
|
+
realtimeValidation,
|
|
33
|
+
displayValidation,
|
|
34
|
+
updateValidation,
|
|
35
|
+
resetValidation,
|
|
36
|
+
commitValidation
|
|
37
|
+
} = props[privateValidationStateProp];
|
|
38
|
+
return {
|
|
39
|
+
realtimeValidation,
|
|
40
|
+
displayValidation,
|
|
41
|
+
updateValidation,
|
|
42
|
+
resetValidation,
|
|
43
|
+
commitValidation
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
48
|
+
return useFormValidationStateImpl(props);
|
|
49
|
+
}
|
|
50
|
+
function useFormValidationStateImpl(props) {
|
|
51
|
+
var _builtinValidation;
|
|
52
|
+
let {
|
|
53
|
+
isInvalid,
|
|
54
|
+
validationState,
|
|
55
|
+
name,
|
|
56
|
+
value,
|
|
57
|
+
builtinValidation,
|
|
58
|
+
validate,
|
|
59
|
+
validationBehavior = 'aria'
|
|
60
|
+
} = props;
|
|
61
|
+
|
|
62
|
+
// backward compatibility.
|
|
63
|
+
if (validationState) {
|
|
64
|
+
isInvalid ||= validationState === 'invalid';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// If the isInvalid prop is controlled, update validation result in realtime.
|
|
68
|
+
let controlledError = isInvalid !== undefined ? {
|
|
69
|
+
isInvalid,
|
|
70
|
+
validationErrors: [],
|
|
71
|
+
validationDetails: CUSTOM_VALIDITY_STATE
|
|
72
|
+
} : null;
|
|
73
|
+
|
|
74
|
+
// Perform custom client side validation.
|
|
75
|
+
let clientError = useMemo(() => getValidationResult(runValidate(validate, value)), [validate, value]);
|
|
76
|
+
if ((_builtinValidation = builtinValidation) !== null && _builtinValidation !== void 0 && _builtinValidation.validationDetails.valid) {
|
|
77
|
+
builtinValidation = null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Get relevant server errors from the form.
|
|
81
|
+
let serverErrors = useContext(FormValidationContext);
|
|
82
|
+
let serverErrorMessages = useMemo(() => {
|
|
83
|
+
if (name) {
|
|
84
|
+
return Array.isArray(name) ? name.flatMap(name => asArray(serverErrors[name])) : asArray(serverErrors[name]);
|
|
85
|
+
}
|
|
86
|
+
return [];
|
|
87
|
+
}, [serverErrors, name]);
|
|
88
|
+
|
|
89
|
+
// Show server errors when the form gets a new value, and clear when the user changes the value.
|
|
90
|
+
let [lastServerErrors, setLastServerErrors] = useState(serverErrors);
|
|
91
|
+
let [isServerErrorCleared, setServerErrorCleared] = useState(false);
|
|
92
|
+
if (serverErrors !== lastServerErrors) {
|
|
93
|
+
setLastServerErrors(serverErrors);
|
|
94
|
+
setServerErrorCleared(false);
|
|
95
|
+
}
|
|
96
|
+
let serverError = useMemo(() => getValidationResult(isServerErrorCleared ? [] : serverErrorMessages), [isServerErrorCleared, serverErrorMessages]);
|
|
97
|
+
|
|
98
|
+
// Track the next validation state in a ref until commitValidation is called.
|
|
99
|
+
let nextValidation = useRef(DEFAULT_VALIDATION_RESULT);
|
|
100
|
+
let [currentValidity, setCurrentValidity] = useState(DEFAULT_VALIDATION_RESULT);
|
|
101
|
+
let lastError = useRef(DEFAULT_VALIDATION_RESULT);
|
|
102
|
+
let commitValidation = () => {
|
|
103
|
+
if (!commitQueued) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
setCommitQueued(false);
|
|
107
|
+
let error = clientError || builtinValidation || nextValidation.current;
|
|
108
|
+
if (!isEqualValidation(error, lastError.current)) {
|
|
109
|
+
lastError.current = error;
|
|
110
|
+
setCurrentValidity(error);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
let [commitQueued, setCommitQueued] = useState(false);
|
|
114
|
+
useEffect(commitValidation);
|
|
115
|
+
|
|
116
|
+
// realtimeValidation is used to update the native input element's state based on custom validation logic.
|
|
117
|
+
// displayValidation is the currently displayed validation state that the user sees (e.g. on input change/form submit).
|
|
118
|
+
// With validationBehavior="aria", all errors are displayed in realtime rather than on submit.
|
|
119
|
+
let realtimeValidation = controlledError || serverError || clientError || builtinValidation || DEFAULT_VALIDATION_RESULT;
|
|
120
|
+
let displayValidation = validationBehavior === 'native' ? controlledError || serverError || currentValidity : controlledError || serverError || clientError || builtinValidation || currentValidity;
|
|
121
|
+
return {
|
|
122
|
+
realtimeValidation,
|
|
123
|
+
displayValidation,
|
|
124
|
+
updateValidation(value) {
|
|
125
|
+
// If validationBehavior is 'aria', update in realtime. Otherwise, store in a ref until commit.
|
|
126
|
+
if (validationBehavior === 'aria' && !isEqualValidation(currentValidity, value)) {
|
|
127
|
+
setCurrentValidity(value);
|
|
128
|
+
} else {
|
|
129
|
+
nextValidation.current = value;
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
resetValidation() {
|
|
133
|
+
// Update the currently displayed validation state to valid on form reset,
|
|
134
|
+
// even if the native validity says it isn't. It'll show again on the next form submit.
|
|
135
|
+
let error = DEFAULT_VALIDATION_RESULT;
|
|
136
|
+
if (!isEqualValidation(error, lastError.current)) {
|
|
137
|
+
lastError.current = error;
|
|
138
|
+
setCurrentValidity(error);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Do not commit validation after the next render. This avoids a condition where
|
|
142
|
+
// useSelect calls commitValidation inside an onReset handler.
|
|
143
|
+
if (validationBehavior === 'native') {
|
|
144
|
+
setCommitQueued(false);
|
|
145
|
+
}
|
|
146
|
+
setServerErrorCleared(true);
|
|
147
|
+
},
|
|
148
|
+
commitValidation() {
|
|
149
|
+
// Commit validation state so the user sees it on blur/change/submit. Also clear any server errors.
|
|
150
|
+
// Wait until after the next render to commit so that the latest value has been validated.
|
|
151
|
+
if (validationBehavior === 'native') {
|
|
152
|
+
setCommitQueued(true);
|
|
153
|
+
}
|
|
154
|
+
setServerErrorCleared(true);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function asArray(v) {
|
|
159
|
+
if (!v) {
|
|
160
|
+
return [];
|
|
161
|
+
}
|
|
162
|
+
return Array.isArray(v) ? v : [v];
|
|
163
|
+
}
|
|
164
|
+
function runValidate(validate, value) {
|
|
165
|
+
if (typeof validate === 'function') {
|
|
166
|
+
let e = validate(value);
|
|
167
|
+
if (e && typeof e !== 'boolean') {
|
|
168
|
+
return asArray(e);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return [];
|
|
172
|
+
}
|
|
173
|
+
function getValidationResult(errors) {
|
|
174
|
+
return errors.length ? {
|
|
175
|
+
isInvalid: true,
|
|
176
|
+
validationErrors: errors,
|
|
177
|
+
validationDetails: CUSTOM_VALIDITY_STATE
|
|
178
|
+
} : null;
|
|
179
|
+
}
|
|
180
|
+
function isEqualValidation(a, b) {
|
|
181
|
+
if (a === b) {
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
return a && b && a.isInvalid === b.isInvalid && a.validationErrors.length === b.validationErrors.length && a.validationErrors.every((a, i) => a === b.validationErrors[i]) && Object.entries(a.validationDetails).every(_ref => {
|
|
185
|
+
let [k, v] = _ref;
|
|
186
|
+
return b.validationDetails[k] === v;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export { DEFAULT_VALIDATION_RESULT, FormValidationContext, VALID_VALIDITY_STATE, privateValidationStateProp, useFormValidationState };
|
|
191
|
+
//# sourceMappingURL=useFormValidationState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormValidationState.js","sources":["../../../../src/react-aria/react-stately/form/useFormValidationState.ts"],"sourcesContent":["/* eslint-disable prefer-const */\n// @ts-nocheck\n/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { Validation, ValidationErrors, ValidationFunction, ValidationResult } from '../../react-types/shared';\n\nexport const VALID_VALIDITY_STATE: ValidityState = {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valueMissing: false,\n valid: true,\n};\n\nconst CUSTOM_VALIDITY_STATE: ValidityState = {\n ...VALID_VALIDITY_STATE,\n customError: true,\n valid: false,\n};\n\nexport const DEFAULT_VALIDATION_RESULT: ValidationResult = {\n isInvalid: false,\n validationDetails: VALID_VALIDITY_STATE,\n validationErrors: [],\n};\n\nexport const FormValidationContext = createContext<ValidationErrors>({});\n\nexport const privateValidationStateProp = '__formValidationState' + Date.now();\n\ninterface FormValidationProps<T> extends Validation<T> {\n builtinValidation?: ValidationResult;\n name?: string | string[];\n value: T;\n}\n\nexport interface FormValidationState {\n /** Realtime validation results, updated as the user edits the value. */\n realtimeValidation: ValidationResult;\n /** Currently displayed validation results, updated when the user commits their changes. */\n displayValidation: ValidationResult;\n /** Updates the current validation result. Not displayed to the user until `commitValidation` is called. */\n updateValidation(result: ValidationResult): void;\n /** Resets the displayed validation state to valid when the user resets the form. */\n resetValidation(): void;\n /** Commits the realtime validation so it is displayed to the user. */\n commitValidation(): void;\n}\n\nexport function useFormValidationState<T>(props: FormValidationProps<T>): FormValidationState {\n // Private prop for parent components to pass state to children.\n if (props[privateValidationStateProp]) {\n let { realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation } = props[\n privateValidationStateProp\n ] as FormValidationState;\n return { realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation };\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useFormValidationStateImpl(props);\n}\n\nfunction useFormValidationStateImpl<T>(props: FormValidationProps<T>): FormValidationState {\n let { isInvalid, validationState, name, value, builtinValidation, validate, validationBehavior = 'aria' } = props;\n\n // backward compatibility.\n if (validationState) {\n isInvalid ||= validationState === 'invalid';\n }\n\n // If the isInvalid prop is controlled, update validation result in realtime.\n let controlledError: ValidationResult | null =\n isInvalid !== undefined\n ? {\n isInvalid,\n validationErrors: [],\n validationDetails: CUSTOM_VALIDITY_STATE,\n }\n : null;\n\n // Perform custom client side validation.\n let clientError: ValidationResult | null = useMemo(\n () => getValidationResult(runValidate(validate, value)),\n [validate, value]\n );\n\n if (builtinValidation?.validationDetails.valid) {\n builtinValidation = null;\n }\n\n // Get relevant server errors from the form.\n let serverErrors = useContext(FormValidationContext);\n let serverErrorMessages = useMemo(() => {\n if (name) {\n return Array.isArray(name) ? name.flatMap((name) => asArray(serverErrors[name])) : asArray(serverErrors[name]);\n }\n return [];\n }, [serverErrors, name]);\n\n // Show server errors when the form gets a new value, and clear when the user changes the value.\n let [lastServerErrors, setLastServerErrors] = useState(serverErrors);\n let [isServerErrorCleared, setServerErrorCleared] = useState(false);\n if (serverErrors !== lastServerErrors) {\n setLastServerErrors(serverErrors);\n setServerErrorCleared(false);\n }\n\n let serverError: ValidationResult | null = useMemo(\n () => getValidationResult(isServerErrorCleared ? [] : serverErrorMessages),\n [isServerErrorCleared, serverErrorMessages]\n );\n\n // Track the next validation state in a ref until commitValidation is called.\n let nextValidation = useRef(DEFAULT_VALIDATION_RESULT);\n let [currentValidity, setCurrentValidity] = useState(DEFAULT_VALIDATION_RESULT);\n\n let lastError = useRef(DEFAULT_VALIDATION_RESULT);\n let commitValidation = () => {\n if (!commitQueued) {\n return;\n }\n\n setCommitQueued(false);\n let error = clientError || builtinValidation || nextValidation.current;\n if (!isEqualValidation(error, lastError.current)) {\n lastError.current = error;\n setCurrentValidity(error);\n }\n };\n\n let [commitQueued, setCommitQueued] = useState(false);\n useEffect(commitValidation);\n\n // realtimeValidation is used to update the native input element's state based on custom validation logic.\n // displayValidation is the currently displayed validation state that the user sees (e.g. on input change/form submit).\n // With validationBehavior=\"aria\", all errors are displayed in realtime rather than on submit.\n let realtimeValidation =\n controlledError || serverError || clientError || builtinValidation || DEFAULT_VALIDATION_RESULT;\n let displayValidation =\n validationBehavior === 'native'\n ? controlledError || serverError || currentValidity\n : controlledError || serverError || clientError || builtinValidation || currentValidity;\n\n return {\n realtimeValidation,\n displayValidation,\n updateValidation(value) {\n // If validationBehavior is 'aria', update in realtime. Otherwise, store in a ref until commit.\n if (validationBehavior === 'aria' && !isEqualValidation(currentValidity, value)) {\n setCurrentValidity(value);\n } else {\n nextValidation.current = value;\n }\n },\n resetValidation() {\n // Update the currently displayed validation state to valid on form reset,\n // even if the native validity says it isn't. It'll show again on the next form submit.\n let error = DEFAULT_VALIDATION_RESULT;\n if (!isEqualValidation(error, lastError.current)) {\n lastError.current = error;\n setCurrentValidity(error);\n }\n\n // Do not commit validation after the next render. This avoids a condition where\n // useSelect calls commitValidation inside an onReset handler.\n if (validationBehavior === 'native') {\n setCommitQueued(false);\n }\n\n setServerErrorCleared(true);\n },\n commitValidation() {\n // Commit validation state so the user sees it on blur/change/submit. Also clear any server errors.\n // Wait until after the next render to commit so that the latest value has been validated.\n if (validationBehavior === 'native') {\n setCommitQueued(true);\n }\n setServerErrorCleared(true);\n },\n };\n}\n\nfunction asArray<T>(v: T | T[]): T[] {\n if (!v) {\n return [];\n }\n\n return Array.isArray(v) ? v : [v];\n}\n\nfunction runValidate<T>(validate: ValidationFunction<T>, value: T): string[] {\n if (typeof validate === 'function') {\n let e = validate(value);\n if (e && typeof e !== 'boolean') {\n return asArray(e);\n }\n }\n\n return [];\n}\n\nfunction getValidationResult(errors: string[]): ValidationResult | null {\n return errors.length\n ? {\n isInvalid: true,\n validationErrors: errors,\n validationDetails: CUSTOM_VALIDITY_STATE,\n }\n : null;\n}\n\nfunction isEqualValidation(a: ValidationResult | null, b: ValidationResult | null): boolean {\n if (a === b) {\n return true;\n }\n\n return (\n a &&\n b &&\n a.isInvalid === b.isInvalid &&\n a.validationErrors.length === b.validationErrors.length &&\n a.validationErrors.every((a, i) => a === b.validationErrors[i]) &&\n Object.entries(a.validationDetails).every(([k, v]) => b.validationDetails[k] === v)\n );\n}\n\nexport function mergeValidation(...results: ValidationResult[]): ValidationResult {\n let errors = new Set<string>();\n let isInvalid = false;\n let validationDetails = {\n ...VALID_VALIDITY_STATE,\n };\n\n for (let v of results) {\n for (let e of v.validationErrors) {\n errors.add(e);\n }\n\n // Only these properties apply for checkboxes.\n isInvalid ||= v.isInvalid;\n for (let key in validationDetails) {\n validationDetails[key] ||= v.validationDetails[key];\n }\n }\n\n validationDetails.valid = !isInvalid;\n return {\n isInvalid,\n validationErrors: [...errors],\n validationDetails,\n };\n}\n"],"names":["VALID_VALIDITY_STATE","badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing","valid","CUSTOM_VALIDITY_STATE","_objectSpread","DEFAULT_VALIDATION_RESULT","isInvalid","validationDetails","validationErrors","FormValidationContext","createContext","privateValidationStateProp","Date","now","useFormValidationState","props","realtimeValidation","displayValidation","updateValidation","resetValidation","commitValidation","useFormValidationStateImpl","_builtinValidation","validationState","name","value","builtinValidation","validate","validationBehavior","controlledError","undefined","clientError","useMemo","getValidationResult","runValidate","serverErrors","useContext","serverErrorMessages","Array","isArray","flatMap","asArray","lastServerErrors","setLastServerErrors","useState","isServerErrorCleared","setServerErrorCleared","serverError","nextValidation","useRef","currentValidity","setCurrentValidity","lastError","commitQueued","setCommitQueued","error","current","isEqualValidation","useEffect","v","e","errors","length","a","b","every","i","Object","entries","_ref","k"],"mappings":";;;AAiBO,MAAMA,oBAAmC,GAAG;AACjDC,EAAAA,QAAQ,EAAE,KAAK;AACfC,EAAAA,WAAW,EAAE,KAAK;AAClBC,EAAAA,eAAe,EAAE,KAAK;AACtBC,EAAAA,aAAa,EAAE,KAAK;AACpBC,EAAAA,cAAc,EAAE,KAAK;AACrBC,EAAAA,YAAY,EAAE,KAAK;AACnBC,EAAAA,OAAO,EAAE,KAAK;AACdC,EAAAA,QAAQ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