@atomic-ui/ui 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +474 -3
- package/dist/base/FieldElement.d.ts +10 -0
- package/dist/{chunk-2BGOBD6Y.js → chunk-273AYERA.js} +2 -2
- package/dist/{chunk-EUOBFMWC.js → chunk-6IQIFKY6.js} +2 -2
- package/dist/{chunk-WEX5RKVC.js → chunk-BTACNWU6.js} +2 -2
- package/dist/{chunk-5OCDXZXG.js → chunk-C767LTJE.js} +3 -2
- package/dist/chunk-C767LTJE.js.map +1 -0
- package/dist/{chunk-RNFGIXJ7.js → chunk-CN4J5RS2.js} +2 -2
- package/dist/{chunk-SRXC6ZPM.js → chunk-DJLUWM3C.js} +10 -1
- package/dist/chunk-DJLUWM3C.js.map +1 -0
- package/dist/{chunk-F2MFV7RM.js → chunk-DKVLA7AF.js} +2 -2
- package/dist/{chunk-P5FAKEFK.js → chunk-GIIJ32FN.js} +2 -2
- package/dist/{chunk-LSEK5MEZ.js → chunk-H5HWJ2D4.js} +2 -2
- package/dist/{chunk-B2GWXXIW.js → chunk-JDKOHA3B.js} +2 -2
- package/dist/{chunk-G7CVRNY5.js → chunk-JX5RJRME.js} +5 -4
- package/dist/chunk-JX5RJRME.js.map +1 -0
- package/dist/{chunk-WT7MHYJR.js → chunk-KDU2POFS.js} +11 -5
- package/dist/chunk-KDU2POFS.js.map +1 -0
- package/dist/{chunk-EA3M6KPB.js → chunk-NCVBRUJM.js} +6 -1
- package/dist/chunk-NCVBRUJM.js.map +1 -0
- package/dist/{chunk-NZSKUEYS.js → chunk-VR543SMV.js} +2 -2
- package/dist/{chunk-QJBRENLI.js → chunk-WGFHYSXH.js} +7 -3
- package/dist/{chunk-QJBRENLI.js.map → chunk-WGFHYSXH.js.map} +1 -1
- package/dist/{chunk-PII4SJL5.js → chunk-X57BTN6V.js} +14 -2
- package/dist/chunk-X57BTN6V.js.map +1 -0
- package/dist/components/app-bar.d.ts +5 -4
- package/dist/components/app-bar.js +3 -3
- package/dist/components/app-ui.d.ts +4 -0
- package/dist/components/app-ui.js +2 -2
- package/dist/components/checkbox-group.d.ts +4 -0
- package/dist/components/checkbox-group.js +2 -2
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.js +2 -2
- package/dist/components/chip-group.d.ts +1 -0
- package/dist/components/chip-group.js +2 -2
- package/dist/components/chip.js +1 -1
- package/dist/components/date-input.d.ts +4 -0
- package/dist/components/date-input.js +2 -2
- package/dist/components/journey.d.ts +16 -0
- package/dist/components/journey.js +2 -2
- package/dist/components/navigation.d.ts +6 -0
- package/dist/components/navigation.js +5 -3
- package/dist/components/page.js +1 -1
- package/dist/components/radio-group.d.ts +4 -0
- package/dist/components/radio-group.js +2 -2
- package/dist/components/select.d.ts +4 -0
- package/dist/components/select.js +2 -2
- package/dist/components/switch.d.ts +8 -0
- package/dist/components/switch.js +2 -2
- package/dist/components/text-input.d.ts +4 -0
- package/dist/components/text-input.js +2 -2
- package/dist/components/textarea.d.ts +4 -0
- package/dist/components/textarea.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -17
- package/dist/standalone/atomic-ui.js +149 -120
- package/dist/standalone/atomic-ui.js.map +3 -3
- package/package.json +2 -2
- package/dist/chunk-5OCDXZXG.js.map +0 -1
- package/dist/chunk-EA3M6KPB.js.map +0 -1
- package/dist/chunk-G7CVRNY5.js.map +0 -1
- package/dist/chunk-PII4SJL5.js.map +0 -1
- package/dist/chunk-SRXC6ZPM.js.map +0 -1
- package/dist/chunk-WT7MHYJR.js.map +0 -1
- /package/dist/{chunk-2BGOBD6Y.js.map → chunk-273AYERA.js.map} +0 -0
- /package/dist/{chunk-EUOBFMWC.js.map → chunk-6IQIFKY6.js.map} +0 -0
- /package/dist/{chunk-WEX5RKVC.js.map → chunk-BTACNWU6.js.map} +0 -0
- /package/dist/{chunk-RNFGIXJ7.js.map → chunk-CN4J5RS2.js.map} +0 -0
- /package/dist/{chunk-F2MFV7RM.js.map → chunk-DKVLA7AF.js.map} +0 -0
- /package/dist/{chunk-P5FAKEFK.js.map → chunk-GIIJ32FN.js.map} +0 -0
- /package/dist/{chunk-LSEK5MEZ.js.map → chunk-H5HWJ2D4.js.map} +0 -0
- /package/dist/{chunk-B2GWXXIW.js.map → chunk-JDKOHA3B.js.map} +0 -0
- /package/dist/{chunk-NZSKUEYS.js.map → chunk-VR543SMV.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/page.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { onServer } from '../base/server';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing } from '../base/styles';\nimport { space, spaceAround, t, token } from '../base/tokens';\n\n/** The widest a line of content runs, for each choice of `width`. */\nconst widths = css`\n :host { --impakt-page-inner: ${token('layout.page-width', '1200px')}; }\n :host([width='narrow']) { --impakt-page-inner: 760px; }\n :host([width='wide']) { --impakt-page-inner: 1440px; }\n :host([width='content']) { --impakt-page-inner: 1080px; }\n`;\n\n/**\n * The side margins, from the brand's layout: narrow on a phone, wider on a\n * tablet and a desktop. Measured against the page itself, so a page drawn in a\n * narrow preview gets phone margins whatever the window is.\n */\nconst margins = css`\n :host { --impakt-page-margin: ${token('layout.margin.phone', '16px')}; }\n @container impakt-page (min-width: 40rem) { .frame { --impakt-page-margin: ${token('layout.margin.tablet', '32px')}; } }\n @container impakt-page (min-width: 64rem) { .frame { --impakt-page-margin: ${token('layout.margin.desktop', '64px')}; } }\n`;\n\n/**\n * The frame every page sits in: a header, the page's own content, and a\n * footer, each kept to the brand's page width with the brand's side margins.\n *\n * A layout puts this at its root, with the site's header and footer in their\n * slots and the page content in the middle, so an app draws the same frame the\n * CMS shows. Without it, a page runs edge to edge.\n *\n * **It gives the page its landmarks.** The header, main content and footer are\n * `header`, `main` and `footer` elements, so a screen reader can jump between\n * them (1.3.1), and the first thing in the page is a \"Skip to content\" link\n * that appears when it has focus (2.4.1).\n *\n * @category layout\n * @icon layout\n * @slot header - The site's header: its logo, navigation and a call to action.\n * @slot - The page's own content.\n * @slot footer - The site's footer.\n */\nexport class ImpaktPage extends ImpaktElement {\n static properties = {\n width: { type: String, reflect: true },\n stickyHeader: { type: Boolean, reflect: true, attribute: 'sticky-header' },\n skipText: { type: String, attribute: 'skip-text' },\n noHeader: { type: Boolean, reflect: true, attribute: 'no-header' },\n noFooter: { type: Boolean, reflect: true, attribute: 'no-footer' },\n };\n /** How wide the content runs. Standard is the brand's page width; `content` is G2's 1080px column. */\n declare width: 'narrow' | 'standard' | 'content' | 'wide';\n /** Keep the header at the top of the screen while the page scrolls. */\n declare stickyHeader: boolean;\n /** The words of the link that skips past the header to the content. */\n declare skipText: string;\n /**\n * Leave the header landmark out. In a browser the page sees for itself whether a header was\n * given, so this is only for a page drawn on the server, where it cannot.\n */\n declare noHeader: boolean;\n /** Leave the footer landmark out, for a page drawn on the server with no footer. */\n declare noFooter: boolean;\n\n constructor() {\n super();\n this.width = 'standard';\n this.stickyHeader = false;\n this.skipText = 'Skip to content';\n this.noHeader = false;\n this.noFooter = false;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n widths,\n margins,\n css`\n :host { display: block; container: impakt-page / inline-size; }\n .frame { position: relative; display: flex; flex-direction: column; min-block-size: 100%; overflow-x: clip; }\n .inner { box-sizing: border-box; inline-size: 100%; max-inline-size: calc(var(--impakt-page-inner) + 2 * var(--impakt-page-margin)); margin-inline: auto; padding-inline: var(--impakt-page-margin); }\n header { background: ${token('color.surface.header', 'transparent')}; color: ${token('color.text.on-header', 'inherit')}; padding-block: ${space(4)}; }\n /* What sits in the header and footer takes their text colour, so words on a dark footer stay readable. */\n header { --impakt-color-text-default: ${token('color.text.on-header', 'inherit')}; --impakt-color-text-heading: ${token('color.text.on-header', 'inherit')}; --impakt-color-text-link: ${token('color.text.on-header', 'inherit')}; --impakt-color-text-link-hover: ${token('color.text.on-header', 'inherit')}; }\n footer { --impakt-color-text-default: ${token('color.text.on-footer', 'inherit')}; --impakt-color-text-heading: ${token('color.text.on-footer', 'inherit')}; --impakt-color-text-muted: ${token('color.text.on-footer', 'inherit')}; --impakt-color-text-link: ${token('color.text.on-footer', 'inherit')}; --impakt-color-text-link-hover: ${token('color.text.on-footer', 'inherit')}; }\n :host([sticky-header]) header { position: sticky; inset-block-start: 0; z-index: 10; }\n main { flex: 1; padding-block: ${space(6)} ${space(10)}; }\n main:focus { outline: none; }\n /* A page that opens on a full-picture hero: the header floats over it as a rounded bar. */\n :host([floating]) header { position: absolute; z-index: 20; inset-inline: 0; inset-block-start: var(--impakt-header-top, 0px); padding-block: ${space(6)} 0; background: transparent; border: 0; }\n :host([floating]) header .inner { inline-size: calc(100% - 2 * var(--impakt-page-margin)); max-inline-size: var(--impakt-page-inner); padding: ${space(3)} ${space(4)} ${space(3)} ${space(6)}; background: ${token('color.surface.header', '#fff')}; border-radius: ${t.radius2xl}; box-shadow: ${t.shadowLg}; }\n :host([floating]) main { padding-block-start: 0; }\n footer { background: ${token('color.surface.footer', 'transparent')}; color: ${token('color.text.on-footer', 'inherit')}; padding-block: ${space(8)}; border-block-start: ${t.borderThin} solid ${token('color.border.subtle', 'transparent')}; }\n .skip { position: absolute; inset-inline-start: ${space(2)}; inset-block-start: ${space(2)}; z-index: 20; padding: ${space(2)} ${space(4)}; background: ${t.surfaceCard}; color: ${t.link}; border-radius: ${t.radius}; transform: translateY(-200%); }\n .skip:not(:focus) { clip-path: inset(50%); }\n .skip:focus { transform: none; }\n .empty { display: none; }\n `,\n ];\n\n /**\n * Whether something was given for a slot. An element drawn on the server cannot see its own\n * children, so there the landmark is drawn unless `no-header` or `no-footer` says to leave it out.\n */\n private hasSlot(name: 'header' | 'footer'): boolean {\n if (name === 'header' ? this.noHeader : this.noFooter) return false;\n if (onServer) return true;\n return Array.from(this.children).some((c) => c.getAttribute('slot') === name);\n }\n\n private skip(event: Event): void {\n event.preventDefault();\n const main = this.renderRoot.querySelector('main');\n main?.focus();\n main?.scrollIntoView();\n }\n\n render(): TemplateResult {\n // The header and footer are left out when nothing is in them, so a page\n // with no site header has no empty landmark for a screen reader to land on.\n const header = this.hasSlot('header');\n const footer = this.hasSlot('footer');\n return html`<div class=\"frame\" part=\"frame\">\n <a class=\"skip\" href=\"#content\" part=\"skip\" @click=${this.skip}>${this.skipText}</a>\n ${header ? html`<header part=\"header\"><div class=\"inner\"><slot name=\"header\"></slot></div></header>` : nothing}\n <main id=\"content\" tabindex=\"-1\" part=\"main\"><div class=\"inner\"><slot></slot></div></main>\n ${footer ? html`<footer part=\"footer\"><div class=\"inner\"><slot name=\"footer\"></slot></div></footer>` : nothing}\n </div>`;\n }\n\n /**\n * The header floats when the page opens on a full-picture hero, sitting on the\n * picture itself, so nothing has to be set for it. It stays an ordinary bar\n * while editing, where the blocks are kept inside the page's box.\n */\n private place = (): void => {\n const hero = this.querySelector('impakt-hero[treatment=\"cover\"]');\n const editing = getComputedStyle(this).getPropertyValue('--impakt-bleed').trim() === '0';\n const floats = !!hero && !editing && this.opensOn(hero);\n this.toggleAttribute('floating', floats);\n if (!floats) return;\n const frame = this.renderRoot.querySelector('.frame');\n if (frame) this.style.setProperty('--impakt-header-top', `${Math.round(hero!.getBoundingClientRect().top - frame.getBoundingClientRect().top)}px`);\n };\n\n /** Whether nothing a reader would notice comes before this block, other than an announcement. */\n private opensOn(hero: Element): boolean {\n for (const element of Array.from(this.querySelectorAll('*'))) {\n if (element === hero) return true;\n if (element.closest('[slot=\"header\"],[slot=\"footer\"]')) continue;\n if (element.tagName.startsWith('IMPAKT-') && !/^IMPAKT-(STACK|SECTION|GRID|ANNOUNCEMENT)$/.test(element.tagName)) return false;\n }\n return false;\n }\n\n // A header or footer added after the first render still gets its landmark.\n connectedCallback(): void {\n super.connectedCallback();\n this.observer = new MutationObserver(() => this.requestUpdate());\n this.observer.observe(this, { childList: true, attributes: true, subtree: false, attributeFilter: ['slot'] });\n this.watcher = new MutationObserver(this.place);\n this.watcher.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: ['treatment'] });\n if (typeof ResizeObserver === 'function') {\n this.resize = new ResizeObserver(this.place);\n this.resize.observe(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.watcher?.disconnect();\n this.resize?.disconnect();\n }\n\n protected firstUpdated(): void {\n this.place();\n }\n\n private observer?: MutationObserver;\n private watcher?: MutationObserver;\n private resize?: ResizeObserver;\n}\n\n/**\n * A band across the whole width of the page, with its own background, and its\n * content kept to the page width inside it: a coloured strip of features, a\n * quote on a tinted background, a call to action at the foot of a page.\n *\n * Inside a Page it reaches the edges of the screen whatever the page width is,\n * so a page can alternate bands without any of them knowing the frame. Set\n * `bleed` off to keep the band to the page width, as a panel.\n *\n * @category layout\n * @icon section\n * @slot - The section's content.\n */\nexport class ImpaktSection extends ImpaktElement {\n static properties = {\n tone: { type: String, reflect: true },\n padding: { type: String, reflect: true },\n width: { type: String, reflect: true },\n bleed: { type: Boolean, reflect: true },\n pattern: { type: String, reflect: true },\n label: { type: String },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /**\n * The band's background. Text on it takes the matching colour, so it stays\n * readable. `board` is G2's blueprint grey (#E3E2DD). On `ink` the cards are\n * the raised ink (#1C1C1C) with a #2E2E2E rule, a primary button is the paper\n * with ink words and an outline button has a paper border.\n */\n declare tone: 'none' | 'subtle' | 'inset' | 'brand' | 'card' | 'ink' | 'accent' | 'board';\n /** Space inside the band, above and below its content. `3xl` is G2's 120px on a desktop and 64px on a phone. */\n declare padding: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';\n /** How wide the content inside runs. `content` is G2's 1080px column. */\n declare width: 'narrow' | 'standard' | 'content' | 'wide';\n /** Run the background to the edges of the screen. */\n declare bleed: boolean;\n /**\n * Fine lines drawn across the band: a square grid, a closer blueprint grid,\n * upright columns or ruled lines. They are decoration, drawn in the band's\n * own text colour at a tenth of its strength, and are left out in a forced\n * colours mode.\n */\n declare pattern: 'none' | 'grid' | 'blueprint' | 'columns' | 'ruled';\n /** A name for the section, so a screen reader can find it in the page's regions. Leave empty for none. */\n declare label: string;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.tone = 'none';\n this.padding = 'lg';\n this.width = 'standard';\n this.bleed = true;\n this.pattern = 'none';\n this.label = '';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n widths,\n css`\n :host { display: block; --impakt-page-margin: inherit; }\n /* What a solid card on a brand band goes back to, since the band repaints these for its own text. */\n :host([tone='brand']) { --impakt-solid-card: ${t.surfaceCard}; --impakt-solid-text: ${t.text}; --impakt-solid-heading: var(--impakt-color-text-heading, ${t.text}); --impakt-solid-muted: ${t.textMuted}; }\n .band { box-sizing: border-box; border-radius: ${t.radiusLg}; }\n /* --impakt-bleed is 0 while editing, so a full-width block stays inside the box it is being edited in. */\n :host([bleed]) .band { border-radius: 0; margin-inline: calc(var(--impakt-bleed, 1) * (50% - 50vw)); padding-inline: max(${token('section.gutter', '16px')}, calc(var(--impakt-bleed, 1) * (50vw - 50%))); }\n :host([tone='subtle']) .band { background: ${t.surfaceSubtle}; }\n :host([tone='inset']) .band { background: ${t.surfaceInset}; }\n :host([tone='card']) .band { background: ${t.surfaceCard}; }\n :host([tone='board']) .band { background: var(--impakt-color-surface-board, var(--ik-surface-board, #e3e2dd)); }\n /*\n * A toned band sets what a button and a solid mark on it need, and resets what\n * an outer band set, so a band inside another one, or a banner inside a band,\n * never draws with colours meant for the band round it. --impakt-color-text-inverse\n * is the colour that reads on the band's text colour: a dark button's words.\n */\n :host(:not([tone='none'])) .band { --impakt-button-primary: initial; --impakt-button-on-primary: initial; --impakt-button-primary-hover: initial; --impakt-color-text-inverse: initial; }\n :host([tone='brand']) .band { --impakt-color-text-inverse: ${t.brand}; }\n :host([tone='accent']) .band { --impakt-color-text-inverse: var(--impakt-solid-card); }\n :host([tone='brand']) .band { background: ${t.brand}; color: ${t.onBrand}; --impakt-eyebrow: ${t.onBrand}; --impakt-color-surface-card: color-mix(in srgb, ${t.onBrand} 10%, transparent); --impakt-color-text-heading: ${t.onBrand}; --impakt-color-text-default: ${t.onBrand}; --impakt-color-text-muted: ${t.onBrand}; --impakt-color-text-link: ${t.onBrand}; --impakt-color-text-link-hover: ${t.onBrand}; }\n /* Ink and accent bands take their colours from the host, because the band repaints the text colour for what is inside it. */\n :host([tone='ink']) { --impakt-band: ${t.text}; --impakt-band-on: ${t.surfaceCard}; --impakt-band-muted: color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text}); --impakt-solid-card: ${t.surfaceCard}; --impakt-solid-text: ${t.text}; --impakt-solid-heading: var(--impakt-color-text-heading, ${t.text}); --impakt-solid-muted: ${t.textMuted}; }\n :host([tone='accent']) { --impakt-band: ${token('color.accent.default', '#ffd43b')}; --impakt-band-on: ${token('color.accent.on', '#1a1a1a')}; --impakt-band-muted: ${token('color.accent.on', '#1a1a1a')}; --impakt-solid-card: ${t.surfaceCard}; --impakt-solid-text: ${t.text}; --impakt-solid-heading: var(--impakt-color-text-heading, ${t.text}); --impakt-solid-muted: ${t.textMuted}; }\n :host(:is([tone='ink'], [tone='accent'])) .band { background-color: var(--impakt-band); color: var(--impakt-band-on); --impakt-eyebrow: var(--impakt-band-muted); --impakt-color-surface-card: color-mix(in srgb, var(--impakt-band-on) 10%, transparent); --impakt-color-text-heading: var(--impakt-band-on); --impakt-color-text-default: var(--impakt-band-on); --impakt-color-text-muted: var(--impakt-band-muted); --impakt-color-text-link: var(--impakt-band-on); --impakt-color-text-link-hover: var(--impakt-band-on); }\n /* On ink the cards are the raised ink with a darker rule (G2 ink-raised and line-inverse), not a wash. */\n :host([tone='ink']) .band {\n --impakt-color-text-inverse: var(--impakt-band);\n --impakt-button-primary: var(--impakt-band-on);\n --impakt-button-on-primary: var(--impakt-band);\n --impakt-button-primary-hover: color-mix(in srgb, var(--impakt-band-on) 86%, var(--impakt-band));\n /* Mixed from the band, so it is #1C1C1C on light ink and still a step off the band when dark turns the band over. */\n --impakt-color-surface-card: color-mix(in srgb, var(--impakt-band) 95%, var(--impakt-band-on));\n --impakt-color-line-soft: color-mix(in srgb, var(--impakt-band) 87%, var(--impakt-band-on));\n /* The accent reads on light-theme ink only; the theme leaves it unset in dark, where the band turns paper. */\n --impakt-site-menu-current: var(--impakt-color-accent-on-ink, currentColor);\n --impakt-steps-current: var(--impakt-color-accent-on-ink, currentColor);\n }\n /* The lines are a tenth of the band's own text colour, so they suit any tone. They carry no meaning. */\n :host([pattern]:not([pattern='none'])) .band { --impakt-pattern-line: color-mix(in srgb, currentColor 10%, transparent); }\n :host(:is([pattern='grid'], [pattern='blueprint'])) .band { background-image: linear-gradient(to right, var(--impakt-pattern-line) 1px, transparent 1px), linear-gradient(to bottom, var(--impakt-pattern-line) 1px, transparent 1px); background-size: 7rem 7rem; }\n :host([pattern='blueprint']) .band { background-size: 1.75rem 1.75rem; }\n :host([pattern='columns']) .band { background-image: linear-gradient(to right, var(--impakt-pattern-line) 1px, transparent 1px); background-size: 5.625rem 100%; }\n :host([pattern='ruled']) .band { background-image: linear-gradient(to bottom, var(--impakt-pattern-line) 1px, transparent 1px); background-size: 100% 2.5rem; }\n @media (forced-colors: active) { .band { background-image: none !important; } }\n :host(:not([bleed]):not([tone='none'])) .band { padding-inline: ${space(6)}; }\n :host([padding='sm']) .band { padding-block: ${space(4)}; }\n :host([padding='md']) .band { padding-block: ${space(8)}; }\n :host([padding='lg']) .band { padding-block: ${space(12)}; }\n :host([padding='xl']) .band { padding-block: ${space(16)}; }\n :host([padding='2xl']) .band { padding-block: ${token('section.padding-2xl', 'clamp(56px, 8vw, 112px)')}; }\n :host([padding='3xl']) .band { padding-block: clamp(${space(16)}, 10vw, ${space(30)}); }\n .content { max-inline-size: var(--impakt-page-inner); margin-inline: auto; }\n `,\n ];\n\n render(): TemplateResult {\n return html`<section class=\"band\" part=\"band\" aria-label=${this.label || nothing} role=${this.label ? nothing : 'presentation'}><div class=\"content\" part=\"content\"><slot></slot></div></section>`;\n }\n}\n\ncustomElements.define('impakt-page', ImpaktPage);\ncustomElements.define('impakt-section', ImpaktSection);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-page': ImpaktPage;\n 'impakt-section': ImpaktSection;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAOxD,IAAM,SAAS;AAAA,iCACkB,MAAM,qBAAqB,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA;AAWrE,IAAM,UAAU;AAAA,kCACkB,MAAM,uBAAuB,MAAM,CAAC;AAAA,+EACS,MAAM,wBAAwB,MAAM,CAAC;AAAA,+EACrC,MAAM,yBAAyB,MAAM,CAAC;AAAA;AAsB9G,IAAM,aAAN,cAAyB,cAAc;AAAA,EAsB5C,cAAc;AACZ,UAAM;AAuER;AAAA;AAAA;AAAA;AAAA;AAAA,SAAQ,QAAQ,MAAY;AAC1B,YAAM,OAAO,KAAK,cAAc,gCAAgC;AAChE,YAAM,UAAU,iBAAiB,IAAI,EAAE,iBAAiB,gBAAgB,EAAE,KAAK,MAAM;AACrF,YAAM,SAAS,CAAC,CAAC,QAAQ,CAAC,WAAW,KAAK,QAAQ,IAAI;AACtD,WAAK,gBAAgB,YAAY,MAAM;AACvC,UAAI,CAAC,OAAQ;AACb,YAAM,QAAQ,KAAK,WAAW,cAAc,QAAQ;AACpD,UAAI,MAAO,MAAK,MAAM,YAAY,uBAAuB,GAAG,KAAK,MAAM,KAAM,sBAAsB,EAAE,MAAM,MAAM,sBAAsB,EAAE,GAAG,CAAC,IAAI;AAAA,IACnJ;AA9EE,SAAK,QAAQ;AACb,SAAK,eAAe;AACpB,SAAK,WAAW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AA;AAAA;AAAA;AAAA,sEAsBzT,MAAM,CAAC,CAAC;AAAA,mDAC3B,MAAM,CAAC,CAAC;AAAA,mDACR,MAAM,CAAC,CAAC;AAAA,mDACR,MAAM,EAAE,CAAC;AAAA,mDACT,MAAM,EAAE,CAAC;AAAA,oDACR,MAAM,uBAAuB,yBAAyB,CAAC;AAAA,0DACjD,MAAM,EAAE,CAAC,WAAW,MAAM,EAAE,CAAC;AAAA;AAAA;AAAA,IAGrF;AAAA;AAAA,EAEA,SAAyB;AACvB,WAAO,oDAAoD,KAAK,SAAS,OAAO,SAAS,KAAK,QAAQ,UAAU,cAAc;AAAA,EAChI;AACF;AAEA,eAAe,OAAO,eAAe,UAAU;AAC/C,eAAe,OAAO,kBAAkB,aAAa;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/components/page.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { onServer } from '../base/server';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing } from '../base/styles';\nimport { space, spaceAround, t, token } from '../base/tokens';\n\n/** The widest a line of content runs, for each choice of `width`. */\nconst widths = css`\n :host { --impakt-page-inner: ${token('layout.page-width', '1200px')}; }\n :host([width='narrow']) { --impakt-page-inner: 760px; }\n :host([width='wide']) { --impakt-page-inner: 1440px; }\n :host([width='content']) { --impakt-page-inner: 1080px; }\n`;\n\n/**\n * The side margins, from the brand's layout: narrow on a phone, wider on a\n * tablet and a desktop. Measured against the page itself, so a page drawn in a\n * narrow preview gets phone margins whatever the window is.\n */\nconst margins = css`\n :host { --impakt-page-margin: ${token('layout.margin.phone', '16px')}; }\n @container impakt-page (min-width: 40rem) { .frame { --impakt-page-margin: ${token('layout.margin.tablet', '32px')}; } }\n @container impakt-page (min-width: 64rem) { .frame { --impakt-page-margin: ${token('layout.margin.desktop', '64px')}; } }\n`;\n\n/**\n * The frame every page sits in: a header, the page's own content, and a\n * footer, each kept to the brand's page width with the brand's side margins.\n *\n * A layout puts this at its root, with the site's header and footer in their\n * slots and the page content in the middle, so an app draws the same frame the\n * CMS shows. Without it, a page runs edge to edge.\n *\n * **It gives the page its landmarks.** The header, main content and footer are\n * `header`, `main` and `footer` elements, so a screen reader can jump between\n * them (1.3.1), and the first thing in the page is a \"Skip to content\" link\n * that appears when it has focus (2.4.1).\n *\n * @category layout\n * @icon layout\n * @slot header - The site's header: its logo, navigation and a call to action.\n * @slot - The page's own content.\n * @slot footer - The site's footer.\n */\nexport class ImpaktPage extends ImpaktElement {\n static properties = {\n width: { type: String, reflect: true },\n stickyHeader: { type: Boolean, reflect: true, attribute: 'sticky-header' },\n skipText: { type: String, attribute: 'skip-text' },\n noHeader: { type: Boolean, reflect: true, attribute: 'no-header' },\n noFooter: { type: Boolean, reflect: true, attribute: 'no-footer' },\n };\n /** How wide the content runs. Standard is the brand's page width; `content` is G2's 1080px column. */\n declare width: 'narrow' | 'standard' | 'content' | 'wide';\n /** Keep the header at the top of the screen while the page scrolls. */\n declare stickyHeader: boolean;\n /** The words of the link that skips past the header to the content. */\n declare skipText: string;\n /**\n * Leave the header landmark out. In a browser the page sees for itself whether a header was\n * given, so this is only for a page drawn on the server, where it cannot.\n */\n declare noHeader: boolean;\n /** Leave the footer landmark out, for a page drawn on the server with no footer. */\n declare noFooter: boolean;\n\n constructor() {\n super();\n this.width = 'standard';\n this.stickyHeader = false;\n this.skipText = 'Skip to content';\n this.noHeader = false;\n this.noFooter = false;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n widths,\n margins,\n css`\n :host { display: block; container: impakt-page / inline-size; }\n .frame { position: relative; display: flex; flex-direction: column; min-block-size: 100%; overflow-x: clip; }\n .inner { box-sizing: border-box; inline-size: 100%; max-inline-size: calc(var(--impakt-page-inner) + 2 * var(--impakt-page-margin)); margin-inline: auto; padding-inline: var(--impakt-page-margin); }\n header { background: ${token('color.surface.header', 'transparent')}; color: ${token('color.text.on-header', 'inherit')}; padding-block: ${space(4)}; }\n /* What sits in the header and footer takes their text colour, so words on a dark footer stay readable. */\n header { --impakt-color-text-default: ${token('color.text.on-header', 'inherit')}; --impakt-color-text-heading: ${token('color.text.on-header', 'inherit')}; --impakt-color-text-link: ${token('color.text.on-header', 'inherit')}; --impakt-color-text-link-hover: ${token('color.text.on-header', 'inherit')}; }\n footer { --impakt-color-text-default: ${token('color.text.on-footer', 'inherit')}; --impakt-color-text-heading: ${token('color.text.on-footer', 'inherit')}; --impakt-color-text-muted: ${token('color.text.on-footer', 'inherit')}; --impakt-color-text-link: ${token('color.text.on-footer', 'inherit')}; --impakt-color-text-link-hover: ${token('color.text.on-footer', 'inherit')}; }\n :host([sticky-header]) header { position: sticky; inset-block-start: 0; z-index: 10; }\n main { flex: 1; padding-block: ${space(6)} ${space(10)}; }\n main:focus { outline: none; }\n /* A page that opens on a full-picture hero: the header floats over it as a rounded bar. */\n :host([floating]) header { position: absolute; z-index: 20; inset-inline: 0; inset-block-start: var(--impakt-header-top, 0px); padding-block: ${space(6)} 0; background: transparent; border: 0; }\n :host([floating]) header .inner { inline-size: calc(100% - 2 * var(--impakt-page-margin)); max-inline-size: var(--impakt-page-inner); padding: ${space(3)} ${space(4)} ${space(3)} ${space(6)}; background: ${token('color.surface.header', '#fff')}; border-radius: ${t.radius2xl}; box-shadow: ${t.shadowLg}; }\n :host([floating]) main { padding-block-start: 0; }\n footer { background: ${token('color.surface.footer', 'transparent')}; color: ${token('color.text.on-footer', 'inherit')}; padding-block: ${space(8)}; border-block-start: ${t.borderThin} solid ${token('color.border.subtle', 'transparent')}; }\n .skip { position: absolute; inset-inline-start: ${space(2)}; inset-block-start: ${space(2)}; z-index: 20; padding: ${space(2)} ${space(4)}; background: ${t.surfaceCard}; color: ${t.link}; border-radius: ${t.radius}; transform: translateY(-200%); }\n .skip:not(:focus) { clip-path: inset(50%); }\n .skip:focus { transform: none; }\n .empty { display: none; }\n `,\n ];\n\n /**\n * Whether something was given for a slot. An element drawn on the server cannot see its own\n * children, so there the landmark is drawn unless `no-header` or `no-footer` says to leave it out.\n */\n private hasSlot(name: 'header' | 'footer'): boolean {\n if (name === 'header' ? this.noHeader : this.noFooter) return false;\n if (onServer) return true;\n return Array.from(this.children).some((c) => c.getAttribute('slot') === name);\n }\n\n private skip(event: Event): void {\n event.preventDefault();\n const main = this.renderRoot.querySelector('main');\n main?.focus();\n main?.scrollIntoView();\n }\n\n render(): TemplateResult {\n // The header and footer are left out when nothing is in them, so a page\n // with no site header has no empty landmark for a screen reader to land on.\n const header = this.hasSlot('header');\n const footer = this.hasSlot('footer');\n return html`<div class=\"frame\" part=\"frame\">\n <a class=\"skip\" href=\"#content\" part=\"skip\" @click=${this.skip}>${this.skipText}</a>\n ${header ? html`<header part=\"header\"><div class=\"inner\"><slot name=\"header\"></slot></div></header>` : nothing}\n <main id=\"content\" tabindex=\"-1\" part=\"main\"><div class=\"inner\"><slot></slot></div></main>\n ${footer ? html`<footer part=\"footer\"><div class=\"inner\"><slot name=\"footer\"></slot></div></footer>` : nothing}\n </div>`;\n }\n\n /**\n * The header floats when the page opens on a full-picture hero, sitting on the\n * picture itself, so nothing has to be set for it. It stays an ordinary bar\n * while editing, where the blocks are kept inside the page's box.\n */\n private place = (): void => {\n const hero = this.querySelector('impakt-hero[treatment=\"cover\"]');\n const editing = getComputedStyle(this).getPropertyValue('--impakt-bleed').trim() === '0';\n const floats = !!hero && !editing && this.opensOn(hero);\n this.toggleAttribute('floating', floats);\n if (!floats) return;\n const frame = this.renderRoot.querySelector('.frame');\n if (frame) this.style.setProperty('--impakt-header-top', `${Math.round(hero!.getBoundingClientRect().top - frame.getBoundingClientRect().top)}px`);\n };\n\n /** Whether nothing a reader would notice comes before this block, other than an announcement. */\n private opensOn(hero: Element): boolean {\n for (const element of Array.from(this.querySelectorAll('*'))) {\n if (element === hero) return true;\n if (element.closest('[slot=\"header\"],[slot=\"footer\"]')) continue;\n if (element.tagName.startsWith('IMPAKT-') && !/^IMPAKT-(STACK|SECTION|GRID|ANNOUNCEMENT)$/.test(element.tagName)) return false;\n }\n return false;\n }\n\n // A header or footer added after the first render still gets its landmark.\n connectedCallback(): void {\n super.connectedCallback();\n this.observer = new MutationObserver(() => this.requestUpdate());\n this.observer.observe(this, { childList: true, attributes: true, subtree: false, attributeFilter: ['slot'] });\n this.watcher = new MutationObserver(this.place);\n this.watcher.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: ['treatment'] });\n if (typeof ResizeObserver === 'function') {\n this.resize = new ResizeObserver(this.place);\n this.resize.observe(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.watcher?.disconnect();\n this.resize?.disconnect();\n }\n\n protected firstUpdated(): void {\n this.place();\n }\n\n private observer?: MutationObserver;\n private watcher?: MutationObserver;\n private resize?: ResizeObserver;\n}\n\n/**\n * A band across the whole width of the page, with its own background, and its\n * content kept to the page width inside it: a coloured strip of features, a\n * quote on a tinted background, a call to action at the foot of a page.\n *\n * Inside a Page it reaches the edges of the screen whatever the page width is,\n * so a page can alternate bands without any of them knowing the frame. Set\n * `bleed` off to keep the band to the page width, as a panel.\n *\n * @category layout\n * @icon section\n * @slot - The section's content.\n */\nexport class ImpaktSection extends ImpaktElement {\n static properties = {\n tone: { type: String, reflect: true },\n padding: { type: String, reflect: true },\n width: { type: String, reflect: true },\n bleed: { type: Boolean, reflect: true },\n pattern: { type: String, reflect: true },\n label: { type: String },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /**\n * The band's background. Text on it takes the matching colour, so it stays\n * readable. `board` is G2's blueprint grey (#E3E2DD). On `ink` the cards are\n * the raised ink (#1C1C1C) with a #2E2E2E rule, a primary button is the paper\n * with ink words and an outline button has a paper border.\n */\n declare tone: 'none' | 'subtle' | 'inset' | 'brand' | 'card' | 'ink' | 'accent' | 'board';\n /** Space inside the band, above and below its content. `3xl` is G2's 120px on a desktop and 64px on a phone. */\n declare padding: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';\n /** How wide the content inside runs. `content` is G2's 1080px column. */\n declare width: 'narrow' | 'standard' | 'content' | 'wide';\n /** Run the background to the edges of the screen. */\n declare bleed: boolean;\n /**\n * Fine lines drawn across the band: a square grid, a closer blueprint grid,\n * upright columns or ruled lines. They are decoration, drawn in the band's\n * own text colour at a tenth of its strength, and are left out in a forced\n * colours mode.\n */\n declare pattern: 'none' | 'grid' | 'blueprint' | 'columns' | 'ruled';\n /** A name for the section, so a screen reader can find it in the page's regions. Leave empty for none. */\n declare label: string;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.tone = 'none';\n this.padding = 'lg';\n this.width = 'standard';\n this.bleed = true;\n this.pattern = 'none';\n this.label = '';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n widths,\n css`\n :host { display: block; --impakt-page-margin: inherit; }\n /* What a solid card on a brand band goes back to, since the band repaints these for its own text. */\n :host([tone='brand']) { --impakt-solid-card: ${t.surfaceCard}; --impakt-solid-text: ${t.text}; --impakt-solid-heading: var(--impakt-color-text-heading, ${t.text}); --impakt-solid-muted: ${t.textMuted}; }\n .band { box-sizing: border-box; border-radius: ${t.radiusLg}; }\n /* --impakt-bleed is 0 while editing, so a full-width block stays inside the box it is being edited in. */\n :host([bleed]) .band { border-radius: 0; margin-inline: calc(var(--impakt-bleed, 1) * (50% - 50vw)); padding-inline: max(${token('section.gutter', '16px')}, calc(var(--impakt-bleed, 1) * (50vw - 50%))); }\n :host([tone='subtle']) .band { background: ${t.surfaceSubtle}; }\n :host([tone='inset']) .band { background: ${t.surfaceInset}; }\n :host([tone='card']) .band { background: ${t.surfaceCard}; }\n :host([tone='board']) .band { background: var(--impakt-color-surface-board, var(--ik-surface-board, #e3e2dd)); }\n /*\n * A toned band sets what a button and a solid mark on it need, and resets what\n * an outer band set, so a band inside another one, or a banner inside a band,\n * never draws with colours meant for the band round it. --impakt-color-text-inverse\n * is the colour that reads on the band's text colour: a dark button's words.\n */\n :host(:not([tone='none'])) .band { --impakt-button-primary: initial; --impakt-button-on-primary: initial; --impakt-button-primary-hover: initial; --impakt-color-text-inverse: initial; }\n :host([tone='brand']) .band { --impakt-color-text-inverse: ${t.brand}; }\n :host([tone='accent']) .band { --impakt-color-text-inverse: var(--impakt-solid-card); }\n :host([tone='brand']) .band { background: ${t.brand}; color: ${t.onBrand}; --impakt-eyebrow: ${t.onBrand}; --impakt-color-surface-card: color-mix(in srgb, ${t.onBrand} 10%, transparent); --impakt-color-text-heading: ${t.onBrand}; --impakt-color-text-default: ${t.onBrand}; --impakt-color-text-muted: ${t.onBrand}; --impakt-color-text-link: ${t.onBrand}; --impakt-color-text-link-hover: ${t.onBrand}; }\n /*\n * Ink and accent bands take their colours from the host, because the band repaints the text colour for what is inside it.\n * A block that draws its own ink panel off a band, such as the process line, leaves it out on one (--impakt-band-panel,\n * --impakt-band-panel-inset), so the band and its pattern show through.\n */\n :host([tone='ink']) { --impakt-band: ${t.text}; --impakt-band-on: ${t.surfaceCard}; --impakt-band-muted: color-mix(in srgb, ${t.surfaceCard} 78%, ${t.text}); --impakt-solid-card: ${t.surfaceCard}; --impakt-solid-text: ${t.text}; --impakt-solid-heading: var(--impakt-color-text-heading, ${t.text}); --impakt-solid-muted: ${t.textMuted}; }\n :host([tone='accent']) { --impakt-band: ${token('color.accent.default', '#ffd43b')}; --impakt-band-on: ${token('color.accent.on', '#1a1a1a')}; --impakt-band-muted: ${token('color.accent.on', '#1a1a1a')}; --impakt-solid-card: ${t.surfaceCard}; --impakt-solid-text: ${t.text}; --impakt-solid-heading: var(--impakt-color-text-heading, ${t.text}); --impakt-solid-muted: ${t.textMuted}; }\n :host(:is([tone='ink'], [tone='accent'])) .band { background-color: var(--impakt-band); color: var(--impakt-band-on); --impakt-band-panel: transparent; --impakt-band-panel-inset: 0px; --impakt-eyebrow: var(--impakt-band-muted); --impakt-color-surface-card: color-mix(in srgb, var(--impakt-band-on) 10%, transparent); --impakt-color-text-heading: var(--impakt-band-on); --impakt-color-text-default: var(--impakt-band-on); --impakt-color-text-muted: var(--impakt-band-muted); --impakt-color-text-link: var(--impakt-band-on); --impakt-color-text-link-hover: var(--impakt-band-on); }\n /* On ink the cards are the raised ink with a darker rule (G2 ink-raised and line-inverse), not a wash. */\n :host([tone='ink']) .band {\n --impakt-color-text-inverse: var(--impakt-band);\n --impakt-button-primary: var(--impakt-band-on);\n --impakt-button-on-primary: var(--impakt-band);\n --impakt-button-primary-hover: color-mix(in srgb, var(--impakt-band-on) 86%, var(--impakt-band));\n /* Mixed from the band, so it is #1C1C1C on light ink and still a step off the band when dark turns the band over. */\n --impakt-color-surface-card: color-mix(in srgb, var(--impakt-band) 95%, var(--impakt-band-on));\n --impakt-color-line-soft: color-mix(in srgb, var(--impakt-band) 87%, var(--impakt-band-on));\n /* The accent reads on light-theme ink only; the theme leaves it unset in dark, where the band turns paper. */\n --impakt-site-menu-current: var(--impakt-color-accent-on-ink, currentColor);\n --impakt-steps-current: var(--impakt-color-accent-on-ink, currentColor);\n }\n /* The lines are a tenth of the band's own text colour, so they suit any tone. They carry no meaning. */\n :host([pattern]:not([pattern='none'])) .band { --impakt-pattern-line: color-mix(in srgb, currentColor 10%, transparent); }\n :host(:is([pattern='grid'], [pattern='blueprint'])) .band { background-image: linear-gradient(to right, var(--impakt-pattern-line) 1px, transparent 1px), linear-gradient(to bottom, var(--impakt-pattern-line) 1px, transparent 1px); background-size: 7rem 7rem; }\n :host([pattern='blueprint']) .band { background-size: 1.75rem 1.75rem; }\n :host([pattern='columns']) .band { background-image: linear-gradient(to right, var(--impakt-pattern-line) 1px, transparent 1px); background-size: 5.625rem 100%; }\n :host([pattern='ruled']) .band { background-image: linear-gradient(to bottom, var(--impakt-pattern-line) 1px, transparent 1px); background-size: 100% 2.5rem; }\n @media (forced-colors: active) { .band { background-image: none !important; } }\n :host(:not([bleed]):not([tone='none'])) .band { padding-inline: ${space(6)}; }\n :host([padding='sm']) .band { padding-block: ${space(4)}; }\n :host([padding='md']) .band { padding-block: ${space(8)}; }\n :host([padding='lg']) .band { padding-block: ${space(12)}; }\n :host([padding='xl']) .band { padding-block: ${space(16)}; }\n :host([padding='2xl']) .band { padding-block: ${token('section.padding-2xl', 'clamp(56px, 8vw, 112px)')}; }\n :host([padding='3xl']) .band { padding-block: clamp(${space(16)}, 10vw, ${space(30)}); }\n .content { max-inline-size: var(--impakt-page-inner); margin-inline: auto; }\n `,\n ];\n\n render(): TemplateResult {\n return html`<section class=\"band\" part=\"band\" aria-label=${this.label || nothing} role=${this.label ? nothing : 'presentation'}><div class=\"content\" part=\"content\"><slot></slot></div></section>`;\n }\n}\n\ncustomElements.define('impakt-page', ImpaktPage);\ncustomElements.define('impakt-section', ImpaktSection);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-page': ImpaktPage;\n 'impakt-section': ImpaktSection;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAOxD,IAAM,SAAS;AAAA,iCACkB,MAAM,qBAAqB,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA;AAWrE,IAAM,UAAU;AAAA,kCACkB,MAAM,uBAAuB,MAAM,CAAC;AAAA,+EACS,MAAM,wBAAwB,MAAM,CAAC;AAAA,+EACrC,MAAM,yBAAyB,MAAM,CAAC;AAAA;AAsB9G,IAAM,aAAN,cAAyB,cAAc;AAAA,EAsB5C,cAAc;AACZ,UAAM;AAuER;AAAA;AAAA;AAAA;AAAA;AAAA,SAAQ,QAAQ,MAAY;AAC1B,YAAM,OAAO,KAAK,cAAc,gCAAgC;AAChE,YAAM,UAAU,iBAAiB,IAAI,EAAE,iBAAiB,gBAAgB,EAAE,KAAK,MAAM;AACrF,YAAM,SAAS,CAAC,CAAC,QAAQ,CAAC,WAAW,KAAK,QAAQ,IAAI;AACtD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,EAAE,SAAS;AAAA,8CACnS,MAAM,wBAAwB,SAAS,CAAC,uBAAuB,MAAM,mBAAmB,SAAS,CAAC,0BAA0B,MAAM,mBAAmB,SAAS,CAAC,0BAA0B,EAAE,WAAW,0BAA0B,EAAE,IAAI,8DAA8D,EAAE,IAAI,4BAA4B,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sEAsBzT,MAAM,CAAC,CAAC;AAAA,mDAC3B,MAAM,CAAC,CAAC;AAAA,mDACR,MAAM,CAAC,CAAC;AAAA,mDACR,MAAM,EAAE,CAAC;AAAA,mDACT,MAAM,EAAE,CAAC;AAAA,oDACR,MAAM,uBAAuB,yBAAyB,CAAC;AAAA,0DACjD,MAAM,EAAE,CAAC,WAAW,MAAM,EAAE,CAAC;AAAA;AAAA;AAAA,IAGrF;AAAA;AAAA,EAEA,SAAyB;AACvB,WAAO,oDAAoD,KAAK,SAAS,OAAO,SAAS,KAAK,QAAQ,UAAU,cAAc;AAAA,EAChI;AACF;AAEA,eAAe,OAAO,eAAe,UAAU;AAC/C,eAAe,OAAO,kBAAkB,aAAa;","names":[]}
|
|
@@ -83,6 +83,7 @@ var FieldElement = class extends ImpaktElement {
|
|
|
83
83
|
this.disabled = false;
|
|
84
84
|
this.readonly = false;
|
|
85
85
|
this.requiredText = "required";
|
|
86
|
+
this.look = "default";
|
|
86
87
|
try {
|
|
87
88
|
this.internals = this.attachInternals();
|
|
88
89
|
} catch {
|
|
@@ -103,7 +104,8 @@ var FieldElement = class extends ImpaktElement {
|
|
|
103
104
|
required: { type: Boolean, reflect: true },
|
|
104
105
|
disabled: { type: Boolean, reflect: true },
|
|
105
106
|
readonly: { type: Boolean, reflect: true },
|
|
106
|
-
requiredText: { type: String, attribute: "required-text" }
|
|
107
|
+
requiredText: { type: String, attribute: "required-text" },
|
|
108
|
+
look: { type: String, reflect: true }
|
|
107
109
|
};
|
|
108
110
|
}
|
|
109
111
|
static {
|
|
@@ -132,6 +134,15 @@ var FieldElement = class extends ImpaktElement {
|
|
|
132
134
|
margin-block-end: var(--impakt-field-label-space, ${space(1)});
|
|
133
135
|
color: ${t.text};
|
|
134
136
|
}
|
|
137
|
+
/* The site's form label (20:1100): G2 Mono S, IBM Plex Mono medium at 11px, in capitals, 8px above the box (#66). */
|
|
138
|
+
:host([look='site']) {
|
|
139
|
+
--impakt-field-label-font: ${t.fontMono};
|
|
140
|
+
--impakt-field-label-size: 0.6875rem;
|
|
141
|
+
--impakt-field-label-weight: ${fontWeight("medium")};
|
|
142
|
+
--impakt-field-label-tracking: 0.06em;
|
|
143
|
+
--impakt-field-label-transform: uppercase;
|
|
144
|
+
--impakt-field-label-space: ${space(2)};
|
|
145
|
+
}
|
|
135
146
|
.required {
|
|
136
147
|
font-weight: ${fontWeight("regular")};
|
|
137
148
|
color: ${t.textMuted};
|
|
@@ -244,7 +255,8 @@ var FieldElement = class extends ImpaktElement {
|
|
|
244
255
|
|
|
245
256
|
export {
|
|
246
257
|
fieldWidths,
|
|
258
|
+
F,
|
|
247
259
|
fieldControl,
|
|
248
260
|
FieldElement
|
|
249
261
|
};
|
|
250
|
-
//# sourceMappingURL=chunk-
|
|
262
|
+
//# sourceMappingURL=chunk-X57BTN6V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/base/FieldElement.ts"],"sourcesContent":["import { html, css, nothing, unsafeCSS, type CSSResult, type TemplateResult } from 'lit';\nimport { ImpaktElement } from './ImpaktElement';\nimport { focusRing, visuallyHidden } from './styles';\nimport { fontSize, fontWeight, lineHeight, space, t, token } from './tokens';\n\n/**\n * The shared anatomy of a form control: a label, an optional description, a\n * control, and an error.\n *\n * This exists because the ARIA wiring between those four is where accessible\n * forms actually fail, and it fails the same way every time — a description\n * that is never announced, an error that appears silently, a label that points\n * at nothing. Written once, it is right once.\n *\n * Everything is rendered inside this component's own shadow root, including\n * the native control. That is not an implementation detail: `aria-describedby`\n * cannot cross a shadow boundary, so a component that slotted the input from\n * outside could not describe it. Keeping the whole relationship in one tree is\n * what makes the wiring work at all.\n */\n/**\n * How wide a single-line control is, from what it holds: a postcode is short,\n * an email address is long. A width that matches the answer is a hint about\n * what to type (1.3.5 is about the purpose, this is about the size). Applied by\n * the controls that take a `width`, through `--impakt-field-width`.\n */\nexport const fieldWidths = css`\n :host { --impakt-field-width: 100%; }\n :host([width='xs']) { --impakt-field-width: 8ch; }\n :host([width='sm']) { --impakt-field-width: 14ch; }\n :host([width='md']) { --impakt-field-width: 24ch; }\n :host([width='lg']) { --impakt-field-width: 40ch; }\n`;\n\n/**\n * The field's shape, from the brand (`field.*` in `@atomic-ui/design-tokens`). Each fallback is\n * the shape every brand derives: a 44px box with the grey border that darkens when pointed at,\n * and the brand's halo round the focus ring. The Impakt theme sets the G2 Noire shape over it:\n * a 50px box with an ink edge and the plain focus ring (frames 33:492 and 36:398).\n *\n * An edge is how much of the text colour it takes, mixed here rather than on the root, so a\n * band that repaints the text colour repaints the edge with it.\n */\nexport const F = {\n height: token('field.height', '44px'),\n paddingBlock: token('field.padding-block', '10px'),\n paddingInline: token('field.padding-inline', '12px'),\n lineHeight: token('field.line-height', 'normal'),\n radius: token('field.radius', '8px'),\n edge: token('field.edge', '0%'),\n focusEdge: token('field.focus-edge', '0%'),\n focusHalo: token('field.focus-halo', '6px'),\n};\n\n/**\n * The box a single control is drawn in, shared by the text input, the select and\n * the textarea so they match, in the brand's field shape (`F` above).\n * A product can still set `--impakt-shadow-field` or `--impakt-color-field-border`.\n */\nexport const fieldControl = (selector: string): CSSResult => {\n const s = unsafeCSS(selector);\n return css`\n ${s} {\n inline-size: min(100%, var(--impakt-field-width));\n min-block-size: ${F.height};\n padding: ${F.paddingBlock} ${F.paddingInline};\n font-family: inherit;\n font-size: ${fontSize('md')};\n line-height: ${F.lineHeight};\n color: ${t.text};\n background: var(--impakt-color-field-surface, ${t.surfaceCard});\n border: ${t.borderThin} solid var(--impakt-color-field-border, color-mix(in srgb, ${t.text} ${F.edge}, ${t.border}));\n border-radius: ${F.radius};\n box-shadow: var(--impakt-shadow-field, ${t.shadowXs});\n transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;\n }\n ${s}:hover:not(:disabled) {\n border-color: var(--impakt-color-field-border, color-mix(in srgb, ${t.text} ${F.edge}, ${t.borderStrong}));\n }\n /* The focus ring, and the brand's halo round it where the brand draws one, so the field being typed in is plain at a glance. */\n ${s}:focus-visible {\n border-color: color-mix(in srgb, ${t.text} ${F.focusEdge}, ${t.brand});\n box-shadow: ${t.focusShadow}, 0 0 0 ${F.focusHalo} ${t.brandHalo};\n }\n ${s}::placeholder {\n color: ${t.textPlaceholder};\n }\n ${s}:disabled {\n background: ${t.surfaceInset};\n cursor: not-allowed;\n }\n /* The border thickens as well as reddening, and the message below says it in words (1.4.1). */\n :host([invalid]) ${s} {\n border-color: ${t.danger};\n border-width: ${t.borderThick};\n }\n `;\n};\n\n/**\n * The base of every form control.\n *\n * @fires {CustomEvent<{ value: string }>} impakt-change - When the answer changes. The answer is in detail.value.\n */\nexport abstract class FieldElement extends ImpaktElement {\n /** Form controls participate in a `<form>` like native ones. */\n static formAssociated = true;\n\n static properties = {\n label: { type: String },\n name: { type: String },\n value: { type: String },\n description: { type: String },\n error: { type: String },\n required: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n readonly: { type: Boolean, reflect: true },\n requiredText: { type: String, attribute: 'required-text' },\n look: { type: String, reflect: true },\n };\n\n declare label: string;\n declare name: string;\n declare value: string;\n declare description: string;\n declare error: string;\n declare required: boolean;\n declare disabled: boolean;\n declare readonly: boolean;\n /**\n * How \"you must answer this\" is said.\n *\n * Words, not an asterisk. 3.3.2 asks for labels or instructions, and an\n * asterisk is neither until a legend explains it — which puts the\n * explanation somewhere other than the field it explains. It is a property\n * so a partner can reword it, not so they can empty it.\n */\n declare requiredText: string;\n /**\n * `default` takes the brand's field label; `site` is the mono uppercase label of the site's\n * forms, as the G2 contact frame (20:1100) draws \"NAME\" and \"MESSAGE\" and as\n * `impakt-chip-group look=\"site\"` draws its own (#66).\n */\n declare look: 'default' | 'site';\n\n protected internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this.label = '';\n this.name = '';\n this.value = '';\n this.description = '';\n this.error = '';\n this.required = false;\n this.disabled = false;\n this.readonly = false;\n this.requiredText = 'required';\n this.look = 'default';\n // happy-dom and older engines do not implement attachInternals. A control\n // that cannot associate with a form is still a usable control, so this\n // degrades rather than throwing on construction.\n try {\n this.internals = this.attachInternals();\n } catch {\n this.internals = null;\n }\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host {\n display: block;\n margin-block-end: ${space(4)};\n }\n /*\n * The question, at 14px in the ink: semibold in the body face, or under Noire in the code\n * face (G2). The brand sets the face and weight (field.label.*); a page can set it\n * another way through these properties, such as the site's contact form, which sets its\n * labels in capitals at 11px (frame 20:1157).\n */\n .label {\n display: block;\n font-family: var(--impakt-field-label-font, ${t.fontBody});\n font-size: var(--impakt-field-label-size, ${fontSize('sm')});\n font-weight: var(--impakt-field-label-weight, ${fontWeight('semibold')});\n letter-spacing: var(--impakt-field-label-tracking, normal);\n text-transform: var(--impakt-field-label-transform, none);\n line-height: ${lineHeight('normal')};\n margin-block-end: var(--impakt-field-label-space, ${space(1)});\n color: ${t.text};\n }\n /* The site's form label (20:1100): G2 Mono S, IBM Plex Mono medium at 11px, in capitals, 8px above the box (#66). */\n :host([look='site']) {\n --impakt-field-label-font: ${t.fontMono};\n --impakt-field-label-size: 0.6875rem;\n --impakt-field-label-weight: ${fontWeight('medium')};\n --impakt-field-label-tracking: 0.06em;\n --impakt-field-label-transform: uppercase;\n --impakt-field-label-space: ${space(2)};\n }\n .required {\n font-weight: ${fontWeight('regular')};\n color: ${t.textMuted};\n }\n .description {\n font-size: ${fontSize('sm')};\n line-height: ${lineHeight('normal')};\n color: ${t.textMuted};\n margin-block-end: ${space(2)};\n }\n .error {\n font-size: ${fontSize('sm')};\n line-height: ${lineHeight('normal')};\n color: ${t.dangerText};\n margin-block-start: ${space(1)};\n display: flex;\n gap: ${space(1)};\n }\n .error:empty {\n display: none;\n }\n .visually-hidden {\n ${visuallyHidden}\n }\n /*\n * Only the control is dimmed. Dimming the whole host took the question,\n * the hint and the error below 4.5:1, and a disabled field still has to\n * say what it is and why it cannot be changed. The native disabled\n * control itself is exempt from the contrast criterion.\n */\n :host([disabled]) :is(input, select, textarea, button) {\n opacity: 0.6;\n cursor: not-allowed;\n }\n `,\n ];\n\n protected get controlId(): string {\n return this.id_('control');\n }\n\n /**\n * What the control points `aria-describedby` at.\n *\n * The error id is included only while there is an error. A describedby that\n * always names an empty element trains a screen-reader user to expect\n * nothing after the description, and then the one time it matters they have\n * already learned to ignore it.\n */\n protected get describedBy(): string | typeof nothing {\n const ids = [this.description ? this.id_('description') : '', this.error ? this.id_('error') : ''].filter(Boolean);\n return ids.length ? ids.join(' ') : nothing;\n }\n\n /**\n * Focusing the element focuses its control, so `el.focus()` from an app, a\n * React ref or the error summary's link lands where someone can type, rather\n * than on a host that cannot take focus and so silently does nothing.\n */\n focus(options?: FocusOptions): void {\n const control =\n this.renderRoot?.querySelector<HTMLElement>(`#${this.controlId}`) ?? this.renderRoot?.querySelector<HTMLElement>('input, select, textarea, button');\n if (control) control.focus(options);\n else super.focus(options);\n }\n\n /** Subclasses render the control itself; everything round it is here. */\n protected abstract renderControl(): TemplateResult;\n\n /**\n * `<label for>` by default. A group of controls — radios, checkboxes —\n * cannot use one, because `for` names a single control, so those override\n * this and render a `<fieldset>` and `<legend>` instead.\n */\n protected renderLabel(): TemplateResult {\n return html`\n <label class=\"label\" for=${this.controlId} part=\"label\">\n ${this.label}${this.required ? html`<span class=\"required\"> (${this.requiredText})</span>` : nothing}\n </label>\n `;\n }\n\n render(): TemplateResult {\n return html`\n ${this.renderLabel()}\n ${\n this.description\n ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">\n ${this.description}\n </div>`\n : nothing\n }\n ${this.renderControl()}\n <!--\n The error region is always present, even when empty. A live region\n inserted at the same moment as its content is announced unreliably\n across screen readers; one that already exists and is then filled is\n announced consistently. \"polite\" rather than \"assertive\" because a\n validation message should not interrupt what is being read.\n -->\n <div\n class=\"error\"\n id=${this.id_('error')}\n part=\"error\"\n aria-live=\"polite\"\n >\n ${this.error || nothing}\n </div>\n `;\n }\n\n /** Keep the form value in step with the control. */\n protected setFormValue(value: string): void {\n this.value = value;\n this.internals?.setFormValue(value);\n this.dispatchEvent(new CustomEvent('impakt-change', { detail: this.changeDetail(value), bubbles: true, composed: true }));\n }\n\n /** What `impakt-change` carries. A control with more to say than its value adds it here. */\n protected changeDetail(value: string): { value: string } {\n return { value };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,SAAS,iBAAsD;AA0B5E,IAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBpB,IAAM,IAAI;AAAA,EACf,QAAQ,MAAM,gBAAgB,MAAM;AAAA,EACpC,cAAc,MAAM,uBAAuB,MAAM;AAAA,EACjD,eAAe,MAAM,wBAAwB,MAAM;AAAA,EACnD,YAAY,MAAM,qBAAqB,QAAQ;AAAA,EAC/C,QAAQ,MAAM,gBAAgB,KAAK;AAAA,EACnC,MAAM,MAAM,cAAc,IAAI;AAAA,EAC9B,WAAW,MAAM,oBAAoB,IAAI;AAAA,EACzC,WAAW,MAAM,oBAAoB,KAAK;AAC5C;AAOO,IAAM,eAAe,CAAC,aAAgC;AAC3D,QAAM,IAAI,UAAU,QAAQ;AAC5B,SAAO;AAAA,MACH,CAAC;AAAA;AAAA,wBAEiB,EAAE,MAAM;AAAA,iBACf,EAAE,YAAY,IAAI,EAAE,aAAa;AAAA;AAAA,mBAE/B,SAAS,IAAI,CAAC;AAAA,qBACZ,EAAE,UAAU;AAAA,eAClB,EAAE,IAAI;AAAA,sDACiC,E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AY,iBAAiB,EAAE,QAAQ,KAAK,aAAa,KAAK,GAAG,SAAS,MAAM,UAAU,KAAK,CAAC,CAAC;AAAA,EAC1H;AAAA;AAAA,EAGU,aAAa,OAAkC;AACvD,WAAO,EAAE,MAAM;AAAA,EACjB;AACF;","names":[]}
|
|
@@ -41,10 +41,11 @@ export type AppBarMenuItem = MenuItem & {
|
|
|
41
41
|
* `organisation-items`; or, when `signed-out`, a "Sign in" link in its place.
|
|
42
42
|
*
|
|
43
43
|
* **On a narrow screen the pages move to a second row** under the mark and
|
|
44
|
-
* the menus, the full width of the bar, and
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
44
|
+
* the menus, the full width of the bar, and the segmented track wraps onto
|
|
45
|
+
* another line when they still do not fit, so every page stays in sight at 390
|
|
46
|
+
* and at 320 (#64). Folding them away behind a button would hide where you
|
|
47
|
+
* are, and a row that scrolls hides the pages past the edge with no sign that
|
|
48
|
+
* they are there. The bar reflows to 320px without the page scrolling sideways.
|
|
48
49
|
*
|
|
49
50
|
* Figma: kit `33:361`, `33:365`; every tool screen, such as `36:431`, `36:642`,
|
|
50
51
|
* `37:420`, `37:591`, `39:468`, `39:603`, `39:746`, `53:674`, `53:801`; signed
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImpaktAppBar
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-DJLUWM3C.js";
|
|
4
4
|
import "../chunk-XX6JZW5N.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-VR543SMV.js";
|
|
6
6
|
import "../chunk-UNGAG44M.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-X57BTN6V.js";
|
|
8
8
|
import "../chunk-2YRTFWW2.js";
|
|
9
9
|
import "../chunk-5OYQZWP2.js";
|
|
10
10
|
import "../chunk-72WNCCDC.js";
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
ImpaktSlotPicker,
|
|
9
9
|
ImpaktToast,
|
|
10
10
|
pageWindow
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-VR543SMV.js";
|
|
12
12
|
import "../chunk-UNGAG44M.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-X57BTN6V.js";
|
|
14
14
|
import "../chunk-2YRTFWW2.js";
|
|
15
15
|
import "../chunk-5OYQZWP2.js";
|
|
16
16
|
import "../chunk-72WNCCDC.js";
|
|
@@ -31,6 +31,7 @@ export interface ChipOption {
|
|
|
31
31
|
* @icon checkbox
|
|
32
32
|
* @csspart chip - Each chip.
|
|
33
33
|
* @csspart fieldset - The fieldset.
|
|
34
|
+
* @cssprop --impakt-chip-group-gap - The space between the chips, 6px unless set; the estimator sets 8px, as its frame does (`10:547`).
|
|
34
35
|
*/
|
|
35
36
|
export declare class ImpaktChipGroup extends FieldElement {
|
|
36
37
|
static properties: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImpaktChipGroup
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-JX5RJRME.js";
|
|
4
4
|
import "../chunk-XX6JZW5N.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-X57BTN6V.js";
|
|
6
6
|
import "../chunk-72WNCCDC.js";
|
|
7
7
|
import "../chunk-JTCTQBAX.js";
|
|
8
8
|
export {
|
package/dist/components/chip.js
CHANGED
|
@@ -96,6 +96,10 @@ export declare class ImpaktAddressLookup extends FieldElement {
|
|
|
96
96
|
type: StringConstructor;
|
|
97
97
|
attribute: string;
|
|
98
98
|
};
|
|
99
|
+
look: {
|
|
100
|
+
type: StringConstructor;
|
|
101
|
+
reflect: boolean;
|
|
102
|
+
};
|
|
99
103
|
};
|
|
100
104
|
postcodeLabel: string;
|
|
101
105
|
findText: string;
|
|
@@ -226,6 +230,10 @@ export declare class ImpaktFileUpload extends FieldElement {
|
|
|
226
230
|
type: StringConstructor;
|
|
227
231
|
attribute: string;
|
|
228
232
|
};
|
|
233
|
+
look: {
|
|
234
|
+
type: StringConstructor;
|
|
235
|
+
reflect: boolean;
|
|
236
|
+
};
|
|
229
237
|
};
|
|
230
238
|
/** File types allowed, such as `.pdf,.jpg,.png`. Empty allows any. */
|
|
231
239
|
accept: string;
|
|
@@ -307,6 +315,10 @@ export declare class ImpaktMoneyInput extends FieldElement {
|
|
|
307
315
|
type: StringConstructor;
|
|
308
316
|
attribute: string;
|
|
309
317
|
};
|
|
318
|
+
look: {
|
|
319
|
+
type: StringConstructor;
|
|
320
|
+
reflect: boolean;
|
|
321
|
+
};
|
|
310
322
|
};
|
|
311
323
|
currency: string;
|
|
312
324
|
lowest: number | undefined;
|
|
@@ -381,6 +393,10 @@ export declare class ImpaktRangeInput extends FieldElement {
|
|
|
381
393
|
type: StringConstructor;
|
|
382
394
|
attribute: string;
|
|
383
395
|
};
|
|
396
|
+
look: {
|
|
397
|
+
type: StringConstructor;
|
|
398
|
+
reflect: boolean;
|
|
399
|
+
};
|
|
384
400
|
};
|
|
385
401
|
lowest: number;
|
|
386
402
|
highest: number;
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
ImpaktRangeInput,
|
|
7
7
|
ImpaktTaskList,
|
|
8
8
|
groupDigits
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-273AYERA.js";
|
|
10
10
|
import "../chunk-UNGAG44M.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-X57BTN6V.js";
|
|
12
12
|
import "../chunk-72WNCCDC.js";
|
|
13
13
|
import "../chunk-JTCTQBAX.js";
|
|
14
14
|
export {
|
|
@@ -5,6 +5,12 @@ export interface NavLink {
|
|
|
5
5
|
label: string;
|
|
6
6
|
href: string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Whether a link is the page the visitor is on, or a page above it. Given `current`, the href of
|
|
10
|
+
* the page as the page itself names it, only that link is the page; otherwise it is worked out
|
|
11
|
+
* from the address, and on a server, where there is no address, nothing is.
|
|
12
|
+
*/
|
|
13
|
+
export declare function linkCurrent(href: string, current?: string): 'page' | 'section' | null;
|
|
8
14
|
/**
|
|
9
15
|
* The site's main navigation: a row of links that folds into a Menu button
|
|
10
16
|
* when there is not room for all of them, whatever the screen.
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImpaktBreadcrumbs,
|
|
3
|
-
ImpaktNav
|
|
4
|
-
|
|
3
|
+
ImpaktNav,
|
|
4
|
+
linkCurrent
|
|
5
|
+
} from "../chunk-NCVBRUJM.js";
|
|
5
6
|
import "../chunk-5OYQZWP2.js";
|
|
6
7
|
import "../chunk-72WNCCDC.js";
|
|
7
8
|
import "../chunk-JTCTQBAX.js";
|
|
8
9
|
export {
|
|
9
10
|
ImpaktBreadcrumbs,
|
|
10
|
-
ImpaktNav
|
|
11
|
+
ImpaktNav,
|
|
12
|
+
linkCurrent
|
|
11
13
|
};
|
|
12
14
|
//# sourceMappingURL=navigation.js.map
|
package/dist/components/page.js
CHANGED
|
@@ -65,6 +65,10 @@ export declare class ImpaktSwitch extends FieldElement {
|
|
|
65
65
|
type: StringConstructor;
|
|
66
66
|
attribute: string;
|
|
67
67
|
};
|
|
68
|
+
look: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
reflect: boolean;
|
|
71
|
+
};
|
|
68
72
|
};
|
|
69
73
|
checked: boolean;
|
|
70
74
|
/** Keep the label for screen readers only, when the row around it already names the setting. */
|
|
@@ -143,6 +147,10 @@ export declare class ImpaktSegmentedControl extends FieldElement {
|
|
|
143
147
|
type: StringConstructor;
|
|
144
148
|
attribute: string;
|
|
145
149
|
};
|
|
150
|
+
look: {
|
|
151
|
+
type: StringConstructor;
|
|
152
|
+
reflect: boolean;
|
|
153
|
+
};
|
|
146
154
|
};
|
|
147
155
|
options: SegmentOption[];
|
|
148
156
|
/** Keep the question for screen readers only, when the words around it already ask it. */
|
|
@@ -70,6 +70,10 @@ export declare class ImpaktTextInput extends FieldElement {
|
|
|
70
70
|
type: StringConstructor;
|
|
71
71
|
attribute: string;
|
|
72
72
|
};
|
|
73
|
+
look: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
reflect: boolean;
|
|
76
|
+
};
|
|
73
77
|
};
|
|
74
78
|
/** `search` draws a search icon at the start and rounds the field, as a search box. */
|
|
75
79
|
type: 'text' | 'email' | 'tel' | 'number' | 'password' | 'date' | 'search';
|
package/dist/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export { ImpaktGrid } from './components/grid';
|
|
|
38
38
|
export { ImpaktHelp, type HelpKind } from './components/help';
|
|
39
39
|
export { ImpaktPage, ImpaktSection } from './components/page';
|
|
40
40
|
export { ImpaktIcon, ICONS, ICON_NAMES, iconSvg, type IconName } from './components/icon';
|
|
41
|
-
export { ImpaktNav, ImpaktBreadcrumbs, type NavLink } from './components/navigation';
|
|
41
|
+
export { ImpaktNav, ImpaktBreadcrumbs, linkCurrent, type NavLink } from './components/navigation';
|
|
42
42
|
export { ImpaktDivider, ImpaktSpacer, ImpaktVisuallyHidden, ImpaktTabs, type TabItem } from './components/blocks';
|
|
43
43
|
export { ImpaktFieldset } from './components/fieldset';
|
|
44
44
|
export { ImpaktDrawer, ImpaktToast, ImpaktMenu, ImpaktPagination, ImpaktAvatar, ImpaktAvatarGroup, ImpaktEmptyState, ImpaktSlotPicker, type MenuItem, type AvatarItem, type SlotDay, } from './components/app-ui';
|