@astryxdesign/core 0.4.4 → 0.4.5-canary.013e728
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/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 +65 -15
- 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.map +1 -1
- package/dist/DateInput/DateInput.js +17 -9
- 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 +85 -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/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/plainDate.d.ts +9 -2
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +16 -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 +8 -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 +6 -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/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 +41 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +95 -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 +13 -9
- 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/utils/dateParser.test.ts +20 -0
- package/src/utils/dateParser.ts +14 -7
- package/src/utils/plainDate.test.ts +56 -0
- package/src/utils/plainDate.ts +17 -4
|
@@ -71,7 +71,9 @@ import {
|
|
|
71
71
|
} from './utils';
|
|
72
72
|
import {useCombobox, useSelectedItemOffset} from './hooks';
|
|
73
73
|
import {useTypeahead} from '../hooks/useTypeahead';
|
|
74
|
+
import {useResolvedRequired} from '../hooks/useResolvedRequired';
|
|
74
75
|
import {SelectorOption} from './SelectorOption';
|
|
76
|
+
import {SelectorRowLayoutContext} from './SelectorRowLayoutContext';
|
|
75
77
|
import {getInputARIA, isImeKeyEvent, mergeProps} from '../utils';
|
|
76
78
|
import {useSize} from '../SizeContext/SizeContext';
|
|
77
79
|
import type {BaseProps} from '../BaseProps';
|
|
@@ -100,7 +102,13 @@ const styles = stylex.create({
|
|
|
100
102
|
default: typeScaleVars['--text-label-size'],
|
|
101
103
|
'@media (pointer: coarse)': `max(1rem, ${typeScaleVars['--text-label-size']})`,
|
|
102
104
|
},
|
|
103
|
-
|
|
105
|
+
// A FIXED line box, not the ratio: the trigger's padding is derived from
|
|
106
|
+
// one line being `--spacing-5` tall, and a ratio makes the line box track
|
|
107
|
+
// the font — which the coarse-pointer bump above (and any theme that
|
|
108
|
+
// changes `--font-size-base`) then moves, taking the control off its size
|
|
109
|
+
// token. The glyphs still grow for touch; only the box they sit in is
|
|
110
|
+
// pinned. Item's own rows set their line heights and are unaffected.
|
|
111
|
+
lineHeight: spacingVars['--spacing-5'],
|
|
104
112
|
color: colorVars['--color-text-primary'],
|
|
105
113
|
cursor: 'pointer',
|
|
106
114
|
},
|
|
@@ -141,6 +149,43 @@ const styles = stylex.create({
|
|
|
141
149
|
whiteSpace: 'nowrap',
|
|
142
150
|
textAlign: 'start',
|
|
143
151
|
},
|
|
152
|
+
// Inside an InputGroup the group's own height is the row, and the trigger
|
|
153
|
+
// takes it: `height: 100%` from `groupStyles.inGroup` can only govern if the
|
|
154
|
+
// trigger stops asserting a floor of its own — otherwise a control sized
|
|
155
|
+
// above its group (`<InputGroup size="md"><Selector size="lg">`) grows the
|
|
156
|
+
// row it was supposed to sit in. The padding goes with it: the row is
|
|
157
|
+
// already the size token, and the value box is centred in it.
|
|
158
|
+
triggerInGroup: {
|
|
159
|
+
minHeight: 0,
|
|
160
|
+
paddingBlock: 0,
|
|
161
|
+
},
|
|
162
|
+
// Wrapper for `renderValue` output. Takes the free width and clips
|
|
163
|
+
// horizontally so a long value ellipsizes rather than widening the trigger;
|
|
164
|
+
// vertically the content sizes the control, which the size styles below
|
|
165
|
+
// handle.
|
|
166
|
+
triggerValue: {
|
|
167
|
+
flexGrow: 1,
|
|
168
|
+
minWidth: 0,
|
|
169
|
+
overflow: 'hidden',
|
|
170
|
+
textAlign: 'start',
|
|
171
|
+
},
|
|
172
|
+
// Inside an InputGroup the row height is the group's, so the trigger clamps
|
|
173
|
+
// its own value box to that row rather than asking the value to fit it: any
|
|
174
|
+
// node is cut off at the row's edge instead of bleeding through the border
|
|
175
|
+
// over whatever sits above and below the group. The rows the system draws
|
|
176
|
+
// itself never reach the cut — the row-layout context folds them onto one
|
|
177
|
+
// line first (SelectorRowLayoutContext).
|
|
178
|
+
//
|
|
179
|
+
// The clamp is a percentage, not the size token, because a group can be a
|
|
180
|
+
// different size than the control inside it; the row is whatever the group
|
|
181
|
+
// made it. That needs a definite height to resolve against, which is what
|
|
182
|
+
// stretching the button provides.
|
|
183
|
+
triggerButtonInGroup: {
|
|
184
|
+
alignSelf: 'stretch',
|
|
185
|
+
},
|
|
186
|
+
triggerValueInGroup: {
|
|
187
|
+
maxHeight: '100%',
|
|
188
|
+
},
|
|
144
189
|
// Only what Icon does not already provide: `size="sm"` gives the 16px box
|
|
145
190
|
// and `color` the token, but the glyph still must not shrink inside the flex
|
|
146
191
|
// trigger.
|
|
@@ -168,16 +213,17 @@ const styles = stylex.create({
|
|
|
168
213
|
backgroundColor: 'transparent',
|
|
169
214
|
backgroundImage: {
|
|
170
215
|
default: null,
|
|
171
|
-
':hover': {
|
|
216
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
172
217
|
'@media (hover: hover)': `linear-gradient(${colorVars['--color-overlay-hover']}, ${colorVars['--color-overlay-hover']})`,
|
|
173
218
|
},
|
|
174
219
|
':active': `linear-gradient(${colorVars['--color-overlay-pressed']}, ${colorVars['--color-overlay-pressed']})`,
|
|
175
220
|
},
|
|
176
221
|
boxShadow: {
|
|
177
222
|
default: 'none',
|
|
178
|
-
':hover:not(:focus-within)':
|
|
179
|
-
|
|
180
|
-
|
|
223
|
+
':hover:not(:focus-within):where(:not(:disabled,[aria-disabled="true"]))':
|
|
224
|
+
{
|
|
225
|
+
'@media (hover: hover)': 'none',
|
|
226
|
+
},
|
|
181
227
|
':focus-within': 'none',
|
|
182
228
|
},
|
|
183
229
|
fontWeight: fontWeightVars['--font-weight-medium'],
|
|
@@ -327,15 +373,31 @@ const styles = stylex.create({
|
|
|
327
373
|
},
|
|
328
374
|
});
|
|
329
375
|
|
|
376
|
+
// The trigger is sized by PADDING, not by a fixed height, so it is the size
|
|
377
|
+
// token plus one text line for each extra line the value uses: 28/32/36 for
|
|
378
|
+
// one line, 48/52/56 for two. The token and a text line are both multiples of
|
|
379
|
+
// 4, so every trigger lands on the 4px rhythm and lines up with the Buttons
|
|
380
|
+
// and inputs beside it. No prop picks the height — the content does, and it
|
|
381
|
+
// can only land on the grid.
|
|
382
|
+
//
|
|
383
|
+
// `--spacing-5` is one line here because `triggerContainer` pins its
|
|
384
|
+
// line-height to exactly that; the two must stay in step, which is why both
|
|
385
|
+
// read the same token rather than one hardcoding 20px.
|
|
386
|
+
const linePad = (token: string) =>
|
|
387
|
+
`calc((${token} - ${spacingVars['--spacing-5']} - 2 * ${borderVars['--border-width']}) / 2)`;
|
|
388
|
+
|
|
330
389
|
const sizeStyles = stylex.create({
|
|
331
390
|
sm: {
|
|
332
|
-
|
|
391
|
+
minHeight: sizeVars['--size-element-sm'],
|
|
392
|
+
paddingBlock: linePad(sizeVars['--size-element-sm']),
|
|
333
393
|
},
|
|
334
394
|
md: {
|
|
335
|
-
|
|
395
|
+
minHeight: sizeVars['--size-element-md'],
|
|
396
|
+
paddingBlock: linePad(sizeVars['--size-element-md']),
|
|
336
397
|
},
|
|
337
398
|
lg: {
|
|
338
|
-
|
|
399
|
+
minHeight: sizeVars['--size-element-lg'],
|
|
400
|
+
paddingBlock: linePad(sizeVars['--size-element-lg']),
|
|
339
401
|
},
|
|
340
402
|
});
|
|
341
403
|
|
|
@@ -516,7 +578,8 @@ interface SelectorPropsBase<
|
|
|
516
578
|
labelTooltip?: string;
|
|
517
579
|
|
|
518
580
|
/**
|
|
519
|
-
* Icon displayed at the start of the selector trigger.
|
|
581
|
+
* Icon displayed at the start of the selector trigger. Takes precedence over
|
|
582
|
+
* the selected option's own `icon`, which the trigger otherwise renders.
|
|
520
583
|
*/
|
|
521
584
|
startIcon?: ReactNode | IconType;
|
|
522
585
|
|
|
@@ -526,6 +589,31 @@ interface SelectorPropsBase<
|
|
|
526
589
|
*/
|
|
527
590
|
renderOption?: (option: SelectorOptionData) => ReactNode;
|
|
528
591
|
|
|
592
|
+
/**
|
|
593
|
+
* Custom render function for the selected option inside the closed trigger.
|
|
594
|
+
* Only called when something is selected; the placeholder is unaffected.
|
|
595
|
+
*
|
|
596
|
+
* Passing this does not change the trigger's height — what it draws does. A
|
|
597
|
+
* one-line value measures exactly the `size` token, so the control still
|
|
598
|
+
* lines up with the Buttons and inputs beside it; each further line of
|
|
599
|
+
* content adds one text line. Inside an `InputGroup` the group owns the row
|
|
600
|
+
* height: the trigger clamps its value box to that row, so a `SelectorOption`
|
|
601
|
+
* folds onto one line and ellipsizes, and anything taller than the row is cut
|
|
602
|
+
* off at it rather than bleeding over the rows above and below.
|
|
603
|
+
*
|
|
604
|
+
* @example
|
|
605
|
+
* ```
|
|
606
|
+
* renderValue={option => (
|
|
607
|
+
* <SelectorOption
|
|
608
|
+
* icon={option.icon}
|
|
609
|
+
* label={option.label}
|
|
610
|
+
* description={option.description}
|
|
611
|
+
* />
|
|
612
|
+
* )}
|
|
613
|
+
* ```
|
|
614
|
+
*/
|
|
615
|
+
renderValue?: (option: SelectorOptionData) => ReactNode;
|
|
616
|
+
|
|
529
617
|
/**
|
|
530
618
|
* Which edge of the option row carries the selected mark. `start` reserves a
|
|
531
619
|
* mark column ahead of every label so they stay aligned, the way a native
|
|
@@ -613,7 +701,11 @@ export type SelectorProps<T extends SelectorOptionType = SelectorOptionType> =
|
|
|
613
701
|
*/
|
|
614
702
|
function DefaultOption({option}: {option: SelectorOptionData}) {
|
|
615
703
|
return (
|
|
616
|
-
<SelectorOption
|
|
704
|
+
<SelectorOption
|
|
705
|
+
icon={option.icon}
|
|
706
|
+
label={option.label ?? option.value}
|
|
707
|
+
description={option.description}
|
|
708
|
+
/>
|
|
617
709
|
);
|
|
618
710
|
}
|
|
619
711
|
|
|
@@ -686,6 +778,7 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
686
778
|
startIcon,
|
|
687
779
|
htmlName,
|
|
688
780
|
renderOption,
|
|
781
|
+
renderValue,
|
|
689
782
|
indicatorPosition = 'end',
|
|
690
783
|
hasSearch = false,
|
|
691
784
|
searchPlaceholder: searchPlaceholderFromProps,
|
|
@@ -699,6 +792,7 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
699
792
|
hasClear: hasClearProp,
|
|
700
793
|
...rest
|
|
701
794
|
} = props as SelectorPropsClearable<T>;
|
|
795
|
+
const isEffectivelyRequired = useResolvedRequired({isRequired, isOptional});
|
|
702
796
|
const placeholder = placeholderFromProps ?? t('@astryx.selector.placeholder');
|
|
703
797
|
const searchPlaceholder =
|
|
704
798
|
searchPlaceholderFromProps ?? t('@astryx.selector.searchPlaceholder');
|
|
@@ -1164,12 +1258,27 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1164
1258
|
aria-disabled={item.disabled}
|
|
1165
1259
|
onClick={() => onItemSelect(item)}
|
|
1166
1260
|
onMouseEnter={() => onItemMouseEnter(item, flatIndex)}
|
|
1167
|
-
{...
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1261
|
+
{...mergeProps(
|
|
1262
|
+
// Stable theme target on the option row itself, mirroring
|
|
1263
|
+
// `multi-selector-option`: it carries the row's size and runtime
|
|
1264
|
+
// state so a theme can express "selected option at large" or
|
|
1265
|
+
// restyle a given row density without structural selectors. The
|
|
1266
|
+
// row's padding is split across a base and a per-size override (the
|
|
1267
|
+
// default `md` trims the block axis), so `size` is what a theme
|
|
1268
|
+
// needs to reach it. Named `-option-row` because `selector-option`
|
|
1269
|
+
// is the public SelectorOption content primitive, not this row.
|
|
1270
|
+
themeProps('selector-option-row', {
|
|
1271
|
+
size,
|
|
1272
|
+
selected: isSelected ? 'selected' : null,
|
|
1273
|
+
disabled: item.disabled ? 'disabled' : null,
|
|
1274
|
+
}),
|
|
1275
|
+
stylex.props(
|
|
1276
|
+
styles.item,
|
|
1277
|
+
itemSizeStyles[size],
|
|
1278
|
+
isHighlighted && styles.itemHighlighted,
|
|
1279
|
+
isSelected && styles.itemSelected,
|
|
1280
|
+
item.disabled && styles.itemDisabled,
|
|
1281
|
+
),
|
|
1173
1282
|
)}>
|
|
1174
1283
|
{content}
|
|
1175
1284
|
</div>
|
|
@@ -1279,6 +1388,40 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1279
1388
|
const showStatusTooltip =
|
|
1280
1389
|
status != null && effectiveStatusVariant === 'tooltip' && !!status.message;
|
|
1281
1390
|
|
|
1391
|
+
// Two lines cannot fit inside an InputGroup: the group pins the row height,
|
|
1392
|
+
// and the trigger clamps its value box to one line so nothing bleeds through
|
|
1393
|
+
// its border (styles.triggerValueInGroup). The clamp holds for any node; the
|
|
1394
|
+
// context is what lets the rows the system draws itself reflow into that one
|
|
1395
|
+
// line — label and description side by side — instead of being cut off at
|
|
1396
|
+
// it. Outside a group the caller's own row decides, and the trigger's
|
|
1397
|
+
// padding sizes it to whatever that draws.
|
|
1398
|
+
const rowLayout = inputGroup ? 'inline' : 'stacked';
|
|
1399
|
+
|
|
1400
|
+
// What the closed trigger shows for the current selection: the option's icon
|
|
1401
|
+
// and label. `startIcon` wins over the option's own icon so a caller who
|
|
1402
|
+
// pins a field icon does not get two.
|
|
1403
|
+
const valueContent =
|
|
1404
|
+
selectedItem && renderValue ? (
|
|
1405
|
+
<SelectorRowLayoutContext value={rowLayout}>
|
|
1406
|
+
<span
|
|
1407
|
+
{...stylex.props(
|
|
1408
|
+
styles.triggerValue,
|
|
1409
|
+
inputGroup && styles.triggerValueInGroup,
|
|
1410
|
+
)}>
|
|
1411
|
+
{renderValue(selectedItem)}
|
|
1412
|
+
</span>
|
|
1413
|
+
</SelectorRowLayoutContext>
|
|
1414
|
+
) : (
|
|
1415
|
+
<>
|
|
1416
|
+
{!startIcon &&
|
|
1417
|
+
selectedItem?.icon != null &&
|
|
1418
|
+
renderIconSlot(selectedItem.icon, {size: 'sm', color: 'secondary'})}
|
|
1419
|
+
<span {...stylex.props(styles.triggerLabel)}>
|
|
1420
|
+
{selectedItem?.label ?? placeholder}
|
|
1421
|
+
</span>
|
|
1422
|
+
</>
|
|
1423
|
+
);
|
|
1424
|
+
|
|
1282
1425
|
const selectorContent = (
|
|
1283
1426
|
<>
|
|
1284
1427
|
<div
|
|
@@ -1316,6 +1459,7 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1316
1459
|
!isDisabled &&
|
|
1317
1460
|
inputStatusHoverShadowStyles[status.type],
|
|
1318
1461
|
variant !== 'ghost' && inputGroup && groupStyles.inGroup,
|
|
1462
|
+
inputGroup && styles.triggerInGroup,
|
|
1319
1463
|
xstyle,
|
|
1320
1464
|
),
|
|
1321
1465
|
className,
|
|
@@ -1345,7 +1489,7 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1345
1489
|
}
|
|
1346
1490
|
aria-describedby={ariaDescribedBy}
|
|
1347
1491
|
aria-labelledby={ariaLabelledBy}
|
|
1348
|
-
aria-required={
|
|
1492
|
+
aria-required={isEffectivelyRequired ? 'true' : undefined}
|
|
1349
1493
|
aria-invalid={status?.type === 'error' ? 'true' : undefined}
|
|
1350
1494
|
aria-busy={isBusy || undefined}
|
|
1351
1495
|
// With a disabledMessage the trigger keeps focusability via
|
|
@@ -1355,10 +1499,11 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1355
1499
|
aria-disabled={showsDisabledMessage ? 'true' : undefined}
|
|
1356
1500
|
onKeyDown={handleTriggerKeyDown}
|
|
1357
1501
|
tabIndex={isDisabled && !showsDisabledMessage ? -1 : 0}
|
|
1358
|
-
{...stylex.props(
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1502
|
+
{...stylex.props(
|
|
1503
|
+
styles.trigger,
|
|
1504
|
+
inputGroup && styles.triggerButtonInGroup,
|
|
1505
|
+
)}>
|
|
1506
|
+
{valueContent}
|
|
1362
1507
|
</button>
|
|
1363
1508
|
{htmlName != null && (
|
|
1364
1509
|
<input
|
|
@@ -27,6 +27,13 @@ export const docs = {
|
|
|
27
27
|
type: 'ReactNode',
|
|
28
28
|
description: 'Secondary description text displayed below the label.',
|
|
29
29
|
},
|
|
30
|
+
{
|
|
31
|
+
name: 'layout',
|
|
32
|
+
type: "'stacked' | 'inline'",
|
|
33
|
+
description:
|
|
34
|
+
"How the label and description sit together. 'stacked' puts the description on its own line; 'inline' keeps both on one line so the row fits a fixed-height host. Inside a Selector trigger the trigger's padding sizes itself to whichever layout you pick, so both land on the 4px rhythm; an InputGroup pins the row height and forces 'inline'.",
|
|
35
|
+
default: "'stacked'",
|
|
36
|
+
},
|
|
30
37
|
{
|
|
31
38
|
name: 'endContent',
|
|
32
39
|
type: 'ReactNode',
|
|
@@ -13,6 +13,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
13
13
|
import type {StyleXStyles} from '@stylexjs/stylex';
|
|
14
14
|
import {renderIconSlot, type IconType} from '../Icon';
|
|
15
15
|
import {Item} from '../Item';
|
|
16
|
+
import {useSelectorRowLayout} from './SelectorRowLayoutContext';
|
|
16
17
|
import {mergeProps} from '../utils';
|
|
17
18
|
import {themeProps} from '../utils/themeProps';
|
|
18
19
|
|
|
@@ -40,6 +41,20 @@ export interface SelectorOptionProps {
|
|
|
40
41
|
*/
|
|
41
42
|
description?: ReactNode;
|
|
42
43
|
|
|
44
|
+
/**
|
|
45
|
+
* How the label and description sit together. `stacked` puts the
|
|
46
|
+
* description on its own line below the label; `inline` keeps both on one
|
|
47
|
+
* line, with the description ellipsizing first.
|
|
48
|
+
*
|
|
49
|
+
* In a Selector trigger this is the caller's choice and the trigger sizes
|
|
50
|
+
* itself to it — one line at the size token, two lines exactly one text line
|
|
51
|
+
* taller. Inside an `InputGroup` the row height is pinned by the group, so
|
|
52
|
+
* `inline` is forced.
|
|
53
|
+
*
|
|
54
|
+
* @default 'stacked'
|
|
55
|
+
*/
|
|
56
|
+
layout?: 'stacked' | 'inline';
|
|
57
|
+
|
|
43
58
|
/**
|
|
44
59
|
* Additional content to render after the label/description.
|
|
45
60
|
*/
|
|
@@ -95,11 +110,16 @@ export function SelectorOption({
|
|
|
95
110
|
icon,
|
|
96
111
|
label,
|
|
97
112
|
description,
|
|
113
|
+
layout,
|
|
98
114
|
endContent,
|
|
99
115
|
xstyle,
|
|
100
116
|
className,
|
|
101
117
|
style,
|
|
102
118
|
}: SelectorOptionProps) {
|
|
119
|
+
// A height-pinned host (the trigger inside an InputGroup) overrides the
|
|
120
|
+
// caller's choice: the row physically cannot be two lines there.
|
|
121
|
+
const enforcedLayout = useSelectorRowLayout();
|
|
122
|
+
|
|
103
123
|
return (
|
|
104
124
|
<Item
|
|
105
125
|
startContent={
|
|
@@ -109,6 +129,7 @@ export function SelectorOption({
|
|
|
109
129
|
}
|
|
110
130
|
label={label}
|
|
111
131
|
description={description}
|
|
132
|
+
layout={enforcedLayout === 'inline' ? 'inline' : layout}
|
|
112
133
|
endContent={endContent}
|
|
113
134
|
xstyle={[embeddedStyles.root, xstyle]}
|
|
114
135
|
{...mergeProps(themeProps('selector-option'), {className, style})}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file SelectorRowLayoutContext.ts
|
|
7
|
+
* @input React createContext/use
|
|
8
|
+
* @output Exports the row-layout context and useSelectorRowLayout hook
|
|
9
|
+
* @position Internal to the Selector module; read by SelectorOption
|
|
10
|
+
*
|
|
11
|
+
* The trigger inside an InputGroup is height-pinned by the group, so its value
|
|
12
|
+
* box is clamped to one line and anything taller is cut off at the fold. This
|
|
13
|
+
* context is how the rows the system draws itself avoid being cut: they reflow
|
|
14
|
+
* label and description onto that one line instead. The geometry does not
|
|
15
|
+
* depend on it — a node that ignores this context still cannot grow the row.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import {createContext, use} from 'react';
|
|
19
|
+
|
|
20
|
+
export type SelectorRowLayout = 'stacked' | 'inline';
|
|
21
|
+
|
|
22
|
+
export const SelectorRowLayoutContext =
|
|
23
|
+
createContext<SelectorRowLayout>('stacked');
|
|
24
|
+
SelectorRowLayoutContext.displayName = 'SelectorRowLayoutContext';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The row layout a host imposes on the options it renders. `stacked` outside
|
|
28
|
+
* any height-pinned host.
|
|
29
|
+
*/
|
|
30
|
+
export function useSelectorRowLayout(): SelectorRowLayout {
|
|
31
|
+
return use(SelectorRowLayoutContext);
|
|
32
|
+
}
|
package/src/Selector/types.ts
CHANGED
|
@@ -14,7 +14,10 @@ import type {IconType} from '../Icon';
|
|
|
14
14
|
*/
|
|
15
15
|
export type SelectorOptionData = {
|
|
16
16
|
value: string;
|
|
17
|
+
// Kept a string, not ReactNode: search filtering and type-ahead both
|
|
18
|
+
// lowercase this to match keystrokes.
|
|
17
19
|
label?: string;
|
|
20
|
+
description?: ReactNode;
|
|
18
21
|
disabled?: boolean;
|
|
19
22
|
icon?: ReactNode | IconType;
|
|
20
23
|
};
|
|
@@ -40,7 +43,4 @@ export type SelectorSection = {
|
|
|
40
43
|
* Can be a plain string, option data object, divider, or section.
|
|
41
44
|
*/
|
|
42
45
|
export type SelectorOptionType =
|
|
43
|
-
|
|
|
44
|
-
| SelectorOptionData
|
|
45
|
-
| SelectorDivider
|
|
46
|
-
| SelectorSection;
|
|
46
|
+
string | SelectorOptionData | SelectorDivider | SelectorSection;
|
|
@@ -82,7 +82,7 @@ const styles = stylex.create({
|
|
|
82
82
|
fontSize: 'inherit',
|
|
83
83
|
fontWeight: fontWeightVars['--font-weight-normal'],
|
|
84
84
|
textAlign: 'start',
|
|
85
|
-
':hover': {
|
|
85
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
86
86
|
'@media (hover: hover)': {
|
|
87
87
|
backgroundColor: colorVars['--color-overlay-hover'],
|
|
88
88
|
},
|
|
@@ -104,7 +104,7 @@ const styles = stylex.create({
|
|
|
104
104
|
interactiveCollapsed: {
|
|
105
105
|
backgroundColor: {
|
|
106
106
|
default: 'transparent',
|
|
107
|
-
':hover': {
|
|
107
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
108
108
|
'@media (hover: hover)': 'transparent',
|
|
109
109
|
},
|
|
110
110
|
},
|
|
@@ -147,7 +147,7 @@ const styles = stylex.create({
|
|
|
147
147
|
color: 'inherit',
|
|
148
148
|
cursor: 'pointer',
|
|
149
149
|
borderRadius: radiusVars['--radius-element'],
|
|
150
|
-
':hover': {
|
|
150
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
151
151
|
'@media (hover: hover)': {
|
|
152
152
|
backgroundColor: colorVars['--color-overlay-hover'],
|
|
153
153
|
},
|
package/src/Slider/Slider.tsx
CHANGED
|
@@ -189,6 +189,16 @@ const styles = stylex.create({
|
|
|
189
189
|
trackContainerVertical: {
|
|
190
190
|
width: THUMB_SIZE,
|
|
191
191
|
height: 160,
|
|
192
|
+
// Same tap target, rotated: the vertical track is the thing you press, and
|
|
193
|
+
// it is only THUMB_SIZE (20px) wide. `minBlockSize` above floors the
|
|
194
|
+
// horizontal track's short axis; here the short axis is the inline one
|
|
195
|
+
// (the block size is already 160px), so floor that instead. The rail,
|
|
196
|
+
// fill, marks and thumb all center on the inline 50%, so they stay put;
|
|
197
|
+
// only the invisible tappable area grows. Desktop is unchanged.
|
|
198
|
+
minInlineSize: {
|
|
199
|
+
default: null,
|
|
200
|
+
'@media (pointer: coarse)': '24px',
|
|
201
|
+
},
|
|
192
202
|
flexDirection: 'column',
|
|
193
203
|
justifyContent: 'center',
|
|
194
204
|
cursor: 'pointer',
|
|
@@ -258,7 +268,7 @@ const styles = stylex.create({
|
|
|
258
268
|
thumbHover: {
|
|
259
269
|
backgroundColor: {
|
|
260
270
|
default: colorVars['--color-accent'],
|
|
261
|
-
':hover': {
|
|
271
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
262
272
|
'@media (hover: hover)': `color-mix(in srgb, ${colorVars['--color-accent']}, ${colorVars['--color-tint-hover']} 15%)`,
|
|
263
273
|
},
|
|
264
274
|
},
|
package/src/Stack/Stack.doc.mjs
CHANGED
|
@@ -46,12 +46,36 @@ export const docs = {
|
|
|
46
46
|
description:
|
|
47
47
|
'Inline (horizontal) padding. Overrides padding on the inline axis when both are set.',
|
|
48
48
|
},
|
|
49
|
+
{
|
|
50
|
+
name: 'paddingInlineStart',
|
|
51
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
52
|
+
description:
|
|
53
|
+
'Inline-start padding, using the spacing scale (left in LTR, right in RTL). Overrides paddingInline and padding on that edge only.',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'paddingInlineEnd',
|
|
57
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
58
|
+
description:
|
|
59
|
+
'Inline-end padding, using the spacing scale (right in LTR, left in RTL). Overrides paddingInline and padding on that edge only.',
|
|
60
|
+
},
|
|
49
61
|
{
|
|
50
62
|
name: 'paddingBlock',
|
|
51
63
|
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
52
64
|
description:
|
|
53
65
|
'Block (vertical) padding. Overrides padding on the block axis when both are set.',
|
|
54
66
|
},
|
|
67
|
+
{
|
|
68
|
+
name: 'paddingBlockStart',
|
|
69
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
70
|
+
description:
|
|
71
|
+
'Block-start (top) padding, using the spacing scale. Overrides paddingBlock and padding on that edge only.',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'paddingBlockEnd',
|
|
75
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
76
|
+
description:
|
|
77
|
+
'Block-end (bottom) padding, using the spacing scale. Overrides paddingBlock and padding on that edge only.',
|
|
78
|
+
},
|
|
55
79
|
{
|
|
56
80
|
name: 'isScrollable',
|
|
57
81
|
type: 'boolean',
|
|
@@ -150,12 +174,36 @@ export const docs = {
|
|
|
150
174
|
description:
|
|
151
175
|
'Inline (horizontal) padding, using the spacing scale. Overrides padding on the inline axis when both are set.',
|
|
152
176
|
},
|
|
177
|
+
{
|
|
178
|
+
name: 'paddingInlineStart',
|
|
179
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
180
|
+
description:
|
|
181
|
+
'Inline-start padding, using the spacing scale (left in LTR, right in RTL). Overrides paddingInline and padding on that edge only.',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: 'paddingInlineEnd',
|
|
185
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
186
|
+
description:
|
|
187
|
+
'Inline-end padding, using the spacing scale (right in LTR, left in RTL). Overrides paddingInline and padding on that edge only.',
|
|
188
|
+
},
|
|
153
189
|
{
|
|
154
190
|
name: 'paddingBlock',
|
|
155
191
|
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
156
192
|
description:
|
|
157
193
|
'Block (vertical) padding, using the spacing scale. Overrides padding on the block axis when both are set.',
|
|
158
194
|
},
|
|
195
|
+
{
|
|
196
|
+
name: 'paddingBlockStart',
|
|
197
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
198
|
+
description:
|
|
199
|
+
'Block-start (top) padding, using the spacing scale. Overrides paddingBlock and padding on that edge only.',
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: 'paddingBlockEnd',
|
|
203
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
204
|
+
description:
|
|
205
|
+
'Block-end (bottom) padding, using the spacing scale. Overrides paddingBlock and padding on that edge only.',
|
|
206
|
+
},
|
|
159
207
|
{
|
|
160
208
|
name: 'isScrollable',
|
|
161
209
|
type: 'boolean',
|
|
@@ -253,12 +301,36 @@ export const docs = {
|
|
|
253
301
|
description:
|
|
254
302
|
'Inline (horizontal) padding, using the spacing scale. Overrides padding on the inline axis when both are set.',
|
|
255
303
|
},
|
|
304
|
+
{
|
|
305
|
+
name: 'paddingInlineStart',
|
|
306
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
307
|
+
description:
|
|
308
|
+
'Inline-start padding, using the spacing scale (left in LTR, right in RTL). Overrides paddingInline and padding on that edge only.',
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: 'paddingInlineEnd',
|
|
312
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
313
|
+
description:
|
|
314
|
+
'Inline-end padding, using the spacing scale (right in LTR, left in RTL). Overrides paddingInline and padding on that edge only.',
|
|
315
|
+
},
|
|
256
316
|
{
|
|
257
317
|
name: 'paddingBlock',
|
|
258
318
|
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
259
319
|
description:
|
|
260
320
|
'Block (vertical) padding, using the spacing scale. Overrides padding on the block axis when both are set.',
|
|
261
321
|
},
|
|
322
|
+
{
|
|
323
|
+
name: 'paddingBlockStart',
|
|
324
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
325
|
+
description:
|
|
326
|
+
'Block-start (top) padding, using the spacing scale. Overrides paddingBlock and padding on that edge only.',
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
name: 'paddingBlockEnd',
|
|
330
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
331
|
+
description:
|
|
332
|
+
'Block-end (bottom) padding, using the spacing scale. Overrides paddingBlock and padding on that edge only.',
|
|
333
|
+
},
|
|
262
334
|
{
|
|
263
335
|
name: 'isScrollable',
|
|
264
336
|
type: 'boolean',
|