@knime/kds-components 0.5.10 → 0.6.1

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 (51) hide show
  1. package/dist/Modal/KdsDynamicModalProvider.vue.d.ts.map +1 -1
  2. package/dist/Modal/useKdsDynamicModal.d.ts +5 -8
  3. package/dist/Modal/useKdsDynamicModal.d.ts.map +1 -1
  4. package/dist/buttons/BaseButton.vue.d.ts +18 -0
  5. package/dist/buttons/BaseButton.vue.d.ts.map +1 -0
  6. package/dist/buttons/KdsButton.vue.d.ts.map +1 -0
  7. package/dist/buttons/KdsInfoToggleButton.vue.d.ts +15 -0
  8. package/dist/buttons/KdsInfoToggleButton.vue.d.ts.map +1 -0
  9. package/dist/buttons/KdsLinkButton.vue.d.ts.map +1 -0
  10. package/dist/buttons/KdsProgressButton.vue.d.ts +3 -0
  11. package/dist/buttons/KdsProgressButton.vue.d.ts.map +1 -0
  12. package/dist/buttons/KdsToggleButton.vue.d.ts.map +1 -0
  13. package/dist/buttons/KdsVariableToggleButton.vue.d.ts +18 -0
  14. package/dist/buttons/KdsVariableToggleButton.vue.d.ts.map +1 -0
  15. package/dist/buttons/constants.d.ts.map +1 -0
  16. package/dist/buttons/index.d.ts +8 -0
  17. package/dist/buttons/index.d.ts.map +1 -0
  18. package/dist/{Button → buttons}/types.d.ts +58 -5
  19. package/dist/buttons/types.d.ts.map +1 -0
  20. package/dist/{Button/BaseButton.vue.d.ts → forms/Checkbox/BaseCheckbox.vue.d.ts} +1 -1
  21. package/dist/forms/Checkbox/BaseCheckbox.vue.d.ts.map +1 -0
  22. package/dist/forms/Checkbox/KdsCheckbox.vue.d.ts.map +1 -0
  23. package/dist/forms/Checkbox/KdsCheckboxGroup.vue.d.ts +15 -0
  24. package/dist/forms/Checkbox/KdsCheckboxGroup.vue.d.ts.map +1 -0
  25. package/dist/forms/Checkbox/types.d.ts +58 -0
  26. package/dist/forms/Checkbox/types.d.ts.map +1 -0
  27. package/dist/forms/KdsSubText.vue.d.ts.map +1 -1
  28. package/dist/forms/RadioButton/KdsRadioButton.vue.d.ts +1 -1
  29. package/dist/forms/RadioButton/KdsRadioButton.vue.d.ts.map +1 -1
  30. package/dist/forms/index.d.ts +3 -0
  31. package/dist/forms/index.d.ts.map +1 -1
  32. package/dist/index.css +458 -280
  33. package/dist/index.d.ts +4 -8
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +705 -336
  36. package/dist/index.js.map +1 -1
  37. package/package.json +4 -4
  38. package/dist/Button/BaseButton.vue.d.ts.map +0 -1
  39. package/dist/Button/KdsButton.vue.d.ts.map +0 -1
  40. package/dist/Button/KdsLinkButton.vue.d.ts.map +0 -1
  41. package/dist/Button/KdsToggleButton.vue.d.ts.map +0 -1
  42. package/dist/Button/constants.d.ts.map +0 -1
  43. package/dist/Button/types.d.ts.map +0 -1
  44. package/dist/Checkbox/KdsCheckbox.vue.d.ts.map +0 -1
  45. package/dist/Checkbox/types.d.ts +0 -35
  46. package/dist/Checkbox/types.d.ts.map +0 -1
  47. /package/dist/{Button → buttons}/KdsButton.vue.d.ts +0 -0
  48. /package/dist/{Button → buttons}/KdsLinkButton.vue.d.ts +0 -0
  49. /package/dist/{Button → buttons}/KdsToggleButton.vue.d.ts +0 -0
  50. /package/dist/{Button → buttons}/constants.d.ts +0 -0
  51. /package/dist/{Checkbox → forms/Checkbox}/KdsCheckbox.vue.d.ts +0 -0
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { shallowRef, watch, defineComponent, toRef, createBlock, createElementBlock, unref, openBlock, resolveDynamicComponent, normalizeClass, computed, withCtx, createCommentVNode, toDisplayString, mergeProps, h, useSlots, getCurrentInstance, mergeModels, useModel, useId, createElementVNode, mergeDefaults, useCssVars, Fragment, createVNode, renderSlot, useTemplateRef, nextTick, ref, withModifiers, createSlots, renderList, normalizeProps, guardReactiveProps, onBeforeUpdate } from 'vue';
1
+ import { shallowRef, watch, defineComponent, toRef, createBlock, createElementBlock, unref, openBlock, resolveDynamicComponent, normalizeClass, computed, withCtx, renderSlot, createCommentVNode, toDisplayString, mergeProps, mergeDefaults, useCssVars, Fragment, createElementVNode, createVNode, useTemplateRef, nextTick, ref, withModifiers, mergeModels, useModel, useId, createSlots, renderList, normalizeProps, guardReactiveProps, h, useSlots, getCurrentInstance, normalizeStyle, onBeforeUpdate } from 'vue';
2
2
  import { useLocalStorage, useDark, usePreferredDark, useResizeObserver, useElementSize } from '@vueuse/core';
3
3
 
4
4
  import './index.css';const __variableDynamicImportRuntimeHelper = (glob$1, path$13, segs) => {
@@ -35,7 +35,7 @@ const useIcon = ({
35
35
  return iconComponent;
36
36
  };
37
37
 
38
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
38
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
39
39
  __name: "KdsIcon",
40
40
  props: {
41
41
  name: {},
@@ -68,285 +68,7 @@ const _export_sfc = (sfc, props) => {
68
68
  return target;
69
69
  };
70
70
 
71
- const KdsIcon = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-d965b88c"]]);
72
-
73
- const _hoisted_1$c = {
74
- key: 1,
75
- class: "label"
76
- };
77
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
78
- __name: "BaseButton",
79
- props: {
80
- size: { default: "medium" },
81
- disabled: { type: Boolean, default: false },
82
- title: {},
83
- variant: {},
84
- label: {},
85
- leadingIcon: {},
86
- trailingIcon: {},
87
- ariaLabel: {},
88
- destructive: { type: Boolean, default: false },
89
- toggled: { type: Boolean, default: false },
90
- component: { default: "button" }
91
- },
92
- emits: ["click"],
93
- setup(__props, { emit: __emit }) {
94
- const props = __props;
95
- const emit = __emit;
96
- const classes = computed(() => [
97
- "button",
98
- props.size,
99
- props.variant,
100
- { destructive: props.destructive },
101
- { disabled: props.disabled },
102
- { toggled: props.toggled }
103
- ]);
104
- const iconSize = computed(() => {
105
- if (props.size === "xsmall") {
106
- return "small";
107
- } else {
108
- return props.size;
109
- }
110
- });
111
- function onClick(e) {
112
- if (!props.disabled) {
113
- emit("click", e);
114
- }
115
- }
116
- return (_ctx, _cache) => {
117
- return openBlock(), createBlock(resolveDynamicComponent(__props.component), {
118
- class: normalizeClass(classes.value),
119
- disabled: props.disabled,
120
- title: props.title,
121
- "aria-label": props.ariaLabel,
122
- onClick: _cache[0] || (_cache[0] = ($event) => onClick($event))
123
- }, {
124
- default: withCtx(() => [
125
- props.leadingIcon ? (openBlock(), createBlock(KdsIcon, {
126
- key: 0,
127
- name: props.leadingIcon,
128
- size: iconSize.value
129
- }, null, 8, ["name", "size"])) : createCommentVNode("", true),
130
- props.label ? (openBlock(), createElementBlock("span", _hoisted_1$c, toDisplayString(props.label), 1)) : createCommentVNode("", true),
131
- props.trailingIcon && props.label ? (openBlock(), createBlock(KdsIcon, {
132
- key: 2,
133
- name: props.trailingIcon,
134
- size: iconSize.value
135
- }, null, 8, ["name", "size"])) : createCommentVNode("", true)
136
- ]),
137
- _: 1
138
- }, 8, ["class", "disabled", "title", "aria-label"]);
139
- };
140
- }
141
- });
142
-
143
- const BaseButton = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-dd209f83"]]);
144
-
145
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
146
- __name: "KdsButton",
147
- props: {
148
- size: {},
149
- disabled: { type: Boolean },
150
- title: {},
151
- variant: { default: "filled" },
152
- label: {},
153
- leadingIcon: {},
154
- trailingIcon: {},
155
- ariaLabel: {},
156
- destructive: { type: Boolean }
157
- },
158
- emits: ["click"],
159
- setup(__props, { emit: __emit }) {
160
- const props = __props;
161
- const emit = __emit;
162
- return (_ctx, _cache) => {
163
- return openBlock(), createBlock(BaseButton, mergeProps(props, {
164
- onClick: _cache[0] || (_cache[0] = ($event) => emit("click", $event))
165
- }), null, 16);
166
- };
167
- }
168
- });
169
-
170
- const getAppInstance = () => {
171
- const currentInstance = getCurrentInstance();
172
- return currentInstance?.appContext.app;
173
- };
174
- const resolveNuxtLinkComponent = () => {
175
- const app = getAppInstance();
176
- const nuxtLinkComponent = app?.component("NuxtLink");
177
- if (nuxtLinkComponent) {
178
- return nuxtLinkComponent;
179
- }
180
- const routerLinkComponent = app?.component("RouterLink");
181
- if (routerLinkComponent) {
182
- return routerLinkComponent;
183
- }
184
- const fallbackComponent = defineComponent({
185
- props: {
186
- to: {
187
- type: String,
188
- default: ""
189
- }
190
- },
191
- render() {
192
- return h("a", { href: this.to }, [useSlots().default?.()]);
193
- }
194
- });
195
- return fallbackComponent;
196
- };
197
-
198
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
199
- __name: "KdsLinkButton",
200
- props: {
201
- size: {},
202
- disabled: { type: Boolean },
203
- title: {},
204
- variant: { default: "filled" },
205
- label: {},
206
- leadingIcon: {},
207
- trailingIcon: {},
208
- ariaLabel: {},
209
- destructive: { type: Boolean },
210
- to: {},
211
- download: { type: Boolean, default: void 0 },
212
- target: { default: null },
213
- rel: { default: null }
214
- },
215
- emits: ["click"],
216
- setup(__props, { emit: __emit }) {
217
- const props = __props;
218
- const component = computed(() => {
219
- if (props.disabled) {
220
- return "button";
221
- }
222
- return resolveNuxtLinkComponent();
223
- });
224
- const emit = __emit;
225
- return (_ctx, _cache) => {
226
- return openBlock(), createBlock(BaseButton, mergeProps(props, {
227
- component: component.value,
228
- onClick: _cache[0] || (_cache[0] = ($event) => emit("click", $event))
229
- }), null, 16, ["component"]);
230
- };
231
- }
232
- });
233
-
234
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
235
- __name: "KdsToggleButton",
236
- props: /* @__PURE__ */ mergeModels({
237
- size: {},
238
- disabled: { type: Boolean },
239
- title: {},
240
- variant: { default: "outlined" },
241
- label: {},
242
- leadingIcon: {},
243
- trailingIcon: {},
244
- ariaLabel: {}
245
- }, {
246
- "modelValue": { type: Boolean, ...{ default: false } },
247
- "modelModifiers": {}
248
- }),
249
- emits: ["update:modelValue"],
250
- setup(__props) {
251
- const props = __props;
252
- const modelValue = useModel(__props, "modelValue");
253
- return (_ctx, _cache) => {
254
- return openBlock(), createBlock(BaseButton, mergeProps(props, {
255
- toggled: modelValue.value,
256
- "aria-pressed": modelValue.value,
257
- onClick: _cache[0] || (_cache[0] = ($event) => modelValue.value = !modelValue.value)
258
- }), null, 16, ["toggled", "aria-pressed"]);
259
- };
260
- }
261
- });
262
-
263
- const _hoisted_1$b = ["disabled", "aria-checked", "aria-describedby", "aria-invalid", "title"];
264
- const _hoisted_2$4 = { class: "control" };
265
- const _hoisted_3$3 = {
266
- key: 0,
267
- class: "content"
268
- };
269
- const _hoisted_4$2 = { class: "label" };
270
- const _hoisted_5$1 = ["id"];
271
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
272
- __name: "KdsCheckbox",
273
- props: {
274
- modelValue: { type: [Boolean, String], default: false },
275
- disabled: { type: Boolean, default: false },
276
- error: { type: Boolean, default: false },
277
- title: {},
278
- label: {},
279
- helperText: {}
280
- },
281
- emits: ["update:modelValue"],
282
- setup(__props, { emit: __emit }) {
283
- const props = __props;
284
- const emit = __emit;
285
- const id = useId();
286
- const isChecked = computed(() => props.modelValue === true);
287
- const isIndeterminate = computed(() => props.modelValue === "indeterminate");
288
- const icon = computed(() => {
289
- if (isChecked.value) {
290
- return "checkmark";
291
- }
292
- if (isIndeterminate.value) {
293
- return "minus";
294
- }
295
- return null;
296
- });
297
- const ariaChecked = computed(() => {
298
- if (isIndeterminate.value) {
299
- return "mixed";
300
- }
301
- return isChecked.value;
302
- });
303
- const handleClick = () => {
304
- if (props.disabled) {
305
- return;
306
- }
307
- const newValue = isIndeterminate.value ? true : !isChecked.value;
308
- emit("update:modelValue", newValue);
309
- };
310
- return (_ctx, _cache) => {
311
- return openBlock(), createElementBlock("button", {
312
- class: normalizeClass({
313
- checkbox: true,
314
- checked: isChecked.value,
315
- indeterminate: isIndeterminate.value,
316
- disabled: props.disabled,
317
- error: props.error
318
- }),
319
- disabled: props.disabled,
320
- "aria-checked": ariaChecked.value,
321
- "aria-describedby": props.helperText ? `${unref(id)}-helper` : void 0,
322
- "aria-invalid": props.error,
323
- title: props.title,
324
- type: "button",
325
- role: "checkbox",
326
- onClick: handleClick
327
- }, [
328
- createElementVNode("div", _hoisted_2$4, [
329
- icon.value ? (openBlock(), createBlock(KdsIcon, {
330
- key: 0,
331
- name: icon.value,
332
- class: "icon",
333
- size: "xsmall"
334
- }, null, 8, ["name"])) : createCommentVNode("", true)
335
- ]),
336
- props.label || props.helperText ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
337
- createElementVNode("div", _hoisted_4$2, toDisplayString(props.label), 1),
338
- props.helperText ? (openBlock(), createElementBlock("div", {
339
- key: 0,
340
- id: `${unref(id)}-helper`,
341
- class: "helper-text"
342
- }, toDisplayString(props.helperText), 9, _hoisted_5$1)) : createCommentVNode("", true)
343
- ])) : createCommentVNode("", true)
344
- ], 10, _hoisted_1$b);
345
- };
346
- }
347
- });
348
-
349
- const KdsCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-a0ec0f68"]]);
71
+ const KdsIcon = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-d965b88c"]]);
350
72
 
351
73
  const ID_TO_ICON_MAP = {
352
74
  // Flow Variables
@@ -492,8 +214,8 @@ const typeIconNames = [
492
214
  "xml-datatype"
493
215
  ];
494
216
 
495
- const _hoisted_1$a = ["title"];
496
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
217
+ const _hoisted_1$g = ["title"];
218
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
497
219
  __name: "KdsDataType",
498
220
  props: {
499
221
  iconName: { default: "unknown-datatype" },
@@ -533,12 +255,115 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
533
255
  "aria-hidden": "true",
534
256
  focusable: "false"
535
257
  }, null, 8, ["class"]))
536
- ], 10, _hoisted_1$a);
258
+ ], 10, _hoisted_1$g);
259
+ };
260
+ }
261
+ });
262
+
263
+ const KdsDataType = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-f7d93fdf"]]);
264
+
265
+ const _hoisted_1$f = {
266
+ key: 0,
267
+ class: "label"
268
+ };
269
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
270
+ __name: "BaseButton",
271
+ props: {
272
+ size: { default: "medium" },
273
+ disabled: { type: Boolean, default: false },
274
+ title: {},
275
+ variant: {},
276
+ label: {},
277
+ leadingIcon: {},
278
+ trailingIcon: {},
279
+ ariaLabel: {},
280
+ destructive: { type: Boolean, default: false },
281
+ success: { type: Boolean, default: false },
282
+ error: { type: Boolean, default: false },
283
+ toggled: { type: Boolean, default: false },
284
+ component: { default: "button" }
285
+ },
286
+ emits: ["click"],
287
+ setup(__props, { emit: __emit }) {
288
+ const props = __props;
289
+ const emit = __emit;
290
+ const classes = computed(() => [
291
+ "button",
292
+ props.size,
293
+ props.variant,
294
+ { destructive: props.destructive },
295
+ { disabled: props.disabled },
296
+ { toggled: props.toggled },
297
+ { success: props.success },
298
+ { error: props.error }
299
+ ]);
300
+ const iconSize = computed(() => {
301
+ if (props.size === "xsmall") {
302
+ return "small";
303
+ } else {
304
+ return props.size;
305
+ }
306
+ });
307
+ function onClick(e) {
308
+ if (!props.disabled) {
309
+ emit("click", e);
310
+ }
311
+ }
312
+ return (_ctx, _cache) => {
313
+ return openBlock(), createBlock(resolveDynamicComponent(__props.component), {
314
+ class: normalizeClass(classes.value),
315
+ disabled: props.disabled,
316
+ title: props.title,
317
+ "aria-label": props.ariaLabel,
318
+ onClick: _cache[0] || (_cache[0] = ($event) => onClick($event))
319
+ }, {
320
+ default: withCtx(() => [
321
+ renderSlot(_ctx.$slots, "leading", {}, () => [
322
+ props.leadingIcon ? (openBlock(), createBlock(KdsIcon, {
323
+ key: 0,
324
+ name: props.leadingIcon,
325
+ size: iconSize.value
326
+ }, null, 8, ["name", "size"])) : createCommentVNode("", true)
327
+ ], true),
328
+ props.label ? (openBlock(), createElementBlock("span", _hoisted_1$f, toDisplayString(props.label), 1)) : createCommentVNode("", true),
329
+ props.trailingIcon && props.label ? (openBlock(), createBlock(KdsIcon, {
330
+ key: 1,
331
+ name: props.trailingIcon,
332
+ size: iconSize.value
333
+ }, null, 8, ["name", "size"])) : createCommentVNode("", true)
334
+ ]),
335
+ _: 3
336
+ }, 8, ["class", "disabled", "title", "aria-label"]);
537
337
  };
538
338
  }
539
339
  });
540
340
 
541
- const KdsDataType = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-f7d93fdf"]]);
341
+ const BaseButton = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-ab4824cd"]]);
342
+
343
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
344
+ __name: "KdsButton",
345
+ props: {
346
+ size: {},
347
+ disabled: { type: Boolean },
348
+ title: {},
349
+ variant: { default: "filled" },
350
+ label: {},
351
+ leadingIcon: {},
352
+ trailingIcon: {},
353
+ ariaLabel: {},
354
+ destructive: { type: Boolean }
355
+ },
356
+ emits: ["click"],
357
+ setup(__props, { emit: __emit }) {
358
+ const props = __props;
359
+ const emit = __emit;
360
+ return (_ctx, _cache) => {
361
+ return openBlock(), createBlock(BaseButton, mergeProps(props, {
362
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("click", $event))
363
+ }), null, 16);
364
+ };
365
+ }
366
+ });
542
367
 
543
368
  const modalLayoutPropsDefault = {
544
369
  title: "",
@@ -554,14 +379,14 @@ const modalPropsDefault = {
554
379
  ...modalLayoutPropsDefault
555
380
  };
556
381
 
557
- const _hoisted_1$9 = { class: "modal-header" };
558
- const _hoisted_2$3 = { class: "modal-header-title" };
559
- const _hoisted_3$2 = ["data-variant"];
560
- const _hoisted_4$1 = {
382
+ const _hoisted_1$e = { class: "modal-header" };
383
+ const _hoisted_2$5 = { class: "modal-header-title" };
384
+ const _hoisted_3$3 = ["data-variant"];
385
+ const _hoisted_4$2 = {
561
386
  key: 0,
562
387
  class: "modal-footer"
563
388
  };
564
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
389
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
565
390
  ...{ inheritAttrs: false },
566
391
  __name: "KdsModalLayout",
567
392
  props: /* @__PURE__ */ mergeDefaults({
@@ -573,19 +398,19 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
573
398
  }, modalLayoutPropsDefault),
574
399
  setup(__props) {
575
400
  useCssVars((_ctx) => ({
576
- "v7613d0dd": _ctx.overflow
401
+ "c5a8c866": _ctx.overflow
577
402
  }));
578
403
  const props = __props;
579
404
  return (_ctx, _cache) => {
580
405
  return openBlock(), createElementBlock(Fragment, null, [
581
- createElementVNode("header", _hoisted_1$9, [
406
+ createElementVNode("header", _hoisted_1$e, [
582
407
  props.icon ? (openBlock(), createBlock(KdsIcon, {
583
408
  key: 0,
584
409
  name: props.icon,
585
410
  size: "medium"
586
411
  }, null, 8, ["name"])) : createCommentVNode("", true),
587
- createElementVNode("div", _hoisted_2$3, toDisplayString(props.title), 1),
588
- createVNode(_sfc_main$e, {
412
+ createElementVNode("div", _hoisted_2$5, toDisplayString(props.title), 1),
413
+ createVNode(_sfc_main$i, {
589
414
  "leading-icon": "x-close",
590
415
  variant: "transparent",
591
416
  size: "medium",
@@ -598,8 +423,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
598
423
  "data-variant": __props.variant
599
424
  }, [
600
425
  renderSlot(_ctx.$slots, "body", {}, void 0, true)
601
- ], 8, _hoisted_3$2),
602
- _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_4$1, [
426
+ ], 8, _hoisted_3$3),
427
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_4$2, [
603
428
  renderSlot(_ctx.$slots, "footer", {}, void 0, true)
604
429
  ])) : createCommentVNode("", true)
605
430
  ], 64);
@@ -607,10 +432,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
607
432
  }
608
433
  });
609
434
 
610
- const KdsModalLayout = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-c600bf4b"]]);
435
+ const KdsModalLayout = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-583e34fe"]]);
611
436
 
612
- const _hoisted_1$8 = ["closedby"];
613
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
437
+ const _hoisted_1$d = ["closedby"];
438
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
614
439
  __name: "KdsModal",
615
440
  props: /* @__PURE__ */ mergeDefaults({
616
441
  icon: {},
@@ -702,12 +527,193 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
702
527
  _: 3
703
528
  }, 8, ["title", "icon", "variant", "overflow"])
704
529
  ], true)
705
- ], 42, _hoisted_1$8)) : createCommentVNode("", true);
530
+ ], 42, _hoisted_1$d)) : createCommentVNode("", true);
706
531
  };
707
532
  }
708
533
  });
709
534
 
710
- const KdsModal = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-6fc6d7dd"]]);
535
+ const KdsModal = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-6fc6d7dd"]]);
536
+
537
+ const _hoisted_1$c = ["id"];
538
+ const _hoisted_2$4 = { class: "subtext-text" };
539
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
540
+ __name: "KdsSubText",
541
+ props: {
542
+ id: {},
543
+ subText: {},
544
+ error: { type: Boolean, default: false },
545
+ preserveSubTextSpace: { type: Boolean, default: false }
546
+ },
547
+ setup(__props) {
548
+ const props = __props;
549
+ return (_ctx, _cache) => {
550
+ return props.subText || props.preserveSubTextSpace ? (openBlock(), createElementBlock("div", {
551
+ key: 0,
552
+ id: props.id,
553
+ class: normalizeClass({
554
+ subtext: true,
555
+ error: props.error
556
+ })
557
+ }, [
558
+ props.error && props.subText ? (openBlock(), createBlock(KdsIcon, {
559
+ key: 0,
560
+ name: "circle-error",
561
+ size: "small",
562
+ "aria-label": "Error"
563
+ })) : createCommentVNode("", true),
564
+ createElementVNode("span", _hoisted_2$4, toDisplayString(props.subText), 1)
565
+ ], 10, _hoisted_1$c)) : createCommentVNode("", true);
566
+ };
567
+ }
568
+ });
569
+
570
+ const KdsSubText = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-78af6eac"]]);
571
+
572
+ const _hoisted_1$b = ["disabled", "title", "aria-label", "aria-checked", "aria-describedby", "aria-invalid"];
573
+ const _hoisted_2$3 = { class: "control" };
574
+ const _hoisted_3$2 = {
575
+ key: 0,
576
+ class: "content"
577
+ };
578
+ const _hoisted_4$1 = { class: "label" };
579
+ const _hoisted_5$1 = ["id"];
580
+ const _hoisted_6$1 = { class: "subtext-wrapper" };
581
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
582
+ __name: "BaseCheckbox",
583
+ props: /* @__PURE__ */ mergeModels({
584
+ disabled: { type: Boolean, default: false },
585
+ error: { type: Boolean, default: false },
586
+ subText: {},
587
+ preserveSubTextSpace: { type: Boolean },
588
+ label: {},
589
+ title: {},
590
+ helperText: {}
591
+ }, {
592
+ "modelValue": { type: [Boolean, String], ...{ default: false } },
593
+ "modelModifiers": {}
594
+ }),
595
+ emits: ["update:modelValue"],
596
+ setup(__props) {
597
+ const props = __props;
598
+ const modelValue = useModel(__props, "modelValue");
599
+ const helperId = useId();
600
+ const descriptionId = useId();
601
+ const isChecked = computed(() => modelValue.value === true);
602
+ const isIndeterminate = computed(() => modelValue.value === "indeterminate");
603
+ const icon = computed(() => {
604
+ if (isChecked.value) {
605
+ return "checkmark";
606
+ }
607
+ if (isIndeterminate.value) {
608
+ return "minus";
609
+ }
610
+ return null;
611
+ });
612
+ const ariaChecked = computed(() => {
613
+ if (isIndeterminate.value) {
614
+ return "mixed";
615
+ }
616
+ return isChecked.value;
617
+ });
618
+ const ariaDescribedBy = computed(() => {
619
+ const ids = [];
620
+ if (props.helperText) {
621
+ ids.push(helperId);
622
+ }
623
+ if (props.subText) {
624
+ ids.push(descriptionId);
625
+ }
626
+ return ids.length > 0 ? ids.join(" ") : void 0;
627
+ });
628
+ const handleClick = () => {
629
+ if (props.disabled) {
630
+ return;
631
+ }
632
+ modelValue.value = isIndeterminate.value ? true : !isChecked.value;
633
+ };
634
+ return (_ctx, _cache) => {
635
+ return openBlock(), createElementBlock("div", null, [
636
+ createElementVNode("button", {
637
+ class: normalizeClass({
638
+ checkbox: true,
639
+ checked: isChecked.value,
640
+ indeterminate: isIndeterminate.value,
641
+ disabled: props.disabled,
642
+ error: props.error
643
+ }),
644
+ disabled: props.disabled,
645
+ title: props.title,
646
+ "aria-label": props.title,
647
+ "aria-checked": ariaChecked.value,
648
+ "aria-describedby": ariaDescribedBy.value,
649
+ "aria-invalid": props.error,
650
+ type: "button",
651
+ role: "checkbox",
652
+ onClick: handleClick
653
+ }, [
654
+ createElementVNode("div", _hoisted_2$3, [
655
+ icon.value ? (openBlock(), createBlock(KdsIcon, {
656
+ key: 0,
657
+ name: icon.value,
658
+ class: "icon",
659
+ size: "xsmall"
660
+ }, null, 8, ["name"])) : createCommentVNode("", true)
661
+ ]),
662
+ props.label || props.helperText ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
663
+ createElementVNode("div", _hoisted_4$1, toDisplayString(props.label), 1),
664
+ props.helperText ? (openBlock(), createElementBlock("div", {
665
+ key: 0,
666
+ id: unref(helperId),
667
+ class: "helper-text"
668
+ }, toDisplayString(props.helperText), 9, _hoisted_5$1)) : createCommentVNode("", true)
669
+ ])) : createCommentVNode("", true)
670
+ ], 10, _hoisted_1$b),
671
+ createElementVNode("div", _hoisted_6$1, [
672
+ createVNode(KdsSubText, {
673
+ id: unref(descriptionId),
674
+ "sub-text": props.subText,
675
+ "preserve-sub-text-space": props.preserveSubTextSpace,
676
+ error: props.error
677
+ }, null, 8, ["id", "sub-text", "preserve-sub-text-space", "error"])
678
+ ])
679
+ ]);
680
+ };
681
+ }
682
+ });
683
+
684
+ const BaseCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-593a7b0c"]]);
685
+
686
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
687
+ __name: "KdsCheckbox",
688
+ props: /* @__PURE__ */ mergeModels({
689
+ disabled: { type: Boolean, default: false },
690
+ error: { type: Boolean, default: false },
691
+ subText: {},
692
+ preserveSubTextSpace: { type: Boolean, default: false },
693
+ label: {},
694
+ title: {}
695
+ }, {
696
+ "modelValue": { type: [Boolean, String], ...{ default: false } },
697
+ "modelModifiers": {}
698
+ }),
699
+ emits: ["update:modelValue"],
700
+ setup(__props) {
701
+ const props = __props;
702
+ const modelValue = useModel(__props, "modelValue");
703
+ return (_ctx, _cache) => {
704
+ return openBlock(), createBlock(BaseCheckbox, {
705
+ modelValue: modelValue.value,
706
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
707
+ disabled: props.disabled,
708
+ error: props.error,
709
+ label: props.label,
710
+ title: props.title,
711
+ "sub-text": props.subText,
712
+ "preserve-sub-text-space": props.preserveSubTextSpace
713
+ }, null, 8, ["modelValue", "disabled", "error", "label", "title", "sub-text", "preserve-sub-text-space"]);
714
+ };
715
+ }
716
+ });
711
717
 
712
718
  const createUnwrappedPromise = () => {
713
719
  let resolve = () => {
@@ -800,7 +806,7 @@ const useKdsDynamicModal = () => {
800
806
  };
801
807
  };
802
808
 
803
- const _hoisted_1$7 = {
809
+ const _hoisted_1$a = {
804
810
  key: 1,
805
811
  class: "confirmation"
806
812
  };
@@ -809,7 +815,7 @@ const _hoisted_3$1 = {
809
815
  key: 0,
810
816
  class: "ask-again"
811
817
  };
812
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
818
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
813
819
  __name: "KdsDynamicModalProvider",
814
820
  setup(__props) {
815
821
  const askAgain = ref(false);
@@ -862,16 +868,15 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
862
868
  unref(config)?.type === "confirm" ? {
863
869
  name: "body",
864
870
  fn: withCtx(() => [
865
- unref(internal).isTemplateBasedConfirm(unref(config).value) ? (openBlock(), createBlock(resolveDynamicComponent(unref(config).value.component), { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_1$7, [
871
+ unref(internal).isTemplateBasedConfirm(unref(config).value) ? (openBlock(), createBlock(resolveDynamicComponent(unref(config).value.component), { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_1$a, [
866
872
  createElementVNode("div", _hoisted_2$2, toDisplayString(unref(config).value.message), 1),
867
873
  unref(config).value.doNotAskAgain ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
868
- createVNode(KdsCheckbox, {
874
+ createVNode(_sfc_main$d, {
869
875
  modelValue: askAgain.value,
870
876
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => askAgain.value = $event),
871
877
  label: unref(config).value.doNotAskAgain.label,
872
- title: unref(config).value.doNotAskAgain.title,
873
- "helper-text": unref(config).value.doNotAskAgain.helperText
874
- }, null, 8, ["modelValue", "label", "title", "helper-text"])
878
+ "sub-text": unref(config).value.doNotAskAgain.subText
879
+ }, null, 8, ["modelValue", "label", "sub-text"])
875
880
  ])) : createCommentVNode("", true)
876
881
  ]))
877
882
  ]),
@@ -881,7 +886,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
881
886
  name: "footer",
882
887
  fn: withCtx(() => [
883
888
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(config).value.buttons, (button, index) => {
884
- return openBlock(), createBlock(_sfc_main$e, {
889
+ return openBlock(), createBlock(_sfc_main$i, {
885
890
  key: index,
886
891
  destructive: button.destructive,
887
892
  autofocus: button.autofocus,
@@ -911,10 +916,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
911
916
  }
912
917
  });
913
918
 
914
- const KdsDynamicModalProvider = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-bd3a851b"]]);
919
+ const KdsDynamicModalProvider = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-c0769cfd"]]);
915
920
 
916
- const _hoisted_1$6 = ["data-style"];
917
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
921
+ const _hoisted_1$9 = ["data-style"];
922
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
918
923
  __name: "KdsLoadingSpinner",
919
924
  props: {
920
925
  size: { default: "medium" },
@@ -939,12 +944,317 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
939
944
  cy: "60",
940
945
  r: "50"
941
946
  }, null, -1)
942
- ])], 10, _hoisted_1$6);
947
+ ])], 10, _hoisted_1$9);
948
+ };
949
+ }
950
+ });
951
+
952
+ const KdsLoadingSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-13c830ad"]]);
953
+
954
+ const _hoisted_1$8 = ["disabled", "title", "aria-label", "aria-pressed"];
955
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
956
+ __name: "KdsVariableToggleButton",
957
+ props: /* @__PURE__ */ mergeModels({
958
+ disabled: { type: Boolean, default: false },
959
+ hidden: { type: Boolean, default: false },
960
+ inSet: { type: Boolean, default: false },
961
+ outSet: { type: Boolean, default: false },
962
+ error: { type: Boolean, default: false }
963
+ }, {
964
+ "modelValue": { type: Boolean, ...{ default: false } },
965
+ "modelModifiers": {}
966
+ }),
967
+ emits: ["update:modelValue"],
968
+ setup(__props) {
969
+ const props = __props;
970
+ const modelValue = useModel(__props, "modelValue");
971
+ const iconState = computed(() => {
972
+ if (props.inSet && props.outSet) {
973
+ return "in-out";
974
+ }
975
+ if (props.inSet) {
976
+ return "in";
977
+ }
978
+ if (props.outSet) {
979
+ return "out";
980
+ }
981
+ return "none";
982
+ });
983
+ const iconName = computed(() => {
984
+ switch (iconState.value) {
985
+ case "in":
986
+ return "flow-variable-in";
987
+ case "out":
988
+ return "flow-variable-out";
989
+ case "in-out":
990
+ return "flow-variable-in-out";
991
+ case "none":
992
+ default:
993
+ return "flow-variable-default";
994
+ }
995
+ });
996
+ const baseTitleByState = {
997
+ in: "Input Flow Variable",
998
+ out: "Output Flow Variable",
999
+ "in-out": "Input and Output Flow Variable",
1000
+ none: "No Flow Variable set"
1001
+ };
1002
+ const errorTitleByState = {
1003
+ in: "Error in input Flow Variable",
1004
+ out: "Error in output Flow Variable",
1005
+ "in-out": "Error in Flow Variables"
1006
+ };
1007
+ const title = computed(() => {
1008
+ const baseTitle = baseTitleByState[iconState.value];
1009
+ if (!props.error) {
1010
+ return baseTitle;
1011
+ }
1012
+ return errorTitleByState[iconState.value] ?? baseTitle;
1013
+ });
1014
+ return (_ctx, _cache) => {
1015
+ return openBlock(), createElementBlock("button", {
1016
+ class: normalizeClass({
1017
+ "variable-toggle-button": true,
1018
+ disabled: props.disabled,
1019
+ error: props.error,
1020
+ "pressed-or-set": modelValue.value || props.inSet || props.outSet,
1021
+ hidden: props.hidden && !modelValue.value
1022
+ }),
1023
+ disabled: props.disabled,
1024
+ title: title.value,
1025
+ "aria-label": title.value,
1026
+ "aria-pressed": modelValue.value,
1027
+ type: "button",
1028
+ onClick: _cache[0] || (_cache[0] = ($event) => modelValue.value = !modelValue.value)
1029
+ }, [
1030
+ createVNode(KdsIcon, {
1031
+ name: iconName.value,
1032
+ size: "xsmall"
1033
+ }, null, 8, ["name"])
1034
+ ], 10, _hoisted_1$8);
1035
+ };
1036
+ }
1037
+ });
1038
+
1039
+ const KdsVariableToggleButton = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-8b6f8b81"]]);
1040
+
1041
+ const _hoisted_1$7 = ["disabled", "aria-pressed"];
1042
+ const TITLE = "Click for more information";
1043
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1044
+ __name: "KdsInfoToggleButton",
1045
+ props: /* @__PURE__ */ mergeModels({
1046
+ disabled: { type: Boolean, default: false },
1047
+ hidden: { type: Boolean, default: false }
1048
+ }, {
1049
+ "modelValue": { type: Boolean, ...{ default: false } },
1050
+ "modelModifiers": {}
1051
+ }),
1052
+ emits: ["update:modelValue"],
1053
+ setup(__props) {
1054
+ const props = __props;
1055
+ const modelValue = useModel(__props, "modelValue");
1056
+ return (_ctx, _cache) => {
1057
+ return openBlock(), createElementBlock("button", {
1058
+ class: normalizeClass({
1059
+ "info-toggle-button": true,
1060
+ selected: modelValue.value,
1061
+ disabled: props.disabled,
1062
+ hidden: props.hidden && !modelValue.value
1063
+ }),
1064
+ disabled: props.disabled,
1065
+ title: TITLE,
1066
+ "aria-label": TITLE,
1067
+ "aria-pressed": modelValue.value,
1068
+ type: "button",
1069
+ onClick: _cache[0] || (_cache[0] = ($event) => modelValue.value = !modelValue.value)
1070
+ }, [
1071
+ createVNode(KdsIcon, {
1072
+ name: "circle-question",
1073
+ size: "xsmall"
1074
+ })
1075
+ ], 10, _hoisted_1$7);
1076
+ };
1077
+ }
1078
+ });
1079
+
1080
+ const KdsInfoToggleButton = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-24b40e36"]]);
1081
+
1082
+ const getAppInstance = () => {
1083
+ const currentInstance = getCurrentInstance();
1084
+ return currentInstance?.appContext.app;
1085
+ };
1086
+ const resolveNuxtLinkComponent = () => {
1087
+ const app = getAppInstance();
1088
+ const nuxtLinkComponent = app?.component("NuxtLink");
1089
+ if (nuxtLinkComponent) {
1090
+ return nuxtLinkComponent;
1091
+ }
1092
+ const routerLinkComponent = app?.component("RouterLink");
1093
+ if (routerLinkComponent) {
1094
+ return routerLinkComponent;
1095
+ }
1096
+ const fallbackComponent = defineComponent({
1097
+ props: {
1098
+ to: {
1099
+ type: String,
1100
+ default: ""
1101
+ }
1102
+ },
1103
+ render() {
1104
+ return h("a", { href: this.to }, [useSlots().default?.()]);
1105
+ }
1106
+ });
1107
+ return fallbackComponent;
1108
+ };
1109
+
1110
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1111
+ __name: "KdsLinkButton",
1112
+ props: {
1113
+ size: {},
1114
+ disabled: { type: Boolean },
1115
+ title: {},
1116
+ variant: { default: "filled" },
1117
+ label: {},
1118
+ leadingIcon: {},
1119
+ trailingIcon: {},
1120
+ ariaLabel: {},
1121
+ destructive: { type: Boolean },
1122
+ to: {},
1123
+ download: { type: Boolean, default: void 0 },
1124
+ target: { default: null },
1125
+ rel: { default: null }
1126
+ },
1127
+ emits: ["click"],
1128
+ setup(__props, { emit: __emit }) {
1129
+ const props = __props;
1130
+ const component = computed(() => {
1131
+ if (props.disabled) {
1132
+ return "button";
1133
+ }
1134
+ return resolveNuxtLinkComponent();
1135
+ });
1136
+ const emit = __emit;
1137
+ return (_ctx, _cache) => {
1138
+ return openBlock(), createBlock(BaseButton, mergeProps(props, {
1139
+ component: component.value,
1140
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("click", $event))
1141
+ }), null, 16, ["component"]);
1142
+ };
1143
+ }
1144
+ });
1145
+
1146
+ const _hoisted_1$6 = ["data-visible"];
1147
+ const _hoisted_2$1 = ["data-visible"];
1148
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1149
+ __name: "KdsProgressButton",
1150
+ props: /* @__PURE__ */ mergeModels({
1151
+ size: { default: "medium" },
1152
+ variant: { default: "filled" },
1153
+ disabled: { type: Boolean, default: false },
1154
+ label: {},
1155
+ leadingIcon: {},
1156
+ ariaLabel: {}
1157
+ }, {
1158
+ "state": {
1159
+ default: "default"
1160
+ },
1161
+ "stateModifiers": {}
1162
+ }),
1163
+ emits: /* @__PURE__ */ mergeModels(["click"], ["update:state"]),
1164
+ setup(__props, { emit: __emit }) {
1165
+ const props = __props;
1166
+ const emit = __emit;
1167
+ const state = useModel(__props, "state");
1168
+ const iconSize = computed(() => {
1169
+ if (props.size === "xsmall") {
1170
+ return "small";
1171
+ }
1172
+ return props.size;
1173
+ });
1174
+ function onClick(event) {
1175
+ event.preventDefault();
1176
+ if (state.value !== "default") {
1177
+ return;
1178
+ }
1179
+ emit("click", event);
1180
+ }
1181
+ const baseButtonProps = computed(() => ({
1182
+ variant: props.variant,
1183
+ size: props.size,
1184
+ disabled: props.disabled,
1185
+ success: state.value === "success",
1186
+ error: state.value === "error",
1187
+ title: props.ariaLabel,
1188
+ label: props.label,
1189
+ leadingIcon: props.leadingIcon,
1190
+ ariaLabel: props.ariaLabel
1191
+ }));
1192
+ return (_ctx, _cache) => {
1193
+ return openBlock(), createBlock(BaseButton, mergeProps(baseButtonProps.value, {
1194
+ class: "kds-progress-button",
1195
+ "data-kds-progress-state": state.value,
1196
+ onClick
1197
+ }), {
1198
+ leading: withCtx(() => [
1199
+ createElementVNode("span", {
1200
+ class: normalizeClass(["leading", iconSize.value])
1201
+ }, [
1202
+ createElementVNode("span", {
1203
+ class: "leading-icon",
1204
+ "data-visible": state.value !== "progress"
1205
+ }, [
1206
+ createVNode(KdsIcon, {
1207
+ name: props.leadingIcon,
1208
+ size: iconSize.value
1209
+ }, null, 8, ["name", "size"])
1210
+ ], 8, _hoisted_1$6),
1211
+ createElementVNode("span", {
1212
+ class: "spinner",
1213
+ "data-visible": state.value === "progress"
1214
+ }, [
1215
+ createVNode(KdsLoadingSpinner, {
1216
+ size: iconSize.value,
1217
+ style: normalizeStyle(props.variant === "filled" ? "onPrimary" : "onSurface")
1218
+ }, null, 8, ["size", "style"])
1219
+ ], 8, _hoisted_2$1)
1220
+ ], 2)
1221
+ ]),
1222
+ _: 1
1223
+ }, 16, ["data-kds-progress-state"]);
943
1224
  };
944
1225
  }
945
1226
  });
946
1227
 
947
- const KdsLoadingSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-13c830ad"]]);
1228
+ const KdsProgressButton = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-6648b2f8"]]);
1229
+
1230
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1231
+ __name: "KdsToggleButton",
1232
+ props: /* @__PURE__ */ mergeModels({
1233
+ size: {},
1234
+ disabled: { type: Boolean },
1235
+ title: {},
1236
+ variant: { default: "outlined" },
1237
+ label: {},
1238
+ leadingIcon: {},
1239
+ trailingIcon: {},
1240
+ ariaLabel: {}
1241
+ }, {
1242
+ "modelValue": { type: Boolean, ...{ default: false } },
1243
+ "modelModifiers": {}
1244
+ }),
1245
+ emits: ["update:modelValue"],
1246
+ setup(__props) {
1247
+ const props = __props;
1248
+ const modelValue = useModel(__props, "modelValue");
1249
+ return (_ctx, _cache) => {
1250
+ return openBlock(), createBlock(BaseButton, mergeProps(props, {
1251
+ toggled: modelValue.value,
1252
+ "aria-pressed": modelValue.value,
1253
+ onClick: _cache[0] || (_cache[0] = ($event) => modelValue.value = !modelValue.value)
1254
+ }), null, 16, ["toggled", "aria-pressed"]);
1255
+ };
1256
+ }
1257
+ });
948
1258
 
949
1259
  const KDS_DARK_MODE_STORAGE_KEY = "KNIME_DARK_MODE";
950
1260
  const defaultMode = "light";
@@ -1066,37 +1376,96 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1066
1376
 
1067
1377
  const KdsLabel = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-174d476a"]]);
1068
1378
 
1069
- const _hoisted_1$4 = ["id"];
1070
- const _hoisted_2$1 = { class: "subtext-text" };
1379
+ const _hoisted_1$4 = ["id", "aria-labelledby", "aria-describedby"];
1071
1380
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1072
- __name: "KdsSubText",
1073
- props: {
1381
+ __name: "KdsCheckboxGroup",
1382
+ props: /* @__PURE__ */ mergeModels({
1074
1383
  id: {},
1384
+ label: {},
1385
+ possibleValues: {},
1386
+ alignment: { default: "vertical" },
1387
+ disabled: { type: Boolean, default: false },
1075
1388
  subText: {},
1076
- error: { type: Boolean, default: false },
1077
- preserveSubTextSpace: { type: Boolean, default: false }
1078
- },
1389
+ preserveSubTextSpace: { type: Boolean }
1390
+ }, {
1391
+ "modelValue": { default: [] },
1392
+ "modelModifiers": {}
1393
+ }),
1394
+ emits: ["update:modelValue"],
1079
1395
  setup(__props) {
1080
1396
  const props = __props;
1397
+ const modelValue = useModel(__props, "modelValue");
1398
+ const possibleValues = computed(
1399
+ () => props.possibleValues.map((o) => {
1400
+ if (typeof o === "string") {
1401
+ return { text: o, id: o };
1402
+ }
1403
+ return o;
1404
+ })
1405
+ );
1406
+ const labelId = useId();
1407
+ const descriptionId = useId();
1408
+ const isOptionDisabled = (index) => props.disabled || possibleValues.value[index]?.disabled === true;
1409
+ const isHorizontal = computed(() => props.alignment === "horizontal");
1410
+ const anyOptionHasError = computed(
1411
+ () => possibleValues.value.some((o) => o.error)
1412
+ );
1413
+ const isChecked = (id) => modelValue.value.includes(id);
1414
+ const handleCheckboxChange = (index, checked) => {
1415
+ if (isOptionDisabled(index)) {
1416
+ return;
1417
+ }
1418
+ const option = possibleValues.value[index];
1419
+ if (checked === true) {
1420
+ modelValue.value = [...modelValue.value, option.id];
1421
+ return;
1422
+ }
1423
+ modelValue.value = modelValue.value.filter((v) => v !== option.id);
1424
+ };
1081
1425
  return (_ctx, _cache) => {
1082
- return props.subText || props.preserveSubTextSpace ? (openBlock(), createElementBlock("div", {
1083
- key: 0,
1426
+ return openBlock(), createElementBlock("div", {
1084
1427
  id: props.id,
1085
- class: normalizeClass({ subtext: true, error: props.error })
1428
+ class: "checkbox-group",
1429
+ role: "group",
1430
+ "aria-labelledby": props.label ? unref(labelId) : void 0,
1431
+ "aria-describedby": props.subText ? unref(descriptionId) : void 0
1086
1432
  }, [
1087
- props.error && props.subText ? (openBlock(), createBlock(KdsIcon, {
1433
+ props.label ? (openBlock(), createBlock(KdsLabel, {
1088
1434
  key: 0,
1089
- name: "circle-error",
1090
- size: "small",
1091
- "aria-label": "Error"
1092
- })) : createCommentVNode("", true),
1093
- createElementVNode("span", _hoisted_2$1, toDisplayString(props.subText), 1)
1094
- ], 10, _hoisted_1$4)) : createCommentVNode("", true);
1435
+ id: unref(labelId),
1436
+ label: props.label
1437
+ }, null, 8, ["id", "label"])) : createCommentVNode("", true),
1438
+ createElementVNode("div", {
1439
+ class: normalizeClass({ options: true, horizontal: isHorizontal.value })
1440
+ }, [
1441
+ (openBlock(true), createElementBlock(Fragment, null, renderList(possibleValues.value, (option, index) => {
1442
+ return openBlock(), createElementBlock("div", {
1443
+ key: option.id,
1444
+ class: "option"
1445
+ }, [
1446
+ createVNode(BaseCheckbox, {
1447
+ disabled: props.disabled || option.disabled,
1448
+ error: option.error,
1449
+ "helper-text": option.helperText,
1450
+ label: option.text,
1451
+ "model-value": isChecked(option.id),
1452
+ "onUpdate:modelValue": (checked) => handleCheckboxChange(index, checked)
1453
+ }, null, 8, ["disabled", "error", "helper-text", "label", "model-value", "onUpdate:modelValue"])
1454
+ ]);
1455
+ }), 128))
1456
+ ], 2),
1457
+ createVNode(KdsSubText, {
1458
+ id: unref(descriptionId),
1459
+ "sub-text": props.subText,
1460
+ "preserve-sub-text-space": props.preserveSubTextSpace,
1461
+ error: anyOptionHasError.value
1462
+ }, null, 8, ["id", "sub-text", "preserve-sub-text-space", "error"])
1463
+ ], 8, _hoisted_1$4);
1095
1464
  };
1096
1465
  }
1097
1466
  });
1098
1467
 
1099
- const KdsSubText = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-8fccdd6d"]]);
1468
+ const KdsCheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-4363a8f9"]]);
1100
1469
 
1101
1470
  const _hoisted_1$3 = ["aria-checked", "aria-describedby", "aria-invalid", "disabled"];
1102
1471
  const _hoisted_2 = { class: "control" };
@@ -1172,7 +1541,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1172
1541
  }
1173
1542
  });
1174
1543
 
1175
- const KdsRadioButton = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-f6d4be71"]]);
1544
+ const KdsRadioButton = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-a7490a52"]]);
1176
1545
 
1177
1546
  const useRadioSelection = ({
1178
1547
  selectedId,
@@ -1379,7 +1748,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1379
1748
  }
1380
1749
  });
1381
1750
 
1382
- const KdsRadioButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-8c13f6fe"]]);
1751
+ const KdsRadioButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b0e27ba1"]]);
1383
1752
 
1384
1753
  const _hoisted_1$1 = ["aria-checked", "aria-label", "disabled", "tabindex", "title"];
1385
1754
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
@@ -1585,7 +1954,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1585
1954
  }
1586
1955
  });
1587
1956
 
1588
- const KdsValueSwitch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f62881a3"]]);
1957
+ const KdsValueSwitch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e5da4485"]]);
1589
1958
 
1590
- export { _sfc_main$e as KdsButton, KdsCheckbox, KdsDataType, KdsDynamicModalProvider, KdsIcon, KdsLabel, _sfc_main$d as KdsLinkButton, KdsLoadingSpinner, KdsModal, KdsModalLayout, KdsRadioButtonGroup, KdsSubText, _sfc_main$c as KdsToggleButton, KdsValueSwitch, useKdsDarkMode, useKdsDynamicModal, useKdsIsTruncated, useKdsLegacyMode };
1959
+ export { _sfc_main$i as KdsButton, _sfc_main$d as KdsCheckbox, KdsCheckboxGroup, KdsDataType, KdsDynamicModalProvider, KdsIcon, KdsInfoToggleButton, KdsLabel, _sfc_main$8 as KdsLinkButton, KdsLoadingSpinner, KdsModal, KdsModalLayout, KdsProgressButton, KdsRadioButtonGroup, KdsSubText, _sfc_main$6 as KdsToggleButton, KdsValueSwitch, KdsVariableToggleButton, useKdsDarkMode, useKdsDynamicModal, useKdsIsTruncated, useKdsLegacyMode };
1591
1960
  //# sourceMappingURL=index.js.map