kanto-ds 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +24 -6
  2. package/dist/chunks/{defaults-DKzFsNbv.js → defaults-BwgjMcww.js} +27 -26
  3. package/dist/chunks/{defaults-DKzFsNbv.js.map → defaults-BwgjMcww.js.map} +1 -1
  4. package/dist/chunks/index-DSSLJirw.js +79 -0
  5. package/dist/chunks/index-DSSLJirw.js.map +1 -0
  6. package/dist/chunks/kt-element-E-tfJpGQ.js +52 -0
  7. package/dist/chunks/kt-element-E-tfJpGQ.js.map +1 -0
  8. package/dist/components/core/kt-avatar/kt-avatar.js +8 -7
  9. package/dist/components/core/kt-avatar/kt-avatar.js.map +1 -1
  10. package/dist/components/core/kt-badge/kt-badge.js +7 -6
  11. package/dist/components/core/kt-badge/kt-badge.js.map +1 -1
  12. package/dist/components/core/kt-button/kt-button.js +1 -1
  13. package/dist/components/core/kt-card/kt-card.js +1 -1
  14. package/dist/components/core/kt-code/kt-code.js +31 -30
  15. package/dist/components/core/kt-code/kt-code.js.map +1 -1
  16. package/dist/components/core/kt-icon/kt-icon.js +2 -2
  17. package/dist/components/core/kt-kbd/kt-kbd.js +1 -1
  18. package/dist/components/core/kt-split-button/kt-split-button.d.ts +2 -2
  19. package/dist/components/core/kt-split-button/kt-split-button.js +27 -26
  20. package/dist/components/core/kt-split-button/kt-split-button.js.map +1 -1
  21. package/dist/components/data/kt-chart/kt-chart.d.ts +2 -2
  22. package/dist/components/data/kt-chart/kt-chart.js +222 -221
  23. package/dist/components/data/kt-chart/kt-chart.js.map +1 -1
  24. package/dist/components/data/kt-meter/kt-meter.js +1 -1
  25. package/dist/components/data/kt-pagination/kt-pagination.d.ts +1 -1
  26. package/dist/components/data/kt-pagination/kt-pagination.js +29 -28
  27. package/dist/components/data/kt-pagination/kt-pagination.js.map +1 -1
  28. package/dist/components/data/kt-stat/kt-stat.js +1 -1
  29. package/dist/components/data/kt-table/kt-table.d.ts +2 -2
  30. package/dist/components/data/kt-table/kt-table.js +30 -29
  31. package/dist/components/data/kt-table/kt-table.js.map +1 -1
  32. package/dist/components/data/kt-timeline/kt-timeline.js +1 -1
  33. package/dist/components/feedback/kt-alert/kt-alert.js +17 -16
  34. package/dist/components/feedback/kt-alert/kt-alert.js.map +1 -1
  35. package/dist/components/feedback/kt-empty-state/kt-empty-state.js +1 -1
  36. package/dist/components/feedback/kt-progress-bar/kt-progress-bar.js +1 -1
  37. package/dist/components/feedback/kt-skeleton/kt-skeleton.js +1 -1
  38. package/dist/components/feedback/kt-toast/kt-toast.js +25 -19
  39. package/dist/components/feedback/kt-toast/kt-toast.js.map +1 -1
  40. package/dist/components/feedback/kt-toast-container/kt-toast-container.js +1 -1
  41. package/dist/components/feedback/kt-tooltip/kt-tooltip.js +1 -1
  42. package/dist/components/forms/kt-checkbox/kt-checkbox.d.ts +66 -0
  43. package/dist/components/forms/kt-checkbox/kt-checkbox.js +198 -0
  44. package/dist/components/forms/kt-checkbox/kt-checkbox.js.map +1 -0
  45. package/dist/components/forms/kt-drag-drop/kt-drag-drop.d.ts +2 -2
  46. package/dist/components/forms/kt-drag-drop/kt-drag-drop.js +60 -57
  47. package/dist/components/forms/kt-drag-drop/kt-drag-drop.js.map +1 -1
  48. package/dist/components/forms/kt-form/kt-form.js +11 -10
  49. package/dist/components/forms/kt-form/kt-form.js.map +1 -1
  50. package/dist/components/forms/kt-input/kt-input.js +56 -55
  51. package/dist/components/forms/kt-input/kt-input.js.map +1 -1
  52. package/dist/components/forms/kt-input-menu/kt-input-menu.d.ts +1 -1
  53. package/dist/components/forms/kt-input-menu/kt-input-menu.js +57 -56
  54. package/dist/components/forms/kt-input-menu/kt-input-menu.js.map +1 -1
  55. package/dist/components/forms/kt-label-input/kt-label-input.js +1 -1
  56. package/dist/components/forms/kt-radio-group/kt-radio-group.d.ts +103 -0
  57. package/dist/components/forms/kt-radio-group/kt-radio-group.js +265 -0
  58. package/dist/components/forms/kt-radio-group/kt-radio-group.js.map +1 -0
  59. package/dist/components/forms/kt-select/kt-select.d.ts +2 -2
  60. package/dist/components/forms/kt-select/kt-select.js +62 -61
  61. package/dist/components/forms/kt-select/kt-select.js.map +1 -1
  62. package/dist/components/forms/kt-textarea/kt-textarea.js +9 -8
  63. package/dist/components/forms/kt-textarea/kt-textarea.js.map +1 -1
  64. package/dist/components/forms/kt-toggle/kt-toggle.js +1 -1
  65. package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.d.ts +1 -1
  66. package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.js +6 -5
  67. package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.js.map +1 -1
  68. package/dist/components/navigation/kt-header/kt-header.js +11 -10
  69. package/dist/components/navigation/kt-header/kt-header.js.map +1 -1
  70. package/dist/components/navigation/kt-page-header/kt-page-header.js +1 -1
  71. package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js +44 -43
  72. package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js.map +1 -1
  73. package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.d.ts +1 -1
  74. package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js +6 -5
  75. package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js.map +1 -1
  76. package/dist/components/navigation/kt-tabs/kt-tabs.js +1 -1
  77. package/dist/components/navigation/kt-toggle-button/kt-toggle-button.js +1 -1
  78. package/dist/components/navigation/kt-toggle-button-group/kt-toggle-button-group.js +12 -6
  79. package/dist/components/navigation/kt-toggle-button-group/kt-toggle-button-group.js.map +1 -1
  80. package/dist/components/overlays/kt-collapsible/kt-collapsible.js +1 -1
  81. package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.d.ts +3 -3
  82. package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.js +30 -27
  83. package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.js.map +1 -1
  84. package/dist/components/overlays/kt-dropdown/kt-dropdown.d.ts +1 -1
  85. package/dist/components/overlays/kt-dropdown/kt-dropdown.js +8 -7
  86. package/dist/components/overlays/kt-dropdown/kt-dropdown.js.map +1 -1
  87. package/dist/components/overlays/kt-modal/kt-modal.js +5 -4
  88. package/dist/components/overlays/kt-modal/kt-modal.js.map +1 -1
  89. package/dist/components/overlays/kt-side-panel/kt-side-panel.d.ts +1 -1
  90. package/dist/components/overlays/kt-side-panel/kt-side-panel.js +24 -23
  91. package/dist/components/overlays/kt-side-panel/kt-side-panel.js.map +1 -1
  92. package/dist/custom-elements.json +1870 -1071
  93. package/dist/icons/defaults.d.ts +1 -0
  94. package/dist/icons/index.js +1 -1
  95. package/dist/index.d.ts +5 -0
  96. package/dist/index.js +93 -83
  97. package/dist/index.js.map +1 -1
  98. package/dist/internal/kt-element.d.ts +6 -1
  99. package/dist/internal/strings.d.ts +103 -0
  100. package/dist/react/index.d.ts +13 -0
  101. package/dist/react/index.js +176 -157
  102. package/dist/react/index.js.map +1 -1
  103. package/dist/react/jsx.d.ts +12 -1
  104. package/dist/strings/index.d.ts +11 -0
  105. package/dist/strings/index.js +8 -0
  106. package/dist/strings/index.js.map +1 -0
  107. package/dist/tokens/base.css +56 -0
  108. package/dist/vscode.css-custom-data.json +12 -0
  109. package/dist/vscode.html-custom-data.json +85 -0
  110. package/dist/vue/index.d.ts +6 -0
  111. package/dist/vue/index.js +9 -7
  112. package/dist/vue/index.js.map +1 -1
  113. package/dist/web-types.json +263 -39
  114. package/package.json +19 -3
  115. package/dist/chunks/kt-element-B_jjQDhg.js +0 -38
  116. package/dist/chunks/kt-element-B_jjQDhg.js.map +0 -1
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The copy Kanto's elements write themselves, and the way to translate it.
3
+ *
4
+ * import { setStrings } from 'kanto-ds/strings';
5
+ *
6
+ * setStrings({ clear: 'Effacer', noData: 'Aucune donnée' });
7
+ *
8
+ * A light entry point: it loads no element, so it can run before any of them.
9
+ * The same functions are exported from `kanto-ds`.
10
+ */
11
+ export { defaultStrings, resetStrings, setStrings, strings as getStrings, type KtStrings, } from '#internal/strings';
@@ -0,0 +1,8 @@
1
+ import { d as r, s as a, r as e, a as g } from "../chunks/index-DSSLJirw.js";
2
+ export {
3
+ r as defaultStrings,
4
+ a as getStrings,
5
+ e as resetStrings,
6
+ g as setStrings
7
+ };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -77,3 +77,59 @@ pre {
77
77
  outline: var(--outline-width) solid var(--color-primary-base);
78
78
  outline-offset: 2px;
79
79
  }
80
+
81
+ /* Before its definition loads, a custom element is an unknown inline element:
82
+ its slotted text and icons show raw, unstyled, then jump into place. Hidden
83
+ instead — `visibility`, not `display`, so the page keeps its layout and does
84
+ not shift twice. Scoped to Kanto's own tags, never to every :not(:defined)
85
+ element on the page. */
86
+ :is(
87
+ kt-alert,
88
+ kt-avatar,
89
+ kt-badge,
90
+ kt-breadcrumb,
91
+ kt-button,
92
+ kt-card,
93
+ kt-chart,
94
+ kt-checkbox,
95
+ kt-code,
96
+ kt-collapsible,
97
+ kt-confirm-dialog,
98
+ kt-drag-drop,
99
+ kt-dropdown,
100
+ kt-empty-state,
101
+ kt-form,
102
+ kt-header,
103
+ kt-icon,
104
+ kt-input,
105
+ kt-input-menu,
106
+ kt-kbd,
107
+ kt-label-input,
108
+ kt-meter,
109
+ kt-modal,
110
+ kt-page-header,
111
+ kt-pagination,
112
+ kt-progress-bar,
113
+ kt-radio,
114
+ kt-radio-group,
115
+ kt-segmented-control,
116
+ kt-select,
117
+ kt-side-panel,
118
+ kt-skeleton,
119
+ kt-split-button,
120
+ kt-stat,
121
+ kt-sub-menu-navigation,
122
+ kt-table,
123
+ kt-tabs,
124
+ kt-textarea,
125
+ kt-timeline,
126
+ kt-timeline-item,
127
+ kt-toast,
128
+ kt-toast-container,
129
+ kt-toggle,
130
+ kt-toggle-button,
131
+ kt-toggle-button-group,
132
+ kt-tooltip
133
+ ):not(:defined) {
134
+ visibility: hidden;
135
+ }
@@ -83,6 +83,12 @@
83
83
  { "name": "::part(base)", "description": "The toast surface." },
84
84
  { "name": "::part(close)", "description": "The dismiss button." },
85
85
  { "name": "::part(bubble)", "description": "The tooltip bubble." },
86
+ {
87
+ "name": "::part(base)",
88
+ "description": "The `<label>` around box and text."
89
+ },
90
+ { "name": "::part(input)", "description": "The native checkbox." },
91
+ { "name": "::part(box)", "description": "The drawn box." },
86
92
  { "name": "::part(base)", "description": "The dashed drop zone." },
87
93
  { "name": "::part(list)", "description": "The list of chosen files." },
88
94
  { "name": "::part(base)", "description": "The `<fieldset>`." },
@@ -97,6 +103,12 @@
97
103
  { "name": "::part(popup)", "description": "The option list." },
98
104
  { "name": "::part(option)", "description": "An option row." },
99
105
  { "name": "::part(label)", "description": "The `<label>`." },
106
+ { "name": "::part(base)", "description": "The `role=\"radio\"` row." },
107
+ { "name": "::part(circle)", "description": "The drawn circle." },
108
+ {
109
+ "name": "::part(base)",
110
+ "description": "The `role=\"radiogroup\"` container."
111
+ },
100
112
  {
101
113
  "name": "::part(trigger)",
102
114
  "description": "The button that opens the list."
@@ -631,6 +631,38 @@
631
631
  ],
632
632
  "references": []
633
633
  },
634
+ {
635
+ "name": "kt-checkbox",
636
+ "description": "A checkbox: a choice that applies when the form is submitted.\n\nBuilt on a real `<input type=\"checkbox\">`, laid invisibly over the drawn\nbox, so the keyboard, the label click, the indeterminate state and what a\nscreen reader announces all come from the platform rather than a\nreimplementation of it.\n\nFor a setting that takes effect the moment it is flipped, use\n`<kt-toggle>`; for one choice among several, `<kt-radio-group>`.\n---\n\n\n### **Events:**\n - **kt-change** - The box was checked or unchecked. `detail: { checked }`.\n\n### **Slots:**\n - _default_ - The label, clickable.\n\n### **CSS Parts:**\n - **base** - The `<label>` around box and text.\n- **input** - The native checkbox.\n- **box** - The drawn box.",
637
+ "attributes": [
638
+ { "name": "checked", "values": [] },
639
+ {
640
+ "name": "indeterminate",
641
+ "description": "Neither checked nor unchecked — for a \"select all\" over a partial\nselection. Cleared as soon as the user clicks, as on a native checkbox.",
642
+ "values": []
643
+ },
644
+ { "name": "disabled", "values": [] },
645
+ { "name": "required", "values": [] },
646
+ { "name": "size", "values": [{ "name": "KtCheckboxSize" }] },
647
+ { "name": "name", "values": [] },
648
+ {
649
+ "name": "value",
650
+ "description": "Submitted when checked, as for a native checkbox.",
651
+ "values": []
652
+ },
653
+ {
654
+ "name": "label",
655
+ "description": "Accessible name, when nothing is slotted.",
656
+ "values": []
657
+ },
658
+ {
659
+ "name": "error",
660
+ "description": "Error message. A non-empty value puts the box in its error state.",
661
+ "values": []
662
+ }
663
+ ],
664
+ "references": []
665
+ },
634
666
  {
635
667
  "name": "kt-drag-drop",
636
668
  "description": "A file drop zone.\n\nAccepts a drop or a click, lists what was picked with sizes and types, and\nlets each entry be removed. It holds the files in memory and reports them —\nuploading is the application's business.\n---\n\n\n### **Events:**\n - **kt-files-change** - The selection changed. `detail: { files }`.\n- **kt-files-rejected** - Files were refused. `detail: { files, reason }`.\n\n### **Methods:**\n - **clear(): _void_** - Empties the selection without firing a rejection.\n\n### **CSS Parts:**\n - **base** - The dashed drop zone.\n- **list** - The list of chosen files.",
@@ -781,6 +813,59 @@
781
813
  ],
782
814
  "references": []
783
815
  },
816
+ {
817
+ "name": "kt-radio",
818
+ "description": "One option of a `<kt-radio-group>`.\n\nIt draws itself and carries `role=\"radio\"`; the group owns the selection,\nthe tab stop and the keyboard. A `<kt-radio>` outside a group does nothing\nuseful.\n---\n\n\n### **Slots:**\n - _default_ - The label.\n\n### **CSS Parts:**\n - **base** - The `role=\"radio\"` row.\n- **circle** - The drawn circle.",
819
+ "attributes": [
820
+ {
821
+ "name": "value",
822
+ "description": "Submitted by the group when this option is chosen.",
823
+ "values": []
824
+ },
825
+ { "name": "disabled", "values": [] },
826
+ { "name": "checked", "description": "Set by the group.", "values": [] },
827
+ {
828
+ "name": "invalid",
829
+ "description": "Set by the group while it reports an error.",
830
+ "values": []
831
+ },
832
+ {
833
+ "name": "group-disabled",
834
+ "description": "Set by the group while the whole group is disabled.",
835
+ "values": []
836
+ }
837
+ ],
838
+ "references": []
839
+ },
840
+ {
841
+ "name": "kt-radio-group",
842
+ "description": "One choice among a few, all visible at once.\n\nReach for it over `<kt-select>` when there are few enough options to show\nthem all — seeing every option is the point — and over\n`<kt-segmented-control>` when the options need a sentence each, or the\nchoice belongs in a form rather than a toolbar.\n\nNative radios cannot form a group across shadow roots, so this is the ARIA\nradio group pattern: one tab stop for the whole group, arrow keys move and\nselect, disabled options are skipped.\n---\n\n\n### **Events:**\n - **kt-change** - An option was chosen. `detail: { value }`.\n\n### **Slots:**\n - _default_ - The `<kt-radio>` options.\n\n### **CSS Parts:**\n - **base** - The `role=\"radiogroup\"` container.",
843
+ "attributes": [
844
+ {
845
+ "name": "value",
846
+ "description": "The chosen option's value, or `null`.",
847
+ "values": []
848
+ },
849
+ { "name": "name", "values": [] },
850
+ {
851
+ "name": "label",
852
+ "description": "Accessible name of the group.",
853
+ "values": []
854
+ },
855
+ { "name": "disabled", "values": [] },
856
+ { "name": "required", "values": [] },
857
+ {
858
+ "name": "orientation",
859
+ "values": [{ "name": "KtRadioGroupOrientation" }]
860
+ },
861
+ {
862
+ "name": "error",
863
+ "description": "Error message. A non-empty value puts the group in its error state.",
864
+ "values": []
865
+ }
866
+ ],
867
+ "references": []
868
+ },
784
869
  {
785
870
  "name": "kt-select",
786
871
  "description": "A single-choice dropdown.\n\nUnlike the trigger-plus-div it replaces, this is a real listbox: arrow keys\nmove an active descendant, Home and End jump to the ends, Enter commits,\nEscape closes without changing anything, and disabled options are skipped\nrather than merely unclickable.\n---\n\n\n### **Events:**\n - **kt-change** - An option was chosen or cleared. `detail: { value, option }`.\n\n### **CSS Parts:**\n - **trigger** - The button that opens the list.\n- **popup** - The option list.\n- **option** - An option row.",
@@ -44,6 +44,9 @@ import type { KtInput } from 'kanto-ds';
44
44
  import type { KtInputMenu } from 'kanto-ds';
45
45
  import type { KtLabelInput } from 'kanto-ds';
46
46
  import type { KtSelect } from 'kanto-ds';
47
+ import type { KtCheckbox } from 'kanto-ds';
48
+ import type { KtRadioGroup } from 'kanto-ds';
49
+ import type { KtRadio } from 'kanto-ds';
47
50
  import type { KtTextarea } from 'kanto-ds';
48
51
  import type { KtToggle } from 'kanto-ds';
49
52
  import type { KtBreadcrumb } from 'kanto-ds';
@@ -105,6 +108,9 @@ declare module 'vue' {
105
108
  'kt-input-menu': KtProps<KtInputMenu>;
106
109
  'kt-label-input': KtProps<KtLabelInput>;
107
110
  'kt-select': KtProps<KtSelect>;
111
+ 'kt-checkbox': KtProps<KtCheckbox>;
112
+ 'kt-radio-group': KtProps<KtRadioGroup>;
113
+ 'kt-radio': KtProps<KtRadio>;
108
114
  'kt-textarea': KtProps<KtTextarea>;
109
115
  'kt-toggle': KtProps<KtToggle>;
110
116
  'kt-breadcrumb': KtProps<KtBreadcrumb>;
package/dist/vue/index.js CHANGED
@@ -6,11 +6,13 @@ import "../components/core/kt-card/kt-card.js";
6
6
  import "../components/core/kt-code/kt-code.js";
7
7
  import "../components/core/kt-icon/kt-icon.js";
8
8
  import "../components/core/kt-kbd/kt-kbd.js";
9
+ import "../components/forms/kt-checkbox/kt-checkbox.js";
9
10
  import "../components/forms/kt-drag-drop/kt-drag-drop.js";
10
11
  import "../components/forms/kt-form/kt-form.js";
11
12
  import "../components/forms/kt-input/kt-input.js";
12
13
  import "../components/forms/kt-input-menu/kt-input-menu.js";
13
14
  import "../components/forms/kt-label-input/kt-label-input.js";
15
+ import "../components/forms/kt-radio-group/kt-radio-group.js";
14
16
  import "../components/forms/kt-select/kt-select.js";
15
17
  import "../components/forms/kt-textarea/kt-textarea.js";
16
18
  import "../components/forms/kt-toggle/kt-toggle.js";
@@ -28,7 +30,7 @@ import "../components/feedback/kt-progress-bar/kt-progress-bar.js";
28
30
  import "../components/feedback/kt-skeleton/kt-skeleton.js";
29
31
  import "../components/feedback/kt-toast/kt-toast.js";
30
32
  import "../components/feedback/kt-toast-container/kt-toast-container.js";
31
- import { t as S } from "../chunks/toaster-PmdKSV5x.js";
33
+ import { t as V } from "../chunks/toaster-PmdKSV5x.js";
32
34
  import "../components/feedback/kt-tooltip/kt-tooltip.js";
33
35
  import "../components/overlays/kt-collapsible/kt-collapsible.js";
34
36
  import "../components/overlays/kt-confirm-dialog/kt-confirm-dialog.js";
@@ -41,17 +43,17 @@ import "../components/data/kt-pagination/kt-pagination.js";
41
43
  import "../components/data/kt-stat/kt-stat.js";
42
44
  import "../components/data/kt-table/kt-table.js";
43
45
  import "../components/data/kt-timeline/kt-timeline.js";
44
- function H(t) {
46
+ function L(t) {
45
47
  return t.startsWith("kt-");
46
48
  }
47
- const J = "kt-", L = {
49
+ const M = "kt-", Q = {
48
50
  install() {
49
51
  }
50
52
  };
51
53
  export {
52
- J as KANTO_TAG_PREFIX,
53
- H as isKantoElement,
54
- L as kanto,
55
- S as toaster
54
+ M as KANTO_TAG_PREFIX,
55
+ L as isKantoElement,
56
+ Q as kanto,
57
+ V as toaster
56
58
  };
57
59
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/vue/index.ts"],"sourcesContent":["/**\n * Vue integration for the Kanto elements.\n *\n * There are no per-component wrappers here, and that is the point. Vue 3\n * renders custom elements natively and sets non-primitive bindings as DOM\n * properties, so `<kt-select :options=\"regions\">` already works. A wrapper\n * layer would only be one more thing to keep in sync.\n *\n * What Vue cannot infer on its own is which tags are custom elements, and what\n * they accept. That is what this module supplies.\n *\n * ```ts\n * // vite.config.ts\n * import vue from '@vitejs/plugin-vue';\n * import { isKantoElement } from 'kanto-ds/vue';\n *\n * export default defineConfig({\n * plugins: [vue({ template: { compilerOptions: { isCustomElement: isKantoElement } } })],\n * });\n * ```\n *\n * ```ts\n * // main.ts\n * import 'kanto-ds/vue'; // registers every element\n * import 'kanto-ds/styles.css';\n * ```\n *\n * Vue is a peer dependency: importing this module in a project without Vue\n * still works, since nothing here is imported from `vue` at runtime.\n */\n// Type-only, so nothing from Vue is pulled in at runtime — but the import is\n// what lets TypeScript resolve the module we augment below.\nimport type { Plugin } from 'vue';\n\nimport '../index.js';\n\nimport type { KtAvatar } from 'kanto-ds';\nimport type { KtBadge } from 'kanto-ds';\nimport type { KtButton } from 'kanto-ds';\nimport type { KtSplitButton } from 'kanto-ds';\nimport type { KtCard } from 'kanto-ds';\nimport type { KtCode } from 'kanto-ds';\nimport type { KtIcon } from 'kanto-ds';\nimport type { KtKbd } from 'kanto-ds';\nimport type { KtDragDrop } from 'kanto-ds';\nimport type { KtForm } from 'kanto-ds';\nimport type { KtInput } from 'kanto-ds';\nimport type { KtInputMenu } from 'kanto-ds';\nimport type { KtLabelInput } from 'kanto-ds';\nimport type { KtSelect } from 'kanto-ds';\nimport type { KtTextarea } from 'kanto-ds';\nimport type { KtToggle } from 'kanto-ds';\nimport type { KtBreadcrumb } from 'kanto-ds';\nimport type { KtPageHeader } from 'kanto-ds';\nimport type { KtSegmentedControl } from 'kanto-ds';\nimport type { KtSubMenuNavigation } from 'kanto-ds';\nimport type { KtTabs } from 'kanto-ds';\nimport type { KtHeader } from 'kanto-ds';\nimport type { KtToggleButton } from 'kanto-ds';\nimport type { KtToggleButtonGroup } from 'kanto-ds';\nimport type { KtAlert } from 'kanto-ds';\nimport type { KtEmptyState } from 'kanto-ds';\nimport type { KtProgressBar } from 'kanto-ds';\nimport type { KtSkeleton } from 'kanto-ds';\nimport type { KtToast } from 'kanto-ds';\nimport type { KtToastContainer } from 'kanto-ds';\nimport type { KtTooltip } from 'kanto-ds';\nimport type { KtCollapsible } from 'kanto-ds';\nimport type { KtConfirmDialog } from 'kanto-ds';\nimport type { KtDropdown } from 'kanto-ds';\nimport type { KtModal } from 'kanto-ds';\nimport type { KtSidePanel } from 'kanto-ds';\nimport type { KtChart } from 'kanto-ds';\nimport type { KtMeter } from 'kanto-ds';\nimport type { KtPagination } from 'kanto-ds';\nimport type { KtStat } from 'kanto-ds';\nimport type { KtTable } from 'kanto-ds';\nimport type { KtTimeline, KtTimelineItem } from 'kanto-ds';\n\n/**\n * True for any Kanto custom element.\n *\n * Pass it as `compilerOptions.isCustomElement` so the Vue compiler stops\n * trying to resolve `kt-*` tags as components.\n */\nexport function isKantoElement(tag: string): boolean {\n return tag.startsWith('kt-');\n}\n\n/** Every element's tag name, for anyone building their own predicate. */\nexport const KANTO_TAG_PREFIX = 'kt-';\n\n/**\n * What a Kanto element accepts in a template: its own properties, plus the\n * attributes and listeners any element takes.\n */\ntype KtProps<T> = Partial<T> &\n Record<`on${string}`, unknown> & { class?: unknown; style?: unknown };\n\ndeclare module 'vue' {\n interface GlobalComponents {\n 'kt-avatar': KtProps<KtAvatar>;\n 'kt-badge': KtProps<KtBadge>;\n 'kt-button': KtProps<KtButton>;\n 'kt-split-button': KtProps<KtSplitButton>;\n 'kt-card': KtProps<KtCard>;\n 'kt-code': KtProps<KtCode>;\n 'kt-icon': KtProps<KtIcon>;\n 'kt-kbd': KtProps<KtKbd>;\n 'kt-drag-drop': KtProps<KtDragDrop>;\n 'kt-form': KtProps<KtForm>;\n 'kt-input': KtProps<KtInput>;\n 'kt-input-menu': KtProps<KtInputMenu>;\n 'kt-label-input': KtProps<KtLabelInput>;\n 'kt-select': KtProps<KtSelect>;\n 'kt-textarea': KtProps<KtTextarea>;\n 'kt-toggle': KtProps<KtToggle>;\n 'kt-breadcrumb': KtProps<KtBreadcrumb>;\n 'kt-page-header': KtProps<KtPageHeader>;\n 'kt-segmented-control': KtProps<KtSegmentedControl>;\n 'kt-sub-menu-navigation': KtProps<KtSubMenuNavigation>;\n 'kt-tabs': KtProps<KtTabs>;\n 'kt-header': KtProps<KtHeader>;\n 'kt-toggle-button': KtProps<KtToggleButton>;\n 'kt-toggle-button-group': KtProps<KtToggleButtonGroup>;\n 'kt-alert': KtProps<KtAlert>;\n 'kt-empty-state': KtProps<KtEmptyState>;\n 'kt-progress-bar': KtProps<KtProgressBar>;\n 'kt-skeleton': KtProps<KtSkeleton>;\n 'kt-toast': KtProps<KtToast>;\n 'kt-toast-container': KtProps<KtToastContainer>;\n 'kt-tooltip': KtProps<KtTooltip>;\n 'kt-collapsible': KtProps<KtCollapsible>;\n 'kt-confirm-dialog': KtProps<KtConfirmDialog>;\n 'kt-dropdown': KtProps<KtDropdown>;\n 'kt-modal': KtProps<KtModal>;\n 'kt-side-panel': KtProps<KtSidePanel>;\n 'kt-chart': KtProps<KtChart>;\n 'kt-meter': KtProps<KtMeter>;\n 'kt-pagination': KtProps<KtPagination>;\n 'kt-stat': KtProps<KtStat>;\n 'kt-table': KtProps<KtTable>;\n 'kt-timeline': KtProps<KtTimeline>;\n 'kt-timeline-item': KtProps<KtTimelineItem>;\n }\n}\n\n/**\n * A no-op plugin, for apps that would rather write `app.use(kanto)` than a\n * bare side-effect import. Importing this module already registers every\n * element; this only makes that visible in `main.ts`.\n */\nexport const kanto: Plugin = {\n install() {\n /* the elements register themselves on import */\n },\n};\n\nexport { toaster } from '../components/feedback/kt-toast-container/toaster.js';\n"],"names":["isKantoElement","tag","KANTO_TAG_PREFIX","kanto"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFO,SAASA,EAAeC,GAAsB;AACnD,SAAOA,EAAI,WAAW,KAAK;AAC7B;AAGO,MAAMC,IAAmB,OA8DnBC,IAAgB;AAAA,EAC3B,UAAU;AAAA,EAEV;AACF;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/vue/index.ts"],"sourcesContent":["/**\n * Vue integration for the Kanto elements.\n *\n * There are no per-component wrappers here, and that is the point. Vue 3\n * renders custom elements natively and sets non-primitive bindings as DOM\n * properties, so `<kt-select :options=\"regions\">` already works. A wrapper\n * layer would only be one more thing to keep in sync.\n *\n * What Vue cannot infer on its own is which tags are custom elements, and what\n * they accept. That is what this module supplies.\n *\n * ```ts\n * // vite.config.ts\n * import vue from '@vitejs/plugin-vue';\n * import { isKantoElement } from 'kanto-ds/vue';\n *\n * export default defineConfig({\n * plugins: [vue({ template: { compilerOptions: { isCustomElement: isKantoElement } } })],\n * });\n * ```\n *\n * ```ts\n * // main.ts\n * import 'kanto-ds/vue'; // registers every element\n * import 'kanto-ds/styles.css';\n * ```\n *\n * Vue is a peer dependency: importing this module in a project without Vue\n * still works, since nothing here is imported from `vue` at runtime.\n */\n// Type-only, so nothing from Vue is pulled in at runtime — but the import is\n// what lets TypeScript resolve the module we augment below.\nimport type { Plugin } from 'vue';\n\nimport '../index.js';\n\nimport type { KtAvatar } from 'kanto-ds';\nimport type { KtBadge } from 'kanto-ds';\nimport type { KtButton } from 'kanto-ds';\nimport type { KtSplitButton } from 'kanto-ds';\nimport type { KtCard } from 'kanto-ds';\nimport type { KtCode } from 'kanto-ds';\nimport type { KtIcon } from 'kanto-ds';\nimport type { KtKbd } from 'kanto-ds';\nimport type { KtDragDrop } from 'kanto-ds';\nimport type { KtForm } from 'kanto-ds';\nimport type { KtInput } from 'kanto-ds';\nimport type { KtInputMenu } from 'kanto-ds';\nimport type { KtLabelInput } from 'kanto-ds';\nimport type { KtSelect } from 'kanto-ds';\nimport type { KtCheckbox } from 'kanto-ds';\nimport type { KtRadioGroup } from 'kanto-ds';\nimport type { KtRadio } from 'kanto-ds';\nimport type { KtTextarea } from 'kanto-ds';\nimport type { KtToggle } from 'kanto-ds';\nimport type { KtBreadcrumb } from 'kanto-ds';\nimport type { KtPageHeader } from 'kanto-ds';\nimport type { KtSegmentedControl } from 'kanto-ds';\nimport type { KtSubMenuNavigation } from 'kanto-ds';\nimport type { KtTabs } from 'kanto-ds';\nimport type { KtHeader } from 'kanto-ds';\nimport type { KtToggleButton } from 'kanto-ds';\nimport type { KtToggleButtonGroup } from 'kanto-ds';\nimport type { KtAlert } from 'kanto-ds';\nimport type { KtEmptyState } from 'kanto-ds';\nimport type { KtProgressBar } from 'kanto-ds';\nimport type { KtSkeleton } from 'kanto-ds';\nimport type { KtToast } from 'kanto-ds';\nimport type { KtToastContainer } from 'kanto-ds';\nimport type { KtTooltip } from 'kanto-ds';\nimport type { KtCollapsible } from 'kanto-ds';\nimport type { KtConfirmDialog } from 'kanto-ds';\nimport type { KtDropdown } from 'kanto-ds';\nimport type { KtModal } from 'kanto-ds';\nimport type { KtSidePanel } from 'kanto-ds';\nimport type { KtChart } from 'kanto-ds';\nimport type { KtMeter } from 'kanto-ds';\nimport type { KtPagination } from 'kanto-ds';\nimport type { KtStat } from 'kanto-ds';\nimport type { KtTable } from 'kanto-ds';\nimport type { KtTimeline, KtTimelineItem } from 'kanto-ds';\n\n/**\n * True for any Kanto custom element.\n *\n * Pass it as `compilerOptions.isCustomElement` so the Vue compiler stops\n * trying to resolve `kt-*` tags as components.\n */\nexport function isKantoElement(tag: string): boolean {\n return tag.startsWith('kt-');\n}\n\n/** Every element's tag name, for anyone building their own predicate. */\nexport const KANTO_TAG_PREFIX = 'kt-';\n\n/**\n * What a Kanto element accepts in a template: its own properties, plus the\n * attributes and listeners any element takes.\n */\ntype KtProps<T> = Partial<T> &\n Record<`on${string}`, unknown> & { class?: unknown; style?: unknown };\n\ndeclare module 'vue' {\n interface GlobalComponents {\n 'kt-avatar': KtProps<KtAvatar>;\n 'kt-badge': KtProps<KtBadge>;\n 'kt-button': KtProps<KtButton>;\n 'kt-split-button': KtProps<KtSplitButton>;\n 'kt-card': KtProps<KtCard>;\n 'kt-code': KtProps<KtCode>;\n 'kt-icon': KtProps<KtIcon>;\n 'kt-kbd': KtProps<KtKbd>;\n 'kt-drag-drop': KtProps<KtDragDrop>;\n 'kt-form': KtProps<KtForm>;\n 'kt-input': KtProps<KtInput>;\n 'kt-input-menu': KtProps<KtInputMenu>;\n 'kt-label-input': KtProps<KtLabelInput>;\n 'kt-select': KtProps<KtSelect>;\n 'kt-checkbox': KtProps<KtCheckbox>;\n 'kt-radio-group': KtProps<KtRadioGroup>;\n 'kt-radio': KtProps<KtRadio>;\n 'kt-textarea': KtProps<KtTextarea>;\n 'kt-toggle': KtProps<KtToggle>;\n 'kt-breadcrumb': KtProps<KtBreadcrumb>;\n 'kt-page-header': KtProps<KtPageHeader>;\n 'kt-segmented-control': KtProps<KtSegmentedControl>;\n 'kt-sub-menu-navigation': KtProps<KtSubMenuNavigation>;\n 'kt-tabs': KtProps<KtTabs>;\n 'kt-header': KtProps<KtHeader>;\n 'kt-toggle-button': KtProps<KtToggleButton>;\n 'kt-toggle-button-group': KtProps<KtToggleButtonGroup>;\n 'kt-alert': KtProps<KtAlert>;\n 'kt-empty-state': KtProps<KtEmptyState>;\n 'kt-progress-bar': KtProps<KtProgressBar>;\n 'kt-skeleton': KtProps<KtSkeleton>;\n 'kt-toast': KtProps<KtToast>;\n 'kt-toast-container': KtProps<KtToastContainer>;\n 'kt-tooltip': KtProps<KtTooltip>;\n 'kt-collapsible': KtProps<KtCollapsible>;\n 'kt-confirm-dialog': KtProps<KtConfirmDialog>;\n 'kt-dropdown': KtProps<KtDropdown>;\n 'kt-modal': KtProps<KtModal>;\n 'kt-side-panel': KtProps<KtSidePanel>;\n 'kt-chart': KtProps<KtChart>;\n 'kt-meter': KtProps<KtMeter>;\n 'kt-pagination': KtProps<KtPagination>;\n 'kt-stat': KtProps<KtStat>;\n 'kt-table': KtProps<KtTable>;\n 'kt-timeline': KtProps<KtTimeline>;\n 'kt-timeline-item': KtProps<KtTimelineItem>;\n }\n}\n\n/**\n * A no-op plugin, for apps that would rather write `app.use(kanto)` than a\n * bare side-effect import. Importing this module already registers every\n * element; this only makes that visible in `main.ts`.\n */\nexport const kanto: Plugin = {\n install() {\n /* the elements register themselves on import */\n },\n};\n\nexport { toaster } from '../components/feedback/kt-toast-container/toaster.js';\n"],"names":["isKantoElement","tag","KANTO_TAG_PREFIX","kanto"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFO,SAASA,EAAeC,GAAsB;AACnD,SAAOA,EAAI,WAAW,KAAK;AAC7B;AAGO,MAAMC,IAAmB,OAiEnBC,IAAgB;AAAA,EAC3B,UAAU;AAAA,EAEV;AACF;"}