@sondor-technology/sondor-components 1.0.0 → 1.0.1-develop.2
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 +28 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.js +247 -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 +13 -0
- package/dist/components/form/form-step.d.ts.map +1 -0
- package/dist/components/form/form-step.js +41 -0
- package/dist/components/form/form.d.ts +25 -0
- package/dist/components/form/form.d.ts.map +1 -0
- package/dist/components/form/form.js +358 -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 +116 -0
- package/dist/components/icon/icon-paths.d.ts.map +1 -0
- package/dist/components/icon/icon-paths.js +121 -0
- package/dist/components/icon/icon.d.ts +16 -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 +24 -0
- package/dist/components/modal/modal.d.ts.map +1 -0
- package/dist/components/modal/modal.js +163 -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 +7 -0
- package/dist/components/router/router.d.ts.map +1 -0
- package/dist/components/router/router.js +37 -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 +17 -0
- package/dist/components/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.js +78 -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 +9 -0
- package/dist/components/vertical-nav/vertical-nav-group.d.ts.map +1 -0
- package/dist/components/vertical-nav/vertical-nav-group.js +111 -0
- package/dist/components/vertical-nav/vertical-nav-item.d.ts +8 -0
- package/dist/components/vertical-nav/vertical-nav-item.d.ts.map +1 -0
- package/dist/components/vertical-nav/vertical-nav-item.js +65 -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 +3 -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 +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
|
@@ -0,0 +1,167 @@
|
|
|
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 StTable = class StTable extends LitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.columns = [];
|
|
14
|
+
this.data = [];
|
|
15
|
+
this.mode = 'horizontal';
|
|
16
|
+
this.striped = false;
|
|
17
|
+
this.hoverable = false;
|
|
18
|
+
this.dense = false;
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return html `
|
|
22
|
+
<div class="table-wrapper">
|
|
23
|
+
<table>
|
|
24
|
+
<thead>
|
|
25
|
+
<tr>
|
|
26
|
+
${this.columns.map(col => html `<th scope="col">${col.header}</th>`)}
|
|
27
|
+
</tr>
|
|
28
|
+
</thead>
|
|
29
|
+
<tbody>
|
|
30
|
+
${this.data.map(row => html `
|
|
31
|
+
<tr>
|
|
32
|
+
${this.columns.map(col => html `
|
|
33
|
+
<td data-label=${col.header}>${row[col.key]}</td>
|
|
34
|
+
`)}
|
|
35
|
+
</tr>
|
|
36
|
+
`)}
|
|
37
|
+
</tbody>
|
|
38
|
+
</table>
|
|
39
|
+
</div>
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
StTable.styles = [
|
|
44
|
+
resetStyles,
|
|
45
|
+
css `
|
|
46
|
+
:host {
|
|
47
|
+
display: block;
|
|
48
|
+
width: 100%;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.table-wrapper {
|
|
52
|
+
width: 100%;
|
|
53
|
+
overflow-x: auto;
|
|
54
|
+
-webkit-overflow-scrolling: touch;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
table {
|
|
58
|
+
width: 100%;
|
|
59
|
+
border-collapse: collapse;
|
|
60
|
+
text-align: left;
|
|
61
|
+
font-size: var(--st-font-size-base, 1rem);
|
|
62
|
+
color: var(--st-color-text);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
th {
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
padding: var(--st-spacing-md) var(--st-spacing-lg);
|
|
68
|
+
border-bottom: 2px solid var(--st-color-border);
|
|
69
|
+
color: var(--st-color-text-muted);
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
td {
|
|
74
|
+
padding: var(--st-spacing-md) var(--st-spacing-lg);
|
|
75
|
+
border-bottom: 1px solid var(--st-color-border);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Modifiers */
|
|
79
|
+
:host([dense]) th,
|
|
80
|
+
:host([dense]) td {
|
|
81
|
+
padding: var(--st-spacing-sm) var(--st-spacing-md);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:host([striped]) tbody tr:nth-of-type(odd) {
|
|
85
|
+
background-color: var(--st-color-surface-muted);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host([hoverable]) tbody tr:hover {
|
|
89
|
+
background-color: var(--st-color-surface-hover);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* ==========================================================
|
|
93
|
+
Vertical Mode (Responsive Stacked Cards)
|
|
94
|
+
========================================================== */
|
|
95
|
+
:host([mode="vertical"]) table,
|
|
96
|
+
:host([mode="vertical"]) tbody,
|
|
97
|
+
:host([mode="vertical"]) tr,
|
|
98
|
+
:host([mode="vertical"]) td {
|
|
99
|
+
display: block;
|
|
100
|
+
width: 100%;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Visually hide header but keep for screen readers */
|
|
104
|
+
:host([mode="vertical"]) thead {
|
|
105
|
+
position: absolute;
|
|
106
|
+
width: 1px;
|
|
107
|
+
height: 1px;
|
|
108
|
+
padding: 0;
|
|
109
|
+
margin: -1px;
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
clip: rect(0, 0, 0, 0);
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
border: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host([mode="vertical"]) tr {
|
|
117
|
+
margin-bottom: var(--st-spacing-md);
|
|
118
|
+
border: 1px solid var(--st-color-border);
|
|
119
|
+
border-radius: var(--st-radius-md);
|
|
120
|
+
background-color: var(--st-color-surface);
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host([mode="vertical"]) td {
|
|
125
|
+
display: flex;
|
|
126
|
+
justify-content: space-between;
|
|
127
|
+
align-items: center;
|
|
128
|
+
border-bottom: 1px solid var(--st-color-border);
|
|
129
|
+
text-align: right;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:host([mode="vertical"]) td:last-child {
|
|
133
|
+
border-bottom: none;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Inject the header name on the left */
|
|
137
|
+
:host([mode="vertical"]) td::before {
|
|
138
|
+
content: attr(data-label);
|
|
139
|
+
font-weight: 600;
|
|
140
|
+
text-align: left;
|
|
141
|
+
padding-right: var(--st-spacing-md);
|
|
142
|
+
color: var(--st-color-text-muted);
|
|
143
|
+
}
|
|
144
|
+
`
|
|
145
|
+
];
|
|
146
|
+
__decorate([
|
|
147
|
+
property({ type: Array })
|
|
148
|
+
], StTable.prototype, "columns", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
property({ type: Array })
|
|
151
|
+
], StTable.prototype, "data", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
property({ type: String, reflect: true })
|
|
154
|
+
], StTable.prototype, "mode", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
property({ type: Boolean, reflect: true })
|
|
157
|
+
], StTable.prototype, "striped", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
property({ type: Boolean, reflect: true })
|
|
160
|
+
], StTable.prototype, "hoverable", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
property({ type: Boolean, reflect: true })
|
|
163
|
+
], StTable.prototype, "dense", void 0);
|
|
164
|
+
StTable = __decorate([
|
|
165
|
+
customElement('st-table')
|
|
166
|
+
], StTable);
|
|
167
|
+
export { StTable };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab-panel.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tab-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,UAAW,SAAQ,UAAU;IACG,IAAI,SAAM;IACT,MAAM,UAAS;IAE3D,MAAM,CAAC,MAAM,4BAYX;IAEF,MAAM,yCAML;CACF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 StTabPanel = class StTabPanel extends LitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.name = '';
|
|
14
|
+
this.active = false;
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return html `
|
|
18
|
+
<div role="tabpanel" aria-hidden=${this.active ? 'false' : 'true'}>
|
|
19
|
+
<slot></slot>
|
|
20
|
+
</div>
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
StTabPanel.styles = [
|
|
25
|
+
resetStyles,
|
|
26
|
+
css `
|
|
27
|
+
:host {
|
|
28
|
+
display: block;
|
|
29
|
+
padding: var(--st-spacing-md) 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host(:not([active])) {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
35
|
+
`
|
|
36
|
+
];
|
|
37
|
+
__decorate([
|
|
38
|
+
property({ type: String, reflect: true })
|
|
39
|
+
], StTabPanel.prototype, "name", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
property({ type: Boolean, reflect: true })
|
|
42
|
+
], StTabPanel.prototype, "active", void 0);
|
|
43
|
+
StTabPanel = __decorate([
|
|
44
|
+
customElement('st-tab-panel')
|
|
45
|
+
], StTabPanel);
|
|
46
|
+
export { StTabPanel };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class StTab extends LitElement {
|
|
3
|
+
panel: string;
|
|
4
|
+
active: boolean;
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
private _handleClick;
|
|
7
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=tab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,KAAM,SAAQ,UAAU;IACQ,KAAK,SAAM;IACV,MAAM,UAAS;IAE3D,MAAM,CAAC,MAAM,4BA6CX;IAEF,OAAO,CAAC,YAAY;IAQpB,MAAM,yCAWL;CACF"}
|
|
@@ -0,0 +1,91 @@
|
|
|
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 StTab = class StTab extends LitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.panel = '';
|
|
14
|
+
this.active = false;
|
|
15
|
+
}
|
|
16
|
+
_handleClick() {
|
|
17
|
+
this.dispatchEvent(new CustomEvent('st-tab-select', {
|
|
18
|
+
detail: { panel: this.panel },
|
|
19
|
+
bubbles: true,
|
|
20
|
+
composed: true
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
return html `
|
|
25
|
+
<button
|
|
26
|
+
role="tab"
|
|
27
|
+
aria-selected=${this.active ? 'true' : 'false'}
|
|
28
|
+
tabindex=${this.active ? '0' : '-1'}
|
|
29
|
+
@click=${this._handleClick}
|
|
30
|
+
>
|
|
31
|
+
<slot></slot>
|
|
32
|
+
</button>
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
StTab.styles = [
|
|
37
|
+
resetStyles,
|
|
38
|
+
css `
|
|
39
|
+
:host {
|
|
40
|
+
display: inline-block;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
button {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: var(--st-spacing-sm);
|
|
47
|
+
background: transparent;
|
|
48
|
+
border: none;
|
|
49
|
+
border-bottom: 2px solid transparent;
|
|
50
|
+
padding: var(--st-spacing-sm) var(--st-spacing-md);
|
|
51
|
+
color: var(--st-color-text-muted);
|
|
52
|
+
font-size: var(--st-font-size-sm);
|
|
53
|
+
font-weight: var(--st-font-weight-medium);
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
transition: all 0.2s ease;
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
button:hover {
|
|
60
|
+
color: var(--st-color-text);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
button:focus-visible {
|
|
64
|
+
outline: none;
|
|
65
|
+
background-color: var(--st-color-surface);
|
|
66
|
+
border-radius: 4px 4px 0 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Active State */
|
|
70
|
+
:host([active]) button {
|
|
71
|
+
color: var(--st-color-primary);
|
|
72
|
+
border-bottom-color: var(--st-color-primary);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
::slotted(svg) {
|
|
76
|
+
width: 1.125rem;
|
|
77
|
+
height: 1.125rem;
|
|
78
|
+
fill: currentColor;
|
|
79
|
+
}
|
|
80
|
+
`
|
|
81
|
+
];
|
|
82
|
+
__decorate([
|
|
83
|
+
property({ type: String, reflect: true })
|
|
84
|
+
], StTab.prototype, "panel", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
property({ type: Boolean, reflect: true })
|
|
87
|
+
], StTab.prototype, "active", void 0);
|
|
88
|
+
StTab = __decorate([
|
|
89
|
+
customElement('st-tab')
|
|
90
|
+
], StTab);
|
|
91
|
+
export { StTab };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./tab.js";
|
|
2
|
+
import "./tab-panel.js";
|
|
3
|
+
import { LitElement } from "lit";
|
|
4
|
+
export declare class StTabs extends LitElement {
|
|
5
|
+
private _tabs;
|
|
6
|
+
private _panels;
|
|
7
|
+
static styles: import("lit").CSSResult[];
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
disconnectedCallback(): void;
|
|
10
|
+
private _handleTabSelect;
|
|
11
|
+
private _handleSlotChange;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,CAAC;AAClB,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAM1C,qBACa,MAAO,SAAQ,UAAU;IAEpC,OAAO,CAAC,KAAK,CAAW;IAGxB,OAAO,CAAC,OAAO,CAAgB;IAE/B,MAAM,CAAC,MAAM,4BAoBX;IAEF,iBAAiB,SAGhB;IAED,oBAAoB,SAGnB;IAED,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,iBAAiB;IAUzB,MAAM,yCASL;CACF"}
|
|
@@ -0,0 +1,85 @@
|
|
|
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 "./tab.js";
|
|
8
|
+
import "./tab-panel.js";
|
|
9
|
+
import { LitElement, html, css } from "lit";
|
|
10
|
+
import { customElement, queryAssignedElements } from "lit/decorators.js";
|
|
11
|
+
import { resetStyles } from "../../styles/reset.js";
|
|
12
|
+
let StTabs = class StTabs extends LitElement {
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
super.connectedCallback();
|
|
15
|
+
this.addEventListener("st-tab-select", this._handleTabSelect);
|
|
16
|
+
}
|
|
17
|
+
disconnectedCallback() {
|
|
18
|
+
super.disconnectedCallback();
|
|
19
|
+
this.removeEventListener("st-tab-select", this._handleTabSelect);
|
|
20
|
+
}
|
|
21
|
+
_handleTabSelect(e) {
|
|
22
|
+
// 1. Stop the event here so parent <st-tabs> instances don't react to it
|
|
23
|
+
e.stopPropagation();
|
|
24
|
+
const targetPanel = e.detail.panel;
|
|
25
|
+
// Update active states on all tabs
|
|
26
|
+
this._tabs.forEach((tab) => {
|
|
27
|
+
tab.active = tab.panel === targetPanel;
|
|
28
|
+
});
|
|
29
|
+
// Update active states on all panels
|
|
30
|
+
this._panels.forEach((panel) => {
|
|
31
|
+
panel.active = panel.name === targetPanel;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
// Ensures the first tab is active by default if none are explicitly set
|
|
35
|
+
_handleSlotChange() {
|
|
36
|
+
if (!this._tabs.length || !this._panels.length)
|
|
37
|
+
return;
|
|
38
|
+
const hasActiveTab = this._tabs.some((tab) => tab.active);
|
|
39
|
+
if (!hasActiveTab) {
|
|
40
|
+
this._tabs[0].active = true;
|
|
41
|
+
this._panels[0].active = true;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
return html `
|
|
46
|
+
<div class="nav-container" role="tablist">
|
|
47
|
+
<slot name="nav" @slotchange=${this._handleSlotChange}></slot>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="panels-container">
|
|
50
|
+
<slot></slot>
|
|
51
|
+
</div>
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
StTabs.styles = [
|
|
56
|
+
resetStyles,
|
|
57
|
+
css `
|
|
58
|
+
:host {
|
|
59
|
+
display: block;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.nav-container {
|
|
63
|
+
display: flex;
|
|
64
|
+
/* Creates the track line underneath the tabs */
|
|
65
|
+
border-bottom: 1px solid var(--st-color-border);
|
|
66
|
+
gap: var(--st-spacing-xs);
|
|
67
|
+
overflow-x: auto; /* Allows tabs to scroll horizontally on small screens */
|
|
68
|
+
scrollbar-width: none; /* Hides scrollbar on Firefox */
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.nav-container::-webkit-scrollbar {
|
|
72
|
+
display: none; /* Hides scrollbar on Chrome/Safari */
|
|
73
|
+
}
|
|
74
|
+
`,
|
|
75
|
+
];
|
|
76
|
+
__decorate([
|
|
77
|
+
queryAssignedElements({ slot: "nav", selector: "st-tab" })
|
|
78
|
+
], StTabs.prototype, "_tabs", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
queryAssignedElements({ selector: "st-tab-panel" })
|
|
81
|
+
], StTabs.prototype, "_panels", void 0);
|
|
82
|
+
StTabs = __decorate([
|
|
83
|
+
customElement("st-tabs")
|
|
84
|
+
], StTabs);
|
|
85
|
+
export { StTabs };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from "lit";
|
|
2
|
+
export type TextareaResize = "none" | "vertical" | "horizontal" | "both";
|
|
3
|
+
export declare class StTextarea extends LitElement {
|
|
4
|
+
static formAssociated: boolean;
|
|
5
|
+
private _internals;
|
|
6
|
+
private _textareaEl;
|
|
7
|
+
name: string;
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
placeholder: string;
|
|
11
|
+
helpText: string;
|
|
12
|
+
rows: number;
|
|
13
|
+
resize: TextareaResize;
|
|
14
|
+
required: boolean;
|
|
15
|
+
minlength?: number;
|
|
16
|
+
maxlength?: number;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
invalid: boolean;
|
|
19
|
+
readonly: boolean;
|
|
20
|
+
constructor();
|
|
21
|
+
static styles: import("lit").CSSResult[];
|
|
22
|
+
updated(changedProperties: PropertyValues<this>): void;
|
|
23
|
+
private _syncValidity;
|
|
24
|
+
formResetCallback(): void;
|
|
25
|
+
checkValidity(): boolean;
|
|
26
|
+
reportValidity(): boolean;
|
|
27
|
+
private _handleInput;
|
|
28
|
+
private _handleChange;
|
|
29
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
30
|
+
}
|
|
31
|
+
declare global {
|
|
32
|
+
interface HTMLElementTagNameMap {
|
|
33
|
+
"st-textarea": StTextarea;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/textarea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAa,cAAc,EAAC,MAAM,KAAK,CAAC;AAK1D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;AAEzE,qBACa,UAAW,SAAQ,UAAU;IACxC,MAAM,CAAC,cAAc,UAAQ;IAC7B,OAAO,CAAC,UAAU,CAAmB;IAElB,OAAO,CAAC,WAAW,CAAuB;IAEpB,IAAI,SAAM;IACzB,KAAK,SAAM;IACX,KAAK,SAAM;IACX,WAAW,SAAM;IACP,QAAQ,SAAM;IAGxB,IAAI,SAAK;IACM,MAAM,EAAE,cAAc,CAAc;IAGnC,QAAQ,UAAS;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGH,QAAQ,UAAS;IACjB,OAAO,UAAS;IAChB,QAAQ,UAAS;IAE3D,cAaC;IAED,MAAM,CAAC,MAAM,4BAuFX;IAEO,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,QAOvD;IAED,OAAO,CAAC,aAAa;IASrB,iBAAiB,SAIhB;IAED,aAAa,YAEZ;IACD,cAAc,YAEb;IAED,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,aAAa;IAIrB,MAAM,yCAuBL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|