@astryxdesign/core 0.7.17-canary.gffd1c8e → 0.7.17
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 +334 -0
- package/README.md +26 -9
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +6 -8
- package/dist/AppShell/AppShell.d.ts +7 -3
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +74 -36
- package/dist/AppShell/unreadWidthPoint.d.ts +29 -0
- package/dist/AppShell/unreadWidthPoint.d.ts.map +1 -0
- package/dist/AppShell/unreadWidthPoint.js +134 -0
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +5 -1
- package/dist/Badge/Badge.d.ts.map +1 -1
- package/dist/Badge/Badge.js +2 -2
- package/dist/Banner/Banner.d.ts +6 -4
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +32 -29
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +3 -1
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +11 -7
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +57 -2
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts +5 -0
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +6 -14
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +12 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +4 -0
- package/dist/Calendar/Calendar.js +8 -2
- package/dist/Calendar/styles.d.ts +10 -6
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +7 -3
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +23 -4
- package/dist/Chat/ChatComposer.d.ts +1 -1
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +4 -4
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +8 -4
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +7 -0
- package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
- package/dist/Chat/ChatPastedTextToken.js +3 -9
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +3 -0
- package/dist/Chat/ChatSystemMessage.d.ts.map +1 -1
- package/dist/Chat/ChatSystemMessage.js +1 -0
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +8 -0
- package/dist/Chat/pastedTextLabel.d.ts +4 -0
- package/dist/Chat/pastedTextLabel.d.ts.map +1 -0
- package/dist/Chat/pastedTextLabel.js +21 -0
- package/dist/Chat/useChatPasteAsToken.d.ts.map +1 -1
- package/dist/Chat/useChatPasteAsToken.js +8 -8
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +3 -3
- package/dist/CheckboxInput/CheckboxInput.d.ts +2 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +69 -18
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +8 -1
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +17 -3
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +2 -0
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +1 -0
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +8 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +32 -5
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +1 -0
- package/dist/DateInput/PickerWheel.d.ts.map +1 -1
- package/dist/DateInput/PickerWheel.js +3 -2
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +2 -1
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +8 -8
- package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -1
- package/dist/DateInput/usePointerDragScroll.js +5 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +7 -0
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +2 -1
- package/dist/DateTimeInput/nativePickerSegmentStyles.d.ts +2 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +104 -18
- package/dist/Dialog/DialogContext.d.ts +5 -4
- package/dist/Dialog/DialogContext.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +38 -12
- package/dist/Drawer/DrawerHeader.d.ts.map +1 -1
- package/dist/Drawer/DrawerHeader.js +23 -8
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +23 -17
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +3 -3
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +3 -3
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +19 -2
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +6 -3
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +31 -7
- package/dist/DropdownMenu/menuRowCorners.stylex.d.ts +24 -0
- package/dist/DropdownMenu/menuRowCorners.stylex.d.ts.map +1 -0
- package/dist/DropdownMenu/menuRowCorners.stylex.js +29 -0
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +2 -2
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +2 -2
- package/dist/Field/inputDisabledFocus.d.ts +4 -0
- package/dist/Field/inputDisabledFocus.d.ts.map +1 -1
- package/dist/Field/inputDisabledFocus.js +5 -0
- package/dist/Field/inputStyles.stylex.d.ts +31 -4
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +30 -5
- package/dist/Grid/Grid.d.ts +2 -1
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +5 -2
- package/dist/Heading/Heading.d.ts +1 -1
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +15 -1
- package/dist/Icon/Icon.d.ts +1 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +32 -2
- package/dist/Indicator/CheckboxIndicator.d.ts.map +1 -1
- package/dist/Indicator/CheckboxIndicator.js +12 -6
- package/dist/Indicator/RadioIndicator.d.ts.map +1 -1
- package/dist/Indicator/RadioIndicator.js +18 -4
- package/dist/Indicator/indicatorRegistry.d.ts +3 -26
- package/dist/Indicator/indicatorRegistry.d.ts.map +1 -1
- package/dist/Indicator/indicatorRegistry.js +2 -11
- package/dist/Indicator/themeIndicators.d.ts +15 -0
- package/dist/Indicator/themeIndicators.d.ts.map +1 -0
- package/dist/Indicator/themeIndicators.js +21 -0
- package/dist/Indicator/types.d.ts +14 -0
- package/dist/Indicator/types.d.ts.map +1 -1
- package/dist/Indicator/useThemeIndicator.d.ts +3 -0
- package/dist/Indicator/useThemeIndicator.d.ts.map +1 -0
- package/dist/Indicator/useThemeIndicator.js +19 -0
- package/dist/Item/Item.d.ts +6 -2
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +30 -2
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +9 -2
- package/dist/Layer/layerExitCopy.d.ts.map +1 -1
- package/dist/Layer/layerExitCopy.js +1 -1
- package/dist/Layer/layerSlideRules.d.ts +23 -15
- package/dist/Layer/layerSlideRules.d.ts.map +1 -1
- package/dist/Layer/layerSlideRules.js +54 -54
- package/dist/Layer/useLayer.d.ts +41 -29
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +199 -126
- package/dist/Layer/useLayerKeyboardClearance.d.ts +5 -5
- package/dist/Layer/useLayerKeyboardClearance.d.ts.map +1 -1
- package/dist/Layer/useLayerKeyboardClearance.js +5 -5
- package/dist/Layout/LayoutContainerContext.d.ts +4 -0
- package/dist/Layout/LayoutContainerContext.d.ts.map +1 -0
- package/dist/Layout/LayoutContainerContext.js +20 -0
- package/dist/Layout/LayoutContainerScope.d.ts +15 -0
- package/dist/Layout/LayoutContainerScope.d.ts.map +1 -0
- package/dist/Layout/LayoutContainerScope.js +23 -0
- package/dist/Layout/LayoutContent.d.ts +2 -1
- package/dist/Layout/LayoutContent.d.ts.map +1 -1
- package/dist/Layout/LayoutContent.js +7 -2
- package/dist/Layout/LayoutFooter.d.ts.map +1 -1
- package/dist/Layout/LayoutFooter.js +5 -1
- package/dist/Layout/LayoutHeader.d.ts.map +1 -1
- package/dist/Layout/LayoutHeader.js +5 -1
- package/dist/Layout/containerCorners.stylex.d.ts +15 -7
- package/dist/Layout/containerCorners.stylex.d.ts.map +1 -1
- package/dist/Layout/containerCorners.stylex.js +16 -7
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +324 -6
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +1 -1
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +14 -6
- package/dist/List/ListContext.d.ts +38 -1
- package/dist/List/ListContext.d.ts.map +1 -1
- package/dist/List/ListContext.js +50 -2
- package/dist/List/ListItem.js +2 -2
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +85 -96
- package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts.map +1 -1
- package/dist/Markdown/plugins/HeadingLinksRenderer.js +12 -5
- package/dist/Markdown/plugins/protocol.js +3 -3
- package/dist/MetadataList/MetadataListItem.d.ts.map +1 -1
- package/dist/MetadataList/MetadataListItem.js +11 -3
- package/dist/MobileNav/MobileNav.d.ts +1 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +6 -3
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +33 -9
- package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.js +5 -2
- package/dist/NavMenu/NavHeadingMenuItem.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenuItem.js +1 -0
- package/dist/NavMenu/NavMenuContext.d.ts +7 -0
- package/dist/NavMenu/NavMenuContext.d.ts.map +1 -1
- package/dist/NavMenu/NavMenuContext.js +9 -0
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +8 -2
- package/dist/Outline/Outline.d.ts +7 -3
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +11 -3
- package/dist/Outline/useScrollSpy.d.ts +1 -1
- package/dist/Outline/useScrollSpy.d.ts.map +1 -1
- package/dist/Outline/useScrollSpy.js +6 -2
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +51 -25
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +33 -13
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +5 -1
- package/dist/Popover/popoverAnchor.d.ts +11 -0
- package/dist/Popover/popoverAnchor.d.ts.map +1 -0
- package/dist/Popover/popoverAnchor.js +33 -0
- package/dist/Popover/usePopover.d.ts +20 -3
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +110 -10
- package/dist/PowerSearch/PowerSearch.d.ts +1 -0
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +46 -9
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.js +7 -1
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +7 -0
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +2 -4
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +6 -13
- package/dist/ProgressBar/ProgressBar.d.ts +5 -4
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +26 -26
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +51 -0
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +1 -1
- package/dist/Resizable/ResizeHandle.d.ts +1 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +1 -1
- package/dist/Resizable/resizableModel.d.ts +45 -3
- package/dist/Resizable/resizableModel.d.ts.map +1 -1
- package/dist/Resizable/resizableModel.js +91 -3
- package/dist/Resizable/resizeGesture.d.ts +3 -0
- package/dist/Resizable/resizeGesture.d.ts.map +1 -1
- package/dist/Resizable/resizeGesture.js +6 -0
- package/dist/Resizable/useResizable.d.ts +1 -33
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +8 -72
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +1 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts +27 -5
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedTouchTracking.js +70 -8
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +34 -14
- package/dist/Selector/hooks.d.ts +5 -0
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +72 -16
- package/dist/Selector/useSelectorPresentation.d.ts.map +1 -1
- package/dist/Selector/useSelectorPresentation.js +9 -3
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +18 -5
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +2 -2
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +47 -33
- package/dist/Stepper/Step.d.ts.map +1 -1
- package/dist/Stepper/Step.js +21 -12
- package/dist/Swipe/useSwipeAction.js +3 -3
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +64 -46
- package/dist/Switch/useSwitchTouch.d.ts +22 -1
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
- package/dist/Switch/useSwitchTouch.js +54 -3
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +3 -3
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +37 -18
- package/dist/Table/Table.d.ts +4 -3
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +32 -14
- package/dist/Table/TableBody.d.ts.map +1 -1
- package/dist/Table/TableBody.js +5 -1
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +6 -0
- package/dist/Table/TableHeaderCell.d.ts +1 -1
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js +42 -9
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +9 -1
- package/dist/Table/TableRowPlacementContext.d.ts +18 -0
- package/dist/Table/TableRowPlacementContext.d.ts.map +1 -0
- package/dist/Table/TableRowPlacementContext.js +41 -0
- package/dist/Table/TableSelectionToolbar.d.ts.map +1 -1
- package/dist/Table/TableSelectionToolbar.js +7 -0
- package/dist/Table/columnUtils.d.ts +5 -0
- package/dist/Table/columnUtils.d.ts.map +1 -1
- package/dist/Table/columnUtils.js +9 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +2 -2
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +8 -3
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.js +10 -6
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +5 -1
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +2 -1
- package/dist/Table/table.stylex.d.ts +31 -5
- package/dist/Table/table.stylex.d.ts.map +1 -1
- package/dist/Table/table.stylex.js +33 -5
- package/dist/Table/types.d.ts +3 -1
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Text/TruncationTooltip.d.ts.map +1 -1
- package/dist/Text/TruncationTooltip.js +17 -6
- package/dist/Text/text.stylex.d.ts +2 -2
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +23 -4
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +15 -1
- package/dist/TextInput/TextInput.d.ts +9 -3
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +19 -18
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +13 -4
- package/dist/Timer/Timer.d.ts.map +1 -1
- package/dist/Timer/Timer.js +10 -7
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +55 -4
- package/dist/Toast/Toast.d.ts +1 -6
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +77 -44
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +48 -21
- package/dist/Toast/types.d.ts +8 -0
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +14 -7
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +2 -1
- package/dist/Token/Token.d.ts +1 -1
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +6 -2
- package/dist/Tokenizer/Tokenizer.d.ts +2 -2
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +102 -62
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +33 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +20 -1
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +24 -8
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +21 -9
- package/dist/TopNav/TopNavMegaMenu.js +1 -1
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +9 -2
- package/dist/TopNav/TopNavRenderContext.d.ts +13 -0
- package/dist/TopNav/TopNavRenderContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavRenderContext.js +24 -9
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +7 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +20 -2
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -1
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +24 -9
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/Typeahead/TypeaheadItem.js +7 -0
- package/dist/astryx.css +211 -56
- package/dist/gestures/GestureHost.d.ts +7 -0
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +37 -0
- package/dist/hooks/anchoredHint.d.ts.map +1 -1
- package/dist/hooks/anchoredHint.js +0 -1
- package/dist/hooks/computeOverflow.d.ts.map +1 -1
- package/dist/hooks/computeOverflow.js +7 -0
- package/dist/hooks/focusableSelector.d.ts +16 -9
- package/dist/hooks/focusableSelector.d.ts.map +1 -1
- package/dist/hooks/focusableSelector.js +53 -2
- package/dist/hooks/scrollEdgeFade.d.ts +34 -0
- package/dist/hooks/scrollEdgeFade.d.ts.map +1 -0
- package/dist/hooks/scrollEdgeFade.js +173 -0
- package/dist/hooks/statusButtonPress.d.ts +15 -0
- package/dist/hooks/statusButtonPress.d.ts.map +1 -0
- package/dist/hooks/statusButtonPress.js +19 -0
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +2 -1
- package/dist/hooks/useFocusTrap.d.ts +26 -16
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +75 -112
- package/dist/hooks/useGroupPressTracking.d.ts +1 -1
- package/dist/hooks/useGroupPressTracking.js +1 -1
- package/dist/hooks/useOverflow.d.ts +25 -2
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +137 -8
- package/dist/hooks/useResolvedRequired.d.ts +27 -0
- package/dist/hooks/useResolvedRequired.d.ts.map +1 -1
- package/dist/hooks/useResolvedRequired.js +30 -1
- package/dist/hooks/useTreeFocus.d.ts.map +1 -1
- package/dist/hooks/useTreeFocus.js +4 -2
- package/dist/hooks/useTypeahead.d.ts.map +1 -1
- package/dist/hooks/useTypeahead.js +8 -8
- package/dist/i18n/InternationalizationContext.d.ts +13 -6
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +11 -6
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +7 -0
- package/dist/i18n/defaultTranslator.d.ts +17 -0
- package/dist/i18n/defaultTranslator.d.ts.map +1 -0
- package/dist/i18n/defaultTranslator.js +18 -0
- package/dist/i18n/firstStrongDirection.d.ts +3 -2
- package/dist/i18n/firstStrongDirection.d.ts.map +1 -1
- package/dist/i18n/firstStrongDirection.js +50 -12
- package/dist/i18n/generated-english/Chat/ChatPastedTextToken.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Chat/ChatPastedTextToken.generated.js +1 -2
- package/dist/i18n/generated-english/Chat/pastedTextLabel.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/pastedTextLabel.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/pastedTextLabel.generated.js +12 -0
- package/dist/i18n/generated-english/Chat/useTriggerMenu.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Chat/useTriggerMenu.generated.js +1 -0
- package/dist/i18n/generated-english/CodeBlock/CodeBlock.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/CodeBlock/CodeBlock.generated.js +2 -1
- package/dist/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.js +2 -1
- package/dist/i18n/generated-english/MultiSelector/MultiSelector.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/MultiSelector/MultiSelector.generated.js +1 -0
- package/dist/i18n/generated-english/Slider/Slider.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Slider/Slider.generated.js +2 -1
- package/dist/i18n/generated-english/TextArea/TextArea.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/TextArea/TextArea.generated.js +1 -0
- package/dist/i18n/generated-english/TextInput/TextInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/TextInput/TextInput.generated.js +1 -0
- package/dist/i18n/generated-english/Timestamp/Timestamp.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Timestamp/Timestamp.generated.js +2 -1
- package/dist/i18n/generated-english/Tokenizer/Tokenizer.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Tokenizer/Tokenizer.generated.js +1 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +9 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +9 -0
- package/dist/i18n/publicContext.d.ts.map +1 -1
- package/dist/i18n/publicContext.js +4 -2
- package/dist/i18n/translatingContext.d.ts +2 -0
- package/dist/i18n/translatingContext.d.ts.map +1 -0
- package/dist/i18n/translatingContext.js +25 -0
- package/dist/i18n/useComponentTranslator.d.ts.map +1 -1
- package/dist/i18n/useComponentTranslator.js +3 -2
- package/dist/i18n/useListFormatter.d.ts.map +1 -1
- package/dist/i18n/useListFormatter.js +3 -2
- package/dist/i18n/useTranslator.d.ts.map +1 -1
- package/dist/i18n/useTranslator.js +3 -2
- package/dist/internal/touch.d.ts +2 -0
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +5 -1
- package/dist/keyboard/keyboardHeight.d.ts +34 -3
- package/dist/keyboard/keyboardHeight.d.ts.map +1 -1
- package/dist/keyboard/keyboardHeight.js +101 -24
- package/dist/keyboard/keyboardTarget.d.ts +19 -16
- package/dist/keyboard/keyboardTarget.d.ts.map +1 -1
- package/dist/keyboard/keyboardTarget.js +529 -72
- package/dist/keyboard/useMobileKeyboard.d.ts.map +1 -1
- package/dist/keyboard/useMobileKeyboard.js +1 -8
- package/dist/palette/color.d.ts +23 -0
- package/dist/palette/color.d.ts.map +1 -0
- package/dist/palette/color.js +126 -0
- package/dist/palette/generator.d.ts +69 -0
- package/dist/palette/generator.d.ts.map +1 -0
- package/dist/palette/generator.js +778 -0
- package/dist/palette/index.d.ts +12 -0
- package/dist/palette/index.d.ts.map +1 -0
- package/dist/palette/index.js +13 -0
- package/dist/palette/mapping.d.ts +319 -0
- package/dist/palette/mapping.d.ts.map +1 -0
- package/dist/palette/mapping.js +1312 -0
- package/dist/palette/themePalette.d.ts +20 -0
- package/dist/palette/themePalette.d.ts.map +1 -0
- package/dist/palette/themePalette.js +145 -0
- package/dist/palette/types.d.ts +178 -0
- package/dist/palette/types.d.ts.map +1 -0
- package/dist/palette/types.js +1 -0
- package/dist/privateAttributes/mediaDarkPage.d.ts +5 -0
- package/dist/privateAttributes/mediaDarkPage.d.ts.map +1 -0
- package/dist/privateAttributes/mediaDarkPage.js +27 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +2 -1
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/pressGroupItem.stylex.js +2 -1
- package/dist/privateAttributes/scheme.d.ts +10 -0
- package/dist/privateAttributes/scheme.d.ts.map +1 -0
- package/dist/privateAttributes/scheme.js +34 -0
- package/dist/privateAttributes/travelling.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/travelling.stylex.js +2 -2
- package/dist/theme/MediaDarkPage.d.ts +18 -0
- package/dist/theme/MediaDarkPage.d.ts.map +1 -0
- package/dist/theme/MediaDarkPage.js +35 -0
- package/dist/theme/MediaTheme.d.ts.map +1 -1
- package/dist/theme/MediaTheme.js +9 -1
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +99 -31
- package/dist/theme/defineTheme.d.ts +31 -6
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +65 -29
- package/dist/theme/derivedVarRegistry.d.ts +19 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +49 -4
- package/dist/theme/expandRadiusScale.d.ts +1 -2
- package/dist/theme/expandRadiusScale.d.ts.map +1 -1
- package/dist/theme/expandRadiusScale.js +1 -5
- package/dist/theme/generateThemeRules.d.ts +10 -3
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +310 -207
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +2 -1
- package/dist/theme/invertedSurfaceSide.d.ts +17 -0
- package/dist/theme/invertedSurfaceSide.d.ts.map +1 -0
- package/dist/theme/invertedSurfaceSide.js +47 -0
- package/dist/theme/resolveThemeValues.d.ts +5 -2
- package/dist/theme/resolveThemeValues.d.ts.map +1 -1
- package/dist/theme/resolveThemeValues.js +7 -1
- package/dist/theme/statusRoleDefaults.d.ts +43 -0
- package/dist/theme/statusRoleDefaults.d.ts.map +1 -0
- package/dist/theme/statusRoleDefaults.js +196 -0
- package/dist/theme/statusRoleDerivation.d.ts +4 -0
- package/dist/theme/statusRoleDerivation.d.ts.map +1 -1
- package/dist/theme/statusRoleDerivation.js +3 -1
- package/dist/theme/syntax/SyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/SyntaxTheme.js +7 -0
- package/dist/theme/themeAdaptations.d.ts +24 -1
- package/dist/theme/themeAdaptations.d.ts.map +1 -1
- package/dist/theme/themeAdaptations.js +48 -5
- package/dist/theme/tokenDefaults.d.ts +3 -0
- package/dist/theme/tokenDefaults.d.ts.map +1 -0
- package/dist/theme/tokenDefaults.js +30 -0
- package/dist/theme/tokenValues.d.ts +26 -0
- package/dist/theme/tokenValues.d.ts.map +1 -0
- package/dist/theme/tokenValues.js +180 -0
- package/dist/theme/tokens.d.ts +3 -2
- package/dist/theme/tokens.d.ts.map +1 -1
- package/dist/theme/tokens.js +7 -161
- package/dist/theme/tokens.stylex.d.ts +4 -4
- package/dist/theme/tokens.stylex.d.ts.map +1 -1
- package/dist/theme/tokens.stylex.js +7 -5
- package/dist/theme/useTheme.d.ts +40 -3
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +137 -32
- package/dist/utils/devWarning.d.ts +17 -0
- package/dist/utils/devWarning.d.ts.map +1 -1
- package/dist/utils/devWarning.js +20 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
- package/dist/utils/focusOutline.stylex.js +7 -4
- package/dist/utils/focusReturn.d.ts +110 -0
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +418 -12
- package/dist/utils/hitArea.d.ts +28 -0
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +52 -18
- package/dist/utils/inputStream.d.ts +27 -0
- package/dist/utils/inputStream.d.ts.map +1 -1
- package/dist/utils/inputStream.js +72 -5
- package/dist/utils/nodeType.d.ts +2 -0
- package/dist/utils/nodeType.d.ts.map +1 -1
- package/dist/utils/nodeType.js +10 -0
- package/dist/utils/timeFormat.d.ts +14 -4
- package/dist/utils/timeFormat.d.ts.map +1 -1
- package/dist/utils/timeFormat.js +42 -4
- package/dist/utils/touchPresentation.d.ts +2 -2
- package/dist/utils/touchPresentation.d.ts.map +1 -1
- package/dist/utils/touchPresentation.js +10 -7
- package/dist/utils/touchPresentation.stylex.d.ts +4 -3
- package/dist/utils/touchPresentation.stylex.d.ts.map +1 -1
- package/dist/utils/touchPresentation.stylex.js +3 -3
- package/dist/utils/touchQueries.d.ts +3 -2
- package/dist/utils/touchQueries.d.ts.map +1 -1
- package/dist/utils/touchQueries.js +3 -2
- package/dist/utils/typeaheadMatch.d.ts +13 -0
- package/dist/utils/typeaheadMatch.d.ts.map +1 -1
- package/dist/utils/typeaheadMatch.js +15 -1
- package/dist/virtualization/useInlineListWindow.d.ts.map +1 -1
- package/dist/virtualization/useInlineListWindow.js +38 -22
- package/locales/en.json +36 -0
- package/locales/pseudo.json +27 -0
- package/package.json +10 -5
- package/scripts/agent-doc-state.mjs +71 -4
- package/src/AlertDialog/AlertDialog.doc.mjs +5 -1
- package/src/AlertDialog/AlertDialog.tsx +34 -7
- package/src/AppShell/AppShell.doc.mjs +22 -0
- package/src/AppShell/AppShell.tsx +112 -65
- package/src/AppShell/unreadWidthPoint.ts +162 -0
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +6 -1
- package/src/Badge/Badge.tsx +5 -2
- package/src/Banner/Banner.doc.mjs +15 -0
- package/src/Banner/Banner.tsx +56 -45
- package/src/BottomSheet/BottomSheet.doc.mjs +6 -3
- package/src/BottomSheet/BottomSheet.tsx +3 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +15 -7
- package/src/BottomSheet/BottomSheetSwitcher.tsx +73 -1
- package/src/BottomSheet/BottomSheetSwitcherContext.ts +5 -0
- package/src/BottomSheet/bottomSheetStack.ts +6 -14
- package/src/Breadcrumbs/BreadcrumbItem.tsx +14 -1
- package/src/Button/Button.doc.mjs +6 -0
- package/src/Button/Button.tsx +6 -0
- package/src/Calendar/Calendar.doc.mjs +16 -0
- package/src/Calendar/Calendar.tsx +32 -20
- package/src/Calendar/styles.ts +12 -3
- package/src/Card/Card.doc.mjs +2 -2
- package/src/Card/Card.tsx +22 -3
- package/src/Chat/Chat.doc.mjs +1 -1
- package/src/Chat/ChatComposer.doc.mjs +3 -3
- package/src/Chat/ChatComposer.tsx +11 -5
- package/src/Chat/ChatComposerDrawer.tsx +11 -7
- package/src/Chat/ChatDictationButton.tsx +12 -0
- package/src/Chat/ChatMessageBubble.tsx +2 -2
- package/src/Chat/ChatPastedTextToken.tsx +3 -9
- package/src/Chat/ChatSendButton.tsx +5 -0
- package/src/Chat/ChatSystemMessage.tsx +1 -0
- package/src/Chat/ChatToolCalls.tsx +16 -0
- package/src/Chat/pastedTextLabel.ts +23 -0
- package/src/Chat/useChatPasteAsToken.ts +9 -8
- package/src/Chat/useTriggerMenu.tsx +4 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +20 -0
- package/src/CheckboxInput/CheckboxInput.tsx +83 -26
- package/src/CheckboxList/CheckboxList.doc.mjs +15 -0
- package/src/CheckboxList/CheckboxListItem.doc.mjs +3 -3
- package/src/Citation/Citation.tsx +16 -1
- package/src/CodeBlock/CodeBlock.tsx +29 -2
- package/src/Collapsible/Collapsible.tsx +2 -0
- package/src/CommandPalette/CommandPaletteItem.tsx +1 -0
- package/src/ComplexSelector/ComplexSelector.doc.mjs +30 -2
- package/src/ComplexSelector/ComplexSelector.tsx +19 -1
- package/src/ContextMenu/ContextMenu.doc.mjs +5 -1
- package/src/ContextMenu/ContextMenu.tsx +44 -5
- package/src/ContextMenu/ContextMenuItem.doc.mjs +55 -5
- package/src/DateInput/MonthScroller.tsx +1 -0
- package/src/DateInput/PickerWheel.tsx +1 -0
- package/src/DateInput/TouchDateField.tsx +2 -0
- package/src/DateInput/Wheel.tsx +1 -0
- package/src/DateInput/usePointerDragScroll.ts +6 -2
- package/src/DateRangeInput/DateRangeInput.tsx +16 -0
- package/src/DateTimeInput/TouchDateTimeField.tsx +2 -0
- package/src/Dialog/Dialog.doc.mjs +11 -1
- package/src/Dialog/Dialog.tsx +116 -19
- package/src/Dialog/DialogContext.ts +5 -4
- package/src/Dialog/DialogHeader.tsx +50 -12
- package/src/Drawer/DrawerHeader.tsx +31 -6
- package/src/DropdownMenu/DropdownMenu.doc.mjs +20 -1
- package/src/DropdownMenu/DropdownMenu.tsx +29 -22
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +4 -4
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +3 -2
- package/src/DropdownMenu/DropdownMenuItem.doc.mjs +5 -5
- package/src/DropdownMenu/DropdownMenuItem.tsx +3 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +4 -4
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +3 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +3 -3
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +23 -1
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +37 -9
- package/src/DropdownMenu/menuRowCorners.stylex.ts +40 -0
- package/src/EmptyState/EmptyState.tsx +2 -0
- package/src/Field/Field.doc.mjs +1 -1
- package/src/Field/FieldLabel.doc.mjs +3 -3
- package/src/Field/FieldLabel.tsx +9 -2
- package/src/Field/inputDisabledFocus.ts +18 -0
- package/src/Field/inputStyles.stylex.ts +52 -1
- package/src/Grid/Grid.doc.mjs +6 -3
- package/src/Grid/Grid.tsx +5 -2
- package/src/Heading/Heading.tsx +24 -1
- package/src/Icon/Icon.doc.mjs +1 -1
- package/src/Icon/Icon.tsx +40 -2
- package/src/Indicator/CheckboxIndicator.tsx +11 -6
- package/src/Indicator/Indicator.doc.mjs +1 -1
- package/src/Indicator/RadioIndicator.tsx +31 -4
- package/src/Indicator/indicatorRegistry.ts +7 -23
- package/src/Indicator/themeIndicators.ts +29 -0
- package/src/Indicator/types.ts +14 -0
- package/src/Indicator/useThemeIndicator.ts +24 -0
- package/src/Item/Item.doc.mjs +3 -3
- package/src/Item/Item.tsx +48 -7
- package/src/Kbd/Kbd.doc.mjs +6 -2
- package/src/Kbd/Kbd.tsx +16 -1
- package/src/Layer/layerExitCopy.ts +0 -1
- package/src/Layer/layerSlideRules.ts +62 -74
- package/src/Layer/useLayer.doc.mjs +2 -2
- package/src/Layer/useLayer.tsx +293 -137
- package/src/Layer/useLayerKeyboardClearance.ts +9 -12
- package/src/Layout/Layout.doc.mjs +3 -3
- package/src/Layout/LayoutContainerContext.ts +27 -0
- package/src/Layout/LayoutContainerScope.tsx +32 -0
- package/src/Layout/LayoutContent.tsx +5 -2
- package/src/Layout/LayoutFooter.tsx +3 -1
- package/src/Layout/LayoutHeader.tsx +3 -1
- package/src/Layout/containerCorners.stylex.ts +44 -7
- package/src/Lightbox/Lightbox.tsx +460 -8
- package/src/Link/Link.doc.mjs +18 -0
- package/src/Link/Link.tsx +3 -1
- package/src/List/List.tsx +14 -2
- package/src/List/ListContext.tsx +60 -1
- package/src/List/ListItem.doc.mjs +11 -9
- package/src/List/ListItem.tsx +4 -4
- package/src/Markdown/Markdown.doc.mjs +1 -1
- package/src/Markdown/Markdown.tsx +189 -190
- package/src/Markdown/plugins/HeadingLinksRenderer.tsx +14 -4
- package/src/Markdown/plugins/protocol.ts +3 -3
- package/src/MetadataList/MetadataListItem.tsx +18 -3
- package/src/MobileNav/MobileNav.doc.mjs +134 -52
- package/src/MobileNav/MobileNav.tsx +13 -9
- package/src/MultiSelector/MultiSelector.doc.mjs +2 -2
- package/src/MultiSelector/MultiSelector.tsx +51 -8
- package/src/NavMenu/NavHeadingMenu.tsx +5 -1
- package/src/NavMenu/NavHeadingMenuItem.tsx +1 -0
- package/src/NavMenu/NavMenu.doc.mjs +105 -2
- package/src/NavMenu/NavMenuContext.tsx +13 -0
- package/src/NumberInput/NumberInput.doc.mjs +12 -10
- package/src/NumberInput/NumberInput.tsx +19 -11
- package/src/Outline/Outline.doc.mjs +26 -8
- package/src/Outline/Outline.tsx +35 -5
- package/src/Outline/useScrollSpy.ts +8 -3
- package/src/OverflowList/OverflowList.doc.mjs +15 -0
- package/src/OverflowList/OverflowList.tsx +62 -26
- package/src/Pagination/Pagination.doc.mjs +12 -0
- package/src/Pagination/Pagination.tsx +40 -6
- package/src/Popover/Popover.doc.mjs +10 -0
- package/src/Popover/Popover.tsx +8 -4
- package/src/Popover/popoverAnchor.ts +47 -0
- package/src/Popover/usePopover.doc.mjs +16 -2
- package/src/Popover/usePopover.tsx +152 -16
- package/src/PowerSearch/PowerSearch.doc.mjs +8 -8
- package/src/PowerSearch/PowerSearch.tsx +65 -12
- package/src/PowerSearch/PowerSearchEditPopover.tsx +1 -0
- package/src/PowerSearch/PowerSearchFilterEditor.tsx +12 -0
- package/src/PowerSearch/PowerSearchToken.tsx +12 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +14 -19
- package/src/ProgressBar/ProgressBar.doc.mjs +2 -2
- package/src/ProgressBar/ProgressBar.tsx +44 -30
- package/src/RadioList/RadioList.tsx +63 -0
- package/src/RadioList/RadioListItem.tsx +4 -1
- package/src/Resizable/ResizeHandle.tsx +2 -3
- package/src/Resizable/resizableModel.ts +105 -3
- package/src/Resizable/resizeGesture.ts +14 -0
- package/src/Resizable/useResizable.ts +14 -75
- package/src/SegmentedControl/SegmentedControlItem.tsx +1 -0
- package/src/SegmentedControl/useSegmentedTouchTracking.ts +76 -12
- package/src/Selector/Selector.doc.mjs +34 -7
- package/src/Selector/Selector.tsx +55 -25
- package/src/Selector/SelectorOption.doc.mjs +5 -5
- package/src/Selector/hooks.ts +92 -17
- package/src/Selector/useSelectorPresentation.ts +18 -3
- package/src/SideNav/SideNavHeading.tsx +15 -4
- package/src/SideNav/SideNavItem.doc.mjs +10 -10
- package/src/Slider/Slider.tsx +4 -1
- package/src/Spinner/Spinner.tsx +56 -41
- package/src/Stepper/Step.tsx +18 -3
- package/src/Stepper/Stepper.doc.mjs +14 -2
- package/src/Swipe/useSwipeAction.ts +3 -3
- package/src/Switch/Switch.doc.mjs +61 -5
- package/src/Switch/Switch.tsx +72 -35
- package/src/Switch/useSwitchTouch.ts +68 -3
- package/src/TabList/Tab.tsx +6 -0
- package/src/Table/BaseTable.tsx +73 -35
- package/src/Table/Table.doc.mjs +109 -5
- package/src/Table/Table.tsx +42 -17
- package/src/Table/TableBody.tsx +10 -1
- package/src/Table/TableCell.tsx +6 -0
- package/src/Table/TableHeaderCell.tsx +52 -7
- package/src/Table/TableRow.tsx +8 -1
- package/src/Table/TableRowPlacementContext.ts +58 -0
- package/src/Table/TableSelectionToolbar.tsx +12 -0
- package/src/Table/columnUtils.ts +9 -1
- package/src/Table/plugins/columnSettings/useTableColumnSettingsState.doc.mjs +1 -1
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +1 -0
- package/src/Table/plugins/sortable/useTableSortable.tsx +15 -2
- package/src/Table/plugins/sortable/useTableSortableState.doc.mjs +5 -5
- package/src/Table/plugins/sortable/useTableSortableState.tsx +15 -8
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +8 -0
- package/src/Table/plugins/tree/useTableTreeData.tsx +2 -4
- package/src/Table/table.stylex.ts +44 -5
- package/src/Table/types.ts +3 -1
- package/src/Table/useTableColumnResize.doc.mjs +3 -3
- package/src/Table/useTableColumnSettings.doc.mjs +3 -3
- package/src/Table/useTableFilterState.doc.mjs +6 -3
- package/src/Table/useTableFiltering.doc.mjs +71 -4
- package/src/Table/useTableInfiniteScroll.doc.mjs +2 -2
- package/src/Table/useTablePagination.doc.mjs +24 -3
- package/src/Table/useTableSelection.doc.mjs +30 -6
- package/src/Table/useTableSelectionState.doc.mjs +30 -2
- package/src/Table/useTableSortable.doc.mjs +104 -17
- package/src/Table/useTableStickyColumns.doc.mjs +3 -3
- package/src/Text/Heading.doc.mjs +2 -2
- package/src/Text/Text.doc.mjs +1 -1
- package/src/Text/TruncationTooltip.tsx +18 -11
- package/src/Text/useTruncation.ts +20 -4
- package/src/TextArea/TextArea.doc.mjs +5 -5
- package/src/TextArea/TextArea.tsx +20 -1
- package/src/TextInput/TextInput.doc.mjs +5 -5
- package/src/TextInput/TextInput.tsx +23 -18
- package/src/Thumbnail/Thumbnail.tsx +2 -1
- package/src/Timer/Timer.tsx +21 -6
- package/src/Timestamp/Timestamp.tsx +67 -4
- package/src/Toast/Toast.doc.mjs +15 -5
- package/src/Toast/Toast.tsx +83 -62
- package/src/Toast/ToastViewport.tsx +62 -23
- package/src/Toast/types.ts +8 -0
- package/src/Toast/useToast.doc.mjs +80 -15
- package/src/Toast/useToast.tsx +18 -7
- package/src/ToggleButton/ToggleButton.doc.mjs +1 -1
- package/src/ToggleButton/ToggleButton.tsx +1 -0
- package/src/Token/Token.tsx +5 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +15 -3
- package/src/Tokenizer/Tokenizer.tsx +130 -75
- package/src/Toolbar/Toolbar.tsx +55 -4
- package/src/Tooltip/useTooltip.tsx +26 -0
- package/src/TopNav/TopNav.doc.mjs +1 -1
- package/src/TopNav/TopNav.tsx +13 -3
- package/src/TopNav/TopNavHeading.tsx +22 -9
- package/src/TopNav/TopNavMegaMenu.tsx +4 -4
- package/src/TopNav/TopNavMenu.tsx +13 -0
- package/src/TopNav/TopNavRenderContext.ts +30 -9
- package/src/TreeList/TreeList.tsx +12 -0
- package/src/TreeList/TreeListItem.tsx +26 -5
- package/src/Typeahead/BaseTypeahead.doc.mjs +6 -0
- package/src/Typeahead/BaseTypeahead.tsx +2 -0
- package/src/Typeahead/Typeahead.doc.mjs +15 -2
- package/src/Typeahead/Typeahead.tsx +37 -13
- package/src/Typeahead/TypeaheadItem.tsx +12 -0
- package/src/gestures/GestureHost.ts +34 -0
- package/src/gestures/README.md +9 -6
- package/src/hooks/anchoredHint.tsx +1 -2
- package/src/hooks/computeOverflow.ts +10 -0
- package/src/hooks/focusableSelector.ts +59 -2
- package/src/hooks/scrollEdgeFade.ts +129 -0
- package/src/hooks/statusButtonPress.ts +26 -0
- package/src/hooks/useAnnounce.ts +2 -1
- package/src/hooks/useFocusTrap.ts +110 -141
- package/src/hooks/useGroupPressTracking.ts +1 -1
- package/src/hooks/useOverflow.ts +227 -13
- package/src/hooks/useResolvedRequired.ts +50 -1
- package/src/hooks/useTreeFocus.ts +8 -4
- package/src/hooks/useTypeahead.ts +12 -10
- package/src/i18n/InternationalizationContext.ts +16 -7
- package/src/i18n/InternationalizationProvider.doc.mjs +1 -1
- package/src/i18n/InternationalizationProvider.tsx +12 -0
- package/src/i18n/defaultTranslator.ts +25 -0
- package/src/i18n/firstStrongDirection.ts +54 -13
- package/src/i18n/generated-english/Chat/ChatPastedTextToken.generated.ts +1 -2
- package/src/i18n/generated-english/Chat/pastedTextLabel.generated.ts +13 -0
- package/src/i18n/generated-english/Chat/useTriggerMenu.generated.ts +1 -0
- package/src/i18n/generated-english/CodeBlock/CodeBlock.generated.ts +2 -1
- package/src/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.ts +2 -1
- package/src/i18n/generated-english/MultiSelector/MultiSelector.generated.ts +1 -0
- package/src/i18n/generated-english/Slider/Slider.generated.ts +2 -1
- package/src/i18n/generated-english/TextArea/TextArea.generated.ts +1 -0
- package/src/i18n/generated-english/TextInput/TextInput.generated.ts +1 -0
- package/src/i18n/generated-english/Timestamp/Timestamp.generated.ts +2 -1
- package/src/i18n/generated-english/Tokenizer/Tokenizer.generated.ts +1 -0
- package/src/i18n/generated-locales/en.generated.ts +11 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +11 -0
- package/src/i18n/publicContext.ts +4 -2
- package/src/i18n/translatingContext.ts +28 -0
- package/src/i18n/useComponentTranslator.ts +3 -2
- package/src/i18n/useListFormatter.ts +3 -2
- package/src/i18n/useTranslator.ts +3 -2
- package/src/internal/touch.ts +7 -0
- package/src/keyboard/README.md +58 -16
- package/src/keyboard/keyboardHeight.ts +138 -26
- package/src/keyboard/keyboardTarget.ts +667 -71
- package/src/keyboard/useMobileKeyboard.ts +1 -7
- package/src/palette/color.ts +205 -0
- package/src/palette/generator.ts +1134 -0
- package/src/palette/index.ts +35 -0
- package/src/palette/mapping.ts +1630 -0
- package/src/palette/themePalette.ts +175 -0
- package/src/palette/types.ts +194 -0
- package/src/privateAttributes/mediaDarkPage.ts +27 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +2 -1
- package/src/privateAttributes/scheme.ts +37 -0
- package/src/privateAttributes/travelling.stylex.ts +6 -4
- package/src/reset.css +1 -1
- package/src/theme/MediaDarkPage.tsx +41 -0
- package/src/theme/MediaTheme.tsx +8 -1
- package/src/theme/Theme.doc.mjs +4 -4
- package/src/theme/Theme.tsx +140 -35
- package/src/theme/defineTheme.ts +103 -40
- package/src/theme/derivedVarRegistry.ts +61 -4
- package/src/theme/expandRadiusScale.ts +1 -5
- package/src/theme/generateThemeRules.ts +398 -342
- package/src/theme/index.ts +2 -4
- package/src/theme/invertedSurfaceSide.ts +65 -0
- package/src/theme/resolveThemeValues.ts +8 -2
- package/src/theme/statusRoleDefaults.ts +330 -0
- package/src/theme/statusRoleDerivation.ts +2 -1
- package/src/theme/syntax/SyntaxTheme.tsx +12 -0
- package/src/theme/themeAdaptations.ts +53 -5
- package/src/theme/tokenDefaults.ts +44 -0
- package/src/theme/tokenValues.ts +193 -0
- package/src/theme/tokens.stylex.ts +7 -5
- package/src/theme/tokens.ts +14 -176
- package/src/theme/useTheme.ts +164 -35
- package/src/utils/devWarning.ts +24 -0
- package/src/utils/focusOutline.stylex.ts +7 -4
- package/src/utils/focusReturn.ts +578 -16
- package/src/utils/hitArea.ts +70 -33
- package/src/utils/inputStream.ts +81 -5
- package/src/utils/nodeType.ts +10 -0
- package/src/utils/timeFormat.ts +54 -4
- package/src/utils/touchPresentation.stylex.ts +7 -6
- package/src/utils/touchPresentation.ts +10 -7
- package/src/utils/touchQueries.ts +3 -2
- package/src/utils/typeaheadMatch.ts +20 -1
- package/src/virtualization/useInlineListWindow.ts +57 -33
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file unreadWidthPoint.ts
|
|
5
|
+
* @input The shell's layout state, its side nav breakpoint and the width the
|
|
6
|
+
* theme gives that breakpoint
|
|
7
|
+
* @output unreadWidthPoint (the standard width point below which a shell that
|
|
8
|
+
* has not read the window hides its phone-only regions) and UNREAD_STYLES
|
|
9
|
+
* (the compiled rule for each standard point: the inline side nav, the
|
|
10
|
+
* elevated corner and the top nav's start and center regions)
|
|
11
|
+
* @position Private to AppShell: its layout before it reads the window, and
|
|
12
|
+
* the only module that writes the standard width points as media keys.
|
|
13
|
+
* AppShell computes the point once and hands TopNav its region rule through
|
|
14
|
+
* TopNavUnreadRegionContext.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import * as stylex from '@stylexjs/stylex';
|
|
18
|
+
import {radiusVars} from '../theme/tokens.stylex';
|
|
19
|
+
import {
|
|
20
|
+
DEFAULT_WIDTH_BREAKPOINTS,
|
|
21
|
+
type WidthBreakpointName,
|
|
22
|
+
} from '../theme/themeAdaptations';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The standard width point below which a shell that has not read the window
|
|
26
|
+
* shows its phone layout through CSS, or null. StyleX compiles media queries
|
|
27
|
+
* ahead of time, so only the standard points have a rule: a theme that moves
|
|
28
|
+
* the point keeps the server's layout until the shell reads the window.
|
|
29
|
+
*/
|
|
30
|
+
export function unreadWidthPoint(
|
|
31
|
+
isUnread: boolean,
|
|
32
|
+
breakpoint: WidthBreakpointName | 'none',
|
|
33
|
+
breakpointWidth: number | null,
|
|
34
|
+
): WidthBreakpointName | null {
|
|
35
|
+
return isUnread &&
|
|
36
|
+
breakpoint !== 'none' &&
|
|
37
|
+
breakpointWidth === DEFAULT_WIDTH_BREAKPOINTS[breakpoint]
|
|
38
|
+
? breakpoint
|
|
39
|
+
: null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// One rule per standard width point (`DEFAULT_WIDTH_BREAKPOINTS`). The
|
|
43
|
+
// queries use `not all and (min-width)`: StyleX lowers `(width < N)` to
|
|
44
|
+
// `(max-width: N - 0.01)`, which Chromium rounds up to N, so the rule would
|
|
45
|
+
// also apply at the point itself. Below the point, the inline side nav does
|
|
46
|
+
// not paint, the elevated backdrop loses its corner, and the top nav's start
|
|
47
|
+
// and center regions do not paint, as in the phone layout.
|
|
48
|
+
const sideNavStyles = stylex.create({
|
|
49
|
+
sm: {
|
|
50
|
+
display: {default: null, '@media not all and (min-width: 640px)': 'none'},
|
|
51
|
+
},
|
|
52
|
+
md: {
|
|
53
|
+
display: {default: null, '@media not all and (min-width: 768px)': 'none'},
|
|
54
|
+
},
|
|
55
|
+
lg: {
|
|
56
|
+
display: {default: null, '@media not all and (min-width: 1024px)': 'none'},
|
|
57
|
+
},
|
|
58
|
+
xl: {
|
|
59
|
+
display: {default: null, '@media not all and (min-width: 1280px)': 'none'},
|
|
60
|
+
},
|
|
61
|
+
'2xl': {
|
|
62
|
+
display: {default: null, '@media not all and (min-width: 1536px)': 'none'},
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
const cornerStyles = stylex.create({
|
|
66
|
+
sm: {
|
|
67
|
+
borderStartStartRadius: {
|
|
68
|
+
default: radiusVars['--radius-page'],
|
|
69
|
+
'@media not all and (min-width: 640px)': 0,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
md: {
|
|
73
|
+
borderStartStartRadius: {
|
|
74
|
+
default: radiusVars['--radius-page'],
|
|
75
|
+
'@media not all and (min-width: 768px)': 0,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
lg: {
|
|
79
|
+
borderStartStartRadius: {
|
|
80
|
+
default: radiusVars['--radius-page'],
|
|
81
|
+
'@media not all and (min-width: 1024px)': 0,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
xl: {
|
|
85
|
+
borderStartStartRadius: {
|
|
86
|
+
default: radiusVars['--radius-page'],
|
|
87
|
+
'@media not all and (min-width: 1280px)': 0,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
'2xl': {
|
|
91
|
+
borderStartStartRadius: {
|
|
92
|
+
default: radiusVars['--radius-page'],
|
|
93
|
+
'@media not all and (min-width: 1536px)': 0,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
// The regions are flex rows: a StyleX value replaces the whole property, so
|
|
98
|
+
// the rule keeps `flex` above the point.
|
|
99
|
+
const topNavRegionStyles = stylex.create({
|
|
100
|
+
sm: {
|
|
101
|
+
display: {default: 'flex', '@media not all and (min-width: 640px)': 'none'},
|
|
102
|
+
},
|
|
103
|
+
md: {
|
|
104
|
+
display: {default: 'flex', '@media not all and (min-width: 768px)': 'none'},
|
|
105
|
+
},
|
|
106
|
+
lg: {
|
|
107
|
+
display: {
|
|
108
|
+
default: 'flex',
|
|
109
|
+
'@media not all and (min-width: 1024px)': 'none',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
xl: {
|
|
113
|
+
display: {
|
|
114
|
+
default: 'flex',
|
|
115
|
+
'@media not all and (min-width: 1280px)': 'none',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
'2xl': {
|
|
119
|
+
display: {
|
|
120
|
+
default: 'flex',
|
|
121
|
+
'@media not all and (min-width: 1536px)': 'none',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
/** The rules for each standard width point. */
|
|
127
|
+
export const UNREAD_STYLES: Readonly<
|
|
128
|
+
Record<
|
|
129
|
+
WidthBreakpointName,
|
|
130
|
+
{
|
|
131
|
+
sideNav: stylex.StyleXStyles;
|
|
132
|
+
corner: stylex.StyleXStyles;
|
|
133
|
+
topNavRegion: stylex.StyleXStyles;
|
|
134
|
+
}
|
|
135
|
+
>
|
|
136
|
+
> = {
|
|
137
|
+
sm: {
|
|
138
|
+
sideNav: sideNavStyles.sm,
|
|
139
|
+
corner: cornerStyles.sm,
|
|
140
|
+
topNavRegion: topNavRegionStyles.sm,
|
|
141
|
+
},
|
|
142
|
+
md: {
|
|
143
|
+
sideNav: sideNavStyles.md,
|
|
144
|
+
corner: cornerStyles.md,
|
|
145
|
+
topNavRegion: topNavRegionStyles.md,
|
|
146
|
+
},
|
|
147
|
+
lg: {
|
|
148
|
+
sideNav: sideNavStyles.lg,
|
|
149
|
+
corner: cornerStyles.lg,
|
|
150
|
+
topNavRegion: topNavRegionStyles.lg,
|
|
151
|
+
},
|
|
152
|
+
xl: {
|
|
153
|
+
sideNav: sideNavStyles.xl,
|
|
154
|
+
corner: cornerStyles.xl,
|
|
155
|
+
topNavRegion: topNavRegionStyles.xl,
|
|
156
|
+
},
|
|
157
|
+
'2xl': {
|
|
158
|
+
sideNav: sideNavStyles['2xl'],
|
|
159
|
+
corner: cornerStyles['2xl'],
|
|
160
|
+
topNavRegion: topNavRegionStyles['2xl'],
|
|
161
|
+
},
|
|
162
|
+
};
|
|
@@ -135,6 +135,7 @@ const dynamicStyles = stylex.create({
|
|
|
135
135
|
fontSize: `max(${typeScaleVars['--text-supporting-size']}, ${
|
|
136
136
|
s * OVERFLOW_FONT_RATIO
|
|
137
137
|
}px)`,
|
|
138
|
+
lineHeight: typeScaleVars['--text-supporting-leading'],
|
|
138
139
|
}),
|
|
139
140
|
overlap: (offset: number) => ({
|
|
140
141
|
'--_avatar-group-overlap': `${offset}px`,
|
|
@@ -163,6 +164,7 @@ export function AvatarGroupOverflow({
|
|
|
163
164
|
xstyle,
|
|
164
165
|
className,
|
|
165
166
|
style,
|
|
167
|
+
'aria-label': ariaLabel,
|
|
166
168
|
...rest
|
|
167
169
|
}: AvatarGroupOverflowProps): ReactNode {
|
|
168
170
|
const pressable = usePressFeedback();
|
|
@@ -177,7 +179,10 @@ export function AvatarGroupOverflow({
|
|
|
177
179
|
// `total - visibleCount`, which goes negative whenever the list is shorter
|
|
178
180
|
// than the slice. Clamping keeps that from rendering "+-3".
|
|
179
181
|
const safeCount = Math.max(0, count);
|
|
180
|
-
|
|
182
|
+
// A caller's non-empty aria-label names the indicator; the count is the
|
|
183
|
+
// fallback. A caller's aria-labelledby wins over both in the browser.
|
|
184
|
+
const label =
|
|
185
|
+
ariaLabel || t('@astryx.avatarGroup.overflow', {count: safeCount});
|
|
181
186
|
const content = children ?? `+${safeCount}`;
|
|
182
187
|
|
|
183
188
|
if (onClick) {
|
package/src/Badge/Badge.tsx
CHANGED
|
@@ -91,9 +91,12 @@ const styles = stylex.create({
|
|
|
91
91
|
*/
|
|
92
92
|
const variants = stylex.create({
|
|
93
93
|
// Semantic variants
|
|
94
|
+
// In a primary or destructive Button, the neutral tint over the fill misses
|
|
95
|
+
// 4.5:1. There the badge paints the Button's colour pair inverted, which
|
|
96
|
+
// keeps its contrast.
|
|
94
97
|
neutral: {
|
|
95
|
-
backgroundColor: colorVars['--color-neutral']
|
|
96
|
-
color: colorVars['--color-text-primary']
|
|
98
|
+
backgroundColor: `var(--_button-on-fill, ${colorVars['--color-neutral']})`,
|
|
99
|
+
color: `var(--_button-fill, ${colorVars['--color-text-primary']})`,
|
|
97
100
|
},
|
|
98
101
|
info: {
|
|
99
102
|
backgroundColor: colorVars['--color-info'],
|
|
@@ -25,6 +25,7 @@ export const docs = {
|
|
|
25
25
|
{name: 'Banner frame', required: true, description: 'Outer frame that groups the status surface and optional content surface. It carries whole-banner elevation and, for elevated card banners, the radius that shapes that silhouette.'},
|
|
26
26
|
{name: 'Status surface', required: true, description: 'The primary painted surface. It communicates status and contains the icon, title, description, actions, and controls.'},
|
|
27
27
|
{name: 'Icon', required: true, description: 'Automatically set based on the status (info, warning, error, success).'},
|
|
28
|
+
{name: 'Message', required: true, description: 'Holds the title and the description. Themes can lay the two out on one line.'},
|
|
28
29
|
{name: 'Title', required: true, description: 'The main message. Always required.'},
|
|
29
30
|
{name: 'Description', required: false, description: 'Additional detail below the title.'},
|
|
30
31
|
{name: 'Action button', required: false, description: 'A button for the user to act on the message, like "Review" or "Retry".'},
|
|
@@ -170,8 +171,11 @@ function SaveSettings() {
|
|
|
170
171
|
{className: 'astryx-banner-frame', visualProps: ['container', 'elevation']},
|
|
171
172
|
{className: 'astryx-banner', visualProps: ['container', 'status']},
|
|
172
173
|
{className: 'astryx-banner-icon', visualProps: ['status']},
|
|
174
|
+
{className: 'astryx-banner-message'},
|
|
175
|
+
{className: 'astryx-banner-title'},
|
|
173
176
|
{className: 'astryx-banner-description'},
|
|
174
177
|
{className: 'astryx-banner-content', visualProps: ['container', 'status']},
|
|
178
|
+
{className: 'astryx-banner-close'},
|
|
175
179
|
],
|
|
176
180
|
vars: [
|
|
177
181
|
{name: '--_banner-radius', description: 'Border radius of the card container (header, content area and the elevated root silhouette)', default: 'var(--radius-container)', private: true},
|
|
@@ -203,6 +207,7 @@ export const docsZh = {
|
|
|
203
207
|
{name: 'Banner frame', required: true, description: 'Outer frame that groups the status surface and optional content surface. It carries whole-banner elevation and, for elevated card banners, the radius that shapes that silhouette.'},
|
|
204
208
|
{name: 'Status surface', required: true, description: 'The primary painted surface. It communicates status and contains the icon, title, description, actions, and controls.'},
|
|
205
209
|
{name: 'Icon', required: true, description: 'Automatically set based on the status (info, warning, error, success).'},
|
|
210
|
+
{name: 'Message', required: true, description: 'Holds the title and the description. Themes can lay the two out on one line.'},
|
|
206
211
|
{name: 'Title', required: true, description: 'The main message. Always required.'},
|
|
207
212
|
{name: 'Description', required: false, description: 'Additional detail below the title.'},
|
|
208
213
|
{name: 'Action button', required: false, description: 'A button for the user to act on the message, like "Review" or "Retry".'},
|
|
@@ -252,6 +257,12 @@ export const docsZh = {
|
|
|
252
257
|
'status',
|
|
253
258
|
],
|
|
254
259
|
},
|
|
260
|
+
{
|
|
261
|
+
className: 'astryx-banner-message',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
className: 'astryx-banner-title',
|
|
265
|
+
},
|
|
255
266
|
{
|
|
256
267
|
className: 'astryx-banner-description',
|
|
257
268
|
},
|
|
@@ -262,6 +273,9 @@ export const docsZh = {
|
|
|
262
273
|
'status',
|
|
263
274
|
],
|
|
264
275
|
},
|
|
276
|
+
{
|
|
277
|
+
className: 'astryx-banner-close',
|
|
278
|
+
},
|
|
265
279
|
],
|
|
266
280
|
vars: [
|
|
267
281
|
{name: '--_banner-radius', description: 'Border radius of the card container (header, content area and the elevated root silhouette)', default: 'var(--radius-container)', private: true},
|
|
@@ -292,6 +306,7 @@ export const docsDense = {
|
|
|
292
306
|
{name: 'Banner frame', required: true, description: 'Outer frame grouping the status and optional content surfaces; owns whole-banner elevation and its elevated-card silhouette.'},
|
|
293
307
|
{name: 'Status surface', required: true, description: 'Primary painted surface communicating status and containing the message and controls.'},
|
|
294
308
|
{name: 'Icon', required: true, description: 'Set automatically from status.'},
|
|
309
|
+
{name: 'Message', required: true, description: 'Title plus description; themeable as one line.'},
|
|
295
310
|
{name: 'Title', required: true, description: 'Main message text.'},
|
|
296
311
|
{name: 'Description', required: false, description: 'Detail below title.'},
|
|
297
312
|
{name: 'Action button', required: false, description: 'CTA like Review or Retry.'},
|
package/src/Banner/Banner.tsx
CHANGED
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
* - End area restores the ordinary text context for consumer `endContent`; built-in controls opt back into the status foreground
|
|
16
16
|
* - Content area (themeProps 'banner-content'): card background for additional content (children)
|
|
17
17
|
* - Status icon (themeProps 'banner-icon'): the target rides on the default
|
|
18
|
-
* <Icon> itself
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* <Icon> itself, a direct header item, so 'status:X' overrides reach the
|
|
19
|
+
* glyph and hiding it leaves no gap; a custom `icon` node gets a wrapper
|
|
20
|
+
* that carries the target
|
|
21
|
+
* - Message (themeProps 'banner-message'): the title and description column
|
|
22
|
+
* - Title (themeProps 'banner-title') and description (themeProps
|
|
23
|
+
* 'banner-description'): each line owns its own colour and type
|
|
22
24
|
* - The end area carries no target: it is a layout row (flex, wrap, edge
|
|
23
25
|
* compensation) rather than a painted surface, and a theme that wants the
|
|
24
26
|
* header to grow around its buttons sets `padding-block` on 'banner'
|
|
@@ -316,6 +318,9 @@ const styles = stylex.create({
|
|
|
316
318
|
alignItems: 'center',
|
|
317
319
|
flexShrink: 0,
|
|
318
320
|
},
|
|
321
|
+
icon: {
|
|
322
|
+
flexShrink: 0,
|
|
323
|
+
},
|
|
319
324
|
endArea: {
|
|
320
325
|
display: 'flex',
|
|
321
326
|
alignItems: 'center',
|
|
@@ -689,52 +694,55 @@ export function Banner({
|
|
|
689
694
|
: styles.headerCardStandalone),
|
|
690
695
|
),
|
|
691
696
|
)}>
|
|
692
|
-
{/* The
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
overrides reach
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
{...themeProps('banner-icon', {status})}
|
|
717
|
-
/>
|
|
718
|
-
) : null}
|
|
719
|
-
</div>
|
|
697
|
+
{/* The default Icon is a direct flex item. A theme that hides
|
|
698
|
+
'banner-icon' also removes its column gap. A custom `icon` node
|
|
699
|
+
gets a wrapper, because core never adds props to consumer
|
|
700
|
+
elements; overrides reach the node through inheritance. */}
|
|
701
|
+
{isRenderable(icon) ? (
|
|
702
|
+
<div
|
|
703
|
+
{...mergeProps(
|
|
704
|
+
themeProps('banner-icon', {status}),
|
|
705
|
+
stylex.props(styles.iconWrapper),
|
|
706
|
+
)}
|
|
707
|
+
aria-hidden="true">
|
|
708
|
+
{icon}
|
|
709
|
+
</div>
|
|
710
|
+
) : defaultIconName != null ? (
|
|
711
|
+
// The target is on the glyph itself, so a 'banner-icon' 'status:X'
|
|
712
|
+
// color override beats the Icon's own variant.
|
|
713
|
+
<Icon
|
|
714
|
+
icon={defaultIconName}
|
|
715
|
+
size="md"
|
|
716
|
+
color={iconColor}
|
|
717
|
+
xstyle={styles.icon}
|
|
718
|
+
{...themeProps('banner-icon', {status})}
|
|
719
|
+
/>
|
|
720
|
+
) : null}
|
|
720
721
|
<div
|
|
721
722
|
role={isUrgentAlert ? 'alert' : undefined}
|
|
722
723
|
{...alertAriaProps}
|
|
723
|
-
{...
|
|
724
|
-
|
|
725
|
-
|
|
724
|
+
{...mergeProps(
|
|
725
|
+
themeProps('banner-message'),
|
|
726
|
+
stylex.props(
|
|
727
|
+
styles.headerContent,
|
|
728
|
+
isRenderable(endContent) && styles.headerContentWithEndContent,
|
|
729
|
+
),
|
|
726
730
|
)}>
|
|
727
731
|
<div
|
|
728
|
-
{...
|
|
729
|
-
|
|
730
|
-
|
|
732
|
+
{...mergeProps(
|
|
733
|
+
themeProps('banner-title'),
|
|
734
|
+
stylex.props(
|
|
735
|
+
styles.title,
|
|
736
|
+
hasStatusStyle(status) && styles.statusForeground,
|
|
737
|
+
),
|
|
731
738
|
)}>
|
|
732
739
|
{title}
|
|
733
740
|
</div>
|
|
734
|
-
{/* A flex container renders no whitespace-only text, so
|
|
735
|
-
only separates the title and the
|
|
736
|
-
text.
|
|
737
|
-
|
|
741
|
+
{/* A flex container renders no whitespace-only text, so in the
|
|
742
|
+
default layout this space only separates the title and the
|
|
743
|
+
description in the message's text. A theme that lays them out
|
|
744
|
+
on one line shows it as the gap between them. */}
|
|
745
|
+
{isRenderable(description) && ' '}
|
|
738
746
|
{isRenderable(description) && (
|
|
739
747
|
<div
|
|
740
748
|
{...mergeProps(
|
|
@@ -800,9 +808,12 @@ export function Banner({
|
|
|
800
808
|
icon={<Icon icon="close" size="sm" color="inherit" />}
|
|
801
809
|
onClick={handleDismiss}
|
|
802
810
|
className={
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
811
|
+
mergeProps(
|
|
812
|
+
themeProps('banner-close'),
|
|
813
|
+
hasStatusStyle(status)
|
|
814
|
+
? stylex.props(statusControlStyles[status])
|
|
815
|
+
: {},
|
|
816
|
+
).className
|
|
806
817
|
}
|
|
807
818
|
isIconOnly
|
|
808
819
|
/>
|
|
@@ -91,7 +91,10 @@ export const docs = {
|
|
|
91
91
|
},
|
|
92
92
|
theming: {
|
|
93
93
|
container: true,
|
|
94
|
-
targets: [
|
|
94
|
+
targets: [
|
|
95
|
+
{className: 'astryx-bottom-sheet', visualProps: []},
|
|
96
|
+
{className: 'astryx-bottom-sheet-handle'},
|
|
97
|
+
],
|
|
95
98
|
derived: [{property: 'padding', expand: 'container'}],
|
|
96
99
|
},
|
|
97
100
|
description:
|
|
@@ -152,7 +155,7 @@ export const docs = {
|
|
|
152
155
|
name: 'height',
|
|
153
156
|
type: "'hug' | 'capped' | 'tall' | number | string",
|
|
154
157
|
description:
|
|
155
|
-
"How tall the sheet is. Named budgets: 'hug' fits its content up to 92% of the viewport, 'capped' is a scrolling mid-height panel (~62%), and 'tall' is a pinned near-full panel (~92%) for content that streams in. Or pass a number (px) / CSS length for a custom budget. Give snapPoints to let the user drag between heights. On shorter viewports the sheet fills the available height. Only a fully expanded 'tall' sheet provides mobile-keyboard accommodation: it stays put and scrolls each focused control above the keyboard. Hug, Capped, numeric and CSS-length heights never do, and a Tall sheet stops doing it the moment the user drags it to a shorter detent, resuming when they drag it back. Outside that state the sheet neither moves nor adds keyboard scroll space,
|
|
158
|
+
"How tall the sheet is. Named budgets: 'hug' fits its content up to 92% of the viewport, 'capped' is a scrolling mid-height panel (~62%), and 'tall' is a pinned near-full panel (~92%) for content that streams in. Or pass a number (px) / CSS length for a custom budget. Give snapPoints to let the user drag between heights. On shorter viewports the sheet fills the available height. Only a fully expanded 'tall' sheet provides mobile-keyboard accommodation: it stays put and scrolls each focused control above the keyboard. Hug, Capped, numeric and CSS-length heights never do, and a Tall sheet stops doing it the moment the user drags it to a shorter detent, resuming when they drag it back. Outside that state the sheet neither moves nor adds keyboard scroll space. A TextInput, TextArea or NumberInput in it is scrolled above the keyboard by a scroller in the sheet when that scroller can bring it there; otherwise the page brings it into view, which on iOS can shift the whole page. In Firefox for Android, where the page cannot scroll further, the field can stay under the keyboard. This accommodation applies where the visual viewport shrinks for the keyboard, as in Safari on iOS, Firefox for Android and Chrome on Android, where the sheet places the focused control just above the keyboard as it comes up, and the control rides the rest of Gboard\u2019s slide up, and the slide down after it loses focus; a hide Chrome reports late, such as Back, rides down from Chrome\u2019s report (`astryx docs browser-support`).",
|
|
156
159
|
default: "'capped'",
|
|
157
160
|
},
|
|
158
161
|
{
|
|
@@ -172,7 +175,7 @@ export const docs = {
|
|
|
172
175
|
usage: {
|
|
173
176
|
anatomy,
|
|
174
177
|
description:
|
|
175
|
-
"A mobile touch surface for filters, actions, forms, and detail views that should rise from the bottom of the viewport. For a multi-step flow, give each step its own sheet and one state value that names the open step (see Replacing a sheet); open a second sheet over the first when a step should stay visible beneath it.\n\nStacking. Every sheet keeps its own isOpen. Open a sheet while another scrim sheet is open and it stacks on top: the sheet beneath stays mounted with its scroll position and inputs, recedes behind the new one (the nearest covered sheet shrinks to 0.96 and lifts 8px, deeper ones to 0.92 and 16px), and is blocked from pointer, keyboard, and assistive technology by the top sheet's modal dialog. The sheets can be siblings, live in separate components, sit inside another sheet's content, or sit inside a BottomSheetSwitcher step; a whole switcher is one level, and switching its step in place does not change its position. Nothing moves in the DOM: each sheet's dialog stays where it is written, and no wrapper component is needed.\n\nOrder is open order. The top sheet is the one presented most recently that is still open; a sheet that closes and reopens comes back on top. When several sheets open in one update (a deep link into a flow), there is no open order between them, so tree order decides: a sheet below the sheets rendered in its content, siblings in the order they are written. That order is right in the first painted frame.\n\nOne scrim. Only the bottom sheet's backdrop dims the page; the backdrops of the sheets above it are transparent, so a stack never darkens per level. The dim holds steady while sheets push and pop, and if the bottom sheet closes while sheets remain above it, the next sheet's backdrop takes over in the same frame.\n\nDismissal. Escape, a tap on the scrim, a downward swipe, and a platform close request (Android back, a close watcher) reach only the top sheet, through that sheet's own onOpenChange, and that sheet's purpose applies: required blocks all of them, form blocks the scrim and the swipe. Nothing closes a whole stack at once; set every sheet closed in one update when a flow is done and they leave together.\n\nClosing a covered sheet from code. Sheets rendered inside the closing sheet's content are part of it: they are presented only while it is open and leave with it. Their isOpen stays yours, as with a Dialog rendered in a closed Dialog: nothing is written to it, and a nested sheet that is still open when its host reopens is presented again, on top. Set it closed yourself when the flow is done. Sheets above the closing sheet that are not in its content stay open and keep their order; the closing sheet slides out from beneath them, and if it owned the scrim, the sheet above takes it over.\n\nReplacing a sheet. Close the top sheet and open another in the same update (one state value that names the open step does this) and the new sheet replaces it instead of stacking on it: the new sheet rises above the one it replaces; if the replaced sheet is taller it moves down to meet the new sheet's top edge at the same time; the replaced sheet fades only after both motions finish, and is inert and hidden from assistive technology from the start. The scrim holds steady throughout, with no dip; focus moves into the new sheet; and when the flow closes, focus returns to the element that opened its first sheet, whichever sheet closed last. This is the handoff the deprecated BottomSheetSwitcher ran between its steps; a multi-step flow needs no switcher: give each step its own BottomSheet and one state value. A replace happens only when exactly one sheet closes and one opens in the update, the closing sheet was the top sheet of its stack, and the move was made from inside it (the control last pressed, or with no recent press the focused element, was in the closing sheet, as a step's own Continue or Back button is); a covered sheet closing while a sheet opens, a close and an open in different updates, or a close and an open driven from a control outside the closing sheet (two unrelated owners acting at once) keep the ordinary push and pop motion and their own focus return. A replace over an open stack runs one level up and leaves the sheets beneath covered. Non-modal sheets (hasScrim={false}) replace each other the same way, with no scrim: they are hosted in the browser top layer as manual popovers, so the entering step orders above the retained one with no page-level z-index, and toasts raised before or while the sheet is open stay above it. Below the Popover API support floor (Tier 2 in the browser support guide) the sheet falls back to show() in page stacking order: usable, but with no promise over later page content. A non-modal sheet returns focus to its opener on close only while focus is still inside it; focus taken elsewhere on the live page stays there.\n\nFocus. Opening a sheet, modal or not, focuses its data-autofocus field (a TextInput with hasAutoFocus) in every browser. Without one, focus goes wherever the engine's native dialog focusing steps land: the panel in Chromium, the first focusable control in Firefox. A step entering as a replacement also focuses a data-autofocus descendant first, so a flow that opens on a field keeps the keyboard on it. Closing the top sheet returns focus into the sheet it reveals: to the control that opened it when that control is still there, otherwise to the revealed sheet's panel. When the last sheet closes, the standalone rules apply: finalFocusRef, else the element that opened the sheet, with a focus ring only after keyboard input. When every sheet of a stack closes in one update, focus returns once, to the bottom sheet's finalFocusRef or opener, after the last dialog has closed.\n\nCaveats. A Dialog, AlertDialog, or Popover opened from a sheet paints above the sheet and does not make it recede; a sheet opened from inside that Dialog paints above the Dialog and stacks over the sheet beneath. Sheets with hasScrim={false} stay out of the stack entirely (they replace each other, but never stack, recede, or take the scrim). A sheet React hides (a suspended Suspense boundary, Activity mode=\"hidden\") leaves the stack and closes its dialog; when it is shown again it is presented again, on top. Only sheets rendered in the same document stack; a sheet inside an iframe is its own stack.",
|
|
178
|
+
"A mobile touch surface for filters, actions, forms, and detail views that should rise from the bottom of the viewport. For a multi-step flow, give each step its own sheet and one state value that names the open step (see Replacing a sheet); open a second sheet over the first when a step should stay visible beneath it.\n\nStacking. Every sheet keeps its own isOpen. Open a sheet while another scrim sheet is open and it stacks on top: the sheet beneath stays mounted with its scroll position and inputs, recedes behind the new one (the nearest covered sheet shrinks to 0.96 and lifts 8px, deeper ones to 0.92 and 16px), and is blocked from pointer, keyboard, and assistive technology by the top sheet's modal dialog. The sheets can be siblings, live in separate components, sit inside another sheet's content, or sit inside a BottomSheetSwitcher step; a whole switcher is one level, and switching its step in place does not change its position. Nothing moves in the DOM: each sheet's dialog stays where it is written, and no wrapper component is needed.\n\nOrder is open order. The top sheet is the one presented most recently that is still open; a sheet that closes and reopens comes back on top. When several sheets open in one update (a deep link into a flow), there is no open order between them, so tree order decides: a sheet below the sheets rendered in its content, siblings in the order they are written. That order is right in the first painted frame.\n\nOne scrim. Only the bottom sheet's backdrop dims the page; the backdrops of the sheets above it are transparent, so a stack never darkens per level. The dim holds steady while sheets push and pop, and if the bottom sheet closes while sheets remain above it, the next sheet's backdrop takes over in the same frame.\n\nDismissal. Escape, a tap on the scrim, a downward swipe, and a platform close request (Android back, a close watcher) reach only the top sheet, through that sheet's own onOpenChange, and that sheet's purpose applies: required blocks all of them, form blocks the scrim and the swipe. Nothing closes a whole stack at once; set every sheet closed in one update when a flow is done and they leave together.\n\nClosing a covered sheet from code. Sheets rendered inside the closing sheet's content are part of it: they are presented only while it is open and leave with it. Their isOpen stays yours, as with a Dialog rendered in a closed Dialog: nothing is written to it, and a nested sheet that is still open when its host reopens is presented again, on top. Set it closed yourself when the flow is done. Sheets above the closing sheet that are not in its content stay open and keep their order; the closing sheet slides out from beneath them, and if it owned the scrim, the sheet above takes it over.\n\nReplacing a sheet. Close the top sheet and open another in the same update (one state value that names the open step does this) and the new sheet replaces it instead of stacking on it: the new sheet rises above the one it replaces; if the replaced sheet is taller it moves down to meet the new sheet's top edge at the same time; the replaced sheet fades only after both motions finish, and is inert and hidden from assistive technology from the start. The scrim holds steady throughout, with no dip; focus moves into the new sheet; and when the flow closes, focus returns to the element that opened its first sheet, whichever sheet closed last. This is the handoff the deprecated BottomSheetSwitcher ran between its steps; a multi-step flow needs no switcher: give each step its own BottomSheet and one state value. A replace happens only when exactly one sheet closes and one opens in the update, the closing sheet was the top sheet of its stack, and the move was made from inside it (the control last pressed, or with no recent press the focused element, was in the closing sheet, as a step's own Continue or Back button is); a covered sheet closing while a sheet opens, a close and an open in different updates, or a close and an open driven from a control outside the closing sheet (two unrelated owners acting at once) keep the ordinary push and pop motion and their own focus return. A replace over an open stack runs one level up and leaves the sheets beneath covered. Non-modal sheets (hasScrim={false}) replace each other the same way, with no scrim: they are hosted in the browser top layer as manual popovers, so the entering step orders above the retained one with no page-level z-index, and toasts raised before or while the sheet is open stay above it. Below the Popover API support floor (Tier 2 in the browser support guide) the sheet falls back to show() in page stacking order: usable, but with no promise over later page content. A non-modal sheet returns focus to its opener on close only while focus is still inside it; focus taken elsewhere on the live page stays there.\n\nFocus. Opening a sheet, modal or not, focuses its data-autofocus field (a TextInput with hasAutoFocus) in every browser. Without one, focus goes wherever the engine's native dialog focusing steps land: the panel in Chromium, and in Safari on iOS for a modal sheet; the first focusable control in Firefox. So to open on a field in every browser, mark it data-autofocus (a TextInput with hasAutoFocus). A step entering as a replacement also focuses a data-autofocus descendant first, so a flow that opens on a field keeps the keyboard on it. Closing the top sheet returns focus into the sheet it reveals: to the control that opened it when that control is still there, otherwise to the revealed sheet's panel. When the last sheet closes, the standalone rules apply: finalFocusRef, else the element that opened the sheet, with a focus ring only after keyboard input. When every sheet of a stack closes in one update, focus returns once, to the bottom sheet's finalFocusRef or opener, after the last dialog has closed.\n\nCaveats. A Dialog, AlertDialog, or Popover opened from a sheet paints above the sheet and does not make it recede; a sheet opened from inside that Dialog paints above the Dialog and stacks over the sheet beneath. Sheets with hasScrim={false} stay out of the stack entirely (they replace each other, but never stack, recede, or take the scrim). A sheet React hides (a suspended Suspense boundary, Activity mode=\"hidden\") leaves the stack and closes its dialog; when it is shown again it is presented again, on top. Only sheets rendered in the same document stack; a sheet inside an iframe is its own stack.",
|
|
176
179
|
bestPractices: [
|
|
177
180
|
{
|
|
178
181
|
guidance: true,
|
|
@@ -1002,6 +1002,7 @@ function SwitcherBottomSheetItem({
|
|
|
1002
1002
|
registerSheetDialog,
|
|
1003
1003
|
registerSheetPurpose,
|
|
1004
1004
|
onBeforeSheetPresent,
|
|
1005
|
+
onBeforeSheetShow,
|
|
1005
1006
|
isCoveredInTopLayer,
|
|
1006
1007
|
onSheetEnterStart,
|
|
1007
1008
|
onSheetTransitionComplete,
|
|
@@ -1166,6 +1167,7 @@ function SwitcherBottomSheetItem({
|
|
|
1166
1167
|
presentWithClearScrim(dialog);
|
|
1167
1168
|
}
|
|
1168
1169
|
} else {
|
|
1170
|
+
onBeforeSheetShow();
|
|
1169
1171
|
dialog.show();
|
|
1170
1172
|
}
|
|
1171
1173
|
}
|
|
@@ -1177,6 +1179,7 @@ function SwitcherBottomSheetItem({
|
|
|
1177
1179
|
isInteractive,
|
|
1178
1180
|
isPresented,
|
|
1179
1181
|
onBeforeSheetPresent,
|
|
1182
|
+
onBeforeSheetShow,
|
|
1180
1183
|
ownsScrim,
|
|
1181
1184
|
sheetId,
|
|
1182
1185
|
]);
|
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
} from '../theme/tokens.stylex';
|
|
51
51
|
import {mergeProps} from '../utils/mergeProps';
|
|
52
52
|
import {themeProps} from '../utils/themeProps';
|
|
53
|
+
import {LayoutContainerContext} from '../Layout/LayoutContainerContext';
|
|
53
54
|
import {focusOutlineStyles} from '../utils/focusOutline.stylex';
|
|
54
55
|
import {layerTextReset} from '../Layer/layerTextReset.stylex';
|
|
55
56
|
import {layerStructureReset} from '../Layer/layerStructureReset.stylex';
|
|
@@ -861,16 +862,16 @@ export function BottomSheetPanel({
|
|
|
861
862
|
if (keyedSnapPoints.key !== snapPointsKey) {
|
|
862
863
|
setKeyedSnapPoints({key: snapPointsKey, points: snapPoints});
|
|
863
864
|
}
|
|
864
|
-
const {snapHeights,
|
|
865
|
+
const {snapHeights, ignoredSnapPointsWarning} = useMemo(() => {
|
|
865
866
|
const {key, points} = keyedSnapPoints;
|
|
866
867
|
if (key === '') {
|
|
867
|
-
return {snapHeights: undefined,
|
|
868
|
+
return {snapHeights: undefined, ignoredSnapPointsWarning: ''};
|
|
868
869
|
}
|
|
869
870
|
const ignored = (points ?? []).filter(point => !isValidSnapPoint(point));
|
|
870
871
|
return {
|
|
871
872
|
snapHeights: () =>
|
|
872
873
|
resolveSnapPoints(points ?? [], layoutViewportHeight()),
|
|
873
|
-
|
|
874
|
+
ignoredSnapPointsWarning:
|
|
874
875
|
ignored.length === 0
|
|
875
876
|
? ''
|
|
876
877
|
: `snapPoints ignored ${JSON.stringify(ignored)}. A snap point is a viewport fraction above 0 and up to 1 (0.5 is half the screen), a px length ('320px'), or a percentage ('50%').`,
|
|
@@ -878,8 +879,8 @@ export function BottomSheetPanel({
|
|
|
878
879
|
}, [keyedSnapPoints]);
|
|
879
880
|
useDevWarning(
|
|
880
881
|
'BottomSheet',
|
|
881
|
-
|
|
882
|
-
|
|
882
|
+
ignoredSnapPointsWarning,
|
|
883
|
+
ignoredSnapPointsWarning !== '',
|
|
883
884
|
);
|
|
884
885
|
|
|
885
886
|
// A caller's height owns the element's height: the drag never writes it.
|
|
@@ -1298,7 +1299,10 @@ export function BottomSheetPanel({
|
|
|
1298
1299
|
)}>
|
|
1299
1300
|
<div
|
|
1300
1301
|
ref={handleRef}
|
|
1301
|
-
{...
|
|
1302
|
+
{...mergeProps(
|
|
1303
|
+
themeProps('bottom-sheet-handle'),
|
|
1304
|
+
stylex.props(styles.handleBar),
|
|
1305
|
+
)}
|
|
1302
1306
|
{...handleProps}
|
|
1303
1307
|
aria-hidden="true"
|
|
1304
1308
|
/>
|
|
@@ -1357,7 +1361,11 @@ export function BottomSheetPanel({
|
|
|
1357
1361
|
),
|
|
1358
1362
|
),
|
|
1359
1363
|
)}>
|
|
1360
|
-
<LayerContentBoundary>
|
|
1364
|
+
<LayerContentBoundary>
|
|
1365
|
+
<LayoutContainerContext value="bottom-sheet">
|
|
1366
|
+
{children}
|
|
1367
|
+
</LayoutContainerContext>
|
|
1368
|
+
</LayerContentBoundary>
|
|
1361
1369
|
</div>
|
|
1362
1370
|
</div>
|
|
1363
1371
|
</div>
|
|
@@ -94,6 +94,10 @@ import {
|
|
|
94
94
|
type BottomSheetSwitcherPhase,
|
|
95
95
|
type BottomSheetSwitcherTransitionEvent,
|
|
96
96
|
} from './BottomSheetSwitcherContext';
|
|
97
|
+
import {
|
|
98
|
+
prepareFocusRepairOnRemoval,
|
|
99
|
+
returnFocusForLastInput,
|
|
100
|
+
} from '../utils/focusReturn';
|
|
97
101
|
|
|
98
102
|
const styles = stylex.create({
|
|
99
103
|
// A scrim flow's dialogs live in the top layer; the wrapper has no box.
|
|
@@ -568,6 +572,36 @@ export function BottomSheetSwitcher({
|
|
|
568
572
|
presentationCounterRef.current += 1;
|
|
569
573
|
presentationOrderRef.current.set(sheetId, presentationCounterRef.current);
|
|
570
574
|
}, []);
|
|
575
|
+
// The step dialogs can render outside the flow's element, so focus counts as
|
|
576
|
+
// inside the flow when the flow or one of its step dialogs holds it.
|
|
577
|
+
const holdsFocus = useCallback(
|
|
578
|
+
(active: Element | null): boolean =>
|
|
579
|
+
active != null &&
|
|
580
|
+
(flowRef.current?.contains(active) === true ||
|
|
581
|
+
[...sheetDialogsRef.current.values()].some(dialog =>
|
|
582
|
+
dialog.contains(active),
|
|
583
|
+
)),
|
|
584
|
+
[],
|
|
585
|
+
);
|
|
586
|
+
// Whether focus was in the flow when the flow closed. Read in the commit
|
|
587
|
+
// that closes it: the closing step is marked inert in that commit, and the
|
|
588
|
+
// browser moves focus out of it only when it next renders.
|
|
589
|
+
const hadFocusAtCloseRef = useRef(false);
|
|
590
|
+
const previousActiveSheetRef = useRef(activeSheet);
|
|
591
|
+
// Syncs with document focus: records whether the flow held it in the commit
|
|
592
|
+
// that closes the flow.
|
|
593
|
+
useLayoutEffect(() => {
|
|
594
|
+
const wasOpen = previousActiveSheetRef.current != null;
|
|
595
|
+
previousActiveSheetRef.current = activeSheet;
|
|
596
|
+
if (wasOpen && activeSheet == null) {
|
|
597
|
+
hadFocusAtCloseRef.current = holdsFocus(document.activeElement);
|
|
598
|
+
}
|
|
599
|
+
}, [activeSheet, holdsFocus]);
|
|
600
|
+
const onBeforeSheetShow = useCallback(() => {
|
|
601
|
+
if (triggerRef.current == null) {
|
|
602
|
+
triggerRef.current = document.activeElement as HTMLElement | null;
|
|
603
|
+
}
|
|
604
|
+
}, []);
|
|
571
605
|
// Syncs document focus with the flow's visibility. When the flow hides, focus
|
|
572
606
|
// goes to the opener, to the sheet now on top, or to the target of the
|
|
573
607
|
// registry.
|
|
@@ -607,11 +641,47 @@ export function BottomSheetSwitcher({
|
|
|
607
641
|
trigger?.focus({preventScroll: true});
|
|
608
642
|
}
|
|
609
643
|
}
|
|
644
|
+
} else if (!hasScrim) {
|
|
645
|
+
// A flow without the scrim keeps the native dialog's return rule: focus
|
|
646
|
+
// goes back to the opener only while it is still inside the flow.
|
|
647
|
+
const trigger = triggerRef.current;
|
|
648
|
+
const active = document.activeElement;
|
|
649
|
+
const isFocusLeftInFlow =
|
|
650
|
+
active == null || active === document.body || holdsFocus(active);
|
|
651
|
+
if (
|
|
652
|
+
hadFocusAtCloseRef.current &&
|
|
653
|
+
isFocusLeftInFlow &&
|
|
654
|
+
trigger?.isConnected === true
|
|
655
|
+
) {
|
|
656
|
+
returnFocusForLastInput(trigger);
|
|
657
|
+
}
|
|
610
658
|
}
|
|
659
|
+
hadFocusAtCloseRef.current = false;
|
|
611
660
|
triggerRef.current = null;
|
|
612
661
|
modalFlowRef.current = false;
|
|
613
662
|
presentationOrderRef.current.clear();
|
|
614
|
-
}, [hasScrim, isFlowVisible]);
|
|
663
|
+
}, [hasScrim, holdsFocus, isFlowVisible]);
|
|
664
|
+
|
|
665
|
+
// A flow removed while a sheet is open runs no close, so focus would drop to
|
|
666
|
+
// the page. After the commit, the shared repair returns focus to the opener
|
|
667
|
+
// when the removal lost it, as a standalone sheet's does.
|
|
668
|
+
useLayoutEffect(() => {
|
|
669
|
+
const flow = flowRef.current;
|
|
670
|
+
if (!isFlowVisible || flow == null) {
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
const repairOnRemoval = prepareFocusRepairOnRemoval(flow, {
|
|
674
|
+
keepRestingFocus: true,
|
|
675
|
+
});
|
|
676
|
+
return () => {
|
|
677
|
+
const opener = triggerRef.current;
|
|
678
|
+
repairOnRemoval(() => {
|
|
679
|
+
if (opener != null && opener.isConnected) {
|
|
680
|
+
returnFocusForLastInput(opener);
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
};
|
|
684
|
+
}, [isFlowVisible]);
|
|
615
685
|
|
|
616
686
|
// A scrim flow is one level of the bottom-sheet stack while it is visible.
|
|
617
687
|
// The step hosts present their own dialogs; the registry re-presents the
|
|
@@ -1036,6 +1106,7 @@ export function BottomSheetSwitcher({
|
|
|
1036
1106
|
registerSheetDialog,
|
|
1037
1107
|
registerSheetPurpose,
|
|
1038
1108
|
onBeforeSheetPresent,
|
|
1109
|
+
onBeforeSheetShow,
|
|
1039
1110
|
isCoveredInTopLayer,
|
|
1040
1111
|
onSheetEnterStart,
|
|
1041
1112
|
onSheetTransitionComplete,
|
|
@@ -1058,6 +1129,7 @@ export function BottomSheetSwitcher({
|
|
|
1058
1129
|
isScrimOwner,
|
|
1059
1130
|
onActiveSheetChange,
|
|
1060
1131
|
onBeforeSheetPresent,
|
|
1132
|
+
onBeforeSheetShow,
|
|
1061
1133
|
onDialogCancel,
|
|
1062
1134
|
onDialogClick,
|
|
1063
1135
|
onDialogKeyDown,
|