@astryxdesign/core 0.4.5 → 0.4.6-canary.cea9ecd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +134 -0
- package/dist/Avatar/Avatar.d.ts +10 -5
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +139 -30
- package/dist/Avatar/AvatarStatusDot.d.ts +2 -1
- package/dist/Avatar/AvatarStatusDot.d.ts.map +1 -1
- package/dist/Avatar/AvatarStatusDot.js +30 -4
- package/dist/Avatar/AvatarStatusLabelContext.d.ts +39 -0
- package/dist/Avatar/AvatarStatusLabelContext.d.ts.map +1 -0
- package/dist/Avatar/AvatarStatusLabelContext.js +41 -0
- package/dist/AvatarGroup/AvatarGroup.d.ts +3 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +15 -9
- package/dist/Blockquote/Blockquote.d.ts +4 -3
- package/dist/Blockquote/Blockquote.d.ts.map +1 -1
- package/dist/Blockquote/Blockquote.js +9 -10
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +21 -5
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +47 -34
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +7 -7
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +21 -12
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarNavigation.js +8 -4
- package/dist/Calendar/styles.d.ts +2 -2
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +5 -5
- package/dist/Center/Center.d.ts +23 -1
- package/dist/Center/Center.d.ts.map +1 -1
- package/dist/Center/Center.js +12 -6
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +3 -3
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +2 -2
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +2 -2
- package/dist/Chat/useChatDictation.d.ts +1 -1
- package/dist/Chat/useChatDictation.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.d.ts +1 -1
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +4 -3
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +2 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +2 -2
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +5 -5
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +4 -4
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +1 -1
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +2 -2
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +3 -3
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +6 -6
- package/dist/DateInput/DateInput.d.ts +31 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +90 -22
- package/dist/DateInput/MonthScroller.d.ts +35 -0
- package/dist/DateInput/MonthScroller.d.ts.map +1 -0
- package/dist/DateInput/MonthScroller.js +658 -0
- package/dist/DateInput/MonthYearWheels.d.ts +24 -0
- package/dist/DateInput/MonthYearWheels.d.ts.map +1 -0
- package/dist/DateInput/MonthYearWheels.js +114 -0
- package/dist/DateInput/TouchDateField.d.ts +10 -0
- package/dist/DateInput/TouchDateField.d.ts.map +1 -0
- package/dist/DateInput/TouchDateField.js +810 -0
- package/dist/DateInput/Wheel.d.ts +41 -0
- package/dist/DateInput/Wheel.d.ts.map +1 -0
- package/dist/DateInput/Wheel.js +315 -0
- package/dist/DateInput/monthGeometry.d.ts +65 -0
- package/dist/DateInput/monthGeometry.d.ts.map +1 -0
- package/dist/DateInput/monthGeometry.js +98 -0
- package/dist/DateInput/tokens.stylex.d.ts +63 -0
- package/dist/DateInput/tokens.stylex.d.ts.map +1 -0
- package/dist/DateInput/tokens.stylex.js +74 -0
- package/dist/DateInput/useOwnScrollGesture.d.ts +41 -0
- package/dist/DateInput/useOwnScrollGesture.d.ts.map +1 -0
- package/dist/DateInput/useOwnScrollGesture.js +202 -0
- package/dist/DateInput/usePointerDragScroll.d.ts +15 -0
- package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -0
- package/dist/DateInput/usePointerDragScroll.js +216 -0
- package/dist/DateInput/useScrollSettle.d.ts +26 -0
- package/dist/DateInput/useScrollSettle.d.ts.map +1 -0
- package/dist/DateInput/useScrollSettle.js +149 -0
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +17 -14
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +17 -14
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +2 -2
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +2 -2
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +2 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +2 -2
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +4 -4
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +6 -0
- package/dist/Field/inputStyles.stylex.d.ts +1 -1
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +5 -5
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +6 -6
- package/dist/HoverCard/HoverCard.d.ts +13 -3
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +2 -0
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/HoverCard/index.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.d.ts +17 -2
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +78 -9
- package/dist/InputGroup/InputGroup.js +1 -1
- package/dist/Item/Item.d.ts +9 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +52 -14
- package/dist/Layer/index.d.ts +4 -2
- package/dist/Layer/index.d.ts.map +1 -1
- package/dist/Layer/index.js +2 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +3 -2
- package/dist/Layer/useTouchTrigger.d.ts +113 -0
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -0
- package/dist/Layer/useTouchTrigger.js +241 -0
- package/dist/Layout/container.stylex.d.ts +4 -2
- package/dist/Layout/container.stylex.d.ts.map +1 -1
- package/dist/Layout/container.stylex.js +19 -11
- package/dist/Layout/index.d.ts +1 -0
- package/dist/Layout/index.d.ts.map +1 -1
- package/dist/Layout/index.js +4 -0
- package/dist/Layout/padding.stylex.d.ts +315 -12
- package/dist/Layout/padding.stylex.d.ts.map +1 -1
- package/dist/Layout/padding.stylex.js +389 -12
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +5 -4
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +6 -6
- package/dist/MetadataList/MetadataList.d.ts.map +1 -1
- package/dist/MetadataList/MetadataList.js +1 -1
- package/dist/MobileNav/MobileNav.d.ts +1 -0
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +24 -6
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +8 -8
- package/dist/NavItem/navItemStyles.stylex.d.ts +4 -4
- package/dist/NavItem/navItemStyles.stylex.d.ts.map +1 -1
- package/dist/NavItem/navItemStyles.stylex.js +4 -4
- package/dist/NavMenu/NavHeadingMenuItem.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenuItem.js +3 -3
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +36 -8
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +3 -3
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +2 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +11 -12
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +3 -1
- package/dist/PowerSearch/formatFilterValue.d.ts +11 -2
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +23 -8
- package/dist/RadioList/RadioListItem.d.ts +2 -2
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +70 -40
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +7 -7
- package/dist/Section/Section.d.ts +36 -1
- package/dist/Section/Section.d.ts.map +1 -1
- package/dist/Section/Section.js +12 -2
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +7 -2
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +3 -3
- package/dist/Selector/Selector.d.ts +26 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +93 -20
- package/dist/Selector/SelectorOption.d.ts +14 -1
- package/dist/Selector/SelectorOption.d.ts.map +1 -1
- package/dist/Selector/SelectorOption.js +6 -0
- package/dist/Selector/SelectorRowLayoutContext.d.ts +8 -0
- package/dist/Selector/SelectorRowLayoutContext.d.ts.map +1 -0
- package/dist/Selector/SelectorRowLayoutContext.js +27 -0
- package/dist/Selector/types.d.ts +1 -0
- package/dist/Selector/types.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +4 -4
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +3 -3
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +7 -7
- package/dist/Stack/Stack.d.ts +23 -1
- package/dist/Stack/Stack.d.ts.map +1 -1
- package/dist/Stack/Stack.js +12 -6
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +2 -2
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +1 -1
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +3 -3
- package/dist/Table/TableRow.js +4 -4
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +2 -2
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +2 -2
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +2 -2
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts +5 -3
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.js +12 -9
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +3 -3
- package/dist/TextArea/TextArea.js +1 -1
- package/dist/TextInput/TextInput.js +1 -1
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +3 -3
- package/dist/TimeInput/TimeInput.js +2 -2
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +6 -4
- package/dist/Timestamp/formatInstant.d.ts +3 -2
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +8 -8
- package/dist/Timestamp/tooltipEntries.d.ts +2 -1
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.js +5 -3
- package/dist/Toast/Toast.d.ts +4 -3
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +10 -7
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +6 -6
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +1 -1
- package/dist/Tooltip/Tooltip.d.ts +16 -3
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +2 -0
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +21 -2
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +71 -13
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +4 -4
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +3 -3
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +2 -2
- package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +2 -2
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +4 -4
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +7 -7
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -2
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +1 -1
- package/dist/astryx.css +124 -62
- package/dist/hooks/containerReveal.stylex.d.ts.map +1 -1
- package/dist/hooks/containerReveal.stylex.js +18 -18
- package/dist/hooks/scrollbarGutter.d.ts +28 -0
- package/dist/hooks/scrollbarGutter.d.ts.map +1 -0
- package/dist/hooks/scrollbarGutter.js +103 -0
- package/dist/hooks/useAutoMediaMode.d.ts +31 -0
- package/dist/hooks/useAutoMediaMode.d.ts.map +1 -0
- package/dist/hooks/useAutoMediaMode.js +201 -0
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +1 -1
- package/dist/hooks/useListFocus.d.ts +5 -2
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +12 -6
- package/dist/hooks/useScrollLock.d.ts +4 -0
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +13 -1
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +2 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +6 -0
- package/dist/i18n/useCollator.d.ts +12 -0
- package/dist/i18n/useCollator.d.ts.map +1 -0
- package/dist/i18n/useCollator.js +40 -0
- package/dist/i18n/useLocale.d.ts +3 -0
- package/dist/i18n/useLocale.d.ts.map +1 -0
- package/dist/i18n/useLocale.js +31 -0
- package/dist/theme/MediaTheme.d.ts +25 -5
- package/dist/theme/MediaTheme.d.ts.map +1 -1
- package/dist/theme/MediaTheme.js +31 -6
- package/dist/theme/defineTheme.d.ts +5 -0
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +5 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +7 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +66 -5
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/syntax/index.d.ts +6 -0
- package/dist/theme/syntax/index.d.ts.map +1 -1
- package/dist/theme/syntax/index.js +7 -2
- package/dist/utils/dateParser.d.ts +4 -3
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +8 -8
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/plainDate.d.ts +5 -2
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +20 -4
- package/locales/en.json +28 -0
- package/locales/pseudo.json +21 -0
- package/package.json +3 -3
- package/src/Avatar/Avatar.doc.mjs +10 -6
- package/src/Avatar/Avatar.test.tsx +219 -1
- package/src/Avatar/Avatar.tsx +179 -37
- package/src/Avatar/AvatarStatusDot.tsx +30 -4
- package/src/Avatar/AvatarStatusLabelContext.ts +47 -0
- package/src/AvatarGroup/AvatarGroup.doc.mjs +10 -6
- package/src/AvatarGroup/AvatarGroup.test.tsx +62 -0
- package/src/AvatarGroup/AvatarGroup.tsx +3 -1
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +31 -8
- package/src/Banner/Banner.doc.mjs +2 -0
- package/src/Blockquote/Blockquote.doc.mjs +30 -7
- package/src/Blockquote/Blockquote.test.tsx +34 -3
- package/src/Blockquote/Blockquote.tsx +11 -9
- package/src/BottomSheet/BottomSheet.doc.mjs +3 -3
- package/src/BottomSheet/BottomSheet.test.tsx +24 -0
- package/src/BottomSheet/BottomSheetPanel.test.tsx +91 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +58 -3
- package/src/Breadcrumbs/BreadcrumbItem.tsx +36 -23
- package/src/Breadcrumbs/Breadcrumbs.doc.mjs +26 -2
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +31 -0
- package/src/Button/Button.tsx +12 -9
- package/src/Calendar/Calendar.tsx +15 -9
- package/src/Calendar/hooks/useCalendarNavigation.ts +6 -4
- package/src/Calendar/styles.ts +8 -5
- package/src/Center/Center.doc.mjs +48 -0
- package/src/Center/Center.test.tsx +158 -0
- package/src/Center/Center.tsx +50 -9
- package/src/Chat/ChatComposer.tsx +11 -5
- package/src/Chat/ChatComposerDrawer.tsx +4 -1
- package/src/Chat/ChatToolCalls.tsx +13 -4
- package/src/Chat/{useChatDictation.test.ts → useChatDictation.test.tsx} +29 -14
- package/src/Chat/useChatDictation.ts +1 -1
- package/src/Chat/useSpeechRecognition.ts +5 -3
- package/src/Chat/useTriggerMenu.tsx +4 -1
- package/src/CheckboxInput/CheckboxInput.tsx +5 -2
- package/src/Citation/Citation.test.tsx +6 -1
- package/src/Citation/Citation.tsx +11 -5
- package/src/ClickableCard/ClickableCard.tsx +7 -4
- package/src/CodeBlock/CodeBlock.tsx +4 -1
- package/src/Collapsible/Collapsible.tsx +5 -2
- package/src/CommandPalette/CommandPaletteItem.tsx +6 -3
- package/src/ComplexSelector/ComplexSelector.doc.mjs +10 -0
- package/src/ComplexSelector/ComplexSelector.tsx +14 -7
- package/src/DateInput/DateInput.test.tsx +17 -1
- package/src/DateInput/DateInput.tsx +93 -21
- package/src/DateInput/DateInputTouch.test.tsx +2582 -0
- package/src/DateInput/MonthScroller.tsx +878 -0
- package/src/DateInput/MonthYearWheels.tsx +147 -0
- package/src/DateInput/TouchDateField.tsx +1223 -0
- package/src/DateInput/Wheel.tsx +473 -0
- package/src/DateInput/monthGeometry.ts +118 -0
- package/src/DateInput/tokens.stylex.ts +99 -0
- package/src/DateInput/useOwnScrollGesture.ts +227 -0
- package/src/DateInput/usePointerDragScroll.ts +220 -0
- package/src/DateInput/useScrollSettle.ts +164 -0
- package/src/DateRangeInput/DateRangeInput.doc.mjs +1 -1
- package/src/DateRangeInput/DateRangeInput.tsx +31 -13
- package/src/DateTimeInput/DateTimeInput.tsx +25 -9
- package/src/Dialog/Dialog.test.tsx +24 -0
- package/src/Dialog/Dialog.tsx +3 -0
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +5 -2
- package/src/DropdownMenu/DropdownMenuItem.tsx +5 -2
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +5 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +5 -2
- package/src/Field/Field.doc.mjs +2 -0
- package/src/Field/FieldLabel.tsx +9 -3
- package/src/Field/InputClearButton.test.tsx +110 -3
- package/src/Field/InputClearButton.tsx +38 -0
- package/src/Field/inputStyles.stylex.ts +17 -13
- package/src/FileInput/FileInput.tsx +15 -8
- package/src/FormLayout/FormLayout.doc.mjs +1 -1
- package/src/HoverCard/HoverCard.doc.mjs +18 -0
- package/src/HoverCard/HoverCard.test.tsx +189 -0
- package/src/HoverCard/HoverCard.tsx +22 -2
- package/src/HoverCard/index.ts +1 -0
- package/src/HoverCard/useHoverCard.doc.mjs +2 -0
- package/src/HoverCard/useHoverCard.tsx +103 -7
- package/src/InputGroup/InputGroup.tsx +1 -1
- package/src/Item/Item.doc.mjs +1 -0
- package/src/Item/Item.test.tsx +50 -0
- package/src/Item/Item.tsx +54 -6
- package/src/Layer/index.ts +10 -0
- package/src/Layer/useLayer.tsx +13 -2
- package/src/Layer/useTouchTrigger.test.ts +70 -0
- package/src/Layer/useTouchTrigger.ts +366 -0
- package/src/Layout/Layout.doc.mjs +18 -0
- package/src/Layout/container.stylex.ts +11 -3
- package/src/Layout/index.ts +4 -0
- package/src/Layout/overlayPaddingReset.test.tsx +222 -0
- package/src/Layout/padding.stylex.ts +192 -12
- package/src/Lightbox/Lightbox.tsx +11 -3
- package/src/Link/Link.tsx +9 -6
- package/src/MetadataList/MetadataList.tsx +4 -1
- package/src/MobileNav/MobileNav.tsx +61 -5
- package/src/MobileNav/MobileNavEntryAnimation.test.tsx +212 -0
- package/src/MobileNav/MobileNavScrollbarGutter.test.tsx +109 -0
- package/src/MultiSelector/MultiSelector.test.tsx +1 -1
- package/src/MultiSelector/MultiSelector.tsx +26 -10
- package/src/NavItem/navItemStyles.stylex.ts +7 -4
- package/src/NavMenu/NavHeadingMenuItem.tsx +6 -3
- package/src/NumberInput/NumberInput.doc.mjs +24 -0
- package/src/NumberInput/NumberInput.test.tsx +138 -0
- package/src/NumberInput/NumberInput.tsx +47 -8
- package/src/Outline/Outline.tsx +5 -2
- package/src/Pagination/Pagination.tsx +5 -2
- package/src/Popover/Popover.test.tsx +27 -1
- package/src/PowerSearch/PowerSearch.tsx +17 -8
- package/src/PowerSearch/PowerSearchToken.tsx +3 -0
- package/src/PowerSearch/formatFilterValue.test.ts +22 -2
- package/src/PowerSearch/formatFilterValue.ts +31 -6
- package/src/RadioList/RadioList.doc.mjs +1 -1
- package/src/RadioList/RadioList.test.tsx +170 -2
- package/src/RadioList/RadioListItem.tsx +88 -53
- package/src/Resizable/ResizeHandle.test.tsx +22 -0
- package/src/Resizable/ResizeHandle.tsx +25 -7
- package/src/Section/Section.doc.mjs +55 -0
- package/src/Section/Section.test.tsx +201 -4
- package/src/Section/Section.tsx +69 -0
- package/src/SegmentedControl/SegmentedControl.test.tsx +31 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +15 -3
- package/src/SelectableCard/SelectableCard.tsx +6 -3
- package/src/Selector/Selector.doc.mjs +16 -2
- package/src/Selector/Selector.test.tsx +525 -1
- package/src/Selector/Selector.tsx +180 -25
- package/src/Selector/SelectorOption.doc.mjs +7 -0
- package/src/Selector/SelectorOption.tsx +21 -0
- package/src/Selector/SelectorRowLayoutContext.ts +32 -0
- package/src/Selector/types.ts +4 -4
- package/src/SideNav/SideNavHeading.tsx +14 -5
- package/src/SideNav/SideNavItem.tsx +9 -3
- package/src/Slider/Slider.tsx +25 -6
- package/src/Stack/Stack.doc.mjs +72 -0
- package/src/Stack/Stack.test.tsx +156 -0
- package/src/Stack/Stack.tsx +50 -8
- package/src/Switch/Switch.tsx +5 -2
- package/src/TabList/Tab.tsx +4 -1
- package/src/TabList/TabMenu.tsx +9 -3
- package/src/Table/TableRow.tsx +4 -4
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +6 -2
- package/src/Table/plugins/filtering/useTableFiltering.tsx +4 -1
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +10 -3
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +6 -3
- package/src/Table/plugins/sortable/useTableSortable.tsx +4 -1
- package/src/Table/plugins/sortable/useTableSortableState.test.tsx +34 -0
- package/src/Table/plugins/sortable/useTableSortableState.tsx +26 -23
- package/src/Table/plugins/tree/useTableTreeData.tsx +10 -4
- package/src/TextArea/TextArea.doc.mjs +1 -1
- package/src/TextArea/TextArea.tsx +1 -1
- package/src/TextInput/TextInput.tsx +1 -1
- package/src/Thumbnail/Thumbnail.tsx +9 -3
- package/src/TimeInput/TimeInput.tsx +1 -1
- package/src/Timestamp/Timestamp.test.tsx +27 -7
- package/src/Timestamp/Timestamp.tsx +8 -4
- package/src/Timestamp/formatInstant.ts +9 -7
- package/src/Timestamp/tooltipEntries.test.ts +11 -6
- package/src/Timestamp/tooltipEntries.ts +6 -2
- package/src/Toast/Toast.tsx +9 -7
- package/src/Token/Token.tsx +14 -5
- package/src/Tokenizer/Tokenizer.tsx +4 -1
- package/src/Tooltip/Tooltip.doc.mjs +18 -0
- package/src/Tooltip/Tooltip.test.tsx +254 -1
- package/src/Tooltip/Tooltip.tsx +22 -2
- package/src/Tooltip/index.ts +1 -0
- package/src/Tooltip/useTooltip.doc.mjs +2 -0
- package/src/Tooltip/useTooltip.tsx +99 -21
- package/src/TopNav/TopNavHeading.tsx +13 -4
- package/src/TopNav/TopNavItem.tsx +6 -3
- package/src/TopNav/TopNavMegaMenu.tsx +5 -2
- package/src/TopNav/TopNavMegaMenuItem.tsx +5 -2
- package/src/TopNav/TopNavMenu.tsx +10 -4
- package/src/TreeList/TreeListItem.tsx +22 -7
- package/src/Typeahead/BaseTypeahead.tsx +5 -2
- package/src/Typeahead/Typeahead.tsx +4 -1
- package/src/hooks/containerReveal.stylex.ts +54 -18
- package/src/hooks/scrollbarGutter.test.ts +167 -0
- package/src/hooks/scrollbarGutter.ts +121 -0
- package/src/hooks/useAutoMediaMode.test.ts +109 -0
- package/src/hooks/useAutoMediaMode.ts +233 -0
- package/src/hooks/useInputStatusIcon.tsx +4 -1
- package/src/hooks/useListFocus.doc.mjs +2 -2
- package/src/hooks/useListFocus.test.tsx +65 -3
- package/src/hooks/useListFocus.ts +15 -7
- package/src/hooks/useScrollLock.doc.mjs +4 -4
- package/src/hooks/useScrollLock.test.ts +73 -0
- package/src/hooks/useScrollLock.ts +14 -0
- package/src/i18n/InternationalizationContext.ts +2 -0
- package/src/i18n/__tests__/e2e-powersearch.test.tsx +37 -1
- package/src/i18n/__tests__/useCollator.test.tsx +115 -0
- package/src/i18n/__tests__/useLocale.test.tsx +52 -0
- package/src/i18n/index.ts +6 -0
- package/src/i18n/useCollator.doc.mjs +84 -0
- package/src/i18n/useCollator.ts +44 -0
- package/src/i18n/useLocale.doc.mjs +70 -0
- package/src/i18n/useLocale.ts +34 -0
- package/src/i18n/useTranslator.doc.mjs +1 -1
- package/src/reset.css +9 -2
- package/src/reset.test.ts +22 -0
- package/src/theme/MediaTheme.doc.mjs +23 -4
- package/src/theme/MediaTheme.dom.test.tsx +97 -0
- package/src/theme/MediaTheme.tsx +42 -7
- package/src/theme/defineTheme.test.ts +9 -3
- package/src/theme/defineTheme.ts +5 -0
- package/src/theme/derivedVarRegistry.test.ts +19 -5
- package/src/theme/derivedVarRegistry.ts +4 -0
- package/src/theme/generateThemeRules.test.ts +118 -0
- package/src/theme/generateThemeRules.ts +83 -5
- package/src/theme/index.ts +1 -1
- package/src/theme/syntax/index.ts +6 -2
- package/src/theme/syntax/serverSafeSyntax.test.ts +68 -0
- package/src/utils/dateParser.test.ts +20 -0
- package/src/utils/dateParser.ts +14 -7
- package/src/utils/index.ts +2 -0
- package/src/utils/plainDate.test.ts +6 -0
- package/src/utils/plainDate.ts +21 -4
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file MonthScroller.tsx
|
|
7
|
+
* @input Month bounds, selected value, constraints, week start
|
|
8
|
+
* @output Exports MonthScroller and MonthScrollerHandle
|
|
9
|
+
* @position Internal component; consumed by TouchDateField.tsx
|
|
10
|
+
*
|
|
11
|
+
* The continuous surface: months stacked vertically in one scroller, each pane
|
|
12
|
+
* exactly as tall as the scrollport and snapped to its start. Two consequences
|
|
13
|
+
* fall out of that single geometric choice — the picker never changes height,
|
|
14
|
+
* and there is no resting position that shows half of two months.
|
|
15
|
+
*
|
|
16
|
+
* Every pane is a fixed six-row grid, including the months that only need
|
|
17
|
+
* four or five, because a pane whose height depended on its contents would
|
|
18
|
+
* make snap offsets vary from month to month and the scroll position drift.
|
|
19
|
+
*
|
|
20
|
+
* The list is long (a century by default) but only a few panes are ever
|
|
21
|
+
* mounted: a spacer holds the full scroll height and the visible panes are
|
|
22
|
+
* positioned into it absolutely. Nothing is stitched or recycled during a
|
|
23
|
+
* scroll, so snap offsets are constant and momentum is never interrupted —
|
|
24
|
+
* which is the failure mode of the usual "append months at the edge" approach.
|
|
25
|
+
*
|
|
26
|
+
* SYNC: When modified, update:
|
|
27
|
+
* - /packages/core/src/DateInput/TouchDateField.tsx
|
|
28
|
+
* - /packages/core/src/DateInput/DateInput.doc.mjs
|
|
29
|
+
* - /packages/core/src/DateInput/DateInputTouch.test.tsx
|
|
30
|
+
*/
|
|
31
|
+
import { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from 'react';
|
|
32
|
+
import * as stylex from '@stylexjs/stylex';
|
|
33
|
+
import { useCalendarDays } from "../Calendar/index.js";
|
|
34
|
+
import { useDirection } from "../i18n/index.js";
|
|
35
|
+
import "../theme/tokens.stylex.js";
|
|
36
|
+
import { colorVars, radiusVars, fontWeightVars, typeScaleVars, durationVars, borderVars } from "../theme/tokens.stylex.js";
|
|
37
|
+
import { focusOutlineStyles } from "../utils/index.js";
|
|
38
|
+
import { plainDateAddDays, plainDateDayOfWeek, plainDateFormat, plainDateIsEqual, plainDateToISO, DATE_FORMAT_MONTH_YEAR, DATE_FORMAT_WITH_WEEKDAY } from "../utils/index.js";
|
|
39
|
+
import "./tokens.stylex.js";
|
|
40
|
+
import { dateInputTouchSizes, dateInputTouchGeometry } from "./tokens.stylex.js";
|
|
41
|
+
import { useOwnScrollGesture } from "./useOwnScrollGesture.js";
|
|
42
|
+
import { useScrollSettle } from "./useScrollSettle.js";
|
|
43
|
+
import { fromMonthIndex, monthIndexOf, paneWindow, rowAtScrollOffset, rowsIn, scrollOffsetForRow } from "./monthGeometry.js";
|
|
44
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
45
|
+
const DAY_SIZE = dateInputTouchSizes.daySize;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Panes mounted on each side of the visible one. Sized against a fast fling:
|
|
49
|
+
* the window widens once per animation frame, so it only fails if a single
|
|
50
|
+
* frame travels further than this — three months, about 800px at the default
|
|
51
|
+
* day size. Under `scroll-snap-type: mandatory`, landing on an unmounted pane
|
|
52
|
+
* would not merely show a gap, it would re-snap to the nearest mounted one.
|
|
53
|
+
*/
|
|
54
|
+
const OVERSCAN = 3;
|
|
55
|
+
const styles = {
|
|
56
|
+
spacer: {
|
|
57
|
+
kVAEAm: "x1n2onr6",
|
|
58
|
+
kZKoxP: "x5yr21d",
|
|
59
|
+
$$css: true
|
|
60
|
+
},
|
|
61
|
+
pane: {
|
|
62
|
+
kVAEAm: "x10l6tqk",
|
|
63
|
+
kYYq5F: "x10no89f",
|
|
64
|
+
kZKoxP: "xm8gem",
|
|
65
|
+
k5xd4v: "x1bhewko",
|
|
66
|
+
k1xSpc: "xrvj5dj",
|
|
67
|
+
kumcoG: "x1mzazjb",
|
|
68
|
+
k9llMU: "xy8nx85",
|
|
69
|
+
$$css: true
|
|
70
|
+
},
|
|
71
|
+
day: {
|
|
72
|
+
k1xSpc: "x78zum5",
|
|
73
|
+
kGNEyG: "x6s0dn4",
|
|
74
|
+
kjj79g: "xl56j7k",
|
|
75
|
+
kzqmXN: "xh8yej3",
|
|
76
|
+
kZKoxP: "x5yr21d",
|
|
77
|
+
k7Eaqz: "x1tutbut",
|
|
78
|
+
kAzted: "x1dg37ty",
|
|
79
|
+
kmVPX3: "x1717udv",
|
|
80
|
+
kMzoRj: "xc342km",
|
|
81
|
+
ksu8eU: "xng3xce",
|
|
82
|
+
kWkggS: "xjbqb8w",
|
|
83
|
+
kMwMTN: "x1tgivj0",
|
|
84
|
+
kGuDYH: "xjm74w1",
|
|
85
|
+
k63SB2: "x1sodnla",
|
|
86
|
+
kkrTdU: "x1ypdohk x16khyan",
|
|
87
|
+
kfSwDN: "x87ps6o",
|
|
88
|
+
kQizK7: "x1i10hfl",
|
|
89
|
+
$$css: true
|
|
90
|
+
},
|
|
91
|
+
dayOutside: {
|
|
92
|
+
kMwMTN: "xv1l7n4",
|
|
93
|
+
kSiTet: "xbyyjgo",
|
|
94
|
+
$$css: true
|
|
95
|
+
},
|
|
96
|
+
dayDisabled: {
|
|
97
|
+
kSiTet: "xuzhngd",
|
|
98
|
+
kkrTdU: "xt0e3qv",
|
|
99
|
+
$$css: true
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const _temp = {
|
|
103
|
+
kzqmXN: "x1uyokj7",
|
|
104
|
+
"$$css": true
|
|
105
|
+
};
|
|
106
|
+
const _temp2 = {
|
|
107
|
+
kLqNvP: "x1lxsm33",
|
|
108
|
+
kzqmXN: "x1uyokj7",
|
|
109
|
+
"$$css": true
|
|
110
|
+
};
|
|
111
|
+
const dynamic = {
|
|
112
|
+
spacer: inlineSize => [_temp, {
|
|
113
|
+
"--x-inlineSize": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(`${inlineSize}px`)
|
|
114
|
+
}],
|
|
115
|
+
pane: (insetInlineStart, inlineSize) => [_temp2, {
|
|
116
|
+
"--x-insetInlineStart": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(`${insetInlineStart}px`),
|
|
117
|
+
"--x-inlineSize": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(`${inlineSize}px`)
|
|
118
|
+
}]
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* A vertically continuous, snap-paged run of month grids.
|
|
122
|
+
*/
|
|
123
|
+
export function MonthScroller({
|
|
124
|
+
handleRef,
|
|
125
|
+
minMonthIndex,
|
|
126
|
+
maxMonthIndex,
|
|
127
|
+
initialMonthIndex,
|
|
128
|
+
onVisibleMonthChange,
|
|
129
|
+
selectedDate,
|
|
130
|
+
today,
|
|
131
|
+
isDateDisabled,
|
|
132
|
+
weekStartsOn,
|
|
133
|
+
onSelect
|
|
134
|
+
}) {
|
|
135
|
+
const scrollerRef = useRef(null);
|
|
136
|
+
const rowCount = maxMonthIndex - minMonthIndex + 1;
|
|
137
|
+
|
|
138
|
+
// Pane WIDTH is read from layout, never assumed: it is whatever the CSS
|
|
139
|
+
// says the scrollport is, so the snap offsets and the virtualization follow
|
|
140
|
+
// a resize (rotation, a split-screen change) without re-deriving anything.
|
|
141
|
+
const [paneSize, setPaneSize] = useState(0);
|
|
142
|
+
// Which way the inline axis runs. Under RTL the panes lay out from the
|
|
143
|
+
// right and scrollLeft counts DOWN from 0, so every conversion between a
|
|
144
|
+
// row and a scroll offset has to know.
|
|
145
|
+
const isRTL = useDirection() === 'rtl';
|
|
146
|
+
const [centerRow, setCenterRow] = useState(initialMonthIndex - minMonthIndex);
|
|
147
|
+
// The visible row, mirrored so the scroll handler can tell "changed" from
|
|
148
|
+
// "same" without reading state, and notify the parent OUTSIDE a state
|
|
149
|
+
// updater — React runs updaters during render, where another component's
|
|
150
|
+
// setState is illegal.
|
|
151
|
+
const centerRowRef = useRef(centerRow);
|
|
152
|
+
// A row to scroll to once its pane is mounted; see scrollToMonth.
|
|
153
|
+
const pendingScrollRef = useRef(null);
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* The row a programmatic scroll is heading for, so its own scroll events
|
|
157
|
+
* are not reported back as if the user had gone there. Null once a finger
|
|
158
|
+
* touches the scroller, or once the steered scroll has arrived.
|
|
159
|
+
*/
|
|
160
|
+
const steeredRowRef = useRef(null);
|
|
161
|
+
|
|
162
|
+
// Keyboard focus moves by date, not by cell index, so it crosses month
|
|
163
|
+
// boundaries the way a calendar should. Null until the user takes the grid
|
|
164
|
+
// with the keyboard.
|
|
165
|
+
const [focusedDate, setFocusedDate] = useState(null);
|
|
166
|
+
const shouldRestoreFocusRef = useRef(false);
|
|
167
|
+
const onVisibleMonthChangeRef = useRef(onVisibleMonthChange);
|
|
168
|
+
onVisibleMonthChangeRef.current = onVisibleMonthChange;
|
|
169
|
+
useLayoutEffect(() => {
|
|
170
|
+
const scroller = scrollerRef.current;
|
|
171
|
+
if (scroller == null) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const measure = () => {
|
|
175
|
+
// Ignore zero: the picker can be mounted inside something not yet
|
|
176
|
+
// displayed (a closed BottomSheet), and a zero width would unmount
|
|
177
|
+
// every pane and lose the scroll position.
|
|
178
|
+
const measured = scroller.clientWidth;
|
|
179
|
+
if (measured > 0) {
|
|
180
|
+
// eslint-disable-next-line @eslint-react/set-state-in-effect -- pane width is a measurement; layout is the only place it exists
|
|
181
|
+
setPaneSize(measured);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
measure();
|
|
185
|
+
const observer = new ResizeObserver(measure);
|
|
186
|
+
observer.observe(scroller);
|
|
187
|
+
return () => observer.disconnect();
|
|
188
|
+
}, []);
|
|
189
|
+
|
|
190
|
+
// Land on the initial month before the first paint. Runs once the height is
|
|
191
|
+
// known; `hasPositioned` keeps a later resize from yanking the user back.
|
|
192
|
+
const hasPositionedRef = useRef(false);
|
|
193
|
+
useLayoutEffect(() => {
|
|
194
|
+
const scroller = scrollerRef.current;
|
|
195
|
+
if (scroller == null || paneSize === 0 || hasPositionedRef.current) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
hasPositionedRef.current = true;
|
|
199
|
+
scroller.scrollLeft = scrollOffsetForRow(initialMonthIndex - minMonthIndex, paneSize, isRTL);
|
|
200
|
+
}, [paneSize, initialMonthIndex, minMonthIndex, isRTL]);
|
|
201
|
+
const scrollToMonth = useCallback((monthIndex, behavior = 'smooth') => {
|
|
202
|
+
const scroller = scrollerRef.current;
|
|
203
|
+
if (scroller == null || paneSize === 0) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const row = Math.min(rowCount - 1, Math.max(0, monthIndex - minMonthIndex));
|
|
207
|
+
if (Math.abs(row - centerRowRef.current) > OVERSCAN) {
|
|
208
|
+
// Beyond the mounted window there is no pane at the target offset, and
|
|
209
|
+
// `scroll-snap-type: mandatory` will not leave the scroller resting
|
|
210
|
+
// where no snap area is — it re-snaps to the nearest mounted pane, so
|
|
211
|
+
// a jump to another year lands one month away instead. Mount the
|
|
212
|
+
// target first and scroll once it exists (see the layout effect
|
|
213
|
+
// below); a jump that far is never worth animating either.
|
|
214
|
+
pendingScrollRef.current = row;
|
|
215
|
+
centerRowRef.current = row;
|
|
216
|
+
setCenterRow(row);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
steeredRowRef.current = row;
|
|
220
|
+
scroller.scrollTo({
|
|
221
|
+
left: scrollOffsetForRow(row, paneSize, isRTL),
|
|
222
|
+
behavior
|
|
223
|
+
});
|
|
224
|
+
}, [paneSize, minMonthIndex, rowCount, isRTL]);
|
|
225
|
+
|
|
226
|
+
// Deliberately un-keyed: it runs after every render, costs a null check, and
|
|
227
|
+
// must fire on whichever render finally mounts the pending row's pane.
|
|
228
|
+
useLayoutEffect(() => {
|
|
229
|
+
const row = pendingScrollRef.current;
|
|
230
|
+
const scroller = scrollerRef.current;
|
|
231
|
+
if (row == null || scroller == null || paneSize === 0) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
pendingScrollRef.current = null;
|
|
235
|
+
scroller.scrollTo({
|
|
236
|
+
left: scrollOffsetForRow(row, paneSize, isRTL),
|
|
237
|
+
behavior: 'auto'
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
useImperativeHandle(handleRef, () => ({
|
|
241
|
+
scrollToMonth
|
|
242
|
+
}), [scrollToMonth]);
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Put the scroller back on a pane boundary once the gesture is over.
|
|
246
|
+
*
|
|
247
|
+
* `scroll-snap-type: mandatory` is supposed to make this unnecessary, and
|
|
248
|
+
* on a static list it does. This list is virtualized: seven panes exist out
|
|
249
|
+
* of twelve hundred, and the panes ARE the snap areas — so every month the
|
|
250
|
+
* finger crosses mounts one and unmounts another, mid-fling.
|
|
251
|
+
*
|
|
252
|
+
* iOS scrolls off the main thread. It picks a landing place from the snap
|
|
253
|
+
* points it knows about at the time, and a React re-render that lands after
|
|
254
|
+
* that decision moves them; the scroller then comes to rest where no snap
|
|
255
|
+
* point exists any more, and nothing re-snaps it. That is the calendar
|
|
256
|
+
* sitting between two months with the weekday header still square — the
|
|
257
|
+
* grid is not skewed, the scrollport is simply parked a couple of columns
|
|
258
|
+
* into a pane. Chrome hides it by snapping again after the mutation.
|
|
259
|
+
*
|
|
260
|
+
* So the rest position is corrected here rather than trusted. It waits for
|
|
261
|
+
* a true settle — touch released AND quiet, since iOS below 26 has no
|
|
262
|
+
* `scrollend` and its momentum outlasts any naive timer (see
|
|
263
|
+
* useScrollSettle) — and only moves when the offset is genuinely off, so a
|
|
264
|
+
* scroller the browser snapped for itself is left alone.
|
|
265
|
+
*
|
|
266
|
+
* ## Why it re-checks that the scroller is still
|
|
267
|
+
*
|
|
268
|
+
* A quiet period is not proof of rest, and getting that wrong here does not
|
|
269
|
+
* merely fail to fix the bug — it REVERSES the user's swipe. iOS runs its
|
|
270
|
+
* own snap animation for ~150-300ms after the finger lifts, and the scroll
|
|
271
|
+
* events it fires during that animation arrive irregularly; a gap longer
|
|
272
|
+
* than the quiet period is routine in the slow tail. The settle then lands
|
|
273
|
+
* mid-animation, reads a scrollLeft still travelling toward April, rounds
|
|
274
|
+
* THAT to the nearest pane — which is still March, because the animation is
|
|
275
|
+
* not yet halfway — and drags the calendar back where it came from. Swipe
|
|
276
|
+
* forward, get pulled backward, which is what this looked like on a device.
|
|
277
|
+
*
|
|
278
|
+
* Two samples a frame apart settle it: if the offset moved, the scroller is
|
|
279
|
+
* still going somewhere and its destination is not ours to guess. Skipping
|
|
280
|
+
* costs nothing, because the animation's own scroll events re-arm the
|
|
281
|
+
* settle, and the last of them gets a quiet period that ends at true rest.
|
|
282
|
+
*
|
|
283
|
+
* The threshold is a subpixel rather than exact equality. A scroller at rest
|
|
284
|
+
* on a fractional-density viewport can report an offset that wobbles in the
|
|
285
|
+
* last decimal place, and exact equality would read that as travel and never
|
|
286
|
+
* correct at all — the failure mode being silent, which is the worst kind.
|
|
287
|
+
* A tail crawling slower than half a pixel a frame has effectively arrived,
|
|
288
|
+
* so treating it as arrived is right anyway.
|
|
289
|
+
*
|
|
290
|
+
* The correction is at most half a pane by construction, and its own scroll
|
|
291
|
+
* settles onto the boundary it just aimed at, so it cannot oscillate.
|
|
292
|
+
*/
|
|
293
|
+
const settleFrameRef = useRef(undefined);
|
|
294
|
+
useEffect(() => () => {
|
|
295
|
+
if (settleFrameRef.current != null) {
|
|
296
|
+
cancelAnimationFrame(settleFrameRef.current);
|
|
297
|
+
}
|
|
298
|
+
}, []);
|
|
299
|
+
useScrollSettle(scrollerRef, scroller => {
|
|
300
|
+
if (paneSize === 0) {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
const offsetBefore = scroller.scrollLeft;
|
|
304
|
+
if (settleFrameRef.current != null) {
|
|
305
|
+
cancelAnimationFrame(settleFrameRef.current);
|
|
306
|
+
}
|
|
307
|
+
settleFrameRef.current = requestAnimationFrame(() => {
|
|
308
|
+
settleFrameRef.current = undefined;
|
|
309
|
+
// Still travelling — including a snap animation iOS has not finished.
|
|
310
|
+
// Correcting toward the nearest pane from a position mid-flight would
|
|
311
|
+
// undo the swipe rather than complete it.
|
|
312
|
+
if (Math.abs(scroller.scrollLeft - offsetBefore) >= 0.5) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
const row = rowAtScrollOffset(scroller.scrollLeft, paneSize, rowCount, isRTL);
|
|
316
|
+
const target = scrollOffsetForRow(row, paneSize, isRTL);
|
|
317
|
+
// Sub-pixel drift is the browser's own rounding, not a failed snap.
|
|
318
|
+
if (Math.abs(scroller.scrollLeft - target) < 1) {
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
scroller.scrollTo({
|
|
322
|
+
left: target,
|
|
323
|
+
behavior: 'smooth'
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
// Claim horizontal gestures, leave vertical ones to the sheet.
|
|
329
|
+
//
|
|
330
|
+
// `touch-action: pan-x` alone is NOT enough: it governs what the browser
|
|
331
|
+
// pans natively, and the sheet's listener is JavaScript whose
|
|
332
|
+
// preventDefault() cancels the scroll regardless. Measured — a swipe 9° off
|
|
333
|
+
// horizontal had every touchmove cancelled by the sheet and the month never
|
|
334
|
+
// changed. The axis lock is biased toward horizontal, because a thumb arcs
|
|
335
|
+
// as it swipes; `onSwipe` then pages the diagonals the browser itself
|
|
336
|
+
// declines to pan, so no angle is left doing nothing. See
|
|
337
|
+
// useOwnScrollGesture.
|
|
338
|
+
useOwnScrollGesture(scrollerRef, 'inline', {
|
|
339
|
+
onSwipe: direction => {
|
|
340
|
+
const scroller = scrollerRef.current;
|
|
341
|
+
if (scroller == null || paneSize === 0) {
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
scroller.scrollBy({
|
|
345
|
+
left: direction * paneSize,
|
|
346
|
+
behavior: 'smooth'
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
// rAF-throttled: a touch scroll fires far more scroll events than frames,
|
|
352
|
+
// and all this does is move a label and widen a window.
|
|
353
|
+
const frameRef = useRef(undefined);
|
|
354
|
+
useEffect(() => {
|
|
355
|
+
const scroller = scrollerRef.current;
|
|
356
|
+
// Not before the height is known. A listener attached while it was zero
|
|
357
|
+
// would close over that zero and report row 0 for any scroll — and the
|
|
358
|
+
// scroll event fired by the initial positioning arrives just late enough
|
|
359
|
+
// to be handled by that stale listener. Every pane then unmounts except
|
|
360
|
+
// rows 0-2, and `scroll-snap-type: mandatory` yanks the scroller to the
|
|
361
|
+
// nearest surviving snap area, a century away from where it just landed.
|
|
362
|
+
if (scroller == null || paneSize === 0) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
// A finger on the scroller ends any steering: from here the months it
|
|
366
|
+
// passes are the user's doing and every one of them is worth reporting.
|
|
367
|
+
const onTouchStart = () => {
|
|
368
|
+
steeredRowRef.current = null;
|
|
369
|
+
};
|
|
370
|
+
const onScroll = () => {
|
|
371
|
+
if (frameRef.current != null) {
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
frameRef.current = requestAnimationFrame(() => {
|
|
375
|
+
frameRef.current = undefined;
|
|
376
|
+
const row = rowAtScrollOffset(scroller.scrollLeft, paneSize, rowCount, isRTL);
|
|
377
|
+
if (row === centerRowRef.current) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
centerRowRef.current = row;
|
|
381
|
+
setCenterRow(row);
|
|
382
|
+
// Report nothing while a steer is in flight. `scrollToMonth` is only
|
|
383
|
+
// ever called by something that already knows the month — a wheel
|
|
384
|
+
// commit, a header arrow, the re-assert when the wheels close — so
|
|
385
|
+
// none of the scrolling it causes is news, including whatever the
|
|
386
|
+
// scroller passes through on the way.
|
|
387
|
+
//
|
|
388
|
+
// Reporting it is a feedback cycle, and worse on iOS. A wheel commit
|
|
389
|
+
// steers this scroller while it is hidden behind the wheels, and a
|
|
390
|
+
// hidden scroller does not reliably stay where it was put: iOS
|
|
391
|
+
// re-snaps it when the panel becomes visible again, firing scrolls at
|
|
392
|
+
// the exact moment reports start being trusted again. The month drifted
|
|
393
|
+
// on the way back to the calendar.
|
|
394
|
+
//
|
|
395
|
+
// Cleared on arrival, or by a touch below — once a finger is on the
|
|
396
|
+
// scroller the user owns it, and every month it passes is worth
|
|
397
|
+
// reporting.
|
|
398
|
+
if (steeredRowRef.current != null) {
|
|
399
|
+
if (steeredRowRef.current === row) {
|
|
400
|
+
steeredRowRef.current = null;
|
|
401
|
+
}
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
onVisibleMonthChangeRef.current(minMonthIndex + row);
|
|
405
|
+
});
|
|
406
|
+
};
|
|
407
|
+
scroller.addEventListener('scroll', onScroll, {
|
|
408
|
+
passive: true
|
|
409
|
+
});
|
|
410
|
+
scroller.addEventListener('touchstart', onTouchStart, {
|
|
411
|
+
passive: true
|
|
412
|
+
});
|
|
413
|
+
return () => {
|
|
414
|
+
scroller.removeEventListener('scroll', onScroll);
|
|
415
|
+
scroller.removeEventListener('touchstart', onTouchStart);
|
|
416
|
+
if (frameRef.current != null) {
|
|
417
|
+
cancelAnimationFrame(frameRef.current);
|
|
418
|
+
frameRef.current = undefined;
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
}, [paneSize, rowCount, minMonthIndex, isRTL]);
|
|
422
|
+
|
|
423
|
+
// Move the keyboard focus by whole days and let the scroller follow. Paging
|
|
424
|
+
// by month is PageUp/PageDown; everything else is the APG grid vocabulary.
|
|
425
|
+
const moveFocus = useCallback((from, deltaDays) => {
|
|
426
|
+
const next = plainDateAddDays(from, deltaDays);
|
|
427
|
+
const nextIndex = monthIndexOf(next);
|
|
428
|
+
if (nextIndex < minMonthIndex || nextIndex > maxMonthIndex) {
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
shouldRestoreFocusRef.current = true;
|
|
432
|
+
setFocusedDate(next);
|
|
433
|
+
if (nextIndex !== monthIndexOf(from)) {
|
|
434
|
+
scrollToMonth(nextIndex, 'smooth');
|
|
435
|
+
}
|
|
436
|
+
}, [minMonthIndex, maxMonthIndex, scrollToMonth]);
|
|
437
|
+
const handleKeyDown = useCallback((event, date) => {
|
|
438
|
+
// Column within the displayed week, which is what Home/End move to —
|
|
439
|
+
// not the day of the month.
|
|
440
|
+
const column = (plainDateDayOfWeek(date) - weekStartsOn + 7) % 7;
|
|
441
|
+
switch (event.key) {
|
|
442
|
+
case 'ArrowLeft':
|
|
443
|
+
event.preventDefault();
|
|
444
|
+
moveFocus(date, -1);
|
|
445
|
+
break;
|
|
446
|
+
case 'ArrowRight':
|
|
447
|
+
event.preventDefault();
|
|
448
|
+
moveFocus(date, 1);
|
|
449
|
+
break;
|
|
450
|
+
case 'ArrowUp':
|
|
451
|
+
event.preventDefault();
|
|
452
|
+
moveFocus(date, -7);
|
|
453
|
+
break;
|
|
454
|
+
case 'ArrowDown':
|
|
455
|
+
event.preventDefault();
|
|
456
|
+
moveFocus(date, 7);
|
|
457
|
+
break;
|
|
458
|
+
case 'Home':
|
|
459
|
+
event.preventDefault();
|
|
460
|
+
moveFocus(date, -column);
|
|
461
|
+
break;
|
|
462
|
+
case 'End':
|
|
463
|
+
event.preventDefault();
|
|
464
|
+
moveFocus(date, 6 - column);
|
|
465
|
+
break;
|
|
466
|
+
default:
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
}, [moveFocus, weekStartsOn]);
|
|
470
|
+
|
|
471
|
+
// The focused day may have been in an unmounted pane a frame ago; focus it
|
|
472
|
+
// once it exists, and only in response to a key press so a scroll never
|
|
473
|
+
// steals focus.
|
|
474
|
+
const focusedISO = focusedDate == null ? null : plainDateToISO(focusedDate);
|
|
475
|
+
useEffect(() => {
|
|
476
|
+
if (!shouldRestoreFocusRef.current || focusedISO == null) {
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
const target = scrollerRef.current?.querySelector(`[data-date="${focusedISO}"]`);
|
|
480
|
+
if (target != null) {
|
|
481
|
+
shouldRestoreFocusRef.current = false;
|
|
482
|
+
// preventScroll: the scroller is already snapping to this month; a
|
|
483
|
+
// browser scroll-into-view here would fight the snap and land between
|
|
484
|
+
// two panes.
|
|
485
|
+
target.focus({
|
|
486
|
+
preventScroll: true
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
}, [focusedISO]);
|
|
490
|
+
const visibleRows = paneWindow(centerRow, rowCount, OVERSCAN);
|
|
491
|
+
|
|
492
|
+
// A focus event fires for the programmatic focus above too; only take the
|
|
493
|
+
// date when it is actually a different day.
|
|
494
|
+
const handleDayFocus = useCallback(date => {
|
|
495
|
+
setFocusedDate(previous => previous != null && plainDateIsEqual(previous, date) ? previous : date);
|
|
496
|
+
}, []);
|
|
497
|
+
return /*#__PURE__*/_jsx("div", {
|
|
498
|
+
ref: scrollerRef,
|
|
499
|
+
"data-scroller": "months",
|
|
500
|
+
...{
|
|
501
|
+
className: "x1n2onr6 xm8gem x9f619 xw2csxc x10wlt62 xhfbhpw xish69e x1rohswg x1bblx7b"
|
|
502
|
+
},
|
|
503
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
504
|
+
...stylex.props(styles.spacer, dynamic.spacer(rowCount * paneSize)),
|
|
505
|
+
children: paneSize > 0 && rowsIn(visibleRows).map(row => /*#__PURE__*/_jsx(MonthPane, {
|
|
506
|
+
monthIndex: minMonthIndex + row,
|
|
507
|
+
insetInlineStart: row * paneSize,
|
|
508
|
+
inlineSize: paneSize,
|
|
509
|
+
selectedDate: selectedDate,
|
|
510
|
+
focusedDate: focusedDate,
|
|
511
|
+
today: today,
|
|
512
|
+
isDateDisabled: isDateDisabled,
|
|
513
|
+
weekStartsOn: weekStartsOn,
|
|
514
|
+
onSelect: onSelect,
|
|
515
|
+
onDayKeyDown: handleKeyDown,
|
|
516
|
+
onDayFocus: handleDayFocus
|
|
517
|
+
}, row))
|
|
518
|
+
})
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
MonthScroller.displayName = 'MonthScroller';
|
|
522
|
+
/**
|
|
523
|
+
* One month, as a six-row grid.
|
|
524
|
+
*
|
|
525
|
+
* There is no `role="columnheader"` row in here: the weekday names are a
|
|
526
|
+
* single sticky row outside the scroller (they would otherwise scroll away),
|
|
527
|
+
* so each day instead carries its weekday in its accessible name.
|
|
528
|
+
*/
|
|
529
|
+
function MonthPane({
|
|
530
|
+
monthIndex,
|
|
531
|
+
insetInlineStart,
|
|
532
|
+
inlineSize,
|
|
533
|
+
selectedDate,
|
|
534
|
+
focusedDate,
|
|
535
|
+
today,
|
|
536
|
+
isDateDisabled,
|
|
537
|
+
weekStartsOn,
|
|
538
|
+
onSelect,
|
|
539
|
+
onDayKeyDown,
|
|
540
|
+
onDayFocus
|
|
541
|
+
}) {
|
|
542
|
+
const {
|
|
543
|
+
year,
|
|
544
|
+
month
|
|
545
|
+
} = fromMonthIndex(monthIndex);
|
|
546
|
+
const {
|
|
547
|
+
weeks
|
|
548
|
+
} = useCalendarDays({
|
|
549
|
+
year,
|
|
550
|
+
month,
|
|
551
|
+
weekStartsOn,
|
|
552
|
+
// Always six rows: a variable grid would make pane heights differ, and
|
|
553
|
+
// with them every snap offset below this month.
|
|
554
|
+
hasVariableRowCount: false
|
|
555
|
+
});
|
|
556
|
+
const monthLabel = plainDateFormat({
|
|
557
|
+
year,
|
|
558
|
+
month,
|
|
559
|
+
day: 1
|
|
560
|
+
}, DATE_FORMAT_MONTH_YEAR);
|
|
561
|
+
|
|
562
|
+
// Exactly one day per pane is tab-reachable, so Tab moves through the
|
|
563
|
+
// picker rather than through 42 buttons: the focused day if the keyboard
|
|
564
|
+
// owns one, else the selection, else the first of the month.
|
|
565
|
+
const tabbableISO = (() => {
|
|
566
|
+
if (focusedDate != null && focusedDate.year === year && focusedDate.month === month) {
|
|
567
|
+
return plainDateToISO(focusedDate);
|
|
568
|
+
}
|
|
569
|
+
if (selectedDate != null && selectedDate.year === year && selectedDate.month === month) {
|
|
570
|
+
return plainDateToISO(selectedDate);
|
|
571
|
+
}
|
|
572
|
+
return plainDateToISO({
|
|
573
|
+
year,
|
|
574
|
+
month,
|
|
575
|
+
day: 1
|
|
576
|
+
});
|
|
577
|
+
})();
|
|
578
|
+
return /*#__PURE__*/_jsx("div", {
|
|
579
|
+
role: "grid",
|
|
580
|
+
"aria-label": monthLabel,
|
|
581
|
+
"data-month": monthLabel,
|
|
582
|
+
...stylex.props(styles.pane, dynamic.pane(insetInlineStart, inlineSize)),
|
|
583
|
+
children: weeks.map(week => /*#__PURE__*/_jsx("div", {
|
|
584
|
+
role: "row",
|
|
585
|
+
...{
|
|
586
|
+
className: "xjp7ctv"
|
|
587
|
+
},
|
|
588
|
+
children: week.map(day => {
|
|
589
|
+
// A spilled day is context, not a choice. Calendar computes the
|
|
590
|
+
// same thing as `effectivelyDisabled: isDisabled || isOutside`,
|
|
591
|
+
// and guards today/selected on `!isOutside` beside it, so a date
|
|
592
|
+
// borrowed from a neighbouring month never carries a ring or a
|
|
593
|
+
// puck in the pane that is only showing it.
|
|
594
|
+
const isDisabled = day.isOutside || isDateDisabled(day.date);
|
|
595
|
+
const isSelected = !day.isOutside && selectedDate != null && plainDateIsEqual(day.date, selectedDate);
|
|
596
|
+
const isToday = !day.isOutside && plainDateIsEqual(day.date, today);
|
|
597
|
+
return /*#__PURE__*/_jsx("div", {
|
|
598
|
+
role: "gridcell",
|
|
599
|
+
"aria-selected": isSelected || undefined,
|
|
600
|
+
...{
|
|
601
|
+
className: "x1n2onr6 x78zum5 x6s0dn4 xl56j7k"
|
|
602
|
+
},
|
|
603
|
+
children: /*#__PURE__*/_jsx("button", {
|
|
604
|
+
type: "button",
|
|
605
|
+
"data-date": day.iso,
|
|
606
|
+
tabIndex: day.iso === tabbableISO ? 0 : -1,
|
|
607
|
+
"aria-label": plainDateFormat(day.date, DATE_FORMAT_WITH_WEEKDAY),
|
|
608
|
+
"aria-disabled": isDisabled || undefined,
|
|
609
|
+
"aria-current": isToday ? 'date' : undefined,
|
|
610
|
+
onClick: () => {
|
|
611
|
+
if (!isDisabled) {
|
|
612
|
+
onSelect(day.iso);
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
onFocus: () => onDayFocus(day.date),
|
|
616
|
+
onKeyDown: event => onDayKeyDown(event, day.date),
|
|
617
|
+
...stylex.props(styles.day, focusOutlineStyles.focusVisible,
|
|
618
|
+
// Outside FIRST, so disabled wins where both apply: a
|
|
619
|
+
// spilled day past the range is unselectable, and must
|
|
620
|
+
// not be painted more available than the in-month days
|
|
621
|
+
// beside it.
|
|
622
|
+
day.isOutside && styles.dayOutside, isDisabled && styles.dayDisabled),
|
|
623
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
624
|
+
...{
|
|
625
|
+
0: {
|
|
626
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 x9r1u3d xjbqb8w xzo0q3i xuedmi6"
|
|
627
|
+
},
|
|
628
|
+
4: {
|
|
629
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 x9r1u3d xzo0q3i xuedmi6 xjbqb8w x150ydqw xoevpu5"
|
|
630
|
+
},
|
|
631
|
+
2: {
|
|
632
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 xjbqb8w xzo0q3i xuedmi6 xvy26l8 x2mo6ok"
|
|
633
|
+
},
|
|
634
|
+
6: {
|
|
635
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 xzo0q3i xuedmi6 xjbqb8w x150ydqw xoevpu5 xvy26l8 x2mo6ok"
|
|
636
|
+
},
|
|
637
|
+
1: {
|
|
638
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 xzo0q3i xuedmi6 x1ewilqj x1spg45b xad5do x17wrial x2mo6ok"
|
|
639
|
+
},
|
|
640
|
+
5: {
|
|
641
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 xzo0q3i xuedmi6 x1ewilqj x1spg45b xad5do x17wrial x2mo6ok"
|
|
642
|
+
},
|
|
643
|
+
3: {
|
|
644
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 xzo0q3i xuedmi6 x1ewilqj x1spg45b xad5do x17wrial x2mo6ok"
|
|
645
|
+
},
|
|
646
|
+
7: {
|
|
647
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 xzo0q3i xuedmi6 x1ewilqj x1spg45b xad5do x17wrial x2mo6ok"
|
|
648
|
+
}
|
|
649
|
+
}[!!!isDisabled << 2 | !!isToday << 1 | !!isSelected << 0],
|
|
650
|
+
children: day.dayNumber
|
|
651
|
+
})
|
|
652
|
+
})
|
|
653
|
+
}, day.iso);
|
|
654
|
+
})
|
|
655
|
+
}, week[0].iso))
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
MonthPane.displayName = 'MonthPane';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface MonthYearWheelsProps {
|
|
2
|
+
/** The month the wheels currently show. */
|
|
3
|
+
monthIndex: number;
|
|
4
|
+
/** First reachable month. */
|
|
5
|
+
minMonthIndex: number;
|
|
6
|
+
/** Last reachable month. */
|
|
7
|
+
maxMonthIndex: number;
|
|
8
|
+
/** Fired when either wheel comes to rest on a new month. */
|
|
9
|
+
onChange: (monthIndex: number) => void;
|
|
10
|
+
/** Accessible name for the month wheel. */
|
|
11
|
+
monthLabel: string;
|
|
12
|
+
/** Accessible name for the year wheel. */
|
|
13
|
+
yearLabel: string;
|
|
14
|
+
/** False while the panel is hidden. */
|
|
15
|
+
isActive?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Month and year wheels, bounded by the same range as the scroller.
|
|
19
|
+
*/
|
|
20
|
+
export declare function MonthYearWheels({ monthIndex, minMonthIndex, maxMonthIndex, onChange, monthLabel, yearLabel, isActive, }: MonthYearWheelsProps): import("react").JSX.Element;
|
|
21
|
+
export declare namespace MonthYearWheels {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=MonthYearWheels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MonthYearWheels.d.ts","sourceRoot":"","sources":["../../src/DateInput/MonthYearWheels.tsx"],"names":[],"mappings":"AAuCA,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,4BAA4B;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,EACV,SAAS,EACT,QAAe,GAChB,EAAE,oBAAoB,+BA6EtB;yBArFe,eAAe"}
|