@sondor-technology/sondor-components 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/alert/alert.constants.d.ts +3 -0
- package/dist/components/alert/alert.constants.d.ts.map +1 -0
- package/dist/components/alert/alert.constants.js +2 -0
- package/dist/components/alert/alert.constants.js.map +1 -0
- package/dist/components/alert/alert.d.ts +4 -3
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/alert.js +21 -11
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/badge/badge.constants.d.ts +3 -0
- package/dist/components/badge/badge.constants.d.ts.map +1 -0
- package/dist/components/badge/badge.constants.js +2 -0
- package/dist/components/badge/badge.constants.js.map +1 -0
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +3 -2
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +2 -1
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/button/button.constants.d.ts +7 -0
- package/dist/components/button/button.constants.d.ts.map +1 -0
- package/dist/components/button/button.constants.js +4 -0
- package/dist/components/button/button.constants.js.map +1 -0
- package/dist/components/button/button.d.ts +8 -4
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +181 -137
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button-group/button-group.d.ts +6 -0
- package/dist/components/button-group/button-group.d.ts.map +1 -1
- package/dist/components/button-group/button-group.js +17 -21
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/checkbox/checkbox.constants.d.ts +3 -0
- package/dist/components/checkbox/checkbox.constants.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.constants.js +2 -0
- package/dist/components/checkbox/checkbox.constants.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +5 -1
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.js +21 -5
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +12 -7
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/code-block.js +130 -66
- package/dist/components/code-block/code-block.js.map +1 -0
- package/dist/components/content-card/content-card.d.ts.map +1 -1
- package/dist/components/content-card/content-card.js +10 -15
- package/dist/components/content-card/content-card.js.map +1 -0
- package/dist/components/divider/divider.constants.d.ts +5 -0
- package/dist/components/divider/divider.constants.d.ts.map +1 -0
- package/dist/components/divider/divider.constants.js +3 -0
- package/dist/components/divider/divider.constants.js.map +1 -0
- package/dist/components/divider/divider.d.ts +4 -2
- package/dist/components/divider/divider.d.ts.map +1 -1
- package/dist/components/divider/divider.js +18 -9
- package/dist/components/divider/divider.js.map +1 -0
- package/dist/components/drawer/drawer.d.ts +7 -4
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/drawer.js +73 -30
- package/dist/components/drawer/drawer.js.map +1 -0
- package/dist/components/field/field.d.ts +2 -2
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/field.js +8 -9
- package/dist/components/field/field.js.map +1 -0
- package/dist/components/footer/footer.d.ts +8 -1
- package/dist/components/footer/footer.d.ts.map +1 -1
- package/dist/components/footer/footer.js +42 -12
- package/dist/components/footer/footer.js.map +1 -0
- package/dist/components/form/form-step.js +1 -0
- package/dist/components/form/form-step.js.map +1 -0
- package/dist/components/form/form.d.ts +3 -0
- package/dist/components/form/form.d.ts.map +1 -1
- package/dist/components/form/form.js +107 -67
- package/dist/components/form/form.js.map +1 -0
- package/dist/components/grid/grid-row.d.ts +3 -3
- package/dist/components/grid/grid-row.d.ts.map +1 -1
- package/dist/components/grid/grid-row.js +36 -22
- package/dist/components/grid/grid-row.js.map +1 -0
- package/dist/components/grid/grid.d.ts +2 -2
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/grid.js +5 -2
- package/dist/components/grid/grid.js.map +1 -0
- package/dist/components/icon/icon-paths.js +1 -0
- package/dist/components/icon/icon-paths.js.map +1 -0
- package/dist/components/icon/icon.js +1 -0
- package/dist/components/icon/icon.js.map +1 -0
- package/dist/components/input/input.d.ts +14 -0
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/input/input.js +30 -37
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/link/link.d.ts +6 -6
- package/dist/components/link/link.d.ts.map +1 -1
- package/dist/components/link/link.js +42 -19
- package/dist/components/link/link.js.map +1 -0
- package/dist/components/metadata/metadata.d.ts +3 -3
- package/dist/components/metadata/metadata.d.ts.map +1 -1
- package/dist/components/metadata/metadata.js +23 -20
- package/dist/components/metadata/metadata.js.map +1 -0
- package/dist/components/modal/modal.d.ts +4 -16
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/modal/modal.js +99 -62
- package/dist/components/modal/modal.js.map +1 -0
- package/dist/components/page-layout/page-layout.d.ts +4 -3
- package/dist/components/page-layout/page-layout.d.ts.map +1 -1
- package/dist/components/page-layout/page-layout.js +96 -69
- package/dist/components/page-layout/page-layout.js.map +1 -0
- package/dist/components/radio/radio.d.ts +8 -0
- package/dist/components/radio/radio.d.ts.map +1 -1
- package/dist/components/radio/radio.js +8 -12
- package/dist/components/radio/radio.js.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +6 -1
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/radio-group.js +44 -18
- package/dist/components/radio-group/radio-group.js.map +1 -0
- package/dist/components/router/router.d.ts +5 -7
- package/dist/components/router/router.d.ts.map +1 -1
- package/dist/components/router/router.js +54 -38
- package/dist/components/router/router.js.map +1 -0
- package/dist/components/select/select.d.ts +41 -7
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +467 -150
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +3 -2
- package/dist/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton/skeleton.js +10 -13
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/switch/switch.d.ts +12 -0
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/switch/switch.js +28 -22
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/table/data-table.d.ts +3 -25
- package/dist/components/table/data-table.d.ts.map +1 -1
- package/dist/components/table/data-table.js +211 -146
- package/dist/components/table/data-table.js.map +1 -0
- package/dist/components/table/table.d.ts +3 -3
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +39 -20
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/tabs/tab-panel.d.ts +8 -1
- package/dist/components/tabs/tab-panel.d.ts.map +1 -1
- package/dist/components/tabs/tab-panel.js +21 -11
- package/dist/components/tabs/tab-panel.js.map +1 -0
- package/dist/components/tabs/tab.d.ts +10 -1
- package/dist/components/tabs/tab.d.ts.map +1 -1
- package/dist/components/tabs/tab.js +46 -28
- package/dist/components/tabs/tab.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +9 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +76 -13
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/textarea/textarea.d.ts +13 -0
- package/dist/components/textarea/textarea.d.ts.map +1 -1
- package/dist/components/textarea/textarea.js +59 -13
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/theme-toggle/theme-toggle.constants.d.ts +3 -0
- package/dist/components/theme-toggle/theme-toggle.constants.d.ts.map +1 -0
- package/dist/components/theme-toggle/theme-toggle.constants.js +2 -0
- package/dist/components/theme-toggle/theme-toggle.constants.js.map +1 -0
- package/dist/components/theme-toggle/theme-toggle.d.ts +3 -2
- package/dist/components/theme-toggle/theme-toggle.d.ts.map +1 -1
- package/dist/components/theme-toggle/theme-toggle.js +46 -19
- package/dist/components/theme-toggle/theme-toggle.js.map +1 -0
- package/dist/components/vertical-nav/vertical-nav-group.d.ts +5 -2
- package/dist/components/vertical-nav/vertical-nav-group.d.ts.map +1 -1
- package/dist/components/vertical-nav/vertical-nav-group.js +50 -14
- package/dist/components/vertical-nav/vertical-nav-group.js.map +1 -0
- package/dist/components/vertical-nav/vertical-nav-item.d.ts +3 -2
- package/dist/components/vertical-nav/vertical-nav-item.d.ts.map +1 -1
- package/dist/components/vertical-nav/vertical-nav-item.js +30 -8
- package/dist/components/vertical-nav/vertical-nav-item.js.map +1 -0
- package/dist/styles/index.css +50 -17
- package/dist/styles/reset.js +1 -0
- package/dist/styles/reset.js.map +1 -0
- package/package.json +2 -1
- package/src/components/alert/alert.constants.ts +2 -0
- package/src/components/alert/alert.ts +24 -15
- package/src/components/badge/badge.constants.ts +2 -0
- package/src/components/badge/badge.ts +3 -4
- package/src/components/breadcrumb/breadcrumb.ts +2 -2
- package/src/components/button/button.constants.ts +8 -0
- package/src/components/button/button.ts +184 -144
- package/src/components/button-group/button-group.ts +23 -21
- package/src/components/checkbox/checkbox.constants.ts +2 -0
- package/src/components/checkbox/checkbox.ts +33 -18
- package/src/components/code-block/code-block.ts +157 -84
- package/src/components/content-card/content-card.ts +10 -16
- package/src/components/divider/divider.constants.ts +5 -0
- package/src/components/divider/divider.ts +22 -11
- package/src/components/drawer/drawer.ts +79 -34
- package/src/components/field/field.ts +9 -11
- package/src/components/footer/footer.ts +43 -12
- package/src/components/form/form.ts +120 -83
- package/src/components/grid/grid-row.ts +45 -32
- package/src/components/grid/grid.ts +7 -4
- package/src/components/input/input.ts +37 -41
- package/src/components/link/link.ts +45 -21
- package/src/components/metadata/metadata.ts +26 -24
- package/src/components/modal/modal.ts +108 -74
- package/src/components/page-layout/page-layout.ts +98 -73
- package/src/components/radio/radio.ts +8 -13
- package/src/components/radio-group/radio-group.ts +45 -21
- package/src/components/router/router.ts +73 -50
- package/src/components/select/select.ts +502 -131
- package/src/components/skeleton/skeleton.ts +14 -14
- package/src/components/switch/switch.ts +31 -25
- package/src/components/table/data-table.ts +248 -177
- package/src/components/table/table.ts +52 -29
- package/src/components/tabs/tab-panel.ts +30 -13
- package/src/components/tabs/tab.ts +64 -33
- package/src/components/tabs/tabs.ts +82 -14
- package/src/components/textarea/textarea.ts +63 -15
- package/src/components/theme-toggle/theme-toggle.constants.ts +2 -0
- package/src/components/theme-toggle/theme-toggle.ts +47 -22
- package/src/components/vertical-nav/vertical-nav-group.ts +57 -18
- package/src/components/vertical-nav/vertical-nav-item.ts +35 -12
- package/src/styles/globals.css +27 -4
- package/src/styles/theme.css +39 -31
- package/tsconfig.json +2 -1
- 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/src/components/card/card.ts +0 -53
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { LitElement, html, css } from "lit";
|
|
8
8
|
import { customElement, property, query } from "lit/decorators.js";
|
|
9
|
-
import { ifDefined } from "lit/directives/if-defined.js";
|
|
9
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
10
|
import { resetStyles } from "../../styles/reset.js";
|
|
11
11
|
let StInput = class StInput extends LitElement {
|
|
12
12
|
constructor() {
|
|
@@ -17,43 +17,35 @@ let StInput = class StInput extends LitElement {
|
|
|
17
17
|
this.placeholder = "";
|
|
18
18
|
this.type = "text";
|
|
19
19
|
this.helpText = "";
|
|
20
|
-
// Validation Properties
|
|
21
20
|
this.required = false;
|
|
22
21
|
this.disabled = false;
|
|
23
22
|
this.invalid = false;
|
|
24
23
|
this.readonly = false;
|
|
25
24
|
this._internals = this.attachInternals();
|
|
26
|
-
// 1. Trigger error state if the user clicks away and the field is invalid
|
|
27
25
|
this.addEventListener("focusout", () => {
|
|
28
26
|
this.invalid = !this._inputEl.validity.valid;
|
|
29
27
|
});
|
|
30
|
-
// 2. Trigger error state if the st-form tries to submit and fails
|
|
31
28
|
this.addEventListener("invalid", () => {
|
|
32
29
|
this.invalid = true;
|
|
33
30
|
});
|
|
34
31
|
}
|
|
35
32
|
updated(changedProperties) {
|
|
36
33
|
super.updated(changedProperties);
|
|
37
|
-
// Sync the value to the form engine
|
|
38
34
|
if (changedProperties.has("value")) {
|
|
39
35
|
this._internals.setFormValue(this.value);
|
|
40
36
|
}
|
|
41
|
-
// Sync validity whenever properties change (like value or required status)
|
|
42
37
|
this._syncValidity();
|
|
43
38
|
}
|
|
44
39
|
_syncValidity() {
|
|
45
40
|
if (!this._inputEl)
|
|
46
41
|
return;
|
|
47
|
-
// setValidity arguments: (ValidityState object, Custom Error Message, Anchor Element for Tooltip)
|
|
48
42
|
this._internals.setValidity(this._inputEl.validity, this._inputEl.validationMessage, this._inputEl);
|
|
49
43
|
}
|
|
50
44
|
formResetCallback() {
|
|
51
45
|
this.value = "";
|
|
52
46
|
this._internals.setFormValue("");
|
|
53
|
-
// Need to wait for the render cycle to finish before checking validity on reset
|
|
54
47
|
this.updateComplete.then(() => this._syncValidity());
|
|
55
48
|
}
|
|
56
|
-
// Expose standard native methods so external scripts can call them on the component
|
|
57
49
|
checkValidity() {
|
|
58
50
|
return this._internals.checkValidity();
|
|
59
51
|
}
|
|
@@ -72,6 +64,11 @@ let StInput = class StInput extends LitElement {
|
|
|
72
64
|
this.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
|
|
73
65
|
}
|
|
74
66
|
render() {
|
|
67
|
+
const helpTextId = this.helpText ? "help-text" : undefined;
|
|
68
|
+
// Security: Prevent OS/Extensions from logging sensitive data via spellcheck
|
|
69
|
+
const isSensitive = this.type === "password" || this.type === "email";
|
|
70
|
+
const safeSpellcheck = isSensitive ? "false" : undefined;
|
|
71
|
+
const safeAutocapitalize = isSensitive ? "none" : undefined;
|
|
75
72
|
return html `
|
|
76
73
|
<div class="form-control">
|
|
77
74
|
${this.label ? html `<label for="input">${this.label}</label>` : ""}
|
|
@@ -91,6 +88,11 @@ let StInput = class StInput extends LitElement {
|
|
|
91
88
|
minlength=${ifDefined(this.minlength)}
|
|
92
89
|
maxlength=${ifDefined(this.maxlength)}
|
|
93
90
|
pattern=${ifDefined(this.pattern)}
|
|
91
|
+
autocomplete=${ifDefined(this.autocomplete)}
|
|
92
|
+
spellcheck=${ifDefined(safeSpellcheck)}
|
|
93
|
+
autocapitalize=${ifDefined(safeAutocapitalize)}
|
|
94
|
+
aria-invalid=${this.invalid ? "true" : "false"}
|
|
95
|
+
aria-describedby=${ifDefined(helpTextId)}
|
|
94
96
|
@input=${this._handleInput}
|
|
95
97
|
@change=${this._handleChange}
|
|
96
98
|
/>
|
|
@@ -98,12 +100,15 @@ let StInput = class StInput extends LitElement {
|
|
|
98
100
|
<slot name="suffix"></slot>
|
|
99
101
|
</div>
|
|
100
102
|
|
|
101
|
-
${this.helpText
|
|
103
|
+
${this.helpText
|
|
104
|
+
? html `<div id="help-text" class="help-text">${this.helpText}</div>`
|
|
105
|
+
: ""}
|
|
102
106
|
</div>
|
|
103
107
|
`;
|
|
104
108
|
}
|
|
105
109
|
};
|
|
106
110
|
StInput.formAssociated = true;
|
|
111
|
+
StInput.shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };
|
|
107
112
|
StInput.styles = [
|
|
108
113
|
resetStyles,
|
|
109
114
|
css `
|
|
@@ -122,41 +127,34 @@ StInput.styles = [
|
|
|
122
127
|
font-weight: var(--st-font-weight-medium);
|
|
123
128
|
color: var(--st-color-text);
|
|
124
129
|
margin-bottom: 0.5em;
|
|
130
|
+
cursor: pointer;
|
|
125
131
|
}
|
|
126
132
|
|
|
127
|
-
/* 1. The Wrapper acts as the visual input field */
|
|
128
133
|
.input-wrapper {
|
|
129
134
|
display: flex;
|
|
130
135
|
align-items: center;
|
|
131
136
|
gap: var(--st-spacing-sm);
|
|
132
137
|
width: 100%;
|
|
133
|
-
|
|
134
138
|
background-color: var(--st-color-bg);
|
|
135
139
|
border: 1px solid var(--st-color-border);
|
|
136
140
|
border-radius: 4px;
|
|
137
|
-
|
|
138
|
-
/* Horizontal padding on the wrapper, vertical on the input */
|
|
139
141
|
padding: 0 var(--st-spacing-md);
|
|
140
142
|
transition:
|
|
141
143
|
border-color 0.2s ease,
|
|
142
144
|
box-shadow 0.2s ease;
|
|
143
145
|
}
|
|
144
146
|
|
|
145
|
-
/* 2. Apply focus ring to the wrapper when the internal input is focused */
|
|
146
147
|
.input-wrapper:focus-within {
|
|
147
148
|
border-color: var(--st-color-primary);
|
|
148
149
|
box-shadow: 0 0 0 1px var(--st-color-primary);
|
|
149
150
|
}
|
|
150
151
|
|
|
151
|
-
/* 3. The actual input becomes transparent and fills the wrapper */
|
|
152
152
|
input {
|
|
153
153
|
flex: 1;
|
|
154
154
|
width: 100%;
|
|
155
155
|
border: none;
|
|
156
156
|
background: transparent;
|
|
157
157
|
outline: none;
|
|
158
|
-
|
|
159
|
-
/* Vertical padding stretches the wrapper */
|
|
160
158
|
padding: var(--st-spacing-sm) 0;
|
|
161
159
|
font-size: var(--st-font-size-base);
|
|
162
160
|
color: var(--st-color-text);
|
|
@@ -166,58 +164,49 @@ StInput.styles = [
|
|
|
166
164
|
color: var(--st-color-text-muted);
|
|
167
165
|
}
|
|
168
166
|
|
|
169
|
-
/* Slotted Icons */
|
|
170
167
|
::slotted(svg) {
|
|
171
168
|
width: 1.25em;
|
|
172
169
|
height: 1.25em;
|
|
173
|
-
/* Default icons to the muted text color */
|
|
174
170
|
color: var(--st-color-text-muted);
|
|
175
171
|
fill: currentColor;
|
|
176
172
|
flex-shrink: 0;
|
|
177
173
|
}
|
|
178
174
|
|
|
179
|
-
/* Interactive Slotted Elements (like clear buttons) */
|
|
180
175
|
::slotted(st-button) {
|
|
181
|
-
/* Pull the button back slightly so it aligns nicely with the input padding */
|
|
182
176
|
margin-right: calc(var(--st-spacing-sm) * -1);
|
|
183
177
|
}
|
|
184
178
|
|
|
185
|
-
|
|
179
|
+
.help-text {
|
|
180
|
+
font-size: var(--st-font-size-xs);
|
|
181
|
+
color: var(--st-color-text-muted);
|
|
182
|
+
margin: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
186
185
|
:host([invalid]) .input-wrapper {
|
|
187
186
|
border-color: var(--st-color-error);
|
|
188
187
|
}
|
|
188
|
+
|
|
189
189
|
:host([invalid]) .input-wrapper:focus-within {
|
|
190
190
|
box-shadow: 0 0 0 1px var(--st-color-error);
|
|
191
191
|
}
|
|
192
|
+
|
|
192
193
|
:host([invalid]) .help-text {
|
|
193
194
|
color: var(--st-color-error);
|
|
194
195
|
}
|
|
195
196
|
|
|
196
|
-
/* Disabled & Readonly States */
|
|
197
197
|
:host([disabled]) .input-wrapper {
|
|
198
198
|
opacity: 0.5;
|
|
199
199
|
cursor: not-allowed;
|
|
200
200
|
background-color: var(--st-color-surface);
|
|
201
201
|
}
|
|
202
|
+
|
|
202
203
|
:host([disabled]) input {
|
|
203
204
|
cursor: not-allowed;
|
|
204
205
|
}
|
|
206
|
+
|
|
205
207
|
:host([readonly]) .input-wrapper {
|
|
206
208
|
background-color: var(--st-color-surface);
|
|
207
209
|
}
|
|
208
|
-
|
|
209
|
-
.help-text {
|
|
210
|
-
font-size: var(--st-font-size-xs);
|
|
211
|
-
color: var(--st-color-text-muted);
|
|
212
|
-
margin: 0;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
:host([invalid]) .input-wrapper {
|
|
216
|
-
border-color: var(--st-color-error);
|
|
217
|
-
}
|
|
218
|
-
:host([invalid]) .help-text {
|
|
219
|
-
color: var(--st-color-error);
|
|
220
|
-
}
|
|
221
210
|
`,
|
|
222
211
|
];
|
|
223
212
|
__decorate([
|
|
@@ -241,6 +230,9 @@ __decorate([
|
|
|
241
230
|
__decorate([
|
|
242
231
|
property({ attribute: "help-text" })
|
|
243
232
|
], StInput.prototype, "helpText", void 0);
|
|
233
|
+
__decorate([
|
|
234
|
+
property({ type: String })
|
|
235
|
+
], StInput.prototype, "autocomplete", void 0);
|
|
244
236
|
__decorate([
|
|
245
237
|
property({ type: Boolean, reflect: true })
|
|
246
238
|
], StInput.prototype, "required", void 0);
|
|
@@ -266,3 +258,4 @@ StInput = __decorate([
|
|
|
266
258
|
customElement("st-input")
|
|
267
259
|
], StInput);
|
|
268
260
|
export { StInput };
|
|
261
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,IAAI,EAAE,GAAG,EAAiB,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAK3C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,UAAU;IAuBrC;QACE,KAAK,EAAE,CAAC;QAlB+B,SAAI,GAAG,EAAE,CAAC;QACzB,UAAK,GAAG,EAAE,CAAC;QACX,UAAK,GAAG,EAAE,CAAC;QACX,gBAAW,GAAG,EAAE,CAAC;QACjB,SAAI,GAAc,MAAM,CAAC;QACf,aAAQ,GAAG,EAAE,CAAC;QAGR,aAAQ,GAAG,KAAK,CAAC;QAKjB,aAAQ,GAAG,KAAK,CAAC;QACjB,YAAO,GAAG,KAAK,CAAC;QAChB,aAAQ,GAAG,KAAK,CAAC;QAIzD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAEzC,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,GAAG,EAAE;YACrC,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC/C,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE;YACpC,IAAI,CAAC,O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AC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;yCAAkB;AACjC;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0CAAoB;AACnB;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0CAAoB;AACnB;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;wCAAkB;AAED;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;yCAAkB;AACjB;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;wCAAiB;AAChB;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;yCAAkB;AArBhD,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAqOnB"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { LitElement } from
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
2
|
export declare class StLink extends LitElement {
|
|
3
3
|
href: string;
|
|
4
|
-
target:
|
|
5
|
-
size:
|
|
6
|
-
variant:
|
|
7
|
-
color:
|
|
4
|
+
target: "_blank" | "_self";
|
|
5
|
+
size: "sm" | "md" | "lg";
|
|
6
|
+
variant: "inline" | "standalone";
|
|
7
|
+
color: "default" | "primary" | "muted";
|
|
8
8
|
static styles: import("lit").CSSResult[];
|
|
9
9
|
render(): import("lit-html").TemplateResult<1>;
|
|
10
10
|
}
|
|
11
11
|
declare global {
|
|
12
12
|
interface HTMLElementTagNameMap {
|
|
13
|
-
|
|
13
|
+
"st-link": StLink;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/components/link/link.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/components/link/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAK1C,qBACa,MAAO,SAAQ,UAAU;IACV,IAAI,SAAO;IACX,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAW;IACtB,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAChC,OAAO,EAAE,QAAQ,GAAG,YAAY,CAAY;IAC5C,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAa;IAE5F,MAAM,CAAC,MAAM,4BAqFX;IAEF,MAAM,yCAcL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|
|
@@ -4,21 +4,28 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { LitElement, html, css } from
|
|
8
|
-
import { customElement, property } from
|
|
9
|
-
import {
|
|
7
|
+
import { LitElement, html, css } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
|
+
import { resetStyles } from "../../styles/reset.js";
|
|
10
11
|
let StLink = class StLink extends LitElement {
|
|
11
12
|
constructor() {
|
|
12
13
|
super(...arguments);
|
|
13
|
-
this.href =
|
|
14
|
-
this.target =
|
|
15
|
-
this.size =
|
|
16
|
-
this.variant =
|
|
17
|
-
this.color =
|
|
14
|
+
this.href = "#";
|
|
15
|
+
this.target = "_self";
|
|
16
|
+
this.size = "md";
|
|
17
|
+
this.variant = "inline";
|
|
18
|
+
this.color = "primary";
|
|
18
19
|
}
|
|
19
20
|
render() {
|
|
21
|
+
// SECURITY: Prevent XSS via javascript: URI injection
|
|
22
|
+
const sanitizedHref = this.href?.trim().toLowerCase().startsWith("javascript:")
|
|
23
|
+
? "#blocked"
|
|
24
|
+
: this.href;
|
|
25
|
+
// SECURITY: Prevent Reverse Tabnabbing for external links
|
|
26
|
+
const secureRel = this.target === "_blank" ? "noopener noreferrer" : undefined;
|
|
20
27
|
return html `
|
|
21
|
-
<a href="${
|
|
28
|
+
<a href="${sanitizedHref}" target="${this.target}" rel="${ifDefined(secureRel)}">
|
|
22
29
|
<slot></slot>
|
|
23
30
|
</a>
|
|
24
31
|
`;
|
|
@@ -29,7 +36,8 @@ StLink.styles = [
|
|
|
29
36
|
css `
|
|
30
37
|
:host {
|
|
31
38
|
display: inline-flex;
|
|
32
|
-
align-items:
|
|
39
|
+
align-items: baseline; /* Ensures it sits perfectly inside a line of text */
|
|
40
|
+
vertical-align: baseline;
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
a {
|
|
@@ -38,7 +46,17 @@ StLink.styles = [
|
|
|
38
46
|
gap: 0.25em;
|
|
39
47
|
text-decoration: none;
|
|
40
48
|
font-weight: 500;
|
|
41
|
-
transition:
|
|
49
|
+
transition:
|
|
50
|
+
color 0.2s ease,
|
|
51
|
+
opacity 0.2s ease,
|
|
52
|
+
text-decoration-thickness 0.2s ease;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Accessibility: Clear focus indicators for keyboard navigation */
|
|
56
|
+
a:focus-visible {
|
|
57
|
+
outline: 2px solid var(--st-color-primary);
|
|
58
|
+
outline-offset: 2px;
|
|
59
|
+
border-radius: 2px;
|
|
42
60
|
}
|
|
43
61
|
|
|
44
62
|
/* ==========================================================
|
|
@@ -68,24 +86,28 @@ StLink.styles = [
|
|
|
68
86
|
/* ==========================================================
|
|
69
87
|
Sizes
|
|
70
88
|
========================================================== */
|
|
71
|
-
:host([size="sm"]) a {
|
|
72
|
-
|
|
73
|
-
|
|
89
|
+
:host([size="sm"]) a {
|
|
90
|
+
font-size: 0.875rem;
|
|
91
|
+
}
|
|
92
|
+
:host([size="md"]) a {
|
|
93
|
+
font-size: 1rem;
|
|
94
|
+
}
|
|
95
|
+
:host([size="lg"]) a {
|
|
96
|
+
font-size: 1.125rem;
|
|
97
|
+
}
|
|
74
98
|
|
|
75
99
|
/* ==========================================================
|
|
76
100
|
Variants
|
|
77
101
|
========================================================== */
|
|
78
|
-
/* inline links live inside paragraphs and underline on hover */
|
|
79
102
|
:host([variant="inline"]) a {
|
|
80
103
|
text-decoration: underline;
|
|
81
104
|
text-underline-offset: 4px;
|
|
82
|
-
font-weight: inherit;
|
|
105
|
+
font-weight: inherit;
|
|
83
106
|
}
|
|
84
107
|
:host([variant="inline"]) a:hover {
|
|
85
108
|
text-decoration-thickness: 2px;
|
|
86
109
|
}
|
|
87
110
|
|
|
88
|
-
/* standalone links (e.g., footers, sidebars) have no underline by default */
|
|
89
111
|
:host([variant="standalone"]) a {
|
|
90
112
|
text-decoration: none;
|
|
91
113
|
}
|
|
@@ -93,7 +115,7 @@ StLink.styles = [
|
|
|
93
115
|
text-decoration: underline;
|
|
94
116
|
text-underline-offset: 4px;
|
|
95
117
|
}
|
|
96
|
-
|
|
118
|
+
`,
|
|
97
119
|
];
|
|
98
120
|
__decorate([
|
|
99
121
|
property({ type: String })
|
|
@@ -111,6 +133,7 @@ __decorate([
|
|
|
111
133
|
property({ type: String, reflect: true })
|
|
112
134
|
], StLink.prototype, "color", void 0);
|
|
113
135
|
StLink = __decorate([
|
|
114
|
-
customElement(
|
|
136
|
+
customElement("st-link")
|
|
115
137
|
], StLink);
|
|
116
138
|
export { StLink };
|
|
139
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../src/components/link/link.ts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EAAE,MAAM,EAAC,CAAC;sCAAsC;AACtB;IAAxC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;oCAAiC;AAChC;IAAxC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;uCAA6C;AAC5C;IAAxC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;qCAAoD;AALjF,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CA6GlB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { LitElement } from
|
|
1
|
+
import { LitElement, PropertyValues } from "lit";
|
|
2
2
|
export declare class StMetadata extends LitElement {
|
|
3
3
|
pageTitle: string;
|
|
4
4
|
description: string;
|
|
5
5
|
image: string;
|
|
6
6
|
protected createRenderRoot(): this;
|
|
7
|
-
updated(): void;
|
|
7
|
+
updated(changedProperties: PropertyValues<this>): void;
|
|
8
8
|
private _updateMetadata;
|
|
9
9
|
private _setMeta;
|
|
10
10
|
private _setCanonical;
|
|
@@ -12,7 +12,7 @@ export declare class StMetadata extends LitElement {
|
|
|
12
12
|
}
|
|
13
13
|
declare global {
|
|
14
14
|
interface HTMLElementTagNameMap {
|
|
15
|
-
|
|
15
|
+
"st-metadata": StMetadata;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/components/metadata/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/components/metadata/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAW,cAAc,EAAC,MAAM,KAAK,CAAC;AAGxD,qBACa,UAAW,SAAQ,UAAU;IACd,SAAS,SAAM;IACf,WAAW,SAAM;IACjB,KAAK,SAAM;IAErC,SAAS,CAAC,gBAAgB,SAEzB;IAGQ,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,QAGvD;IAED,OAAO,CAAC,eAAe;IAoBvB,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,aAAa;IAUrB,MAAM,WAEL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
|
@@ -4,53 +4,55 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { LitElement, nothing } from
|
|
8
|
-
import { customElement, property } from
|
|
7
|
+
import { LitElement, nothing } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
9
|
let StMetadata = class StMetadata extends LitElement {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
12
|
-
this.pageTitle =
|
|
13
|
-
this.description =
|
|
14
|
-
this.image =
|
|
12
|
+
this.pageTitle = "";
|
|
13
|
+
this.description = "";
|
|
14
|
+
this.image = "";
|
|
15
15
|
}
|
|
16
|
-
createRenderRoot() {
|
|
17
|
-
|
|
16
|
+
createRenderRoot() {
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
// 🚀 Added strict PropertyValues typing and super call
|
|
20
|
+
updated(changedProperties) {
|
|
21
|
+
super.updated(changedProperties);
|
|
18
22
|
this._updateMetadata();
|
|
19
23
|
}
|
|
20
24
|
_updateMetadata() {
|
|
21
|
-
|
|
22
|
-
const siteName = import.meta.env?.VITE_SITE_NAME || '';
|
|
25
|
+
const siteName = import.meta.env?.VITE_SITE_NAME || "";
|
|
23
26
|
if (this.pageTitle) {
|
|
24
|
-
// If site name is configured, append it; otherwise use the title standalone
|
|
25
27
|
document.title = siteName ? `${this.pageTitle} - ${siteName}` : this.pageTitle;
|
|
26
|
-
this._setMeta(
|
|
28
|
+
this._setMeta("property", "og:title", this.pageTitle);
|
|
27
29
|
}
|
|
28
30
|
if (this.description) {
|
|
29
|
-
this._setMeta(
|
|
30
|
-
this._setMeta(
|
|
31
|
+
this._setMeta("name", "description", this.description);
|
|
32
|
+
this._setMeta("property", "og:description", this.description);
|
|
31
33
|
}
|
|
32
34
|
if (this.image) {
|
|
33
|
-
this._setMeta(
|
|
35
|
+
this._setMeta("property", "og:image", this.image);
|
|
34
36
|
}
|
|
35
37
|
this._setCanonical(window.location.href);
|
|
36
38
|
}
|
|
37
39
|
_setMeta(attrName, attrValue, content) {
|
|
38
40
|
let meta = document.head.querySelector(`meta[${attrName}="${attrValue}"]`);
|
|
39
41
|
if (!meta) {
|
|
40
|
-
meta = document.createElement(
|
|
42
|
+
meta = document.createElement("meta");
|
|
41
43
|
meta.setAttribute(attrName, attrValue);
|
|
42
44
|
document.head.appendChild(meta);
|
|
43
45
|
}
|
|
44
|
-
meta.setAttribute(
|
|
46
|
+
meta.setAttribute("content", content);
|
|
45
47
|
}
|
|
46
48
|
_setCanonical(url) {
|
|
47
49
|
let link = document.head.querySelector('link[rel="canonical"]');
|
|
48
50
|
if (!link) {
|
|
49
|
-
link = document.createElement(
|
|
50
|
-
link.setAttribute(
|
|
51
|
+
link = document.createElement("link");
|
|
52
|
+
link.setAttribute("rel", "canonical");
|
|
51
53
|
document.head.appendChild(link);
|
|
52
54
|
}
|
|
53
|
-
link.setAttribute(
|
|
55
|
+
link.setAttribute("href", url);
|
|
54
56
|
}
|
|
55
57
|
render() {
|
|
56
58
|
return nothing;
|
|
@@ -66,6 +68,7 @@ __decorate([
|
|
|
66
68
|
property({ type: String })
|
|
67
69
|
], StMetadata.prototype, "image", void 0);
|
|
68
70
|
StMetadata = __decorate([
|
|
69
|
-
customElement(
|
|
71
|
+
customElement("st-metadata")
|
|
70
72
|
], StMetadata);
|
|
71
73
|
export { StMetadata };
|
|
74
|
+
//# sourceMappingURL=metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../src/components/metadata/metadata.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AACxD,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAGnD,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QACqB,cAAS,GAAG,EAAE,CAAC;QACf,gBAAW,GAAG,EAAE,CAAC;QACjB,UAAK,GAAG,EAAE,CAAC;IAuDvC,CAAC;IArDW,gBAAgB;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,uDAAuD;IAC9C,OAAO,CAAC,iBAAuC;QACtD,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACjC,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAEO,eAAe;QACrB,MAAM,QAAQ,GAAI,OAAO,IAAY,CAAC,GAAG,EAAE,cAAc,IAAI,EAAE,CAAC;QAEhE,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,MAAM,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;YAC/E,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACxD,CAAC;QAED,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,WAA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O,CAAC;IACjB,CAAC;CACF,CAAA;AAzD2B;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;6CAAgB;AACf;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;+CAAkB;AACjB;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;yCAAY;AAH1B,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA0DtB"}
|
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
import { LitElement, PropertyValues } from
|
|
1
|
+
import { LitElement, PropertyValues } from "lit";
|
|
2
2
|
export declare class StModal extends LitElement {
|
|
3
|
-
/**
|
|
4
|
-
* Controls whether the modal is open.
|
|
5
|
-
*/
|
|
6
3
|
open: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Title text displayed in the modal header.
|
|
9
|
-
*/
|
|
10
4
|
heading: string;
|
|
11
|
-
|
|
12
|
-
* Size of the modal (sm, md, lg, xl, xxl).
|
|
13
|
-
*/
|
|
14
|
-
size: 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
15
|
-
/**
|
|
16
|
-
* If true, the modal cannot be closed by clicking the backdrop or pressing Esc.
|
|
17
|
-
*/
|
|
5
|
+
size: "sm" | "md" | "lg" | "xl" | "xxl";
|
|
18
6
|
static: boolean;
|
|
19
7
|
private dialogEl;
|
|
20
8
|
private isClosing;
|
|
21
9
|
static styles: import("lit").CSSResult[];
|
|
22
|
-
updated(changedProperties: PropertyValues): void;
|
|
10
|
+
updated(changedProperties: PropertyValues<this>): void;
|
|
23
11
|
private closeWithAnimation;
|
|
24
12
|
private handleClose;
|
|
25
13
|
private handleCancel;
|
|
@@ -29,7 +17,7 @@ export declare class StModal extends LitElement {
|
|
|
29
17
|
}
|
|
30
18
|
declare global {
|
|
31
19
|
interface HTMLElementTagNameMap {
|
|
32
|
-
|
|
20
|
+
"st-modal": StModal;
|
|
33
21
|
}
|
|
34
22
|
}
|
|
35
23
|
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/modal.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAa,cAAc,EAAU,MAAM,KAAK,CAAC;AAInE,qBACa,OAAQ,SAAQ,UAAU;IACK,IAAI,UAAS;IAC7B,OAAO,SAAM;IACb,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAQ;IAC9C,MAAM,UAAS;IAEzB,OAAO,CAAC,QAAQ,CAAqB;IAEtD,OAAO,CAAC,SAAS,CAAS;IAE1B,MAAM,CAAC,MAAM,4BAiJX;IAGO,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,QAcvD;IAED,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,mBAAmB;IAe3B,MAAM,yCA2CL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
|