@atomic-ui/ui 0.1.5 → 0.2.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 +17 -3
- package/custom-elements.json +24569 -0
- package/dist/base/ImpktElement.d.ts +14 -0
- package/dist/base/locale.d.ts +8 -0
- package/dist/base/say.d.ts +1 -0
- package/dist/base/styles.d.ts +1 -1
- package/dist/base/tokens.d.ts +28 -2
- package/dist/{chunk-KWURASAB.js → chunk-26O27BQS.js} +3 -3
- package/dist/chunk-2CFVV2NZ.js +494 -0
- package/dist/chunk-2CFVV2NZ.js.map +1 -0
- package/dist/chunk-3IGNZTJU.js +14 -0
- package/dist/chunk-3IGNZTJU.js.map +1 -0
- package/dist/{chunk-DR3SJ7ZV.js → chunk-3IQ73WNW.js} +3 -3
- package/dist/{chunk-AXQ5YBN2.js → chunk-4X723QBD.js} +135 -10
- package/dist/chunk-4X723QBD.js.map +1 -0
- package/dist/{chunk-OFAVRPRK.js → chunk-6YYAOKNI.js} +2 -2
- package/dist/chunk-6YYAOKNI.js.map +1 -0
- package/dist/{chunk-DI2CJ3MZ.js → chunk-7AJN2TIS.js} +2 -2
- package/dist/chunk-7BSZPUE3.js +53 -0
- package/dist/chunk-7BSZPUE3.js.map +1 -0
- package/dist/{chunk-IBTOZOGI.js → chunk-7OXTZJR4.js} +2 -2
- package/dist/chunk-7XEPNEVQ.js +264 -0
- package/dist/chunk-7XEPNEVQ.js.map +1 -0
- package/dist/{chunk-5NUF7ZQA.js → chunk-D6C7XEY4.js} +64 -3
- package/dist/chunk-D6C7XEY4.js.map +1 -0
- package/dist/{chunk-4JKUAA6K.js → chunk-E2VBUWJ4.js} +53 -14
- package/dist/chunk-E2VBUWJ4.js.map +1 -0
- package/dist/{chunk-57P4WO4Y.js → chunk-E3XJK7MY.js} +38 -23
- package/dist/chunk-E3XJK7MY.js.map +1 -0
- package/dist/{chunk-6UDDZQDK.js → chunk-EDSZI227.js} +3 -3
- package/dist/chunk-EDSZI227.js.map +1 -0
- package/dist/{chunk-3OSL2HMN.js → chunk-FFCIY7NM.js} +9 -6
- package/dist/chunk-FFCIY7NM.js.map +1 -0
- package/dist/{chunk-4AJPS5AU.js → chunk-FJRHZA3C.js} +16 -6
- package/dist/chunk-FJRHZA3C.js.map +1 -0
- package/dist/{chunk-JPEWRJSQ.js → chunk-GQDUHZE3.js} +3 -3
- package/dist/chunk-HYPPG4NF.js +553 -0
- package/dist/chunk-HYPPG4NF.js.map +1 -0
- package/dist/chunk-J4JULXUG.js +249 -0
- package/dist/chunk-J4JULXUG.js.map +1 -0
- package/dist/{chunk-CFGLOYWW.js → chunk-KFD4O7VA.js} +4 -2
- package/dist/chunk-KFD4O7VA.js.map +1 -0
- package/dist/{chunk-LLRJU7XE.js → chunk-MVEFM5QI.js} +6 -6
- package/dist/chunk-MVEFM5QI.js.map +1 -0
- package/dist/{chunk-6GKI67P7.js → chunk-NCASAXQT.js} +7 -3
- package/dist/chunk-NCASAXQT.js.map +1 -0
- package/dist/{chunk-H6L3FSQY.js → chunk-NKTMMJYD.js} +7 -6
- package/dist/chunk-NKTMMJYD.js.map +1 -0
- package/dist/{chunk-QELX47AP.js → chunk-OB7WULFK.js} +50 -27
- package/dist/chunk-OB7WULFK.js.map +1 -0
- package/dist/chunk-OHDPGIJ3.js +428 -0
- package/dist/chunk-OHDPGIJ3.js.map +1 -0
- package/dist/{chunk-TZD7IVVQ.js → chunk-OLLZFNO6.js} +13 -5
- package/dist/chunk-OLLZFNO6.js.map +1 -0
- package/dist/{chunk-5RVMMKMO.js → chunk-OMJMUFOW.js} +3 -3
- package/dist/{chunk-U2S7OESF.js → chunk-QB2KMV6S.js} +56 -15
- package/dist/chunk-QB2KMV6S.js.map +1 -0
- package/dist/{chunk-QH46SOPJ.js → chunk-R67PDFKE.js} +54 -11
- package/dist/chunk-R67PDFKE.js.map +1 -0
- package/dist/chunk-RZSZQMSE.js +236 -0
- package/dist/chunk-RZSZQMSE.js.map +1 -0
- package/dist/{chunk-6MLXFFH4.js → chunk-TGT7J4EG.js} +3 -3
- package/dist/chunk-TGT7J4EG.js.map +1 -0
- package/dist/{chunk-S3EQO33M.js → chunk-UCHJCUYI.js} +6 -4
- package/dist/chunk-UCHJCUYI.js.map +1 -0
- package/dist/chunk-UHLRXI6J.js +453 -0
- package/dist/chunk-UHLRXI6J.js.map +1 -0
- package/dist/chunk-UNVL3CNM.js +725 -0
- package/dist/chunk-UNVL3CNM.js.map +1 -0
- package/dist/{chunk-2RBYVWZT.js → chunk-WDDWWCHN.js} +5 -3
- package/dist/chunk-WDDWWCHN.js.map +1 -0
- package/dist/chunk-WFKSOM6O.js +498 -0
- package/dist/chunk-WFKSOM6O.js.map +1 -0
- package/dist/{chunk-HWNY6U5F.js → chunk-XEJMFFIM.js} +4 -3
- package/dist/chunk-XEJMFFIM.js.map +1 -0
- package/dist/{chunk-ZDYTNFQI.js → chunk-XJXCTGDR.js} +16 -6
- package/dist/chunk-XJXCTGDR.js.map +1 -0
- package/dist/{chunk-G6UVYMA6.js → chunk-YD6IZ2C5.js} +2 -2
- package/dist/chunk-YK5QI57J.js +396 -0
- package/dist/chunk-YK5QI57J.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 +27 -0
- package/dist/components/app-ui.js.map +1 -0
- package/dist/components/blocks.d.ts +2 -2
- package/dist/components/blocks.js +3 -3
- package/dist/components/button.d.ts +14 -0
- package/dist/components/button.js +3 -3
- package/dist/components/changelog.d.ts +386 -0
- package/dist/components/changelog.js +25 -0
- package/dist/components/changelog.js.map +1 -0
- 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/estimator.d.ts +246 -0
- package/dist/components/estimator.js +16 -0
- package/dist/components/estimator.js.map +1 -0
- package/dist/components/fieldset.js +2 -2
- package/dist/components/grid.d.ts +2 -2
- package/dist/components/grid.js +2 -2
- package/dist/components/help.js +2 -2
- package/dist/components/icon.d.ts +2 -0
- package/dist/components/icon.js +2 -2
- package/dist/components/journey.d.ts +433 -0
- package/dist/components/journey.js +22 -0
- package/dist/components/journey.js.map +1 -0
- package/dist/components/layout.d.ts +34 -5
- package/dist/components/layout.js +2 -2
- package/dist/components/link.js +3 -3
- package/dist/components/list.d.ts +50 -0
- package/dist/components/list.js +8 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/marketing.d.ts +119 -6
- package/dist/components/marketing.js +7 -3
- package/dist/components/media.d.ts +10 -0
- package/dist/components/media.js +2 -2
- package/dist/components/navigation.d.ts +25 -2
- package/dist/components/navigation.js +3 -3
- package/dist/components/organisms.d.ts +559 -0
- package/dist/components/organisms.js +25 -0
- package/dist/components/organisms.js.map +1 -0
- package/dist/components/page.d.ts +14 -3
- package/dist/components/page.js +2 -2
- package/dist/components/price.d.ts +6 -1
- package/dist/components/price.js +3 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/property.d.ts +389 -0
- package/dist/components/property.js +20 -0
- package/dist/components/property.js.map +1 -0
- package/dist/components/radio-group.js +3 -3
- package/dist/components/scene.d.ts +138 -0
- package/dist/components/scene.js +8 -0
- package/dist/components/scene.js.map +1 -0
- package/dist/components/scrubber.d.ts +86 -0
- package/dist/components/scrubber.js +8 -0
- package/dist/components/scrubber.js.map +1 -0
- package/dist/components/select.js +3 -3
- package/dist/components/selling.d.ts +407 -0
- package/dist/components/selling.js +25 -0
- package/dist/components/selling.js.map +1 -0
- package/dist/components/site.d.ts +283 -0
- package/dist/components/site.js +20 -0
- package/dist/components/site.js.map +1 -0
- package/dist/components/summary-list.js +2 -2
- package/dist/components/table.js +2 -2
- package/dist/components/text-input.js +3 -3
- package/dist/components/textarea.d.ts +13 -0
- package/dist/components/textarea.js +3 -3
- package/dist/index.d.ts +13 -2
- package/dist/index.js +180 -47
- package/package.json +11 -4
- package/dist/chunk-2RBYVWZT.js.map +0 -1
- package/dist/chunk-3OSL2HMN.js.map +0 -1
- package/dist/chunk-4AJPS5AU.js.map +0 -1
- package/dist/chunk-4JKUAA6K.js.map +0 -1
- package/dist/chunk-57P4WO4Y.js.map +0 -1
- package/dist/chunk-5NUF7ZQA.js.map +0 -1
- package/dist/chunk-6GKI67P7.js.map +0 -1
- package/dist/chunk-6MLXFFH4.js.map +0 -1
- package/dist/chunk-6UDDZQDK.js.map +0 -1
- package/dist/chunk-AXQ5YBN2.js.map +0 -1
- package/dist/chunk-CFGLOYWW.js.map +0 -1
- package/dist/chunk-H6L3FSQY.js.map +0 -1
- package/dist/chunk-HWNY6U5F.js.map +0 -1
- package/dist/chunk-LLRJU7XE.js.map +0 -1
- package/dist/chunk-OFAVRPRK.js.map +0 -1
- package/dist/chunk-QELX47AP.js.map +0 -1
- package/dist/chunk-QH46SOPJ.js.map +0 -1
- package/dist/chunk-S3EQO33M.js.map +0 -1
- package/dist/chunk-TZD7IVVQ.js.map +0 -1
- package/dist/chunk-U2S7OESF.js.map +0 -1
- package/dist/chunk-ZDYTNFQI.js.map +0 -1
- /package/dist/{chunk-KWURASAB.js.map → chunk-26O27BQS.js.map} +0 -0
- /package/dist/{chunk-DR3SJ7ZV.js.map → chunk-3IQ73WNW.js.map} +0 -0
- /package/dist/{chunk-DI2CJ3MZ.js.map → chunk-7AJN2TIS.js.map} +0 -0
- /package/dist/{chunk-IBTOZOGI.js.map → chunk-7OXTZJR4.js.map} +0 -0
- /package/dist/{chunk-JPEWRJSQ.js.map → chunk-GQDUHZE3.js.map} +0 -0
- /package/dist/{chunk-5RVMMKMO.js.map → chunk-OMJMUFOW.js.map} +0 -0
- /package/dist/{chunk-G6UVYMA6.js.map → chunk-YD6IZ2C5.js.map} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ImpktChip,
|
|
3
|
+
ImpktSiteFooter,
|
|
4
|
+
ImpktSiteHeader,
|
|
5
|
+
ImpktWordmark
|
|
6
|
+
} from "../chunk-J4JULXUG.js";
|
|
7
|
+
import "../chunk-QB2KMV6S.js";
|
|
8
|
+
import "../chunk-E3XJK7MY.js";
|
|
9
|
+
import "../chunk-2CFVV2NZ.js";
|
|
10
|
+
import "../chunk-OHDPGIJ3.js";
|
|
11
|
+
import "../chunk-3IGNZTJU.js";
|
|
12
|
+
import "../chunk-KFD4O7VA.js";
|
|
13
|
+
import "../chunk-D6C7XEY4.js";
|
|
14
|
+
export {
|
|
15
|
+
ImpktChip,
|
|
16
|
+
ImpktSiteFooter,
|
|
17
|
+
ImpktSiteHeader,
|
|
18
|
+
ImpktWordmark
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=site.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/components/table.js
CHANGED
|
@@ -17,6 +17,10 @@ export declare class ImpktTextarea extends FieldElement {
|
|
|
17
17
|
maxlength: {
|
|
18
18
|
type: NumberConstructor;
|
|
19
19
|
};
|
|
20
|
+
fillFrom: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
attribute: string;
|
|
23
|
+
};
|
|
20
24
|
label: {
|
|
21
25
|
type: StringConstructor;
|
|
22
26
|
};
|
|
@@ -51,10 +55,19 @@ export declare class ImpktTextarea extends FieldElement {
|
|
|
51
55
|
};
|
|
52
56
|
rows: number;
|
|
53
57
|
maxlength: number | undefined;
|
|
58
|
+
/** `estimate` starts an empty box with the estimate a cost estimator sent on, so the visitor can edit it. */
|
|
59
|
+
fillFrom: 'none' | 'estimate';
|
|
54
60
|
/** How wide the box is, to suit the answer. Full width on a phone whatever this says. */
|
|
55
61
|
width: 'full' | 'lg' | 'md' | 'sm' | 'xs';
|
|
56
62
|
constructor();
|
|
57
63
|
static styles: import("lit").CSSResult[];
|
|
64
|
+
private filled;
|
|
65
|
+
/** The estimate it was filled with, kept until the visitor edits it, so a binding that has not caught up yet cannot empty the box. */
|
|
66
|
+
private filledText;
|
|
67
|
+
/** @ignore */
|
|
68
|
+
protected willUpdate(changed: Map<string, unknown>): void;
|
|
69
|
+
/** Fills the box once, when it is first asked to and is still empty. Props can arrive after the element joins the page. */
|
|
70
|
+
private fill;
|
|
58
71
|
protected renderControl(): TemplateResult;
|
|
59
72
|
updated(changed: Map<string, unknown>): void;
|
|
60
73
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
2
|
+
* @atomic-ui/ui — standard custom elements, styled only from design tokens,
|
|
3
3
|
* built to WCAG 2.2 AA.
|
|
4
4
|
*
|
|
5
5
|
* Importing this module defines every element. There is no registry to
|
|
@@ -20,10 +20,16 @@ export { ImpktSummaryList, type SummaryRow } from './components/summary-list';
|
|
|
20
20
|
export { ImpktTable, type TableColumn } from './components/table';
|
|
21
21
|
export { ImpktAccordion, type AccordionItem } from './components/accordion';
|
|
22
22
|
export { ImpktProgress, type ProgressStep } from './components/progress';
|
|
23
|
+
export { ImpktScene, type SceneDrive, type SceneLayout } from './components/scene';
|
|
24
|
+
export { ImpktScrubber, type ScrubberStop } from './components/scrubber';
|
|
25
|
+
export { ImpktReleaseCard, ImpktReleaseList, ImpktBranchList, ImpktCheckList, ImpktBranchTimeline, type DiffLine, type ReleaseItem, type Branch, type CheckItem, type TimelineLane, type TimelineMark, type Tone } from './components/changelog';
|
|
26
|
+
export { ImpktSiteHeader, ImpktSiteFooter, ImpktWordmark, ImpktChip, type FooterLogLine, type FooterColumn } from './components/site';
|
|
23
27
|
export { ImpktTextarea } from './components/textarea';
|
|
24
28
|
export { ImpktCheckboxGroup, type CheckboxOption } from './components/checkbox-group';
|
|
25
29
|
export { ImpktDateInput } from './components/date-input';
|
|
26
30
|
export { ImpktDialog } from './components/dialog';
|
|
31
|
+
export { ImpktList } from './components/list';
|
|
32
|
+
export { ImpktEstimator, estimate, phaseWeeks, type EstimatorQuestion, type EstimatorChoice, type EstimatorBand, type EstimatorPhase, type EstimateResult } from './components/estimator';
|
|
27
33
|
export { ImpktElement } from './base/ImpktElement';
|
|
28
34
|
export { FieldElement } from './base/FieldElement';
|
|
29
35
|
export { token, space, fontSize, lineHeight, fontWeight, t } from './base/tokens';
|
|
@@ -32,6 +38,11 @@ export { ImpktHelp, type HelpKind } from './components/help';
|
|
|
32
38
|
export { ImpktPage, ImpktSection } from './components/page';
|
|
33
39
|
export { ImpktIcon, ICONS, ICON_NAMES, iconSvg, type IconName } from './components/icon';
|
|
34
40
|
export { ImpktNav, ImpktBreadcrumbs, type NavLink } from './components/navigation';
|
|
35
|
-
export { ImpktHero, ImpktFeatureList, ImpktQuote, ImpktStat, ImpktBadge, type FeatureItem } from './components/marketing';
|
|
41
|
+
export { ImpktSearchBar, type SearchField, ImpktAnnouncement, ImpktHero, ImpktFeatureList, ImpktQuote, ImpktStat, ImpktBadge, type FeatureItem } from './components/marketing';
|
|
36
42
|
export { ImpktDivider, ImpktSpacer, ImpktVisuallyHidden, ImpktTabs, ImpktCardGrid, type TabItem, type CardItem } from './components/blocks';
|
|
37
43
|
export { ImpktFieldset } from './components/fieldset';
|
|
44
|
+
export { ImpktDrawer, ImpktToast, ImpktMenu, ImpktPagination, ImpktAvatar, ImpktAvatarGroup, ImpktEmptyState, ImpktSlotPicker, type MenuItem, type AvatarItem, type SlotDay } from './components/app-ui';
|
|
45
|
+
export { ImpktSitePlan, ImpktMortgageCalculator, ImpktBeforeAfter, ImpktStickyBar, ImpktLocationCard, monthlyPayment, type SitePlot, type NearbyItem } from './components/property';
|
|
46
|
+
export { ImpktCarousel, ImpktGallery, ImpktLogoCloud, ImpktSteps, ImpktMediaSplit, ImpktCtaBanner, ImpktReviews, ImpktNewsletter, type GalleryItem, type LogoItem, type StepItem, type ReviewItem } from './components/organisms';
|
|
47
|
+
export { ImpktAddressLookup, ImpktErrorSummary, ImpktFileUpload, ImpktMoneyInput, ImpktRangeInput, ImpktTaskList, groupDigits, type AddressItem, type ErrorItem, type TaskItem } from './components/journey';
|
|
48
|
+
export { ImpktPlanComparison, ImpktVideo, ImpktRegulatoryNotice, ImpktStampDutyCalculator, ImpktAffordabilityCalculator, ImpktContactBlock, stampDuty, embedOf, SDLT, type PlanItem, type PlanRow } from './components/selling';
|
package/dist/index.js
CHANGED
|
@@ -1,102 +1,180 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ImpktAffordabilityCalculator,
|
|
3
|
+
ImpktContactBlock,
|
|
4
|
+
ImpktPlanComparison,
|
|
5
|
+
ImpktRegulatoryNotice,
|
|
6
|
+
ImpktStampDutyCalculator,
|
|
7
|
+
ImpktVideo,
|
|
8
|
+
SDLT,
|
|
9
|
+
embedOf,
|
|
10
|
+
stampDuty
|
|
11
|
+
} from "./chunk-UHLRXI6J.js";
|
|
12
|
+
import {
|
|
13
|
+
ImpktChip,
|
|
14
|
+
ImpktSiteFooter,
|
|
15
|
+
ImpktSiteHeader,
|
|
16
|
+
ImpktWordmark
|
|
17
|
+
} from "./chunk-J4JULXUG.js";
|
|
18
|
+
import {
|
|
19
|
+
ImpktSummaryList
|
|
20
|
+
} from "./chunk-EDSZI227.js";
|
|
1
21
|
import {
|
|
2
22
|
ImpktTable
|
|
3
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-WDDWWCHN.js";
|
|
4
24
|
import {
|
|
5
25
|
ImpktTextInput
|
|
6
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FJRHZA3C.js";
|
|
7
27
|
import {
|
|
8
28
|
ImpktTextarea
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
ImpktDocumentLink,
|
|
12
|
-
ImpktImage,
|
|
13
|
-
ImpktLogo
|
|
14
|
-
} from "./chunk-6GKI67P7.js";
|
|
15
|
-
import {
|
|
16
|
-
ImpktBreadcrumbs,
|
|
17
|
-
ImpktNav
|
|
18
|
-
} from "./chunk-U2S7OESF.js";
|
|
29
|
+
} from "./chunk-E2VBUWJ4.js";
|
|
19
30
|
import {
|
|
20
31
|
ImpktPage,
|
|
21
32
|
ImpktSection
|
|
22
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-R67PDFKE.js";
|
|
23
34
|
import {
|
|
24
35
|
ImpktPrice
|
|
25
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-OLLZFNO6.js";
|
|
26
37
|
import {
|
|
27
38
|
ImpktProgress
|
|
28
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-XEJMFFIM.js";
|
|
29
40
|
import {
|
|
30
41
|
ImpktRadioGroup
|
|
31
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-OMJMUFOW.js";
|
|
32
43
|
import {
|
|
33
|
-
|
|
34
|
-
} from "./chunk-
|
|
44
|
+
ImpktScene
|
|
45
|
+
} from "./chunk-7XEPNEVQ.js";
|
|
35
46
|
import {
|
|
36
|
-
|
|
37
|
-
} from "./chunk-
|
|
47
|
+
ImpktScrubber
|
|
48
|
+
} from "./chunk-RZSZQMSE.js";
|
|
38
49
|
import {
|
|
39
|
-
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import {
|
|
42
|
-
ImpktFieldset
|
|
43
|
-
} from "./chunk-G6UVYMA6.js";
|
|
44
|
-
import {
|
|
45
|
-
ImpktGrid
|
|
46
|
-
} from "./chunk-OFAVRPRK.js";
|
|
50
|
+
ImpktSelect
|
|
51
|
+
} from "./chunk-XJXCTGDR.js";
|
|
47
52
|
import {
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
ImpktAddressLookup,
|
|
54
|
+
ImpktErrorSummary,
|
|
55
|
+
ImpktFileUpload,
|
|
56
|
+
ImpktMoneyInput,
|
|
57
|
+
ImpktRangeInput,
|
|
58
|
+
ImpktTaskList,
|
|
59
|
+
groupDigits
|
|
60
|
+
} from "./chunk-WFKSOM6O.js";
|
|
50
61
|
import {
|
|
51
62
|
ImpktCard,
|
|
52
63
|
ImpktHeading,
|
|
53
64
|
ImpktStack,
|
|
54
65
|
ImpktText
|
|
55
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-OB7WULFK.js";
|
|
56
67
|
import {
|
|
57
68
|
ImpktLink
|
|
58
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-GQDUHZE3.js";
|
|
70
|
+
import {
|
|
71
|
+
ImpktList
|
|
72
|
+
} from "./chunk-7BSZPUE3.js";
|
|
59
73
|
import {
|
|
74
|
+
ImpktAnnouncement,
|
|
60
75
|
ImpktBadge,
|
|
61
76
|
ImpktFeatureList,
|
|
62
77
|
ImpktHero,
|
|
63
78
|
ImpktQuote,
|
|
79
|
+
ImpktSearchBar,
|
|
64
80
|
ImpktStat
|
|
65
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-4X723QBD.js";
|
|
82
|
+
import {
|
|
83
|
+
ImpktDocumentLink,
|
|
84
|
+
ImpktImage,
|
|
85
|
+
ImpktLogo
|
|
86
|
+
} from "./chunk-NCASAXQT.js";
|
|
87
|
+
import {
|
|
88
|
+
ImpktBreadcrumbs,
|
|
89
|
+
ImpktNav
|
|
90
|
+
} from "./chunk-QB2KMV6S.js";
|
|
91
|
+
import {
|
|
92
|
+
ImpktCarousel,
|
|
93
|
+
ImpktCtaBanner,
|
|
94
|
+
ImpktGallery,
|
|
95
|
+
ImpktLogoCloud,
|
|
96
|
+
ImpktMediaSplit,
|
|
97
|
+
ImpktNewsletter,
|
|
98
|
+
ImpktReviews,
|
|
99
|
+
ImpktSteps
|
|
100
|
+
} from "./chunk-UNVL3CNM.js";
|
|
101
|
+
import {
|
|
102
|
+
ImpktCheckbox
|
|
103
|
+
} from "./chunk-3IQ73WNW.js";
|
|
104
|
+
import {
|
|
105
|
+
ImpktDateInput
|
|
106
|
+
} from "./chunk-NKTMMJYD.js";
|
|
107
|
+
import {
|
|
108
|
+
ImpktDialog
|
|
109
|
+
} from "./chunk-UCHJCUYI.js";
|
|
110
|
+
import {
|
|
111
|
+
ImpktEstimator,
|
|
112
|
+
estimate,
|
|
113
|
+
phaseWeeks
|
|
114
|
+
} from "./chunk-YK5QI57J.js";
|
|
115
|
+
import {
|
|
116
|
+
ImpktFieldset
|
|
117
|
+
} from "./chunk-YD6IZ2C5.js";
|
|
118
|
+
import {
|
|
119
|
+
ImpktGrid
|
|
120
|
+
} from "./chunk-6YYAOKNI.js";
|
|
121
|
+
import {
|
|
122
|
+
ImpktHelp
|
|
123
|
+
} from "./chunk-7OXTZJR4.js";
|
|
66
124
|
import {
|
|
67
125
|
ImpktAccordion
|
|
68
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-TGT7J4EG.js";
|
|
69
127
|
import {
|
|
70
128
|
ImpktAlert
|
|
71
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-FFCIY7NM.js";
|
|
130
|
+
import {
|
|
131
|
+
ImpktAvatar,
|
|
132
|
+
ImpktAvatarGroup,
|
|
133
|
+
ImpktDrawer,
|
|
134
|
+
ImpktEmptyState,
|
|
135
|
+
ImpktMenu,
|
|
136
|
+
ImpktPagination,
|
|
137
|
+
ImpktSlotPicker,
|
|
138
|
+
ImpktToast
|
|
139
|
+
} from "./chunk-HYPPG4NF.js";
|
|
72
140
|
import {
|
|
73
141
|
ImpktCardGrid,
|
|
74
142
|
ImpktDivider,
|
|
75
143
|
ImpktSpacer,
|
|
76
144
|
ImpktTabs,
|
|
77
145
|
ImpktVisuallyHidden
|
|
78
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-MVEFM5QI.js";
|
|
79
147
|
import {
|
|
80
148
|
ImpktButton
|
|
81
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-E3XJK7MY.js";
|
|
150
|
+
import {
|
|
151
|
+
ImpktBranchList,
|
|
152
|
+
ImpktBranchTimeline,
|
|
153
|
+
ImpktCheckList,
|
|
154
|
+
ImpktReleaseCard,
|
|
155
|
+
ImpktReleaseList
|
|
156
|
+
} from "./chunk-2CFVV2NZ.js";
|
|
157
|
+
import {
|
|
158
|
+
ImpktBeforeAfter,
|
|
159
|
+
ImpktLocationCard,
|
|
160
|
+
ImpktMortgageCalculator,
|
|
161
|
+
ImpktSitePlan,
|
|
162
|
+
ImpktStickyBar,
|
|
163
|
+
monthlyPayment
|
|
164
|
+
} from "./chunk-OHDPGIJ3.js";
|
|
165
|
+
import "./chunk-3IGNZTJU.js";
|
|
82
166
|
import {
|
|
83
167
|
ICONS,
|
|
84
168
|
ICON_NAMES,
|
|
85
169
|
ImpktIcon,
|
|
86
170
|
iconSvg
|
|
87
|
-
} from "./chunk-
|
|
171
|
+
} from "./chunk-KFD4O7VA.js";
|
|
88
172
|
import {
|
|
89
173
|
ImpktCheckboxGroup
|
|
90
|
-
} from "./chunk-
|
|
91
|
-
import {
|
|
92
|
-
ImpktCheckbox
|
|
93
|
-
} from "./chunk-DR3SJ7ZV.js";
|
|
94
|
-
import {
|
|
95
|
-
ImpktDateInput
|
|
96
|
-
} from "./chunk-H6L3FSQY.js";
|
|
174
|
+
} from "./chunk-26O27BQS.js";
|
|
97
175
|
import {
|
|
98
176
|
FieldElement
|
|
99
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-7AJN2TIS.js";
|
|
100
178
|
import {
|
|
101
179
|
ImpktElement,
|
|
102
180
|
fontSize,
|
|
@@ -105,27 +183,46 @@ import {
|
|
|
105
183
|
space,
|
|
106
184
|
t,
|
|
107
185
|
token
|
|
108
|
-
} from "./chunk-
|
|
186
|
+
} from "./chunk-D6C7XEY4.js";
|
|
109
187
|
export {
|
|
110
188
|
FieldElement,
|
|
111
189
|
ICONS,
|
|
112
190
|
ICON_NAMES,
|
|
113
191
|
ImpktAccordion,
|
|
192
|
+
ImpktAddressLookup,
|
|
193
|
+
ImpktAffordabilityCalculator,
|
|
114
194
|
ImpktAlert,
|
|
195
|
+
ImpktAnnouncement,
|
|
196
|
+
ImpktAvatar,
|
|
197
|
+
ImpktAvatarGroup,
|
|
115
198
|
ImpktBadge,
|
|
199
|
+
ImpktBeforeAfter,
|
|
200
|
+
ImpktBranchList,
|
|
201
|
+
ImpktBranchTimeline,
|
|
116
202
|
ImpktBreadcrumbs,
|
|
117
203
|
ImpktButton,
|
|
118
204
|
ImpktCard,
|
|
119
205
|
ImpktCardGrid,
|
|
206
|
+
ImpktCarousel,
|
|
207
|
+
ImpktCheckList,
|
|
120
208
|
ImpktCheckbox,
|
|
121
209
|
ImpktCheckboxGroup,
|
|
210
|
+
ImpktChip,
|
|
211
|
+
ImpktContactBlock,
|
|
212
|
+
ImpktCtaBanner,
|
|
122
213
|
ImpktDateInput,
|
|
123
214
|
ImpktDialog,
|
|
124
215
|
ImpktDivider,
|
|
125
216
|
ImpktDocumentLink,
|
|
217
|
+
ImpktDrawer,
|
|
126
218
|
ImpktElement,
|
|
219
|
+
ImpktEmptyState,
|
|
220
|
+
ImpktErrorSummary,
|
|
221
|
+
ImpktEstimator,
|
|
127
222
|
ImpktFeatureList,
|
|
128
223
|
ImpktFieldset,
|
|
224
|
+
ImpktFileUpload,
|
|
225
|
+
ImpktGallery,
|
|
129
226
|
ImpktGrid,
|
|
130
227
|
ImpktHeading,
|
|
131
228
|
ImpktHelp,
|
|
@@ -133,30 +230,66 @@ export {
|
|
|
133
230
|
ImpktIcon,
|
|
134
231
|
ImpktImage,
|
|
135
232
|
ImpktLink,
|
|
233
|
+
ImpktList,
|
|
234
|
+
ImpktLocationCard,
|
|
136
235
|
ImpktLogo,
|
|
236
|
+
ImpktLogoCloud,
|
|
237
|
+
ImpktMediaSplit,
|
|
238
|
+
ImpktMenu,
|
|
239
|
+
ImpktMoneyInput,
|
|
240
|
+
ImpktMortgageCalculator,
|
|
137
241
|
ImpktNav,
|
|
242
|
+
ImpktNewsletter,
|
|
138
243
|
ImpktPage,
|
|
244
|
+
ImpktPagination,
|
|
245
|
+
ImpktPlanComparison,
|
|
139
246
|
ImpktPrice,
|
|
140
247
|
ImpktProgress,
|
|
141
248
|
ImpktQuote,
|
|
142
249
|
ImpktRadioGroup,
|
|
250
|
+
ImpktRangeInput,
|
|
251
|
+
ImpktRegulatoryNotice,
|
|
252
|
+
ImpktReleaseCard,
|
|
253
|
+
ImpktReleaseList,
|
|
254
|
+
ImpktReviews,
|
|
255
|
+
ImpktScene,
|
|
256
|
+
ImpktScrubber,
|
|
257
|
+
ImpktSearchBar,
|
|
143
258
|
ImpktSection,
|
|
144
259
|
ImpktSelect,
|
|
260
|
+
ImpktSiteFooter,
|
|
261
|
+
ImpktSiteHeader,
|
|
262
|
+
ImpktSitePlan,
|
|
263
|
+
ImpktSlotPicker,
|
|
145
264
|
ImpktSpacer,
|
|
146
265
|
ImpktStack,
|
|
266
|
+
ImpktStampDutyCalculator,
|
|
147
267
|
ImpktStat,
|
|
268
|
+
ImpktSteps,
|
|
269
|
+
ImpktStickyBar,
|
|
148
270
|
ImpktSummaryList,
|
|
149
271
|
ImpktTable,
|
|
150
272
|
ImpktTabs,
|
|
273
|
+
ImpktTaskList,
|
|
151
274
|
ImpktText,
|
|
152
275
|
ImpktTextInput,
|
|
153
276
|
ImpktTextarea,
|
|
277
|
+
ImpktToast,
|
|
278
|
+
ImpktVideo,
|
|
154
279
|
ImpktVisuallyHidden,
|
|
280
|
+
ImpktWordmark,
|
|
281
|
+
SDLT,
|
|
282
|
+
embedOf,
|
|
283
|
+
estimate,
|
|
155
284
|
fontSize,
|
|
156
285
|
fontWeight,
|
|
286
|
+
groupDigits,
|
|
157
287
|
iconSvg,
|
|
158
288
|
lineHeight,
|
|
289
|
+
monthlyPayment,
|
|
290
|
+
phaseWeeks,
|
|
159
291
|
space,
|
|
292
|
+
stampDuty,
|
|
160
293
|
t,
|
|
161
294
|
token
|
|
162
295
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomic-ui/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "The Impkt component library: standard custom elements, styled only from design tokens, built to WCAG 2.2 AA.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/matthill8286/impkt-design-system.git",
|
|
8
|
+
"directory": "packages/ui"
|
|
9
|
+
},
|
|
5
10
|
"type": "module",
|
|
6
11
|
"main": "./dist/index.js",
|
|
7
12
|
"types": "./dist/index.d.ts",
|
|
@@ -17,7 +22,7 @@
|
|
|
17
22
|
},
|
|
18
23
|
"dependencies": {
|
|
19
24
|
"lit": "^3.3.3",
|
|
20
|
-
"@atomic-ui/design-tokens": "0.
|
|
25
|
+
"@atomic-ui/design-tokens": "^0.2.0"
|
|
21
26
|
},
|
|
22
27
|
"devDependencies": {
|
|
23
28
|
"@types/node": "^20.14.0",
|
|
@@ -32,9 +37,11 @@
|
|
|
32
37
|
"customElements": "custom-elements.json",
|
|
33
38
|
"files": [
|
|
34
39
|
"dist",
|
|
35
|
-
"README.md"
|
|
40
|
+
"README.md",
|
|
41
|
+
"custom-elements.json"
|
|
36
42
|
],
|
|
37
43
|
"publishConfig": {
|
|
44
|
+
"registry": "https://registry.npmjs.org",
|
|
38
45
|
"access": "public"
|
|
39
46
|
},
|
|
40
47
|
"scripts": {
|
|
@@ -44,4 +51,4 @@
|
|
|
44
51
|
"test:browser": "playwright test",
|
|
45
52
|
"manifest": "custom-elements-manifest analyze"
|
|
46
53
|
}
|
|
47
|
-
}
|
|
54
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/table.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { focusRing } from '../base/styles';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\n\nexport interface TableColumn {\n key: string;\n label: string;\n numeric?: boolean;\n}\n\n/**\n * A data table — a plan comparison, a payment schedule.\n *\n * **The caption is required.** It is the table's name, and a page with three\n * unnamed tables is a page a screen-reader user has to read in full to tell\n * apart. Visually it can be the heading they would have written anyway.\n *\n * **It scrolls, and the scroller is focusable.** A wide table cannot reflow to\n * 320px without becoming unreadable, so it scrolls horizontally — and a region\n * that scrolls must be reachable by keyboard, or a keyboard user simply cannot\n * see the right-hand columns. `tabindex=\"0\"` with a role and a name is the\n * established fix, and the name is why the role is there: a bare focusable div\n * announces nothing.\n\n *\n * @category content\n * @icon table\n */\nexport class ImpktTable extends ImpktElement {\n static properties = {\n caption: { type: String },\n columns: { type: Array },\n rows: { type: Array },\n };\n\n declare caption: string;\n declare columns: TableColumn[];\n declare rows: Array<Record<string, string>>;\n\n constructor() {\n super();\n this.caption = '';\n this.columns = [];\n this.rows = [];\n }\n\n static styles = [\n ...ImpktElement.styles,\n focusRing,\n css`\n :host {\n display: block;\n }\n .scroller {\n overflow-x: auto;\n }\n table {\n inline-size: 100%;\n border-collapse: collapse;\n font-size: ${fontSize('md')};\n }\n caption {\n text-align: start;\n font-weight: ${fontWeight('semibold')};\n padding-block-end: ${space(2)};\n }\n th,\n td {\n text-align: start;\n padding: ${space(3)};\n border-block-end: ${t.borderThin} solid ${t.border};\n }\n th {\n font-weight: ${fontWeight('semibold')};\n background: ${t.surfaceInset};\n }\n .numeric {\n text-align: end;\n font-variant-numeric: tabular-nums;\n }\n `,\n ];\n\n render(): TemplateResult {\n return html`\n <div class=\"scroller\" part=\"scroller\" tabindex=\"0\" role=\"region\" aria-label=${this.caption || nothing}>\n <table part=\"table\">\n ${this.caption ? html`<caption part=\"caption\">${this.caption}</caption>` : nothing}\n <thead>\n <tr>\n ${this.columns.map(\n (c) => html`<th scope=\"col\" class=${c.numeric ? 'numeric' : ''}>${c.label}</th>`,\n )}\n </tr>\n </thead>\n <tbody>\n ${this.rows.map(\n (row, i) => html`\n <tr>\n ${this.columns.map((c, j) =>\n // The first cell of each row is a row header, so a screen\n // reader announces \"Delivery charge, £250\" rather than\n // reading a bare number with no idea what it belongs to.\n j === 0\n ? html`<th scope=\"row\" id=${`${this.uid}-r${i}`}>${row[c.key] ?? ''}</th>`\n : html`<td class=${c.numeric ? 'numeric' : ''}>${row[c.key] ?? ''}</td>`,\n )}\n </tr>\n `,\n )}\n </tbody>\n </table>\n </div>\n `;\n }\n}\n\ncustomElements.define('impkt-table', ImpktTable);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impkt-table': ImpktTable }\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA6BjD,IAAM,aAAN,cAAyB,aAAa;AAAA,EAC3C;AAAA,SAAO,aAAa;AAAA,MAClB,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,SAAS,EAAE,MAAM,MAAM;AAAA,MACvB,MAAM,EAAE,MAAM,MAAM;AAAA,IACtB;AAAA;AAAA,EAMA,cAAc;AACZ,UAAM;AACN,SAAK,UAAU;AACf,SAAK,UAAU,CAAC;AAChB,SAAK,OAAO,CAAC;AAAA,EACf;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA,MACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAUiB,SAAS,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,uBAIZ,WAAW,UAAU,CAAC;AAAA,6BAChB,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,mBAKlB,MAAM,CAAC,CAAC;AAAA,4BACC,EAAE,UAAU,UAAU,EAAE,MAAM;AAAA;AAAA;AAAA,uBAGnC,WAAW,UAAU,CAAC;AAAA,sBACvB,EAAE,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOlC;AAAA;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA,oFACyE,KAAK,WAAW,OAAO;AAAA;AAAA,YAE/F,KAAK,UAAU,+BAA+B,KAAK,OAAO,eAAe,OAAO;AAAA;AAAA;AAAA,gBAG5E,KAAK,QAAQ;AAAA,MACb,CAAC,MAAM,6BAA6B,EAAE,UAAU,YAAY,EAAE,IAAI,EAAE,KAAK;AAAA,IAC3E,CAAC;AAAA;AAAA;AAAA;AAAA,cAID,KAAK,KAAK;AAAA,MACV,CAAC,KAAK,MAAM;AAAA;AAAA,oBAEN,KAAK,QAAQ;AAAA,QAAI,CAAC,GAAG;AAAA;AAAA;AAAA;AAAA,UAIrB,MAAM,IACF,0BAA0B,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,IAAI,IAAI,EAAE,GAAG,KAAK,EAAE,UACjE,iBAAiB,EAAE,UAAU,YAAY,EAAE,IAAI,IAAI,EAAE,GAAG,KAAK,EAAE;AAAA;AAAA,MACrE,CAAC;AAAA;AAAA;AAAA,IAGP,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKX;AACF;AAEA,eAAe,OAAO,eAAe,UAAU;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/alert.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\n\nexport type AlertTone = 'info' | 'success' | 'warning' | 'danger';\n\n/**\n * A notice.\n *\n * **The role depends on the tone, and that is a real distinction.** `alert`\n * interrupts whatever a screen reader is saying; `status` waits for a pause.\n * A failed payment earns the interruption. \"Your basket has been saved\" does\n * not, and using `alert` for it is how users learn to tune the live region\n * out — at which point the one that mattered is also lost.\n *\n * **The tone is never carried by colour alone.** Each tone ships a word, in\n * the accessible name, because 1.4.1 Use of Colour says a red border is not a\n * message and because a red border is invisible in forced-colours mode.\n\n *\n * @category feedback\n * @icon alert\n * @slot - The body of the notice.\n */\nexport class ImpktAlert extends ImpktElement {\n static properties = {\n tone: { type: String, reflect: true },\n heading: { type: String },\n toneLabel: { type: String, attribute: 'tone-label' },\n };\n\n declare tone: AlertTone;\n declare heading: string;\n /** Overrides the default word for the tone, for translation. */\n declare toneLabel: string;\n\n constructor() {\n super();\n this.tone = 'info';\n this.heading = '';\n this.toneLabel = '';\n }\n\n private static readonly TONE_WORDS: Record<AlertTone, string> = {\n info: 'Information',\n success: 'Success',\n warning: 'Warning',\n danger: 'Error',\n };\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: block;\n margin-block-end: ${space(4)};\n }\n .alert {\n padding: ${space(4)};\n border-radius: ${t.radius};\n border-inline-start: 4px solid;\n font-size: ${fontSize('md')};\n }\n .heading {\n font-weight: ${fontWeight('semibold')};\n margin-block-end: ${space(1)};\n }\n :host([tone='info']) .alert {\n background: ${t.infoSubtle};\n border-color: ${t.info};\n color: ${t.text};\n }\n :host([tone='success']) .alert {\n background: ${t.successSubtle};\n border-color: ${t.success};\n color: ${t.text};\n }\n :host([tone='warning']) .alert {\n background: ${t.warningSubtle};\n border-color: ${t.warning};\n color: ${t.text};\n }\n :host([tone='danger']) .alert {\n background: ${t.dangerSubtle};\n border-color: ${t.danger};\n color: ${t.text};\n }\n /* Colour is the only signal left in forced-colours mode, and it is gone.\n The border keeps the boundary; the tone word in the label carries the\n meaning. */\n @media (forced-colors: active) {\n .alert {\n border: 1px solid CanvasText;\n border-inline-start-width: 4px;\n }\n }\n `,\n ];\n\n render(): TemplateResult {\n const word = this.toneLabel || ImpktAlert.TONE_WORDS[this.tone];\n return html`\n <div\n class=\"alert\"\n part=\"alert\"\n role=${this.tone === 'danger' ? 'alert' : 'status'}\n aria-label=${this.heading ? nothing : word}\n >\n ${this.heading\n ? html`<div class=\"heading\" part=\"heading\">\n <span class=\"tone-word\">${word}:</span> ${this.heading}\n </div>`\n : nothing}\n <slot></slot>\n </div>\n `;\n }\n}\n\ncustomElements.define('impkt-alert', ImpktAlert);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-alert': ImpktAlert;\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAwBjD,IAAM,aAAN,MAAM,oBAAmB,aAAa;AAAA,EAC3C;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,WAAW,EAAE,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AAAA,sBAExD,OAAO;AAAA;AAAA;AAAA;AAAA,EAIjB;AACF;AAEA,eAAe,OAAO,eAAe,UAAU;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/text-input.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/**\n * A single-line text field.\n *\n * `inputmode` and `autocomplete` are first-class properties rather than\n * afterthoughts. 1.3.5 Identify Input Purpose is a Level AA criterion that\n * autofill satisfies directly, and it is the single cheapest accessibility win\n * in a checkout journey — a form that fills itself is a form that someone with a\n * motor impairment can actually finish.\n\n *\n * @category form\n * @icon field\n */\nexport class ImpktTextInput extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n width: { type: String, reflect: true },\n type: { type: String },\n placeholder: { type: String },\n autocomplete: { type: String },\n inputmode: { type: String },\n maxlength: { type: Number },\n };\n\n declare type: 'text' | 'email' | 'tel' | 'number' | 'password' | 'date';\n declare placeholder: string;\n /** A token from the HTML autofill list — `given-name`, `postal-code`, `tel`. */\n declare autocomplete: string;\n declare inputmode: string;\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.type = 'text';\n this.placeholder = '';\n this.autocomplete = '';\n this.inputmode = '';\n this.maxlength = undefined;\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n css`\n input {\n inline-size: min(100%, var(--impkt-field-width));\n min-block-size: 44px;\n padding: ${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.radius};\n }\n input::placeholder {\n color: ${t.textPlaceholder};\n }\n input:disabled {\n background: ${t.surfaceInset};\n cursor: not-allowed;\n }\n /* The border thickens as well as reddening. Colour alone would carry the\n error, which 1.4.1 forbids — and the message below says it in words. */\n :host([invalid]) input {\n border-color: ${t.danger};\n border-width: ${t.borderThick};\n }\n `,\n ];\n\n protected renderControl(): TemplateResult {\n return html`\n <input\n id=${this.controlId}\n part=\"input\"\n type=${this.type}\n name=${this.name || nothing}\n .value=${this.value}\n placeholder=${this.placeholder || nothing}\n autocomplete=${this.autocomplete || nothing}\n inputmode=${this.inputmode || nothing}\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 HTMLInputElement).value)}\n />\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-text-input', ImpktTextInput);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-text-input': ImpktTextInput;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAiBjD,IAAM,iBAAN,cAA6B,aAAa;AAAA,EAC/C;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,aAAa,EAAE,MAAM,OAAO;AAAA,MAC5B,cAAc,EAAE,MAAM,OAAO;AAAA,MAC7B,WAAW,EAAE,MAAM,OAAO;AAAA,MAC1B,WAAW,EAAE,MAAM,OAAO;AAAA,IAC5B;AAAA;AAAA,EAYA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,cAAc;AACnB,SAAK,eAAe;AACpB,SAAK,YAAY;AACjB,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA,MACA;AAAA;AAAA;AAAA;AAAA,mBAIe,MAAM,CAAC,CAAC;AAAA;AAAA,qBAEN,SAAS,IAAI,CAAC;AAAA,iBAClB,EAAE,IAAI;AAAA,sBACD,EAAE,WAAW;AAAA,kBACjB,EAAE,UAAU,UAAU,EAAE,MAAM;AAAA,yBACvB,EAAE,MAAM;AAAA;AAAA;AAAA,iBAGhB,EAAE,eAAe;AAAA;AAAA;AAAA,sBAGZ,EAAE,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAMZ,EAAE,MAAM;AAAA,wBACR,EAAE,WAAW;AAAA;AAAA;AAAA,IAGnC;AAAA;AAAA,EAEU,gBAAgC;AACxC,WAAO;AAAA;AAAA,aAEE,KAAK,SAAS;AAAA;AAAA,eAEZ,KAAK,IAAI;AAAA,eACT,KAAK,QAAQ,OAAO;AAAA,iBAClB,KAAK,KAAK;AAAA,sBACL,KAAK,eAAe,OAAO;AAAA,uBAC1B,KAAK,gBAAgB,OAAO;AAAA,oBAC/B,KAAK,aAAa,OAAO;AAAA,oBACzB,KAAK,aAAa,OAAO;AAAA,oBACzB,KAAK,QAAQ;AAAA,oBACb,KAAK,QAAQ;AAAA,oBACb,KAAK,QAAQ;AAAA,2BACN,KAAK,WAAW;AAAA,uBACpB,KAAK,QAAQ,SAAS,OAAO;AAAA,iBACnC,CAAC,MAAa,KAAK,aAAc,EAAE,OAA4B,KAAK,CAAC;AAAA;AAAA;AAAA,EAGpF;AAAA,EAEA,QAAQ,SAAqC;AAC3C,QAAI,QAAQ,IAAI,OAAO,EAAG,MAAK,gBAAgB,WAAW,QAAQ,KAAK,KAAK,CAAC;AAAA,EAC/E;AACF;AAEA,eAAe,OAAO,oBAAoB,cAAc;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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(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.radius};\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 :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,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OAAO,kBAAkB,aAAa;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/button.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { focusRing, targetSize, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/**\n * A button.\n *\n * Two decisions carry the accessibility weight here.\n *\n * **A busy button is not a disabled button.** While an action is in flight the\n * control keeps its place in the tab order and reports `aria-disabled`, rather\n * than taking the native `disabled` attribute. A natively disabled element is\n * removed from the tab order, so a keyboard user who had just activated it\n * loses their focus position to the top of the document — at precisely the\n * moment something is happening that they need to be told about. Activation is\n * blocked in the handler instead.\n *\n * **It renders a real `<button>`.** A `<div role=\"button\">` needs Enter and\n * Space handling, a tabindex, and a disabled story, and it will still not\n * submit a form. The native element already has all of that, correctly, in\n * every browser and every assistive technology.\n\n *\n * **A button that goes somewhere is a link.** With `href` set it renders an\n * `<a>` styled as a button, so it opens in a new tab, shows its address and is\n * announced as a link, which is what it is.\n *\n * @category action\n * @icon button\n * @slot - The button label.\n * @fires click - When the button is pressed. Not while it is busy or disabled.\n */\nexport class ImpktButton extends ImpktElement {\n static formAssociated = true;\n\n static properties = {\n variant: { type: String, reflect: true },\n type: { type: String },\n disabled: { type: Boolean, reflect: true },\n busy: { type: Boolean, reflect: true },\n busyLabel: { type: String, attribute: 'busy-label' },\n full: { type: Boolean, reflect: true },\n size: { type: String, reflect: true },\n iconBefore: { type: String, attribute: 'icon-before' },\n iconAfter: { type: String, attribute: 'icon-after' },\n href: { type: String },\n };\n\n declare variant: 'primary' | 'secondary' | 'ghost';\n declare type: 'button' | 'submit' | 'reset';\n declare disabled: boolean;\n declare busy: boolean;\n /** Announced when the button becomes busy. Says what is happening, not that something is. */\n declare busyLabel: string;\n declare full: boolean;\n declare size: 'sm' | 'md' | 'lg';\n /** An icon before the words, such as phone or calendar. */\n declare iconBefore: '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 /** An icon after the words, such as arrow-right. */\n declare iconAfter: '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 button goes, when it opens a page rather than doing something here. */\n declare href: string;\n\n private internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this.variant = 'primary';\n this.type = 'button';\n this.disabled = false;\n this.busy = false;\n this.busyLabel = 'Working';\n this.full = false;\n this.size = 'md';\n this.iconBefore = 'none';\n this.iconAfter = 'none';\n this.href = '';\n try {\n this.internals = this.attachInternals();\n } catch {\n this.internals = null;\n }\n }\n\n static styles = [\n ...ImpktElement.styles,\n focusRing,\n css`\n :host {\n display: inline-block;\n }\n :host([full]) {\n display: block;\n }\n button, a {\n ${targetSize}\n box-sizing: border-box;\n text-decoration: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ${space(2)};\n inline-size: 100%;\n padding: ${space(3)} ${space(5)};\n font-family: inherit;\n font-size: ${fontSize('md')};\n font-weight: ${fontWeight('semibold')};\n line-height: 1.2;\n border-radius: ${t.radius};\n border: ${t.borderThick} solid transparent;\n cursor: pointer;\n transition: background-color 120ms ease-in-out, border-color 120ms ease-in-out;\n }\n :host([size='sm']) :is(button, a) { padding: ${space(2)} ${space(3)}; font-size: ${fontSize('sm')}; }\n :host([size='lg']) :is(button, a) { padding: ${space(4)} ${space(6)}; font-size: ${fontSize('lg')}; }\n .icon { flex: none; }\n /* The cursor is the only thing that changes while busy. Moving or\n recolouring a control the moment it is pressed is how a user loses it. */\n button[aria-disabled='true'] {\n cursor: progress;\n }\n :host([disabled]) button {\n cursor: not-allowed;\n opacity: 0.55;\n }\n\n .primary {\n background: ${t.brand};\n color: ${t.onBrand};\n }\n .primary:hover:not([aria-disabled='true']) {\n background: ${t.brandHover};\n }\n .primary:active:not([aria-disabled='true']) {\n background: ${t.brandActive};\n }\n\n .secondary {\n background: transparent;\n color: ${t.link};\n border-color: currentColor;\n }\n .secondary:hover:not([aria-disabled='true']) {\n background: ${t.brandSubtle};\n }\n\n .ghost {\n background: transparent;\n color: ${t.link};\n border-color: transparent;\n text-decoration: underline;\n }\n .ghost:hover:not([aria-disabled='true']) {\n background: ${t.brandSubtle};\n }\n\n .sr-only {\n ${visuallyHidden}\n }\n\n /* Windows High Contrast Mode drops background and border colours, so a\n button styled only by background becomes invisible. A forced-colors\n border puts the boundary back. */\n @media (forced-colors: active) {\n button, a {\n border-color: ButtonBorder;\n }\n }\n `,\n ];\n\n private onClick(event: MouseEvent): void {\n if (this.disabled || this.busy) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n // A shadow-rooted button does not submit the outer form by itself, because\n // the click never reaches it. `requestSubmit` rather than `submit` so that\n // native validation and the submit event both still run.\n if (this.type === 'submit') this.internals?.form?.requestSubmit();\n if (this.type === 'reset') this.internals?.form?.reset();\n }\n\n render(): TemplateResult {\n const words = html`${iconSvg(this.iconBefore)}<slot></slot>${iconSvg(this.iconAfter)}`;\n if (this.href && !this.disabled) {\n return html`<a class=${this.variant} href=${this.href} part=\"button\">${words}</a>`;\n }\n return html`\n <button\n class=${this.variant}\n type=\"button\"\n part=\"button\"\n ?disabled=${this.disabled}\n aria-disabled=${this.busy ? 'true' : nothing}\n aria-busy=${this.busy ? 'true' : nothing}\n @click=${this.onClick}\n >\n ${words}\n ${this.busy ? html`<span class=\"sr-only\">${this.busyLabel}</span>` : nothing}\n </button>\n `;\n }\n}\n\ncustomElements.define('impkt-button', ImpktButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-button': ImpktButton;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAkCjD,IAAM,cAAN,cAA0B,aAAa;AAAA,EAiC5C,cAAc;AACZ,UAAM;AAHR,SAAQ,YAAqC;AAI3C,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,WAAW;AAChB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,YAAY;AACjB,SAAK,OAAO;AACZ,QAAI;AACF,WAAK,YAAY,KAAK,gBAAgB;AAAA,IACxC,QAAQ;AACN,WAAK,YAAY;AAAA,IACnB;AAAA,EACF;AAAA,EAjDA;AAAA,SAAO,iBAAiB;AAAA;AAAA,EAExB;AAAA,SAAO,aAAa;AAAA,MAClB,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACvC,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,UAAU,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACzC,MAAM,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACrC,WAAW,EAAE,MAAM,QAAQ,WAAW,aAAa;AAAA,MACnD,MAAM,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACrC,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,MACrD,WAAW,EAAE,MAAM,QAAQ,WAAW,aAAa;AAAA,MACnD,MAAM,EAAE,MAAM,OAAO;AAAA,IACvB;AAAA;AAAA,EAsCA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA,MACA;AAAA;AAAA;AAAA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AA,EAEA,SAAyB;AACvB,UAAM,QAAQ,OAAO,QAAQ,KAAK,UAAU,CAAC,gBAAgB,QAAQ,KAAK,SAAS,CAAC;AACpF,QAAI,KAAK,QAAQ,CAAC,KAAK,UAAU;AAC/B,aAAO,gBAAgB,KAAK,OAAO,SAAS,KAAK,IAAI,kBAAkB,KAAK;AAAA,IAC9E;AACA,WAAO;AAAA;AAAA,gBAEK,KAAK,OAAO;AAAA;AAAA;AAAA,oBAGR,KAAK,QAAQ;AAAA,wBACT,KAAK,OAAO,SAAS,OAAO;AAAA,oBAChC,KAAK,OAAO,SAAS,OAAO;AAAA,iBAC/B,KAAK,OAAO;AAAA;AAAA,UAEnB,KAAK;AAAA,UACL,KAAK,OAAO,6BAA6B,KAAK,SAAS,YAAY,OAAO;AAAA;AAAA;AAAA,EAGlF;AACF;AAEA,eAAe,OAAO,gBAAgB,WAAW;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/base/tokens.ts","../src/base/styles.ts","../src/base/ImpktElement.ts"],"sourcesContent":["/**\n * Token helpers.\n *\n * Components never name a colour, a size or a radius. They name a token, and a\n * brand decides what it holds — which is what makes a rebrand a content\n * publish rather than a rebuild\n * ([ADR 0005](../../../../docs/decisions/0005-design-tokens.md)).\n *\n * Every reference carries a fallback so that a component dropped onto a page\n * with no token stylesheet still renders something legible. An unstyled\n * component is indistinguishable from a broken one, and the fallback is what\n * keeps a missing stylesheet a visible annoyance rather than a blank screen.\n *\n * These return `CSSResult` rather than strings. Lit's `css` tag refuses plain\n * interpolated strings, which is a deliberate guard against injecting\n * attacker-controlled text into a stylesheet; `unsafeCSS` is the documented\n * way past it and is safe here because every value is a literal in this file,\n * never anything authored or fetched.\n */\nimport { css, unsafeCSS, type CSSResult } from 'lit';\n\n/** `color.brand.default` → `var(--impkt-color-brand-default, <fallback>)`. */\nexport const token = (path: string, fallback: string): CSSResult =>\n unsafeCSS(`var(--impkt-${path.replace(/\\./g, '-')}, ${fallback})`);\n\nexport const t = {\n brand: token('color.brand.default', '#1f4ed8'),\n brandHover: token('color.brand.hover', '#1b45be'),\n brandActive: token('color.brand.active', '#183ba4'),\n brandSubtle: token('color.brand.subtle', '#e4eafa'),\n onBrand: token('color.text.on-brand', '#ffffff'),\n\n surfaceCard: token('color.surface.card', '#ffffff'),\n surfaceInset: token('color.surface.inset', '#f4f4f4'),\n surfaceSubtle: token('color.surface.subtle', '#e4eafa'),\n\n text: token('color.text.default', '#1a1a1a'),\n textMuted: token('color.text.muted', '#717171'),\n textPlaceholder: token('color.text.placeholder', '#767676'),\n textHeading: token('color.text.heading', '#1f4ed8'),\n link: token('color.text.link', '#1f4ed8'),\n linkHover: token('color.text.link-hover', '#193ead'),\n\n border: token('color.border.default', '#929292'),\n borderStrong: token('color.border.strong', '#818181'),\n\n danger: token('color.status.danger.default', '#c8102e'),\n dangerText: token('color.status.danger.text', '#c8102e'),\n dangerSubtle: token('color.status.danger.subtle', '#f8e2e6'),\n warning: token('color.status.warning.default', '#b45309'),\n warningText: token('color.status.warning.text', '#b45309'),\n warningSubtle: token('color.status.warning.subtle', '#f6eae1'),\n success: token('color.status.success.default', '#047857'),\n successText: token('color.status.success.text', '#047857'),\n successSubtle: token('color.status.success.subtle', '#e0f0ea'),\n info: token('color.status.info.default', '#1f4ed8'),\n infoText: token('color.status.info.text', '#1f4ed8'),\n infoSubtle: token('color.status.info.subtle', '#e4eafa'),\n\n fontBody: token('font.family.body', 'system-ui, sans-serif'),\n fontHeading: token('font.family.heading', 'system-ui, sans-serif'),\n\n focusShadow: token('focus.ring.shadow', '0 0 0 2px #ffffff, 0 0 0 4px #1a1a1a'),\n focusOffset: token('focus.ring.offset', '2px'),\n\n targetMin: token('target.min', '24px'),\n\n radiusSm: token('radius.sm', '2px'),\n radius: token('radius.md', '4px'),\n radiusLg: token('radius.lg', '8px'),\n\n borderThin: token('border.width.thin', '1px'),\n borderThick: token('border.width.thick', '2px'),\n} as const;\n\n/** `space.3` → the custom property. Spacing is always a token, never a number. */\nexport const space = (step: number): CSSResult => token(`space.${step}`, `${step * 4}px`);\n/** `font.size.lg` → the custom property. */\nexport const fontSize = (name: string): CSSResult => token(`font.size.${name}`, '1rem');\nexport const lineHeight = (name: string): CSSResult => token(`font.line-height.${name}`, '1.5');\nexport const fontWeight = (name: string): CSSResult => token(`font.weight.${name}`, '400');\n\n/**\n * Space above and below a section, from the spacing scale: `none`, `sm`,\n * `md`, `lg` or `xl`, set by `space-above` and `space-below`. A section names\n * a step rather than a size, so a page keeps the brand's rhythm.\n */\nexport const spaceAround: CSSResult = css`\n :host([space-above='sm']) { margin-block-start: ${space(2)}; }\n :host([space-above='md']) { margin-block-start: ${space(4)}; }\n :host([space-above='lg']) { margin-block-start: ${space(6)}; }\n :host([space-above='xl']) { margin-block-start: ${space(8)}; }\n :host([space-below='sm']) { margin-block-end: ${space(2)}; }\n :host([space-below='md']) { margin-block-end: ${space(4)}; }\n :host([space-below='lg']) { margin-block-end: ${space(6)}; }\n :host([space-below='xl']) { margin-block-end: ${space(8)}; }\n`;\n","/**\n * Shared style fragments.\n *\n * Three of these carry an accessibility guarantee and are therefore not\n * negotiable per component: the focus ring, the minimum target size and the\n * reduced-motion rule. A component that wants its own focus treatment is a\n * component that will get it subtly wrong on one brand, so there is one.\n */\nimport { css } from 'lit';\nimport { t } from './tokens';\n\n/**\n * The focus ring.\n *\n * `:focus-visible` rather than `:focus`, so a mouse click on a button does not\n * draw a ring the user did not ask for while keyboard focus still does.\n *\n * The ring is two-tone — a light inner band inside a dark outer one — drawn\n * with `box-shadow` and a transparent `outline` behind it. The outline is not\n * decoration: it is what survives Windows High Contrast Mode, where box-shadow\n * is dropped entirely and a shadow-only ring disappears for exactly the users\n * who most need it.\n *\n * The colours come from locked tokens a brand cannot reach\n * ([ADR 0010](../../../../docs/decisions/0010-what-a-brand-may-set.md)).\n */\nexport const focusRing = css`\n :host(:focus-visible),\n :host(:not([disabled])) :focus-visible {\n outline: 2px solid transparent;\n outline-offset: ${t.focusOffset};\n box-shadow: ${t.focusShadow};\n }\n`;\n\n/**\n * WCAG 2.2, 2.5.8 Target Size (Minimum): 24 by 24 CSS pixels.\n *\n * Applied as a minimum rather than a fixed size so a control grows with its\n * content and never shrinks below the floor. It reads the locked token, which\n * is deliberately outside the spacing scale — otherwise a brand tightening its\n * spacing unit would shrink every tap target with it.\n */\nexport const targetSize = css`\n min-block-size: ${t.targetMin};\n min-inline-size: ${t.targetMin};\n`;\n\n/**\n * Visible to a screen reader, invisible on screen.\n *\n * `clip-path` with a 1px box rather than `display: none` or `visibility:\n * hidden`, both of which remove the text from the accessibility tree — which\n * is the one thing this must not do.\n */\nexport const visuallyHidden = css`\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n`;\n\n/**\n * 2.3.3 Animation from Interactions, and plain decency.\n *\n * `0.01ms` rather than `0` because a zero-duration transition does not fire a\n * `transitionend` event in every engine, and components that wait for one hang.\n */\nexport const reducedMotion = css`\n @media (prefers-reduced-motion: reduce) {\n :host,\n :host *,\n :host *::before,\n :host *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n }\n`;\n\n/** The base every component starts from. */\nexport const base = css`\n :host {\n box-sizing: border-box;\n font-family: ${t.fontBody};\n color: ${t.text};\n }\n :host([hidden]) {\n display: none !important;\n }\n *,\n *::before,\n *::after {\n box-sizing: inherit;\n }\n`;\n","import { LitElement, css } from 'lit';\nimport { base, reducedMotion } from './styles';\n\nlet counter = 0;\n\n/**\n * The base every Impkt component extends.\n *\n * It carries the two style fragments that are not a per-component choice — the\n * reset and the reduced-motion rule — and a stable id generator for the ARIA\n * wiring. It deliberately carries nothing else: a base class that grows\n * behaviour becomes the place every component's exceptions are negotiated.\n */\nexport class ImpktElement extends LitElement {\n static styles = [base, reducedMotion, css``];\n\n /**\n * A unique id for this instance, for `aria-describedby` and friends.\n *\n * Generated once in the constructor rather than in `render`, because an id\n * that changes between renders breaks the relationship it exists to express\n * — and it breaks it silently, since the markup still looks correct.\n */\n protected readonly uid = `impkt-${(counter += 1)}`;\n\n protected id_(part: string): string {\n return `${this.uid}-${part}`;\n }\n}\n"],"mappings":";AAmBA,SAAS,KAAK,iBAAiC;AAGxC,IAAM,QAAQ,CAAC,MAAc,aAClC,UAAU,eAAe,KAAK,QAAQ,OAAO,GAAG,CAAC,KAAK,QAAQ,GAAG;AAE5D,IAAM,IAAI;AAAA,EACf,OAAO,MAAM,uBAAuB,SAAS;AAAA,EAC7C,YAAY,MAAM,qBAAqB,SAAS;AAAA,EAChD,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,SAAS,MAAM,uBAAuB,SAAS;AAAA,EAE/C,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,cAAc,MAAM,uBAAuB,SAAS;AAAA,EACpD,eAAe,MAAM,wBAAwB,SAAS;AAAA,EAEtD,MAAM,MAAM,sBAAsB,SAAS;AAAA,EAC3C,WAAW,MAAM,oBAAoB,SAAS;AAAA,EAC9C,iBAAiB,MAAM,0BAA0B,SAAS;AAAA,EAC1D,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,MAAM,MAAM,mBAAmB,SAAS;AAAA,EACxC,WAAW,MAAM,yBAAyB,SAAS;AAAA,EAEnD,QAAQ,MAAM,wBAAwB,SAAS;AAAA,EAC/C,cAAc,MAAM,uBAAuB,SAAS;AAAA,EAEpD,QAAQ,MAAM,+BAA+B,SAAS;AAAA,EACtD,YAAY,MAAM,4BAA4B,SAAS;AAAA,EACvD,cAAc,MAAM,8BAA8B,SAAS;AAAA,EAC3D,SAAS,MAAM,gCAAgC,SAAS;AAAA,EACxD,aAAa,MAAM,6BAA6B,SAAS;AAAA,EACzD,eAAe,MAAM,+BAA+B,SAAS;AAAA,EAC7D,SAAS,M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