kanto-ds 1.3.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.
- package/README.md +3 -3
- package/dist/chunks/{defaults-DKzFsNbv.js → defaults-BwgjMcww.js} +27 -26
- package/dist/chunks/{defaults-DKzFsNbv.js.map → defaults-BwgjMcww.js.map} +1 -1
- package/dist/chunks/{index-fzPIgxe2.js → index-DSSLJirw.js} +17 -12
- package/dist/chunks/index-DSSLJirw.js.map +1 -0
- package/dist/chunks/{kt-element-mdd5cXZX.js → kt-element-E-tfJpGQ.js} +2 -2
- package/dist/chunks/{kt-element-mdd5cXZX.js.map → kt-element-E-tfJpGQ.js.map} +1 -1
- package/dist/components/core/kt-avatar/kt-avatar.js +2 -2
- package/dist/components/core/kt-badge/kt-badge.js +2 -2
- package/dist/components/core/kt-button/kt-button.js +1 -1
- package/dist/components/core/kt-card/kt-card.js +1 -1
- package/dist/components/core/kt-code/kt-code.js +2 -2
- package/dist/components/core/kt-icon/kt-icon.js +2 -2
- package/dist/components/core/kt-kbd/kt-kbd.js +1 -1
- package/dist/components/core/kt-split-button/kt-split-button.js +2 -2
- package/dist/components/data/kt-chart/kt-chart.js +51 -51
- package/dist/components/data/kt-chart/kt-chart.js.map +1 -1
- package/dist/components/data/kt-meter/kt-meter.js +1 -1
- package/dist/components/data/kt-pagination/kt-pagination.js +2 -2
- package/dist/components/data/kt-stat/kt-stat.js +1 -1
- package/dist/components/data/kt-table/kt-table.js +2 -2
- package/dist/components/data/kt-timeline/kt-timeline.js +1 -1
- package/dist/components/feedback/kt-alert/kt-alert.js +2 -2
- package/dist/components/feedback/kt-empty-state/kt-empty-state.js +1 -1
- package/dist/components/feedback/kt-progress-bar/kt-progress-bar.js +1 -1
- package/dist/components/feedback/kt-skeleton/kt-skeleton.js +1 -1
- package/dist/components/feedback/kt-toast/kt-toast.js +2 -2
- package/dist/components/feedback/kt-toast-container/kt-toast-container.js +1 -1
- package/dist/components/feedback/kt-tooltip/kt-tooltip.js +1 -1
- package/dist/components/forms/kt-checkbox/kt-checkbox.d.ts +66 -0
- package/dist/components/forms/kt-checkbox/kt-checkbox.js +198 -0
- package/dist/components/forms/kt-checkbox/kt-checkbox.js.map +1 -0
- package/dist/components/forms/kt-drag-drop/kt-drag-drop.js +2 -2
- package/dist/components/forms/kt-form/kt-form.js +11 -10
- package/dist/components/forms/kt-form/kt-form.js.map +1 -1
- package/dist/components/forms/kt-input/kt-input.js +2 -2
- package/dist/components/forms/kt-input-menu/kt-input-menu.js +2 -2
- package/dist/components/forms/kt-label-input/kt-label-input.js +1 -1
- package/dist/components/forms/kt-radio-group/kt-radio-group.d.ts +103 -0
- package/dist/components/forms/kt-radio-group/kt-radio-group.js +265 -0
- package/dist/components/forms/kt-radio-group/kt-radio-group.js.map +1 -0
- package/dist/components/forms/kt-select/kt-select.js +2 -2
- package/dist/components/forms/kt-textarea/kt-textarea.js +2 -2
- package/dist/components/forms/kt-toggle/kt-toggle.js +1 -1
- package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.js +2 -2
- package/dist/components/navigation/kt-header/kt-header.js +2 -2
- package/dist/components/navigation/kt-page-header/kt-page-header.js +1 -1
- package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js +2 -2
- package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js +2 -2
- package/dist/components/navigation/kt-tabs/kt-tabs.js +1 -1
- package/dist/components/navigation/kt-toggle-button/kt-toggle-button.js +1 -1
- package/dist/components/navigation/kt-toggle-button-group/kt-toggle-button-group.js +12 -6
- package/dist/components/navigation/kt-toggle-button-group/kt-toggle-button-group.js.map +1 -1
- package/dist/components/overlays/kt-collapsible/kt-collapsible.js +1 -1
- package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.js +2 -2
- package/dist/components/overlays/kt-dropdown/kt-dropdown.js +2 -2
- package/dist/components/overlays/kt-modal/kt-modal.js +2 -2
- package/dist/components/overlays/kt-side-panel/kt-side-panel.js +2 -2
- package/dist/custom-elements.json +1740 -941
- package/dist/icons/defaults.d.ts +1 -0
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +95 -90
- package/dist/index.js.map +1 -1
- package/dist/internal/strings.d.ts +10 -0
- package/dist/react/index.d.ts +13 -0
- package/dist/react/index.js +176 -157
- package/dist/react/index.js.map +1 -1
- package/dist/react/jsx.d.ts +12 -1
- package/dist/strings/index.js +1 -1
- package/dist/tokens/base.css +3 -0
- package/dist/vscode.css-custom-data.json +12 -0
- package/dist/vscode.html-custom-data.json +85 -0
- package/dist/vue/index.d.ts +6 -0
- package/dist/vue/index.js +9 -7
- package/dist/vue/index.js.map +1 -1
- package/dist/web-types.json +225 -1
- package/package.json +9 -1
- package/dist/chunks/index-fzPIgxe2.js.map +0 -1
package/dist/tokens/base.css
CHANGED
|
@@ -91,6 +91,7 @@ pre {
|
|
|
91
91
|
kt-button,
|
|
92
92
|
kt-card,
|
|
93
93
|
kt-chart,
|
|
94
|
+
kt-checkbox,
|
|
94
95
|
kt-code,
|
|
95
96
|
kt-collapsible,
|
|
96
97
|
kt-confirm-dialog,
|
|
@@ -109,6 +110,8 @@ pre {
|
|
|
109
110
|
kt-page-header,
|
|
110
111
|
kt-pagination,
|
|
111
112
|
kt-progress-bar,
|
|
113
|
+
kt-radio,
|
|
114
|
+
kt-radio-group,
|
|
112
115
|
kt-segmented-control,
|
|
113
116
|
kt-select,
|
|
114
117
|
kt-side-panel,
|
|
@@ -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.",
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
46
|
+
function L(t) {
|
|
45
47
|
return t.startsWith("kt-");
|
|
46
48
|
}
|
|
47
|
-
const
|
|
49
|
+
const M = "kt-", Q = {
|
|
48
50
|
install() {
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
53
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
package/dist/vue/index.js.map
CHANGED
|
@@ -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":"
|
|
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;"}
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "kanto-ds",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -1648,6 +1648,92 @@
|
|
|
1648
1648
|
"events": []
|
|
1649
1649
|
}
|
|
1650
1650
|
},
|
|
1651
|
+
{
|
|
1652
|
+
"name": "kt-checkbox",
|
|
1653
|
+
"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\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.",
|
|
1654
|
+
"doc-url": "",
|
|
1655
|
+
"attributes": [
|
|
1656
|
+
{
|
|
1657
|
+
"name": "checked",
|
|
1658
|
+
"value": { "type": "boolean", "default": "false" }
|
|
1659
|
+
},
|
|
1660
|
+
{
|
|
1661
|
+
"name": "indeterminate",
|
|
1662
|
+
"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.",
|
|
1663
|
+
"value": { "type": "boolean", "default": "false" }
|
|
1664
|
+
},
|
|
1665
|
+
{
|
|
1666
|
+
"name": "disabled",
|
|
1667
|
+
"value": { "type": "boolean", "default": "false" }
|
|
1668
|
+
},
|
|
1669
|
+
{
|
|
1670
|
+
"name": "required",
|
|
1671
|
+
"value": { "type": "boolean", "default": "false" }
|
|
1672
|
+
},
|
|
1673
|
+
{
|
|
1674
|
+
"name": "size",
|
|
1675
|
+
"value": { "type": "KtCheckboxSize", "default": "'medium'" }
|
|
1676
|
+
},
|
|
1677
|
+
{ "name": "name", "value": { "type": "string", "default": "''" } },
|
|
1678
|
+
{
|
|
1679
|
+
"name": "value",
|
|
1680
|
+
"description": "Submitted when checked, as for a native checkbox.",
|
|
1681
|
+
"value": { "type": "string", "default": "'on'" }
|
|
1682
|
+
},
|
|
1683
|
+
{
|
|
1684
|
+
"name": "label",
|
|
1685
|
+
"description": "Accessible name, when nothing is slotted.",
|
|
1686
|
+
"value": { "type": "string", "default": "''" }
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
"name": "error",
|
|
1690
|
+
"description": "Error message. A non-empty value puts the box in its error state.",
|
|
1691
|
+
"value": { "type": "string", "default": "''" }
|
|
1692
|
+
}
|
|
1693
|
+
],
|
|
1694
|
+
"slots": [{ "name": "", "description": "The label, clickable." }],
|
|
1695
|
+
"events": [
|
|
1696
|
+
{
|
|
1697
|
+
"name": "kt-change",
|
|
1698
|
+
"description": "The box was checked or unchecked. `detail: { checked }`."
|
|
1699
|
+
}
|
|
1700
|
+
],
|
|
1701
|
+
"js": {
|
|
1702
|
+
"properties": [
|
|
1703
|
+
{ "name": "checked", "type": "boolean" },
|
|
1704
|
+
{
|
|
1705
|
+
"name": "indeterminate",
|
|
1706
|
+
"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.",
|
|
1707
|
+
"type": "boolean"
|
|
1708
|
+
},
|
|
1709
|
+
{ "name": "disabled", "type": "boolean" },
|
|
1710
|
+
{ "name": "required", "type": "boolean" },
|
|
1711
|
+
{ "name": "size", "type": "KtCheckboxSize" },
|
|
1712
|
+
{ "name": "name", "type": "string" },
|
|
1713
|
+
{
|
|
1714
|
+
"name": "value",
|
|
1715
|
+
"description": "Submitted when checked, as for a native checkbox.",
|
|
1716
|
+
"type": "string"
|
|
1717
|
+
},
|
|
1718
|
+
{
|
|
1719
|
+
"name": "label",
|
|
1720
|
+
"description": "Accessible name, when nothing is slotted.",
|
|
1721
|
+
"type": "string"
|
|
1722
|
+
},
|
|
1723
|
+
{
|
|
1724
|
+
"name": "error",
|
|
1725
|
+
"description": "Error message. A non-empty value puts the box in its error state.",
|
|
1726
|
+
"type": "string"
|
|
1727
|
+
}
|
|
1728
|
+
],
|
|
1729
|
+
"events": [
|
|
1730
|
+
{
|
|
1731
|
+
"name": "kt-change",
|
|
1732
|
+
"description": "The box was checked or unchecked. `detail: { checked }`."
|
|
1733
|
+
}
|
|
1734
|
+
]
|
|
1735
|
+
}
|
|
1736
|
+
},
|
|
1651
1737
|
{
|
|
1652
1738
|
"name": "kt-drag-drop",
|
|
1653
1739
|
"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\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.",
|
|
@@ -2081,6 +2167,144 @@
|
|
|
2081
2167
|
"events": []
|
|
2082
2168
|
}
|
|
2083
2169
|
},
|
|
2170
|
+
{
|
|
2171
|
+
"name": "kt-radio",
|
|
2172
|
+
"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\n### **Slots:**\n - _default_ - The label.\n\n### **CSS Parts:**\n - **base** - The `role=\"radio\"` row.\n- **circle** - The drawn circle.",
|
|
2173
|
+
"doc-url": "",
|
|
2174
|
+
"attributes": [
|
|
2175
|
+
{
|
|
2176
|
+
"name": "value",
|
|
2177
|
+
"description": "Submitted by the group when this option is chosen.",
|
|
2178
|
+
"value": { "type": "string", "default": "''" }
|
|
2179
|
+
},
|
|
2180
|
+
{
|
|
2181
|
+
"name": "disabled",
|
|
2182
|
+
"value": { "type": "boolean", "default": "false" }
|
|
2183
|
+
},
|
|
2184
|
+
{
|
|
2185
|
+
"name": "checked",
|
|
2186
|
+
"description": "Set by the group.",
|
|
2187
|
+
"value": { "type": "boolean", "default": "false" }
|
|
2188
|
+
},
|
|
2189
|
+
{
|
|
2190
|
+
"name": "invalid",
|
|
2191
|
+
"description": "Set by the group while it reports an error.",
|
|
2192
|
+
"value": { "type": "boolean", "default": "false" }
|
|
2193
|
+
},
|
|
2194
|
+
{
|
|
2195
|
+
"name": "group-disabled",
|
|
2196
|
+
"description": "Set by the group while the whole group is disabled.",
|
|
2197
|
+
"value": { "type": "boolean", "default": "false" }
|
|
2198
|
+
}
|
|
2199
|
+
],
|
|
2200
|
+
"slots": [{ "name": "", "description": "The label." }],
|
|
2201
|
+
"events": [],
|
|
2202
|
+
"js": {
|
|
2203
|
+
"properties": [
|
|
2204
|
+
{
|
|
2205
|
+
"name": "value",
|
|
2206
|
+
"description": "Submitted by the group when this option is chosen.",
|
|
2207
|
+
"type": "string"
|
|
2208
|
+
},
|
|
2209
|
+
{ "name": "disabled", "type": "boolean" },
|
|
2210
|
+
{
|
|
2211
|
+
"name": "checked",
|
|
2212
|
+
"description": "Set by the group.",
|
|
2213
|
+
"type": "boolean"
|
|
2214
|
+
},
|
|
2215
|
+
{
|
|
2216
|
+
"name": "tabbable",
|
|
2217
|
+
"description": "Set by the group: whether this option holds the group's one tab stop.",
|
|
2218
|
+
"type": "boolean"
|
|
2219
|
+
},
|
|
2220
|
+
{
|
|
2221
|
+
"name": "invalid",
|
|
2222
|
+
"description": "Set by the group while it reports an error.",
|
|
2223
|
+
"type": "boolean"
|
|
2224
|
+
},
|
|
2225
|
+
{
|
|
2226
|
+
"name": "groupDisabled",
|
|
2227
|
+
"description": "Set by the group while the whole group is disabled.",
|
|
2228
|
+
"type": "boolean"
|
|
2229
|
+
}
|
|
2230
|
+
],
|
|
2231
|
+
"events": []
|
|
2232
|
+
}
|
|
2233
|
+
},
|
|
2234
|
+
{
|
|
2235
|
+
"name": "kt-radio-group",
|
|
2236
|
+
"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\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.",
|
|
2237
|
+
"doc-url": "",
|
|
2238
|
+
"attributes": [
|
|
2239
|
+
{
|
|
2240
|
+
"name": "value",
|
|
2241
|
+
"description": "The chosen option's value, or `null`.",
|
|
2242
|
+
"value": { "type": "string | null", "default": "null" }
|
|
2243
|
+
},
|
|
2244
|
+
{ "name": "name", "value": { "type": "string", "default": "''" } },
|
|
2245
|
+
{
|
|
2246
|
+
"name": "label",
|
|
2247
|
+
"description": "Accessible name of the group.",
|
|
2248
|
+
"value": { "type": "string", "default": "''" }
|
|
2249
|
+
},
|
|
2250
|
+
{
|
|
2251
|
+
"name": "disabled",
|
|
2252
|
+
"value": { "type": "boolean", "default": "false" }
|
|
2253
|
+
},
|
|
2254
|
+
{
|
|
2255
|
+
"name": "required",
|
|
2256
|
+
"value": { "type": "boolean", "default": "false" }
|
|
2257
|
+
},
|
|
2258
|
+
{
|
|
2259
|
+
"name": "orientation",
|
|
2260
|
+
"value": {
|
|
2261
|
+
"type": "KtRadioGroupOrientation",
|
|
2262
|
+
"default": "'vertical'"
|
|
2263
|
+
}
|
|
2264
|
+
},
|
|
2265
|
+
{
|
|
2266
|
+
"name": "error",
|
|
2267
|
+
"description": "Error message. A non-empty value puts the group in its error state.",
|
|
2268
|
+
"value": { "type": "string", "default": "''" }
|
|
2269
|
+
}
|
|
2270
|
+
],
|
|
2271
|
+
"slots": [{ "name": "", "description": "The `<kt-radio>` options." }],
|
|
2272
|
+
"events": [
|
|
2273
|
+
{
|
|
2274
|
+
"name": "kt-change",
|
|
2275
|
+
"description": "An option was chosen. `detail: { value }`."
|
|
2276
|
+
}
|
|
2277
|
+
],
|
|
2278
|
+
"js": {
|
|
2279
|
+
"properties": [
|
|
2280
|
+
{
|
|
2281
|
+
"name": "value",
|
|
2282
|
+
"description": "The chosen option's value, or `null`.",
|
|
2283
|
+
"type": "string | null"
|
|
2284
|
+
},
|
|
2285
|
+
{ "name": "name", "type": "string" },
|
|
2286
|
+
{
|
|
2287
|
+
"name": "label",
|
|
2288
|
+
"description": "Accessible name of the group.",
|
|
2289
|
+
"type": "string"
|
|
2290
|
+
},
|
|
2291
|
+
{ "name": "disabled", "type": "boolean" },
|
|
2292
|
+
{ "name": "required", "type": "boolean" },
|
|
2293
|
+
{ "name": "orientation", "type": "KtRadioGroupOrientation" },
|
|
2294
|
+
{
|
|
2295
|
+
"name": "error",
|
|
2296
|
+
"description": "Error message. A non-empty value puts the group in its error state.",
|
|
2297
|
+
"type": "string"
|
|
2298
|
+
}
|
|
2299
|
+
],
|
|
2300
|
+
"events": [
|
|
2301
|
+
{
|
|
2302
|
+
"name": "kt-change",
|
|
2303
|
+
"description": "An option was chosen. `detail: { value }`."
|
|
2304
|
+
}
|
|
2305
|
+
]
|
|
2306
|
+
}
|
|
2307
|
+
},
|
|
2084
2308
|
{
|
|
2085
2309
|
"name": "kt-select",
|
|
2086
2310
|
"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\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.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kanto-ds",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Framework-agnostic design system for data-dense product interfaces.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
|
@@ -153,6 +153,10 @@
|
|
|
153
153
|
"types": "./dist/components/feedback/kt-tooltip/kt-tooltip.d.ts",
|
|
154
154
|
"default": "./dist/components/feedback/kt-tooltip/kt-tooltip.js"
|
|
155
155
|
},
|
|
156
|
+
"./components/forms/kt-checkbox": {
|
|
157
|
+
"types": "./dist/components/forms/kt-checkbox/kt-checkbox.d.ts",
|
|
158
|
+
"default": "./dist/components/forms/kt-checkbox/kt-checkbox.js"
|
|
159
|
+
},
|
|
156
160
|
"./components/forms/kt-drag-drop": {
|
|
157
161
|
"types": "./dist/components/forms/kt-drag-drop/kt-drag-drop.d.ts",
|
|
158
162
|
"default": "./dist/components/forms/kt-drag-drop/kt-drag-drop.js"
|
|
@@ -173,6 +177,10 @@
|
|
|
173
177
|
"types": "./dist/components/forms/kt-label-input/kt-label-input.d.ts",
|
|
174
178
|
"default": "./dist/components/forms/kt-label-input/kt-label-input.js"
|
|
175
179
|
},
|
|
180
|
+
"./components/forms/kt-radio-group": {
|
|
181
|
+
"types": "./dist/components/forms/kt-radio-group/kt-radio-group.d.ts",
|
|
182
|
+
"default": "./dist/components/forms/kt-radio-group/kt-radio-group.js"
|
|
183
|
+
},
|
|
176
184
|
"./components/forms/kt-select": {
|
|
177
185
|
"types": "./dist/components/forms/kt-select/kt-select.d.ts",
|
|
178
186
|
"default": "./dist/components/forms/kt-select/kt-select.js"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-fzPIgxe2.js","sources":["../../src/internal/strings.ts"],"sourcesContent":["/**\n * Every piece of copy the elements write themselves — empty states, button\n * labels, validation messages, and the accessible names a screen reader\n * announces but nobody sees.\n *\n * English by default. An application in another language replaces them once,\n * at start-up, and every element follows:\n *\n * import { setStrings } from 'kanto-ds/strings';\n *\n * setStrings({\n * clear: 'Effacer',\n * pageOf: (page, total) => `Page ${page} sur ${total}`,\n * });\n *\n * Anything left out keeps its English default. A string an element also takes\n * as a property — `emptyText`, `placeholder`, `confirmLabel` — still wins when\n * it is set, so one screen can say something different from the rest.\n *\n * Copy that carries a value is a function, not a template with placeholders:\n * the translation owns the word order, and \"Remove {name}\" does not survive\n * languages that put the object first.\n */\n\nexport interface KtStrings {\n // --- Shared actions ---\n /** Clear button in fields. */\n clear: string;\n /** Close button on toasts, alerts' dismiss button. */\n close: string;\n dismiss: string;\n /** Copy button on `kt-code`, and its state once copied. */\n copy: string;\n copied: string;\n copyCode: string;\n /** The countdown bar on a toast that closes itself. */\n timeRemaining: string;\n /** Remove button on a badge or a dropped file. */\n remove: (name: string) => string;\n\n // --- Empty and loading states ---\n noOptions: string;\n noResults: string;\n noActions: string;\n noData: string;\n loading: string;\n\n // --- Fields ---\n /** `kt-select` with nothing chosen. */\n select: string;\n openList: string;\n closeList: string;\n showPassword: string;\n hidePassword: string;\n searchCountry: string;\n noCountry: string;\n countryCode: (country: string | undefined) => string;\n dragAndDrop: string;\n browseFiles: string;\n recommendedSize: (size: string) => string;\n selectedFiles: string;\n\n // --- Validation messages, shown by the browser on submit ---\n required: string;\n selectOption: string;\n selectFile: string;\n\n // --- Navigation ---\n openMenu: string;\n closeMenu: string;\n breadcrumb: string;\n secondaryNavigation: string;\n pagination: string;\n previous: string;\n next: string;\n pageOf: (page: number, total: number) => string;\n moreActions: string;\n\n // --- Data ---\n selectRow: string;\n selectAll: string;\n total: string;\n /** Column headers of the data table every chart renders for assistive tech. */\n chartSeries: string;\n chartPoint: string;\n chartSlice: string;\n chartShare: string;\n\n // --- Overlays ---\n confirmHeading: string;\n confirm: string;\n cancel: string;\n details: string;\n\n // --- Identity ---\n avatar: string;\n}\n\nexport const defaultStrings: Readonly<KtStrings> = Object.freeze({\n clear: 'Clear',\n close: 'Close',\n dismiss: 'Dismiss',\n copy: 'Copy',\n copied: 'Copied',\n copyCode: 'Copy code',\n timeRemaining: 'Time remaining',\n remove: (name: string) => (name ? `Remove ${name}` : 'Remove'),\n\n noOptions: 'No options available',\n noResults: 'No results',\n noActions: 'No actions',\n noData: 'No data to display',\n loading: 'Loading…',\n\n select: 'Select',\n openList: 'Open list',\n closeList: 'Close list',\n showPassword: 'Show password',\n hidePassword: 'Hide password',\n searchCountry: 'Search country or dial code',\n noCountry: 'No country found',\n countryCode: (country: string | undefined) => `Country code: ${country ?? 'none'}`,\n dragAndDrop: 'Drag and drop or',\n browseFiles: 'browse your files',\n recommendedSize: (size: string) => `Recommended image size: ${size}`,\n selectedFiles: 'Selected files',\n\n required: 'This field is required.',\n selectOption: 'Select an option.',\n selectFile: 'Select a file.',\n\n openMenu: 'Open menu',\n closeMenu: 'Close menu',\n breadcrumb: 'Breadcrumb',\n secondaryNavigation: 'Secondary navigation',\n pagination: 'Pagination',\n previous: 'Previous',\n next: 'Next',\n pageOf: (page: number, total: number) => `Page ${page} / ${total}`,\n moreActions: 'More actions',\n\n selectRow: 'Select row',\n selectAll: 'Select all',\n total: 'Total',\n chartSeries: 'Series',\n chartPoint: 'Point',\n chartSlice: 'Slice',\n chartShare: 'Share',\n\n confirmHeading: 'Are you sure?',\n confirm: 'Confirm',\n cancel: 'Cancel',\n details: 'Details',\n\n avatar: 'Avatar',\n});\n\nlet current: KtStrings = { ...defaultStrings };\nconst listeners = new Set<() => void>();\n\n/** The strings in effect. Elements read them at render time. */\nexport function strings(): Readonly<KtStrings> {\n return current;\n}\n\n/**\n * Replaces some or all of the strings, and re-renders every connected element\n * so the change shows at once — switching language at runtime works.\n */\nexport function setStrings(overrides: Partial<KtStrings>): void {\n current = { ...current, ...overrides };\n for (const listener of listeners) listener();\n}\n\n/** Back to the English defaults. */\nexport function resetStrings(): void {\n setStrings(defaultStrings);\n}\n\n/** Calls `listener` after every `setStrings`. Returns the unsubscribe function. */\nexport function onStringsChange(listener: () => void): () => void {\n listeners.add(listener);\n return () => listeners.delete(listener);\n}\n"],"names":["defaultStrings","name","country","size","page","total","current","listeners","strings","setStrings","overrides","listener","resetStrings","onStringsChange"],"mappings":"AAkGO,MAAMA,IAAsC,OAAO,OAAO;AAAA,EAC/D,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,eAAe;AAAA,EACf,QAAQ,CAACC,MAAkBA,IAAO,UAAUA,CAAI,KAAK;AAAA,EAErD,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EAET,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,WAAW;AAAA,EACX,cAAc;AAAA,EACd,cAAc;AAAA,EACd,eAAe;AAAA,EACf,WAAW;AAAA,EACX,aAAa,CAACC,MAAgC,iBAAiBA,KAAW,MAAM;AAAA,EAChF,aAAa;AAAA,EACb,aAAa;AAAA,EACb,iBAAiB,CAACC,MAAiB,2BAA2BA,CAAI;AAAA,EAClE,eAAe;AAAA,EAEf,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AAAA,EAEZ,UAAU;AAAA,EACV,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,MAAM;AAAA,EACN,QAAQ,CAACC,GAAcC,MAAkB,QAAQD,CAAI,MAAMC,CAAK;AAAA,EAChE,aAAa;AAAA,EAEb,WAAW;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EAEZ,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EAET,QAAQ;AACV,CAAC;AAED,IAAIC,IAAqB,EAAE,GAAGN,EAAA;AAC9B,MAAMO,wBAAgB,IAAA;AAGf,SAASC,IAA+B;AAC7C,SAAOF;AACT;AAMO,SAASG,EAAWC,GAAqC;AAC9D,EAAAJ,IAAU,EAAE,GAAGA,GAAS,GAAGI,EAAA;AAC3B,aAAWC,KAAYJ,EAAW,CAAAI,EAAA;AACpC;AAGO,SAASC,IAAqB;AACnC,EAAAH,EAAWT,CAAc;AAC3B;AAGO,SAASa,EAAgBF,GAAkC;AAChE,SAAAJ,EAAU,IAAII,CAAQ,GACf,MAAMJ,EAAU,OAAOI,CAAQ;AACxC;"}
|