@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.
Files changed (98) hide show
  1. package/dist/custom-elements.json +453 -20
  2. package/dist/vscode.html-custom-data.json +87 -11
  3. package/dist/web-types.json +168 -12
  4. package/dist/zn.d.ts +149 -25
  5. package/dist/zn.min.css +1 -1
  6. package/dist/zn.min.js +911 -874
  7. package/docs/assets/styles/docs.css +1 -1
  8. package/docs/pages/components/button.md +25 -7
  9. package/docs/pages/components/chat-message.md +62 -0
  10. package/docs/pages/components/data-table-search.md +6 -6
  11. package/docs/pages/components/editor.md +1 -1
  12. package/docs/pages/components/file.md +1 -1
  13. package/docs/pages/components/form-group.md +1 -1
  14. package/docs/pages/components/icon.md +19 -2
  15. package/docs/pages/components/menu.md +23 -2
  16. package/docs/pages/components/select.md +2 -2
  17. package/docs/pages/components/tile-group.md +92 -0
  18. package/docs/pages/components/tile.md +80 -25
  19. package/package.json +1 -1
  20. package/scss/_root.scss +1 -1
  21. package/scss/mixins/_spacing-mixins.scss +20 -0
  22. package/scss/mixins/_typography-mixins.scss +22 -0
  23. package/scss/mixins/index.scss +2 -1
  24. package/scss/shared/_base.scss +18 -20
  25. package/scss/shared/_button.scss +5 -3
  26. package/scss/shared/_table.scss +4 -1
  27. package/scss/shared/layout.scss +2 -2
  28. package/scss/themes/_index.scss +2 -0
  29. package/scss/themes/_light.scss +22 -45
  30. package/scss/themes/_spacing.scss +44 -0
  31. package/scss/themes/_typography.scss +62 -0
  32. package/src/components/animated-button/README.md +1 -1
  33. package/src/components/button/button.component.ts +27 -5
  34. package/src/components/button/button.scss +86 -30
  35. package/src/components/button-menu/button-menu.component.ts +22 -9
  36. package/src/components/button-menu/button-menu.scss +1 -2
  37. package/src/components/button-menu/button-menu.test.ts +18 -0
  38. package/src/components/chat-message/chat-message.component.ts +73 -0
  39. package/src/components/chat-message/chat-message.scss +60 -0
  40. package/src/components/chat-message/index.ts +12 -0
  41. package/src/components/checkbox/checkbox.scss +2 -2
  42. package/src/components/chip/chip.component.ts +0 -5
  43. package/src/components/chip/chip.scss +14 -35
  44. package/src/components/content-block/content-block.component.ts +46 -45
  45. package/src/components/content-block/content-block.scss +58 -27
  46. package/src/components/data-table/data-table.scss +10 -7
  47. package/src/components/data-table-sort/data-table-sort.scss +1 -1
  48. package/src/components/dialog/dialog.component.ts +3 -3
  49. package/src/components/dialog/dialog.scss +2 -2
  50. package/src/components/dropdown/dropdown.component.ts +1 -0
  51. package/src/components/editor/editor.component.ts +3 -1
  52. package/src/components/editor/editor.scss +9 -2
  53. package/src/components/editor/modules/ai/panel/ai-panel.scss +2 -2
  54. package/src/components/editor/modules/ai/tooltip/ai-tooltip.scss +1 -1
  55. package/src/components/editor/modules/context-menu/context-menu.ts +20 -20
  56. package/src/components/editor/modules/dialog/dialog.component.ts +3 -4
  57. package/src/components/editor/modules/dialog/dialog.scss +2 -1
  58. package/src/components/editor/modules/dialog/dialog.ts +12 -8
  59. package/src/components/editor/modules/toolbar/tool/tool.component.ts +1 -5
  60. package/src/components/editor/modules/toolbar/toolbar.component.ts +54 -50
  61. package/src/components/editor/modules/toolbar/toolbar.scss +4 -29
  62. package/src/components/editor/modules/toolbar/toolbar.ts +15 -17
  63. package/src/components/expanding-action/expanding-action.component.ts +14 -7
  64. package/src/components/expanding-action/expanding-action.scss +44 -2
  65. package/src/components/file/file.scss +2 -2
  66. package/src/components/header/header.component.ts +1 -1
  67. package/src/components/header/header.scss +3 -3
  68. package/src/components/hover-container/hover-container.scss +1 -1
  69. package/src/components/icon/icon.component.ts +6 -1
  70. package/src/components/icon/icon.scss +31 -0
  71. package/src/components/icon-picker/icon-picker.scss +3 -3
  72. package/src/components/input/input.scss +3 -3
  73. package/src/components/input-group/input-group.scss +16 -16
  74. package/src/components/markdown-editor/markdown-editor.scss +2 -2
  75. package/src/components/menu/menu.component.ts +32 -1
  76. package/src/components/menu/menu.scss +28 -5
  77. package/src/components/menu-item/menu-item.component.ts +6 -2
  78. package/src/components/menu-item/menu-item.scss +49 -5
  79. package/src/components/navbar/navbar.component.ts +7 -4
  80. package/src/components/navbar/navbar.scss +93 -21
  81. package/src/components/page/page.component.ts +1 -1
  82. package/src/components/page/page.scss +7 -26
  83. package/src/components/panel/panel.scss +5 -8
  84. package/src/components/priority-list/priority-list.scss +1 -1
  85. package/src/components/rating/rating.scss +1 -1
  86. package/src/components/scroll-container/scroll-container.scss +2 -1
  87. package/src/components/select/select.scss +1 -1
  88. package/src/components/settings-container/settings-container.scss +2 -2
  89. package/src/components/stat/stat.scss +8 -5
  90. package/src/components/tile/tile.component.ts +10 -2
  91. package/src/components/tile/tile.scss +108 -67
  92. package/src/components/tile-group/index.ts +12 -0
  93. package/src/components/tile-group/tile-group.component.ts +66 -0
  94. package/src/components/tile-group/tile-group.scss +23 -0
  95. package/src/form-control.scss +2 -1
  96. package/src/wc.scss +1 -0
  97. package/src/zinc.ts +2 -0
  98. package/src/components/editor/modules/toolbar/tool/tool.scss +0 -5
@@ -1,21 +1,34 @@
1
1
  @use "../../wc";
2
2
 
3
+ :host {
4
+ display: block;
5
+ }
6
+
3
7
  .tile {
4
8
  position: relative;
5
9
  display: flex;
10
+ align-items: center;
6
11
  justify-content: space-between;
12
+ min-height: 48px;
13
+ column-gap: var(--zn-spacing-large);
14
+
15
+ font-size: var(--zn-text-table-content-font-size);
16
+ line-height: var(--zn-text-table-content-line-height);
17
+ font-weight: var(--zn-text-table-content-font-weight);
18
+ color: var(--zn-text-table-content-color);
7
19
 
8
20
  &--has-image,
9
- &--has-text,
10
21
  &--has-caption,
11
22
  &--has-description,
12
23
  &--has-properties,
13
- &--has-actions,
24
+ &--has-actions {
25
+ padding-inline: var(--zn-base-gap);
26
+ }
27
+
14
28
  &--has-image {
15
29
  padding: var(--zn-base-gap);
16
30
  }
17
31
 
18
-
19
32
  &--has-href {
20
33
  cursor: pointer;
21
34
 
@@ -37,108 +50,136 @@
37
50
  }
38
51
  }
39
52
 
53
+ a {
54
+ color: inherit;
55
+ text-decoration: none;
56
+ cursor: pointer;
57
+ }
58
+
40
59
  ::slotted(zn-icon) {
41
60
  display: flex;
42
61
  justify-content: center;
43
62
  align-items: center;
44
63
  }
45
64
 
46
- .tile__left {
65
+ .tile__link {
47
66
  display: flex;
48
67
  align-items: center;
49
- column-gap: var(--zn-spacing-medium);
50
- padding-right: var(--zn-spacing-medium);
51
- width: 100%;
52
- max-width: 400px;
68
+ column-gap: var(--zn-spacing-small);
69
+ min-width: 0;
70
+ }
53
71
 
54
- @include wc.container-query(null, md) {
55
- max-width: 320px;
56
- }
72
+ .tile__left {
73
+ display: flex;
74
+ align-items: center;
75
+ column-gap: var(--zn-spacing-small);
76
+ min-width: 0;
57
77
  }
58
78
 
59
- .tile__right {
79
+ .tile__image {
60
80
  display: flex;
61
81
  align-items: center;
62
- justify-content: flex-end;
63
- width: 50%;
64
- flex-grow: 1;
65
- column-gap: var(--zn-spacing-medium);
82
+ flex-shrink: 0;
66
83
  }
67
84
 
68
- .tile__properties {
85
+ .tile__content {
69
86
  display: flex;
87
+ flex-direction: column;
88
+ justify-content: center;
89
+ min-width: 0;
90
+ }
91
+
92
+ .tile--inline .tile__content {
70
93
  flex-direction: row;
71
- column-gap: 30px;
72
- overflow: auto;
94
+ align-items: center;
95
+ column-gap: var(--zn-spacing-x-small);
96
+ }
73
97
 
74
- @include wc.container-query(null, md) {
75
- display: none;
76
- }
98
+ .tile__caption {
99
+ margin: 0;
100
+ font-weight: 600;
101
+ color: rgb(var(--zn-text-heading));
102
+ white-space: nowrap;
103
+ overflow: hidden;
104
+ text-overflow: ellipsis;
77
105
  }
78
106
 
79
- a {
80
- color: inherit;
81
- text-decoration: none;
82
- cursor: pointer;
107
+ .tile--plain .tile__caption {
108
+ font-weight: var(--zn-text-table-content-font-weight);
109
+ color: var(--zn-text-table-content-color);
83
110
  }
84
111
 
85
- .tile__content {
86
- flex: auto;
87
- min-width: 0;
112
+ .tile__description {
113
+ margin: var(--zn-spacing-3x-small) 0 0;
114
+ font-weight: var(--zn-text-table-content-font-weight);
115
+ color: var(--zn-text-table-content-color);
116
+ white-space: nowrap;
117
+ overflow: hidden;
118
+ text-overflow: ellipsis;
119
+ }
88
120
 
89
- @extend %property;
121
+ .tile--inline .tile__description {
122
+ margin: 0;
90
123
  }
91
124
 
92
- .tile--inline .tile__content {
125
+ .tile__right {
126
+ display: flex;
127
+ align-items: center;
128
+ justify-content: flex-end;
129
+ column-gap: var(--zn-spacing-large);
130
+ min-width: 0;
131
+ }
132
+
133
+ .tile__properties {
93
134
  display: flex;
135
+ flex-direction: row;
94
136
  align-items: center;
95
- gap: 5px;
137
+ column-gap: var(--zn-spacing-large);
138
+ min-width: 0;
139
+ overflow: hidden;
96
140
 
97
- .tile__description {
98
- margin: 0;
141
+ ::slotted(*) {
142
+ white-space: nowrap;
143
+ }
144
+
145
+ @include wc.container-query(null, sm) {
146
+ display: none;
99
147
  }
100
148
  }
101
149
 
102
150
  .tile__actions {
103
151
  display: flex;
152
+ align-items: center;
104
153
  column-gap: var(--zn-spacing-small);
105
- margin-left: auto;
154
+ flex-shrink: 0;
106
155
  }
107
156
 
108
- .tile__link {
109
- width: 100%;
110
- }
111
-
112
- %property {
113
- .tile__caption {
114
- display: block;
115
- font-weight: 500;
116
- margin: 0;
117
- font-size: 14px;
118
- color: rgb(var(--zn-text-heading));
119
- text-overflow: ellipsis;
120
- overflow: hidden;
121
- }
157
+ :host([grouped]) {
158
+ display: grid;
159
+ grid-column: 1 / -1;
160
+ grid-template-columns: subgrid;
161
+ align-items: center;
162
+ }
122
163
 
123
- .tile__description {
124
- display: block;
125
- font-weight: 400;
126
- margin: var(--zn-spacing-2x-small) 0 0;
127
- font-size: var(--zn-font-size-medium);
128
- color: rgb(var(--zn-text-color));
129
- text-overflow: ellipsis;
130
- overflow: hidden;
131
- }
164
+ :host([grouped]) .tile {
165
+ display: grid;
166
+ grid-column: 1 / -1;
167
+ grid-template-columns: subgrid;
168
+ align-items: center;
169
+ justify-items: end;
170
+ min-height: 48px;
132
171
  }
133
172
 
134
- // Tile property
135
- .tile__property {
136
- display: flex;
137
- flex-direction: column;
138
- max-width: 150px;
139
- overflow: hidden;
140
- white-space: nowrap;
141
- text-overflow: ellipsis;
173
+ :host([grouped]) .tile__link,
174
+ :host([grouped]) .tile__right,
175
+ :host([grouped]) .tile__properties,
176
+ :host([grouped]) .tile__actions {
177
+ display: contents;
178
+ }
142
179
 
143
- @extend %property;
180
+ :host([grouped]) .tile__left {
181
+ grid-column: 1;
182
+ justify-self: stretch;
183
+ min-width: 0;
184
+ overflow: hidden;
144
185
  }
@@ -0,0 +1,12 @@
1
+ import ZnTileGroup from './tile-group.component';
2
+
3
+ export * from './tile-group.component';
4
+ export default ZnTileGroup;
5
+
6
+ ZnTileGroup.define('zn-tile-group');
7
+
8
+ declare global {
9
+ interface HTMLElementTagNameMap {
10
+ 'zn-tile-group': ZnTileGroup;
11
+ }
12
+ }
@@ -0,0 +1,66 @@
1
+ import {type CSSResultGroup, html, unsafeCSS} from 'lit';
2
+ import {property} from 'lit/decorators.js';
3
+ import ZincElement from '../../internal/zinc-element';
4
+
5
+ import styles from './tile-group.scss';
6
+
7
+ /**
8
+ * @summary Aligns a list of `zn-tile` rows into shared, content-driven columns so values
9
+ * and actions line up across every row, with optional dividing borders.
10
+ * @documentation https://zinc.style/components/tile-group
11
+ * @status experimental
12
+ * @since 1.0
13
+ *
14
+ * @dependency zn-tile
15
+ *
16
+ * @slot - One or more `zn-tile` elements.
17
+ *
18
+ * @csspart base - The component's base wrapper (the grid container).
19
+ *
20
+ * @cssproperty --zn-tile-cols - The number of value/action columns (set automatically).
21
+ */
22
+ export default class ZnTileGroup extends ZincElement {
23
+ static styles: CSSResultGroup = unsafeCSS(styles);
24
+
25
+ /** Draws a dividing border between rows. */
26
+ @property({attribute: 'divide', type: Boolean, reflect: true}) divide = false;
27
+
28
+ private _mutationObserver: MutationObserver | null = null;
29
+
30
+ connectedCallback() {
31
+ super.connectedCallback();
32
+ // Re-sync when tiles (or their values/actions) are added or removed so the
33
+ // shared column count tracks the current content.
34
+ this._mutationObserver = new MutationObserver(() => this._sync());
35
+ this._mutationObserver.observe(this, {childList: true, subtree: true});
36
+ }
37
+
38
+ disconnectedCallback() {
39
+ super.disconnectedCallback();
40
+ this._mutationObserver?.disconnect();
41
+ this._mutationObserver = null;
42
+ }
43
+
44
+ private _handleSlotChange = () => this._sync();
45
+
46
+ // Flag each child tile as grouped (so it switches to its subgrid row layout)
47
+ // and publish the widest row's column count as --zn-tile-cols so the grid
48
+ // template has enough shared tracks for every row.
49
+ private _sync() {
50
+ const tiles = Array.from(this.querySelectorAll<HTMLElement>(':scope > zn-tile'));
51
+ let cols = 0;
52
+ for (const tile of tiles) {
53
+ tile.setAttribute('grouped', '');
54
+ const count = tile.querySelectorAll(':scope > [slot="properties"], :scope > [slot="actions"]').length;
55
+ cols = Math.max(cols, count);
56
+ }
57
+ this.style.setProperty('--zn-tile-cols', String(Math.max(1, cols)));
58
+ }
59
+
60
+ protected render(): unknown {
61
+ return html`
62
+ <div part="base" class="tile-group">
63
+ <slot @slotchange=${this._handleSlotChange}></slot>
64
+ </div>`;
65
+ }
66
+ }
@@ -0,0 +1,23 @@
1
+ @use "../../wc";
2
+
3
+ :host {
4
+ display: block;
5
+ width: 100%;
6
+ }
7
+
8
+ .tile-group {
9
+ display: grid;
10
+ width: 100%;
11
+ grid-template-columns: minmax(min(100%, var(--zn-tile-caption-min-width, 7.5rem)), 1fr) repeat(var(--zn-tile-cols, 1), auto);
12
+ align-items: center;
13
+ column-gap: var(--zn-spacing-large);
14
+ row-gap: 0;
15
+ }
16
+
17
+ slot {
18
+ display: contents;
19
+ }
20
+
21
+ :host([divide]) ::slotted(zn-tile:not(:first-child)) {
22
+ border-top: 1px solid rgb(var(--zn-border-color));
23
+ }
@@ -18,7 +18,8 @@
18
18
  .form-control--has-label .form-control__label {
19
19
  display: inline-block;
20
20
  color: var(--zn-input-label-color);
21
- font-weight: var(--zn-font-weight-semibold);
21
+ font-weight: var(--zn-input-label-font-weight);
22
+ line-height: var(--zn-input-label-line-height);
22
23
  margin-bottom: var(--zn-spacing-2x-small);
23
24
  }
24
25
 
package/src/wc.scss CHANGED
@@ -12,6 +12,7 @@
12
12
  text-rendering: optimizeLegibility;
13
13
  -webkit-font-smoothing: antialiased;
14
14
  -moz-osx-font-smoothing: grayscale;
15
+ text-transform: none;
15
16
 
16
17
  *, *::before, *::after {
17
18
  box-sizing: border-box;
package/src/zinc.ts CHANGED
@@ -7,6 +7,7 @@ export { default as Popup } from './components/popup';
7
7
  export { default as Collapsible } from './components/collapsible';
8
8
  export { default as Alert } from './components/alert';
9
9
  export { default as ButtonGroup } from './components/button-group';
10
+ export { default as ChatMessage } from './components/chat-message';
10
11
  export { default as Chip } from './components/chip';
11
12
  export { default as Well } from './components/well';
12
13
  export { default as CopyButton } from './components/copy-button';
@@ -21,6 +22,7 @@ export { default as DefinedLabel } from './components/defined-label';
21
22
  export { default as EmptyState } from './components/empty-state';
22
23
  export { default as Note } from './components/note';
23
24
  export { default as Tile } from './components/tile';
25
+ export { default as TileGroup } from './components/tile-group';
24
26
  export { default as TileProperty } from './components/tile-property';
25
27
  export { default as Chart } from './components/chart';
26
28
  export { default as SimpleChart } from './components/simple-chart';
@@ -1,5 +0,0 @@
1
- .tool-action {
2
- width: 28px;
3
- height: 28px;
4
- margin: 3px 2px;
5
- }