kanto-ds 1.4.0 → 1.5.2

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 (130) hide show
  1. package/README.md +10 -10
  2. package/dist/chunks/{defaults-BwgjMcww.js → defaults-CFrjqae2.js} +22 -21
  3. package/dist/chunks/{defaults-BwgjMcww.js.map → defaults-CFrjqae2.js.map} +1 -1
  4. package/dist/chunks/events-r51msXNf.js +22 -0
  5. package/dist/chunks/{events-Bjl5Zmmq.js.map → events-r51msXNf.js.map} +1 -1
  6. package/dist/chunks/floating-B7_Dahpn.js +54 -0
  7. package/dist/chunks/floating-B7_Dahpn.js.map +1 -0
  8. package/dist/chunks/{form-control-CxjBTt1c.js → form-control-B74_EHtG.js} +7 -7
  9. package/dist/chunks/form-control-B74_EHtG.js.map +1 -0
  10. package/dist/chunks/{index-DSSLJirw.js → index-STEEvEP7.js} +24 -12
  11. package/dist/chunks/index-STEEvEP7.js.map +1 -0
  12. package/dist/chunks/kt-calendar-B_hFdD9V.js +640 -0
  13. package/dist/chunks/kt-calendar-B_hFdD9V.js.map +1 -0
  14. package/dist/chunks/{kt-element-E-tfJpGQ.js → kt-element-Djx2JcGl.js} +2 -2
  15. package/dist/chunks/{kt-element-E-tfJpGQ.js.map → kt-element-Djx2JcGl.js.map} +1 -1
  16. package/dist/chunks/{listbox-Sm3nvsC6.js → listbox-llcUu_V-.js} +18 -14
  17. package/dist/chunks/{listbox-Sm3nvsC6.js.map → listbox-llcUu_V-.js.map} +1 -1
  18. package/dist/chunks/locale-C5xLkGx5.js +14 -0
  19. package/dist/chunks/locale-C5xLkGx5.js.map +1 -0
  20. package/dist/chunks/position-Cx_ZH5zh.js +39 -0
  21. package/dist/chunks/position-Cx_ZH5zh.js.map +1 -0
  22. package/dist/components/core/kt-avatar/kt-avatar.js +2 -2
  23. package/dist/components/core/kt-badge/kt-badge.js +3 -3
  24. package/dist/components/core/kt-button/kt-button.js +1 -1
  25. package/dist/components/core/kt-card/kt-card.js +2 -2
  26. package/dist/components/core/kt-code/kt-code.js +3 -3
  27. package/dist/components/core/kt-icon/kt-icon.js +2 -2
  28. package/dist/components/core/kt-kbd/kt-kbd.js +1 -1
  29. package/dist/components/core/kt-split-button/kt-split-button.js +4 -4
  30. package/dist/components/data/kt-chart/kt-chart.js +3 -3
  31. package/dist/components/data/kt-meter/kt-meter.js +1 -1
  32. package/dist/components/data/kt-pagination/kt-pagination.js +3 -3
  33. package/dist/components/data/kt-stat/kt-stat.js +1 -1
  34. package/dist/components/data/kt-table/kt-table.d.ts +53 -3
  35. package/dist/components/data/kt-table/kt-table.js +286 -131
  36. package/dist/components/data/kt-table/kt-table.js.map +1 -1
  37. package/dist/components/data/kt-table/window.d.ts +19 -0
  38. package/dist/components/data/kt-timeline/kt-timeline.js +1 -1
  39. package/dist/components/feedback/kt-alert/kt-alert.js +3 -3
  40. package/dist/components/feedback/kt-empty-state/kt-empty-state.js +1 -1
  41. package/dist/components/feedback/kt-progress-bar/kt-progress-bar.js +10 -10
  42. package/dist/components/feedback/kt-progress-bar/kt-progress-bar.js.map +1 -1
  43. package/dist/components/feedback/kt-skeleton/kt-skeleton.js +1 -1
  44. package/dist/components/feedback/kt-toast/kt-toast.js +58 -42
  45. package/dist/components/feedback/kt-toast/kt-toast.js.map +1 -1
  46. package/dist/components/feedback/kt-toast-container/kt-toast-container.js +1 -1
  47. package/dist/components/feedback/kt-tooltip/kt-tooltip.d.ts +20 -0
  48. package/dist/components/feedback/kt-tooltip/kt-tooltip.js +95 -51
  49. package/dist/components/feedback/kt-tooltip/kt-tooltip.js.map +1 -1
  50. package/dist/components/forms/kt-calendar/kt-calendar.d.ts +96 -0
  51. package/dist/components/forms/kt-calendar/kt-calendar.js +13 -0
  52. package/dist/components/forms/kt-calendar/kt-calendar.js.map +1 -0
  53. package/dist/components/forms/kt-checkbox/kt-checkbox.d.ts +9 -0
  54. package/dist/components/forms/kt-checkbox/kt-checkbox.js +34 -20
  55. package/dist/components/forms/kt-checkbox/kt-checkbox.js.map +1 -1
  56. package/dist/components/forms/kt-date-picker/kt-date-picker.d.ts +105 -0
  57. package/dist/components/forms/kt-date-picker/kt-date-picker.js +382 -0
  58. package/dist/components/forms/kt-date-picker/kt-date-picker.js.map +1 -0
  59. package/dist/components/forms/kt-drag-drop/kt-drag-drop.d.ts +9 -0
  60. package/dist/components/forms/kt-drag-drop/kt-drag-drop.js +36 -22
  61. package/dist/components/forms/kt-drag-drop/kt-drag-drop.js.map +1 -1
  62. package/dist/components/forms/kt-form/kt-form.js +2 -2
  63. package/dist/components/forms/kt-input/kt-input.d.ts +37 -1
  64. package/dist/components/forms/kt-input/kt-input.js +380 -194
  65. package/dist/components/forms/kt-input/kt-input.js.map +1 -1
  66. package/dist/components/forms/kt-input-menu/kt-input-menu.d.ts +13 -0
  67. package/dist/components/forms/kt-input-menu/kt-input-menu.js +73 -42
  68. package/dist/components/forms/kt-input-menu/kt-input-menu.js.map +1 -1
  69. package/dist/components/forms/kt-label-input/kt-label-input.js +1 -1
  70. package/dist/components/forms/kt-radio-group/kt-radio-group.d.ts +9 -0
  71. package/dist/components/forms/kt-radio-group/kt-radio-group.js +67 -53
  72. package/dist/components/forms/kt-radio-group/kt-radio-group.js.map +1 -1
  73. package/dist/components/forms/kt-select/kt-select.d.ts +13 -0
  74. package/dist/components/forms/kt-select/kt-select.js +87 -56
  75. package/dist/components/forms/kt-select/kt-select.js.map +1 -1
  76. package/dist/components/forms/kt-textarea/kt-textarea.d.ts +9 -0
  77. package/dist/components/forms/kt-textarea/kt-textarea.js +28 -14
  78. package/dist/components/forms/kt-textarea/kt-textarea.js.map +1 -1
  79. package/dist/components/forms/kt-toggle/kt-toggle.d.ts +9 -0
  80. package/dist/components/forms/kt-toggle/kt-toggle.js +43 -29
  81. package/dist/components/forms/kt-toggle/kt-toggle.js.map +1 -1
  82. package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.js +3 -3
  83. package/dist/components/navigation/kt-header/kt-header.js +3 -3
  84. package/dist/components/navigation/kt-page-header/kt-page-header.js +1 -1
  85. package/dist/components/navigation/kt-segmented-control/kt-segmented-control.d.ts +9 -0
  86. package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js +40 -22
  87. package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js.map +1 -1
  88. package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js +3 -3
  89. package/dist/components/navigation/kt-tabs/kt-tabs.js +2 -2
  90. package/dist/components/navigation/kt-toggle-button/kt-toggle-button.js +2 -2
  91. package/dist/components/navigation/kt-toggle-button-group/kt-toggle-button-group.js +3 -3
  92. package/dist/components/overlays/kt-collapsible/kt-collapsible.js +2 -2
  93. package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.js +3 -3
  94. package/dist/components/overlays/kt-dropdown/kt-dropdown.d.ts +7 -5
  95. package/dist/components/overlays/kt-dropdown/kt-dropdown.js +67 -57
  96. package/dist/components/overlays/kt-dropdown/kt-dropdown.js.map +1 -1
  97. package/dist/components/overlays/kt-modal/kt-modal.js +3 -3
  98. package/dist/components/overlays/kt-side-panel/kt-side-panel.js +3 -3
  99. package/dist/custom-elements.json +2110 -124
  100. package/dist/icons/defaults.d.ts +1 -0
  101. package/dist/icons/index.js +1 -1
  102. package/dist/index.d.ts +4 -0
  103. package/dist/index.js +91 -87
  104. package/dist/index.js.map +1 -1
  105. package/dist/internal/countries.d.ts +24 -9
  106. package/dist/internal/date.d.ts +53 -0
  107. package/dist/internal/events.d.ts +5 -0
  108. package/dist/internal/floating.d.ts +48 -0
  109. package/dist/internal/form-control.d.ts +5 -1
  110. package/dist/internal/locale.d.ts +15 -0
  111. package/dist/internal/position.d.ts +27 -0
  112. package/dist/internal/strings.d.ts +15 -0
  113. package/dist/react/index.d.ts +12 -0
  114. package/dist/react/index.js +180 -166
  115. package/dist/react/index.js.map +1 -1
  116. package/dist/react/jsx.d.ts +11 -1
  117. package/dist/strings/index.js +1 -1
  118. package/dist/tokens/base.css +2 -0
  119. package/dist/tokens/responsive.css +1 -0
  120. package/dist/tokens/spacing.css +1 -0
  121. package/dist/vscode.css-custom-data.json +8 -0
  122. package/dist/vscode.html-custom-data.json +138 -11
  123. package/dist/vue/index.d.ts +4 -0
  124. package/dist/vue/index.js +9 -7
  125. package/dist/vue/index.js.map +1 -1
  126. package/dist/web-types.json +292 -14
  127. package/package.json +10 -1
  128. package/dist/chunks/events-Bjl5Zmmq.js +0 -18
  129. package/dist/chunks/form-control-CxjBTt1c.js.map +0 -1
  130. package/dist/chunks/index-DSSLJirw.js.map +0 -1
@@ -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.0",
4
+ "version": "1.5.2",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1033,6 +1033,26 @@
1033
1033
  "description": "A data table: tri-state sorting, single or multiple selection, paging.\n\n---\n\n\n### **Events:**\n - **kt-sort-change** - Sorting changed. `detail: { key, direction }`.\n- **kt-selection-change** - Selection changed. `detail: { selected, rows }`.\n- **kt-row-click** - A row was clicked. `detail: { row, index }`.\n- **kt-page-change** - The page changed. `detail: { page }`.\n\n### **CSS Parts:**\n - **table** - The `<table>`.\n- **header-cell** - A `<th>`.\n- **row** - A `<tr>`.\n- **cell** - A `<td>`.",
1034
1034
  "doc-url": "",
1035
1035
  "attributes": [
1036
+ {
1037
+ "name": "page",
1038
+ "description": "The page on screen, from 1. Set it to open on another page.",
1039
+ "value": { "type": "number", "default": "1" }
1040
+ },
1041
+ {
1042
+ "name": "manual",
1043
+ "description": "For data sorted and paged on a server: `data` is the current page, shown\nas given. Headers and the pager still update the state and fire their\nevents, and the application loads what they ask for.",
1044
+ "value": { "type": "boolean", "default": "false" }
1045
+ },
1046
+ {
1047
+ "name": "virtual",
1048
+ "description": "Renders only the rows in view, for thousands of rows without paging. The\ntable scrolls inside its own box: give it a height (`kt-table { height:\n480px }`). Every row must be the same height — the first one rendered is\nmeasured. A page size takes precedence.",
1049
+ "value": { "type": "boolean", "default": "false" }
1050
+ },
1051
+ {
1052
+ "name": "total-rows",
1053
+ "description": "In manual mode, how many rows the server holds — what the pager counts.",
1054
+ "value": { "type": "number", "default": "0" }
1055
+ },
1036
1056
  {
1037
1057
  "name": "selectable",
1038
1058
  "value": { "type": "boolean", "default": "false" }
@@ -1077,6 +1097,11 @@
1077
1097
  "name": "label",
1078
1098
  "description": "Accessible name for the table.",
1079
1099
  "value": { "type": "string", "default": "''" }
1100
+ },
1101
+ {
1102
+ "name": "locale",
1103
+ "description": "BCP 47 locale text is sorted in. Empty means the page's `<html lang>`,\nthen the browser's language.",
1104
+ "value": { "type": "string", "default": "''" }
1080
1105
  }
1081
1106
  ],
1082
1107
  "events": [
@@ -1099,6 +1124,26 @@
1099
1124
  ],
1100
1125
  "js": {
1101
1126
  "properties": [
1127
+ {
1128
+ "name": "page",
1129
+ "description": "The page on screen, from 1. Set it to open on another page.",
1130
+ "type": "number"
1131
+ },
1132
+ {
1133
+ "name": "manual",
1134
+ "description": "For data sorted and paged on a server: `data` is the current page, shown\nas given. Headers and the pager still update the state and fire their\nevents, and the application loads what they ask for.",
1135
+ "type": "boolean"
1136
+ },
1137
+ {
1138
+ "name": "virtual",
1139
+ "description": "Renders only the rows in view, for thousands of rows without paging. The\ntable scrolls inside its own box: give it a height (`kt-table { height:\n480px }`). Every row must be the same height — the first one rendered is\nmeasured. A page size takes precedence.",
1140
+ "type": "boolean"
1141
+ },
1142
+ {
1143
+ "name": "totalRows",
1144
+ "description": "In manual mode, how many rows the server holds — what the pager counts.",
1145
+ "type": "number"
1146
+ },
1102
1147
  { "name": "columns", "type": "readonly KtTableColumn[]" },
1103
1148
  { "name": "data", "type": "readonly KtTableRow[]" },
1104
1149
  { "name": "selectable", "type": "boolean" },
@@ -1129,9 +1174,14 @@
1129
1174
  "description": "Accessible name for the table.",
1130
1175
  "type": "string"
1131
1176
  },
1177
+ {
1178
+ "name": "locale",
1179
+ "description": "BCP 47 locale text is sorted in. Empty means the page's `<html lang>`,\nthen the browser's language.",
1180
+ "type": "string"
1181
+ },
1132
1182
  {
1133
1183
  "name": "sortedRows",
1134
- "description": "The rows after sorting, before paging.",
1184
+ "description": "The rows after sorting, before paging.\n\nSorted once per change of `data`, `sortKey`, `sortDirection` or locale, not on\nevery render: hovering a row or ticking a box re-renders the table, and\nre-sorting a few thousand rows each time is what made that lag. Assign a\nnew array to `data` rather than changing it in place.",
1135
1185
  "type": "readonly KtTableRow[]"
1136
1186
  },
1137
1187
  { "name": "totalPages", "type": "number" },
@@ -1625,8 +1675,14 @@
1625
1675
  { "name": "text", "value": { "type": "string", "default": "''" } },
1626
1676
  {
1627
1677
  "name": "placement",
1678
+ "description": "The side the bubble prefers. It takes the opposite one when this one has\nno room — \"top\" on a trigger at the top of the page shows below it.",
1628
1679
  "value": { "type": "KtTooltipPlacement", "default": "'top'" }
1629
1680
  },
1681
+ {
1682
+ "name": "open",
1683
+ "description": "Shows the bubble whatever the pointer and focus do — for a trigger that\ncannot take focus itself, like an icon beside a field, whose owner shows\nit while the field is focused.",
1684
+ "value": { "type": "boolean", "default": "false" }
1685
+ },
1630
1686
  {
1631
1687
  "name": "disabled",
1632
1688
  "description": "Suppresses the tooltip without removing it from the markup.",
@@ -1638,7 +1694,16 @@
1638
1694
  "js": {
1639
1695
  "properties": [
1640
1696
  { "name": "text", "type": "string" },
1641
- { "name": "placement", "type": "KtTooltipPlacement" },
1697
+ {
1698
+ "name": "placement",
1699
+ "description": "The side the bubble prefers. It takes the opposite one when this one has\nno room — \"top\" on a trigger at the top of the page shows below it.",
1700
+ "type": "KtTooltipPlacement"
1701
+ },
1702
+ {
1703
+ "name": "open",
1704
+ "description": "Shows the bubble whatever the pointer and focus do — for a trigger that\ncannot take focus itself, like an icon beside a field, whose owner shows\nit while the field is focused.",
1705
+ "type": "boolean"
1706
+ },
1642
1707
  {
1643
1708
  "name": "disabled",
1644
1709
  "description": "Suppresses the tooltip without removing it from the markup.",
@@ -1648,9 +1713,92 @@
1648
1713
  "events": []
1649
1714
  }
1650
1715
  },
1716
+ {
1717
+ "name": "kt-calendar",
1718
+ "description": "A month calendar to pick a day or a period from, shown in the page.\n\nThe same calendar `<kt-date-picker>` opens in its popup, for when the\ncalendar is the interface rather than a way to fill a field: a booking\npage, a dashboard's date filter, a planning view.\n\nThe header's month and year are buttons. The month opens a grid of the\ntwelve months, the year a grid of twelve years, so reaching a date years\naway takes three clicks rather than paging month by month.\n\nKeyboard, in the day grid (the WAI-ARIA date grid pattern): arrows by day\nand week, Home/End to the week's ends, Page Up/Down by month and with Shift\nby year, Enter to choose. In the month and year grids: arrows, Page Up/Down\nby year or by twelve years, Enter to choose, Escape back to the days.\n\n---\n\n\n### **Events:**\n - **kt-change** - A day, or a whole period, was chosen. `detail: { value }`.\n\n### **Methods:**\n - **focus(): _void_** - Focuses the grid's current cell — the chosen day, or today.\n\n### **CSS Parts:**\n - **base** - The calendar.\n- **day** - A day cell.",
1719
+ "doc-url": "",
1720
+ "attributes": [
1721
+ {
1722
+ "name": "value",
1723
+ "description": "ISO date, or `start/end` interval with `range`. `null` when empty.",
1724
+ "value": { "type": "string | null", "default": "null" }
1725
+ },
1726
+ {
1727
+ "name": "range",
1728
+ "description": "Choose a period — two dates — instead of one day.",
1729
+ "value": { "type": "boolean", "default": "false" }
1730
+ },
1731
+ {
1732
+ "name": "min",
1733
+ "description": "Earliest date that can be chosen, ISO.",
1734
+ "value": { "type": "string", "default": "''" }
1735
+ },
1736
+ {
1737
+ "name": "max",
1738
+ "description": "Latest date that can be chosen, ISO.",
1739
+ "value": { "type": "string", "default": "''" }
1740
+ },
1741
+ {
1742
+ "name": "locale",
1743
+ "description": "BCP 47 language tag for names and the first day of the week. Empty: the\npage's `lang`, then the browser's language.",
1744
+ "value": { "type": "string", "default": "''" }
1745
+ },
1746
+ {
1747
+ "name": "label",
1748
+ "description": "Accessible name of the calendar. Defaults to the strings registry.",
1749
+ "value": { "type": "string", "default": "''" }
1750
+ }
1751
+ ],
1752
+ "events": [
1753
+ {
1754
+ "name": "kt-change",
1755
+ "description": "A day, or a whole period, was chosen. `detail: { value }`."
1756
+ }
1757
+ ],
1758
+ "js": {
1759
+ "properties": [
1760
+ {
1761
+ "name": "value",
1762
+ "description": "ISO date, or `start/end` interval with `range`. `null` when empty.",
1763
+ "type": "string | null"
1764
+ },
1765
+ {
1766
+ "name": "range",
1767
+ "description": "Choose a period — two dates — instead of one day.",
1768
+ "type": "boolean"
1769
+ },
1770
+ {
1771
+ "name": "min",
1772
+ "description": "Earliest date that can be chosen, ISO.",
1773
+ "type": "string"
1774
+ },
1775
+ {
1776
+ "name": "max",
1777
+ "description": "Latest date that can be chosen, ISO.",
1778
+ "type": "string"
1779
+ },
1780
+ {
1781
+ "name": "locale",
1782
+ "description": "BCP 47 language tag for names and the first day of the week. Empty: the\npage's `lang`, then the browser's language.",
1783
+ "type": "string"
1784
+ },
1785
+ {
1786
+ "name": "label",
1787
+ "description": "Accessible name of the calendar. Defaults to the strings registry.",
1788
+ "type": "string"
1789
+ }
1790
+ ],
1791
+ "events": [
1792
+ {
1793
+ "name": "kt-change",
1794
+ "description": "A day, or a whole period, was chosen. `detail: { value }`."
1795
+ }
1796
+ ]
1797
+ }
1798
+ },
1651
1799
  {
1652
1800
  "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.",
1801
+ "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### **Methods:**\n - **formDisabledCallback(disabled: _boolean_): _void_** - Called by the platform when the control's disabled state changes — its\nown `disabled`, or an ancestor `<fieldset disabled>` it cannot see.\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
1802
  "doc-url": "",
1655
1803
  "attributes": [
1656
1804
  {
@@ -1734,9 +1882,139 @@
1734
1882
  ]
1735
1883
  }
1736
1884
  },
1885
+ {
1886
+ "name": "kt-date-picker",
1887
+ "description": "A date field with a calendar, for one day or a period.\n\nThe value is ISO 8601 text, the format a server and a `<input type=\"date\">`\nalready speak: `2026-09-25`, or `2026-09-01/2026-09-25` for a period. What\nthe field shows is the same date formatted for the reader's language, and\nthe calendar starts its weeks on the day their region does.\n\nThe popup is a `<kt-calendar>`, with its keyboard model and its month and\nyear views: the WAI-ARIA date picker dialog pattern, where Escape closes the\ndialog and hands focus back to the field, and tabbing out closes it too.\n\n---\n\n\n### **Events:**\n - **kt-change** - A date or a whole period was chosen, or the value cleared. `detail: { value }` — the ISO date or interval, or `null`.\n\n### **Methods:**\n - **formDisabledCallback(disabled: _boolean_): _void_** - Called by the platform when the control's disabled state changes — its\nown `disabled`, or an ancestor `<fieldset disabled>` it cannot see.\n\n### **CSS Parts:**\n - **trigger** - The field.\n- **panel** - The calendar popup.\n- **calendar** - The `<kt-calendar>` inside it.",
1888
+ "doc-url": "",
1889
+ "attributes": [
1890
+ {
1891
+ "name": "value",
1892
+ "description": "ISO date, or `start/end` interval with `range`. `null` when empty.",
1893
+ "value": { "type": "string | null", "default": "null" }
1894
+ },
1895
+ {
1896
+ "name": "range",
1897
+ "description": "Choose a period — two dates — instead of one day.",
1898
+ "value": { "type": "boolean", "default": "false" }
1899
+ },
1900
+ {
1901
+ "name": "min",
1902
+ "description": "Earliest date that can be chosen, ISO.",
1903
+ "value": { "type": "string", "default": "''" }
1904
+ },
1905
+ {
1906
+ "name": "max",
1907
+ "description": "Latest date that can be chosen, ISO.",
1908
+ "value": { "type": "string", "default": "''" }
1909
+ },
1910
+ { "name": "name", "value": { "type": "string", "default": "''" } },
1911
+ {
1912
+ "name": "label",
1913
+ "description": "Accessible name, when no `<kt-label-input>` wraps the field.",
1914
+ "value": { "type": "string", "default": "''" }
1915
+ },
1916
+ {
1917
+ "name": "placeholder",
1918
+ "description": "Shown while empty. Defaults to the strings registry.",
1919
+ "value": { "type": "string | undefined", "default": "undefined" }
1920
+ },
1921
+ {
1922
+ "name": "locale",
1923
+ "description": "BCP 47 language tag for formatting and for the first day of the week.\nEmpty: the page's `lang`, then the browser's language.",
1924
+ "value": { "type": "string", "default": "''" }
1925
+ },
1926
+ {
1927
+ "name": "size",
1928
+ "value": { "type": "KtDatePickerSize", "default": "'medium'" }
1929
+ },
1930
+ {
1931
+ "name": "disabled",
1932
+ "value": { "type": "boolean", "default": "false" }
1933
+ },
1934
+ {
1935
+ "name": "required",
1936
+ "value": { "type": "boolean", "default": "false" }
1937
+ },
1938
+ {
1939
+ "name": "clearable",
1940
+ "description": "Shows a button that empties the field once it holds a value.",
1941
+ "value": { "type": "boolean", "default": "true" }
1942
+ },
1943
+ {
1944
+ "name": "error",
1945
+ "description": "Error message. A non-empty value puts the field in its error state.",
1946
+ "value": { "type": "string", "default": "''" }
1947
+ }
1948
+ ],
1949
+ "events": [
1950
+ {
1951
+ "name": "kt-change",
1952
+ "description": "A date or a whole period was chosen, or the value cleared. `detail: { value }` — the ISO date or interval, or `null`."
1953
+ }
1954
+ ],
1955
+ "js": {
1956
+ "properties": [
1957
+ {
1958
+ "name": "value",
1959
+ "description": "ISO date, or `start/end` interval with `range`. `null` when empty.",
1960
+ "type": "string | null"
1961
+ },
1962
+ {
1963
+ "name": "range",
1964
+ "description": "Choose a period — two dates — instead of one day.",
1965
+ "type": "boolean"
1966
+ },
1967
+ {
1968
+ "name": "min",
1969
+ "description": "Earliest date that can be chosen, ISO.",
1970
+ "type": "string"
1971
+ },
1972
+ {
1973
+ "name": "max",
1974
+ "description": "Latest date that can be chosen, ISO.",
1975
+ "type": "string"
1976
+ },
1977
+ { "name": "name", "type": "string" },
1978
+ {
1979
+ "name": "label",
1980
+ "description": "Accessible name, when no `<kt-label-input>` wraps the field.",
1981
+ "type": "string"
1982
+ },
1983
+ {
1984
+ "name": "placeholder",
1985
+ "description": "Shown while empty. Defaults to the strings registry.",
1986
+ "type": "string | undefined"
1987
+ },
1988
+ {
1989
+ "name": "locale",
1990
+ "description": "BCP 47 language tag for formatting and for the first day of the week.\nEmpty: the page's `lang`, then the browser's language.",
1991
+ "type": "string"
1992
+ },
1993
+ { "name": "size", "type": "KtDatePickerSize" },
1994
+ { "name": "disabled", "type": "boolean" },
1995
+ { "name": "required", "type": "boolean" },
1996
+ {
1997
+ "name": "clearable",
1998
+ "description": "Shows a button that empties the field once it holds a value.",
1999
+ "type": "boolean"
2000
+ },
2001
+ {
2002
+ "name": "error",
2003
+ "description": "Error message. A non-empty value puts the field in its error state.",
2004
+ "type": "string"
2005
+ }
2006
+ ],
2007
+ "events": [
2008
+ {
2009
+ "name": "kt-change",
2010
+ "description": "A date or a whole period was chosen, or the value cleared. `detail: { value }` — the ISO date or interval, or `null`."
2011
+ }
2012
+ ]
2013
+ }
2014
+ },
1737
2015
  {
1738
2016
  "name": "kt-drag-drop",
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.",
2017
+ "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 - **formDisabledCallback(disabled: _boolean_): _void_** - Called by the platform when the control's disabled state changes — its\nown `disabled`, or an ancestor `<fieldset disabled>` it cannot see.\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.",
1740
2018
  "doc-url": "",
1741
2019
  "attributes": [
1742
2020
  {
@@ -1916,7 +2194,7 @@
1916
2194
  },
1917
2195
  {
1918
2196
  "name": "kt-input",
1919
- "description": "A single-line text field.\n\nBorderless by design: the field is a fill on `--color-dark-12` that gains a\n2px *outline* — grey on hover, primary on focus, danger on error. An outline\nsits outside the box, so nothing reflows when the state changes.\n\nThe element is form-associated: it serialises into `FormData` under its\n`name`, resets with the form, and reports validity like a native input.\n\n---\n\n\n### **Events:**\n - **kt-input** - On every keystroke. `detail: { value }`.\n- **kt-change** - When the value is committed (blur or Enter). `detail: { value }`.\n- **kt-clear** - The clear button was pressed.\n\n### **Methods:**\n - **formResetCallback(): _void_** - Called by the platform when the enclosing form is reset.\n- **formStateRestoreCallback(state: _string_): _void_** - Called by the platform when the browser restores a session.\n- **select(): _void_** - Selects the field's contents, as `HTMLInputElement.select()` does.\n\n### **CSS Parts:**\n - **base** - The field container.\n- **control** - The native `<input>`.\n- **actions** - The trailing icon row.",
2197
+ "description": "A single-line text field.\n\nBorderless by design: the field is a fill on `--color-dark-12` that gains a\n2px *outline* — grey on hover, primary on focus, danger on error. An outline\nsits outside the box, so nothing reflows when the state changes.\n\nThe element is form-associated: it serialises into `FormData` under its\n`name`, resets with the form, and reports validity like a native input.\n\n---\n\n\n### **Events:**\n - **kt-input** - On every keystroke. `detail: { value }`.\n- **kt-change** - When the value is committed (blur or Enter). `detail: { value }`.\n- **kt-clear** - The clear button was pressed.\n\n### **Methods:**\n - **formResetCallback(): _void_** - Called by the platform when the enclosing form is reset.\n- **formDisabledCallback(disabled: _boolean_): _void_** - Called by the platform when the control's disabled state changes — its\nown `disabled`, or an ancestor `<fieldset disabled>` it cannot see.\n- **formStateRestoreCallback(state: _string_): _void_** - Called by the platform when the browser restores a session.\n- **select(): _void_** - Selects the field's contents, as `HTMLInputElement.select()` does.\n\n### **CSS Parts:**\n - **base** - The field container.\n- **control** - The native `<input>`.\n- **actions** - The trailing icon row.",
1920
2198
  "doc-url": "",
1921
2199
  "attributes": [
1922
2200
  {
@@ -1958,7 +2236,7 @@
1958
2236
  },
1959
2237
  {
1960
2238
  "name": "error",
1961
- "description": "Error message. A non-empty value puts the field in its error state.",
2239
+ "description": "Error message. A non-empty value puts the field in its error state, and\nwins over the field's own checks.",
1962
2240
  "value": { "type": "string", "default": "''" }
1963
2241
  },
1964
2242
  {
@@ -2025,7 +2303,7 @@
2025
2303
  },
2026
2304
  {
2027
2305
  "name": "error",
2028
- "description": "Error message. A non-empty value puts the field in its error state.",
2306
+ "description": "Error message. A non-empty value puts the field in its error state, and\nwins over the field's own checks.",
2029
2307
  "type": "string"
2030
2308
  },
2031
2309
  {
@@ -2069,7 +2347,7 @@
2069
2347
  },
2070
2348
  {
2071
2349
  "name": "kt-input-menu",
2072
- "description": "A combobox: type to narrow the list, then pick.\n\nReach for it over `<kt-select>` once the list is long enough that scanning it\nis slower than typing three letters — somewhere around twenty options.\n\n---\n\n\n### **Events:**\n - **kt-change** - An option was chosen or cleared. `detail: { value, option }`.\n- **kt-filter** - The query changed. `detail: { query }`.\n\n### **CSS Parts:**\n - **control** - The field.\n- **input** - The native `<input>`.\n- **popup** - The option list.\n- **option** - An option row.",
2350
+ "description": "A combobox: type to narrow the list, then pick.\n\nReach for it over `<kt-select>` once the list is long enough that scanning it\nis slower than typing three letters — somewhere around twenty options.\n\n---\n\n\n### **Events:**\n - **kt-change** - An option was chosen or cleared. `detail: { value, option }`.\n- **kt-filter** - The query changed. `detail: { query }`.\n\n### **Methods:**\n - **formDisabledCallback(disabled: _boolean_): _void_** - Called by the platform when the control's disabled state changes — its\nown `disabled`, or an ancestor `<fieldset disabled>` it cannot see.\n\n### **CSS Parts:**\n - **control** - The field.\n- **input** - The native `<input>`.\n- **popup** - The option list.\n- **option** - An option row.",
2073
2351
  "doc-url": "",
2074
2352
  "attributes": [
2075
2353
  {
@@ -2233,7 +2511,7 @@
2233
2511
  },
2234
2512
  {
2235
2513
  "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.",
2514
+ "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### **Methods:**\n - **formDisabledCallback(disabled: _boolean_): _void_** - Called by the platform when the control's disabled state changes — its\nown `disabled`, or an ancestor `<fieldset disabled>` it cannot see.\n\n### **Slots:**\n - _default_ - The `<kt-radio>` options.\n\n### **CSS Parts:**\n - **base** - The `role=\"radiogroup\"` container.",
2237
2515
  "doc-url": "",
2238
2516
  "attributes": [
2239
2517
  {
@@ -2307,7 +2585,7 @@
2307
2585
  },
2308
2586
  {
2309
2587
  "name": "kt-select",
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.",
2588
+ "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### **Methods:**\n - **formDisabledCallback(disabled: _boolean_): _void_** - Called by the platform when the control's disabled state changes — its\nown `disabled`, or an ancestor `<fieldset disabled>` it cannot see.\n\n### **CSS Parts:**\n - **trigger** - The button that opens the list.\n- **popup** - The option list.\n- **option** - An option row.",
2311
2589
  "doc-url": "",
2312
2590
  "attributes": [
2313
2591
  {
@@ -2412,7 +2690,7 @@
2412
2690
  },
2413
2691
  {
2414
2692
  "name": "kt-textarea",
2415
- "description": "A multi-line text field, with the same borderless fill and outline states as\n`<kt-input>`.\n\nA character counter appears whenever `maxlength` is set — the field tells\nthe user where the limit is before the browser silently stops accepting\nkeystrokes.\n\n---\n\n\n### **Events:**\n - **kt-input** - On every keystroke. `detail: { value }`.\n- **kt-change** - When the value is committed. `detail: { value }`.\n\n### **CSS Parts:**\n - **base** - The field container.\n- **control** - The native `<textarea>`.\n- **counter** - The character counter.",
2693
+ "description": "A multi-line text field, with the same borderless fill and outline states as\n`<kt-input>`.\n\nA character counter appears whenever `maxlength` is set — the field tells\nthe user where the limit is before the browser silently stops accepting\nkeystrokes.\n\n---\n\n\n### **Events:**\n - **kt-input** - On every keystroke. `detail: { value }`.\n- **kt-change** - When the value is committed. `detail: { value }`.\n\n### **Methods:**\n - **formDisabledCallback(disabled: _boolean_): _void_** - Called by the platform when the control's disabled state changes — its\nown `disabled`, or an ancestor `<fieldset disabled>` it cannot see.\n\n### **CSS Parts:**\n - **base** - The field container.\n- **control** - The native `<textarea>`.\n- **counter** - The character counter.",
2416
2694
  "doc-url": "",
2417
2695
  "attributes": [
2418
2696
  { "name": "value", "value": { "type": "string", "default": "''" } },
@@ -2501,7 +2779,7 @@
2501
2779
  },
2502
2780
  {
2503
2781
  "name": "kt-toggle",
2504
- "description": "An on/off switch.\n\nSized off the button heights so a toggle lines up with the controls beside\nit: the track is 1.8× the field height, the thumb is inset by 12% of it.\nChange `--button-height` and the switch follows.\n\n---\n\n\n### **Events:**\n - **kt-change** - The state changed. `detail: { checked }`.\n\n### **Slots:**\n - _default_ - Optional label, rendered beside the switch and clickable.\n\n### **CSS Parts:**\n - **base** - The button carrying `role=\"switch\"`.\n- **track** - The track.\n- **thumb** - The sliding thumb.",
2782
+ "description": "An on/off switch.\n\nSized off the button heights so a toggle lines up with the controls beside\nit: the track is 1.8× the field height, the thumb is inset by 12% of it.\nChange `--button-height` and the switch follows.\n\n---\n\n\n### **Events:**\n - **kt-change** - The state changed. `detail: { checked }`.\n\n### **Methods:**\n - **formDisabledCallback(disabled: _boolean_): _void_** - Called by the platform when the control's disabled state changes — its\nown `disabled`, or an ancestor `<fieldset disabled>` it cannot see.\n\n### **Slots:**\n - _default_ - Optional label, rendered beside the switch and clickable.\n\n### **CSS Parts:**\n - **base** - The button carrying `role=\"switch\"`.\n- **track** - The track.\n- **thumb** - The sliding thumb.",
2505
2783
  "doc-url": "",
2506
2784
  "attributes": [
2507
2785
  {
@@ -2740,7 +3018,7 @@
2740
3018
  },
2741
3019
  {
2742
3020
  "name": "kt-segmented-control",
2743
- "description": "A small set of mutually exclusive choices, shown as one inset track with the\nselected segment raised out of it.\n\nUse it for two to five options that all fit on screen — a view switch, a date\nrange. Past that, `<kt-select>`.\n\nImplemented as a radio group: one tab stop for the whole control, arrows to\nmove between segments. That is what a keyboard user expects here, and it\nkeeps a five-option control from adding five tab stops to the page.\n\n---\n\n\n### **Events:**\n - **kt-change** - A segment was chosen. `detail: { value, option }`.\n\n### **CSS Parts:**\n - **base** - The track.\n- **option** - A segment.",
3021
+ "description": "A small set of mutually exclusive choices, shown as one inset track with the\nselected segment raised out of it.\n\nUse it for two to five options that all fit on screen — a view switch, a date\nrange. Past that, `<kt-select>`.\n\nImplemented as a radio group: one tab stop for the whole control, arrows to\nmove between segments. That is what a keyboard user expects here, and it\nkeeps a five-option control from adding five tab stops to the page.\n\n---\n\n\n### **Events:**\n - **kt-change** - A segment was chosen. `detail: { value, option }`.\n\n### **Methods:**\n - **formDisabledCallback(disabled: _boolean_): _void_** - Called by the platform when the control's disabled state changes — its\nown `disabled`, or an ancestor `<fieldset disabled>` it cannot see.\n\n### **CSS Parts:**\n - **base** - The track.\n- **option** - A segment.",
2744
3022
  "doc-url": "",
2745
3023
  "attributes": [
2746
3024
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kanto-ds",
3
- "version": "1.4.0",
3
+ "version": "1.5.2",
4
4
  "description": "Framework-agnostic design system for data-dense product interfaces.",
5
5
  "keywords": [
6
6
  "design-system",
@@ -153,10 +153,18 @@
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-calendar": {
157
+ "types": "./dist/components/forms/kt-calendar/kt-calendar.d.ts",
158
+ "default": "./dist/components/forms/kt-calendar/kt-calendar.js"
159
+ },
156
160
  "./components/forms/kt-checkbox": {
157
161
  "types": "./dist/components/forms/kt-checkbox/kt-checkbox.d.ts",
158
162
  "default": "./dist/components/forms/kt-checkbox/kt-checkbox.js"
159
163
  },
164
+ "./components/forms/kt-date-picker": {
165
+ "types": "./dist/components/forms/kt-date-picker/kt-date-picker.d.ts",
166
+ "default": "./dist/components/forms/kt-date-picker/kt-date-picker.js"
167
+ },
160
168
  "./components/forms/kt-drag-drop": {
161
169
  "types": "./dist/components/forms/kt-drag-drop/kt-drag-drop.d.ts",
162
170
  "default": "./dist/components/forms/kt-drag-drop/kt-drag-drop.js"
@@ -323,6 +331,7 @@
323
331
  "happy-dom": "^20.14.0",
324
332
  "highlight.js": "^11.12.0",
325
333
  "jsdom": "^30.0.1",
334
+ "libphonenumber-js": "^1.13.14",
326
335
  "marked": "^18.0.12",
327
336
  "playwright": "^1.63.0",
328
337
  "prettier": "^3.9.6",
@@ -1,18 +0,0 @@
1
- function c(e, u, r) {
2
- const t = new CustomEvent(u, {
3
- detail: r,
4
- bubbles: !0,
5
- composed: !0,
6
- cancelable: !0
7
- });
8
- return e.dispatchEvent(t), t;
9
- }
10
- let n = 0;
11
- function o(e) {
12
- return n += 1, `${e}-${n}`;
13
- }
14
- export {
15
- c as e,
16
- o as u
17
- };
18
- //# sourceMappingURL=events-Bjl5Zmmq.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-control-CxjBTt1c.js","sources":["../../src/internal/form-control.ts"],"sourcesContent":["/**\n * Form participation for Kanto's input elements.\n *\n * A control inside a shadow root is invisible to the form around it. The\n * platform's answer is `ElementInternals`: the element declares\n * `static formAssociated = true`, calls `attachInternals()` and pushes its\n * value in with `setFormValue`, which makes it a first-class form control —\n * serialised into `FormData`, reset by `form.reset()`, validated by\n * `form.checkValidity()`.\n *\n * Every browser Kanto targets supports this. Test environments do not: neither\n * happy-dom nor jsdom implements it, and jsdom stubs `attachInternals` with an\n * object that has no `setFormValue`. So each call is guarded, and an element\n * still works — minus form serialisation — where the API is missing.\n */\n\n/** An `ElementInternals` implementation complete enough to be worth calling. */\nexport type UsableInternals = ElementInternals;\n\nexport function attachFormInternals(host: HTMLElement): UsableInternals | null {\n if (typeof host.attachInternals !== 'function') return null;\n\n const internals = host.attachInternals();\n if (typeof internals.setFormValue !== 'function') return null;\n\n return internals;\n}\n\n/**\n * Pushes the control's current value into the enclosing form, if there is one.\n *\n * A `FormData` submits each of its entries as they are named in it — which is\n * how one control contributes several files under one name.\n */\nexport function setFormValue(\n internals: UsableInternals | null,\n value: string | FormData | null,\n): void {\n internals?.setFormValue(value);\n}\n\n/**\n * Mirrors a control's validity onto the host element.\n *\n * `anchor` is the element a browser scrolls to and anchors the native bubble\n * against when the form is submitted invalid.\n */\nexport function setValidity(\n internals: UsableInternals | null,\n flags: ValidityStateFlags,\n message: string,\n anchor?: HTMLElement,\n): void {\n if (!internals || typeof internals.setValidity !== 'function') return;\n if (Object.values(flags).some(Boolean)) internals.setValidity(flags, message, anchor);\n else internals.setValidity({});\n}\n"],"names":["attachFormInternals","host","internals","setFormValue","value","setValidity","flags","message","anchor"],"mappings":"AAmBO,SAASA,EAAoBC,GAA2C;AAC7E,MAAI,OAAOA,EAAK,mBAAoB,WAAY,QAAO;AAEvD,QAAMC,IAAYD,EAAK,gBAAA;AACvB,SAAI,OAAOC,EAAU,gBAAiB,aAAmB,OAElDA;AACT;AAQO,SAASC,EACdD,GACAE,GACM;AACN,EAAAF,GAAW,aAAaE,CAAK;AAC/B;AAQO,SAASC,EACdH,GACAI,GACAC,GACAC,GACM;AACN,EAAI,CAACN,KAAa,OAAOA,EAAU,eAAgB,eAC/C,OAAO,OAAOI,CAAK,EAAE,KAAK,OAAO,IAAGJ,EAAU,YAAYI,GAAOC,GAASC,CAAM,IAC/EN,EAAU,YAAY,EAAE;AAC/B;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-DSSLJirw.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 /** A required checkbox left unchecked. */\n checkRequired: 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 // --- Groups and sections ---\n /** A button or choice group with no label of its own. */\n options: string;\n /** A `kt-form` section with no heading. */\n formSection: 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 /** Caption of a chart's data table when the chart has no label. */\n chartData: string;\n /** Value column of a single-series chart's data table when the series has no name. */\n chartValue: 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 checkRequired: 'Check this box to continue.',\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 options: 'Options',\n formSection: 'Form section',\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 chartData: 'Chart data',\n chartValue: 'Value',\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":"AA8GO,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,EACZ,eAAe;AAAA,EAEf,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,SAAS;AAAA,EACT,aAAa;AAAA,EAEb,WAAW;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,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;"}