@astryxdesign/core 0.4.4 → 0.4.5-canary.0472ec1
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 +40 -0
- package/dist/AvatarGroup/AvatarGroupOverflow.js +1 -1
- 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/BottomSheet.d.ts +11 -2
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +4 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts +5 -2
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +77 -18
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts.map +1 -1
- package/dist/BottomSheet/snapOffsets.d.ts +57 -20
- package/dist/BottomSheet/snapOffsets.d.ts.map +1 -1
- package/dist/BottomSheet/snapOffsets.js +106 -30
- package/dist/BottomSheet/useSheetGestures.d.ts +13 -8
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +160 -64
- package/dist/Breadcrumbs/BreadcrumbItem.js +6 -6
- package/dist/Button/Button.js +5 -5
- package/dist/Calendar/Calendar.d.ts +17 -0
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +55 -15
- package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts +14 -0
- package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts.map +1 -0
- package/dist/Calendar/getStandaloneShortWeekdayNames.js +26 -0
- package/dist/Calendar/hooks/useCalendarConstraints.d.ts +22 -1
- package/dist/Calendar/hooks/useCalendarConstraints.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarConstraints.js +26 -4
- package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarDays.js +14 -10
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarNavigation.js +8 -4
- package/dist/Calendar/standaloneShortWeekdayNames.generated.d.ts +47 -0
- package/dist/Calendar/standaloneShortWeekdayNames.generated.d.ts.map +1 -0
- package/dist/Calendar/standaloneShortWeekdayNames.generated.js +40 -0
- package/dist/Calendar/styles.js +3 -3
- 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 +2 -2
- package/dist/Chat/ChatToolCalls.js +1 -1
- 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/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +9 -0
- package/dist/Citation/Citation.js +3 -3
- package/dist/ClickableCard/ClickableCard.js +2 -2
- package/dist/CommandPalette/CommandPaletteItem.js +1 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +8 -3
- package/dist/DateInput/DateInput.d.ts +31 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +92 -19
- package/dist/DateInput/MonthScroller.d.ts +35 -0
- package/dist/DateInput/MonthScroller.d.ts.map +1 -0
- package/dist/DateInput/MonthScroller.js +573 -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 +23 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +47 -9
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +18 -10
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/Field/FieldLabel.d.ts +2 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +21 -3
- package/dist/Field/InputClearButton.d.ts +2 -1
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +12 -1
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +4 -4
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +2 -2
- package/dist/FormLayout/FormLayout.d.ts +24 -2
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/FormLayout/FormLayout.js +7 -2
- package/dist/FormLayout/FormLayoutContext.d.ts +15 -2
- package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
- package/dist/FormLayout/FormLayoutContext.js +19 -4
- package/dist/FormLayout/index.d.ts +1 -1
- package/dist/FormLayout/index.d.ts.map +1 -1
- 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/Item/Item.d.ts +9 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +46 -8
- 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 +2 -1
- package/dist/Link/Link.js +4 -4
- package/dist/Markdown/Markdown.d.ts +8 -0
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +31 -3
- package/dist/Markdown/parser.d.ts +14 -2
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +50 -2
- 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 -3
- package/dist/NavItem/navItemStyles.stylex.d.ts +2 -2
- package/dist/NavItem/navItemStyles.stylex.js +2 -2
- package/dist/NavMenu/NavHeadingMenuItem.js +1 -1
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +38 -5
- package/dist/Outline/Outline.js +2 -2
- package/dist/Outline/parseOutlineFromMarkdown.d.ts +2 -0
- package/dist/Outline/parseOutlineFromMarkdown.d.ts.map +1 -1
- package/dist/Outline/parseOutlineFromMarkdown.js +5 -31
- 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/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +12 -1
- package/dist/RadioList/RadioListItem.d.ts +2 -2
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +68 -38
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +3 -3
- 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 +6 -1
- package/dist/SelectableCard/SelectableCard.js +1 -1
- package/dist/Selector/Selector.d.ts +26 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +95 -17
- 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.js +1 -1
- package/dist/SideNav/SideNavItem.js +1 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +3 -3
- 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/StatusDot/StatusDot.d.ts +43 -3
- package/dist/StatusDot/StatusDot.d.ts.map +1 -1
- package/dist/StatusDot/StatusDot.js +42 -5
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +9 -0
- package/dist/TabList/TabMenu.js +1 -1
- 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/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +7 -2
- 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.js +2 -2
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +6 -1
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +6 -1
- package/dist/Thumbnail/Thumbnail.js +1 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +6 -1
- 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/Token/Token.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.js +2 -2
- package/dist/TopNav/TopNavItem.js +2 -2
- package/dist/TopNav/TopNavMegaMenu.js +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +1 -1
- package/dist/TopNav/TopNavMenu.js +2 -2
- package/dist/TreeList/TreeListItem.js +1 -1
- package/dist/astryx.css +123 -60
- 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/useResolvedRequired.d.ts +19 -0
- package/dist/hooks/useResolvedRequired.d.ts.map +1 -0
- package/dist/hooks/useResolvedRequired.js +40 -0
- 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/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/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 +11 -2
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +32 -4
- package/locales/af-ZA.json +958 -0
- package/locales/ar-SA.json +998 -0
- package/locales/ca-ES.json +974 -0
- package/locales/cs-CZ.json +990 -0
- package/locales/da-DK.json +966 -0
- package/locales/de-DE.json +966 -0
- package/locales/el-GR.json +990 -0
- package/locales/en.json +32 -0
- package/locales/es-ES.json +978 -0
- package/locales/fi-FI.json +990 -0
- package/locales/fr-FR.json +928 -0
- package/locales/he-IL.json +990 -0
- package/locales/hu-HU.json +990 -0
- package/locales/it-IT.json +978 -0
- package/locales/ja-JP.json +998 -0
- package/locales/ko-KR.json +990 -0
- package/locales/nl-NL.json +954 -0
- package/locales/no-NO.json +978 -0
- package/locales/pl-PL.json +982 -0
- package/locales/pseudo.json +24 -0
- package/locales/pt-BR.json +982 -0
- package/locales/pt-PT.json +982 -0
- package/locales/ro-RO.json +982 -0
- package/locales/ru-RU.json +990 -0
- package/locales/sr-SP.json +990 -0
- package/locales/sv-SE.json +986 -0
- package/locales/tr-TR.json +990 -0
- package/locales/uk-UA.json +990 -0
- package/locales/vi-VN.json +986 -0
- package/locales/zh-CN.json +998 -0
- package/locales/zh-TW.json +998 -0
- package/package.json +3 -3
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +1 -1
- 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 +36 -3
- package/src/BottomSheet/BottomSheet.test.tsx +177 -2
- package/src/BottomSheet/BottomSheet.tsx +16 -2
- package/src/BottomSheet/BottomSheetPanel.test.tsx +91 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +121 -15
- package/src/BottomSheet/index.ts +5 -1
- package/src/BottomSheet/snapOffsets.test.ts +114 -47
- package/src/BottomSheet/snapOffsets.ts +119 -33
- package/src/BottomSheet/useSheetGestures.test.ts +113 -15
- package/src/BottomSheet/useSheetGestures.ts +196 -100
- package/src/Breadcrumbs/BreadcrumbItem.tsx +1 -1
- package/src/Button/Button.tsx +7 -7
- package/src/Calendar/Calendar.doc.mjs +16 -0
- package/src/Calendar/Calendar.test.tsx +137 -0
- package/src/Calendar/Calendar.tsx +80 -11
- package/src/Calendar/getStandaloneShortWeekdayNames.test.ts +54 -0
- package/src/Calendar/getStandaloneShortWeekdayNames.ts +38 -0
- package/src/Calendar/hooks/useCalendarConstraints.ts +54 -3
- package/src/Calendar/hooks/useCalendarDays.ts +13 -10
- package/src/Calendar/hooks/useCalendarNavigation.ts +6 -4
- package/src/Calendar/standaloneShortWeekdayNames.generated.ts +50 -0
- package/src/Calendar/styles.ts +3 -3
- 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 +7 -4
- package/src/Chat/ChatToolCalls.tsx +1 -1
- 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/CheckboxInput/CheckboxInput.tsx +6 -0
- package/src/Citation/Citation.tsx +3 -3
- package/src/ClickableCard/ClickableCard.tsx +2 -2
- package/src/CommandPalette/CommandPaletteItem.tsx +1 -1
- package/src/ComplexSelector/ComplexSelector.doc.mjs +10 -0
- package/src/ComplexSelector/ComplexSelector.tsx +8 -5
- package/src/DateInput/DateInput.test.tsx +17 -1
- package/src/DateInput/DateInput.tsx +90 -19
- package/src/DateInput/DateInputTouch.test.tsx +2393 -0
- package/src/DateInput/MonthScroller.tsx +784 -0
- package/src/DateInput/MonthYearWheels.tsx +147 -0
- package/src/DateInput/TouchDateField.tsx +1214 -0
- package/src/DateInput/Wheel.tsx +470 -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 +16 -0
- package/src/DateRangeInput/DateRangeInput.test.tsx +81 -1
- package/src/DateRangeInput/DateRangeInput.tsx +88 -8
- package/src/DateTimeInput/DateTimeInput.tsx +23 -8
- package/src/Dialog/Dialog.test.tsx +24 -0
- package/src/Dialog/Dialog.tsx +3 -0
- package/src/Field/Field.doc.mjs +3 -0
- package/src/Field/FieldLabel.tsx +20 -4
- package/src/Field/InputClearButton.test.tsx +134 -2
- package/src/Field/InputClearButton.tsx +42 -1
- package/src/Field/inputStyles.stylex.ts +16 -12
- package/src/FileInput/FileInput.tsx +5 -4
- package/src/FormLayout/FormLayout.doc.mjs +13 -0
- package/src/FormLayout/FormLayout.test.tsx +181 -4
- package/src/FormLayout/FormLayout.tsx +33 -2
- package/src/FormLayout/FormLayoutContext.ts +22 -7
- package/src/FormLayout/index.ts +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/Item/Item.doc.mjs +1 -0
- package/src/Item/Item.test.tsx +50 -0
- package/src/Item/Item.tsx +41 -2
- 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 +2 -1
- package/src/Link/Link.tsx +4 -4
- package/src/Markdown/Markdown.doc.mjs +3 -0
- package/src/Markdown/Markdown.test.tsx +78 -0
- package/src/Markdown/Markdown.tsx +41 -1
- package/src/Markdown/parser.ts +60 -2
- 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 +8 -5
- package/src/NavItem/navItemStyles.stylex.ts +2 -2
- package/src/NavMenu/NavHeadingMenuItem.tsx +1 -1
- package/src/NumberInput/NumberInput.doc.mjs +24 -0
- package/src/NumberInput/NumberInput.test.tsx +138 -0
- package/src/NumberInput/NumberInput.tsx +44 -6
- package/src/Outline/Outline.doc.mjs +2 -0
- package/src/Outline/Outline.tsx +1 -1
- package/src/Outline/parseOutlineFromMarkdown.ts +10 -40
- 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/RadioList.tsx +9 -1
- package/src/RadioList/RadioListItem.tsx +83 -51
- package/src/Resizable/ResizeHandle.test.tsx +22 -0
- package/src/Resizable/ResizeHandle.tsx +9 -3
- 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 +11 -2
- package/src/SelectableCard/SelectableCard.tsx +1 -1
- package/src/Selector/Selector.doc.mjs +16 -2
- package/src/Selector/Selector.test.tsx +525 -1
- package/src/Selector/Selector.tsx +166 -21
- 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 +2 -2
- package/src/SideNav/SideNavItem.tsx +1 -1
- package/src/Slider/Slider.tsx +11 -1
- 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/StatusDot/StatusDot.doc.mjs +13 -0
- package/src/StatusDot/StatusDot.test.tsx +115 -8
- package/src/StatusDot/StatusDot.tsx +74 -9
- package/src/Switch/Switch.tsx +6 -0
- package/src/TabList/TabMenu.tsx +1 -1
- package/src/Table/TableRow.tsx +4 -4
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +2 -1
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +2 -1
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +22 -4
- 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 +2 -2
- package/src/TextArea/TextArea.doc.mjs +1 -1
- package/src/TextArea/TextArea.tsx +3 -1
- package/src/TextInput/TextInput.tsx +3 -1
- package/src/Thumbnail/Thumbnail.tsx +1 -1
- package/src/TimeInput/TimeInput.tsx +3 -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/Token/Token.tsx +1 -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 +1 -1
- package/src/TopNav/TopNavItem.tsx +2 -2
- package/src/TopNav/TopNavMegaMenu.tsx +1 -1
- package/src/TopNav/TopNavMegaMenuItem.tsx +1 -1
- package/src/TopNav/TopNavMenu.tsx +2 -2
- package/src/TreeList/TreeListItem.tsx +1 -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/useResolvedRequired.ts +42 -0
- 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/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/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 +56 -0
- package/src/utils/plainDate.ts +33 -4
package/dist/Calendar/styles.js
CHANGED
|
@@ -253,7 +253,7 @@ export const dayCellTheme = {
|
|
|
253
253
|
day: {
|
|
254
254
|
kMwMTN: "x1tgivj0",
|
|
255
255
|
kWkggS: "xjbqb8w",
|
|
256
|
-
kKwaWg: "
|
|
256
|
+
kKwaWg: "xmvprkv",
|
|
257
257
|
$$css: true
|
|
258
258
|
},
|
|
259
259
|
dayOutside: {
|
|
@@ -271,12 +271,12 @@ export const dayCellTheme = {
|
|
|
271
271
|
daySelected: {
|
|
272
272
|
kWkggS: "x1ewilqj",
|
|
273
273
|
kMwMTN: "x17wrial",
|
|
274
|
-
kKwaWg: "
|
|
274
|
+
kKwaWg: "xmvprkv",
|
|
275
275
|
$$css: true
|
|
276
276
|
},
|
|
277
277
|
dayDisabled: {
|
|
278
278
|
kSiTet: "xuzhngd",
|
|
279
|
-
kKwaWg: "x18o3ruo
|
|
279
|
+
kKwaWg: "x18o3ruo x1bm8j9m",
|
|
280
280
|
$$css: true
|
|
281
281
|
}
|
|
282
282
|
};
|
package/dist/Center/Center.d.ts
CHANGED
|
@@ -57,11 +57,33 @@ export interface CenterProps extends BaseProps<HTMLDivElement> {
|
|
|
57
57
|
* Overrides `padding` on the inline axis when both are set.
|
|
58
58
|
*/
|
|
59
59
|
paddingInline?: SpacingStep;
|
|
60
|
+
/**
|
|
61
|
+
* Inline-start padding, using the spacing scale. Logical: the left edge in
|
|
62
|
+
* LTR, the right edge in RTL.
|
|
63
|
+
* Overrides `paddingInline` and `padding` on that edge only.
|
|
64
|
+
*/
|
|
65
|
+
paddingInlineStart?: SpacingStep;
|
|
66
|
+
/**
|
|
67
|
+
* Inline-end padding, using the spacing scale. Logical: the right edge in
|
|
68
|
+
* LTR, the left edge in RTL.
|
|
69
|
+
* Overrides `paddingInline` and `padding` on that edge only.
|
|
70
|
+
*/
|
|
71
|
+
paddingInlineEnd?: SpacingStep;
|
|
60
72
|
/**
|
|
61
73
|
* Block (vertical) padding, using the spacing scale.
|
|
62
74
|
* Overrides `padding` on the block axis when both are set.
|
|
63
75
|
*/
|
|
64
76
|
paddingBlock?: SpacingStep;
|
|
77
|
+
/**
|
|
78
|
+
* Block-start (top) padding, using the spacing scale.
|
|
79
|
+
* Overrides `paddingBlock` and `padding` on that edge only.
|
|
80
|
+
*/
|
|
81
|
+
paddingBlockStart?: SpacingStep;
|
|
82
|
+
/**
|
|
83
|
+
* Block-end (bottom) padding, using the spacing scale.
|
|
84
|
+
* Overrides `paddingBlock` and `padding` on that edge only.
|
|
85
|
+
*/
|
|
86
|
+
paddingBlockEnd?: SpacingStep;
|
|
65
87
|
/**
|
|
66
88
|
* Whether to make the container inline-flex (useful for text/icons).
|
|
67
89
|
* @default false
|
|
@@ -85,7 +107,7 @@ export interface CenterProps extends BaseProps<HTMLDivElement> {
|
|
|
85
107
|
* </Center>
|
|
86
108
|
* ```
|
|
87
109
|
*/
|
|
88
|
-
export declare function Center({ axis, width, height, maxWidth, minHeight, padding, paddingInline, paddingBlock, isInline, children, xstyle, className, style, ref, ...props }: CenterProps): import("react").JSX.Element;
|
|
110
|
+
export declare function Center({ axis, width, height, maxWidth, minHeight, padding, paddingInline, paddingInlineStart, paddingInlineEnd, paddingBlock, paddingBlockStart, paddingBlockEnd, isInline, children, xstyle, className, style, ref, ...props }: CenterProps): import("react").JSX.Element;
|
|
89
111
|
export declare namespace Center {
|
|
90
112
|
var displayName: string;
|
|
91
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Center.d.ts","sourceRoot":"","sources":["../../src/Center/Center.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Center.d.ts","sourceRoot":"","sources":["../../src/Center/Center.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAwC3D,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;AAE5D,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC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from '@stylexjs/stylex';
|
|
17
|
-
import {
|
|
17
|
+
import { paddingInlineStartStyles, paddingInlineEndStyles, paddingBlockStartStyles, paddingBlockEndStyles } from "../Layout/padding.stylex.js";
|
|
18
18
|
import { mergeProps } from "../utils/index.js";
|
|
19
19
|
import { themeProps } from "../utils/themeProps.js";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -73,7 +73,11 @@ export function Center({
|
|
|
73
73
|
minHeight,
|
|
74
74
|
padding,
|
|
75
75
|
paddingInline,
|
|
76
|
+
paddingInlineStart,
|
|
77
|
+
paddingInlineEnd,
|
|
76
78
|
paddingBlock,
|
|
79
|
+
paddingBlockStart,
|
|
80
|
+
paddingBlockEnd,
|
|
77
81
|
isInline = false,
|
|
78
82
|
children,
|
|
79
83
|
xstyle,
|
|
@@ -82,13 +86,15 @@ export function Center({
|
|
|
82
86
|
ref,
|
|
83
87
|
...props
|
|
84
88
|
}) {
|
|
85
|
-
// Resolve padding to per-
|
|
86
|
-
//
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
+
// Resolve padding to per-edge values. Most specific wins, per edge:
|
|
90
|
+
// edge prop -> axis prop -> `padding`.
|
|
91
|
+
const resolvedPaddingInlineStart = paddingInlineStart ?? paddingInline ?? padding;
|
|
92
|
+
const resolvedPaddingInlineEnd = paddingInlineEnd ?? paddingInline ?? padding;
|
|
93
|
+
const resolvedPaddingBlockStart = paddingBlockStart ?? paddingBlock ?? padding;
|
|
94
|
+
const resolvedPaddingBlockEnd = paddingBlockEnd ?? paddingBlock ?? padding;
|
|
89
95
|
const stylexProps = mergeProps(themeProps('center', {
|
|
90
96
|
axis
|
|
91
|
-
}), stylex.props(isInline ? styles.inline : styles.base, (axis === 'both' || axis === 'vertical') && styles.alignItemsCenter, (axis === 'both' || axis === 'horizontal') && styles.justifyContentCenter, dynamicStyles.sizing(width ?? null, height ?? null, maxWidth ?? null, minHeight ?? null),
|
|
97
|
+
}), stylex.props(isInline ? styles.inline : styles.base, (axis === 'both' || axis === 'vertical') && styles.alignItemsCenter, (axis === 'both' || axis === 'horizontal') && styles.justifyContentCenter, dynamicStyles.sizing(width ?? null, height ?? null, maxWidth ?? null, minHeight ?? null), resolvedPaddingInlineStart != null && paddingInlineStartStyles[resolvedPaddingInlineStart], resolvedPaddingInlineEnd != null && paddingInlineEndStyles[resolvedPaddingInlineEnd], resolvedPaddingBlockStart != null && paddingBlockStartStyles[resolvedPaddingBlockStart], resolvedPaddingBlockEnd != null && paddingBlockEndStyles[resolvedPaddingBlockEnd], xstyle), className, style);
|
|
92
98
|
return /*#__PURE__*/_jsx("div", {
|
|
93
99
|
ref: ref,
|
|
94
100
|
...stylexProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposer.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatComposer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA0B5C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEtE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAC7C,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,GAAG,UAAU,CACxB;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,+CAA+C;IAC/C,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,kFAAkF;IAClF,WAAW,CAAC,EAAE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QAAQ,CAAC;CACnC;AAiMD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBAiLpD;yBAjLe,YAAY"}
|
|
@@ -75,7 +75,7 @@ const styles = {
|
|
|
75
75
|
// shadow rings on hover and focus.
|
|
76
76
|
const elevationStyles = {
|
|
77
77
|
low: {
|
|
78
|
-
kGVxlE: "x1i5ehqx
|
|
78
|
+
kGVxlE: "x1i5ehqx x1ymidup",
|
|
79
79
|
knuKkz: "xyavpck",
|
|
80
80
|
$$css: true
|
|
81
81
|
},
|
|
@@ -84,7 +84,7 @@ const elevationStyles = {
|
|
|
84
84
|
ksu8eU: "x1y0btm7",
|
|
85
85
|
kVAM5u: "xvy26l8 x6q1khz",
|
|
86
86
|
kmVPX3: "x1b50gpf",
|
|
87
|
-
kGVxlE: "x1gnnqk1
|
|
87
|
+
kGVxlE: "x1gnnqk1 x1xqjsvb xuihb5h",
|
|
88
88
|
$$css: true
|
|
89
89
|
}
|
|
90
90
|
};
|
|
@@ -136,7 +136,7 @@ function CallRow({
|
|
|
136
136
|
className: "x78zum5 x6s0dn4 x1s4dlld xjwf9q1 x13f7esw"
|
|
137
137
|
},
|
|
138
138
|
1: {
|
|
139
|
-
className: "x78zum5 x6s0dn4 x1s4dlld xjwf9q1 x13f7esw x1ypdohk xh6dtrn x7a5moj xtedp8i
|
|
139
|
+
className: "x78zum5 x6s0dn4 x1s4dlld xjwf9q1 x13f7esw x1ypdohk xh6dtrn x7a5moj xtedp8i xoevpu5"
|
|
140
140
|
}
|
|
141
141
|
}[!!hasDetail << 0],
|
|
142
142
|
children: [/*#__PURE__*/_jsxs("span", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChatComposerInputHandle } from './ChatComposerInput';
|
|
2
2
|
export interface UseChatDictationOptions {
|
|
3
|
-
/** BCP-47 language tag. @default
|
|
3
|
+
/** BCP-47 language tag. @default InternationalizationProvider locale */
|
|
4
4
|
lang?: string;
|
|
5
5
|
/** Whether recognition continues until explicitly stopped. @default true */
|
|
6
6
|
continuous?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatDictation.d.ts","sourceRoot":"","sources":["../../src/Chat/useChatDictation.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AAOjE,MAAM,WAAW,uBAAuB;IACtC,
|
|
1
|
+
{"version":3,"file":"useChatDictation.d.ts","sourceRoot":"","sources":["../../src/Chat/useChatDictation.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AAOjE,MAAM,WAAW,uBAAuB;IACtC,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gFAAgF;IAChF,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IACrD,2DAA2D;IAC3D,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9D,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,8CAA8C;IAC9C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC,KAAK,IAAI,CAAC;IAC7D,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wEAAwE;IACxE,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,sFAAsF;IACtF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,sBAAsB;IACrC,sDAAsD;IACtD,WAAW,EAAE,OAAO,CAAC;IACrB,+CAA+C;IAC/C,WAAW,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,UAAU,EAAE,OAAO,CAAC;IACpB,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf,qFAAqF;IACrF,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,2CAA2C;IAC3C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gCAAgC;IAChC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,mEAAmE;IACnE,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,qCAAqC;IACrC,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAgMD,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,uBAA4B,GACpC,sBAAsB,CA4NxB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface UseSpeechRecognitionOptions {
|
|
2
|
-
/** BCP-47 language tag. @default
|
|
2
|
+
/** BCP-47 language tag. @default InternationalizationProvider locale */
|
|
3
3
|
lang?: string;
|
|
4
4
|
/** Whether recognition continues until explicitly stopped. @default true */
|
|
5
5
|
continuous?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSpeechRecognition.d.ts","sourceRoot":"","sources":["../../src/Chat/useSpeechRecognition.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,2BAA2B;IAC1C,
|
|
1
|
+
{"version":3,"file":"useSpeechRecognition.d.ts","sourceRoot":"","sources":["../../src/Chat/useSpeechRecognition.ts"],"names":[],"mappings":"AAsBA,MA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AA4C;IAC5C,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,qCAAqC;IACrC,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AA8LD,wBAAgB,oBAAoB,CAClC,OAAO,GAAE,2BAAgC,GACxC,0BAA0B,CAuM5B"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* volume level from the microphone via AudioContext analyser.
|
|
14
14
|
*/
|
|
15
15
|
import { useState, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
16
|
-
import { useTranslator } from "../i18n/index.js";
|
|
16
|
+
import { useLocale, useTranslator } from "../i18n/index.js";
|
|
17
17
|
|
|
18
18
|
// =============================================================================
|
|
19
19
|
// Types
|
|
@@ -151,6 +151,7 @@ function getDefaultAudioContext() {
|
|
|
151
151
|
|
|
152
152
|
export function useSpeechRecognition(options = {}) {
|
|
153
153
|
const t = useTranslator();
|
|
154
|
+
const providerLocale = useLocale();
|
|
154
155
|
const {
|
|
155
156
|
lang,
|
|
156
157
|
continuous = true,
|
|
@@ -228,7 +229,7 @@ export function useSpeechRecognition(options = {}) {
|
|
|
228
229
|
}
|
|
229
230
|
recognitionRef.current?.abort();
|
|
230
231
|
const recognition = new SR();
|
|
231
|
-
recognition.lang = lang ??
|
|
232
|
+
recognition.lang = lang ?? providerLocale;
|
|
232
233
|
recognition.continuous = continuous;
|
|
233
234
|
recognition.interimResults = interimResults;
|
|
234
235
|
recognition.onstart = () => {
|
|
@@ -289,7 +290,7 @@ export function useSpeechRecognition(options = {}) {
|
|
|
289
290
|
};
|
|
290
291
|
recognitionRef.current = recognition;
|
|
291
292
|
recognition.start();
|
|
292
|
-
}, [lang, continuous, interimResults, startVolumePolling, stopVolumePolling, t]);
|
|
293
|
+
}, [lang, providerLocale, continuous, interimResults, startVolumePolling, stopVolumePolling, t]);
|
|
293
294
|
const stop = useCallback(() => {
|
|
294
295
|
recognitionRef.current?.stop();
|
|
295
296
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxInput.d.ts","sourceRoot":"","sources":["../../src/CheckboxInput/CheckboxInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckboxInput.d.ts","sourceRoot":"","sources":["../../src/CheckboxInput/CheckboxInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AA+EhD,QAAA,MAAM,iBAAiB;;;;;;;;;EASrB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAE/D,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACrE,wDAAwD;IACxD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,KAA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ACtB;AAOD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,KAAK,EACL,UAAkB,EAClB,QAAQ,EACR,eAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,IAAW,EACX,OAAO,EACP,MAAM,EACN,SAAS,EACT,MAAM,EACN,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,kBAAkB,+BAwMpB;yBAjOe,aAAa"}
|
|
@@ -26,6 +26,7 @@ import { useTooltip } from "../Tooltip/index.js";
|
|
|
26
26
|
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
27
27
|
import { indicatorScope } from "../Indicator/indicator.markers.stylex.js";
|
|
28
28
|
import { useIndicatorFocusRing } from "../hooks/useIndicatorFocusRing.js";
|
|
29
|
+
import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
|
|
29
30
|
import { useIndicator } from "../Indicator/index.js";
|
|
30
31
|
import { themeProps } from "../utils/themeProps.js";
|
|
31
32
|
import { CheckboxListContext } from "../CheckboxList/CheckboxListContext.js";
|
|
@@ -138,6 +139,13 @@ export function CheckboxInput({
|
|
|
138
139
|
const id = useId();
|
|
139
140
|
const descriptionID = useId();
|
|
140
141
|
const statusMessageID = useId();
|
|
142
|
+
// Announce the effective required state (form default included) while the
|
|
143
|
+
// native `required` stays bound to the explicit `isRequired` so a layout
|
|
144
|
+
// default never switches on browser validation.
|
|
145
|
+
const isEffectivelyRequired = useResolvedRequired({
|
|
146
|
+
isRequired,
|
|
147
|
+
isOptional
|
|
148
|
+
});
|
|
141
149
|
const [, startTransition] = useTransition();
|
|
142
150
|
const [optimisticValue, setOptimisticValue] = useOptimistic(value);
|
|
143
151
|
const isBusy = isLoading || optimisticValue !== value;
|
|
@@ -241,6 +249,7 @@ export function CheckboxInput({
|
|
|
241
249
|
form: isFocusableDisabled ? '' : undefined,
|
|
242
250
|
readOnly: isReadOnly,
|
|
243
251
|
required: isRequired,
|
|
252
|
+
"aria-required": isEffectivelyRequired ? 'true' : undefined,
|
|
244
253
|
onChange: e => {
|
|
245
254
|
if (isDisabled || isBusy || isReadOnly) {
|
|
246
255
|
return;
|
|
@@ -57,8 +57,8 @@ const styles = {
|
|
|
57
57
|
$$css: true
|
|
58
58
|
},
|
|
59
59
|
labelHover: {
|
|
60
|
-
kWkggS: "
|
|
61
|
-
kMwMTN: "xv1l7n4
|
|
60
|
+
kWkggS: "xoevpu5",
|
|
61
|
+
kMwMTN: "xv1l7n4 xo5jvnm",
|
|
62
62
|
$$css: true
|
|
63
63
|
},
|
|
64
64
|
number: {
|
|
@@ -86,7 +86,7 @@ const styles = {
|
|
|
86
86
|
$$css: true
|
|
87
87
|
},
|
|
88
88
|
numberHover: {
|
|
89
|
-
kWkggS: "xgcxg3y
|
|
89
|
+
kWkggS: "xgcxg3y xoevpu5",
|
|
90
90
|
$$css: true
|
|
91
91
|
}
|
|
92
92
|
};
|
|
@@ -64,7 +64,7 @@ const styles = {
|
|
|
64
64
|
$$css: true
|
|
65
65
|
},
|
|
66
66
|
hoverOnPointer: {
|
|
67
|
-
|
|
67
|
+
k8t4tK: "x1912f9e",
|
|
68
68
|
$$css: true
|
|
69
69
|
},
|
|
70
70
|
borderless: {
|
|
@@ -83,7 +83,7 @@ const styles = {
|
|
|
83
83
|
$$css: true
|
|
84
84
|
},
|
|
85
85
|
borderedHoverOnPointer: {
|
|
86
|
-
|
|
86
|
+
kpsWHe: "x1xwh4np",
|
|
87
87
|
$$css: true
|
|
88
88
|
},
|
|
89
89
|
disabled: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComplexSelector.d.ts","sourceRoot":"","sources":["../../src/ComplexSelector/ComplexSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAOZ,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,EACpB,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,KAAK,CAAC,qBAgO7B;yBA/Pe,eAAe"}
|
|
@@ -23,6 +23,7 @@ import { Spinner } from "../Spinner/index.js";
|
|
|
23
23
|
import { useTranslator } from "../i18n/index.js";
|
|
24
24
|
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
25
25
|
import { usePopover } from "../Popover/usePopover.js";
|
|
26
|
+
import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
|
|
26
27
|
import "../theme/tokens.stylex.js";
|
|
27
28
|
import { colorVars, durationVars, easeVars, fontWeightVars, radiusVars, sizeVars, spacingVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
28
29
|
import { isRenderable, mergeProps } from "../utils/index.js";
|
|
@@ -87,8 +88,8 @@ const styles = {
|
|
|
87
88
|
kzqmXN: "x14atkfc",
|
|
88
89
|
kMzoRj: "xc342km",
|
|
89
90
|
kWkggS: "xjbqb8w",
|
|
90
|
-
kKwaWg: "
|
|
91
|
-
kGVxlE: "x1gnnqk1
|
|
91
|
+
kKwaWg: "xmvprkv xq8i9tn",
|
|
92
|
+
kGVxlE: "x1gnnqk1 x1s17dad x15ysqaf",
|
|
92
93
|
k63SB2: "x1e4wzip",
|
|
93
94
|
k1ekBW: "xrafxwg",
|
|
94
95
|
k3aq6I: "x3oybdh xk4oym4",
|
|
@@ -212,6 +213,10 @@ export function ComplexSelector({
|
|
|
212
213
|
...props
|
|
213
214
|
}) {
|
|
214
215
|
const t = useTranslator();
|
|
216
|
+
const isEffectivelyRequired = useResolvedRequired({
|
|
217
|
+
isRequired,
|
|
218
|
+
isOptional
|
|
219
|
+
});
|
|
215
220
|
const placeholder = placeholderFromProps ?? t('@astryx.selector.placeholder');
|
|
216
221
|
const effectiveStatusVariant = variant === 'ghost' && statusVariant === 'attached' ? 'detached' : statusVariant;
|
|
217
222
|
const triggerId = useId();
|
|
@@ -318,7 +323,7 @@ export function ComplexSelector({
|
|
|
318
323
|
"aria-controls": contentId,
|
|
319
324
|
"aria-describedby": ariaDescribedBy,
|
|
320
325
|
"aria-labelledby": labelId,
|
|
321
|
-
"aria-required":
|
|
326
|
+
"aria-required": isEffectivelyRequired ? 'true' : undefined,
|
|
322
327
|
"aria-invalid": status?.type === 'error' ? 'true' : undefined,
|
|
323
328
|
"aria-busy": isBusy || undefined,
|
|
324
329
|
disabled: isDisabled,
|
|
@@ -204,7 +204,36 @@ export interface DateInputProps extends Omit<BaseProps, 'onChange' | 'defaultVal
|
|
|
204
204
|
format?: DateInputFormat | ((value: ISODateString) => string);
|
|
205
205
|
}
|
|
206
206
|
/**
|
|
207
|
-
* A date picker
|
|
207
|
+
* A date picker that fits the pointer it is being used with.
|
|
208
|
+
*
|
|
209
|
+
* With a mouse or trackpad this is a text input you can type into, with a
|
|
210
|
+
* calendar in a popover — unchanged, and still the surface every existing
|
|
211
|
+
* consumer gets. With a finger it is a picker built for one: a bottom sheet
|
|
212
|
+
* holding one month per screen, swiped sideways, with month and year wheels
|
|
213
|
+
* behind the header title for the far jumps swiping is bad at.
|
|
214
|
+
*
|
|
215
|
+
* The props are identical either way — this is one component with two
|
|
216
|
+
* surfaces, not two components — so nothing at the call site changes, and a
|
|
217
|
+
* date typed on a laptop and a date thumbed on a phone are the same value.
|
|
218
|
+
*
|
|
219
|
+
* ## Why a runtime switch and not CSS
|
|
220
|
+
*
|
|
221
|
+
* The two surfaces are structurally different — a popover anchored to a text
|
|
222
|
+
* field versus a full-width sheet holding a scroller — so "render both, hide
|
|
223
|
+
* one" would double the DOM, double the tab stops, and mount two calendars.
|
|
224
|
+
* The condition is not layout either: it is *which interaction is faster*,
|
|
225
|
+
* and that depends on the pointer, which CSS cannot hand to JS.
|
|
226
|
+
*
|
|
227
|
+
* They are two components rather than one with a branch inside because the
|
|
228
|
+
* hook lists differ; keeping them separate is what lets each own its own.
|
|
229
|
+
*
|
|
230
|
+
* ## Hydration
|
|
231
|
+
*
|
|
232
|
+
* `useMediaQuery` reports false during SSR, so server HTML is always the
|
|
233
|
+
* pointer field and the swap happens after hydration. That is deliberately
|
|
234
|
+
* unobservable: both surfaces render the SAME closed field — a bordered input
|
|
235
|
+
* with a calendar icon and the formatted date — and differ only in what
|
|
236
|
+
* opens. Nothing moves; the field just starts opening a sheet.
|
|
208
237
|
*
|
|
209
238
|
* @example
|
|
210
239
|
* ```
|
|
@@ -215,7 +244,7 @@ export interface DateInputProps extends Omit<BaseProps, 'onChange' | 'defaultVal
|
|
|
215
244
|
* />
|
|
216
245
|
* ```
|
|
217
246
|
*/
|
|
218
|
-
export declare function DateInput(
|
|
247
|
+
export declare function DateInput(props: DateInputProps): import("react").JSX.Element;
|
|
219
248
|
export declare namespace DateInput {
|
|
220
249
|
var displayName: string;
|
|
221
250
|
}
|
|
@@ -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":"AA2BA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAOlB,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAcrB,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AA8ClD,QAAA,MAAM,UAAU;;;;;;;;;;;;;EAad,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,UAAU,CAAC;AAEpD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CACnC,eAAe,EACf,MAAM,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,CACtD,CAAC;AAIF,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,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M,CAAC;IAErB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IAErB;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAEnC;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,KAAK,EAAE,aAAa,KAAK,MAAM,CAAC,CAAC;CAC/D;AAmeD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BAQ9C;yBARe,SAAS"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* - /apps/storybook/stories/DateInput.stories.tsx (storybook stories)
|
|
16
16
|
* - /packages/cli/assets/templates/blocks/components/DateInput/ (showcase blocks)
|
|
17
17
|
*/
|
|
18
|
-
import { useId, useState, useCallback, useRef, useOptimistic, useTransition } from 'react';
|
|
18
|
+
import { use, useId, useState, useCallback, useRef, useOptimistic, useTransition } from 'react';
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import "../theme/tokens.stylex.js";
|
|
21
21
|
import { colorVars, sizeVars, radiusVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
@@ -29,7 +29,10 @@ import { Spinner } from "../Spinner/index.js";
|
|
|
29
29
|
import { Calendar } from "../Calendar/index.js";
|
|
30
30
|
import { useCalendarConstraints } from "../Calendar/hooks/index.js";
|
|
31
31
|
import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
|
|
32
|
+
import { useMediaQuery } from "../hooks/useMediaQuery.js";
|
|
33
|
+
import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
|
|
32
34
|
import { usePopover } from "../Popover/index.js";
|
|
35
|
+
import { TouchDateField } from "./TouchDateField.js";
|
|
33
36
|
import { useTooltip } from "../Tooltip/index.js";
|
|
34
37
|
import { getInputARIA, isImeKeyEvent, parseDateInput } from "../utils/index.js";
|
|
35
38
|
import { plainDateFromISO, plainDateToISO, formatSharedDate } from "../utils/plainDate.js";
|
|
@@ -91,21 +94,33 @@ import { mergeProps, mergeRefs, isFocusDetached } from "../utils/index.js";
|
|
|
91
94
|
import { themeProps } from "../utils/themeProps.js";
|
|
92
95
|
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
93
96
|
import { stableClassName } from "../naming.js";
|
|
94
|
-
import { useTranslator } from "../i18n/index.js";
|
|
97
|
+
import { useTranslator, InternationalizationContext } from "../i18n/index.js";
|
|
95
98
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
96
99
|
/**
|
|
97
|
-
*
|
|
100
|
+
* The pointer that decides which surface a `DateInput` renders.
|
|
98
101
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
102
|
+
* `pointer: coarse` is the *primary* pointing device, which is what makes it
|
|
103
|
+
* the whole test. A touchscreen laptop reports `fine` (its trackpad) with
|
|
104
|
+
* `any-pointer: coarse` alongside, so it keeps the typable field — right,
|
|
105
|
+
* because its keyboard is there. A tablet reports `coarse` and gets the
|
|
106
|
+
* picker, at any width. There is deliberately no width bound: it would only
|
|
107
|
+
* re-exclude the tablets, since a narrowed desktop window is still a mouse.
|
|
108
|
+
*
|
|
109
|
+
* Deliberately NOT exported. It was, briefly, on the theory that an app might
|
|
110
|
+
* want to ask the same question and lay out to match — but nothing asked, and
|
|
111
|
+
* six other core components (CheckboxInput, ChatComposerInput, ...) just
|
|
112
|
+
* write `@media (pointer: coarse)` inline rather than sharing a constant. An
|
|
113
|
+
* export is additive later and awkward to withdraw, so it waits for a real
|
|
114
|
+
* caller.
|
|
107
115
|
*/
|
|
108
|
-
|
|
116
|
+
const TOUCH_POINTER_QUERY = '(pointer: coarse)';
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The pointer-driven field: a text input you can type into, with a calendar
|
|
120
|
+
* in a popover beside it. `DateInput` renders this whenever the primary
|
|
121
|
+
* pointer is not a finger — see {@link TOUCH_POINTER_QUERY}.
|
|
122
|
+
*/
|
|
123
|
+
function PointerDateField({
|
|
109
124
|
label,
|
|
110
125
|
isLabelHidden = false,
|
|
111
126
|
description,
|
|
@@ -137,6 +152,13 @@ export function DateInput({
|
|
|
137
152
|
...rest
|
|
138
153
|
}) {
|
|
139
154
|
const t = useTranslator();
|
|
155
|
+
const isEffectivelyRequired = useResolvedRequired({
|
|
156
|
+
isRequired,
|
|
157
|
+
isOptional
|
|
158
|
+
});
|
|
159
|
+
const {
|
|
160
|
+
locale
|
|
161
|
+
} = use(InternationalizationContext);
|
|
140
162
|
const placeholder = placeholderFromProps ?? t('@astryx.dateInput.placeholder');
|
|
141
163
|
const size = useSize(sizeProp, 'md');
|
|
142
164
|
const id = useId();
|
|
@@ -214,13 +236,13 @@ export function DateInput({
|
|
|
214
236
|
// with the ISO value; every other named member reuses Timestamp's shared
|
|
215
237
|
// date mapping. Applies ONLY to the committed value, never to in-progress
|
|
216
238
|
// typed input.
|
|
217
|
-
const formatCommittedValue = useCallback(iso => typeof format === 'function' ? format(iso) : formatSharedDate(plainDateFromISO(iso), format), [format]);
|
|
239
|
+
const formatCommittedValue = useCallback(iso => typeof format === 'function' ? format(iso) : formatSharedDate(plainDateFromISO(iso), format, locale), [format, locale]);
|
|
218
240
|
|
|
219
241
|
// Display value: pending input if typing, otherwise formatted value
|
|
220
242
|
const displayValue = pendingInput !== null ? pendingInput : optimisticValue && /^\d{4}-\d{2}-\d{2}$/.test(optimisticValue) ? formatCommittedValue(optimisticValue) : '';
|
|
221
243
|
|
|
222
244
|
// Check if current input is valid (for styling purposes)
|
|
223
|
-
const isInputValid = pendingInput === null || !pendingInput.trim() ? true : parseDateInput(pendingInput) !== null;
|
|
245
|
+
const isInputValid = pendingInput === null || !pendingInput.trim() ? true : parseDateInput(pendingInput, locale) !== null;
|
|
224
246
|
const popover = usePopover({
|
|
225
247
|
dialogLabel: t('@astryx.dateInput.dialogLabel'),
|
|
226
248
|
closeButtonLabel: t('@astryx.dateInput.closeCalendar'),
|
|
@@ -296,7 +318,7 @@ export function DateInput({
|
|
|
296
318
|
setPendingInput(newValue);
|
|
297
319
|
|
|
298
320
|
// If the input is valid and passes constraints, update immediately
|
|
299
|
-
const parsed = parseDateInput(newValue);
|
|
321
|
+
const parsed = parseDateInput(newValue, locale);
|
|
300
322
|
if (parsed && plainDateToISO(parsed) !== value && !isDateDisabled(parsed)) {
|
|
301
323
|
const parsedISO = plainDateToISO(parsed);
|
|
302
324
|
lastFiredValueRef.current = parsedISO;
|
|
@@ -304,7 +326,7 @@ export function DateInput({
|
|
|
304
326
|
// Navigate calendar to show the parsed date's month
|
|
305
327
|
calendarRef.current?.navigateTo(parsedISO);
|
|
306
328
|
}
|
|
307
|
-
}, [value, fireChange, isDateDisabled, isEffectivelyDisabled]);
|
|
329
|
+
}, [value, fireChange, isDateDisabled, isEffectivelyDisabled, locale]);
|
|
308
330
|
|
|
309
331
|
// Commit pending input (shared by blur and Enter key)
|
|
310
332
|
const commitPendingInput = useCallback(() => {
|
|
@@ -318,7 +340,7 @@ export function DateInput({
|
|
|
318
340
|
setPendingInput(null);
|
|
319
341
|
return;
|
|
320
342
|
}
|
|
321
|
-
const parsed = parseDateInput(pendingInput);
|
|
343
|
+
const parsed = parseDateInput(pendingInput, locale);
|
|
322
344
|
if (parsed && !isDateDisabled(parsed)) {
|
|
323
345
|
const parsedISO = plainDateToISO(parsed);
|
|
324
346
|
if (parsedISO !== value) {
|
|
@@ -326,7 +348,7 @@ export function DateInput({
|
|
|
326
348
|
}
|
|
327
349
|
}
|
|
328
350
|
setPendingInput(null);
|
|
329
|
-
}, [pendingInput, value, fireChange, isDateDisabled]);
|
|
351
|
+
}, [pendingInput, value, fireChange, isDateDisabled, locale]);
|
|
330
352
|
|
|
331
353
|
// Handle blur - validate, check constraints, and clear pending input
|
|
332
354
|
const handleBlur = useCallback(() => {
|
|
@@ -419,7 +441,7 @@ export function DateInput({
|
|
|
419
441
|
readOnly: showsDisabledMessage || undefined,
|
|
420
442
|
"aria-labelledby": ariaLabelledBy,
|
|
421
443
|
"aria-describedby": ariaDescribedBy,
|
|
422
|
-
"aria-required":
|
|
444
|
+
"aria-required": isEffectivelyRequired ? 'true' : undefined,
|
|
423
445
|
"aria-invalid": status?.type === 'error' || !isInputValid ? 'true' : undefined,
|
|
424
446
|
"aria-busy": isBusy || undefined,
|
|
425
447
|
"aria-expanded": popover.isOpen,
|
|
@@ -492,4 +514,55 @@ export function DateInput({
|
|
|
492
514
|
children: inputWrapper
|
|
493
515
|
});
|
|
494
516
|
}
|
|
517
|
+
PointerDateField.displayName = 'PointerDateField';
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* A date picker that fits the pointer it is being used with.
|
|
521
|
+
*
|
|
522
|
+
* With a mouse or trackpad this is a text input you can type into, with a
|
|
523
|
+
* calendar in a popover — unchanged, and still the surface every existing
|
|
524
|
+
* consumer gets. With a finger it is a picker built for one: a bottom sheet
|
|
525
|
+
* holding one month per screen, swiped sideways, with month and year wheels
|
|
526
|
+
* behind the header title for the far jumps swiping is bad at.
|
|
527
|
+
*
|
|
528
|
+
* The props are identical either way — this is one component with two
|
|
529
|
+
* surfaces, not two components — so nothing at the call site changes, and a
|
|
530
|
+
* date typed on a laptop and a date thumbed on a phone are the same value.
|
|
531
|
+
*
|
|
532
|
+
* ## Why a runtime switch and not CSS
|
|
533
|
+
*
|
|
534
|
+
* The two surfaces are structurally different — a popover anchored to a text
|
|
535
|
+
* field versus a full-width sheet holding a scroller — so "render both, hide
|
|
536
|
+
* one" would double the DOM, double the tab stops, and mount two calendars.
|
|
537
|
+
* The condition is not layout either: it is *which interaction is faster*,
|
|
538
|
+
* and that depends on the pointer, which CSS cannot hand to JS.
|
|
539
|
+
*
|
|
540
|
+
* They are two components rather than one with a branch inside because the
|
|
541
|
+
* hook lists differ; keeping them separate is what lets each own its own.
|
|
542
|
+
*
|
|
543
|
+
* ## Hydration
|
|
544
|
+
*
|
|
545
|
+
* `useMediaQuery` reports false during SSR, so server HTML is always the
|
|
546
|
+
* pointer field and the swap happens after hydration. That is deliberately
|
|
547
|
+
* unobservable: both surfaces render the SAME closed field — a bordered input
|
|
548
|
+
* with a calendar icon and the formatted date — and differ only in what
|
|
549
|
+
* opens. Nothing moves; the field just starts opening a sheet.
|
|
550
|
+
*
|
|
551
|
+
* @example
|
|
552
|
+
* ```
|
|
553
|
+
* <DateInput
|
|
554
|
+
* label="Event date"
|
|
555
|
+
* value={date}
|
|
556
|
+
* onChange={setDate}
|
|
557
|
+
* />
|
|
558
|
+
* ```
|
|
559
|
+
*/
|
|
560
|
+
export function DateInput(props) {
|
|
561
|
+
const isTouch = useMediaQuery(TOUCH_POINTER_QUERY);
|
|
562
|
+
return isTouch ? /*#__PURE__*/_jsx(TouchDateField, {
|
|
563
|
+
...props
|
|
564
|
+
}) : /*#__PURE__*/_jsx(PointerDateField, {
|
|
565
|
+
...props
|
|
566
|
+
});
|
|
567
|
+
}
|
|
495
568
|
DateInput.displayName = 'DateInput';
|