@kubex/zinc 1.0.119 → 1.1.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/dist/custom-elements.json +453 -20
- package/dist/vscode.html-custom-data.json +87 -11
- package/dist/web-types.json +168 -12
- package/dist/zn.d.ts +149 -25
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +911 -874
- package/docs/assets/styles/docs.css +1 -1
- package/docs/pages/components/button.md +25 -7
- package/docs/pages/components/chat-message.md +62 -0
- package/docs/pages/components/data-table-search.md +6 -6
- package/docs/pages/components/editor.md +1 -1
- package/docs/pages/components/file.md +1 -1
- package/docs/pages/components/form-group.md +1 -1
- package/docs/pages/components/icon.md +19 -2
- package/docs/pages/components/menu.md +23 -2
- package/docs/pages/components/select.md +2 -2
- package/docs/pages/components/tile-group.md +92 -0
- package/docs/pages/components/tile.md +80 -25
- package/package.json +1 -1
- package/scss/_root.scss +1 -1
- package/scss/mixins/_spacing-mixins.scss +20 -0
- package/scss/mixins/_typography-mixins.scss +22 -0
- package/scss/mixins/index.scss +2 -1
- package/scss/shared/_base.scss +18 -20
- package/scss/shared/_button.scss +5 -3
- package/scss/shared/_table.scss +4 -1
- package/scss/shared/layout.scss +2 -2
- package/scss/themes/_index.scss +2 -0
- package/scss/themes/_light.scss +22 -45
- package/scss/themes/_spacing.scss +44 -0
- package/scss/themes/_typography.scss +62 -0
- package/src/components/animated-button/README.md +1 -1
- package/src/components/button/button.component.ts +27 -5
- package/src/components/button/button.scss +86 -30
- package/src/components/button-menu/button-menu.component.ts +22 -9
- package/src/components/button-menu/button-menu.scss +1 -2
- package/src/components/button-menu/button-menu.test.ts +18 -0
- package/src/components/chat-message/chat-message.component.ts +73 -0
- package/src/components/chat-message/chat-message.scss +60 -0
- package/src/components/chat-message/index.ts +12 -0
- package/src/components/checkbox/checkbox.scss +2 -2
- package/src/components/chip/chip.component.ts +0 -5
- package/src/components/chip/chip.scss +14 -35
- package/src/components/content-block/content-block.component.ts +46 -45
- package/src/components/content-block/content-block.scss +58 -27
- package/src/components/data-table/data-table.scss +10 -7
- package/src/components/data-table-sort/data-table-sort.scss +1 -1
- package/src/components/dialog/dialog.component.ts +3 -3
- package/src/components/dialog/dialog.scss +2 -2
- package/src/components/dropdown/dropdown.component.ts +1 -0
- package/src/components/editor/editor.component.ts +3 -1
- package/src/components/editor/editor.scss +9 -2
- package/src/components/editor/modules/ai/panel/ai-panel.scss +2 -2
- package/src/components/editor/modules/ai/tooltip/ai-tooltip.scss +1 -1
- package/src/components/editor/modules/context-menu/context-menu.ts +20 -20
- package/src/components/editor/modules/dialog/dialog.component.ts +3 -4
- package/src/components/editor/modules/dialog/dialog.scss +2 -1
- package/src/components/editor/modules/dialog/dialog.ts +12 -8
- package/src/components/editor/modules/toolbar/tool/tool.component.ts +1 -5
- package/src/components/editor/modules/toolbar/toolbar.component.ts +54 -50
- package/src/components/editor/modules/toolbar/toolbar.scss +4 -29
- package/src/components/editor/modules/toolbar/toolbar.ts +15 -17
- package/src/components/expanding-action/expanding-action.component.ts +14 -7
- package/src/components/expanding-action/expanding-action.scss +44 -2
- package/src/components/file/file.scss +2 -2
- package/src/components/header/header.component.ts +1 -1
- package/src/components/header/header.scss +3 -3
- package/src/components/hover-container/hover-container.scss +1 -1
- package/src/components/icon/icon.component.ts +6 -1
- package/src/components/icon/icon.scss +31 -0
- package/src/components/icon-picker/icon-picker.scss +3 -3
- package/src/components/input/input.scss +3 -3
- package/src/components/input-group/input-group.scss +16 -16
- package/src/components/markdown-editor/markdown-editor.scss +2 -2
- package/src/components/menu/menu.component.ts +32 -1
- package/src/components/menu/menu.scss +28 -5
- package/src/components/menu-item/menu-item.component.ts +6 -2
- package/src/components/menu-item/menu-item.scss +49 -5
- package/src/components/navbar/navbar.component.ts +7 -4
- package/src/components/navbar/navbar.scss +93 -21
- package/src/components/page/page.component.ts +1 -1
- package/src/components/page/page.scss +7 -26
- package/src/components/panel/panel.scss +5 -8
- package/src/components/priority-list/priority-list.scss +1 -1
- package/src/components/rating/rating.scss +1 -1
- package/src/components/scroll-container/scroll-container.scss +2 -1
- package/src/components/select/select.scss +1 -1
- package/src/components/settings-container/settings-container.scss +2 -2
- package/src/components/stat/stat.scss +8 -5
- package/src/components/tile/tile.component.ts +10 -2
- package/src/components/tile/tile.scss +108 -67
- package/src/components/tile-group/index.ts +12 -0
- package/src/components/tile-group/tile-group.component.ts +66 -0
- package/src/components/tile-group/tile-group.scss +23 -0
- package/src/form-control.scss +2 -1
- package/src/wc.scss +1 -0
- package/src/zinc.ts +2 -0
- package/src/components/editor/modules/toolbar/tool/tool.scss +0 -5
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
@use "../../wc";
|
|
2
2
|
@use "./lni";
|
|
3
3
|
|
|
4
|
+
$icon-colors: (
|
|
5
|
+
default: --zn-text,
|
|
6
|
+
primary: --zn-primary,
|
|
7
|
+
accent: --zn-accent,
|
|
8
|
+
info: --zn-color-info,
|
|
9
|
+
warning: --zn-color-warning,
|
|
10
|
+
error: --zn-color-error,
|
|
11
|
+
success: --zn-color-success,
|
|
12
|
+
white: --zn-body,
|
|
13
|
+
disabled: --zn-color-disabled,
|
|
14
|
+
red: --zn-red,
|
|
15
|
+
blue: --zn-blue,
|
|
16
|
+
green: --zn-green,
|
|
17
|
+
orange: --zn-orange,
|
|
18
|
+
yellow: --zn-yellow,
|
|
19
|
+
indigo: --zn-indigo,
|
|
20
|
+
violet: --zn-violet,
|
|
21
|
+
pink: --zn-pink,
|
|
22
|
+
grey: --zn-grey,
|
|
23
|
+
);
|
|
24
|
+
|
|
4
25
|
:host {
|
|
5
26
|
display: inline-block;
|
|
6
27
|
box-sizing: content-box !important;
|
|
@@ -115,6 +136,16 @@
|
|
|
115
136
|
--icon-color: rgb(var(--zn-grey));
|
|
116
137
|
}
|
|
117
138
|
|
|
139
|
+
&--filled .lucide {
|
|
140
|
+
fill: var(--icon-fill, currentColor);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@each $name, $token in $icon-colors {
|
|
144
|
+
&--fill-#{$name} {
|
|
145
|
+
--icon-fill: rgb(var(#{$token}));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
118
149
|
&--round {
|
|
119
150
|
border-radius: 50%;
|
|
120
151
|
}
|
|
@@ -136,7 +136,7 @@ zn-dialog {
|
|
|
136
136
|
overflow-y: auto;
|
|
137
137
|
align-content: flex-start;
|
|
138
138
|
border: solid 1px rgb(var(--zn-border-color));
|
|
139
|
-
border-radius: var(--zn-border-radius
|
|
139
|
+
border-radius: var(--zn-border-radius);
|
|
140
140
|
padding: var(--zn-spacing-x-small);
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -148,7 +148,7 @@ zn-dialog {
|
|
|
148
148
|
height: 48px;
|
|
149
149
|
padding: 0;
|
|
150
150
|
border: 2px solid transparent;
|
|
151
|
-
border-radius: var(--zn-border-radius
|
|
151
|
+
border-radius: var(--zn-border-radius);
|
|
152
152
|
background: transparent;
|
|
153
153
|
color: rgb(var(--zn-text-color));
|
|
154
154
|
cursor: pointer;
|
|
@@ -179,7 +179,7 @@ zn-dialog {
|
|
|
179
179
|
gap: var(--zn-spacing-small);
|
|
180
180
|
padding: var(--zn-spacing-medium);
|
|
181
181
|
background-color: rgba(var(--zn-panel-secondary), 0.5);
|
|
182
|
-
border-radius: var(--zn-border-radius
|
|
182
|
+
border-radius: var(--zn-border-radius);
|
|
183
183
|
text-align: center;
|
|
184
184
|
|
|
185
185
|
&--empty {
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
margin: 0;
|
|
92
92
|
cursor: inherit;
|
|
93
93
|
-webkit-appearance: none;
|
|
94
|
-
line-height:
|
|
94
|
+
line-height: var(--zn-input-line-height);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/* Color input text should use monospace font */
|
|
@@ -391,7 +391,7 @@ input[type='date']::-webkit-calendar-picker-indicator {
|
|
|
391
391
|
justify-content: center;
|
|
392
392
|
width: 1.75rem;
|
|
393
393
|
height: 1.75rem;
|
|
394
|
-
border-radius: var(--zn-border-radius
|
|
394
|
+
border-radius: var(--zn-border-radius);
|
|
395
395
|
border: solid 1px rgba(0, 0, 0, 0.15);
|
|
396
396
|
background-color: var(--zn-color-neutral-0);
|
|
397
397
|
cursor: pointer;
|
|
@@ -427,7 +427,7 @@ input[type='date']::-webkit-calendar-picker-indicator {
|
|
|
427
427
|
.input__color-swatch-inner {
|
|
428
428
|
width: 100%;
|
|
429
429
|
height: 100%;
|
|
430
|
-
border-radius: calc(var(--zn-border-radius
|
|
430
|
+
border-radius: calc(var(--zn-border-radius) - 2px);
|
|
431
431
|
background-color: var(--color-value, #000000);
|
|
432
432
|
}
|
|
433
433
|
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
.input-group--gap ::slotted([data-zn-input-group__input--first]),
|
|
35
35
|
.input-group--gap ::slotted([data-zn-input-group__input--inner]),
|
|
36
36
|
.input-group--gap ::slotted([data-zn-input-group__input--last]) {
|
|
37
|
-
--zn-input-border-radius-x-small: var(--zn-border-radius
|
|
38
|
-
--zn-input-border-radius-small: var(--zn-border-radius
|
|
39
|
-
--zn-input-border-radius-medium: var(--zn-border-radius
|
|
40
|
-
--zn-input-border-radius-large: var(--zn-border-radius
|
|
37
|
+
--zn-input-border-radius-x-small: var(--zn-border-radius);
|
|
38
|
+
--zn-input-border-radius-small: var(--zn-border-radius);
|
|
39
|
+
--zn-input-border-radius-medium: var(--zn-border-radius);
|
|
40
|
+
--zn-input-border-radius-large: var(--zn-border-radius);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/* Common styles for slotted inputs */
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
::slotted([data-zn-input-group__input--first]) {
|
|
68
|
-
--zn-input-border-radius-x-small: var(--zn-border-radius
|
|
69
|
-
--zn-input-border-radius-small: var(--zn-border-radius
|
|
70
|
-
--zn-input-border-radius-medium: var(--zn-border-radius
|
|
71
|
-
--zn-input-border-radius-large: var(--zn-border-radius
|
|
68
|
+
--zn-input-border-radius-x-small: var(--zn-border-radius) 0 0 var(--zn-border-radius);
|
|
69
|
+
--zn-input-border-radius-small: var(--zn-border-radius) 0 0 var(--zn-border-radius);
|
|
70
|
+
--zn-input-border-radius-medium: var(--zn-border-radius) 0 0 var(--zn-border-radius);
|
|
71
|
+
--zn-input-border-radius-large: var(--zn-border-radius) 0 0 var(--zn-border-radius);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
::slotted([data-zn-input-group__input--inner]) {
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
::slotted([data-zn-input-group__input--last]) {
|
|
82
|
-
--zn-input-border-radius-x-small: 0 var(--zn-border-radius
|
|
83
|
-
--zn-input-border-radius-small: 0 var(--zn-border-radius
|
|
84
|
-
--zn-input-border-radius-medium: 0 var(--zn-border-radius
|
|
85
|
-
--zn-input-border-radius-large: 0 var(--zn-border-radius
|
|
82
|
+
--zn-input-border-radius-x-small: 0 var(--zn-border-radius) var(--zn-border-radius) 0;
|
|
83
|
+
--zn-input-border-radius-small: 0 var(--zn-border-radius) var(--zn-border-radius) 0;
|
|
84
|
+
--zn-input-border-radius-medium: 0 var(--zn-border-radius) var(--zn-border-radius) 0;
|
|
85
|
+
--zn-input-border-radius-large: 0 var(--zn-border-radius) var(--zn-border-radius) 0;
|
|
86
86
|
|
|
87
87
|
margin-inline-end: 0;
|
|
88
88
|
}
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
::slotted(zn-button[data-zn-input-group__input--first]),
|
|
98
98
|
::slotted(zn-button[data-zn-input-group__input--inner]),
|
|
99
99
|
::slotted(zn-button[data-zn-input-group__input--last]) {
|
|
100
|
-
--zn-input-border-radius-x-small: var(--zn-border-radius
|
|
101
|
-
--zn-input-border-radius-small: var(--zn-border-radius
|
|
102
|
-
--zn-input-border-radius-medium: var(--zn-border-radius
|
|
103
|
-
--zn-input-border-radius-large: var(--zn-border-radius
|
|
100
|
+
--zn-input-border-radius-x-small: var(--zn-border-radius);
|
|
101
|
+
--zn-input-border-radius-small: var(--zn-border-radius);
|
|
102
|
+
--zn-input-border-radius-medium: var(--zn-border-radius);
|
|
103
|
+
--zn-input-border-radius-large: var(--zn-border-radius);
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
.panel {
|
|
4
4
|
border: 1px solid rgb(var(--zn-border-color));
|
|
5
5
|
background-color: rgba(var(--zn-panel), var(--zn-panel-opacity));
|
|
6
|
-
border-radius: var(--zn-border-radius
|
|
6
|
+
border-radius: var(--zn-border-radius);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.markdown-editor {
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
flex: 1;
|
|
109
109
|
background: var(--zn-color-neutral-0, white);
|
|
110
110
|
border: 1px solid var(--zn-color-neutral-200);
|
|
111
|
-
border-radius: var(--zn-border-radius
|
|
111
|
+
border-radius: var(--zn-border-radius);
|
|
112
112
|
padding: var(--zn-spacing-x-large);
|
|
113
113
|
overflow-y: auto;
|
|
114
114
|
font-family: inherit;
|
|
@@ -58,6 +58,11 @@ export default class ZnMenu extends ZincElement {
|
|
|
58
58
|
|
|
59
59
|
@property({attribute: 'actions', type: Array}) actions = [];
|
|
60
60
|
|
|
61
|
+
/** The menu's visual style. `shell` renders the app-shell header dropdown
|
|
62
|
+
* look: a padded panel with floating rounded items. Propagated to the
|
|
63
|
+
* menu's items. */
|
|
64
|
+
@property({reflect: true}) variant: 'default' | 'shell' = 'default';
|
|
65
|
+
|
|
61
66
|
connectedCallback() {
|
|
62
67
|
super.connectedCallback();
|
|
63
68
|
this.setAttribute('role', 'menu');
|
|
@@ -113,6 +118,7 @@ export default class ZnMenu extends ZincElement {
|
|
|
113
118
|
<zn-menu-item @mousedown=${this.handleMouseDown}
|
|
114
119
|
@keydown=${this.handleKeyDown}
|
|
115
120
|
id="${item.confirm?.trigger}"
|
|
121
|
+
variant="${this.itemVariant}"
|
|
116
122
|
confirm>
|
|
117
123
|
${(item.icon) ? html`
|
|
118
124
|
<zn-icon src="${item.icon}" size="20" slot="prefix"></zn-icon>` : html``}
|
|
@@ -123,6 +129,7 @@ export default class ZnMenu extends ZincElement {
|
|
|
123
129
|
return html`
|
|
124
130
|
<zn-menu-item value="${item.title}"
|
|
125
131
|
href="${item.path}"
|
|
132
|
+
variant="${this.itemVariant}"
|
|
126
133
|
data-target="${ifDefined(item.target)}">
|
|
127
134
|
${(item.icon) ? html`
|
|
128
135
|
<zn-icon src="${item.icon}" size="20" slot="prefix"></zn-icon>` : html``}
|
|
@@ -133,7 +140,7 @@ export default class ZnMenu extends ZincElement {
|
|
|
133
140
|
</zn-menu-item>`;
|
|
134
141
|
} else {
|
|
135
142
|
return html`
|
|
136
|
-
<zn-menu-item value="${item.title}" data-path="${ifDefined(item.path)}">
|
|
143
|
+
<zn-menu-item value="${item.title}" variant="${this.itemVariant}" data-path="${ifDefined(item.path)}">
|
|
137
144
|
${(item.icon) ? html`
|
|
138
145
|
<zn-icon src="${item.icon}" size="20" slot="prefix"></zn-icon>` : html``}
|
|
139
146
|
<span @click="${this.handleClick}"
|
|
@@ -233,6 +240,30 @@ export default class ZnMenu extends ZincElement {
|
|
|
233
240
|
this.setCurrentItem(items[0]);
|
|
234
241
|
this.emit('zn-menu-ready');
|
|
235
242
|
}
|
|
243
|
+
|
|
244
|
+
this.propagateVariant();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
protected updated(changedProperties: Map<string, unknown>) {
|
|
248
|
+
super.updated(changedProperties);
|
|
249
|
+
|
|
250
|
+
if (changedProperties.has('variant')) {
|
|
251
|
+
this.propagateVariant();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* @internal The variant applied to slotted items. A `default` menu still gives
|
|
257
|
+
* its items the `dropdown` look (muted hover, no separators) — distinct from a
|
|
258
|
+
* bare standalone menu item, which keeps the navigation styling.
|
|
259
|
+
*/
|
|
260
|
+
get itemVariant(): 'dropdown' | 'shell' {
|
|
261
|
+
return this.variant === 'shell' ? 'shell' : 'dropdown';
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** Keeps slotted menu items in sync with the menu's variant. */
|
|
265
|
+
private propagateVariant() {
|
|
266
|
+
this.getAllItems().forEach(item => item.setAttribute('variant', this.itemVariant));
|
|
236
267
|
}
|
|
237
268
|
|
|
238
269
|
private isMenuItem(item: HTMLElement) {
|
|
@@ -3,12 +3,35 @@
|
|
|
3
3
|
:host {
|
|
4
4
|
display: block;
|
|
5
5
|
position: relative;
|
|
6
|
-
|
|
7
|
-
border
|
|
6
|
+
padding: 1px;
|
|
7
|
+
border: 1px solid rgb(var(--zn-border-color));
|
|
8
|
+
border-radius: var(--zn-border-radius);
|
|
8
9
|
width: fit-content;
|
|
9
|
-
min-width: var(--zn-
|
|
10
|
+
min-width: var(--zn-size-spanel);
|
|
10
11
|
overflow: auto;
|
|
11
12
|
overscroll-behavior: none;
|
|
12
|
-
box-shadow:
|
|
13
|
-
background-color: rgb(var(--zn-
|
|
13
|
+
box-shadow: 0 4px 8px -4px rgba(33, 33, 33, 0.1);
|
|
14
|
+
background-color: rgb(var(--zn-panel));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Dropdown vs shell hover/row styling lives on zn-menu-item, keyed by the
|
|
18
|
+
// `variant` the menu sets on its items (see menu.component.ts).
|
|
19
|
+
|
|
20
|
+
// Shell variant — the app-shell header dropdown look (as used by Rubix):
|
|
21
|
+
// padded panel with floating rounded items, translucent blurred background
|
|
22
|
+
:host([variant="shell"]) {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
gap: var(--zn-spacing-x-small);
|
|
26
|
+
padding: var(--zn-spacing-x-small);
|
|
27
|
+
border: 1px solid rgb(var(--zn-border-color));
|
|
28
|
+
border-radius: var(--zn-border-radius);
|
|
29
|
+
min-width: 245px;
|
|
30
|
+
max-width: min(320px, calc(100vw - 16px));
|
|
31
|
+
overflow-x: hidden;
|
|
32
|
+
overflow-y: auto;
|
|
33
|
+
box-shadow: none;
|
|
34
|
+
filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.04)) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.1));
|
|
35
|
+
background-color: rgba(var(--zn-color-navigation, 255, 255, 255), 0.95);
|
|
36
|
+
backdrop-filter: blur(3px);
|
|
14
37
|
}
|
|
@@ -47,6 +47,10 @@ export default class ZnMenuItem extends ZincElement {
|
|
|
47
47
|
/** The type of menu item to render. To use `checked`, this value must be set to `checkbox`. */
|
|
48
48
|
@property() type: 'normal' | 'checkbox' = 'normal';
|
|
49
49
|
|
|
50
|
+
/** The item's visual style. A standalone item defaults to navigation styling;
|
|
51
|
+
* a parent zn-menu sets this to `dropdown` or `shell` automatically. */
|
|
52
|
+
@property({reflect: true}) variant: 'default' | 'dropdown' | 'shell' = 'default';
|
|
53
|
+
|
|
50
54
|
/** Draws the item in a checked state. */
|
|
51
55
|
@property({type: Boolean, reflect: true}) checked = false;
|
|
52
56
|
|
|
@@ -235,7 +239,7 @@ export default class ZnMenuItem extends ZincElement {
|
|
|
235
239
|
?aria-expanded="${isSubmenuExpanded}">
|
|
236
240
|
${this.checkedPosition === 'left' ? html`
|
|
237
241
|
<span part="checked-icon" class="menu-item__check">
|
|
238
|
-
<zn-icon src="
|
|
242
|
+
<zn-icon src="check@lu" size="18" aria-hidden="true"></zn-icon>
|
|
239
243
|
</span>` : ''}
|
|
240
244
|
|
|
241
245
|
<slot name="prefix" part="prefix" class="menu-item__prefix"></slot>
|
|
@@ -246,7 +250,7 @@ export default class ZnMenuItem extends ZincElement {
|
|
|
246
250
|
|
|
247
251
|
${this.checkedPosition === 'right' ? html`
|
|
248
252
|
<span part="checked-icon" class="menu-item__check">
|
|
249
|
-
<zn-icon src="
|
|
253
|
+
<zn-icon src="check@lu" size="18" aria-hidden="true"></zn-icon>
|
|
250
254
|
</span>` : ''}
|
|
251
255
|
|
|
252
256
|
<span part="submenu-icon" class="menu-item__chevron">
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
@use "../../wc";
|
|
2
2
|
|
|
3
3
|
:host {
|
|
4
|
+
// Baseline — standalone items (e.g. app/sidebar navigation): primary hover
|
|
4
5
|
--submenu-offset: -2px;
|
|
5
|
-
--color:
|
|
6
|
+
--color: var(--zn-text-menu-link-color);
|
|
6
7
|
--hover-color: rgb(var(--zn-primary));
|
|
7
8
|
--hover-bg: rgba(var(--zn-color-navigation-highlight), var(--zn-panel-highlight-opacity));
|
|
9
|
+
--active-color: rgb(var(--zn-primary));
|
|
8
10
|
display: block;
|
|
9
11
|
}
|
|
10
12
|
|
|
13
|
+
// Dropdown — items inside a default zn-menu panel: muted hover (the text keeps
|
|
14
|
+
// its colour), no separators between rows. Set by the parent zn-menu.
|
|
15
|
+
:host([variant="dropdown"]) {
|
|
16
|
+
--hover-color: var(--color);
|
|
17
|
+
--hover-bg: rgba(0, 0, 0, 0.06);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Shell — app-shell header dropdown look: dark text, primary hover. Set by the
|
|
21
|
+
// parent zn-menu's `variant="shell"`.
|
|
22
|
+
:host([variant="shell"]) {
|
|
23
|
+
--color: rgb(var(--zn-text));
|
|
24
|
+
--hover-color: rgb(var(--zn-primary));
|
|
25
|
+
--hover-bg: rgba(var(--zn-primary), 0.05);
|
|
26
|
+
}
|
|
27
|
+
|
|
11
28
|
:host([inert]) {
|
|
12
29
|
display: none;
|
|
13
30
|
}
|
|
@@ -25,9 +42,27 @@
|
|
|
25
42
|
border-bottom-width: 1px;
|
|
26
43
|
width: 100%;
|
|
27
44
|
text-decoration: none;
|
|
45
|
+
font-size: var(--zn-text-menu-link-font-size);
|
|
46
|
+
line-height: var(--zn-text-menu-link-line-height);
|
|
47
|
+
font-weight: var(--zn-text-menu-link-font-weight);
|
|
28
48
|
color: var(--color);
|
|
29
49
|
}
|
|
30
50
|
|
|
51
|
+
:host([variant="dropdown"]) .menu-item {
|
|
52
|
+
align-items: center;
|
|
53
|
+
padding: var(--zn-spacing-small) var(--zn-spacing-large);
|
|
54
|
+
border-bottom-width: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([variant="shell"]) .menu-item {
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: var(--zn-spacing-x-small);
|
|
60
|
+
padding: var(--zn-spacing-x-small);
|
|
61
|
+
border-bottom-width: 0;
|
|
62
|
+
border-radius: var(--zn-border-radius);
|
|
63
|
+
line-height: 25px;
|
|
64
|
+
}
|
|
65
|
+
|
|
31
66
|
.menu-item__label::slotted(*) {
|
|
32
67
|
text-decoration: none;
|
|
33
68
|
color: inherit;
|
|
@@ -72,12 +107,12 @@
|
|
|
72
107
|
top: 0;
|
|
73
108
|
bottom: 0;
|
|
74
109
|
width: 3px;
|
|
75
|
-
background-color: var(--
|
|
110
|
+
background-color: var(--active-color);
|
|
76
111
|
}
|
|
77
112
|
|
|
78
113
|
.menu-item.menu-item--active .menu-item__label {
|
|
79
114
|
font-weight: 700;
|
|
80
|
-
color: var(--
|
|
115
|
+
color: var(--active-color);
|
|
81
116
|
}
|
|
82
117
|
|
|
83
118
|
.menu-item--rtl.menu-item--active::before {
|
|
@@ -134,6 +169,11 @@
|
|
|
134
169
|
margin-inline-end: var(--zn-spacing-small);
|
|
135
170
|
}
|
|
136
171
|
|
|
172
|
+
// Shell items space the icon via the row gap instead
|
|
173
|
+
:host([variant="shell"]) .menu-item .menu-item__prefix::slotted(*) {
|
|
174
|
+
margin-inline-end: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
137
177
|
.menu-item .menu-item__suffix {
|
|
138
178
|
flex: 0 0 auto;
|
|
139
179
|
display: flex;
|
|
@@ -165,12 +205,16 @@
|
|
|
165
205
|
}
|
|
166
206
|
|
|
167
207
|
:host(:hover:not([aria-disabled='true'], :focus-visible)) .menu-item,
|
|
168
|
-
.menu-item--submenu-expanded
|
|
169
|
-
.menu-item--active {
|
|
208
|
+
.menu-item--submenu-expanded {
|
|
170
209
|
background-color: var(--hover-bg);
|
|
171
210
|
color: var(--hover-color);
|
|
172
211
|
}
|
|
173
212
|
|
|
213
|
+
.menu-item--active {
|
|
214
|
+
background-color: var(--hover-bg);
|
|
215
|
+
color: var(--active-color);
|
|
216
|
+
}
|
|
217
|
+
|
|
174
218
|
:host(:focus-visible) .menu-item {
|
|
175
219
|
outline: none;
|
|
176
220
|
background-color: var(--hover-bg);
|
|
@@ -49,11 +49,13 @@ export default class ZnNavbar extends ZincElement {
|
|
|
49
49
|
@property({attribute: 'border', type: Boolean, reflect: true}) border: boolean;
|
|
50
50
|
@property({attribute: 'hide-one', type: Boolean, reflect: true}) hideOne: boolean;
|
|
51
51
|
@property({attribute: 'flush', type: Boolean, reflect: true}) flush: boolean = false;
|
|
52
|
+
@property({attribute: 'gutter', type: Boolean, reflect: true}) gutter: boolean = false;
|
|
52
53
|
@property({type: Boolean}) stacked: boolean;
|
|
53
54
|
@property({type: Array}) dropdown = [];
|
|
54
55
|
@property({attribute: "no-pad", type: Boolean}) noPad: false
|
|
55
56
|
@property({attribute: 'manual-add-items', type: Boolean}) manualAddItems = false;
|
|
56
57
|
@property({type: Boolean}) isolated = false;
|
|
58
|
+
@property({reflect: true}) color: string;
|
|
57
59
|
|
|
58
60
|
@property({attribute: 'master-id', reflect: true}) masterId: string;
|
|
59
61
|
@property({attribute: 'store-key', type: String}) storeKey: string = '';
|
|
@@ -541,14 +543,15 @@ export default class ZnNavbar extends ZincElement {
|
|
|
541
543
|
'navbar--flush': this.flush,
|
|
542
544
|
'navbar--no-pad': this.noPad,
|
|
543
545
|
'navbar--stacked': this.stacked,
|
|
544
|
-
'navbar--icon-bar': this.iconBar
|
|
546
|
+
'navbar--icon-bar': this.iconBar,
|
|
547
|
+
[`navbar--color-${this.color}`]: Boolean(this.color)
|
|
545
548
|
})}">
|
|
546
549
|
${this._preItems}
|
|
547
550
|
${this.navigation.map((item: any) => {
|
|
548
551
|
let content = html`${item.title}`;
|
|
549
552
|
if (item.icon != undefined && item.icon != '') {
|
|
550
553
|
content = html`
|
|
551
|
-
<zn-icon src="${item.icon}"></zn-icon>${content}`;
|
|
554
|
+
<zn-icon src="${item.icon}" size="20"></zn-icon>${content}`;
|
|
552
555
|
}
|
|
553
556
|
if (item.path != undefined) {
|
|
554
557
|
return html`
|
|
@@ -564,9 +567,9 @@ export default class ZnNavbar extends ZincElement {
|
|
|
564
567
|
</li>`;
|
|
565
568
|
})}
|
|
566
569
|
<li class="more">
|
|
567
|
-
<zn-dropdown placement="bottom-end" id="extended-dropdown">
|
|
570
|
+
<zn-dropdown placement="bottom-end" id="extended-dropdown" distance="1">
|
|
568
571
|
<zn-button slot="trigger" text color="transparent">
|
|
569
|
-
<zn-icon src="arrow_right_alt" size="
|
|
572
|
+
<zn-icon src="arrow_right_alt" size="20"></zn-icon>
|
|
570
573
|
</zn-button>
|
|
571
574
|
<ul id="extended-menu">
|
|
572
575
|
</ul>
|