@astryxdesign/core 0.7.2-canary.fe2c655 → 0.7.2
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 +156 -2
- package/README.md +4 -4
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +40 -1
- 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/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +8 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +4 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +5 -2
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +1 -0
- 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/CheckboxList.d.ts +1 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +6 -2
- 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/CommandPalette/CommandPaletteInput.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +37 -5
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +5 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +20 -8
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +84 -113
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.d.ts +17 -0
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.js +21 -0
- 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/DropdownMenuGroup.d.ts +6 -4
- package/dist/DropdownMenu/DropdownMenuGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuGroup.js +4 -3
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +15 -4
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +24 -0
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -0
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +46 -0
- package/dist/DropdownMenu/menuRegionStops.d.ts +38 -0
- package/dist/DropdownMenu/menuRegionStops.d.ts.map +1 -0
- package/dist/DropdownMenu/menuRegionStops.js +131 -0
- 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/FormLayout/FormLayout.d.ts +5 -4
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/FormLayout/FormLayout.js +1 -1
- package/dist/FormLayout/FormLayoutContext.d.ts +3 -3
- package/dist/FormLayout/FormLayoutContext.js +3 -3
- package/dist/Grid/Grid.d.ts +8 -7
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +5 -4
- package/dist/Grid/GridSpan.d.ts +1 -1
- package/dist/Grid/GridSpan.d.ts.map +1 -1
- package/dist/Grid/GridSpan.js +1 -0
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +4 -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/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/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +8 -2
- package/dist/Markdown/plugins/headingLinks.d.ts.map +1 -1
- package/dist/Markdown/plugins/headingLinks.js +9 -1
- 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/MobileNav/MobileNav.d.ts +9 -0
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +30 -3
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +5 -0
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +45 -11
- package/dist/RadioList/RadioList.d.ts +1 -1
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +6 -2
- 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/SideNav/SideNavItem.d.ts +8 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +76 -10
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +4 -2
- package/dist/ToggleButton/ToggleButton.d.ts +3 -2
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +12 -1
- package/dist/Token/Token.js +1 -1
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +5 -3
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +5 -3
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +1 -0
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +2 -2
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +57 -9
- package/dist/astryx.css +27 -4
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +18 -13
- package/dist/reset.a11y.chromium.spec.js +50 -1
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +15 -9
- package/docs.mjs +4 -4
- package/package.json +4 -4
- package/scripts/agent-doc-state.mjs +66 -6
- package/scripts/postinstall.mjs +44 -3
- package/src/AppShell/AppShell.tsx +45 -1
- 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/Avatar/Avatar.doc.mjs +5 -3
- package/src/Avatar/Avatar.tsx +11 -2
- package/src/AvatarGroup/AvatarGroup.doc.mjs +3 -2
- package/src/AvatarGroup/AvatarGroupOverflow.test.tsx +24 -1
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +2 -0
- package/src/Breadcrumbs/BreadcrumbItem.tsx +4 -1
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +30 -1
- package/src/Card/Card.doc.mjs +1 -1
- package/src/Chat/ChatLayoutScrollButton.test.tsx +13 -0
- package/src/Chat/ChatLayoutScrollButton.tsx +4 -2
- package/src/Chat/__tests__/ChatLayoutScrollButton.a11y.chromium.spec.ts +64 -19
- package/src/Chat/__tests__/ChatMessageMetadata.a11y.chromium.spec.ts +3 -1
- package/src/CheckboxInput/CheckboxInput.test.tsx +34 -0
- package/src/CheckboxInput/CheckboxInput.tsx +3 -1
- package/src/CheckboxList/CheckboxList.fr10.test.tsx +29 -2
- package/src/CheckboxList/CheckboxList.test.tsx +22 -0
- package/src/CheckboxList/CheckboxList.tsx +4 -1
- package/src/CheckboxList/CheckboxListItem.doc.mjs +16 -0
- package/src/CheckboxList/CheckboxListItem.tsx +10 -0
- package/src/Code/Code.doc.mjs +1 -0
- package/src/CommandPalette/CommandPalette.doc.mjs +2 -0
- package/src/CommandPalette/CommandPaletteInput.test.tsx +53 -4
- package/src/CommandPalette/CommandPaletteInput.tsx +33 -3
- package/src/CommandPalette/__tests__/CommandPaletteInputAudit.a11y.chromium.spec.ts +335 -0
- package/src/CommandPalette/__tests__/CommandPaletteItemAudit.a11y.chromium.spec.ts +292 -0
- package/src/ContextMenu/ContextMenu.doc.mjs +2 -3
- package/src/ContextMenu/ContextMenu.test.tsx +12 -2
- package/src/ContextMenu/ContextMenu.tsx +4 -1
- package/src/ContextMenu/__tests__/ContextMenuAudit.a11y.chromium.spec.ts +438 -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 +1 -0
- package/src/DropdownMenu/DropdownMenu.ssr.test.tsx +57 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +79 -6
- package/src/DropdownMenu/DropdownMenu.tsx +88 -144
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuContext.tsx +24 -0
- package/src/DropdownMenu/DropdownMenuDivider.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenuDivider.spec.md +192 -0
- package/src/DropdownMenu/DropdownMenuDivider.tsx +9 -5
- package/src/DropdownMenu/DropdownMenuGroup.doc.mjs +169 -10
- package/src/DropdownMenu/DropdownMenuGroup.tsx +6 -4
- package/src/DropdownMenu/DropdownMenuLazySheet.test.tsx +126 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +185 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +17 -3
- package/src/DropdownMenu/__tests__/DropdownMenuDividerAudit.a11y.chromium.spec.ts +280 -0
- package/src/DropdownMenu/__tests__/DropdownMenuGroupAudit.a11y.chromium.spec.ts +334 -0
- package/src/DropdownMenu/__tests__/warmMenuBottomSheet.tsx +43 -0
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +71 -0
- package/src/DropdownMenu/menuRegionStops.ts +167 -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/Field/FieldLabel.doc.mjs +133 -26
- package/src/Field/FieldLabel.spec.md +172 -0
- package/src/Field/__tests__/FieldLabelAudit.a11y.chromium.spec.ts +296 -0
- package/src/FormLayout/FormLayout.doc.mjs +6 -3
- package/src/FormLayout/FormLayout.spec.md +192 -0
- package/src/FormLayout/FormLayout.test.tsx +15 -0
- package/src/FormLayout/FormLayout.tsx +7 -6
- package/src/FormLayout/FormLayoutContext.ts +3 -3
- package/src/Grid/Grid.doc.mjs +7 -1
- package/src/Grid/Grid.spec.md +93 -113
- package/src/Grid/Grid.test.tsx +22 -0
- package/src/Grid/Grid.tsx +10 -9
- package/src/Grid/GridSpan.doc.mjs +3 -3
- package/src/Grid/GridSpan.tsx +4 -1
- package/src/Heading/Heading.test.tsx +57 -0
- package/src/Heading/Heading.tsx +6 -2
- package/src/Icon/Icon.doc.mjs +36 -0
- package/src/Indicator/Indicator.doc.mjs +3 -3
- package/src/Item/Item.doc.mjs +12 -8
- package/src/Item/Item.test.tsx +61 -0
- package/src/Item/Item.tsx +40 -4
- package/src/Layout/LayoutHeader.doc.mjs +5 -0
- 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 +16 -0
- package/src/List/ListItem.tsx +56 -27
- package/src/List/index.ts +1 -1
- package/src/Markdown/Markdown.tsx +14 -1
- package/src/Markdown/parser.ts +8 -2
- package/src/Markdown/plugins/headingLinks.ts +9 -1
- package/src/MetadataList/MetadataList.doc.mjs +3 -3
- package/src/MetadataList/MetadataList.test.tsx +38 -0
- package/src/MetadataList/MetadataList.tsx +8 -1
- package/src/MetadataList/MetadataListContext.tsx +1 -1
- package/src/MobileNav/MobileNav.tsx +30 -3
- package/src/MobileNav/MobileNavCloseEdgeCases.test.tsx +173 -15
- package/src/MoreMenu/MoreMenu.test.tsx +5 -1
- package/src/PowerSearch/PowerSearch.test.tsx +62 -0
- package/src/PowerSearch/PowerSearch.tsx +9 -0
- package/src/PowerSearch/PowerSearchValueEditor.test.tsx +71 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +45 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +1 -0
- package/src/RadioList/RadioList.fr10.test.tsx +45 -2
- package/src/RadioList/RadioList.test.tsx +22 -0
- package/src/RadioList/RadioList.tsx +4 -1
- package/src/RadioList/RadioListItem.doc.mjs +16 -0
- package/src/RadioList/RadioListItem.tsx +10 -1
- package/src/Resizable/useResizable.doc.mjs +2 -0
- package/src/ScrollableArea/ScrollableArea.doc.mjs +1 -1
- package/src/SideNav/SideNav.spec.md +227 -0
- package/src/SideNav/SideNav.test.tsx +220 -0
- package/src/SideNav/SideNavItem.doc.mjs +2 -2
- package/src/SideNav/SideNavItem.tsx +99 -17
- package/src/Slider/Slider.spec.md +39 -18
- package/src/Spinner/Spinner.doc.mjs +1 -1
- package/src/TabList/TabList.spec.md +57 -44
- package/src/Table/Table.spec.md +6 -1
- package/src/Table/plugins/activation/useTableActivation.spec.md +254 -0
- package/src/Text/Text.test.tsx +57 -0
- package/src/Text/Text.tsx +6 -2
- package/src/TimeInput/TimeInput.fr10.test.tsx +15 -0
- package/src/Timestamp/Timestamp.doc.mjs +1 -1
- package/src/ToggleButton/ToggleButton.test.tsx +95 -0
- package/src/ToggleButton/ToggleButton.tsx +12 -1
- package/src/ToggleButton/ToggleButtonGroup.doc.mjs +4 -0
- package/src/Token/Token.tsx +1 -1
- package/src/Token/__tests__/TokenRemoveTarget.a11y.chromium.spec.ts +86 -0
- package/src/Toolbar/Toolbar.test.tsx +0 -8
- package/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts +163 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.renders.tsx +63 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.states.ts +142 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.test.tsx +126 -0
- package/src/TopNav/TopNavMegaMenu.test.tsx +47 -0
- package/src/TopNav/TopNavMegaMenu.tsx +9 -3
- package/src/TopNav/TopNavMenu.test.tsx +46 -1
- package/src/TopNav/TopNavMenu.tsx +13 -3
- package/src/TreeList/TreeList.doc.mjs +1 -0
- package/src/TreeList/TreeList.test.tsx +327 -6
- package/src/TreeList/TreeList.tsx +5 -1
- package/src/TreeList/TreeListBranches.tsx +6 -0
- package/src/TreeList/TreeListItem.tsx +88 -13
- package/src/docPropLiterals.test.ts +36 -10
- package/src/hooks/useMenuHover.ts +18 -13
- package/src/postinstall.test.mjs +79 -0
- package/src/reset.a11y.chromium.spec.ts +52 -1
- package/src/reset.css +9 -29
- package/src/reset.test.ts +11 -0
- package/src/theme/derivedVarRegistry.test.ts +7 -0
- package/src/unicodePropertyEscapes.source-build.test.mjs +69 -0
- package/src/utils/plainDate.test.ts +37 -1
- package/src/utils/plainDate.ts +15 -5
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
* - /packages/core/src/TreeList/TreeList.tsx
|
|
14
14
|
* - /packages/cli/assets/templates/blocks/components/TreeList/ (showcase blocks)
|
|
15
15
|
*/
|
|
16
|
-
import { useId, useMemo } from 'react';
|
|
16
|
+
import { useId, useMemo, useRef } from 'react';
|
|
17
17
|
import * as stylex from '@stylexjs/stylex';
|
|
18
18
|
import "../theme/tokens.stylex.js";
|
|
19
19
|
import { colorVars, radiusVars, spacingVars, durationVars, easeVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
20
20
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
21
21
|
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
22
22
|
import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
23
|
+
import { hasInteractiveAncestor, useClickableContainer } from "../hooks/useClickableContainer.js";
|
|
23
24
|
import { Icon } from "../Icon/index.js";
|
|
24
25
|
import { mergeProps } from "../utils/index.js";
|
|
25
26
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
@@ -38,6 +39,7 @@ const styles = {
|
|
|
38
39
|
kmVPX3: "x1717udv",
|
|
39
40
|
kVAEAm: "x1n2onr6",
|
|
40
41
|
kzqmXN: "xh8yej3",
|
|
42
|
+
"--_tree-focus-z": "x70muob x1sk5w8o",
|
|
41
43
|
kI3sdo: "x1a2a7pz",
|
|
42
44
|
$$css: true
|
|
43
45
|
},
|
|
@@ -51,7 +53,10 @@ const styles = {
|
|
|
51
53
|
kVAEAm: "x1n2onr6",
|
|
52
54
|
kB7OPa: "x9f619",
|
|
53
55
|
k9WMMc: "x1yc453h",
|
|
54
|
-
|
|
56
|
+
$$css: true
|
|
57
|
+
},
|
|
58
|
+
focusLift: {
|
|
59
|
+
kY2c9j: "x6tapwc x3x83r7",
|
|
55
60
|
$$css: true
|
|
56
61
|
},
|
|
57
62
|
interactive: {
|
|
@@ -177,6 +182,7 @@ export function TreeListItem({
|
|
|
177
182
|
const labelId = useId();
|
|
178
183
|
const descriptionId = useId();
|
|
179
184
|
const LinkComponent = useLinkComponent();
|
|
185
|
+
const linkRef = useRef(null);
|
|
180
186
|
const isInteractive = onClick != null || href != null;
|
|
181
187
|
const handleToggle = useMemo(() => hasChildren && onToggle != null ? e => {
|
|
182
188
|
e.stopPropagation();
|
|
@@ -188,8 +194,10 @@ export function TreeListItem({
|
|
|
188
194
|
if (isDisabled) {
|
|
189
195
|
return;
|
|
190
196
|
}
|
|
191
|
-
|
|
192
|
-
|
|
197
|
+
// Controls inside the row, native or role-based, keep their own
|
|
198
|
+
// activation (FR7): the same rule link rows get from the shared
|
|
199
|
+
// enlarged-surface hook below.
|
|
200
|
+
if (hasInteractiveAncestor(e.target, e.currentTarget)) {
|
|
193
201
|
return;
|
|
194
202
|
}
|
|
195
203
|
if (onClick != null) {
|
|
@@ -202,6 +210,38 @@ export function TreeListItem({
|
|
|
202
210
|
return undefined;
|
|
203
211
|
}, [onClick, hasChildren, onToggle, id, isDisabled]);
|
|
204
212
|
|
|
213
|
+
// A link row (an `href` and no other row action) is an enlarged surface for
|
|
214
|
+
// its link: the indent is part of the row, so a click anywhere in it must
|
|
215
|
+
// follow the link, as Enter already does. Built on the shared
|
|
216
|
+
// enlarged-surface hook (family:navigation-destinations), which skips
|
|
217
|
+
// clicks on nested controls, native or role-based, and text selections.
|
|
218
|
+
// - Clicks are delegated: the hook re-dispatches the click on the anchor
|
|
219
|
+
// with its modifier keys, so the link component and the browser handle
|
|
220
|
+
// same-tab, new-tab and new-window activation, and stops the original, so
|
|
221
|
+
// ancestors see one click per press.
|
|
222
|
+
// - Middle-click has no synthetic equivalent, so it takes the hook's href
|
|
223
|
+
// path, which opens the destination in a new tab after the shared
|
|
224
|
+
// navigation rule.
|
|
225
|
+
// The container ref is attached to link rows only, so every other row stays
|
|
226
|
+
// a plain element and both hook instances stay inert on it.
|
|
227
|
+
const forwardsToLink = href != null && handleClick == null;
|
|
228
|
+
const linkRowRef = useRef(null);
|
|
229
|
+
const {
|
|
230
|
+
onClick: delegateToLink
|
|
231
|
+
} = useClickableContainer({
|
|
232
|
+
containerRef: linkRowRef,
|
|
233
|
+
interactiveRef: linkRef,
|
|
234
|
+
disabled: isDisabled || !forwardsToLink
|
|
235
|
+
});
|
|
236
|
+
const {
|
|
237
|
+
onMouseUp: openLinkOnMiddleClick
|
|
238
|
+
} = useClickableContainer({
|
|
239
|
+
containerRef: linkRowRef,
|
|
240
|
+
href,
|
|
241
|
+
target,
|
|
242
|
+
disabled: isDisabled || !forwardsToLink
|
|
243
|
+
});
|
|
244
|
+
|
|
205
245
|
// Per-level indent distance. The per-level step is the public, themeable
|
|
206
246
|
// `--tree-list-indent` lever (default `--spacing-4`, set on the tree-list
|
|
207
247
|
// root). A leaf adds a fixed chevron-column offset (chevron width + gap) so
|
|
@@ -211,8 +251,8 @@ export function TreeListItem({
|
|
|
211
251
|
// every row sits flush, like a parent at that level. That offset is tied to
|
|
212
252
|
// the chevron's own dimensions, not the indent step, so it does not scale
|
|
213
253
|
// with the lever. Published as the private `--_tree-indent` and consumed by
|
|
214
|
-
// `
|
|
215
|
-
//
|
|
254
|
+
// `indentedContent`'s stylesheet `padding-inline-start`; the step stays
|
|
255
|
+
// themeable through `--tree-list-indent` (see #4308).
|
|
216
256
|
const reservesChevronColumn = !hasChildren && hasExpandableItems;
|
|
217
257
|
const indentDistance = reservesChevronColumn ? `calc(${nestedLevel} * var(--tree-list-indent) + ${spacingVars['--spacing-4']} + ${spacingVars['--spacing-2']})` : `calc(${nestedLevel} * var(--tree-list-indent))`;
|
|
218
258
|
const indentStyle = {
|
|
@@ -308,6 +348,7 @@ export function TreeListItem({
|
|
|
308
348
|
},
|
|
309
349
|
children: startContent
|
|
310
350
|
}), href != null ? /*#__PURE__*/_jsx(LinkComponent, {
|
|
351
|
+
ref: linkRef,
|
|
311
352
|
href: href,
|
|
312
353
|
target: target,
|
|
313
354
|
"aria-disabled": isDisabled || undefined,
|
|
@@ -389,7 +430,7 @@ export function TreeListItem({
|
|
|
389
430
|
density,
|
|
390
431
|
selected: isSelected ? 'selected' : null,
|
|
391
432
|
disabled: isDisabled ? 'disabled' : null
|
|
392
|
-
}), isInteractive || hasChildren && onClick == null ? focusOutlineProps.focusWithinOrPublished(styles.contentWrapper, densityStyles[density], styles.interactive, interactionOverlayStyles.backgroundImage, isDisabled && styles.disabled, isSelected && styles.selected, xstyle) : stylex.props(styles.contentWrapper, densityStyles[density], isDisabled && styles.disabled, isSelected && styles.selected, xstyle),
|
|
433
|
+
}), isInteractive || hasChildren && onClick == null ? focusOutlineProps.focusWithinOrPublished(styles.contentWrapper, styles.focusLift, densityStyles[density], styles.interactive, interactionOverlayStyles.backgroundImage, isDisabled && styles.disabled, isSelected && styles.selected, xstyle) : stylex.props(styles.contentWrapper, densityStyles[density], isDisabled && styles.disabled, isSelected && styles.selected, xstyle),
|
|
393
434
|
// Consumer row props are merged last so useContainerReveal can
|
|
394
435
|
// publish both its classes and inline custom properties. Seed the
|
|
395
436
|
// private indent first, then preserve the standard inline-style
|
|
@@ -398,8 +439,15 @@ export function TreeListItem({
|
|
|
398
439
|
...indentStyle,
|
|
399
440
|
...style
|
|
400
441
|
}),
|
|
401
|
-
|
|
402
|
-
|
|
442
|
+
ref: forwardsToLink ? linkRowRef : undefined,
|
|
443
|
+
onClick: forwardsToLink ? delegateToLink : handleClick,
|
|
444
|
+
onMouseUp: forwardsToLink ? openLinkOnMiddleClick : undefined,
|
|
445
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
446
|
+
...{
|
|
447
|
+
className: "x78zum5 x98rzlu xeuugli x1h91t0o x14kbac9 xw2xrtw"
|
|
448
|
+
},
|
|
449
|
+
children: innerContent
|
|
450
|
+
})
|
|
403
451
|
})
|
|
404
452
|
}), isExpanded && renderedChildren != null && /*#__PURE__*/_jsx("ul", {
|
|
405
453
|
role: "group",
|
package/dist/astryx.css
CHANGED
|
@@ -134,6 +134,7 @@
|
|
|
134
134
|
.xqxtgf4{--_input-clear-hit-content:none}
|
|
135
135
|
.xtoycft{--_input-clear-hit-inset:0px}
|
|
136
136
|
.xqlix59{--_item-description-color:var(--color-error)}
|
|
137
|
+
.x1nwg5ib{--_item-inset-inline:0px}
|
|
137
138
|
.xw1s368{--_item-inset-inline:var(--spacing-2)}
|
|
138
139
|
.x1ytau7y{--_item-inset-inline:var(--spacing-3)}
|
|
139
140
|
.xufyqxy{--_item-label-color:var(--color-error)}
|
|
@@ -173,6 +174,7 @@
|
|
|
173
174
|
.x1ur4yav{--_thumbnail-hit-inset:0px}
|
|
174
175
|
.x87gnkx{--_toast-slide-y:calc(-1 * var(--spacing-2))}
|
|
175
176
|
.x1heqljd{--_toast-slide-y:var(--spacing-2)}
|
|
177
|
+
.x70muob{--_tree-focus-z:auto}
|
|
176
178
|
.x16bblx1{--button-focus-offset:var(--focus-outline-offset)}
|
|
177
179
|
.x1v15ycx{--button-icon-only-aspect:1 / 1}
|
|
178
180
|
.x1mtvhk1{--color-syntax-background:transparent}
|
|
@@ -415,6 +417,7 @@
|
|
|
415
417
|
.x1mjsb9v:focus-within{--_reveal-delay:0s,0s}
|
|
416
418
|
.xi33vf3:focus-within{--_reveal-opacity:1}
|
|
417
419
|
.xoa21yc:focus-within{--_reveal-position:static}
|
|
420
|
+
.x1sk5w8o:focus-visible{--_tree-focus-z:2}
|
|
418
421
|
.x11woleg:focus-visible{--indicator-color:var(--color-accent)}
|
|
419
422
|
.x1i79oho.x1i79oho:hover:where(:not(:disabled,[aria-disabled="true"])){--indicator-color:var(--resize-hint-gate,var(--color-accent))}
|
|
420
423
|
.x1qs65gq:has(> [data-size="lg"]){--_field-status-overlap:calc(var(--size-element-lg) / 2)}
|
|
@@ -682,6 +685,7 @@
|
|
|
682
685
|
.xpqajaz:not(#\#):not(#\#):not(#\#){align-items:end}
|
|
683
686
|
.xuk3077:not(#\#):not(#\#):not(#\#){align-items:flex-end}
|
|
684
687
|
.x1cy8zhl:not(#\#):not(#\#):not(#\#){align-items:flex-start}
|
|
688
|
+
.x1h91t0o:not(#\#):not(#\#):not(#\#){align-items:inherit}
|
|
685
689
|
.xaz6w31:not(#\#):not(#\#):not(#\#){align-items:last baseline}
|
|
686
690
|
.x7a106z:not(#\#):not(#\#):not(#\#){align-items:start}
|
|
687
691
|
.x1qjc9v5:not(#\#):not(#\#):not(#\#){align-items:stretch}
|
|
@@ -1042,6 +1046,7 @@
|
|
|
1042
1046
|
.x1pmbctz:not(#\#):not(#\#):not(#\#){grid-template-columns:auto 1fr}
|
|
1043
1047
|
.x1rkzygb:not(#\#):not(#\#):not(#\#){grid-template-columns:auto minmax(0,1fr)}
|
|
1044
1048
|
.x1wthsqz:not(#\#):not(#\#):not(#\#){grid-template-columns:auto repeat(7,1fr)}
|
|
1049
|
+
.x1mkdm3x:not(#\#):not(#\#):not(#\#){grid-template-columns:minmax(0,1fr)}
|
|
1045
1050
|
.x1mzazjb:not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(7,1fr)}
|
|
1046
1051
|
.x189bvgu:not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
|
|
1047
1052
|
.x1xx4m37:not(#\#):not(#\#):not(#\#){grid-template-columns:var(--_codeblock-gutter-width) 1fr}
|
|
@@ -1112,13 +1117,13 @@
|
|
|
1112
1117
|
.x3ct3a4:not(#\#):not(#\#):not(#\#){list-style-type:none}
|
|
1113
1118
|
.x14z9mp:not(#\#):not(#\#):not(#\#){margin-inline-end:0}
|
|
1114
1119
|
.x11t971q:not(#\#):not(#\#):not(#\#){margin-inline-end:auto}
|
|
1115
|
-
.x1cphv78:not(#\#):not(#\#):not(#\#){margin-inline-end:calc(-1 * min(var(--_item-inset-inline),var(--container-padding-inline-end,0px)))}
|
|
1116
1120
|
.x1fcf3bl:not(#\#):not(#\#):not(#\#){margin-inline-end:calc(-1 * var(--container-padding-inline-end,0px))}
|
|
1117
1121
|
.x1kpg4um:not(#\#):not(#\#):not(#\#){margin-inline-end:calc(-1 * var(--layout-padding-inner-x,var(--spacing-4)))}
|
|
1118
1122
|
.xkd40ry:not(#\#):not(#\#):not(#\#){margin-inline-end:calc(-1 * var(--spacing-1))}
|
|
1119
1123
|
.x3kzqx6:not(#\#):not(#\#):not(#\#){margin-inline-end:calc(-1 * var(--spacing-2))}
|
|
1120
1124
|
.xmequkd:not(#\#):not(#\#):not(#\#){margin-inline-end:calc(var(--spacing-1) * -1)}
|
|
1121
1125
|
.x144kxal:not(#\#):not(#\#):not(#\#){margin-inline-end:calc(calc(var(--spacing-4) + max(var(--astryx-layer-inset-inline-start, 0px), var(--astryx-layer-inset-inline-end, 0px))));margin-inline-end:calc(calc(max(var(--spacing-4), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)) + max(var(--astryx-layer-inset-inline-start, 0px), var(--astryx-layer-inset-inline-end, 0px))))}
|
|
1126
|
+
.x2gtn1o:not(#\#):not(#\#):not(#\#){margin-inline-end:max(var(--container-padding-inline-end,0px) - var(--_item-inset-inline),0px)}
|
|
1122
1127
|
.xnur1sd:not(#\#):not(#\#):not(#\#){margin-inline-end:var(--spacing-1)}
|
|
1123
1128
|
.x1pezmd8:not(#\#):not(#\#):not(#\#){margin-inline-end:var(--spacing-2)}
|
|
1124
1129
|
.x1c9tiao:not(#\#):not(#\#):not(#\#){margin-inline-end:var(--x-marginInlineEnd)}
|
|
@@ -1126,7 +1131,6 @@
|
|
|
1126
1131
|
.x1qfufaz:not(#\#):not(#\#):not(#\#){margin-inline-start:-8px}
|
|
1127
1132
|
.x1lziwak:not(#\#):not(#\#):not(#\#){margin-inline-start:0}
|
|
1128
1133
|
.xvc5jky:not(#\#):not(#\#):not(#\#){margin-inline-start:auto}
|
|
1129
|
-
.x1t1czy8:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(-1 * min(var(--_item-inset-inline),var(--container-padding-inline-start,0px)))}
|
|
1130
1134
|
.xd10s4z:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(-1 * var(--border-width))}
|
|
1131
1135
|
.xojxgvx:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(-1 * var(--container-padding-inline-start,0px))}
|
|
1132
1136
|
.x1wim8z0:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(-1 * var(--layout-padding-inner-x,var(--spacing-4)))}
|
|
@@ -1138,8 +1142,8 @@
|
|
|
1138
1142
|
.x1xrm450:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(var(--spacing-2) - var(--spacing-1) + 1px)}
|
|
1139
1143
|
.x6w1cxl:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(var(--spacing-3) + var(--border-width) + var(--spacing-4))}
|
|
1140
1144
|
.xpdk1p0:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(calc(var(--spacing-4) + max(var(--astryx-layer-inset-inline-start, 0px), var(--astryx-layer-inset-inline-end, 0px))));margin-inline-start:calc(calc(max(var(--spacing-4), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)) + max(var(--astryx-layer-inset-inline-start, 0px), var(--astryx-layer-inset-inline-end, 0px))))}
|
|
1145
|
+
.xch736x:not(#\#):not(#\#):not(#\#){margin-inline-start:max(var(--container-padding-inline-start,0px) - var(--_item-inset-inline),0px)}
|
|
1141
1146
|
.x13hpdyo:not(#\#):not(#\#):not(#\#){margin-inline-start:var(--_avatar-group-overlap)}
|
|
1142
|
-
.x12vn87o:not(#\#):not(#\#):not(#\#){margin-inline-start:var(--_tree-indent,0px)}
|
|
1143
1147
|
.xladpz9:not(#\#):not(#\#):not(#\#){margin-inline-start:var(--spacing-0-5)}
|
|
1144
1148
|
.x17lnmll:not(#\#):not(#\#):not(#\#){margin-inline-start:var(--spacing-1-5)}
|
|
1145
1149
|
.x11g1kdw:not(#\#):not(#\#):not(#\#){margin-inline-start:var(--spacing-1)}
|
|
@@ -1192,6 +1196,7 @@
|
|
|
1192
1196
|
.x12frdag:not(#\#):not(#\#):not(#\#){padding-inline-end:calc(var(--container-padding-inline-end) - var(--border-width))}
|
|
1193
1197
|
.x1ahicqp:not(#\#):not(#\#):not(#\#){padding-inline-end:max(var(--container-padding-inline-end,0px),calc((100cqi - var(--layout-alignment-width)) / 2 + var(--container-padding-inline-end,0px)))}
|
|
1194
1198
|
.xy07wb4:not(#\#):not(#\#):not(#\#){padding-inline-end:max(var(--container-padding-inline-end,0px),calc(100cqi - var(--layout-alignment-width) + var(--container-padding-inline-end,0px)))}
|
|
1199
|
+
.x1pyz5s7:not(#\#):not(#\#):not(#\#){padding-inline-end:max(var(--container-padding-inline-end,0px),var(--_item-inset-inline))}
|
|
1195
1200
|
.x1g0rcpp:not(#\#):not(#\#):not(#\#){padding-inline-end:max(var(--spacing-4),env(safe-area-inset-right,0px))}
|
|
1196
1201
|
.x1p6hqjl:not(#\#):not(#\#):not(#\#){padding-inline-end:var(--_tokenizer-end-lane-reserve,0px)}
|
|
1197
1202
|
.x1by8st6:not(#\#):not(#\#):not(#\#){padding-inline-end:var(--astryx-dialog-padding-inline-end,var(--astryx-dialog-padding-inline,var(--astryx-dialog-padding,max(var(--spacing-4),env(safe-area-inset-right,0px)))))}
|
|
@@ -1223,7 +1228,9 @@
|
|
|
1223
1228
|
.x2a0j69:not(#\#):not(#\#):not(#\#){padding-inline-start:calc(var(--spacing-2) - var(--spacing-1) + 1px)}
|
|
1224
1229
|
.xhlv5e7:not(#\#):not(#\#):not(#\#){padding-inline-start:max(var(--container-padding-inline-start,0px),calc((100cqi - var(--layout-alignment-width)) / 2 + var(--container-padding-inline-start,0px)))}
|
|
1225
1230
|
.xxjme2g:not(#\#):not(#\#):not(#\#){padding-inline-start:max(var(--container-padding-inline-start,0px),calc(100cqi - var(--layout-alignment-width) + var(--container-padding-inline-start,0px)))}
|
|
1231
|
+
.xua885n:not(#\#):not(#\#):not(#\#){padding-inline-start:max(var(--container-padding-inline-start,0px),var(--_item-inset-inline))}
|
|
1226
1232
|
.xf4btlh:not(#\#):not(#\#):not(#\#){padding-inline-start:max(var(--spacing-4),env(safe-area-inset-left,0px))}
|
|
1233
|
+
.xw2xrtw:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--_tree-indent,0px)}
|
|
1227
1234
|
.xqmdmw:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--astryx-dialog-padding-inline-start,var(--astryx-dialog-padding-inline,var(--astryx-dialog-padding,max(var(--spacing-4),env(safe-area-inset-left,0px)))))}
|
|
1228
1235
|
.x1jni19p:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--astryx-number-input-padding-inline-start,var(--astryx-number-input-padding-inline,var(--astryx-number-input-padding,var(--spacing-2))))}
|
|
1229
1236
|
.x1c35znw:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--container-padding-inline-start)}
|
|
@@ -1351,6 +1358,8 @@
|
|
|
1351
1358
|
.xsqj5wx:not(#\#):not(#\#):not(#\#){transform:var(--x-transform)}
|
|
1352
1359
|
.xd00j3c:not(#\#):not(#\#):not(#\#){transition-behavior:allow-discrete}
|
|
1353
1360
|
.x5h36tt:not(#\#):not(#\#):not(#\#){transition-delay:.15s}
|
|
1361
|
+
.xf1rc6:not(#\#):not(#\#):not(#\#){transition-delay:0s,0s}
|
|
1362
|
+
.xostmdb:not(#\#):not(#\#):not(#\#){transition-delay:0s,var(--duration-medium)}
|
|
1354
1363
|
.x1ahifba:not(#\#):not(#\#):not(#\#){transition-delay:0s}
|
|
1355
1364
|
.x4avkj2:not(#\#):not(#\#):not(#\#){transition-delay:var(--_fade-delay,0s)}
|
|
1356
1365
|
.x1rq8cwj:not(#\#):not(#\#):not(#\#){transition-delay:var(--_reveal-delay,0s,0s)}
|
|
@@ -1366,6 +1375,7 @@
|
|
|
1366
1375
|
.x1tw3moq:not(#\#):not(#\#):not(#\#){transition-duration:var(--duration-fast),0s}
|
|
1367
1376
|
.xuedmi6:not(#\#):not(#\#):not(#\#){transition-duration:var(--duration-fast)}
|
|
1368
1377
|
.xgneliz:not(#\#):not(#\#):not(#\#){transition-duration:var(--duration-medium-min)}
|
|
1378
|
+
.x1eizr8u:not(#\#):not(#\#):not(#\#){transition-duration:var(--duration-medium),0s}
|
|
1369
1379
|
.x80gvsz:not(#\#):not(#\#):not(#\#){transition-duration:var(--duration-medium)}
|
|
1370
1380
|
.x1eaenvl:not(#\#):not(#\#):not(#\#){transition-property:background-color,border-color,color}
|
|
1371
1381
|
.xts7igz:not(#\#):not(#\#):not(#\#){transition-property:background-color,border-color}
|
|
@@ -1388,6 +1398,7 @@
|
|
|
1388
1398
|
.x1mpt4pi:not(#\#):not(#\#):not(#\#){transition-property:color,text-decoration}
|
|
1389
1399
|
.xt3l3uh:not(#\#):not(#\#):not(#\#){transition-property:color}
|
|
1390
1400
|
.xrgi2yo:not(#\#):not(#\#):not(#\#){transition-property:display}
|
|
1401
|
+
.x6kj92:not(#\#):not(#\#):not(#\#){transition-property:grid-template-rows,overflow}
|
|
1391
1402
|
.xjshnde:not(#\#):not(#\#):not(#\#){transition-property:grid-template-rows,padding}
|
|
1392
1403
|
.x1qn9uv2:not(#\#):not(#\#):not(#\#){transition-property:grid-template-rows}
|
|
1393
1404
|
.x157bb6t:not(#\#):not(#\#):not(#\#){transition-property:mask-image}
|
|
@@ -1442,6 +1453,7 @@
|
|
|
1442
1453
|
.xzkaem6:not(#\#):not(#\#):not(#\#){z-index:3}
|
|
1443
1454
|
.x6cuj84:not(#\#):not(#\#):not(#\#){z-index:500}
|
|
1444
1455
|
.x1q2oy4v:not(#\#):not(#\#):not(#\#){z-index:9999}
|
|
1456
|
+
.x6tapwc:not(#\#):not(#\#):not(#\#){z-index:var(--_tree-focus-z,auto)}
|
|
1445
1457
|
.x1wphrdb[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#){--_press-overlay-transition:0s}
|
|
1446
1458
|
.xbb2ue6[data-astryx-press="on"]:not(#\#):not(#\#):not(#\#){--_press-overlay-transition:0s}
|
|
1447
1459
|
.x11z29ks[data-astryx-press="on"]:not(#\#):not(#\#):not(#\#){--astryx-press-alpha:1}
|
|
@@ -1480,6 +1492,8 @@
|
|
|
1480
1492
|
.x1nwey30:is([dir="rtl"] *):not(#\#):not(#\#):not(#\#){mask-image:linear-gradient(to left,transparent var(--_tab-strip-bleed),black calc(var(--_tab-strip-bleed) + var(--spacing-8)))}
|
|
1481
1493
|
.x8ulde1:is([dir="rtl"] *):not(#\#):not(#\#):not(#\#){mask-image:linear-gradient(to right,transparent 0%,rgba(0,0,0,.3) 2px,black var(--spacing-1))}
|
|
1482
1494
|
.x1rxa4r8:is([dir="rtl"] *):not(#\#):not(#\#):not(#\#){mask-image:linear-gradient(to right,transparent var(--_tab-strip-bleed),black calc(var(--_tab-strip-bleed) + var(--spacing-8)))}
|
|
1495
|
+
.x16lv2iq:not([stylex-hack]) > :is(img, video):not(#\#):not(#\#):not(#\#){object-fit:contain}
|
|
1496
|
+
.x492jj3:not([stylex-hack]) > :is(img, video):not(#\#):not(#\#):not(#\#){object-fit:cover}
|
|
1483
1497
|
.x1euntei:focus-within:not(#\#):not(#\#):not(#\#){opacity:1}
|
|
1484
1498
|
.x25t5g8:focus-visible:not(#\#):not(#\#):not(#\#){opacity:1}
|
|
1485
1499
|
.xof6bs:is(th:hover *):not(#\#):not(#\#):not(#\#){opacity:1}
|
|
@@ -1535,6 +1549,7 @@
|
|
|
1535
1549
|
.xxdn8bs:has(> div > .astryx-layout-content):not(#\#):not(#\#):not(#\#){padding-inline-end:max(0px,calc((100% - var(--layout-content-width)) / 2))}
|
|
1536
1550
|
.xmnmr5y:has(.astryx-nav-icon):not(#\#):not(#\#):not(#\#){padding-inline-start:0}
|
|
1537
1551
|
.x1vvd0s7:has(> div > .astryx-layout-content):not(#\#):not(#\#):not(#\#){padding-inline-start:max(0px,calc((100% - var(--layout-content-width)) / 2))}
|
|
1552
|
+
.x3x83r7:has(:focus-visible):not(#\#):not(#\#):not(#\#){z-index:2}
|
|
1538
1553
|
.xbw113y:dir(rtl):not(#\#):not(#\#):not(#\#){transform:translateX(-100%)}
|
|
1539
1554
|
.x1eqdj8u:dir(rtl):not(#\#):not(#\#):not(#\#){transform:translateX(100%)}
|
|
1540
1555
|
.x1xrp5p4:first-child:not(#\#):not(#\#):not(#\#){border-end-start-radius:var(--radius-element)}
|
|
@@ -1596,6 +1611,7 @@
|
|
|
1596
1611
|
@media (pointer: coarse){.x1bjav06.x1bjav06:not(#\#):not(#\#):not(#\#){pointer-events:none}}
|
|
1597
1612
|
@media (prefers-reduced-motion: reduce){.xg83hb1.xg83hb1:not(#\#):not(#\#):not(#\#){scroll-behavior:auto}}
|
|
1598
1613
|
@media (forced-colors: active){.xrih18v.xrih18v:not(#\#):not(#\#):not(#\#){scrollbar-color:auto}}
|
|
1614
|
+
@media (prefers-reduced-motion: reduce){.x1k6wr6r.x1k6wr6r:not(#\#):not(#\#):not(#\#){transition-delay:0s,0s}}
|
|
1599
1615
|
@media (prefers-reduced-motion: reduce){.xwgk2z2.xwgk2z2:not(#\#):not(#\#):not(#\#){transition-delay:var(--_reveal-delay-reduced,0s,0s)}}
|
|
1600
1616
|
@media (prefers-reduced-motion: reduce){.xsagj69.xsagj69:not(#\#):not(#\#):not(#\#){transition-duration:.01ms}}
|
|
1601
1617
|
@media (prefers-reduced-motion: reduce){.xzg1mie.xzg1mie:not(#\#):not(#\#):not(#\#){transition-duration:.01s}}
|
|
@@ -2014,11 +2030,13 @@
|
|
|
2014
2030
|
.x1uyokj7:not(#\#):not(#\#):not(#\#):not(#\#){width:var(--x-inlineSize)}
|
|
2015
2031
|
.x5lhr3w:not(#\#):not(#\#):not(#\#):not(#\#){width:var(--x-width)}
|
|
2016
2032
|
.x1wp2rvj.x1wp2rvj:where(.x139im0d:last-child *):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-width:0}
|
|
2033
|
+
.x1m6kvgq:not([stylex-hack]) > *:not(#\#):not(#\#):not(#\#):not(#\#){height:100%}
|
|
2017
2034
|
.x1vonza8.x1vonza8:where(.astryx-input-group > *):not(#\#):not(#\#):not(#\#):not(#\#){height:100%}
|
|
2018
2035
|
.x132qfvm:focus-within:not(#\#):not(#\#):not(#\#):not(#\#){height:auto}
|
|
2019
2036
|
.xsg11nj.xsg11nj:where(.x-default-marker:has(> .astryx-layout-footer:not([data-divider])) *):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:0}
|
|
2020
2037
|
.x1ioh5az.x1ioh5az:where(.x-default-marker:has(> .astryx-layout-header:not([data-divider])) *):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:0}
|
|
2021
2038
|
.x1kw28su:focus-within:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--spacing-1)}
|
|
2039
|
+
.xyz6fim:not([stylex-hack]) > *:not(#\#):not(#\#):not(#\#):not(#\#){width:100%}
|
|
2022
2040
|
.x10okhzq:focus-within:not(#\#):not(#\#):not(#\#):not(#\#){width:auto}
|
|
2023
2041
|
.x5du68j:has(~ * [data-chat-name]):not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--spacing-5)}
|
|
2024
2042
|
.xzzx6db:has([role="radio"]:not([aria-label])):not(#\#):not(#\#):not(#\#):not(#\#){max-width:100%}
|
|
@@ -2059,7 +2077,7 @@
|
|
|
2059
2077
|
.x1bev2v5[data-astryx-press="on"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-image:none}
|
|
2060
2078
|
.x524tya[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-image:none}
|
|
2061
2079
|
@starting-style{.x1sopeo2.x1sopeo2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-rows:0fr}}
|
|
2062
|
-
.
|
|
2080
|
+
.xramuyw:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset:-4px}
|
|
2063
2081
|
.xarstr8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset:0}
|
|
2064
2082
|
.xxx281p:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset:0}
|
|
2065
2083
|
.xht581f:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset:var(--_input-clear-hit-inset)}
|
|
@@ -2093,6 +2111,7 @@
|
|
|
2093
2111
|
.xd54j2p:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset-block:0}
|
|
2094
2112
|
.xpsyfx0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-date-and-time-value{margin-block:0}
|
|
2095
2113
|
.x1qqcexc:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-date-and-time-value{margin-inline:0}
|
|
2114
|
+
.x1xb3ux:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{overflow:hidden}
|
|
2096
2115
|
.x1x4c3m6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-date-and-time-value{padding-block:0}
|
|
2097
2116
|
.xtbxizx:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit{padding-block:0}
|
|
2098
2117
|
@starting-style{.x5rzir7.x5rzir7:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:0}}
|
|
@@ -2120,6 +2139,7 @@
|
|
|
2120
2139
|
.xeyghm5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:var(--color-text-secondary)}
|
|
2121
2140
|
.x1cpjm7i:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:""}
|
|
2122
2141
|
.x1s928wv:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{content:""}
|
|
2142
|
+
.x4jt1l0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:"\200B";content:"\200B" / ""}
|
|
2123
2143
|
.x46gnpd:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:attr(data-line)}
|
|
2124
2144
|
.x1mls8ih:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:counter(astryx-list, lower-alpha) "."}
|
|
2125
2145
|
.xdaf9gw:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:counter(astryx-list, lower-roman) "."}
|
|
@@ -2128,6 +2148,7 @@
|
|
|
2128
2148
|
.xhkezso:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{display:block}
|
|
2129
2149
|
.xolhmmf:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-calendar-picker-indicator{display:none}
|
|
2130
2150
|
.x3nzp0f:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{font-family:var(--font-family-code)}
|
|
2151
|
+
.x1899uy6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{font-size:var(--text-body-size)}
|
|
2131
2152
|
.xekda60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset-inline-end:-2px}
|
|
2132
2153
|
.x1unh1gc:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset-inline-end:0}
|
|
2133
2154
|
.xvw6utc:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset-inline-start:-2px}
|
|
@@ -2135,6 +2156,7 @@
|
|
|
2135
2156
|
.x1km86hw:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{inset-inline-start:calc(var(--spacing-4) + var(--_codeblock-gutter-width) + var(--spacing-3))}
|
|
2136
2157
|
.x15bqym3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit{line-height:inherit}
|
|
2137
2158
|
.x1f74mqm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-date-and-time-value{line-height:inherit}
|
|
2159
|
+
.x1xcinxp:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{line-height:var(--text-body-leading)}
|
|
2138
2160
|
.xph5o2a:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{opacity:0}
|
|
2139
2161
|
.xb3n6bw:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{opacity:1}
|
|
2140
2162
|
.xni466t:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{opacity:var(--_sheet-scrim-opacity,1)}
|
|
@@ -2193,6 +2215,7 @@
|
|
|
2193
2215
|
.xec4aax:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-date-and-time-value{min-height:0}
|
|
2194
2216
|
.x51xajf:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{top:-2px}
|
|
2195
2217
|
.x1m1drc7:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{top:0}
|
|
2218
|
+
.xk9ib7f:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{width:0}
|
|
2196
2219
|
.xkj6t0a:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{width:0}
|
|
2197
2220
|
.xzkji8o:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{width:6px}
|
|
2198
2221
|
.xi8c0p9:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{width:var(--indicator-width,1px)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMenuHover.d.ts","sourceRoot":"","sources":["../../src/hooks/useMenuHover.ts"],"names":[],"mappings":"AA8DA,UAAU,KAAK;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,UAAU,QAAQ;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAeD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,KAAK,EACb,MAAM,EAAE,QAAQ,GACf,OAAO,CAqBT;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAC,KAAK,IAAI,CAAC;IACpD,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,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CAAC;QACzB;;;WAGG;QACH,YAAY,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;QACjD,iDAAiD;QACjD,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,YAAY,EAAE;QACZ,YAAY,EAAE,MAAM,IAAI,CAAC;QACzB,YAAY,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;QACjD,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;KAC7C,CAAC;IACF,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACnC,uEAAuE;IACvE,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B;;;OAGG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,OAAO,CAAC;IAChC;;;;OAIG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,YAAY,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAC9D,OAAO,EAAE,mBAAmB,GAC3B,kBAAkB,CAAC,CAAC,CAAC,CAmVvB"}
|
|
@@ -147,19 +147,6 @@ export function useMenuHover(options) {
|
|
|
147
147
|
/** When the current open began as a hover-open; 0 once confirmed or closed. */
|
|
148
148
|
const hoverOpenedAtRef = useRef(0);
|
|
149
149
|
const prevIsOpenRef = useRef(isOpen);
|
|
150
|
-
|
|
151
|
-
// Catches every close, whatever caused it. A layout effect, not render: it
|
|
152
|
-
// must land before the browser hit-tests the vanished panel and fires the
|
|
153
|
-
// mouseenter REOPEN_SUPPRESS_MS exists to swallow.
|
|
154
|
-
useIsomorphicLayoutEffect(() => {
|
|
155
|
-
const wasOpen = prevIsOpenRef.current;
|
|
156
|
-
prevIsOpenRef.current = isOpen;
|
|
157
|
-
if (wasOpen && !isOpen) {
|
|
158
|
-
hoverModeRef.current = false;
|
|
159
|
-
hoverOpenedAtRef.current = 0;
|
|
160
|
-
closedAtRef.current = Date.now();
|
|
161
|
-
}
|
|
162
|
-
}, [isOpen]);
|
|
163
150
|
const clearTimeouts = useCallback(() => {
|
|
164
151
|
if (showTimerRef.current) {
|
|
165
152
|
clearTimeout(showTimerRef.current);
|
|
@@ -173,6 +160,24 @@ export function useMenuHover(options) {
|
|
|
173
160
|
safeTriangleCleanupRef.current = null;
|
|
174
161
|
}, []);
|
|
175
162
|
|
|
163
|
+
// Catches every close, whatever caused it. A layout effect, not render: it
|
|
164
|
+
// must land before the browser hit-tests the vanished panel and fires the
|
|
165
|
+
// mouseenter REOPEN_SUPPRESS_MS exists to swallow.
|
|
166
|
+
useIsomorphicLayoutEffect(() => {
|
|
167
|
+
const wasOpen = prevIsOpenRef.current;
|
|
168
|
+
prevIsOpenRef.current = isOpen;
|
|
169
|
+
if (wasOpen && !isOpen) {
|
|
170
|
+
// A hover-open scheduled before the close must not fire afterwards and
|
|
171
|
+
// reopen what just closed from elsewhere — e.g. the root menu's light
|
|
172
|
+
// dismiss closing a submenu flyout mid hover-intent (#6893). A fresh
|
|
173
|
+
// mouseenter still opens; only the stale timer is cancelled.
|
|
174
|
+
clearTimeouts();
|
|
175
|
+
hoverModeRef.current = false;
|
|
176
|
+
hoverOpenedAtRef.current = 0;
|
|
177
|
+
closedAtRef.current = Date.now();
|
|
178
|
+
}
|
|
179
|
+
}, [isOpen, clearTimeouts]);
|
|
180
|
+
|
|
176
181
|
// useListFocus needs an onEscape that is defined in terms of its own listRef;
|
|
177
182
|
// the indirection avoids the use-before-declare.
|
|
178
183
|
const escapeHandlerRef = useRef(() => {});
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @file reset.a11y.chromium.spec.ts
|
|
5
5
|
* @input packages/core/src/reset.css, alone on a blank Chromium page
|
|
6
6
|
* @output Browser evidence that the reset reaches ::before, ::after,
|
|
7
|
-
* ::placeholder
|
|
7
|
+
* ::placeholder, the search field's cancel button and the dropdown marker
|
|
8
|
+
* of a field with a list
|
|
8
9
|
* @position reset.css integration proof. A pseudo-element inside :where() is
|
|
9
10
|
* invalid, and the forgiving list drops it without an error, so only a
|
|
10
11
|
* shipping engine shows which of the reset's rules still match.
|
|
@@ -13,6 +14,8 @@
|
|
|
13
14
|
import * as fs from 'node:fs';
|
|
14
15
|
import { fileURLToPath } from 'node:url';
|
|
15
16
|
import { expect, test } from '@playwright/test';
|
|
17
|
+
// @ts-expect-error -- pngjs ships no declarations; runtime support is pinned.
|
|
18
|
+
import { PNG } from 'pngjs';
|
|
16
19
|
const RESET_CSS = fs.readFileSync(fileURLToPath(new URL('./reset.css', import.meta.url)), 'utf8');
|
|
17
20
|
|
|
18
21
|
// No Astryx CSS is loaded, so --color-text-secondary is undefined and a
|
|
@@ -149,6 +152,52 @@ test('a search field has no cancel button to clear it', async ({
|
|
|
149
152
|
await page.mouse.click(box.x + box.width - 8, box.y + box.height / 2);
|
|
150
153
|
await expect(query).toHaveValue('query');
|
|
151
154
|
});
|
|
155
|
+
test('the dropdown marker of a field with a list sits in its middle', async ({
|
|
156
|
+
page
|
|
157
|
+
}) => {
|
|
158
|
+
// Chromium shows the marker while the pointer is over the field and draws
|
|
159
|
+
// it as a glyph set on the field's line-height, the 1.5 the reset inherits.
|
|
160
|
+
await page.evaluate(() => {
|
|
161
|
+
const field = document.createElement('input');
|
|
162
|
+
field.id = 'fruit';
|
|
163
|
+
field.setAttribute('list', 'fruits');
|
|
164
|
+
const options = document.createElement('datalist');
|
|
165
|
+
options.id = 'fruits';
|
|
166
|
+
options.append(new Option('Apple'));
|
|
167
|
+
document.body.append(field, options);
|
|
168
|
+
});
|
|
169
|
+
await page.addStyleTag({
|
|
170
|
+
content: `
|
|
171
|
+
#fruit {
|
|
172
|
+
display: block;
|
|
173
|
+
width: 240px;
|
|
174
|
+
padding: 7px 11px;
|
|
175
|
+
border: 1px solid;
|
|
176
|
+
line-height: 1.5;
|
|
177
|
+
}
|
|
178
|
+
`
|
|
179
|
+
});
|
|
180
|
+
const field = page.locator('#fruit');
|
|
181
|
+
await field.hover();
|
|
182
|
+
const png = PNG.sync.read(await field.screenshot({
|
|
183
|
+
caret: 'hide'
|
|
184
|
+
}));
|
|
185
|
+
// The marker is the only ink in the field's last 32px, inside the border.
|
|
186
|
+
const inkRows = [];
|
|
187
|
+
for (let y = 2; y < png.height - 2; y++) {
|
|
188
|
+
for (let x = png.width - 32; x < png.width - 2; x++) {
|
|
189
|
+
const offset = (y * png.width + x) * 4;
|
|
190
|
+
const luminance = (png.data[offset] + png.data[offset + 1] + png.data[offset + 2]) / 3;
|
|
191
|
+
if (luminance < 160) {
|
|
192
|
+
inkRows.push(y);
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
expect(inkRows.length, 'the hovered field shows its marker').toBeGreaterThan(0);
|
|
198
|
+
const markerMiddle = (inkRows[0] + inkRows[inkRows.length - 1] + 1) / 2;
|
|
199
|
+
expect(Math.abs(markerMiddle - png.height / 2)).toBeLessThanOrEqual(1);
|
|
200
|
+
});
|
|
152
201
|
test('a later layer and an unlayered rule still override the reset', async ({
|
|
153
202
|
page
|
|
154
203
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plainDate.d.ts","sourceRoot":"","sources":["../../src/utils/plainDate.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAE1C,YAAY,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAE3C,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,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AI,CAAC,qBAGpC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,IAAI,CAAC,qBAI9C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,IAAI,CAAC,qBAAqB,EACnC,MAAM,GAAE,MAAa,GACpB,MAAM,CAKR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,GAAE,MAAa,GAAG,MAAM,CAYpE;AAMD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAC1B,MAAM,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,CAAC;AAExD;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAC7C,OAAO,CAAC,gBAAgB,EAAE,aAAa,CAAC,EACxC,IAAI,CAAC,qBAAqB,CAK3B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,gBAAgB,EACxB,MAAM,GAAE,MAAa,GACpB,MAAM,CAKR"}
|
package/dist/utils/plainDate.js
CHANGED
|
@@ -202,15 +202,21 @@ export function plainDateSetEndOfWeekExclusive(pd, weekStartsOn) {
|
|
|
202
202
|
return plainDateAddDays(plainDateSetStartOfWeek(pd, weekStartsOn), 7);
|
|
203
203
|
}
|
|
204
204
|
export function plainDateGetWeekNumber(pd) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
205
|
+
// ISO week number: ceil(day-of-year of the week's Thursday / 7). Computed
|
|
206
|
+
// entirely on UTC anchors — the same DST immunity plainDateDiffDays relies
|
|
207
|
+
// on — because mixing local-time instants leaks the host zone's DST offset
|
|
208
|
+
// into the day count. When Jan 1 is a Friday (so every Thursday's day-of-year
|
|
209
|
+
// is an exact multiple of 7), a one-hour offset from a zone whose DST ends
|
|
210
|
+
// after New Year rounds a whole week up: Sydney, Auckland and Santiago users
|
|
211
|
+
// saw week 15 for the week that is ISO week 14. utcTime keeps years 1-99
|
|
212
|
+
// as given, like the other Calendar date helpers.
|
|
213
|
+
const msPerDay = 24 * 60 * 60 * 1000;
|
|
214
|
+
const utcMidnight = utcTime(pd.year, pd.month - 1, pd.day);
|
|
215
|
+
const dayNum = new Date(utcMidnight).getUTCDay() || 7;
|
|
216
|
+
const thursday = utcMidnight + (4 - dayNum) * msPerDay;
|
|
217
|
+
const yearStart = utcTime(new Date(thursday).getUTCFullYear(), 0, 1);
|
|
218
|
+
const dayOfYear = (thursday - yearStart) / msPerDay + 1;
|
|
219
|
+
return Math.ceil(dayOfYear / 7);
|
|
214
220
|
}
|
|
215
221
|
|
|
216
222
|
// e.g. "Wednesday, May 21, 2026" (locale-dependent)
|
package/docs.mjs
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* ==========================================================================
|
|
14
14
|
* AI AGENT: do NOT guess component APIs or hand-write CSS. Run:
|
|
15
15
|
* npx @astryxdesign/cli init
|
|
16
|
-
* Use the SCOPED name `@astryxdesign/cli` —
|
|
17
|
-
* unrelated package until the CLI is a dependency. Then, per component:
|
|
16
|
+
* Use the SCOPED name `@astryxdesign/cli` — the unscoped `astryx` resolves to
|
|
17
|
+
* an unrelated npm package until the CLI is a dependency. Then, per component:
|
|
18
18
|
* npx @astryxdesign/cli component <Name>
|
|
19
19
|
* npx @astryxdesign/cli component --list
|
|
20
20
|
* ==========================================================================
|
|
@@ -27,8 +27,8 @@ const BANNER = `
|
|
|
27
27
|
|
|
28
28
|
npx @astryxdesign/cli init
|
|
29
29
|
|
|
30
|
-
(Use the scoped name @astryxdesign/cli.
|
|
31
|
-
unrelated package until the CLI is installed as a dependency.)
|
|
30
|
+
(Use the scoped name @astryxdesign/cli. The unscoped name astryx resolves
|
|
31
|
+
to an unrelated npm package until the CLI is installed as a dependency.)
|
|
32
32
|
|
|
33
33
|
init writes the full component guide, page templates, design rules & tokens
|
|
34
34
|
into your AGENTS.md / CLAUDE.md. Then, for any component:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.7.2
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"displayName": "Astryx Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -792,8 +792,6 @@
|
|
|
792
792
|
"react-dom": ">=19.0.0"
|
|
793
793
|
},
|
|
794
794
|
"devDependencies": {
|
|
795
|
-
"@astryxdesign/a11y-spec": "0.7.2-canary.fe2c655",
|
|
796
|
-
"@astryxdesign/cli": "0.7.2-canary.fe2c655",
|
|
797
795
|
"@babel/cli": "^7.29.7",
|
|
798
796
|
"@babel/core": "^7.29.7",
|
|
799
797
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -804,7 +802,9 @@
|
|
|
804
802
|
"@testing-library/jest-dom": "^6.6.0",
|
|
805
803
|
"@testing-library/react": "^16.3.2",
|
|
806
804
|
"@types/babel__core": "^7.20.5",
|
|
807
|
-
"tailwindcss": "^4.3.2"
|
|
805
|
+
"tailwindcss": "^4.3.2",
|
|
806
|
+
"@astryxdesign/a11y-spec": "0.0.0",
|
|
807
|
+
"@astryxdesign/cli": "0.7.2"
|
|
808
808
|
},
|
|
809
809
|
"dependencies": {
|
|
810
810
|
"intl-messageformat": "^11.2.9"
|