kanto-ds 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +15 -10
  2. package/dist/cdn/kanto.min.js +887 -234
  3. package/dist/chunks/{index-TWJzttLX.js → index-BEWmAE0T.js} +21 -7
  4. package/dist/chunks/index-BEWmAE0T.js.map +1 -0
  5. package/dist/chunks/{kt-calendar-CtwOby1R.js → kt-calendar-D72xa8qr.js} +3 -3
  6. package/dist/chunks/{kt-calendar-CtwOby1R.js.map → kt-calendar-D72xa8qr.js.map} +1 -1
  7. package/dist/chunks/{kt-element-T0VbIBNp.js → kt-element-COgh6Yr1.js} +2 -2
  8. package/dist/chunks/{kt-element-T0VbIBNp.js.map → kt-element-COgh6Yr1.js.map} +1 -1
  9. package/dist/chunks/numbers-QyecMiSJ.js +9 -0
  10. package/dist/chunks/numbers-QyecMiSJ.js.map +1 -0
  11. package/dist/chunks/{segmented-field-BBXR4XFL.js → segmented-field-BCjCGF4I.js} +2 -2
  12. package/dist/chunks/{segmented-field-BBXR4XFL.js.map → segmented-field-BCjCGF4I.js.map} +1 -1
  13. package/dist/chunks/{typed-date-CPAUNHzr.js → typed-date-Z3vcUJbb.js} +2 -2
  14. package/dist/chunks/{typed-date-CPAUNHzr.js.map → typed-date-Z3vcUJbb.js.map} +1 -1
  15. package/dist/components/core/kt-avatar/kt-avatar.js +2 -2
  16. package/dist/components/core/kt-badge/kt-badge.js +2 -2
  17. package/dist/components/core/kt-button/kt-button.js +1 -1
  18. package/dist/components/core/kt-card/kt-card.js +1 -1
  19. package/dist/components/core/kt-code/kt-code.js +2 -2
  20. package/dist/components/core/kt-icon/kt-icon.js +1 -1
  21. package/dist/components/core/kt-kbd/kt-kbd.js +1 -1
  22. package/dist/components/core/kt-split-button/kt-split-button.js +2 -2
  23. package/dist/components/data/kt-chart/kt-chart.js +2 -2
  24. package/dist/components/data/kt-meter/kt-meter.js +1 -1
  25. package/dist/components/data/kt-pagination/kt-pagination.js +2 -2
  26. package/dist/components/data/kt-stat/kt-stat.js +1 -1
  27. package/dist/components/data/kt-table/kt-table.js +2 -2
  28. package/dist/components/data/kt-timeline/kt-timeline.js +1 -1
  29. package/dist/components/feedback/kt-alert/kt-alert.js +2 -2
  30. package/dist/components/feedback/kt-empty-state/kt-empty-state.js +1 -1
  31. package/dist/components/feedback/kt-progress-bar/kt-progress-bar.js +1 -1
  32. package/dist/components/feedback/kt-skeleton/kt-skeleton.js +1 -1
  33. package/dist/components/feedback/kt-toast/kt-toast.js +2 -2
  34. package/dist/components/feedback/kt-toast-container/kt-toast-container.js +1 -1
  35. package/dist/components/feedback/kt-tooltip/kt-tooltip.js +1 -1
  36. package/dist/components/forms/kt-calendar/kt-calendar.js +3 -3
  37. package/dist/components/forms/kt-checkbox/kt-checkbox.js +2 -2
  38. package/dist/components/forms/kt-date-input/kt-date-input.js +5 -5
  39. package/dist/components/forms/kt-date-picker/kt-date-picker.js +4 -4
  40. package/dist/components/forms/kt-drag-drop/kt-drag-drop.js +2 -2
  41. package/dist/components/forms/kt-form/kt-form.js +2 -2
  42. package/dist/components/forms/kt-input/kt-input.js +2 -2
  43. package/dist/components/forms/kt-input-menu/kt-input-menu.js +2 -2
  44. package/dist/components/forms/kt-label-input/kt-label-input.js +1 -1
  45. package/dist/components/forms/kt-multi-select/kt-multi-select.js +2 -2
  46. package/dist/components/forms/kt-number-input/kt-number-input.d.ts +89 -0
  47. package/dist/components/forms/kt-number-input/kt-number-input.js +350 -0
  48. package/dist/components/forms/kt-number-input/kt-number-input.js.map +1 -0
  49. package/dist/components/forms/kt-radio-group/kt-radio-group.js +2 -2
  50. package/dist/components/forms/kt-select/kt-select.js +2 -2
  51. package/dist/components/forms/kt-slider/kt-slider.d.ts +69 -0
  52. package/dist/components/forms/kt-slider/kt-slider.js +252 -0
  53. package/dist/components/forms/kt-slider/kt-slider.js.map +1 -0
  54. package/dist/components/forms/kt-textarea/kt-textarea.js +2 -2
  55. package/dist/components/forms/kt-time-input/kt-time-input.js +3 -3
  56. package/dist/components/forms/kt-toggle/kt-toggle.js +1 -1
  57. package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.js +2 -2
  58. package/dist/components/navigation/kt-header/kt-header.js +2 -2
  59. package/dist/components/navigation/kt-page-header/kt-page-header.js +1 -1
  60. package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js +2 -2
  61. package/dist/components/navigation/kt-steps/kt-steps.d.ts +65 -0
  62. package/dist/components/navigation/kt-steps/kt-steps.js +244 -0
  63. package/dist/components/navigation/kt-steps/kt-steps.js.map +1 -0
  64. package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js +2 -2
  65. package/dist/components/navigation/kt-tabs/kt-tabs.js +1 -1
  66. package/dist/components/navigation/kt-toggle-button/kt-toggle-button.js +1 -1
  67. package/dist/components/navigation/kt-toggle-button-group/kt-toggle-button-group.js +2 -2
  68. package/dist/components/overlays/kt-collapsible/kt-collapsible.js +1 -1
  69. package/dist/components/overlays/kt-command-palette/kt-command-palette.d.ts +87 -0
  70. package/dist/components/overlays/kt-command-palette/kt-command-palette.js +370 -0
  71. package/dist/components/overlays/kt-command-palette/kt-command-palette.js.map +1 -0
  72. package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.js +2 -2
  73. package/dist/components/overlays/kt-dropdown/kt-dropdown.js +2 -2
  74. package/dist/components/overlays/kt-modal/kt-modal.js +2 -2
  75. package/dist/components/overlays/kt-side-panel/kt-side-panel.js +2 -2
  76. package/dist/custom-elements.json +3279 -1754
  77. package/dist/docs/kt-command-palette.md +99 -0
  78. package/dist/docs/kt-number-input.md +77 -0
  79. package/dist/docs/kt-slider.md +76 -0
  80. package/dist/docs/kt-steps.md +79 -0
  81. package/dist/index.d.ts +6 -0
  82. package/dist/index.js +105 -97
  83. package/dist/index.js.map +1 -1
  84. package/dist/internal/command-search.d.ts +27 -0
  85. package/dist/internal/numbers.d.ts +2 -0
  86. package/dist/internal/strings.d.ts +14 -0
  87. package/dist/react/index.d.ts +31 -0
  88. package/dist/react/index.js +199 -164
  89. package/dist/react/index.js.map +1 -1
  90. package/dist/react/jsx.d.ts +27 -1
  91. package/dist/strings/index.js +1 -1
  92. package/dist/tokens/base.css +4 -0
  93. package/dist/vscode.css-custom-data.json +26 -2
  94. package/dist/vscode.html-custom-data.json +120 -12
  95. package/dist/vue/index.d.ts +8 -0
  96. package/dist/vue/index.js +12 -8
  97. package/dist/vue/index.js.map +1 -1
  98. package/dist/web-types.json +347 -39
  99. package/package.json +20 -3
  100. package/dist/chunks/index-TWJzttLX.js.map +0 -1
@@ -0,0 +1,244 @@
1
+ import { css as g, nothing as p, html as r } from "lit";
2
+ import { property as l } from "lit/decorators.js";
3
+ import { K as m, d as v } from "../../../chunks/kt-element-COgh6Yr1.js";
4
+ import { e as k } from "../../../chunks/events-r51msXNf.js";
5
+ import { s as f } from "../../../chunks/index-BEWmAE0T.js";
6
+ import "../../core/kt-icon/kt-icon.js";
7
+ var x = Object.defineProperty, c = (d, e, a, n) => {
8
+ for (var t = void 0, o = d.length - 1, i; o >= 0; o--)
9
+ (i = d[o]) && (t = i(e, a, t) || t);
10
+ return t && x(e, a, t), t;
11
+ };
12
+ class s extends m {
13
+ constructor() {
14
+ super(...arguments), this.steps = [], this.current = "", this.label = "", this.orientation = "horizontal", this.navigable = !1;
15
+ }
16
+ static {
17
+ this.styles = [
18
+ m.styles,
19
+ g`
20
+ :host {
21
+ display: block;
22
+ --kt-steps-marker: calc(28px * var(--density-scale, 1));
23
+ }
24
+
25
+ ol {
26
+ display: flex;
27
+ margin: 0;
28
+ padding: 0;
29
+ list-style: none;
30
+ }
31
+ :host([orientation='vertical']) ol {
32
+ flex-direction: column;
33
+ }
34
+
35
+ /* Across, the steps share the width evenly: a column each, the marker
36
+ on top and the text centred under it. */
37
+ li {
38
+ position: relative;
39
+ flex: 1 1 0;
40
+ min-width: 0;
41
+ }
42
+ .step {
43
+ display: flex;
44
+ flex-direction: column;
45
+ gap: 8px;
46
+ align-items: center;
47
+ text-align: center;
48
+ }
49
+ :host([orientation='vertical']) li {
50
+ flex: none;
51
+ padding-bottom: 24px;
52
+ }
53
+ :host([orientation='vertical']) li:last-child {
54
+ padding-bottom: 0;
55
+ }
56
+ :host([orientation='vertical']) .step {
57
+ flex-direction: row;
58
+ gap: 12px;
59
+ align-items: flex-start;
60
+ text-align: start;
61
+ }
62
+
63
+ /* The line to the next step, from marker to marker through their
64
+ middle, clear of each: 8px across, 6px down. */
65
+ .connector {
66
+ position: absolute;
67
+ top: calc(var(--kt-steps-marker) / 2 - 1px);
68
+ left: calc(50% + var(--kt-steps-marker) / 2 + 8px);
69
+ width: calc(100% - var(--kt-steps-marker) - 16px);
70
+ height: 2px;
71
+ background: var(--border-field);
72
+ border-radius: var(--radius-full);
73
+ }
74
+ li[data-state='complete'] .connector {
75
+ background: var(--color-primary-base);
76
+ }
77
+ :host([orientation='vertical']) .connector {
78
+ top: calc(var(--kt-steps-marker) + 6px);
79
+ left: calc(var(--kt-steps-marker) / 2 - 1px);
80
+ width: 2px;
81
+ height: calc(100% - var(--kt-steps-marker) - 12px);
82
+ }
83
+
84
+ /* A filled circle: the tick when done, the number otherwise. */
85
+ .marker {
86
+ display: grid;
87
+ flex: none;
88
+ place-items: center;
89
+ width: var(--kt-steps-marker);
90
+ height: var(--kt-steps-marker);
91
+ color: var(--text-body);
92
+ font: var(--font-normal-small);
93
+ font-weight: 600;
94
+ /* A field's border colour: a grey that reads on a card and a page,
95
+ in both themes. */
96
+ background: var(--border-field);
97
+ border-radius: 50%;
98
+ transition:
99
+ background-color var(--duration-fast) var(--easing-standard),
100
+ color var(--duration-fast) var(--easing-standard);
101
+ }
102
+ li[data-state='complete'] .marker,
103
+ li[data-state='current'] .marker {
104
+ color: var(--color-white);
105
+ background: var(--color-primary-base);
106
+ }
107
+ li[data-state='error'] .marker {
108
+ color: var(--color-white);
109
+ background: var(--color-danger-base);
110
+ }
111
+ /* Trimmed to the digits' height, so the grid centres the ink, not a
112
+ line box padded by the font's ascent and descent. */
113
+ .number {
114
+ display: block;
115
+ line-height: 1;
116
+ font-variant-numeric: tabular-nums;
117
+ text-box: trim-both cap alphabetic;
118
+ }
119
+ /* Lucide's tick sits high in its square; this puts its ink on the
120
+ marker's middle. */
121
+ .marker kt-icon[name='check'] {
122
+ translate: 0 0.5px;
123
+ }
124
+
125
+ .text {
126
+ display: grid;
127
+ gap: 2px;
128
+ min-width: 0;
129
+ padding: 0 4px;
130
+ }
131
+ :host([orientation='vertical']) .text {
132
+ gap: 0;
133
+ padding: 0;
134
+ }
135
+ .label {
136
+ color: var(--text-muted);
137
+ font: var(--font-normal-medium);
138
+ }
139
+ /* Down, as tall as the marker, so the label sits on its middle. */
140
+ :host([orientation='vertical']) .label {
141
+ display: flex;
142
+ align-items: center;
143
+ min-height: var(--kt-steps-marker);
144
+ }
145
+ li[data-state='current'] .label,
146
+ li[data-state='complete'] .label {
147
+ color: var(--text-body);
148
+ }
149
+ li[data-state='error'] .label {
150
+ color: var(--color-danger-text);
151
+ }
152
+ .description {
153
+ color: var(--text-muted);
154
+ font: var(--font-normal-small);
155
+ }
156
+
157
+ button.step {
158
+ width: 100%;
159
+ margin: 0;
160
+ padding: 0;
161
+ color: inherit;
162
+ font: inherit;
163
+ background: none;
164
+ border: none;
165
+ border-radius: var(--radius-input);
166
+ cursor: pointer;
167
+ }
168
+ button.step:hover .label {
169
+ color: var(--color-primary-text);
170
+ }
171
+ button.step:hover .marker {
172
+ background: var(--color-primary-hover);
173
+ }
174
+ button.step:focus-visible {
175
+ outline: var(--outline-width) solid var(--color-primary-base);
176
+ outline-offset: 4px;
177
+ }
178
+
179
+ .visually-hidden {
180
+ position: absolute;
181
+ width: 1px;
182
+ height: 1px;
183
+ overflow: hidden;
184
+ clip-path: inset(50%);
185
+ white-space: nowrap;
186
+ }
187
+ `
188
+ ];
189
+ }
190
+ stateOf(e, a, n) {
191
+ return e.error ? "error" : a < n ? "complete" : a === n ? "current" : "upcoming";
192
+ }
193
+ goTo(e) {
194
+ this.current = e.id, k(this, "kt-change", { id: e.id });
195
+ }
196
+ render() {
197
+ const e = f(), a = this.steps.findIndex((t) => t.id === this.current), n = {
198
+ complete: e.stepComplete,
199
+ current: e.stepCurrent,
200
+ upcoming: e.stepUpcoming,
201
+ error: e.stepError
202
+ };
203
+ return r`<ol part="list" aria-label=${this.label || p}>
204
+ ${this.steps.map((t, o) => {
205
+ const i = this.stateOf(t, o, a), u = i === "complete" ? r`<kt-icon name="check" size="14"></kt-icon>` : i === "error" ? r`<kt-icon name="circle-alert" size="14"></kt-icon>` : r`<span class="number">${o + 1}</span>`, h = r`<span part="marker" class="marker" aria-hidden="true">${u}</span>
206
+ <span class="text">
207
+ <span class="label">${t.label}</span>
208
+ ${t.description ? r`<span class="description">${t.description}</span>` : p}
209
+ <span class="visually-hidden">${n[i]}</span>
210
+ </span>`, b = this.navigable && o < a;
211
+ return r`<li
212
+ part="step"
213
+ data-state=${i}
214
+ aria-current=${o === a ? "step" : p}
215
+ >
216
+ ${b ? r`<button class="step" type="button" @click=${() => this.goTo(t)}>
217
+ ${h}
218
+ </button>` : r`<span class="step">${h}</span>`}
219
+ ${o < this.steps.length - 1 ? r`<span part="connector" class="connector" aria-hidden="true"></span>` : p}
220
+ </li>`;
221
+ })}
222
+ </ol>`;
223
+ }
224
+ }
225
+ c([
226
+ l({ attribute: !1 })
227
+ ], s.prototype, "steps");
228
+ c([
229
+ l({ type: String, reflect: !0 })
230
+ ], s.prototype, "current");
231
+ c([
232
+ l({ type: String })
233
+ ], s.prototype, "label");
234
+ c([
235
+ l({ type: String, reflect: !0 })
236
+ ], s.prototype, "orientation");
237
+ c([
238
+ l({ type: Boolean, reflect: !0 })
239
+ ], s.prototype, "navigable");
240
+ v("kt-steps", s);
241
+ export {
242
+ s as KtSteps
243
+ };
244
+ //# sourceMappingURL=kt-steps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kt-steps.js","sources":["../../../../src/components/navigation/kt-steps/kt-steps.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { KtElement, defineElement } from '#internal/kt-element';\nimport { emit } from '#internal/events';\nimport { strings } from '#internal/strings';\nimport '../../core/kt-icon/kt-icon.js';\n\nexport interface KtStep {\n readonly id: string;\n readonly label: string;\n /** A line under the label. */\n readonly description?: string;\n /** Something on this step needs fixing — a field it holds failed. */\n readonly error?: boolean;\n}\n\nexport type KtStepsOrientation = 'horizontal' | 'vertical';\n\ntype StepState = 'complete' | 'current' | 'upcoming' | 'error';\n\n/**\n * The steps of a flow — sign-up, checkout, onboarding — and where the reader\n * is in it.\n *\n * Steps before `current` are complete, `current` is current, the rest are to\n * come — all of them, while `current` names no step; a step with `error` shows as needing attention wherever it is. With\n * `navigable`, a completed step is a button that goes back to it; going\n * forward is the flow's job, not the stepper's.\n *\n * An ordered list: the number is the step's place, `aria-current=\"step\"`\n * marks the current one, and each state is said in words, not only shown.\n *\n * @element kt-steps\n *\n * @csspart list - The `<ol>`.\n * @csspart step - A step.\n * @csspart marker - A step's number, tick or alert.\n * @csspart connector - The line from a step to the next.\n *\n * @fires kt-change - A completed step was picked, with `navigable`. `detail: { id }`.\n *\n * @example\n * ```html\n * <kt-steps label=\"Sign-up\" current=\"billing\"></kt-steps>\n * <script>\n * steps.steps = [\n * { id: 'account', label: 'Account' },\n * { id: 'billing', label: 'Billing', description: 'Card or invoice' },\n * { id: 'team', label: 'Team' },\n * ];\n * </script>\n * ```\n */\nexport class KtSteps extends KtElement {\n static override styles = [\n KtElement.styles,\n css`\n :host {\n display: block;\n --kt-steps-marker: calc(28px * var(--density-scale, 1));\n }\n\n ol {\n display: flex;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n :host([orientation='vertical']) ol {\n flex-direction: column;\n }\n\n /* Across, the steps share the width evenly: a column each, the marker\n on top and the text centred under it. */\n li {\n position: relative;\n flex: 1 1 0;\n min-width: 0;\n }\n .step {\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n text-align: center;\n }\n :host([orientation='vertical']) li {\n flex: none;\n padding-bottom: 24px;\n }\n :host([orientation='vertical']) li:last-child {\n padding-bottom: 0;\n }\n :host([orientation='vertical']) .step {\n flex-direction: row;\n gap: 12px;\n align-items: flex-start;\n text-align: start;\n }\n\n /* The line to the next step, from marker to marker through their\n middle, clear of each: 8px across, 6px down. */\n .connector {\n position: absolute;\n top: calc(var(--kt-steps-marker) / 2 - 1px);\n left: calc(50% + var(--kt-steps-marker) / 2 + 8px);\n width: calc(100% - var(--kt-steps-marker) - 16px);\n height: 2px;\n background: var(--border-field);\n border-radius: var(--radius-full);\n }\n li[data-state='complete'] .connector {\n background: var(--color-primary-base);\n }\n :host([orientation='vertical']) .connector {\n top: calc(var(--kt-steps-marker) + 6px);\n left: calc(var(--kt-steps-marker) / 2 - 1px);\n width: 2px;\n height: calc(100% - var(--kt-steps-marker) - 12px);\n }\n\n /* A filled circle: the tick when done, the number otherwise. */\n .marker {\n display: grid;\n flex: none;\n place-items: center;\n width: var(--kt-steps-marker);\n height: var(--kt-steps-marker);\n color: var(--text-body);\n font: var(--font-normal-small);\n font-weight: 600;\n /* A field's border colour: a grey that reads on a card and a page,\n in both themes. */\n background: var(--border-field);\n border-radius: 50%;\n transition:\n background-color var(--duration-fast) var(--easing-standard),\n color var(--duration-fast) var(--easing-standard);\n }\n li[data-state='complete'] .marker,\n li[data-state='current'] .marker {\n color: var(--color-white);\n background: var(--color-primary-base);\n }\n li[data-state='error'] .marker {\n color: var(--color-white);\n background: var(--color-danger-base);\n }\n /* Trimmed to the digits' height, so the grid centres the ink, not a\n line box padded by the font's ascent and descent. */\n .number {\n display: block;\n line-height: 1;\n font-variant-numeric: tabular-nums;\n text-box: trim-both cap alphabetic;\n }\n /* Lucide's tick sits high in its square; this puts its ink on the\n marker's middle. */\n .marker kt-icon[name='check'] {\n translate: 0 0.5px;\n }\n\n .text {\n display: grid;\n gap: 2px;\n min-width: 0;\n padding: 0 4px;\n }\n :host([orientation='vertical']) .text {\n gap: 0;\n padding: 0;\n }\n .label {\n color: var(--text-muted);\n font: var(--font-normal-medium);\n }\n /* Down, as tall as the marker, so the label sits on its middle. */\n :host([orientation='vertical']) .label {\n display: flex;\n align-items: center;\n min-height: var(--kt-steps-marker);\n }\n li[data-state='current'] .label,\n li[data-state='complete'] .label {\n color: var(--text-body);\n }\n li[data-state='error'] .label {\n color: var(--color-danger-text);\n }\n .description {\n color: var(--text-muted);\n font: var(--font-normal-small);\n }\n\n button.step {\n width: 100%;\n margin: 0;\n padding: 0;\n color: inherit;\n font: inherit;\n background: none;\n border: none;\n border-radius: var(--radius-input);\n cursor: pointer;\n }\n button.step:hover .label {\n color: var(--color-primary-text);\n }\n button.step:hover .marker {\n background: var(--color-primary-hover);\n }\n button.step:focus-visible {\n outline: var(--outline-width) solid var(--color-primary-base);\n outline-offset: 4px;\n }\n\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n `,\n ];\n\n /** The steps, in order. Set as a property. */\n @property({ attribute: false })\n steps: readonly KtStep[] = [];\n\n /** The id of the step the reader is on. */\n @property({ type: String, reflect: true })\n current = '';\n\n /** Accessible name of the list: what the flow is. */\n @property({ type: String })\n label = '';\n\n @property({ type: String, reflect: true })\n orientation: KtStepsOrientation = 'horizontal';\n\n /** Completed steps become buttons that go back to them. */\n @property({ type: Boolean, reflect: true })\n navigable = false;\n\n private stateOf(step: KtStep, index: number, currentIndex: number): StepState {\n if (step.error) return 'error';\n if (index < currentIndex) return 'complete';\n return index === currentIndex ? 'current' : 'upcoming';\n }\n\n private goTo(step: KtStep): void {\n this.current = step.id;\n emit(this, 'kt-change', { id: step.id });\n }\n\n override render(): TemplateResult {\n const s = strings();\n const currentIndex = this.steps.findIndex((step) => step.id === this.current);\n const said: Record<StepState, string> = {\n complete: s.stepComplete,\n current: s.stepCurrent,\n upcoming: s.stepUpcoming,\n error: s.stepError,\n };\n\n return html`<ol part=\"list\" aria-label=${this.label || nothing}>\n ${this.steps.map((step, index) => {\n const state = this.stateOf(step, index, currentIndex);\n const marker =\n state === 'complete'\n ? html`<kt-icon name=\"check\" size=\"14\"></kt-icon>`\n : state === 'error'\n ? html`<kt-icon name=\"circle-alert\" size=\"14\"></kt-icon>`\n : html`<span class=\"number\">${index + 1}</span>`;\n const body = html`<span part=\"marker\" class=\"marker\" aria-hidden=\"true\">${marker}</span>\n <span class=\"text\">\n <span class=\"label\">${step.label}</span>\n ${step.description ? html`<span class=\"description\">${step.description}</span>` : nothing}\n <span class=\"visually-hidden\">${said[state]}</span>\n </span>`;\n const back = this.navigable && index < currentIndex;\n\n return html`<li\n part=\"step\"\n data-state=${state}\n aria-current=${index === currentIndex ? 'step' : nothing}\n >\n ${\n back\n ? html`<button class=\"step\" type=\"button\" @click=${() => this.goTo(step)}>\n ${body}\n </button>`\n : html`<span class=\"step\">${body}</span>`\n }\n ${index < this.steps.length - 1 ? html`<span part=\"connector\" class=\"connector\" aria-hidden=\"true\"></span>` : nothing}\n </li>`;\n })}\n </ol>`;\n }\n}\n\ndefineElement('kt-steps', KtSteps);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kt-steps': KtSteps;\n }\n}\n"],"names":["KtSteps","KtElement","css","step","index","currentIndex","emit","s","strings","said","html","nothing","state","marker","body","back","__decorateClass","property","defineElement"],"mappings":";;;;;;;;;;;AAqDO,MAAMA,UAAgBC,EAAU;AAAA,EAAhC,cAAA;AAAA,UAAA,GAAA,SAAA,GAgLL,KAAA,QAA2B,CAAA,GAI3B,KAAA,UAAU,IAIV,KAAA,QAAQ,IAGR,KAAA,cAAkC,cAIlC,KAAA,YAAY;AAAA,EAAA;AAAA,EA9LZ,OAAA;AAAA,SAAgB,SAAS;AAAA,MACvBA,EAAU;AAAA,MACVC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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EAwLX,WAAA,OAAA;AAGAgB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GA1L9BjB,EA2LX,WAAA,aAAA;AAIAgB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GA9L/BjB,EA+LX,WAAA,WAAA;AA2DFkB,EAAc,YAAYlB,CAAO;"}
@@ -2,9 +2,9 @@ import { css as y, html as a, nothing as n } from "lit";
2
2
  import { property as c, state as x } from "lit/decorators.js";
3
3
  import { classMap as f } from "lit/directives/class-map.js";
4
4
  import { styleMap as $ } from "lit/directives/style-map.js";
5
- import { K as b, d as k } from "../../../chunks/kt-element-T0VbIBNp.js";
5
+ import { K as b, d as k } from "../../../chunks/kt-element-COgh6Yr1.js";
6
6
  import { e as g } from "../../../chunks/events-r51msXNf.js";
7
- import { s as w } from "../../../chunks/index-TWJzttLX.js";
7
+ import { s as w } from "../../../chunks/index-BEWmAE0T.js";
8
8
  import "../../core/kt-icon/kt-icon.js";
9
9
  import "../../core/kt-badge/kt-badge.js";
10
10
  var A = Object.defineProperty, d = (p, e, t, o) => {
@@ -1,7 +1,7 @@
1
1
  import { css as u, html as l, nothing as p } from "lit";
2
2
  import { queryAll as h, property as n } from "lit/decorators.js";
3
3
  import { classMap as f } from "lit/directives/class-map.js";
4
- import { K as c, d as v } from "../../../chunks/kt-element-T0VbIBNp.js";
4
+ import { K as c, d as v } from "../../../chunks/kt-element-COgh6Yr1.js";
5
5
  import { e as m } from "../../../chunks/events-r51msXNf.js";
6
6
  import "../../core/kt-icon/kt-icon.js";
7
7
  import "../../feedback/kt-skeleton/kt-skeleton.js";
@@ -1,7 +1,7 @@
1
1
  import { css as p, html as c, nothing as n } from "lit";
2
2
  import { property as o } from "lit/decorators.js";
3
3
  import { classMap as b } from "lit/directives/class-map.js";
4
- import { K as u, d as g } from "../../../chunks/kt-element-T0VbIBNp.js";
4
+ import { K as u, d as g } from "../../../chunks/kt-element-COgh6Yr1.js";
5
5
  import { e as v } from "../../../chunks/events-r51msXNf.js";
6
6
  import "../../core/kt-icon/kt-icon.js";
7
7
  var m = Object.defineProperty, r = (l, e, i, s) => {
@@ -1,8 +1,8 @@
1
1
  import { css as c, html as h } from "lit";
2
2
  import { queryAssignedElements as g, property as l } from "lit/decorators.js";
3
- import { K as d, d as b } from "../../../chunks/kt-element-T0VbIBNp.js";
3
+ import { K as d, d as b } from "../../../chunks/kt-element-COgh6Yr1.js";
4
4
  import { e as p } from "../../../chunks/events-r51msXNf.js";
5
- import { s as v } from "../../../chunks/index-TWJzttLX.js";
5
+ import { s as v } from "../../../chunks/index-BEWmAE0T.js";
6
6
  import { KtToggleButton as f } from "../kt-toggle-button/kt-toggle-button.js";
7
7
  var m = Object.defineProperty, s = (n, t, e, r) => {
8
8
  for (var o = void 0, a = n.length - 1, u; a >= 0; a--)
@@ -1,6 +1,6 @@
1
1
  import { css as d, nothing as m, html as c } from "lit";
2
2
  import { property as n } from "lit/decorators.js";
3
- import { K as p, d as u } from "../../../chunks/kt-element-T0VbIBNp.js";
3
+ import { K as p, d as u } from "../../../chunks/kt-element-COgh6Yr1.js";
4
4
  import { e as f } from "../../../chunks/events-r51msXNf.js";
5
5
  import "../../core/kt-icon/kt-icon.js";
6
6
  var h = Object.defineProperty, i = (a, o, t, v) => {
@@ -0,0 +1,87 @@
1
+ import { type PropertyValues, type TemplateResult } from 'lit';
2
+ import { KtElement } from '#internal/kt-element';
3
+ import { type KtCommand } from '#internal/command-search';
4
+ import '../../core/kt-icon/kt-icon.js';
5
+ import '../../core/kt-kbd/kt-kbd.js';
6
+ export type { KtCommand } from '#internal/command-search';
7
+ /**
8
+ * The palette a product opens on Cmd+K: every action and page, a few
9
+ * keystrokes away.
10
+ *
11
+ * Give it `commands`; it lists them under their groups, narrows them as you
12
+ * type — every word, in any order, in the label, a keyword or the group,
13
+ * ignoring case and accents — and runs the one you pick with `kt-select`.
14
+ * Cmd+K or Ctrl+K opens and closes it from anywhere on the page; `hotkey`
15
+ * changes the key or, empty, turns it off.
16
+ *
17
+ * Built on the native `<dialog>`: the top layer, focus containment and the
18
+ * inert page come from the platform. The field is a combobox over a listbox,
19
+ * so a screen reader follows the active command as the arrows move.
20
+ *
21
+ * @element kt-command-palette
22
+ *
23
+ * @csspart dialog - The `<dialog>`.
24
+ * @csspart input - The search field.
25
+ * @csspart list - The scrolling list.
26
+ * @csspart footer - The keyboard hints.
27
+ *
28
+ * @fires kt-select - A command was run. `detail: { id, command }`.
29
+ * @fires kt-open - It opened.
30
+ * @fires kt-close - It closed.
31
+ *
32
+ * @example
33
+ * ```html
34
+ * <kt-command-palette></kt-command-palette>
35
+ * <script>
36
+ * palette.commands = [
37
+ * { id: 'new', label: 'New invoice', group: 'Create', shortcut: 'mod i' },
38
+ * { id: 'settings', label: 'Open settings', group: 'Navigate', icon: 'settings' },
39
+ * ];
40
+ * palette.addEventListener('kt-select', (e) => run(e.detail.id));
41
+ * </script>
42
+ * ```
43
+ */
44
+ export declare class KtCommandPalette extends KtElement {
45
+ static styles: import("lit").CSSResultGroup[];
46
+ /** What it can run. Set as a property: `palette.commands = [...]`. */
47
+ commands: readonly KtCommand[];
48
+ open: boolean;
49
+ /** Placeholder of the search field. Defaults to the translated string. */
50
+ placeholder: string;
51
+ /**
52
+ * The key that opens it with Cmd or Ctrl, from anywhere on the page. Empty
53
+ * turns the shortcut off — for a page with two palettes, or its own key.
54
+ */
55
+ hotkey: string;
56
+ private query;
57
+ private activeIndex;
58
+ private dialog;
59
+ private input;
60
+ private readonly listId;
61
+ /** Where the focus was before opening, to give it back on close. */
62
+ private returnFocus;
63
+ connectedCallback(): void;
64
+ disconnectedCallback(): void;
65
+ /** The commands the query keeps, best first. */
66
+ private get results();
67
+ willUpdate(changed: PropertyValues<this>): void;
68
+ updated(changed: PropertyValues<this>): void;
69
+ private firstEnabled;
70
+ /** The next enabled command from `from`, one way, wrapping; -1 when none is. */
71
+ private step;
72
+ private onDocumentKeyDown;
73
+ private onInput;
74
+ private onKeyDown;
75
+ private run;
76
+ private onDialogCancel;
77
+ /** The browser can close the dialog itself; the property follows. */
78
+ private onDialogClose;
79
+ private onDialogClick;
80
+ private optionId;
81
+ render(): TemplateResult;
82
+ }
83
+ declare global {
84
+ interface HTMLElementTagNameMap {
85
+ 'kt-command-palette': KtCommandPalette;
86
+ }
87
+ }