@astryxdesign/core 0.1.8 → 0.1.9-canary.02ef052
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 +100 -0
- 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 +58 -3
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +240 -53
- package/dist/Avatar/AvatarStatusDot.d.ts +35 -5
- package/dist/Avatar/AvatarStatusDot.d.ts.map +1 -1
- package/dist/Avatar/AvatarStatusDot.js +144 -19
- package/dist/AvatarGroup/AvatarGroup.d.ts +7 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +58 -6
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +1 -0
- package/dist/Banner/Banner.d.ts +9 -1
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +33 -4
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +31 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +215 -6
- package/dist/Breadcrumbs/index.d.ts +6 -0
- package/dist/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/Breadcrumbs/index.js +10 -1
- package/dist/Button/Button.d.ts +8 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +33 -4
- 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/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +80 -11
- package/dist/Calendar/dayCellUtils.d.ts +4 -4
- package/dist/Calendar/dayCellUtils.js +3 -3
- package/dist/Calendar/styles.d.ts +30 -31
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +30 -31
- 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 +4 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +46 -16
- package/dist/Chat/ChatComposer.d.ts +8 -0
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +46 -7
- 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 +36 -4
- package/dist/Chat/ChatContext.d.ts +33 -0
- package/dist/Chat/ChatContext.d.ts.map +1 -1
- package/dist/Chat/ChatContext.js +16 -2
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +4 -2
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +4 -4
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +4 -4
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +7 -1
- package/dist/Chat/ChatToolCalls.d.ts +5 -1
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +27 -11
- package/dist/Chat/index.d.ts +2 -1
- package/dist/Chat/index.d.ts.map +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/Chat/useChatStreamScroll.d.ts +2 -1
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +22 -8
- package/dist/Chat/useSpeechRecognition.d.ts +0 -1
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +1 -1
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +2 -2
- package/dist/CheckboxInput/CheckboxInput.js +5 -5
- package/dist/CheckboxList/CheckboxListItem.d.ts +20 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +11 -1
- package/dist/Citation/Citation.d.ts +22 -1
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +20 -6
- package/dist/ClickableCard/ClickableCard.d.ts +9 -2
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +5 -2
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +22 -9
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +3 -1
- package/dist/CommandPalette/CommandPalette.d.ts +2 -2
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +45 -4
- package/dist/CommandPalette/CommandPaletteGroup.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteGroup.js +9 -2
- 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/CommandPalette/CommandPaletteItem.js +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +14 -5
- package/dist/ContextMenu/index.d.ts +1 -0
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/ContextMenu/index.js +3 -1
- package/dist/DateInput/DateInput.d.ts +56 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +59 -21
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts +10 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +23 -20
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +33 -19
- package/dist/Dialog/Dialog.d.ts +3 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +57 -6
- package/dist/Dialog/DialogContext.d.ts +7 -0
- package/dist/Dialog/DialogContext.d.ts.map +1 -1
- package/dist/Dialog/DialogContext.js +2 -2
- package/dist/Dialog/DialogHeader.d.ts +5 -2
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +6 -1
- package/dist/Divider/Divider.js +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts +6 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +22 -5
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -2
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +5 -3
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +5 -2
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +1 -2
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +1 -2
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +4 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +104 -0
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +427 -0
- package/dist/DropdownMenu/index.d.ts +10 -0
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/index.js +13 -0
- package/dist/DropdownMenu/menuItemHover.d.ts +23 -0
- package/dist/DropdownMenu/menuItemHover.d.ts.map +1 -0
- package/dist/DropdownMenu/menuItemHover.js +33 -0
- package/dist/DropdownMenu/menuItemRoles.d.ts +8 -0
- package/dist/DropdownMenu/menuItemRoles.d.ts.map +1 -1
- package/dist/DropdownMenu/menuItemRoles.js +10 -1
- package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -1
- package/dist/DropdownMenu/renderDropdownItems.js +21 -6
- package/dist/Field/Field.d.ts +3 -1
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +6 -4
- package/dist/Field/FieldLabel.d.ts +1 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +43 -16
- package/dist/Field/inputStyles.stylex.d.ts +1 -0
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +1 -0
- package/dist/FieldStatus/FieldStatus.d.ts +18 -0
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +60 -6
- package/dist/FileInput/FileInput.d.ts +10 -2
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +54 -35
- 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 +17 -6
- package/dist/Icon/Icon.d.ts +22 -3
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +19 -3
- package/dist/Item/Item.d.ts +6 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +22 -1
- 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/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +19 -13
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +7 -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 +9 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +104 -50
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +16 -0
- package/dist/NavMenu/NavHeadingMenuItem.js +1 -1
- package/dist/NumberInput/NumberInput.d.ts +10 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +22 -17
- package/dist/Outline/Outline.d.ts +0 -1
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +0 -1
- 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/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +11 -3
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +3 -2
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +3 -9
- package/dist/PowerSearch/PowerSearch.d.ts +9 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +2 -0
- package/dist/PowerSearch/PowerSearchEditPopover.js +1 -1
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/RadioList/RadioList.d.ts +2 -2
- package/dist/RadioList/RadioListItem.js +4 -4
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +2 -1
- package/dist/SelectableCard/SelectableCard.d.ts +9 -2
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +16 -13
- package/dist/Selector/Selector.d.ts +8 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +65 -19
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +16 -0
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +5 -5
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +13 -10
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +21 -8
- package/dist/SideNav/SideNavItem.d.ts +1 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +12 -10
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +106 -36
- package/dist/Stack/stack.stylex.d.ts +9 -9
- package/dist/Switch/Switch.d.ts +8 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +160 -91
- package/dist/TabList/Tab.js +2 -2
- package/dist/TabList/TabMenu.js +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +33 -6
- package/dist/Table/TableCell.js +3 -3
- package/dist/Table/TableHeaderCell.js +3 -3
- package/dist/Table/index.d.ts +2 -0
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +1 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +15 -11
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +36 -26
- 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 +13 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +7 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.d.ts +16 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +105 -12
- package/dist/Table/plugins/tree/useTableTreeState.d.ts +6 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeState.js +22 -1
- package/dist/Table/types.d.ts +32 -0
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +5 -3
- package/dist/TextArea/TextArea.d.ts +10 -1
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +18 -19
- package/dist/TextInput/TextInput.d.ts +10 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +20 -17
- package/dist/Thumbnail/Thumbnail.d.ts +26 -5
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +97 -54
- package/dist/Thumbnail/thumbnail.markers.stylex.d.ts +9 -0
- package/dist/Thumbnail/thumbnail.markers.stylex.d.ts.map +1 -0
- package/dist/Thumbnail/thumbnail.markers.stylex.js +14 -0
- package/dist/TimeInput/TimeInput.d.ts +10 -2
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +32 -21
- package/dist/Timestamp/Timestamp.d.ts +3 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +8 -6
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +2 -5
- package/dist/ToggleButton/ToggleButtonGroup.d.ts +0 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.js +1 -1
- package/dist/Token/Token.d.ts +30 -3
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +17 -2
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.d.ts +10 -3
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +20 -6
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +17 -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/TopNavMegaMenuFeaturedCard.d.ts +9 -1
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.js +8 -1
- 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/TreeList.d.ts +12 -3
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +3 -0
- package/dist/TreeList/TreeListBranches.d.ts +5 -0
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +18 -10
- package/dist/TreeList/TreeListItem.d.ts +8 -2
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +59 -21
- package/dist/TreeList/TreeListTypes.d.ts +25 -1
- package/dist/TreeList/TreeListTypes.d.ts.map +1 -1
- package/dist/TreeList/index.d.ts +2 -2
- package/dist/TreeList/index.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +20 -11
- package/dist/Typeahead/Typeahead.d.ts +9 -2
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +3 -1
- package/dist/Typeahead/TypeaheadItem.d.ts +1 -1
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/Typeahead/TypeaheadItem.js +20 -10
- package/dist/astryx.css +61 -39
- package/dist/astryx.umd.js +53 -53
- package/dist/astryx.umd.js.map +4 -4
- package/dist/authoring/doc.d.ts.map +1 -1
- package/dist/docs-types.d.ts +8 -0
- package/dist/docs-types.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/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/isRtlElement.d.ts +18 -0
- package/dist/hooks/isRtlElement.d.ts.map +1 -0
- package/dist/hooks/isRtlElement.js +27 -0
- package/dist/hooks/useDevWarning.d.ts +18 -0
- package/dist/hooks/useDevWarning.d.ts.map +1 -0
- package/dist/hooks/useDevWarning.js +49 -0
- package/dist/hooks/useGridFocus.d.ts +6 -1
- package/dist/hooks/useGridFocus.d.ts.map +1 -1
- package/dist/hooks/useGridFocus.js +12 -9
- package/dist/hooks/useInputStatusIcon.d.ts +38 -0
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -0
- package/dist/hooks/useInputStatusIcon.js +158 -0
- package/dist/hooks/useListFocus.d.ts +39 -1
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +54 -9
- package/dist/hooks/useOverflow.d.ts +19 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +36 -25
- package/dist/i18n/InternationalizationContext.d.ts +1 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +3 -0
- package/dist/i18n/InternationalizationProvider.d.ts +8 -1
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +5 -1
- package/dist/i18n/getLocaleDirection.d.ts +18 -0
- package/dist/i18n/getLocaleDirection.d.ts.map +1 -0
- package/dist/i18n/getLocaleDirection.js +29 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +7 -1
- package/dist/i18n/resolve.d.ts.map +1 -1
- package/dist/i18n/resolve.js +7 -18
- package/dist/i18n/useDirection.d.ts +2 -0
- package/dist/i18n/useDirection.d.ts.map +1 -0
- package/dist/i18n/useDirection.js +27 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +2 -7
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +13 -0
- 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 +1 -1
- package/dist/theme/syntax/defineSyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/defineSyntaxTheme.js +2 -1
- package/dist/utils/devWarning.d.ts +42 -0
- package/dist/utils/devWarning.d.ts.map +1 -0
- package/dist/utils/devWarning.js +88 -0
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -2
- package/dist/utils/plainDate.d.ts +30 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +65 -3
- package/dist/utils/rtlStyles.d.ts +24 -0
- package/dist/utils/rtlStyles.d.ts.map +1 -0
- package/dist/utils/rtlStyles.js +27 -0
- package/dist/utils/types.d.ts +13 -0
- package/dist/utils/types.d.ts.map +1 -1
- package/locales/en.json +104 -0
- package/locales/fr-FR.json +14 -0
- package/locales/pseudo.json +78 -0
- package/package.json +6 -1
- 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 +64 -5
- package/src/Avatar/Avatar.test.tsx +374 -1
- package/src/Avatar/Avatar.tsx +367 -69
- package/src/Avatar/AvatarStatusDot.doc.mjs +23 -12
- package/src/Avatar/AvatarStatusDot.test.tsx +284 -0
- package/src/Avatar/AvatarStatusDot.tsx +180 -21
- package/src/AvatarGroup/AvatarGroup.doc.mjs +2 -0
- package/src/AvatarGroup/AvatarGroup.test.tsx +141 -1
- package/src/AvatarGroup/AvatarGroup.tsx +58 -3
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +1 -0
- package/src/Banner/Banner.doc.mjs +9 -0
- package/src/Banner/Banner.test.tsx +30 -0
- package/src/Banner/Banner.tsx +53 -9
- package/src/Breadcrumbs/BreadcrumbItem.doc.mjs +26 -0
- package/src/Breadcrumbs/BreadcrumbItem.tsx +333 -14
- package/src/Breadcrumbs/Breadcrumbs.doc.mjs +2 -0
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +335 -2
- package/src/Breadcrumbs/index.ts +31 -0
- package/src/Button/Button.doc.mjs +9 -4
- package/src/Button/Button.test.tsx +49 -0
- package/src/Button/Button.tsx +27 -3
- 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/Calendar/Calendar.doc.mjs +12 -1
- package/src/Calendar/Calendar.test.tsx +362 -19
- package/src/Calendar/Calendar.tsx +111 -32
- package/src/Calendar/dayCellUtils.test.ts +23 -18
- package/src/Calendar/dayCellUtils.ts +3 -3
- package/src/Calendar/styles.ts +33 -39
- 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 +53 -0
- package/src/Carousel/Carousel.tsx +59 -10
- package/src/Chat/ChatComposer.doc.mjs +12 -3
- package/src/Chat/ChatComposer.test.tsx +115 -0
- package/src/Chat/ChatComposer.tsx +73 -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 +103 -0
- package/src/Chat/ChatComposerInput.tsx +51 -5
- package/src/Chat/ChatContext.tsx +37 -10
- package/src/Chat/ChatDictationButton.tsx +11 -2
- package/src/Chat/ChatLayout.tsx +7 -5
- package/src/Chat/ChatLayoutScrollButton.tsx +7 -2
- package/src/Chat/ChatMessageMetadata.tsx +1 -2
- package/src/Chat/ChatSendButton.tsx +11 -1
- package/src/Chat/ChatToolCalls.test.tsx +64 -0
- package/src/Chat/ChatToolCalls.tsx +33 -5
- package/src/Chat/index.ts +5 -1
- package/src/Chat/useChatStreamScroll.test.tsx +49 -0
- package/src/Chat/useChatStreamScroll.ts +27 -10
- package/src/Chat/useSpeechRecognition.ts +1 -1
- package/src/Chat/useTriggerMenu.tsx +4 -2
- package/src/CheckboxInput/CheckboxInput.doc.mjs +6 -0
- package/src/CheckboxInput/CheckboxInput.test.tsx +32 -1
- package/src/CheckboxInput/CheckboxInput.tsx +5 -5
- package/src/CheckboxList/CheckboxList.doc.mjs +6 -0
- package/src/CheckboxList/CheckboxList.test.tsx +81 -3
- package/src/CheckboxList/CheckboxListItem.doc.mjs +33 -5
- package/src/CheckboxList/CheckboxListItem.tsx +41 -5
- package/src/Citation/Citation.doc.mjs +4 -3
- package/src/Citation/Citation.test.tsx +97 -0
- package/src/Citation/Citation.tsx +43 -11
- package/src/ClickableCard/ClickableCard.doc.mjs +2 -0
- package/src/ClickableCard/ClickableCard.test.tsx +34 -0
- package/src/ClickableCard/ClickableCard.tsx +13 -3
- package/src/CodeBlock/CodeBlock.test.tsx +56 -0
- package/src/CodeBlock/CodeBlock.tsx +45 -10
- package/src/Collapsible/Collapsible.doc.mjs +1 -0
- package/src/Collapsible/Collapsible.test.tsx +7 -0
- package/src/Collapsible/Collapsible.tsx +16 -6
- package/src/CommandPalette/CommandPalette.doc.mjs +1 -0
- package/src/CommandPalette/CommandPalette.test.tsx +95 -1
- package/src/CommandPalette/CommandPalette.tsx +44 -3
- package/src/CommandPalette/CommandPaletteGroup.test.tsx +71 -0
- package/src/CommandPalette/CommandPaletteGroup.tsx +12 -1
- 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/CommandPalette/CommandPaletteItem.tsx +1 -1
- package/src/ContextMenu/ContextMenu.test.tsx +235 -0
- package/src/ContextMenu/ContextMenu.tsx +13 -11
- package/src/ContextMenu/index.ts +5 -0
- package/src/DateInput/DateInput.doc.mjs +41 -0
- package/src/DateInput/DateInput.test.tsx +338 -0
- package/src/DateInput/DateInput.tsx +119 -32
- package/src/DateInput/index.ts +1 -0
- package/src/DateRangeInput/DateRangeInput.doc.mjs +16 -0
- package/src/DateRangeInput/DateRangeInput.test.tsx +140 -0
- package/src/DateRangeInput/DateRangeInput.tsx +42 -30
- package/src/DateTimeInput/DateTimeInput.doc.mjs +22 -1
- package/src/DateTimeInput/DateTimeInput.test.tsx +147 -0
- package/src/DateTimeInput/DateTimeInput.tsx +58 -41
- package/src/Dialog/Dialog.doc.mjs +2 -2
- package/src/Dialog/Dialog.test.tsx +77 -4
- package/src/Dialog/Dialog.tsx +89 -5
- package/src/Dialog/DialogContext.ts +9 -2
- package/src/Dialog/DialogHeader.doc.mjs +2 -2
- package/src/Dialog/DialogHeader.tsx +9 -2
- package/src/Divider/Divider.tsx +2 -2
- package/src/DropdownMenu/DropdownMenu.test.tsx +229 -0
- package/src/DropdownMenu/DropdownMenu.tsx +31 -12
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +9 -4
- package/src/DropdownMenu/DropdownMenuItem.tsx +9 -3
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +1 -2
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +8 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +88 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +635 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +553 -0
- package/src/DropdownMenu/index.ts +16 -0
- package/src/DropdownMenu/menuItemHover.ts +39 -0
- package/src/DropdownMenu/menuItemRoles.ts +9 -0
- package/src/DropdownMenu/renderDropdownItems.tsx +29 -15
- package/src/Field/Field.test.tsx +57 -12
- package/src/Field/Field.tsx +20 -14
- package/src/Field/FieldLabel.tsx +9 -1
- package/src/Field/inputStyles.stylex.ts +2 -0
- package/src/FieldStatus/FieldStatus.doc.mjs +17 -5
- package/src/FieldStatus/FieldStatus.test.tsx +150 -40
- package/src/FieldStatus/FieldStatus.tsx +69 -5
- package/src/FileInput/FileInput.doc.mjs +23 -2
- package/src/FileInput/FileInput.test.tsx +135 -12
- package/src/FileInput/FileInput.tsx +65 -51
- 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 +39 -5
- package/src/Icon/Icon.doc.mjs +16 -2
- package/src/Icon/Icon.test.tsx +89 -0
- package/src/Icon/Icon.tsx +58 -5
- package/src/IconButton/IconButton.doc.mjs +8 -0
- package/src/IconButton/IconButton.test.tsx +15 -18
- package/src/Item/Item.test.tsx +40 -18
- package/src/Item/Item.tsx +38 -2
- package/src/Layer/useLayer.tsx +8 -0
- package/src/Lightbox/Lightbox.tsx +15 -7
- package/src/List/List.test.tsx +9 -8
- package/src/Markdown/Markdown.test.tsx +21 -0
- package/src/Markdown/Markdown.tsx +4 -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 +24 -2
- package/src/MultiSelector/MultiSelector.test.tsx +498 -3
- package/src/MultiSelector/MultiSelector.tsx +149 -65
- package/src/MultiSelector/hooks.ts +17 -0
- package/src/NavMenu/NavHeadingMenuItem.tsx +1 -1
- package/src/NumberInput/NumberInput.doc.mjs +21 -0
- package/src/NumberInput/NumberInput.test.tsx +82 -7
- package/src/NumberInput/NumberInput.tsx +36 -28
- package/src/Outline/Outline.tsx +0 -1
- 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/Pagination/Pagination.tsx +11 -3
- package/src/Popover/Popover.tsx +7 -4
- package/src/Popover/usePopover.tsx +9 -13
- package/src/PowerSearch/PowerSearch.doc.mjs +29 -0
- package/src/PowerSearch/PowerSearch.test.tsx +43 -0
- package/src/PowerSearch/PowerSearch.tsx +10 -1
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +67 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +1 -1
- package/src/PowerSearch/usePowerSearchSource.ts +1 -2
- package/src/RadioList/RadioList.doc.mjs +6 -0
- package/src/RadioList/RadioList.tsx +2 -2
- package/src/RadioList/RadioListItem.tsx +4 -4
- package/src/SegmentedControl/SegmentedControlItem.tsx +2 -0
- package/src/SelectableCard/SelectableCard.doc.mjs +2 -0
- package/src/SelectableCard/SelectableCard.test.tsx +46 -4
- package/src/SelectableCard/SelectableCard.tsx +29 -16
- package/src/Selector/Selector.doc.mjs +15 -0
- package/src/Selector/Selector.test.tsx +417 -0
- package/src/Selector/Selector.tsx +86 -21
- package/src/Selector/hooks.ts +17 -0
- package/src/SideNav/SideNav.test.tsx +119 -3
- package/src/SideNav/SideNav.tsx +1 -8
- package/src/SideNav/SideNavCollapseButton.tsx +15 -8
- package/src/SideNav/SideNavHeading.tsx +24 -8
- package/src/SideNav/SideNavItem.tsx +10 -4
- package/src/Slider/Slider.doc.mjs +6 -0
- package/src/Slider/Slider.test.tsx +314 -13
- package/src/Slider/Slider.tsx +117 -28
- package/src/Switch/Switch.doc.mjs +142 -42
- package/src/Switch/Switch.test.tsx +54 -1
- package/src/Switch/Switch.tsx +90 -33
- package/src/TabList/Tab.tsx +2 -2
- package/src/TabList/TabMenu.tsx +2 -2
- package/src/Table/BaseTable.tsx +37 -7
- package/src/Table/Table.doc.mjs +11 -0
- package/src/Table/Table.test.tsx +85 -0
- package/src/Table/TableCell.tsx +3 -3
- package/src/Table/TableHeaderCell.tsx +3 -3
- package/src/Table/index.ts +5 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +15 -8
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +24 -17
- 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 +77 -3
- package/src/Table/plugins/selection/useTableSelection.tsx +22 -1
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +1 -1
- package/src/Table/plugins/tree/useTableTreeData.test.tsx +135 -3
- package/src/Table/plugins/tree/useTableTreeData.tsx +139 -8
- package/src/Table/plugins/tree/useTableTreeState.test.tsx +104 -0
- package/src/Table/plugins/tree/useTableTreeState.tsx +46 -2
- package/src/Table/types.ts +33 -0
- package/src/Table/useBaseTablePlugins.ts +10 -6
- package/src/Table/useTableRowStatus.doc.mjs +30 -0
- package/src/Table/useTableSelection.doc.mjs +65 -14
- package/src/Table/useTableTreeData.doc.mjs +29 -0
- package/src/Table/useTableTreeState.doc.mjs +2 -2
- package/src/TextArea/TextArea.doc.mjs +21 -0
- package/src/TextArea/TextArea.test.tsx +32 -1
- package/src/TextArea/TextArea.tsx +27 -26
- package/src/TextInput/TextInput.doc.mjs +21 -0
- package/src/TextInput/TextInput.test.tsx +150 -0
- package/src/TextInput/TextInput.tsx +28 -25
- package/src/Thumbnail/Thumbnail.doc.mjs +19 -10
- package/src/Thumbnail/Thumbnail.test.tsx +98 -7
- package/src/Thumbnail/Thumbnail.tsx +142 -42
- package/src/Thumbnail/thumbnail.markers.stylex.ts +12 -0
- package/src/TimeInput/TimeInput.doc.mjs +21 -0
- package/src/TimeInput/TimeInput.test.tsx +99 -1
- package/src/TimeInput/TimeInput.tsx +43 -31
- package/src/Timestamp/Timestamp.doc.mjs +4 -4
- package/src/Timestamp/Timestamp.test.tsx +32 -0
- package/src/Timestamp/Timestamp.tsx +28 -8
- package/src/Toast/useToast.tsx +7 -8
- package/src/ToggleButton/ToggleButtonGroup.tsx +1 -1
- package/src/Token/Token.test.tsx +21 -15
- package/src/Token/Token.tsx +31 -14
- package/src/Token/index.ts +1 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +38 -2
- package/src/Tokenizer/Tokenizer.test.tsx +206 -2
- package/src/Tokenizer/Tokenizer.tsx +30 -6
- package/src/Tooltip/Tooltip.test.tsx +46 -0
- package/src/Tooltip/useTooltip.tsx +20 -0
- package/src/TopNav/TopNav.test.tsx +125 -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/TopNavMegaMenuFeaturedCard.doc.mjs +3 -3
- package/src/TopNav/TopNavMegaMenuFeaturedCard.tsx +19 -2
- package/src/TopNav/TopNavMenu.test.tsx +118 -4
- package/src/TopNav/TopNavMenu.tsx +83 -5
- package/src/TreeList/TreeList.doc.mjs +28 -0
- package/src/TreeList/TreeList.test.tsx +272 -0
- package/src/TreeList/TreeList.tsx +23 -2
- package/src/TreeList/TreeListBranches.tsx +24 -8
- package/src/TreeList/TreeListItem.tsx +84 -22
- package/src/TreeList/TreeListTypes.ts +27 -1
- package/src/TreeList/index.ts +2 -2
- package/src/Typeahead/BaseTypeahead.tsx +30 -15
- package/src/Typeahead/Typeahead.doc.mjs +13 -0
- package/src/Typeahead/Typeahead.test.tsx +50 -0
- package/src/Typeahead/Typeahead.tsx +11 -1
- package/src/Typeahead/TypeaheadItem.tsx +2 -1
- package/src/__tests__/inputWidthContract.test.tsx +62 -0
- package/src/authoring/doc.ts +1 -3
- package/src/doc-mjs.d.ts +19 -0
- package/src/docs-types.ts +5 -0
- package/src/hooks/computeOverflow.test.ts +422 -0
- package/src/hooks/computeOverflow.ts +290 -0
- package/src/hooks/index.ts +8 -0
- package/src/hooks/isRtlElement.ts +27 -0
- package/src/hooks/useDevWarning.test.tsx +45 -0
- package/src/hooks/useDevWarning.ts +54 -0
- package/src/hooks/useGridFocus.doc.mjs +3 -3
- package/src/hooks/useGridFocus.test.tsx +41 -0
- package/src/hooks/useGridFocus.ts +21 -10
- package/src/hooks/useInputStatusIcon.test.tsx +162 -0
- package/src/hooks/useInputStatusIcon.tsx +224 -0
- package/src/hooks/useListFocus.doc.mjs +25 -3
- package/src/hooks/useListFocus.test.tsx +153 -1
- package/src/hooks/useListFocus.ts +102 -9
- package/src/hooks/useOverflow.test.ts +96 -4
- package/src/hooks/useOverflow.ts +74 -33
- package/src/i18n/InternationalizationContext.ts +4 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +99 -2
- package/src/i18n/InternationalizationProvider.tsx +12 -2
- package/src/i18n/__tests__/getLocaleDirection.test.ts +40 -0
- package/src/i18n/__tests__/useDirection.test.tsx +66 -0
- package/src/i18n/getLocaleDirection.ts +29 -0
- package/src/i18n/index.ts +6 -0
- package/src/i18n/resolve.ts +9 -21
- package/src/i18n/useDirection.ts +29 -0
- package/src/reset.css +0 -26
- package/src/reset.test.ts +60 -0
- package/src/theme/Theme.tsx +11 -14
- package/src/theme/derivedVarRegistry.test.ts +1 -0
- package/src/theme/derivedVarRegistry.ts +6 -0
- package/src/theme/generateThemeRules.test.ts +107 -0
- package/src/theme/generateThemeRules.ts +56 -0
- package/src/theme/hct.ts +1 -1
- package/src/theme/syntax/defineSyntaxTheme.ts +5 -6
- package/src/utils/devWarning.test.ts +56 -0
- package/src/utils/devWarning.ts +102 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/plainDate.test.ts +46 -6
- package/src/utils/plainDate.ts +69 -3
- package/src/utils/rtlStyles.ts +27 -0
- package/src/utils/types.ts +14 -0
|
@@ -9,14 +9,17 @@
|
|
|
9
9
|
* @position Horizontal scroll container with fade-edge overflow indication,
|
|
10
10
|
* optional prev/next buttons on the top layer, scroll-snap, a 1px
|
|
11
11
|
* visual bleed allowance for child selection indicators, and Shift + wheel
|
|
12
|
-
* mapping so mouse users can scroll horizontally.
|
|
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".
|
|
13
16
|
*
|
|
14
17
|
* SYNC: When modified, update:
|
|
15
18
|
* - /packages/core/src/Carousel/index.ts (exports)
|
|
16
19
|
* - /apps/storybook/stories/Carousel.stories.tsx
|
|
17
20
|
* - /packages/cli/templates/blocks/components/Carousel/ (showcase blocks)
|
|
18
21
|
*/
|
|
19
|
-
import { useRef, useCallback, useEffect, Children } from 'react';
|
|
22
|
+
import { useRef, useCallback, useEffect, Children, isValidElement } from 'react';
|
|
20
23
|
import * as stylex from '@stylexjs/stylex';
|
|
21
24
|
import "../theme/tokens.stylex.js";
|
|
22
25
|
import { spacingVars, colorVars, shadowVars, radiusVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
@@ -24,7 +27,8 @@ import { Button } from "../Button/index.js";
|
|
|
24
27
|
import { Icon } from "../Icon/index.js";
|
|
25
28
|
import { useLayer } from "../Layer/index.js";
|
|
26
29
|
import { useScrollOverflow } from "../hooks/useScrollOverflow.js";
|
|
27
|
-
import {
|
|
30
|
+
import { isRtlElement } from "../hooks/isRtlElement.js";
|
|
31
|
+
import { mergeProps, mergeRefs, rtlStyles } from "../utils/index.js";
|
|
28
32
|
import { themeProps } from "../utils/themeProps.js";
|
|
29
33
|
import { useTranslator } from "../i18n/index.js";
|
|
30
34
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -220,6 +224,11 @@ export function Carousel({
|
|
|
220
224
|
overflowStart,
|
|
221
225
|
overflowEnd
|
|
222
226
|
} = useScrollOverflow();
|
|
227
|
+
|
|
228
|
+
// Children.toArray drops null/undefined/boolean children and assigns
|
|
229
|
+
// stable keys, so slide numbering ("Slide N of M") matches what actually
|
|
230
|
+
// renders even when some children are conditionally omitted.
|
|
231
|
+
const slides = Children.toArray(children);
|
|
223
232
|
const layer = useLayer({
|
|
224
233
|
mode: 'context',
|
|
225
234
|
lightDismiss: false
|
|
@@ -276,7 +285,10 @@ export function Carousel({
|
|
|
276
285
|
// for users who opted out of motion.
|
|
277
286
|
const prefersReducedMotion = typeof window !== 'undefined' && typeof window.matchMedia === 'function' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
278
287
|
el.scrollBy({
|
|
279
|
-
|
|
288
|
+
// `direction` is the logical intent (-1 = toward content start, +1 =
|
|
289
|
+
// toward content end). Under RTL the scroll axis is inverted (start is
|
|
290
|
+
// scrollLeft 0, the end is negative), so flip the physical delta sign.
|
|
291
|
+
left: (isRtlElement(el) ? -1 : 1) * direction * Math.max(amount, itemWidth),
|
|
280
292
|
behavior: prefersReducedMotion ? 'auto' : 'smooth'
|
|
281
293
|
});
|
|
282
294
|
}, []);
|
|
@@ -302,26 +314,41 @@ export function Carousel({
|
|
|
302
314
|
tabIndex: 0,
|
|
303
315
|
onWheel: handleWheel,
|
|
304
316
|
...stylex.props(styles.scroller, gapStyles[gap], padding != null && paddingStyles[padding], hasSnap && styles.snap, fadeStyle),
|
|
305
|
-
children:
|
|
317
|
+
children: slides.map((child, index) =>
|
|
318
|
+
/*#__PURE__*/
|
|
319
|
+
// APG carousel pattern: each slide container is a group with
|
|
320
|
+
// aria-roledescription="slide" and an "N of M" accessible name so
|
|
321
|
+
// ATs announce slide boundaries and position instead of anonymous
|
|
322
|
+
// generics.
|
|
323
|
+
_jsx("div", {
|
|
324
|
+
role: "group",
|
|
325
|
+
"aria-roledescription": "slide",
|
|
326
|
+
"aria-label": t('@astryx.carousel.slideLabel', {
|
|
327
|
+
current: index + 1,
|
|
328
|
+
total: slides.length
|
|
329
|
+
}),
|
|
306
330
|
...{
|
|
307
331
|
className: "x1bhewko x78zum5 x2lah0s"
|
|
308
332
|
},
|
|
309
333
|
children: child
|
|
310
|
-
}))
|
|
334
|
+
}, /*#__PURE__*/isValidElement(child) ? child.key : index))
|
|
311
335
|
}), hasButtons && layer.render(/*#__PURE__*/_jsxs(_Fragment, {
|
|
312
336
|
children: [/*#__PURE__*/_jsx("div", {
|
|
313
337
|
...{
|
|
314
338
|
0: {
|
|
315
|
-
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x67bb7w x1hc1fzr x19991ni xuedmi6 xlr8y92 xuuh30"
|
|
339
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x67bb7w x1hc1fzr x19991ni xuedmi6 xlr8y92 xuuh30 x1nyx83j"
|
|
316
340
|
},
|
|
317
341
|
1: {
|
|
318
|
-
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x19991ni xuedmi6 xlr8y92 xuuh30 xg01cxk x47corl"
|
|
342
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x19991ni xuedmi6 xlr8y92 xuuh30 x1nyx83j xg01cxk x47corl"
|
|
319
343
|
}
|
|
320
344
|
}[!!!overflowStart << 0],
|
|
321
345
|
children: /*#__PURE__*/_jsx(Button, {
|
|
322
|
-
icon: /*#__PURE__*/_jsx(
|
|
323
|
-
|
|
324
|
-
|
|
346
|
+
icon: /*#__PURE__*/_jsx("span", {
|
|
347
|
+
...stylex.props(rtlStyles.mirror),
|
|
348
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
349
|
+
icon: "chevronLeft",
|
|
350
|
+
size: "xsm"
|
|
351
|
+
})
|
|
325
352
|
}),
|
|
326
353
|
label: t('@astryx.carousel.scrollLeft'),
|
|
327
354
|
variant: "ghost",
|
|
@@ -339,16 +366,19 @@ export function Carousel({
|
|
|
339
366
|
}), /*#__PURE__*/_jsx("div", {
|
|
340
367
|
...{
|
|
341
368
|
0: {
|
|
342
|
-
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x67bb7w x1hc1fzr x19991ni xuedmi6 xlr8y92 xitnhlw"
|
|
369
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x67bb7w x1hc1fzr x19991ni xuedmi6 xlr8y92 xitnhlw x36dvrd"
|
|
343
370
|
},
|
|
344
371
|
1: {
|
|
345
|
-
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x19991ni xuedmi6 xlr8y92 xitnhlw xg01cxk x47corl"
|
|
372
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1prclbq xjspbzw x14hfi27 x19991ni xuedmi6 xlr8y92 xitnhlw x36dvrd xg01cxk x47corl"
|
|
346
373
|
}
|
|
347
374
|
}[!!!overflowEnd << 0],
|
|
348
375
|
children: /*#__PURE__*/_jsx(Button, {
|
|
349
|
-
icon: /*#__PURE__*/_jsx(
|
|
350
|
-
|
|
351
|
-
|
|
376
|
+
icon: /*#__PURE__*/_jsx("span", {
|
|
377
|
+
...stylex.props(rtlStyles.mirror),
|
|
378
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
379
|
+
icon: "chevronRight",
|
|
380
|
+
size: "xsm"
|
|
381
|
+
})
|
|
352
382
|
}),
|
|
353
383
|
label: t('@astryx.carousel.scrollRight'),
|
|
354
384
|
variant: "ghost",
|
|
@@ -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;AA0B5C,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,qBAiLpD;yBAjLe,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,
|
|
@@ -127,6 +152,11 @@ export function ChatComposer(props) {
|
|
|
127
152
|
}, [currentValue, isDisabled, onSubmit, updateValue]);
|
|
128
153
|
const canSend = currentValue.trim().length > 0 && !isDisabled;
|
|
129
154
|
const bodyRef = useRef(null);
|
|
155
|
+
|
|
156
|
+
// Input slot registers its focus (and future) control here so the shell can
|
|
157
|
+
// drive it without knowing its DOM shape. Stable ref — safe in the memoized
|
|
158
|
+
// context value.
|
|
159
|
+
const inputControlRef = useRef(null);
|
|
130
160
|
const handleBodyClick = useCallback(e => {
|
|
131
161
|
// Focus the input when clicking empty space in the body.
|
|
132
162
|
// Skip if the click target is a button, link, or interactive element.
|
|
@@ -134,6 +164,14 @@ export function ChatComposer(props) {
|
|
|
134
164
|
if (target.closest('button, a, [role="button"], [contenteditable="true"], [data-astryx-token]')) {
|
|
135
165
|
return;
|
|
136
166
|
}
|
|
167
|
+
// Prefer the input's registered control (works for any input shape,
|
|
168
|
+
// including editors whose focusable node isn't a bare
|
|
169
|
+
// contenteditable/textarea). Fall back to a DOM query so uninstrumented
|
|
170
|
+
// custom inputs still get click-to-focus.
|
|
171
|
+
if (inputControlRef.current) {
|
|
172
|
+
inputControlRef.current.focus();
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
137
175
|
const editable = bodyRef.current?.querySelector('[contenteditable="true"], textarea');
|
|
138
176
|
editable?.focus();
|
|
139
177
|
}, []);
|
|
@@ -179,7 +217,8 @@ export function ChatComposer(props) {
|
|
|
179
217
|
isDisabled,
|
|
180
218
|
isStopShown,
|
|
181
219
|
canSend,
|
|
182
|
-
onStop
|
|
220
|
+
onStop,
|
|
221
|
+
inputControlRef
|
|
183
222
|
}), [currentValue, updateValue, handleSubmit, placeholder, isDisabled, isStopShown, canSend, onStop]);
|
|
184
223
|
return /*#__PURE__*/_jsx(ChatComposerContext, {
|
|
185
224
|
value: composerContext,
|
|
@@ -199,7 +238,7 @@ export function ChatComposer(props) {
|
|
|
199
238
|
children: [statusPosition === 'top' && statusEl, drawer, /*#__PURE__*/_jsxs("div", {
|
|
200
239
|
ref: bodyRef,
|
|
201
240
|
onClick: handleBodyClick,
|
|
202
|
-
...stylex.props(styles.body, density === 'compact' && styles.compact, xstyle),
|
|
241
|
+
...stylex.props(styles.body, elevationStyles[elevation], density === 'compact' && styles.compact, xstyle),
|
|
203
242
|
children: [(headerActions || headerContext) && /*#__PURE__*/_jsxs("div", {
|
|
204
243
|
...{
|
|
205
244
|
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 {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposerInput.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposerInput.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"ChatComposerInput.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposerInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAML,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,cAAc,EAAE,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAarE,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAQ,KAAK,UAAU,EAAC,MAAM,UAAU,CAAC;AAShD,mEAAmE;AACnE,MAAM,WAAW,uBAAuB;IACtC,iEAAiE;IACjE,WAAW,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,MAAM,GAAG,SAAS,CAAC;IAC9D,6EAA6E;IAC7E,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,uDAAuD;IACvD,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,sBAAsB;IACtB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,MAAM,CAAC;CACxB;AAED,wFAAwF;AACxF,MAAM,MAAM,sBAAsB,GAAG;IACnC,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC,CAAC;AAE/D,mFAAmF;AACnF,MAAM,MAAM,uBAAuB,GAAG;IACpC,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,MAAM,EAAE,MAAM,SAAS,CAAC;CACzB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAC3B,sBAAsB,GAAG,uBAAuB,CAAC;AAEnD,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG;IAChC,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,EAAE,YAAY,CAAC;IAC3B,kDAAkD;IAClD,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,SAAS,CAAC;IACjD;;;OAGG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,MAAM,GAAG,iBAAiB,CAAC;IAC/D;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,iBAAiB,GAAG,IAAI,CAAC;IAC1D,8DAA8D;IAC9D,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,GAAG,SAAS,GAAG,UAAU,CACpC;IACC,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,sDAAsD;IACtD,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IAC/C,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACjC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0IAA0I;IAC1I,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,EACrC,IAAI,EAAE,MAAM,KACT,OAAO,GAAG,IAAI,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,yBAAyB,GAAG,KAAK,CAAC;IACjD,8BAA8B;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAClC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;CAC5D;AA0FD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAyb9D;yBAzbe,iBAAiB;;;AAicjC,wBAAgB,wBAAwB,CAAC,EAAC,KAAK,EAAC,EAAE;IAAC,KAAK,EAAE,iBAAiB,CAAA;CAAC,+BAc3E;yBAde,wBAAwB"}
|
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
*
|
|
12
12
|
* ContentEditable-based rich input for the chat composer.
|
|
13
13
|
* Supports trigger menus (@ mentions, / commands) via SearchSource,
|
|
14
|
-
* inline token rendering, serialization, Enter
|
|
15
|
-
*
|
|
14
|
+
* inline token rendering, serialization, Enter-to-submit with
|
|
15
|
+
* IME-composition guarding and an onKeyDown seam for platform-specific
|
|
16
|
+
* key handling, message history, paste/drop file handling, and
|
|
17
|
+
* mobile-safe touch typography.
|
|
16
18
|
*
|
|
17
19
|
*
|
|
18
20
|
* SYNC: When modified, update:
|
|
@@ -133,6 +135,7 @@ export function ChatComposerInput(props) {
|
|
|
133
135
|
pasteAsToken: pasteAsTokenProp,
|
|
134
136
|
onFiles,
|
|
135
137
|
onSubmit = composerCtx?.onSubmit,
|
|
138
|
+
onKeyDown: onKeyDownProp,
|
|
136
139
|
xstyle,
|
|
137
140
|
className,
|
|
138
141
|
style,
|
|
@@ -188,6 +191,22 @@ export function ChatComposerInput(props) {
|
|
|
188
191
|
};
|
|
189
192
|
selfRef.current = handle;
|
|
190
193
|
useImperativeHandle(handleRef, () => handle);
|
|
194
|
+
|
|
195
|
+
// Register a focus control with the composer shell so body-click-to-focus
|
|
196
|
+
// works without the shell sniffing the input's DOM shape. Cleared on
|
|
197
|
+
// unmount so the shell falls back cleanly if the input goes away.
|
|
198
|
+
const inputControlRef = composerCtx?.inputControlRef;
|
|
199
|
+
useEffect(() => {
|
|
200
|
+
if (!inputControlRef) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
inputControlRef.current = {
|
|
204
|
+
focus: () => editableRef.current?.focus()
|
|
205
|
+
};
|
|
206
|
+
return () => {
|
|
207
|
+
inputControlRef.current = null;
|
|
208
|
+
};
|
|
209
|
+
}, [inputControlRef]);
|
|
191
210
|
useEffect(() => {
|
|
192
211
|
if (controlledValue === undefined || !editableRef.current) {
|
|
193
212
|
return;
|
|
@@ -289,6 +308,13 @@ export function ChatComposerInput(props) {
|
|
|
289
308
|
return;
|
|
290
309
|
}
|
|
291
310
|
|
|
311
|
+
// Consumer passthrough — runs before built-in Enter/history handling.
|
|
312
|
+
// A consumer can preventDefault() to fully own the keystroke.
|
|
313
|
+
onKeyDownProp?.(e);
|
|
314
|
+
if (e.defaultPrevented) {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
|
|
292
318
|
// Handle Backspace near tokens — prevent browser from creating
|
|
293
319
|
// stray <br> elements or moving the cursor unexpectedly.
|
|
294
320
|
if (e.key === 'Backspace') {
|
|
@@ -322,6 +348,12 @@ export function ChatComposerInput(props) {
|
|
|
322
348
|
}
|
|
323
349
|
}
|
|
324
350
|
if (e.key === 'Enter' && !e.shiftKey) {
|
|
351
|
+
// Never submit mid-composition — an IME uses Enter to commit a
|
|
352
|
+
// candidate (e.g. Japanese/Chinese/Korean input), and browsers may
|
|
353
|
+
// also surface the legacy keyCode 229 for composing keystrokes.
|
|
354
|
+
if (e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229) {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
325
357
|
e.preventDefault();
|
|
326
358
|
if (!editableRef.current) {
|
|
327
359
|
return;
|
|
@@ -379,7 +411,7 @@ export function ChatComposerInput(props) {
|
|
|
379
411
|
e.preventDefault();
|
|
380
412
|
}
|
|
381
413
|
}
|
|
382
|
-
}, [hasHistory, onSubmit, onChange, emitChange, triggerMenu]);
|
|
414
|
+
}, [hasHistory, onSubmit, onChange, emitChange, triggerMenu, onKeyDownProp]);
|
|
383
415
|
const handlePaste = useCallback(e => {
|
|
384
416
|
const editable = editableRef.current;
|
|
385
417
|
if (!editable) {
|
|
@@ -426,7 +458,7 @@ export function ChatComposerInput(props) {
|
|
|
426
458
|
...rest,
|
|
427
459
|
children: [isEmpty && /*#__PURE__*/_jsx("div", {
|
|
428
460
|
...{
|
|
429
|
-
className: "x10l6tqk x13vifvy
|
|
461
|
+
className: "x10l6tqk x13vifvy x1o0tod xtijo5x x47corl xv1l7n4 xjm74w1 x6pjikd x19v9tvf x9ynric x87ps6o x9epnlk"
|
|
430
462
|
},
|
|
431
463
|
"aria-hidden": "true",
|
|
432
464
|
children: placeholder
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file ChatContext.tsx
|
|
3
|
+
* @input Uses React createContext
|
|
4
|
+
* @output Exports Chat message/list/composer/layout contexts. The composer
|
|
5
|
+
* context (value + input-control registration) is public composition API,
|
|
6
|
+
* re-exported from Chat/index.ts for custom inputs.
|
|
7
|
+
* @position Shared contexts; consumed by ChatMessage, ChatComposer,
|
|
8
|
+
* ChatComposerInput, ChatSendButton, and custom inputs.
|
|
9
|
+
*/
|
|
10
|
+
import { type RefObject } from 'react';
|
|
1
11
|
export type ChatMessageSender = 'user' | 'assistant' | 'system';
|
|
2
12
|
export type ChatDensity = 'compact' | 'balanced' | 'spacious';
|
|
3
13
|
export interface ChatMessageContextValue {
|
|
@@ -11,6 +21,20 @@ export interface ChatListContextValue {
|
|
|
11
21
|
}
|
|
12
22
|
export declare const ChatListContext: import("react").Context<ChatListContextValue | null>;
|
|
13
23
|
export declare function useChatListContext(): ChatListContextValue | null;
|
|
24
|
+
/**
|
|
25
|
+
* Imperative surface the composer shell can invoke on its input slot.
|
|
26
|
+
*
|
|
27
|
+
* The input is one slot inside the composer body — it does not span the whole
|
|
28
|
+
* body — so shell-level interactions like "click empty space to focus the
|
|
29
|
+
* input" must flow shell → input. A custom input registers this control (via
|
|
30
|
+
* `ChatComposerContextValue.inputControlRef`) so the shell can drive it
|
|
31
|
+
* without knowing its DOM shape. Optional methods can be added over time;
|
|
32
|
+
* inputs implement only what they support.
|
|
33
|
+
*/
|
|
34
|
+
export interface ChatComposerInputControl {
|
|
35
|
+
/** Move keyboard focus into the input. */
|
|
36
|
+
focus: () => void;
|
|
37
|
+
}
|
|
14
38
|
export interface ChatComposerContextValue {
|
|
15
39
|
value: string;
|
|
16
40
|
onChange: (value: string) => void;
|
|
@@ -20,6 +44,15 @@ export interface ChatComposerContextValue {
|
|
|
20
44
|
isStopShown: boolean;
|
|
21
45
|
canSend: boolean;
|
|
22
46
|
onStop?: () => void;
|
|
47
|
+
/**
|
|
48
|
+
* Mutable handle the input slot populates with its {@link
|
|
49
|
+
* ChatComposerInputControl}. The shell reads `.current` to drive the input
|
|
50
|
+
* (e.g. focus on body click). A custom input assigns
|
|
51
|
+
* `inputControlRef.current = { focus }` on mount and clears it on unmount.
|
|
52
|
+
* When unset, the shell falls back to focusing a `contenteditable`/`textarea`
|
|
53
|
+
* it finds in the body.
|
|
54
|
+
*/
|
|
55
|
+
inputControlRef?: RefObject<ChatComposerInputControl | null>;
|
|
23
56
|
}
|
|
24
57
|
export declare const ChatComposerContext: import("react").Context<ChatComposerContextValue | null>;
|
|
25
58
|
export declare function useChatComposerContext(): ChatComposerContextValue | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContext.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatContext.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatContext.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAAqB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAChE,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9D,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,yDAE9B,CAAC;AAGF,wBAAgB,qBAAqB,IAAI,uBAAuB,GAAG,IAAI,CAEtE;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,sDAAmD,CAAC;AAGhF,wBAAgB,kBAAkB,IAAI,oBAAoB,GAAG,IAAI,CAEhE;AAMD;;;;;;;;;GASG;AACH,MAAM,WAAW,wBAAwB;IACvC,0CAA0C;IAC1C,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;CAC9D;AAED,eAAO,MAAM,mBAAmB,0DACsB,CAAC;AAGvD,wBAAgB,sBAAsB,IAAI,wBAAwB,GAAG,IAAI,CAExE;AAMD,MAAM,WAAW,sBAAsB;IACrC,2EAA2E;IAC3E,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACxD,+FAA+F;IAC/F,UAAU,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,iBAAiB,wDAE7B,CAAC;AAGF,wBAAgB,oBAAoB,IAAI,sBAAsB,GAAG,IAAI,CAEpE"}
|
package/dist/Chat/ChatContext.js
CHANGED
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file ChatContext.tsx
|
|
7
7
|
* @input Uses React createContext
|
|
8
|
-
* @output Exports
|
|
9
|
-
*
|
|
8
|
+
* @output Exports Chat message/list/composer/layout contexts. The composer
|
|
9
|
+
* context (value + input-control registration) is public composition API,
|
|
10
|
+
* re-exported from Chat/index.ts for custom inputs.
|
|
11
|
+
* @position Shared contexts; consumed by ChatMessage, ChatComposer,
|
|
12
|
+
* ChatComposerInput, ChatSendButton, and custom inputs.
|
|
10
13
|
*/
|
|
11
14
|
import { createContext, use } from 'react';
|
|
12
15
|
export const ChatMessageContext = /*#__PURE__*/createContext(null);
|
|
@@ -24,6 +27,17 @@ export function useChatListContext() {
|
|
|
24
27
|
// Composer context — shared state between ChatComposer and ChatComposerInput
|
|
25
28
|
// =============================================================================
|
|
26
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Imperative surface the composer shell can invoke on its input slot.
|
|
32
|
+
*
|
|
33
|
+
* The input is one slot inside the composer body — it does not span the whole
|
|
34
|
+
* body — so shell-level interactions like "click empty space to focus the
|
|
35
|
+
* input" must flow shell → input. A custom input registers this control (via
|
|
36
|
+
* `ChatComposerContextValue.inputControlRef`) so the shell can drive it
|
|
37
|
+
* without knowing its DOM shape. Optional methods can be added over time;
|
|
38
|
+
* inputs implement only what they support.
|
|
39
|
+
*/
|
|
40
|
+
|
|
27
41
|
export const ChatComposerContext = /*#__PURE__*/createContext(null);
|
|
28
42
|
ChatComposerContext.displayName = 'ChatComposerContext';
|
|
29
43
|
export function useChatComposerContext() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDictationButton.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatDictationButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,wBAAwB,CAAC;AAMvE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatDictationButton.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatDictationButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,wBAAwB,CAAC;AAMvE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAO5C,MAAM,WAAW,wBAAyB,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC1E,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC,sEAAsE;IACtE,SAAS,EAAE,0BAA0B,CAAC;IACtC,iCAAiC;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,6EAA6E;IAC7E,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiDD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,SAAS,EACT,IAAW,EACX,uBAA8B,EAC9B,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,wBAAwB,4BAoE1B;yBA9Ee,mBAAmB"}
|
|
@@ -24,6 +24,7 @@ import { colorVars, radiusVars } from "../theme/tokens.stylex.js";
|
|
|
24
24
|
import { Button } from "../Button/index.js";
|
|
25
25
|
import { Icon } from "../Icon/index.js";
|
|
26
26
|
import { mergeProps } from "../utils/index.js";
|
|
27
|
+
import { useTranslator } from "../i18n/index.js";
|
|
27
28
|
|
|
28
29
|
// =============================================================================
|
|
29
30
|
// Types
|
|
@@ -86,6 +87,7 @@ export function ChatDictationButton({
|
|
|
86
87
|
style,
|
|
87
88
|
...rest
|
|
88
89
|
}) {
|
|
90
|
+
const t = useTranslator();
|
|
89
91
|
if (isHiddenWhenUnsupported && !dictation.isSupported) {
|
|
90
92
|
return null;
|
|
91
93
|
}
|
|
@@ -94,7 +96,7 @@ export function ChatDictationButton({
|
|
|
94
96
|
bands,
|
|
95
97
|
volume: rawVolume
|
|
96
98
|
} = dictation;
|
|
97
|
-
const accessibleLabel = label ?? (isListening ? '
|
|
99
|
+
const accessibleLabel = label ?? (isListening ? t('@astryx.chatDictationButton.stopDictation') : t('@astryx.chatDictationButton.startDictation'));
|
|
98
100
|
|
|
99
101
|
// Boost each band for visibility — quiet speech (0-10%) maps to full visual range
|
|
100
102
|
const boostedBands = bands.map(b => Math.min(Math.pow(b / 0.2, 0.5), 1));
|
|
@@ -126,7 +128,7 @@ export function ChatDictationButton({
|
|
|
126
128
|
const scale = BAR_MIN_SCALE + level * (1 - BAR_MIN_SCALE);
|
|
127
129
|
return /*#__PURE__*/_jsx("span", {
|
|
128
130
|
...mergeProps({
|
|
129
|
-
className: "xjspbzw x1g0ag68 x18dpk69 x11bq7d0 x9lcvmn"
|
|
131
|
+
className: "xjspbzw x1g0ag68 x18dpk69 x11bq7d0 x12w9bfk x9lcvmn"
|
|
130
132
|
}, {
|
|
131
133
|
style: {
|
|
132
134
|
width: barWidth,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatLayout.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatLayout.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAkB,MAAM,OAAO,CAAC;AAGtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAa5C,KAAK,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEnD,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAEhC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAEhD;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA8JD,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,QAAQ,EACR,OAAoB,EACpB,UAAU,EACV,YAAY,EACZ,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,GAAG,IAAI,EACR,EAAE,eAAe,+
|
|
1
|
+
{"version":3,"file":"ChatLayout.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatLayout.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAkB,MAAM,OAAO,CAAC;AAGtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAa5C,KAAK,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEnD,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAEhC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAEhD;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA8JD,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,QAAQ,EACR,OAAoB,EACpB,UAAU,EACV,YAAY,EACZ,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,GAAG,IAAI,EACR,EAAE,eAAe,+BA4GjB;yBAzHe,UAAU"}
|
package/dist/Chat/ChatLayout.js
CHANGED
|
@@ -69,8 +69,8 @@ const styles = {
|
|
|
69
69
|
blurLayer: {
|
|
70
70
|
kVAEAm: "x10l6tqk",
|
|
71
71
|
krVfgx: "x1ey2m1c",
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
kLqNvP: "x1o0tod",
|
|
73
|
+
kt4wiu: "xtijo5x",
|
|
74
74
|
kfzvcC: "x47corl",
|
|
75
75
|
k6WDB: "xvn2z4z",
|
|
76
76
|
keRtuK: "x67t5t6",
|
|
@@ -258,10 +258,10 @@ export function ChatLayout({
|
|
|
258
258
|
}), /*#__PURE__*/_jsxs("div", {
|
|
259
259
|
...{
|
|
260
260
|
0: {
|
|
261
|
-
className: "x1ey2m1c
|
|
261
|
+
className: "x1ey2m1c x1o0tod xtijo5x x1ja2u2z xc8icb0 x47corl xixxii4"
|
|
262
262
|
},
|
|
263
263
|
1: {
|
|
264
|
-
className: "x1ey2m1c
|
|
264
|
+
className: "x1ey2m1c x1o0tod xtijo5x x1ja2u2z xc8icb0 x47corl x7wzq59"
|
|
265
265
|
}
|
|
266
266
|
}[!!isSelfScrolling << 0],
|
|
267
267
|
children: [scrollButton === undefined ? defaultScrollButton : scrollButton, /*#__PURE__*/_jsx("div", {
|