@ng-solid/design-system 22.2.2 → 22.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/fesm2022/ng-solid-design-system.mjs +3736 -482
- package/fesm2022/ng-solid-design-system.mjs.map +1 -1
- package/package.json +1 -1
- package/themes/README.md +72 -1
- package/themes/tailwind.css +15 -0
- package/types/ng-solid-design-system.d.ts +683 -89
package/package.json
CHANGED
package/themes/README.md
CHANGED
|
@@ -53,11 +53,51 @@ export const ProductTheme = defineNsPreset(Arvisfy, {
|
|
|
53
53
|
|
|
54
54
|
Tailwind utilities are composed from SCSS, never placed in ng-solid component
|
|
55
55
|
templates. Consumers that want the same semantic utility bridge may import
|
|
56
|
-
`@ng-solid/design-system/themes/tailwind.css` after Tailwind
|
|
56
|
+
`@ng-solid/design-system/themes/tailwind.css` after Tailwind; doing so also
|
|
57
|
+
applies the box-sizing contract described below, though the kit assumes that
|
|
58
|
+
contract regardless of whether the bridge is imported (see "Box model").
|
|
57
59
|
|
|
58
60
|
Every component stylesheet starts with `@reference` to that bridge and reads
|
|
59
61
|
only `--ns-component-*` variables for component-specific visual decisions.
|
|
60
62
|
|
|
63
|
+
## Box model
|
|
64
|
+
|
|
65
|
+
Arvisfy assumes `box-sizing: border-box` everywhere. `theme/tailwind.css`
|
|
66
|
+
restates the `box-sizing` declaration from Tailwind v4's preflight, on that
|
|
67
|
+
preflight's exact selector:
|
|
68
|
+
|
|
69
|
+
```css
|
|
70
|
+
*,
|
|
71
|
+
::before,
|
|
72
|
+
::after,
|
|
73
|
+
::backdrop,
|
|
74
|
+
::file-selector-button {
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
It is copied literally rather than `@import`ed, because ng-packagr ships this
|
|
80
|
+
file as a plain asset — an `@import` would reach the consumer unresolved. The
|
|
81
|
+
rest of preflight's box-sizing block (`margin/padding/border: 0` on every
|
|
82
|
+
element) is intentionally left out: unlike this single, additive rule, it is
|
|
83
|
+
destructive to markup that doesn't expect it.
|
|
84
|
+
|
|
85
|
+
Three properties follow from that choice:
|
|
86
|
+
|
|
87
|
+
- **Idempotent.** Applications that already load Tailwind's own preflight (or
|
|
88
|
+
any other reset that sets the same rule) see no change — selector and
|
|
89
|
+
declaration are identical.
|
|
90
|
+
- **Zero added specificity.** The universal selector `*` (and the
|
|
91
|
+
pseudo-elements listed alongside it) contributes no specificity, so any
|
|
92
|
+
consumer rule, however plain, overrides it trivially. It is a default, not
|
|
93
|
+
an imposition.
|
|
94
|
+
- **Opt-in scope.** Consumers who don't import the bridge are covered only
|
|
95
|
+
where a component's own SCSS declares `box-sizing` locally; the
|
|
96
|
+
workspace-wide default lives solely inside `tailwind.css`.
|
|
97
|
+
|
|
98
|
+
An audit across 53 playground pages found that adopting this rule eliminated
|
|
99
|
+
17 real overflow bugs and introduced none.
|
|
100
|
+
|
|
61
101
|
## HeroUI foundations
|
|
62
102
|
|
|
63
103
|
Arvisfy vendors Inter Variable in `theme/fonts/InterVariable.woff2` (with its
|
|
@@ -73,3 +113,34 @@ maps to `light`. Components own their state tokens (for example
|
|
|
73
113
|
`--ns-component-slider-*` and `--ns-component-input-search-*`) rather than
|
|
74
114
|
borrowing another component's variables; use the matching family when adding
|
|
75
115
|
a visual decision.
|
|
116
|
+
|
|
117
|
+
## Retired tokens
|
|
118
|
+
|
|
119
|
+
A token is retired when no component stylesheet reads its `--ns-component-*`
|
|
120
|
+
variable anymore, but it still ships as a published field of the preset —
|
|
121
|
+
removing the field outright would silently break any consumer override that
|
|
122
|
+
still targets it. `NsTokenTree` has an open index signature, so an override
|
|
123
|
+
of a retired (or otherwise unknown) key merges in cleanly with no type error
|
|
124
|
+
and no `validateNsPreset` error; it just has no effect.
|
|
125
|
+
|
|
126
|
+
To surface that instead of letting it fail silently, `theme/utils/theme.utils.ts`
|
|
127
|
+
keeps a small internal `NS_RETIRED_TOKENS` map of retired token paths to a
|
|
128
|
+
warning message, and `validateNsPreset` emits a `console.warn` for each one
|
|
129
|
+
still present in the resolved preset. This does not throw — an inert override
|
|
130
|
+
should not crash a consumer's app — and it is not deduplicated across calls,
|
|
131
|
+
so it warns every time a preset containing the retired path is validated.
|
|
132
|
+
|
|
133
|
+
The registry lives inside `theme.utils.ts` itself rather than its own file:
|
|
134
|
+
`packages/mcp`'s data extraction transpiles that file in isolation and cannot
|
|
135
|
+
resolve a relative value import from a sibling module at that point (see
|
|
136
|
+
`assertNoValueImports` in `packages/mcp/scripts/lib/extract-tokens.mjs`), so a
|
|
137
|
+
separate `retired-tokens.ts` imported for its data would break
|
|
138
|
+
`nx run mcp:build-data`.
|
|
139
|
+
|
|
140
|
+
Currently retired:
|
|
141
|
+
|
|
142
|
+
- `components.imageUpload.thumbnailSize` — used to size each stack thumbnail
|
|
143
|
+
and (indirectly) the height of `ns-image-upload[layout="cover"]`. Since the
|
|
144
|
+
height fix in AVF-29, `components.imageUpload.emptyMinHeight` alone sizes
|
|
145
|
+
that layout in both its empty and filled states, and no stylesheet reads
|
|
146
|
+
`--ns-component-image-upload-thumbnail-size` anymore.
|
package/themes/tailwind.css
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/* This bridge ships as a raw asset (ng-package.json) and ng-packagr copies it
|
|
2
|
+
byte-for-byte to consumers, with no PostCSS pass — so it cannot `@import`
|
|
3
|
+
Tailwind's preflight (that import would reach consumers unresolved).
|
|
4
|
+
Instead this literally reproduces just the `box-sizing: border-box` line
|
|
5
|
+
from Tailwind v4's preflight (node_modules/tailwindcss/preflight.css),
|
|
6
|
+
intentionally omitting the accompanying margin/padding/border reset, which
|
|
7
|
+
would be destructive to existing markup. */
|
|
8
|
+
*,
|
|
9
|
+
::before,
|
|
10
|
+
::after,
|
|
11
|
+
::backdrop,
|
|
12
|
+
::file-selector-button {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
1
16
|
@font-face {
|
|
2
17
|
font-family: 'Inter Variable';
|
|
3
18
|
font-style: normal;
|