@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.
- package/CHANGELOG.md +102 -0
- package/README.md +50 -29
- package/css/legacy-bg-text-aliases.css +65 -61
- package/dist/NiceCodeEditor-Bc81wiaN.js +1134 -0
- package/dist/NiceCodeEditor-D6f8KdHN.js +1134 -0
- package/dist/NiceCodeEditor-DE3saxyt.cjs +260 -0
- package/dist/NiceCodeEditor-DZM16My5.cjs +260 -0
- package/dist/NiceCodeEditor-HqmcJjmZ.js +1179 -0
- package/dist/NiceColorPicker-6EqXaDj0.cjs +1 -0
- package/dist/NiceColorPicker-BiEWqWnd.js +596 -0
- package/dist/NiceColorPicker-Cuc6YXqz.cjs +1 -0
- package/dist/NiceColorPicker-DMATcNWG.js +596 -0
- package/dist/NiceColorPicker-R3O1nemp.js +596 -0
- package/dist/NiceConfirmDialog-B0e10fRL.cjs +1 -0
- package/dist/NiceConfirmDialog-BBDgEMHv.js +81 -0
- package/dist/NiceConfirmDialog-C7kdr8jJ.js +81 -0
- package/dist/NiceConfirmDialog-DMHqPfFM.js +81 -0
- package/dist/NiceConfirmDialog-ZJpQLQQS.cjs +1 -0
- package/dist/NiceDataGrid-BzUw4dSu.cjs +10 -0
- package/dist/NiceDataGrid-CPKcVOVz.js +1743 -0
- package/dist/NiceDataGrid-DJr33WMy.cjs +10 -0
- package/dist/NiceDataGrid-D_4gZ1Hu.js +1736 -0
- package/dist/NiceDataGrid-DlUAaXhD.js +1736 -0
- package/dist/NiceDocumentViewer-8ghRVtfO.js +672 -0
- package/dist/NiceDocumentViewer-ChWtA_Ry.cjs +180 -0
- package/dist/NiceDocumentViewer-DwLUV7Tc.js +672 -0
- package/dist/NiceDocumentViewer-goMzF1w3.cjs +180 -0
- package/dist/NiceDocumentViewer-gt1mxzP8.js +672 -0
- package/dist/NiceForm-CHEAHxDw.js +4805 -0
- package/dist/NiceForm-CJUp1CL0.cjs +1 -0
- package/dist/NiceForm-Cp_RH3Yj.js +4805 -0
- package/dist/NiceForm-a6tGr6ss.js +4819 -0
- package/dist/NiceForm-jU89oe2S.cjs +1 -0
- package/dist/NiceGantt-BnQwyTfG.cjs +1 -0
- package/dist/NiceGantt-D8coFAvK.js +328 -0
- package/dist/NiceGantt-DOZfT6r5.js +328 -0
- package/dist/NiceGantt-DQzH1V-R.js +328 -0
- package/dist/NiceGantt-jQ8ZpXko.cjs +1 -0
- package/dist/NiceHtmlEditor-B1nlXJNW.cjs +10 -0
- package/dist/NiceHtmlEditor-Bv3VqJPG.js +862 -0
- package/dist/NiceHtmlEditor-CKsGj-Ei.cjs +10 -0
- package/dist/NiceHtmlEditor-CloMgyzg.js +841 -0
- package/dist/NiceHtmlEditor-DUAHmkWI.js +841 -0
- package/dist/NiceLoginForm-Ce_QLnLf.js +736 -0
- package/dist/NiceLoginForm-DLpNTQlR.cjs +1 -0
- package/dist/NiceLoginForm-Dg0286Cc.js +736 -0
- package/dist/NiceLoginForm-X05Vadeg.js +708 -0
- package/dist/NiceLoginForm-f_dBCnUi.cjs +1 -0
- package/dist/NiceMention-BByI4nFG.js +11120 -0
- package/dist/NiceMention-BjeLN4Jx.cjs +430 -0
- package/dist/NiceMention-C2TPiMph.cjs +430 -0
- package/dist/NiceMention-C67vT6m0.js +11145 -0
- package/dist/NiceMention-D1cdy63w.cjs +430 -0
- package/dist/NiceMention-OaCi-GNO.js +11094 -0
- package/dist/NiceMention-QIuggb9Y.js +11122 -0
- package/dist/NiceMention.css +1 -1
- package/dist/NiceModal-CHaan9al.js +95 -0
- package/dist/NiceModal-Czq6OEAT.js +95 -0
- package/dist/NiceModal-D-HFwawr.js +95 -0
- package/dist/NiceModal-DOy2XTzc.cjs +1 -0
- package/dist/NiceModal-DkawKzEE.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-1CsP8Zst.js +6997 -0
- package/dist/NiceModuleLifecyclePanel-Bkx4Yg-3.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-C5oYtczk.js +6999 -0
- package/dist/NiceModuleLifecyclePanel-DCcy2yYi.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DqdgW-0s.js +7004 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-7od5KUa3.cjs +1 -0
- package/dist/NicePagination-DMrkR8hH.cjs +1 -0
- package/dist/NicePagination-DQmZpsSQ.js +179 -0
- package/dist/NicePagination-DipQRjPq.js +172 -0
- package/dist/NicePagination-KhlVXYaT.js +172 -0
- package/dist/NicePivotGrid-B-KthuqL.cjs +152 -0
- package/dist/NicePivotGrid-CLCTHkKO.cjs +152 -0
- package/dist/NicePivotGrid-DV54FCsH.js +1174 -0
- package/dist/NicePivotGrid-DoWLUPUs.js +1167 -0
- package/dist/NicePivotGrid-etwpfccz.js +1167 -0
- package/dist/NiceSavedQueryPanel-BABkTNc5.js +5129 -0
- package/dist/NiceSavedQueryPanel-Cfeig83P.cjs +586 -0
- package/dist/NiceSavedQueryPanel-DTWRLseb.cjs +586 -0
- package/dist/NiceSavedQueryPanel-Dy154sxE.js +5129 -0
- package/dist/NiceSavedQueryPanel-v7AffOOe.js +5129 -0
- package/dist/NiceSavedQueryPanel.css +1 -1
- package/dist/NiceScheduler-BEgB7ZgF.cjs +5 -0
- package/dist/NiceScheduler-C9JprsEI.cjs +5 -0
- package/dist/NiceScheduler-DSP-PPh0.js +1645 -0
- package/dist/NiceScheduler-DuPnaA3t.js +1652 -0
- package/dist/NiceScheduler-Oa89YZx9.js +1645 -0
- package/dist/NiceSelect-A336yeLZ.js +433 -0
- package/dist/NiceSelect-B5hTbqi2.js +433 -0
- package/dist/NiceSelect-BYSgDYzq.cjs +1 -0
- package/dist/NiceSelect-Dudf2T5T.js +433 -0
- package/dist/NiceSelect-DwBAIrX7.cjs +1 -0
- package/dist/NiceWindow-B6zjBTl9.cjs +1 -0
- package/dist/NiceWindow-BKQEx7Vf.js +1623 -0
- package/dist/NiceWindow-BnTH7Gy0.js +1623 -0
- package/dist/NiceWindow-CZN9NVZw.cjs +1 -0
- package/dist/NiceWindow-lxtPR7yZ.js +1623 -0
- package/dist/NiceWindow.css +1 -1
- package/dist/charts-B8_V3_nq.cjs +882 -0
- package/dist/charts-BZgyyybE.js +31933 -0
- package/dist/charts-FuDk5-r6.js +31958 -0
- package/dist/charts-INj3yFo5.js +31946 -0
- package/dist/charts-NolNXKUL.cjs +882 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.css +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-A_A6c7an.js +795 -0
- package/dist/core-B2iH2J_X.js +795 -0
- package/dist/core-BmspZEfD.js +795 -0
- package/dist/core-DAfLOet6.cjs +1 -0
- package/dist/core-ZG3bgnBR.cjs +1 -0
- package/dist/data-branching-B3TOqXAO.cjs +1 -0
- package/dist/data-branching-BUGiICDZ.js +6275 -0
- package/dist/data-branching-DMXmcocj.js +6275 -0
- package/dist/data-branching-YE8P9M5P.js +6275 -0
- package/dist/data-branching-t6uhAwIm.cjs +1 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +7 -2
- package/dist/data.mjs +3 -3
- package/dist/devops-BhV3OmF7.js +8285 -0
- package/dist/devops-BqUxnbRi.cjs +17 -0
- package/dist/devops-Bx-Qwj9w.cjs +17 -0
- package/dist/devops-DYZatW45.js +8251 -0
- package/dist/devops-R98k2zpd.js +8251 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.d.ts +29 -16
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +59 -28
- package/dist/editors.mjs +7 -7
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +3 -3
- package/dist/index.cjs +445 -445
- package/dist/index.css +1 -1
- package/dist/index.d.ts +214 -119
- package/dist/index.mjs +16635 -16351
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +31 -18
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +17 -14
- package/dist/navigation.mjs +130 -130
- package/dist/no-code-BPaAS4wW.cjs +332 -0
- package/dist/no-code-CBwUVL1i.js +7447 -0
- package/dist/no-code-CjktkQ50.js +7447 -0
- package/dist/no-code-DW2NrRba.js +7447 -0
- package/dist/no-code-DmFxrZ5T.cjs +332 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.d.ts +2 -2
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +4 -4
- package/dist/overlays.mjs +2 -2
- package/dist/pickerCommons-C4XWRUvH.cjs +1 -0
- package/dist/pickerCommons-C_BpYs_m.cjs +1 -0
- package/dist/pickerCommons-DAOXH_u5.js +1122 -0
- package/dist/pickerCommons-Dn4wnDco.js +1122 -0
- package/dist/pickerCommons-DskswPS5.js +1122 -0
- package/dist/pickerCommons.css +1 -1
- package/dist/style.css +7 -7
- 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-
|
|
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: #
|
|
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
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
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
|
|
5
|
-
|
|
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
|
-
|
|
9
|
-
`--border-color`, `--shadow-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
--
|
|
27
|
-
--
|
|
28
|
-
--
|
|
29
|
-
--
|
|
30
|
-
--
|
|
31
|
-
--bg-inset:
|
|
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
|
-
--
|
|
35
|
-
--
|
|
36
|
-
--
|
|
37
|
-
--
|
|
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
|
-
--
|
|
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
|
-
--
|
|
46
|
-
--
|
|
47
|
-
--
|
|
48
|
-
--
|
|
49
|
-
|
|
50
|
-
/* Brand / status
|
|
51
|
-
--color-primary:
|
|
52
|
-
--color-success:
|
|
53
|
-
--color-warning:
|
|
54
|
-
--color-error:
|
|
55
|
-
--color-info:
|
|
56
|
-
--color-accent:
|
|
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
|
-
--
|
|
60
|
-
--color-surface:
|
|
66
|
+
--nice-hover-bg: var(--hover-bg, #f1f5f9);
|
|
67
|
+
--nice-color-surface: var(--color-surface, #ffffff);
|
|
61
68
|
}
|
|
62
69
|
|
|
63
|
-
/* Dark-mode mirror
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
[data-theme='dark']
|
|
69
|
-
:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
--bg-
|
|
73
|
-
--bg-
|
|
74
|
-
|
|
75
|
-
--
|
|
76
|
-
--
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
--
|
|
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
|
}
|