@aceshooting/lyra-ui 0.1.5 → 1.0.1
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 +17 -8
- package/custom-elements.json +5655 -4175
- package/dist/components/chart/bar-chart.stories.d.ts +5 -0
- package/dist/components/chart/bar-chart.stories.js +20 -0
- package/dist/components/chart/box-plot.stories.d.ts +5 -0
- package/dist/components/chart/box-plot.stories.js +29 -0
- package/dist/components/chart/bubble-chart.stories.d.ts +5 -0
- package/dist/components/chart/bubble-chart.stories.js +26 -0
- package/dist/components/chart/doughnut-chart.stories.d.ts +5 -0
- package/dist/components/chart/doughnut-chart.stories.js +26 -0
- package/dist/components/chart/histogram.stories.d.ts +5 -0
- package/dist/components/chart/histogram.stories.js +17 -0
- package/dist/components/chart/line-chart.stories.d.ts +5 -0
- package/dist/components/chart/line-chart.stories.js +24 -0
- package/dist/components/chart/pie-chart.stories.d.ts +5 -0
- package/dist/components/chart/pie-chart.stories.js +26 -0
- package/dist/components/chart/polar-area-chart.stories.d.ts +5 -0
- package/dist/components/chart/polar-area-chart.stories.js +20 -0
- package/dist/components/chart/radar-chart.stories.d.ts +5 -0
- package/dist/components/chart/radar-chart.stories.js +20 -0
- package/dist/components/chart/scatter-chart.stories.d.ts +5 -0
- package/dist/components/chart/scatter-chart.stories.js +31 -0
- package/dist/components/combobox/combobox.d.ts +26 -1
- package/dist/components/combobox/combobox.js +147 -31
- package/dist/components/combobox/combobox.styles.js +21 -0
- package/dist/components/combobox/option.d.ts +4 -0
- package/dist/components/combobox/option.js +10 -0
- package/dist/components/date-picker/calendar-core.d.ts +6 -2
- package/dist/components/date-picker/calendar-core.js +23 -4
- package/dist/components/date-picker/date-input.d.ts +1 -0
- package/dist/components/date-picker/date-input.js +19 -2
- package/dist/components/date-picker/date-picker.js +4 -2
- package/dist/components/date-picker/date-picker.styles.js +5 -1
- package/dist/components/empty/empty.stories.d.ts +5 -0
- package/dist/components/empty/empty.stories.js +14 -0
- package/dist/components/export-button/export-button.js +7 -2
- package/dist/components/export-button/export-button.stories.d.ts +6 -0
- package/dist/components/export-button/export-button.stories.js +32 -0
- package/dist/components/file-input/file-input.stories.d.ts +5 -0
- package/dist/components/file-input/file-input.stories.js +10 -0
- package/dist/components/flag/flag.js +12 -2
- package/dist/components/gauge/gauge.js +8 -4
- package/dist/components/gauge/gauge.stories.d.ts +6 -0
- package/dist/components/gauge/gauge.stories.js +13 -0
- package/dist/components/graph/graph.stories.d.ts +5 -0
- package/dist/components/graph/graph.stories.js +30 -0
- package/dist/components/heatmap/heatmap.stories.d.ts +5 -0
- package/dist/components/heatmap/heatmap.stories.js +24 -0
- package/dist/components/map/map.d.ts +6 -0
- package/dist/components/map/map.js +69 -9
- package/dist/components/map/map.stories.d.ts +5 -0
- package/dist/components/map/map.stories.js +40 -0
- package/dist/components/playback/playback.stories.d.ts +5 -0
- package/dist/components/playback/playback.stories.js +10 -0
- package/dist/components/skeleton/skeleton.stories.d.ts +5 -0
- package/dist/components/skeleton/skeleton.stories.js +16 -0
- package/dist/components/split/split.d.ts +1 -0
- package/dist/components/split/split.js +25 -4
- package/dist/components/split/split.stories.d.ts +5 -0
- package/dist/components/split/split.stories.js +16 -0
- package/dist/components/table/table.stories.d.ts +6 -0
- package/dist/components/table/table.stories.js +22 -0
- package/dist/components/time-range/time-range.stories.d.ts +6 -0
- package/dist/components/time-range/time-range.stories.js +13 -0
- package/dist/components/toast/toast-item.d.ts +1 -0
- package/dist/components/toast/toast-item.js +16 -1
- package/dist/components/tree/tree.stories.d.ts +5 -0
- package/dist/components/tree/tree.stories.js +22 -0
- package/dist/components/widget/widget.d.ts +40 -0
- package/dist/components/widget/widget.js +159 -0
- package/dist/components/widget/widget.stories.d.ts +6 -0
- package/dist/components/widget/widget.stories.js +31 -0
- package/dist/components/widget/widget.styles.d.ts +1 -0
- package/dist/components/widget/widget.styles.js +90 -0
- package/dist/internal/icons.d.ts +2 -0
- package/dist/internal/icons.js +9 -0
- package/dist/internal/scroll-lock.d.ts +7 -0
- package/dist/internal/scroll-lock.js +25 -0
- package/dist/internal/tokens.styles.js +5 -0
- package/dist/lyra.d.ts +5 -0
- package/dist/lyra.js +2 -0
- package/llms.txt +3 -0
- package/package.json +3 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type TemplateResult, type PropertyValues } from 'lit';
|
|
2
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
3
|
+
/**
|
|
4
|
+
* `<lyra-widget>` — a titled panel shell with an optional collapse toggle and
|
|
5
|
+
* an optional fullscreen-expand toggle. Fullscreen promotes the same host
|
|
6
|
+
* element in place (a CSS state, not a clone/portal), so slotted content
|
|
7
|
+
* (a chart, a running simulation, scroll position) survives the transition.
|
|
8
|
+
*
|
|
9
|
+
* @customElement lyra-widget
|
|
10
|
+
* @slot - The panel body.
|
|
11
|
+
* @slot actions - Header action controls, rendered before the collapse/expand buttons.
|
|
12
|
+
* @event lyra-collapse-change - `detail: boolean` (the new `collapsed` state).
|
|
13
|
+
* @event lyra-fullscreen-change - `detail: boolean` (the new `fullscreen` state).
|
|
14
|
+
* @csspart base, header, title, label, sublabel, actions, body, backdrop
|
|
15
|
+
*/
|
|
16
|
+
export declare class LyraWidget extends LyraElement {
|
|
17
|
+
static styles: import("lit").CSSResultGroup[];
|
|
18
|
+
label: string;
|
|
19
|
+
sublabel: string;
|
|
20
|
+
collapsible: boolean;
|
|
21
|
+
collapsed: boolean;
|
|
22
|
+
expandable: boolean;
|
|
23
|
+
fullscreen: boolean;
|
|
24
|
+
private hasActionsSlot;
|
|
25
|
+
private releaseScrollLock?;
|
|
26
|
+
private lastTrigger?;
|
|
27
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
28
|
+
disconnectedCallback(): void;
|
|
29
|
+
private onActionsSlotChange;
|
|
30
|
+
private toggleCollapsed;
|
|
31
|
+
private toggleFullscreen;
|
|
32
|
+
private onDocKeyDown;
|
|
33
|
+
private onBackdropClick;
|
|
34
|
+
render(): TemplateResult;
|
|
35
|
+
}
|
|
36
|
+
declare global {
|
|
37
|
+
interface HTMLElementTagNameMap {
|
|
38
|
+
'lyra-widget': LyraWidget;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
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 { html, nothing } from 'lit';
|
|
8
|
+
import { property, state } from 'lit/decorators.js';
|
|
9
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
10
|
+
import { defineElement } from '../../internal/prefix.js';
|
|
11
|
+
import { lockScroll } from '../../internal/scroll-lock.js';
|
|
12
|
+
import { chevronIcon, closeIcon, expandIcon } from '../../internal/icons.js';
|
|
13
|
+
import { styles } from './widget.styles.js';
|
|
14
|
+
/**
|
|
15
|
+
* `<lyra-widget>` — a titled panel shell with an optional collapse toggle and
|
|
16
|
+
* an optional fullscreen-expand toggle. Fullscreen promotes the same host
|
|
17
|
+
* element in place (a CSS state, not a clone/portal), so slotted content
|
|
18
|
+
* (a chart, a running simulation, scroll position) survives the transition.
|
|
19
|
+
*
|
|
20
|
+
* @customElement lyra-widget
|
|
21
|
+
* @slot - The panel body.
|
|
22
|
+
* @slot actions - Header action controls, rendered before the collapse/expand buttons.
|
|
23
|
+
* @event lyra-collapse-change - `detail: boolean` (the new `collapsed` state).
|
|
24
|
+
* @event lyra-fullscreen-change - `detail: boolean` (the new `fullscreen` state).
|
|
25
|
+
* @csspart base, header, title, label, sublabel, actions, body, backdrop
|
|
26
|
+
*/
|
|
27
|
+
export class LyraWidget extends LyraElement {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
this.label = '';
|
|
31
|
+
this.sublabel = '';
|
|
32
|
+
this.collapsible = false;
|
|
33
|
+
this.collapsed = false;
|
|
34
|
+
this.expandable = false;
|
|
35
|
+
this.fullscreen = false;
|
|
36
|
+
this.hasActionsSlot = false;
|
|
37
|
+
this.onActionsSlotChange = (e) => {
|
|
38
|
+
this.hasActionsSlot = e.target.assignedElements({ flatten: true }).length > 0;
|
|
39
|
+
};
|
|
40
|
+
this.toggleCollapsed = () => {
|
|
41
|
+
this.collapsed = !this.collapsed;
|
|
42
|
+
this.emit('lyra-collapse-change', this.collapsed);
|
|
43
|
+
};
|
|
44
|
+
this.toggleFullscreen = (e) => {
|
|
45
|
+
this.lastTrigger = e.currentTarget;
|
|
46
|
+
this.fullscreen = !this.fullscreen;
|
|
47
|
+
this.emit('lyra-fullscreen-change', this.fullscreen);
|
|
48
|
+
if (!this.fullscreen) {
|
|
49
|
+
this.lastTrigger?.focus();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
this.onDocKeyDown = (e) => {
|
|
53
|
+
if (e.key === 'Escape' && this.fullscreen) {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
this.fullscreen = false;
|
|
56
|
+
this.emit('lyra-fullscreen-change', false);
|
|
57
|
+
this.lastTrigger?.focus();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
this.onBackdropClick = () => {
|
|
61
|
+
if (!this.fullscreen)
|
|
62
|
+
return;
|
|
63
|
+
this.fullscreen = false;
|
|
64
|
+
this.emit('lyra-fullscreen-change', false);
|
|
65
|
+
document.removeEventListener('keydown', this.onDocKeyDown);
|
|
66
|
+
this.lastTrigger?.focus();
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
static { this.styles = [LyraElement.styles, styles]; }
|
|
70
|
+
willUpdate(changed) {
|
|
71
|
+
if (!this.hasUpdated) {
|
|
72
|
+
this.hasActionsSlot = Array.from(this.children).some((el) => el.getAttribute('slot') === 'actions');
|
|
73
|
+
}
|
|
74
|
+
if (changed.has('fullscreen')) {
|
|
75
|
+
if (this.fullscreen) {
|
|
76
|
+
this.releaseScrollLock = lockScroll();
|
|
77
|
+
document.addEventListener('keydown', this.onDocKeyDown);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
this.releaseScrollLock?.();
|
|
81
|
+
this.releaseScrollLock = undefined;
|
|
82
|
+
document.removeEventListener('keydown', this.onDocKeyDown);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
disconnectedCallback() {
|
|
87
|
+
super.disconnectedCallback();
|
|
88
|
+
this.releaseScrollLock?.();
|
|
89
|
+
this.releaseScrollLock = undefined;
|
|
90
|
+
document.removeEventListener('keydown', this.onDocKeyDown);
|
|
91
|
+
}
|
|
92
|
+
render() {
|
|
93
|
+
const hasLabel = this.label.length > 0;
|
|
94
|
+
const hasSublabel = this.sublabel.length > 0;
|
|
95
|
+
return html `
|
|
96
|
+
${this.fullscreen ? html `<div part="backdrop" @click=${this.onBackdropClick}></div>` : nothing}
|
|
97
|
+
<div part="base">
|
|
98
|
+
<div part="header">
|
|
99
|
+
<div part="title">
|
|
100
|
+
${hasLabel ? html `<span part="label">${this.label}</span>` : nothing}
|
|
101
|
+
${hasSublabel ? html `<span part="sublabel">${this.sublabel}</span>` : nothing}
|
|
102
|
+
</div>
|
|
103
|
+
<div part="actions" ?hidden=${!this.hasActionsSlot}>
|
|
104
|
+
<slot name="actions" @slotchange=${this.onActionsSlotChange}></slot>
|
|
105
|
+
</div>
|
|
106
|
+
${this.collapsible
|
|
107
|
+
? html `<button
|
|
108
|
+
part="collapse-button"
|
|
109
|
+
type="button"
|
|
110
|
+
aria-expanded=${this.collapsed ? 'false' : 'true'}
|
|
111
|
+
aria-label=${this.collapsed ? 'Expand panel' : 'Collapse panel'}
|
|
112
|
+
@click=${this.toggleCollapsed}
|
|
113
|
+
>
|
|
114
|
+
<span style="display:inline-flex;transform:rotate(${this.collapsed ? '0deg' : '90deg'})"
|
|
115
|
+
>${chevronIcon()}</span
|
|
116
|
+
>
|
|
117
|
+
</button>`
|
|
118
|
+
: nothing}
|
|
119
|
+
${this.expandable
|
|
120
|
+
? html `<button
|
|
121
|
+
part="fullscreen-button"
|
|
122
|
+
type="button"
|
|
123
|
+
aria-pressed=${this.fullscreen ? 'true' : 'false'}
|
|
124
|
+
aria-label=${this.fullscreen ? 'Exit fullscreen' : 'Expand to fullscreen'}
|
|
125
|
+
@click=${this.toggleFullscreen}
|
|
126
|
+
>
|
|
127
|
+
${this.fullscreen ? closeIcon() : expandIcon()}
|
|
128
|
+
</button>`
|
|
129
|
+
: nothing}
|
|
130
|
+
</div>
|
|
131
|
+
<div part="body" ?hidden=${this.collapsed}>
|
|
132
|
+
<slot></slot>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
`;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
__decorate([
|
|
139
|
+
property()
|
|
140
|
+
], LyraWidget.prototype, "label", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
property()
|
|
143
|
+
], LyraWidget.prototype, "sublabel", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
property({ type: Boolean, reflect: true })
|
|
146
|
+
], LyraWidget.prototype, "collapsible", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
property({ type: Boolean, reflect: true })
|
|
149
|
+
], LyraWidget.prototype, "collapsed", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
property({ type: Boolean, reflect: true })
|
|
152
|
+
], LyraWidget.prototype, "expandable", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
property({ type: Boolean, reflect: true })
|
|
155
|
+
], LyraWidget.prototype, "fullscreen", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
state()
|
|
158
|
+
], LyraWidget.prototype, "hasActionsSlot", void 0);
|
|
159
|
+
defineElement('widget', LyraWidget);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Widget',
|
|
4
|
+
component: 'lyra-widget',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: () => html `
|
|
10
|
+
<lyra-widget
|
|
11
|
+
label="Load profile"
|
|
12
|
+
sublabel="Last 7 days"
|
|
13
|
+
collapsible
|
|
14
|
+
expandable
|
|
15
|
+
style="max-width: 28rem;"
|
|
16
|
+
>
|
|
17
|
+
<span slot="actions"><button>Refresh</button></span>
|
|
18
|
+
<div style="padding: 1rem;">
|
|
19
|
+
<p style="margin: 0 0 0.5rem;">Panel body content — a chart, a table, anything.</p>
|
|
20
|
+
<p style="margin: 0; color: #666;">Click the chevron to collapse, or the expand icon to go fullscreen.</p>
|
|
21
|
+
</div>
|
|
22
|
+
</lyra-widget>
|
|
23
|
+
`,
|
|
24
|
+
};
|
|
25
|
+
export const CollapsedInitially = {
|
|
26
|
+
render: () => html `
|
|
27
|
+
<lyra-widget label="Alerts" sublabel="3 active" collapsible collapsed style="max-width: 28rem;">
|
|
28
|
+
<div style="padding: 1rem;">This body is hidden until the panel is expanded.</div>
|
|
29
|
+
</lyra-widget>
|
|
30
|
+
`,
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
[part='base'] {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
border: 1px solid var(--lyra-color-border);
|
|
10
|
+
border-radius: var(--lyra-radius);
|
|
11
|
+
background: var(--lyra-color-surface);
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
}
|
|
14
|
+
[part='header'] {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: var(--lyra-space-s);
|
|
18
|
+
padding: var(--lyra-space-s) var(--lyra-space-m);
|
|
19
|
+
border-block-end: 1px solid var(--lyra-color-border);
|
|
20
|
+
}
|
|
21
|
+
[part='title'] {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
flex: 1 1 auto;
|
|
25
|
+
min-inline-size: 0;
|
|
26
|
+
}
|
|
27
|
+
[part='label'] {
|
|
28
|
+
font-weight: 600;
|
|
29
|
+
}
|
|
30
|
+
[part='sublabel'] {
|
|
31
|
+
font-size: 0.8125rem;
|
|
32
|
+
color: var(--lyra-color-text-quiet);
|
|
33
|
+
}
|
|
34
|
+
[part='actions'] {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: var(--lyra-space-xs);
|
|
38
|
+
}
|
|
39
|
+
[part='actions'][hidden] {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
[part='collapse-button'],
|
|
43
|
+
[part='fullscreen-button'] {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
min-inline-size: var(--lyra-icon-button-size);
|
|
48
|
+
min-block-size: var(--lyra-icon-button-size);
|
|
49
|
+
border: none;
|
|
50
|
+
background: transparent;
|
|
51
|
+
color: var(--lyra-color-text-quiet);
|
|
52
|
+
border-radius: var(--lyra-radius);
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
transition: transform var(--lyra-transition-fast);
|
|
55
|
+
}
|
|
56
|
+
[part='collapse-button']:hover,
|
|
57
|
+
[part='fullscreen-button']:hover {
|
|
58
|
+
background: var(--lyra-color-brand-quiet);
|
|
59
|
+
color: var(--lyra-color-brand);
|
|
60
|
+
}
|
|
61
|
+
[part='collapse-button']:focus-visible,
|
|
62
|
+
[part='fullscreen-button']:focus-visible {
|
|
63
|
+
outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
|
|
64
|
+
outline-offset: var(--lyra-focus-ring-offset);
|
|
65
|
+
}
|
|
66
|
+
[part='body'] {
|
|
67
|
+
padding: var(--lyra-space-m);
|
|
68
|
+
flex: 1 1 auto;
|
|
69
|
+
min-block-size: 0;
|
|
70
|
+
}
|
|
71
|
+
[part='body'][hidden] {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
74
|
+
[part='backdrop'] {
|
|
75
|
+
position: fixed;
|
|
76
|
+
inset: 0;
|
|
77
|
+
background: rgb(0 0 0 / 0.5);
|
|
78
|
+
z-index: 999;
|
|
79
|
+
}
|
|
80
|
+
:host([fullscreen]) [part='base'] {
|
|
81
|
+
position: fixed;
|
|
82
|
+
inset: var(--lyra-space-l);
|
|
83
|
+
z-index: 1000;
|
|
84
|
+
box-shadow: var(--lyra-shadow);
|
|
85
|
+
}
|
|
86
|
+
:host([fullscreen]) [part='body'] {
|
|
87
|
+
overflow: auto;
|
|
88
|
+
block-size: 100%;
|
|
89
|
+
}
|
|
90
|
+
`;
|
package/dist/internal/icons.d.ts
CHANGED
|
@@ -9,3 +9,5 @@ export declare function playIcon(): SVGTemplateResult;
|
|
|
9
9
|
export declare function pauseIcon(): SVGTemplateResult;
|
|
10
10
|
/** A calendar/date glyph, for date-input's open-calendar toggle. */
|
|
11
11
|
export declare function calendarIcon(): SVGTemplateResult;
|
|
12
|
+
/** A four-corner "expand to fullscreen" glyph. */
|
|
13
|
+
export declare function expandIcon(): SVGTemplateResult;
|
package/dist/internal/icons.js
CHANGED
|
@@ -62,3 +62,12 @@ export function calendarIcon() {
|
|
|
62
62
|
<line x1="3" y1="10" x2="21" y2="10"></line>
|
|
63
63
|
`);
|
|
64
64
|
}
|
|
65
|
+
/** A four-corner "expand to fullscreen" glyph. */
|
|
66
|
+
export function expandIcon() {
|
|
67
|
+
return icon(svg `
|
|
68
|
+
<polyline points="15 3 21 3 21 9"></polyline>
|
|
69
|
+
<polyline points="9 21 3 21 3 15"></polyline>
|
|
70
|
+
<line x1="21" y1="3" x2="14" y2="10"></line>
|
|
71
|
+
<line x1="3" y1="21" x2="10" y2="14"></line>
|
|
72
|
+
`);
|
|
73
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ref-counted document scroll lock — safe when a lock is acquired and
|
|
3
|
+
* released more than once concurrently (e.g. a fast open/close/open
|
|
4
|
+
* sequence). The original `overflow` value is restored only once the last
|
|
5
|
+
* outstanding lock releases.
|
|
6
|
+
*/
|
|
7
|
+
export declare function lockScroll(): () => void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
let lockCount = 0;
|
|
2
|
+
let previousOverflow = '';
|
|
3
|
+
/**
|
|
4
|
+
* Ref-counted document scroll lock — safe when a lock is acquired and
|
|
5
|
+
* released more than once concurrently (e.g. a fast open/close/open
|
|
6
|
+
* sequence). The original `overflow` value is restored only once the last
|
|
7
|
+
* outstanding lock releases.
|
|
8
|
+
*/
|
|
9
|
+
export function lockScroll() {
|
|
10
|
+
if (lockCount === 0) {
|
|
11
|
+
previousOverflow = document.documentElement.style.overflow;
|
|
12
|
+
document.documentElement.style.overflow = 'hidden';
|
|
13
|
+
}
|
|
14
|
+
lockCount++;
|
|
15
|
+
let released = false;
|
|
16
|
+
return () => {
|
|
17
|
+
if (released)
|
|
18
|
+
return;
|
|
19
|
+
released = true;
|
|
20
|
+
lockCount--;
|
|
21
|
+
if (lockCount === 0) {
|
|
22
|
+
document.documentElement.style.overflow = previousOverflow;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -12,6 +12,11 @@ export const tokens = css `
|
|
|
12
12
|
--lyra-color-success: var(--wa-color-success-fill-loud, #1a7f37);
|
|
13
13
|
--lyra-color-warning: var(--wa-color-warning-fill-loud, #9a6700);
|
|
14
14
|
--lyra-color-danger: var(--wa-color-danger-fill-loud, #cf222e);
|
|
15
|
+
/* Text/icon color for content painted on top of a solid brand-fill
|
|
16
|
+
background (selected calendar days, filled badges, etc.) -- almost
|
|
17
|
+
always white on both the light and dark brand fills above, so it's
|
|
18
|
+
not itself light/dark-mode-swapped like the other tokens here. */
|
|
19
|
+
--lyra-color-on-brand: var(--wa-color-on-brand, #fff);
|
|
15
20
|
--lyra-space-xs: var(--wa-space-xs, 0.25rem);
|
|
16
21
|
--lyra-space-s: var(--wa-space-s, 0.5rem);
|
|
17
22
|
--lyra-space-m: var(--wa-space-m, 0.75rem);
|
package/dist/lyra.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ import './components/chart/box-plot.js';
|
|
|
32
32
|
import './components/chart/histogram.js';
|
|
33
33
|
import './components/map/map.js';
|
|
34
34
|
import './components/file-input/file-input.js';
|
|
35
|
+
import './components/widget/widget.js';
|
|
35
36
|
export { LyraSparkline } from './components/sparkline/sparkline.js';
|
|
36
37
|
export { LyraToast } from './components/toast/toast.js';
|
|
37
38
|
export type { ToastPlacement, ToastCreateOptions } from './components/toast/toast.js';
|
|
@@ -88,6 +89,10 @@ export type { HistogramBucket } from './components/chart/histogram-bin.js';
|
|
|
88
89
|
export { LyraMap } from './components/map/map.js';
|
|
89
90
|
export type { LegendEntry, ChoroplethLayer } from './components/map/map.js';
|
|
90
91
|
export { LyraFileInput } from './components/file-input/file-input.js';
|
|
92
|
+
export { LyraWidget } from './components/widget/widget.js';
|
|
93
|
+
export type { MapMarker } from './components/map/map.js';
|
|
94
|
+
export type { ComboboxSource, ComboboxSourceRow } from './components/combobox/combobox.js';
|
|
95
|
+
export type { CalendarDay } from './components/heatmap/calendar-grid.js';
|
|
91
96
|
export { LyraElement } from './internal/lyra-element.js';
|
|
92
97
|
export { FormAssociated } from './internal/form-associated.js';
|
|
93
98
|
export { LYRA_PREFIX, tag, defineElement } from './internal/prefix.js';
|
package/dist/lyra.js
CHANGED
|
@@ -33,6 +33,7 @@ import './components/chart/box-plot.js';
|
|
|
33
33
|
import './components/chart/histogram.js';
|
|
34
34
|
import './components/map/map.js';
|
|
35
35
|
import './components/file-input/file-input.js';
|
|
36
|
+
import './components/widget/widget.js';
|
|
36
37
|
// …and the barrel re-exports classes, helpers, and types.
|
|
37
38
|
export { LyraSparkline } from './components/sparkline/sparkline.js';
|
|
38
39
|
export { LyraToast } from './components/toast/toast.js';
|
|
@@ -73,6 +74,7 @@ export { LyraHistogram } from './components/chart/histogram.js';
|
|
|
73
74
|
export { binValues } from './components/chart/histogram-bin.js';
|
|
74
75
|
export { LyraMap } from './components/map/map.js';
|
|
75
76
|
export { LyraFileInput } from './components/file-input/file-input.js';
|
|
77
|
+
export { LyraWidget } from './components/widget/widget.js';
|
|
76
78
|
export { LyraElement } from './internal/lyra-element.js';
|
|
77
79
|
export { FormAssociated } from './internal/form-associated.js';
|
|
78
80
|
export { LYRA_PREFIX, tag, defineElement } from './internal/prefix.js';
|
package/llms.txt
CHANGED
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
## Docs
|
|
11
11
|
|
|
12
|
+
- [Live docs site](https://aceshooting.github.io/lyra-ui/): Storybook site with a live, interactive
|
|
13
|
+
example and copy-pasteable source for every component — useful for a human reviewing this
|
|
14
|
+
library, less relevant for a coding assistant already reading this file.
|
|
12
15
|
- [llms-full.txt](./llms-full.txt): Complete component-by-component API reference (properties,
|
|
13
16
|
events, slots, CSS parts, themeable custom properties, optional peer deps, usage snippets, and
|
|
14
17
|
known gotchas) for every tag in the library — the primary resource for a coding assistant
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aceshooting/lyra-ui",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Free, clean-room Lit web components — a companion to Web Awesome.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"lit": "^3.3.3"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@aceshooting/lyra-flags": "^
|
|
46
|
+
"@aceshooting/lyra-flags": "^1.0.0",
|
|
47
47
|
"@sgratzl/chartjs-chart-boxplot": "^4.4.0",
|
|
48
48
|
"chart.js": "^4.5.0",
|
|
49
49
|
"chartjs-plugin-zoom": "^2.2.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@aceshooting/lyra-flags": "^
|
|
86
|
+
"@aceshooting/lyra-flags": "^1.0.0",
|
|
87
87
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
88
88
|
"@open-wc/testing": "^4.0.0",
|
|
89
89
|
"@sgratzl/chartjs-chart-boxplot": "^4.4.5",
|