@astryxdesign/core 0.7.9-canary.2f035fe → 0.7.9-canary.2f3510b
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/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 +38 -11
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +3 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts +2 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +27 -8
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts +2 -0
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts.map +1 -0
- package/dist/CheckboxInput/CheckboxRowPressContext.js +20 -0
- package/dist/CheckboxList/CheckboxListItem.d.ts +2 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +40 -14
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +12 -4
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +5 -1
- package/dist/DateInput/DateInput.d.ts +37 -6
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +98 -128
- package/dist/DateInput/MonthScroller.d.ts +5 -2
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +26 -29
- package/dist/DateInput/MonthYearWheels.d.ts +10 -1
- package/dist/DateInput/MonthYearWheels.d.ts.map +1 -1
- package/dist/DateInput/MonthYearWheels.js +54 -42
- package/dist/DateInput/TouchDateField.d.ts +1 -1
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +26 -21
- package/dist/DateInput/monthGeometry.d.ts +42 -8
- package/dist/DateInput/monthGeometry.d.ts.map +1 -1
- package/dist/DateInput/monthGeometry.js +81 -7
- package/dist/DateInput/useCalendarPresentation.d.ts +10 -0
- package/dist/DateInput/useCalendarPresentation.d.ts.map +1 -0
- package/dist/DateInput/useCalendarPresentation.js +32 -0
- package/dist/DateInput/useTypedDate.d.ts +92 -0
- package/dist/DateInput/useTypedDate.d.ts.map +1 -0
- package/dist/DateInput/useTypedDate.js +269 -0
- package/dist/DateInput/wheelStrip.js +2 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts +17 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +15 -11
- package/dist/DateTimeInput/DateTimeInput.d.ts +26 -3
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +93 -92
- package/dist/DateTimeInput/TouchDateTimeField.d.ts +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +26 -20
- 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 +25 -1
- 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/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/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 +39 -17
- 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/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/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 +10 -3
- package/dist/animator/createAnimator.js +2 -2
- package/dist/astryx.css +19 -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/computeOverflow.d.ts +2 -0
- package/dist/hooks/computeOverflow.d.ts.map +1 -1
- package/dist/hooks/computeOverflow.js +1 -1
- 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/useMediaQuery.d.ts +2 -1
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +37 -12
- 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 +214 -23
- 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/InternationalizationProvider.d.ts +2 -1
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateInput/DateInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateInput/DateInput.generated.js +0 -1
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.d.ts +8 -0
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.js +16 -0
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateTimeInput/DateTimeInput.generated.js +0 -1
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +4 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +4 -0
- 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 +10 -5
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +15 -7
- 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/press.stylex.d.ts +18 -11
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/press.stylex.js +20 -11
- 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/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/calendarDateParser.d.ts +1 -1
- package/dist/utils/calendarDateParser.js +1 -1
- package/dist/utils/calendarSystem.d.ts +49 -3
- package/dist/utils/calendarSystem.d.ts.map +1 -1
- package/dist/utils/calendarSystem.js +129 -5
- package/dist/utils/coarsePointer.d.ts +5 -0
- package/dist/utils/coarsePointer.d.ts.map +1 -1
- package/dist/utils/coarsePointer.js +22 -13
- 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/inputPresentation.d.ts +9 -1
- package/dist/utils/inputPresentation.d.ts.map +1 -1
- package/dist/utils/inputPresentation.js +15 -1
- package/locales/en.json +17 -1
- package/locales/pseudo.json +12 -0
- package/package.json +4 -4
- package/src/BottomSheet/BottomSheet.tsx +39 -2
- package/src/BottomSheet/useSheetGestures.ts +43 -12
- package/src/Breadcrumbs/BreadcrumbItem.tsx +7 -1
- package/src/Calendar/useCalendarDays.doc.mjs +158 -0
- package/src/CheckboxInput/CheckboxInput.doc.mjs +2 -2
- package/src/CheckboxInput/CheckboxInput.tsx +47 -12
- package/src/CheckboxInput/CheckboxRowPressContext.ts +22 -0
- package/src/CheckboxList/CheckboxList.doc.mjs +9 -0
- package/src/CheckboxList/CheckboxListItem.doc.mjs +3 -3
- package/src/CheckboxList/CheckboxListItem.tsx +35 -14
- package/src/CodeBlock/CodeBlock.doc.mjs +17 -0
- package/src/CodeBlock/CodeBlock.tsx +11 -2
- package/src/ContextMenu/ContextMenu.tsx +9 -1
- package/src/DateInput/DateInput.doc.mjs +45 -12
- package/src/DateInput/DateInput.tsx +165 -181
- package/src/DateInput/MonthScroller.tsx +39 -37
- package/src/DateInput/MonthYearWheels.tsx +68 -47
- package/src/DateInput/TouchDateField.tsx +45 -17
- package/src/DateInput/monthGeometry.ts +110 -8
- package/src/DateInput/useCalendarPresentation.ts +64 -0
- package/src/DateInput/useTypedDate.ts +469 -0
- package/src/DateInput/wheelStrip.ts +2 -2
- package/src/DateRangeInput/DateRangeInput.doc.mjs +9 -0
- package/src/DateRangeInput/DateRangeInput.tsx +42 -10
- package/src/DateTimeInput/DateTimeInput.doc.mjs +42 -9
- package/src/DateTimeInput/DateTimeInput.tsx +138 -150
- package/src/DateTimeInput/TouchDateTimeField.tsx +31 -16
- package/src/Drawer/Drawer.tsx +3 -1
- package/src/DropdownMenu/DropdownMenu.tsx +32 -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/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/Popover/Popover.tsx +5 -0
- package/src/PowerSearch/PowerSearch.doc.mjs +3 -3
- package/src/Resizable/resizablePane.ts +4 -13
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +15 -62
- package/src/Selector/Selector.tsx +61 -8
- package/src/SideNav/SideNav.tsx +0 -1
- package/src/SideNav/SideNavItem.tsx +8 -6
- package/src/Slider/sliderTouchController.ts +2 -2
- 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/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/Tooltip/useTooltip.tsx +2 -0
- package/src/TopNav/TopNavItem.tsx +7 -2
- package/src/Typeahead/BaseTypeahead.tsx +25 -3
- 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/computeOverflow.ts +1 -1
- package/src/hooks/index.ts +8 -0
- package/src/hooks/useAnimatedLayout.doc.mjs +1 -1
- package/src/hooks/useAnimator.doc.mjs +1 -1
- package/src/hooks/useEntryAnimation.doc.mjs +1 -1
- package/src/hooks/useMediaQuery.ts +41 -12
- package/src/hooks/useMenuPress.ts +14 -1
- package/src/hooks/useOverflow.ts +321 -75
- 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/InternationalizationProvider.doc.mjs +3 -3
- package/src/i18n/InternationalizationProvider.tsx +2 -1
- package/src/i18n/generated-english/DateInput/DateInput.generated.ts +0 -1
- package/src/i18n/generated-english/DateInput/useTypedDate.generated.ts +17 -0
- package/src/i18n/generated-english/DateTimeInput/DateTimeInput.generated.ts +0 -1
- package/src/i18n/generated-locales/en.generated.ts +6 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +6 -0
- package/src/index.ts +2 -0
- package/src/internal/touch.ts +16 -8
- 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/press.stylex.ts +47 -11
- package/src/theme/defineTheme.ts +99 -2
- package/src/theme/resolveThemeValues.ts +12 -3
- package/src/theme/themeMotion.ts +7 -5
- package/src/utils/calendarDateParser.ts +1 -1
- package/src/utils/calendarSystem.ts +212 -3
- package/src/utils/coarsePointer.ts +27 -14
- package/src/utils/focusReturn.ts +61 -15
- package/src/utils/inputPresentation.ts +21 -1
|
@@ -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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AK,CAAC;CACjB;AAED,UAAU,wBAAyB,SAAQ,sBAAsB;IAC/D;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,GAC1B,0BAA0B,GAAG,wBAAwB,CAAC;AA27BxD;;;GAGG;AACH,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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gBAAgB,CAAC;IAC9B;;;;OAIG;IACH,SAAS,EAAE,cAAc,CAAC;IAC1B;;;;;OAKG;IACH,cAAc,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,4EAA4E;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,
|
|
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;AA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AAE,gBAAgB,CAAC;IAC9B;;;;OAIG;IACH,SAAS,EAAE,cAAc,CAAC;IAC1B;;;;;OAKG;IACH,cAAc,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,4EAA4E;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"}
|
|
@@ -94,8 +94,8 @@ function touchPointerType(touch) {
|
|
|
94
94
|
return touch.touchType === 'stylus' ? 'pen' : 'touch';
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
// A mouse's stretch past fully open: a resisted fraction of the
|
|
98
|
-
// at OVERSCROLL_MAX.
|
|
97
|
+
// A mouse's or a pen's stretch past fully open: a resisted fraction of the
|
|
98
|
+
// drag, capped at OVERSCROLL_MAX.
|
|
99
99
|
const OVERSCROLL_RESISTANCE = 0.35;
|
|
100
100
|
// SYNC: must not exceed MIN_RESERVE in BottomSheetPanel.tsx, the smallest
|
|
101
101
|
// reserve the sheet keeps below the screen.
|
|
@@ -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;;;;;;;;;;;;;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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,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file CheckboxInput.tsx
|
|
3
|
-
* @input Uses React, useId, ChangeEvent, FieldLabel, FieldStatus, IconType, InputStatus, useTooltip
|
|
3
|
+
* @input Uses React, useId, ChangeEvent, FieldLabel, FieldStatus, IconType, InputStatus, useTooltip,
|
|
4
|
+
* CheckboxRowPressContext (a row around the checkbox that owns its press)
|
|
4
5
|
* @output Exports CheckboxInput component, CheckboxInputProps
|
|
5
6
|
* @position Core implementation; consumed by index.ts, tested by CheckboxInput.test.tsx
|
|
6
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxInput.d.ts","sourceRoot":"","sources":["../../src/CheckboxInput/CheckboxInput.tsx"],"names":[],"mappings":"AAIA
|
|
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,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AA6KhD,QAAA,MAAM,iBAAiB;;;;;;;;;EASrB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAE/D,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACrE,wDAAwD;IACxD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,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D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,EAAE,EAAE,MAAM,EACV,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,KAAK,EACL,UAAkB,EAClB,QAAQ,EACR,eAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,IAAW,EACX,OAAO,EACP,MAAM,EACN,SAAS,EACT,MAAM,EACN,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,kBAAkB,EAAE,mBAAmB,EACvC,GAAG,IAAI,EACR,EAAE,kBAAkB,+BAyRpB;yBApTe,aAAa"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file CheckboxInput.tsx
|
|
7
|
-
* @input Uses React, useId, ChangeEvent, FieldLabel, FieldStatus, IconType, InputStatus, useTooltip
|
|
7
|
+
* @input Uses React, useId, ChangeEvent, FieldLabel, FieldStatus, IconType, InputStatus, useTooltip,
|
|
8
|
+
* CheckboxRowPressContext (a row around the checkbox that owns its press)
|
|
8
9
|
* @output Exports CheckboxInput component, CheckboxInputProps
|
|
9
10
|
* @position Core implementation; consumed by index.ts, tested by CheckboxInput.test.tsx
|
|
10
11
|
*
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
* - /apps/storybook/stories/CheckboxInput.stories.tsx (storybook stories)
|
|
16
17
|
* - /packages/cli/assets/templates/blocks/components/CheckboxInput/ (showcase blocks)
|
|
17
18
|
*/
|
|
18
|
-
import { useId, useCallback, useOptimistic, useRef, useTransition } from 'react';
|
|
19
|
+
import { use, useId, useCallback, useOptimistic, useRef, useTransition } from 'react';
|
|
19
20
|
import * as stylex from '@stylexjs/stylex';
|
|
20
21
|
import "../theme/tokens.stylex.js";
|
|
21
22
|
import { colorVars, spacingVars, radiusVars, typographyVars, typeScaleVars, fontWeightVars } from "../theme/tokens.stylex.js";
|
|
@@ -25,6 +26,7 @@ import { Spinner } from "../Spinner/Spinner.js";
|
|
|
25
26
|
import { useTooltip } from "../Tooltip/useTooltip.js";
|
|
26
27
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
27
28
|
import { rtlStyles } from "../utils/rtlStyles.js";
|
|
29
|
+
import { withholdCallerHandlers } from "../utils/disabledInteraction.js";
|
|
28
30
|
import "../Indicator/indicator.markers.stylex.js";
|
|
29
31
|
import { indicatorScope } from "../Indicator/indicator.markers.stylex.js";
|
|
30
32
|
import "../internal/indicatorPress.stylex.js";
|
|
@@ -40,6 +42,7 @@ import { useTouchHitArea } from "../utils/touchHitArea.js";
|
|
|
40
42
|
import { touchHitAreaStyles } from "../utils/touchHitArea.stylex.js";
|
|
41
43
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
42
44
|
import english from "../i18n/generated-english/CheckboxInput/CheckboxInput.generated.js";
|
|
45
|
+
import { CheckboxRowPressContext } from "./CheckboxRowPressContext.js";
|
|
43
46
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
44
47
|
registerEnglishFallback(english);
|
|
45
48
|
|
|
@@ -72,6 +75,10 @@ const styles = {
|
|
|
72
75
|
"--_indicator-press-image": "x1dueop1 x189o2zt",
|
|
73
76
|
$$css: true
|
|
74
77
|
},
|
|
78
|
+
indicatorRowPressImage: {
|
|
79
|
+
"--_indicator-press-image": "x1y1g3jp",
|
|
80
|
+
$$css: true
|
|
81
|
+
},
|
|
75
82
|
checkboxWrapper: {
|
|
76
83
|
kVAEAm: "x1n2onr6",
|
|
77
84
|
k1xSpc: "x78zum5",
|
|
@@ -91,6 +98,10 @@ const styles = {
|
|
|
91
98
|
kNctxI: "x1ikgzpo xsozn46",
|
|
92
99
|
$$css: true
|
|
93
100
|
},
|
|
101
|
+
indicatorRowPressOverlay: {
|
|
102
|
+
kNctxI: "xlvbopx",
|
|
103
|
+
$$css: true
|
|
104
|
+
},
|
|
94
105
|
input: {
|
|
95
106
|
kVAEAm: "x10l6tqk",
|
|
96
107
|
k87sOh: "xwa60dl",
|
|
@@ -182,6 +193,13 @@ export function CheckboxInput({
|
|
|
182
193
|
// The row is the pressable: the overlay's pressed arm reads the row's
|
|
183
194
|
// scope marker, the way the indicator's hover tint does.
|
|
184
195
|
const pressable = usePressFeedback();
|
|
196
|
+
// A row around the checkbox that answers a press anywhere on it (a
|
|
197
|
+
// CheckboxListItem) owns the touch press instead. The checkbox then carries
|
|
198
|
+
// no press marker of its own. So the controller's innermost-wins rule finds
|
|
199
|
+
// the row for a finger on the label, the description or the box. The
|
|
200
|
+
// overlay below paints that row's press.
|
|
201
|
+
const isRowPressSurface = use(CheckboxRowPressContext);
|
|
202
|
+
const ownsPress = !isDisabled && !isRowPressSurface;
|
|
185
203
|
const generatedId = useId();
|
|
186
204
|
const id = idProp || generatedId;
|
|
187
205
|
const descriptionID = useId();
|
|
@@ -296,20 +314,21 @@ export function CheckboxInput({
|
|
|
296
314
|
ref: rowRef,
|
|
297
315
|
onPointerDown: hasHitArea ? handleRowPointerDown : undefined,
|
|
298
316
|
onClick: hasHitArea ? handleRowClick : undefined,
|
|
299
|
-
...(
|
|
317
|
+
...(ownsPress ? pressable : undefined),
|
|
300
318
|
...stylex.props(styles.container, isLabelHidden && styles.containerLabelHidden, hasHitArea && styles.hitAreaHost, hasHitArea && touchHitAreaStyles.layer,
|
|
301
319
|
// Hover and focus reach the checkbox visual through this ancestor
|
|
302
320
|
// marker rather than props, so the whole row drives it.
|
|
303
|
-
!isDisabled && indicatorScope, !isDisabled && styles.indicatorPressImage,
|
|
321
|
+
!isDisabled && indicatorScope, !isDisabled && (isRowPressSurface ? styles.indicatorRowPressImage : styles.indicatorPressImage),
|
|
304
322
|
// The touch press's strength and release live on the row the
|
|
305
323
|
// controller writes to; the layer over the checkbox box inherits
|
|
306
|
-
// and paints it.
|
|
307
|
-
|
|
324
|
+
// and paints it. Under a row that owns the press, the box inherits
|
|
325
|
+
// that row's strength instead.
|
|
326
|
+
ownsPress && interactionOverlayStyles.pressedAlpha),
|
|
308
327
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
309
|
-
...stylex.props(styles.checkboxWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay),
|
|
328
|
+
...stylex.props(styles.checkboxWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay, !isDisabled && isRowPressSurface && styles.indicatorRowPressOverlay),
|
|
310
329
|
...focusProps,
|
|
311
330
|
children: [/*#__PURE__*/_jsx("input", {
|
|
312
|
-
...rest,
|
|
331
|
+
...withholdCallerHandlers(rest, isDisabled),
|
|
313
332
|
ref: useMergedRefs(ref, indeterminateRef, disabledMessageTooltip.positionRef, inputRef),
|
|
314
333
|
id: id,
|
|
315
334
|
type: "checkbox"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckboxRowPressContext.d.ts","sourceRoot":"","sources":["../../src/CheckboxInput/CheckboxRowPressContext.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,uBAAuB,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file CheckboxRowPressContext.ts
|
|
7
|
+
* @input Uses the private layer-scoped context factory
|
|
8
|
+
* @output CheckboxRowPressContext: whether the row is its checkbox's press surface
|
|
9
|
+
* @position Internal; CheckboxListItem provides it, CheckboxInput reads it
|
|
10
|
+
*
|
|
11
|
+
* Such a row carries the shared press marker (utils/pressFeedback.ts). Its
|
|
12
|
+
* checkbox carries none, so a finger anywhere on the row presses the row.
|
|
13
|
+
* It is layer-scoped and wraps only the row's own checkbox.
|
|
14
|
+
*
|
|
15
|
+
* SYNC: When modified, update CheckboxInput.tsx and
|
|
16
|
+
* ../CheckboxList/CheckboxListItem.tsx.
|
|
17
|
+
*/
|
|
18
|
+
import { createLayerScopedContext } from "../Layer/layerScopedContext.js";
|
|
19
|
+
export const CheckboxRowPressContext = createLayerScopedContext(false);
|
|
20
|
+
CheckboxRowPressContext.displayName = 'CheckboxRowPressContext';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file CheckboxListItem.tsx
|
|
3
|
-
* @input Uses React, CheckboxInput, ListItem, CheckboxListContext
|
|
3
|
+
* @input Uses React, CheckboxInput, ListItem, CheckboxListContext,
|
|
4
|
+
* CheckboxRowPressContext, the touch presentation and the row press paint
|
|
4
5
|
* @output Exports CheckboxListItem component, CheckboxListItemProps
|
|
5
6
|
* @position Core implementation; consumed by index.ts, tested by CheckboxList.test.tsx
|
|
6
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxListItem.d.ts","sourceRoot":"","sources":["../../src/CheckboxList/CheckboxListItem.tsx"],"names":[],"mappings":"AAIA
|
|
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;AAc5C,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,+BAiLvB;yBAlMe,gBAAgB"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file CheckboxListItem.tsx
|
|
7
|
-
* @input Uses React, CheckboxInput, ListItem, CheckboxListContext
|
|
7
|
+
* @input Uses React, CheckboxInput, ListItem, CheckboxListContext,
|
|
8
|
+
* CheckboxRowPressContext, the touch presentation and the row press paint
|
|
8
9
|
* @output Exports CheckboxListItem component, CheckboxListItemProps
|
|
9
10
|
* @position Core implementation; consumed by index.ts, tested by CheckboxList.test.tsx
|
|
10
11
|
*
|
|
@@ -21,6 +22,10 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
21
22
|
import "../theme/tokens.stylex.js";
|
|
22
23
|
import { colorVars } from "../theme/tokens.stylex.js";
|
|
23
24
|
import { CheckboxInput } from "../CheckboxInput/CheckboxInput.js";
|
|
25
|
+
import { CheckboxRowPressContext } from "../CheckboxInput/CheckboxRowPressContext.js";
|
|
26
|
+
import { rowPressPaintStyles } from "../privateAttributes/press.stylex.js";
|
|
27
|
+
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
28
|
+
import { useTouchPresentation } from "../utils/touchPresentation.js";
|
|
24
29
|
import { ListItem } from "../List/ListItem.js";
|
|
25
30
|
import { ListContext } from "../List/ListContext.js";
|
|
26
31
|
import { CheckboxListContext } from "./CheckboxListContext.js";
|
|
@@ -184,6 +189,14 @@ export function CheckboxListItem({
|
|
|
184
189
|
}) : undefined, [requiredGroup, isBoxChecked, isBoxEnabled]);
|
|
185
190
|
const checkboxInputRef = useMergedRefs(checkboxRef, registerWithRequiredGroup);
|
|
186
191
|
|
|
192
|
+
// Under a finger, a delegating row is the option's only press surface. A
|
|
193
|
+
// touch anywhere on it presses the row. A fine pointer keeps the box's own
|
|
194
|
+
// press.
|
|
195
|
+
const {
|
|
196
|
+
isTouch
|
|
197
|
+
} = useTouchPresentation();
|
|
198
|
+
const rowOwnsPress = isTouch && hasRowInteraction && !effectiveDisabled;
|
|
199
|
+
|
|
187
200
|
// A read-only checkbox carries aria-readonly, which the row's clickable
|
|
188
201
|
// container treats as a non-interactive target, so a click on it would be
|
|
189
202
|
// delegated straight back to the checkbox without end. Stop that click at
|
|
@@ -230,21 +243,34 @@ export function CheckboxListItem({
|
|
|
230
243
|
,
|
|
231
244
|
interactiveRef: hasRowInteraction ? checkboxRef : undefined,
|
|
232
245
|
"aria-busy": isBusy || undefined,
|
|
233
|
-
xstyle: [
|
|
246
|
+
xstyle: [
|
|
247
|
+
// The row's own press paint, which the layer over its box reads.
|
|
248
|
+
rowOwnsPress && rowPressPaintStyles.checkboxRow,
|
|
249
|
+
// Item's row layer drops the strength's release, and the box paints
|
|
250
|
+
// at that strength. So the row brings the release back, and the box
|
|
251
|
+
// fades with the row.
|
|
252
|
+
rowOwnsPress && interactionOverlayStyles.pressedAlpha, resolvedChecked === true && !effectiveDisabled && !effectiveReadOnly && styles.selected, xstyle],
|
|
234
253
|
className: className,
|
|
235
254
|
style: style,
|
|
236
|
-
startContent:
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
value:
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
255
|
+
startContent:
|
|
256
|
+
/*#__PURE__*/
|
|
257
|
+
// Only the row's own checkbox: a checkbox placed in the row's content
|
|
258
|
+
// keeps its own press.
|
|
259
|
+
_jsx(CheckboxRowPressContext, {
|
|
260
|
+
value: rowOwnsPress,
|
|
261
|
+
children: /*#__PURE__*/_jsx(DescribedCheckboxInput, {
|
|
262
|
+
ref: checkboxInputRef,
|
|
263
|
+
label: checkboxLabel,
|
|
264
|
+
"aria-labelledby": namesFromVisibleLabel ? labelID : undefined,
|
|
265
|
+
isLabelHidden: true,
|
|
266
|
+
value: resolvedChecked,
|
|
267
|
+
onChange: () => handleToggle(),
|
|
268
|
+
onClick: handleCheckboxClick,
|
|
269
|
+
isDisabled: effectiveDisabled,
|
|
270
|
+
isReadOnly: effectiveReadOnly,
|
|
271
|
+
isLoading: isBusy,
|
|
272
|
+
size: checkboxSize
|
|
273
|
+
})
|
|
248
274
|
})
|
|
249
275
|
});
|
|
250
276
|
}
|
|
@@ -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/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4B5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AAW5C,OAAO,E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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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../src/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../src/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAyCrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EACV,kBAAkB,EAClB,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AAS,CAAC;IAClB,+CAA+C;IAC/C,WAAW,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,wBAAwB,CAAC;AAM/E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,EACT,IAAW,EACX,KAAK,EAAE,cAAc,EACrB,UAAkB,EAClB,YAAY,EACZ,YAAwB,EACxB,SAAiB,EACjB,GAAG,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,aAAa,EACb,aAAa,EAAE,iBAAiB,EAChC,YAAY,EAAE,gBAAgB,EAC9B,WAAW,EAAE,eAAe,EAC5B,UAAU,EAAE,cAAc,EAC1B,aAAa,EAAE,iBAAiB,EAChC,aAAa,EAAE,MAAM,EACrB,GAAG,IAAI,EACR,EAAE,gBAAgB,qBAijBlB;yBAtkBe,WAAW"}
|
|
@@ -48,6 +48,7 @@ import { useLayerInternal } from "../Layer/useLayer.js";
|
|
|
48
48
|
import { LayerDepthProvider } from "../Layer/LayerDepthContext.js";
|
|
49
49
|
import { useLayerDismissal } from "../Layer/useLayerDismissal.js";
|
|
50
50
|
import { currentGesture } from "../Layer/gestureCounter.js";
|
|
51
|
+
import { noteOutsideDismissal } from "../Layer/outsidePress.js";
|
|
51
52
|
import { MenuBottomSheetActionList } from "../DropdownMenu/MenuBottomSheetActionList.js";
|
|
52
53
|
import { menuBottomSheetStyles } from "../DropdownMenu/menuBottomSheet.stylex.js";
|
|
53
54
|
import { renderDropdownItems } from "../DropdownMenu/renderDropdownItems.js";
|
|
@@ -60,6 +61,8 @@ import { useMenuPress } from "../hooks/useMenuPress.js";
|
|
|
60
61
|
import { useTypeahead } from "../hooks/useTypeahead.js";
|
|
61
62
|
import { useLongPress } from "../hooks/useLongPress.js";
|
|
62
63
|
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
64
|
+
import "../Layer/layerViewportInset.stylex.js";
|
|
65
|
+
import { layerViewportInset } from "../Layer/layerViewportInset.stylex.js";
|
|
63
66
|
import "../theme/tokens.stylex.js";
|
|
64
67
|
import { colorVars, spacingVars, radiusVars, durationVars, easeVars, shadowVars } from "../theme/tokens.stylex.js";
|
|
65
68
|
import { mergeProps, rtlStyles } from "../utils/index.js";
|
|
@@ -86,7 +89,7 @@ const styles = {
|
|
|
86
89
|
k1xSpc: "x78zum5",
|
|
87
90
|
kXwgrk: "xdt5ytf",
|
|
88
91
|
kOIVth: "x1lsbc85",
|
|
89
|
-
kskxy: "
|
|
92
|
+
kskxy: "x1uh1i8a",
|
|
90
93
|
kORKVm: "x1odjw0f",
|
|
91
94
|
"--_dropdown-menu-radius": "x1fcsqxe",
|
|
92
95
|
"--_dropdown-menu-padding": "xgory14",
|
|
@@ -386,6 +389,7 @@ export function ContextMenu({
|
|
|
386
389
|
return;
|
|
387
390
|
}
|
|
388
391
|
if (menu && !menu.contains(e.target)) {
|
|
392
|
+
noteOutsideDismissal(menu.ownerDocument);
|
|
389
393
|
closeMenu();
|
|
390
394
|
}
|
|
391
395
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as stylex from '@stylexjs/stylex';
|
|
2
2
|
import { type InputStatus } from '../Field/index.js';
|
|
3
3
|
import { type ISODateString, type DayOfWeek, type DayOfWeekName } from '../Calendar/index.js';
|
|
4
|
+
import type { CalendarSystem } from '../utils/calendarSystem.js';
|
|
4
5
|
import type { TimestampFormat } from '../Timestamp/index.js';
|
|
5
6
|
import { type PickerPresentation } from '../utils/inputPresentation.js';
|
|
6
7
|
declare const sizeStyles: Readonly<{
|
|
@@ -136,7 +137,8 @@ export interface DateInputProps extends Omit<FieldInputBaseProps<HTMLInputElemen
|
|
|
136
137
|
*/
|
|
137
138
|
dateConstraints?: ReadonlyArray<(date: Date) => boolean>;
|
|
138
139
|
/**
|
|
139
|
-
* Placeholder text shown when no date is selected.
|
|
140
|
+
* Placeholder text shown when no date is selected. A caller placeholder
|
|
141
|
+
* replaces the calendar format hint.
|
|
140
142
|
* @default "Select a date"
|
|
141
143
|
*/
|
|
142
144
|
placeholder?: string;
|
|
@@ -202,9 +204,10 @@ export interface DateInputProps extends Omit<FieldInputBaseProps<HTMLInputElemen
|
|
|
202
204
|
* - `(value: ISODateString) => string`: fully custom display string
|
|
203
205
|
*
|
|
204
206
|
* Formatting applies only to the committed value — never to text the user is
|
|
205
|
-
* actively typing.
|
|
206
|
-
*
|
|
207
|
-
*
|
|
207
|
+
* actively typing. Named formats write the date in the field's `calendar`;
|
|
208
|
+
* `'system_date'` stays the Gregorian ISO date. A custom function's output
|
|
209
|
+
* that the field cannot read back can't be re-committed after an edit;
|
|
210
|
+
* external `value` changes always recompute the display from the ISO value.
|
|
208
211
|
*
|
|
209
212
|
* @default 'date_long'
|
|
210
213
|
* @example
|
|
@@ -219,6 +222,28 @@ export interface DateInputProps extends Omit<FieldInputBaseProps<HTMLInputElemen
|
|
|
219
222
|
* ```
|
|
220
223
|
*/
|
|
221
224
|
format?: DateInputFormat | ((value: ISODateString) => string);
|
|
225
|
+
/**
|
|
226
|
+
* The calendar the field shows dates in, such as `'persian'`, `'hebrew'`, or
|
|
227
|
+
* `'buddhist'`: the text field, its calendar popover, and the bottom sheet's
|
|
228
|
+
* months and wheels. `value`, `onChange`, `min`, and `max` stay Gregorian
|
|
229
|
+
* ISO dates in every calendar. People type a date the way the locale writes
|
|
230
|
+
* it in this calendar, and the committed text uses it.
|
|
231
|
+
* Years are years of this calendar, so a Buddhist field reads `2026` as
|
|
232
|
+
* Buddhist year 2026; set `min` and `max` to catch a year typed in the
|
|
233
|
+
* wrong calendar. Calendars other than `gregory`, `iso8601`, `buddhist`,
|
|
234
|
+
* `roc`, and `japanese` need `Temporal`, native or a polyfill the
|
|
235
|
+
* application loads; without it the field uses the Gregorian calendar.
|
|
236
|
+
* The native date control is Gregorian, so with a calendar other than
|
|
237
|
+
* `gregory` or `iso8601` every presentation that would show it uses the
|
|
238
|
+
* popover on a fine pointer and the bottom sheet on a coarse pointer.
|
|
239
|
+
*
|
|
240
|
+
* @default the InternationalizationProvider's calendar, else `'gregory'`
|
|
241
|
+
* @example
|
|
242
|
+
* ```
|
|
243
|
+
* <DateInput label="Start date" calendar="persian" value={date} onChange={setDate} />
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
calendar?: CalendarSystem;
|
|
222
247
|
/**
|
|
223
248
|
* When date picking is handed to the browser/OS instead of Astryx's own
|
|
224
249
|
* surfaces: the field becomes an `<input type="date">` and the platform
|
|
@@ -244,6 +269,9 @@ export interface DateInputProps extends Omit<FieldInputBaseProps<HTMLInputElemen
|
|
|
244
269
|
* picker. `dateConstraints` is enforced the same way, on commit, and is
|
|
245
270
|
* reason enough to prefer `'never'` on a field that uses it.
|
|
246
271
|
*
|
|
272
|
+
* In a calendar other than `gregory` or `iso8601`, `'touch'` and `'always'`
|
|
273
|
+
* use the calendar popover on a mouse and the touch picker on a finger.
|
|
274
|
+
*
|
|
247
275
|
* @default 'touch'
|
|
248
276
|
* @deprecated Use `presentation` (`spec:AST-043` FR3):
|
|
249
277
|
* `'touch'` → `'adaptive-native'`, `'always'` → `'native'`,
|
|
@@ -258,12 +286,15 @@ export interface DateInputProps extends Omit<FieldInputBaseProps<HTMLInputElemen
|
|
|
258
286
|
* - `'popover'`: Astryx's typed field + calendar popover on every pointer
|
|
259
287
|
* - `'bottom-sheet'`: Astryx's bottom-sheet calendar on every pointer
|
|
260
288
|
* - `'native'`: the browser/OS picker on every pointer, with no Astryx
|
|
261
|
-
* fallback (FR2)
|
|
289
|
+
* fallback (FR2), except in a calendar other than `gregory` or
|
|
290
|
+
* `iso8601`, where it is `'adaptive-bottom-sheet'` and warns in
|
|
291
|
+
* development
|
|
262
292
|
* - `'adaptive-bottom-sheet'`: popover on a fine pointer, bottom sheet on
|
|
263
293
|
* a coarse pointer
|
|
264
294
|
* - `'adaptive-native'` (default): popover on a fine pointer, browser/OS
|
|
265
295
|
* picker on a coarse pointer, keeping the released Astryx fallbacks
|
|
266
|
-
* where a native control cannot express the value (FR2)
|
|
296
|
+
* where a native control cannot express the value (FR2), and the bottom
|
|
297
|
+
* sheet in a calendar other than `gregory` or `iso8601`
|
|
267
298
|
*
|
|
268
299
|
* @default 'adaptive-native'
|
|
269
300
|
*/
|