@openelement/ui 1.0.0-alpha.7 → 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/src/open-tabs.js CHANGED
@@ -209,63 +209,48 @@ const __compiledProps = {
209
209
  }
210
210
  };
211
211
  var OpenTabs = class extends OpenElement {
212
- constructor(..._args) {
213
- super(..._args);
214
- this.active = 0;
215
- this.tabsId = "";
216
- }
217
- static {
218
- this.__partProgram = __partProgram;
219
- }
220
- static {
221
- this.__compiledProperties = __compiledProperties;
222
- }
223
- static {
224
- this.__elementMetadata = __elementMetadata;
225
- }
226
- static {
227
- this.props = __compiledProps;
228
- }
229
- static {
230
- this.observedAttributes = __observedAttributes;
231
- }
232
- static {
233
- this.styles = [recipe(`
212
+ static __partProgram = __partProgram;
213
+ static __compiledProperties = __compiledProperties;
214
+ static __elementMetadata = __elementMetadata;
215
+ static props = __compiledProps;
216
+ static observedAttributes = __observedAttributes;
217
+ static styles = [recipe(`
234
218
  :host {
235
219
  display: block;
236
220
  }
237
221
 
238
222
  .tabs {
239
223
  display: flex;
240
- gap: var(--size-1);
241
- padding: var(--size-1);
242
- border-bottom: 1px solid var(--surface-border);
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));
243
227
  }
244
228
 
245
229
  ::slotted([slot='tab']) {
246
- padding: var(--size-2) var(--size-4);
230
+ padding: calc(var(--spacing) * 2) calc(var(--spacing) * 4);
247
231
  border-color: transparent;
248
232
  background: transparent;
249
- color: var(--text-secondary);
233
+ color: var(--color-muted-foreground);
250
234
  cursor: pointer;
251
235
  }
252
236
 
253
237
  ::slotted([slot='tab']:hover) {
254
- color: var(--text-primary);
238
+ color: var(--color-foreground);
255
239
  }
256
240
 
257
241
  ::slotted(.tab-active) {
258
- color: var(--text-primary);
259
- background: var(--brand-subtle);
260
- border-color: var(--surface-border-strong);
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));
261
245
  }
262
246
 
263
247
  ::slotted([slot='panel']) {
264
- padding-block: var(--size-4);
265
- color: var(--text-secondary);
248
+ padding-block: calc(var(--spacing) * 4);
249
+ color: var(--color-muted-foreground);
266
250
  }
267
251
  `)];
268
- }
252
+ active = 0;
253
+ tabsId = "";
269
254
  onDsdHydrated() {
270
255
  this.activate();
271
256
  }
@@ -423,30 +423,13 @@ const __compiledProps = { theme: {
423
423
  attribute: "theme"
424
424
  } };
425
425
  var OpenThemeToggle = class extends OpenElement {
426
- constructor(..._args) {
427
- super(..._args);
428
- this.theme = "dark";
429
- }
430
- static {
431
- this.__partProgram = __partProgram;
432
- }
433
- static {
434
- this.__compiledProperties = __compiledProperties;
435
- }
436
- static {
437
- this.__elementMetadata = __elementMetadata;
438
- }
439
- static {
440
- this.props = __compiledProps;
441
- }
442
- static {
443
- this.observedAttributes = __observedAttributes;
444
- }
445
- static {
446
- this.delegatesFocus = true;
447
- }
448
- static {
449
- this.styles = [recipe(`
426
+ static __partProgram = __partProgram;
427
+ static __compiledProperties = __compiledProperties;
428
+ static __elementMetadata = __elementMetadata;
429
+ static props = __compiledProps;
430
+ static observedAttributes = __observedAttributes;
431
+ static delegatesFocus = true;
432
+ static styles = [recipe(`
450
433
  :host {
451
434
  display: inline-block;
452
435
  }
@@ -456,23 +439,23 @@ var OpenThemeToggle = class extends OpenElement {
456
439
  align-items: center;
457
440
  justify-content: center;
458
441
  width: 38px; height: 38px; padding: 0;
459
- border: var(--border-size-1) solid color-mix(in srgb, var(--border) 72%, var(--brand));
460
- border-radius: var(--radius-round);
461
- background: color-mix(in srgb, var(--bg-elevated) 76%, transparent);
462
- color: var(--text-muted);
463
- box-shadow: inset 0 1px 0 color-mix(in srgb, var(--gray-0) 70%, transparent);
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);
464
447
  cursor: pointer;
465
- transition: all var(--ease-2) var(--duration-2);
448
+ transition: all var(--ease-in-out) var(--default-transition-duration);
466
449
  }
467
450
  .theme-toggle:hover {
468
- color: var(--text-primary);
469
- border-color: var(--brand-light);
470
- background: color-mix(in srgb, var(--brand-pale) 42%, var(--bg-elevated));
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));
471
454
  }
472
455
 
473
456
  .theme-toggle:focus-visible {
474
- outline: var(--focus-size, 2px) solid var(--focus-ring, var(--brand-light));
475
- outline-offset: var(--focus-offset, 2px);
457
+ outline: calc(var(--spacing) * 0.5) solid var(--color-ring);
458
+ outline-offset: calc(var(--spacing) * 0.75);
476
459
  }
477
460
 
478
461
  .theme-toggle svg {
@@ -496,7 +479,7 @@ var OpenThemeToggle = class extends OpenElement {
496
479
  display: block;
497
480
  }
498
481
  `)];
499
- }
482
+ theme = "dark";
500
483
  connectedCallback() {
501
484
  super.connectedCallback();
502
485
  this._requestAnimationFrame(() => this.initTheme());
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
+ }
@@ -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