@astryxdesign/core 0.1.7 → 0.1.8-canary.0c4d8d7
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/CHANGELOG.md +65 -0
- package/README.md +30 -19
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +6 -2
- package/dist/AppShell/AppShellMobileContext.d.ts +8 -0
- package/dist/AppShell/AppShellMobileContext.d.ts.map +1 -1
- package/dist/Avatar/Avatar.d.ts +10 -5
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +12 -8
- package/dist/Avatar/AvatarSizeContext.d.ts +1 -1
- package/dist/Avatar/AvatarSizeContext.js +1 -1
- package/dist/Avatar/AvatarStatusDot.d.ts +2 -2
- package/dist/Avatar/AvatarStatusDot.js +2 -2
- package/dist/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +2 -2
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +16 -14
- package/dist/Banner/Banner.d.ts +9 -1
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +31 -2
- package/dist/Button/Button.d.ts +8 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +31 -2
- package/dist/ButtonGroup/ButtonGroup.d.ts +9 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +30 -1
- package/dist/Card/Card.d.ts +8 -2
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +28 -2
- package/dist/Carousel/Carousel.d.ts +6 -2
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +55 -5
- package/dist/Chat/ChatComposer.d.ts +8 -0
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +31 -6
- package/dist/Chat/ChatComposerDrawer.d.ts +2 -0
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +11 -1
- package/dist/Chat/ChatComposerInput.d.ts +20 -3
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +19 -3
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatMessage.d.ts +1 -1
- package/dist/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/Chat/ChatMessage.js +1 -1
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.d.ts +5 -1
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +12 -3
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +10 -4
- package/dist/ClickableCard/ClickableCard.d.ts +9 -2
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +3 -0
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +8 -1
- package/dist/Collapsible/Collapsible.d.ts +11 -1
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +36 -4
- package/dist/CommandPalette/CommandPaletteInput.d.ts +7 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +6 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +4 -3
- package/dist/ContextMenu/index.d.ts +3 -0
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/ContextMenu/index.js +7 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +10 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +2 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +8 -4
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +88 -0
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +169 -0
- package/dist/DropdownMenu/DropdownMenuContext.d.ts +17 -1
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.js +18 -0
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +68 -0
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +69 -0
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +69 -0
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +178 -0
- package/dist/DropdownMenu/index.d.ts +5 -1
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/index.js +10 -1
- package/dist/DropdownMenu/menuItemRoles.d.ts +13 -0
- package/dist/DropdownMenu/menuItemRoles.d.ts.map +1 -0
- package/dist/DropdownMenu/menuItemRoles.js +15 -0
- package/dist/FieldStatus/FieldStatus.d.ts +8 -0
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +22 -4
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +10 -2
- package/dist/HoverCard/HoverCard.d.ts +9 -1
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +2 -0
- package/dist/HoverCard/useHoverCard.d.ts +8 -0
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +7 -2
- package/dist/Icon/Icon.d.ts +43 -13
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +62 -27
- package/dist/Layer/useLayer.d.ts +6 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +2 -0
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +6 -1
- package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
- package/dist/MobileNav/MobileNavToggle.js +4 -0
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +39 -12
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +16 -0
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/Outline/Outline.d.ts +68 -3
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +128 -26
- package/dist/Outline/useScrollSpy.d.ts +27 -7
- package/dist/Outline/useScrollSpy.d.ts.map +1 -1
- package/dist/Outline/useScrollSpy.js +202 -70
- package/dist/OverflowList/OverflowList.d.ts +20 -3
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +29 -4
- package/dist/PowerSearch/PowerSearchEditPopover.js +1 -1
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.d.ts +9 -2
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +14 -11
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +4 -2
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +16 -0
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +21 -8
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +15 -1
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +2 -2
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +2 -0
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +1 -1
- package/dist/Table/Table.d.ts +1 -1
- package/dist/Table/Table.js +1 -1
- package/dist/Table/index.d.ts +4 -0
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +2 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +24 -2
- package/dist/Table/plugins/rowStatus/index.d.ts +3 -0
- package/dist/Table/plugins/rowStatus/index.d.ts.map +1 -0
- package/dist/Table/plugins/rowStatus/index.js +3 -0
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts +60 -0
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -0
- package/dist/Table/plugins/rowStatus/useTableRowStatus.js +145 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts +12 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +4 -1
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +18 -7
- package/dist/Table/plugins/tree/index.d.ts +5 -0
- package/dist/Table/plugins/tree/index.d.ts.map +1 -0
- package/dist/Table/plugins/tree/index.js +4 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts +38 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -0
- package/dist/Table/plugins/tree/useTableTreeData.js +358 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts +51 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts.map +1 -0
- package/dist/Table/plugins/tree/useTableTreeState.js +175 -0
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +6 -3
- package/dist/Thumbnail/Thumbnail.d.ts +8 -1
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +46 -8
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +15 -4
- package/dist/Tokenizer/Tokenizer.d.ts +1 -1
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +16 -4
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +8 -1
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +18 -8
- package/dist/TopNav/TopNavMegaMenu.js +10 -4
- package/dist/TopNav/TopNavMenu.d.ts +2 -1
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +68 -6
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +5 -14
- package/dist/astryx.css +51 -16
- package/dist/astryx.umd.js +56 -56
- package/dist/astryx.umd.js.map +4 -4
- package/dist/authoring/doc.d.ts.map +1 -1
- package/dist/hooks/computeOverflow.d.ts +47 -0
- package/dist/hooks/computeOverflow.d.ts.map +1 -0
- package/dist/hooks/computeOverflow.js +213 -0
- package/dist/hooks/useOverflow.d.ts +19 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +37 -25
- package/dist/theme/Theme.js +1 -1
- package/dist/theme/defineTheme.d.ts +1 -1
- package/dist/theme/defineTheme.js +1 -1
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +51 -0
- package/dist/theme/hct.d.ts +0 -1
- package/dist/theme/hct.d.ts.map +1 -1
- package/dist/theme/hct.js +0 -3
- package/dist/utils/types.d.ts +13 -0
- package/dist/utils/types.d.ts.map +1 -1
- package/docs.mjs +32 -461
- package/locales/en.json +212 -172
- package/locales/fr-FR.json +10 -0
- package/locales/pseudo.json +30 -0
- package/package.json +3 -1
- package/scripts/postinstall.mjs +93 -0
- package/src/AppShell/AppShell.tsx +6 -0
- package/src/AppShell/AppShellMobileContext.tsx +8 -0
- package/src/AppShell/useAppShellMobile.doc.mjs +8 -0
- package/src/Avatar/Avatar.doc.mjs +6 -6
- package/src/Avatar/Avatar.tsx +16 -11
- package/src/Avatar/AvatarSizeContext.ts +1 -1
- package/src/Avatar/AvatarStatusDot.tsx +2 -2
- package/src/AvatarGroup/AvatarGroup.doc.mjs +1 -1
- package/src/AvatarGroup/AvatarGroup.test.tsx +17 -3
- package/src/AvatarGroup/AvatarGroup.tsx +3 -3
- package/src/AvatarGroup/AvatarGroupOverflow.doc.mjs +4 -4
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +21 -5
- package/src/Banner/Banner.doc.mjs +9 -0
- package/src/Banner/Banner.test.tsx +30 -0
- package/src/Banner/Banner.tsx +47 -3
- package/src/Button/Button.doc.mjs +9 -0
- package/src/Button/Button.test.tsx +49 -0
- package/src/Button/Button.tsx +25 -1
- package/src/ButtonGroup/ButtonGroup.doc.mjs +3 -0
- package/src/ButtonGroup/ButtonGroup.test.tsx +37 -0
- package/src/ButtonGroup/ButtonGroup.tsx +32 -0
- package/src/Card/Card.doc.mjs +9 -0
- package/src/Card/Card.test.tsx +21 -3
- package/src/Card/Card.tsx +35 -2
- package/src/Carousel/Carousel.doc.mjs +1 -0
- package/src/Carousel/Carousel.test.tsx +149 -1
- package/src/Carousel/Carousel.tsx +62 -5
- package/src/Chat/Chat.doc.mjs +1 -1
- package/src/Chat/ChatComposer.doc.mjs +9 -0
- package/src/Chat/ChatComposer.test.tsx +35 -0
- package/src/Chat/ChatComposer.tsx +58 -9
- package/src/Chat/ChatComposerDrawer.test.tsx +61 -0
- package/src/Chat/ChatComposerDrawer.tsx +11 -1
- package/src/Chat/ChatComposerInput.doc.mjs +7 -0
- package/src/Chat/ChatComposerInput.test.tsx +87 -0
- package/src/Chat/ChatComposerInput.tsx +35 -3
- package/src/Chat/ChatLayout.tsx +3 -1
- package/src/Chat/ChatLayoutScrollButton.tsx +3 -1
- package/src/Chat/ChatMessage.tsx +4 -2
- package/src/Chat/ChatMessageMetadata.tsx +1 -2
- package/src/Chat/ChatSendButton.tsx +5 -1
- package/src/Chat/ChatToolCalls.test.tsx +64 -0
- package/src/Chat/ChatToolCalls.tsx +13 -1
- package/src/Chat/useTriggerMenu.tsx +3 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +1 -1
- package/src/CheckboxInput/CheckboxInput.test.tsx +32 -1
- package/src/CheckboxList/CheckboxList.test.tsx +9 -1
- package/src/Citation/Citation.test.tsx +51 -0
- package/src/Citation/Citation.tsx +8 -2
- package/src/ClickableCard/ClickableCard.doc.mjs +2 -0
- package/src/ClickableCard/ClickableCard.test.tsx +34 -0
- package/src/ClickableCard/ClickableCard.tsx +11 -1
- package/src/CodeBlock/CodeBlock.test.tsx +56 -0
- package/src/CodeBlock/CodeBlock.tsx +9 -1
- package/src/Collapsible/Collapsible.doc.mjs +7 -0
- package/src/Collapsible/Collapsible.test.tsx +80 -0
- package/src/Collapsible/Collapsible.tsx +58 -5
- package/src/CommandPalette/CommandPaletteInput.doc.mjs +26 -9
- package/src/CommandPalette/CommandPaletteInput.test.tsx +34 -0
- package/src/CommandPalette/CommandPaletteInput.tsx +11 -0
- package/src/ContextMenu/ContextMenu.test.tsx +75 -1
- package/src/ContextMenu/ContextMenu.tsx +10 -5
- package/src/ContextMenu/index.ts +15 -0
- package/src/DateTimeInput/DateTimeInput.test.tsx +35 -0
- package/src/DateTimeInput/DateTimeInput.tsx +14 -2
- package/src/Dialog/Dialog.tsx +12 -2
- package/src/DropdownMenu/DropdownMenu.doc.mjs +23 -0
- package/src/DropdownMenu/DropdownMenu.tsx +11 -6
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +95 -0
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +236 -0
- package/src/DropdownMenu/DropdownMenuContext.tsx +29 -1
- package/src/DropdownMenu/DropdownMenuItem.doc.mjs +7 -1
- package/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs +80 -0
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +118 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +80 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +232 -0
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +163 -0
- package/src/DropdownMenu/index.ts +23 -3
- package/src/DropdownMenu/menuItemRoles.ts +22 -0
- package/src/Field/Field.doc.mjs +1 -1
- package/src/Field/Field.test.tsx +57 -12
- package/src/Field/FieldLabel.doc.mjs +1 -1
- package/src/FieldStatus/FieldStatus.doc.mjs +17 -5
- package/src/FieldStatus/FieldStatus.test.tsx +78 -40
- package/src/FieldStatus/FieldStatus.tsx +22 -4
- package/src/FileInput/FileInput.test.tsx +52 -3
- package/src/FileInput/FileInput.tsx +13 -2
- package/src/HoverCard/HoverCard.doc.mjs +13 -0
- package/src/HoverCard/HoverCard.test.tsx +21 -2
- package/src/HoverCard/HoverCard.tsx +11 -0
- package/src/HoverCard/useHoverCard.doc.mjs +2 -0
- package/src/HoverCard/useHoverCard.tsx +24 -2
- package/src/Icon/Icon.doc.mjs +12 -0
- package/src/Icon/Icon.test.tsx +142 -0
- package/src/Icon/Icon.tsx +98 -30
- package/src/IconButton/IconButton.doc.mjs +8 -0
- package/src/IconButton/IconButton.test.tsx +15 -18
- package/src/Item/Item.doc.mjs +1 -1
- package/src/Layer/useLayer.tsx +8 -0
- package/src/MobileNav/MobileNav.tsx +12 -1
- package/src/MobileNav/MobileNavToggle.test.tsx +116 -0
- package/src/MobileNav/MobileNavToggle.tsx +9 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +4 -2
- package/src/MultiSelector/MultiSelector.test.tsx +162 -1
- package/src/MultiSelector/MultiSelector.tsx +55 -12
- package/src/MultiSelector/hooks.ts +17 -0
- package/src/NumberInput/NumberInput.doc.mjs +2 -2
- package/src/NumberInput/NumberInput.test.tsx +11 -7
- package/src/NumberInput/NumberInput.tsx +1 -2
- package/src/Outline/Outline.doc.mjs +123 -3
- package/src/Outline/Outline.test.tsx +735 -0
- package/src/Outline/Outline.tsx +183 -33
- package/src/Outline/useScrollSpy.ts +248 -72
- package/src/OverflowList/OverflowList.doc.mjs +39 -6
- package/src/OverflowList/OverflowList.test.tsx +111 -0
- package/src/OverflowList/OverflowList.tsx +48 -8
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +67 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +1 -1
- package/src/PowerSearch/usePowerSearchSource.ts +1 -2
- package/src/SelectableCard/SelectableCard.doc.mjs +2 -0
- package/src/SelectableCard/SelectableCard.test.tsx +46 -4
- package/src/SelectableCard/SelectableCard.tsx +27 -14
- package/src/Selector/Selector.test.tsx +69 -0
- package/src/Selector/Selector.tsx +5 -1
- package/src/Selector/SelectorOption.doc.mjs +1 -1
- package/src/Selector/hooks.ts +17 -0
- package/src/SideNav/SideNav.test.tsx +119 -3
- package/src/SideNav/SideNavCollapseButton.tsx +6 -1
- package/src/SideNav/SideNavHeading.tsx +24 -8
- package/src/SideNav/SideNavItem.doc.mjs +2 -2
- package/src/SideNav/SideNavItem.tsx +5 -1
- package/src/Slider/Slider.test.tsx +62 -2
- package/src/Slider/Slider.tsx +15 -1
- package/src/Switch/Switch.doc.mjs +1 -1
- package/src/Switch/Switch.test.tsx +32 -1
- package/src/TabList/Tab.tsx +5 -1
- package/src/TabList/TabList.doc.mjs +3 -3
- package/src/TabList/TabList.test.tsx +66 -0
- package/src/TabList/TabList.tsx +8 -0
- package/src/TabList/TabMenu.tsx +4 -1
- package/src/Table/Table.doc.mjs +2 -0
- package/src/Table/Table.tsx +1 -1
- package/src/Table/index.ts +12 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +6 -2
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +90 -1
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +37 -5
- package/src/Table/plugins/rowStatus/index.ts +7 -0
- package/src/Table/plugins/rowStatus/useTableRowStatus.test.tsx +138 -0
- package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +189 -0
- package/src/Table/plugins/selection/useTableSelection.test.tsx +16 -0
- package/src/Table/plugins/selection/useTableSelection.tsx +18 -1
- package/src/Table/plugins/sortable/useTableSortable.test.tsx +95 -9
- package/src/Table/plugins/sortable/useTableSortable.tsx +23 -7
- package/src/Table/plugins/tree/index.ts +12 -0
- package/src/Table/plugins/tree/useTableTreeData-perf.test.tsx +163 -0
- package/src/Table/plugins/tree/useTableTreeData.test.tsx +594 -0
- package/src/Table/plugins/tree/useTableTreeData.tsx +495 -0
- package/src/Table/plugins/tree/useTableTreeState.test.tsx +636 -0
- package/src/Table/plugins/tree/useTableTreeState.tsx +253 -0
- package/src/Table/useBaseTablePlugins.ts +6 -2
- package/src/Table/useTableRowStatus.doc.mjs +30 -0
- package/src/Table/useTableSelection.doc.mjs +65 -14
- package/src/Table/useTableTreeData.doc.mjs +75 -0
- package/src/Table/useTableTreeState.doc.mjs +98 -0
- package/src/TextArea/TextArea.doc.mjs +1 -1
- package/src/TextArea/TextArea.test.tsx +9 -1
- package/src/TextInput/TextInput.doc.mjs +1 -1
- package/src/Thumbnail/Thumbnail.doc.mjs +9 -0
- package/src/Thumbnail/Thumbnail.test.tsx +38 -8
- package/src/Thumbnail/Thumbnail.tsx +28 -1
- package/src/TimeInput/TimeInput.test.tsx +76 -1
- package/src/TimeInput/TimeInput.tsx +19 -6
- package/src/Tokenizer/Tokenizer.doc.mjs +1 -1
- package/src/Tokenizer/Tokenizer.test.tsx +137 -2
- package/src/Tokenizer/Tokenizer.tsx +16 -4
- package/src/Toolbar/Toolbar.tsx +10 -3
- package/src/TopNav/TopNav.test.tsx +80 -1
- package/src/TopNav/TopNavHeading.tsx +24 -8
- package/src/TopNav/TopNavMegaMenu.test.tsx +149 -1
- package/src/TopNav/TopNavMegaMenu.tsx +10 -4
- package/src/TopNav/TopNavMenu.test.tsx +118 -4
- package/src/TopNav/TopNavMenu.tsx +83 -5
- package/src/TreeList/TreeList.test.tsx +32 -1
- package/src/TreeList/TreeListItem.tsx +19 -10
- package/src/authoring/doc.ts +1 -3
- package/src/docs-script.test.mjs +18 -13
- package/src/hooks/computeOverflow.test.ts +422 -0
- package/src/hooks/computeOverflow.ts +290 -0
- package/src/hooks/useOverflow.test.ts +96 -4
- package/src/hooks/useOverflow.ts +77 -33
- package/src/postinstall.test.mjs +71 -0
- package/src/theme/Theme.doc.mjs +4 -4
- package/src/theme/Theme.tsx +1 -1
- package/src/theme/defineTheme.ts +1 -1
- package/src/theme/generateThemeRules.test.ts +65 -0
- package/src/theme/generateThemeRules.ts +56 -0
- package/src/theme/hct.ts +0 -4
- package/src/utils/types.ts +14 -0
- package/dist/TreeList/treeListItem.markers.stylex.d.ts +0 -16
- package/dist/TreeList/treeListItem.markers.stylex.d.ts.map +0 -1
- package/dist/TreeList/treeListItem.markers.stylex.js +0 -22
- package/src/TreeList/treeListItem.markers.stylex.ts +0 -20
package/src/Outline/Outline.tsx
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Outline.tsx
|
|
7
|
-
* @input Uses React, StyleX, Astryx link provider integration, Outline hooks/types
|
|
7
|
+
* @input Uses React, StyleX, Astryx link provider integration, Outline hooks/types, useListFocus
|
|
8
8
|
* @output Exports Outline component and OutlineProps type
|
|
9
9
|
* @position Core implementation; consumed by index.ts
|
|
10
10
|
*
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
* - Sliding indicator track (vertical divider + animated active bar)
|
|
13
13
|
* - Density variant (default/compact)
|
|
14
14
|
* - Scroll-spy active state when uncontrolled
|
|
15
|
+
* - Roving-tabindex keyboard navigation (Arrow/Home/End, Enter/Space activate)
|
|
16
|
+
* - onNavigateStart / onNavigateEnd callbacks around the smooth scroll
|
|
17
|
+
* - Scroll scoping (offset, scrollContainerRef, hasScrollOnClick)
|
|
15
18
|
*
|
|
16
19
|
* SYNC: When modified, update these files to stay in sync:
|
|
17
20
|
* - /packages/core/src/Outline/Outline.doc.mjs
|
|
@@ -32,6 +35,8 @@ import {
|
|
|
32
35
|
fontWeightVars,
|
|
33
36
|
} from '../theme/tokens.stylex';
|
|
34
37
|
import {useLinkComponent} from '../Link/useLinkComponent';
|
|
38
|
+
import {useListFocus} from '../hooks/useListFocus';
|
|
39
|
+
import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
35
40
|
import {mergeProps, mergeRefs} from '../utils';
|
|
36
41
|
import type {BaseProps} from '../BaseProps';
|
|
37
42
|
import {useScrollSpy} from './useScrollSpy';
|
|
@@ -65,6 +70,55 @@ export interface OutlineProps extends BaseProps<HTMLElement> {
|
|
|
65
70
|
*/
|
|
66
71
|
density?: 'default' | 'compact';
|
|
67
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Called when navigation to an item begins, before the scroll starts.
|
|
75
|
+
* Receives the item `id`. Pair with `onNavigateEnd` to drive an arrival
|
|
76
|
+
* effect (flash, ring, pulse) on the target heading.
|
|
77
|
+
*/
|
|
78
|
+
onNavigateStart?: (id: string) => void;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Called once when navigation to an item resolves — when the smooth scroll
|
|
82
|
+
* settles, or immediately-ish when reduced motion turns it into a jump.
|
|
83
|
+
*
|
|
84
|
+
* Fires exactly once for every `onNavigateStart`, including when the user
|
|
85
|
+
* interrupts the scroll by scrolling manually, so a "navigating" state can
|
|
86
|
+
* never leak. It does not fire if the Outline unmounts mid-scroll.
|
|
87
|
+
*/
|
|
88
|
+
onNavigateEnd?: (id: string) => void;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Height in px of a fixed header overlaying the top of the scroll root.
|
|
92
|
+
*
|
|
93
|
+
* Shifts both the activation line *and* the scroll landing by the same
|
|
94
|
+
* amount, so a heading activates exactly where navigating to it puts it —
|
|
95
|
+
* below the header rather than hidden underneath it.
|
|
96
|
+
*
|
|
97
|
+
* It composes with each heading's own `scroll-margin-top` (the header, then
|
|
98
|
+
* the breathing room below it) rather than replacing it. When nothing
|
|
99
|
+
* overlays the content, leave this at 0 and let `scroll-margin-top` do the
|
|
100
|
+
* work — the browser already honors it.
|
|
101
|
+
*
|
|
102
|
+
* @default 0
|
|
103
|
+
*/
|
|
104
|
+
offset?: number;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Scroll container to track, instead of auto-detecting the nearest scrollable
|
|
108
|
+
* ancestor. Use this when the content scrolls inside a split pane, modal, or
|
|
109
|
+
* dashboard panel rather than the viewport.
|
|
110
|
+
*/
|
|
111
|
+
scrollContainerRef?: React.RefObject<HTMLElement | null>;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Whether activating an item smooth-scrolls to it. Set to false to own the
|
|
115
|
+
* scrolling yourself (virtualized content, a router) — the Outline still
|
|
116
|
+
* updates the active item, the hash, and the navigate callbacks, but performs
|
|
117
|
+
* no scroll and suppresses the anchor's default jump.
|
|
118
|
+
* @default true
|
|
119
|
+
*/
|
|
120
|
+
hasScrollOnClick?: boolean;
|
|
121
|
+
|
|
68
122
|
/** Test ID for testing frameworks. */
|
|
69
123
|
'data-testid'?: string;
|
|
70
124
|
}
|
|
@@ -219,8 +273,15 @@ function getIndentStyle(level: number) {
|
|
|
219
273
|
* track that animates to the active item.
|
|
220
274
|
*
|
|
221
275
|
* When `activeId` is omitted, it tracks scroll position and marks the last
|
|
222
|
-
* heading whose top has passed its activation line
|
|
223
|
-
*
|
|
276
|
+
* heading whose top has passed its activation line — which is exactly where
|
|
277
|
+
* navigating to that heading lands it: `offset` (a fixed header overlaying the
|
|
278
|
+
* scroll root) plus the heading's own `scroll-margin-top`. It defaults to the
|
|
279
|
+
* first item at the top and the last at the bottom.
|
|
280
|
+
*
|
|
281
|
+
* Keyboard: the list is a single tab stop (roving tabindex), seated on the
|
|
282
|
+
* active heading. Arrow keys move between headings, Home/End jump to the ends,
|
|
283
|
+
* and Enter/Space activate — so a long table of contents costs one Tab press,
|
|
284
|
+
* not one per heading.
|
|
224
285
|
*
|
|
225
286
|
* @example
|
|
226
287
|
* ```
|
|
@@ -232,6 +293,20 @@ function getIndentStyle(level: number) {
|
|
|
232
293
|
* ]}
|
|
233
294
|
* />
|
|
234
295
|
* ```
|
|
296
|
+
*
|
|
297
|
+
* Scoped to a custom scroll container, under a fixed header:
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```
|
|
301
|
+
* const scrollContainerRef = useRef<HTMLDivElement>(null);
|
|
302
|
+
* <div ref={scrollContainerRef} style={{overflowY: 'auto'}}>...</div>
|
|
303
|
+
* <Outline
|
|
304
|
+
* items={items}
|
|
305
|
+
* scrollContainerRef={scrollContainerRef}
|
|
306
|
+
* offset={64}
|
|
307
|
+
* onNavigateEnd={id => flashHeading(id)}
|
|
308
|
+
* />
|
|
309
|
+
* ```
|
|
235
310
|
*/
|
|
236
311
|
export function Outline({
|
|
237
312
|
items,
|
|
@@ -239,6 +314,11 @@ export function Outline({
|
|
|
239
314
|
onActiveIdChange,
|
|
240
315
|
label: labelFromProps,
|
|
241
316
|
density = 'default',
|
|
317
|
+
onNavigateStart,
|
|
318
|
+
onNavigateEnd,
|
|
319
|
+
offset = 0,
|
|
320
|
+
scrollContainerRef,
|
|
321
|
+
hasScrollOnClick = true,
|
|
242
322
|
xstyle,
|
|
243
323
|
className,
|
|
244
324
|
style,
|
|
@@ -250,50 +330,114 @@ export function Outline({
|
|
|
250
330
|
const label = labelFromProps ?? t('@astryx.outline.label');
|
|
251
331
|
const rootRef = useRef<HTMLElement | null>(null);
|
|
252
332
|
const LinkComponent = useLinkComponent();
|
|
253
|
-
const
|
|
254
|
-
const {
|
|
255
|
-
activeId: resolvedActiveId,
|
|
256
|
-
setActiveId,
|
|
257
|
-
lockActiveId,
|
|
258
|
-
} = useScrollSpy({
|
|
333
|
+
const {activeId: resolvedActiveId, scrollTo} = useScrollSpy({
|
|
259
334
|
activeId,
|
|
260
335
|
items,
|
|
261
336
|
onActiveIdChange,
|
|
262
337
|
rootRef,
|
|
338
|
+
offset,
|
|
339
|
+
scrollContainerRef,
|
|
340
|
+
hasScrollOnClick,
|
|
341
|
+
onNavigateStart,
|
|
342
|
+
onNavigateEnd,
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// Roving tabindex over the links: the whole outline is one tab stop, and
|
|
346
|
+
// arrows move between headings. The hook owns `tabindex` on the items.
|
|
347
|
+
const {
|
|
348
|
+
listRef,
|
|
349
|
+
handleKeyDown: handleListKeyDown,
|
|
350
|
+
handleFocus,
|
|
351
|
+
} = useListFocus<HTMLUListElement>({
|
|
352
|
+
itemSelector: 'a[href]',
|
|
353
|
+
orientation: 'vertical',
|
|
354
|
+
hasRovingTabIndex: true,
|
|
263
355
|
});
|
|
264
356
|
|
|
357
|
+
// Seat the tab stop on the *active* heading. WAI-ARIA puts the single tab
|
|
358
|
+
// stop on the current item, so tabbing into a table of contents while
|
|
359
|
+
// reading section 7 lands on section 7 — not back at section 1, which is
|
|
360
|
+
// where useListFocus would otherwise leave it (it promotes the first item on
|
|
361
|
+
// mount and then keeps whichever item already holds the stop).
|
|
362
|
+
//
|
|
363
|
+
// Only while focus is outside the list: once the reader has arrowed to an
|
|
364
|
+
// item, the stop is theirs and scroll-spy must not yank it away. Sets
|
|
365
|
+
// `tabindex` only — it never steals focus. Registered after useListFocus so
|
|
366
|
+
// it runs after the hook's own layout effect and wins; on later commits the
|
|
367
|
+
// hook then finds this item already holding the stop and keeps it.
|
|
368
|
+
useIsomorphicLayoutEffect(() => {
|
|
369
|
+
const list = listRef.current;
|
|
370
|
+
if (list == null || list.contains(document.activeElement)) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
const links = Array.from(list.querySelectorAll<HTMLElement>('a[href]'));
|
|
374
|
+
const active = links.find(
|
|
375
|
+
link => link.getAttribute('aria-current') === 'true',
|
|
376
|
+
);
|
|
377
|
+
if (active == null) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
for (const link of links) {
|
|
381
|
+
const tabIndex = link === active ? '0' : '-1';
|
|
382
|
+
if (link.getAttribute('tabindex') !== tabIndex) {
|
|
383
|
+
link.setAttribute('tabindex', tabIndex);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* The single navigation path, shared by click and keyboard activation:
|
|
390
|
+
* push the hash, then hand off to the scroll-spy's `scrollTo`, which fires
|
|
391
|
+
* the navigate callbacks and moves the indicator when the scroll settles.
|
|
392
|
+
*/
|
|
393
|
+
const navigate = (id: string) => {
|
|
394
|
+
if (scrollTo(id)) {
|
|
395
|
+
window.history.pushState(null, '', `#${id}`);
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
/** Whether an event carries a modifier chord we must leave to the browser. */
|
|
400
|
+
const hasModifier = (
|
|
401
|
+
event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,
|
|
402
|
+
) => event.metaKey || event.altKey || event.ctrlKey || event.shiftKey;
|
|
403
|
+
|
|
265
404
|
const handleClick =
|
|
266
405
|
(id: string) => (event: React.MouseEvent<HTMLElement>) => {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
) {
|
|
406
|
+
// Let the browser handle modified clicks (open in new tab, etc.) without
|
|
407
|
+
// touching the active state.
|
|
408
|
+
if (event.defaultPrevented || hasModifier(event)) {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// With no target in the DOM — lazily-rendered or virtualized content —
|
|
413
|
+
// there is nothing to scroll to and nothing to make active. Leave the
|
|
414
|
+
// anchor to the browser's native fragment navigation (which still
|
|
415
|
+
// updates the URL) rather than swallowing the click into a dead link.
|
|
416
|
+
if (document.getElementById(id) == null) {
|
|
279
417
|
return;
|
|
280
418
|
}
|
|
281
419
|
|
|
420
|
+
// Suppress the anchor's default jump: we own the scroll (or, with
|
|
421
|
+
// `hasScrollOnClick={false}`, deliberately leave it to the consumer).
|
|
282
422
|
event.preventDefault();
|
|
283
|
-
|
|
423
|
+
navigate(id);
|
|
424
|
+
};
|
|
284
425
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
//
|
|
288
|
-
//
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
426
|
+
const handleKeyDown =
|
|
427
|
+
(id: string) => (event: React.KeyboardEvent<HTMLElement>) => {
|
|
428
|
+
// Enter is a link's native activation and already produces a click.
|
|
429
|
+
// Space is not, so wire it up here to match the button-like affordance.
|
|
430
|
+
if (event.key !== ' ' && event.key !== 'Spacebar') {
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
if (event.defaultPrevented || hasModifier(event)) {
|
|
434
|
+
return;
|
|
294
435
|
}
|
|
295
436
|
|
|
296
|
-
|
|
437
|
+
// preventDefault does double duty: it stops the page from scrolling, and
|
|
438
|
+
// it tells useScrollSpy this Space is an activation, not a manual scroll.
|
|
439
|
+
event.preventDefault();
|
|
440
|
+
navigate(id);
|
|
297
441
|
};
|
|
298
442
|
|
|
299
443
|
return (
|
|
@@ -308,7 +452,12 @@ export function Outline({
|
|
|
308
452
|
className,
|
|
309
453
|
style,
|
|
310
454
|
)}>
|
|
311
|
-
<ul
|
|
455
|
+
<ul
|
|
456
|
+
{...stylex.props(styles.list)}
|
|
457
|
+
ref={listRef}
|
|
458
|
+
role="list"
|
|
459
|
+
onKeyDown={handleListKeyDown}
|
|
460
|
+
onFocus={handleFocus}>
|
|
312
461
|
{items.map(item => {
|
|
313
462
|
const isActive = item.id === resolvedActiveId;
|
|
314
463
|
|
|
@@ -318,6 +467,7 @@ export function Outline({
|
|
|
318
467
|
href={`#${item.id}`}
|
|
319
468
|
aria-current={isActive ? 'true' : undefined}
|
|
320
469
|
onClick={handleClick(item.id)}
|
|
470
|
+
onKeyDown={handleKeyDown(item.id)}
|
|
321
471
|
{...mergeProps(
|
|
322
472
|
themeProps('outline-item', {
|
|
323
473
|
active: isActive ? 'active' : null,
|