@sondor-technology/sondor-components 1.0.1-develop.2 → 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/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/vertical-nav/vertical-nav-group.d.ts +1 -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 +1 -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/vertical-nav/vertical-nav-group.ts +34 -21
- package/src/components/vertical-nav/vertical-nav-item.ts +24 -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 +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"}
|
|
@@ -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);
|
|
@@ -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"}
|
|
@@ -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.3",
|
|
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;
|
|
@@ -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);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.label {
|
|
50
|
+
flex: 1;
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
text-align: left;
|
|
36
55
|
}
|
|
37
56
|
|
|
38
|
-
svg {
|
|
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,19 +94,15 @@ 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
|
`;
|
|
@@ -6,43 +6,60 @@ 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
|
`;
|