@openelement/ui 1.0.0-alpha.12 → 1.0.0-alpha.14
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 +6 -45
- package/README.md +0 -8
- package/package.json +2 -2
- package/src/generated-manifest.json +1 -1
- package/src/open-button.js +7 -3
- package/src/open-dialog.js +7 -3
- package/src/open-input.js +21 -13
- package/src/open-theme-toggle.js +13 -5
package/CUSTOMIZATION.md
CHANGED
|
@@ -9,7 +9,10 @@ to the 1.0.0-alpha.8 baseline.
|
|
|
9
9
|
## Semver contract
|
|
10
10
|
|
|
11
11
|
- **`::part` names never shrink.** Every part shipped in 1.0.0-alpha.8 exists
|
|
12
|
-
today and must exist in every later release
|
|
12
|
+
today and must exist in every later release, for every component that still
|
|
13
|
+
ships; adding a part is allowed. (`open-card`, `open-callout`, `open-badge`
|
|
14
|
+
and `open-tabs` left the package under the Alpha disclaimer and are no
|
|
15
|
+
longer part of this contract.)
|
|
13
16
|
- **Consumed variables are pinned at the C3 role-direct baseline.** Adding or
|
|
14
17
|
removing a `var()` reference in a recipe is a deliberate surface change: the
|
|
15
18
|
guard fails until the pin and this document are updated in the same change.
|
|
@@ -132,11 +135,8 @@ Deliberate pixel breaks to note (this is C3's contract, not a migration):
|
|
|
132
135
|
(primary-foreground/secondary/border/ring/primary/secondary-foreground), so
|
|
133
136
|
coordinated surfaces (e.g. the site's flood panels) invert together with
|
|
134
137
|
the theme instead of mirroring a fixed ramp.
|
|
135
|
-
-
|
|
136
|
-
|
|
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).
|
|
138
|
+
- Code-block and dialog backdrop keep static zinc surfaces in both themes
|
|
139
|
+
(the retired sheet's behavior, now explicit literals-free ramp references).
|
|
140
140
|
|
|
141
141
|
## Per-component surface
|
|
142
142
|
|
|
@@ -144,16 +144,6 @@ Variables listed are the ones each component's recipe **consumes**; all of
|
|
|
144
144
|
them resolve from the role table above. There are no component-defined
|
|
145
145
|
custom properties.
|
|
146
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
147
|
### `open-button`
|
|
158
148
|
|
|
159
149
|
- Parts: `control`
|
|
@@ -165,28 +155,6 @@ custom properties.
|
|
|
165
155
|
- Shares the control recipe (below). Variant `primary`/`accent` fill with
|
|
166
156
|
`--color-primary` over `--color-primary-foreground`.
|
|
167
157
|
|
|
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
158
|
### `open-code-block`
|
|
191
159
|
|
|
192
160
|
- Parts: `copy`
|
|
@@ -233,13 +201,6 @@ custom properties.
|
|
|
233
201
|
- Shares the control recipe; error/invalid states use
|
|
234
202
|
`--color-destructive`.
|
|
235
203
|
|
|
236
|
-
### `open-tabs`
|
|
237
|
-
|
|
238
|
-
- Parts: none (light-DOM decoration pattern; the tabs/panels stay in the
|
|
239
|
-
page's DOM, styled through inherited roles)
|
|
240
|
-
- Variables: `--color-border`, `--color-foreground`,
|
|
241
|
-
`--color-muted-foreground`, `--color-primary`, `--spacing`
|
|
242
|
-
|
|
243
204
|
### `open-theme-toggle`
|
|
244
205
|
|
|
245
206
|
- Parts: `toggle`, `icon-sun`, `icon-moon`
|
package/README.md
CHANGED
|
@@ -34,14 +34,10 @@ npm install @openelement/ui
|
|
|
34
34
|
| ----------------- | ------------------- | ---------------------------------------------------------------- |
|
|
35
35
|
| `OpenButton` | `open-button` | Button component. |
|
|
36
36
|
| `OpenInput` | `open-input` | Input component. |
|
|
37
|
-
| `OpenCard` | `open-card` | Content card. |
|
|
38
37
|
| `OpenCodeBlock` | `open-code-block` | Code block with copy behavior; highlighting is the host's build-time step. |
|
|
39
|
-
| `OpenBadge` | `open-badge` | Status/content badge. |
|
|
40
38
|
| `OpenThemeToggle` | `open-theme-toggle` | Theme switch island. |
|
|
41
39
|
| `OpenDialog` | `open-dialog` | Modal/non-modal dialog. |
|
|
42
|
-
| `OpenCallout` | `open-callout` | Callout/notice box. |
|
|
43
40
|
| `OpenDropdown` | `open-dropdown` | Popover-first dropdown. |
|
|
44
|
-
| `OpenTabs` | `open-tabs` | Accessible tab interface. |
|
|
45
41
|
|
|
46
42
|
## Layering contract
|
|
47
43
|
|
|
@@ -150,14 +146,10 @@ manifest; the per-component JSDoc is the source of truth for those.
|
|
|
150
146
|
```text
|
|
151
147
|
@openelement/ui/open-button
|
|
152
148
|
@openelement/ui/open-input
|
|
153
|
-
@openelement/ui/open-card
|
|
154
149
|
@openelement/ui/open-code-block
|
|
155
|
-
@openelement/ui/open-badge
|
|
156
150
|
@openelement/ui/open-theme-toggle
|
|
157
151
|
@openelement/ui/open-dialog
|
|
158
|
-
@openelement/ui/open-callout
|
|
159
152
|
@openelement/ui/open-dropdown
|
|
160
|
-
@openelement/ui/open-tabs
|
|
161
153
|
@openelement/ui/theme.css (the @theme role source; compiled through the router preset)
|
|
162
154
|
@openelement/ui/instance-state (per-element instance state store; tree-shakeable leaf)
|
|
163
155
|
@openelement/ui/manifest (generated WC package manifest; node-safe leaf)
|
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.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -75,6 +75,6 @@
|
|
|
75
75
|
"sideEffects": false,
|
|
76
76
|
"peerDependenciesMeta": {},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@openelement/element": "1.0.0-alpha.
|
|
78
|
+
"@openelement/element": "1.0.0-alpha.14"
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
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.
|
|
5
|
+
"version": "1.0.0-alpha.14",
|
|
6
6
|
"description": "Semantic Web Component library for openElement",
|
|
7
7
|
"author": "openElement",
|
|
8
8
|
"license": "MIT",
|
package/src/open-button.js
CHANGED
|
@@ -1092,9 +1092,13 @@ var OpenButton = class extends OpenElement {
|
|
|
1092
1092
|
this.syncInternals();
|
|
1093
1093
|
}
|
|
1094
1094
|
attributeChangedCallback(name, old, val) {
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1095
|
+
try {
|
|
1096
|
+
super.attributeChangedCallback(name, old, val);
|
|
1097
|
+
if (old === val) return;
|
|
1098
|
+
if (name === "disabled") this.syncInternals();
|
|
1099
|
+
} catch (error) {
|
|
1100
|
+
if (!this._captureError(error)) throw error;
|
|
1101
|
+
}
|
|
1098
1102
|
}
|
|
1099
1103
|
syncInternals() {
|
|
1100
1104
|
syncDisabledState(this._internals, this.disabled);
|
package/src/open-dialog.js
CHANGED
|
@@ -544,9 +544,13 @@ var OpenDialog = class extends OpenElement {
|
|
|
544
544
|
this.syncOpenState();
|
|
545
545
|
}
|
|
546
546
|
disconnectedCallback() {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
547
|
+
try {
|
|
548
|
+
readInstanceState(this, "openEffect", () => void 0)?.();
|
|
549
|
+
writeInstanceState(this, "openEffect", void 0);
|
|
550
|
+
super.disconnectedCallback();
|
|
551
|
+
} catch (error) {
|
|
552
|
+
if (!this._captureError(error)) throw error;
|
|
553
|
+
}
|
|
550
554
|
}
|
|
551
555
|
syncOpenState() {
|
|
552
556
|
this.updateStates();
|
package/src/open-input.js
CHANGED
|
@@ -1722,15 +1722,19 @@ var OpenInput = class extends OpenElement {
|
|
|
1722
1722
|
this.updateStates();
|
|
1723
1723
|
}
|
|
1724
1724
|
attributeChangedCallback(name, old, val) {
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1725
|
+
try {
|
|
1726
|
+
super.attributeChangedCallback(name, old, val);
|
|
1727
|
+
if (old === val) return;
|
|
1728
|
+
if (name === "value") {
|
|
1729
|
+
this.syncFormValue();
|
|
1730
|
+
this.syncValidity();
|
|
1731
|
+
return;
|
|
1732
|
+
}
|
|
1733
|
+
if (name === "disabled" || name === "error") this.updateStates();
|
|
1734
|
+
if (name === "required") this.syncValidity();
|
|
1735
|
+
} catch (error) {
|
|
1736
|
+
if (!this._captureError(error)) throw error;
|
|
1731
1737
|
}
|
|
1732
|
-
if (name === "disabled" || name === "error") this.updateStates();
|
|
1733
|
-
if (name === "required") this.syncValidity();
|
|
1734
1738
|
}
|
|
1735
1739
|
updateStates() {
|
|
1736
1740
|
if (!this._internals?.states) return;
|
|
@@ -1781,11 +1785,15 @@ var OpenInput = class extends OpenElement {
|
|
|
1781
1785
|
}));
|
|
1782
1786
|
}
|
|
1783
1787
|
formResetCallback() {
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1788
|
+
try {
|
|
1789
|
+
super.formResetCallback();
|
|
1790
|
+
this.setAttribute("value", "");
|
|
1791
|
+
this.removeAttribute("error");
|
|
1792
|
+
this.syncFormValue();
|
|
1793
|
+
this.syncValidity();
|
|
1794
|
+
} catch (error) {
|
|
1795
|
+
if (!this._captureError(error)) throw error;
|
|
1796
|
+
}
|
|
1789
1797
|
}
|
|
1790
1798
|
formDisabledCallback(disabled) {
|
|
1791
1799
|
this.disabled = disabled;
|
package/src/open-theme-toggle.js
CHANGED
|
@@ -433,8 +433,12 @@ var OpenThemeToggle = class extends OpenElement {
|
|
|
433
433
|
static styles = [openThemeToggleStyles];
|
|
434
434
|
theme = "dark";
|
|
435
435
|
connectedCallback() {
|
|
436
|
-
|
|
437
|
-
|
|
436
|
+
try {
|
|
437
|
+
super.connectedCallback();
|
|
438
|
+
this._requestAnimationFrame(() => this.initTheme());
|
|
439
|
+
} catch (error) {
|
|
440
|
+
if (!this._captureError(error)) throw error;
|
|
441
|
+
}
|
|
438
442
|
}
|
|
439
443
|
onDsdHydrated() {
|
|
440
444
|
this._requestAnimationFrame(() => this.initTheme());
|
|
@@ -505,9 +509,13 @@ var OpenThemeToggle = class extends OpenElement {
|
|
|
505
509
|
}
|
|
506
510
|
}
|
|
507
511
|
attributeChangedCallback(name, old, val) {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
512
|
+
try {
|
|
513
|
+
super.attributeChangedCallback(name, old, val);
|
|
514
|
+
if (old === val) return;
|
|
515
|
+
if (name === "theme" && val) this.applyTheme(val === "light" ? "light" : "dark");
|
|
516
|
+
} catch (error) {
|
|
517
|
+
if (!this._captureError(error)) throw error;
|
|
518
|
+
}
|
|
511
519
|
}
|
|
512
520
|
render() {
|
|
513
521
|
throw new Error("[open:compiled-element] open-theme-toggle is compiled to a Part Program; the runtime JSX render path is not available.");
|