@nice2dev/ui 1.1.5 → 1.1.7

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 (164) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/README.md +50 -29
  3. package/css/legacy-bg-text-aliases.css +65 -61
  4. package/dist/NiceCodeEditor-Bc81wiaN.js +1134 -0
  5. package/dist/NiceCodeEditor-D6f8KdHN.js +1134 -0
  6. package/dist/NiceCodeEditor-DE3saxyt.cjs +260 -0
  7. package/dist/NiceCodeEditor-DZM16My5.cjs +260 -0
  8. package/dist/NiceCodeEditor-HqmcJjmZ.js +1179 -0
  9. package/dist/NiceColorPicker-6EqXaDj0.cjs +1 -0
  10. package/dist/NiceColorPicker-BiEWqWnd.js +596 -0
  11. package/dist/NiceColorPicker-Cuc6YXqz.cjs +1 -0
  12. package/dist/NiceColorPicker-DMATcNWG.js +596 -0
  13. package/dist/NiceColorPicker-R3O1nemp.js +596 -0
  14. package/dist/NiceConfirmDialog-B0e10fRL.cjs +1 -0
  15. package/dist/NiceConfirmDialog-BBDgEMHv.js +81 -0
  16. package/dist/NiceConfirmDialog-C7kdr8jJ.js +81 -0
  17. package/dist/NiceConfirmDialog-DMHqPfFM.js +81 -0
  18. package/dist/NiceConfirmDialog-ZJpQLQQS.cjs +1 -0
  19. package/dist/NiceDataGrid-BzUw4dSu.cjs +10 -0
  20. package/dist/NiceDataGrid-CPKcVOVz.js +1743 -0
  21. package/dist/NiceDataGrid-DJr33WMy.cjs +10 -0
  22. package/dist/NiceDataGrid-D_4gZ1Hu.js +1736 -0
  23. package/dist/NiceDataGrid-DlUAaXhD.js +1736 -0
  24. package/dist/NiceDocumentViewer-8ghRVtfO.js +672 -0
  25. package/dist/NiceDocumentViewer-ChWtA_Ry.cjs +180 -0
  26. package/dist/NiceDocumentViewer-DwLUV7Tc.js +672 -0
  27. package/dist/NiceDocumentViewer-goMzF1w3.cjs +180 -0
  28. package/dist/NiceDocumentViewer-gt1mxzP8.js +672 -0
  29. package/dist/NiceForm-CHEAHxDw.js +4805 -0
  30. package/dist/NiceForm-CJUp1CL0.cjs +1 -0
  31. package/dist/NiceForm-Cp_RH3Yj.js +4805 -0
  32. package/dist/NiceForm-a6tGr6ss.js +4819 -0
  33. package/dist/NiceForm-jU89oe2S.cjs +1 -0
  34. package/dist/NiceGantt-BnQwyTfG.cjs +1 -0
  35. package/dist/NiceGantt-D8coFAvK.js +328 -0
  36. package/dist/NiceGantt-DOZfT6r5.js +328 -0
  37. package/dist/NiceGantt-DQzH1V-R.js +328 -0
  38. package/dist/NiceGantt-jQ8ZpXko.cjs +1 -0
  39. package/dist/NiceHtmlEditor-B1nlXJNW.cjs +10 -0
  40. package/dist/NiceHtmlEditor-Bv3VqJPG.js +862 -0
  41. package/dist/NiceHtmlEditor-CKsGj-Ei.cjs +10 -0
  42. package/dist/NiceHtmlEditor-CloMgyzg.js +841 -0
  43. package/dist/NiceHtmlEditor-DUAHmkWI.js +841 -0
  44. package/dist/NiceLoginForm-Ce_QLnLf.js +736 -0
  45. package/dist/NiceLoginForm-DLpNTQlR.cjs +1 -0
  46. package/dist/NiceLoginForm-Dg0286Cc.js +736 -0
  47. package/dist/NiceLoginForm-X05Vadeg.js +708 -0
  48. package/dist/NiceLoginForm-f_dBCnUi.cjs +1 -0
  49. package/dist/NiceMention-BByI4nFG.js +11120 -0
  50. package/dist/NiceMention-BjeLN4Jx.cjs +430 -0
  51. package/dist/NiceMention-C2TPiMph.cjs +430 -0
  52. package/dist/NiceMention-C67vT6m0.js +11145 -0
  53. package/dist/NiceMention-D1cdy63w.cjs +430 -0
  54. package/dist/NiceMention-OaCi-GNO.js +11094 -0
  55. package/dist/NiceMention-QIuggb9Y.js +11122 -0
  56. package/dist/NiceMention.css +1 -1
  57. package/dist/NiceModal-CHaan9al.js +95 -0
  58. package/dist/NiceModal-Czq6OEAT.js +95 -0
  59. package/dist/NiceModal-D-HFwawr.js +95 -0
  60. package/dist/NiceModal-DOy2XTzc.cjs +1 -0
  61. package/dist/NiceModal-DkawKzEE.cjs +1 -0
  62. package/dist/NiceModuleLifecyclePanel-1CsP8Zst.js +6997 -0
  63. package/dist/NiceModuleLifecyclePanel-Bkx4Yg-3.cjs +1 -0
  64. package/dist/NiceModuleLifecyclePanel-C5oYtczk.js +6999 -0
  65. package/dist/NiceModuleLifecyclePanel-DCcy2yYi.cjs +1 -0
  66. package/dist/NiceModuleLifecyclePanel-DqdgW-0s.js +7004 -0
  67. package/dist/NiceModuleLifecyclePanel.css +1 -1
  68. package/dist/NicePagination-7od5KUa3.cjs +1 -0
  69. package/dist/NicePagination-DMrkR8hH.cjs +1 -0
  70. package/dist/NicePagination-DQmZpsSQ.js +179 -0
  71. package/dist/NicePagination-DipQRjPq.js +172 -0
  72. package/dist/NicePagination-KhlVXYaT.js +172 -0
  73. package/dist/NicePivotGrid-B-KthuqL.cjs +152 -0
  74. package/dist/NicePivotGrid-CLCTHkKO.cjs +152 -0
  75. package/dist/NicePivotGrid-DV54FCsH.js +1174 -0
  76. package/dist/NicePivotGrid-DoWLUPUs.js +1167 -0
  77. package/dist/NicePivotGrid-etwpfccz.js +1167 -0
  78. package/dist/NiceSavedQueryPanel-BABkTNc5.js +5129 -0
  79. package/dist/NiceSavedQueryPanel-Cfeig83P.cjs +586 -0
  80. package/dist/NiceSavedQueryPanel-DTWRLseb.cjs +586 -0
  81. package/dist/NiceSavedQueryPanel-Dy154sxE.js +5129 -0
  82. package/dist/NiceSavedQueryPanel-v7AffOOe.js +5129 -0
  83. package/dist/NiceSavedQueryPanel.css +1 -1
  84. package/dist/NiceScheduler-BEgB7ZgF.cjs +5 -0
  85. package/dist/NiceScheduler-C9JprsEI.cjs +5 -0
  86. package/dist/NiceScheduler-DSP-PPh0.js +1645 -0
  87. package/dist/NiceScheduler-DuPnaA3t.js +1652 -0
  88. package/dist/NiceScheduler-Oa89YZx9.js +1645 -0
  89. package/dist/NiceSelect-A336yeLZ.js +433 -0
  90. package/dist/NiceSelect-B5hTbqi2.js +433 -0
  91. package/dist/NiceSelect-BYSgDYzq.cjs +1 -0
  92. package/dist/NiceSelect-Dudf2T5T.js +433 -0
  93. package/dist/NiceSelect-DwBAIrX7.cjs +1 -0
  94. package/dist/NiceWindow-B6zjBTl9.cjs +1 -0
  95. package/dist/NiceWindow-BKQEx7Vf.js +1623 -0
  96. package/dist/NiceWindow-BnTH7Gy0.js +1623 -0
  97. package/dist/NiceWindow-CZN9NVZw.cjs +1 -0
  98. package/dist/NiceWindow-lxtPR7yZ.js +1623 -0
  99. package/dist/NiceWindow.css +1 -1
  100. package/dist/charts-B8_V3_nq.cjs +882 -0
  101. package/dist/charts-BZgyyybE.js +31933 -0
  102. package/dist/charts-FuDk5-r6.js +31958 -0
  103. package/dist/charts-INj3yFo5.js +31946 -0
  104. package/dist/charts-NolNXKUL.cjs +882 -0
  105. package/dist/charts.cjs +1 -1
  106. package/dist/charts.css +1 -1
  107. package/dist/charts.mjs +1 -1
  108. package/dist/core-A_A6c7an.js +795 -0
  109. package/dist/core-B2iH2J_X.js +795 -0
  110. package/dist/core-BmspZEfD.js +795 -0
  111. package/dist/core-DAfLOet6.cjs +1 -0
  112. package/dist/core-ZG3bgnBR.cjs +1 -0
  113. package/dist/data-branching-B3TOqXAO.cjs +1 -0
  114. package/dist/data-branching-BUGiICDZ.js +6275 -0
  115. package/dist/data-branching-DMXmcocj.js +6275 -0
  116. package/dist/data-branching-YE8P9M5P.js +6275 -0
  117. package/dist/data-branching-t6uhAwIm.cjs +1 -0
  118. package/dist/data-branching.cjs +1 -1
  119. package/dist/data-branching.mjs +1 -1
  120. package/dist/data.cjs +1 -1
  121. package/dist/data.d.ts +7 -2
  122. package/dist/data.mjs +3 -3
  123. package/dist/devops-BhV3OmF7.js +8285 -0
  124. package/dist/devops-BqUxnbRi.cjs +17 -0
  125. package/dist/devops-Bx-Qwj9w.cjs +17 -0
  126. package/dist/devops-DYZatW45.js +8251 -0
  127. package/dist/devops-R98k2zpd.js +8251 -0
  128. package/dist/devops.cjs +1 -1
  129. package/dist/devops.d.ts +29 -16
  130. package/dist/devops.mjs +1 -1
  131. package/dist/editors.cjs +1 -1
  132. package/dist/editors.d.ts +59 -28
  133. package/dist/editors.mjs +7 -7
  134. package/dist/feedback.cjs +1 -1
  135. package/dist/feedback.mjs +3 -3
  136. package/dist/index.cjs +445 -445
  137. package/dist/index.css +1 -1
  138. package/dist/index.d.ts +214 -119
  139. package/dist/index.mjs +16635 -16351
  140. package/dist/lazy.cjs +1 -1
  141. package/dist/lazy.d.ts +31 -18
  142. package/dist/lazy.mjs +24 -24
  143. package/dist/navigation.cjs +1 -1
  144. package/dist/navigation.d.ts +17 -14
  145. package/dist/navigation.mjs +130 -130
  146. package/dist/no-code-BPaAS4wW.cjs +332 -0
  147. package/dist/no-code-CBwUVL1i.js +7447 -0
  148. package/dist/no-code-CjktkQ50.js +7447 -0
  149. package/dist/no-code-DW2NrRba.js +7447 -0
  150. package/dist/no-code-DmFxrZ5T.cjs +332 -0
  151. package/dist/no-code.cjs +1 -1
  152. package/dist/no-code.d.ts +2 -2
  153. package/dist/no-code.mjs +1 -1
  154. package/dist/overlays.cjs +1 -1
  155. package/dist/overlays.d.ts +4 -4
  156. package/dist/overlays.mjs +2 -2
  157. package/dist/pickerCommons-C4XWRUvH.cjs +1 -0
  158. package/dist/pickerCommons-C_BpYs_m.cjs +1 -0
  159. package/dist/pickerCommons-DAOXH_u5.js +1122 -0
  160. package/dist/pickerCommons-Dn4wnDco.js +1122 -0
  161. package/dist/pickerCommons-DskswPS5.js +1122 -0
  162. package/dist/pickerCommons.css +1 -1
  163. package/dist/style.css +7 -7
  164. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,107 @@
1
1
  # [1.0.27] — 2026-06-07
2
2
 
3
+ ## 1.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Close the three items left open in the 1.1.6 response to OmniVerk.
8
+
9
+ **Every value control works without state in the parent.** The `audit-controllable-state` gate
10
+ counted 87 value props that were required with no `default*`, so the control could not render from a
11
+ manifest without data. It now reports 0 and gates CI at `--max=0`. 48 controls gained `default*` props
12
+ through `useControllableState` (existing `value` + handler call sites behave as before); 33 read-only
13
+ data lists are optional with a stable empty default; 4 props paired with a handler only by name are
14
+ optional; `NiceWhiteboard` and `NiceMetricsDashboard` render an empty state until a session or
15
+ dashboard arrives. Additive API only — nothing renamed or removed.
16
+
17
+ - `NicePivotGrid.fields`, `NiceScheduler.events` and `NiceGitHooks.hooks` are controlled only together
18
+ with their change handler, as `NiceScheduler` already documented for `currentDate`/`view`. A bare
19
+ prop stays an initial value; prop plus handler now always wins (later prop updates used to be
20
+ ignored). `NiceGitHooks.onHookChange` is now called; `onHooksChange` and
21
+ `NiceLocaleManager.onTranslationsChange` are new.
22
+ - `NiceCodeEditor` / `NiceCodeDiffEditor` no longer report a value written from the prop back through
23
+ `onChange`, and call the latest handler rather than the one captured at mount.
24
+ - `NiceHtmlEditor` no longer rewrites its content on every render (React 19 compares the
25
+ `dangerouslySetInnerHTML` object, not its string), which moved the caret; the HTML source and
26
+ Markdown views can be closed again.
27
+ - Selections seeded once from the first item (access manager, automation/scene editors, git diff
28
+ viewer, ribbon, setup wizard) follow data that arrives after mount.
29
+ - `useControllableState`: new `fallbackValue` seed that never triggers the value/default clash warning;
30
+ two functional updates in one tick no longer lose the first; `onChange` is called with one argument
31
+ when there is no meta. `UseControllableStateOptions` is now a union type alias.
32
+
33
+ **`--nice-*` is the source of truth for design tokens.** Controls read only `--nice-*` (9,225 reads in
34
+ 339 files). The unprefixed names (`--color-primary`, `--bg-primary`, `--text-muted`, …) stay declared
35
+ as aliases pointing at the Nice tokens, so reading them works, but setting them no longer repaints Nice
36
+ controls. Apps that relied on that can import `@nice2dev/ui/css/legacy-bg-text-aliases.css` after
37
+ `style.css` (removed in 1.2), or set `--nice-color-primary` and friends directly. 13 tokens that were
38
+ read and never declared (`--color-danger`, `--text-on-primary`, `--color-white`, …) are defined; the
39
+ dark blocks define the canonical names, so `.nice-dark` on `<body>` no longer leaves them on light
40
+ values; `--nice-primary-bg` and `--nice-selected-bg` are a primary tint instead of falling through to
41
+ grey. New gate `audit-token-names`.
42
+
43
+ **Node ESM and `require()`.** `@nice2dev/spatial-core` imports from plain Node ESM (51 relative
44
+ specifiers gained extensions, enforced by `nodenext`), and so does `@nice2dev/ui-buildings`, which
45
+ failed through it. `require()` works for `ui-3d`, `ui-graphics` and `game-engine`. The package-exports
46
+ gate now loads every entry in both module systems.
47
+
48
+ **Hygiene.** Sources are prettier-formatted and CI gates on it; 640 stale `.d.ts` files were removed
49
+ from source trees (never published).
50
+
51
+ - Updated dependencies
52
+ - @nice2dev/i18n@1.1.7
53
+ - @nice2dev/ui-core@1.1.7
54
+
55
+ ## 1.1.6
56
+
57
+ ### Patch Changes
58
+
59
+ - Repair the published package surface, in answer to the OmniVerk 1.1.6 request.
60
+
61
+ **Type declarations.** `ui-3d`, `ui-graphics` and `game-engine` published zero `.d.ts` while
62
+ declaring `"types": "dist/types/index.d.ts"` — their declaration emitter was never invoked, and
63
+ rollup treats TS errors as warnings, so the build stayed green. `icons-game` had the same outcome
64
+ by a different route: `noEmit: true` in its tsconfig silently beats `tsc --emitDeclarationOnly` on
65
+ TS 5.9, so the step exited 0 and wrote nothing; it now emits declarations via `vite-plugin-dts`.
66
+ `ui-diagrams` pointed `types` and `exports["."]` at `./src/`, which `files` does not publish.
67
+ Turning the emitters on surfaced 9 real TS errors that rollup had been swallowing (`SVGResultPaths`,
68
+ framer-motion's removed `AnimationControls`, WebGPU's removed `requestAdapterInfo()`).
69
+
70
+ **Stylesheet exports.** `exports["./style.css"]` pointed at `./dist/style.css` in 28 packages while
71
+ the build emits `dist/<pkg>.css` (vite) or `dist/{cjs,esm}/nice2dev-<pkg>.css` (rollup). The public
72
+ specifier is unchanged — it just resolves now. The dead entry is removed from the nine packages that
73
+ emit no CSS at all. `ui-security` and `ui-video` authored a stylesheet that nothing imported, so it
74
+ never reached the bundle; it ships now.
75
+
76
+ **`@nice2dev/icons` subpaths.** `./rsc`, `./client`, `./design-tokens`, `./headless-ui` and
77
+ `./utilities` resolved to JavaScript the build never produced — rollup with `preserveModules` only
78
+ emits modules reachable from an entry, and none of the five was one. They are real entry points now.
79
+ Four icon packs pointed `require.types` at a `.d.cts` no build creates, and four `icons-life`
80
+ subpaths declared no `types` condition at all.
81
+
82
+ **CSS.** 47 declarations across 13 stylesheets in `@nice2dev/ui` carried an unbalanced `)` left by a
83
+ token migration in 1.0.19; two had a wrecked `linear-gradient` and were rewritten. Every emitted
84
+ stylesheet now parses under lightningcss, so Vite 8's default CSS minifier works.
85
+
86
+ **Sourcemaps.** No package publishes them any more. They referenced `src/` paths absent from the
87
+ tarball and carried no `sourcesContent`, which TypeScript does not offer for `.d.ts.map` at all.
88
+
89
+ **API (additive).** `NiceDateRangeBox` works uncontrolled — `startDate`, `endDate`, `onStartChange`
90
+ and `onEndChange` are optional, with `defaultStartDate` / `defaultEndDate`.
91
+ `NiceVocalPerformanceReport` accepts a precomputed `reports` (plus `noteCount`) instead of a live
92
+ audio session, and renders an empty state rather than `null`. `NiceKaraokeLyrics` takes optional
93
+ `song` / `currentTime` and exports its props interface.
94
+
95
+ **Release integrity.** CI now wipes `packages/*/dist` before building — the self-hosted agent's
96
+ persistent workspace meant any file that ever landed there was published forever, which is why
97
+ `ui-3d@1.1.5` shipped a declaration barrel generated a year earlier. A new gate,
98
+ `scripts/audit-package-exports.mjs`, resolves every entry point and `exports` condition against the
99
+ filesystem, checks `files[]` coverage and CSS parenthesis balance, and runs after the build and
100
+ before artifacts are uploaded.
101
+
102
+ - @nice2dev/i18n@1.1.6
103
+ - @nice2dev/ui-core@1.1.6
104
+
3
105
  ## 1.1.5
4
106
 
5
107
  ### Patch Changes
package/README.md CHANGED
@@ -587,40 +587,57 @@ The entire design system is driven by CSS custom properties. Import the styleshe
587
587
  import '@nice2dev/ui/style.css';
588
588
  ```
589
589
 
590
+ > **Renamed in 1.1.7.** Every token is now spelled `--nice-*`. The old unprefixed
591
+ > names (`--color-primary`, `--bg-primary`, `--text-muted`, …) still **resolve** —
592
+ > `style.css` declares them as aliases — but the controls no longer **read** them,
593
+ > so setting one in your app no longer repaints Nice controls. That was never
594
+ > intentional: unprefixed names belong to the page, and an app that scoped
595
+ > `--color-primary` to one of its own components was silently repainting every Nice
596
+ > control rendered inside it. To keep the old override behaviour for one more
597
+ > release, import [the opt-in compatibility sheet](#legacy-shorthand-alias-layer-opt-in).
598
+
590
599
  #### Available Variables
591
600
 
592
601
  ```css
593
602
  :root {
594
603
  /* Colors */
595
- --color-primary: #3b82f6;
596
- --color-primary-hover: #2563eb;
597
- --color-success: #10b981;
598
- --color-warning: #f59e0b;
599
- --color-error: #ef4444;
600
- --color-info: #06b6d4;
604
+ --nice-color-primary: #3b82f6;
605
+ --nice-color-primary-hover: #2563eb;
606
+ --nice-color-success: #10b981;
607
+ --nice-color-warning: #f59e0b;
608
+ --nice-color-error: #ef4444;
609
+ --nice-color-danger: var(--nice-color-error);
610
+ --nice-color-info: #06b6d4;
611
+ --nice-color-accent: #8b5cf6;
601
612
 
602
613
  /* Backgrounds */
603
- --bg-primary: #ffffff;
604
- --bg-secondary: #f8fafc;
605
- --bg-tertiary: #f1f5f9;
614
+ --nice-bg-primary: #ffffff;
615
+ --nice-bg-secondary: #f8fafc;
616
+ --nice-bg-tertiary: #f1f5f9;
617
+ --nice-bg-elevated: #ffffff;
606
618
 
607
619
  /* Text */
608
- --text-primary: #0f172a;
609
- --text-secondary: #475569;
610
- --text-muted: #94a3b8;
620
+ --nice-text-primary: #0f172a;
621
+ --nice-text-secondary: #475569;
622
+ --nice-text-muted: #94a3b8;
623
+ --nice-text-on-primary: #ffffff;
611
624
 
612
625
  /* Borders & Interactions */
613
- --border-color: #e2e8f0;
614
- --hover-bg: #f1f5f9;
626
+ --nice-border-color: #cbd5e1;
627
+ --nice-hover-bg: #f1f5f9;
628
+ --nice-selected-bg: #dbeafe;
615
629
 
616
630
  /* Shadows */
617
- --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
618
- --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
619
- --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
620
- --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
631
+ --nice-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
632
+ --nice-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
633
+ --nice-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
634
+ --nice-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
621
635
  }
622
636
  ```
623
637
 
638
+ This is the spelling [`@nice2dev/design-tokens`](../design-tokens) emits, so the two
639
+ packages now share one vocabulary.
640
+
624
641
  ### Dark Mode
625
642
 
626
643
  Dark mode is supported in three ways:
@@ -655,27 +672,31 @@ Create a custom theme by overriding CSS variables:
655
672
  ```css
656
673
  /* my-theme.css */
657
674
  :root {
658
- --color-primary: #8b5cf6; /* purple primary */
659
- --color-primary-hover: #7c3aed;
660
- --bg-primary: #faf5ff;
661
- --border-color: #ddd6fe;
675
+ --nice-color-primary: #8b5cf6; /* purple primary */
676
+ --nice-color-primary-hover: #7c3aed;
677
+ --nice-bg-primary: #faf5ff;
678
+ --nice-border-color: #ddd6fe;
662
679
  }
663
680
  ```
664
681
 
665
682
  ### Legacy shorthand alias layer (opt-in)
666
683
 
667
- If your app already uses the conventional shorthand variables
668
- (`--bg-primary`, `--text-primary`, `--border-color`, `--shadow-sm/md/lg`,
669
- etc.) — for example when porting from a custom design-token system
670
- like OmniVerk's `--s-*` table — import the opt-in alias stylesheet so
671
- those names inherit values from the active Nice token set without
672
- being redefined by hand:
684
+ If your app **sets** the conventional shorthand variables (`--color-primary`,
685
+ `--bg-primary`, `--text-primary`, `--border-color`, `--shadow-sm/md/lg`, …) and
686
+ expects Nice controls to follow them, import this sheet **after** `style.css`. It
687
+ re-points each Nice token at the matching unprefixed name, falling back to the Nice
688
+ default where your app has not set one:
673
689
 
674
690
  ```ts
675
691
  import '@nice2dev/ui/style.css';
676
- import '@nice2dev/ui/css/legacy-bg-text-aliases.css'; // opt-in
692
+ import '@nice2dev/ui/css/legacy-bg-text-aliases.css'; // opt-in, must come second
677
693
  ```
678
694
 
695
+ Reading the old names never stopped working and needs no import — `style.css`
696
+ declares them as aliases. This sheet is only about the reverse direction, and it is
697
+ removed in 1.2. Prefer setting `--nice-color-primary` directly: it cannot collide
698
+ with your own variables, and unlike the shorthand it is safe to scope to a subtree.
699
+
679
700
  The alias file only fills in gaps (it never overrides values you set
680
701
  yourself) and follows the active Nice theme (light / dark) automatically.
681
702
 
@@ -1,83 +1,87 @@
1
1
  /* ============================================================
2
2
  @nice2dev/ui — legacy-bg-text-aliases.css
3
3
 
4
- Opt-in alias layer that maps the conventional shorthand CSS
5
- variables used by many design systems onto the canonical
6
- `--nice-*` design tokens shipped by @nice2dev/ui.
4
+ Opt-in compatibility layer for apps that SET the old unprefixed
5
+ variable names and expect Nice controls to follow them.
7
6
 
8
- Use case: your app already references `--bg-primary`, `--text-primary`,
9
- `--border-color`, `--shadow-sm/md/lg`, etc. directly in its own CSS
10
- (e.g. ported from a custom design system like OmniVerk's `--s-*`
11
- table) and you want those names to inherit values from the active
12
- Nice token set instead of re-defining them by hand.
7
+ Until 1.1.7 the library read `--color-primary`, `--bg-primary`,
8
+ `--text-muted`, `--border-color`, `--shadow-md` and friends directly,
9
+ so setting those names anywhere on the page repainted our controls.
10
+ That was never intentional: unprefixed names belong to the page, not
11
+ to a library, and a single collision poisoned the whole `--nice-*`
12
+ tree because those tokens were derived from the unprefixed ones.
13
+
14
+ From 1.1.7 the controls read `--nice-*` only, and `style.css` declares
15
+ the old names as aliases pointing AT the Nice tokens — so reading them
16
+ still works. What no longer works by default is the reverse: setting
17
+ `--color-primary` in your app no longer moves our controls.
18
+
19
+ Import this file if you need that behaviour back:
13
20
 
14
- Usage (after `@nice2dev/ui/style.css`):
15
21
  import '@nice2dev/ui/style.css';
16
- import '@nice2dev/ui/css/legacy-bg-text-aliases.css';
22
+ import '@nice2dev/ui/css/legacy-bg-text-aliases.css'; // after style.css
23
+
24
+ It re-points each Nice token at the matching unprefixed name, falling
25
+ back to the Nice default when the app has not set one. Loading it after
26
+ style.css is required — these declarations must win on source order.
17
27
 
18
- The fallback chain prefers the canonical Nice token, then the bare
19
- shorthand the app may have set itself, then a sane hardcoded value.
20
- This file therefore never *overrides* an explicit app value — it
21
- only fills in gaps.
28
+ Prefer migrating instead: set `--nice-color-primary` (and friends)
29
+ directly. That is the spelling @nice2dev/design-tokens emits, it cannot
30
+ collide with your own variables, and this file will be removed in 1.2.
22
31
  ============================================================ */
23
32
 
24
33
  :root {
25
34
  /* Backgrounds */
26
- --bg-primary: var(--nice-bg-primary, var(--bg-primary, #ffffff));
27
- --bg-secondary: var(--nice-bg-secondary, var(--bg-secondary, #f8fafc));
28
- --bg-tertiary: var(--nice-bg-tertiary, var(--bg-tertiary, #f1f5f9));
29
- --bg-elevated: var(--nice-bg-elevated, var(--bg-elevated, #ffffff));
30
- --bg-canvas: var(--nice-bg-canvas, var(--bg-canvas, #f8fafc));
31
- --bg-inset: var(--nice-bg-tertiary, var(--bg-inset, #f1f5f9));
35
+ --nice-bg-primary: var(--bg-primary, #ffffff);
36
+ --nice-bg-secondary: var(--bg-secondary, #f8fafc);
37
+ --nice-bg-tertiary: var(--bg-tertiary, #f1f5f9);
38
+ --nice-bg-elevated: var(--bg-elevated, #ffffff);
39
+ --nice-bg-canvas: var(--bg-canvas, #f8fafc);
40
+ --nice-bg-inset: var(--bg-inset, #f1f5f9);
32
41
 
33
42
  /* Text */
34
- --text-primary: var(--nice-text-primary, var(--text-primary, #0f172a));
35
- --text-secondary: var(--nice-text-secondary, var(--text-secondary, #475569));
36
- --text-muted: var(--nice-text-muted, var(--text-muted, #94a3b8));
37
- --text-inverse: var(--nice-text-inverse, var(--text-inverse, #ffffff));
43
+ --nice-text-primary: var(--text-primary, #0f172a);
44
+ --nice-text-secondary: var(--text-secondary, #475569);
45
+ --nice-text-muted: var(--text-muted, #94a3b8);
46
+ --nice-text-inverse: var(--text-inverse, #ffffff);
38
47
 
39
48
  /* Borders */
40
- --border-color: var(--nice-border-color, var(--border-color, #cbd5e1));
41
- --border-light: var(--nice-border-light, var(--border-color, #e2e8f0));
42
- --border-strong: var(--nice-border-strong, var(--border-color, #94a3b8));
49
+ --nice-border-color: var(--border-color, #cbd5e1);
43
50
 
44
51
  /* Shadows */
45
- --shadow-sm: var(--nice-shadow-sm, var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05)));
46
- --shadow-md: var(--nice-shadow-md, var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.10)));
47
- --shadow-lg: var(--nice-shadow-lg, var(--shadow-lg, 0 10px 24px rgba(0, 0, 0, 0.15)));
48
- --shadow-xl: var(--nice-shadow-xl, var(--shadow-xl, 0 20px 40px rgba(0, 0, 0, 0.20)));
49
-
50
- /* Brand / status colors (most commonly aliased shorthand) */
51
- --color-primary: var(--nice-primary, var(--color-primary, #3b82f6));
52
- --color-success: var(--nice-success, var(--color-success, #10b981));
53
- --color-warning: var(--nice-warning, var(--color-warning, #f59e0b));
54
- --color-error: var(--nice-error, var(--color-error, #ef4444));
55
- --color-info: var(--nice-info, var(--color-info, #06b6d4));
56
- --color-accent: var(--nice-accent, var(--color-accent, #8b5cf6));
52
+ --nice-shadow-sm: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
53
+ --nice-shadow-md: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
54
+ --nice-shadow-lg: var(--shadow-lg, 0 10px 24px rgba(0, 0, 0, 0.15));
55
+ --nice-shadow-xl: var(--shadow-xl, 0 20px 40px rgba(0, 0, 0, 0.2));
56
+
57
+ /* Brand / status colours */
58
+ --nice-color-primary: var(--color-primary, #3b82f6);
59
+ --nice-color-success: var(--color-success, #10b981);
60
+ --nice-color-warning: var(--color-warning, #f59e0b);
61
+ --nice-color-error: var(--color-error, #ef4444);
62
+ --nice-color-info: var(--color-info, #06b6d4);
63
+ --nice-color-accent: var(--color-accent, #8b5cf6);
57
64
 
58
65
  /* Hover / surface */
59
- --hover-bg: var(--nice-hover-bg, var(--hover-bg, #f1f5f9));
60
- --color-surface: var(--nice-surface, var(--color-surface, #ffffff));
66
+ --nice-hover-bg: var(--hover-bg, #f1f5f9);
67
+ --nice-color-surface: var(--color-surface, #ffffff);
61
68
  }
62
69
 
63
- /* Dark-mode mirror — applies under the same selectors Nice uses
64
- for its dark theme. The canonical Nice tokens already swap with
65
- the data-theme attribute, so the aliases inherit automatically;
66
- this block re-asserts the chain in case the consumer uses a
67
- different selector and expects the shorthand vars to follow. */
68
- [data-theme='dark'] :root,
69
- :root[data-theme='dark'],
70
- .dark :root,
71
- .nice-theme-dark :root {
72
- --bg-primary: var(--nice-bg-primary, #0f172a);
73
- --bg-secondary: var(--nice-bg-secondary, #1e293b);
74
- --bg-tertiary: var(--nice-bg-tertiary, #334155);
75
- --bg-elevated: var(--nice-bg-elevated, #1e293b);
76
- --bg-canvas: var(--nice-bg-canvas, #0f172a);
77
-
78
- --text-primary: var(--nice-text-primary, #f8fafc);
79
- --text-secondary: var(--nice-text-secondary, #cbd5e1);
80
- --text-muted: var(--nice-text-muted, #64748b);
81
-
82
- --border-color: var(--nice-border-color, #334155);
70
+ /* Dark-mode mirror. The Nice tokens swap on their own with the theme
71
+ attribute; this block re-asserts the chain so an app that sets the
72
+ unprefixed names per theme still wins under Nice's dark selectors. */
73
+ .nice-dark,
74
+ [data-theme='dark'],
75
+ :root[data-theme='dark'] {
76
+ --nice-bg-primary: var(--bg-primary, #0f172a);
77
+ --nice-bg-secondary: var(--bg-secondary, #1e293b);
78
+ --nice-bg-tertiary: var(--bg-tertiary, #334155);
79
+ --nice-bg-elevated: var(--bg-elevated, #1e293b);
80
+ --nice-bg-canvas: var(--bg-canvas, #0f172a);
81
+
82
+ --nice-text-primary: var(--text-primary, #f8fafc);
83
+ --nice-text-secondary: var(--text-secondary, #cbd5e1);
84
+ --nice-text-muted: var(--text-muted, #64748b);
85
+
86
+ --nice-border-color: var(--border-color, #334155);
83
87
  }