@astryxdesign/core 0.7.9-canary.e2b522f → 0.7.9-canary.e423ffa
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 +32 -3
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +4 -3
- package/dist/BottomSheet/useSheetGestures.js +2 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts +2 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +31 -17
- 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/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +2 -0
- 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/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +2 -2
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +3 -1
- package/dist/DropdownMenu/DropdownMenu.js +2 -4
- package/dist/InfoTip/InfoTip.d.ts.map +1 -1
- package/dist/InfoTip/InfoTip.js +5 -18
- 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 +18 -0
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +74 -26
- package/dist/Item/ItemListRowContext.d.ts +2 -0
- package/dist/Item/ItemListRowContext.d.ts.map +1 -0
- package/dist/Item/ItemListRowContext.js +16 -0
- package/dist/Layer/LayerProvider.d.ts.map +1 -1
- package/dist/Layer/LayerProvider.js +8 -7
- 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/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/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +4 -0
- package/dist/Layout/LayoutPanel.d.ts +10 -10
- package/dist/Layout/LayoutPanel.d.ts.map +1 -1
- package/dist/Layout/LayoutPanel.js +71 -10
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +1 -0
- package/dist/List/ListItem.d.ts +5 -4
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +45 -9
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +6 -9
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +7 -2
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -10
- package/dist/Resizable/ResizeHandle.d.ts +5 -5
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +44 -5
- package/dist/Resizable/resizablePane.d.ts +58 -0
- package/dist/Resizable/resizablePane.d.ts.map +1 -0
- package/dist/Resizable/resizablePane.js +137 -0
- package/dist/Resizable/useResizable.d.ts +7 -0
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +13 -0
- 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 +51 -10
- package/dist/SideNav/SideNav.d.ts +9 -3
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +45 -10
- 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.js +4 -4
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +5 -1
- 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 +14 -7
- 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/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -1
- package/dist/animator/createAnimator.js +2 -2
- package/dist/astryx.css +344 -334
- 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/useClickableContainer.d.ts +10 -3
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +23 -10
- package/dist/hooks/useKeyboardHighlight.d.ts +17 -0
- package/dist/hooks/useKeyboardHighlight.d.ts.map +1 -0
- package/dist/hooks/useKeyboardHighlight.js +38 -0
- 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/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/animator.d.ts +5 -5
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +7 -6
- 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 +14 -11
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/press.stylex.js +15 -11
- package/dist/utils/calendarDateParser.d.ts +3 -1
- package/dist/utils/calendarDateParser.d.ts.map +1 -1
- package/dist/utils/calendarDateParser.js +105 -17
- 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 +34 -13
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +64 -17
- package/dist/utils/hitArea.d.ts +8 -1
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +17 -4
- 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/dist/utils/touchHitArea.d.ts +30 -0
- package/dist/utils/touchHitArea.d.ts.map +1 -0
- package/dist/utils/touchHitArea.js +167 -0
- package/dist/utils/touchHitArea.stylex.d.ts +6 -3
- package/dist/utils/touchHitArea.stylex.d.ts.map +1 -1
- package/dist/utils/touchHitArea.stylex.js +19 -3
- package/locales/en.json +17 -1
- package/locales/pseudo.json +12 -0
- package/package.json +4 -4
- package/src/BottomSheet/BottomSheet.tsx +40 -3
- package/src/BottomSheet/bottomSheetStack.ts +4 -3
- package/src/BottomSheet/useSheetGestures.ts +2 -2
- package/src/CheckboxInput/CheckboxInput.doc.mjs +2 -2
- package/src/CheckboxInput/CheckboxInput.tsx +51 -24
- 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/ContextMenu/ContextMenu.tsx +2 -0
- 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/Dialog/Dialog.tsx +2 -1
- package/src/Drawer/Drawer.tsx +3 -1
- package/src/DropdownMenu/DropdownMenu.tsx +2 -2
- package/src/Icon/useIcon.doc.mjs +94 -0
- package/src/InfoTip/InfoTip.tsx +5 -27
- 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 +99 -31
- package/src/Item/ItemListRowContext.tsx +18 -0
- package/src/Layer/LayerProvider.tsx +9 -8
- package/src/Layer/outsidePress.ts +18 -1
- package/src/Layer/toastHost.tsx +212 -0
- package/src/Layer/useBackdropPress.ts +41 -1
- package/src/Layer/useTouchTrigger.ts +4 -0
- package/src/Layout/LayoutPanel.doc.mjs +8 -8
- package/src/Layout/LayoutPanel.tsx +105 -15
- package/src/Link/useLinkComponent.doc.mjs +95 -0
- package/src/List/List.doc.mjs +10 -1
- package/src/List/List.tsx +5 -0
- package/src/List/ListItem.tsx +63 -8
- package/src/MultiSelector/MultiSelector.tsx +7 -17
- package/src/OverflowList/OverflowList.tsx +15 -9
- package/src/PowerSearch/PowerSearch.doc.mjs +3 -3
- package/src/RadioList/RadioListItem.tsx +5 -13
- package/src/Resizable/Resizable.doc.mjs +40 -12
- package/src/Resizable/ResizeHandle.tsx +68 -6
- package/src/Resizable/resizablePane.ts +179 -0
- package/src/Resizable/useResizable.ts +15 -0
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +15 -62
- package/src/Selector/Selector.tsx +83 -8
- package/src/SideNav/SideNav.doc.mjs +2 -2
- package/src/SideNav/SideNav.tsx +87 -12
- package/src/SideNav/SideNavItem.tsx +8 -6
- package/src/Slider/sliderTouchController.ts +2 -2
- package/src/Switch/useSwitchTouch.ts +4 -4
- package/src/TabList/Tab.tsx +5 -1
- package/src/Toast/ToastContext.ts +7 -17
- package/src/Toast/ToastViewport.tsx +13 -9
- package/src/Toast/useToast.tsx +7 -52
- package/src/Tooltip/useTooltip.tsx +2 -0
- package/src/Typeahead/BaseTypeahead.tsx +2 -0
- 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/useClickableContainer.ts +22 -10
- package/src/hooks/useKeyboardHighlight.ts +71 -0
- package/src/hooks/useMediaQuery.ts +41 -12
- package/src/hooks/useOverflow.ts +321 -75
- package/src/hooks/usePanGesture.doc.mjs +159 -0
- package/src/hooks/usePanGesture.ts +75 -0
- 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 +3 -3
- package/src/motion/animator.ts +7 -7
- package/src/motion/themeTiming.ts +198 -0
- package/src/privateAttributes/press.stylex.ts +29 -11
- package/src/utils/calendarDateParser.ts +108 -18
- package/src/utils/calendarSystem.ts +212 -3
- package/src/utils/coarsePointer.ts +27 -14
- package/src/utils/focusReturn.ts +78 -18
- package/src/utils/hitArea.ts +31 -4
- package/src/utils/inputPresentation.ts +21 -1
- package/src/utils/touchHitArea.stylex.ts +18 -3
- package/src/utils/touchHitArea.ts +177 -0
|
@@ -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,EAAC,MAAM,gBAAgB,CAAC;AA4DhD,YAAY,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAmLhF,UAAU,sBAAuB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,qDAAqD;IACrD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IAEd,0EAA0E;IAC1E,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB,wGAAwG;IACxG,MAAM,CAAC,EAAE,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;IAE7C;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAEjD;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,UAAU,0BAA2B,SAAQ,sBAAsB;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,KAAK,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 {
|
|
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) {
|
|
@@ -533,7 +562,7 @@ function StandaloneBottomSheet({
|
|
|
533
562
|
if (revealed != null && (returnTarget == null || !revealed.element.contains(returnTarget))) {
|
|
534
563
|
revealed.focus();
|
|
535
564
|
} else if (returnTarget != null) {
|
|
536
|
-
|
|
565
|
+
returnFocusForLastInput(returnTarget);
|
|
537
566
|
}
|
|
538
567
|
triggerRef.current = null;
|
|
539
568
|
}, [finalFocusRef, hasScrim, isOpen]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottomSheetStack.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/bottomSheetStack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bottomSheetStack.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/bottomSheetStack.ts"],"names":[],"mappings":"AAuDA,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,yBAAyB,GAAG,I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FAA+F;AAC/F,eAAO,MAAM,kCAAkC;;;;sBAI3B,MAAM;IAExB,8DAA8D;iCACjC,QAAQ;CACtC,CAAC"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file bottomSheetStack.ts
|
|
7
|
-
* @input The DOM (dialog elements, document order) and
|
|
7
|
+
* @input The DOM (dialog elements, document order) and the focus-return
|
|
8
|
+
* utilities
|
|
8
9
|
* @output The private bottom-sheet stack registry: host registration,
|
|
9
10
|
* open-order ranking, top-layer reconciliation, one view per host, the
|
|
10
11
|
* replace handoff, and the shared native show/hide and focus helpers
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
// two copies of this module on one page share one stack. A copy on another
|
|
50
51
|
// version keeps its own stack. Each document is its own stack.
|
|
51
52
|
import { notifyTopLayerEntry } from "../Layer/modalOutlet.js";
|
|
52
|
-
import { focusForLastInput } from "../utils/focusReturn.js";
|
|
53
|
+
import { focusForLastInput, returnFocusForLastInput } from "../utils/focusReturn.js";
|
|
53
54
|
|
|
54
55
|
/** The motions a host's panel reports to the registry during a replace. */
|
|
55
56
|
|
|
@@ -240,7 +241,7 @@ function completeClosingGroup(group) {
|
|
|
240
241
|
group.reported = true;
|
|
241
242
|
const target = group.returnTarget;
|
|
242
243
|
if (target != null && target.isConnected) {
|
|
243
|
-
|
|
244
|
+
returnFocusForLastInput(target);
|
|
244
245
|
}
|
|
245
246
|
}
|
|
246
247
|
|
|
@@ -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.
|
|
@@ -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,U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AC;IACnD;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAOD;;;;;;;;;;;;;;;;;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";
|
|
@@ -36,10 +38,11 @@ import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
|
36
38
|
import { useIndicator } from "../Indicator/useIndicator.js";
|
|
37
39
|
import { themeProps } from "../utils/themeProps.js";
|
|
38
40
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
39
|
-
import {
|
|
41
|
+
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();
|
|
@@ -222,14 +240,9 @@ export function CheckboxInput({
|
|
|
222
240
|
// checkbox is a marker in another component's row, which keeps its target.
|
|
223
241
|
const hasHitArea = !isLabelHidden && !isDisabled && !isReadOnly;
|
|
224
242
|
const inputRef = useRef(null);
|
|
225
|
-
// The
|
|
226
|
-
//
|
|
227
|
-
const watchRowHitArea =
|
|
228
|
-
if (row == null || !hasHitArea) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
return watchHitArea(row, insets => writeHitInsets(row, insets));
|
|
232
|
-
}, [hasHitArea]);
|
|
243
|
+
// The band's insets stay live while the row takes taps, and clear when it
|
|
244
|
+
// stops.
|
|
245
|
+
const watchRowHitArea = useTouchHitArea(hasHitArea);
|
|
233
246
|
// The disabled-message tooltip listens for hover and focus on the whole
|
|
234
247
|
// row, a larger trigger. It anchors on the checkbox itself (below), so it
|
|
235
248
|
// shows next to the control. Its handlers check isEnabled, so the row
|
|
@@ -301,20 +314,21 @@ export function CheckboxInput({
|
|
|
301
314
|
ref: rowRef,
|
|
302
315
|
onPointerDown: hasHitArea ? handleRowPointerDown : undefined,
|
|
303
316
|
onClick: hasHitArea ? handleRowClick : undefined,
|
|
304
|
-
...(
|
|
317
|
+
...(ownsPress ? pressable : undefined),
|
|
305
318
|
...stylex.props(styles.container, isLabelHidden && styles.containerLabelHidden, hasHitArea && styles.hitAreaHost, hasHitArea && touchHitAreaStyles.layer,
|
|
306
319
|
// Hover and focus reach the checkbox visual through this ancestor
|
|
307
320
|
// marker rather than props, so the whole row drives it.
|
|
308
|
-
!isDisabled && indicatorScope, !isDisabled && styles.indicatorPressImage,
|
|
321
|
+
!isDisabled && indicatorScope, !isDisabled && (isRowPressSurface ? styles.indicatorRowPressImage : styles.indicatorPressImage),
|
|
309
322
|
// The touch press's strength and release live on the row the
|
|
310
323
|
// controller writes to; the layer over the checkbox box inherits
|
|
311
|
-
// and paints it.
|
|
312
|
-
|
|
324
|
+
// and paints it. Under a row that owns the press, the box inherits
|
|
325
|
+
// that row's strength instead.
|
|
326
|
+
ownsPress && interactionOverlayStyles.pressedAlpha),
|
|
313
327
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
314
|
-
...stylex.props(styles.checkboxWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay),
|
|
328
|
+
...stylex.props(styles.checkboxWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay, !isDisabled && isRowPressSurface && styles.indicatorRowPressOverlay),
|
|
315
329
|
...focusProps,
|
|
316
330
|
children: [/*#__PURE__*/_jsx("input", {
|
|
317
|
-
...rest,
|
|
331
|
+
...withholdCallerHandlers(rest, isDisabled),
|
|
318
332
|
ref: useMergedRefs(ref, indeterminateRef, disabledMessageTooltip.positionRef, inputRef),
|
|
319
333
|
id: id,
|
|
320
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":"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;AAwCrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAGtC,OA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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";
|
|
@@ -386,6 +387,7 @@ export function ContextMenu({
|
|
|
386
387
|
return;
|
|
387
388
|
}
|
|
388
389
|
if (menu && !menu.contains(e.target)) {
|
|
390
|
+
noteOutsideDismissal(menu.ownerDocument);
|
|
389
391
|
closeMenu();
|
|
390
392
|
}
|
|
391
393
|
};
|
|
@@ -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
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/DateInput/DateInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/DateInput/DateInput.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAQlB,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAkBrB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAG5D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAwDpC,QAAA,MAAM,UAAU;;;;;;;;;;;;;EAad,CAAC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