@knime/kds-components 0.31.4 → 1.0.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/CHANGELOG.md +18 -0
- package/dist/index.css +38 -38
- package/dist/index.js +235 -74
- package/dist/index.js.map +1 -1
- package/dist/src/patterns/ResponsiveButtonGroup/KdsResponsiveButtonGroup.vue.d.ts +37 -91
- package/dist/src/patterns/ResponsiveButtonGroup/KdsResponsiveButtonGroup.vue.d.ts.map +1 -1
- package/dist/src/patterns/ResponsiveButtonGroup/mapping.d.ts +150 -0
- package/dist/src/patterns/ResponsiveButtonGroup/mapping.d.ts.map +1 -0
- package/dist/src/patterns/ResponsiveButtonGroup/types.d.ts +93 -8
- package/dist/src/patterns/ResponsiveButtonGroup/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,65 +1,11 @@
|
|
|
1
|
-
import { nextTick } from 'vue';
|
|
1
|
+
import { ComponentPublicInstance, nextTick } from 'vue';
|
|
2
|
+
import { KdsIconName } from '../../accessories/Icon/types';
|
|
3
|
+
import { KdsMenuItem } from '../../containers/MenuContainer/types';
|
|
2
4
|
import { KdsResponsiveButtonGroupProps } from './types';
|
|
3
|
-
declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
|
-
buttonClick: (id: string) => any;
|
|
5
|
-
}, string, import('vue').PublicProps, Readonly<KdsResponsiveButtonGroupProps> & Readonly<{
|
|
6
|
-
onButtonClick?: ((id: string) => any) | undefined;
|
|
7
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
5
|
+
declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<KdsResponsiveButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
8
6
|
measureContainer: HTMLDivElement;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
title?: string;
|
|
13
|
-
variant?: import('../..').KdsButtonVariant | undefined;
|
|
14
|
-
} & {
|
|
15
|
-
label: string;
|
|
16
|
-
leadingIcon?: import('../..').KdsIconName;
|
|
17
|
-
trailingIcon?: import('../..').KdsIconName;
|
|
18
|
-
ariaLabel?: never;
|
|
19
|
-
} & import('../../buttons/types').WithDestructive) | (import('../../types/testId').WithTestId & {
|
|
20
|
-
size?: import('../..').KdsButtonSize;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
title?: string;
|
|
23
|
-
variant?: import('../..').KdsButtonVariant | undefined;
|
|
24
|
-
} & {
|
|
25
|
-
label?: never;
|
|
26
|
-
leadingIcon: import('../..').KdsIconName;
|
|
27
|
-
trailingIcon?: never;
|
|
28
|
-
ariaLabel: string;
|
|
29
|
-
} & import('../../buttons/types').WithDestructive)> & Readonly<{
|
|
30
|
-
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
31
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
32
|
-
click: (event: MouseEvent) => any;
|
|
33
|
-
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
34
|
-
P: {};
|
|
35
|
-
B: {};
|
|
36
|
-
D: {};
|
|
37
|
-
C: {};
|
|
38
|
-
M: {};
|
|
39
|
-
Defaults: {};
|
|
40
|
-
}, {} & (Readonly<(import('../../types/testId').WithTestId & {
|
|
41
|
-
size?: import('../..').KdsButtonSize;
|
|
42
|
-
disabled?: boolean;
|
|
43
|
-
title?: string;
|
|
44
|
-
variant?: import('../..').KdsButtonVariant | undefined;
|
|
45
|
-
} & {
|
|
46
|
-
label: string;
|
|
47
|
-
leadingIcon?: import('../..').KdsIconName;
|
|
48
|
-
trailingIcon?: import('../..').KdsIconName;
|
|
49
|
-
ariaLabel?: never;
|
|
50
|
-
} & import('../../buttons/types').WithDestructive) | (import('../../types/testId').WithTestId & {
|
|
51
|
-
size?: import('../..').KdsButtonSize;
|
|
52
|
-
disabled?: boolean;
|
|
53
|
-
title?: string;
|
|
54
|
-
variant?: import('../..').KdsButtonVariant | undefined;
|
|
55
|
-
} & {
|
|
56
|
-
label?: never;
|
|
57
|
-
leadingIcon: import('../..').KdsIconName;
|
|
58
|
-
trailingIcon?: never;
|
|
59
|
-
ariaLabel: string;
|
|
60
|
-
} & import('../../buttons/types').WithDestructive)> & Readonly<{
|
|
61
|
-
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
62
|
-
}>), {}, {}, {}, {}, {}> | null)[];
|
|
7
|
+
measureFullEntry: unknown;
|
|
8
|
+
measureIconEntry: unknown;
|
|
63
9
|
measureMenuButton: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<({
|
|
64
10
|
modelValue?: boolean;
|
|
65
11
|
} & import('../../types/testId').WithTestId & {
|
|
@@ -69,11 +15,11 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
69
15
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
70
16
|
} & {
|
|
71
17
|
label: string;
|
|
72
|
-
leadingIcon?:
|
|
73
|
-
trailingIcon?:
|
|
18
|
+
leadingIcon?: KdsIconName;
|
|
19
|
+
trailingIcon?: KdsIconName;
|
|
74
20
|
ariaLabel?: never;
|
|
75
21
|
} & {
|
|
76
|
-
items:
|
|
22
|
+
items: KdsMenuItem[];
|
|
77
23
|
menuMaxHeight?: string;
|
|
78
24
|
}) | ({
|
|
79
25
|
modelValue?: boolean;
|
|
@@ -84,11 +30,11 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
84
30
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
85
31
|
} & {
|
|
86
32
|
label?: never;
|
|
87
|
-
leadingIcon:
|
|
33
|
+
leadingIcon: KdsIconName;
|
|
88
34
|
trailingIcon?: never;
|
|
89
35
|
ariaLabel: string;
|
|
90
36
|
} & {
|
|
91
|
-
items:
|
|
37
|
+
items: KdsMenuItem[];
|
|
92
38
|
menuMaxHeight?: string;
|
|
93
39
|
})> & Readonly<{
|
|
94
40
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
@@ -103,8 +49,8 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
103
49
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
104
50
|
} & {
|
|
105
51
|
label: string;
|
|
106
|
-
leadingIcon?:
|
|
107
|
-
trailingIcon?:
|
|
52
|
+
leadingIcon?: KdsIconName;
|
|
53
|
+
trailingIcon?: KdsIconName;
|
|
108
54
|
ariaLabel?: never;
|
|
109
55
|
}) | ({
|
|
110
56
|
modelValue?: boolean;
|
|
@@ -115,7 +61,7 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
115
61
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
116
62
|
} & {
|
|
117
63
|
label?: never;
|
|
118
|
-
leadingIcon:
|
|
64
|
+
leadingIcon: KdsIconName;
|
|
119
65
|
trailingIcon?: never;
|
|
120
66
|
ariaLabel: string;
|
|
121
67
|
})> & Readonly<{
|
|
@@ -138,8 +84,8 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
138
84
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
139
85
|
} & {
|
|
140
86
|
label: string;
|
|
141
|
-
leadingIcon?:
|
|
142
|
-
trailingIcon?:
|
|
87
|
+
leadingIcon?: KdsIconName;
|
|
88
|
+
trailingIcon?: KdsIconName;
|
|
143
89
|
ariaLabel?: never;
|
|
144
90
|
}) | ({
|
|
145
91
|
modelValue?: boolean;
|
|
@@ -150,7 +96,7 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
150
96
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
151
97
|
} & {
|
|
152
98
|
label?: never;
|
|
153
|
-
leadingIcon:
|
|
99
|
+
leadingIcon: KdsIconName;
|
|
154
100
|
trailingIcon?: never;
|
|
155
101
|
ariaLabel: string;
|
|
156
102
|
})> & Readonly<{
|
|
@@ -169,8 +115,8 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
169
115
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
170
116
|
} & {
|
|
171
117
|
label: string;
|
|
172
|
-
leadingIcon?:
|
|
173
|
-
trailingIcon?:
|
|
118
|
+
leadingIcon?: KdsIconName;
|
|
119
|
+
trailingIcon?: KdsIconName;
|
|
174
120
|
ariaLabel?: never;
|
|
175
121
|
}) | ({
|
|
176
122
|
modelValue?: boolean;
|
|
@@ -181,7 +127,7 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
181
127
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
182
128
|
} & {
|
|
183
129
|
label?: never;
|
|
184
|
-
leadingIcon:
|
|
130
|
+
leadingIcon: KdsIconName;
|
|
185
131
|
trailingIcon?: never;
|
|
186
132
|
ariaLabel: string;
|
|
187
133
|
})> & Readonly<{
|
|
@@ -204,8 +150,8 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
204
150
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
205
151
|
} & {
|
|
206
152
|
label: string;
|
|
207
|
-
leadingIcon?:
|
|
208
|
-
trailingIcon?:
|
|
153
|
+
leadingIcon?: KdsIconName;
|
|
154
|
+
trailingIcon?: KdsIconName;
|
|
209
155
|
ariaLabel?: never;
|
|
210
156
|
}) | ({
|
|
211
157
|
modelValue?: boolean;
|
|
@@ -216,7 +162,7 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
216
162
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
217
163
|
} & {
|
|
218
164
|
label?: never;
|
|
219
|
-
leadingIcon:
|
|
165
|
+
leadingIcon: KdsIconName;
|
|
220
166
|
trailingIcon?: never;
|
|
221
167
|
ariaLabel: string;
|
|
222
168
|
})> & Readonly<{
|
|
@@ -258,8 +204,8 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
258
204
|
$slots: Readonly<{
|
|
259
205
|
[name: string]: import('vue').Slot<any> | undefined;
|
|
260
206
|
}>;
|
|
261
|
-
$root:
|
|
262
|
-
$parent:
|
|
207
|
+
$root: ComponentPublicInstance | null;
|
|
208
|
+
$parent: ComponentPublicInstance | null;
|
|
263
209
|
$host: Element | null;
|
|
264
210
|
$emit: (event: "update:modelValue", value: boolean) => void;
|
|
265
211
|
$el: HTMLDivElement;
|
|
@@ -310,7 +256,7 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
310
256
|
unmounted?: (() => void) | (() => void)[];
|
|
311
257
|
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
312
258
|
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
313
|
-
errorCaptured?: ((err: unknown, instance:
|
|
259
|
+
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
314
260
|
};
|
|
315
261
|
$forceUpdate: () => void;
|
|
316
262
|
$nextTick: typeof nextTick;
|
|
@@ -386,11 +332,11 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
386
332
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
387
333
|
} & {
|
|
388
334
|
label: string;
|
|
389
|
-
leadingIcon?:
|
|
390
|
-
trailingIcon?:
|
|
335
|
+
leadingIcon?: KdsIconName;
|
|
336
|
+
trailingIcon?: KdsIconName;
|
|
391
337
|
ariaLabel?: never;
|
|
392
338
|
} & {
|
|
393
|
-
items:
|
|
339
|
+
items: KdsMenuItem[];
|
|
394
340
|
menuMaxHeight?: string;
|
|
395
341
|
}) | ({
|
|
396
342
|
modelValue?: boolean;
|
|
@@ -401,11 +347,11 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
401
347
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
402
348
|
} & {
|
|
403
349
|
label?: never;
|
|
404
|
-
leadingIcon:
|
|
350
|
+
leadingIcon: KdsIconName;
|
|
405
351
|
trailingIcon?: never;
|
|
406
352
|
ariaLabel: string;
|
|
407
353
|
} & {
|
|
408
|
-
items:
|
|
354
|
+
items: KdsMenuItem[];
|
|
409
355
|
menuMaxHeight?: string;
|
|
410
356
|
})> & Readonly<{
|
|
411
357
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
@@ -420,8 +366,8 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
420
366
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
421
367
|
} & {
|
|
422
368
|
label: string;
|
|
423
|
-
leadingIcon?:
|
|
424
|
-
trailingIcon?:
|
|
369
|
+
leadingIcon?: KdsIconName;
|
|
370
|
+
trailingIcon?: KdsIconName;
|
|
425
371
|
ariaLabel?: never;
|
|
426
372
|
}) | ({
|
|
427
373
|
modelValue?: boolean;
|
|
@@ -432,7 +378,7 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
432
378
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
433
379
|
} & {
|
|
434
380
|
label?: never;
|
|
435
|
-
leadingIcon:
|
|
381
|
+
leadingIcon: KdsIconName;
|
|
436
382
|
trailingIcon?: never;
|
|
437
383
|
ariaLabel: string;
|
|
438
384
|
})> & Readonly<{
|
|
@@ -455,8 +401,8 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
455
401
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
456
402
|
} & {
|
|
457
403
|
label: string;
|
|
458
|
-
leadingIcon?:
|
|
459
|
-
trailingIcon?:
|
|
404
|
+
leadingIcon?: KdsIconName;
|
|
405
|
+
trailingIcon?: KdsIconName;
|
|
460
406
|
ariaLabel?: never;
|
|
461
407
|
}) | ({
|
|
462
408
|
modelValue?: boolean;
|
|
@@ -467,7 +413,7 @@ declare const _default: import('vue').DefineComponent<KdsResponsiveButtonGroupPr
|
|
|
467
413
|
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
468
414
|
} & {
|
|
469
415
|
label?: never;
|
|
470
|
-
leadingIcon:
|
|
416
|
+
leadingIcon: KdsIconName;
|
|
471
417
|
trailingIcon?: never;
|
|
472
418
|
ariaLabel: string;
|
|
473
419
|
})> & Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KdsResponsiveButtonGroup.vue.d.ts","sourceRoot":"","sources":["../../../../src/patterns/ResponsiveButtonGroup/KdsResponsiveButtonGroup.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KdsResponsiveButtonGroup.vue.d.ts","sourceRoot":"","sources":["../../../../src/patterns/ResponsiveButtonGroup/KdsResponsiveButtonGroup.vue"],"names":[],"mappings":"AA4UA,OAAO,EACL,KAAK,uBAAuB,EAE5B,QAAQ,EAKT,MAAM,KAAK,CAAC;AAGb,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AASxE,OAAO,KAAK,EAEV,6BAA6B,EAC9B,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwY8/G,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAfroH,wBAOG"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { KdsIconName } from '../../accessories/Icon/types';
|
|
3
|
+
import { KdsMenuItem } from '../../containers/MenuContainer/types';
|
|
4
|
+
import { KdsResponsiveButtonGroupButton } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Maps an entry's `type` to the Vue component used to render it. Drives the
|
|
7
|
+
* `<component :is>` lookup in `KdsResponsiveButtonGroup.vue`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const typeToComponent: Record<KdsResponsiveButtonGroupButton["type"], Component>;
|
|
10
|
+
/** Bindings for a full-width (label + icons) render. */
|
|
11
|
+
export declare const fullBindings: (entry: KdsResponsiveButtonGroupButton) => {
|
|
12
|
+
title?: string | undefined;
|
|
13
|
+
label: string;
|
|
14
|
+
ariaLabel?: never | undefined;
|
|
15
|
+
disabled?: boolean | undefined;
|
|
16
|
+
variant?: import('../..').KdsButtonVariant | undefined;
|
|
17
|
+
dataTestId?: string | undefined;
|
|
18
|
+
trailingIcon?: KdsIconName | undefined;
|
|
19
|
+
destructive?: boolean | undefined;
|
|
20
|
+
leadingIcon: KdsIconName;
|
|
21
|
+
} | {
|
|
22
|
+
title?: string | undefined;
|
|
23
|
+
label: string;
|
|
24
|
+
ariaLabel?: never | undefined;
|
|
25
|
+
disabled?: boolean | undefined;
|
|
26
|
+
target?: (import('../../types/linkTypes').LiteralUnion<"_blank" | "_parent" | "_self" | "_top"> | null) | undefined;
|
|
27
|
+
variant?: import('../..').KdsButtonVariant | undefined;
|
|
28
|
+
dataTestId?: string | undefined;
|
|
29
|
+
trailingIcon?: KdsIconName | undefined;
|
|
30
|
+
destructive?: boolean | undefined;
|
|
31
|
+
to: string;
|
|
32
|
+
download?: boolean | undefined;
|
|
33
|
+
rel?: (import('../../types/linkTypes').LiteralUnion<"noopener" | "noreferrer" | "nofollow" | "sponsored" | "ugc"> | null) | undefined;
|
|
34
|
+
leadingIcon: KdsIconName;
|
|
35
|
+
} | {
|
|
36
|
+
title?: string | undefined;
|
|
37
|
+
label: string;
|
|
38
|
+
ariaLabel?: never | undefined;
|
|
39
|
+
disabled?: boolean | undefined;
|
|
40
|
+
variant?: import('../..').KdsButtonVariant | undefined;
|
|
41
|
+
dataTestId?: string | undefined;
|
|
42
|
+
trailingIcon?: KdsIconName | undefined;
|
|
43
|
+
items: KdsMenuItem[];
|
|
44
|
+
menuMaxHeight?: string | undefined;
|
|
45
|
+
leadingIcon: KdsIconName;
|
|
46
|
+
} | {
|
|
47
|
+
title?: string | undefined;
|
|
48
|
+
label: string;
|
|
49
|
+
ariaLabel?: never | undefined;
|
|
50
|
+
disabled?: boolean | undefined;
|
|
51
|
+
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
52
|
+
dataTestId?: string | undefined;
|
|
53
|
+
trailingIcon?: KdsIconName | undefined;
|
|
54
|
+
items: KdsMenuItem[];
|
|
55
|
+
menuMaxHeight?: string | undefined;
|
|
56
|
+
leadingIcon: KdsIconName;
|
|
57
|
+
} | {
|
|
58
|
+
title?: string | undefined;
|
|
59
|
+
label: string;
|
|
60
|
+
ariaLabel?: never | undefined;
|
|
61
|
+
disabled?: boolean | undefined;
|
|
62
|
+
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
63
|
+
dataTestId?: string | undefined;
|
|
64
|
+
trailingIcon?: KdsIconName | undefined;
|
|
65
|
+
modelValue?: boolean | undefined;
|
|
66
|
+
leadingIcon: KdsIconName;
|
|
67
|
+
} | {
|
|
68
|
+
title?: string | undefined;
|
|
69
|
+
label: string;
|
|
70
|
+
ariaLabel?: never | undefined;
|
|
71
|
+
disabled?: boolean | undefined;
|
|
72
|
+
variant?: import('../..').KdsButtonVariant | undefined;
|
|
73
|
+
dataTestId?: string | undefined;
|
|
74
|
+
trailingIcon?: KdsIconName | undefined;
|
|
75
|
+
destructive?: boolean | undefined;
|
|
76
|
+
leadingIcon?: never;
|
|
77
|
+
} | {
|
|
78
|
+
title?: string | undefined;
|
|
79
|
+
label: string;
|
|
80
|
+
ariaLabel?: never | undefined;
|
|
81
|
+
disabled?: boolean | undefined;
|
|
82
|
+
target?: (import('../../types/linkTypes').LiteralUnion<"_blank" | "_parent" | "_self" | "_top"> | null) | undefined;
|
|
83
|
+
variant?: import('../..').KdsButtonVariant | undefined;
|
|
84
|
+
dataTestId?: string | undefined;
|
|
85
|
+
trailingIcon?: KdsIconName | undefined;
|
|
86
|
+
destructive?: boolean | undefined;
|
|
87
|
+
to: string;
|
|
88
|
+
download?: boolean | undefined;
|
|
89
|
+
rel?: (import('../../types/linkTypes').LiteralUnion<"noopener" | "noreferrer" | "nofollow" | "sponsored" | "ugc"> | null) | undefined;
|
|
90
|
+
leadingIcon?: never;
|
|
91
|
+
} | {
|
|
92
|
+
title?: string | undefined;
|
|
93
|
+
label: string;
|
|
94
|
+
ariaLabel?: never | undefined;
|
|
95
|
+
disabled?: boolean | undefined;
|
|
96
|
+
variant?: import('../..').KdsButtonVariant | undefined;
|
|
97
|
+
dataTestId?: string | undefined;
|
|
98
|
+
trailingIcon?: KdsIconName | undefined;
|
|
99
|
+
items: KdsMenuItem[];
|
|
100
|
+
menuMaxHeight?: string | undefined;
|
|
101
|
+
leadingIcon?: never;
|
|
102
|
+
} | {
|
|
103
|
+
title?: string | undefined;
|
|
104
|
+
label: string;
|
|
105
|
+
ariaLabel?: never | undefined;
|
|
106
|
+
disabled?: boolean | undefined;
|
|
107
|
+
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
108
|
+
dataTestId?: string | undefined;
|
|
109
|
+
trailingIcon?: KdsIconName | undefined;
|
|
110
|
+
items: KdsMenuItem[];
|
|
111
|
+
menuMaxHeight?: string | undefined;
|
|
112
|
+
leadingIcon?: never;
|
|
113
|
+
} | {
|
|
114
|
+
title?: string | undefined;
|
|
115
|
+
label: string;
|
|
116
|
+
ariaLabel?: never | undefined;
|
|
117
|
+
disabled?: boolean | undefined;
|
|
118
|
+
variant?: import('../..').KdsButtonVariant | undefined;
|
|
119
|
+
leadingIcon: KdsIconName;
|
|
120
|
+
dataTestId?: string | undefined;
|
|
121
|
+
state?: import('../..').KdsProgressButtonState | undefined;
|
|
122
|
+
} | {
|
|
123
|
+
title?: string | undefined;
|
|
124
|
+
label: string;
|
|
125
|
+
ariaLabel?: never | undefined;
|
|
126
|
+
disabled?: boolean | undefined;
|
|
127
|
+
variant?: import('../..').KdsToggleButtonVariant | undefined;
|
|
128
|
+
dataTestId?: string | undefined;
|
|
129
|
+
trailingIcon?: KdsIconName | undefined;
|
|
130
|
+
modelValue?: boolean | undefined;
|
|
131
|
+
leadingIcon?: never;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Bindings for the icon-only render of an icon-capable entry: drops `label`
|
|
135
|
+
* and `trailingIcon`, promotes the label to `ariaLabel` and (when no
|
|
136
|
+
* explicit `title` is set) to `title`.
|
|
137
|
+
*/
|
|
138
|
+
export declare const iconOnlyBindings: (entry: KdsResponsiveButtonGroupButton, leadingIcon: KdsIconName, ariaLabel: string) => {
|
|
139
|
+
leadingIcon: "filter" | "link" | "menu" | "table" | "time" | "stop" | "text" | "key" | "add-user" | "ai-general" | "annotation-mode" | "arrow-down" | "arrow-up" | "arrows-expand" | "arrows-move" | "arrows-order" | "auto-configure" | "back" | "bold" | "calendar" | "case-sensitive" | "cell-renderer" | "center-aligned" | "checkmark" | "chevron-down" | "chevron-left-double" | "chevron-left" | "chevron-right-double" | "chevron-right" | "chevron-up" | "circle-error" | "circle-info" | "circle-question" | "circle-success" | "circle-unchecked" | "cloud-download" | "cloud-knime" | "cloud-pending-changes" | "cloud-synced" | "cloud-upload" | "cloud-workflow" | "code-block" | "collection" | "color-picker" | "column-width" | "comment" | "component" | "connection" | "copy" | "cursor" | "data-app" | "data-value-view" | "date-time" | "db-browse" | "db-database" | "db-fetch" | "db-schema" | "db-table-view" | "db-table" | "deploy" | "detect" | "divider" | "duplicate" | "duration" | "edit" | "education" | "error-panel" | "execute-all" | "execute" | "expand-panel" | "extension-community" | "extension" | "external-link" | "eye" | "feedback" | "file-export" | "file-text" | "file" | "flow-variable-default" | "flow-variable-in-out" | "flow-variable-in" | "flow-variable-out" | "folder-move" | "folder-plus" | "folder-search" | "folder-workflow" | "folder" | "forum" | "function-catalog" | "hide-eye" | "home" | "import-table" | "import" | "info" | "interval" | "italic" | "layout-editor" | "left-aligned" | "like" | "limit" | "linked-component" | "linked-metanode" | "list-bulletpoint" | "list-number" | "list-thumbs" | "list" | "local-filesystem" | "lock" | "login" | "metanode" | "mini-map" | "minimize-dialog" | "minimize-side-panel" | "minus" | "more-actions" | "node-stack" | "nodes-align-horiz" | "nodes-align-vert" | "open-in-new-window" | "pan-mode" | "parameter" | "path-separator" | "pending-changes" | "pin" | "placeholder" | "plus" | "python" | "quote" | "random-seed" | "re-execution" | "redo" | "regex" | "reload" | "rename" | "replace" | "reset-all" | "resume-execution" | "right-aligned" | "rocket" | "save-as" | "save" | "schedule" | "search" | "secret-store" | "selected-cancel" | "selected-execution" | "selected-reset" | "send" | "server-rack-workflow" | "service" | "settings" | "share" | "shortcuts" | "sort-ascending" | "sort-descending" | "space-local" | "space-private" | "space" | "stepwise-execution" | "strikethrough" | "table-statistics" | "tag" | "team" | "template-gallery" | "textstyles" | "thumbs-down" | "thumbs-up" | "to-bottom" | "to-top" | "trash" | "trigger" | "underline" | "undo" | "unlink" | "update-file" | "usage" | "user" | "validate" | "version" | "view-cards" | "warning" | "workflow" | "x-close";
|
|
140
|
+
ariaLabel: string;
|
|
141
|
+
title: string;
|
|
142
|
+
};
|
|
143
|
+
export declare const isIconCapable: (entry: KdsResponsiveButtonGroupButton) => boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Map a `KdsResponsiveButtonGroupButton` to the `KdsMenuItem` form it takes
|
|
146
|
+
* when it has collapsed into the overflow menu. See the entry-type-specific
|
|
147
|
+
* comments in the switch body for details on each transform.
|
|
148
|
+
*/
|
|
149
|
+
export declare const toMenuItem: (entry: KdsResponsiveButtonGroupButton) => KdsMenuItem;
|
|
150
|
+
//# sourceMappingURL=mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../../src/patterns/ResponsiveButtonGroup/mapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAQhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,8BAA8B,CAAC,MAAM,CAAC,EACtC,SAAS,CAQV,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,YAAY,GAAI,OAAO,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEhE,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,8BAA8B,EACrC,aAAa,WAAW,EACxB,WAAW,MAAM;;;;CAoBlB,CAAC;AAKF,eAAO,MAAM,aAAa,GAAI,OAAO,8BAA8B,KAAG,OACd,CAAC;AASzD;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,8BAA8B,KACpC,WA8EF,CAAC"}
|
|
@@ -1,16 +1,101 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KdsIconName } from '../../accessories/Icon/types';
|
|
2
|
+
import { KdsButtonProps, KdsLinkButtonProps, KdsMenuButtonProps, KdsProgressButtonProps, KdsSplitButtonProps, KdsToggleButtonProps } from '../../buttons';
|
|
3
|
+
import { KdsProgressButtonState } from '../../buttons/KdsProgressButton/types';
|
|
2
4
|
import { kdsResponsiveButtonGroupAlignment } from './enums';
|
|
3
5
|
export type KdsResponsiveButtonGroupAlignment = (typeof kdsResponsiveButtonGroupAlignment)[keyof typeof kdsResponsiveButtonGroupAlignment];
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type ButtonPropMap = {
|
|
7
|
+
KdsButton: KdsButtonProps;
|
|
8
|
+
KdsLinkButton: KdsLinkButtonProps;
|
|
9
|
+
KdsSplitButton: KdsSplitButtonProps;
|
|
10
|
+
KdsMenuButton: KdsMenuButtonProps;
|
|
11
|
+
KdsProgressButton: KdsProgressButtonProps & {
|
|
12
|
+
state?: KdsProgressButtonState;
|
|
13
|
+
};
|
|
14
|
+
KdsToggleButton: KdsToggleButtonProps & {
|
|
15
|
+
modelValue?: boolean;
|
|
16
|
+
};
|
|
8
17
|
};
|
|
18
|
+
type EntryType = keyof ButtonPropMap;
|
|
19
|
+
type EntryMeta<T extends EntryType> = Omit<Extract<ButtonPropMap[T], {
|
|
20
|
+
label: string;
|
|
21
|
+
}>, "size">;
|
|
22
|
+
/**
|
|
23
|
+
* Splits a meta with an optional `leadingIcon` into two mutually exclusive
|
|
24
|
+
* branches:
|
|
25
|
+
*
|
|
26
|
+
* - icon-capable: `meta.leadingIcon` is required; `canBeIconOnly` defaults
|
|
27
|
+
* to true and may be set to false to opt out of icon-only collapse.
|
|
28
|
+
* - icon-incapable: `meta.leadingIcon` must be absent; `canBeIconOnly` must
|
|
29
|
+
* not be true (there is no icon to collapse to).
|
|
30
|
+
*/
|
|
31
|
+
type WithIconCollapse<TMeta> = {
|
|
32
|
+
/**
|
|
33
|
+
* If true (default), the entry drops its label and renders icon-only
|
|
34
|
+
* once the row needs to shrink. Only valid when `meta.leadingIcon` is
|
|
35
|
+
* set. The label is promoted to `title` (unless `meta.title` is set)
|
|
36
|
+
* and `ariaLabel`.
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
canBeIconOnly?: boolean;
|
|
40
|
+
meta: Omit<TMeta, "leadingIcon"> & {
|
|
41
|
+
leadingIcon: KdsIconName;
|
|
42
|
+
};
|
|
43
|
+
} | {
|
|
44
|
+
canBeIconOnly?: false;
|
|
45
|
+
meta: Omit<TMeta, "leadingIcon"> & {
|
|
46
|
+
leadingIcon?: never;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
type EntryHandler<E> = (entry: E, event: MouseEvent | KeyboardEvent) => void;
|
|
50
|
+
type ToggleEntryHandler<E> = (entry: E, nextValue: boolean) => void;
|
|
51
|
+
/**
|
|
52
|
+
* One responsive-button-group entry. Discriminates on `type`; the meta and
|
|
53
|
+
* handler shape are derived from there.
|
|
54
|
+
*
|
|
55
|
+
* `KdsProgressButton` always has a required `leadingIcon` (the underlying
|
|
56
|
+
* button forces it), so it skips `WithIconCollapse` — `canBeIconOnly`
|
|
57
|
+
* remains unconstrained.
|
|
58
|
+
*
|
|
59
|
+
* `KdsLinkButton` and `KdsMenuButton` have no entry-level handler: link
|
|
60
|
+
* activation is native, menu activation lives on `meta.items`.
|
|
61
|
+
*
|
|
62
|
+
* `KdsToggleButton`'s handler receives the next boolean value instead of a
|
|
63
|
+
* DOM event — the underlying button is fully controlled, so the consumer
|
|
64
|
+
* must update `meta.modelValue` from this callback for the toggle state to
|
|
65
|
+
* actually change.
|
|
66
|
+
*/
|
|
67
|
+
type Entry<T extends EntryType> = {
|
|
68
|
+
/** Stable identifier; used as the Vue v-for key and surfaced to consumers. */
|
|
69
|
+
id: string;
|
|
70
|
+
type: T;
|
|
71
|
+
/**
|
|
72
|
+
* If true (default), the entry is allowed to move into the overflow menu
|
|
73
|
+
* when the row runs out of space. Pinned (`false`) entries always render
|
|
74
|
+
* in the visible row.
|
|
75
|
+
* @default true
|
|
76
|
+
*/
|
|
77
|
+
canMoveToMenu?: boolean;
|
|
78
|
+
} & (T extends "KdsProgressButton" ? {
|
|
79
|
+
/**
|
|
80
|
+
* If true (default), the entry drops its label and renders icon-only
|
|
81
|
+
* once the row needs to shrink.
|
|
82
|
+
* @default true
|
|
83
|
+
*/
|
|
84
|
+
canBeIconOnly?: boolean;
|
|
85
|
+
meta: EntryMeta<T>;
|
|
86
|
+
} : WithIconCollapse<EntryMeta<T>>) & (T extends "KdsLinkButton" | "KdsMenuButton" ? {
|
|
87
|
+
handler?: never;
|
|
88
|
+
} : T extends "KdsToggleButton" ? {
|
|
89
|
+
handler: ToggleEntryHandler<Entry<T>>;
|
|
90
|
+
} : {
|
|
91
|
+
handler: EntryHandler<Entry<T>>;
|
|
92
|
+
});
|
|
93
|
+
export type KdsResponsiveButtonGroupButton = Entry<"KdsButton"> | Entry<"KdsLinkButton"> | Entry<"KdsSplitButton"> | Entry<"KdsMenuButton"> | Entry<"KdsProgressButton"> | Entry<"KdsToggleButton">;
|
|
9
94
|
export type KdsResponsiveButtonGroupProps = {
|
|
10
95
|
/**
|
|
11
|
-
* Array of button
|
|
12
|
-
*
|
|
13
|
-
*
|
|
96
|
+
* Array of button entries. Each entry declares the button `type` and a
|
|
97
|
+
* `meta` object carrying that type's props, plus optional flags controlling
|
|
98
|
+
* how the entry participates in responsive collapse.
|
|
14
99
|
*/
|
|
15
100
|
buttons: KdsResponsiveButtonGroupButton[];
|
|
16
101
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/patterns/ResponsiveButtonGroup/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/patterns/ResponsiveButtonGroup/types.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knime/kds-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Package containing basic Vue components of the KNIME Design System",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"motion": "^12.39.0",
|
|
41
41
|
"pretty-bytes": "^7.1.0",
|
|
42
42
|
"temporal-polyfill": "^0.3.2",
|
|
43
|
-
"@knime/kds-styles": "^0.
|
|
43
|
+
"@knime/kds-styles": "^1.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@storybook/vue3-vite": "^10.4.3",
|