@vverchonov/web-components 0.1.3 → 0.1.5
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/dist/button-DQ0O2D-7.js +39 -0
- package/dist/button.js +4 -2
- package/dist/card-3IqRfmms.js +83 -0
- package/dist/card.js +4 -0
- package/dist/components/button/button-types.d.ts +4 -0
- package/dist/components/button/button.d.ts +13 -4
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/card/card-types.d.ts +7 -0
- package/dist/components/card/card.d.ts +26 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/dropdown-button/dropdown-button-types.d.ts +9 -1
- package/dist/components/dropdown-button/dropdown-button.d.ts +10 -0
- package/dist/components/input/input-types.d.ts +2 -0
- package/dist/components/input/input.d.ts +17 -0
- package/dist/components/layouts/form/form-layout-types.d.ts +2 -0
- package/dist/components/layouts/form/form-layout.d.ts +9 -5
- package/dist/components/layouts/page/layout.d.ts +5 -1
- package/dist/components/menu/menu-types.d.ts +12 -0
- package/dist/components/menu/menu.d.ts +15 -0
- package/dist/components/modal/modal-types.d.ts +2 -0
- package/dist/components/modal/modal.d.ts +7 -5
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/radio-group-types.d.ts +18 -0
- package/dist/components/radio-group/radio-group.d.ts +40 -0
- package/dist/components/selector/selector-types.d.ts +10 -1
- package/dist/components/selector/selector.d.ts +17 -0
- package/dist/components/table/table-types.d.ts +12 -0
- package/dist/components/table/table.d.ts +11 -0
- package/dist/components/tabs/tabs.d.ts +17 -0
- package/dist/components/toggle/toggle-types.d.ts +3 -0
- package/dist/components/toggle/toggle.d.ts +12 -3
- package/dist/{dropdown-button-B6XNoy4L.js → dropdown-button-B7Fq2mCT.js} +8 -2
- package/dist/dropdown-button.js +4 -2
- package/dist/{form-layout-DCX8X-8-.js → form-layout-C4YmJMfZ.js} +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/inject-theme-BJHnhQgY.js +8 -0
- package/dist/{input-BVlPYqTe.js → input-DNyTDs8C.js} +1 -1
- package/dist/input.js +4 -2
- package/dist/layouts.js +5 -3
- package/dist/{menu-DmAFaVi5.js → menu-Dx0eMU3U.js} +1 -1
- package/dist/menu.js +4 -2
- package/dist/{modal-v1GlqMF_.js → modal-DhA8aXSy.js} +1 -1
- package/dist/modal.js +4 -2
- package/dist/radio-group-rh17Z4Of.js +111 -0
- package/dist/radio-group.js +4 -0
- package/dist/react/button.js +1 -1
- package/dist/react/card.d.ts +6 -0
- package/dist/react/card.js +10 -0
- package/dist/react/dropdown-button.js +1 -1
- package/dist/react/form-layout.js +1 -1
- package/dist/react/index.d.ts +4 -0
- package/dist/react/input.js +1 -1
- package/dist/react/layout.js +1 -1
- package/dist/react/menu.js +1 -1
- package/dist/react/modal.js +1 -1
- package/dist/react/radio-group.d.ts +6 -0
- package/dist/react/radio-group.js +10 -0
- package/dist/react/selector.js +1 -1
- package/dist/react/table.js +1 -1
- package/dist/react/tabs.js +1 -1
- package/dist/react/toggle.js +1 -1
- package/dist/react.js +9 -7
- package/dist/{selector-Bl7Nbkqo.js → selector-B32NqDPk.js} +1 -1
- package/dist/selector.js +4 -2
- package/dist/styles/inject-theme.d.ts +1 -0
- package/dist/{table--O5km0Wv.js → table-AcQEI_eg.js} +1 -1
- package/dist/table.js +4 -2
- package/dist/tabs.js +4 -2
- package/dist/theme.css +186 -0
- package/dist/{toggle-D6UMZ8UZ.js → toggle--vvYf4Md.js} +1 -1
- package/dist/toggle.js +4 -2
- package/dist/web-components.js +18 -14
- package/package.json +5 -3
- package/dist/button-DYrT530y.js +0 -39
- /package/dist/{layout-CYvgu_WE.js → layout-BsVF8Au9.js} +0 -0
- /package/dist/{tabs-C2lP0uxY.js → tabs-Ds0Hee2h.js} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LitElement as e, html as t, unsafeCSS as n } from "lit";
|
|
2
|
+
import { customElement as r, property as i } from "lit/decorators.js";
|
|
3
|
+
var a = ":host{display:inline-block}button{margin:var(--button-margin-block) var(--button-margin-inline);padding:var(--button-padding-block) var(--button-padding-inline);font-size:var(--button-font-size);font-weight:var(--button-font-weight);border-radius:var(--radius-button);cursor:pointer;transition:background-color var(--button-transition-duration) var(--ease-emphasized), border-color var(--button-transition-duration) var(--ease-emphasized), color var(--button-transition-duration) var(--ease-emphasized);border:none;align-items:center;display:inline-flex}button:has(.icon-wrapper:has(*)){gap:var(--button-icon-gap)}button .icon-wrapper{align-items:center;display:inline-flex}button .icon-wrapper:not(:has(*)){display:none}button.icon-start .icon-wrapper{order:0}button.icon-start .label{order:1}button.icon-end .label{order:0}button.icon-end .icon-wrapper{order:1}button.variant-primary{background:var(--color-primary);color:var(--color-text-inverse)}button.variant-primary:hover{background:var(--color-primary-hover)}button.variant-secondary{color:var(--color-primary);border:2px solid var(--color-primary);background:0 0}button.variant-secondary:hover{background:var(--color-primary-muted)}button.variant-ghost{color:var(--color-primary);background:0 0;border:none}button.variant-ghost:hover{background:var(--color-primary-muted)}button.variant-danger{background:var(--color-invalid);color:var(--color-text-inverse);border:none}button.variant-danger:hover{background:var(--color-invalid-hover)}button:focus{outline:none}button:focus-visible{outline:var(--button-focus-ring-width) solid var(--color-primary);outline-offset:var(--button-focus-ring-offset)}";
|
|
4
|
+
function o(e, t, n, r) {
|
|
5
|
+
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
6
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
7
|
+
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
8
|
+
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
9
|
+
}
|
|
10
|
+
var s = class extends e {
|
|
11
|
+
static {
|
|
12
|
+
this.styles = [n(a)];
|
|
13
|
+
}
|
|
14
|
+
_handleClick(e) {
|
|
15
|
+
this.onClick?.(e);
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
return t`
|
|
19
|
+
<button
|
|
20
|
+
type=${this.type}
|
|
21
|
+
class="icon-${this.iconPosition} variant-${this.variant}"
|
|
22
|
+
@click=${this._handleClick}
|
|
23
|
+
>
|
|
24
|
+
<span class="icon-wrapper">
|
|
25
|
+
<slot name="icon"></slot>
|
|
26
|
+
</span>
|
|
27
|
+
<span class="label">${this.label}</span>
|
|
28
|
+
</button>
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
constructor(...e) {
|
|
32
|
+
super(...e), this.label = "Click me", this.iconPosition = "start", this.type = "button", this.variant = "primary";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
o([i({ type: String })], s.prototype, "label", void 0), o([i({
|
|
36
|
+
type: String,
|
|
37
|
+
attribute: "icon-position"
|
|
38
|
+
})], s.prototype, "iconPosition", void 0), o([i({ type: String })], s.prototype, "type", void 0), o([i({ type: String })], s.prototype, "variant", void 0), o([i({ attribute: !1 })], s.prototype, "onClick", void 0), s = o([r("app-button")], s);
|
|
39
|
+
export { s as t };
|
package/dist/button.js
CHANGED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { LitElement as e, html as t, nothing as n, unsafeCSS as r } from "lit";
|
|
2
|
+
import { customElement as i, property as a } from "lit/decorators.js";
|
|
3
|
+
var o = ":host{display:block}.card{border-radius:var(--radius-card);color:var(--color-text);transition:box-shadow var(--card-transition-duration) var(--ease-emphasized), border-color var(--card-transition-duration) var(--ease-emphasized), background-color var(--card-transition-duration) var(--ease-emphasized);overflow:hidden}.card.variant-elevated{background:var(--color-surface);box-shadow:0 1px 3px oklch(0% 0 0/.1),0 1px 2px -1px oklch(0% 0 0/.1)}.card.variant-outlined{background:var(--color-surface);border:1px solid var(--color-border)}.card.variant-filled{background:var(--color-surface-elevated)}.card.clickable{cursor:pointer}.card.clickable:hover.variant-elevated{box-shadow:0 4px 6px -1px oklch(0% 0 0/.1),0 2px 4px -2px oklch(0% 0 0/.1)}.card.clickable:hover.variant-outlined{border-color:var(--color-border-strong)}.card.clickable:hover.variant-filled{background:var(--color-border)}.card.clickable:active{transform:scale(.99)}.header{padding:var(--card-padding);justify-content:space-between;align-items:center;gap:var(--card-gap);cursor:pointer;user-select:none;text-align:start;width:100%;font:inherit;color:inherit;background:0 0;border:none;display:flex}.header:focus{outline:none}.header:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px;border-radius:var(--radius-card)}.header-content{flex:1;min-width:0}.chevron{width:1.25rem;height:1.25rem;color:var(--color-text-muted);transition:transform var(--card-transition-duration) var(--ease-emphasized);flex-shrink:0}.chevron.rotated{transform:rotate(180deg)}.body-wrapper{transition:grid-template-rows var(--card-transition-duration) var(--ease-emphasized);grid-template-rows:0fr;display:grid}.body-wrapper.open{grid-template-rows:1fr}.body-inner{overflow:hidden}.body,.footer{padding:0 var(--card-padding) var(--card-padding)}.sr-only{clip:rect(0 0 0 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}";
|
|
4
|
+
function s(e, t, n, r) {
|
|
5
|
+
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
6
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
7
|
+
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
8
|
+
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
9
|
+
}
|
|
10
|
+
var c = class extends e {
|
|
11
|
+
static {
|
|
12
|
+
this.styles = [r(o)];
|
|
13
|
+
}
|
|
14
|
+
_toggle() {
|
|
15
|
+
this.open = !this.open, this.dispatchEvent(new CustomEvent("card-toggle", {
|
|
16
|
+
detail: { open: this.open },
|
|
17
|
+
bubbles: !0,
|
|
18
|
+
composed: !0
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
_handleCardClick(e) {
|
|
22
|
+
this.clickable && this.onClick?.(e);
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
return t`
|
|
26
|
+
<div
|
|
27
|
+
class=${[
|
|
28
|
+
"card",
|
|
29
|
+
`variant-${this.variant}`,
|
|
30
|
+
this.clickable ? "clickable" : ""
|
|
31
|
+
].filter(Boolean).join(" ")}
|
|
32
|
+
@click=${this._handleCardClick}
|
|
33
|
+
role=${this.clickable ? "button" : n}
|
|
34
|
+
tabindex=${this.clickable ? "0" : n}
|
|
35
|
+
>
|
|
36
|
+
<button
|
|
37
|
+
class="header"
|
|
38
|
+
type="button"
|
|
39
|
+
aria-expanded=${this.open}
|
|
40
|
+
@click=${(e) => {
|
|
41
|
+
e.stopPropagation(), this._toggle();
|
|
42
|
+
}}
|
|
43
|
+
>
|
|
44
|
+
<span class="header-content">
|
|
45
|
+
<slot name="title"></slot>
|
|
46
|
+
</span>
|
|
47
|
+
<svg
|
|
48
|
+
class="chevron ${this.open ? "rotated" : ""}"
|
|
49
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
50
|
+
viewBox="0 0 24 24"
|
|
51
|
+
fill="none"
|
|
52
|
+
stroke="currentColor"
|
|
53
|
+
stroke-width="2"
|
|
54
|
+
stroke-linecap="round"
|
|
55
|
+
stroke-linejoin="round"
|
|
56
|
+
aria-hidden="true"
|
|
57
|
+
>
|
|
58
|
+
<polyline points="6 9 12 15 18 9"></polyline>
|
|
59
|
+
</svg>
|
|
60
|
+
</button>
|
|
61
|
+
|
|
62
|
+
<div class="body-wrapper ${this.open ? "open" : ""}">
|
|
63
|
+
<div class="body-inner">
|
|
64
|
+
<div class="body">
|
|
65
|
+
<slot></slot>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="footer">
|
|
68
|
+
<slot name="footer"></slot>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
`;
|
|
74
|
+
}
|
|
75
|
+
constructor(...e) {
|
|
76
|
+
super(...e), this.variant = "elevated", this.open = !0, this.clickable = !1;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
s([a({ type: String })], c.prototype, "variant", void 0), s([a({
|
|
80
|
+
type: Boolean,
|
|
81
|
+
reflect: !0
|
|
82
|
+
})], c.prototype, "open", void 0), s([a({ type: Boolean })], c.prototype, "clickable", void 0), s([a({ attribute: !1 })], c.prototype, "onClick", void 0), c = s([i("app-card")], c);
|
|
83
|
+
export { c as t };
|
package/dist/card.js
ADDED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
/** Icon placement relative to the button label. */
|
|
1
2
|
export type ButtonIconPosition = 'start' | 'end';
|
|
3
|
+
/** HTML button type attribute values. */
|
|
2
4
|
export type ButtonType = 'button' | 'submit' | 'reset';
|
|
5
|
+
/** Visual style variant for `<app-button>`. */
|
|
6
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import { ButtonIconPosition, ButtonType } from './button-types.ts';
|
|
3
|
-
/**
|
|
2
|
+
import { ButtonIconPosition, ButtonType, ButtonVariant } from './button-types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* General-purpose button with label, optional icon slot, and visual variants.
|
|
5
|
+
*
|
|
6
|
+
* @tag app-button
|
|
7
|
+
* @slot icon - Optional icon rendered before or after the label (controlled by `icon-position`).
|
|
8
|
+
*/
|
|
4
9
|
export declare class Button extends LitElement {
|
|
5
10
|
static styles: import('lit').CSSResult[];
|
|
11
|
+
/** Visible button text. */
|
|
6
12
|
label: string;
|
|
7
|
-
/** Where to show the icon: before the label (start) or after (end). */
|
|
13
|
+
/** Where to show the icon: before the label (start) or after (end) (attribute: `icon-position`). */
|
|
8
14
|
iconPosition: ButtonIconPosition;
|
|
15
|
+
/** HTML button type attribute. */
|
|
9
16
|
type: ButtonType;
|
|
10
|
-
/**
|
|
17
|
+
/** Visual style variant. */
|
|
18
|
+
variant: ButtonVariant;
|
|
19
|
+
/** Optional click callback. Set via property (e.g. `el.onClick = (e) => ...`). */
|
|
11
20
|
onClick?: (e: MouseEvent) => void;
|
|
12
21
|
private _handleClick;
|
|
13
22
|
render(): import('lit-html').TemplateResult<1>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Button } from './button.ts';
|
|
2
|
-
export type { ButtonIconPosition, ButtonType } from './button-types.ts';
|
|
2
|
+
export type { ButtonIconPosition, ButtonType, ButtonVariant } from './button-types.ts';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Visual style variant for `<app-card>`. */
|
|
2
|
+
export type CardVariant = 'elevated' | 'outlined' | 'filled';
|
|
3
|
+
/** Detail payload for the `card-toggle` custom event. */
|
|
4
|
+
export interface CardToggleEventDetail {
|
|
5
|
+
/** Whether the card body is now visible. */
|
|
6
|
+
open: boolean;
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { CardVariant } from './card-types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Collapsible card with title, body, and footer slots, three visual variants,
|
|
5
|
+
* and optional click interaction.
|
|
6
|
+
*
|
|
7
|
+
* @tag app-card
|
|
8
|
+
* @slot title - Header content, always visible. Clicking toggles the body open/closed.
|
|
9
|
+
* @slot - Default slot for the card body content (hidden when collapsed).
|
|
10
|
+
* @slot footer - Bottom actions area (hidden when collapsed).
|
|
11
|
+
* @fires card-toggle - Fires when the card is toggled open or closed. Detail: `{ open: boolean }`.
|
|
12
|
+
*/
|
|
13
|
+
export declare class Card extends LitElement {
|
|
14
|
+
static styles: import('lit').CSSResult[];
|
|
15
|
+
/** Visual style variant. */
|
|
16
|
+
variant: CardVariant;
|
|
17
|
+
/** Whether the card body is expanded. */
|
|
18
|
+
open: boolean;
|
|
19
|
+
/** Enables hover/active effects and click handling on the card. */
|
|
20
|
+
clickable: boolean;
|
|
21
|
+
/** Optional click callback. Set via property (e.g. `el.onClick = (e) => ...`). */
|
|
22
|
+
onClick?: (e: MouseEvent) => void;
|
|
23
|
+
private _toggle;
|
|
24
|
+
private _handleCardClick;
|
|
25
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
26
|
+
}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
|
+
/** Direction the dropdown panel opens relative to the trigger. */
|
|
2
3
|
export type DropdownPlacement = 'bottom' | 'top';
|
|
4
|
+
/** A single item (or parent of nested items) in a dropdown menu. */
|
|
3
5
|
export interface DropdownItem {
|
|
6
|
+
/** Visible label text. */
|
|
4
7
|
label: string;
|
|
8
|
+
/** Value emitted in the `dropdown-select` event. */
|
|
5
9
|
value?: string;
|
|
6
|
-
/**
|
|
10
|
+
/** Per-item icon: a slot name string or an inline Lit TemplateResult. */
|
|
7
11
|
icon?: string | TemplateResult;
|
|
12
|
+
/** Nested child items; renders an inline sub-menu when present. */
|
|
8
13
|
children?: DropdownItem[];
|
|
9
14
|
}
|
|
15
|
+
/** Detail payload for the `dropdown-select` custom event. */
|
|
10
16
|
export interface DropdownSelectEventDetail {
|
|
17
|
+
/** The selected item object. */
|
|
11
18
|
item: DropdownItem;
|
|
19
|
+
/** Shorthand for `item.value`. */
|
|
12
20
|
value?: string;
|
|
13
21
|
}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
import { DropdownItem, DropdownPlacement } from './dropdown-button-types';
|
|
3
|
+
/**
|
|
4
|
+
* Button that opens a dropdown menu with nested sub-menu support.
|
|
5
|
+
*
|
|
6
|
+
* @tag app-dropdown-button
|
|
7
|
+
* @slot icon - Optional icon shown in the trigger button.
|
|
8
|
+
* @fires dropdown-select - Fired when a leaf item is selected. Detail: `{ item, value }`.
|
|
9
|
+
*/
|
|
3
10
|
export declare class DropdownButton extends LitElement {
|
|
4
11
|
static styles: import('lit').CSSResult[];
|
|
12
|
+
/** Text label displayed in the trigger button. */
|
|
5
13
|
label: string;
|
|
14
|
+
/** Preferred direction for the dropdown panel. Auto-flips when insufficient viewport space. */
|
|
6
15
|
placement: DropdownPlacement;
|
|
16
|
+
/** Menu items (supports nested `children` for sub-menus). */
|
|
7
17
|
items: DropdownItem[];
|
|
8
18
|
private _open;
|
|
9
19
|
/**
|
|
@@ -1,18 +1,35 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { InputType, InputState } from './input-types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Text input with optional label, leading icon slot, and validation state.
|
|
5
|
+
*
|
|
6
|
+
* @tag app-input
|
|
7
|
+
* @slot icon - Optional leading icon displayed before the input field.
|
|
8
|
+
*/
|
|
3
9
|
export declare class Input extends LitElement {
|
|
4
10
|
static styles: import('lit').CSSResult[];
|
|
5
11
|
private readonly _uid;
|
|
12
|
+
/** HTML input type. */
|
|
6
13
|
type: InputType;
|
|
14
|
+
/** Visible label rendered above the input. */
|
|
7
15
|
label: string;
|
|
16
|
+
/** Placeholder text shown when the input is empty. */
|
|
8
17
|
placeholder: string;
|
|
18
|
+
/** Current input value (two-way: updates on user input). */
|
|
9
19
|
value: string;
|
|
20
|
+
/** Form field name submitted with the value. */
|
|
10
21
|
name: string;
|
|
22
|
+
/** Marks the input as required for form validation. */
|
|
11
23
|
required: boolean;
|
|
24
|
+
/** Disables the input and prevents interaction. */
|
|
12
25
|
disabled: boolean;
|
|
26
|
+
/** Makes the input read-only (focusable but not editable). */
|
|
13
27
|
readonly: boolean;
|
|
28
|
+
/** Validation state controlling visual feedback and ARIA. */
|
|
14
29
|
state: InputState;
|
|
30
|
+
/** Error text displayed below the input when `state` is `'invalid'` (attribute: `error-message`). */
|
|
15
31
|
errorMessage: string;
|
|
32
|
+
/** Callback invoked with the new value string on every input event. Set via property. */
|
|
16
33
|
onChange?: (value: string) => void;
|
|
17
34
|
private _hasIcon;
|
|
18
35
|
private _onIconSlotChange;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Configurable form shell with optional multi-step stages.
|
|
4
4
|
*
|
|
5
5
|
* Single-step usage:
|
|
6
6
|
* <app-form-layout title="Create account" description="Fill in the details below." columns="2">
|
|
@@ -15,14 +15,18 @@ import { LitElement } from 'lit';
|
|
|
15
15
|
* <div slot="stage-2">…step 3 fields…</div>
|
|
16
16
|
* </app-form-layout>
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* @tag app-form-layout
|
|
19
|
+
* @slot fields - Form fields for single-step mode.
|
|
20
|
+
* @slot stage-{index} - Form fields for each stage in multi-step mode.
|
|
21
|
+
* @fires form-layout-next - Fired when moving to the next stage. Detail: `{ stage }`.
|
|
22
|
+
* @fires form-layout-back - Fired when moving to the previous stage. Detail: `{ stage }`.
|
|
23
|
+
* @fires form-layout-submit - Fired when the submit button is clicked. Detail: `{ stage }`.
|
|
22
24
|
*/
|
|
23
25
|
export declare class FormLayout extends LitElement {
|
|
24
26
|
static styles: import('lit').CSSResult[];
|
|
27
|
+
/** Form heading displayed at the top. */
|
|
25
28
|
title: string;
|
|
29
|
+
/** Subtitle text shown below the title. */
|
|
26
30
|
description: string;
|
|
27
31
|
/** Number of columns for the fields grid. */
|
|
28
32
|
columns: 1 | 2 | 3;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Two-column shell with a sticky sidebar and a scrollable content area.
|
|
4
4
|
*
|
|
5
5
|
* No Shadow DOM: styles are injected once into document.head and target
|
|
6
6
|
* `app-layout > [slot="sidebar"]` / `app-layout > [slot="content"]` directly.
|
|
@@ -14,6 +14,10 @@ import { LitElement } from 'lit';
|
|
|
14
14
|
* The sidebar width is fixed to --menu-collapsed-width (default 3.5rem).
|
|
15
15
|
* When the menu expands on hover it overlays the content via overflow:visible
|
|
16
16
|
* on the sidebar — the content area never moves.
|
|
17
|
+
*
|
|
18
|
+
* @tag app-layout
|
|
19
|
+
* @slot sidebar - Fixed sidebar area (typically `<app-menu collapsed>`).
|
|
20
|
+
* @slot content - Main scrollable content area.
|
|
17
21
|
*/
|
|
18
22
|
export declare class Layout extends LitElement {
|
|
19
23
|
createRenderRoot(): HTMLElement;
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
|
+
/** A single navigation item (or parent of nested items) in `<app-menu>`. */
|
|
2
3
|
export interface MenuItem {
|
|
4
|
+
/** Visible label text. */
|
|
3
5
|
label: string;
|
|
6
|
+
/** Unique value emitted in the `menu-select` event. */
|
|
4
7
|
value?: string;
|
|
8
|
+
/** Per-item icon: a slot name string or an inline Lit TemplateResult. */
|
|
5
9
|
icon?: string | TemplateResult;
|
|
10
|
+
/** When set, the item renders as an `<a>` link instead of a `<button>`. */
|
|
6
11
|
href?: string;
|
|
12
|
+
/** @deprecated Use `activeValue` on the component instead. */
|
|
7
13
|
active?: boolean;
|
|
14
|
+
/** Nested child items; renders an expandable sub-menu when present. */
|
|
8
15
|
children?: MenuItem[];
|
|
9
16
|
}
|
|
17
|
+
/** Detail payload for the `menu-select` custom event. */
|
|
10
18
|
export interface MenuSelectEventDetail {
|
|
19
|
+
/** The selected item object. */
|
|
11
20
|
item: MenuItem;
|
|
21
|
+
/** Shorthand for `item.value`. */
|
|
12
22
|
value: string | undefined;
|
|
13
23
|
}
|
|
24
|
+
/** Detail payload for the `menu-search` custom event. */
|
|
14
25
|
export interface MenuSearchEventDetail {
|
|
26
|
+
/** Current search query string. */
|
|
15
27
|
query: string;
|
|
16
28
|
}
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
import { MenuItem } from './menu-types';
|
|
3
|
+
/**
|
|
4
|
+
* Sidebar navigation menu with nested items, search, and collapsible mode.
|
|
5
|
+
*
|
|
6
|
+
* @tag app-menu
|
|
7
|
+
* @slot logo - Full-width logo shown when the menu is expanded.
|
|
8
|
+
* @slot logo-icon - Compact logo/icon shown when the menu is collapsed.
|
|
9
|
+
* @slot bottom - Content rendered at the bottom of the sidebar (e.g. user profile).
|
|
10
|
+
* @fires menu-select - Fired when a leaf menu item is clicked. Detail: `{ item, value }`.
|
|
11
|
+
* @fires menu-search - Fired on search input. Detail: `{ query }`.
|
|
12
|
+
*/
|
|
3
13
|
export declare class Menu extends LitElement {
|
|
4
14
|
static styles: import('lit').CSSResult[];
|
|
15
|
+
/** Primary navigation items rendered in the main section. */
|
|
5
16
|
items: MenuItem[];
|
|
17
|
+
/** Secondary items rendered in the footer section below the main items. */
|
|
6
18
|
footerItems: MenuItem[];
|
|
19
|
+
/** Enables the search input above the navigation items. */
|
|
7
20
|
searchable: boolean;
|
|
21
|
+
/** Placeholder text for the search input. */
|
|
8
22
|
searchPlaceholder: string;
|
|
23
|
+
/** Value of the currently active item; highlights the matching item and auto-expands its parents. */
|
|
9
24
|
activeValue?: string;
|
|
10
25
|
/**
|
|
11
26
|
* When true the menu renders in semi-open (icon-only) mode by default.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { ModalVariant, ModalSize } from './modal-types.ts';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Configurable dialog for info, confirm, form, and custom use-cases.
|
|
5
5
|
*
|
|
6
6
|
* Info (single OK button):
|
|
7
7
|
* <app-modal open title="Note" description="Saved." variant="info"></app-modal>
|
|
@@ -28,10 +28,12 @@ import { ModalVariant, ModalSize } from './modal-types.ts';
|
|
|
28
28
|
* <app-form-layout seamless .stages=${[…]}>…</app-form-layout>
|
|
29
29
|
* </app-modal>
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
31
|
+
* @tag app-modal
|
|
32
|
+
* @slot - Default slot for body content.
|
|
33
|
+
* @slot footer - Custom footer that replaces the built-in action buttons.
|
|
34
|
+
* @fires modal-confirm - Primary action (Save / Confirm / OK) clicked.
|
|
35
|
+
* @fires modal-cancel - Secondary action (Cancel) clicked.
|
|
36
|
+
* @fires modal-close - Any close action (Escape, backdrop, OK, Confirm, Cancel).
|
|
35
37
|
*/
|
|
36
38
|
export declare class Modal extends LitElement {
|
|
37
39
|
static styles: import('lit').CSSResult[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Layout direction for `<app-radio-group>`. */
|
|
2
|
+
export type RadioGroupOrientation = 'vertical' | 'horizontal';
|
|
3
|
+
/** Visual validation state for `<app-radio-group>`. */
|
|
4
|
+
export type RadioGroupState = 'default' | 'valid' | 'invalid';
|
|
5
|
+
/** A single option in `<app-radio-group>`. */
|
|
6
|
+
export interface RadioGroupItem {
|
|
7
|
+
/** Visible label text. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Unique value identifying this option. */
|
|
10
|
+
value: string;
|
|
11
|
+
/** When true the option cannot be selected. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Detail payload for the `radio-change` custom event. */
|
|
15
|
+
export interface RadioGroupChangeEventDetail {
|
|
16
|
+
/** The newly selected value. */
|
|
17
|
+
value: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { RadioGroupItem, RadioGroupOrientation, RadioGroupState, RadioGroupChangeEventDetail } from './radio-group-types';
|
|
3
|
+
/**
|
|
4
|
+
* Radio group for single-option selection with keyboard navigation and validation.
|
|
5
|
+
*
|
|
6
|
+
* @tag app-radio-group
|
|
7
|
+
* @fires radio-change - Fired when the selected option changes. Detail: `{ value: string }`.
|
|
8
|
+
*/
|
|
9
|
+
export declare class RadioGroup extends LitElement {
|
|
10
|
+
static styles: import('lit').CSSResult[];
|
|
11
|
+
private readonly _uid;
|
|
12
|
+
/** Array of selectable radio options. */
|
|
13
|
+
items: RadioGroupItem[];
|
|
14
|
+
/** Currently selected value. */
|
|
15
|
+
value: string;
|
|
16
|
+
/** Visible label rendered above the radio options. */
|
|
17
|
+
label: string;
|
|
18
|
+
/** Form field name. */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Disables the entire group. */
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
/** Layout direction: vertical (default) or horizontal. */
|
|
23
|
+
orientation: RadioGroupOrientation;
|
|
24
|
+
/** Validation state controlling visual feedback and ARIA. */
|
|
25
|
+
state: RadioGroupState;
|
|
26
|
+
/** Error text displayed below the group when `state` is `'invalid'` (attribute: `error-message`). */
|
|
27
|
+
errorMessage: string;
|
|
28
|
+
/** Optional callback invoked with the `radio-change` custom event. Set via property. */
|
|
29
|
+
onChange?: (e: CustomEvent<RadioGroupChangeEventDetail>) => void;
|
|
30
|
+
private _focusedIndex;
|
|
31
|
+
private get _enabledItems();
|
|
32
|
+
private _select;
|
|
33
|
+
private _onRadioClick;
|
|
34
|
+
private _onKeydown;
|
|
35
|
+
private _enabledIndexFromAbsolute;
|
|
36
|
+
private _focusOption;
|
|
37
|
+
private _onFocus;
|
|
38
|
+
private _getInitialTabIndex;
|
|
39
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
40
|
+
}
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
|
+
/** Visual validation state for `<app-selector>`. */
|
|
2
3
|
export type SelectorState = 'default' | 'valid' | 'invalid';
|
|
4
|
+
/** A single option in `<app-selector>`. */
|
|
3
5
|
export interface SelectorOption {
|
|
6
|
+
/** Visible label text. */
|
|
4
7
|
label: string;
|
|
8
|
+
/** Unique value identifying this option. */
|
|
5
9
|
value: string;
|
|
6
|
-
/**
|
|
10
|
+
/** Per-item icon: a slot name string or an inline Lit TemplateResult. */
|
|
7
11
|
icon?: string | TemplateResult;
|
|
12
|
+
/** When true the option cannot be selected. */
|
|
8
13
|
disabled?: boolean;
|
|
9
14
|
/** Group key — matches `SelectorGroup.key` for visual grouping. */
|
|
10
15
|
group?: string;
|
|
11
16
|
}
|
|
17
|
+
/** Defines a named group for visually grouping selector options. */
|
|
12
18
|
export interface SelectorGroup {
|
|
19
|
+
/** Unique group identifier referenced by `SelectorOption.group`. */
|
|
13
20
|
key: string;
|
|
21
|
+
/** Visible group header label. */
|
|
14
22
|
label: string;
|
|
15
23
|
}
|
|
24
|
+
/** Detail payload for the `selector-change` custom event. */
|
|
16
25
|
export interface SelectorChangeEventDetail {
|
|
17
26
|
/** Selected values. Always an array (single-select wraps in a one-element array). */
|
|
18
27
|
value: string[];
|
|
@@ -1,18 +1,35 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { SelectorOption, SelectorGroup, SelectorState } from './selector-types';
|
|
3
|
+
/**
|
|
4
|
+
* Dropdown selector (single or multi-select) with search, groups, and validation.
|
|
5
|
+
*
|
|
6
|
+
* @tag app-selector
|
|
7
|
+
* @fires selector-change - Fired when the selection changes. Detail: `{ value: string[] }`.
|
|
8
|
+
*/
|
|
3
9
|
export declare class Selector extends LitElement {
|
|
4
10
|
static styles: import('lit').CSSResult[];
|
|
5
11
|
private readonly _uid;
|
|
12
|
+
/** Flat list of selectable options. */
|
|
6
13
|
items: SelectorOption[];
|
|
14
|
+
/** Optional group definitions for visually grouping options. */
|
|
7
15
|
groups: SelectorGroup[];
|
|
16
|
+
/** Currently selected values (always an array, even in single-select mode). */
|
|
8
17
|
value: string[];
|
|
18
|
+
/** Visible label rendered above the trigger. */
|
|
9
19
|
label: string;
|
|
20
|
+
/** Placeholder text shown when nothing is selected. */
|
|
10
21
|
placeholder: string;
|
|
22
|
+
/** Enables a text search input inside the dropdown panel. */
|
|
11
23
|
searchable: boolean;
|
|
24
|
+
/** Allows selecting more than one option at a time. */
|
|
12
25
|
multiple: boolean;
|
|
26
|
+
/** Disables the selector and prevents interaction. */
|
|
13
27
|
disabled: boolean;
|
|
28
|
+
/** Form field name submitted with the value. */
|
|
14
29
|
name: string;
|
|
30
|
+
/** Validation state controlling visual feedback and ARIA. */
|
|
15
31
|
state: SelectorState;
|
|
32
|
+
/** Error text displayed below the selector when `state` is `'invalid'` (attribute: `error-message`). */
|
|
16
33
|
errorMessage: string;
|
|
17
34
|
private _open;
|
|
18
35
|
private _search;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
|
+
/** Describes a single column in `<app-table>`. */
|
|
2
3
|
export interface ColumnDef<T = Record<string, unknown>> {
|
|
3
4
|
/** Unique key — matched against row object properties for default text rendering. */
|
|
4
5
|
key: string;
|
|
@@ -19,17 +20,28 @@ export interface ColumnDef<T = Record<string, unknown>> {
|
|
|
19
20
|
*/
|
|
20
21
|
renderCell?: (row: T, rowIndex: number) => TemplateResult | unknown;
|
|
21
22
|
}
|
|
23
|
+
/** Sort direction for a table column. */
|
|
22
24
|
export type SortDir = 'asc' | 'desc';
|
|
25
|
+
/** Detail payload for the `table-sort` custom event. */
|
|
23
26
|
export interface TableSortEvent {
|
|
27
|
+
/** Key of the column being sorted. */
|
|
24
28
|
column: string;
|
|
29
|
+
/** Current sort direction. */
|
|
25
30
|
dir: SortDir;
|
|
31
|
+
/** Active page size (useful when re-fetching server data). */
|
|
26
32
|
pageSize: number;
|
|
27
33
|
}
|
|
34
|
+
/** Detail payload for the `table-page` custom event. */
|
|
28
35
|
export interface TablePageEvent {
|
|
36
|
+
/** Newly selected page (1-based). */
|
|
29
37
|
page: number;
|
|
38
|
+
/** Active page size. */
|
|
30
39
|
pageSize: number;
|
|
31
40
|
}
|
|
41
|
+
/** Detail payload for the `table-column-toggle` custom event. */
|
|
32
42
|
export interface TableColumnToggleEvent {
|
|
43
|
+
/** Key of the toggled column. */
|
|
33
44
|
column: string;
|
|
45
|
+
/** Whether the column is now hidden. */
|
|
34
46
|
hidden: boolean;
|
|
35
47
|
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { ColumnDef } from './table-types';
|
|
3
|
+
/**
|
|
4
|
+
* Data table with sortable columns, pagination, column-visibility toggle,
|
|
5
|
+
* and optional server-side data mode.
|
|
6
|
+
*
|
|
7
|
+
* @tag app-table
|
|
8
|
+
* @fires table-sort - Fired when a sortable column header is clicked. Detail: `{ column, dir, pageSize }`.
|
|
9
|
+
* @fires table-page - Fired when the user navigates to a different page. Detail: `{ page, pageSize }`.
|
|
10
|
+
* @fires table-column-toggle - Fired when a column is shown/hidden via the toggle panel. Detail: `{ column, hidden }`.
|
|
11
|
+
*/
|
|
3
12
|
export declare class Table extends LitElement {
|
|
4
13
|
static styles: import('lit').CSSResult[];
|
|
14
|
+
/** Column definitions describing each table column. */
|
|
5
15
|
columns: ColumnDef<any>[];
|
|
16
|
+
/** Row data objects keyed by column `key`. */
|
|
6
17
|
rows: Record<string, unknown>[];
|
|
7
18
|
/** If > 0, enables pagination with this many rows per page. */
|
|
8
19
|
pageSize: number;
|