@astryxdesign/core 0.7.9-canary.4d7dca6 → 0.7.9-canary.4e4cf84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlertDialog/AlertDialog.d.ts +3 -2
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +11 -14
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +32 -3
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +4 -3
- 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/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +11 -2
- package/dist/ButtonGroup/ButtonGroup.d.ts +2 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +28 -5
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +10 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts +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 +47 -14
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +12 -4
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +21 -12
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +5 -1
- package/dist/DateInput/DateInput.d.ts +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 +126 -101
- 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.d.ts +2 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +44 -12
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +19 -9
- package/dist/Icon/ComponentIcon.d.ts +33 -0
- package/dist/Icon/ComponentIcon.d.ts.map +1 -0
- package/dist/Icon/ComponentIcon.js +56 -0
- package/dist/Icon/globalIconRegistry.d.ts +45 -4
- package/dist/Icon/globalIconRegistry.d.ts.map +1 -1
- package/dist/Icon/globalIconRegistry.js +137 -3
- package/dist/Icon/index.d.ts +73 -2
- package/dist/Icon/index.d.ts.map +1 -1
- package/dist/Icon/index.js +42 -3
- package/dist/Icon/useIcon.d.ts +13 -4
- package/dist/Icon/useIcon.d.ts.map +1 -1
- package/dist/Icon/useIcon.js +16 -5
- package/dist/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 +83 -28
- 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/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 +10 -10
- package/dist/Layout/LayoutPanel.d.ts.map +1 -1
- package/dist/Layout/LayoutPanel.js +71 -10
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +5 -1
- 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 +13 -11
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +28 -28
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +7 -2
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +28 -10
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +1 -0
- package/dist/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 +74 -23
- 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/Spinner/Spinner.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +27 -5
- package/dist/Spinner/SpinnerOwnerContext.d.ts +2 -0
- package/dist/Spinner/SpinnerOwnerContext.d.ts.map +1 -0
- package/dist/Spinner/SpinnerOwnerContext.js +20 -0
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
- package/dist/Switch/useSwitchTouch.js +13 -9
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +5 -1
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +1 -0
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +2 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +27 -5
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +16 -8
- package/dist/Timestamp/TimestampHoverCard.d.ts +2 -1
- package/dist/Timestamp/TimestampHoverCard.d.ts.map +1 -1
- package/dist/Timestamp/TimestampHoverCard.js +12 -5
- package/dist/Toast/Toast.js +4 -4
- package/dist/Toast/ToastContext.d.ts +6 -13
- package/dist/Toast/ToastContext.d.ts.map +1 -1
- package/dist/Toast/ToastContext.js +6 -8
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +75 -10
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +10 -50
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +17 -10
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +19 -9
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +2 -0
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +7 -2
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +18 -7
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +11 -4
- package/dist/animator/createAnimator.js +2 -2
- package/dist/astryx.css +367 -337
- package/dist/gestures/createPanGesture.d.ts +49 -0
- package/dist/gestures/createPanGesture.d.ts.map +1 -0
- package/dist/gestures/createPanGesture.js +80 -0
- package/dist/hooks/actionGroupTracker.d.ts +9 -0
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
- package/dist/hooks/actionGroupTracker.js +38 -24
- package/dist/hooks/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/pressGroupContext.d.ts +5 -3
- package/dist/hooks/pressGroupContext.d.ts.map +1 -1
- package/dist/hooks/pressGroupContext.js +17 -9
- package/dist/hooks/useActionGroupTracking.d.ts +29 -4
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -1
- package/dist/hooks/useActionGroupTracking.js +92 -14
- package/dist/hooks/useAnnounceRenderedText.d.ts +10 -2
- package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +45 -8
- package/dist/hooks/useClickableContainer.d.ts +10 -3
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +23 -10
- package/dist/hooks/useGroupPressTracking.d.ts +34 -0
- package/dist/hooks/useGroupPressTracking.d.ts.map +1 -0
- package/dist/hooks/useGroupPressTracking.js +122 -0
- package/dist/hooks/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/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 +6 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +6 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/internal/touch.d.ts +19 -6
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +25 -8
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +10 -7
- package/dist/motion/animator.d.ts +5 -5
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +10 -8
- package/dist/motion/resolveMotion.d.ts +6 -27
- package/dist/motion/resolveMotion.d.ts.map +1 -1
- package/dist/motion/resolveMotion.js +82 -16
- package/dist/motion/themeTempo.d.ts +7 -0
- package/dist/motion/themeTempo.d.ts.map +1 -0
- package/dist/motion/themeTempo.js +38 -0
- package/dist/motion/themeTiming.d.ts +63 -0
- package/dist/motion/themeTiming.d.ts.map +1 -0
- package/dist/motion/themeTiming.js +173 -0
- package/dist/privateAttributes/focusOwner.stylex.d.ts +22 -0
- package/dist/privateAttributes/focusOwner.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/focusOwner.stylex.js +39 -0
- package/dist/privateAttributes/press.stylex.d.ts +18 -11
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/press.stylex.js +20 -11
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +8 -5
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/pressGroupItem.stylex.js +11 -5
- package/dist/theme/defineTheme.d.ts +42 -3
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +48 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +4 -1
- package/dist/theme/resolveThemeValues.d.ts.map +1 -1
- package/dist/theme/resolveThemeValues.js +12 -4
- package/dist/theme/themeMotion.d.ts +7 -5
- package/dist/theme/themeMotion.d.ts.map +1 -1
- package/dist/theme/themeMotion.js +7 -5
- package/dist/utils/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 +35 -2
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +65 -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/dist/utils/touchHitArea.d.ts +49 -0
- package/dist/utils/touchHitArea.d.ts.map +1 -0
- package/dist/utils/touchHitArea.js +177 -0
- package/dist/utils/touchHitArea.stylex.d.ts +31 -4
- package/dist/utils/touchHitArea.stylex.d.ts.map +1 -1
- package/dist/utils/touchHitArea.stylex.js +51 -4
- package/locales/en.json +21 -1
- package/locales/pseudo.json +15 -0
- package/package.json +4 -4
- package/src/AlertDialog/AlertDialog.tsx +9 -13
- package/src/BottomSheet/BottomSheet.tsx +40 -3
- package/src/BottomSheet/bottomSheetStack.ts +4 -3
- package/src/BottomSheet/useSheetGestures.ts +43 -12
- package/src/Breadcrumbs/BreadcrumbItem.tsx +7 -1
- package/src/Button/Button.tsx +17 -2
- package/src/ButtonGroup/ButtonGroup.doc.mjs +3 -2
- package/src/ButtonGroup/ButtonGroup.tsx +28 -4
- package/src/Calendar/useCalendarDays.doc.mjs +158 -0
- package/src/Chat/ChatMessageList.tsx +18 -2
- package/src/CheckboxInput/CheckboxInput.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 +42 -18
- package/src/CodeBlock/CodeBlock.doc.mjs +17 -0
- package/src/CodeBlock/CodeBlock.tsx +11 -2
- package/src/ComplexSelector/ComplexSelector.doc.mjs +2 -2
- package/src/ComplexSelector/ComplexSelector.tsx +39 -31
- package/src/ContextMenu/ContextMenu.tsx +9 -1
- package/src/DateInput/DateInput.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 +173 -163
- 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 +50 -12
- package/src/HoverCard/HoverCard.tsx +4 -1
- package/src/Icon/ComponentIcon.tsx +71 -0
- package/src/Icon/globalIconRegistry.tsx +181 -4
- package/src/Icon/index.ts +85 -2
- package/src/Icon/useIcon.doc.mjs +94 -0
- package/src/Icon/useIcon.ts +24 -3
- package/src/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 +113 -32
- package/src/Item/ItemListRowContext.tsx +18 -0
- 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.doc.mjs +8 -8
- package/src/Layout/LayoutPanel.tsx +105 -15
- package/src/Link/Link.tsx +5 -1
- 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 +31 -19
- package/src/MultiSelector/hooks.ts +28 -35
- package/src/MultiSelector/useMultiCombobox.doc.mjs +2 -2
- package/src/OverflowList/OverflowList.tsx +15 -9
- package/src/Overlay/useOverlay.doc.mjs +176 -0
- package/src/Pagination/Pagination.tsx +23 -9
- package/src/Popover/Popover.tsx +5 -0
- package/src/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 +117 -11
- 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/Spinner/Spinner.doc.mjs +150 -36
- package/src/Spinner/Spinner.tsx +34 -6
- package/src/Spinner/SpinnerOwnerContext.ts +22 -0
- package/src/Switch/useSwitchTouch.ts +17 -9
- package/src/TabList/Tab.tsx +5 -1
- package/src/TabList/TabList.tsx +1 -0
- package/src/Table/Table.doc.mjs +34 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +32 -7
- package/src/Table/plugins/sortable/useTableSortable.tsx +19 -12
- package/src/Table/plugins/sortable/useTableSortableState.doc.mjs +173 -0
- package/src/Timestamp/Timestamp.doc.mjs +17 -0
- package/src/Timestamp/TimestampHoverCard.tsx +11 -3
- package/src/Toast/Toast.doc.mjs +14 -0
- package/src/Toast/Toast.tsx +2 -2
- package/src/Toast/ToastContext.ts +7 -17
- package/src/Toast/ToastViewport.tsx +53 -9
- package/src/Toast/useToast.tsx +7 -52
- package/src/Tokenizer/Tokenizer.tsx +14 -10
- package/src/Tooltip/Tooltip.tsx +4 -1
- package/src/Tooltip/useTooltip.tsx +2 -0
- package/src/TopNav/TopNavItem.tsx +7 -2
- package/src/Typeahead/BaseTypeahead.tsx +34 -8
- package/src/Typeahead/Typeahead.tsx +7 -1
- package/src/animator/createAnimator.doc.mjs +1 -1
- package/src/animator/createAnimator.ts +3 -3
- package/src/gestures/README.md +2 -1
- package/src/gestures/createPanGesture.doc.mjs +145 -0
- package/src/gestures/createPanGesture.ts +107 -0
- package/src/hooks/actionGroupTracker.ts +33 -24
- package/src/hooks/computeOverflow.ts +1 -1
- package/src/hooks/index.ts +8 -0
- package/src/hooks/pressGroupContext.ts +18 -9
- package/src/hooks/useActionGroupTracking.ts +139 -19
- package/src/hooks/useAnimatedLayout.doc.mjs +1 -1
- package/src/hooks/useAnimator.doc.mjs +1 -1
- package/src/hooks/useAnnounceRenderedText.ts +59 -8
- package/src/hooks/useClickableContainer.ts +22 -10
- package/src/hooks/useEntryAnimation.doc.mjs +1 -1
- package/src/hooks/useGroupPressTracking.ts +154 -0
- package/src/hooks/useKeyboardHighlight.ts +71 -0
- 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 +7 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +7 -0
- package/src/index.ts +2 -0
- package/src/internal/touch.ts +32 -9
- package/src/motion/README.md +6 -5
- package/src/motion/animatedLayout.ts +10 -7
- package/src/motion/animator.ts +10 -9
- package/src/motion/resolveMotion.ts +89 -18
- package/src/motion/themeTempo.ts +41 -0
- package/src/motion/themeTiming.ts +198 -0
- package/src/privateAttributes/focusOwner.stylex.ts +51 -0
- package/src/privateAttributes/press.stylex.ts +49 -11
- package/src/privateAttributes/pressGroupItem.stylex.ts +11 -5
- package/src/theme/defineTheme.ts +99 -2
- package/src/theme/generateThemeRules.ts +3 -0
- package/src/theme/resolveThemeValues.ts +12 -3
- package/src/theme/themeMotion.ts +7 -5
- package/src/utils/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 +119 -12
- package/src/utils/inputPresentation.ts +21 -1
- package/src/utils/touchHitArea.stylex.ts +41 -16
- package/src/utils/touchHitArea.ts +225 -0
|
@@ -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;AAe5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAuBvC,MAAM,WAAW,qBAAsB,SAAQ,SAAS,CAAC,aAAa,CAAC;IACrE;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;;;;OAaG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IACtC;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAChC;AAyCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,WAAW,EACX,UAAU,EACV,UAAU,EAAE,cAAsB,EAClC,SAAS,EAAE,aAAqB,EAChC,SAAS,EACT,OAAO,EACP,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EAAE,WAAW,EACpB,KAAK,EACL,GAAG,SAAS,EACb,EAAE,qBAAqB,+BAmLvB;yBApMe,gBAAgB"}
|
|
@@ -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,12 +22,17 @@ 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";
|
|
27
32
|
import { ItemDescriptionContext } from "../Item/ItemDescriptionContext.js";
|
|
28
33
|
import { joinAriaIDs } from "../utils/inputAria.js";
|
|
29
34
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
35
|
+
import { themeDataAttributes } from "../utils/themeProps.js";
|
|
30
36
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
31
37
|
import english from "../i18n/generated-english/CheckboxList/CheckboxListItem.generated.js";
|
|
32
38
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -184,6 +190,14 @@ export function CheckboxListItem({
|
|
|
184
190
|
}) : undefined, [requiredGroup, isBoxChecked, isBoxEnabled]);
|
|
185
191
|
const checkboxInputRef = useMergedRefs(checkboxRef, registerWithRequiredGroup);
|
|
186
192
|
|
|
193
|
+
// Under a finger, a delegating row is the option's only press surface. A
|
|
194
|
+
// touch anywhere on it presses the row. A fine pointer keeps the box's own
|
|
195
|
+
// press.
|
|
196
|
+
const {
|
|
197
|
+
isTouch
|
|
198
|
+
} = useTouchPresentation();
|
|
199
|
+
const rowOwnsPress = isTouch && hasRowInteraction && !effectiveDisabled;
|
|
200
|
+
|
|
187
201
|
// A read-only checkbox carries aria-readonly, which the row's clickable
|
|
188
202
|
// container treats as a non-interactive target, so a click on it would be
|
|
189
203
|
// delegated straight back to the checkbox without end. Stop that click at
|
|
@@ -211,8 +225,14 @@ export function CheckboxListItem({
|
|
|
211
225
|
onCheck?.(shouldCheck);
|
|
212
226
|
}
|
|
213
227
|
};
|
|
228
|
+
|
|
229
|
+
// The state follows the fill, so a theme can restyle the text on it.
|
|
230
|
+
const isCheckedRow = resolvedChecked === true && !effectiveDisabled && !effectiveReadOnly;
|
|
214
231
|
return /*#__PURE__*/_jsx(ListItem, {
|
|
215
232
|
...restProps,
|
|
233
|
+
...themeDataAttributes({
|
|
234
|
+
selected: isCheckedRow ? 'selected' : null
|
|
235
|
+
}),
|
|
216
236
|
ref: ref,
|
|
217
237
|
label: namesFromVisibleLabel ? /*#__PURE__*/_jsx("span", {
|
|
218
238
|
id: labelID,
|
|
@@ -230,21 +250,34 @@ export function CheckboxListItem({
|
|
|
230
250
|
,
|
|
231
251
|
interactiveRef: hasRowInteraction ? checkboxRef : undefined,
|
|
232
252
|
"aria-busy": isBusy || undefined,
|
|
233
|
-
xstyle: [
|
|
253
|
+
xstyle: [
|
|
254
|
+
// The row's own press paint, which the layer over its box reads.
|
|
255
|
+
rowOwnsPress && rowPressPaintStyles.checkboxRow,
|
|
256
|
+
// Item's row layer drops the strength's release, and the box paints
|
|
257
|
+
// at that strength. So the row brings the release back, and the box
|
|
258
|
+
// fades with the row.
|
|
259
|
+
rowOwnsPress && interactionOverlayStyles.pressedAlpha, isCheckedRow && styles.selected, xstyle],
|
|
234
260
|
className: className,
|
|
235
261
|
style: style,
|
|
236
|
-
startContent:
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
value:
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
262
|
+
startContent:
|
|
263
|
+
/*#__PURE__*/
|
|
264
|
+
// Only the row's own checkbox: a checkbox placed in the row's content
|
|
265
|
+
// keeps its own press.
|
|
266
|
+
_jsx(CheckboxRowPressContext, {
|
|
267
|
+
value: rowOwnsPress,
|
|
268
|
+
children: /*#__PURE__*/_jsx(DescribedCheckboxInput, {
|
|
269
|
+
ref: checkboxInputRef,
|
|
270
|
+
label: checkboxLabel,
|
|
271
|
+
"aria-labelledby": namesFromVisibleLabel ? labelID : undefined,
|
|
272
|
+
isLabelHidden: true,
|
|
273
|
+
value: resolvedChecked,
|
|
274
|
+
onChange: () => handleToggle(),
|
|
275
|
+
onClick: handleCheckboxClick,
|
|
276
|
+
isDisabled: effectiveDisabled,
|
|
277
|
+
isReadOnly: effectiveReadOnly,
|
|
278
|
+
isLoading: isBusy,
|
|
279
|
+
size: checkboxSize
|
|
280
|
+
})
|
|
248
281
|
})
|
|
249
282
|
});
|
|
250
283
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../src/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","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SAAS,CAAC;IAC/B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,CACV,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAClD,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC5C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC;AA0UD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,QAAsB,EACtB,KAAK,EACL,gBAAuB,EACvB,cAAsB,EACtB,eAAmB,EACnB,cAAc,EACd,MAAc,EACd,aAAoB,EACpB,MAAM,EACN,UAAU,EACV,SAAiB,EACjB,SAAS,EACT,aAAqB,EACrB,oBAAyB,EACzB,IAAW,EACX,KAAK,EAAE,SAAyB,EAChC,SAAkB,EAClB,SAAS,EAAE,eAAe,EAC1B,aAAsB,EACtB,WAAW,EACX,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,cAAc,qBAmUhB;yBA9Ve,SAAS"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file CodeBlock.tsx
|
|
7
|
-
* @input Uses React, StyleX, theme tokens, CSS Custom Highlight API, SyntaxTheme
|
|
7
|
+
* @input Uses React, StyleX, theme tokens, CSS Custom Highlight API, SyntaxTheme
|
|
8
|
+
* provider, and the theme's `code-block-copy` icon slot
|
|
8
9
|
* @output Exports CodeBlock component and CodeBlockProps
|
|
9
10
|
* @position Core implementation; read-only syntax-highlighted code display
|
|
10
11
|
*/
|
|
@@ -17,6 +18,7 @@ import { isRenderable, mergeProps, rtlStyles } from "../utils/index.js";
|
|
|
17
18
|
import { useClipboard } from "../hooks/useClipboard.js";
|
|
18
19
|
import { useScrollableArea } from "../hooks/useScrollableArea.js";
|
|
19
20
|
import { Icon } from "../Icon/index.js";
|
|
21
|
+
import { ComponentIcon } from "../Icon/ComponentIcon.js";
|
|
20
22
|
import { IconButton } from "../IconButton/index.js";
|
|
21
23
|
import { tokenize, tokenizeAsync, splitDiffLines, flatTokensToLines, SYNC_TOKENIZE_THRESHOLD } from "./tokenizer.js";
|
|
22
24
|
import { isCustomCodeLanguage, languageKey, languageLabel as languageWord, sameCodeLanguage } from "./grammar.js";
|
|
@@ -693,9 +695,15 @@ export function CodeBlock({
|
|
|
693
695
|
const copyButtonEl = hasCopyButton ? /*#__PURE__*/_jsx(IconButton, {
|
|
694
696
|
variant: "ghost",
|
|
695
697
|
size: "sm",
|
|
696
|
-
icon: /*#__PURE__*/_jsx(
|
|
697
|
-
|
|
698
|
-
|
|
698
|
+
icon: /*#__PURE__*/_jsx(ComponentIcon, {
|
|
699
|
+
slot: "code-block-copy",
|
|
700
|
+
state: {
|
|
701
|
+
copied
|
|
702
|
+
},
|
|
703
|
+
fallback: {
|
|
704
|
+
icon: copied ? 'check' : 'copy',
|
|
705
|
+
size: 'sm'
|
|
706
|
+
},
|
|
699
707
|
color: "inherit"
|
|
700
708
|
})
|
|
701
709
|
// A visible "Copy" hover/focus hint via Button's built-in tooltip. It
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComplexSelector.d.ts","sourceRoot":"","sources":["../../src/ComplexSelector/ComplexSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAQZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAG5D,OAAO,KAAK,EAA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H,EAAE,EACF,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,kBAAkB,EAAE,mBAAmB,EACvC,GAAG,SAAS,EACb,EAAE,oBAAoB,CAAC,KAAK,CAAC,qBA8a7B;yBArde,eAAe"}
|
|
@@ -289,15 +289,14 @@ export function ComplexSelector({
|
|
|
289
289
|
const contentId = useId();
|
|
290
290
|
const descriptionId = useId();
|
|
291
291
|
const statusMessageId = useId();
|
|
292
|
-
// With `tooltip` placement Field renders no message box
|
|
293
|
-
//
|
|
294
|
-
// Only that placement renders an on-field status affordance here.
|
|
292
|
+
// With `tooltip` placement, Field renders no message box. The info-tip
|
|
293
|
+
// holds the message and describes the trigger.
|
|
295
294
|
const isTooltipStatus = effectiveStatusVariant === 'tooltip';
|
|
296
295
|
const {
|
|
297
296
|
statusIcon: statusTip,
|
|
298
297
|
describedBy: statusTipDescribedBy
|
|
299
298
|
} = useInputStatusIcon({
|
|
300
|
-
status
|
|
299
|
+
status,
|
|
301
300
|
statusVariant: effectiveStatusVariant,
|
|
302
301
|
size: 'sm'
|
|
303
302
|
});
|
|
@@ -549,21 +548,31 @@ export function ComplexSelector({
|
|
|
549
548
|
},
|
|
550
549
|
children: triggerContent
|
|
551
550
|
})
|
|
552
|
-
}),
|
|
551
|
+
}), isBusy && /*#__PURE__*/_jsx(Spinner, {
|
|
552
|
+
size: "sm",
|
|
553
|
+
"aria-hidden": "true"
|
|
554
|
+
}), isRenderable(statusTip) && (isTooltipStatus ?
|
|
553
555
|
/*#__PURE__*/
|
|
554
|
-
// The info-tip is its own control: a press on it, or on its
|
|
555
|
-
// bubble (portaled, so outside this span in the DOM but
|
|
556
|
-
// React), shows the message without opening the
|
|
556
|
+
// The info-tip is its own control: a press on it, or on its
|
|
557
|
+
// message bubble (portaled, so outside this span in the DOM but
|
|
558
|
+
// inside it in React), shows the message without opening the
|
|
559
|
+
// popup.
|
|
557
560
|
_jsx("span", {
|
|
558
561
|
onClick: stopPropagation,
|
|
559
562
|
...{
|
|
560
563
|
className: "x3nfvp2 x6s0dn4 x2lah0s"
|
|
561
564
|
},
|
|
562
565
|
children: statusTip
|
|
563
|
-
})
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
566
|
+
}) :
|
|
567
|
+
/*#__PURE__*/
|
|
568
|
+
// The plain icon is part of the field: a press on it opens the
|
|
569
|
+
// popup, as a press on the trigger does.
|
|
570
|
+
_jsx("span", {
|
|
571
|
+
...{
|
|
572
|
+
className: "x3nfvp2 x6s0dn4 x2lah0s"
|
|
573
|
+
},
|
|
574
|
+
children: statusTip
|
|
575
|
+
})), !isRenderable(statusTip) && /*#__PURE__*/_jsx(Icon, {
|
|
567
576
|
icon: "chevronDown",
|
|
568
577
|
size: "sm",
|
|
569
578
|
color: "secondary"
|
|
@@ -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,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAEL,KAAK,oBAA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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
|
*/
|
|
@@ -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;AAEH,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,UAAU,CAAC;AAEpD;;;;;;;;;;;;;GAaG;AACH;;;;;;;;GAQG;AACH,iFAAiF;AACjF,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEjE,8FAA8F;AAC9F,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,OAAO,CACnC,eAAe,EACf,MAAM,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,CACtD,CAAC;AAIF,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,eAAe,IAAI,mBAAmB,GACvC,MAAM,UAAU,CAAC;AAGlB,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAC,SAA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