@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/dist/Button/Button.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { type ReactNode } from 'react';
|
|
17
17
|
import type { BaseProps } from '../BaseProps';
|
|
18
|
-
import type { SizeValue } from '../utils/types';
|
|
18
|
+
import type { Elevation, SizeValue } from '../utils/types';
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import type { LinkComponentType } from '../Link/types';
|
|
21
21
|
declare const sizeStyles: Readonly<{
|
|
@@ -84,6 +84,12 @@ export interface ButtonProps extends BaseProps<HTMLButtonElement> {
|
|
|
84
84
|
* @default 'md'
|
|
85
85
|
*/
|
|
86
86
|
size?: ButtonSize;
|
|
87
|
+
/**
|
|
88
|
+
* Resting elevation — the shadow depth the button sits at. Use for floating
|
|
89
|
+
* buttons (FABs) that hover above content. `none` is the default flat button.
|
|
90
|
+
* @default 'none'
|
|
91
|
+
*/
|
|
92
|
+
elevation?: Elevation;
|
|
87
93
|
/**
|
|
88
94
|
* Whether the button is disabled.
|
|
89
95
|
* @default false
|
|
@@ -193,7 +199,7 @@ export interface ButtonProps extends BaseProps<HTMLButtonElement> {
|
|
|
193
199
|
* <Button label="Open in new tab" href="https://example.com" target="_blank" rel="noopener noreferrer" />
|
|
194
200
|
* ```
|
|
195
201
|
*/
|
|
196
|
-
export declare function Button({ label, variant, size: sizeProp, type, isDisabled, isLoading, isInterruptible, clickAction, icon, isIconOnly, width, children, endContent, tooltip, href, as, target, rel, xstyle, className, style, ref, ...props }: ButtonProps): ReactNode;
|
|
202
|
+
export declare function Button({ label, variant, size: sizeProp, type, isDisabled, isLoading, isInterruptible, clickAction, icon, isIconOnly, width, elevation, children, endContent, tooltip, href, as, target, rel, xstyle, className, style, ref, ...props }: ButtonProps): ReactNode;
|
|
197
203
|
export declare namespace Button {
|
|
198
204
|
var displayName: string;
|
|
199
205
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAsB3C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AA+FrD,QAAA,MAAM,UAAU;;;;;;;;;;EAUd,CAAC;AAkHH;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;IAChB,KAAK,EAAE,IAAI,CAAC;IACZ,WAAW,EAAE,IAAI,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,UAAU,CAAC;AAEjD,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC/D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC,oDAAoD;IACpD,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IAChD,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD;;OAEG;IACH,WAAW,CAAC,EAAE,CACZ,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KACnC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAqJD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,OAAqB,EACrB,IAAI,EAAE,QAAQ,EACd,IAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,eAAuB,EACvB,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,KAAK,EACL,SAAkB,EAClB,QAAQ,EACR,UAAU,EACV,OAAO,EACP,IAAI,EACJ,EAAE,EACF,MAAM,EACN,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,SAAS,CA0OzB;yBAnQe,MAAM"}
|
package/dist/Button/Button.js
CHANGED
|
@@ -21,7 +21,7 @@ import { useRef, useTransition } from 'react';
|
|
|
21
21
|
import * as stylex from '@stylexjs/stylex';
|
|
22
22
|
import { useTooltip } from "../Tooltip/useTooltip.js";
|
|
23
23
|
import "../theme/tokens.stylex.js";
|
|
24
|
-
import { colorVars, sizeVars, spacingVars, radiusVars, borderVars, durationVars, easeVars, fontWeightVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
24
|
+
import { colorVars, sizeVars, spacingVars, radiusVars, borderVars, durationVars, easeVars, fontWeightVars, typeScaleVars, shadowVars } from "../theme/tokens.stylex.js";
|
|
25
25
|
import { Spinner } from "../Spinner/index.js";
|
|
26
26
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
27
27
|
import { EDGE_COMP_ATTR } from "../Layout/edgeCompensation.stylex.js";
|
|
@@ -150,6 +150,30 @@ const iconSizeStyles = {
|
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Resting elevation for floating buttons (e.g. a FAB). `none` is the default
|
|
155
|
+
* flat button; `low`/`med`/`high` map to the shadow token scale. 'none' stays
|
|
156
|
+
* a literal so it never conflicts with a variant's background layering.
|
|
157
|
+
*/
|
|
158
|
+
const elevationStyles = {
|
|
159
|
+
none: {
|
|
160
|
+
kGVxlE: "x1gnnqk1",
|
|
161
|
+
$$css: true
|
|
162
|
+
},
|
|
163
|
+
low: {
|
|
164
|
+
kGVxlE: "x1i5ehqx",
|
|
165
|
+
$$css: true
|
|
166
|
+
},
|
|
167
|
+
med: {
|
|
168
|
+
kGVxlE: "x14hfi27",
|
|
169
|
+
$$css: true
|
|
170
|
+
},
|
|
171
|
+
high: {
|
|
172
|
+
kGVxlE: "x1kcpxr7",
|
|
173
|
+
$$css: true
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
153
177
|
/**
|
|
154
178
|
* Variant styles using backgroundImage for layered colors
|
|
155
179
|
* Pseudo-classes are nested within properties per StyleX recommendation
|
|
@@ -338,6 +362,7 @@ export function Button({
|
|
|
338
362
|
icon,
|
|
339
363
|
isIconOnly = false,
|
|
340
364
|
width,
|
|
365
|
+
elevation = 'none',
|
|
341
366
|
children,
|
|
342
367
|
endContent,
|
|
343
368
|
tooltip,
|
|
@@ -430,7 +455,10 @@ export function Button({
|
|
|
430
455
|
} : null;
|
|
431
456
|
|
|
432
457
|
// Shared StyleX props for both button and link rendering
|
|
433
|
-
const sharedStylexProps = stylex.props(styles.base, sizeStyles[size], variants[variant], isIconOnly && styles.iconOnly, buttonDisabled && styles.disabled, useAriaDisabled && styles.ariaDisabled, renderAsLink && styles.link, !buttonGroup && styles.pressable, buttonGroup && (buttonGroup.orientation === 'horizontal' ? groupStyles.horizontal : groupStyles.vertical), buttonGroup && (variant === 'primary' || variant === 'destructive') && (buttonGroup.orientation === 'horizontal' ? groupStyles.onSolidHorizontal : groupStyles.onSolidVertical),
|
|
458
|
+
const sharedStylexProps = stylex.props(styles.base, sizeStyles[size], variants[variant], isIconOnly && styles.iconOnly, buttonDisabled && styles.disabled, useAriaDisabled && styles.ariaDisabled, renderAsLink && styles.link, !buttonGroup && styles.pressable, buttonGroup && (buttonGroup.orientation === 'horizontal' ? groupStyles.horizontal : groupStyles.vertical), buttonGroup && (variant === 'primary' || variant === 'destructive') && (buttonGroup.orientation === 'horizontal' ? groupStyles.onSolidHorizontal : groupStyles.onSolidVertical),
|
|
459
|
+
// Standalone floating buttons only — a grouped button's elevation is owned
|
|
460
|
+
// by the ButtonGroup so the shared surface lifts as one unit.
|
|
461
|
+
!buttonGroup && elevationStyles[elevation], width != null && dynamicStyles.width(width), xstyle);
|
|
434
462
|
const sharedMergedProps = mergeProps(themeProps('button', {
|
|
435
463
|
variant,
|
|
436
464
|
size
|
|
@@ -505,6 +533,7 @@ export function Button({
|
|
|
505
533
|
...ariaLabelProp,
|
|
506
534
|
...describedByProp,
|
|
507
535
|
...edgeCompAttr,
|
|
536
|
+
"aria-busy": isLoadingState || undefined,
|
|
508
537
|
onClick: handleClick,
|
|
509
538
|
children: buttonContent
|
|
510
539
|
});
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { type ReactNode } from 'react';
|
|
20
20
|
import type { ButtonSize } from '../Button';
|
|
21
|
+
import type { Elevation } from '../utils/types';
|
|
21
22
|
import type { BaseProps } from '../BaseProps';
|
|
22
23
|
import type { ButtonGroupOrientation } from './ButtonGroupContext';
|
|
23
24
|
export interface ButtonGroupProps extends BaseProps<HTMLDivElement> {
|
|
@@ -42,6 +43,13 @@ export interface ButtonGroupProps extends BaseProps<HTMLDivElement> {
|
|
|
42
43
|
* @default 'md'
|
|
43
44
|
*/
|
|
44
45
|
size?: ButtonSize;
|
|
46
|
+
/**
|
|
47
|
+
* Resting elevation for the group. The connected buttons share one surface,
|
|
48
|
+
* so the shadow sits on the group and lifts them together. Use for a floating
|
|
49
|
+
* group of actions above content.
|
|
50
|
+
* @default 'none'
|
|
51
|
+
*/
|
|
52
|
+
elevation?: Elevation;
|
|
45
53
|
/**
|
|
46
54
|
* Whether all buttons in the group are disabled.
|
|
47
55
|
* @default false
|
|
@@ -82,7 +90,7 @@ export interface ButtonGroupProps extends BaseProps<HTMLDivElement> {
|
|
|
82
90
|
* </ButtonGroup>
|
|
83
91
|
* ```
|
|
84
92
|
*/
|
|
85
|
-
export declare function ButtonGroup({ children, label, orientation, size: sizeProp, isDisabled, xstyle, className, style, ref, 'data-testid': testId, onKeyDown, ...props }: ButtonGroupProps): ReactNode;
|
|
93
|
+
export declare function ButtonGroup({ children, label, orientation, size: sizeProp, isDisabled, elevation, xstyle, className, style, ref, 'data-testid': testId, onKeyDown, ...props }: ButtonGroupProps): ReactNode;
|
|
86
94
|
export declare namespace ButtonGroup {
|
|
87
95
|
var displayName: string;
|
|
88
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAU,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAU,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAE1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAI9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,sBAAsB,CAAC;AAOjE,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACjE,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,WAAW,CAAC,EAAE,sBAAsB,CAAC;IAErC;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAwCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,KAAK,EACL,WAA0B,EAC1B,IAAI,EAAE,QAAQ,EACd,UAAkB,EAClB,SAAkB,EAClB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,aAAa,EAAE,MAAM,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,SAAS,CAwC9B;yBAtDe,WAAW"}
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { useMemo } from 'react';
|
|
24
24
|
import * as stylex from '@stylexjs/stylex';
|
|
25
|
+
import "../theme/tokens.stylex.js";
|
|
26
|
+
import { radiusVars, shadowVars } from "../theme/tokens.stylex.js";
|
|
25
27
|
import { SizeProvider, useSize } from "../SizeContext/SizeContext.js";
|
|
26
28
|
import { useListFocus } from "../hooks/useListFocus.js";
|
|
27
29
|
import { mergeProps, mergeRefs, composeEventHandlers } from "../utils/index.js";
|
|
@@ -48,6 +50,32 @@ const styles = {
|
|
|
48
50
|
}
|
|
49
51
|
};
|
|
50
52
|
|
|
53
|
+
// Resting elevation for the whole group — the connected buttons share one
|
|
54
|
+
// surface, so the shadow sits on the group wrapper and lifts them as a unit.
|
|
55
|
+
// The wrapper takes the element radius so the shadow follows the group's
|
|
56
|
+
// rounded outer corners rather than a bare rectangle. 'none' is the default.
|
|
57
|
+
const elevationStyles = {
|
|
58
|
+
none: {
|
|
59
|
+
kGVxlE: "x1gnnqk1",
|
|
60
|
+
$$css: true
|
|
61
|
+
},
|
|
62
|
+
low: {
|
|
63
|
+
kGVxlE: "x1i5ehqx",
|
|
64
|
+
kaIpWk: "xh6dtrn",
|
|
65
|
+
$$css: true
|
|
66
|
+
},
|
|
67
|
+
med: {
|
|
68
|
+
kGVxlE: "x14hfi27",
|
|
69
|
+
kaIpWk: "xh6dtrn",
|
|
70
|
+
$$css: true
|
|
71
|
+
},
|
|
72
|
+
high: {
|
|
73
|
+
kGVxlE: "x1kcpxr7",
|
|
74
|
+
kaIpWk: "xh6dtrn",
|
|
75
|
+
$$css: true
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
51
79
|
// =============================================================================
|
|
52
80
|
// Component
|
|
53
81
|
// =============================================================================
|
|
@@ -88,6 +116,7 @@ export function ButtonGroup({
|
|
|
88
116
|
orientation = 'horizontal',
|
|
89
117
|
size: sizeProp,
|
|
90
118
|
isDisabled = false,
|
|
119
|
+
elevation = 'none',
|
|
91
120
|
xstyle,
|
|
92
121
|
className,
|
|
93
122
|
style,
|
|
@@ -118,7 +147,7 @@ export function ButtonGroup({
|
|
|
118
147
|
...mergeProps(themeProps('button-group', {
|
|
119
148
|
size,
|
|
120
149
|
orientation
|
|
121
|
-
}), stylex.props(styles.group, orientation === 'vertical' && styles.vertical, xstyle), className, style),
|
|
150
|
+
}), stylex.props(styles.group, orientation === 'vertical' && styles.vertical, elevationStyles[elevation], xstyle), className, style),
|
|
122
151
|
role: "group",
|
|
123
152
|
"aria-label": label,
|
|
124
153
|
onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown),
|
package/dist/Card/Card.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* - /packages/cli/templates/blocks/components/Card/ (showcase blocks)
|
|
12
12
|
*/
|
|
13
13
|
import type { ReactNode } from 'react';
|
|
14
|
-
import type { SizeValue, SpacingStep } from '../utils/types';
|
|
14
|
+
import type { Elevation, SizeValue, SpacingStep } from '../utils/types';
|
|
15
15
|
import type { BaseProps } from '../BaseProps';
|
|
16
16
|
/**
|
|
17
17
|
* Background color variant for Card.
|
|
@@ -78,6 +78,12 @@ export interface CardProps extends BaseProps<HTMLDivElement> {
|
|
|
78
78
|
* @default 'default'
|
|
79
79
|
*/
|
|
80
80
|
variant?: CardVariant;
|
|
81
|
+
/**
|
|
82
|
+
* Resting elevation — the shadow depth the card sits at.
|
|
83
|
+
* `none` is flat; `low`/`med`/`high` map to the shadow token scale.
|
|
84
|
+
* @default 'none'
|
|
85
|
+
*/
|
|
86
|
+
elevation?: Elevation;
|
|
81
87
|
}
|
|
82
88
|
/**
|
|
83
89
|
* A card container with border and themed styling.
|
|
@@ -113,7 +119,7 @@ export interface CardProps extends BaseProps<HTMLDivElement> {
|
|
|
113
119
|
* </Card>
|
|
114
120
|
* ```
|
|
115
121
|
*/
|
|
116
|
-
export declare function Card({ width, height, maxWidth, minHeight, children, padding, variant, xstyle, className, style, ref, ...props }: CardProps): import("react").JSX.Element;
|
|
122
|
+
export declare function Card({ width, height, maxWidth, minHeight, children, padding, variant, elevation, xstyle, className, style, ref, ...props }: CardProps): import("react").JSX.Element;
|
|
117
123
|
export declare namespace Card {
|
|
118
124
|
var displayName: string;
|
|
119
125
|
}
|
package/dist/Card/Card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAiBrC,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAO5C;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,aAAa,GACb,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,KAAK,GACL,MAAM,GACN,QAAQ,CAAC;AA2Gb,YAAY,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAO,EACP,OAAmB,EACnB,SAAkB,EAClB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,+BA2DX;yBAzEe,IAAI"}
|
package/dist/Card/Card.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import * as stylex from '@stylexjs/stylex';
|
|
18
18
|
import "../theme/tokens.stylex.js";
|
|
19
|
-
import { borderVars, colorVars, radiusVars } from "../theme/tokens.stylex.js";
|
|
19
|
+
import { borderVars, colorVars, radiusVars, shadowVars } from "../theme/tokens.stylex.js";
|
|
20
20
|
import { container } from "../Layout/container.stylex.js";
|
|
21
21
|
import { paddingStyles, containerPaddingInlineVarStyles, containerPaddingBlockStartVarStyles, containerPaddingBlockEndVarStyles, spacingStepToToken } from "../Layout/padding.stylex.js";
|
|
22
22
|
import { mergeProps } from "../utils/index.js";
|
|
@@ -49,6 +49,7 @@ const styles = {
|
|
|
49
49
|
"--_card-radius": "x2kkz0m",
|
|
50
50
|
kaIpWk: "x153u1i6",
|
|
51
51
|
kVQacm: "x7giv3",
|
|
52
|
+
kGVxlE: "x1p8z4y0",
|
|
52
53
|
$$css: true
|
|
53
54
|
},
|
|
54
55
|
withBorder: {
|
|
@@ -123,6 +124,30 @@ const variantStyles = {
|
|
|
123
124
|
}
|
|
124
125
|
};
|
|
125
126
|
|
|
127
|
+
// Elevation → shadow-token map. Sets the private --_card-elevation variable
|
|
128
|
+
// (not box-shadow directly) so it composes with --_card-ring in the shadow
|
|
129
|
+
// list above — a selection ring and a resting elevation coexist without one
|
|
130
|
+
// overwriting the other. 'none' is a transparent no-op (not the CSS literal
|
|
131
|
+
// `none`, which would be invalid inside the comma-separated shadow list).
|
|
132
|
+
const elevationStyles = {
|
|
133
|
+
none: {
|
|
134
|
+
"--_card-elevation": "xw28qpl",
|
|
135
|
+
$$css: true
|
|
136
|
+
},
|
|
137
|
+
low: {
|
|
138
|
+
"--_card-elevation": "x1nn8khe",
|
|
139
|
+
$$css: true
|
|
140
|
+
},
|
|
141
|
+
med: {
|
|
142
|
+
"--_card-elevation": "x1ovzxg0",
|
|
143
|
+
$$css: true
|
|
144
|
+
},
|
|
145
|
+
high: {
|
|
146
|
+
"--_card-elevation": "xnpe7fx",
|
|
147
|
+
$$css: true
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
126
151
|
// Dynamic styles for sizing props
|
|
127
152
|
const dynamicStyles = {
|
|
128
153
|
sizing: (width, height, maxWidth, minHeight) => [{
|
|
@@ -180,6 +205,7 @@ export function Card({
|
|
|
180
205
|
children,
|
|
181
206
|
padding,
|
|
182
207
|
variant = 'default',
|
|
208
|
+
elevation = 'none',
|
|
183
209
|
xstyle,
|
|
184
210
|
className,
|
|
185
211
|
style,
|
|
@@ -197,7 +223,7 @@ export function Card({
|
|
|
197
223
|
ref: ref,
|
|
198
224
|
...mergeProps(themeProps('card', {
|
|
199
225
|
variant
|
|
200
|
-
}), stylex.props(styles.card, variantStyles[variant], hasFixedHeight && styles.scrollable, dynamicStyles.sizing(width ?? null, height ?? null, maxWidth ?? null, minHeight ?? null), ...container(useThemeDefault ? {
|
|
226
|
+
}), stylex.props(styles.card, variantStyles[variant], elevationStyles[elevation], hasFixedHeight && styles.scrollable, dynamicStyles.sizing(width ?? null, height ?? null, maxWidth ?? null, minHeight ?? null), ...container(useThemeDefault ? {
|
|
201
227
|
useThemeDefault: 'card'
|
|
202
228
|
} : {
|
|
203
229
|
paddingInnerX: paddingToken,
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
* @input Uses React, StyleX, useScrollOverflow, useLayer, Button, Icon, theme tokens
|
|
4
4
|
* @output Exports Carousel component
|
|
5
5
|
* @position Horizontal scroll container with fade-edge overflow indication,
|
|
6
|
-
* optional prev/next buttons on the top layer, scroll-snap,
|
|
7
|
-
* visual bleed allowance for child selection indicators
|
|
6
|
+
* optional prev/next buttons on the top layer, scroll-snap, a 1px
|
|
7
|
+
* visual bleed allowance for child selection indicators, and Shift + wheel
|
|
8
|
+
* mapping so mouse users can scroll horizontally. Exposes APG
|
|
9
|
+
* carousel semantics: the root is a labelled region with
|
|
10
|
+
* aria-roledescription="carousel" and each item wrapper is a group with
|
|
11
|
+
* aria-roledescription="slide" named "Slide N of M".
|
|
8
12
|
*
|
|
9
13
|
* SYNC: When modified, update:
|
|
10
14
|
* - /packages/core/src/Carousel/index.ts (exports)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../src/Carousel/Carousel.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../src/Carousel/Carousel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAcf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAIhD,MAAM,WAAW,aAAc,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC9D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,kEAAkE;IAClE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAyJD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,GAAG,EACH,QAAQ,EACR,GAAO,EACP,UAAiB,EACjB,WAAkB,EAClB,OAAe,EACf,OAAO,EACP,YAAY,EAAE,kBAAkB,EAChC,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,SAAS,EACb,EAAE,aAAa,+BAiMf;yBA/Me,QAAQ"}
|
|
@@ -7,15 +7,19 @@
|
|
|
7
7
|
* @input Uses React, StyleX, useScrollOverflow, useLayer, Button, Icon, theme tokens
|
|
8
8
|
* @output Exports Carousel component
|
|
9
9
|
* @position Horizontal scroll container with fade-edge overflow indication,
|
|
10
|
-
* optional prev/next buttons on the top layer, scroll-snap,
|
|
11
|
-
* visual bleed allowance for child selection indicators
|
|
10
|
+
* optional prev/next buttons on the top layer, scroll-snap, a 1px
|
|
11
|
+
* visual bleed allowance for child selection indicators, and Shift + wheel
|
|
12
|
+
* mapping so mouse users can scroll horizontally. Exposes APG
|
|
13
|
+
* carousel semantics: the root is a labelled region with
|
|
14
|
+
* aria-roledescription="carousel" and each item wrapper is a group with
|
|
15
|
+
* aria-roledescription="slide" named "Slide N of M".
|
|
12
16
|
*
|
|
13
17
|
* SYNC: When modified, update:
|
|
14
18
|
* - /packages/core/src/Carousel/index.ts (exports)
|
|
15
19
|
* - /apps/storybook/stories/Carousel.stories.tsx
|
|
16
20
|
* - /packages/cli/templates/blocks/components/Carousel/ (showcase blocks)
|
|
17
21
|
*/
|
|
18
|
-
import { useRef, useCallback, useEffect, Children } from 'react';
|
|
22
|
+
import { useRef, useCallback, useEffect, Children, isValidElement } from 'react';
|
|
19
23
|
import * as stylex from '@stylexjs/stylex';
|
|
20
24
|
import "../theme/tokens.stylex.js";
|
|
21
25
|
import { spacingVars, colorVars, shadowVars, radiusVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
@@ -219,6 +223,11 @@ export function Carousel({
|
|
|
219
223
|
overflowStart,
|
|
220
224
|
overflowEnd
|
|
221
225
|
} = useScrollOverflow();
|
|
226
|
+
|
|
227
|
+
// Children.toArray drops null/undefined/boolean children and assigns
|
|
228
|
+
// stable keys, so slide numbering ("Slide N of M") matches what actually
|
|
229
|
+
// renders even when some children are conditionally omitted.
|
|
230
|
+
const slides = Children.toArray(children);
|
|
222
231
|
const layer = useLayer({
|
|
223
232
|
mode: 'context',
|
|
224
233
|
lightDismiss: false
|
|
@@ -234,6 +243,34 @@ export function Carousel({
|
|
|
234
243
|
scrollElRef.current = el;
|
|
235
244
|
scrollRef(el);
|
|
236
245
|
}, [scrollRef]);
|
|
246
|
+
|
|
247
|
+
// Map Shift + vertical wheel to horizontal scroll. Trackpads emit
|
|
248
|
+
// horizontal deltas natively, but a standard mouse only produces deltaY —
|
|
249
|
+
// so mouse users can't wheel-scroll a horizontal container. Shift + wheel
|
|
250
|
+
// is the long-established convention for horizontal scroll containers; we
|
|
251
|
+
// honor it by translating the vertical delta into a horizontal scroll.
|
|
252
|
+
//
|
|
253
|
+
// Only kicks in when Shift is held and the wheel is purely vertical
|
|
254
|
+
// (deltaX === 0), so native trackpad horizontal scrolling is untouched.
|
|
255
|
+
const handleWheel = useCallback(event => {
|
|
256
|
+
if (!event.shiftKey || event.deltaY === 0 || event.deltaX !== 0) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
const el = scrollElRef.current;
|
|
260
|
+
if (!el) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
// Nothing to scroll horizontally — let the event fall through so the page
|
|
264
|
+
// can scroll as it normally would.
|
|
265
|
+
if (el.scrollWidth <= el.clientWidth) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
event.preventDefault();
|
|
269
|
+
el.scrollBy({
|
|
270
|
+
left: event.deltaY,
|
|
271
|
+
behavior: 'auto'
|
|
272
|
+
});
|
|
273
|
+
}, []);
|
|
237
274
|
const scrollBy = useCallback(direction => {
|
|
238
275
|
const el = scrollElRef.current;
|
|
239
276
|
if (!el) {
|
|
@@ -271,13 +308,26 @@ export function Carousel({
|
|
|
271
308
|
children: [/*#__PURE__*/_jsx("div", {
|
|
272
309
|
ref: composedRef,
|
|
273
310
|
tabIndex: 0,
|
|
311
|
+
onWheel: handleWheel,
|
|
274
312
|
...stylex.props(styles.scroller, gapStyles[gap], padding != null && paddingStyles[padding], hasSnap && styles.snap, fadeStyle),
|
|
275
|
-
children:
|
|
313
|
+
children: slides.map((child, index) =>
|
|
314
|
+
/*#__PURE__*/
|
|
315
|
+
// APG carousel pattern: each slide container is a group with
|
|
316
|
+
// aria-roledescription="slide" and an "N of M" accessible name so
|
|
317
|
+
// ATs announce slide boundaries and position instead of anonymous
|
|
318
|
+
// generics.
|
|
319
|
+
_jsx("div", {
|
|
320
|
+
role: "group",
|
|
321
|
+
"aria-roledescription": "slide",
|
|
322
|
+
"aria-label": t('@astryx.carousel.slideLabel', {
|
|
323
|
+
current: index + 1,
|
|
324
|
+
total: slides.length
|
|
325
|
+
}),
|
|
276
326
|
...{
|
|
277
327
|
className: "x1bhewko x78zum5 x2lah0s"
|
|
278
328
|
},
|
|
279
329
|
children: child
|
|
280
|
-
}))
|
|
330
|
+
}, /*#__PURE__*/isValidElement(child) ? child.key : index))
|
|
281
331
|
}), hasButtons && layer.render(/*#__PURE__*/_jsxs(_Fragment, {
|
|
282
332
|
children: [/*#__PURE__*/_jsx("div", {
|
|
283
333
|
...{
|
|
@@ -43,6 +43,14 @@ export interface ChatComposerProps extends Omit<BaseProps<HTMLDivElement>, 'onCh
|
|
|
43
43
|
isDisabled?: boolean;
|
|
44
44
|
/** Density variant */
|
|
45
45
|
density?: ChatComposerDensity;
|
|
46
|
+
/**
|
|
47
|
+
* Resting elevation of the composer body. `low` (the default) keeps today's
|
|
48
|
+
* raised look — low at rest, bumping to med on hover / focus. `none` flattens
|
|
49
|
+
* it and draws a border with the same rest / hover / focus treatment as a
|
|
50
|
+
* text input (emphasized border → accent on focus, with matching inset rings).
|
|
51
|
+
* @default 'low'
|
|
52
|
+
*/
|
|
53
|
+
elevation?: 'none' | 'low';
|
|
46
54
|
/** Collapsible drawer rendered above the input — attachments, context chips, etc. Use ChatComposerDrawer. */
|
|
47
55
|
drawer?: ReactNode;
|
|
48
56
|
/** Actions rendered on the left side of the header (e.g. attach, mention buttons). Use icon-only `size="sm"` buttons. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposer.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatComposer.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyB5C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEtE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAC7C,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,GAAG,UAAU,CACxB;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,+CAA+C;IAC/C,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,kFAAkF;IAClF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB;IACtB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAI3B,6GAA6G;IAC7G,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,yHAAyH;IACzH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,yGAAyG;IACzG,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gHAAgH;IAChH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,gHAAgH;IAChH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,gDAAgD;IAChD,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,iEAAiE;IACjE,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,oDAAoD;IACpD,cAAc,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;CACnC;AA8LD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBAmKpD;yBAnKe,YAAY"}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import React, { useState, useCallback, useRef, useMemo } from 'react';
|
|
26
26
|
import * as stylex from '@stylexjs/stylex';
|
|
27
27
|
import "../theme/tokens.stylex.js";
|
|
28
|
-
import { colorVars, spacingVars, radiusVars, shadowVars, durationVars, easeVars, typeScaleVars, typographyVars } from "../theme/tokens.stylex.js";
|
|
28
|
+
import { colorVars, spacingVars, radiusVars, shadowVars, durationVars, easeVars, borderVars, typeScaleVars, typographyVars } from "../theme/tokens.stylex.js";
|
|
29
29
|
import { mergeProps } from "../utils/index.js";
|
|
30
30
|
import { Icon } from "../Icon/index.js";
|
|
31
31
|
import { ChatComposerInput } from "./ChatComposerInput.js";
|
|
@@ -53,18 +53,42 @@ const styles = {
|
|
|
53
53
|
kaIpWk: "x1xunbrq",
|
|
54
54
|
kWkggS: "x1prclbq",
|
|
55
55
|
kkrTdU: "x1ed109x",
|
|
56
|
-
|
|
57
|
-
kmkexE: "xiw5bxp",
|
|
58
|
-
knuKkz: "xyavpck",
|
|
56
|
+
kmkexE: "xrg7dcy",
|
|
59
57
|
$$css: true
|
|
60
58
|
},
|
|
61
59
|
compact: {
|
|
62
|
-
|
|
60
|
+
"--_chat-composer-padding": "x18zce08",
|
|
63
61
|
kOIVth: "xzye2dw",
|
|
64
62
|
$$css: true
|
|
65
63
|
}
|
|
66
64
|
};
|
|
67
65
|
|
|
66
|
+
// Resting elevation for the composer body, narrowed to two steps.
|
|
67
|
+
// - `low` (default) preserves today's look: low at rest, bumping to med on
|
|
68
|
+
// hover / focus-within (a CSS-only interaction state the component owns).
|
|
69
|
+
// - `none` is flat; depth comes from a border + inset rings instead. The
|
|
70
|
+
// border is drawn *inside* the padding — its width is subtracted from every
|
|
71
|
+
// side (like Card) so total inset (border + padding) equals the elevated
|
|
72
|
+
// case and content geometry is unchanged. Border color, hover, and focus
|
|
73
|
+
// states mirror TextInput (shared `inputWrapperStyles.base` treatment):
|
|
74
|
+
// emphasized border at rest → accent on focus-within, with the same inset
|
|
75
|
+
// shadow rings on hover and focus.
|
|
76
|
+
const elevationStyles = {
|
|
77
|
+
low: {
|
|
78
|
+
kGVxlE: "x1i5ehqx xhouywz",
|
|
79
|
+
knuKkz: "xyavpck",
|
|
80
|
+
$$css: true
|
|
81
|
+
},
|
|
82
|
+
none: {
|
|
83
|
+
kMzoRj: "x1litavf",
|
|
84
|
+
ksu8eU: "x1y0btm7",
|
|
85
|
+
kVAM5u: "xvy26l8 x6q1khz",
|
|
86
|
+
kmVPX3: "x1b50gpf",
|
|
87
|
+
kGVxlE: "x1gnnqk1 x12y27fx xuihb5h",
|
|
88
|
+
$$css: true
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
68
92
|
// =============================================================================
|
|
69
93
|
// Component
|
|
70
94
|
// =============================================================================
|
|
@@ -93,6 +117,7 @@ export function ChatComposer(props) {
|
|
|
93
117
|
placeholder: placeholderFromProps,
|
|
94
118
|
isDisabled = false,
|
|
95
119
|
density = 'balanced',
|
|
120
|
+
elevation = 'low',
|
|
96
121
|
drawer,
|
|
97
122
|
headerActions,
|
|
98
123
|
headerContext,
|
|
@@ -199,7 +224,7 @@ export function ChatComposer(props) {
|
|
|
199
224
|
children: [statusPosition === 'top' && statusEl, drawer, /*#__PURE__*/_jsxs("div", {
|
|
200
225
|
ref: bodyRef,
|
|
201
226
|
onClick: handleBodyClick,
|
|
202
|
-
...stylex.props(styles.body, density === 'compact' && styles.compact, xstyle),
|
|
227
|
+
...stylex.props(styles.body, elevationStyles[elevation], density === 'compact' && styles.compact, xstyle),
|
|
203
228
|
children: [(headerActions || headerContext) && /*#__PURE__*/_jsxs("div", {
|
|
204
229
|
...{
|
|
205
230
|
className: "x78zum5 x6s0dn4 x1qughib x1txdalj xe0p6wg"
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* @position Collapsible drawer panel for ChatComposer.
|
|
6
6
|
* Supports expanded (full content) and collapsed (count + label) states
|
|
7
7
|
* with fade animation and grid-template-rows height transition.
|
|
8
|
+
* The collapse toggle exposes aria-expanded + aria-controls linking it to
|
|
9
|
+
* the content region (disclosure pattern).
|
|
8
10
|
*
|
|
9
11
|
* SYNC: When modified, update:
|
|
10
12
|
* - /packages/core/src/Chat/index.ts (exports)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposerDrawer.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposerDrawer.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"ChatComposerDrawer.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposerDrawer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAkB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAYnD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAI5C,MAAM,WAAW,uBAAwB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACxE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAEnD;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAgID;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,GAAG,EACH,QAAQ,EACR,KAAK,EACL,KAAK,EAAE,cAAc,EACrB,WAAW,EAAE,mBAAmB,EAChC,kBAA0B,EAC1B,iBAAiB,EACjB,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,SAAS,EACb,EAAE,uBAAuB,GAAG,KAAK,CAAC,YAAY,CA6F9C;yBA1Ge,kBAAkB"}
|
|
@@ -9,12 +9,14 @@
|
|
|
9
9
|
* @position Collapsible drawer panel for ChatComposer.
|
|
10
10
|
* Supports expanded (full content) and collapsed (count + label) states
|
|
11
11
|
* with fade animation and grid-template-rows height transition.
|
|
12
|
+
* The collapse toggle exposes aria-expanded + aria-controls linking it to
|
|
13
|
+
* the content region (disclosure pattern).
|
|
12
14
|
*
|
|
13
15
|
* SYNC: When modified, update:
|
|
14
16
|
* - /packages/core/src/Chat/index.ts (exports)
|
|
15
17
|
* - /packages/cli/templates/blocks/components/ChatComposerDrawer/ (block examples)
|
|
16
18
|
*/
|
|
17
|
-
import { useState } from 'react';
|
|
19
|
+
import { useId, useState } from 'react';
|
|
18
20
|
import * as stylex from '@stylexjs/stylex';
|
|
19
21
|
import "../theme/tokens.stylex.js";
|
|
20
22
|
import { colorVars, spacingVars, radiusVars, durationVars, easeVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
@@ -74,6 +76,12 @@ export function ChatComposerDrawer({
|
|
|
74
76
|
const isControlled = controlledCollapsed !== undefined;
|
|
75
77
|
const isCollapsed = isControlled ? controlledCollapsed : internalCollapsed;
|
|
76
78
|
const canCollapse = count != null;
|
|
79
|
+
|
|
80
|
+
// Links the toggle to the region it shows/hides so assistive tech can move
|
|
81
|
+
// from the button to its controlled content (disclosure pattern). The
|
|
82
|
+
// content stays mounted while collapsed (hidden via the grid-row collapse),
|
|
83
|
+
// so the reference always resolves.
|
|
84
|
+
const contentId = useId();
|
|
77
85
|
const toggle = () => {
|
|
78
86
|
const next = !isCollapsed;
|
|
79
87
|
if (!isControlled) {
|
|
@@ -100,6 +108,7 @@ export function ChatComposerDrawer({
|
|
|
100
108
|
role: "button",
|
|
101
109
|
tabIndex: 0,
|
|
102
110
|
"aria-expanded": !isCollapsed,
|
|
111
|
+
"aria-controls": contentId,
|
|
103
112
|
"aria-label": isCollapsed ? t('@astryx.chatComposerDrawer.expand', {
|
|
104
113
|
label
|
|
105
114
|
}) : t('@astryx.chatComposerDrawer.collapse', {
|
|
@@ -141,6 +150,7 @@ export function ChatComposerDrawer({
|
|
|
141
150
|
}[!!isCollapsed << 0]
|
|
142
151
|
})]
|
|
143
152
|
}), /*#__PURE__*/_jsx("div", {
|
|
153
|
+
id: contentId,
|
|
144
154
|
...{
|
|
145
155
|
0: {
|
|
146
156
|
className: "xrvj5dj x1tu4anv x1qn9uv2 x80gvsz xlr8y92"
|
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
*
|
|
8
8
|
* ContentEditable-based rich input for the chat composer.
|
|
9
9
|
* Supports trigger menus (@ mentions, / commands) via SearchSource,
|
|
10
|
-
* inline token rendering, serialization, Enter
|
|
11
|
-
*
|
|
10
|
+
* inline token rendering, serialization, Enter-to-submit with
|
|
11
|
+
* IME-composition guarding and an onKeyDown seam for platform-specific
|
|
12
|
+
* key handling, message history, paste/drop file handling, and
|
|
13
|
+
* mobile-safe touch typography.
|
|
12
14
|
*
|
|
13
15
|
*
|
|
14
16
|
* SYNC: When modified, update:
|
|
@@ -16,7 +18,7 @@
|
|
|
16
18
|
* - /apps/storybook/stories/ChatComposer.stories.tsx
|
|
17
19
|
* - /packages/cli/templates/blocks/components/ChatComposerInput/ (block examples)
|
|
18
20
|
*/
|
|
19
|
-
import { type ReactNode, type ClipboardEvent } from 'react';
|
|
21
|
+
import { type ReactNode, type KeyboardEvent, type ClipboardEvent } from 'react';
|
|
20
22
|
import type { BaseProps } from '../BaseProps';
|
|
21
23
|
import type { SearchableItem, SearchSource } from '../Typeahead/types';
|
|
22
24
|
import { type UseChatPasteAsTokenReturn } from './useChatPasteAsToken';
|
|
@@ -137,6 +139,21 @@ export interface ChatComposerInputProps extends Omit<BaseProps<HTMLDivElement>,
|
|
|
137
139
|
onFiles?: (files: File[]) => void;
|
|
138
140
|
/** Submit handler (Enter without Shift) */
|
|
139
141
|
onSubmit?: (value: string) => void;
|
|
142
|
+
/**
|
|
143
|
+
* Key-down handler invoked before the built-in Enter/history behavior
|
|
144
|
+
* (but after an open trigger menu consumes the event).
|
|
145
|
+
*
|
|
146
|
+
* This is the seam for platform- or app-specific key handling:
|
|
147
|
+
* - Call `event.preventDefault()` to suppress the default submit (e.g.
|
|
148
|
+
* let Enter insert a newline on a touch keyboard).
|
|
149
|
+
* - Add behavior by acting on the event yourself (e.g. submit on
|
|
150
|
+
* Cmd/Ctrl+Enter) without calling `preventDefault()`, so the default
|
|
151
|
+
* handling still runs for other keys.
|
|
152
|
+
*
|
|
153
|
+
* IME composition is always respected regardless of this handler: Enter
|
|
154
|
+
* never submits while a composition is in progress.
|
|
155
|
+
*/
|
|
156
|
+
onKeyDown?: (event: KeyboardEvent<HTMLDivElement>) => void;
|
|
140
157
|
}
|
|
141
158
|
export declare function ChatComposerInput(props: ChatComposerInputProps): import("react").JSX.Element;
|
|
142
159
|
export declare namespace ChatComposerInput {
|