@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @xds/core
|
|
2
2
|
|
|
3
|
+
# 0.4.5
|
|
4
|
+
|
|
5
|
+
#### New Features
|
|
6
|
+
|
|
7
|
+
- BottomSheet: `snapPoints` makes the drag-to-resize stops the host's choice. A stop is the sheet's visible height, written as a viewport fraction (`0.5`), a percentage (`'50%'`), or a px length (`'320px'`) — matching `height`, where a bare number is also px and a string carries its unit. Fractions and percentages re-resolve when the viewport changes, so a sheet keeps the stop the user chose across a rotation, and swapping the points under a resting sheet re-anchors it the same way. A stop of a quarter of the sheet or less is a peek: it slides away rather than reflowing into a sliver, and thins the scrim. Taller stops are working surfaces, so they lay their content out and keep the scrim full — previously the shortest stop was always a peek, which would have thinned the backdrop of a half-height sheet (#5203).
|
|
8
|
+
Behavior change, deliberate and not breaking: every sheet used to carry three built-in stops (14%, 50% and 92% of the viewport), so a drag could leave it resting somewhere the host never asked for. A sheet now opens and closes unless `snapPoints` says otherwise; pass `snapPoints={[0.14, 0.5, 0.92]}` to keep the old stops. No prop, type, or DOM output was removed or renamed, and swipe-to-dismiss, the height budgets, and mobile-keyboard accommodation are untouched.
|
|
9
|
+
- Astryx ships translations for 28 more locales. `packages/core/locales/` went from `en` and `fr-FR` to 30 files — Arabic, Catalan, Chinese (Simplified and Traditional), Czech, Danish, Dutch, Finnish, German, Greek, Hebrew, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese (Brazil and Portugal), Romanian, Russian, Serbian, Spanish, Swedish, Turkish, Ukrainian, Vietnamese and Afrikaans — covering every `@astryx.*` message the components announce or display (#5185).
|
|
10
|
+
Nothing changes unless you ask for it: `InternationalizationProvider` still defaults to English, and the catalogs are loaded through the existing `./locales/*.json` export. An app that already passes a `locale` now gets translated component strings where it previously fell back to English.
|
|
11
|
+
|
|
12
|
+
The catalogs come from Crowdin and are refreshed nightly (#5186), so a translation landing upstream reaches a release without anyone opening a PR by hand.
|
|
13
|
+
|
|
14
|
+
- DateRangeInput / Calendar: add `maxRangeSpan` and `minRangeSpan` to constrain the size of a selected range. Once a start date is picked, days outside the allowed window are disabled — e.g. `maxRangeSpan={7}` keeps the range within a 7-day window of the start (#5145).
|
|
15
|
+
- FormLayout: add `defaultOptionality` — set a form-wide default (`'optional'` or `'required'`) so only the exception carries a visible indicator. Under `'optional'` only `isRequired` fields show one; under `'required'` only `isOptional` fields do; a field that restates the default shows nothing. Under `'required'` the unmarked fields also expose `aria-required` so screen readers match what sighted users see — resolved on `aria-required` only, never the native `required` attribute. Unset keeps today's per-field behavior (#4791).
|
|
16
|
+
- Add `astryx-input-clear-button` theme target on the shared clear button wrapper. Themes can now control the clear button's height and hover independently of other ghost buttons — for example suppressing the hover fill or matching a different element size scale (#5093).
|
|
17
|
+
|
|
18
|
+
#### Fixes
|
|
19
|
+
|
|
20
|
+
- BottomSheet: a pull up from the scroll area now expands the sheet on iOS. Below the tallest detent, dragging up inside the content did nothing on a real device while the grab handle worked — the sheet took the gesture and then froze for the rest of the pull. iOS Safari raises PointerEvents for a finger under the same numeric id it puts in `Touch.identifier`, so the drag the touch path started was keyed to a live pointer: `beginDrag` captured that pointer, WebKit handed the capture straight back, and the `lostpointercapture` a millisecond later cancelled the drag. Touch-driven drags are now marked as such — they take no pointer capture, and `lostpointercapture`, `pointercancel` and `pointermove` for that same finger no longer cancel, end or double-drive them. Browsers that keep the two id spaces apart were never affected, which is why this only showed up on device (#5178).
|
|
21
|
+
- Calendar weekday headers now use compact CLDR stand-alone-short names for the selected locale, while preserving the existing `Su` / `Mo` / `Tu` English labels.
|
|
22
|
+
- Render generated id attributes on Markdown headings so Outline hash links scroll to their target. Heading slugs now come from parser helpers shared with parseOutlineFromMarkdown, and the components.heading override receives the generated id (#4765).
|
|
23
|
+
- StatusDot: pair each variant with a distinct built-in shape drawn from the system's semantic icon vocabulary — success a check, warning an exclamation, error a cross, neutral a ring, accent the plain filled dot — so status no longer relies on colour alone (WCAG 2.1 SC 1.4.1). The shapes mirror the marks `Banner`/`FieldStatus` render via `defaultIcons`, a different axis of consistency from `AvatarStatusDot`'s presence shapes (the two share only the neutral ring, intentionally). The diagonal check and cross take a slightly heavier stroke so they stay crisp and distinct at 8px. Also adds an `icon` prop for API parity with `AvatarStatusDot`: a rendered icon replaces the built-in glyph, while booleans and empty renders are ignored so `cond && <Icon />` stays safe. The built-in glyphs resolve through the icon registry under scoped `statusdot:<variant>` keys (the `richtext:*` precedent), so themes can reshape a variant's mark everywhere via `defineTheme({icons})` / `registerIcons` — including marks for augmented custom variants — while overrides of the standard 24px semantic icons deliberately do not leak into the 8px field. Themes can also target the new stable `astryx-statusdot-glyph` class and its `data-shape` attribute — a stroked inline `<svg>` painted from the dot's `currentColor` (#4373).
|
|
24
|
+
- `Table`'s row-expansion chevron now mirrors correctly under RTL. It previously rotated on expand with no RTL handling at all, so the directional glyph pointed the same way regardless of text direction, matching the pattern already used by `TreeListItem`'s chevron (#5153).
|
|
25
|
+
|
|
26
|
+
#### Contributors
|
|
27
|
+
|
|
28
|
+
Thanks to everyone who contributed to this release:
|
|
29
|
+
|
|
30
|
+
- @athz
|
|
31
|
+
- @bhamodi
|
|
32
|
+
- @cixzhang
|
|
33
|
+
- @freddymeta
|
|
34
|
+
- @HelloOjasMutreja
|
|
35
|
+
- @imdreamrunner
|
|
36
|
+
- @jiunshinn
|
|
37
|
+
- @nynexman4464
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
3
41
|
# 0.4.4
|
|
4
42
|
|
|
5
43
|
#### New Components
|
|
@@ -16,6 +54,7 @@
|
|
|
16
54
|
Three more lessons came out of building a real app on it. The page now `<link>`s the theme's webfont from Google Fonts, because the theme _names_ Figtree and never loads it, so every viewer silently got the fallback stack (#5015 again). It imports the theme OBJECT and wraps in `<Theme theme={neutralTheme} mode="system">`, so light and dark follow the OS — the `data-astryx-theme` attribute alone scopes the stylesheet but cannot switch modes. And `#root:empty` carries a "Loading…" state, because ESM-from-CDN has real latency and a blank page reads as broken. Markup is `htm`, with a comment saying it is optional and `createElement` is the dependency-free alternative.
|
|
17
55
|
|
|
18
56
|
A recipe that is only read is a recipe that is only assumed to work, so CI renders it: `.github/scripts/cdn-template-smoke-test.mjs` scaffolds the page with the real CLI and opens it in headless Chromium, failing on any console error, page error or failed request, and on a page that loads without rendering.
|
|
57
|
+
|
|
19
58
|
- DateTimeInput: expose `date-time-input-toggle-icon` (calendar glyph, with open/closed `state`) and `date-time-input-clock-icon` (leading time glyph) theme targets, so a theme can size and color the leading icons — matching the `date-input-toggle-icon` seam DateInput already offers (#5148).
|
|
20
59
|
- `defineTheme`: `color.accent` accepts a `[light, dark]` tuple (#2279)
|
|
21
60
|
`ColorScaleConfig.accent` now takes either a single hex or a `[light, dark]` tuple, matching `TokenValue`. With a tuple, `expandColorScale` derives the light half of every generated `light-dark()` pair from the light seed's palettes and the dark half from the dark seed's, so each scheme gets a consistent derived palette (muted, on-accent, neutrals) instead of the `tokens['--color-accent']` workaround that skips scale generation. Single-string configs are unchanged, token for token. Also documents the precedence between `color` and `tokens` for accent-derived values: `tokens` entries win token by token, the `var(--color-accent)` reference tokens follow a `--color-accent` override at runtime, and the baked `--color-on-accent` stays derived from the `color.accent` seed.
|
|
@@ -43,6 +82,7 @@
|
|
|
43
82
|
Nobody has a migration to make, because there was no working configuration to migrate from. The bundle binds Astryx to `window.React` and `window.ReactDOM`, and React 19 does not ship a build that defines them: "UMD builds removed: To load React 19 with a script tag, we recommend using an ESM-based CDN such as esm.sh." `https://unpkg.com/react@19.2.0/umd/react.production.min.js` is a 404 where 18.3.1 is a 200. Our `peerDependencies` are `react >= 19.0.0`, so every supported React is one without a global for the bundle to bind to — it documented a path that never had an entrance.
|
|
44
83
|
|
|
45
84
|
If you were loading it with an older React anyway, load the same components as modules instead: an import map for `react`, `react/jsx-runtime`, `react-dom`, `react-dom/client` and `@astryxdesign/core` (pinned, with `?external=react,react-dom`), then one `<script type="module">`. `astryx template --cdn` writes that page for you, pinned to your installed version and annotated; the recipe is also in the core README under "No build step (CDN)".
|
|
85
|
+
|
|
46
86
|
- `isImeKeyEvent` — the guard that stops an IME composition keystroke being read as a command — now lives at `@astryxdesign/core/utils` alongside the other pure helpers, with the reasoning for its two signals written down in one place. It stays exported from `@astryxdesign/core/hooks` for this release but is deprecated there: it is a plain predicate, not a hook, and that barrel is a `'use client'` boundary, so importing it from `hooks` pulls a server-safe function onto a client path. Move imports to `@astryxdesign/core/utils`; the `hooks` re-export will be removed in an upcoming major (#4907).
|
|
47
87
|
|
|
48
88
|
#### Contributors
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
import { type ReactNode } from 'react';
|
|
23
23
|
import type { BaseProps } from '../BaseProps';
|
|
24
24
|
import type { DialogPurpose } from '../Dialog';
|
|
25
|
-
export type { BottomSheetHeight } from './BottomSheetPanel';
|
|
26
|
-
import type { BottomSheetHeight } from './BottomSheetPanel';
|
|
25
|
+
export type { BottomSheetHeight, BottomSheetSnapPoint } from './BottomSheetPanel';
|
|
26
|
+
import type { BottomSheetHeight, BottomSheetSnapPoint } from './BottomSheetPanel';
|
|
27
27
|
interface BottomSheetSharedProps extends BaseProps<HTMLDivElement> {
|
|
28
28
|
/** Ref forwarded to the visual sheet panel <div>. */
|
|
29
29
|
ref?: React.Ref<HTMLDivElement>;
|
|
@@ -33,6 +33,15 @@ interface BottomSheetSharedProps extends BaseProps<HTMLDivElement> {
|
|
|
33
33
|
children: ReactNode;
|
|
34
34
|
/** Height budget or custom CSS length. Only fully expanded Tall is keyboard-aware. @default 'capped' */
|
|
35
35
|
height?: BottomSheetHeight | number | string;
|
|
36
|
+
/**
|
|
37
|
+
* Extra heights the sheet can rest at when dragged; its own height is always
|
|
38
|
+
* the tallest stop, and omitting this gives a sheet that only opens and
|
|
39
|
+
* closes. Each stop is the sheet's visible height: a number is a viewport
|
|
40
|
+
* fraction (`0.5` is half the screen), `'50%'` the same in CSS, `'320px'` an
|
|
41
|
+
* absolute length. A stop of a quarter of the sheet or less is a peek — it
|
|
42
|
+
* slides away instead of reflowing, and thins the scrim.
|
|
43
|
+
*/
|
|
44
|
+
snapPoints?: ReadonlyArray<BottomSheetSnapPoint>;
|
|
36
45
|
/**
|
|
37
46
|
* Configures implicit dismissal behavior, matching Dialog.
|
|
38
47
|
* - required: Blocks swipe, scrim click, and Escape
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAc7C,YAAY,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAc7C,YAAY,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AA2DhF,UAAU,sBAAuB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,qDAAqD;IACrD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IAEd,0EAA0E;IAC1E,QAAQ,EAAE,SAAS,CAAC;IAEpB,wGAAwG;IACxG,MAAM,CAAC,EAAE,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;IAE7C;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAEjD;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,UAAU,0BAA2B,SAAQ,sBAAsB;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED,UAAU,wBAAyB,SAAQ,sBAAsB;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,GAC1B,0BAA0B,GAAG,wBAAwB,CAAC;AA4WxD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BA6BlD;yBA7Be,WAAW"}
|
|
@@ -89,6 +89,7 @@ function StandaloneBottomSheet({
|
|
|
89
89
|
label,
|
|
90
90
|
children,
|
|
91
91
|
height = 'capped',
|
|
92
|
+
snapPoints,
|
|
92
93
|
hasScrim = true,
|
|
93
94
|
purpose = 'info',
|
|
94
95
|
xstyle,
|
|
@@ -224,6 +225,7 @@ function StandaloneBottomSheet({
|
|
|
224
225
|
ref: ref,
|
|
225
226
|
state: panelState,
|
|
226
227
|
height: height,
|
|
228
|
+
snapPoints: snapPoints,
|
|
227
229
|
isSwipeDismissAllowed: purpose === 'info',
|
|
228
230
|
isPageScrollLocked: shouldPresent && hasScrim,
|
|
229
231
|
xstyle: xstyle,
|
|
@@ -243,6 +245,7 @@ function SwitcherBottomSheetItem({
|
|
|
243
245
|
label,
|
|
244
246
|
children,
|
|
245
247
|
height = 'capped',
|
|
248
|
+
snapPoints,
|
|
246
249
|
purpose = 'info',
|
|
247
250
|
xstyle,
|
|
248
251
|
...props
|
|
@@ -353,6 +356,7 @@ function SwitcherBottomSheetItem({
|
|
|
353
356
|
ref: ref,
|
|
354
357
|
state: panelState,
|
|
355
358
|
height: height,
|
|
359
|
+
snapPoints: snapPoints,
|
|
356
360
|
isSwipeDismissAllowed: purpose === 'info',
|
|
357
361
|
isPageScrollLocked: hasScrim,
|
|
358
362
|
xstyle: xstyle,
|
|
@@ -12,17 +12,20 @@
|
|
|
12
12
|
* SYNC: When modified, update these files to stay in sync:
|
|
13
13
|
* - /packages/core/src/BottomSheet/BottomSheet.tsx
|
|
14
14
|
* - /packages/core/src/BottomSheet/BottomSheetPanel.test.tsx
|
|
15
|
+
* - /packages/core/src/BottomSheet/snapOffsets.ts
|
|
15
16
|
* - /packages/core/src/BottomSheet/useMobileKeyboard.ts
|
|
16
17
|
* - /packages/core/src/BottomSheet/useSheetGestures.ts
|
|
17
18
|
*/
|
|
18
19
|
import { type ReactNode } from 'react';
|
|
19
20
|
import type { BaseProps } from '../BaseProps';
|
|
21
|
+
import { type BottomSheetSnapPoint } from './snapOffsets';
|
|
20
22
|
declare const HEIGHT_BUDGETS: {
|
|
21
23
|
readonly hug: "92dvh";
|
|
22
24
|
readonly capped: "62dvh";
|
|
23
25
|
readonly tall: "92dvh";
|
|
24
26
|
};
|
|
25
27
|
export type BottomSheetHeight = keyof typeof HEIGHT_BUDGETS;
|
|
28
|
+
export type { BottomSheetSnapPoint };
|
|
26
29
|
export type BottomSheetPanelMotion = 'entering' | 'aligning' | 'fading' | 'exiting';
|
|
27
30
|
export type BottomSheetPanelState = {
|
|
28
31
|
kind: 'hidden';
|
|
@@ -42,6 +45,7 @@ interface BottomSheetPanelProps extends BaseProps<HTMLDivElement> {
|
|
|
42
45
|
state: BottomSheetPanelState;
|
|
43
46
|
height: BottomSheetHeight | number | string;
|
|
44
47
|
children: ReactNode;
|
|
48
|
+
snapPoints?: ReadonlyArray<BottomSheetSnapPoint>;
|
|
45
49
|
isSwipeDismissAllowed?: boolean;
|
|
46
50
|
/** Whether the host has locked page scrolling (a modal, scrim-backed sheet). */
|
|
47
51
|
isPageScrollLocked?: boolean;
|
|
@@ -52,9 +56,8 @@ interface BottomSheetPanelProps extends BaseProps<HTMLDivElement> {
|
|
|
52
56
|
onMotionComplete?: (motion: BottomSheetPanelMotion) => void;
|
|
53
57
|
}
|
|
54
58
|
/** Internal visual and gesture surface shared by every BottomSheet host. */
|
|
55
|
-
export declare function BottomSheetPanel({ ref, state, height, children, className, style, tabIndex, xstyle, isSwipeDismissAllowed, isPageScrollLocked, onDismiss, onScrimOpacity, onElementChange, onMotionStart, onMotionComplete, ...props }: BottomSheetPanelProps): import("react").JSX.Element;
|
|
59
|
+
export declare function BottomSheetPanel({ ref, state, height, children, snapPoints, className, style, tabIndex, xstyle, isSwipeDismissAllowed, isPageScrollLocked, onDismiss, onScrimOpacity, onElementChange, onMotionStart, onMotionComplete, ...props }: BottomSheetPanelProps): import("react").JSX.Element;
|
|
56
60
|
export declare namespace BottomSheetPanel {
|
|
57
61
|
var displayName: string;
|
|
58
62
|
}
|
|
59
|
-
export {};
|
|
60
63
|
//# sourceMappingURL=BottomSheetPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAa5C,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAIvB,QAAA,MAAM,cAAc;;;;CAIV,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,cAAc,CAAC;AAC5D,YAAY,EAAC,oBAAoB,EAAC,CAAC;AA4InC,MAAM,MAAM,sBAAsB,GAChC,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEjD,MAAM,MAAM,qBAAqB,GAC7B;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAC,GAChB;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAC,GACjC;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC1C,eAAe,EAAE,MAAM,CAAC;CACzB,GACD;IAAC,IAAI,EAAE,SAAS,CAAA;CAAC,CAAC;AAEtB,UAAU,qBAAsB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC/D,+CAA+C;IAC/C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,MAAM,EAAE,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;IAC5C,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IACjD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3D,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzD,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;CAC7D;AA+GD,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,KAAK,EACL,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,qBAA4B,EAC5B,kBAA0B,EAC1B,SAAS,EACT,cAAc,EACd,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,qBAAqB,+BAyQvB;yBA3Re,gBAAgB"}
|
|
@@ -16,18 +16,21 @@
|
|
|
16
16
|
* SYNC: When modified, update these files to stay in sync:
|
|
17
17
|
* - /packages/core/src/BottomSheet/BottomSheet.tsx
|
|
18
18
|
* - /packages/core/src/BottomSheet/BottomSheetPanel.test.tsx
|
|
19
|
+
* - /packages/core/src/BottomSheet/snapOffsets.ts
|
|
19
20
|
* - /packages/core/src/BottomSheet/useMobileKeyboard.ts
|
|
20
21
|
* - /packages/core/src/BottomSheet/useSheetGestures.ts
|
|
21
22
|
*/
|
|
22
|
-
import { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useRef } from 'react';
|
|
23
|
+
import { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef } from 'react';
|
|
23
24
|
import * as stylex from '@stylexjs/stylex';
|
|
25
|
+
import { useDevWarning } from "../hooks/index.js";
|
|
24
26
|
import "../theme/tokens.stylex.js";
|
|
25
27
|
import { colorVars, durationVars, easeVars, radiusVars, shadowVars, sizeVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
26
28
|
import { mergeProps, themeProps } from "../utils/index.js";
|
|
29
|
+
import { overlayPaddingReset } from "../Layout/padding.stylex.js";
|
|
30
|
+
import { isValidSnapPoint, resolveSnapPoints } from "./snapOffsets.js";
|
|
27
31
|
import { useMobileKeyboard } from "./useMobileKeyboard.js";
|
|
28
32
|
import { useSheetGestures } from "./useSheetGestures.js";
|
|
29
33
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
-
const SNAP_FRACTIONS = [0.14, 0.5, 0.92];
|
|
31
34
|
const HEIGHT_BUDGETS = {
|
|
32
35
|
hug: '92dvh',
|
|
33
36
|
capped: '62dvh',
|
|
@@ -37,22 +40,42 @@ const HEIGHT_BUDGETS = {
|
|
|
37
40
|
const OVERSCROLL_PADDING = 48;
|
|
38
41
|
const MOBILE_KEYBOARD_BOTTOM_CLEARANCE = 48;
|
|
39
42
|
const TRANSITION_BACKSTOP_BUFFER_MS = 50;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
// The floating handle bar's height. The bar is out of flow, so this is not
|
|
44
|
+
// layout space the content pays for -- the pill (4px, centered) lands 10-14px
|
|
45
|
+
// from the sheet's top edge, inside the space a content wrapper's own top
|
|
46
|
+
// padding already provides.
|
|
47
|
+
const HANDLE_BAR_HEIGHT = spacingVars['--spacing-6'];
|
|
48
|
+
|
|
49
|
+
// Measure the same viewport the height budgets are written against. Those are
|
|
50
|
+
// `dvh`, which the virtual keyboard does not shrink, so reading
|
|
51
|
+
// `visualViewport` here would make the two disagree by exactly the keyboard's
|
|
52
|
+
// height: every detent would move while the sheet it measures did not. A
|
|
53
|
+
// keyboard is `useMobileKeyboard`'s business — it holds the sheet still and
|
|
54
|
+
// scrolls the body — and it does not redefine the sheet's detents.
|
|
55
|
+
function layoutViewportHeight() {
|
|
56
|
+
return typeof window === 'undefined' ? 0 : window.innerHeight;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A stable identity for a set of snap points. Type-tagged, so the fraction
|
|
61
|
+
* `0.5` and the (invalid) string `'0.5'` cannot collide on one key.
|
|
62
|
+
*
|
|
63
|
+
* Recomputed every render — the panel re-renders on every frame of a drag — so
|
|
64
|
+
* it stays a single pass over a handful of values, and everything derived from
|
|
65
|
+
* the points hangs off it instead of being rebuilt per frame.
|
|
66
|
+
*/
|
|
67
|
+
function snapPointsKeyFor(points) {
|
|
68
|
+
let key = '';
|
|
69
|
+
for (const point of points ?? []) {
|
|
70
|
+
key += `${typeof point}:${point}|`;
|
|
43
71
|
}
|
|
44
|
-
|
|
45
|
-
// are `dvh`, which the virtual keyboard does not shrink, so reading
|
|
46
|
-
// `visualViewport` here made the two disagree by exactly the keyboard's
|
|
47
|
-
// height: every detent moved while the sheet it was measuring did not. A
|
|
48
|
-
// keyboard is `useMobileKeyboard`'s business — it holds the sheet still and
|
|
49
|
-
// scrolls the body — and it does not redefine the sheet's detents.
|
|
50
|
-
return SNAP_FRACTIONS.map(fraction => fraction * window.innerHeight);
|
|
72
|
+
return key;
|
|
51
73
|
}
|
|
52
74
|
const styles = {
|
|
53
75
|
sheet: {
|
|
54
76
|
kfzvcC: "x67bb7w",
|
|
55
77
|
kB7OPa: "x9f619",
|
|
78
|
+
kVAEAm: "x1n2onr6",
|
|
56
79
|
k1xSpc: "x78zum5",
|
|
57
80
|
kXwgrk: "xdt5ytf",
|
|
58
81
|
kAzted: "x2lwn1j",
|
|
@@ -190,6 +213,7 @@ export function BottomSheetPanel({
|
|
|
190
213
|
state,
|
|
191
214
|
height,
|
|
192
215
|
children,
|
|
216
|
+
snapPoints,
|
|
193
217
|
className,
|
|
194
218
|
style,
|
|
195
219
|
tabIndex,
|
|
@@ -230,6 +254,32 @@ export function BottomSheetPanel({
|
|
|
230
254
|
const isClosing = state.kind === 'exiting';
|
|
231
255
|
const isFading = isRetained && state.motion === 'fading';
|
|
232
256
|
const alignmentOffset = isRetained ? state.alignmentOffset : 0;
|
|
257
|
+
|
|
258
|
+
// Everything derived from the snap points keys off their identity, not the
|
|
259
|
+
// array's: the resolver's identity is the hook's signal that the stops
|
|
260
|
+
// changed, so it must not churn on a re-render the drag caused. The memo
|
|
261
|
+
// reads the points through a ref, so the resolver resolves them at call time
|
|
262
|
+
// — against whatever the viewport is then, not what it was at memo time.
|
|
263
|
+
const snapPointsKey = snapPointsKeyFor(snapPoints);
|
|
264
|
+
const snapPointsRef = useRef(snapPoints);
|
|
265
|
+
snapPointsRef.current = snapPoints;
|
|
266
|
+
const {
|
|
267
|
+
snapHeights,
|
|
268
|
+
ignoredSnapPointsMessage
|
|
269
|
+
} = useMemo(() => {
|
|
270
|
+
if (snapPointsKey === '') {
|
|
271
|
+
return {
|
|
272
|
+
snapHeights: undefined,
|
|
273
|
+
ignoredSnapPointsMessage: ''
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
const ignored = (snapPointsRef.current ?? []).filter(point => !isValidSnapPoint(point));
|
|
277
|
+
return {
|
|
278
|
+
snapHeights: () => resolveSnapPoints(snapPointsRef.current ?? [], layoutViewportHeight()),
|
|
279
|
+
ignoredSnapPointsMessage: ignored.length === 0 ? '' : `snapPoints ignored ${JSON.stringify(ignored)}. A snap point is a viewport fraction above 0 and up to 1 (0.5 is half the screen), a px length ('320px'), or a percentage ('50%').`
|
|
280
|
+
};
|
|
281
|
+
}, [snapPointsKey]);
|
|
282
|
+
useDevWarning('BottomSheet', ignoredSnapPointsMessage, ignoredSnapPointsMessage !== '');
|
|
233
283
|
const {
|
|
234
284
|
contentProps,
|
|
235
285
|
handleProps,
|
|
@@ -249,7 +299,7 @@ export function BottomSheetPanel({
|
|
|
249
299
|
canDismiss: isSwipeDismissAllowed,
|
|
250
300
|
offscreenBlockEndInset: OVERSCROLL_PADDING,
|
|
251
301
|
onDismiss,
|
|
252
|
-
snapHeights
|
|
302
|
+
snapHeights,
|
|
253
303
|
onScrimOpacity
|
|
254
304
|
});
|
|
255
305
|
const setElement = useCallback(element => {
|
|
@@ -356,7 +406,7 @@ export function BottomSheetPanel({
|
|
|
356
406
|
...props,
|
|
357
407
|
ref: setElement,
|
|
358
408
|
tabIndex: tabIndex ?? -1,
|
|
359
|
-
...mergeProps(themeProps('bottom-sheet'), stylex.props(styles.sheet, height === 'hug' ? styles.hugHeight : styles.budget, isClosing && styles.sheetClosing, isFading && styles.sheetFading, isInactive && styles.sheetInactive, xstyle), className, {
|
|
409
|
+
...mergeProps(themeProps('bottom-sheet'), stylex.props(styles.sheet, overlayPaddingReset.reset, height === 'hug' ? styles.hugHeight : styles.budget, isClosing && styles.sheetClosing, isFading && styles.sheetFading, isInactive && styles.sheetInactive, xstyle), className, {
|
|
360
410
|
['--_sheet-budget']: budget,
|
|
361
411
|
...(isInteractive ? gestureStyle : isRetained ? {
|
|
362
412
|
transform: retainedTransform,
|
|
@@ -368,7 +418,7 @@ export function BottomSheetPanel({
|
|
|
368
418
|
}),
|
|
369
419
|
children: [/*#__PURE__*/_jsx("div", {
|
|
370
420
|
...{
|
|
371
|
-
className: "
|
|
421
|
+
className: "x10l6tqk x13vifvy x1o0tod xtijo5x x1vjfegm x78zum5 x6s0dn4 xl56j7k xvpftlf xafqdz2 x5ve5x3 x1jm3nie"
|
|
372
422
|
},
|
|
373
423
|
...handleProps,
|
|
374
424
|
"aria-hidden": "true",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @position Component entry point; re-exported by /packages/core/src/index.ts
|
|
6
6
|
*/
|
|
7
7
|
export { BottomSheet } from './BottomSheet';
|
|
8
|
-
export type { BottomSheetHeight, BottomSheetProps } from './BottomSheet';
|
|
8
|
+
export type { BottomSheetHeight, BottomSheetProps, BottomSheetSnapPoint, } from './BottomSheet';
|
|
9
9
|
export { BottomSheetSwitcher } from './BottomSheetSwitcher';
|
|
10
10
|
export type { BottomSheetSwitcherProps } from './BottomSheetSwitcher';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/index.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/index.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAC,wBAAwB,EAAC,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file snapOffsets.ts
|
|
3
3
|
* @input Pure geometry helpers — no React, no DOM.
|
|
4
|
-
* @output
|
|
5
|
-
* @position Internal to BottomSheet; consumed by useSheetGestures
|
|
6
|
-
* snapOffsets.test.ts.
|
|
4
|
+
* @output Resolves snap points and converts them to translateY offsets.
|
|
5
|
+
* @position Internal to BottomSheet; consumed by useSheetGestures and
|
|
6
|
+
* BottomSheetPanel, tested by snapOffsets.test.ts.
|
|
7
7
|
*
|
|
8
8
|
* A detent is represented as an offset in px from the fully-open position
|
|
9
9
|
* (0 = fully open, larger = more collapsed). The panel may render that offset
|
|
@@ -11,6 +11,20 @@
|
|
|
11
11
|
* helpers turn snap points into the shared offset list; they are pure so the
|
|
12
12
|
* geometry can be unit-tested without a DOM.
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* A height the sheet can rest at, expressed as the sheet's VISIBLE height:
|
|
16
|
+
*
|
|
17
|
+
* - a number in `(0, 1]` — a fraction of the viewport (`0.5` is half the
|
|
18
|
+
* screen), so the stop tracks rotation and window resizes;
|
|
19
|
+
* - a `'<n>%'` string — the same thing spelled in CSS;
|
|
20
|
+
* - a `'<n>px'` string — an absolute height that does not scale.
|
|
21
|
+
*
|
|
22
|
+
* Anything else — a unitless string, `calc()`, `vh`, `rem`, a number outside
|
|
23
|
+
* `(0, 1]` — is ignored with a dev warning. Percentages resolve against the
|
|
24
|
+
* layout viewport (`window.innerHeight`), the same box the height budgets are
|
|
25
|
+
* written against, so the mobile keyboard never moves a stop.
|
|
26
|
+
*/
|
|
27
|
+
export type BottomSheetSnapPoint = number | string;
|
|
14
28
|
/**
|
|
15
29
|
* Detents whose resting offsets land within this many px of each other are
|
|
16
30
|
* treated as the same stop (the taller one wins). Stops the sheet from having
|
|
@@ -18,8 +32,24 @@
|
|
|
18
32
|
* a hair away from a fractional snap point.
|
|
19
33
|
*/
|
|
20
34
|
export declare const DETENT_DEDUP_PX = 48;
|
|
21
|
-
/**
|
|
22
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Largest share of the fully open sheet the shortest stop may fill and still
|
|
37
|
+
* be a peek. Above it the stop is a working surface — it lays its content out
|
|
38
|
+
* and keeps a full scrim — so a two-stop sheet like `[0.5]` behaves like the
|
|
39
|
+
* half-height panel it asks for rather than like a glance.
|
|
40
|
+
*/
|
|
41
|
+
export declare const PEEK_MAX_HEIGHT_RATIO = 0.25;
|
|
42
|
+
/**
|
|
43
|
+
* Whether a snap point can be resolved at all. The viewport only scales the
|
|
44
|
+
* result, so validity is independent of it.
|
|
45
|
+
*/
|
|
46
|
+
export declare function isValidSnapPoint(point: BottomSheetSnapPoint): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Resolve snap points to candidate visible heights in px, dropping the ones
|
|
49
|
+
* this sheet cannot honor. Callers warn about those separately — this stays
|
|
50
|
+
* silent because it runs on every drag frame.
|
|
51
|
+
*/
|
|
52
|
+
export declare function resolveSnapPoints(points: ReadonlyArray<BottomSheetSnapPoint>, viewportPx: number): number[];
|
|
23
53
|
/**
|
|
24
54
|
* Given the sheet's full height (px, as rendered fully open) and a set of
|
|
25
55
|
* candidate detent *visible heights* (px), return the resting offsets from
|
|
@@ -42,26 +72,33 @@ export declare function nearestOffset(value: number, offsets: ReadonlyArray<numb
|
|
|
42
72
|
*/
|
|
43
73
|
export declare const MIN_PEEK_SCRIM_OPACITY = 0.3;
|
|
44
74
|
/**
|
|
45
|
-
*
|
|
46
|
-
* glance rather than a working surface. A sheet with no collapsed stop at all
|
|
47
|
-
* has no peek — the same rule `scrimOpacityForOffset` thins the scrim by.
|
|
75
|
+
* The peek detent's offset, or `null` when this sheet has no peek.
|
|
48
76
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
77
|
+
* A peek is the shortest stop AND a sliver — at most `PEEK_MAX_HEIGHT_RATIO`
|
|
78
|
+
* of the fully open sheet. It is the one detent the sheet does NOT express as
|
|
79
|
+
* layout height: at a sliver there is nothing useful to lay out, and reflowing
|
|
80
|
+
* the content into it (then back out on the way up) is churn the user sees, so
|
|
81
|
+
* it keeps the full layout height and slides below the viewport instead. It is
|
|
82
|
+
* also the only stop that thins the scrim.
|
|
83
|
+
*
|
|
84
|
+
* A sheet whose shortest stop is a working height — `[0.5]`, say — has no
|
|
85
|
+
* peek: half a screen of content deserves to be laid out at half a screen, and
|
|
86
|
+
* a scrim that thinned there would read as a dismissed sheet.
|
|
53
87
|
*/
|
|
54
|
-
export declare function
|
|
88
|
+
export declare function peekOffsetFor(offsets: ReadonlyArray<number>, visibleSheetHeight: number): number | null;
|
|
55
89
|
/**
|
|
56
90
|
* Scrim opacity (1 = fully visible) for a drag/settle `offset`.
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
91
|
+
*
|
|
92
|
+
* The scrim is full down to the shortest stop that is still a working surface,
|
|
93
|
+
* and only thins past it — onto a peek, where it holds at
|
|
94
|
+
* `MIN_PEEK_SCRIM_OPACITY` (a glance state, and the sheet is still modal), or
|
|
95
|
+
* out through the dismiss overshoot toward `dismissOffset`, where it clears
|
|
96
|
+
* completely because the sheet is leaving.
|
|
97
|
+
*
|
|
98
|
+
* So a sheet whose stops are all working heights keeps a full scrim at every
|
|
99
|
+
* one of them; only the sliver of a peek, or a sheet on its way out, dims less.
|
|
63
100
|
*/
|
|
64
|
-
export declare function scrimOpacityForOffset(offset: number, offsets: ReadonlyArray<number>, dismissOffset: number): number;
|
|
101
|
+
export declare function scrimOpacityForOffset(offset: number, offsets: ReadonlyArray<number>, dismissOffset: number, peekOffset: number | null): number;
|
|
65
102
|
/**
|
|
66
103
|
* Settle target for a released drag. Restricts candidates to the drag
|
|
67
104
|
* direction so a committed drag never snaps *back past* where it started
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapOffsets.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/snapOffsets.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,
|
|
1
|
+
{"version":3,"file":"snapOffsets.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/snapOffsets.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAkC1C;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAErE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,CAAC,oBAAoB,CAAC,EAC3C,UAAU,EAAE,MAAM,GACjB,MAAM,EAAE,CASV;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,EACpC,OAAO,GAAE,MAAwB,GAChC,MAAM,EAAE,CAcV;AAED,yEAAyE;AACzE,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,GAC7B,MAAM,CAKR;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,EAC9B,kBAAkB,EAAE,MAAM,GACzB,MAAM,GAAG,IAAI,CASf;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,EAC9B,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,GAAG,IAAI,GACxB,MAAM,CAgBR;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,EAC9B,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,GACjB,MAAM,CAcR"}
|