kanto-ds 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -14
- package/dist/AGENTS.md +157 -0
- package/dist/cdn/kanto.min.js +4743 -932
- package/dist/chunks/block-Cci-Kff_.js +69 -0
- package/dist/chunks/block-Cci-Kff_.js.map +1 -0
- package/dist/chunks/defaults-yhaR6U65.js +70 -0
- package/dist/chunks/{defaults-Cpeg13O5.js.map → defaults-yhaR6U65.js.map} +1 -1
- package/dist/chunks/heading-DsnZsfg-.js +21 -0
- package/dist/chunks/heading-DsnZsfg-.js.map +1 -0
- package/dist/chunks/{index-TWJzttLX.js → index-1ZFgagWW.js} +37 -12
- package/dist/chunks/index-1ZFgagWW.js.map +1 -0
- package/dist/chunks/indicator-B_Rs8F92.js +49 -0
- package/dist/chunks/indicator-B_Rs8F92.js.map +1 -0
- package/dist/chunks/{kt-calendar-CtwOby1R.js → kt-calendar-SK8eapuy.js} +3 -3
- package/dist/chunks/{kt-calendar-CtwOby1R.js.map → kt-calendar-SK8eapuy.js.map} +1 -1
- package/dist/chunks/kt-color-picker-BoezCAmx.js +365 -0
- package/dist/chunks/kt-color-picker-BoezCAmx.js.map +1 -0
- package/dist/chunks/{kt-element-T0VbIBNp.js → kt-element-DvWtPQ1Y.js} +2 -2
- package/dist/chunks/{kt-element-T0VbIBNp.js.map → kt-element-DvWtPQ1Y.js.map} +1 -1
- package/dist/chunks/motion-ChVUUO7O.js +28 -0
- package/dist/chunks/motion-ChVUUO7O.js.map +1 -0
- package/dist/chunks/numbers-QyecMiSJ.js +9 -0
- package/dist/chunks/numbers-QyecMiSJ.js.map +1 -0
- package/dist/chunks/{segmented-field-BBXR4XFL.js → segmented-field-T_Zo6lc1.js} +2 -2
- package/dist/chunks/{segmented-field-BBXR4XFL.js.map → segmented-field-T_Zo6lc1.js.map} +1 -1
- package/dist/chunks/{typed-date-CPAUNHzr.js → typed-date-CaU0kXoY.js} +2 -2
- package/dist/chunks/{typed-date-CPAUNHzr.js.map → typed-date-CaU0kXoY.js.map} +1 -1
- package/dist/components/blocks/kt-auth-form/kt-auth-form.d.ts +143 -0
- package/dist/components/blocks/kt-auth-form/kt-auth-form.js +368 -0
- package/dist/components/blocks/kt-auth-form/kt-auth-form.js.map +1 -0
- package/dist/components/blocks/kt-blog-post/kt-blog-post.d.ts +75 -0
- package/dist/components/blocks/kt-blog-post/kt-blog-post.js +285 -0
- package/dist/components/blocks/kt-blog-post/kt-blog-post.js.map +1 -0
- package/dist/components/blocks/kt-cta/kt-cta.d.ts +51 -0
- package/dist/components/blocks/kt-cta/kt-cta.js +126 -0
- package/dist/components/blocks/kt-cta/kt-cta.js.map +1 -0
- package/dist/components/blocks/kt-empty-page/kt-empty-page.d.ts +75 -0
- package/dist/components/blocks/kt-empty-page/kt-empty-page.js +245 -0
- package/dist/components/blocks/kt-empty-page/kt-empty-page.js.map +1 -0
- package/dist/components/blocks/kt-error-page/kt-error-page.d.ts +65 -0
- package/dist/components/blocks/kt-error-page/kt-error-page.js +177 -0
- package/dist/components/blocks/kt-error-page/kt-error-page.js.map +1 -0
- package/dist/components/blocks/kt-faq/kt-faq.d.ts +61 -0
- package/dist/components/blocks/kt-faq/kt-faq.js +129 -0
- package/dist/components/blocks/kt-faq/kt-faq.js.map +1 -0
- package/dist/components/blocks/kt-feature-grid/kt-feature-grid.d.ts +59 -0
- package/dist/components/blocks/kt-feature-grid/kt-feature-grid.js +166 -0
- package/dist/components/blocks/kt-feature-grid/kt-feature-grid.js.map +1 -0
- package/dist/components/blocks/kt-hero/kt-hero.d.ts +51 -0
- package/dist/components/blocks/kt-hero/kt-hero.js +138 -0
- package/dist/components/blocks/kt-hero/kt-hero.js.map +1 -0
- package/dist/components/blocks/kt-logo-cloud/kt-logo-cloud.d.ts +46 -0
- package/dist/components/blocks/kt-logo-cloud/kt-logo-cloud.js +100 -0
- package/dist/components/blocks/kt-logo-cloud/kt-logo-cloud.js.map +1 -0
- package/dist/components/blocks/kt-newsletter/kt-newsletter.d.ts +85 -0
- package/dist/components/blocks/kt-newsletter/kt-newsletter.js +247 -0
- package/dist/components/blocks/kt-newsletter/kt-newsletter.js.map +1 -0
- package/dist/components/blocks/kt-post-grid/kt-post-grid.d.ts +73 -0
- package/dist/components/blocks/kt-post-grid/kt-post-grid.js +249 -0
- package/dist/components/blocks/kt-post-grid/kt-post-grid.js.map +1 -0
- package/dist/components/blocks/kt-pricing-table/kt-pricing-table.d.ts +102 -0
- package/dist/components/blocks/kt-pricing-table/kt-pricing-table.js +307 -0
- package/dist/components/blocks/kt-pricing-table/kt-pricing-table.js.map +1 -0
- package/dist/components/blocks/kt-settings-section/kt-settings-section.d.ts +52 -0
- package/dist/components/blocks/kt-settings-section/kt-settings-section.js +158 -0
- package/dist/components/blocks/kt-settings-section/kt-settings-section.js.map +1 -0
- package/dist/components/blocks/kt-testimonials/kt-testimonials.d.ts +56 -0
- package/dist/components/blocks/kt-testimonials/kt-testimonials.js +161 -0
- package/dist/components/blocks/kt-testimonials/kt-testimonials.js.map +1 -0
- package/dist/components/core/kt-avatar/kt-avatar.js +2 -2
- package/dist/components/core/kt-avatar-group/kt-avatar-group.d.ts +42 -0
- package/dist/components/core/kt-avatar-group/kt-avatar-group.js +97 -0
- package/dist/components/core/kt-avatar-group/kt-avatar-group.js.map +1 -0
- package/dist/components/core/kt-badge/kt-badge.js +2 -2
- package/dist/components/core/kt-button/flights.d.ts +27 -0
- package/dist/components/core/kt-button/kt-button.d.ts +52 -1
- package/dist/components/core/kt-button/kt-button.js +353 -77
- package/dist/components/core/kt-button/kt-button.js.map +1 -1
- package/dist/components/core/kt-button/morph.d.ts +27 -0
- package/dist/components/core/kt-card/kt-card.js +1 -1
- package/dist/components/core/kt-code/kt-code.d.ts +2 -1
- package/dist/components/core/kt-code/kt-code.js +52 -37
- package/dist/components/core/kt-code/kt-code.js.map +1 -1
- package/dist/components/core/kt-copy-button/kt-copy-button.d.ts +47 -0
- package/dist/components/core/kt-copy-button/kt-copy-button.js +74 -0
- package/dist/components/core/kt-copy-button/kt-copy-button.js.map +1 -0
- package/dist/components/core/kt-icon/kt-icon.js +2 -2
- package/dist/components/core/kt-kbd/kt-kbd.js +1 -1
- package/dist/components/core/kt-split-button/kt-split-button.js +2 -2
- package/dist/components/data/kt-chart/kt-chart.js +2 -2
- package/dist/components/data/kt-chat-message/kt-chat-message.d.ts +60 -0
- package/dist/components/data/kt-chat-message/kt-chat-message.js +204 -0
- package/dist/components/data/kt-chat-message/kt-chat-message.js.map +1 -0
- package/dist/components/data/kt-description-list/kt-description-list.d.ts +56 -0
- package/dist/components/data/kt-description-list/kt-description-list.js +120 -0
- package/dist/components/data/kt-description-list/kt-description-list.js.map +1 -0
- package/dist/components/data/kt-meter/kt-meter.js +8 -6
- package/dist/components/data/kt-meter/kt-meter.js.map +1 -1
- package/dist/components/data/kt-pagination/kt-pagination.js +2 -2
- package/dist/components/data/kt-stat/kt-stat.d.ts +3 -1
- package/dist/components/data/kt-stat/kt-stat.js +31 -16
- package/dist/components/data/kt-stat/kt-stat.js.map +1 -1
- package/dist/components/data/kt-table/kt-table.js +2 -2
- package/dist/components/data/kt-timeline/kt-timeline.js +2 -2
- package/dist/components/data/kt-timeline/kt-timeline.js.map +1 -1
- package/dist/components/data/kt-tree/kt-tree.d.ts +69 -0
- package/dist/components/data/kt-tree/kt-tree.js +208 -0
- package/dist/components/data/kt-tree/kt-tree.js.map +1 -0
- package/dist/components/feedback/kt-alert/kt-alert.js +2 -2
- package/dist/components/feedback/kt-empty-state/kt-empty-state.js +1 -1
- package/dist/components/feedback/kt-progress-bar/kt-progress-bar.js +1 -1
- package/dist/components/feedback/kt-skeleton/kt-skeleton.js +1 -1
- package/dist/components/feedback/kt-toast/kt-toast.js +2 -2
- package/dist/components/feedback/kt-toast-container/kt-toast-container.d.ts +8 -1
- package/dist/components/feedback/kt-toast-container/kt-toast-container.js +65 -26
- package/dist/components/feedback/kt-toast-container/kt-toast-container.js.map +1 -1
- package/dist/components/feedback/kt-tooltip/kt-tooltip.js +1 -1
- package/dist/components/forms/kt-calendar/kt-calendar.js +3 -3
- package/dist/components/forms/kt-checkbox/kt-checkbox.d.ts +2 -0
- package/dist/components/forms/kt-checkbox/kt-checkbox.js +19 -8
- package/dist/components/forms/kt-checkbox/kt-checkbox.js.map +1 -1
- package/dist/components/forms/kt-color-picker/kt-color-picker.d.ts +66 -0
- package/dist/components/forms/kt-color-picker/kt-color-picker.js +14 -0
- package/dist/components/forms/kt-color-picker/kt-color-picker.js.map +1 -0
- package/dist/components/forms/kt-date-input/kt-date-input.js +5 -5
- package/dist/components/forms/kt-date-picker/kt-date-picker.js +4 -4
- package/dist/components/forms/kt-drag-drop/kt-drag-drop.js +2 -2
- package/dist/components/forms/kt-form/kt-form.js +2 -2
- package/dist/components/forms/kt-input/kt-input.js +2 -2
- package/dist/components/forms/kt-input-menu/kt-input-menu.js +2 -2
- package/dist/components/forms/kt-label-input/kt-label-input.js +1 -1
- package/dist/components/forms/kt-multi-select/kt-multi-select.js +2 -2
- package/dist/components/forms/kt-number-input/kt-number-input.d.ts +92 -0
- package/dist/components/forms/kt-number-input/kt-number-input.js +366 -0
- package/dist/components/forms/kt-number-input/kt-number-input.js.map +1 -0
- package/dist/components/forms/kt-otp-input/kt-otp-input.d.ts +74 -0
- package/dist/components/forms/kt-otp-input/kt-otp-input.js +232 -0
- package/dist/components/forms/kt-otp-input/kt-otp-input.js.map +1 -0
- package/dist/components/forms/kt-prompt-input/kt-prompt-input.d.ts +74 -0
- package/dist/components/forms/kt-prompt-input/kt-prompt-input.js +213 -0
- package/dist/components/forms/kt-prompt-input/kt-prompt-input.js.map +1 -0
- package/dist/components/forms/kt-radio-group/kt-radio-group.js +2 -2
- package/dist/components/forms/kt-select/kt-select.js +2 -2
- package/dist/components/forms/kt-slider/kt-slider.d.ts +69 -0
- package/dist/components/forms/kt-slider/kt-slider.js +252 -0
- package/dist/components/forms/kt-slider/kt-slider.js.map +1 -0
- package/dist/components/forms/kt-textarea/kt-textarea.js +2 -2
- package/dist/components/forms/kt-time-input/kt-time-input.js +3 -3
- package/dist/components/forms/kt-toggle/kt-toggle.js +1 -1
- package/dist/components/navigation/kt-app-shell/kt-app-shell.d.ts +85 -0
- package/dist/components/navigation/kt-app-shell/kt-app-shell.js +220 -0
- package/dist/components/navigation/kt-app-shell/kt-app-shell.js.map +1 -0
- package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.js +2 -2
- package/dist/components/navigation/kt-footer/kt-footer.d.ts +82 -0
- package/dist/components/navigation/kt-footer/kt-footer.js +220 -0
- package/dist/components/navigation/kt-footer/kt-footer.js.map +1 -0
- package/dist/components/navigation/kt-header/kt-header.js +2 -2
- package/dist/components/navigation/kt-page-header/kt-page-header.js +2 -2
- package/dist/components/navigation/kt-page-header/kt-page-header.js.map +1 -1
- package/dist/components/navigation/kt-segmented-control/kt-segmented-control.d.ts +1 -0
- package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js +81 -44
- package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js.map +1 -1
- package/dist/components/navigation/kt-steps/kt-steps.d.ts +68 -0
- package/dist/components/navigation/kt-steps/kt-steps.js +286 -0
- package/dist/components/navigation/kt-steps/kt-steps.js.map +1 -0
- package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js +3 -3
- package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js.map +1 -1
- package/dist/components/navigation/kt-tabs/kt-tabs.d.ts +1 -0
- package/dist/components/navigation/kt-tabs/kt-tabs.js +92 -64
- package/dist/components/navigation/kt-tabs/kt-tabs.js.map +1 -1
- package/dist/components/navigation/kt-toggle-button/kt-toggle-button.js +1 -1
- package/dist/components/navigation/kt-toggle-button-group/kt-toggle-button-group.js +2 -2
- package/dist/components/navigation/kt-user-menu/kt-user-menu.d.ts +86 -0
- package/dist/components/navigation/kt-user-menu/kt-user-menu.js +298 -0
- package/dist/components/navigation/kt-user-menu/kt-user-menu.js.map +1 -0
- package/dist/components/overlays/kt-accordion/kt-accordion.d.ts +47 -0
- package/dist/components/overlays/kt-accordion/kt-accordion.js +80 -0
- package/dist/components/overlays/kt-accordion/kt-accordion.js.map +1 -0
- package/dist/components/overlays/kt-collapsible/kt-collapsible.d.ts +17 -1
- package/dist/components/overlays/kt-collapsible/kt-collapsible.js +87 -32
- package/dist/components/overlays/kt-collapsible/kt-collapsible.js.map +1 -1
- package/dist/components/overlays/kt-command-palette/kt-command-palette.d.ts +87 -0
- package/dist/components/overlays/kt-command-palette/kt-command-palette.js +370 -0
- package/dist/components/overlays/kt-command-palette/kt-command-palette.js.map +1 -0
- package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.js +2 -2
- package/dist/components/overlays/kt-dropdown/kt-dropdown.js +2 -2
- package/dist/components/overlays/kt-modal/kt-modal.js +2 -2
- package/dist/components/overlays/kt-side-panel/kt-side-panel.js +2 -2
- package/dist/components/overlays/kt-tour/kt-tour.d.ts +77 -0
- package/dist/components/overlays/kt-tour/kt-tour.js +200 -0
- package/dist/components/overlays/kt-tour/kt-tour.js.map +1 -0
- package/dist/custom-elements.json +16427 -8061
- package/dist/docs/kt-accordion.md +49 -0
- package/dist/docs/kt-app-shell.md +89 -0
- package/dist/docs/kt-auth-form.md +111 -0
- package/dist/docs/kt-avatar-group.md +49 -0
- package/dist/docs/kt-blog-post.md +77 -0
- package/dist/docs/kt-button.md +21 -0
- package/dist/docs/kt-chat-message.md +68 -0
- package/dist/docs/kt-color-picker.md +67 -0
- package/dist/docs/kt-command-palette.md +99 -0
- package/dist/docs/kt-copy-button.md +50 -0
- package/dist/docs/kt-cta.md +45 -0
- package/dist/docs/kt-description-list.md +58 -0
- package/dist/docs/kt-empty-page.md +92 -0
- package/dist/docs/kt-error-page.md +64 -0
- package/dist/docs/kt-faq.md +54 -0
- package/dist/docs/kt-feature-grid.md +53 -0
- package/dist/docs/kt-footer.md +115 -0
- package/dist/docs/kt-hero.md +53 -0
- package/dist/docs/kt-logo-cloud.md +41 -0
- package/dist/docs/kt-newsletter.md +69 -0
- package/dist/docs/kt-number-input.md +77 -0
- package/dist/docs/kt-otp-input.md +68 -0
- package/dist/docs/kt-post-grid.md +66 -0
- package/dist/docs/kt-pricing-table.md +101 -0
- package/dist/docs/kt-prompt-input.md +86 -0
- package/dist/docs/kt-settings-section.md +65 -0
- package/dist/docs/kt-slider.md +76 -0
- package/dist/docs/kt-steps.md +79 -0
- package/dist/docs/kt-testimonials.md +52 -0
- package/dist/docs/kt-tour.md +75 -0
- package/dist/docs/kt-tree.md +83 -0
- package/dist/docs/kt-user-menu.md +77 -0
- package/dist/icons/defaults.d.ts +2 -0
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +56 -0
- package/dist/index.js +225 -284
- package/dist/index.js.map +1 -1
- package/dist/internal/block.d.ts +23 -0
- package/dist/internal/command-search.d.ts +27 -0
- package/dist/internal/heading.d.ts +8 -0
- package/dist/internal/indicator.d.ts +34 -0
- package/dist/internal/motion.d.ts +25 -0
- package/dist/internal/numbers.d.ts +2 -0
- package/dist/internal/strings.d.ts +36 -0
- package/dist/react/index.d.ts +165 -0
- package/dist/react/index.js +420 -171
- package/dist/react/index.js.map +1 -1
- package/dist/react/jsx.d.ts +128 -1
- package/dist/strings/index.js +1 -1
- package/dist/tokens/base.css +35 -2
- package/dist/vscode.css-custom-data.json +165 -19
- package/dist/vscode.html-custom-data.json +1023 -149
- package/dist/vue/index.d.ts +62 -0
- package/dist/vue/index.js +39 -8
- package/dist/vue/index.js.map +1 -1
- package/dist/web-types.json +3238 -836
- package/package.json +128 -3
- package/dist/chunks/defaults-Cpeg13O5.js +0 -68
- package/dist/chunks/index-TWJzttLX.js.map +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/theme/accent.ts","../src/theme/appearance.ts"],"sourcesContent":["/**\n * The accent colour: one colour in, every input the token layer reads out,\n * each at the contrast Kanto promises.\n *\n * Self-contained on purpose — no imports — so `scripts/generate-accents.js`\n * runs it straight from source under Node.\n */\n\n/** An sRGB colour, each channel 0–255. */\nexport type KtRgb = readonly [number, number, number];\ntype Oklch = readonly [number, number, number]; // L 0–1, C, H in degrees\n\nconst toLinear = (c: number) => {\n const v = c / 255;\n return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;\n};\nconst fromLinear = (c: number) =>\n 255 * (c <= 0.0031308 ? 12.92 * c : 1.055 * c ** (1 / 2.4) - 0.055);\n\nfunction toOklch([r, g, b]: KtRgb): Oklch {\n const [R, G, B] = [r, g, b].map(toLinear) as [number, number, number];\n const l = Math.cbrt(0.4122214708 * R + 0.5363325363 * G + 0.0514459929 * B);\n const m = Math.cbrt(0.2119034982 * R + 0.6806995451 * G + 0.1073969566 * B);\n const s = Math.cbrt(0.0883024619 * R + 0.2817188376 * G + 0.6299787005 * B);\n const L = 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;\n const a = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;\n const bb = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;\n return [L, Math.hypot(a, bb), ((Math.atan2(bb, a) * 180) / Math.PI + 360) % 360];\n}\n\n/** Unclamped: a channel outside 0–255 means the colour is outside sRGB. */\nfunction fromOklch([L, C, H]: Oklch): KtRgb {\n const a = C * Math.cos((H * Math.PI) / 180);\n const b = C * Math.sin((H * Math.PI) / 180);\n const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;\n const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;\n const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;\n return [\n fromLinear(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),\n fromLinear(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),\n fromLinear(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s),\n ];\n}\n\nconst inGamut = (rgb: KtRgb) => rgb.every((c) => c >= -0.5 && c <= 255.5);\n\n/** The most chroma sRGB holds at this lightness and hue, up to `limit`. */\nfunction fitChroma(L: number, H: number, limit: number): number {\n if (inGamut(fromOklch([L, limit, H]))) return limit;\n let low = 0;\n let high = limit;\n for (let i = 0; i < 24; i += 1) {\n const mid = (low + high) / 2;\n if (inGamut(fromOklch([L, mid, H]))) low = mid;\n else high = mid;\n }\n return low;\n}\n\nconst round255 = (rgb: KtRgb): KtRgb =>\n rgb.map((c) => Math.min(255, Math.max(0, Math.round(c)))) as unknown as KtRgb;\n\nfunction luminance(rgb: KtRgb): number {\n const [r, g, b] = rgb.map(toLinear) as [number, number, number];\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n/** The WCAG contrast ratio of two colours. */\nexport function contrastRatio(a: KtRgb, b: KtRgb): number {\n const [high, low] = [luminance(a), luminance(b)].sort((x, y) => y - x) as [number, number];\n return (high + 0.05) / (low + 0.05);\n}\n\n/** `top` at `alpha` over `bottom`, blended in sRGB as browsers paint it. */\nconst over = (top: KtRgb, alpha: number, bottom: KtRgb): KtRgb =>\n top.map((c, i) => c * alpha + bottom[i]! * (1 - alpha)) as unknown as KtRgb;\n\nconst hex = (rgb: KtRgb) =>\n `#${round255(rgb)\n .map((c) => c.toString(16).padStart(2, '0'))\n .join('')}`;\n\n/** Reads `#rgb`, `#rrggbb`, `rgb()`/`rgba()` and `oklch()`; throws on anything else. */\nexport function parseColor(input: string): KtRgb {\n const text = input.trim().toLowerCase();\n let match = /^#([0-9a-f]{3}|[0-9a-f]{6})$/.exec(text);\n if (match) {\n const digits = match[1]!.length === 3 ? [...match[1]!].map((d) => d + d).join('') : match[1]!;\n return [0, 2, 4].map((i) => parseInt(digits.slice(i, i + 2), 16)) as unknown as KtRgb;\n }\n match =\n /^rgba?\\(\\s*(\\d*\\.?\\d+)[\\s,]+(\\d*\\.?\\d+)[\\s,]+(\\d*\\.?\\d+)(?:\\s*[,/]\\s*\\d*\\.?\\d+%?)?\\s*\\)$/.exec(\n text,\n );\n if (match) {\n const rgb = match.slice(1, 4).map(Number) as unknown as KtRgb;\n if (rgb.every((c) => c <= 255)) return rgb;\n }\n match =\n /^oklch\\(\\s*(\\d*\\.?\\d+)(%?)\\s+(\\d*\\.?\\d+)\\s+(\\d*\\.?\\d+)(?:deg)?\\s*(?:\\/\\s*\\d*\\.?\\d+%?\\s*)?\\)$/.exec(\n text,\n );\n if (match) {\n const L = Number(match[1]) / (match[2] ? 100 : 1);\n const H = Number(match[4]);\n if (L <= 1) return round255(fromOklch([L, fitChroma(L, H, Number(match[3])), H]));\n }\n throw new TypeError(`Not a colour Kanto can read: \"${input}\". Use #rrggbb, rgb() or oklch().`);\n}\n\n/** What the token layer reads for an accent. */\nexport interface KtAccentPalette {\n /** Solid fill; carries white text at 4.5:1 or more. */\n readonly base: string;\n /** Fill on hover, a step darker. */\n readonly hover: string;\n /** The accent as text or an icon in the dark theme. */\n readonly textDark: string;\n /** The accent as text or an icon in the light theme. */\n readonly textLight: string;\n /** The translucent wash behind secondary buttons on hover: the fill at 16%. */\n readonly wash: string;\n /** The hue, in degrees, the neutral ramp is tinted with. */\n readonly neutralHue: number;\n /** How much of the ramp's tint to keep: 0 for a grey accent, 1 for a vivid one. */\n readonly neutralChroma: number;\n}\n\n/** The violet Kanto ships, as literal values: what the tokens fall back to. */\nexport const KT_DEFAULT_ACCENT: KtAccentPalette = {\n base: '#5f5dea',\n hover: '#5856e0',\n textDark: '#8e97ff',\n textLight: '#4f30ef',\n wash: 'rgba(111, 116, 246, 0.16)',\n neutralHue: 278,\n neutralChroma: 1,\n};\n\n/** The presets `accents.css` carries, each from a reference colour. */\nexport const KT_ACCENTS: readonly { id: string; label: string; color: string }[] = [\n { id: 'violet', label: 'Violet', color: '#5f5dea' },\n { id: 'blue', label: 'Blue', color: '#1f6feb' },\n { id: 'teal', label: 'Teal', color: '#0d9488' },\n { id: 'green', label: 'Green', color: '#16a34a' },\n { id: 'orange', label: 'Orange', color: '#ea580c' },\n { id: 'pink', label: 'Pink', color: '#db2777' },\n { id: 'slate', label: 'Slate', color: '#64748b' },\n];\n\n/** The neutral steps text reads on, as [L, C, hue offset] — `--color-dark-20` per theme. */\nconst DARK_GROUND: Oklch = [0.3074, 0.018, 16.5];\nconst LIGHT_GROUNDS: Oklch[] = [\n [1, 0, 0],\n [0.9023, 0.0081, 8.2],\n];\nconst WHITE_TEXT: KtRgb = [244, 244, 245];\n/** 4.5:1, with room for the rounding to hex and the browser's own. */\nconst TARGET = 4.6;\n\n/** Every token input for `color`, solved in OKLCH for the contrast Kanto promises. */\nexport function accentPalette(color: string): KtAccentPalette {\n const [inL, inC, inH] = toOklch(parseColor(color));\n const hue = inC < 0.0005 ? 0 : inH;\n const neutralChroma = Math.round(Math.min(1, inC / 0.08) * 100) / 100;\n const at = (L: number): KtRgb => fromOklch([L, fitChroma(L, hue, inC), hue]);\n const ground = ([L, C, offset]: Oklch): KtRgb => fromOklch([L, C * neutralChroma, hue + offset]);\n\n // The lightest fill, at or below the colour's own lightness, that white reads on.\n let baseL = Math.min(inL, 0.72);\n while (baseL > 0 && contrastRatio(WHITE_TEXT, at(baseL)) < TARGET) baseL -= 0.0025;\n const base = at(baseL);\n\n // Dark theme text: the darkest step that reads, which keeps the most colour.\n // Accent text sits on the surfaces, on its own 12% tint and on the 16%\n // wash behind a hovered secondary button.\n const tints = (g: KtRgb) => [g, over(base, 0.12, g), over(base, 0.16, g)];\n const darkGrounds = tints(ground(DARK_GROUND));\n let darkL = 0.45;\n while (darkL < 1 && darkGrounds.some((g) => contrastRatio(at(darkL), g) < TARGET)) {\n darkL += 0.0025;\n }\n\n // Light theme text: the lightest step that reads.\n const lightGrounds = LIGHT_GROUNDS.map(ground).flatMap(tints);\n let lightL = 0.7;\n while (lightL > 0 && lightGrounds.some((g) => contrastRatio(at(lightL), g) < TARGET)) {\n lightL -= 0.0025;\n }\n\n const [r, g, b] = round255(base);\n return {\n base: hex(base),\n hover: hex(at(Math.max(0, baseL - 0.025))),\n textDark: hex(at(darkL)),\n textLight: hex(at(lightL)),\n wash: `rgba(${r}, ${g}, ${b}, 0.16)`,\n neutralHue: Math.round(hue * 10) / 10,\n neutralChroma,\n };\n}\n\n/** The custom properties a palette sets — what `accents.css` and `setAccent` write. */\nexport function accentProperties(palette: KtAccentPalette): Record<string, string> {\n return {\n '--accent-base': palette.base,\n '--accent-hover': palette.hover,\n '--accent-text-dark': palette.textDark,\n '--accent-text-light': palette.textLight,\n '--accent-wash': palette.wash,\n '--neutral-hue': String(palette.neutralHue),\n '--neutral-chroma': String(palette.neutralChroma),\n };\n}\n\nconst INPUTS = Object.keys(accentProperties(KT_DEFAULT_ACCENT));\n\n/**\n * Themes `root` — the page by default — with any colour; `null` takes it off,\n * back to the `data-accent` preset or the default.\n *\n * The inputs go on as inline custom properties. The element also needs a\n * `data-accent` attribute for the token layer to re-read them there: a preset\n * already on it is kept, otherwise it gets `data-accent=\"custom\"`.\n */\nexport function setAccent(\n color: string | null,\n root: HTMLElement = document.documentElement,\n): void {\n if (color === null) {\n for (const name of INPUTS) root.style.removeProperty(name);\n if (root.dataset['accent'] === 'custom') delete root.dataset['accent'];\n return;\n }\n for (const [name, value] of Object.entries(accentProperties(accentPalette(color)))) {\n root.style.setProperty(name, value);\n }\n // A preset already there stays: the inline inputs win over it, and it is\n // what setAccent(null) goes back to.\n root.dataset['accent'] ??= 'custom';\n}\n","/**\n * The appearance: theme, accent, font, corners, density and text size, as\n * the data attributes the token layer reads.\n */\nimport { KT_ACCENTS, parseColor, setAccent } from './accent.js';\n\nexport type KtTheme = 'dark' | 'light' | 'auto';\nexport type KtFont = 'kanto' | 'system' | 'inter' | 'plex' | 'geist';\nexport type KtRadius = 'sharp' | 'default' | 'round';\nexport type KtDensity = 'compact' | 'default' | 'comfortable';\nexport type KtTextSize = 'small' | 'default' | 'large';\n\n/** Every setting is optional: setAppearance changes only those given. */\nexport interface KtAppearance {\n theme?: KtTheme;\n /** A preset id from `KT_ACCENTS`, or any colour `setAccent` reads. */\n accent?: string;\n font?: KtFont;\n radius?: KtRadius;\n density?: KtDensity;\n textSize?: KtTextSize;\n}\n\ninterface KtChoice<T extends string> {\n readonly id: T;\n readonly label: string;\n}\n\nexport const KT_THEMES: readonly KtChoice<KtTheme>[] = [\n { id: 'dark', label: 'Dark' },\n { id: 'light', label: 'Light' },\n { id: 'auto', label: 'Auto' },\n];\n\n/** The fonts, each with the stack it sets — for showing a name in its face. */\nexport const KT_FONTS: readonly (KtChoice<KtFont> & { readonly family: string })[] = [\n { id: 'kanto', label: 'Kanto', family: \"'Mulish', system-ui, sans-serif\" },\n {\n id: 'system',\n label: 'System',\n family: \"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif\",\n },\n { id: 'inter', label: 'Inter', family: \"'Inter', system-ui, sans-serif\" },\n { id: 'plex', label: 'IBM Plex Sans', family: \"'IBM Plex Sans', system-ui, sans-serif\" },\n { id: 'geist', label: 'Geist', family: \"'Geist', system-ui, sans-serif\" },\n];\n\nexport const KT_RADII: readonly KtChoice<KtRadius>[] = [\n { id: 'sharp', label: 'Sharp' },\n { id: 'default', label: 'Default' },\n { id: 'round', label: 'Round' },\n];\n\nexport const KT_DENSITIES: readonly KtChoice<KtDensity>[] = [\n { id: 'compact', label: 'Compact' },\n { id: 'default', label: 'Default' },\n { id: 'comfortable', label: 'Comfortable' },\n];\n\nexport const KT_TEXT_SIZES: readonly KtChoice<KtTextSize>[] = [\n { id: 'small', label: 'Small' },\n { id: 'default', label: 'Default' },\n { id: 'large', label: 'Large' },\n];\n\nexport const KT_DEFAULT_APPEARANCE: Required<KtAppearance> = {\n theme: 'dark',\n accent: 'violet',\n font: 'kanto',\n radius: 'default',\n density: 'default',\n textSize: 'default',\n};\n\n/** Each attribute-backed setting, by its `dataset` key (`textSize` is `data-text-size`). */\nconst CHOICES = {\n theme: KT_THEMES,\n font: KT_FONTS,\n radius: KT_RADII,\n density: KT_DENSITIES,\n textSize: KT_TEXT_SIZES,\n} as const;\ntype Keyed = keyof typeof CHOICES;\nconst KEYS = Object.keys(CHOICES) as Keyed[];\n\nconst ids = (key: Keyed) => CHOICES[key].map((choice) => choice.id as string);\n\n/**\n * Applies `appearance` to `root` — the page by default. A setting at its\n * default removes its attribute. Everything is checked first, so an unknown\n * value throws a TypeError with nothing changed.\n */\nexport function setAppearance(\n appearance: KtAppearance,\n root: HTMLElement = document.documentElement,\n): void {\n for (const key of KEYS) {\n const value = appearance[key];\n if (value !== undefined && !ids(key).includes(value)) {\n throw new TypeError(`Unknown ${key} \"${value}\". Use one of: ${ids(key).join(', ')}.`);\n }\n }\n const preset = KT_ACCENTS.find((accent) => accent.id === appearance.accent);\n if (appearance.accent !== undefined && !preset) parseColor(appearance.accent);\n\n // On the page a default is no attribute at all. On a container it is\n // written out, so the container can go back to it inside a page that\n // changed it — except the dark theme, which Kanto only has at the root.\n const page = root === document.documentElement;\n const clears = (key: Keyed | 'accent', value: string) =>\n value === KT_DEFAULT_APPEARANCE[key] && (page || key === 'theme');\n\n for (const key of KEYS) {\n const value = appearance[key];\n if (value === undefined) continue;\n if (clears(key, value)) delete root.dataset[key];\n else root.dataset[key] = value;\n }\n if (appearance.accent === undefined) return;\n if (preset) {\n setAccent(null, root);\n if (clears('accent', preset.id)) delete root.dataset['accent'];\n else root.dataset['accent'] = preset.id;\n } else {\n delete root.dataset['accent'];\n setAccent(appearance.accent, root);\n }\n}\n\n/** The appearance `root` shows: its attributes, with defaults for the rest. */\nexport function readAppearance(\n root: HTMLElement = document.documentElement,\n): Required<KtAppearance> {\n const read = { ...KT_DEFAULT_APPEARANCE } as Record<keyof KtAppearance, string>;\n for (const key of KEYS) {\n const value = root.dataset[key];\n if (value !== undefined && ids(key).includes(value)) read[key] = value;\n }\n const custom = root.style.getPropertyValue('--accent-base').trim();\n const preset = root.dataset['accent'];\n if (custom) read.accent = custom;\n else if (preset && KT_ACCENTS.some((accent) => accent.id === preset)) read.accent = preset;\n return read as Required<KtAppearance>;\n}\n"],"names":["toLinear","c","v","fromLinear","toOklch","r","g","b","R","G","B","l","m","s","L","a","bb","fromOklch","C","H","inGamut","rgb","fitChroma","limit","low","high","i","mid","round255","luminance","contrastRatio","x","y","over","top","alpha","bottom","hex","parseColor","input","text","match","digits","d","KT_DEFAULT_ACCENT","KT_ACCENTS","DARK_GROUND","LIGHT_GROUNDS","WHITE_TEXT","TARGET","accentPalette","color","inL","inC","inH","hue","neutralChroma","at","ground","offset","baseL","base","tints","darkGrounds","darkL","lightGrounds","lightL","accentProperties","palette","INPUTS","setAccent","root","name","value","KT_THEMES","KT_FONTS","KT_RADII","KT_DENSITIES","KT_TEXT_SIZES","KT_DEFAULT_APPEARANCE","CHOICES","KEYS","ids","key","choice","setAppearance","appearance","preset","accent","page","clears","readAppearance","read","custom"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAMA,IAAW,CAACC,MAAc;AAC9B,QAAMC,IAAID,IAAI;AACd,SAAOC,KAAK,UAAUA,IAAI,UAAUA,IAAI,SAAS,UAAU;AAC7D,GACMC,IAAa,CAACF,MAClB,OAAOA,KAAK,WAAY,QAAQA,IAAI,QAAQA,MAAM,IAAI,OAAO;AAE/D,SAASG,EAAQ,CAACC,GAAGC,GAAGC,CAAC,GAAiB;AACxC,QAAM,CAACC,GAAGC,GAAGC,CAAC,IAAI,CAACL,GAAGC,GAAGC,CAAC,EAAE,IAAIP,CAAQ,GAClCW,IAAI,KAAK,KAAK,eAAeH,IAAI,eAAeC,IAAI,eAAeC,CAAC,GACpEE,IAAI,KAAK,KAAK,eAAeJ,IAAI,eAAeC,IAAI,eAAeC,CAAC,GACpEG,IAAI,KAAK,KAAK,eAAeL,IAAI,eAAeC,IAAI,eAAeC,CAAC,GACpEI,IAAI,eAAeH,IAAI,cAAcC,IAAI,eAAeC,GACxDE,IAAI,eAAeJ,IAAI,cAAcC,IAAI,eAAeC,GACxDG,IAAK,eAAeL,IAAI,eAAeC,IAAI,cAAcC;AAC/D,SAAO,CAACC,GA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ourcesContent":["/**\n * The appearance: theme, accent, font, corners, density and text size, as\n * the data attributes the token layer reads.\n */\nimport { KT_ACCENTS, parseColor, setAccent } from './accent.js';\n\nexport type KtTheme = 'dark' | 'light' | 'auto';\nexport type KtFont = 'kanto' | 'system' | 'inter' | 'plex' | 'geist';\nexport type KtRadius = 'sharp' | 'default' | 'round';\nexport type KtDensity = 'compact' | 'default' | 'comfortable';\nexport type KtTextSize = 'small' | 'default' | 'large';\n\n/** Every setting is optional: setAppearance changes only those given. */\nexport interface KtAppearance {\n theme?: KtTheme;\n /** A preset id from `KT_ACCENTS`, or any colour `setAccent` reads. */\n accent?: string;\n font?: KtFont;\n radius?: KtRadius;\n density?: KtDensity;\n textSize?: KtTextSize;\n}\n\ninterface KtChoice<T extends string> {\n readonly id: T;\n readonly label: string;\n}\n\nexport const KT_THEMES: readonly KtChoice<KtTheme>[] = [\n { id: 'dark', label: 'Dark' },\n { id: 'light', label: 'Light' },\n { id: 'auto', label: 'Auto' },\n];\n\n/** The fonts, each with the stack it sets — for showing a name in its face. */\nexport const KT_FONTS: readonly (KtChoice<KtFont> & { readonly family: string })[] = [\n { id: 'kanto', label: 'Kanto', family: \"'Mulish', system-ui, sans-serif\" },\n {\n id: 'system',\n label: 'System',\n family: \"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif\",\n },\n { id: 'inter', label: 'Inter', family: \"'Inter', system-ui, sans-serif\" },\n { id: 'plex', label: 'IBM Plex Sans', family: \"'IBM Plex Sans', system-ui, sans-serif\" },\n { id: 'geist', label: 'Geist', family: \"'Geist', system-ui, sans-serif\" },\n];\n\nexport const KT_RADII: readonly KtChoice<KtRadius>[] = [\n { id: 'sharp', label: 'Sharp' },\n { id: 'default', label: 'Default' },\n { id: 'round', label: 'Round' },\n];\n\nexport const KT_DENSITIES: readonly KtChoice<KtDensity>[] = [\n { id: 'compact', label: 'Compact' },\n { id: 'default', label: 'Default' },\n { id: 'comfortable', label: 'Comfortable' },\n];\n\nexport const KT_TEXT_SIZES: readonly KtChoice<KtTextSize>[] = [\n { id: 'small', label: 'Small' },\n { id: 'default', label: 'Default' },\n { id: 'large', label: 'Large' },\n];\n\nexport const KT_DEFAULT_APPEARANCE: Required<KtAppearance> = {\n theme: 'dark',\n accent: 'violet',\n font: 'kanto',\n radius: 'default',\n density: 'default',\n textSize: 'default',\n};\n\n/** Each attribute-backed setting, by its `dataset` key (`textSize` is `data-text-size`). */\nconst CHOICES = {\n theme: KT_THEMES,\n font: KT_FONTS,\n radius: KT_RADII,\n density: KT_DENSITIES,\n textSize: KT_TEXT_SIZES,\n} as const;\ntype Keyed = keyof typeof CHOICES;\nconst KEYS = Object.keys(CHOICES) as Keyed[];\n\nconst ids = (key: Keyed) => CHOICES[key].map((choice) => choice.id as string);\n\n/**\n * Applies `appearance` to `root` — the page by default. A setting at its\n * default removes its attribute. Everything is checked first, so an unknown\n * value throws a TypeError with nothing changed.\n */\nexport function setAppearance(\n appearance: KtAppearance,\n root: HTMLElement = document.documentElement,\n): void {\n for (const key of KEYS) {\n const value = appearance[key];\n if (value !== undefined && !ids(key).includes(value)) {\n throw new TypeError(`Unknown ${key} \"${value}\". Use one of: ${ids(key).join(', ')}.`);\n }\n }\n const preset = KT_ACCENTS.find((accent) => accent.id === appearance.accent);\n if (appearance.accent !== undefined && !preset) parseColor(appearance.accent);\n\n // On the page a default is no attribute at all. On a container it is\n // written out, so the container can go back to it inside a page that\n // changed it — except the dark theme, which Kanto only has at the root.\n const page = root === document.documentElement;\n const clears = (key: Keyed | 'accent', value: string) =>\n value === KT_DEFAULT_APPEARANCE[key] && (page || key === 'theme');\n\n for (const key of KEYS) {\n const value = appearance[key];\n if (value === undefined) continue;\n if (clears(key, value)) delete root.dataset[key];\n else root.dataset[key] = value;\n }\n if (appearance.accent === undefined) return;\n if (preset) {\n setAccent(null, root);\n if (clears('accent', preset.id)) delete root.dataset['accent'];\n else root.dataset['accent'] = preset.id;\n } else {\n delete root.dataset['accent'];\n setAccent(appearance.accent, root);\n }\n}\n\n/** The appearance `root` shows: its attributes, with defaults for the rest. */\nexport function readAppearance(\n root: HTMLElement = document.documentElement,\n): Required<KtAppearance> {\n const read = { ...KT_DEFAULT_APPEARANCE } as Record<keyof KtAppearance, string>;\n for (const key of KEYS) {\n const value = root.dataset[key];\n if (value !== undefined && ids(key).includes(value)) read[key] = value;\n }\n const custom = root.style.getPropertyValue('--accent-base').trim();\n const preset = root.dataset['accent'];\n if (custom) read.accent = custom;\n else if (preset && KT_ACCENTS.some((accent) => accent.id === preset)) read.accent = preset;\n return read as Required<KtAppearance>;\n}\n"],"names":["KT_THEMES","KT_FONTS","KT_RADII","KT_DENSITIES","KT_TEXT_SIZES","KT_DEFAULT_APPEARANCE","CHOICES","KEYS","ids","key","choice","setAppearance","appearance","root","value","preset","KT_ACCENTS","accent","parseColor","page","clears","setAccent","readAppearance","read","custom"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAMA,IAA0C;AAAA,EACrD,EAAE,IAAI,QAAQ,OAAO,OAAA;AAAA,EACrB,EAAE,IAAI,SAAS,OAAO,QAAA;AAAA,EACtB,EAAE,IAAI,QAAQ,OAAO,OAAA;AACvB,GAGaC,IAAwE;AAAA,EACnF,EAAE,IAAI,SAAS,OAAO,SAAS,QAAQ,kCAAA;AAAA,EACvC;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,EAAA;AAAA,EAEV,EAAE,IAAI,SAAS,OAAO,SAAS,QAAQ,iCAAA;AAAA,EACvC,EAAE,IAAI,QAAQ,OAAO,iBAAiB,QAAQ,yCAAA;AAAA,EAC9C,EAAE,IAAI,SAAS,OAAO,SAAS,QAAQ,iCAAA;AACzC,GAEaC,IAA0C;AAAA,EACrD,EAAE,IAAI,SAAS,OAAO,QAAA;AAAA,EACtB,EAAE,IAAI,WAAW,OAAO,UAAA;AAAA,EAC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,GAAM;AACtB,UAAMO,IAAQF,EAAWH,CAAG;AAC5B,IAAIK,MAAU,WACVM,EAAOX,GAAKK,CAAK,IAAG,OAAOD,EAAK,QAAQJ,CAAG,IAC1CI,EAAK,QAAQJ,CAAG,IAAIK;AAAA,EAC3B;AACA,EAAIF,EAAW,WAAW,WACtBG,KACFM,EAAU,MAAMR,CAAI,GAChBO,EAAO,UAAUL,EAAO,EAAE,IAAG,OAAOF,EAAK,QAAQ,SAChDA,EAAK,QAAQ,SAAYE,EAAO,OAErC,OAAOF,EAAK,QAAQ,QACpBQ,EAAUT,EAAW,QAAQC,CAAI;AAErC;AAGO,SAASS,EACdT,IAAoB,SAAS,iBACL;AACxB,QAAMU,IAAO,EAAE,GAAGlB,EAAA;AAClB,aAAWI,KAAOF,GAAM;AACtB,UAAMO,IAAQD,EAAK,QAAQJ,CAAG;AAC9B,IAAIK,MAAU,UAAaN,EAAIC,CAAG,EAAE,SAASK,CAAK,MAAGS,EAAKd,CAAG,IAAIK;AAAA,EACnE;AACA,QAAMU,IAASX,EAAK,MAAM,iBAAiB,eAAe,EAAE,KAAA,GACtDE,IAASF,EAAK,QAAQ;AAC5B,SAAIW,MAAa,SAASA,IACjBT,KAAUC,EAAW,KAAK,CAACC,MAAWA,EAAO,OAAOF,CAAM,MAAGQ,EAAK,SAASR,IAC7EQ;AACT;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { nothing, type TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* What the page blocks share: the room around a section, and the head over
|
|
4
|
+
* its content — a heading and a lead, centred or at the start.
|
|
5
|
+
*
|
|
6
|
+
* A block's heading level is the page's to set (`heading-level`); its items'
|
|
7
|
+
* headings sit one level under it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const blockStyles: import("lit").CSSResult;
|
|
10
|
+
export declare function blockId(prefix: string): string;
|
|
11
|
+
/** The head over a block: its heading and lead, when it has them. */
|
|
12
|
+
export declare function blockHead({ title, lead, level, id, }: {
|
|
13
|
+
title: string;
|
|
14
|
+
lead: string;
|
|
15
|
+
level: number;
|
|
16
|
+
id: string;
|
|
17
|
+
}): TemplateResult | typeof nothing;
|
|
18
|
+
/**
|
|
19
|
+
* A date for people — "Sep 14, 2026" — in `locale`, the page's language when
|
|
20
|
+
* empty. A date alone, `2026-09-14`, is read as that day where the reader is,
|
|
21
|
+
* not as midnight in London.
|
|
22
|
+
*/
|
|
23
|
+
export declare function formatDate(iso: string, locale?: string): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The search behind `<kt-command-palette>`: which commands a query keeps, and
|
|
3
|
+
* in what order.
|
|
4
|
+
*
|
|
5
|
+
* Every word typed must appear — in the label, a keyword or the group — in
|
|
6
|
+
* any order, ignoring case and accents. What matches ranks by how it matches:
|
|
7
|
+
* a label that starts with the query, then a label word that does, then a
|
|
8
|
+
* match inside the label, then a keyword or the group. Ties keep the order
|
|
9
|
+
* given, which is the order the application chose.
|
|
10
|
+
*/
|
|
11
|
+
export interface KtCommand {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly label: string;
|
|
14
|
+
/** Heading the command is listed under. */
|
|
15
|
+
readonly group?: string;
|
|
16
|
+
/** A Lucide icon name. */
|
|
17
|
+
readonly icon?: string;
|
|
18
|
+
/** Other words it answers to: "client" for New customer. */
|
|
19
|
+
readonly keywords?: readonly string[];
|
|
20
|
+
/** Keys shown beside it, as `<kt-kbd keys>` takes them: "mod n". */
|
|
21
|
+
readonly shortcut?: string;
|
|
22
|
+
readonly disabled?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Lowercase, without accents: "Préférences" reads "preferences". */
|
|
25
|
+
export declare function fold(text: string): string;
|
|
26
|
+
/** The commands `query` keeps, best first. An empty query keeps them all, in order. */
|
|
27
|
+
export declare function rankCommands(commands: readonly KtCommand[], query: string): KtCommand[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* A heading at the level a page needs. A block or a footer cannot know where
|
|
4
|
+
* it sits in the page's outline, so its heading level is the page's to set;
|
|
5
|
+
* this draws that level, kept between 1 and 6, `fallback` when it is not a
|
|
6
|
+
* number.
|
|
7
|
+
*/
|
|
8
|
+
export declare function heading(level: number, text: string | TemplateResult, className?: string, fallback?: number): TemplateResult;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* One mark that slides to whichever item is selected — a tab's underline, a
|
|
4
|
+
* segmented control's surface — rather than one per item that blinks from
|
|
5
|
+
* the old to the new.
|
|
6
|
+
*
|
|
7
|
+
* It measures the selected item against its container and writes the box to
|
|
8
|
+
* the container as `--kt-indicator-x`, `-y`, `-width` and `-height`. The
|
|
9
|
+
* container's `data-indicator` says where things stand: absent while nothing
|
|
10
|
+
* is selected, `placed` once the mark is under the item, `ready` a frame
|
|
11
|
+
* later. A component transitions the mark only when `ready`, so a page opens
|
|
12
|
+
* with the mark in place, not sliding in from the corner.
|
|
13
|
+
*
|
|
14
|
+
* It slides only when the selection moves to another item. When the same item
|
|
15
|
+
* changes size — the brand font replacing the fallback, a label rewritten —
|
|
16
|
+
* the mark follows at once: growing towards its item would read as a glitch.
|
|
17
|
+
*/
|
|
18
|
+
export interface IndicatorOptions {
|
|
19
|
+
readonly container: () => HTMLElement | null | undefined;
|
|
20
|
+
readonly selected: () => HTMLElement | null | undefined;
|
|
21
|
+
}
|
|
22
|
+
export declare class IndicatorController implements ReactiveController {
|
|
23
|
+
private readonly options;
|
|
24
|
+
private observer;
|
|
25
|
+
private observed;
|
|
26
|
+
private frame;
|
|
27
|
+
private placed;
|
|
28
|
+
constructor(host: ReactiveControllerHost, options: IndicatorOptions);
|
|
29
|
+
hostConnected(): void;
|
|
30
|
+
hostDisconnected(): void;
|
|
31
|
+
hostUpdated(): void;
|
|
32
|
+
private place;
|
|
33
|
+
private observe;
|
|
34
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motion read from the theme. The duration tokens are where reduced motion is
|
|
3
|
+
* honoured — they are all zero under `prefers-reduced-motion: reduce` — so
|
|
4
|
+
* script-driven animations read them instead of carrying their own numbers,
|
|
5
|
+
* and are skipped outright when they come back zero.
|
|
6
|
+
*/
|
|
7
|
+
/** A CSS time — `0.2s`, `160ms` — in milliseconds; zero when it is not one. */
|
|
8
|
+
export declare function parseTime(value: string): number;
|
|
9
|
+
/** A duration token's value at `element`, in milliseconds. */
|
|
10
|
+
export declare function durationOf(element: Element, token: `--duration-${string}`): number;
|
|
11
|
+
/** The theme's standard easing at `element`, for the Web Animations API. */
|
|
12
|
+
export declare function easingOf(element: Element): string;
|
|
13
|
+
/**
|
|
14
|
+
* Plays `keyframes` on `element` for as long as the duration token says,
|
|
15
|
+
* with the theme's easing, under `id` so tests and callers can find it.
|
|
16
|
+
* Cancels an earlier run with the same id, so a quick second change starts
|
|
17
|
+
* afresh. Null — and nothing played — when the token is zero or the browser
|
|
18
|
+
* has no Web Animations.
|
|
19
|
+
*/
|
|
20
|
+
export declare function play(element: Element, keyframes: Keyframe[], token: `--duration-${string}`, id: string, options?: {
|
|
21
|
+
/** Overrides the theme's easing — `linear` when the keyframes carry their own. */
|
|
22
|
+
readonly easing?: string;
|
|
23
|
+
/** Multiplies the token's duration, for a motion with several legs. */
|
|
24
|
+
readonly scale?: number;
|
|
25
|
+
}): Animation | null;
|
|
@@ -101,6 +101,20 @@ export interface KtStrings {
|
|
|
101
101
|
/** A required time left empty, and one outside min and max. */
|
|
102
102
|
timeRequired: string;
|
|
103
103
|
timeOutOfRange: string;
|
|
104
|
+
commandPalette: string;
|
|
105
|
+
commandPlaceholder: string;
|
|
106
|
+
commandHintMove: string;
|
|
107
|
+
commandHintRun: string;
|
|
108
|
+
commandHintClose: string;
|
|
109
|
+
sliderMinimum: string;
|
|
110
|
+
sliderMaximum: string;
|
|
111
|
+
stepComplete: string;
|
|
112
|
+
stepCurrent: string;
|
|
113
|
+
stepUpcoming: string;
|
|
114
|
+
stepError: string;
|
|
115
|
+
numberRequired: string;
|
|
116
|
+
decrease: string;
|
|
117
|
+
increase: string;
|
|
104
118
|
/** A phone number typed with the prefix only dialled from inside the country. */
|
|
105
119
|
phoneTrunkPrefix: (prefix: string) => string;
|
|
106
120
|
openMenu: string;
|
|
@@ -133,6 +147,28 @@ export interface KtStrings {
|
|
|
133
147
|
cancel: string;
|
|
134
148
|
details: string;
|
|
135
149
|
avatar: string;
|
|
150
|
+
/** The prompt input's send button. */
|
|
151
|
+
send: string;
|
|
152
|
+
/** The prompt input's field, when it is given no label. */
|
|
153
|
+
message: string;
|
|
154
|
+
/** Said while a chat message is being thought out, before its first word. */
|
|
155
|
+
thinking: string;
|
|
156
|
+
/** The app shell's side area. */
|
|
157
|
+
sidebar: string;
|
|
158
|
+
/** An avatar group's sum of the people it does not show. */
|
|
159
|
+
moreCount: (count: number) => string;
|
|
160
|
+
/** One box of a one-time code, by its place. */
|
|
161
|
+
otpCharacter: (place: number, length: number) => string;
|
|
162
|
+
/** A required one-time code, not yet whole. */
|
|
163
|
+
otpRequired: string;
|
|
164
|
+
/** The colour picker's free colour, beside its swatches. */
|
|
165
|
+
customColour: string;
|
|
166
|
+
/** The colour picker's hex field. */
|
|
167
|
+
hexColour: string;
|
|
168
|
+
/** A tour's place: "Step 2 of 4". */
|
|
169
|
+
stepOf: (step: number, total: number) => string;
|
|
170
|
+
/** A tour's last button. */
|
|
171
|
+
done: string;
|
|
136
172
|
}
|
|
137
173
|
export declare const defaultStrings: Readonly<KtStrings>;
|
|
138
174
|
/** The strings in effect. Elements read them at render time. */
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { type EventName } from '@lit/react';
|
|
2
2
|
import type { KtOption } from '../internal/listbox.js';
|
|
3
|
+
import type { KtCommand } from '../internal/command-search.js';
|
|
4
|
+
import type { KtUserMenuItem } from '../components/navigation/kt-user-menu/kt-user-menu.js';
|
|
5
|
+
import type { KtTreeItem } from '../components/data/kt-tree/kt-tree.js';
|
|
6
|
+
import type { KtAuthMode, KtAuthSubmitDetail } from '../components/blocks/kt-auth-form/kt-auth-form.js';
|
|
7
|
+
import type { KtSubscribeDetail } from '../components/blocks/kt-newsletter/kt-newsletter.js';
|
|
8
|
+
import type { KtBilling } from '../components/blocks/kt-pricing-table/kt-pricing-table.js';
|
|
9
|
+
import type { KtPromptSubmitDetail } from '../components/forms/kt-prompt-input/kt-prompt-input.js';
|
|
3
10
|
import { KtAvatar as KtAvatarElement } from '../components/core/kt-avatar/kt-avatar.js';
|
|
4
11
|
import { KtBadge as KtBadgeElement } from '../components/core/kt-badge/kt-badge.js';
|
|
5
12
|
import { KtButton as KtButtonElement } from '../components/core/kt-button/kt-button.js';
|
|
@@ -20,6 +27,9 @@ import { KtMultiSelect as KtMultiSelectElement } from '../components/forms/kt-mu
|
|
|
20
27
|
import { KtLabelInput as KtLabelInputElement } from '../components/forms/kt-label-input/kt-label-input.js';
|
|
21
28
|
import { KtRadio as KtRadioElement, KtRadioGroup as KtRadioGroupElement } from '../components/forms/kt-radio-group/kt-radio-group.js';
|
|
22
29
|
import { KtSelect as KtSelectElement } from '../components/forms/kt-select/kt-select.js';
|
|
30
|
+
import { KtSteps as KtStepsElement } from '../components/navigation/kt-steps/kt-steps.js';
|
|
31
|
+
import { KtNumberInput as KtNumberInputElement } from '../components/forms/kt-number-input/kt-number-input.js';
|
|
32
|
+
import { KtSlider as KtSliderElement } from '../components/forms/kt-slider/kt-slider.js';
|
|
23
33
|
import { KtTextarea as KtTextareaElement } from '../components/forms/kt-textarea/kt-textarea.js';
|
|
24
34
|
import { KtTimeInput as KtTimeInputElement } from '../components/forms/kt-time-input/kt-time-input.js';
|
|
25
35
|
import { KtToggle as KtToggleElement } from '../components/forms/kt-toggle/kt-toggle.js';
|
|
@@ -29,6 +39,7 @@ import { KtSegmentedControl as KtSegmentedControlElement } from '../components/n
|
|
|
29
39
|
import { KtSubMenuNavigation as KtSubMenuNavigationElement } from '../components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js';
|
|
30
40
|
import { KtTabs as KtTabsElement } from '../components/navigation/kt-tabs/kt-tabs.js';
|
|
31
41
|
import { KtHeader as KtHeaderElement } from '../components/navigation/kt-header/kt-header.js';
|
|
42
|
+
import { KtFooter as KtFooterElement } from '../components/navigation/kt-footer/kt-footer.js';
|
|
32
43
|
import { KtToggleButton as KtToggleButtonElement } from '../components/navigation/kt-toggle-button/kt-toggle-button.js';
|
|
33
44
|
import { KtToggleButtonGroup as KtToggleButtonGroupElement } from '../components/navigation/kt-toggle-button-group/kt-toggle-button-group.js';
|
|
34
45
|
import { KtAlert as KtAlertElement } from '../components/feedback/kt-alert/kt-alert.js';
|
|
@@ -41,6 +52,7 @@ import { KtTooltip as KtTooltipElement } from '../components/feedback/kt-tooltip
|
|
|
41
52
|
import { KtCollapsible as KtCollapsibleElement } from '../components/overlays/kt-collapsible/kt-collapsible.js';
|
|
42
53
|
import { KtConfirmDialog as KtConfirmDialogElement } from '../components/overlays/kt-confirm-dialog/kt-confirm-dialog.js';
|
|
43
54
|
import { KtDropdown as KtDropdownElement } from '../components/overlays/kt-dropdown/kt-dropdown.js';
|
|
55
|
+
import { KtCommandPalette as KtCommandPaletteElement } from '../components/overlays/kt-command-palette/kt-command-palette.js';
|
|
44
56
|
import { KtModal as KtModalElement } from '../components/overlays/kt-modal/kt-modal.js';
|
|
45
57
|
import { KtSidePanel as KtSidePanelElement } from '../components/overlays/kt-side-panel/kt-side-panel.js';
|
|
46
58
|
import { KtChart as KtChartElement } from '../components/data/kt-chart/kt-chart.js';
|
|
@@ -48,6 +60,32 @@ import { KtMeter as KtMeterElement } from '../components/data/kt-meter/kt-meter.
|
|
|
48
60
|
import { KtPagination as KtPaginationElement } from '../components/data/kt-pagination/kt-pagination.js';
|
|
49
61
|
import { KtStat as KtStatElement } from '../components/data/kt-stat/kt-stat.js';
|
|
50
62
|
import { KtTable as KtTableElement } from '../components/data/kt-table/kt-table.js';
|
|
63
|
+
import { KtPromptInput as KtPromptInputElement } from '../components/forms/kt-prompt-input/kt-prompt-input.js';
|
|
64
|
+
import { KtChatMessage as KtChatMessageElement } from '../components/data/kt-chat-message/kt-chat-message.js';
|
|
65
|
+
import { KtAppShell as KtAppShellElement } from '../components/navigation/kt-app-shell/kt-app-shell.js';
|
|
66
|
+
import { KtDescriptionList as KtDescriptionListElement } from '../components/data/kt-description-list/kt-description-list.js';
|
|
67
|
+
import { KtAvatarGroup as KtAvatarGroupElement } from '../components/core/kt-avatar-group/kt-avatar-group.js';
|
|
68
|
+
import { KtCopyButton as KtCopyButtonElement } from '../components/core/kt-copy-button/kt-copy-button.js';
|
|
69
|
+
import { KtOtpInput as KtOtpInputElement } from '../components/forms/kt-otp-input/kt-otp-input.js';
|
|
70
|
+
import { KtAccordion as KtAccordionElement } from '../components/overlays/kt-accordion/kt-accordion.js';
|
|
71
|
+
import { KtUserMenu as KtUserMenuElement } from '../components/navigation/kt-user-menu/kt-user-menu.js';
|
|
72
|
+
import { KtTree as KtTreeElement } from '../components/data/kt-tree/kt-tree.js';
|
|
73
|
+
import { KtColorPicker as KtColorPickerElement } from '../components/forms/kt-color-picker/kt-color-picker.js';
|
|
74
|
+
import { KtTour as KtTourElement } from '../components/overlays/kt-tour/kt-tour.js';
|
|
75
|
+
import { KtAuthForm as KtAuthFormElement } from '../components/blocks/kt-auth-form/kt-auth-form.js';
|
|
76
|
+
import { KtErrorPage as KtErrorPageElement } from '../components/blocks/kt-error-page/kt-error-page.js';
|
|
77
|
+
import { KtHero as KtHeroElement } from '../components/blocks/kt-hero/kt-hero.js';
|
|
78
|
+
import { KtFeatureGrid as KtFeatureGridElement } from '../components/blocks/kt-feature-grid/kt-feature-grid.js';
|
|
79
|
+
import { KtCta as KtCtaElement } from '../components/blocks/kt-cta/kt-cta.js';
|
|
80
|
+
import { KtPricingTable as KtPricingTableElement } from '../components/blocks/kt-pricing-table/kt-pricing-table.js';
|
|
81
|
+
import { KtTestimonials as KtTestimonialsElement } from '../components/blocks/kt-testimonials/kt-testimonials.js';
|
|
82
|
+
import { KtLogoCloud as KtLogoCloudElement } from '../components/blocks/kt-logo-cloud/kt-logo-cloud.js';
|
|
83
|
+
import { KtFaq as KtFaqElement } from '../components/blocks/kt-faq/kt-faq.js';
|
|
84
|
+
import { KtPostGrid as KtPostGridElement } from '../components/blocks/kt-post-grid/kt-post-grid.js';
|
|
85
|
+
import { KtBlogPost as KtBlogPostElement } from '../components/blocks/kt-blog-post/kt-blog-post.js';
|
|
86
|
+
import { KtNewsletter as KtNewsletterElement } from '../components/blocks/kt-newsletter/kt-newsletter.js';
|
|
87
|
+
import { KtSettingsSection as KtSettingsSectionElement } from '../components/blocks/kt-settings-section/kt-settings-section.js';
|
|
88
|
+
import { KtEmptyPage as KtEmptyPageElement } from '../components/blocks/kt-empty-page/kt-empty-page.js';
|
|
51
89
|
import { KtTimeline as KtTimelineElement, KtTimelineItem as KtTimelineItemElement } from '../components/data/kt-timeline/kt-timeline.js';
|
|
52
90
|
/** Narrows an event name to the detail its element actually dispatches. */
|
|
53
91
|
type Kt<T> = EventName<CustomEvent<T>>;
|
|
@@ -88,6 +126,24 @@ export declare const KtInput: import("@lit/react").ReactWebComponent<KtInputElem
|
|
|
88
126
|
dialCode: string;
|
|
89
127
|
}>;
|
|
90
128
|
}>;
|
|
129
|
+
export declare const KtSteps: import("@lit/react").ReactWebComponent<KtStepsElement, {
|
|
130
|
+
onKtChange: Kt<{
|
|
131
|
+
id: string;
|
|
132
|
+
}>;
|
|
133
|
+
}>;
|
|
134
|
+
export declare const KtNumberInput: import("@lit/react").ReactWebComponent<KtNumberInputElement, {
|
|
135
|
+
onKtChange: Kt<{
|
|
136
|
+
value: number | null;
|
|
137
|
+
}>;
|
|
138
|
+
}>;
|
|
139
|
+
export declare const KtSlider: import("@lit/react").ReactWebComponent<KtSliderElement, {
|
|
140
|
+
onKtInput: Kt<{
|
|
141
|
+
value: string;
|
|
142
|
+
}>;
|
|
143
|
+
onKtChange: Kt<{
|
|
144
|
+
value: string;
|
|
145
|
+
}>;
|
|
146
|
+
}>;
|
|
91
147
|
export declare const KtTextarea: import("@lit/react").ReactWebComponent<KtTextareaElement, {
|
|
92
148
|
onKtInput: Kt<{
|
|
93
149
|
value: string;
|
|
@@ -183,6 +239,7 @@ export declare const KtTabs: import("@lit/react").ReactWebComponent<KtTabsElemen
|
|
|
183
239
|
value: string | number;
|
|
184
240
|
}>;
|
|
185
241
|
}>;
|
|
242
|
+
export declare const KtFooter: import("@lit/react").ReactWebComponent<KtFooterElement, {}>;
|
|
186
243
|
export declare const KtHeader: import("@lit/react").ReactWebComponent<KtHeaderElement, {
|
|
187
244
|
onKtMenuToggle: Kt<{
|
|
188
245
|
open: boolean;
|
|
@@ -222,6 +279,14 @@ export declare const KtDropdown: import("@lit/react").ReactWebComponent<KtDropdo
|
|
|
222
279
|
onKtOpen: Kt<never>;
|
|
223
280
|
onKtClose: Kt<never>;
|
|
224
281
|
}>;
|
|
282
|
+
export declare const KtCommandPalette: import("@lit/react").ReactWebComponent<KtCommandPaletteElement, {
|
|
283
|
+
onKtSelect: Kt<{
|
|
284
|
+
id: string;
|
|
285
|
+
command: KtCommand;
|
|
286
|
+
}>;
|
|
287
|
+
onKtOpen: Kt<never>;
|
|
288
|
+
onKtClose: Kt<never>;
|
|
289
|
+
}>;
|
|
225
290
|
export declare const KtModal: import("@lit/react").ReactWebComponent<KtModalElement, {
|
|
226
291
|
onKtClose: Kt<never>;
|
|
227
292
|
}>;
|
|
@@ -267,3 +332,103 @@ export { toaster } from '../components/feedback/kt-toast-container/toaster.js';
|
|
|
267
332
|
export declare const KtStat: import("@lit/react").ReactWebComponent<KtStatElement, {}>;
|
|
268
333
|
export declare const KtTimeline: import("@lit/react").ReactWebComponent<KtTimelineElement, {}>;
|
|
269
334
|
export declare const KtTimelineItem: import("@lit/react").ReactWebComponent<KtTimelineItemElement, {}>;
|
|
335
|
+
export declare const KtPromptInput: import("@lit/react").ReactWebComponent<KtPromptInputElement, {
|
|
336
|
+
onKtInput: Kt<{
|
|
337
|
+
value: string;
|
|
338
|
+
}>;
|
|
339
|
+
onKtSubmit: Kt<KtPromptSubmitDetail>;
|
|
340
|
+
}>;
|
|
341
|
+
export declare const KtChatMessage: import("@lit/react").ReactWebComponent<KtChatMessageElement, {}>;
|
|
342
|
+
export declare const KtAppShell: import("@lit/react").ReactWebComponent<KtAppShellElement, {
|
|
343
|
+
onKtSidebarToggle: Kt<{
|
|
344
|
+
open: boolean;
|
|
345
|
+
}>;
|
|
346
|
+
}>;
|
|
347
|
+
export declare const KtDescriptionList: import("@lit/react").ReactWebComponent<KtDescriptionListElement, {}>;
|
|
348
|
+
export declare const KtAvatarGroup: import("@lit/react").ReactWebComponent<KtAvatarGroupElement, {}>;
|
|
349
|
+
export declare const KtCopyButton: import("@lit/react").ReactWebComponent<KtCopyButtonElement, {
|
|
350
|
+
onKtCopy: Kt<{
|
|
351
|
+
value: string;
|
|
352
|
+
}>;
|
|
353
|
+
}>;
|
|
354
|
+
export declare const KtOtpInput: import("@lit/react").ReactWebComponent<KtOtpInputElement, {
|
|
355
|
+
onKtChange: Kt<{
|
|
356
|
+
value: string;
|
|
357
|
+
}>;
|
|
358
|
+
onKtComplete: Kt<{
|
|
359
|
+
value: string;
|
|
360
|
+
}>;
|
|
361
|
+
}>;
|
|
362
|
+
export declare const KtAccordion: import("@lit/react").ReactWebComponent<KtAccordionElement, {
|
|
363
|
+
onKtChange: Kt<{
|
|
364
|
+
open: number[];
|
|
365
|
+
}>;
|
|
366
|
+
}>;
|
|
367
|
+
export declare const KtUserMenu: import("@lit/react").ReactWebComponent<KtUserMenuElement, {
|
|
368
|
+
onKtSelect: Kt<{
|
|
369
|
+
id: string;
|
|
370
|
+
item: KtUserMenuItem;
|
|
371
|
+
}>;
|
|
372
|
+
onKtOpen: Kt<never>;
|
|
373
|
+
onKtClose: Kt<never>;
|
|
374
|
+
}>;
|
|
375
|
+
export declare const KtTree: import("@lit/react").ReactWebComponent<KtTreeElement, {
|
|
376
|
+
onKtSelect: Kt<{
|
|
377
|
+
id: string;
|
|
378
|
+
item: KtTreeItem;
|
|
379
|
+
}>;
|
|
380
|
+
onKtToggle: Kt<{
|
|
381
|
+
id: string;
|
|
382
|
+
expanded: boolean;
|
|
383
|
+
}>;
|
|
384
|
+
}>;
|
|
385
|
+
export declare const KtColorPicker: import("@lit/react").ReactWebComponent<KtColorPickerElement, {
|
|
386
|
+
onKtChange: Kt<{
|
|
387
|
+
value: string;
|
|
388
|
+
}>;
|
|
389
|
+
}>;
|
|
390
|
+
export declare const KtTour: import("@lit/react").ReactWebComponent<KtTourElement, {
|
|
391
|
+
onKtStep: Kt<{
|
|
392
|
+
index: number;
|
|
393
|
+
}>;
|
|
394
|
+
onKtFinish: Kt<never>;
|
|
395
|
+
onKtClose: Kt<never>;
|
|
396
|
+
}>;
|
|
397
|
+
export declare const KtAuthForm: import("@lit/react").ReactWebComponent<KtAuthFormElement, {
|
|
398
|
+
onKtSubmit: Kt<KtAuthSubmitDetail>;
|
|
399
|
+
onKtMode: Kt<{
|
|
400
|
+
mode: KtAuthMode;
|
|
401
|
+
}>;
|
|
402
|
+
onKtProvider: Kt<{
|
|
403
|
+
id: string;
|
|
404
|
+
}>;
|
|
405
|
+
}>;
|
|
406
|
+
export declare const KtErrorPage: import("@lit/react").ReactWebComponent<KtErrorPageElement, {
|
|
407
|
+
onKtRetry: Kt<never>;
|
|
408
|
+
}>;
|
|
409
|
+
export declare const KtHero: import("@lit/react").ReactWebComponent<KtHeroElement, {}>;
|
|
410
|
+
export declare const KtFeatureGrid: import("@lit/react").ReactWebComponent<KtFeatureGridElement, {}>;
|
|
411
|
+
export declare const KtCta: import("@lit/react").ReactWebComponent<KtCtaElement, {}>;
|
|
412
|
+
export declare const KtPricingTable: import("@lit/react").ReactWebComponent<KtPricingTableElement, {
|
|
413
|
+
onKtBilling: Kt<{
|
|
414
|
+
billing: KtBilling;
|
|
415
|
+
}>;
|
|
416
|
+
onKtPlan: Kt<{
|
|
417
|
+
id: string;
|
|
418
|
+
billing: KtBilling;
|
|
419
|
+
}>;
|
|
420
|
+
}>;
|
|
421
|
+
export declare const KtTestimonials: import("@lit/react").ReactWebComponent<KtTestimonialsElement, {}>;
|
|
422
|
+
export declare const KtLogoCloud: import("@lit/react").ReactWebComponent<KtLogoCloudElement, {}>;
|
|
423
|
+
export declare const KtFaq: import("@lit/react").ReactWebComponent<KtFaqElement, {}>;
|
|
424
|
+
export declare const KtPostGrid: import("@lit/react").ReactWebComponent<KtPostGridElement, {}>;
|
|
425
|
+
export declare const KtBlogPost: import("@lit/react").ReactWebComponent<KtBlogPostElement, {}>;
|
|
426
|
+
export declare const KtNewsletter: import("@lit/react").ReactWebComponent<KtNewsletterElement, {
|
|
427
|
+
onKtSubscribe: Kt<KtSubscribeDetail>;
|
|
428
|
+
}>;
|
|
429
|
+
export declare const KtSettingsSection: import("@lit/react").ReactWebComponent<KtSettingsSectionElement, {}>;
|
|
430
|
+
export declare const KtEmptyPage: import("@lit/react").ReactWebComponent<KtEmptyPageElement, {
|
|
431
|
+
onKtStep: Kt<{
|
|
432
|
+
id: string;
|
|
433
|
+
}>;
|
|
434
|
+
}>;
|