@waggylabs/yumekit 0.4.3-beta.39 → 0.4.3-beta.41
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 +7 -0
- package/CONTRIBUTING.md +56 -0
- package/README.md +2 -1
- package/dist/components/y-breadcrumbs/y-breadcrumbs.d.ts +35 -0
- package/dist/components/y-breadcrumbs.d.ts +35 -0
- package/dist/components/y-breadcrumbs.js +636 -0
- package/dist/components/y-tabs/y-tabs.d.ts +6 -3
- package/dist/components/y-tabs.d.ts +6 -3
- package/dist/components/y-tabs.js +286 -42
- package/dist/components/y-theme.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9222 -7313
- package/dist/react.d.ts +7 -0
- package/dist/styles/variables.css +12 -0
- package/dist/yumekit.min.js +1 -1
- package/llm.txt +58 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -36,11 +36,18 @@ Delete any empty sections before publishing.
|
|
|
36
36
|
### Added
|
|
37
37
|
|
|
38
38
|
- New `y-stepper` component — a multi-step wizard that guides users through a sequential flow. Step content is provided via named slots defined in the `items` JSON array (`{ label, slot, description?, icon?, status? }`). Supports `current` (zero-based active step index), `orientation` (`"horizontal"` | `"vertical"`), `position` (`"start"` | `"end"` — controls whether indicators appear before or after the content), `size` (`"small"` | `"medium"` | `"large"`), `linear` (restricts free navigation), and `editable` (allows returning to completed steps). Methods: `next()`, `previous()`, `goTo(index)`, `complete(index?)`, `reset()`. Events: cancelable `change`, `complete`, `finish`. Full ARIA support with `role="list"`, `aria-current="step"`, `aria-controls`/`aria-labelledby` linkage, and keyboard navigation.
|
|
39
|
+
- New `y-breadcrumbs` component — a navigation breadcrumb trail. Accepts an `items` JSON array (`{ text, href?, icon? }`). Supports `separator` (custom separator character or slotted icon), `max-items` (collapses middle items with an expand button), `size` (`"small"` | `"medium"` | `"large"`), and `history` (set to `"false"` for full-page navigation instead of `pushState`). Fires cancelable `navigate` and `expand` events. Full ARIA with `<nav aria-label="Breadcrumb">`, `<ol>`, `aria-current="page"`, and `aria-hidden` separators.
|
|
39
40
|
- New `y-gallery` component — a media gallery that accepts `<img>` or `<figure>` children and arranges them in `grid`, `row`, `column`, or `masonry` layouts. Supports `columns`, `gap` (`"small"` | `"medium"` | `"large"` or any CSS length), `aspect-ratio`, `expandable` (lightbox with prev/next navigation), `loop`, and `size` attributes. The expanded view uses `<y-icon>` for nav arrows and supports `data-src` for full-resolution images, `<figcaption>` captions, and image counter. Icon slots (`expand-prev-icon`, `expand-next-icon`, `expand-close-icon`) allow custom icons. Fires `expand`, `close`, and `navigate` events.
|
|
40
41
|
- New `y-colorpicker` component — a standalone color picker widget with a 2D saturation/brightness canvas, hue slider, optional alpha slider, format selector, and channel inputs. Supports `value` (`#hex`, `rgb()`, `rgba()`, `hsl()`, `hsla()`, `hsv()`, `hsva()`), `format` (`"hex"` | `"rgb"` | `"hsl"` | `"hsv"`), `formats` (JSON array of available formats), `show-alpha` (alpha channel), and `size` attributes.
|
|
41
42
|
- New `y-color` component — a form-associated color input with a trigger/popup pattern (like `<y-date>`). Renders a color swatch preview and value string in the trigger; opens a `<y-colorpicker>` popup on click. Supports `value`, `format`, `formats`, `show-alpha`, `placeholder`, `name`, `disabled`, `invalid`, `clearable`, `size`, and `label-position` attributes. Uses `ElementInternals` for `FormData` participation.
|
|
42
43
|
- New `y-banner` component — a full-width informational banner that renders in a semantic color with matching text. Supports `color` (`"base"` | `"primary"` | `"secondary"` | `"success"` | `"error"` | `"warning"` | `"help"`), `icon` attribute (or `icon` slot), `position` (`"push"` | `"overlap"`), `sticky` (fixed to viewport when overlapping), `dismissable` close button, `size` (`"small"` | `"medium"` | `"large"`), and an `action` slot for CTA elements.
|
|
43
44
|
- New `y-stack` component — a layout container for arranging child elements in rows, columns, grids, or masonry patterns. Supports `mode` (`"flex"` | `"grid"` | `"masonry"`), `direction`, `columns`, `gap` (maps to `--spacing-*` tokens), `wrap`, `align`, `justify`, and `responsive` attributes. Masonry mode uses JS absolute positioning with `ResizeObserver`. Responsive mode auto-collapses columns at configurable breakpoints.
|
|
45
|
+
- `y-tabs`: `leftIcon` and `rightIcon` properties on option objects — set a `<y-icon>` name directly in the options JSON to render icons without requiring extra child elements or named slots.
|
|
46
|
+
- `y-tabs`: `tab-content-{id}` slot — place any content (icons, badges, custom markup) inside the tab button itself by targeting this slot. Takes full precedence over `leftIcon`/`rightIcon` and the default label rendering.
|
|
47
|
+
|
|
48
|
+
### Deprecated
|
|
49
|
+
|
|
50
|
+
- `y-tabs`: `left-icon-{id}` and `right-icon-{id}` slots — these slots still function but emit a `console.warn` directing users to the `leftIcon`/`rightIcon` option properties or the `tab-content-{id}` slot. They will be removed before the release of version 1.0.
|
|
44
51
|
|
|
45
52
|
## [0.4.2] - 2026-04-07
|
|
46
53
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -36,6 +36,62 @@ Yumekit is authored in plain JavaScript. Please follow the conventions already p
|
|
|
36
36
|
- Keep components self-contained: styles live in the Shadow DOM, logic in the class, no shared global state.
|
|
37
37
|
- Run the linter before submitting: `npm run lint`.
|
|
38
38
|
|
|
39
|
+
## Component Authoring Guidelines
|
|
40
|
+
|
|
41
|
+
### Class structure
|
|
42
|
+
|
|
43
|
+
Every component class must have exactly four comment-delimited sections in this order — no more, no subdivisions:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
// Lifecycle
|
|
47
|
+
// Getters / Setters
|
|
48
|
+
// Public
|
|
49
|
+
// Private
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Methods within their subdivision must be listed alphabetically.
|
|
53
|
+
|
|
54
|
+
### Method style
|
|
55
|
+
|
|
56
|
+
Follow a **define → compute → return/apply** flow within each method where possible: gather inputs and state at the top, do the work in the middle, produce output at the end. Keep methods small and focused — if a method grows long or does multiple distinct things, extract a named helper. Minimize nesting by preferring early returns over deep `if/else` trees. Separate distinct logical units of work with blank lines. This ruleset allows humans and AI to have a predictable and human-readable code structure upon which to base future updates.
|
|
57
|
+
|
|
58
|
+
### DOM element creation
|
|
59
|
+
|
|
60
|
+
Use the `createElement` helper (imported as `_el`) from `src/modules/helpers.js` for all element creation inside components. Do not use manual `document.createElement` + `setAttribute` chains.
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
import { createElement as _el } from "../../modules/helpers.js";
|
|
64
|
+
|
|
65
|
+
const btn = _el("button", { role: "tab", "aria-label": label }, [labelText]);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Icons
|
|
69
|
+
|
|
70
|
+
Use `<y-icon name="...">` for all icons. Never inline SVG strings or constants. Import `y-icon.js` at the top of any component that renders icons.
|
|
71
|
+
|
|
72
|
+
### Slot patterns
|
|
73
|
+
|
|
74
|
+
Always render named slots unconditionally and place default/fallback content as **children of the slot element**. Never use `querySelector` to decide whether to create a slot. This breaks framework rendering (React, Vue, etc.) where children may arrive after the element upgrades.
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
// Correct
|
|
78
|
+
const slot = _el("slot", { name: "icon" });
|
|
79
|
+
slot.appendChild(defaultIcon);
|
|
80
|
+
parent.appendChild(slot);
|
|
81
|
+
|
|
82
|
+
// Wrong — slot is conditional on a render-time DOM query
|
|
83
|
+
if (this.querySelector('[slot="icon"]')) { ... }
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### New component checklist
|
|
87
|
+
|
|
88
|
+
Every new component requireschanges to the following: `README.md`, `CHANGELOG.md`, `reference.md`, `SKILL.md`, `react.d.ts`, `variables.css`, `.figma/variables.json`, entry in `llm.txt`, and a `y-*.stories.js` stories file.
|
|
89
|
+
|
|
90
|
+
### Testing
|
|
91
|
+
|
|
92
|
+
- Tests co-locate with the component source file.
|
|
93
|
+
- Use `sinon.createSandbox()` at the `describe` level with `afterEach(() => sandbox.restore())`.
|
|
94
|
+
|
|
39
95
|
## AI Assistance
|
|
40
96
|
|
|
41
97
|
AI tools can be helpful for brainstorming and prototyping, but they are not a substitute for human judgment and expertise.
|
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
## Overview
|
|
19
19
|
|
|
20
|
-
YumeKit is a collection of
|
|
20
|
+
YumeKit is a collection of 34 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
|
|
@@ -78,6 +78,7 @@ Then use the `<y-theme>` component to apply a theme:
|
|
|
78
78
|
| App Bar | `<y-appbar>` | Top or side navigation bar |
|
|
79
79
|
| Avatar | `<y-avatar>` | User avatar with shape and color variants |
|
|
80
80
|
| Badge | `<y-badge>` | Status badge or label |
|
|
81
|
+
| Breadcrumbs | `<y-breadcrumbs>` | Navigation breadcrumb trail with collapse support |
|
|
81
82
|
| Button | `<y-button>` | Button with icon, size, and style variants |
|
|
82
83
|
| Button Group | `<y-button-group>` | Groups buttons (or inputs) into a connected toolbar |
|
|
83
84
|
| Card | `<y-card>` | Content card container |
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export class YumeBreadcrumbs extends HTMLElement {
|
|
2
|
+
static get observedAttributes(): string[];
|
|
3
|
+
_expanded: boolean;
|
|
4
|
+
connectedCallback(): void;
|
|
5
|
+
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
|
|
6
|
+
set history(val: string);
|
|
7
|
+
/** When omitted, navigation uses pushState. Set to "false" for full-page navigation. */
|
|
8
|
+
get history(): string;
|
|
9
|
+
set items(val: any);
|
|
10
|
+
/** Array of breadcrumb items. */
|
|
11
|
+
get items(): any;
|
|
12
|
+
set maxItems(val: number);
|
|
13
|
+
/** Maximum visible items before collapsing. */
|
|
14
|
+
get maxItems(): number;
|
|
15
|
+
set separator(val: string);
|
|
16
|
+
/** Text or character used as the separator. Defaults to a chevron-right icon when unset. */
|
|
17
|
+
get separator(): string;
|
|
18
|
+
set size(val: string);
|
|
19
|
+
/** Controls padding, font size, and icon size. */
|
|
20
|
+
get size(): string;
|
|
21
|
+
render(): void;
|
|
22
|
+
_buildExpandItem(): HTMLElement;
|
|
23
|
+
_buildHostStyles(): string;
|
|
24
|
+
_buildItem(item: any, index: any, items: any): HTMLElement;
|
|
25
|
+
_buildItemStyles(): string;
|
|
26
|
+
_buildSeparatorItem(): HTMLElement;
|
|
27
|
+
_buildSeparatorStyles(): string;
|
|
28
|
+
_buildStyles(): string;
|
|
29
|
+
_getDefaultFontSize(): any;
|
|
30
|
+
_getDefaultGap(): any;
|
|
31
|
+
_getIconSize(): any;
|
|
32
|
+
_getVisibleItems(items: any): any;
|
|
33
|
+
_onExpand(): void;
|
|
34
|
+
_onNavigate(e: any, href: any): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export class YumeBreadcrumbs extends HTMLElement {
|
|
2
|
+
static get observedAttributes(): string[];
|
|
3
|
+
_expanded: boolean;
|
|
4
|
+
connectedCallback(): void;
|
|
5
|
+
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
|
|
6
|
+
set history(val: string);
|
|
7
|
+
/** When omitted, navigation uses pushState. Set to "false" for full-page navigation. */
|
|
8
|
+
get history(): string;
|
|
9
|
+
set items(val: any);
|
|
10
|
+
/** Array of breadcrumb items. */
|
|
11
|
+
get items(): any;
|
|
12
|
+
set maxItems(val: number);
|
|
13
|
+
/** Maximum visible items before collapsing. */
|
|
14
|
+
get maxItems(): number;
|
|
15
|
+
set separator(val: string);
|
|
16
|
+
/** Text or character used as the separator. Defaults to a chevron-right icon when unset. */
|
|
17
|
+
get separator(): string;
|
|
18
|
+
set size(val: string);
|
|
19
|
+
/** Controls padding, font size, and icon size. */
|
|
20
|
+
get size(): string;
|
|
21
|
+
render(): void;
|
|
22
|
+
_buildExpandItem(): HTMLElement;
|
|
23
|
+
_buildHostStyles(): string;
|
|
24
|
+
_buildItem(item: any, index: any, items: any): HTMLElement;
|
|
25
|
+
_buildItemStyles(): string;
|
|
26
|
+
_buildSeparatorItem(): HTMLElement;
|
|
27
|
+
_buildSeparatorStyles(): string;
|
|
28
|
+
_buildStyles(): string;
|
|
29
|
+
_getDefaultFontSize(): any;
|
|
30
|
+
_getDefaultGap(): any;
|
|
31
|
+
_getIconSize(): any;
|
|
32
|
+
_getVisibleItems(items: any): any;
|
|
33
|
+
_onExpand(): void;
|
|
34
|
+
_onNavigate(e: any, href: any): void;
|
|
35
|
+
}
|