@f-ewald/components 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/custom-elements.json +3488 -929
- package/dist/chat-message.d.ts +39 -0
- package/dist/chat-message.d.ts.map +1 -0
- package/dist/chat-message.js +155 -0
- package/dist/chat-message.js.map +1 -0
- package/dist/data-table.d.ts +39 -0
- package/dist/data-table.d.ts.map +1 -0
- package/dist/data-table.js +119 -0
- package/dist/data-table.js.map +1 -0
- package/dist/editable-text.d.ts +52 -0
- package/dist/editable-text.d.ts.map +1 -0
- package/dist/editable-text.js +224 -0
- package/dist/editable-text.js.map +1 -0
- package/dist/form-select.d.ts +40 -0
- package/dist/form-select.d.ts.map +1 -0
- package/dist/form-select.js +236 -0
- package/dist/form-select.js.map +1 -0
- package/dist/gallery-item-variant.d.ts +21 -0
- package/dist/gallery-item-variant.d.ts.map +1 -0
- package/dist/gallery-item-variant.js +44 -0
- package/dist/gallery-item-variant.js.map +1 -0
- package/dist/gallery-item.d.ts +28 -0
- package/dist/gallery-item.d.ts.map +1 -0
- package/dist/gallery-item.js +54 -0
- package/dist/gallery-item.js.map +1 -0
- package/dist/icons.d.ts +7 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +7 -0
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/live-timer.d.ts +31 -0
- package/dist/live-timer.d.ts.map +1 -0
- package/dist/live-timer.js +78 -0
- package/dist/live-timer.js.map +1 -0
- package/dist/photo-gallery.d.ts +117 -0
- package/dist/photo-gallery.d.ts.map +1 -0
- package/dist/photo-gallery.js +620 -0
- package/dist/photo-gallery.js.map +1 -0
- package/dist/popover-panel.d.ts +34 -0
- package/dist/popover-panel.d.ts.map +1 -0
- package/dist/popover-panel.js +173 -0
- package/dist/popover-panel.js.map +1 -0
- package/dist/stat-meter.d.ts +25 -0
- package/dist/stat-meter.d.ts.map +1 -0
- package/dist/stat-meter.js +106 -0
- package/dist/stat-meter.js.map +1 -0
- package/dist/status-pill.d.ts +24 -0
- package/dist/status-pill.d.ts.map +1 -0
- package/dist/status-pill.js +101 -0
- package/dist/status-pill.js.map +1 -0
- package/dist/tile-grid.d.ts +32 -0
- package/dist/tile-grid.d.ts.map +1 -0
- package/dist/tile-grid.js +102 -0
- package/dist/tile-grid.js.map +1 -0
- package/dist/tokens.css +39 -0
- package/dist/tokens.d.ts +28 -3
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +42 -43
- package/dist/tokens.js.map +1 -1
- package/dist/user-avatar.d.ts +5 -2
- package/dist/user-avatar.d.ts.map +1 -1
- package/dist/user-avatar.js +22 -6
- package/dist/user-avatar.js.map +1 -1
- package/dist/utils/duration.d.ts +12 -0
- package/dist/utils/duration.d.ts.map +1 -0
- package/dist/utils/duration.js +27 -0
- package/dist/utils/duration.js.map +1 -0
- package/docs/chat-message.md +59 -0
- package/docs/data-table.md +63 -0
- package/docs/editable-text.md +51 -0
- package/docs/form-select.md +64 -0
- package/docs/gallery-item-variant.md +37 -0
- package/docs/gallery-item.md +47 -0
- package/docs/live-timer.md +39 -0
- package/docs/map-point.md +2 -1
- package/docs/photo-gallery.md +77 -0
- package/docs/popover-panel.md +66 -0
- package/docs/stat-meter.md +48 -0
- package/docs/status-pill.md +43 -0
- package/docs/tile-grid.md +58 -0
- package/docs/user-avatar.md +1 -1
- package/llms.txt +303 -2
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editable-text.js","sourceRoot":"","sources":["../src/editable-text.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MA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,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC5H,OAAO,IAAI,CAAA,eAAe,OAAO,WAAW,IAAI,CAAC,UAAU;SACtD,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK;MAC1C,CAAC;IACL,CAAC;CACF,CAAA;AAtHa;IAAX,QAAQ,EAAE;2CAAY;AAEM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CAAmB;AAEnC;IAAX,QAAQ,EAAE;iDAAkB;AAEA;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CAAkB;AAElC;IAAX,QAAQ,EAAE;2CAAY;AAEN;IAAhB,KAAK,EAAE;8CAA0B;AACjB;IAAhB,KAAK,EAAE;4CAAqB;AAEK;IAAjC,KAAK,CAAC,iBAAiB,CAAC;4CAAyD;AAxEvE,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAiLxB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * Jira/GitHub-style click-to-edit text: a display span that turns into an\n * `<input>` (or auto-growing `<textarea>` when `multiline`) on click. The\n * input/textarea inherits the host's font, so a title wrapped in an `<h1>`\n * edits at title size.\n *\n * @element editable-text\n * @fires change - Fired with `{ value: string }` when the committed value differs from the previous one.\n */\n@customElement(\"editable-text\")\nexport class EditableText extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .display {\n cursor: text;\n border-radius: var(--ui-radius-sm, 0.25rem);\n padding: 0.1rem 0.3rem;\n margin: -0.1rem -0.3rem;\n }\n .display.multiline {\n white-space: pre-wrap;\n }\n .display:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .display.empty {\n color: var(--ui-text-muted, #64748b);\n }\n .display.readonly {\n cursor: inherit;\n }\n .display.readonly:hover {\n background: none;\n }\n input,\n textarea {\n display: block;\n width: 100%;\n box-sizing: border-box;\n font: inherit;\n color: inherit;\n background: var(--ui-surface, #fff);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n padding: 0.1rem 0.3rem;\n margin: -0.1rem -0.3rem;\n outline: none;\n }\n input:focus,\n textarea:focus {\n border-color: var(--ui-primary, #4f46e5);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n textarea {\n resize: none;\n overflow: hidden;\n }\n `,\n ];\n\n /** Current text. */\n @property() value = \"\";\n /** `false` renders an `<input>`, `true` an auto-growing `<textarea>`. */\n @property({ type: Boolean }) multiline = false;\n /** Muted placeholder text shown when `value` is empty, and as the input's placeholder. */\n @property() placeholder = \"\";\n /** Disables entering edit mode. */\n @property({ type: Boolean }) readonly = false;\n /** `aria-label` applied to the input/textarea. */\n @property() label = \"\";\n\n @state() private _editing = false;\n @state() private _draft = \"\";\n\n @query(\"input, textarea\") private _field?: HTMLInputElement | HTMLTextAreaElement;\n\n /** Enters edit mode, seeding the draft from the current value. */\n private _startEdit() {\n if (this.readonly) return;\n this._draft = this.value;\n this._editing = true;\n }\n\n /** Commits the draft (reverting an empty single-line commit) and exits edit mode.\n *\n * Guarded on `_editing`: removing the focused input/textarea from the DOM\n * (which happens as soon as `_editing` flips to false) makes the browser\n * fire a native `blur` on it, re-invoking this handler a second time after\n * a cancel already ran — the guard makes that second call a no-op instead\n * of re-committing the stale draft.\n */\n private _commit() {\n if (!this._editing) return;\n const next = this._draft;\n this._editing = false;\n if (!this.multiline && next.trim() === \"\") return;\n if (next === this.value) return;\n this.value = next;\n this.dispatchEvent(new CustomEvent(\"change\", { detail: { value: next } }));\n }\n\n /** Discards the draft and exits edit mode without committing. */\n private _cancel() {\n this._editing = false;\n }\n\n private _onInput(e: Event) {\n this._draft = (e.target as HTMLInputElement | HTMLTextAreaElement).value;\n if (this.multiline) this._resize();\n }\n\n private _onSingleLineKeydown(e: KeyboardEvent) {\n if (e.key === \"Enter\") {\n e.preventDefault();\n this._commit();\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n this._cancel();\n }\n }\n\n private _onMultilineKeydown(e: KeyboardEvent) {\n if (e.key === \"Escape\") {\n e.preventDefault();\n this._cancel();\n } else if (e.key === \"Enter\" && (e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n this._commit();\n }\n }\n\n /** Grows the textarea's height to fit its content. */\n private _resize() {\n const field = this._field;\n if (!field) return;\n field.style.height = \"auto\";\n field.style.height = `${field.scrollHeight}px`;\n }\n\n protected override updated(changed: Map<string, unknown>) {\n if (changed.has(\"_editing\") && this._editing) {\n const field = this._field;\n if (!field) return;\n field.focus();\n const end = field.value.length;\n field.setSelectionRange(end, end);\n if (this.multiline) this._resize();\n }\n }\n\n override render() {\n if (this._editing) {\n return this.multiline\n ? html`<textarea\n rows=\"3\"\n .value=${this._draft}\n placeholder=${this.placeholder}\n aria-label=${this.label || nothing}\n @input=${this._onInput}\n @keydown=${this._onMultilineKeydown}\n @blur=${this._commit}\n ></textarea>`\n : html`<input\n type=\"text\"\n .value=${this._draft}\n placeholder=${this.placeholder}\n aria-label=${this.label || nothing}\n @input=${this._onInput}\n @keydown=${this._onSingleLineKeydown}\n @blur=${this._commit}\n />`;\n }\n\n const isEmpty = this.value.trim() === \"\";\n const classes = `display ${this.multiline ? \"multiline\" : \"\"} ${isEmpty ? \"empty\" : \"\"} ${this.readonly ? \"readonly\" : \"\"}`;\n return html`<span class=${classes} @click=${this._startEdit}\n >${isEmpty ? this.placeholder : this.value}</span\n >`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"editable-text\": EditableText;\n }\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from "lit";
|
|
2
|
+
/** A single selectable option. */
|
|
3
|
+
export interface SelectOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A styled dropdown select: a trigger button showing the current option's
|
|
9
|
+
* label, opening a listbox popover on click. Drop-in generic replacement for
|
|
10
|
+
* a native `<select>` wherever consistent cross-browser styling and a
|
|
11
|
+
* `change` event carrying `{ value }` are wanted (e.g. a task's status
|
|
12
|
+
* picker).
|
|
13
|
+
*
|
|
14
|
+
* @element form-select
|
|
15
|
+
* @fires change - Fired with `{ value: string }` when a different option is picked.
|
|
16
|
+
*/
|
|
17
|
+
export declare class FormSelect extends LitElement {
|
|
18
|
+
#private;
|
|
19
|
+
static styles: import("lit").CSSResult[];
|
|
20
|
+
/** The full list of selectable options. */
|
|
21
|
+
options: SelectOption[];
|
|
22
|
+
/** Currently selected value; must match one of `options[].value`. */
|
|
23
|
+
value: string;
|
|
24
|
+
/** `aria-label` applied to the trigger button. */
|
|
25
|
+
label: string;
|
|
26
|
+
/** Disables the trigger, preventing the popover from opening. */
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
private _open;
|
|
29
|
+
private _activeIndex;
|
|
30
|
+
disconnectedCallback(): void;
|
|
31
|
+
protected updated(changed: PropertyValues): void;
|
|
32
|
+
private renderListbox;
|
|
33
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
"form-select": FormSelect;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=form-select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-select.d.ts","sourceRoot":"","sources":["../src/form-select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAK1E,kCAAkC;AAClC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,qBACa,UAAW,SAAQ,UAAU;;IACxC,OAAgB,MAAM,4BAwEpB;IAEF,2CAA2C;IACX,OAAO,EAAE,YAAY,EAAE,CAAM;IAC7D,qEAAqE;IACzD,KAAK,SAAM;IACvB,kDAAkD;IACtC,KAAK,SAAM;IACvB,iEAAiE;IACpC,QAAQ,UAAS;IAErC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,YAAY,CAAM;IAE1B,oBAAoB,IAAI,IAAI,CAGpC;IAED,UAAmB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAQxD;IAmDD,OAAO,CAAC,aAAa;IAuBZ,MAAM,yCAkBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, css, html, nothing } from "lit";
|
|
8
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
9
|
+
import { iconChevronRight } from "./icons.js";
|
|
10
|
+
import { tokens } from "./tokens.js";
|
|
11
|
+
/**
|
|
12
|
+
* A styled dropdown select: a trigger button showing the current option's
|
|
13
|
+
* label, opening a listbox popover on click. Drop-in generic replacement for
|
|
14
|
+
* a native `<select>` wherever consistent cross-browser styling and a
|
|
15
|
+
* `change` event carrying `{ value }` are wanted (e.g. a task's status
|
|
16
|
+
* picker).
|
|
17
|
+
*
|
|
18
|
+
* @element form-select
|
|
19
|
+
* @fires change - Fired with `{ value: string }` when a different option is picked.
|
|
20
|
+
*/
|
|
21
|
+
let FormSelect = class FormSelect extends LitElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
/** The full list of selectable options. */
|
|
25
|
+
this.options = [];
|
|
26
|
+
/** Currently selected value; must match one of `options[].value`. */
|
|
27
|
+
this.value = "";
|
|
28
|
+
/** `aria-label` applied to the trigger button. */
|
|
29
|
+
this.label = "";
|
|
30
|
+
/** Disables the trigger, preventing the popover from opening. */
|
|
31
|
+
this.disabled = false;
|
|
32
|
+
this._open = false;
|
|
33
|
+
this._activeIndex = -1;
|
|
34
|
+
this.#onWindowMousedown = (e) => {
|
|
35
|
+
if (!e.composedPath().includes(this))
|
|
36
|
+
this._open = false;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static { this.styles = [
|
|
40
|
+
tokens,
|
|
41
|
+
css `
|
|
42
|
+
:host {
|
|
43
|
+
display: inline-block;
|
|
44
|
+
position: relative;
|
|
45
|
+
font-family: var(--ui-font, ui-sans-serif, system-ui, sans-serif);
|
|
46
|
+
font-size: var(--ui-font-size-sm, 0.75rem);
|
|
47
|
+
}
|
|
48
|
+
button.trigger {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: 0.35rem;
|
|
52
|
+
font: inherit;
|
|
53
|
+
color: var(--ui-text, #0f172a);
|
|
54
|
+
background: var(--ui-surface, #fff);
|
|
55
|
+
border: 1px solid var(--ui-border, #e2e8f0);
|
|
56
|
+
border-radius: var(--ui-radius-sm, 0.25rem);
|
|
57
|
+
padding: 0.3rem 0.5rem;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
}
|
|
60
|
+
button.trigger:hover {
|
|
61
|
+
background: var(--ui-surface-muted, #f8fafc);
|
|
62
|
+
}
|
|
63
|
+
button.trigger:disabled {
|
|
64
|
+
cursor: not-allowed;
|
|
65
|
+
opacity: 0.6;
|
|
66
|
+
}
|
|
67
|
+
button.trigger:focus-visible {
|
|
68
|
+
outline: none;
|
|
69
|
+
border-color: var(--ui-primary, #4f46e5);
|
|
70
|
+
box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));
|
|
71
|
+
}
|
|
72
|
+
.chevron {
|
|
73
|
+
display: flex;
|
|
74
|
+
color: var(--ui-text-muted, #64748b);
|
|
75
|
+
transform: rotate(90deg);
|
|
76
|
+
transition: transform 0.1s ease;
|
|
77
|
+
}
|
|
78
|
+
:host([open]) .chevron {
|
|
79
|
+
transform: rotate(-90deg);
|
|
80
|
+
}
|
|
81
|
+
ul.options {
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: 100%;
|
|
84
|
+
left: 0;
|
|
85
|
+
z-index: 10;
|
|
86
|
+
min-width: 100%;
|
|
87
|
+
max-height: 40vh;
|
|
88
|
+
overflow-y: auto;
|
|
89
|
+
margin: 2px 0 0;
|
|
90
|
+
padding: 4px 0;
|
|
91
|
+
list-style: none;
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
background: var(--ui-surface, #fff);
|
|
94
|
+
border: 1px solid var(--ui-border, #e2e8f0);
|
|
95
|
+
border-radius: var(--ui-radius-sm, 0.25rem);
|
|
96
|
+
box-shadow: var(--ui-shadow, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1));
|
|
97
|
+
}
|
|
98
|
+
li {
|
|
99
|
+
padding: 0.35rem 0.6rem;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
}
|
|
102
|
+
li.active,
|
|
103
|
+
li:hover {
|
|
104
|
+
background: var(--ui-surface-muted, #f8fafc);
|
|
105
|
+
}
|
|
106
|
+
li[aria-selected="true"] {
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
color: var(--ui-primary, #4f46e5);
|
|
109
|
+
}
|
|
110
|
+
`,
|
|
111
|
+
]; }
|
|
112
|
+
disconnectedCallback() {
|
|
113
|
+
super.disconnectedCallback();
|
|
114
|
+
window.removeEventListener("mousedown", this.#onWindowMousedown, true);
|
|
115
|
+
}
|
|
116
|
+
updated(changed) {
|
|
117
|
+
if (!changed.has("_open"))
|
|
118
|
+
return;
|
|
119
|
+
this.toggleAttribute("open", this._open);
|
|
120
|
+
if (this._open) {
|
|
121
|
+
window.addEventListener("mousedown", this.#onWindowMousedown, true);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
window.removeEventListener("mousedown", this.#onWindowMousedown, true);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
#onWindowMousedown;
|
|
128
|
+
#toggle() {
|
|
129
|
+
if (this.disabled)
|
|
130
|
+
return;
|
|
131
|
+
this._open = !this._open;
|
|
132
|
+
if (this._open) {
|
|
133
|
+
this._activeIndex = Math.max(0, this.options.findIndex((o) => o.value === this.value));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
#select(option) {
|
|
137
|
+
this._open = false;
|
|
138
|
+
if (option.value === this.value)
|
|
139
|
+
return;
|
|
140
|
+
this.value = option.value;
|
|
141
|
+
this.dispatchEvent(new CustomEvent("change", { detail: { value: option.value } }));
|
|
142
|
+
}
|
|
143
|
+
#onTriggerKeydown(e) {
|
|
144
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === " ") {
|
|
145
|
+
e.preventDefault();
|
|
146
|
+
if (!this._open) {
|
|
147
|
+
this.#toggle();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (e.key === "ArrowDown")
|
|
151
|
+
this.#moveActive(1);
|
|
152
|
+
else if (e.key === "ArrowUp")
|
|
153
|
+
this.#moveActive(-1);
|
|
154
|
+
else
|
|
155
|
+
this.#confirmActive();
|
|
156
|
+
}
|
|
157
|
+
else if (e.key === "Escape" && this._open) {
|
|
158
|
+
e.preventDefault();
|
|
159
|
+
this._open = false;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
#moveActive(delta) {
|
|
163
|
+
if (this.options.length === 0)
|
|
164
|
+
return;
|
|
165
|
+
const n = this.options.length;
|
|
166
|
+
this._activeIndex = (this._activeIndex + delta + n) % n;
|
|
167
|
+
}
|
|
168
|
+
#confirmActive() {
|
|
169
|
+
const option = this.options[this._activeIndex];
|
|
170
|
+
if (option)
|
|
171
|
+
this.#select(option);
|
|
172
|
+
}
|
|
173
|
+
renderListbox() {
|
|
174
|
+
if (!this._open)
|
|
175
|
+
return nothing;
|
|
176
|
+
return html `
|
|
177
|
+
<ul class="options" role="listbox">
|
|
178
|
+
${this.options.map((o, i) => html `
|
|
179
|
+
<li
|
|
180
|
+
role="option"
|
|
181
|
+
aria-selected=${o.value === this.value}
|
|
182
|
+
class=${i === this._activeIndex ? "active" : ""}
|
|
183
|
+
@mousedown=${(e) => {
|
|
184
|
+
e.preventDefault();
|
|
185
|
+
this.#select(o);
|
|
186
|
+
}}
|
|
187
|
+
>
|
|
188
|
+
${o.label}
|
|
189
|
+
</li>
|
|
190
|
+
`)}
|
|
191
|
+
</ul>
|
|
192
|
+
`;
|
|
193
|
+
}
|
|
194
|
+
render() {
|
|
195
|
+
const current = this.options.find((o) => o.value === this.value);
|
|
196
|
+
return html `
|
|
197
|
+
<button
|
|
198
|
+
type="button"
|
|
199
|
+
class="trigger"
|
|
200
|
+
aria-haspopup="listbox"
|
|
201
|
+
aria-expanded=${this._open}
|
|
202
|
+
aria-label=${this.label || nothing}
|
|
203
|
+
?disabled=${this.disabled}
|
|
204
|
+
@click=${() => this.#toggle()}
|
|
205
|
+
@keydown=${(e) => this.#onTriggerKeydown(e)}
|
|
206
|
+
>
|
|
207
|
+
<span>${current?.label ?? this.value}</span>
|
|
208
|
+
<span class="chevron">${iconChevronRight(14)}</span>
|
|
209
|
+
</button>
|
|
210
|
+
${this.renderListbox()}
|
|
211
|
+
`;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
__decorate([
|
|
215
|
+
property({ attribute: false })
|
|
216
|
+
], FormSelect.prototype, "options", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
property()
|
|
219
|
+
], FormSelect.prototype, "value", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
property()
|
|
222
|
+
], FormSelect.prototype, "label", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
property({ type: Boolean })
|
|
225
|
+
], FormSelect.prototype, "disabled", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
state()
|
|
228
|
+
], FormSelect.prototype, "_open", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
state()
|
|
231
|
+
], FormSelect.prototype, "_activeIndex", void 0);
|
|
232
|
+
FormSelect = __decorate([
|
|
233
|
+
customElement("form-select")
|
|
234
|
+
], FormSelect);
|
|
235
|
+
export { FormSelect };
|
|
236
|
+
//# sourceMappingURL=form-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-select.js","sourceRoot":"","sources":["../src/form-select.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQrC;;;;;;;;;GASG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QA2EL,2CAA2C;QACX,YAAO,GAAmB,EAAE,CAAC;QAC7D,qEAAqE;QACzD,UAAK,GAAG,EAAE,CAAC;QACvB,kDAAkD;QACtC,UAAK,GAAG,EAAE,CAAC;QACvB,iEAAiE;QACpC,aAAQ,GAAG,K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ACb,IAAI,CAAC,KAAK,IAAI,OAAO;oBACtB,IAAI,CAAC,QAAQ;iBAChB,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE;mBAClB,CAAC,CAAgB,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;;gBAElD,OAAO,EAAE,KAAK,IAAI,IAAI,CAAC,KAAK;gCACZ,gBAAgB,CAAC,EAAE,CAAC;;QAE5C,IAAI,CAAC,aAAa,EAAE;KACvB,CAAC;IACJ,CAAC;CACF,CAAA;AArHiC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;2CAA8B;AAEjD;IAAX,QAAQ,EAAE;yCAAY;AAEX;IAAX,QAAQ,EAAE;yCAAY;AAEM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAAkB;AAE7B;IAAhB,KAAK,EAAE;yCAAuB;AACd;IAAhB,KAAK,EAAE;gDAA2B;AArFxB,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAiMtB","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { iconChevronRight } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** A single selectable option. */\nexport interface SelectOption {\n value: string;\n label: string;\n}\n\n/**\n * A styled dropdown select: a trigger button showing the current option's\n * label, opening a listbox popover on click. Drop-in generic replacement for\n * a native `<select>` wherever consistent cross-browser styling and a\n * `change` event carrying `{ value }` are wanted (e.g. a task's status\n * picker).\n *\n * @element form-select\n * @fires change - Fired with `{ value: string }` when a different option is picked.\n */\n@customElement(\"form-select\")\nexport class FormSelect extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-block;\n position: relative;\n font-family: var(--ui-font, ui-sans-serif, system-ui, sans-serif);\n font-size: var(--ui-font-size-sm, 0.75rem);\n }\n button.trigger {\n display: flex;\n align-items: center;\n gap: 0.35rem;\n font: inherit;\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface, #fff);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n padding: 0.3rem 0.5rem;\n cursor: pointer;\n }\n button.trigger:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n button.trigger:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n button.trigger:focus-visible {\n outline: none;\n border-color: var(--ui-primary, #4f46e5);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .chevron {\n display: flex;\n color: var(--ui-text-muted, #64748b);\n transform: rotate(90deg);\n transition: transform 0.1s ease;\n }\n :host([open]) .chevron {\n transform: rotate(-90deg);\n }\n ul.options {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 10;\n min-width: 100%;\n max-height: 40vh;\n overflow-y: auto;\n margin: 2px 0 0;\n padding: 4px 0;\n list-style: none;\n white-space: nowrap;\n background: var(--ui-surface, #fff);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n box-shadow: var(--ui-shadow, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1));\n }\n li {\n padding: 0.35rem 0.6rem;\n cursor: pointer;\n }\n li.active,\n li:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n li[aria-selected=\"true\"] {\n font-weight: 600;\n color: var(--ui-primary, #4f46e5);\n }\n `,\n ];\n\n /** The full list of selectable options. */\n @property({ attribute: false }) options: SelectOption[] = [];\n /** Currently selected value; must match one of `options[].value`. */\n @property() value = \"\";\n /** `aria-label` applied to the trigger button. */\n @property() label = \"\";\n /** Disables the trigger, preventing the popover from opening. */\n @property({ type: Boolean }) disabled = false;\n\n @state() private _open = false;\n @state() private _activeIndex = -1;\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n window.removeEventListener(\"mousedown\", this.#onWindowMousedown, true);\n }\n\n protected override updated(changed: PropertyValues): void {\n if (!changed.has(\"_open\")) return;\n this.toggleAttribute(\"open\", this._open);\n if (this._open) {\n window.addEventListener(\"mousedown\", this.#onWindowMousedown, true);\n } else {\n window.removeEventListener(\"mousedown\", this.#onWindowMousedown, true);\n }\n }\n\n #onWindowMousedown = (e: MouseEvent): void => {\n if (!e.composedPath().includes(this)) this._open = false;\n };\n\n #toggle(): void {\n if (this.disabled) return;\n this._open = !this._open;\n if (this._open) {\n this._activeIndex = Math.max(\n 0,\n this.options.findIndex((o) => o.value === this.value),\n );\n }\n }\n\n #select(option: SelectOption): void {\n this._open = false;\n if (option.value === this.value) return;\n this.value = option.value;\n this.dispatchEvent(new CustomEvent(\"change\", { detail: { value: option.value } }));\n }\n\n #onTriggerKeydown(e: KeyboardEvent): void {\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\" || e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n if (!this._open) {\n this.#toggle();\n return;\n }\n if (e.key === \"ArrowDown\") this.#moveActive(1);\n else if (e.key === \"ArrowUp\") this.#moveActive(-1);\n else this.#confirmActive();\n } else if (e.key === \"Escape\" && this._open) {\n e.preventDefault();\n this._open = false;\n }\n }\n\n #moveActive(delta: number): void {\n if (this.options.length === 0) return;\n const n = this.options.length;\n this._activeIndex = (this._activeIndex + delta + n) % n;\n }\n\n #confirmActive(): void {\n const option = this.options[this._activeIndex];\n if (option) this.#select(option);\n }\n\n private renderListbox() {\n if (!this._open) return nothing;\n return html`\n <ul class=\"options\" role=\"listbox\">\n ${this.options.map(\n (o, i) => html`\n <li\n role=\"option\"\n aria-selected=${o.value === this.value}\n class=${i === this._activeIndex ? \"active\" : \"\"}\n @mousedown=${(e: MouseEvent) => {\n e.preventDefault();\n this.#select(o);\n }}\n >\n ${o.label}\n </li>\n `,\n )}\n </ul>\n `;\n }\n\n override render() {\n const current = this.options.find((o) => o.value === this.value);\n return html`\n <button\n type=\"button\"\n class=\"trigger\"\n aria-haspopup=\"listbox\"\n aria-expanded=${this._open}\n aria-label=${this.label || nothing}\n ?disabled=${this.disabled}\n @click=${() => this.#toggle()}\n @keydown=${(e: KeyboardEvent) => this.#onTriggerKeydown(e)}\n >\n <span>${current?.label ?? this.value}</span>\n <span class=\"chevron\">${iconChevronRight(14)}</span>\n </button>\n ${this.renderListbox()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"form-select\": FormSelect;\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* Responsive image source metadata for a parent `gallery-item`.
|
|
4
|
+
*
|
|
5
|
+
* @element gallery-item-variant
|
|
6
|
+
*/
|
|
7
|
+
export declare class GalleryItemVariant extends LitElement {
|
|
8
|
+
/** Optional media query that controls when this source is selected. */
|
|
9
|
+
media?: string;
|
|
10
|
+
/** Responsive image candidate string passed to a generated `<source>`. */
|
|
11
|
+
srcset: string;
|
|
12
|
+
static styles: import("lit").CSSResult[];
|
|
13
|
+
/** Keeps this metadata element non-visual. */
|
|
14
|
+
protected render(): symbol;
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
"gallery-item-variant": GalleryItemVariant;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=gallery-item-variant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gallery-item-variant.d.ts","sourceRoot":"","sources":["../src/gallery-item-variant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgB,MAAM,KAAK,CAAC;AAI/C;;;;GAIG;AACH,qBACa,kBAAmB,SAAQ,UAAU;IAChD,uEAAuE;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IAE5C,0EAA0E;IAC7C,MAAM,SAAM;IAEzC,OAAgB,MAAM,4BAOpB;IAEF,8CAA8C;IAC9C,UAAmB,MAAM,WAExB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, css, nothing } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import { tokens } from "./tokens.js";
|
|
10
|
+
/**
|
|
11
|
+
* Responsive image source metadata for a parent `gallery-item`.
|
|
12
|
+
*
|
|
13
|
+
* @element gallery-item-variant
|
|
14
|
+
*/
|
|
15
|
+
let GalleryItemVariant = class GalleryItemVariant extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
/** Responsive image candidate string passed to a generated `<source>`. */
|
|
19
|
+
this.srcset = "";
|
|
20
|
+
}
|
|
21
|
+
static { this.styles = [
|
|
22
|
+
tokens,
|
|
23
|
+
css `
|
|
24
|
+
:host {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
`,
|
|
28
|
+
]; }
|
|
29
|
+
/** Keeps this metadata element non-visual. */
|
|
30
|
+
render() {
|
|
31
|
+
return nothing;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
__decorate([
|
|
35
|
+
property({ reflect: true })
|
|
36
|
+
], GalleryItemVariant.prototype, "media", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
property({ reflect: true })
|
|
39
|
+
], GalleryItemVariant.prototype, "srcset", void 0);
|
|
40
|
+
GalleryItemVariant = __decorate([
|
|
41
|
+
customElement("gallery-item-variant")
|
|
42
|
+
], GalleryItemVariant);
|
|
43
|
+
export { GalleryItemVariant };
|
|
44
|
+
//# sourceMappingURL=gallery-item-variant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gallery-item-variant.js","sourceRoot":"","sources":["../src/gallery-item-variant.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;GAIG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;IAA3C;;QAIL,0EAA0E;QAC7C,WAAM,GAAG,EAAE,CAAC;IAe3C,CAAC;aAbiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;KAIF;KACF,AAPqB,CAOpB;IAEF,8CAA8C;IAC3B,MAAM;QACvB,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAA;AAlB8B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAgB;AAGf;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAa;AAL9B,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAoB9B","sourcesContent":["import { LitElement, css, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * Responsive image source metadata for a parent `gallery-item`.\n *\n * @element gallery-item-variant\n */\n@customElement(\"gallery-item-variant\")\nexport class GalleryItemVariant extends LitElement {\n /** Optional media query that controls when this source is selected. */\n @property({ reflect: true }) media?: string;\n\n /** Responsive image candidate string passed to a generated `<source>`. */\n @property({ reflect: true }) srcset = \"\";\n\n static override styles = [\n tokens,\n css`\n :host {\n display: none;\n }\n `,\n ];\n\n /** Keeps this metadata element non-visual. */\n protected override render() {\n return nothing;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"gallery-item-variant\": GalleryItemVariant;\n }\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "./gallery-item-variant.js";
|
|
3
|
+
import type { GalleryItemVariant } from "./gallery-item-variant.js";
|
|
4
|
+
/**
|
|
5
|
+
* Declarative image metadata consumed by a parent `photo-gallery`.
|
|
6
|
+
*
|
|
7
|
+
* @element gallery-item
|
|
8
|
+
* @slot - Optional `gallery-item-variant` elements for responsive sources.
|
|
9
|
+
*/
|
|
10
|
+
export declare class GalleryItem extends LitElement {
|
|
11
|
+
/** URL of the fallback image. */
|
|
12
|
+
src: string;
|
|
13
|
+
/** Required alternative text for the image. */
|
|
14
|
+
alt: string;
|
|
15
|
+
/** Optional visible caption rendered below the image. */
|
|
16
|
+
caption?: string;
|
|
17
|
+
/** Responsive source variants declared inside this item. */
|
|
18
|
+
readonly variants: GalleryItemVariant[];
|
|
19
|
+
static styles: import("lit").CSSResult[];
|
|
20
|
+
/** Retains declarative variants while keeping the metadata host hidden. */
|
|
21
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
22
|
+
}
|
|
23
|
+
declare global {
|
|
24
|
+
interface HTMLElementTagNameMap {
|
|
25
|
+
"gallery-item": GalleryItem;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=gallery-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gallery-item.d.ts","sourceRoot":"","sources":["../src/gallery-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGpE;;;;;GAKG;AACH,qBACa,WAAY,SAAQ,UAAU;IACzC,iCAAiC;IACJ,GAAG,SAAM;IAEtC,+CAA+C;IAClB,GAAG,SAAM;IAEtC,yDAAyD;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IAE9C,4DAA4D;IAE5D,QAAQ,CAAC,QAAQ,EAAG,kBAAkB,EAAE,CAAC;IAEzC,OAAgB,MAAM,4BAOpB;IAEF,2EAA2E;IAC3E,UAAmB,MAAM,yCAExB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, css, html } from "lit";
|
|
8
|
+
import { customElement, property, queryAssignedElements } from "lit/decorators.js";
|
|
9
|
+
import "./gallery-item-variant.js";
|
|
10
|
+
import { tokens } from "./tokens.js";
|
|
11
|
+
/**
|
|
12
|
+
* Declarative image metadata consumed by a parent `photo-gallery`.
|
|
13
|
+
*
|
|
14
|
+
* @element gallery-item
|
|
15
|
+
* @slot - Optional `gallery-item-variant` elements for responsive sources.
|
|
16
|
+
*/
|
|
17
|
+
let GalleryItem = class GalleryItem extends LitElement {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
/** URL of the fallback image. */
|
|
21
|
+
this.src = "";
|
|
22
|
+
/** Required alternative text for the image. */
|
|
23
|
+
this.alt = "";
|
|
24
|
+
}
|
|
25
|
+
static { this.styles = [
|
|
26
|
+
tokens,
|
|
27
|
+
css `
|
|
28
|
+
:host {
|
|
29
|
+
display: none;
|
|
30
|
+
}
|
|
31
|
+
`,
|
|
32
|
+
]; }
|
|
33
|
+
/** Retains declarative variants while keeping the metadata host hidden. */
|
|
34
|
+
render() {
|
|
35
|
+
return html `<slot></slot>`;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
__decorate([
|
|
39
|
+
property({ reflect: true })
|
|
40
|
+
], GalleryItem.prototype, "src", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
property({ reflect: true })
|
|
43
|
+
], GalleryItem.prototype, "alt", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
property({ reflect: true })
|
|
46
|
+
], GalleryItem.prototype, "caption", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
queryAssignedElements({ selector: "gallery-item-variant" })
|
|
49
|
+
], GalleryItem.prototype, "variants", void 0);
|
|
50
|
+
GalleryItem = __decorate([
|
|
51
|
+
customElement("gallery-item")
|
|
52
|
+
], GalleryItem);
|
|
53
|
+
export { GalleryItem };
|
|
54
|
+
//# sourceMappingURL=gallery-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gallery-item.js","sourceRoot":"","sources":["../src/gallery-item.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,2BAA2B,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;GAKG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QACL,iCAAiC;QACJ,QAAG,GAAG,EAAE,CAAC;QAEtC,+CAA+C;QAClB,QAAG,GAAG,EAAE,CAAC;IAsBxC,CAAC;aAbiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;KAIF;KACF,AAPqB,CAOpB;IAEF,2EAA2E;IACxD,MAAM;QACvB,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;CACF,CAAA;AAzB8B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAAU;AAGT;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAAU;AAGT;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAkB;AAIrC;IADR,qBAAqB,CAAC,EAAE,QAAQ,EAAE,sBAAsB,EAAE,CAAC;6CACnB;AAZ9B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA2BvB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property, queryAssignedElements } from \"lit/decorators.js\";\nimport \"./gallery-item-variant.js\";\nimport type { GalleryItemVariant } from \"./gallery-item-variant.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * Declarative image metadata consumed by a parent `photo-gallery`.\n *\n * @element gallery-item\n * @slot - Optional `gallery-item-variant` elements for responsive sources.\n */\n@customElement(\"gallery-item\")\nexport class GalleryItem extends LitElement {\n /** URL of the fallback image. */\n @property({ reflect: true }) src = \"\";\n\n /** Required alternative text for the image. */\n @property({ reflect: true }) alt = \"\";\n\n /** Optional visible caption rendered below the image. */\n @property({ reflect: true }) caption?: string;\n\n /** Responsive source variants declared inside this item. */\n @queryAssignedElements({ selector: \"gallery-item-variant\" })\n readonly variants!: GalleryItemVariant[];\n\n static override styles = [\n tokens,\n css`\n :host {\n display: none;\n }\n `,\n ];\n\n /** Retains declarative variants while keeping the metadata host hidden. */\n protected override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"gallery-item\": GalleryItem;\n }\n}\n"]}
|
package/dist/icons.d.ts
CHANGED
|
@@ -29,4 +29,11 @@ export declare const iconEye: (size?: number) => import("lit-html").TemplateResu
|
|
|
29
29
|
export declare const iconEyeSlash: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
30
30
|
export declare const iconShieldCheck: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
31
31
|
export declare const iconUserCircle: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
32
|
+
export declare const iconClipboardDocumentList: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
33
|
+
export declare const iconCpuChip: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
34
|
+
export declare const iconFolder: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
35
|
+
export declare const iconChevronDown: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
36
|
+
export declare const iconDocument: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
37
|
+
export declare const iconSquares2x2: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
38
|
+
export declare const iconChatBubbleLeftRight: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
32
39
|
//# sourceMappingURL=icons.d.ts.map
|
package/dist/icons.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,KAAK,yDAC2O,CAAC;AAE9P,eAAO,MAAM,SAAS,yDAC+P,CAAC;AAEtR,eAAO,MAAM,eAAe,yDACwO,CAAC;AAErQ,eAAO,MAAM,gBAAgB,yDACqO,CAAC;AAEnQ,eAAO,MAAM,OAAO,yDAC2xC,CAAC;AAEhzC,eAAO,MAAM,QAAQ,yDAC4W,CAAC;AAElY,eAAO,MAAM,sB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;AAEpQ,eAAO,MAAM,YAAY,yDACid,CAAC;AAE3e,eAAO,MAAM,cAAc,yDACosB,CAAC;AAEhuB,eAAO,MAAM,uBAAuB,yDAC2sB,CAAC"}
|
package/dist/icons.js
CHANGED
|
@@ -32,4 +32,11 @@ export const iconEye = (size = 16) => svg `<svg xmlns="http://www.w3.org/2000/sv
|
|
|
32
32
|
export const iconEyeSlash = (size = 16) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"/></svg>`;
|
|
33
33
|
export const iconShieldCheck = (size = 16) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"/></svg>`;
|
|
34
34
|
export const iconUserCircle = (size = 20) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>`;
|
|
35
|
+
export const iconClipboardDocumentList = (size = 18) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"/></svg>`;
|
|
36
|
+
export const iconCpuChip = (size = 18) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"/></svg>`;
|
|
37
|
+
export const iconFolder = (size = 18) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"/></svg>`;
|
|
38
|
+
export const iconChevronDown = (size = 16) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/></svg>`;
|
|
39
|
+
export const iconDocument = (size = 18) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"/></svg>`;
|
|
40
|
+
export const iconSquares2x2 = (size = 18) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"/></svg>`;
|
|
41
|
+
export const iconChatBubbleLeftRight = (size = 18) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"/></svg>`;
|
|
35
42
|
//# sourceMappingURL=icons.js.map
|