burne-ui 2.1.3 → 2.1.4

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 (98) hide show
  1. package/README.md +8 -4
  2. package/cli/burne-ui.js +4 -3
  3. package/cli/init.js +83 -19
  4. package/cli/skin-validate.mjs +83 -2
  5. package/cli/tailwind.css +12 -0
  6. package/cli/theme-bridge.css +2 -0
  7. package/dist/authoring.d.ts +2 -0
  8. package/dist/authoring.js +8 -0
  9. package/dist/components/composite/Accordion/accordionStyles.js +1 -1
  10. package/dist/components/composite/ButtonGroup/buttonGroupStyles.js +1 -1
  11. package/dist/components/composite/Form/formStyles.js +4 -4
  12. package/dist/components/core/Alert/alertStyles.d.ts +1 -1
  13. package/dist/components/core/Alert/alertStyles.js +1 -1
  14. package/dist/components/core/Breadcrumbs/breadcrumbsStyles.js +4 -4
  15. package/dist/components/core/Button/buttonStyles.d.ts +1 -1
  16. package/dist/components/core/Button/buttonStyles.js +9 -8
  17. package/dist/components/core/Calendar/calendarStyles.d.ts +3 -3
  18. package/dist/components/core/Calendar/calendarStyles.js +4 -4
  19. package/dist/components/core/Card/cardStyles.d.ts +2 -2
  20. package/dist/components/core/Card/cardStyles.js +2 -2
  21. package/dist/components/core/Checkbox/checkboxStyles.d.ts +3 -3
  22. package/dist/components/core/Checkbox/checkboxStyles.js +3 -3
  23. package/dist/components/core/ColorPicker/colorPickerStyles.d.ts +2 -2
  24. package/dist/components/core/ColorPicker/colorPickerStyles.js +2 -2
  25. package/dist/components/core/ColorPicker/colorSliderStyles.d.ts +1 -1
  26. package/dist/components/core/ColorPicker/colorSliderStyles.js +1 -1
  27. package/dist/components/core/ComboBox/comboBoxStyles.d.ts +4 -4
  28. package/dist/components/core/ComboBox/comboBoxStyles.js +4 -4
  29. package/dist/components/core/DatePicker/datePickerStyles.d.ts +2 -2
  30. package/dist/components/core/DatePicker/datePickerStyles.js +2 -2
  31. package/dist/components/core/Disclosure/disclosureStyles.d.ts +1 -1
  32. package/dist/components/core/Disclosure/disclosureStyles.js +3 -3
  33. package/dist/components/core/Dropdown/dropdownStyles.d.ts +3 -3
  34. package/dist/components/core/Dropdown/dropdownStyles.js +3 -3
  35. package/dist/components/core/Expandable/expandableStyles.d.ts +1 -1
  36. package/dist/components/core/Expandable/expandableStyles.js +1 -1
  37. package/dist/components/core/Field/fieldStyles.js +1 -1
  38. package/dist/components/core/Input/inputStyles.d.ts +5 -5
  39. package/dist/components/core/Input/inputStyles.js +5 -5
  40. package/dist/components/core/Kbd/kbdStyles.d.ts +1 -1
  41. package/dist/components/core/Kbd/kbdStyles.js +1 -1
  42. package/dist/components/core/Link/linkStyles.d.ts +1 -1
  43. package/dist/components/core/Link/linkStyles.js +1 -1
  44. package/dist/components/core/ListBox/listBoxStyles.d.ts +3 -3
  45. package/dist/components/core/ListBox/listBoxStyles.js +3 -3
  46. package/dist/components/core/Loading/loadingStyles.js +1 -1
  47. package/dist/components/core/Meter/meterStyles.d.ts +1 -1
  48. package/dist/components/core/Meter/meterStyles.js +1 -1
  49. package/dist/components/core/NumberInput/numberInputStyles.js +2 -2
  50. package/dist/components/core/Pagination/paginationStyles.d.ts +3 -3
  51. package/dist/components/core/Pagination/paginationStyles.js +3 -3
  52. package/dist/components/core/PinInput/pinInputStyles.d.ts +1 -1
  53. package/dist/components/core/PinInput/pinInputStyles.js +2 -2
  54. package/dist/components/core/ProgressBar/progressBarStyles.d.ts +1 -1
  55. package/dist/components/core/ProgressBar/progressBarStyles.js +1 -1
  56. package/dist/components/core/Radio/radioStyles.d.ts +3 -3
  57. package/dist/components/core/Radio/radioStyles.js +3 -3
  58. package/dist/components/core/SearchInput/searchInputStyles.d.ts +2 -2
  59. package/dist/components/core/SearchInput/searchInputStyles.js +2 -2
  60. package/dist/components/core/Select/selectStyles.d.ts +3 -3
  61. package/dist/components/core/Select/selectStyles.js +3 -3
  62. package/dist/components/core/Separator/separatorStyles.d.ts +2 -2
  63. package/dist/components/core/Separator/separatorStyles.js +2 -2
  64. package/dist/components/core/Slider/sliderStyles.d.ts +1 -1
  65. package/dist/components/core/Slider/sliderStyles.js +1 -1
  66. package/dist/components/core/Stepper/stepperStyles.js +1 -1
  67. package/dist/components/core/Switch/switchStyles.d.ts +3 -3
  68. package/dist/components/core/Switch/switchStyles.js +3 -3
  69. package/dist/components/core/Table/tableStyles.d.ts +1 -1
  70. package/dist/components/core/Table/tableStyles.js +2 -2
  71. package/dist/components/core/Tabs/tabsStyles.js +1 -1
  72. package/dist/components/core/TagsInput/tagsInputStyles.js +2 -2
  73. package/dist/components/core/TextArea/textAreaStyles.d.ts +3 -3
  74. package/dist/components/core/TextArea/textAreaStyles.js +2 -2
  75. package/dist/components/core/TimeField/timeFieldStyles.d.ts +1 -1
  76. package/dist/components/core/TimeField/timeFieldStyles.js +1 -1
  77. package/dist/components/core/Toast/toastStyles.d.ts +1 -1
  78. package/dist/components/core/Toast/toastStyles.js +1 -1
  79. package/dist/components/core/Tooltip/tooltipStyles.d.ts +1 -1
  80. package/dist/components/core/Tooltip/tooltipStyles.js +1 -1
  81. package/dist/components/core/utils/inputAffixStyles.js +1 -1
  82. package/dist/components/core/utils/optionListItemStyles.d.ts +2 -2
  83. package/dist/components/core/utils/optionListItemStyles.js +2 -2
  84. package/dist/components/core/utils/semanticStatusSurface.js +4 -4
  85. package/dist/components/core/utils/sizeLayout/panel.js +4 -4
  86. package/dist/studio/colorPresets.d.ts +1 -1
  87. package/dist/studio/colorPresets.js +8 -1
  88. package/dist/studio.d.ts +1 -1
  89. package/dist/studio.js +13 -1
  90. package/dist/theme/namedPalettes.d.ts +12 -0
  91. package/dist/theme/namedPalettes.js +697 -1
  92. package/dist/tokens/config.d.ts +8 -2
  93. package/dist/tokens/config.js +8 -0
  94. package/dist/tokens/index.d.ts +1 -1
  95. package/dist/tokens/index.js +9 -0
  96. package/dist/ui.css +55 -45
  97. package/dist/utils/cn.js +2 -0
  98. package/package.json +1 -1
package/README.md CHANGED
@@ -73,14 +73,18 @@ import "burne-ui/styles.css";
73
73
 
74
74
  | Домен | Knob | Шаги (design) | Мост Tailwind | Утилиты |
75
75
  |-------|------|---------------|---------------|---------|
76
- | Spacing | `--space` | `--space-*` (`xsmall`…`3xlarge`) | `--spacing-*` | `gap-*`, `p-*`, `m-*` |
77
- | Radius | `--radius` | `--radius-*` | `--radius-*` (identity) | `rounded-*` |
76
+ | Spacing | `--space` | `--space-*` (`2xsmall`…`5xlarge`) | `--spacing-*` | `gap-*`, `p-*`, `m-*` |
77
+ | Radius | `--radius` | `--radius-*` (`none`, `xsmall`…`3xlarge`, `full`, `nested`) | `--radius-*` (identity) | `rounded-*` |
78
78
  | Control | — | `--control-height-*` / `--control-size-*` (= height) | — | `min-h-control-*`, `w-control-*` |
79
79
  | Icons | `--size` | `--size-scale-*` → `--icon-size-*` (1:1) | — | `icon-xsmall` … `icon-3xlarge` |
80
80
 
81
81
  `--space-*` и `--spacing-*` — разные имена **намеренно**: у Tailwind namespace отступов — `spacing`.
82
82
 
83
- Шкала spacing: `xsmall` 0.618 · `small` 0.875 · `base` 1 · `mid` 1.5 · `large` 2 · `xlarge` 2.5 · `2xlarge` 4 · `3xlarge` 6 (× `--space`).
83
+ Шкала spacing: `2xsmall` 0.25 · `xsmall` 0.5 · `small` 0.75 · `base` 1 · `mid` 1.5 · `large` 2 · `xlarge` 2.5 · `2xlarge` 3 · `3xlarge` 4 · `4xlarge` 5 · `5xlarge` 6 (× `--space`).
84
+
85
+ Шкала radius: `none` 0 · `xsmall` 0.618 · `small` 0.875 · `base` 1 · `mid` 1.125 · `large` 1.25 · `xlarge` 1.5 · `2xlarge` 2 · `3xlarge` 3 (× `--radius`) · `full` 9999px · `nested`.
86
+
87
+ **Рекомендация по размерам и отступам:** в обычных интерфейсах и сложных компонентах, собранных из базовых примитивов кита, используйте компоненты размером **`base`** (дефолт), а не `small`, и держите отступы ближе к **`base` и выше** (`gap-base`, `gap-mid`, `p-base`, `p-mid`, `p-large`), не съезжая в `xsmall` / `2xsmall`. Если в компоненте есть `header`, отделяйте его от тела компонента через **`gap-large`**.
84
88
 
85
89
  ### Типографика
86
90
 
@@ -213,7 +217,7 @@ const ripple = colorToken("converge-ripple-neutral"); // var(--color-converge-ri
213
217
 
214
218
  ## Tailwind в приложении-потребителе
215
219
 
216
- Компоненты используют классы Tailwind, сопоставленные с токенами пакета (`bg-surface`, `text-muted`, `gap-mid`, …). Чтобы **ваши** классы в `className` и классы из prebuilt-бандла библиотеки попали в итоговый CSS, Tailwind должен сканировать артефакты пакета. Добавьте путь к сборке (пример для Tailwind v4 / Vite):
220
+ Компоненты используют классы Tailwind, сопоставленные с токенами пакета (`bg-surface`, `text-muted-foreground`, `gap-mid`, …). Чтобы **ваши** классы в `className` и классы из prebuilt-бандла библиотеки попали в итоговый CSS, Tailwind должен сканировать артефакты пакета. Добавьте путь к сборке (пример для Tailwind v4 / Vite):
217
221
 
218
222
  ```ts
219
223
  // @source в глобальном CSS приложения или content — см. документацию Tailwind v4
package/cli/burne-ui.js CHANGED
@@ -20,18 +20,19 @@ Add Burne UI to an existing project, or see create-burne-app for a new one.
20
20
  Usage:
21
21
  npx burne-ui@latest init [options]
22
22
  npx burne-ui@latest skin add <name> [--tier 1|2|3]
23
- npx burne-ui@latest skin validate [dir]
24
- npx burne-ui@latest skin build [dir]
23
+ npx burne-ui@latest skin validate [dir] [--pro] [--slots-file <path>] [--slot <name>]
24
+ npx burne-ui@latest skin build [dir] [--pro] [--slots-file <path>] [--slot <name>]
25
25
  pnpm dlx burne-ui init
26
26
  bunx burne-ui init
27
27
 
28
28
  Commands:
29
- init Patch CSS, install deps, add BurneUIProvider
29
+ init Patch CSS, install deps, add BurneUIProvider (or BurneProProvider with --pro)
30
30
  skin add Scaffold burne-ui-skin-<name> (tier 1 tokens, tier 2 classes, tier 3 layers)
31
31
  skin validate Check tokens, contrast, slots, layers, and recipe names
32
32
  skin build Write dist/styles.css from src/skin.json
33
33
 
34
34
  Options (init):
35
+ --pro also configure @burne-ui/pro (preset.css + BurneProProvider)
35
36
  --yes, -y skip prompts (arrow menus)
36
37
  --pm npm | pnpm | bun | yarn
37
38
  --theme system | dark | light (default: system)
package/cli/init.js CHANGED
@@ -8,12 +8,15 @@ import * as prompts from "./prompts.js";
8
8
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
9
 
10
10
  const TAILWIND_ENTRY_IMPORT = `@import "burne-ui/tailwind.css";`;
11
+ const PRO_PRESET_IMPORT = `@import "@burne-ui/pro/preset.css";`;
12
+ const PRO_STYLES_IMPORT = `@import "@burne-ui/pro/styles.css";`;
11
13
 
12
14
  /** @param {string} css */
13
15
  function hasThemeBridge(css) {
14
16
  return (
15
17
  css.includes("burne-ui/tailwind.css") ||
16
18
  css.includes("burne-ui/theme-bridge.css") ||
19
+ css.includes("@burne-ui/pro/preset.css") ||
17
20
  css.includes("--text-base: var(--text-base-size)")
18
21
  );
19
22
  }
@@ -108,13 +111,42 @@ export function findCssCandidates(cwd, framework) {
108
111
 
109
112
  /**
110
113
  * @param {string} cssPath
114
+ * @param {{ pro?: boolean }} [options]
111
115
  */
112
- export function patchCssFile(cssPath) {
116
+ export function patchCssFile(cssPath, options = {}) {
117
+ const pro = Boolean(options.pro);
113
118
  let css = fs.readFileSync(cssPath, "utf8");
114
- const hadBurne = css.includes("burne-ui/styles.css");
119
+ const hadBurne =
120
+ css.includes("burne-ui/styles.css") || css.includes("@burne-ui/pro/preset.css");
121
+ const hadPro =
122
+ css.includes("@burne-ui/pro/styles.css") || css.includes("@burne-ui/pro/preset.css");
115
123
  const hadTailwind = /@import\s+["']tailwindcss["']/.test(css);
116
124
  const hadThemeBridge = hasThemeBridge(css);
117
125
 
126
+ if (pro && !hadBurne && !hadPro) {
127
+ if (hadTailwind) {
128
+ const importLine = `\n${PRO_PRESET_IMPORT}\n`;
129
+ const sourceBlocks = [...css.matchAll(/@source\s+[^;]+;/g)];
130
+ if (sourceBlocks.length > 0) {
131
+ const last = sourceBlocks[sourceBlocks.length - 1];
132
+ const insertAt = last.index + last[0].length;
133
+ css = css.slice(0, insertAt) + importLine + css.slice(insertAt);
134
+ } else {
135
+ css = css.replace(
136
+ /@import\s+["']tailwindcss["']\s*;/,
137
+ `@import "tailwindcss";${importLine}`,
138
+ );
139
+ }
140
+ } else {
141
+ css =
142
+ `/* Burne UI + Pro — recommend Tailwind v4: @import "tailwindcss" */\n` +
143
+ `${PRO_PRESET_IMPORT}\n\n` +
144
+ css;
145
+ }
146
+ fs.writeFileSync(cssPath, css);
147
+ return { hadBurne, hadPro, hadTailwind, hadThemeBridge };
148
+ }
149
+
118
150
  if (!hadBurne) {
119
151
  if (hadTailwind) {
120
152
  const importLine = `\n@import "burne-ui/styles.css";\n`;
@@ -137,7 +169,7 @@ export function patchCssFile(cssPath) {
137
169
  }
138
170
  }
139
171
 
140
- if (!css.includes("burne-ui/styles.css")) {
172
+ if (!css.includes("burne-ui/styles.css") && !css.includes("@burne-ui/pro/preset.css")) {
141
173
  css += `\n@import "burne-ui/styles.css";\n`;
142
174
  }
143
175
 
@@ -154,31 +186,46 @@ export function patchCssFile(cssPath) {
154
186
  }
155
187
  }
156
188
 
189
+ if (pro && !hadPro) {
190
+ const twImport = css.match(/@import\s+["']burne-ui\/tailwind\.css["']\s*;/);
191
+ if (twImport && twImport.index != null) {
192
+ const insertAt = twImport.index + twImport[0].length;
193
+ css = css.slice(0, insertAt) + `\n${PRO_STYLES_IMPORT}\n` + css.slice(insertAt);
194
+ } else {
195
+ css += `\n${PRO_STYLES_IMPORT}\n`;
196
+ }
197
+ }
198
+
157
199
  fs.writeFileSync(cssPath, css);
158
- return { hadBurne, hadTailwind, hadThemeBridge };
200
+ return { hadBurne, hadPro, hadTailwind, hadThemeBridge };
159
201
  }
160
202
 
161
203
  /**
162
204
  * @param {ThemeMode} theme
163
205
  * @param {boolean} toast
206
+ * @param {boolean} [pro]
164
207
  */
165
- function providerSource(theme, toast) {
208
+ function providerSource(theme, toast, pro = false) {
166
209
  const toastLine = toast ? " toast" : " toast={false}";
210
+ const importLine = pro
211
+ ? `import { BurneProProvider } from "@burne-ui/pro";`
212
+ : `import { BurneUIProvider } from "burne-ui";`;
213
+ const tag = pro ? "BurneProProvider" : "BurneUIProvider";
167
214
  return `"use client";
168
215
 
169
- import { BurneUIProvider } from "burne-ui";
216
+ ${importLine}
170
217
 
171
218
  import burneTheme from "./burne-theme";
172
219
 
173
220
  /**
174
- * Generated by \`burne-ui init\`.
221
+ * Generated by \`burne-ui init${pro ? " --pro" : ""}\`.
175
222
  * Theme tokens live in \`burne-theme.ts\` (replace via docs site → Copy config).
176
223
  */
177
224
  export function BurneProviders({ children }: { children: React.ReactNode }) {
178
225
  return (
179
- <BurneUIProvider config={burneTheme} defaultTheme="${theme}"${toastLine}>
226
+ <${tag} config={burneTheme} defaultTheme="${theme}"${toastLine}>
180
227
  {children}
181
- </BurneUIProvider>
228
+ </${tag}>
182
229
  );
183
230
  }
184
231
  `;
@@ -277,9 +324,10 @@ function runCommand(pmBin, args, cwd) {
277
324
  /**
278
325
  * @param {PackageManager} pm
279
326
  * @param {string} cwd
327
+ * @param {boolean} [pro]
280
328
  */
281
- async function installDeps(pm, cwd) {
282
- const pkgs = ["burne-ui", "gsap"];
329
+ async function installDeps(pm, cwd, pro = false) {
330
+ const pkgs = pro ? ["burne-ui", "@burne-ui/pro", "gsap", "react-icons"] : ["burne-ui", "gsap"];
283
331
  if (pm === "npm") await runCommand("npm", ["install", ...pkgs], cwd);
284
332
  else if (pm === "pnpm") await runCommand("pnpm", ["add", ...pkgs], cwd);
285
333
  else if (pm === "bun") await runCommand("bun", ["add", ...pkgs], cwd);
@@ -294,6 +342,7 @@ function parseInitArgs(argv) {
294
342
  * yes: boolean;
295
343
  * skipInstall: boolean;
296
344
  * toast: boolean;
345
+ * pro: boolean;
297
346
  * pm?: PackageManager;
298
347
  * theme?: ThemeMode;
299
348
  * css?: string;
@@ -303,6 +352,7 @@ function parseInitArgs(argv) {
303
352
  yes: false,
304
353
  skipInstall: false,
305
354
  toast: true,
355
+ pro: false,
306
356
  help: false,
307
357
  };
308
358
 
@@ -312,6 +362,7 @@ function parseInitArgs(argv) {
312
362
  else if (arg === "--yes" || arg === "-y") out.yes = true;
313
363
  else if (arg === "--skip-install") out.skipInstall = true;
314
364
  else if (arg === "--no-toast") out.toast = false;
365
+ else if (arg === "--pro") out.pro = true;
315
366
  else if (arg === "--pm") {
316
367
  const v = argv[++i];
317
368
  if (v === "npm" || v === "pnpm" || v === "bun" || v === "yarn") out.pm = v;
@@ -419,21 +470,34 @@ export async function runInit(argv, cliVersion) {
419
470
  const provider = resolveProviderPath(cwd, fw);
420
471
 
421
472
  if (!args.skipInstall) {
422
- console.log(`\nInstalling burne-ui + gsap with ${pm}…\n`);
423
- await installDeps(pm, cwd);
473
+ console.log(
474
+ args.pro
475
+ ? `\nInstalling burne-ui + @burne-ui/pro + gsap + react-icons with ${pm}…\n`
476
+ : `\nInstalling burne-ui + gsap with ${pm}…\n`,
477
+ );
478
+ await installDeps(pm, cwd, args.pro);
424
479
  }
425
480
 
426
481
  if (cssRel) {
427
482
  const abs = path.resolve(cwd, cssRel);
428
483
  if (!fs.existsSync(abs)) throw new Error(`CSS not found: ${cssRel}`);
429
- const { hadBurne, hadTailwind, hadThemeBridge } = patchCssFile(abs);
430
- console.log(hadBurne ? `CSS OK (already linked): ${cssRel}` : `Patched CSS: ${cssRel}`);
431
- if (!hadThemeBridge) console.log("Added Tailwind entry (burne-ui/tailwind.css).");
484
+ const { hadBurne, hadPro, hadTailwind, hadThemeBridge } = patchCssFile(abs, { pro: args.pro });
485
+ if (args.pro && !hadBurne && !hadPro) {
486
+ console.log(`Patched CSS with @burne-ui/pro/preset.css: ${cssRel}`);
487
+ } else {
488
+ console.log(hadBurne ? `CSS OK (already linked): ${cssRel}` : `Patched CSS: ${cssRel}`);
489
+ if (!hadThemeBridge) console.log("Added Tailwind entry (burne-ui/tailwind.css).");
490
+ if (args.pro && !hadPro) console.log("Added Pro styles (@burne-ui/pro/styles.css).");
491
+ }
432
492
  if (!hadTailwind) {
433
493
  console.log('Note: no @import "tailwindcss" — add Tailwind v4 for className utilities.');
434
494
  }
435
495
  } else {
436
- console.log('Skipped CSS — add: @import "burne-ui/styles.css";');
496
+ console.log(
497
+ args.pro
498
+ ? 'Skipped CSS — add: @import "@burne-ui/pro/preset.css";'
499
+ : 'Skipped CSS — add: @import "burne-ui/styles.css";',
500
+ );
437
501
  }
438
502
 
439
503
  fs.mkdirSync(provider.dir, { recursive: true });
@@ -461,9 +525,9 @@ export async function runInit(argv, cliVersion) {
461
525
  message: `Overwrite ${relProvider}?`,
462
526
  initialValue: false,
463
527
  });
464
- if (overwrite) fs.writeFileSync(provider.file, providerSource(theme, toast));
528
+ if (overwrite) fs.writeFileSync(provider.file, providerSource(theme, toast, args.pro));
465
529
  } else {
466
- fs.writeFileSync(provider.file, providerSource(theme, toast));
530
+ fs.writeFileSync(provider.file, providerSource(theme, toast, args.pro));
467
531
  console.log(`Wrote ${relProvider}`);
468
532
  }
469
533
 
@@ -7,7 +7,7 @@
7
7
  * component reads is a dead slot.
8
8
  */
9
9
  import { existsSync, readFileSync } from "node:fs";
10
- import { dirname, join } from "node:path";
10
+ import { dirname, join, resolve } from "node:path";
11
11
  import { fileURLToPath } from "node:url";
12
12
 
13
13
  import {
@@ -168,6 +168,52 @@ function mergeRegistered(slots) {
168
168
  return set;
169
169
  }
170
170
 
171
+ /**
172
+ * Reads a JSON file containing an array of slot names (e.g. `@burne-ui/pro/dist/skin-slots.json`)
173
+ * or an object `{ slots: string[] }`.
174
+ */
175
+ export function loadSlotsFile(filePath) {
176
+ const abs = resolve(filePath);
177
+ if (!existsSync(abs)) {
178
+ throw new Error(`Slots file not found: ${filePath}`);
179
+ }
180
+ const parsed = JSON.parse(readFileSync(abs, "utf8"));
181
+ const list = Array.isArray(parsed)
182
+ ? parsed
183
+ : parsed && typeof parsed === "object" && Array.isArray(parsed.slots)
184
+ ? parsed.slots
185
+ : null;
186
+ if (!list) {
187
+ throw new Error(`Slots file must export a JSON array of slot names: ${filePath}`);
188
+ }
189
+ return list.filter((s) => typeof s === "string" && s.trim() !== "");
190
+ }
191
+
192
+ /**
193
+ * Resolves `@burne-ui/pro/dist/skin-slots.json` walking upward from `startDir` (or `process.cwd()`),
194
+ * including sibling monorepo `burne-ui-pro/packages/pro/dist/skin-slots.json`.
195
+ */
196
+ export function resolveProSkinSlotsPath(startDir = process.cwd()) {
197
+ const roots = [resolve(startDir), resolve(process.cwd()), resolve(dirname(fileURLToPath(import.meta.url)), "../..")];
198
+ for (const base of roots) {
199
+ let cur = base;
200
+ for (let depth = 0; depth < 8; depth++) {
201
+ const candidates = [
202
+ join(cur, "node_modules/@burne-ui/pro/dist/skin-slots.json"),
203
+ join(cur, "packages/pro/dist/skin-slots.json"),
204
+ join(cur, "burne-ui-pro/packages/pro/dist/skin-slots.json"),
205
+ ];
206
+ for (const candidate of candidates) {
207
+ if (existsSync(candidate)) return candidate;
208
+ }
209
+ const parent = dirname(cur);
210
+ if (parent === cur) break;
211
+ cur = parent;
212
+ }
213
+ }
214
+ return null;
215
+ }
216
+
171
217
  /**
172
218
  * @param {string[]} argv
173
219
  * @returns {{ dir: string, error?: string }}
@@ -175,6 +221,9 @@ function mergeRegistered(slots) {
175
221
  export function consumeSkinCliArgs(argv) {
176
222
  const positional = [];
177
223
  const slots = [];
224
+ const slotsFiles = [];
225
+ let usePro = false;
226
+
178
227
  for (let i = 0; i < argv.length; i++) {
179
228
  if (argv[i] === "--slot") {
180
229
  const name = argv[i + 1];
@@ -183,10 +232,42 @@ export function consumeSkinCliArgs(argv) {
183
232
  i += 1;
184
233
  continue;
185
234
  }
235
+ if (argv[i] === "--slots-file") {
236
+ const file = argv[i + 1];
237
+ if (!file || file.startsWith("-")) return { dir: process.cwd(), error: "--slots-file needs a path" };
238
+ slotsFiles.push(file);
239
+ i += 1;
240
+ continue;
241
+ }
242
+ if (argv[i] === "--pro") {
243
+ usePro = true;
244
+ continue;
245
+ }
186
246
  positional.push(argv[i]);
187
247
  }
188
- registerSkinSlots(slots);
248
+
189
249
  const dir = positional.find((arg) => !arg.startsWith("-")) ?? process.cwd();
250
+
251
+ if (usePro) {
252
+ const proSlotsPath = resolveProSkinSlotsPath(dir);
253
+ if (!proSlotsPath) {
254
+ return {
255
+ dir,
256
+ error: "--pro could not locate @burne-ui/pro/dist/skin-slots.json (install or build @burne-ui/pro, or pass --slots-file <path>)",
257
+ };
258
+ }
259
+ slotsFiles.push(proSlotsPath);
260
+ }
261
+
262
+ for (const file of slotsFiles) {
263
+ try {
264
+ slots.push(...loadSlotsFile(file));
265
+ } catch (error) {
266
+ return { dir, error: error instanceof Error ? error.message : String(error) };
267
+ }
268
+ }
269
+
270
+ registerSkinSlots(slots);
190
271
  return { dir };
191
272
  }
192
273
 
package/cli/tailwind.css CHANGED
@@ -94,6 +94,7 @@
94
94
  --color-surface-tint-info-hover: var(--color-surface-tint-info-hover);
95
95
  --color-surface-tint-warning-hover: var(--color-surface-tint-warning-hover);
96
96
 
97
+ --spacing-2xsmall: var(--space-2xsmall);
97
98
  --spacing-xsmall: var(--space-xsmall);
98
99
  --spacing-small: var(--space-small);
99
100
  --spacing-base: var(--space-base);
@@ -111,6 +112,7 @@
111
112
  --radius-base: var(--radius-base);
112
113
  --radius-mid: var(--radius-mid);
113
114
  --radius-large: var(--radius-large);
115
+ --radius-xlarge: var(--radius-xlarge);
114
116
  --radius-2xlarge: var(--radius-2xlarge);
115
117
  --radius-3xlarge: var(--radius-3xlarge);
116
118
  --radius-full: var(--radius-full);
@@ -327,6 +329,16 @@
327
329
  border-color: var(--color-warning);
328
330
  }
329
331
 
332
+ @utility border-x-token {
333
+ border-inline-width: var(--border-width, 1px);
334
+ border-inline-color: var(--border-color, var(--color-border));
335
+ }
336
+
337
+ @utility border-y-token {
338
+ border-block-width: var(--border-width, 1px);
339
+ border-block-color: var(--border-color, var(--color-border));
340
+ }
341
+
330
342
  @utility border-t-token {
331
343
  border-top-width: var(--border-width, 1px);
332
344
  border-top-color: var(--border-color, var(--color-border));
@@ -83,6 +83,7 @@
83
83
  --color-surface-tint-info-hover: var(--color-surface-tint-info-hover);
84
84
  --color-surface-tint-warning-hover: var(--color-surface-tint-warning-hover);
85
85
 
86
+ --spacing-2xsmall: var(--space-2xsmall);
86
87
  --spacing-xsmall: var(--space-xsmall);
87
88
  --spacing-small: var(--space-small);
88
89
  --spacing-base: var(--space-base);
@@ -100,6 +101,7 @@
100
101
  --radius-base: var(--radius-base);
101
102
  --radius-mid: var(--radius-mid);
102
103
  --radius-large: var(--radius-large);
104
+ --radius-xlarge: var(--radius-xlarge);
103
105
  --radius-2xlarge: var(--radius-2xlarge);
104
106
  --radius-3xlarge: var(--radius-3xlarge);
105
107
  --radius-full: var(--radius-full);
@@ -13,6 +13,8 @@ export { focusKeyboard, focusOnOpen, focusPanelOnOpen, } from './components/core
13
13
  export { dataActiveState, dataCheckedState, dataExpandedState, dataFlag, dataGroupSegment, dataOnState, dataOpenState, dataValue, dataVariantProps, } from './components/core/utils/dataContract.js';
14
14
  export { useSkinSlot } from './skins/useSkinSlot.js';
15
15
  export type { SkinSlotView } from './skins/useSkinSlot.js';
16
+ export { SHADOW_LIFT_MOTION_CLASS, shadowMotionFor, useFirstLevelHoverShadow, useSecondLevelShadow, type UseSecondLevelShadowOptions, } from './components/core/utils/useShadowMotion.js';
17
+ export { primeInteractiveScaleRest, shouldSkipInteractiveHoverLift, type HoverShadowConfig, } from './components/core/utils/hoverInteractiveLift.js';
16
18
  export type { UseControllableStateParams } from './components/core/utils/useControllableState.js';
17
19
  export type { DataState } from './components/core/utils/dataContract.js';
18
20
  export type { MotionScopeValue } from './components/core/utils/slotMotion/createMotionScope.js';
package/dist/authoring.js CHANGED
@@ -6,7 +6,10 @@ import { useControllableState } from "./components/core/utils/useControllableSta
6
6
  import { focusKeyboard, focusOnOpen, focusPanelOnOpen } from "./components/core/utils/focusElement.js";
7
7
  import { dataActiveState, dataCheckedState, dataExpandedState, dataFlag, dataGroupSegment, dataOnState, dataOpenState, dataValue, dataVariantProps } from "./components/core/utils/dataContract.js";
8
8
  import { useSkinSlot } from "./skins/useSkinSlot.js";
9
+ import { SHADOW_LIFT_MOTION_CLASS, shadowMotionFor, useFirstLevelHoverShadow, useSecondLevelShadow } from "./components/core/utils/useShadowMotion.js";
10
+ import { primeInteractiveScaleRest, shouldSkipInteractiveHoverLift } from "./components/core/utils/hoverInteractiveLift.js";
9
11
  export {
12
+ SHADOW_LIFT_MOTION_CLASS,
10
13
  createMotionScope,
11
14
  dataActiveState,
12
15
  dataCheckedState,
@@ -22,7 +25,12 @@ export {
22
25
  focusPanelOnOpen,
23
26
  mergeAsChildProps,
24
27
  mergeRefs,
28
+ primeInteractiveScaleRest,
29
+ shadowMotionFor,
30
+ shouldSkipInteractiveHoverLift,
25
31
  useControllableState,
32
+ useFirstLevelHoverShadow,
26
33
  useMotionPart,
34
+ useSecondLevelShadow,
27
35
  useSkinSlot
28
36
  };
@@ -38,7 +38,7 @@ function accordionBodyClass({
38
38
  className,
39
39
  slotClass
40
40
  }) {
41
- return cn("text-muted", slotClass, className);
41
+ return cn("text-muted-foreground", slotClass, className);
42
42
  }
43
43
  const ACCORDION_CHEVRON_CLASS = "shrink-0";
44
44
  export {
@@ -50,7 +50,7 @@ function buttonGroupSegmentSurfaceClasses(seg) {
50
50
  }
51
51
  function buttonGroupTextSurfaceClasses(seg) {
52
52
  return cn(
53
- "relative inline-flex shrink-0 select-none items-center justify-center border-token bg-surface text-muted",
53
+ "relative inline-flex shrink-0 select-none items-center justify-center border-token bg-surface text-muted-foreground",
54
54
  buttonGroupRoundingClasses(seg),
55
55
  buttonGroupOverlapBorderClasses(seg),
56
56
  seg != null && buttonGroupSegmentSurfaceClasses(seg),
@@ -9,7 +9,7 @@ const FORM_SIZE_LAYOUT = {
9
9
  actionsPaddingTop: "pt-xsmall",
10
10
  titleVariant: "base",
11
11
  titleClassName: "font-w-mid text-foreground",
12
- descClassName: "text-small text-muted"
12
+ descClassName: "text-small text-muted-foreground"
13
13
  },
14
14
  base: {
15
15
  rootGap: "gap-2xlarge",
@@ -19,7 +19,7 @@ const FORM_SIZE_LAYOUT = {
19
19
  actionsPaddingTop: "pt-small",
20
20
  titleVariant: "mid",
21
21
  titleClassName: "font-w-mid text-foreground",
22
- descClassName: "text-base text-muted"
22
+ descClassName: "text-base text-muted-foreground"
23
23
  },
24
24
  mid: {
25
25
  rootGap: "gap-2xlarge",
@@ -29,7 +29,7 @@ const FORM_SIZE_LAYOUT = {
29
29
  actionsPaddingTop: "pt-base",
30
30
  titleVariant: "mid",
31
31
  titleClassName: "font-w-mid text-foreground",
32
- descClassName: "text-base text-muted"
32
+ descClassName: "text-base text-muted-foreground"
33
33
  },
34
34
  large: {
35
35
  rootGap: "gap-3xlarge",
@@ -39,7 +39,7 @@ const FORM_SIZE_LAYOUT = {
39
39
  actionsPaddingTop: "pt-base",
40
40
  titleVariant: "large",
41
41
  titleClassName: "font-w-mid text-foreground",
42
- descClassName: "text-mid text-muted"
42
+ descClassName: "text-mid text-muted-foreground"
43
43
  }
44
44
  };
45
45
  function resolveFormSize(size) {
@@ -9,4 +9,4 @@ export declare function alertIndicatorClass(status: AlertStatus, iconSvgClass: s
9
9
  export declare const ALERT_COMPOUND_CONTENTS_CLASS = "contents";
10
10
  export declare const ALERT_TITLE_CLASS = "font-w-mid";
11
11
  export declare function alertTitleClass(status: AlertStatus): string;
12
- export declare const ALERT_DESCRIPTION_CLASS = "text-muted";
12
+ export declare const ALERT_DESCRIPTION_CLASS = "text-muted-foreground";
@@ -27,7 +27,7 @@ function alertTitleClass(status) {
27
27
  status !== "default" ? SEMANTIC_STATUS_TEXT[status] : ""
28
28
  );
29
29
  }
30
- const ALERT_DESCRIPTION_CLASS = "text-muted";
30
+ const ALERT_DESCRIPTION_CLASS = "text-muted-foreground";
31
31
  export {
32
32
  ALERT_COMPOUND_CONTENTS_CLASS,
33
33
  ALERT_DESCRIPTION_CLASS,
@@ -1,7 +1,7 @@
1
1
  import { TEXT_COLOR_TRANSITION } from "../utils/hoverVariant.js";
2
2
  import { cn } from "../../../utils/cn.js";
3
3
  const CRUMB_INTERACTIVE_INNER_CLASS = cn(
4
- "inline-flex max-w-[min(12rem,46vw)] min-w-0 cursor-pointer truncate rounded-mid px-xsmall py-xsmall text-muted no-underline outline-none focus-ring",
4
+ "inline-flex max-w-[min(12rem,46vw)] min-w-0 cursor-pointer truncate rounded-mid px-xsmall py-xsmall text-muted-foreground no-underline outline-none focus-ring",
5
5
  TEXT_COLOR_TRANSITION,
6
6
  "hover:text-foreground"
7
7
  );
@@ -10,7 +10,7 @@ const CRUMB_INTERACTIVE_BUTTON_CLASS = cn(
10
10
  "border-0 bg-transparent font-[inherit]"
11
11
  );
12
12
  const BREADCRUMBS_ELLIPSIS_TRIGGER_CLASS = cn(
13
- "inline-flex min-w-0 cursor-pointer rounded-mid border-0 bg-transparent px-xsmall py-xsmall font-[inherit] text-muted outline-none focus-ring",
13
+ "inline-flex min-w-0 cursor-pointer rounded-mid border-0 bg-transparent px-xsmall py-xsmall font-[inherit] text-muted-foreground outline-none focus-ring",
14
14
  TEXT_COLOR_TRANSITION,
15
15
  "hover:text-foreground aria-expanded:text-foreground"
16
16
  );
@@ -39,10 +39,10 @@ function breadcrumbCurrentClass(className) {
39
39
  );
40
40
  }
41
41
  function breadcrumbStaticClass(className) {
42
- return cn("max-w-[min(12rem,46vw)] truncate px-xsmall py-xsmall text-muted", className);
42
+ return cn("max-w-[min(12rem,46vw)] truncate px-xsmall py-xsmall text-muted-foreground", className);
43
43
  }
44
44
  function breadcrumbChevronClass(className) {
45
- return cn("shrink-0 text-muted opacity-75 icon-small rtl:rotate-180", className);
45
+ return cn("shrink-0 text-muted-foreground opacity-75 icon-small rtl:rotate-180", className);
46
46
  }
47
47
  function crumbInteractiveInnerClass(className) {
48
48
  return cn(CRUMB_INTERACTIVE_INNER_CLASS, className);
@@ -42,7 +42,7 @@ export declare function buttonLoaderTextClass(variant: ButtonVariant, status: Bu
42
42
  export declare function buttonConvergeRippleColor(variant: ButtonVariant, status: ButtonStatus): string;
43
43
  export declare const BUTTON_CONTROL_HEIGHT_CLASS: Record<ComponentSize, string>;
44
44
  export declare function controlShellClass(size: ComponentSize, minW?: string): string;
45
- export declare function buttonRootClass(size: ComponentSize, iconOnly?: boolean): string;
45
+ export declare function buttonRootClass(size: ComponentSize, _iconOnly?: boolean): string;
46
46
  export declare function buttonSpinnerClass(size: ComponentSize): string;
47
47
  export declare function buttonSpinnerInnerClass(): string;
48
48
  export declare function buttonContentClass({ groupSegment, slotClass, className, }: {
@@ -1,4 +1,4 @@
1
- import { SEMANTIC_STATUS_FILL_TEXT, SEMANTIC_STATUS_TEXT, SEMANTIC_STATUS_OUTLINE_BORDER, SEMANTIC_STATUS_FILL, SEMANTIC_STATUS_SURFACE_TINT } from "../utils/semanticStatusSurface.js";
1
+ import { SEMANTIC_STATUS_FILL_TEXT, SEMANTIC_STATUS_TEXT, SEMANTIC_STATUS_SURFACE_TINT, SEMANTIC_STATUS_OUTLINE_BORDER, SEMANTIC_STATUS_FILL } from "../utils/semanticStatusSurface.js";
2
2
  import { hoverVariant } from "../utils/hoverVariant.js";
3
3
  import { SHADOW_LIFT_MOTION_CLASS } from "../utils/useShadowMotion.js";
4
4
  import { colorToken } from "../../../tokens/index.js";
@@ -119,12 +119,13 @@ function buttonHoverVariant(variant, status) {
119
119
  }
120
120
  switch (key) {
121
121
  case "default":
122
- return `${status}-tint-hover`;
122
+ return "default";
123
123
  case "primary":
124
124
  return `${status}-fill`;
125
125
  case "outline":
126
- case "ghost":
127
126
  return status;
127
+ case "ghost":
128
+ return `${status}-tint-hover`;
128
129
  case "secondary":
129
130
  return "secondary";
130
131
  }
@@ -137,7 +138,7 @@ function buttonStatusClass(variant, status) {
137
138
  }
138
139
  switch (key) {
139
140
  case "default":
140
- return cn(SEMANTIC_STATUS_SURFACE_TINT[status], SEMANTIC_STATUS_TEXT[status]);
141
+ return SEMANTIC_STATUS_TEXT[status];
141
142
  case "primary":
142
143
  return SEMANTIC_STATUS_FILL[status];
143
144
  case "outline":
@@ -145,7 +146,7 @@ function buttonStatusClass(variant, status) {
145
146
  case "secondary":
146
147
  return SEMANTIC_STATUS_TEXT[status];
147
148
  case "ghost":
148
- return SEMANTIC_STATUS_TEXT[status];
149
+ return cn(SEMANTIC_STATUS_SURFACE_TINT[status], SEMANTIC_STATUS_TEXT[status]);
149
150
  }
150
151
  }
151
152
  function buttonIdleSurfaceMotion(variant, status, blocked) {
@@ -169,15 +170,15 @@ const BUTTON_CONTROL_HEIGHT_CLASS = {
169
170
  mid: "min-h-control-mid",
170
171
  large: "min-h-control-large"
171
172
  };
172
- function controlShellClass(size, minW = CONTROL_SIZE_LAYOUT[size].minWButton) {
173
+ function controlShellClass(size, minW = "min-w-fit") {
173
174
  const layout = CONTROL_SIZE_LAYOUT[size];
174
175
  return cn(minW, layout.padX, layout.padY);
175
176
  }
176
- function buttonRootClass(size, iconOnly = false) {
177
+ function buttonRootClass(size, _iconOnly = false) {
177
178
  const layout = CONTROL_SIZE_LAYOUT[size];
178
179
  return cn(
179
180
  BUTTON_CONTROL_HEIGHT_CLASS[size],
180
- iconOnly ? "min-w-fit" : layout.minWButton,
181
+ "min-w-fit",
181
182
  layout.padX,
182
183
  layout.padY
183
184
  );
@@ -23,7 +23,7 @@ export declare const CALENDAR_GRID_CLASS = "min-w-0";
23
23
  export declare const CALENDAR_CONTENTS_CLASS = "contents";
24
24
  export declare const CALENDAR_DAYS_WEEKDAY_GRID_CLASS = "grid grid-cols-7 gap-xsmall";
25
25
  export declare const CALENDAR_DAYS_CELL_GRID_CLASS = "grid grid-cols-7 gap-xsmall";
26
- export declare const CALENDAR_WEEKDAY_LABEL_CLASS = "flex items-center justify-center font-w-mid text-muted";
26
+ export declare const CALENDAR_WEEKDAY_LABEL_CLASS = "flex items-center justify-center font-w-mid text-muted-foreground";
27
27
  export declare const CALENDAR_DAY_CELL_WRAPPER_CLASS = "relative flex items-center justify-center";
28
28
  export declare const CALENDAR_DAY_CELL_LAYER_CLASS = "relative z-10";
29
29
  export declare const CALENDAR_MONTHS_GRID_CLASS = "grid grid-cols-3";
@@ -46,8 +46,8 @@ export declare const CALENDAR_CELL_CURRENT_CLASS = "font-w-mid text-primary";
46
46
  export declare const CALENDAR_CELL_DEFAULT_CLASS = "text-foreground";
47
47
  export declare const CALENDAR_CELL_DISABLED_CLASS = "cursor-not-allowed opacity-35";
48
48
  export declare const CALENDAR_CELL_POINTER_CLASS = "cursor-pointer";
49
- export declare const CALENDAR_YEAR_OUT_OF_DECADE_CLASS = "text-muted";
50
- export declare const CALENDAR_FOOTER_TODAY_BUTTON_CLASS = "text-muted";
49
+ export declare const CALENDAR_YEAR_OUT_OF_DECADE_CLASS = "text-muted-foreground";
50
+ export declare const CALENDAR_FOOTER_TODAY_BUTTON_CLASS = "text-muted-foreground";
51
51
  export declare function calendarNavButtonClass(size: CalendarSize): string;
52
52
  export declare function calendarDayEmptyClass(size: CalendarSize, slotClass?: string, className?: string): string;
53
53
  export declare function calendarRootClass(variant: CalendarVariant, size: CalendarSize, className?: string): string;