@astryxdesign/core 0.4.4 → 0.4.5-canary.0472ec1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/AvatarGroup/AvatarGroupOverflow.js +1 -1
- package/dist/Blockquote/Blockquote.d.ts +4 -3
- package/dist/Blockquote/Blockquote.d.ts.map +1 -1
- package/dist/Blockquote/Blockquote.js +9 -10
- package/dist/BottomSheet/BottomSheet.d.ts +11 -2
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +4 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts +5 -2
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +77 -18
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts.map +1 -1
- package/dist/BottomSheet/snapOffsets.d.ts +57 -20
- package/dist/BottomSheet/snapOffsets.d.ts.map +1 -1
- package/dist/BottomSheet/snapOffsets.js +106 -30
- package/dist/BottomSheet/useSheetGestures.d.ts +13 -8
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +160 -64
- package/dist/Breadcrumbs/BreadcrumbItem.js +6 -6
- package/dist/Button/Button.js +5 -5
- package/dist/Calendar/Calendar.d.ts +17 -0
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +55 -15
- package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts +14 -0
- package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts.map +1 -0
- package/dist/Calendar/getStandaloneShortWeekdayNames.js +26 -0
- package/dist/Calendar/hooks/useCalendarConstraints.d.ts +22 -1
- package/dist/Calendar/hooks/useCalendarConstraints.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarConstraints.js +26 -4
- package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarDays.js +14 -10
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarNavigation.js +8 -4
- package/dist/Calendar/standaloneShortWeekdayNames.generated.d.ts +47 -0
- package/dist/Calendar/standaloneShortWeekdayNames.generated.d.ts.map +1 -0
- package/dist/Calendar/standaloneShortWeekdayNames.generated.js +40 -0
- package/dist/Calendar/styles.js +3 -3
- package/dist/Center/Center.d.ts +23 -1
- package/dist/Center/Center.d.ts.map +1 -1
- package/dist/Center/Center.js +12 -6
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +2 -2
- package/dist/Chat/ChatToolCalls.js +1 -1
- package/dist/Chat/useChatDictation.d.ts +1 -1
- package/dist/Chat/useChatDictation.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.d.ts +1 -1
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +4 -3
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +9 -0
- package/dist/Citation/Citation.js +3 -3
- package/dist/ClickableCard/ClickableCard.js +2 -2
- package/dist/CommandPalette/CommandPaletteItem.js +1 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +8 -3
- package/dist/DateInput/DateInput.d.ts +31 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +92 -19
- package/dist/DateInput/MonthScroller.d.ts +35 -0
- package/dist/DateInput/MonthScroller.d.ts.map +1 -0
- package/dist/DateInput/MonthScroller.js +573 -0
- package/dist/DateInput/MonthYearWheels.d.ts +24 -0
- package/dist/DateInput/MonthYearWheels.d.ts.map +1 -0
- package/dist/DateInput/MonthYearWheels.js +114 -0
- package/dist/DateInput/TouchDateField.d.ts +10 -0
- package/dist/DateInput/TouchDateField.d.ts.map +1 -0
- package/dist/DateInput/TouchDateField.js +810 -0
- package/dist/DateInput/Wheel.d.ts +41 -0
- package/dist/DateInput/Wheel.d.ts.map +1 -0
- package/dist/DateInput/Wheel.js +315 -0
- package/dist/DateInput/monthGeometry.d.ts +65 -0
- package/dist/DateInput/monthGeometry.d.ts.map +1 -0
- package/dist/DateInput/monthGeometry.js +98 -0
- package/dist/DateInput/tokens.stylex.d.ts +63 -0
- package/dist/DateInput/tokens.stylex.d.ts.map +1 -0
- package/dist/DateInput/tokens.stylex.js +74 -0
- package/dist/DateInput/useOwnScrollGesture.d.ts +41 -0
- package/dist/DateInput/useOwnScrollGesture.d.ts.map +1 -0
- package/dist/DateInput/useOwnScrollGesture.js +202 -0
- package/dist/DateInput/usePointerDragScroll.d.ts +15 -0
- package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -0
- package/dist/DateInput/usePointerDragScroll.js +216 -0
- package/dist/DateInput/useScrollSettle.d.ts +26 -0
- package/dist/DateInput/useScrollSettle.d.ts.map +1 -0
- package/dist/DateInput/useScrollSettle.js +149 -0
- package/dist/DateRangeInput/DateRangeInput.d.ts +23 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +47 -9
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +18 -10
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/Field/FieldLabel.d.ts +2 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +21 -3
- package/dist/Field/InputClearButton.d.ts +2 -1
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +12 -1
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +4 -4
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +2 -2
- package/dist/FormLayout/FormLayout.d.ts +24 -2
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/FormLayout/FormLayout.js +7 -2
- package/dist/FormLayout/FormLayoutContext.d.ts +15 -2
- package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
- package/dist/FormLayout/FormLayoutContext.js +19 -4
- package/dist/FormLayout/index.d.ts +1 -1
- package/dist/FormLayout/index.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.d.ts +13 -3
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +2 -0
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/HoverCard/index.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.d.ts +17 -2
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +78 -9
- package/dist/Item/Item.d.ts +9 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +46 -8
- package/dist/Layer/index.d.ts +4 -2
- package/dist/Layer/index.d.ts.map +1 -1
- package/dist/Layer/index.js +2 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +3 -2
- package/dist/Layer/useTouchTrigger.d.ts +113 -0
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -0
- package/dist/Layer/useTouchTrigger.js +241 -0
- package/dist/Layout/container.stylex.d.ts +4 -2
- package/dist/Layout/container.stylex.d.ts.map +1 -1
- package/dist/Layout/container.stylex.js +19 -11
- package/dist/Layout/index.d.ts +1 -0
- package/dist/Layout/index.d.ts.map +1 -1
- package/dist/Layout/index.js +4 -0
- package/dist/Layout/padding.stylex.d.ts +315 -12
- package/dist/Layout/padding.stylex.d.ts.map +1 -1
- package/dist/Layout/padding.stylex.js +389 -12
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +2 -1
- package/dist/Link/Link.js +4 -4
- package/dist/Markdown/Markdown.d.ts +8 -0
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +31 -3
- package/dist/Markdown/parser.d.ts +14 -2
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +50 -2
- package/dist/MobileNav/MobileNav.d.ts +1 -0
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +24 -6
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +8 -3
- package/dist/NavItem/navItemStyles.stylex.d.ts +2 -2
- package/dist/NavItem/navItemStyles.stylex.js +2 -2
- package/dist/NavMenu/NavHeadingMenuItem.js +1 -1
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +38 -5
- package/dist/Outline/Outline.js +2 -2
- package/dist/Outline/parseOutlineFromMarkdown.d.ts +2 -0
- package/dist/Outline/parseOutlineFromMarkdown.d.ts.map +1 -1
- package/dist/Outline/parseOutlineFromMarkdown.js +5 -31
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +11 -12
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +3 -1
- package/dist/PowerSearch/formatFilterValue.d.ts +11 -2
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +23 -8
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +12 -1
- package/dist/RadioList/RadioListItem.d.ts +2 -2
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +68 -38
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +3 -3
- package/dist/Section/Section.d.ts +36 -1
- package/dist/Section/Section.d.ts.map +1 -1
- package/dist/Section/Section.js +12 -2
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +6 -1
- package/dist/SelectableCard/SelectableCard.js +1 -1
- package/dist/Selector/Selector.d.ts +26 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +95 -17
- package/dist/Selector/SelectorOption.d.ts +14 -1
- package/dist/Selector/SelectorOption.d.ts.map +1 -1
- package/dist/Selector/SelectorOption.js +6 -0
- package/dist/Selector/SelectorRowLayoutContext.d.ts +8 -0
- package/dist/Selector/SelectorRowLayoutContext.d.ts.map +1 -0
- package/dist/Selector/SelectorRowLayoutContext.js +27 -0
- package/dist/Selector/types.d.ts +1 -0
- package/dist/Selector/types.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +1 -1
- package/dist/SideNav/SideNavItem.js +1 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +3 -3
- package/dist/Stack/Stack.d.ts +23 -1
- package/dist/Stack/Stack.d.ts.map +1 -1
- package/dist/Stack/Stack.js +12 -6
- package/dist/StatusDot/StatusDot.d.ts +43 -3
- package/dist/StatusDot/StatusDot.d.ts.map +1 -1
- package/dist/StatusDot/StatusDot.js +42 -5
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +9 -0
- package/dist/TabList/TabMenu.js +1 -1
- package/dist/Table/TableRow.js +4 -4
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +7 -2
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts +5 -3
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.js +12 -9
- package/dist/Table/plugins/tree/useTableTreeData.js +2 -2
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +6 -1
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +6 -1
- package/dist/Thumbnail/Thumbnail.js +1 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +6 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +6 -4
- package/dist/Timestamp/formatInstant.d.ts +3 -2
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +8 -8
- package/dist/Timestamp/tooltipEntries.d.ts +2 -1
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.js +5 -3
- package/dist/Token/Token.js +1 -1
- package/dist/Tooltip/Tooltip.d.ts +16 -3
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +2 -0
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +21 -2
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +71 -13
- package/dist/TopNav/TopNavHeading.js +2 -2
- package/dist/TopNav/TopNavItem.js +2 -2
- package/dist/TopNav/TopNavMegaMenu.js +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +1 -1
- package/dist/TopNav/TopNavMenu.js +2 -2
- package/dist/TreeList/TreeListItem.js +1 -1
- package/dist/astryx.css +123 -60
- package/dist/hooks/containerReveal.stylex.d.ts.map +1 -1
- package/dist/hooks/containerReveal.stylex.js +18 -18
- package/dist/hooks/scrollbarGutter.d.ts +28 -0
- package/dist/hooks/scrollbarGutter.d.ts.map +1 -0
- package/dist/hooks/scrollbarGutter.js +103 -0
- package/dist/hooks/useResolvedRequired.d.ts +19 -0
- package/dist/hooks/useResolvedRequired.d.ts.map +1 -0
- package/dist/hooks/useResolvedRequired.js +40 -0
- package/dist/hooks/useScrollLock.d.ts +4 -0
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +13 -1
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +2 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +6 -0
- package/dist/i18n/useCollator.d.ts +12 -0
- package/dist/i18n/useCollator.d.ts.map +1 -0
- package/dist/i18n/useCollator.js +40 -0
- package/dist/i18n/useLocale.d.ts +3 -0
- package/dist/i18n/useLocale.d.ts.map +1 -0
- package/dist/i18n/useLocale.js +31 -0
- package/dist/theme/defineTheme.d.ts +5 -0
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +5 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +7 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +66 -5
- package/dist/theme/syntax/index.d.ts +6 -0
- package/dist/theme/syntax/index.d.ts.map +1 -1
- package/dist/theme/syntax/index.js +7 -2
- package/dist/utils/dateParser.d.ts +4 -3
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +8 -8
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/plainDate.d.ts +11 -2
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +32 -4
- package/locales/af-ZA.json +958 -0
- package/locales/ar-SA.json +998 -0
- package/locales/ca-ES.json +974 -0
- package/locales/cs-CZ.json +990 -0
- package/locales/da-DK.json +966 -0
- package/locales/de-DE.json +966 -0
- package/locales/el-GR.json +990 -0
- package/locales/en.json +32 -0
- package/locales/es-ES.json +978 -0
- package/locales/fi-FI.json +990 -0
- package/locales/fr-FR.json +928 -0
- package/locales/he-IL.json +990 -0
- package/locales/hu-HU.json +990 -0
- package/locales/it-IT.json +978 -0
- package/locales/ja-JP.json +998 -0
- package/locales/ko-KR.json +990 -0
- package/locales/nl-NL.json +954 -0
- package/locales/no-NO.json +978 -0
- package/locales/pl-PL.json +982 -0
- package/locales/pseudo.json +24 -0
- package/locales/pt-BR.json +982 -0
- package/locales/pt-PT.json +982 -0
- package/locales/ro-RO.json +982 -0
- package/locales/ru-RU.json +990 -0
- package/locales/sr-SP.json +990 -0
- package/locales/sv-SE.json +986 -0
- package/locales/tr-TR.json +990 -0
- package/locales/uk-UA.json +990 -0
- package/locales/vi-VN.json +986 -0
- package/locales/zh-CN.json +998 -0
- package/locales/zh-TW.json +998 -0
- package/package.json +3 -3
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +1 -1
- package/src/Banner/Banner.doc.mjs +2 -0
- package/src/Blockquote/Blockquote.doc.mjs +30 -7
- package/src/Blockquote/Blockquote.test.tsx +34 -3
- package/src/Blockquote/Blockquote.tsx +11 -9
- package/src/BottomSheet/BottomSheet.doc.mjs +36 -3
- package/src/BottomSheet/BottomSheet.test.tsx +177 -2
- package/src/BottomSheet/BottomSheet.tsx +16 -2
- package/src/BottomSheet/BottomSheetPanel.test.tsx +91 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +121 -15
- package/src/BottomSheet/index.ts +5 -1
- package/src/BottomSheet/snapOffsets.test.ts +114 -47
- package/src/BottomSheet/snapOffsets.ts +119 -33
- package/src/BottomSheet/useSheetGestures.test.ts +113 -15
- package/src/BottomSheet/useSheetGestures.ts +196 -100
- package/src/Breadcrumbs/BreadcrumbItem.tsx +1 -1
- package/src/Button/Button.tsx +7 -7
- package/src/Calendar/Calendar.doc.mjs +16 -0
- package/src/Calendar/Calendar.test.tsx +137 -0
- package/src/Calendar/Calendar.tsx +80 -11
- package/src/Calendar/getStandaloneShortWeekdayNames.test.ts +54 -0
- package/src/Calendar/getStandaloneShortWeekdayNames.ts +38 -0
- package/src/Calendar/hooks/useCalendarConstraints.ts +54 -3
- package/src/Calendar/hooks/useCalendarDays.ts +13 -10
- package/src/Calendar/hooks/useCalendarNavigation.ts +6 -4
- package/src/Calendar/standaloneShortWeekdayNames.generated.ts +50 -0
- package/src/Calendar/styles.ts +3 -3
- package/src/Center/Center.doc.mjs +48 -0
- package/src/Center/Center.test.tsx +158 -0
- package/src/Center/Center.tsx +50 -9
- package/src/Chat/ChatComposer.tsx +7 -4
- package/src/Chat/ChatToolCalls.tsx +1 -1
- package/src/Chat/{useChatDictation.test.ts → useChatDictation.test.tsx} +29 -14
- package/src/Chat/useChatDictation.ts +1 -1
- package/src/Chat/useSpeechRecognition.ts +5 -3
- package/src/CheckboxInput/CheckboxInput.tsx +6 -0
- package/src/Citation/Citation.tsx +3 -3
- package/src/ClickableCard/ClickableCard.tsx +2 -2
- package/src/CommandPalette/CommandPaletteItem.tsx +1 -1
- package/src/ComplexSelector/ComplexSelector.doc.mjs +10 -0
- package/src/ComplexSelector/ComplexSelector.tsx +8 -5
- package/src/DateInput/DateInput.test.tsx +17 -1
- package/src/DateInput/DateInput.tsx +90 -19
- package/src/DateInput/DateInputTouch.test.tsx +2393 -0
- package/src/DateInput/MonthScroller.tsx +784 -0
- package/src/DateInput/MonthYearWheels.tsx +147 -0
- package/src/DateInput/TouchDateField.tsx +1214 -0
- package/src/DateInput/Wheel.tsx +470 -0
- package/src/DateInput/monthGeometry.ts +118 -0
- package/src/DateInput/tokens.stylex.ts +99 -0
- package/src/DateInput/useOwnScrollGesture.ts +227 -0
- package/src/DateInput/usePointerDragScroll.ts +220 -0
- package/src/DateInput/useScrollSettle.ts +164 -0
- package/src/DateRangeInput/DateRangeInput.doc.mjs +16 -0
- package/src/DateRangeInput/DateRangeInput.test.tsx +81 -1
- package/src/DateRangeInput/DateRangeInput.tsx +88 -8
- package/src/DateTimeInput/DateTimeInput.tsx +23 -8
- package/src/Dialog/Dialog.test.tsx +24 -0
- package/src/Dialog/Dialog.tsx +3 -0
- package/src/Field/Field.doc.mjs +3 -0
- package/src/Field/FieldLabel.tsx +20 -4
- package/src/Field/InputClearButton.test.tsx +134 -2
- package/src/Field/InputClearButton.tsx +42 -1
- package/src/Field/inputStyles.stylex.ts +16 -12
- package/src/FileInput/FileInput.tsx +5 -4
- package/src/FormLayout/FormLayout.doc.mjs +13 -0
- package/src/FormLayout/FormLayout.test.tsx +181 -4
- package/src/FormLayout/FormLayout.tsx +33 -2
- package/src/FormLayout/FormLayoutContext.ts +22 -7
- package/src/FormLayout/index.ts +1 -1
- package/src/HoverCard/HoverCard.doc.mjs +18 -0
- package/src/HoverCard/HoverCard.test.tsx +189 -0
- package/src/HoverCard/HoverCard.tsx +22 -2
- package/src/HoverCard/index.ts +1 -0
- package/src/HoverCard/useHoverCard.doc.mjs +2 -0
- package/src/HoverCard/useHoverCard.tsx +103 -7
- package/src/Item/Item.doc.mjs +1 -0
- package/src/Item/Item.test.tsx +50 -0
- package/src/Item/Item.tsx +41 -2
- package/src/Layer/index.ts +10 -0
- package/src/Layer/useLayer.tsx +13 -2
- package/src/Layer/useTouchTrigger.test.ts +70 -0
- package/src/Layer/useTouchTrigger.ts +366 -0
- package/src/Layout/Layout.doc.mjs +18 -0
- package/src/Layout/container.stylex.ts +11 -3
- package/src/Layout/index.ts +4 -0
- package/src/Layout/overlayPaddingReset.test.tsx +222 -0
- package/src/Layout/padding.stylex.ts +192 -12
- package/src/Lightbox/Lightbox.tsx +2 -1
- package/src/Link/Link.tsx +4 -4
- package/src/Markdown/Markdown.doc.mjs +3 -0
- package/src/Markdown/Markdown.test.tsx +78 -0
- package/src/Markdown/Markdown.tsx +41 -1
- package/src/Markdown/parser.ts +60 -2
- package/src/MobileNav/MobileNav.tsx +61 -5
- package/src/MobileNav/MobileNavEntryAnimation.test.tsx +212 -0
- package/src/MobileNav/MobileNavScrollbarGutter.test.tsx +109 -0
- package/src/MultiSelector/MultiSelector.test.tsx +1 -1
- package/src/MultiSelector/MultiSelector.tsx +8 -5
- package/src/NavItem/navItemStyles.stylex.ts +2 -2
- package/src/NavMenu/NavHeadingMenuItem.tsx +1 -1
- package/src/NumberInput/NumberInput.doc.mjs +24 -0
- package/src/NumberInput/NumberInput.test.tsx +138 -0
- package/src/NumberInput/NumberInput.tsx +44 -6
- package/src/Outline/Outline.doc.mjs +2 -0
- package/src/Outline/Outline.tsx +1 -1
- package/src/Outline/parseOutlineFromMarkdown.ts +10 -40
- package/src/PowerSearch/PowerSearch.tsx +17 -8
- package/src/PowerSearch/PowerSearchToken.tsx +3 -0
- package/src/PowerSearch/formatFilterValue.test.ts +22 -2
- package/src/PowerSearch/formatFilterValue.ts +31 -6
- package/src/RadioList/RadioList.doc.mjs +1 -1
- package/src/RadioList/RadioList.test.tsx +170 -2
- package/src/RadioList/RadioList.tsx +9 -1
- package/src/RadioList/RadioListItem.tsx +83 -51
- package/src/Resizable/ResizeHandle.test.tsx +22 -0
- package/src/Resizable/ResizeHandle.tsx +9 -3
- package/src/Section/Section.doc.mjs +55 -0
- package/src/Section/Section.test.tsx +201 -4
- package/src/Section/Section.tsx +69 -0
- package/src/SegmentedControl/SegmentedControl.test.tsx +31 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +11 -2
- package/src/SelectableCard/SelectableCard.tsx +1 -1
- package/src/Selector/Selector.doc.mjs +16 -2
- package/src/Selector/Selector.test.tsx +525 -1
- package/src/Selector/Selector.tsx +166 -21
- package/src/Selector/SelectorOption.doc.mjs +7 -0
- package/src/Selector/SelectorOption.tsx +21 -0
- package/src/Selector/SelectorRowLayoutContext.ts +32 -0
- package/src/Selector/types.ts +4 -4
- package/src/SideNav/SideNavHeading.tsx +2 -2
- package/src/SideNav/SideNavItem.tsx +1 -1
- package/src/Slider/Slider.tsx +11 -1
- package/src/Stack/Stack.doc.mjs +72 -0
- package/src/Stack/Stack.test.tsx +156 -0
- package/src/Stack/Stack.tsx +50 -8
- package/src/StatusDot/StatusDot.doc.mjs +13 -0
- package/src/StatusDot/StatusDot.test.tsx +115 -8
- package/src/StatusDot/StatusDot.tsx +74 -9
- package/src/Switch/Switch.tsx +6 -0
- package/src/TabList/TabMenu.tsx +1 -1
- package/src/Table/TableRow.tsx +4 -4
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +2 -1
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +2 -1
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +22 -4
- package/src/Table/plugins/sortable/useTableSortableState.test.tsx +34 -0
- package/src/Table/plugins/sortable/useTableSortableState.tsx +26 -23
- package/src/Table/plugins/tree/useTableTreeData.tsx +2 -2
- package/src/TextArea/TextArea.doc.mjs +1 -1
- package/src/TextArea/TextArea.tsx +3 -1
- package/src/TextInput/TextInput.tsx +3 -1
- package/src/Thumbnail/Thumbnail.tsx +1 -1
- package/src/TimeInput/TimeInput.tsx +3 -1
- package/src/Timestamp/Timestamp.test.tsx +27 -7
- package/src/Timestamp/Timestamp.tsx +8 -4
- package/src/Timestamp/formatInstant.ts +9 -7
- package/src/Timestamp/tooltipEntries.test.ts +11 -6
- package/src/Timestamp/tooltipEntries.ts +6 -2
- package/src/Token/Token.tsx +1 -1
- package/src/Tooltip/Tooltip.doc.mjs +18 -0
- package/src/Tooltip/Tooltip.test.tsx +254 -1
- package/src/Tooltip/Tooltip.tsx +22 -2
- package/src/Tooltip/index.ts +1 -0
- package/src/Tooltip/useTooltip.doc.mjs +2 -0
- package/src/Tooltip/useTooltip.tsx +99 -21
- package/src/TopNav/TopNavHeading.tsx +1 -1
- package/src/TopNav/TopNavItem.tsx +2 -2
- package/src/TopNav/TopNavMegaMenu.tsx +1 -1
- package/src/TopNav/TopNavMegaMenuItem.tsx +1 -1
- package/src/TopNav/TopNavMenu.tsx +2 -2
- package/src/TreeList/TreeListItem.tsx +1 -1
- package/src/hooks/containerReveal.stylex.ts +54 -18
- package/src/hooks/scrollbarGutter.test.ts +167 -0
- package/src/hooks/scrollbarGutter.ts +121 -0
- package/src/hooks/useResolvedRequired.ts +42 -0
- package/src/hooks/useScrollLock.doc.mjs +4 -4
- package/src/hooks/useScrollLock.test.ts +73 -0
- package/src/hooks/useScrollLock.ts +14 -0
- package/src/i18n/InternationalizationContext.ts +2 -0
- package/src/i18n/__tests__/e2e-powersearch.test.tsx +37 -1
- package/src/i18n/__tests__/useCollator.test.tsx +115 -0
- package/src/i18n/__tests__/useLocale.test.tsx +52 -0
- package/src/i18n/index.ts +6 -0
- package/src/i18n/useCollator.doc.mjs +84 -0
- package/src/i18n/useCollator.ts +44 -0
- package/src/i18n/useLocale.doc.mjs +70 -0
- package/src/i18n/useLocale.ts +34 -0
- package/src/i18n/useTranslator.doc.mjs +1 -1
- package/src/theme/defineTheme.test.ts +9 -3
- package/src/theme/defineTheme.ts +5 -0
- package/src/theme/derivedVarRegistry.test.ts +19 -5
- package/src/theme/derivedVarRegistry.ts +4 -0
- package/src/theme/generateThemeRules.test.ts +118 -0
- package/src/theme/generateThemeRules.ts +83 -5
- package/src/theme/syntax/index.ts +6 -2
- package/src/theme/syntax/serverSafeSyntax.test.ts +68 -0
- package/src/utils/dateParser.test.ts +20 -0
- package/src/utils/dateParser.ts +14 -7
- package/src/utils/index.ts +2 -0
- package/src/utils/plainDate.test.ts +56 -0
- package/src/utils/plainDate.ts +33 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5-canary.0472ec1",
|
|
4
4
|
"displayName": "Astryx Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -656,6 +656,7 @@
|
|
|
656
656
|
"react-dom": ">=19.0.0"
|
|
657
657
|
},
|
|
658
658
|
"devDependencies": {
|
|
659
|
+
"@astryxdesign/cli": "0.4.5-canary.0472ec1",
|
|
659
660
|
"@babel/cli": "^8.0.4",
|
|
660
661
|
"@babel/core": "^7.29.7",
|
|
661
662
|
"@babel/preset-react": "^8.0.1",
|
|
@@ -664,8 +665,7 @@
|
|
|
664
665
|
"@testing-library/dom": "^10.0.0",
|
|
665
666
|
"@testing-library/jest-dom": "^6.6.0",
|
|
666
667
|
"@testing-library/react": "^16.3.2",
|
|
667
|
-
"rimraf": "^6.0.1"
|
|
668
|
-
"@astryxdesign/cli": "0.4.4"
|
|
668
|
+
"rimraf": "^6.0.1"
|
|
669
669
|
},
|
|
670
670
|
"dependencies": {
|
|
671
671
|
"intl-messageformat": "^11.2.9"
|
|
@@ -88,7 +88,7 @@ const styles = stylex.create({
|
|
|
88
88
|
// Interactive overlay states layered on top via backgroundImage
|
|
89
89
|
backgroundImage: {
|
|
90
90
|
default: `linear-gradient(${colorVars['--color-neutral']}, ${colorVars['--color-neutral']})`,
|
|
91
|
-
':hover': {
|
|
91
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
92
92
|
'@media (hover: hover)': `linear-gradient(${colorVars['--color-overlay-hover']}, ${colorVars['--color-overlay-hover']}), linear-gradient(${colorVars['--color-neutral']}, ${colorVars['--color-neutral']})`,
|
|
93
93
|
},
|
|
94
94
|
':active': `linear-gradient(${colorVars['--color-overlay-pressed']}, ${colorVars['--color-overlay-pressed']}), linear-gradient(${colorVars['--color-neutral']}, ${colorVars['--color-neutral']})`,
|
|
@@ -221,6 +221,8 @@ export const docsDense = {
|
|
|
221
221
|
{guidance: true, description: 'Keep titles short: "Payment failed" not "There was a problem processing your payment."'},
|
|
222
222
|
{guidance: false, description: 'Use for auto-dismissing messages; use Toast instead.'},
|
|
223
223
|
{guidance: false, description: 'Stack multiple banners of the same status; combine into one.'},
|
|
224
|
+
{guidance: true, description: 'Error/warning render role="alert", info/success role="status"; mount an alert banner on an event, not first paint, so assistive tech announces it.'},
|
|
225
|
+
{guidance: false, description: 'Rely on status color or icon alone; state the status in the title text, since the icon is decorative to a screen reader.'},
|
|
224
226
|
],
|
|
225
227
|
anatomy: [
|
|
226
228
|
{name: 'Icon', required: true, description: 'Set automatically from status.'},
|
|
@@ -19,7 +19,7 @@ export const docs = {
|
|
|
19
19
|
{
|
|
20
20
|
name: 'cite',
|
|
21
21
|
type: 'ReactNode',
|
|
22
|
-
description: 'Optional attribution for the quote. Rendered in a <
|
|
22
|
+
description: 'Optional attribution for the quote. Rendered in a <cite> element after the quoted content.',
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
name: 'xstyle',
|
|
@@ -28,17 +28,31 @@ export const docs = {
|
|
|
28
28
|
'StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value, not an inline style object like style={{}}.',
|
|
29
29
|
},
|
|
30
30
|
],
|
|
31
|
+
playground: {
|
|
32
|
+
defaults: {
|
|
33
|
+
children:
|
|
34
|
+
'Design is not just what it looks like and feels like. Design is how it works.',
|
|
35
|
+
cite: 'Steve Jobs',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
31
38
|
theming: {
|
|
32
39
|
targets: [
|
|
33
40
|
{className: 'astryx-blockquote', visualProps: []},
|
|
34
41
|
],
|
|
35
42
|
},
|
|
36
43
|
usage: {
|
|
37
|
-
description: 'A
|
|
44
|
+
description: 'A quotation block with a rule on its inline-start edge and secondary text color. Use to highlight quoted content, testimonials, or excerpts. The rule and padding are logical, so they move to the right edge in right-to-left locales.',
|
|
45
|
+
anatomy: [
|
|
46
|
+
{name: 'Rule', required: true, description: 'The border on the inline-start edge, drawn with --color-border-emphasized.'},
|
|
47
|
+
{name: 'Quotation', required: true, description: 'The quoted content, passed as children. Renders inside the <blockquote> element.'},
|
|
48
|
+
{name: 'Attribution', required: false, description: 'The source, passed as cite. Renders as a <cite> element below the quotation.'},
|
|
49
|
+
],
|
|
38
50
|
bestPractices: [
|
|
39
51
|
{ guidance: true, description: 'Use for quoted text, testimonials, or highlighted excerpts from external sources.' },
|
|
40
52
|
{ guidance: true, description: 'Provide a cite prop when the source of the quote is known.' },
|
|
53
|
+
{ guidance: true, description: 'Pass the source through cite rather than typing it into children, so it renders as a semantic <cite> element that assistive technology can distinguish from the quotation.' },
|
|
41
54
|
{ guidance: false, description: 'Use for callout boxes or informational notes; use Banner for those.' },
|
|
55
|
+
{ guidance: false, description: 'Wrap the attribution in your own <footer>. A <footer> inside a <blockquote> becomes a contentinfo document landmark, and a page with several quotes then reports several page footers.' },
|
|
42
56
|
],
|
|
43
57
|
},
|
|
44
58
|
};
|
|
@@ -57,7 +71,7 @@ export const docsZh = {
|
|
|
57
71
|
{
|
|
58
72
|
name: 'cite',
|
|
59
73
|
type: 'ReactNode',
|
|
60
|
-
description: '
|
|
74
|
+
description: '引用的可选出处。在引用内容之后以 <cite> 元素渲染。',
|
|
61
75
|
},
|
|
62
76
|
{
|
|
63
77
|
name: 'xstyle',
|
|
@@ -72,29 +86,38 @@ export const docsZh = {
|
|
|
72
86
|
],
|
|
73
87
|
},
|
|
74
88
|
usage: {
|
|
75
|
-
description: '
|
|
89
|
+
description: '带有行首边框和次要文本颜色的引用块。用于突出显示引用内容、推荐语或摘录。边框和内边距使用逻辑属性,因此在从右到左的语言环境中会移到右侧。',
|
|
90
|
+
anatomy: [
|
|
91
|
+
{name: '边框', required: true, description: '行首边缘的边框,使用 --color-border-emphasized 绘制。'},
|
|
92
|
+
{name: '引用内容', required: true, description: '通过 children 传入的引用内容,渲染在 <blockquote> 元素内。'},
|
|
93
|
+
{name: '出处', required: false, description: '通过 cite 传入的来源,在引用内容下方以 <cite> 元素渲染。'},
|
|
94
|
+
],
|
|
76
95
|
bestPractices: [
|
|
77
96
|
{ guidance: true, description: '用于引用文本、推荐语或来自外部来源的高亮摘录。' },
|
|
78
97
|
{ guidance: true, description: '当引用来源已知时,提供 cite 属性。' },
|
|
98
|
+
{ guidance: true, description: '通过 cite 传入来源,而不是写在 children 里,这样它会渲染为语义化的 <cite> 元素,辅助技术可以将其与引用内容区分开。' },
|
|
79
99
|
{ guidance: false, description: '用于提示框或信息说明,应使用 Banner。' },
|
|
100
|
+
{ guidance: false, description: '自行用 <footer> 包裹出处。<blockquote> 内的 <footer> 会成为 contentinfo 文档地标,页面上有多个引用时就会报告多个页脚。' },
|
|
80
101
|
],
|
|
81
102
|
},
|
|
82
103
|
};
|
|
83
104
|
|
|
84
105
|
/** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
|
|
85
106
|
export const docsDense = {
|
|
86
|
-
description: '
|
|
107
|
+
description: 'quotation block w/ inline-start rule, secondary text, optional citation',
|
|
87
108
|
usage: {
|
|
88
|
-
description: 'A
|
|
109
|
+
description: 'A quotation block with a rule on its inline-start edge and secondary text color. Use to highlight quoted content, testimonials, or excerpts.',
|
|
89
110
|
bestPractices: [
|
|
90
111
|
{ guidance: true, description: 'Use for quoted text, testimonials, or highlighted excerpts.' },
|
|
91
112
|
{ guidance: true, description: 'Provide cite when source is known.' },
|
|
113
|
+
{ guidance: true, description: 'Pass the source via cite, not inside children.' },
|
|
92
114
|
{ guidance: false, description: 'Use for callouts/notes; use Banner instead.' },
|
|
115
|
+
{ guidance: false, description: 'Wrap the attribution in <footer>; it becomes a contentinfo landmark.' },
|
|
93
116
|
],
|
|
94
117
|
},
|
|
95
118
|
propDescriptions: {
|
|
96
119
|
children: 'blockquote content',
|
|
97
|
-
cite: 'optional attribution rendered
|
|
120
|
+
cite: 'optional attribution rendered as <cite> after the quote',
|
|
98
121
|
xstyle: 'StyleX styles for layout; must be stylex.create() value',
|
|
99
122
|
},
|
|
100
123
|
};
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import {describe, it, expect, vi} from 'vitest';
|
|
13
13
|
import {render, screen} from '@testing-library/react';
|
|
14
|
+
import {renderToString} from 'react-dom/server';
|
|
14
15
|
import {Blockquote} from './Blockquote';
|
|
15
16
|
|
|
16
17
|
describe('Blockquote', () => {
|
|
@@ -31,7 +32,6 @@ describe('Blockquote', () => {
|
|
|
31
32
|
it('renders without cite by default', () => {
|
|
32
33
|
render(<Blockquote data-testid="bq">Quote</Blockquote>);
|
|
33
34
|
const element = screen.getByTestId('bq');
|
|
34
|
-
expect(element.querySelector('footer')).toBeNull();
|
|
35
35
|
expect(element.querySelector('cite')).toBeNull();
|
|
36
36
|
});
|
|
37
37
|
|
|
@@ -42,13 +42,34 @@ describe('Blockquote', () => {
|
|
|
42
42
|
</Blockquote>,
|
|
43
43
|
);
|
|
44
44
|
const element = screen.getByTestId('bq');
|
|
45
|
-
const footer = element.querySelector('footer');
|
|
46
|
-
expect(footer).toBeInTheDocument();
|
|
47
45
|
const cite = element.querySelector('cite');
|
|
48
46
|
expect(cite).toBeInTheDocument();
|
|
49
47
|
expect(cite).toHaveTextContent('Steve Jobs');
|
|
50
48
|
});
|
|
51
49
|
|
|
50
|
+
it('never wraps the attribution in a landmark element', () => {
|
|
51
|
+
render(
|
|
52
|
+
<Blockquote cite="Steve Jobs" data-testid="bq">
|
|
53
|
+
Quote
|
|
54
|
+
</Blockquote>,
|
|
55
|
+
);
|
|
56
|
+
const element = screen.getByTestId('bq');
|
|
57
|
+
expect(element.querySelector('footer')).toBeNull();
|
|
58
|
+
expect(screen.queryByRole('contentinfo')).toBeNull();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it.each([
|
|
62
|
+
['false', false],
|
|
63
|
+
['an empty string', ''],
|
|
64
|
+
])('renders no cite element when cite is %s', (_label, cite) => {
|
|
65
|
+
render(
|
|
66
|
+
<Blockquote cite={cite} data-testid="bq">
|
|
67
|
+
Quote
|
|
68
|
+
</Blockquote>,
|
|
69
|
+
);
|
|
70
|
+
expect(screen.getByTestId('bq').querySelector('cite')).toBeNull();
|
|
71
|
+
});
|
|
72
|
+
|
|
52
73
|
it('renders cite as ReactNode', () => {
|
|
53
74
|
render(
|
|
54
75
|
<Blockquote
|
|
@@ -87,4 +108,14 @@ describe('Blockquote', () => {
|
|
|
87
108
|
);
|
|
88
109
|
expect(screen.getByTestId('child-p')).toBeInTheDocument();
|
|
89
110
|
});
|
|
111
|
+
|
|
112
|
+
it('renders on the server', () => {
|
|
113
|
+
const html = renderToString(
|
|
114
|
+
<Blockquote cite="Steve Jobs">Design is how it works.</Blockquote>,
|
|
115
|
+
);
|
|
116
|
+
expect(html).toContain('<blockquote');
|
|
117
|
+
expect(html).toContain('astryx-blockquote');
|
|
118
|
+
expect(html).toContain('<cite');
|
|
119
|
+
expect(html).toContain('Steve Jobs');
|
|
120
|
+
});
|
|
90
121
|
});
|
|
@@ -17,7 +17,7 @@ import type {ReactNode} from 'react';
|
|
|
17
17
|
import type {BaseProps} from '../BaseProps';
|
|
18
18
|
import * as stylex from '@stylexjs/stylex';
|
|
19
19
|
import {colorVars, spacingVars, typeScaleVars} from '../theme/tokens.stylex';
|
|
20
|
-
import {mergeProps} from '../utils';
|
|
20
|
+
import {isRenderable, mergeProps} from '../utils';
|
|
21
21
|
import {themeProps} from '../utils/themeProps';
|
|
22
22
|
|
|
23
23
|
export interface BlockquoteProps extends BaseProps<HTMLQuoteElement> {
|
|
@@ -26,7 +26,8 @@ export interface BlockquoteProps extends BaseProps<HTMLQuoteElement> {
|
|
|
26
26
|
/** Content of the blockquote */
|
|
27
27
|
children: ReactNode;
|
|
28
28
|
/**
|
|
29
|
-
* Optional attribution for the quote. Rendered in a
|
|
29
|
+
* Optional attribution for the quote. Rendered in a `<cite>` element after
|
|
30
|
+
* the quoted content.
|
|
30
31
|
*/
|
|
31
32
|
cite?: ReactNode;
|
|
32
33
|
}
|
|
@@ -38,6 +39,7 @@ const styles = stylex.create({
|
|
|
38
39
|
borderInlineStartColor: colorVars['--color-border-emphasized'],
|
|
39
40
|
paddingInlineStart: spacingVars['--spacing-4'],
|
|
40
41
|
color: colorVars['--color-text-secondary'],
|
|
42
|
+
overflowWrap: 'break-word',
|
|
41
43
|
marginInlineStart: 0,
|
|
42
44
|
marginInlineEnd: 0,
|
|
43
45
|
marginBlockStart: 0,
|
|
@@ -55,8 +57,8 @@ const styles = stylex.create({
|
|
|
55
57
|
/**
|
|
56
58
|
* Blockquote component for displaying quoted content.
|
|
57
59
|
*
|
|
58
|
-
* Renders a semantic `<blockquote>` with an
|
|
59
|
-
*
|
|
60
|
+
* Renders a semantic `<blockquote>` with an inline-start rule and secondary
|
|
61
|
+
* text color, matching the Astryx visual language.
|
|
60
62
|
*
|
|
61
63
|
* @example
|
|
62
64
|
* ```
|
|
@@ -83,11 +85,11 @@ export function Blockquote({
|
|
|
83
85
|
)}
|
|
84
86
|
{...props}>
|
|
85
87
|
{children}
|
|
86
|
-
{
|
|
87
|
-
<footer>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
)}
|
|
88
|
+
{/*
|
|
89
|
+
A bare <cite>, never wrapped in <footer>: <blockquote> is a sectioning
|
|
90
|
+
root, so a <footer> inside it maps to a contentinfo document landmark.
|
|
91
|
+
*/}
|
|
92
|
+
{isRenderable(cite) && <cite {...stylex.props(styles.cite)}>{cite}</cite>}
|
|
91
93
|
</blockquote>
|
|
92
94
|
);
|
|
93
95
|
}
|
|
@@ -13,6 +13,9 @@ export const docs = {
|
|
|
13
13
|
'touch',
|
|
14
14
|
'drag',
|
|
15
15
|
'swipe',
|
|
16
|
+
'snap point',
|
|
17
|
+
'detent',
|
|
18
|
+
'resize',
|
|
16
19
|
'dismiss',
|
|
17
20
|
'grab handle',
|
|
18
21
|
'dialog',
|
|
@@ -54,7 +57,7 @@ export const docs = {
|
|
|
54
57
|
targets: [{className: 'astryx-bottom-sheet', visualProps: []}],
|
|
55
58
|
},
|
|
56
59
|
description:
|
|
57
|
-
"A mobile touch sheet that rises from the bottom edge, with animated entrance and exit, a grab handle, drag-to-resize snap points, and purpose-controlled dismissal. A standalone sheet owns a native <dialog>; inside BottomSheetSwitcher it renders a panel in the switcher's shared dialog. In both modes, ref and shared DOM props target the visual panel <div>.",
|
|
60
|
+
"A mobile touch sheet that rises from the bottom edge, with animated entrance and exit, a grab handle, optional drag-to-resize snap points, and purpose-controlled dismissal. A standalone sheet owns a native <dialog>; inside BottomSheetSwitcher it renders a panel in the switcher's shared dialog. In both modes, ref and shared DOM props target the visual panel <div>.",
|
|
58
61
|
props: [
|
|
59
62
|
{
|
|
60
63
|
name: 'isOpen',
|
|
@@ -99,9 +102,15 @@ export const docs = {
|
|
|
99
102
|
name: 'height',
|
|
100
103
|
type: "'hug' | 'capped' | 'tall' | number | string",
|
|
101
104
|
description:
|
|
102
|
-
"How tall the sheet is. Named budgets: 'hug' fits its content up to 92% of the viewport, 'capped' is a scrolling mid-height panel (~62%), and 'tall' is a pinned near-full panel (~92%) for content that streams in. Or pass a number (px) / CSS length for a custom budget.
|
|
105
|
+
"How tall the sheet is. Named budgets: 'hug' fits its content up to 92% of the viewport, 'capped' is a scrolling mid-height panel (~62%), and 'tall' is a pinned near-full panel (~92%) for content that streams in. Or pass a number (px) / CSS length for a custom budget. Give snapPoints to let the user drag between heights. On shorter viewports the sheet fills the available height. Only a fully expanded 'tall' sheet provides mobile-keyboard accommodation: it stays put and scrolls each focused control above the keyboard. Hug, Capped, numeric and CSS-length heights never do, and a Tall sheet stops doing it the moment the user drags it to a shorter detent, resuming when they drag it back. Outside that state the sheet neither moves nor adds keyboard scroll space, and the browser's own focus reveal is left in place; on iOS that reveal can shift the whole page.",
|
|
103
106
|
default: "'capped'",
|
|
104
107
|
},
|
|
108
|
+
{
|
|
109
|
+
name: 'snapPoints',
|
|
110
|
+
type: 'ReadonlyArray<number | string>',
|
|
111
|
+
description:
|
|
112
|
+
"Extra heights the sheet can rest at when dragged; its own height is always the tallest stop, and omitting this gives a sheet that only opens and closes. Each stop is the sheet's visible height: a number is a viewport fraction (0.5 is half the screen), '50%' the same in CSS, '320px' an absolute length. A stop of a quarter of the sheet or less is a peek: it slides away instead of reflowing, and thins the scrim.",
|
|
113
|
+
},
|
|
105
114
|
{
|
|
106
115
|
name: 'hasScrim',
|
|
107
116
|
type: 'boolean',
|
|
@@ -156,6 +165,30 @@ export const docs = {
|
|
|
156
165
|
label="Nearby places"
|
|
157
166
|
height="tall">
|
|
158
167
|
<PlaceList />
|
|
168
|
+
</BottomSheet>`,
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
label: 'Collapsible to half the screen',
|
|
172
|
+
code: `const [isOpen, setIsOpen] = useState(false);
|
|
173
|
+
<BottomSheet
|
|
174
|
+
isOpen={isOpen}
|
|
175
|
+
onOpenChange={setIsOpen}
|
|
176
|
+
label="Nearby places"
|
|
177
|
+
height="tall"
|
|
178
|
+
snapPoints={[0.5]}>
|
|
179
|
+
<PlaceList />
|
|
180
|
+
</BottomSheet>`,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
label: 'A peek, a working height, and full',
|
|
184
|
+
code: `const [isOpen, setIsOpen] = useState(false);
|
|
185
|
+
<BottomSheet
|
|
186
|
+
isOpen={isOpen}
|
|
187
|
+
onOpenChange={setIsOpen}
|
|
188
|
+
label="Route"
|
|
189
|
+
height="tall"
|
|
190
|
+
snapPoints={['96px', '50%']}>
|
|
191
|
+
<RouteDetails />
|
|
159
192
|
</BottomSheet>`,
|
|
160
193
|
},
|
|
161
194
|
{
|
|
@@ -236,7 +269,7 @@ export const docs = {
|
|
|
236
269
|
/** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
|
|
237
270
|
export const docsDense = {
|
|
238
271
|
description:
|
|
239
|
-
'mobile touch sheet rising from the bottom edge (native <dialog>): grab handle, transform-based drag-to-resize snap points, scrolling area resizes to the snapped visible height on release (
|
|
272
|
+
'mobile touch sheet rising from the bottom edge (native <dialog>): grab handle, opt-in transform-based drag-to-resize snap points (snapPoints: viewport fraction, percent or px length), scrolling area resizes to the snapped visible height on release (a peek stop, a quarter of the sheet or less, keeps the full height and slides instead), Dialog-aligned dismissal purpose (info/form/required), purpose-gated swipe-to-dismiss, fully-expanded Tall visual-viewport mobile-keyboard handling, named height scale, modal (default) or non-modal (hasScrim={false}) presentation',
|
|
240
273
|
usage: {
|
|
241
274
|
description:
|
|
242
275
|
'Mobile touch surface for filters, actions, forms, and detail views that should rise from the bottom of the viewport; use BottomSheetSwitcher for multi-step flows.',
|
|
@@ -15,6 +15,12 @@ import {createRef, useState} from 'react';
|
|
|
15
15
|
import {BottomSheet} from './BottomSheet';
|
|
16
16
|
import {BottomSheetSwitcher} from './BottomSheetSwitcher';
|
|
17
17
|
|
|
18
|
+
// A sheet has no stops unless its host asks for them, so the tests that
|
|
19
|
+
// exercise detents pass their own. These three — a 14% peek, a half-height
|
|
20
|
+
// stop, and a 92% stop the Tall budget already covers — are the geometry the
|
|
21
|
+
// height assertions below are written against.
|
|
22
|
+
const SNAP_POINTS: ReadonlyArray<number> = [0.14, 0.5, 0.92];
|
|
23
|
+
|
|
18
24
|
// jsdom doesn't implement <dialog> open/close or pointer capture; stub them.
|
|
19
25
|
beforeEach(() => {
|
|
20
26
|
HTMLDialogElement.prototype.showModal = vi.fn(function (
|
|
@@ -178,13 +184,20 @@ function finishSheetExit() {
|
|
|
178
184
|
fireEvent.transitionEnd(getSheet(), {propertyName: 'transform'});
|
|
179
185
|
}
|
|
180
186
|
|
|
181
|
-
function ExitHarness({
|
|
187
|
+
function ExitHarness({
|
|
188
|
+
hasScrim,
|
|
189
|
+
snapPoints,
|
|
190
|
+
}: {
|
|
191
|
+
hasScrim?: boolean;
|
|
192
|
+
snapPoints?: ReadonlyArray<number>;
|
|
193
|
+
}) {
|
|
182
194
|
const [isOpen, setIsOpen] = useState(true);
|
|
183
195
|
return (
|
|
184
196
|
<BottomSheet
|
|
185
197
|
isOpen={isOpen}
|
|
186
198
|
onOpenChange={setIsOpen}
|
|
187
199
|
label="Filters"
|
|
200
|
+
snapPoints={snapPoints}
|
|
188
201
|
hasScrim={hasScrim}>
|
|
189
202
|
<button type="button" onClick={() => setIsOpen(false)}>
|
|
190
203
|
Close sheet
|
|
@@ -616,6 +629,7 @@ describe('BottomSheet', () => {
|
|
|
616
629
|
isOpen
|
|
617
630
|
onOpenChange={() => {}}
|
|
618
631
|
label="Release notes"
|
|
632
|
+
snapPoints={SNAP_POINTS}
|
|
619
633
|
height="tall">
|
|
620
634
|
Content
|
|
621
635
|
</BottomSheet>,
|
|
@@ -667,6 +681,7 @@ describe('BottomSheet', () => {
|
|
|
667
681
|
isOpen
|
|
668
682
|
onOpenChange={() => {}}
|
|
669
683
|
label="Release notes"
|
|
684
|
+
snapPoints={SNAP_POINTS}
|
|
670
685
|
height="tall">
|
|
671
686
|
Content
|
|
672
687
|
</BottomSheet>,
|
|
@@ -720,6 +735,7 @@ describe('BottomSheet', () => {
|
|
|
720
735
|
isOpen
|
|
721
736
|
onOpenChange={() => {}}
|
|
722
737
|
label="Release notes"
|
|
738
|
+
snapPoints={SNAP_POINTS}
|
|
723
739
|
height="tall">
|
|
724
740
|
Content
|
|
725
741
|
</BottomSheet>,
|
|
@@ -797,6 +813,7 @@ describe('BottomSheet', () => {
|
|
|
797
813
|
isOpen
|
|
798
814
|
onOpenChange={() => {}}
|
|
799
815
|
label="Release notes"
|
|
816
|
+
snapPoints={SNAP_POINTS}
|
|
800
817
|
height="tall"
|
|
801
818
|
style={{transition: 'none'}}>
|
|
802
819
|
Content
|
|
@@ -830,6 +847,7 @@ describe('BottomSheet', () => {
|
|
|
830
847
|
isOpen
|
|
831
848
|
onOpenChange={() => {}}
|
|
832
849
|
label="Release notes"
|
|
850
|
+
snapPoints={SNAP_POINTS}
|
|
833
851
|
height="tall">
|
|
834
852
|
Content
|
|
835
853
|
</BottomSheet>,
|
|
@@ -890,7 +908,7 @@ describe('BottomSheet', () => {
|
|
|
890
908
|
const observers = mockResizeObserverInstances();
|
|
891
909
|
mockVisualViewport(800);
|
|
892
910
|
mockWindowHeight(800);
|
|
893
|
-
render(<ExitHarness />);
|
|
911
|
+
render(<ExitHarness snapPoints={SNAP_POINTS} />);
|
|
894
912
|
const sheet = getSheet();
|
|
895
913
|
const sheetObserver = observers.find(instance =>
|
|
896
914
|
instance.observed.has(sheet),
|
|
@@ -936,6 +954,7 @@ describe('BottomSheet', () => {
|
|
|
936
954
|
isOpen
|
|
937
955
|
onOpenChange={() => {}}
|
|
938
956
|
label="Release notes"
|
|
957
|
+
snapPoints={SNAP_POINTS}
|
|
939
958
|
height="tall">
|
|
940
959
|
Content
|
|
941
960
|
</BottomSheet>,
|
|
@@ -1000,6 +1019,7 @@ describe('BottomSheet', () => {
|
|
|
1000
1019
|
isOpen
|
|
1001
1020
|
onOpenChange={() => {}}
|
|
1002
1021
|
label="Release notes"
|
|
1022
|
+
snapPoints={SNAP_POINTS}
|
|
1003
1023
|
height="tall">
|
|
1004
1024
|
Content
|
|
1005
1025
|
</BottomSheet>,
|
|
@@ -1039,6 +1059,136 @@ describe('BottomSheet', () => {
|
|
|
1039
1059
|
});
|
|
1040
1060
|
});
|
|
1041
1061
|
|
|
1062
|
+
describe('snapPoints', () => {
|
|
1063
|
+
// A Tall sheet in an 800px window: a 784px border box, 48px of which is
|
|
1064
|
+
// the reserve below the fold, so 736px of it is visible.
|
|
1065
|
+
function renderTallSheet(
|
|
1066
|
+
snapPoints?: ReadonlyArray<number | string>,
|
|
1067
|
+
onOpenChange: (isOpen: boolean) => void = () => {},
|
|
1068
|
+
) {
|
|
1069
|
+
const observers = mockResizeObserverInstances();
|
|
1070
|
+
mockVisualViewport(800);
|
|
1071
|
+
mockWindowHeight(800);
|
|
1072
|
+
const view = render(
|
|
1073
|
+
<BottomSheet
|
|
1074
|
+
isOpen
|
|
1075
|
+
onOpenChange={onOpenChange}
|
|
1076
|
+
label="Release notes"
|
|
1077
|
+
snapPoints={snapPoints}
|
|
1078
|
+
height="tall">
|
|
1079
|
+
Content
|
|
1080
|
+
</BottomSheet>,
|
|
1081
|
+
);
|
|
1082
|
+
const sheet = getSheet();
|
|
1083
|
+
const sheetObserver = observers.find(instance =>
|
|
1084
|
+
instance.observed.has(sheet),
|
|
1085
|
+
);
|
|
1086
|
+
act(() => {
|
|
1087
|
+
sheetObserver?.callback(
|
|
1088
|
+
[resizeEntry(784, 736)],
|
|
1089
|
+
sheetObserver as unknown as ResizeObserver,
|
|
1090
|
+
);
|
|
1091
|
+
});
|
|
1092
|
+
return {sheet, view};
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
function dragHandleTo(y: number) {
|
|
1096
|
+
fireTimedPointer(getHandle(), 'pointerdown', {time: 0, y: 0});
|
|
1097
|
+
fireTimedPointer(getHandle(), 'pointermove', {time: 1000, y});
|
|
1098
|
+
fireTimedPointer(getHandle(), 'pointerup', {time: 2000, y});
|
|
1099
|
+
fireEvent.transitionEnd(getSheet(), {propertyName: 'transform'});
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
it('has no stops of its own, so a released drag springs back', () => {
|
|
1103
|
+
const onOpenChange = vi.fn();
|
|
1104
|
+
const {sheet} = renderTallSheet(undefined, onOpenChange);
|
|
1105
|
+
|
|
1106
|
+
// 200px down is well short of the dismiss threshold, and there is no
|
|
1107
|
+
// stop to catch it, so the sheet returns to fully open.
|
|
1108
|
+
dragHandleTo(200);
|
|
1109
|
+
|
|
1110
|
+
expect(sheet.style.transform).toBe('');
|
|
1111
|
+
expect(sheet.style.height).toBe('');
|
|
1112
|
+
expect(onOpenChange).not.toHaveBeenCalled();
|
|
1113
|
+
});
|
|
1114
|
+
|
|
1115
|
+
it('rests at a stop given as a fraction of the viewport', () => {
|
|
1116
|
+
const {sheet} = renderTallSheet([0.5]);
|
|
1117
|
+
|
|
1118
|
+
// Half of the 800px window is 400px of visible sheet: 736 - 400 = 336px
|
|
1119
|
+
// of travel, taken as layout height once the snap lands.
|
|
1120
|
+
dragHandleTo(336);
|
|
1121
|
+
|
|
1122
|
+
expect(sheet.style.height).toBe('448px');
|
|
1123
|
+
expect(sheet.style.transform).toBe('');
|
|
1124
|
+
});
|
|
1125
|
+
|
|
1126
|
+
it('reads a percentage as the same stop as the fraction', () => {
|
|
1127
|
+
const {sheet} = renderTallSheet(['50%']);
|
|
1128
|
+
dragHandleTo(336);
|
|
1129
|
+
expect(sheet.style.height).toBe('448px');
|
|
1130
|
+
});
|
|
1131
|
+
|
|
1132
|
+
it('rests at a stop given as an absolute px length', () => {
|
|
1133
|
+
const {sheet} = renderTallSheet(['320px']);
|
|
1134
|
+
|
|
1135
|
+
// A 320px stop sits 736 - 320 = 416px down, whatever the window does.
|
|
1136
|
+
dragHandleTo(416);
|
|
1137
|
+
|
|
1138
|
+
expect(sheet.style.height).toBe('368px');
|
|
1139
|
+
expect(sheet.style.transform).toBe('');
|
|
1140
|
+
});
|
|
1141
|
+
|
|
1142
|
+
it('re-anchors to the same stop when the points change under a resting sheet', () => {
|
|
1143
|
+
const {sheet, view} = renderTallSheet([0.5]);
|
|
1144
|
+
dragHandleTo(336);
|
|
1145
|
+
expect(sheet.style.height).toBe('448px');
|
|
1146
|
+
|
|
1147
|
+
// Without an inline height the sheet renders its natural 92dvh budget.
|
|
1148
|
+
vi.spyOn(sheet, 'getBoundingClientRect').mockImplementation(() =>
|
|
1149
|
+
rect({
|
|
1150
|
+
top: 0,
|
|
1151
|
+
bottom: sheet.style.height
|
|
1152
|
+
? Number.parseFloat(sheet.style.height)
|
|
1153
|
+
: 784,
|
|
1154
|
+
}),
|
|
1155
|
+
);
|
|
1156
|
+
|
|
1157
|
+
// The host moves its one stop from half the window to a quarter of it.
|
|
1158
|
+
// The sheet is resting on that stop, so it follows — no gesture, and
|
|
1159
|
+
// nothing to animate.
|
|
1160
|
+
view.rerender(
|
|
1161
|
+
<BottomSheet
|
|
1162
|
+
isOpen
|
|
1163
|
+
onOpenChange={() => {}}
|
|
1164
|
+
label="Release notes"
|
|
1165
|
+
snapPoints={[0.25]}
|
|
1166
|
+
height="tall">
|
|
1167
|
+
Content
|
|
1168
|
+
</BottomSheet>,
|
|
1169
|
+
);
|
|
1170
|
+
|
|
1171
|
+
// 200px of visible sheet is 736 - 200 = 536px of travel.
|
|
1172
|
+
expect(sheet.style.height).toBe('248px');
|
|
1173
|
+
expect(sheet.style.transform).toBe('');
|
|
1174
|
+
});
|
|
1175
|
+
|
|
1176
|
+
it('ignores a stop it cannot resolve, and warns which one', () => {
|
|
1177
|
+
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
1178
|
+
// 200 is the px mistake: a bare number is a fraction, never a length.
|
|
1179
|
+
const {sheet} = renderTallSheet([0.5, 200]);
|
|
1180
|
+
|
|
1181
|
+
expect(
|
|
1182
|
+
warn.mock.calls.some(args => String(args[0]).includes('200')),
|
|
1183
|
+
).toBe(true);
|
|
1184
|
+
|
|
1185
|
+
// The stop it could read still works.
|
|
1186
|
+
dragHandleTo(336);
|
|
1187
|
+
expect(sheet.style.height).toBe('448px');
|
|
1188
|
+
warn.mockRestore();
|
|
1189
|
+
});
|
|
1190
|
+
});
|
|
1191
|
+
|
|
1042
1192
|
describe('mobile keyboard', () => {
|
|
1043
1193
|
it('claims a transition between fields and delivers it with preventScroll', () => {
|
|
1044
1194
|
mockIOSWebKit();
|
|
@@ -1293,6 +1443,7 @@ describe('BottomSheet', () => {
|
|
|
1293
1443
|
isOpen
|
|
1294
1444
|
onOpenChange={() => {}}
|
|
1295
1445
|
label="Add a comment"
|
|
1446
|
+
snapPoints={SNAP_POINTS}
|
|
1296
1447
|
height="tall">
|
|
1297
1448
|
<input aria-label="Comment" />
|
|
1298
1449
|
</BottomSheet>,
|
|
@@ -2111,4 +2262,28 @@ describe('BottomSheet', () => {
|
|
|
2111
2262
|
expect(screen.getByRole('dialog')).toBeInTheDocument();
|
|
2112
2263
|
});
|
|
2113
2264
|
});
|
|
2265
|
+
|
|
2266
|
+
describe('container padding isolation', () => {
|
|
2267
|
+
it('resets container padding custom properties to 0px on the sheet panel element', () => {
|
|
2268
|
+
render(
|
|
2269
|
+
<BottomSheet isOpen onOpenChange={() => {}} label="Filters">
|
|
2270
|
+
Content
|
|
2271
|
+
</BottomSheet>,
|
|
2272
|
+
);
|
|
2273
|
+
const sheet = getSheet();
|
|
2274
|
+
const computed = window.getComputedStyle(sheet);
|
|
2275
|
+
expect(
|
|
2276
|
+
computed.getPropertyValue('--container-padding-inline-start'),
|
|
2277
|
+
).toBe('0px');
|
|
2278
|
+
expect(computed.getPropertyValue('--container-padding-inline-end')).toBe(
|
|
2279
|
+
'0px',
|
|
2280
|
+
);
|
|
2281
|
+
expect(computed.getPropertyValue('--container-padding-block-start')).toBe(
|
|
2282
|
+
'0px',
|
|
2283
|
+
);
|
|
2284
|
+
expect(computed.getPropertyValue('--container-padding-block-end')).toBe(
|
|
2285
|
+
'0px',
|
|
2286
|
+
);
|
|
2287
|
+
});
|
|
2288
|
+
});
|
|
2114
2289
|
});
|
|
@@ -49,8 +49,8 @@ import {
|
|
|
49
49
|
type BottomSheetSwitcherPhase,
|
|
50
50
|
} from './BottomSheetSwitcherContext';
|
|
51
51
|
|
|
52
|
-
export type {BottomSheetHeight} from './BottomSheetPanel';
|
|
53
|
-
import type {BottomSheetHeight} from './BottomSheetPanel';
|
|
52
|
+
export type {BottomSheetHeight, BottomSheetSnapPoint} from './BottomSheetPanel';
|
|
53
|
+
import type {BottomSheetHeight, BottomSheetSnapPoint} from './BottomSheetPanel';
|
|
54
54
|
|
|
55
55
|
const styles = stylex.create({
|
|
56
56
|
dialog: {
|
|
@@ -122,6 +122,16 @@ interface BottomSheetSharedProps extends BaseProps<HTMLDivElement> {
|
|
|
122
122
|
/** Height budget or custom CSS length. Only fully expanded Tall is keyboard-aware. @default 'capped' */
|
|
123
123
|
height?: BottomSheetHeight | number | string;
|
|
124
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Extra heights the sheet can rest at when dragged; its own height is always
|
|
127
|
+
* the tallest stop, and omitting this gives a sheet that only opens and
|
|
128
|
+
* closes. Each stop is the sheet's visible height: a number is a viewport
|
|
129
|
+
* fraction (`0.5` is half the screen), `'50%'` the same in CSS, `'320px'` an
|
|
130
|
+
* absolute length. A stop of a quarter of the sheet or less is a peek — it
|
|
131
|
+
* slides away instead of reflowing, and thins the scrim.
|
|
132
|
+
*/
|
|
133
|
+
snapPoints?: ReadonlyArray<BottomSheetSnapPoint>;
|
|
134
|
+
|
|
125
135
|
/**
|
|
126
136
|
* Configures implicit dismissal behavior, matching Dialog.
|
|
127
137
|
* - required: Blocks swipe, scrim click, and Escape
|
|
@@ -193,6 +203,7 @@ function StandaloneBottomSheet({
|
|
|
193
203
|
label,
|
|
194
204
|
children,
|
|
195
205
|
height = 'capped',
|
|
206
|
+
snapPoints,
|
|
196
207
|
hasScrim = true,
|
|
197
208
|
purpose = 'info',
|
|
198
209
|
xstyle,
|
|
@@ -333,6 +344,7 @@ function StandaloneBottomSheet({
|
|
|
333
344
|
ref={ref}
|
|
334
345
|
state={panelState}
|
|
335
346
|
height={height}
|
|
347
|
+
snapPoints={snapPoints}
|
|
336
348
|
isSwipeDismissAllowed={purpose === 'info'}
|
|
337
349
|
isPageScrollLocked={shouldPresent && hasScrim}
|
|
338
350
|
xstyle={xstyle}
|
|
@@ -358,6 +370,7 @@ function SwitcherBottomSheetItem({
|
|
|
358
370
|
label,
|
|
359
371
|
children,
|
|
360
372
|
height = 'capped',
|
|
373
|
+
snapPoints,
|
|
361
374
|
purpose = 'info',
|
|
362
375
|
xstyle,
|
|
363
376
|
...props
|
|
@@ -488,6 +501,7 @@ function SwitcherBottomSheetItem({
|
|
|
488
501
|
ref={ref}
|
|
489
502
|
state={panelState}
|
|
490
503
|
height={height}
|
|
504
|
+
snapPoints={snapPoints}
|
|
491
505
|
isSwipeDismissAllowed={purpose === 'info'}
|
|
492
506
|
isPageScrollLocked={hasScrim}
|
|
493
507
|
xstyle={xstyle}
|