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.
- package/README.md +24 -6
- 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-DSSLJirw.js +79 -0
- package/dist/chunks/index-DSSLJirw.js.map +1 -0
- package/dist/chunks/kt-element-E-tfJpGQ.js +52 -0
- package/dist/chunks/kt-element-E-tfJpGQ.js.map +1 -0
- package/dist/components/core/kt-avatar/kt-avatar.js +8 -7
- package/dist/components/core/kt-avatar/kt-avatar.js.map +1 -1
- package/dist/components/core/kt-badge/kt-badge.js +7 -6
- package/dist/components/core/kt-badge/kt-badge.js.map +1 -1
- 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 +31 -30
- package/dist/components/core/kt-code/kt-code.js.map +1 -1
- 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.d.ts +2 -2
- package/dist/components/core/kt-split-button/kt-split-button.js +27 -26
- package/dist/components/core/kt-split-button/kt-split-button.js.map +1 -1
- package/dist/components/data/kt-chart/kt-chart.d.ts +2 -2
- package/dist/components/data/kt-chart/kt-chart.js +222 -221
- 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.d.ts +1 -1
- package/dist/components/data/kt-pagination/kt-pagination.js +29 -28
- package/dist/components/data/kt-pagination/kt-pagination.js.map +1 -1
- package/dist/components/data/kt-stat/kt-stat.js +1 -1
- package/dist/components/data/kt-table/kt-table.d.ts +2 -2
- package/dist/components/data/kt-table/kt-table.js +30 -29
- package/dist/components/data/kt-table/kt-table.js.map +1 -1
- package/dist/components/data/kt-timeline/kt-timeline.js +1 -1
- package/dist/components/feedback/kt-alert/kt-alert.js +17 -16
- package/dist/components/feedback/kt-alert/kt-alert.js.map +1 -1
- 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 +25 -19
- package/dist/components/feedback/kt-toast/kt-toast.js.map +1 -1
- 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.d.ts +2 -2
- package/dist/components/forms/kt-drag-drop/kt-drag-drop.js +60 -57
- package/dist/components/forms/kt-drag-drop/kt-drag-drop.js.map +1 -1
- 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 +56 -55
- package/dist/components/forms/kt-input/kt-input.js.map +1 -1
- package/dist/components/forms/kt-input-menu/kt-input-menu.d.ts +1 -1
- package/dist/components/forms/kt-input-menu/kt-input-menu.js +57 -56
- package/dist/components/forms/kt-input-menu/kt-input-menu.js.map +1 -1
- 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.d.ts +2 -2
- package/dist/components/forms/kt-select/kt-select.js +62 -61
- package/dist/components/forms/kt-select/kt-select.js.map +1 -1
- package/dist/components/forms/kt-textarea/kt-textarea.js +9 -8
- package/dist/components/forms/kt-textarea/kt-textarea.js.map +1 -1
- package/dist/components/forms/kt-toggle/kt-toggle.js +1 -1
- package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.d.ts +1 -1
- package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.js +6 -5
- package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.js.map +1 -1
- package/dist/components/navigation/kt-header/kt-header.js +11 -10
- package/dist/components/navigation/kt-header/kt-header.js.map +1 -1
- package/dist/components/navigation/kt-page-header/kt-page-header.js +1 -1
- package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js +44 -43
- package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js.map +1 -1
- package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.d.ts +1 -1
- package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js +6 -5
- package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js.map +1 -1
- 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.d.ts +3 -3
- package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.js +30 -27
- package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.js.map +1 -1
- package/dist/components/overlays/kt-dropdown/kt-dropdown.d.ts +1 -1
- package/dist/components/overlays/kt-dropdown/kt-dropdown.js +8 -7
- package/dist/components/overlays/kt-dropdown/kt-dropdown.js.map +1 -1
- package/dist/components/overlays/kt-modal/kt-modal.js +5 -4
- package/dist/components/overlays/kt-modal/kt-modal.js.map +1 -1
- package/dist/components/overlays/kt-side-panel/kt-side-panel.d.ts +1 -1
- package/dist/components/overlays/kt-side-panel/kt-side-panel.js +24 -23
- package/dist/components/overlays/kt-side-panel/kt-side-panel.js.map +1 -1
- package/dist/custom-elements.json +1870 -1071
- package/dist/icons/defaults.d.ts +1 -0
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +93 -83
- package/dist/index.js.map +1 -1
- package/dist/internal/kt-element.d.ts +6 -1
- package/dist/internal/strings.d.ts +103 -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.d.ts +11 -0
- package/dist/strings/index.js +8 -0
- package/dist/strings/index.js.map +1 -0
- package/dist/tokens/base.css +56 -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 +263 -39
- package/package.json +19 -3
- package/dist/chunks/kt-element-B_jjQDhg.js +0 -38
- package/dist/chunks/kt-element-B_jjQDhg.js.map +0 -1
package/dist/icons/defaults.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const defaultIcons: {
|
|
|
17
17
|
Info: import("lucide").IconNode;
|
|
18
18
|
LoaderCircle: import("lucide").IconNode;
|
|
19
19
|
Menu: import("lucide").IconNode;
|
|
20
|
+
Minus: import("lucide").IconNode;
|
|
20
21
|
Search: import("lucide").IconNode;
|
|
21
22
|
Trash2: import("lucide").IconNode;
|
|
22
23
|
TriangleAlert: import("lucide").IconNode;
|
package/dist/icons/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -19,12 +19,16 @@ export type { KtCardImagePosition } from './components/core/kt-card/kt-card.js';
|
|
|
19
19
|
export { KtCode } from './components/core/kt-code/kt-code.js';
|
|
20
20
|
export { KtIcon } from './components/core/kt-icon/kt-icon.js';
|
|
21
21
|
export { KtKbd } from './components/core/kt-kbd/kt-kbd.js';
|
|
22
|
+
export { KtCheckbox } from './components/forms/kt-checkbox/kt-checkbox.js';
|
|
23
|
+
export type { KtCheckboxSize } from './components/forms/kt-checkbox/kt-checkbox.js';
|
|
22
24
|
export { KtDragDrop } from './components/forms/kt-drag-drop/kt-drag-drop.js';
|
|
23
25
|
export { KtForm } from './components/forms/kt-form/kt-form.js';
|
|
24
26
|
export { KtInput } from './components/forms/kt-input/kt-input.js';
|
|
25
27
|
export type { KtInputSize } from './components/forms/kt-input/kt-input.js';
|
|
26
28
|
export { KtInputMenu } from './components/forms/kt-input-menu/kt-input-menu.js';
|
|
27
29
|
export { KtLabelInput } from './components/forms/kt-label-input/kt-label-input.js';
|
|
30
|
+
export { KtRadio, KtRadioGroup } from './components/forms/kt-radio-group/kt-radio-group.js';
|
|
31
|
+
export type { KtRadioGroupOrientation } from './components/forms/kt-radio-group/kt-radio-group.js';
|
|
28
32
|
export { KtSelect } from './components/forms/kt-select/kt-select.js';
|
|
29
33
|
export type { KtSelectSize } from './components/forms/kt-select/kt-select.js';
|
|
30
34
|
export { KtTextarea } from './components/forms/kt-textarea/kt-textarea.js';
|
|
@@ -80,4 +84,5 @@ export type { KtOption } from './internal/listbox.js';
|
|
|
80
84
|
export type { KtCountry } from './internal/countries.js';
|
|
81
85
|
export { getIcon, registerIcon, registerIcons, registeredIcons } from './icons/registry.js';
|
|
82
86
|
export type { IconNode } from './icons/registry.js';
|
|
87
|
+
export { defaultStrings, resetStrings, setStrings, strings as getStrings, type KtStrings, } from './internal/strings.js';
|
|
83
88
|
export { KtElement, defineElement } from './internal/kt-element.js';
|
package/dist/index.js
CHANGED
|
@@ -1,98 +1,108 @@
|
|
|
1
1
|
import { KtAvatar as r } from "./components/core/kt-avatar/kt-avatar.js";
|
|
2
|
-
import { KtBadge as
|
|
2
|
+
import { KtBadge as p } from "./components/core/kt-badge/kt-badge.js";
|
|
3
3
|
import { KtButton as f } from "./components/core/kt-button/kt-button.js";
|
|
4
4
|
import { KtSplitButton as K } from "./components/core/kt-split-button/kt-split-button.js";
|
|
5
5
|
import { KtCard as n } from "./components/core/kt-card/kt-card.js";
|
|
6
|
-
import { KtCode as
|
|
7
|
-
import { KtIcon as
|
|
6
|
+
import { KtCode as i } from "./components/core/kt-code/kt-code.js";
|
|
7
|
+
import { KtIcon as l } from "./components/core/kt-icon/kt-icon.js";
|
|
8
8
|
import { KtKbd as u } from "./components/core/kt-kbd/kt-kbd.js";
|
|
9
|
+
import { KtCheckbox as T } from "./components/forms/kt-checkbox/kt-checkbox.js";
|
|
9
10
|
import { KtDragDrop as I } from "./components/forms/kt-drag-drop/kt-drag-drop.js";
|
|
10
|
-
import { KtForm as
|
|
11
|
-
import { KtInput as
|
|
12
|
-
import { KtInputMenu as
|
|
13
|
-
import { KtLabelInput as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
11
|
+
import { KtForm as C } from "./components/forms/kt-form/kt-form.js";
|
|
12
|
+
import { KtInput as D } from "./components/forms/kt-input/kt-input.js";
|
|
13
|
+
import { KtInputMenu as P } from "./components/forms/kt-input-menu/kt-input-menu.js";
|
|
14
|
+
import { KtLabelInput as h } from "./components/forms/kt-label-input/kt-label-input.js";
|
|
15
|
+
import { KtRadio as v, KtRadioGroup as A } from "./components/forms/kt-radio-group/kt-radio-group.js";
|
|
16
|
+
import { KtSelect as H } from "./components/forms/kt-select/kt-select.js";
|
|
17
|
+
import { KtTextarea as w } from "./components/forms/kt-textarea/kt-textarea.js";
|
|
18
|
+
import { KtToggle as F } from "./components/forms/kt-toggle/kt-toggle.js";
|
|
19
|
+
import { KtBreadcrumb as N } from "./components/navigation/kt-breadcrumb/kt-breadcrumb.js";
|
|
20
|
+
import { KtPageHeader as q } from "./components/navigation/kt-page-header/kt-page-header.js";
|
|
21
|
+
import { KtSegmentedControl as J } from "./components/navigation/kt-segmented-control/kt-segmented-control.js";
|
|
22
|
+
import { KtSubMenuNavigation as Q } from "./components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js";
|
|
23
|
+
import { KtTabs as V } from "./components/navigation/kt-tabs/kt-tabs.js";
|
|
24
|
+
import { KtHeader as X } from "./components/navigation/kt-header/kt-header.js";
|
|
25
|
+
import { KtToggleButton as Z } from "./components/navigation/kt-toggle-button/kt-toggle-button.js";
|
|
26
|
+
import { KtToggleButtonGroup as $ } from "./components/navigation/kt-toggle-button-group/kt-toggle-button-group.js";
|
|
27
|
+
import { KtAlert as ot } from "./components/feedback/kt-alert/kt-alert.js";
|
|
28
|
+
import { KtEmptyState as et } from "./components/feedback/kt-empty-state/kt-empty-state.js";
|
|
29
|
+
import { KtProgressBar as mt } from "./components/feedback/kt-progress-bar/kt-progress-bar.js";
|
|
30
|
+
import { KtSkeleton as xt } from "./components/feedback/kt-skeleton/kt-skeleton.js";
|
|
31
|
+
import { KtToast as at } from "./components/feedback/kt-toast/kt-toast.js";
|
|
32
|
+
import { KtToastContainer as st } from "./components/feedback/kt-toast-container/kt-toast-container.js";
|
|
33
|
+
import { t as gt } from "./chunks/toaster-PmdKSV5x.js";
|
|
34
|
+
import { KtTooltip as dt } from "./components/feedback/kt-tooltip/kt-tooltip.js";
|
|
35
|
+
import { KtCollapsible as St } from "./components/overlays/kt-collapsible/kt-collapsible.js";
|
|
36
|
+
import { KtConfirmDialog as bt } from "./components/overlays/kt-confirm-dialog/kt-confirm-dialog.js";
|
|
37
|
+
import { KtDropdown as ct } from "./components/overlays/kt-dropdown/kt-dropdown.js";
|
|
38
|
+
import { KtModal as Bt } from "./components/overlays/kt-modal/kt-modal.js";
|
|
39
|
+
import { KtSidePanel as Mt } from "./components/overlays/kt-side-panel/kt-side-panel.js";
|
|
40
|
+
import { KtChart as Et } from "./components/data/kt-chart/kt-chart.js";
|
|
41
|
+
import { KtMeter as kt } from "./components/data/kt-meter/kt-meter.js";
|
|
42
|
+
import { KtPagination as At } from "./components/data/kt-pagination/kt-pagination.js";
|
|
43
|
+
import { KtStat as Ht } from "./components/data/kt-stat/kt-stat.js";
|
|
44
|
+
import { KtTable as wt } from "./components/data/kt-table/kt-table.js";
|
|
45
|
+
import { KtTimeline as Ft, KtTimelineItem as Lt } from "./components/data/kt-timeline/kt-timeline.js";
|
|
46
|
+
import { g as jt, r as qt, a as zt, b as Jt } from "./chunks/defaults-BwgjMcww.js";
|
|
47
|
+
import { d as Qt, s as Ut, r as Vt, a as Wt } from "./chunks/index-DSSLJirw.js";
|
|
48
|
+
import { K as Yt, d as Zt } from "./chunks/kt-element-E-tfJpGQ.js";
|
|
46
49
|
export {
|
|
47
|
-
|
|
50
|
+
ot as KtAlert,
|
|
48
51
|
r as KtAvatar,
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
p as KtBadge,
|
|
53
|
+
N as KtBreadcrumb,
|
|
51
54
|
f as KtButton,
|
|
52
55
|
n as KtCard,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
Et as KtChart,
|
|
57
|
+
T as KtCheckbox,
|
|
58
|
+
i as KtCode,
|
|
59
|
+
St as KtCollapsible,
|
|
60
|
+
bt as KtConfirmDialog,
|
|
57
61
|
I as KtDragDrop,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
ct as KtDropdown,
|
|
63
|
+
Yt as KtElement,
|
|
64
|
+
et as KtEmptyState,
|
|
65
|
+
C as KtForm,
|
|
66
|
+
X as KtHeader,
|
|
67
|
+
l as KtIcon,
|
|
68
|
+
D as KtInput,
|
|
69
|
+
P as KtInputMenu,
|
|
66
70
|
u as KtKbd,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
h as KtLabelInput,
|
|
72
|
+
kt as KtMeter,
|
|
73
|
+
Bt as KtModal,
|
|
74
|
+
q as KtPageHeader,
|
|
75
|
+
At as KtPagination,
|
|
76
|
+
mt as KtProgressBar,
|
|
77
|
+
v as KtRadio,
|
|
78
|
+
A as KtRadioGroup,
|
|
79
|
+
J as KtSegmentedControl,
|
|
80
|
+
H as KtSelect,
|
|
81
|
+
Mt as KtSidePanel,
|
|
82
|
+
xt as KtSkeleton,
|
|
77
83
|
K as KtSplitButton,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
Ht as KtStat,
|
|
85
|
+
Q as KtSubMenuNavigation,
|
|
86
|
+
wt as KtTable,
|
|
87
|
+
V as KtTabs,
|
|
88
|
+
w as KtTextarea,
|
|
89
|
+
Ft as KtTimeline,
|
|
90
|
+
Lt as KtTimelineItem,
|
|
91
|
+
at as KtToast,
|
|
92
|
+
st as KtToastContainer,
|
|
93
|
+
F as KtToggle,
|
|
94
|
+
Z as KtToggleButton,
|
|
95
|
+
$ as KtToggleButtonGroup,
|
|
96
|
+
dt as KtTooltip,
|
|
97
|
+
Qt as defaultStrings,
|
|
98
|
+
Zt as defineElement,
|
|
99
|
+
jt as getIcon,
|
|
100
|
+
Ut as getStrings,
|
|
101
|
+
qt as registerIcon,
|
|
102
|
+
zt as registerIcons,
|
|
103
|
+
Jt as registeredIcons,
|
|
104
|
+
Vt as resetStrings,
|
|
105
|
+
Wt as setStrings,
|
|
106
|
+
gt as toaster
|
|
97
107
|
};
|
|
98
108
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement, type CSSResultGroup } from 'lit';
|
|
1
|
+
import { LitElement, type CSSResultGroup, type PropertyValues } from 'lit';
|
|
2
2
|
/**
|
|
3
3
|
* Base class for every Kanto element.
|
|
4
4
|
*
|
|
@@ -10,6 +10,11 @@ import { LitElement, type CSSResultGroup } from 'lit';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class KtElement extends LitElement {
|
|
12
12
|
static styles: CSSResultGroup;
|
|
13
|
+
private unsubscribeStrings;
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
disconnectedCallback(): void;
|
|
16
|
+
/** True when this update was triggered by `setStrings`. */
|
|
17
|
+
protected stringsChanged(changed: PropertyValues): boolean;
|
|
13
18
|
}
|
|
14
19
|
/**
|
|
15
20
|
* Registers a custom element, tolerating a repeat call.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every piece of copy the elements write themselves — empty states, button
|
|
3
|
+
* labels, validation messages, and the accessible names a screen reader
|
|
4
|
+
* announces but nobody sees.
|
|
5
|
+
*
|
|
6
|
+
* English by default. An application in another language replaces them once,
|
|
7
|
+
* at start-up, and every element follows:
|
|
8
|
+
*
|
|
9
|
+
* import { setStrings } from 'kanto-ds/strings';
|
|
10
|
+
*
|
|
11
|
+
* setStrings({
|
|
12
|
+
* clear: 'Effacer',
|
|
13
|
+
* pageOf: (page, total) => `Page ${page} sur ${total}`,
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* Anything left out keeps its English default. A string an element also takes
|
|
17
|
+
* as a property — `emptyText`, `placeholder`, `confirmLabel` — still wins when
|
|
18
|
+
* it is set, so one screen can say something different from the rest.
|
|
19
|
+
*
|
|
20
|
+
* Copy that carries a value is a function, not a template with placeholders:
|
|
21
|
+
* the translation owns the word order, and "Remove {name}" does not survive
|
|
22
|
+
* languages that put the object first.
|
|
23
|
+
*/
|
|
24
|
+
export interface KtStrings {
|
|
25
|
+
/** Clear button in fields. */
|
|
26
|
+
clear: string;
|
|
27
|
+
/** Close button on toasts, alerts' dismiss button. */
|
|
28
|
+
close: string;
|
|
29
|
+
dismiss: string;
|
|
30
|
+
/** Copy button on `kt-code`, and its state once copied. */
|
|
31
|
+
copy: string;
|
|
32
|
+
copied: string;
|
|
33
|
+
copyCode: string;
|
|
34
|
+
/** The countdown bar on a toast that closes itself. */
|
|
35
|
+
timeRemaining: string;
|
|
36
|
+
/** Remove button on a badge or a dropped file. */
|
|
37
|
+
remove: (name: string) => string;
|
|
38
|
+
noOptions: string;
|
|
39
|
+
noResults: string;
|
|
40
|
+
noActions: string;
|
|
41
|
+
noData: string;
|
|
42
|
+
loading: string;
|
|
43
|
+
/** `kt-select` with nothing chosen. */
|
|
44
|
+
select: string;
|
|
45
|
+
openList: string;
|
|
46
|
+
closeList: string;
|
|
47
|
+
showPassword: string;
|
|
48
|
+
hidePassword: string;
|
|
49
|
+
searchCountry: string;
|
|
50
|
+
noCountry: string;
|
|
51
|
+
countryCode: (country: string | undefined) => string;
|
|
52
|
+
dragAndDrop: string;
|
|
53
|
+
browseFiles: string;
|
|
54
|
+
recommendedSize: (size: string) => string;
|
|
55
|
+
selectedFiles: string;
|
|
56
|
+
required: string;
|
|
57
|
+
selectOption: string;
|
|
58
|
+
selectFile: string;
|
|
59
|
+
/** A required checkbox left unchecked. */
|
|
60
|
+
checkRequired: string;
|
|
61
|
+
openMenu: string;
|
|
62
|
+
closeMenu: string;
|
|
63
|
+
breadcrumb: string;
|
|
64
|
+
secondaryNavigation: string;
|
|
65
|
+
pagination: string;
|
|
66
|
+
previous: string;
|
|
67
|
+
next: string;
|
|
68
|
+
pageOf: (page: number, total: number) => string;
|
|
69
|
+
moreActions: string;
|
|
70
|
+
/** A button or choice group with no label of its own. */
|
|
71
|
+
options: string;
|
|
72
|
+
/** A `kt-form` section with no heading. */
|
|
73
|
+
formSection: string;
|
|
74
|
+
selectRow: string;
|
|
75
|
+
selectAll: string;
|
|
76
|
+
total: string;
|
|
77
|
+
/** Column headers of the data table every chart renders for assistive tech. */
|
|
78
|
+
chartSeries: string;
|
|
79
|
+
chartPoint: string;
|
|
80
|
+
chartSlice: string;
|
|
81
|
+
chartShare: string;
|
|
82
|
+
/** Caption of a chart's data table when the chart has no label. */
|
|
83
|
+
chartData: string;
|
|
84
|
+
/** Value column of a single-series chart's data table when the series has no name. */
|
|
85
|
+
chartValue: string;
|
|
86
|
+
confirmHeading: string;
|
|
87
|
+
confirm: string;
|
|
88
|
+
cancel: string;
|
|
89
|
+
details: string;
|
|
90
|
+
avatar: string;
|
|
91
|
+
}
|
|
92
|
+
export declare const defaultStrings: Readonly<KtStrings>;
|
|
93
|
+
/** The strings in effect. Elements read them at render time. */
|
|
94
|
+
export declare function strings(): Readonly<KtStrings>;
|
|
95
|
+
/**
|
|
96
|
+
* Replaces some or all of the strings, and re-renders every connected element
|
|
97
|
+
* so the change shows at once — switching language at runtime works.
|
|
98
|
+
*/
|
|
99
|
+
export declare function setStrings(overrides: Partial<KtStrings>): void;
|
|
100
|
+
/** Back to the English defaults. */
|
|
101
|
+
export declare function resetStrings(): void;
|
|
102
|
+
/** Calls `listener` after every `setStrings`. Returns the unsubscribe function. */
|
|
103
|
+
export declare function onStringsChange(listener: () => void): () => void;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -7,11 +7,13 @@ import { KtCard as KtCardElement } from '../components/core/kt-card/kt-card.js';
|
|
|
7
7
|
import { KtCode as KtCodeElement } from '../components/core/kt-code/kt-code.js';
|
|
8
8
|
import { KtIcon as KtIconElement } from '../components/core/kt-icon/kt-icon.js';
|
|
9
9
|
import { KtKbd as KtKbdElement } from '../components/core/kt-kbd/kt-kbd.js';
|
|
10
|
+
import { KtCheckbox as KtCheckboxElement } from '../components/forms/kt-checkbox/kt-checkbox.js';
|
|
10
11
|
import { KtDragDrop as KtDragDropElement } from '../components/forms/kt-drag-drop/kt-drag-drop.js';
|
|
11
12
|
import { KtForm as KtFormElement } from '../components/forms/kt-form/kt-form.js';
|
|
12
13
|
import { KtInput as KtInputElement } from '../components/forms/kt-input/kt-input.js';
|
|
13
14
|
import { KtInputMenu as KtInputMenuElement } from '../components/forms/kt-input-menu/kt-input-menu.js';
|
|
14
15
|
import { KtLabelInput as KtLabelInputElement } from '../components/forms/kt-label-input/kt-label-input.js';
|
|
16
|
+
import { KtRadio as KtRadioElement, KtRadioGroup as KtRadioGroupElement } from '../components/forms/kt-radio-group/kt-radio-group.js';
|
|
15
17
|
import { KtSelect as KtSelectElement } from '../components/forms/kt-select/kt-select.js';
|
|
16
18
|
import { KtTextarea as KtTextareaElement } from '../components/forms/kt-textarea/kt-textarea.js';
|
|
17
19
|
import { KtToggle as KtToggleElement } from '../components/forms/kt-toggle/kt-toggle.js';
|
|
@@ -94,6 +96,17 @@ export declare const KtToggle: import("@lit/react").ReactWebComponent<KtToggleEl
|
|
|
94
96
|
checked: boolean;
|
|
95
97
|
}>;
|
|
96
98
|
}>;
|
|
99
|
+
export declare const KtCheckbox: import("@lit/react").ReactWebComponent<KtCheckboxElement, {
|
|
100
|
+
onKtChange: Kt<{
|
|
101
|
+
checked: boolean;
|
|
102
|
+
}>;
|
|
103
|
+
}>;
|
|
104
|
+
export declare const KtRadioGroup: import("@lit/react").ReactWebComponent<KtRadioGroupElement, {
|
|
105
|
+
onKtChange: Kt<{
|
|
106
|
+
value: string | null;
|
|
107
|
+
}>;
|
|
108
|
+
}>;
|
|
109
|
+
export declare const KtRadio: import("@lit/react").ReactWebComponent<KtRadioElement, {}>;
|
|
97
110
|
export declare const KtSelect: import("@lit/react").ReactWebComponent<KtSelectElement, {
|
|
98
111
|
onKtChange: Kt<{
|
|
99
112
|
value: string | number | null;
|