@astryxdesign/core 0.7.9-canary.e657e2e → 0.7.9-canary.eaea67d
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/dist/AlertDialog/AlertDialog.d.ts +3 -2
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +11 -14
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +31 -2
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +36 -9
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +3 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +11 -2
- package/dist/ButtonGroup/ButtonGroup.d.ts +2 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +28 -5
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +10 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +2 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +8 -1
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +12 -4
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +21 -12
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +5 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +2 -1
- package/dist/DateInput/wheelStrip.js +2 -2
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +35 -10
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +3 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts +2 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +42 -8
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +19 -9
- package/dist/Icon/ComponentIcon.d.ts +33 -0
- package/dist/Icon/ComponentIcon.d.ts.map +1 -0
- package/dist/Icon/ComponentIcon.js +56 -0
- package/dist/Icon/globalIconRegistry.d.ts +45 -4
- package/dist/Icon/globalIconRegistry.d.ts.map +1 -1
- package/dist/Icon/globalIconRegistry.js +137 -3
- package/dist/Icon/index.d.ts +73 -2
- package/dist/Icon/index.d.ts.map +1 -1
- package/dist/Icon/index.js +42 -3
- package/dist/Icon/useIcon.d.ts +13 -4
- package/dist/Icon/useIcon.d.ts.map +1 -1
- package/dist/Icon/useIcon.js +16 -5
- package/dist/InputGroup/InputGroupText.d.ts +2 -1
- package/dist/InputGroup/InputGroupText.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupText.js +2 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +13 -3
- package/dist/Layer/LayerProvider.d.ts.map +1 -1
- package/dist/Layer/LayerProvider.js +8 -7
- package/dist/Layer/LayerTouch.d.ts +13 -0
- package/dist/Layer/LayerTouch.d.ts.map +1 -0
- package/dist/Layer/LayerTouch.js +16 -0
- package/dist/Layer/holdEntranceInput.d.ts.map +1 -1
- package/dist/Layer/holdEntranceInput.js +4 -2
- package/dist/Layer/layerKeyboardClearance.d.ts +41 -0
- package/dist/Layer/layerKeyboardClearance.d.ts.map +1 -0
- package/dist/Layer/layerKeyboardClearance.js +51 -0
- package/dist/Layer/layerViewportInset.stylex.d.ts +5 -1
- package/dist/Layer/layerViewportInset.stylex.d.ts.map +1 -1
- package/dist/Layer/layerViewportInset.stylex.js +11 -4
- package/dist/Layer/outsidePress.d.ts +4 -0
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +18 -1
- package/dist/Layer/settledBox.d.ts +16 -0
- package/dist/Layer/settledBox.d.ts.map +1 -0
- package/dist/Layer/settledBox.js +117 -0
- package/dist/Layer/toastHost.d.ts +77 -0
- package/dist/Layer/toastHost.d.ts.map +1 -0
- package/dist/Layer/toastHost.js +172 -0
- package/dist/Layer/useBackdropPress.d.ts +8 -0
- package/dist/Layer/useBackdropPress.d.ts.map +1 -1
- package/dist/Layer/useBackdropPress.js +31 -2
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +36 -106
- package/dist/Layer/useLayerKeyboardClearance.d.ts +54 -0
- package/dist/Layer/useLayerKeyboardClearance.d.ts.map +1 -0
- package/dist/Layer/useLayerKeyboardClearance.js +330 -0
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +4 -0
- package/dist/Layout/LayoutPanel.d.ts.map +1 -1
- package/dist/Layout/LayoutPanel.js +12 -3
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +5 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +7 -2
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +28 -28
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +7 -2
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +28 -10
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +1 -0
- package/dist/Resizable/resizablePane.d.ts +0 -2
- package/dist/Resizable/resizablePane.d.ts.map +1 -1
- package/dist/Resizable/resizablePane.js +2 -7
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +16 -56
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +45 -18
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +0 -2
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +7 -4
- package/dist/Slider/sliderTouchController.js +2 -2
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +27 -5
- package/dist/Spinner/SpinnerOwnerContext.d.ts +2 -0
- package/dist/Spinner/SpinnerOwnerContext.d.ts.map +1 -0
- package/dist/Spinner/SpinnerOwnerContext.js +20 -0
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
- package/dist/Switch/useSwitchTouch.js +13 -9
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +5 -1
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +1 -0
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +2 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +27 -5
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +16 -8
- package/dist/Timestamp/TimestampHoverCard.d.ts +2 -1
- package/dist/Timestamp/TimestampHoverCard.d.ts.map +1 -1
- package/dist/Timestamp/TimestampHoverCard.js +12 -5
- package/dist/Toast/Toast.js +4 -4
- package/dist/Toast/ToastContext.d.ts +6 -13
- package/dist/Toast/ToastContext.d.ts.map +1 -1
- package/dist/Toast/ToastContext.js +6 -8
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +75 -10
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +10 -50
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +17 -10
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +19 -9
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +2 -0
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +7 -2
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +18 -7
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +11 -4
- package/dist/animator/createAnimator.js +2 -2
- package/dist/astryx.css +20 -4
- package/dist/gestures/createPanGesture.d.ts +49 -0
- package/dist/gestures/createPanGesture.d.ts.map +1 -0
- package/dist/gestures/createPanGesture.js +80 -0
- package/dist/hooks/actionGroupTracker.d.ts +9 -0
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +38 -24
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/pressGroupContext.d.ts +5 -3
- package/dist/hooks/pressGroupContext.d.ts.map +1 -1
- package/dist/hooks/pressGroupContext.js +17 -9
- package/dist/hooks/useActionGroupTracking.d.ts +29 -4
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -1
- package/dist/hooks/useActionGroupTracking.js +92 -14
- package/dist/hooks/useAnnounceRenderedText.d.ts +10 -2
- package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +45 -8
- package/dist/hooks/useGroupPressTracking.d.ts +34 -0
- package/dist/hooks/useGroupPressTracking.d.ts.map +1 -0
- package/dist/hooks/useGroupPressTracking.js +122 -0
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +7 -0
- package/dist/hooks/useOverflow.d.ts +10 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +25 -3
- package/dist/hooks/usePanGesture.d.ts +32 -0
- package/dist/hooks/usePanGesture.d.ts.map +1 -0
- package/dist/hooks/usePanGesture.js +67 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +2 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/internal/touch.d.ts +19 -6
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +25 -8
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +10 -7
- package/dist/motion/animator.d.ts +5 -5
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +10 -8
- package/dist/motion/resolveMotion.d.ts +6 -27
- package/dist/motion/resolveMotion.d.ts.map +1 -1
- package/dist/motion/resolveMotion.js +82 -16
- package/dist/motion/themeTempo.d.ts +7 -0
- package/dist/motion/themeTempo.d.ts.map +1 -0
- package/dist/motion/themeTempo.js +38 -0
- package/dist/motion/themeTiming.d.ts +63 -0
- package/dist/motion/themeTiming.d.ts.map +1 -0
- package/dist/motion/themeTiming.js +173 -0
- package/dist/privateAttributes/focusOwner.stylex.d.ts +22 -0
- package/dist/privateAttributes/focusOwner.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/focusOwner.stylex.js +39 -0
- package/dist/privateAttributes/press.stylex.d.ts +5 -1
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/press.stylex.js +6 -1
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +8 -5
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/pressGroupItem.stylex.js +11 -5
- package/dist/theme/defineTheme.d.ts +42 -3
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +48 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +4 -1
- package/dist/theme/resolveThemeValues.d.ts.map +1 -1
- package/dist/theme/resolveThemeValues.js +12 -4
- package/dist/theme/themeMotion.d.ts +7 -5
- package/dist/theme/themeMotion.d.ts.map +1 -1
- package/dist/theme/themeMotion.js +7 -5
- package/dist/utils/focusReturn.d.ts +24 -11
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +48 -14
- package/dist/utils/hitArea.d.ts +28 -2
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +49 -11
- package/dist/utils/touchHitArea.d.ts +25 -6
- package/dist/utils/touchHitArea.d.ts.map +1 -1
- package/dist/utils/touchHitArea.js +22 -12
- package/dist/utils/touchHitArea.stylex.d.ts +29 -5
- package/dist/utils/touchHitArea.stylex.d.ts.map +1 -1
- package/dist/utils/touchHitArea.stylex.js +37 -6
- package/locales/en.json +4 -0
- package/locales/pseudo.json +3 -0
- package/package.json +4 -4
- package/src/AlertDialog/AlertDialog.tsx +9 -13
- package/src/BottomSheet/BottomSheet.tsx +39 -2
- package/src/BottomSheet/useSheetGestures.ts +41 -10
- package/src/Breadcrumbs/BreadcrumbItem.tsx +7 -1
- package/src/Button/Button.tsx +17 -2
- package/src/ButtonGroup/ButtonGroup.doc.mjs +3 -2
- package/src/ButtonGroup/ButtonGroup.tsx +28 -4
- package/src/Calendar/useCalendarDays.doc.mjs +158 -0
- package/src/Chat/ChatMessageList.tsx +18 -2
- package/src/CheckboxInput/CheckboxInput.tsx +5 -1
- package/src/CheckboxList/CheckboxListItem.tsx +7 -4
- package/src/CodeBlock/CodeBlock.doc.mjs +17 -0
- package/src/CodeBlock/CodeBlock.tsx +11 -2
- package/src/ComplexSelector/ComplexSelector.doc.mjs +2 -2
- package/src/ComplexSelector/ComplexSelector.tsx +39 -31
- package/src/ContextMenu/ContextMenu.tsx +9 -1
- package/src/DateInput/DateInput.tsx +2 -0
- package/src/DateInput/wheelStrip.ts +2 -2
- package/src/DateTimeInput/DateTimeInput.tsx +37 -13
- package/src/Drawer/Drawer.tsx +3 -1
- package/src/DropdownMenu/DropdownMenu.tsx +48 -10
- package/src/HoverCard/HoverCard.tsx +4 -1
- package/src/Icon/ComponentIcon.tsx +71 -0
- package/src/Icon/globalIconRegistry.tsx +181 -4
- package/src/Icon/index.ts +85 -2
- package/src/Icon/useIcon.doc.mjs +94 -0
- package/src/Icon/useIcon.ts +24 -3
- package/src/InputGroup/InputGroupText.doc.mjs +45 -3
- package/src/InputGroup/InputGroupText.tsx +2 -1
- package/src/Item/Item.doc.mjs +19 -4
- package/src/Item/Item.tsx +21 -2
- package/src/Layer/LayerProvider.tsx +9 -8
- package/src/Layer/LayerTouch.ts +17 -0
- package/src/Layer/holdEntranceInput.ts +4 -2
- package/src/Layer/layerKeyboardClearance.ts +55 -0
- package/src/Layer/layerViewportInset.stylex.ts +16 -5
- package/src/Layer/outsidePress.ts +18 -1
- package/src/Layer/settledBox.ts +138 -0
- package/src/Layer/toastHost.tsx +212 -0
- package/src/Layer/useBackdropPress.ts +41 -1
- package/src/Layer/useLayer.tsx +41 -123
- package/src/Layer/useLayerKeyboardClearance.ts +371 -0
- package/src/Layer/useTouchTrigger.ts +4 -0
- package/src/Layout/LayoutPanel.tsx +16 -2
- package/src/Link/Link.tsx +5 -1
- package/src/Link/useLinkComponent.doc.mjs +95 -0
- package/src/MultiSelector/MultiSelector.tsx +24 -2
- package/src/MultiSelector/hooks.ts +28 -35
- package/src/MultiSelector/useMultiCombobox.doc.mjs +2 -2
- package/src/OverflowList/OverflowList.tsx +15 -9
- package/src/Overlay/useOverlay.doc.mjs +176 -0
- package/src/Pagination/Pagination.tsx +23 -9
- package/src/Popover/Popover.tsx +5 -0
- package/src/Resizable/resizablePane.ts +4 -13
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +15 -62
- package/src/Selector/Selector.tsx +71 -9
- package/src/SideNav/SideNav.tsx +0 -1
- package/src/SideNav/SideNavItem.tsx +8 -6
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Spinner/Spinner.doc.mjs +150 -36
- package/src/Spinner/Spinner.tsx +34 -6
- package/src/Spinner/SpinnerOwnerContext.ts +22 -0
- package/src/Switch/useSwitchTouch.ts +17 -9
- package/src/TabList/Tab.tsx +5 -1
- package/src/TabList/TabList.tsx +1 -0
- package/src/Table/Table.doc.mjs +34 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +32 -7
- package/src/Table/plugins/sortable/useTableSortable.tsx +19 -12
- package/src/Table/plugins/sortable/useTableSortableState.doc.mjs +173 -0
- package/src/Timestamp/Timestamp.doc.mjs +17 -0
- package/src/Timestamp/TimestampHoverCard.tsx +11 -3
- package/src/Toast/Toast.doc.mjs +14 -0
- package/src/Toast/Toast.tsx +2 -2
- package/src/Toast/ToastContext.ts +7 -17
- package/src/Toast/ToastViewport.tsx +53 -9
- package/src/Toast/useToast.tsx +7 -52
- package/src/Tokenizer/Tokenizer.tsx +14 -10
- package/src/Tooltip/Tooltip.tsx +4 -1
- package/src/Tooltip/useTooltip.tsx +2 -0
- package/src/TopNav/TopNavItem.tsx +7 -2
- package/src/Typeahead/BaseTypeahead.tsx +34 -8
- package/src/Typeahead/Typeahead.tsx +7 -1
- package/src/animator/createAnimator.doc.mjs +1 -1
- package/src/animator/createAnimator.ts +3 -3
- package/src/gestures/README.md +2 -1
- package/src/gestures/createPanGesture.doc.mjs +145 -0
- package/src/gestures/createPanGesture.ts +107 -0
- package/src/hooks/actionGroupTracker.ts +33 -24
- package/src/hooks/index.ts +8 -0
- package/src/hooks/pressGroupContext.ts +18 -9
- package/src/hooks/useActionGroupTracking.ts +139 -19
- package/src/hooks/useAnimatedLayout.doc.mjs +1 -1
- package/src/hooks/useAnimator.doc.mjs +1 -1
- package/src/hooks/useAnnounceRenderedText.ts +59 -8
- package/src/hooks/useEntryAnimation.doc.mjs +1 -1
- package/src/hooks/useGroupPressTracking.ts +154 -0
- package/src/hooks/useMenuPress.ts +14 -1
- package/src/hooks/useOverflow.ts +25 -3
- package/src/hooks/usePanGesture.doc.mjs +158 -0
- package/src/hooks/usePanGesture.ts +75 -0
- package/src/hooks/usePressFeedback.doc.mjs +1 -1
- package/src/i18n/generated-locales/en.generated.ts +1 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
- package/src/index.ts +2 -0
- package/src/internal/touch.ts +32 -9
- package/src/motion/README.md +6 -5
- package/src/motion/animatedLayout.ts +10 -7
- package/src/motion/animator.ts +10 -9
- package/src/motion/resolveMotion.ts +89 -18
- package/src/motion/themeTempo.ts +41 -0
- package/src/motion/themeTiming.ts +198 -0
- package/src/privateAttributes/focusOwner.stylex.ts +51 -0
- package/src/privateAttributes/press.stylex.ts +21 -1
- package/src/privateAttributes/pressGroupItem.stylex.ts +11 -5
- package/src/theme/defineTheme.ts +99 -2
- package/src/theme/generateThemeRules.ts +3 -0
- package/src/theme/resolveThemeValues.ts +12 -3
- package/src/theme/themeMotion.ts +7 -5
- package/src/utils/focusReturn.ts +61 -15
- package/src/utils/hitArea.ts +88 -8
- package/src/utils/touchHitArea.stylex.ts +29 -19
- package/src/utils/touchHitArea.ts +60 -12
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file AlertDialog.tsx
|
|
3
3
|
* @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button, the
|
|
4
|
-
* action-group tracking (hooks/useActionGroupTracking)
|
|
5
|
-
*
|
|
4
|
+
* action-group tracking (hooks/useActionGroupTracking), the press-group
|
|
5
|
+
* context (hooks/pressGroupContext) and the group pointers
|
|
6
|
+
* (hooks/useGroupPressTracking)
|
|
6
7
|
* @output Exports AlertDialog component, AlertDialogProps type
|
|
7
8
|
* @position Core implementation; consumed by index.ts, tested by AlertDialog.test.tsx
|
|
8
9
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../src/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../src/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAmC,MAAM,OAAO,CAAC;AAUxD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAmC5C,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACpE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IAE3C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC;IAExB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,WAAW,EACX,WAAW,EAAE,oBAAoB,EACjC,WAAW,EACX,aAA6B,EAC7B,eAAe,EACf,QAAQ,EACR,KAAW,EACX,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,IAAI,EACR,EAAE,gBAAgB,qBAoHlB;yBAtIe,WAAW"}
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file AlertDialog.tsx
|
|
7
7
|
* @input Uses React, StyleX, Dialog, Layout, Heading, Text, Button, the
|
|
8
|
-
* action-group tracking (hooks/useActionGroupTracking)
|
|
9
|
-
*
|
|
8
|
+
* action-group tracking (hooks/useActionGroupTracking), the press-group
|
|
9
|
+
* context (hooks/pressGroupContext) and the group pointers
|
|
10
|
+
* (hooks/useGroupPressTracking)
|
|
10
11
|
* @output Exports AlertDialog component, AlertDialogProps type
|
|
11
12
|
* @position Core implementation; consumed by index.ts, tested by AlertDialog.test.tsx
|
|
12
13
|
*
|
|
@@ -36,12 +37,10 @@ import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComp
|
|
|
36
37
|
import english from "../i18n/generated-english/AlertDialog/AlertDialog.generated.js";
|
|
37
38
|
import { useActionGroupTracking } from "../hooks/useActionGroupTracking.js";
|
|
38
39
|
import { PressGroupContext } from "../hooks/pressGroupContext.js";
|
|
40
|
+
import { GROUP_PRESS_POINTERS } from "../hooks/useGroupPressTracking.js";
|
|
39
41
|
import { alertController } from "../motion/uikit/alert.js";
|
|
40
|
-
import { pressGroupItemProps } from "../privateAttributes/pressGroupItem.stylex.js";
|
|
41
42
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
42
43
|
registerEnglishFallback(english);
|
|
43
|
-
const SLIDING_POINTERS = ['touch', 'pen'];
|
|
44
|
-
const ACTION_TRACKING_PROPS = pressGroupItemProps(SLIDING_POINTERS);
|
|
45
44
|
const SMALL_SCREEN_QUERY = '(max-width: 640px)';
|
|
46
45
|
const styles = {
|
|
47
46
|
trackingRow: {
|
|
@@ -115,8 +114,8 @@ export function AlertDialog({
|
|
|
115
114
|
onOpenChange(false);
|
|
116
115
|
}, [onOpenChange]);
|
|
117
116
|
|
|
118
|
-
//
|
|
119
|
-
// tracker is its only painter.
|
|
117
|
+
// Through the group's context, each action's Button writes the press-group
|
|
118
|
+
// marker from its first render. So the tracker is its only painter.
|
|
120
119
|
const actionsRef = useRef(null);
|
|
121
120
|
// Only under the touch presentation does a press slide across the
|
|
122
121
|
// actions. A desktop press stays the native button's.
|
|
@@ -130,21 +129,20 @@ export function AlertDialog({
|
|
|
130
129
|
highlightOnsetMs: alertController.actions.highlightOnsetMs,
|
|
131
130
|
highlightExpansion: alertController.actions.highlightExpansion,
|
|
132
131
|
// A mouse press acts as a native button's under any presentation.
|
|
133
|
-
pointerTypes:
|
|
132
|
+
pointerTypes: GROUP_PRESS_POINTERS,
|
|
134
133
|
isEnabled: isTracking
|
|
135
134
|
});
|
|
136
|
-
const actionTrackingProps = isTracking ? ACTION_TRACKING_PROPS : undefined;
|
|
137
135
|
const buttonActionStyle = [styles.action, isSmallScreen && styles.stackedAction];
|
|
138
136
|
const cancelButton = /*#__PURE__*/_jsx(Button, {
|
|
139
137
|
variant: "ghost",
|
|
140
138
|
label: cancelLabel,
|
|
141
139
|
onClick: handleCancel,
|
|
142
|
-
xstyle: buttonActionStyle
|
|
143
|
-
...actionTrackingProps,
|
|
140
|
+
xstyle: buttonActionStyle
|
|
144
141
|
// Dialog focuses [data-autofocus] itself after showModal(), because
|
|
145
142
|
// React's autoFocus runs during commit while the dialog is invisible.
|
|
146
143
|
// Cancel is least destructive, so it remains the autofocus target even
|
|
147
144
|
// when small-screen visual order places the destructive action above it.
|
|
145
|
+
,
|
|
148
146
|
"data-autofocus": true
|
|
149
147
|
}, "cancel");
|
|
150
148
|
const actionButton = /*#__PURE__*/_jsx(Button, {
|
|
@@ -152,8 +150,7 @@ export function AlertDialog({
|
|
|
152
150
|
label: actionLabel,
|
|
153
151
|
onClick: onAction,
|
|
154
152
|
isLoading: isActionLoading,
|
|
155
|
-
xstyle: buttonActionStyle
|
|
156
|
-
...actionTrackingProps
|
|
153
|
+
xstyle: buttonActionStyle
|
|
157
154
|
}, "action");
|
|
158
155
|
return /*#__PURE__*/_jsx(Dialog, {
|
|
159
156
|
...rest,
|
|
@@ -200,7 +197,7 @@ export function AlertDialog({
|
|
|
200
197
|
hAlign: isSmallScreen ? 'stretch' : 'end',
|
|
201
198
|
wrap: isSmallScreen ? 'nowrap' : 'wrap',
|
|
202
199
|
children: /*#__PURE__*/_jsx(PressGroupContext, {
|
|
203
|
-
value: isTracking,
|
|
200
|
+
value: isTracking ? GROUP_PRESS_POINTERS : null,
|
|
204
201
|
children: isSmallScreen ? [actionButton, cancelButton] : [cancelButton, actionButton]
|
|
205
202
|
})
|
|
206
203
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAuBH,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAuBH,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAC,WAAW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ACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BA6BlD;yBA7Be,WAAW"}
|
|
@@ -65,7 +65,7 @@ import { ModalAnnounceProvider } from "../hooks/ModalAnnounceProvider.js";
|
|
|
65
65
|
import { useModalOutlet } from "../Layer/modalOutlet.js";
|
|
66
66
|
import { useLayerDismissal } from "../Layer/useLayerDismissal.js";
|
|
67
67
|
import { useFocusRegionContainment } from "../hooks/useFocusTrap.js";
|
|
68
|
-
import { returnFocusForLastInput } from "../utils/focusReturn.js";
|
|
68
|
+
import { prepareFocusRepairOnRemoval, returnFocusForLastInput } from "../utils/focusReturn.js";
|
|
69
69
|
import { useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
70
70
|
import { BottomSheetPanel } from "./BottomSheetPanel.js";
|
|
71
71
|
import { BottomSheetEdgeTint } from "./BottomSheetEdgeTint.js";
|
|
@@ -387,7 +387,14 @@ function StandaloneBottomSheet({
|
|
|
387
387
|
return;
|
|
388
388
|
}
|
|
389
389
|
const key = stackKeyRef.current;
|
|
390
|
-
|
|
390
|
+
const dialog = dialogRef.current;
|
|
391
|
+
// Removing an open dialog runs no close, so focus would drop to the page.
|
|
392
|
+
// After the commit, the repair sends focus where a close would, if the
|
|
393
|
+
// removal lost focus.
|
|
394
|
+
const repairOnRemoval = dialog == null ? null : prepareFocusRepairOnRemoval(dialog, {
|
|
395
|
+
keepRestingFocus: true
|
|
396
|
+
});
|
|
397
|
+
const leave = registerBottomSheet({
|
|
391
398
|
key,
|
|
392
399
|
getElement: () => dialogRef.current,
|
|
393
400
|
show: () => {
|
|
@@ -437,6 +444,28 @@ function StandaloneBottomSheet({
|
|
|
437
444
|
}
|
|
438
445
|
}
|
|
439
446
|
}, isOpenRef.current, hasScrim);
|
|
447
|
+
return () => {
|
|
448
|
+
// Read before the registry lets go of the sheet beneath. Focus the
|
|
449
|
+
// person had already moved out of the sheet to the page body stays
|
|
450
|
+
// there: the removal did not lose it.
|
|
451
|
+
if (repairOnRemoval != null && isSheetHostPresented(dialog)) {
|
|
452
|
+
const returnTarget = finalFocusRefRef.current?.current ?? triggerRef.current;
|
|
453
|
+
const revealed = hasScrim ? getBottomSheetBeneath(key) : null;
|
|
454
|
+
repairOnRemoval(() => {
|
|
455
|
+
// The sheet beneath left too. Its own repair returns focus for the
|
|
456
|
+
// stack.
|
|
457
|
+
if (revealed != null && !revealed.element.isConnected) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
if (revealed != null && (returnTarget == null || !revealed.element.contains(returnTarget))) {
|
|
461
|
+
revealed.focus();
|
|
462
|
+
} else if (returnTarget != null && returnTarget.isConnected) {
|
|
463
|
+
returnFocusForLastInput(returnTarget);
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
leave();
|
|
468
|
+
};
|
|
440
469
|
}, [hasScrim, shouldPresent, writeScrim]);
|
|
441
470
|
useLayoutEffect(() => {
|
|
442
471
|
if (!isOpen) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAoCH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACd,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,OAAO,IAAI,YAAY,EAC7B,MAAM,OAAO,CAAC;AA4Hf;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE3E;AA+BD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,GAAG,IAAI,EAC1B,IAAI,EA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AC5E,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;;;OAOG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACnC,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,uBAAuB,EAAE,MAAM,CAAC;IAChC,qEAAqE;IACrE,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;;;;;OAOG;IACH,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,eAAwB,EACxB,UAAiB,EACjB,sBAA0B,EAC1B,SAAS,EACT,WAAW,EACX,MAAM,EACN,aAAa,EACb,cAAc,EACd,cAAsB,GACvB,EAAE,uBAAuB,GAAG,sBAAsB,
|
|
1
|
+
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAoCH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACd,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,OAAO,IAAI,YAAY,EAC7B,MAAM,OAAO,CAAC;AA4Hf;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE3E;AA+BD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,GAAG,IAAI,EAC1B,IAA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4E;IAC5E,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;;;OAOG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACnC,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,uBAAuB,EAAE,MAAM,CAAC;IAChC,qEAAqE;IACrE,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;;;;;OAOG;IACH,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,eAAwB,EACxB,UAAiB,EACjB,sBAA0B,EAC1B,SAAS,EACT,WAAW,EACX,MAAM,EACN,aAAa,EACb,cAAc,EACd,cAAsB,GACvB,EAAE,uBAAuB,GAAG,sBAAsB,CA+4ClD"}
|
|
@@ -333,18 +333,26 @@ export function useSheetGestures({
|
|
|
333
333
|
// onDismiss() and sets `pending`; the host answers in the same update, so
|
|
334
334
|
// the first render afterwards says whether it took the close (its
|
|
335
335
|
// controlled state now says closed: the exit under way is the drag's) or
|
|
336
|
-
// refused it (a guarded onOpenChange left it open: the sheet snaps back
|
|
337
|
-
// the request is spent). Either way the flag is
|
|
338
|
-
// prev-prop pattern, and derived back to false
|
|
339
|
-
// again — so a later close from a control, Escape
|
|
340
|
-
// mistaken for a drag.
|
|
336
|
+
// refused it (a guarded onOpenChange left it open: the sheet snaps back,
|
|
337
|
+
// its scrim with it, and the request is spent). Either way the flag is
|
|
338
|
+
// settled during render, the prev-prop pattern, and derived back to false
|
|
339
|
+
// once the sheet is open again — so a later close from a control, Escape
|
|
340
|
+
// or code is never mistaken for a drag.
|
|
341
341
|
const [touchDragDismissal, setTouchDragDismissal] = useState(null);
|
|
342
|
+
// The render that spends a refused request counts it. The layout effect
|
|
343
|
+
// below answers each count.
|
|
344
|
+
const [refusedDismissalCount, setRefusedDismissalCount] = useState(0);
|
|
342
345
|
if (touchDragDismissal != null) {
|
|
343
346
|
if (touchDragDismissal.pending) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}
|
|
347
|
+
if (isOpenRequested) {
|
|
348
|
+
setTouchDragDismissal(null);
|
|
349
|
+
setRefusedDismissalCount(count => count + 1);
|
|
350
|
+
} else {
|
|
351
|
+
setTouchDragDismissal({
|
|
352
|
+
isTouch: touchDragDismissal.isTouch,
|
|
353
|
+
pending: false
|
|
354
|
+
});
|
|
355
|
+
}
|
|
348
356
|
} else if (isOpenRequested) {
|
|
349
357
|
setTouchDragDismissal(null);
|
|
350
358
|
}
|
|
@@ -452,6 +460,24 @@ export function useSheetGestures({
|
|
|
452
460
|
hasFixedHeightRef.current = hasFixedHeight;
|
|
453
461
|
});
|
|
454
462
|
|
|
463
|
+
// The release cannot know whether the host takes the close. The host
|
|
464
|
+
// answers through `isOpenRequested` in the next render. Keep the left
|
|
465
|
+
// detent's scrim until then.
|
|
466
|
+
const restingScrimOpacityRef = useRef(null);
|
|
467
|
+
// Syncs the host's scrim (its backdrop, written through `onScrimOpacity`)
|
|
468
|
+
// with the panel's return to rest after a refusal: the panel rests on that
|
|
469
|
+
// detent again, so the scrim the drag thinned toward the dismiss line rests
|
|
470
|
+
// with it. The refusal changes none of the host's own scrim inputs, so the
|
|
471
|
+
// drag's last value would otherwise stand.
|
|
472
|
+
useLayoutEffect(() => {
|
|
473
|
+
const restingScrimOpacity = restingScrimOpacityRef.current;
|
|
474
|
+
if (refusedDismissalCount === 0 || restingScrimOpacity == null) {
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
restingScrimOpacityRef.current = null;
|
|
478
|
+
onScrimOpacityRef.current?.(restingScrimOpacity);
|
|
479
|
+
}, [refusedDismissalCount]);
|
|
480
|
+
|
|
455
481
|
// Live drag bookkeeping (refs so pointermove doesn't churn renders).
|
|
456
482
|
const dragStateRef = useRef(null);
|
|
457
483
|
|
|
@@ -770,6 +796,7 @@ export function useSheetGestures({
|
|
|
770
796
|
if (dir > 0 && projected > dismissOffset) {
|
|
771
797
|
if (canDismissRef.current) {
|
|
772
798
|
prepareScrollAreaSettle(baseLayoutOffset, baseOffset, baseLayoutOffset, baseLayoutOffset, baseLayoutOffset, naturalEndGap, false);
|
|
799
|
+
restingScrimOpacityRef.current = scrimOpacityForOffset(baseOffset, offsets, dismissOffset, peekOffset);
|
|
773
800
|
setTouchDragDismissal({
|
|
774
801
|
isTouch,
|
|
775
802
|
pending: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbItem.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/BreadcrumbItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"BreadcrumbItem.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/BreadcrumbItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAc5C,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,qCAAqC,CAAC;AAM7C,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAarE,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,SAAS,CAAC,aAAa,CAAC,EACxB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/B;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC/C;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B;AA2ID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,EAAE,EACF,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,SAAS,EAAE,aAAa,EACxB,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,IAAI,EACR,EAAE,mBAAmB,qBAuMrB;yBAtNe,cAAc"}
|
|
@@ -41,6 +41,8 @@ import { menuTouchActionStyles } from "../DropdownMenu/menuTouchAction.stylex.js
|
|
|
41
41
|
import { useMenuOverflow } from "../DropdownMenu/useMenuOverflow.js";
|
|
42
42
|
import { useTypeahead } from "../hooks/useTypeahead.js";
|
|
43
43
|
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
44
|
+
import "../Layer/layerViewportInset.stylex.js";
|
|
45
|
+
import { layerViewportInset } from "../Layer/layerViewportInset.stylex.js";
|
|
44
46
|
import { renderDropdownItems } from "../DropdownMenu/renderDropdownItems.js";
|
|
45
47
|
import { DropdownMenuContext, DropdownMenuRootOpenContext } from "../DropdownMenu/DropdownMenuContext.js";
|
|
46
48
|
import { MENU_ITEM_ROLES, MENU_ITEM_SELECTOR, MENU_BOUNDARY_SELECTOR } from "../DropdownMenu/menuItemRoles.js";
|
|
@@ -131,7 +133,7 @@ const menuStyles = {
|
|
|
131
133
|
k1xSpc: "x78zum5",
|
|
132
134
|
kXwgrk: "xdt5ytf",
|
|
133
135
|
kOIVth: "x1lsbc85",
|
|
134
|
-
kskxy: "
|
|
136
|
+
kskxy: "x1uh1i8a",
|
|
135
137
|
kORKVm: "x1odjw0f",
|
|
136
138
|
"--_dropdown-menu-radius": "x1fcsqxe",
|
|
137
139
|
"--_dropdown-menu-padding": "xgory14",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAqC3C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC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B;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AA6KD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,OAAqB,EACrB,IAAI,EAAE,QAAQ,EACd,IAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,eAAuB,EACvB,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,KAAK,EACL,SAAkB,EAClB,QAAQ,EACR,UAAU,EACV,OAAO,EACP,IAAI,EACJ,EAAE,EACF,MAAM,EACN,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,SAAS,CAoVzB;yBA7We,MAAM"}
|
package/dist/Button/Button.js
CHANGED
|
@@ -30,7 +30,7 @@ import { iconBoxSizeStyles } from "../Icon/IconSize.stylex.js";
|
|
|
30
30
|
import { EDGE_COMP_ATTR } from "../Layout/edgeCompensation.stylex.js";
|
|
31
31
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
32
32
|
import { useButtonGroup } from "../ButtonGroup/ButtonGroupContext.js";
|
|
33
|
-
import { PressGroupContext } from "../hooks/pressGroupContext.js";
|
|
33
|
+
import { PressGroupContext, pressGroupItemProps } from "../hooks/pressGroupContext.js";
|
|
34
34
|
import { useInputGroup } from "../InputGroup/InputGroupContext.js";
|
|
35
35
|
import { InputGroupInternalContext } from "../InputGroup/InputGroupInternalContext.js";
|
|
36
36
|
import { groupStyles as inputGroupStyles, inputGroupItemProps } from "../InputGroup/groupStyles.js";
|
|
@@ -53,6 +53,9 @@ registerEnglishFallback(english);
|
|
|
53
53
|
*/
|
|
54
54
|
const PRESSED_ON = '[data-astryx-press="on"]';
|
|
55
55
|
|
|
56
|
+
/** `aria-haspopup` values of a trigger that keeps its own press and opening. */
|
|
57
|
+
const MENU_POPUPS = new Set(['true', 'menu', 'listbox']);
|
|
58
|
+
|
|
56
59
|
/**
|
|
57
60
|
* Base button styles
|
|
58
61
|
* Pseudo-classes are nested within properties per StyleX recommendation:
|
|
@@ -396,7 +399,11 @@ export function Button({
|
|
|
396
399
|
const t = useComponentTranslator();
|
|
397
400
|
const size = useSize(sizeProp, 'md');
|
|
398
401
|
const buttonGroup = useButtonGroup();
|
|
399
|
-
|
|
402
|
+
// A tracking group's tracker paints this button's pointer press. A menu
|
|
403
|
+
// trigger is not tracked: it keeps its own press and opening.
|
|
404
|
+
const groupPointers = use(PressGroupContext);
|
|
405
|
+
const groupItemProps = groupPointers != null && !MENU_POPUPS.has(String(props['aria-haspopup'])) ? pressGroupItemProps(groupPointers) : undefined;
|
|
406
|
+
const isGroupTracked = groupItemProps != null;
|
|
400
407
|
const inputGroup = useInputGroup();
|
|
401
408
|
const [isPending, startTransition] = useTransition();
|
|
402
409
|
// clickAction is normally fire-once (submit/save/pay), so a same-tick
|
|
@@ -611,6 +618,7 @@ export function Button({
|
|
|
611
618
|
...(inputGroup != null && buttonGroup == null ? inputGroupItemProps : undefined),
|
|
612
619
|
...sharedMergedProps,
|
|
613
620
|
...pressFeedback,
|
|
621
|
+
...groupItemProps,
|
|
614
622
|
...props,
|
|
615
623
|
...ariaLabelProp,
|
|
616
624
|
...describedByProp,
|
|
@@ -633,6 +641,7 @@ export function Button({
|
|
|
633
641
|
...(inputGroup != null && buttonGroup == null ? inputGroupItemProps : undefined),
|
|
634
642
|
...sharedMergedProps,
|
|
635
643
|
...pressFeedback,
|
|
644
|
+
...groupItemProps,
|
|
636
645
|
...props,
|
|
637
646
|
...ariaLabelProp,
|
|
638
647
|
...describedByProp,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file ButtonGroup.tsx
|
|
3
|
-
* @input Uses React, StyleX, Button/IconButton children
|
|
3
|
+
* @input Uses React, StyleX, Button/IconButton children, and the shared group
|
|
4
|
+
* press tracking (hooks/useGroupPressTracking)
|
|
4
5
|
* @output Exports ButtonGroup component, context, and types
|
|
5
6
|
* @position Groups buttons with connected styling; consumed by index.ts
|
|
6
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAkB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAE1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAW9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,sBAAsB,CAAC;AAQjE,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACjE,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,WAAW,CAAC,EAAE,sBAAsB,CAAC;IAErC;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA6CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,KAAK,EACL,WAA0B,EAC1B,IAAI,EAAE,QAAQ,EACd,UAAkB,EAClB,SAAkB,EAClB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,aAAa,EAAE,MAAM,EACrB,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,SAAS,CA+D9B;yBA9Ee,WAAW"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file ButtonGroup.tsx
|
|
7
|
-
* @input Uses React, StyleX, Button/IconButton children
|
|
7
|
+
* @input Uses React, StyleX, Button/IconButton children, and the shared group
|
|
8
|
+
* press tracking (hooks/useGroupPressTracking)
|
|
8
9
|
* @output Exports ButtonGroup component, context, and types
|
|
9
10
|
* @position Groups buttons with connected styling; consumed by index.ts
|
|
10
11
|
*
|
|
@@ -20,12 +21,16 @@
|
|
|
20
21
|
* - /apps/storybook/stories/ButtonGroup.stories.tsx (storybook stories)
|
|
21
22
|
* - /packages/cli/assets/templates/blocks/components/ButtonGroup/ (showcase blocks)
|
|
22
23
|
*/
|
|
23
|
-
import { useMemo } from 'react';
|
|
24
|
+
import { useMemo, useRef } from 'react';
|
|
24
25
|
import * as stylex from '@stylexjs/stylex';
|
|
25
26
|
import "../theme/tokens.stylex.js";
|
|
26
27
|
import { radiusVars, shadowVars } from "../theme/tokens.stylex.js";
|
|
27
28
|
import { SizeProvider, useSize } from "../SizeContext/SizeContext.js";
|
|
28
29
|
import { useListFocus } from "../hooks/useListFocus.js";
|
|
30
|
+
import { PressGroupContext } from "../hooks/pressGroupContext.js";
|
|
31
|
+
import { GROUP_PRESS_POINTERS, useGroupPressTracking } from "../hooks/useGroupPressTracking.js";
|
|
32
|
+
import { useTouchPresentation } from "../utils/touchPresentation.js";
|
|
33
|
+
import { touchHitAreaStyles } from "../utils/touchHitArea.stylex.js";
|
|
29
34
|
import { mergeProps, composeEventHandlers } from "../utils/index.js";
|
|
30
35
|
import { ButtonGroupContext } from "./ButtonGroupContext.js";
|
|
31
36
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -47,6 +52,10 @@ const styles = {
|
|
|
47
52
|
vertical: {
|
|
48
53
|
kXwgrk: "xdt5ytf",
|
|
49
54
|
$$css: true
|
|
55
|
+
},
|
|
56
|
+
tracking: {
|
|
57
|
+
kVAEAm: "x1n2onr6",
|
|
58
|
+
$$css: true
|
|
50
59
|
}
|
|
51
60
|
};
|
|
52
61
|
|
|
@@ -154,25 +163,39 @@ export function ButtonGroup({
|
|
|
154
163
|
orientation,
|
|
155
164
|
isDisabled
|
|
156
165
|
}), [orientation, isDisabled]);
|
|
166
|
+
|
|
167
|
+
// Only under the touch presentation does a press slide across the buttons.
|
|
168
|
+
// A desktop press stays the native button's.
|
|
169
|
+
const {
|
|
170
|
+
isTouch
|
|
171
|
+
} = useTouchPresentation();
|
|
172
|
+
const tracksPress = !isDisabled && isTouch;
|
|
173
|
+
const groupRef = useRef(null);
|
|
174
|
+
const {
|
|
175
|
+
hitAreaRef
|
|
176
|
+
} = useGroupPressTracking(groupRef, tracksPress);
|
|
157
177
|
return /*#__PURE__*/_jsx(ButtonGroupContext, {
|
|
158
178
|
value: contextValue,
|
|
159
179
|
children: /*#__PURE__*/_jsx(SizeProvider, {
|
|
160
180
|
value: size,
|
|
161
181
|
children: /*#__PURE__*/_jsx("div", {
|
|
162
|
-
ref: useMergedRefs(ref, listRef),
|
|
182
|
+
ref: useMergedRefs(ref, listRef, groupRef, hitAreaRef),
|
|
163
183
|
...props,
|
|
164
184
|
...mergeProps(themeProps('button-group', {
|
|
165
185
|
size,
|
|
166
186
|
orientation,
|
|
167
187
|
elevation
|
|
168
|
-
}), stylex.props(styles.group, orientation === 'vertical' && styles.vertical, elevationStyles[elevation], xstyle), className, style),
|
|
188
|
+
}), stylex.props(styles.group, tracksPress && styles.tracking, tracksPress && touchHitAreaStyles.layerBelowChildren, orientation === 'vertical' && styles.vertical, elevationStyles[elevation], xstyle), className, style),
|
|
169
189
|
role: "group",
|
|
170
190
|
"aria-label": label,
|
|
171
191
|
onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown),
|
|
172
192
|
onFocus: composeEventHandlers(onFocus, handleFocus),
|
|
173
193
|
"aria-disabled": isDisabled || undefined,
|
|
174
194
|
"data-testid": testId,
|
|
175
|
-
children:
|
|
195
|
+
children: /*#__PURE__*/_jsx(PressGroupContext, {
|
|
196
|
+
value: tracksPress ? GROUP_PRESS_POINTERS : null,
|
|
197
|
+
children: children
|
|
198
|
+
})
|
|
176
199
|
})
|
|
177
200
|
})
|
|
178
201
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatMessageList.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatMessageList.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAC,KAAK,SAAS,EAA4C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatMessageList.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatMessageList.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAC,KAAK,SAAS,EAA4C,MAAM,OAAO,CAAC;AAIhF,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAWhD,MAAM,WAAW,oBAAqB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACrE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,WAAW,CAAC;IAElB;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAEzB;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAoGD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,OAAoB,EACpB,GAAG,EACH,KAAgB,EAChB,WAAmB,EACnB,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,GAAG,IAAI,EACR,EAAE,oBAAoB,+BA6GtB;yBA3He,eAAe"}
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
import { useEffect, useMemo, useRef, useTransition } from 'react';
|
|
27
27
|
import * as stylex from '@stylexjs/stylex';
|
|
28
28
|
import "../theme/tokens.stylex.js";
|
|
29
|
-
import { spacingVars } from "../theme/tokens.stylex.js";
|
|
29
|
+
import { focusVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
30
|
+
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
30
31
|
import { ChatListContext, useChatLayoutContext } from "./ChatContext.js";
|
|
31
32
|
import { isRenderable, mergeProps } from "../utils/index.js";
|
|
32
33
|
import { Spinner } from "../Spinner/index.js";
|
|
@@ -48,6 +49,10 @@ const styles = {
|
|
|
48
49
|
kAzted: "x2lwn1j",
|
|
49
50
|
$$css: true
|
|
50
51
|
},
|
|
52
|
+
focusRingInset: {
|
|
53
|
+
kInvED: "x1nw7mhf",
|
|
54
|
+
$$css: true
|
|
55
|
+
},
|
|
51
56
|
inner: {
|
|
52
57
|
k1xSpc: "x78zum5",
|
|
53
58
|
kXwgrk: "xdt5ytf",
|
|
@@ -218,7 +223,10 @@ export function ChatMessageList({
|
|
|
218
223
|
"data-testid": testId,
|
|
219
224
|
...mergeProps(themeProps('chat-message-list', {
|
|
220
225
|
density
|
|
221
|
-
}),
|
|
226
|
+
}),
|
|
227
|
+
// A tab stop: the shared ring, which a theme restyles through the
|
|
228
|
+
// focus-outline tokens.
|
|
229
|
+
stylex.props(styles.root, focusOutlineStyles.focusVisible, styles.focusRingInset, xstyle), className, style),
|
|
222
230
|
children: /*#__PURE__*/_jsxs("div", {
|
|
223
231
|
ref: innerRef,
|
|
224
232
|
...stylex.props(styles.inner, densityGapStyle, gapOverrideStyle),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxInput.d.ts","sourceRoot":"","sources":["../../src/CheckboxInput/CheckboxInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,UAAU,EAGf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,E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RpB;yBApTe,aAAa"}
|
|
@@ -26,6 +26,7 @@ import { Spinner } from "../Spinner/Spinner.js";
|
|
|
26
26
|
import { useTooltip } from "../Tooltip/useTooltip.js";
|
|
27
27
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
28
28
|
import { rtlStyles } from "../utils/rtlStyles.js";
|
|
29
|
+
import { withholdCallerHandlers } from "../utils/disabledInteraction.js";
|
|
29
30
|
import "../Indicator/indicator.markers.stylex.js";
|
|
30
31
|
import { indicatorScope } from "../Indicator/indicator.markers.stylex.js";
|
|
31
32
|
import "../internal/indicatorPress.stylex.js";
|
|
@@ -327,7 +328,7 @@ export function CheckboxInput({
|
|
|
327
328
|
...stylex.props(styles.checkboxWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay, !isDisabled && isRowPressSurface && styles.indicatorRowPressOverlay),
|
|
328
329
|
...focusProps,
|
|
329
330
|
children: [/*#__PURE__*/_jsx("input", {
|
|
330
|
-
...rest,
|
|
331
|
+
...withholdCallerHandlers(rest, isDisabled),
|
|
331
332
|
ref: useMergedRefs(ref, indeterminateRef, disabledMessageTooltip.positionRef, inputRef),
|
|
332
333
|
id: id,
|
|
333
334
|
type: "checkbox"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxListItem.d.ts","sourceRoot":"","sources":["../../src/CheckboxList/CheckboxListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAkC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAItE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckboxListItem.d.ts","sourceRoot":"","sources":["../../src/CheckboxList/CheckboxListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAkC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAItE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAe5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAuBvC,MAAM,WAAW,qBAAsB,SAAQ,SAAS,CAAC,aAAa,CAAC;IACrE;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;;;;OAaG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IACtC;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAChC;AAyCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,WAAW,EACX,UAAU,EACV,UAAU,EAAE,cAAsB,EAClC,SAAS,EAAE,aAAqB,EAChC,SAAS,EACT,OAAO,EACP,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EAAE,WAAW,EACpB,KAAK,EACL,GAAG,SAAS,EACb,EAAE,qBAAqB,+BAmLvB;yBApMe,gBAAgB"}
|
|
@@ -32,6 +32,7 @@ import { CheckboxListContext } from "./CheckboxListContext.js";
|
|
|
32
32
|
import { ItemDescriptionContext } from "../Item/ItemDescriptionContext.js";
|
|
33
33
|
import { joinAriaIDs } from "../utils/inputAria.js";
|
|
34
34
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
35
|
+
import { themeDataAttributes } from "../utils/themeProps.js";
|
|
35
36
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
36
37
|
import english from "../i18n/generated-english/CheckboxList/CheckboxListItem.generated.js";
|
|
37
38
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -224,8 +225,14 @@ export function CheckboxListItem({
|
|
|
224
225
|
onCheck?.(shouldCheck);
|
|
225
226
|
}
|
|
226
227
|
};
|
|
228
|
+
|
|
229
|
+
// The state follows the fill, so a theme can restyle the text on it.
|
|
230
|
+
const isCheckedRow = resolvedChecked === true && !effectiveDisabled && !effectiveReadOnly;
|
|
227
231
|
return /*#__PURE__*/_jsx(ListItem, {
|
|
228
232
|
...restProps,
|
|
233
|
+
...themeDataAttributes({
|
|
234
|
+
selected: isCheckedRow ? 'selected' : null
|
|
235
|
+
}),
|
|
229
236
|
ref: ref,
|
|
230
237
|
label: namesFromVisibleLabel ? /*#__PURE__*/_jsx("span", {
|
|
231
238
|
id: labelID,
|
|
@@ -249,7 +256,7 @@ export function CheckboxListItem({
|
|
|
249
256
|
// Item's row layer drops the strength's release, and the box paints
|
|
250
257
|
// at that strength. So the row brings the release back, and the box
|
|
251
258
|
// fades with the row.
|
|
252
|
-
rowOwnsPress && interactionOverlayStyles.pressedAlpha,
|
|
259
|
+
rowOwnsPress && interactionOverlayStyles.pressedAlpha, isCheckedRow && styles.selected, xstyle],
|
|
253
260
|
className: className,
|
|
254
261
|
style: style,
|
|
255
262
|
startContent:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../src/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../src/Code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OAKG;IACH,SAAS,CAAC,EAAE,CACV,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAClD,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC5C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC;AA0UD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,QAAsB,EACtB,KAAK,EACL,gBAAuB,EACvB,cAAsB,EACtB,eAAmB,EACnB,cAAc,EACd,MAAc,EACd,aAAoB,EACpB,MAAM,EACN,UAAU,EACV,SAAiB,EACjB,SAAS,EACT,aAAqB,EACrB,oBAAyB,EACzB,IAAW,EACX,KAAK,EAAE,SAAyB,EAChC,SAAkB,EAClB,SAAS,EAAE,eAAe,EAC1B,aAAsB,EACtB,WAAW,EACX,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,cAAc,qBAmUhB;yBA9Ve,SAAS"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file CodeBlock.tsx
|
|
7
|
-
* @input Uses React, StyleX, theme tokens, CSS Custom Highlight API, SyntaxTheme
|
|
7
|
+
* @input Uses React, StyleX, theme tokens, CSS Custom Highlight API, SyntaxTheme
|
|
8
|
+
* provider, and the theme's `code-block-copy` icon slot
|
|
8
9
|
* @output Exports CodeBlock component and CodeBlockProps
|
|
9
10
|
* @position Core implementation; read-only syntax-highlighted code display
|
|
10
11
|
*/
|
|
@@ -17,6 +18,7 @@ import { isRenderable, mergeProps, rtlStyles } from "../utils/index.js";
|
|
|
17
18
|
import { useClipboard } from "../hooks/useClipboard.js";
|
|
18
19
|
import { useScrollableArea } from "../hooks/useScrollableArea.js";
|
|
19
20
|
import { Icon } from "../Icon/index.js";
|
|
21
|
+
import { ComponentIcon } from "../Icon/ComponentIcon.js";
|
|
20
22
|
import { IconButton } from "../IconButton/index.js";
|
|
21
23
|
import { tokenize, tokenizeAsync, splitDiffLines, flatTokensToLines, SYNC_TOKENIZE_THRESHOLD } from "./tokenizer.js";
|
|
22
24
|
import { isCustomCodeLanguage, languageKey, languageLabel as languageWord, sameCodeLanguage } from "./grammar.js";
|
|
@@ -693,9 +695,15 @@ export function CodeBlock({
|
|
|
693
695
|
const copyButtonEl = hasCopyButton ? /*#__PURE__*/_jsx(IconButton, {
|
|
694
696
|
variant: "ghost",
|
|
695
697
|
size: "sm",
|
|
696
|
-
icon: /*#__PURE__*/_jsx(
|
|
697
|
-
|
|
698
|
-
|
|
698
|
+
icon: /*#__PURE__*/_jsx(ComponentIcon, {
|
|
699
|
+
slot: "code-block-copy",
|
|
700
|
+
state: {
|
|
701
|
+
copied
|
|
702
|
+
},
|
|
703
|
+
fallback: {
|
|
704
|
+
icon: copied ? 'check' : 'copy',
|
|
705
|
+
size: 'sm'
|
|
706
|
+
},
|
|
699
707
|
color: "inherit"
|
|
700
708
|
})
|
|
701
709
|
// A visible "Copy" hover/focus hint via Button's built-in tooltip. It
|