@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
|
@@ -72,7 +72,7 @@ export const navItemStyles = stylex.create({
|
|
|
72
72
|
lineHeight: typeScaleVars['--text-label-leading'],
|
|
73
73
|
textAlign: 'start',
|
|
74
74
|
boxSizing: 'border-box',
|
|
75
|
-
':hover': {
|
|
75
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
76
76
|
'@media (hover: hover)': {
|
|
77
77
|
backgroundColor: colorVars['--color-overlay-hover'],
|
|
78
78
|
},
|
|
@@ -98,7 +98,7 @@ export const navItemStyles = stylex.create({
|
|
|
98
98
|
'@media (forced-colors: active)': 'HighlightText',
|
|
99
99
|
},
|
|
100
100
|
fontWeight: fontWeightVars['--font-weight-medium'],
|
|
101
|
-
':hover': {
|
|
101
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
102
102
|
'@media (hover: hover)': {
|
|
103
103
|
backgroundColor: {
|
|
104
104
|
default: colorVars['--color-neutral'],
|
|
@@ -43,7 +43,7 @@ const styles = stylex.create({
|
|
|
43
43
|
backgroundColor: {
|
|
44
44
|
default: 'transparent',
|
|
45
45
|
':focus': colorVars['--color-overlay-hover'],
|
|
46
|
-
':hover': {
|
|
46
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
47
47
|
'@media (hover: hover)': colorVars['--color-overlay-hover'],
|
|
48
48
|
},
|
|
49
49
|
},
|
|
@@ -219,6 +219,19 @@ export const docs = {
|
|
|
219
219
|
states: ['disabled', 'readonly'],
|
|
220
220
|
},
|
|
221
221
|
],
|
|
222
|
+
derived: [
|
|
223
|
+
// `padding` in any spelling — the shorthand, `paddingBlock`, or a lone
|
|
224
|
+
// `paddingBlockStart` — is parsed by the shared container expansion and
|
|
225
|
+
// emitted as normalized per-side `--astryx-number-input-padding-*`
|
|
226
|
+
// tokens. The wrapper and the number-stepper column both read those, so
|
|
227
|
+
// the column stays flush with the field edges under a themed padding.
|
|
228
|
+
{property: 'padding', expand: 'container'},
|
|
229
|
+
// Scoped to this component's own subtree: the stepper column's outer
|
|
230
|
+
// corners follow the field radius, so a themed `number-input`
|
|
231
|
+
// borderRadius has to reach the var the column reads, not just the
|
|
232
|
+
// wrapper's own `border-radius`.
|
|
233
|
+
{property: 'borderRadius', vars: ['--_field-radius']},
|
|
234
|
+
],
|
|
222
235
|
},
|
|
223
236
|
usage: {
|
|
224
237
|
description:
|
|
@@ -475,6 +488,17 @@ export const docsZh = {
|
|
|
475
488
|
states: ['disabled', 'readonly'],
|
|
476
489
|
},
|
|
477
490
|
],
|
|
491
|
+
derived: [
|
|
492
|
+
// 任何写法的 `padding`(简写、`paddingBlock`,或单独的
|
|
493
|
+
// `paddingBlockStart`)都由共享的 container 展开解析,并输出为规范化的
|
|
494
|
+
// 每侧 `--astryx-number-input-padding-*` 令牌。容器与数字步进器列都读取
|
|
495
|
+
// 这些令牌,因此在主题化内边距下步进器仍与字段边缘齐平。
|
|
496
|
+
{property: 'padding', expand: 'container'},
|
|
497
|
+
// 作用域限于该组件自身的子树:步进器列的外角跟随字段圆角,因此主题化的
|
|
498
|
+
// `number-input` borderRadius 必须传到步进器读取的变量,而不只是容器
|
|
499
|
+
// 自身的 `border-radius`。
|
|
500
|
+
{property: 'borderRadius', vars: ['--_field-radius']},
|
|
501
|
+
],
|
|
478
502
|
},
|
|
479
503
|
usage: {
|
|
480
504
|
description:
|
|
@@ -15,6 +15,8 @@ import userEvent from '@testing-library/user-event';
|
|
|
15
15
|
import {TestIcon} from '../__tests__/TestIcon';
|
|
16
16
|
import {InputGroup} from '../InputGroup';
|
|
17
17
|
import {NumberInput} from './NumberInput';
|
|
18
|
+
import {defineTheme} from '../theme/defineTheme';
|
|
19
|
+
import {generateThemeCSS} from '../theme/generateThemeRules';
|
|
18
20
|
import {__resetLiveRegionsForTest} from '../hooks/useAnnounce';
|
|
19
21
|
|
|
20
22
|
// FieldStatus announces status messages through the persistent useAnnounce
|
|
@@ -1745,3 +1747,139 @@ describe('NumberInput readonly theme state', () => {
|
|
|
1745
1747
|
expect(root).not.toHaveAttribute('data-readonly');
|
|
1746
1748
|
});
|
|
1747
1749
|
});
|
|
1750
|
+
|
|
1751
|
+
describe('NumberInput stepper padding coupling', () => {
|
|
1752
|
+
function generateThemeTestCSS(theme: Parameters<typeof generateThemeCSS>[0]) {
|
|
1753
|
+
const {prose, component} = generateThemeCSS(theme);
|
|
1754
|
+
return [prose, component].filter(Boolean).join('\n\n');
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
// The chains the wrapper and the stepper column both read. Spelled out here
|
|
1758
|
+
// rather than imported so the test pins the actual token names a theme sets:
|
|
1759
|
+
// if the chain is renamed or a level is dropped, this fails.
|
|
1760
|
+
const BLOCK_START =
|
|
1761
|
+
'var(--astryx-number-input-padding-block-start, var(--astryx-number-input-padding, var(--spacing-1)))';
|
|
1762
|
+
const BLOCK_END =
|
|
1763
|
+
'var(--astryx-number-input-padding-block-end, var(--astryx-number-input-padding, var(--spacing-1)))';
|
|
1764
|
+
|
|
1765
|
+
// jsdom re-serializes a var() chain without the spaces after its commas.
|
|
1766
|
+
const noSpace = (value: string) => value.replace(/\s+/g, '');
|
|
1767
|
+
|
|
1768
|
+
it('reads its padding from the public number-input padding tokens', () => {
|
|
1769
|
+
const {container} = render(
|
|
1770
|
+
<NumberInput
|
|
1771
|
+
label="Quantity"
|
|
1772
|
+
value={5}
|
|
1773
|
+
onChange={() => {}}
|
|
1774
|
+
hasNumberSteppers
|
|
1775
|
+
/>,
|
|
1776
|
+
);
|
|
1777
|
+
const root = container.querySelector('.astryx-number-input') as HTMLElement;
|
|
1778
|
+
// Read as physical properties: StyleX compiles the block-axis logical
|
|
1779
|
+
// properties to `padding-top`/`padding-bottom` (identical in every
|
|
1780
|
+
// horizontal writing mode). Per side, not through the shared field base's
|
|
1781
|
+
// `paddingBlock` shorthand, so each edge can be cancelled on its own.
|
|
1782
|
+
const wrapper = getComputedStyle(root);
|
|
1783
|
+
expect(noSpace(wrapper.paddingTop)).toBe(noSpace(BLOCK_START));
|
|
1784
|
+
expect(noSpace(wrapper.paddingBottom)).toBe(noSpace(BLOCK_END));
|
|
1785
|
+
|
|
1786
|
+
// The column cancels the wrapper's block padding by reading the same
|
|
1787
|
+
// tokens — not a hardcoded default — so it stays flush when a theme
|
|
1788
|
+
// changes the padding. The column is the stepper buttons' direct parent.
|
|
1789
|
+
const steppers = container.querySelector(
|
|
1790
|
+
'button[aria-label="Increment Quantity"]',
|
|
1791
|
+
)?.parentElement as HTMLElement;
|
|
1792
|
+
const column = getComputedStyle(steppers);
|
|
1793
|
+
expect(noSpace(column.marginTop)).toBe(
|
|
1794
|
+
noSpace(`calc(-1 * ${BLOCK_START})`),
|
|
1795
|
+
);
|
|
1796
|
+
expect(noSpace(column.marginBottom)).toBe(
|
|
1797
|
+
noSpace(`calc(-1 * ${BLOCK_END})`),
|
|
1798
|
+
);
|
|
1799
|
+
});
|
|
1800
|
+
|
|
1801
|
+
// jsdom cannot resolve the @layer cascade, so the generated CSS is the
|
|
1802
|
+
// proof. Each case is a spelling of the SAME declaration: the column has to
|
|
1803
|
+
// track all of them, not just the one the component happened to name.
|
|
1804
|
+
describe('a themed padding reaches the steppers in every spelling', () => {
|
|
1805
|
+
it.each([
|
|
1806
|
+
[
|
|
1807
|
+
'the padding shorthand, two values',
|
|
1808
|
+
{padding: '14px 20px'},
|
|
1809
|
+
[
|
|
1810
|
+
'--astryx-number-input-padding-block-start: 14px',
|
|
1811
|
+
'--astryx-number-input-padding-block-end: 14px',
|
|
1812
|
+
'--astryx-number-input-padding-inline: 20px',
|
|
1813
|
+
],
|
|
1814
|
+
],
|
|
1815
|
+
[
|
|
1816
|
+
'the padding shorthand, one value',
|
|
1817
|
+
{padding: '10px'},
|
|
1818
|
+
['--astryx-number-input-padding: 10px'],
|
|
1819
|
+
],
|
|
1820
|
+
[
|
|
1821
|
+
'the block/inline longhands',
|
|
1822
|
+
{paddingBlock: '10px', paddingInline: '20px'},
|
|
1823
|
+
[
|
|
1824
|
+
'--astryx-number-input-padding-block-start: 10px',
|
|
1825
|
+
'--astryx-number-input-padding-block-end: 10px',
|
|
1826
|
+
'--astryx-number-input-padding-inline: 20px',
|
|
1827
|
+
],
|
|
1828
|
+
],
|
|
1829
|
+
[
|
|
1830
|
+
'a single edge longhand',
|
|
1831
|
+
{paddingBlockStart: '12px'},
|
|
1832
|
+
['--astryx-number-input-padding-block-start: 12px'],
|
|
1833
|
+
],
|
|
1834
|
+
[
|
|
1835
|
+
// A single var carrying "4px 12px" would make the column's
|
|
1836
|
+
// calc(-1 * …) invalid and drop the margin outright; the expansion
|
|
1837
|
+
// splits the two values into their own edges instead.
|
|
1838
|
+
'an asymmetric block padding',
|
|
1839
|
+
{paddingBlock: '4px 12px'},
|
|
1840
|
+
[
|
|
1841
|
+
'--astryx-number-input-padding-block-start: 4px',
|
|
1842
|
+
'--astryx-number-input-padding-block-end: 12px',
|
|
1843
|
+
],
|
|
1844
|
+
],
|
|
1845
|
+
[
|
|
1846
|
+
// `paddingTop` is `paddingBlockStart` in every horizontal writing
|
|
1847
|
+
// mode, so it normalizes onto the same tokens. The physical inline
|
|
1848
|
+
// pair is deliberately not mapped — see generateThemeRules.
|
|
1849
|
+
'the physical block longhands',
|
|
1850
|
+
{paddingTop: '14px', paddingBottom: '6px'},
|
|
1851
|
+
[
|
|
1852
|
+
'--astryx-number-input-padding-block-start: 14px',
|
|
1853
|
+
'--astryx-number-input-padding-block-end: 6px',
|
|
1854
|
+
],
|
|
1855
|
+
],
|
|
1856
|
+
])('%s', (_label, base, expected) => {
|
|
1857
|
+
const theme = defineTheme({
|
|
1858
|
+
name: 'number-input-padding-spelling-test',
|
|
1859
|
+
components: {'number-input': {base}},
|
|
1860
|
+
});
|
|
1861
|
+
const css = generateThemeTestCSS(theme);
|
|
1862
|
+
for (const declaration of expected) {
|
|
1863
|
+
expect(css).toContain(declaration);
|
|
1864
|
+
}
|
|
1865
|
+
// The expansion consumes the padding: a raw declaration left on the
|
|
1866
|
+
// wrapper is padding the column cannot see, which is the gap itself.
|
|
1867
|
+
expect(css).not.toMatch(
|
|
1868
|
+
/^\s*padding(-block|-inline|-top|-bottom)?(-start|-end)?:/m,
|
|
1869
|
+
);
|
|
1870
|
+
});
|
|
1871
|
+
});
|
|
1872
|
+
|
|
1873
|
+
it('carries a themed border radius to the stepper column corners', () => {
|
|
1874
|
+
// The column's outer corners read --_field-radius. Emitting only
|
|
1875
|
+
// `border-radius` on the wrapper rounds the field and leaves the steppers
|
|
1876
|
+
// at the default radius, which is visible wherever the two differ.
|
|
1877
|
+
const theme = defineTheme({
|
|
1878
|
+
name: 'number-input-radius-test',
|
|
1879
|
+
components: {'number-input': {base: {borderRadius: '2px'}}},
|
|
1880
|
+
});
|
|
1881
|
+
const css = generateThemeTestCSS(theme);
|
|
1882
|
+
expect(css).toContain('--_field-radius: 2px');
|
|
1883
|
+
expect(css).toContain('border-radius: 2px');
|
|
1884
|
+
});
|
|
1885
|
+
});
|
|
@@ -31,7 +31,6 @@ import {
|
|
|
31
31
|
colorVars,
|
|
32
32
|
sizeVars,
|
|
33
33
|
spacingVars,
|
|
34
|
-
radiusVars,
|
|
35
34
|
typographyVars,
|
|
36
35
|
typeScaleVars,
|
|
37
36
|
borderVars,
|
|
@@ -53,11 +52,44 @@ import {getInputARIA} from '../utils';
|
|
|
53
52
|
import {useSize} from '../SizeContext/SizeContext';
|
|
54
53
|
import {useInputContainer} from '../hooks/useInputContainer';
|
|
55
54
|
import {useInputStatusIcon} from '../hooks/useInputStatusIcon';
|
|
55
|
+
import {useResolvedRequired} from '../hooks/useResolvedRequired';
|
|
56
56
|
import {useInputGroup} from '../InputGroup/InputGroupContext';
|
|
57
57
|
|
|
58
|
+
// Public padding tokens for the `number-input` theme target. A theme writes an
|
|
59
|
+
// ordinary `padding` (in ANY spelling — the shorthand, `paddingBlock`, or a
|
|
60
|
+
// single `paddingBlockStart`) and the pipeline's `container` expansion parses
|
|
61
|
+
// it and emits these normalized per-side tokens; the wrapper and the stepper
|
|
62
|
+
// column both read them, so the column tracks whatever the theme sets instead
|
|
63
|
+
// of assuming the default. Routing through the shared expansion rather than a
|
|
64
|
+
// hand-rolled property→var mapping is what makes every spelling work: a
|
|
65
|
+
// mapping only fires for the exact property name it names.
|
|
66
|
+
//
|
|
67
|
+
// Read order per level: `var(--astryx-…, <next level>)`, terminating at the
|
|
68
|
+
// shared field defaults (NOT the container default --spacing-4, which is a
|
|
69
|
+
// layout metric and would resize every themed field). Built as chained const
|
|
70
|
+
// strings — no function calls — so StyleX can statically analyze them; same
|
|
71
|
+
// shape as the card/section/dialog chains in Layout/container.stylex.ts.
|
|
72
|
+
const FIELD_PAD_BLOCK = spacingVars['--spacing-1'];
|
|
73
|
+
const FIELD_PAD_INLINE = spacingVars['--spacing-2'];
|
|
74
|
+
const padBlockAll = `var(--astryx-number-input-padding, ${FIELD_PAD_BLOCK})`;
|
|
75
|
+
const padInlineAll = `var(--astryx-number-input-padding, ${FIELD_PAD_INLINE})`;
|
|
76
|
+
const padInline = `var(--astryx-number-input-padding-inline, ${padInlineAll})`;
|
|
77
|
+
const padInlineStart = `var(--astryx-number-input-padding-inline-start, ${padInline})`;
|
|
78
|
+
const padInlineEnd = `var(--astryx-number-input-padding-inline-end, ${padInline})`;
|
|
79
|
+
const padBlockStart = `var(--astryx-number-input-padding-block-start, ${padBlockAll})`;
|
|
80
|
+
const padBlockEnd = `var(--astryx-number-input-padding-block-end, ${padBlockAll})`;
|
|
81
|
+
|
|
58
82
|
const styles = stylex.create({
|
|
59
83
|
wrapper: {
|
|
60
84
|
zIndex: 1,
|
|
85
|
+
// Applied per side rather than through the shared field base's
|
|
86
|
+
// `paddingBlock`/`paddingInline` shorthands, because the stepper column
|
|
87
|
+
// has to cancel the block padding edge by edge — an asymmetric
|
|
88
|
+
// `paddingBlock: 4px 12px` needs two different negative margins.
|
|
89
|
+
paddingBlockStart: padBlockStart,
|
|
90
|
+
paddingBlockEnd: padBlockEnd,
|
|
91
|
+
paddingInlineStart: padInlineStart,
|
|
92
|
+
paddingInlineEnd: padInlineEnd,
|
|
61
93
|
},
|
|
62
94
|
wrapperWithNumberSteppers: {
|
|
63
95
|
paddingInlineEnd: 0,
|
|
@@ -101,13 +133,18 @@ const styles = stylex.create({
|
|
|
101
133
|
flexDirection: 'column',
|
|
102
134
|
flexShrink: 0,
|
|
103
135
|
width: spacingVars['--spacing-4'],
|
|
104
|
-
|
|
136
|
+
// Cancel the wrapper's block padding edge by edge so the column spans the
|
|
137
|
+
// field's full height. Reading the same tokens the wrapper applies is what
|
|
138
|
+
// keeps it flush under a themed padding — including an asymmetric one,
|
|
139
|
+
// where a single `marginBlock` would be wrong at one end.
|
|
140
|
+
marginBlockStart: `calc(-1 * ${padBlockStart})`,
|
|
141
|
+
marginBlockEnd: `calc(-1 * ${padBlockEnd})`,
|
|
105
142
|
borderInlineStartWidth: borderVars['--border-width'],
|
|
106
143
|
borderInlineStartStyle: 'solid',
|
|
107
144
|
borderInlineStartColor: colorVars['--color-border-emphasized'],
|
|
108
145
|
overflow: 'hidden',
|
|
109
|
-
borderStartEndRadius:
|
|
110
|
-
borderEndEndRadius:
|
|
146
|
+
borderStartEndRadius: 'var(--_field-radius)',
|
|
147
|
+
borderEndEndRadius: 'var(--_field-radius)',
|
|
111
148
|
},
|
|
112
149
|
numberStepperButton: {
|
|
113
150
|
boxSizing: 'border-box',
|
|
@@ -124,7 +161,7 @@ const styles = stylex.create({
|
|
|
124
161
|
backgroundColor: colorVars['--color-background-surface'],
|
|
125
162
|
backgroundImage: {
|
|
126
163
|
default: null,
|
|
127
|
-
':hover': {
|
|
164
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
128
165
|
'@media (hover: hover)': `linear-gradient(${colorVars['--color-overlay-hover']}, ${colorVars['--color-overlay-hover']})`,
|
|
129
166
|
},
|
|
130
167
|
':active': `linear-gradient(${colorVars['--color-overlay-pressed']}, ${colorVars['--color-overlay-pressed']})`,
|
|
@@ -559,6 +596,7 @@ export function NumberInput({
|
|
|
559
596
|
...rest
|
|
560
597
|
}: NumberInputProps) {
|
|
561
598
|
const t = useTranslator();
|
|
599
|
+
const isEffectivelyRequired = useResolvedRequired({isRequired, isOptional});
|
|
562
600
|
const size = useSize(sizeProp, 'md');
|
|
563
601
|
const id = useId();
|
|
564
602
|
const inputLabelID = useId();
|
|
@@ -927,7 +965,7 @@ export function NumberInput({
|
|
|
927
965
|
value == null || !formatValue ? undefined : formattedValue
|
|
928
966
|
}
|
|
929
967
|
aria-describedby={ariaDescribedBy}
|
|
930
|
-
aria-required={
|
|
968
|
+
aria-required={isEffectivelyRequired ? 'true' : undefined}
|
|
931
969
|
aria-invalid={
|
|
932
970
|
status?.type === 'error' || !isInputValid ? 'true' : undefined
|
|
933
971
|
}
|
|
@@ -166,6 +166,8 @@ import {Outline, useOutlineFromMarkdown} from '@astryxdesign/core/Outline';
|
|
|
166
166
|
|
|
167
167
|
function MarkdownOutline({markdown}) {
|
|
168
168
|
// Derives {id, label, level} items from headings in the source.
|
|
169
|
+
// The Markdown component renders the same generated ids on its
|
|
170
|
+
// headings, so outline links scroll without any extra wiring.
|
|
169
171
|
const items = useOutlineFromMarkdown(markdown);
|
|
170
172
|
return <Outline items={items} />;
|
|
171
173
|
}
|
package/src/Outline/Outline.tsx
CHANGED
|
@@ -203,7 +203,7 @@ const styles = stylex.create({
|
|
|
203
203
|
width: '100%',
|
|
204
204
|
fontSize: typeScaleVars['--text-body-size'],
|
|
205
205
|
lineHeight: typeScaleVars['--text-body-leading'],
|
|
206
|
-
':hover': {
|
|
206
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
207
207
|
'@media (hover: hover)': {
|
|
208
208
|
backgroundColor: colorVars['--color-overlay-hover'],
|
|
209
209
|
color: colorVars['--color-text-primary'],
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file parseOutlineFromMarkdown.ts
|
|
5
|
-
* @input Uses Markdown parser internals
|
|
5
|
+
* @input Uses Markdown parser internals (parseMarkdown + heading slug
|
|
6
|
+
* helpers) and OutlineItem type
|
|
6
7
|
* @output Exports parseOutlineFromMarkdown for extracting heading outlines from Markdown
|
|
7
8
|
* @position Pure utility; consumed by useOutlineFromMarkdown and public exports
|
|
8
9
|
*
|
|
@@ -11,52 +12,21 @@
|
|
|
11
12
|
* - /packages/core/src/Outline/index.ts
|
|
12
13
|
*/
|
|
13
14
|
|
|
14
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
parseMarkdown,
|
|
17
|
+
inlineText,
|
|
18
|
+
slugify,
|
|
19
|
+
uniqueSlug,
|
|
20
|
+
} from '../Markdown/parser';
|
|
15
21
|
import type {OutlineItem} from './types';
|
|
16
22
|
|
|
17
|
-
function inlineText(nodes: InlineNode[]): string {
|
|
18
|
-
return nodes
|
|
19
|
-
.map(node => {
|
|
20
|
-
switch (node.type) {
|
|
21
|
-
case 'text':
|
|
22
|
-
case 'code':
|
|
23
|
-
return node.content;
|
|
24
|
-
case 'bold':
|
|
25
|
-
case 'italic':
|
|
26
|
-
case 'strikethrough':
|
|
27
|
-
case 'link':
|
|
28
|
-
return inlineText(node.children);
|
|
29
|
-
case 'image':
|
|
30
|
-
return node.alt;
|
|
31
|
-
case 'citation':
|
|
32
|
-
case 'break':
|
|
33
|
-
return '';
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
.join('');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function slugify(value: string): string {
|
|
40
|
-
return value
|
|
41
|
-
.trim()
|
|
42
|
-
.toLowerCase()
|
|
43
|
-
.replace(/['"]/g, '')
|
|
44
|
-
.replace(/[^a-z0-9]+/g, '-')
|
|
45
|
-
.replace(/^-+|-+$/g, '');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function uniqueSlug(baseSlug: string, counts: Map<string, number>): string {
|
|
49
|
-
const fallbackSlug = baseSlug || 'section';
|
|
50
|
-
const count = counts.get(fallbackSlug) ?? 0;
|
|
51
|
-
counts.set(fallbackSlug, count + 1);
|
|
52
|
-
return count === 0 ? fallbackSlug : `${fallbackSlug}-${count}`;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
23
|
/**
|
|
56
24
|
* Extract heading items from a Markdown string.
|
|
57
25
|
*
|
|
58
26
|
* Uses Markdown's parser so fenced code blocks, tables, lists, and inline
|
|
59
27
|
* formatting are interpreted consistently with rendered Markdown output.
|
|
28
|
+
* Ids come from the parser's shared slug helpers, so they always match the
|
|
29
|
+
* `id` attributes Markdown renders on its headings.
|
|
60
30
|
*/
|
|
61
31
|
export function parseOutlineFromMarkdown(markdown: string): OutlineItem[] {
|
|
62
32
|
const counts = new Map<string, number>();
|
|
@@ -50,12 +50,17 @@ import {mergeRefs} from '../utils';
|
|
|
50
50
|
import {useSize} from '../SizeContext/SizeContext';
|
|
51
51
|
import {useInternalConfig} from './useInternalConfig';
|
|
52
52
|
import {usePowerSearchSource} from './usePowerSearchSource';
|
|
53
|
-
import {
|
|
53
|
+
import {
|
|
54
|
+
formatFilterValue,
|
|
55
|
+
formatDateAbsoluteCompact,
|
|
56
|
+
} from './formatFilterValue';
|
|
54
57
|
import {PowerSearchEditPopover} from './PowerSearchEditPopover';
|
|
55
58
|
import {resolveOperatorLabel} from './resolveOperatorLabel';
|
|
56
59
|
import {themeProps} from '../utils/themeProps';
|
|
57
60
|
import {truncateCharacters} from '../utils/characters';
|
|
58
61
|
import {useTranslator} from '../i18n';
|
|
62
|
+
import {useLocale} from '../i18n/useLocale';
|
|
63
|
+
import type {Locale} from '../i18n/types';
|
|
59
64
|
import type {
|
|
60
65
|
PowerSearchConfig,
|
|
61
66
|
PowerSearchFilter,
|
|
@@ -131,10 +136,12 @@ function PowerSearchTokenValue({
|
|
|
131
136
|
operatorValue,
|
|
132
137
|
filterValue,
|
|
133
138
|
maxLength,
|
|
139
|
+
locale,
|
|
134
140
|
}: {
|
|
135
141
|
operatorValue: OperatorValue;
|
|
136
142
|
filterValue: FilterValue;
|
|
137
143
|
maxLength: number;
|
|
144
|
+
locale: Locale;
|
|
138
145
|
}) {
|
|
139
146
|
switch (filterValue.type) {
|
|
140
147
|
case 'empty':
|
|
@@ -276,12 +283,10 @@ function PowerSearchTokenValue({
|
|
|
276
283
|
);
|
|
277
284
|
|
|
278
285
|
case 'date_absolute': {
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
day: 'numeric',
|
|
284
|
-
}).format(date);
|
|
286
|
+
const formatted = formatDateAbsoluteCompact(
|
|
287
|
+
filterValue.unixSeconds,
|
|
288
|
+
locale,
|
|
289
|
+
);
|
|
285
290
|
return (
|
|
286
291
|
<span {...stylex.props(tokenValueStyles.value)}>
|
|
287
292
|
{truncateString(formatted, maxLength)}
|
|
@@ -556,6 +561,7 @@ export function PowerSearch({
|
|
|
556
561
|
const config = useInternalConfig(configProp);
|
|
557
562
|
const searchSource = usePowerSearchSource(config);
|
|
558
563
|
const t = useTranslator();
|
|
564
|
+
const locale = useLocale();
|
|
559
565
|
const label = labelFromProps ?? t('@astryx.powersearch.label');
|
|
560
566
|
const placeholder =
|
|
561
567
|
placeholderFromProps ?? t('@astryx.powersearch.placeholder');
|
|
@@ -625,6 +631,7 @@ export function PowerSearch({
|
|
|
625
631
|
filter.value,
|
|
626
632
|
maxTokenLength,
|
|
627
633
|
t,
|
|
634
|
+
locale,
|
|
628
635
|
timezoneID,
|
|
629
636
|
)
|
|
630
637
|
: '';
|
|
@@ -644,7 +651,7 @@ export function PowerSearch({
|
|
|
644
651
|
},
|
|
645
652
|
};
|
|
646
653
|
});
|
|
647
|
-
}, [filters, config, maxTokenLength, timezoneID, t]);
|
|
654
|
+
}, [filters, config, maxTokenLength, timezoneID, t, locale]);
|
|
648
655
|
|
|
649
656
|
// Handle tokenizer onChange (field selected from typeahead)
|
|
650
657
|
const handleTokenizerChange = useCallback(
|
|
@@ -820,6 +827,7 @@ export function PowerSearch({
|
|
|
820
827
|
operatorValue={operator.value}
|
|
821
828
|
filterValue={filter.value}
|
|
822
829
|
maxLength={adjustedMaxLength}
|
|
830
|
+
locale={locale}
|
|
823
831
|
/>
|
|
824
832
|
) : undefined;
|
|
825
833
|
|
|
@@ -858,6 +866,7 @@ export function PowerSearch({
|
|
|
858
866
|
config,
|
|
859
867
|
configProp,
|
|
860
868
|
maxTokenLength,
|
|
869
|
+
locale,
|
|
861
870
|
size,
|
|
862
871
|
isReadOnly,
|
|
863
872
|
isDisabled,
|
|
@@ -13,6 +13,7 @@ import React from 'react';
|
|
|
13
13
|
import * as stylex from '@stylexjs/stylex';
|
|
14
14
|
import {Token} from '../Token';
|
|
15
15
|
import {useTranslator} from '../i18n';
|
|
16
|
+
import {useLocale} from '../i18n/useLocale';
|
|
16
17
|
import {fontWeightVars} from '../theme/tokens.stylex';
|
|
17
18
|
import {formatFilterValue} from './formatFilterValue';
|
|
18
19
|
import {resolveOperatorLabel} from './resolveOperatorLabel';
|
|
@@ -44,6 +45,7 @@ export function PowerSearchToken({
|
|
|
44
45
|
}: PowerSearchTokenProps) {
|
|
45
46
|
const config = useInternalConfig(configProp);
|
|
46
47
|
const t = useTranslator();
|
|
48
|
+
const locale = useLocale();
|
|
47
49
|
|
|
48
50
|
const fieldLabel = field.label;
|
|
49
51
|
const resolvedOperatorLabel = resolveOperatorLabel(operator, t);
|
|
@@ -63,6 +65,7 @@ export function PowerSearchToken({
|
|
|
63
65
|
filter.value,
|
|
64
66
|
adjustedMaxLength,
|
|
65
67
|
t,
|
|
68
|
+
locale,
|
|
66
69
|
);
|
|
67
70
|
|
|
68
71
|
const valueContent = valueStr ? (
|
|
@@ -31,7 +31,15 @@ const fmt = (
|
|
|
31
31
|
maxLength = 20,
|
|
32
32
|
timezoneID?: string,
|
|
33
33
|
): string =>
|
|
34
|
-
formatFilterValue(
|
|
34
|
+
formatFilterValue(
|
|
35
|
+
{} as never,
|
|
36
|
+
operator,
|
|
37
|
+
value,
|
|
38
|
+
maxLength,
|
|
39
|
+
t,
|
|
40
|
+
'en-US',
|
|
41
|
+
timezoneID,
|
|
42
|
+
);
|
|
35
43
|
|
|
36
44
|
const ELLIPSIS = '…';
|
|
37
45
|
|
|
@@ -87,8 +95,20 @@ describe('formatFilterValue', () => {
|
|
|
87
95
|
});
|
|
88
96
|
|
|
89
97
|
describe('integer / float', () => {
|
|
98
|
+
it('formats the same number differently when the locale changes', () => {
|
|
99
|
+
const args = [
|
|
100
|
+
{} as never,
|
|
101
|
+
{type: 'float'} as OperatorValue,
|
|
102
|
+
{type: 'float', value: 1234.5} as FilterValue,
|
|
103
|
+
40,
|
|
104
|
+
t,
|
|
105
|
+
] as const;
|
|
106
|
+
expect(formatFilterValue(...args, 'en-US')).toBe('1,234.5');
|
|
107
|
+
expect(formatFilterValue(...args, 'de-DE')).toBe('1.234,5');
|
|
108
|
+
});
|
|
109
|
+
|
|
90
110
|
it('formats an integer with locale grouping', () => {
|
|
91
|
-
const expected = new Intl.NumberFormat().format(1234567);
|
|
111
|
+
const expected = new Intl.NumberFormat('en-US').format(1234567);
|
|
92
112
|
expect(
|
|
93
113
|
fmt({type: 'integer'}, {type: 'integer', value: 1234567}, 40),
|
|
94
114
|
).toBe(expected);
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import type {OperatorValue, FilterValue, EnumItem} from './types';
|
|
14
14
|
import type {InternalConfig} from './useInternalConfig';
|
|
15
|
-
import type {TranslatorFn} from '../i18n';
|
|
15
|
+
import type {Locale, TranslatorFn} from '../i18n';
|
|
16
16
|
import {truncateCharacters} from '../utils/characters';
|
|
17
17
|
|
|
18
18
|
function truncate(str: string, maxLength: number): string {
|
|
@@ -27,12 +27,16 @@ function formatEnumLabel(
|
|
|
27
27
|
return item?.label ?? value;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
function formatNumber(value: number, units?: string): string {
|
|
31
|
-
const formatted = new Intl.NumberFormat().format(value);
|
|
30
|
+
function formatNumber(value: number, locale: Locale, units?: string): string {
|
|
31
|
+
const formatted = new Intl.NumberFormat(locale).format(value);
|
|
32
32
|
return units ? `${formatted} ${units}` : formatted;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
function formatDateAbsolute(
|
|
35
|
+
export function formatDateAbsolute(
|
|
36
|
+
unixSeconds: number,
|
|
37
|
+
locale: Locale,
|
|
38
|
+
timezoneID?: string,
|
|
39
|
+
): string {
|
|
36
40
|
const options: Intl.DateTimeFormatOptions = {
|
|
37
41
|
year: 'numeric',
|
|
38
42
|
month: 'short',
|
|
@@ -41,7 +45,25 @@ function formatDateAbsolute(unixSeconds: number, timezoneID?: string): string {
|
|
|
41
45
|
minute: '2-digit',
|
|
42
46
|
...(timezoneID ? {timeZone: timezoneID} : {}),
|
|
43
47
|
};
|
|
44
|
-
return new Intl.DateTimeFormat(
|
|
48
|
+
return new Intl.DateTimeFormat(locale, options).format(unixSeconds * 1000);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Compact date-only rendering (no time-of-day) for the token pill's inline
|
|
53
|
+
* value display, which has less room than the editor's full summary. Kept
|
|
54
|
+
* separate from {@link formatDateAbsolute} rather than reusing it with
|
|
55
|
+
* different options threaded through a param, since the two callers want
|
|
56
|
+
* genuinely different shapes, not a parameterization of the same one.
|
|
57
|
+
*/
|
|
58
|
+
export function formatDateAbsoluteCompact(
|
|
59
|
+
unixSeconds: number,
|
|
60
|
+
locale: Locale,
|
|
61
|
+
): string {
|
|
62
|
+
return new Intl.DateTimeFormat(locale, {
|
|
63
|
+
year: 'numeric',
|
|
64
|
+
month: 'short',
|
|
65
|
+
day: 'numeric',
|
|
66
|
+
}).format(unixSeconds * 1000);
|
|
45
67
|
}
|
|
46
68
|
|
|
47
69
|
function formatRelativeDate(value: string): string {
|
|
@@ -62,6 +84,7 @@ export function formatFilterValue(
|
|
|
62
84
|
filterValue: FilterValue,
|
|
63
85
|
maxLength: number,
|
|
64
86
|
t: TranslatorFn,
|
|
87
|
+
locale: Locale,
|
|
65
88
|
timezoneID?: string,
|
|
66
89
|
): string {
|
|
67
90
|
switch (filterValue.type) {
|
|
@@ -74,12 +97,14 @@ export function formatFilterValue(
|
|
|
74
97
|
case 'integer':
|
|
75
98
|
return formatNumber(
|
|
76
99
|
filterValue.value,
|
|
100
|
+
locale,
|
|
77
101
|
operatorValue.type === 'integer' ? operatorValue.units : undefined,
|
|
78
102
|
);
|
|
79
103
|
|
|
80
104
|
case 'float':
|
|
81
105
|
return formatNumber(
|
|
82
106
|
filterValue.value,
|
|
107
|
+
locale,
|
|
83
108
|
operatorValue.type === 'float' ? operatorValue.units : undefined,
|
|
84
109
|
);
|
|
85
110
|
|
|
@@ -157,7 +182,7 @@ export function formatFilterValue(
|
|
|
157
182
|
|
|
158
183
|
case 'date_absolute':
|
|
159
184
|
return truncate(
|
|
160
|
-
formatDateAbsolute(filterValue.unixSeconds, timezoneID),
|
|
185
|
+
formatDateAbsolute(filterValue.unixSeconds, locale, timezoneID),
|
|
161
186
|
maxLength,
|
|
162
187
|
);
|
|
163
188
|
|
|
@@ -11,7 +11,7 @@ export const docs = {
|
|
|
11
11
|
theming: {
|
|
12
12
|
targets: [
|
|
13
13
|
{className: 'astryx-radio-list', visualProps: ['orientation', 'size']},
|
|
14
|
-
{className: 'astryx-radio-list-item'},
|
|
14
|
+
{className: 'astryx-radio-list-item', visualProps: ['size'], states: ['selected', 'disabled']},
|
|
15
15
|
{className: 'astryx-radio-indicator', visualProps: ['size'], states: ['checked', 'disabled']},
|
|
16
16
|
{className: 'astryx-radio-indicator-dot', visualProps: ['size']},
|
|
17
17
|
{className: 'astryx-radio', visualProps: ['size'], states: ['checked', 'disabled'], deprecatedFor: 'radio-indicator'},
|