@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/src/open-tabs.js
CHANGED
|
@@ -221,32 +221,32 @@ var OpenTabs = class extends OpenElement {
|
|
|
221
221
|
|
|
222
222
|
.tabs {
|
|
223
223
|
display: flex;
|
|
224
|
-
gap: var(--
|
|
225
|
-
padding: var(--
|
|
226
|
-
border-bottom: 1px solid var(--
|
|
224
|
+
gap: calc(var(--spacing) * 1);
|
|
225
|
+
padding: calc(var(--spacing) * 1);
|
|
226
|
+
border-bottom: 1px solid color-mix(in srgb, var(--color-border) 78%, var(--color-primary));
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
::slotted([slot='tab']) {
|
|
230
|
-
padding: var(--
|
|
230
|
+
padding: calc(var(--spacing) * 2) calc(var(--spacing) * 4);
|
|
231
231
|
border-color: transparent;
|
|
232
232
|
background: transparent;
|
|
233
|
-
color: var(--
|
|
233
|
+
color: var(--color-muted-foreground);
|
|
234
234
|
cursor: pointer;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
::slotted([slot='tab']:hover) {
|
|
238
|
-
color: var(--
|
|
238
|
+
color: var(--color-foreground);
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
::slotted(.tab-active) {
|
|
242
|
-
color: var(--
|
|
243
|
-
background: var(--
|
|
244
|
-
border-color: var(--
|
|
242
|
+
color: var(--color-foreground);
|
|
243
|
+
background: color-mix(in srgb, var(--color-primary) 14%, transparent);
|
|
244
|
+
border-color: color-mix(in srgb, color-mix(in srgb, var(--color-foreground) 25%, var(--color-border)) 62%, var(--color-primary));
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
::slotted([slot='panel']) {
|
|
248
|
-
padding-block: var(--
|
|
249
|
-
color: var(--
|
|
248
|
+
padding-block: calc(var(--spacing) * 4);
|
|
249
|
+
color: var(--color-muted-foreground);
|
|
250
250
|
}
|
|
251
251
|
`)];
|
|
252
252
|
active = 0;
|
package/src/open-theme-toggle.js
CHANGED
|
@@ -439,23 +439,23 @@ var OpenThemeToggle = class extends OpenElement {
|
|
|
439
439
|
align-items: center;
|
|
440
440
|
justify-content: center;
|
|
441
441
|
width: 38px; height: 38px; padding: 0;
|
|
442
|
-
border: var(--
|
|
443
|
-
border-radius:
|
|
444
|
-
background: color-mix(in srgb, var(--
|
|
445
|
-
color: var(--
|
|
446
|
-
box-shadow: inset 0 1px 0 color-mix(in srgb, var(--
|
|
442
|
+
border: calc(var(--spacing) * 0.25) solid color-mix(in srgb, var(--color-border) 72%, var(--color-primary));
|
|
443
|
+
border-radius: calc(infinity * 1px);
|
|
444
|
+
background: color-mix(in srgb, var(--color-popover) 76%, transparent);
|
|
445
|
+
color: var(--color-muted-foreground);
|
|
446
|
+
box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-background) 70%, transparent);
|
|
447
447
|
cursor: pointer;
|
|
448
|
-
transition: all var(--ease-
|
|
448
|
+
transition: all var(--ease-in-out) var(--default-transition-duration);
|
|
449
449
|
}
|
|
450
450
|
.theme-toggle:hover {
|
|
451
|
-
color: var(--
|
|
452
|
-
border-color: var(--
|
|
453
|
-
background: color-mix(in srgb, var(--
|
|
451
|
+
color: var(--color-foreground);
|
|
452
|
+
border-color: var(--color-violet-400);
|
|
453
|
+
background: color-mix(in srgb, color-mix(in srgb, var(--color-primary) 16%, transparent) 42%, var(--color-popover));
|
|
454
454
|
}
|
|
455
455
|
|
|
456
456
|
.theme-toggle:focus-visible {
|
|
457
|
-
outline: var(--
|
|
458
|
-
outline-offset: var(--
|
|
457
|
+
outline: calc(var(--spacing) * 0.5) solid var(--color-ring);
|
|
458
|
+
outline-offset: calc(var(--spacing) * 0.75);
|
|
459
459
|
}
|
|
460
460
|
|
|
461
461
|
.theme-toggle svg {
|
package/src/theme.css
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════════════
|
|
2
|
+
The real @theme role source — shadcn semantic roles on the Tailwind
|
|
3
|
+
default scale (#1504 draft, #1505 C2 handoff executed).
|
|
4
|
+
|
|
5
|
+
C2 handoff (executed): with Tailwind 4.x installed (4.3.3, @tailwindcss/
|
|
6
|
+
vite — the v3-lts line is forbidden), this file's hand-carried scale
|
|
7
|
+
layer is replaced by the real @theme mechanism: the Tailwind build's own
|
|
8
|
+
theme layer provides every scale variable (--spacing, the color ramps,
|
|
9
|
+
the type/motion scales) from the INSTALLED tailwindcss theme.css, and the
|
|
10
|
+
role declarations below moved into the @theme block verbatim. Role names
|
|
11
|
+
are the migration contract, not this file's selector shape.
|
|
12
|
+
|
|
13
|
+
Version note (4.3.3 vs the v4.1.16 text the retired hand-carried scale
|
|
14
|
+
layer was evaluated against): the installed 4.3.3 defaults prevail per
|
|
15
|
+
the C2 handoff. Differences touching this package's vocabulary:
|
|
16
|
+
- --color-zinc-50: oklch(98.5% 0 0) → oklch(98.5% 0 none) (achromatic
|
|
17
|
+
ramps spell the hue component `none`; visually identical at chroma 0).
|
|
18
|
+
- --font-sans: the default system stack grew (-apple-system,
|
|
19
|
+
BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans',
|
|
20
|
+
Arial now precede sans-serif).
|
|
21
|
+
No carried ramp step other than zinc-50 changed value between the two
|
|
22
|
+
versions. With the alpha9 C5 twin removal this file has no compiled
|
|
23
|
+
shadow form: the installed Tailwind defaults are the only scale
|
|
24
|
+
evaluation, reached exclusively through the preset's build.
|
|
25
|
+
|
|
26
|
+
Rules the roles obey (umbrella rulings, do not relitigate):
|
|
27
|
+
|
|
28
|
+
- Role values are expressed with Tailwind default theme variables
|
|
29
|
+
(var(--color-<ramp>-<step>)); no role carries a color literal.
|
|
30
|
+
- Dark pairs follow the shadcn v4 convention; the '.dark' selector is
|
|
31
|
+
re-pointed at this repo's theme mechanism
|
|
32
|
+
(:root[data-theme='dark'], :host([data-theme='dark'])) — the preset's
|
|
33
|
+
Tailwind build compiles no @custom-variant here yet.
|
|
34
|
+
- One deliberate divergence from the shadcn default palette: light
|
|
35
|
+
--color-destructive sits on red-700, not red-600 — red-600 clears 4.5:1
|
|
36
|
+
on the background but drops to ~3.8:1 on the 10% badge wash of itself
|
|
37
|
+
that open-badge paints; red-700 clears both (measured in the ui suite).
|
|
38
|
+
- Three non-shadcn status roles (--color-success/-warning/-info) joined
|
|
39
|
+
the table in C3 (#1506): the components' status tones need theme-aware
|
|
40
|
+
inks and the alias layer that used to carry them is deleted. Their light
|
|
41
|
+
steps are the AA-tuned ones the alias layer measured (same floor rule as
|
|
42
|
+
destructive above); forced-colors re-seats them on CanvasText like
|
|
43
|
+
destructive — high-contrast palettes own hue, so status is carried by
|
|
44
|
+
the label and the border, not by color.
|
|
45
|
+
|
|
46
|
+
Consumption: the @openelement/router tailwind preset compiles this file
|
|
47
|
+
into the bundle's theme layer (`tailwind: { theme: [...] }`). The ui
|
|
48
|
+
package emits no values itself (the theme-tokens twin is deleted): a
|
|
49
|
+
consumer without the preset writes its own table using these role names
|
|
50
|
+
— the OFF contract in CUSTOMIZATION.md ("Value delivery").
|
|
51
|
+
═══════════════════════════════════════════════════════════════════════ */
|
|
52
|
+
|
|
53
|
+
@theme {
|
|
54
|
+
/* ── shadcn semantic roles (light), over the TW4 default scale.
|
|
55
|
+
Violet-anchored roles (the brand reads violet); neutral surfaces stay
|
|
56
|
+
zinc so the page base keeps its near-neutral paper feel. ── */
|
|
57
|
+
|
|
58
|
+
--color-background: var(--color-white);
|
|
59
|
+
--color-foreground: var(--color-zinc-950);
|
|
60
|
+
|
|
61
|
+
--color-card: var(--color-white);
|
|
62
|
+
--color-card-foreground: var(--color-zinc-950);
|
|
63
|
+
|
|
64
|
+
--color-popover: var(--color-white);
|
|
65
|
+
--color-popover-foreground: var(--color-zinc-950);
|
|
66
|
+
|
|
67
|
+
--color-primary: var(--color-violet-700);
|
|
68
|
+
--color-primary-foreground: var(--color-violet-50);
|
|
69
|
+
|
|
70
|
+
--color-secondary: var(--color-violet-100);
|
|
71
|
+
--color-secondary-foreground: var(--color-violet-900);
|
|
72
|
+
|
|
73
|
+
--color-muted: var(--color-zinc-100);
|
|
74
|
+
--color-muted-foreground: var(--color-zinc-600);
|
|
75
|
+
|
|
76
|
+
--color-accent: var(--color-violet-100);
|
|
77
|
+
--color-accent-foreground: var(--color-violet-900);
|
|
78
|
+
|
|
79
|
+
--color-destructive: var(--color-red-700);
|
|
80
|
+
--color-destructive-foreground: var(--color-white);
|
|
81
|
+
|
|
82
|
+
/* Status inks (non-shadcn addition — see the header note). */
|
|
83
|
+
--color-success: var(--color-green-800);
|
|
84
|
+
--color-warning: var(--color-amber-800);
|
|
85
|
+
--color-info: var(--color-blue-700);
|
|
86
|
+
|
|
87
|
+
--color-border: var(--color-violet-200);
|
|
88
|
+
--color-input: var(--color-violet-200);
|
|
89
|
+
--color-ring: var(--color-violet-500);
|
|
90
|
+
|
|
91
|
+
--color-chart-1: var(--color-violet-500);
|
|
92
|
+
--color-chart-2: var(--color-sky-500);
|
|
93
|
+
--color-chart-3: var(--color-emerald-500);
|
|
94
|
+
--color-chart-4: var(--color-amber-500);
|
|
95
|
+
--color-chart-5: var(--color-rose-500);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Dark pairs (shadcn v4 convention, selector re-pointed — see header). */
|
|
99
|
+
:root[data-theme='dark'],
|
|
100
|
+
:host([data-theme='dark']) {
|
|
101
|
+
--color-background: var(--color-zinc-950);
|
|
102
|
+
--color-foreground: var(--color-zinc-50);
|
|
103
|
+
|
|
104
|
+
--color-card: var(--color-zinc-900);
|
|
105
|
+
--color-card-foreground: var(--color-zinc-50);
|
|
106
|
+
|
|
107
|
+
--color-popover: var(--color-zinc-900);
|
|
108
|
+
--color-popover-foreground: var(--color-zinc-50);
|
|
109
|
+
|
|
110
|
+
--color-primary: var(--color-violet-400);
|
|
111
|
+
--color-primary-foreground: var(--color-violet-950);
|
|
112
|
+
|
|
113
|
+
--color-secondary: var(--color-zinc-800);
|
|
114
|
+
--color-secondary-foreground: var(--color-zinc-100);
|
|
115
|
+
|
|
116
|
+
--color-muted: var(--color-zinc-800);
|
|
117
|
+
--color-muted-foreground: var(--color-zinc-400);
|
|
118
|
+
|
|
119
|
+
--color-accent: var(--color-zinc-800);
|
|
120
|
+
--color-accent-foreground: var(--color-zinc-100);
|
|
121
|
+
|
|
122
|
+
--color-destructive: var(--color-red-400);
|
|
123
|
+
--color-destructive-foreground: var(--color-red-950);
|
|
124
|
+
|
|
125
|
+
--color-success: var(--color-green-400);
|
|
126
|
+
--color-warning: var(--color-amber-400);
|
|
127
|
+
--color-info: var(--color-blue-400);
|
|
128
|
+
|
|
129
|
+
--color-border: var(--color-zinc-800);
|
|
130
|
+
--color-input: var(--color-zinc-800);
|
|
131
|
+
--color-ring: var(--color-violet-400);
|
|
132
|
+
|
|
133
|
+
--color-chart-1: var(--color-violet-400);
|
|
134
|
+
--color-chart-2: var(--color-sky-400);
|
|
135
|
+
--color-chart-3: var(--color-emerald-400);
|
|
136
|
+
--color-chart-4: var(--color-amber-400);
|
|
137
|
+
--color-chart-5: var(--color-rose-400);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Forced-colors layer: every role re-seats on a system color. The mapping is
|
|
141
|
+
theme-independent (the UA owns the palette in forced-colors mode); the
|
|
142
|
+
duplicate dark pair exists so both selectors stay total if a UA applies
|
|
143
|
+
author dark resolution before forcing. Values are system keywords — no
|
|
144
|
+
author color survives the forcing. */
|
|
145
|
+
@media (forced-colors: active) {
|
|
146
|
+
:root {
|
|
147
|
+
--color-background: Canvas;
|
|
148
|
+
--color-foreground: CanvasText;
|
|
149
|
+
--color-card: Canvas;
|
|
150
|
+
--color-card-foreground: CanvasText;
|
|
151
|
+
--color-popover: Canvas;
|
|
152
|
+
--color-popover-foreground: CanvasText;
|
|
153
|
+
--color-primary: ButtonText;
|
|
154
|
+
--color-primary-foreground: Canvas;
|
|
155
|
+
--color-secondary: ButtonFace;
|
|
156
|
+
--color-secondary-foreground: ButtonText;
|
|
157
|
+
--color-muted: Canvas;
|
|
158
|
+
--color-muted-foreground: GrayText;
|
|
159
|
+
--color-accent: ButtonFace;
|
|
160
|
+
--color-accent-foreground: ButtonText;
|
|
161
|
+
--color-destructive: CanvasText;
|
|
162
|
+
--color-destructive-foreground: Canvas;
|
|
163
|
+
--color-success: CanvasText;
|
|
164
|
+
--color-warning: CanvasText;
|
|
165
|
+
--color-info: CanvasText;
|
|
166
|
+
--color-border: CanvasText;
|
|
167
|
+
--color-input: CanvasText;
|
|
168
|
+
--color-ring: Highlight;
|
|
169
|
+
--color-chart-1: LinkText;
|
|
170
|
+
--color-chart-2: Mark;
|
|
171
|
+
--color-chart-3: GrayText;
|
|
172
|
+
--color-chart-4: Highlight;
|
|
173
|
+
--color-chart-5: CanvasText;
|
|
174
|
+
}
|
|
175
|
+
:root[data-theme='dark'],
|
|
176
|
+
:host([data-theme='dark']) {
|
|
177
|
+
--color-background: Canvas;
|
|
178
|
+
--color-foreground: CanvasText;
|
|
179
|
+
--color-card: Canvas;
|
|
180
|
+
--color-card-foreground: CanvasText;
|
|
181
|
+
--color-popover: Canvas;
|
|
182
|
+
--color-popover-foreground: CanvasText;
|
|
183
|
+
--color-primary: ButtonText;
|
|
184
|
+
--color-primary-foreground: Canvas;
|
|
185
|
+
--color-secondary: ButtonFace;
|
|
186
|
+
--color-secondary-foreground: ButtonText;
|
|
187
|
+
--color-muted: Canvas;
|
|
188
|
+
--color-muted-foreground: GrayText;
|
|
189
|
+
--color-accent: ButtonFace;
|
|
190
|
+
--color-accent-foreground: ButtonText;
|
|
191
|
+
--color-destructive: CanvasText;
|
|
192
|
+
--color-destructive-foreground: Canvas;
|
|
193
|
+
--color-success: CanvasText;
|
|
194
|
+
--color-warning: CanvasText;
|
|
195
|
+
--color-info: CanvasText;
|
|
196
|
+
--color-border: CanvasText;
|
|
197
|
+
--color-input: CanvasText;
|
|
198
|
+
--color-ring: Highlight;
|
|
199
|
+
--color-chart-1: LinkText;
|
|
200
|
+
--color-chart-2: Mark;
|
|
201
|
+
--color-chart-3: GrayText;
|
|
202
|
+
--color-chart-4: Highlight;
|
|
203
|
+
--color-chart-5: CanvasText;
|
|
204
|
+
}
|
|
205
|
+
}
|
package/THIRD_PARTY_NOTICES.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# @openelement/ui — Third-Party Notices
|
|
2
|
-
|
|
3
|
-
This file is part of the published package tarball. It records the
|
|
4
|
-
third-party components redistributed inside `@openelement/ui` itself. The
|
|
5
|
-
repository-level inventory (vendored assets, fonts, Prism) lives in the
|
|
6
|
-
repository root `THIRD_PARTY_NOTICES.md`; package-level copies like this one
|
|
7
|
-
exist because a package tarball cannot reach repository-root files.
|
|
8
|
-
|
|
9
|
-
## open-props 1.7.23
|
|
10
|
-
|
|
11
|
-
Design tokens carried verbatim into the generated token module
|
|
12
|
-
(`src/open-props-tokens.ts`) by the package's build-time adapter (task
|
|
13
|
-
`generate:ui-tokens`), which reads the
|
|
14
|
-
pinned npm dependency at generation time. Only these declarations ship: the
|
|
15
|
-
gray ramp, `--indigo-6`, two border sizes, the font weights, and two
|
|
16
|
-
line-heights — everything else in the token layer is first-party.
|
|
17
|
-
|
|
18
|
-
- Upstream: <https://github.com/argyleink/open-props> (tag `1.7.23`,
|
|
19
|
-
<https://open-props.style>)
|
|
20
|
-
- License: MIT
|
|
21
|
-
- Copyright: Copyright (c) 2021 Adam Argyle
|
|
22
|
-
|
|
23
|
-
```text
|
|
24
|
-
MIT License
|
|
25
|
-
|
|
26
|
-
Copyright (c) 2021 Adam Argyle
|
|
27
|
-
|
|
28
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
29
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
30
|
-
in the Software without restriction, including without limitation the rights
|
|
31
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
32
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
33
|
-
furnished to do so, subject to the following conditions:
|
|
34
|
-
|
|
35
|
-
The above copyright notice and this permission notice shall be included in all
|
|
36
|
-
copies or substantial portions of the Software.
|
|
37
|
-
|
|
38
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
39
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
40
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
41
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
42
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
43
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
44
|
-
SOFTWARE.
|
|
45
|
-
```
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { StyleSheetLike } from "@openelement/element";
|
|
2
|
-
//#region src/open-props-tokens.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* The full token set as one constructable sheet. The token block selects
|
|
5
|
-
* `:root, :host`, so the same sheet serves a document-level adoption and a
|
|
6
|
-
* shadow-root adoption; only the structural fallback is :host-exclusive.
|
|
7
|
-
*/
|
|
8
|
-
export declare const openPropsTokenSheet: StyleSheetLike;
|
|
9
|
-
//#endregion
|