@atomic-ui/ui 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +18 -6
  2. package/dist/base/FieldElement.d.ts +7 -0
  3. package/dist/{chunk-A4CJ2F3J.js → chunk-4AJPS5AU.js} +8 -4
  4. package/dist/chunk-4AJPS5AU.js.map +1 -0
  5. package/dist/{chunk-QYHWR6C5.js → chunk-4JKUAA6K.js} +8 -4
  6. package/dist/chunk-4JKUAA6K.js.map +1 -0
  7. package/dist/{chunk-TIKX5POO.js → chunk-57P4WO4Y.js} +32 -12
  8. package/dist/chunk-57P4WO4Y.js.map +1 -0
  9. package/dist/{chunk-OBCSDZHP.js → chunk-5RVMMKMO.js} +2 -2
  10. package/dist/{chunk-DIZCGSJA.js → chunk-6GKI67P7.js} +14 -2
  11. package/dist/chunk-6GKI67P7.js.map +1 -0
  12. package/dist/chunk-AXQ5YBN2.js +236 -0
  13. package/dist/chunk-AXQ5YBN2.js.map +1 -0
  14. package/dist/chunk-CFGLOYWW.js +85 -0
  15. package/dist/chunk-CFGLOYWW.js.map +1 -0
  16. package/dist/{chunk-ZXCSQ6MK.js → chunk-DI2CJ3MZ.js} +9 -1
  17. package/dist/chunk-DI2CJ3MZ.js.map +1 -0
  18. package/dist/{chunk-LFOWTFMR.js → chunk-DR3SJ7ZV.js} +2 -2
  19. package/dist/chunk-G6UVYMA6.js +56 -0
  20. package/dist/chunk-G6UVYMA6.js.map +1 -0
  21. package/dist/{chunk-CGMDIZPO.js → chunk-H6L3FSQY.js} +2 -2
  22. package/dist/{chunk-4KFHQBH2.js → chunk-JPEWRJSQ.js} +16 -3
  23. package/dist/chunk-JPEWRJSQ.js.map +1 -0
  24. package/dist/{chunk-PDXOPY22.js → chunk-KWURASAB.js} +2 -2
  25. package/dist/chunk-LLRJU7XE.js +195 -0
  26. package/dist/chunk-LLRJU7XE.js.map +1 -0
  27. package/dist/{chunk-4Y3HJBJY.js → chunk-OFAVRPRK.js} +2 -1
  28. package/dist/chunk-OFAVRPRK.js.map +1 -0
  29. package/dist/{chunk-GGODB3GY.js → chunk-QELX47AP.js} +70 -8
  30. package/dist/chunk-QELX47AP.js.map +1 -0
  31. package/dist/chunk-QH46SOPJ.js +134 -0
  32. package/dist/chunk-QH46SOPJ.js.map +1 -0
  33. package/dist/chunk-U2S7OESF.js +135 -0
  34. package/dist/chunk-U2S7OESF.js.map +1 -0
  35. package/dist/{chunk-MAMBT7BZ.js → chunk-ZDYTNFQI.js} +8 -4
  36. package/dist/chunk-ZDYTNFQI.js.map +1 -0
  37. package/dist/components/blocks.d.ts +174 -0
  38. package/dist/components/blocks.js +17 -0
  39. package/dist/components/blocks.js.map +1 -0
  40. package/dist/components/button.d.ts +26 -0
  41. package/dist/components/button.js +2 -1
  42. package/dist/components/checkbox-group.js +2 -2
  43. package/dist/components/checkbox.js +2 -2
  44. package/dist/components/date-input.js +2 -2
  45. package/dist/components/fieldset.d.ts +49 -0
  46. package/dist/components/fieldset.js +8 -0
  47. package/dist/components/fieldset.js.map +1 -0
  48. package/dist/components/grid.d.ts +1 -1
  49. package/dist/components/grid.js +1 -1
  50. package/dist/components/icon.d.ts +89 -0
  51. package/dist/components/icon.js +14 -0
  52. package/dist/components/icon.js.map +1 -0
  53. package/dist/components/layout.d.ts +65 -2
  54. package/dist/components/layout.js +1 -1
  55. package/dist/components/link.d.ts +11 -0
  56. package/dist/components/link.js +2 -1
  57. package/dist/components/marketing.d.ts +257 -0
  58. package/dist/components/marketing.js +17 -0
  59. package/dist/components/marketing.js.map +1 -0
  60. package/dist/components/media.d.ts +12 -0
  61. package/dist/components/media.js +1 -1
  62. package/dist/components/navigation.d.ts +91 -0
  63. package/dist/components/navigation.js +11 -0
  64. package/dist/components/navigation.js.map +1 -0
  65. package/dist/components/page.d.ts +119 -0
  66. package/dist/components/page.js +10 -0
  67. package/dist/components/page.js.map +1 -0
  68. package/dist/components/radio-group.js +2 -2
  69. package/dist/components/select.d.ts +6 -0
  70. package/dist/components/select.js +2 -2
  71. package/dist/components/text-input.d.ts +6 -0
  72. package/dist/components/text-input.js +2 -2
  73. package/dist/components/textarea.d.ts +6 -0
  74. package/dist/components/textarea.js +2 -2
  75. package/dist/index.d.ts +6 -0
  76. package/dist/index.js +82 -32
  77. package/package.json +2 -2
  78. package/dist/chunk-4KFHQBH2.js.map +0 -1
  79. package/dist/chunk-4Y3HJBJY.js.map +0 -1
  80. package/dist/chunk-A4CJ2F3J.js.map +0 -1
  81. package/dist/chunk-DIZCGSJA.js.map +0 -1
  82. package/dist/chunk-GGODB3GY.js.map +0 -1
  83. package/dist/chunk-MAMBT7BZ.js.map +0 -1
  84. package/dist/chunk-QYHWR6C5.js.map +0 -1
  85. package/dist/chunk-TIKX5POO.js.map +0 -1
  86. package/dist/chunk-ZXCSQ6MK.js.map +0 -1
  87. /package/dist/{chunk-OBCSDZHP.js.map → chunk-5RVMMKMO.js.map} +0 -0
  88. /package/dist/{chunk-LFOWTFMR.js.map → chunk-DR3SJ7ZV.js.map} +0 -0
  89. /package/dist/{chunk-CGMDIZPO.js.map → chunk-H6L3FSQY.js.map} +0 -0
  90. /package/dist/{chunk-PDXOPY22.js.map → chunk-KWURASAB.js.map} +0 -0
package/README.md CHANGED
@@ -24,16 +24,28 @@ In React, from `@atomic-ui/ui-react`:
24
24
 
25
25
  ## What is here
26
26
 
27
- Twenty-four elements.
27
+ Forty-one elements.
28
28
 
29
29
  | Group | Elements |
30
30
  | --- | --- |
31
- | Layout and type | `impkt-grid`, `impkt-stack`, `impkt-card`, `impkt-heading`, `impkt-text` |
32
- | Actions | `impkt-button`, `impkt-link` |
33
- | Form controls | `impkt-text-input`, `impkt-textarea`, `impkt-select`, `impkt-checkbox`, `impkt-checkbox-group`, `impkt-radio-group`, `impkt-date-input` |
31
+ | The page frame | `impkt-page`, `impkt-section` |
32
+ | Layout and type | `impkt-grid`, `impkt-stack`, `impkt-card`, `impkt-heading`, `impkt-text`, `impkt-divider`, `impkt-spacer`, `impkt-visually-hidden` |
33
+ | Navigation and actions | `impkt-nav`, `impkt-breadcrumbs`, `impkt-button`, `impkt-link` |
34
+ | Marketing blocks | `impkt-hero`, `impkt-feature-list`, `impkt-card-grid`, `impkt-quote`, `impkt-stat`, `impkt-badge` |
35
+ | Form controls | `impkt-text-input`, `impkt-textarea`, `impkt-select`, `impkt-checkbox`, `impkt-checkbox-group`, `impkt-radio-group`, `impkt-date-input`, `impkt-fieldset` |
34
36
  | Feedback | `impkt-alert`, `impkt-dialog` |
35
- | Content | `impkt-summary-list`, `impkt-table`, `impkt-accordion`, `impkt-progress`, `impkt-price` |
36
- | Media | `impkt-image`, `impkt-logo`, `impkt-document-link` |
37
+ | Content | `impkt-summary-list`, `impkt-table`, `impkt-accordion`, `impkt-tabs`, `impkt-progress`, `impkt-price` |
38
+ | Media | `impkt-image`, `impkt-logo`, `impkt-icon`, `impkt-document-link` |
39
+
40
+ **A layout puts `impkt-page` at its root.** It gives a page the brand's page width
41
+ (`layout.page-width`), its side margins on a phone, tablet and desktop
42
+ (`layout.margin.*`), the header, main and footer landmarks, and a Skip to content link.
43
+ Without it a page runs edge to edge. `impkt-section` is a band across the whole width
44
+ of the screen with the content kept to the page width inside it.
45
+
46
+ **Icons come from one set**, `ICONS`, drawn on a 24 by 24 grid in the current text
47
+ colour, so every icon matches the line weight of the ones beside it. An icon is
48
+ decorative unless it is given a `label`.
37
49
 
38
50
  Bindings: [`@atomic-ui/ui-react`](../ui-react), [`@atomic-ui/ui-vue`](../ui-vue),
39
51
  [`@atomic-ui/ui-angular`](../ui-angular). Each is thin and each exists for a different
@@ -15,6 +15,13 @@ import { ImpktElement } from './ImpktElement';
15
15
  * outside could not describe it. Keeping the whole relationship in one tree is
16
16
  * what makes the wiring work at all.
17
17
  */
18
+ /**
19
+ * How wide a single-line control is, from what it holds: a postcode is short,
20
+ * an email address is long. A width that matches the answer is a hint about
21
+ * what to type (1.3.5 is about the purpose, this is about the size). Applied by
22
+ * the controls that take a `width`, through `--impkt-field-width`.
23
+ */
24
+ export declare const fieldWidths: import("lit").CSSResult;
18
25
  export declare abstract class FieldElement extends ImpktElement {
19
26
  /** Form controls participate in a `<form>` like native ones. */
20
27
  static formAssociated: boolean;
@@ -1,6 +1,7 @@
1
1
  import {
2
- FieldElement
3
- } from "./chunk-ZXCSQ6MK.js";
2
+ FieldElement,
3
+ fieldWidths
4
+ } from "./chunk-DI2CJ3MZ.js";
4
5
  import {
5
6
  fontSize,
6
7
  space,
@@ -13,6 +14,7 @@ var ImpktTextInput = class extends FieldElement {
13
14
  static {
14
15
  this.properties = {
15
16
  ...FieldElement.properties,
17
+ width: { type: String, reflect: true },
16
18
  type: { type: String },
17
19
  placeholder: { type: String },
18
20
  autocomplete: { type: String },
@@ -22,6 +24,7 @@ var ImpktTextInput = class extends FieldElement {
22
24
  }
23
25
  constructor() {
24
26
  super();
27
+ this.width = "full";
25
28
  this.type = "text";
26
29
  this.placeholder = "";
27
30
  this.autocomplete = "";
@@ -31,9 +34,10 @@ var ImpktTextInput = class extends FieldElement {
31
34
  static {
32
35
  this.styles = [
33
36
  ...FieldElement.styles,
37
+ fieldWidths,
34
38
  css`
35
39
  input {
36
- inline-size: 100%;
40
+ inline-size: min(100%, var(--impkt-field-width));
37
41
  min-block-size: 44px;
38
42
  padding: ${space(3)};
39
43
  font-family: inherit;
@@ -89,4 +93,4 @@ customElements.define("impkt-text-input", ImpktTextInput);
89
93
  export {
90
94
  ImpktTextInput
91
95
  };
92
- //# sourceMappingURL=chunk-A4CJ2F3J.js.map
96
+ //# sourceMappingURL=chunk-4AJPS5AU.js.map
@@ -0,0 +1 @@
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,6 +1,7 @@
1
1
  import {
2
- FieldElement
3
- } from "./chunk-ZXCSQ6MK.js";
2
+ FieldElement,
3
+ fieldWidths
4
+ } from "./chunk-DI2CJ3MZ.js";
4
5
  import {
5
6
  fontSize,
6
7
  space,
@@ -13,21 +14,24 @@ 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%;
34
+ inline-size: min(100%, var(--impkt-field-width));
31
35
  padding: ${space(3)};
32
36
  font-family: inherit;
33
37
  font-size: ${fontSize("md")};
@@ -72,4 +76,4 @@ customElements.define("impkt-textarea", ImpktTextarea);
72
76
  export {
73
77
  ImpktTextarea
74
78
  };
75
- //# sourceMappingURL=chunk-QYHWR6C5.js.map
79
+ //# sourceMappingURL=chunk-4JKUAA6K.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(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,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,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;AAAA;AAAA;AAAA,wBAMT,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,QAAQ,OAAO;AAAA,eACpB,KAAK,IAAI;AAAA,oBACJ,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,OAA+B,KAAK,CAAC;AAAA,SAChF,KAAK,KAAK;AAAA;AAAA,EAEjB;AAAA,EAEA,QAAQ,SAAqC;AAC3C,QAAI,QAAQ,IAAI,OAAO,EAAG,MAAK,gBAAgB,WAAW,QAAQ,KAAK,KAAK,CAAC;AAAA,EAC/E;AACF;AAEA,eAAe,OAAO,kBAAkB,aAAa;","names":[]}
@@ -1,3 +1,6 @@
1
+ import {
2
+ iconSvg
3
+ } from "./chunk-CFGLOYWW.js";
1
4
  import {
2
5
  ImpktElement,
3
6
  focusRing,
@@ -21,6 +24,10 @@ var ImpktButton = class extends ImpktElement {
21
24
  this.busy = false;
22
25
  this.busyLabel = "Working";
23
26
  this.full = false;
27
+ this.size = "md";
28
+ this.iconBefore = "none";
29
+ this.iconAfter = "none";
30
+ this.href = "";
24
31
  try {
25
32
  this.internals = this.attachInternals();
26
33
  } catch {
@@ -37,7 +44,11 @@ var ImpktButton = class extends ImpktElement {
37
44
  disabled: { type: Boolean, reflect: true },
38
45
  busy: { type: Boolean, reflect: true },
39
46
  busyLabel: { type: String, attribute: "busy-label" },
40
- full: { type: Boolean, reflect: true }
47
+ full: { type: Boolean, reflect: true },
48
+ size: { type: String, reflect: true },
49
+ iconBefore: { type: String, attribute: "icon-before" },
50
+ iconAfter: { type: String, attribute: "icon-after" },
51
+ href: { type: String }
41
52
  };
42
53
  }
43
54
  static {
@@ -51,8 +62,10 @@ var ImpktButton = class extends ImpktElement {
51
62
  :host([full]) {
52
63
  display: block;
53
64
  }
54
- button {
65
+ button, a {
55
66
  ${targetSize}
67
+ box-sizing: border-box;
68
+ text-decoration: none;
56
69
  display: inline-flex;
57
70
  align-items: center;
58
71
  justify-content: center;
@@ -68,6 +81,9 @@ var ImpktButton = class extends ImpktElement {
68
81
  cursor: pointer;
69
82
  transition: background-color 120ms ease-in-out, border-color 120ms ease-in-out;
70
83
  }
84
+ :host([size='sm']) :is(button, a) { padding: ${space(2)} ${space(3)}; font-size: ${fontSize("sm")}; }
85
+ :host([size='lg']) :is(button, a) { padding: ${space(4)} ${space(6)}; font-size: ${fontSize("lg")}; }
86
+ .icon { flex: none; }
71
87
  /* The cursor is the only thing that changes while busy. Moving or
72
88
  recolouring a control the moment it is pressed is how a user loses it. */
73
89
  button[aria-disabled='true'] {
@@ -78,33 +94,33 @@ var ImpktButton = class extends ImpktElement {
78
94
  opacity: 0.55;
79
95
  }
80
96
 
81
- button.primary {
97
+ .primary {
82
98
  background: ${t.brand};
83
99
  color: ${t.onBrand};
84
100
  }
85
- button.primary:hover:not([aria-disabled='true']) {
101
+ .primary:hover:not([aria-disabled='true']) {
86
102
  background: ${t.brandHover};
87
103
  }
88
- button.primary:active:not([aria-disabled='true']) {
104
+ .primary:active:not([aria-disabled='true']) {
89
105
  background: ${t.brandActive};
90
106
  }
91
107
 
92
- button.secondary {
108
+ .secondary {
93
109
  background: transparent;
94
110
  color: ${t.link};
95
111
  border-color: currentColor;
96
112
  }
97
- button.secondary:hover:not([aria-disabled='true']) {
113
+ .secondary:hover:not([aria-disabled='true']) {
98
114
  background: ${t.brandSubtle};
99
115
  }
100
116
 
101
- button.ghost {
117
+ .ghost {
102
118
  background: transparent;
103
119
  color: ${t.link};
104
120
  border-color: transparent;
105
121
  text-decoration: underline;
106
122
  }
107
- button.ghost:hover:not([aria-disabled='true']) {
123
+ .ghost:hover:not([aria-disabled='true']) {
108
124
  background: ${t.brandSubtle};
109
125
  }
110
126
 
@@ -116,7 +132,7 @@ var ImpktButton = class extends ImpktElement {
116
132
  button styled only by background becomes invisible. A forced-colors
117
133
  border puts the boundary back. */
118
134
  @media (forced-colors: active) {
119
- button {
135
+ button, a {
120
136
  border-color: ButtonBorder;
121
137
  }
122
138
  }
@@ -133,6 +149,10 @@ var ImpktButton = class extends ImpktElement {
133
149
  if (this.type === "reset") this.internals?.form?.reset();
134
150
  }
135
151
  render() {
152
+ const words = html`${iconSvg(this.iconBefore)}<slot></slot>${iconSvg(this.iconAfter)}`;
153
+ if (this.href && !this.disabled) {
154
+ return html`<a class=${this.variant} href=${this.href} part="button">${words}</a>`;
155
+ }
136
156
  return html`
137
157
  <button
138
158
  class=${this.variant}
@@ -143,7 +163,7 @@ var ImpktButton = class extends ImpktElement {
143
163
  aria-busy=${this.busy ? "true" : nothing}
144
164
  @click=${this.onClick}
145
165
  >
146
- <slot></slot>
166
+ ${words}
147
167
  ${this.busy ? html`<span class="sr-only">${this.busyLabel}</span>` : nothing}
148
168
  </button>
149
169
  `;
@@ -154,4 +174,4 @@ customElements.define("impkt-button", ImpktButton);
154
174
  export {
155
175
  ImpktButton
156
176
  };
157
- //# sourceMappingURL=chunk-TIKX5POO.js.map
177
+ //# sourceMappingURL=chunk-57P4WO4Y.js.map
@@ -0,0 +1 @@
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;AAA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js";
3
+ } from "./chunk-DI2CJ3MZ.js";
4
4
  import {
5
5
  fontSize,
6
6
  space,
@@ -136,4 +136,4 @@ customElements.define("impkt-radio-group", ImpktRadioGroup);
136
136
  export {
137
137
  ImpktRadioGroup
138
138
  };
139
- //# sourceMappingURL=chunk-OBCSDZHP.js.map
139
+ //# sourceMappingURL=chunk-5RVMMKMO.js.map
@@ -15,11 +15,15 @@ var ImpktImage = class extends ImpktElement {
15
15
  height: { type: Number },
16
16
  focalX: { type: Number, attribute: "focal-x" },
17
17
  focalY: { type: Number, attribute: "focal-y" },
18
- loading: { type: String }
18
+ loading: { type: String },
19
+ ratio: { type: String, reflect: true },
20
+ rounded: { type: String, reflect: true }
19
21
  };
20
22
  }
21
23
  constructor() {
22
24
  super();
25
+ this.ratio = "natural";
26
+ this.rounded = "none";
23
27
  this.src = "";
24
28
  this.alt = "";
25
29
  this.decorative = false;
@@ -42,6 +46,14 @@ var ImpktImage = class extends ImpktElement {
42
46
  block-size: auto;
43
47
  object-fit: cover;
44
48
  }
49
+ :host(:not([ratio='natural'])) img { inline-size: 100%; }
50
+ :host([ratio='16:9']) img { aspect-ratio: 16 / 9; }
51
+ :host([ratio='4:3']) img { aspect-ratio: 4 / 3; }
52
+ :host([ratio='3:2']) img { aspect-ratio: 3 / 2; }
53
+ :host([ratio='1:1']) img { aspect-ratio: 1 / 1; }
54
+ :host([rounded='sm']) img { border-radius: ${t.radius}; }
55
+ :host([rounded='lg']) img { border-radius: ${t.radiusLg}; }
56
+ :host([rounded='full']) img { border-radius: 50%; }
45
57
  `
46
58
  ];
47
59
  }
@@ -159,4 +171,4 @@ export {
159
171
  ImpktLogo,
160
172
  ImpktDocumentLink
161
173
  };
162
- //# sourceMappingURL=chunk-DIZCGSJA.js.map
174
+ //# sourceMappingURL=chunk-6GKI67P7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/media.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { t } from '../base/tokens';\n\n/**\n * An image.\n *\n * `alt` is required and may be the empty string, which is a decision rather\n * than laxity: an empty alt is the correct and only way to mark an image as\n * decorative, and a missing alt is a different thing entirely — it leaves a\n * screen reader to read the file name. Making the property required forces the\n * author to say which they meant.\n *\n * `width` and `height` are the intrinsic pixel size. Without them the browser\n * cannot reserve space and the page jumps as each image loads, which is a\n * usability problem for everyone and a serious one for anyone using a screen\n * magnifier, who loses their place entirely.\n\n *\n * @category media\n * @icon image\n * @role image\n */\nexport class ImpktImage extends ImpktElement {\n static properties = {\n src: { type: String },\n alt: { type: String },\n decorative: { type: Boolean, reflect: true },\n width: { type: Number },\n height: { type: Number },\n focalX: { type: Number, attribute: 'focal-x' },\n focalY: { type: Number, attribute: 'focal-y' },\n loading: { type: String },\n ratio: { type: String, reflect: true },\n rounded: { type: String, reflect: true },\n };\n\n declare src: string;\n declare alt: string;\n /**\n * This image says nothing a reader needs.\n *\n * An empty `alt` is the correct way to mark a decorative image AND what a\n * missing one looks like, so the two are indistinguishable to anything\n * downstream — which is why the commonest accessibility failure on the web\n * survives every automated check. Only the author knows which they meant,\n * so this is where they say it, and the publish gate holds them to it.\n */\n declare decorative: boolean;\n declare width: number | undefined;\n declare height: number | undefined;\n /** The fraction of the image that must survive a crop. */\n declare focalX: number;\n declare focalY: number;\n declare loading: 'lazy' | 'eager';\n /** The picture's shape. It is cropped to fit, keeping the focal point in view. */\n declare ratio: 'natural' | '16:9' | '4:3' | '3:2' | '1:1';\n /** How round the corners are. */\n declare rounded: 'none' | 'sm' | 'lg' | 'full';\n\n constructor() {\n super();\n this.ratio = 'natural';\n this.rounded = 'none';\n this.src = '';\n this.alt = '';\n this.decorative = false;\n this.width = undefined;\n this.height = undefined;\n this.focalX = 0.5;\n this.focalY = 0.5;\n this.loading = 'lazy';\n }\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: block;\n }\n img {\n display: block;\n max-inline-size: 100%;\n block-size: auto;\n object-fit: cover;\n }\n :host(:not([ratio='natural'])) img { inline-size: 100%; }\n :host([ratio='16:9']) img { aspect-ratio: 16 / 9; }\n :host([ratio='4:3']) img { aspect-ratio: 4 / 3; }\n :host([ratio='3:2']) img { aspect-ratio: 3 / 2; }\n :host([ratio='1:1']) img { aspect-ratio: 1 / 1; }\n :host([rounded='sm']) img { border-radius: ${t.radius}; }\n :host([rounded='lg']) img { border-radius: ${t.radiusLg}; }\n :host([rounded='full']) img { border-radius: 50%; }\n `,\n ];\n\n render(): TemplateResult {\n return html`\n <img\n part=\"image\"\n src=${this.src}\n alt=${this.decorative ? '' : this.alt}\n role=${this.decorative ? 'presentation' : nothing}\n width=${this.width ?? nothing}\n height=${this.height ?? nothing}\n loading=${this.loading}\n style=\"object-position: ${this.focalX * 100}% ${this.focalY * 100}%\"\n />\n `;\n }\n}\n\n/**\n * The partner's logo.\n *\n * Separate from `impkt-image` for one reason: it is the most prominent image on\n * every page and its alt text is the brand name, so it should not be possible\n * to ship it with an empty alt by copying a decorative image. `src` and `alt`\n * come from the brand's assets.\n *\n * `on-dark` picks the dark-surface variant where the brand supplies one. A\n * logo that disappears into a dark footer is not a styling problem, it is a\n * missing piece of information.\n\n *\n * @category media\n * @icon logo\n */\nexport class ImpktLogo extends ImpktElement {\n static properties = {\n src: { type: String },\n srcDark: { type: String, attribute: 'src-dark' },\n alt: { type: String },\n onDark: { type: Boolean, attribute: 'on-dark', reflect: true },\n height: { type: Number },\n };\n\n declare src: string;\n declare srcDark: string;\n declare alt: string;\n declare onDark: boolean;\n declare height: number;\n\n constructor() {\n super();\n this.src = '';\n this.srcDark = '';\n this.alt = '';\n this.onDark = false;\n this.height = 32;\n }\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: inline-block;\n }\n img {\n display: block;\n inline-size: auto;\n }\n `,\n ];\n\n render(): TemplateResult {\n const src = this.onDark && this.srcDark ? this.srcDark : this.src;\n return html`<img part=\"logo\" src=${src} alt=${this.alt} style=\"height: ${this.height}px\" />`;\n }\n}\n\n/**\n * A downloadable document — terms of service, a product sheet, a price list.\n *\n * The file type and size are part of the accessible name, not decoration\n * beside it. A list of links all named \"Download\" fails 2.4.4 Link Purpose,\n * and a reader tabbing between them cannot tell which document they are on.\n\n *\n * @category media\n * @icon document\n */\nexport class ImpktDocumentLink extends ImpktElement {\n static properties = {\n href: { type: String },\n label: { type: String },\n fileType: { type: String, attribute: 'file-type' },\n byteSize: { type: Number, attribute: 'byte-size' },\n };\n\n declare href: string;\n declare label: string;\n declare fileType: string;\n declare byteSize: number | undefined;\n\n constructor() {\n super();\n this.href = '';\n this.label = '';\n this.fileType = '';\n this.byteSize = undefined;\n }\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: block;\n }\n a {\n color: ${t.link};\n text-decoration: underline;\n text-underline-offset: 0.2em;\n display: inline-flex;\n gap: 0.5ch;\n align-items: baseline;\n min-block-size: ${t.targetMin};\n }\n .meta {\n color: ${t.textMuted};\n }\n `,\n ];\n\n /** \"240 KB\". Rounded, because the exact byte count helps nobody. */\n private get size(): string {\n if (!this.byteSize) return '';\n const kb = this.byteSize / 1024;\n return kb >= 1024 ? `${(kb / 1024).toFixed(1)} MB` : `${Math.round(kb)} KB`;\n }\n\n render(): TemplateResult {\n const meta = [this.fileType, this.size].filter(Boolean).join(', ');\n return html`\n <a part=\"link\" href=${this.href || nothing} download>\n <span>${this.label}</span>${meta ? html`<span class=\"meta\">(${meta})</span>` : nothing}\n </a>\n `;\n }\n}\n\ncustomElements.define('impkt-image', ImpktImage);\ncustomElements.define('impkt-logo', ImpktLogo);\ncustomElements.define('impkt-document-link', ImpktDocumentLink);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-image': ImpktImage;\n 'impkt-logo': ImpktLogo;\n 'impkt-document-link': ImpktDocumentLink;\n }\n}\n"],"mappings":";;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAuBjD,IAAM,aAAN,cAAyB,aAAa;AAAA,EAC3C;AAAA,S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AAA,0BAMG,EAAE,SAAS;AAAA;AAAA;AAAA,iBAGpB,EAAE,SAAS;AAAA;AAAA;AAAA,IAG1B;AAAA;AAAA;AAAA,EAGA,IAAY,OAAe;AACzB,QAAI,CAAC,KAAK,SAAU,QAAO;AAC3B,UAAM,KAAK,KAAK,WAAW;AAC3B,WAAO,MAAM,OAAO,IAAI,KAAK,MAAM,QAAQ,CAAC,CAAC,QAAQ,GAAG,KAAK,MAAM,EAAE,CAAC;AAAA,EACxE;AAAA,EAEA,SAAyB;AACvB,UAAM,OAAO,CAAC,KAAK,UAAU,KAAK,IAAI,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI;AACjE,WAAO;AAAA,4BACiB,KAAK,QAAQ,OAAO;AAAA,gBAChC,KAAK,KAAK,UAAU,OAAO,2BAA2B,IAAI,aAAa,OAAO;AAAA;AAAA;AAAA,EAG5F;AACF;AAEA,eAAe,OAAO,eAAe,UAAU;AAC/C,eAAe,OAAO,cAAc,SAAS;AAC7C,eAAe,OAAO,uBAAuB,iBAAiB;","names":[]}
@@ -0,0 +1,236 @@
1
+ import {
2
+ iconSvg
3
+ } from "./chunk-CFGLOYWW.js";
4
+ import {
5
+ ImpktElement,
6
+ fontSize,
7
+ fontWeight,
8
+ lineHeight,
9
+ space,
10
+ spaceAround,
11
+ t
12
+ } from "./chunk-5NUF7ZQA.js";
13
+
14
+ // packages/ui/src/components/marketing.ts
15
+ import { css, html, nothing } from "lit";
16
+ var heading = (level, text, cls) => html`<div class=${cls} role="heading" aria-level=${level}>${text}</div>`;
17
+ var headingStyles = css`
18
+ .h { margin: 0; color: ${t.textHeading}; font-family: ${t.fontHeading}; font-weight: ${fontWeight("bold")}; line-height: ${lineHeight("tight")}; }
19
+ .eyebrow { margin: 0; color: ${t.brand}; font-size: ${fontSize("sm")}; font-weight: ${fontWeight("semibold")}; letter-spacing: 0.06em; text-transform: uppercase; }
20
+ .body { margin: 0; line-height: ${lineHeight("normal")}; max-inline-size: 65ch; }
21
+ `;
22
+ var ImpktHero = class extends ImpktElement {
23
+ static {
24
+ this.properties = {
25
+ eyebrow: { type: String },
26
+ heading: { type: String },
27
+ lead: { type: String },
28
+ level: { type: Number, reflect: true },
29
+ imageSrc: { type: String, attribute: "image-src" },
30
+ imageAlt: { type: String, attribute: "image-alt" },
31
+ align: { type: String, reflect: true },
32
+ spaceAbove: { type: String, reflect: true, attribute: "space-above" },
33
+ spaceBelow: { type: String, reflect: true, attribute: "space-below" }
34
+ };
35
+ }
36
+ constructor() {
37
+ super();
38
+ this.eyebrow = "";
39
+ this.heading = "";
40
+ this.lead = "";
41
+ this.level = 1;
42
+ this.imageSrc = "";
43
+ this.imageAlt = "";
44
+ this.align = "start";
45
+ this.spaceAbove = "none";
46
+ this.spaceBelow = "none";
47
+ }
48
+ static {
49
+ this.styles = [...ImpktElement.styles, spaceAround, headingStyles, css`
50
+ :host { display: block; container-type: inline-size; }
51
+ .hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: ${space(8)}; align-items: center; }
52
+ .hero.pictured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
53
+ .words { display: flex; flex-direction: column; gap: ${space(4)}; }
54
+ :host([align='center']) .words { align-items: center; text-align: center; margin-inline: auto; max-inline-size: 48rem; }
55
+ .h { font-size: ${fontSize("3xl")}; }
56
+ .body { font-size: ${fontSize("lg")}; color: ${t.text}; }
57
+ .actions { display: flex; flex-wrap: wrap; gap: ${space(3)} ${space(4)}; align-items: center; margin-block-start: ${space(2)}; }
58
+ :host([align='center']) .actions { justify-content: center; }
59
+ img { display: block; inline-size: 100%; block-size: auto; border-radius: ${t.radiusLg}; aspect-ratio: 4 / 3; object-fit: cover; }
60
+ @container (max-width: 48rem) { .hero.pictured { grid-template-columns: minmax(0, 1fr); } }
61
+ `];
62
+ }
63
+ render() {
64
+ const pictured = Boolean(this.imageSrc) && this.align !== "center";
65
+ return html`<div class="hero ${pictured ? "pictured" : ""}" part="hero">
66
+ <div class="words">
67
+ ${this.eyebrow ? html`<p class="eyebrow" part="eyebrow">${this.eyebrow}</p>` : nothing}
68
+ ${heading(this.level, this.heading, "h")}
69
+ ${this.lead ? html`<p class="body">${this.lead}</p>` : nothing}
70
+ <div class="actions"><slot name="actions"></slot></div>
71
+ </div>
72
+ ${pictured ? html`<img src=${this.imageSrc} alt=${this.imageAlt} part="image" />` : nothing}
73
+ </div>`;
74
+ }
75
+ };
76
+ var ImpktFeatureList = class extends ImpktElement {
77
+ static {
78
+ this.properties = {
79
+ items: { type: Array },
80
+ columns: { type: String, reflect: true },
81
+ headingLevel: { type: Number, attribute: "heading-level" },
82
+ layout: { type: String, reflect: true },
83
+ spaceAbove: { type: String, reflect: true, attribute: "space-above" },
84
+ spaceBelow: { type: String, reflect: true, attribute: "space-below" }
85
+ };
86
+ }
87
+ constructor() {
88
+ super();
89
+ this.items = [];
90
+ this.columns = "three";
91
+ this.headingLevel = 3;
92
+ this.layout = "stacked";
93
+ this.spaceAbove = "none";
94
+ this.spaceBelow = "none";
95
+ }
96
+ static {
97
+ this.styles = [...ImpktElement.styles, spaceAround, headingStyles, css`
98
+ :host { display: block; container-type: inline-size; }
99
+ ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(8)} ${space(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
100
+ :host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
101
+ :host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
102
+ li { display: flex; flex-direction: column; gap: ${space(2)}; }
103
+ :host([layout='inline']) li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: ${space(4)}; align-items: start; }
104
+ :host([layout='inline']) .words { display: flex; flex-direction: column; gap: ${space(1)}; }
105
+ .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)}; }
106
+ :host([layout='inline']) .icon { margin: 0; }
107
+ .h { font-size: ${fontSize("lg")}; }
108
+ .body { color: ${t.text}; }
109
+ @container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
110
+ @container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
111
+ `];
112
+ }
113
+ render() {
114
+ return html`<ul part="list">${(this.items ?? []).map((item) => html`<li part="item">
115
+ ${item.icon ? html`<span class="icon">${iconSvg(item.icon, "24px")}</span>` : nothing}
116
+ <div class="words">${heading(this.headingLevel, item.heading, "h")}${item.text ? html`<p class="body">${item.text}</p>` : nothing}</div>
117
+ </li>`)}</ul>`;
118
+ }
119
+ };
120
+ var ImpktQuote = class extends ImpktElement {
121
+ static {
122
+ this.properties = {
123
+ quote: { type: String },
124
+ person: { type: String },
125
+ about: { type: String },
126
+ imageSrc: { type: String, attribute: "image-src" },
127
+ size: { type: String, reflect: true },
128
+ align: { type: String, reflect: true },
129
+ spaceAbove: { type: String, reflect: true, attribute: "space-above" },
130
+ spaceBelow: { type: String, reflect: true, attribute: "space-below" }
131
+ };
132
+ }
133
+ constructor() {
134
+ super();
135
+ this.quote = "";
136
+ this.person = "";
137
+ this.about = "";
138
+ this.imageSrc = "";
139
+ this.size = "md";
140
+ this.align = "start";
141
+ this.spaceAbove = "none";
142
+ this.spaceBelow = "none";
143
+ }
144
+ static {
145
+ this.styles = [...ImpktElement.styles, spaceAround, css`
146
+ :host { display: block; }
147
+ figure { margin: 0; display: flex; flex-direction: column; gap: ${space(4)}; max-inline-size: 48rem; }
148
+ :host([align='center']) figure { margin-inline: auto; align-items: center; text-align: center; }
149
+ blockquote { margin: 0; font-family: ${t.fontHeading}; font-size: ${fontSize("lg")}; line-height: ${lineHeight("normal")}; color: inherit; }
150
+ :host([size='lg']) blockquote { font-size: ${fontSize("2xl")}; line-height: ${lineHeight("tight")}; }
151
+ blockquote::before { content: '\\201C'; } blockquote::after { content: '\\201D'; }
152
+ figcaption { display: flex; align-items: center; gap: ${space(3)}; }
153
+ img { inline-size: 48px; block-size: 48px; border-radius: 50%; object-fit: cover; }
154
+ .name { font-weight: ${fontWeight("semibold")}; }
155
+ .detail { color: ${t.textMuted}; font-size: ${fontSize("sm")}; }
156
+ `];
157
+ }
158
+ render() {
159
+ return html`<figure part="figure">
160
+ <blockquote part="quote">${this.quote}</blockquote>
161
+ ${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}
162
+ </figure>`;
163
+ }
164
+ };
165
+ var ImpktStat = class extends ImpktElement {
166
+ static {
167
+ this.properties = {
168
+ figure: { type: String },
169
+ label: { type: String },
170
+ note: { type: String },
171
+ align: { type: String, reflect: true }
172
+ };
173
+ }
174
+ constructor() {
175
+ super();
176
+ this.figure = "";
177
+ this.label = "";
178
+ this.note = "";
179
+ this.align = "start";
180
+ }
181
+ static {
182
+ this.styles = [...ImpktElement.styles, css`
183
+ :host { display: block; }
184
+ .stat { display: flex; flex-direction: column; gap: ${space(1)}; }
185
+ :host([align='center']) .stat { align-items: center; text-align: center; }
186
+ .value { font-family: ${t.fontHeading}; font-size: ${fontSize("3xl")}; font-weight: ${fontWeight("bold")}; line-height: 1; color: ${t.textHeading}; }
187
+ .label { font-weight: ${fontWeight("semibold")}; }
188
+ .detail { color: ${t.textMuted}; font-size: ${fontSize("sm")}; }
189
+ `];
190
+ }
191
+ render() {
192
+ 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>`;
193
+ }
194
+ };
195
+ var ImpktBadge = class extends ImpktElement {
196
+ static {
197
+ this.properties = {
198
+ tone: { type: String, reflect: true },
199
+ icon: { type: String }
200
+ };
201
+ }
202
+ constructor() {
203
+ super();
204
+ this.tone = "neutral";
205
+ this.icon = "none";
206
+ }
207
+ static {
208
+ this.styles = [...ImpktElement.styles, css`
209
+ :host { display: inline-flex; }
210
+ span { display: inline-flex; align-items: center; gap: ${space(1)}; padding: ${space(1)} ${space(2)}; border-radius: 999px; font-size: ${fontSize("sm")}; font-weight: ${fontWeight("semibold")}; line-height: 1.2; background: ${t.surfaceInset}; color: ${t.text}; border: ${t.borderThin} solid transparent; }
211
+ :host([tone='brand']) span { background: ${t.brandSubtle}; color: ${t.brand}; }
212
+ :host([tone='success']) span { background: ${t.successSubtle}; color: ${t.successText}; }
213
+ :host([tone='warning']) span { background: ${t.warningSubtle}; color: ${t.warningText}; }
214
+ :host([tone='danger']) span { background: ${t.dangerSubtle}; color: ${t.dangerText}; }
215
+ :host([tone='info']) span { background: ${t.infoSubtle}; color: ${t.infoText}; }
216
+ @media (forced-colors: active) { span { border-color: CanvasText; } }
217
+ `];
218
+ }
219
+ render() {
220
+ return html`<span part="badge">${iconSvg(this.icon, "1em")}<slot></slot></span>`;
221
+ }
222
+ };
223
+ customElements.define("impkt-hero", ImpktHero);
224
+ customElements.define("impkt-feature-list", ImpktFeatureList);
225
+ customElements.define("impkt-quote", ImpktQuote);
226
+ customElements.define("impkt-stat", ImpktStat);
227
+ customElements.define("impkt-badge", ImpktBadge);
228
+
229
+ export {
230
+ ImpktHero,
231
+ ImpktFeatureList,
232
+ ImpktQuote,
233
+ ImpktStat,
234
+ ImpktBadge
235
+ };
236
+ //# sourceMappingURL=chunk-AXQ5YBN2.js.map