@waggylabs/yumekit 0.4.0 → 0.4.1-beta.25
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 +45 -9
- package/README.md +33 -30
- package/dist/components/{y-appbar.d.ts → y-appbar/y-appbar.d.ts} +6 -0
- package/dist/components/y-appbar/y-appbar.stories.d.ts +90 -0
- package/dist/components/y-appbar.js +126 -16
- package/dist/components/y-avatar/y-avatar.stories.d.ts +119 -0
- package/dist/components/y-avatar.js +1 -1
- package/dist/components/y-badge/y-badge.stories.d.ts +107 -0
- package/dist/components/y-badge/y-badge.test.d.ts +1 -0
- package/dist/components/y-badge.js +1 -1
- package/dist/components/{y-button.d.ts → y-button/y-button.d.ts} +10 -1
- package/dist/components/y-button/y-button.stories.d.ts +136 -0
- package/dist/components/y-button/y-button.test.d.ts +1 -0
- package/dist/components/y-button-group/y-button-group.d.ts +13 -0
- package/dist/components/y-button-group/y-button-group.stories.d.ts +57 -0
- package/dist/components/y-button-group/y-button-group.test.d.ts +1 -0
- package/dist/components/y-button-group.js +118 -0
- package/dist/components/y-button.js +74 -12
- package/dist/components/y-card/y-card.stories.d.ts +61 -0
- package/dist/components/y-card/y-card.test.d.ts +1 -0
- package/dist/components/y-card.js +1 -1
- package/dist/components/y-checkbox/y-checkbox.stories.d.ts +119 -0
- package/dist/components/y-checkbox/y-checkbox.test.d.ts +1 -0
- package/dist/components/y-date/y-date.d.ts +179 -0
- package/dist/components/y-date/y-date.stories.d.ts +334 -0
- package/dist/components/y-date/y-date.test.d.ts +1 -0
- package/dist/components/y-date.js +4187 -0
- package/dist/components/y-datepicker/y-datepicker.d.ts +121 -0
- package/dist/components/y-datepicker/y-datepicker.stories.d.ts +316 -0
- package/dist/components/y-datepicker/y-datepicker.test.d.ts +1 -0
- package/dist/components/y-datepicker.js +2817 -0
- package/dist/components/y-dialog/y-dialog.stories.d.ts +118 -0
- package/dist/components/y-dialog/y-dialog.test.d.ts +1 -0
- package/dist/components/y-drawer/y-drawer.d.ts +1 -0
- package/dist/components/y-drawer/y-drawer.stories.d.ts +83 -0
- package/dist/components/y-drawer/y-drawer.test.d.ts +1 -0
- package/dist/components/y-icon/y-icon.stories.d.ts +95 -0
- package/dist/components/y-icon/y-icon.test.d.ts +1 -0
- package/dist/components/y-icon.js +1 -1
- package/dist/components/y-input/y-input.stories.d.ts +158 -0
- package/dist/components/y-input/y-input.test.d.ts +1 -0
- package/dist/components/y-input.js +68 -22
- package/dist/components/y-menu/y-menu.d.ts +1 -0
- package/dist/components/y-menu/y-menu.stories.d.ts +103 -0
- package/dist/components/y-menu/y-menu.test.d.ts +1 -0
- package/dist/components/y-menu.js +26 -2
- package/dist/components/y-panel/y-panel.test.d.ts +1 -0
- package/dist/components/y-panel.js +8 -0
- package/dist/components/y-panelbar/y-panelbar.stories.d.ts +44 -0
- package/dist/components/y-progress/y-progress.stories.d.ts +198 -0
- package/dist/components/y-progress/y-progress.test.d.ts +1 -0
- package/dist/components/y-progress.js +1 -1
- package/dist/components/y-radio/y-radio.stories.d.ts +62 -0
- package/dist/components/y-radio/y-radio.test.d.ts +1 -0
- package/dist/components/y-rating/y-rating.stories.d.ts +176 -0
- package/dist/components/y-rating/y-rating.test.d.ts +1 -0
- package/dist/components/y-rating.js +1 -1
- package/dist/components/y-select/y-select.stories.d.ts +216 -0
- package/dist/components/y-select/y-select.test.d.ts +1 -0
- package/dist/components/y-select.js +48 -23
- package/dist/components/y-slider/y-slider.stories.d.ts +153 -0
- package/dist/components/y-slider/y-slider.test.d.ts +1 -0
- package/dist/components/y-switch/y-switch.d.ts +1 -0
- package/dist/components/y-switch/y-switch.stories.d.ts +164 -0
- package/dist/components/y-switch/y-switch.test.d.ts +1 -0
- package/dist/components/y-switch.js +123 -54
- package/dist/components/y-table/y-table.stories.d.ts +84 -0
- package/dist/components/y-table/y-table.test.d.ts +1 -0
- package/dist/components/y-table.js +12 -3
- package/dist/components/y-tabs/y-tabs.stories.d.ts +70 -0
- package/dist/components/y-tabs/y-tabs.test.d.ts +1 -0
- package/dist/components/y-tag/y-tag.stories.d.ts +133 -0
- package/dist/components/y-tag/y-tag.test.d.ts +1 -0
- package/dist/components/y-tag.js +1 -1
- package/dist/components/y-textarea/y-textarea.stories.d.ts +151 -0
- package/dist/components/y-textarea/y-textarea.test.d.ts +1 -0
- package/dist/components/y-textarea.js +70 -23
- package/dist/components/{y-theme.d.ts → y-theme/y-theme.d.ts} +6 -0
- package/dist/components/y-theme/y-theme.stories.d.ts +184 -0
- package/dist/components/y-theme/y-theme.test.d.ts +1 -0
- package/dist/components/y-theme.js +85 -7
- package/dist/components/y-toast/y-toast.stories.d.ts +83 -0
- package/dist/components/y-toast/y-toast.test.d.ts +1 -0
- package/dist/components/y-toast.js +1 -1
- package/dist/components/y-tooltip/y-tooltip.stories.d.ts +82 -0
- package/dist/components/y-tooltip/y-tooltip.test.d.ts +1 -0
- package/dist/components/y-tooltip.js +1 -1
- package/dist/icons/all.js +34 -1
- package/dist/index.d.ts +28 -24
- package/dist/index.js +5728 -2704
- package/dist/modules/helpers.d.ts +7 -0
- package/dist/modules/helpers.js +29 -0
- package/dist/modules/helpers.test.d.ts +1 -0
- package/dist/modules/helpers.test.js +201 -0
- package/dist/react.d.ts +38 -0
- package/dist/styles/blue-dark.css +4 -0
- package/dist/styles/blue-light.css +4 -0
- package/dist/styles/brown-dark.css +143 -0
- package/dist/styles/brown-light.css +143 -0
- package/dist/styles/green-dark.css +143 -0
- package/dist/styles/green-light.css +143 -0
- package/dist/styles/indigo-dark.css +143 -0
- package/dist/styles/indigo-light.css +143 -0
- package/dist/styles/olive-dark.css +143 -0
- package/dist/styles/olive-light.css +143 -0
- package/dist/styles/orange-dark.css +4 -0
- package/dist/styles/orange-light.css +4 -0
- package/dist/styles/pink-dark.css +143 -0
- package/dist/styles/pink-light.css +143 -0
- package/dist/styles/purple-dark.css +143 -0
- package/dist/styles/purple-light.css +143 -0
- package/dist/styles/red-dark.css +143 -0
- package/dist/styles/red-light.css +143 -0
- package/dist/styles/teal-dark.css +143 -0
- package/dist/styles/teal-light.css +143 -0
- package/dist/styles/variables.css +77 -68
- package/dist/styles/yellow-dark.css +143 -0
- package/dist/styles/yellow-light.css +143 -0
- package/dist/yumekit.min.js +1 -1
- package/llm.txt +114 -8
- package/package.json +16 -3
- package/dist/components/y-switch.d.ts +0 -51
- /package/dist/components/{y-drawer.d.ts → y-appbar/y-appbar.test.d.ts} +0 -0
- /package/dist/components/{y-avatar.d.ts → y-avatar/y-avatar.d.ts} +0 -0
- /package/dist/components/{y-menu.d.ts → y-avatar/y-avatar.test.d.ts} +0 -0
- /package/dist/components/{y-badge.d.ts → y-badge/y-badge.d.ts} +0 -0
- /package/dist/components/{y-card.d.ts → y-card/y-card.d.ts} +0 -0
- /package/dist/components/{y-checkbox.d.ts → y-checkbox/y-checkbox.d.ts} +0 -0
- /package/dist/components/{y-dialog.d.ts → y-dialog/y-dialog.d.ts} +0 -0
- /package/dist/components/{y-icon.d.ts → y-icon/y-icon.d.ts} +0 -0
- /package/dist/components/{y-input.d.ts → y-input/y-input.d.ts} +0 -0
- /package/dist/components/{y-panel.d.ts → y-panel/y-panel.d.ts} +0 -0
- /package/dist/components/{y-panelbar.d.ts → y-panelbar/y-panelbar.d.ts} +0 -0
- /package/dist/components/{y-progress.d.ts → y-progress/y-progress.d.ts} +0 -0
- /package/dist/components/{y-radio.d.ts → y-radio/y-radio.d.ts} +0 -0
- /package/dist/components/{y-rating.d.ts → y-rating/y-rating.d.ts} +0 -0
- /package/dist/components/{y-select.d.ts → y-select/y-select.d.ts} +0 -0
- /package/dist/components/{y-slider.d.ts → y-slider/y-slider.d.ts} +0 -0
- /package/dist/components/{y-table.d.ts → y-table/y-table.d.ts} +0 -0
- /package/dist/components/{y-tabs.d.ts → y-tabs/y-tabs.d.ts} +0 -0
- /package/dist/components/{y-tag.d.ts → y-tag/y-tag.d.ts} +0 -0
- /package/dist/components/{y-textarea.d.ts → y-textarea/y-textarea.d.ts} +0 -0
- /package/dist/components/{y-toast.d.ts → y-toast/y-toast.d.ts} +0 -0
- /package/dist/components/{y-tooltip.d.ts → y-tooltip/y-tooltip.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -31,7 +31,43 @@ Delete any empty sections before publishing.
|
|
|
31
31
|
<!-- ### Security -->
|
|
32
32
|
<!-- Vulnerability patches or hardening changes -->
|
|
33
33
|
|
|
34
|
-
## [0.4.
|
|
34
|
+
## [0.4.2] - 2026-04-07
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- New `y-button-group` component — wraps `y-button` (and other elements such as `y-input` or `y-select`) into a visually connected toolbar. Automatically removes inner border-radius on middle children and collapses shared borders to avoid double-border artifacts. Supports `orientation` attribute (`"horizontal"` (default) | `"vertical"`). Works with any slotted child that respects the `--component-button-border-radius-outer` CSS custom property.
|
|
39
|
+
- `href`, `target`, and `rel` attributes on `y-button`. When `href` is set the internal element switches from `<button>` to `<a>`, preserving all visual styles and size/color/style-type variants. Disabled state is handled via `aria-disabled` and `pointer-events: none` since `<a>` has no native disabled.
|
|
40
|
+
- `navigate` custom event on `y-appbar`, `y-panel`, and `y-menu`. Fires before any navigation when an item with an `href` / `url` is clicked. The event is cancelable (`e.preventDefault()`) and carries `event.detail.href` — React Router and other SPA routers can intercept it without any framework-specific glue.
|
|
41
|
+
- `history` attribute on `y-appbar` and `y-menu` (already present on `y-panel`). When omitted (default), navigation uses `history.pushState` + a synthetic `popstate` event so all `popstate`-based routers (React Router `BrowserRouter`, Vue Router, etc.) respond automatically. Set `history="false"` to opt back in to full-page `window.location.href` navigation.
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
|
|
45
|
+
- Added responsive display to `y-date` and `y-datepicker` as well as the ability to set a `native-mobile` property to `y-date` which will allow the input to use the native mobile date and time picker instead of the `y-datepicker`.
|
|
46
|
+
|
|
47
|
+
## [0.4.1] - 2026-04-01
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- New `y-date` component — a form-associated date (and optional time) input field. Displays a trigger button that opens a `y-datepicker` popup. Supports `name`, `value`, `label`, `label-position`, `placeholder`, `size`, `disabled`, `required`, `invalid`, `clearable`, `show-hours`, `min`, `max`, `format`, and `mode` attributes. Emits `change` and `input` events. Fully keyboard accessible with `aria-expanded` management.
|
|
52
|
+
- New `y-datepicker` component — a standalone calendar and optional time picker widget. Supports single date and date range selection via the `mode` attribute. Configurable with `value`, `min`, `max`, `show-hours`, `show-seconds`, `format`, `first-day-of-week`, `year-range`, and `panel-count` attributes. Emits a `change` event with the selected date value or `[start, end]` range array. Public API: `clear()`, `formatDate(date)`.
|
|
53
|
+
- 10 new bundled icons: `fan`, `thermometer-high`, `thermometer-low`, `ban`, `bluetooth`, `unlock`, `plug`, `gasoline`, `ev-charger`, `tools`.
|
|
54
|
+
- `comp-date` icon added to the bundled icon registry.
|
|
55
|
+
- Storybook integration — all 28 components now have Storybook stories. Includes a theme background selector that applies the correct design tokens for each active theme.
|
|
56
|
+
- 18 new built-in themes (9 color families × dark + light): `green`, `red`, `teal`, `yellow`, `indigo`, `purple`, `pink`, `brown`, `olive`. All are usable by name in the `theme` attribute of `<y-theme>`.
|
|
57
|
+
|
|
58
|
+
### Changed
|
|
59
|
+
|
|
60
|
+
- All component source files moved into per-component subdirectories under `src/components/` (e.g. `src/components/y-button/y-button.js`). Tests co-located alongside their component files.
|
|
61
|
+
- `--lime-*` color tokens in `variables.css` renamed to `--olive-*` to better reflect the adjusted core color (`#838807`).
|
|
62
|
+
- Core token values adjusted for WCAG 3:1 accessibility compliance against both black and white backgrounds: `--green--`, `--teal--`, `--indigo--`, and `--olive--` (formerly `--lime--`). Corresponding dark and light scale variants regenerated using linear RGB interpolation.
|
|
63
|
+
|
|
64
|
+
### Fixed
|
|
65
|
+
|
|
66
|
+
- `y-table` sort indicator no longer resizes columns when applied
|
|
67
|
+
- `y-icon` removed artifact from accessibility icon
|
|
68
|
+
- Dark theme files corrected: `--help-background-component` now uses `var(--indigo-dark-0)` instead of `var(--indigo-light-0)`.
|
|
69
|
+
|
|
70
|
+
## [0.4.0] - 2026-03-29
|
|
35
71
|
|
|
36
72
|
### Added
|
|
37
73
|
|
|
@@ -63,19 +99,19 @@ Delete any empty sections before publishing.
|
|
|
63
99
|
- `gripDots(horizontal)` function removed from `src/icons/index.js`.
|
|
64
100
|
- Stale `--base-background-border` and `--error-background-border` variable references cleaned up across all theme files (renamed to `--base-border` / `--error-border` in 0.3.9).
|
|
65
101
|
|
|
66
|
-
## [0.3.10]
|
|
102
|
+
## [0.3.10] - 2026-03-25
|
|
67
103
|
|
|
68
104
|
### Added
|
|
69
105
|
|
|
70
106
|
- `y-card`: added `image` slot that displays over the `header` slot if included.
|
|
71
107
|
|
|
72
|
-
## [0.3.9]
|
|
108
|
+
## [0.3.9] - 2026-03-25
|
|
73
109
|
|
|
74
110
|
### Fixed
|
|
75
111
|
|
|
76
112
|
- `y-card`, `y-switch`, `y-slider`, `y-progress`: restored missing borders after theme variable rename in 0.3.8 changed `--{scheme}-background-border` to `--{scheme}-border` without updating component references.
|
|
77
113
|
|
|
78
|
-
## [0.3.8]
|
|
114
|
+
## [0.3.8] - 2026-03-25
|
|
79
115
|
|
|
80
116
|
### Fixed
|
|
81
117
|
|
|
@@ -83,7 +119,7 @@ Delete any empty sections before publishing.
|
|
|
83
119
|
|
|
84
120
|
- `y-tag`: reverted earlier change adding variables to tag backgrounds. Defaults to -background-app variables
|
|
85
121
|
|
|
86
|
-
## [0.3.6]
|
|
122
|
+
## [0.3.6] - 2026-03-23
|
|
87
123
|
|
|
88
124
|
### Added
|
|
89
125
|
|
|
@@ -105,25 +141,25 @@ Delete any empty sections before publishing.
|
|
|
105
141
|
|
|
106
142
|
- Removed `features` icon (duplicate of `sun`)
|
|
107
143
|
|
|
108
|
-
## [0.3.5]
|
|
144
|
+
## [0.3.5] - 2026-03-20
|
|
109
145
|
|
|
110
146
|
### Fixed
|
|
111
147
|
|
|
112
148
|
- Patch for 0.3.3 with bug fixes
|
|
113
149
|
|
|
114
|
-
## [0.3.4]
|
|
150
|
+
## [0.3.4] - 2026-03-20
|
|
115
151
|
|
|
116
152
|
### Fixed
|
|
117
153
|
|
|
118
154
|
- Patch for 0.3.3 with bug fixes
|
|
119
155
|
|
|
120
|
-
## [0.3.3]
|
|
156
|
+
## [0.3.3] - 2026-03-20
|
|
121
157
|
|
|
122
158
|
### Fixed
|
|
123
159
|
|
|
124
160
|
- Several bug fixes and test updates
|
|
125
161
|
|
|
126
|
-
## [0.3.2]
|
|
162
|
+
## [0.3.2] - 2026-03-18
|
|
127
163
|
|
|
128
164
|
### Added
|
|
129
165
|
|
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
|
|
18
18
|
## Overview
|
|
19
19
|
|
|
20
|
-
YumeKit is a collection of
|
|
20
|
+
YumeKit is a collection of 27 production-ready custom elements built with native Web Components. It works with any framework — or none at all — and ships with a comprehensive design token system, built-in theming, an icon registry, and full TypeScript support.
|
|
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** — 22 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
|
|
|
@@ -73,34 +73,37 @@ Then use the `<y-theme>` component to apply a theme:
|
|
|
73
73
|
|
|
74
74
|
## Components
|
|
75
75
|
|
|
76
|
-
| Component
|
|
77
|
-
|
|
|
78
|
-
| App Bar
|
|
79
|
-
| Avatar
|
|
80
|
-
| Badge
|
|
81
|
-
| Button
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
76
|
+
| Component | Element | Description |
|
|
77
|
+
| ------------ | ------------------ | --------------------------------------------------- |
|
|
78
|
+
| App Bar | `<y-appbar>` | Top or side navigation bar |
|
|
79
|
+
| Avatar | `<y-avatar>` | User avatar with shape and color variants |
|
|
80
|
+
| Badge | `<y-badge>` | Status badge or label |
|
|
81
|
+
| Button | `<y-button>` | Button with icon, size, and style variants |
|
|
82
|
+
| Button Group | `<y-button-group>` | Groups buttons (or inputs) into a connected toolbar |
|
|
83
|
+
| Card | `<y-card>` | Content card container |
|
|
84
|
+
| Checkbox | `<y-checkbox>` | Form checkbox input |
|
|
85
|
+
| Date | `<y-date>` | Date input |
|
|
86
|
+
| DatePicker | `<y-datepicker>` | A date and time picker |
|
|
87
|
+
| Dialog | `<y-dialog>` | Modal dialog |
|
|
88
|
+
| Drawer | `<y-drawer>` | Side drawer / sidebar |
|
|
89
|
+
| Icon | `<y-icon>` | SVG icon display |
|
|
90
|
+
| Input | `<y-input>` | Text input field |
|
|
91
|
+
| Menu | `<y-menu>` | Dropdown navigation menu |
|
|
92
|
+
| Panel | `<y-panel>` | Accordion panel |
|
|
93
|
+
| Panel Bar | `<y-panelbar>` | Accordion panel group |
|
|
94
|
+
| Progress | `<y-progress>` | Progress bar |
|
|
95
|
+
| Radio | `<y-radio>` | Radio button input |
|
|
96
|
+
| Rating | `<y-rating>` | Star / icon rating input |
|
|
97
|
+
| Select | `<y-select>` | Select / dropdown input |
|
|
98
|
+
| Slider | `<y-slider>` | Range slider input |
|
|
99
|
+
| Switch | `<y-switch>` | Toggle switch |
|
|
100
|
+
| Table | `<y-table>` | Sortable data table |
|
|
101
|
+
| Textarea | `<y-textarea>` | Multi-line text input |
|
|
102
|
+
| Tabs | `<y-tabs>` | Tabbed interface |
|
|
103
|
+
| Tag | `<y-tag>` | Tag / chip label |
|
|
104
|
+
| Theme | `<y-theme>` | Theme provider |
|
|
105
|
+
| Toast | `<y-toast>` | Notification toast |
|
|
106
|
+
| Tooltip | `<y-tooltip>` | Tooltip / popover |
|
|
104
107
|
|
|
105
108
|
---
|
|
106
109
|
|
|
@@ -34,6 +34,12 @@ export class YumeAppbar extends HTMLElement {
|
|
|
34
34
|
set size(val: string);
|
|
35
35
|
/** Size variant: "small" | "medium" | "large" (default "medium"). */
|
|
36
36
|
get size(): string;
|
|
37
|
+
set history(val: string);
|
|
38
|
+
/**
|
|
39
|
+
* Navigation mode: omit for pushState (SPA-friendly), set to "false" for full-page navigation.
|
|
40
|
+
* Regardless of this setting, a cancelable "navigate" event is always dispatched first.
|
|
41
|
+
*/
|
|
42
|
+
get history(): string;
|
|
37
43
|
set sticky(val: string | false);
|
|
38
44
|
/** Sticky position: "start" | "end" | false. */
|
|
39
45
|
get sticky(): string | false;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let title: string;
|
|
3
|
+
let tags: string[];
|
|
4
|
+
namespace argTypes {
|
|
5
|
+
namespace orientation {
|
|
6
|
+
let control: string;
|
|
7
|
+
let options: string[];
|
|
8
|
+
let description: string;
|
|
9
|
+
namespace table {
|
|
10
|
+
namespace defaultValue {
|
|
11
|
+
let summary: string;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
namespace size {
|
|
16
|
+
let control_1: string;
|
|
17
|
+
export { control_1 as control };
|
|
18
|
+
let options_1: string[];
|
|
19
|
+
export { options_1 as options };
|
|
20
|
+
let description_1: string;
|
|
21
|
+
export { description_1 as description };
|
|
22
|
+
export namespace table_1 {
|
|
23
|
+
export namespace defaultValue_1 {
|
|
24
|
+
let summary_1: string;
|
|
25
|
+
export { summary_1 as summary };
|
|
26
|
+
}
|
|
27
|
+
export { defaultValue_1 as defaultValue };
|
|
28
|
+
}
|
|
29
|
+
export { table_1 as table };
|
|
30
|
+
}
|
|
31
|
+
namespace collapsed {
|
|
32
|
+
let control_2: string;
|
|
33
|
+
export { control_2 as control };
|
|
34
|
+
let description_2: string;
|
|
35
|
+
export { description_2 as description };
|
|
36
|
+
export namespace table_2 {
|
|
37
|
+
export namespace defaultValue_2 {
|
|
38
|
+
let summary_2: boolean;
|
|
39
|
+
export { summary_2 as summary };
|
|
40
|
+
}
|
|
41
|
+
export { defaultValue_2 as defaultValue };
|
|
42
|
+
}
|
|
43
|
+
export { table_2 as table };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
namespace args {
|
|
47
|
+
let orientation_1: string;
|
|
48
|
+
export { orientation_1 as orientation };
|
|
49
|
+
let size_1: string;
|
|
50
|
+
export { size_1 as size };
|
|
51
|
+
let collapsed_1: boolean;
|
|
52
|
+
export { collapsed_1 as collapsed };
|
|
53
|
+
}
|
|
54
|
+
function render({ orientation, size, collapsed }: {
|
|
55
|
+
orientation: any;
|
|
56
|
+
size: any;
|
|
57
|
+
collapsed: any;
|
|
58
|
+
}): string;
|
|
59
|
+
}
|
|
60
|
+
export default _default;
|
|
61
|
+
export const Default: {};
|
|
62
|
+
export namespace Collapsed {
|
|
63
|
+
export namespace args_1 {
|
|
64
|
+
let collapsed_2: boolean;
|
|
65
|
+
export { collapsed_2 as collapsed };
|
|
66
|
+
}
|
|
67
|
+
export { args_1 as args };
|
|
68
|
+
}
|
|
69
|
+
export namespace Horizontal {
|
|
70
|
+
export namespace args_2 {
|
|
71
|
+
let orientation_2: string;
|
|
72
|
+
export { orientation_2 as orientation };
|
|
73
|
+
}
|
|
74
|
+
export { args_2 as args };
|
|
75
|
+
export function render_1(): string;
|
|
76
|
+
export { render_1 as render };
|
|
77
|
+
}
|
|
78
|
+
export namespace Sizes {
|
|
79
|
+
export function render_2(): string;
|
|
80
|
+
export { render_2 as render };
|
|
81
|
+
}
|
|
82
|
+
export namespace NavigateEvent {
|
|
83
|
+
export let name: string;
|
|
84
|
+
export function render_3(): HTMLDivElement;
|
|
85
|
+
export { render_3 as render };
|
|
86
|
+
}
|
|
87
|
+
export namespace WithFooter {
|
|
88
|
+
export function render_4(): string;
|
|
89
|
+
export { render_4 as render };
|
|
90
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { contrastTextColor } from '
|
|
2
|
-
import { getIcon } from '
|
|
1
|
+
import { contrastTextColor } from '../../modules/helpers.js';
|
|
2
|
+
import { getIcon } from '../../icons/registry.js';
|
|
3
3
|
|
|
4
4
|
class YumeButton extends HTMLElement {
|
|
5
5
|
static get observedAttributes() {
|
|
@@ -8,6 +8,7 @@ class YumeButton extends HTMLElement {
|
|
|
8
8
|
"disabled", "name", "value", "autofocus", "form", "formaction",
|
|
9
9
|
"formenctype", "formmethod", "formnovalidate", "formtarget",
|
|
10
10
|
"aria-label", "aria-pressed", "aria-hidden",
|
|
11
|
+
"href", "target", "rel",
|
|
11
12
|
];
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -49,6 +50,27 @@ class YumeButton extends HTMLElement {
|
|
|
49
50
|
// Getters / Setters
|
|
50
51
|
// -------------------------------------------------------------------------
|
|
51
52
|
|
|
53
|
+
/** URL to navigate to. When set, the internal element renders as an <a> instead of <button>. */
|
|
54
|
+
get href() { return this.getAttribute("href"); }
|
|
55
|
+
set href(val) {
|
|
56
|
+
if (val != null) this.setAttribute("href", val);
|
|
57
|
+
else this.removeAttribute("href");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Anchor target (e.g. "_blank"). Only applies when href is set. */
|
|
61
|
+
get target() { return this.getAttribute("target"); }
|
|
62
|
+
set target(val) {
|
|
63
|
+
if (val != null) this.setAttribute("target", val);
|
|
64
|
+
else this.removeAttribute("target");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Anchor rel attribute (e.g. "noopener noreferrer"). Only applies when href is set. */
|
|
68
|
+
get rel() { return this.getAttribute("rel"); }
|
|
69
|
+
set rel(val) {
|
|
70
|
+
if (val != null) this.setAttribute("rel", val);
|
|
71
|
+
else this.removeAttribute("rel");
|
|
72
|
+
}
|
|
73
|
+
|
|
52
74
|
/** Color theme for the button (default "base"). */
|
|
53
75
|
get color() { return this.getAttribute("color") || "base"; }
|
|
54
76
|
set color(val) { this.setAttribute("color", val); }
|
|
@@ -287,9 +309,15 @@ class YumeButton extends HTMLElement {
|
|
|
287
309
|
line-height: 1;
|
|
288
310
|
}
|
|
289
311
|
|
|
290
|
-
.button
|
|
312
|
+
.button {
|
|
313
|
+
text-decoration: none;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.button:disabled,
|
|
317
|
+
.button[aria-disabled="true"] {
|
|
291
318
|
opacity: 0.5;
|
|
292
319
|
cursor: not-allowed;
|
|
320
|
+
pointer-events: none;
|
|
293
321
|
}
|
|
294
322
|
|
|
295
323
|
.button:hover:not(:disabled),
|
|
@@ -419,23 +447,49 @@ class YumeButton extends HTMLElement {
|
|
|
419
447
|
}
|
|
420
448
|
|
|
421
449
|
_render() {
|
|
450
|
+
const needsAnchor = this.hasAttribute("href");
|
|
451
|
+
const isAnchor = this.button?.tagName === "A";
|
|
452
|
+
|
|
453
|
+
if (this.button && needsAnchor !== isAnchor) {
|
|
454
|
+
this.button.remove();
|
|
455
|
+
this.button = null;
|
|
456
|
+
}
|
|
457
|
+
|
|
422
458
|
if (!this.button) {
|
|
423
|
-
this.button =
|
|
459
|
+
this.button = needsAnchor
|
|
460
|
+
? document.createElement("a")
|
|
461
|
+
: document.createElement("button");
|
|
424
462
|
this.button.classList.add("button");
|
|
425
|
-
this.button.setAttribute("role", "button");
|
|
426
|
-
this.button.setAttribute("tabindex", "0");
|
|
427
463
|
this.button.setAttribute("part", "button");
|
|
464
|
+
if (!needsAnchor) {
|
|
465
|
+
this.button.setAttribute("role", "button");
|
|
466
|
+
this.button.setAttribute("tabindex", "0");
|
|
467
|
+
}
|
|
428
468
|
this.shadowRoot.appendChild(this.button);
|
|
429
469
|
}
|
|
430
470
|
|
|
431
471
|
this._updateButtonAttributes();
|
|
432
472
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
473
|
+
const disabled = this.hasAttribute("disabled");
|
|
474
|
+
if (needsAnchor) {
|
|
475
|
+
// <a> has no native disabled — manage via aria and href removal
|
|
476
|
+
if (disabled) {
|
|
477
|
+
this.button.removeAttribute("href");
|
|
478
|
+
this.button.setAttribute("aria-disabled", "true");
|
|
479
|
+
this.button.setAttribute("tabindex", "-1");
|
|
480
|
+
} else {
|
|
481
|
+
this.button.setAttribute("href", this.getAttribute("href"));
|
|
482
|
+
this.button.setAttribute("aria-disabled", "false");
|
|
483
|
+
this.button.removeAttribute("tabindex");
|
|
484
|
+
}
|
|
436
485
|
} else {
|
|
437
|
-
|
|
438
|
-
|
|
486
|
+
if (disabled) {
|
|
487
|
+
this.button.setAttribute("disabled", "");
|
|
488
|
+
this.button.setAttribute("aria-disabled", "true");
|
|
489
|
+
} else {
|
|
490
|
+
this.button.removeAttribute("disabled");
|
|
491
|
+
this.button.setAttribute("aria-disabled", "false");
|
|
492
|
+
}
|
|
439
493
|
}
|
|
440
494
|
|
|
441
495
|
this.button.innerHTML = `
|
|
@@ -450,9 +504,17 @@ class YumeButton extends HTMLElement {
|
|
|
450
504
|
}
|
|
451
505
|
|
|
452
506
|
_updateButtonAttributes() {
|
|
453
|
-
const
|
|
507
|
+
const isAnchor = this.button?.tagName === "A";
|
|
508
|
+
// These are only meaningful on <button>
|
|
509
|
+
const buttonOnlyAttrs = new Set(["type", "disabled", "name", "value", "autofocus", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget"]);
|
|
510
|
+
// These are only meaningful on <a>; href is managed separately in _render
|
|
511
|
+
const anchorOnlyAttrs = new Set(["href", "target", "rel"]);
|
|
512
|
+
|
|
513
|
+
YumeButton.observedAttributes.forEach((attr) => {
|
|
514
|
+
if (isAnchor && buttonOnlyAttrs.has(attr)) return;
|
|
515
|
+
if (isAnchor && attr === "href") return; // handled in _render (disabled-aware)
|
|
516
|
+
if (!isAnchor && anchorOnlyAttrs.has(attr)) return;
|
|
454
517
|
|
|
455
|
-
attributes.forEach((attr) => {
|
|
456
518
|
if (this.hasAttribute(attr)) {
|
|
457
519
|
this.button.setAttribute(attr, this.getAttribute(attr));
|
|
458
520
|
} else {
|
|
@@ -732,7 +794,7 @@ var menu = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill
|
|
|
732
794
|
|
|
733
795
|
class YumeMenu extends HTMLElement {
|
|
734
796
|
static get observedAttributes() {
|
|
735
|
-
return ["items", "anchor", "visible", "direction", "size"];
|
|
797
|
+
return ["items", "anchor", "visible", "direction", "size", "history"];
|
|
736
798
|
}
|
|
737
799
|
|
|
738
800
|
// -------------------------------------------------------------------------
|
|
@@ -760,6 +822,7 @@ class YumeMenu extends HTMLElement {
|
|
|
760
822
|
this.style.position = "fixed";
|
|
761
823
|
this.style.zIndex = "1000";
|
|
762
824
|
this.style.display = "none";
|
|
825
|
+
if (this.visible) this._updatePosition();
|
|
763
826
|
}
|
|
764
827
|
|
|
765
828
|
disconnectedCallback() {
|
|
@@ -809,6 +872,16 @@ class YumeMenu extends HTMLElement {
|
|
|
809
872
|
this.setAttribute("items", Array.isArray(val) ? JSON.stringify(val) : (val ?? "[]"));
|
|
810
873
|
}
|
|
811
874
|
|
|
875
|
+
/**
|
|
876
|
+
* Navigation mode: omit for pushState (SPA-friendly), set to "false" for full-page navigation.
|
|
877
|
+
* Regardless of this setting, a cancelable "navigate" event is always dispatched first.
|
|
878
|
+
*/
|
|
879
|
+
get history() { return this.getAttribute("history"); }
|
|
880
|
+
set history(val) {
|
|
881
|
+
if (val != null) this.setAttribute("history", val);
|
|
882
|
+
else this.removeAttribute("history");
|
|
883
|
+
}
|
|
884
|
+
|
|
812
885
|
/** Size: "small" | "medium" | "large" (default "medium"). */
|
|
813
886
|
get size() {
|
|
814
887
|
const sz = this.getAttribute("size");
|
|
@@ -961,7 +1034,20 @@ class YumeMenu extends HTMLElement {
|
|
|
961
1034
|
|
|
962
1035
|
if (item.url) {
|
|
963
1036
|
li.addEventListener("click", () => {
|
|
964
|
-
|
|
1037
|
+
const event = new CustomEvent("navigate", {
|
|
1038
|
+
bubbles: true,
|
|
1039
|
+
composed: true,
|
|
1040
|
+
cancelable: true,
|
|
1041
|
+
detail: { href: item.url },
|
|
1042
|
+
});
|
|
1043
|
+
const cancelled = !this.dispatchEvent(event);
|
|
1044
|
+
if (cancelled) return;
|
|
1045
|
+
if (this.getAttribute("history") !== "false") {
|
|
1046
|
+
history.pushState({}, "", item.url);
|
|
1047
|
+
window.dispatchEvent(new PopStateEvent("popstate", { state: {} }));
|
|
1048
|
+
} else {
|
|
1049
|
+
window.location.href = item.url;
|
|
1050
|
+
}
|
|
965
1051
|
});
|
|
966
1052
|
}
|
|
967
1053
|
|
|
@@ -1142,6 +1228,7 @@ class YumeAppbar extends HTMLElement {
|
|
|
1142
1228
|
"menu-direction",
|
|
1143
1229
|
"sticky",
|
|
1144
1230
|
"mobile-breakpoint",
|
|
1231
|
+
"history",
|
|
1145
1232
|
];
|
|
1146
1233
|
}
|
|
1147
1234
|
|
|
@@ -1228,6 +1315,16 @@ class YumeAppbar extends HTMLElement {
|
|
|
1228
1315
|
get size() { return this.getAttribute("size") || "medium"; }
|
|
1229
1316
|
set size(val) { this.setAttribute("size", val); }
|
|
1230
1317
|
|
|
1318
|
+
/**
|
|
1319
|
+
* Navigation mode: omit for pushState (SPA-friendly), set to "false" for full-page navigation.
|
|
1320
|
+
* Regardless of this setting, a cancelable "navigate" event is always dispatched first.
|
|
1321
|
+
*/
|
|
1322
|
+
get history() { return this.getAttribute("history"); }
|
|
1323
|
+
set history(val) {
|
|
1324
|
+
if (val != null) this.setAttribute("history", val);
|
|
1325
|
+
else this.removeAttribute("history");
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1231
1328
|
/** Sticky position: "start" | "end" | false. */
|
|
1232
1329
|
get sticky() {
|
|
1233
1330
|
const val = this.getAttribute("sticky");
|
|
@@ -1345,7 +1442,20 @@ class YumeAppbar extends HTMLElement {
|
|
|
1345
1442
|
|
|
1346
1443
|
if (item.href && !hasChildren) {
|
|
1347
1444
|
btn.addEventListener("click", () => {
|
|
1348
|
-
|
|
1445
|
+
const event = new CustomEvent("navigate", {
|
|
1446
|
+
bubbles: true,
|
|
1447
|
+
composed: true,
|
|
1448
|
+
cancelable: true,
|
|
1449
|
+
detail: { href: item.href },
|
|
1450
|
+
});
|
|
1451
|
+
const cancelled = !this.dispatchEvent(event);
|
|
1452
|
+
if (cancelled) return;
|
|
1453
|
+
if (this.getAttribute("history") !== "false") {
|
|
1454
|
+
history.pushState({}, "", item.href);
|
|
1455
|
+
window.dispatchEvent(new PopStateEvent("popstate", { state: {} }));
|
|
1456
|
+
} else {
|
|
1457
|
+
window.location.href = item.href;
|
|
1458
|
+
}
|
|
1349
1459
|
});
|
|
1350
1460
|
}
|
|
1351
1461
|
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let title: string;
|
|
3
|
+
let tags: string[];
|
|
4
|
+
namespace argTypes {
|
|
5
|
+
namespace alt {
|
|
6
|
+
let control: string;
|
|
7
|
+
let description: string;
|
|
8
|
+
namespace table {
|
|
9
|
+
namespace defaultValue {
|
|
10
|
+
let summary: string;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
namespace src {
|
|
15
|
+
let control_1: string;
|
|
16
|
+
export { control_1 as control };
|
|
17
|
+
let description_1: string;
|
|
18
|
+
export { description_1 as description };
|
|
19
|
+
}
|
|
20
|
+
namespace color {
|
|
21
|
+
let control_2: string;
|
|
22
|
+
export { control_2 as control };
|
|
23
|
+
export let options: string[];
|
|
24
|
+
let description_2: string;
|
|
25
|
+
export { description_2 as description };
|
|
26
|
+
export namespace table_1 {
|
|
27
|
+
export namespace defaultValue_1 {
|
|
28
|
+
let summary_1: string;
|
|
29
|
+
export { summary_1 as summary };
|
|
30
|
+
}
|
|
31
|
+
export { defaultValue_1 as defaultValue };
|
|
32
|
+
}
|
|
33
|
+
export { table_1 as table };
|
|
34
|
+
}
|
|
35
|
+
namespace size {
|
|
36
|
+
let control_3: string;
|
|
37
|
+
export { control_3 as control };
|
|
38
|
+
let options_1: string[];
|
|
39
|
+
export { options_1 as options };
|
|
40
|
+
let description_3: string;
|
|
41
|
+
export { description_3 as description };
|
|
42
|
+
export namespace table_2 {
|
|
43
|
+
export namespace defaultValue_2 {
|
|
44
|
+
let summary_2: string;
|
|
45
|
+
export { summary_2 as summary };
|
|
46
|
+
}
|
|
47
|
+
export { defaultValue_2 as defaultValue };
|
|
48
|
+
}
|
|
49
|
+
export { table_2 as table };
|
|
50
|
+
}
|
|
51
|
+
namespace shape {
|
|
52
|
+
let control_4: string;
|
|
53
|
+
export { control_4 as control };
|
|
54
|
+
let options_2: string[];
|
|
55
|
+
export { options_2 as options };
|
|
56
|
+
let description_4: string;
|
|
57
|
+
export { description_4 as description };
|
|
58
|
+
export namespace table_3 {
|
|
59
|
+
export namespace defaultValue_3 {
|
|
60
|
+
let summary_3: string;
|
|
61
|
+
export { summary_3 as summary };
|
|
62
|
+
}
|
|
63
|
+
export { defaultValue_3 as defaultValue };
|
|
64
|
+
}
|
|
65
|
+
export { table_3 as table };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
namespace args {
|
|
69
|
+
let alt_1: string;
|
|
70
|
+
export { alt_1 as alt };
|
|
71
|
+
let src_1: string;
|
|
72
|
+
export { src_1 as src };
|
|
73
|
+
let color_1: string;
|
|
74
|
+
export { color_1 as color };
|
|
75
|
+
let size_1: string;
|
|
76
|
+
export { size_1 as size };
|
|
77
|
+
let shape_1: string;
|
|
78
|
+
export { shape_1 as shape };
|
|
79
|
+
}
|
|
80
|
+
function render({ alt, src, color, size, shape }: {
|
|
81
|
+
alt: any;
|
|
82
|
+
src: any;
|
|
83
|
+
color: any;
|
|
84
|
+
size: any;
|
|
85
|
+
shape: any;
|
|
86
|
+
}): string;
|
|
87
|
+
}
|
|
88
|
+
export default _default;
|
|
89
|
+
export const Default: {};
|
|
90
|
+
export namespace WithImage {
|
|
91
|
+
export namespace args_1 {
|
|
92
|
+
let src_2: string;
|
|
93
|
+
export { src_2 as src };
|
|
94
|
+
let alt_2: string;
|
|
95
|
+
export { alt_2 as alt };
|
|
96
|
+
}
|
|
97
|
+
export { args_1 as args };
|
|
98
|
+
}
|
|
99
|
+
export namespace Initials {
|
|
100
|
+
export namespace args_2 {
|
|
101
|
+
let alt_3: string;
|
|
102
|
+
export { alt_3 as alt };
|
|
103
|
+
let src_3: string;
|
|
104
|
+
export { src_3 as src };
|
|
105
|
+
}
|
|
106
|
+
export { args_2 as args };
|
|
107
|
+
}
|
|
108
|
+
export namespace Colors {
|
|
109
|
+
export function render_1(): string;
|
|
110
|
+
export { render_1 as render };
|
|
111
|
+
}
|
|
112
|
+
export namespace Sizes {
|
|
113
|
+
export function render_2(): string;
|
|
114
|
+
export { render_2 as render };
|
|
115
|
+
}
|
|
116
|
+
export namespace Shapes {
|
|
117
|
+
export function render_3(): string;
|
|
118
|
+
export { render_3 as render };
|
|
119
|
+
}
|