@sondor-technology/sondor-components 1.0.1-develop.2 → 1.0.1-develop.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/icon/icon-paths.d.ts +16 -0
- package/dist/components/icon/icon-paths.d.ts.map +1 -1
- package/dist/components/icon/icon-paths.js +16 -0
- package/dist/components/skeleton/skeleton.d.ts +2 -3
- package/dist/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton/skeleton.js +89 -18
- package/dist/components/vertical-nav/vertical-nav-group.d.ts +6 -0
- package/dist/components/vertical-nav/vertical-nav-group.d.ts.map +1 -1
- package/dist/components/vertical-nav/vertical-nav-group.js +37 -21
- package/dist/components/vertical-nav/vertical-nav-item.d.ts +6 -0
- package/dist/components/vertical-nav/vertical-nav-item.d.ts.map +1 -1
- package/dist/components/vertical-nav/vertical-nav-item.js +27 -7
- package/package.json +5 -1
- package/src/components/icon/icon-paths.ts +16 -0
- package/src/components/skeleton/skeleton.ts +87 -20
- package/src/components/vertical-nav/vertical-nav-group.ts +40 -21
- package/src/components/vertical-nav/vertical-nav-item.ts +30 -7
|
@@ -111,6 +111,22 @@ export declare const iconPaths: {
|
|
|
111
111
|
outline: import("lit-html").TemplateResult<2>;
|
|
112
112
|
solid: import("lit-html").TemplateResult<2>;
|
|
113
113
|
};
|
|
114
|
+
calender: {
|
|
115
|
+
outline: import("lit-html").TemplateResult<2>;
|
|
116
|
+
solid: import("lit-html").TemplateResult<2>;
|
|
117
|
+
};
|
|
118
|
+
user: {
|
|
119
|
+
outline: import("lit-html").TemplateResult<2>;
|
|
120
|
+
solid: import("lit-html").TemplateResult<2>;
|
|
121
|
+
};
|
|
122
|
+
home: {
|
|
123
|
+
outline: import("lit-html").TemplateResult<2>;
|
|
124
|
+
solid: import("lit-html").TemplateResult<2>;
|
|
125
|
+
};
|
|
126
|
+
"circle-cross": {
|
|
127
|
+
outline: import("lit-html").TemplateResult<2>;
|
|
128
|
+
solid: import("lit-html").TemplateResult<2>;
|
|
129
|
+
};
|
|
114
130
|
};
|
|
115
131
|
export type IconName = keyof typeof iconPaths;
|
|
116
132
|
//# sourceMappingURL=icon-paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-paths.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icon-paths.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;IACpB,cAAc;QACZ,OAAO;QACP,KAAK;;IAEP,gBAAgB;QACd,OAAO;QACP,KAAK;;IAEP,IAAI;QACF,OAAO;QACP,KAAK;;IAEP,OAAO;QACL,OAAO;QACP,KAAK;;IAEP,QAAQ;QACN,OAAO;QACP,KAAK;;IAEP,gBAAgB;QACd,OAAO;QACP,KAAK;;IAEP,OAAO;QACL,OAAO;QACP,KAAK;;IAEP,SAAS;QACP,OAAO;QACP,KAAK;;IAEP,iBAAiB;QACf,OAAO;QACP,KAAK;;IAEP,OAAO;QACL,OAAO;QACP,KAAK;;IAEP,GAAG;QACD,OAAO;QACP,KAAK;;IAEP,OAAO;QACL,OAAO;QACP,KAAK;;IAEP,SAAS;QACP,OAAO;QACP,KAAK;;IAEP,cAAc;QACZ,OAAO;QACP,KAAK;;IAEP,eAAe;QACb,OAAO;QACP,KAAK;;IAEP,OAAO;QACL,OAAO;QACP,KAAK;;IAEP,QAAQ;QACN,OAAO;QACP,KAAK;;IAEP,MAAM;QACJ,OAAO;QACP,KAAK;;IAEP,eAAe;QACb,OAAO;QAIP,KAAK;;IAKP,QAAQ;QACN,OAAO;QACP,KAAK;;IAEP,KAAK;QACH,OAAO;QACP,KAAK;;IAEP,WAAW;QACT,OAAO;QACP,KAAK;;IAEP,MAAM;QACJ,OAAO;QACP,KAAK;;IAEP,IAAI;QACF,OAAO;QACP,KAAK;;IAEP,sBAAsB;QACpB,OAAO;QACP,KAAK;;IAEP,wBAAwB;QACtB,OAAO;QACP,KAAK;;IAEP,kBAAkB;QAChB,OAAO;QACP,KAAK;;IAEP,qBAAqB;QACnB,OAAO;QACP,KAAK;;CAER,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"icon-paths.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icon-paths.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;IACpB,cAAc;QACZ,OAAO;QACP,KAAK;;IAEP,gBAAgB;QACd,OAAO;QACP,KAAK;;IAEP,IAAI;QACF,OAAO;QACP,KAAK;;IAEP,OAAO;QACL,OAAO;QACP,KAAK;;IAEP,QAAQ;QACN,OAAO;QACP,KAAK;;IAEP,gBAAgB;QACd,OAAO;QACP,KAAK;;IAEP,OAAO;QACL,OAAO;QACP,KAAK;;IAEP,SAAS;QACP,OAAO;QACP,KAAK;;IAEP,iBAAiB;QACf,OAAO;QACP,KAAK;;IAEP,OAAO;QACL,OAAO;QACP,KAAK;;IAEP,GAAG;QACD,OAAO;QACP,KAAK;;IAEP,OAAO;QACL,OAAO;QACP,KAAK;;IAEP,SAAS;QACP,OAAO;QACP,KAAK;;IAEP,cAAc;QACZ,OAAO;QACP,KAAK;;IAEP,eAAe;QACb,OAAO;QACP,KAAK;;IAEP,OAAO;QACL,OAAO;QACP,KAAK;;IAEP,QAAQ;QACN,OAAO;QACP,KAAK;;IAEP,MAAM;QACJ,OAAO;QACP,KAAK;;IAEP,eAAe;QACb,OAAO;QAIP,KAAK;;IAKP,QAAQ;QACN,OAAO;QACP,KAAK;;IAEP,KAAK;QACH,OAAO;QACP,KAAK;;IAEP,WAAW;QACT,OAAO;QACP,KAAK;;IAEP,MAAM;QACJ,OAAO;QACP,KAAK;;IAEP,IAAI;QACF,OAAO;QACP,KAAK;;IAEP,sBAAsB;QACpB,OAAO;QACP,KAAK;;IAEP,wBAAwB;QACtB,OAAO;QACP,KAAK;;IAEP,kBAAkB;QAChB,OAAO;QACP,KAAK;;IAEP,qBAAqB;QACnB,OAAO;QACP,KAAK;;IAEP,QAAQ;QACN,OAAO;QACP,KAAK;;IAEP,IAAI;QACF,OAAO;QACP,KAAK;;IAEP,IAAI;QACF,OAAO;QACP,KAAK;;IAEP,cAAc;QACZ,OAAO;QACP,KAAK;;CAER,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,SAAS,CAAC"}
|
|
@@ -118,4 +118,20 @@ export const iconPaths = {
|
|
|
118
118
|
outline: svg `<rect x="3" y="3" width="18" height="18" rx="2" stroke="currentColor" stroke-width="2" fill="none"></rect><line x1="3" y1="8" x2="21" y2="8" stroke="currentColor" stroke-width="2"></line><line x1="7" y1="8" x2="7" y2="21" stroke="currentColor" stroke-width="2"></line><line x1="17" y1="8" x2="17" y2="21" stroke="currentColor" stroke-width="2"></line><line x1="10" y1="14" x2="14" y2="14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></line>`,
|
|
119
119
|
solid: svg `<path fill="currentColor" d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5zm2 3h14V5H5v3zM7 9H3v12h4V9zm14 0h-4v12h4V9z"></path>`,
|
|
120
120
|
},
|
|
121
|
+
calender: {
|
|
122
|
+
outline: svg `<rect x="3" y="4" width="18" height="18" rx="2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></rect><line x1="16" y1="2" x2="16" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round"></line><line x1="8" y1="2" x2="8" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round"></line><line x1="3" y1="10" x2="21" y2="10" stroke="currentColor" stroke-width="2"></line>`,
|
|
123
|
+
solid: svg `<path fill="currentColor" d="M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V9h14v11z"></path>`,
|
|
124
|
+
},
|
|
125
|
+
user: {
|
|
126
|
+
outline: svg `<circle cx="12" cy="8" r="4" fill="none" stroke="currentColor" stroke-width="2"></circle><path d="M4 20c0-4 4-6 8-6s8 2 8 6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path>`,
|
|
127
|
+
solid: svg `<path fill="currentColor" d="M12 12a5 5 0 1 0-5-5 5 5 0 0 0 5 5zm0 2c-3.33 0-10 1.67-10 5v3h20v-3c0-3.33-6.67-5-10-5z"></path>`,
|
|
128
|
+
},
|
|
129
|
+
home: {
|
|
130
|
+
outline: svg `<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><polyline points="9 22 9 12 15 12 15 22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></polyline>`,
|
|
131
|
+
solid: svg `<path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"></path>`,
|
|
132
|
+
},
|
|
133
|
+
"circle-cross": {
|
|
134
|
+
outline: svg `<circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></circle><line x1="15" y1="9" x2="9" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></line><line x1="9" y1="9" x2="15" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></line>`,
|
|
135
|
+
solid: svg `<path fill="currentColor" fill-rule="evenodd" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm3.36 6.64a1 1 0 0 1 0 1.41L13.41 12l1.95 1.95a1 1 0 0 1-1.41 1.41L12 13.41l-1.95 1.95a1 1 0 0 1-1.41-1.41L10.59 12 8.64 10.05a1 1 0 0 1 1.41-1.41L12 10.59l1.95-1.95a1 1 0 0 1 1.41 0z" clip-rule="evenodd"></path>`,
|
|
136
|
+
},
|
|
121
137
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
export declare class StSkeleton extends LitElement {
|
|
3
|
-
/** Variant shape: 'text' | 'circular' | 'rectangular' */
|
|
4
3
|
variant: 'text' | 'circular' | 'rectangular';
|
|
5
|
-
|
|
4
|
+
animation: 'shimmer' | 'pulse' | 'none';
|
|
6
5
|
width: string;
|
|
7
|
-
/** Custom height override (e.g., '40px', '1rem') */
|
|
8
6
|
height: string;
|
|
7
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
9
8
|
static styles: import("lit").CSSResult[];
|
|
10
9
|
render(): import("lit-html").TemplateResult<1>;
|
|
11
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,UAAW,SAAQ,UAAU;
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,UAAW,SAAQ,UAAU;IACG,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,CAAU;IACtD,SAAS,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,CAAa;IACnE,KAAK,SAAM;IACX,MAAM,SAAM;IAGxC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,QAkBhE;IAED,MAAM,CAAC,MAAM,4BAyFX;IAEF,MAAM,yCAIL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
|
@@ -10,19 +10,35 @@ import { resetStyles } from '../../styles/reset.js';
|
|
|
10
10
|
let StSkeleton = class StSkeleton extends LitElement {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
|
-
/** Variant shape: 'text' | 'circular' | 'rectangular' */
|
|
14
13
|
this.variant = 'text';
|
|
15
|
-
|
|
14
|
+
this.animation = 'shimmer';
|
|
16
15
|
this.width = '';
|
|
17
|
-
/** Custom height override (e.g., '40px', '1rem') */
|
|
18
16
|
this.height = '';
|
|
19
17
|
}
|
|
18
|
+
// Apply properties directly to the :host as CSS variables when they change
|
|
19
|
+
updated(changedProperties) {
|
|
20
|
+
super.updated(changedProperties);
|
|
21
|
+
if (changedProperties.has('width')) {
|
|
22
|
+
if (this.width) {
|
|
23
|
+
this.style.setProperty('--st-skeleton-width', this.width);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.style.removeProperty('--st-skeleton-width');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (changedProperties.has('height')) {
|
|
30
|
+
if (this.height) {
|
|
31
|
+
this.style.setProperty('--st-skeleton-height', this.height);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.style.removeProperty('--st-skeleton-height');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
20
38
|
render() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
${this.height ? `--st-skeleton-height: ${this.height};` : ''}
|
|
39
|
+
return html `
|
|
40
|
+
<div class="skeleton" aria-hidden="true" part="base"></div>
|
|
24
41
|
`;
|
|
25
|
-
return html `<div class="skeleton" style=${style}></div>`;
|
|
26
42
|
}
|
|
27
43
|
};
|
|
28
44
|
StSkeleton.styles = [
|
|
@@ -30,12 +46,38 @@ StSkeleton.styles = [
|
|
|
30
46
|
css `
|
|
31
47
|
:host {
|
|
32
48
|
display: block;
|
|
33
|
-
|
|
49
|
+
|
|
50
|
+
/* Define base sizing variables that can be overridden by props */
|
|
51
|
+
--_width: var(--st-skeleton-width, 100%);
|
|
52
|
+
--_height: var(--st-skeleton-height, 1em);
|
|
53
|
+
|
|
54
|
+
/*
|
|
55
|
+
CRITICAL FIX: Apply sizing directly to the host.
|
|
56
|
+
This allows external classes and styles (like margin: auto) to work perfectly.
|
|
57
|
+
*/
|
|
58
|
+
width: var(--_width);
|
|
59
|
+
height: var(--_height);
|
|
60
|
+
|
|
61
|
+
/* Expose radius as a token for external theme overrides */
|
|
62
|
+
--st-skeleton-radius: var(--st-radius-sm, 0.25rem);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Shape Variants adjust the host's sizing variables */
|
|
66
|
+
:host([variant="circular"]) {
|
|
67
|
+
--_width: var(--st-skeleton-width, 2.5rem);
|
|
68
|
+
--_height: var(--st-skeleton-height, 2.5rem);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host([variant="rectangular"]) {
|
|
72
|
+
--_height: var(--st-skeleton-height, 8rem);
|
|
34
73
|
}
|
|
35
74
|
|
|
36
75
|
.skeleton {
|
|
37
|
-
|
|
38
|
-
|
|
76
|
+
/* The inner element simply fills the host */
|
|
77
|
+
display: block;
|
|
78
|
+
width: 100%;
|
|
79
|
+
height: 100%;
|
|
80
|
+
|
|
39
81
|
background: linear-gradient(
|
|
40
82
|
90deg,
|
|
41
83
|
var(--st-color-surface-muted, #f1f5f9) 25%,
|
|
@@ -43,29 +85,58 @@ StSkeleton.styles = [
|
|
|
43
85
|
var(--st-color-surface-muted, #f1f5f9) 63%
|
|
44
86
|
);
|
|
45
87
|
background-size: 400% 100%;
|
|
46
|
-
|
|
47
|
-
|
|
88
|
+
border-radius: var(--st-skeleton-radius);
|
|
89
|
+
|
|
90
|
+
/* Prevent accidental selection */
|
|
91
|
+
user-select: none;
|
|
92
|
+
pointer-events: none;
|
|
48
93
|
}
|
|
49
94
|
|
|
50
95
|
:host([variant="circular"]) .skeleton {
|
|
51
96
|
border-radius: 50%;
|
|
52
|
-
height: var(--st-skeleton-height, 2.5rem);
|
|
53
|
-
width: var(--st-skeleton-width, 2.5rem);
|
|
54
97
|
}
|
|
55
98
|
|
|
56
|
-
|
|
57
|
-
|
|
99
|
+
/* Animations */
|
|
100
|
+
:host([animation="shimmer"]) .skeleton {
|
|
101
|
+
animation: st-shimmer 1.4s ease infinite;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host([animation="pulse"]) .skeleton {
|
|
105
|
+
background: var(--st-color-surface-muted, #f1f5f9);
|
|
106
|
+
animation: st-pulse 1.5s ease-in-out infinite;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:host([animation="none"]) .skeleton {
|
|
110
|
+
background: var(--st-color-surface-muted, #f1f5f9);
|
|
111
|
+
animation: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Accessibility: Respect OS reduced motion settings */
|
|
115
|
+
@media (prefers-reduced-motion: reduce) {
|
|
116
|
+
.skeleton {
|
|
117
|
+
animation: none !important;
|
|
118
|
+
background: var(--st-color-surface-muted, #f1f5f9) !important;
|
|
119
|
+
}
|
|
58
120
|
}
|
|
59
121
|
|
|
60
122
|
@keyframes st-shimmer {
|
|
61
123
|
0% { background-position: 100% 0; }
|
|
62
|
-
100% { background-position:
|
|
124
|
+
100% { background-position: -100% 0; }
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@keyframes st-pulse {
|
|
128
|
+
0% { opacity: 1; }
|
|
129
|
+
50% { opacity: 0.4; }
|
|
130
|
+
100% { opacity: 1; }
|
|
63
131
|
}
|
|
64
132
|
`
|
|
65
133
|
];
|
|
66
134
|
__decorate([
|
|
67
|
-
property({ type: String })
|
|
135
|
+
property({ type: String, reflect: true })
|
|
68
136
|
], StSkeleton.prototype, "variant", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
property({ type: String, reflect: true })
|
|
139
|
+
], StSkeleton.prototype, "animation", void 0);
|
|
69
140
|
__decorate([
|
|
70
141
|
property({ type: String })
|
|
71
142
|
], StSkeleton.prototype, "width", void 0);
|
|
@@ -2,8 +2,14 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
export declare class StNavGroup extends LitElement {
|
|
3
3
|
label: string;
|
|
4
4
|
open: boolean;
|
|
5
|
+
depth: number;
|
|
5
6
|
static styles: import("lit").CSSResult[];
|
|
6
7
|
private _toggle;
|
|
7
8
|
render(): import("lit-html").TemplateResult<1>;
|
|
8
9
|
}
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
'st-vertical-nav-group': StNavGroup;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
9
15
|
//# sourceMappingURL=vertical-nav-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertical-nav-group.d.ts","sourceRoot":"","sources":["../../../src/components/vertical-nav/vertical-nav-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,UAAW,SAAQ,UAAU;IACZ,KAAK,SAAM;IACK,IAAI,UAAS;
|
|
1
|
+
{"version":3,"file":"vertical-nav-group.d.ts","sourceRoot":"","sources":["../../../src/components/vertical-nav/vertical-nav-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,UAAW,SAAQ,UAAU;IACZ,KAAK,SAAM;IACK,IAAI,UAAS;IAC7B,KAAK,SAAK;IAEtC,MAAM,CAAC,MAAM,4BA8EX;IAEF,OAAO,CAAC,OAAO;IAIf,MAAM,yCAcL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,UAAU,CAAC;KACrC;CACF"}
|
|
@@ -12,25 +12,22 @@ let StNavGroup = class StNavGroup extends LitElement {
|
|
|
12
12
|
super(...arguments);
|
|
13
13
|
this.label = '';
|
|
14
14
|
this.open = false;
|
|
15
|
+
this.depth = 0;
|
|
15
16
|
}
|
|
16
17
|
_toggle() {
|
|
17
18
|
this.open = !this.open;
|
|
18
19
|
}
|
|
19
20
|
render() {
|
|
20
21
|
return html `
|
|
21
|
-
<button @click=${this._toggle} aria-expanded=${this.open}>
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
</svg>
|
|
22
|
+
<button @click=${this._toggle} aria-expanded=${this.open} style="--nav-depth: ${this.depth}">
|
|
23
|
+
<slot name="icon"></slot>
|
|
24
|
+
<span class="label">${this.label}</span>
|
|
25
|
+
<svg class="chevron" viewBox="0 0 24 24"><path d="M6 9l6 6 6-6"></path></svg>
|
|
26
26
|
</button>
|
|
27
27
|
|
|
28
28
|
<div class="drawer">
|
|
29
29
|
<div class="drawer-content">
|
|
30
|
-
|
|
31
|
-
<div style="padding: 4px 0;">
|
|
32
|
-
<slot></slot>
|
|
33
|
-
</div>
|
|
30
|
+
<slot></slot>
|
|
34
31
|
</div>
|
|
35
32
|
</div>
|
|
36
33
|
`;
|
|
@@ -41,32 +38,51 @@ StNavGroup.styles = [
|
|
|
41
38
|
css `
|
|
42
39
|
:host {
|
|
43
40
|
display: block;
|
|
44
|
-
margin-bottom:
|
|
41
|
+
margin-bottom: 2px;
|
|
42
|
+
overflow: hidden;
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
button {
|
|
48
46
|
display: flex;
|
|
49
47
|
align-items: center;
|
|
50
|
-
|
|
48
|
+
gap: var(--st-spacing-sm, 8px);
|
|
51
49
|
width: 100%;
|
|
50
|
+
box-sizing: border-box;
|
|
52
51
|
background: transparent;
|
|
53
52
|
border: none;
|
|
54
|
-
padding: var(--st-spacing-
|
|
53
|
+
padding: var(--st-spacing-sm) var(--st-spacing-xl);
|
|
54
|
+
padding-left: calc(var(--st-spacing-xl, 24px) + (var(--nav-depth, 0) * 16px));
|
|
55
55
|
color: var(--st-color-text);
|
|
56
56
|
font-size: var(--st-font-size-sm);
|
|
57
|
-
font-weight: var(--st-font-weight-
|
|
57
|
+
font-weight: var(--st-font-weight-semibold);
|
|
58
58
|
cursor: pointer;
|
|
59
|
-
|
|
60
|
-
transition: color 0.2s ease;
|
|
59
|
+
transition: background-color 0.2s ease, color 0.2s ease;
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
button:hover {
|
|
64
|
-
color: var(--st-color-
|
|
63
|
+
background-color: var(--st-color-surface-hover, rgba(0,0,0,0.03));
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
/* Styles for slotted icons */
|
|
67
|
+
::slotted([slot="icon"]) {
|
|
68
68
|
width: 1rem;
|
|
69
69
|
height: 1rem;
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
color: var(--st-color-text-muted);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.label {
|
|
75
|
+
flex: 1;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
text-overflow: ellipsis;
|
|
79
|
+
text-align: left;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
svg.chevron {
|
|
83
|
+
width: 1rem;
|
|
84
|
+
height: 1rem;
|
|
85
|
+
flex-shrink: 0;
|
|
70
86
|
fill: none;
|
|
71
87
|
stroke: currentColor;
|
|
72
88
|
stroke-width: 2;
|
|
@@ -75,12 +91,10 @@ StNavGroup.styles = [
|
|
|
75
91
|
transition: transform 0.2s ease;
|
|
76
92
|
}
|
|
77
93
|
|
|
78
|
-
|
|
79
|
-
:host([open]) svg {
|
|
94
|
+
:host([open]) svg.chevron {
|
|
80
95
|
transform: rotate(180deg);
|
|
81
96
|
}
|
|
82
97
|
|
|
83
|
-
/* Modern CSS Grid Animation trick for accordion height */
|
|
84
98
|
.drawer {
|
|
85
99
|
display: grid;
|
|
86
100
|
grid-template-rows: 0fr;
|
|
@@ -95,7 +109,6 @@ StNavGroup.styles = [
|
|
|
95
109
|
overflow: hidden;
|
|
96
110
|
display: flex;
|
|
97
111
|
flex-direction: column;
|
|
98
|
-
gap: 2px;
|
|
99
112
|
}
|
|
100
113
|
`
|
|
101
114
|
];
|
|
@@ -105,6 +118,9 @@ __decorate([
|
|
|
105
118
|
__decorate([
|
|
106
119
|
property({ type: Boolean, reflect: true })
|
|
107
120
|
], StNavGroup.prototype, "open", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
property({ type: Number })
|
|
123
|
+
], StNavGroup.prototype, "depth", void 0);
|
|
108
124
|
StNavGroup = __decorate([
|
|
109
125
|
customElement('st-vertical-nav-group')
|
|
110
126
|
], StNavGroup);
|
|
@@ -2,7 +2,13 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
export declare class StNavItem extends LitElement {
|
|
3
3
|
href: string;
|
|
4
4
|
active: boolean;
|
|
5
|
+
depth: number;
|
|
5
6
|
static styles: import("lit").CSSResult[];
|
|
6
7
|
render(): import("lit-html").TemplateResult<1>;
|
|
7
8
|
}
|
|
9
|
+
declare global {
|
|
10
|
+
interface HTMLElementTagNameMap {
|
|
11
|
+
'st-vertical-nav-item': StNavItem;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
8
14
|
//# sourceMappingURL=vertical-nav-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertical-nav-item.d.ts","sourceRoot":"","sources":["../../../src/components/vertical-nav/vertical-nav-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,SAAU,SAAQ,UAAU;IACX,IAAI,SAAO;IACK,MAAM,UAAS;
|
|
1
|
+
{"version":3,"file":"vertical-nav-item.d.ts","sourceRoot":"","sources":["../../../src/components/vertical-nav/vertical-nav-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,SAAU,SAAQ,UAAU;IACX,IAAI,SAAO;IACK,MAAM,UAAS;IAC/B,KAAK,SAAK;IAEtC,MAAM,CAAC,MAAM,4BA8CX;IAEF,MAAM,yCAOL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,SAAS,CAAC;KACnC;CACF"}
|
|
@@ -12,10 +12,12 @@ let StNavItem = class StNavItem extends LitElement {
|
|
|
12
12
|
super(...arguments);
|
|
13
13
|
this.href = '#';
|
|
14
14
|
this.active = false;
|
|
15
|
+
this.depth = 0;
|
|
15
16
|
}
|
|
16
17
|
render() {
|
|
17
18
|
return html `
|
|
18
|
-
<a href=${this.href} part="link">
|
|
19
|
+
<a href=${this.href} part="link" style="--nav-depth: ${this.depth}">
|
|
20
|
+
<slot name="icon"></slot>
|
|
19
21
|
<slot></slot>
|
|
20
22
|
</a>
|
|
21
23
|
`;
|
|
@@ -26,30 +28,45 @@ StNavItem.styles = [
|
|
|
26
28
|
css `
|
|
27
29
|
:host {
|
|
28
30
|
display: block;
|
|
31
|
+
overflow: hidden;
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
a {
|
|
32
35
|
display: flex;
|
|
33
36
|
align-items: center;
|
|
34
|
-
|
|
37
|
+
gap: var(--st-spacing-sm, 8px);
|
|
38
|
+
width: 100%;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
padding: 8px var(--st-spacing-xl);
|
|
41
|
+
padding-left: calc(var(--st-spacing-xl, 24px) + (var(--nav-depth, 0) * 16px));
|
|
35
42
|
color: var(--st-color-text-muted);
|
|
36
43
|
font-size: var(--st-font-size-sm);
|
|
37
44
|
text-decoration: none;
|
|
38
|
-
border-left:
|
|
45
|
+
border-left: 3px solid transparent;
|
|
39
46
|
transition: all 0.15s ease;
|
|
47
|
+
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
text-overflow: ellipsis;
|
|
40
51
|
}
|
|
41
52
|
|
|
42
53
|
a:hover {
|
|
43
54
|
color: var(--st-color-text);
|
|
44
|
-
background-color: var(--st-color-surface);
|
|
55
|
+
background-color: var(--st-color-surface-hover, rgba(0,0,0,0.03));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
::slotted([slot="icon"]) {
|
|
59
|
+
width: 1rem;
|
|
60
|
+
height: 1rem;
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
color: inherit;
|
|
45
63
|
}
|
|
46
64
|
|
|
47
|
-
/* Active state: Purple text with a left border indicator */
|
|
48
65
|
:host([active]) a {
|
|
49
66
|
color: var(--st-color-primary);
|
|
50
67
|
border-left-color: var(--st-color-primary);
|
|
51
|
-
font-weight: var(--st-font-weight-
|
|
52
|
-
background-color:
|
|
68
|
+
font-weight: var(--st-font-weight-bold);
|
|
69
|
+
background-color: var(--st-color-primary-light, rgba(98, 0, 238, 0.05));
|
|
53
70
|
}
|
|
54
71
|
`
|
|
55
72
|
];
|
|
@@ -59,6 +76,9 @@ __decorate([
|
|
|
59
76
|
__decorate([
|
|
60
77
|
property({ type: Boolean, reflect: true })
|
|
61
78
|
], StNavItem.prototype, "active", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: Number })
|
|
81
|
+
], StNavItem.prototype, "depth", void 0);
|
|
62
82
|
StNavItem = __decorate([
|
|
63
83
|
customElement('st-vertical-nav-item')
|
|
64
84
|
], StNavItem);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sondor-technology/sondor-components",
|
|
3
|
-
"version": "1.0.1-develop.
|
|
3
|
+
"version": "1.0.1-develop.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -101,6 +101,10 @@
|
|
|
101
101
|
"types": "./dist/components/icon/icon.d.ts",
|
|
102
102
|
"default": "./dist/components/icon/icon.js"
|
|
103
103
|
},
|
|
104
|
+
"./icon-paths": {
|
|
105
|
+
"types": "./dist/components/icon/icon-paths.d.ts",
|
|
106
|
+
"default": "./dist/components/icon/icon-paths.js"
|
|
107
|
+
},
|
|
104
108
|
"./footer": {
|
|
105
109
|
"types": "./dist/components/footer/footer.d.ts",
|
|
106
110
|
"default": "./dist/components/footer/footer.js"
|
|
@@ -119,6 +119,22 @@ export const iconPaths = {
|
|
|
119
119
|
outline: svg`<rect x="3" y="3" width="18" height="18" rx="2" stroke="currentColor" stroke-width="2" fill="none"></rect><line x1="3" y1="8" x2="21" y2="8" stroke="currentColor" stroke-width="2"></line><line x1="7" y1="8" x2="7" y2="21" stroke="currentColor" stroke-width="2"></line><line x1="17" y1="8" x2="17" y2="21" stroke="currentColor" stroke-width="2"></line><line x1="10" y1="14" x2="14" y2="14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></line>`,
|
|
120
120
|
solid: svg`<path fill="currentColor" d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5zm2 3h14V5H5v3zM7 9H3v12h4V9zm14 0h-4v12h4V9z"></path>`,
|
|
121
121
|
},
|
|
122
|
+
calender: {
|
|
123
|
+
outline: svg`<rect x="3" y="4" width="18" height="18" rx="2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></rect><line x1="16" y1="2" x2="16" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round"></line><line x1="8" y1="2" x2="8" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round"></line><line x1="3" y1="10" x2="21" y2="10" stroke="currentColor" stroke-width="2"></line>`,
|
|
124
|
+
solid: svg`<path fill="currentColor" d="M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V9h14v11z"></path>`,
|
|
125
|
+
},
|
|
126
|
+
user: {
|
|
127
|
+
outline: svg`<circle cx="12" cy="8" r="4" fill="none" stroke="currentColor" stroke-width="2"></circle><path d="M4 20c0-4 4-6 8-6s8 2 8 6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path>`,
|
|
128
|
+
solid: svg`<path fill="currentColor" d="M12 12a5 5 0 1 0-5-5 5 5 0 0 0 5 5zm0 2c-3.33 0-10 1.67-10 5v3h20v-3c0-3.33-6.67-5-10-5z"></path>`,
|
|
129
|
+
},
|
|
130
|
+
home: {
|
|
131
|
+
outline: svg`<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><polyline points="9 22 9 12 15 12 15 22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></polyline>`,
|
|
132
|
+
solid: svg`<path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"></path>`,
|
|
133
|
+
},
|
|
134
|
+
"circle-cross": {
|
|
135
|
+
outline: svg`<circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></circle><line x1="15" y1="9" x2="9" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></line><line x1="9" y1="9" x2="15" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></line>`,
|
|
136
|
+
solid: svg`<path fill="currentColor" fill-rule="evenodd" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm3.36 6.64a1 1 0 0 1 0 1.41L13.41 12l1.95 1.95a1 1 0 0 1-1.41 1.41L12 13.41l-1.95 1.95a1 1 0 0 1-1.41-1.41L10.59 12 8.64 10.05a1 1 0 0 1 1.41-1.41L12 10.59l1.95-1.95a1 1 0 0 1 1.41 0z" clip-rule="evenodd"></path>`,
|
|
137
|
+
},
|
|
122
138
|
};
|
|
123
139
|
|
|
124
140
|
export type IconName = keyof typeof iconPaths;
|
|
@@ -4,26 +4,69 @@ import { resetStyles } from '../../styles/reset.js';
|
|
|
4
4
|
|
|
5
5
|
@customElement('st-skeleton')
|
|
6
6
|
export class StSkeleton extends LitElement {
|
|
7
|
-
|
|
8
|
-
@property({ type: String })
|
|
9
|
-
|
|
10
|
-
/** Custom width override (e.g., '200px', '50%') */
|
|
7
|
+
@property({ type: String, reflect: true }) variant: 'text' | 'circular' | 'rectangular' = 'text';
|
|
8
|
+
@property({ type: String, reflect: true }) animation: 'shimmer' | 'pulse' | 'none' = 'shimmer';
|
|
11
9
|
@property({ type: String }) width = '';
|
|
12
|
-
|
|
13
|
-
/** Custom height override (e.g., '40px', '1rem') */
|
|
14
10
|
@property({ type: String }) height = '';
|
|
15
11
|
|
|
12
|
+
// Apply properties directly to the :host as CSS variables when they change
|
|
13
|
+
updated(changedProperties: Map<string | number | symbol, unknown>) {
|
|
14
|
+
super.updated(changedProperties);
|
|
15
|
+
|
|
16
|
+
if (changedProperties.has('width')) {
|
|
17
|
+
if (this.width) {
|
|
18
|
+
this.style.setProperty('--st-skeleton-width', this.width);
|
|
19
|
+
} else {
|
|
20
|
+
this.style.removeProperty('--st-skeleton-width');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (changedProperties.has('height')) {
|
|
25
|
+
if (this.height) {
|
|
26
|
+
this.style.setProperty('--st-skeleton-height', this.height);
|
|
27
|
+
} else {
|
|
28
|
+
this.style.removeProperty('--st-skeleton-height');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
16
33
|
static styles = [
|
|
17
34
|
resetStyles,
|
|
18
35
|
css`
|
|
19
36
|
:host {
|
|
20
37
|
display: block;
|
|
21
|
-
|
|
38
|
+
|
|
39
|
+
/* Define base sizing variables that can be overridden by props */
|
|
40
|
+
--_width: var(--st-skeleton-width, 100%);
|
|
41
|
+
--_height: var(--st-skeleton-height, 1em);
|
|
42
|
+
|
|
43
|
+
/*
|
|
44
|
+
CRITICAL FIX: Apply sizing directly to the host.
|
|
45
|
+
This allows external classes and styles (like margin: auto) to work perfectly.
|
|
46
|
+
*/
|
|
47
|
+
width: var(--_width);
|
|
48
|
+
height: var(--_height);
|
|
49
|
+
|
|
50
|
+
/* Expose radius as a token for external theme overrides */
|
|
51
|
+
--st-skeleton-radius: var(--st-radius-sm, 0.25rem);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Shape Variants adjust the host's sizing variables */
|
|
55
|
+
:host([variant="circular"]) {
|
|
56
|
+
--_width: var(--st-skeleton-width, 2.5rem);
|
|
57
|
+
--_height: var(--st-skeleton-height, 2.5rem);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host([variant="rectangular"]) {
|
|
61
|
+
--_height: var(--st-skeleton-height, 8rem);
|
|
22
62
|
}
|
|
23
63
|
|
|
24
64
|
.skeleton {
|
|
25
|
-
|
|
26
|
-
|
|
65
|
+
/* The inner element simply fills the host */
|
|
66
|
+
display: block;
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: 100%;
|
|
69
|
+
|
|
27
70
|
background: linear-gradient(
|
|
28
71
|
90deg,
|
|
29
72
|
var(--st-color-surface-muted, #f1f5f9) 25%,
|
|
@@ -31,33 +74,57 @@ export class StSkeleton extends LitElement {
|
|
|
31
74
|
var(--st-color-surface-muted, #f1f5f9) 63%
|
|
32
75
|
);
|
|
33
76
|
background-size: 400% 100%;
|
|
34
|
-
|
|
35
|
-
|
|
77
|
+
border-radius: var(--st-skeleton-radius);
|
|
78
|
+
|
|
79
|
+
/* Prevent accidental selection */
|
|
80
|
+
user-select: none;
|
|
81
|
+
pointer-events: none;
|
|
36
82
|
}
|
|
37
83
|
|
|
38
84
|
:host([variant="circular"]) .skeleton {
|
|
39
85
|
border-radius: 50%;
|
|
40
|
-
height: var(--st-skeleton-height, 2.5rem);
|
|
41
|
-
width: var(--st-skeleton-width, 2.5rem);
|
|
42
86
|
}
|
|
43
87
|
|
|
44
|
-
|
|
45
|
-
|
|
88
|
+
/* Animations */
|
|
89
|
+
:host([animation="shimmer"]) .skeleton {
|
|
90
|
+
animation: st-shimmer 1.4s ease infinite;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:host([animation="pulse"]) .skeleton {
|
|
94
|
+
background: var(--st-color-surface-muted, #f1f5f9);
|
|
95
|
+
animation: st-pulse 1.5s ease-in-out infinite;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host([animation="none"]) .skeleton {
|
|
99
|
+
background: var(--st-color-surface-muted, #f1f5f9);
|
|
100
|
+
animation: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Accessibility: Respect OS reduced motion settings */
|
|
104
|
+
@media (prefers-reduced-motion: reduce) {
|
|
105
|
+
.skeleton {
|
|
106
|
+
animation: none !important;
|
|
107
|
+
background: var(--st-color-surface-muted, #f1f5f9) !important;
|
|
108
|
+
}
|
|
46
109
|
}
|
|
47
110
|
|
|
48
111
|
@keyframes st-shimmer {
|
|
49
112
|
0% { background-position: 100% 0; }
|
|
50
|
-
100% { background-position:
|
|
113
|
+
100% { background-position: -100% 0; }
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@keyframes st-pulse {
|
|
117
|
+
0% { opacity: 1; }
|
|
118
|
+
50% { opacity: 0.4; }
|
|
119
|
+
100% { opacity: 1; }
|
|
51
120
|
}
|
|
52
121
|
`
|
|
53
122
|
];
|
|
54
123
|
|
|
55
124
|
render() {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
${this.height ? `--st-skeleton-height: ${this.height};` : ''}
|
|
125
|
+
return html`
|
|
126
|
+
<div class="skeleton" aria-hidden="true" part="base"></div>
|
|
59
127
|
`;
|
|
60
|
-
return html`<div class="skeleton" style=${style}></div>`;
|
|
61
128
|
}
|
|
62
129
|
}
|
|
63
130
|
|
|
@@ -6,38 +6,58 @@ import { resetStyles } from '../../styles/reset.js';
|
|
|
6
6
|
export class StNavGroup extends LitElement {
|
|
7
7
|
@property({ type: String }) label = '';
|
|
8
8
|
@property({ type: Boolean, reflect: true }) open = false;
|
|
9
|
+
@property({ type: Number }) depth = 0;
|
|
9
10
|
|
|
10
11
|
static styles = [
|
|
11
12
|
resetStyles,
|
|
12
13
|
css`
|
|
13
14
|
:host {
|
|
14
15
|
display: block;
|
|
15
|
-
margin-bottom:
|
|
16
|
+
margin-bottom: 2px;
|
|
17
|
+
overflow: hidden;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
button {
|
|
19
21
|
display: flex;
|
|
20
22
|
align-items: center;
|
|
21
|
-
|
|
23
|
+
gap: var(--st-spacing-sm, 8px);
|
|
22
24
|
width: 100%;
|
|
25
|
+
box-sizing: border-box;
|
|
23
26
|
background: transparent;
|
|
24
27
|
border: none;
|
|
25
|
-
padding: var(--st-spacing-
|
|
28
|
+
padding: var(--st-spacing-sm) var(--st-spacing-xl);
|
|
29
|
+
padding-left: calc(var(--st-spacing-xl, 24px) + (var(--nav-depth, 0) * 16px));
|
|
26
30
|
color: var(--st-color-text);
|
|
27
31
|
font-size: var(--st-font-size-sm);
|
|
28
|
-
font-weight: var(--st-font-weight-
|
|
32
|
+
font-weight: var(--st-font-weight-semibold);
|
|
29
33
|
cursor: pointer;
|
|
30
|
-
|
|
31
|
-
transition: color 0.2s ease;
|
|
34
|
+
transition: background-color 0.2s ease, color 0.2s ease;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
button:hover {
|
|
35
|
-
color: var(--st-color-
|
|
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);
|
|
36
47
|
}
|
|
37
48
|
|
|
38
|
-
|
|
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 {
|
|
39
58
|
width: 1rem;
|
|
40
59
|
height: 1rem;
|
|
60
|
+
flex-shrink: 0;
|
|
41
61
|
fill: none;
|
|
42
62
|
stroke: currentColor;
|
|
43
63
|
stroke-width: 2;
|
|
@@ -46,12 +66,10 @@ export class StNavGroup extends LitElement {
|
|
|
46
66
|
transition: transform 0.2s ease;
|
|
47
67
|
}
|
|
48
68
|
|
|
49
|
-
|
|
50
|
-
:host([open]) svg {
|
|
69
|
+
:host([open]) svg.chevron {
|
|
51
70
|
transform: rotate(180deg);
|
|
52
71
|
}
|
|
53
72
|
|
|
54
|
-
/* Modern CSS Grid Animation trick for accordion height */
|
|
55
73
|
.drawer {
|
|
56
74
|
display: grid;
|
|
57
75
|
grid-template-rows: 0fr;
|
|
@@ -66,7 +84,6 @@ export class StNavGroup extends LitElement {
|
|
|
66
84
|
overflow: hidden;
|
|
67
85
|
display: flex;
|
|
68
86
|
flex-direction: column;
|
|
69
|
-
gap: 2px;
|
|
70
87
|
}
|
|
71
88
|
`
|
|
72
89
|
];
|
|
@@ -77,21 +94,23 @@ export class StNavGroup extends LitElement {
|
|
|
77
94
|
|
|
78
95
|
render() {
|
|
79
96
|
return html`
|
|
80
|
-
<button @click=${this._toggle} aria-expanded=${this.open}>
|
|
81
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
</svg>
|
|
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>
|
|
85
101
|
</button>
|
|
86
102
|
|
|
87
103
|
<div class="drawer">
|
|
88
104
|
<div class="drawer-content">
|
|
89
|
-
|
|
90
|
-
<div style="padding: 4px 0;">
|
|
91
|
-
<slot></slot>
|
|
92
|
-
</div>
|
|
105
|
+
<slot></slot>
|
|
93
106
|
</div>
|
|
94
107
|
</div>
|
|
95
108
|
`;
|
|
96
109
|
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare global {
|
|
113
|
+
interface HTMLElementTagNameMap {
|
|
114
|
+
'st-vertical-nav-group': StNavGroup;
|
|
115
|
+
}
|
|
97
116
|
}
|
|
@@ -6,45 +6,68 @@ import { resetStyles } from '../../styles/reset.js';
|
|
|
6
6
|
export class StNavItem extends LitElement {
|
|
7
7
|
@property({ type: String }) href = '#';
|
|
8
8
|
@property({ type: Boolean, reflect: true }) active = false;
|
|
9
|
+
@property({ type: Number }) depth = 0;
|
|
9
10
|
|
|
10
11
|
static styles = [
|
|
11
12
|
resetStyles,
|
|
12
13
|
css`
|
|
13
14
|
:host {
|
|
14
15
|
display: block;
|
|
16
|
+
overflow: hidden;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
a {
|
|
18
20
|
display: flex;
|
|
19
21
|
align-items: center;
|
|
20
|
-
|
|
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));
|
|
21
27
|
color: var(--st-color-text-muted);
|
|
22
28
|
font-size: var(--st-font-size-sm);
|
|
23
29
|
text-decoration: none;
|
|
24
|
-
border-left:
|
|
30
|
+
border-left: 3px solid transparent;
|
|
25
31
|
transition: all 0.15s ease;
|
|
32
|
+
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
text-overflow: ellipsis;
|
|
26
36
|
}
|
|
27
37
|
|
|
28
38
|
a:hover {
|
|
29
39
|
color: var(--st-color-text);
|
|
30
|
-
background-color: var(--st-color-surface);
|
|
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;
|
|
31
48
|
}
|
|
32
49
|
|
|
33
|
-
/* Active state: Purple text with a left border indicator */
|
|
34
50
|
:host([active]) a {
|
|
35
51
|
color: var(--st-color-primary);
|
|
36
52
|
border-left-color: var(--st-color-primary);
|
|
37
|
-
font-weight: var(--st-font-weight-
|
|
38
|
-
background-color:
|
|
53
|
+
font-weight: var(--st-font-weight-bold);
|
|
54
|
+
background-color: var(--st-color-primary-light, rgba(98, 0, 238, 0.05));
|
|
39
55
|
}
|
|
40
56
|
`
|
|
41
57
|
];
|
|
42
58
|
|
|
43
59
|
render() {
|
|
44
60
|
return html`
|
|
45
|
-
<a href=${this.href} part="link">
|
|
61
|
+
<a href=${this.href} part="link" style="--nav-depth: ${this.depth}">
|
|
62
|
+
<slot name="icon"></slot>
|
|
46
63
|
<slot></slot>
|
|
47
64
|
</a>
|
|
48
65
|
`;
|
|
49
66
|
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare global {
|
|
70
|
+
interface HTMLElementTagNameMap {
|
|
71
|
+
'st-vertical-nav-item': StNavItem;
|
|
72
|
+
}
|
|
50
73
|
}
|