@krelborn/stylesui 0.0.0-stage → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +74 -0
- package/README.md +129 -2
- package/dist/accessibility/RequiredAccessibleName.d.ts +26 -0
- package/dist/accessibility/idSegment.d.ts +7 -0
- package/dist/accessibility/idSegment.js +5 -0
- package/dist/accessibility/index.d.ts +2 -0
- package/dist/collections/index.d.ts +7 -0
- package/dist/collections/optionId.d.ts +8 -0
- package/dist/collections/optionId.js +6 -0
- package/dist/collections/renderedOptions.d.ts +37 -0
- package/dist/collections/renderedOptions.js +17 -0
- package/dist/collections/targetIndexForKey.d.ts +45 -0
- package/dist/collections/targetIndexForKey.js +16 -0
- package/dist/collections/typeAhead.d.ts +43 -0
- package/dist/collections/typeAhead.js +18 -0
- package/dist/components/Accordion/Accordion.css +1 -0
- package/dist/components/Accordion/Accordion.d.ts +90 -0
- package/dist/components/Accordion/Accordion.js +47 -0
- package/dist/components/Accordion/Accordion.module.js +19 -0
- package/dist/components/Accordion/AccordionContext.d.ts +40 -0
- package/dist/components/Accordion/AccordionContext.js +4 -0
- package/dist/components/Accordion/AccordionItem.d.ts +51 -0
- package/dist/components/Accordion/AccordionItem.js +69 -0
- package/dist/components/Accordion/AccordionToggleContent.d.ts +30 -0
- package/dist/components/Accordion/AccordionToggleContent.js +44 -0
- package/dist/components/Accordion/accordionIds.d.ts +24 -0
- package/dist/components/Accordion/accordionIds.js +12 -0
- package/dist/components/Accordion/index.d.ts +4 -0
- package/dist/components/Accordion/useAccordionContext.d.ts +9 -0
- package/dist/components/Accordion/useAccordionContext.js +10 -0
- package/dist/components/Accordion/useFindablePanel.d.ts +25 -0
- package/dist/components/Accordion/useFindablePanel.js +36 -0
- package/dist/components/Accordion/useFragmentTargetReveal.d.ts +27 -0
- package/dist/components/Accordion/useFragmentTargetReveal.js +36 -0
- package/dist/components/Accordion/useHasOpened.d.ts +7 -0
- package/dist/components/Accordion/useHasOpened.js +7 -0
- package/dist/components/Alert/Alert.css +1 -0
- package/dist/components/Alert/Alert.d.ts +47 -0
- package/dist/components/Alert/Alert.js +27 -0
- package/dist/components/Alert/Alert.module.js +8 -0
- package/dist/components/Alert/AlertIcon.d.ts +14 -0
- package/dist/components/Alert/AlertIcon.js +42 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.css +1 -0
- package/dist/components/Avatar/Avatar.d.ts +33 -0
- package/dist/components/Avatar/Avatar.js +26 -0
- package/dist/components/Avatar/Avatar.module.js +6 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Avatar/initialsOf.d.ts +9 -0
- package/dist/components/Avatar/initialsOf.js +9 -0
- package/dist/components/AvatarGroup/AvatarGroup.css +1 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +30 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +33 -0
- package/dist/components/AvatarGroup/AvatarGroup.module.js +6 -0
- package/dist/components/AvatarGroup/index.d.ts +2 -0
- package/dist/components/Badge/Badge.css +1 -0
- package/dist/components/Badge/Badge.d.ts +36 -0
- package/dist/components/Badge/Badge.js +15 -0
- package/dist/components/Badge/Badge.module.js +3 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Box/Box.css +1 -0
- package/dist/components/Box/Box.d.ts +31 -0
- package/dist/components/Box/Box.js +17 -0
- package/dist/components/Box/Box.module.js +3 -0
- package/dist/components/Box/index.d.ts +2 -0
- package/dist/components/Button/Button.css +1 -0
- package/dist/components/Button/Button.d.ts +42 -0
- package/dist/components/Button/Button.js +24 -0
- package/dist/components/Button/Button.module.js +6 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Card/Card.css +1 -0
- package/dist/components/Card/Card.d.ts +24 -0
- package/dist/components/Card/Card.js +14 -0
- package/dist/components/Card/Card.module.js +3 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Center/Center.css +1 -0
- package/dist/components/Center/Center.d.ts +34 -0
- package/dist/components/Center/Center.js +19 -0
- package/dist/components/Center/Center.module.js +3 -0
- package/dist/components/Center/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +23 -0
- package/dist/components/Checkbox/Checkbox.js +12 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/ChoiceControl/ChoiceControl.css +1 -0
- package/dist/components/ChoiceControl/ChoiceControl.d.ts +21 -0
- package/dist/components/ChoiceControl/ChoiceControl.js +39 -0
- package/dist/components/ChoiceControl/ChoiceControl.module.js +8 -0
- package/dist/components/ChoiceControl/index.d.ts +1 -0
- package/dist/components/Cluster/Cluster.d.ts +29 -0
- package/dist/components/Cluster/Cluster.js +13 -0
- package/dist/components/Cluster/index.d.ts +2 -0
- package/dist/components/Code/Code.css +1 -0
- package/dist/components/Code/Code.d.ts +13 -0
- package/dist/components/Code/Code.js +19 -0
- package/dist/components/Code/Code.module.js +3 -0
- package/dist/components/Code/index.d.ts +2 -0
- package/dist/components/Combobox/Autocomplete.d.ts +83 -0
- package/dist/components/Combobox/Autocomplete.js +102 -0
- package/dist/components/Combobox/Combobox.css +1 -0
- package/dist/components/Combobox/Combobox.d.ts +59 -0
- package/dist/components/Combobox/Combobox.js +82 -0
- package/dist/components/Combobox/Combobox.module.js +17 -0
- package/dist/components/Combobox/ComboboxContext.d.ts +88 -0
- package/dist/components/Combobox/ComboboxContext.js +4 -0
- package/dist/components/Combobox/ComboboxFieldValue.d.ts +17 -0
- package/dist/components/Combobox/ComboboxFieldValue.js +33 -0
- package/dist/components/Combobox/ComboboxOption.d.ts +51 -0
- package/dist/components/Combobox/ComboboxOption.js +74 -0
- package/dist/components/Combobox/ComboboxOptionContent.d.ts +32 -0
- package/dist/components/Combobox/ComboboxOptionContent.js +51 -0
- package/dist/components/Combobox/ComboboxPopup.d.ts +50 -0
- package/dist/components/Combobox/ComboboxPopup.js +59 -0
- package/dist/components/Combobox/autocompleteKeys.d.ts +31 -0
- package/dist/components/Combobox/autocompleteKeys.js +25 -0
- package/dist/components/Combobox/comboboxKeys.d.ts +10 -0
- package/dist/components/Combobox/comboboxKeys.js +22 -0
- package/dist/components/Combobox/containsText.d.ts +9 -0
- package/dist/components/Combobox/containsText.js +8 -0
- package/dist/components/Combobox/index.d.ts +6 -0
- package/dist/components/Combobox/isAltArrow.d.ts +9 -0
- package/dist/components/Combobox/isAltArrow.js +5 -0
- package/dist/components/Combobox/isOptionShown.d.ts +10 -0
- package/dist/components/Combobox/isOptionShown.js +5 -0
- package/dist/components/Combobox/useAutocompleteText.d.ts +56 -0
- package/dist/components/Combobox/useAutocompleteText.js +27 -0
- package/dist/components/Combobox/useComboboxContext.d.ts +9 -0
- package/dist/components/Combobox/useComboboxContext.js +10 -0
- package/dist/components/Combobox/useComboboxList.d.ts +129 -0
- package/dist/components/Combobox/useComboboxList.js +138 -0
- package/dist/components/Combobox/useComboboxOption.d.ts +35 -0
- package/dist/components/Combobox/useComboboxOption.js +46 -0
- package/dist/components/Combobox/useComboboxSelection.d.ts +45 -0
- package/dist/components/Combobox/useComboboxSelection.js +17 -0
- package/dist/components/Combobox/useResultsAnnouncement.d.ts +23 -0
- package/dist/components/Combobox/useResultsAnnouncement.js +24 -0
- package/dist/components/ContextMenu/index.d.ts +2 -0
- package/dist/components/ContextMenu/useContextMenu.d.ts +112 -0
- package/dist/components/ContextMenu/useContextMenu.js +202 -0
- package/dist/components/ContextMenu/watchLongPress.d.ts +35 -0
- package/dist/components/ContextMenu/watchLongPress.js +38 -0
- package/dist/components/Counter/Counter.css +1 -0
- package/dist/components/Counter/Counter.d.ts +39 -0
- package/dist/components/Counter/Counter.js +18 -0
- package/dist/components/Counter/Counter.module.js +3 -0
- package/dist/components/Counter/index.d.ts +2 -0
- package/dist/components/Cover/Cover.css +1 -0
- package/dist/components/Cover/Cover.d.ts +40 -0
- package/dist/components/Cover/Cover.js +29 -0
- package/dist/components/Cover/Cover.module.js +6 -0
- package/dist/components/Cover/index.d.ts +2 -0
- package/dist/components/Divider/Divider.css +1 -0
- package/dist/components/Divider/Divider.d.ts +25 -0
- package/dist/components/Divider/Divider.js +15 -0
- package/dist/components/Divider/Divider.module.js +3 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Field/Field.css +1 -0
- package/dist/components/Field/Field.d.ts +49 -0
- package/dist/components/Field/Field.js +49 -0
- package/dist/components/Field/Field.module.js +8 -0
- package/dist/components/Field/index.d.ts +2 -0
- package/dist/components/Fieldset/Fieldset.css +1 -0
- package/dist/components/Fieldset/Fieldset.d.ts +35 -0
- package/dist/components/Fieldset/Fieldset.js +64 -0
- package/dist/components/Fieldset/Fieldset.module.js +8 -0
- package/dist/components/Fieldset/index.d.ts +2 -0
- package/dist/components/Frame/Frame.css +1 -0
- package/dist/components/Frame/Frame.d.ts +23 -0
- package/dist/components/Frame/Frame.js +16 -0
- package/dist/components/Frame/Frame.module.js +3 -0
- package/dist/components/Frame/index.d.ts +2 -0
- package/dist/components/Grid/Grid.css +1 -0
- package/dist/components/Grid/Grid.d.ts +25 -0
- package/dist/components/Grid/Grid.js +22 -0
- package/dist/components/Grid/Grid.module.js +3 -0
- package/dist/components/Grid/index.d.ts +2 -0
- package/dist/components/Heading/Heading.css +1 -0
- package/dist/components/Heading/Heading.d.ts +39 -0
- package/dist/components/Heading/Heading.js +23 -0
- package/dist/components/Heading/Heading.module.js +3 -0
- package/dist/components/Heading/index.d.ts +2 -0
- package/dist/components/HorizontalFlow/HorizontalFlow.css +1 -0
- package/dist/components/HorizontalFlow/HorizontalFlow.d.ts +30 -0
- package/dist/components/HorizontalFlow/HorizontalFlow.js +30 -0
- package/dist/components/HorizontalFlow/HorizontalFlow.module.js +3 -0
- package/dist/components/HorizontalFlow/index.d.ts +2 -0
- package/dist/components/Icon/AddIcon.d.ts +11 -0
- package/dist/components/Icon/AddIcon.js +21 -0
- package/dist/components/Icon/CheckIcon.d.ts +11 -0
- package/dist/components/Icon/CheckIcon.js +18 -0
- package/dist/components/Icon/ChevronDownIcon.d.ts +11 -0
- package/dist/components/Icon/ChevronDownIcon.js +18 -0
- package/dist/components/Icon/ChevronRightIcon.d.ts +11 -0
- package/dist/components/Icon/ChevronRightIcon.js +19 -0
- package/dist/components/Icon/CloseIcon.d.ts +12 -0
- package/dist/components/Icon/CloseIcon.js +21 -0
- package/dist/components/Icon/ColorModeIcon.d.ts +12 -0
- package/dist/components/Icon/ColorModeIcon.js +36 -0
- package/dist/components/Icon/DeleteIcon.d.ts +11 -0
- package/dist/components/Icon/DeleteIcon.js +36 -0
- package/dist/components/Icon/Icon.css +1 -0
- package/dist/components/Icon/Icon.d.ts +40 -0
- package/dist/components/Icon/Icon.js +27 -0
- package/dist/components/Icon/Icon.module.js +6 -0
- package/dist/components/Icon/InfoIcon.d.ts +11 -0
- package/dist/components/Icon/InfoIcon.js +30 -0
- package/dist/components/Icon/MenuIcon.d.ts +12 -0
- package/dist/components/Icon/MenuIcon.js +28 -0
- package/dist/components/Icon/MoreHorizontalIcon.d.ts +11 -0
- package/dist/components/Icon/MoreHorizontalIcon.js +34 -0
- package/dist/components/Icon/MoreVerticalIcon.d.ts +11 -0
- package/dist/components/Icon/MoreVerticalIcon.js +34 -0
- package/dist/components/Icon/PaletteIcon.d.ts +12 -0
- package/dist/components/Icon/PaletteIcon.js +48 -0
- package/dist/components/Icon/RefreshIcon.d.ts +13 -0
- package/dist/components/Icon/RefreshIcon.js +32 -0
- package/dist/components/Icon/RemoveIcon.d.ts +11 -0
- package/dist/components/Icon/RemoveIcon.js +18 -0
- package/dist/components/Icon/SendIcon.d.ts +11 -0
- package/dist/components/Icon/SendIcon.js +22 -0
- package/dist/components/Icon/index.d.ts +16 -0
- package/dist/components/IconButton/IconButton.css +1 -0
- package/dist/components/IconButton/IconButton.d.ts +45 -0
- package/dist/components/IconButton/IconButton.js +40 -0
- package/dist/components/IconButton/IconButton.module.js +7 -0
- package/dist/components/IconButton/index.d.ts +2 -0
- package/dist/components/Kbd/Kbd.css +1 -0
- package/dist/components/Kbd/Kbd.d.ts +13 -0
- package/dist/components/Kbd/Kbd.js +19 -0
- package/dist/components/Kbd/Kbd.module.js +3 -0
- package/dist/components/Kbd/index.d.ts +2 -0
- package/dist/components/Link/Link.css +1 -0
- package/dist/components/Link/Link.d.ts +52 -0
- package/dist/components/Link/Link.js +26 -0
- package/dist/components/Link/Link.module.js +3 -0
- package/dist/components/Link/index.d.ts +2 -0
- package/dist/components/Listbox/Listbox.css +1 -0
- package/dist/components/Listbox/Listbox.d.ts +46 -0
- package/dist/components/Listbox/Listbox.js +55 -0
- package/dist/components/Listbox/Listbox.module.js +6 -0
- package/dist/components/Listbox/ListboxContext.d.ts +38 -0
- package/dist/components/Listbox/ListboxContext.js +4 -0
- package/dist/components/Listbox/ListboxOption.d.ts +31 -0
- package/dist/components/Listbox/ListboxOption.js +42 -0
- package/dist/components/Listbox/index.d.ts +4 -0
- package/dist/components/Listbox/useListbox.d.ts +54 -0
- package/dist/components/Listbox/useListbox.js +103 -0
- package/dist/components/Listbox/useListboxContext.d.ts +9 -0
- package/dist/components/Listbox/useListboxContext.js +10 -0
- package/dist/components/Menu/Menu.d.ts +70 -0
- package/dist/components/Menu/Menu.js +76 -0
- package/dist/components/Menu/MenuContext.d.ts +29 -0
- package/dist/components/Menu/MenuContext.js +4 -0
- package/dist/components/Menu/MenuGroup.d.ts +22 -0
- package/dist/components/Menu/MenuGroup.js +32 -0
- package/dist/components/Menu/MenuItem.d.ts +77 -0
- package/dist/components/Menu/MenuItem.js +54 -0
- package/dist/components/Menu/MenuItemCheckbox.d.ts +61 -0
- package/dist/components/Menu/MenuItemCheckbox.js +37 -0
- package/dist/components/Menu/MenuItemRadio.d.ts +47 -0
- package/dist/components/Menu/MenuItemRadio.js +39 -0
- package/dist/components/Menu/MenuRadioGroup.d.ts +34 -0
- package/dist/components/Menu/MenuRadioGroup.js +27 -0
- package/dist/components/Menu/MenuRadioGroupContext.d.ts +17 -0
- package/dist/components/Menu/MenuRadioGroupContext.js +4 -0
- package/dist/components/Menu/MenuSeparator.d.ts +16 -0
- package/dist/components/Menu/MenuSeparator.js +20 -0
- package/dist/components/Menu/Submenu.d.ts +36 -0
- package/dist/components/Menu/Submenu.js +122 -0
- package/dist/components/Menu/index.d.ts +18 -0
- package/dist/components/Menu/useMenu.d.ts +18 -0
- package/dist/components/Menu/useMenu.js +20 -0
- package/dist/components/Menu/useMenuButton.d.ts +124 -0
- package/dist/components/Menu/useMenuButton.js +92 -0
- package/dist/components/Menu/useMenuContext.d.ts +9 -0
- package/dist/components/Menu/useMenuContext.js +10 -0
- package/dist/components/Menu/useMenuItemContent.d.ts +55 -0
- package/dist/components/Menu/useMenuItemContent.js +66 -0
- package/dist/components/Menu/useMenuPointer.d.ts +27 -0
- package/dist/components/Menu/useMenuPointer.js +56 -0
- package/dist/components/Menu/useMenuRadioGroupContext.d.ts +9 -0
- package/dist/components/Menu/useMenuRadioGroupContext.js +10 -0
- package/dist/components/MenuSurface/MenuSurface.css +1 -0
- package/dist/components/MenuSurface/MenuSurface.module.js +16 -0
- package/dist/components/Menubar/Menubar.css +1 -0
- package/dist/components/Menubar/Menubar.d.ts +23 -0
- package/dist/components/Menubar/Menubar.js +67 -0
- package/dist/components/Menubar/Menubar.module.js +7 -0
- package/dist/components/Menubar/MenubarContext.d.ts +29 -0
- package/dist/components/Menubar/MenubarContext.js +4 -0
- package/dist/components/Menubar/MenubarMenu.d.ts +26 -0
- package/dist/components/Menubar/MenubarMenu.js +88 -0
- package/dist/components/Menubar/findOpenMenubarItem.d.ts +7 -0
- package/dist/components/Menubar/findOpenMenubarItem.js +6 -0
- package/dist/components/Menubar/index.d.ts +4 -0
- package/dist/components/Menubar/menubarItems.d.ts +7 -0
- package/dist/components/Menubar/menubarItems.js +5 -0
- package/dist/components/Menubar/useMenubarContext.d.ts +9 -0
- package/dist/components/Menubar/useMenubarContext.js +10 -0
- package/dist/components/NavBar/NavBar.css +1 -0
- package/dist/components/NavBar/NavBar.d.ts +53 -0
- package/dist/components/NavBar/NavBar.js +97 -0
- package/dist/components/NavBar/NavBar.module.js +22 -0
- package/dist/components/NavBar/NavBarContext.d.ts +21 -0
- package/dist/components/NavBar/NavBarContext.js +4 -0
- package/dist/components/NavBar/NavBarItem.d.ts +32 -0
- package/dist/components/NavBar/NavBarItem.js +18 -0
- package/dist/components/NavBar/NavBarMenu.d.ts +32 -0
- package/dist/components/NavBar/NavBarMenu.js +84 -0
- package/dist/components/NavBar/NavBarMenuGroup.d.ts +25 -0
- package/dist/components/NavBar/NavBarMenuGroup.js +40 -0
- package/dist/components/NavBar/NavBarMenuItem.d.ts +36 -0
- package/dist/components/NavBar/NavBarMenuItem.js +49 -0
- package/dist/components/NavBar/index.d.ts +10 -0
- package/dist/components/NavBar/isNavBarCollapsed.d.ts +8 -0
- package/dist/components/NavBar/isNavBarCollapsed.js +5 -0
- package/dist/components/NavBar/leavesPageInPlace.d.ts +12 -0
- package/dist/components/NavBar/leavesPageInPlace.js +29 -0
- package/dist/components/NavBar/renderNavBarLink.d.ts +12 -0
- package/dist/components/NavBar/renderNavBarLink.js +16 -0
- package/dist/components/NavBar/useLayoutSwitch.d.ts +26 -0
- package/dist/components/NavBar/useLayoutSwitch.js +25 -0
- package/dist/components/NavBar/useNavBarContext.d.ts +9 -0
- package/dist/components/NavBar/useNavBarContext.js +10 -0
- package/dist/components/NavList/NavList.css +1 -0
- package/dist/components/NavList/NavList.d.ts +20 -0
- package/dist/components/NavList/NavList.js +27 -0
- package/dist/components/NavList/NavList.module.js +11 -0
- package/dist/components/NavList/NavListGroup.d.ts +25 -0
- package/dist/components/NavList/NavListGroup.js +39 -0
- package/dist/components/NavList/NavListItem.d.ts +49 -0
- package/dist/components/NavList/NavListItem.js +56 -0
- package/dist/components/NavList/index.d.ts +6 -0
- package/dist/components/Overlay/Overlay.css +1 -0
- package/dist/components/Overlay/Overlay.d.ts +33 -0
- package/dist/components/Overlay/Overlay.js +35 -0
- package/dist/components/Overlay/Overlay.module.js +3 -0
- package/dist/components/Overlay/index.d.ts +1 -0
- package/dist/components/PageLayout/PageLayout.css +1 -0
- package/dist/components/PageLayout/PageLayout.d.ts +26 -0
- package/dist/components/PageLayout/PageLayout.js +17 -0
- package/dist/components/PageLayout/PageLayout.module.js +3 -0
- package/dist/components/PageLayout/index.d.ts +2 -0
- package/dist/components/Popover/Popover.css +1 -0
- package/dist/components/Popover/Popover.d.ts +52 -0
- package/dist/components/Popover/Popover.js +20 -0
- package/dist/components/Popover/Popover.module.js +3 -0
- package/dist/components/Popover/index.d.ts +4 -0
- package/dist/components/Popover/usePopover.d.ts +96 -0
- package/dist/components/Popover/usePopover.js +71 -0
- package/dist/components/Prose/Prose.css +1 -0
- package/dist/components/Prose/Prose.d.ts +50 -0
- package/dist/components/Prose/Prose.js +15 -0
- package/dist/components/Prose/Prose.module.js +3 -0
- package/dist/components/Prose/index.d.ts +2 -0
- package/dist/components/Radio/Radio.d.ts +29 -0
- package/dist/components/Radio/Radio.js +23 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/RadioGroup/RadioGroup.css +1 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +58 -0
- package/dist/components/RadioGroup/RadioGroup.js +36 -0
- package/dist/components/RadioGroup/RadioGroup.module.js +3 -0
- package/dist/components/RadioGroup/index.d.ts +2 -0
- package/dist/components/RequiredIndicator/RequiredIndicator.css +1 -0
- package/dist/components/RequiredIndicator/RequiredIndicator.d.ts +6 -0
- package/dist/components/RequiredIndicator/RequiredIndicator.js +15 -0
- package/dist/components/RequiredIndicator/RequiredIndicator.module.js +3 -0
- package/dist/components/RequiredIndicator/index.d.ts +1 -0
- package/dist/components/Row/Row.d.ts +29 -0
- package/dist/components/Row/Row.js +13 -0
- package/dist/components/Row/index.d.ts +2 -0
- package/dist/components/SegmentedControl/Segment.d.ts +24 -0
- package/dist/components/SegmentedControl/Segment.js +41 -0
- package/dist/components/SegmentedControl/SegmentedControl.css +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +25 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +19 -0
- package/dist/components/SegmentedControl/SegmentedControl.module.js +9 -0
- package/dist/components/SegmentedControl/index.d.ts +4 -0
- package/dist/components/Select/Select.d.ts +27 -0
- package/dist/components/Select/Select.js +11 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.css +1 -0
- package/dist/components/Sidebar/Sidebar.d.ts +42 -0
- package/dist/components/Sidebar/Sidebar.js +23 -0
- package/dist/components/Sidebar/Sidebar.module.js +3 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/SkipLink/SkipLink.css +1 -0
- package/dist/components/SkipLink/SkipLink.d.ts +20 -0
- package/dist/components/SkipLink/SkipLink.js +20 -0
- package/dist/components/SkipLink/SkipLink.module.js +3 -0
- package/dist/components/SkipLink/index.d.ts +2 -0
- package/dist/components/Spinner/Spinner.css +1 -0
- package/dist/components/Spinner/Spinner.d.ts +13 -0
- package/dist/components/Spinner/Spinner.js +32 -0
- package/dist/components/Spinner/Spinner.module.js +7 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/Stack/Stack.css +1 -0
- package/dist/components/Stack/Stack.d.ts +25 -0
- package/dist/components/Stack/Stack.js +20 -0
- package/dist/components/Stack/Stack.module.js +3 -0
- package/dist/components/Stack/index.d.ts +2 -0
- package/dist/components/StatusDot/StatusDot.css +1 -0
- package/dist/components/StatusDot/StatusDot.d.ts +57 -0
- package/dist/components/StatusDot/StatusDot.js +20 -0
- package/dist/components/StatusDot/StatusDot.module.js +3 -0
- package/dist/components/StatusDot/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +24 -0
- package/dist/components/Switch/Switch.js +12 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switcher/Switcher.css +1 -0
- package/dist/components/Switcher/Switcher.d.ts +27 -0
- package/dist/components/Switcher/Switcher.js +22 -0
- package/dist/components/Switcher/Switcher.module.js +3 -0
- package/dist/components/Switcher/index.d.ts +2 -0
- package/dist/components/Tabs/Tab.d.ts +26 -0
- package/dist/components/Tabs/Tab.js +60 -0
- package/dist/components/Tabs/TabList.d.ts +16 -0
- package/dist/components/Tabs/TabList.js +22 -0
- package/dist/components/Tabs/TabPanel.d.ts +24 -0
- package/dist/components/Tabs/TabPanel.js +21 -0
- package/dist/components/Tabs/Tabs.css +1 -0
- package/dist/components/Tabs/Tabs.d.ts +81 -0
- package/dist/components/Tabs/Tabs.js +30 -0
- package/dist/components/Tabs/Tabs.module.js +8 -0
- package/dist/components/Tabs/TabsContext.d.ts +39 -0
- package/dist/components/Tabs/TabsContext.js +4 -0
- package/dist/components/Tabs/index.d.ts +8 -0
- package/dist/components/Tabs/tabIds.d.ts +16 -0
- package/dist/components/Tabs/tabIds.js +9 -0
- package/dist/components/Tabs/useTabsContext.d.ts +9 -0
- package/dist/components/Tabs/useTabsContext.js +10 -0
- package/dist/components/Text/Text.css +1 -0
- package/dist/components/Text/Text.d.ts +40 -0
- package/dist/components/Text/Text.js +16 -0
- package/dist/components/Text/Text.module.js +3 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/TextControl/TextControl.css +1 -0
- package/dist/components/TextControl/TextControl.d.ts +22 -0
- package/dist/components/TextControl/TextControl.js +27 -0
- package/dist/components/TextControl/TextControl.module.js +3 -0
- package/dist/components/TextControl/index.d.ts +1 -0
- package/dist/components/TextInput/TextInput.d.ts +31 -0
- package/dist/components/TextInput/TextInput.js +12 -0
- package/dist/components/TextInput/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +24 -0
- package/dist/components/Textarea/Textarea.js +11 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Theme/Theme.d.ts +46 -0
- package/dist/components/Theme/Theme.js +17 -0
- package/dist/components/Theme/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.css +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +49 -0
- package/dist/components/Tooltip/Tooltip.js +21 -0
- package/dist/components/Tooltip/Tooltip.module.js +3 -0
- package/dist/components/Tooltip/index.d.ts +4 -0
- package/dist/components/Tooltip/tooltipCoordinator.d.ts +14 -0
- package/dist/components/Tooltip/tooltipCoordinator.js +16 -0
- package/dist/components/Tooltip/useTooltip.d.ts +119 -0
- package/dist/components/Tooltip/useTooltip.js +73 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.css +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +14 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +19 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.module.js +3 -0
- package/dist/components/VisuallyHidden/index.d.ts +2 -0
- package/dist/errors/MissingContextError.d.ts +11 -0
- package/dist/errors/MissingContextError.js +8 -0
- package/dist/errors/PopoverRefusedError.d.ts +12 -0
- package/dist/errors/PopoverRefusedError.js +8 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/forms/ControlSize.d.ts +4 -0
- package/dist/forms/FieldContext.d.ts +34 -0
- package/dist/forms/FieldContext.js +4 -0
- package/dist/forms/RadioGroupContext.d.ts +34 -0
- package/dist/forms/RadioGroupContext.js +4 -0
- package/dist/forms/hasContent.d.ts +10 -0
- package/dist/forms/hasContent.js +6 -0
- package/dist/forms/index.d.ts +8 -0
- package/dist/forms/useFieldControl.d.ts +36 -0
- package/dist/forms/useFieldControl.js +28 -0
- package/dist/forms/useRadioGroupItem.d.ts +50 -0
- package/dist/forms/useRadioGroupItem.js +26 -0
- package/dist/index.d.ts +107 -0
- package/dist/index.js +92 -0
- package/dist/layout/Space.d.ts +4 -0
- package/dist/layout/alignment.d.ts +8 -0
- package/dist/layout/index.d.ts +5 -0
- package/dist/layout/listRole.d.ts +11 -0
- package/dist/layout/listRole.js +5 -0
- package/dist/layout/spaceValue.d.ts +8 -0
- package/dist/layout/spaceValue.js +5 -0
- package/dist/layout/withCustomProperties.d.ts +9 -0
- package/dist/layout/withCustomProperties.js +8 -0
- package/dist/links/LinkOrButtonProps.d.ts +17 -0
- package/dist/links/index.d.ts +1 -0
- package/dist/menus/closeWhenFocusLeaves.d.ts +9 -0
- package/dist/menus/closeWhenFocusLeaves.js +11 -0
- package/dist/menus/focusItem.d.ts +6 -0
- package/dist/menus/focusItem.js +9 -0
- package/dist/menus/focusOnOpening.d.ts +11 -0
- package/dist/menus/focusOnOpening.js +11 -0
- package/dist/menus/hasModifier.d.ts +7 -0
- package/dist/menus/hasModifier.js +5 -0
- package/dist/menus/index.d.ts +11 -0
- package/dist/menus/itemText.d.ts +8 -0
- package/dist/menus/itemText.js +6 -0
- package/dist/menus/leaveMenuOnTab.d.ts +9 -0
- package/dist/menus/leaveMenuOnTab.js +6 -0
- package/dist/menus/pointerIntent.d.ts +36 -0
- package/dist/menus/pointerIntent.js +68 -0
- package/dist/menus/renderedItems.d.ts +8 -0
- package/dist/menus/renderedItems.js +4 -0
- package/dist/menus/watchRemovals.d.ts +8 -0
- package/dist/menus/watchRemovals.js +23 -0
- package/dist/overlays/OverlayDelay.d.ts +13 -0
- package/dist/overlays/OverlayPlacement.d.ts +6 -0
- package/dist/overlays/anchorNameFor.d.ts +7 -0
- package/dist/overlays/anchorNameFor.js +5 -0
- package/dist/overlays/index.d.ts +6 -0
- package/dist/overlays/mergeProps.d.ts +13 -0
- package/dist/overlays/mergeProps.js +29 -0
- package/dist/overlays/syncPopover.d.ts +11 -0
- package/dist/overlays/syncPopover.js +24 -0
- package/dist/overlays/useOverlay.d.ts +71 -0
- package/dist/overlays/useOverlay.js +49 -0
- package/dist/styles.css +1 -0
- package/fonts/playful.css +3 -0
- package/package.json +103 -3
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Overlay as e } from "../Overlay/Overlay.js";
|
|
2
|
+
import t from "./Tooltip.module.js";
|
|
3
|
+
import { clsx as n } from "clsx";
|
|
4
|
+
import { c as r } from "react/compiler-runtime";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
7
|
+
function a(a) {
|
|
8
|
+
let o = r(8), s, c;
|
|
9
|
+
o[0] === a ? (s = o[1], c = o[2]) : ({className: s, ...c} = a, o[0] = a, o[1] = s, o[2] = c);
|
|
10
|
+
let l;
|
|
11
|
+
o[3] === s ? l = o[4] : (l = n(t.tooltip, s), o[3] = s, o[4] = l);
|
|
12
|
+
let u;
|
|
13
|
+
return o[5] !== c || o[6] !== l ? (u = /* @__PURE__ */ i(e, {
|
|
14
|
+
...c,
|
|
15
|
+
as: "span",
|
|
16
|
+
className: l,
|
|
17
|
+
popover: "manual",
|
|
18
|
+
role: "tooltip"
|
|
19
|
+
}), o[5] = c, o[6] = l, o[7] = u) : u = o[7], u;
|
|
20
|
+
}
|
|
21
|
+
export { a as Tooltip };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Records a tooltip as the one open tooltip, hiding the tooltip that was open before it
|
|
3
|
+
*
|
|
4
|
+
* @param id the claiming tooltip's id
|
|
5
|
+
* @param hide hides the claiming tooltip when a later tooltip claims
|
|
6
|
+
* @returns releases the claim; call it when the tooltip closes or unmounts
|
|
7
|
+
*/
|
|
8
|
+
export declare function claimTooltip(id: string, hide: () => void): () => void;
|
|
9
|
+
/**
|
|
10
|
+
* Whether a tooltip opening now should skip its show delay
|
|
11
|
+
*
|
|
12
|
+
* @returns true while a tooltip is open, and for 300ms after the last one closes
|
|
13
|
+
*/
|
|
14
|
+
export declare function isTooltipWarm(): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/components/Tooltip/tooltipCoordinator.ts
|
|
2
|
+
var e = null, t = -Infinity;
|
|
3
|
+
function n(n, r) {
|
|
4
|
+
e !== null && e.id !== n && e.hide();
|
|
5
|
+
let i = {
|
|
6
|
+
hide: r,
|
|
7
|
+
id: n
|
|
8
|
+
};
|
|
9
|
+
return e = i, () => {
|
|
10
|
+
e === i && (e = null, t = Date.now());
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function r() {
|
|
14
|
+
return e !== null || Date.now() - t < 300;
|
|
15
|
+
}
|
|
16
|
+
export { n as claimTooltip, r as isTooltipWarm };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { CSSProperties, FocusEventHandler, MouseEventHandler, PointerEventHandler } from "react";
|
|
2
|
+
import type { OverlayDelay, OverlayPlacement } from "../../overlays";
|
|
3
|
+
import type { TooltipOverlayProps } from "./Tooltip";
|
|
4
|
+
/**
|
|
5
|
+
* Whether a tooltip names its trigger or describes it
|
|
6
|
+
*/
|
|
7
|
+
export type TooltipRelationship = "description" | "label";
|
|
8
|
+
/**
|
|
9
|
+
* Options for `useTooltip`
|
|
10
|
+
*/
|
|
11
|
+
export interface UseTooltipOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Whether the tooltip starts open when uncontrolled. Defaults to `false`.
|
|
14
|
+
*/
|
|
15
|
+
defaultOpen?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Show and hide delays. Defaults to 400ms to show and 150ms to hide; an omitted field keeps its default. A hide
|
|
18
|
+
* delay too short for the pointer to cross from the trigger to the tooltip hides the tooltip on the way.
|
|
19
|
+
*/
|
|
20
|
+
delay?: OverlayDelay;
|
|
21
|
+
/**
|
|
22
|
+
* Called with the requested open state whenever the tooltip asks to open or close
|
|
23
|
+
*/
|
|
24
|
+
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Controls whether the tooltip is open. The hook then only reports through `onOpenChange`.
|
|
27
|
+
*/
|
|
28
|
+
open?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Side of the trigger the tooltip opens on. It flips to the opposite side when there is no room. Defaults to `top`.
|
|
31
|
+
*/
|
|
32
|
+
placement?: OverlayPlacement;
|
|
33
|
+
/**
|
|
34
|
+
* `label` makes the tooltip the trigger's accessible name, for a trigger with no text of its own, and
|
|
35
|
+
* `description` adds it as the trigger's description. Defaults to `description`.
|
|
36
|
+
*/
|
|
37
|
+
relationship?: TooltipRelationship;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Props `getTriggerProps` sets on the trigger
|
|
41
|
+
*/
|
|
42
|
+
interface TooltipTriggerProps {
|
|
43
|
+
/**
|
|
44
|
+
* The tooltip's id when it describes the trigger
|
|
45
|
+
*/
|
|
46
|
+
"aria-describedby"?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The tooltip's id when it names the trigger
|
|
49
|
+
*/
|
|
50
|
+
"aria-labelledby"?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Hides the tooltip
|
|
53
|
+
*/
|
|
54
|
+
onBlur: FocusEventHandler<HTMLElement>;
|
|
55
|
+
/**
|
|
56
|
+
* Hides the tooltip when the keyboard presses the trigger
|
|
57
|
+
*/
|
|
58
|
+
onClick: MouseEventHandler<HTMLElement>;
|
|
59
|
+
/**
|
|
60
|
+
* Shows the tooltip when focus arrives from the keyboard
|
|
61
|
+
*/
|
|
62
|
+
onFocus: FocusEventHandler<HTMLElement>;
|
|
63
|
+
/**
|
|
64
|
+
* Hides the tooltip
|
|
65
|
+
*/
|
|
66
|
+
onPointerDown: PointerEventHandler<HTMLElement>;
|
|
67
|
+
/**
|
|
68
|
+
* Shows the tooltip after the show delay, for a mouse or pen
|
|
69
|
+
*/
|
|
70
|
+
onPointerEnter: PointerEventHandler<HTMLElement>;
|
|
71
|
+
/**
|
|
72
|
+
* Cancels a pending show and hides the tooltip after the hide delay, for a mouse or pen, unless keyboard focus
|
|
73
|
+
* opened the tooltip and it is still open
|
|
74
|
+
*/
|
|
75
|
+
onPointerLeave: PointerEventHandler<HTMLElement>;
|
|
76
|
+
/**
|
|
77
|
+
* Names the trigger as the tooltip's anchor
|
|
78
|
+
*/
|
|
79
|
+
style: CSSProperties;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Prop getters for a tooltip's trigger and the `Tooltip`, and whether the tooltip is open
|
|
83
|
+
*/
|
|
84
|
+
export interface UseTooltipResult {
|
|
85
|
+
/**
|
|
86
|
+
* Returns the props to spread on the `Tooltip`, merged with any given
|
|
87
|
+
*/
|
|
88
|
+
getOverlayProps: <Props extends object>(props?: Props & Partial<TooltipOverlayProps>) => Omit<Props, keyof TooltipOverlayProps> & TooltipOverlayProps;
|
|
89
|
+
/**
|
|
90
|
+
* Returns the props to spread on the trigger, merged with any given: where both set a handler, both run, the given
|
|
91
|
+
* one first; the tooltip's id comes before any given `aria-describedby` or `aria-labelledby` ids; and `style`
|
|
92
|
+
* objects merge
|
|
93
|
+
*/
|
|
94
|
+
getTriggerProps: <Props extends object>(props?: Props & Partial<TooltipTriggerProps>) => Omit<Props, keyof TooltipTriggerProps> & TooltipTriggerProps;
|
|
95
|
+
/**
|
|
96
|
+
* Whether the tooltip is open
|
|
97
|
+
*/
|
|
98
|
+
open: boolean;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Connects a `Tooltip` to the element it belongs to. Spread `getTriggerProps()` on that element and
|
|
102
|
+
* `getOverlayProps()` on the `Tooltip`. The tooltip opens after the show delay when a mouse or pen rests on the
|
|
103
|
+
* trigger and at once when the trigger takes keyboard focus, or once the popover has closed when closing a popover
|
|
104
|
+
* returns keyboard focus to the trigger. It stays open while the pointer is over the tooltip, and hides after the hide
|
|
105
|
+
* delay once the pointer leaves both, or at once on blur, on Escape and when the trigger is pressed. A tooltip that
|
|
106
|
+
* keyboard focus opened stays open when the pointer leaves, until blur or Escape. Only one tooltip is open at a time,
|
|
107
|
+
* and while one is open, or for 300ms after it closes, the next opens without its show delay.
|
|
108
|
+
*
|
|
109
|
+
* @param options open state, delays, placement and how the tooltip relates to its trigger
|
|
110
|
+
* @returns prop getters for the trigger and the `Tooltip`, and whether the tooltip is open
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* const tooltip = useTooltip({ relationship: "label" });
|
|
114
|
+
*
|
|
115
|
+
* <Button {...tooltip.getTriggerProps()}><CopyIcon /></Button>
|
|
116
|
+
* <Tooltip {...tooltip.getOverlayProps()}>Copy link</Tooltip>
|
|
117
|
+
*/
|
|
118
|
+
export declare function useTooltip({ defaultOpen, delay, onOpenChange, open: controlledOpen, placement, relationship, }?: UseTooltipOptions): UseTooltipResult;
|
|
119
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { mergeProps as e } from "../../overlays/mergeProps.js";
|
|
2
|
+
import { useOverlay as t } from "../../overlays/useOverlay.js";
|
|
3
|
+
import { claimTooltip as n, isTooltipWarm as r } from "./tooltipCoordinator.js";
|
|
4
|
+
import { useEffect as i, useEffectEvent as a, useRef as o } from "react";
|
|
5
|
+
// src/components/Tooltip/useTooltip.ts
|
|
6
|
+
var s = {
|
|
7
|
+
hide: 150,
|
|
8
|
+
show: 400
|
|
9
|
+
};
|
|
10
|
+
function c({ defaultOpen: c = !1, delay: u, onOpenChange: d, open: f, placement: p = "top", relationship: m = "description" } = {}) {
|
|
11
|
+
let h = t({
|
|
12
|
+
defaultOpen: c,
|
|
13
|
+
delay: {
|
|
14
|
+
hide: u?.hide ?? s.hide,
|
|
15
|
+
show: u?.show ?? s.show
|
|
16
|
+
},
|
|
17
|
+
onOpenChange: d,
|
|
18
|
+
open: f
|
|
19
|
+
}), g = o(!1), _ = a(() => h.hide()), { id: v, open: y } = h;
|
|
20
|
+
i(() => {
|
|
21
|
+
if (y) return n(v, () => _());
|
|
22
|
+
}, [v, y]), i(() => {
|
|
23
|
+
y || (g.current = !1);
|
|
24
|
+
}, [y]);
|
|
25
|
+
function b(e) {
|
|
26
|
+
e.pointerType !== "touch" && (r() ? h.show() : h.showAfterDelay());
|
|
27
|
+
}
|
|
28
|
+
function x(e) {
|
|
29
|
+
e.pointerType !== "touch" && !(g.current && y) && h.hideAfterDelay();
|
|
30
|
+
}
|
|
31
|
+
function S(e) {
|
|
32
|
+
g.current = e.currentTarget.matches(":focus-visible"), g.current && (l(e) ? h.showAfterTask() : h.show());
|
|
33
|
+
}
|
|
34
|
+
function C() {
|
|
35
|
+
g.current = !1, h.hide();
|
|
36
|
+
}
|
|
37
|
+
function w(e) {
|
|
38
|
+
e.detail === 0 && h.hide();
|
|
39
|
+
}
|
|
40
|
+
let T = {
|
|
41
|
+
anchorName: h.anchorName,
|
|
42
|
+
id: h.id,
|
|
43
|
+
onPointerEnter: h.cancelDelay,
|
|
44
|
+
onPointerLeave: x,
|
|
45
|
+
open: h.open,
|
|
46
|
+
placement: p
|
|
47
|
+
}, E = {
|
|
48
|
+
...m === "label" ? { "aria-labelledby": h.id } : { "aria-describedby": h.id },
|
|
49
|
+
onBlur: C,
|
|
50
|
+
onClick: w,
|
|
51
|
+
onFocus: S,
|
|
52
|
+
onPointerDown: h.hide,
|
|
53
|
+
onPointerEnter: b,
|
|
54
|
+
onPointerLeave: x,
|
|
55
|
+
style: { anchorName: h.anchorName }
|
|
56
|
+
};
|
|
57
|
+
function D(t) {
|
|
58
|
+
return e(t, T);
|
|
59
|
+
}
|
|
60
|
+
function O(t) {
|
|
61
|
+
return e(t, E);
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
getOverlayProps: D,
|
|
65
|
+
getTriggerProps: O,
|
|
66
|
+
open: h.open
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function l(e) {
|
|
70
|
+
let t = e.relatedTarget instanceof Element ? e.relatedTarget.closest("[popover]") : null;
|
|
71
|
+
return t !== null && !t.matches(":popover-open");
|
|
72
|
+
}
|
|
73
|
+
export { c as useTooltip };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.sui-visuallyHidden-KiAzg{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { BoxElement, BoxProps } from "../Box";
|
|
3
|
+
/**
|
|
4
|
+
* Props for `VisuallyHidden`: every prop supported by the element given in `as`
|
|
5
|
+
*/
|
|
6
|
+
export type VisuallyHiddenProps<E extends BoxElement = "span"> = BoxProps<E>;
|
|
7
|
+
/**
|
|
8
|
+
* Hides its content from view while keeping it in the accessibility tree, for text that only
|
|
9
|
+
* assistive technology needs, such as the name of an icon-only button
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <Button><span aria-hidden={true}>×</span><VisuallyHidden>Close</VisuallyHidden></Button>
|
|
13
|
+
*/
|
|
14
|
+
export declare function VisuallyHidden<E extends BoxElement = "span">({ as, className, ...rest }: VisuallyHiddenProps<E>): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Box as e } from "../Box/Box.js";
|
|
2
|
+
import t from "./VisuallyHidden.module.js";
|
|
3
|
+
import { clsx as n } from "clsx";
|
|
4
|
+
import { c as r } from "react/compiler-runtime";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
// src/components/VisuallyHidden/VisuallyHidden.tsx
|
|
7
|
+
function a(a) {
|
|
8
|
+
let o = r(10), s, c, l;
|
|
9
|
+
o[0] === a ? (s = o[1], c = o[2], l = o[3]) : ({as: s, className: c, ...l} = a, o[0] = a, o[1] = s, o[2] = c, o[3] = l);
|
|
10
|
+
let u = l, d = s ?? "span", f;
|
|
11
|
+
o[4] === c ? f = o[5] : (f = n(t.visuallyHidden, c), o[4] = c, o[5] = f);
|
|
12
|
+
let p;
|
|
13
|
+
return o[6] !== u || o[7] !== d || o[8] !== f ? (p = /* @__PURE__ */ i(e, {
|
|
14
|
+
...u,
|
|
15
|
+
as: d,
|
|
16
|
+
className: f
|
|
17
|
+
}), o[6] = u, o[7] = d, o[8] = f, o[9] = p) : p = o[9], p;
|
|
18
|
+
}
|
|
19
|
+
export { a as VisuallyHidden };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown when a part of a compound component renders outside the component that provides its state
|
|
3
|
+
*/
|
|
4
|
+
export declare class MissingContextError extends Error {
|
|
5
|
+
readonly name = "MissingContextError";
|
|
6
|
+
/**
|
|
7
|
+
* @param part the part that rendered, such as `Tab`
|
|
8
|
+
* @param provider the component it must render inside, such as `Tabs`
|
|
9
|
+
*/
|
|
10
|
+
constructor(part: string, provider: string);
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown when the browser refuses to show or hide a popover, even once it has finished showing or hiding another
|
|
3
|
+
*/
|
|
4
|
+
export declare class PopoverRefusedError extends Error {
|
|
5
|
+
readonly name = "PopoverRefusedError";
|
|
6
|
+
/**
|
|
7
|
+
* @param popover the popover the browser refused
|
|
8
|
+
* @param open whether the browser was asked to show the popover rather than hide it
|
|
9
|
+
* @param cause the browser's refusal
|
|
10
|
+
*/
|
|
11
|
+
constructor(popover: HTMLElement, open: boolean, cause: DOMException);
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// src/errors/PopoverRefusedError.ts
|
|
2
|
+
var e = class extends Error {
|
|
3
|
+
name = "PopoverRefusedError";
|
|
4
|
+
constructor(e, t, n) {
|
|
5
|
+
super(`The browser refused to ${t ? "show" : "hide"} the popover with id "${e.id}"`, { cause: n });
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
export { e as PopoverRefusedError };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State a `Field` shares with the control it holds
|
|
3
|
+
*/
|
|
4
|
+
export interface FieldContextValue {
|
|
5
|
+
/**
|
|
6
|
+
* The `id` the control must render, so the label points at it
|
|
7
|
+
*/
|
|
8
|
+
controlId: string;
|
|
9
|
+
/**
|
|
10
|
+
* Space-separated ids of the description and error, or undefined when the field renders neither
|
|
11
|
+
*/
|
|
12
|
+
describedBy: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the field disables its control
|
|
15
|
+
*/
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the field shows an error for its control
|
|
19
|
+
*/
|
|
20
|
+
invalid: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The label's `id`, for a part of the control that the label names but cannot point at, such as a combobox's list;
|
|
23
|
+
* undefined when the field has no label
|
|
24
|
+
*/
|
|
25
|
+
labelId: string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the control must be filled in
|
|
28
|
+
*/
|
|
29
|
+
required: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Carries a `Field`'s state to its control; null when the control is not inside a `Field`
|
|
33
|
+
*/
|
|
34
|
+
export declare const FieldContext: import("react").Context<FieldContextValue | null>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State a `RadioGroup` shares with the radios it holds
|
|
3
|
+
*/
|
|
4
|
+
interface RadioGroupContextValue {
|
|
5
|
+
/**
|
|
6
|
+
* The value selected at first when the group is uncontrolled, or undefined when the group sets none
|
|
7
|
+
*/
|
|
8
|
+
defaultValue: string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the group shows an error, which each radio draws on its own box
|
|
11
|
+
*/
|
|
12
|
+
invalid: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The `name` every radio renders, so the browser lets only one of them be selected
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Called with the value of the radio the user selects, after that radio's own `onChange`
|
|
19
|
+
*/
|
|
20
|
+
onValueChange: ((value: string) => void) | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Whether one radio must be selected, which each radio renders as the native `required`
|
|
23
|
+
*/
|
|
24
|
+
required: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The value selected when the group is controlled, or undefined when the group is uncontrolled
|
|
27
|
+
*/
|
|
28
|
+
value: string | undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Carries a `RadioGroup`'s state to its radios; null when a radio is not inside a `RadioGroup`
|
|
32
|
+
*/
|
|
33
|
+
export declare const RadioGroupContext: import("react").Context<RadioGroupContextValue | null>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Tells whether a node holds a value other than an empty one, so an empty `description` or `error` slot can be
|
|
4
|
+
* skipped
|
|
5
|
+
*
|
|
6
|
+
* @param node the node to check
|
|
7
|
+
* @returns false for `undefined`, `null`, a boolean, an empty string, and an array or fragment holding only those;
|
|
8
|
+
* otherwise true, including for a component that renders nothing
|
|
9
|
+
*/
|
|
10
|
+
export declare function hasContent(node: ReactNode): boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Fragment as e, isValidElement as t } from "react";
|
|
2
|
+
// src/forms/hasContent.ts
|
|
3
|
+
function n(r) {
|
|
4
|
+
return Array.isArray(r) ? r.some(n) : t(r) && r.type === e ? n(r.props.children) : r != null && typeof r != "boolean" && r !== "";
|
|
5
|
+
}
|
|
6
|
+
export { n as hasContent };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { ControlSize } from "./ControlSize";
|
|
2
|
+
export { FieldContext } from "./FieldContext";
|
|
3
|
+
export type { FieldContextValue } from "./FieldContext";
|
|
4
|
+
export { hasContent } from "./hasContent";
|
|
5
|
+
export { RadioGroupContext } from "./RadioGroupContext";
|
|
6
|
+
export { useFieldControl } from "./useFieldControl";
|
|
7
|
+
export type { FieldControlProps } from "./useFieldControl";
|
|
8
|
+
export { useRadioGroupItem } from "./useRadioGroupItem";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AriaAttributes } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The props a form control passes to `useFieldControl` and renders from what it returns
|
|
4
|
+
*/
|
|
5
|
+
export interface FieldControlProps {
|
|
6
|
+
/**
|
|
7
|
+
* Ids of the elements that describe the control, separated by spaces
|
|
8
|
+
*/
|
|
9
|
+
"aria-describedby"?: AriaAttributes["aria-describedby"];
|
|
10
|
+
/**
|
|
11
|
+
* Whether the control's value fails validation
|
|
12
|
+
*/
|
|
13
|
+
"aria-invalid"?: AriaAttributes["aria-invalid"];
|
|
14
|
+
/**
|
|
15
|
+
* Whether the control is disabled
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The control's `id`, which a label points at
|
|
20
|
+
*/
|
|
21
|
+
id?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the control must be filled in
|
|
24
|
+
*/
|
|
25
|
+
required?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Merges the state of the surrounding `Field` into a form control's own props
|
|
29
|
+
*
|
|
30
|
+
* @param props the control's own `aria-describedby`, `aria-invalid`, `disabled`, `id` and `required`
|
|
31
|
+
* @returns the props to render on the control. Outside a `Field` they are the given props. Inside one, the
|
|
32
|
+
* field's control id replaces the control's own `id`, the field's description and error ids come before the
|
|
33
|
+
* control's own `aria-describedby`, and the control's own `aria-invalid`, `disabled` and `required` win over
|
|
34
|
+
* the field's, which are left absent rather than false.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useFieldControl({ "aria-describedby": ownDescribedBy, "aria-invalid": ownInvalid, disabled: ownDisabled, id: ownId, required: ownRequired, }: FieldControlProps): FieldControlProps;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FieldContext as e } from "./FieldContext.js";
|
|
2
|
+
import { useContext as t } from "react";
|
|
3
|
+
import { c as n } from "react/compiler-runtime";
|
|
4
|
+
// src/forms/useFieldControl.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let i = n(15), { "aria-describedby": a, "aria-invalid": o, disabled: s, id: c, required: l } = r, u = t(e);
|
|
7
|
+
if (u === null) {
|
|
8
|
+
let e;
|
|
9
|
+
return i[0] !== a || i[1] !== s || i[2] !== c || i[3] !== o || i[4] !== l ? (e = {
|
|
10
|
+
"aria-describedby": a,
|
|
11
|
+
"aria-invalid": o,
|
|
12
|
+
disabled: s,
|
|
13
|
+
id: c,
|
|
14
|
+
required: l
|
|
15
|
+
}, i[0] = a, i[1] = s, i[2] = c, i[3] = o, i[4] = l, i[5] = e) : e = i[5], e;
|
|
16
|
+
}
|
|
17
|
+
let d;
|
|
18
|
+
i[6] !== u.describedBy || i[7] !== a ? (d = [u.describedBy, a].filter(Boolean), i[6] = u.describedBy, i[7] = a, i[8] = d) : d = i[8];
|
|
19
|
+
let f = d.join(" "), p = f === "" ? void 0 : f, m = o ?? (u.invalid || void 0), h = s ?? (u.disabled || void 0), g = l ?? (u.required || void 0), _;
|
|
20
|
+
return i[9] !== u.controlId || i[10] !== p || i[11] !== m || i[12] !== h || i[13] !== g ? (_ = {
|
|
21
|
+
"aria-describedby": p,
|
|
22
|
+
"aria-invalid": m,
|
|
23
|
+
disabled: h,
|
|
24
|
+
id: u.controlId,
|
|
25
|
+
required: g
|
|
26
|
+
}, i[9] = u.controlId, i[10] = p, i[11] = m, i[12] = h, i[13] = g, i[14] = _) : _ = i[14], _;
|
|
27
|
+
}
|
|
28
|
+
export { r as useFieldControl };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ChangeEventHandler } from "react";
|
|
2
|
+
interface RadioGroupItemOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The radio's own change handler
|
|
5
|
+
*/
|
|
6
|
+
onChange: ChangeEventHandler<HTMLInputElement> | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* The value the radio stands for
|
|
9
|
+
*/
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The props a radio takes from the `RadioGroup` around it
|
|
14
|
+
*/
|
|
15
|
+
export interface RadioGroupItemProps {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the radio is selected, when the group is controlled
|
|
18
|
+
*/
|
|
19
|
+
checked?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Present when the group shows an error, so the radio can draw it
|
|
22
|
+
*/
|
|
23
|
+
"data-invalid"?: "";
|
|
24
|
+
/**
|
|
25
|
+
* Whether the radio starts selected, when the group is uncontrolled
|
|
26
|
+
*/
|
|
27
|
+
defaultChecked?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The group's shared name
|
|
30
|
+
*/
|
|
31
|
+
name?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The radio's own handler, followed inside a group by reporting the radio's value to the group
|
|
34
|
+
*/
|
|
35
|
+
onChange: ChangeEventHandler<HTMLInputElement> | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the group needs an answer
|
|
38
|
+
*/
|
|
39
|
+
required?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Connects a radio to the `RadioGroup` around it
|
|
43
|
+
*
|
|
44
|
+
* @param options the radio's own `onChange` and its `value`
|
|
45
|
+
* @returns the props to spread on the radio input after its own. Outside a group, only the radio's `onChange`. Inside
|
|
46
|
+
* one: the selection from the group's `value` or `defaultValue`, the group's `name` and `required`, `data-invalid`
|
|
47
|
+
* while the group has an error, and an `onChange` that runs the radio's own and then reports its value to the group.
|
|
48
|
+
*/
|
|
49
|
+
export declare function useRadioGroupItem({ onChange, value }: RadioGroupItemOptions): RadioGroupItemProps;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RadioGroupContext as e } from "./RadioGroupContext.js";
|
|
2
|
+
import { useContext as t } from "react";
|
|
3
|
+
import { c as n } from "react/compiler-runtime";
|
|
4
|
+
// src/forms/useRadioGroupItem.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let i = n(16), { onChange: a, value: o } = r, s = t(e);
|
|
7
|
+
if (s === null) {
|
|
8
|
+
let e;
|
|
9
|
+
return i[0] === a ? e = i[1] : (e = { onChange: a }, i[0] = a, i[1] = e), e;
|
|
10
|
+
}
|
|
11
|
+
let c;
|
|
12
|
+
i[2] !== s.defaultValue || i[3] !== s.value || i[4] !== o ? (c = {}, s.value === void 0 ? s.defaultValue !== void 0 && (c.defaultChecked = s.defaultValue === o) : c.checked = s.value === o, i[2] = s.defaultValue, i[3] = s.value, i[4] = o, i[5] = c) : c = i[5];
|
|
13
|
+
let l = s.invalid ? "" : void 0, u;
|
|
14
|
+
i[6] !== s || i[7] !== a || i[8] !== o ? (u = (e) => {
|
|
15
|
+
a?.(e), s.onValueChange?.(o);
|
|
16
|
+
}, i[6] = s, i[7] = a, i[8] = o, i[9] = u) : u = i[9];
|
|
17
|
+
let d;
|
|
18
|
+
return i[10] !== s.name || i[11] !== s.required || i[12] !== c || i[13] !== l || i[14] !== u ? (d = {
|
|
19
|
+
...c,
|
|
20
|
+
"data-invalid": l,
|
|
21
|
+
name: s.name,
|
|
22
|
+
onChange: u,
|
|
23
|
+
required: s.required
|
|
24
|
+
}, i[10] = s.name, i[11] = s.required, i[12] = c, i[13] = l, i[14] = u, i[15] = d) : d = i[15], d;
|
|
25
|
+
}
|
|
26
|
+
export { r as useRadioGroupItem };
|