@astryx-vue/core 0.27.0 → 0.28.0

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.
Files changed (143) hide show
  1. package/dist/AlertDialog/index.js +1 -1
  2. package/dist/{AlertDialog-CGGkPG4T.js → AlertDialog-B195FgtL.js} +2 -2
  3. package/dist/AppShell/index.js +1 -1
  4. package/dist/{AppShell-DGJgCvS6.js → AppShell-Da255Ktm.js} +3 -3
  5. package/dist/AvatarGroup/index.d.ts +1 -1
  6. package/dist/Banner/index.d.ts +1 -1
  7. package/dist/BottomSheet/index.d.ts +1 -1
  8. package/dist/Breadcrumbs/index.d.ts +2 -2
  9. package/dist/Breadcrumbs/index.js +2 -2
  10. package/dist/{Breadcrumbs-Bt6Pp3gV.js → Breadcrumbs-CmtcXM4e.js} +1 -1
  11. package/dist/Button/index.d.ts +1 -1
  12. package/dist/ButtonGroup/index.d.ts +1 -1
  13. package/dist/Calendar/index.d.ts +1 -1
  14. package/dist/Carousel/index.d.ts +1 -1
  15. package/dist/Chat/index.d.ts +1 -1
  16. package/dist/Chat/index.js +1 -1
  17. package/dist/CheckboxInput/index.d.ts +1 -1
  18. package/dist/CheckboxList/index.d.ts +1 -1
  19. package/dist/CheckboxList/index.js +1 -1
  20. package/dist/{CheckboxList-CWHlG8Jq.js → CheckboxList-DGM-cgX5.js} +2 -2
  21. package/dist/ClickableCard/index.d.ts +1 -1
  22. package/dist/ClickableCard/index.js +1 -1
  23. package/dist/Collapsible/index.js +1 -1
  24. package/dist/{Collapsible-BSRdsb6w.js → Collapsible-B2vrr_YP.js} +2 -2
  25. package/dist/ComplexSelector/index.js +1 -1
  26. package/dist/{ComplexSelector-DI3J30Ho.js → ComplexSelector-Dq9esodQ.js} +1 -1
  27. package/dist/ContextMenu/index.d.ts +2 -2
  28. package/dist/ContextMenu/index.js +2 -2
  29. package/dist/{ContextMenu-CVf4OqJP.js → ContextMenu-DB4XcNKf.js} +1 -1
  30. package/dist/DateInput/index.d.ts +1 -1
  31. package/dist/DateInput/index.js +1 -1
  32. package/dist/{DateInput-DK-FI37x.js → DateInput-DNqm49AX.js} +1 -1
  33. package/dist/DateRangeInput/index.d.ts +1 -1
  34. package/dist/DateRangeInput/index.js +1 -1
  35. package/dist/{DateRangeInput-ClriBc4F.js → DateRangeInput-Bch513M0.js} +1 -1
  36. package/dist/DateTimeInput/index.d.ts +1 -1
  37. package/dist/DateTimeInput/index.js +1 -1
  38. package/dist/{DateTimeInput-BdXkBBYi.js → DateTimeInput-BCFgCeNy.js} +1 -1
  39. package/dist/Dialog/index.d.ts +1 -1
  40. package/dist/Drawer/index.d.ts +1 -1
  41. package/dist/DropdownMenu/index.d.ts +2 -2
  42. package/dist/DropdownMenu/index.js +3 -3
  43. package/dist/{DropdownMenu-CmbnIRug.js → DropdownMenu-D9swCben.js} +3 -3
  44. package/dist/{DropdownMenu-NIGjTT7o.js → DropdownMenu-DlfMGzZ2.js} +2 -2
  45. package/dist/{DropdownMenuRadioItem.vue-DINRx71W.d.ts → DropdownMenuRadioItem.vue-C8rePTyz.d.ts} +1 -1
  46. package/dist/Heading/index.d.ts +1 -1
  47. package/dist/InfoTip/index.d.ts +1 -1
  48. package/dist/{Item-DUI1Qnnd.js → Item-C8UAQwFQ.js} +193 -111
  49. package/dist/Link/index.d.ts +1 -1
  50. package/dist/List/index.d.ts +2 -2
  51. package/dist/List/index.js +2 -2
  52. package/dist/{ListItem-C8SqSrU6.js → ListItem-BlrEngDO.js} +11 -3
  53. package/dist/Markdown/index.d.ts +1 -1
  54. package/dist/MoreMenu/index.d.ts +1 -1
  55. package/dist/MoreMenu/index.js +1 -1
  56. package/dist/{MoreMenu-vavlbJ-p.js → MoreMenu-GPcHAauX.js} +1 -1
  57. package/dist/MultiSelector/index.d.ts +1 -1
  58. package/dist/NavItem/index.d.ts +1 -1
  59. package/dist/NavItem/index.js +1 -1
  60. package/dist/NumberInput/index.d.ts +1 -1
  61. package/dist/Outline/index.js +1 -1
  62. package/dist/{Outline-DvQbXc_H.js → Outline-DI9MZnuQ.js} +106 -50
  63. package/dist/OverflowList/index.d.ts +1 -1
  64. package/dist/Pagination/index.js +1 -1
  65. package/dist/{Pagination-CRrou1P-.js → Pagination-BNPBvFW1.js} +2 -2
  66. package/dist/Popover/index.d.ts +1 -1
  67. package/dist/Popover/index.js +1 -1
  68. package/dist/{Popover-sERt08TR.js → Popover-MJQZog5m.js} +2 -2
  69. package/dist/PowerSearch/index.d.ts +1 -1
  70. package/dist/PowerSearch/index.js +1 -1
  71. package/dist/{PowerSearch-CUY0iULe.js → PowerSearch-Bv-yUo6C.js} +4 -4
  72. package/dist/Radio/index.d.ts +1 -1
  73. package/dist/RadioList/index.d.ts +1 -1
  74. package/dist/ScrollableArea/index.d.ts +1 -1
  75. package/dist/SelectableCard/index.d.ts +1 -1
  76. package/dist/Selector/index.d.ts +1 -1
  77. package/dist/Selector/index.js +1 -1
  78. package/dist/SideNav/index.d.ts +1 -1
  79. package/dist/SideNav/index.js +2 -2
  80. package/dist/{SideNav-CHSwzwTt.js → SideNav-B_0Fv-ZU.js} +4 -4
  81. package/dist/Stack/index.d.ts +1 -1
  82. package/dist/Switch/index.d.ts +1 -1
  83. package/dist/TabList/index.d.ts +1 -1
  84. package/dist/Table/index.d.ts +1 -1
  85. package/dist/Table/index.js +1 -1
  86. package/dist/{Table-B7MHrvdy.js → Table-B0Aj43zB.js} +7 -7
  87. package/dist/Text/index.d.ts +1 -1
  88. package/dist/TextArea/index.d.ts +1 -1
  89. package/dist/TextInput/index.d.ts +1 -1
  90. package/dist/TimeInput/index.d.ts +1 -1
  91. package/dist/Timer/index.d.ts +1 -1
  92. package/dist/Timestamp/index.d.ts +1 -1
  93. package/dist/ToggleButton/index.d.ts +1 -1
  94. package/dist/Token/index.d.ts +1 -1
  95. package/dist/Toolbar/index.d.ts +1 -1
  96. package/dist/TopNav/index.d.ts +1 -1
  97. package/dist/TopNav/index.js +1 -1
  98. package/dist/{TopNav-Ce79A3zT.js → TopNav-ctvKlpxf.js} +1 -1
  99. package/dist/TreeList/index.js +1 -1
  100. package/dist/{TreeList-BEPHdVYu.js → TreeList-Dh0uAj2B.js} +48 -7
  101. package/dist/{animator-BooLoGyI.js → animator-BGq5a6vT.js} +4 -300
  102. package/dist/{batch-CM-vJhQg.js → batch-BhaAWUIt.js} +3 -2
  103. package/dist/{bezier-Cts7gENO.js → bezier-Df-yGuNZ.js} +1 -90
  104. package/dist/composables/index.js +2 -1
  105. package/dist/{composables-BtqijTIO.js → composables-BTRbNgmR.js} +4 -41
  106. package/dist/{context-DH8E-qjm.js → context-jtpQfR6F.js} +1 -1
  107. package/dist/{edge-BYXwSggM.js → edge-CJIswPTX.js} +1 -1
  108. package/dist/{edgeRide-B5mlN2Q4.js → edgeRide-Drk4V-MC.js} +2 -2
  109. package/dist/{index-X4S7_dmq.d.ts → index-BA8exXNP.d.ts} +1 -1
  110. package/dist/{index-CVNtRsJb.d.ts → index-BLsYMZgA.d.ts} +2 -2
  111. package/dist/{index-BR3MOBYd.d.ts → index-BgT6mH3U.d.ts} +2 -2
  112. package/dist/{index-BD-Pxni9.d.ts → index-BhxqUt3y.d.ts} +1 -1
  113. package/dist/{index-C4EuWBql.d.ts → index-C6IcBhAn.d.ts} +1 -1
  114. package/dist/{index-waTkqxTz.d.ts → index-C89cIh4E.d.ts} +1 -1
  115. package/dist/{index-CiVrhGUJ.d.ts → index-C9ZssPUV.d.ts} +1 -1
  116. package/dist/{index-Cm36VS1A.d.ts → index-C9uW39Mj.d.ts} +1 -1
  117. package/dist/{index-CRtGmCHi.d.ts → index-CEtFUoIm.d.ts} +1 -1
  118. package/dist/{index-B-oy8Ko6.d.ts → index-CMZnO7VU.d.ts} +2 -2
  119. package/dist/{index-BO8V3n98.d.ts → index-CkzTX9pb.d.ts} +38 -38
  120. package/dist/{index-SI2AkpMU.d.ts → index-Ct6SEtjd.d.ts} +1 -1
  121. package/dist/{index-rdwI-mcm.d.ts → index-CtYlR9Cu.d.ts} +1 -1
  122. package/dist/{index-FeZXsFO-.d.ts → index-DDrL_-hJ.d.ts} +1 -1
  123. package/dist/{index-DDVCVpnG.d.ts → index-DE-QPNz0.d.ts} +1 -1
  124. package/dist/{index-BO9TY87G.d.ts → index-DFLPv9io.d.ts} +1 -1
  125. package/dist/{index-CfPgindd.d.ts → index-DIw5D3zj.d.ts} +1 -1
  126. package/dist/index.d.ts +20 -20
  127. package/dist/index.js +31 -30
  128. package/dist/{landing-B9Uvex6x.js → landing-CBaXCGEg.js} +2 -2
  129. package/dist/resolveMotion-CurhYTVC.js +307 -0
  130. package/dist/{themeTiming-CWEvdh31.js → themeTiming-BFDOPRjK.js} +1 -1
  131. package/dist/timing-CSHWQbTJ.js +90 -0
  132. package/dist/{types-Gw2OjSK9.d.ts → types-ClOMFbqC.d.ts} +2 -2
  133. package/dist/useAnimatedLayout-DC2l3WrE.js +40 -0
  134. package/dist/{useMenuDrillIn-CP0P49ej.js → useMenuDrillIn-BQx6lQMz.js} +1 -1
  135. package/package.json +1 -1
  136. package/styles/list.css +102 -5
  137. package/styles/metadata-list.css +6 -1
  138. package/styles/outline.css +2 -1
  139. package/dist/{Chat-RE_6Ez79.js → Chat-Bg1IuDMt.js} +1 -1
  140. package/dist/{ClickableCard-CwGxO0GU.js → ClickableCard-ChmOwgYq.js} +1 -1
  141. package/dist/{NavItem-c1ScHEJY.js → NavItem-kj9FbbFS.js} +1 -1
  142. package/dist/{Selector-Bj4q6aT5.js → Selector-BrNA4sLV.js} +1 -1
  143. package/dist/{index-BqhgeAT4.d.ts → index-CHx33xGa.d.ts} +2 -2
@@ -0,0 +1,307 @@
1
+ import { b as isSpring, h as motionRoleOf, m as motionRoleIn } from "./pressGesture-BzIBmKF2.js";
2
+ //#region src/motion/engine/constants.ts
3
+ const PROPERTIES = [
4
+ "x",
5
+ "y",
6
+ "rotate",
7
+ "scaleX",
8
+ "scaleY",
9
+ "opacity"
10
+ ];
11
+ /** The axes momentum moves: `decay` takes only these (DR2, DEC-2). */
12
+ const DECAY_PROPERTIES = ["x", "y"];
13
+ const IDENTITY = {
14
+ x: 0,
15
+ y: 0,
16
+ rotate: 0,
17
+ scaleX: 1,
18
+ scaleY: 1,
19
+ opacity: 1
20
+ };
21
+ /**
22
+ * Keyframes are added until linear interpolation is within this: a quarter of
23
+ * a device pixel (this quarter of a CSS pixel, divided by the device pixel
24
+ * ratio where it is above 1), a twentieth of a degree, a 2000th of the size,
25
+ * about one step of an 8-bit alpha. Every one is below what a moving element
26
+ * can show.
27
+ */
28
+ const SAMPLE_TOLERANCE = {
29
+ x: .25,
30
+ y: .25,
31
+ rotate: .05,
32
+ scaleX: 5e-4,
33
+ scaleY: 5e-4,
34
+ opacity: .004
35
+ };
36
+ /** Keyframes start on this grid (ms) and are split where the curve needs it. */
37
+ const SAMPLE_GRID_MS = 1e3 / 30;
38
+ /** A curve that has not settled by then (an undamped spring) snaps. */
39
+ const MAX_DURATION_MS = 3e4;
40
+ /**
41
+ * How close a spring's target and a value must be to count as the same, in
42
+ * the property's own units. Only float rounding separates two ways of
43
+ * computing one value, far below anything the screen shows.
44
+ */
45
+ const SAME_VALUE = 1e-6;
46
+ /** Above this many keyframes the tolerance is relaxed. */
47
+ const MAX_KEYFRAMES = 1200;
48
+ /**
49
+ * The keyframes hold the end state this long after a curve ends. An engine
50
+ * whose compositor ends an animation while the main thread is blocked falls
51
+ * back to the value its main thread last committed, the curve's start
52
+ * (WebKit on Linux); the hold keeps the end state on screen through any such
53
+ * block. It only stretches the last keyframe. The main thread retires the
54
+ * animation as soon as it runs after the curve's end.
55
+ *
56
+ * Why a tail inside the curve's own animation, with a bound (measured Oct 24
57
+ * 2026; do not replace it without these proofs):
58
+ * - WebKit on Linux (WebKitGTK and WPE) ignores `fill` on its compositor:
59
+ * a 400 ms move that ends during a 1 s main-thread block snaps back to the
60
+ * block-start position 13 ms after its end, with `fill: forwards` or with
61
+ * no fill, and holds with this tail. iOS 26.2 Mobile Safari holds the end
62
+ * in all three forms, so there the tail is unneeded but harmless (measured
63
+ * Oct 25 2026). The browser proof "a spring that ends inside the block
64
+ * keeps showing its end state" catches it.
65
+ * - A separate static animation of the end state under the curve would hold
66
+ * it without a bound, but two animations on one property push Chromium to
67
+ * run the curve on the main thread: the 1 s block proof moved in 0 of 57
68
+ * frames, the start-before-a-block proof failed, and seeking the curve
69
+ * broke.
70
+ */
71
+ const END_HOLD_MS = 6e4;
72
+ /**
73
+ * The soonest a running animation's end is looked for again, ms: a frame at
74
+ * 60 Hz. WebKit moves an animation's currentTime once per frame, so a look
75
+ * within a frame reads the frame's time, a fraction of a ms short of the end,
76
+ * and a timer for that fraction would fire again before anything moved.
77
+ */
78
+ const END_RECHECK_MS = 1e3 / 60;
79
+ const CHANNELS = {
80
+ translate: ["x", "y"],
81
+ rotate: ["rotate"],
82
+ scale: ["scaleX", "scaleY"],
83
+ opacity: ["opacity"]
84
+ };
85
+ const CHANNEL_OF = {
86
+ x: "translate",
87
+ y: "translate",
88
+ rotate: "rotate",
89
+ scaleX: "scale",
90
+ scaleY: "scale",
91
+ opacity: "opacity"
92
+ };
93
+ /** What `inlineText` writes for each channel at identity. */
94
+ const IDENTITY_TEXT = {
95
+ translate: "none",
96
+ rotate: "none",
97
+ scale: "none",
98
+ opacity: "1"
99
+ };
100
+ /**
101
+ * The transition `decay` hands a Reduce Motion transition curve to: under
102
+ * Reduce Motion `animate` plays no spring (a cross-fade, or at once), so the
103
+ * spring itself is never solved.
104
+ */
105
+ const REDUCED_TRANSITION = { spring: {
106
+ duration: .5,
107
+ bounce: 0
108
+ } };
109
+ //#endregion
110
+ //#region src/motion/engine/cssValues.ts
111
+ function round(value, digits) {
112
+ return Number(value.toFixed(digits));
113
+ }
114
+ function format(channel, value) {
115
+ switch (channel) {
116
+ case "translate": return `${round(value("x"), 3)}px ${round(value("y"), 3)}px`;
117
+ case "rotate": return `${round(value("rotate"), 4)}deg`;
118
+ case "scale": return `${round(value("scaleX"), 5)} ${round(value("scaleY"), 5)}`;
119
+ case "opacity": return `${round(Math.min(1, Math.max(0, value("opacity"))), 4)}`;
120
+ }
121
+ }
122
+ /**
123
+ * Whether a computed value shows `expected` (`format`'s text). An unset or
124
+ * `none` value is the channel's identity. One value of a two-value channel
125
+ * stands for both (scale), or for x with y at 0 (translate).
126
+ */
127
+ function sameShown(channel, shown, expected) {
128
+ const numbers = (text) => {
129
+ const list = ((text === "" || text === "none" ? IDENTITY_TEXT[channel] : text).match(/-?\d*\.?\d+(?:e-?\d+)?/g) ?? []).map(Number);
130
+ if (channel === "translate") return [list[0] ?? 0, list[1] ?? 0];
131
+ if (channel === "scale") return [list[0] ?? 1, list[1] ?? list[0] ?? 1];
132
+ return list.length > 0 ? list : [channel === "opacity" ? 1 : 0];
133
+ };
134
+ const a = numbers(shown);
135
+ const b = numbers(expected);
136
+ return a.length === b.length && a.every((value, i) => Math.abs(value - b[i]) < .001);
137
+ }
138
+ /**
139
+ * The inline text for a channel: `format`, except that an identity transform
140
+ * is written `none`. Any other value, `translate: 0px 0px` included, makes
141
+ * the element the containing block of its `position: fixed` descendants and
142
+ * a stacking context, so a motion back to identity would leave a fixed child
143
+ * moved with its parent; Mobile Safari also lets no finger scroll a list
144
+ * inside an element left at `scale: 1`. At rest the identity leaves the
145
+ * element entirely when its stylesheet agrees (`releaseIdentity`).
146
+ */
147
+ function inlineText(channel, value) {
148
+ const at = (property, identity, digits) => round(value(property), digits) === identity;
149
+ switch (channel) {
150
+ case "translate": return at("x", 0, 3) && at("y", 0, 3) ? "none" : format(channel, value);
151
+ case "rotate": return at("rotate", 0, 4) ? "none" : format(channel, value);
152
+ case "scale": return at("scaleX", 1, 5) && at("scaleY", 1, 5) ? "none" : format(channel, value);
153
+ case "opacity": return format(channel, value);
154
+ }
155
+ }
156
+ /** Whether a computed value (or an unset one) is the channel's identity. */
157
+ function isIdentityText(channel, text) {
158
+ const value = text.trim();
159
+ if (value === "" || value === "none") return true;
160
+ const numbers = value.split(/\s+/).map((part) => Number.parseFloat(part));
161
+ if (numbers.some((number) => !Number.isFinite(number))) return false;
162
+ const identity = channel === "scale" || channel === "opacity" ? 1 : 0;
163
+ return numbers.every((number) => Math.abs(number - identity) < 1e-6);
164
+ }
165
+ function expand(values) {
166
+ const out = {};
167
+ for (const [key, value] of Object.entries(values)) {
168
+ if (value == null || !Number.isFinite(value)) continue;
169
+ if (key === "scale") {
170
+ out.scaleX ??= value;
171
+ out.scaleY ??= value;
172
+ } else if (PROPERTIES.includes(key)) out[key] = value;
173
+ }
174
+ return out;
175
+ }
176
+ /** The time the motion clock reads (`performance.now()`'s time base). */
177
+ function motionNow() {
178
+ return typeof performance === "undefined" ? Date.now() : performance.now();
179
+ }
180
+ /**
181
+ * Whether the user asked for reduced motion (`prefers-reduced-motion:
182
+ * reduce`), read at the moment of the call: the preference the animator uses
183
+ * by default for its Reduce Motion substitution. A component never reads it
184
+ * to pick a curve of its own: its motion settings do not override the
185
+ * policy (design:reduced-motion DR4); `animator.reducedMotion()` or
186
+ * `reducedMotionFade()` gives the policy's answer. False without a window
187
+ * (server rendering).
188
+ */
189
+ function defaultPrefersReducedMotion() {
190
+ return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
191
+ }
192
+ /** Whether the primary pointer is coarse: `(pointer: coarse)`. */
193
+ function defaultIsCoarsePointer() {
194
+ return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(pointer: coarse)").matches;
195
+ }
196
+ /**
197
+ * Registers `name` as an inherited `<length>` (initially 0px) or `<number>`
198
+ * (initially 0) so keyframes interpolate it; an unregistered custom property
199
+ * animates in steps. A property the page already registered is left as it
200
+ * is.
201
+ */
202
+ function registerCustomProperty(name, syntax) {
203
+ if (typeof CSS === "undefined" || typeof CSS.registerProperty !== "function") return;
204
+ try {
205
+ CSS.registerProperty({
206
+ name,
207
+ syntax,
208
+ inherits: true,
209
+ initialValue: syntax === "<length>" ? "0px" : "0"
210
+ });
211
+ } catch (error) {
212
+ if (!(error instanceof DOMException) || error.name !== "InvalidModificationError") throw error;
213
+ }
214
+ }
215
+ function expandList(properties) {
216
+ const out = /* @__PURE__ */ new Set();
217
+ for (const property of properties) if (property === "scale") {
218
+ out.add("scaleX");
219
+ out.add("scaleY");
220
+ } else out.add(property);
221
+ return [...out];
222
+ }
223
+ //#endregion
224
+ //#region src/motion/themeTempo.ts
225
+ /**
226
+ * @file themeTempo.ts
227
+ * @input An element on the page
228
+ * @output `themeTempo(element)`: the tempo of the theme the element is in
229
+ * @position Motion foundation; resolveMotion.ts scales a motion role by it,
230
+ * and the pager scales its settle by it, which no role names
231
+ *
232
+ * A theme that sets `tempo` writes it, clamped, to the private custom
233
+ * property `--_astryx-motion-tempo` beside its duration tokens. An
234
+ * adaptation rule writes it where its condition holds, and a nested theme
235
+ * that sets no tempo inherits it. A layer whose durations come from a
236
+ * duration scale writes a tempo of 1, so its springs keep its own pace. One
237
+ * read of a custom property forces no layout.
238
+ * Nothing here imports a theme module, runs on import or runs on the server.
239
+ */
240
+ /** The property a theme that sets `tempo` writes (theme/themeMotion.ts). */
241
+ const TEMPO_PROPERTY = "--_astryx-motion-tempo";
242
+ /**
243
+ * The tempo motion on `element` plays at: the one its theme or an adaptation
244
+ * rule sets, else 1. Without an element in a document, or with a value that
245
+ * is not a positive number, it is 1.
246
+ */
247
+ function themeTempo(element) {
248
+ const view = element?.ownerDocument?.defaultView;
249
+ if (element == null || view == null) return 1;
250
+ const text = view.getComputedStyle(element).getPropertyValue(TEMPO_PROPERTY).trim();
251
+ const tempo = text === "" ? NaN : Number(text);
252
+ return Number.isFinite(tempo) && tempo > 0 ? tempo : 1;
253
+ }
254
+ //#endregion
255
+ //#region src/motion/resolveMotion.ts
256
+ /**
257
+ * The roles the tempo leaves as measured: the parts that follow a finger,
258
+ * and ProgressBar's busy loop.
259
+ */
260
+ const FIXED_ROLES = /* @__PURE__ */ new Set([
261
+ "springs.fingerTracking",
262
+ "switchControl.tracking",
263
+ "progress.reducedMotionPulseMs"
264
+ ]);
265
+ /** Each role spring at each tempo, so a role resolves to one object per tempo. */
266
+ const springsAtTempo = /* @__PURE__ */ new WeakMap();
267
+ /**
268
+ * `spring` at `tempo`. In each of its forms, the undamped period grows by the
269
+ * tempo and the damping ratio stays. So the motion keeps its shape and takes
270
+ * `tempo` times as long.
271
+ */
272
+ function springAtTempo(spring, tempo) {
273
+ let byTempo = springsAtTempo.get(spring);
274
+ if (byTempo == null) {
275
+ byTempo = /* @__PURE__ */ new Map();
276
+ springsAtTempo.set(spring, byTempo);
277
+ }
278
+ let scaled = byTempo.get(tempo);
279
+ if (scaled == null) {
280
+ if ("response" in spring) scaled = {
281
+ response: spring.response * tempo,
282
+ dampingRatio: spring.dampingRatio
283
+ };
284
+ else if ("duration" in spring) scaled = {
285
+ duration: spring.duration * tempo,
286
+ bounce: spring.bounce
287
+ };
288
+ else scaled = {
289
+ ...spring.mass == null ? null : { mass: spring.mass },
290
+ stiffness: spring.stiffness / (tempo * tempo),
291
+ damping: spring.damping / tempo
292
+ };
293
+ byTempo.set(tempo, scaled);
294
+ }
295
+ return scaled;
296
+ }
297
+ function resolveMotion(element, leafOrGroup, key) {
298
+ const value = key === void 0 ? leafOrGroup : leafOrGroup[key];
299
+ const role = key === void 0 ? motionRoleOf(leafOrGroup) : motionRoleIn(leafOrGroup, key);
300
+ if (role == null || role.kind === "curve" || FIXED_ROLES.has(role.id)) return value;
301
+ const tempo = themeTempo(element);
302
+ if (tempo === 1) return value;
303
+ if (typeof value === "number") return value * tempo;
304
+ return isSpring(value) ? springAtTempo(value, tempo) : value;
305
+ }
306
+ //#endregion
307
+ export { REDUCED_TRANSITION as C, SAMPLE_TOLERANCE as E, PROPERTIES as S, SAMPLE_GRID_MS as T, END_RECHECK_MS as _, expandList as a, MAX_DURATION_MS as b, isIdentityText as c, round as d, sameShown as f, END_HOLD_MS as g, DECAY_PROPERTIES as h, expand as i, motionNow as l, CHANNEL_OF as m, defaultIsCoarsePointer as n, format as o, CHANNELS as p, defaultPrefersReducedMotion as r, inlineText as s, resolveMotion as t, registerCustomProperty as u, IDENTITY as v, SAME_VALUE as w, MAX_KEYFRAMES as x, IDENTITY_TEXT as y };
@@ -1,5 +1,5 @@
1
1
  import { _ as parseMotionRoleValue, g as parseCssEasing } from "./pressGesture-BzIBmKF2.js";
2
- import { t as cubicBezier } from "./bezier-Cts7gENO.js";
2
+ import { t as cubicBezier } from "./bezier-Df-yGuNZ.js";
3
3
  import { n as easeDefaults, t as durationDefaults } from "./motionTokenDefaults-EFzpiAF5.js";
4
4
  import { n as normalizeTokenName } from "./tokenName-0U-WEH09.js";
5
5
  //#region src/Theme/tokenReferences.ts
@@ -0,0 +1,90 @@
1
+ import { v as registerMotionTable } from "./pressGesture-BzIBmKF2.js";
2
+ //#region src/motion/reducedMotionMark.ts
3
+ /**
4
+ * @file reducedMotionMark.ts
5
+ * @input Whether a theme reduces motion for everyone
6
+ * @output reducedMotionMarkProps and setRootReducedMotionMark, which write the
7
+ * mark, and themeReducesMotion, which reads it
8
+ * @position Owner module of the private reduced-motion attribute: the only
9
+ * file that writes its name. A theme that reduces motion for everyone
10
+ * spreads the mark on its root, and the root theme sets it on `<html>`; the
11
+ * animator and reducedMotionFade read it as the person's Reduce Motion
12
+ * setting. No package entry exports it.
13
+ */
14
+ const REDUCED_MOTION = "data-astryx-reduced-motion";
15
+ /**
16
+ * Whether the theme `element` is in reduces motion for everyone: its root,
17
+ * or `<html>` for the root theme, carries the mark.
18
+ */
19
+ function themeReducesMotion(element) {
20
+ return element?.closest?.(`[${REDUCED_MOTION}]`) != null;
21
+ }
22
+ //#endregion
23
+ //#region src/motion/uikit/timing.ts
24
+ /**
25
+ * @file timing.ts
26
+ * @input Nothing; data only
27
+ * @output Exports `timing`: the non-spring clocks and curves UIKit uses
28
+ * (press highlight onset, flash and fade, Core Animation's named Bézier
29
+ * curves, the navigation bar hide/show duration, the keyboard
30
+ * notification duration, the Reduced Motion cross-fade)
31
+ * @position The timing domain of the UIKit constants table (motion/uikit)
32
+ *
33
+ * Every leaf carries one or more `@source` (apple-docs | wwdc | webkit |
34
+ * measured | GUESS); webkit and GUESS values also carry the `@measure` task
35
+ * that will confirm or replace them (MEASUREMENTS.md). uikit.test.ts
36
+ * enforces both.
37
+ *
38
+ * Durations are in ms (the unit of pointer-event timestamps, which these
39
+ * clocks are compared against); curves are cubic-bézier control points
40
+ * [x1, y1, x2, y2].
41
+ */
42
+ /**
43
+ * The Reduce Motion fade, its own export so the animator reads it without
44
+ * the rest of the table (`architecture:component-style-authoring` INV6).
45
+ * `timing` composes it under its table paths, `reducedMotionCrossFadeMs` and
46
+ * `curves.move`, so their roles are unchanged.
47
+ */
48
+ const reducedMotionCrossFade = {
49
+ /**
50
+ * The Reduced Motion cross-fade, in ms, on `curves.move`: under
51
+ * Reduce Motion an entrance, exit, presentation switch or state change
52
+ * becomes an opacity-only cross-fade of this length on a coarse pointer
53
+ * (design:reduced-motion DR2 caps it at 200 ms, by owner decision DEC-1
54
+ * of 2026-10-24, departing from UIKit's own navigation cross-fade,
55
+ * measured below at 0.5 s). Not a role: nothing lengthens it (DR4).
56
+ * @source apple-docs https://developer.apple.com/documentation/uikit/uiaccessibility/preferscrossfadetransitions
57
+ * (the setting)
58
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
59
+ * iPhone 17 Pro, CAAnimation dump with Reduce Motion and Prefer
60
+ * Cross-Fade Transitions on (opacity CABasicAnimation 0.5 s,
61
+ * (0.42, 0, 0.58, 1)), Oct 23 2026
62
+ */
63
+ durationMs: 200,
64
+ /**
65
+ * `easeInEaseOut`; UIKit's default curve (`UIView.AnimationCurve
66
+ * .easeInOut`, "the default curve for most animations").
67
+ * @source apple-docs https://developer.apple.com/documentation/quartzcore/camediatimingfunctionname/easeineaseout
68
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
69
+ * iPhone 17 Pro, CAMediaTimingFunction read from UIView.animate,
70
+ * Oct 23 2026
71
+ */
72
+ curve: [
73
+ .42,
74
+ 0,
75
+ .58,
76
+ 1
77
+ ]
78
+ };
79
+ const { durationMs: reducedMotionCrossFadeMs, curve: move } = reducedMotionCrossFade;
80
+ const reducedMotionCrossFadeRoles = { curves: { move } };
81
+ /**
82
+ * Registers only the Reduce Motion fade's curve as its role,
83
+ * `timing.curves.move`, for code that reads the fade without the rest of the
84
+ * table (the animator, reducedMotionFade()). The fade's length is not a role.
85
+ */
86
+ function registerReducedMotionCrossFade() {
87
+ registerMotionTable("timing", reducedMotionCrossFadeRoles, { roles: ["curves.move"] });
88
+ }
89
+ //#endregion
90
+ export { registerReducedMotionCrossFade as n, themeReducesMotion as r, reducedMotionCrossFade as t };
@@ -193,13 +193,13 @@ interface ListItemProps {
193
193
  swipeBehavior?: ItemSwipeBehavior;
194
194
  }
195
195
  interface ListItemSlots {
196
- /** Leading content before the label: an icon, an avatar, a checkbox. */
196
+ /** Content before the label, inside the row: an icon, an avatar, a checkbox. */
197
197
  startContent?: () => VNodeChild;
198
198
  /** Rich content replacing the `label` prop. */
199
199
  label?: () => VNodeChild;
200
200
  /** Rich content replacing the `description` prop. */
201
201
  description?: () => VNodeChild;
202
- /** Trailing content after the label area: a badge, a timestamp, a chevron. */
202
+ /** Content after the label and description, inside the row: a badge, a timestamp, a chevron. */
203
203
  endContent?: () => VNodeChild;
204
204
  }
205
205
  interface ItemProps extends ListItemProps {
@@ -0,0 +1,40 @@
1
+ import { n as createAnimatedLayout } from "./handle-BazRxHwq.js";
2
+ import { toValue } from "vue";
3
+ //#region src/composables/useAnimatedLayout.ts
4
+ function elementOf(value) {
5
+ if (value == null) return null;
6
+ if (typeof Element !== "undefined" && value instanceof Element) return value;
7
+ const root = value.$el;
8
+ return typeof Element !== "undefined" && root instanceof Element ? root : null;
9
+ }
10
+ /**
11
+ * 返回一个句柄,交给尺寸会变的组件(例如 TreeList、Collapsible)。组件尺寸变化时,
12
+ * 它和 `containerRef` 里排在它后面的内容按同一条动效一起滑到新位置。固定定位和吸住的
13
+ * 粘性元素不动,滑动从不滚动容器,并遵从「减少动态效果」。
14
+ *
15
+ * 容器在变化发生时才读,所以句柄只创建一次,之后 ref 指向别的元素也能读到。
16
+ * 句柄没有公开成员。服务端渲染时不碰 DOM。
17
+ *
18
+ * @example
19
+ * ```vue
20
+ * <script setup lang="ts">
21
+ * import { useAnimatedLayout } from '@astryx-vue/core'
22
+ * import { useTemplateRef } from 'vue'
23
+ *
24
+ * const container = useTemplateRef<HTMLElement>('container')
25
+ * const animatedLayout = useAnimatedLayout({ containerRef: container })
26
+ * <\/script>
27
+ *
28
+ * <template>
29
+ * <div ref="container">
30
+ * <TreeList :items="items" :animated-layout="animatedLayout" />
31
+ * <p>备注</p>
32
+ * </div>
33
+ * </template>
34
+ * ```
35
+ */
36
+ function useAnimatedLayout({ containerRef }) {
37
+ return createAnimatedLayout(() => elementOf(toValue(containerRef)));
38
+ }
39
+ //#endregion
40
+ export { useAnimatedLayout as t };
@@ -1,7 +1,7 @@
1
1
  import { n as readLayerScoped, t as defineLayerScopedKey } from "./scopedProvide-C-Df7c15.js";
2
2
  import { t as _sfc_main$4 } from "./Icon-Dk0jccgU.js";
3
3
  import { o as useComponentMessages } from "./context-B8IEFCDR.js";
4
- import { t as _sfc_main$5 } from "./Item-DUI1Qnnd.js";
4
+ import { t as _sfc_main$5 } from "./Item-C8UAQwFQ.js";
5
5
  import { t as _sfc_main$6 } from "./CheckboxIndicator-fH4d-JE1.js";
6
6
  import { a as useCompactDefinition, r as readCompactTouch } from "./presentationHold-7IkbR4d8.js";
7
7
  import { t as dropdownMenuMessages } from "./dropdown-menu-BDu4gWwQ.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astryx-vue/core",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "Vue 3 components for the unofficial astryx-vue port of Astryx. Not affiliated with Meta.",
6
6
  "author": "ShenQingchuan",
7
7
  "license": "MIT",
package/styles/list.css CHANGED
@@ -20,11 +20,49 @@
20
20
  margin: 0;
21
21
  padding-inline-start: 0;
22
22
  overflow-inline: clip;
23
+ /* 行的热区只在列表里抬高,不会盖过页面上吸顶的头部。 */
24
+ isolation: isolate;
23
25
  list-style-type: none;
24
26
  }
25
27
 
26
28
  .astryx-list[data-dividers='true'] {
27
- gap: 0;
29
+ row-gap: 0;
30
+ }
31
+
32
+ /*
33
+ * 有序列表的行共用一列标记:列表是两列的网格(标记按内容宽度,其余占满),
34
+ * 每行用子网格接上这两列,数字位数变了,别的行的文字和嵌套列表也不动。
35
+ * 不支持子网格时保持弹性布局。
36
+ */
37
+ @supports (grid-template-columns: subgrid) {
38
+ .astryx-list[data-list-style='decimal'] {
39
+ display: grid;
40
+ grid-template-columns: max-content minmax(0, 1fr);
41
+ column-gap: var(--astryx-spacing-2, 8px);
42
+ }
43
+
44
+ .astryx-list[data-list-style='decimal'] > .astryx-list-item {
45
+ grid-column: 1 / -1;
46
+ }
47
+
48
+ .astryx-list[data-list-style='decimal'] > .astryx-list-item:not(.astryx-item--swipe):has(> .astryx-item__marker-content) {
49
+ display: grid;
50
+ grid-template-columns: subgrid;
51
+ }
52
+ }
53
+
54
+ /* 标记之外的内容在同一格里,仍沿用行的对齐和间距。 */
55
+ .astryx-item__marker-content {
56
+ display: flex;
57
+ flex: 1;
58
+ align-items: inherit;
59
+ align-self: stretch;
60
+ gap: inherit;
61
+ min-width: 0;
62
+ }
63
+
64
+ .astryx-item[data-align='first-line'] > .astryx-item__marker-content {
65
+ align-self: baseline;
28
66
  }
29
67
 
30
68
  .astryx-list:not([data-list-style='none']) {
@@ -92,6 +130,36 @@
92
130
  padding-inline-end: max(var(--container-padding-inline-end, 0px), var(--astryx-item-inset-inline));
93
131
  }
94
132
 
133
+ /*
134
+ * 粗指针下,可点的行朝相邻行留出的空隙长出热区。后面的行是没有 z-index 的定位元素,
135
+ * 会盖住前面行的热区,所以热区抬高一层。有分隔线时热区从分隔线外缘起算(最后一行没有分隔线)。
136
+ */
137
+ @media (pointer: coarse) {
138
+ .astryx-list > .astryx-list-item.astryx-touch-hit-area-band::after {
139
+ z-index: 1;
140
+ }
141
+
142
+ .astryx-list[data-dividers='true'] > .astryx-list-item.astryx-touch-hit-area-band:not(:last-child)::after {
143
+ margin-block-end: calc(var(--astryx-border-width, 1px) * -1);
144
+ }
145
+ }
146
+
147
+ /*
148
+ * 圆角卡片、对话框里,作为它第一个或最后一个子元素的 `bleed` 列表:首行、末行取容器
149
+ * 发布的圆角,减去自己保留的块方向内边距(行的底色和焦点环不被容器的弧线裁掉)。
150
+ * 有标题时列表的根是容器的子元素,头部在首行上面,所以只有末行取角。其余的角保持直角。
151
+ */
152
+ :is(.astryx-card, .astryx-dialog__inner) > .astryx-list[data-edge='bleed']:first-child > .astryx-list-item:first-child {
153
+ border-start-start-radius: max(0px, var(--_container-corner-block-start, 0px) - var(--container-padding-block-start, 0px));
154
+ border-start-end-radius: max(0px, var(--_container-corner-block-start, 0px) - var(--container-padding-block-start, 0px));
155
+ }
156
+
157
+ :is(.astryx-card, .astryx-dialog__inner) > .astryx-list[data-edge='bleed']:last-child > .astryx-list-item:last-child,
158
+ :is(.astryx-card, .astryx-dialog__inner) > .astryx-list-root:last-child > .astryx-list[data-edge='bleed'] > .astryx-list-item:last-child {
159
+ border-end-start-radius: max(0px, var(--_container-corner-block-end, 0px) - var(--container-padding-block-end, 0px));
160
+ border-end-end-radius: max(0px, var(--_container-corner-block-end, 0px) - var(--container-padding-block-end, 0px));
161
+ }
162
+
95
163
  .astryx-list-marker {
96
164
  box-sizing: border-box;
97
165
  display: flex;
@@ -123,15 +191,21 @@
123
191
  .astryx-list-marker__number {
124
192
  flex-shrink: 0;
125
193
  align-self: baseline;
126
- width: var(--astryx-spacing-4, 16px);
194
+ /* 数字右对齐、等宽,每个句点都在一条线上;比这一列更宽的数字先挂进行的内边距,再撑宽整列。 */
195
+ min-width: var(--astryx-spacing-4, 16px);
127
196
  color: var(--astryx-list-marker-foreground, light-dark(#171717, #fafafa));
128
197
  font-size: var(--astryx-text-body-size, 0.875rem);
198
+ font-variant-numeric: tabular-nums;
129
199
  line-height: var(--astryx-text-body-leading, 1.4286);
130
200
  display: flex;
131
201
  justify-content: flex-end;
132
202
  white-space: nowrap;
133
203
  }
134
204
 
205
+ .astryx-list-marker__number::before {
206
+ margin-inline-start: calc(-1 * var(--astryx-item-inset-inline, 8px));
207
+ }
208
+
135
209
  .astryx-list-marker__number[data-style='decimal']::before {
136
210
  content: counter(astryx-list) '.';
137
211
  }
@@ -221,10 +295,32 @@
221
295
  }
222
296
  }
223
297
 
224
- .astryx-item[data-astryx-press]:not([data-disabled='true']):not([data-selected='true']) {
298
+ .astryx-item[data-astryx-press]:not([data-disabled='true']) {
225
299
  background-image: var(--_press-paint-image);
226
300
  }
227
301
 
302
+ /*
303
+ * 选中行保留自己的底色,悬停和按下的色调作为图片层叠在上面。
304
+ * 高亮行的底色本来就是悬停色,只表现按下。
305
+ */
306
+ @media (hover: hover) {
307
+ .astryx-item[data-interactive='true'][data-selected='true']:not([data-disabled='true']):hover {
308
+ background-image: linear-gradient(
309
+ var(--astryx-list-item-hover-background, light-dark(#0536590c, #ffffff0c)),
310
+ var(--astryx-list-item-hover-background, light-dark(#0536590c, #ffffff0c))
311
+ );
312
+ }
313
+ }
314
+
315
+ @media not all and (pointer: coarse) {
316
+ .astryx-item[data-interactive='true'][data-selected='true']:not([data-disabled='true']):active {
317
+ background-image: linear-gradient(
318
+ var(--astryx-list-item-pressed-background, light-dark(#05365919, #ffffff19)),
319
+ var(--astryx-list-item-pressed-background, light-dark(#05365919, #ffffff19))
320
+ );
321
+ }
322
+ }
323
+
228
324
  /*
229
325
  * 行只为自己的按钮或链接画环;委托模式下嵌套控件就是行的唯一 Tab 停点,照旧画在行上。
230
326
  * 起止插槽里的其他控件自己画环,同一次聚焦不会出现两个环。
@@ -314,7 +410,8 @@
314
410
  position: relative;
315
411
  overflow: clip;
316
412
  padding: 0;
317
- touch-action: pan-y;
413
+ /* pan-y 让浏览器继续滚动列表;pinch-zoom 把双指缩放留给浏览器,页面仍可缩放。 */
414
+ touch-action: pan-y pinch-zoom;
318
415
  --_item-swipe-dir: 1;
319
416
  --_item-swipe-travel: 0;
320
417
  --_item-swipe-duration: 0s;
@@ -394,7 +491,7 @@
394
491
  color: var(--astryx-color-on-error, #fff);
395
492
  }
396
493
 
397
- .astryx-item__swipe-action:disabled {
494
+ .astryx-item__swipe-action[aria-disabled='true'] {
398
495
  opacity: 0.5;
399
496
  cursor: default;
400
497
  }
@@ -77,11 +77,16 @@
77
77
  font-size: var(--astryx-text-body-size, 1rem);
78
78
  line-height: var(--astryx-text-body-leading, 1.5);
79
79
  overflow-wrap: break-word;
80
- word-break: break-word;
81
80
  }
82
81
 
82
+ /*
83
+ * 标签的单词比一列还长时在列内折断。值只在单词比一行还长时才折断:
84
+ * 用 overflow-wrap 而不是 word-break,值的最窄宽度仍是最长的单词,
85
+ * 一行里并排的金额和说明不会被挤到一个字符一行。
86
+ */
83
87
  .astryx-metadata-list__label,
84
88
  .astryx-metadata-list__item-label {
89
+ word-break: break-word;
85
90
  display: flex;
86
91
  align-items: center;
87
92
  gap: var(--astryx-spacing-2, 8px);
@@ -117,7 +117,8 @@
117
117
  }
118
118
 
119
119
  @media (prefers-reduced-motion: reduce) {
120
- .astryx-outline__indicator {
120
+ .astryx-outline__indicator,
121
+ .astryx-outline__link {
121
122
  transition: none;
122
123
  }
123
124
  }