@kubex/zinc 1.0.4 → 1.0.5

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.
Files changed (153) hide show
  1. package/dist/custom-elements.json +1034 -111
  2. package/dist/vscode.html-custom-data.json +85 -15
  3. package/dist/web-types.json +215 -24
  4. package/dist/zn.d.ts +1234 -888
  5. package/dist/zn.min.css +1 -1
  6. package/dist/zn.min.js +1979 -940
  7. package/docs/_includes/default.njk +1 -0
  8. package/docs/assets/scripts/docs.js +4 -5
  9. package/docs/assets/scripts/search.js +0 -9
  10. package/docs/assets/styles/docs.css +3 -3
  11. package/docs/data/data-table.json +79 -0
  12. package/docs/data/products-table.json +36 -0
  13. package/docs/eleventy.config.cjs +3 -0
  14. package/docs/pages/components/data-select.md +10 -0
  15. package/docs/pages/components/data-table.md +84 -45
  16. package/docs/pages/components/dialog.md +1 -1
  17. package/docs/pages/components/editor.md +1 -3
  18. package/docs/pages/components/filter-wrapper.md +20 -0
  19. package/docs/pages/components/icon.md +2 -0
  20. package/docs/pages/components/item.md +2 -2
  21. package/docs/pages/components/menu-item.md +12 -3
  22. package/docs/pages/components/panel.md +17 -0
  23. package/docs/pages/components/progress-tile.md +17 -1
  24. package/docs/pages/components/settings-container.md +137 -0
  25. package/docs/pages/components/textarea.md +1 -1
  26. package/package.json +3 -1
  27. package/scss/_root.scss +26 -0
  28. package/scss/boot.scss +27 -1
  29. package/scss/mixins/index.scss +30 -1
  30. package/scss/shared/_base.scss +1 -1
  31. package/scss/shared/_button.scss +1 -1
  32. package/scss/shared/layout.scss +7 -0
  33. package/scss/themes/_dark.scss +5 -5
  34. package/scss/themes/_light.scss +6 -5
  35. package/scss/variables/index.scss +9 -0
  36. package/src/components/alert/alert.component.ts +1 -1
  37. package/src/components/alert/alert.scss +18 -4
  38. package/src/components/button/button.component.ts +6 -2
  39. package/src/components/button/button.scss +16 -1
  40. package/src/components/button-menu/button-menu.component.ts +23 -15
  41. package/src/components/button-menu/button-menu.scss +4 -4
  42. package/src/components/checkbox/checkbox.component.ts +5 -1
  43. package/src/components/checkbox/checkbox.scss +1 -1
  44. package/src/components/chip/chip.component.ts +7 -3
  45. package/src/components/chip/chip.scss +9 -1
  46. package/src/components/collapsible/collapsible.component.ts +48 -2
  47. package/src/components/confirm/confirm.component.ts +1 -2
  48. package/src/components/content-block/content-block.component.ts +25 -1
  49. package/src/components/content-block/content-block.scss +8 -0
  50. package/src/components/data-select/data-select.component.ts +1 -1
  51. package/src/components/data-table/data-table.component.ts +361 -422
  52. package/src/components/data-table/data-table.scss +6 -1
  53. package/src/components/datepicker/datepicker.scss +1 -1
  54. package/src/components/dialog/dialog.component.ts +52 -33
  55. package/src/components/dialog/dialog.scss +15 -1
  56. package/src/components/dropdown/dropdown.component.ts +1 -1
  57. package/src/components/editor/editor.component.ts +196 -158
  58. package/src/components/editor/editor.scss +25 -5
  59. package/src/components/editor/modules/ai/index.ts +281 -0
  60. package/src/components/editor/modules/ai/panel/ai-panel.component.ts +102 -0
  61. package/src/components/editor/modules/ai/panel/ai-panel.scss +83 -0
  62. package/src/components/editor/modules/ai/tooltip/ai-tooltip.component.ts +30 -0
  63. package/src/components/editor/modules/ai/tooltip/ai-tooltip.scss +28 -0
  64. package/src/components/editor/modules/{attachment-module.ts → attachment/attachment.ts} +7 -7
  65. package/src/components/editor/modules/context-menu/context-menu-component.ts +115 -0
  66. package/src/components/editor/modules/context-menu/context-menu.scss +49 -0
  67. package/src/components/editor/modules/context-menu/context-menu.ts +296 -0
  68. package/src/components/editor/modules/context-menu/quick-action/index.ts +12 -0
  69. package/src/components/editor/modules/context-menu/quick-action/quick-action.component.ts +18 -0
  70. package/src/components/editor/modules/date-picker/date-picker.ts +77 -0
  71. package/src/components/editor/modules/dialog/dialog.component.ts +115 -0
  72. package/src/components/editor/modules/dialog/dialog.scss +43 -0
  73. package/src/components/editor/modules/dialog/dialog.ts +46 -0
  74. package/src/components/editor/modules/{drag-drop-module.ts → drag-drop/drag-drop.ts} +6 -6
  75. package/src/components/editor/modules/emoji/emoji.ts +106 -0
  76. package/src/components/editor/modules/emoji/headless/headless-emoji.component.ts +122 -0
  77. package/src/components/editor/modules/emoji/headless/headless-emoji.scss +52 -0
  78. package/src/components/editor/modules/emoji/headless/headless-emoji.ts +223 -0
  79. package/src/components/editor/modules/{image-resize-module/image-resize-module.ts → image-resize/image-resize.ts} +5 -5
  80. package/src/components/editor/modules/{time-tracking-module.ts → time-tracking/time-tracking.ts} +5 -5
  81. package/src/components/editor/modules/toolbar/tool/index.ts +12 -0
  82. package/src/components/editor/modules/toolbar/tool/tool.component.ts +30 -0
  83. package/src/components/editor/modules/toolbar/tool/tool.scss +5 -0
  84. package/src/components/editor/modules/toolbar/toolbar.component.ts +738 -0
  85. package/src/components/editor/modules/toolbar/toolbar.scss +98 -0
  86. package/src/components/editor/modules/toolbar/toolbar.ts +328 -0
  87. package/src/components/expanding-action/expanding-action.component.ts +2 -2
  88. package/src/components/expanding-action/expanding-action.scss +2 -2
  89. package/src/components/filter-wrapper/filter-wrapper.component.ts +91 -0
  90. package/src/components/filter-wrapper/filter-wrapper.scss +11 -0
  91. package/src/components/filter-wrapper/filter-wrapper.test.ts +10 -0
  92. package/src/components/filter-wrapper/index.ts +12 -0
  93. package/src/components/header/header.component.ts +1 -1
  94. package/src/components/header/header.scss +8 -1
  95. package/src/components/hover-container/hover-container.scss +39 -36
  96. package/src/components/icon/icon.component.ts +11 -5
  97. package/src/components/icon/icon.scss +15 -2
  98. package/src/components/inline-edit/inline-edit.component.ts +28 -3
  99. package/src/components/inline-edit/inline-edit.scss +4 -1
  100. package/src/components/input/input.scss +1 -1
  101. package/src/components/item/item.component.ts +30 -19
  102. package/src/components/item/item.scss +56 -14
  103. package/src/components/linked-select/linked-select.component.ts +5 -1
  104. package/src/components/menu/menu.component.ts +1 -0
  105. package/src/components/menu/menu.scss +1 -1
  106. package/src/components/menu-item/menu-item.component.ts +22 -4
  107. package/src/components/menu-item/menu-item.scss +54 -7
  108. package/src/components/navbar/navbar.component.ts +7 -1
  109. package/src/components/navbar/navbar.scss +26 -16
  110. package/src/components/option/option.component.ts +4 -1
  111. package/src/components/option/option.scss +9 -0
  112. package/src/components/page-nav/page-nav.component.ts +2 -2
  113. package/src/components/page-nav/page-nav.scss +4 -4
  114. package/src/components/panel/panel.component.ts +20 -9
  115. package/src/components/panel/panel.scss +5 -1
  116. package/src/components/popup/popup.component.ts +16 -2
  117. package/src/components/progress-tile/progress-tile.component.ts +10 -4
  118. package/src/components/progress-tile/progress-tile.scss +7 -4
  119. package/src/components/query-builder/query-builder.component.ts +1 -1
  120. package/src/components/radio/radio.scss +1 -1
  121. package/src/components/scroll-container/scroll-container.component.ts +56 -9
  122. package/src/components/scroll-container/scroll-container.scss +37 -2
  123. package/src/components/select/select.component.ts +3 -0
  124. package/src/components/select/select.scss +1 -1
  125. package/src/components/settings-container/index.ts +12 -0
  126. package/src/components/settings-container/settings-container.component.ts +226 -0
  127. package/src/components/settings-container/settings-container.scss +92 -0
  128. package/src/components/settings-container/settings-container.test.ts +10 -0
  129. package/src/components/skeleton/skeleton.scss +5 -4
  130. package/src/components/sp/sp.component.ts +2 -0
  131. package/src/components/sp/sp.scss +2 -0
  132. package/src/components/split-button/split-button.component.ts +24 -18
  133. package/src/components/split-pane/split-pane.component.ts +5 -5
  134. package/src/components/stat/stat.component.ts +5 -1
  135. package/src/components/stat/stat.scss +24 -1
  136. package/src/components/style/style.component.ts +18 -0
  137. package/src/components/tabs/tabs.component.ts +12 -1
  138. package/src/components/textarea/textarea.component.ts +3 -1
  139. package/src/components/textarea/textarea.scss +21 -2
  140. package/src/components/vertical-stepper/vertical-stepper.scss +1 -1
  141. package/src/internal/form.ts +3 -1
  142. package/src/internal/slot.ts +29 -3
  143. package/src/utilities/on.ts +7 -8
  144. package/src/utilities/query.ts +5 -1
  145. package/src/wc.scss +7 -0
  146. package/src/zinc.ts +5 -0
  147. package/src/components/editor/modules/dialog-module/dialog-module.component.ts +0 -289
  148. package/src/components/editor/modules/dialog-module/dialog-module.scss +0 -115
  149. package/src/components/editor/modules/dialog-module/dialog-module.ts +0 -99
  150. package/src/components/editor/modules/events/zn-show-canned-response-dialog.ts +0 -15
  151. package/src/components/editor/modules/menu-module/menu-module.component.ts +0 -149
  152. package/src/components/editor/modules/menu-module/menu-module.scss +0 -17
  153. package/src/components/editor/modules/menu-module/menu-module.ts +0 -203
@@ -13,47 +13,50 @@
13
13
  display: contents;
14
14
  }
15
15
 
16
- .hover-container--top::part(popup) {
17
- transform-origin: bottom;
18
- }
16
+ .hover-container {
17
+ position: relative;
19
18
 
20
- .hover-container--bottom::part(popup) {
21
- transform-origin: top;
22
- }
19
+ &--top::part(popup) {
20
+ transform-origin: bottom;
21
+ }
23
22
 
24
- .hover-container--left::part(popup) {
25
- transform-origin: right;
26
- }
23
+ &--bottom::part(popup) {
24
+ transform-origin: top;
25
+ }
27
26
 
28
- .hover-container--right::part(popup) {
29
- transform-origin: left;
30
- }
27
+ &--left::part(popup) {
28
+ transform-origin: right;
29
+ }
31
30
 
32
- slot[slot='anchor'] {
33
- cursor: pointer;
34
- }
31
+ &--right::part(popup) {
32
+ transform-origin: left;
33
+ }
35
34
 
36
- .hover-container__body {
37
- flex-direction: column;
38
- z-index: 2;
39
- background-color: var(--zn-panel-background-color);
40
- border-radius: var(--zn-border-radius-large);
41
- border: 1px solid rgb(var(--zn-border-color));
42
- box-shadow: var(--zn-shadow-x-large);
43
- width: var(--width);
44
- max-width: calc(100% - var(--zn-spacing-2x-large));
45
- max-height: calc(100% - var(--zn-spacing-2x-large));
46
-
47
- ::slotted(*) {
48
- flex: 1 1 auto;
49
- display: block;
50
- overflow: auto;
51
- -webkit-overflow-scrolling: touch;
52
- color: var(--zn-color-text-default);
53
- font-size: var(--zn-font-size-medium);
54
- font-weight: var(--zn-font-weight-normal);
55
- letter-spacing: var(--zn-tracking-normal);
56
- line-height: var(--zn-line-height-dense);
35
+ &__body {
36
+ flex-direction: column;
37
+ z-index: 2;
38
+ background-color: var(--zn-panel-background-color);
39
+ border-radius: var(--zn-border-radius-large);
40
+ border: 1px solid rgb(var(--zn-border-color));
41
+ box-shadow: var(--zn-shadow-x-large);
42
+ width: var(--width);
43
+ max-width: calc(100% - var(--zn-spacing-2x-large));
44
+ max-height: calc(100% - var(--zn-spacing-2x-large));
45
+
46
+ ::slotted(*) {
47
+ flex: 1 1 auto;
48
+ display: block;
49
+ overflow: auto;
50
+ -webkit-overflow-scrolling: touch;
51
+ color: var(--zn-color-text-default);
52
+ font-size: var(--zn-font-size-medium);
53
+ font-weight: var(--zn-font-weight-normal);
54
+ letter-spacing: var(--zn-tracking-normal);
55
+ line-height: var(--zn-line-height-dense);
56
+ }
57
57
  }
58
58
  }
59
59
 
60
+ slot[slot='anchor'] {
61
+ cursor: pointer;
62
+ }
@@ -8,7 +8,7 @@ import ZincElement from '../../internal/zinc-element';
8
8
 
9
9
  import styles from './icon.scss';
10
10
 
11
- type IconLibrary = "material" | "material-outlined" | "material-round" | "material-sharp" |
11
+ type IconLibrary = "src" | "material" | "material-outlined" | "material-round" | "material-sharp" |
12
12
  "material-two-tone" | "material-symbols-outlined" | "gravatar" | "libravatar" | "avatar" | "brands" | "line";
13
13
 
14
14
  export type IconColor =
@@ -63,6 +63,10 @@ export default class ZnIcon extends ZincElement {
63
63
 
64
64
  @property({reflect: true}) color: IconColor;
65
65
 
66
+ @property({type: Boolean}) padded: boolean = false;
67
+
68
+ @property({type: Boolean}) squared: boolean = false;
69
+
66
70
  gravatarOptions = "";
67
71
  defaultLibrary: IconLibrary = "material-symbols-outlined";
68
72
 
@@ -142,7 +146,7 @@ export default class ZnIcon extends ZincElement {
142
146
  // load the material icons font if the library is set to material
143
147
  render(html`
144
148
  <link
145
- href="https://cdn.jsdelivr.net/gh/kubex/icons@0.0.6/dist/kubex-icons.css"
149
+ href="https://cdn.jsdelivr.net/gh/kubex/icons@0.0.8/dist/kubex-icons.css"
146
150
  rel="stylesheet">
147
151
  <link
148
152
  href="https://cdn.lineicons.com/5.0/lineicons.css"
@@ -186,12 +190,14 @@ export default class ZnIcon extends ZincElement {
186
190
  'icon--violet': this.color === "violet",
187
191
  'icon--pink': this.color === "pink",
188
192
  'icon--grey': this.color === "grey",
189
- 'icon--avatar': this.library === "avatar"
193
+ 'icon--avatar': this.library === "avatar",
194
+ 'icon--padded': this.padded,
195
+ 'icon--squared': this.squared,
190
196
  })}" style="${styleMap({
191
197
  '--icon-size': this.size + "px",
192
198
  '--avatar-color': this.color ? null : (this.library === 'avatar' ? this.getColorForAvatar(this.getAvatarInitials(this.src)) : null)
193
199
  })}">
194
- ${this.library ? html`
200
+ ${this.library && this.library !== "src" ? html`
195
201
  ${choose(this.library, [
196
202
  ["material", () => html`<i part="icon" class="mi">${this.src}</i>`],
197
203
  ["material-outlined", () => html`<i part="icon" class="mi mi--outlined">${this.src}</i>`],
@@ -208,7 +214,7 @@ export default class ZnIcon extends ZincElement {
208
214
  ["avatar", () => html`<span class="avatar__text">${this.getAvatarInitials(this.src)}</span>`]
209
215
  ], () => html`Library not supported: ${this.library}`)}` : ''}
210
216
 
211
- ${!this.library && this.src ? html`
217
+ ${(!this.library || this.library === 'src') && this.src ? html`
212
218
  <img part="icon" src="${this.src}" alt="${this.alt}" class="${this.library}" height="${this.size}"
213
219
  width="${this.size}"/>` : ''}
214
220
 
@@ -1,7 +1,6 @@
1
1
  @use "../../wc";
2
2
  @use "./lni";
3
3
 
4
-
5
4
  :host {
6
5
  display: inline-block;
7
6
  box-sizing: content-box !important;
@@ -10,6 +9,10 @@
10
9
  --icon-color: inherit;
11
10
  }
12
11
 
12
+ :host([split-pane-focus]) .icon-wrapper {
13
+ cursor: pointer;
14
+ }
15
+
13
16
  .icon-wrapper {
14
17
  user-select: none;
15
18
  font-family: sans-serif;
@@ -27,7 +30,6 @@
27
30
  height: 100%;
28
31
  }
29
32
 
30
-
31
33
  .icon {
32
34
  width: var(--icon-size);
33
35
  height: var(--icon-size);
@@ -131,6 +133,17 @@
131
133
  }
132
134
  }
133
135
 
136
+ &--padded {
137
+ padding: var(--zn-spacing-small);
138
+ }
139
+
140
+ &--squared {
141
+ width: auto !important;
142
+ height: auto !important;
143
+ aspect-ratio: 1/1;
144
+ display: block;
145
+ }
146
+
134
147
  .mi {
135
148
  font-family: 'Material Icons';
136
149
  font-size: inherit;
@@ -5,9 +5,9 @@ import {FormControlController} from "../../internal/form";
5
5
  import {ifDefined} from "lit/directives/if-defined.js";
6
6
  import {property, query, state} from 'lit/decorators.js';
7
7
  import {watch} from "../../internal/watch";
8
- import type {ZincFormControl} from '../../internal/zinc-element';
9
8
  import ZincElement from '../../internal/zinc-element';
10
9
  import ZnSelect from "../select";
10
+ import type {ZincFormControl} from '../../internal/zinc-element';
11
11
  import type ZnInput from "../input";
12
12
 
13
13
  import styles from './inline-edit.scss';
@@ -103,11 +103,15 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
103
103
  connectedCallback() {
104
104
  super.connectedCallback();
105
105
  document.addEventListener('keydown', this.escKeyHandler);
106
+ document.addEventListener('keydown', this.submitKeyHandler);
107
+ document.addEventListener('click', this.mouseEventHandler);
106
108
  }
107
109
 
108
110
  disconnectedCallback() {
109
111
  super.disconnectedCallback();
110
112
  document.removeEventListener('keydown', this.escKeyHandler);
113
+ document.removeEventListener('keydown', this.submitKeyHandler);
114
+ document.removeEventListener('click', this.mouseEventHandler);
111
115
  }
112
116
 
113
117
  async firstUpdated() {
@@ -129,14 +133,33 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
129
133
  }
130
134
  }
131
135
 
136
+ mouseEventHandler = (e: MouseEvent) => {
137
+ if (this.isEditing && !this.contains(e.target as Node)) {
138
+ this.isEditing = false;
139
+ this.value = this.defaultValue;
140
+ this.input.blur();
141
+ }
142
+ };
143
+
132
144
  escKeyHandler = (e: KeyboardEvent) => {
133
145
  if (e.key === 'Escape' && this.isEditing) {
134
146
  this.isEditing = false;
135
147
  this.value = this.defaultValue;
148
+ this.input.blur();
136
149
  }
137
150
  };
138
151
 
139
- handleEditClick = () => {
152
+ submitKeyHandler = (e: KeyboardEvent) => {
153
+ if (e.key === 'Enter' && this.isEditing) {
154
+ this.isEditing = false;
155
+ this.formControlController.submit();
156
+ this.input.blur();
157
+ }
158
+ }
159
+
160
+ handleEditClick = (e: MouseEvent) => {
161
+ e.preventDefault();
162
+ e.stopPropagation();
140
163
  if (this.disabled) {
141
164
  return;
142
165
  }
@@ -235,6 +258,7 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
235
258
  name="${this.name}"
236
259
  size="${this.size}"
237
260
  value="${this.value}"
261
+ placeholder="${this.placeholder}"
238
262
  help-text="${ifDefined(this.helpText)}"
239
263
  pattern=${ifDefined(this.pattern)}
240
264
  @zn-input="${this.handleInput}"
@@ -249,6 +273,7 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
249
273
  name="${this.name}"
250
274
  size="${this.size}"
251
275
  value="${this.value}"
276
+ placeholder="${this.placeholder}"
252
277
  help-text="${ifDefined(this.helpText)}"
253
278
  pattern=${ifDefined(this.pattern)}
254
279
  @zn-input="${this.handleInput}"
@@ -263,7 +288,7 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
263
288
  value="${this.value}"
264
289
  help-text="${ifDefined(this.helpText)}"
265
290
  size="${this.size}"
266
- placeholder=" ${this.placeholder}"
291
+ placeholder="${this.placeholder}"
267
292
  @zn-input="${this.handleInput}"
268
293
  @zn-blur="${this.handleBlur}">
269
294
  ${Object.keys(this.options).map(key => html`
@@ -26,6 +26,10 @@
26
26
  line-height: var(--zn-line-height-looser);
27
27
  }
28
28
 
29
+ .ai__input::part(display-input) {
30
+ color: rgb(var(--zn-text));
31
+ }
32
+
29
33
  .ai__input::part(input), .ai__input::part(combobox) {
30
34
  padding: 0;
31
35
  color: rgb(var(--zn-text));
@@ -91,7 +95,6 @@
91
95
  &--editing {
92
96
  .ai__right {
93
97
  display: flex !important;
94
- align-items: start;
95
98
  }
96
99
  }
97
100
 
@@ -12,7 +12,7 @@
12
12
  justify-content: start;
13
13
  position: relative;
14
14
  width: 100%;
15
- box-shadow: var(--zn-shadow-medium);
15
+ box-shadow: var(--zn-shadow-x-small);
16
16
  font-family: var(--zn-input-font-family), sans-serif;
17
17
  font-weight: var(--zn-input-font-weight);
18
18
  letter-spacing: var(--zn-input-letter-spacing);
@@ -30,6 +30,8 @@ export default class ZnItem extends ZincElement {
30
30
 
31
31
  @property() caption: string;
32
32
 
33
+ @property() description: string;
34
+
33
35
  @property({type: Boolean}) stacked: boolean;
34
36
 
35
37
  @property({reflect: true}) size: 'small' | 'medium' | 'large' = 'medium';
@@ -46,6 +48,9 @@ export default class ZnItem extends ZincElement {
46
48
 
47
49
  @property({type: Boolean, attribute: 'no-padding'}) noPadding: boolean;
48
50
 
51
+ // align items to the right
52
+ @property({type: Boolean, attribute: 'align-end'}) alignEnd: boolean;
53
+
49
54
  connectedCallback() {
50
55
  super.connectedCallback();
51
56
  this.setAttribute('role', 'listitem');
@@ -63,37 +68,43 @@ export default class ZnItem extends ZincElement {
63
68
  render() {
64
69
  const hasIcon = this.icon && this.icon.length > 0;
65
70
 
71
+ const headings = html`
72
+ <div class="item__headings">
73
+ <div class="item__caption" part="caption">${this.caption}</div>
74
+ ${this.description ? html`<div class="item__description">${this.description}</div>` : ''}
75
+ </div>`;
76
+
66
77
  return html`
67
78
  <div
68
79
  class=${classMap({
69
- 'description-item': true,
70
- 'description-item--stacked': this.stacked,
71
- 'description-item--edit-on-hover': this.editOnHover,
72
- 'description-item--inline': this.inline,
73
- 'description-item--grid': this.grid,
74
- 'description-item--small': this.size === 'small',
75
- 'description-item--medium': this.size === 'medium',
76
- 'description-item--large': this.size === 'large',
77
- 'description-item--has-icon': hasIcon,
78
- 'description-item--no-padding': this.noPadding
80
+ 'item': true,
81
+ 'item--stacked': this.stacked,
82
+ 'item--edit-on-hover': this.editOnHover,
83
+ 'item--inline': this.inline,
84
+ 'item--grid': this.grid,
85
+ 'item--small': this.size === 'small',
86
+ 'item--medium': this.size === 'medium',
87
+ 'item--large': this.size === 'large',
88
+ 'item--has-icon': hasIcon,
89
+ 'item--no-padding': this.noPadding,
90
+ 'item--align-end': this.alignEnd
79
91
  })}
80
92
  part="base">
81
93
 
82
94
  ${this.icon ? html`
83
- <div class="description-item__header">
84
- <div class="description-item__icon">
95
+ <div class="item__header">
96
+ <div class="item__icon">
85
97
  <zn-icon src="${this.icon}" size="20" part="icon"></zn-icon>
86
98
  </div>
87
- <div class="description-item__caption" part="caption">${this.caption}</div>
88
- </div>` : html`
89
- <div class="description-item__caption" part="caption">${this.caption}</div>`}
99
+ ${headings}
100
+ </div>` : headings}
90
101
 
91
- <div class="description-item__content">
92
- <div class="description-item__content-inner">
102
+ <div class="item__content">
103
+ <div class="item__content-inner">
93
104
  <slot>${this.value}</slot>
94
105
  </div>
95
- <div class="description-item__action-wrapper">
96
- <slot name="actions" class="description-item__actions"></slot>
106
+ <div class="item__action-wrapper">
107
+ <slot name="actions" class="item__actions"></slot>
97
108
  </div>
98
109
  </div>
99
110
  </div>
@@ -7,10 +7,11 @@
7
7
  --zn-item-label-max-width: 300px;
8
8
  }
9
9
 
10
- .description-item {
10
+ .item {
11
11
  display: flex;
12
12
  flex-direction: row;
13
13
  padding: 0 var(--zn-spacing-medium);
14
+ gap: var(--zn-spacing-2x-small);
14
15
 
15
16
  @include wc.container-query(null, md) {
16
17
  --zn-item-label-max-width: 200px;
@@ -26,9 +27,7 @@
26
27
  }
27
28
 
28
29
  &--has-icon {
29
- align-items: flex-start !important;
30
-
31
- .description-item__icon {
30
+ .item__icon {
32
31
  position: relative;
33
32
  line-height: 33px;
34
33
  display: flex;
@@ -38,32 +37,54 @@
38
37
  }
39
38
  }
40
39
 
40
+ &--align-end .description-item__content {
41
+ text-align: right;
42
+ }
43
+
41
44
  &__header {
42
45
  display: flex;
46
+ align-items: center;
43
47
  max-width: var(--zn-item-label-max-width);
44
48
  width: 100%;
45
49
 
46
- .description-item__caption {
50
+ .item__caption {
47
51
  width: unset;
48
52
  max-width: unset;
49
53
  }
50
54
  }
51
55
 
56
+ &__headings {
57
+ display: flex;
58
+ flex-direction: column;
59
+ max-width: var(--zn-item-label-max-width);
60
+ width: 100%;
61
+ flex-shrink: 0;
62
+ }
63
+
52
64
  &__content {
53
65
  width: 100%;
54
66
  display: flex;
55
67
  justify-content: space-between;
56
- line-height: 30px;
68
+ line-height: 33px;
57
69
  }
58
70
 
59
71
  &__content-inner {
60
72
  width: 100%;
73
+
74
+ ::slotted(a) {
75
+ color: rgb(var(--zn-primary)) !important;
76
+ }
77
+
78
+ ::slotted(zn-icon) {
79
+ vertical-align: middle;
80
+ margin-right: var(--zn-spacing-2x-small);
81
+ }
61
82
  }
62
83
 
63
84
  &__caption {
64
85
  font-weight: 500;
65
86
  color: rgb(var(--zn-text-heading));
66
- line-height: 33px;
87
+ line-height: var(--zn-line-height-normal);
67
88
  max-width: var(--zn-item-label-max-width);
68
89
  width: 100%;
69
90
  flex-shrink: 0;
@@ -73,8 +94,20 @@
73
94
  }
74
95
  }
75
96
 
97
+ &__description {
98
+ display: block;
99
+ font-weight: 400;
100
+ margin: var(--zn-spacing-2x-small) 0 0;
101
+ font-size: var(--zn-font-size-small);
102
+ color: rgb(var(--zn-text-color));
103
+ overflow: hidden;
104
+ white-space: nowrap;
105
+ text-overflow: ellipsis;
106
+ }
107
+
76
108
  &__action-wrapper {
77
109
  display: inline-block;
110
+ align-content: center;
78
111
  }
79
112
 
80
113
  &__actions {
@@ -86,11 +119,11 @@
86
119
 
87
120
  // Sizes
88
121
  &--small {
89
- &.description-item {
122
+ &.item {
90
123
  padding: var(--zn-spacing-x-small);
91
124
  }
92
125
 
93
- .description-item__caption, .description-item__content-inner {
126
+ .item__caption, .item__content-inner {
94
127
  font-size: var(--zn-font-size-small);
95
128
  }
96
129
 
@@ -110,7 +143,7 @@
110
143
  display: none;
111
144
  }
112
145
 
113
- .description-item__actions {
146
+ .item__actions {
114
147
  display: none;
115
148
  }
116
149
 
@@ -119,7 +152,7 @@
119
152
  display: flex;
120
153
  }
121
154
 
122
- .description-item__actions {
155
+ .item__actions {
123
156
  display: flex;
124
157
  }
125
158
  }
@@ -129,20 +162,29 @@
129
162
 
130
163
  gap: var(--zn-spacing-small);
131
164
 
132
- .description-item__header {
165
+ .item__header {
133
166
  width: unset;
134
167
  max-width: unset;
135
168
  }
136
169
 
137
- .description-item__icon {
170
+ .item__icon {
138
171
  margin-right: 0;
139
172
  }
140
173
 
141
- .description-item__caption {
174
+ .item__caption {
142
175
  width: unset;
143
176
  max-width: unset;
144
177
  }
145
178
 
179
+ .item__headings {
180
+ width: unset;
181
+ max-width: unset;
182
+ }
183
+
184
+ .item__description {
185
+ margin: 0;
186
+ }
187
+
146
188
  @include wc.container-query(null, sm) {
147
189
  flex-direction: row;
148
190
  align-items: center;
@@ -46,7 +46,7 @@ export default class ZnLinkedSelect extends ZincElement implements ZincFormContr
46
46
  @property({attribute: 'cache-key'}) cacheKey: string = "";
47
47
  @property() label: string = "";
48
48
 
49
- @query('zn-select') input: HTMLInputElement;
49
+ @query('zn-select') input: ZnSelect;
50
50
 
51
51
  private linkedSelectElement: HTMLSelectElement | ZnSelect;
52
52
  private readonly formControlController = new FormControlController(this, {
@@ -60,6 +60,10 @@ export default class ZnLinkedSelect extends ZincElement implements ZincFormContr
60
60
  }
61
61
  });
62
62
 
63
+ get displayLabel() {
64
+ return (this.input as ZnSelect).displayLabel;
65
+ }
66
+
63
67
  get validity() {
64
68
  return this.input?.validity;
65
69
  }
@@ -169,6 +169,7 @@ export default class ZnMenu extends ZincElement {
169
169
  // get the parent dropdown and close it
170
170
  (closestMenu?.closest('zn-dropdown') as ZnDropdown | null)?.hide();
171
171
 
172
+ console.log('emitting select')
172
173
  this.emit('zn-select', {detail: {item}});
173
174
  }
174
175
 
@@ -9,6 +9,6 @@
9
9
  min-width: var(--zn-spacing-small-panel);
10
10
  overflow: auto;
11
11
  overscroll-behavior: none;
12
- filter: drop-shadow(0 5px 4px rgba(0, 0, 0, 0.04)) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.1));
12
+ box-shadow: var(--zn-shadow-medium);
13
13
  background-color: rgb(var(--zn-panel, 255, 255, 255));
14
14
  }
@@ -50,6 +50,8 @@ export default class ZnMenuItem extends ZincElement {
50
50
  /** Draws the item in a checked state. */
51
51
  @property({type: Boolean, reflect: true}) checked = false;
52
52
 
53
+ @property({attribute: 'checked-position', reflect: true}) checkedPosition: 'left' | 'right' = 'left';
54
+
53
55
  /** A unique value to store in the menu item. This can be used as a way to identify menu items when selected. */
54
56
  @property() value = '';
55
57
 
@@ -59,6 +61,8 @@ export default class ZnMenuItem extends ZincElement {
59
61
  /** Draws the menu item in a disabled state, preventing selection. */
60
62
  @property({type: Boolean, reflect: true}) disabled = false;
61
63
 
64
+ @property() color: string;
65
+
62
66
  // Link Specific
63
67
  @property() href: string;
64
68
 
@@ -193,13 +197,22 @@ export default class ZnMenuItem extends ZincElement {
193
197
  'menu-item--disabled': this.disabled,
194
198
  'menu-item--loading': this.loading,
195
199
  'menu-item--has-submenu': this.isSubmenu(),
196
- 'menu-item--submenu-expanded': isSubmenuExpanded
200
+ 'menu-item--submenu-expanded': isSubmenuExpanded,
201
+ 'menu-item--primary': this.color === 'primary',
202
+ 'menu-item--secondary': this.color === 'secondary',
203
+ 'menu-item--error': this.color === 'error',
204
+ 'menu-item--info': this.color === 'info',
205
+ 'menu-item--success': this.color === 'success',
206
+ 'menu-item--warning': this.color === 'warning',
207
+ 'menu-item--transparent': this.color === 'transparent',
208
+
197
209
  })}
198
210
  ?aria-haspopup="${this.isSubmenu()}"
199
211
  ?aria-expanded="${isSubmenuExpanded}">
200
- <span part="checked-icon" class="menu-item__check">
201
- <zn-icon src="check_small" aria-hidden="true"></zn-icon>
202
- </span>
212
+ ${this.checkedPosition === 'left' ? html`
213
+ <span part="checked-icon" class="menu-item__check">
214
+ <zn-icon src="check_small" aria-hidden="true"></zn-icon>
215
+ </span>` : ''}
203
216
 
204
217
  <slot name="prefix" part="prefix" class="menu-item__prefix"></slot>
205
218
 
@@ -207,6 +220,11 @@ export default class ZnMenuItem extends ZincElement {
207
220
 
208
221
  <slot name="suffix" part="suffix" class="menu-item__suffix"></slot>
209
222
 
223
+ ${this.checkedPosition === 'right' ? html`
224
+ <span part="checked-icon" class="menu-item__check">
225
+ <zn-icon src="check_small" aria-hidden="true"></zn-icon>
226
+ </span>` : ''}
227
+
210
228
  <span part="submenu-icon" class="menu-item__chevron">
211
229
  <zn-icon src=${isRtl ? 'chevron_left' : 'chevron_right'} aria-hidden="true"></zn-icon>
212
230
  </span>