@atomic-ui/ui 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +9839 -6255
- package/dist/base/FieldElement.d.ts +10 -3
- package/dist/{chunk-YWP2Z3JN.js → chunk-2TNF7O43.js} +7 -5
- package/dist/{chunk-YWP2Z3JN.js.map → chunk-2TNF7O43.js.map} +1 -1
- package/dist/{chunk-FKUBEVCU.js → chunk-2WHOBIOY.js} +11 -9
- package/dist/{chunk-FKUBEVCU.js.map → chunk-2WHOBIOY.js.map} +1 -1
- package/dist/{chunk-26BO3W56.js → chunk-3BWCD5U5.js} +5 -3
- package/dist/{chunk-26BO3W56.js.map → chunk-3BWCD5U5.js.map} +1 -1
- package/dist/chunk-3GPGDERO.js +201 -0
- package/dist/chunk-3GPGDERO.js.map +1 -0
- package/dist/{chunk-3T7J66Z2.js → chunk-3KAFK24X.js} +13 -11
- package/dist/chunk-3KAFK24X.js.map +1 -0
- package/dist/{chunk-5OJAJA3U.js → chunk-5HCWL2YD.js} +6 -4
- package/dist/{chunk-5OJAJA3U.js.map → chunk-5HCWL2YD.js.map} +1 -1
- package/dist/{chunk-AG4EP3OY.js → chunk-5IGBH4GL.js} +8 -6
- package/dist/{chunk-AG4EP3OY.js.map → chunk-5IGBH4GL.js.map} +1 -1
- package/dist/{chunk-AL4IUSML.js → chunk-5OYQZWP2.js} +5 -3
- package/dist/{chunk-AL4IUSML.js.map → chunk-5OYQZWP2.js.map} +1 -1
- package/dist/chunk-5PRB7P7N.js +167 -0
- package/dist/chunk-5PRB7P7N.js.map +1 -0
- package/dist/chunk-6CDQSHVW.js +21 -0
- package/dist/chunk-6CDQSHVW.js.map +1 -0
- package/dist/{chunk-MLKNZL5J.js → chunk-6J22I7F6.js} +14 -12
- package/dist/chunk-6J22I7F6.js.map +1 -0
- package/dist/chunk-72WNCCDC.js +136 -0
- package/dist/chunk-72WNCCDC.js.map +1 -0
- package/dist/chunk-7UI3OBXL.js +104 -0
- package/dist/chunk-7UI3OBXL.js.map +1 -0
- package/dist/{chunk-D6NET2VB.js → chunk-ALFE35FS.js} +30 -3
- package/dist/chunk-ALFE35FS.js.map +1 -0
- package/dist/chunk-AYINRYNC.js +184 -0
- package/dist/chunk-AYINRYNC.js.map +1 -0
- package/dist/{chunk-2D2IMQII.js → chunk-BAITBJUC.js} +51 -29
- package/dist/chunk-BAITBJUC.js.map +1 -0
- package/dist/{chunk-2EP3IV3G.js → chunk-BGHAANTP.js} +22 -8
- package/dist/chunk-BGHAANTP.js.map +1 -0
- package/dist/{chunk-OJO62KRX.js → chunk-CFCFKLTN.js} +85 -10
- package/dist/chunk-CFCFKLTN.js.map +1 -0
- package/dist/{chunk-UFPI4I2Y.js → chunk-CQT3VPYK.js} +8 -29
- package/dist/chunk-CQT3VPYK.js.map +1 -0
- package/dist/{chunk-AURT72IC.js → chunk-DXLEYNID.js} +13 -7
- package/dist/chunk-DXLEYNID.js.map +1 -0
- package/dist/{chunk-L4CIBOGK.js → chunk-EKPTMRBG.js} +5 -3
- package/dist/{chunk-L4CIBOGK.js.map → chunk-EKPTMRBG.js.map} +1 -1
- package/dist/{chunk-7UWJXPR3.js → chunk-F3NHPQU5.js} +17 -36
- package/dist/chunk-F3NHPQU5.js.map +1 -0
- package/dist/{chunk-Z2EWQMTR.js → chunk-F4IXELLK.js} +5 -3
- package/dist/{chunk-Z2EWQMTR.js.map → chunk-F4IXELLK.js.map} +1 -1
- package/dist/{chunk-APQEXM4I.js → chunk-FJHPGOGS.js} +5 -3
- package/dist/{chunk-APQEXM4I.js.map → chunk-FJHPGOGS.js.map} +1 -1
- package/dist/chunk-FLAUZU7Y.js +345 -0
- package/dist/chunk-FLAUZU7Y.js.map +1 -0
- package/dist/{chunk-3NEWOO2P.js → chunk-FZWUQC42.js} +7 -5
- package/dist/{chunk-3NEWOO2P.js.map → chunk-FZWUQC42.js.map} +1 -1
- package/dist/{chunk-ONED3PUB.js → chunk-HSXLSJVG.js} +54 -8
- package/dist/chunk-HSXLSJVG.js.map +1 -0
- package/dist/{chunk-V7EB7Q2M.js → chunk-JTCTQBAX.js} +2 -131
- package/dist/chunk-JTCTQBAX.js.map +1 -0
- package/dist/{chunk-ZL3JFUIE.js → chunk-K5QFVLCI.js} +7 -5
- package/dist/{chunk-ZL3JFUIE.js.map → chunk-K5QFVLCI.js.map} +1 -1
- package/dist/{chunk-DN5YZFSG.js → chunk-KE6WCXQP.js} +55 -9
- package/dist/chunk-KE6WCXQP.js.map +1 -0
- package/dist/chunk-LBHTXY7K.js +75 -0
- package/dist/chunk-LBHTXY7K.js.map +1 -0
- package/dist/{chunk-OZGKK3N5.js → chunk-LP4RTYTL.js} +88 -9
- package/dist/chunk-LP4RTYTL.js.map +1 -0
- package/dist/{chunk-MOO63SHZ.js → chunk-LXVPWTSY.js} +80 -23
- package/dist/chunk-LXVPWTSY.js.map +1 -0
- package/dist/{chunk-JNLKM3JT.js → chunk-N6EEW2GF.js} +6 -4
- package/dist/{chunk-JNLKM3JT.js.map → chunk-N6EEW2GF.js.map} +1 -1
- package/dist/chunk-NHEU5FT6.js +115 -0
- package/dist/chunk-NHEU5FT6.js.map +1 -0
- package/dist/chunk-P3BPW446.js +294 -0
- package/dist/chunk-P3BPW446.js.map +1 -0
- package/dist/chunk-QPOM7W3D.js +104 -0
- package/dist/chunk-QPOM7W3D.js.map +1 -0
- package/dist/{chunk-FU3CEHBS.js → chunk-R6PBY3YN.js} +6 -4
- package/dist/{chunk-FU3CEHBS.js.map → chunk-R6PBY3YN.js.map} +1 -1
- package/dist/{chunk-TJOYBDKS.js → chunk-R6YMSJR7.js} +65 -36
- package/dist/chunk-R6YMSJR7.js.map +1 -0
- package/dist/{chunk-ZEIV5X3U.js → chunk-SOYKSPPX.js} +73 -23
- package/dist/chunk-SOYKSPPX.js.map +1 -0
- package/dist/{chunk-NKMJMVZP.js → chunk-T52CUOCJ.js} +5 -3
- package/dist/{chunk-NKMJMVZP.js.map → chunk-T52CUOCJ.js.map} +1 -1
- package/dist/chunk-UFENSIWD.js +135 -0
- package/dist/chunk-UFENSIWD.js.map +1 -0
- package/dist/{chunk-A4M3A4SZ.js → chunk-UYTIJCCW.js} +10 -42
- package/dist/chunk-UYTIJCCW.js.map +1 -0
- package/dist/chunk-XX6JZW5N.js +36 -0
- package/dist/chunk-XX6JZW5N.js.map +1 -0
- package/dist/{chunk-2ZF3J7OO.js → chunk-XXSZL5CY.js} +17 -5
- package/dist/chunk-XXSZL5CY.js.map +1 -0
- package/dist/{chunk-6PMA6NHE.js → chunk-Y55FNQHS.js} +5 -3
- package/dist/{chunk-6PMA6NHE.js.map → chunk-Y55FNQHS.js.map} +1 -1
- package/dist/chunk-ZAWGJC4I.js +176 -0
- package/dist/chunk-ZAWGJC4I.js.map +1 -0
- package/dist/chunk-ZUQ3DOG2.js +110 -0
- package/dist/chunk-ZUQ3DOG2.js.map +1 -0
- package/dist/components/accordion.d.ts +22 -0
- package/dist/components/accordion.js +6 -2
- package/dist/components/alert.d.ts +22 -1
- package/dist/components/alert.js +3 -2
- package/dist/components/app-bar.d.ts +153 -0
- package/dist/components/app-bar.js +15 -0
- package/dist/components/app-bar.js.map +1 -0
- package/dist/components/app-ui.d.ts +29 -2
- package/dist/components/app-ui.js +5 -4
- package/dist/components/badge.d.ts +17 -1
- package/dist/components/badge.js +4 -3
- package/dist/components/blocks.js +5 -4
- package/dist/components/button.d.ts +18 -2
- package/dist/components/button.js +4 -3
- package/dist/components/checkbox-group.js +4 -3
- package/dist/components/checkbox.js +4 -3
- package/dist/components/checked.d.ts +77 -0
- package/dist/components/checked.js +10 -0
- package/dist/components/checked.js.map +1 -0
- package/dist/components/chip-group.d.ts +113 -0
- package/dist/components/chip-group.js +11 -0
- package/dist/components/chip-group.js.map +1 -0
- package/dist/components/chip.d.ts +11 -0
- package/dist/components/chip.js +3 -2
- package/dist/components/code-diff.d.ts +77 -0
- package/dist/components/code-diff.js +10 -0
- package/dist/components/code-diff.js.map +1 -0
- package/dist/components/date-input.js +4 -3
- package/dist/components/dialog.d.ts +15 -0
- package/dist/components/dialog.js +3 -2
- package/dist/components/fieldset.js +3 -2
- package/dist/components/grid.js +3 -2
- package/dist/components/help.js +3 -2
- package/dist/components/icon.js +3 -2
- package/dist/components/journey.js +4 -3
- package/dist/components/language-switch.d.ts +59 -0
- package/dist/components/language-switch.js +10 -0
- package/dist/components/language-switch.js.map +1 -0
- package/dist/components/layout.d.ts +8 -2
- package/dist/components/layout.js +3 -2
- package/dist/components/link.js +4 -3
- package/dist/components/list.js +3 -2
- package/dist/components/media.js +3 -2
- package/dist/components/meter.d.ts +112 -0
- package/dist/components/meter.js +13 -0
- package/dist/components/meter.js.map +1 -0
- package/dist/components/navigation.d.ts +52 -0
- package/dist/components/navigation.js +4 -3
- package/dist/components/page.d.ts +13 -8
- package/dist/components/page.js +3 -2
- package/dist/components/price.js +3 -2
- package/dist/components/progress.d.ts +16 -2
- package/dist/components/progress.js +3 -2
- package/dist/components/radio-group.js +4 -3
- package/dist/components/redaction.d.ts +51 -0
- package/dist/components/redaction.js +10 -0
- package/dist/components/redaction.js.map +1 -0
- package/dist/components/rows.d.ts +28 -0
- package/dist/components/rows.js +7 -3
- package/dist/components/select.js +4 -3
- package/dist/components/shell.js +4 -3
- package/dist/components/source.d.ts +68 -0
- package/dist/components/source.js +10 -0
- package/dist/components/source.js.map +1 -0
- package/dist/components/status-pill-style.d.ts +16 -0
- package/dist/components/status-pill-style.js +15 -0
- package/dist/components/status-pill-style.js.map +1 -0
- package/dist/components/status.d.ts +66 -0
- package/dist/components/status.js +10 -0
- package/dist/components/status.js.map +1 -0
- package/dist/components/summary-list.js +3 -2
- package/dist/components/switch.js +4 -3
- package/dist/components/table.d.ts +19 -0
- package/dist/components/table.js +4 -3
- package/dist/components/text-input.js +5 -4
- package/dist/components/textarea.d.ts +5 -0
- package/dist/components/textarea.js +4 -3
- package/dist/components/tool-card.d.ts +107 -0
- package/dist/components/tool-card.js +11 -0
- package/dist/components/tool-card.js.map +1 -0
- package/dist/components/tool-kit-tokens.d.ts +25 -0
- package/dist/components/tool-kit-tokens.js +8 -0
- package/dist/components/tool-kit-tokens.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +116 -70
- package/dist/standalone/atomic-ui.js +2047 -733
- package/dist/standalone/atomic-ui.js.map +4 -4
- package/package.json +2 -2
- package/dist/chunk-2D2IMQII.js.map +0 -1
- package/dist/chunk-2EP3IV3G.js.map +0 -1
- package/dist/chunk-2ZF3J7OO.js.map +0 -1
- package/dist/chunk-3T7J66Z2.js.map +0 -1
- package/dist/chunk-7UWJXPR3.js.map +0 -1
- package/dist/chunk-A4M3A4SZ.js.map +0 -1
- package/dist/chunk-AURT72IC.js.map +0 -1
- package/dist/chunk-AYKYHZGQ.js +0 -108
- package/dist/chunk-AYKYHZGQ.js.map +0 -1
- package/dist/chunk-D6NET2VB.js.map +0 -1
- package/dist/chunk-DN5YZFSG.js.map +0 -1
- package/dist/chunk-MLKNZL5J.js.map +0 -1
- package/dist/chunk-MOO63SHZ.js.map +0 -1
- package/dist/chunk-OJO62KRX.js.map +0 -1
- package/dist/chunk-ONED3PUB.js.map +0 -1
- package/dist/chunk-OZGKK3N5.js.map +0 -1
- package/dist/chunk-QU3U2CS2.js +0 -144
- package/dist/chunk-QU3U2CS2.js.map +0 -1
- package/dist/chunk-TJOYBDKS.js.map +0 -1
- package/dist/chunk-UFPI4I2Y.js.map +0 -1
- package/dist/chunk-V7EB7Q2M.js.map +0 -1
- package/dist/chunk-ZEIV5X3U.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/alert.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { fontSize, fontWeight, space, t, token } from '../base/tokens';\n\nexport type AlertTone = 'info' | 'success' | 'warning' | 'danger' | 'attention';\n\n/**\n * A notice.\n *\n * **The role depends on the tone, and that is a real distinction.** `alert`\n * interrupts whatever a screen reader is saying; `status` waits for a pause.\n * A failed payment earns the interruption. \"Your basket has been saved\" does\n * not, and using `alert` for it is how users learn to tune the live region\n * out — at which point the one that mattered is also lost.\n *\n * **The tone is never carried by colour alone.** Each tone ships a word, in\n * the accessible name, because 1.4.1 Use of Colour says a red border is not a\n * message and because a red border is invisible in forced-colours mode.\n\n *\n * **`attention` is the one yellow notice in a tool.** Inside a product yellow\n * means \"this needs your attention\" and nothing else, so this tone is the\n * accent as a fill with a 1px ink border, a solid ink label before the words\n * (`label`, \"Check\" unless set) and room at the end for one ink action, such\n * as \"Claim £252 instead\" (G2 frames 33:494, 37:452, 37:492, 45:657). The\n * label is visible text and is read with the words.\n *\n * @category feedback\n * @icon alert\n * @slot - The body of the notice.\n * @slot actions - An action at the end of an attention notice, such as an ink button.\n */\nexport class ImpaktAlert extends ImpaktElement {\n static properties = {\n tone: { type: String, reflect: true },\n heading: { type: String },\n toneLabel: { type: String, attribute: 'tone-label' },\n label: { type: String },\n noLabel: { type: Boolean, attribute: 'no-label' },\n };\n\n declare tone: AlertTone;\n declare heading: string;\n /** Overrides the default word for the tone, for translation. */\n declare toneLabel: string;\n /** The solid label an attention notice starts with. \"Check\" when empty. */\n declare label: string;\n /** Leaves the solid label off an attention notice, when its words already say what needs doing. */\n declare noLabel: boolean;\n\n constructor() {\n super();\n this.tone = 'info';\n this.heading = '';\n this.toneLabel = '';\n this.label = '';\n this.noLabel = false;\n }\n\n private static readonly TONE_WORDS: Record<AlertTone, string> = {\n info: 'Information',\n success: 'Success',\n warning: 'Warning',\n danger: 'Error',\n attention: 'Warning',\n };\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host {\n display: block;\n margin-block-end: ${space(4)};\n }\n .alert {\n padding: ${space(4)} ${space(5)};\n border-radius: ${t.radiusLg};\n border-inline-start: 4px solid;\n box-shadow: inset 0 0 0 1px ${t.hairline};\n font-size: ${fontSize('sm')};\n line-height: 1.5;\n }\n .heading {\n font-weight: ${fontWeight('semibold')};\n margin-block-end: ${space(1)};\n }\n :host([tone='info']) .alert {\n background: ${t.infoSubtle};\n border-color: ${t.info};\n color: ${t.text};\n }\n :host([tone='success']) .alert {\n background: ${t.successSubtle};\n border-color: ${t.success};\n color: ${t.text};\n }\n :host([tone='warning']) .alert {\n background: ${t.warningSubtle};\n border-color: ${t.warning};\n color: ${t.text};\n }\n :host([tone='danger']) .alert {\n background: ${t.dangerSubtle};\n border-color: ${t.danger};\n color: ${t.text};\n }\n /* Attention: the accent as a fill, an ink border, a solid ink label and an action at the end. */\n :host([tone='attention']) .alert {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: ${space(3)};\n padding: ${space(3.5)} ${space(4)};\n border: ${t.borderThin} solid ${token('color.accent.on', '#111111')};\n border-radius: ${t.radius};\n box-shadow: none;\n background: ${token('color.accent.default', '#ffd43b')};\n color: ${token('color.accent.on', '#111111')};\n font-size: ${fontSize('md')};\n line-height: 1.4;\n /* What sits on the yellow is drawn in the ink, whatever the band round it says. */\n --impakt-color-text-default: ${token('color.accent.on', '#111111')};\n --impakt-color-text-inverse: ${token('color.accent.default', '#ffd43b')};\n }\n .tag {\n flex: none;\n padding: 3px ${space(2)};\n font-family: ${t.fontMono};\n font-size: ${fontSize('sm')};\n line-height: 1.3;\n background: ${token('color.accent.on', '#111111')};\n color: ${token('color.accent.default', '#ffd43b')};\n }\n .words {\n flex: 1 1 16rem;\n min-inline-size: 0;\n }\n .actions {\n flex: none;\n display: flex;\n flex-wrap: wrap;\n gap: ${space(2)};\n margin-inline-start: auto;\n }\n .actions.empty {\n display: none;\n }\n /* Colour is the only signal left in forced-colours mode, and it is gone.\n The border keeps the boundary; the tone word in the label carries the\n meaning. */\n @media (forced-colors: active) {\n .alert {\n border: 1px solid CanvasText;\n border-inline-start-width: 4px;\n }\n }\n `,\n ];\n\n private hasActions = false;\n\n private onActions(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n this.hasActions = slot.assignedElements({ flatten: true }).length > 0;\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n if (this.tone === 'attention') {\n const tag = this.label || say('Check');\n return html`\n <div class=\"alert\" part=\"alert\" role=\"status\">\n ${this.noLabel ? nothing : html`<span class=\"tag\" part=\"label\">${tag}</span>`}\n <div class=\"words\" part=\"body\">\n ${this.heading ? html`<div class=\"heading\" part=\"heading\">${this.heading}</div>` : nothing}\n <slot></slot>\n </div>\n <div class=\"actions ${this.hasActions ? '' : 'empty'}\" part=\"actions\"><slot name=\"actions\" @slotchange=${this.onActions}></slot></div>\n </div>\n `;\n }\n const word = this.toneLabel || say(ImpaktAlert.TONE_WORDS[this.tone]);\n return html`\n <div\n class=\"alert\"\n part=\"alert\"\n role=${this.tone === 'danger' ? 'alert' : 'status'}\n aria-label=${this.heading ? nothing : word}\n >\n ${\n this.heading\n ? html`<div class=\"heading\" part=\"heading\">\n <span class=\"tone-word\">${word}:</span> ${this.heading}\n </div>`\n : nothing\n }\n <slot></slot>\n </div>\n `;\n }\n}\n\ncustomElements.define('impakt-alert', ImpaktAlert);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-alert': ImpaktAlert;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAiCjD,IAAM,cAAN,MAAM,qBAAoB,cAAc;AAAA,EAkB7C,cAAc;AACZ,UAAM;AA4GR,SAAQ,aAAa;AA3GnB,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,YAAY;AACjB,SAAK,QAAQ;AACb,SAAK,UAAU;AAAA,EACjB;AAAA,EAxBA;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,WAAW,EAAE,MAAM,QAAQ,WAAW,aAAa;AAAA,MACnD,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,SAAS,EAAE,MAAM,SAAS,WAA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names":[]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {
|
|
2
|
+
kit
|
|
3
|
+
} from "./chunk-XX6JZW5N.js";
|
|
4
|
+
import {
|
|
5
|
+
ImpaktElement
|
|
6
|
+
} from "./chunk-72WNCCDC.js";
|
|
7
|
+
import {
|
|
8
|
+
space,
|
|
9
|
+
t
|
|
10
|
+
} from "./chunk-JTCTQBAX.js";
|
|
11
|
+
|
|
12
|
+
// packages/ui/src/components/status.ts
|
|
13
|
+
import { css, html, nothing } from "lit";
|
|
14
|
+
var ImpaktStatus = class extends ImpaktElement {
|
|
15
|
+
static {
|
|
16
|
+
this.properties = {
|
|
17
|
+
tone: { type: String, reflect: true },
|
|
18
|
+
label: { type: String },
|
|
19
|
+
size: { type: String, reflect: true },
|
|
20
|
+
live: { type: Boolean, reflect: true }
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.tone = "neutral";
|
|
26
|
+
this.label = "";
|
|
27
|
+
this.size = "tool";
|
|
28
|
+
this.live = false;
|
|
29
|
+
}
|
|
30
|
+
static {
|
|
31
|
+
this.styles = [
|
|
32
|
+
...ImpaktElement.styles,
|
|
33
|
+
css`
|
|
34
|
+
/* A short pill stays on one line; a long one wraps inside its border rather than pushing the page sideways at 320 (1.4.10). */
|
|
35
|
+
:host {
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
flex: 0 1 auto;
|
|
38
|
+
min-inline-size: 0;
|
|
39
|
+
max-inline-size: 100%;
|
|
40
|
+
vertical-align: middle;
|
|
41
|
+
}
|
|
42
|
+
.pill {
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: ${space(1.5)};
|
|
46
|
+
padding: 3px ${space(2)};
|
|
47
|
+
font-family: ${t.fontMono};
|
|
48
|
+
font-size: ${kit.small};
|
|
49
|
+
font-weight: ${kit.medium};
|
|
50
|
+
line-height: 1.3;
|
|
51
|
+
overflow-wrap: anywhere;
|
|
52
|
+
color: ${t.text};
|
|
53
|
+
background: ${t.surfaceCard};
|
|
54
|
+
border: 1px solid ${t.text};
|
|
55
|
+
border-radius: 0;
|
|
56
|
+
}
|
|
57
|
+
.dot {
|
|
58
|
+
flex: none;
|
|
59
|
+
inline-size: 7px;
|
|
60
|
+
block-size: 7px;
|
|
61
|
+
border-radius: 50%;
|
|
62
|
+
background: currentColor;
|
|
63
|
+
}
|
|
64
|
+
:host([tone='ok']) .dot {
|
|
65
|
+
background: ${kit.ok};
|
|
66
|
+
}
|
|
67
|
+
:host([tone='bad']) .dot {
|
|
68
|
+
background: ${kit.bad};
|
|
69
|
+
}
|
|
70
|
+
:host([tone='warn']) .dot {
|
|
71
|
+
background: ${kit.accent};
|
|
72
|
+
border: 1px solid ${t.text};
|
|
73
|
+
}
|
|
74
|
+
:host([tone='solid']) .pill {
|
|
75
|
+
color: ${kit.onInverse};
|
|
76
|
+
background: ${kit.inverse};
|
|
77
|
+
border-color: ${kit.inverse};
|
|
78
|
+
}
|
|
79
|
+
:host([size='marketing']) .pill {
|
|
80
|
+
font-size: ${kit.tiny};
|
|
81
|
+
text-transform: uppercase;
|
|
82
|
+
letter-spacing: 0.06em;
|
|
83
|
+
}
|
|
84
|
+
@media (forced-colors: active) {
|
|
85
|
+
.dot {
|
|
86
|
+
background: CanvasText;
|
|
87
|
+
forced-color-adjust: none;
|
|
88
|
+
}
|
|
89
|
+
.pill {
|
|
90
|
+
border-color: CanvasText;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
`
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
get hasDot() {
|
|
97
|
+
return this.tone === "ok" || this.tone === "bad" || this.tone === "warn" || this.tone === "info";
|
|
98
|
+
}
|
|
99
|
+
render() {
|
|
100
|
+
return html`<span class="pill" part="pill" role=${this.live ? "status" : nothing}
|
|
101
|
+
>${this.hasDot ? html`<span class="dot" part="dot" aria-hidden="true"></span>` : nothing}<span class="text"><slot>${this.label}</slot></span></span
|
|
102
|
+
>`;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
customElements.define("impakt-status", ImpaktStatus);
|
|
106
|
+
|
|
107
|
+
export {
|
|
108
|
+
ImpaktStatus
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=chunk-ZUQ3DOG2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/status.ts"],"sourcesContent":["/**\n * The status pill of the AI tools: a word, with a dot that supports it.\n */\nimport { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { space, t } from '../base/tokens';\nimport { kit } from './tool-kit-tokens';\n\nexport type StatusTone = 'ok' | 'bad' | 'warn' | 'info' | 'neutral' | 'solid';\n\n/**\n * A short status, such as \"Done\", \"Failed\", \"Check\" or \"Waiting\".\n *\n * **The word carries the status; the dot only supports it.** Green is done, red\n * has failed, yellow needs your attention, ink is information, and a pill with\n * no dot is waiting or neutral. The dot is hidden from assistive technology, so\n * a screen reader hears the word and nothing else, and a person who cannot tell\n * the colours apart reads the same word everyone else does.\n *\n * It is not a live region. A status that changes while someone is on the page,\n * such as a check that finishes, sets `live`, which gives it `role=\"status\"` so\n * the new word is announced.\n *\n * `size=\"marketing\"` is the badge on the marketing site: uppercase, 11px and\n * tracked out. Inside a tool, pills stay in sentence case.\n *\n * Figma: kit `33:419`; on every tool screen, such as `36:430`, `37:590` and `39:460`.\n *\n * @category feedback\n * @icon badge\n * @slot - The word. Overrides `label`.\n * @csspart pill - The pill.\n * @csspart dot - The dot.\n */\nexport class ImpaktStatus extends ImpaktElement {\n static properties = {\n tone: { type: String, reflect: true },\n label: { type: String },\n size: { type: String, reflect: true },\n live: { type: Boolean, reflect: true },\n };\n\n /** `ok` done, `bad` failed, `warn` needs attention, `info`, `neutral` (no dot) or `solid` (an ink pill, no dot). */\n declare tone: StatusTone;\n /** The word, when it is not given in the slot. */\n declare label: string;\n /** `tool` is sentence case at 14px; `marketing` is the uppercase 11px badge. */\n declare size: 'tool' | 'marketing';\n /** Announce a change of word, for a status that updates while someone is on the page. */\n declare live: boolean;\n\n constructor() {\n super();\n this.tone = 'neutral';\n this.label = '';\n this.size = 'tool';\n this.live = false;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n /* A short pill stays on one line; a long one wraps inside its border rather than pushing the page sideways at 320 (1.4.10). */\n :host {\n display: inline-flex;\n flex: 0 1 auto;\n min-inline-size: 0;\n max-inline-size: 100%;\n vertical-align: middle;\n }\n .pill {\n display: inline-flex;\n align-items: center;\n gap: ${space(1.5)};\n padding: 3px ${space(2)};\n font-family: ${t.fontMono};\n font-size: ${kit.small};\n font-weight: ${kit.medium};\n line-height: 1.3;\n overflow-wrap: anywhere;\n color: ${t.text};\n background: ${t.surfaceCard};\n border: 1px solid ${t.text};\n border-radius: 0;\n }\n .dot {\n flex: none;\n inline-size: 7px;\n block-size: 7px;\n border-radius: 50%;\n background: currentColor;\n }\n :host([tone='ok']) .dot {\n background: ${kit.ok};\n }\n :host([tone='bad']) .dot {\n background: ${kit.bad};\n }\n :host([tone='warn']) .dot {\n background: ${kit.accent};\n border: 1px solid ${t.text};\n }\n :host([tone='solid']) .pill {\n color: ${kit.onInverse};\n background: ${kit.inverse};\n border-color: ${kit.inverse};\n }\n :host([size='marketing']) .pill {\n font-size: ${kit.tiny};\n text-transform: uppercase;\n letter-spacing: 0.06em;\n }\n @media (forced-colors: active) {\n .dot {\n background: CanvasText;\n forced-color-adjust: none;\n }\n .pill {\n border-color: CanvasText;\n }\n }\n `,\n ];\n\n private get hasDot(): boolean {\n return this.tone === 'ok' || this.tone === 'bad' || this.tone === 'warn' || this.tone === 'info';\n }\n\n render(): TemplateResult {\n return html`<span class=\"pill\" part=\"pill\" role=${this.live ? 'status' : nothing}\n >${this.hasDot ? html`<span class=\"dot\" part=\"dot\" aria-hidden=\"true\"></span>` : nothing}<span class=\"text\"><slot>${this.label}</slot></span></span\n >`;\n }\n}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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAc3B;AAAA;AAAA,EAEA,IAAY,SAAkB;AAC5B,WAAO,KAAK,SAAS,QAAQ,KAAK,SAAS,SAAS,KAAK,SAAS,UAAU,KAAK,SAAS;AAAA,EAC5F;AAAA,EAEA,SAAyB;AACvB,WAAO,2CAA2C,KAAK,OAAO,WAAW,OAAO;AAAA,SAC3E,KAAK,SAAS,gEAAgE,OAAO,4BAA4B,KAAK,KAAK;AAAA;AAAA,EAElI;AACF;AAEA,eAAe,OAAO,iBAAiB,YAAY;","names":[]}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { type TemplateResult } from 'lit';
|
|
2
2
|
import { ImpaktElement } from '../base/ImpaktElement';
|
|
3
|
+
import { type StatusTone } from './status-pill-style';
|
|
3
4
|
export interface AccordionItem {
|
|
4
5
|
id: string;
|
|
5
6
|
heading: string;
|
|
6
7
|
body: string;
|
|
8
|
+
/** A short code before the heading, in the code face, such as "01" or "WCAG 1.4.3". It is part of the button's name. */
|
|
9
|
+
meta?: string;
|
|
10
|
+
/** A status after the heading, drawn as a pill, such as "Fixed". It is outside the button, so its name stays the question. */
|
|
11
|
+
status?: string;
|
|
12
|
+
/** The status's tone. */
|
|
13
|
+
statusTone?: StatusTone;
|
|
14
|
+
/** More pills after the status, such as "Found by the model" or "WCAG 1.1.1". Each one is words, so none rests on its dot. */
|
|
15
|
+
tags?: Array<{
|
|
16
|
+
label: string;
|
|
17
|
+
tone?: StatusTone;
|
|
18
|
+
}>;
|
|
7
19
|
}
|
|
8
20
|
/**
|
|
9
21
|
* Disclosure sections — frequently asked questions, "what does this mean?".
|
|
@@ -53,6 +65,10 @@ export declare class ImpaktAccordion extends ImpaktElement {
|
|
|
53
65
|
multiple: {
|
|
54
66
|
type: BooleanConstructor;
|
|
55
67
|
};
|
|
68
|
+
look: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
reflect: boolean;
|
|
71
|
+
};
|
|
56
72
|
enhanced: {
|
|
57
73
|
state: boolean;
|
|
58
74
|
};
|
|
@@ -63,6 +79,12 @@ export declare class ImpaktAccordion extends ImpaktElement {
|
|
|
63
79
|
open: string[];
|
|
64
80
|
/** When false, opening one closes the others. */
|
|
65
81
|
multiple: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* `plain` is the site's questions: a "+" at the end that turns to "−" when
|
|
84
|
+
* open. `issues` is a list of findings in a tool: the "+" at the start and an
|
|
85
|
+
* open panel drawn as an inset soft panel with an ink border.
|
|
86
|
+
*/
|
|
87
|
+
look: 'plain' | 'issues';
|
|
66
88
|
/** Whether the script is running here, so the panels can be closed and opened. */
|
|
67
89
|
private enhanced;
|
|
68
90
|
constructor();
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImpaktAccordion
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-FLAUZU7Y.js";
|
|
4
|
+
import "../chunk-6CDQSHVW.js";
|
|
5
|
+
import "../chunk-ZUQ3DOG2.js";
|
|
4
6
|
import "../chunk-6WVL3HOC.js";
|
|
5
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-XX6JZW5N.js";
|
|
8
|
+
import "../chunk-72WNCCDC.js";
|
|
9
|
+
import "../chunk-JTCTQBAX.js";
|
|
6
10
|
export {
|
|
7
11
|
ImpaktAccordion
|
|
8
12
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TemplateResult } from 'lit';
|
|
2
2
|
import { ImpaktElement } from '../base/ImpaktElement';
|
|
3
|
-
export type AlertTone = 'info' | 'success' | 'warning' | 'danger';
|
|
3
|
+
export type AlertTone = 'info' | 'success' | 'warning' | 'danger' | 'attention';
|
|
4
4
|
/**
|
|
5
5
|
* A notice.
|
|
6
6
|
*
|
|
@@ -14,10 +14,18 @@ export type AlertTone = 'info' | 'success' | 'warning' | 'danger';
|
|
|
14
14
|
* the accessible name, because 1.4.1 Use of Colour says a red border is not a
|
|
15
15
|
* message and because a red border is invisible in forced-colours mode.
|
|
16
16
|
|
|
17
|
+
*
|
|
18
|
+
* **`attention` is the one yellow notice in a tool.** Inside a product yellow
|
|
19
|
+
* means "this needs your attention" and nothing else, so this tone is the
|
|
20
|
+
* accent as a fill with a 1px ink border, a solid ink label before the words
|
|
21
|
+
* (`label`, "Check" unless set) and room at the end for one ink action, such
|
|
22
|
+
* as "Claim £252 instead" (G2 frames 33:494, 37:452, 37:492, 45:657). The
|
|
23
|
+
* label is visible text and is read with the words.
|
|
17
24
|
*
|
|
18
25
|
* @category feedback
|
|
19
26
|
* @icon alert
|
|
20
27
|
* @slot - The body of the notice.
|
|
28
|
+
* @slot actions - An action at the end of an attention notice, such as an ink button.
|
|
21
29
|
*/
|
|
22
30
|
export declare class ImpaktAlert extends ImpaktElement {
|
|
23
31
|
static properties: {
|
|
@@ -32,14 +40,27 @@ export declare class ImpaktAlert extends ImpaktElement {
|
|
|
32
40
|
type: StringConstructor;
|
|
33
41
|
attribute: string;
|
|
34
42
|
};
|
|
43
|
+
label: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
};
|
|
46
|
+
noLabel: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
attribute: string;
|
|
49
|
+
};
|
|
35
50
|
};
|
|
36
51
|
tone: AlertTone;
|
|
37
52
|
heading: string;
|
|
38
53
|
/** Overrides the default word for the tone, for translation. */
|
|
39
54
|
toneLabel: string;
|
|
55
|
+
/** The solid label an attention notice starts with. "Check" when empty. */
|
|
56
|
+
label: string;
|
|
57
|
+
/** Leaves the solid label off an attention notice, when its words already say what needs doing. */
|
|
58
|
+
noLabel: boolean;
|
|
40
59
|
constructor();
|
|
41
60
|
private static readonly TONE_WORDS;
|
|
42
61
|
static styles: import("lit").CSSResult[];
|
|
62
|
+
private hasActions;
|
|
63
|
+
private onActions;
|
|
43
64
|
render(): TemplateResult;
|
|
44
65
|
}
|
|
45
66
|
declare global {
|
package/dist/components/alert.js
CHANGED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The frame every AI tool sits in: the app bar.
|
|
3
|
+
*/
|
|
4
|
+
import { type TemplateResult } from 'lit';
|
|
5
|
+
import { ImpaktElement } from '../base/ImpaktElement';
|
|
6
|
+
import type { MenuItem } from './app-ui';
|
|
7
|
+
import './app-ui';
|
|
8
|
+
export interface AppBarLink {
|
|
9
|
+
label: string;
|
|
10
|
+
href: string;
|
|
11
|
+
/** The page that is showing. */
|
|
12
|
+
current?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* An item in the "All tools" switcher or the organisation menu. `group`,
|
|
16
|
+
* `meta`, `current` and `disabled` are drawn by `impakt-menu`: the group's
|
|
17
|
+
* heading ("Tools", "Working in", "Account"), a mono note on the right
|
|
18
|
+
* ("Open", "You are here", "Coming soon"), the tool that is showing, and a
|
|
19
|
+
* tool that cannot be opened yet.
|
|
20
|
+
*/
|
|
21
|
+
export type AppBarMenuItem = MenuItem & {
|
|
22
|
+
group?: string;
|
|
23
|
+
meta?: string;
|
|
24
|
+
current?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The bar at the top of every AI tool: the Impakt mark and the tool's name on
|
|
29
|
+
* the left, the tool's own pages in the middle, and the way to other tools and
|
|
30
|
+
* the organisation on the right.
|
|
31
|
+
*
|
|
32
|
+
* It is a `header` landmark, 56px tall. "impakt" links home; the tool's name
|
|
33
|
+
* follows a "/". The tool's pages, when it has more than one, are a `nav`
|
|
34
|
+
* drawn as a segmented track, and the page that is showing is marked with
|
|
35
|
+
* `aria-current="page"` as well as a dot, so it is never told by colour.
|
|
36
|
+
*
|
|
37
|
+
* On the right, the built-in "All tools" switcher is an `impakt-menu` of the
|
|
38
|
+
* `switcher` items, grouped and annotated (Tools, Working in, Account). Put
|
|
39
|
+
* your own controls in the `tools` slot to replace it, and put a language switch
|
|
40
|
+
* or anything else before it in the `extra` slot. Then comes the organisation menu, from
|
|
41
|
+
* `organisation-items`; or, when `signed-out`, a "Sign in" link in its place.
|
|
42
|
+
*
|
|
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 scroll sideways if they still do
|
|
45
|
+
* not fit. Folding them away behind a button would hide where you are; a row
|
|
46
|
+
* that scrolls keeps the current page in view and every page one swipe or one
|
|
47
|
+
* Tab away. The bar reflows to 320px without the page scrolling sideways.
|
|
48
|
+
*
|
|
49
|
+
* Figma: kit `33:361`, `33:365`; every tool screen, such as `36:431`, `36:642`,
|
|
50
|
+
* `37:420`, `37:591`, `39:468`, `39:603`, `39:746`, `53:674`, `53:801`; signed
|
|
51
|
+
* out `36:382`; dark `48:527`, `48:857`; the switcher open `53:960`, `53:800`.
|
|
52
|
+
*
|
|
53
|
+
* @category navigation
|
|
54
|
+
* @icon menu
|
|
55
|
+
* @slot tools - Replaces the built-in "All tools" switcher.
|
|
56
|
+
* @slot extra - Before the "All tools" switcher, such as an `impakt-language-switch` (39:468).
|
|
57
|
+
* @csspart bar - The header.
|
|
58
|
+
* @csspart home - The link home.
|
|
59
|
+
* @csspart pages - The tool's own pages.
|
|
60
|
+
* @csspart sign-in - The sign-in link.
|
|
61
|
+
*/
|
|
62
|
+
export declare class ImpaktAppBar extends ImpaktElement {
|
|
63
|
+
static properties: {
|
|
64
|
+
tool: {
|
|
65
|
+
type: StringConstructor;
|
|
66
|
+
};
|
|
67
|
+
home: {
|
|
68
|
+
type: StringConstructor;
|
|
69
|
+
};
|
|
70
|
+
brand: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
};
|
|
73
|
+
links: {
|
|
74
|
+
type: ArrayConstructor;
|
|
75
|
+
};
|
|
76
|
+
pagesLabel: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
attribute: string;
|
|
79
|
+
};
|
|
80
|
+
switcher: {
|
|
81
|
+
type: ArrayConstructor;
|
|
82
|
+
};
|
|
83
|
+
switcherLabel: {
|
|
84
|
+
type: StringConstructor;
|
|
85
|
+
attribute: string;
|
|
86
|
+
};
|
|
87
|
+
toolsHref: {
|
|
88
|
+
type: StringConstructor;
|
|
89
|
+
attribute: string;
|
|
90
|
+
};
|
|
91
|
+
organisation: {
|
|
92
|
+
type: StringConstructor;
|
|
93
|
+
};
|
|
94
|
+
organisationItems: {
|
|
95
|
+
type: ArrayConstructor;
|
|
96
|
+
attribute: string;
|
|
97
|
+
};
|
|
98
|
+
organisationHref: {
|
|
99
|
+
type: StringConstructor;
|
|
100
|
+
attribute: string;
|
|
101
|
+
};
|
|
102
|
+
signedOut: {
|
|
103
|
+
type: BooleanConstructor;
|
|
104
|
+
reflect: boolean;
|
|
105
|
+
attribute: string;
|
|
106
|
+
};
|
|
107
|
+
signInHref: {
|
|
108
|
+
type: StringConstructor;
|
|
109
|
+
attribute: string;
|
|
110
|
+
};
|
|
111
|
+
signInText: {
|
|
112
|
+
type: StringConstructor;
|
|
113
|
+
attribute: string;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
/** The tool's name, as it follows "impakt /": "accessibility". */
|
|
117
|
+
tool: string;
|
|
118
|
+
/** Where "impakt" leads. */
|
|
119
|
+
home: string;
|
|
120
|
+
/** The word beside the mark. */
|
|
121
|
+
brand: string;
|
|
122
|
+
/** The tool's own pages, drawn in the middle. */
|
|
123
|
+
links: AppBarLink[];
|
|
124
|
+
/** The name of the pages' navigation landmark. */
|
|
125
|
+
pagesLabel: string;
|
|
126
|
+
/** The "All tools" menu: the tools, where you are working, and the account. */
|
|
127
|
+
switcher: AppBarMenuItem[];
|
|
128
|
+
/** The switcher's button. */
|
|
129
|
+
switcherLabel: string;
|
|
130
|
+
/** With no `switcher` items, "All tools" is a link here instead. */
|
|
131
|
+
toolsHref: string;
|
|
132
|
+
/** The organisation's name on its menu button. */
|
|
133
|
+
organisation: string;
|
|
134
|
+
/** The organisation menu. */
|
|
135
|
+
organisationItems: AppBarMenuItem[];
|
|
136
|
+
/** With no `organisation-items`, the organisation is a link here instead. */
|
|
137
|
+
organisationHref: string;
|
|
138
|
+
/** Nobody is signed in: a "Sign in" link takes the organisation's place. */
|
|
139
|
+
signedOut: boolean;
|
|
140
|
+
signInHref: string;
|
|
141
|
+
signInText: string;
|
|
142
|
+
constructor();
|
|
143
|
+
static styles: import("lit").CSSResult[];
|
|
144
|
+
private renderPages;
|
|
145
|
+
private renderSwitcher;
|
|
146
|
+
private renderAccount;
|
|
147
|
+
render(): TemplateResult;
|
|
148
|
+
}
|
|
149
|
+
declare global {
|
|
150
|
+
interface HTMLElementTagNameMap {
|
|
151
|
+
'impakt-app-bar': ImpaktAppBar;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ImpaktAppBar
|
|
3
|
+
} from "../chunk-P3BPW446.js";
|
|
4
|
+
import "../chunk-XX6JZW5N.js";
|
|
5
|
+
import "../chunk-SOYKSPPX.js";
|
|
6
|
+
import "../chunk-UNGAG44M.js";
|
|
7
|
+
import "../chunk-HSXLSJVG.js";
|
|
8
|
+
import "../chunk-2YRTFWW2.js";
|
|
9
|
+
import "../chunk-5OYQZWP2.js";
|
|
10
|
+
import "../chunk-72WNCCDC.js";
|
|
11
|
+
import "../chunk-JTCTQBAX.js";
|
|
12
|
+
export {
|
|
13
|
+
ImpaktAppBar
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=app-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -126,6 +126,14 @@ export interface MenuItem {
|
|
|
126
126
|
value?: string;
|
|
127
127
|
icon?: string;
|
|
128
128
|
tone?: '' | 'danger';
|
|
129
|
+
/** A group name. Items with the same group are drawn together under it, as a labelled group, in the order the groups first appear. */
|
|
130
|
+
group?: string;
|
|
131
|
+
/** A short note on the right in the code face, such as "Open" or "Coming soon". It is read with the item. */
|
|
132
|
+
meta?: string;
|
|
133
|
+
/** The page you are on: an ink fill, `aria-current="page"`, and "You are here" when there is no meta. */
|
|
134
|
+
current?: boolean;
|
|
135
|
+
/** Shown but not chosen, such as a tool still to come. It stays in the arrow-key order and says it is unavailable. */
|
|
136
|
+
disabled?: boolean;
|
|
129
137
|
}
|
|
130
138
|
/**
|
|
131
139
|
* A button that opens a short list of actions or links.
|
|
@@ -144,6 +152,13 @@ export interface MenuItem {
|
|
|
144
152
|
*
|
|
145
153
|
* @category navigation
|
|
146
154
|
* @icon menu
|
|
155
|
+
* **Items can be grouped, noted and marked.** An item's `group` draws it under
|
|
156
|
+
* a label in the code face, as a `group` named by that label, with a soft rule
|
|
157
|
+
* above each group after the first. Its `meta` is a quiet note at the end. The
|
|
158
|
+
* page you are on is `current`, an ink row with `aria-current="page"`, and a
|
|
159
|
+
* `disabled` item is still reached by the arrow keys but says it is unavailable
|
|
160
|
+
* and does nothing (G2 tool switcher, frames 53:960 and 53:800).
|
|
161
|
+
*
|
|
147
162
|
* @slot trigger - What the button shows, in place of the icon and label.
|
|
148
163
|
* @slot header - A note above the items, such as the name and email of who is signed in.
|
|
149
164
|
* @csspart trigger - The button.
|
|
@@ -172,9 +187,16 @@ export declare class ImpaktMenu extends ImpaktElement {
|
|
|
172
187
|
type: BooleanConstructor;
|
|
173
188
|
reflect: boolean;
|
|
174
189
|
};
|
|
190
|
+
triggerLook: {
|
|
191
|
+
type: StringConstructor;
|
|
192
|
+
reflect: boolean;
|
|
193
|
+
attribute: string;
|
|
194
|
+
};
|
|
175
195
|
};
|
|
176
196
|
label: string;
|
|
177
197
|
icon: string;
|
|
198
|
+
/** `button` is a bordered button with a chevron. `text` is plain words with "▾", "▴" when open, as a tool's name in a header is. */
|
|
199
|
+
triggerLook: 'button' | 'text';
|
|
178
200
|
items: MenuItem[];
|
|
179
201
|
/** Which edge of the button the list lines up with. */
|
|
180
202
|
edge: 'start' | 'end';
|
|
@@ -191,6 +213,9 @@ export declare class ImpaktMenu extends ImpaktElement {
|
|
|
191
213
|
private triggerKey;
|
|
192
214
|
private listKey;
|
|
193
215
|
private choose;
|
|
216
|
+
private renderItem;
|
|
217
|
+
/** The items in runs: each run of items with the same group, in order. Items with no group are a run with no label. */
|
|
218
|
+
private get runs();
|
|
194
219
|
render(): TemplateResult;
|
|
195
220
|
}
|
|
196
221
|
/** Which page numbers to show: the ends and the neighbours, with gaps between. */
|
|
@@ -265,7 +290,8 @@ export declare class ImpaktAvatar extends ImpaktElement {
|
|
|
265
290
|
};
|
|
266
291
|
fullName: string;
|
|
267
292
|
src: string;
|
|
268
|
-
|
|
293
|
+
/** `xs` is 22px, for a row of people in a header. */
|
|
294
|
+
size: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
269
295
|
private failed;
|
|
270
296
|
constructor();
|
|
271
297
|
static styles: import("lit").CSSResult[];
|
|
@@ -303,7 +329,8 @@ export declare class ImpaktAvatarGroup extends ImpaktElement {
|
|
|
303
329
|
};
|
|
304
330
|
items: AvatarItem[];
|
|
305
331
|
max: number;
|
|
306
|
-
|
|
332
|
+
/** `xs` is 22px faces with a 1px ink outline, overlapped less, as in the G2 site header (frame 9:264). */
|
|
333
|
+
size: 'xs' | 'sm' | 'md' | 'lg';
|
|
307
334
|
/** How the people left out are described to a screen reader, after the number. */
|
|
308
335
|
moreLabel: string;
|
|
309
336
|
constructor();
|
|
@@ -8,12 +8,13 @@ import {
|
|
|
8
8
|
ImpaktSlotPicker,
|
|
9
9
|
ImpaktToast,
|
|
10
10
|
pageWindow
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-SOYKSPPX.js";
|
|
12
12
|
import "../chunk-UNGAG44M.js";
|
|
13
|
+
import "../chunk-HSXLSJVG.js";
|
|
13
14
|
import "../chunk-2YRTFWW2.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-5OYQZWP2.js";
|
|
16
|
+
import "../chunk-72WNCCDC.js";
|
|
17
|
+
import "../chunk-JTCTQBAX.js";
|
|
17
18
|
export {
|
|
18
19
|
ImpaktAvatar,
|
|
19
20
|
ImpaktAvatarGroup,
|
|
@@ -22,13 +22,29 @@ export declare class ImpaktBadge extends ImpaktElement {
|
|
|
22
22
|
icon: {
|
|
23
23
|
type: StringConstructor;
|
|
24
24
|
};
|
|
25
|
+
look: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
reflect: boolean;
|
|
28
|
+
};
|
|
29
|
+
size: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
reflect: boolean;
|
|
32
|
+
};
|
|
25
33
|
};
|
|
26
34
|
/**
|
|
27
35
|
* Its colour. `inverse` is the text colour as a fill, for a label that has to
|
|
28
36
|
* stand out on a photo or a light card. `solid` is the brand as a fill, for
|
|
29
37
|
* the one label on a screen that matters most.
|
|
30
38
|
*/
|
|
31
|
-
tone: 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'info' | 'inverse' | 'solid';
|
|
39
|
+
tone: 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'info' | 'inverse' | 'solid' | 'accent';
|
|
40
|
+
/** `filled` is the tone as a fill. `outline` is a 1px ink border on a clear ground, the words in the ink. */
|
|
41
|
+
look: 'filled' | 'outline';
|
|
42
|
+
/**
|
|
43
|
+
* `md` is the product badge. `marketing` is the site's label: capitals in
|
|
44
|
+
* the code face at 11px, medium, with 6% tracking (G2 frames 34:398, 34:767,
|
|
45
|
+
* 21:1416, 20:1218). Keep it apart from a tool's sentence-case status pill.
|
|
46
|
+
*/
|
|
47
|
+
size: 'md' | 'marketing';
|
|
32
48
|
/** An icon before the words. */
|
|
33
49
|
icon: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat' | 'grid' | 'clipboard' | 'map-pinned' | 'users' | 'radio' | 'settings' | 'log-out' | 'arrow-up-right' | 'more' | 'upload' | 'image' | 'lock' | 'eye' | 'trash' | 'pencil' | 'qr-code' | 'battery';
|
|
34
50
|
constructor();
|
package/dist/components/badge.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImpaktBadge
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-XXSZL5CY.js";
|
|
4
|
+
import "../chunk-5OYQZWP2.js";
|
|
5
|
+
import "../chunk-72WNCCDC.js";
|
|
6
|
+
import "../chunk-JTCTQBAX.js";
|
|
6
7
|
export {
|
|
7
8
|
ImpaktBadge
|
|
8
9
|
};
|
|
@@ -3,10 +3,11 @@ import {
|
|
|
3
3
|
ImpaktSpacer,
|
|
4
4
|
ImpaktTabs,
|
|
5
5
|
ImpaktVisuallyHidden
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-6J22I7F6.js";
|
|
7
|
+
import "../chunk-N6EEW2GF.js";
|
|
8
|
+
import "../chunk-5OYQZWP2.js";
|
|
9
|
+
import "../chunk-72WNCCDC.js";
|
|
10
|
+
import "../chunk-JTCTQBAX.js";
|
|
10
11
|
export {
|
|
11
12
|
ImpaktDivider,
|
|
12
13
|
ImpaktSpacer,
|
|
@@ -91,6 +91,14 @@ export declare class ImpaktButton extends ImpaktElement {
|
|
|
91
91
|
label: {
|
|
92
92
|
type: StringConstructor;
|
|
93
93
|
};
|
|
94
|
+
spread: {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
reflect: boolean;
|
|
97
|
+
};
|
|
98
|
+
centred: {
|
|
99
|
+
type: BooleanConstructor;
|
|
100
|
+
reflect: boolean;
|
|
101
|
+
};
|
|
94
102
|
};
|
|
95
103
|
/** Leave it out on a phone, where a header has no room for it. */
|
|
96
104
|
hideOn: 'never' | 'phone';
|
|
@@ -100,7 +108,15 @@ export declare class ImpaktButton extends ImpaktElement {
|
|
|
100
108
|
* action that removes or cancels something, and `accent` the brand's
|
|
101
109
|
* second colour, for the one action a page is built around.
|
|
102
110
|
*/
|
|
103
|
-
variant: 'primary' | 'secondary' | 'ghost' | 'dark' | 'subtle' | 'danger' | 'accent';
|
|
111
|
+
variant: 'primary' | 'secondary' | 'ghost' | 'dark' | 'subtle' | 'danger' | 'accent' | 'outline';
|
|
112
|
+
/**
|
|
113
|
+
* Put the words at the start and the trailing icon at the far end, as the
|
|
114
|
+
* G2 buttons that run the width of a form or a card do. A `full` button
|
|
115
|
+
* spreads anyway; set `centred` on it to keep its words in the middle.
|
|
116
|
+
*/
|
|
117
|
+
spread: boolean;
|
|
118
|
+
/** Keep a `full` button's words in the middle rather than spread. */
|
|
119
|
+
centred: boolean;
|
|
104
120
|
type: 'button' | 'submit' | 'reset';
|
|
105
121
|
disabled: boolean;
|
|
106
122
|
busy: boolean;
|
|
@@ -116,7 +132,7 @@ export declare class ImpaktButton extends ImpaktElement {
|
|
|
116
132
|
iconAfter: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat' | 'grid' | 'clipboard' | 'map-pinned' | 'users' | 'radio' | 'settings' | 'log-out' | 'arrow-up-right' | 'more' | 'upload' | 'image' | 'lock' | 'eye' | 'trash' | 'pencil' | 'qr-code' | 'battery';
|
|
117
133
|
/** Where the button goes, when it opens a page rather than doing something here. */
|
|
118
134
|
href: string;
|
|
119
|
-
/** Draws the button as this icon alone, a round
|
|
135
|
+
/** Draws the button as this icon alone, a square button (round where the brand rounds its corners). Needs `label`. */
|
|
120
136
|
icon: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat' | 'grid' | 'clipboard' | 'map-pinned' | 'users' | 'radio' | 'settings' | 'log-out' | 'arrow-up-right' | 'more' | 'upload' | 'image' | 'lock' | 'eye' | 'trash' | 'pencil' | 'qr-code' | 'battery';
|
|
121
137
|
/** The accessible name of an icon-only button, such as "Back" or "More actions". */
|
|
122
138
|
label: string;
|