@knime/kds-components 0.22.1 → 0.22.3

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 (36) hide show
  1. package/dist/index.css +134 -52
  2. package/dist/index.js +1299 -861
  3. package/dist/index.js.map +1 -1
  4. package/dist/src/accessories/ColorSwatch/KdsColorSwatch.vue.d.ts.map +1 -1
  5. package/dist/src/forms/_helper/List/ListContainer/KdsListContainer.vue.d.ts.map +1 -1
  6. package/dist/src/forms/inputs/ColorInput/{ColorPicker.vue.d.ts → ColorPicker/ColorPicker.vue.d.ts} +0 -1
  7. package/dist/src/forms/inputs/ColorInput/ColorPicker/ColorPicker.vue.d.ts.map +1 -0
  8. package/dist/src/forms/inputs/ColorInput/ColorPicker/ColorPickerSlider.vue.d.ts +14 -0
  9. package/dist/src/forms/inputs/ColorInput/ColorPicker/ColorPickerSlider.vue.d.ts.map +1 -0
  10. package/dist/src/forms/inputs/ColorInput/ColorPicker/types.d.ts +12 -0
  11. package/dist/src/forms/inputs/ColorInput/ColorPicker/types.d.ts.map +1 -0
  12. package/dist/src/forms/inputs/ColorInput/KdsColorInput.vue.d.ts.map +1 -1
  13. package/dist/src/forms/inputs/ColorInput/colorUtils.d.ts +7 -0
  14. package/dist/src/forms/inputs/ColorInput/colorUtils.d.ts.map +1 -1
  15. package/dist/src/forms/inputs/ColorInput/useColorInputValidationOnFocusOut.d.ts.map +1 -1
  16. package/dist/src/forms/selects/MultiSelectListBox/KdsMultiSelectListBox.vue.d.ts.map +1 -1
  17. package/dist/src/forms/selects/MultiSelectListBox/types.d.ts +3 -1
  18. package/dist/src/forms/selects/MultiSelectListBox/types.d.ts.map +1 -1
  19. package/dist/src/forms/selects/MultiSelectListBox/useMultiSelectListBoxSelection.d.ts.map +1 -1
  20. package/dist/src/forms/selects/SortableListBox/KdsSortableListBox.vue.d.ts +196 -0
  21. package/dist/src/forms/selects/SortableListBox/KdsSortableListBox.vue.d.ts.map +1 -0
  22. package/dist/src/forms/selects/SortableListBox/index.d.ts +3 -0
  23. package/dist/src/forms/selects/SortableListBox/index.d.ts.map +1 -0
  24. package/dist/src/forms/selects/SortableListBox/types.d.ts +10 -0
  25. package/dist/src/forms/selects/SortableListBox/types.d.ts.map +1 -0
  26. package/dist/src/forms/selects/SortableListBox/useSortableListBoxReorder.d.ts +16 -0
  27. package/dist/src/forms/selects/SortableListBox/useSortableListBoxReorder.d.ts.map +1 -0
  28. package/dist/src/forms/selects/TwinList/KdsTwinList.vue.d.ts.map +1 -1
  29. package/dist/src/forms/selects/TwinList/TwinListBody.vue.d.ts.map +1 -1
  30. package/dist/src/forms/selects/TwinList/types.d.ts +2 -0
  31. package/dist/src/forms/selects/TwinList/types.d.ts.map +1 -1
  32. package/dist/src/forms/selects/index.d.ts +2 -2
  33. package/dist/src/forms/selects/index.d.ts.map +1 -1
  34. package/dist/src/layouts/ResizeContainer/KdsResizeContainer.vue.d.ts.map +1 -1
  35. package/package.json +2 -2
  36. package/dist/src/forms/inputs/ColorInput/ColorPicker.vue.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, createPropsRestProxy, ref, watch, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, shallowRef, toRef, unref, createBlock, resolveDynamicComponent, createCommentVNode, normalizeStyle, useTemplateRef, createVNode, withCtx, renderSlot, mergeProps, h, useSlots, getCurrentInstance, useModel, mergeModels, useId, nextTick, Fragment, renderList, watchEffect, useAttrs, withKeys, defineAsyncComponent, onBeforeUpdate, withModifiers, reactive, onMounted, onUnmounted, toRefs, normalizeProps, inject, withDirectives, provide, guardReactiveProps, createTextVNode, isRef, resolveComponent, Transition, resolveDirective, toHandlers, onBeforeUnmount, vModelText, useCssVars, createSlots } from 'vue';
1
+ import { defineComponent, createPropsRestProxy, ref, watch, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, shallowRef, toRef, unref, createBlock, resolveDynamicComponent, createCommentVNode, normalizeStyle, useTemplateRef, createVNode, withCtx, renderSlot, mergeProps, h, useSlots, getCurrentInstance, useModel, mergeModels, useId, nextTick, Fragment, renderList, watchEffect, useAttrs, withKeys, defineAsyncComponent, onBeforeUpdate, withModifiers, onBeforeUnmount, useCssVars, reactive, onMounted, onUnmounted, toRefs, normalizeProps, inject, withDirectives, provide, guardReactiveProps, createTextVNode, isRef, resolveComponent, Transition, resolveDirective, toHandlers, vModelText, createSlots } from 'vue';
2
2
  import { useLocalStorage, useDark, usePreferredDark, useResizeObserver, useMutationObserver, useElementSize, useMousePressed, useVirtualList, useTemplateRefsList } from '@vueuse/core';
3
3
 
4
4
  import './index.css';const kdsAvatarSize = {
@@ -9,14 +9,14 @@ import './index.css';const kdsAvatarSize = {
9
9
  };
10
10
  const kdsAvatarSizes = Object.values(kdsAvatarSize);
11
11
 
12
- const _hoisted_1$K = ["role", "title", "aria-hidden", "aria-label"];
13
- const _hoisted_2$s = ["src"];
14
- const _hoisted_3$i = {
12
+ const _hoisted_1$M = ["role", "title", "aria-hidden", "aria-label"];
13
+ const _hoisted_2$t = ["src"];
14
+ const _hoisted_3$j = {
15
15
  key: 1,
16
16
  class: "kds-avatar-initials",
17
17
  "aria-hidden": "true"
18
18
  };
19
- const _sfc_main$18 = /* @__PURE__ */ defineComponent({
19
+ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
20
20
  __name: "KdsAvatar",
21
21
  props: {
22
22
  initials: {},
@@ -59,10 +59,10 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
59
59
  alt: "",
60
60
  "aria-hidden": "true",
61
61
  onError: onImageError
62
- }, null, 40, _hoisted_2$s)) : (openBlock(), createElementBlock("div", _hoisted_3$i, [
62
+ }, null, 40, _hoisted_2$t)) : (openBlock(), createElementBlock("div", _hoisted_3$j, [
63
63
  createElementVNode("span", null, toDisplayString(displayedInitials.value), 1)
64
64
  ]))
65
- ], 10, _hoisted_1$K);
65
+ ], 10, _hoisted_1$M);
66
66
  };
67
67
  }
68
68
  });
@@ -75,7 +75,7 @@ const _export_sfc$1 = (sfc, props) => {
75
75
  return target;
76
76
  };
77
77
 
78
- const KdsAvatar = /* @__PURE__ */ _export_sfc$1(_sfc_main$18, [["__scopeId", "data-v-c90668bf"]]);
78
+ const KdsAvatar = /* @__PURE__ */ _export_sfc$1(_sfc_main$1a, [["__scopeId", "data-v-c90668bf"]]);
79
79
 
80
80
  const __variableDynamicImportRuntimeHelper = (glob$1, path$13, segs) => {
81
81
  const v = glob$1[path$13];
@@ -117,7 +117,7 @@ function useIcon({
117
117
  return iconComponent;
118
118
  }
119
119
 
120
- const _sfc_main$17 = /* @__PURE__ */ defineComponent({
120
+ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
121
121
  __name: "KdsIcon",
122
122
  props: {
123
123
  name: {},
@@ -146,7 +146,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
146
146
  }
147
147
  });
148
148
 
149
- const KdsIcon = /* @__PURE__ */ _export_sfc$1(_sfc_main$17, [["__scopeId", "data-v-fb124eb6"]]);
149
+ const KdsIcon = /* @__PURE__ */ _export_sfc$1(_sfc_main$19, [["__scopeId", "data-v-fb124eb6"]]);
150
150
 
151
151
  const ID_TO_ICON_MAP = {
152
152
  // Flow Variables
@@ -483,8 +483,8 @@ const kdsDataTypeSize = {
483
483
  };
484
484
  const kdsDataTypeSizes = Object.values(kdsDataTypeSize);
485
485
 
486
- const _hoisted_1$J = ["title"];
487
- const _sfc_main$16 = /* @__PURE__ */ defineComponent({
486
+ const _hoisted_1$L = ["title"];
487
+ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
488
488
  __name: "KdsDataType",
489
489
  props: {
490
490
  iconName: { default: "unknown-datatype" },
@@ -524,12 +524,12 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
524
524
  "aria-hidden": "true",
525
525
  focusable: "false"
526
526
  }, null, 8, ["class"]))
527
- ], 10, _hoisted_1$J);
527
+ ], 10, _hoisted_1$L);
528
528
  };
529
529
  }
530
530
  });
531
531
 
532
- const KdsDataType = /* @__PURE__ */ _export_sfc$1(_sfc_main$16, [["__scopeId", "data-v-3b8ebdbd"]]);
532
+ const KdsDataType = /* @__PURE__ */ _export_sfc$1(_sfc_main$18, [["__scopeId", "data-v-3b8ebdbd"]]);
533
533
 
534
534
  const kdsBadgeVariant = {
535
535
  NEUTRAL: "neutral",
@@ -546,8 +546,8 @@ const kdsBadgeSize = {
546
546
  };
547
547
  const kdsBadgeSizes = Object.values(kdsBadgeSize);
548
548
 
549
- const _hoisted_1$I = { class: "label-wrapper" };
550
- const _sfc_main$15 = /* @__PURE__ */ defineComponent({
549
+ const _hoisted_1$K = { class: "label-wrapper" };
550
+ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
551
551
  __name: "KdsBadge",
552
552
  props: {
553
553
  label: {},
@@ -569,13 +569,13 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
569
569
  name: __props.leadingIcon,
570
570
  size: sizeToIconSize[__props.size]
571
571
  }, null, 8, ["name", "size"])) : createCommentVNode("", true),
572
- createElementVNode("span", _hoisted_1$I, toDisplayString(__props.label), 1)
572
+ createElementVNode("span", _hoisted_1$K, toDisplayString(__props.label), 1)
573
573
  ], 2);
574
574
  };
575
575
  }
576
576
  });
577
577
 
578
- const KdsBadge = /* @__PURE__ */ _export_sfc$1(_sfc_main$15, [["__scopeId", "data-v-df64f7cf"]]);
578
+ const KdsBadge = /* @__PURE__ */ _export_sfc$1(_sfc_main$17, [["__scopeId", "data-v-df64f7cf"]]);
579
579
 
580
580
  const kdsColorSwatchType = {
581
581
  LEARNER: "learner",
@@ -594,8 +594,14 @@ const kdsColorSwatchSize = {
594
594
  };
595
595
  const kdsColorSwatchSizes = Object.values(kdsColorSwatchSize);
596
596
 
597
- const _hoisted_1$H = ["role", "title", "aria-hidden", "aria-label"];
598
- const _sfc_main$14 = /* @__PURE__ */ defineComponent({
597
+ const _hoisted_1$J = ["role", "title", "aria-hidden", "aria-label"];
598
+ const RGBA_SHORT_HEX_LENGTH = 4;
599
+ const RGBA_LONG_HEX_LENGTH = 8;
600
+ const ALPHA_NIBBLE_INDEX = 3;
601
+ const ALPHA_BYTE_START = 6;
602
+ const RGB_SHORT_HEX_LENGTH = 3;
603
+ const RGB_LONG_HEX_LENGTH = 6;
604
+ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
599
605
  __name: "KdsColorSwatch",
600
606
  props: {
601
607
  color: {},
@@ -614,12 +620,52 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
614
620
  other: "var(--kds-color-nodes-and-variables-other)"
615
621
  };
616
622
  const isKdsColorSwatchType = (value) => Object.hasOwn(typeToTokenColor, value);
623
+ const isTransparentAlphaHexColor = (value) => {
624
+ const withoutHash = value.startsWith("#") ? value.slice(1) : value;
625
+ if (withoutHash.length === RGBA_SHORT_HEX_LENGTH) {
626
+ return withoutHash[ALPHA_NIBBLE_INDEX].toLowerCase() !== "f";
627
+ }
628
+ if (withoutHash.length === RGBA_LONG_HEX_LENGTH) {
629
+ return withoutHash.slice(ALPHA_BYTE_START).toLowerCase() !== "ff";
630
+ }
631
+ return false;
632
+ };
633
+ const toOpaqueHexColor = (value) => {
634
+ const withoutHash = value.startsWith("#") ? value.slice(1) : value;
635
+ if (withoutHash.length === RGBA_SHORT_HEX_LENGTH) {
636
+ return `#${withoutHash.slice(0, RGB_SHORT_HEX_LENGTH)}`;
637
+ }
638
+ if (withoutHash.length === RGBA_LONG_HEX_LENGTH) {
639
+ return `#${withoutHash.slice(0, RGB_LONG_HEX_LENGTH)}`;
640
+ }
641
+ return value;
642
+ };
617
643
  const backgroundColor = computed(() => {
618
644
  if (isKdsColorSwatchType(props.color)) {
619
645
  return typeToTokenColor[props.color];
620
646
  }
621
647
  return props.color;
622
648
  });
649
+ const showAlphaPreview = computed(
650
+ () => !isKdsColorSwatchType(props.color) && isTransparentAlphaHexColor(props.color)
651
+ );
652
+ const swatchStyle = computed(() => {
653
+ if (!showAlphaPreview.value) {
654
+ return { backgroundColor: backgroundColor.value };
655
+ }
656
+ const opaqueColor = toOpaqueHexColor(props.color);
657
+ return {
658
+ backgroundImage: `
659
+ linear-gradient(to right, ${backgroundColor.value} 0 50%, ${opaqueColor} 50% 100%),
660
+ repeating-conic-gradient(
661
+ var(--kds-color-background-neutral-active) 0 25%,
662
+ var(--kds-color-surface-default) 0 50%
663
+ )
664
+ `,
665
+ backgroundSize: "100% 100%, var(--kds-color-swatch-checker-size) var(--kds-color-swatch-checker-size)",
666
+ backgroundPosition: "0 0, 0 0"
667
+ };
668
+ });
623
669
  const accessibleTitle = computed(() => props.title?.trim() ?? "");
624
670
  const hasTitle = computed(() => accessibleTitle.value.length > 0);
625
671
  return (_ctx, _cache) => {
@@ -627,15 +673,15 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
627
673
  role: hasTitle.value ? "img" : "presentation",
628
674
  class: normalizeClass(["kds-color-swatch", __props.size]),
629
675
  title: hasTitle.value ? accessibleTitle.value : void 0,
630
- style: normalizeStyle({ backgroundColor: backgroundColor.value }),
676
+ style: normalizeStyle(swatchStyle.value),
631
677
  "aria-hidden": hasTitle.value ? void 0 : "true",
632
678
  "aria-label": hasTitle.value ? accessibleTitle.value : void 0
633
- }, null, 14, _hoisted_1$H);
679
+ }, null, 14, _hoisted_1$J);
634
680
  };
635
681
  }
636
682
  });
637
683
 
638
- const KdsColorSwatch = /* @__PURE__ */ _export_sfc$1(_sfc_main$14, [["__scopeId", "data-v-2e300e76"]]);
684
+ const KdsColorSwatch = /* @__PURE__ */ _export_sfc$1(_sfc_main$16, [["__scopeId", "data-v-91e0130d"]]);
639
685
 
640
686
  const kdsDarkModeType = {
641
687
  LIGHT: "light",
@@ -755,9 +801,9 @@ function useKdsIsTruncated(elementRef) {
755
801
  return { isTruncated };
756
802
  }
757
803
 
758
- const _hoisted_1$G = ["title", "aria-label"];
759
- const _hoisted_2$r = ["title"];
760
- const _sfc_main$13 = /* @__PURE__ */ defineComponent({
804
+ const _hoisted_1$I = ["title", "aria-label"];
805
+ const _hoisted_2$s = ["title"];
806
+ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
761
807
  __name: "KdsLiveStatus",
762
808
  props: {
763
809
  status: { default: "red" },
@@ -786,13 +832,13 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
786
832
  ref: labelEl,
787
833
  class: "label",
788
834
  title: unref(isTruncated) ? __props.label : void 0
789
- }, toDisplayString(__props.label), 9, _hoisted_2$r)) : createCommentVNode("", true)
790
- ], 10, _hoisted_1$G);
835
+ }, toDisplayString(__props.label), 9, _hoisted_2$s)) : createCommentVNode("", true)
836
+ ], 10, _hoisted_1$I);
791
837
  };
792
838
  }
793
839
  });
794
840
 
795
- const KdsLiveStatus = /* @__PURE__ */ _export_sfc$1(_sfc_main$13, [["__scopeId", "data-v-01555495"]]);
841
+ const KdsLiveStatus = /* @__PURE__ */ _export_sfc$1(_sfc_main$15, [["__scopeId", "data-v-01555495"]]);
796
842
 
797
843
  const kdsLiveStatusStatus = {
798
844
  RED: "red",
@@ -808,8 +854,8 @@ const kdsLiveStatusSize = {
808
854
  };
809
855
  const kdsLiveStatusSizes = Object.values(kdsLiveStatusSize);
810
856
 
811
- const _hoisted_1$F = ["data-style"];
812
- const _sfc_main$12 = /* @__PURE__ */ defineComponent({
857
+ const _hoisted_1$H = ["data-style"];
858
+ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
813
859
  __name: "KdsLoadingSpinner",
814
860
  props: {
815
861
  size: { default: "medium" },
@@ -834,12 +880,12 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
834
880
  cy: "60",
835
881
  r: "50"
836
882
  }, null, -1)
837
- ])], 10, _hoisted_1$F);
883
+ ])], 10, _hoisted_1$H);
838
884
  };
839
885
  }
840
886
  });
841
887
 
842
- const KdsLoadingSpinner = /* @__PURE__ */ _export_sfc$1(_sfc_main$12, [["__scopeId", "data-v-54835dc0"]]);
888
+ const KdsLoadingSpinner = /* @__PURE__ */ _export_sfc$1(_sfc_main$14, [["__scopeId", "data-v-54835dc0"]]);
843
889
 
844
890
  const kdsLoadingSpinnerVariant = {
845
891
  ON_PRIMARY: "onPrimary",
@@ -849,14 +895,14 @@ const kdsLoadingSpinnerVariants = Object.values(
849
895
  kdsLoadingSpinnerVariant
850
896
  );
851
897
 
852
- const _hoisted_1$E = ["role"];
853
- const _hoisted_2$q = { class: "header" };
854
- const _hoisted_3$h = { class: "headline" };
855
- const _hoisted_4$d = {
898
+ const _hoisted_1$G = ["role"];
899
+ const _hoisted_2$r = { class: "header" };
900
+ const _hoisted_3$i = { class: "headline" };
901
+ const _hoisted_4$e = {
856
902
  key: 0,
857
903
  class: "body"
858
904
  };
859
- const _sfc_main$11 = /* @__PURE__ */ defineComponent({
905
+ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
860
906
  __name: "KdsInlineMessage",
861
907
  props: {
862
908
  headline: {},
@@ -887,21 +933,21 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
887
933
  class: normalizeClass(classes.value),
888
934
  role: role.value
889
935
  }, [
890
- createElementVNode("div", _hoisted_2$q, [
936
+ createElementVNode("div", _hoisted_2$r, [
891
937
  createVNode(KdsIcon, {
892
938
  class: "icon",
893
939
  name: iconName.value,
894
940
  size: "small"
895
941
  }, null, 8, ["name"]),
896
- createElementVNode("div", _hoisted_3$h, toDisplayString(props.headline), 1)
942
+ createElementVNode("div", _hoisted_3$i, toDisplayString(props.headline), 1)
897
943
  ]),
898
- props.description ? (openBlock(), createElementBlock("div", _hoisted_4$d, toDisplayString(props.description), 1)) : createCommentVNode("", true)
899
- ], 10, _hoisted_1$E);
944
+ props.description ? (openBlock(), createElementBlock("div", _hoisted_4$e, toDisplayString(props.description), 1)) : createCommentVNode("", true)
945
+ ], 10, _hoisted_1$G);
900
946
  };
901
947
  }
902
948
  });
903
949
 
904
- const KdsInlineMessage = /* @__PURE__ */ _export_sfc$1(_sfc_main$11, [["__scopeId", "data-v-af14056f"]]);
950
+ const KdsInlineMessage = /* @__PURE__ */ _export_sfc$1(_sfc_main$13, [["__scopeId", "data-v-af14056f"]]);
905
951
 
906
952
  const kdsInlineMessageVariant = {
907
953
  ERROR: "error",
@@ -911,11 +957,11 @@ const kdsInlineMessageVariant = {
911
957
  };
912
958
  const kdsInlineMessageVariants = Object.values(kdsInlineMessageVariant);
913
959
 
914
- const _hoisted_1$D = {
960
+ const _hoisted_1$F = {
915
961
  key: 0,
916
962
  class: "label"
917
963
  };
918
- const _sfc_main$10 = /* @__PURE__ */ defineComponent({
964
+ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
919
965
  __name: "BaseButton",
920
966
  props: {
921
967
  size: { default: "medium" },
@@ -976,7 +1022,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
976
1022
  size: iconSize.value
977
1023
  }, null, 8, ["name", "size"])) : createCommentVNode("", true)
978
1024
  ], true),
979
- props.label ? (openBlock(), createElementBlock("span", _hoisted_1$D, toDisplayString(props.label), 1)) : createCommentVNode("", true),
1025
+ props.label ? (openBlock(), createElementBlock("span", _hoisted_1$F, toDisplayString(props.label), 1)) : createCommentVNode("", true),
980
1026
  props.trailingIcon && props.label ? (openBlock(), createBlock(KdsIcon, {
981
1027
  key: 1,
982
1028
  name: props.trailingIcon,
@@ -989,9 +1035,9 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
989
1035
  }
990
1036
  });
991
1037
 
992
- const BaseButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$10, [["__scopeId", "data-v-a696a1ec"]]);
1038
+ const BaseButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$12, [["__scopeId", "data-v-a696a1ec"]]);
993
1039
 
994
- const _sfc_main$$ = /* @__PURE__ */ defineComponent({
1040
+ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
995
1041
  __name: "KdsButton",
996
1042
  props: {
997
1043
  size: {},
@@ -1045,7 +1091,7 @@ const resolveNuxtLinkComponent = () => {
1045
1091
  return fallbackComponent;
1046
1092
  };
1047
1093
 
1048
- const _sfc_main$_ = /* @__PURE__ */ defineComponent({
1094
+ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
1049
1095
  __name: "KdsLinkButton",
1050
1096
  props: {
1051
1097
  size: {},
@@ -1264,12 +1310,12 @@ function prettyBytes(number, options) {
1264
1310
  return applyFixedWidth(result, options.fixedWidth);
1265
1311
  }
1266
1312
 
1267
- const _hoisted_1$C = { class: "label" };
1268
- const _hoisted_2$p = {
1313
+ const _hoisted_1$E = { class: "label" };
1314
+ const _hoisted_2$q = {
1269
1315
  key: 1,
1270
1316
  class: "file-size"
1271
1317
  };
1272
- const _sfc_main$Z = /* @__PURE__ */ defineComponent({
1318
+ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
1273
1319
  __name: "KdsLink",
1274
1320
  props: {
1275
1321
  to: {},
@@ -1369,13 +1415,13 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
1369
1415
  onClick
1370
1416
  }, {
1371
1417
  default: withCtx(() => [
1372
- createElementVNode("span", _hoisted_1$C, toDisplayString(__props.label), 1),
1418
+ createElementVNode("span", _hoisted_1$E, toDisplayString(__props.label), 1),
1373
1419
  variant.value === "external" ? (openBlock(), createBlock(KdsIcon, {
1374
1420
  key: 0,
1375
1421
  name: "external-link",
1376
1422
  size: "xsmall"
1377
1423
  })) : createCommentVNode("", true),
1378
- normalizedFileSize.value ? (openBlock(), createElementBlock("span", _hoisted_2$p, toDisplayString(normalizedFileSize.value), 1)) : createCommentVNode("", true)
1424
+ normalizedFileSize.value ? (openBlock(), createElementBlock("span", _hoisted_2$q, toDisplayString(normalizedFileSize.value), 1)) : createCommentVNode("", true)
1379
1425
  ]),
1380
1426
  _: 1
1381
1427
  }, 8, ["class", "to", "download", "target", "rel", "title", "aria-disabled"]);
@@ -1383,9 +1429,9 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
1383
1429
  }
1384
1430
  });
1385
1431
 
1386
- const KdsLink = /* @__PURE__ */ _export_sfc$1(_sfc_main$Z, [["__scopeId", "data-v-65e776f1"]]);
1432
+ const KdsLink = /* @__PURE__ */ _export_sfc$1(_sfc_main$$, [["__scopeId", "data-v-65e776f1"]]);
1387
1433
 
1388
- const _sfc_main$Y = /* @__PURE__ */ defineComponent({
1434
+ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
1389
1435
  __name: "KdsToggleButton",
1390
1436
  props: /* @__PURE__ */ mergeModels({
1391
1437
  size: {},
@@ -1421,9 +1467,9 @@ const kdsToggleButtonVariant = {
1421
1467
  };
1422
1468
  const kdsToggleButtonVariants = Object.values(kdsToggleButtonVariant);
1423
1469
 
1424
- const _hoisted_1$B = ["data-visible"];
1425
- const _hoisted_2$o = ["data-visible"];
1426
- const _sfc_main$X = /* @__PURE__ */ defineComponent({
1470
+ const _hoisted_1$D = ["data-visible"];
1471
+ const _hoisted_2$p = ["data-visible"];
1472
+ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
1427
1473
  __name: "KdsProgressButton",
1428
1474
  props: /* @__PURE__ */ mergeModels({
1429
1475
  size: { default: "medium" },
@@ -1484,7 +1530,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
1484
1530
  name: props.leadingIcon,
1485
1531
  size: iconSize.value
1486
1532
  }, null, 8, ["name", "size"])
1487
- ], 8, _hoisted_1$B),
1533
+ ], 8, _hoisted_1$D),
1488
1534
  createElementVNode("span", {
1489
1535
  class: "spinner",
1490
1536
  "data-visible": state.value === "progress"
@@ -1493,7 +1539,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
1493
1539
  size: iconSize.value,
1494
1540
  variant: __props.variant === "filled" ? "onPrimary" : "onSurface"
1495
1541
  }, null, 8, ["size", "variant"])
1496
- ], 8, _hoisted_2$o)
1542
+ ], 8, _hoisted_2$p)
1497
1543
  ], 2)
1498
1544
  ]),
1499
1545
  _: 1
@@ -1502,7 +1548,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
1502
1548
  }
1503
1549
  });
1504
1550
 
1505
- const KdsProgressButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$X, [["__scopeId", "data-v-d38d7ade"]]);
1551
+ const KdsProgressButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$Z, [["__scopeId", "data-v-d38d7ade"]]);
1506
1552
 
1507
1553
  const kdsProgressButtonState = {
1508
1554
  DEFAULT: "default",
@@ -1512,17 +1558,17 @@ const kdsProgressButtonState = {
1512
1558
  };
1513
1559
  const kdsProgressButtonStates = Object.values(kdsProgressButtonState);
1514
1560
 
1515
- const _hoisted_1$A = { class: "kds-empty-state" };
1516
- const _hoisted_2$n = { class: "kds-empty-state-headline" };
1517
- const _hoisted_3$g = {
1561
+ const _hoisted_1$C = { class: "kds-empty-state" };
1562
+ const _hoisted_2$o = { class: "kds-empty-state-headline" };
1563
+ const _hoisted_3$h = {
1518
1564
  key: 1,
1519
1565
  class: "kds-empty-state-description"
1520
1566
  };
1521
- const _hoisted_4$c = {
1567
+ const _hoisted_4$d = {
1522
1568
  key: 2,
1523
1569
  class: "kds-empty-state-action"
1524
1570
  };
1525
- const _sfc_main$W = /* @__PURE__ */ defineComponent({
1571
+ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
1526
1572
  __name: "KdsEmptyState",
1527
1573
  props: {
1528
1574
  headline: {},
@@ -1538,10 +1584,10 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
1538
1584
  () => props.button && "to" in props.button && props.button.to !== void 0
1539
1585
  );
1540
1586
  const buttonComponent = computed(
1541
- () => isLinkButton.value ? _sfc_main$_ : _sfc_main$$
1587
+ () => isLinkButton.value ? _sfc_main$10 : _sfc_main$11
1542
1588
  );
1543
1589
  return (_ctx, _cache) => {
1544
- return openBlock(), createElementBlock("div", _hoisted_1$A, [
1590
+ return openBlock(), createElementBlock("div", _hoisted_1$C, [
1545
1591
  props.loadingSpinner ? (openBlock(), createBlock(KdsLoadingSpinner, {
1546
1592
  key: 0,
1547
1593
  "data-testid": "loading-spinner",
@@ -1549,9 +1595,9 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
1549
1595
  variant: "onSurface",
1550
1596
  "aria-hidden": "true"
1551
1597
  })) : createCommentVNode("", true),
1552
- createElementVNode("p", _hoisted_2$n, toDisplayString(props.headline), 1),
1553
- props.description ? (openBlock(), createElementBlock("p", _hoisted_3$g, toDisplayString(props.description), 1)) : createCommentVNode("", true),
1554
- props.button ? (openBlock(), createElementBlock("div", _hoisted_4$c, [
1598
+ createElementVNode("p", _hoisted_2$o, toDisplayString(props.headline), 1),
1599
+ props.description ? (openBlock(), createElementBlock("p", _hoisted_3$h, toDisplayString(props.description), 1)) : createCommentVNode("", true),
1600
+ props.button ? (openBlock(), createElementBlock("div", _hoisted_4$d, [
1555
1601
  (openBlock(), createBlock(resolveDynamicComponent(buttonComponent.value), mergeProps(props.button, {
1556
1602
  onClick: _cache[0] || (_cache[0] = ($event) => emit("buttonClick", $event))
1557
1603
  }), null, 16))
@@ -1561,9 +1607,9 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
1561
1607
  }
1562
1608
  });
1563
1609
 
1564
- const KdsEmptyState = /* @__PURE__ */ _export_sfc$1(_sfc_main$W, [["__scopeId", "data-v-5da4d570"]]);
1610
+ const KdsEmptyState = /* @__PURE__ */ _export_sfc$1(_sfc_main$Y, [["__scopeId", "data-v-5da4d570"]]);
1565
1611
 
1566
- const _sfc_main$V = /* @__PURE__ */ defineComponent({
1612
+ const _sfc_main$X = /* @__PURE__ */ defineComponent({
1567
1613
  __name: "ListItemAccessory",
1568
1614
  props: {
1569
1615
  accessory: {},
@@ -1614,13 +1660,13 @@ const kdsListItemVariant = {
1614
1660
  LARGE: "large"
1615
1661
  };
1616
1662
 
1617
- const _hoisted_1$z = ["id", "role", "aria-selected", "aria-disabled"];
1618
- const _hoisted_2$m = {
1663
+ const _hoisted_1$B = ["id", "role", "aria-selected", "aria-disabled"];
1664
+ const _hoisted_2$n = {
1619
1665
  key: 0,
1620
1666
  class: "accessory"
1621
1667
  };
1622
- const _hoisted_3$f = { class: "content" };
1623
- const _hoisted_4$b = ["title"];
1668
+ const _hoisted_3$g = { class: "content" };
1669
+ const _hoisted_4$c = ["title"];
1624
1670
  const _hoisted_5$7 = {
1625
1671
  key: 0,
1626
1672
  class: "prefix"
@@ -1635,7 +1681,7 @@ const _hoisted_9$1 = {
1635
1681
  key: 2,
1636
1682
  class: "trailing-item-reserve-space"
1637
1683
  };
1638
- const _sfc_main$U = /* @__PURE__ */ defineComponent({
1684
+ const _sfc_main$W = /* @__PURE__ */ defineComponent({
1639
1685
  __name: "KdsListItem",
1640
1686
  props: {
1641
1687
  id: {},
@@ -1689,14 +1735,14 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
1689
1735
  ]),
1690
1736
  onClick
1691
1737
  }, [
1692
- props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$m, [
1693
- createVNode(_sfc_main$V, {
1738
+ props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$n, [
1739
+ createVNode(_sfc_main$X, {
1694
1740
  accessory: props.accessory,
1695
1741
  size: accessorySize.value,
1696
1742
  disabled: __props.disabled
1697
1743
  }, null, 8, ["accessory", "size", "disabled"])
1698
1744
  ])) : createCommentVNode("", true),
1699
- createElementVNode("span", _hoisted_3$f, [
1745
+ createElementVNode("span", _hoisted_3$g, [
1700
1746
  createElementVNode("span", {
1701
1747
  ref_key: "labelEl",
1702
1748
  ref: labelEl,
@@ -1707,7 +1753,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
1707
1753
  createElementVNode("span", {
1708
1754
  class: normalizeClass({ special: __props.special })
1709
1755
  }, toDisplayString(props.label), 3)
1710
- ], 8, _hoisted_4$b),
1756
+ ], 8, _hoisted_4$c),
1711
1757
  props.subText ? (openBlock(), createElementBlock("span", {
1712
1758
  key: 0,
1713
1759
  ref_key: "subtextEl",
@@ -1724,29 +1770,29 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
1724
1770
  size: "small"
1725
1771
  }, null, 8, ["name"])) : (openBlock(), createElementBlock("span", _hoisted_9$1))
1726
1772
  ])
1727
- ], 10, _hoisted_1$z);
1773
+ ], 10, _hoisted_1$B);
1728
1774
  };
1729
1775
  }
1730
1776
  });
1731
1777
 
1732
- const KdsListItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$U, [["__scopeId", "data-v-822789ec"]]);
1778
+ const KdsListItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$W, [["__scopeId", "data-v-822789ec"]]);
1733
1779
 
1734
- const _sfc_main$T = { };
1780
+ const _sfc_main$V = { };
1735
1781
 
1736
- const _hoisted_1$y = { class: "kds-list-item-divider" };
1782
+ const _hoisted_1$A = { class: "kds-list-item-divider" };
1737
1783
 
1738
1784
  function _sfc_render$8(_ctx, _cache) {
1739
- return (openBlock(), createElementBlock("hr", _hoisted_1$y))
1785
+ return (openBlock(), createElementBlock("hr", _hoisted_1$A))
1740
1786
  }
1741
- const ListItemDivider = /*#__PURE__*/_export_sfc$1(_sfc_main$T, [['render',_sfc_render$8],['__scopeId',"data-v-3ee92695"]]);
1787
+ const ListItemDivider = /*#__PURE__*/_export_sfc$1(_sfc_main$V, [['render',_sfc_render$8],['__scopeId',"data-v-3ee92695"]]);
1742
1788
 
1743
- const _hoisted_1$x = { class: "kds-list-item-section-title" };
1744
- const _hoisted_2$l = {
1789
+ const _hoisted_1$z = { class: "kds-list-item-section-title" };
1790
+ const _hoisted_2$m = {
1745
1791
  key: 0,
1746
1792
  class: "icon"
1747
1793
  };
1748
- const _hoisted_3$e = ["title"];
1749
- const _sfc_main$S = /* @__PURE__ */ defineComponent({
1794
+ const _hoisted_3$f = ["title"];
1795
+ const _sfc_main$U = /* @__PURE__ */ defineComponent({
1750
1796
  __name: "ListItemSectionTitle",
1751
1797
  props: {
1752
1798
  label: {},
@@ -1757,8 +1803,8 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
1757
1803
  const labelEl = useTemplateRef("labelEl");
1758
1804
  const { isTruncated } = useKdsIsTruncated(labelEl);
1759
1805
  return (_ctx, _cache) => {
1760
- return openBlock(), createElementBlock("div", _hoisted_1$x, [
1761
- props.leadingIcon ? (openBlock(), createElementBlock("span", _hoisted_2$l, [
1806
+ return openBlock(), createElementBlock("div", _hoisted_1$z, [
1807
+ props.leadingIcon ? (openBlock(), createElementBlock("span", _hoisted_2$m, [
1762
1808
  createVNode(KdsIcon, {
1763
1809
  name: props.leadingIcon,
1764
1810
  size: "small"
@@ -1769,18 +1815,18 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
1769
1815
  ref: labelEl,
1770
1816
  class: "label",
1771
1817
  title: unref(isTruncated) ? props.label : void 0
1772
- }, toDisplayString(props.label), 9, _hoisted_3$e)
1818
+ }, toDisplayString(props.label), 9, _hoisted_3$f)
1773
1819
  ]);
1774
1820
  };
1775
1821
  }
1776
1822
  });
1777
1823
 
1778
- const ListItemSectionTitle = /* @__PURE__ */ _export_sfc$1(_sfc_main$S, [["__scopeId", "data-v-53382531"]]);
1824
+ const ListItemSectionTitle = /* @__PURE__ */ _export_sfc$1(_sfc_main$U, [["__scopeId", "data-v-53382531"]]);
1779
1825
 
1780
- const _hoisted_1$w = ["role", "aria-busy", "aria-label", "aria-activedescendant", "tabindex"];
1781
- const _hoisted_2$k = ["role"];
1826
+ const _hoisted_1$y = ["role", "aria-busy", "aria-label", "aria-activedescendant", "tabindex"];
1827
+ const _hoisted_2$l = ["role"];
1782
1828
  const loadingStateText = "Loading entries";
1783
- const _sfc_main$R = /* @__PURE__ */ defineComponent({
1829
+ const _sfc_main$T = /* @__PURE__ */ defineComponent({
1784
1830
  __name: "KdsListContainer",
1785
1831
  props: {
1786
1832
  possibleValues: {},
@@ -1804,8 +1850,37 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
1804
1850
  }
1805
1851
  return elementId?.slice(idPrefix.length + 1);
1806
1852
  }
1853
+ const warnedDuplicateIds = /* @__PURE__ */ new Set();
1854
+ const deduplicationResult = computed(() => {
1855
+ const seen = /* @__PURE__ */ new Set();
1856
+ const duplicateIds = [];
1857
+ const items = props.possibleValues.filter((o) => {
1858
+ if (seen.has(o.id)) {
1859
+ duplicateIds.push(o.id);
1860
+ return false;
1861
+ }
1862
+ seen.add(o.id);
1863
+ return true;
1864
+ });
1865
+ return { items, duplicateIds };
1866
+ });
1867
+ const sanitizedValues = computed(() => deduplicationResult.value.items);
1868
+ watch(
1869
+ () => deduplicationResult.value.duplicateIds,
1870
+ (duplicateIds) => {
1871
+ for (const id of duplicateIds) {
1872
+ if (!warnedDuplicateIds.has(id)) {
1873
+ console.warn(
1874
+ `[KdsListContainer] Duplicate option id "${id}" detected. Only the first occurrence will be used.`
1875
+ );
1876
+ warnedDuplicateIds.add(id);
1877
+ }
1878
+ }
1879
+ },
1880
+ { immediate: true }
1881
+ );
1807
1882
  const prefixedValues = computed(
1808
- () => (__props.loading ? [] : props.possibleValues).map((o) => ({
1883
+ () => (__props.loading ? [] : sanitizedValues.value).map((o) => ({
1809
1884
  ...o,
1810
1885
  id: `${idPrefix}-${o.id}`
1811
1886
  }))
@@ -2021,21 +2096,21 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
2021
2096
  headline: __props.loading ? loadingStateText : __props.emptyText,
2022
2097
  "loading-spinner": __props.loading
2023
2098
  }, null, 8, ["headline", "loading-spinner"])
2024
- ], 8, _hoisted_2$k)) : createCommentVNode("", true)
2025
- ], 16, _hoisted_1$w);
2099
+ ], 8, _hoisted_2$l)) : createCommentVNode("", true)
2100
+ ], 16, _hoisted_1$y);
2026
2101
  };
2027
2102
  }
2028
2103
  });
2029
2104
 
2030
- const KdsListContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$R, [["__scopeId", "data-v-446a5ba1"]]);
2105
+ const KdsListContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$T, [["__scopeId", "data-v-d8750fc1"]]);
2031
2106
 
2032
2107
  const KdsListContainer$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2033
2108
  __proto__: null,
2034
2109
  default: KdsListContainer
2035
2110
  }, Symbol.toStringTag, { value: 'Module' }));
2036
2111
 
2037
- const _hoisted_1$v = { class: "kds-menu-container" };
2038
- const _sfc_main$Q = /* @__PURE__ */ defineComponent({
2112
+ const _hoisted_1$x = { class: "kds-menu-container" };
2113
+ const _sfc_main$S = /* @__PURE__ */ defineComponent({
2039
2114
  __name: "KdsMenuContainer",
2040
2115
  props: {
2041
2116
  id: {},
@@ -2059,7 +2134,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
2059
2134
  }
2060
2135
  });
2061
2136
  return (_ctx, _cache) => {
2062
- return openBlock(), createElementBlock("div", _hoisted_1$v, [
2137
+ return openBlock(), createElementBlock("div", _hoisted_1$x, [
2063
2138
  createVNode(KdsListContainer, {
2064
2139
  id: props.id,
2065
2140
  ref_key: "listContainerEl",
@@ -2076,14 +2151,14 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
2076
2151
  }
2077
2152
  });
2078
2153
 
2079
- const KdsMenuContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$Q, [["__scopeId", "data-v-d87656d8"]]);
2154
+ const KdsMenuContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$S, [["__scopeId", "data-v-d87656d8"]]);
2080
2155
 
2081
- const _hoisted_1$u = ["id", "popover", "role"];
2082
- const _hoisted_2$j = {
2156
+ const _hoisted_1$w = ["id", "popover", "role"];
2157
+ const _hoisted_2$k = {
2083
2158
  key: 0,
2084
2159
  class: "kds-popover-default-content"
2085
2160
  };
2086
- const _sfc_main$P = /* @__PURE__ */ defineComponent({
2161
+ const _sfc_main$R = /* @__PURE__ */ defineComponent({
2087
2162
  __name: "KdsPopover",
2088
2163
  props: /* @__PURE__ */ mergeModels({
2089
2164
  placement: { default: "bottom-left" },
@@ -2127,21 +2202,21 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
2127
2202
  onToggle
2128
2203
  }, [
2129
2204
  renderSlot(_ctx.$slots, "default", {}, () => [
2130
- props.content?.trim().length ? (openBlock(), createElementBlock("div", _hoisted_2$j, toDisplayString(props.content), 1)) : createCommentVNode("", true)
2205
+ props.content?.trim().length ? (openBlock(), createElementBlock("div", _hoisted_2$k, toDisplayString(props.content), 1)) : createCommentVNode("", true)
2131
2206
  ], true)
2132
- ], 46, _hoisted_1$u);
2207
+ ], 46, _hoisted_1$w);
2133
2208
  };
2134
2209
  }
2135
2210
  });
2136
2211
 
2137
- const KdsPopover = /* @__PURE__ */ _export_sfc$1(_sfc_main$P, [["__scopeId", "data-v-83c11cee"]]);
2212
+ const KdsPopover = /* @__PURE__ */ _export_sfc$1(_sfc_main$R, [["__scopeId", "data-v-83c11cee"]]);
2138
2213
 
2139
2214
  const KdsPopover$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2140
2215
  __proto__: null,
2141
2216
  default: KdsPopover
2142
2217
  }, Symbol.toStringTag, { value: 'Module' }));
2143
2218
 
2144
- const _sfc_main$O = /* @__PURE__ */ defineComponent({
2219
+ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
2145
2220
  ...{
2146
2221
  inheritAttrs: false
2147
2222
  },
@@ -2189,7 +2264,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
2189
2264
  };
2190
2265
  return (_ctx, _cache) => {
2191
2266
  return openBlock(), createElementBlock(Fragment, null, [
2192
- createVNode(_sfc_main$Y, mergeProps({
2267
+ createVNode(_sfc_main$_, mergeProps({
2193
2268
  modelValue: isMenuOpen.value,
2194
2269
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isMenuOpen.value = $event)
2195
2270
  }, toggleButtonProps.value, {
@@ -2223,7 +2298,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
2223
2298
  }
2224
2299
  });
2225
2300
 
2226
- const _sfc_main$N = /* @__PURE__ */ defineComponent({
2301
+ const _sfc_main$P = /* @__PURE__ */ defineComponent({
2227
2302
  __name: "KdsSplitButton",
2228
2303
  props: {
2229
2304
  size: { default: "medium" },
@@ -2310,7 +2385,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
2310
2385
  }
2311
2386
  });
2312
2387
 
2313
- const KdsSplitButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$N, [["__scopeId", "data-v-f9ca012e"]]);
2388
+ const KdsSplitButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$P, [["__scopeId", "data-v-f9ca012e"]]);
2314
2389
 
2315
2390
  const kdsButtonSize = {
2316
2391
  XSMALL: "xsmall",
@@ -2326,9 +2401,9 @@ const kdsButtonVariant = {
2326
2401
  };
2327
2402
  const kdsButtonVariants = Object.values(kdsButtonVariant);
2328
2403
 
2329
- const _hoisted_1$t = { class: "kds-label-wrapper" };
2330
- const _hoisted_2$i = ["id", "for", "title"];
2331
- const _sfc_main$M = /* @__PURE__ */ defineComponent({
2404
+ const _hoisted_1$v = { class: "kds-label-wrapper" };
2405
+ const _hoisted_2$j = ["id", "for", "title"];
2406
+ const _sfc_main$O = /* @__PURE__ */ defineComponent({
2332
2407
  __name: "KdsLabel",
2333
2408
  props: {
2334
2409
  label: {},
@@ -2345,7 +2420,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
2345
2420
  const labelEl = useTemplateRef("labelEl");
2346
2421
  const { isTruncated } = useKdsIsTruncated(labelEl);
2347
2422
  return (_ctx, _cache) => {
2348
- return openBlock(), createElementBlock("div", _hoisted_1$t, [
2423
+ return openBlock(), createElementBlock("div", _hoisted_1$v, [
2349
2424
  createElementVNode("label", {
2350
2425
  id: props.id,
2351
2426
  ref_key: "labelEl",
@@ -2353,7 +2428,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
2353
2428
  for: props.for,
2354
2429
  class: "label",
2355
2430
  title: unref(isTruncated) ? props.label : void 0
2356
- }, toDisplayString(props.label), 9, _hoisted_2$i),
2431
+ }, toDisplayString(props.label), 9, _hoisted_2$j),
2357
2432
  props.description ? (openBlock(), createBlock(unref(KdsInfoToggleButton), {
2358
2433
  key: 0,
2359
2434
  content: props.description,
@@ -2364,11 +2439,11 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
2364
2439
  }
2365
2440
  });
2366
2441
 
2367
- const KdsLabel = /* @__PURE__ */ _export_sfc$1(_sfc_main$M, [["__scopeId", "data-v-13bea091"]]);
2442
+ const KdsLabel = /* @__PURE__ */ _export_sfc$1(_sfc_main$O, [["__scopeId", "data-v-13bea091"]]);
2368
2443
 
2369
- const _hoisted_1$s = ["id"];
2370
- const _hoisted_2$h = { class: "subtext-text" };
2371
- const _sfc_main$L = /* @__PURE__ */ defineComponent({
2444
+ const _hoisted_1$u = ["id"];
2445
+ const _hoisted_2$i = { class: "subtext-text" };
2446
+ const _sfc_main$N = /* @__PURE__ */ defineComponent({
2372
2447
  __name: "KdsSubText",
2373
2448
  props: {
2374
2449
  id: {},
@@ -2399,27 +2474,27 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
2399
2474
  variant: "onSurface",
2400
2475
  "aria-hidden": "true"
2401
2476
  })) : createCommentVNode("", true),
2402
- createElementVNode("span", _hoisted_2$h, toDisplayString(props.subText), 1)
2403
- ], 10, _hoisted_1$s)) : createCommentVNode("", true);
2477
+ createElementVNode("span", _hoisted_2$i, toDisplayString(props.subText), 1)
2478
+ ], 10, _hoisted_1$u)) : createCommentVNode("", true);
2404
2479
  };
2405
2480
  }
2406
2481
  });
2407
2482
 
2408
- const KdsSubText = /* @__PURE__ */ _export_sfc$1(_sfc_main$L, [["__scopeId", "data-v-2e6ba10c"]]);
2483
+ const KdsSubText = /* @__PURE__ */ _export_sfc$1(_sfc_main$N, [["__scopeId", "data-v-2e6ba10c"]]);
2409
2484
 
2410
- const _hoisted_1$r = ["disabled", "title", "aria-label", "aria-checked", "aria-describedby", "aria-invalid"];
2411
- const _hoisted_2$g = { class: "control" };
2412
- const _hoisted_3$d = {
2485
+ const _hoisted_1$t = ["disabled", "title", "aria-label", "aria-checked", "aria-describedby", "aria-invalid"];
2486
+ const _hoisted_2$h = { class: "control" };
2487
+ const _hoisted_3$e = {
2413
2488
  key: 0,
2414
2489
  class: "content"
2415
2490
  };
2416
- const _hoisted_4$a = { class: "label" };
2491
+ const _hoisted_4$b = { class: "label" };
2417
2492
  const _hoisted_5$6 = ["id"];
2418
2493
  const _hoisted_6$4 = {
2419
2494
  key: 0,
2420
2495
  class: "subtext-wrapper"
2421
2496
  };
2422
- const _sfc_main$K = /* @__PURE__ */ defineComponent({
2497
+ const _sfc_main$M = /* @__PURE__ */ defineComponent({
2423
2498
  __name: "BaseCheckbox",
2424
2499
  props: /* @__PURE__ */ mergeModels({
2425
2500
  disabled: { type: Boolean, default: false },
@@ -2492,7 +2567,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
2492
2567
  role: "checkbox",
2493
2568
  onClick: handleClick
2494
2569
  }, [
2495
- createElementVNode("div", _hoisted_2$g, [
2570
+ createElementVNode("div", _hoisted_2$h, [
2496
2571
  icon.value ? (openBlock(), createBlock(KdsIcon, {
2497
2572
  key: 0,
2498
2573
  name: icon.value,
@@ -2500,15 +2575,15 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
2500
2575
  size: "xsmall"
2501
2576
  }, null, 8, ["name"])) : createCommentVNode("", true)
2502
2577
  ]),
2503
- props.label || props.helperText ? (openBlock(), createElementBlock("div", _hoisted_3$d, [
2504
- createElementVNode("div", _hoisted_4$a, toDisplayString(props.label), 1),
2578
+ props.label || props.helperText ? (openBlock(), createElementBlock("div", _hoisted_3$e, [
2579
+ createElementVNode("div", _hoisted_4$b, toDisplayString(props.label), 1),
2505
2580
  props.helperText ? (openBlock(), createElementBlock("div", {
2506
2581
  key: 0,
2507
2582
  id: unref(helperId),
2508
2583
  class: "helper-text"
2509
2584
  }, toDisplayString(props.helperText), 9, _hoisted_5$6)) : createCommentVNode("", true)
2510
2585
  ])) : createCommentVNode("", true)
2511
- ], 10, _hoisted_1$r),
2586
+ ], 10, _hoisted_1$t),
2512
2587
  props.subText || props.preserveSubTextSpace ? (openBlock(), createElementBlock("div", _hoisted_6$4, [
2513
2588
  createVNode(KdsSubText, {
2514
2589
  id: unref(descriptionId),
@@ -2522,9 +2597,9 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
2522
2597
  }
2523
2598
  });
2524
2599
 
2525
- const BaseCheckbox = /* @__PURE__ */ _export_sfc$1(_sfc_main$K, [["__scopeId", "data-v-7bfc5667"]]);
2600
+ const BaseCheckbox = /* @__PURE__ */ _export_sfc$1(_sfc_main$M, [["__scopeId", "data-v-7bfc5667"]]);
2526
2601
 
2527
- const _sfc_main$J = /* @__PURE__ */ defineComponent({
2602
+ const _sfc_main$L = /* @__PURE__ */ defineComponent({
2528
2603
  __name: "KdsCheckbox",
2529
2604
  props: /* @__PURE__ */ mergeModels({
2530
2605
  disabled: { type: Boolean, default: false },
@@ -2554,11 +2629,11 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
2554
2629
  }
2555
2630
  });
2556
2631
 
2557
- const _hoisted_1$q = ["id", "role", "aria-label", "aria-labelledby", "aria-describedby"];
2558
- const _hoisted_2$f = ["id"];
2559
- const _hoisted_3$c = ["title"];
2560
- const _hoisted_4$9 = { class: "kds-fieldset-content" };
2561
- const _sfc_main$I = /* @__PURE__ */ defineComponent({
2632
+ const _hoisted_1$s = ["id", "role", "aria-label", "aria-labelledby", "aria-describedby"];
2633
+ const _hoisted_2$g = ["id"];
2634
+ const _hoisted_3$d = ["title"];
2635
+ const _hoisted_4$a = { class: "kds-fieldset-content" };
2636
+ const _sfc_main$K = /* @__PURE__ */ defineComponent({
2562
2637
  __name: "BaseFieldsetWrapper",
2563
2638
  props: {
2564
2639
  id: {},
@@ -2604,14 +2679,14 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
2604
2679
  ref: legendTextEl,
2605
2680
  class: "legend-text",
2606
2681
  title: unref(isTruncated) ? props.label : void 0
2607
- }, toDisplayString(props.label), 9, _hoisted_3$c),
2682
+ }, toDisplayString(props.label), 9, _hoisted_3$d),
2608
2683
  props.description ? (openBlock(), createBlock(unref(KdsInfoToggleButton), {
2609
2684
  key: 0,
2610
2685
  content: props.description,
2611
2686
  hidden: !isHovered.value
2612
2687
  }, null, 8, ["content", "hidden"])) : createCommentVNode("", true)
2613
- ], 8, _hoisted_2$f)) : createCommentVNode("", true),
2614
- createElementVNode("div", _hoisted_4$9, [
2688
+ ], 8, _hoisted_2$g)) : createCommentVNode("", true),
2689
+ createElementVNode("div", _hoisted_4$a, [
2615
2690
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
2616
2691
  ]),
2617
2692
  createVNode(KdsSubText, {
@@ -2621,14 +2696,14 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
2621
2696
  validating: props.validating,
2622
2697
  "preserve-sub-text-space": props.preserveSubTextSpace
2623
2698
  }, null, 8, ["id", "sub-text", "error", "validating", "preserve-sub-text-space"])
2624
- ], 40, _hoisted_1$q);
2699
+ ], 40, _hoisted_1$s);
2625
2700
  };
2626
2701
  }
2627
2702
  });
2628
2703
 
2629
- const BaseFieldsetWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$I, [["__scopeId", "data-v-a44731da"]]);
2704
+ const BaseFieldsetWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$K, [["__scopeId", "data-v-a44731da"]]);
2630
2705
 
2631
- const _sfc_main$H = /* @__PURE__ */ defineComponent({
2706
+ const _sfc_main$J = /* @__PURE__ */ defineComponent({
2632
2707
  __name: "KdsCheckboxGroup",
2633
2708
  props: /* @__PURE__ */ mergeModels({
2634
2709
  id: {},
@@ -2707,7 +2782,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
2707
2782
  }
2708
2783
  });
2709
2784
 
2710
- const KdsCheckboxGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$H, [["__scopeId", "data-v-c6536296"]]);
2785
+ const KdsCheckboxGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$J, [["__scopeId", "data-v-c6536296"]]);
2711
2786
 
2712
2787
  const kdsCheckboxGroupAlignment = {
2713
2788
  VERTICAL: "vertical",
@@ -2723,19 +2798,19 @@ const kdsCheckboxValue = {
2723
2798
  };
2724
2799
  const kdsCheckboxValues = Object.values(kdsCheckboxValue);
2725
2800
 
2726
- const _hoisted_1$p = ["aria-checked", "aria-describedby", "aria-invalid", "disabled"];
2727
- const _hoisted_2$e = { class: "control" };
2728
- const _hoisted_3$b = {
2801
+ const _hoisted_1$r = ["aria-checked", "aria-describedby", "aria-invalid", "disabled"];
2802
+ const _hoisted_2$f = { class: "control" };
2803
+ const _hoisted_3$c = {
2729
2804
  key: 0,
2730
2805
  class: "dot",
2731
2806
  viewBox: "0 0 2 2",
2732
2807
  "aria-hidden": "true",
2733
2808
  focusable: "false"
2734
2809
  };
2735
- const _hoisted_4$8 = { class: "content" };
2810
+ const _hoisted_4$9 = { class: "content" };
2736
2811
  const _hoisted_5$5 = { class: "label" };
2737
2812
  const _hoisted_6$3 = ["id"];
2738
- const _sfc_main$G = /* @__PURE__ */ defineComponent({
2813
+ const _sfc_main$I = /* @__PURE__ */ defineComponent({
2739
2814
  __name: "KdsRadioButton",
2740
2815
  props: /* @__PURE__ */ mergeModels({
2741
2816
  text: {},
@@ -2775,8 +2850,8 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
2775
2850
  type: "button",
2776
2851
  onClick: handleClick
2777
2852
  }, [
2778
- createElementVNode("div", _hoisted_2$e, [
2779
- modelValue.value ? (openBlock(), createElementBlock("svg", _hoisted_3$b, [..._cache[0] || (_cache[0] = [
2853
+ createElementVNode("div", _hoisted_2$f, [
2854
+ modelValue.value ? (openBlock(), createElementBlock("svg", _hoisted_3$c, [..._cache[0] || (_cache[0] = [
2780
2855
  createElementVNode("circle", {
2781
2856
  cx: "1",
2782
2857
  cy: "1",
@@ -2784,7 +2859,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
2784
2859
  }, null, -1)
2785
2860
  ])])) : createCommentVNode("", true)
2786
2861
  ]),
2787
- createElementVNode("div", _hoisted_4$8, [
2862
+ createElementVNode("div", _hoisted_4$9, [
2788
2863
  createElementVNode("div", _hoisted_5$5, toDisplayString(props.text), 1),
2789
2864
  props.helperText ? (openBlock(), createElementBlock("div", {
2790
2865
  key: 0,
@@ -2792,12 +2867,12 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
2792
2867
  class: "helper-text"
2793
2868
  }, toDisplayString(props.helperText), 9, _hoisted_6$3)) : createCommentVNode("", true)
2794
2869
  ])
2795
- ], 10, _hoisted_1$p);
2870
+ ], 10, _hoisted_1$r);
2796
2871
  };
2797
2872
  }
2798
2873
  });
2799
2874
 
2800
- const KdsRadioButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$G, [["__scopeId", "data-v-f4f6392a"]]);
2875
+ const KdsRadioButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$I, [["__scopeId", "data-v-f4f6392a"]]);
2801
2876
 
2802
2877
  const useRadioSelection = ({
2803
2878
  selectedId,
@@ -2919,7 +2994,7 @@ const useRadioSelection = ({
2919
2994
  };
2920
2995
  };
2921
2996
 
2922
- const _sfc_main$F = /* @__PURE__ */ defineComponent({
2997
+ const _sfc_main$H = /* @__PURE__ */ defineComponent({
2923
2998
  __name: "KdsRadioButtonGroup",
2924
2999
  props: /* @__PURE__ */ mergeModels({
2925
3000
  id: {},
@@ -2994,10 +3069,10 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
2994
3069
  }
2995
3070
  });
2996
3071
 
2997
- const KdsRadioButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$F, [["__scopeId", "data-v-d78ed4a2"]]);
3072
+ const KdsRadioButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$H, [["__scopeId", "data-v-d78ed4a2"]]);
2998
3073
 
2999
- const _hoisted_1$o = ["aria-checked", "aria-label", "disabled", "tabindex", "title"];
3000
- const _sfc_main$E = /* @__PURE__ */ defineComponent({
3074
+ const _hoisted_1$q = ["aria-checked", "aria-label", "disabled", "tabindex", "title"];
3075
+ const _sfc_main$G = /* @__PURE__ */ defineComponent({
3001
3076
  __name: "ValueSwitchItem",
3002
3077
  props: {
3003
3078
  selected: { type: Boolean },
@@ -3047,12 +3122,12 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
3047
3122
  name: props.trailingIcon,
3048
3123
  size: __props.size
3049
3124
  }, null, 8, ["name", "size"])) : createCommentVNode("", true)
3050
- ], 10, _hoisted_1$o);
3125
+ ], 10, _hoisted_1$q);
3051
3126
  };
3052
3127
  }
3053
3128
  });
3054
3129
 
3055
- const ValueSwitchItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$E, [["__scopeId", "data-v-5c6f0f1f"]]);
3130
+ const ValueSwitchItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$G, [["__scopeId", "data-v-5c6f0f1f"]]);
3056
3131
 
3057
3132
  const useValueSwitchIconHiding = ({
3058
3133
  width,
@@ -3103,7 +3178,7 @@ const useValueSwitchIconHiding = ({
3103
3178
  };
3104
3179
  };
3105
3180
 
3106
- const _sfc_main$D = /* @__PURE__ */ defineComponent({
3181
+ const _sfc_main$F = /* @__PURE__ */ defineComponent({
3107
3182
  __name: "KdsValueSwitch",
3108
3183
  props: /* @__PURE__ */ mergeModels({
3109
3184
  id: {},
@@ -3190,7 +3265,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
3190
3265
  }
3191
3266
  });
3192
3267
 
3193
- const KdsValueSwitch = /* @__PURE__ */ _export_sfc$1(_sfc_main$D, [["__scopeId", "data-v-640271e0"]]);
3268
+ const KdsValueSwitch = /* @__PURE__ */ _export_sfc$1(_sfc_main$F, [["__scopeId", "data-v-640271e0"]]);
3194
3269
 
3195
3270
  const kdsRadioButtonGroupAlignment = {
3196
3271
  VERTICAL: "vertical",
@@ -3210,7 +3285,7 @@ const kdsValueSwitchVariant = {
3210
3285
  };
3211
3286
  const kdsValueSwitchVariants = Object.values(kdsValueSwitchVariant);
3212
3287
 
3213
- const _sfc_main$C = /* @__PURE__ */ defineComponent({
3288
+ const _sfc_main$E = /* @__PURE__ */ defineComponent({
3214
3289
  __name: "BaseFormFieldWrapper",
3215
3290
  props: {
3216
3291
  id: {},
@@ -3262,18 +3337,18 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
3262
3337
  }
3263
3338
  });
3264
3339
 
3265
- const BaseFormFieldWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$C, [["__scopeId", "data-v-5d99c134"]]);
3340
+ const BaseFormFieldWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$E, [["__scopeId", "data-v-5d99c134"]]);
3266
3341
 
3267
- const _hoisted_1$n = {
3342
+ const _hoisted_1$p = {
3268
3343
  key: 0,
3269
3344
  class: "icon-wrapper leading"
3270
3345
  };
3271
- const _hoisted_2$d = {
3346
+ const _hoisted_2$e = {
3272
3347
  key: 1,
3273
3348
  class: "leading-slot"
3274
3349
  };
3275
- const _hoisted_3$a = ["id", "value", "type", "inputmode", "placeholder", "disabled", "autocomplete", "min", "max", "step", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "role", "pattern", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext", "aria-activedescendant", "aria-haspopup", "aria-controls", "aria-expanded", "aria-autocomplete"];
3276
- const _hoisted_4$7 = ["aria-disabled"];
3350
+ const _hoisted_3$b = ["id", "value", "type", "inputmode", "placeholder", "disabled", "autocomplete", "min", "max", "step", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "role", "pattern", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext", "aria-activedescendant", "aria-haspopup", "aria-controls", "aria-expanded", "aria-autocomplete"];
3351
+ const _hoisted_4$8 = ["aria-disabled"];
3277
3352
  const _hoisted_5$4 = {
3278
3353
  key: 4,
3279
3354
  class: "trailing-slot"
@@ -3282,7 +3357,7 @@ const _hoisted_6$2 = {
3282
3357
  key: 5,
3283
3358
  class: "icon-wrapper trailing"
3284
3359
  };
3285
- const _sfc_main$B = /* @__PURE__ */ defineComponent({
3360
+ const _sfc_main$D = /* @__PURE__ */ defineComponent({
3286
3361
  __name: "BaseInput",
3287
3362
  props: /* @__PURE__ */ mergeModels({
3288
3363
  id: {},
@@ -3361,13 +3436,13 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
3361
3436
  }),
3362
3437
  onClick: handleContainerClick
3363
3438
  }, [
3364
- props.leadingIcon ? (openBlock(), createElementBlock("div", _hoisted_1$n, [
3439
+ props.leadingIcon ? (openBlock(), createElementBlock("div", _hoisted_1$p, [
3365
3440
  props.leadingIcon ? (openBlock(), createBlock(KdsIcon, {
3366
3441
  key: 0,
3367
3442
  name: props.leadingIcon
3368
3443
  }, null, 8, ["name"])) : createCommentVNode("", true)
3369
3444
  ])) : createCommentVNode("", true),
3370
- _ctx.$slots.leading ? (openBlock(), createElementBlock("div", _hoisted_2$d, [
3445
+ _ctx.$slots.leading ? (openBlock(), createElementBlock("div", _hoisted_2$e, [
3371
3446
  renderSlot(_ctx.$slots, "leading", {}, void 0, true)
3372
3447
  ])) : createCommentVNode("", true),
3373
3448
  createElementVNode("input", {
@@ -3403,7 +3478,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
3403
3478
  onBlur: _cache[1] || (_cache[1] = ($event) => emit("blur", $event)),
3404
3479
  onKeydown: _cache[2] || (_cache[2] = ($event) => emit("keydown", $event)),
3405
3480
  onClick: _cache[3] || (_cache[3] = ($event) => emit("click", $event))
3406
- }, null, 42, _hoisted_3$a),
3481
+ }, null, 42, _hoisted_3$b),
3407
3482
  props.unit ? (openBlock(), createElementBlock("span", {
3408
3483
  key: 2,
3409
3484
  class: normalizeClass({
@@ -3412,8 +3487,8 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
3412
3487
  disabled: __props.disabled
3413
3488
  }),
3414
3489
  "aria-disabled": __props.disabled || void 0
3415
- }, toDisplayString(props.unit), 11, _hoisted_4$7)) : createCommentVNode("", true),
3416
- __props.clearable && hasValue.value && !__props.disabled ? (openBlock(), createBlock(_sfc_main$$, {
3490
+ }, toDisplayString(props.unit), 11, _hoisted_4$8)) : createCommentVNode("", true),
3491
+ __props.clearable && hasValue.value && !__props.disabled ? (openBlock(), createBlock(_sfc_main$11, {
3417
3492
  key: 3,
3418
3493
  class: "clear-button",
3419
3494
  type: "button",
@@ -3437,7 +3512,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
3437
3512
  }
3438
3513
  });
3439
3514
 
3440
- const BaseInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$B, [["__scopeId", "data-v-92291903"]]);
3515
+ const BaseInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$D, [["__scopeId", "data-v-92291903"]]);
3441
3516
 
3442
3517
  const usePointerHandler = (updateFromEvent) => {
3443
3518
  const activePointerId = ref(null);
@@ -3477,8 +3552,141 @@ const usePointerHandler = (updateFromEvent) => {
3477
3552
  };
3478
3553
  };
3479
3554
 
3480
- const _sfc_main$A = /* @__PURE__ */ defineComponent({
3481
- __name: "KdsTextInput",
3555
+ const additionalGroupSeparators = [" ", " ", " "];
3556
+ const decimalSeparatorSample = 1.1;
3557
+ const groupSeparatorSample = 1000.1;
3558
+ const countFractionDigits = (value) => {
3559
+ if (!Number.isFinite(value)) {
3560
+ return 0;
3561
+ }
3562
+ const exp = value.toExponential();
3563
+ const match = /^[-+]?(\d+)(?:\.(\d+))?e([+-]?\d+)$/i.exec(exp);
3564
+ if (!match) {
3565
+ return 0;
3566
+ }
3567
+ const fractionDigitsInMantissa = match[2]?.length ?? 0;
3568
+ const exponent = Number.parseInt(match[3], 10);
3569
+ if (exponent >= 0) {
3570
+ return Math.max(0, fractionDigitsInMantissa - exponent);
3571
+ }
3572
+ return fractionDigitsInMantissa + Math.abs(exponent);
3573
+ };
3574
+ const createKdsNumberParser = (params) => {
3575
+ const formatter = new Intl.NumberFormat(params.locale);
3576
+ const decimalSeparator = formatter.formatToParts(decimalSeparatorSample).find((part) => part.type === "decimal")?.value ?? ".";
3577
+ const groupSeparator = formatter.formatToParts(groupSeparatorSample).find((part) => part.type === "group")?.value ?? ",";
3578
+ const removeGroupingSeparators = (input) => [groupSeparator, ...additionalGroupSeparators].reduce(
3579
+ (acc, groupSep) => groupSep.length > 0 ? acc.split(groupSep).join("") : acc,
3580
+ input
3581
+ );
3582
+ const formattersByMaxDecimals = /* @__PURE__ */ new Map();
3583
+ const getFormatterForMaxDecimals = (maxDecimals) => {
3584
+ const cached = formattersByMaxDecimals.get(maxDecimals);
3585
+ if (cached) {
3586
+ return cached;
3587
+ }
3588
+ const created = new Intl.NumberFormat(params.locale, {
3589
+ useGrouping: false,
3590
+ minimumFractionDigits: 0,
3591
+ maximumFractionDigits: maxDecimals
3592
+ });
3593
+ formattersByMaxDecimals.set(maxDecimals, created);
3594
+ return created;
3595
+ };
3596
+ const stepFractionDigits = countFractionDigits(params.step);
3597
+ const precisionFactor = Number(`1e${stepFractionDigits}`);
3598
+ const formatForDisplay = (value) => {
3599
+ if (!Number.isFinite(value)) {
3600
+ return "";
3601
+ }
3602
+ const valueDecimals = countFractionDigits(value);
3603
+ const maxDecimals = Math.max(stepFractionDigits, valueDecimals);
3604
+ return getFormatterForMaxDecimals(maxDecimals).format(value);
3605
+ };
3606
+ const roundToStep = (value) => {
3607
+ if (!Number.isFinite(value)) {
3608
+ return Number.NaN;
3609
+ }
3610
+ const step = params.step;
3611
+ if (!Number.isFinite(step) || step <= 0) {
3612
+ return value;
3613
+ }
3614
+ if (!Number.isFinite(precisionFactor) || precisionFactor <= 0) {
3615
+ return value;
3616
+ }
3617
+ const scaledNext = Math.round(value * precisionFactor);
3618
+ const scaledStep = Math.round(step * precisionFactor);
3619
+ if (scaledStep === 0) {
3620
+ return value;
3621
+ }
3622
+ const roundedScaled = Math.round(scaledNext / scaledStep) * scaledStep;
3623
+ return roundedScaled / precisionFactor;
3624
+ };
3625
+ const isValidNormalizedNumber = (normalized) => (
3626
+ // Accept plain decimals as well as scientific notation.
3627
+ // Note: whitespace is removed earlier; we don't accept grouping separators here.
3628
+ /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/.test(normalized)
3629
+ );
3630
+ const parseWithLocaleDecimal = (input, localeDecimal) => {
3631
+ const withoutGrouping = removeGroupingSeparators(input);
3632
+ const normalized = withoutGrouping.split(localeDecimal).join(".");
3633
+ if (!isValidNormalizedNumber(normalized)) {
3634
+ return Number.NaN;
3635
+ }
3636
+ const parsed = Number.parseFloat(normalized);
3637
+ return Number.isFinite(parsed) ? parsed : Number.NaN;
3638
+ };
3639
+ const parseWithFallbackDot = (input) => {
3640
+ const lastDotIndex = input.lastIndexOf(".");
3641
+ const digitsAfterDot = input.slice(lastDotIndex + 1);
3642
+ const looksLikeDecimal = digitsAfterDot.length > 0 && digitsAfterDot.length <= 2;
3643
+ const normalized = looksLikeDecimal ? `${removeGroupingSeparators(input.slice(0, lastDotIndex))}.${removeGroupingSeparators(
3644
+ digitsAfterDot
3645
+ )}` : removeGroupingSeparators(input);
3646
+ if (!isValidNormalizedNumber(normalized)) {
3647
+ return Number.NaN;
3648
+ }
3649
+ const parsed = Number.parseFloat(normalized);
3650
+ return Number.isFinite(parsed) ? parsed : Number.NaN;
3651
+ };
3652
+ const parseWithoutLocaleDecimal = (input) => {
3653
+ const normalized = removeGroupingSeparators(input);
3654
+ if (!isValidNormalizedNumber(normalized)) {
3655
+ return Number.NaN;
3656
+ }
3657
+ const parsed = Number.parseFloat(normalized);
3658
+ return Number.isFinite(parsed) ? parsed : Number.NaN;
3659
+ };
3660
+ function parseFromInput(value) {
3661
+ const trimmed = value.trim();
3662
+ if (trimmed.length === 0) {
3663
+ return Number.NaN;
3664
+ }
3665
+ const localeDecimal = decimalSeparator;
3666
+ const hasLocaleDecimal = localeDecimal.length > 0 && trimmed.includes(localeDecimal);
3667
+ if (hasLocaleDecimal) {
3668
+ return parseWithLocaleDecimal(trimmed, localeDecimal);
3669
+ }
3670
+ if (localeDecimal !== "." && trimmed.includes(".")) {
3671
+ return parseWithFallbackDot(trimmed);
3672
+ }
3673
+ return parseWithoutLocaleDecimal(trimmed);
3674
+ }
3675
+ return {
3676
+ locale: params.locale,
3677
+ decimalSeparator,
3678
+ groupSeparator,
3679
+ stepFractionDigits,
3680
+ formatForDisplay,
3681
+ parseFromInput,
3682
+ roundToStep
3683
+ };
3684
+ };
3685
+
3686
+ const REPEAT_INITIAL_DELAY_MS = 400;
3687
+ const REPEAT_INTERVAL_MS = 100;
3688
+ const _sfc_main$C = /* @__PURE__ */ defineComponent({
3689
+ __name: "KdsNumberInput",
3482
3690
  props: /* @__PURE__ */ mergeModels({
3483
3691
  description: {},
3484
3692
  label: {},
@@ -3491,20 +3699,242 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
3491
3699
  placeholder: {},
3492
3700
  disabled: { type: Boolean, default: false },
3493
3701
  autocomplete: {},
3494
- suggestions: {},
3495
- suggestionsHeadline: {}
3702
+ unit: { default: "" },
3703
+ min: {},
3704
+ max: {},
3705
+ step: { default: 1 }
3496
3706
  }, {
3497
- "modelValue": { default: "" },
3707
+ "modelValue": { default: Number.NaN },
3498
3708
  "modelModifiers": {}
3499
3709
  }),
3500
3710
  emits: ["update:modelValue"],
3501
3711
  setup(__props, { expose: __expose }) {
3502
- const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace"]);
3712
+ const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace", "unit", "step"]);
3503
3713
  const modelValue = useModel(__props, "modelValue");
3504
- const baseInput = useTemplateRef("baseInput");
3505
- const popoverRef = useTemplateRef("popoverRef");
3506
- const listContainerRef = useTemplateRef("listContainerRef");
3507
- const popoverOpen = ref(false);
3714
+ const isFocused = ref(false);
3715
+ const localValue = ref("");
3716
+ const numberParser = computed(
3717
+ () => createKdsNumberParser({ locale: "en-US", step: __props.step })
3718
+ );
3719
+ const ariaValuenow = computed(
3720
+ () => Number.isFinite(modelValue.value) ? modelValue.value : void 0
3721
+ );
3722
+ const ariaValuetext = computed(() => {
3723
+ if (!Number.isFinite(modelValue.value)) {
3724
+ return void 0;
3725
+ }
3726
+ return numberParser.value.formatForDisplay(modelValue.value);
3727
+ });
3728
+ const clamp = (value) => {
3729
+ if (!Number.isFinite(value)) {
3730
+ return Number.NaN;
3731
+ }
3732
+ let result = value;
3733
+ if (props.min !== void 0 && !Number.isNaN(props.min)) {
3734
+ result = Math.max(props.min, result);
3735
+ }
3736
+ if (props.max !== void 0 && !Number.isNaN(props.max)) {
3737
+ result = Math.min(props.max, result);
3738
+ }
3739
+ return result;
3740
+ };
3741
+ watch(
3742
+ () => modelValue.value,
3743
+ (next) => {
3744
+ if (isFocused.value) {
3745
+ return;
3746
+ }
3747
+ localValue.value = numberParser.value.formatForDisplay(next);
3748
+ },
3749
+ { immediate: true }
3750
+ );
3751
+ const canDecrease = computed(() => {
3752
+ if (__props.disabled) {
3753
+ return false;
3754
+ }
3755
+ if (props.min === void 0 || Number.isNaN(props.min)) {
3756
+ return true;
3757
+ }
3758
+ if (Number.isNaN(modelValue.value)) {
3759
+ return true;
3760
+ }
3761
+ return modelValue.value > props.min;
3762
+ });
3763
+ const canIncrease = computed(() => {
3764
+ if (__props.disabled) {
3765
+ return false;
3766
+ }
3767
+ if (props.max === void 0 || Number.isNaN(props.max)) {
3768
+ return true;
3769
+ }
3770
+ if (Number.isNaN(modelValue.value)) {
3771
+ return true;
3772
+ }
3773
+ return modelValue.value < props.max;
3774
+ });
3775
+ const adjustByStep = (direction) => {
3776
+ if (__props.step <= 0) {
3777
+ return;
3778
+ }
3779
+ const base = Number.isFinite(modelValue.value) ? modelValue.value : numberParser.value.parseFromInput(localValue.value);
3780
+ const nextRaw = Number.isFinite(base) ? base + direction * __props.step : 0;
3781
+ const rounded = numberParser.value.roundToStep(nextRaw);
3782
+ const next = clamp(rounded);
3783
+ modelValue.value = next;
3784
+ localValue.value = numberParser.value.formatForDisplay(next);
3785
+ };
3786
+ const handleKeydown = (event) => {
3787
+ if (__props.disabled) {
3788
+ return;
3789
+ }
3790
+ if (event.key === "ArrowUp" && canIncrease.value) {
3791
+ event.preventDefault();
3792
+ adjustByStep(1);
3793
+ return;
3794
+ }
3795
+ if (event.key === "ArrowDown" && canDecrease.value) {
3796
+ event.preventDefault();
3797
+ adjustByStep(-1);
3798
+ }
3799
+ };
3800
+ const handleUpdateModelValue = (value) => {
3801
+ localValue.value = value;
3802
+ modelValue.value = numberParser.value.parseFromInput(value);
3803
+ };
3804
+ const baseInput = useTemplateRef("baseInput");
3805
+ let repeatTimer = null;
3806
+ let isStepping = false;
3807
+ const handleBlur = () => {
3808
+ if (isStepping) {
3809
+ baseInput.value?.focus();
3810
+ return;
3811
+ }
3812
+ isFocused.value = false;
3813
+ const parsed = numberParser.value.parseFromInput(localValue.value);
3814
+ const normalized = clamp(parsed);
3815
+ modelValue.value = normalized;
3816
+ localValue.value = numberParser.value.formatForDisplay(normalized);
3817
+ };
3818
+ const stopRepeating = () => {
3819
+ if (repeatTimer !== null) {
3820
+ clearTimeout(repeatTimer);
3821
+ repeatTimer = null;
3822
+ }
3823
+ isStepping = false;
3824
+ };
3825
+ const startRepeating = (direction) => {
3826
+ stopRepeating();
3827
+ isStepping = true;
3828
+ adjustByStep(direction);
3829
+ repeatTimer = setTimeout(function tick() {
3830
+ adjustByStep(direction);
3831
+ repeatTimer = setTimeout(tick, REPEAT_INTERVAL_MS);
3832
+ }, REPEAT_INITIAL_DELAY_MS);
3833
+ };
3834
+ onBeforeUnmount(stopRepeating);
3835
+ const handleButtonClick = (direction, event) => {
3836
+ if (event.detail !== 0) {
3837
+ return;
3838
+ }
3839
+ adjustByStep(direction);
3840
+ };
3841
+ __expose({
3842
+ focus: () => baseInput.value?.focus()
3843
+ });
3844
+ return (_ctx, _cache) => {
3845
+ return openBlock(), createBlock(BaseFormFieldWrapper, mergeProps(props, {
3846
+ error: __props.error,
3847
+ validating: __props.validating,
3848
+ "preserve-sub-text-space": __props.preserveSubTextSpace
3849
+ }), {
3850
+ default: withCtx((slotProps) => [
3851
+ createVNode(BaseInput, mergeProps({
3852
+ ref_key: "baseInput",
3853
+ ref: baseInput
3854
+ }, slotProps, {
3855
+ "model-value": localValue.value,
3856
+ type: "text",
3857
+ inputmode: Number.isInteger(__props.step) ? "numeric" : "decimal",
3858
+ placeholder: props.placeholder,
3859
+ disabled: __props.disabled,
3860
+ error: __props.error,
3861
+ autocomplete: props.autocomplete,
3862
+ unit: __props.unit,
3863
+ role: "spinbutton",
3864
+ "aria-valuenow": ariaValuenow.value,
3865
+ "aria-valuemin": props.min,
3866
+ "aria-valuemax": props.max,
3867
+ "aria-valuetext": ariaValuetext.value,
3868
+ "onUpdate:modelValue": handleUpdateModelValue,
3869
+ onKeydown: handleKeydown,
3870
+ onFocus: _cache[4] || (_cache[4] = ($event) => isFocused.value = true),
3871
+ onBlur: handleBlur
3872
+ }), {
3873
+ trailing: withCtx(() => [
3874
+ createVNode(_sfc_main$11, {
3875
+ type: "button",
3876
+ size: "xsmall",
3877
+ variant: "outlined",
3878
+ "leading-icon": "minus",
3879
+ ariaLabel: `Decrease ${props.label ?? props.ariaLabel}`,
3880
+ disabled: !canDecrease.value,
3881
+ onClick: _cache[0] || (_cache[0] = ($event) => handleButtonClick(-1, $event)),
3882
+ onPointerdown: _cache[1] || (_cache[1] = ($event) => startRepeating(-1)),
3883
+ onPointerup: stopRepeating,
3884
+ onPointerleave: stopRepeating,
3885
+ onPointercancel: stopRepeating
3886
+ }, null, 8, ["ariaLabel", "disabled"]),
3887
+ createVNode(_sfc_main$11, {
3888
+ type: "button",
3889
+ size: "xsmall",
3890
+ variant: "outlined",
3891
+ "leading-icon": "plus",
3892
+ ariaLabel: `Increase ${props.label ?? props.ariaLabel}`,
3893
+ disabled: !canIncrease.value,
3894
+ onClick: _cache[2] || (_cache[2] = ($event) => handleButtonClick(1, $event)),
3895
+ onPointerdown: _cache[3] || (_cache[3] = ($event) => startRepeating(1)),
3896
+ onPointerup: stopRepeating,
3897
+ onPointerleave: stopRepeating,
3898
+ onPointercancel: stopRepeating
3899
+ }, null, 8, ["ariaLabel", "disabled"])
3900
+ ]),
3901
+ _: 1
3902
+ }, 16, ["model-value", "inputmode", "placeholder", "disabled", "error", "autocomplete", "unit", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext"])
3903
+ ]),
3904
+ _: 1
3905
+ }, 16, ["error", "validating", "preserve-sub-text-space"]);
3906
+ };
3907
+ }
3908
+ });
3909
+
3910
+ const _sfc_main$B = /* @__PURE__ */ defineComponent({
3911
+ __name: "KdsTextInput",
3912
+ props: /* @__PURE__ */ mergeModels({
3913
+ description: {},
3914
+ label: {},
3915
+ ariaLabel: {},
3916
+ id: {},
3917
+ subText: {},
3918
+ error: { type: Boolean, default: false },
3919
+ validating: { type: Boolean, default: false },
3920
+ preserveSubTextSpace: { type: Boolean, default: false },
3921
+ placeholder: {},
3922
+ disabled: { type: Boolean, default: false },
3923
+ autocomplete: {},
3924
+ suggestions: {},
3925
+ suggestionsHeadline: {}
3926
+ }, {
3927
+ "modelValue": { default: "" },
3928
+ "modelModifiers": {}
3929
+ }),
3930
+ emits: ["update:modelValue"],
3931
+ setup(__props, { expose: __expose }) {
3932
+ const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace"]);
3933
+ const modelValue = useModel(__props, "modelValue");
3934
+ const baseInput = useTemplateRef("baseInput");
3935
+ const popoverRef = useTemplateRef("popoverRef");
3936
+ const listContainerRef = useTemplateRef("listContainerRef");
3937
+ const popoverOpen = ref(false);
3508
3938
  const isFocused = ref(false);
3509
3939
  const hasSuggestions = computed(() => Boolean(props.suggestions?.length));
3510
3940
  const filteredSuggestions = computed(() => {
@@ -3647,7 +4077,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
3647
4077
  }
3648
4078
  });
3649
4079
 
3650
- const KdsTextInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$A, [["__scopeId", "data-v-1740ce83"]]);
4080
+ const KdsTextInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$B, [["__scopeId", "data-v-1740ce83"]]);
3651
4081
 
3652
4082
  const HEX_RADIX = 16;
3653
4083
  const RGB_MAX = 255;
@@ -3664,6 +4094,9 @@ const HEX_PAIR_LENGTH = 2;
3664
4094
  const HEX_RED_START = 1;
3665
4095
  const HEX_GREEN_START = HEX_RED_START + HEX_PAIR_LENGTH;
3666
4096
  const HEX_BLUE_START = HEX_GREEN_START + HEX_PAIR_LENGTH;
4097
+ const HEX_ALPHA_START = HEX_BLUE_START + HEX_PAIR_LENGTH;
4098
+ const FULL_HEX_COLOR_LENGTH = 9;
4099
+ const HEX_WITH_HASH_LENGTH$1 = 7;
3667
4100
  const clamp$1 = (value, min, max) => Math.min(max, Math.max(min, value));
3668
4101
  const round$1 = (value) => Math.round(value);
3669
4102
  const padHex = (value) => value.toString(HEX_RADIX).padStart(2, "0");
@@ -3677,12 +4110,16 @@ const normalizeHexColor = (value) => {
3677
4110
  const [r, g, b] = withoutHash.split("");
3678
4111
  return `#${r}${r}${g}${g}${b}${b}`.toUpperCase();
3679
4112
  }
3680
- if (/^[0-9a-fA-F]{6}$/.test(withoutHash)) {
4113
+ if (/^[0-9a-fA-F]{4}$/.test(withoutHash)) {
4114
+ const [r, g, b, a] = withoutHash.split("");
4115
+ return `#${r}${r}${g}${g}${b}${b}${a}${a}`.toUpperCase();
4116
+ }
4117
+ if (/^([0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(withoutHash)) {
3681
4118
  return `#${withoutHash}`.toUpperCase();
3682
4119
  }
3683
4120
  return null;
3684
4121
  };
3685
- const hexToRgb = (hex) => {
4122
+ const hexToRgba = (hex) => {
3686
4123
  const normalized = normalizeHexColor(hex);
3687
4124
  if (!normalized) {
3688
4125
  return null;
@@ -3699,7 +4136,12 @@ const hexToRgb = (hex) => {
3699
4136
  normalized.slice(HEX_BLUE_START, HEX_BLUE_START + HEX_PAIR_LENGTH),
3700
4137
  HEX_RADIX
3701
4138
  );
3702
- return { r, g, b };
4139
+ const hasAlpha = normalized.length === FULL_HEX_COLOR_LENGTH;
4140
+ const a = hasAlpha ? Number.parseInt(
4141
+ normalized.slice(HEX_ALPHA_START, HEX_ALPHA_START + HEX_PAIR_LENGTH),
4142
+ HEX_RADIX
4143
+ ) / RGB_MAX : 1;
4144
+ return { r, g, b, a };
3703
4145
  };
3704
4146
  const rgbToHex = ({ r, g, b }) => {
3705
4147
  const rr = clamp$1(round$1(r), 0, RGB_MAX);
@@ -3707,6 +4149,10 @@ const rgbToHex = ({ r, g, b }) => {
3707
4149
  const bb = clamp$1(round$1(b), 0, RGB_MAX);
3708
4150
  return `#${padHex(rr)}${padHex(gg)}${padHex(bb)}`.toUpperCase();
3709
4151
  };
4152
+ const rgbaToHex = ({ r, g, b, a }) => {
4153
+ const alpha = clamp$1(round$1(a * RGB_MAX), 0, RGB_MAX);
4154
+ return `${rgbToHex({ r, g, b })}${padHex(alpha)}`.toUpperCase();
4155
+ };
3710
4156
  const rgbToHsv = ({ r, g, b }) => {
3711
4157
  const rr = clamp$1(r / RGB_MAX, 0, 1);
3712
4158
  const gg = clamp$1(g / RGB_MAX, 0, 1);
@@ -3767,46 +4213,153 @@ const hsvToRgb = ({ h, s, v }) => {
3767
4213
  b: round$1((bPrime + m) * RGB_MAX)
3768
4214
  };
3769
4215
  };
3770
- const hsvToHex = (hsv) => rgbToHex(hsvToRgb(hsv));
4216
+ const removeAlphaFromHexInput = (next) => {
4217
+ const trimmed = next.trim();
4218
+ const hasHash = trimmed.startsWith("#");
4219
+ const withoutHash = hasHash ? trimmed.slice(1) : trimmed;
4220
+ if (/^[0-9a-fA-F]{8}$/.test(withoutHash)) {
4221
+ const rgbWithoutAlpha = withoutHash.slice(0, HEX_WITH_HASH_LENGTH$1 - 1);
4222
+ return hasHash ? `#${rgbWithoutAlpha}` : rgbWithoutAlpha;
4223
+ }
4224
+ return next;
4225
+ };
3771
4226
 
3772
- const _hoisted_1$m = { class: "kds-color-picker" };
3773
- const _hoisted_2$c = ["aria-valuetext"];
3774
- const _hoisted_3$9 = ["aria-valuenow", "aria-valuetext"];
3775
- const DEFAULT_HUE_DEG = 270;
3776
- const DEFAULT_SATURATION = 0.8;
3777
- const DEFAULT_VALUE = 0.9;
3778
- const HUE_MAX_DEG = 360;
3779
- const HUE_MAX_EXCLUSIVE_DEG = 359.999;
3780
- const PERCENT = 100;
3781
- const KEYBOARD_STEP = 0.01;
3782
- const KEYBOARD_LARGE_STEP = 0.1;
3783
- const HUE_KEYBOARD_STEP_DEG = 1;
3784
- const HUE_KEYBOARD_LARGE_STEP_DEG = 10;
3785
- const TO_BOTTOM_GRADIENT = "linear-gradient(to bottom, transparent, black)";
3786
- const _sfc_main$z = /* @__PURE__ */ defineComponent({
3787
- __name: "ColorPicker",
3788
- props: {
3789
- "modelValue": { default: "" },
4227
+ const _hoisted_1$o = ["aria-label", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext"];
4228
+ const _sfc_main$A = /* @__PURE__ */ defineComponent({
4229
+ __name: "ColorPickerSlider",
4230
+ props: /* @__PURE__ */ mergeModels({
4231
+ label: {},
4232
+ valueNow: {},
4233
+ valueMin: {},
4234
+ valueMax: {},
4235
+ valueText: {},
4236
+ min: {},
4237
+ max: {},
4238
+ step: {},
4239
+ largeStep: {}
4240
+ }, {
4241
+ "modelValue": { required: true },
3790
4242
  "modelModifiers": {}
3791
- },
4243
+ }),
3792
4244
  emits: ["update:modelValue"],
3793
4245
  setup(__props) {
4246
+ useCssVars((_ctx) => ({
4247
+ "v087094b8": handlePosition.value
4248
+ }));
4249
+ const props = __props;
3794
4250
  const modelValue = useModel(__props, "modelValue");
3795
- const colorspaceEl = ref(null);
3796
- const hueEl = ref(null);
3797
- const hue = ref(DEFAULT_HUE_DEG);
4251
+ const sliderEl = useTemplateRef("sliderEl");
4252
+ const setFromPointerEvent = (event) => {
4253
+ const el = sliderEl.value;
4254
+ if (!el) {
4255
+ return;
4256
+ }
4257
+ const rect = el.getBoundingClientRect();
4258
+ const x = (event.clientX - rect.left) / rect.width;
4259
+ const ratio = clamp$1(x, 0, 1);
4260
+ modelValue.value = props.min + ratio * (props.max - props.min);
4261
+ };
4262
+ const { onPointerDown, onPointerMove, onPointerUp } = usePointerHandler(setFromPointerEvent);
4263
+ const onKeyDown = (event) => {
4264
+ const delta = event.shiftKey ? props.largeStep : props.step;
4265
+ let handled = true;
4266
+ switch (event.key) {
4267
+ case "ArrowLeft":
4268
+ modelValue.value = clamp$1(modelValue.value - delta, props.min, props.max);
4269
+ break;
4270
+ case "ArrowRight":
4271
+ modelValue.value = clamp$1(modelValue.value + delta, props.min, props.max);
4272
+ break;
4273
+ default:
4274
+ handled = false;
4275
+ }
4276
+ if (handled) {
4277
+ event.preventDefault();
4278
+ }
4279
+ };
4280
+ const handlePosition = computed(() => {
4281
+ const ratio = (modelValue.value - props.min) / (props.max - props.min);
4282
+ return `${clamp$1(ratio, 0, 1) * 100}%`;
4283
+ });
4284
+ return (_ctx, _cache) => {
4285
+ return openBlock(), createElementBlock("div", {
4286
+ ref_key: "sliderEl",
4287
+ ref: sliderEl,
4288
+ class: "kds-color-picker-slider",
4289
+ role: "slider",
4290
+ "aria-label": __props.label,
4291
+ "aria-valuenow": __props.valueNow,
4292
+ "aria-valuemin": __props.valueMin,
4293
+ "aria-valuemax": __props.valueMax,
4294
+ "aria-valuetext": __props.valueText,
4295
+ tabindex: "0",
4296
+ onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
4297
+ (...args) => unref(onPointerDown) && unref(onPointerDown)(...args)),
4298
+ onPointermove: _cache[1] || (_cache[1] = withModifiers(
4299
+ //@ts-ignore
4300
+ (...args) => unref(onPointerMove) && unref(onPointerMove)(...args),
4301
+ ["prevent"]
4302
+ )),
4303
+ onPointerup: _cache[2] || (_cache[2] = //@ts-ignore
4304
+ (...args) => unref(onPointerUp) && unref(onPointerUp)(...args)),
4305
+ onPointercancel: _cache[3] || (_cache[3] = //@ts-ignore
4306
+ (...args) => unref(onPointerUp) && unref(onPointerUp)(...args)),
4307
+ onLostpointercapture: _cache[4] || (_cache[4] = //@ts-ignore
4308
+ (...args) => unref(onPointerUp) && unref(onPointerUp)(...args)),
4309
+ onKeydown: onKeyDown
4310
+ }, [..._cache[5] || (_cache[5] = [
4311
+ createElementVNode("div", { class: "handle" }, null, -1)
4312
+ ])], 40, _hoisted_1$o);
4313
+ };
4314
+ }
4315
+ });
4316
+
4317
+ const ColorPickerSlider = /* @__PURE__ */ _export_sfc$1(_sfc_main$A, [["__scopeId", "data-v-f4be2bd4"]]);
4318
+
4319
+ const _hoisted_1$n = { class: "kds-color-picker" };
4320
+ const _hoisted_2$d = ["aria-valuetext"];
4321
+ const _hoisted_3$a = { class: "value-inputs" };
4322
+ const DEFAULT_HUE_DEG = 270;
4323
+ const DEFAULT_SATURATION = 0.8;
4324
+ const DEFAULT_VALUE = 0.9;
4325
+ const DEFAULT_ALPHA = 1;
4326
+ const HUE_MAX_DEG = 360;
4327
+ const HUE_MAX_EXCLUSIVE_DEG = 359.999;
4328
+ const PERCENT = 100;
4329
+ const HEX_WITH_HASH_LENGTH = 7;
4330
+ const KEYBOARD_STEP = 0.01;
4331
+ const KEYBOARD_LARGE_STEP = 0.1;
4332
+ const HUE_KEYBOARD_STEP_DEG = 1;
4333
+ const HUE_KEYBOARD_LARGE_STEP_DEG = 10;
4334
+ const TO_BOTTOM_GRADIENT = "linear-gradient(to bottom, transparent, black)";
4335
+ const _sfc_main$z = /* @__PURE__ */ defineComponent({
4336
+ __name: "ColorPicker",
4337
+ props: {
4338
+ "modelValue": { default: "" },
4339
+ "modelModifiers": {}
4340
+ },
4341
+ emits: ["update:modelValue"],
4342
+ setup(__props) {
4343
+ useCssVars((_ctx) => ({
4344
+ "v535b907d": alphaBackgroundImage.value
4345
+ }));
4346
+ const modelValue = useModel(__props, "modelValue");
4347
+ const colorspaceEl = ref(null);
4348
+ const hue = ref(DEFAULT_HUE_DEG);
3798
4349
  const saturation = ref(DEFAULT_SATURATION);
3799
4350
  const value = ref(DEFAULT_VALUE);
4351
+ const alpha = ref(DEFAULT_ALPHA);
3800
4352
  const hasPendingInternalModelUpdate = ref(false);
3801
- const syncFromModelValue = (next) => {
3802
- const rgb = hexToRgb(next);
3803
- if (!rgb) {
4353
+ const updateHsvFromHex = (hex) => {
4354
+ const rgba = hexToRgba(hex);
4355
+ if (!rgba) {
3804
4356
  return;
3805
4357
  }
3806
- const hsv = rgbToHsv(rgb);
4358
+ const hsv = rgbToHsv(rgba);
3807
4359
  hue.value = hsv.h;
3808
4360
  saturation.value = hsv.s;
3809
4361
  value.value = hsv.v;
4362
+ alpha.value = rgba.a;
3810
4363
  };
3811
4364
  watch(
3812
4365
  () => modelValue.value,
@@ -3815,17 +4368,25 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
3815
4368
  hasPendingInternalModelUpdate.value = false;
3816
4369
  return;
3817
4370
  }
3818
- syncFromModelValue(next);
4371
+ updateHsvFromHex(next);
3819
4372
  },
3820
4373
  { immediate: true }
3821
4374
  );
3822
- const currentHex = computed(
3823
- () => hsvToHex({
4375
+ const hexInputValue = computed(() => removeAlphaFromHexInput(modelValue.value));
4376
+ const currentRgb = computed(
4377
+ () => hsvToRgb({
3824
4378
  h: hue.value,
3825
4379
  s: saturation.value,
3826
4380
  v: value.value
3827
4381
  })
3828
4382
  );
4383
+ const currentHex = computed(() => {
4384
+ const hex = rgbaToHex({
4385
+ ...currentRgb.value,
4386
+ a: alpha.value
4387
+ });
4388
+ return alpha.value === DEFAULT_ALPHA ? hex.slice(0, HEX_WITH_HASH_LENGTH) : hex;
4389
+ });
3829
4390
  const hueRgb = computed(() => hsvToRgb({ h: hue.value, s: 1, v: 1 }));
3830
4391
  const colorspaceBackground = computed(() => {
3831
4392
  const { r, g, b } = hueRgb.value;
@@ -3837,9 +4398,16 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
3837
4398
  left: `${saturation.value * 100}%`,
3838
4399
  top: `${(1 - value.value) * 100}%`
3839
4400
  }));
3840
- const hueHandleStyle = computed(() => ({
3841
- left: `${hue.value / HUE_MAX_DEG * PERCENT}%`
3842
- }));
4401
+ const alphaBackgroundImage = computed(() => {
4402
+ const { r, g, b } = currentRgb.value;
4403
+ return `
4404
+ linear-gradient(to right, rgba(${r}, ${g}, ${b}, 0), rgb(${r}, ${g}, ${b})),
4405
+ repeating-conic-gradient(
4406
+ var(--kds-color-background-neutral-active) 0 25%,
4407
+ var(--kds-color-surface-default) 0 50%
4408
+ )
4409
+ `;
4410
+ });
3843
4411
  const setModelValueFromHsv = () => {
3844
4412
  hasPendingInternalModelUpdate.value = true;
3845
4413
  modelValue.value = currentHex.value;
@@ -3852,18 +4420,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
3852
4420
  const rect = el.getBoundingClientRect();
3853
4421
  const x = (event.clientX - rect.left) / rect.width;
3854
4422
  const y = (event.clientY - rect.top) / rect.height;
3855
- saturation.value = Math.min(1, Math.max(0, x));
3856
- value.value = 1 - Math.min(1, Math.max(0, y));
3857
- setModelValueFromHsv();
3858
- };
3859
- const updateFromHueEvent = (event) => {
3860
- const el = hueEl.value;
3861
- if (!el) {
3862
- return;
3863
- }
3864
- const rect = el.getBoundingClientRect();
3865
- const x = (event.clientX - rect.left) / rect.width;
3866
- hue.value = Math.min(HUE_MAX_EXCLUSIVE_DEG, Math.max(0, x * HUE_MAX_DEG));
4423
+ saturation.value = clamp$1(x, 0, 1);
4424
+ value.value = 1 - clamp$1(y, 0, 1);
3867
4425
  setModelValueFromHsv();
3868
4426
  };
3869
4427
  const {
@@ -3871,17 +4429,21 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
3871
4429
  onPointerMove: onColorspacePointerMove,
3872
4430
  onPointerUp: onColorspacePointerUp
3873
4431
  } = usePointerHandler(updateFromColorspaceEvent);
3874
- const {
3875
- onPointerDown: onHuePointerDown,
3876
- onPointerMove: onHuePointerMove,
3877
- onPointerUp: onHuePointerUp
3878
- } = usePointerHandler(updateFromHueEvent);
3879
4432
  const updateFromTextValue = (next) => {
3880
4433
  modelValue.value = next;
3881
- const normalized = normalizeHexColor(next);
4434
+ };
4435
+ const onHexInputFocusOut = () => {
4436
+ const normalized = normalizeHexColor(modelValue.value);
3882
4437
  if (normalized) {
3883
- syncFromModelValue(normalized);
4438
+ modelValue.value = normalized;
4439
+ }
4440
+ };
4441
+ const updateFromAlphaNumberInput = (next) => {
4442
+ if (!Number.isFinite(next)) {
4443
+ return;
3884
4444
  }
4445
+ alpha.value = clamp$1(next / PERCENT, 0, 1);
4446
+ setModelValueFromHsv();
3885
4447
  };
3886
4448
  const saturationPercent = computed(
3887
4449
  () => Math.round(saturation.value * PERCENT)
@@ -3891,6 +4453,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
3891
4453
  () => `Saturation ${saturationPercent.value} percent, brightness ${valuePercent.value} percent`
3892
4454
  );
3893
4455
  const hueValueText = computed(() => `${Math.round(hue.value)} degrees`);
4456
+ const alphaPercent = computed(() => Math.round(alpha.value * PERCENT));
4457
+ const alphaValueText = computed(() => `${alphaPercent.value} percent`);
3894
4458
  const onColorspaceKeyDown = (event) => {
3895
4459
  const step = event.shiftKey ? KEYBOARD_LARGE_STEP : KEYBOARD_STEP;
3896
4460
  let handled = true;
@@ -3915,26 +4479,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
3915
4479
  setModelValueFromHsv();
3916
4480
  }
3917
4481
  };
3918
- const onHueKeyDown = (event) => {
3919
- const step = event.shiftKey ? HUE_KEYBOARD_LARGE_STEP_DEG : HUE_KEYBOARD_STEP_DEG;
3920
- let handled = true;
3921
- switch (event.key) {
3922
- case "ArrowLeft":
3923
- hue.value = clamp$1(hue.value - step, 0, HUE_MAX_EXCLUSIVE_DEG);
3924
- break;
3925
- case "ArrowRight":
3926
- hue.value = clamp$1(hue.value + step, 0, HUE_MAX_EXCLUSIVE_DEG);
3927
- break;
3928
- default:
3929
- handled = false;
3930
- }
3931
- if (handled) {
3932
- event.preventDefault();
3933
- setModelValueFromHsv();
3934
- }
3935
- };
3936
4482
  return (_ctx, _cache) => {
3937
- return openBlock(), createElementBlock("div", _hoisted_1$m, [
4483
+ return openBlock(), createElementBlock("div", _hoisted_1$n, [
3938
4484
  createElementVNode("div", {
3939
4485
  ref_key: "colorspaceEl",
3940
4486
  ref: colorspaceEl,
@@ -3945,11 +4491,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
3945
4491
  "aria-valuetext": colorspaceValueText.value,
3946
4492
  style: normalizeStyle(colorspaceBackground.value),
3947
4493
  tabindex: "0",
3948
- onPointerdown: _cache[0] || (_cache[0] = withModifiers(
3949
- //@ts-ignore
3950
- (...args) => unref(onColorspacePointerDown) && unref(onColorspacePointerDown)(...args),
3951
- ["prevent"]
3952
- )),
4494
+ onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
4495
+ (...args) => unref(onColorspacePointerDown) && unref(onColorspacePointerDown)(...args)),
3953
4496
  onPointermove: _cache[1] || (_cache[1] = withModifiers(
3954
4497
  //@ts-ignore
3955
4498
  (...args) => unref(onColorspacePointerMove) && unref(onColorspacePointerMove)(...args),
@@ -3957,61 +4500,82 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
3957
4500
  )),
3958
4501
  onLostpointercapture: _cache[2] || (_cache[2] = //@ts-ignore
3959
4502
  (...args) => unref(onColorspacePointerUp) && unref(onColorspacePointerUp)(...args)),
4503
+ onPointerup: _cache[3] || (_cache[3] = //@ts-ignore
4504
+ (...args) => unref(onColorspacePointerUp) && unref(onColorspacePointerUp)(...args)),
3960
4505
  onKeydown: onColorspaceKeyDown
3961
4506
  }, [
3962
4507
  createElementVNode("div", {
3963
4508
  class: "handle",
3964
4509
  style: normalizeStyle(colorspaceHandleStyle.value)
3965
4510
  }, null, 4)
3966
- ], 44, _hoisted_2$c),
3967
- createElementVNode("div", {
3968
- ref_key: "hueEl",
3969
- ref: hueEl,
4511
+ ], 44, _hoisted_2$d),
4512
+ createVNode(ColorPickerSlider, {
4513
+ modelValue: hue.value,
4514
+ "onUpdate:modelValue": [
4515
+ _cache[4] || (_cache[4] = ($event) => hue.value = $event),
4516
+ setModelValueFromHsv
4517
+ ],
3970
4518
  class: "hue",
3971
- role: "slider",
3972
- "aria-label": "Hue",
3973
- "aria-valuenow": Math.round(hue.value),
3974
- "aria-valuemin": "0",
3975
- "aria-valuemax": HUE_MAX_DEG,
3976
- "aria-valuetext": hueValueText.value,
3977
- tabindex: "0",
3978
- onPointerdown: _cache[3] || (_cache[3] = withModifiers(
3979
- //@ts-ignore
3980
- (...args) => unref(onHuePointerDown) && unref(onHuePointerDown)(...args),
3981
- ["prevent"]
3982
- )),
3983
- onPointermove: _cache[4] || (_cache[4] = withModifiers(
3984
- //@ts-ignore
3985
- (...args) => unref(onHuePointerMove) && unref(onHuePointerMove)(...args),
3986
- ["prevent"]
3987
- )),
3988
- onLostpointercapture: _cache[5] || (_cache[5] = //@ts-ignore
3989
- (...args) => unref(onHuePointerUp) && unref(onHuePointerUp)(...args)),
3990
- onKeydown: onHueKeyDown
3991
- }, [
3992
- createElementVNode("div", {
3993
- class: "handle",
3994
- style: normalizeStyle(hueHandleStyle.value)
3995
- }, null, 4)
3996
- ], 40, _hoisted_3$9),
3997
- createVNode(KdsTextInput, {
3998
- "model-value": modelValue.value,
3999
- ariaLabel: "Color hex value",
4000
- placeholder: "#FFFFFF",
4001
- "onUpdate:modelValue": updateFromTextValue
4002
- }, null, 8, ["model-value"])
4519
+ label: "Hue",
4520
+ "value-now": Math.round(hue.value),
4521
+ "value-min": 0,
4522
+ "value-max": HUE_MAX_DEG,
4523
+ "value-text": hueValueText.value,
4524
+ min: 0,
4525
+ max: HUE_MAX_EXCLUSIVE_DEG,
4526
+ step: HUE_KEYBOARD_STEP_DEG,
4527
+ "large-step": HUE_KEYBOARD_LARGE_STEP_DEG
4528
+ }, null, 8, ["modelValue", "value-now", "value-text"]),
4529
+ createVNode(ColorPickerSlider, {
4530
+ modelValue: alpha.value,
4531
+ "onUpdate:modelValue": [
4532
+ _cache[5] || (_cache[5] = ($event) => alpha.value = $event),
4533
+ setModelValueFromHsv
4534
+ ],
4535
+ class: "alpha",
4536
+ label: "Alpha",
4537
+ "value-now": alphaPercent.value,
4538
+ "value-min": 0,
4539
+ "value-max": PERCENT,
4540
+ "value-text": alphaValueText.value,
4541
+ min: 0,
4542
+ max: 1,
4543
+ step: KEYBOARD_STEP,
4544
+ "large-step": KEYBOARD_LARGE_STEP
4545
+ }, null, 8, ["modelValue", "value-now", "value-text"]),
4546
+ createElementVNode("div", _hoisted_3$a, [
4547
+ createVNode(KdsTextInput, {
4548
+ "model-value": hexInputValue.value,
4549
+ ariaLabel: "Color hex value",
4550
+ placeholder: "#FFFFFF",
4551
+ "onUpdate:modelValue": updateFromTextValue,
4552
+ onFocusout: onHexInputFocusOut
4553
+ }, null, 8, ["model-value"]),
4554
+ createVNode(_sfc_main$C, {
4555
+ "model-value": alphaPercent.value,
4556
+ ariaLabel: "Alpha percentage",
4557
+ min: 0,
4558
+ max: PERCENT,
4559
+ step: 1,
4560
+ unit: "%",
4561
+ "onUpdate:modelValue": updateFromAlphaNumberInput
4562
+ }, null, 8, ["model-value"])
4563
+ ])
4003
4564
  ]);
4004
4565
  };
4005
4566
  }
4006
4567
  });
4007
4568
 
4008
- const ColorPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["__scopeId", "data-v-74392b20"]]);
4569
+ const ColorPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["__scopeId", "data-v-2daeaa68"]]);
4009
4570
 
4010
4571
  const HEX_LENGTH_1 = 1;
4011
4572
  const HEX_LENGTH_2 = 2;
4012
4573
  const HEX_LENGTH_3 = 3;
4013
4574
  const HEX_LENGTH_4 = 4;
4014
4575
  const HEX_LENGTH_6 = 6;
4576
+ const HEX_LENGTH_8 = 8;
4577
+ const FULLY_OPAQUE_ALPHA_SUFFIX = "FF";
4578
+ const normalizeOpaqueAlpha = (normalizedHexWithHash) => normalizedHexWithHash.length === HEX_LENGTH_8 + 1 && normalizedHexWithHash.endsWith(FULLY_OPAQUE_ALPHA_SUFFIX) ? normalizedHexWithHash.slice(0, HEX_LENGTH_6 + 1) : normalizedHexWithHash;
4015
4579
  const normalize = (value, fallbackValue) => {
4016
4580
  const trimmed = value.trim();
4017
4581
  if (trimmed.length === 0) {
@@ -4027,13 +4591,22 @@ const normalize = (value, fallbackValue) => {
4027
4591
  if (withoutHash.length === HEX_LENGTH_2) {
4028
4592
  return `#${withoutHash.repeat(HEX_LENGTH_3)}`.toUpperCase();
4029
4593
  }
4030
- if (withoutHash.length === HEX_LENGTH_3 || withoutHash.length === HEX_LENGTH_4) {
4594
+ if (withoutHash.length === HEX_LENGTH_3) {
4031
4595
  const [r, g, b] = withoutHash;
4032
4596
  return `#${r}${r}${g}${g}${b}${b}`.toUpperCase();
4033
4597
  }
4598
+ if (withoutHash.length === HEX_LENGTH_4) {
4599
+ const [r, g, b, a] = withoutHash;
4600
+ return normalizeOpaqueAlpha(
4601
+ `#${r}${r}${g}${g}${b}${b}${a}${a}`.toUpperCase()
4602
+ );
4603
+ }
4034
4604
  if (withoutHash.length === HEX_LENGTH_6) {
4035
4605
  return `#${withoutHash}`.toUpperCase();
4036
4606
  }
4607
+ if (withoutHash.length === HEX_LENGTH_8) {
4608
+ return normalizeOpaqueAlpha(`#${withoutHash}`.toUpperCase());
4609
+ }
4037
4610
  return fallbackValue;
4038
4611
  };
4039
4612
  const useColorInputValidationOnFocusOut = (modelValue) => {
@@ -4042,8 +4615,10 @@ const useColorInputValidationOnFocusOut = (modelValue) => {
4042
4615
  modelValue,
4043
4616
  (value) => {
4044
4617
  const withoutHash = value.startsWith("#") ? value.slice(1) : value;
4045
- if (/^[0-9a-fA-F]{6}$/.test(withoutHash)) {
4046
- lastValidHexColor.value = `#${withoutHash.toUpperCase()}`;
4618
+ if ((withoutHash.length === HEX_LENGTH_6 || withoutHash.length === HEX_LENGTH_8) && /^[0-9a-fA-F]+$/.test(withoutHash)) {
4619
+ lastValidHexColor.value = normalizeOpaqueAlpha(
4620
+ `#${withoutHash.toUpperCase()}`
4621
+ );
4047
4622
  }
4048
4623
  },
4049
4624
  { immediate: true }
@@ -4128,7 +4703,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
4128
4703
  }, null, 8, ["color", "style"])
4129
4704
  ]),
4130
4705
  trailing: withCtx(() => [
4131
- createVNode(unref(_sfc_main$Y), {
4706
+ createVNode(unref(_sfc_main$_), {
4132
4707
  modelValue: open.value,
4133
4708
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => open.value = $event),
4134
4709
  size: "xsmall",
@@ -4229,7 +4804,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
4229
4804
  onBlur: handleBlur
4230
4805
  }), {
4231
4806
  trailing: withCtx(() => [
4232
- __props.showVisibilityToggle ? (openBlock(), createBlock(_sfc_main$Y, {
4807
+ __props.showVisibilityToggle ? (openBlock(), createBlock(_sfc_main$_, {
4233
4808
  key: 0,
4234
4809
  modelValue: showValue.value,
4235
4810
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => showValue.value = $event),
@@ -14110,13 +14685,13 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
14110
14685
  };
14111
14686
  }
14112
14687
  });
14113
- const _hoisted_1$l = {
14688
+ const _hoisted_1$m = {
14114
14689
  key: 0,
14115
14690
  class: "vc-time-header"
14116
14691
  };
14117
- const _hoisted_2$b = { class: "vc-time-weekday" };
14118
- const _hoisted_3$8 = { class: "vc-time-month" };
14119
- const _hoisted_4$6 = { class: "vc-time-day" };
14692
+ const _hoisted_2$c = { class: "vc-time-weekday" };
14693
+ const _hoisted_3$9 = { class: "vc-time-month" };
14694
+ const _hoisted_4$7 = { class: "vc-time-day" };
14120
14695
  const _hoisted_5$3 = { class: "vc-time-year" };
14121
14696
  const _hoisted_6$1 = { class: "vc-time-select-group" };
14122
14697
  const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
@@ -14151,10 +14726,10 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
14151
14726
  }, [
14152
14727
  createVNode(_sfc_main$i$1, { name: "time-header" }, {
14153
14728
  default: withCtx(() => [
14154
- unref(showHeader) && unref(date) ? (openBlock(), createElementBlock("div", _hoisted_1$l, [
14155
- createElementVNode("span", _hoisted_2$b, toDisplayString(unref(locale).formatDate(unref(date), "WWW")), 1),
14156
- createElementVNode("span", _hoisted_3$8, toDisplayString(unref(locale).formatDate(unref(date), "MMM")), 1),
14157
- createElementVNode("span", _hoisted_4$6, toDisplayString(unref(locale).formatDate(unref(date), "D")), 1),
14729
+ unref(showHeader) && unref(date) ? (openBlock(), createElementBlock("div", _hoisted_1$m, [
14730
+ createElementVNode("span", _hoisted_2$c, toDisplayString(unref(locale).formatDate(unref(date), "WWW")), 1),
14731
+ createElementVNode("span", _hoisted_3$9, toDisplayString(unref(locale).formatDate(unref(date), "MMM")), 1),
14732
+ createElementVNode("span", _hoisted_4$7, toDisplayString(unref(locale).formatDate(unref(date), "D")), 1),
14158
14733
  createElementVNode("span", _hoisted_5$3, toDisplayString(unref(locale).formatDate(unref(date), "YYYY")), 1)
14159
14734
  ])) : createCommentVNode("", true)
14160
14735
  ]),
@@ -14452,7 +15027,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
14452
15027
  onBlur: onTextInputBlur
14453
15028
  }), {
14454
15029
  trailing: withCtx(() => [
14455
- createVNode(_sfc_main$Y, {
15030
+ createVNode(_sfc_main$_, {
14456
15031
  modelValue: popoverIsVisible.value,
14457
15032
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => popoverIsVisible.value = $event),
14458
15033
  type: "button",
@@ -14507,7 +15082,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
14507
15082
  }
14508
15083
  });
14509
15084
 
14510
- const _hoisted_1$k = { class: "kds-date-time-format-popover" };
15085
+ const _hoisted_1$l = { class: "kds-date-time-format-popover" };
14511
15086
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
14512
15087
  __name: "DateTimeFormatPopover",
14513
15088
  props: /* @__PURE__ */ mergeModels({
@@ -14646,7 +15221,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
14646
15221
  }));
14647
15222
  });
14648
15223
  return (_ctx, _cache) => {
14649
- return openBlock(), createElementBlock("div", _hoisted_1$k, [
15224
+ return openBlock(), createElementBlock("div", _hoisted_1$l, [
14650
15225
  modeOptions.value.length > 1 ? (openBlock(), createBlock(KdsValueSwitch, {
14651
15226
  key: 0,
14652
15227
  "model-value": effectiveSelectedMode.value,
@@ -14694,388 +15269,18 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
14694
15269
  placeholder: { default: "Format" },
14695
15270
  disabled: { type: Boolean, default: false },
14696
15271
  autocomplete: {},
14697
- allowedFormats: {},
14698
- allDefaultFormats: {}
14699
- }, {
14700
- "modelValue": { default: "" },
14701
- "modelModifiers": {}
14702
- }),
14703
- emits: ["update:modelValue"],
14704
- setup(__props) {
14705
- const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace", "placeholder"]);
14706
- const modelValue = useModel(__props, "modelValue");
14707
- const open = ref(false);
14708
- const popoverEl = useTemplateRef("popoverEl");
14709
- return (_ctx, _cache) => {
14710
- return openBlock(), createBlock(BaseFormFieldWrapper, mergeProps(props, {
14711
- error: __props.error,
14712
- validating: __props.validating,
14713
- "preserve-sub-text-space": __props.preserveSubTextSpace
14714
- }), {
14715
- default: withCtx((slotProps) => [
14716
- createElementVNode("div", {
14717
- style: normalizeStyle(popoverEl.value?.anchorStyle)
14718
- }, [
14719
- createVNode(BaseInput, mergeProps(slotProps, {
14720
- modelValue: modelValue.value,
14721
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event),
14722
- type: "text",
14723
- placeholder: __props.placeholder,
14724
- disabled: __props.disabled,
14725
- error: __props.error,
14726
- validating: __props.validating,
14727
- autocomplete: props.autocomplete
14728
- }), {
14729
- trailing: withCtx(() => [
14730
- createVNode(unref(_sfc_main$Y), {
14731
- modelValue: open.value,
14732
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => open.value = $event),
14733
- size: "xsmall",
14734
- variant: "outlined",
14735
- "leading-icon": "date-time",
14736
- ariaLabel: "Open date/time format picker",
14737
- "aria-controls": popoverEl.value?.popoverId,
14738
- "aria-expanded": open.value,
14739
- "aria-haspopup": "dialog",
14740
- disabled: __props.disabled,
14741
- title: open.value ? "Close date/time format picker" : "Open date/time format picker"
14742
- }, null, 8, ["modelValue", "aria-controls", "aria-expanded", "disabled", "title"])
14743
- ]),
14744
- _: 1
14745
- }, 16, ["modelValue", "placeholder", "disabled", "error", "validating", "autocomplete"]),
14746
- createVNode(KdsPopover, {
14747
- ref_key: "popoverEl",
14748
- ref: popoverEl,
14749
- modelValue: open.value,
14750
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => open.value = $event),
14751
- placement: "bottom-right",
14752
- "aria-label": "Date time format selection dialog"
14753
- }, {
14754
- default: withCtx(() => [
14755
- createVNode(DateTimeFormatPopover, {
14756
- selection: modelValue.value,
14757
- "all-default-formats": props.allDefaultFormats,
14758
- "allowed-formats": props.allowedFormats,
14759
- "onUpdate:selection": _cache[2] || (_cache[2] = ($event) => {
14760
- modelValue.value = $event;
14761
- open.value = false;
14762
- })
14763
- }, null, 8, ["selection", "all-default-formats", "allowed-formats"])
14764
- ]),
14765
- _: 1
14766
- }, 8, ["modelValue"])
14767
- ], 4)
14768
- ]),
14769
- _: 1
14770
- }, 16, ["error", "validating", "preserve-sub-text-space"]);
14771
- };
14772
- }
14773
- });
14774
-
14775
- const kdsTemporalType = {
14776
- DATE: "DATE",
14777
- TIME: "TIME",
14778
- DATE_TIME: "DATE_TIME",
14779
- ZONED_DATE_TIME: "ZONED_DATE_TIME"
14780
- };
14781
- const kdsTemporalTypes = Object.values(kdsTemporalType);
14782
- const kdsDateFormatCategory = {
14783
- RECENT: "RECENT",
14784
- STANDARD: "STANDARD",
14785
- EUROPEAN: "EUROPEAN",
14786
- AMERICAN: "AMERICAN"
14787
- };
14788
- const kdsDateFormatCategories = Object.values(kdsDateFormatCategory);
14789
-
14790
- const additionalGroupSeparators = [" ", " ", " "];
14791
- const decimalSeparatorSample = 1.1;
14792
- const groupSeparatorSample = 1000.1;
14793
- const countFractionDigits = (value) => {
14794
- if (!Number.isFinite(value)) {
14795
- return 0;
14796
- }
14797
- const exp = value.toExponential();
14798
- const match = /^[-+]?(\d+)(?:\.(\d+))?e([+-]?\d+)$/i.exec(exp);
14799
- if (!match) {
14800
- return 0;
14801
- }
14802
- const fractionDigitsInMantissa = match[2]?.length ?? 0;
14803
- const exponent = Number.parseInt(match[3], 10);
14804
- if (exponent >= 0) {
14805
- return Math.max(0, fractionDigitsInMantissa - exponent);
14806
- }
14807
- return fractionDigitsInMantissa + Math.abs(exponent);
14808
- };
14809
- const createKdsNumberParser = (params) => {
14810
- const formatter = new Intl.NumberFormat(params.locale);
14811
- const decimalSeparator = formatter.formatToParts(decimalSeparatorSample).find((part) => part.type === "decimal")?.value ?? ".";
14812
- const groupSeparator = formatter.formatToParts(groupSeparatorSample).find((part) => part.type === "group")?.value ?? ",";
14813
- const removeGroupingSeparators = (input) => [groupSeparator, ...additionalGroupSeparators].reduce(
14814
- (acc, groupSep) => groupSep.length > 0 ? acc.split(groupSep).join("") : acc,
14815
- input
14816
- );
14817
- const formattersByMaxDecimals = /* @__PURE__ */ new Map();
14818
- const getFormatterForMaxDecimals = (maxDecimals) => {
14819
- const cached = formattersByMaxDecimals.get(maxDecimals);
14820
- if (cached) {
14821
- return cached;
14822
- }
14823
- const created = new Intl.NumberFormat(params.locale, {
14824
- useGrouping: false,
14825
- minimumFractionDigits: 0,
14826
- maximumFractionDigits: maxDecimals
14827
- });
14828
- formattersByMaxDecimals.set(maxDecimals, created);
14829
- return created;
14830
- };
14831
- const stepFractionDigits = countFractionDigits(params.step);
14832
- const precisionFactor = Number(`1e${stepFractionDigits}`);
14833
- const formatForDisplay = (value) => {
14834
- if (!Number.isFinite(value)) {
14835
- return "";
14836
- }
14837
- const valueDecimals = countFractionDigits(value);
14838
- const maxDecimals = Math.max(stepFractionDigits, valueDecimals);
14839
- return getFormatterForMaxDecimals(maxDecimals).format(value);
14840
- };
14841
- const roundToStep = (value) => {
14842
- if (!Number.isFinite(value)) {
14843
- return Number.NaN;
14844
- }
14845
- const step = params.step;
14846
- if (!Number.isFinite(step) || step <= 0) {
14847
- return value;
14848
- }
14849
- if (!Number.isFinite(precisionFactor) || precisionFactor <= 0) {
14850
- return value;
14851
- }
14852
- const scaledNext = Math.round(value * precisionFactor);
14853
- const scaledStep = Math.round(step * precisionFactor);
14854
- if (scaledStep === 0) {
14855
- return value;
14856
- }
14857
- const roundedScaled = Math.round(scaledNext / scaledStep) * scaledStep;
14858
- return roundedScaled / precisionFactor;
14859
- };
14860
- const isValidNormalizedNumber = (normalized) => (
14861
- // Accept plain decimals as well as scientific notation.
14862
- // Note: whitespace is removed earlier; we don't accept grouping separators here.
14863
- /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/.test(normalized)
14864
- );
14865
- const parseWithLocaleDecimal = (input, localeDecimal) => {
14866
- const withoutGrouping = removeGroupingSeparators(input);
14867
- const normalized = withoutGrouping.split(localeDecimal).join(".");
14868
- if (!isValidNormalizedNumber(normalized)) {
14869
- return Number.NaN;
14870
- }
14871
- const parsed = Number.parseFloat(normalized);
14872
- return Number.isFinite(parsed) ? parsed : Number.NaN;
14873
- };
14874
- const parseWithFallbackDot = (input) => {
14875
- const lastDotIndex = input.lastIndexOf(".");
14876
- const digitsAfterDot = input.slice(lastDotIndex + 1);
14877
- const looksLikeDecimal = digitsAfterDot.length > 0 && digitsAfterDot.length <= 2;
14878
- const normalized = looksLikeDecimal ? `${removeGroupingSeparators(input.slice(0, lastDotIndex))}.${removeGroupingSeparators(
14879
- digitsAfterDot
14880
- )}` : removeGroupingSeparators(input);
14881
- if (!isValidNormalizedNumber(normalized)) {
14882
- return Number.NaN;
14883
- }
14884
- const parsed = Number.parseFloat(normalized);
14885
- return Number.isFinite(parsed) ? parsed : Number.NaN;
14886
- };
14887
- const parseWithoutLocaleDecimal = (input) => {
14888
- const normalized = removeGroupingSeparators(input);
14889
- if (!isValidNormalizedNumber(normalized)) {
14890
- return Number.NaN;
14891
- }
14892
- const parsed = Number.parseFloat(normalized);
14893
- return Number.isFinite(parsed) ? parsed : Number.NaN;
14894
- };
14895
- function parseFromInput(value) {
14896
- const trimmed = value.trim();
14897
- if (trimmed.length === 0) {
14898
- return Number.NaN;
14899
- }
14900
- const localeDecimal = decimalSeparator;
14901
- const hasLocaleDecimal = localeDecimal.length > 0 && trimmed.includes(localeDecimal);
14902
- if (hasLocaleDecimal) {
14903
- return parseWithLocaleDecimal(trimmed, localeDecimal);
14904
- }
14905
- if (localeDecimal !== "." && trimmed.includes(".")) {
14906
- return parseWithFallbackDot(trimmed);
14907
- }
14908
- return parseWithoutLocaleDecimal(trimmed);
14909
- }
14910
- return {
14911
- locale: params.locale,
14912
- decimalSeparator,
14913
- groupSeparator,
14914
- stepFractionDigits,
14915
- formatForDisplay,
14916
- parseFromInput,
14917
- roundToStep
14918
- };
14919
- };
14920
-
14921
- const REPEAT_INITIAL_DELAY_MS = 400;
14922
- const REPEAT_INTERVAL_MS = 100;
14923
- const _sfc_main$r = /* @__PURE__ */ defineComponent({
14924
- __name: "KdsNumberInput",
14925
- props: /* @__PURE__ */ mergeModels({
14926
- description: {},
14927
- label: {},
14928
- ariaLabel: {},
14929
- id: {},
14930
- subText: {},
14931
- error: { type: Boolean, default: false },
14932
- validating: { type: Boolean, default: false },
14933
- preserveSubTextSpace: { type: Boolean, default: false },
14934
- placeholder: {},
14935
- disabled: { type: Boolean, default: false },
14936
- autocomplete: {},
14937
- unit: { default: "" },
14938
- min: {},
14939
- max: {},
14940
- step: { default: 1 }
14941
- }, {
14942
- "modelValue": { default: Number.NaN },
14943
- "modelModifiers": {}
14944
- }),
14945
- emits: ["update:modelValue"],
14946
- setup(__props, { expose: __expose }) {
14947
- const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace", "unit", "step"]);
14948
- const modelValue = useModel(__props, "modelValue");
14949
- const isFocused = ref(false);
14950
- const localValue = ref("");
14951
- const numberParser = computed(
14952
- () => createKdsNumberParser({ locale: "en-US", step: __props.step })
14953
- );
14954
- const ariaValuenow = computed(
14955
- () => Number.isFinite(modelValue.value) ? modelValue.value : void 0
14956
- );
14957
- const ariaValuetext = computed(() => {
14958
- if (!Number.isFinite(modelValue.value)) {
14959
- return void 0;
14960
- }
14961
- return numberParser.value.formatForDisplay(modelValue.value);
14962
- });
14963
- const clamp = (value) => {
14964
- if (!Number.isFinite(value)) {
14965
- return Number.NaN;
14966
- }
14967
- let result = value;
14968
- if (props.min !== void 0 && !Number.isNaN(props.min)) {
14969
- result = Math.max(props.min, result);
14970
- }
14971
- if (props.max !== void 0 && !Number.isNaN(props.max)) {
14972
- result = Math.min(props.max, result);
14973
- }
14974
- return result;
14975
- };
14976
- watch(
14977
- () => modelValue.value,
14978
- (next) => {
14979
- if (isFocused.value) {
14980
- return;
14981
- }
14982
- localValue.value = numberParser.value.formatForDisplay(next);
14983
- },
14984
- { immediate: true }
14985
- );
14986
- const canDecrease = computed(() => {
14987
- if (__props.disabled) {
14988
- return false;
14989
- }
14990
- if (props.min === void 0 || Number.isNaN(props.min)) {
14991
- return true;
14992
- }
14993
- if (Number.isNaN(modelValue.value)) {
14994
- return true;
14995
- }
14996
- return modelValue.value > props.min;
14997
- });
14998
- const canIncrease = computed(() => {
14999
- if (__props.disabled) {
15000
- return false;
15001
- }
15002
- if (props.max === void 0 || Number.isNaN(props.max)) {
15003
- return true;
15004
- }
15005
- if (Number.isNaN(modelValue.value)) {
15006
- return true;
15007
- }
15008
- return modelValue.value < props.max;
15009
- });
15010
- const adjustByStep = (direction) => {
15011
- if (__props.step <= 0) {
15012
- return;
15013
- }
15014
- const base = Number.isFinite(modelValue.value) ? modelValue.value : numberParser.value.parseFromInput(localValue.value);
15015
- const nextRaw = Number.isFinite(base) ? base + direction * __props.step : 0;
15016
- const rounded = numberParser.value.roundToStep(nextRaw);
15017
- const next = clamp(rounded);
15018
- modelValue.value = next;
15019
- localValue.value = numberParser.value.formatForDisplay(next);
15020
- };
15021
- const handleKeydown = (event) => {
15022
- if (__props.disabled) {
15023
- return;
15024
- }
15025
- if (event.key === "ArrowUp" && canIncrease.value) {
15026
- event.preventDefault();
15027
- adjustByStep(1);
15028
- return;
15029
- }
15030
- if (event.key === "ArrowDown" && canDecrease.value) {
15031
- event.preventDefault();
15032
- adjustByStep(-1);
15033
- }
15034
- };
15035
- const handleUpdateModelValue = (value) => {
15036
- localValue.value = value;
15037
- modelValue.value = numberParser.value.parseFromInput(value);
15038
- };
15039
- const baseInput = useTemplateRef("baseInput");
15040
- let repeatTimer = null;
15041
- let isStepping = false;
15042
- const handleBlur = () => {
15043
- if (isStepping) {
15044
- baseInput.value?.focus();
15045
- return;
15046
- }
15047
- isFocused.value = false;
15048
- const parsed = numberParser.value.parseFromInput(localValue.value);
15049
- const normalized = clamp(parsed);
15050
- modelValue.value = normalized;
15051
- localValue.value = numberParser.value.formatForDisplay(normalized);
15052
- };
15053
- const stopRepeating = () => {
15054
- if (repeatTimer !== null) {
15055
- clearTimeout(repeatTimer);
15056
- repeatTimer = null;
15057
- }
15058
- isStepping = false;
15059
- };
15060
- const startRepeating = (direction) => {
15061
- stopRepeating();
15062
- isStepping = true;
15063
- adjustByStep(direction);
15064
- repeatTimer = setTimeout(function tick() {
15065
- adjustByStep(direction);
15066
- repeatTimer = setTimeout(tick, REPEAT_INTERVAL_MS);
15067
- }, REPEAT_INITIAL_DELAY_MS);
15068
- };
15069
- onBeforeUnmount(stopRepeating);
15070
- const handleButtonClick = (direction, event) => {
15071
- if (event.detail !== 0) {
15072
- return;
15073
- }
15074
- adjustByStep(direction);
15075
- };
15076
- __expose({
15077
- focus: () => baseInput.value?.focus()
15078
- });
15272
+ allowedFormats: {},
15273
+ allDefaultFormats: {}
15274
+ }, {
15275
+ "modelValue": { default: "" },
15276
+ "modelModifiers": {}
15277
+ }),
15278
+ emits: ["update:modelValue"],
15279
+ setup(__props) {
15280
+ const props = createPropsRestProxy(__props, ["disabled", "error", "validating", "preserveSubTextSpace", "placeholder"]);
15281
+ const modelValue = useModel(__props, "modelValue");
15282
+ const open = ref(false);
15283
+ const popoverEl = useTemplateRef("popoverEl");
15079
15284
  return (_ctx, _cache) => {
15080
15285
  return openBlock(), createBlock(BaseFormFieldWrapper, mergeProps(props, {
15081
15286
  error: __props.error,
@@ -15083,58 +15288,58 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
15083
15288
  "preserve-sub-text-space": __props.preserveSubTextSpace
15084
15289
  }), {
15085
15290
  default: withCtx((slotProps) => [
15086
- createVNode(BaseInput, mergeProps({
15087
- ref_key: "baseInput",
15088
- ref: baseInput
15089
- }, slotProps, {
15090
- "model-value": localValue.value,
15091
- type: "text",
15092
- inputmode: Number.isInteger(__props.step) ? "numeric" : "decimal",
15093
- placeholder: props.placeholder,
15094
- disabled: __props.disabled,
15095
- error: __props.error,
15096
- autocomplete: props.autocomplete,
15097
- unit: __props.unit,
15098
- role: "spinbutton",
15099
- "aria-valuenow": ariaValuenow.value,
15100
- "aria-valuemin": props.min,
15101
- "aria-valuemax": props.max,
15102
- "aria-valuetext": ariaValuetext.value,
15103
- "onUpdate:modelValue": handleUpdateModelValue,
15104
- onKeydown: handleKeydown,
15105
- onFocus: _cache[4] || (_cache[4] = ($event) => isFocused.value = true),
15106
- onBlur: handleBlur
15107
- }), {
15108
- trailing: withCtx(() => [
15109
- createVNode(_sfc_main$$, {
15110
- type: "button",
15111
- size: "xsmall",
15112
- variant: "outlined",
15113
- "leading-icon": "minus",
15114
- ariaLabel: `Decrease ${props.label ?? props.ariaLabel}`,
15115
- disabled: !canDecrease.value,
15116
- onClick: _cache[0] || (_cache[0] = ($event) => handleButtonClick(-1, $event)),
15117
- onPointerdown: _cache[1] || (_cache[1] = ($event) => startRepeating(-1)),
15118
- onPointerup: stopRepeating,
15119
- onPointerleave: stopRepeating,
15120
- onPointercancel: stopRepeating
15121
- }, null, 8, ["ariaLabel", "disabled"]),
15122
- createVNode(_sfc_main$$, {
15123
- type: "button",
15124
- size: "xsmall",
15125
- variant: "outlined",
15126
- "leading-icon": "plus",
15127
- ariaLabel: `Increase ${props.label ?? props.ariaLabel}`,
15128
- disabled: !canIncrease.value,
15129
- onClick: _cache[2] || (_cache[2] = ($event) => handleButtonClick(1, $event)),
15130
- onPointerdown: _cache[3] || (_cache[3] = ($event) => startRepeating(1)),
15131
- onPointerup: stopRepeating,
15132
- onPointerleave: stopRepeating,
15133
- onPointercancel: stopRepeating
15134
- }, null, 8, ["ariaLabel", "disabled"])
15135
- ]),
15136
- _: 1
15137
- }, 16, ["model-value", "inputmode", "placeholder", "disabled", "error", "autocomplete", "unit", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext"])
15291
+ createElementVNode("div", {
15292
+ style: normalizeStyle(popoverEl.value?.anchorStyle)
15293
+ }, [
15294
+ createVNode(BaseInput, mergeProps(slotProps, {
15295
+ modelValue: modelValue.value,
15296
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event),
15297
+ type: "text",
15298
+ placeholder: __props.placeholder,
15299
+ disabled: __props.disabled,
15300
+ error: __props.error,
15301
+ validating: __props.validating,
15302
+ autocomplete: props.autocomplete
15303
+ }), {
15304
+ trailing: withCtx(() => [
15305
+ createVNode(unref(_sfc_main$_), {
15306
+ modelValue: open.value,
15307
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => open.value = $event),
15308
+ size: "xsmall",
15309
+ variant: "outlined",
15310
+ "leading-icon": "date-time",
15311
+ ariaLabel: "Open date/time format picker",
15312
+ "aria-controls": popoverEl.value?.popoverId,
15313
+ "aria-expanded": open.value,
15314
+ "aria-haspopup": "dialog",
15315
+ disabled: __props.disabled,
15316
+ title: open.value ? "Close date/time format picker" : "Open date/time format picker"
15317
+ }, null, 8, ["modelValue", "aria-controls", "aria-expanded", "disabled", "title"])
15318
+ ]),
15319
+ _: 1
15320
+ }, 16, ["modelValue", "placeholder", "disabled", "error", "validating", "autocomplete"]),
15321
+ createVNode(KdsPopover, {
15322
+ ref_key: "popoverEl",
15323
+ ref: popoverEl,
15324
+ modelValue: open.value,
15325
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => open.value = $event),
15326
+ placement: "bottom-right",
15327
+ "aria-label": "Date time format selection dialog"
15328
+ }, {
15329
+ default: withCtx(() => [
15330
+ createVNode(DateTimeFormatPopover, {
15331
+ selection: modelValue.value,
15332
+ "all-default-formats": props.allDefaultFormats,
15333
+ "allowed-formats": props.allowedFormats,
15334
+ "onUpdate:selection": _cache[2] || (_cache[2] = ($event) => {
15335
+ modelValue.value = $event;
15336
+ open.value = false;
15337
+ })
15338
+ }, null, 8, ["selection", "all-default-formats", "allowed-formats"])
15339
+ ]),
15340
+ _: 1
15341
+ }, 8, ["modelValue"])
15342
+ ], 4)
15138
15343
  ]),
15139
15344
  _: 1
15140
15345
  }, 16, ["error", "validating", "preserve-sub-text-space"]);
@@ -15142,6 +15347,21 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
15142
15347
  }
15143
15348
  });
15144
15349
 
15350
+ const kdsTemporalType = {
15351
+ DATE: "DATE",
15352
+ TIME: "TIME",
15353
+ DATE_TIME: "DATE_TIME",
15354
+ ZONED_DATE_TIME: "ZONED_DATE_TIME"
15355
+ };
15356
+ const kdsTemporalTypes = Object.values(kdsTemporalType);
15357
+ const kdsDateFormatCategory = {
15358
+ RECENT: "RECENT",
15359
+ STANDARD: "STANDARD",
15360
+ EUROPEAN: "EUROPEAN",
15361
+ AMERICAN: "AMERICAN"
15362
+ };
15363
+ const kdsDateFormatCategories = Object.values(kdsDateFormatCategory);
15364
+
15145
15365
  const escapeRegex = (value) => value.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
15146
15366
  const wildcardToRegexBody = (pattern) => {
15147
15367
  let body = "";
@@ -15168,7 +15388,7 @@ const buildRegexFromPatternInput = (input, options) => {
15168
15388
  return `^(?!.*${withCase}).*$`;
15169
15389
  };
15170
15390
 
15171
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
15391
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
15172
15392
  __name: "KdsPatternInput",
15173
15393
  props: /* @__PURE__ */ mergeModels({
15174
15394
  description: {},
@@ -15251,7 +15471,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
15251
15471
  clearable: ""
15252
15472
  }), {
15253
15473
  trailing: withCtx(() => [
15254
- createVNode(_sfc_main$Y, {
15474
+ createVNode(_sfc_main$_, {
15255
15475
  modelValue: caseSensitive.value,
15256
15476
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => caseSensitive.value = $event),
15257
15477
  size: "xsmall",
@@ -15261,7 +15481,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
15261
15481
  ariaLabel: "Case sensitivity",
15262
15482
  disabled: __props.disabled
15263
15483
  }, null, 8, ["modelValue", "title", "disabled"]),
15264
- createVNode(_sfc_main$Y, {
15484
+ createVNode(_sfc_main$_, {
15265
15485
  modelValue: excludeMatches.value,
15266
15486
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => excludeMatches.value = $event),
15267
15487
  size: "xsmall",
@@ -15271,7 +15491,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
15271
15491
  ariaLabel: "Exclude matches",
15272
15492
  disabled: __props.disabled
15273
15493
  }, null, 8, ["modelValue", "title", "disabled"]),
15274
- createVNode(_sfc_main$Y, {
15494
+ createVNode(_sfc_main$_, {
15275
15495
  modelValue: useRegex.value,
15276
15496
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => useRegex.value = $event),
15277
15497
  size: "xsmall",
@@ -15291,7 +15511,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
15291
15511
  }
15292
15512
  });
15293
15513
 
15294
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
15514
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
15295
15515
  __name: "KdsSearchInput",
15296
15516
  props: /* @__PURE__ */ mergeModels({
15297
15517
  description: {},
@@ -15443,11 +15663,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
15443
15663
  }
15444
15664
  });
15445
15665
 
15446
- const KdsSearchInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$p, [["__scopeId", "data-v-b1809b6d"]]);
15666
+ const KdsSearchInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["__scopeId", "data-v-b1809b6d"]]);
15447
15667
 
15448
- const _hoisted_1$j = ["rows", "placeholder", "disabled", "autocomplete"];
15668
+ const _hoisted_1$k = ["rows", "placeholder", "disabled", "autocomplete"];
15449
15669
  const DEFAULT_ROWS = 3;
15450
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
15670
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
15451
15671
  __name: "KdsTextarea",
15452
15672
  props: /* @__PURE__ */ mergeModels({
15453
15673
  description: {},
@@ -15508,7 +15728,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
15508
15728
  placeholder: __props.placeholder,
15509
15729
  disabled: __props.disabled,
15510
15730
  autocomplete: props.autocomplete
15511
- }), null, 16, _hoisted_1$j), [
15731
+ }), null, 16, _hoisted_1$k), [
15512
15732
  [vModelText, modelValue.value]
15513
15733
  ])
15514
15734
  ]),
@@ -15518,20 +15738,20 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
15518
15738
  }
15519
15739
  });
15520
15740
 
15521
- const KdsTextarea = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["__scopeId", "data-v-bdf12ef9"]]);
15741
+ const KdsTextarea = /* @__PURE__ */ _export_sfc$1(_sfc_main$p, [["__scopeId", "data-v-bdf12ef9"]]);
15522
15742
 
15523
- const _hoisted_1$i = ["id", "aria-expanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-invalid", "aria-controls", "disabled"];
15524
- const _hoisted_2$a = {
15743
+ const _hoisted_1$j = ["id", "aria-expanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-invalid", "aria-controls", "disabled"];
15744
+ const _hoisted_2$b = {
15525
15745
  key: 0,
15526
15746
  class: "leading",
15527
15747
  "aria-hidden": "true"
15528
15748
  };
15529
- const _hoisted_3$7 = ["id"];
15530
- const _hoisted_4$5 = {
15749
+ const _hoisted_3$8 = ["id"];
15750
+ const _hoisted_4$6 = {
15531
15751
  class: "trailing",
15532
15752
  "aria-hidden": "true"
15533
15753
  };
15534
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
15754
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
15535
15755
  __name: "BaseDropdown",
15536
15756
  props: /* @__PURE__ */ mergeModels({
15537
15757
  text: {},
@@ -15603,8 +15823,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
15603
15823
  onClick: _cache[0] || (_cache[0] = ($event) => !__props.disabled && emit("click")),
15604
15824
  onKeydown
15605
15825
  }, [
15606
- props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$a, [
15607
- createVNode(_sfc_main$V, {
15826
+ props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$b, [
15827
+ createVNode(_sfc_main$X, {
15608
15828
  accessory: props.accessory,
15609
15829
  size: "medium"
15610
15830
  }, null, 8, ["accessory"])
@@ -15615,28 +15835,28 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
15615
15835
  placeholder: !props.text && !__props.disabled,
15616
15836
  missing: __props.missing
15617
15837
  }])
15618
- }, toDisplayString(props.text ?? props.placeholder), 11, _hoisted_3$7),
15619
- createElementVNode("span", _hoisted_4$5, [
15838
+ }, toDisplayString(props.text ?? props.placeholder), 11, _hoisted_3$8),
15839
+ createElementVNode("span", _hoisted_4$6, [
15620
15840
  createVNode(KdsIcon, {
15621
15841
  name: open.value ? "chevron-up" : "chevron-down",
15622
15842
  size: "small"
15623
15843
  }, null, 8, ["name"])
15624
15844
  ])
15625
- ], 42, _hoisted_1$i);
15845
+ ], 42, _hoisted_1$j);
15626
15846
  };
15627
15847
  }
15628
15848
  });
15629
15849
 
15630
- const BaseDropdown = /* @__PURE__ */ _export_sfc$1(_sfc_main$n, [["__scopeId", "data-v-cf3becf9"]]);
15850
+ const BaseDropdown = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["__scopeId", "data-v-cf3becf9"]]);
15631
15851
 
15632
15852
  const DROPDOWN_SEARCH_THRESHOLD = 12;
15633
15853
 
15634
- const _hoisted_1$h = { class: "kds-dropdown-container" };
15635
- const _hoisted_2$9 = {
15854
+ const _hoisted_1$i = { class: "kds-dropdown-container" };
15855
+ const _hoisted_2$a = {
15636
15856
  key: 0,
15637
15857
  class: "kds-dropdown-container-sticky-top"
15638
15858
  };
15639
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
15859
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
15640
15860
  __name: "DropdownContainer",
15641
15861
  props: /* @__PURE__ */ mergeModels({
15642
15862
  emptyText: {},
@@ -15719,8 +15939,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
15719
15939
  }
15720
15940
  });
15721
15941
  return (_ctx, _cache) => {
15722
- return openBlock(), createElementBlock("div", _hoisted_1$h, [
15723
- searchable.value ? (openBlock(), createElementBlock("div", _hoisted_2$9, [
15942
+ return openBlock(), createElementBlock("div", _hoisted_1$i, [
15943
+ searchable.value ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
15724
15944
  createVNode(BaseInput, {
15725
15945
  ref_key: "searchEl",
15726
15946
  ref: searchEl,
@@ -15752,9 +15972,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
15752
15972
  }
15753
15973
  });
15754
15974
 
15755
- const DropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["__scopeId", "data-v-db105594"]]);
15975
+ const DropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$n, [["__scopeId", "data-v-db105594"]]);
15756
15976
 
15757
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
15977
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
15758
15978
  __name: "KdsDropdown",
15759
15979
  props: /* @__PURE__ */ mergeModels({
15760
15980
  placeholder: { default: "Select" },
@@ -15847,9 +16067,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
15847
16067
  }
15848
16068
  });
15849
16069
 
15850
- const _hoisted_1$g = ["disabled"];
15851
- const _hoisted_2$8 = ["title"];
15852
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
16070
+ const _hoisted_1$h = ["disabled"];
16071
+ const _hoisted_2$9 = ["title"];
16072
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
15853
16073
  __name: "KdsListItemButton",
15854
16074
  props: {
15855
16075
  label: {},
@@ -15879,21 +16099,21 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
15879
16099
  ref: labelEl,
15880
16100
  class: "label",
15881
16101
  title: unref(isLabelTruncated) ? props.label : void 0
15882
- }, toDisplayString(props.label), 9, _hoisted_2$8)
15883
- ], 8, _hoisted_1$g);
16102
+ }, toDisplayString(props.label), 9, _hoisted_2$9)
16103
+ ], 8, _hoisted_1$h);
15884
16104
  };
15885
16105
  }
15886
16106
  });
15887
16107
 
15888
- const KdsListItemButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["__scopeId", "data-v-13945d12"]]);
16108
+ const KdsListItemButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["__scopeId", "data-v-13945d12"]]);
15889
16109
 
15890
- const _hoisted_1$f = { class: "kds-multi-select-dropdown-options" };
15891
- const _hoisted_2$7 = { class: "kds-multi-select-dropdown-search" };
15892
- const _hoisted_3$6 = {
16110
+ const _hoisted_1$g = { class: "kds-multi-select-dropdown-options" };
16111
+ const _hoisted_2$8 = { class: "kds-multi-select-dropdown-search" };
16112
+ const _hoisted_3$7 = {
15893
16113
  key: 0,
15894
16114
  class: "kds-multi-select-dropdown-footer"
15895
16115
  };
15896
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
16116
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
15897
16117
  __name: "MultiSelectDropdownContainer",
15898
16118
  props: /* @__PURE__ */ mergeModels({
15899
16119
  emptyText: {},
@@ -16009,8 +16229,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
16009
16229
  }
16010
16230
  });
16011
16231
  return (_ctx, _cache) => {
16012
- return openBlock(), createElementBlock("div", _hoisted_1$f, [
16013
- createElementVNode("div", _hoisted_2$7, [
16232
+ return openBlock(), createElementBlock("div", _hoisted_1$g, [
16233
+ createElementVNode("div", _hoisted_2$8, [
16014
16234
  createVNode(BaseInput, {
16015
16235
  ref_key: "searchEl",
16016
16236
  ref: searchEl,
@@ -16039,7 +16259,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
16039
16259
  "aria-label": "Dropdown options",
16040
16260
  onItemClick: _cache[4] || (_cache[4] = ($event) => $event !== void 0 && onItemClick($event))
16041
16261
  }, null, 8, ["class", "possible-values", "loading", "empty-text"]),
16042
- !__props.loading && visibleEnabledIds.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
16262
+ !__props.loading && visibleEnabledIds.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$7, [
16043
16263
  createVNode(unref(KdsListItemButton), {
16044
16264
  label: anyVisibleSelected.value ? "Clear all" : "Select all",
16045
16265
  "leading-icon": anyVisibleSelected.value ? "trash" : "checkmark",
@@ -16052,9 +16272,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
16052
16272
  }
16053
16273
  });
16054
16274
 
16055
- const MultiSelectDropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$j, [["__scopeId", "data-v-9b631765"]]);
16275
+ const MultiSelectDropdownContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["__scopeId", "data-v-9b631765"]]);
16056
16276
 
16057
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
16277
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
16058
16278
  __name: "KdsMultiSelectDropdown",
16059
16279
  props: /* @__PURE__ */ mergeModels({
16060
16280
  placeholder: { default: "Select" },
@@ -16181,9 +16401,9 @@ const kdsDimensionComponentHeight20x = 320;
16181
16401
  const kdsSpacingContainer0p10x = 1;
16182
16402
  const kdsSpacingContainer0p25x = 4;
16183
16403
 
16184
- const _hoisted_1$e = { class: "kds-resize-handle-area" };
16185
- const _hoisted_2$6 = ["aria-label"];
16186
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
16404
+ const _hoisted_1$f = { class: "kds-resize-handle-area" };
16405
+ const _hoisted_2$7 = ["aria-label"];
16406
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
16187
16407
  __name: "ResizeHandle",
16188
16408
  props: {
16189
16409
  numberOfHandles: { default: 1 },
@@ -16205,7 +16425,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
16205
16425
  return `calc((100% - ${n - 1} * ${gap}) / ${2 * n})`;
16206
16426
  });
16207
16427
  return (_ctx, _cache) => {
16208
- return openBlock(), createElementBlock("div", _hoisted_1$e, [
16428
+ return openBlock(), createElementBlock("div", _hoisted_1$f, [
16209
16429
  (openBlock(true), createElementBlock(Fragment, null, renderList(normalizedNumberOfHandles.value, (i) => {
16210
16430
  return openBlock(), createElementBlock("button", {
16211
16431
  key: i,
@@ -16214,22 +16434,22 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
16214
16434
  type: "button"
16215
16435
  }, [..._cache[0] || (_cache[0] = [
16216
16436
  createElementVNode("span", { class: "kds-resize-handle-line" }, null, -1)
16217
- ])], 8, _hoisted_2$6);
16437
+ ])], 8, _hoisted_2$7);
16218
16438
  }), 128))
16219
16439
  ]);
16220
16440
  };
16221
16441
  }
16222
16442
  });
16223
16443
 
16224
- const ResizeHandle = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-df3803d4"]]);
16444
+ const ResizeHandle = /* @__PURE__ */ _export_sfc$1(_sfc_main$i, [["__scopeId", "data-v-df3803d4"]]);
16225
16445
 
16226
- const _hoisted_1$d = {
16446
+ const _hoisted_1$e = {
16227
16447
  ref: "content",
16228
16448
  class: "kds-resize-container-content"
16229
16449
  };
16230
16450
  const DEFAULT_INITIAL_HEIGHT = 200;
16231
16451
  const KEYBOARD_RESIZE_STEP = 10;
16232
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
16452
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
16233
16453
  __name: "KdsResizeContainer",
16234
16454
  props: {
16235
16455
  height: { default: () => DEFAULT_INITIAL_HEIGHT },
@@ -16292,7 +16512,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
16292
16512
  return openBlock(), createElementBlock("div", {
16293
16513
  class: normalizeClass(["kds-resize-container", { dragging: unref(activePointerId) !== null }])
16294
16514
  }, [
16295
- createElementVNode("div", _hoisted_1$d, [
16515
+ createElementVNode("div", _hoisted_1$e, [
16296
16516
  renderSlot(_ctx.$slots, "default", { contentStyle: contentStyle.value }, void 0, true)
16297
16517
  ], 512),
16298
16518
  createVNode(ResizeHandle, {
@@ -16301,15 +16521,16 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
16301
16521
  onPointerdown: unref(onPointerDown),
16302
16522
  onPointermove: withModifiers(unref(onPointerMove), ["prevent"]),
16303
16523
  onLostpointercapture: unref(onPointerUp),
16524
+ onPointerup: unref(onPointerUp),
16304
16525
  onKeydown,
16305
16526
  onDblclick: toggleMaximized
16306
- }, null, 8, ["number-of-handles", "handle-gap", "onPointerdown", "onPointermove", "onLostpointercapture"])
16527
+ }, null, 8, ["number-of-handles", "handle-gap", "onPointerdown", "onPointermove", "onLostpointercapture", "onPointerup"])
16307
16528
  ], 2);
16308
16529
  };
16309
16530
  }
16310
16531
  });
16311
16532
 
16312
- const KdsResizeContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$g, [["__scopeId", "data-v-403e065b"]]);
16533
+ const KdsResizeContainer = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-46b33b01"]]);
16313
16534
 
16314
16535
  const CLICK_META_KEY_TIMEOUT = 250;
16315
16536
  const useMultiSelectListBoxSelection = ({
@@ -16559,7 +16780,9 @@ const useMultiSelectListBoxSelection = ({
16559
16780
  if (currentKeyNavIndex.value < 0) {
16560
16781
  currentKeyNavIndex.value = 0;
16561
16782
  }
16562
- setSelected([allValues.value[currentKeyNavIndex.value].id]);
16783
+ if (modelValue.value.length === 0) {
16784
+ setSelected([allValues.value[currentKeyNavIndex.value].id]);
16785
+ }
16563
16786
  }
16564
16787
  };
16565
16788
  const onBlur = () => {
@@ -16599,17 +16822,17 @@ const useMultiSelectListBoxSelection = ({
16599
16822
  };
16600
16823
  };
16601
16824
 
16602
- const _hoisted_1$c = ["id", "tabindex", "aria-labelledby", "aria-describedby", "aria-label", "aria-invalid", "aria-activedescendant", "aria-disabled", "onKeydown"];
16603
- const _hoisted_2$5 = { class: "kds-multiselect-list-box-content-grid" };
16604
- const _hoisted_3$5 = {
16825
+ const _hoisted_1$d = ["id", "tabindex", "aria-labelledby", "aria-describedby", "aria-label", "aria-invalid", "aria-activedescendant", "aria-disabled", "onKeydown"];
16826
+ const _hoisted_2$6 = { class: "kds-multiselect-list-box-content-grid" };
16827
+ const _hoisted_3$6 = {
16605
16828
  key: 0,
16606
16829
  class: "kds-multiselect-sticky-bottom"
16607
16830
  };
16608
- const _hoisted_4$4 = {
16831
+ const _hoisted_4$5 = {
16609
16832
  key: 0,
16610
16833
  class: "kds-multiselect-empty"
16611
16834
  };
16612
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
16835
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
16613
16836
  __name: "KdsMultiSelectListBox",
16614
16837
  props: /* @__PURE__ */ mergeModels({
16615
16838
  description: {},
@@ -16780,7 +17003,10 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
16780
17003
  }, {
16781
17004
  default: withCtx(({ contentStyle }) => [
16782
17005
  createElementVNode("div", {
16783
- class: "kds-multiselect-list-box",
17006
+ class: normalizeClass([
17007
+ "kds-multiselect-list-box",
17008
+ { error: __props.error, disabled: effectiveDisabled.value }
17009
+ ]),
16784
17010
  style: normalizeStyle(contentStyle)
16785
17011
  }, [
16786
17012
  createElementVNode("div", mergeProps(unref(containerProps), {
@@ -16859,7 +17085,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
16859
17085
  onBlur: _cache[17] || (_cache[17] = //@ts-ignore
16860
17086
  (...args) => unref(onBlur) && unref(onBlur)(...args))
16861
17087
  }), [
16862
- createElementVNode("div", _hoisted_2$5, [
17088
+ createElementVNode("div", _hoisted_2$6, [
16863
17089
  createElementVNode("div", mergeProps({ class: "kds-multiselect-list-box-content" }, unref(wrapperProps)), [
16864
17090
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(virtualList), ({ data: item, index }) => {
16865
17091
  return openBlock(), createBlock(unref(KdsListItem), {
@@ -16872,20 +17098,21 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
16872
17098
  label: item.text,
16873
17099
  accessory: item.accessory,
16874
17100
  missing: item.missing,
17101
+ special: item.special,
16875
17102
  "data-option-index": index,
16876
17103
  selected: unref(isCurrentValue)(item.id),
16877
17104
  disabled: effectiveDisabled.value,
16878
17105
  active: unref(isKeyboardNavigating) && unref(currentKeyNavIndex) === index,
16879
- "trailing-icon": item.missing && !effectiveDisabled.value ? "trash" : unref(isCurrentValue)(item.id) ? "checkmark" : void 0,
17106
+ "trailing-icon": unref(isCurrentValue)(item.id) ? "checkmark" : void 0,
16880
17107
  onDblclick: [
16881
17108
  withModifiers(($event) => handleDblClick(item.id, index), ["exact"]),
16882
17109
  _cache[0] || (_cache[0] = withModifiers(($event) => handleShiftDblClick(), ["shift"]))
16883
17110
  ],
16884
17111
  onClick: ($event) => unref(handleClick)($event, item.id, index)
16885
- }, null, 8, ["id", "class", "label", "accessory", "missing", "data-option-index", "selected", "disabled", "active", "trailing-icon", "onDblclick", "onClick"]);
17112
+ }, null, 8, ["id", "class", "label", "accessory", "missing", "special", "data-option-index", "selected", "disabled", "active", "trailing-icon", "onDblclick", "onClick"]);
16886
17113
  }), 128))
16887
17114
  ], 16),
16888
- visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$5, [
17115
+ visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
16889
17116
  createVNode(unref(KdsListItem), {
16890
17117
  id: generateOptionId(visibleBottomValue.value.id),
16891
17118
  label: visibleBottomValue.value.text,
@@ -16896,7 +17123,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
16896
17123
  disabled: effectiveDisabled.value,
16897
17124
  active: unref(isKeyboardNavigating) && unref(currentKeyNavIndex) === bottomIndex.value,
16898
17125
  special: "",
16899
- "trailing-icon": visibleBottomValue.value.missing && !effectiveDisabled.value ? "trash" : unref(isCurrentValue)(visibleBottomValue.value.id) ? "checkmark" : void 0,
17126
+ "trailing-icon": unref(isCurrentValue)(visibleBottomValue.value.id) ? "checkmark" : void 0,
16900
17127
  onClick: _cache[1] || (_cache[1] = ($event) => unref(handleClick)($event, visibleBottomValue.value.id, bottomIndex.value)),
16901
17128
  onDblclick: [
16902
17129
  _cache[2] || (_cache[2] = withModifiers(($event) => handleShiftDblClick(), ["shift"])),
@@ -16905,14 +17132,14 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
16905
17132
  }, null, 8, ["id", "label", "accessory", "missing", "data-option-index", "selected", "disabled", "active", "trailing-icon"])
16906
17133
  ])) : createCommentVNode("", true)
16907
17134
  ])
16908
- ], 16, _hoisted_1$c),
16909
- visiblePossibleValues.value.length === 0 && !visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_4$4, [
17135
+ ], 16, _hoisted_1$d),
17136
+ visiblePossibleValues.value.length === 0 && !visibleBottomValue.value ? (openBlock(), createElementBlock("div", _hoisted_4$5, [
16910
17137
  createVNode(KdsEmptyState, {
16911
17138
  headline: __props.loading ? "Loading data…" : __props.emptyStateLabel,
16912
17139
  "loading-spinner": __props.loading
16913
17140
  }, null, 8, ["headline", "loading-spinner"])
16914
17141
  ])) : createCommentVNode("", true)
16915
- ], 4)
17142
+ ], 6)
16916
17143
  ]),
16917
17144
  _: 2
16918
17145
  }, 1032, ["height", "min-height"]))
@@ -16923,12 +17150,12 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
16923
17150
  }
16924
17151
  });
16925
17152
 
16926
- const KdsMultiSelectListBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__scopeId", "data-v-9fde3128"]]);
17153
+ const KdsMultiSelectListBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$g, [["__scopeId", "data-v-24af1af0"]]);
16927
17154
 
16928
- const _hoisted_1$b = { class: "kds-list-column" };
16929
- const _hoisted_2$4 = { class: "kds-list-header" };
16930
- const _hoisted_3$4 = { class: "kds-list-label" };
16931
- const _hoisted_4$3 = {
17155
+ const _hoisted_1$c = { class: "kds-list-column" };
17156
+ const _hoisted_2$5 = { class: "kds-list-header" };
17157
+ const _hoisted_3$5 = { class: "kds-list-label" };
17158
+ const _hoisted_4$4 = {
16932
17159
  key: 0,
16933
17160
  class: "kds-list-count"
16934
17161
  };
@@ -16941,10 +17168,11 @@ const _hoisted_9 = {
16941
17168
  class: "kds-list-count"
16942
17169
  };
16943
17170
  const UNKNOWN_VALUE_ID = "__unknown-value-option__";
16944
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
17171
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
16945
17172
  __name: "TwinListBody",
16946
17173
  props: /* @__PURE__ */ mergeModels({
16947
17174
  disabled: { type: Boolean, default: false },
17175
+ error: { type: Boolean, default: false },
16948
17176
  possibleValues: {},
16949
17177
  searchTerm: { default: "" },
16950
17178
  excludeLabel: { default: "Exclude" },
@@ -16958,7 +17186,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
16958
17186
  }),
16959
17187
  emits: ["update:modelValue"],
16960
17188
  setup(__props) {
16961
- const props = createPropsRestProxy(__props, ["disabled", "searchTerm", "excludeLabel", "includeLabel", "unknownValuesText", "loading"]);
17189
+ const props = createPropsRestProxy(__props, ["disabled", "error", "searchTerm", "excludeLabel", "includeLabel", "unknownValuesText", "loading"]);
16962
17190
  const modelValue = useModel(__props, "modelValue");
16963
17191
  const effectiveDisabled = computed(() => __props.disabled || __props.loading);
16964
17192
  const leftSelected = ref([]);
@@ -17114,10 +17342,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
17114
17342
  class: "kds-twin-list-body",
17115
17343
  style: normalizeStyle(contentStyle)
17116
17344
  }, [
17117
- createElementVNode("div", _hoisted_1$b, [
17118
- createElementVNode("div", _hoisted_2$4, [
17119
- createElementVNode("span", _hoisted_3$4, toDisplayString(__props.excludeLabel), 1),
17120
- !__props.loading && __props.searchTerm ? (openBlock(), createElementBlock("span", _hoisted_4$3, toDisplayString(leftOptions.value.length) + " of " + toDisplayString(excludedItems.value.length), 1)) : createCommentVNode("", true)
17345
+ createElementVNode("div", _hoisted_1$c, [
17346
+ createElementVNode("div", _hoisted_2$5, [
17347
+ createElementVNode("span", _hoisted_3$5, toDisplayString(__props.excludeLabel), 1),
17348
+ !__props.loading && __props.searchTerm ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(leftOptions.value.length) + " of " + toDisplayString(excludedItems.value.length), 1)) : createCommentVNode("", true)
17121
17349
  ]),
17122
17350
  createVNode(unref(KdsMultiSelectListBox), {
17123
17351
  modelValue: leftSelected.value,
@@ -17126,6 +17354,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
17126
17354
  "possible-values": leftOptions.value,
17127
17355
  ariaLabel: __props.excludeLabel,
17128
17356
  disabled: effectiveDisabled.value,
17357
+ error: __props.error,
17129
17358
  loading: __props.loading,
17130
17359
  "empty-state-label": props.emptyStateLabel,
17131
17360
  "bottom-value": showUnknownValues.value && modelValue.value.includeUnknownValues === false ? unknownValueOption.value : void 0,
@@ -17133,10 +17362,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
17133
17362
  onDoubleClickShift: moveRight,
17134
17363
  onKeyArrowRight: moveRight,
17135
17364
  onKeyEnter: moveRight
17136
- }, null, 8, ["modelValue", "possible-values", "ariaLabel", "disabled", "loading", "empty-state-label", "bottom-value"])
17365
+ }, null, 8, ["modelValue", "possible-values", "ariaLabel", "disabled", "error", "loading", "empty-state-label", "bottom-value"])
17137
17366
  ]),
17138
17367
  createElementVNode("div", _hoisted_5$1, [
17139
- createVNode(unref(_sfc_main$$), {
17368
+ createVNode(unref(_sfc_main$11), {
17140
17369
  "leading-icon": "chevron-right",
17141
17370
  ariaLabel: "Move selected values right",
17142
17371
  title: "Move selected values right",
@@ -17145,7 +17374,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
17145
17374
  disabled: effectiveDisabled.value || leftSelected.value.length === 0,
17146
17375
  onClick: _cache[2] || (_cache[2] = ($event) => moveRight(leftSelected.value))
17147
17376
  }, null, 8, ["disabled"]),
17148
- createVNode(unref(_sfc_main$$), {
17377
+ createVNode(unref(_sfc_main$11), {
17149
17378
  "leading-icon": "chevron-right-double",
17150
17379
  ariaLabel: "Move all values right",
17151
17380
  title: "Move all values right",
@@ -17157,7 +17386,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
17157
17386
  ...showUnknownValues.value && !modelValue.value.includeUnknownValues ? [UNKNOWN_VALUE_ID] : []
17158
17387
  ]))
17159
17388
  }, null, 8, ["disabled"]),
17160
- createVNode(unref(_sfc_main$$), {
17389
+ createVNode(unref(_sfc_main$11), {
17161
17390
  "leading-icon": "chevron-left",
17162
17391
  ariaLabel: "Move selected values left",
17163
17392
  title: "Move selected values left",
@@ -17166,7 +17395,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
17166
17395
  disabled: effectiveDisabled.value || rightSelected.value.length === 0,
17167
17396
  onClick: _cache[4] || (_cache[4] = ($event) => moveLeft(rightSelected.value))
17168
17397
  }, null, 8, ["disabled"]),
17169
- createVNode(unref(_sfc_main$$), {
17398
+ createVNode(unref(_sfc_main$11), {
17170
17399
  "leading-icon": "chevron-left-double",
17171
17400
  ariaLabel: "Move all values left",
17172
17401
  title: "Move all values left",
@@ -17191,6 +17420,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
17191
17420
  "possible-values": rightOptions.value,
17192
17421
  ariaLabel: __props.includeLabel,
17193
17422
  disabled: effectiveDisabled.value,
17423
+ error: __props.error,
17194
17424
  loading: __props.loading,
17195
17425
  "empty-state-label": props.emptyStateLabel,
17196
17426
  "bottom-value": showUnknownValues.value && modelValue.value.includeUnknownValues === true ? unknownValueOption.value : void 0,
@@ -17198,7 +17428,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
17198
17428
  onDoubleClickShift: moveLeft,
17199
17429
  onKeyArrowLeft: moveLeft,
17200
17430
  onKeyEnter: moveLeft
17201
- }, null, 8, ["modelValue", "possible-values", "ariaLabel", "disabled", "loading", "empty-state-label", "bottom-value"])
17431
+ }, null, 8, ["modelValue", "possible-values", "ariaLabel", "disabled", "error", "loading", "empty-state-label", "bottom-value"])
17202
17432
  ])
17203
17433
  ], 4)
17204
17434
  ]),
@@ -17208,7 +17438,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
17208
17438
  }
17209
17439
  });
17210
17440
 
17211
- const TwinListBody = /* @__PURE__ */ _export_sfc$1(_sfc_main$e, [["__scopeId", "data-v-e05644d2"]]);
17441
+ const TwinListBody = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__scopeId", "data-v-8a9e1b15"]]);
17212
17442
 
17213
17443
  const kdsTwinListSearchMode = {
17214
17444
  MANUAL: "manual",
@@ -17217,7 +17447,7 @@ const kdsTwinListSearchMode = {
17217
17447
  };
17218
17448
  const kdsTwinListSearchModes = Object.values(kdsTwinListSearchMode);
17219
17449
 
17220
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
17450
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
17221
17451
  __name: "TwinListHeader",
17222
17452
  props: /* @__PURE__ */ mergeModels({
17223
17453
  filterTypes: { default: () => void 0 },
@@ -17293,7 +17523,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
17293
17523
  ariaLabel: "Search values",
17294
17524
  placeholder: "Search",
17295
17525
  disabled: __props.disabled
17296
- }, null, 8, ["modelValue", "disabled"])) : mode.value === unref(kdsTwinListSearchMode).PATTERN ? (openBlock(), createBlock(unref(_sfc_main$q), {
17526
+ }, null, 8, ["modelValue", "disabled"])) : mode.value === unref(kdsTwinListSearchMode).PATTERN ? (openBlock(), createBlock(unref(_sfc_main$r), {
17297
17527
  key: 2,
17298
17528
  modelValue: pattern.value,
17299
17529
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => pattern.value = $event),
@@ -17307,7 +17537,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
17307
17537
  placeholder: "Pattern",
17308
17538
  disabled: __props.disabled,
17309
17539
  "onUpdate:regex": _cache[6] || (_cache[6] = ($event) => emit("update:regex", $event))
17310
- }, null, 8, ["modelValue", "case-sensitive", "exclude-matches", "use-regex", "disabled"])) : (openBlock(), createBlock(unref(_sfc_main$i), {
17540
+ }, null, 8, ["modelValue", "case-sensitive", "exclude-matches", "use-regex", "disabled"])) : (openBlock(), createBlock(unref(_sfc_main$j), {
17311
17541
  key: 3,
17312
17542
  modelValue: selectedTypes.value,
17313
17543
  "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => selectedTypes.value = $event),
@@ -17321,8 +17551,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
17321
17551
  }
17322
17552
  });
17323
17553
 
17324
- const _hoisted_1$a = { class: "kds-twin-list" };
17325
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
17554
+ const _hoisted_1$b = { class: "kds-twin-list" };
17555
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
17326
17556
  __name: "KdsTwinList",
17327
17557
  props: /* @__PURE__ */ mergeModels({
17328
17558
  description: {},
@@ -17453,8 +17683,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
17453
17683
  "preserve-sub-text-space": __props.preserveSubTextSpace
17454
17684
  }, {
17455
17685
  default: withCtx(() => [
17456
- createElementVNode("div", _hoisted_1$a, [
17457
- createVNode(_sfc_main$d, {
17686
+ createElementVNode("div", _hoisted_1$b, [
17687
+ createVNode(_sfc_main$e, {
17458
17688
  mode: mode.value,
17459
17689
  "onUpdate:mode": _cache[0] || (_cache[0] = ($event) => mode.value = $event),
17460
17690
  pattern: pattern.value,
@@ -17478,6 +17708,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
17478
17708
  modelValue: effectiveBodyModel.value,
17479
17709
  "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => effectiveBodyModel.value = $event),
17480
17710
  disabled: __props.disabled || mode.value !== unref(kdsTwinListSearchMode).MANUAL,
17711
+ error: __props.error,
17481
17712
  "possible-values": __props.possibleValues,
17482
17713
  "search-term": searchTerm.value,
17483
17714
  "exclude-label": props.excludeLabel,
@@ -17485,7 +17716,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
17485
17716
  "unknown-values-text": props.unknownValuesText,
17486
17717
  "empty-state-label": props.emptyStateLabel,
17487
17718
  loading: __props.loading
17488
- }, null, 8, ["modelValue", "disabled", "possible-values", "search-term", "exclude-label", "include-label", "unknown-values-text", "empty-state-label", "loading"])
17719
+ }, null, 8, ["modelValue", "disabled", "error", "possible-values", "search-term", "exclude-label", "include-label", "unknown-values-text", "empty-state-label", "loading"])
17489
17720
  ])
17490
17721
  ]),
17491
17722
  _: 1
@@ -17494,7 +17725,214 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
17494
17725
  }
17495
17726
  });
17496
17727
 
17497
- const KdsTwinList = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__scopeId", "data-v-c46b28b5"]]);
17728
+ const KdsTwinList = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["__scopeId", "data-v-1a9327b5"]]);
17729
+
17730
+ const useSortableListBoxReorder = ({
17731
+ orderedIds,
17732
+ selection,
17733
+ disabled
17734
+ }) => {
17735
+ const selectedIndices = computed(() => {
17736
+ const selected = new Set(selection.value);
17737
+ return orderedIds.value.map((id, i) => ({ id, index: i })).filter((v) => selected.has(v.id)).map((v) => v.index);
17738
+ });
17739
+ const canMoveUp = computed(
17740
+ () => !disabled.value && selectedIndices.value.length > 0 && selectedIndices.value[0] > 0
17741
+ );
17742
+ const canMoveDown = computed(
17743
+ () => !disabled.value && selectedIndices.value.length > 0 && selectedIndices.value[selectedIndices.value.length - 1] < orderedIds.value.length - 1
17744
+ );
17745
+ const reorder = (direction) => {
17746
+ const ids = [...orderedIds.value];
17747
+ const indices = selectedIndices.value;
17748
+ if (indices.length === 0) {
17749
+ return ids;
17750
+ }
17751
+ const movingIds = indices.map((i) => ids[i]);
17752
+ const indexSet = new Set(indices);
17753
+ const remaining = ids.filter((_, i) => !indexSet.has(i));
17754
+ let insertAt;
17755
+ if (direction === "top") {
17756
+ insertAt = 0;
17757
+ } else if (direction === "bottom") {
17758
+ insertAt = remaining.length;
17759
+ } else if (direction === "up") {
17760
+ insertAt = Math.max(0, indices[0] - 1);
17761
+ } else {
17762
+ insertAt = Math.min(
17763
+ remaining.length,
17764
+ indices[indices.length - 1] - indices.length + 2
17765
+ );
17766
+ }
17767
+ remaining.splice(insertAt, 0, ...movingIds);
17768
+ return remaining;
17769
+ };
17770
+ const sortByText = (ascending, optionLookup) => {
17771
+ const sorted = [...orderedIds.value].sort((a, b) => {
17772
+ const textA = optionLookup.get(a)?.text ?? a;
17773
+ const textB = optionLookup.get(b)?.text ?? b;
17774
+ return ascending ? textA.localeCompare(textB) : textB.localeCompare(textA);
17775
+ });
17776
+ return sorted;
17777
+ };
17778
+ return {
17779
+ selectedIndices,
17780
+ canMoveUp,
17781
+ canMoveDown,
17782
+ reorder,
17783
+ sortByText
17784
+ };
17785
+ };
17786
+
17787
+ const _hoisted_1$a = { class: "kds-sortable-list-box-wrapper" };
17788
+ const _hoisted_2$4 = { class: "kds-sortable-top-buttons" };
17789
+ const _hoisted_3$4 = { class: "kds-sortable-top-buttons-left" };
17790
+ const _hoisted_4$3 = { class: "kds-sortable-footer-buttons" };
17791
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
17792
+ __name: "KdsSortableListBox",
17793
+ props: /* @__PURE__ */ mergeModels({
17794
+ possibleValues: {},
17795
+ disabled: { type: Boolean, default: false },
17796
+ description: {},
17797
+ label: {},
17798
+ ariaLabel: {},
17799
+ id: {},
17800
+ subText: {},
17801
+ error: { type: Boolean, default: false },
17802
+ validating: { type: Boolean, default: false },
17803
+ preserveSubTextSpace: { type: Boolean, default: false }
17804
+ }, {
17805
+ "modelValue": { required: true },
17806
+ "modelModifiers": {}
17807
+ }),
17808
+ emits: ["update:modelValue"],
17809
+ setup(__props, { expose: __expose }) {
17810
+ const formFieldProps = createPropsRestProxy(__props, ["possibleValues", "disabled", "error", "validating", "preserveSubTextSpace"]);
17811
+ const modelValue = useModel(__props, "modelValue");
17812
+ const selection = ref([]);
17813
+ const optionLookup = computed(() => {
17814
+ const map = /* @__PURE__ */ new Map();
17815
+ for (const option of __props.possibleValues) {
17816
+ map.set(option.id, option);
17817
+ }
17818
+ return map;
17819
+ });
17820
+ const orderedOptions = computed(
17821
+ () => modelValue.value.map(
17822
+ (id) => optionLookup.value.get(id) ?? { id, text: id, missing: true }
17823
+ )
17824
+ );
17825
+ const listBoxRef = useTemplateRef("listBoxRef");
17826
+ const { canMoveUp, canMoveDown, reorder, sortByText } = useSortableListBoxReorder({
17827
+ orderedIds: modelValue,
17828
+ selection,
17829
+ disabled: toRef(() => __props.disabled)
17830
+ });
17831
+ const applyReorder = (newOrder) => {
17832
+ modelValue.value = newOrder;
17833
+ };
17834
+ const moveUp = () => canMoveUp.value && applyReorder(reorder("up"));
17835
+ const moveDown = () => canMoveDown.value && applyReorder(reorder("down"));
17836
+ const moveToTop = () => canMoveUp.value && applyReorder(reorder("top"));
17837
+ const moveToBottom = () => canMoveDown.value && applyReorder(reorder("bottom"));
17838
+ const resetOrder = () => applyReorder(__props.possibleValues.map((option) => option.id));
17839
+ const focus = () => listBoxRef.value?.focus();
17840
+ __expose({ focus });
17841
+ return (_ctx, _cache) => {
17842
+ return openBlock(), createBlock(BaseFieldsetWrapper, mergeProps(formFieldProps, {
17843
+ error: __props.error,
17844
+ validating: __props.validating,
17845
+ "preserve-sub-text-space": __props.preserveSubTextSpace
17846
+ }), {
17847
+ default: withCtx(() => [
17848
+ createElementVNode("div", _hoisted_1$a, [
17849
+ createElementVNode("div", _hoisted_2$4, [
17850
+ createElementVNode("div", _hoisted_3$4, [
17851
+ createVNode(_sfc_main$11, {
17852
+ size: "small",
17853
+ variant: "transparent",
17854
+ "leading-icon": "sort-descending",
17855
+ label: "A – Z",
17856
+ disabled: __props.disabled,
17857
+ onClick: _cache[0] || (_cache[0] = ($event) => applyReorder(unref(sortByText)(true, optionLookup.value)))
17858
+ }, null, 8, ["disabled"]),
17859
+ createVNode(_sfc_main$11, {
17860
+ size: "small",
17861
+ variant: "transparent",
17862
+ "leading-icon": "sort-ascending",
17863
+ label: "Z – A",
17864
+ disabled: __props.disabled,
17865
+ onClick: _cache[1] || (_cache[1] = ($event) => applyReorder(unref(sortByText)(false, optionLookup.value)))
17866
+ }, null, 8, ["disabled"])
17867
+ ]),
17868
+ createVNode(_sfc_main$11, {
17869
+ size: "small",
17870
+ variant: "transparent",
17871
+ destructive: "",
17872
+ label: "Reset all",
17873
+ disabled: __props.disabled,
17874
+ onClick: resetOrder
17875
+ }, null, 8, ["disabled"])
17876
+ ]),
17877
+ createVNode(KdsMultiSelectListBox, {
17878
+ ref_key: "listBoxRef",
17879
+ ref: listBoxRef,
17880
+ modelValue: selection.value,
17881
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => selection.value = $event),
17882
+ "possible-values": orderedOptions.value,
17883
+ disabled: __props.disabled,
17884
+ error: __props.error,
17885
+ "use-resize-handle": true,
17886
+ ariaLabel: formFieldProps.label ?? formFieldProps.ariaLabel ?? ""
17887
+ /* fallback only for TS */
17888
+ }, null, 8, ["modelValue", "possible-values", "disabled", "error", "ariaLabel"]),
17889
+ createElementVNode("div", _hoisted_4$3, [
17890
+ createVNode(_sfc_main$11, {
17891
+ size: "small",
17892
+ variant: "transparent",
17893
+ "leading-icon": "to-top",
17894
+ label: "Top",
17895
+ title: "Move to top",
17896
+ disabled: __props.disabled || !unref(canMoveUp),
17897
+ onClick: moveToTop
17898
+ }, null, 8, ["disabled"]),
17899
+ createVNode(_sfc_main$11, {
17900
+ size: "small",
17901
+ variant: "transparent",
17902
+ "leading-icon": "to-bottom",
17903
+ label: "Bottom",
17904
+ title: "Move to bottom",
17905
+ disabled: __props.disabled || !unref(canMoveDown),
17906
+ onClick: moveToBottom
17907
+ }, null, 8, ["disabled"]),
17908
+ createVNode(_sfc_main$11, {
17909
+ size: "small",
17910
+ variant: "transparent",
17911
+ "leading-icon": "arrow-up",
17912
+ label: "Up",
17913
+ title: "Move up",
17914
+ disabled: __props.disabled || !unref(canMoveUp),
17915
+ onClick: moveUp
17916
+ }, null, 8, ["disabled"]),
17917
+ createVNode(_sfc_main$11, {
17918
+ size: "small",
17919
+ variant: "transparent",
17920
+ "leading-icon": "arrow-down",
17921
+ label: "Down",
17922
+ title: "Move down",
17923
+ disabled: __props.disabled || !unref(canMoveDown),
17924
+ onClick: moveDown
17925
+ }, null, 8, ["disabled"])
17926
+ ])
17927
+ ])
17928
+ ]),
17929
+ _: 1
17930
+ }, 16, ["error", "validating", "preserve-sub-text-space"]);
17931
+ };
17932
+ }
17933
+ });
17934
+
17935
+ const KdsSortableListBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__scopeId", "data-v-ee7b63e2"]]);
17498
17936
 
17499
17937
  const _hoisted_1$9 = { class: "kds-info-popover-content" };
17500
17938
  const _sfc_main$b = /* @__PURE__ */ defineComponent({
@@ -18308,7 +18746,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
18308
18746
  size: "medium"
18309
18747
  }, null, 8, ["name"])) : createCommentVNode("", true),
18310
18748
  createElementVNode("div", _hoisted_2$1, toDisplayString(__props.headline), 1),
18311
- createVNode(_sfc_main$$, {
18749
+ createVNode(_sfc_main$11, {
18312
18750
  "leading-icon": "x-close",
18313
18751
  variant: "transparent",
18314
18752
  size: "medium",
@@ -18581,7 +19019,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
18581
19019
  unref(internal).isTemplateBasedConfirm(unref(config).value) ? (openBlock(), createBlock(resolveDynamicComponent(unref(config).value.component), { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_1, [
18582
19020
  createElementVNode("div", _hoisted_2, toDisplayString(unref(config).value.message), 1),
18583
19021
  unref(config).value.doNotAskAgain ? (openBlock(), createElementBlock("div", _hoisted_3, [
18584
- createVNode(_sfc_main$J, {
19022
+ createVNode(_sfc_main$L, {
18585
19023
  modelValue: askAgain.value,
18586
19024
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => askAgain.value = $event),
18587
19025
  label: unref(config).value.doNotAskAgain.label,
@@ -18596,7 +19034,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
18596
19034
  name: "footer",
18597
19035
  fn: withCtx(() => [
18598
19036
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(config).value.buttons, (button, index) => {
18599
- return openBlock(), createBlock(_sfc_main$$, {
19037
+ return openBlock(), createBlock(_sfc_main$11, {
18600
19038
  key: index,
18601
19039
  destructive: button.destructive,
18602
19040
  autofocus: button.autofocus,
@@ -18628,5 +19066,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
18628
19066
 
18629
19067
  const KdsDynamicModalProvider = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__scopeId", "data-v-41fc8d84"]]);
18630
19068
 
18631
- export { KdsAvatar, KdsBadge, _sfc_main$$ as KdsButton, KdsCardClickable, _sfc_main$J as KdsCheckbox, KdsCheckboxGroup, _sfc_main$y as KdsColorInput, KdsColorSwatch, KdsDataType, _sfc_main$u as KdsDateInput, _sfc_main$s as KdsDateTimeFormatInput, _sfc_main$l as KdsDropdown, KdsDynamicModalProvider, KdsEmptyState, KdsIcon, KdsInfoToggleButton, KdsInlineMessage, KdsLabel, KdsLink, _sfc_main$_ as KdsLinkButton, KdsLiveStatus, KdsLoadingSkeleton, KdsLoadingSpinner, _sfc_main$O as KdsMenuButton, KdsModal, KdsModalLayout, _sfc_main$i as KdsMultiSelectDropdown, KdsMultiSelectListBox, _sfc_main$r as KdsNumberInput, _sfc_main$x as KdsPasswordInput, _sfc_main$q as KdsPatternInput, KdsProgressButton, KdsRadioButton, KdsRadioButtonGroup, KdsSearchInput, KdsSplitButton, KdsSubText, KdsTabBar, KdsTextInput, KdsTextarea, _sfc_main$Y as KdsToggleButton, KdsTwinList, _sfc_main$w as KdsUsernameInput, KdsValueSwitch, KdsVariableToggleButton, kdsAvatarSize, kdsAvatarSizes, kdsBadgeSize, kdsBadgeSizes, kdsBadgeVariant, kdsBadgeVariants, kdsButtonSize, kdsButtonSizes, kdsButtonVariant, kdsButtonVariants, kdsCardVariant, kdsCardVariants, kdsCheckboxGroupAlignment, kdsCheckboxGroupAlignments, kdsCheckboxValue, kdsCheckboxValues, kdsColorSwatchSize, kdsColorSwatchSizes, kdsColorSwatchType, kdsColorSwatchTypes, kdsDarkModeType, kdsDarkModeTypes, kdsDataTypeSize, kdsDataTypeSizes, kdsDateFormatCategories, kdsDateFormatCategory, kdsIconName, iconNames as kdsIconNames, kdsIconSize, kdsIconSizes, kdsInlineMessageVariant, kdsInlineMessageVariants, kdsLiveStatusSize, kdsLiveStatusSizes, kdsLiveStatusStatus, kdsLiveStatusStatuses, kdsLoadingSkeletonVariant, kdsLoadingSkeletonVariants, kdsLoadingSpinnerVariant, kdsLoadingSpinnerVariants, kdsModalClosedBy, kdsModalClosedByOptions, kdsModalHeight, kdsModalHeightSizes, kdsModalVariant, kdsModalVariants, kdsModalWidth, kdsModalWidthSizes, kdsPasswordInputAutocomplete, kdsPasswordInputAutocompletes, kdsPasswordInputVariant, kdsPasswordInputVariants, kdsProgressButtonState, kdsProgressButtonStates, kdsRadioButtonGroupAlignment, kdsRadioButtonGroupAlignments, kdsTabBarSize, kdsTabBarSizes, kdsTemporalType, kdsTemporalTypes, kdsToggleButtonVariant, kdsToggleButtonVariants, kdsTwinListSearchMode, kdsTwinListSearchModes, kdsTypeIconName, typeIconNames as kdsTypeIconNames, kdsUsernameInputAutocomplete, kdsUsernameInputAutocompletes, kdsValueSwitchSize, kdsValueSwitchSizes, kdsValueSwitchVariant, kdsValueSwitchVariants, useKdsDarkMode, useKdsDynamicModal, useKdsIsTruncated, useKdsLegacyMode };
19069
+ export { KdsAvatar, KdsBadge, _sfc_main$11 as KdsButton, KdsCardClickable, _sfc_main$L as KdsCheckbox, KdsCheckboxGroup, _sfc_main$y as KdsColorInput, KdsColorSwatch, KdsDataType, _sfc_main$u as KdsDateInput, _sfc_main$s as KdsDateTimeFormatInput, _sfc_main$m as KdsDropdown, KdsDynamicModalProvider, KdsEmptyState, KdsIcon, KdsInfoToggleButton, KdsInlineMessage, KdsLabel, KdsLink, _sfc_main$10 as KdsLinkButton, KdsLiveStatus, KdsLoadingSkeleton, KdsLoadingSpinner, _sfc_main$Q as KdsMenuButton, KdsModal, KdsModalLayout, _sfc_main$j as KdsMultiSelectDropdown, _sfc_main$C as KdsNumberInput, _sfc_main$x as KdsPasswordInput, _sfc_main$r as KdsPatternInput, KdsProgressButton, KdsRadioButton, KdsRadioButtonGroup, KdsSearchInput, KdsSortableListBox, KdsSplitButton, KdsSubText, KdsTabBar, KdsTextInput, KdsTextarea, _sfc_main$_ as KdsToggleButton, KdsTwinList, _sfc_main$w as KdsUsernameInput, KdsValueSwitch, KdsVariableToggleButton, kdsAvatarSize, kdsAvatarSizes, kdsBadgeSize, kdsBadgeSizes, kdsBadgeVariant, kdsBadgeVariants, kdsButtonSize, kdsButtonSizes, kdsButtonVariant, kdsButtonVariants, kdsCardVariant, kdsCardVariants, kdsCheckboxGroupAlignment, kdsCheckboxGroupAlignments, kdsCheckboxValue, kdsCheckboxValues, kdsColorSwatchSize, kdsColorSwatchSizes, kdsColorSwatchType, kdsColorSwatchTypes, kdsDarkModeType, kdsDarkModeTypes, kdsDataTypeSize, kdsDataTypeSizes, kdsDateFormatCategories, kdsDateFormatCategory, kdsIconName, iconNames as kdsIconNames, kdsIconSize, kdsIconSizes, kdsInlineMessageVariant, kdsInlineMessageVariants, kdsLiveStatusSize, kdsLiveStatusSizes, kdsLiveStatusStatus, kdsLiveStatusStatuses, kdsLoadingSkeletonVariant, kdsLoadingSkeletonVariants, kdsLoadingSpinnerVariant, kdsLoadingSpinnerVariants, kdsModalClosedBy, kdsModalClosedByOptions, kdsModalHeight, kdsModalHeightSizes, kdsModalVariant, kdsModalVariants, kdsModalWidth, kdsModalWidthSizes, kdsPasswordInputAutocomplete, kdsPasswordInputAutocompletes, kdsPasswordInputVariant, kdsPasswordInputVariants, kdsProgressButtonState, kdsProgressButtonStates, kdsRadioButtonGroupAlignment, kdsRadioButtonGroupAlignments, kdsTabBarSize, kdsTabBarSizes, kdsTemporalType, kdsTemporalTypes, kdsToggleButtonVariant, kdsToggleButtonVariants, kdsTwinListSearchMode, kdsTwinListSearchModes, kdsTypeIconName, typeIconNames as kdsTypeIconNames, kdsUsernameInputAutocomplete, kdsUsernameInputAutocompletes, kdsValueSwitchSize, kdsValueSwitchSizes, kdsValueSwitchVariant, kdsValueSwitchVariants, useKdsDarkMode, useKdsDynamicModal, useKdsIsTruncated, useKdsLegacyMode };
18632
19070
  //# sourceMappingURL=index.js.map