@openelement/ui 1.0.0-alpha.8 → 1.0.0-alpha.9
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/CUSTOMIZATION.md +271 -0
- package/README.md +38 -39
- package/package.json +4 -12
- package/src/component-recipes.js +22 -22
- package/src/generated-manifest.json +7 -7
- package/src/index.d.ts +1 -2
- package/src/index.js +1 -2
- package/src/open-badge.js +23 -23
- package/src/open-button.js +34 -33
- package/src/open-callout.js +12 -15
- package/src/open-card.js +26 -23
- package/src/open-code-block.js +44 -43
- package/src/open-dialog.js +79 -27
- package/src/open-dropdown.js +2 -2
- package/src/open-input.js +21 -21
- package/src/open-tabs.js +11 -11
- package/src/open-theme-toggle.js +11 -11
- package/src/theme.css +205 -0
- package/THIRD_PARTY_NOTICES.md +0 -45
- package/src/open-props-tokens.d.ts +0 -9
- package/src/open-props-tokens.js +0 -464
- package/src/semantic-tokens.css +0 -413
package/CUSTOMIZATION.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# Customizing @openelement/ui
|
|
2
|
+
|
|
3
|
+
This document is the package's **customization surface declaration** (alpha9
|
|
4
|
+
C3, #1506). It lists, per component, the shadow parts (`::part(...)`) and the
|
|
5
|
+
CSS custom properties the recipes consume. A test guard
|
|
6
|
+
(`__tests__/customization-surface.test.ts`) pins both lists to the code and
|
|
7
|
+
to the 1.0.0-alpha.8 baseline.
|
|
8
|
+
|
|
9
|
+
## Semver contract
|
|
10
|
+
|
|
11
|
+
- **`::part` names never shrink.** Every part shipped in 1.0.0-alpha.8 exists
|
|
12
|
+
today and must exist in every later release; adding a part is allowed.
|
|
13
|
+
- **Consumed variables are pinned at the C3 role-direct baseline.** Adding or
|
|
14
|
+
removing a `var()` reference in a recipe is a deliberate surface change: the
|
|
15
|
+
guard fails until the pin and this document are updated in the same change.
|
|
16
|
+
- Component internals carry **no utility classes** — the role variables are
|
|
17
|
+
the entire styling contract.
|
|
18
|
+
|
|
19
|
+
## Theming model
|
|
20
|
+
|
|
21
|
+
Components read the shadcn-convention role table in
|
|
22
|
+
[`src/theme.css`](./src/theme.css) directly: `--color-*` semantic roles seated
|
|
23
|
+
on the Tailwind v4 default scale. There is no intermediate alias layer — the
|
|
24
|
+
C1 alias sheet (`semantic-tokens.css`) was deleted in C3 under its own
|
|
25
|
+
DELETION CONDITION.
|
|
26
|
+
|
|
27
|
+
- **Light/dark**: the roles carry `[data-theme='dark']` pairs re-pointed at
|
|
28
|
+
this repo's theme mechanism (`:root[data-theme='dark']`,
|
|
29
|
+
`:host([data-theme='dark'])`). Components flip automatically.
|
|
30
|
+
- **Forced colors** (Windows High Contrast): the `forced-colors: active`
|
|
31
|
+
tier in `theme.css` re-seats **every** role on a system color
|
|
32
|
+
(`Canvas`, `CanvasText`, `ButtonFace`, `ButtonText`, `GrayText`,
|
|
33
|
+
`Highlight`, `LinkText`, `Mark`) in both selector blocks. Every component
|
|
34
|
+
therefore resolves fully under forced colors; hue carries no meaning there,
|
|
35
|
+
so status is also encoded by border and label, never by color alone.
|
|
36
|
+
- **Delivery**: see the [Value delivery](#value-delivery) section below.
|
|
37
|
+
|
|
38
|
+
## Value delivery
|
|
39
|
+
|
|
40
|
+
**What the ui package guarantees is the role table's SHAPE, not its values.**
|
|
41
|
+
The contract a consumer may rely on:
|
|
42
|
+
|
|
43
|
+
- the role names declared in the `@theme` block of
|
|
44
|
+
[`src/theme.css`](./src/theme.css) (the full inventory below),
|
|
45
|
+
- each role's `[data-theme='dark']` dark pair,
|
|
46
|
+
- the `forced-colors: active` tier that re-seats every role on a system color.
|
|
47
|
+
|
|
48
|
+
**The package carries no scale values of its own.** Since the alpha9 C5 twin
|
|
49
|
+
removal, `@openelement/ui` embeds no compiled value table and exports no
|
|
50
|
+
token module — the retired `@openelement/ui/theme-tokens`
|
|
51
|
+
(`themeTokenCss` / `themeTokenSheet`) is gone. Component recipes reference
|
|
52
|
+
`var(--color-*)` / `var(--spacing)` / etc.; until the host supplies those
|
|
53
|
+
variables the recipes resolve to nothing. Values have exactly two suppliers:
|
|
54
|
+
|
|
55
|
+
- **Preset ON**: a `@openelement/router` Tailwind build compiles
|
|
56
|
+
`theme.css` through the preset (`tailwind: { theme:
|
|
57
|
+
['@openelement/ui/theme.css'] }`), emitting the roles plus Tailwind's own
|
|
58
|
+
scale layer. This is the first-party delivery (the www site and the
|
|
59
|
+
router-ui-dogfood fixture).
|
|
60
|
+
- **Preset OFF**: the consumer writes its own table. The only requirement is
|
|
61
|
+
that it defines the role names (and any scale variables the recipes
|
|
62
|
+
consume, e.g. `--spacing`, `--radius-md`) under the same selectors.
|
|
63
|
+
Minimal shape, values illustrative:
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
/* OFF-state table — role names from src/theme.css are the contract;
|
|
67
|
+
the values are the consumer's own. */
|
|
68
|
+
:root,
|
|
69
|
+
:host {
|
|
70
|
+
--color-background: white;
|
|
71
|
+
--color-foreground: black;
|
|
72
|
+
--color-primary: rebeccapurple;
|
|
73
|
+
--color-primary-foreground: white;
|
|
74
|
+
/* …the remaining --color-* roles of src/theme.css… */
|
|
75
|
+
--spacing: 0.25rem;
|
|
76
|
+
--radius-md: 0.375rem;
|
|
77
|
+
}
|
|
78
|
+
:root[data-theme='dark'],
|
|
79
|
+
:host([data-theme='dark']) {
|
|
80
|
+
/* the same roles, dark-side values */
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The full role-name inventory is the `@theme` block of
|
|
85
|
+
[`src/theme.css`](./src/theme.css): `--color-background`, `--color-foreground`,
|
|
86
|
+
`--color-card(-foreground)`, `--color-popover(-foreground)`,
|
|
87
|
+
`--color-primary(-foreground)`, `--color-secondary(-foreground)`,
|
|
88
|
+
`--color-muted(-foreground)`, `--color-accent(-foreground)`,
|
|
89
|
+
`--color-destructive(-foreground)`, `--color-success`, `--color-warning`,
|
|
90
|
+
`--color-info`, `--color-border`, `--color-input`, `--color-ring`, and
|
|
91
|
+
`--color-chart-1` … `--color-chart-5`.
|
|
92
|
+
|
|
93
|
+
## alpha8 → C3 variable rename map
|
|
94
|
+
|
|
95
|
+
The retired alias names are gone. The notable re-seats (consumers renaming
|
|
96
|
+
their overrides):
|
|
97
|
+
|
|
98
|
+
| Retired (alpha8) | C3 role expression |
|
|
99
|
+
| ----------------- | --------------------------------------------------------- |
|
|
100
|
+
| `--bg-base` | `--color-background` |
|
|
101
|
+
| `--bg-card` | `--color-card` |
|
|
102
|
+
| `--bg-elevated` | `--color-popover` |
|
|
103
|
+
| `--bg-surface` | `--color-muted` |
|
|
104
|
+
| `--text-primary` | `--color-foreground` |
|
|
105
|
+
| `--text-secondary`| `--color-muted-foreground` |
|
|
106
|
+
| `--text-muted` | `--color-muted-foreground` (one ink step since C1) |
|
|
107
|
+
| `--brand` | `--color-primary` |
|
|
108
|
+
| `--on-brand` | `--color-primary-foreground` |
|
|
109
|
+
| `--border` | `--color-border` |
|
|
110
|
+
| `--error` | `--color-destructive` |
|
|
111
|
+
| `--success` | `--color-success` (new role, same AA-tuned values) |
|
|
112
|
+
| `--warning` | `--color-warning` (new role, same AA-tuned values) |
|
|
113
|
+
| `--info` | `--color-info` (new role, same AA-tuned values) |
|
|
114
|
+
| `--focus-ring` | `--color-ring` |
|
|
115
|
+
| `--bg-code` | static `--color-zinc-950` (code surfaces stay dark) |
|
|
116
|
+
| `--code-text` | static `--color-zinc-200` |
|
|
117
|
+
| `--code-border` | static `--color-zinc-700` |
|
|
118
|
+
| `--size-N` | `calc(var(--spacing) * N)` |
|
|
119
|
+
| `--radius-1/2/3` | `--radius-md` / `--radius-lg` / `--radius-xl` |
|
|
120
|
+
| `--radius-round` | `calc(infinity * 1px)` |
|
|
121
|
+
| `--font-size-0..3`| `--text-sm` / `--text-base` / `--text-xl` / `--text-2xl` |
|
|
122
|
+
| `--font-weight-N` | `--font-weight-medium` … `--font-weight-black` |
|
|
123
|
+
| `--motion-fast`, `--duration-2` | `--default-transition-duration` (150ms) |
|
|
124
|
+
| `--ease-3`, `--motion-standard` | `--ease-out` |
|
|
125
|
+
| `--ease-2` | `--ease-in-out` |
|
|
126
|
+
|
|
127
|
+
Deliberate pixel breaks to note (this is C3's contract, not a migration):
|
|
128
|
+
|
|
129
|
+
- `--brand-deep` (static violet-950) became a 50/50 primary/foreground mix —
|
|
130
|
+
the default-button hover ink now tracks the theme's ink side.
|
|
131
|
+
- `--violet-0/1/2/5/8/10` re-seat on flipping roles
|
|
132
|
+
(primary-foreground/secondary/border/ring/primary/secondary-foreground), so
|
|
133
|
+
coordinated surfaces (e.g. the site's flood panels) invert together with
|
|
134
|
+
the theme instead of mirroring a fixed ramp.
|
|
135
|
+
- Badge/callout washes are computed inline (`color-mix(... 10%, transparent)`)
|
|
136
|
+
from each status role; the light-theme rgba tint overrides are gone.
|
|
137
|
+
- Card `artifact`, code-block and dialog backdrop keep static zinc surfaces
|
|
138
|
+
in both themes (the retired sheet's behavior, now explicit literals-free
|
|
139
|
+
ramp references).
|
|
140
|
+
|
|
141
|
+
## Per-component surface
|
|
142
|
+
|
|
143
|
+
Variables listed are the ones each component's recipe **consumes**; all of
|
|
144
|
+
them resolve from the role table above. There are no component-defined
|
|
145
|
+
custom properties.
|
|
146
|
+
|
|
147
|
+
### `open-badge`
|
|
148
|
+
|
|
149
|
+
- Parts: `badge`
|
|
150
|
+
- Variables: `--color-border`, `--color-info`, `--color-muted`,
|
|
151
|
+
`--color-muted-foreground`, `--color-primary`, `--color-success`,
|
|
152
|
+
`--color-warning`, `--font-mono`, `--font-weight-extrabold`,
|
|
153
|
+
`--leading-normal`, `--radius-md`, `--spacing`, `--text-xs`
|
|
154
|
+
- Tones `brand/success/warning/info` paint their 10% wash with `color-mix`
|
|
155
|
+
off the matching role; AA is asserted against base and wash in the suite.
|
|
156
|
+
|
|
157
|
+
### `open-button`
|
|
158
|
+
|
|
159
|
+
- Parts: `control`
|
|
160
|
+
- Variables: `--color-border`, `--color-foreground`, `--color-popover`,
|
|
161
|
+
`--color-primary`, `--color-primary-foreground`, `--color-ring`,
|
|
162
|
+
`--color-violet-400`, `--color-white`, `--default-transition-duration`,
|
|
163
|
+
`--ease-out`, `--font-sans`, `--font-weight-extrabold`, `--radius-md`,
|
|
164
|
+
`--shadow-sm`, `--spacing`, `--text-base`, `--text-sm`, `--text-xl`
|
|
165
|
+
- Shares the control recipe (below). Variant `primary`/`accent` fill with
|
|
166
|
+
`--color-primary` over `--color-primary-foreground`.
|
|
167
|
+
|
|
168
|
+
### `open-callout`
|
|
169
|
+
|
|
170
|
+
- Parts: `container`, `icon`, `content`
|
|
171
|
+
- Variables: `--color-destructive`, `--color-foreground`,
|
|
172
|
+
`--color-muted-foreground`, `--color-primary`, `--color-success`,
|
|
173
|
+
`--color-warning`, `--font-weight-semibold`, `--leading-relaxed`,
|
|
174
|
+
`--radius-lg`, `--spacing`, `--text-base`, `--text-sm`
|
|
175
|
+
- Types `info/warning/danger/tip` map to primary/warning/destructive/success
|
|
176
|
+
inks with 10% washes; the alpha8 light-theme rgba overrides are gone (the
|
|
177
|
+
roles' dark pairs carry the flip).
|
|
178
|
+
|
|
179
|
+
### `open-card`
|
|
180
|
+
|
|
181
|
+
- Parts: `container`, `body`
|
|
182
|
+
- Variables: `--color-border`, `--color-card`, `--color-foreground`,
|
|
183
|
+
`--color-muted`, `--color-muted-foreground`, `--color-primary`,
|
|
184
|
+
`--color-secondary`, `--color-zinc-200`, `--color-zinc-700`,
|
|
185
|
+
`--color-zinc-950`, `--default-transition-duration`, `--ease-out`,
|
|
186
|
+
`--font-weight-semibold`, `--radius-md`, `--spacing`, `--text-sm`,
|
|
187
|
+
`--text-xl`
|
|
188
|
+
- Variant `artifact` paints a static zinc-950 panel in both themes.
|
|
189
|
+
|
|
190
|
+
### `open-code-block`
|
|
191
|
+
|
|
192
|
+
- Parts: `copy`
|
|
193
|
+
- Variables: `--color-destructive`, `--color-primary`, `--color-zinc-200`,
|
|
194
|
+
`--color-zinc-700`, `--color-zinc-950`, `--default-transition-duration`,
|
|
195
|
+
`--ease-in-out`, `--font-mono`, `--font-sans`, `--font-weight-bold`,
|
|
196
|
+
`--font-weight-semibold`, `--leading-relaxed`, `--radius-lg`,
|
|
197
|
+
`--radius-md`, `--spacing`, `--text-sm`, `--text-xs`, `--tracking-wider`,
|
|
198
|
+
`--tracking-widest`
|
|
199
|
+
- The Prism token palette is static (GitHub-dark-derived hexes measured on
|
|
200
|
+
the static zinc surface); it is deliberately not token-driven.
|
|
201
|
+
|
|
202
|
+
### `open-dialog`
|
|
203
|
+
|
|
204
|
+
- Parts: `overlay`, `header`, `close`, `body`, `footer`
|
|
205
|
+
- Variables: `--color-border`, `--color-foreground`,
|
|
206
|
+
`--color-muted-foreground`, `--color-popover`, `--color-primary`,
|
|
207
|
+
`--color-white`, `--color-zinc-950`, `--font-sans`,
|
|
208
|
+
`--font-weight-semibold`, `--leading-normal`, `--leading-tight`,
|
|
209
|
+
`--radius-md`, `--radius-xl`, `--shadow-2xl`, `--spacing`, `--text-base`,
|
|
210
|
+
`--text-xl`
|
|
211
|
+
- Shares the overlay recipe (below); the backdrop composes the zinc-950
|
|
212
|
+
scrim in both themes.
|
|
213
|
+
- Entry and exit animate through `transition-behavior: allow-discrete` +
|
|
214
|
+
`@starting-style` (no keyframes, no JS timing); under
|
|
215
|
+
`forced-colors: active` and `prefers-reduced-motion: reduce` the
|
|
216
|
+
transitions collapse and the dialog opens/closes immediately.
|
|
217
|
+
|
|
218
|
+
### `open-dropdown`
|
|
219
|
+
|
|
220
|
+
- Parts: `trigger`, `content`
|
|
221
|
+
- Variables: `--font-sans`, `--spacing`
|
|
222
|
+
- Shares the overlay recipe for the popover surface.
|
|
223
|
+
|
|
224
|
+
### `open-input`
|
|
225
|
+
|
|
226
|
+
- Parts: `wrapper`, `label`, `control`, `error`
|
|
227
|
+
- Variables: `--color-border`, `--color-destructive`, `--color-foreground`,
|
|
228
|
+
`--color-muted`, `--color-muted-foreground`, `--color-popover`,
|
|
229
|
+
`--color-primary`, `--color-violet-400`, `--font-sans`,
|
|
230
|
+
`--font-weight-medium`, `--radius-md`, `--spacing`, `--text-base`,
|
|
231
|
+
`--text-sm`, `--text-xs`, `--tracking-normal`
|
|
232
|
+
- Shares the control recipe; error/invalid states use
|
|
233
|
+
`--color-destructive`.
|
|
234
|
+
|
|
235
|
+
### `open-tabs`
|
|
236
|
+
|
|
237
|
+
- Parts: none (light-DOM decoration pattern; the tabs/panels stay in the
|
|
238
|
+
page's DOM, styled through inherited roles)
|
|
239
|
+
- Variables: `--color-border`, `--color-foreground`,
|
|
240
|
+
`--color-muted-foreground`, `--color-primary`, `--spacing`
|
|
241
|
+
|
|
242
|
+
### `open-theme-toggle`
|
|
243
|
+
|
|
244
|
+
- Parts: `toggle`, `icon-sun`, `icon-moon`
|
|
245
|
+
- Variables: `--color-background`, `--color-border`, `--color-foreground`,
|
|
246
|
+
`--color-muted-foreground`, `--color-popover`, `--color-primary`,
|
|
247
|
+
`--color-ring`, `--color-violet-400`, `--default-transition-duration`,
|
|
248
|
+
`--ease-in-out`, `--spacing`
|
|
249
|
+
|
|
250
|
+
### Shared recipes (`component-recipes.ts`)
|
|
251
|
+
|
|
252
|
+
- `controlRecipe` (`.control`): `--color-border`, `--color-foreground`,
|
|
253
|
+
`--color-popover`, `--color-primary`, `--color-ring`, `--color-violet-400`,
|
|
254
|
+
`--color-white`, `--default-transition-duration`, `--ease-out`,
|
|
255
|
+
`--radius-md`, `--spacing`
|
|
256
|
+
- `surfaceRecipe` (`.surface`) adds: `--color-card`, `--radius-lg`,
|
|
257
|
+
`--shadow-2xl`
|
|
258
|
+
- `overlayRecipe` (`.overlay`) adds: `--radius-xl`
|
|
259
|
+
|
|
260
|
+
## Deep customization
|
|
261
|
+
|
|
262
|
+
`::part()` reaches every interactive element. Beyond parts, recolor by
|
|
263
|
+
overriding the **roles** on `:root` (light), `:root[data-theme='dark']`
|
|
264
|
+
(dark), or inside the `forced-colors` media query — never by redefining
|
|
265
|
+
component internals. Example:
|
|
266
|
+
|
|
267
|
+
```css
|
|
268
|
+
:root {
|
|
269
|
+
--color-primary: oklch(54.1% 0.281 293.009); /* re-brand every component */
|
|
270
|
+
}
|
|
271
|
+
```
|
package/README.md
CHANGED
|
@@ -19,7 +19,8 @@ separate application-framework promise.
|
|
|
19
19
|
|
|
20
20
|
There is **no Linear compatibility layer**: the `open-*-linear` components and
|
|
21
21
|
the `linear-token-sheet` token sheet are not part of the public surface. Use the
|
|
22
|
-
canonical
|
|
22
|
+
canonical components and the `@theme` role table in
|
|
23
|
+
[`src/theme.css`](./src/theme.css) instead.
|
|
23
24
|
|
|
24
25
|
## Install
|
|
25
26
|
|
|
@@ -47,10 +48,9 @@ npm install @openelement/ui
|
|
|
47
48
|
Dependencies flow in one direction:
|
|
48
49
|
|
|
49
50
|
```text
|
|
50
|
-
|
|
51
|
-
->
|
|
52
|
-
->
|
|
53
|
-
-> Web Component primitives
|
|
51
|
+
@theme-derived token table (theme.css)
|
|
52
|
+
-> component recipes (role names, direct)
|
|
53
|
+
-> Web Component primitives
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
Tokens contain shared style values and classes and import no components.
|
|
@@ -85,35 +85,38 @@ The reference site wires the same scripts through its Vite `inject` option.
|
|
|
85
85
|
|
|
86
86
|
## Design tokens
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
88
|
+
The token layer is hand-maintained — there is no generator. One authored CSS
|
|
89
|
+
source, no shipped values:
|
|
90
|
+
|
|
91
|
+
- `src/theme.css` — **the single source of design roles** (P6: the only place
|
|
92
|
+
in the repository that defines them). shadcn-convention roles
|
|
93
|
+
(`--color-background`, `--color-primary`, …) seated on the Tailwind v4
|
|
94
|
+
default scale; roles reference only scale variables, dark pairs follow the
|
|
95
|
+
shadcn v4 convention with the selector re-pointed at this repo's
|
|
96
|
+
`[data-theme='dark']` mechanism, and a forced-colors layer re-seats every
|
|
97
|
+
role on a system color. Since alpha9 C2 the scale layer is the real
|
|
98
|
+
`@theme` block; role names are the migration contract. Since C3 (#1506) the
|
|
99
|
+
component recipes read these role names directly — the C1 alias layer
|
|
100
|
+
(`semantic-tokens.css`) was deleted under its own DELETION CONDITION, and
|
|
101
|
+
three non-shadcn status roles (`--color-success/-warning/-info`) joined the
|
|
102
|
+
table with the same forced-colors and dark-pair discipline.
|
|
103
|
+
|
|
104
|
+
**The package ships no token values.** The compiled `theme-tokens` twin
|
|
105
|
+
(`themeTokenCss` / `themeTokenSheet`) was deleted in alpha9 C5 — the role
|
|
106
|
+
names, dark pairs and forced-colors tier are the contract; the values come
|
|
107
|
+
from the `@openelement/router` Tailwind preset (ON) or a table the consumer
|
|
108
|
+
writes itself (OFF). See [CUSTOMIZATION.md](./CUSTOMIZATION.md),
|
|
109
|
+
"Value delivery".
|
|
110
|
+
|
|
111
|
+
The ui suite fails closed on the role contract (dark
|
|
112
|
+
pairs, forced-colors totality), on recipes consuming undeclared variables,
|
|
113
|
+
and on WCAG floors (3:1 focus ring, 4.5:1 status inks on the background and
|
|
114
|
+
their 10% recipe washes). `daisyClassSheet`, modal and step-card are retired
|
|
115
|
+
and must not reappear in exports, manifests, docs or packed artifacts.
|
|
116
|
+
|
|
117
|
+
The per-component customization surface (`::part` names, consumed variables,
|
|
118
|
+
the alpha8 alias→role rename map) is declared in
|
|
119
|
+
[CUSTOMIZATION.md](./CUSTOMIZATION.md) and pinned by test.
|
|
117
120
|
|
|
118
121
|
Existing per-component imports remain stable across this layering change.
|
|
119
122
|
|
|
@@ -158,15 +161,11 @@ manifest; the per-component JSDoc is the source of truth for those.
|
|
|
158
161
|
@openelement/ui/open-callout
|
|
159
162
|
@openelement/ui/open-dropdown
|
|
160
163
|
@openelement/ui/open-tabs
|
|
161
|
-
@openelement/ui/
|
|
162
|
-
@openelement/ui/open-props-tokens.js (legacy alias of the previous entry)
|
|
164
|
+
@openelement/ui/theme.css (the @theme role source; compiled through the router preset)
|
|
163
165
|
@openelement/ui/instance-state (per-element instance state store; tree-shakeable leaf)
|
|
164
166
|
@openelement/ui/manifest (generated WC package manifest; node-safe leaf)
|
|
165
167
|
```
|
|
166
168
|
|
|
167
|
-
The last entry is a compatibility alias kept for import maps written against the
|
|
168
|
-
`.js` form; new code uses `@openelement/ui/open-props-tokens`.
|
|
169
|
-
|
|
170
169
|
## License
|
|
171
170
|
|
|
172
171
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openelement/ui",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -70,15 +70,8 @@
|
|
|
70
70
|
"import": "./src/instance-state.js",
|
|
71
71
|
"default": "./src/instance-state.js"
|
|
72
72
|
},
|
|
73
|
-
"./
|
|
74
|
-
"
|
|
75
|
-
"import": "./src/open-props-tokens.js",
|
|
76
|
-
"default": "./src/open-props-tokens.js"
|
|
77
|
-
},
|
|
78
|
-
"./open-props-tokens.js": {
|
|
79
|
-
"types": "./src/open-props-tokens.d.ts",
|
|
80
|
-
"import": "./src/open-props-tokens.js",
|
|
81
|
-
"default": "./src/open-props-tokens.js"
|
|
73
|
+
"./theme.css": {
|
|
74
|
+
"default": "./src/theme.css"
|
|
82
75
|
}
|
|
83
76
|
},
|
|
84
77
|
"repository": {
|
|
@@ -94,7 +87,6 @@
|
|
|
94
87
|
"web-components",
|
|
95
88
|
"ui",
|
|
96
89
|
"design-tokens",
|
|
97
|
-
"open-props",
|
|
98
90
|
"experimental"
|
|
99
91
|
],
|
|
100
92
|
"engines": {
|
|
@@ -103,6 +95,6 @@
|
|
|
103
95
|
"sideEffects": false,
|
|
104
96
|
"peerDependenciesMeta": {},
|
|
105
97
|
"dependencies": {
|
|
106
|
-
"@openelement/element": "1.0.0-alpha.
|
|
98
|
+
"@openelement/element": "1.0.0-alpha.9"
|
|
107
99
|
}
|
|
108
100
|
}
|
package/src/component-recipes.js
CHANGED
|
@@ -70,39 +70,39 @@ const CALLOUT_TYPE_ICONS = {
|
|
|
70
70
|
const controlRecipe = recipe(`
|
|
71
71
|
.control {
|
|
72
72
|
font: inherit;
|
|
73
|
-
color: var(--
|
|
74
|
-
background: var(--
|
|
75
|
-
border: var(--
|
|
76
|
-
border-radius: var(--
|
|
77
|
-
box-shadow: var(--
|
|
78
|
-
transition: border-color var(--
|
|
79
|
-
background var(--
|
|
80
|
-
box-shadow var(--
|
|
81
|
-
transform var(--
|
|
73
|
+
color: var(--color-foreground);
|
|
74
|
+
background: color-mix(in srgb, var(--color-popover) 78%, transparent);
|
|
75
|
+
border: calc(var(--spacing) * 0.25) solid color-mix(in srgb, var(--color-border) 72%, var(--color-primary));
|
|
76
|
+
border-radius: var(--radius-md);
|
|
77
|
+
box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-white) 12%, transparent);
|
|
78
|
+
transition: border-color var(--default-transition-duration) var(--ease-out),
|
|
79
|
+
background var(--default-transition-duration) var(--ease-out),
|
|
80
|
+
box-shadow var(--default-transition-duration) var(--ease-out),
|
|
81
|
+
transform var(--default-transition-duration) var(--ease-out);
|
|
82
82
|
}
|
|
83
|
-
.control:hover { border-color: var(--
|
|
83
|
+
.control:hover { border-color: color-mix(in srgb, var(--color-violet-400) 74%, var(--color-border)); }
|
|
84
84
|
.control:focus-visible {
|
|
85
|
-
outline: var(--
|
|
86
|
-
outline-offset: var(--
|
|
85
|
+
outline: calc(var(--spacing) * 0.5) solid var(--color-ring);
|
|
86
|
+
outline-offset: calc(var(--spacing) * 0.75);
|
|
87
87
|
}
|
|
88
88
|
.control:disabled, .control[aria-disabled="true"] { opacity: .48; cursor: not-allowed; }
|
|
89
89
|
`);
|
|
90
90
|
const surfaceRecipe = recipe(`
|
|
91
91
|
.surface {
|
|
92
|
-
color: var(--
|
|
93
|
-
background: var(--
|
|
94
|
-
border: var(--
|
|
95
|
-
border-radius: var(--
|
|
96
|
-
box-shadow: var(--
|
|
92
|
+
color: var(--color-foreground);
|
|
93
|
+
background: linear-gradient(145deg, color-mix(in srgb, var(--color-primary) 9%, var(--color-card)), color-mix(in srgb, var(--color-card) 90%, transparent));
|
|
94
|
+
border: calc(var(--spacing) * 0.25) solid color-mix(in srgb, var(--color-border) 78%, var(--color-primary));
|
|
95
|
+
border-radius: var(--radius-lg);
|
|
96
|
+
box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-white) 8%, transparent), var(--shadow-2xl);
|
|
97
97
|
}
|
|
98
98
|
`);
|
|
99
99
|
const overlayRecipe = recipe(`
|
|
100
100
|
.overlay {
|
|
101
|
-
color: var(--
|
|
102
|
-
background: var(--
|
|
103
|
-
border: var(--
|
|
104
|
-
border-radius: var(--
|
|
105
|
-
box-shadow: var(--
|
|
101
|
+
color: var(--color-foreground);
|
|
102
|
+
background: color-mix(in srgb, var(--color-popover) 92%, transparent);
|
|
103
|
+
border: calc(var(--spacing) * 0.25) solid color-mix(in srgb, color-mix(in srgb, var(--color-foreground) 25%, var(--color-border)) 62%, var(--color-primary));
|
|
104
|
+
border-radius: var(--radius-xl);
|
|
105
|
+
box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-white) 8%, transparent), var(--shadow-2xl);
|
|
106
106
|
}
|
|
107
107
|
`);
|
|
108
108
|
//#endregion
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"$comment": "GENERATED FILE - do not edit. Regenerate with: pnpm --filter @openelement/ui run generate:ui-manifest (drift gate: ui-manifest:check).",
|
|
3
3
|
"schemaVersion": "1.0.0",
|
|
4
4
|
"packageName": "@openelement/ui",
|
|
5
|
-
"version": "1.0.0-alpha.
|
|
6
|
-
"description": "
|
|
5
|
+
"version": "1.0.0-alpha.9",
|
|
6
|
+
"description": "Semantic Web Component library for openElement",
|
|
7
7
|
"author": "openElement",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"homepage": "https://openelement.org",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"tagName": "open-card",
|
|
14
14
|
"className": "OpenCard",
|
|
15
15
|
"superclassName": "OpenElement",
|
|
16
|
-
"description": "
|
|
16
|
+
"description": "Card container with optional `header`/`footer` slots and a themed body",
|
|
17
17
|
"attributes": [
|
|
18
18
|
{
|
|
19
19
|
"name": "variant",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"tagName": "open-button",
|
|
107
107
|
"className": "OpenButton",
|
|
108
108
|
"superclassName": "OpenElement",
|
|
109
|
-
"description": "
|
|
109
|
+
"description": "Button or link control: an `href` property switches the compiled anchor",
|
|
110
110
|
"attributes": [
|
|
111
111
|
{
|
|
112
112
|
"name": "variant",
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
"tagName": "open-input",
|
|
174
174
|
"className": "OpenInput",
|
|
175
175
|
"superclassName": "OpenElement",
|
|
176
|
-
"description": "
|
|
176
|
+
"description": "Form-associated text input with a label, an inline error slot, and native",
|
|
177
177
|
"attributes": [
|
|
178
178
|
{
|
|
179
179
|
"name": "type",
|
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
"tagName": "open-theme-toggle",
|
|
273
273
|
"className": "OpenThemeToggle",
|
|
274
274
|
"superclassName": "OpenElement",
|
|
275
|
-
"description": "Theme toggle
|
|
275
|
+
"description": "Theme toggle button for dark/light mode: reads and flips the document's",
|
|
276
276
|
"attributes": [
|
|
277
277
|
{
|
|
278
278
|
"name": "theme",
|
|
@@ -342,7 +342,7 @@
|
|
|
342
342
|
"tagName": "open-badge",
|
|
343
343
|
"className": "OpenBadge",
|
|
344
344
|
"superclassName": "OpenElement",
|
|
345
|
-
"description": "Compact status badge
|
|
345
|
+
"description": "Compact status badge themed by the shadcn role table (C3 #1506).",
|
|
346
346
|
"attributes": [
|
|
347
347
|
{
|
|
348
348
|
"name": "tone",
|
package/src/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { openPropsTokenSheet } from "./open-props-tokens.js";
|
|
2
1
|
import { readInstanceState, writeInstanceState } from "./instance-state.js";
|
|
3
2
|
import { OpenButton } from "./open-button.js";
|
|
4
3
|
import { OpenCard } from "./open-card.js";
|
|
@@ -12,4 +11,4 @@ import { OpenDropdown } from "./open-dropdown.js";
|
|
|
12
11
|
import { OpenTabs } from "./open-tabs.js";
|
|
13
12
|
import { manifest } from "./manifest.js";
|
|
14
13
|
import { registerOpenUi } from "./register.js";
|
|
15
|
-
export { OpenBadge, OpenButton, OpenCallout, OpenCard, OpenCodeBlock, OpenDialog, OpenDropdown, OpenInput, OpenTabs, OpenThemeToggle, manifest,
|
|
14
|
+
export { OpenBadge, OpenButton, OpenCallout, OpenCard, OpenCodeBlock, OpenDialog, OpenDropdown, OpenInput, OpenTabs, OpenThemeToggle, manifest, readInstanceState, registerOpenUi, writeInstanceState };
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { openPropsTokenSheet } from "./open-props-tokens.js";
|
|
2
1
|
import { readInstanceState, writeInstanceState } from "./instance-state.js";
|
|
3
2
|
import { OpenButton } from "./open-button.js";
|
|
4
3
|
import { OpenCard } from "./open-card.js";
|
|
@@ -12,4 +11,4 @@ import { OpenDropdown } from "./open-dropdown.js";
|
|
|
12
11
|
import { OpenTabs } from "./open-tabs.js";
|
|
13
12
|
import { manifest } from "./manifest.js";
|
|
14
13
|
import { registerOpenUi } from "./register.js";
|
|
15
|
-
export { OpenBadge, OpenButton, OpenCallout, OpenCard, OpenCodeBlock, OpenDialog, OpenDropdown, OpenInput, OpenTabs, OpenThemeToggle, manifest,
|
|
14
|
+
export { OpenBadge, OpenButton, OpenCallout, OpenCard, OpenCodeBlock, OpenDialog, OpenDropdown, OpenInput, OpenTabs, OpenThemeToggle, manifest, readInstanceState, registerOpenUi, writeInstanceState };
|
package/src/open-badge.js
CHANGED
|
@@ -189,47 +189,47 @@ var OpenBadge = class extends OpenElement {
|
|
|
189
189
|
display: inline-flex;
|
|
190
190
|
align-items: center;
|
|
191
191
|
justify-content: center;
|
|
192
|
-
min-height: var(--
|
|
193
|
-
padding: var(--
|
|
194
|
-
border: var(--
|
|
195
|
-
border-radius: var(--
|
|
196
|
-
background: var(--
|
|
197
|
-
color: var(--
|
|
192
|
+
min-height: calc(var(--spacing) * 6);
|
|
193
|
+
padding: calc(var(--spacing) * 0.5) calc(var(--spacing) * 2);
|
|
194
|
+
border: calc(var(--spacing) * 0.25) solid var(--color-border);
|
|
195
|
+
border-radius: var(--radius-md);
|
|
196
|
+
background: var(--color-muted);
|
|
197
|
+
color: var(--color-muted-foreground);
|
|
198
198
|
font-family: var(--font-mono);
|
|
199
|
-
font-size: var(--
|
|
200
|
-
font-weight: var(--font-weight-
|
|
201
|
-
line-height: var(--
|
|
199
|
+
font-size: var(--text-xs);
|
|
200
|
+
font-weight: var(--font-weight-extrabold);
|
|
201
|
+
line-height: var(--leading-normal);
|
|
202
202
|
letter-spacing: 0;
|
|
203
203
|
white-space: nowrap;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
:host([tone='brand']) .badge {
|
|
207
|
-
border-color: var(--
|
|
208
|
-
background: var(--
|
|
209
|
-
color: var(--
|
|
207
|
+
border-color: var(--color-primary);
|
|
208
|
+
background: color-mix(in srgb, var(--color-primary) 14%, transparent);
|
|
209
|
+
color: var(--color-primary);
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
:host([tone='success']) .badge {
|
|
213
|
-
border-color: var(--success);
|
|
214
|
-
background: var(--success
|
|
215
|
-
color: var(--success);
|
|
213
|
+
border-color: var(--color-success);
|
|
214
|
+
background: color-mix(in srgb, var(--color-success) 10%, transparent);
|
|
215
|
+
color: var(--color-success);
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
:host([tone='warning']) .badge {
|
|
219
|
-
border-color: var(--warning);
|
|
220
|
-
background: var(--warning
|
|
221
|
-
color: var(--warning);
|
|
219
|
+
border-color: var(--color-warning);
|
|
220
|
+
background: color-mix(in srgb, var(--color-warning) 10%, transparent);
|
|
221
|
+
color: var(--color-warning);
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
:host([tone='info']) .badge {
|
|
225
|
-
border-color: var(--info);
|
|
226
|
-
background: var(--info
|
|
227
|
-
color: var(--info);
|
|
225
|
+
border-color: var(--color-info);
|
|
226
|
+
background: color-mix(in srgb, var(--color-info) 10%, transparent);
|
|
227
|
+
color: var(--color-info);
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
:host([size='sm']) .badge {
|
|
231
|
-
min-height: var(--
|
|
232
|
-
padding-inline: var(--
|
|
231
|
+
min-height: calc(var(--spacing) * 5);
|
|
232
|
+
padding-inline: calc(var(--spacing) * 2);
|
|
233
233
|
}
|
|
234
234
|
`)];
|
|
235
235
|
tone = "neutral";
|