kanto-ds 1.0.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 (192) hide show
  1. package/LICENSE +26 -0
  2. package/README.md +155 -0
  3. package/dist/assets/fonts/README.md +19 -0
  4. package/dist/assets/fonts/manrope/OFL.txt +93 -0
  5. package/dist/assets/fonts/manrope/manrope-cyrillic-ext-wght-normal.woff2 +0 -0
  6. package/dist/assets/fonts/manrope/manrope-cyrillic-wght-normal.woff2 +0 -0
  7. package/dist/assets/fonts/manrope/manrope-latin-ext-wght-normal.woff2 +0 -0
  8. package/dist/assets/fonts/manrope/manrope-latin-wght-normal.woff2 +0 -0
  9. package/dist/assets/fonts/mulish/OFL.txt +93 -0
  10. package/dist/assets/fonts/mulish/mulish-cyrillic-ext-wght-italic.woff2 +0 -0
  11. package/dist/assets/fonts/mulish/mulish-cyrillic-ext-wght-normal.woff2 +0 -0
  12. package/dist/assets/fonts/mulish/mulish-cyrillic-wght-italic.woff2 +0 -0
  13. package/dist/assets/fonts/mulish/mulish-cyrillic-wght-normal.woff2 +0 -0
  14. package/dist/assets/fonts/mulish/mulish-latin-ext-wght-italic.woff2 +0 -0
  15. package/dist/assets/fonts/mulish/mulish-latin-ext-wght-normal.woff2 +0 -0
  16. package/dist/assets/fonts/mulish/mulish-latin-wght-italic.woff2 +0 -0
  17. package/dist/assets/fonts/mulish/mulish-latin-wght-normal.woff2 +0 -0
  18. package/dist/assets/fonts/source_code_pro/OFL.txt +93 -0
  19. package/dist/assets/fonts/source_code_pro/SourceCodePro-Regular.woff2 +0 -0
  20. package/dist/chunks/dialog-CPIfFIlF.js +29 -0
  21. package/dist/chunks/dialog-CPIfFIlF.js.map +1 -0
  22. package/dist/chunks/events-Bjl5Zmmq.js +18 -0
  23. package/dist/chunks/events-Bjl5Zmmq.js.map +1 -0
  24. package/dist/chunks/form-control-CxjBTt1c.js +17 -0
  25. package/dist/chunks/form-control-CxjBTt1c.js.map +1 -0
  26. package/dist/chunks/kt-element-CcMLO5e8.js +28 -0
  27. package/dist/chunks/kt-element-CcMLO5e8.js.map +1 -0
  28. package/dist/chunks/listbox-CUXYn_3S.js +101 -0
  29. package/dist/chunks/listbox-CUXYn_3S.js.map +1 -0
  30. package/dist/chunks/registry-X4LS9J5K.js +30 -0
  31. package/dist/chunks/registry-X4LS9J5K.js.map +1 -0
  32. package/dist/chunks/slots-BPbIdxAJ.js +7 -0
  33. package/dist/chunks/slots-BPbIdxAJ.js.map +1 -0
  34. package/dist/chunks/toaster-PmdKSV5x.js +40 -0
  35. package/dist/chunks/toaster-PmdKSV5x.js.map +1 -0
  36. package/dist/components/core/kt-avatar/kt-avatar.d.ts +49 -0
  37. package/dist/components/core/kt-avatar/kt-avatar.js +156 -0
  38. package/dist/components/core/kt-avatar/kt-avatar.js.map +1 -0
  39. package/dist/components/core/kt-badge/kt-badge.d.ts +77 -0
  40. package/dist/components/core/kt-badge/kt-badge.js +254 -0
  41. package/dist/components/core/kt-badge/kt-badge.js.map +1 -0
  42. package/dist/components/core/kt-button/kt-button.d.ts +71 -0
  43. package/dist/components/core/kt-button/kt-button.js +271 -0
  44. package/dist/components/core/kt-button/kt-button.js.map +1 -0
  45. package/dist/components/core/kt-card/kt-card.d.ts +62 -0
  46. package/dist/components/core/kt-card/kt-card.js +230 -0
  47. package/dist/components/core/kt-card/kt-card.js.map +1 -0
  48. package/dist/components/core/kt-code/kt-code.d.ts +55 -0
  49. package/dist/components/core/kt-code/kt-code.js +155 -0
  50. package/dist/components/core/kt-code/kt-code.js.map +1 -0
  51. package/dist/components/core/kt-icon/kt-icon.d.ts +44 -0
  52. package/dist/components/core/kt-icon/kt-icon.js +85 -0
  53. package/dist/components/core/kt-icon/kt-icon.js.map +1 -0
  54. package/dist/components/core/kt-kbd/kt-kbd.d.ts +38 -0
  55. package/dist/components/core/kt-kbd/kt-kbd.js +89 -0
  56. package/dist/components/core/kt-kbd/kt-kbd.js.map +1 -0
  57. package/dist/components/data/kt-chart/kt-chart.d.ts +99 -0
  58. package/dist/components/data/kt-chart/kt-chart.js +406 -0
  59. package/dist/components/data/kt-chart/kt-chart.js.map +1 -0
  60. package/dist/components/data/kt-meter/kt-meter.d.ts +63 -0
  61. package/dist/components/data/kt-meter/kt-meter.js +177 -0
  62. package/dist/components/data/kt-meter/kt-meter.js.map +1 -0
  63. package/dist/components/data/kt-pagination/kt-pagination.d.ts +35 -0
  64. package/dist/components/data/kt-pagination/kt-pagination.js +88 -0
  65. package/dist/components/data/kt-pagination/kt-pagination.js.map +1 -0
  66. package/dist/components/data/kt-stat/kt-stat.d.ts +60 -0
  67. package/dist/components/data/kt-stat/kt-stat.js +137 -0
  68. package/dist/components/data/kt-stat/kt-stat.js.map +1 -0
  69. package/dist/components/data/kt-table/kt-table.d.ts +99 -0
  70. package/dist/components/data/kt-table/kt-table.js +340 -0
  71. package/dist/components/data/kt-table/kt-table.js.map +1 -0
  72. package/dist/components/data/kt-timeline/kt-timeline.d.ts +78 -0
  73. package/dist/components/data/kt-timeline/kt-timeline.js +252 -0
  74. package/dist/components/data/kt-timeline/kt-timeline.js.map +1 -0
  75. package/dist/components/feedback/kt-alert/kt-alert.d.ts +46 -0
  76. package/dist/components/feedback/kt-alert/kt-alert.js +180 -0
  77. package/dist/components/feedback/kt-alert/kt-alert.js.map +1 -0
  78. package/dist/components/feedback/kt-empty-state/kt-empty-state.d.ts +40 -0
  79. package/dist/components/feedback/kt-empty-state/kt-empty-state.js +100 -0
  80. package/dist/components/feedback/kt-empty-state/kt-empty-state.js.map +1 -0
  81. package/dist/components/feedback/kt-progress-bar/kt-progress-bar.d.ts +53 -0
  82. package/dist/components/feedback/kt-progress-bar/kt-progress-bar.js +212 -0
  83. package/dist/components/feedback/kt-progress-bar/kt-progress-bar.js.map +1 -0
  84. package/dist/components/feedback/kt-skeleton/kt-skeleton.d.ts +43 -0
  85. package/dist/components/feedback/kt-skeleton/kt-skeleton.js +117 -0
  86. package/dist/components/feedback/kt-skeleton/kt-skeleton.js.map +1 -0
  87. package/dist/components/feedback/kt-toast/kt-toast.d.ts +57 -0
  88. package/dist/components/feedback/kt-toast/kt-toast.js +231 -0
  89. package/dist/components/feedback/kt-toast/kt-toast.js.map +1 -0
  90. package/dist/components/feedback/kt-toast-container/kt-toast-container.d.ts +60 -0
  91. package/dist/components/feedback/kt-toast-container/kt-toast-container.js +100 -0
  92. package/dist/components/feedback/kt-toast-container/kt-toast-container.js.map +1 -0
  93. package/dist/components/feedback/kt-toast-container/toaster.d.ts +37 -0
  94. package/dist/components/feedback/kt-tooltip/kt-tooltip.d.ts +57 -0
  95. package/dist/components/feedback/kt-tooltip/kt-tooltip.js +138 -0
  96. package/dist/components/feedback/kt-tooltip/kt-tooltip.js.map +1 -0
  97. package/dist/components/forms/kt-drag-drop/kt-drag-drop.d.ts +68 -0
  98. package/dist/components/forms/kt-drag-drop/kt-drag-drop.js +287 -0
  99. package/dist/components/forms/kt-drag-drop/kt-drag-drop.js.map +1 -0
  100. package/dist/components/forms/kt-form/kt-form.d.ts +75 -0
  101. package/dist/components/forms/kt-form/kt-form.js +187 -0
  102. package/dist/components/forms/kt-form/kt-form.js.map +1 -0
  103. package/dist/components/forms/kt-input/kt-input.d.ts +112 -0
  104. package/dist/components/forms/kt-input/kt-input.js +556 -0
  105. package/dist/components/forms/kt-input/kt-input.js.map +1 -0
  106. package/dist/components/forms/kt-input-menu/kt-input-menu.d.ts +60 -0
  107. package/dist/components/forms/kt-input-menu/kt-input-menu.js +313 -0
  108. package/dist/components/forms/kt-input-menu/kt-input-menu.js.map +1 -0
  109. package/dist/components/forms/kt-label-input/kt-label-input.d.ts +42 -0
  110. package/dist/components/forms/kt-label-input/kt-label-input.js +69 -0
  111. package/dist/components/forms/kt-label-input/kt-label-input.js.map +1 -0
  112. package/dist/components/forms/kt-select/kt-select.d.ts +80 -0
  113. package/dist/components/forms/kt-select/kt-select.js +334 -0
  114. package/dist/components/forms/kt-select/kt-select.js.map +1 -0
  115. package/dist/components/forms/kt-textarea/kt-textarea.d.ts +62 -0
  116. package/dist/components/forms/kt-textarea/kt-textarea.js +239 -0
  117. package/dist/components/forms/kt-textarea/kt-textarea.js.map +1 -0
  118. package/dist/components/forms/kt-toggle/kt-toggle.d.ts +53 -0
  119. package/dist/components/forms/kt-toggle/kt-toggle.js +170 -0
  120. package/dist/components/forms/kt-toggle/kt-toggle.js.map +1 -0
  121. package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.d.ts +45 -0
  122. package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.js +93 -0
  123. package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.js.map +1 -0
  124. package/dist/components/navigation/kt-header/kt-header.d.ts +67 -0
  125. package/dist/components/navigation/kt-header/kt-header.js +195 -0
  126. package/dist/components/navigation/kt-header/kt-header.js.map +1 -0
  127. package/dist/components/navigation/kt-page-header/kt-page-header.d.ts +48 -0
  128. package/dist/components/navigation/kt-page-header/kt-page-header.js +111 -0
  129. package/dist/components/navigation/kt-page-header/kt-page-header.js.map +1 -0
  130. package/dist/components/navigation/kt-segmented-control/kt-segmented-control.d.ts +63 -0
  131. package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js +228 -0
  132. package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js.map +1 -0
  133. package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.d.ts +94 -0
  134. package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js +265 -0
  135. package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js.map +1 -0
  136. package/dist/components/navigation/kt-tabs/kt-tabs.d.ts +64 -0
  137. package/dist/components/navigation/kt-tabs/kt-tabs.js +175 -0
  138. package/dist/components/navigation/kt-tabs/kt-tabs.js.map +1 -0
  139. package/dist/components/navigation/kt-toggle-button/kt-toggle-button.d.ts +50 -0
  140. package/dist/components/navigation/kt-toggle-button/kt-toggle-button.js +191 -0
  141. package/dist/components/navigation/kt-toggle-button/kt-toggle-button.js.map +1 -0
  142. package/dist/components/navigation/kt-toggle-button-group/kt-toggle-button-group.d.ts +55 -0
  143. package/dist/components/navigation/kt-toggle-button-group/kt-toggle-button-group.js +128 -0
  144. package/dist/components/navigation/kt-toggle-button-group/kt-toggle-button-group.js.map +1 -0
  145. package/dist/components/overlays/kt-collapsible/kt-collapsible.d.ts +42 -0
  146. package/dist/components/overlays/kt-collapsible/kt-collapsible.js +107 -0
  147. package/dist/components/overlays/kt-collapsible/kt-collapsible.js.map +1 -0
  148. package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.d.ts +56 -0
  149. package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.js +155 -0
  150. package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.js.map +1 -0
  151. package/dist/components/overlays/kt-dropdown/kt-dropdown.d.ts +64 -0
  152. package/dist/components/overlays/kt-dropdown/kt-dropdown.js +212 -0
  153. package/dist/components/overlays/kt-dropdown/kt-dropdown.js.map +1 -0
  154. package/dist/components/overlays/kt-modal/kt-modal.d.ts +61 -0
  155. package/dist/components/overlays/kt-modal/kt-modal.js +207 -0
  156. package/dist/components/overlays/kt-modal/kt-modal.js.map +1 -0
  157. package/dist/components/overlays/kt-side-panel/kt-side-panel.d.ts +52 -0
  158. package/dist/components/overlays/kt-side-panel/kt-side-panel.js +178 -0
  159. package/dist/components/overlays/kt-side-panel/kt-side-panel.js.map +1 -0
  160. package/dist/icons/defaults.d.ts +25 -0
  161. package/dist/icons/index.d.ts +3 -0
  162. package/dist/icons/index.js +37 -0
  163. package/dist/icons/index.js.map +1 -0
  164. package/dist/icons/registry.d.ts +38 -0
  165. package/dist/index.d.ts +81 -0
  166. package/dist/index.js +96 -0
  167. package/dist/index.js.map +1 -0
  168. package/dist/internal/countries.d.ts +37 -0
  169. package/dist/internal/dialog.d.ts +22 -0
  170. package/dist/internal/events.d.ts +14 -0
  171. package/dist/internal/form-control.d.ts +27 -0
  172. package/dist/internal/format.d.ts +8 -0
  173. package/dist/internal/kt-element.d.ts +22 -0
  174. package/dist/internal/listbox.d.ts +36 -0
  175. package/dist/internal/slots.d.ts +10 -0
  176. package/dist/react/index.d.ts +208 -0
  177. package/dist/react/index.js +314 -0
  178. package/dist/react/index.js.map +1 -0
  179. package/dist/styles.css +13 -0
  180. package/dist/tokens/README.md +63 -0
  181. package/dist/tokens/base.css +79 -0
  182. package/dist/tokens/colors.css +125 -0
  183. package/dist/tokens/fonts.css +136 -0
  184. package/dist/tokens/index.css +12 -0
  185. package/dist/tokens/responsive.css +108 -0
  186. package/dist/tokens/spacing.css +66 -0
  187. package/dist/tokens/theme-light.css +144 -0
  188. package/dist/tokens/typography.css +41 -0
  189. package/dist/vue/index.d.ts +143 -0
  190. package/dist/vue/index.js +56 -0
  191. package/dist/vue/index.js.map +1 -0
  192. package/package.json +296 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kt-form.js","sources":["../../../../src/components/forms/kt-form/kt-form.ts"],"sourcesContent":["import { css, html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, queryAssignedElements, state } from 'lit/decorators.js';\nimport { KtElement, defineElement } from '#internal/kt-element';\nimport { hasAssignedContent } from '#internal/slots';\nimport '../../feedback/kt-skeleton/kt-skeleton.js';\n\n/** Anything the panel can switch off along with itself. */\ninterface Disableable extends HTMLElement {\n disabled?: boolean;\n}\n\n/**\n * A panel grouping related fields.\n *\n * It sits one step above the page on `--surface-form`, so the fields inside —\n * filled at `--surface-field` — read as wells recessed into it rather than as\n * boxes floating on it.\n *\n * **Put it inside your own `<form>`.** It renders a `<fieldset>`, not a form:\n * Kanto fields are form-associated custom elements, and a control finds its\n * form by walking its *own* tree. A `<form>` inside this element's shadow root\n * would not own anything slotted into it, and `new FormData(form)` would come\n * back empty. The `<form>` above stays in charge of submission, validation and\n * reset; this owns the grouping and the look.\n *\n * @element kt-form\n *\n * @slot - The fields.\n * @slot heading - Replaces the `heading` attribute, for markup.\n * @slot footer - Actions, right-aligned. Hidden when empty.\n *\n * @csspart base - The `<fieldset>`.\n * @csspart header - The heading and description.\n * @csspart fields - The field column.\n * @csspart footer - The action row.\n *\n * @example\n * ```html\n * <form>\n * <kt-form heading=\"Identity\" description=\"How we address you.\">\n * <kt-label-input label=\"Company\" required>\n * <kt-input name=\"company\" required></kt-input>\n * </kt-label-input>\n * <kt-button slot=\"footer\" type=\"submit\">Save</kt-button>\n * </kt-form>\n * </form>\n * ```\n */\nexport class KtForm extends KtElement {\n static override styles = [\n KtElement.styles,\n css`\n :host {\n display: block;\n }\n\n fieldset {\n display: flex;\n flex-direction: column;\n gap: var(--gap-form);\n min-width: 0;\n margin: 0;\n padding: var(--padding-card);\n background-color: var(--surface-form);\n border: var(--border-width) solid var(--border-subtle);\n border-radius: var(--border-radius-card);\n }\n\n .header {\n display: flex;\n flex-direction: column;\n gap: var(--gap-element);\n }\n\n /* A legend is the accessible name for the group, so it stays in the\n accessibility tree even when there is nothing to show. */\n legend {\n padding: 0;\n color: var(--text-body);\n font: var(--font-title-h6);\n }\n\n legend.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 .description {\n margin: 0;\n color: var(--text-muted);\n font: var(--font-normal-regular);\n }\n\n .fields {\n display: flex;\n flex-direction: column;\n gap: var(--gap-form);\n min-width: 0;\n }\n\n .placeholder {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n\n .footer {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\n gap: var(--gap-button);\n }\n\n /* Collapsed from JS: a wrapper around a <slot> always has the slot as a\n child, so :has(*) cannot tell an empty slot from a filled one. */\n .footer.empty {\n display: none;\n }\n\n /* While loading, the real fields stay in the DOM — and keep their state\n — but step aside for the placeholders. */\n :host([loading]) ::slotted(*) {\n display: none;\n }\n\n :host([disabled]) fieldset {\n opacity: 0.6;\n }\n `,\n ];\n\n @queryAssignedElements()\n private fields!: HTMLElement[];\n\n @state()\n private hasFooter = false;\n\n /** Group heading. Also the fieldset's accessible name. */\n @property({ type: String })\n heading = '';\n\n @property({ type: String })\n description = '';\n\n /** Replaces the fields with placeholders. */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /** Switches off every field in the panel. */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /** How many placeholder fields `loading` draws. */\n @property({ type: Number, attribute: 'loading-fields' })\n loadingFields = 3;\n\n override updated(changed: PropertyValues<this>): void {\n if (changed.has('disabled')) this.syncDisabled();\n }\n\n /**\n * A native `<fieldset disabled>` switches off its descendants, but slotted\n * fields are not descendants of the fieldset in their own tree — the shadow\n * boundary sits between them — so the platform never reaches them. Walk the\n * slotted controls and set it directly.\n */\n /**\n * The initial `slotchange` is queued as a microtask and can land after the\n * first render has settled, so read the slots once directly as well.\n */\n override firstUpdated(): void {\n this.readSlots();\n this.syncDisabled();\n }\n\n private readSlots(): void {\n this.hasFooter = hasAssignedContent(\n this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"footer\"]'),\n );\n }\n\n private onFooterSlotChange(): void {\n this.readSlots();\n }\n\n private syncDisabled(): void {\n for (const field of this.fields ?? []) {\n if ('disabled' in field) (field as Disableable).disabled = this.disabled;\n for (const nested of field.querySelectorAll<Disableable>('*')) {\n if ('disabled' in nested) nested.disabled = this.disabled;\n }\n }\n }\n\n override render(): TemplateResult {\n const hasHeader = Boolean(this.heading) || Boolean(this.description);\n\n return html`<fieldset part=\"base\" ?disabled=${this.disabled}>\n <legend class=${this.heading ? '' : 'visually-hidden'}>\n <slot name=\"heading\">${this.heading || 'Form section'}</slot>\n </legend>\n\n ${\n hasHeader && this.description\n ? html`<div part=\"header\" class=\"header\">\n <p class=\"description\">${this.description}</p>\n </div>`\n : nothing\n }\n\n <div part=\"fields\" class=\"fields\">\n ${\n this.loading\n ? Array.from(\n { length: this.loadingFields },\n () =>\n html`<div class=\"placeholder\" aria-hidden=\"true\">\n <kt-skeleton width=\"30%\" height=\"14px\"></kt-skeleton>\n <kt-skeleton variant=\"rect\" height=\"40px\"></kt-skeleton>\n </div>`,\n )\n : nothing\n }\n <slot @slotchange=${this.syncDisabled}></slot>\n </div>\n\n <div part=\"footer\" class=${this.hasFooter ? 'footer' : 'footer empty'}>\n <slot name=\"footer\" @slotchange=${this.onFooterSlotChange}></slot>\n </div>\n </fieldset>`;\n }\n}\n\ndefineElement('kt-form', KtForm);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kt-form': KtForm;\n }\n}\n"],"names":["KtForm","KtElement","css","changed","hasAssignedContent","field","nested","hasHeader","html","nothing","__decorateClass","queryAssignedElements","state","property","defineElement"],"mappings":"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"}
@@ -0,0 +1,112 @@
1
+ import { type PropertyValues, type TemplateResult } from 'lit';
2
+ import { KtElement } from '#internal/kt-element';
3
+ import { type KtCountry } from '#internal/countries';
4
+ import '../../core/kt-icon/kt-icon.js';
5
+ export type KtInputSize = 'small' | 'medium' | 'large';
6
+ /**
7
+ * A single-line text field.
8
+ *
9
+ * Borderless by design: the field is a fill on `--color-dark-12` that gains a
10
+ * 2px *outline* — grey on hover, primary on focus, danger on error. An outline
11
+ * sits outside the box, so nothing reflows when the state changes.
12
+ *
13
+ * The element is form-associated: it serialises into `FormData` under its
14
+ * `name`, resets with the form, and reports validity like a native input.
15
+ *
16
+ * @element kt-input
17
+ *
18
+ * @csspart base - The field container.
19
+ * @csspart control - The native `<input>`.
20
+ * @csspart actions - The trailing icon row.
21
+ *
22
+ * @fires kt-input - On every keystroke. `detail: { value }`.
23
+ * @fires kt-change - When the value is committed (blur or Enter). `detail: { value }`.
24
+ * @fires kt-clear - The clear button was pressed.
25
+ *
26
+ * @example
27
+ * ```html
28
+ * <kt-input placeholder="Search everything..." icon="search"></kt-input>
29
+ * <kt-input type="password" name="password"></kt-input>
30
+ * <kt-input error="Invalid email address" value="not-an-address"></kt-input>
31
+ * ```
32
+ */
33
+ export declare class KtInput extends KtElement {
34
+ static readonly formAssociated = true;
35
+ static styles: import("lit").CSSResultGroup[];
36
+ private input;
37
+ private internals;
38
+ /** True while a `password` field is showing its contents. */
39
+ private passwordVisible;
40
+ private countryOpen;
41
+ private countryQuery;
42
+ /** The field's value. The `value` attribute seeds it and acts as the reset value. */
43
+ value: string;
44
+ name: string;
45
+ /** Any native input type. `password` adds the reveal toggle. */
46
+ type: string;
47
+ placeholder: string;
48
+ /** Field height: 32 / 40 / 48px at the desktop scale. */
49
+ size: KtInputSize;
50
+ disabled: boolean;
51
+ readonly: boolean;
52
+ required: boolean;
53
+ /** Trailing Lucide icon, kebab-case. */
54
+ icon: string;
55
+ /** Error message. A non-empty value puts the field in its error state. */
56
+ error: string;
57
+ /** Shows the clear button once there is something to clear. */
58
+ clearable: boolean;
59
+ /** Accessible name, when no `<kt-label-input>` wraps the field. */
60
+ label: string;
61
+ autocomplete: string;
62
+ maxlength?: number;
63
+ /**
64
+ * Countries offered in phone mode. Replace it to widen the list.
65
+ */
66
+ countries: readonly KtCountry[];
67
+ /** Selected country in phone mode, as an ISO 3166-1 alpha-2 code. */
68
+ country: string;
69
+ /** The value the enclosing form resets to. */
70
+ private defaultValue;
71
+ connectedCallback(): void;
72
+ willUpdate(changed: PropertyValues<this>): void;
73
+ private refreshValidity;
74
+ disconnectedCallback(): void;
75
+ /** Called by the platform when the enclosing form is reset. */
76
+ formResetCallback(): void;
77
+ /** Called by the platform when the browser restores a session. */
78
+ formStateRestoreCallback(state: string): void;
79
+ focus(options?: FocusOptions): void;
80
+ blur(): void;
81
+ /** Selects the field's contents, as `HTMLInputElement.select()` does. */
82
+ select(): void;
83
+ /** Phone mode: the country picker, digit-only storage and grouped display. */
84
+ private get isPhone();
85
+ private get selectedCountry();
86
+ /**
87
+ * What the form receives. In phone mode that is the full international
88
+ * number — submitting national digits alone would throw away the country
89
+ * the user picked.
90
+ */
91
+ private get formValue();
92
+ private get displayValue();
93
+ private get showClear();
94
+ private get resolvedType();
95
+ private onInput;
96
+ private toggleCountryPanel;
97
+ private selectCountry;
98
+ private closeCountryPanel;
99
+ private onCountryKeyDown;
100
+ private renderCountryPicker;
101
+ private onChange;
102
+ private clear;
103
+ private togglePassword;
104
+ /** Clicking the padding around the input should focus it, as on a native field. */
105
+ private onFieldPointerDown;
106
+ render(): TemplateResult;
107
+ }
108
+ declare global {
109
+ interface HTMLElementTagNameMap {
110
+ 'kt-input': KtInput;
111
+ }
112
+ }
@@ -0,0 +1,556 @@
1
+ import { css as v, nothing as a, html as l } from "lit";
2
+ import { query as w, state as p, property as n } from "lit/decorators.js";
3
+ import { classMap as f } from "lit/directives/class-map.js";
4
+ import { live as x } from "lit/directives/live.js";
5
+ import { K as m, d as $ } from "../../../chunks/kt-element-CcMLO5e8.js";
6
+ import { e as d } from "../../../chunks/events-Bjl5Zmmq.js";
7
+ import { a as C, s as b, b as k } from "../../../chunks/form-control-CxjBTt1c.js";
8
+ import "../../core/kt-icon/kt-icon.js";
9
+ const P = [
10
+ { id: "us", name: "United States", dialCode: "1", format: "123-456-7890" },
11
+ { id: "gb", name: "United Kingdom", dialCode: "44", format: "7123 456789" },
12
+ { id: "de", name: "Germany", dialCode: "49", format: "1234 567890" },
13
+ { id: "fr", name: "France", dialCode: "33", format: "1 23 45 67 89" },
14
+ { id: "be", name: "Belgium", dialCode: "32", format: "1 23 45 67 89" },
15
+ { id: "ch", name: "Switzerland", dialCode: "41", format: "12 345 67 89" }
16
+ ], O = 127462, S = 65;
17
+ function g(s) {
18
+ return /^[a-z]{2}$/i.test(s) ? String.fromCodePoint(
19
+ ...[...s.toUpperCase()].map(
20
+ (e) => O + e.charCodeAt(0) - S
21
+ )
22
+ ) : "";
23
+ }
24
+ function V(s) {
25
+ return s.replace(/\D/g, "");
26
+ }
27
+ function z(s, e) {
28
+ if (!s) return "";
29
+ const r = [];
30
+ let t = s;
31
+ if (e?.id === "fr")
32
+ for (r.push(t.slice(0, 1)), t = t.slice(1); t; )
33
+ r.push(t.slice(0, 2)), t = t.slice(2);
34
+ else if (e?.id === "us" || e?.id === "ca") {
35
+ for (const u of [3, 3, 4]) {
36
+ if (!t) break;
37
+ r.push(t.slice(0, u)), t = t.slice(u);
38
+ }
39
+ t && r.push(t);
40
+ } else
41
+ for (; t; )
42
+ r.push(t.slice(0, 3)), t = t.slice(3);
43
+ return r.filter(Boolean).join(" ");
44
+ }
45
+ function E(s, e) {
46
+ const r = e.trim().toLowerCase();
47
+ return r ? s.filter(
48
+ (t) => t.name.toLowerCase().includes(r) || t.dialCode.includes(r.replace(/^\+/, "")) || t.id === r
49
+ ) : s;
50
+ }
51
+ var A = Object.defineProperty, i = (s, e, r, t) => {
52
+ for (var u = void 0, h = s.length - 1, y; h >= 0; h--)
53
+ (y = s[h]) && (u = y(e, r, u) || u);
54
+ return u && A(e, r, u), u;
55
+ };
56
+ const c = 18;
57
+ class o extends m {
58
+ constructor() {
59
+ super(...arguments), this.internals = null, this.passwordVisible = !1, this.countryOpen = !1, this.countryQuery = "", this.value = "", this.name = "", this.type = "text", this.placeholder = "", this.size = "medium", this.disabled = !1, this.readonly = !1, this.required = !1, this.icon = "", this.error = "", this.clearable = !0, this.label = "", this.autocomplete = "", this.countries = P, this.country = "us", this.defaultValue = "", this.closeCountryPanel = (e) => {
60
+ e.composedPath().includes(this) || (this.countryOpen = !1);
61
+ };
62
+ }
63
+ static {
64
+ this.formAssociated = !0;
65
+ }
66
+ static {
67
+ this.styles = [
68
+ m.styles,
69
+ v`
70
+ :host {
71
+ display: block;
72
+ }
73
+
74
+ .field {
75
+ position: relative;
76
+ display: inline-flex;
77
+ align-items: center;
78
+ width: 100%;
79
+ height: var(--button-height);
80
+ padding: 0 var(--button-padding-x);
81
+ gap: var(--gap-button);
82
+ background-color: var(--surface-field);
83
+ border-radius: var(--radius-input);
84
+ /* A resting hairline. A field is a fill on --surface-field, which is
85
+ one ramp step from the page in dark and almost the same colour in
86
+ light — so on a card or inside a modal it simply disappeared and
87
+ read as a bare native control.
88
+
89
+ A border rather than an outline, because the control inside fills
90
+ the field exactly and a coincident outline is painted over by the
91
+ native widget. A border insets the control by its own width, so it
92
+ cannot be covered. box-sizing: border-box keeps the outer size.
93
+
94
+ The hover and focus rings stay outlines on top of it, and the
95
+ transparent resting outline is what they animate from: without it
96
+ outline-color starts at the initial value, which resolves to the
97
+ text colour, and hover flashed near-white before settling. */
98
+ border: var(--border-width) solid var(--border-field);
99
+ outline: var(--outline-width) solid transparent;
100
+ transition: outline-color var(--duration-instant);
101
+ }
102
+
103
+ /* Outline, never border: it sits outside the box, so hover and focus
104
+ change nothing about the layout. */
105
+ .field:hover {
106
+ outline: var(--outline-width) solid var(--color-text-700);
107
+ }
108
+ .field:focus-within {
109
+ outline: var(--outline-width) solid var(--color-primary-base);
110
+ }
111
+
112
+ .small {
113
+ height: var(--button-height-small);
114
+ }
115
+ .large {
116
+ height: var(--button-height-large);
117
+ }
118
+
119
+ .error,
120
+ .error:hover,
121
+ .error:focus-within {
122
+ outline: var(--outline-width) solid var(--color-danger-base);
123
+ }
124
+ .error input {
125
+ color: var(--color-danger-base);
126
+ }
127
+
128
+ .disabled {
129
+ background-color: var(--color-dark-14);
130
+ pointer-events: none;
131
+ }
132
+ .disabled input {
133
+ color: var(--text-disabled);
134
+ }
135
+
136
+ input {
137
+ width: 100%;
138
+ min-width: 0;
139
+ padding: 0;
140
+ color: var(--text-body);
141
+ font: var(--font-input);
142
+ background: transparent;
143
+ border: none;
144
+ outline: none;
145
+ }
146
+
147
+ input::placeholder {
148
+ color: var(--color-text-500);
149
+ }
150
+
151
+ /* The clear button is ours; the browser's is redundant. */
152
+ input::-webkit-search-cancel-button {
153
+ display: none;
154
+ }
155
+
156
+ .actions {
157
+ display: flex;
158
+ flex: none;
159
+ align-items: center;
160
+ gap: var(--gap-button);
161
+ }
162
+
163
+ .icon-button {
164
+ display: inline-flex;
165
+ align-items: center;
166
+ padding: 0;
167
+ color: var(--text-body);
168
+ background: none;
169
+ border: none;
170
+ cursor: pointer;
171
+ }
172
+
173
+ .icon-button:focus-visible {
174
+ outline: var(--outline-width) solid var(--color-primary-base);
175
+ outline-offset: 2px;
176
+ border-radius: 2px;
177
+ }
178
+
179
+ .clear {
180
+ transition: transform var(--duration-instant) ease-in-out;
181
+ }
182
+ .clear:hover {
183
+ transform: rotate(90deg);
184
+ }
185
+
186
+ .adornment {
187
+ display: flex;
188
+ align-items: center;
189
+ color: var(--text-muted);
190
+ }
191
+
192
+ .error-icon {
193
+ color: var(--color-danger-base);
194
+ }
195
+
196
+ /* === PHONE MODE === */
197
+ .country {
198
+ display: inline-flex;
199
+ flex: none;
200
+ align-items: center;
201
+ justify-content: center;
202
+ gap: var(--gap-element);
203
+ height: 100%;
204
+ margin-right: var(--button-padding-x);
205
+ padding: 0 var(--button-padding-x) 0 0;
206
+ color: var(--text-body);
207
+ background: none;
208
+ border: none;
209
+ border-right: var(--border-width) solid var(--color-dark-16);
210
+ cursor: pointer;
211
+ font: var(--font-normal-regular);
212
+ user-select: none;
213
+ }
214
+
215
+ .country:focus-visible {
216
+ outline: var(--outline-width) solid var(--color-primary-base);
217
+ outline-offset: -2px;
218
+ }
219
+
220
+ .chevron {
221
+ display: inline-flex;
222
+ transform-origin: 50% 50%;
223
+ transition: transform var(--duration-fast) ease-in-out;
224
+ }
225
+ .chevron.open {
226
+ transform: scaleY(-1);
227
+ }
228
+
229
+ .dial {
230
+ color: var(--text-muted);
231
+ }
232
+
233
+ .country-panel {
234
+ position: absolute;
235
+ top: calc(100% + 6px);
236
+ left: 0;
237
+ z-index: var(--z-dropdown);
238
+ display: flex;
239
+ flex-direction: column;
240
+ gap: var(--gap-element);
241
+ width: 280px;
242
+ max-height: 225px;
243
+ padding: var(--padding-expand);
244
+ background: var(--color-dark-20);
245
+ border-radius: var(--radius-input);
246
+ }
247
+
248
+ .country-search {
249
+ width: 100%;
250
+ height: var(--button-height-small);
251
+ padding: 0 12px;
252
+ color: var(--text-body);
253
+ font: var(--font-normal-regular);
254
+ background: var(--color-dark-12);
255
+ border: none;
256
+ border-radius: var(--radius-input);
257
+ outline: none;
258
+ }
259
+
260
+ .country-list {
261
+ display: flex;
262
+ flex: 1;
263
+ flex-direction: column;
264
+ gap: var(--gap-element);
265
+ margin: 0;
266
+ padding: 0;
267
+ overflow-y: auto;
268
+ list-style: none;
269
+ scrollbar-width: thin;
270
+ }
271
+
272
+ .country-item {
273
+ display: flex;
274
+ align-items: center;
275
+ gap: 8px;
276
+ padding: 8px 12px;
277
+ border-radius: var(--radius-input);
278
+ cursor: pointer;
279
+ font: var(--font-normal-regular);
280
+ }
281
+ .country-item:hover,
282
+ .country-item[aria-selected='true'] {
283
+ background: var(--color-dark-23);
284
+ }
285
+
286
+ .country-name {
287
+ flex: 1;
288
+ }
289
+
290
+ .country-empty {
291
+ padding: 8px 12px;
292
+ color: var(--text-muted);
293
+ font: var(--font-normal-small);
294
+ }
295
+ `
296
+ ];
297
+ }
298
+ connectedCallback() {
299
+ super.connectedCallback(), document.addEventListener("pointerdown", this.closeCountryPanel), this.internals ??= C(this), this.defaultValue = this.value, b(this.internals, this.formValue);
300
+ }
301
+ willUpdate(e) {
302
+ (e.has("value") || e.has("required") || e.has("error") || e.has("country")) && (b(this.internals, this.value), this.refreshValidity());
303
+ }
304
+ refreshValidity() {
305
+ const e = this.required && this.value.length === 0, r = this.error || (e ? "This field is required." : "");
306
+ k(
307
+ this.internals,
308
+ { valueMissing: e, customError: !!this.error },
309
+ r
310
+ );
311
+ }
312
+ disconnectedCallback() {
313
+ super.disconnectedCallback(), document.removeEventListener("pointerdown", this.closeCountryPanel);
314
+ }
315
+ /** Called by the platform when the enclosing form is reset. */
316
+ formResetCallback() {
317
+ this.value = this.defaultValue, this.passwordVisible = !1;
318
+ }
319
+ /** Called by the platform when the browser restores a session. */
320
+ formStateRestoreCallback(e) {
321
+ this.value = e;
322
+ }
323
+ focus(e) {
324
+ this.input?.focus(e);
325
+ }
326
+ blur() {
327
+ this.input?.blur();
328
+ }
329
+ /** Selects the field's contents, as `HTMLInputElement.select()` does. */
330
+ select() {
331
+ this.input?.select();
332
+ }
333
+ /** Phone mode: the country picker, digit-only storage and grouped display. */
334
+ get isPhone() {
335
+ return this.type === "tel";
336
+ }
337
+ get selectedCountry() {
338
+ return this.countries.find((e) => e.id === this.country);
339
+ }
340
+ /**
341
+ * What the form receives. In phone mode that is the full international
342
+ * number — submitting national digits alone would throw away the country
343
+ * the user picked.
344
+ */
345
+ get formValue() {
346
+ return !this.isPhone || !this.value ? this.value : `+${this.selectedCountry?.dialCode ?? ""}${this.value}`;
347
+ }
348
+ get displayValue() {
349
+ return this.isPhone ? z(this.value, this.selectedCountry) : this.value;
350
+ }
351
+ get showClear() {
352
+ return this.clearable && this.value.length > 0 && !this.readonly && !this.disabled;
353
+ }
354
+ get resolvedType() {
355
+ return this.isPhone ? "text" : this.type !== "password" ? this.type : this.passwordVisible ? "text" : "password";
356
+ }
357
+ onInput(e) {
358
+ const r = e.target.value;
359
+ this.value = this.isPhone ? V(r) : r, d(this, "kt-input", { value: this.value });
360
+ }
361
+ toggleCountryPanel() {
362
+ this.countryOpen = !this.countryOpen, this.countryQuery = "";
363
+ }
364
+ selectCountry(e) {
365
+ this.country = e.id, this.countryOpen = !1, this.countryQuery = "", d(this, "kt-country-change", { country: e.id, dialCode: e.dialCode }), this.focus();
366
+ }
367
+ onCountryKeyDown(e) {
368
+ e.key === "Escape" && this.countryOpen && (e.stopPropagation(), this.countryOpen = !1, this.shadowRoot?.querySelector(".country")?.focus());
369
+ }
370
+ renderCountryPicker() {
371
+ const e = this.selectedCountry, r = E(this.countries, this.countryQuery);
372
+ return l`<button
373
+ type="button"
374
+ class="country"
375
+ aria-haspopup="listbox"
376
+ aria-expanded=${this.countryOpen ? "true" : "false"}
377
+ aria-label=${`Country code: ${e?.name ?? "none"}`}
378
+ ?disabled=${this.disabled || this.readonly}
379
+ @click=${this.toggleCountryPanel}
380
+ >
381
+ <span aria-hidden="true">${g(this.country)}</span>
382
+ <span class="dial">+${e?.dialCode ?? ""}</span>
383
+ <span class=${f({ chevron: !0, open: this.countryOpen })}>
384
+ <kt-icon name="chevron-down" size="14"></kt-icon>
385
+ </span>
386
+ </button>
387
+ ${this.countryOpen ? l`<div class="country-panel" @pointerdown=${(t) => t.stopPropagation()}>
388
+ <input
389
+ class="country-search"
390
+ placeholder="Search country or dial code"
391
+ .value=${this.countryQuery}
392
+ aria-label="Search country or dial code"
393
+ @input=${(t) => {
394
+ this.countryQuery = t.target.value;
395
+ }}
396
+ />
397
+ <ul class="country-list" role="listbox">
398
+ ${r.length === 0 ? l`<li class="country-empty">No country found</li>` : r.map(
399
+ (t) => l`<li
400
+ class="country-item"
401
+ role="option"
402
+ aria-selected=${t.id === this.country ? "true" : "false"}
403
+ @click=${() => this.selectCountry(t)}
404
+ >
405
+ <span aria-hidden="true">${g(t.id)}</span>
406
+ <span class="country-name">${t.name}</span>
407
+ <span class="dial">+${t.dialCode}</span>
408
+ </li>`
409
+ )}
410
+ </ul>
411
+ </div>` : a}`;
412
+ }
413
+ onChange(e) {
414
+ e.stopPropagation(), d(this, "kt-change", { value: this.value });
415
+ }
416
+ clear() {
417
+ this.value = "", d(this, "kt-clear"), d(this, "kt-input", { value: "" }), d(this, "kt-change", { value: "" }), this.focus();
418
+ }
419
+ togglePassword() {
420
+ this.passwordVisible = !this.passwordVisible;
421
+ }
422
+ /** Clicking the padding around the input should focus it, as on a native field. */
423
+ onFieldPointerDown(e) {
424
+ e.target !== this.input && (e.target.closest("button") || (e.preventDefault(), this.focus()));
425
+ }
426
+ render() {
427
+ const e = this.type === "password" || !!this.icon || !!this.error || this.showClear;
428
+ return l`<div
429
+ part="base"
430
+ class=${f({
431
+ field: !0,
432
+ [this.size]: !0,
433
+ error: !!this.error,
434
+ disabled: this.disabled
435
+ })}
436
+ @pointerdown=${this.onFieldPointerDown}
437
+ @keydown=${this.onCountryKeyDown}
438
+ >
439
+ ${this.isPhone ? this.renderCountryPicker() : a}
440
+
441
+ <input
442
+ part="control"
443
+ type=${this.resolvedType}
444
+ name=${this.name || a}
445
+ .value=${x(this.displayValue)}
446
+ placeholder=${this.placeholder || this.selectedCountry?.format || a}
447
+ autocomplete=${this.autocomplete || a}
448
+ inputmode=${this.isPhone ? "tel" : a}
449
+ maxlength=${this.maxlength ?? a}
450
+ aria-label=${this.label || a}
451
+ aria-invalid=${this.error ? "true" : a}
452
+ aria-errormessage=${this.error || a}
453
+ ?disabled=${this.disabled}
454
+ ?readonly=${this.readonly}
455
+ ?required=${this.required}
456
+ @input=${this.onInput}
457
+ @change=${this.onChange}
458
+ />
459
+
460
+ ${e ? l`<div part="actions" class="actions">
461
+ ${this.type === "password" ? l`<button
462
+ type="button"
463
+ class="icon-button"
464
+ tabindex="-1"
465
+ aria-label=${this.passwordVisible ? "Hide password" : "Show password"}
466
+ @click=${this.togglePassword}
467
+ >
468
+ <kt-icon
469
+ name=${this.passwordVisible ? "eye-off" : "eye"}
470
+ size=${c}
471
+ ></kt-icon>
472
+ </button>` : a}
473
+ ${this.icon ? l`<span class="adornment">
474
+ <kt-icon name=${this.icon} size=${c}></kt-icon>
475
+ </span>` : a}
476
+ ${this.error ? l`<span class="adornment error-icon" title=${this.error}>
477
+ <kt-icon name="circle-alert" size=${c} label=${this.error}></kt-icon>
478
+ </span>` : a}
479
+ ${this.showClear ? l`<button
480
+ type="button"
481
+ class="icon-button clear"
482
+ tabindex="-1"
483
+ aria-label="Clear"
484
+ @click=${this.clear}
485
+ >
486
+ <kt-icon name="x" size=${c}></kt-icon>
487
+ </button>` : a}
488
+ </div>` : a}
489
+ </div>`;
490
+ }
491
+ }
492
+ i([
493
+ w("input")
494
+ ], o.prototype, "input");
495
+ i([
496
+ p()
497
+ ], o.prototype, "passwordVisible");
498
+ i([
499
+ p()
500
+ ], o.prototype, "countryOpen");
501
+ i([
502
+ p()
503
+ ], o.prototype, "countryQuery");
504
+ i([
505
+ n({ type: String })
506
+ ], o.prototype, "value");
507
+ i([
508
+ n({ type: String })
509
+ ], o.prototype, "name");
510
+ i([
511
+ n({ type: String })
512
+ ], o.prototype, "type");
513
+ i([
514
+ n({ type: String })
515
+ ], o.prototype, "placeholder");
516
+ i([
517
+ n({ type: String, reflect: !0 })
518
+ ], o.prototype, "size");
519
+ i([
520
+ n({ type: Boolean, reflect: !0 })
521
+ ], o.prototype, "disabled");
522
+ i([
523
+ n({ type: Boolean, reflect: !0 })
524
+ ], o.prototype, "readonly");
525
+ i([
526
+ n({ type: Boolean, reflect: !0 })
527
+ ], o.prototype, "required");
528
+ i([
529
+ n({ type: String })
530
+ ], o.prototype, "icon");
531
+ i([
532
+ n({ type: String, reflect: !0 })
533
+ ], o.prototype, "error");
534
+ i([
535
+ n({ type: Boolean })
536
+ ], o.prototype, "clearable");
537
+ i([
538
+ n({ type: String })
539
+ ], o.prototype, "label");
540
+ i([
541
+ n({ type: String })
542
+ ], o.prototype, "autocomplete");
543
+ i([
544
+ n({ type: Number })
545
+ ], o.prototype, "maxlength");
546
+ i([
547
+ n({ attribute: !1 })
548
+ ], o.prototype, "countries");
549
+ i([
550
+ n({ type: String })
551
+ ], o.prototype, "country");
552
+ $("kt-input", o);
553
+ export {
554
+ o as KtInput
555
+ };
556
+ //# sourceMappingURL=kt-input.js.map