@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
|
@@ -5,10 +5,13 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file FormLayoutContext.ts
|
|
7
7
|
* @input Uses React createContext
|
|
8
|
-
* @output Exports FormLayoutContext and
|
|
9
|
-
* @position Context for form layout direction detection
|
|
8
|
+
* @output Exports FormLayoutContext, FormLayoutDirection, and FormOptionality types
|
|
9
|
+
* @position Context for form layout direction + default-optionality detection
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
12
|
+
* - /packages/core/src/FormLayout/FormLayout.tsx (prop + context value)
|
|
13
|
+
* - /packages/core/src/Field/FieldLabel.tsx (indicator resolution)
|
|
14
|
+
* - /packages/core/src/FormLayout/index.ts (exports if types change)
|
|
12
15
|
*/
|
|
13
16
|
import { createContext } from 'react';
|
|
14
17
|
|
|
@@ -22,8 +25,20 @@ import { createContext } from 'react';
|
|
|
22
25
|
*/
|
|
23
26
|
|
|
24
27
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
28
|
+
* Which state a form treats as its default, so only the *exception* carries a
|
|
29
|
+
* visible optional/required indicator.
|
|
30
|
+
*
|
|
31
|
+
* - `'optional'` — fields are optional unless a field opts into `isRequired`;
|
|
32
|
+
* only required fields show an indicator.
|
|
33
|
+
* - `'required'` — fields are required unless a field opts into `isOptional`;
|
|
34
|
+
* only optional fields show an indicator.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Context for detecting which form layout a component is rendered in. Children
|
|
39
|
+
* can use this to adapt their rendering based on the parent layout — direction
|
|
40
|
+
* for spatial arrangement, and `defaultOptionality` so a field can suppress the
|
|
41
|
+
* indicator that merely restates the form-wide default.
|
|
27
42
|
*/
|
|
28
43
|
export const FormLayoutContext = /*#__PURE__*/createContext({
|
|
29
44
|
direction: 'vertical'
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { FormLayout } from './FormLayout';
|
|
10
10
|
export type { FormLayoutProps } from './FormLayout';
|
|
11
|
-
export type { FormLayoutDirection } from './FormLayoutContext';
|
|
11
|
+
export type { FormLayoutDirection, FormOptionality } from './FormLayoutContext';
|
|
12
12
|
export { FormLayoutContext } from './FormLayoutContext';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormLayout/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,YAAY,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAClD,YAAY,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormLayout/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,YAAY,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAClD,YAAY,EAAC,mBAAmB,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC"}
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
* - /packages/cli/assets/templates/blocks/components/HoverCard/ (showcase blocks)
|
|
12
12
|
*/
|
|
13
13
|
import { type ReactElement, type ReactNode } from 'react';
|
|
14
|
-
import { type HoverCardFocusTrigger } from './useHoverCard';
|
|
14
|
+
import { type HoverCardFocusTrigger, type HoverCardTouchTrigger } from './useHoverCard';
|
|
15
15
|
import type { LayerAlignment, LayerPlacement } from '../Layer/useLayer';
|
|
16
16
|
import type { BaseProps } from '../BaseProps';
|
|
17
|
-
export type { HoverCardFocusTrigger } from './useHoverCard';
|
|
17
|
+
export type { HoverCardFocusTrigger, HoverCardTouchTrigger, } from './useHoverCard';
|
|
18
18
|
export interface HoverCardProps extends Pick<BaseProps, 'xstyle' | 'className' | 'style'> {
|
|
19
19
|
/**
|
|
20
20
|
* The trigger element(s). Children refs are preserved.
|
|
@@ -53,6 +53,16 @@ export interface HoverCardProps extends Pick<BaseProps, 'xstyle' | 'className' |
|
|
|
53
53
|
* @default 'auto'
|
|
54
54
|
*/
|
|
55
55
|
focusTrigger?: HoverCardFocusTrigger;
|
|
56
|
+
/**
|
|
57
|
+
* What a tap does on a touch pointer, where there is no hover:
|
|
58
|
+
* - `auto`: tap opens the card, unless the trigger performs an action of its
|
|
59
|
+
* own (a button, a link, a form control) — that tap belongs to the control
|
|
60
|
+
* - `tap`: tap always opens the card, even on a trigger that acts
|
|
61
|
+
* - `none`: touch never opens the card
|
|
62
|
+
*
|
|
63
|
+
* @default 'auto'
|
|
64
|
+
*/
|
|
65
|
+
touchTrigger?: HoverCardTouchTrigger;
|
|
56
66
|
/**
|
|
57
67
|
* Whether the hover card is enabled.
|
|
58
68
|
* When false, hover/focus triggers are disabled.
|
|
@@ -110,7 +120,7 @@ export interface HoverCardProps extends Pick<BaseProps, 'xstyle' | 'className' |
|
|
|
110
120
|
* </HoverCard>
|
|
111
121
|
* ```
|
|
112
122
|
*/
|
|
113
|
-
export declare function HoverCard({ children, content, placement, alignment, delay, hideDelay, focusTrigger, isEnabled, label, onOpenChange, hasHoverIndication, isOpen, isDefaultOpen, xstyle, className, style, }: HoverCardProps): ReactElement;
|
|
123
|
+
export declare function HoverCard({ children, content, placement, alignment, delay, hideDelay, focusTrigger, touchTrigger, isEnabled, label, onOpenChange, hasHoverIndication, isOpen, isDefaultOpen, xstyle, className, style, }: HoverCardProps): ReactElement;
|
|
114
124
|
export declare namespace HoverCard {
|
|
115
125
|
var displayName: string;
|
|
116
126
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/HoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG7E,OAAO,
|
|
1
|
+
{"version":3,"file":"HoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/HoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG7E,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,YAAY,EACV,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAiBxB,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAEzC;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAEtC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAiBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,OAAO,EACP,SAAmB,EACnB,SAAoB,EACpB,KAAW,EACX,SAAe,EACf,YAAqB,EACrB,YAAqB,EACrB,SAAgB,EAChB,KAAK,EACL,YAAY,EACZ,kBAA2B,EAC3B,MAAM,EACN,aAAa,EACb,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,cAAc,GAAG,YAAY,CA0G/B;yBA5He,SAAS"}
|
|
@@ -59,6 +59,7 @@ export function HoverCard({
|
|
|
59
59
|
delay = 300,
|
|
60
60
|
hideDelay = 200,
|
|
61
61
|
focusTrigger = 'auto',
|
|
62
|
+
touchTrigger = 'auto',
|
|
62
63
|
isEnabled = true,
|
|
63
64
|
label,
|
|
64
65
|
onOpenChange,
|
|
@@ -88,6 +89,7 @@ export function HoverCard({
|
|
|
88
89
|
delay,
|
|
89
90
|
hideDelay,
|
|
90
91
|
focusTrigger,
|
|
92
|
+
touchTrigger,
|
|
91
93
|
isEnabled,
|
|
92
94
|
label,
|
|
93
95
|
isOpen,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SYNC: When adding new HoverCard files, update exports here
|
|
8
8
|
*/
|
|
9
9
|
export { useHoverCard } from './useHoverCard';
|
|
10
|
-
export type { HoverCardFocusTrigger, HoverCardOptions, HoverCardReturn, } from './useHoverCard';
|
|
10
|
+
export type { HoverCardFocusTrigger, HoverCardTouchTrigger, HoverCardOptions, HoverCardReturn, } from './useHoverCard';
|
|
11
11
|
export { HoverCard } from './HoverCard';
|
|
12
12
|
export type { HoverCardProps } from './HoverCard';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/HoverCard/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAGH,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,YAAY,EACV,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,YAAY,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/HoverCard/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAGH,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,YAAY,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file useHoverCard.ts
|
|
3
|
-
* @input Uses useLayer, React hooks
|
|
4
|
-
* @output Exports useHoverCard hook for hover/focus triggered layers
|
|
3
|
+
* @input Uses useLayer, useTouchTrigger, React hooks
|
|
4
|
+
* @output Exports useHoverCard hook for hover/focus/tap triggered layers
|
|
5
5
|
* @position Layer hook; builds on useLayer for hover card behavior
|
|
6
6
|
*
|
|
7
7
|
* SYNC: When modified, update:
|
|
@@ -9,10 +9,15 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { type ReactNode, type RefCallback } from 'react';
|
|
11
11
|
import { type ContextRenderProps, type LayerAlignment, type LayerPlacement } from '../Layer/useLayer';
|
|
12
|
+
import { type LayerTouchTrigger } from '../Layer/useTouchTrigger';
|
|
12
13
|
/**
|
|
13
14
|
* Focus trigger behavior for hover cards
|
|
14
15
|
*/
|
|
15
16
|
export type HoverCardFocusTrigger = 'auto' | 'always' | 'never';
|
|
17
|
+
/**
|
|
18
|
+
* Touch trigger behavior for hover cards
|
|
19
|
+
*/
|
|
20
|
+
export type HoverCardTouchTrigger = LayerTouchTrigger;
|
|
16
21
|
export interface HoverCardOptions {
|
|
17
22
|
/**
|
|
18
23
|
* Position placement relative to anchor
|
|
@@ -43,6 +48,16 @@ export interface HoverCardOptions {
|
|
|
43
48
|
* @default 'auto'
|
|
44
49
|
*/
|
|
45
50
|
focusTrigger?: HoverCardFocusTrigger;
|
|
51
|
+
/**
|
|
52
|
+
* What a tap does on a touch pointer, where there is no hover:
|
|
53
|
+
* - `auto`: tap opens the card, unless the trigger performs an action of its
|
|
54
|
+
* own (a button, a link, a form control) — that tap belongs to the control
|
|
55
|
+
* - `tap`: tap always opens the card, even on a trigger that acts
|
|
56
|
+
* - `none`: touch never opens the card
|
|
57
|
+
*
|
|
58
|
+
* @default 'auto'
|
|
59
|
+
*/
|
|
60
|
+
touchTrigger?: HoverCardTouchTrigger;
|
|
46
61
|
/**
|
|
47
62
|
* Whether the hover card is enabled.
|
|
48
63
|
* When false, hover/focus triggers are disabled.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;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IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAE9B;;;OAGG;IACH,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEtC;;;;OAIG;IACH,cAAc,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEzC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,eAAe,EAAE,CACf,QAAQ,EAAE,SAAS,EACnB,KAAK,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,KAC5C,SAAS,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAyBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CA8X5E"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file useHoverCard.ts
|
|
7
|
-
* @input Uses useLayer, React hooks
|
|
8
|
-
* @output Exports useHoverCard hook for hover/focus triggered layers
|
|
7
|
+
* @input Uses useLayer, useTouchTrigger, React hooks
|
|
8
|
+
* @output Exports useHoverCard hook for hover/focus/tap triggered layers
|
|
9
9
|
* @position Layer hook; builds on useLayer for hover card behavior
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update:
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import { useCallback, useEffect, useRef } from 'react';
|
|
15
15
|
import * as stylex from '@stylexjs/stylex';
|
|
16
16
|
import { useLayer } from "../Layer/useLayer.js";
|
|
17
|
+
import { useTouchTrigger } from "../Layer/useTouchTrigger.js";
|
|
17
18
|
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
18
19
|
import "../theme/tokens.stylex.js";
|
|
19
20
|
import { colorVars, shadowVars, radiusVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
@@ -33,6 +34,10 @@ const styles = {
|
|
|
33
34
|
* Focus trigger behavior for hover cards
|
|
34
35
|
*/
|
|
35
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Touch trigger behavior for hover cards
|
|
39
|
+
*/
|
|
40
|
+
|
|
36
41
|
/**
|
|
37
42
|
* Check if an element is naturally focusable
|
|
38
43
|
*/
|
|
@@ -79,6 +84,7 @@ export function useHoverCard(options = {}) {
|
|
|
79
84
|
delay = 300,
|
|
80
85
|
hideDelay = 200,
|
|
81
86
|
focusTrigger = 'auto',
|
|
87
|
+
touchTrigger = 'auto',
|
|
82
88
|
isEnabled = true,
|
|
83
89
|
label,
|
|
84
90
|
isOpen,
|
|
@@ -112,6 +118,28 @@ export function useHoverCard(options = {}) {
|
|
|
112
118
|
}
|
|
113
119
|
}, []);
|
|
114
120
|
|
|
121
|
+
// Touch resolves immediately: the hover delays exist to filter out a pointer
|
|
122
|
+
// passing across the trigger, and a tap is never that.
|
|
123
|
+
const showNow = useCallback(() => {
|
|
124
|
+
clearTimeouts();
|
|
125
|
+
layer.show();
|
|
126
|
+
}, [clearTimeouts, layer]);
|
|
127
|
+
const hideNow = useCallback(() => {
|
|
128
|
+
clearTimeouts();
|
|
129
|
+
isHoveringContentRef.current = false;
|
|
130
|
+
layer.hide();
|
|
131
|
+
}, [clearTimeouts, layer]);
|
|
132
|
+
const touch = useTouchTrigger({
|
|
133
|
+
touchTrigger,
|
|
134
|
+
isEnabled,
|
|
135
|
+
isControlled: isOpen !== undefined,
|
|
136
|
+
isOpen: layer.isOpen,
|
|
137
|
+
layerId: layer.id,
|
|
138
|
+
triggerRef,
|
|
139
|
+
show: showNow,
|
|
140
|
+
hide: hideNow
|
|
141
|
+
});
|
|
142
|
+
|
|
115
143
|
// Schedule show with delay (suppressed when isOpen is false)
|
|
116
144
|
const scheduleShow = useCallback(() => {
|
|
117
145
|
if (!isEnabled || isOpen === false) {
|
|
@@ -139,15 +167,37 @@ export function useHoverCard(options = {}) {
|
|
|
139
167
|
|
|
140
168
|
// Event handlers
|
|
141
169
|
const handleMouseEnter = useCallback(() => {
|
|
170
|
+
// A tap synthesizes mouseenter. On touch the tap path owns the decision,
|
|
171
|
+
// so hover must not also fire — without this a hover card opens on every
|
|
172
|
+
// tap of its trigger and has nothing to close it.
|
|
173
|
+
if (touch.isTouchPointerRef.current) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
142
176
|
scheduleShow();
|
|
143
|
-
}, [scheduleShow]);
|
|
177
|
+
}, [touch, scheduleShow]);
|
|
144
178
|
const handleMouseLeave = useCallback(() => {
|
|
179
|
+
// On touch the synthesized mouseleave arrives with the next tap elsewhere,
|
|
180
|
+
// which the outside-tap dismissal already handles.
|
|
181
|
+
if (touch.isTouchPointerRef.current) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
145
184
|
scheduleHide();
|
|
146
|
-
}, [scheduleHide]);
|
|
185
|
+
}, [touch, scheduleHide]);
|
|
186
|
+
|
|
187
|
+
// Tap-to-open on touch; on a mouse this does nothing and hover still rules.
|
|
188
|
+
const handlePointerDown = useCallback(event => {
|
|
189
|
+
touch.handlePointerDown(event);
|
|
190
|
+
}, [touch]);
|
|
147
191
|
const handleFocusIn = useCallback(() => {
|
|
148
192
|
if (!isEnabled) {
|
|
149
193
|
return;
|
|
150
194
|
}
|
|
195
|
+
// A tap focuses the trigger it activates. Opening on that focus would
|
|
196
|
+
// reinstate exactly the behavior the touch path just decided against —
|
|
197
|
+
// and on an action trigger it covers the thing the user tapped.
|
|
198
|
+
if (touch.isTouchInteraction()) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
151
201
|
// Skip showing if we're in the middle of an Escape dismiss
|
|
152
202
|
if (isEscapeDismissingRef.current) {
|
|
153
203
|
isEscapeDismissingRef.current = false;
|
|
@@ -155,7 +205,7 @@ export function useHoverCard(options = {}) {
|
|
|
155
205
|
}
|
|
156
206
|
clearTimeouts();
|
|
157
207
|
layer.show();
|
|
158
|
-
}, [isEnabled, clearTimeouts, layer]);
|
|
208
|
+
}, [isEnabled, touch, clearTimeouts, layer]);
|
|
159
209
|
const handleFocusOut = useCallback(e => {
|
|
160
210
|
// Check if focus is moving to the hover card content
|
|
161
211
|
const relatedTarget = e.relatedTarget;
|
|
@@ -172,11 +222,15 @@ export function useHoverCard(options = {}) {
|
|
|
172
222
|
e.stopPropagation();
|
|
173
223
|
// Hide immediately without refocusing (we're already on trigger)
|
|
174
224
|
clearTimeouts();
|
|
225
|
+
touch.clearTapOpen();
|
|
175
226
|
layer.hide();
|
|
176
227
|
}
|
|
177
|
-
}, [clearTimeouts, layer]);
|
|
228
|
+
}, [touch, clearTimeouts, layer]);
|
|
178
229
|
|
|
179
230
|
// Interaction ref that handles event listeners only
|
|
231
|
+
const {
|
|
232
|
+
handlePointerEnter
|
|
233
|
+
} = touch;
|
|
180
234
|
const interactionRef = useCallback(el => {
|
|
181
235
|
// Cleanup previous element
|
|
182
236
|
if (triggerRef.current) {
|
|
@@ -185,11 +239,17 @@ export function useHoverCard(options = {}) {
|
|
|
185
239
|
triggerRef.current.removeEventListener('focusin', handleFocusIn);
|
|
186
240
|
triggerRef.current.removeEventListener('focusout', handleFocusOut);
|
|
187
241
|
triggerRef.current.removeEventListener('keydown', handleKeyDown);
|
|
242
|
+
triggerRef.current.removeEventListener('pointerenter', handlePointerEnter);
|
|
243
|
+
triggerRef.current.removeEventListener('pointerdown', handlePointerDown);
|
|
188
244
|
}
|
|
189
245
|
if (el) {
|
|
190
|
-
// Attach hover listeners
|
|
246
|
+
// Attach hover listeners. `pointerenter` runs before the synthesized
|
|
247
|
+
// `mouseenter` a tap produces, which is what lets the hover path know
|
|
248
|
+
// it is looking at a finger.
|
|
249
|
+
el.addEventListener('pointerenter', handlePointerEnter);
|
|
191
250
|
el.addEventListener('mouseenter', handleMouseEnter);
|
|
192
251
|
el.addEventListener('mouseleave', handleMouseLeave);
|
|
252
|
+
el.addEventListener('pointerdown', handlePointerDown);
|
|
193
253
|
|
|
194
254
|
// Attach focus listeners based on focusTrigger option
|
|
195
255
|
const shouldAttachFocus = focusTrigger === 'always' || focusTrigger === 'auto' && isFocusable(el);
|
|
@@ -202,7 +262,7 @@ export function useHoverCard(options = {}) {
|
|
|
202
262
|
el.addEventListener('keydown', handleKeyDown);
|
|
203
263
|
}
|
|
204
264
|
triggerRef.current = el;
|
|
205
|
-
}, [focusTrigger, handleMouseEnter, handleMouseLeave, handleFocusIn, handleFocusOut, handleKeyDown]);
|
|
265
|
+
}, [focusTrigger, handleMouseEnter, handleMouseLeave, handleFocusIn, handleFocusOut, handleKeyDown, handlePointerEnter, handlePointerDown]);
|
|
206
266
|
|
|
207
267
|
// Combined ref - shorthand for calling both positionRef and interactionRef
|
|
208
268
|
const ref = useCallback(el => {
|
|
@@ -268,10 +328,18 @@ export function useHoverCard(options = {}) {
|
|
|
268
328
|
className: "x1lliihq x1vlblms xvmdzux x126nfab x1t818jl"
|
|
269
329
|
},
|
|
270
330
|
onMouseEnter: () => {
|
|
331
|
+
// Touch synthesizes these over the card too; letting a tap inside
|
|
332
|
+
// register as "hovering content" would block every later hide.
|
|
333
|
+
if (touch.isTouchPointerRef.current) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
271
336
|
isHoveringContentRef.current = true;
|
|
272
337
|
clearTimeouts();
|
|
273
338
|
},
|
|
274
339
|
onMouseLeave: () => {
|
|
340
|
+
if (touch.isTouchPointerRef.current) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
275
343
|
isHoveringContentRef.current = false;
|
|
276
344
|
scheduleHide();
|
|
277
345
|
},
|
|
@@ -283,6 +351,7 @@ export function useHoverCard(options = {}) {
|
|
|
283
351
|
isEscapeDismissingRef.current = true;
|
|
284
352
|
// Hide immediately
|
|
285
353
|
clearTimeouts();
|
|
354
|
+
touch.clearTapOpen();
|
|
286
355
|
layer.hide();
|
|
287
356
|
// Refocus the trigger
|
|
288
357
|
triggerRef.current?.focus();
|
|
@@ -308,7 +377,7 @@ export function useHoverCard(options = {}) {
|
|
|
308
377
|
},
|
|
309
378
|
children: children
|
|
310
379
|
}), renderProps);
|
|
311
|
-
}, [layer, placement, alignment, label, clearTimeouts, scheduleHide, popoverXstyle]);
|
|
380
|
+
}, [layer, placement, alignment, label, clearTimeouts, scheduleHide, popoverXstyle, touch]);
|
|
312
381
|
return {
|
|
313
382
|
ref,
|
|
314
383
|
positionRef: layer.ref,
|
package/dist/Item/Item.d.ts
CHANGED
|
@@ -68,6 +68,14 @@ export interface ItemProps extends BaseProps<HTMLElement> {
|
|
|
68
68
|
* and text-overflow: ellipsis is applied.
|
|
69
69
|
*/
|
|
70
70
|
descriptionLines?: number;
|
|
71
|
+
/**
|
|
72
|
+
* How the label and description sit together. `stacked` puts the description
|
|
73
|
+
* on its own line below the label; `inline` keeps both on one line, with the
|
|
74
|
+
* description ellipsizing first, so the row fits a fixed-height host.
|
|
75
|
+
*
|
|
76
|
+
* @default 'stacked'
|
|
77
|
+
*/
|
|
78
|
+
layout?: 'stacked' | 'inline';
|
|
71
79
|
/**
|
|
72
80
|
* Click handler. Makes the item clickable with button semantics.
|
|
73
81
|
*/
|
|
@@ -139,7 +147,7 @@ export interface ItemProps extends BaseProps<HTMLElement> {
|
|
|
139
147
|
* />
|
|
140
148
|
* ```
|
|
141
149
|
*/
|
|
142
|
-
export declare function Item({ as: Component, marker, startContent, label, description, endContent, align, density, labelLines, descriptionLines, onClick, interactiveRef, href, target: targetFromProps, rel: relFromProps, isHighlighted, isSelected, isDisabled, xstyle, className, style, ref, role, ...restProps }: ItemProps): import("react").JSX.Element;
|
|
150
|
+
export declare function Item({ as: Component, marker, startContent, label, description, endContent, align, density, labelLines, descriptionLines, layout, onClick, interactiveRef, href, target: targetFromProps, rel: relFromProps, isHighlighted, isSelected, isDisabled, xstyle, className, style, ref, role, ...restProps }: ItemProps): import("react").JSX.Element;
|
|
143
151
|
export declare namespace Item {
|
|
144
152
|
var displayName: string;
|
|
145
153
|
}
|
package/dist/Item/Item.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/Item/Item.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAS,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAU7C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAa5C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC3C,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9D,MAAM,WAAW,SAAU,SAAQ,SAAS,CAAC,WAAW,CAAC;IACvD,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAE7B;;;OAGG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,MAAM,CAAC;IAE3B;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE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,EAClB,UAAkB,EAClB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,IAAI,EACJ,GAAG,SAAS,EACb,EAAE,SAAS,+BAqNX;yBA/Oe,IAAI"}
|
package/dist/Item/Item.js
CHANGED
|
@@ -66,7 +66,7 @@ const styles = {
|
|
|
66
66
|
k1ekBW: "x15406qy",
|
|
67
67
|
kIyJzY: "xkvfbh3",
|
|
68
68
|
kAMwcw: "xlr8y92",
|
|
69
|
-
kWkggS: "xjbqb8w
|
|
69
|
+
kWkggS: "xjbqb8w xoevpu5 xyxi2l3",
|
|
70
70
|
$$css: true
|
|
71
71
|
},
|
|
72
72
|
highlighted: {
|
|
@@ -82,6 +82,15 @@ const styles = {
|
|
|
82
82
|
kfzvcC: "x47corl",
|
|
83
83
|
$$css: true
|
|
84
84
|
},
|
|
85
|
+
inlineLabel: {
|
|
86
|
+
kmuXW: "x2lah0s",
|
|
87
|
+
$$css: true
|
|
88
|
+
},
|
|
89
|
+
inlineDescription: {
|
|
90
|
+
kmuXW: "xs83m0k",
|
|
91
|
+
k7Eaqz: "xeuugli",
|
|
92
|
+
$$css: true
|
|
93
|
+
},
|
|
85
94
|
label: {
|
|
86
95
|
kMwMTN: "x5tbw38",
|
|
87
96
|
kGuDYH: "xjm74w1",
|
|
@@ -174,6 +183,7 @@ export function Item({
|
|
|
174
183
|
density = 'balanced',
|
|
175
184
|
labelLines,
|
|
176
185
|
descriptionLines,
|
|
186
|
+
layout = 'stacked',
|
|
177
187
|
onClick,
|
|
178
188
|
interactiveRef,
|
|
179
189
|
href,
|
|
@@ -223,13 +233,17 @@ export function Item({
|
|
|
223
233
|
const isStringLabel = typeof label === 'string';
|
|
224
234
|
const isStringDescription = typeof description === 'string';
|
|
225
235
|
const labelTruncateStyle = labelLines != null ? labelLines === 1 ? styles.labelSingleTruncate : styles.labelMultiTruncate : isStringLabel ? styles.labelSingleTruncate : null;
|
|
226
|
-
|
|
236
|
+
|
|
237
|
+
// Inline rows are one line by definition, so the description always
|
|
238
|
+
// ellipsizes there — a ReactNode description cannot wrap the row open.
|
|
239
|
+
const isInline = layout === 'inline' && description != null;
|
|
240
|
+
const descriptionTruncateStyle = descriptionLines != null ? descriptionLines === 1 ? styles.descriptionSingleTruncate : styles.descriptionMultiTruncate : isStringDescription || isInline ? styles.descriptionSingleTruncate : null;
|
|
227
241
|
const labelAndDescription = /*#__PURE__*/_jsxs(_Fragment, {
|
|
228
242
|
children: [/*#__PURE__*/_jsx("span", {
|
|
229
|
-
...stylex.props(styles.label, labelTruncateStyle, labelLines != null && labelLines > 1 && dynamicStyles.lineClamp(labelLines)),
|
|
243
|
+
...stylex.props(styles.label, isInline && styles.inlineLabel, labelTruncateStyle, labelLines != null && labelLines > 1 && dynamicStyles.lineClamp(labelLines)),
|
|
230
244
|
children: label
|
|
231
245
|
}), description != null && /*#__PURE__*/_jsx("span", {
|
|
232
|
-
...stylex.props(styles.description, descriptionTruncateStyle, descriptionLines != null && descriptionLines > 1 && dynamicStyles.lineClamp(descriptionLines)),
|
|
246
|
+
...stylex.props(styles.description, isInline && styles.inlineDescription, descriptionTruncateStyle, descriptionLines != null && descriptionLines > 1 && dynamicStyles.lineClamp(descriptionLines)),
|
|
233
247
|
children: description
|
|
234
248
|
})]
|
|
235
249
|
});
|
|
@@ -259,10 +273,16 @@ export function Item({
|
|
|
259
273
|
0: {
|
|
260
274
|
className: "x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h"
|
|
261
275
|
},
|
|
276
|
+
2: {
|
|
277
|
+
className: "x78zum5 x98rzlu xeuugli x1yc453h x1q0g3np x6s0dn4 x1lfs0n9"
|
|
278
|
+
},
|
|
262
279
|
1: {
|
|
263
280
|
className: "x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h xbyyjgo"
|
|
281
|
+
},
|
|
282
|
+
3: {
|
|
283
|
+
className: "x78zum5 x98rzlu xeuugli x1yc453h x1q0g3np x6s0dn4 x1lfs0n9 xbyyjgo"
|
|
264
284
|
}
|
|
265
|
-
}[!!isDisabled << 0],
|
|
285
|
+
}[!!isInline << 1 | !!isDisabled << 0],
|
|
266
286
|
children: labelAndDescription
|
|
267
287
|
}) : href != null ? /*#__PURE__*/_jsx(LinkComponent, {
|
|
268
288
|
href: href,
|
|
@@ -274,10 +294,16 @@ export function Item({
|
|
|
274
294
|
0: {
|
|
275
295
|
className: "xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz"
|
|
276
296
|
},
|
|
297
|
+
2: {
|
|
298
|
+
className: "xmper1u xln7xf2 x1heor9g x78zum5 x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz x1q0g3np x6s0dn4 x1lfs0n9"
|
|
299
|
+
},
|
|
277
300
|
1: {
|
|
278
301
|
className: "xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz xbyyjgo"
|
|
302
|
+
},
|
|
303
|
+
3: {
|
|
304
|
+
className: "xmper1u xln7xf2 x1heor9g x78zum5 x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz x1q0g3np x6s0dn4 x1lfs0n9 xbyyjgo"
|
|
279
305
|
}
|
|
280
|
-
}[!!isDisabled << 0],
|
|
306
|
+
}[!!isInline << 1 | !!isDisabled << 0],
|
|
281
307
|
children: labelAndDescription
|
|
282
308
|
}) : onClick != null ? /*#__PURE__*/_jsx("button", {
|
|
283
309
|
type: "button",
|
|
@@ -287,20 +313,32 @@ export function Item({
|
|
|
287
313
|
0: {
|
|
288
314
|
className: "xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1a2a7pz"
|
|
289
315
|
},
|
|
316
|
+
2: {
|
|
317
|
+
className: "xmper1u xln7xf2 x1heor9g x78zum5 x98rzlu xeuugli x1yc453h x1a2a7pz x1q0g3np x6s0dn4 x1lfs0n9"
|
|
318
|
+
},
|
|
290
319
|
1: {
|
|
291
320
|
className: "xmper1u xln7xf2 x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1a2a7pz xbyyjgo"
|
|
321
|
+
},
|
|
322
|
+
3: {
|
|
323
|
+
className: "xmper1u xln7xf2 x1heor9g x78zum5 x98rzlu xeuugli x1yc453h x1a2a7pz x1q0g3np x6s0dn4 x1lfs0n9 xbyyjgo"
|
|
292
324
|
}
|
|
293
|
-
}[!!isDisabled << 0],
|
|
325
|
+
}[!!isInline << 1 | !!isDisabled << 0],
|
|
294
326
|
children: labelAndDescription
|
|
295
327
|
}) : /*#__PURE__*/_jsx("span", {
|
|
296
328
|
...{
|
|
297
329
|
0: {
|
|
298
330
|
className: "x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h"
|
|
299
331
|
},
|
|
332
|
+
2: {
|
|
333
|
+
className: "x78zum5 x98rzlu xeuugli x1yc453h x1q0g3np x6s0dn4 x1lfs0n9"
|
|
334
|
+
},
|
|
300
335
|
1: {
|
|
301
336
|
className: "x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h xbyyjgo"
|
|
337
|
+
},
|
|
338
|
+
3: {
|
|
339
|
+
className: "x78zum5 x98rzlu xeuugli x1yc453h x1q0g3np x6s0dn4 x1lfs0n9 xbyyjgo"
|
|
302
340
|
}
|
|
303
|
-
}[!!isDisabled << 0],
|
|
341
|
+
}[!!isInline << 1 | !!isDisabled << 0],
|
|
304
342
|
children: labelAndDescription
|
|
305
343
|
}), endContent != null && /*#__PURE__*/_jsx("span", {
|
|
306
344
|
...{
|
package/dist/Layer/index.d.ts
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export { useLayer } from './useLayer';
|
|
15
15
|
export type { LayerAlignment, LayerPlacement, ContextRenderProps, FixedRenderProps, ContextLayerOptions, FixedLayerOptions, ContextLayerReturn, FixedLayerReturn, } from './useLayer';
|
|
16
|
+
export { useTouchTrigger, isActionTrigger } from './useTouchTrigger';
|
|
17
|
+
export type { LayerTouchTrigger, UseTouchTriggerOptions, UseTouchTriggerReturn, } from './useTouchTrigger';
|
|
16
18
|
export { LayerProvider } from './LayerProvider';
|
|
17
19
|
export type { LayerProviderProps } from './LayerProvider';
|
|
18
20
|
export { LayerContext, useLayerContext } from './LayerContext';
|
|
@@ -21,7 +23,7 @@ export { layerAnimations } from './layerAnimations.stylex';
|
|
|
21
23
|
export { usePopover, Popover } from '../Popover';
|
|
22
24
|
export type { UsePopoverOptions, UsePopoverReturn, PopoverProps, } from '../Popover';
|
|
23
25
|
export { useHoverCard, HoverCard } from '../HoverCard';
|
|
24
|
-
export type { HoverCardFocusTrigger, HoverCardOptions, HoverCardReturn, HoverCardProps, } from '../HoverCard';
|
|
26
|
+
export type { HoverCardFocusTrigger, HoverCardTouchTrigger, HoverCardOptions, HoverCardReturn, HoverCardProps, } from '../HoverCard';
|
|
25
27
|
export { useTooltip, Tooltip } from '../Tooltip';
|
|
26
|
-
export type { TooltipFocusTrigger, TooltipOptions, TooltipReturn, TooltipProps, } from '../Tooltip';
|
|
28
|
+
export type { TooltipFocusTrigger, TooltipTouchTrigger, TooltipOptions, TooltipReturn, TooltipProps, } from '../Tooltip';
|
|
27
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Layer/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,YAAY,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,YAAY,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC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GxE,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AAGzD,OAAO,EAAC,UAAU,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AAC/C,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AACrD,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,cAAc,GACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAC,UAAU,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AAC/C,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,YAAY,CAAC"}
|
package/dist/Layer/index.js
CHANGED
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
// Core layer hook (remains in Layer)
|
|
20
20
|
export { useLayer } from "./useLayer.js";
|
|
21
|
+
// Shared touch behavior for the hover layers
|
|
22
|
+
export { useTouchTrigger, isActionTrigger } from "./useTouchTrigger.js";
|
|
21
23
|
// Layer provider
|
|
22
24
|
export { LayerProvider } from "./LayerProvider.js";
|
|
23
25
|
export { LayerContext, useLayerContext } from "./LayerContext.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayer.d.ts","sourceRoot":"","sources":["../../src/Layer/useLayer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAMZ,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"useLayer.d.ts","sourceRoot":"","sources":["../../src/Layer/useLayer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EA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AAE,MAAM,CAAC;IAEX;;;OAGG;IACH,MAAM,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,KAAK,SAAS,CAAC;CACrE;AAmFD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,GAAE,cAAwB,EACnC,SAAS,GAAE,cAAyB,GACnC,MAAM,CAgBR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,mBAAmB,GAAG,kBAAkB,CAAC;AAC3E,wBAAgB,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAAC"}
|
package/dist/Layer/useLayer.js
CHANGED
|
@@ -20,6 +20,7 @@ import { addAnchorName, removeAnchorName } from "./anchorName.js";
|
|
|
20
20
|
import { resolveLayerPortalTarget } from "./layerHost.js";
|
|
21
21
|
import "../theme/tokens.stylex.js";
|
|
22
22
|
import { typeScaleVars, typographyVars } from "../theme/tokens.stylex.js";
|
|
23
|
+
import { overlayPaddingReset } from "../Layout/padding.stylex.js";
|
|
23
24
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
25
|
const _temp = {
|
|
25
26
|
keoZOQ: "x1vhfslr",
|
|
@@ -453,7 +454,7 @@ export function useLayer(options) {
|
|
|
453
454
|
positionTryFallbacks: getPositionTryFallbacks(placement, alignment)
|
|
454
455
|
};
|
|
455
456
|
const offsetStyle = positioning === 'anchor' && offset ? placement === 'above' || placement === 'below' ? styles.offsetBlock(toCssLength(offset)) : styles.offsetInline(toCssLength(offset)) : null;
|
|
456
|
-
const stylexResult = stylex.props(styles.base, offsetStyle, xstyle);
|
|
457
|
+
const stylexResult = stylex.props(styles.base, overlayPaddingReset.reset, offsetStyle, xstyle);
|
|
457
458
|
const combinedClassName = extraClassName ? `${extraClassName} ${stylexResult.className ?? ''}` : stylexResult.className;
|
|
458
459
|
|
|
459
460
|
// The marker gives us the actual JSX parent without mounting arbitrary
|
|
@@ -496,7 +497,7 @@ export function useLayer(options) {
|
|
|
496
497
|
top: y,
|
|
497
498
|
left: x
|
|
498
499
|
};
|
|
499
|
-
const stylexResult = stylex.props(styles.base, styles.fixed, xstyle);
|
|
500
|
+
const stylexResult = stylex.props(styles.base, overlayPaddingReset.reset, styles.fixed, xstyle);
|
|
500
501
|
const combinedClassName = extraClassName ? `${extraClassName} ${stylexResult.className ?? ''}` : stylexResult.className;
|
|
501
502
|
return /*#__PURE__*/_jsx("div", {
|
|
502
503
|
ref: popoverRefCallback,
|