@sondor-technology/sondor-components 1.0.0-1165-initial-setup.11 → 1.0.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/package.json +2 -3
- package/src/components/alert/alert.ts +100 -100
- package/src/components/badge/badge.ts +96 -96
- package/src/components/breadcrumb/breadcrumb.ts +98 -98
- package/src/components/button/button.ts +281 -281
- package/src/components/button-group/button-group.ts +67 -67
- package/src/components/card/card.ts +52 -52
- package/src/components/checkbox/checkbox.ts +238 -238
- package/src/components/code-block/code-block.ts +256 -256
- package/src/components/content-card/content-card.ts +133 -133
- package/src/components/divider/divider.ts +68 -68
- package/src/components/drawer/drawer.ts +217 -217
- package/src/components/field/field.ts +30 -30
- package/src/components/footer/footer.ts +58 -58
- package/src/components/form/form-step.ts +32 -32
- package/src/components/form/form.ts +376 -376
- package/src/components/grid/grid-row.ts +75 -75
- package/src/components/grid/grid.ts +36 -36
- package/src/components/icon/icon-paths.ts +124 -124
- package/src/components/icon/icon.ts +82 -82
- package/src/components/input/input.ts +248 -248
- package/src/components/link/link.ts +97 -97
- package/src/components/metadata/metadata.ts +66 -66
- package/src/components/modal/modal.ts +158 -158
- package/src/components/page-layout/page-layout.ts +704 -704
- package/src/components/radio/radio.ts +142 -142
- package/src/components/radio-group/radio-group.ts +157 -157
- package/src/components/router/router.ts +46 -46
- package/src/components/select/select.ts +161 -161
- package/src/components/skeleton/skeleton.ts +67 -67
- package/src/components/switch/switch.ts +181 -181
- package/src/components/table/data-table.ts +556 -556
- package/src/components/table/table.ts +153 -153
- package/src/components/tabs/tab-panel.ts +30 -30
- package/src/components/tabs/tab.ts +76 -76
- package/src/components/tabs/tabs.ts +88 -88
- package/src/components/textarea/textarea.ts +215 -215
- package/src/components/theme-toggle/theme-toggle.ts +131 -131
- package/src/components/vertical-nav/vertical-nav-group.ts +96 -96
- package/src/components/vertical-nav/vertical-nav-item.ts +49 -49
- package/src/styles/globals.css +58 -58
- package/src/styles/index.css +80 -80
- package/src/styles/reset.ts +50 -50
- package/src/styles/theme.css +58 -58
- package/src/styles/typography.css +25 -25
- package/tsconfig.json +15 -15
- package/README.md +0 -8
- package/dist/components/alert/alert.d.ts +0 -13
- package/dist/components/alert/alert.d.ts.map +0 -1
- package/dist/components/alert/alert.js +0 -105
- package/dist/components/badge/badge.d.ts +0 -13
- package/dist/components/badge/badge.d.ts.map +0 -1
- package/dist/components/badge/badge.js +0 -101
- package/dist/components/breadcrumb/breadcrumb.d.ts +0 -19
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +0 -1
- package/dist/components/breadcrumb/breadcrumb.js +0 -99
- package/dist/components/button/button.d.ts +0 -23
- package/dist/components/button/button.d.ts.map +0 -1
- package/dist/components/button/button.js +0 -304
- package/dist/components/button-group/button-group.d.ts +0 -6
- package/dist/components/button-group/button-group.d.ts.map +0 -1
- package/dist/components/button-group/button-group.js +0 -74
- package/dist/components/card/card.d.ts +0 -11
- package/dist/components/card/card.d.ts.map +0 -1
- package/dist/components/card/card.js +0 -54
- package/dist/components/checkbox/checkbox.d.ts +0 -28
- package/dist/components/checkbox/checkbox.d.ts.map +0 -1
- package/dist/components/checkbox/checkbox.js +0 -247
- package/dist/components/code-block/code-block.d.ts +0 -20
- package/dist/components/code-block/code-block.d.ts.map +0 -1
- package/dist/components/code-block/code-block.js +0 -260
- package/dist/components/content-card/content-card.d.ts +0 -13
- package/dist/components/content-card/content-card.d.ts.map +0 -1
- package/dist/components/content-card/content-card.js +0 -140
- package/dist/components/divider/divider.d.ts +0 -16
- package/dist/components/divider/divider.d.ts.map +0 -1
- package/dist/components/divider/divider.js +0 -82
- package/dist/components/drawer/drawer.d.ts +0 -22
- package/dist/components/drawer/drawer.d.ts.map +0 -1
- package/dist/components/drawer/drawer.js +0 -226
- package/dist/components/field/field.d.ts +0 -11
- package/dist/components/field/field.d.ts.map +0 -1
- package/dist/components/field/field.js +0 -32
- package/dist/components/footer/footer.d.ts +0 -6
- package/dist/components/footer/footer.d.ts.map +0 -1
- package/dist/components/footer/footer.js +0 -65
- package/dist/components/form/form-step.d.ts +0 -13
- package/dist/components/form/form-step.d.ts.map +0 -1
- package/dist/components/form/form-step.js +0 -41
- package/dist/components/form/form.d.ts +0 -25
- package/dist/components/form/form.d.ts.map +0 -1
- package/dist/components/form/form.js +0 -358
- package/dist/components/grid/grid-row.d.ts +0 -17
- package/dist/components/grid/grid-row.d.ts.map +0 -1
- package/dist/components/grid/grid-row.js +0 -92
- package/dist/components/grid/grid.d.ts +0 -13
- package/dist/components/grid/grid.d.ts.map +0 -1
- package/dist/components/grid/grid.js +0 -42
- package/dist/components/icon/icon-paths.d.ts +0 -116
- package/dist/components/icon/icon-paths.d.ts.map +0 -1
- package/dist/components/icon/icon-paths.js +0 -121
- package/dist/components/icon/icon.d.ts +0 -16
- package/dist/components/icon/icon.d.ts.map +0 -1
- package/dist/components/icon/icon.js +0 -95
- package/dist/components/input/input.d.ts +0 -31
- package/dist/components/input/input.d.ts.map +0 -1
- package/dist/components/input/input.js +0 -268
- package/dist/components/link/link.d.ts +0 -16
- package/dist/components/link/link.d.ts.map +0 -1
- package/dist/components/link/link.js +0 -116
- package/dist/components/metadata/metadata.d.ts +0 -18
- package/dist/components/metadata/metadata.d.ts.map +0 -1
- package/dist/components/metadata/metadata.js +0 -71
- package/dist/components/modal/modal.d.ts +0 -24
- package/dist/components/modal/modal.d.ts.map +0 -1
- package/dist/components/modal/modal.js +0 -163
- package/dist/components/page-layout/page-layout.d.ts +0 -46
- package/dist/components/page-layout/page-layout.d.ts.map +0 -1
- package/dist/components/page-layout/page-layout.js +0 -697
- package/dist/components/radio/radio.d.ts +0 -16
- package/dist/components/radio/radio.d.ts.map +0 -1
- package/dist/components/radio/radio.js +0 -152
- package/dist/components/radio-group/radio-group.d.ts +0 -27
- package/dist/components/radio-group/radio-group.d.ts.map +0 -1
- package/dist/components/radio-group/radio-group.js +0 -161
- package/dist/components/router/router.d.ts +0 -7
- package/dist/components/router/router.d.ts.map +0 -1
- package/dist/components/router/router.js +0 -37
- package/dist/components/select/select.d.ts +0 -16
- package/dist/components/select/select.d.ts.map +0 -1
- package/dist/components/select/select.js +0 -172
- package/dist/components/skeleton/skeleton.d.ts +0 -17
- package/dist/components/skeleton/skeleton.d.ts.map +0 -1
- package/dist/components/skeleton/skeleton.js +0 -78
- package/dist/components/switch/switch.d.ts +0 -25
- package/dist/components/switch/switch.d.ts.map +0 -1
- package/dist/components/switch/switch.js +0 -185
- package/dist/components/table/data-table.d.ts +0 -72
- package/dist/components/table/data-table.d.ts.map +0 -1
- package/dist/components/table/data-table.js +0 -551
- package/dist/components/table/table.d.ts +0 -22
- package/dist/components/table/table.d.ts.map +0 -1
- package/dist/components/table/table.js +0 -167
- package/dist/components/tabs/tab-panel.d.ts +0 -8
- package/dist/components/tabs/tab-panel.d.ts.map +0 -1
- package/dist/components/tabs/tab-panel.js +0 -46
- package/dist/components/tabs/tab.d.ts +0 -9
- package/dist/components/tabs/tab.d.ts.map +0 -1
- package/dist/components/tabs/tab.js +0 -91
- package/dist/components/tabs/tabs.d.ts +0 -14
- package/dist/components/tabs/tabs.d.ts.map +0 -1
- package/dist/components/tabs/tabs.js +0 -85
- package/dist/components/textarea/textarea.d.ts +0 -36
- package/dist/components/textarea/textarea.d.ts.map +0 -1
- package/dist/components/textarea/textarea.js +0 -231
- package/dist/components/theme-toggle/theme-toggle.d.ts +0 -15
- package/dist/components/theme-toggle/theme-toggle.d.ts.map +0 -1
- package/dist/components/theme-toggle/theme-toggle.js +0 -130
- package/dist/components/vertical-nav/vertical-nav-group.d.ts +0 -9
- package/dist/components/vertical-nav/vertical-nav-group.d.ts.map +0 -1
- package/dist/components/vertical-nav/vertical-nav-group.js +0 -111
- package/dist/components/vertical-nav/vertical-nav-item.d.ts +0 -8
- package/dist/components/vertical-nav/vertical-nav-item.d.ts.map +0 -1
- package/dist/components/vertical-nav/vertical-nav-item.js +0 -65
- package/dist/styles/index.css +0 -171
- package/dist/styles/reset.d.ts +0 -2
- package/dist/styles/reset.d.ts.map +0 -1
- package/dist/styles/reset.js +0 -50
|
@@ -1,231 +0,0 @@
|
|
|
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, html, css } from "lit";
|
|
8
|
-
import { customElement, property, query } from "lit/decorators.js";
|
|
9
|
-
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
|
-
import { resetStyles } from "../../styles/reset.js";
|
|
11
|
-
let StTextarea = class StTextarea extends LitElement {
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
|
-
this.name = "";
|
|
15
|
-
this.label = "";
|
|
16
|
-
this.value = "";
|
|
17
|
-
this.placeholder = "";
|
|
18
|
-
this.helpText = "";
|
|
19
|
-
// Textarea specific properties
|
|
20
|
-
this.rows = 4;
|
|
21
|
-
this.resize = "vertical";
|
|
22
|
-
// Validation
|
|
23
|
-
this.required = false;
|
|
24
|
-
// States
|
|
25
|
-
this.disabled = false;
|
|
26
|
-
this.invalid = false;
|
|
27
|
-
this.readonly = false;
|
|
28
|
-
this._internals = this.attachInternals();
|
|
29
|
-
// 1. Trigger error state if the user clicks away and the field is invalid
|
|
30
|
-
this.addEventListener("focusout", () => {
|
|
31
|
-
this.invalid = !this._textareaEl.validity.valid;
|
|
32
|
-
});
|
|
33
|
-
// 2. Trigger error state if the st-form tries to submit and fails
|
|
34
|
-
this.addEventListener("invalid", () => {
|
|
35
|
-
this.invalid = true;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
updated(changedProperties) {
|
|
39
|
-
super.updated(changedProperties);
|
|
40
|
-
if (changedProperties.has("value")) {
|
|
41
|
-
this._internals.setFormValue(this.value);
|
|
42
|
-
}
|
|
43
|
-
this._syncValidity();
|
|
44
|
-
}
|
|
45
|
-
_syncValidity() {
|
|
46
|
-
if (!this._textareaEl)
|
|
47
|
-
return;
|
|
48
|
-
this._internals.setValidity(this._textareaEl.validity, this._textareaEl.validationMessage, this._textareaEl);
|
|
49
|
-
}
|
|
50
|
-
formResetCallback() {
|
|
51
|
-
this.value = "";
|
|
52
|
-
this._internals.setFormValue("");
|
|
53
|
-
this.updateComplete.then(() => this._syncValidity());
|
|
54
|
-
}
|
|
55
|
-
checkValidity() {
|
|
56
|
-
return this._internals.checkValidity();
|
|
57
|
-
}
|
|
58
|
-
reportValidity() {
|
|
59
|
-
return this._internals.reportValidity();
|
|
60
|
-
}
|
|
61
|
-
_handleInput(e) {
|
|
62
|
-
const target = e.target;
|
|
63
|
-
this.value = target.value;
|
|
64
|
-
if (this.invalid && target.validity.valid) {
|
|
65
|
-
this.invalid = false;
|
|
66
|
-
}
|
|
67
|
-
this.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
|
|
68
|
-
}
|
|
69
|
-
_handleChange(e) {
|
|
70
|
-
this.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
|
|
71
|
-
}
|
|
72
|
-
render() {
|
|
73
|
-
return html `
|
|
74
|
-
<div class="form-control">
|
|
75
|
-
${this.label ? html `<label for="textarea">${this.label}</label>` : ""}
|
|
76
|
-
|
|
77
|
-
<textarea
|
|
78
|
-
id="textarea"
|
|
79
|
-
.name=${this.name}
|
|
80
|
-
.value=${this.value}
|
|
81
|
-
placeholder=${this.placeholder}
|
|
82
|
-
rows=${this.rows}
|
|
83
|
-
?disabled=${this.disabled}
|
|
84
|
-
?readonly=${this.readonly}
|
|
85
|
-
?required=${this.required}
|
|
86
|
-
minlength=${ifDefined(this.minlength)}
|
|
87
|
-
maxlength=${ifDefined(this.maxlength)}
|
|
88
|
-
@input=${this._handleInput}
|
|
89
|
-
@change=${this._handleChange}
|
|
90
|
-
></textarea>
|
|
91
|
-
|
|
92
|
-
${this.helpText ? html `<div class="help-text">${this.helpText}</div>` : ""}
|
|
93
|
-
</div>
|
|
94
|
-
`;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
StTextarea.formAssociated = true;
|
|
98
|
-
StTextarea.styles = [
|
|
99
|
-
resetStyles,
|
|
100
|
-
css `
|
|
101
|
-
:host {
|
|
102
|
-
display: block;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.form-control {
|
|
106
|
-
display: flex;
|
|
107
|
-
flex-direction: column;
|
|
108
|
-
gap: var(--st-spacing-xs);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
label {
|
|
112
|
-
font-size: var(--st-font-size-sm);
|
|
113
|
-
font-weight: var(--st-font-weight-medium);
|
|
114
|
-
color: var(--st-color-text);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
textarea {
|
|
118
|
-
width: 100%;
|
|
119
|
-
padding: var(--st-spacing-sm) var(--st-spacing-md);
|
|
120
|
-
font-size: var(--st-font-size-base);
|
|
121
|
-
font-family: inherit;
|
|
122
|
-
color: var(--st-color-text);
|
|
123
|
-
background-color: var(--st-color-bg);
|
|
124
|
-
border: 1px solid var(--st-color-border);
|
|
125
|
-
border-radius: 4px;
|
|
126
|
-
transition:
|
|
127
|
-
border-color 0.2s ease,
|
|
128
|
-
box-shadow 0.2s ease;
|
|
129
|
-
|
|
130
|
-
/* Map the resize property */
|
|
131
|
-
resize: vertical;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/* Dynamically handle resize constraints based on the host attribute */
|
|
135
|
-
:host([resize="none"]) textarea {
|
|
136
|
-
resize: none;
|
|
137
|
-
}
|
|
138
|
-
:host([resize="horizontal"]) textarea {
|
|
139
|
-
resize: horizontal;
|
|
140
|
-
}
|
|
141
|
-
:host([resize="both"]) textarea {
|
|
142
|
-
resize: both;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
textarea::placeholder {
|
|
146
|
-
color: var(--st-color-text-muted);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
textarea:focus {
|
|
150
|
-
outline: none;
|
|
151
|
-
border-color: var(--st-color-primary);
|
|
152
|
-
box-shadow: 0 0 0 1px var(--st-color-primary);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/* Validation States */
|
|
156
|
-
:host([invalid]) textarea {
|
|
157
|
-
border-color: var(--st-color-error);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
:host([invalid]) textarea:focus {
|
|
161
|
-
box-shadow: 0 0 0 1px var(--st-color-error);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
:host([invalid]) .help-text {
|
|
165
|
-
color: var(--st-color-error);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/* Disabled & Readonly */
|
|
169
|
-
:host([disabled]) textarea {
|
|
170
|
-
opacity: 0.5;
|
|
171
|
-
cursor: not-allowed;
|
|
172
|
-
background-color: var(--st-color-surface);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
:host([readonly]) textarea {
|
|
176
|
-
background-color: var(--st-color-surface);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.help-text {
|
|
180
|
-
font-size: var(--st-font-size-xs);
|
|
181
|
-
color: var(--st-color-text-muted);
|
|
182
|
-
margin: 0;
|
|
183
|
-
}
|
|
184
|
-
`,
|
|
185
|
-
];
|
|
186
|
-
__decorate([
|
|
187
|
-
query("textarea")
|
|
188
|
-
], StTextarea.prototype, "_textareaEl", void 0);
|
|
189
|
-
__decorate([
|
|
190
|
-
property({ type: String, reflect: true })
|
|
191
|
-
], StTextarea.prototype, "name", void 0);
|
|
192
|
-
__decorate([
|
|
193
|
-
property({ type: String })
|
|
194
|
-
], StTextarea.prototype, "label", void 0);
|
|
195
|
-
__decorate([
|
|
196
|
-
property({ type: String })
|
|
197
|
-
], StTextarea.prototype, "value", void 0);
|
|
198
|
-
__decorate([
|
|
199
|
-
property({ type: String })
|
|
200
|
-
], StTextarea.prototype, "placeholder", void 0);
|
|
201
|
-
__decorate([
|
|
202
|
-
property({ attribute: "help-text" })
|
|
203
|
-
], StTextarea.prototype, "helpText", void 0);
|
|
204
|
-
__decorate([
|
|
205
|
-
property({ type: Number })
|
|
206
|
-
], StTextarea.prototype, "rows", void 0);
|
|
207
|
-
__decorate([
|
|
208
|
-
property({ type: String, reflect: true })
|
|
209
|
-
], StTextarea.prototype, "resize", void 0);
|
|
210
|
-
__decorate([
|
|
211
|
-
property({ type: Boolean, reflect: true })
|
|
212
|
-
], StTextarea.prototype, "required", void 0);
|
|
213
|
-
__decorate([
|
|
214
|
-
property({ type: Number })
|
|
215
|
-
], StTextarea.prototype, "minlength", void 0);
|
|
216
|
-
__decorate([
|
|
217
|
-
property({ type: Number })
|
|
218
|
-
], StTextarea.prototype, "maxlength", void 0);
|
|
219
|
-
__decorate([
|
|
220
|
-
property({ type: Boolean, reflect: true })
|
|
221
|
-
], StTextarea.prototype, "disabled", void 0);
|
|
222
|
-
__decorate([
|
|
223
|
-
property({ type: Boolean, reflect: true })
|
|
224
|
-
], StTextarea.prototype, "invalid", void 0);
|
|
225
|
-
__decorate([
|
|
226
|
-
property({ type: Boolean, reflect: true })
|
|
227
|
-
], StTextarea.prototype, "readonly", void 0);
|
|
228
|
-
StTextarea = __decorate([
|
|
229
|
-
customElement("st-textarea")
|
|
230
|
-
], StTextarea);
|
|
231
|
-
export { StTextarea };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
2
|
-
export type ThemeMode = "light" | "system" | "dark";
|
|
3
|
-
export declare class StThemeToggle extends LitElement {
|
|
4
|
-
theme: ThemeMode;
|
|
5
|
-
static styles: import("lit").CSSResult[];
|
|
6
|
-
private _handleThemeChange;
|
|
7
|
-
connectedCallback(): void;
|
|
8
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
-
}
|
|
10
|
-
declare global {
|
|
11
|
-
interface HTMLElementTagNameMap {
|
|
12
|
-
"st-theme-toggle": StThemeToggle;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=theme-toggle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/theme-toggle/theme-toggle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAI1C,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEpD,qBACa,aAAc,SAAQ,UAAU;IACF,KAAK,EAAE,SAAS,CAAY;IAErE,MAAM,CAAC,MAAM,4BAkDX;IAEF,OAAO,CAAC,kBAAkB;IAajB,iBAAiB,SAOzB;IAED,MAAM,yCAuCL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
|
|
@@ -1,130 +0,0 @@
|
|
|
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, html, css } from "lit";
|
|
8
|
-
import { customElement, property } from "lit/decorators.js";
|
|
9
|
-
import { resetStyles } from "../../styles/reset.js";
|
|
10
|
-
let StThemeToggle = class StThemeToggle extends LitElement {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.theme = "system";
|
|
14
|
-
}
|
|
15
|
-
_handleThemeChange(newTheme) {
|
|
16
|
-
this.theme = newTheme;
|
|
17
|
-
// Dispatch an event so the consuming app knows to update the document root
|
|
18
|
-
this.dispatchEvent(new CustomEvent("st-theme-change", {
|
|
19
|
-
detail: { theme: newTheme },
|
|
20
|
-
bubbles: true,
|
|
21
|
-
composed: true,
|
|
22
|
-
}));
|
|
23
|
-
}
|
|
24
|
-
connectedCallback() {
|
|
25
|
-
super.connectedCallback();
|
|
26
|
-
// Check the html tag for the theme injected by your blocking <head> script
|
|
27
|
-
const rootTheme = document.documentElement.getAttribute("data-theme");
|
|
28
|
-
if (rootTheme) {
|
|
29
|
-
this.theme = rootTheme;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
return html `
|
|
34
|
-
<button
|
|
35
|
-
aria-pressed=${this.theme === "light"}
|
|
36
|
-
title="Light Mode"
|
|
37
|
-
@click=${() => this._handleThemeChange("light")}
|
|
38
|
-
>
|
|
39
|
-
<!-- Sun Icon -->
|
|
40
|
-
<svg viewBox="0 0 24 24">
|
|
41
|
-
<circle cx="12" cy="12" r="5"></circle>
|
|
42
|
-
<path
|
|
43
|
-
d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"
|
|
44
|
-
></path>
|
|
45
|
-
</svg>
|
|
46
|
-
</button>
|
|
47
|
-
|
|
48
|
-
<button
|
|
49
|
-
aria-pressed=${this.theme === "system"}
|
|
50
|
-
title="System Preference"
|
|
51
|
-
@click=${() => this._handleThemeChange("system")}
|
|
52
|
-
>
|
|
53
|
-
<!-- Monitor/System Icon -->
|
|
54
|
-
<svg viewBox="0 0 24 24">
|
|
55
|
-
<rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect>
|
|
56
|
-
<path d="M8 21h8M12 17v4"></path>
|
|
57
|
-
</svg>
|
|
58
|
-
</button>
|
|
59
|
-
|
|
60
|
-
<button
|
|
61
|
-
aria-pressed=${this.theme === "dark"}
|
|
62
|
-
title="Dark Mode"
|
|
63
|
-
@click=${() => this._handleThemeChange("dark")}
|
|
64
|
-
>
|
|
65
|
-
<!-- Moon Icon -->
|
|
66
|
-
<svg viewBox="0 0 24 24">
|
|
67
|
-
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
|
|
68
|
-
</svg>
|
|
69
|
-
</button>
|
|
70
|
-
`;
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
StThemeToggle.styles = [
|
|
74
|
-
resetStyles,
|
|
75
|
-
css `
|
|
76
|
-
:host {
|
|
77
|
-
display: inline-flex;
|
|
78
|
-
/* Use semantic tokens for the container */
|
|
79
|
-
background-color: var(--st-color-surface);
|
|
80
|
-
border: 1px solid var(--st-color-border);
|
|
81
|
-
border-radius: 999px;
|
|
82
|
-
padding: 4px;
|
|
83
|
-
gap: 2px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
button {
|
|
87
|
-
display: flex;
|
|
88
|
-
align-items: center;
|
|
89
|
-
justify-content: center;
|
|
90
|
-
width: 28px;
|
|
91
|
-
height: 28px;
|
|
92
|
-
border-radius: 50%;
|
|
93
|
-
border: none;
|
|
94
|
-
background: transparent;
|
|
95
|
-
color: var(--st-color-text-muted);
|
|
96
|
-
cursor: pointer;
|
|
97
|
-
transition: all 0.2s ease;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
button:hover {
|
|
101
|
-
color: var(--st-color-text);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/* Active State Styling */
|
|
105
|
-
button[aria-pressed="true"] {
|
|
106
|
-
/* Use the main background color so the active pill "pops" out of the surface */
|
|
107
|
-
background-color: var(--st-color-bg);
|
|
108
|
-
color: var(--st-color-primary);
|
|
109
|
-
/* Subtle shadow to lift the active pill */
|
|
110
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
svg {
|
|
114
|
-
width: 16px;
|
|
115
|
-
height: 16px;
|
|
116
|
-
fill: none;
|
|
117
|
-
stroke: currentColor;
|
|
118
|
-
stroke-width: 2;
|
|
119
|
-
stroke-linecap: round;
|
|
120
|
-
stroke-linejoin: round;
|
|
121
|
-
}
|
|
122
|
-
`,
|
|
123
|
-
];
|
|
124
|
-
__decorate([
|
|
125
|
-
property({ type: String, reflect: true })
|
|
126
|
-
], StThemeToggle.prototype, "theme", void 0);
|
|
127
|
-
StThemeToggle = __decorate([
|
|
128
|
-
customElement("st-theme-toggle")
|
|
129
|
-
], StThemeToggle);
|
|
130
|
-
export { StThemeToggle };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
export declare class StNavGroup extends LitElement {
|
|
3
|
-
label: string;
|
|
4
|
-
open: boolean;
|
|
5
|
-
static styles: import("lit").CSSResult[];
|
|
6
|
-
private _toggle;
|
|
7
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=vertical-nav-group.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vertical-nav-group.d.ts","sourceRoot":"","sources":["../../../src/components/vertical-nav/vertical-nav-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,UAAW,SAAQ,UAAU;IACZ,KAAK,SAAM;IACK,IAAI,UAAS;IAEzD,MAAM,CAAC,MAAM,4BA8DX;IAEF,OAAO,CAAC,OAAO;IAIf,MAAM,yCAkBL;CACF"}
|
|
@@ -1,111 +0,0 @@
|
|
|
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, html, css } from 'lit';
|
|
8
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
-
import { resetStyles } from '../../styles/reset.js';
|
|
10
|
-
let StNavGroup = class StNavGroup extends LitElement {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.label = '';
|
|
14
|
-
this.open = false;
|
|
15
|
-
}
|
|
16
|
-
_toggle() {
|
|
17
|
-
this.open = !this.open;
|
|
18
|
-
}
|
|
19
|
-
render() {
|
|
20
|
-
return html `
|
|
21
|
-
<button @click=${this._toggle} aria-expanded=${this.open}>
|
|
22
|
-
${this.label}
|
|
23
|
-
<svg viewBox="0 0 24 24">
|
|
24
|
-
<path d="M6 9l6 6 6-6"></path>
|
|
25
|
-
</svg>
|
|
26
|
-
</button>
|
|
27
|
-
|
|
28
|
-
<div class="drawer">
|
|
29
|
-
<div class="drawer-content">
|
|
30
|
-
<!-- We add slight padding top/bottom so the inner links breathe -->
|
|
31
|
-
<div style="padding: 4px 0;">
|
|
32
|
-
<slot></slot>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
`;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
StNavGroup.styles = [
|
|
40
|
-
resetStyles,
|
|
41
|
-
css `
|
|
42
|
-
:host {
|
|
43
|
-
display: block;
|
|
44
|
-
margin-bottom: var(--st-spacing-sm);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
button {
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
justify-content: space-between;
|
|
51
|
-
width: 100%;
|
|
52
|
-
background: transparent;
|
|
53
|
-
border: none;
|
|
54
|
-
padding: var(--st-spacing-xs) var(--st-spacing-lg);
|
|
55
|
-
color: var(--st-color-text);
|
|
56
|
-
font-size: var(--st-font-size-sm);
|
|
57
|
-
font-weight: var(--st-font-weight-bold);
|
|
58
|
-
cursor: pointer;
|
|
59
|
-
text-align: left;
|
|
60
|
-
transition: color 0.2s ease;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
button:hover {
|
|
64
|
-
color: var(--st-color-primary);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
svg {
|
|
68
|
-
width: 1rem;
|
|
69
|
-
height: 1rem;
|
|
70
|
-
fill: none;
|
|
71
|
-
stroke: currentColor;
|
|
72
|
-
stroke-width: 2;
|
|
73
|
-
stroke-linecap: round;
|
|
74
|
-
stroke-linejoin: round;
|
|
75
|
-
transition: transform 0.2s ease;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/* Rotate Chevron when open */
|
|
79
|
-
:host([open]) svg {
|
|
80
|
-
transform: rotate(180deg);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/* Modern CSS Grid Animation trick for accordion height */
|
|
84
|
-
.drawer {
|
|
85
|
-
display: grid;
|
|
86
|
-
grid-template-rows: 0fr;
|
|
87
|
-
transition: grid-template-rows 0.2s ease-in-out;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
:host([open]) .drawer {
|
|
91
|
-
grid-template-rows: 1fr;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.drawer-content {
|
|
95
|
-
overflow: hidden;
|
|
96
|
-
display: flex;
|
|
97
|
-
flex-direction: column;
|
|
98
|
-
gap: 2px;
|
|
99
|
-
}
|
|
100
|
-
`
|
|
101
|
-
];
|
|
102
|
-
__decorate([
|
|
103
|
-
property({ type: String })
|
|
104
|
-
], StNavGroup.prototype, "label", void 0);
|
|
105
|
-
__decorate([
|
|
106
|
-
property({ type: Boolean, reflect: true })
|
|
107
|
-
], StNavGroup.prototype, "open", void 0);
|
|
108
|
-
StNavGroup = __decorate([
|
|
109
|
-
customElement('st-vertical-nav-group')
|
|
110
|
-
], StNavGroup);
|
|
111
|
-
export { StNavGroup };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
export declare class StNavItem extends LitElement {
|
|
3
|
-
href: string;
|
|
4
|
-
active: boolean;
|
|
5
|
-
static styles: import("lit").CSSResult[];
|
|
6
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=vertical-nav-item.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vertical-nav-item.d.ts","sourceRoot":"","sources":["../../../src/components/vertical-nav/vertical-nav-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,SAAU,SAAQ,UAAU;IACX,IAAI,SAAO;IACK,MAAM,UAAS;IAE3D,MAAM,CAAC,MAAM,4BA+BX;IAEF,MAAM,yCAML;CACF"}
|
|
@@ -1,65 +0,0 @@
|
|
|
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, html, css } from 'lit';
|
|
8
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
-
import { resetStyles } from '../../styles/reset.js';
|
|
10
|
-
let StNavItem = class StNavItem extends LitElement {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.href = '#';
|
|
14
|
-
this.active = false;
|
|
15
|
-
}
|
|
16
|
-
render() {
|
|
17
|
-
return html `
|
|
18
|
-
<a href=${this.href} part="link">
|
|
19
|
-
<slot></slot>
|
|
20
|
-
</a>
|
|
21
|
-
`;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
StNavItem.styles = [
|
|
25
|
-
resetStyles,
|
|
26
|
-
css `
|
|
27
|
-
:host {
|
|
28
|
-
display: block;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
a {
|
|
32
|
-
display: flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
padding: 6px var(--st-spacing-lg);
|
|
35
|
-
color: var(--st-color-text-muted);
|
|
36
|
-
font-size: var(--st-font-size-sm);
|
|
37
|
-
text-decoration: none;
|
|
38
|
-
border-left: 2px solid transparent;
|
|
39
|
-
transition: all 0.15s ease;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
a:hover {
|
|
43
|
-
color: var(--st-color-text);
|
|
44
|
-
background-color: var(--st-color-surface);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/* Active state: Purple text with a left border indicator */
|
|
48
|
-
:host([active]) a {
|
|
49
|
-
color: var(--st-color-primary);
|
|
50
|
-
border-left-color: var(--st-color-primary);
|
|
51
|
-
font-weight: var(--st-font-weight-medium);
|
|
52
|
-
background-color: transparent;
|
|
53
|
-
}
|
|
54
|
-
`
|
|
55
|
-
];
|
|
56
|
-
__decorate([
|
|
57
|
-
property({ type: String })
|
|
58
|
-
], StNavItem.prototype, "href", void 0);
|
|
59
|
-
__decorate([
|
|
60
|
-
property({ type: Boolean, reflect: true })
|
|
61
|
-
], StNavItem.prototype, "active", void 0);
|
|
62
|
-
StNavItem = __decorate([
|
|
63
|
-
customElement('st-vertical-nav-item')
|
|
64
|
-
], StNavItem);
|
|
65
|
-
export { StNavItem };
|