@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,40 @@
|
|
|
1
|
+
import type { HeadingLevel } from "../Heading";
|
|
2
|
+
import type { AccordionIndicator, AccordionVariant } from "./Accordion";
|
|
3
|
+
/**
|
|
4
|
+
* State an `Accordion` shares with its items
|
|
5
|
+
*/
|
|
6
|
+
export interface AccordionContextValue {
|
|
7
|
+
/**
|
|
8
|
+
* The generated id every toggle and panel id starts with
|
|
9
|
+
*/
|
|
10
|
+
baseId: string;
|
|
11
|
+
/**
|
|
12
|
+
* Level of every item's heading
|
|
13
|
+
*/
|
|
14
|
+
headingLevel: HeadingLevel;
|
|
15
|
+
/**
|
|
16
|
+
* Shape of every item's indicator
|
|
17
|
+
*/
|
|
18
|
+
indicator: AccordionIndicator;
|
|
19
|
+
/**
|
|
20
|
+
* Values of the open items
|
|
21
|
+
*/
|
|
22
|
+
openValues: readonly string[];
|
|
23
|
+
/**
|
|
24
|
+
* Whether each open panel is a region named by its title
|
|
25
|
+
*/
|
|
26
|
+
regions: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Opens the item with the given value if it is closed, or closes it if it is open, reporting the open items to
|
|
29
|
+
* `onValueChange`
|
|
30
|
+
*/
|
|
31
|
+
toggle: (value: string) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Look of the accordion and its items
|
|
34
|
+
*/
|
|
35
|
+
variant: AccordionVariant;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Carries an `Accordion`'s state to its items; null outside an `Accordion`
|
|
39
|
+
*/
|
|
40
|
+
export declare const AccordionContext: import("react").Context<AccordionContextValue | null>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from "react";
|
|
2
|
+
import type { BoxProps } from "../Box";
|
|
3
|
+
/**
|
|
4
|
+
* Props for `AccordionItem`: its own props plus every `div` prop except `dangerouslySetInnerHTML` and `title`
|
|
5
|
+
*/
|
|
6
|
+
export interface AccordionItemProps extends Omit<BoxProps<"div">, "as" | "dangerouslySetInnerHTML" | "title"> {
|
|
7
|
+
/**
|
|
8
|
+
* Controls beside the toggle, such as an `IconButton` that adds an entry to the section. They sit outside the
|
|
9
|
+
* heading, so they are not part of its text or the toggle's name.
|
|
10
|
+
*/
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The panel's content
|
|
14
|
+
*/
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Muted text under the title, inside the toggle, so it is read as part of the toggle's name
|
|
18
|
+
*/
|
|
19
|
+
description?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the item cannot be opened or closed. A disabled item stays reachable with the keyboard, so its title is
|
|
22
|
+
* read, and its closed panel is skipped by find-in-page. Defaults to `false`.
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the panel's content renders only once the item first opens, for content that is costly to render. It stays
|
|
27
|
+
* rendered after the item closes. Find-in-page and links cannot reach content that has never rendered. Defaults to
|
|
28
|
+
* `false`.
|
|
29
|
+
*/
|
|
30
|
+
lazy?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The header's text, which names the toggle and, when the accordion has regions, the panel
|
|
33
|
+
*/
|
|
34
|
+
title: ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Shown at the end of the toggle, such as a value or a `Counter`. A space separates it from the title, so it is read
|
|
37
|
+
* after it. Not for interactive content, which cannot sit inside the toggle: put controls in `actions`.
|
|
38
|
+
*/
|
|
39
|
+
trailing?: ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Identifies the item in the `Accordion`'s `value`, `defaultValue` and `onValueChange`
|
|
42
|
+
*/
|
|
43
|
+
value: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* One section of an `Accordion`: a heading holding the toggle that opens and closes it, and the panel it shows
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* <AccordionItem title="Effects" trailing={<Counter count={2} />} value="effects">…</AccordionItem>
|
|
50
|
+
*/
|
|
51
|
+
export declare function AccordionItem({ actions, children, className, description, disabled, lazy, title, trailing, value, ...rest }: AccordionItemProps): JSX.Element;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { hasContent as e } from "../../forms/hasContent.js";
|
|
2
|
+
import { Box as t } from "../Box/Box.js";
|
|
3
|
+
import n from "./Accordion.module.js";
|
|
4
|
+
import { panelId as r, titleId as i, toggleId as a } from "./accordionIds.js";
|
|
5
|
+
import { AccordionToggleContent as o } from "./AccordionToggleContent.js";
|
|
6
|
+
import { useAccordionContext as s } from "./useAccordionContext.js";
|
|
7
|
+
import { useFindablePanel as c } from "./useFindablePanel.js";
|
|
8
|
+
import { useHasOpened as l } from "./useHasOpened.js";
|
|
9
|
+
import { clsx as u } from "clsx";
|
|
10
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
|
+
// src/components/Accordion/AccordionItem.tsx
|
|
12
|
+
function p({ actions: p, children: m, className: h, description: g, disabled: _ = !1, lazy: v = !1, title: y, trailing: b, value: x, ...S }) {
|
|
13
|
+
let C = s("AccordionItem"), w = C.openValues.includes(x), T = a(C.baseId, x), E = r(C.baseId, x), D = i(C.baseId, x), O = l(w), k = c({
|
|
14
|
+
disabled: _,
|
|
15
|
+
onMatch: () => C.toggle(x),
|
|
16
|
+
open: w
|
|
17
|
+
}), A = C.regions && w ? {
|
|
18
|
+
role: "region",
|
|
19
|
+
"aria-labelledby": D
|
|
20
|
+
} : {};
|
|
21
|
+
function j() {
|
|
22
|
+
_ || C.toggle(x);
|
|
23
|
+
}
|
|
24
|
+
return /* @__PURE__ */ f(t, {
|
|
25
|
+
...S,
|
|
26
|
+
className: u(n.item, h),
|
|
27
|
+
"data-disabled": _,
|
|
28
|
+
"data-open": w,
|
|
29
|
+
children: [/* @__PURE__ */ f(t, {
|
|
30
|
+
className: n.header,
|
|
31
|
+
children: [/* @__PURE__ */ d(t, {
|
|
32
|
+
as: `h${C.headingLevel}`,
|
|
33
|
+
className: n.heading,
|
|
34
|
+
children: /* @__PURE__ */ d(t, {
|
|
35
|
+
as: "button",
|
|
36
|
+
className: n.toggle,
|
|
37
|
+
id: T,
|
|
38
|
+
onClick: j,
|
|
39
|
+
type: "button",
|
|
40
|
+
"aria-controls": E,
|
|
41
|
+
"aria-disabled": _ ? !0 : void 0,
|
|
42
|
+
"aria-expanded": w,
|
|
43
|
+
"data-variant": C.variant,
|
|
44
|
+
children: /* @__PURE__ */ d(o, {
|
|
45
|
+
description: g,
|
|
46
|
+
indicator: C.indicator,
|
|
47
|
+
title: y,
|
|
48
|
+
titleId: D,
|
|
49
|
+
trailing: b
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
}), e(p) && /* @__PURE__ */ d(t, {
|
|
53
|
+
className: n.actions,
|
|
54
|
+
children: p
|
|
55
|
+
})]
|
|
56
|
+
}), /* @__PURE__ */ d(t, {
|
|
57
|
+
className: n.panel,
|
|
58
|
+
hidden: !w,
|
|
59
|
+
id: E,
|
|
60
|
+
ref: k,
|
|
61
|
+
...A,
|
|
62
|
+
children: /* @__PURE__ */ d(t, {
|
|
63
|
+
className: n.content,
|
|
64
|
+
children: !v || O ? m : null
|
|
65
|
+
})
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
export { p as AccordionItem };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from "react";
|
|
2
|
+
import type { AccordionIndicator } from "./Accordion";
|
|
3
|
+
interface AccordionToggleContentProps {
|
|
4
|
+
/**
|
|
5
|
+
* Muted text under the title
|
|
6
|
+
*/
|
|
7
|
+
description: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Shape of the indicator
|
|
10
|
+
*/
|
|
11
|
+
indicator: AccordionIndicator;
|
|
12
|
+
/**
|
|
13
|
+
* The header's text
|
|
14
|
+
*/
|
|
15
|
+
title: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Id of the element holding the title
|
|
18
|
+
*/
|
|
19
|
+
titleId: string;
|
|
20
|
+
/**
|
|
21
|
+
* Shown at the end of the toggle
|
|
22
|
+
*/
|
|
23
|
+
trailing: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* What an `AccordionItem`'s toggle shows: the indicator, which the stylesheet places for the look, then its title, and
|
|
27
|
+
* its description and trailing content, each after a space, so the toggle's name reads them in that order
|
|
28
|
+
*/
|
|
29
|
+
export declare function AccordionToggleContent({ description, indicator, title, titleId, trailing, }: AccordionToggleContentProps): JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { hasContent as e } from "../../forms/hasContent.js";
|
|
2
|
+
import { Box as t } from "../Box/Box.js";
|
|
3
|
+
import { AddIcon as n } from "../Icon/AddIcon.js";
|
|
4
|
+
import { ChevronDownIcon as r } from "../Icon/ChevronDownIcon.js";
|
|
5
|
+
import i from "./Accordion.module.js";
|
|
6
|
+
import { c as a } from "react/compiler-runtime";
|
|
7
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
// src/components/Accordion/AccordionToggleContent.tsx
|
|
9
|
+
function l(l) {
|
|
10
|
+
let u = a(16), { description: d, indicator: f, title: p, titleId: m, trailing: h } = l, g;
|
|
11
|
+
u[0] === f ? g = u[1] : (g = f === "plusMinus" ? /* @__PURE__ */ s(n, { className: `${i.indicator} ${i.plusMinus}` }) : /* @__PURE__ */ s(r, { className: `${i.indicator} ${i.chevron}` }), u[0] = f, u[1] = g);
|
|
12
|
+
let _;
|
|
13
|
+
u[2] !== p || u[3] !== m ? (_ = /* @__PURE__ */ s(t, {
|
|
14
|
+
as: "span",
|
|
15
|
+
className: i.title,
|
|
16
|
+
id: m,
|
|
17
|
+
children: p
|
|
18
|
+
}), u[2] = p, u[3] = m, u[4] = _) : _ = u[4];
|
|
19
|
+
let v;
|
|
20
|
+
u[5] === d ? v = u[6] : (v = e(d) && /* @__PURE__ */ c(o, { children: [" ", /* @__PURE__ */ s(t, {
|
|
21
|
+
as: "span",
|
|
22
|
+
className: i.description,
|
|
23
|
+
children: d
|
|
24
|
+
})] }), u[5] = d, u[6] = v);
|
|
25
|
+
let y;
|
|
26
|
+
u[7] !== _ || u[8] !== v ? (y = /* @__PURE__ */ c(t, {
|
|
27
|
+
as: "span",
|
|
28
|
+
className: i.label,
|
|
29
|
+
children: [_, v]
|
|
30
|
+
}), u[7] = _, u[8] = v, u[9] = y) : y = u[9];
|
|
31
|
+
let b;
|
|
32
|
+
u[10] === h ? b = u[11] : (b = e(h) && /* @__PURE__ */ c(o, { children: [" ", /* @__PURE__ */ s(t, {
|
|
33
|
+
as: "span",
|
|
34
|
+
className: i.trailing,
|
|
35
|
+
children: h
|
|
36
|
+
})] }), u[10] = h, u[11] = b);
|
|
37
|
+
let x;
|
|
38
|
+
return u[12] !== g || u[13] !== y || u[14] !== b ? (x = /* @__PURE__ */ c(o, { children: [
|
|
39
|
+
g,
|
|
40
|
+
y,
|
|
41
|
+
b
|
|
42
|
+
] }), u[12] = g, u[13] = y, u[14] = b, u[15] = x) : x = u[15], x;
|
|
43
|
+
}
|
|
44
|
+
export { l as AccordionToggleContent };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the id of an item's toggle
|
|
3
|
+
*
|
|
4
|
+
* @param baseId the `Accordion`'s generated id
|
|
5
|
+
* @param value the item's value
|
|
6
|
+
* @returns an id unique to the value within its `Accordion`, whatever characters the value holds
|
|
7
|
+
*/
|
|
8
|
+
export declare function toggleId(baseId: string, value: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Builds the id of an item's panel
|
|
11
|
+
*
|
|
12
|
+
* @param baseId the `Accordion`'s generated id
|
|
13
|
+
* @param value the item's value
|
|
14
|
+
* @returns an id unique to the value within its `Accordion`, whatever characters the value holds
|
|
15
|
+
*/
|
|
16
|
+
export declare function panelId(baseId: string, value: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Builds the id of an item's title, which names its panel when the panel is a region
|
|
19
|
+
*
|
|
20
|
+
* @param baseId the `Accordion`'s generated id
|
|
21
|
+
* @param value the item's value
|
|
22
|
+
* @returns an id unique to the value within its `Accordion`, whatever characters the value holds
|
|
23
|
+
*/
|
|
24
|
+
export declare function titleId(baseId: string, value: string): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { idSegment as e } from "../../accessibility/idSegment.js";
|
|
2
|
+
// src/components/Accordion/accordionIds.ts
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
return `${t}-toggle-${e(n)}`;
|
|
5
|
+
}
|
|
6
|
+
function n(t, n) {
|
|
7
|
+
return `${t}-panel-${e(n)}`;
|
|
8
|
+
}
|
|
9
|
+
function r(t, n) {
|
|
10
|
+
return `${t}-title-${e(n)}`;
|
|
11
|
+
}
|
|
12
|
+
export { n as panelId, r as titleId, t as toggleId };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AccordionContextValue } from "./AccordionContext";
|
|
2
|
+
/**
|
|
3
|
+
* Reads the state of the surrounding `Accordion`
|
|
4
|
+
*
|
|
5
|
+
* @param part the name of the part reading it, for the error message
|
|
6
|
+
* @returns the surrounding `Accordion`'s state
|
|
7
|
+
* @throws MissingContextError when the part is not inside an `Accordion`
|
|
8
|
+
*/
|
|
9
|
+
export declare function useAccordionContext(part: string): AccordionContextValue;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MissingContextError as e } from "../../errors/MissingContextError.js";
|
|
2
|
+
import { AccordionContext as t } from "./AccordionContext.js";
|
|
3
|
+
import { useContext as n } from "react";
|
|
4
|
+
// src/components/Accordion/useAccordionContext.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let i = n(t);
|
|
7
|
+
if (i === null) throw new e(r, "Accordion");
|
|
8
|
+
return i;
|
|
9
|
+
}
|
|
10
|
+
export { r as useAccordionContext };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
interface FindablePanelOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the item is disabled, so its closed panel is skipped by find-in-page
|
|
5
|
+
*/
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Called when find-in-page, a fragment link or the page's URL fragment as the panel mounts matches inside the closed
|
|
9
|
+
* panel
|
|
10
|
+
*/
|
|
11
|
+
onMatch: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the item is open
|
|
14
|
+
*/
|
|
15
|
+
open: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Keeps a closed panel hidden until find-in-page or a fragment link matches inside it. Render the panel with `hidden`
|
|
19
|
+
* set to whether it is closed, and give it the returned ref.
|
|
20
|
+
*
|
|
21
|
+
* @param options the item's state and what to do on a match
|
|
22
|
+
* @returns the ref for the panel element
|
|
23
|
+
*/
|
|
24
|
+
export declare function useFindablePanel({ disabled, onMatch, open }: FindablePanelOptions): RefObject<HTMLDivElement | null>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useFragmentTargetReveal as e } from "./useFragmentTargetReveal.js";
|
|
2
|
+
import { useLayoutEffect as t, useRef as n, useState as r } from "react";
|
|
3
|
+
import { c as i } from "react/compiler-runtime";
|
|
4
|
+
// src/components/Accordion/useFindablePanel.ts
|
|
5
|
+
function a(a) {
|
|
6
|
+
let s = i(15), { disabled: c, onMatch: l, open: u } = a, d = n(null), [f, p] = r(0), m = !u && !c, h;
|
|
7
|
+
s[0] !== c || s[1] !== u ? (h = () => {
|
|
8
|
+
u || d.current?.setAttribute("hidden", c ? "" : "until-found");
|
|
9
|
+
}, s[0] = c, s[1] = u, s[2] = h) : h = s[2];
|
|
10
|
+
let g;
|
|
11
|
+
s[3] !== c || s[4] !== u || s[5] !== f ? (g = [
|
|
12
|
+
c,
|
|
13
|
+
u,
|
|
14
|
+
f
|
|
15
|
+
], s[3] = c, s[4] = u, s[5] = f, s[6] = g) : g = s[6], t(h, g);
|
|
16
|
+
let _, v;
|
|
17
|
+
s[7] !== m || s[8] !== l ? (_ = () => {
|
|
18
|
+
let e = d.current;
|
|
19
|
+
if (e === null || !m) return;
|
|
20
|
+
let t = function(t) {
|
|
21
|
+
t.target === e && (p(o), l());
|
|
22
|
+
};
|
|
23
|
+
return e.addEventListener("beforematch", t), () => e.removeEventListener("beforematch", t);
|
|
24
|
+
}, v = [m, l], s[7] = m, s[8] = l, s[9] = _, s[10] = v) : (_ = s[9], v = s[10]), t(_, v);
|
|
25
|
+
let y;
|
|
26
|
+
return s[11] !== m || s[12] !== l || s[13] !== u ? (y = {
|
|
27
|
+
findable: m,
|
|
28
|
+
onMatch: l,
|
|
29
|
+
open: u,
|
|
30
|
+
panelRef: d
|
|
31
|
+
}, s[11] = m, s[12] = l, s[13] = u, s[14] = y) : y = s[14], e(y), d;
|
|
32
|
+
}
|
|
33
|
+
function o(e) {
|
|
34
|
+
return e + 1;
|
|
35
|
+
}
|
|
36
|
+
export { a as useFindablePanel };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
interface FragmentTargetRevealOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the panel is closed and can be found, so the fragment's target may open it
|
|
5
|
+
*/
|
|
6
|
+
findable: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Called when the page's URL fragment points inside the panel as it mounts
|
|
9
|
+
*/
|
|
10
|
+
onMatch: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the item is open
|
|
13
|
+
*/
|
|
14
|
+
open: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The panel element
|
|
17
|
+
*/
|
|
18
|
+
panelRef: RefObject<HTMLElement | null>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Opens a closed panel when, as it mounts, the page's URL fragment points at an element inside it, and scrolls that
|
|
22
|
+
* element into view once the panel has opened
|
|
23
|
+
*
|
|
24
|
+
* @param options the panel, its state and what to do on a match
|
|
25
|
+
*/
|
|
26
|
+
export declare function useFragmentTargetReveal({ findable, onMatch, open, panelRef }: FragmentTargetRevealOptions): void;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEffect as e, useLayoutEffect as t, useRef as n } from "react";
|
|
2
|
+
import { c as r } from "react/compiler-runtime";
|
|
3
|
+
// src/components/Accordion/useFragmentTargetReveal.ts
|
|
4
|
+
function i(i) {
|
|
5
|
+
let o = r(8), { findable: s, onMatch: c, open: l, panelRef: u } = i, d = n(!1), f = n(null), p, m;
|
|
6
|
+
o[0] !== s || o[1] !== c || o[2] !== u ? (p = () => {
|
|
7
|
+
if (d.current) return;
|
|
8
|
+
d.current = !0;
|
|
9
|
+
let e = a();
|
|
10
|
+
s && e !== null && u.current?.contains(e) === !0 && (f.current = e, c());
|
|
11
|
+
}, m = [
|
|
12
|
+
s,
|
|
13
|
+
c,
|
|
14
|
+
u
|
|
15
|
+
], o[0] = s, o[1] = c, o[2] = u, o[3] = p, o[4] = m) : (p = o[3], m = o[4]), t(p, m);
|
|
16
|
+
let h, g;
|
|
17
|
+
o[5] === l ? (h = o[6], g = o[7]) : (h = () => {
|
|
18
|
+
l && f.current !== null && (f.current.scrollIntoView(), f.current = null);
|
|
19
|
+
}, g = [l], o[5] = l, o[6] = h, o[7] = g), e(h, g);
|
|
20
|
+
}
|
|
21
|
+
function a() {
|
|
22
|
+
let e = window.location.hash.slice(1);
|
|
23
|
+
return e === "" ? null : o(e) ?? o(s(e));
|
|
24
|
+
}
|
|
25
|
+
function o(e) {
|
|
26
|
+
return document.getElementById(e) ?? Array.from(document.getElementsByName(e)).find((e) => e instanceof HTMLAnchorElement) ?? null;
|
|
27
|
+
}
|
|
28
|
+
function s(e) {
|
|
29
|
+
let t = new TextEncoder().encode(e), n = [];
|
|
30
|
+
for (let e = 0; e < t.length; e++) {
|
|
31
|
+
let r = String.fromCharCode(t[e + 1] ?? 0, t[e + 2] ?? 0);
|
|
32
|
+
t[e] === 37 && /^[\da-f]{2}$/i.test(r) ? (n.push(Number.parseInt(r, 16)), e += 2) : n.push(t[e]);
|
|
33
|
+
}
|
|
34
|
+
return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(new Uint8Array(n));
|
|
35
|
+
}
|
|
36
|
+
export { i as useFragmentTargetReveal };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.sui-alert-7cYyI{--sui-alert-bg:var(--sui-color-info-subtle,#f0f3ff);--sui-alert-accent:var(--sui-color-info-text,#4338ca);--sui-link-color:currentColor;align-items:flex-start;gap:var(--sui-space-3,.75rem);padding:var(--sui-space-4,1rem);border:var(--sui-border-width,1px) solid var(--sui-alert-accent);border-radius:var(--sui-radius-md,4px);background-color:var(--sui-alert-bg);color:var(--sui-color-text,#111827);font-family:var(--sui-font-body,system-ui, sans-serif);font-size:var(--sui-font-size-md,1rem);line-height:var(--sui-line-height-normal,1.5);overflow-wrap:anywhere;display:flex}.sui-alert-7cYyI[data-tone=danger]{--sui-alert-bg:var(--sui-color-danger-subtle,#fff1f1);--sui-alert-accent:var(--sui-color-danger-text,#b91c1c)}.sui-alert-7cYyI[data-tone=success]{--sui-alert-bg:var(--sui-color-success-subtle,#eefef3);--sui-alert-accent:var(--sui-color-success-text,#166534)}.sui-alert-7cYyI[data-tone=warning]{--sui-alert-bg:var(--sui-color-warning-subtle,#fffce1);--sui-alert-accent:var(--sui-color-warning-text,#854d0e)}.sui-icon-Zg6SB{block-size:1lh;color:var(--sui-alert-accent);flex:none;align-items:center;display:flex}.sui-content-UXnmZ{flex:1;min-inline-size:0}.sui-title-abGgF{color:var(--sui-alert-accent);font-weight:var(--sui-font-weight-bold,700)}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from "react";
|
|
2
|
+
import type { BoxProps } from "../Box";
|
|
3
|
+
/**
|
|
4
|
+
* Alert colours and icons: the theme's four status colours
|
|
5
|
+
*/
|
|
6
|
+
export type AlertTone = "danger" | "info" | "success" | "warning";
|
|
7
|
+
/**
|
|
8
|
+
* Props for `Alert`: its own props plus every native div prop
|
|
9
|
+
*/
|
|
10
|
+
export interface AlertProps extends Omit<BoxProps<"div">, "as" | "title"> {
|
|
11
|
+
/**
|
|
12
|
+
* Icon shown before the content. Defaults to the icon for the tone; `null` or `false` shows none.
|
|
13
|
+
*/
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Bold first line above the children. It replaces the native `title` attribute, so it never
|
|
17
|
+
* reaches the DOM as an attribute.
|
|
18
|
+
*/
|
|
19
|
+
title?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Alert colour and default icon. Defaults to `info`.
|
|
22
|
+
*/
|
|
23
|
+
tone?: AlertTone;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Inline message in one of four tones, with an icon for the tone and an optional title. It has no
|
|
27
|
+
* role, so screen readers read it in place. Set `role="alert"` for an error raised by an action, or
|
|
28
|
+
* `aria-live="polite"` for a quiet update. Screen readers announce a polite region reliably only when
|
|
29
|
+
* it is on the page before its content changes, so keep the element with `aria-live` rendered and
|
|
30
|
+
* render the alert inside it.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* <Alert title="Scheduled maintenance" tone="warning">
|
|
34
|
+
* The dashboard is read-only on Saturday from 02:00 to 03:00 UTC.
|
|
35
|
+
* </Alert>
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* <Box aria-live="polite">
|
|
39
|
+
* {isSaved && <Alert tone="success">Draft saved</Alert>}
|
|
40
|
+
* </Box>
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* <Alert role="alert" title="Payment failed" tone="danger">
|
|
44
|
+
* The card was declined. Check the details and try again.
|
|
45
|
+
* </Alert>
|
|
46
|
+
*/
|
|
47
|
+
export declare function Alert({ children, className, icon, title, tone, ...rest }: AlertProps): JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { hasContent as e } from "../../forms/hasContent.js";
|
|
2
|
+
import { Box as t } from "../Box/Box.js";
|
|
3
|
+
import n from "./Alert.module.js";
|
|
4
|
+
import { AlertIcon as r } from "./AlertIcon.js";
|
|
5
|
+
import { clsx as i } from "clsx";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
// src/components/Alert/Alert.tsx
|
|
8
|
+
function s({ children: s, className: c, icon: l, title: u, tone: d = "info", ...f }) {
|
|
9
|
+
let p = l !== null && l !== !1;
|
|
10
|
+
return /* @__PURE__ */ o(t, {
|
|
11
|
+
...f,
|
|
12
|
+
className: i(n.alert, c),
|
|
13
|
+
"data-tone": d,
|
|
14
|
+
children: [p ? /* @__PURE__ */ a(t, {
|
|
15
|
+
as: "span",
|
|
16
|
+
className: n.icon,
|
|
17
|
+
children: l === void 0 ? /* @__PURE__ */ a(r, { tone: d }) : l
|
|
18
|
+
}) : null, /* @__PURE__ */ o(t, {
|
|
19
|
+
className: n.content,
|
|
20
|
+
children: [e(u) ? /* @__PURE__ */ a(t, {
|
|
21
|
+
className: n.title,
|
|
22
|
+
children: u
|
|
23
|
+
}) : null, s]
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export { s as Alert };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './Alert.css';// src/components/Alert/Alert.module.css
|
|
2
|
+
var e = "sui-alert-7cYyI", t = "sui-icon-Zg6SB", n = "sui-content-UXnmZ", r = "sui-title-abGgF", i = {
|
|
3
|
+
alert: e,
|
|
4
|
+
icon: t,
|
|
5
|
+
content: n,
|
|
6
|
+
title: r
|
|
7
|
+
};
|
|
8
|
+
export { e as alert, n as content, i as default, t as icon, r as title };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { AlertTone } from "./Alert";
|
|
3
|
+
interface AlertIconProps {
|
|
4
|
+
/**
|
|
5
|
+
* Alert tone whose glyph to draw
|
|
6
|
+
*/
|
|
7
|
+
tone: AlertTone;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Decorative glyph for an alert tone, drawn in the current text colour and hidden from assistive
|
|
11
|
+
* technology, since the alert's text carries the meaning
|
|
12
|
+
*/
|
|
13
|
+
export declare function AlertIcon({ tone }: AlertIconProps): JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Box as e } from "../Box/Box.js";
|
|
2
|
+
import { c as t } from "react/compiler-runtime";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
// src/components/Alert/AlertIcon.tsx
|
|
5
|
+
var i = {
|
|
6
|
+
danger: "M15 9l-6 6M9 9l6 6",
|
|
7
|
+
info: "M12 16v-4M12 8h.01",
|
|
8
|
+
success: "M8 12.5l3 3 5-6",
|
|
9
|
+
warning: "M12 10v4M12 17h.01"
|
|
10
|
+
};
|
|
11
|
+
function a(a) {
|
|
12
|
+
let o = t(7), { tone: s } = a, c;
|
|
13
|
+
o[0] === s ? c = o[1] : (c = s === "warning" ? /* @__PURE__ */ n(e, {
|
|
14
|
+
as: "path",
|
|
15
|
+
d: "M12 3L22 20H2z"
|
|
16
|
+
}) : /* @__PURE__ */ n(e, {
|
|
17
|
+
as: "circle",
|
|
18
|
+
cx: 12,
|
|
19
|
+
cy: 12,
|
|
20
|
+
r: 10
|
|
21
|
+
}), o[0] = s, o[1] = c);
|
|
22
|
+
let l = i[s], u;
|
|
23
|
+
o[2] === l ? u = o[3] : (u = /* @__PURE__ */ n(e, {
|
|
24
|
+
as: "path",
|
|
25
|
+
d: l
|
|
26
|
+
}), o[2] = l, o[3] = u);
|
|
27
|
+
let d;
|
|
28
|
+
return o[4] !== c || o[5] !== u ? (d = /* @__PURE__ */ r(e, {
|
|
29
|
+
as: "svg",
|
|
30
|
+
fill: "none",
|
|
31
|
+
height: "1.25em",
|
|
32
|
+
stroke: "currentColor",
|
|
33
|
+
strokeLinecap: "round",
|
|
34
|
+
strokeLinejoin: "round",
|
|
35
|
+
strokeWidth: 2,
|
|
36
|
+
viewBox: "0 0 24 24",
|
|
37
|
+
width: "1.25em",
|
|
38
|
+
"aria-hidden": "true",
|
|
39
|
+
children: [c, u]
|
|
40
|
+
}), o[4] = c, o[5] = u, o[6] = d) : d = o[6], d;
|
|
41
|
+
}
|
|
42
|
+
export { a as AlertIcon };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.sui-avatar-3xMuZ{--sui-avatar-size:2rem;--sui-avatar-font-scale:.4;--sui-avatar-outline-width:var(--sui-border-width,1px);inline-size:var(--sui-avatar-size);block-size:var(--sui-avatar-size);outline:var(--sui-avatar-outline-width) solid var(--sui-color-control-border,transparent);outline-offset:calc(var(--sui-avatar-outline-width) * -1);background-color:var(--sui-color-secondary,#e5e7eb);color:var(--sui-color-on-secondary,#111827);font-family:var(--sui-font-body,system-ui, sans-serif);font-size:calc(var(--sui-avatar-size) * var(--sui-avatar-font-scale));font-weight:var(--sui-font-weight-bold,700);vertical-align:middle;border-radius:50%;flex:none;place-items:center;line-height:1;display:inline-grid;overflow:hidden}.sui-avatar-3xMuZ[data-size=xs]{--sui-avatar-size:1rem;--sui-avatar-font-scale:.55;--sui-avatar-outline-width:min(var(--sui-border-width,1px), 1px)}.sui-avatar-3xMuZ[data-size=sm]{--sui-avatar-size:1.5rem}.sui-avatar-3xMuZ[data-size=lg]{--sui-avatar-size:3rem}.sui-image-ieqGp{object-fit:cover;block-size:100%;inline-size:100%}@media (forced-colors:active){.sui-avatar-3xMuZ{outline-color:canvastext}}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { BoxProps } from "../Box";
|
|
3
|
+
/**
|
|
4
|
+
* Avatar sizes: `xs` is 1rem across, `sm` 1.5rem, `md` 2rem and `lg` 3rem
|
|
5
|
+
*/
|
|
6
|
+
export type AvatarSize = "lg" | "md" | "sm" | "xs";
|
|
7
|
+
/**
|
|
8
|
+
* Props for `Avatar`: its own props plus every `span` prop except `children`, `dangerouslySetInnerHTML` and `role`
|
|
9
|
+
*/
|
|
10
|
+
export interface AvatarProps extends Omit<BoxProps<"span">, "as" | "children" | "dangerouslySetInnerHTML" | "role"> {
|
|
11
|
+
/**
|
|
12
|
+
* The person's or team's name. It names the avatar for screen readers, unless a non-blank `aria-label` replaces it,
|
|
13
|
+
* and gives the initials shown when there is no image.
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* Avatar size. `xs` shows one initial. Defaults to `md`.
|
|
18
|
+
*/
|
|
19
|
+
size?: AvatarSize;
|
|
20
|
+
/**
|
|
21
|
+
* Image URL. Initials show while it is missing or empty, and after it fails to load until `src` changes to a URL
|
|
22
|
+
* that has not failed.
|
|
23
|
+
*/
|
|
24
|
+
src?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A person or team, shown as their image or their initials in a circle. Screen readers read it as an image named by
|
|
28
|
+
* `name`. When the name is printed beside it, pass `aria-hidden={true}` so the name is not read twice.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* <Avatar name="Pat Lee" size="sm" src={pat.avatarUrl} />
|
|
32
|
+
*/
|
|
33
|
+
export declare function Avatar({ "aria-label": ariaLabel, className, name, size, src, ...rest }: AvatarProps): JSX.Element;
|