@sondor-technology/sondor-components 1.0.0 → 1.0.1-develop.3
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 +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 +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 +10 -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 +9 -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 +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 +140 -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 +109 -96
- package/src/components/vertical-nav/vertical-nav-item.ts +66 -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
|
@@ -1,131 +1,131 @@
|
|
|
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 ThemeMode = "light" | "system" | "dark";
|
|
6
|
-
|
|
7
|
-
@customElement("st-theme-toggle")
|
|
8
|
-
export class StThemeToggle extends LitElement {
|
|
9
|
-
@property({type: String, reflect: true}) theme: ThemeMode = "system";
|
|
10
|
-
|
|
11
|
-
static styles = [
|
|
12
|
-
resetStyles,
|
|
13
|
-
css`
|
|
14
|
-
:host {
|
|
15
|
-
display: inline-flex;
|
|
16
|
-
/* Use semantic tokens for the container */
|
|
17
|
-
background-color: var(--st-color-surface);
|
|
18
|
-
border: 1px solid var(--st-color-border);
|
|
19
|
-
border-radius: 999px;
|
|
20
|
-
padding: 4px;
|
|
21
|
-
gap: 2px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
button {
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
justify-content: center;
|
|
28
|
-
width: 28px;
|
|
29
|
-
height: 28px;
|
|
30
|
-
border-radius: 50%;
|
|
31
|
-
border: none;
|
|
32
|
-
background: transparent;
|
|
33
|
-
color: var(--st-color-text-muted);
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
transition: all 0.2s ease;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
button:hover {
|
|
39
|
-
color: var(--st-color-text);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/* Active State Styling */
|
|
43
|
-
button[aria-pressed="true"] {
|
|
44
|
-
/* Use the main background color so the active pill "pops" out of the surface */
|
|
45
|
-
background-color: var(--st-color-bg);
|
|
46
|
-
color: var(--st-color-primary);
|
|
47
|
-
/* Subtle shadow to lift the active pill */
|
|
48
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
svg {
|
|
52
|
-
width: 16px;
|
|
53
|
-
height: 16px;
|
|
54
|
-
fill: none;
|
|
55
|
-
stroke: currentColor;
|
|
56
|
-
stroke-width: 2;
|
|
57
|
-
stroke-linecap: round;
|
|
58
|
-
stroke-linejoin: round;
|
|
59
|
-
}
|
|
60
|
-
`,
|
|
61
|
-
];
|
|
62
|
-
|
|
63
|
-
private _handleThemeChange(newTheme: ThemeMode) {
|
|
64
|
-
this.theme = newTheme;
|
|
65
|
-
|
|
66
|
-
// Dispatch an event so the consuming app knows to update the document root
|
|
67
|
-
this.dispatchEvent(
|
|
68
|
-
new CustomEvent("st-theme-change", {
|
|
69
|
-
detail: {theme: newTheme},
|
|
70
|
-
bubbles: true,
|
|
71
|
-
composed: true,
|
|
72
|
-
}),
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
override connectedCallback() {
|
|
77
|
-
super.connectedCallback();
|
|
78
|
-
// Check the html tag for the theme injected by your blocking <head> script
|
|
79
|
-
const rootTheme = document.documentElement.getAttribute("data-theme") as ThemeMode;
|
|
80
|
-
if (rootTheme) {
|
|
81
|
-
this.theme = rootTheme;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
render() {
|
|
86
|
-
return html`
|
|
87
|
-
<button
|
|
88
|
-
aria-pressed=${this.theme === "light"}
|
|
89
|
-
title="Light Mode"
|
|
90
|
-
@click=${() => this._handleThemeChange("light")}
|
|
91
|
-
>
|
|
92
|
-
<!-- Sun Icon -->
|
|
93
|
-
<svg viewBox="0 0 24 24">
|
|
94
|
-
<circle cx="12" cy="12" r="5"></circle>
|
|
95
|
-
<path
|
|
96
|
-
d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"
|
|
97
|
-
></path>
|
|
98
|
-
</svg>
|
|
99
|
-
</button>
|
|
100
|
-
|
|
101
|
-
<button
|
|
102
|
-
aria-pressed=${this.theme === "system"}
|
|
103
|
-
title="System Preference"
|
|
104
|
-
@click=${() => this._handleThemeChange("system")}
|
|
105
|
-
>
|
|
106
|
-
<!-- Monitor/System Icon -->
|
|
107
|
-
<svg viewBox="0 0 24 24">
|
|
108
|
-
<rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect>
|
|
109
|
-
<path d="M8 21h8M12 17v4"></path>
|
|
110
|
-
</svg>
|
|
111
|
-
</button>
|
|
112
|
-
|
|
113
|
-
<button
|
|
114
|
-
aria-pressed=${this.theme === "dark"}
|
|
115
|
-
title="Dark Mode"
|
|
116
|
-
@click=${() => this._handleThemeChange("dark")}
|
|
117
|
-
>
|
|
118
|
-
<!-- Moon Icon -->
|
|
119
|
-
<svg viewBox="0 0 24 24">
|
|
120
|
-
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
|
|
121
|
-
</svg>
|
|
122
|
-
</button>
|
|
123
|
-
`;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
declare global {
|
|
128
|
-
interface HTMLElementTagNameMap {
|
|
129
|
-
"st-theme-toggle": StThemeToggle;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
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 ThemeMode = "light" | "system" | "dark";
|
|
6
|
+
|
|
7
|
+
@customElement("st-theme-toggle")
|
|
8
|
+
export class StThemeToggle extends LitElement {
|
|
9
|
+
@property({type: String, reflect: true}) theme: ThemeMode = "system";
|
|
10
|
+
|
|
11
|
+
static styles = [
|
|
12
|
+
resetStyles,
|
|
13
|
+
css`
|
|
14
|
+
:host {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
/* Use semantic tokens for the container */
|
|
17
|
+
background-color: var(--st-color-surface);
|
|
18
|
+
border: 1px solid var(--st-color-border);
|
|
19
|
+
border-radius: 999px;
|
|
20
|
+
padding: 4px;
|
|
21
|
+
gap: 2px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
button {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
width: 28px;
|
|
29
|
+
height: 28px;
|
|
30
|
+
border-radius: 50%;
|
|
31
|
+
border: none;
|
|
32
|
+
background: transparent;
|
|
33
|
+
color: var(--st-color-text-muted);
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
transition: all 0.2s ease;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
button:hover {
|
|
39
|
+
color: var(--st-color-text);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Active State Styling */
|
|
43
|
+
button[aria-pressed="true"] {
|
|
44
|
+
/* Use the main background color so the active pill "pops" out of the surface */
|
|
45
|
+
background-color: var(--st-color-bg);
|
|
46
|
+
color: var(--st-color-primary);
|
|
47
|
+
/* Subtle shadow to lift the active pill */
|
|
48
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
svg {
|
|
52
|
+
width: 16px;
|
|
53
|
+
height: 16px;
|
|
54
|
+
fill: none;
|
|
55
|
+
stroke: currentColor;
|
|
56
|
+
stroke-width: 2;
|
|
57
|
+
stroke-linecap: round;
|
|
58
|
+
stroke-linejoin: round;
|
|
59
|
+
}
|
|
60
|
+
`,
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
private _handleThemeChange(newTheme: ThemeMode) {
|
|
64
|
+
this.theme = newTheme;
|
|
65
|
+
|
|
66
|
+
// Dispatch an event so the consuming app knows to update the document root
|
|
67
|
+
this.dispatchEvent(
|
|
68
|
+
new CustomEvent("st-theme-change", {
|
|
69
|
+
detail: {theme: newTheme},
|
|
70
|
+
bubbles: true,
|
|
71
|
+
composed: true,
|
|
72
|
+
}),
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
override connectedCallback() {
|
|
77
|
+
super.connectedCallback();
|
|
78
|
+
// Check the html tag for the theme injected by your blocking <head> script
|
|
79
|
+
const rootTheme = document.documentElement.getAttribute("data-theme") as ThemeMode;
|
|
80
|
+
if (rootTheme) {
|
|
81
|
+
this.theme = rootTheme;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
render() {
|
|
86
|
+
return html`
|
|
87
|
+
<button
|
|
88
|
+
aria-pressed=${this.theme === "light"}
|
|
89
|
+
title="Light Mode"
|
|
90
|
+
@click=${() => this._handleThemeChange("light")}
|
|
91
|
+
>
|
|
92
|
+
<!-- Sun Icon -->
|
|
93
|
+
<svg viewBox="0 0 24 24">
|
|
94
|
+
<circle cx="12" cy="12" r="5"></circle>
|
|
95
|
+
<path
|
|
96
|
+
d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"
|
|
97
|
+
></path>
|
|
98
|
+
</svg>
|
|
99
|
+
</button>
|
|
100
|
+
|
|
101
|
+
<button
|
|
102
|
+
aria-pressed=${this.theme === "system"}
|
|
103
|
+
title="System Preference"
|
|
104
|
+
@click=${() => this._handleThemeChange("system")}
|
|
105
|
+
>
|
|
106
|
+
<!-- Monitor/System Icon -->
|
|
107
|
+
<svg viewBox="0 0 24 24">
|
|
108
|
+
<rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect>
|
|
109
|
+
<path d="M8 21h8M12 17v4"></path>
|
|
110
|
+
</svg>
|
|
111
|
+
</button>
|
|
112
|
+
|
|
113
|
+
<button
|
|
114
|
+
aria-pressed=${this.theme === "dark"}
|
|
115
|
+
title="Dark Mode"
|
|
116
|
+
@click=${() => this._handleThemeChange("dark")}
|
|
117
|
+
>
|
|
118
|
+
<!-- Moon Icon -->
|
|
119
|
+
<svg viewBox="0 0 24 24">
|
|
120
|
+
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
|
|
121
|
+
</svg>
|
|
122
|
+
</button>
|
|
123
|
+
`;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
declare global {
|
|
128
|
+
interface HTMLElementTagNameMap {
|
|
129
|
+
"st-theme-toggle": StThemeToggle;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -1,97 +1,110 @@
|
|
|
1
|
-
import { LitElement, html, css } from 'lit';
|
|
2
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
-
import { resetStyles } from '../../styles/reset.js';
|
|
4
|
-
|
|
5
|
-
@customElement('st-vertical-nav-group')
|
|
6
|
-
export class StNavGroup extends LitElement {
|
|
7
|
-
@property({ type: String }) label = '';
|
|
8
|
-
@property({ type: Boolean, reflect: true }) open = false;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
+
@customElement('st-vertical-nav-group')
|
|
6
|
+
export class StNavGroup extends LitElement {
|
|
7
|
+
@property({ type: String }) label = '';
|
|
8
|
+
@property({ type: Boolean, reflect: true }) open = false;
|
|
9
|
+
@property({ type: Number }) depth = 0;
|
|
10
|
+
|
|
11
|
+
static styles = [
|
|
12
|
+
resetStyles,
|
|
13
|
+
css`
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
margin-bottom: 2px;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
button {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: var(--st-spacing-sm, 8px);
|
|
24
|
+
width: 100%;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
background: transparent;
|
|
27
|
+
border: none;
|
|
28
|
+
padding: var(--st-spacing-sm) var(--st-spacing-xl);
|
|
29
|
+
padding-left: calc(var(--st-spacing-xl, 24px) + (var(--nav-depth, 0) * 16px));
|
|
30
|
+
color: var(--st-color-text);
|
|
31
|
+
font-size: var(--st-font-size-sm);
|
|
32
|
+
font-weight: var(--st-font-weight-semibold);
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
transition: background-color 0.2s ease, color 0.2s ease;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
button:hover {
|
|
38
|
+
background-color: var(--st-color-surface-hover, rgba(0,0,0,0.03));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Styles for slotted icons */
|
|
42
|
+
::slotted([slot="icon"]) {
|
|
43
|
+
width: 1rem;
|
|
44
|
+
height: 1rem;
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
color: var(--st-color-text-muted);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.label {
|
|
50
|
+
flex: 1;
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
text-align: left;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
svg.chevron {
|
|
58
|
+
width: 1rem;
|
|
59
|
+
height: 1rem;
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
fill: none;
|
|
62
|
+
stroke: currentColor;
|
|
63
|
+
stroke-width: 2;
|
|
64
|
+
stroke-linecap: round;
|
|
65
|
+
stroke-linejoin: round;
|
|
66
|
+
transition: transform 0.2s ease;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:host([open]) svg.chevron {
|
|
70
|
+
transform: rotate(180deg);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.drawer {
|
|
74
|
+
display: grid;
|
|
75
|
+
grid-template-rows: 0fr;
|
|
76
|
+
transition: grid-template-rows 0.2s ease-in-out;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([open]) .drawer {
|
|
80
|
+
grid-template-rows: 1fr;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.drawer-content {
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
}
|
|
88
|
+
`
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
private _toggle() {
|
|
92
|
+
this.open = !this.open;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
render() {
|
|
96
|
+
return html`
|
|
97
|
+
<button @click=${this._toggle} aria-expanded=${this.open} style="--nav-depth: ${this.depth}">
|
|
98
|
+
<slot name="icon"></slot>
|
|
99
|
+
<span class="label">${this.label}</span>
|
|
100
|
+
<svg class="chevron" viewBox="0 0 24 24"><path d="M6 9l6 6 6-6"></path></svg>
|
|
101
|
+
</button>
|
|
102
|
+
|
|
103
|
+
<div class="drawer">
|
|
104
|
+
<div class="drawer-content">
|
|
105
|
+
<slot></slot>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
`;
|
|
109
|
+
}
|
|
97
110
|
}
|
|
@@ -1,50 +1,67 @@
|
|
|
1
|
-
import { LitElement, html, css } from 'lit';
|
|
2
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
-
import { resetStyles } from '../../styles/reset.js';
|
|
4
|
-
|
|
5
|
-
@customElement('st-vertical-nav-item')
|
|
6
|
-
export class StNavItem extends LitElement {
|
|
7
|
-
@property({ type: String }) href = '#';
|
|
8
|
-
@property({ type: Boolean, reflect: true }) active = false;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
+
import { resetStyles } from '../../styles/reset.js';
|
|
4
|
+
|
|
5
|
+
@customElement('st-vertical-nav-item')
|
|
6
|
+
export class StNavItem extends LitElement {
|
|
7
|
+
@property({ type: String }) href = '#';
|
|
8
|
+
@property({ type: Boolean, reflect: true }) active = false;
|
|
9
|
+
@property({ type: Number }) depth = 0;
|
|
10
|
+
|
|
11
|
+
static styles = [
|
|
12
|
+
resetStyles,
|
|
13
|
+
css`
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
a {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--st-spacing-sm, 8px);
|
|
23
|
+
width: 100%;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
padding: 8px var(--st-spacing-xl);
|
|
26
|
+
padding-left: calc(var(--st-spacing-xl, 24px) + (var(--nav-depth, 0) * 16px));
|
|
27
|
+
color: var(--st-color-text-muted);
|
|
28
|
+
font-size: var(--st-font-size-sm);
|
|
29
|
+
text-decoration: none;
|
|
30
|
+
border-left: 3px solid transparent;
|
|
31
|
+
transition: all 0.15s ease;
|
|
32
|
+
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
text-overflow: ellipsis;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
a:hover {
|
|
39
|
+
color: var(--st-color-text);
|
|
40
|
+
background-color: var(--st-color-surface-hover, rgba(0,0,0,0.03));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
::slotted([slot="icon"]) {
|
|
44
|
+
width: 1rem;
|
|
45
|
+
height: 1rem;
|
|
46
|
+
flex-shrink: 0;
|
|
47
|
+
color: inherit;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([active]) a {
|
|
51
|
+
color: var(--st-color-primary);
|
|
52
|
+
border-left-color: var(--st-color-primary);
|
|
53
|
+
font-weight: var(--st-font-weight-bold);
|
|
54
|
+
background-color: var(--st-color-primary-light, rgba(98, 0, 238, 0.05));
|
|
55
|
+
}
|
|
56
|
+
`
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
render() {
|
|
60
|
+
return html`
|
|
61
|
+
<a href=${this.href} part="link" style="--nav-depth: ${this.depth}">
|
|
62
|
+
<slot name="icon"></slot>
|
|
63
|
+
<slot></slot>
|
|
64
|
+
</a>
|
|
65
|
+
`;
|
|
66
|
+
}
|
|
50
67
|
}
|