@waggylabs/yumekit 0.5.2 → 0.5.3
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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/dist/ai/llm.txt +13 -11
- package/dist/ai/skill/examples/nav-layout.html +5 -5
- package/dist/ai/skill/examples/themed-app.html +6 -6
- package/dist/ai/skill/patterns.md +7 -7
- package/dist/ai/skill/reference.md +20 -18
- package/dist/components/y-appbar.js +45 -16
- package/dist/components/y-banner.js +44 -15
- package/dist/components/y-button/y-button.d.ts +11 -4
- package/dist/components/y-button.d.ts +11 -4
- package/dist/components/y-button.js +43 -14
- package/dist/components/y-checkbox.js +7 -1
- package/dist/components/y-color.js +12 -2
- package/dist/components/y-colorpicker.js +12 -2
- package/dist/components/y-data-grid.js +83 -35
- package/dist/components/y-date.js +72 -30
- package/dist/components/y-datepicker.js +72 -30
- package/dist/components/y-dialog.js +1 -1
- package/dist/components/y-help.js +46 -17
- package/dist/components/y-input.js +11 -1
- package/dist/components/y-paginator.js +46 -17
- package/dist/components/y-select.js +1 -1
- package/dist/components/y-sidebar.js +45 -16
- package/dist/components/y-tag/y-tag.d.ts +9 -2
- package/dist/components/y-tag.d.ts +9 -2
- package/dist/components/y-tag.js +36 -8
- package/dist/components/y-textarea.js +11 -1
- package/dist/index.js +139 -53
- package/dist/react.d.ts +4 -0
- package/dist/yumekit.min.js +1 -1
- package/llm.txt +13 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -31,6 +31,20 @@ Delete any empty sections before publishing.
|
|
|
31
31
|
<!-- ### Security -->
|
|
32
32
|
<!-- Vulnerability patches or hardening changes -->
|
|
33
33
|
|
|
34
|
+
## [0.5.3]
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- `y-button` and `y-tag` rename the `style-type` attribute to `variant`.
|
|
39
|
+
|
|
40
|
+
### Deprecated
|
|
41
|
+
|
|
42
|
+
- `y-button`'s and `y-tag`'s `style-type` attribute is deprecated in favor of `variant`; it still works (with `variant` taking precedence) but will be removed in a future major version.
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- `y-input`, `y-textarea`, and `y-checkbox` now respond to clicks across their full interactive area. Clicking anywhere in a `y-input`/`y-textarea` (padding and icon slots included) focuses the field, and clicking a `y-checkbox`'s label toggles it, matching the existing hover affordance and `y-radio`'s label behavior.
|
|
47
|
+
|
|
34
48
|
## [0.5.2] - 2026-06-27
|
|
35
49
|
|
|
36
50
|
### Added
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ YumeKit is a collection of 51 production-ready components built with native Web
|
|
|
21
21
|
|
|
22
22
|
- **Zero dependencies** — built entirely on web standards
|
|
23
23
|
- **Framework-agnostic** — works with React, Vue, Svelte, or plain HTML
|
|
24
|
-
- **Themeable** —
|
|
24
|
+
- **Themeable** — 60 built-in themes plus support for fully custom themes
|
|
25
25
|
- **Accessible** — ARIA-compliant, keyboard navigable, form-associated inputs
|
|
26
26
|
- **Tree-shakeable** — import only the components you use
|
|
27
27
|
|
package/dist/ai/llm.txt
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
A modern, framework-agnostic Web Components UI kit providing 51 production-ready custom HTML elements. Built entirely on native web standards with zero external runtime dependencies.
|
|
4
4
|
|
|
5
5
|
## Version
|
|
6
|
-
0.5.
|
|
6
|
+
0.5.3
|
|
7
7
|
|
|
8
8
|
## License
|
|
9
9
|
MIT
|
|
@@ -158,7 +158,8 @@ Tag: `<y-button>`
|
|
|
158
158
|
Attributes:
|
|
159
159
|
- `color` — predefined scheme (`"base"` | `"primary"` | `"secondary"` | `"success"` | `"warning"` | `"error"` | `"help"`) or any CSS color (`#hex`, `rgb()`, `hsl()`)
|
|
160
160
|
- `size` — `"small"` | `"medium"` (default) | `"large"`
|
|
161
|
-
- `
|
|
161
|
+
- `variant` — `"outlined"` (default) | `"filled"` | `"flat"`
|
|
162
|
+
- `style-type` — **deprecated** alias for `variant`; still honored (with `variant` winning if both are set) but will be removed in a future major version
|
|
162
163
|
- `padding-mode` — `"auto"` (default) | `"square"` | `"wide"`. Controls whether the inline padding collapses to the block value: `auto` does so for icon-only buttons; `square` forces it (e.g. paginator number buttons); `wide` never does
|
|
163
164
|
- `left-icon` — icon name (from registry)
|
|
164
165
|
- `right-icon` — icon name (from registry)
|
|
@@ -176,7 +177,7 @@ Attributes:
|
|
|
176
177
|
<y-button href="/docs" target="_blank" rel="noopener">Docs</y-button>
|
|
177
178
|
```
|
|
178
179
|
|
|
179
|
-
CSS Custom Properties (per `small|medium|large`): `--component-button-padding-{size}` sets padding on all sides; `--component-button-padding-block-{size}` and `--component-button-padding-inline-{size}` override the vertical / horizontal axes independently and fall back to `--component-button-padding-{size}` when unset (the Material and Shadcn themes use this for wider buttons). Whether the inline axis collapses to the block value is governed by the `padding-mode` attribute above (default `auto` = collapse for icon-only buttons). `--component-control-height-{size}` sets the min-height (shared with `y-input` so fields and buttons stay the same height per theme); falls back to `--sizing-{size}`. For `
|
|
180
|
+
CSS Custom Properties (per `small|medium|large`): `--component-button-padding-{size}` sets padding on all sides; `--component-button-padding-block-{size}` and `--component-button-padding-inline-{size}` override the vertical / horizontal axes independently and fall back to `--component-button-padding-{size}` when unset (the Material and Shadcn themes use this for wider buttons). Whether the inline axis collapses to the block value is governed by the `padding-mode` attribute above (default `auto` = collapse for icon-only buttons). `--component-control-height-{size}` sets the min-height (shared with `y-input` so fields and buttons stay the same height per theme); falls back to `--sizing-{size}`. For `variant="outlined"`, the border is sourced from the button's matching semantic border token (`--base-border`, `--primary-border`, `--error-border`, …) per `color`, falling back to the button's text color when that token is unset. `--component-button-border-width` sets the border width and is applied as the `border-width` longhand (not baked into a shorthand), so it accepts a 1–4 value pattern for per-side widths (e.g. `1px 2px` or `0 0 2px 0` for a bottom-only border); defaults to `1px`. Two optional global overrides remain: `--component-button-outline-border` overrides the border style + color as a CSS `border` shorthand (e.g. `1px solid var(--base-border)`) — note its width is superseded by `--component-button-border-width` — and `--component-button-outline-border-color` sets just the border color across resting/hover/focus/active — set either via CSS or a scoped `y-theme` to flatten all outlined borders to one color.
|
|
180
181
|
|
|
181
182
|
---
|
|
182
183
|
|
|
@@ -779,7 +780,8 @@ Tag: `<y-tag>`
|
|
|
779
780
|
Attributes:
|
|
780
781
|
- `color` — predefined scheme or CSS color (`#hex`, `rgb()`, `hsl()`). For `filled`, text is auto-contrasted via WCAG luminance. For `flat`, background is a 20% tint via `color-mix()`.
|
|
781
782
|
- `size` — `"small"` | `"medium"` | `"large"`
|
|
782
|
-
- `
|
|
783
|
+
- `variant` — `"filled"` (default) | `"outlined"` | `"flat"`
|
|
784
|
+
- `style-type` — **deprecated** alias for `variant`; still honored (with `variant` winning if both are set) but will be removed in a future major version
|
|
783
785
|
- `shape` — `"square"` (default) | `"round"`
|
|
784
786
|
- `removable` — boolean, shows close button
|
|
785
787
|
|
|
@@ -789,8 +791,8 @@ The `flat` style uses `--{color}-background-app` as the background, so it automa
|
|
|
789
791
|
|
|
790
792
|
```html
|
|
791
793
|
<y-tag color="primary" removable>JavaScript</y-tag>
|
|
792
|
-
<y-tag color="success"
|
|
793
|
-
<y-tag color="base"
|
|
794
|
+
<y-tag color="success" variant="outlined" shape="round">Active</y-tag>
|
|
795
|
+
<y-tag color="base" variant="flat">Draft</y-tag>
|
|
794
796
|
```
|
|
795
797
|
|
|
796
798
|
---
|
|
@@ -976,7 +978,7 @@ CSS Custom Properties: `--component-popover-background`, `--component-popover-co
|
|
|
976
978
|
<strong slot="header">Confirm change</strong>
|
|
977
979
|
<p>Saving will overwrite the existing layout.</p>
|
|
978
980
|
<div slot="footer">
|
|
979
|
-
<y-button size="small"
|
|
981
|
+
<y-button size="small" variant="outlined">Cancel</y-button>
|
|
980
982
|
<y-button size="small" color="primary">Save</y-button>
|
|
981
983
|
</div>
|
|
982
984
|
</y-popover>
|
|
@@ -1470,7 +1472,7 @@ CSS Custom Properties: `--component-dock-height`, `--component-dock-height-{smal
|
|
|
1470
1472
|
|
|
1471
1473
|
```html
|
|
1472
1474
|
<y-dock
|
|
1473
|
-
items='[{"name":"Home","icon":"home","href":"/","selected":true},{"name":"Search","icon":"
|
|
1475
|
+
items='[{"name":"Home","icon":"home","href":"/","selected":true},{"name":"Search","icon":"magnifying-glass","href":"/search"},{"name":"Profile","icon":"gear","href":"/profile"}]'
|
|
1474
1476
|
></y-dock>
|
|
1475
1477
|
```
|
|
1476
1478
|
|
|
@@ -1481,7 +1483,7 @@ Dropdown menu. Positioned relative to an anchor element. Items can be defined vi
|
|
|
1481
1483
|
|
|
1482
1484
|
Tag: `<y-menu>`
|
|
1483
1485
|
Attributes:
|
|
1484
|
-
- `items` — JSON string: `[{"text": "Edit", "value": "edit", "href": "...", "icon": "
|
|
1486
|
+
- `items` — JSON string: `[{"text": "Edit", "value": "edit", "href": "...", "icon": "pencil", "slot": "name", "selected": true, "children": [...]}, ...]`
|
|
1485
1487
|
- `anchor` — element ID (no `#`) of the trigger element; clicking the anchor toggles the menu automatically (no manual listener needed). A disabled anchor (native `disabled`, a reflected `disabled` attribute on a custom element like `y-button`, or `aria-disabled="true"`) will not open the menu.
|
|
1486
1488
|
- `visible` — boolean
|
|
1487
1489
|
- `direction` — `"down"` (default) | `"up"` | `"left"` | `"right"`
|
|
@@ -1498,7 +1500,7 @@ Item object fields:
|
|
|
1498
1500
|
- `text` — display text
|
|
1499
1501
|
- `value` — value reported in the `select` event (defaults to `text`)
|
|
1500
1502
|
- `href` — optional navigation URL
|
|
1501
|
-
- `icon` — icon name rendered via `<y-icon>` (e.g. `"
|
|
1503
|
+
- `icon` — icon name rendered via `<y-icon>` (e.g. `"pencil"`, `"trash"`)
|
|
1502
1504
|
- `slot` — named slot in light DOM whose content replaces this item's default content
|
|
1503
1505
|
- `selected` — boolean, highlights the active item
|
|
1504
1506
|
- `children` — array of sub-items (nested submenu)
|
|
@@ -1816,7 +1818,7 @@ Keyboard: ArrowUp/Down move between visible items; ArrowRight expands or focuses
|
|
|
1816
1818
|
```html
|
|
1817
1819
|
<y-tree route-match="prefix" style="width:280px">
|
|
1818
1820
|
<y-tree-item href="/docs" expanded>
|
|
1819
|
-
<y-icon slot="icon" name="
|
|
1821
|
+
<y-icon slot="icon" name="folder" size="small"></y-icon>
|
|
1820
1822
|
<span slot="label">Docs</span>
|
|
1821
1823
|
<y-tree-item slot="children" href="/docs/install">
|
|
1822
1824
|
<span slot="label">Installation</span>
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
<nav slot="nav">
|
|
38
38
|
<y-button style-type="flat" left-icon="home">Dashboard</y-button>
|
|
39
|
-
<y-button style-type="flat" left-icon="
|
|
39
|
+
<y-button style-type="flat" left-icon="diagram">Reports</y-button>
|
|
40
40
|
</nav>
|
|
41
41
|
|
|
42
42
|
<div slot="actions" style="display:flex; align-items:center; gap:0.5rem;">
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
<!-- User menu -->
|
|
51
51
|
<y-menu position="bottom-right">
|
|
52
52
|
<y-avatar slot="trigger" alt="JD" color="secondary" size="small" style="cursor:pointer;"></y-avatar>
|
|
53
|
-
<y-button style-type="flat" left-icon="
|
|
54
|
-
<y-button style-type="flat" left-icon="
|
|
53
|
+
<y-button style-type="flat" left-icon="gear">Settings</y-button>
|
|
54
|
+
<y-button style-type="flat" left-icon="x">Sign Out</y-button>
|
|
55
55
|
</y-menu>
|
|
56
56
|
</div>
|
|
57
57
|
</y-appbar>
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
<y-drawer id="sidebar" position="left" modal>
|
|
61
61
|
<nav class="drawer-nav">
|
|
62
62
|
<y-button style-type="flat" left-icon="home">Dashboard</y-button>
|
|
63
|
-
<y-button style-type="flat" left-icon="
|
|
64
|
-
<y-button style-type="flat" left-icon="
|
|
63
|
+
<y-button style-type="flat" left-icon="diagram">Reports</y-button>
|
|
64
|
+
<y-button style-type="flat" left-icon="gear">Settings</y-button>
|
|
65
65
|
</nav>
|
|
66
66
|
</y-drawer>
|
|
67
67
|
|
|
@@ -89,15 +89,15 @@
|
|
|
89
89
|
<!-- Icons tab -->
|
|
90
90
|
<div slot="icons" style="display:flex; gap:1rem; flex-wrap:wrap; padding-top:1rem; align-items:center;">
|
|
91
91
|
<y-icon name="home" size="large" label="Home"></y-icon>
|
|
92
|
-
<y-icon name="
|
|
92
|
+
<y-icon name="gear" size="large" label="Settings"></y-icon>
|
|
93
93
|
<y-icon name="bell" size="large" color="warning" label="Notifications"></y-icon>
|
|
94
94
|
<y-icon name="check" size="large" color="success" label="Success"></y-icon>
|
|
95
|
-
<y-icon name="
|
|
96
|
-
<y-icon name="info" size="large" color="primary" label="Info"></y-icon>
|
|
97
|
-
<y-icon name="
|
|
95
|
+
<y-icon name="x" size="large" color="error" label="Close"></y-icon>
|
|
96
|
+
<y-icon name="circle-info" size="large" color="primary" label="Info"></y-icon>
|
|
97
|
+
<y-icon name="magnifying-glass" size="large" label="Search"></y-icon>
|
|
98
98
|
<y-icon name="trash" size="large" color="error" label="Delete"></y-icon>
|
|
99
|
-
<y-icon name="
|
|
100
|
-
<y-icon name="
|
|
99
|
+
<y-icon name="pencil" size="large" color="secondary" label="Edit"></y-icon>
|
|
100
|
+
<y-icon name="down-to-bracket" size="large" color="primary" label="Download"></y-icon>
|
|
101
101
|
</div>
|
|
102
102
|
</y-tabs>
|
|
103
103
|
</div>
|
|
@@ -18,7 +18,7 @@ Common multi-component patterns. Adapt these for specific use cases.
|
|
|
18
18
|
<y-appbar
|
|
19
19
|
orientation="horizontal"
|
|
20
20
|
sticky="start"
|
|
21
|
-
items='[{"text":"Dashboard","icon":"home","href":"/"},{"text":"Reports","icon":"
|
|
21
|
+
items='[{"text":"Dashboard","icon":"home","href":"/"},{"text":"Reports","icon":"diagram","href":"/reports"},{"text":"Settings","icon":"gear","href":"/settings"}]'
|
|
22
22
|
>
|
|
23
23
|
<y-icon slot="logo" name="bolt" size="medium"></y-icon>
|
|
24
24
|
<span slot="title">MyApp</span>
|
|
@@ -48,7 +48,7 @@ Common multi-component patterns. Adapt these for specific use cases.
|
|
|
48
48
|
<y-appbar
|
|
49
49
|
orientation="vertical"
|
|
50
50
|
sticky="start"
|
|
51
|
-
items='[{"text":"Dashboard","icon":"home","href":"/"},{"text":"Reports","icon":"
|
|
51
|
+
items='[{"text":"Dashboard","icon":"home","href":"/"},{"text":"Reports","icon":"diagram","href":"/reports"},{"text":"Settings","icon":"gear","href":"/settings"}]'
|
|
52
52
|
>
|
|
53
53
|
<y-icon slot="logo" name="bolt" size="medium"></y-icon>
|
|
54
54
|
<span slot="title">MyApp</span>
|
|
@@ -85,7 +85,7 @@ Common multi-component patterns. Adapt these for specific use cases.
|
|
|
85
85
|
<y-button type="submit" color="primary">Sign In</y-button>
|
|
86
86
|
</form>
|
|
87
87
|
|
|
88
|
-
<y-button slot="footer"
|
|
88
|
+
<y-button slot="footer" variant="flat">Forgot password?</y-button>
|
|
89
89
|
</y-card>
|
|
90
90
|
</div>
|
|
91
91
|
|
|
@@ -128,7 +128,7 @@ Common multi-component patterns. Adapt these for specific use cases.
|
|
|
128
128
|
<y-dialog id="delete-dialog" persistent>
|
|
129
129
|
<span slot="header">Confirm Delete</span>
|
|
130
130
|
<p>This action cannot be undone. Are you sure?</p>
|
|
131
|
-
<y-button slot="footer" id="cancel-btn"
|
|
131
|
+
<y-button slot="footer" id="cancel-btn" variant="outlined">Cancel</y-button>
|
|
132
132
|
<y-button slot="footer" id="confirm-btn" color="error">Delete</y-button>
|
|
133
133
|
</y-dialog>
|
|
134
134
|
|
|
@@ -186,13 +186,13 @@ Common multi-component patterns. Adapt these for specific use cases.
|
|
|
186
186
|
|
|
187
187
|
<y-panel label="Danger Zone">
|
|
188
188
|
<div style="padding:1rem 0;">
|
|
189
|
-
<y-button color="error"
|
|
189
|
+
<y-button color="error" variant="outlined">Delete Account</y-button>
|
|
190
190
|
</div>
|
|
191
191
|
</y-panel>
|
|
192
192
|
</y-panelbar>
|
|
193
193
|
|
|
194
194
|
<div style="margin-top:1rem; display:flex; justify-content:flex-end; gap:0.5rem;">
|
|
195
|
-
<y-button
|
|
195
|
+
<y-button variant="outlined">Cancel</y-button>
|
|
196
196
|
<y-button type="submit" color="primary">Save Changes</y-button>
|
|
197
197
|
</div>
|
|
198
198
|
</form>
|
|
@@ -256,7 +256,7 @@ function confirmAction(message) {
|
|
|
256
256
|
dialog.innerHTML = `
|
|
257
257
|
<span slot="header">Confirm</span>
|
|
258
258
|
<p>${message}</p>
|
|
259
|
-
<y-button slot="footer" id="cancel"
|
|
259
|
+
<y-button slot="footer" id="cancel" variant="outlined">Cancel</y-button>
|
|
260
260
|
<y-button slot="footer" id="confirm" color="primary">Confirm</y-button>
|
|
261
261
|
`;
|
|
262
262
|
document.body.appendChild(dialog);
|
|
@@ -139,7 +139,8 @@ When `href` is set, the internal element renders as `<a>` instead of `<button>`
|
|
|
139
139
|
| ------------ | -------------------------------------------------------------------------------------- |
|
|
140
140
|
| `color` | `base` \| `primary` \| `secondary` \| `success` \| `warning` \| `error` \| `help` |
|
|
141
141
|
| `size` | `small` \| `medium` \| `large` |
|
|
142
|
-
| `
|
|
142
|
+
| `variant` | `outlined` (default) \| `filled` \| `flat` |
|
|
143
|
+
| `style-type` | **deprecated** alias for `variant` (still honored; `variant` wins if both set) — removed in a future major version |
|
|
143
144
|
| `padding-mode` | `auto` (default) \| `square` \| `wide` — `square` forces equal block/inline padding (e.g. paginator numbers), `wide` keeps inline padding even when icon-only, `auto` squares icon-only buttons |
|
|
144
145
|
| `disabled` | boolean |
|
|
145
146
|
| `type` | `button` (default) \| `submit` \| `reset` — ignored when `href` is set |
|
|
@@ -158,7 +159,7 @@ Slots: default (label), `left-icon`, `right-icon`
|
|
|
158
159
|
</y-button>
|
|
159
160
|
|
|
160
161
|
<!-- Link button — renders <a href="/docs"> internally -->
|
|
161
|
-
<y-button href="/docs" color="primary"
|
|
162
|
+
<y-button href="/docs" color="primary" variant="outlined"
|
|
162
163
|
>Documentation</y-button
|
|
163
164
|
>
|
|
164
165
|
|
|
@@ -167,7 +168,7 @@ Slots: default (label), `left-icon`, `right-icon`
|
|
|
167
168
|
href="https://example.com"
|
|
168
169
|
target="_blank"
|
|
169
170
|
rel="noopener noreferrer"
|
|
170
|
-
|
|
171
|
+
variant="flat"
|
|
171
172
|
>
|
|
172
173
|
External
|
|
173
174
|
<y-icon slot="right-icon" name="arrow-right" size="small"></y-icon>
|
|
@@ -177,7 +178,7 @@ Slots: default (label), `left-icon`, `right-icon`
|
|
|
177
178
|
<y-button href="/restricted" disabled>Unavailable</y-button>
|
|
178
179
|
```
|
|
179
180
|
|
|
180
|
-
CSS Custom Properties (per `small|medium|large`): `--component-button-padding-{size}` (all sides), and `--component-button-padding-block-{size}` / `--component-button-padding-inline-{size}` to override the vertical / horizontal axes independently (fall back to `--component-button-padding-{size}`). The `padding-mode` attribute governs whether the inline axis collapses to the block value (default `auto` = collapse for icon-only buttons). `--component-control-height-{size}` sets min-height (shared with `y-input`; falls back to `--sizing-{size}`). For `
|
|
181
|
+
CSS Custom Properties (per `small|medium|large`): `--component-button-padding-{size}` (all sides), and `--component-button-padding-block-{size}` / `--component-button-padding-inline-{size}` to override the vertical / horizontal axes independently (fall back to `--component-button-padding-{size}`). The `padding-mode` attribute governs whether the inline axis collapses to the block value (default `auto` = collapse for icon-only buttons). `--component-control-height-{size}` sets min-height (shared with `y-input`; falls back to `--sizing-{size}`). For `variant="outlined"`: the border is sourced from the button's matching semantic border token (`--base-border`, `--error-border`, …) per `color`, falling back to the text color when that token is unset. `--component-button-border-width` (applied as the `border-width` longhand, default `1px`) accepts a 1–4 value pattern for per-side widths (e.g. `0 0 2px 0`). Optional global overrides: `--component-button-outline-border` (border style + color as a CSS `border` shorthand; its width is superseded by `--component-button-border-width`) and `--component-button-outline-border-color` (border color across all states) — set via CSS or a scoped `y-theme`.
|
|
181
182
|
|
|
182
183
|
---
|
|
183
184
|
|
|
@@ -208,8 +209,8 @@ Slot: default (accepts any child elements — typically `y-button`, `y-input`, o
|
|
|
208
209
|
<!-- Mixed: input + button (search bar) -->
|
|
209
210
|
<y-button-group>
|
|
210
211
|
<y-input placeholder="Search…"></y-input>
|
|
211
|
-
<y-button
|
|
212
|
-
<y-icon slot="left-icon" name="
|
|
212
|
+
<y-button variant="filled" color="primary">
|
|
213
|
+
<y-icon slot="left-icon" name="magnifying-glass" size="small"></y-icon>
|
|
213
214
|
</y-button>
|
|
214
215
|
</y-button-group>
|
|
215
216
|
```
|
|
@@ -683,7 +684,8 @@ Slots: default (the element the badge overlays)
|
|
|
683
684
|
| ------------ | ------------------------------------------ |
|
|
684
685
|
| `color` | color scheme name |
|
|
685
686
|
| `size` | `small` \| `medium` \| `large` |
|
|
686
|
-
| `
|
|
687
|
+
| `variant` | `filled` (default) \| `outlined` \| `flat` |
|
|
688
|
+
| `style-type` | **deprecated** alias for `variant` (still honored; `variant` wins if both set) — removed in a future major version |
|
|
687
689
|
| `shape` | `square` (default) \| `round` |
|
|
688
690
|
| `removable` | boolean — shows close button |
|
|
689
691
|
|
|
@@ -693,8 +695,8 @@ Slot: default (label text)
|
|
|
693
695
|
|
|
694
696
|
```html
|
|
695
697
|
<y-tag color="primary" removable>JavaScript</y-tag>
|
|
696
|
-
<y-tag color="success"
|
|
697
|
-
<y-tag color="base"
|
|
698
|
+
<y-tag color="success" variant="outlined" shape="round">Active</y-tag>
|
|
699
|
+
<y-tag color="base" variant="flat">Draft</y-tag>
|
|
698
700
|
```
|
|
699
701
|
|
|
700
702
|
---
|
|
@@ -769,7 +771,7 @@ Slot: default (trigger element)
|
|
|
769
771
|
|
|
770
772
|
```html
|
|
771
773
|
<y-tooltip text="Remove this item" position="top">
|
|
772
|
-
<y-button color="error"
|
|
774
|
+
<y-button color="error" variant="flat"
|
|
773
775
|
><y-icon name="trash"></y-icon
|
|
774
776
|
></y-button>
|
|
775
777
|
</y-tooltip>
|
|
@@ -973,8 +975,8 @@ Slots: `header`, `body`, `footer` — **named slots only**; content without a `s
|
|
|
973
975
|
<y-drawer id="nav-drawer" position="left" anchor="open-nav-btn">
|
|
974
976
|
<strong slot="header">Navigation</strong>
|
|
975
977
|
<nav slot="body">
|
|
976
|
-
<y-button
|
|
977
|
-
<y-button
|
|
978
|
+
<y-button variant="flat">Dashboard</y-button>
|
|
979
|
+
<y-button variant="flat">Settings</y-button>
|
|
978
980
|
</nav>
|
|
979
981
|
</y-drawer>
|
|
980
982
|
|
|
@@ -1163,7 +1165,7 @@ Slots: `header`, `body`, `footer` — **named slots only**; content without a `s
|
|
|
1163
1165
|
<y-dialog id="confirm-dialog">
|
|
1164
1166
|
<span slot="header">Confirm Delete</span>
|
|
1165
1167
|
<p slot="body">This action cannot be undone.</p>
|
|
1166
|
-
<y-button slot="footer"
|
|
1168
|
+
<y-button slot="footer" variant="outlined">Cancel</y-button>
|
|
1167
1169
|
<y-button slot="footer" color="error">Delete</y-button>
|
|
1168
1170
|
</y-dialog>
|
|
1169
1171
|
|
|
@@ -1209,17 +1211,17 @@ Fixed navigation bar (dock) for primary app navigation. Displays icon+label item
|
|
|
1209
1211
|
```html
|
|
1210
1212
|
<!-- Basic bottom dock -->
|
|
1211
1213
|
<y-dock
|
|
1212
|
-
items='[{"name":"Home","icon":"home","href":"/","selected":true},{"name":"Search","icon":"
|
|
1214
|
+
items='[{"name":"Home","icon":"home","href":"/","selected":true},{"name":"Search","icon":"magnifying-glass","href":"/search"},{"name":"Profile","icon":"gear","href":"/profile"}]'
|
|
1213
1215
|
></y-dock>
|
|
1214
1216
|
|
|
1215
1217
|
<!-- Per-item custom slot template -->
|
|
1216
1218
|
<y-dock
|
|
1217
|
-
items='[{"name":"Home","icon":"home","href":"/"},{"name":"Create","icon":"plus","slot":"create-action"},{"name":"Profile","icon":"
|
|
1219
|
+
items='[{"name":"Home","icon":"home","href":"/"},{"name":"Create","icon":"plus","slot":"create-action"},{"name":"Profile","icon":"gear","href":"/profile"}]'
|
|
1218
1220
|
>
|
|
1219
1221
|
<y-button
|
|
1220
1222
|
slot="create-action"
|
|
1221
1223
|
color="primary"
|
|
1222
|
-
|
|
1224
|
+
variant="filled"
|
|
1223
1225
|
size="small"
|
|
1224
1226
|
left-icon="plus"
|
|
1225
1227
|
>Create</y-button
|
|
@@ -1728,7 +1730,7 @@ CSS Parts: `tree`
|
|
|
1728
1730
|
```html
|
|
1729
1731
|
<y-tree route-match="prefix" style="width:280px">
|
|
1730
1732
|
<y-tree-item href="/docs" expanded>
|
|
1731
|
-
<y-icon slot="icon" name="
|
|
1733
|
+
<y-icon slot="icon" name="folder" size="small"></y-icon>
|
|
1732
1734
|
<span slot="label">Docs</span>
|
|
1733
1735
|
<y-tree-item slot="children" href="/docs/install">
|
|
1734
1736
|
<span slot="label">Installation</span>
|
|
@@ -1851,7 +1853,7 @@ Accessibility: non-modal uses `role="tooltip"`; modal uses `role="dialog"` + `ar
|
|
|
1851
1853
|
<strong slot="header">Confirm change</strong>
|
|
1852
1854
|
<p>Saving will overwrite the existing layout.</p>
|
|
1853
1855
|
<div slot="footer">
|
|
1854
|
-
<y-button size="small"
|
|
1856
|
+
<y-button size="small" variant="outlined">Cancel</y-button>
|
|
1855
1857
|
<y-button size="small" color="primary">Save</y-button>
|
|
1856
1858
|
</div>
|
|
1857
1859
|
</y-popover>
|
|
@@ -7,6 +7,7 @@ class YumeButton extends HTMLElement {
|
|
|
7
7
|
"right-icon",
|
|
8
8
|
"color",
|
|
9
9
|
"size",
|
|
10
|
+
"variant",
|
|
10
11
|
"style-type",
|
|
11
12
|
"type",
|
|
12
13
|
"padding-mode",
|
|
@@ -59,9 +60,13 @@ class YumeButton extends HTMLElement {
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
if (name === "style-type" && newValue !== null) {
|
|
64
|
+
this._warnStyleTypeDeprecated();
|
|
65
|
+
}
|
|
66
|
+
|
|
62
67
|
this._init();
|
|
63
68
|
|
|
64
|
-
if (["color", "size", "style-type", "disabled"].includes(name)) {
|
|
69
|
+
if (["color", "size", "variant", "style-type", "disabled"].includes(name)) {
|
|
65
70
|
this._updateStyles();
|
|
66
71
|
}
|
|
67
72
|
}
|
|
@@ -143,9 +148,12 @@ class YumeButton extends HTMLElement {
|
|
|
143
148
|
this.setAttribute("size", val);
|
|
144
149
|
}
|
|
145
150
|
|
|
146
|
-
/**
|
|
151
|
+
/**
|
|
152
|
+
* Deprecated alias for `variant`. Use `variant` instead; retained for
|
|
153
|
+
* backward compatibility and removed in a future major version.
|
|
154
|
+
*/
|
|
147
155
|
get styleType() {
|
|
148
|
-
return this.
|
|
156
|
+
return this.variant;
|
|
149
157
|
}
|
|
150
158
|
set styleType(val) {
|
|
151
159
|
this.setAttribute("style-type", val);
|
|
@@ -188,6 +196,18 @@ class YumeButton extends HTMLElement {
|
|
|
188
196
|
this.setAttribute("value", newVal);
|
|
189
197
|
}
|
|
190
198
|
|
|
199
|
+
/** Visual style: "filled" | "outlined" | "flat" (default "outlined"). */
|
|
200
|
+
get variant() {
|
|
201
|
+
return (
|
|
202
|
+
this.getAttribute("variant") ||
|
|
203
|
+
this.getAttribute("style-type") ||
|
|
204
|
+
"outlined"
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
set variant(val) {
|
|
208
|
+
this.setAttribute("variant", val);
|
|
209
|
+
}
|
|
210
|
+
|
|
191
211
|
// -------------------------------------------------------------------------
|
|
192
212
|
// Public
|
|
193
213
|
// -------------------------------------------------------------------------
|
|
@@ -242,7 +262,7 @@ class YumeButton extends HTMLElement {
|
|
|
242
262
|
});
|
|
243
263
|
}
|
|
244
264
|
|
|
245
|
-
_applyCustomColorStyles(color,
|
|
265
|
+
_applyCustomColorStyles(color, variant, size) {
|
|
246
266
|
const text = contrastTextColor(color);
|
|
247
267
|
const hover = `color-mix(in srgb, ${color} 85%, black)`;
|
|
248
268
|
const active = `color-mix(in srgb, ${color} 70%, black)`;
|
|
@@ -298,7 +318,7 @@ class YumeButton extends HTMLElement {
|
|
|
298
318
|
},
|
|
299
319
|
};
|
|
300
320
|
|
|
301
|
-
Object.entries(styles[
|
|
321
|
+
Object.entries(styles[variant] || styles.outlined).forEach(
|
|
302
322
|
([key, val]) => this.button.style.setProperty(key, val),
|
|
303
323
|
);
|
|
304
324
|
|
|
@@ -344,11 +364,11 @@ class YumeButton extends HTMLElement {
|
|
|
344
364
|
);
|
|
345
365
|
}
|
|
346
366
|
|
|
347
|
-
_applyInteractionStyles(vars,
|
|
348
|
-
if (
|
|
367
|
+
_applyInteractionStyles(vars, variant) {
|
|
368
|
+
if (variant === "filled") {
|
|
349
369
|
this._applyFilledInteractionStyles(vars);
|
|
350
370
|
} else {
|
|
351
|
-
this._applyUnfilledInteractionStyles(vars,
|
|
371
|
+
this._applyUnfilledInteractionStyles(vars, variant);
|
|
352
372
|
}
|
|
353
373
|
}
|
|
354
374
|
|
|
@@ -473,7 +493,7 @@ class YumeButton extends HTMLElement {
|
|
|
473
493
|
this.shadowRoot.appendChild(style);
|
|
474
494
|
}
|
|
475
495
|
|
|
476
|
-
_applyUnfilledInteractionStyles(vars,
|
|
496
|
+
_applyUnfilledInteractionStyles(vars, variant) {
|
|
477
497
|
const borderColor = this._outlineBorderColor(
|
|
478
498
|
`var(${vars[7]}, var(${vars[0]}, #f7f7fa))`,
|
|
479
499
|
);
|
|
@@ -503,7 +523,7 @@ class YumeButton extends HTMLElement {
|
|
|
503
523
|
`var(${vars[6]}, #0c0c0d)`,
|
|
504
524
|
);
|
|
505
525
|
|
|
506
|
-
if (
|
|
526
|
+
if (variant === "outlined") {
|
|
507
527
|
// Outlined buttons keep their border color across all states
|
|
508
528
|
this.button.style.setProperty("--hover-border-color", borderColor);
|
|
509
529
|
this.button.style.setProperty("--focus-border-color", borderColor);
|
|
@@ -791,11 +811,11 @@ class YumeButton extends HTMLElement {
|
|
|
791
811
|
}
|
|
792
812
|
|
|
793
813
|
_updateStyles() {
|
|
794
|
-
const { color, size,
|
|
814
|
+
const { color, size, variant } = this;
|
|
795
815
|
const colorVars = this._getColorVarsMap();
|
|
796
816
|
|
|
797
817
|
if (!colorVars[color] && isSafeCssColor(color)) {
|
|
798
|
-
this._applyCustomColorStyles(color,
|
|
818
|
+
this._applyCustomColorStyles(color, variant, size);
|
|
799
819
|
return;
|
|
800
820
|
}
|
|
801
821
|
|
|
@@ -824,14 +844,23 @@ class YumeButton extends HTMLElement {
|
|
|
824
844
|
},
|
|
825
845
|
};
|
|
826
846
|
|
|
827
|
-
const currentStyle = styleVars[
|
|
847
|
+
const currentStyle = styleVars[variant] || styleVars.outlined;
|
|
828
848
|
Object.entries(currentStyle).forEach(([key, value]) => {
|
|
829
849
|
this.button.style.setProperty(key, value);
|
|
830
850
|
});
|
|
831
851
|
|
|
832
|
-
this._applyInteractionStyles(vars,
|
|
852
|
+
this._applyInteractionStyles(vars, variant);
|
|
833
853
|
this._applySizeStyles(size);
|
|
834
854
|
}
|
|
855
|
+
|
|
856
|
+
_warnStyleTypeDeprecated() {
|
|
857
|
+
if (YumeButton._styleTypeDeprecationWarned) return;
|
|
858
|
+
|
|
859
|
+
YumeButton._styleTypeDeprecationWarned = true;
|
|
860
|
+
console.warn(
|
|
861
|
+
'y-button: the "style-type" attribute is deprecated and will be removed in a future major version. Use "variant" instead.',
|
|
862
|
+
);
|
|
863
|
+
}
|
|
835
864
|
}
|
|
836
865
|
|
|
837
866
|
if (!customElements.get("y-button")) {
|
|
@@ -2168,7 +2197,7 @@ class YumeAppbar extends HTMLElement {
|
|
|
2168
2197
|
{
|
|
2169
2198
|
id,
|
|
2170
2199
|
color: "base",
|
|
2171
|
-
"
|
|
2200
|
+
"variant": "flat",
|
|
2172
2201
|
size: cfg.buttonSize,
|
|
2173
2202
|
"aria-label": "Open menu",
|
|
2174
2203
|
"aria-controls": panelId,
|
|
@@ -2320,7 +2349,7 @@ class YumeAppbar extends HTMLElement {
|
|
|
2320
2349
|
const btn = createElement("y-button", {
|
|
2321
2350
|
id: btnId,
|
|
2322
2351
|
color: isActive ? "primary" : "base",
|
|
2323
|
-
"
|
|
2352
|
+
"variant": "flat",
|
|
2324
2353
|
size: cfg.buttonSize,
|
|
2325
2354
|
"aria-current": isActive ? "page" : false,
|
|
2326
2355
|
});
|