@atomic-ui/ui 0.1.4 → 0.1.7
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 +30 -6
- package/dist/base/FieldElement.d.ts +7 -0
- package/dist/base/tokens.d.ts +23 -1
- package/dist/chunk-2YQA3VBY.js +85 -0
- package/dist/chunk-2YQA3VBY.js.map +1 -0
- package/dist/{chunk-LFOWTFMR.js → chunk-4HU4Y23Q.js} +3 -3
- package/dist/chunk-5EA4IDUD.js +177 -0
- package/dist/chunk-5EA4IDUD.js.map +1 -0
- package/dist/{chunk-3OSL2HMN.js → chunk-6ICOJPMD.js} +7 -5
- package/dist/chunk-6ICOJPMD.js.map +1 -0
- package/dist/{chunk-ZXCSQ6MK.js → chunk-7BIQ3K6H.js} +10 -2
- package/dist/chunk-7BIQ3K6H.js.map +1 -0
- package/dist/chunk-7Y6UCSUS.js +361 -0
- package/dist/chunk-7Y6UCSUS.js.map +1 -0
- package/dist/chunk-BTGCUONV.js +56 -0
- package/dist/chunk-BTGCUONV.js.map +1 -0
- package/dist/{chunk-QYHWR6C5.js → chunk-C36CZRHK.js} +20 -7
- package/dist/chunk-C36CZRHK.js.map +1 -0
- package/dist/{chunk-MAMBT7BZ.js → chunk-CMAU4DSB.js} +21 -7
- package/dist/chunk-CMAU4DSB.js.map +1 -0
- package/dist/{chunk-HWNY6U5F.js → chunk-G6OVKNL7.js} +2 -2
- package/dist/{chunk-6UDDZQDK.js → chunk-GO2IBRFP.js} +3 -3
- package/dist/chunk-GO2IBRFP.js.map +1 -0
- package/dist/{chunk-PDXOPY22.js → chunk-GSCVG2ER.js} +3 -3
- package/dist/{chunk-IBTOZOGI.js → chunk-HWWA27DN.js} +2 -2
- package/dist/chunk-MLVUMCQ2.js +167 -0
- package/dist/chunk-MLVUMCQ2.js.map +1 -0
- package/dist/{chunk-A4CJ2F3J.js → chunk-MOEMFL4K.js} +21 -7
- package/dist/chunk-MOEMFL4K.js.map +1 -0
- package/dist/{chunk-OBCSDZHP.js → chunk-NQKYHILD.js} +3 -3
- package/dist/{chunk-5NUF7ZQA.js → chunk-NTNXHLTM.js} +24 -3
- package/dist/chunk-NTNXHLTM.js.map +1 -0
- package/dist/{chunk-4Y3HJBJY.js → chunk-OB7LC6NJ.js} +3 -2
- package/dist/chunk-OB7LC6NJ.js.map +1 -0
- package/dist/chunk-QCNT7D5V.js +549 -0
- package/dist/chunk-QCNT7D5V.js.map +1 -0
- package/dist/{chunk-CGMDIZPO.js → chunk-QDNI54ON.js} +3 -3
- package/dist/chunk-T6L3USBZ.js +245 -0
- package/dist/chunk-T6L3USBZ.js.map +1 -0
- package/dist/{chunk-TZD7IVVQ.js → chunk-TPF4MOMF.js} +8 -3
- package/dist/chunk-TPF4MOMF.js.map +1 -0
- package/dist/{chunk-S3EQO33M.js → chunk-VTFCTWSX.js} +6 -4
- package/dist/chunk-VTFCTWSX.js.map +1 -0
- package/dist/{chunk-2RBYVWZT.js → chunk-VWNBB7FW.js} +5 -3
- package/dist/chunk-VWNBB7FW.js.map +1 -0
- package/dist/{chunk-DIZCGSJA.js → chunk-WECSVHIM.js} +15 -3
- package/dist/chunk-WECSVHIM.js.map +1 -0
- package/dist/chunk-X7IPZPTG.js +710 -0
- package/dist/chunk-X7IPZPTG.js.map +1 -0
- package/dist/{chunk-TIKX5POO.js → chunk-XJP45LFA.js} +55 -28
- package/dist/chunk-XJP45LFA.js.map +1 -0
- package/dist/{chunk-6MLXFFH4.js → chunk-XVKEM5JY.js} +3 -3
- package/dist/chunk-XVKEM5JY.js.map +1 -0
- package/dist/chunk-ZBLTU67D.js +424 -0
- package/dist/chunk-ZBLTU67D.js.map +1 -0
- package/dist/{chunk-4KFHQBH2.js → chunk-ZGAOMRYD.js} +17 -4
- package/dist/chunk-ZGAOMRYD.js.map +1 -0
- package/dist/chunk-ZQJD4YEJ.js +195 -0
- package/dist/chunk-ZQJD4YEJ.js.map +1 -0
- package/dist/components/accordion.js +2 -2
- package/dist/components/alert.js +2 -2
- package/dist/components/app-ui.d.ts +421 -0
- package/dist/components/app-ui.js +26 -0
- package/dist/components/app-ui.js.map +1 -0
- package/dist/components/blocks.d.ts +174 -0
- package/dist/components/blocks.js +17 -0
- package/dist/components/blocks.js.map +1 -0
- package/dist/components/button.d.ts +33 -0
- package/dist/components/button.js +3 -2
- package/dist/components/checkbox-group.js +3 -3
- package/dist/components/checkbox.js +3 -3
- package/dist/components/date-input.js +3 -3
- package/dist/components/dialog.js +2 -2
- package/dist/components/fieldset.d.ts +49 -0
- package/dist/components/fieldset.js +8 -0
- package/dist/components/fieldset.js.map +1 -0
- package/dist/components/grid.d.ts +3 -3
- package/dist/components/grid.js +2 -2
- package/dist/components/help.js +2 -2
- package/dist/components/icon.d.ts +89 -0
- package/dist/components/icon.js +14 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/layout.d.ts +75 -7
- package/dist/components/layout.js +2 -2
- package/dist/components/link.d.ts +11 -0
- package/dist/components/link.js +3 -2
- package/dist/components/marketing.d.ts +370 -0
- package/dist/components/marketing.js +21 -0
- package/dist/components/marketing.js.map +1 -0
- package/dist/components/media.d.ts +12 -0
- package/dist/components/media.js +2 -2
- package/dist/components/navigation.d.ts +98 -0
- package/dist/components/navigation.js +11 -0
- package/dist/components/navigation.js.map +1 -0
- package/dist/components/organisms.d.ts +547 -0
- package/dist/components/organisms.js +25 -0
- package/dist/components/organisms.js.map +1 -0
- package/dist/components/page.d.ts +130 -0
- package/dist/components/page.js +10 -0
- package/dist/components/page.js.map +1 -0
- package/dist/components/price.d.ts +5 -0
- package/dist/components/price.js +2 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/property.d.ts +389 -0
- package/dist/components/property.js +19 -0
- package/dist/components/property.js.map +1 -0
- package/dist/components/radio-group.js +3 -3
- package/dist/components/select.d.ts +6 -0
- package/dist/components/select.js +3 -3
- package/dist/components/summary-list.js +2 -2
- package/dist/components/table.js +2 -2
- package/dist/components/text-input.d.ts +6 -0
- package/dist/components/text-input.js +3 -3
- package/dist/components/textarea.d.ts +6 -0
- package/dist/components/textarea.js +3 -3
- package/dist/index.d.ts +9 -0
- package/dist/index.js +140 -36
- package/package.json +2 -2
- package/dist/chunk-2RBYVWZT.js.map +0 -1
- package/dist/chunk-3OSL2HMN.js.map +0 -1
- package/dist/chunk-4KFHQBH2.js.map +0 -1
- package/dist/chunk-4Y3HJBJY.js.map +0 -1
- package/dist/chunk-5NUF7ZQA.js.map +0 -1
- package/dist/chunk-6MLXFFH4.js.map +0 -1
- package/dist/chunk-6UDDZQDK.js.map +0 -1
- package/dist/chunk-A4CJ2F3J.js.map +0 -1
- package/dist/chunk-DIZCGSJA.js.map +0 -1
- package/dist/chunk-GGODB3GY.js +0 -172
- package/dist/chunk-GGODB3GY.js.map +0 -1
- package/dist/chunk-MAMBT7BZ.js.map +0 -1
- package/dist/chunk-QYHWR6C5.js.map +0 -1
- package/dist/chunk-S3EQO33M.js.map +0 -1
- package/dist/chunk-TIKX5POO.js.map +0 -1
- package/dist/chunk-TZD7IVVQ.js.map +0 -1
- package/dist/chunk-ZXCSQ6MK.js.map +0 -1
- /package/dist/{chunk-LFOWTFMR.js.map → chunk-4HU4Y23Q.js.map} +0 -0
- /package/dist/{chunk-HWNY6U5F.js.map → chunk-G6OVKNL7.js.map} +0 -0
- /package/dist/{chunk-PDXOPY22.js.map → chunk-GSCVG2ER.js.map} +0 -0
- /package/dist/{chunk-IBTOZOGI.js.map → chunk-HWWA27DN.js.map} +0 -0
- /package/dist/{chunk-OBCSDZHP.js.map → chunk-NQKYHILD.js.map} +0 -0
- /package/dist/{chunk-CGMDIZPO.js.map → chunk-QDNI54ON.js.map} +0 -0
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import {
|
|
2
|
+
iconSvg
|
|
3
|
+
} from "./chunk-2YQA3VBY.js";
|
|
4
|
+
import {
|
|
5
|
+
ImpktElement,
|
|
6
|
+
fontSize,
|
|
7
|
+
fontWeight,
|
|
8
|
+
lineHeight,
|
|
9
|
+
space,
|
|
10
|
+
spaceAround,
|
|
11
|
+
t,
|
|
12
|
+
type
|
|
13
|
+
} from "./chunk-NTNXHLTM.js";
|
|
14
|
+
|
|
15
|
+
// packages/ui/src/components/marketing.ts
|
|
16
|
+
import { css, html, nothing } from "lit";
|
|
17
|
+
var heading = (level, text, cls) => html`<div class=${cls} role="heading" aria-level=${level}>${text}</div>`;
|
|
18
|
+
var headingStyles = css`
|
|
19
|
+
.h { margin: 0; color: ${t.textHeading}; font-family: ${t.fontHeading}; font-weight: ${fontWeight("bold")}; line-height: ${lineHeight("tight")}; }
|
|
20
|
+
.eyebrow { margin: 0; color: var(--impkt-eyebrow, ${t.brand}); ${type("sm")} font-weight: ${fontWeight("semibold")}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; }
|
|
21
|
+
.body { margin: 0; line-height: ${lineHeight("normal")}; max-inline-size: 65ch; }
|
|
22
|
+
`;
|
|
23
|
+
var ImpktHero = class extends ImpktElement {
|
|
24
|
+
static {
|
|
25
|
+
this.properties = {
|
|
26
|
+
eyebrow: { type: String },
|
|
27
|
+
heading: { type: String },
|
|
28
|
+
lead: { type: String },
|
|
29
|
+
level: { type: Number, reflect: true },
|
|
30
|
+
imageSrc: { type: String, attribute: "image-src" },
|
|
31
|
+
imageAlt: { type: String, attribute: "image-alt" },
|
|
32
|
+
treatment: { type: String, reflect: true },
|
|
33
|
+
ratingText: { type: String, attribute: "rating-text" },
|
|
34
|
+
eyebrowIcon: { type: String, attribute: "eyebrow-icon" },
|
|
35
|
+
align: { type: String, reflect: true },
|
|
36
|
+
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
37
|
+
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
this.eyebrow = "";
|
|
43
|
+
this.heading = "";
|
|
44
|
+
this.lead = "";
|
|
45
|
+
this.level = 1;
|
|
46
|
+
this.imageSrc = "";
|
|
47
|
+
this.imageAlt = "";
|
|
48
|
+
this.treatment = "split";
|
|
49
|
+
this.ratingText = "";
|
|
50
|
+
this.eyebrowIcon = "none";
|
|
51
|
+
this.align = "start";
|
|
52
|
+
this.spaceAbove = "none";
|
|
53
|
+
this.spaceBelow = "none";
|
|
54
|
+
}
|
|
55
|
+
static {
|
|
56
|
+
this.styles = [...ImpktElement.styles, spaceAround, headingStyles, css`
|
|
57
|
+
:host { display: block; container-type: inline-size; }
|
|
58
|
+
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: ${space(8)}; align-items: center; }
|
|
59
|
+
.hero.pictured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
|
|
60
|
+
.words { display: flex; flex-direction: column; gap: ${space(4)}; }
|
|
61
|
+
:host([align='center']) .words { align-items: center; text-align: center; margin-inline: auto; max-inline-size: 48rem; }
|
|
62
|
+
.h { ${type("5xl")} letter-spacing: ${t.trackingTight}; text-wrap: balance; }
|
|
63
|
+
.body { ${type("lg")} color: ${t.textMuted}; text-wrap: pretty; }
|
|
64
|
+
@container (max-width: 40rem) { .h { ${type("4xl")} } }
|
|
65
|
+
.actions { display: flex; flex-wrap: wrap; gap: ${space(3)} ${space(4)}; align-items: center; margin-block-start: ${space(2)}; }
|
|
66
|
+
:host([align='center']) .actions { justify-content: center; }
|
|
67
|
+
img { display: block; inline-size: 100%; block-size: auto; border-radius: ${t.radius2xl}; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: ${t.shadowLg}; }
|
|
68
|
+
@container (max-width: 48rem) { .hero.pictured { grid-template-columns: minmax(0, 1fr); } }
|
|
69
|
+
/* Cover: the picture fills the block edge to edge, a scrim keeps the words readable (1.4.3). */
|
|
70
|
+
.cover { position: relative; display: flex; flex-direction: column; justify-content: center; min-block-size: clamp(44rem, 61vw, 55rem); margin-inline: calc(var(--impkt-bleed, 1) * (50% - 50vw)); padding: ${space(32)} max(${space(8)}, calc(var(--impkt-bleed, 1) * (50vw - 50%))) ${space(24)}; overflow: hidden; color: #fff; --impkt-color-text-heading: #fff; }
|
|
71
|
+
.cover img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
|
|
72
|
+
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(18 31 26 / 0.82) 0%, rgb(18 31 26 / 0.42) 55%, rgb(18 31 26 / 0.05) 100%); }
|
|
73
|
+
.cover .words { position: relative; z-index: 1; max-inline-size: 48rem; }
|
|
74
|
+
.cover .eyebrow { display: inline-flex; align-items: center; gap: ${space(2)}; align-self: flex-start; padding: ${space(2)} ${space(3.5)}; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: 999px; text-transform: none; letter-spacing: 0; }
|
|
75
|
+
.chip-line { position: relative; z-index: 1; block-size: 0; }
|
|
76
|
+
.chip { position: absolute; inset-block-start: ${space(14)}; inset-inline-end: ${space(9)}; display: inline-flex; align-items: center; gap: ${space(2.5)}; padding: ${space(3)} ${space(4.5)}; ${type("sm")} font-weight: ${fontWeight("semibold")}; white-space: nowrap; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: ${t.radiusXl}; }
|
|
77
|
+
.finder { position: relative; z-index: 1; margin-block-start: ${space(12)}; }
|
|
78
|
+
.cover .h { font-size: clamp(3rem, 6.4vw, 5.75rem); line-height: 1; }
|
|
79
|
+
.cover .body { color: rgb(255 255 255 / 0.92); max-inline-size: 40rem; }
|
|
80
|
+
@container (max-width: 64rem) { .chip { display: none; } }
|
|
81
|
+
@container (max-width: 30rem) { .finder { display: none; } }
|
|
82
|
+
@container (max-width: 48rem) { .finder { margin-block-start: ${space(6)}; } .cover { justify-content: flex-end; min-block-size: 43.75rem; padding-block: ${space(32)} ${space(10)}; } .cover::after { background: linear-gradient(180deg, rgb(18 31 26 / 0.1) 0%, rgb(18 31 26 / 0.3) 42%, rgb(18 31 26 / 0.86) 100%); } .cover .h { font-size: 3rem; } }
|
|
83
|
+
`];
|
|
84
|
+
}
|
|
85
|
+
render() {
|
|
86
|
+
if (this.treatment === "cover" && this.imageSrc) {
|
|
87
|
+
return html`<div class="cover" part="hero">
|
|
88
|
+
${this.ratingText ? html`<div class="chip-line"><div class="chip">${iconSvg("star", "20px")}${this.ratingText}</div></div>` : nothing}
|
|
89
|
+
<img src=${this.imageSrc} alt=${this.imageAlt} part="image" />
|
|
90
|
+
<div class="words">
|
|
91
|
+
${this.eyebrow ? html`<p class="eyebrow" part="eyebrow">${this.eyebrowIcon !== "none" ? iconSvg(this.eyebrowIcon, "16px") : nothing}${this.eyebrow}</p>` : nothing}
|
|
92
|
+
${heading(this.level, this.heading, "h")}
|
|
93
|
+
${this.lead ? html`<p class="body">${this.lead}</p>` : nothing}
|
|
94
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
95
|
+
</div>
|
|
96
|
+
<div class="finder"><slot name="search"></slot></div>
|
|
97
|
+
</div>`;
|
|
98
|
+
}
|
|
99
|
+
const pictured = Boolean(this.imageSrc) && this.align !== "center";
|
|
100
|
+
return html`<div class="hero ${pictured ? "pictured" : ""}" part="hero">
|
|
101
|
+
<div class="words">
|
|
102
|
+
${this.eyebrow ? html`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>` : nothing}
|
|
103
|
+
${heading(this.level, this.heading, "h")}
|
|
104
|
+
${this.lead ? html`<p class="body">${this.lead}</p>` : nothing}
|
|
105
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
106
|
+
</div>
|
|
107
|
+
${pictured ? html`<img src=${this.imageSrc} alt=${this.imageAlt} part="image" />` : nothing}
|
|
108
|
+
</div>`;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
var ImpktFeatureList = class extends ImpktElement {
|
|
112
|
+
static {
|
|
113
|
+
this.properties = {
|
|
114
|
+
items: { type: Array },
|
|
115
|
+
columns: { type: String, reflect: true },
|
|
116
|
+
headingLevel: { type: Number, attribute: "heading-level" },
|
|
117
|
+
layout: { type: String, reflect: true },
|
|
118
|
+
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
119
|
+
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
constructor() {
|
|
123
|
+
super();
|
|
124
|
+
this.items = [];
|
|
125
|
+
this.columns = "three";
|
|
126
|
+
this.headingLevel = 3;
|
|
127
|
+
this.layout = "stacked";
|
|
128
|
+
this.spaceAbove = "none";
|
|
129
|
+
this.spaceBelow = "none";
|
|
130
|
+
}
|
|
131
|
+
static {
|
|
132
|
+
this.styles = [...ImpktElement.styles, spaceAround, headingStyles, css`
|
|
133
|
+
:host { display: block; container-type: inline-size; }
|
|
134
|
+
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(8)} ${space(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
135
|
+
:host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
136
|
+
:host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
137
|
+
li { display: flex; flex-direction: column; gap: ${space(2)}; }
|
|
138
|
+
:host([layout='inline']) li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: ${space(4)}; align-items: start; }
|
|
139
|
+
:host([layout='inline']) .words { display: flex; flex-direction: column; gap: ${space(1)}; }
|
|
140
|
+
.icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 48px; block-size: 48px; border-radius: ${t.radiusLg}; background: ${t.brandSubtle}; color: ${t.brand}; margin-block-end: ${space(2)}; }
|
|
141
|
+
:host([layout='inline']) .icon { margin: 0; }
|
|
142
|
+
.h { font-size: ${fontSize("lg")}; }
|
|
143
|
+
.body { color: ${t.text}; }
|
|
144
|
+
@container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
145
|
+
@container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
|
|
146
|
+
`];
|
|
147
|
+
}
|
|
148
|
+
render() {
|
|
149
|
+
return html`<ul part="list">${(this.items ?? []).map((item) => html`<li part="item">
|
|
150
|
+
${item.icon ? html`<span class="icon">${iconSvg(item.icon, "24px")}</span>` : nothing}
|
|
151
|
+
<div class="words">${heading(this.headingLevel, item.heading, "h")}${item.text ? html`<p class="body">${item.text}</p>` : nothing}</div>
|
|
152
|
+
</li>`)}</ul>`;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
var ImpktQuote = class extends ImpktElement {
|
|
156
|
+
static {
|
|
157
|
+
this.properties = {
|
|
158
|
+
quote: { type: String },
|
|
159
|
+
person: { type: String },
|
|
160
|
+
about: { type: String },
|
|
161
|
+
imageSrc: { type: String, attribute: "image-src" },
|
|
162
|
+
size: { type: String, reflect: true },
|
|
163
|
+
align: { type: String, reflect: true },
|
|
164
|
+
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
165
|
+
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
constructor() {
|
|
169
|
+
super();
|
|
170
|
+
this.quote = "";
|
|
171
|
+
this.person = "";
|
|
172
|
+
this.about = "";
|
|
173
|
+
this.imageSrc = "";
|
|
174
|
+
this.size = "md";
|
|
175
|
+
this.align = "start";
|
|
176
|
+
this.spaceAbove = "none";
|
|
177
|
+
this.spaceBelow = "none";
|
|
178
|
+
}
|
|
179
|
+
static {
|
|
180
|
+
this.styles = [...ImpktElement.styles, spaceAround, css`
|
|
181
|
+
:host { display: block; }
|
|
182
|
+
figure { margin: 0; display: flex; flex-direction: column; gap: ${space(4)}; max-inline-size: 48rem; }
|
|
183
|
+
:host([align='center']) figure { margin-inline: auto; align-items: center; text-align: center; }
|
|
184
|
+
blockquote { margin: 0; font-family: ${t.fontHeading}; font-size: ${fontSize("lg")}; line-height: ${lineHeight("normal")}; color: inherit; }
|
|
185
|
+
:host([size='lg']) blockquote { font-size: ${fontSize("2xl")}; line-height: ${lineHeight("tight")}; }
|
|
186
|
+
blockquote::before { content: '\\201C'; } blockquote::after { content: '\\201D'; }
|
|
187
|
+
figcaption { display: flex; align-items: center; gap: ${space(3)}; }
|
|
188
|
+
img { inline-size: 48px; block-size: 48px; border-radius: 50%; object-fit: cover; }
|
|
189
|
+
.name { font-weight: ${fontWeight("semibold")}; }
|
|
190
|
+
.detail { color: ${t.textMuted}; font-size: ${fontSize("sm")}; }
|
|
191
|
+
`];
|
|
192
|
+
}
|
|
193
|
+
render() {
|
|
194
|
+
return html`<figure part="figure">
|
|
195
|
+
<blockquote part="quote">${this.quote}</blockquote>
|
|
196
|
+
${this.person ? html`<figcaption>${this.imageSrc ? html`<img src=${this.imageSrc} alt="" />` : nothing}<span><span class="name">${this.person}</span>${this.about ? html`<br /><span class="detail">${this.about}</span>` : nothing}</span></figcaption>` : nothing}
|
|
197
|
+
</figure>`;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
var ImpktStat = class extends ImpktElement {
|
|
201
|
+
static {
|
|
202
|
+
this.properties = {
|
|
203
|
+
figure: { type: String },
|
|
204
|
+
label: { type: String },
|
|
205
|
+
note: { type: String },
|
|
206
|
+
size: { type: String, reflect: true },
|
|
207
|
+
align: { type: String, reflect: true }
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
constructor() {
|
|
211
|
+
super();
|
|
212
|
+
this.figure = "";
|
|
213
|
+
this.label = "";
|
|
214
|
+
this.note = "";
|
|
215
|
+
this.size = "md";
|
|
216
|
+
this.align = "start";
|
|
217
|
+
}
|
|
218
|
+
static {
|
|
219
|
+
this.styles = [...ImpktElement.styles, css`
|
|
220
|
+
:host { display: block; }
|
|
221
|
+
.stat { display: flex; flex-direction: column; gap: ${space(1)}; }
|
|
222
|
+
:host([align='center']) .stat { align-items: center; text-align: center; }
|
|
223
|
+
.value { font-family: ${t.fontHeading}; font-size: ${fontSize("3xl")}; font-weight: ${fontWeight("bold")}; line-height: 1; color: ${t.textHeading}; }
|
|
224
|
+
:host([size='lg']) .value { font-size: ${fontSize("5xl")}; }
|
|
225
|
+
:host([size='xl']) .value { font-size: clamp(2.75rem, 6vw, 4rem); }
|
|
226
|
+
.label { font-weight: ${fontWeight("semibold")}; }
|
|
227
|
+
.detail { color: ${t.textMuted}; font-size: ${fontSize("sm")}; }
|
|
228
|
+
`];
|
|
229
|
+
}
|
|
230
|
+
render() {
|
|
231
|
+
return html`<p class="stat" part="stat" style="margin:0"><span class="value">${this.figure}</span> <span class="label">${this.label}</span>${this.note ? html` <span class="detail">${this.note}</span>` : nothing}</p>`;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
var ImpktBadge = class extends ImpktElement {
|
|
235
|
+
static {
|
|
236
|
+
this.properties = {
|
|
237
|
+
tone: { type: String, reflect: true },
|
|
238
|
+
icon: { type: String }
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
constructor() {
|
|
242
|
+
super();
|
|
243
|
+
this.tone = "neutral";
|
|
244
|
+
this.icon = "none";
|
|
245
|
+
}
|
|
246
|
+
static {
|
|
247
|
+
this.styles = [...ImpktElement.styles, css`
|
|
248
|
+
:host { display: inline-flex; }
|
|
249
|
+
span { display: inline-flex; align-items: center; gap: ${space(1)}; padding: ${space(0.5)} ${space(2)}; border-radius: ${t.radius}; ${type("xs")} font-weight: ${fontWeight("medium")}; background: ${t.surfaceInset}; color: ${t.text}; box-shadow: inset 0 0 0 1px ${t.hairline}; }
|
|
250
|
+
:host([tone='brand']) span { background: ${t.brandSubtle}; color: ${t.brand}; }
|
|
251
|
+
:host([tone='success']) span { background: ${t.successSubtle}; color: ${t.successText}; }
|
|
252
|
+
:host([tone='warning']) span { background: ${t.warningSubtle}; color: ${t.warningText}; }
|
|
253
|
+
:host([tone='danger']) span { background: ${t.dangerSubtle}; color: ${t.dangerText}; }
|
|
254
|
+
:host([tone='info']) span { background: ${t.infoSubtle}; color: ${t.infoText}; }
|
|
255
|
+
@media (forced-colors: active) { span { border-color: CanvasText; } }
|
|
256
|
+
`];
|
|
257
|
+
}
|
|
258
|
+
render() {
|
|
259
|
+
return html`<span part="badge">${iconSvg(this.icon, "1em")}<slot></slot></span>`;
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
var ImpktAnnouncement = class extends ImpktElement {
|
|
263
|
+
static {
|
|
264
|
+
this.properties = {
|
|
265
|
+
message: { type: String },
|
|
266
|
+
linkText: { type: String, attribute: "link-text" },
|
|
267
|
+
href: { type: String }
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
constructor() {
|
|
271
|
+
super();
|
|
272
|
+
this.message = "";
|
|
273
|
+
this.linkText = "";
|
|
274
|
+
this.href = "";
|
|
275
|
+
}
|
|
276
|
+
static {
|
|
277
|
+
this.styles = [...ImpktElement.styles, css`
|
|
278
|
+
:host { display: block; }
|
|
279
|
+
.bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: ${space(2)} ${space(3)}; padding: ${space(2.5)} ${space(5)}; ${type("sm")} text-align: center; color: ${t.onBrand}; background: ${t.brand}; }
|
|
280
|
+
:host { margin-inline: calc(var(--impkt-bleed, 1) * (50% - 50vw)); }
|
|
281
|
+
a { display: inline-flex; align-items: center; gap: ${space(1)}; color: inherit; font-weight: ${fontWeight("semibold")}; }
|
|
282
|
+
`];
|
|
283
|
+
}
|
|
284
|
+
render() {
|
|
285
|
+
return html`<div class="bar" part="bar"><span>${this.message}</span>${this.linkText && this.href ? html`<a href=${this.href}>${this.linkText}${iconSvg("arrow-right", "14px")}</a>` : nothing}</div>`;
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
var ImpktSearchBar = class extends ImpktElement {
|
|
289
|
+
static {
|
|
290
|
+
this.properties = {
|
|
291
|
+
items: { type: Array },
|
|
292
|
+
buttonText: { type: String, attribute: "button-text" },
|
|
293
|
+
action: { type: String },
|
|
294
|
+
label: { type: String },
|
|
295
|
+
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
296
|
+
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
constructor() {
|
|
300
|
+
super();
|
|
301
|
+
this.items = [];
|
|
302
|
+
this.buttonText = "Search";
|
|
303
|
+
this.action = "";
|
|
304
|
+
this.label = "Search";
|
|
305
|
+
this.spaceAbove = "none";
|
|
306
|
+
this.spaceBelow = "none";
|
|
307
|
+
}
|
|
308
|
+
static {
|
|
309
|
+
this.styles = [...ImpktElement.styles, spaceAround, css`
|
|
310
|
+
:host { display: block; container-type: inline-size; }
|
|
311
|
+
form { display: flex; align-items: center; padding: ${space(3)}; background: ${t.surfaceCard}; color: ${t.text}; border-radius: ${t.radius2xl}; box-shadow: ${t.shadowXl}; }
|
|
312
|
+
.field { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${space(1)}; padding: ${space(1.5)} ${space(5)}; }
|
|
313
|
+
label { ${type("sm")} color: ${t.textMuted}; }
|
|
314
|
+
select { inline-size: 100%; min-block-size: 28px; padding: 0; font: inherit; ${type("sm")} font-weight: ${fontWeight("semibold")}; color: ${t.text}; background: transparent; border: 0; border-radius: ${t.radiusSm}; cursor: pointer; }
|
|
315
|
+
select:focus-visible, button:focus-visible { outline: 2px solid ${t.brand}; outline-offset: 2px; }
|
|
316
|
+
button { flex: none; min-block-size: 48px; padding: ${space(3)} ${space(6)}; font: inherit; font-weight: ${fontWeight("semibold")}; color: ${t.onBrand}; background: ${t.brand}; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }
|
|
317
|
+
button:hover { background: ${t.brandHover}; }
|
|
318
|
+
@container (max-width: 56rem) { form { flex-wrap: wrap; } .field { flex: 1 1 40%; } button { inline-size: 100%; } }
|
|
319
|
+
@container (max-width: 30rem) { form { flex-direction: column; align-items: stretch; gap: ${space(2)}; } .field { flex: none; } }
|
|
320
|
+
`];
|
|
321
|
+
}
|
|
322
|
+
submit(event) {
|
|
323
|
+
const data = new FormData(event.currentTarget);
|
|
324
|
+
const values = {};
|
|
325
|
+
data.forEach((value, key) => {
|
|
326
|
+
if (value !== "") values[key] = String(value);
|
|
327
|
+
});
|
|
328
|
+
this.dispatchEvent(new CustomEvent("impkt-submit", { detail: { values }, bubbles: true, composed: true }));
|
|
329
|
+
if (!this.action) event.preventDefault();
|
|
330
|
+
}
|
|
331
|
+
render() {
|
|
332
|
+
return html`<form role="search" aria-label=${this.label} method="get" action=${this.action || nothing} @submit=${this.submit} part="form">
|
|
333
|
+
${(this.items ?? []).map((field, i) => {
|
|
334
|
+
const id = this.id_(`field-${i}`);
|
|
335
|
+
const choices = String(field.options ?? "").split(",").map((o) => o.trim()).filter(Boolean);
|
|
336
|
+
return html`<div class="field"><label for=${id}>${field.label}</label><select id=${id} name=${field.name || field.label.toLowerCase().replace(/[^a-z0-9]+/g, "-")}>
|
|
337
|
+
<option value="">${field.placeholder || "Any"}</option>${choices.map((c) => html`<option value=${c}>${c}</option>`)}
|
|
338
|
+
</select></div>`;
|
|
339
|
+
})}
|
|
340
|
+
<button type="submit">${this.buttonText}</button>
|
|
341
|
+
</form>`;
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
customElements.define("impkt-search-bar", ImpktSearchBar);
|
|
345
|
+
customElements.define("impkt-announcement", ImpktAnnouncement);
|
|
346
|
+
customElements.define("impkt-hero", ImpktHero);
|
|
347
|
+
customElements.define("impkt-feature-list", ImpktFeatureList);
|
|
348
|
+
customElements.define("impkt-quote", ImpktQuote);
|
|
349
|
+
customElements.define("impkt-stat", ImpktStat);
|
|
350
|
+
customElements.define("impkt-badge", ImpktBadge);
|
|
351
|
+
|
|
352
|
+
export {
|
|
353
|
+
ImpktHero,
|
|
354
|
+
ImpktFeatureList,
|
|
355
|
+
ImpktQuote,
|
|
356
|
+
ImpktStat,
|
|
357
|
+
ImpktBadge,
|
|
358
|
+
ImpktAnnouncement,
|
|
359
|
+
ImpktSearchBar
|
|
360
|
+
};
|
|
361
|
+
//# sourceMappingURL=chunk-7Y6UCSUS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/marketing.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { fontSize, fontWeight, lineHeight, space, spaceAround, t, type } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/** A heading at a level the author chose, drawn at a size the component chose. */\nconst heading = (level: number, text: string, cls: string): TemplateResult =>\n html`<div class=${cls} role=\"heading\" aria-level=${level}>${text}</div>`;\n\nconst headingStyles = css`\n .h { margin: 0; color: ${t.textHeading}; font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; line-height: ${lineHeight('tight')}; }\n .eyebrow { margin: 0; color: var(--impkt-eyebrow, ${t.brand}); ${type('sm')} font-weight: ${fontWeight('semibold')}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; }\n .body { margin: 0; line-height: ${lineHeight('normal')}; max-inline-size: 65ch; }\n`;\n\n/**\n * The opening of a page: a short label, a big heading, a line of text, the\n * page's main actions and, beside them, a picture.\n *\n * Put the buttons in the `actions` slot. The picture goes beside the words on\n * a wide screen and below them on a phone, so the heading is always the first\n * thing read.\n *\n * @category layout\n * @icon hero\n * @role heading\n * @slot actions - The page's main buttons and links.\n * @slot search - A search bar across the bottom of a full-picture hero.\n */\nexport class ImpktHero extends ImpktElement {\n static properties = {\n eyebrow: { type: String },\n heading: { type: String },\n lead: { type: String },\n level: { type: Number, reflect: true },\n imageSrc: { type: String, attribute: 'image-src' },\n imageAlt: { type: String, attribute: 'image-alt' },\n treatment: { type: String, reflect: true },\n ratingText: { type: String, attribute: 'rating-text' },\n eyebrowIcon: { type: String, attribute: 'eyebrow-icon' },\n align: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** A short label above the heading, such as the name of the development. */\n declare eyebrow: string;\n declare heading: string;\n /** A sentence or two under the heading. */\n declare lead: string;\n /** The heading's level in the page. A page's hero is usually its only level 1. */\n declare level: 1 | 2;\n declare imageSrc: string;\n /** What the picture shows. Leave empty only when it is decoration. */\n declare imageAlt: string;\n /** The picture beside the words, or filling the whole block with the words over it. */\n declare treatment: 'split' | 'cover';\n /** A short line of proof on the picture, such as \"4.8 from 312 buyers\". */\n declare ratingText: string;\n /** A small picture before the eyebrow on a full-picture hero. */\n declare eyebrowIcon: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat';\n /** Where the words sit. Centred heroes have no picture beside them. */\n declare align: 'start' | 'center';\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.eyebrow = '';\n this.heading = '';\n this.lead = '';\n this.level = 1;\n this.imageSrc = '';\n this.imageAlt = '';\n this.treatment = 'split';\n this.ratingText = '';\n this.eyebrowIcon = 'none';\n this.align = 'start';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, headingStyles, css`\n :host { display: block; container-type: inline-size; }\n .hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: ${space(8)}; align-items: center; }\n .hero.pictured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }\n .words { display: flex; flex-direction: column; gap: ${space(4)}; }\n :host([align='center']) .words { align-items: center; text-align: center; margin-inline: auto; max-inline-size: 48rem; }\n .h { ${type('5xl')} letter-spacing: ${t.trackingTight}; text-wrap: balance; }\n .body { ${type('lg')} color: ${t.textMuted}; text-wrap: pretty; }\n @container (max-width: 40rem) { .h { ${type('4xl')} } }\n .actions { display: flex; flex-wrap: wrap; gap: ${space(3)} ${space(4)}; align-items: center; margin-block-start: ${space(2)}; }\n :host([align='center']) .actions { justify-content: center; }\n img { display: block; inline-size: 100%; block-size: auto; border-radius: ${t.radius2xl}; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: ${t.shadowLg}; }\n @container (max-width: 48rem) { .hero.pictured { grid-template-columns: minmax(0, 1fr); } }\n /* Cover: the picture fills the block edge to edge, a scrim keeps the words readable (1.4.3). */\n .cover { position: relative; display: flex; flex-direction: column; justify-content: center; min-block-size: clamp(44rem, 61vw, 55rem); margin-inline: calc(var(--impkt-bleed, 1) * (50% - 50vw)); padding: ${space(32)} max(${space(8)}, calc(var(--impkt-bleed, 1) * (50vw - 50%))) ${space(24)}; overflow: hidden; color: #fff; --impkt-color-text-heading: #fff; }\n .cover img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }\n .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(18 31 26 / 0.82) 0%, rgb(18 31 26 / 0.42) 55%, rgb(18 31 26 / 0.05) 100%); }\n .cover .words { position: relative; z-index: 1; max-inline-size: 48rem; }\n .cover .eyebrow { display: inline-flex; align-items: center; gap: ${space(2)}; align-self: flex-start; padding: ${space(2)} ${space(3.5)}; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: 999px; text-transform: none; letter-spacing: 0; }\n .chip-line { position: relative; z-index: 1; block-size: 0; }\n .chip { position: absolute; inset-block-start: ${space(14)}; inset-inline-end: ${space(9)}; display: inline-flex; align-items: center; gap: ${space(2.5)}; padding: ${space(3)} ${space(4.5)}; ${type('sm')} font-weight: ${fontWeight('semibold')}; white-space: nowrap; color: #fff; background: rgb(255 255 255 / 0.16); border-radius: ${t.radiusXl}; }\n .finder { position: relative; z-index: 1; margin-block-start: ${space(12)}; }\n .cover .h { font-size: clamp(3rem, 6.4vw, 5.75rem); line-height: 1; }\n .cover .body { color: rgb(255 255 255 / 0.92); max-inline-size: 40rem; }\n @container (max-width: 64rem) { .chip { display: none; } }\n @container (max-width: 30rem) { .finder { display: none; } }\n @container (max-width: 48rem) { .finder { margin-block-start: ${space(6)}; } .cover { justify-content: flex-end; min-block-size: 43.75rem; padding-block: ${space(32)} ${space(10)}; } .cover::after { background: linear-gradient(180deg, rgb(18 31 26 / 0.1) 0%, rgb(18 31 26 / 0.3) 42%, rgb(18 31 26 / 0.86) 100%); } .cover .h { font-size: 3rem; } }\n `];\n\n render(): TemplateResult {\n if (this.treatment === 'cover' && this.imageSrc) {\n return html`<div class=\"cover\" part=\"hero\">\n ${this.ratingText ? html`<div class=\"chip-line\"><div class=\"chip\">${iconSvg('star', '20px')}${this.ratingText}</div></div>` : nothing}\n <img src=${this.imageSrc} alt=${this.imageAlt} part=\"image\" />\n <div class=\"words\">\n ${this.eyebrow ? html`<p class=\"eyebrow\" part=\"eyebrow\">${this.eyebrowIcon !== 'none' ? iconSvg(this.eyebrowIcon, '16px') : nothing}${this.eyebrow}</p>` : nothing}\n ${heading(this.level, this.heading, 'h')}\n ${this.lead ? html`<p class=\"body\">${this.lead}</p>` : nothing}\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>\n <div class=\"finder\"><slot name=\"search\"></slot></div>\n </div>`;\n }\n const pictured = Boolean(this.imageSrc) && this.align !== 'center';\n return html`<div class=\"hero ${pictured ? 'pictured' : ''}\" part=\"hero\">\n <div class=\"words\">\n ${this.eyebrow ? html`<p class=\"eyebrow\" part=\"eyebrow\">${this.eyebrow}</p>` : nothing}\n ${heading(this.level, this.heading, 'h')}\n ${this.lead ? html`<p class=\"body\">${this.lead}</p>` : nothing}\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>\n ${pictured ? html`<img src=${this.imageSrc} alt=${this.imageAlt} part=\"image\" />` : nothing}\n </div>`;\n }\n}\n\n/** One benefit or feature in a list of them. */\nexport interface FeatureItem {\n id?: string;\n icon?: string;\n heading: string;\n text?: string;\n}\n\n/**\n * Benefits or features side by side, each with an icon, a short heading and a\n * line of text: \"Ten years of cover\", \"Lower bills from day one\".\n *\n * The icons are decoration, because each heading already says what it is.\n * The items are a list, so a screen reader says how many there are.\n *\n * @category content\n * @icon features\n */\nexport class ImpktFeatureList extends ImpktElement {\n static properties = {\n items: { type: Array },\n columns: { type: String, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n layout: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare items: FeatureItem[];\n declare columns: 'two' | 'three' | 'four';\n /** The level of each item's heading. One below the heading above the list. */\n declare headingLevel: 2 | 3 | 4;\n /** Icons above the words, or beside them. */\n declare layout: 'stacked' | 'inline';\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.items = [];\n this.columns = 'three';\n this.headingLevel = 3;\n this.layout = 'stacked';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, headingStyles, css`\n :host { display: block; container-type: inline-size; }\n ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(8)} ${space(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }\n :host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n :host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }\n li { display: flex; flex-direction: column; gap: ${space(2)}; }\n :host([layout='inline']) li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: ${space(4)}; align-items: start; }\n :host([layout='inline']) .words { display: flex; flex-direction: column; gap: ${space(1)}; }\n .icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 48px; block-size: 48px; border-radius: ${t.radiusLg}; background: ${t.brandSubtle}; color: ${t.brand}; margin-block-end: ${space(2)}; }\n :host([layout='inline']) .icon { margin: 0; }\n .h { font-size: ${fontSize('lg')}; }\n .body { color: ${t.text}; }\n @container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n @container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }\n `];\n\n render(): TemplateResult {\n return html`<ul part=\"list\">${(this.items ?? []).map((item) => html`<li part=\"item\">\n ${item.icon ? html`<span class=\"icon\">${iconSvg(item.icon, '24px')}</span>` : nothing}\n <div class=\"words\">${heading(this.headingLevel, item.heading, 'h')}${item.text ? html`<p class=\"body\">${item.text}</p>` : nothing}</div>\n </li>`)}</ul>`;\n }\n}\n\n/**\n * Something a customer said, and who said it.\n *\n * It is a `blockquote` with a `figcaption`, so the words and the person are\n * tied together for a screen reader as well as on the screen.\n *\n * @category content\n * @icon quote\n */\nexport class ImpktQuote extends ImpktElement {\n static properties = {\n quote: { type: String },\n person: { type: String },\n about: { type: String },\n imageSrc: { type: String, attribute: 'image-src' },\n size: { type: String, reflect: true },\n align: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** The words they said, without quotation marks. */\n declare quote: string;\n /** Who said it. */\n declare person: string;\n /** Who they are, such as \"Bought at Larkfield Meadows, 2025\". */\n declare about: string;\n /** A photo of them. It is decoration, because their name is beside it. */\n declare imageSrc: string;\n declare size: 'md' | 'lg';\n declare align: 'start' | 'center';\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.quote = '';\n this.person = '';\n this.about = '';\n this.imageSrc = '';\n this.size = 'md';\n this.align = 'start';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, css`\n :host { display: block; }\n figure { margin: 0; display: flex; flex-direction: column; gap: ${space(4)}; max-inline-size: 48rem; }\n :host([align='center']) figure { margin-inline: auto; align-items: center; text-align: center; }\n blockquote { margin: 0; font-family: ${t.fontHeading}; font-size: ${fontSize('lg')}; line-height: ${lineHeight('normal')}; color: inherit; }\n :host([size='lg']) blockquote { font-size: ${fontSize('2xl')}; line-height: ${lineHeight('tight')}; }\n blockquote::before { content: '\\\\201C'; } blockquote::after { content: '\\\\201D'; }\n figcaption { display: flex; align-items: center; gap: ${space(3)}; }\n img { inline-size: 48px; block-size: 48px; border-radius: 50%; object-fit: cover; }\n .name { font-weight: ${fontWeight('semibold')}; }\n .detail { color: ${t.textMuted}; font-size: ${fontSize('sm')}; }\n `];\n\n render(): TemplateResult {\n return html`<figure part=\"figure\">\n <blockquote part=\"quote\">${this.quote}</blockquote>\n ${this.person ? html`<figcaption>${this.imageSrc ? html`<img src=${this.imageSrc} alt=\"\" />` : nothing}<span><span class=\"name\">${this.person}</span>${this.about ? html`<br /><span class=\"detail\">${this.about}</span>` : nothing}</span></figcaption>` : nothing}\n </figure>`;\n }\n}\n\n/**\n * A number that makes a point, with what it counts beneath it: \"36 years\",\n * \"Building in Kent since 1987\".\n *\n * @category content\n * @icon stat\n */\nexport class ImpktStat extends ImpktElement {\n static properties = {\n figure: { type: String },\n label: { type: String },\n note: { type: String },\n size: { type: String, reflect: true },\n align: { type: String, reflect: true },\n };\n /** How large the number is drawn. */\n declare size: 'md' | 'lg' | 'xl';\n /** The number, written as it should appear, such as \"36\" or \"£280k\". */\n declare figure: string;\n /** What the number counts. */\n declare label: string;\n /** A line more, if the label needs it. */\n declare note: string;\n declare align: 'start' | 'center';\n\n constructor() {\n super();\n this.figure = '';\n this.label = '';\n this.note = '';\n this.size = 'md';\n this.align = 'start';\n }\n\n static styles = [...ImpktElement.styles, css`\n :host { display: block; }\n .stat { display: flex; flex-direction: column; gap: ${space(1)}; }\n :host([align='center']) .stat { align-items: center; text-align: center; }\n .value { font-family: ${t.fontHeading}; font-size: ${fontSize('3xl')}; font-weight: ${fontWeight('bold')}; line-height: 1; color: ${t.textHeading}; }\n :host([size='lg']) .value { font-size: ${fontSize('5xl')}; }\n :host([size='xl']) .value { font-size: clamp(2.75rem, 6vw, 4rem); }\n .label { font-weight: ${fontWeight('semibold')}; }\n .detail { color: ${t.textMuted}; font-size: ${fontSize('sm')}; }\n `];\n\n render(): TemplateResult {\n // Read as one phrase, \"36 years\", rather than a bare number and then a label.\n return html`<p class=\"stat\" part=\"stat\" style=\"margin:0\"><span class=\"value\">${this.figure}</span> <span class=\"label\">${this.label}</span>${this.note ? html` <span class=\"detail\">${this.note}</span>` : nothing}</p>`;\n }\n}\n\n/**\n * A short label on something: \"New\", \"Selling fast\", \"2 left\".\n *\n * The tone colours it, and the words carry the meaning, so it reads the same\n * without the colour (1.4.1).\n *\n * @category feedback\n * @icon badge\n * @slot - The badge's words.\n */\nexport class ImpktBadge extends ImpktElement {\n static properties = {\n tone: { type: String, reflect: true },\n icon: { type: String },\n };\n declare tone: 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'info';\n /** An icon before the words. */\n declare icon: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat';\n\n constructor() {\n super();\n this.tone = 'neutral';\n this.icon = 'none';\n }\n\n static styles = [...ImpktElement.styles, css`\n :host { display: inline-flex; }\n span { display: inline-flex; align-items: center; gap: ${space(1)}; padding: ${space(0.5)} ${space(2)}; border-radius: ${t.radius}; ${type('xs')} font-weight: ${fontWeight('medium')}; background: ${t.surfaceInset}; color: ${t.text}; box-shadow: inset 0 0 0 1px ${t.hairline}; }\n :host([tone='brand']) span { background: ${t.brandSubtle}; color: ${t.brand}; }\n :host([tone='success']) span { background: ${t.successSubtle}; color: ${t.successText}; }\n :host([tone='warning']) span { background: ${t.warningSubtle}; color: ${t.warningText}; }\n :host([tone='danger']) span { background: ${t.dangerSubtle}; color: ${t.dangerText}; }\n :host([tone='info']) span { background: ${t.infoSubtle}; color: ${t.infoText}; }\n @media (forced-colors: active) { span { border-color: CanvasText; } }\n `];\n\n render(): TemplateResult {\n return html`<span part=\"badge\">${iconSvg(this.icon, '1em')}<slot></slot></span>`;\n }\n}\n\n/**\n * A thin line of news across the top of a page: a launch, a change to opening\n * hours. Keep it to one short sentence.\n *\n * @category feedback\n * @icon alert\n */\nexport class ImpktAnnouncement extends ImpktElement {\n static properties = {\n message: { type: String },\n linkText: { type: String, attribute: 'link-text' },\n href: { type: String },\n };\n declare message: string;\n declare linkText: string;\n declare href: string;\n\n constructor() {\n super();\n this.message = '';\n this.linkText = '';\n this.href = '';\n }\n\n static styles = [...ImpktElement.styles, css`\n :host { display: block; }\n .bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: ${space(2)} ${space(3)}; padding: ${space(2.5)} ${space(5)}; ${type('sm')} text-align: center; color: ${t.onBrand}; background: ${t.brand}; }\n :host { margin-inline: calc(var(--impkt-bleed, 1) * (50% - 50vw)); }\n a { display: inline-flex; align-items: center; gap: ${space(1)}; color: inherit; font-weight: ${fontWeight('semibold')}; }\n `];\n\n render(): TemplateResult {\n return html`<div class=\"bar\" part=\"bar\"><span>${this.message}</span>${this.linkText && this.href ? html`<a href=${this.href}>${this.linkText}${iconSvg('arrow-right', '14px')}</a>` : nothing}</div>`;\n }\n}\n\n/** One choice in a search bar. */\nexport interface SearchField {\n id?: string;\n /** The name it sends, such as \"bedrooms\". */\n name?: string;\n label: string;\n /** What it shows before anything is chosen. */\n placeholder?: string;\n /** The other choices, separated by commas. */\n options?: string;\n}\n\n/**\n * A row of choices and one button that finds what fits: where, how many\n * bedrooms, up to what budget.\n *\n * Each choice is a native select with a real label. It sends the visitor to\n * `action` with their choices in the address, so it works as a plain link can.\n *\n * @category form\n * @icon search\n * @fires impkt-submit - When the search is run. The choices are in detail.values.\n */\nexport class ImpktSearchBar extends ImpktElement {\n static properties = {\n items: { type: Array },\n buttonText: { type: String, attribute: 'button-text' },\n action: { type: String },\n label: { type: String },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare items: SearchField[];\n declare buttonText: string;\n /** Where the search goes. Leave empty to handle it in the app. */\n declare action: string;\n /** What the search is called for a screen reader. */\n declare label: string;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.items = [];\n this.buttonText = 'Search';\n this.action = '';\n this.label = 'Search';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, css`\n :host { display: block; container-type: inline-size; }\n form { display: flex; align-items: center; padding: ${space(3)}; background: ${t.surfaceCard}; color: ${t.text}; border-radius: ${t.radius2xl}; box-shadow: ${t.shadowXl}; }\n .field { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${space(1)}; padding: ${space(1.5)} ${space(5)}; }\n label { ${type('sm')} color: ${t.textMuted}; }\n select { inline-size: 100%; min-block-size: 28px; padding: 0; font: inherit; ${type('sm')} font-weight: ${fontWeight('semibold')}; color: ${t.text}; background: transparent; border: 0; border-radius: ${t.radiusSm}; cursor: pointer; }\n select:focus-visible, button:focus-visible { outline: 2px solid ${t.brand}; outline-offset: 2px; }\n button { flex: none; min-block-size: 48px; padding: ${space(3)} ${space(6)}; font: inherit; font-weight: ${fontWeight('semibold')}; color: ${t.onBrand}; background: ${t.brand}; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }\n button:hover { background: ${t.brandHover}; }\n @container (max-width: 56rem) { form { flex-wrap: wrap; } .field { flex: 1 1 40%; } button { inline-size: 100%; } }\n @container (max-width: 30rem) { form { flex-direction: column; align-items: stretch; gap: ${space(2)}; } .field { flex: none; } }\n `];\n\n private submit(event: SubmitEvent): void {\n const data = new FormData(event.currentTarget as HTMLFormElement);\n const values: Record<string, string> = {};\n data.forEach((value, key) => { if (value !== '') values[key] = String(value); });\n this.dispatchEvent(new CustomEvent('impkt-submit', { detail: { values }, bubbles: true, composed: true }));\n if (!this.action) event.preventDefault();\n }\n\n render(): TemplateResult {\n return html`<form role=\"search\" aria-label=${this.label} method=\"get\" action=${this.action || nothing} @submit=${this.submit} part=\"form\">\n ${(this.items ?? []).map((field, i) => {\n const id = this.id_(`field-${i}`);\n const choices = String(field.options ?? '').split(',').map((o) => o.trim()).filter(Boolean);\n return html`<div class=\"field\"><label for=${id}>${field.label}</label><select id=${id} name=${field.name || field.label.toLowerCase().replace(/[^a-z0-9]+/g, '-')}>\n <option value=\"\">${field.placeholder || 'Any'}</option>${choices.map((c) => html`<option value=${c}>${c}</option>`)}\n </select></div>`;\n })}\n <button type=\"submit\">${this.buttonText}</button>\n </form>`;\n }\n}\n\ncustomElements.define('impkt-search-bar', ImpktSearchBar);\ncustomElements.define('impkt-announcement', ImpktAnnouncement);\ncustomElements.define('impkt-hero', ImpktHero);\ncustomElements.define('impkt-feature-list', ImpktFeatureList);\ncustomElements.define('impkt-quote', ImpktQuote);\ncustomElements.define('impkt-stat', ImpktStat);\ncustomElements.define('impkt-badge', ImpktBadge);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-hero': ImpktHero; 'impkt-feature-list': ImpktFeatureList; 'impkt-quote': ImpktQuote; 'impkt-stat': ImpktStat; 'impkt-badge': ImpktBadge;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAMxD,IAAM,UAAU,CAAC,OAAe,MAAc,QAC5C,kBAAkB,GAAG,8BAA8B,KAAK,IAAI,IAAI;AAElE,IAAM,gBAAgB;AAAA,2BACK,EAAE,WAAW,kBAAkB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G,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,OAAO;AAC1F,aAAO,qCAAqC,EAAE,IAAI,MAAM,KAAK,sBAAsB,EAAE,SAAS,MAAM,QAAQ,MAAM,MAAM,YAAY,EAAE,QAAQ,eAAe,GAAG,CAAC;AAAA,6BAC5I,MAAM,eAAe,KAAK,YAAY,QAAQ,IAAI,CAAC,MAAM,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC;AAAA;AAAA,IAEvH,CAAC,CAAC;AAAA,8BACsB,KAAK,UAAU;AAAA;AAAA,EAE3C;AACF;AAEA,eAAe,OAAO,oBAAoB,cAAc;AACxD,eAAe,OAAO,sBAAsB,iBAAiB;AAC7D,eAAe,OAAO,cAAc,SAAS;AAC7C,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,eAAe,UAAU;AAC/C,eAAe,OAAO,cAAc,SAAS;AAC7C,eAAe,OAAO,eAAe,UAAU;","names":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ImpktElement,
|
|
3
|
+
fontSize,
|
|
4
|
+
fontWeight,
|
|
5
|
+
lineHeight,
|
|
6
|
+
space,
|
|
7
|
+
t
|
|
8
|
+
} from "./chunk-NTNXHLTM.js";
|
|
9
|
+
|
|
10
|
+
// packages/ui/src/components/fieldset.ts
|
|
11
|
+
import { css, html, nothing } from "lit";
|
|
12
|
+
var ImpktFieldset = class extends ImpktElement {
|
|
13
|
+
static {
|
|
14
|
+
this.properties = {
|
|
15
|
+
legend: { type: String },
|
|
16
|
+
description: { type: String },
|
|
17
|
+
error: { type: String, reflect: true },
|
|
18
|
+
size: { type: String, reflect: true }
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.legend = "";
|
|
24
|
+
this.description = "";
|
|
25
|
+
this.error = "";
|
|
26
|
+
this.size = "md";
|
|
27
|
+
}
|
|
28
|
+
static {
|
|
29
|
+
this.styles = [...ImpktElement.styles, css`
|
|
30
|
+
:host { display: block; margin-block-end: ${space(6)}; }
|
|
31
|
+
fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
|
|
32
|
+
legend { padding: 0; margin-block-end: ${space(2)}; font-size: ${fontSize("md")}; font-weight: ${fontWeight("bold")}; line-height: ${lineHeight("tight")}; color: ${t.text}; }
|
|
33
|
+
:host([size='lg']) legend { font-size: ${fontSize("xl")}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }
|
|
34
|
+
:host([size='xl']) legend { font-size: ${fontSize("2xl")}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }
|
|
35
|
+
.description { margin-block-end: ${space(3)}; font-size: ${fontSize("sm")}; color: ${t.textMuted}; line-height: ${lineHeight("normal")}; }
|
|
36
|
+
.error { margin-block-end: ${space(3)}; font-size: ${fontSize("sm")}; color: ${t.dangerText}; font-weight: ${fontWeight("semibold")}; }
|
|
37
|
+
.error:empty { display: none; }
|
|
38
|
+
:host([error]:not([error=''])) .fields { padding-inline-start: ${space(4)}; border-inline-start: 4px solid ${t.danger}; }
|
|
39
|
+
`];
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
const described = [this.description ? this.id_("description") : "", this.error ? this.id_("error") : ""].filter(Boolean).join(" ");
|
|
43
|
+
return html`<fieldset part="fieldset" aria-describedby=${described || nothing}>
|
|
44
|
+
<legend part="legend">${this.legend}</legend>
|
|
45
|
+
${this.description ? html`<div class="description" id=${this.id_("description")}>${this.description}</div>` : nothing}
|
|
46
|
+
<div class="error" id=${this.id_("error")} aria-live="polite">${this.error || nothing}</div>
|
|
47
|
+
<div class="fields" part="fields"><slot></slot></div>
|
|
48
|
+
</fieldset>`;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
customElements.define("impkt-fieldset", ImpktFieldset);
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
ImpktFieldset
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=chunk-BTGCUONV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/fieldset.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { fontSize, fontWeight, lineHeight, space, t } from '../base/tokens';\n\n/**\n * Fields that belong together under one question: the lines of an address,\n * or a name in two parts.\n *\n * **The question is the group's name.** It is a `fieldset` with a `legend`, so\n * a screen reader says \"Your address, group\" on the way in, and each field\n * inside is heard as part of it (1.3.1, 3.3.2). An error for the group as a\n * whole, such as \"Enter a full address\", is tied to it the same way.\n *\n * @category form\n * @icon fieldset\n * @slot - The fields in the group.\n */\nexport class ImpktFieldset extends ImpktElement {\n static properties = {\n legend: { type: String },\n description: { type: String },\n error: { type: String, reflect: true },\n size: { type: String, reflect: true },\n };\n /** The question the fields answer together. */\n declare legend: string;\n /** A hint for the whole group, under the question. */\n declare description: string;\n /** What is wrong with the group as a whole. */\n declare error: string;\n /** How large the question is. A page that asks only this question makes it the page's heading size. */\n declare size: 'md' | 'lg' | 'xl';\n\n constructor() {\n super();\n this.legend = '';\n this.description = '';\n this.error = '';\n this.size = 'md';\n }\n\n static styles = [...ImpktElement.styles, css`\n :host { display: block; margin-block-end: ${space(6)}; }\n fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }\n legend { padding: 0; margin-block-end: ${space(2)}; font-size: ${fontSize('md')}; font-weight: ${fontWeight('bold')}; line-height: ${lineHeight('tight')}; color: ${t.text}; }\n :host([size='lg']) legend { font-size: ${fontSize('xl')}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }\n :host([size='xl']) legend { font-size: ${fontSize('2xl')}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }\n .description { margin-block-end: ${space(3)}; font-size: ${fontSize('sm')}; color: ${t.textMuted}; line-height: ${lineHeight('normal')}; }\n .error { margin-block-end: ${space(3)}; font-size: ${fontSize('sm')}; color: ${t.dangerText}; font-weight: ${fontWeight('semibold')}; }\n .error:empty { display: none; }\n :host([error]:not([error=''])) .fields { padding-inline-start: ${space(4)}; border-inline-start: 4px solid ${t.danger}; }\n `];\n\n render(): TemplateResult {\n const described = [this.description ? this.id_('description') : '', this.error ? this.id_('error') : ''].filter(Boolean).join(' ');\n return html`<fieldset part=\"fieldset\" aria-describedby=${described || nothing}>\n <legend part=\"legend\">${this.legend}</legend>\n ${this.description ? html`<div class=\"description\" id=${this.id_('description')}>${this.description}</div>` : nothing}\n <div class=\"error\" id=${this.id_('error')} aria-live=\"polite\">${this.error || nothing}</div>\n <div class=\"fields\" part=\"fields\"><slot></slot></div>\n </fieldset>`;\n }\n}\n\ncustomElements.define('impkt-fieldset', ImpktFieldset);\ndeclare global { interface HTMLElementTagNameMap { 'impkt-fieldset': ImpktFieldset } }\n"],"mappings":";;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAiBjD,IAAM,gBAAN,cAA4B,aAAa;AAAA,EAC9C;AAAA,SAAO,aAAa;AAAA,MAClB,QAAQ,EAAE,MAAM,OAAO;AAAA,MACvB,aAAa,EAAE,MAAM,OAAO;AAAA,MAC5B,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,IACtC;AAAA;AAAA,EAUA,cAAc;AACZ,UAAM;AACN,SAAK,SAAS;AACd,SAAK,cAAc;AACnB,SAAK,QAAQ;AACb,SAAK,OAAO;AAAA,EACd;AAAA,EAEA;AAAA,SAAO,SAAS,CAAC,GAAG,aAAa,QAAQ;AAAA,gDACK,MAAM,CAAC,CAAC;AAAA;AAAA,6CAEX,MAAM,CAAC,CAAC,gBAAgB,SAAS,IAAI,CAAC,kBAAkB,WAAW,MAAM,CAAC,kBAAkB,WAAW,OAAO,CAAC,YAAY,EAAE,IAAI;AAAA,6CACjI,SAAS,IAAI,CAAC,kBAAkB,EAAE,WAAW,YAAY,EAAE,WAAW;AAAA,6CACtE,SAAS,KAAK,CAAC,kBAAkB,EAAE,WAAW,YAAY,EAAE,WAAW;AAAA,uCAC7E,MAAM,CAAC,CAAC,gBAAgB,SAAS,IAAI,CAAC,YAAY,EAAE,SAAS,kBAAkB,WAAW,QAAQ,CAAC;AAAA,iCACzG,MAAM,CAAC,CAAC,gBAAgB,SAAS,IAAI,CAAC,YAAY,EAAE,UAAU,kBAAkB,WAAW,UAAU,CAAC;AAAA;AAAA,qEAElE,MAAM,CAAC,CAAC,oCAAoC,EAAE,MAAM;AAAA,GACtH;AAAA;AAAA,EAED,SAAyB;AACvB,UAAM,YAAY,CAAC,KAAK,cAAc,KAAK,IAAI,aAAa,IAAI,IAAI,KAAK,QAAQ,KAAK,IAAI,OAAO,IAAI,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AACjI,WAAO,kDAAkD,aAAa,OAAO;AAAA,8BACnD,KAAK,MAAM;AAAA,QACjC,KAAK,cAAc,mCAAmC,KAAK,IAAI,aAAa,CAAC,IAAI,KAAK,WAAW,WAAW,OAAO;AAAA,8BAC7F,KAAK,IAAI,OAAO,CAAC,uBAAuB,KAAK,SAAS,OAAO;AAAA;AAAA;AAAA,EAGzF;AACF;AAEA,eAAe,OAAO,kBAAkB,aAAa;","names":[]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
FieldElement
|
|
3
|
-
|
|
2
|
+
FieldElement,
|
|
3
|
+
fieldWidths
|
|
4
|
+
} from "./chunk-7BIQ3K6H.js";
|
|
4
5
|
import {
|
|
5
6
|
fontSize,
|
|
6
7
|
space,
|
|
7
8
|
t
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NTNXHLTM.js";
|
|
9
10
|
|
|
10
11
|
// packages/ui/src/components/textarea.ts
|
|
11
12
|
import { html, css, nothing } from "lit";
|
|
@@ -13,32 +14,44 @@ var ImpktTextarea = class extends FieldElement {
|
|
|
13
14
|
static {
|
|
14
15
|
this.properties = {
|
|
15
16
|
...FieldElement.properties,
|
|
17
|
+
width: { type: String, reflect: true },
|
|
16
18
|
rows: { type: Number },
|
|
17
19
|
maxlength: { type: Number }
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
22
|
constructor() {
|
|
21
23
|
super();
|
|
24
|
+
this.width = "full";
|
|
22
25
|
this.rows = 4;
|
|
23
26
|
this.maxlength = void 0;
|
|
24
27
|
}
|
|
25
28
|
static {
|
|
26
29
|
this.styles = [
|
|
27
30
|
...FieldElement.styles,
|
|
31
|
+
fieldWidths,
|
|
28
32
|
css`
|
|
29
33
|
textarea {
|
|
30
|
-
inline-size: 100
|
|
31
|
-
padding: ${space(3)};
|
|
34
|
+
inline-size: min(100%, var(--impkt-field-width));
|
|
35
|
+
padding: ${space(2.5)} ${space(3)};
|
|
32
36
|
font-family: inherit;
|
|
33
37
|
font-size: ${fontSize("md")};
|
|
34
38
|
color: ${t.text};
|
|
35
39
|
background: ${t.surfaceCard};
|
|
36
40
|
border: ${t.borderThin} solid ${t.border};
|
|
37
|
-
border-radius: ${t.
|
|
41
|
+
border-radius: ${t.radiusLg};
|
|
42
|
+
box-shadow: ${t.shadowXs};
|
|
43
|
+
transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
38
44
|
/* Resizing is left on deliberately. 1.4.4 and 1.4.12 both assume text
|
|
39
45
|
can be made bigger, and a fixed box is where that stops working. */
|
|
40
46
|
resize: vertical;
|
|
41
47
|
}
|
|
48
|
+
textarea:hover:not(:disabled) {
|
|
49
|
+
border-color: ${t.borderStrong};
|
|
50
|
+
}
|
|
51
|
+
textarea:focus-visible {
|
|
52
|
+
border-color: ${t.brand};
|
|
53
|
+
box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};
|
|
54
|
+
}
|
|
42
55
|
:host([invalid]) textarea {
|
|
43
56
|
border-color: ${t.danger};
|
|
44
57
|
border-width: ${t.borderThick};
|
|
@@ -72,4 +85,4 @@ customElements.define("impkt-textarea", ImpktTextarea);
|
|
|
72
85
|
export {
|
|
73
86
|
ImpktTextarea
|
|
74
87
|
};
|
|
75
|
-
//# sourceMappingURL=chunk-
|
|
88
|
+
//# sourceMappingURL=chunk-C36CZRHK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/textarea.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { FieldElement, fieldWidths } from '../base/FieldElement';\nimport { fontSize, space, t } from '../base/tokens';\n\n/** Several lines of text — a delivery instruction, an additional note.\n *\n * @category form\n * @icon field\n */\nexport class ImpktTextarea extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n width: { type: String, reflect: true },\n rows: { type: Number },\n maxlength: { type: Number },\n };\n\n declare rows: number;\n declare maxlength: number | undefined;\n\n /** How wide the box is, to suit the answer. Full width on a phone whatever this says. */\n declare width: 'full' | 'lg' | 'md' | 'sm' | 'xs';\n\n constructor() {\n super();\n this.width = 'full';\n this.rows = 4;\n this.maxlength = undefined;\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n css`\n textarea {\n inline-size: min(100%, var(--impkt-field-width));\n padding: ${space(2.5)} ${space(3)};\n font-family: inherit;\n font-size: ${fontSize('md')};\n color: ${t.text};\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radiusLg};\n box-shadow: ${t.shadowXs};\n transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;\n /* Resizing is left on deliberately. 1.4.4 and 1.4.12 both assume text\n can be made bigger, and a fixed box is where that stops working. */\n resize: vertical;\n }\n textarea:hover:not(:disabled) {\n border-color: ${t.borderStrong};\n }\n textarea:focus-visible {\n border-color: ${t.brand};\n box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};\n }\n :host([invalid]) textarea {\n border-color: ${t.danger};\n border-width: ${t.borderThick};\n }\n `,\n ];\n\n protected renderControl(): TemplateResult {\n return html`\n <textarea\n id=${this.controlId}\n part=\"textarea\"\n name=${this.name || nothing}\n rows=${this.rows}\n maxlength=${this.maxlength ?? nothing}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n aria-describedby=${this.describedBy}\n aria-invalid=${this.error ? 'true' : nothing}\n @input=${(e: Event) => this.setFormValue((e.target as HTMLTextAreaElement).value)}\n >${this.value}</textarea>\n `;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\ncustomElements.define('impkt-textarea', ImpktTextarea);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impkt-textarea': ImpktTextarea }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AASjD,IAAM,gBAAN,cAA4B,aAAa;AAAA,EAC9C;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,WAAW,EAAE,MAAM,OAAO;AAAA,IAC5B;AAAA;AAAA,EAQA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA,MACA;AAAA;AAAA;AAAA,mBAGe,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA;AAAA,qBAEpB,SAAS,IAAI,CAAC;AAAA,iBAClB,EAAE,IAAI;AAAA,sBACD,EAAE,WAAW;AAAA,kBACjB,EAAE,UAAU,UAAU,EAAE,MAAM;AAAA,yBACvB,EAAE,QAAQ;AAAA,sBACb,EAAE,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAOR,EAAE,YAAY;AAAA;AAAA;AAAA,wBAGd,EAAE,KAAK;AAAA,sBACT,EAAE,WAAW,eAAe,EAAE,SAAS;A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