@sondor-technology/sondor-components 1.0.0 → 1.0.1-develop.11
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 +8 -0
- package/dist/components/alert/alert.d.ts +13 -0
- package/dist/components/alert/alert.d.ts.map +1 -0
- package/dist/components/alert/alert.js +105 -0
- package/dist/components/badge/badge.d.ts +13 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/badge.js +101 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +19 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.js +99 -0
- package/dist/components/button/button.d.ts +23 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/button.js +304 -0
- package/dist/components/button-group/button-group.d.ts +6 -0
- package/dist/components/button-group/button-group.d.ts.map +1 -0
- package/dist/components/button-group/button-group.js +74 -0
- package/dist/components/card/card.d.ts +11 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/card.js +54 -0
- package/dist/components/checkbox/checkbox.d.ts +31 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.js +265 -0
- package/dist/components/code-block/code-block.d.ts +20 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -0
- package/dist/components/code-block/code-block.js +260 -0
- package/dist/components/content-card/content-card.d.ts +13 -0
- package/dist/components/content-card/content-card.d.ts.map +1 -0
- package/dist/components/content-card/content-card.js +140 -0
- package/dist/components/divider/divider.d.ts +16 -0
- package/dist/components/divider/divider.d.ts.map +1 -0
- package/dist/components/divider/divider.js +82 -0
- package/dist/components/drawer/drawer.d.ts +22 -0
- package/dist/components/drawer/drawer.d.ts.map +1 -0
- package/dist/components/drawer/drawer.js +226 -0
- package/dist/components/field/field.d.ts +11 -0
- package/dist/components/field/field.d.ts.map +1 -0
- package/dist/components/field/field.js +32 -0
- package/dist/components/footer/footer.d.ts +6 -0
- package/dist/components/footer/footer.d.ts.map +1 -0
- package/dist/components/footer/footer.js +65 -0
- package/dist/components/form/form-step.d.ts +14 -0
- package/dist/components/form/form-step.d.ts.map +1 -0
- package/dist/components/form/form-step.js +44 -0
- package/dist/components/form/form.d.ts +30 -0
- package/dist/components/form/form.d.ts.map +1 -0
- package/dist/components/form/form.js +456 -0
- package/dist/components/grid/grid-row.d.ts +17 -0
- package/dist/components/grid/grid-row.d.ts.map +1 -0
- package/dist/components/grid/grid-row.js +92 -0
- package/dist/components/grid/grid.d.ts +13 -0
- package/dist/components/grid/grid.d.ts.map +1 -0
- package/dist/components/grid/grid.js +42 -0
- package/dist/components/icon/icon-paths.d.ts +132 -0
- package/dist/components/icon/icon-paths.d.ts.map +1 -0
- package/dist/components/icon/icon-paths.js +137 -0
- package/dist/components/icon/icon.d.ts +17 -0
- package/dist/components/icon/icon.d.ts.map +1 -0
- package/dist/components/icon/icon.js +95 -0
- package/dist/components/input/input.d.ts +31 -0
- package/dist/components/input/input.d.ts.map +1 -0
- package/dist/components/input/input.js +268 -0
- package/dist/components/link/link.d.ts +16 -0
- package/dist/components/link/link.d.ts.map +1 -0
- package/dist/components/link/link.js +116 -0
- package/dist/components/metadata/metadata.d.ts +18 -0
- package/dist/components/metadata/metadata.d.ts.map +1 -0
- package/dist/components/metadata/metadata.js +71 -0
- package/dist/components/modal/modal.d.ts +35 -0
- package/dist/components/modal/modal.d.ts.map +1 -0
- package/dist/components/modal/modal.js +251 -0
- package/dist/components/page-layout/page-layout.d.ts +46 -0
- package/dist/components/page-layout/page-layout.d.ts.map +1 -0
- package/dist/components/page-layout/page-layout.js +697 -0
- package/dist/components/radio/radio.d.ts +16 -0
- package/dist/components/radio/radio.d.ts.map +1 -0
- package/dist/components/radio/radio.js +152 -0
- package/dist/components/radio-group/radio-group.d.ts +27 -0
- package/dist/components/radio-group/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group/radio-group.js +161 -0
- package/dist/components/router/router.d.ts +31 -0
- package/dist/components/router/router.d.ts.map +1 -0
- package/dist/components/router/router.js +97 -0
- package/dist/components/select/select.d.ts +16 -0
- package/dist/components/select/select.d.ts.map +1 -0
- package/dist/components/select/select.js +172 -0
- package/dist/components/skeleton/skeleton.d.ts +16 -0
- package/dist/components/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.js +149 -0
- package/dist/components/switch/switch.d.ts +25 -0
- package/dist/components/switch/switch.d.ts.map +1 -0
- package/dist/components/switch/switch.js +185 -0
- package/dist/components/table/data-table.d.ts +72 -0
- package/dist/components/table/data-table.d.ts.map +1 -0
- package/dist/components/table/data-table.js +551 -0
- package/dist/components/table/table.d.ts +22 -0
- package/dist/components/table/table.d.ts.map +1 -0
- package/dist/components/table/table.js +167 -0
- package/dist/components/tabs/tab-panel.d.ts +8 -0
- package/dist/components/tabs/tab-panel.d.ts.map +1 -0
- package/dist/components/tabs/tab-panel.js +46 -0
- package/dist/components/tabs/tab.d.ts +9 -0
- package/dist/components/tabs/tab.d.ts.map +1 -0
- package/dist/components/tabs/tab.js +91 -0
- package/dist/components/tabs/tabs.d.ts +14 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -0
- package/dist/components/tabs/tabs.js +85 -0
- package/dist/components/textarea/textarea.d.ts +36 -0
- package/dist/components/textarea/textarea.d.ts.map +1 -0
- package/dist/components/textarea/textarea.js +231 -0
- package/dist/components/theme-toggle/theme-toggle.d.ts +15 -0
- package/dist/components/theme-toggle/theme-toggle.d.ts.map +1 -0
- package/dist/components/theme-toggle/theme-toggle.js +130 -0
- package/dist/components/vertical-nav/vertical-nav-group.d.ts +15 -0
- package/dist/components/vertical-nav/vertical-nav-group.d.ts.map +1 -0
- package/dist/components/vertical-nav/vertical-nav-group.js +127 -0
- package/dist/components/vertical-nav/vertical-nav-item.d.ts +14 -0
- package/dist/components/vertical-nav/vertical-nav-item.d.ts.map +1 -0
- package/dist/components/vertical-nav/vertical-nav-item.js +85 -0
- package/dist/styles/index.css +171 -0
- package/dist/styles/reset.d.ts +2 -0
- package/dist/styles/reset.d.ts.map +1 -0
- package/dist/styles/reset.js +50 -0
- package/package.json +7 -2
- 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 +266 -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 +36 -32
- package/src/components/form/form.ts +492 -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 +140 -124
- package/src/components/icon/icon.ts +84 -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 +246 -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 +133 -46
- package/src/components/select/select.ts +161 -161
- package/src/components/skeleton/skeleton.ts +134 -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 +115 -96
- package/src/components/vertical-nav/vertical-nav-item.ts +72 -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
|
@@ -0,0 +1,304 @@
|
|
|
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, nothing } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import { resetStyles } from "../../styles/reset.js";
|
|
10
|
+
let StButton = class StButton extends LitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.target = "_self";
|
|
14
|
+
this.disabled = false;
|
|
15
|
+
this.loading = false;
|
|
16
|
+
this.variant = "primary";
|
|
17
|
+
this.size = "md";
|
|
18
|
+
this.color = "primary";
|
|
19
|
+
this.active = false;
|
|
20
|
+
this.ariaLabel = null;
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const content = html `<slot></slot>`;
|
|
24
|
+
if (this.href) {
|
|
25
|
+
return html `<a href="${this.href}" target="${this.target}" class="btn" color="${this.color}" aria-label=${this.ariaLabel || nothing}
|
|
26
|
+
>${content}</a
|
|
27
|
+
>`;
|
|
28
|
+
}
|
|
29
|
+
return html `
|
|
30
|
+
<button class="btn" ?disabled=${this.disabled || this.loading}>
|
|
31
|
+
${this.loading
|
|
32
|
+
? html `
|
|
33
|
+
<svg class="spinner" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
34
|
+
<path
|
|
35
|
+
opacity="0.2"
|
|
36
|
+
fill-rule="evenodd"
|
|
37
|
+
clip-rule="evenodd"
|
|
38
|
+
d="M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z"
|
|
39
|
+
fill="currentColor"
|
|
40
|
+
/>
|
|
41
|
+
<path
|
|
42
|
+
d="M2 12C2 6.47715 6.47715 2 12 2V5C8.13401 5 5 8.13401 5 12H2Z"
|
|
43
|
+
fill="currentColor"
|
|
44
|
+
/>
|
|
45
|
+
</svg>
|
|
46
|
+
`
|
|
47
|
+
: html `<slot name="prefix"></slot>`}
|
|
48
|
+
${content}
|
|
49
|
+
<slot name="suffix"></slot>
|
|
50
|
+
</button>
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
StButton.styles = [
|
|
55
|
+
resetStyles,
|
|
56
|
+
css `
|
|
57
|
+
:host {
|
|
58
|
+
/* ==========================================================
|
|
59
|
+
1. Base Palette (Defaults to Primary Theme)
|
|
60
|
+
========================================================== */
|
|
61
|
+
--_palette-base: var(--st-color-primary);
|
|
62
|
+
--_palette-hover: var(--st-color-primary-hover);
|
|
63
|
+
--_palette-surface: var(--st-color-surface);
|
|
64
|
+
--_palette-surface-hover: var(--st-color-border);
|
|
65
|
+
|
|
66
|
+
--_palette-text-on-base: var(--st-color-surface);
|
|
67
|
+
--_palette-text-on-surface: var(--st-color-text);
|
|
68
|
+
|
|
69
|
+
/* Sizing Tokens */
|
|
70
|
+
--_btn-padding: var(--st-spacing-sm) var(--st-spacing-md);
|
|
71
|
+
--_btn-font-size: var(--st-font-size-sm);
|
|
72
|
+
--_btn-radius: 4px;
|
|
73
|
+
--_btn-gap: var(--st-spacing-sm);
|
|
74
|
+
|
|
75
|
+
display: inline-block;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* ==========================================================
|
|
79
|
+
2. Semantic Color Overrides (Swaps the active palette)
|
|
80
|
+
========================================================== */
|
|
81
|
+
:host([color="error"]) {
|
|
82
|
+
--_palette-base: var(--st-color-error);
|
|
83
|
+
--_palette-hover: color-mix(in srgb, var(--st-color-error), black 15%);
|
|
84
|
+
--_palette-surface: var(--st-color-error-bg);
|
|
85
|
+
--_palette-surface-hover: color-mix(in srgb, var(--st-color-error-bg), black 10%);
|
|
86
|
+
--_palette-text-on-base: var(--st-white); /* Force white text */
|
|
87
|
+
--_palette-text-on-surface: var(--st-color-error);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([color="success"]) {
|
|
91
|
+
--_palette-base: var(--st-color-success);
|
|
92
|
+
--_palette-hover: color-mix(in srgb, var(--st-color-success), black 15%);
|
|
93
|
+
--_palette-surface: var(--st-color-success-bg);
|
|
94
|
+
--_palette-surface-hover: color-mix(in srgb, var(--st-color-success-bg), black 10%);
|
|
95
|
+
--_palette-text-on-base: var(--st-white);
|
|
96
|
+
--_palette-text-on-surface: var(--st-color-success);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([color="warning"]) {
|
|
100
|
+
--_palette-base: var(--st-color-warning);
|
|
101
|
+
--_palette-hover: color-mix(in srgb, var(--st-color-warning), black 15%);
|
|
102
|
+
--_palette-surface: var(--st-color-warning-bg);
|
|
103
|
+
--_palette-surface-hover: color-mix(in srgb, var(--st-color-warning-bg), black 10%);
|
|
104
|
+
--_palette-text-on-base: var(--st-gray-900); /* Amber needs dark text for contrast */
|
|
105
|
+
--_palette-text-on-surface: var(--st-color-warning);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host([color="info"]) {
|
|
109
|
+
--_palette-base: var(--st-color-info);
|
|
110
|
+
--_palette-hover: color-mix(in srgb, var(--st-color-info), black 15%);
|
|
111
|
+
--_palette-surface: var(--st-color-info-bg);
|
|
112
|
+
--_palette-surface-hover: color-mix(in srgb, var(--st-color-info-bg), black 10%);
|
|
113
|
+
--_palette-text-on-base: var(--st-white);
|
|
114
|
+
--_palette-text-on-surface: var(--st-color-info);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* ==========================================================
|
|
118
|
+
3. Visual Variants (Consumes the active palette)
|
|
119
|
+
========================================================== */
|
|
120
|
+
|
|
121
|
+
/* Base (Primary / Solid) */
|
|
122
|
+
:host {
|
|
123
|
+
--_btn-bg: var(--_palette-base);
|
|
124
|
+
--_btn-bg-hover: var(--_palette-hover);
|
|
125
|
+
--_btn-text: var(--_palette-text-on-base);
|
|
126
|
+
--_btn-border: transparent;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Secondary Variant */
|
|
130
|
+
:host([variant="secondary"]) {
|
|
131
|
+
--_btn-bg: var(--_palette-surface);
|
|
132
|
+
--_btn-bg-hover: var(--_palette-surface-hover);
|
|
133
|
+
--_btn-text: var(--_palette-text-on-surface);
|
|
134
|
+
--_btn-border: transparent;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Outline Variant */
|
|
138
|
+
:host([variant="outline"]) {
|
|
139
|
+
--_btn-bg: transparent;
|
|
140
|
+
--_btn-bg-hover: var(--_palette-surface);
|
|
141
|
+
--_btn-text: var(--_palette-base);
|
|
142
|
+
--_btn-border: var(--_palette-base);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* ==========================================================
|
|
146
|
+
4. Size Variants
|
|
147
|
+
========================================================== */
|
|
148
|
+
:host([size="sm"]) {
|
|
149
|
+
--_btn-padding: var(--st-spacing-xs) var(--st-spacing-sm);
|
|
150
|
+
--_btn-font-size: var(--st-font-size-xs);
|
|
151
|
+
--_btn-radius: 2px;
|
|
152
|
+
--_btn-gap: var(--st-spacing-xs);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:host([size="lg"]) {
|
|
156
|
+
--_btn-padding: var(--st-spacing-md) var(--st-spacing-lg);
|
|
157
|
+
--_btn-font-size: var(--st-font-size-base);
|
|
158
|
+
--_btn-radius: 6px;
|
|
159
|
+
--_btn-gap: var(--st-spacing-sm);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* ==========================================================
|
|
163
|
+
5. Base Button Rules
|
|
164
|
+
========================================================== */
|
|
165
|
+
.btn {
|
|
166
|
+
display: inline-flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
justify-content: center;
|
|
169
|
+
gap: var(--_btn-gap);
|
|
170
|
+
|
|
171
|
+
background-color: var(--_btn-bg);
|
|
172
|
+
color: var(--_btn-text);
|
|
173
|
+
border: 1px solid var(--_btn-border);
|
|
174
|
+
padding: var(--_btn-padding);
|
|
175
|
+
font-size: var(--_btn-font-size);
|
|
176
|
+
border-radius: var(--_btn-radius);
|
|
177
|
+
line-height: 1;
|
|
178
|
+
|
|
179
|
+
cursor: pointer;
|
|
180
|
+
font-weight: var(--st-font-weight-medium);
|
|
181
|
+
transition: all 0.2s ease;
|
|
182
|
+
padding: 0.5rem 1rem;
|
|
183
|
+
|
|
184
|
+
/* 1. Split the border radius into 4 independent corners */
|
|
185
|
+
border-radius: var(--btn-radius-tl, var(--st-radius-md, 0.5rem))
|
|
186
|
+
var(--btn-radius-tr, var(--st-radius-md, 0.5rem))
|
|
187
|
+
var(--btn-radius-br, var(--st-radius-md, 0.5rem))
|
|
188
|
+
var(--btn-radius-bl, var(--st-radius-md, 0.5rem));
|
|
189
|
+
|
|
190
|
+
/* 2. Add a hook for the group wrapper to inject a divider line */
|
|
191
|
+
box-shadow: var(--btn-divider, none);
|
|
192
|
+
|
|
193
|
+
font-weight: 500;
|
|
194
|
+
text-decoration: none;
|
|
195
|
+
border: 1px solid transparent;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.btn:hover {
|
|
199
|
+
color: var(--_btn-text);
|
|
200
|
+
background-color: var(--_btn-bg-hover);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* ==========================================================
|
|
204
|
+
Logical Active States (Selected/Toggled)
|
|
205
|
+
========================================================== */
|
|
206
|
+
:host([active]) .btn {
|
|
207
|
+
filter: brightness(0.9);
|
|
208
|
+
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.2);
|
|
209
|
+
border-color: transparent;
|
|
210
|
+
color: var(--_btn-text);
|
|
211
|
+
background-color: var(--_btn-bg-hover);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
:host([active]) .btn[color="primary"] {
|
|
215
|
+
filter: brightness(0.85);
|
|
216
|
+
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2); /* Inset shadow gives a pressed look */
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* ==========================================================
|
|
220
|
+
Focus State (Accessibility)
|
|
221
|
+
========================================================== */
|
|
222
|
+
/* focus-visible ensures this only shows for keyboard navigation, not mouse clicks */
|
|
223
|
+
.btn:focus-visible {
|
|
224
|
+
outline: 2px solid var(--st-color-primary);
|
|
225
|
+
outline-offset: 2px;
|
|
226
|
+
z-index: 1; /* Pulls the focused button forward if it's in a button group */
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* ==========================================================
|
|
230
|
+
Physical Active State (Mouse down)
|
|
231
|
+
========================================================== */
|
|
232
|
+
.btn:active {
|
|
233
|
+
transform: scale(0.98);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* Disabled & Loading */
|
|
237
|
+
:host([disabled]),
|
|
238
|
+
:host([loading]) {
|
|
239
|
+
pointer-events: none;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
:host([disabled]) button {
|
|
243
|
+
opacity: 0.5;
|
|
244
|
+
cursor: not-allowed;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
:host([loading]) button {
|
|
248
|
+
opacity: 0.8;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* Icons & Spinner */
|
|
252
|
+
::slotted(svg),
|
|
253
|
+
svg.spinner {
|
|
254
|
+
width: 1.25em;
|
|
255
|
+
height: 1.25em;
|
|
256
|
+
fill: currentColor;
|
|
257
|
+
flex-shrink: 0;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
svg.spinner {
|
|
261
|
+
animation: st-spin 1s linear infinite;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
@keyframes st-spin {
|
|
265
|
+
from {
|
|
266
|
+
transform: rotate(0deg);
|
|
267
|
+
}
|
|
268
|
+
to {
|
|
269
|
+
transform: rotate(360deg);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
`,
|
|
273
|
+
];
|
|
274
|
+
__decorate([
|
|
275
|
+
property({ type: String })
|
|
276
|
+
], StButton.prototype, "href", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
property({ type: String })
|
|
279
|
+
], StButton.prototype, "target", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
property({ type: Boolean, reflect: true })
|
|
282
|
+
], StButton.prototype, "disabled", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
property({ type: Boolean, reflect: true })
|
|
285
|
+
], StButton.prototype, "loading", void 0);
|
|
286
|
+
__decorate([
|
|
287
|
+
property({ type: String, reflect: true })
|
|
288
|
+
], StButton.prototype, "variant", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
property({ type: String, reflect: true })
|
|
291
|
+
], StButton.prototype, "size", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
property({ type: String, reflect: true })
|
|
294
|
+
], StButton.prototype, "color", void 0);
|
|
295
|
+
__decorate([
|
|
296
|
+
property({ type: Boolean, reflect: true })
|
|
297
|
+
], StButton.prototype, "active", void 0);
|
|
298
|
+
__decorate([
|
|
299
|
+
property({ type: String, attribute: 'aria-label' })
|
|
300
|
+
], StButton.prototype, "ariaLabel", void 0);
|
|
301
|
+
StButton = __decorate([
|
|
302
|
+
customElement("st-button")
|
|
303
|
+
], StButton);
|
|
304
|
+
export { StButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../src/components/button-group/button-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAI1C,qBACa,aAAc,SAAQ,UAAU;IAC3C,MAAM,CAAC,MAAM,4BAmDX;IAEF,MAAM,yCAML;CACF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 } from "lit/decorators.js";
|
|
9
|
+
import { resetStyles } from "../../styles/reset";
|
|
10
|
+
let StButtonGroup = class StButtonGroup extends LitElement {
|
|
11
|
+
render() {
|
|
12
|
+
return html `
|
|
13
|
+
<div class="group" role="group" aria-label="button group">
|
|
14
|
+
<slot></slot>
|
|
15
|
+
</div>
|
|
16
|
+
`;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
StButtonGroup.styles = [
|
|
20
|
+
resetStyles,
|
|
21
|
+
css `
|
|
22
|
+
:host {
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.group {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* 1. Flatten all corners by default */
|
|
32
|
+
::slotted(st-button) {
|
|
33
|
+
--btn-radius-tl: 0px;
|
|
34
|
+
--btn-radius-tr: 0px;
|
|
35
|
+
--btn-radius-br: 0px;
|
|
36
|
+
--btn-radius-bl: 0px;
|
|
37
|
+
position: relative;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* 2. Restore ONLY the left corners for the first button */
|
|
41
|
+
::slotted(st-button:first-child) {
|
|
42
|
+
--btn-radius-tl: var(--st-radius-md, 0.5rem);
|
|
43
|
+
--btn-radius-bl: var(--st-radius-md, 0.5rem);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* 3. Restore ONLY the right corners for the last button */
|
|
47
|
+
::slotted(st-button:last-child) {
|
|
48
|
+
--btn-radius-tr: var(--st-radius-md, 0.5rem);
|
|
49
|
+
--btn-radius-br: var(--st-radius-md, 0.5rem);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* 4. Collapse borders by hiding the left border of adjacent default buttons */
|
|
53
|
+
::slotted(st-button[color="default"]:not(:first-child)) {
|
|
54
|
+
margin-left: -1px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* 5. Prevent Primary buttons from overlapping at all, use box-shadow for the divider */
|
|
58
|
+
::slotted(st-button[color="primary"]:not(:first-child)) {
|
|
59
|
+
--btn-divider: inset 1px 0 0 0 rgba(255, 255, 255, 0.3);
|
|
60
|
+
margin-left: 0; /* Override any inherited negative margins */
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* 6. Pull active/hovered default buttons forward so their full border shows */
|
|
64
|
+
::slotted(st-button[color="default"]:hover),
|
|
65
|
+
::slotted(st-button[color="default"]:focus-within),
|
|
66
|
+
::slotted(st-button[color="default"]:active) {
|
|
67
|
+
z-index: 1;
|
|
68
|
+
}
|
|
69
|
+
`,
|
|
70
|
+
];
|
|
71
|
+
StButtonGroup = __decorate([
|
|
72
|
+
customElement("st-button-group")
|
|
73
|
+
], StButtonGroup);
|
|
74
|
+
export { StButtonGroup };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class StCard extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
'st-card': StCard;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,MAAO,SAAQ,UAAU;IACpC,MAAM,CAAC,MAAM,4BA+BX;IAEF,MAAM,yCAML;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css } from 'lit';
|
|
8
|
+
import { customElement } from 'lit/decorators.js';
|
|
9
|
+
import { resetStyles } from '../../styles/reset.js';
|
|
10
|
+
let StCard = class StCard extends LitElement {
|
|
11
|
+
render() {
|
|
12
|
+
return html `
|
|
13
|
+
<slot name="header"></slot>
|
|
14
|
+
<slot></slot>
|
|
15
|
+
<slot name="footer"></slot>
|
|
16
|
+
`;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
StCard.styles = [
|
|
20
|
+
resetStyles,
|
|
21
|
+
css `
|
|
22
|
+
:host {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
background-color: var(--st-color-bg);
|
|
26
|
+
border: 1px solid var(--st-color-border);
|
|
27
|
+
border-radius: 8px;
|
|
28
|
+
overflow: hidden; /* Ensures contents don't break the border radius */
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Apply standard padding to all direct slotted children */
|
|
32
|
+
::slotted(*) {
|
|
33
|
+
padding: var(--st-spacing-md) var(--st-spacing-lg);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Optional structured slots for headers and footers */
|
|
37
|
+
::slotted([slot="header"]) {
|
|
38
|
+
border-bottom: 1px solid var(--st-color-border);
|
|
39
|
+
background-color: var(--st-color-surface);
|
|
40
|
+
font-weight: var(--st-font-weight-medium);
|
|
41
|
+
margin: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
::slotted([slot="footer"]) {
|
|
45
|
+
border-top: 1px solid var(--st-color-border);
|
|
46
|
+
background-color: var(--st-color-surface);
|
|
47
|
+
margin-top: auto; /* Pushes the footer to the bottom if the card has a fixed height */
|
|
48
|
+
}
|
|
49
|
+
`
|
|
50
|
+
];
|
|
51
|
+
StCard = __decorate([
|
|
52
|
+
customElement('st-card')
|
|
53
|
+
], StCard);
|
|
54
|
+
export { StCard };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from "lit";
|
|
2
|
+
export declare class StCheckbox extends LitElement {
|
|
3
|
+
static formAssociated: boolean;
|
|
4
|
+
private _internals;
|
|
5
|
+
private _inputEl;
|
|
6
|
+
size: "sm" | "md" | "lg";
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
9
|
+
checked: boolean;
|
|
10
|
+
indeterminate: boolean;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
invalid: boolean;
|
|
13
|
+
required: boolean;
|
|
14
|
+
errorMessage: string;
|
|
15
|
+
ariaLabel: string;
|
|
16
|
+
constructor();
|
|
17
|
+
static styles: import("lit").CSSResult[];
|
|
18
|
+
updated(changedProperties: PropertyValues<this>): void;
|
|
19
|
+
private _syncValidity;
|
|
20
|
+
checkValidity(): boolean;
|
|
21
|
+
reportValidity(): boolean;
|
|
22
|
+
formResetCallback(): void;
|
|
23
|
+
private _handleChange;
|
|
24
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
"st-checkbox": StCheckbox;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAa,cAAc,EAAC,MAAM,KAAK,CAAC;AAI1D,qBACa,UAAW,SAAQ,UAAU;IACxC,MAAM,CAAC,cAAc,UAAQ;IAC7B,OAAO,CAAC,UAAU,CAAmB;IAErB,OAAO,CAAC,QAAQ,CAAoB;IAEX,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAChC,IAAI,SAAM;IACzB,KAAK,SAAQ;IAEG,OAAO,UAAS;IAChB,aAAa,UAAS;IAEtB,QAAQ,UAAS;IACjB,OAAO,UAAS;IAChB,QAAQ,UAAS;IACjC,YAAY,SAAM;IAEP,SAAS,SAAM;IAEpD,cAWC;IAED,MAAM,CAAC,MAAM,4BA6GX;IAEO,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,QAWvD;IAED,OAAO,CAAC,aAAa;IAmBd,aAAa,IAAI,OAAO,CAkB9B;IAEM,cAAc,IAAI,OAAO,CAK/B;IAED,iBAAiB,SAMhB;IAED,OAAO,CAAC,aAAa;IAkBrB,MAAM,yCAwBL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|