@nibapp/ui 0.0.0-stage → 0.1.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 (292) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +21 -0
  3. package/README.md +124 -2
  4. package/TRADEMARKS.md +22 -0
  5. package/dist/_bundled/money/index.d.ts +98 -0
  6. package/dist/_bundled/money/index.js +152 -0
  7. package/dist/_bundled/tokens/index.d.ts +2 -0
  8. package/dist/_bundled/tokens/index.js +2 -0
  9. package/dist/_bundled/tokens/palette.gen.d.ts +51 -0
  10. package/dist/_bundled/tokens/palette.gen.js +206 -0
  11. package/dist/_bundled/tokens/spec.d.ts +291 -0
  12. package/dist/_bundled/tokens/spec.js +221 -0
  13. package/dist/components/accordion.d.ts +27 -0
  14. package/dist/components/accordion.js +66 -0
  15. package/dist/components/alert-dialog.d.ts +59 -0
  16. package/dist/components/alert-dialog.js +82 -0
  17. package/dist/components/alert.d.ts +141 -0
  18. package/dist/components/alert.js +55 -0
  19. package/dist/components/appear.d.ts +21 -0
  20. package/dist/components/appear.js +42 -0
  21. package/dist/components/avatar.d.ts +196 -0
  22. package/dist/components/avatar.js +135 -0
  23. package/dist/components/badge.d.ts +183 -0
  24. package/dist/components/badge.js +68 -0
  25. package/dist/components/block-stack.d.ts +33 -0
  26. package/dist/components/block-stack.js +197 -0
  27. package/dist/components/button.d.ts +327 -0
  28. package/dist/components/button.js +101 -0
  29. package/dist/components/card.d.ts +131 -0
  30. package/dist/components/card.js +100 -0
  31. package/dist/components/checkbox.d.ts +34 -0
  32. package/dist/components/checkbox.js +37 -0
  33. package/dist/components/choice-row.d.ts +104 -0
  34. package/dist/components/choice-row.js +56 -0
  35. package/dist/components/clamped-text.d.ts +17 -0
  36. package/dist/components/clamped-text.js +47 -0
  37. package/dist/components/code-block.d.ts +48 -0
  38. package/dist/components/code-block.js +124 -0
  39. package/dist/components/code-input.d.ts +49 -0
  40. package/dist/components/code-input.js +59 -0
  41. package/dist/components/combobox.d.ts +194 -0
  42. package/dist/components/combobox.js +176 -0
  43. package/dist/components/command-palette.d.ts +57 -0
  44. package/dist/components/command-palette.js +83 -0
  45. package/dist/components/context-menu.d.ts +24 -0
  46. package/dist/components/context-menu.js +30 -0
  47. package/dist/components/copy-button.d.ts +9 -0
  48. package/dist/components/copy-button.js +20 -0
  49. package/dist/components/copy-command.d.ts +18 -0
  50. package/dist/components/copy-command.js +19 -0
  51. package/dist/components/data-table.d.ts +240 -0
  52. package/dist/components/data-table.js +63 -0
  53. package/dist/components/dialog.d.ts +80 -0
  54. package/dist/components/dialog.js +85 -0
  55. package/dist/components/diff-lines.d.ts +20 -0
  56. package/dist/components/diff-lines.js +10 -0
  57. package/dist/components/diff-view.d.ts +128 -0
  58. package/dist/components/diff-view.js +675 -0
  59. package/dist/components/disclosure.d.ts +33 -0
  60. package/dist/components/disclosure.js +51 -0
  61. package/dist/components/drawn-check.d.ts +8 -0
  62. package/dist/components/drawn-check.js +16 -0
  63. package/dist/components/edge-resizer.d.ts +26 -0
  64. package/dist/components/edge-resizer.js +53 -0
  65. package/dist/components/empty-state.d.ts +112 -0
  66. package/dist/components/empty-state.js +56 -0
  67. package/dist/components/expand-toggle.d.ts +19 -0
  68. package/dist/components/expand-toggle.js +10 -0
  69. package/dist/components/field.d.ts +48 -0
  70. package/dist/components/field.js +60 -0
  71. package/dist/components/filter-chip.d.ts +47 -0
  72. package/dist/components/filter-chip.js +33 -0
  73. package/dist/components/group.d.ts +10 -0
  74. package/dist/components/group.js +9 -0
  75. package/dist/components/icon-text.d.ts +11 -0
  76. package/dist/components/icon-text.js +10 -0
  77. package/dist/components/image-sources.d.ts +57 -0
  78. package/dist/components/image-sources.js +58 -0
  79. package/dist/components/image-thumbnail.d.ts +34 -0
  80. package/dist/components/image-thumbnail.js +58 -0
  81. package/dist/components/image-viewer.d.ts +60 -0
  82. package/dist/components/image-viewer.js +411 -0
  83. package/dist/components/inline-edit.d.ts +22 -0
  84. package/dist/components/inline-edit.js +51 -0
  85. package/dist/components/input.d.ts +155 -0
  86. package/dist/components/input.js +109 -0
  87. package/dist/components/item-label.d.ts +11 -0
  88. package/dist/components/item-label.js +5 -0
  89. package/dist/components/item-row.d.ts +23 -0
  90. package/dist/components/item-row.js +19 -0
  91. package/dist/components/kbd.d.ts +55 -0
  92. package/dist/components/kbd.js +86 -0
  93. package/dist/components/link-policy.d.ts +24 -0
  94. package/dist/components/link-policy.js +32 -0
  95. package/dist/components/linked-text.d.ts +15 -0
  96. package/dist/components/linked-text.js +48 -0
  97. package/dist/components/loading-region.d.ts +18 -0
  98. package/dist/components/loading-region.js +17 -0
  99. package/dist/components/markdown.d.ts +34 -0
  100. package/dist/components/markdown.js +307 -0
  101. package/dist/components/menu.d.ts +132 -0
  102. package/dist/components/menu.js +102 -0
  103. package/dist/components/message-bubble.d.ts +57 -0
  104. package/dist/components/message-bubble.js +28 -0
  105. package/dist/components/meta-line.d.ts +28 -0
  106. package/dist/components/meta-line.js +36 -0
  107. package/dist/components/money-input.d.ts +23 -0
  108. package/dist/components/money-input.js +34 -0
  109. package/dist/components/native-select.d.ts +120 -0
  110. package/dist/components/native-select.js +85 -0
  111. package/dist/components/page-trail.d.ts +30 -0
  112. package/dist/components/page-trail.js +43 -0
  113. package/dist/components/page.d.ts +80 -0
  114. package/dist/components/page.js +60 -0
  115. package/dist/components/path-text.d.ts +8 -0
  116. package/dist/components/path-text.js +11 -0
  117. package/dist/components/percent-input.d.ts +20 -0
  118. package/dist/components/percent-input.js +32 -0
  119. package/dist/components/popover.d.ts +52 -0
  120. package/dist/components/popover.js +36 -0
  121. package/dist/components/progress.d.ts +389 -0
  122. package/dist/components/progress.js +142 -0
  123. package/dist/components/radio.d.ts +65 -0
  124. package/dist/components/radio.js +54 -0
  125. package/dist/components/remote-image-gate.d.ts +34 -0
  126. package/dist/components/remote-image-gate.js +60 -0
  127. package/dist/components/resizable.d.ts +23 -0
  128. package/dist/components/resizable.js +30 -0
  129. package/dist/components/rolling-number.d.ts +13 -0
  130. package/dist/components/rolling-number.js +69 -0
  131. package/dist/components/scroll-area.d.ts +17 -0
  132. package/dist/components/scroll-area.js +25 -0
  133. package/dist/components/section-label.d.ts +10 -0
  134. package/dist/components/section-label.js +21 -0
  135. package/dist/components/section-nav.d.ts +22 -0
  136. package/dist/components/section-nav.js +80 -0
  137. package/dist/components/segmented-control.d.ts +125 -0
  138. package/dist/components/segmented-control.js +101 -0
  139. package/dist/components/select.d.ts +120 -0
  140. package/dist/components/select.js +89 -0
  141. package/dist/components/separator.d.ts +10 -0
  142. package/dist/components/separator.js +12 -0
  143. package/dist/components/sheet.d.ts +101 -0
  144. package/dist/components/sheet.js +129 -0
  145. package/dist/components/shortcut-recorder.d.ts +31 -0
  146. package/dist/components/shortcut-recorder.js +67 -0
  147. package/dist/components/skeleton.d.ts +31 -0
  148. package/dist/components/skeleton.js +33 -0
  149. package/dist/components/slider.d.ts +138 -0
  150. package/dist/components/slider.js +98 -0
  151. package/dist/components/spinner.d.ts +37 -0
  152. package/dist/components/spinner.js +16 -0
  153. package/dist/components/switch.d.ts +59 -0
  154. package/dist/components/switch.js +56 -0
  155. package/dist/components/tab-strip.d.ts +29 -0
  156. package/dist/components/tab-strip.js +42 -0
  157. package/dist/components/tabs.d.ts +13 -0
  158. package/dist/components/tabs.js +68 -0
  159. package/dist/components/text-link.d.ts +54 -0
  160. package/dist/components/text-link.js +38 -0
  161. package/dist/components/textarea.d.ts +75 -0
  162. package/dist/components/textarea.js +90 -0
  163. package/dist/components/toast.d.ts +74 -0
  164. package/dist/components/toast.js +128 -0
  165. package/dist/components/tooltip.d.ts +50 -0
  166. package/dist/components/tooltip.js +46 -0
  167. package/dist/components/truncated-text.d.ts +15 -0
  168. package/dist/components/truncated-text.js +19 -0
  169. package/dist/i18n/defaults.d.ts +7 -0
  170. package/dist/i18n/defaults.js +7 -0
  171. package/dist/i18n/format.d.ts +84 -0
  172. package/dist/i18n/format.js +169 -0
  173. package/dist/i18n/index.d.ts +6 -0
  174. package/dist/i18n/index.js +8 -0
  175. package/dist/i18n/locales/ru-formatters.d.ts +3 -0
  176. package/dist/i18n/locales/ru-formatters.js +22 -0
  177. package/dist/i18n/locales/ru.d.ts +5 -0
  178. package/dist/i18n/locales/ru.js +185 -0
  179. package/dist/i18n/plural.d.ts +20 -0
  180. package/dist/i18n/plural.js +26 -0
  181. package/dist/i18n/provider.d.ts +36 -0
  182. package/dist/i18n/provider.js +39 -0
  183. package/dist/i18n/rich.d.ts +14 -0
  184. package/dist/i18n/rich.js +44 -0
  185. package/dist/i18n/ru-plural.d.ts +3 -0
  186. package/dist/i18n/ru-plural.js +4 -0
  187. package/dist/i18n/strings/alert-dialog.d.ts +5 -0
  188. package/dist/i18n/strings/alert-dialog.js +5 -0
  189. package/dist/i18n/strings/block-stack.d.ts +17 -0
  190. package/dist/i18n/strings/block-stack.js +11 -0
  191. package/dist/i18n/strings/code-block.d.ts +18 -0
  192. package/dist/i18n/strings/code-block.js +13 -0
  193. package/dist/i18n/strings/combobox.d.ts +12 -0
  194. package/dist/i18n/strings/combobox.js +10 -0
  195. package/dist/i18n/strings/command-palette.d.ts +17 -0
  196. package/dist/i18n/strings/command-palette.js +11 -0
  197. package/dist/i18n/strings/diff-view.d.ts +92 -0
  198. package/dist/i18n/strings/diff-view.js +68 -0
  199. package/dist/i18n/strings/image-viewer.d.ts +43 -0
  200. package/dist/i18n/strings/image-viewer.js +32 -0
  201. package/dist/i18n/strings/index.d.ts +314 -0
  202. package/dist/i18n/strings/index.js +43 -0
  203. package/dist/i18n/strings/kbd.d.ts +42 -0
  204. package/dist/i18n/strings/kbd.js +39 -0
  205. package/dist/i18n/strings/markdown.d.ts +23 -0
  206. package/dist/i18n/strings/markdown.js +18 -0
  207. package/dist/i18n/strings/money.d.ts +7 -0
  208. package/dist/i18n/strings/money.js +5 -0
  209. package/dist/i18n/strings/primitives.d.ts +25 -0
  210. package/dist/i18n/strings/primitives.js +18 -0
  211. package/dist/i18n/strings/progress.d.ts +4 -0
  212. package/dist/i18n/strings/progress.js +4 -0
  213. package/dist/i18n/strings/shortcut-recorder.d.ts +15 -0
  214. package/dist/i18n/strings/shortcut-recorder.js +11 -0
  215. package/dist/i18n/strings/time.d.ts +41 -0
  216. package/dist/i18n/strings/time.js +20 -0
  217. package/dist/i18n/strings/toast.d.ts +6 -0
  218. package/dist/i18n/strings/toast.js +6 -0
  219. package/dist/i18n/time-zones.d.ts +20 -0
  220. package/dist/i18n/time-zones.js +64 -0
  221. package/dist/index.d.ts +84 -0
  222. package/dist/index.js +88 -0
  223. package/dist/lib/ansi.d.ts +55 -0
  224. package/dist/lib/ansi.js +438 -0
  225. package/dist/lib/clock.d.ts +32 -0
  226. package/dist/lib/clock.js +106 -0
  227. package/dist/lib/cn.d.ts +12 -0
  228. package/dist/lib/cn.js +28 -0
  229. package/dist/lib/control-props.d.ts +21 -0
  230. package/dist/lib/control-props.js +14 -0
  231. package/dist/lib/direction.d.ts +13 -0
  232. package/dist/lib/direction.js +25 -0
  233. package/dist/lib/image-size.d.ts +12 -0
  234. package/dist/lib/image-size.js +66 -0
  235. package/dist/lib/keycaps.d.ts +21 -0
  236. package/dist/lib/keycaps.js +62 -0
  237. package/dist/lib/keyed.d.ts +9 -0
  238. package/dist/lib/keyed.js +14 -0
  239. package/dist/lib/keys.d.ts +49 -0
  240. package/dist/lib/keys.js +159 -0
  241. package/dist/lib/kit-motion.d.ts +9 -0
  242. package/dist/lib/kit-motion.js +12 -0
  243. package/dist/lib/link-check-dialog.d.ts +11 -0
  244. package/dist/lib/link-check-dialog.js +18 -0
  245. package/dist/lib/motion-features.d.ts +1 -0
  246. package/dist/lib/motion-features.js +4 -0
  247. package/dist/lib/motion-provider.d.ts +5 -0
  248. package/dist/lib/motion-provider.js +8 -0
  249. package/dist/lib/motion.d.ts +39 -0
  250. package/dist/lib/motion.js +49 -0
  251. package/dist/lib/number-format.d.ts +114 -0
  252. package/dist/lib/number-format.js +313 -0
  253. package/dist/lib/patch.d.ts +72 -0
  254. package/dist/lib/patch.js +344 -0
  255. package/dist/lib/path.d.ts +34 -0
  256. package/dist/lib/path.js +85 -0
  257. package/dist/lib/search.d.ts +10 -0
  258. package/dist/lib/search.js +20 -0
  259. package/dist/lib/shiki-themes.d.ts +7 -0
  260. package/dist/lib/shiki-themes.js +115 -0
  261. package/dist/lib/shiki.d.ts +101 -0
  262. package/dist/lib/shiki.js +353 -0
  263. package/dist/lib/shortcut-context.d.ts +23 -0
  264. package/dist/lib/shortcut-context.js +29 -0
  265. package/dist/lib/text.d.ts +56 -0
  266. package/dist/lib/text.js +149 -0
  267. package/dist/lib/theme-scope.d.ts +18 -0
  268. package/dist/lib/theme-scope.js +24 -0
  269. package/dist/lib/theme.d.ts +40 -0
  270. package/dist/lib/theme.js +96 -0
  271. package/dist/lib/tree-keys.d.ts +72 -0
  272. package/dist/lib/tree-keys.js +126 -0
  273. package/dist/lib/url.d.ts +17 -0
  274. package/dist/lib/url.js +38 -0
  275. package/dist/lib/use-copy-to-clipboard.d.ts +13 -0
  276. package/dist/lib/use-copy-to-clipboard.js +40 -0
  277. package/dist/lib/use-delayed-loading.d.ts +11 -0
  278. package/dist/lib/use-delayed-loading.js +31 -0
  279. package/dist/lib/use-file-picker.d.ts +26 -0
  280. package/dist/lib/use-file-picker.js +43 -0
  281. package/dist/lib/use-hydrated.d.ts +6 -0
  282. package/dist/lib/use-hydrated.js +11 -0
  283. package/dist/lib/use-latest.d.ts +12 -0
  284. package/dist/lib/use-latest.js +22 -0
  285. package/dist/lib/use-resolved-theme.d.ts +12 -0
  286. package/dist/lib/use-resolved-theme.js +25 -0
  287. package/dist/styles/base.css +393 -0
  288. package/dist/styles/code.css +35 -0
  289. package/dist/styles/fonts.css +12 -0
  290. package/dist/styles/index.css +13 -0
  291. package/dist/styles/tokens.gen.css +494 -0
  292. package/package.json +208 -4
@@ -0,0 +1,221 @@
1
+ export const BRAND_HEX = "#0169ff";
2
+ export const FOCUS_MIX = { light: 100, dark: 72 };
3
+ export const SURFACE_LIGHT = [0.999, 0.0015, 84];
4
+ const WARM_HUE = 84;
5
+ const LIGHT_L = [0.991, 0.979, 0.961, 0.944, 0.926, 0.902, 0.866, 0.805, 0, 0, 0.52, 0.218];
6
+ const DARK_L = [0.212, 0.235, 0.262, 0.288, 0.314, 0.346, 0.396, 0.474, 0, 0, 0.78, 0.955];
7
+ const GRAY_C_LIGHT = [
8
+ 0.0035,
9
+ 0.0045,
10
+ 0.006,
11
+ 0.0065,
12
+ 0.007,
13
+ 0.0075,
14
+ 0.008,
15
+ 0.009,
16
+ 0.008,
17
+ 0.008,
18
+ 0.008,
19
+ 0.006
20
+ ];
21
+ const GRAY_C_DARK = [
22
+ 0.003,
23
+ 0.0035,
24
+ 0.004,
25
+ 0.0045,
26
+ 0.005,
27
+ 0.0055,
28
+ 0.006,
29
+ 0.007,
30
+ 0.007,
31
+ 0.007,
32
+ 0.006,
33
+ 0.004
34
+ ];
35
+ const step = (xs, i) => {
36
+ const v = xs[i];
37
+ if (v === undefined)
38
+ throw new Error(`ramp index ${i} out of range`);
39
+ return v;
40
+ };
41
+ const toRamp = (xs) => {
42
+ if (xs.length !== 12)
43
+ throw new Error("ramp must have 12 steps");
44
+ const at = (i) => step(xs, i);
45
+ return [at(0), at(1), at(2), at(3), at(4), at(5), at(6), at(7), at(8), at(9), at(10), at(11)];
46
+ };
47
+ function grayRamp(mode) {
48
+ const L = mode === "light" ? LIGHT_L : DARK_L;
49
+ const C = mode === "light" ? GRAY_C_LIGHT : GRAY_C_DARK;
50
+ const solid = mode === "light" ? [0.6, 0.505] : [0.56, 0.702];
51
+ const text = mode === "light" ? 0.426 : 0.8;
52
+ return toRamp(Array.from({ length: 12 }, (_, i) => {
53
+ const l = i === 8 ? step(solid, 0) : i === 9 ? step(solid, 1) : i === 10 ? text : step(L, i);
54
+ return [l, step(C, i), WARM_HUE];
55
+ }));
56
+ }
57
+ const CHROMA_SHAPE = [0.05, 0.1, 0.18, 0.26, 0.34, 0.42, 0.52, 0.68, 1, 0.96, 0.82, 0.42];
58
+ function hueRamp(spec, mode) {
59
+ const L = mode === "light" ? LIGHT_L : DARK_L;
60
+ const idx = mode === "light" ? 0 : 1;
61
+ const solidL = spec.solid[idx];
62
+ return toRamp(Array.from({ length: 12 }, (_, i) => {
63
+ let l = step(L, i);
64
+ if (i === 8)
65
+ l = solidL;
66
+ if (i === 9)
67
+ l = mode === "light" ? solidL - 0.045 : solidL + 0.045;
68
+ if (i === 10 && spec.text)
69
+ l = spec.text[idx];
70
+ const darkDamp = mode === "dark" && i < 8 ? 0.78 : 1;
71
+ return [l, spec.c * step(CHROMA_SHAPE, i) * darkDamp, spec.h];
72
+ }));
73
+ }
74
+ export const HUES = {
75
+ blue: { h: 260.44, c: 0.2373, solid: [0.5692, 0.66], text: [0.505, 0.78] },
76
+ green: { h: 152, c: 0.15, solid: [0.545, 0.66], text: [0.48, 0.8], onWhite: 0.545 },
77
+ amber: { h: 72, c: 0.155, solid: [0.78, 0.8], text: [0.52, 0.84] },
78
+ red: { h: 25, c: 0.19, solid: [0.575, 0.64], text: [0.505, 0.78], onWhite: 0.575 },
79
+ violet: { h: 295, c: 0.15, solid: [0.58, 0.64], text: [0.5, 0.8] }
80
+ };
81
+ export const RAMPS = {
82
+ light: {
83
+ gray: grayRamp("light"),
84
+ blue: hueRamp(HUES.blue, "light"),
85
+ green: hueRamp(HUES.green, "light"),
86
+ amber: hueRamp(HUES.amber, "light"),
87
+ red: hueRamp(HUES.red, "light"),
88
+ violet: hueRamp(HUES.violet, "light")
89
+ },
90
+ dark: {
91
+ gray: grayRamp("dark"),
92
+ blue: hueRamp(HUES.blue, "dark"),
93
+ green: hueRamp(HUES.green, "dark"),
94
+ amber: hueRamp(HUES.amber, "dark"),
95
+ red: hueRamp(HUES.red, "dark"),
96
+ violet: hueRamp(HUES.violet, "dark")
97
+ }
98
+ };
99
+ const soften = (color) => ({ mix: [color, ["gray", 11], 0.18] });
100
+ export const SYNTAX = {
101
+ light: {
102
+ fg: ["gray", 12],
103
+ muted: ["gray", 11],
104
+ comment: ["gray", 10],
105
+ keyword: ["violet", 11],
106
+ string: ["green", 11],
107
+ number: ["amber", 11],
108
+ fn: ["blue", 11],
109
+ type: { mix: [["blue", 11], ["green", 11], 0.5] },
110
+ tag: { mix: [["red", 11], ["gray", 11], 0.2] },
111
+ attribute: ["amber", 11],
112
+ regex: ["red", 11],
113
+ inserted: ["green", 11],
114
+ deleted: ["red", 11]
115
+ },
116
+ dark: {
117
+ fg: { mix: [["gray", 12], ["gray", 11], 0.22] },
118
+ muted: ["gray", 11],
119
+ comment: ["gray", 10],
120
+ keyword: soften(["violet", 11]),
121
+ string: soften(["green", 11]),
122
+ number: soften(["amber", 11]),
123
+ fn: soften(["blue", 11]),
124
+ type: soften({ mix: [["blue", 11], ["green", 11], 0.5] }),
125
+ tag: soften(["red", 11]),
126
+ attribute: soften(["amber", 11]),
127
+ regex: soften(["red", 11]),
128
+ inserted: soften(["green", 11]),
129
+ deleted: soften(["red", 11])
130
+ }
131
+ };
132
+ export const PERSONA_HUES = {
133
+ clay: 42,
134
+ ochre: 78,
135
+ sage: 140,
136
+ teal: 192,
137
+ slate: 245,
138
+ iris: 278,
139
+ plum: 330,
140
+ rose: 12
141
+ };
142
+ export const RADII = {
143
+ xs: "0.25rem",
144
+ sm: "0.375rem",
145
+ md: "0.5rem",
146
+ lg: "0.625rem",
147
+ xl: "0.75rem",
148
+ "2xl": "1rem",
149
+ "3xl": "1.375rem",
150
+ "4xl": "1.75rem"
151
+ };
152
+ export const CONTAINERS = {
153
+ reading: "46rem",
154
+ form: "42rem",
155
+ page: "64rem",
156
+ wide: "76rem",
157
+ card: "25rem",
158
+ "card-wide": "44rem",
159
+ bar: "40rem"
160
+ };
161
+ export const PAGE_STEPS = {
162
+ "page-md": "40rem",
163
+ "page-lg": "64rem"
164
+ };
165
+ export const LAYERS = {
166
+ sticky: 10,
167
+ dropdown: 20,
168
+ banner: 30,
169
+ drawer: 40,
170
+ tour: 45,
171
+ toast: 50,
172
+ overlay: 60,
173
+ tooltip: 70
174
+ };
175
+ export const LAYOUT = {
176
+ sidebar: "16.5rem",
177
+ header: "3.25rem",
178
+ "bottom-bar": "2.75rem",
179
+ "pane-min": "18.75rem"
180
+ };
181
+ export const TYPE_SCALE = {
182
+ "2xs": ["0.6875rem", "1rem", "0.01em"],
183
+ xs: ["0.75rem", "1.125rem", "0.005em"],
184
+ sm: ["0.8125rem", "1.25rem", "0em"],
185
+ base: ["0.875rem", "1.375rem", "-0.003em"],
186
+ md: ["0.9375rem", "1.5rem", "-0.006em"],
187
+ lg: ["1.0625rem", "1.625rem", "-0.011em"],
188
+ xl: ["1.25rem", "1.75rem", "-0.015em"],
189
+ "2xl": ["1.5rem", "2rem", "-0.019em"],
190
+ "3xl": ["1.875rem", "2.375rem", "-0.022em"],
191
+ "4xl": ["2.375rem", "2.75rem", "-0.025em"],
192
+ "5xl": ["3rem", "3.375rem", "-0.028em"],
193
+ "6xl": ["3.75rem", "4rem", "-0.03em"]
194
+ };
195
+ export const DURATIONS = {
196
+ instant: 80,
197
+ fast: 120,
198
+ base: 180,
199
+ moderate: 240,
200
+ slow: 320,
201
+ slower: 480,
202
+ glacial: 800,
203
+ loaderDelay: 200,
204
+ loaderMin: 400
205
+ };
206
+ export const EASINGS = {
207
+ standard: [0.2, 0, 0, 1],
208
+ out: [0.16, 1, 0.3, 1],
209
+ in: [0.5, 0, 0.75, 0],
210
+ inOut: [0.65, 0, 0.35, 1],
211
+ emphasized: [0.3, 0, 0, 1.15],
212
+ sheet: [0.32, 0.72, 0, 1]
213
+ };
214
+ export const SPRINGS = {
215
+ snappy: { visualDuration: 0.14, bounce: 0 },
216
+ smooth: { visualDuration: 0.17, bounce: 0 },
217
+ gentle: { visualDuration: 0.42, bounce: 0 },
218
+ bouncy: { visualDuration: 0.38, bounce: 0.28 },
219
+ signature: { visualDuration: 0.5, bounce: 0.2 }
220
+ };
221
+ export const SPRING_CSS_REST = 0.01;
@@ -0,0 +1,27 @@
1
+ import { Accordion as BaseAccordion } from "@base-ui/react/accordion";
2
+ import { type ComponentProps } from "react";
3
+ /**
4
+ * `card`: each item its own bordered row on the surface, 8 px apart (the files an import would
5
+ * change). `plain`: no chrome, for an accordion inside other content (a held message's text in its
6
+ * card); the trigger takes its text from where it sits and wraps.
7
+ */
8
+ type AccordionVariant = "card" | "plain";
9
+ export interface AccordionProps extends ComponentProps<typeof BaseAccordion.Root> {
10
+ readonly variant?: AccordionVariant;
11
+ }
12
+ /**
13
+ * A list of things, each a header that opens its own panel: the files a change touches, a message's
14
+ * full text. `multiple` lets several stay open, as a list of files wants. One quiet fold under a label
15
+ * ("Advanced", "Details") is a `Disclosure`.
16
+ *
17
+ * Panels open at their full height at once; only the chevron turns and the content fades in (§7).
18
+ */
19
+ export declare function Accordion({ variant, className, ...props }: AccordionProps): import("react").JSX.Element;
20
+ export declare function AccordionItem({ className, ...props }: ComponentProps<typeof BaseAccordion.Item>): import("react").JSX.Element;
21
+ /**
22
+ * The item's header: a heading (`h3`) holding the button that opens the panel, with a chevron before
23
+ * the children. Its children are the button's name.
24
+ */
25
+ export declare function AccordionTrigger({ className, children, ...props }: ComponentProps<typeof BaseAccordion.Trigger>): import("react").JSX.Element;
26
+ export declare function AccordionPanel({ className, ...props }: ComponentProps<typeof BaseAccordion.Panel>): import("react").JSX.Element;
27
+ export {};
@@ -0,0 +1,66 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Accordion as BaseAccordion } from "@base-ui/react/accordion";
4
+ import { createContext, use } from "react";
5
+ import { tv, withBase } from "../lib/cn.js";
6
+ import { DisclosureChevron } from "./disclosure.js";
7
+ const AccordionVariantContext = createContext("card");
8
+ const accordionStyles = tv({
9
+ slots: {
10
+ root: "flex min-w-0 flex-col",
11
+ item: "flex min-w-0 flex-col",
12
+ header: "flex min-w-0",
13
+ trigger: [
14
+ "flex w-full min-w-0 text-start outline-none focus-visible:ring-focus",
15
+ "data-disabled:pointer-events-none data-disabled:opacity-45",
16
+ ],
17
+ // One line tall, so the chevron sits on the first line of a header that wraps.
18
+ chevronBox: "flex h-lh shrink-0 items-center",
19
+ chevron: "text-fg-subtle",
20
+ // Opens at its full height at once (no layout motion, system.md §7); only the content fades in.
21
+ panel: [
22
+ "transition-opacity duration-(--duration-fast) ease-standard",
23
+ "data-starting-style:opacity-0 data-ending-style:opacity-0 motion-reduce:transition-none",
24
+ ],
25
+ },
26
+ variants: {
27
+ variant: {
28
+ card: {
29
+ root: "gap-2",
30
+ item: "overflow-hidden rounded-lg border border-border bg-surface",
31
+ // The item clips its corners, so the focus ring sits inside the row.
32
+ trigger: "items-center gap-2 rounded-[inherit] px-3 py-2 text-sm focus-visible:outline-offset-[-2px]",
33
+ },
34
+ plain: {
35
+ trigger: "items-start gap-1.5 rounded-sm",
36
+ },
37
+ },
38
+ },
39
+ defaultVariants: { variant: "card" },
40
+ });
41
+ /**
42
+ * A list of things, each a header that opens its own panel: the files a change touches, a message's
43
+ * full text. `multiple` lets several stay open, as a list of files wants. One quiet fold under a label
44
+ * ("Advanced", "Details") is a `Disclosure`.
45
+ *
46
+ * Panels open at their full height at once; only the chevron turns and the content fades in (§7).
47
+ */
48
+ export function Accordion({ variant = "card", className, ...props }) {
49
+ return (_jsx(AccordionVariantContext, { value: variant, children: _jsx(BaseAccordion.Root, { "data-slot": "accordion", "data-variant": variant, className: withBase(accordionStyles({ variant }).root(), className), ...props }) }));
50
+ }
51
+ export function AccordionItem({ className, ...props }) {
52
+ const variant = use(AccordionVariantContext);
53
+ return (_jsx(BaseAccordion.Item, { "data-slot": "accordion-item", className: withBase(accordionStyles({ variant }).item(), className), ...props }));
54
+ }
55
+ /**
56
+ * The item's header: a heading (`h3`) holding the button that opens the panel, with a chevron before
57
+ * the children. Its children are the button's name.
58
+ */
59
+ export function AccordionTrigger({ className, children, ...props }) {
60
+ const styles = accordionStyles({ variant: use(AccordionVariantContext) });
61
+ return (_jsx(BaseAccordion.Header, { "data-slot": "accordion-header", className: styles.header(), children: _jsxs(BaseAccordion.Trigger, { "data-slot": "accordion-trigger", className: withBase(styles.trigger(), className), ...props, children: [_jsx("span", { "aria-hidden": true, className: styles.chevronBox(), children: _jsx(DisclosureChevron, { className: styles.chevron() }) }), children] }) }));
62
+ }
63
+ export function AccordionPanel({ className, ...props }) {
64
+ const variant = use(AccordionVariantContext);
65
+ return (_jsx(BaseAccordion.Panel, { "data-slot": "accordion-panel", className: withBase(accordionStyles({ variant }).panel(), className), ...props }));
66
+ }
@@ -0,0 +1,59 @@
1
+ import { AlertDialog as BaseAlertDialog } from "@base-ui/react/alert-dialog";
2
+ import { type ComponentProps, type ReactElement, type ReactNode } from "react";
3
+ import { type DialogPopupVariants } from "./dialog.js";
4
+ export interface AlertDialogContentProps extends ComponentProps<typeof BaseAlertDialog.Popup>, DialogPopupVariants {
5
+ }
6
+ /** Portal + backdrop + viewport + popup. No corner close: alerts demand an explicit choice. */
7
+ export declare function AlertDialogContent({ size, className, ...props }: AlertDialogContentProps): import("react").JSX.Element;
8
+ export declare function AlertDialogHeader({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
9
+ export declare function AlertDialogFooter({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
10
+ export declare function AlertDialogTitle({ className, ...props }: ComponentProps<typeof BaseAlertDialog.Title>): import("react").JSX.Element;
11
+ export declare function AlertDialogDescription({ className, ...props }: ComponentProps<typeof BaseAlertDialog.Description>): import("react").JSX.Element;
12
+ export interface AlertDialogProps {
13
+ /** Optional trigger element; must accept a ref and DOM props (e.g. <Button>). */
14
+ trigger?: ReactElement;
15
+ title: ReactNode;
16
+ description?: ReactNode;
17
+ /** Extra content between the description and the actions (e.g. a "don't ask again" checkbox). */
18
+ children?: ReactNode;
19
+ /** Leading glyph shown above the title. */
20
+ icon?: ReactNode;
21
+ confirmLabel?: ReactNode;
22
+ cancelLabel?: ReactNode;
23
+ /** Danger styling for irreversible actions. */
24
+ destructive?: boolean;
25
+ /**
26
+ * Runs on confirm. Return a promise to keep the dialog open with a loading confirm button until it
27
+ * settles; the dialog closes on success and stays open if it rejects.
28
+ */
29
+ onConfirm?: () => void | Promise<void>;
30
+ onCancel?: () => void;
31
+ open?: boolean;
32
+ defaultOpen?: boolean;
33
+ onOpenChange?: (open: boolean) => void;
34
+ size?: DialogPopupVariants["size"];
35
+ }
36
+ /** Confirm/cancel convenience: `<AlertDialog trigger={…} title="Discard changes?" destructive onConfirm={…}/>`. */
37
+ export declare function AlertDialog({ trigger, title, description, children, icon, confirmLabel, cancelLabel, destructive, onConfirm, onCancel, open: openProp, defaultOpen, onOpenChange, size, }: AlertDialogProps): import("react").JSX.Element;
38
+ /** What `useConfirm` asks about one item: its words, and what confirming does. */
39
+ export interface ConfirmOptions<T> {
40
+ readonly title: (item: T) => ReactNode;
41
+ readonly description?: ((item: T) => ReactNode) | undefined;
42
+ readonly confirmLabel?: ReactNode;
43
+ readonly destructive?: boolean;
44
+ /**
45
+ * What confirming does. A promise keeps the dialog open with a loading button until it settles: it
46
+ * closes when it resolves, and stays open when it rejects (say why before rejecting, e.g. with a
47
+ * toast). Without one, the dialog closes at once.
48
+ */
49
+ readonly run: (item: T) => void | Promise<void>;
50
+ }
51
+ /**
52
+ * "Confirm this item, then act" without the per-screen state: `ask(item)` opens the dialog for it,
53
+ * and `dialog` is the element to render once. `ask` keeps its identity across renders, so memoized
54
+ * rows can take it as a prop.
55
+ */
56
+ export declare function useConfirm<T>(options: ConfirmOptions<T>): {
57
+ readonly ask: (item: T) => void;
58
+ readonly dialog: ReactNode;
59
+ };
@@ -0,0 +1,82 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { AlertDialog as BaseAlertDialog } from "@base-ui/react/alert-dialog";
4
+ import { useCallback, useState } from "react";
5
+ import { useUiStrings } from "../i18n/provider.js";
6
+ import { cn, withBase } from "../lib/cn.js";
7
+ import { usePortalContainer } from "../lib/theme-scope.js";
8
+ import { Button } from "./button.js";
9
+ import { dialogBackdropClass, dialogDescriptionClass, dialogFooterClass, dialogHeaderClass, dialogPopupStyles, dialogTitleClass, dialogViewportClass, } from "./dialog.js";
10
+ /** Portal + backdrop + viewport + popup. No corner close: alerts demand an explicit choice. */
11
+ export function AlertDialogContent({ size = "sm", className, ...props }) {
12
+ const container = usePortalContainer();
13
+ return (_jsxs(BaseAlertDialog.Portal, { container: container, children: [_jsx(BaseAlertDialog.Backdrop, { "data-slot": "alert-dialog-backdrop", className: dialogBackdropClass }), _jsx(BaseAlertDialog.Viewport, { "data-slot": "alert-dialog-viewport", className: dialogViewportClass, children: _jsx(BaseAlertDialog.Popup, { "data-slot": "alert-dialog", className: withBase(dialogPopupStyles({ size }), className), ...props }) })] }));
14
+ }
15
+ export function AlertDialogHeader({ className, ...props }) {
16
+ return _jsx("div", { "data-slot": "alert-dialog-header", className: cn(dialogHeaderClass, className), ...props });
17
+ }
18
+ export function AlertDialogFooter({ className, ...props }) {
19
+ return _jsx("div", { "data-slot": "alert-dialog-footer", className: cn(dialogFooterClass, className), ...props });
20
+ }
21
+ export function AlertDialogTitle({ className, ...props }) {
22
+ return (_jsx(BaseAlertDialog.Title, { "data-slot": "alert-dialog-title", className: withBase(dialogTitleClass, className), ...props }));
23
+ }
24
+ export function AlertDialogDescription({ className, ...props }) {
25
+ return (_jsx(BaseAlertDialog.Description, { "data-slot": "alert-dialog-description", className: withBase(dialogDescriptionClass, className), ...props }));
26
+ }
27
+ /** Confirm/cancel convenience: `<AlertDialog trigger={…} title="Discard changes?" destructive onConfirm={…}/>`. */
28
+ export function AlertDialog({ trigger, title, description, children, icon, confirmLabel, cancelLabel, destructive = false, onConfirm, onCancel, open: openProp, defaultOpen = false, onOpenChange, size, }) {
29
+ const t = useUiStrings().alertDialog;
30
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
31
+ const [pending, setPending] = useState(false);
32
+ const open = openProp ?? uncontrolledOpen;
33
+ const setOpen = (next) => {
34
+ if (openProp === undefined)
35
+ setUncontrolledOpen(next);
36
+ onOpenChange?.(next);
37
+ };
38
+ const confirm = async () => {
39
+ const result = onConfirm?.();
40
+ if (result instanceof Promise) {
41
+ setPending(true);
42
+ try {
43
+ await result;
44
+ setOpen(false);
45
+ }
46
+ catch {
47
+ // Keep the dialog open so the user can retry; the caller surfaces the error.
48
+ }
49
+ finally {
50
+ setPending(false);
51
+ }
52
+ return;
53
+ }
54
+ setOpen(false);
55
+ };
56
+ return (_jsxs(BaseAlertDialog.Root, { open: open, onOpenChange: (next) => {
57
+ if (pending)
58
+ return;
59
+ if (!next)
60
+ onCancel?.();
61
+ setOpen(next);
62
+ }, children: [trigger && _jsx(BaseAlertDialog.Trigger, { render: trigger }), _jsxs(AlertDialogContent, { size: size, children: [_jsxs(AlertDialogHeader, { children: [icon !== undefined && (_jsx("div", { "aria-hidden": true, className: cn("mb-2 flex size-9 items-center justify-center rounded-xl [&_svg]:size-[18px]", destructive ? "bg-danger-subtle text-danger-fg" : "bg-bg-muted text-fg-muted"), children: icon })), _jsx(AlertDialogTitle, { children: title }), description !== undefined && _jsx(AlertDialogDescription, { children: description })] }), children !== undefined && _jsx("div", { className: "px-6 pb-4", children: children }), _jsxs(AlertDialogFooter, { children: [_jsx(BaseAlertDialog.Close, { disabled: pending, render: _jsx(Button, { variant: "secondary" }), children: cancelLabel ?? t.cancel }), _jsx(Button, { variant: destructive ? "danger" : "primary", loading: pending, onClick: () => {
63
+ void confirm();
64
+ }, children: confirmLabel ?? t.confirm })] })] })] }));
65
+ }
66
+ /**
67
+ * "Confirm this item, then act" without the per-screen state: `ask(item)` opens the dialog for it,
68
+ * and `dialog` is the element to render once. `ask` keeps its identity across renders, so memoized
69
+ * rows can take it as a prop.
70
+ */
71
+ export function useConfirm(options) {
72
+ // The item stays after closing, so the dialog keeps its words while it fades out.
73
+ const [item, setItem] = useState(undefined);
74
+ const [open, setOpen] = useState(false);
75
+ const { title, description, confirmLabel, destructive = false, run } = options;
76
+ const dialog = (_jsx(AlertDialog, { open: open, onOpenChange: setOpen, title: item === undefined ? null : title(item.value), description: item === undefined || description === undefined ? undefined : description(item.value), confirmLabel: confirmLabel, destructive: destructive, onConfirm: () => (item === undefined ? undefined : run(item.value)) }));
77
+ const ask = useCallback((value) => {
78
+ setItem({ value });
79
+ setOpen(true);
80
+ }, []);
81
+ return { ask, dialog };
82
+ }
@@ -0,0 +1,141 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import { type VariantProps } from "../lib/cn.js";
3
+ declare const alertStyles: import("tailwind-variants").TVReturnType<{
4
+ tone: {
5
+ neutral: {
6
+ root: string;
7
+ icon: string;
8
+ };
9
+ info: {
10
+ root: string;
11
+ icon: string;
12
+ };
13
+ success: {
14
+ root: string;
15
+ icon: string;
16
+ };
17
+ warning: {
18
+ root: string;
19
+ icon: string;
20
+ };
21
+ danger: {
22
+ root: string;
23
+ icon: string;
24
+ };
25
+ };
26
+ layout: {
27
+ callout: {
28
+ root: string;
29
+ };
30
+ bar: {
31
+ root: string;
32
+ };
33
+ };
34
+ }, {
35
+ root: string;
36
+ lead: string;
37
+ icon: string;
38
+ body: string;
39
+ title: string;
40
+ description: string;
41
+ action: string;
42
+ dismiss: string;
43
+ }, undefined, {
44
+ tone: {
45
+ neutral: {
46
+ root: string;
47
+ icon: string;
48
+ };
49
+ info: {
50
+ root: string;
51
+ icon: string;
52
+ };
53
+ success: {
54
+ root: string;
55
+ icon: string;
56
+ };
57
+ warning: {
58
+ root: string;
59
+ icon: string;
60
+ };
61
+ danger: {
62
+ root: string;
63
+ icon: string;
64
+ };
65
+ };
66
+ layout: {
67
+ callout: {
68
+ root: string;
69
+ };
70
+ bar: {
71
+ root: string;
72
+ };
73
+ };
74
+ }, {
75
+ root: string;
76
+ lead: string;
77
+ icon: string;
78
+ body: string;
79
+ title: string;
80
+ description: string;
81
+ action: string;
82
+ dismiss: string;
83
+ }, import("tailwind-variants").TVReturnTypeLike<{
84
+ tone: {
85
+ neutral: {
86
+ root: string;
87
+ icon: string;
88
+ };
89
+ info: {
90
+ root: string;
91
+ icon: string;
92
+ };
93
+ success: {
94
+ root: string;
95
+ icon: string;
96
+ };
97
+ warning: {
98
+ root: string;
99
+ icon: string;
100
+ };
101
+ danger: {
102
+ root: string;
103
+ icon: string;
104
+ };
105
+ };
106
+ layout: {
107
+ callout: {
108
+ root: string;
109
+ };
110
+ bar: {
111
+ root: string;
112
+ };
113
+ };
114
+ }, {
115
+ root: string;
116
+ lead: string;
117
+ icon: string;
118
+ body: string;
119
+ title: string;
120
+ description: string;
121
+ action: string;
122
+ dismiss: string;
123
+ }>>;
124
+ export type AlertTone = NonNullable<VariantProps<typeof alertStyles>["tone"]>;
125
+ export interface AlertProps extends Omit<ComponentProps<"div">, "title">, VariantProps<typeof alertStyles> {
126
+ title?: ReactNode;
127
+ /** Replace the tone icon, or pass `false` to hide it. */
128
+ icon?: ReactNode | false;
129
+ /** Trailing controls, e.g. a small "Retry" button. */
130
+ action?: ReactNode;
131
+ /** Renders a close button; the parent decides what dismissal means. */
132
+ onDismiss?: () => void;
133
+ dismissLabel?: string;
134
+ }
135
+ /**
136
+ * Inline callout for page- or panel-level messages; `layout="bar"` lays it flush across the top of a
137
+ * pane. Warnings and errors use `role="alert"` so they're announced when they appear; the rest are
138
+ * polite `status` regions.
139
+ */
140
+ export declare function Alert({ tone, layout, title, icon, action, onDismiss, dismissLabel, className, children, ...props }: AlertProps): import("react").JSX.Element;
141
+ export {};
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { CircleAlert, CircleCheck, Info, Lightbulb, TriangleAlert, X } from "lucide-react";
4
+ import { useUiStrings } from "../i18n/provider.js";
5
+ import { cn, tv } from "../lib/cn.js";
6
+ import { IconButton } from "./button.js";
7
+ const alertStyles = tv({
8
+ slots: {
9
+ root: "relative flex w-full flex-wrap items-start gap-x-2.5 gap-y-2",
10
+ // The icon and the text are one unit, so a narrow alert never leaves the icon alone on a line;
11
+ // it keeps ~14rem of text beside the action, and narrower, the action wraps under the text.
12
+ lead: "flex min-w-0 flex-1 basis-64 items-start gap-x-2.5",
13
+ icon: "mt-0.5 size-4 shrink-0",
14
+ body: "flex min-w-0 flex-1 flex-col gap-0.5",
15
+ title: "font-medium text-fg",
16
+ description: "text-fg-muted text-pretty [&_code]:text-sm",
17
+ // One group at the end; wider than the alert itself (long labels, a narrow column), its buttons
18
+ // wrap whole within it rather than spill past the edge.
19
+ action: "ms-auto flex max-w-full shrink-0 flex-wrap items-center justify-end gap-1.5 self-center",
20
+ dismiss: "-my-1 -me-1.5 shrink-0",
21
+ },
22
+ variants: {
23
+ tone: {
24
+ neutral: { root: "border-border bg-bg-subtle", icon: "text-fg-subtle" },
25
+ info: { root: "border-info-border bg-info-subtle", icon: "text-info-fg" },
26
+ success: { root: "border-success-border bg-success-subtle", icon: "text-success-fg" },
27
+ warning: { root: "border-warning-border bg-warning-subtle", icon: "text-warning-fg" },
28
+ danger: { root: "border-danger-border bg-danger-subtle", icon: "text-danger-fg" },
29
+ },
30
+ layout: {
31
+ callout: { root: "rounded-xl border px-3.5 py-3 text-base" },
32
+ // Flush across the top of a pane or card: no radius, only the hairline under it.
33
+ bar: { root: "shrink-0 border-b px-3 py-2 text-sm" },
34
+ },
35
+ },
36
+ defaultVariants: { tone: "neutral", layout: "callout" },
37
+ });
38
+ const TONE_ICON = {
39
+ neutral: Lightbulb,
40
+ info: Info,
41
+ success: CircleCheck,
42
+ warning: TriangleAlert,
43
+ danger: CircleAlert,
44
+ };
45
+ /**
46
+ * Inline callout for page- or panel-level messages; `layout="bar"` lays it flush across the top of a
47
+ * pane. Warnings and errors use `role="alert"` so they're announced when they appear; the rest are
48
+ * polite `status` regions.
49
+ */
50
+ export function Alert({ tone = "neutral", layout, title, icon, action, onDismiss, dismissLabel, className, children, ...props }) {
51
+ const t = useUiStrings().primitives;
52
+ const styles = alertStyles({ tone, layout });
53
+ const ToneIcon = TONE_ICON[tone];
54
+ return (_jsxs("div", { "data-slot": "alert", "data-tone": tone, role: tone === "danger" || tone === "warning" ? "alert" : "status", className: styles.root({ className }), ...props, children: [_jsxs("div", { className: styles.lead(), children: [icon !== false && (_jsx("span", { "aria-hidden": true, className: cn(styles.icon(), "[&_svg]:size-4"), children: icon ?? _jsx(ToneIcon, { className: "size-4" }) })), _jsxs("div", { className: styles.body(), children: [title !== undefined && _jsx("div", { className: styles.title(), children: title }), children !== undefined && _jsx("div", { className: styles.description(), children: children })] })] }), action !== undefined && _jsx("div", { className: styles.action(), children: action }), onDismiss && (_jsx(IconButton, { "aria-label": dismissLabel ?? t.dismiss, size: "xs", onClick: onDismiss, className: styles.dismiss(), children: _jsx(X, {}) }))] }));
55
+ }
@@ -0,0 +1,21 @@
1
+ import * as m from "motion/react-m";
2
+ import { type ComponentProps, type ReactNode } from "react";
3
+ export declare function AppearProvider({ live, children }: {
4
+ readonly live: boolean;
5
+ readonly children: ReactNode;
6
+ }): import("react").JSX.Element;
7
+ /**
8
+ * A container that arrives as a whole (a row of a live list) and animates itself: what it holds when it
9
+ * mounts doesn't animate again; only what arrives inside it later does.
10
+ */
11
+ export declare function AppearScope({ children }: {
12
+ readonly children: ReactNode;
13
+ }): import("react").JSX.Element;
14
+ export interface AppearProps extends Omit<ComponentProps<typeof m.div>, "initial" | "animate" | "transition"> {
15
+ /** Stable identity of the item (a tool's call id, a part's index in its message). */
16
+ readonly id: string;
17
+ }
18
+ /** A 6 px rise and fade on the snappy spring for an item that just arrived. */
19
+ export declare function Appear({ id, ...props }: AppearProps): import("react").JSX.Element;
20
+ /** Content that replaces a skeleton fades in where the skeleton was (no jump, no movement). */
21
+ export declare function Reveal(props: Omit<ComponentProps<typeof m.div>, "initial" | "animate" | "transition">): import("react").JSX.Element;