@hjmds/design-contracts 0.8.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.
Files changed (353) hide show
  1. package/README.md +208 -0
  2. package/dist/alert-dialog.d.ts +102 -0
  3. package/dist/alert-dialog.d.ts.map +1 -0
  4. package/dist/alert-dialog.js +136 -0
  5. package/dist/alert-dialog.js.map +1 -0
  6. package/dist/base-recipes.d.ts +184 -0
  7. package/dist/base-recipes.d.ts.map +1 -0
  8. package/dist/base-recipes.js +129 -0
  9. package/dist/base-recipes.js.map +1 -0
  10. package/dist/behaviors.d.ts +1254 -0
  11. package/dist/behaviors.d.ts.map +1 -0
  12. package/dist/behaviors.js +972 -0
  13. package/dist/behaviors.js.map +1 -0
  14. package/dist/bottom-navigation-defaults.d.ts +13 -0
  15. package/dist/bottom-navigation-defaults.d.ts.map +1 -0
  16. package/dist/bottom-navigation-defaults.js +10 -0
  17. package/dist/bottom-navigation-defaults.js.map +1 -0
  18. package/dist/bottom-navigation.d.ts +114 -0
  19. package/dist/bottom-navigation.d.ts.map +1 -0
  20. package/dist/bottom-navigation.js +223 -0
  21. package/dist/bottom-navigation.js.map +1 -0
  22. package/dist/breadcrumb.d.ts +97 -0
  23. package/dist/breadcrumb.d.ts.map +1 -0
  24. package/dist/breadcrumb.js +99 -0
  25. package/dist/breadcrumb.js.map +1 -0
  26. package/dist/calendar.d.ts +285 -0
  27. package/dist/calendar.d.ts.map +1 -0
  28. package/dist/calendar.js +297 -0
  29. package/dist/calendar.js.map +1 -0
  30. package/dist/card.d.ts +39 -0
  31. package/dist/card.d.ts.map +1 -0
  32. package/dist/card.js +50 -0
  33. package/dist/card.js.map +1 -0
  34. package/dist/carousel.d.ts +180 -0
  35. package/dist/carousel.d.ts.map +1 -0
  36. package/dist/carousel.js +172 -0
  37. package/dist/carousel.js.map +1 -0
  38. package/dist/catalog.d.ts +7158 -0
  39. package/dist/catalog.d.ts.map +1 -0
  40. package/dist/catalog.js +220 -0
  41. package/dist/catalog.js.map +1 -0
  42. package/dist/collection.d.ts +123 -0
  43. package/dist/collection.d.ts.map +1 -0
  44. package/dist/collection.js +211 -0
  45. package/dist/collection.js.map +1 -0
  46. package/dist/color-references.d.ts +46 -0
  47. package/dist/color-references.d.ts.map +1 -0
  48. package/dist/color-references.js +39 -0
  49. package/dist/color-references.js.map +1 -0
  50. package/dist/colors.d.ts +56 -0
  51. package/dist/colors.d.ts.map +1 -0
  52. package/dist/colors.js +90 -0
  53. package/dist/colors.js.map +1 -0
  54. package/dist/command-palette.d.ts +240 -0
  55. package/dist/command-palette.d.ts.map +1 -0
  56. package/dist/command-palette.js +97 -0
  57. package/dist/command-palette.js.map +1 -0
  58. package/dist/component-contracts.d.ts +137 -0
  59. package/dist/component-contracts.d.ts.map +1 -0
  60. package/dist/component-contracts.js +53 -0
  61. package/dist/component-contracts.js.map +1 -0
  62. package/dist/component-definitions.d.ts +135 -0
  63. package/dist/component-definitions.d.ts.map +1 -0
  64. package/dist/component-definitions.js +142 -0
  65. package/dist/component-definitions.js.map +1 -0
  66. package/dist/component-recipes.d.ts +3583 -0
  67. package/dist/component-recipes.d.ts.map +1 -0
  68. package/dist/component-recipes.js +1503 -0
  69. package/dist/component-recipes.js.map +1 -0
  70. package/dist/component-references.d.ts +416 -0
  71. package/dist/component-references.d.ts.map +1 -0
  72. package/dist/component-references.js +140 -0
  73. package/dist/component-references.js.map +1 -0
  74. package/dist/content-state.d.ts +104 -0
  75. package/dist/content-state.d.ts.map +1 -0
  76. package/dist/content-state.js +116 -0
  77. package/dist/content-state.js.map +1 -0
  78. package/dist/counter-badge-recipe.d.ts +80 -0
  79. package/dist/counter-badge-recipe.d.ts.map +1 -0
  80. package/dist/counter-badge-recipe.js +44 -0
  81. package/dist/counter-badge-recipe.js.map +1 -0
  82. package/dist/counter-badge.d.ts +12 -0
  83. package/dist/counter-badge.d.ts.map +1 -0
  84. package/dist/counter-badge.js +21 -0
  85. package/dist/counter-badge.js.map +1 -0
  86. package/dist/data-table.d.ts +203 -0
  87. package/dist/data-table.d.ts.map +1 -0
  88. package/dist/data-table.js +182 -0
  89. package/dist/data-table.js.map +1 -0
  90. package/dist/date-picker.d.ts +268 -0
  91. package/dist/date-picker.d.ts.map +1 -0
  92. package/dist/date-picker.js +168 -0
  93. package/dist/date-picker.js.map +1 -0
  94. package/dist/description-list.d.ts +68 -0
  95. package/dist/description-list.d.ts.map +1 -0
  96. package/dist/description-list.js +85 -0
  97. package/dist/description-list.js.map +1 -0
  98. package/dist/design-system-provider.d.ts +80 -0
  99. package/dist/design-system-provider.d.ts.map +1 -0
  100. package/dist/design-system-provider.js +147 -0
  101. package/dist/design-system-provider.js.map +1 -0
  102. package/dist/evidence.d.ts +49 -0
  103. package/dist/evidence.d.ts.map +1 -0
  104. package/dist/evidence.js +133 -0
  105. package/dist/evidence.js.map +1 -0
  106. package/dist/file-picker.d.ts +183 -0
  107. package/dist/file-picker.d.ts.map +1 -0
  108. package/dist/file-picker.js +224 -0
  109. package/dist/file-picker.js.map +1 -0
  110. package/dist/floating-action-button.d.ts +143 -0
  111. package/dist/floating-action-button.d.ts.map +1 -0
  112. package/dist/floating-action-button.js +149 -0
  113. package/dist/floating-action-button.js.map +1 -0
  114. package/dist/form.d.ts +143 -0
  115. package/dist/form.d.ts.map +1 -0
  116. package/dist/form.js +206 -0
  117. package/dist/form.js.map +1 -0
  118. package/dist/foundations.d.ts +300 -0
  119. package/dist/foundations.d.ts.map +1 -0
  120. package/dist/foundations.js +238 -0
  121. package/dist/foundations.js.map +1 -0
  122. package/dist/grid.d.ts +75 -0
  123. package/dist/grid.d.ts.map +1 -0
  124. package/dist/grid.js +133 -0
  125. package/dist/grid.js.map +1 -0
  126. package/dist/icon-button-recipe.d.ts +99 -0
  127. package/dist/icon-button-recipe.d.ts.map +1 -0
  128. package/dist/icon-button-recipe.js +53 -0
  129. package/dist/icon-button-recipe.js.map +1 -0
  130. package/dist/icon.d.ts +41 -0
  131. package/dist/icon.d.ts.map +1 -0
  132. package/dist/icon.js +147 -0
  133. package/dist/icon.js.map +1 -0
  134. package/dist/image.d.ts +82 -0
  135. package/dist/image.d.ts.map +1 -0
  136. package/dist/image.js +100 -0
  137. package/dist/image.js.map +1 -0
  138. package/dist/index.d.ts +58 -0
  139. package/dist/index.d.ts.map +1 -0
  140. package/dist/index.js +66 -0
  141. package/dist/index.js.map +1 -0
  142. package/dist/layout.d.ts +118 -0
  143. package/dist/layout.d.ts.map +1 -0
  144. package/dist/layout.js +118 -0
  145. package/dist/layout.js.map +1 -0
  146. package/dist/link.d.ts +57 -0
  147. package/dist/link.d.ts.map +1 -0
  148. package/dist/link.js +142 -0
  149. package/dist/link.js.map +1 -0
  150. package/dist/load-more.d.ts +64 -0
  151. package/dist/load-more.d.ts.map +1 -0
  152. package/dist/load-more.js +124 -0
  153. package/dist/load-more.js.map +1 -0
  154. package/dist/mentions.d.ts +67 -0
  155. package/dist/mentions.d.ts.map +1 -0
  156. package/dist/mentions.js +107 -0
  157. package/dist/mentions.js.map +1 -0
  158. package/dist/number-field.d.ts +208 -0
  159. package/dist/number-field.d.ts.map +1 -0
  160. package/dist/number-field.js +247 -0
  161. package/dist/number-field.js.map +1 -0
  162. package/dist/otp-field.d.ts +152 -0
  163. package/dist/otp-field.d.ts.map +1 -0
  164. package/dist/otp-field.js +117 -0
  165. package/dist/otp-field.js.map +1 -0
  166. package/dist/pagination.d.ts +181 -0
  167. package/dist/pagination.d.ts.map +1 -0
  168. package/dist/pagination.js +226 -0
  169. package/dist/pagination.js.map +1 -0
  170. package/dist/password-field.d.ts +187 -0
  171. package/dist/password-field.d.ts.map +1 -0
  172. package/dist/password-field.js +120 -0
  173. package/dist/password-field.js.map +1 -0
  174. package/dist/popover.d.ts +152 -0
  175. package/dist/popover.d.ts.map +1 -0
  176. package/dist/popover.js +137 -0
  177. package/dist/popover.js.map +1 -0
  178. package/dist/progress-recipe.d.ts +43 -0
  179. package/dist/progress-recipe.d.ts.map +1 -0
  180. package/dist/progress-recipe.js +16 -0
  181. package/dist/progress-recipe.js.map +1 -0
  182. package/dist/recipes.d.ts +31 -0
  183. package/dist/recipes.d.ts.map +1 -0
  184. package/dist/recipes.js +46 -0
  185. package/dist/recipes.js.map +1 -0
  186. package/dist/responsive.d.ts +27 -0
  187. package/dist/responsive.d.ts.map +1 -0
  188. package/dist/responsive.js +66 -0
  189. package/dist/responsive.js.map +1 -0
  190. package/dist/result.d.ts +111 -0
  191. package/dist/result.d.ts.map +1 -0
  192. package/dist/result.js +97 -0
  193. package/dist/result.js.map +1 -0
  194. package/dist/selection-helpers.d.ts +16 -0
  195. package/dist/selection-helpers.d.ts.map +1 -0
  196. package/dist/selection-helpers.js +52 -0
  197. package/dist/selection-helpers.js.map +1 -0
  198. package/dist/semantic-colors.d.ts +275 -0
  199. package/dist/semantic-colors.d.ts.map +1 -0
  200. package/dist/semantic-colors.js +84 -0
  201. package/dist/semantic-colors.js.map +1 -0
  202. package/dist/sheet.d.ts +51 -0
  203. package/dist/sheet.d.ts.map +1 -0
  204. package/dist/sheet.js +69 -0
  205. package/dist/sheet.js.map +1 -0
  206. package/dist/showcase.d.ts +153 -0
  207. package/dist/showcase.d.ts.map +1 -0
  208. package/dist/showcase.js +210 -0
  209. package/dist/showcase.js.map +1 -0
  210. package/dist/side-panel.d.ts +199 -0
  211. package/dist/side-panel.d.ts.map +1 -0
  212. package/dist/side-panel.js +111 -0
  213. package/dist/side-panel.js.map +1 -0
  214. package/dist/slider.d.ts +138 -0
  215. package/dist/slider.d.ts.map +1 -0
  216. package/dist/slider.js +150 -0
  217. package/dist/slider.js.map +1 -0
  218. package/dist/splitter.d.ts +113 -0
  219. package/dist/splitter.d.ts.map +1 -0
  220. package/dist/splitter.js +99 -0
  221. package/dist/splitter.js.map +1 -0
  222. package/dist/statistic.d.ts +41 -0
  223. package/dist/statistic.d.ts.map +1 -0
  224. package/dist/statistic.js +76 -0
  225. package/dist/statistic.js.map +1 -0
  226. package/dist/steps.d.ts +196 -0
  227. package/dist/steps.d.ts.map +1 -0
  228. package/dist/steps.js +160 -0
  229. package/dist/steps.js.map +1 -0
  230. package/dist/tag.d.ts +128 -0
  231. package/dist/tag.d.ts.map +1 -0
  232. package/dist/tag.js +93 -0
  233. package/dist/tag.js.map +1 -0
  234. package/dist/timeline.d.ts +147 -0
  235. package/dist/timeline.d.ts.map +1 -0
  236. package/dist/timeline.js +127 -0
  237. package/dist/timeline.js.map +1 -0
  238. package/dist/toast.d.ts +164 -0
  239. package/dist/toast.d.ts.map +1 -0
  240. package/dist/toast.js +529 -0
  241. package/dist/toast.js.map +1 -0
  242. package/dist/tokens.d.ts +9 -0
  243. package/dist/tokens.d.ts.map +1 -0
  244. package/dist/tokens.js +9 -0
  245. package/dist/tokens.js.map +1 -0
  246. package/dist/tooltip.d.ts +44 -0
  247. package/dist/tooltip.d.ts.map +1 -0
  248. package/dist/tooltip.js +88 -0
  249. package/dist/tooltip.js.map +1 -0
  250. package/dist/tour.d.ts +218 -0
  251. package/dist/tour.d.ts.map +1 -0
  252. package/dist/tour.js +211 -0
  253. package/dist/tour.js.map +1 -0
  254. package/dist/transfer-list.d.ts +207 -0
  255. package/dist/transfer-list.d.ts.map +1 -0
  256. package/dist/transfer-list.js +193 -0
  257. package/dist/transfer-list.js.map +1 -0
  258. package/dist/tree-select.d.ts +78 -0
  259. package/dist/tree-select.d.ts.map +1 -0
  260. package/dist/tree-select.js +132 -0
  261. package/dist/tree-select.js.map +1 -0
  262. package/dist/tree.d.ts +206 -0
  263. package/dist/tree.d.ts.map +1 -0
  264. package/dist/tree.js +223 -0
  265. package/dist/tree.js.map +1 -0
  266. package/dist/upload-item.d.ts +173 -0
  267. package/dist/upload-item.d.ts.map +1 -0
  268. package/dist/upload-item.js +156 -0
  269. package/dist/upload-item.js.map +1 -0
  270. package/dist/version.d.ts +3 -0
  271. package/dist/version.d.ts.map +1 -0
  272. package/dist/version.js +3 -0
  273. package/dist/version.js.map +1 -0
  274. package/docs/affix.md +63 -0
  275. package/docs/anchor.md +59 -0
  276. package/docs/ant-design-coverage.md +119 -0
  277. package/docs/app-provider.md +50 -0
  278. package/docs/app-rn-adoption.md +227 -0
  279. package/docs/architecture.md +320 -0
  280. package/docs/authoring-brief.md +87 -0
  281. package/docs/border-beam.md +66 -0
  282. package/docs/bottom-navigation.md +127 -0
  283. package/docs/breadcrumb.md +82 -0
  284. package/docs/calendar.md +154 -0
  285. package/docs/carousel.md +130 -0
  286. package/docs/cascader.md +93 -0
  287. package/docs/catalog-decision-status.md +306 -0
  288. package/docs/color-picker.md +72 -0
  289. package/docs/command-palette.md +116 -0
  290. package/docs/confirm-popover.md +93 -0
  291. package/docs/consistency-audit.md +383 -0
  292. package/docs/consumer-release-gate.md +90 -0
  293. package/docs/content-state.md +156 -0
  294. package/docs/context-panel.md +88 -0
  295. package/docs/cross-platform-core-normalization.md +118 -0
  296. package/docs/data-table.md +79 -0
  297. package/docs/date-picker.md +84 -0
  298. package/docs/description-list.md +75 -0
  299. package/docs/design-system-provider.md +139 -0
  300. package/docs/dropdown.md +78 -0
  301. package/docs/expansion-roadmap.md +285 -0
  302. package/docs/file-picker.md +59 -0
  303. package/docs/floating-action-button.md +111 -0
  304. package/docs/form.md +134 -0
  305. package/docs/generated/component-maturity.md +103 -0
  306. package/docs/generated/renderer-evidence.json +5597 -0
  307. package/docs/generated/renderer-evidence.md +132 -0
  308. package/docs/generated/showcase-manifest.json +3732 -0
  309. package/docs/icon.md +22 -0
  310. package/docs/identity.md +121 -0
  311. package/docs/image.md +84 -0
  312. package/docs/implementation-0.5.md +85 -0
  313. package/docs/layout-primitives.md +107 -0
  314. package/docs/layout.md +83 -0
  315. package/docs/library-reference-decisions.md +123 -0
  316. package/docs/link.md +67 -0
  317. package/docs/load-more.md +31 -0
  318. package/docs/mentions.md +82 -0
  319. package/docs/migration-0.2.md +108 -0
  320. package/docs/migration-0.3.md +72 -0
  321. package/docs/migration-0.5.md +82 -0
  322. package/docs/migration-0.6.md +197 -0
  323. package/docs/notification.md +54 -0
  324. package/docs/number-field.md +82 -0
  325. package/docs/otp-field.md +103 -0
  326. package/docs/pagination.md +139 -0
  327. package/docs/password-field.md +98 -0
  328. package/docs/popover.md +124 -0
  329. package/docs/promotion-candidates.md +169 -0
  330. package/docs/qr-code.md +69 -0
  331. package/docs/rating.md +58 -0
  332. package/docs/responsive-grid.md +90 -0
  333. package/docs/result.md +96 -0
  334. package/docs/showcase.md +97 -0
  335. package/docs/side-panel.md +71 -0
  336. package/docs/slider.md +79 -0
  337. package/docs/splitter.md +55 -0
  338. package/docs/statistic.md +16 -0
  339. package/docs/steps.md +115 -0
  340. package/docs/tag.md +57 -0
  341. package/docs/time-picker.md +88 -0
  342. package/docs/timeline.md +146 -0
  343. package/docs/toast.md +127 -0
  344. package/docs/tooltip.md +58 -0
  345. package/docs/tour.md +136 -0
  346. package/docs/transfer-list.md +94 -0
  347. package/docs/tree-select.md +101 -0
  348. package/docs/tree.md +123 -0
  349. package/docs/upload-item.md +68 -0
  350. package/docs/utility.md +53 -0
  351. package/docs/virtual-list.md +70 -0
  352. package/docs/watermark.md +58 -0
  353. package/package.json +402 -0
@@ -0,0 +1,76 @@
1
+ export const statisticDefaults = {
2
+ trendTone: "neutral",
3
+ };
4
+ function assertCopy(value, field) {
5
+ if (value.trim().length === 0) {
6
+ throw new TypeError(`Statistic ${field} must not be empty`);
7
+ }
8
+ }
9
+ export function validateStatisticDescriptor(descriptor) {
10
+ assertCopy(descriptor.id, "id");
11
+ if (descriptor.id !== descriptor.id.trim()) {
12
+ throw new TypeError("Statistic id must not start or end with whitespace");
13
+ }
14
+ assertCopy(descriptor.label, "label");
15
+ assertCopy(descriptor.value, "value");
16
+ if (descriptor.prefix !== undefined)
17
+ assertCopy(descriptor.prefix, "prefix");
18
+ if (descriptor.suffix !== undefined)
19
+ assertCopy(descriptor.suffix, "suffix");
20
+ if (descriptor.hint !== undefined)
21
+ assertCopy(descriptor.hint, "hint");
22
+ if (descriptor.trend) {
23
+ if (descriptor.trend.direction !== "up" &&
24
+ descriptor.trend.direction !== "down" &&
25
+ descriptor.trend.direction !== "flat") {
26
+ throw new TypeError(`Unsupported Statistic trend direction: ${String(descriptor.trend.direction)}`);
27
+ }
28
+ if (descriptor.trend.tone !== undefined &&
29
+ descriptor.trend.tone !== "neutral" &&
30
+ descriptor.trend.tone !== "success" &&
31
+ descriptor.trend.tone !== "warning" &&
32
+ descriptor.trend.tone !== "danger") {
33
+ throw new TypeError(`Unsupported Statistic trend tone: ${String(descriptor.trend.tone)}`);
34
+ }
35
+ assertCopy(descriptor.trend.label, "trend.label");
36
+ }
37
+ }
38
+ export function resolveStatisticDescriptor(descriptor) {
39
+ validateStatisticDescriptor(descriptor);
40
+ const { trend, ...copy } = descriptor;
41
+ if (!trend)
42
+ return copy;
43
+ return {
44
+ ...copy,
45
+ trend: {
46
+ ...trend,
47
+ tone: trend.tone ?? statisticDefaults.trendTone,
48
+ },
49
+ };
50
+ }
51
+ export function validateStatisticGroup(group) {
52
+ if (group.items.length === 0) {
53
+ throw new TypeError("Statistic group must contain at least one item");
54
+ }
55
+ if (group.columns !== undefined &&
56
+ group.columns !== 1 &&
57
+ group.columns !== 2 &&
58
+ group.columns !== 3 &&
59
+ group.columns !== 4) {
60
+ throw new RangeError("Statistic columns must be 1, 2, 3, or 4");
61
+ }
62
+ const ids = new Set();
63
+ for (const item of group.items) {
64
+ validateStatisticDescriptor(item);
65
+ if (ids.has(item.id)) {
66
+ throw new TypeError(`Duplicate Statistic id: ${item.id}`);
67
+ }
68
+ ids.add(item.id);
69
+ }
70
+ }
71
+ export const statisticTrendMarks = {
72
+ up: "trendUp",
73
+ down: "trendDown",
74
+ flat: "trendFlat",
75
+ };
76
+ //# sourceMappingURL=statistic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statistic.js","sourceRoot":"","sources":["../src/statistic.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,SAAS,EAAE,SAAS;CAC0C,CAAC;A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AG,IAAI,GAAG,EAAM,CAAC;IAC1B,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAC/B,2BAA2B,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,SAAS,CAAC,2BAA2B,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5D,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,EAAE,EAAE,SAAS;IACb,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;CACyC,CAAC","sourcesContent":["export type StatisticTrendDirection = \"up\" | \"down\" | \"flat\";\nexport type StatisticTrendTone = \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\nexport const statisticDefaults = {\n trendTone: \"neutral\",\n} as const satisfies Readonly<{ trendTone: StatisticTrendTone }>;\n\nexport type StatisticTrendDescriptor = Readonly<{\n direction: StatisticTrendDirection;\n /** Direction and meaning are independent: an increase is not always good. */\n tone?: StatisticTrendTone;\n /** Visible localized copy ensures the trend is never communicated by color alone. */\n label: string;\n}>;\n\nexport type StatisticDescriptor<Id extends string = string> = Readonly<{\n id: Id;\n label: string;\n /** Products own number/date/unit formatting and pass the final visible string. */\n value: string;\n prefix?: string;\n suffix?: string;\n hint?: string;\n trend?: StatisticTrendDescriptor;\n}>;\n\nexport type StatisticGroupDescriptor<Id extends string = string> = Readonly<{\n items: readonly StatisticDescriptor<Id>[];\n columns?: 1 | 2 | 3 | 4;\n}>;\n\nexport type ResolvedStatisticTrendDescriptor = Omit<\n StatisticTrendDescriptor,\n \"tone\"\n> &\n Readonly<{ tone: StatisticTrendTone }>;\n\nexport type ResolvedStatisticDescriptor<Id extends string = string> = Omit<\n StatisticDescriptor<Id>,\n \"trend\"\n> &\n Readonly<{ trend?: ResolvedStatisticTrendDescriptor }>;\n\nfunction assertCopy(value: string, field: string): void {\n if (value.trim().length === 0) {\n throw new TypeError(`Statistic ${field} must not be empty`);\n }\n}\n\nexport function validateStatisticDescriptor<Id extends string>(\n descriptor: StatisticDescriptor<Id>,\n): void {\n assertCopy(descriptor.id, \"id\");\n if (descriptor.id !== descriptor.id.trim()) {\n throw new TypeError(\"Statistic id must not start or end with whitespace\");\n }\n assertCopy(descriptor.label, \"label\");\n assertCopy(descriptor.value, \"value\");\n if (descriptor.prefix !== undefined) assertCopy(descriptor.prefix, \"prefix\");\n if (descriptor.suffix !== undefined) assertCopy(descriptor.suffix, \"suffix\");\n if (descriptor.hint !== undefined) assertCopy(descriptor.hint, \"hint\");\n if (descriptor.trend) {\n if (\n descriptor.trend.direction !== \"up\" &&\n descriptor.trend.direction !== \"down\" &&\n descriptor.trend.direction !== \"flat\"\n ) {\n throw new TypeError(\n `Unsupported Statistic trend direction: ${String(descriptor.trend.direction)}`,\n );\n }\n if (\n descriptor.trend.tone !== undefined &&\n descriptor.trend.tone !== \"neutral\" &&\n descriptor.trend.tone !== \"success\" &&\n descriptor.trend.tone !== \"warning\" &&\n descriptor.trend.tone !== \"danger\"\n ) {\n throw new TypeError(\n `Unsupported Statistic trend tone: ${String(descriptor.trend.tone)}`,\n );\n }\n assertCopy(descriptor.trend.label, \"trend.label\");\n }\n}\n\nexport function resolveStatisticDescriptor<Id extends string>(\n descriptor: StatisticDescriptor<Id>,\n): ResolvedStatisticDescriptor<Id> {\n validateStatisticDescriptor(descriptor);\n const { trend, ...copy } = descriptor;\n if (!trend) return copy;\n return {\n ...copy,\n trend: {\n ...trend,\n tone: trend.tone ?? statisticDefaults.trendTone,\n },\n };\n}\n\nexport function validateStatisticGroup<Id extends string>(\n group: StatisticGroupDescriptor<Id>,\n): void {\n if (group.items.length === 0) {\n throw new TypeError(\"Statistic group must contain at least one item\");\n }\n if (\n group.columns !== undefined &&\n group.columns !== 1 &&\n group.columns !== 2 &&\n group.columns !== 3 &&\n group.columns !== 4\n ) {\n throw new RangeError(\"Statistic columns must be 1, 2, 3, or 4\");\n }\n const ids = new Set<Id>();\n for (const item of group.items) {\n validateStatisticDescriptor(item);\n if (ids.has(item.id)) {\n throw new TypeError(`Duplicate Statistic id: ${item.id}`);\n }\n ids.add(item.id);\n }\n}\n\nexport const statisticTrendMarks = {\n up: \"trendUp\",\n down: \"trendDown\",\n flat: \"trendFlat\",\n} as const satisfies Record<StatisticTrendDirection, string>;\n"]}
@@ -0,0 +1,196 @@
1
+ /**
2
+ * Ant Design Steps' full surface (navigation/clickable jump, dot type, custom
3
+ * per-item icon, vertical orientation) is intentionally not reproduced. Both
4
+ * known consumers (Yajalal onboarding, BurnTok sign-up) are single-cursor,
5
+ * horizontal, back-button-driven wizards; see docs/steps.md for the per-axis
6
+ * rationale.
7
+ */
8
+ export type StepStatus = "pending" | "current" | "complete" | "error";
9
+ /** Only the cursor step can be "current" or "error"; every other step is derived. */
10
+ export type StepCursorStatus = Extract<StepStatus, "current" | "error">;
11
+ export type StepItemDescriptor<Id extends string = string> = Readonly<{
12
+ id: Id;
13
+ label: string;
14
+ description?: string;
15
+ }>;
16
+ /**
17
+ * A single stable cursor (`currentStepId`) is the source of truth instead of a
18
+ * per-item status array, so "two current steps" or "a completed step past an
19
+ * unresolved error" cannot be represented. Clickable jump is out of scope, so
20
+ * the flow is always linear relative to the cursor.
21
+ */
22
+ export type StepsDescriptor<Id extends string = string> = Readonly<{
23
+ steps: readonly StepItemDescriptor<Id>[];
24
+ currentStepId: Id;
25
+ currentStepStatus?: StepCursorStatus;
26
+ }>;
27
+ export declare const stepsDefaults: {
28
+ readonly currentStepStatus: "current";
29
+ };
30
+ export type StepsStatusLabels = Readonly<{
31
+ pending: string;
32
+ current: string;
33
+ complete: string;
34
+ error: string;
35
+ }>;
36
+ export type StepsAccessibleNameInfo = Readonly<{
37
+ position: number;
38
+ total: number;
39
+ label: string;
40
+ }>;
41
+ /**
42
+ * Products own the exact phrase order and counter-word grammar (Korean
43
+ * "3단계 중 2단계" does not translate structurally to English "step 2 of 3"),
44
+ * so the resolver invokes this composer instead of assembling copy itself.
45
+ */
46
+ export type ComposeStepsAccessibleName = (info: StepsAccessibleNameInfo) => string;
47
+ export type ResolvedStepDescriptor<Id extends string = string> = StepItemDescriptor<Id> & Readonly<{
48
+ status: StepStatus;
49
+ /** 1-indexed so position and label both preserve reading order for renderers. */
50
+ position: number;
51
+ total: number;
52
+ /** Primary accessible name: order + label. Never says status by itself. */
53
+ accessibleName: string;
54
+ /** Supplementary status announcement (Web aria-describedby text / RN accessibilityHint). */
55
+ statusLabel: string;
56
+ }>;
57
+ export type ResolveStepsOptions = Readonly<{
58
+ statusLabels: StepsStatusLabels;
59
+ composeAccessibleName: ComposeStepsAccessibleName;
60
+ }>;
61
+ export declare function validateStepItemDescriptor<Id extends string>(step: StepItemDescriptor<Id>): void;
62
+ export declare function validateStepsDescriptor<Id extends string>(descriptor: StepsDescriptor<Id>): void;
63
+ export declare function validateStepsStatusLabels(labels: StepsStatusLabels): void;
64
+ /** A step is visually and semantically "reached" once it is no longer waiting. */
65
+ export declare function isStepReached(status: StepStatus): boolean;
66
+ /**
67
+ * Derives every step's status from its position relative to the single
68
+ * cursor, then attaches the order-preserving accessible name and the
69
+ * supplementary status announcement. Throws on a malformed descriptor,
70
+ * labels bag, or composer instead of silently rendering an inconsistent flow.
71
+ */
72
+ export declare function resolveStepsDescriptor<Id extends string>(descriptor: StepsDescriptor<Id>, options: ResolveStepsOptions): readonly ResolvedStepDescriptor<Id>[];
73
+ export declare const stepsRecipe: {
74
+ readonly slots: readonly ["root", "step", "indicator", "marker", "connector", "label", "description"];
75
+ readonly gap: 8;
76
+ readonly indicator: {
77
+ readonly size: 24;
78
+ readonly borderWidth: 1;
79
+ readonly activeBorderWidth: 2;
80
+ /** null means the renderer shows the step's own position number instead of a glyph. */
81
+ readonly marks: {
82
+ readonly pending: null;
83
+ readonly current: null;
84
+ readonly complete: "check";
85
+ readonly error: "error";
86
+ };
87
+ readonly border: {
88
+ readonly pending: Readonly<{
89
+ source: "theme";
90
+ key: "border";
91
+ alpha?: number;
92
+ }>;
93
+ readonly current: Readonly<{
94
+ source: "theme";
95
+ key: "contentBrand";
96
+ alpha?: number;
97
+ }>;
98
+ readonly complete: Readonly<{
99
+ source: "accent";
100
+ key: "success";
101
+ alpha?: number;
102
+ }>;
103
+ readonly error: Readonly<{
104
+ source: "theme";
105
+ key: "danger";
106
+ alpha?: number;
107
+ }>;
108
+ };
109
+ readonly background: {
110
+ readonly pending: null;
111
+ readonly current: null;
112
+ readonly complete: Readonly<{
113
+ source: "accent";
114
+ key: "success";
115
+ alpha?: number;
116
+ }>;
117
+ readonly error: Readonly<{
118
+ source: "theme";
119
+ key: "danger";
120
+ alpha?: number;
121
+ }>;
122
+ };
123
+ readonly content: {
124
+ readonly pending: Readonly<{
125
+ source: "theme";
126
+ key: "textMuted";
127
+ alpha?: number;
128
+ }>;
129
+ readonly current: Readonly<{
130
+ source: "theme";
131
+ key: "contentBrand";
132
+ alpha?: number;
133
+ }>;
134
+ readonly complete: Readonly<{
135
+ source: "accent";
136
+ key: "success";
137
+ alpha?: number;
138
+ }>;
139
+ readonly error: Readonly<{
140
+ source: "theme";
141
+ key: "danger";
142
+ alpha?: number;
143
+ }>;
144
+ };
145
+ };
146
+ readonly connector: {
147
+ readonly height: 1;
148
+ readonly tone: {
149
+ readonly reached: Readonly<{
150
+ source: "theme";
151
+ key: "contentBrand";
152
+ alpha?: number;
153
+ }>;
154
+ readonly unreached: Readonly<{
155
+ source: "theme";
156
+ key: "border";
157
+ alpha?: number;
158
+ }>;
159
+ };
160
+ };
161
+ readonly label: {
162
+ readonly textVariant: "label";
163
+ readonly fontWeight: "600";
164
+ readonly color: {
165
+ readonly pending: Readonly<{
166
+ source: "theme";
167
+ key: "textMuted";
168
+ alpha?: number;
169
+ }>;
170
+ readonly current: Readonly<{
171
+ source: "theme";
172
+ key: "text";
173
+ alpha?: number;
174
+ }>;
175
+ readonly complete: Readonly<{
176
+ source: "theme";
177
+ key: "text";
178
+ alpha?: number;
179
+ }>;
180
+ readonly error: Readonly<{
181
+ source: "theme";
182
+ key: "danger";
183
+ alpha?: number;
184
+ }>;
185
+ };
186
+ };
187
+ readonly description: {
188
+ readonly textVariant: "caption";
189
+ readonly color: Readonly<{
190
+ source: "theme";
191
+ key: "textMuted";
192
+ alpha?: number;
193
+ }>;
194
+ };
195
+ };
196
+ //# sourceMappingURL=steps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../src/steps.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAEtE,qFAAqF;AACrF,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;AAExE,MAAM,MAAM,kBAAkB,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IACpE,EAAE,EAAE,EAAE,CAAC;IACP,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IACjE,KAAK,EAAE,SAAS,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC;IACzC,aAAa,EAAE,EAAE,CAAC;IAClB,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;CACtC,CAAC,CAAC;AAEH,eAAO,MAAM,aAAa;;CAE4C,CAAC;AAEvE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,K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,mBAAmB,GAC3B,SAAS,sBAAsB,CAAC,EAAE,CAAC,EAAE,CAyCvC;AAED,eAAO,MAAM,WAAW;;;;;;;QAepB,uFAAuF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwE1F,CAAC"}
package/dist/steps.js ADDED
@@ -0,0 +1,160 @@
1
+ import { fontWeight, glyph, spacing, stroke } from "./foundations.js";
2
+ import { semanticColors } from "./semantic-colors.js";
3
+ export const stepsDefaults = {
4
+ currentStepStatus: "current",
5
+ };
6
+ function assertNonEmpty(value, field) {
7
+ if (value.trim().length === 0) {
8
+ throw new TypeError(`Steps ${field} must not be empty`);
9
+ }
10
+ }
11
+ export function validateStepItemDescriptor(step) {
12
+ assertNonEmpty(step.id, "item id");
13
+ if (step.id !== step.id.trim()) {
14
+ throw new TypeError("Steps item id must not start or end with whitespace");
15
+ }
16
+ assertNonEmpty(step.label, "item label");
17
+ if (step.description !== undefined) {
18
+ assertNonEmpty(step.description, "item description");
19
+ }
20
+ }
21
+ export function validateStepsDescriptor(descriptor) {
22
+ if (descriptor.steps.length < 2) {
23
+ throw new RangeError("Steps must contain at least two steps");
24
+ }
25
+ const ids = new Set();
26
+ for (const step of descriptor.steps) {
27
+ validateStepItemDescriptor(step);
28
+ if (ids.has(step.id)) {
29
+ throw new TypeError(`Duplicate Steps item id: ${step.id}`);
30
+ }
31
+ ids.add(step.id);
32
+ }
33
+ if (!ids.has(descriptor.currentStepId)) {
34
+ throw new RangeError(`Steps currentStepId does not match any step id: ${String(descriptor.currentStepId)}`);
35
+ }
36
+ if (descriptor.currentStepStatus !== undefined &&
37
+ descriptor.currentStepStatus !== "current" &&
38
+ descriptor.currentStepStatus !== "error") {
39
+ throw new TypeError(`Unsupported Steps currentStepStatus: ${String(descriptor.currentStepStatus)}`);
40
+ }
41
+ }
42
+ export function validateStepsStatusLabels(labels) {
43
+ if (labels === null || typeof labels !== "object") {
44
+ throw new TypeError("Steps statusLabels must be an object");
45
+ }
46
+ for (const key of ["pending", "current", "complete", "error"]) {
47
+ const value = labels[key];
48
+ if (typeof value !== "string" || value.trim().length === 0) {
49
+ throw new TypeError(`Steps statusLabels.${key} must not be empty`);
50
+ }
51
+ }
52
+ }
53
+ /** A step is visually and semantically "reached" once it is no longer waiting. */
54
+ export function isStepReached(status) {
55
+ return status !== "pending";
56
+ }
57
+ /**
58
+ * Derives every step's status from its position relative to the single
59
+ * cursor, then attaches the order-preserving accessible name and the
60
+ * supplementary status announcement. Throws on a malformed descriptor,
61
+ * labels bag, or composer instead of silently rendering an inconsistent flow.
62
+ */
63
+ export function resolveStepsDescriptor(descriptor, options) {
64
+ validateStepsDescriptor(descriptor);
65
+ validateStepsStatusLabels(options.statusLabels);
66
+ if (typeof options.composeAccessibleName !== "function") {
67
+ throw new TypeError("Steps composeAccessibleName must be a function");
68
+ }
69
+ const currentStepStatus = descriptor.currentStepStatus ?? stepsDefaults.currentStepStatus;
70
+ const total = descriptor.steps.length;
71
+ const cursorIndex = descriptor.steps.findIndex((step) => step.id === descriptor.currentStepId);
72
+ return descriptor.steps.map((step, index) => {
73
+ const status = index < cursorIndex
74
+ ? "complete"
75
+ : index > cursorIndex
76
+ ? "pending"
77
+ : currentStepStatus;
78
+ const position = index + 1;
79
+ const accessibleName = options.composeAccessibleName({
80
+ position,
81
+ total,
82
+ label: step.label,
83
+ });
84
+ if (typeof accessibleName !== "string" || accessibleName.trim().length === 0) {
85
+ throw new TypeError("Steps composeAccessibleName must return a non-empty string");
86
+ }
87
+ return {
88
+ ...step,
89
+ status,
90
+ position,
91
+ total,
92
+ accessibleName,
93
+ statusLabel: options.statusLabels[status],
94
+ };
95
+ });
96
+ }
97
+ export const stepsRecipe = {
98
+ slots: [
99
+ "root",
100
+ "step",
101
+ "indicator",
102
+ "marker",
103
+ "connector",
104
+ "label",
105
+ "description",
106
+ ],
107
+ gap: spacing.xs,
108
+ indicator: {
109
+ size: glyph.md,
110
+ borderWidth: stroke.default,
111
+ activeBorderWidth: stroke.strong,
112
+ /** null means the renderer shows the step's own position number instead of a glyph. */
113
+ marks: {
114
+ pending: null,
115
+ current: null,
116
+ complete: "check",
117
+ error: "error",
118
+ },
119
+ border: {
120
+ pending: semanticColors.border.default,
121
+ current: semanticColors.content.brand,
122
+ complete: semanticColors.feedback.success.border,
123
+ error: semanticColors.feedback.danger.border,
124
+ },
125
+ background: {
126
+ pending: null,
127
+ current: null,
128
+ complete: semanticColors.feedback.success.badgeBackground,
129
+ error: semanticColors.feedback.danger.badgeBackground,
130
+ },
131
+ content: {
132
+ pending: semanticColors.content.secondary,
133
+ current: semanticColors.content.brand,
134
+ complete: semanticColors.feedback.success.foreground,
135
+ error: semanticColors.feedback.danger.foreground,
136
+ },
137
+ },
138
+ connector: {
139
+ height: stroke.default,
140
+ tone: {
141
+ reached: semanticColors.content.brand,
142
+ unreached: semanticColors.border.default,
143
+ },
144
+ },
145
+ label: {
146
+ textVariant: "label",
147
+ fontWeight: fontWeight.semibold,
148
+ color: {
149
+ pending: semanticColors.content.secondary,
150
+ current: semanticColors.content.primary,
151
+ complete: semanticColors.content.primary,
152
+ error: semanticColors.feedback.danger.foreground,
153
+ },
154
+ },
155
+ description: {
156
+ textVariant: "caption",
157
+ color: semanticColors.content.secondary,
158
+ },
159
+ };
160
+ //# sourceMappingURL=steps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steps.js","sourceRoot":"","sources":["../src/steps.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAgCtD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,iBAAiB,EAAE,SAAS;CACwC,CAAC;AA0CvE,SAAS,cAAc,CAAC,KAAa,EAAE,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AK,EAAE;YACL,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,SAAS;YACzC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,OAAO;YACvC,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,OAAO;YACxC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU;SACjD;KACF;IACD,WAAW,EAAE;QACX,WAAW,EAAE,SAAS;QACtB,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,SAAS;KACxC;CA0BF,CAAC","sourcesContent":["import type { ColorReference } from \"./color-references.js\";\nimport type { FontWeightValue, TextVariant } from \"./foundations.js\";\nimport type { SemanticIconName } from \"./icon.js\";\nimport { fontWeight, glyph, spacing, stroke } from \"./foundations.js\";\nimport { semanticColors } from \"./semantic-colors.js\";\n\n/**\n * Ant Design Steps' full surface (navigation/clickable jump, dot type, custom\n * per-item icon, vertical orientation) is intentionally not reproduced. Both\n * known consumers (Yajalal onboarding, BurnTok sign-up) are single-cursor,\n * horizontal, back-button-driven wizards; see docs/steps.md for the per-axis\n * rationale.\n */\nexport type StepStatus = \"pending\" | \"current\" | \"complete\" | \"error\";\n\n/** Only the cursor step can be \"current\" or \"error\"; every other step is derived. */\nexport type StepCursorStatus = Extract<StepStatus, \"current\" | \"error\">;\n\nexport type StepItemDescriptor<Id extends string = string> = Readonly<{\n id: Id;\n label: string;\n description?: string;\n}>;\n\n/**\n * A single stable cursor (`currentStepId`) is the source of truth instead of a\n * per-item status array, so \"two current steps\" or \"a completed step past an\n * unresolved error\" cannot be represented. Clickable jump is out of scope, so\n * the flow is always linear relative to the cursor.\n */\nexport type StepsDescriptor<Id extends string = string> = Readonly<{\n steps: readonly StepItemDescriptor<Id>[];\n currentStepId: Id;\n currentStepStatus?: StepCursorStatus;\n}>;\n\nexport const stepsDefaults = {\n currentStepStatus: \"current\",\n} as const satisfies Readonly<{ currentStepStatus: StepCursorStatus }>;\n\nexport type StepsStatusLabels = Readonly<{\n pending: string;\n current: string;\n complete: string;\n error: string;\n}>;\n\nexport type StepsAccessibleNameInfo = Readonly<{\n position: number;\n total: number;\n label: string;\n}>;\n\n/**\n * Products own the exact phrase order and counter-word grammar (Korean\n * \"3단계 중 2단계\" does not translate structurally to English \"step 2 of 3\"),\n * so the resolver invokes this composer instead of assembling copy itself.\n */\nexport type ComposeStepsAccessibleName = (\n info: StepsAccessibleNameInfo,\n) => string;\n\nexport type ResolvedStepDescriptor<Id extends string = string> =\n StepItemDescriptor<Id> &\n Readonly<{\n status: StepStatus;\n /** 1-indexed so position and label both preserve reading order for renderers. */\n position: number;\n total: number;\n /** Primary accessible name: order + label. Never says status by itself. */\n accessibleName: string;\n /** Supplementary status announcement (Web aria-describedby text / RN accessibilityHint). */\n statusLabel: string;\n }>;\n\nexport type ResolveStepsOptions = Readonly<{\n statusLabels: StepsStatusLabels;\n composeAccessibleName: ComposeStepsAccessibleName;\n}>;\n\nfunction assertNonEmpty(value: string, field: string): void {\n if (value.trim().length === 0) {\n throw new TypeError(`Steps ${field} must not be empty`);\n }\n}\n\nexport function validateStepItemDescriptor<Id extends string>(\n step: StepItemDescriptor<Id>,\n): void {\n assertNonEmpty(step.id, \"item id\");\n if (step.id !== step.id.trim()) {\n throw new TypeError(\"Steps item id must not start or end with whitespace\");\n }\n assertNonEmpty(step.label, \"item label\");\n if (step.description !== undefined) {\n assertNonEmpty(step.description, \"item description\");\n }\n}\n\nexport function validateStepsDescriptor<Id extends string>(\n descriptor: StepsDescriptor<Id>,\n): void {\n if (descriptor.steps.length < 2) {\n throw new RangeError(\"Steps must contain at least two steps\");\n }\n const ids = new Set<Id>();\n for (const step of descriptor.steps) {\n validateStepItemDescriptor(step);\n if (ids.has(step.id)) {\n throw new TypeError(`Duplicate Steps item id: ${step.id}`);\n }\n ids.add(step.id);\n }\n if (!ids.has(descriptor.currentStepId)) {\n throw new RangeError(\n `Steps currentStepId does not match any step id: ${String(descriptor.currentStepId)}`,\n );\n }\n if (\n descriptor.currentStepStatus !== undefined &&\n descriptor.currentStepStatus !== \"current\" &&\n descriptor.currentStepStatus !== \"error\"\n ) {\n throw new TypeError(\n `Unsupported Steps currentStepStatus: ${String(descriptor.currentStepStatus)}`,\n );\n }\n}\n\nexport function validateStepsStatusLabels(labels: StepsStatusLabels): void {\n if (labels === null || typeof labels !== \"object\") {\n throw new TypeError(\"Steps statusLabels must be an object\");\n }\n for (const key of [\"pending\", \"current\", \"complete\", \"error\"] as const) {\n const value = labels[key];\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new TypeError(`Steps statusLabels.${key} must not be empty`);\n }\n }\n}\n\n/** A step is visually and semantically \"reached\" once it is no longer waiting. */\nexport function isStepReached(status: StepStatus): boolean {\n return status !== \"pending\";\n}\n\n/**\n * Derives every step's status from its position relative to the single\n * cursor, then attaches the order-preserving accessible name and the\n * supplementary status announcement. Throws on a malformed descriptor,\n * labels bag, or composer instead of silently rendering an inconsistent flow.\n */\nexport function resolveStepsDescriptor<Id extends string>(\n descriptor: StepsDescriptor<Id>,\n options: ResolveStepsOptions,\n): readonly ResolvedStepDescriptor<Id>[] {\n validateStepsDescriptor(descriptor);\n validateStepsStatusLabels(options.statusLabels);\n if (typeof options.composeAccessibleName !== \"function\") {\n throw new TypeError(\"Steps composeAccessibleName must be a function\");\n }\n\n const currentStepStatus =\n descriptor.currentStepStatus ?? stepsDefaults.currentStepStatus;\n const total = descriptor.steps.length;\n const cursorIndex = descriptor.steps.findIndex(\n (step) => step.id === descriptor.currentStepId,\n );\n\n return descriptor.steps.map((step, index) => {\n const status: StepStatus =\n index < cursorIndex\n ? \"complete\"\n : index > cursorIndex\n ? \"pending\"\n : currentStepStatus;\n const position = index + 1;\n const accessibleName = options.composeAccessibleName({\n position,\n total,\n label: step.label,\n });\n if (typeof accessibleName !== \"string\" || accessibleName.trim().length === 0) {\n throw new TypeError(\n \"Steps composeAccessibleName must return a non-empty string\",\n );\n }\n return {\n ...step,\n status,\n position,\n total,\n accessibleName,\n statusLabel: options.statusLabels[status],\n };\n });\n}\n\nexport const stepsRecipe = {\n slots: [\n \"root\",\n \"step\",\n \"indicator\",\n \"marker\",\n \"connector\",\n \"label\",\n \"description\",\n ] as const,\n gap: spacing.xs,\n indicator: {\n size: glyph.md,\n borderWidth: stroke.default,\n activeBorderWidth: stroke.strong,\n /** null means the renderer shows the step's own position number instead of a glyph. */\n marks: {\n pending: null,\n current: null,\n complete: \"check\",\n error: \"error\",\n },\n border: {\n pending: semanticColors.border.default,\n current: semanticColors.content.brand,\n complete: semanticColors.feedback.success.border,\n error: semanticColors.feedback.danger.border,\n },\n background: {\n pending: null,\n current: null,\n complete: semanticColors.feedback.success.badgeBackground,\n error: semanticColors.feedback.danger.badgeBackground,\n },\n content: {\n pending: semanticColors.content.secondary,\n current: semanticColors.content.brand,\n complete: semanticColors.feedback.success.foreground,\n error: semanticColors.feedback.danger.foreground,\n },\n },\n connector: {\n height: stroke.default,\n tone: {\n reached: semanticColors.content.brand,\n unreached: semanticColors.border.default,\n },\n },\n label: {\n textVariant: \"label\",\n fontWeight: fontWeight.semibold,\n color: {\n pending: semanticColors.content.secondary,\n current: semanticColors.content.primary,\n complete: semanticColors.content.primary,\n error: semanticColors.feedback.danger.foreground,\n },\n },\n description: {\n textVariant: \"caption\",\n color: semanticColors.content.secondary,\n },\n} as const satisfies {\n slots: readonly string[];\n gap: number;\n indicator: {\n size: number;\n borderWidth: number;\n activeBorderWidth: number;\n marks: Record<StepStatus, SemanticIconName | null>;\n border: Record<StepStatus, ColorReference>;\n background: Record<StepStatus, ColorReference | null>;\n content: Record<StepStatus, ColorReference>;\n };\n connector: {\n height: number;\n tone: Record<\"reached\" | \"unreached\", ColorReference>;\n };\n label: {\n textVariant: TextVariant;\n fontWeight: FontWeightValue;\n color: Record<StepStatus, ColorReference>;\n };\n description: {\n textVariant: TextVariant;\n color: ColorReference;\n };\n};\n"]}
package/dist/tag.d.ts ADDED
@@ -0,0 +1,128 @@
1
+ import { type ColorReferencePalette } from "./color-references.js";
2
+ export type TagTone = "neutral" | "info" | "success" | "attention" | "brand";
3
+ export declare const tagDefaults: {
4
+ readonly tone: "neutral";
5
+ };
6
+ /**
7
+ * A single piece of static metadata (a position, a grade, a season). Tag has
8
+ * no interaction axis at all — no selected, no pressed, no closable. Removing
9
+ * or toggling a tag is deselection, which belongs to `Chip`.
10
+ */
11
+ export type TagDescriptor = Readonly<{
12
+ label: string;
13
+ tone?: TagTone;
14
+ }>;
15
+ export type ResolvedTagDescriptor = Readonly<{
16
+ label: string;
17
+ tone: TagTone;
18
+ }>;
19
+ export declare function validateTagDescriptor(descriptor: TagDescriptor): void;
20
+ export declare function resolveTagDescriptor(descriptor: TagDescriptor): ResolvedTagDescriptor;
21
+ /**
22
+ * Rectangular, not the pill `radius.full` that `chipRecipe` and `badgeRecipe`
23
+ * use, so a static Tag never reads as a pressable Chip or a status Badge at a
24
+ * glance. No `states` and no `focus` contract: nothing here is ever pressed
25
+ * or focused.
26
+ */
27
+ export declare const tagRecipe: {
28
+ readonly slots: readonly ["root", "label"];
29
+ readonly defaults: {
30
+ readonly tone: "neutral";
31
+ };
32
+ readonly tones: {
33
+ readonly neutral: {
34
+ readonly background: Readonly<{
35
+ source: "theme";
36
+ key: "surfaceAlt";
37
+ alpha?: number;
38
+ }>;
39
+ readonly content: Readonly<{
40
+ source: "theme";
41
+ key: "textMuted";
42
+ alpha?: number;
43
+ }>;
44
+ readonly border: null;
45
+ };
46
+ readonly brand: {
47
+ readonly background: Readonly<{
48
+ source: "theme";
49
+ key: "surfaceAccent";
50
+ alpha?: number;
51
+ }>;
52
+ readonly content: Readonly<{
53
+ source: "theme";
54
+ key: "contentBrand";
55
+ alpha?: number;
56
+ }>;
57
+ readonly border: null;
58
+ };
59
+ readonly info: {
60
+ readonly background: Readonly<{
61
+ source: "accent";
62
+ key: "info";
63
+ alpha?: number;
64
+ }>;
65
+ readonly content: Readonly<{
66
+ source: "accent";
67
+ key: "info";
68
+ alpha?: number;
69
+ }>;
70
+ readonly border: Readonly<{
71
+ source: "accent";
72
+ key: "info";
73
+ alpha?: number;
74
+ }>;
75
+ };
76
+ readonly success: {
77
+ readonly background: Readonly<{
78
+ source: "accent";
79
+ key: "success";
80
+ alpha?: number;
81
+ }>;
82
+ readonly content: Readonly<{
83
+ source: "accent";
84
+ key: "success";
85
+ alpha?: number;
86
+ }>;
87
+ readonly border: Readonly<{
88
+ source: "accent";
89
+ key: "success";
90
+ alpha?: number;
91
+ }>;
92
+ };
93
+ readonly attention: {
94
+ readonly background: Readonly<{
95
+ source: "accent";
96
+ key: "attention";
97
+ alpha?: number;
98
+ }>;
99
+ readonly content: Readonly<{
100
+ source: "accent";
101
+ key: "attention";
102
+ alpha?: number;
103
+ }>;
104
+ readonly border: Readonly<{
105
+ source: "accent";
106
+ key: "attention";
107
+ alpha?: number;
108
+ }>;
109
+ };
110
+ };
111
+ readonly size: {
112
+ readonly minHeight: 20;
113
+ readonly paddingHorizontal: 4;
114
+ readonly gap: 4;
115
+ readonly textVariant: "caption";
116
+ readonly fontWeight: "600";
117
+ };
118
+ readonly radius: "sm";
119
+ readonly borderWidth: 1;
120
+ };
121
+ export type ResolvedTagPresentation = Readonly<{
122
+ background: string;
123
+ content: string;
124
+ border: string | null;
125
+ }>;
126
+ /** Resolve the same Tag recipe for non-CSS renderers. */
127
+ export declare function resolveTagPresentation(tone: TagTone, palette: ColorReferencePalette): ResolvedTagPresentation;
128
+ //# sourceMappingURL=tag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAC;AAI/B,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AAE7E,eAAO,MAAM,WAAW;;CAEwB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACf,CAAC,CAAC;AAgBH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,aAAa,GAAG,IAAI,CAQrE;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,aAAa,GACxB,qBAAqB,CAMvB;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CZ,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC,CAAC;AAEH,yDAAyD;AACzD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,qBAAqB,GAC7B,uBAAuB,CAUzB"}