@widgentic/designer 0.2.0 → 0.3.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 +19 -4
- package/dist/browser/widgentic-designer.js +28 -50
- package/dist/browser/widgentic-designer.js.map +4 -4
- package/dist/chrome-defaults.d.ts +67 -0
- package/dist/chrome-defaults.d.ts.map +1 -0
- package/dist/chrome-defaults.js +102 -0
- package/dist/chrome-defaults.js.map +1 -0
- package/dist/dom.d.ts +3 -15
- package/dist/dom.d.ts.map +1 -1
- package/dist/dom.js +14 -50
- package/dist/dom.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,14 @@ through 28 `--wgd-*` custom properties, the chrome tokens (`CHROME_TOKENS`).
|
|
|
31
31
|
The widget PREVIEW inside them is not chrome: it follows the selected theme's
|
|
32
32
|
`--wg-*` tokens from `@widgentic/core/theming`.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
By default the designers wear the **widgentic palette**, light and dark, so an
|
|
35
|
+
embedded designer looks like widgentic with nothing configured. Every colour
|
|
36
|
+
sits on the logo mark's hue and is contrast-checked in both schemes — text at
|
|
37
|
+
WCAG AA (4.5:1), and the borders that identify an input, a focused tag or a
|
|
38
|
+
banner at 3:1. Typography is deliberately not branded: a library must never
|
|
39
|
+
default to a webfont it cannot serve.
|
|
40
|
+
|
|
41
|
+
`appearance: "auto" | "light" | "dark"` picks which scheme's defaults the
|
|
35
42
|
chrome follows. `chrome` layers a host's values on top of them, applied
|
|
36
43
|
inline on the designer root, so they win over the light and dark blocks:
|
|
37
44
|
|
|
@@ -65,8 +72,8 @@ The elements take the same map as JSON:
|
|
|
65
72
|
| JSON highlight | `hl-key`, `hl-str`, `hl-num`, `hl-bool`, `hl-punct` | light/dark palette |
|
|
66
73
|
| Typeface | `font` (labels, buttons, controls), `font-mono` (code panes, code-like values) | `system-ui, sans-serif` / `ui-monospace, monospace` |
|
|
67
74
|
| Size | `font-size` (base), `font-size-sm` (compact rows), `font-size-xs` (badges, tags, meta) | `13px` / `12px` / `11px` |
|
|
68
|
-
| Shape | `radius-sm`, `radius`, `radius-lg`, `gap` | `
|
|
69
|
-
| Elevation | `shadow` (menus) | `0
|
|
75
|
+
| Shape | `radius-sm`, `radius`, `radius-lg`, `gap` | `4px` / `6px` / `8px` / `16px` |
|
|
76
|
+
| Elevation | `shadow` (menus) | `0 8px 24px -12px rgba(11, 27, 38, 0.35)` |
|
|
70
77
|
|
|
71
78
|
Rules: values are CSS values; CSS-wide keywords (`inherit`, `initial`,
|
|
72
79
|
`unset`, `revert`) are ignored — on a custom property they act on the token
|
|
@@ -74,6 +81,14 @@ itself, not on what reads it — so to follow the host's typeface pass its
|
|
|
74
81
|
variable with a fallback stack (`font: "var(--app-font, system-ui,
|
|
75
82
|
sans-serif)"`). Unknown tokens, non-string values and unparseable attribute
|
|
76
83
|
JSON are ignored, never thrown. The attributes are read when the element
|
|
77
|
-
connects. With no `chrome`,
|
|
84
|
+
connects. With no `chrome`, you get the widgentic palette.
|
|
85
|
+
|
|
86
|
+
`CHROME_DEFAULTS` is not a description of the defaults — it IS them: the
|
|
87
|
+
injected stylesheet is generated from it, so a host that paints its own page
|
|
88
|
+
from the same object cannot drift. `chromeCss(CHROME_DEFAULTS, { prefix:
|
|
89
|
+
"--app" })` returns the light and dark declaration blocks for that. There is
|
|
90
|
+
one default palette and no second one to fall back to: a host that wants a
|
|
91
|
+
different look passes its own values through `chrome`, and `chromeCss` renders
|
|
92
|
+
them for the surrounding page just the same.
|
|
78
93
|
|
|
79
94
|
MIT © Diego Hoyos
|