@sondor-technology/sondor-components 1.0.0-1165-initial-setup.11 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -3
- package/src/components/alert/alert.ts +100 -100
- package/src/components/badge/badge.ts +96 -96
- package/src/components/breadcrumb/breadcrumb.ts +98 -98
- package/src/components/button/button.ts +281 -281
- package/src/components/button-group/button-group.ts +67 -67
- package/src/components/card/card.ts +52 -52
- package/src/components/checkbox/checkbox.ts +238 -238
- package/src/components/code-block/code-block.ts +256 -256
- package/src/components/content-card/content-card.ts +133 -133
- package/src/components/divider/divider.ts +68 -68
- package/src/components/drawer/drawer.ts +217 -217
- package/src/components/field/field.ts +30 -30
- package/src/components/footer/footer.ts +58 -58
- package/src/components/form/form-step.ts +32 -32
- package/src/components/form/form.ts +376 -376
- package/src/components/grid/grid-row.ts +75 -75
- package/src/components/grid/grid.ts +36 -36
- package/src/components/icon/icon-paths.ts +124 -124
- package/src/components/icon/icon.ts +82 -82
- package/src/components/input/input.ts +248 -248
- package/src/components/link/link.ts +97 -97
- package/src/components/metadata/metadata.ts +66 -66
- package/src/components/modal/modal.ts +158 -158
- package/src/components/page-layout/page-layout.ts +704 -704
- package/src/components/radio/radio.ts +142 -142
- package/src/components/radio-group/radio-group.ts +157 -157
- package/src/components/router/router.ts +46 -46
- package/src/components/select/select.ts +161 -161
- package/src/components/skeleton/skeleton.ts +67 -67
- package/src/components/switch/switch.ts +181 -181
- package/src/components/table/data-table.ts +556 -556
- package/src/components/table/table.ts +153 -153
- package/src/components/tabs/tab-panel.ts +30 -30
- package/src/components/tabs/tab.ts +76 -76
- package/src/components/tabs/tabs.ts +88 -88
- package/src/components/textarea/textarea.ts +215 -215
- package/src/components/theme-toggle/theme-toggle.ts +131 -131
- package/src/components/vertical-nav/vertical-nav-group.ts +96 -96
- package/src/components/vertical-nav/vertical-nav-item.ts +49 -49
- package/src/styles/globals.css +58 -58
- package/src/styles/index.css +80 -80
- package/src/styles/reset.ts +50 -50
- package/src/styles/theme.css +58 -58
- package/src/styles/typography.css +25 -25
- package/tsconfig.json +15 -15
- package/README.md +0 -8
- package/dist/components/alert/alert.d.ts +0 -13
- package/dist/components/alert/alert.d.ts.map +0 -1
- package/dist/components/alert/alert.js +0 -105
- package/dist/components/badge/badge.d.ts +0 -13
- package/dist/components/badge/badge.d.ts.map +0 -1
- package/dist/components/badge/badge.js +0 -101
- package/dist/components/breadcrumb/breadcrumb.d.ts +0 -19
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +0 -1
- package/dist/components/breadcrumb/breadcrumb.js +0 -99
- package/dist/components/button/button.d.ts +0 -23
- package/dist/components/button/button.d.ts.map +0 -1
- package/dist/components/button/button.js +0 -304
- package/dist/components/button-group/button-group.d.ts +0 -6
- package/dist/components/button-group/button-group.d.ts.map +0 -1
- package/dist/components/button-group/button-group.js +0 -74
- package/dist/components/card/card.d.ts +0 -11
- package/dist/components/card/card.d.ts.map +0 -1
- package/dist/components/card/card.js +0 -54
- package/dist/components/checkbox/checkbox.d.ts +0 -28
- package/dist/components/checkbox/checkbox.d.ts.map +0 -1
- package/dist/components/checkbox/checkbox.js +0 -247
- package/dist/components/code-block/code-block.d.ts +0 -20
- package/dist/components/code-block/code-block.d.ts.map +0 -1
- package/dist/components/code-block/code-block.js +0 -260
- package/dist/components/content-card/content-card.d.ts +0 -13
- package/dist/components/content-card/content-card.d.ts.map +0 -1
- package/dist/components/content-card/content-card.js +0 -140
- package/dist/components/divider/divider.d.ts +0 -16
- package/dist/components/divider/divider.d.ts.map +0 -1
- package/dist/components/divider/divider.js +0 -82
- package/dist/components/drawer/drawer.d.ts +0 -22
- package/dist/components/drawer/drawer.d.ts.map +0 -1
- package/dist/components/drawer/drawer.js +0 -226
- package/dist/components/field/field.d.ts +0 -11
- package/dist/components/field/field.d.ts.map +0 -1
- package/dist/components/field/field.js +0 -32
- package/dist/components/footer/footer.d.ts +0 -6
- package/dist/components/footer/footer.d.ts.map +0 -1
- package/dist/components/footer/footer.js +0 -65
- package/dist/components/form/form-step.d.ts +0 -13
- package/dist/components/form/form-step.d.ts.map +0 -1
- package/dist/components/form/form-step.js +0 -41
- package/dist/components/form/form.d.ts +0 -25
- package/dist/components/form/form.d.ts.map +0 -1
- package/dist/components/form/form.js +0 -358
- package/dist/components/grid/grid-row.d.ts +0 -17
- package/dist/components/grid/grid-row.d.ts.map +0 -1
- package/dist/components/grid/grid-row.js +0 -92
- package/dist/components/grid/grid.d.ts +0 -13
- package/dist/components/grid/grid.d.ts.map +0 -1
- package/dist/components/grid/grid.js +0 -42
- package/dist/components/icon/icon-paths.d.ts +0 -116
- package/dist/components/icon/icon-paths.d.ts.map +0 -1
- package/dist/components/icon/icon-paths.js +0 -121
- package/dist/components/icon/icon.d.ts +0 -16
- package/dist/components/icon/icon.d.ts.map +0 -1
- package/dist/components/icon/icon.js +0 -95
- package/dist/components/input/input.d.ts +0 -31
- package/dist/components/input/input.d.ts.map +0 -1
- package/dist/components/input/input.js +0 -268
- package/dist/components/link/link.d.ts +0 -16
- package/dist/components/link/link.d.ts.map +0 -1
- package/dist/components/link/link.js +0 -116
- package/dist/components/metadata/metadata.d.ts +0 -18
- package/dist/components/metadata/metadata.d.ts.map +0 -1
- package/dist/components/metadata/metadata.js +0 -71
- package/dist/components/modal/modal.d.ts +0 -24
- package/dist/components/modal/modal.d.ts.map +0 -1
- package/dist/components/modal/modal.js +0 -163
- package/dist/components/page-layout/page-layout.d.ts +0 -46
- package/dist/components/page-layout/page-layout.d.ts.map +0 -1
- package/dist/components/page-layout/page-layout.js +0 -697
- package/dist/components/radio/radio.d.ts +0 -16
- package/dist/components/radio/radio.d.ts.map +0 -1
- package/dist/components/radio/radio.js +0 -152
- package/dist/components/radio-group/radio-group.d.ts +0 -27
- package/dist/components/radio-group/radio-group.d.ts.map +0 -1
- package/dist/components/radio-group/radio-group.js +0 -161
- package/dist/components/router/router.d.ts +0 -7
- package/dist/components/router/router.d.ts.map +0 -1
- package/dist/components/router/router.js +0 -37
- package/dist/components/select/select.d.ts +0 -16
- package/dist/components/select/select.d.ts.map +0 -1
- package/dist/components/select/select.js +0 -172
- package/dist/components/skeleton/skeleton.d.ts +0 -17
- package/dist/components/skeleton/skeleton.d.ts.map +0 -1
- package/dist/components/skeleton/skeleton.js +0 -78
- package/dist/components/switch/switch.d.ts +0 -25
- package/dist/components/switch/switch.d.ts.map +0 -1
- package/dist/components/switch/switch.js +0 -185
- package/dist/components/table/data-table.d.ts +0 -72
- package/dist/components/table/data-table.d.ts.map +0 -1
- package/dist/components/table/data-table.js +0 -551
- package/dist/components/table/table.d.ts +0 -22
- package/dist/components/table/table.d.ts.map +0 -1
- package/dist/components/table/table.js +0 -167
- package/dist/components/tabs/tab-panel.d.ts +0 -8
- package/dist/components/tabs/tab-panel.d.ts.map +0 -1
- package/dist/components/tabs/tab-panel.js +0 -46
- package/dist/components/tabs/tab.d.ts +0 -9
- package/dist/components/tabs/tab.d.ts.map +0 -1
- package/dist/components/tabs/tab.js +0 -91
- package/dist/components/tabs/tabs.d.ts +0 -14
- package/dist/components/tabs/tabs.d.ts.map +0 -1
- package/dist/components/tabs/tabs.js +0 -85
- package/dist/components/textarea/textarea.d.ts +0 -36
- package/dist/components/textarea/textarea.d.ts.map +0 -1
- package/dist/components/textarea/textarea.js +0 -231
- package/dist/components/theme-toggle/theme-toggle.d.ts +0 -15
- package/dist/components/theme-toggle/theme-toggle.d.ts.map +0 -1
- package/dist/components/theme-toggle/theme-toggle.js +0 -130
- package/dist/components/vertical-nav/vertical-nav-group.d.ts +0 -9
- package/dist/components/vertical-nav/vertical-nav-group.d.ts.map +0 -1
- package/dist/components/vertical-nav/vertical-nav-group.js +0 -111
- package/dist/components/vertical-nav/vertical-nav-item.d.ts +0 -8
- package/dist/components/vertical-nav/vertical-nav-item.d.ts.map +0 -1
- package/dist/components/vertical-nav/vertical-nav-item.js +0 -65
- package/dist/styles/index.css +0 -171
- package/dist/styles/reset.d.ts +0 -2
- package/dist/styles/reset.d.ts.map +0 -1
- package/dist/styles/reset.js +0 -50
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sondor-technology/sondor-components",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -187,6 +187,5 @@
|
|
|
187
187
|
"concurrently": "^10.0.3",
|
|
188
188
|
"esbuild": "^0.28.1",
|
|
189
189
|
"typescript": "^7.0.2"
|
|
190
|
-
}
|
|
191
|
-
"readme": "README.md"
|
|
190
|
+
}
|
|
192
191
|
}
|
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import { LitElement, html, css } from 'lit';
|
|
2
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
-
import { resetStyles } from '../../styles/reset.js';
|
|
4
|
-
|
|
5
|
-
export type AlertColor = 'info' | 'success' | 'warning' | 'error';
|
|
6
|
-
|
|
7
|
-
@customElement('st-alert')
|
|
8
|
-
export class StAlert extends LitElement {
|
|
9
|
-
@property({ type: String, reflect: true }) color: AlertColor = 'info';
|
|
10
|
-
|
|
11
|
-
static styles = [
|
|
12
|
-
resetStyles,
|
|
13
|
-
css`
|
|
14
|
-
:host {
|
|
15
|
-
display: flex;
|
|
16
|
-
gap: var(--st-spacing-md);
|
|
17
|
-
padding: var(--st-spacing-md);
|
|
18
|
-
border-radius: 6px;
|
|
19
|
-
border: 1px solid transparent;
|
|
20
|
-
font-size: var(--st-font-size-base);
|
|
21
|
-
line-height: 1.5;
|
|
22
|
-
|
|
23
|
-
/* Default Palette */
|
|
24
|
-
--_alert-bg: var(--st-color-info-bg);
|
|
25
|
-
--_alert-border: var(--st-color-info);
|
|
26
|
-
--_alert-text: var(--st-color-text);
|
|
27
|
-
--_alert-icon: var(--st-color-info);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/* State Modifiers */
|
|
31
|
-
:host([color="error"]) {
|
|
32
|
-
--_alert-bg: var(--st-color-error-bg);
|
|
33
|
-
--_alert-border: var(--st-color-error);
|
|
34
|
-
--_alert-icon: var(--st-color-error);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
:host([color="success"]) {
|
|
38
|
-
--_alert-bg: var(--st-color-success-bg);
|
|
39
|
-
--_alert-border: var(--st-color-success);
|
|
40
|
-
--_alert-icon: var(--st-color-success);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
:host([color="warning"]) {
|
|
44
|
-
--_alert-bg: var(--st-color-warning-bg);
|
|
45
|
-
--_alert-border: var(--st-color-warning);
|
|
46
|
-
--_alert-icon: var(--st-color-warning);
|
|
47
|
-
/* Amber backgrounds often need forced dark text in light mode, but your tokens handle this */
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* Apply the variables */
|
|
51
|
-
:host {
|
|
52
|
-
background-color: var(--_alert-bg);
|
|
53
|
-
border-color: var(--_alert-border);
|
|
54
|
-
color: var(--_alert-text);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/* Icon Slot */
|
|
58
|
-
.icon-container {
|
|
59
|
-
display: flex;
|
|
60
|
-
flex-shrink: 0;
|
|
61
|
-
color: var(--_alert-icon);
|
|
62
|
-
/* Align icon with the first line of text */
|
|
63
|
-
margin-top: 2px;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
::slotted([slot="icon"]) {
|
|
67
|
-
width: 1.25rem;
|
|
68
|
-
height: 1.25rem;
|
|
69
|
-
fill: none;
|
|
70
|
-
stroke: currentColor;
|
|
71
|
-
stroke-width: 2;
|
|
72
|
-
stroke-linecap: round;
|
|
73
|
-
stroke-linejoin: round;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.content {
|
|
77
|
-
display: flex;
|
|
78
|
-
flex-direction: column;
|
|
79
|
-
gap: var(--st-spacing-xs);
|
|
80
|
-
flex: 1;
|
|
81
|
-
}
|
|
82
|
-
`
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
render() {
|
|
86
|
-
return html`
|
|
87
|
-
<div class="icon-container">
|
|
88
|
-
<slot name="icon"></slot>
|
|
89
|
-
</div>
|
|
90
|
-
<div class="content">
|
|
91
|
-
<slot></slot>
|
|
92
|
-
</div>
|
|
93
|
-
`;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
declare global {
|
|
98
|
-
interface HTMLElementTagNameMap {
|
|
99
|
-
'st-alert': StAlert;
|
|
100
|
-
}
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
+
import { resetStyles } from '../../styles/reset.js';
|
|
4
|
+
|
|
5
|
+
export type AlertColor = 'info' | 'success' | 'warning' | 'error';
|
|
6
|
+
|
|
7
|
+
@customElement('st-alert')
|
|
8
|
+
export class StAlert extends LitElement {
|
|
9
|
+
@property({ type: String, reflect: true }) color: AlertColor = 'info';
|
|
10
|
+
|
|
11
|
+
static styles = [
|
|
12
|
+
resetStyles,
|
|
13
|
+
css`
|
|
14
|
+
:host {
|
|
15
|
+
display: flex;
|
|
16
|
+
gap: var(--st-spacing-md);
|
|
17
|
+
padding: var(--st-spacing-md);
|
|
18
|
+
border-radius: 6px;
|
|
19
|
+
border: 1px solid transparent;
|
|
20
|
+
font-size: var(--st-font-size-base);
|
|
21
|
+
line-height: 1.5;
|
|
22
|
+
|
|
23
|
+
/* Default Palette */
|
|
24
|
+
--_alert-bg: var(--st-color-info-bg);
|
|
25
|
+
--_alert-border: var(--st-color-info);
|
|
26
|
+
--_alert-text: var(--st-color-text);
|
|
27
|
+
--_alert-icon: var(--st-color-info);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* State Modifiers */
|
|
31
|
+
:host([color="error"]) {
|
|
32
|
+
--_alert-bg: var(--st-color-error-bg);
|
|
33
|
+
--_alert-border: var(--st-color-error);
|
|
34
|
+
--_alert-icon: var(--st-color-error);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([color="success"]) {
|
|
38
|
+
--_alert-bg: var(--st-color-success-bg);
|
|
39
|
+
--_alert-border: var(--st-color-success);
|
|
40
|
+
--_alert-icon: var(--st-color-success);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host([color="warning"]) {
|
|
44
|
+
--_alert-bg: var(--st-color-warning-bg);
|
|
45
|
+
--_alert-border: var(--st-color-warning);
|
|
46
|
+
--_alert-icon: var(--st-color-warning);
|
|
47
|
+
/* Amber backgrounds often need forced dark text in light mode, but your tokens handle this */
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Apply the variables */
|
|
51
|
+
:host {
|
|
52
|
+
background-color: var(--_alert-bg);
|
|
53
|
+
border-color: var(--_alert-border);
|
|
54
|
+
color: var(--_alert-text);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Icon Slot */
|
|
58
|
+
.icon-container {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
color: var(--_alert-icon);
|
|
62
|
+
/* Align icon with the first line of text */
|
|
63
|
+
margin-top: 2px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
::slotted([slot="icon"]) {
|
|
67
|
+
width: 1.25rem;
|
|
68
|
+
height: 1.25rem;
|
|
69
|
+
fill: none;
|
|
70
|
+
stroke: currentColor;
|
|
71
|
+
stroke-width: 2;
|
|
72
|
+
stroke-linecap: round;
|
|
73
|
+
stroke-linejoin: round;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.content {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
gap: var(--st-spacing-xs);
|
|
80
|
+
flex: 1;
|
|
81
|
+
}
|
|
82
|
+
`
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
render() {
|
|
86
|
+
return html`
|
|
87
|
+
<div class="icon-container">
|
|
88
|
+
<slot name="icon"></slot>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="content">
|
|
91
|
+
<slot></slot>
|
|
92
|
+
</div>
|
|
93
|
+
`;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
declare global {
|
|
98
|
+
interface HTMLElementTagNameMap {
|
|
99
|
+
'st-alert': StAlert;
|
|
100
|
+
}
|
|
101
101
|
}
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import { LitElement, html, css } from 'lit';
|
|
2
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
-
import { resetStyles } from '../../styles/reset.js';
|
|
4
|
-
|
|
5
|
-
export type BadgeColor = 'primary' | 'neutral' | 'success' | 'warning' | 'error' | 'info';
|
|
6
|
-
|
|
7
|
-
@customElement('st-badge')
|
|
8
|
-
export class StBadge extends LitElement {
|
|
9
|
-
@property({ type: String, reflect: true }) color: BadgeColor = 'neutral';
|
|
10
|
-
|
|
11
|
-
static styles = [
|
|
12
|
-
resetStyles,
|
|
13
|
-
css`
|
|
14
|
-
:host {
|
|
15
|
-
display: inline-flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
padding: 0.125rem 0.5rem; /* 2px 8px */
|
|
19
|
-
font-size: var(--st-font-size-xs);
|
|
20
|
-
font-weight: var(--st-font-weight-medium);
|
|
21
|
-
border-radius: 999px; /* Pill shape */
|
|
22
|
-
line-height: 1.25;
|
|
23
|
-
white-space: nowrap;
|
|
24
|
-
|
|
25
|
-
/* Base / Neutral Palette */
|
|
26
|
-
--_badge-bg: var(--st-color-surface);
|
|
27
|
-
--_badge-text: var(--st-color-text-muted);
|
|
28
|
-
--_badge-border: var(--st-color-border);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/* Base Application */
|
|
32
|
-
:host {
|
|
33
|
-
background-color: var(--_badge-bg);
|
|
34
|
-
color: var(--_badge-text);
|
|
35
|
-
border: 1px solid var(--_badge-border);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/* ==========================================================
|
|
39
|
-
Soft Semantic Variants
|
|
40
|
-
========================================================== */
|
|
41
|
-
:host([color="primary"]) {
|
|
42
|
-
--_badge-bg: var(--st-color-primary);
|
|
43
|
-
--_badge-text: var(--st-white);
|
|
44
|
-
--_badge-border: transparent;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
:host([color="success"]) {
|
|
48
|
-
--_badge-bg: var(--st-color-success-bg);
|
|
49
|
-
--_badge-text: var(--st-color-success);
|
|
50
|
-
--_badge-border: transparent;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
:host([color="warning"]) {
|
|
54
|
-
--_badge-bg: var(--st-color-warning-bg);
|
|
55
|
-
--_badge-text: var(--st-color-warning);
|
|
56
|
-
--_badge-border: transparent;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
:host([color="error"]) {
|
|
60
|
-
--_badge-bg: var(--st-color-error-bg);
|
|
61
|
-
--_badge-text: var(--st-color-error);
|
|
62
|
-
--_badge-border: transparent;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
:host([color="info"]) {
|
|
66
|
-
--_badge-bg: var(--st-color-info-bg);
|
|
67
|
-
--_badge-text: var(--st-color-info);
|
|
68
|
-
--_badge-border: transparent;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/* Optional icon support inside the badge */
|
|
72
|
-
::slotted(svg) {
|
|
73
|
-
width: 0.75rem;
|
|
74
|
-
height: 0.75rem;
|
|
75
|
-
margin-right: 0.25rem;
|
|
76
|
-
fill: none;
|
|
77
|
-
stroke: currentColor;
|
|
78
|
-
stroke-width: 2;
|
|
79
|
-
stroke-linecap: round;
|
|
80
|
-
stroke-linejoin: round;
|
|
81
|
-
}
|
|
82
|
-
`
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
render() {
|
|
86
|
-
return html`
|
|
87
|
-
<slot name="icon"></slot>
|
|
88
|
-
<slot></slot>
|
|
89
|
-
`;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
declare global {
|
|
94
|
-
interface HTMLElementTagNameMap {
|
|
95
|
-
'st-badge': StBadge;
|
|
96
|
-
}
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
+
import { resetStyles } from '../../styles/reset.js';
|
|
4
|
+
|
|
5
|
+
export type BadgeColor = 'primary' | 'neutral' | 'success' | 'warning' | 'error' | 'info';
|
|
6
|
+
|
|
7
|
+
@customElement('st-badge')
|
|
8
|
+
export class StBadge extends LitElement {
|
|
9
|
+
@property({ type: String, reflect: true }) color: BadgeColor = 'neutral';
|
|
10
|
+
|
|
11
|
+
static styles = [
|
|
12
|
+
resetStyles,
|
|
13
|
+
css`
|
|
14
|
+
:host {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
padding: 0.125rem 0.5rem; /* 2px 8px */
|
|
19
|
+
font-size: var(--st-font-size-xs);
|
|
20
|
+
font-weight: var(--st-font-weight-medium);
|
|
21
|
+
border-radius: 999px; /* Pill shape */
|
|
22
|
+
line-height: 1.25;
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
|
|
25
|
+
/* Base / Neutral Palette */
|
|
26
|
+
--_badge-bg: var(--st-color-surface);
|
|
27
|
+
--_badge-text: var(--st-color-text-muted);
|
|
28
|
+
--_badge-border: var(--st-color-border);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Base Application */
|
|
32
|
+
:host {
|
|
33
|
+
background-color: var(--_badge-bg);
|
|
34
|
+
color: var(--_badge-text);
|
|
35
|
+
border: 1px solid var(--_badge-border);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* ==========================================================
|
|
39
|
+
Soft Semantic Variants
|
|
40
|
+
========================================================== */
|
|
41
|
+
:host([color="primary"]) {
|
|
42
|
+
--_badge-bg: var(--st-color-primary);
|
|
43
|
+
--_badge-text: var(--st-white);
|
|
44
|
+
--_badge-border: transparent;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([color="success"]) {
|
|
48
|
+
--_badge-bg: var(--st-color-success-bg);
|
|
49
|
+
--_badge-text: var(--st-color-success);
|
|
50
|
+
--_badge-border: transparent;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([color="warning"]) {
|
|
54
|
+
--_badge-bg: var(--st-color-warning-bg);
|
|
55
|
+
--_badge-text: var(--st-color-warning);
|
|
56
|
+
--_badge-border: transparent;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([color="error"]) {
|
|
60
|
+
--_badge-bg: var(--st-color-error-bg);
|
|
61
|
+
--_badge-text: var(--st-color-error);
|
|
62
|
+
--_badge-border: transparent;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host([color="info"]) {
|
|
66
|
+
--_badge-bg: var(--st-color-info-bg);
|
|
67
|
+
--_badge-text: var(--st-color-info);
|
|
68
|
+
--_badge-border: transparent;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Optional icon support inside the badge */
|
|
72
|
+
::slotted(svg) {
|
|
73
|
+
width: 0.75rem;
|
|
74
|
+
height: 0.75rem;
|
|
75
|
+
margin-right: 0.25rem;
|
|
76
|
+
fill: none;
|
|
77
|
+
stroke: currentColor;
|
|
78
|
+
stroke-width: 2;
|
|
79
|
+
stroke-linecap: round;
|
|
80
|
+
stroke-linejoin: round;
|
|
81
|
+
}
|
|
82
|
+
`
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
render() {
|
|
86
|
+
return html`
|
|
87
|
+
<slot name="icon"></slot>
|
|
88
|
+
<slot></slot>
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
declare global {
|
|
94
|
+
interface HTMLElementTagNameMap {
|
|
95
|
+
'st-badge': StBadge;
|
|
96
|
+
}
|
|
97
97
|
}
|
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import { LitElement, html, css } from 'lit';
|
|
2
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
-
import { resetStyles } from '../../styles/reset.js';
|
|
4
|
-
|
|
5
|
-
export interface BreadcrumbItem {
|
|
6
|
-
label: string;
|
|
7
|
-
href?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@customElement('st-breadcrumb')
|
|
11
|
-
export class StBreadcrumb extends LitElement {
|
|
12
|
-
/**
|
|
13
|
-
* Array of breadcrumb items defining the navigation path.
|
|
14
|
-
*/
|
|
15
|
-
@property({ type: Array }) items: BreadcrumbItem[] = [];
|
|
16
|
-
|
|
17
|
-
static styles = [
|
|
18
|
-
resetStyles,
|
|
19
|
-
css`
|
|
20
|
-
:host {
|
|
21
|
-
display: block;
|
|
22
|
-
font-family: var(--st-font-family, inherit);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
nav {
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
flex-wrap: wrap;
|
|
29
|
-
font-size: var(--st-font-size-sm, 0.875rem);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
ol {
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
flex-wrap: wrap;
|
|
36
|
-
list-style: none;
|
|
37
|
-
margin: 0;
|
|
38
|
-
padding: 0;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
li {
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
color: var(--st-color-text-muted);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
li:not(:last-child)::after {
|
|
48
|
-
content: "/";
|
|
49
|
-
margin: 0 var(--st-spacing-sm, 0.5rem);
|
|
50
|
-
color: var(--st-color-border);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
a {
|
|
54
|
-
color: var(--st-color-text-muted);
|
|
55
|
-
text-decoration: none;
|
|
56
|
-
transition: color 0.2s ease;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
a:hover {
|
|
60
|
-
color: var(--st-color-primary);
|
|
61
|
-
text-decoration: underline;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
li:last-child {
|
|
65
|
-
color: var(--st-color-text);
|
|
66
|
-
font-weight: 500;
|
|
67
|
-
}
|
|
68
|
-
`
|
|
69
|
-
];
|
|
70
|
-
|
|
71
|
-
render() {
|
|
72
|
-
if (!this.items || this.items.length === 0) {
|
|
73
|
-
return html``;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return html`
|
|
77
|
-
<nav aria-label="Breadcrumb">
|
|
78
|
-
<ol>
|
|
79
|
-
${this.items.map((item, index) => {
|
|
80
|
-
const isLast = index === this.items.length - 1;
|
|
81
|
-
return html`
|
|
82
|
-
<li>
|
|
83
|
-
${!isLast && item.href
|
|
84
|
-
? html`<a href=${item.href}>${item.label}</a>`
|
|
85
|
-
: html`<span>${item.label}</span>`}
|
|
86
|
-
</li>
|
|
87
|
-
`;
|
|
88
|
-
})}
|
|
89
|
-
</ol>
|
|
90
|
-
</nav>
|
|
91
|
-
`;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
declare global {
|
|
96
|
-
interface HTMLElementTagNameMap {
|
|
97
|
-
'st-breadcrumb': StBreadcrumb;
|
|
98
|
-
}
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
+
import { resetStyles } from '../../styles/reset.js';
|
|
4
|
+
|
|
5
|
+
export interface BreadcrumbItem {
|
|
6
|
+
label: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@customElement('st-breadcrumb')
|
|
11
|
+
export class StBreadcrumb extends LitElement {
|
|
12
|
+
/**
|
|
13
|
+
* Array of breadcrumb items defining the navigation path.
|
|
14
|
+
*/
|
|
15
|
+
@property({ type: Array }) items: BreadcrumbItem[] = [];
|
|
16
|
+
|
|
17
|
+
static styles = [
|
|
18
|
+
resetStyles,
|
|
19
|
+
css`
|
|
20
|
+
:host {
|
|
21
|
+
display: block;
|
|
22
|
+
font-family: var(--st-font-family, inherit);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
nav {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
font-size: var(--st-font-size-sm, 0.875rem);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
ol {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
flex-wrap: wrap;
|
|
36
|
+
list-style: none;
|
|
37
|
+
margin: 0;
|
|
38
|
+
padding: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
li {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
color: var(--st-color-text-muted);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
li:not(:last-child)::after {
|
|
48
|
+
content: "/";
|
|
49
|
+
margin: 0 var(--st-spacing-sm, 0.5rem);
|
|
50
|
+
color: var(--st-color-border);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
a {
|
|
54
|
+
color: var(--st-color-text-muted);
|
|
55
|
+
text-decoration: none;
|
|
56
|
+
transition: color 0.2s ease;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
a:hover {
|
|
60
|
+
color: var(--st-color-primary);
|
|
61
|
+
text-decoration: underline;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
li:last-child {
|
|
65
|
+
color: var(--st-color-text);
|
|
66
|
+
font-weight: 500;
|
|
67
|
+
}
|
|
68
|
+
`
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
render() {
|
|
72
|
+
if (!this.items || this.items.length === 0) {
|
|
73
|
+
return html``;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return html`
|
|
77
|
+
<nav aria-label="Breadcrumb">
|
|
78
|
+
<ol>
|
|
79
|
+
${this.items.map((item, index) => {
|
|
80
|
+
const isLast = index === this.items.length - 1;
|
|
81
|
+
return html`
|
|
82
|
+
<li>
|
|
83
|
+
${!isLast && item.href
|
|
84
|
+
? html`<a href=${item.href}>${item.label}</a>`
|
|
85
|
+
: html`<span>${item.label}</span>`}
|
|
86
|
+
</li>
|
|
87
|
+
`;
|
|
88
|
+
})}
|
|
89
|
+
</ol>
|
|
90
|
+
</nav>
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare global {
|
|
96
|
+
interface HTMLElementTagNameMap {
|
|
97
|
+
'st-breadcrumb': StBreadcrumb;
|
|
98
|
+
}
|
|
99
99
|
}
|