@kubex/zinc 1.0.118 → 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 +634 -201
- package/dist/vscode.html-custom-data.json +115 -39
- package/dist/web-types.json +220 -64
- 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 -34
- 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
package/scss/shared/_base.scss
CHANGED
|
@@ -8,8 +8,7 @@ Apply default styles to the document, and shadow documents
|
|
|
8
8
|
|
|
9
9
|
font-feature-settings: normal;
|
|
10
10
|
font-variation-settings: normal;
|
|
11
|
-
font-size:
|
|
12
|
-
line-height: 1.5;
|
|
11
|
+
font-size: var(--zn-text-paragraph-font-size);
|
|
13
12
|
|
|
14
13
|
-webkit-text-size-adjust: 100%;
|
|
15
14
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0%);
|
|
@@ -71,33 +70,32 @@ small {
|
|
|
71
70
|
visibility: hidden;
|
|
72
71
|
}
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
font-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
h6 {
|
|
80
|
-
font-size: var(--zn-font-size-x-small);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
h5 {
|
|
84
|
-
font-size: var(--zn-font-size-small);
|
|
73
|
+
p {
|
|
74
|
+
font-size: var(--zn-text-paragraph-font-size);
|
|
75
|
+
line-height: var(--zn-text-paragraph-line-height);
|
|
76
|
+
font-weight: var(--zn-text-paragraph-font-weight);
|
|
85
77
|
}
|
|
86
78
|
|
|
87
|
-
h4 {
|
|
88
|
-
|
|
79
|
+
h1, h2, h3, h4, h5, h6 {
|
|
80
|
+
color: rgb(var(--zn-text-heading));
|
|
89
81
|
}
|
|
90
82
|
|
|
91
|
-
|
|
92
|
-
font-size: var(--zn-font-size
|
|
83
|
+
h1 {
|
|
84
|
+
font-size: var(--zn-text-h1-font-size);
|
|
85
|
+
line-height: var(--zn-text-h1-line-height);
|
|
86
|
+
font-weight: var(--zn-text-h1-font-weight);
|
|
93
87
|
}
|
|
94
88
|
|
|
95
89
|
h2 {
|
|
96
|
-
font-size: var(--zn-font-size
|
|
90
|
+
font-size: var(--zn-text-h2-font-size);
|
|
91
|
+
line-height: var(--zn-text-h2-line-height);
|
|
92
|
+
font-weight: var(--zn-text-h2-font-weight);
|
|
97
93
|
}
|
|
98
94
|
|
|
99
|
-
|
|
100
|
-
font-size: var(--zn-font-size
|
|
95
|
+
h3, h4, h5, h6 {
|
|
96
|
+
font-size: var(--zn-text-h3-font-size);
|
|
97
|
+
line-height: var(--zn-text-h3-line-height);
|
|
98
|
+
font-weight: var(--zn-text-h3-font-weight);
|
|
101
99
|
}
|
|
102
100
|
|
|
103
101
|
kbd {
|
package/scss/shared/_button.scss
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@use '../variables';
|
|
3
3
|
|
|
4
4
|
@mixin button {
|
|
5
|
-
border-radius: var(--zn-border-radius
|
|
5
|
+
border-radius: var(--zn-border-radius);
|
|
6
6
|
display: inline-flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
justify-content: center;
|
|
@@ -11,12 +11,14 @@
|
|
|
11
11
|
width: fit-content;
|
|
12
12
|
background-color: rgb(var(--zn-primary));
|
|
13
13
|
color: rgba(255, 255, 255, 0.9);
|
|
14
|
-
font-
|
|
14
|
+
font-size: var(--zn-text-button-label-font-size);
|
|
15
|
+
font-weight: var(--zn-text-button-label-font-weight);
|
|
16
|
+
line-height: var(--zn-text-button-label-line-height);
|
|
17
|
+
text-transform: var(--zn-text-button-label-transform);
|
|
15
18
|
cursor: pointer;
|
|
16
19
|
vertical-align: middle;
|
|
17
20
|
border-color: transparent;
|
|
18
21
|
white-space: nowrap;
|
|
19
|
-
line-height: 20px;
|
|
20
22
|
|
|
21
23
|
max-height: 36px;
|
|
22
24
|
height: 36px;
|
package/scss/shared/_table.scss
CHANGED
|
@@ -8,9 +8,12 @@ table:not(.remarkd-table) {
|
|
|
8
8
|
max-width: 100%;
|
|
9
9
|
table-layout: auto;
|
|
10
10
|
text-align: left;
|
|
11
|
+
font-size: var(--zn-text-table-content-font-size);
|
|
12
|
+
line-height: var(--zn-text-table-content-line-height);
|
|
13
|
+
font-weight: var(--zn-text-table-content-font-weight);
|
|
11
14
|
|
|
12
15
|
thead {
|
|
13
|
-
font-weight:
|
|
16
|
+
font-weight: var(--zn-font-weight-medium);
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
tbody {
|
package/scss/shared/layout.scss
CHANGED
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
.zn-panel {
|
|
213
213
|
background-color: rgba(var(--zn-panel), var(--zn-panel-opacity));
|
|
214
214
|
border: 1px solid rgb(var(--zn-border-color));
|
|
215
|
-
border-radius: var(--zn-border-radius
|
|
215
|
+
border-radius: var(--zn-border-radius);
|
|
216
216
|
--zn-page-surface-background: var(--zn-panel);
|
|
217
217
|
}
|
|
218
218
|
|
|
@@ -296,7 +296,7 @@
|
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
.zn-panel-bar--pill {
|
|
299
|
-
border-radius: var(--zn-border-radius
|
|
299
|
+
border-radius: var(--zn-border-radius);
|
|
300
300
|
border: 1px solid rgb(var(--zn-border-color));
|
|
301
301
|
}
|
|
302
302
|
|
package/scss/themes/_index.scss
CHANGED
package/scss/themes/_light.scss
CHANGED
|
@@ -110,10 +110,8 @@
|
|
|
110
110
|
--zn-color-neutral-1000: hsl(0, 0%, 0%); // used: docs/assets/styles/docs.css:502 (+2 more)
|
|
111
111
|
|
|
112
112
|
/* Border radii */
|
|
113
|
-
--zn-border-radius
|
|
114
|
-
--zn-border-radius-
|
|
115
|
-
--zn-border-radius-large: 0.5rem; // 8px
|
|
116
|
-
--zn-border-radius-x-large: 1rem; // 16px
|
|
113
|
+
--zn-border-radius: 6px;
|
|
114
|
+
--zn-border-radius-small: 2px;
|
|
117
115
|
--zn-border-radius-circle: 50%;
|
|
118
116
|
--zn-border-radius-pill: 9999px;
|
|
119
117
|
|
|
@@ -123,27 +121,6 @@
|
|
|
123
121
|
--zn-shadow-large: 0 6px 20px rgba(0, 0, 0, 0.15);
|
|
124
122
|
--zn-shadow-x-large: 0 6px 20px rgba(0, 0, 0, 0.25);
|
|
125
123
|
|
|
126
|
-
--zn-spacing-3x-small: 0.125rem; // 2px
|
|
127
|
-
--zn-spacing-2x-small: 0.25rem; // 4px
|
|
128
|
-
--zn-spacing-x-small: 0.5rem; // 8px
|
|
129
|
-
--zn-spacing-small: 0.75rem; // 12px
|
|
130
|
-
--zn-spacing-medium: 1rem; // 16px
|
|
131
|
-
--zn-spacing-large: 1.25rem; // 20px
|
|
132
|
-
--zn-spacing-x-large: 1.75rem; // 28px
|
|
133
|
-
--zn-spacing-2x-large: 2.25rem; // 36px
|
|
134
|
-
--zn-spacing-3x-large: 3rem; // 48px
|
|
135
|
-
--zn-spacing-4x-large: 4.5rem; // 72px
|
|
136
|
-
|
|
137
|
-
/* Fixed Spaces */
|
|
138
|
-
--zn-spacing-narrow-bar: 45px;
|
|
139
|
-
--zn-spacing-bar: 60px;
|
|
140
|
-
--zn-spacing-tile: 80px;
|
|
141
|
-
--zn-spacing-sidenav: 320px;
|
|
142
|
-
--zn-spacing-small-panel: 200px;
|
|
143
|
-
--zn-spacing-medium-panel: 320px;
|
|
144
|
-
--zn-spacing-panel: 360px;
|
|
145
|
-
--zn-spacing-lside: 460px; // Not sure what this is @mressex figure it out. (I never did)
|
|
146
|
-
|
|
147
124
|
/** Container Sizes */
|
|
148
125
|
--zn-container: var(--zn-container-hd);
|
|
149
126
|
--zn-container-default: 100%;
|
|
@@ -195,18 +172,15 @@
|
|
|
195
172
|
--zn-font-weight-bold: 700;
|
|
196
173
|
|
|
197
174
|
/* Letter spacings */
|
|
198
|
-
--zn-letter-spacing-denser: -0.03em;
|
|
199
|
-
--zn-letter-spacing-dense: -0.015em;
|
|
200
175
|
--zn-letter-spacing-normal: normal;
|
|
201
|
-
--zn-letter-spacing-loose: 0.
|
|
202
|
-
--zn-letter-spacing-looser: 0.15em;
|
|
176
|
+
--zn-letter-spacing-loose: 0.5px;
|
|
203
177
|
|
|
204
178
|
/* Line heights */
|
|
205
|
-
--zn-line-height-denser: 1;
|
|
206
|
-
--zn-line-height-dense: 1.
|
|
207
|
-
--zn-line-height-normal:
|
|
208
|
-
--zn-line-height-loose: 2.
|
|
209
|
-
--zn-line-height-looser:
|
|
179
|
+
--zn-line-height-denser: 1; // 16px
|
|
180
|
+
--zn-line-height-dense: 1.5; // 24px
|
|
181
|
+
--zn-line-height-normal: 2; // 32px
|
|
182
|
+
--zn-line-height-loose: 2.5; // 40px
|
|
183
|
+
--zn-line-height-looser: 3; // 48px
|
|
210
184
|
|
|
211
185
|
/* Focus rings */
|
|
212
186
|
--zn-focus-ring-color: var(--zn-color-primary-600);
|
|
@@ -246,29 +220,30 @@
|
|
|
246
220
|
--zn-input-required-content-color: var(--zn-input-label-color);
|
|
247
221
|
|
|
248
222
|
/* Input border radii */
|
|
249
|
-
--zn-input-border-radius-x-small: var(--zn-border-radius
|
|
250
|
-
--zn-input-border-radius-small: var(--zn-border-radius
|
|
251
|
-
--zn-input-border-radius-medium: var(--zn-border-radius
|
|
252
|
-
--zn-input-border-radius-large: var(--zn-border-radius
|
|
223
|
+
--zn-input-border-radius-x-small: var(--zn-border-radius);
|
|
224
|
+
--zn-input-border-radius-small: var(--zn-border-radius);
|
|
225
|
+
--zn-input-border-radius-medium: var(--zn-border-radius);
|
|
226
|
+
--zn-input-border-radius-large: var(--zn-border-radius);
|
|
253
227
|
|
|
254
228
|
/* Input fonts */
|
|
255
229
|
--zn-input-font-family: var(--zn-font-sans);
|
|
256
|
-
--zn-input-font-weight: var(--zn-font-weight
|
|
230
|
+
--zn-input-font-weight: var(--zn-text-input-content-font-weight);
|
|
257
231
|
--zn-input-font-size-x-small: var(--zn-font-size-x-small);
|
|
258
232
|
--zn-input-font-size-small: var(--zn-font-size-small);
|
|
259
|
-
--zn-input-font-size-medium: var(--zn-font-size
|
|
233
|
+
--zn-input-font-size-medium: var(--zn-text-input-content-font-size);
|
|
260
234
|
--zn-input-font-size-large: var(--zn-font-size-large);
|
|
235
|
+
--zn-input-line-height: var(--zn-text-input-content-line-height);
|
|
261
236
|
--zn-input-letter-spacing: var(--zn-letter-spacing-normal);
|
|
262
237
|
|
|
263
238
|
/* Input colors */
|
|
264
|
-
--zn-input-color: var(--zn-
|
|
239
|
+
--zn-input-color: var(--zn-text-input-content-color);
|
|
265
240
|
--zn-input-color-hover: var(--zn-color-neutral-800);
|
|
266
241
|
--zn-input-color-focus: var(--zn-color-neutral-700);
|
|
267
242
|
--zn-input-color-disabled: var(--zn-color-neutral-800);
|
|
268
243
|
--zn-input-icon-color: var(--zn-color-neutral-500);
|
|
269
244
|
--zn-input-icon-color-hover: var(--zn-color-neutral-600);
|
|
270
245
|
--zn-input-icon-color-focus: var(--zn-color-neutral-600);
|
|
271
|
-
--zn-input-placeholder-color: var(--zn-
|
|
246
|
+
--zn-input-placeholder-color: var(--zn-text-input-placeholder-color);
|
|
272
247
|
--zn-input-placeholder-color-disabled: var(--zn-color-neutral-600);
|
|
273
248
|
|
|
274
249
|
/* Input spacing */
|
|
@@ -281,9 +256,11 @@
|
|
|
281
256
|
--zn-input-focus-ring-offset: 0;
|
|
282
257
|
|
|
283
258
|
--zn-input-label-font-size-small: var(--zn-font-size-small);
|
|
284
|
-
--zn-input-label-font-size-medium: var(--zn-font-size
|
|
259
|
+
--zn-input-label-font-size-medium: var(--zn-text-input-label-font-size);
|
|
285
260
|
--zn-input-label-font-size-large: var(--zn-font-size-large);
|
|
286
|
-
--zn-input-label-
|
|
261
|
+
--zn-input-label-font-weight: var(--zn-text-input-label-font-weight);
|
|
262
|
+
--zn-input-label-line-height: var(--zn-text-input-label-line-height);
|
|
263
|
+
--zn-input-label-color: var(--zn-text-input-label-color);
|
|
287
264
|
|
|
288
265
|
/* Help text */
|
|
289
266
|
--zn-input-help-text-font-size-small: var(--zn-font-size-x-small);
|
|
@@ -303,7 +280,7 @@
|
|
|
303
280
|
--zn-panel-border-color: var(--zn-color-neutral-200);
|
|
304
281
|
--zn-panel-border-width: 1px;
|
|
305
282
|
|
|
306
|
-
--zn-tooltip-border-radius: var(--zn-border-radius
|
|
283
|
+
--zn-tooltip-border-radius: var(--zn-border-radius);
|
|
307
284
|
--zn-tooltip-background-color: var(--zn-color-neutral-900);
|
|
308
285
|
--zn-tooltip-color: var(--zn-color-neutral-0);
|
|
309
286
|
--zn-tooltip-font-family: var(--zn-font-sans);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
3
|
+
/**************************************************************
|
|
4
|
+
* Spacing
|
|
5
|
+
*
|
|
6
|
+
* Uniform spacing tokens. The scale is built on iterations of
|
|
7
|
+
* the 8px base unit (--zn-spacing-unit); 3x-small and 2x-small
|
|
8
|
+
* are quarter/half steps for hairline gaps.
|
|
9
|
+
*
|
|
10
|
+
* Emits --zn-spacing-<name> for every step in $spacing-scale.
|
|
11
|
+
*************************************************************/
|
|
12
|
+
|
|
13
|
+
$spacing-unit: 8px;
|
|
14
|
+
|
|
15
|
+
$spacing-scale: (
|
|
16
|
+
"3x-small": 0.25, // 2px
|
|
17
|
+
"2x-small": 0.5, // 4px
|
|
18
|
+
"x-small": 1, // 8px
|
|
19
|
+
"small": 2, // 16px
|
|
20
|
+
"medium": 3, // 24px
|
|
21
|
+
"large": 4, // 32px
|
|
22
|
+
"x-large": 5, // 40px
|
|
23
|
+
"2x-large": 6, // 48px
|
|
24
|
+
"3x-large": 7, // 56px
|
|
25
|
+
"4x-large": 9, // 72px
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
:root {
|
|
29
|
+
--zn-spacing-unit: #{$spacing-unit};
|
|
30
|
+
|
|
31
|
+
@each $name, $multiplier in $spacing-scale {
|
|
32
|
+
--zn-spacing-#{$name}: #{$multiplier * $spacing-unit};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Fixed spaces */
|
|
36
|
+
--zn-spacing-narrow-bar: 45px;
|
|
37
|
+
--zn-spacing-bar: 60px;
|
|
38
|
+
--zn-spacing-tile: 80px;
|
|
39
|
+
--zn-spacing-sidenav: 320px;
|
|
40
|
+
--zn-spacing-small-panel: 200px;
|
|
41
|
+
--zn-spacing-medium-panel: 320px;
|
|
42
|
+
--zn-spacing-panel: 360px;
|
|
43
|
+
--zn-spacing-lside: 460px;
|
|
44
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
3
|
+
/**************************************************************
|
|
4
|
+
* Text Styles
|
|
5
|
+
*
|
|
6
|
+
* Uniform, role-based typography tokens. Every role emits the
|
|
7
|
+
* same six custom properties:
|
|
8
|
+
*
|
|
9
|
+
* --zn-text-<role>-font-size
|
|
10
|
+
* --zn-text-<role>-line-height
|
|
11
|
+
* --zn-text-<role>-spacing (paragraph spacing — apply as margin-block-end)
|
|
12
|
+
* --zn-text-<role>-font-weight
|
|
13
|
+
* --zn-text-<role>-color
|
|
14
|
+
* --zn-text-<role>-transform
|
|
15
|
+
*
|
|
16
|
+
* All roles use the sans family (--zn-font-sans). Apply a role
|
|
17
|
+
* in a component with the text-style() mixin from scss/mixins.
|
|
18
|
+
*************************************************************/
|
|
19
|
+
|
|
20
|
+
$text-styles: (
|
|
21
|
+
"paragraph": ("size": 14px, "line": 21px, "spacing": 21px, "weight": normal, "color": default, "transform": none),
|
|
22
|
+
"table-content": ("size": 14px, "line": 16px, "spacing": 15px, "weight": normal, "color": default, "transform": none),
|
|
23
|
+
"chat": ("size": 16px, "line": 24px, "spacing": 15px, "weight": normal, "color": default, "transform": none),
|
|
24
|
+
"h1": ("size": 16px, "line": 16px, "spacing": 18px, "weight": semibold, "color": default, "transform": none),
|
|
25
|
+
"h2": ("size": 14px, "line": 16px, "spacing": 15px, "weight": semibold, "color": default, "transform": none),
|
|
26
|
+
"h3": ("size": 11px, "line": 16px, "spacing": 15px, "weight": semibold, "color": default, "transform": none),
|
|
27
|
+
"subheading": ("size": 14px, "line": 16px, "spacing": 15px, "weight": normal, "color": muted, "transform": none),
|
|
28
|
+
"subheading-small": ("size": 13px, "line": 16px, "spacing": 15px, "weight": normal, "color": muted, "transform": none),
|
|
29
|
+
"input-placeholder": ("size": 14px, "line": 24px, "spacing": 18px, "weight": normal, "color": muted, "transform": none),
|
|
30
|
+
"input-content": ("size": 14px, "line": 24px, "spacing": 18px, "weight": normal, "color": default, "transform": none),
|
|
31
|
+
"input-label": ("size": 14px, "line": 16px, "spacing": 15px, "weight": semibold, "color": default, "transform": none),
|
|
32
|
+
"chart-minor": ("size": 14px, "line": 16px, "spacing": 15px, "weight": semibold, "color": muted, "transform": none),
|
|
33
|
+
"chart-major": ("size": 21px, "line": 16px, "spacing": 18px, "weight": normal, "color": default, "transform": none),
|
|
34
|
+
"button-label": ("size": 13px, "line": 16px, "spacing": 18px, "weight": semibold, "color": default, "transform": uppercase),
|
|
35
|
+
"chip": ("size": 10px, "line": 16px, "spacing": 15px, "weight": semibold, "color": default, "transform": uppercase),
|
|
36
|
+
"navbar-link": ("size": 16px, "line": 16px, "spacing": 18px, "weight": semibold, "color": muted, "transform": none),
|
|
37
|
+
"tab-link": ("size": 14px, "line": 16px, "spacing": 15px, "weight": semibold, "color": muted, "transform": none),
|
|
38
|
+
"tab-link-active": ("size": 14px, "line": 16px, "spacing": 15px, "weight": semibold, "color": default, "transform": none),
|
|
39
|
+
"menu-link": ("size": 14px, "line": 16px, "spacing": 15px, "weight": normal, "color": muted, "transform": none),
|
|
40
|
+
"notification": ("size": 9px, "line": 11px, "spacing": 0, "weight": semibold, "color": white, "transform": none),
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
:root {
|
|
44
|
+
/* Text colors (themed via --zn-color-text / --zn-color-muted-text in _root.scss) */
|
|
45
|
+
--zn-text-color: rgb(var(--zn-color-text)); // light: rgba(33, 33, 33, 1)
|
|
46
|
+
--zn-text-color-muted: rgb(var(--zn-color-muted-text)); // light: rgba(125, 119, 146, 1)
|
|
47
|
+
|
|
48
|
+
@each $role, $style in $text-styles {
|
|
49
|
+
--zn-text-#{$role}-font-size: #{map.get($style, "size")};
|
|
50
|
+
--zn-text-#{$role}-line-height: #{map.get($style, "line")};
|
|
51
|
+
--zn-text-#{$role}-spacing: #{map.get($style, "spacing")};
|
|
52
|
+
--zn-text-#{$role}-font-weight: var(--zn-font-weight-#{map.get($style, "weight")});
|
|
53
|
+
@if map.get($style, "color") == muted {
|
|
54
|
+
--zn-text-#{$role}-color: var(--zn-text-color-muted);
|
|
55
|
+
} @else if map.get($style, "color") == white {
|
|
56
|
+
--zn-text-#{$role}-color: #fff;
|
|
57
|
+
} @else {
|
|
58
|
+
--zn-text-#{$role}-color: var(--zn-text-color);
|
|
59
|
+
}
|
|
60
|
+
--zn-text-#{$role}-transform: #{map.get($style, "transform")};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -183,7 +183,7 @@ The component uses CSS custom properties from the Zinc design system:
|
|
|
183
183
|
- `--zn-color-error`: Error color (red)
|
|
184
184
|
- `--zn-transition-medium`: Transition duration for color changes
|
|
185
185
|
- `--zn-transition-fast`: Transition duration for interactions
|
|
186
|
-
- `--zn-border-radius
|
|
186
|
+
- `--zn-border-radius`: Border radius
|
|
187
187
|
|
|
188
188
|
### CSS Parts
|
|
189
189
|
|
|
@@ -11,7 +11,7 @@ import ZincElement from '../../internal/zinc-element';
|
|
|
11
11
|
import ZnDropdown from "../dropdown";
|
|
12
12
|
import ZnIcon from "../icon";
|
|
13
13
|
import ZnTooltip from "../tooltip";
|
|
14
|
-
import type {IconColor} from "../icon";
|
|
14
|
+
import type {IconColor, IconLibrary} from "../icon";
|
|
15
15
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
16
16
|
|
|
17
17
|
import styles from './button.scss';
|
|
@@ -67,7 +67,22 @@ export default class ZnButton extends ZincElement implements ZincFormControl {
|
|
|
67
67
|
@property({type: Boolean}) disabled = false;
|
|
68
68
|
@property({type: Boolean}) grow = false;
|
|
69
69
|
@property({type: Boolean}) square = false;
|
|
70
|
-
|
|
70
|
+
/** Renders the button as an icon button (40x36). Pass `small` for the
|
|
71
|
+
* 36x36 variant or `round` for a 36x36 circle: `icon-button`,
|
|
72
|
+
* `icon-button="small"` or `icon-button="round"`. */
|
|
73
|
+
@property({
|
|
74
|
+
attribute: 'icon-button',
|
|
75
|
+
converter: {
|
|
76
|
+
fromAttribute: (value: string | null) => (value === 'small' || value === 'round') ? value : value !== null,
|
|
77
|
+
toAttribute: (value: boolean | 'small' | 'round') =>
|
|
78
|
+
(value === 'small' || value === 'round') ? value : (value ? '' : null)
|
|
79
|
+
}
|
|
80
|
+
}) iconButton: boolean | 'small' | 'round' = false;
|
|
81
|
+
/** With `icon-button`, removes the white background and border while
|
|
82
|
+
* keeping the button's size. */
|
|
83
|
+
@property({type: Boolean}) plain = false;
|
|
84
|
+
/** Disables the hover background, for contexts where the tint doesn't fit. */
|
|
85
|
+
@property({type: Boolean, attribute: 'no-hover'}) noHover = false;
|
|
71
86
|
@property({type: Boolean, attribute: 'panel-bg'}) panelBackground = false;
|
|
72
87
|
|
|
73
88
|
@property({attribute: 'dropdown-closer', type: Boolean}) dropdownCloser = false;
|
|
@@ -83,6 +98,8 @@ export default class ZnButton extends ZincElement implements ZincFormControl {
|
|
|
83
98
|
@property({attribute: "icon-position"}) iconPosition: 'left' | 'right' = 'left';
|
|
84
99
|
@property({attribute: "icon-size"}) iconSize: string;
|
|
85
100
|
@property({attribute: "icon-color"}) iconColor: IconColor;
|
|
101
|
+
@property({attribute: "icon-fill"}) iconFill: IconColor;
|
|
102
|
+
@property({attribute: "icon-library"}) iconLibrary: IconLibrary;
|
|
86
103
|
@property() type: 'button' | 'submit' | 'reset';
|
|
87
104
|
|
|
88
105
|
@property() name: string;
|
|
@@ -259,7 +276,7 @@ export default class ZnButton extends ZincElement implements ZincFormControl {
|
|
|
259
276
|
case 'primary':
|
|
260
277
|
return 'rgb(var(--zn-primary))';
|
|
261
278
|
case 'secondary':
|
|
262
|
-
return 'var(--zn-
|
|
279
|
+
return 'rgb(var(--zn-text))';
|
|
263
280
|
case 'error':
|
|
264
281
|
return 'rgb(var(--zn-color-error))';
|
|
265
282
|
case 'info':
|
|
@@ -348,7 +365,8 @@ export default class ZnButton extends ZincElement implements ZincFormControl {
|
|
|
348
365
|
const showCancel = this.loading && this.autoClick;
|
|
349
366
|
const icon = this.icon && !this.loading ? html`
|
|
350
367
|
<zn-icon part="icon" src="${this.icon}" id="xy2" size="${this.iconSize ? this.iconSize : 20}"
|
|
351
|
-
color="${ifDefined(this.iconColor)}"
|
|
368
|
+
color="${ifDefined(this.iconColor)}" fill="${ifDefined(this.iconFill)}"
|
|
369
|
+
library="${ifDefined(this.iconLibrary)}"></zn-icon>`
|
|
352
370
|
: '';
|
|
353
371
|
const tag = isLink ? literal`a` : literal`button`;
|
|
354
372
|
const iconButtonStyles = this.iconButton ? {
|
|
@@ -372,7 +390,11 @@ export default class ZnButton extends ZincElement implements ZincFormControl {
|
|
|
372
390
|
'button--star': this.color === 'star',
|
|
373
391
|
'button--outline': this.outline,
|
|
374
392
|
'button--text': (this.text && !this.outline),
|
|
375
|
-
'button--icon-button': this.iconButton,
|
|
393
|
+
'button--icon-button': !!this.iconButton,
|
|
394
|
+
'button--plain': !!this.iconButton && this.plain,
|
|
395
|
+
'button--no-hover': this.noHover,
|
|
396
|
+
'button--icon-button-small': this.iconButton === 'small',
|
|
397
|
+
'button--icon-button-round': this.iconButton === 'round',
|
|
376
398
|
'button--grow': this.grow,
|
|
377
399
|
'button--standard': !this.outline && !this.text,
|
|
378
400
|
'button--with-icon': this.icon,
|
|
@@ -50,18 +50,13 @@
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
.button.button--icon-button {
|
|
54
|
-
max-height: 20px;
|
|
55
|
-
height: 20px;
|
|
56
|
-
min-height: 20px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
53
|
.button.button--muted-notification {
|
|
60
54
|
--notification-color: rgb(var(--zn-color-info));
|
|
61
55
|
}
|
|
62
56
|
|
|
63
57
|
.button--has-notification {
|
|
64
58
|
position: relative;
|
|
59
|
+
overflow: visible;
|
|
65
60
|
|
|
66
61
|
&::after {
|
|
67
62
|
content: attr(data-notification);
|
|
@@ -69,25 +64,30 @@
|
|
|
69
64
|
display: flex;
|
|
70
65
|
justify-content: center;
|
|
71
66
|
align-items: center;
|
|
72
|
-
top:
|
|
67
|
+
top: -4px;
|
|
73
68
|
left: auto;
|
|
74
|
-
inset-inline-end:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
inset-inline-end: -4px;
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
min-width: 13px;
|
|
72
|
+
height: 13px;
|
|
73
|
+
padding: 0 3px;
|
|
74
|
+
border-radius: 999px;
|
|
75
|
+
font-size: var(--zn-text-notification-font-size);
|
|
76
|
+
font-weight: var(--zn-text-notification-font-weight);
|
|
77
|
+
line-height: var(--zn-text-notification-line-height);
|
|
78
|
+
color: var(--zn-text-notification-color);
|
|
80
79
|
background-color: var(--notification-color);
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
|
|
84
83
|
.button--has-notification.button--notification-dot {
|
|
85
|
-
|
|
84
|
+
&::after {
|
|
86
85
|
content: '';
|
|
87
|
-
width:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
min-width: 0;
|
|
87
|
+
width: 8px;
|
|
88
|
+
height: 8px;
|
|
89
|
+
padding: 0;
|
|
90
|
+
border-radius: 50%;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -244,19 +244,33 @@
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
|
|
247
|
+
/**
|
|
248
|
+
* Icon buttons
|
|
249
|
+
*
|
|
250
|
+
* Standard: 40x36, white background, 1px border, 6px radius
|
|
251
|
+
* Small: 36x36 (`icon-button="small"`)
|
|
252
|
+
* Plain: either size without the background and border (`plain`)
|
|
253
|
+
*
|
|
254
|
+
* Doubled-up selector so the icon-button design out-cascades the color
|
|
255
|
+
* variant combos (.button--standard.button--secondary etc.)
|
|
256
|
+
*/
|
|
257
|
+
.button.button--icon-button {
|
|
248
258
|
--icon-button-color: rgb(var(--zn-text));
|
|
249
259
|
--icon-button-hover-color: rgb(var(--zn-primary));
|
|
250
260
|
|
|
251
|
-
|
|
252
|
-
|
|
261
|
+
width: 40px;
|
|
262
|
+
min-width: 40px;
|
|
263
|
+
height: 36px;
|
|
264
|
+
min-height: 36px;
|
|
265
|
+
max-height: 36px;
|
|
266
|
+
padding: 6px;
|
|
267
|
+
margin: 0;
|
|
268
|
+
background: rgb(var(--zn-panel));
|
|
269
|
+
border-color: var(--zn-button-border-color, rgb(var(--zn-border-color))) !important;
|
|
270
|
+
border-radius: var(--zn-border-radius);
|
|
253
271
|
color: var(--icon-button-color);
|
|
254
272
|
font-weight: inherit;
|
|
255
273
|
line-height: 0;
|
|
256
|
-
margin: 0;
|
|
257
|
-
min-width: 0;
|
|
258
|
-
padding: 0;
|
|
259
|
-
width: auto;
|
|
260
274
|
|
|
261
275
|
zn-icon,
|
|
262
276
|
::slotted(zn-icon) {
|
|
@@ -266,15 +280,57 @@
|
|
|
266
280
|
line-height: 0;
|
|
267
281
|
}
|
|
268
282
|
|
|
283
|
+
// Hovers tint the background only — the icon keeps its set colour
|
|
269
284
|
&:hover:not([disabled]), &:active:not([disabled]) {
|
|
285
|
+
background: rgba(var(--zn-color-tab), 0.5);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
&.button--icon-button-small {
|
|
289
|
+
width: 36px;
|
|
290
|
+
min-width: 36px;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Round: 36x36 circle on the tab tint, muted icon by default
|
|
294
|
+
&.button--icon-button-round {
|
|
295
|
+
width: 36px;
|
|
296
|
+
min-width: 36px;
|
|
297
|
+
padding: 8px;
|
|
298
|
+
background: rgb(var(--zn-color-tab));
|
|
299
|
+
border-color: var(--zn-button-border-color, transparent) !important;
|
|
300
|
+
border-radius: var(--zn-border-radius-circle);
|
|
301
|
+
|
|
302
|
+
&:hover:not([disabled]), &:active:not([disabled]) {
|
|
303
|
+
background: rgb(var(--zn-color-border));
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
&.button--plain {
|
|
270
308
|
background: transparent;
|
|
271
|
-
color: var(--
|
|
309
|
+
border-color: var(--zn-button-border-color, transparent) !important;
|
|
310
|
+
|
|
311
|
+
&:hover:not([disabled]), &:active:not([disabled]) {
|
|
312
|
+
background: rgb(var(--zn-color-tab));
|
|
313
|
+
}
|
|
272
314
|
}
|
|
273
|
-
}
|
|
274
315
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
316
|
+
// `no-hover`: keep the resting background on hover/active
|
|
317
|
+
&.button--no-hover {
|
|
318
|
+
&:hover:not([disabled]), &:active:not([disabled]) {
|
|
319
|
+
background: rgb(var(--zn-panel));
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
&.button--plain:hover:not([disabled]), &.button--plain:active:not([disabled]) {
|
|
323
|
+
background: transparent;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
&.button--has-notification::after {
|
|
328
|
+
--icon-inset: calc((100% - var(--notification-icon-size, 20px)) / 2);
|
|
329
|
+
|
|
330
|
+
top: calc(var(--icon-inset) - 4px);
|
|
331
|
+
inset-inline-end: calc(var(--icon-inset) - 4px);
|
|
332
|
+
transform: translate(50%, -50%);
|
|
333
|
+
}
|
|
278
334
|
}
|
|
279
335
|
|
|
280
336
|
.button--loading-bg {
|