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
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { css as u, nothing as n, html as r } from "lit";
|
|
2
|
+
import { property as a, state as m } from "lit/decorators.js";
|
|
3
|
+
import { K as h, d as f } from "../../../chunks/kt-element-DvWtPQ1Y.js";
|
|
4
|
+
import { b as v, f as b } from "../../../chunks/block-Cci-Kff_.js";
|
|
5
|
+
import { h as y } from "../../../chunks/heading-DsnZsfg-.js";
|
|
6
|
+
import { h as x } from "../../../chunks/slots-BPbIdxAJ.js";
|
|
7
|
+
import "../../core/kt-avatar/kt-avatar.js";
|
|
8
|
+
import "../../core/kt-icon/kt-icon.js";
|
|
9
|
+
var k = Object.defineProperty, e = (d, o, s, g) => {
|
|
10
|
+
for (var i = void 0, l = d.length - 1, p; l >= 0; l--)
|
|
11
|
+
(p = d[l]) && (i = p(o, s, i) || i);
|
|
12
|
+
return i && k(o, s, i), i;
|
|
13
|
+
};
|
|
14
|
+
const c = {
|
|
15
|
+
back: "All posts",
|
|
16
|
+
minRead: (d) => `${d} min read`
|
|
17
|
+
}, $ = 230;
|
|
18
|
+
class t extends h {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments), this.heading = "", this.lead = "", this.date = "", this.author = "", this.authorRole = "", this.avatar = "", this.readingTime = 0, this.tags = [], this.backHref = "", this.locale = "", this.headingLevel = 1, this.texts = {}, this.counted = 0, this.filled = /* @__PURE__ */ new Set(), this.headingId = v("kt-blog-post"), this.readSlots = () => {
|
|
21
|
+
const o = /* @__PURE__ */ new Set();
|
|
22
|
+
for (const l of this.shadowRoot?.querySelectorAll("slot") ?? [])
|
|
23
|
+
x(l) && o.add(l.name);
|
|
24
|
+
this.filled = o;
|
|
25
|
+
const i = (this.shadowRoot?.querySelector("slot:not([name])")?.assignedNodes({ flatten: !0 }) ?? []).map((l) => l.textContent ?? "").join(" ").split(/\s+/).filter(Boolean).length;
|
|
26
|
+
this.counted = i ? Math.max(1, Math.round(i / $)) : 0;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
static {
|
|
30
|
+
this.styles = [
|
|
31
|
+
h.styles,
|
|
32
|
+
u`
|
|
33
|
+
:host {
|
|
34
|
+
--kt-post-measure: 700px;
|
|
35
|
+
display: block;
|
|
36
|
+
container-type: inline-size;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
article {
|
|
40
|
+
display: grid;
|
|
41
|
+
gap: calc(var(--gap-card) * 2);
|
|
42
|
+
padding-block: var(--kt-block-padding, calc(var(--padding-card) * 2));
|
|
43
|
+
}
|
|
44
|
+
.column {
|
|
45
|
+
width: 100%;
|
|
46
|
+
max-width: var(--kt-post-measure);
|
|
47
|
+
margin-inline: auto;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
header {
|
|
51
|
+
display: grid;
|
|
52
|
+
gap: var(--gap-card);
|
|
53
|
+
}
|
|
54
|
+
.back {
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
gap: 4px;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-self: start;
|
|
59
|
+
color: var(--text-muted);
|
|
60
|
+
font: var(--font-normal-regular);
|
|
61
|
+
text-decoration: none;
|
|
62
|
+
border-radius: var(--border-radius);
|
|
63
|
+
}
|
|
64
|
+
.back:hover {
|
|
65
|
+
color: var(--color-primary-text);
|
|
66
|
+
}
|
|
67
|
+
.back:focus-visible {
|
|
68
|
+
outline: var(--outline-width) solid var(--color-primary-base);
|
|
69
|
+
outline-offset: 2px;
|
|
70
|
+
}
|
|
71
|
+
.tags {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-wrap: wrap;
|
|
74
|
+
gap: 6px 12px;
|
|
75
|
+
}
|
|
76
|
+
.tag {
|
|
77
|
+
color: var(--color-primary-text);
|
|
78
|
+
font: var(--font-normal-small);
|
|
79
|
+
}
|
|
80
|
+
.title {
|
|
81
|
+
margin: 0;
|
|
82
|
+
color: var(--text-body);
|
|
83
|
+
font: 600 clamp(32px, 5cqi, 48px) / 1.1 var(--font-family-display);
|
|
84
|
+
letter-spacing: -0.03em;
|
|
85
|
+
text-wrap: balance;
|
|
86
|
+
}
|
|
87
|
+
.lead {
|
|
88
|
+
margin: 0;
|
|
89
|
+
color: var(--text-muted);
|
|
90
|
+
font: var(--font-normal-regular);
|
|
91
|
+
font-size: calc(19px * var(--text-scale, 1));
|
|
92
|
+
line-height: 1.55;
|
|
93
|
+
text-wrap: pretty;
|
|
94
|
+
}
|
|
95
|
+
.meta {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-wrap: wrap;
|
|
98
|
+
gap: 8px 16px;
|
|
99
|
+
align-items: center;
|
|
100
|
+
margin-top: 4px;
|
|
101
|
+
color: var(--text-muted);
|
|
102
|
+
font: var(--font-normal-small);
|
|
103
|
+
}
|
|
104
|
+
.author {
|
|
105
|
+
display: flex;
|
|
106
|
+
gap: 10px;
|
|
107
|
+
align-items: center;
|
|
108
|
+
}
|
|
109
|
+
.author-text {
|
|
110
|
+
display: grid;
|
|
111
|
+
}
|
|
112
|
+
.author-name {
|
|
113
|
+
color: var(--text-body);
|
|
114
|
+
font: var(--font-normal-medium);
|
|
115
|
+
}
|
|
116
|
+
.when {
|
|
117
|
+
display: flex;
|
|
118
|
+
flex-wrap: wrap;
|
|
119
|
+
gap: 4px 12px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.cover {
|
|
123
|
+
width: 100%;
|
|
124
|
+
max-width: calc(var(--kt-post-measure) + 240px);
|
|
125
|
+
margin-inline: auto;
|
|
126
|
+
}
|
|
127
|
+
.cover ::slotted(img) {
|
|
128
|
+
display: block;
|
|
129
|
+
width: 100%;
|
|
130
|
+
height: auto;
|
|
131
|
+
border-radius: var(--border-radius-card);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* The body: the page's own elements, set as prose. */
|
|
135
|
+
.prose {
|
|
136
|
+
color: var(--text-body);
|
|
137
|
+
font: var(--font-normal-regular);
|
|
138
|
+
font-size: calc(17px * var(--text-scale, 1));
|
|
139
|
+
line-height: 1.75;
|
|
140
|
+
}
|
|
141
|
+
.prose ::slotted(*) {
|
|
142
|
+
margin: 0 0 1.25em;
|
|
143
|
+
}
|
|
144
|
+
.prose ::slotted(:last-child) {
|
|
145
|
+
margin-bottom: 0;
|
|
146
|
+
}
|
|
147
|
+
.prose ::slotted(h2) {
|
|
148
|
+
margin: 2em 0 0.6em;
|
|
149
|
+
font: var(--font-title-h4);
|
|
150
|
+
letter-spacing: -0.01em;
|
|
151
|
+
}
|
|
152
|
+
.prose ::slotted(h3) {
|
|
153
|
+
margin: 1.6em 0 0.5em;
|
|
154
|
+
font: var(--font-title-h6);
|
|
155
|
+
}
|
|
156
|
+
.prose ::slotted(ul),
|
|
157
|
+
.prose ::slotted(ol) {
|
|
158
|
+
padding-inline-start: 1.4em;
|
|
159
|
+
}
|
|
160
|
+
.prose ::slotted(blockquote) {
|
|
161
|
+
padding-inline-start: 1em;
|
|
162
|
+
color: var(--text-muted);
|
|
163
|
+
font-style: italic;
|
|
164
|
+
border-inline-start: 3px solid var(--color-primary-base);
|
|
165
|
+
}
|
|
166
|
+
.prose ::slotted(pre) {
|
|
167
|
+
overflow-x: auto;
|
|
168
|
+
padding: var(--padding-card);
|
|
169
|
+
font-size: 14px;
|
|
170
|
+
line-height: 1.6;
|
|
171
|
+
background-color: var(--color-dark-14);
|
|
172
|
+
border-radius: var(--border-radius-card);
|
|
173
|
+
}
|
|
174
|
+
.prose ::slotted(img),
|
|
175
|
+
.prose ::slotted(figure),
|
|
176
|
+
.prose ::slotted(kt-code) {
|
|
177
|
+
display: block;
|
|
178
|
+
max-width: 100%;
|
|
179
|
+
margin-block: 2em;
|
|
180
|
+
}
|
|
181
|
+
.prose ::slotted(hr) {
|
|
182
|
+
margin-block: 2.5em;
|
|
183
|
+
border: 0;
|
|
184
|
+
border-top: var(--border-width) solid var(--border-subtle);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.end {
|
|
188
|
+
padding-top: calc(var(--gap-card) * 1.5);
|
|
189
|
+
border-top: var(--border-width) solid var(--border-subtle);
|
|
190
|
+
}
|
|
191
|
+
.empty {
|
|
192
|
+
display: none;
|
|
193
|
+
}
|
|
194
|
+
`
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
firstUpdated() {
|
|
198
|
+
this.readSlots();
|
|
199
|
+
}
|
|
200
|
+
meta() {
|
|
201
|
+
const o = { ...c, ...this.texts }, s = this.readingTime || this.counted;
|
|
202
|
+
return !this.author && !this.date && !s ? n : r`<div class="meta">
|
|
203
|
+
${this.author ? r`<span class="author">
|
|
204
|
+
<kt-avatar name=${this.author} src=${this.avatar} aria-hidden="true"></kt-avatar>
|
|
205
|
+
<span class="author-text">
|
|
206
|
+
<span class="author-name">${this.author}</span>
|
|
207
|
+
${this.authorRole ? r`<span class="author-role">${this.authorRole}</span>` : n}
|
|
208
|
+
</span>
|
|
209
|
+
</span>` : n}
|
|
210
|
+
<span class="when">
|
|
211
|
+
${this.date ? r`<time datetime=${this.date}>${b(this.date, this.locale)}</time>` : n}
|
|
212
|
+
${s ? r`<span class="reading">${o.minRead(s)}</span>` : n}
|
|
213
|
+
</span>
|
|
214
|
+
</div>`;
|
|
215
|
+
}
|
|
216
|
+
render() {
|
|
217
|
+
const o = { ...c, ...this.texts };
|
|
218
|
+
return r`<article part="base" aria-labelledby=${this.headingId}>
|
|
219
|
+
<header part="header" class="column">
|
|
220
|
+
${this.backHref ? r`<a class="back" href=${this.backHref}
|
|
221
|
+
><kt-icon name="chevron-left" size="16" aria-hidden="true"></kt-icon>${o.back}</a
|
|
222
|
+
>` : n}
|
|
223
|
+
${this.tags.length ? r`<div class="tags">
|
|
224
|
+
${this.tags.map((s) => r`<span class="tag">${s}</span>`)}
|
|
225
|
+
</div>` : n}
|
|
226
|
+
<div id=${this.headingId}>${y(this.headingLevel, this.heading, "title", 1)}</div>
|
|
227
|
+
${this.lead ? r`<p class="lead">${this.lead}</p>` : n} ${this.meta()}
|
|
228
|
+
</header>
|
|
229
|
+
<div class=${this.filled.has("cover") ? "cover" : "cover empty"}>
|
|
230
|
+
<slot name="cover" @slotchange=${this.readSlots}></slot>
|
|
231
|
+
</div>
|
|
232
|
+
<div part="body" class="prose column"><slot @slotchange=${this.readSlots}></slot></div>
|
|
233
|
+
<footer class=${this.filled.has("end") ? "end column" : "end column empty"}>
|
|
234
|
+
<slot name="end" @slotchange=${this.readSlots}></slot>
|
|
235
|
+
</footer>
|
|
236
|
+
</article>`;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
e([
|
|
240
|
+
a({ type: String })
|
|
241
|
+
], t.prototype, "heading");
|
|
242
|
+
e([
|
|
243
|
+
a({ type: String })
|
|
244
|
+
], t.prototype, "lead");
|
|
245
|
+
e([
|
|
246
|
+
a({ type: String })
|
|
247
|
+
], t.prototype, "date");
|
|
248
|
+
e([
|
|
249
|
+
a({ type: String })
|
|
250
|
+
], t.prototype, "author");
|
|
251
|
+
e([
|
|
252
|
+
a({ type: String, attribute: "author-role" })
|
|
253
|
+
], t.prototype, "authorRole");
|
|
254
|
+
e([
|
|
255
|
+
a({ type: String })
|
|
256
|
+
], t.prototype, "avatar");
|
|
257
|
+
e([
|
|
258
|
+
a({ type: Number, attribute: "reading-time" })
|
|
259
|
+
], t.prototype, "readingTime");
|
|
260
|
+
e([
|
|
261
|
+
a({ attribute: !1 })
|
|
262
|
+
], t.prototype, "tags");
|
|
263
|
+
e([
|
|
264
|
+
a({ type: String, attribute: "back-href" })
|
|
265
|
+
], t.prototype, "backHref");
|
|
266
|
+
e([
|
|
267
|
+
a({ type: String })
|
|
268
|
+
], t.prototype, "locale");
|
|
269
|
+
e([
|
|
270
|
+
a({ type: Number, attribute: "heading-level" })
|
|
271
|
+
], t.prototype, "headingLevel");
|
|
272
|
+
e([
|
|
273
|
+
a({ attribute: !1 })
|
|
274
|
+
], t.prototype, "texts");
|
|
275
|
+
e([
|
|
276
|
+
m()
|
|
277
|
+
], t.prototype, "counted");
|
|
278
|
+
e([
|
|
279
|
+
m()
|
|
280
|
+
], t.prototype, "filled");
|
|
281
|
+
f("kt-blog-post", t);
|
|
282
|
+
export {
|
|
283
|
+
t as KtBlogPost
|
|
284
|
+
};
|
|
285
|
+
//# sourceMappingURL=kt-blog-post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kt-blog-post.js","sources":["../../../../src/components/blocks/kt-blog-post/kt-blog-post.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { KtElement, defineElement } from '#internal/kt-element';\nimport { blockId, formatDate } from '#internal/block';\nimport { heading } from '#internal/heading';\nimport { hasAssignedContent } from '#internal/slots';\nimport '../../core/kt-avatar/kt-avatar.js';\nimport '../../core/kt-icon/kt-icon.js';\n\n/** Every word the post says, in English until given others. */\nexport interface KtBlogPostTexts {\n readonly back: string;\n readonly minRead: (minutes: number) => string;\n}\n\nconst TEXTS: KtBlogPostTexts = {\n back: 'All posts',\n minRead: (minutes) => `${minutes} min read`,\n};\n\n/** Words a minute, read on a screen. */\nconst PACE = 230;\n\n/**\n * A post, set to be read: its title, who wrote it and when, a cover, and the\n * body in a measure an eye can follow.\n *\n * The body is the default slot — paragraphs, headings, lists, quotes, code,\n * figures — set as prose. The reading time is counted from it, unless given.\n *\n * @element kt-blog-post\n *\n * @slot - The body.\n * @slot cover - Under the header: an image, a figure with its caption.\n * @slot end - After the body: tags, sharing, the next post.\n *\n * @csspart base - The article.\n * @csspart header - The title, the lead and who wrote it.\n * @csspart body - The body's column.\n *\n * @cssproperty --kt-post-measure - The column's width. 700px.\n *\n * @example\n * ```html\n * <kt-blog-post heading=\"Closing the month in a day\" author=\"Ada Park\" date=\"2026-09-14\" back-href=\"/blog\">\n * <img slot=\"cover\" src=\"/covers/close.jpg\" alt=\"\" />\n * <p>For years, the first week of the month was the close…</p>\n * </kt-blog-post>\n * ```\n */\nexport class KtBlogPost extends KtElement {\n static override styles = [\n KtElement.styles,\n css`\n :host {\n --kt-post-measure: 700px;\n display: block;\n container-type: inline-size;\n }\n\n article {\n display: grid;\n gap: calc(var(--gap-card) * 2);\n padding-block: var(--kt-block-padding, calc(var(--padding-card) * 2));\n }\n .column {\n width: 100%;\n max-width: var(--kt-post-measure);\n margin-inline: auto;\n }\n\n header {\n display: grid;\n gap: var(--gap-card);\n }\n .back {\n display: inline-flex;\n gap: 4px;\n align-items: center;\n justify-self: start;\n color: var(--text-muted);\n font: var(--font-normal-regular);\n text-decoration: none;\n border-radius: var(--border-radius);\n }\n .back:hover {\n color: var(--color-primary-text);\n }\n .back:focus-visible {\n outline: var(--outline-width) solid var(--color-primary-base);\n outline-offset: 2px;\n }\n .tags {\n display: flex;\n flex-wrap: wrap;\n gap: 6px 12px;\n }\n .tag {\n color: var(--color-primary-text);\n font: var(--font-normal-small);\n }\n .title {\n margin: 0;\n color: var(--text-body);\n font: 600 clamp(32px, 5cqi, 48px) / 1.1 var(--font-family-display);\n letter-spacing: -0.03em;\n text-wrap: balance;\n }\n .lead {\n margin: 0;\n color: var(--text-muted);\n font: var(--font-normal-regular);\n font-size: calc(19px * var(--text-scale, 1));\n line-height: 1.55;\n text-wrap: pretty;\n }\n .meta {\n display: flex;\n flex-wrap: wrap;\n gap: 8px 16px;\n align-items: center;\n margin-top: 4px;\n color: var(--text-muted);\n font: var(--font-normal-small);\n }\n .author {\n display: flex;\n gap: 10px;\n align-items: center;\n }\n .author-text {\n display: grid;\n }\n .author-name {\n color: var(--text-body);\n font: var(--font-normal-medium);\n }\n .when {\n display: flex;\n flex-wrap: wrap;\n gap: 4px 12px;\n }\n\n .cover {\n width: 100%;\n max-width: calc(var(--kt-post-measure) + 240px);\n margin-inline: auto;\n }\n .cover ::slotted(img) {\n display: block;\n width: 100%;\n height: auto;\n border-radius: var(--border-radius-card);\n }\n\n /* The body: the page's own elements, set as prose. */\n .prose {\n color: var(--text-body);\n font: var(--font-normal-regular);\n font-size: calc(17px * var(--text-scale, 1));\n line-height: 1.75;\n }\n .prose ::slotted(*) {\n margin: 0 0 1.25em;\n }\n .prose ::slotted(:last-child) {\n margin-bottom: 0;\n }\n .prose ::slotted(h2) {\n margin: 2em 0 0.6em;\n font: var(--font-title-h4);\n letter-spacing: -0.01em;\n }\n .prose ::slotted(h3) {\n margin: 1.6em 0 0.5em;\n font: var(--font-title-h6);\n }\n .prose ::slotted(ul),\n .prose ::slotted(ol) {\n padding-inline-start: 1.4em;\n }\n .prose ::slotted(blockquote) {\n padding-inline-start: 1em;\n color: var(--text-muted);\n font-style: italic;\n border-inline-start: 3px solid var(--color-primary-base);\n }\n .prose ::slotted(pre) {\n overflow-x: auto;\n padding: var(--padding-card);\n font-size: 14px;\n line-height: 1.6;\n background-color: var(--color-dark-14);\n border-radius: var(--border-radius-card);\n }\n .prose ::slotted(img),\n .prose ::slotted(figure),\n .prose ::slotted(kt-code) {\n display: block;\n max-width: 100%;\n margin-block: 2em;\n }\n .prose ::slotted(hr) {\n margin-block: 2.5em;\n border: 0;\n border-top: var(--border-width) solid var(--border-subtle);\n }\n\n .end {\n padding-top: calc(var(--gap-card) * 1.5);\n border-top: var(--border-width) solid var(--border-subtle);\n }\n .empty {\n display: none;\n }\n `,\n ];\n\n /** The post's title. */\n @property({ type: String })\n heading = '';\n\n /** A line under the title: what the post is about. */\n @property({ type: String })\n lead = '';\n\n /** When it was published: `2026-09-14`. */\n @property({ type: String })\n date = '';\n\n /** Who wrote it. */\n @property({ type: String })\n author = '';\n\n /** Their role: \"CFO, Northwind\". */\n @property({ type: String, attribute: 'author-role' })\n authorRole = '';\n\n /** Their photo's URL; without one, their initials. */\n @property({ type: String })\n avatar = '';\n\n /** Minutes to read it. Counted from the body when 0. */\n @property({ type: Number, attribute: 'reading-time' })\n readingTime = 0;\n\n /** A few words over the title. */\n @property({ attribute: false })\n tags: readonly string[] = [];\n\n /** Where All posts leads; no link without it. */\n @property({ type: String, attribute: 'back-href' })\n backHref = '';\n\n /** The locale the date is written in; the page's language when empty. */\n @property({ type: String })\n locale = '';\n\n /** The title's level: 1, since the post is the page. */\n @property({ type: Number, attribute: 'heading-level' })\n headingLevel = 1;\n\n /** The words, English until given others. */\n @property({ attribute: false })\n texts: Partial<KtBlogPostTexts> = {};\n\n @state() private counted = 0;\n @state() private filled = new Set<string>();\n\n private readonly headingId = blockId('kt-blog-post');\n\n override firstUpdated(): void {\n this.readSlots();\n }\n\n private readSlots = (): void => {\n const filled = new Set<string>();\n for (const slot of this.shadowRoot?.querySelectorAll('slot') ?? []) {\n if (hasAssignedContent(slot)) filled.add(slot.name);\n }\n this.filled = filled;\n const body = this.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])');\n const text = (body?.assignedNodes({ flatten: true }) ?? [])\n .map((node) => node.textContent ?? '')\n .join(' ');\n const count = text.split(/\\s+/).filter(Boolean).length;\n this.counted = count ? Math.max(1, Math.round(count / PACE)) : 0;\n };\n\n private meta(): TemplateResult | typeof nothing {\n const t = { ...TEXTS, ...this.texts };\n const minutes = this.readingTime || this.counted;\n if (!this.author && !this.date && !minutes) return nothing;\n return html`<div class=\"meta\">\n ${\n this.author\n ? html`<span class=\"author\">\n <kt-avatar name=${this.author} src=${this.avatar} aria-hidden=\"true\"></kt-avatar>\n <span class=\"author-text\">\n <span class=\"author-name\">${this.author}</span>\n ${this.authorRole ? html`<span class=\"author-role\">${this.authorRole}</span>` : nothing}\n </span>\n </span>`\n : nothing\n }\n <span class=\"when\">\n ${\n this.date\n ? html`<time datetime=${this.date}>${formatDate(this.date, this.locale)}</time>`\n : nothing\n }\n ${minutes ? html`<span class=\"reading\">${t.minRead(minutes)}</span>` : nothing}\n </span>\n </div>`;\n }\n\n override render(): TemplateResult {\n const t = { ...TEXTS, ...this.texts };\n return html`<article part=\"base\" aria-labelledby=${this.headingId}>\n <header part=\"header\" class=\"column\">\n ${\n this.backHref\n ? html`<a class=\"back\" href=${this.backHref}\n ><kt-icon name=\"chevron-left\" size=\"16\" aria-hidden=\"true\"></kt-icon>${t.back}</a\n >`\n : nothing\n }\n ${\n this.tags.length\n ? html`<div class=\"tags\">\n ${this.tags.map((tag) => html`<span class=\"tag\">${tag}</span>`)}\n </div>`\n : nothing\n }\n <div id=${this.headingId}>${heading(this.headingLevel, this.heading, 'title', 1)}</div>\n ${this.lead ? html`<p class=\"lead\">${this.lead}</p>` : nothing} ${this.meta()}\n </header>\n <div class=${this.filled.has('cover') ? 'cover' : 'cover empty'}>\n <slot name=\"cover\" @slotchange=${this.readSlots}></slot>\n </div>\n <div part=\"body\" class=\"prose column\"><slot @slotchange=${this.readSlots}></slot></div>\n <footer class=${this.filled.has('end') ? 'end column' : 'end column empty'}>\n <slot name=\"end\" @slotchange=${this.readSlots}></slot>\n </footer>\n </article>`;\n }\n}\n\ndefineElement('kt-blog-post', KtBlogPost);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kt-blog-post': KtBlogPost;\n }\n}\n"],"names":["TEXTS","minutes","PACE","KtBlogPost","KtElement","blockId","filled","slot","hasAssignedContent","count","node","css","t","nothing","html","formatDate","tag","heading","__decorateClass","property","state","defineElement"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,IAAyB;AAAA,EAC7B,MAAM;AAAA,EACN,SAAS,CAACC,MAAY,GAAGA,CAAO;AAClC,GAGMC,IAAO;AA6BN,MAAMC,UAAmBC,EAAU;AAAA,EAAnC,cAAA;AAAA,UAAA,GAAA,SAAA,GA0KL,KAAA,UAAU,IAIV,KAAA,OAAO,IAIP,KAAA,OAAO,IAIP,KAAA,SAAS,IAIT,KAAA,aAAa,IAIb,KAAA,SAAS,IAIT,KAAA,cAAc,GAId,KAAA,OAA0B,CAAA,GAI1B,KAAA,WAAW,IAIX,KAAA,SAAS,IAIT,KAAA,eAAe,GAIf,KAAA,QAAkC,CAAA,GAEzB,KAAQ,UAAU,GAClB,KAAQ,6BAAa,IAAA,GAE9B,KAAiB,YAAYC,EAAQ,cAAc,GAMnD,KAAQ,YAAY,MAAY;AAC9B,YAAMC,wBAAa,IAAA;AACnB,iBAAWC,KAAQ,KAAK,YAAY,iBAAiB,MAAM,KAAK;AAC9D,QAAIC,EAAmBD,CAAI,KAAGD,EAAO,IAAIC,EAAK,IAAI;AAEpD,WAAK,SAASD;AAKd,YAAMG,KAJO,KAAK,YAAY,cAA+B,kBAAkB,GAC3D,cAAc,EAAE,SAAS,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A;AAAA,EADCC,EAAS,EAAE,WAAW,GAAA,CAAO;AAAA,GArNnBhB,EAsNX,WAAA,OAAA;AAEiBe,EAAA;AAAA,EAAhBE,EAAA;AAAM,GAxNIjB,EAwNM,WAAA,SAAA;AACAe,EAAA;AAAA,EAAhBE,EAAA;AAAM,GAzNIjB,EAyNM,WAAA,QAAA;AAiFnBkB,EAAc,gBAAgBlB,CAAU;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { KtElement } from '#internal/kt-element';
|
|
3
|
+
export type KtCtaVariant = 'panel' | 'plain';
|
|
4
|
+
export type KtCtaLayout = 'stacked' | 'inline';
|
|
5
|
+
/**
|
|
6
|
+
* The ask at the end of a page: a heading, a line and the button that acts on
|
|
7
|
+
* them.
|
|
8
|
+
*
|
|
9
|
+
* `panel`, the default, sets it on a tinted panel so it reads as the page's
|
|
10
|
+
* last word; `plain` leaves it on the page. `stacked` puts the actions under
|
|
11
|
+
* the words; `inline` beside them once the block is wide enough.
|
|
12
|
+
*
|
|
13
|
+
* @element kt-cta
|
|
14
|
+
*
|
|
15
|
+
* @slot actions - The buttons.
|
|
16
|
+
* @slot note - Under the actions: what it costs, what it needs.
|
|
17
|
+
*
|
|
18
|
+
* @csspart base - The section.
|
|
19
|
+
* @csspart panel - The panel.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```html
|
|
23
|
+
* <kt-cta heading="Start sending invoices" lead="Free for three months. No card needed.">
|
|
24
|
+
* <kt-button slot="actions" size="large">Start free</kt-button>
|
|
25
|
+
* </kt-cta>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare class KtCta extends KtElement {
|
|
29
|
+
static styles: import("lit").CSSResultGroup[];
|
|
30
|
+
heading: string;
|
|
31
|
+
lead: string;
|
|
32
|
+
/** `center` or `start`. */
|
|
33
|
+
align: 'center' | 'start';
|
|
34
|
+
/** `panel`: on a tinted panel. `plain`: on the page. */
|
|
35
|
+
variant: KtCtaVariant;
|
|
36
|
+
/** `stacked`: the actions under the words. `inline`: beside them, where there is room. */
|
|
37
|
+
layout: KtCtaLayout;
|
|
38
|
+
/** The heading's level. */
|
|
39
|
+
headingLevel: number;
|
|
40
|
+
private filled;
|
|
41
|
+
private readonly headingId;
|
|
42
|
+
firstUpdated(): void;
|
|
43
|
+
private readSlots;
|
|
44
|
+
private region;
|
|
45
|
+
render(): TemplateResult;
|
|
46
|
+
}
|
|
47
|
+
declare global {
|
|
48
|
+
interface HTMLElementTagNameMap {
|
|
49
|
+
'kt-cta': KtCta;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { css as h, html as d } from "lit";
|
|
2
|
+
import { property as r, state as c } from "lit/decorators.js";
|
|
3
|
+
import { K as p, d as g } from "../../../chunks/kt-element-DvWtPQ1Y.js";
|
|
4
|
+
import { b as y, a as f, c as m } from "../../../chunks/block-Cci-Kff_.js";
|
|
5
|
+
import { h as u } from "../../../chunks/slots-BPbIdxAJ.js";
|
|
6
|
+
var v = Object.defineProperty, a = (l, t, s, b) => {
|
|
7
|
+
for (var i = void 0, n = l.length - 1, o; n >= 0; n--)
|
|
8
|
+
(o = l[n]) && (i = o(t, s, i) || i);
|
|
9
|
+
return i && v(t, s, i), i;
|
|
10
|
+
};
|
|
11
|
+
class e extends p {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.heading = "", this.lead = "", this.align = "center", this.variant = "panel", this.layout = "stacked", this.headingLevel = 2, this.filled = /* @__PURE__ */ new Set(), this.headingId = y("kt-cta"), this.readSlots = () => {
|
|
14
|
+
const t = /* @__PURE__ */ new Set();
|
|
15
|
+
for (const s of this.shadowRoot?.querySelectorAll("slot") ?? [])
|
|
16
|
+
u(s) && t.add(s.name);
|
|
17
|
+
this.filled = t;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static {
|
|
21
|
+
this.styles = [
|
|
22
|
+
p.styles,
|
|
23
|
+
f,
|
|
24
|
+
h`
|
|
25
|
+
.panel {
|
|
26
|
+
display: grid;
|
|
27
|
+
gap: calc(var(--gap-card) * 1.5);
|
|
28
|
+
justify-items: start;
|
|
29
|
+
}
|
|
30
|
+
:host([align='center']) .panel {
|
|
31
|
+
justify-items: center;
|
|
32
|
+
text-align: center;
|
|
33
|
+
}
|
|
34
|
+
:host([variant='panel']) .panel {
|
|
35
|
+
padding: calc(var(--padding-card) * 2);
|
|
36
|
+
background-color: var(--color-primary-soft);
|
|
37
|
+
border: var(--border-width) solid var(--border-subtle);
|
|
38
|
+
border-radius: var(--border-radius-card);
|
|
39
|
+
}
|
|
40
|
+
.block-heading {
|
|
41
|
+
font: 600 clamp(28px, 4cqi, 44px) / 1.1 var(--font-family-display);
|
|
42
|
+
letter-spacing: -0.03em;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.tail {
|
|
46
|
+
display: grid;
|
|
47
|
+
gap: 12px;
|
|
48
|
+
justify-items: inherit;
|
|
49
|
+
}
|
|
50
|
+
.actions {
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-wrap: wrap;
|
|
53
|
+
gap: var(--gap-button);
|
|
54
|
+
align-items: center;
|
|
55
|
+
}
|
|
56
|
+
.note {
|
|
57
|
+
color: var(--text-muted);
|
|
58
|
+
font: var(--font-normal-small);
|
|
59
|
+
}
|
|
60
|
+
.empty {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Inline: the words at the start, the actions at the end, where they fit. */
|
|
65
|
+
@container (min-width: 720px) {
|
|
66
|
+
:host([layout='inline']) .panel {
|
|
67
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-items: stretch;
|
|
70
|
+
text-align: start;
|
|
71
|
+
}
|
|
72
|
+
:host([layout='inline']) .block-head {
|
|
73
|
+
justify-items: start;
|
|
74
|
+
margin-inline: 0;
|
|
75
|
+
text-align: start;
|
|
76
|
+
}
|
|
77
|
+
:host([layout='inline']) .tail {
|
|
78
|
+
justify-items: end;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
firstUpdated() {
|
|
85
|
+
this.readSlots();
|
|
86
|
+
}
|
|
87
|
+
region(t) {
|
|
88
|
+
return d`<div class=${this.filled.has(t) ? t : `${t} empty`}>
|
|
89
|
+
<slot name=${t} @slotchange=${this.readSlots}></slot>
|
|
90
|
+
</div>`;
|
|
91
|
+
}
|
|
92
|
+
render() {
|
|
93
|
+
return d`<section part="base" class="block" aria-labelledby=${this.headingId}>
|
|
94
|
+
<div part="panel" class="panel">
|
|
95
|
+
${m({ title: this.heading, lead: this.lead, level: this.headingLevel, id: this.headingId })}
|
|
96
|
+
<div class="tail">${this.region("actions")} ${this.region("note")}</div>
|
|
97
|
+
</div>
|
|
98
|
+
</section>`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
a([
|
|
102
|
+
r({ type: String })
|
|
103
|
+
], e.prototype, "heading");
|
|
104
|
+
a([
|
|
105
|
+
r({ type: String })
|
|
106
|
+
], e.prototype, "lead");
|
|
107
|
+
a([
|
|
108
|
+
r({ type: String, reflect: !0 })
|
|
109
|
+
], e.prototype, "align");
|
|
110
|
+
a([
|
|
111
|
+
r({ type: String, reflect: !0 })
|
|
112
|
+
], e.prototype, "variant");
|
|
113
|
+
a([
|
|
114
|
+
r({ type: String, reflect: !0 })
|
|
115
|
+
], e.prototype, "layout");
|
|
116
|
+
a([
|
|
117
|
+
r({ type: Number, attribute: "heading-level" })
|
|
118
|
+
], e.prototype, "headingLevel");
|
|
119
|
+
a([
|
|
120
|
+
c()
|
|
121
|
+
], e.prototype, "filled");
|
|
122
|
+
g("kt-cta", e);
|
|
123
|
+
export {
|
|
124
|
+
e as KtCta
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=kt-cta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kt-cta.js","sources":["../../../../src/components/blocks/kt-cta/kt-cta.ts"],"sourcesContent":["import { css, html, type TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { KtElement, defineElement } from '#internal/kt-element';\nimport { blockHead, blockId, blockStyles } from '#internal/block';\nimport { hasAssignedContent } from '#internal/slots';\n\nexport type KtCtaVariant = 'panel' | 'plain';\nexport type KtCtaLayout = 'stacked' | 'inline';\n\n/**\n * The ask at the end of a page: a heading, a line and the button that acts on\n * them.\n *\n * `panel`, the default, sets it on a tinted panel so it reads as the page's\n * last word; `plain` leaves it on the page. `stacked` puts the actions under\n * the words; `inline` beside them once the block is wide enough.\n *\n * @element kt-cta\n *\n * @slot actions - The buttons.\n * @slot note - Under the actions: what it costs, what it needs.\n *\n * @csspart base - The section.\n * @csspart panel - The panel.\n *\n * @example\n * ```html\n * <kt-cta heading=\"Start sending invoices\" lead=\"Free for three months. No card needed.\">\n * <kt-button slot=\"actions\" size=\"large\">Start free</kt-button>\n * </kt-cta>\n * ```\n */\nexport class KtCta extends KtElement {\n static override styles = [\n KtElement.styles,\n blockStyles,\n css`\n .panel {\n display: grid;\n gap: calc(var(--gap-card) * 1.5);\n justify-items: start;\n }\n :host([align='center']) .panel {\n justify-items: center;\n text-align: center;\n }\n :host([variant='panel']) .panel {\n padding: calc(var(--padding-card) * 2);\n background-color: var(--color-primary-soft);\n border: var(--border-width) solid var(--border-subtle);\n border-radius: var(--border-radius-card);\n }\n .block-heading {\n font: 600 clamp(28px, 4cqi, 44px) / 1.1 var(--font-family-display);\n letter-spacing: -0.03em;\n }\n\n .tail {\n display: grid;\n gap: 12px;\n justify-items: inherit;\n }\n .actions {\n display: flex;\n flex-wrap: wrap;\n gap: var(--gap-button);\n align-items: center;\n }\n .note {\n color: var(--text-muted);\n font: var(--font-normal-small);\n }\n .empty {\n display: none;\n }\n\n /* Inline: the words at the start, the actions at the end, where they fit. */\n @container (min-width: 720px) {\n :host([layout='inline']) .panel {\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n justify-items: stretch;\n text-align: start;\n }\n :host([layout='inline']) .block-head {\n justify-items: start;\n margin-inline: 0;\n text-align: start;\n }\n :host([layout='inline']) .tail {\n justify-items: end;\n }\n }\n `,\n ];\n\n @property({ type: String })\n heading = '';\n\n @property({ type: String })\n lead = '';\n\n /** `center` or `start`. */\n @property({ type: String, reflect: true })\n align: 'center' | 'start' = 'center';\n\n /** `panel`: on a tinted panel. `plain`: on the page. */\n @property({ type: String, reflect: true })\n variant: KtCtaVariant = 'panel';\n\n /** `stacked`: the actions under the words. `inline`: beside them, where there is room. */\n @property({ type: String, reflect: true })\n layout: KtCtaLayout = 'stacked';\n\n /** The heading's level. */\n @property({ type: Number, attribute: 'heading-level' })\n headingLevel = 2;\n\n @state() private filled = new Set<string>();\n\n private readonly headingId = blockId('kt-cta');\n\n override firstUpdated(): void {\n this.readSlots();\n }\n\n private readSlots = (): void => {\n const filled = new Set<string>();\n for (const slot of this.shadowRoot?.querySelectorAll('slot') ?? []) {\n if (hasAssignedContent(slot)) filled.add(slot.name);\n }\n this.filled = filled;\n };\n\n private region(name: string): TemplateResult {\n return html`<div class=${this.filled.has(name) ? name : `${name} empty`}>\n <slot name=${name} @slotchange=${this.readSlots}></slot>\n </div>`;\n }\n\n override render(): TemplateResult {\n return html`<section part=\"base\" class=\"block\" aria-labelledby=${this.headingId}>\n <div part=\"panel\" class=\"panel\">\n ${blockHead({ title: this.heading, lead: this.lead, level: this.headingLevel, id: this.headingId })}\n <div class=\"tail\">${this.region('actions')} ${this.region('note')}</div>\n </div>\n </section>`;\n }\n}\n\ndefineElement('kt-cta', KtCta);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kt-cta': KtCta;\n }\n}\n"],"names":["KtCta","KtElement","blockId","filled","slot","hasAssignedContent","blockStyles","css","name","html","blockHead","__decorateClass","property","state","defineElement"],"mappings":";;;;;;;;;;AAgCO,MAAMA,UAAcC,EAAU;AA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cAAc,IAAI,KAAK,UAAA,CAAW,CAAC;AAAA,4BAC/E,KAAK,OAAO,SAAS,CAAC,IAAI,KAAK,OAAO,MAAM,CAAC;AAAA;AAAA;AAAA,EAGvE;AACF;AAnDEC,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAhEfZ,EAiEX,WAAA,SAAA;AAGAW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAnEfZ,EAoEX,WAAA,MAAA;AAIAW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAvE9BZ,EAwEX,WAAA,OAAA;AAIAW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GA3E9BZ,EA4EX,WAAA,SAAA;AAIAW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GA/E9BZ,EAgFX,WAAA,QAAA;AAIAW,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,iBAAiB;AAAA,GAnF3CZ,EAoFX,WAAA,cAAA;AAEiBW,EAAA;AAAA,EAAhBE,EAAA;AAAM,GAtFIb,EAsFM,WAAA,QAAA;AAgCnBc,EAAc,UAAUd,CAAK;"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { KtElement } from '#internal/kt-element';
|
|
3
|
+
import '../../core/kt-button/kt-button.js';
|
|
4
|
+
import '../../core/kt-icon/kt-icon.js';
|
|
5
|
+
import '../../feedback/kt-progress-bar/kt-progress-bar.js';
|
|
6
|
+
export interface KtFirstStep {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly title: string;
|
|
9
|
+
readonly description?: string;
|
|
10
|
+
/** The button's words: what doing the step starts. */
|
|
11
|
+
readonly action?: string;
|
|
12
|
+
/** Makes the action a link. Without it, the action fires `kt-step`. */
|
|
13
|
+
readonly href?: string;
|
|
14
|
+
readonly done?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Every word the page says, in English until given others. */
|
|
17
|
+
export interface KtEmptyPageTexts {
|
|
18
|
+
readonly progress: (done: number, total: number) => string;
|
|
19
|
+
/** Read before a done step's title, for assistive tech. */
|
|
20
|
+
readonly done: string;
|
|
21
|
+
readonly start: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The page a new account lands on, before there is anything in it: a welcome,
|
|
25
|
+
* and the first steps that fill it — what is done, what is next, and the way
|
|
26
|
+
* to each.
|
|
27
|
+
*
|
|
28
|
+
* The steps are data: `page.steps = [{ id, title, description, action, href,
|
|
29
|
+
* done }]`, numbered in order, with how far along it is over them. A step's
|
|
30
|
+
* action fires `kt-step`, or is a link with an `href`. For a list or a panel
|
|
31
|
+
* that is empty, `kt-empty-state`.
|
|
32
|
+
*
|
|
33
|
+
* @element kt-empty-page
|
|
34
|
+
*
|
|
35
|
+
* @slot media - Over the heading: an illustration, a logo.
|
|
36
|
+
* @slot actions - Under the steps: Skip for now, a link to the docs.
|
|
37
|
+
*
|
|
38
|
+
* @csspart base - The section.
|
|
39
|
+
* @csspart step - One step.
|
|
40
|
+
*
|
|
41
|
+
* @fires kt-step - A step's action was pressed. `detail: { id }`.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```html
|
|
45
|
+
* <kt-empty-page heading="Welcome, Ada" lead="Three steps and you are sending invoices."></kt-empty-page>
|
|
46
|
+
* <script>
|
|
47
|
+
* page.steps = [
|
|
48
|
+
* { id: 'company', title: 'Add your company', done: true },
|
|
49
|
+
* { id: 'invoice', title: 'Send your first invoice', action: 'New invoice', href: '/invoices/new' },
|
|
50
|
+
* ];
|
|
51
|
+
* </script>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare class KtEmptyPage extends KtElement {
|
|
55
|
+
static styles: import("lit").CSSResultGroup[];
|
|
56
|
+
heading: string;
|
|
57
|
+
lead: string;
|
|
58
|
+
/** The first steps, in the order to take them. */
|
|
59
|
+
steps: readonly KtFirstStep[];
|
|
60
|
+
/** The heading's level: 1, since it is the page; the steps' titles sit one under. */
|
|
61
|
+
headingLevel: number;
|
|
62
|
+
/** The words, English until given others. */
|
|
63
|
+
texts: Partial<KtEmptyPageTexts>;
|
|
64
|
+
private filled;
|
|
65
|
+
private readonly headingId;
|
|
66
|
+
firstUpdated(): void;
|
|
67
|
+
private readSlots;
|
|
68
|
+
private step;
|
|
69
|
+
render(): TemplateResult;
|
|
70
|
+
}
|
|
71
|
+
declare global {
|
|
72
|
+
interface HTMLElementTagNameMap {
|
|
73
|
+
'kt-empty-page': KtEmptyPage;
|
|
74
|
+
}
|
|
75
|
+
}
|