@astryx-vue/core 0.17.0 → 0.19.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 (122) hide show
  1. package/dist/AvatarGroup/index.d.ts +1 -1
  2. package/dist/Banner/index.d.ts +1 -1
  3. package/dist/BottomSheet/index.d.ts +1 -1
  4. package/dist/ButtonGroup/index.d.ts +1 -1
  5. package/dist/Calendar/index.d.ts +1 -1
  6. package/dist/Calendar/index.js +1 -1
  7. package/dist/{Calendar-Bk2nGoT-.js → Calendar-DSRNuw3y.js} +37 -13
  8. package/dist/Carousel/index.d.ts +1 -1
  9. package/dist/Center/index.d.ts +1 -1
  10. package/dist/Chat/index.js +1 -1
  11. package/dist/{Chat-Wq7e98zS.js → Chat-CXwXzlZ0.js} +1 -1
  12. package/dist/CheckboxInput/index.d.ts +1 -1
  13. package/dist/CheckboxList/index.d.ts +1 -1
  14. package/dist/ClickableCard/index.d.ts +1 -1
  15. package/dist/Collapsible/index.d.ts +1 -1
  16. package/dist/Collapsible/index.js +1 -1
  17. package/dist/{Collapsible-Dk9BQQbT.js → Collapsible-ExzU7vC0.js} +104 -40
  18. package/dist/ContextMenu/index.d.ts +1 -1
  19. package/dist/DateInput/index.d.ts +1 -1
  20. package/dist/DateInput/index.js +1 -1
  21. package/dist/{DateInput-BitZfGEY.js → DateInput-s2H0orUW.js} +3 -3
  22. package/dist/DateRangeInput/index.d.ts +1 -1
  23. package/dist/DateRangeInput/index.js +1 -1
  24. package/dist/{DateRangeInput-kxXBsUTU.js → DateRangeInput-Dn9I2PMM.js} +7 -7
  25. package/dist/DateTimeInput/index.d.ts +1 -1
  26. package/dist/DateTimeInput/index.js +1 -1
  27. package/dist/{DateTimeInput-Cfkuec_h.js → DateTimeInput-BR_tdURg.js} +47 -17
  28. package/dist/Dialog/index.d.ts +1 -1
  29. package/dist/Drawer/index.d.ts +1 -1
  30. package/dist/FileInput/index.d.ts +1 -1
  31. package/dist/HoverCard/index.d.ts +1 -1
  32. package/dist/HoverCard/index.js +1 -1
  33. package/dist/{HoverCard-DVPLeccv.js → HoverCard-FHYH3VXg.js} +50 -2
  34. package/dist/InfoTip/index.d.ts +1 -1
  35. package/dist/InternationalizationProvider/index.d.ts +1 -1
  36. package/dist/InternationalizationProvider/index.js +1 -1
  37. package/dist/{InternationalizationProvider-Dr5GE6f0.js → InternationalizationProvider-Ddo_-tLK.js} +1 -1
  38. package/dist/Link/index.d.ts +1 -1
  39. package/dist/{MediaTheme-Bkj-_DFN.js → MediaTheme-DfcdEWx-.js} +2 -36
  40. package/dist/MoreMenu/index.d.ts +1 -1
  41. package/dist/MultiSelector/index.d.ts +1 -1
  42. package/dist/NumberInput/index.d.ts +1 -1
  43. package/dist/NumberInput/index.js +1 -1
  44. package/dist/{NumberInput-BPeesTRv.js → NumberInput-BsWTXomE.js} +2 -23
  45. package/dist/OverflowList/index.d.ts +1 -1
  46. package/dist/PowerSearch/index.d.ts +1 -1
  47. package/dist/PowerSearch/index.js +1 -1
  48. package/dist/{PowerSearch-BAOqpQag.js → PowerSearch-CDEn08Pe.js} +6 -6
  49. package/dist/Radio/index.d.ts +1 -1
  50. package/dist/RadioList/index.d.ts +1 -1
  51. package/dist/ScrollableArea/index.d.ts +1 -1
  52. package/dist/SelectableCard/index.d.ts +1 -1
  53. package/dist/Selector/index.d.ts +1 -1
  54. package/dist/SideNav/index.d.ts +1 -1
  55. package/dist/Switch/index.d.ts +1 -1
  56. package/dist/Table/index.d.ts +1 -1
  57. package/dist/Table/index.js +1 -1
  58. package/dist/{Table-CRKljXg4.js → Table-WukSceMV.js} +376 -5
  59. package/dist/TextArea/index.d.ts +1 -1
  60. package/dist/TextInput/index.d.ts +1 -1
  61. package/dist/Theme/index.js +3 -2
  62. package/dist/{Theme-iqi6AvU_.js → Theme-1RJVaRgz.js} +3 -38
  63. package/dist/{TimeField-CBWgdA1Y.js → TimeField-BM-rVFhC.js} +419 -140
  64. package/dist/TimeInput/index.d.ts +2 -2
  65. package/dist/TimeInput/index.js +1 -1
  66. package/dist/{TimeInput-8ASOMV3B.js → TimeInput-CkZfhhAr.js} +28 -8
  67. package/dist/Timer/index.d.ts +1 -1
  68. package/dist/Timer/index.js +1 -1
  69. package/dist/{Timer-C8evnsTE.js → Timer-DiIs5GLA.js} +24 -15
  70. package/dist/Timestamp/index.d.ts +1 -1
  71. package/dist/Timestamp/index.js +1 -1
  72. package/dist/{Timestamp-CgvZe6vH.js → Timestamp-D9Jyk9sD.js} +152 -96
  73. package/dist/Toast/index.js +1 -1
  74. package/dist/{Toast-CzbqvHDN.js → Toast-D4Q6wvYu.js} +1 -1
  75. package/dist/ToggleButton/index.d.ts +1 -1
  76. package/dist/Token/index.d.ts +1 -1
  77. package/dist/Toolbar/index.d.ts +1 -1
  78. package/dist/Tooltip/index.d.ts +1 -1
  79. package/dist/TopNav/index.d.ts +1 -1
  80. package/dist/TreeList/index.d.ts +1 -1
  81. package/dist/TreeList/index.js +1 -1
  82. package/dist/{TreeList-CNj4KnHH.js → TreeList-ugSF9DWj.js} +117 -2
  83. package/dist/composables/index.d.ts +3 -2
  84. package/dist/composables/index.js +3 -3
  85. package/dist/{composables-BKHcPgN0.js → composables-BgfubKnk.js} +39 -332
  86. package/dist/{format-CMHyAMn3.js → format-mffyPc-L.js} +34 -4
  87. package/dist/handle-BPXdHbkr.js +458 -0
  88. package/dist/{index-9eluGe3a.d.ts → index-BA8exXNP.d.ts} +2 -1
  89. package/dist/{index-tuNsmJxw.d.ts → index-BLnvQ4Oj.d.ts} +9 -2
  90. package/dist/{index-B0iRA00v.d.ts → index-BapQGST1.d.ts} +2 -2
  91. package/dist/{index-D31bgBoy.d.ts → index-BdZCLUgY.d.ts} +1 -1
  92. package/dist/{index-DK0Wdo9N.d.ts → index-C9OzEvE_.d.ts} +3 -3
  93. package/dist/{index-CbA8rR_b.d.ts → index-CBOv5j3c.d.ts} +1 -1
  94. package/dist/{index-CMLnSg3T.d.ts → index-CKnr0JlT.d.ts} +7 -0
  95. package/dist/{index-C1qJlC65.d.ts → index-CQ-sq76o.d.ts} +1 -1
  96. package/dist/{index-85RFPeV0.d.ts → index-CULdl3Dg.d.ts} +3 -3
  97. package/dist/{index-BxWCX2pJ.d.ts → index-DFLPv9io.d.ts} +3 -3
  98. package/dist/{index-DofC9Rll.d.ts → index-Otl047R1.d.ts} +1 -1
  99. package/dist/{index-BKnyTWPM.d.ts → index-ZbNwGVkS.d.ts} +1 -1
  100. package/dist/{index-DYabo8TI.d.ts → index-eCp-ElSp.d.ts} +1 -1
  101. package/dist/{index-B95VIgRl.d.ts → index-t27MvEzT.d.ts} +70 -23
  102. package/dist/{index-wY6dKz6c.d.ts → index-yQc-te9a.d.ts} +7 -0
  103. package/dist/index.d.ts +19 -18
  104. package/dist/index.js +25 -24
  105. package/dist/landing-Bs0aMIsR.js +2049 -0
  106. package/dist/{loadCatalog-BJwcyX8i.d.ts → loadCatalog-C4h9SmJs.d.ts} +2 -0
  107. package/dist/{loadCatalog-C1kms5sO.js → loadCatalog-DsEKSY3U.js} +5 -1
  108. package/dist/locale/index.d.ts +2 -2
  109. package/dist/locale/index.js +4 -4
  110. package/dist/{locale-CHhsd9Mq.js → locale-C-Y-13BP.js} +1 -1
  111. package/dist/motionTokenDefaults-EFzpiAF5.js +38 -0
  112. package/dist/timeFormat-CqrwFE42.js +203 -0
  113. package/dist/{timestamp-BMYQsFDj.js → timestamp-saJUedIU.js} +4 -2
  114. package/dist/tokenName-0U-WEH09.js +36 -0
  115. package/dist/unicodeDigits-_BYIJcAu.js +46 -0
  116. package/dist/useAnimatedLayout-C0koWm4a.d.ts +56 -0
  117. package/dist/{useTimeValue-_XW9g2V1.js → useTimeValue-CcKrnO8z.js} +13 -6
  118. package/package.json +1 -1
  119. package/styles/calendar.css +5 -1
  120. package/styles/table.css +19 -0
  121. package/styles/timestamp.css +22 -10
  122. package/dist/{index-D8lv2BiD.d.ts → index-J6YRJ7Ul.d.ts} +1 -1
@@ -0,0 +1,458 @@
1
+ //#region src/motion/reducedMotionMark.ts
2
+ /**
3
+ * @file reducedMotionMark.ts
4
+ * @input Whether a theme reduces motion for everyone
5
+ * @output reducedMotionMarkProps and setRootReducedMotionMark, which write the
6
+ * mark, and themeReducesMotion, which reads it
7
+ * @position Owner module of the private reduced-motion attribute: the only
8
+ * file that writes its name. A theme that reduces motion for everyone
9
+ * spreads the mark on its root, and the root theme sets it on `<html>`; the
10
+ * animator and reducedMotionFade read it as the person's Reduce Motion
11
+ * setting. No package entry exports it.
12
+ */
13
+ const REDUCED_MOTION = "data-astryx-reduced-motion";
14
+ /**
15
+ * Whether the theme `element` is in reduces motion for everyone: its root,
16
+ * or `<html>` for the root theme, carries the mark.
17
+ */
18
+ function themeReducesMotion(element) {
19
+ return element?.closest?.(`[${REDUCED_MOTION}]`) != null;
20
+ }
21
+ //#endregion
22
+ //#region src/utils/sharedRealm.ts
23
+ /**
24
+ * 对应原版 Astryx 的 `utils/sharedRealm`。
25
+ *
26
+ * 整个 JavaScript 运行环境里按键共享一份值:页面上同时加载了两份 core(比如包本身和一份复制进项目的副本)时,
27
+ * 两边拿同一个键读到的是同一份值。不碰 DOM,服务端也能用。
28
+ */
29
+ /**
30
+ * 共享值的注册键。版本号表示值的形状:形状变了、旧副本读不懂新值时就升版本,
31
+ * 两边各用各的。
32
+ */
33
+ function sharedKey(name, version) {
34
+ return Symbol.for(`@astryx-vue/core/${name}/v${version}`);
35
+ }
36
+ /**
37
+ * `key` 下的共享值,第一次用时创建。
38
+ * `accepts` 防键撞车:它不认的值原样留着,这一份自己另建一个。
39
+ */
40
+ function realmValue(key, create, accepts = () => true) {
41
+ const realm = globalThis;
42
+ if (Object.hasOwn(realm, key)) {
43
+ const existing = realm[key];
44
+ return accepts(existing) ? existing : create();
45
+ }
46
+ const value = create();
47
+ realm[key] = value;
48
+ return value;
49
+ }
50
+ /**
51
+ * 按注册名在整页共享一份值:计数器、开关,或装着几样东西的对象。
52
+ * 名字写成 `<目录>/<文件>/<绑定名>`(短横线小写),值的形状变了就升版本。
53
+ */
54
+ function sharedState(name, version, create) {
55
+ return realmValue(sharedKey(name, version), create);
56
+ }
57
+ /** 按注册名共享的 Map。 */
58
+ function sharedMap(name, version) {
59
+ return sharedState(name, version, () => /* @__PURE__ */ new Map());
60
+ }
61
+ /** 按注册名共享的 WeakMap,例如按文档存的状态。 */
62
+ function sharedWeakMap(name, version) {
63
+ return sharedState(name, version, () => /* @__PURE__ */ new WeakMap());
64
+ }
65
+ /** 按注册名共享的 WeakSet,例如登记过的值。 */
66
+ function sharedWeakSet(name, version) {
67
+ return sharedState(name, version, () => /* @__PURE__ */ new WeakSet());
68
+ }
69
+ //#endregion
70
+ //#region src/motion/presentation.ts
71
+ const presented = realmValue(sharedKey("motion/presentation", 1), () => ({
72
+ sources: /* @__PURE__ */ new Map(),
73
+ watchers: /* @__PURE__ */ new Set(),
74
+ batchDepth: 0,
75
+ isChanged: false
76
+ }));
77
+ const { sources, watchers } = presented;
78
+ /** Tell every watcher the reported elements changed; one's throw stops none. */
79
+ function notifyWatchers() {
80
+ if (presented.batchDepth > 0) {
81
+ presented.isChanged = true;
82
+ return;
83
+ }
84
+ for (const watcher of [...watchers]) try {
85
+ watcher();
86
+ } catch (error) {
87
+ queueMicrotask(() => {
88
+ throw error;
89
+ });
90
+ }
91
+ }
92
+ /**
93
+ * Runs `apply`, which reports elements or removes reports, and tells the
94
+ * watchers once, at its end, when the reported elements changed. So the
95
+ * moves of one layout change cost one notice.
96
+ */
97
+ function batchPresented(apply) {
98
+ presented.batchDepth += 1;
99
+ try {
100
+ apply();
101
+ } finally {
102
+ presented.batchDepth -= 1;
103
+ if (presented.batchDepth === 0 && presented.isChanged) {
104
+ presented.isChanged = false;
105
+ notifyWatchers();
106
+ }
107
+ }
108
+ }
109
+ /**
110
+ * Report an element drawn away from where the engine hit-tests it. Returns
111
+ * the function that removes the report.
112
+ */
113
+ function registerPresentedOffset(element, source) {
114
+ sources.set(element, source);
115
+ notifyWatchers();
116
+ return () => {
117
+ if (sources.get(element) === source) {
118
+ sources.delete(element);
119
+ notifyWatchers();
120
+ }
121
+ };
122
+ }
123
+ /** The custom property whose writes make WebKit resolve a moving element. */
124
+ const RESOLVE_PROPERTY = "--astryx-presented";
125
+ /**
126
+ * Makes iOS WebKit resolve `element`'s transform again, to the value drawn
127
+ * now: one write of a value the property does not have yet. The animator and
128
+ * the animated layout both write it, so it counts up from the element's own
129
+ * last value.
130
+ */
131
+ function writePresentedResolve(element) {
132
+ const last = Number(element.style.getPropertyValue(RESOLVE_PROPERTY)) || 0;
133
+ element.style.setProperty(RESOLVE_PROPERTY, String(last + 1));
134
+ }
135
+ /** Removes the resolve write from `element`. */
136
+ function clearPresentedResolve(element) {
137
+ element.style.removeProperty(RESOLVE_PROPERTY);
138
+ }
139
+ //#endregion
140
+ //#region src/motion/roleValue.ts
141
+ const ROLE_ID = /^[a-z][A-Za-z0-9]*(?:\.[a-z][A-Za-z0-9]*)+$/;
142
+ /** Whether `id` is a well-formed role name (a dotted table path). */
143
+ function isMotionRoleId(id) {
144
+ return ROLE_ID.test(id);
145
+ }
146
+ /** The CSS custom property for a role: `--motion-` + the path in kebab case. */
147
+ function motionRoleVariable(id) {
148
+ if (!isMotionRoleId(id)) throw new Error(`motion role "${id}" must be a dotted table path such as "springs.sheetPresent"`);
149
+ return `--motion-${id.split(".").map((part) => part.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)).join("-")}`;
150
+ }
151
+ function isSpring(value) {
152
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
153
+ return "response" in value && "dampingRatio" in value || "duration" in value && "bounce" in value || "stiffness" in value && "damping" in value;
154
+ }
155
+ function isCurve(value) {
156
+ return Array.isArray(value) && value.length === 4 && value.every((n) => typeof n === "number");
157
+ }
158
+ //#endregion
159
+ //#region src/motion/roles.ts
160
+ const rolesById = /* @__PURE__ */ new Map();
161
+ /** A table id → the table registered under it. */
162
+ const tablesById = /* @__PURE__ */ new Map();
163
+ /** A spring or curve leaf → its role. */
164
+ const roleOfLeaf = /* @__PURE__ */ new WeakMap();
165
+ /** A table or one of its groups → its path. */
166
+ const pathOfGroup = /* @__PURE__ */ new WeakMap();
167
+ /** A table path → the role id it is registered under, when renamed. */
168
+ const roleIdOfPath = /* @__PURE__ */ new Map();
169
+ /**
170
+ * Registers a motion table: each spring, `…Ms` duration and curve leaf that
171
+ * `roles` lists (its role name, relative to the table) becomes a role named
172
+ * by its path under `id`; the table's other values stay internal constants. A leaf object the table shares between
173
+ * two keys is replaced in the table by an equal copy, so each role has its own
174
+ * object (an animator resolves a role from the object it is handed).
175
+ * `exclude` lists paths, relative to the table, that are not motion;
176
+ * `rename` maps a path, relative to the table, to the role name it is
177
+ * registered under (relative too), so a role is named for its use while the
178
+ * table keeps its source's name. Registering the same table under the same id
179
+ * again does nothing.
180
+ */
181
+ function registerMotionTable(id, table, { roles = [], exclude = [], rename = {} } = {}) {
182
+ if (!/^[a-z][A-Za-z0-9]*$/.test(id)) throw new Error(`motion table id "${id}" must be one camelCase word`);
183
+ if (tablesById.get(id) === table) return;
184
+ tablesById.set(id, table);
185
+ const skip = new Set(exclude.map((path) => `${id}.${path}`));
186
+ const listed = new Set(roles.map((name) => `${id}.${name}`));
187
+ const walk = (group, prefix) => {
188
+ pathOfGroup.set(group, prefix);
189
+ for (const [key, value] of Object.entries(group)) {
190
+ const path = `${prefix}.${key}`;
191
+ if (skip.has(path)) continue;
192
+ let kind = null;
193
+ if (isSpring(value)) kind = "spring";
194
+ else if (isCurve(value)) kind = "curve";
195
+ else if (typeof value === "number" && key.endsWith("Ms")) kind = "duration";
196
+ else if (value !== null && typeof value === "object" && !Array.isArray(value)) {
197
+ walk(value, path);
198
+ continue;
199
+ }
200
+ if (kind == null) continue;
201
+ const relative = path.slice(id.length + 1);
202
+ const roleId = relative in rename ? `${id}.${rename[relative]}` : path;
203
+ if (!listed.has(roleId)) continue;
204
+ if (roleId !== path) roleIdOfPath.set(path, roleId);
205
+ let leaf = value;
206
+ if (typeof leaf === "object") {
207
+ const taken = roleOfLeaf.get(leaf);
208
+ if (taken != null && taken.id !== roleId) {
209
+ leaf = Object.freeze(Array.isArray(leaf) ? [...leaf] : { ...leaf });
210
+ group[key] = leaf;
211
+ }
212
+ }
213
+ const role = {
214
+ id: roleId,
215
+ kind,
216
+ variable: motionRoleVariable(roleId),
217
+ value: leaf
218
+ };
219
+ rolesById.set(roleId, role);
220
+ if (typeof leaf === "object") roleOfLeaf.set(leaf, role);
221
+ }
222
+ };
223
+ walk(table, id);
224
+ }
225
+ /**
226
+ * Registers `leaf` as the spring role `id` (a table path such as
227
+ * `springs.settle`) and returns it, so a table row can register itself. A row
228
+ * that calls it under a pure annotation drops out of a bundle that does not
229
+ * use it, call included. Registering the same leaf under the same id again
230
+ * does nothing.
231
+ */
232
+ function registerSpringRole(id, leaf) {
233
+ if (!isMotionRoleId(id)) throw new Error(`motion role "${id}" must be a dotted table path such as "springs.settle"`);
234
+ if (roleOfLeaf.get(leaf)?.id !== id) {
235
+ const role = {
236
+ id,
237
+ kind: "spring",
238
+ variable: motionRoleVariable(id),
239
+ value: leaf
240
+ };
241
+ rolesById.set(id, role);
242
+ roleOfLeaf.set(leaf, role);
243
+ }
244
+ return leaf;
245
+ }
246
+ /** The role a spring or curve leaf of a registered table plays, if any. */
247
+ function motionRoleOf(leaf) {
248
+ return leaf !== null && typeof leaf === "object" ? roleOfLeaf.get(leaf) : void 0;
249
+ }
250
+ /**
251
+ * The role `group[key]` plays, for a table or one of its groups: the way to
252
+ * name a duration, which is a bare number.
253
+ */
254
+ function motionRoleIn(group, key) {
255
+ const prefix = pathOfGroup.get(group);
256
+ if (prefix == null) return;
257
+ const path = `${prefix}.${key}`;
258
+ return rolesById.get(roleIdOfPath.get(path) ?? path);
259
+ }
260
+ const NUMBER = "(-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e-?\\d+)?)";
261
+ const SPRING_VALUE = new RegExp(`^${NUMBER}s\\s+${NUMBER}$`);
262
+ const DURATION_VALUE = new RegExp(`^${NUMBER}(ms|s)$`);
263
+ const CURVE_VALUE = new RegExp(`^cubic-bezier\\(\\s*${NUMBER}\\s*,\\s*${NUMBER}\\s*,\\s*${NUMBER}\\s*,\\s*${NUMBER}\\s*\\)$`);
264
+ function parseMotionRoleValue(kind, text) {
265
+ const value = text.trim();
266
+ if (value === "") return null;
267
+ if (kind === "spring") {
268
+ const m = SPRING_VALUE.exec(value);
269
+ if (m == null) return null;
270
+ const duration = Number(m[1]);
271
+ const bounce = Number(m[2]);
272
+ return duration > 0 && bounce > -1 && bounce < 1 ? {
273
+ duration,
274
+ bounce
275
+ } : null;
276
+ }
277
+ if (kind === "duration") {
278
+ const m = DURATION_VALUE.exec(value);
279
+ if (m == null) return null;
280
+ const ms = Number(m[1]) * (m[2] === "s" ? 1e3 : 1);
281
+ return ms >= 0 ? ms : null;
282
+ }
283
+ const m = CURVE_VALUE.exec(value);
284
+ if (m == null) return null;
285
+ const points = [
286
+ m[1],
287
+ m[2],
288
+ m[3],
289
+ m[4]
290
+ ].map(Number);
291
+ return points[0] >= 0 && points[0] <= 1 && points[2] >= 0 && points[2] <= 1 ? points : null;
292
+ }
293
+ /** The CSS easing keywords, as the control points CSS gives them. */
294
+ const EASING_KEYWORDS = {
295
+ "linear": [
296
+ 0,
297
+ 0,
298
+ 1,
299
+ 1
300
+ ],
301
+ "ease": [
302
+ .25,
303
+ .1,
304
+ .25,
305
+ 1
306
+ ],
307
+ "ease-in": [
308
+ .42,
309
+ 0,
310
+ 1,
311
+ 1
312
+ ],
313
+ "ease-out": [
314
+ 0,
315
+ 0,
316
+ .58,
317
+ 1
318
+ ],
319
+ "ease-in-out": [
320
+ .42,
321
+ 0,
322
+ .58,
323
+ 1
324
+ ]
325
+ };
326
+ /**
327
+ * Reads a CSS easing, a keyword or a `cubic-bezier()`, as a curve role's value
328
+ * is read. Returns null for any other easing, such as `steps()`.
329
+ */
330
+ function parseCssEasing(text) {
331
+ const value = text.trim();
332
+ return EASING_KEYWORDS[value] ?? parseMotionRoleValue("curve", value);
333
+ }
334
+ //#endregion
335
+ //#region src/motion/uikit/timing.ts
336
+ /**
337
+ * @file timing.ts
338
+ * @input Nothing; data only
339
+ * @output Exports `timing`: the non-spring clocks and curves UIKit uses
340
+ * (press highlight onset, flash and fade, Core Animation's named Bézier
341
+ * curves, the navigation bar hide/show duration, the keyboard
342
+ * notification duration, the Reduced Motion cross-fade)
343
+ * @position The timing domain of the UIKit constants table (motion/uikit)
344
+ *
345
+ * Every leaf carries one or more `@source` (apple-docs | wwdc | webkit |
346
+ * measured | GUESS); webkit and GUESS values also carry the `@measure` task
347
+ * that will confirm or replace them (MEASUREMENTS.md). uikit.test.ts
348
+ * enforces both.
349
+ *
350
+ * Durations are in ms (the unit of pointer-event timestamps, which these
351
+ * clocks are compared against); curves are cubic-bézier control points
352
+ * [x1, y1, x2, y2].
353
+ */
354
+ /**
355
+ * The Reduce Motion fade, its own export so the animator reads it without
356
+ * the rest of the table (`architecture:component-style-authoring` INV6).
357
+ * `timing` composes it under its table paths, `reducedMotionCrossFadeMs` and
358
+ * `curves.move`, so their roles are unchanged.
359
+ */
360
+ const reducedMotionCrossFade = {
361
+ /**
362
+ * The Reduced Motion cross-fade, in ms, on `curves.move`: under
363
+ * Reduce Motion an entrance, exit, presentation switch or state change
364
+ * becomes an opacity-only cross-fade of this length on a coarse pointer
365
+ * (design:reduced-motion DR2 caps it at 200 ms, by owner decision DEC-1
366
+ * of 2026-10-24, departing from UIKit's own navigation cross-fade,
367
+ * measured below at 0.5 s). Not a role: nothing lengthens it (DR4).
368
+ * @source apple-docs https://developer.apple.com/documentation/uikit/uiaccessibility/preferscrossfadetransitions
369
+ * (the setting)
370
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
371
+ * iPhone 17 Pro, CAAnimation dump with Reduce Motion and Prefer
372
+ * Cross-Fade Transitions on (opacity CABasicAnimation 0.5 s,
373
+ * (0.42, 0, 0.58, 1)), Oct 23 2026
374
+ */
375
+ durationMs: 200,
376
+ /**
377
+ * `easeInEaseOut`; UIKit's default curve (`UIView.AnimationCurve
378
+ * .easeInOut`, "the default curve for most animations").
379
+ * @source apple-docs https://developer.apple.com/documentation/quartzcore/camediatimingfunctionname/easeineaseout
380
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
381
+ * iPhone 17 Pro, CAMediaTimingFunction read from UIView.animate,
382
+ * Oct 23 2026
383
+ */
384
+ curve: [
385
+ .42,
386
+ 0,
387
+ .58,
388
+ 1
389
+ ]
390
+ };
391
+ const { durationMs: reducedMotionCrossFadeMs, curve: move } = reducedMotionCrossFade;
392
+ const reducedMotionCrossFadeRoles = { curves: { move } };
393
+ /**
394
+ * Registers only the Reduce Motion fade's curve as its role,
395
+ * `timing.curves.move`, for code that reads the fade without the rest of the
396
+ * table (the animator, reducedMotionFade()). The fade's length is not a role.
397
+ */
398
+ function registerReducedMotionCrossFade() {
399
+ registerMotionTable("timing", reducedMotionCrossFadeRoles, { roles: ["curves.move"] });
400
+ }
401
+ //#endregion
402
+ //#region src/motion/bezier.ts
403
+ /** The timing function for `points`: maps time progress to eased progress. */
404
+ function cubicBezier([x1, y1, x2, y2]) {
405
+ const cx = 3 * x1;
406
+ const bx = 3 * (x2 - x1) - cx;
407
+ const ax = 1 - cx - bx;
408
+ const cy = 3 * y1;
409
+ const by = 3 * (y2 - y1) - cy;
410
+ const ay = 1 - cy - by;
411
+ const sampleX = (t) => ((ax * t + bx) * t + cx) * t;
412
+ const sampleY = (t) => ((ay * t + by) * t + cy) * t;
413
+ const slopeX = (t) => (3 * ax * t + 2 * bx) * t + cx;
414
+ const solveT = (x) => {
415
+ let t = x;
416
+ for (let i = 0; i < 8; i++) {
417
+ const error = sampleX(t) - x;
418
+ if (Math.abs(error) < 1e-7) return t;
419
+ const slope = slopeX(t);
420
+ if (Math.abs(slope) < 1e-6) break;
421
+ t -= error / slope;
422
+ }
423
+ let lo = 0;
424
+ let hi = 1;
425
+ t = x;
426
+ for (let i = 0; i < 60; i++) {
427
+ const value = sampleX(t);
428
+ if (Math.abs(value - x) < 1e-7) break;
429
+ if (value < x) lo = t;
430
+ else hi = t;
431
+ t = (lo + hi) / 2;
432
+ }
433
+ return t;
434
+ };
435
+ return (x) => x <= 0 ? 0 : x >= 1 ? 1 : sampleY(solveT(x));
436
+ }
437
+ //#endregion
438
+ //#region src/motion/layout/handle.ts
439
+ /**
440
+ * @file handle.ts
441
+ * @position Internal to motion/layout; split from upstream motion/animatedLayout.ts
442
+ */
443
+ const AREA = sharedKey("animated-layout/area", 1);
444
+ /** The container a handle reads, or null for a value that is not a handle. */
445
+ function readArea(handle) {
446
+ const read = handle[AREA];
447
+ return typeof read === "function" ? read() : null;
448
+ }
449
+ /** A handle over `area` (the container element, read when a change runs). */
450
+ function createAnimatedLayout(area) {
451
+ return Object.freeze(Object.defineProperty({}, AREA, { value: area }));
452
+ }
453
+ function areaOf(handle, element) {
454
+ const area = readArea(handle);
455
+ return area != null && area !== element && area.contains(element) ? area : null;
456
+ }
457
+ //#endregion
458
+ export { sharedMap as _, registerReducedMotionCrossFade as a, sharedWeakSet as b, parseCssEasing as c, registerSpringRole as d, isSpring as f, writePresentedResolve as g, registerPresentedOffset as h, reducedMotionCrossFade as i, parseMotionRoleValue as l, clearPresentedResolve as m, createAnimatedLayout as n, motionRoleIn as o, batchPresented as p, cubicBezier as r, motionRoleOf as s, areaOf as t, registerMotionTable as u, sharedState as v, themeReducesMotion as x, sharedWeakMap as y };
@@ -5,7 +5,8 @@ interface TimerPresentation {
5
5
  dateTime: string;
6
6
  text: string;
7
7
  }
8
- declare function getPresentation(elapsedMilliseconds: number, format: TimerFormat): TimerPresentation;
8
+ /** `locale` 决定 elapsed 格式里单位的写法、数字和连接方式(英文是「2m 08s」)。 */
9
+ declare function getPresentation(elapsedMilliseconds: number, format: TimerFormat, locale?: string): TimerPresentation;
9
10
  //#endregion
10
11
  //#region src/Timer/types.d.ts
11
12
  /** Timer can inherit the surrounding type, which Text itself does not offer. */
@@ -1,6 +1,7 @@
1
1
  import { n as LayerPlacement, t as LayerAlignment } from "./position-DFW5ymAF.js";
2
2
  import "./useAsyncSource-DbG2FSuI.js";
3
3
  import "./useClipboard-DeO8fCW_.js";
4
+ import "./useAnimatedLayout-C0koWm4a.js";
4
5
  import "./useInputStatusIcon-B6m_t8cK.js";
5
6
  import "./useResizable-CJd4JkbJ.js";
6
7
  import { CSSProperties, Component, ComponentPublicInstance, ComputedRef, InjectionKey, MaybeRefOrGetter, Ref, ShallowRef } from "vue";
@@ -530,8 +531,14 @@ interface ParsedTime {
530
531
  /** 时间的解析、格式化、比较和步进都在 `utils/timeParser`;这里只做字段用的严格写法和 `hours` 形状。 */
531
532
  declare function parseISOTime(value: string): ParsedTime | null;
532
533
  declare function formatISOTime(time: ParsedTime, hasSeconds: boolean): ISOTimeString;
533
- declare function formatDisplayTime(value: string, hourFormat: HourFormat, hasSeconds: boolean): string;
534
- declare function parseDisplayTime(text: string, hasSeconds: boolean): ISOTimeString | null;
534
+ /**
535
+ * 字段显示的时间文字。`locale` 决定数字、分隔符和上下午的词,不传就是英文写法(「2:30 PM」)。
536
+ */
537
+ declare function formatDisplayTime(value: string, hourFormat: HourFormat, hasSeconds: boolean, locale?: string): string;
538
+ /**
539
+ * 把打进来的文字读成 ISO 时间。除了英文写法,还认 `locale` 的数字、分隔符和上下午的词。
540
+ */
541
+ declare function parseDisplayTime(text: string, hasSeconds: boolean, locale?: string): ISOTimeString | null;
535
542
  declare function shiftTime(value: string, minuteDelta: number, hasSeconds: boolean): ISOTimeString;
536
543
  declare function isTimeInRange(value: string, min?: string, max?: string): boolean;
537
544
  type TimePresentation = 'text-input' | 'popover' | 'bottom-sheet' | 'native' | 'adaptive-bottom-sheet' | 'adaptive-native';
@@ -403,11 +403,11 @@ declare const __VLS_base: import("vue").DefineComponent<PowerSearchProps, {
403
403
  }>, {
404
404
  status: PowerSearchStatus;
405
405
  statusVariant: PowerSearchStatusVariant;
406
- hasClear: boolean;
407
- labelHidden: boolean;
408
406
  disabled: boolean;
409
407
  clearable: boolean;
408
+ hasClear: boolean;
410
409
  overflow: PowerSearchOverflow;
410
+ labelHidden: boolean;
411
411
  readOnly: boolean;
412
412
  maxTokenLength: number;
413
413
  maxSearchResults: number;
@@ -1,4 +1,4 @@
1
- import { s as AstryxMessages, t as AstryxUpstreamCatalog } from "./loadCatalog-BJwcyX8i.js";
1
+ import { s as AstryxMessages, t as AstryxUpstreamCatalog } from "./loadCatalog-C4h9SmJs.js";
2
2
  import { ComputedRef, InjectionKey } from "vue";
3
3
  //#region src/InternationalizationProvider/catalog.d.ts
4
4
  /**
@@ -183,11 +183,11 @@ declare const __VLS_base: import("vue").DefineComponent<SelectorProps, {}, {}, {
183
183
  isLabelHidden: boolean;
184
184
  isRequired: boolean;
185
185
  statusVariant: SelectorStatusVariant;
186
- presentation: SelectorPresentation;
187
- isReadOnly: boolean;
188
186
  disabled: boolean;
189
- clearable: boolean;
187
+ presentation: SelectorPresentation;
190
188
  searchable: boolean;
189
+ clearable: boolean;
190
+ isReadOnly: boolean;
191
191
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
192
192
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
193
193
  declare const _default: typeof __VLS_export;
@@ -92,8 +92,8 @@ declare const __VLS_base$1: import("vue").DefineComponent<DialogProps, {}, {}, {
92
92
  variant: DialogVariant;
93
93
  width: string | number;
94
94
  padding: DialogPadding;
95
- isInline: boolean;
96
95
  position: DialogPosition;
96
+ isInline: boolean;
97
97
  purpose: DialogPurpose;
98
98
  maxHeight: string | number;
99
99
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,3 +1,4 @@
1
+ import { r as AnimatedLayout } from "./useAnimatedLayout-C0koWm4a.js";
1
2
  import { CSSProperties, Component, Ref, VNode, VNodeChild } from "vue";
2
3
  //#region src/TreeList/types.d.ts
3
4
  type TreeListDensity = 'compact' | 'balanced' | 'spacious';
@@ -36,6 +37,12 @@ interface TreeListItemData {
36
37
  }
37
38
  interface TreeListProps {
38
39
  items: TreeListItemData[];
40
+ /**
41
+ * The handle from `useAnimatedLayout({ containerRef })`. With it, expanding
42
+ * or collapsing a row glides the rows and content after it, up to that
43
+ * container, instead of jumping, and the chevron turns on the same timing.
44
+ */
45
+ animatedLayout?: AnimatedLayout;
39
46
  /** @default 'balanced' */
40
47
  density?: TreeListDensity;
41
48
  /** @default 'lineGuides' */
@@ -1,5 +1,5 @@
1
1
  import { i as AstryxLocale } from "./power-search-CqcsJT1F.js";
2
- import { s as AstryxMessages } from "./loadCatalog-BJwcyX8i.js";
2
+ import { s as AstryxMessages } from "./loadCatalog-C4h9SmJs.js";
3
3
  import { ComputedRef, InjectionKey, MaybeRefOrGetter } from "vue";
4
4
  //#region src/locale/context.d.ts
5
5
  declare const astryxLocaleKey: InjectionKey<MaybeRefOrGetter<string>>;
@@ -196,14 +196,14 @@ declare const __VLS_base: import("vue").DefineComponent<MultiSelectorProps, {
196
196
  status: MultiSelectorStatus;
197
197
  modelValue: readonly (string | number)[];
198
198
  statusVariant: MultiSelectorStatusVariant;
199
+ disabled: boolean;
199
200
  presentation: MultiSelectorPresentation;
201
+ searchable: boolean;
202
+ clearable: boolean;
200
203
  isReadOnly: boolean;
201
204
  labelHidden: boolean;
202
- disabled: boolean;
203
- clearable: boolean;
204
205
  hasCreate: boolean;
205
206
  optional: boolean;
206
- searchable: boolean;
207
207
  selectAll: boolean;
208
208
  triggerDisplay: MultiSelectorTriggerDisplay;
209
209
  maxBadges: number;
@@ -140,8 +140,8 @@ declare const __VLS_base$1: import("vue").DefineComponent<__VLS_PublicProps$1, {
140
140
  height: string | number;
141
141
  isInline: boolean;
142
142
  purpose: BottomSheetPurpose;
143
- snapPoints: readonly BottomSheetSnapPoint[];
144
143
  hasScrim: boolean;
144
+ snapPoints: readonly BottomSheetSnapPoint[];
145
145
  finalFocusRef: import("vue").MaybeRef<HTMLElement | null>;
146
146
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
147
147
  declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
@@ -175,11 +175,11 @@ type __VLS_Slots = {} & {
175
175
  default?: (props: typeof __VLS_1) => any;
176
176
  };
177
177
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
178
- cancel: (event: Event) => any;
179
178
  "update:activeSheet": (value: string | null) => any;
179
+ cancel: (event: Event) => any;
180
180
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
181
- onCancel?: ((event: Event) => any) | undefined;
182
181
  "onUpdate:activeSheet"?: ((value: string | null) => any) | undefined;
182
+ onCancel?: ((event: Event) => any) | undefined;
183
183
  }>, {
184
184
  hasScrim: boolean;
185
185
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -84,10 +84,10 @@ declare const __VLS_base: import("vue").DefineComponent<HoverCardProps, {
84
84
  onOpenChange?: ((isOpen: boolean) => any) | undefined;
85
85
  }>, {
86
86
  label: string;
87
- content: string;
88
87
  isOpen: boolean;
89
88
  placement: HoverCardPlacement;
90
89
  alignment: HoverCardAlignment;
90
+ content: string;
91
91
  isDefaultOpen: boolean;
92
92
  delay: number;
93
93
  hideDelay: number;
@@ -101,8 +101,8 @@ type __VLS_Slots = {
101
101
  declare const __VLS_base: import("vue").DefineComponent<CenterProps, {
102
102
  element: Readonly<import("vue").ShallowRef<HTMLDivElement | null>>;
103
103
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CenterProps> & Readonly<{}>, {
104
- axis: CenterAxis;
105
104
  isInline: boolean;
105
+ axis: CenterAxis;
106
106
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
107
107
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
108
108
  declare const _default: typeof __VLS_export;
@@ -66,10 +66,10 @@ declare const __VLS_base: import("vue").DefineComponent<TooltipProps, {}, {}, {}
66
66
  onOpenChange?: ((isOpen: boolean) => any) | undefined;
67
67
  }>, {
68
68
  anchor: HTMLElement | null;
69
- content: string;
70
69
  isOpen: boolean;
71
70
  placement: TooltipPlacement;
72
71
  alignment: TooltipAlignment;
72
+ content: string;
73
73
  isDefaultOpen: boolean;
74
74
  delay: number;
75
75
  hideDelay: number;