@astryxdesign/core 0.7.1 → 0.7.2-canary.151434a
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/dist/AspectRatio/AspectRatio.d.ts +6 -8
- package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
- package/dist/AspectRatio/AspectRatio.js +44 -3
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +38 -14
- package/dist/CheckboxInput/CheckboxInput.d.ts +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +3 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts +9 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +4 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +20 -8
- package/dist/Drawer/Drawer.d.ts +191 -0
- package/dist/Drawer/Drawer.d.ts.map +1 -0
- package/dist/Drawer/Drawer.js +382 -0
- package/dist/Drawer/DrawerHeader.d.ts +85 -0
- package/dist/Drawer/DrawerHeader.d.ts.map +1 -0
- package/dist/Drawer/DrawerHeader.js +134 -0
- package/dist/Drawer/index.d.ts +11 -0
- package/dist/Drawer/index.d.ts.map +1 -0
- package/dist/Drawer/index.js +11 -0
- package/dist/Drawer/useDrawerDialogPresence.d.ts +42 -0
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -0
- package/dist/Drawer/useDrawerDialogPresence.js +236 -0
- package/dist/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/DropdownMenu/DropdownMenuDivider.d.ts +5 -3
- package/dist/DropdownMenu/DropdownMenuDivider.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuDivider.js +7 -3
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +4 -4
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +4 -10
- package/dist/Field/Field.d.ts +1 -1
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +8 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +10 -2
- package/dist/Item/Item.d.ts +6 -2
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +19 -4
- package/dist/Layer/layerViewportInset.stylex.d.ts +6 -2
- package/dist/Layer/layerViewportInset.stylex.d.ts.map +1 -1
- package/dist/Layer/layerViewportInset.stylex.js +6 -2
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +13 -7
- package/dist/Layer/useLayerDismissal.d.ts +1 -1
- package/dist/Layer/useLayerDismissal.js +1 -1
- package/dist/Layout/container.stylex.d.ts +5 -5
- package/dist/Layout/container.stylex.js +4 -4
- package/dist/List/List.d.ts +46 -19
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +28 -10
- package/dist/List/ListContext.d.ts +8 -3
- package/dist/List/ListContext.d.ts.map +1 -1
- package/dist/List/ListContext.js +7 -2
- package/dist/List/ListItem.d.ts +13 -5
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +21 -8
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.d.ts.map +1 -1
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +8 -1
- package/dist/Markdown/plugins/frontmatter.d.ts.map +1 -1
- package/dist/Markdown/plugins/frontmatter.js +7 -3
- package/dist/MetadataList/MetadataList.d.ts.map +1 -1
- package/dist/MetadataList/MetadataList.js +5 -1
- package/dist/MetadataList/MetadataListContext.d.ts +1 -1
- package/dist/MetadataList/MetadataListContext.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +22 -8
- package/dist/MultiSelector/OptionActions.a11y.chromium.spec.js +100 -2
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +3 -1
- package/dist/Pagination/Pagination.d.ts +8 -5
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +21 -8
- package/dist/Popover/Popover.js +2 -2
- package/dist/PowerSearch/PowerSearch.js +1 -1
- package/dist/RadioList/RadioListItem.d.ts +9 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +2 -0
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +6 -2
- package/dist/Switch/Switch.d.ts +1 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +13 -1
- package/dist/TabList/TabMenu.d.ts +2 -2
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +6 -3
- package/dist/Text/useTruncation.d.ts +7 -5
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +16 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +11 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +26 -0
- package/dist/astryx.css +35 -12
- package/dist/hooks/useEntryAnimation.d.ts +2 -1
- package/dist/hooks/useEntryAnimation.d.ts.map +1 -1
- package/dist/hooks/useEntryAnimation.js +14 -12
- package/dist/hooks/useIsHydrating.d.ts +6 -0
- package/dist/hooks/useIsHydrating.d.ts.map +1 -0
- package/dist/hooks/useIsHydrating.js +30 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +112 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +112 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +0 -3
- package/dist/utils/focusOutline.stylex.d.ts +4 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
- package/dist/utils/focusOutline.stylex.js +4 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +15 -9
- package/dist/utils/sharedMutationObserver.d.ts +21 -0
- package/dist/utils/sharedMutationObserver.d.ts.map +1 -0
- package/dist/utils/sharedMutationObserver.js +69 -0
- package/locales/en.json +444 -0
- package/locales/pseudo.json +333 -0
- package/package.json +9 -4
- package/src/AspectRatio/AspectRatio.test.tsx +44 -43
- package/src/AspectRatio/AspectRatio.tsx +38 -18
- package/src/AspectRatio/__tests__/AspectRatioFitLayers.a11y.browser.spec.ts +157 -0
- package/src/Button/Button.doc.mjs +2 -2
- package/src/Button/Button.test.tsx +155 -9
- package/src/Button/Button.tsx +39 -16
- package/src/Button/__tests__/Button.a11y.known-failures.ts +1 -62
- package/src/Button/__tests__/Button.a11y.states.ts +0 -10
- package/src/CheckboxInput/CheckboxInput.test.tsx +34 -0
- package/src/CheckboxInput/CheckboxInput.tsx +3 -1
- package/src/CheckboxList/CheckboxList.test.tsx +22 -0
- package/src/CheckboxList/CheckboxListItem.doc.mjs +16 -0
- package/src/CheckboxList/CheckboxListItem.tsx +10 -0
- package/src/Dialog/Dialog.test.tsx +46 -0
- package/src/Dialog/Dialog.tsx +20 -7
- package/src/Dialog/__tests__/Dialog.a11y.known-failures.ts +0 -14
- package/src/Drawer/Drawer.doc.mjs +472 -0
- package/src/Drawer/Drawer.spec.md +357 -0
- package/src/Drawer/Drawer.test.tsx +1300 -0
- package/src/Drawer/Drawer.tsx +613 -0
- package/src/Drawer/DrawerDirection.test.tsx +127 -0
- package/src/Drawer/DrawerHeader.doc.mjs +293 -0
- package/src/Drawer/DrawerHeader.test.tsx +102 -0
- package/src/Drawer/DrawerHeader.tsx +235 -0
- package/src/Drawer/__tests__/DrawerAudit.a11y.chromium.spec.ts +401 -0
- package/src/Drawer/__tests__/DrawerHeaderAudit.a11y.chromium.spec.ts +297 -0
- package/src/Drawer/index.ts +13 -0
- package/src/Drawer/useDrawerDialogPresence.ts +284 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +21 -12
- package/src/DropdownMenu/DropdownMenu.tsx +2 -2
- package/src/DropdownMenu/DropdownMenuDivider.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenuDivider.tsx +9 -5
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +2 -2
- package/src/DropdownMenu/__tests__/Menu.a11y.chromium.spec.ts +145 -0
- package/src/DropdownMenu/__tests__/Menu.a11y.known-failures.ts +26 -0
- package/src/DropdownMenu/__tests__/Menu.a11y.renders.tsx +65 -0
- package/src/DropdownMenu/__tests__/Menu.a11y.states.ts +138 -0
- package/src/DropdownMenu/__tests__/Menu.a11y.test.tsx +136 -0
- package/src/EmptyState/EmptyState.doc.mjs +3 -2
- package/src/EmptyState/EmptyState.spec.md +189 -0
- package/src/EmptyState/EmptyState.test.tsx +74 -3
- package/src/EmptyState/EmptyState.tsx +4 -8
- package/src/Field/Field.doc.mjs +14 -8
- package/src/Field/Field.spec.md +217 -0
- package/src/Field/Field.test.tsx +60 -2
- package/src/Field/Field.tsx +17 -8
- package/src/HoverCard/HoverCard.test.tsx +58 -0
- package/src/HoverCard/useHoverCard.tsx +10 -2
- package/src/IconButton/IconButton.doc.mjs +2 -2
- package/src/IconButton/IconButton.test.tsx +3 -1
- package/src/Item/Item.doc.mjs +12 -8
- package/src/Item/Item.spec.md +226 -0
- package/src/Item/Item.test.tsx +61 -0
- package/src/Item/Item.tsx +40 -4
- package/src/Layer/layerViewportInset.source-build.test.mjs +90 -0
- package/src/Layer/layerViewportInset.stylex.ts +6 -2
- package/src/Layer/layerViewportInset.test.ts +1 -0
- package/src/Layer/useLayer.tsx +24 -13
- package/src/Layer/useLayerDismissal.ts +1 -1
- package/src/Layout/container.stylex.ts +6 -6
- package/src/List/List.doc.mjs +14 -1
- package/src/List/List.spec.md +129 -77
- package/src/List/List.test.tsx +163 -94
- package/src/List/List.tsx +74 -18
- package/src/List/ListContext.tsx +9 -3
- package/src/List/ListItem.doc.mjs +24 -5
- package/src/List/ListItem.tsx +56 -27
- package/src/List/index.ts +1 -1
- package/src/Markdown/Markdown.tsx +14 -1
- package/src/Markdown/plugins/frontmatter.test.tsx +25 -0
- package/src/Markdown/plugins/frontmatter.ts +7 -3
- package/src/MetadataList/MetadataList.doc.mjs +2 -2
- package/src/MetadataList/MetadataList.test.tsx +38 -0
- package/src/MetadataList/MetadataList.tsx +8 -1
- package/src/MetadataList/MetadataListContext.tsx +1 -1
- package/src/MultiSelector/MultiSelector.test.tsx +159 -0
- package/src/MultiSelector/MultiSelector.tsx +40 -7
- package/src/MultiSelector/OptionActions.a11y.chromium.spec.ts +112 -2
- package/src/MultiSelector/hooks.ts +3 -1
- package/src/MultiSelector/useMultiCombobox.doc.mjs +267 -0
- package/src/Pagination/Pagination.doc.mjs +7 -7
- package/src/Pagination/Pagination.spec.md +9 -9
- package/src/Pagination/Pagination.test.tsx +242 -0
- package/src/Pagination/Pagination.tsx +27 -11
- package/src/Popover/Popover.test.tsx +2 -2
- package/src/Popover/Popover.tsx +4 -4
- package/src/PowerSearch/PowerSearch.test.tsx +85 -0
- package/src/PowerSearch/PowerSearch.tsx +2 -2
- package/src/RadioList/RadioList.test.tsx +22 -0
- package/src/RadioList/RadioListItem.doc.mjs +16 -0
- package/src/RadioList/RadioListItem.tsx +10 -1
- package/src/Selector/hooks.ts +6 -2
- package/src/Selector/useCombobox.doc.mjs +237 -0
- package/src/Switch/Switch.test.tsx +49 -0
- package/src/Switch/Switch.tsx +11 -0
- package/src/TabList/TabList.spec.md +57 -44
- package/src/TabList/TabList.test.tsx +67 -0
- package/src/TabList/TabMenu.doc.mjs +4 -3
- package/src/TabList/TabMenu.tsx +7 -4
- package/src/Text/useTruncation.test.tsx +69 -0
- package/src/Text/useTruncation.ts +16 -5
- package/src/Tokenizer/Tokenizer.test.tsx +54 -1
- package/src/Tooltip/Tooltip.test.tsx +31 -0
- package/src/Tooltip/useTooltip.test.tsx +13 -0
- package/src/Tooltip/useTooltip.tsx +11 -0
- package/src/TreeList/TreeList.spec.md +29 -17
- package/src/Typeahead/BaseTypeahead.tsx +26 -0
- package/src/Typeahead/Typeahead.test.tsx +260 -2
- package/src/hooks/useEntryAnimation.doc.mjs +4 -4
- package/src/hooks/useEntryAnimation.ssr.test.tsx +143 -0
- package/src/hooks/useEntryAnimation.ts +15 -16
- package/src/hooks/useIsHydrating.test.tsx +70 -0
- package/src/hooks/useIsHydrating.ts +31 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +8 -0
- package/src/i18n/InternationalizationProvider.spec.md +252 -0
- package/src/i18n/__tests__/InternationalizationProvider.test.tsx +128 -0
- package/src/i18n/generated-locales/en.generated.ts +121 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +121 -0
- package/src/i18n/useTranslator.test.tsx +37 -0
- package/src/index.ts +1 -0
- package/src/reset.css +0 -29
- package/src/theme/derivedVarRegistry.test.ts +3 -3
- package/src/theme/derivedVarRegistry.ts +0 -3
- package/src/utils/focusOutline.stylex.ts +4 -0
- package/src/utils/plainDate.test.ts +37 -1
- package/src/utils/plainDate.ts +15 -5
- package/src/utils/sharedMutationObserver.test.ts +53 -0
- package/src/utils/sharedMutationObserver.ts +78 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDrawerDialogPresence.d.ts","sourceRoot":"","sources":["../../src/Drawer/useDrawerDialogPresence.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAaf,KAAK,8BAA8B,GAAG;IACpC,SAAS,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC/C,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAClD,CAAC;AAuDF;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,MAAM,EACN,OAAO,EACP,aAAa,GACd,EAAE,8BAA8B,GAAG,IAAI,CAoEvC"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file useDrawerDialogPresence.ts
|
|
7
|
+
* @input Controlled open state, modal mode, dialog ref, and rendered-state setter
|
|
8
|
+
* @output Coordinates native top-layer presence, exit timing, focus restoration, and unmount cleanup
|
|
9
|
+
* @position Drawer-internal hook; consumed only by Drawer.tsx
|
|
10
|
+
*
|
|
11
|
+
* The drawer has two independent notions of presence:
|
|
12
|
+
* - React's rendered state keeps the panel visible for its CSS exit.
|
|
13
|
+
* - Native `showModal()` or `showPopover()` state keeps it in the browser top
|
|
14
|
+
* layer.
|
|
15
|
+
*
|
|
16
|
+
* Their close ordering is a browser-visible invariant: the panel must finish
|
|
17
|
+
* its exit, then leave the active native host and hide in the same task. If the
|
|
18
|
+
* hide lands a frame later, a transformed ancestor becomes the containing block
|
|
19
|
+
* for the now-non-top-layer `position: fixed` panel and it paints back inside
|
|
20
|
+
* the page for one frame.
|
|
21
|
+
*
|
|
22
|
+
* SYNC: When modified, update:
|
|
23
|
+
* - /packages/core/src/Drawer/Drawer.test.tsx
|
|
24
|
+
* - /.github/scripts/modal-close-visibility.js
|
|
25
|
+
*/
|
|
26
|
+
import { useEffect, useRef } from 'react';
|
|
27
|
+
import { flushSync } from 'react-dom';
|
|
28
|
+
|
|
29
|
+
/** Slack past the computed transition before the backstop gives up waiting. */
|
|
30
|
+
const EXIT_BACKSTOP_BUFFER_MS = 50;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Hold used when the transition duration cannot be read — an unresolved
|
|
34
|
+
* `var()` outside a real browser. Picking a fixed number would otherwise make
|
|
35
|
+
* an assumption about the consumer's theme.
|
|
36
|
+
*/
|
|
37
|
+
const EXIT_FALLBACK_MS = 250;
|
|
38
|
+
function isPopoverOpen(dialog) {
|
|
39
|
+
try {
|
|
40
|
+
return dialog.matches(':popover-open');
|
|
41
|
+
} catch {
|
|
42
|
+
// jsdom and pre-Popover browsers do not recognize :popover-open.
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function isDrawerHostOpen(dialog, isModal) {
|
|
47
|
+
return isModal ? dialog.open : isPopoverOpen(dialog) || dialog.open;
|
|
48
|
+
}
|
|
49
|
+
function showDrawerHost(dialog, isModal) {
|
|
50
|
+
if (isModal) {
|
|
51
|
+
dialog.showModal();
|
|
52
|
+
} else if (typeof dialog.showPopover === 'function') {
|
|
53
|
+
dialog.showPopover();
|
|
54
|
+
} else {
|
|
55
|
+
// Reduced fallback for browsers below the Popover API support floor.
|
|
56
|
+
dialog.show();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function dispatchDialogClose(dialog) {
|
|
60
|
+
const EventConstructor = dialog.ownerDocument.defaultView?.Event ?? Event;
|
|
61
|
+
dialog.dispatchEvent(new EventConstructor('close'));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Leaves the active native host. Returns whether the caller owes a synthetic
|
|
66
|
+
* `close` dispatch: `dialog.close()` used to power the non-modal path, and
|
|
67
|
+
* consumers observe its native `close` event through refs/onClose. Popover
|
|
68
|
+
* dismissal has no equivalent event, so that public DOM contract is preserved
|
|
69
|
+
* explicitly — but by the caller, not here. Native `close` is queued as a
|
|
70
|
+
* task, so a consumer's listener always ran after this hook's own focus
|
|
71
|
+
* restore; the synthetic event must keep that ordering (and fire exactly once
|
|
72
|
+
* per exit, including the unmount path).
|
|
73
|
+
*/
|
|
74
|
+
function hideDrawerHost(dialog, isModal) {
|
|
75
|
+
if (!isModal && typeof dialog.hidePopover === 'function') {
|
|
76
|
+
dialog.hidePopover();
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
if (dialog.open) {
|
|
80
|
+
dialog.close();
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Coordinates the native dialog and React-rendered presence for Drawer.
|
|
87
|
+
*
|
|
88
|
+
* Opening captures the trigger, enters the modal-dialog or manual-popover host,
|
|
89
|
+
* and honours the component's `data-autofocus` contract. Closing waits for the
|
|
90
|
+
* actual transform transition (with a computed-duration backstop), then leaves
|
|
91
|
+
* the native host and synchronously hides the panel before the browser can paint
|
|
92
|
+
* it outside the top layer, restores focus to the captured trigger, and only
|
|
93
|
+
* then dispatches the popover host's synthetic `close`. Unmount cleanup closes
|
|
94
|
+
* a host left open by React Activity or a removed subtree.
|
|
95
|
+
*/
|
|
96
|
+
export function useDrawerDialogPresence({
|
|
97
|
+
dialogRef,
|
|
98
|
+
isOpen,
|
|
99
|
+
isModal,
|
|
100
|
+
setIsRendered
|
|
101
|
+
}) {
|
|
102
|
+
// Element focused when the drawer opened — restored on close.
|
|
103
|
+
const triggerElementRef = useRef(null);
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
const dialog = dialogRef.current;
|
|
106
|
+
if (!dialog) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (isOpen) {
|
|
110
|
+
if (!isDrawerHostOpen(dialog, isModal)) {
|
|
111
|
+
triggerElementRef.current = document.activeElement;
|
|
112
|
+
showDrawerHost(dialog, isModal);
|
|
113
|
+
// React's autoFocus calls .focus() during commit, before the native host
|
|
114
|
+
// is visible, so it silently fails — honour data-autofocus instead (same
|
|
115
|
+
// contract as Dialog).
|
|
116
|
+
dialog.querySelector('[data-autofocus]')?.focus();
|
|
117
|
+
}
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (!isDrawerHostOpen(dialog, isModal)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
return waitForDrawerExit(dialog, () => {
|
|
124
|
+
const owesCloseEvent = hideDrawerHost(dialog, isModal);
|
|
125
|
+
// flushSync, not a plain setState: React's default scheduling can land
|
|
126
|
+
// the commit after the next paint, and that one frame is exactly the
|
|
127
|
+
// bug — the panel paints outside the top layer. Both happen in this
|
|
128
|
+
// task, so the browser never gets to paint between them.
|
|
129
|
+
// eslint-disable-next-line @eslint-react/dom-no-flush-sync -- the panel must stop painting in the task the native host closes
|
|
130
|
+
flushSync(() => {
|
|
131
|
+
setIsRendered(false);
|
|
132
|
+
});
|
|
133
|
+
// Return focus after leaving the native host: a modal dialog makes the
|
|
134
|
+
// rest of the document inert, so focusing earlier silently fails.
|
|
135
|
+
triggerElementRef.current?.focus();
|
|
136
|
+
triggerElementRef.current = null;
|
|
137
|
+
// The synthetic popover close fires after the focus restore above,
|
|
138
|
+
// mirroring the task-queued native event: a consumer close listener
|
|
139
|
+
// that retargets focus (master-detail row switching) gets the last word.
|
|
140
|
+
if (owesCloseEvent) {
|
|
141
|
+
dispatchDialogClose(dialog);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}, [dialogRef, isModal, isOpen, setIsRendered]);
|
|
145
|
+
|
|
146
|
+
// Leave the active native host on unmount. When the drawer is mounted inside
|
|
147
|
+
// an <Activity> that flips to mode="hidden", React runs effect cleanups (with
|
|
148
|
+
// stale isOpen) instead of re-running the effect with isOpen=false. Leaving
|
|
149
|
+
// the host active would strand the top-layer surface and skip the next open.
|
|
150
|
+
// This is deliberately separate from the open/close effect: putting it in
|
|
151
|
+
// that cleanup would cut off every delayed slide-out.
|
|
152
|
+
useEffect(() => {
|
|
153
|
+
const dialog = dialogRef.current;
|
|
154
|
+
return () => {
|
|
155
|
+
if (dialog && isDrawerHostOpen(dialog, isModal)) {
|
|
156
|
+
if (hideDrawerHost(dialog, isModal)) {
|
|
157
|
+
// No focus restore on this path — the drawer is being torn down, so
|
|
158
|
+
// the owed synthetic close fires immediately (still exactly once).
|
|
159
|
+
dispatchDialogClose(dialog);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}, [dialogRef, isModal]);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Wait for the panel's transform transition, with a computed-duration
|
|
168
|
+
* backstop. Mirrors BottomSheetPanel.waitForTransition: the native event is
|
|
169
|
+
* authoritative, and the timeout only prevents a lost event from stranding an
|
|
170
|
+
* open dialog.
|
|
171
|
+
*/
|
|
172
|
+
function waitForDrawerExit(element, complete) {
|
|
173
|
+
let done = false;
|
|
174
|
+
let timer = null;
|
|
175
|
+
const finish = () => {
|
|
176
|
+
if (done) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
done = true;
|
|
180
|
+
if (timer != null) {
|
|
181
|
+
clearTimeout(timer);
|
|
182
|
+
}
|
|
183
|
+
element.removeEventListener('transitionend', handleTransitionEnd);
|
|
184
|
+
element.removeEventListener('transitioncancel', handleTransitionEnd);
|
|
185
|
+
complete();
|
|
186
|
+
};
|
|
187
|
+
const handleTransitionEnd = event => {
|
|
188
|
+
if (event.target === element && event.propertyName === 'transform') {
|
|
189
|
+
finish();
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
element.addEventListener('transitionend', handleTransitionEnd);
|
|
193
|
+
element.addEventListener('transitioncancel', handleTransitionEnd);
|
|
194
|
+
const transitionMs = readTransformTransitionMs(element);
|
|
195
|
+
timer = setTimeout(finish, (transitionMs ?? EXIT_FALLBACK_MS) + EXIT_BACKSTOP_BUFFER_MS);
|
|
196
|
+
return () => {
|
|
197
|
+
done = true;
|
|
198
|
+
if (timer != null) {
|
|
199
|
+
clearTimeout(timer);
|
|
200
|
+
}
|
|
201
|
+
element.removeEventListener('transitionend', handleTransitionEnd);
|
|
202
|
+
element.removeEventListener('transitioncancel', handleTransitionEnd);
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** Read the transform transition's duration + delay from computed CSS. */
|
|
207
|
+
function readTransformTransitionMs(element) {
|
|
208
|
+
const computed = window.getComputedStyle(element);
|
|
209
|
+
const properties = computed.transitionProperty.split(',').map(value => value.trim());
|
|
210
|
+
const durations = parseTimes(computed.transitionDuration);
|
|
211
|
+
const delays = parseTimes(computed.transitionDelay);
|
|
212
|
+
if (properties.length === 0 || durations.length === 0 || delays.length === 0 || durations.includes(null) || delays.includes(null)) {
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
return properties.reduce((longest, property, index) => {
|
|
216
|
+
if (property !== 'transform' && property !== 'all') {
|
|
217
|
+
return longest;
|
|
218
|
+
}
|
|
219
|
+
const duration = durations[index % durations.length];
|
|
220
|
+
const delay = delays[index % delays.length];
|
|
221
|
+
return Math.max(longest, (duration ?? 0) + (delay ?? 0));
|
|
222
|
+
}, 0);
|
|
223
|
+
}
|
|
224
|
+
function parseTimes(value) {
|
|
225
|
+
return value.split(',').map(part => {
|
|
226
|
+
const trimmed = part.trim();
|
|
227
|
+
const time = Number.parseFloat(trimmed);
|
|
228
|
+
if (!Number.isFinite(time)) {
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
if (trimmed.endsWith('ms')) {
|
|
232
|
+
return time;
|
|
233
|
+
}
|
|
234
|
+
return trimmed.endsWith('s') ? time * 1000 : null;
|
|
235
|
+
});
|
|
236
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseProps } from '../BaseProps';
|
|
2
|
-
export interface DropdownMenuDividerProps extends
|
|
2
|
+
export interface DropdownMenuDividerProps extends Omit<BaseProps<HTMLDivElement>, 'role' | 'aria-orientation'> {
|
|
3
3
|
/** Ref forwarded to the separator element. */
|
|
4
4
|
ref?: React.Ref<HTMLDivElement>;
|
|
5
5
|
}
|
|
@@ -7,7 +7,9 @@ export interface DropdownMenuDividerProps extends Pick<BaseProps, 'xstyle' | 'cl
|
|
|
7
7
|
* A horizontal rule separating groups of menu rows.
|
|
8
8
|
*
|
|
9
9
|
* Renders `role="separator"`, so it is never a stop in the menu's arrow-key
|
|
10
|
-
* order. Equivalent to `{type: 'divider'}` in the `items` data API.
|
|
10
|
+
* order. Equivalent to `{type: 'divider'}` in the `items` data API. Host
|
|
11
|
+
* attributes (`id`, `data-*`, `aria-*`) and DOM handlers reach the separator;
|
|
12
|
+
* its role and orientation stay component-owned.
|
|
11
13
|
*
|
|
12
14
|
* @example
|
|
13
15
|
* ```
|
|
@@ -18,7 +20,7 @@ export interface DropdownMenuDividerProps extends Pick<BaseProps, 'xstyle' | 'cl
|
|
|
18
20
|
* </DropdownMenu>
|
|
19
21
|
* ```
|
|
20
22
|
*/
|
|
21
|
-
export declare function DropdownMenuDivider({ xstyle, className, style, ref, }: DropdownMenuDividerProps): import("react").JSX.Element;
|
|
23
|
+
export declare function DropdownMenuDivider({ xstyle, className, style, ref, ...rest }: DropdownMenuDividerProps): import("react").JSX.Element;
|
|
22
24
|
export declare namespace DropdownMenuDivider {
|
|
23
25
|
var displayName: string;
|
|
24
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuDivider.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuDivider.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAW5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,SAAS,
|
|
1
|
+
{"version":3,"file":"DropdownMenuDivider.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuDivider.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAW5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,SAAS,CAAC,cAAc,CAAC,EACzB,MAAM,GAAG,kBAAkB,CAC5B;IACC,8CAA8C;IAC9C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,wBAAwB,+BAY1B;yBAlBe,mBAAmB"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file DropdownMenuDivider.tsx
|
|
7
|
-
* @input Uses Divider, spacing tokens, themeProps
|
|
7
|
+
* @input Uses Divider, spacing tokens, themeProps; forwards host props to Divider
|
|
8
8
|
* @output Exports DropdownMenuDivider component and DropdownMenuDividerProps
|
|
9
9
|
* @position Sub-component; used inside DropdownMenu
|
|
10
10
|
*
|
|
@@ -39,7 +39,9 @@ const THEME_CLASS_NAME = themeProps('dropdown-menu-divider').className;
|
|
|
39
39
|
* A horizontal rule separating groups of menu rows.
|
|
40
40
|
*
|
|
41
41
|
* Renders `role="separator"`, so it is never a stop in the menu's arrow-key
|
|
42
|
-
* order. Equivalent to `{type: 'divider'}` in the `items` data API.
|
|
42
|
+
* order. Equivalent to `{type: 'divider'}` in the `items` data API. Host
|
|
43
|
+
* attributes (`id`, `data-*`, `aria-*`) and DOM handlers reach the separator;
|
|
44
|
+
* its role and orientation stay component-owned.
|
|
43
45
|
*
|
|
44
46
|
* @example
|
|
45
47
|
* ```
|
|
@@ -54,9 +56,11 @@ export function DropdownMenuDivider({
|
|
|
54
56
|
xstyle,
|
|
55
57
|
className,
|
|
56
58
|
style,
|
|
57
|
-
ref
|
|
59
|
+
ref,
|
|
60
|
+
...rest
|
|
58
61
|
}) {
|
|
59
62
|
return /*#__PURE__*/_jsx(Divider, {
|
|
63
|
+
...rest,
|
|
60
64
|
ref: ref,
|
|
61
65
|
xstyle: [styles.divider, xstyle],
|
|
62
66
|
className: className ? `${THEME_CLASS_NAME} ${className}` : THEME_CLASS_NAME,
|
|
@@ -659,16 +659,16 @@ export function DropdownMenuSubMenu(props) {
|
|
|
659
659
|
...menuPress.menuProps,
|
|
660
660
|
...mergeProps(themeProps('dropdown-menu'), {
|
|
661
661
|
0: {
|
|
662
|
-
className: "x9f619 x78zum5 xdt5ytf x1lsbc85
|
|
662
|
+
className: "x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o x1j4r261"
|
|
663
663
|
},
|
|
664
664
|
2: {
|
|
665
|
-
className: "x9f619 x78zum5 xdt5ytf x1lsbc85
|
|
665
|
+
className: "x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o xge0x1e xish69e"
|
|
666
666
|
},
|
|
667
667
|
1: {
|
|
668
|
-
className: "x9f619 x78zum5 xdt5ytf x1lsbc85
|
|
668
|
+
className: "x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o x1j4r261 x1odjw0f x6ikm8r xish69e"
|
|
669
669
|
},
|
|
670
670
|
3: {
|
|
671
|
-
className: "x9f619 x78zum5 xdt5ytf x1lsbc85
|
|
671
|
+
className: "x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o xge0x1e x1odjw0f x6ikm8r xish69e"
|
|
672
672
|
}
|
|
673
673
|
}[!!hasOverflow << 1 | !!hasOverflow << 0]),
|
|
674
674
|
children: nestedContent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAgB,MAAM,OAAO,CAAC;AAQpD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4D5C,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,YAAgB,EAChB,SAAiB,EACjB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,+
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAgB,MAAM,OAAO,CAAC;AAQpD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4D5C,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,YAAgB,EAChB,SAAiB,EACjB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,+BAoDjB;yBAhEe,UAAU"}
|
|
@@ -18,7 +18,7 @@ import { createElement } from 'react';
|
|
|
18
18
|
import * as stylex from '@stylexjs/stylex';
|
|
19
19
|
import "../theme/tokens.stylex.js";
|
|
20
20
|
import { colorVars, spacingVars, fontWeightVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
21
|
-
import { mergeProps } from "../utils/index.js";
|
|
21
|
+
import { isRenderable, mergeProps } from "../utils/index.js";
|
|
22
22
|
import { themeProps } from "../utils/themeProps.js";
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
const styles = {
|
|
@@ -82,7 +82,7 @@ export function EmptyState({
|
|
|
82
82
|
...mergeProps(themeProps('empty-state', {
|
|
83
83
|
variant: isCompact ? 'compact' : null
|
|
84
84
|
}), stylex.props(styles.container, isCompact && styles.containerCompact, xstyle), className, style),
|
|
85
|
-
children: [icon
|
|
85
|
+
children: [isRenderable(icon) && /*#__PURE__*/_jsx("div", {
|
|
86
86
|
"aria-hidden": "true",
|
|
87
87
|
children: icon
|
|
88
88
|
}), /*#__PURE__*/_jsxs("div", {
|
|
@@ -98,13 +98,7 @@ export function EmptyState({
|
|
|
98
98
|
1: {
|
|
99
99
|
className: "x1ghz6dp xjb2p0i x2mo6ok xf74fhv x1tgivj0 xcr08ib"
|
|
100
100
|
}
|
|
101
|
-
}[!!isCompact << 0]), title), description
|
|
102
|
-
/*#__PURE__*/
|
|
103
|
-
// Rendered as <div> (not <p>): description accepts ReactNode and a
|
|
104
|
-
// <p> cannot legally contain block children, which causes hydration
|
|
105
|
-
// mismatches. The StyleX style sets margin: 0, so appearance is
|
|
106
|
-
// unchanged.
|
|
107
|
-
_jsx("div", {
|
|
101
|
+
}[!!isCompact << 0]), title), isRenderable(description) && /*#__PURE__*/_jsx("div", {
|
|
108
102
|
...mergeProps(themeProps('empty-state-description', {
|
|
109
103
|
variant: isCompact ? 'compact' : null
|
|
110
104
|
}), {
|
|
@@ -117,7 +111,7 @@ export function EmptyState({
|
|
|
117
111
|
}[!!isCompact << 0]),
|
|
118
112
|
children: description
|
|
119
113
|
})]
|
|
120
|
-
}), actions
|
|
114
|
+
}), isRenderable(actions) && /*#__PURE__*/_jsx("div", {
|
|
121
115
|
...{
|
|
122
116
|
0: {
|
|
123
117
|
className: "x78zum5 x1q0g3np x6s0dn4 x1txdalj xcsaf9d"
|
package/dist/Field/Field.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Field.tsx
|
|
3
|
-
* @input Uses React,
|
|
3
|
+
* @input Uses React, StyleX, BaseProps, FieldLabel/FieldStatus, FormLayoutContext, Text, VisuallyHidden, theme/status utilities
|
|
4
4
|
* @output Exports Field component, FieldProps
|
|
5
5
|
* @position Core implementation; consumed by index.ts, tested by Field.test.tsx
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/Field/Field.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAM,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAGnE,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/Field/Field.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAM,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAGnE,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AA+DtC,YAAY,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAW,SAAQ,IAAI,CACtC,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,CACX;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;I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sx
|
|
7
|
-
* @input Uses React,
|
|
7
|
+
* @input Uses React, StyleX, BaseProps, FieldLabel/FieldStatus, FormLayoutContext, Text, VisuallyHidden, theme/status utilities
|
|
8
8
|
* @output Exports Field component, FieldProps
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by Field.test.tsx
|
|
10
10
|
*
|
|
@@ -26,6 +26,7 @@ import { mergeProps } from "../utils/index.js";
|
|
|
26
26
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
27
27
|
import { FormLayoutContext } from "../FormLayout/FormLayoutContext.js";
|
|
28
28
|
import { Text } from "../Text/index.js";
|
|
29
|
+
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
29
30
|
import { themeProps } from "../utils/themeProps.js";
|
|
30
31
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
31
32
|
const styles = {
|
|
@@ -140,10 +141,10 @@ export function Field({
|
|
|
140
141
|
if (isHorizontalLabels) {
|
|
141
142
|
return /*#__PURE__*/_jsxs("div", {
|
|
142
143
|
ref: ref,
|
|
144
|
+
...props,
|
|
143
145
|
...mergeProps(themeProps('field', {
|
|
144
146
|
layout: 'horizontal-labels'
|
|
145
147
|
}), stylex.props(styles.horizontalLabels, xstyle), className, style),
|
|
146
|
-
...props,
|
|
147
148
|
children: [/*#__PURE__*/_jsx("div", {
|
|
148
149
|
...{
|
|
149
150
|
className: "x1enrzb7"
|
|
@@ -153,12 +154,15 @@ export function Field({
|
|
|
153
154
|
...{
|
|
154
155
|
className: "x78zum5 xdt5ytf xc8icb0 x19nvjgn xlumz0n x1qs65gq"
|
|
155
156
|
},
|
|
156
|
-
children: [description && /*#__PURE__*/_jsx(
|
|
157
|
+
children: [description && (isLabelHidden ? /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
158
|
+
id: resolvedDescriptionID,
|
|
159
|
+
children: description
|
|
160
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
157
161
|
type: "supporting",
|
|
158
162
|
display: "block",
|
|
159
163
|
id: resolvedDescriptionID,
|
|
160
164
|
children: description
|
|
161
|
-
}), children, statusNode]
|
|
165
|
+
})), children, statusNode]
|
|
162
166
|
})]
|
|
163
167
|
});
|
|
164
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AA6BlC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG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AC,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,KAC5C,SAAS,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAyBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CAyc5E"}
|
|
@@ -145,6 +145,14 @@ export function useHoverCard(options = {}) {
|
|
|
145
145
|
isHoveringContentRef.current = false;
|
|
146
146
|
hideLayer();
|
|
147
147
|
}, [clearTimeouts, hideLayer]);
|
|
148
|
+
|
|
149
|
+
// The imperative hide. A card closed while the pointer rests on it unmounts
|
|
150
|
+
// without a mouseleave, so the content-hover latch is cleared here; left set,
|
|
151
|
+
// it would keep the trigger's next hover-open from closing on leave.
|
|
152
|
+
const hide = useCallback(() => {
|
|
153
|
+
isHoveringContentRef.current = false;
|
|
154
|
+
hideLayer();
|
|
155
|
+
}, [hideLayer]);
|
|
148
156
|
const {
|
|
149
157
|
isTouchPointerRef,
|
|
150
158
|
isTouchInteraction,
|
|
@@ -291,7 +299,7 @@ export function useHoverCard(options = {}) {
|
|
|
291
299
|
// clear it.
|
|
292
300
|
const card = typeof document === 'undefined' ? null : document.getElementById(layerId);
|
|
293
301
|
const hadFocus = card?.contains(document.activeElement) ?? false;
|
|
294
|
-
|
|
302
|
+
hide();
|
|
295
303
|
if (hadFocus) {
|
|
296
304
|
isEscapeDismissingRef.current = true;
|
|
297
305
|
triggerRef.current?.focus();
|
|
@@ -448,6 +456,6 @@ export function useHoverCard(options = {}) {
|
|
|
448
456
|
isOpen: isLayerOpen,
|
|
449
457
|
renderHoverCard,
|
|
450
458
|
show: showLayer,
|
|
451
|
-
hide
|
|
459
|
+
hide
|
|
452
460
|
};
|
|
453
461
|
}
|
package/dist/Item/Item.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { type ReactNode } from 'react';
|
|
24
24
|
import type { BaseProps } from '../BaseProps';
|
|
25
|
-
export type ItemAlign = 'center' | 'start';
|
|
25
|
+
export type ItemAlign = 'center' | 'start' | 'first-line';
|
|
26
26
|
export type ItemDensity = 'compact' | 'balanced' | 'spacious';
|
|
27
27
|
/**
|
|
28
28
|
* How a swipe action looks: ordinary, the one you mean, the dangerous one.
|
|
@@ -111,7 +111,11 @@ export interface ItemProps extends BaseProps<HTMLElement> {
|
|
|
111
111
|
*/
|
|
112
112
|
endContent?: ReactNode;
|
|
113
113
|
/**
|
|
114
|
-
* Vertical alignment of the start/end content slots.
|
|
114
|
+
* Vertical alignment of the start/end content slots. `center` centers each
|
|
115
|
+
* slot on the whole text block; `start` lines up slot tops with the text's
|
|
116
|
+
* top; `first-line` centers each slot on the label's first line, so a small
|
|
117
|
+
* mark (a status dot, a radio, a timestamp) stays level with the first line
|
|
118
|
+
* of a wrapped label. A slot taller than that line moves the text down.
|
|
115
119
|
* @default 'center'
|
|
116
120
|
*/
|
|
117
121
|
align?: ItemAlign;
|
package/dist/Item/Item.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/Item/Item.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyB5C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/Item/Item.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyB5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UAAU,EACV,gBAAgB,EAChB,MAAkB,EAClB,OAAO,EACP,cAAc,EACd,IAAI,EACJ,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,YAAY,EACjB,aAAqB,EACrB,UAAkB,EAClB,UAAkB,EAClB,YAAY,EACZ,aAAwB,EACxB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,IAAI,EACJ,GAAG,SAAS,EACb,EAAE,SAAS,+BA8UX;yBA1We,IAAI"}
|
package/dist/Item/Item.js
CHANGED
|
@@ -108,6 +108,10 @@ const styles = {
|
|
|
108
108
|
kGNEyG: "x1cy8zhl",
|
|
109
109
|
$$css: true
|
|
110
110
|
},
|
|
111
|
+
alignFirstLine: {
|
|
112
|
+
kGNEyG: "x1pha0wt",
|
|
113
|
+
$$css: true
|
|
114
|
+
},
|
|
111
115
|
interactive: {
|
|
112
116
|
kkrTdU: "x1ypdohk x16khyan",
|
|
113
117
|
k1ekBW: "x15406qy",
|
|
@@ -359,8 +363,13 @@ export function Item({
|
|
|
359
363
|
const innerContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
360
364
|
children: [marker, startContent != null && /*#__PURE__*/_jsx("span", {
|
|
361
365
|
...{
|
|
362
|
-
|
|
363
|
-
|
|
366
|
+
0: {
|
|
367
|
+
className: "x3psx0u x78zum5"
|
|
368
|
+
},
|
|
369
|
+
1: {
|
|
370
|
+
className: "x3psx0u x78zum5 x6s0dn4 x4jt1l0 xk9ib7f x1xb3ux x1899uy6 x1xcinxp"
|
|
371
|
+
}
|
|
372
|
+
}[!!(align === 'first-line') << 0],
|
|
364
373
|
children: startContent
|
|
365
374
|
}), hasParentRole || isDelegate ?
|
|
366
375
|
/*#__PURE__*/
|
|
@@ -444,10 +453,16 @@ export function Item({
|
|
|
444
453
|
0: {
|
|
445
454
|
className: "x3psx0u x78zum5 xvc5jky"
|
|
446
455
|
},
|
|
456
|
+
2: {
|
|
457
|
+
className: "x3psx0u x78zum5 xvc5jky x6s0dn4 x4jt1l0 xk9ib7f x1xb3ux x1899uy6 x1xcinxp"
|
|
458
|
+
},
|
|
447
459
|
1: {
|
|
448
460
|
className: "x3psx0u x78zum5 xvc5jky xbyyjgo"
|
|
461
|
+
},
|
|
462
|
+
3: {
|
|
463
|
+
className: "x3psx0u x78zum5 xvc5jky x6s0dn4 x4jt1l0 xk9ib7f x1xb3ux x1899uy6 x1xcinxp xbyyjgo"
|
|
449
464
|
}
|
|
450
|
-
}[!!isDisabled << 0],
|
|
465
|
+
}[!!(align === 'first-line') << 1 | !!isDisabled << 0],
|
|
451
466
|
children: endContent
|
|
452
467
|
})]
|
|
453
468
|
});
|
|
@@ -494,7 +509,7 @@ export function Item({
|
|
|
494
509
|
...mergeProps(themeProps('item', {
|
|
495
510
|
density,
|
|
496
511
|
align
|
|
497
|
-
}), focusOutlineProps.focusWithin(styles.root, densityStyles[density], align === 'start' && styles.alignStart, isInteractive && styles.interactive, isInteractive && interactionOverlayStyles.backgroundColor, isLinkRoot && styles.linkRoot, isHighlighted && styles.highlighted, isSelected && styles.selected, isDisabled && !hasParentRole && styles.disabled, hasSwipe && styles.swipeRoot, xstyle), className, style),
|
|
512
|
+
}), focusOutlineProps.focusWithin(styles.root, densityStyles[density], align === 'start' && styles.alignStart, align === 'first-line' && styles.alignFirstLine, isInteractive && styles.interactive, isInteractive && interactionOverlayStyles.backgroundColor, isLinkRoot && styles.linkRoot, isHighlighted && styles.highlighted, isSelected && styles.selected, isDisabled && !hasParentRole && styles.disabled, hasSwipe && styles.swipeRoot, xstyle), className, style),
|
|
498
513
|
role: role,
|
|
499
514
|
onClick: rootOnClick,
|
|
500
515
|
children: [/*#__PURE__*/_jsx(ItemDescriptionContext, {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The viewport gutter and the caps derived from it. Every value has an
|
|
3
|
-
* `env()`-less fallback for engines without safe-area support; pair them
|
|
4
|
-
* `stylex.firstThatWorks(cap
|
|
3
|
+
* `env()`-less fallback for engines without safe-area support; pair them as
|
|
4
|
+
* `stylex.firstThatWorks(`calc(${cap})`, `calc(${capFallback})`)`. Pass
|
|
5
|
+
* each inside a `calc()` (or another function), never as a bare reference: a
|
|
6
|
+
* constant reference compiles to a `var()`, and `firstThatWorks` folds two
|
|
7
|
+
* `var()` arguments into one `var(cap, capFallback)` whose constant is never
|
|
8
|
+
* inlined, so every engine would take the fallback.
|
|
5
9
|
*/
|
|
6
10
|
export declare const layerViewportInset: {
|
|
7
11
|
/** Gutter from the block-start viewport edge. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerViewportInset.stylex.d.ts","sourceRoot":"","sources":["../../src/Layer/layerViewportInset.stylex.ts"],"names":[],"mappings":"AAwDA
|
|
1
|
+
{"version":3,"file":"layerViewportInset.stylex.d.ts","sourceRoot":"","sources":["../../src/Layer/layerViewportInset.stylex.ts"],"names":[],"mappings":"AAwDA;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;IAC7B,iDAAiD;;IAEjD,+CAA+C;;IAE/C,+CAA+C;;IAE/C,gFAAgF;;;;;;IAMhF,iFAAiF;;;IAGjF,gFAAgF;;;CAGhF,CAAC"}
|
|
@@ -54,8 +54,12 @@ const GUTTER_BLOCK = `calc(max(${SPACING}, env(safe-area-inset-top, 0px), env(sa
|
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* The viewport gutter and the caps derived from it. Every value has an
|
|
57
|
-
* `env()`-less fallback for engines without safe-area support; pair them
|
|
58
|
-
* `stylex.firstThatWorks(cap
|
|
57
|
+
* `env()`-less fallback for engines without safe-area support; pair them as
|
|
58
|
+
* `stylex.firstThatWorks(`calc(${cap})`, `calc(${capFallback})`)`. Pass
|
|
59
|
+
* each inside a `calc()` (or another function), never as a bare reference: a
|
|
60
|
+
* constant reference compiles to a `var()`, and `firstThatWorks` folds two
|
|
61
|
+
* `var()` arguments into one `var(cap, capFallback)` whose constant is never
|
|
62
|
+
* inlined, so every engine would take the fallback.
|
|
59
63
|
*/
|
|
60
64
|
export const layerViewportInset = {
|
|
61
65
|
gutterBlockStart: "calc(max(var(--spacing-4), env(safe-area-inset-top, 0px)) + var(--astryx-layer-inset-block-start, 0px))",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayer.d.ts","sourceRoot":"","sources":["../../src/Layer/useLayer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"useLayer.d.ts","sourceRoot":"","sources":["../../src/Layer/useLayer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAyHnD;;GAEG;AACH,UAAU,kBAAkB;IAC1B,aAAa,EAAE,KAAK,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACtD;;;OAGG;IACH,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;CACtD;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;;;;;;;;;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