@atomic-ui/ui 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/README.md +13 -1
  2. package/dist/base/tokens.d.ts +23 -1
  3. package/dist/{chunk-CFGLOYWW.js → chunk-2YQA3VBY.js} +2 -2
  4. package/dist/{chunk-DR3SJ7ZV.js → chunk-4HU4Y23Q.js} +3 -3
  5. package/dist/{chunk-QH46SOPJ.js → chunk-5EA4IDUD.js} +54 -11
  6. package/dist/chunk-5EA4IDUD.js.map +1 -0
  7. package/dist/{chunk-3OSL2HMN.js → chunk-6ICOJPMD.js} +7 -5
  8. package/dist/chunk-6ICOJPMD.js.map +1 -0
  9. package/dist/{chunk-DI2CJ3MZ.js → chunk-7BIQ3K6H.js} +2 -2
  10. package/dist/{chunk-AXQ5YBN2.js → chunk-7Y6UCSUS.js} +135 -10
  11. package/dist/chunk-7Y6UCSUS.js.map +1 -0
  12. package/dist/{chunk-G6UVYMA6.js → chunk-BTGCUONV.js} +2 -2
  13. package/dist/{chunk-4JKUAA6K.js → chunk-C36CZRHK.js} +14 -5
  14. package/dist/chunk-C36CZRHK.js.map +1 -0
  15. package/dist/{chunk-ZDYTNFQI.js → chunk-CMAU4DSB.js} +15 -5
  16. package/dist/chunk-CMAU4DSB.js.map +1 -0
  17. package/dist/{chunk-HWNY6U5F.js → chunk-G6OVKNL7.js} +2 -2
  18. package/dist/{chunk-6UDDZQDK.js → chunk-GO2IBRFP.js} +3 -3
  19. package/dist/chunk-GO2IBRFP.js.map +1 -0
  20. package/dist/{chunk-KWURASAB.js → chunk-GSCVG2ER.js} +3 -3
  21. package/dist/{chunk-IBTOZOGI.js → chunk-HWWA27DN.js} +2 -2
  22. package/dist/{chunk-U2S7OESF.js → chunk-MLVUMCQ2.js} +45 -13
  23. package/dist/chunk-MLVUMCQ2.js.map +1 -0
  24. package/dist/{chunk-4AJPS5AU.js → chunk-MOEMFL4K.js} +15 -5
  25. package/dist/chunk-MOEMFL4K.js.map +1 -0
  26. package/dist/{chunk-5RVMMKMO.js → chunk-NQKYHILD.js} +3 -3
  27. package/dist/{chunk-5NUF7ZQA.js → chunk-NTNXHLTM.js} +24 -3
  28. package/dist/chunk-NTNXHLTM.js.map +1 -0
  29. package/dist/{chunk-OFAVRPRK.js → chunk-OB7LC6NJ.js} +2 -2
  30. package/dist/chunk-OB7LC6NJ.js.map +1 -0
  31. package/dist/chunk-QCNT7D5V.js +549 -0
  32. package/dist/chunk-QCNT7D5V.js.map +1 -0
  33. package/dist/{chunk-H6L3FSQY.js → chunk-QDNI54ON.js} +3 -3
  34. package/dist/{chunk-QELX47AP.js → chunk-T6L3USBZ.js} +31 -20
  35. package/dist/chunk-T6L3USBZ.js.map +1 -0
  36. package/dist/{chunk-TZD7IVVQ.js → chunk-TPF4MOMF.js} +8 -3
  37. package/dist/chunk-TPF4MOMF.js.map +1 -0
  38. package/dist/{chunk-S3EQO33M.js → chunk-VTFCTWSX.js} +6 -4
  39. package/dist/chunk-VTFCTWSX.js.map +1 -0
  40. package/dist/{chunk-2RBYVWZT.js → chunk-VWNBB7FW.js} +5 -3
  41. package/dist/chunk-VWNBB7FW.js.map +1 -0
  42. package/dist/{chunk-6GKI67P7.js → chunk-WECSVHIM.js} +2 -2
  43. package/dist/chunk-X7IPZPTG.js +710 -0
  44. package/dist/chunk-X7IPZPTG.js.map +1 -0
  45. package/dist/{chunk-57P4WO4Y.js → chunk-XJP45LFA.js} +28 -21
  46. package/dist/chunk-XJP45LFA.js.map +1 -0
  47. package/dist/{chunk-6MLXFFH4.js → chunk-XVKEM5JY.js} +3 -3
  48. package/dist/chunk-XVKEM5JY.js.map +1 -0
  49. package/dist/chunk-ZBLTU67D.js +424 -0
  50. package/dist/chunk-ZBLTU67D.js.map +1 -0
  51. package/dist/{chunk-JPEWRJSQ.js → chunk-ZGAOMRYD.js} +3 -3
  52. package/dist/{chunk-LLRJU7XE.js → chunk-ZQJD4YEJ.js} +6 -6
  53. package/dist/chunk-ZQJD4YEJ.js.map +1 -0
  54. package/dist/components/accordion.js +2 -2
  55. package/dist/components/alert.js +2 -2
  56. package/dist/components/app-ui.d.ts +421 -0
  57. package/dist/components/app-ui.js +26 -0
  58. package/dist/components/app-ui.js.map +1 -0
  59. package/dist/components/blocks.d.ts +2 -2
  60. package/dist/components/blocks.js +3 -3
  61. package/dist/components/button.d.ts +7 -0
  62. package/dist/components/button.js +3 -3
  63. package/dist/components/checkbox-group.js +3 -3
  64. package/dist/components/checkbox.js +3 -3
  65. package/dist/components/date-input.js +3 -3
  66. package/dist/components/dialog.js +2 -2
  67. package/dist/components/fieldset.js +2 -2
  68. package/dist/components/grid.d.ts +2 -2
  69. package/dist/components/grid.js +2 -2
  70. package/dist/components/help.js +2 -2
  71. package/dist/components/icon.js +2 -2
  72. package/dist/components/layout.d.ts +10 -5
  73. package/dist/components/layout.js +2 -2
  74. package/dist/components/link.js +3 -3
  75. package/dist/components/marketing.d.ts +119 -6
  76. package/dist/components/marketing.js +7 -3
  77. package/dist/components/media.js +2 -2
  78. package/dist/components/navigation.d.ts +9 -2
  79. package/dist/components/navigation.js +3 -3
  80. package/dist/components/organisms.d.ts +547 -0
  81. package/dist/components/organisms.js +25 -0
  82. package/dist/components/organisms.js.map +1 -0
  83. package/dist/components/page.d.ts +14 -3
  84. package/dist/components/page.js +2 -2
  85. package/dist/components/price.d.ts +5 -0
  86. package/dist/components/price.js +2 -2
  87. package/dist/components/progress.js +2 -2
  88. package/dist/components/property.d.ts +389 -0
  89. package/dist/components/property.js +19 -0
  90. package/dist/components/property.js.map +1 -0
  91. package/dist/components/radio-group.js +3 -3
  92. package/dist/components/select.js +3 -3
  93. package/dist/components/summary-list.js +2 -2
  94. package/dist/components/table.js +2 -2
  95. package/dist/components/text-input.js +3 -3
  96. package/dist/components/textarea.js +3 -3
  97. package/dist/index.d.ts +4 -1
  98. package/dist/index.js +94 -40
  99. package/package.json +2 -2
  100. package/dist/chunk-2RBYVWZT.js.map +0 -1
  101. package/dist/chunk-3OSL2HMN.js.map +0 -1
  102. package/dist/chunk-4AJPS5AU.js.map +0 -1
  103. package/dist/chunk-4JKUAA6K.js.map +0 -1
  104. package/dist/chunk-57P4WO4Y.js.map +0 -1
  105. package/dist/chunk-5NUF7ZQA.js.map +0 -1
  106. package/dist/chunk-6MLXFFH4.js.map +0 -1
  107. package/dist/chunk-6UDDZQDK.js.map +0 -1
  108. package/dist/chunk-AXQ5YBN2.js.map +0 -1
  109. package/dist/chunk-LLRJU7XE.js.map +0 -1
  110. package/dist/chunk-OFAVRPRK.js.map +0 -1
  111. package/dist/chunk-QELX47AP.js.map +0 -1
  112. package/dist/chunk-QH46SOPJ.js.map +0 -1
  113. package/dist/chunk-S3EQO33M.js.map +0 -1
  114. package/dist/chunk-TZD7IVVQ.js.map +0 -1
  115. package/dist/chunk-U2S7OESF.js.map +0 -1
  116. package/dist/chunk-ZDYTNFQI.js.map +0 -1
  117. /package/dist/{chunk-CFGLOYWW.js.map → chunk-2YQA3VBY.js.map} +0 -0
  118. /package/dist/{chunk-DR3SJ7ZV.js.map → chunk-4HU4Y23Q.js.map} +0 -0
  119. /package/dist/{chunk-DI2CJ3MZ.js.map → chunk-7BIQ3K6H.js.map} +0 -0
  120. /package/dist/{chunk-G6UVYMA6.js.map → chunk-BTGCUONV.js.map} +0 -0
  121. /package/dist/{chunk-HWNY6U5F.js.map → chunk-G6OVKNL7.js.map} +0 -0
  122. /package/dist/{chunk-KWURASAB.js.map → chunk-GSCVG2ER.js.map} +0 -0
  123. /package/dist/{chunk-IBTOZOGI.js.map → chunk-HWWA27DN.js.map} +0 -0
  124. /package/dist/{chunk-5RVMMKMO.js.map → chunk-NQKYHILD.js.map} +0 -0
  125. /package/dist/{chunk-H6L3FSQY.js.map → chunk-QDNI54ON.js.map} +0 -0
  126. /package/dist/{chunk-6GKI67P7.js.map → chunk-WECSVHIM.js.map} +0 -0
  127. /package/dist/{chunk-JPEWRJSQ.js.map → chunk-ZGAOMRYD.js.map} +0 -0
@@ -0,0 +1 @@
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\n radiusXs: token('radius.xs', '2px'),\n radiusXl: token('radius.xl', '12px'),\n radius2xl: token('radius.2xl', '16px'),\n\n /** Hairline borders and rings, from the text colour, so they suit any surface. */\n hairline: unsafeCSS('color-mix(in srgb, var(--impkt-color-text-default, #1a1a1a) 10%, transparent)'),\n rule: unsafeCSS('color-mix(in srgb, var(--impkt-color-text-default, #1a1a1a) 15%, transparent)'),\n /** A wash of the text colour, for hover and pressed states on quiet controls. */\n wash: unsafeCSS('color-mix(in srgb, var(--impkt-color-text-default, #1a1a1a) 5%, transparent)'),\n /** The brand at a fifth, for focus halos round fields. */\n brandHalo: unsafeCSS('color-mix(in srgb, var(--impkt-color-brand-default, #1f4ed8) 22%, transparent)'),\n\n shadowXs: token('shadow.xs', '0 1px 2px 0 rgb(0 0 0 / 0.05)'),\n shadowSm: token('shadow.sm', '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)'),\n shadowMd: token('shadow.md', '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)'),\n shadowLg: token('shadow.lg', '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)'),\n shadowXl: token('shadow.xl', '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)'),\n\n trackingTight: token('font.tracking.tight', '-0.02em'),\n trackingWide: token('font.tracking.wide', '0.06em'),\n} as const;\n\n/**\n * A size on the type scale with its own line height, so text drawn at\n * `type('xl')` has the leading that size reads best at.\n */\nexport const type = (name: string): CSSResult =>\n unsafeCSS(`font-size: var(--impkt-font-size-${name}, 1rem); line-height: var(--impkt-font-leading-${name}, 1.5);`);\n\n/** `space(3)` → `space.3`, `space(0.5)` → `space.0-5`. Spacing is always a token, never a number. */\nexport const space = (step: number): CSSResult => token(`space.${String(step).replace('.', '-')}`, `${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-above='2xl']) { margin-block-start: clamp(${space(14)}, 8vw, ${space(28)}); }\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 :host([space-below='2xl']) { margin-block-end: clamp(${space(14)}, 8vw, ${space(28)}); }\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":"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","names":["css","css","css","css"]}
@@ -2,7 +2,7 @@ import {
2
2
  ImpktElement,
3
3
  spaceAround,
4
4
  token
5
- } from "./chunk-5NUF7ZQA.js";
5
+ } from "./chunk-NTNXHLTM.js";
6
6
 
7
7
  // packages/ui/src/components/grid.ts
8
8
  import { css, html } from "lit";
@@ -71,4 +71,4 @@ customElements.define("impkt-grid", ImpktGrid);
71
71
  export {
72
72
  ImpktGrid
73
73
  };
74
- //# sourceMappingURL=chunk-OFAVRPRK.js.map
74
+ //# sourceMappingURL=chunk-OB7LC6NJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/grid.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { spaceAround, token } from '../base/tokens';\n\n/** Column widths as fractions, for each choice of `widths`. */\nconst WIDTHS: Record<string, string> = {\n '2:1': '2fr 1fr', '1:2': '1fr 2fr', '3:1': '3fr 1fr', '1:3': '1fr 3fr',\n '1:2:1': '1fr 2fr 1fr', '2:1:1': '2fr 1fr 1fr', '1:1:2': '1fr 1fr 2fr',\n};\n\n/**\n * A responsive row with named column slots. Child order stays inside each\n * column; changing a page's visual grid never reorders its reading sequence.\n *\n * Gutters come from the brand's layout, so every grid for a partner keeps the\n * same rhythm. Where the columns stack is a choice, because a three-column\n * row of cards may work on a tablet where two columns of long text do not.\n *\n * @category layout\n * @icon columns\n * @slot column-1 - First column.\n * @slot column-2 - Second column.\n * @slot column-3 - Third column.\n * @slot column-4 - Fourth column.\n */\nexport class ImpktGrid extends ImpktElement {\n static properties = {\n columns: { type: String, reflect: true },\n widths: { type: String, reflect: true },\n gap: { type: String, reflect: true },\n stackOn: { type: String, reflect: true, attribute: 'stack-on' },\n align: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare columns: 'one' | 'two' | 'three' | 'four' | 'sidebar-left' | 'sidebar-right';\n /** How wide each column is against the others. Applies when it has as many parts as there are columns. */\n declare widths: 'equal' | '2:1' | '1:2' | '3:1' | '1:3' | '1:2:1' | '2:1:1' | '1:1:2';\n /** The space between columns, from the brand's gutters. */\n declare gap: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n /** The screens on which the columns stack, one above another, in column order. */\n declare stackOn: 'phone' | 'tablet' | 'never';\n /** How columns of different heights line up. */\n declare align: 'stretch' | 'start' | 'center' | 'end';\n /** Space before the grid, from the spacing scale. */\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n /** Space after the grid, from the spacing scale. */\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n constructor() {\n super();\n this.columns = 'two';\n this.widths = 'equal';\n this.gap = 'md';\n this.stackOn = 'phone';\n this.align = 'stretch';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n static styles = [...ImpktElement.styles, spaceAround, css`\n :host { display: block; min-inline-size: 0; container-type: inline-size; }\n .columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${token('layout.gutter.md', '16px')}; align-items: stretch; }\n :host([gap='none']) .columns { gap: 0; }\n :host([gap='sm']) .columns { gap: ${token('layout.gutter.sm', '8px')}; }\n :host([gap='lg']) .columns { gap: ${token('layout.gutter.lg', '32px')}; }\n :host([gap='xl']) .columns { gap: ${token('layout.gutter.xl', '48px')}; }\n :host([align='start']) .columns { align-items: start; }\n :host([align='center']) .columns { align-items: center; }\n :host([align='end']) .columns { align-items: end; }\n :host([columns='one']) .columns { grid-template-columns: minmax(0, 1fr); }\n :host([columns='three']) .columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n :host([columns='four']) .columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }\n :host([columns='sidebar-left']) .columns { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }\n :host([columns='sidebar-right']) .columns { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }\n .column { min-inline-size: 0; overflow-wrap: anywhere; }\n ::slotted(*) { max-inline-size: 100%; }\n @container (max-width: 40rem) { :host(:not([stack-on='never'])) .columns { grid-template-columns: minmax(0, 1fr) !important; } }\n @container (max-width: 64rem) { :host([stack-on='tablet']) .columns { grid-template-columns: minmax(0, 1fr) !important; } }\n `];\n render() {\n const count = this.columns === 'one' ? 1 : this.columns === 'three' ? 3 : this.columns === 'four' ? 4 : 2;\n const fractions = WIDTHS[this.widths]?.split(' ');\n // A width split for a different number of columns would leave a column out, so it is ignored.\n const template = fractions && fractions.length === count ? fractions.map((f) => `minmax(0, ${f})`).join(' ') : '';\n return html`<div class=\"columns\" part=\"row\" style=${template ? `grid-template-columns: ${template}` : ''}>${Array.from({ length: count }, (_, i) => html`<div class=\"column\" part=\"column\"><slot name=${`column-${i + 1}`}></slot></div>`)}</div>`;\n }\n}\ncustomElements.define('impkt-grid', ImpktGrid);\ndeclare global { interface HTMLElementTagNameMap { 'impkt-grid': ImpktGrid } }\n"],"mappings":";;;;;;;AAAA,SAAS,KAAK,YAAY;AAK1B,IAAM,SAAiC;AAAA,EACrC,OAAO;AAAA,EAAW,OAAO;AAAA,EAAW,OAAO;AAAA,EAAW,OAAO;AAAA,EAC7D,SAAS;AAAA,EAAe,SAAS;AAAA,EAAe,SAAS;AAC3D;AAiBO,IAAM,YAAN,cAAwB,aAAa;AAAA,EAC1C;AAAA,SAAO,aAAa;AAAA,MAClB,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACvC,QAAQ,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACtC,KAAK,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACnC,SAAS,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,WAAW;AAAA,MAC9D,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,YAAY,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,cAAc;AAAA,MACpE,YAAY,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,cAAc;AAAA,IACtE;AAAA;AAAA,EAcA,cAAc;AACZ,UAAM;AACN,SAAK,UAAU;AACf,SAAK,SAAS;AACd,SAAK,MAAM;AACX,SAAK,UAAU;AACf,SAAK,QAAQ;AACb,SAAK,aAAa;AAClB,SAAK,aAAa;AAAA,EACpB;AAAA,EACA;AAAA,SAAO,SAAS,CAAC,GAAG,aAAa,QAAQ,aAAa;AAAA;AAAA,uFAE+B,MAAM,oBAAoB,MAAM,CAAC;AAAA;AAAA,wCAEhF,MAAM,oBAAoB,KAAK,CAAC;AAAA,wCAChC,MAAM,oBAAoB,MAAM,CAAC;AAAA,wCACjC,MAAM,oBAAoB,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAatE;AAAA;AAAA,EACD,SAAS;AACP,UAAM,QAAQ,KAAK,YAAY,QAAQ,IAAI,KAAK,YAAY,UAAU,IAAI,KAAK,YAAY,SAAS,IAAI;AACxG,UAAM,YAAY,OAAO,KAAK,MAAM,GAAG,MAAM,GAAG;AAEhD,UAAM,WAAW,aAAa,UAAU,WAAW,QAAQ,UAAU,IAAI,CAAC,MAAM,aAAa,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI;AAC/G,WAAO,6CAA6C,WAAW,0BAA0B,QAAQ,KAAK,EAAE,IAAI,MAAM,KAAK,EAAE,QAAQ,MAAM,GAAG,CAAC,GAAG,MAAM,oDAAoD,UAAU,IAAI,CAAC,EAAE,gBAAgB,CAAC;AAAA,EAC5O;AACF;AACA,eAAe,OAAO,cAAc,SAAS;","names":[]}
@@ -0,0 +1,549 @@
1
+ import {
2
+ iconSvg
3
+ } from "./chunk-2YQA3VBY.js";
4
+ import {
5
+ FieldElement
6
+ } from "./chunk-7BIQ3K6H.js";
7
+ import {
8
+ ImpktElement,
9
+ focusRing,
10
+ fontWeight,
11
+ space,
12
+ spaceAround,
13
+ t,
14
+ targetSize,
15
+ type,
16
+ visuallyHidden
17
+ } from "./chunk-NTNXHLTM.js";
18
+
19
+ // packages/ui/src/components/app-ui.ts
20
+ import { css, html, nothing } from "lit";
21
+ var ImpktDrawer = class extends ImpktElement {
22
+ constructor() {
23
+ super();
24
+ this.hasFooter = false;
25
+ this.open = false;
26
+ this.heading = "";
27
+ this.side = "right";
28
+ this.closeLabel = "Close";
29
+ }
30
+ static {
31
+ this.properties = {
32
+ open: { type: Boolean, reflect: true },
33
+ heading: { type: String },
34
+ side: { type: String, reflect: true },
35
+ closeLabel: { type: String, attribute: "close-label" }
36
+ };
37
+ }
38
+ static {
39
+ this.styles = [...ImpktElement.styles, focusRing, css`
40
+ dialog { box-sizing: border-box; display: none; flex-direction: column; inline-size: min(28rem, 100vw); max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; color: ${t.text}; background: ${t.surfaceCard}; box-shadow: ${t.shadowXl}; animation: from-right 240ms cubic-bezier(0.16, 1, 0.3, 1); }
41
+ dialog[open] { display: flex; }
42
+ :host([side='left']) dialog { margin: 0 auto 0 0; animation-name: from-left; }
43
+ dialog::backdrop { background: color-mix(in srgb, ${t.text} 30%, transparent); backdrop-filter: blur(2px); }
44
+ @keyframes from-right { from { transform: translateX(100%); } }
45
+ @keyframes from-left { from { transform: translateX(-100%); } }
46
+ .head { display: flex; align-items: center; justify-content: space-between; gap: ${space(3)}; padding: ${space(4)} ${space(5)}; box-shadow: 0 1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }
47
+ h2 { margin: 0; font-family: ${t.fontHeading}; ${type("xl")} font-weight: ${fontWeight("bold")}; color: ${t.textHeading}; }
48
+ .close { ${targetSize} display: inline-flex; align-items: center; justify-content: center; padding: 0; color: ${t.text}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }
49
+ .close:hover { background: ${t.surfaceSubtle}; }
50
+ .body { flex: 1; overflow: auto; padding: ${space(5)}; }
51
+ .foot { display: flex; gap: ${space(3)}; justify-content: flex-end; padding: ${space(4)} ${space(5)}; box-shadow: 0 -1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }
52
+ .foot[hidden] { display: none; }
53
+ `];
54
+ }
55
+ get dialog() {
56
+ return this.renderRoot.querySelector("dialog");
57
+ }
58
+ updated(changed) {
59
+ if (!changed.has("open")) return;
60
+ const dialog = this.dialog;
61
+ if (!dialog) return;
62
+ if (this.open) {
63
+ if (typeof dialog.showModal === "function") dialog.showModal();
64
+ else dialog.setAttribute("open", "");
65
+ } else if (typeof dialog.close === "function" && dialog.open) dialog.close();
66
+ else dialog.removeAttribute("open");
67
+ }
68
+ close() {
69
+ this.open = false;
70
+ this.dispatchEvent(new CustomEvent("impkt-close", { bubbles: true, composed: true }));
71
+ }
72
+ footerChanged(event) {
73
+ this.hasFooter = event.target.assignedNodes().length > 0;
74
+ this.requestUpdate();
75
+ }
76
+ render() {
77
+ return html`<dialog part="dialog" aria-labelledby=${this.heading ? this.id_("heading") : nothing}
78
+ @cancel=${() => this.close()}
79
+ @close=${() => {
80
+ if (this.open) this.close();
81
+ }}
82
+ @click=${(event) => {
83
+ if (event.target === this.dialog) this.close();
84
+ }}>
85
+ <div class="head">
86
+ ${this.heading ? html`<h2 id=${this.id_("heading")}>${this.heading}</h2>` : html`<span></span>`}
87
+ <button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${iconSvg("close", "20px")}</button>
88
+ </div>
89
+ <div class="body" part="body"><slot></slot></div>
90
+ <div class="foot" part="footer" ?hidden=${!this.hasFooter}><slot name="footer" @slotchange=${this.footerChanged}></slot></div>
91
+ </dialog>`;
92
+ }
93
+ };
94
+ var TOAST_ICON = { neutral: "info", success: "check", warning: "warning", danger: "warning" };
95
+ var ImpktToast = class extends ImpktElement {
96
+ static {
97
+ this.properties = {
98
+ open: { type: Boolean, reflect: true },
99
+ message: { type: String },
100
+ tone: { type: String, reflect: true },
101
+ duration: { type: Number },
102
+ actionText: { type: String, attribute: "action-text" },
103
+ closeLabel: { type: String, attribute: "close-label" }
104
+ };
105
+ }
106
+ constructor() {
107
+ super();
108
+ this.open = false;
109
+ this.message = "";
110
+ this.tone = "neutral";
111
+ this.duration = 6;
112
+ this.actionText = "";
113
+ this.closeLabel = "Dismiss";
114
+ }
115
+ static {
116
+ this.styles = [...ImpktElement.styles, focusRing, css`
117
+ .region { position: fixed; inset-block-end: calc(${space(4)} + var(--impkt-bottom-bar, 0px)); inset-inline-end: ${space(4)}; z-index: 1000; inline-size: min(24rem, calc(100vw - ${space(8)})); }
118
+ .toast { display: flex; align-items: flex-start; gap: ${space(3)}; padding: ${space(3)} ${space(3)} ${space(3)} ${space(4)}; color: ${t.text}; background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowXl}, 0 0 0 1px color-mix(in srgb, ${t.text} 8%, transparent); animation: rise 220ms cubic-bezier(0.16, 1, 0.3, 1); }
119
+ @keyframes rise { from { opacity: 0; transform: translateY(${space(3)}); } }
120
+ .mark { display: inline-flex; flex: none; margin-block-start: ${space(0.5)}; color: ${t.info}; }
121
+ :host([tone='success']) .mark { color: ${t.success}; }
122
+ :host([tone='warning']) .mark { color: ${t.warning}; }
123
+ :host([tone='danger']) .mark { color: ${t.danger}; }
124
+ .message { flex: 1; align-self: center; margin: 0; ${type("sm")} font-weight: ${fontWeight("medium")}; }
125
+ .action, .close { ${targetSize} padding: 0 ${space(2)}; font: inherit; ${type("sm")} font-weight: ${fontWeight("semibold")}; color: ${t.link}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }
126
+ .close { display: inline-flex; align-items: center; justify-content: center; color: ${t.textMuted}; }
127
+ .action:hover, .close:hover { background: ${t.surfaceSubtle}; }
128
+ `];
129
+ }
130
+ disconnectedCallback() {
131
+ super.disconnectedCallback();
132
+ this.stop();
133
+ }
134
+ updated(changed) {
135
+ if (changed.has("open") || changed.has("duration")) {
136
+ this.stop();
137
+ if (this.open) this.start();
138
+ }
139
+ }
140
+ start() {
141
+ if (this.duration > 0) this.timer = setTimeout(() => this.close(), this.duration * 1e3);
142
+ }
143
+ stop() {
144
+ if (this.timer) clearTimeout(this.timer);
145
+ this.timer = void 0;
146
+ }
147
+ close() {
148
+ this.stop();
149
+ if (!this.open) return;
150
+ this.open = false;
151
+ this.dispatchEvent(new CustomEvent("impkt-close", { bubbles: true, composed: true }));
152
+ }
153
+ action() {
154
+ this.dispatchEvent(new CustomEvent("impkt-action", { bubbles: true, composed: true }));
155
+ this.close();
156
+ }
157
+ render() {
158
+ return html`<div class="region" role="status" aria-live="polite">
159
+ ${this.open ? html`<div class="toast" part="toast" @mouseenter=${this.stop} @mouseleave=${this.start} @focusin=${this.stop} @focusout=${this.start}>
160
+ <span class="mark">${iconSvg(TOAST_ICON[this.tone] ?? "info", "20px")}</span>
161
+ <p class="message">${this.message}</p>
162
+ ${this.actionText ? html`<button class="action" type="button" @click=${this.action}>${this.actionText}</button>` : nothing}
163
+ <button class="close" type="button" aria-label=${this.closeLabel} @click=${this.close}>${iconSvg("close", "16px")}</button>
164
+ </div>` : nothing}
165
+ </div>`;
166
+ }
167
+ };
168
+ var ImpktMenu = class extends ImpktElement {
169
+ constructor() {
170
+ super();
171
+ this.outside = (event) => {
172
+ if (!event.composedPath().includes(this)) this.toggle(false);
173
+ };
174
+ this.label = "Menu";
175
+ this.icon = "";
176
+ this.items = [];
177
+ this.edge = "start";
178
+ this.open = false;
179
+ }
180
+ static {
181
+ this.properties = {
182
+ label: { type: String },
183
+ icon: { type: String },
184
+ items: { type: Array },
185
+ edge: { type: String, reflect: true },
186
+ open: { type: Boolean, reflect: true }
187
+ };
188
+ }
189
+ static {
190
+ this.styles = [...ImpktElement.styles, focusRing, css`
191
+ :host { position: relative; display: inline-block; }
192
+ .trigger { ${targetSize} display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(2)} ${space(3.5)}; font: inherit; ${type("sm")} font-weight: ${fontWeight("semibold")}; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: ${t.shadowXs}; cursor: pointer; }
193
+ .trigger:hover { background: ${t.surfaceSubtle}; }
194
+ .chev { display: inline-flex; color: ${t.textMuted}; transition: transform 120ms ease-in-out; }
195
+ :host([open]) .chev { transform: rotate(180deg); }
196
+ .list { position: absolute; z-index: 100; inset-block-start: calc(100% + ${space(1.5)}); inset-inline-start: 0; box-sizing: border-box; min-inline-size: 13rem; max-inline-size: min(20rem, 90vw); margin: 0; padding: ${space(1.5)}; list-style: none; background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowLg}, 0 0 0 1px color-mix(in srgb, ${t.text} 8%, transparent); animation: pop 120ms ease-out; }
197
+ :host([edge='end']) .list { inset-inline: auto 0; }
198
+ @keyframes pop { from { opacity: 0; transform: translateY(-${space(1)}); } }
199
+ .item { ${targetSize} box-sizing: border-box; display: flex; align-items: center; gap: ${space(2.5)}; inline-size: 100%; padding: ${space(2)} ${space(2.5)}; font: inherit; ${type("sm")} text-align: start; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }
200
+ .item:hover, .item:focus { background: ${t.surfaceSubtle}; }
201
+ .item.danger { color: ${t.dangerText}; }
202
+ .item svg { flex: none; }
203
+ `];
204
+ }
205
+ disconnectedCallback() {
206
+ super.disconnectedCallback();
207
+ document.removeEventListener("click", this.outside);
208
+ }
209
+ get entries() {
210
+ return Array.from(this.renderRoot.querySelectorAll(".item"));
211
+ }
212
+ get trigger() {
213
+ return this.renderRoot.querySelector(".trigger");
214
+ }
215
+ toggle(open, focus) {
216
+ this.open = open;
217
+ if (open) {
218
+ document.addEventListener("click", this.outside);
219
+ void this.updateComplete.then(() => this.entries[focus === "last" ? this.entries.length - 1 : 0]?.focus());
220
+ } else document.removeEventListener("click", this.outside);
221
+ }
222
+ triggerKey(event) {
223
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
224
+ event.preventDefault();
225
+ this.toggle(true, event.key === "ArrowUp" ? "last" : "first");
226
+ }
227
+ }
228
+ listKey(event) {
229
+ const entries = this.entries;
230
+ const at = entries.indexOf(this.renderRoot.activeElement);
231
+ const go = { ArrowDown: (at + 1) % entries.length, ArrowUp: (at - 1 + entries.length) % entries.length, Home: 0, End: entries.length - 1 };
232
+ if (event.key in go) {
233
+ event.preventDefault();
234
+ entries[go[event.key]]?.focus();
235
+ } else if (event.key === "Escape") {
236
+ event.preventDefault();
237
+ this.toggle(false);
238
+ this.trigger?.focus();
239
+ } else if (event.key === "Tab") this.toggle(false);
240
+ }
241
+ choose(item) {
242
+ this.toggle(false);
243
+ this.trigger?.focus();
244
+ if (!item.href) this.dispatchEvent(new CustomEvent("impkt-select", { detail: { value: item.value ?? item.text }, bubbles: true, composed: true }));
245
+ }
246
+ render() {
247
+ const inner = (item) => html`${iconSvg(item.icon, "18px")}<span>${item.text}</span>`;
248
+ return html`<button class="trigger" part="trigger" type="button" aria-haspopup="menu" aria-expanded=${String(this.open)} aria-controls=${this.id_("list")}
249
+ @click=${() => this.toggle(!this.open)} @keydown=${this.triggerKey}>${iconSvg(this.icon, "18px")}${this.label}<span class="chev">${iconSvg("chevron-down", "16px")}</span></button>
250
+ ${this.open ? html`<ul class="list" part="list" id=${this.id_("list")} role="menu" aria-label=${this.label} @keydown=${this.listKey}>
251
+ ${this.items.map((item) => html`<li role="none">${item.href ? html`<a class="item ${item.tone === "danger" ? "danger" : ""}" role="menuitem" tabindex="-1" href=${item.href} @click=${() => this.choose(item)}>${inner(item)}</a>` : html`<button class="item ${item.tone === "danger" ? "danger" : ""}" role="menuitem" tabindex="-1" type="button" @click=${() => this.choose(item)}>${inner(item)}</button>`}</li>`)}
252
+ </ul>` : nothing}`;
253
+ }
254
+ };
255
+ function pageWindow(page, pages) {
256
+ const wanted = [.../* @__PURE__ */ new Set([1, page - 1, page, page + 1, pages])].filter((n) => n >= 1 && n <= pages).sort((a, b) => a - b);
257
+ return wanted.flatMap((n, i) => {
258
+ const previous = wanted[i - 1];
259
+ if (previous === void 0 || n === previous + 1) return [n];
260
+ return n === previous + 2 ? [previous + 1, n] : ["gap", n];
261
+ });
262
+ }
263
+ var ImpktPagination = class extends ImpktElement {
264
+ static {
265
+ this.properties = {
266
+ page: { type: Number },
267
+ pages: { type: Number },
268
+ hrefPattern: { type: String, attribute: "href-pattern" },
269
+ label: { type: String },
270
+ previousText: { type: String, attribute: "previous-text" },
271
+ nextText: { type: String, attribute: "next-text" }
272
+ };
273
+ }
274
+ constructor() {
275
+ super();
276
+ this.page = 1;
277
+ this.pages = 1;
278
+ this.hrefPattern = "";
279
+ this.label = "Pages";
280
+ this.previousText = "Previous";
281
+ this.nextText = "Next";
282
+ }
283
+ static {
284
+ this.styles = [...ImpktElement.styles, focusRing, css`
285
+ :host { display: block; container-type: inline-size; }
286
+ nav { display: flex; align-items: center; justify-content: space-between; gap: ${space(2)}; }
287
+ ul { display: flex; align-items: center; gap: ${space(1)}; margin: 0; padding: 0; list-style: none; }
288
+ .n, .step { ${targetSize} box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: ${space(1.5)}; min-inline-size: 44px; padding: 0 ${space(2.5)}; font: inherit; ${type("sm")} font-weight: ${fontWeight("medium")}; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }
289
+ .n:hover, .step:hover { background: ${t.surfaceSubtle}; }
290
+ .n[aria-current] { color: ${t.onBrand}; background: ${t.brand}; font-weight: ${fontWeight("semibold")}; }
291
+ .step[aria-disabled='true'] { color: ${t.textMuted}; opacity: 0.55; background: none; cursor: not-allowed; }
292
+ .gap { color: ${t.textMuted}; padding: 0 ${space(1)}; }
293
+ .count { display: none; ${type("sm")} color: ${t.textMuted}; }
294
+ @container (max-width: 34rem) { ul { display: none; } .count { display: block; } }
295
+ `];
296
+ }
297
+ go(page, event) {
298
+ if (this.hrefPattern) return;
299
+ event.preventDefault();
300
+ this.page = page;
301
+ this.dispatchEvent(new CustomEvent("impkt-page", { detail: { page }, bubbles: true, composed: true }));
302
+ }
303
+ link(page, classes, content, label, current) {
304
+ return this.hrefPattern ? html`<a class=${classes} href=${this.hrefPattern.replace("{page}", String(page))} aria-label=${label} aria-current=${current ? "page" : nothing}>${content}</a>` : html`<button class=${classes} type="button" aria-label=${label} aria-current=${current ? "page" : nothing} @click=${(e) => this.go(page, e)}>${content}</button>`;
305
+ }
306
+ step(to, words, icon, off) {
307
+ const content = icon === "arrow-left" ? html`${iconSvg(icon, "16px")}${words}` : html`${words}${iconSvg(icon, "16px")}`;
308
+ return off ? html`<span class="step" aria-disabled="true">${content}</span>` : this.link(to, "step", content, words, false);
309
+ }
310
+ render() {
311
+ const page = Math.min(Math.max(this.page, 1), Math.max(this.pages, 1));
312
+ return html`<nav aria-label=${this.label} part="nav">
313
+ ${this.step(page - 1, this.previousText, "arrow-left", page <= 1)}
314
+ <ul>${pageWindow(page, this.pages).map((n) => html`<li>${n === "gap" ? html`<span class="gap" aria-hidden="true">…</span>` : this.link(n, "n", n, `Page ${n}`, n === page)}</li>`)}</ul>
315
+ <span class="count">Page ${page} of ${this.pages}</span>
316
+ ${this.step(page + 1, this.nextText, "arrow-right", page >= this.pages)}
317
+ </nav>`;
318
+ }
319
+ };
320
+ var initialsOf = (name) => {
321
+ const words = name.trim().split(/\s+/).filter(Boolean);
322
+ return ((words[0]?.[0] ?? "") + (words.length > 1 ? words[words.length - 1][0] : "")).toUpperCase();
323
+ };
324
+ var ImpktAvatar = class extends ImpktElement {
325
+ constructor() {
326
+ super();
327
+ this.failed = false;
328
+ this.fullName = "";
329
+ this.src = "";
330
+ this.size = "md";
331
+ }
332
+ static {
333
+ this.properties = {
334
+ fullName: { type: String, attribute: "full-name" },
335
+ src: { type: String },
336
+ size: { type: String, reflect: true }
337
+ };
338
+ }
339
+ static {
340
+ this.styles = [...ImpktElement.styles, css`
341
+ :host { --size: 40px; display: inline-block; inline-size: var(--size); block-size: var(--size); vertical-align: middle; }
342
+ :host([size='sm']) { --size: 32px; }
343
+ :host([size='lg']) { --size: 56px; }
344
+ :host([size='xl']) { --size: 80px; }
345
+ .face { display: flex; align-items: center; justify-content: center; inline-size: 100%; block-size: 100%; overflow: hidden; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; font-size: calc(var(--size) * 0.38); font-weight: ${fontWeight("semibold")}; }
346
+ img { inline-size: 100%; block-size: 100%; object-fit: cover; }
347
+ `];
348
+ }
349
+ willUpdate(changed) {
350
+ if (changed.has("src")) this.failed = false;
351
+ }
352
+ render() {
353
+ if (this.src && !this.failed) {
354
+ return html`<div class="face"><img src=${this.src} alt=${this.fullName} @error=${() => {
355
+ this.failed = true;
356
+ this.requestUpdate();
357
+ }} /></div>`;
358
+ }
359
+ return html`<div class="face" role="img" aria-label=${this.fullName || "Person"}>${initialsOf(this.fullName) || iconSvg("user", "55%")}</div>`;
360
+ }
361
+ };
362
+ var ImpktAvatarGroup = class extends ImpktElement {
363
+ static {
364
+ this.properties = {
365
+ items: { type: Array },
366
+ max: { type: Number },
367
+ size: { type: String, reflect: true },
368
+ moreLabel: { type: String, attribute: "more-label" }
369
+ };
370
+ }
371
+ constructor() {
372
+ super();
373
+ this.items = [];
374
+ this.max = 4;
375
+ this.size = "md";
376
+ this.moreLabel = "more people";
377
+ }
378
+ static {
379
+ this.styles = [...ImpktElement.styles, css`
380
+ ul { display: flex; margin: 0; padding: 0; list-style: none; }
381
+ li { margin-inline-start: -${space(2.5)}; border-radius: 50%; box-shadow: 0 0 0 2px ${t.surfaceCard}; line-height: 0; }
382
+ li:first-child { margin-inline-start: 0; }
383
+ .more { display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; ${type("xs")} line-height: 1; font-weight: ${fontWeight("semibold")}; color: ${t.text}; background: ${t.surfaceSubtle}; border-radius: 50%; }
384
+ :host([size='sm']) .more { inline-size: 32px; block-size: 32px; }
385
+ :host([size='lg']) .more { inline-size: 56px; block-size: 56px; }
386
+ .sr { ${visuallyHidden} }
387
+ `];
388
+ }
389
+ render() {
390
+ const shown = this.items.slice(0, this.max);
391
+ const rest = this.items.length - shown.length;
392
+ return html`<ul part="list">
393
+ ${shown.map((item) => html`<li><impkt-avatar full-name=${item.name} src=${item.src ?? ""} size=${this.size}></impkt-avatar></li>`)}
394
+ ${rest > 0 ? html`<li><span class="more"><span aria-hidden="true">+${rest}</span><span class="sr">${rest} ${this.moreLabel}</span></span></li>` : nothing}
395
+ </ul>`;
396
+ }
397
+ };
398
+ var ImpktEmptyState = class extends ImpktElement {
399
+ static {
400
+ this.properties = {
401
+ icon: { type: String },
402
+ heading: { type: String },
403
+ lead: { type: String },
404
+ framed: { type: Boolean, reflect: true },
405
+ headingLevel: { type: Number, attribute: "heading-level" },
406
+ spaceAbove: { type: String, reflect: true, attribute: "space-above" },
407
+ spaceBelow: { type: String, reflect: true, attribute: "space-below" }
408
+ };
409
+ }
410
+ constructor() {
411
+ super();
412
+ this.icon = "search";
413
+ this.heading = "";
414
+ this.lead = "";
415
+ this.framed = false;
416
+ this.headingLevel = 2;
417
+ this.spaceAbove = "none";
418
+ this.spaceBelow = "none";
419
+ }
420
+ static {
421
+ this.styles = [...ImpktElement.styles, spaceAround, css`
422
+ .wrap { display: flex; flex-direction: column; align-items: center; gap: ${space(2)}; padding: ${space(12)} ${space(6)}; text-align: center; }
423
+ :host([framed]) .wrap { border: ${t.borderThin} dashed ${t.border}; border-radius: ${t.radiusXl}; }
424
+ .mark { display: inline-flex; align-items: center; justify-content: center; inline-size: 56px; block-size: 56px; margin-block-end: ${space(2)}; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; }
425
+ .h { margin: 0; font-family: ${t.fontHeading}; ${type("xl")} font-weight: ${fontWeight("bold")}; color: ${t.textHeading}; }
426
+ p { margin: 0; max-inline-size: 42ch; color: ${t.textMuted}; text-wrap: pretty; }
427
+ .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: ${space(3)}; margin-block-start: ${space(3)}; }
428
+ `];
429
+ }
430
+ render() {
431
+ return html`<div class="wrap" part="wrap">
432
+ <span class="mark">${iconSvg(this.icon, "26px")}</span>
433
+ ${this.heading ? html`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}
434
+ ${this.lead ? html`<p>${this.lead}</p>` : nothing}
435
+ <div class="actions"><slot name="actions"></slot></div>
436
+ </div>`;
437
+ }
438
+ };
439
+ var timesOf = (day) => String(day?.times ?? "").split(",").map((time) => time.trim()).filter(Boolean);
440
+ function dayParts(date) {
441
+ const parsed = /* @__PURE__ */ new Date(`${date}T00:00:00Z`);
442
+ if (Number.isNaN(parsed.getTime())) return { weekday: "", day: date, month: "" };
443
+ const locale = typeof document !== "undefined" && document.documentElement.lang || "en-GB";
444
+ const part = (options) => new Intl.DateTimeFormat(locale, { timeZone: "UTC", ...options }).format(parsed);
445
+ return { weekday: part({ weekday: "short" }), day: part({ day: "numeric" }), month: part({ month: "short" }) };
446
+ }
447
+ var ImpktSlotPicker = class extends FieldElement {
448
+ constructor() {
449
+ super();
450
+ this.day = "";
451
+ this.days = [];
452
+ this.dayLabel = "Day";
453
+ this.timeLabel = "Time";
454
+ this.emptyText = "No times are available at the moment.";
455
+ }
456
+ static {
457
+ this.properties = {
458
+ ...FieldElement.properties,
459
+ days: { type: Array },
460
+ dayLabel: { type: String, attribute: "day-label" },
461
+ timeLabel: { type: String, attribute: "time-label" },
462
+ emptyText: { type: String, attribute: "empty-text" }
463
+ };
464
+ }
465
+ static {
466
+ this.styles = [...FieldElement.styles, css`
467
+ fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
468
+ legend { padding: 0; }
469
+ .row-label { ${type("sm")} color: ${t.textMuted}; margin-block: ${space(2)}; }
470
+ .days { display: flex; gap: ${space(2)}; overflow-x: auto; padding: ${space(1)}; margin: -${space(1)}; scrollbar-width: thin; }
471
+ .times { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: ${space(2)}; }
472
+ label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; min-block-size: 44px; color: ${t.text}; background: ${t.surfaceCard}; border-radius: ${t.radiusLg}; box-shadow: inset 0 0 0 1px ${t.border}; cursor: pointer; transition: background-color 120ms ease-in-out; }
473
+ label:hover { background: ${t.surfaceSubtle}; }
474
+ label:has(input:checked) { color: ${t.onBrand}; background: ${t.brand}; box-shadow: none; }
475
+ label:has(input:focus-visible) { box-shadow: ${t.focusShadow}; }
476
+ input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
477
+ .day { flex: none; inline-size: 4.5rem; padding-block: ${space(2.5)}; }
478
+ .weekday, .month { ${type("xs")} }
479
+ .num { ${type("xl")} font-weight: ${fontWeight("semibold")}; }
480
+ .time { padding: ${space(2)}; ${type("sm")} font-weight: ${fontWeight("medium")}; }
481
+ .empty { margin: 0; color: ${t.textMuted}; }
482
+ :host([invalid]) .days label, :host([invalid]) .times label { box-shadow: inset 0 0 0 1px ${t.danger}; }
483
+ `];
484
+ }
485
+ get currentDay() {
486
+ const wanted = this.day || this.value.split("T")[0];
487
+ return this.days.find((day) => day.date === wanted) ?? this.days[0];
488
+ }
489
+ chooseDay(date) {
490
+ this.day = date;
491
+ if (this.value && !this.value.startsWith(`${date}T`)) this.setFormValue("");
492
+ this.requestUpdate();
493
+ }
494
+ renderLabel() {
495
+ return html`<legend class="label" part="label">${this.label}${this.required ? html`<span class="required"> (${this.requiredText})</span>` : nothing}</legend>`;
496
+ }
497
+ renderControl() {
498
+ const current = this.currentDay;
499
+ if (!current) return html`<p class="empty">${this.emptyText}</p>`;
500
+ return html`
501
+ <div class="row-label" id=${this.id_("days")}>${this.dayLabel}</div>
502
+ <div class="days" part="days" role="radiogroup" aria-labelledby=${this.id_("days")}>
503
+ ${this.days.map((day) => {
504
+ const parts = dayParts(day.date);
505
+ return html`<label class="day"><input type="radio" name=${`${this.uid}-day`} .checked=${day.date === current.date} ?disabled=${this.disabled} @change=${() => this.chooseDay(day.date)} />
506
+ <span class="weekday">${parts.weekday}</span><span class="num">${parts.day}</span><span class="month">${parts.month}</span></label>`;
507
+ })}
508
+ </div>
509
+ <div class="row-label" id=${this.id_("times")}>${this.timeLabel}</div>
510
+ <div class="times" part="times" role="radiogroup" aria-labelledby=${this.id_("times")}>
511
+ ${timesOf(current).map((time, i) => {
512
+ const value = `${current.date}T${time}`;
513
+ return html`<label class="time"><input type="radio" name=${`${this.uid}-time`} .checked=${this.value === value} ?required=${this.required && i === 0} ?disabled=${this.disabled} @change=${() => this.setFormValue(value)} />${time}</label>`;
514
+ })}
515
+ </div>`;
516
+ }
517
+ render() {
518
+ return html`<fieldset part="fieldset" aria-describedby=${this.describedBy} aria-invalid=${this.error ? "true" : nothing}>
519
+ ${this.renderLabel()}
520
+ ${this.description ? html`<div class="description" id=${this.id_("description")} part="description">${this.description}</div>` : nothing}
521
+ ${this.renderControl()}
522
+ <div class="error" id=${this.id_("error")} part="error" aria-live="polite">${this.error || nothing}</div>
523
+ </fieldset>`;
524
+ }
525
+ updated(changed) {
526
+ if (changed.has("error")) this.toggleAttribute("invalid", Boolean(this.error));
527
+ }
528
+ };
529
+ customElements.define("impkt-drawer", ImpktDrawer);
530
+ customElements.define("impkt-toast", ImpktToast);
531
+ customElements.define("impkt-menu", ImpktMenu);
532
+ customElements.define("impkt-pagination", ImpktPagination);
533
+ customElements.define("impkt-avatar", ImpktAvatar);
534
+ customElements.define("impkt-avatar-group", ImpktAvatarGroup);
535
+ customElements.define("impkt-empty-state", ImpktEmptyState);
536
+ customElements.define("impkt-slot-picker", ImpktSlotPicker);
537
+
538
+ export {
539
+ ImpktDrawer,
540
+ ImpktToast,
541
+ ImpktMenu,
542
+ pageWindow,
543
+ ImpktPagination,
544
+ ImpktAvatar,
545
+ ImpktAvatarGroup,
546
+ ImpktEmptyState,
547
+ ImpktSlotPicker
548
+ };
549
+ //# sourceMappingURL=chunk-QCNT7D5V.js.map