@masmarino/gabarit 3.1.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -25
- package/alert/README.md +1 -1
- package/app-shell/README.md +11 -4
- package/auth-activate/README.md +1 -1
- package/auth-login/README.md +1 -1
- package/auth-register/README.md +1 -1
- package/auth-reset-password/README.md +1 -1
- package/card/README.md +11 -12
- package/disclosure/README.md +1 -1
- package/empty-state/README.md +1 -1
- package/fesm2022/masmarino-gabarit-accordion.mjs +4 -4
- package/fesm2022/masmarino-gabarit-accordion.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-alert.mjs +2 -2
- package/fesm2022/masmarino-gabarit-alert.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-app-shell.mjs +4 -4
- package/fesm2022/masmarino-gabarit-app-shell.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-auth-register.mjs +2 -2
- package/fesm2022/masmarino-gabarit-auth-register.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-auth.mjs +4 -4
- package/fesm2022/masmarino-gabarit-auth.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-autocomplete.mjs +2 -2
- package/fesm2022/masmarino-gabarit-autocomplete.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-avatar-group.mjs +2 -2
- package/fesm2022/masmarino-gabarit-avatar-group.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-card.mjs +4 -20
- package/fesm2022/masmarino-gabarit-card.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-chart.mjs +2 -2
- package/fesm2022/masmarino-gabarit-chart.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-command-palette.mjs +4 -4
- package/fesm2022/masmarino-gabarit-command-palette.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-copy-button.mjs +2 -2
- package/fesm2022/masmarino-gabarit-copy-button.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-date-picker.mjs +4 -4
- package/fesm2022/masmarino-gabarit-date-picker.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-disclosure.mjs +3 -3
- package/fesm2022/masmarino-gabarit-disclosure.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-docs.mjs +6 -7
- package/fesm2022/masmarino-gabarit-docs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-drawer.mjs +2 -2
- package/fesm2022/masmarino-gabarit-drawer.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-empty-state.mjs +2 -2
- package/fesm2022/masmarino-gabarit-empty-state.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-git-field.mjs +2 -2
- package/fesm2022/masmarino-gabarit-git-field.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-job-graph.mjs +2 -2
- package/fesm2022/masmarino-gabarit-job-graph.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-list-card.mjs +2 -2
- package/fesm2022/masmarino-gabarit-list-card.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-list-row.mjs +2 -2
- package/fesm2022/masmarino-gabarit-list-row.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-menu.mjs +2 -2
- package/fesm2022/masmarino-gabarit-menu.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs +4 -5
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs +4 -5
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-modal.mjs +2 -2
- package/fesm2022/masmarino-gabarit-modal.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs +4 -4
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-page-header.mjs +2 -2
- package/fesm2022/masmarino-gabarit-page-header.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-page-layout.mjs +2 -2
- package/fesm2022/masmarino-gabarit-page-layout.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-panel.mjs +2 -2
- package/fesm2022/masmarino-gabarit-panel.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs +4 -6
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-popover.mjs +2 -2
- package/fesm2022/masmarino-gabarit-popover.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-search-bar.mjs +2 -2
- package/fesm2022/masmarino-gabarit-search-bar.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-select.mjs +2 -2
- package/fesm2022/masmarino-gabarit-select.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs +4 -23
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-sparkline.mjs +2 -2
- package/fesm2022/masmarino-gabarit-sparkline.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-stat-grid.mjs +2 -2
- package/fesm2022/masmarino-gabarit-stat-grid.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-stat-tile.mjs +2 -2
- package/fesm2022/masmarino-gabarit-stat-tile.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tabs.mjs +2 -2
- package/fesm2022/masmarino-gabarit-tabs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-toaster.mjs +2 -2
- package/fesm2022/masmarino-gabarit-toaster.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tooltip.mjs +2 -2
- package/fesm2022/masmarino-gabarit-tooltip.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-tree.mjs +2 -2
- package/fesm2022/masmarino-gabarit-tree.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit.mjs +1 -1
- package/fesm2022/masmarino-gabarit.mjs.map +1 -1
- package/git-field/README.md +2 -2
- package/list-row/README.md +3 -5
- package/modal/README.md +1 -1
- package/nav-tabs/README.md +3 -2
- package/package.json +1 -1
- package/page-header/README.md +2 -2
- package/page-layout/README.md +1 -1
- package/panel/README.md +2 -3
- package/skeleton-list/README.md +1 -2
- package/src/lib/tokens/_base.scss +5 -6
- package/src/lib/tokens/_depth.scss +1 -1
- package/src/lib/tokens/_glass.scss +87 -0
- package/src/lib/tokens/_grounds.scss +223 -0
- package/src/lib/tokens/_semantic.scss +0 -2
- package/src/lib/tokens/_themes.scss +77 -23
- package/src/lib/tokens/_utilities.scss +53 -13
- package/src/lib/tokens/index.scss +2 -0
- package/types/masmarino-gabarit-card.d.ts +1 -8
- package/types/masmarino-gabarit-disclosure.d.ts +1 -1
- package/types/masmarino-gabarit-git-field.d.ts +1 -1
- package/types/masmarino-gabarit-skeleton-list.d.ts +0 -6
- package/types/masmarino-gabarit.d.ts +3 -3
package/README.md
CHANGED
|
@@ -332,10 +332,10 @@ keep their source order); with `compare`, `desc` reverses the ascending result.
|
|
|
332
332
|
## Styles
|
|
333
333
|
|
|
334
334
|
Gabarit carries the look of the Ferris family: white paper and near-black ink in the light theme, a
|
|
335
|
-
cool graphite in the dark one, IBM Plex throughout,
|
|
335
|
+
cool graphite in the dark one, IBM Plex throughout, one ground and two glasses, and the apps' corners. Neutrals carry
|
|
336
336
|
the screens; the crab's rust is kept for the marks that are the brand's own (focus, the current page),
|
|
337
|
-
patina green says success. Every text token reaches 7:1 on the page and on a panel, in both themes
|
|
338
|
-
(`contrast.spec.ts`).
|
|
337
|
+
patina green says success. Every text token reaches 7:1 on the page and on a panel, in both themes,
|
|
338
|
+
and at every colour of the ground, bare or under its glasses (`contrast.spec.ts`).
|
|
339
339
|
|
|
340
340
|
Import the tokens, and the fonts, in the application's `styles.scss`:
|
|
341
341
|
|
|
@@ -343,7 +343,7 @@ Import the tokens, and the fonts, in the application's `styles.scss`:
|
|
|
343
343
|
@use '@masmarino/gabarit/fonts' with ($path: '/fonts/ibm-plex/');
|
|
344
344
|
@use '@masmarino/gabarit/tokens';
|
|
345
345
|
|
|
346
|
-
// Optional: body, h1–h3, code and selection in the family's type.
|
|
346
|
+
// Optional: the ground on the body; body, h1–h3, code and selection in the family's type.
|
|
347
347
|
@include tokens.document-base;
|
|
348
348
|
```
|
|
349
349
|
|
|
@@ -357,17 +357,26 @@ instance with an Angular asset:
|
|
|
357
357
|
|
|
358
358
|
Without them the stacks fall back to the system's sans and monospace.
|
|
359
359
|
|
|
360
|
-
### The
|
|
360
|
+
### The ground and the two glasses (4.0)
|
|
361
361
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
362
|
+
One ground runs under the whole window (`--gbt-ground`: a gradient and a light from above, held still
|
|
363
|
+
while the page scrolls). The panels are the **content glass** laid on it (`gbt-card` by default,
|
|
364
|
+
`gbt-list-card`, `gbt-stat-tile`, the modal and the drawer in its thick density); what commands and
|
|
365
|
+
floats is the **liquid glass** (the current page in the rail, the search bar, menus, popovers, tooltips,
|
|
366
|
+
the lists of a select, toasts, the command palette). Light is the edge of things: a rim at the top and a
|
|
367
|
+
soft shadow stand where a hairline used to; lists have no line between their rows. The line stays on the
|
|
368
|
+
controls (a field's 3:1 edge, the focus ring) and on `gbt-table`.
|
|
369
|
+
|
|
370
|
+
The recipes are mixins of `_glass.scss`, for an application's own parts: `ground`, `glass($density)`,
|
|
371
|
+
`liquid-glass`, `floating-glass`, and `on-ground` / `on-liquid`, which give the discreet text, the status
|
|
372
|
+
texts and a field's edge the shades that keep 7:1 and 3:1 there. The same as classes: `.gbt-ground`,
|
|
373
|
+
`.gbt-glass` (`--thin`, `--thick`), `.gbt-liquid-glass`. Where the system asks to reduce transparency
|
|
374
|
+
the glass is dense and unblurred; where it asks for more contrast, it has an edge again.
|
|
366
375
|
|
|
367
376
|
```scss
|
|
368
|
-
.
|
|
369
|
-
|
|
370
|
-
|
|
377
|
+
.side-note {
|
|
378
|
+
border-radius: var(--gbt-radius-glass);
|
|
379
|
+
@include tokens.glass(thin);
|
|
371
380
|
}
|
|
372
381
|
```
|
|
373
382
|
|
|
@@ -387,9 +396,8 @@ component (enforced by `token-usage.spec.ts`).
|
|
|
387
396
|
| | `--bg-panel` | The page's ground |
|
|
388
397
|
| | `--bg-hover` | Hover state of an interactive element on a neutral background |
|
|
389
398
|
| | `--bg-track` | Track of a segmented control, visible on the page and on a panel |
|
|
390
|
-
| | `--frame` | The graphite of the shell and the auth pages, in both themes |
|
|
391
399
|
| Border | `--border-color` | The edge of a field or a control (3:1) |
|
|
392
|
-
| | `--gbt-hairline` / `--gbt-card-border` |
|
|
400
|
+
| | `--gbt-hairline` / `--gbt-card-border` | The few lines left: a table's, a chip's |
|
|
393
401
|
| Text | `--text-primary` / `--text-secondary` / `--text-discret` | From most to least emphasized |
|
|
394
402
|
| | `--text-on-primary` / `--text-on-error` / `--text-on-color` | Text set on a `--primary` fill, an error fill, or a solid colour |
|
|
395
403
|
| Success | `--color-success-base` / `-hover` / `-text` / `-bg` / `-bg-text` | Fill, hover, text, light background, text on that background |
|
|
@@ -406,16 +414,14 @@ the type stacks (`--font-family`, `--font-display`, `--gbt-font-mono`).
|
|
|
406
414
|
### Volume and light
|
|
407
415
|
|
|
408
416
|
As on the apps, a little depth and one light from above, in both themes, from `tokens/gabarit.json`
|
|
409
|
-
(`semantic.web.depth`: the apps' roles and the common shadows, composed for CSS). The page is
|
|
410
|
-
|
|
411
|
-
now `--gbt-depth-card`). What can be pressed has some volume and sinks when held (`--gbt-depth-raised`,
|
|
417
|
+
(`semantic.web.depth`: the apps' roles and the common shadows, composed for CSS). The page is the ground, and
|
|
418
|
+
its panels are glass laid on it (above). What can be pressed has some volume and sinks when held (`--gbt-depth-raised`,
|
|
412
419
|
`--gbt-depth-ink`, `--gbt-sheen`, `--gbt-sunk`, with the `depth` mixins: `raised`, `ink`, `surface-hover`,
|
|
413
|
-
`surface-sunk`, `sunk`, `sink`). What holds a value is slightly hollow (`--gbt-depth-hollow`).
|
|
414
|
-
a sheen and casts a shadow on the page (`--gbt-frame-sheen`, `--gbt-depth-bar`). What is on glows, in the
|
|
420
|
+
`surface-sunk`, `sunk`, `sink`). What holds a value is slightly hollow (`--gbt-depth-hollow`). What is on glows, in the
|
|
415
421
|
accent (`--gbt-glow`): a switch, a slider's filled part, the current tab or page. Under the pointer and held
|
|
416
422
|
down, everywhere: `--bg-hover`, then the stronger `--bg-press`; the sink is off when the system asks for
|
|
417
|
-
reduced motion (`depth.spec.ts` holds both). A sheet
|
|
418
|
-
|
|
423
|
+
reduced motion (`depth.spec.ts` holds both). A sheet (`gbt-modal`, `gbt-drawer`) is one thick glass, its header
|
|
424
|
+
and its footer included. In `<gbt-card form>` the card is the fields' frame: `gbt-input`,
|
|
419
425
|
`gbt-textarea` and `gbt-tag-input` lose theirs, a focused field keeps its ring; it is opt-in, a field with no
|
|
420
426
|
edge of its own does not meet WCAG 1.4.11 by itself, so check it with the row's label and line.
|
|
421
427
|
|
|
@@ -434,13 +440,13 @@ so an app that leaves them alone gets the family's look. Set one to take that pa
|
|
|
434
440
|
| `--gbt-radius-tile` | Icon marker tiles, job graph nodes, avatar group overflow, TOTP QR code | `8px` |
|
|
435
441
|
| `--gbt-radius-search` | The search bar field | `6px` |
|
|
436
442
|
| `--gbt-nav-active-bg` / `--gbt-nav-active-text` | The current page in the app shell navigation | a 9% ink tint / `--text-primary` |
|
|
437
|
-
| `--gbt-nav-active-mark` | A 2px rule on the start edge of the current page link |
|
|
443
|
+
| `--gbt-nav-active-mark` | A 2px rule on the start edge of the current page link | none |
|
|
438
444
|
| `--gbt-shell-bar` | The height of the app shell's bar and of the logo's corner | `4rem` |
|
|
439
445
|
| `--gbt-shell-border` | The app shell's navigation and header edges | `transparent` |
|
|
440
|
-
| `--gbt-shell-header-bg` | The app shell's header | the
|
|
446
|
+
| `--gbt-shell-header-bg` | The app shell's header | the ground (`var(--gbt-ground)`) |
|
|
441
447
|
| `--gbt-shell-content-padding` | The app shell's bar and main content area | `clamp(1rem, 0.25rem + 2vw, 2rem)` |
|
|
442
|
-
| `--gbt-auth-panel-backdrop` | The page behind the auth panels (login, register…) | `var(--
|
|
443
|
-
| `--gbt-auth-panel-radius` | The auth panel card | `var(--
|
|
448
|
+
| `--gbt-auth-panel-backdrop` | The page behind the auth panels (login, register…) | the ground (`var(--gbt-ground)`) |
|
|
449
|
+
| `--gbt-auth-panel-radius` | The auth panel card | `var(--gbt-radius-glass)` |
|
|
444
450
|
|
|
445
451
|
Overriding a token after the import:
|
|
446
452
|
|
package/alert/README.md
CHANGED
|
@@ -17,7 +17,7 @@ app renders it.
|
|
|
17
17
|
| `live` | `AlertLive` | `'auto'` | `'auto' \| 'assertive' \| 'polite' \| 'off'` — how the alert is announced (see _Role_). |
|
|
18
18
|
| `heading` | `string` | `''` | A short bold title above the message. |
|
|
19
19
|
| `size` | `AlertSize` | `'md'` | `'md' \| 'sm'` — `sm` is the tighter alert for side panels, hints and dense cards. |
|
|
20
|
-
| `appearance` | `AlertAppearance` | `'default'` | `'default' \| 'subtle'` — subtle: lighter wash
|
|
20
|
+
| `appearance` | `AlertAppearance` | `'default'` | `'default' \| 'subtle'` — subtle: lighter wash and icon ring. No edge in either: the tint and the icon say the status. |
|
|
21
21
|
| `iconAlign` | `AlertIconAlign` | `'auto'` | `'auto' \| 'center' \| 'start'` — `auto` centres the icon on a single block and moves it to the first line once there is a `heading` or `[alert-actions]`; `start` forces the top, `center` opts out. |
|
|
22
22
|
|
|
23
23
|
## Outputs
|
package/app-shell/README.md
CHANGED
|
@@ -41,7 +41,7 @@ navigation, under its bottom (version and toggle), which stays put.
|
|
|
41
41
|
| Default | The page content, in a focusable `<main>`. |
|
|
42
42
|
|
|
43
43
|
**The collapsed rail's flyout.** In the 64 px rail a link shows only its icon; on hover or keyboard focus its
|
|
44
|
-
`<span>` label appears to the right of the rail, in a small
|
|
44
|
+
`<span>` label appears to the right of the rail, in a small bubble of dense liquid glass (`--text-primary`,
|
|
45
45
|
above the header and the page). The bubble sits outside the link and the rail, so the collapsed rail and its links
|
|
46
46
|
do not clip their box (`overflow: visible`); expanded, and in the mobile drawer, they do clip. A link that is not
|
|
47
47
|
the `<gbt-icon /><span>` structure (text only, a badge outside the span) spills over the page in the collapsed
|
|
@@ -49,9 +49,16 @@ rail: give every collapsible link that structure. The bubble opens on a real hov
|
|
|
49
49
|
tap on a touch screen does not leave it painted over the page) and on keyboard focus; a bridge in front of it lets
|
|
50
50
|
the pointer travel from the link onto the label without the flyout closing.
|
|
51
51
|
|
|
52
|
-
`.gbt-app-shell`
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
**The ground.** `.gbt-app-shell` lays the ground (`--gbt-ground`) under
|
|
53
|
+
the whole window: the rail, the bar and the page are one material with nothing
|
|
54
|
+
of their own (no graphite, no sheet, no shadow of the bar). The page's panels
|
|
55
|
+
are glass laid on it (`gbt-card` by default); the current link
|
|
56
|
+
(`aria-current`) is liquid glass with its icon in the accent; the burger is a
|
|
57
|
+
round button of liquid glass. What holds still over a scrolling page (the bar,
|
|
58
|
+
the foot of the rail) shows the same ground, fixed to the window, so the page
|
|
59
|
+
passes under it. On the ground the discreet text, the status texts and the
|
|
60
|
+
edge of a field take shades that keep 7:1 and 3:1 at the ground's worst point
|
|
61
|
+
(`_glass.scss`, `on-ground`). `.gbt-container` (in `_utilities.scss`)
|
|
55
62
|
centers content at reading width, to place on the default-projected
|
|
56
63
|
content if needed.
|
|
57
64
|
|
package/auth-activate/README.md
CHANGED
|
@@ -39,7 +39,7 @@ through its outputs.
|
|
|
39
39
|
| Selector | Role |
|
|
40
40
|
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
41
41
|
| `[auth-logo]` | The application's logo (an `img`, `picture` or `svg`), on top of the panel. Optional. |
|
|
42
|
-
| `[auth-backdrop]` | What is drawn on the
|
|
42
|
+
| `[auth-backdrop]` | What is drawn on the page's ground, behind the panel: `gbt-git-field`, the family's animated commit graph (`@masmarino/gabarit/git-field`). Optional. |
|
|
43
43
|
| `[gbtAuthFooterLink]` | The link to the sign-in page, under the form after "Is your account already active?". An `a gbtButton variant="link"` carrying `routerLink` or `href`. No footer when absent. |
|
|
44
44
|
|
|
45
45
|
## Behaviour
|
package/auth-login/README.md
CHANGED
|
@@ -36,7 +36,7 @@ The enrolment takes its strings from `provideAuthLabels({ mfaEnrollment, totpQr,
|
|
|
36
36
|
| Selector | Role |
|
|
37
37
|
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
38
38
|
| `[auth-logo]` | The application's logo (an `img`, a `picture`, an `svg`) at the top of the panel, on every state. Give it its `alt`. |
|
|
39
|
-
| `[auth-backdrop]` | What is drawn on the
|
|
39
|
+
| `[auth-backdrop]` | What is drawn on the page's ground, behind the panel: `gbt-git-field`, the family's animated commit graph (`@masmarino/gabarit/git-field`). Optional. |
|
|
40
40
|
| `[gbtAuthFooterLink]` | The link to the application's registration page (`<a gbtButton variant="link" gbtAuthFooterLink routerLink="/register">`). Shown under the form, after "No account yet?", only when `authConfig` says registration is open. |
|
|
41
41
|
| `[auth-notice]` | Something the application has to say before the credentials (a session that ended, a sign-in link that failed), e.g. a `gbt-alert`. First in the form, on the credentials step only. |
|
|
42
42
|
|
package/auth-register/README.md
CHANGED
|
@@ -45,7 +45,7 @@ for `minPasswordLength`: both only spare a round trip, the server stays the auth
|
|
|
45
45
|
| Selector | Role |
|
|
46
46
|
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
47
47
|
| `[auth-logo]` | The application's logo (an `img`, `picture` or `svg`), on top of the panel. Optional. |
|
|
48
|
-
| `[auth-backdrop]` | What is drawn on the
|
|
48
|
+
| `[auth-backdrop]` | What is drawn on the page's ground, behind the panel: `gbt-git-field`, the family's animated commit graph (`@masmarino/gabarit/git-field`). Optional. |
|
|
49
49
|
| `[gbtAuthFooterLink]` | The link to the sign-in page, under the form after "Already have an account?". An `a gbtButton variant="link"` carrying `routerLink` or `href`. No footer when absent. |
|
|
50
50
|
|
|
51
51
|
## Behaviour
|
|
@@ -45,7 +45,7 @@ also catch the `reset` events bubbling from the page's own `<form>`.
|
|
|
45
45
|
| Selector | Role |
|
|
46
46
|
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
47
47
|
| `[auth-logo]` | The application's logo (an `img`, `picture` or `svg`), on top of the panel. Optional. |
|
|
48
|
-
| `[auth-backdrop]` | What is drawn on the
|
|
48
|
+
| `[auth-backdrop]` | What is drawn on the page's ground, behind the panel: `gbt-git-field`, the family's animated commit graph (`@masmarino/gabarit/git-field`). Optional. |
|
|
49
49
|
| `[gbtAuthFooterLink]` | The link to the sign-in page, under the form after "Already set your new password?". An `a gbtButton variant="link"` carrying `routerLink` or `href`. No footer when absent. |
|
|
50
50
|
|
|
51
51
|
## Behaviour
|
package/card/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Card
|
|
2
2
|
|
|
3
|
-
Titled container: an optional heading over a box
|
|
4
|
-
|
|
3
|
+
Titled container: an optional heading over a box of content glass — the apps'
|
|
4
|
+
regular glass, laid on the ground: translucent, blurred, a rim of light at the
|
|
5
|
+
top, a soft shadow, no edge —, an optional
|
|
5
6
|
description and counter under / after the heading, a flush body for rows, a
|
|
6
7
|
tone and a selected state, and a link mode that makes the whole box
|
|
7
8
|
clickable.
|
|
@@ -17,7 +18,6 @@ component, see below)
|
|
|
17
18
|
| `heading` | `string` | `''` | Header title. Empty by default: no header is rendered without it (or a `[card-header]` slot). |
|
|
18
19
|
| `icon` | `string` | `''` | Icon shown beside the title, in the header. A toned header without one shows the tone's icon. |
|
|
19
20
|
| `headingLevel` | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `2` | Level of the rendered heading — choose it based on the block's place in the page hierarchy (RGAA 9.1). |
|
|
20
|
-
| `variant` | `'elevated' \| 'outlined'` | `'elevated'` | `outlined` swaps the box's shadow for a border. |
|
|
21
21
|
| `description` | `string` | `''` | One-line help text under the heading (built-in header only). |
|
|
22
22
|
| `count` | `number \| null` | `null` | Counter pill after the heading, `0` included. |
|
|
23
23
|
| `flush` | `boolean` | `false` | No padding inside the box: rows and tables reach its edges (clipped to its rounded corners). |
|
|
@@ -43,15 +43,16 @@ The component renders two siblings:
|
|
|
43
43
|
the icon, the title (with its count), the description under it, and the
|
|
44
44
|
`[card-header-actions]` on the right. `0.5rem` separates it from the box
|
|
45
45
|
(the heading-to-content gap of `gbt-panel`).
|
|
46
|
-
2. **The box** (`.gbt-card`): the card itself —
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
2. **The box** (`.gbt-card`): the card itself — the glass (thicker under the
|
|
47
|
+
pointer; dense where the system reduces transparency, with an edge where it
|
|
48
|
+
asks for more contrast), padding, and a full radius (`--gbt-radius-glass`,
|
|
49
|
+
22px) on all four corners. It holds the body only. `selected` and the link target are the
|
|
49
50
|
box's; the header is a label over it.
|
|
50
51
|
|
|
51
52
|
```
|
|
52
53
|
<gbt-card> display: grid, position: relative
|
|
53
54
|
div.gbt-card__header heading, count, description, actions
|
|
54
|
-
div.gbt-card the box: data-
|
|
55
|
+
div.gbt-card the box: data-flush, data-selected, data-link
|
|
55
56
|
div.gbt-card__body your content
|
|
56
57
|
```
|
|
57
58
|
|
|
@@ -103,9 +104,8 @@ inner corners. The header is not in the box, so it is not affected.
|
|
|
103
104
|
<gbt-gauge-bar ... />
|
|
104
105
|
</gbt-card>
|
|
105
106
|
|
|
106
|
-
<!-- A settings card:
|
|
107
|
+
<!-- A settings card: a heading above it, rows to the edges -->
|
|
107
108
|
<gbt-card
|
|
108
|
-
variant="outlined"
|
|
109
109
|
heading="Variables"
|
|
110
110
|
icon="key"
|
|
111
111
|
description="Injectées dans chaque job."
|
|
@@ -119,7 +119,7 @@ inner corners. The header is not in the box, so it is not affected.
|
|
|
119
119
|
</gbt-card>
|
|
120
120
|
|
|
121
121
|
<!-- Your own header -->
|
|
122
|
-
<gbt-card
|
|
122
|
+
<gbt-card>
|
|
123
123
|
<div card-header><strong>src/app/app.ts</strong> <gbt-badge>+12 −3</gbt-badge></div>
|
|
124
124
|
</gbt-card>
|
|
125
125
|
```
|
|
@@ -147,14 +147,13 @@ body's controls are (see below).
|
|
|
147
147
|
```html
|
|
148
148
|
<!-- 1. href: the heading becomes the link -->
|
|
149
149
|
<gbt-card
|
|
150
|
-
variant="outlined"
|
|
151
150
|
heading="Guide de démarrage"
|
|
152
151
|
href="/guide"
|
|
153
152
|
description="Installer le projet"
|
|
154
153
|
/>
|
|
155
154
|
|
|
156
155
|
<!-- 2. a projected anchor — router-agnostic, works with routerLink -->
|
|
157
|
-
<gbt-card
|
|
156
|
+
<gbt-card>
|
|
158
157
|
<h3 card-header><a gbtCardLink [routerLink]="['/releases', id]">Release {{ version }}</a></h3>
|
|
159
158
|
<gbt-button card-header-actions size="small" variant="secondary" text="Télécharger" />
|
|
160
159
|
<p>Notes de version…</p>
|
package/disclosure/README.md
CHANGED
|
@@ -13,7 +13,7 @@ group, no index, an `open` model you can bind.
|
|
|
13
13
|
| `label` | `string` | — | Required. The text of the toggle. |
|
|
14
14
|
| `open` | `boolean` (model) | `false` | Whether the panel is shown. Two-way: `[(open)]`. |
|
|
15
15
|
| `icon` | `string \| null` | `null` | Registered icon name before the label. |
|
|
16
|
-
| `appearance` | `'
|
|
16
|
+
| `appearance` | `'glass' \| 'plain'` | `'glass'` | `glass`: a box of thin glass, no edge. `plain`: only the toggle and the panel. |
|
|
17
17
|
| `headingLevel` | `2 \| 3 \| 4 \| 5 \| 6 \| null` | `null` | Wraps the toggle in a heading of that level (when the disclosure titles a section). `null`: no heading. |
|
|
18
18
|
|
|
19
19
|
`openChange` is emitted by the model each time the user toggles.
|
package/empty-state/README.md
CHANGED
|
@@ -50,7 +50,7 @@ The 96 px artwork suits a whole page or an empty list. Inside a card, use the
|
|
|
50
50
|
compact block with an icon:
|
|
51
51
|
|
|
52
52
|
```html
|
|
53
|
-
<gbt-card
|
|
53
|
+
<gbt-card heading="Variables" flush>
|
|
54
54
|
<gbt-empty-state
|
|
55
55
|
size="compact"
|
|
56
56
|
icon="key"
|
|
@@ -79,7 +79,7 @@ var Accordion = class Accordion {
|
|
|
79
79
|
</div>
|
|
80
80
|
`,
|
|
81
81
|
isInline: true,
|
|
82
|
-
styles: [".gbt-accordion{display:
|
|
82
|
+
styles: [".gbt-accordion{display:flex;flex-direction:column;gap:2px;padding:.375rem;border-radius:var(--gbt-radius-glass);background:var(--gbt-glass-regular);-webkit-backdrop-filter:var(--gbt-glass-blur);backdrop-filter:var(--gbt-glass-blur);box-shadow:var(--gbt-glass-rim-light),var(--gbt-depth-glass);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text)}@media(prefers-reduced-transparency:reduce){.gbt-accordion{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-accordion{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-glass)}}.gbt-accordion{overflow:hidden}\n"],
|
|
83
83
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
84
84
|
});
|
|
85
85
|
};
|
|
@@ -100,7 +100,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
100
100
|
</div>
|
|
101
101
|
`,
|
|
102
102
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
103
|
-
styles: [".gbt-accordion{display:
|
|
103
|
+
styles: [".gbt-accordion{display:flex;flex-direction:column;gap:2px;padding:.375rem;border-radius:var(--gbt-radius-glass);background:var(--gbt-glass-regular);-webkit-backdrop-filter:var(--gbt-glass-blur);backdrop-filter:var(--gbt-glass-blur);box-shadow:var(--gbt-glass-rim-light),var(--gbt-depth-glass);--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text)}@media(prefers-reduced-transparency:reduce){.gbt-accordion{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-accordion{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-glass)}}.gbt-accordion{overflow:hidden}\n"]
|
|
104
104
|
}]
|
|
105
105
|
}],
|
|
106
106
|
ctorParameters: () => [],
|
|
@@ -197,7 +197,7 @@ var AccordionItem = class AccordionItem {
|
|
|
197
197
|
}],
|
|
198
198
|
ngImport: i0,
|
|
199
199
|
template: "<button\n #header\n type=\"button\"\n class=\"gbt-accordion-item__header\"\n [class.gbt-accordion-item__header--open]=\"active()\"\n [id]=\"headerId()\"\n [attr.aria-expanded]=\"active()\"\n [attr.aria-controls]=\"panelId()\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"gbt-accordion-item__label\">{{ label() }}</span>\n <gbt-icon name=\"chevron-down\" class=\"gbt-accordion-item__chevron\" aria-hidden=\"true\" />\n</button>\n<div\n class=\"gbt-accordion-item__panel\"\n [class.gbt-accordion-item__panel--open]=\"active()\"\n [id]=\"panelId()\"\n [attr.aria-labelledby]=\"headerId()\"\n [attr.inert]=\"active() ? null : ''\"\n>\n <div class=\"gbt-accordion-item__panel-inner\">\n <div class=\"gbt-accordion-item__panel-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n",
|
|
200
|
-
styles: [":host{display:block}
|
|
200
|
+
styles: [":host{display:block}.gbt-accordion-item__header{box-sizing:border-box;display:flex;align-items:center;gap:.75rem;width:100%;padding:.875rem 1rem;background:transparent;border:none;border-radius:var(--gbt-radius-row);color:var(--text-primary);font-size:14px;font-weight:600;text-align:left;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1)}.gbt-accordion-item__header:hover{background:var(--bg-hover)}.gbt-accordion-item__header:active{background:var(--bg-press)}.gbt-accordion-item__header:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:-2px}.gbt-accordion-item__label{flex:1;min-width:0}.gbt-accordion-item__chevron{flex-shrink:0;color:var(--text-secondary);transition:transform .2s cubic-bezier(.4,0,.2,1)}.gbt-accordion-item__header--open .gbt-accordion-item__chevron{transform:rotate(180deg)}.gbt-accordion-item__panel{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s cubic-bezier(.4,0,.2,1)}.gbt-accordion-item__panel--open{grid-template-rows:1fr}.gbt-accordion-item__panel-inner{overflow:hidden;min-height:0}.gbt-accordion-item__panel-content{padding:1rem}@media(prefers-reduced-motion:reduce){.gbt-accordion-item__header,.gbt-accordion-item__chevron,.gbt-accordion-item__panel{transition:none}}\n"],
|
|
201
201
|
dependencies: [{
|
|
202
202
|
kind: "component",
|
|
203
203
|
type: Icon,
|
|
@@ -220,7 +220,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
220
220
|
imports: [Icon],
|
|
221
221
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
222
222
|
template: "<button\n #header\n type=\"button\"\n class=\"gbt-accordion-item__header\"\n [class.gbt-accordion-item__header--open]=\"active()\"\n [id]=\"headerId()\"\n [attr.aria-expanded]=\"active()\"\n [attr.aria-controls]=\"panelId()\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"gbt-accordion-item__label\">{{ label() }}</span>\n <gbt-icon name=\"chevron-down\" class=\"gbt-accordion-item__chevron\" aria-hidden=\"true\" />\n</button>\n<div\n class=\"gbt-accordion-item__panel\"\n [class.gbt-accordion-item__panel--open]=\"active()\"\n [id]=\"panelId()\"\n [attr.aria-labelledby]=\"headerId()\"\n [attr.inert]=\"active() ? null : ''\"\n>\n <div class=\"gbt-accordion-item__panel-inner\">\n <div class=\"gbt-accordion-item__panel-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n",
|
|
223
|
-
styles: [":host{display:block}
|
|
223
|
+
styles: [":host{display:block}.gbt-accordion-item__header{box-sizing:border-box;display:flex;align-items:center;gap:.75rem;width:100%;padding:.875rem 1rem;background:transparent;border:none;border-radius:var(--gbt-radius-row);color:var(--text-primary);font-size:14px;font-weight:600;text-align:left;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1)}.gbt-accordion-item__header:hover{background:var(--bg-hover)}.gbt-accordion-item__header:active{background:var(--bg-press)}.gbt-accordion-item__header:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:-2px}.gbt-accordion-item__label{flex:1;min-width:0}.gbt-accordion-item__chevron{flex-shrink:0;color:var(--text-secondary);transition:transform .2s cubic-bezier(.4,0,.2,1)}.gbt-accordion-item__header--open .gbt-accordion-item__chevron{transform:rotate(180deg)}.gbt-accordion-item__panel{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s cubic-bezier(.4,0,.2,1)}.gbt-accordion-item__panel--open{grid-template-rows:1fr}.gbt-accordion-item__panel-inner{overflow:hidden;min-height:0}.gbt-accordion-item__panel-content{padding:1rem}@media(prefers-reduced-motion:reduce){.gbt-accordion-item__header,.gbt-accordion-item__chevron,.gbt-accordion-item__panel{transition:none}}\n"]
|
|
224
224
|
}]
|
|
225
225
|
}],
|
|
226
226
|
propDecorators: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masmarino-gabarit-accordion.mjs","names":[],"sources":["../../../projects/gabarit/accordion/accordion.ts","../../../projects/gabarit/accordion/accordion-item/accordion-item.ts","../../../projects/gabarit/accordion/accordion-item/accordion-item.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n contentChildren,\n effect,\n input,\n model,\n} from '@angular/core'\nimport { AccordionItem } from './accordion-item/accordion-item'\n\nexport type AccordionMode = 'single' | 'multiple'\n\nlet nextAccordionId = 0\n\n@Component({\n selector: 'gbt-accordion',\n standalone: true,\n imports: [],\n template: `\n <div class=\"gbt-accordion\">\n <ng-content></ng-content>\n </div>\n `,\n styleUrl: './accordion.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Accordion {\n id = input<string>(`gbt-accordion-${++nextAccordionId}`)\n mode = input<AccordionMode>('single')\n expanded = model<number[]>([])\n\n protected readonly items = contentChildren(AccordionItem)\n\n constructor() {\n effect(() => {\n const items = this.items()\n const expanded = this.expanded()\n const groupId = this.id()\n items.forEach((item, i) => item.setState(i, expanded.includes(i), groupId))\n })\n }\n\n toggle(index: number): void {\n const current = this.expanded()\n if (this.mode() === 'single') {\n this.expanded.set(current.includes(index) ? [] : [index])\n return\n }\n this.expanded.set(\n current.includes(index) ? current.filter((i) => i !== index) : [...current, index],\n )\n }\n\n focusHeader(index: number): void {\n const items = this.items()\n const count = items.length\n if (count === 0) {\n return\n }\n const wrapped = ((index % count) + count) % count\n items[wrapped]?.focusHeader()\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core'\nimport { Icon } from '@masmarino/gabarit/icon'\nimport { Accordion } from '../accordion'\n\n@Component({\n selector: 'gbt-accordion-item',\n standalone: true,\n imports: [Icon],\n templateUrl: './accordion-item.html',\n styleUrl: './accordion-item.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AccordionItem {\n private readonly parent = inject(Accordion)\n private readonly header = viewChild<ElementRef<HTMLButtonElement>>('header')\n\n label = input.required<string>()\n\n protected readonly active = signal(false)\n protected readonly index = signal(0)\n protected readonly groupId = signal('')\n\n protected readonly headerId = computed(() => `${this.groupId()}-header-${this.index()}`)\n protected readonly panelId = computed(() => `${this.groupId()}-panel-${this.index()}`)\n\n setState(index: number, active: boolean, groupId: string): void {\n this.index.set(index)\n this.active.set(active)\n this.groupId.set(groupId)\n }\n\n focusHeader(): void {\n this.header()?.nativeElement.focus()\n }\n\n protected toggle(): void {\n this.parent.toggle(this.index())\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n this.parent.focusHeader(this.index() + 1)\n } else if (event.key === 'ArrowUp') {\n event.preventDefault()\n this.parent.focusHeader(this.index() - 1)\n }\n }\n}\n","<button\n #header\n type=\"button\"\n class=\"gbt-accordion-item__header\"\n [class.gbt-accordion-item__header--open]=\"active()\"\n [id]=\"headerId()\"\n [attr.aria-expanded]=\"active()\"\n [attr.aria-controls]=\"panelId()\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"gbt-accordion-item__label\">{{ label() }}</span>\n <gbt-icon name=\"chevron-down\" class=\"gbt-accordion-item__chevron\" aria-hidden=\"true\" />\n</button>\n<div\n class=\"gbt-accordion-item__panel\"\n [class.gbt-accordion-item__panel--open]=\"active()\"\n [id]=\"panelId()\"\n [attr.aria-labelledby]=\"headerId()\"\n [attr.inert]=\"active() ? null : ''\"\n>\n <div class=\"gbt-accordion-item__panel-inner\">\n <div class=\"gbt-accordion-item__panel-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n"],"mappings":";;;AAYA,IAAI,kBAAkB;AActB,IAAa,YAAb,MAAa,UAAS;CACpB,KAAK,MAAc,iBAAiB,EAAE,mBAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CACxD,OAAO,MAAqB,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACrC,WAAW,MAAgB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAEX,QAAQ,gBAAgB,eAAc,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEzD,cAAA;EACE,aAAY;GACV,MAAM,QAAQ,KAAK,MAAK;GACxB,MAAM,WAAW,KAAK,SAAQ;GAC9B,MAAM,UAAU,KAAK,GAAE;GACvB,MAAM,SAAS,MAAM,MAAM,KAAK,SAAS,GAAG,SAAS,SAAS,CAAC,GAAG,OAAO,CAAC;EAC5E,CAAC;CACH;CAEA,OAAO,OAAa;EAClB,MAAM,UAAU,KAAK,SAAQ;EAC7B,IAAI,KAAK,KAAI,MAAO,UAAU;GAC5B,KAAK,SAAS,IAAI,QAAQ,SAAS,KAAK,IAAI,CAAA,IAAK,CAAC,KAAK,CAAC;GACxD;EACF;EACA,KAAK,SAAS,IACZ,QAAQ,SAAS,KAAK,IAAI,QAAQ,QAAQ,MAAM,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,KAAK,CAAC;CAEtF;CAEA,YAAY,OAAa;EACvB,MAAM,QAAQ,KAAK,MAAK;EACxB,MAAM,QAAQ,MAAM;EACpB,IAAI,UAAU,GACZ;EAGF,OADkB,QAAQ,QAAS,SAAS,MAC9B,EAAE,YAAW;CAC7B;CAnCW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAS,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAT,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAS,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,IAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA,EAAA,UAAA,iBAAA;EAAA,SAAA,CAAA;GAAA,cAAA;GAAA,WAKuB;GAAa,UAAA;EAAA,CAAA;EAAA,UAAA;EAAA,UAb9C;;;;;EAIT,UAAA;EAAA,QAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"masmarino-gabarit-accordion.mjs","names":[],"sources":["../../../projects/gabarit/accordion/accordion.ts","../../../projects/gabarit/accordion/accordion-item/accordion-item.ts","../../../projects/gabarit/accordion/accordion-item/accordion-item.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n contentChildren,\n effect,\n input,\n model,\n} from '@angular/core'\nimport { AccordionItem } from './accordion-item/accordion-item'\n\nexport type AccordionMode = 'single' | 'multiple'\n\nlet nextAccordionId = 0\n\n@Component({\n selector: 'gbt-accordion',\n standalone: true,\n imports: [],\n template: `\n <div class=\"gbt-accordion\">\n <ng-content></ng-content>\n </div>\n `,\n styleUrl: './accordion.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Accordion {\n id = input<string>(`gbt-accordion-${++nextAccordionId}`)\n mode = input<AccordionMode>('single')\n expanded = model<number[]>([])\n\n protected readonly items = contentChildren(AccordionItem)\n\n constructor() {\n effect(() => {\n const items = this.items()\n const expanded = this.expanded()\n const groupId = this.id()\n items.forEach((item, i) => item.setState(i, expanded.includes(i), groupId))\n })\n }\n\n toggle(index: number): void {\n const current = this.expanded()\n if (this.mode() === 'single') {\n this.expanded.set(current.includes(index) ? [] : [index])\n return\n }\n this.expanded.set(\n current.includes(index) ? current.filter((i) => i !== index) : [...current, index],\n )\n }\n\n focusHeader(index: number): void {\n const items = this.items()\n const count = items.length\n if (count === 0) {\n return\n }\n const wrapped = ((index % count) + count) % count\n items[wrapped]?.focusHeader()\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core'\nimport { Icon } from '@masmarino/gabarit/icon'\nimport { Accordion } from '../accordion'\n\n@Component({\n selector: 'gbt-accordion-item',\n standalone: true,\n imports: [Icon],\n templateUrl: './accordion-item.html',\n styleUrl: './accordion-item.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AccordionItem {\n private readonly parent = inject(Accordion)\n private readonly header = viewChild<ElementRef<HTMLButtonElement>>('header')\n\n label = input.required<string>()\n\n protected readonly active = signal(false)\n protected readonly index = signal(0)\n protected readonly groupId = signal('')\n\n protected readonly headerId = computed(() => `${this.groupId()}-header-${this.index()}`)\n protected readonly panelId = computed(() => `${this.groupId()}-panel-${this.index()}`)\n\n setState(index: number, active: boolean, groupId: string): void {\n this.index.set(index)\n this.active.set(active)\n this.groupId.set(groupId)\n }\n\n focusHeader(): void {\n this.header()?.nativeElement.focus()\n }\n\n protected toggle(): void {\n this.parent.toggle(this.index())\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n this.parent.focusHeader(this.index() + 1)\n } else if (event.key === 'ArrowUp') {\n event.preventDefault()\n this.parent.focusHeader(this.index() - 1)\n }\n }\n}\n","<button\n #header\n type=\"button\"\n class=\"gbt-accordion-item__header\"\n [class.gbt-accordion-item__header--open]=\"active()\"\n [id]=\"headerId()\"\n [attr.aria-expanded]=\"active()\"\n [attr.aria-controls]=\"panelId()\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"gbt-accordion-item__label\">{{ label() }}</span>\n <gbt-icon name=\"chevron-down\" class=\"gbt-accordion-item__chevron\" aria-hidden=\"true\" />\n</button>\n<div\n class=\"gbt-accordion-item__panel\"\n [class.gbt-accordion-item__panel--open]=\"active()\"\n [id]=\"panelId()\"\n [attr.aria-labelledby]=\"headerId()\"\n [attr.inert]=\"active() ? null : ''\"\n>\n <div class=\"gbt-accordion-item__panel-inner\">\n <div class=\"gbt-accordion-item__panel-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n"],"mappings":";;;AAYA,IAAI,kBAAkB;AActB,IAAa,YAAb,MAAa,UAAS;CACpB,KAAK,MAAc,iBAAiB,EAAE,mBAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CACxD,OAAO,MAAqB,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACrC,WAAW,MAAgB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,C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AAA,MAAA;EAAa,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,OAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,aAAA,CAAA;GAAA,cAAA;GAAA,OAAA;GAAA,WAAA,CAAA,QAAA;GAAA,aAAA;GAAA,UAAA;EAAA,CAAA;EAAA,UAAA;EAAA,UCrB1B;EA2BA,QAAA,CAAA,mwCAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MDXY;GAAI,UAAA;GAAA,QAAA,CAAA,MAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAKH,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EARzB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAoB,YAClB;GAAI,SACP,CAAC,IAAI;GAAC,iBAGE,wBAAwB;GAAM,UAAA;GAAA,QAAA,CAAA,mwCAAA;EAAA,CAAA;CAIoB,CAAA;CAAA,gBAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -106,7 +106,7 @@ var Alert = class Alert {
|
|
|
106
106
|
outputs: { dismissed: "dismissed" },
|
|
107
107
|
ngImport: i0,
|
|
108
108
|
template: "<div\n class=\"gbt-alert\"\n [attr.data-variant]=\"variant()\"\n [attr.data-heading]=\"heading() ? '' : null\"\n [attr.data-size]=\"size() === 'md' ? null : size()\"\n [attr.data-appearance]=\"appearance() === 'default' ? null : appearance()\"\n [attr.data-icon-align]=\"iconAlign() === 'auto' ? null : iconAlign()\"\n [attr.role]=\"role()\"\n [attr.aria-atomic]=\"role() ? 'true' : null\"\n>\n <span class=\"gbt-alert__icon\">\n <gbt-icon [name]=\"icon()\" aria-hidden=\"true\" />\n </span>\n <div class=\"gbt-alert__content\">\n <div class=\"gbt-alert__message\">\n @if (heading()) {\n <p class=\"gbt-alert__heading\">{{ heading() }}</p>\n }\n <ng-content />\n </div>\n <div class=\"gbt-alert__actions\"><ng-content select=\"[alert-actions]\" /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"gbt-alert__close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"dismissed.emit()\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n }\n</div>\n",
|
|
109
|
-
styles: [".gbt-alert{--gbt-alert-icon: 1.5rem;--gbt-alert-font: .875rem;--gbt-alert-line: calc(var(--gbt-alert-font) * 1.4);--gbt-alert-close: 26px;box-sizing:border-box;display:flex;align-items:center;gap:.625rem;width:100%;padding:.75rem 1rem;border-radius:var(--site-border-radius-
|
|
109
|
+
styles: [".gbt-alert{--gbt-alert-icon: 1.5rem;--gbt-alert-font: .875rem;--gbt-alert-line: calc(var(--gbt-alert-font) * 1.4);--gbt-alert-close: 26px;box-sizing:border-box;display:flex;align-items:center;gap:.625rem;width:100%;padding:.75rem 1rem;border-radius:var(--site-border-radius-lg)}.gbt-alert[data-variant=success]{--gbt-alert-bg: var(--color-success-bg);background:var(--color-success-bg);color:var(--color-success-bg-text)}.gbt-alert[data-variant=warning]{--gbt-alert-bg: var(--color-warning-bg);background:var(--color-warning-bg);color:var(--color-warning-bg-text)}.gbt-alert[data-variant=error]{--gbt-alert-bg: var(--color-error-bg);background:var(--color-error-bg);color:var(--color-error-bg-text)}.gbt-alert[data-variant=info]{--gbt-alert-bg: var(--color-info-bg);background:var(--color-info-bg);color:var(--color-info-bg-text)}.gbt-alert[data-variant=neutral]{--gbt-alert-bg: var(--gbt-glass-thin);background:var(--gbt-glass-thin);-webkit-backdrop-filter:var(--gbt-glass-blur);backdrop-filter:var(--gbt-glass-blur);box-shadow:var(--gbt-glass-rim-light),0 0 transparent;--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text)}@media(prefers-reduced-transparency:reduce){.gbt-alert[data-variant=neutral]{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-alert[data-variant=neutral]{box-shadow:inset 0 0 0 1px var(--border-color),0 0 transparent}}.gbt-alert[data-variant=neutral]{color:var(--text-primary)}.gbt-alert[data-size=sm]{--gbt-alert-icon: 1.25rem;--gbt-alert-font: .8125rem;gap:.5rem;padding:.5rem .75rem}.gbt-alert[data-appearance=subtle]{background:color-mix(in srgb,var(--gbt-alert-bg) 55%,var(--bg-principal))}.gbt-alert[data-appearance=subtle] .gbt-alert__icon{border-width:1px}.gbt-alert__icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;box-sizing:border-box;width:var(--gbt-alert-icon);height:var(--gbt-alert-icon);border:1.5px solid currentColor;border-radius:50%}.gbt-alert__icon gbt-icon{width:.875em;height:.875em}.gbt-alert__content{flex:1 1 auto;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;font-size:var(--gbt-alert-font);line-height:1.4}.gbt-alert__message{flex:1 1 14rem}.gbt-alert__heading{margin:0 0 .125rem;font-weight:600}.gbt-alert__actions{display:flex;flex:0 1 auto;flex-wrap:wrap;max-width:100%;align-items:center;gap:.5rem}.gbt-alert__actions:empty{display:none}.gbt-alert[data-heading] .gbt-alert__content{flex-direction:column;align-items:flex-start;gap:.5rem}.gbt-alert[data-heading] .gbt-alert__message{flex:none;width:100%}.gbt-alert__close{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--gbt-alert-close);height:var(--gbt-alert-close);background:none;border:none;border-radius:50%;color:currentColor;opacity:.7;cursor:pointer;transition:opacity var(--site-transition-fast)}.gbt-alert__close:hover,.gbt-alert__close:focus-visible{opacity:1}.gbt-alert__close:active{opacity:.6}.gbt-alert__close:focus-visible{outline:2px solid currentColor;outline-offset:2px}.gbt-alert[data-icon-align=start],.gbt-alert[data-heading]:not([data-icon-align=center]){align-items:flex-start}.gbt-alert[data-icon-align=start] .gbt-alert__content,.gbt-alert[data-heading]:not([data-icon-align=center]) .gbt-alert__content{align-items:flex-start}.gbt-alert[data-icon-align=start] .gbt-alert__message,.gbt-alert[data-heading]:not([data-icon-align=center]) .gbt-alert__message{padding-block:max(0px,(var(--gbt-alert-icon) - var(--gbt-alert-line)) / 2)}.gbt-alert[data-icon-align=start]:not([data-heading]) .gbt-alert__actions,.gbt-alert[data-heading]:not([data-icon-align=center]):not([data-heading]) .gbt-alert__actions{min-height:var(--gbt-alert-icon);margin-block:-.25rem}.gbt-alert[data-icon-align=start] .gbt-alert__close,.gbt-alert[data-heading]:not([data-icon-align=center]) .gbt-alert__close{margin-block:calc((var(--gbt-alert-icon) - var(--gbt-alert-close)) / 2)}.gbt-alert:not([data-icon-align=center]):has(>.gbt-alert__content>.gbt-alert__actions:not(:empty)){align-items:flex-start}.gbt-alert:not([data-icon-align=center]):has(>.gbt-alert__content>.gbt-alert__actions:not(:empty)) .gbt-alert__content{align-items:flex-start}.gbt-alert:not([data-icon-align=center]):has(>.gbt-alert__content>.gbt-alert__actions:not(:empty)) .gbt-alert__message{padding-block:max(0px,(var(--gbt-alert-icon) - var(--gbt-alert-line)) / 2)}.gbt-alert:not([data-icon-align=center]):has(>.gbt-alert__content>.gbt-alert__actions:not(:empty)):not([data-heading]) .gbt-alert__actions{min-height:var(--gbt-alert-icon);margin-block:-.25rem}.gbt-alert:not([data-icon-align=center]):has(>.gbt-alert__content>.gbt-alert__actions:not(:empty)) .gbt-alert__close{margin-block:calc((var(--gbt-alert-icon) - var(--gbt-alert-close)) / 2)}@media(pointer:coarse){.gbt-alert{--gbt-alert-close: 44px}.gbt-alert__close{margin-block:calc((var(--gbt-alert-icon) - var(--gbt-alert-close)) / 2);margin-inline-end:-.5rem}.gbt-alert__actions ::ng-deep .gbt-button{min-height:44px}}@media(max-width:599px){.gbt-alert__actions{--gbt-control-height-sm: 2.75rem;--gbt-control-height-md: 2.75rem}}@media(prefers-reduced-motion:reduce){.gbt-alert__close{transition:none}}\n"],
|
|
110
110
|
dependencies: [{
|
|
111
111
|
kind: "component",
|
|
112
112
|
type: Icon,
|
|
@@ -129,7 +129,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
129
129
|
imports: [Icon],
|
|
130
130
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
131
131
|
template: "<div\n class=\"gbt-alert\"\n [attr.data-variant]=\"variant()\"\n [attr.data-heading]=\"heading() ? '' : null\"\n [attr.data-size]=\"size() === 'md' ? null : size()\"\n [attr.data-appearance]=\"appearance() === 'default' ? null : appearance()\"\n [attr.data-icon-align]=\"iconAlign() === 'auto' ? null : iconAlign()\"\n [attr.role]=\"role()\"\n [attr.aria-atomic]=\"role() ? 'true' : null\"\n>\n <span class=\"gbt-alert__icon\">\n <gbt-icon [name]=\"icon()\" aria-hidden=\"true\" />\n </span>\n <div class=\"gbt-alert__content\">\n <div class=\"gbt-alert__message\">\n @if (heading()) {\n <p class=\"gbt-alert__heading\">{{ heading() }}</p>\n }\n <ng-content />\n </div>\n <div class=\"gbt-alert__actions\"><ng-content select=\"[alert-actions]\" /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"gbt-alert__close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"dismissed.emit()\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n }\n</div>\n",
|
|
132
|
-
styles: [".gbt-alert{--gbt-alert-icon: 1.5rem;--gbt-alert-font: .875rem;--gbt-alert-line: calc(var(--gbt-alert-font) * 1.4);--gbt-alert-close: 26px;box-sizing:border-box;display:flex;align-items:center;gap:.625rem;width:100%;padding:.75rem 1rem;border-radius:var(--site-border-radius-
|
|
132
|
+
styles: [".gbt-alert{--gbt-alert-icon: 1.5rem;--gbt-alert-font: .875rem;--gbt-alert-line: calc(var(--gbt-alert-font) * 1.4);--gbt-alert-close: 26px;box-sizing:border-box;display:flex;align-items:center;gap:.625rem;width:100%;padding:.75rem 1rem;border-radius:var(--site-border-radius-lg)}.gbt-alert[data-variant=success]{--gbt-alert-bg: var(--color-success-bg);background:var(--color-success-bg);color:var(--color-success-bg-text)}.gbt-alert[data-variant=warning]{--gbt-alert-bg: var(--color-warning-bg);background:var(--color-warning-bg);color:var(--color-warning-bg-text)}.gbt-alert[data-variant=error]{--gbt-alert-bg: var(--color-error-bg);background:var(--color-error-bg);color:var(--color-error-bg-text)}.gbt-alert[data-variant=info]{--gbt-alert-bg: var(--color-info-bg);background:var(--color-info-bg);color:var(--color-info-bg-text)}.gbt-alert[data-variant=neutral]{--gbt-alert-bg: var(--gbt-glass-thin);background:var(--gbt-glass-thin);-webkit-backdrop-filter:var(--gbt-glass-blur);backdrop-filter:var(--gbt-glass-blur);box-shadow:var(--gbt-glass-rim-light),0 0 transparent;--text-discret: var(--gbt-ground-text-discret);--border-color: var(--gbt-ground-border);--color-success-text: var(--color-success-bg-text);--color-warning-text: var(--color-warning-bg-text);--color-error-text: var(--color-error-bg-text)}@media(prefers-reduced-transparency:reduce){.gbt-alert[data-variant=neutral]{background:linear-gradient(var(--gbt-glass-thick),var(--gbt-glass-thick)),var(--bg-principal);-webkit-backdrop-filter:none;backdrop-filter:none}}@media(prefers-contrast:more){.gbt-alert[data-variant=neutral]{box-shadow:inset 0 0 0 1px var(--border-color),0 0 transparent}}.gbt-alert[data-variant=neutral]{color:var(--text-primary)}.gbt-alert[data-size=sm]{--gbt-alert-icon: 1.25rem;--gbt-alert-font: .8125rem;gap:.5rem;padding:.5rem .75rem}.gbt-alert[data-appearance=subtle]{background:color-mix(in srgb,var(--gbt-alert-bg) 55%,var(--bg-principal))}.gbt-alert[data-appearance=subtle] .gbt-alert__icon{border-width:1px}.gbt-alert__icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;box-sizing:border-box;width:var(--gbt-alert-icon);height:var(--gbt-alert-icon);border:1.5px solid currentColor;border-radius:50%}.gbt-alert__icon gbt-icon{width:.875em;height:.875em}.gbt-alert__content{flex:1 1 auto;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;font-size:var(--gbt-alert-font);line-height:1.4}.gbt-alert__message{flex:1 1 14rem}.gbt-alert__heading{margin:0 0 .125rem;font-weight:600}.gbt-alert__actions{display:flex;flex:0 1 auto;flex-wrap:wrap;max-width:100%;align-items:center;gap:.5rem}.gbt-alert__actions:empty{display:none}.gbt-alert[data-heading] .gbt-alert__content{flex-direction:column;align-items:flex-start;gap:.5rem}.gbt-alert[data-heading] .gbt-alert__message{flex:none;width:100%}.gbt-alert__close{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--gbt-alert-close);height:var(--gbt-alert-close);background:none;border:none;border-radius:50%;color:currentColor;opacity:.7;cursor:pointer;transition:opacity var(--site-transition-fast)}.gbt-alert__close:hover,.gbt-alert__close:focus-visible{opacity:1}.gbt-alert__close:active{opacity:.6}.gbt-alert__close:focus-visible{outline:2px solid currentColor;outline-offset:2px}.gbt-alert[data-icon-align=start],.gbt-alert[data-heading]:not([data-icon-align=center]){align-items:flex-start}.gbt-alert[data-icon-align=start] .gbt-alert__content,.gbt-alert[data-heading]:not([data-icon-align=center]) .gbt-alert__content{align-items:flex-start}.gbt-alert[data-icon-align=start] .gbt-alert__message,.gbt-alert[data-heading]:not([data-icon-align=center]) .gbt-alert__message{padding-block:max(0px,(var(--gbt-alert-icon) - var(--gbt-alert-line)) / 2)}.gbt-alert[data-icon-align=start]:not([data-heading]) .gbt-alert__actions,.gbt-alert[data-heading]:not([data-icon-align=center]):not([data-heading]) .gbt-alert__actions{min-height:var(--gbt-alert-icon);margin-block:-.25rem}.gbt-alert[data-icon-align=start] .gbt-alert__close,.gbt-alert[data-heading]:not([data-icon-align=center]) .gbt-alert__close{margin-block:calc((var(--gbt-alert-icon) - var(--gbt-alert-close)) / 2)}.gbt-alert:not([data-icon-align=center]):has(>.gbt-alert__content>.gbt-alert__actions:not(:empty)){align-items:flex-start}.gbt-alert:not([data-icon-align=center]):has(>.gbt-alert__content>.gbt-alert__actions:not(:empty)) .gbt-alert__content{align-items:flex-start}.gbt-alert:not([data-icon-align=center]):has(>.gbt-alert__content>.gbt-alert__actions:not(:empty)) .gbt-alert__message{padding-block:max(0px,(var(--gbt-alert-icon) - var(--gbt-alert-line)) / 2)}.gbt-alert:not([data-icon-align=center]):has(>.gbt-alert__content>.gbt-alert__actions:not(:empty)):not([data-heading]) .gbt-alert__actions{min-height:var(--gbt-alert-icon);margin-block:-.25rem}.gbt-alert:not([data-icon-align=center]):has(>.gbt-alert__content>.gbt-alert__actions:not(:empty)) .gbt-alert__close{margin-block:calc((var(--gbt-alert-icon) - var(--gbt-alert-close)) / 2)}@media(pointer:coarse){.gbt-alert{--gbt-alert-close: 44px}.gbt-alert__close{margin-block:calc((var(--gbt-alert-icon) - var(--gbt-alert-close)) / 2);margin-inline-end:-.5rem}.gbt-alert__actions ::ng-deep .gbt-button{min-height:44px}}@media(max-width:599px){.gbt-alert__actions{--gbt-control-height-sm: 2.75rem;--gbt-control-height-md: 2.75rem}}@media(prefers-reduced-motion:reduce){.gbt-alert__close{transition:none}}\n"]
|
|
133
133
|
}]
|
|
134
134
|
}],
|
|
135
135
|
propDecorators: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masmarino-gabarit-alert.mjs","names":[],"sources":["../../../projects/gabarit/alert/alert.ts","../../../projects/gabarit/alert/alert.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n computed,\n input,\n output,\n} from '@angular/core'\nimport { Icon } from '@masmarino/gabarit/icon'\n\nexport type AlertVariant = 'info' | 'success' | 'warning' | 'error' | 'neutral'\n\nexport type AlertLive = 'auto' | 'assertive' | 'polite' | 'off'\nexport type AlertSize = 'md' | 'sm'\nexport type AlertAppearance = 'default' | 'subtle'\nexport type AlertIconAlign = 'auto' | 'center' | 'start'\n\nconst ASSERTIVE_VARIANTS: ReadonlySet<AlertVariant> = new Set(['warning', 'error'])\n\nconst VARIANT_ICONS: Record<AlertVariant, string> = {\n success: 'check-circle',\n error: 'alert-circle',\n warning: 'alert-triangle',\n info: 'info',\n neutral: 'info',\n}\n\n@Component({\n selector: 'gbt-alert',\n standalone: true,\n imports: [Icon],\n templateUrl: './alert.html',\n styleUrl: './alert.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Alert {\n variant = input<AlertVariant>('info')\n dismissible = input(false, { transform: booleanAttribute })\n closeLabel = input<string>('Dismiss')\n\n live = input<AlertLive>('auto')\n heading = input<string>('')\n size = input<AlertSize>('md')\n appearance = input<AlertAppearance>('default')\n iconAlign = input<AlertIconAlign>('auto')\n\n dismissed = output<void>()\n\n protected readonly role = computed(() => {\n switch (this.live()) {\n case 'assertive':\n return 'alert'\n case 'polite':\n return 'status'\n case 'off':\n return null\n default:\n return ASSERTIVE_VARIANTS.has(this.variant()) ? 'alert' : 'status'\n }\n })\n\n protected readonly icon = computed(() => VARIANT_ICONS[this.variant()])\n}\n","<div\n class=\"gbt-alert\"\n [attr.data-variant]=\"variant()\"\n [attr.data-heading]=\"heading() ? '' : null\"\n [attr.data-size]=\"size() === 'md' ? null : size()\"\n [attr.data-appearance]=\"appearance() === 'default' ? null : appearance()\"\n [attr.data-icon-align]=\"iconAlign() === 'auto' ? null : iconAlign()\"\n [attr.role]=\"role()\"\n [attr.aria-atomic]=\"role() ? 'true' : null\"\n>\n <span class=\"gbt-alert__icon\">\n <gbt-icon [name]=\"icon()\" aria-hidden=\"true\" />\n </span>\n <div class=\"gbt-alert__content\">\n <div class=\"gbt-alert__message\">\n @if (heading()) {\n <p class=\"gbt-alert__heading\">{{ heading() }}</p>\n }\n <ng-content />\n </div>\n <div class=\"gbt-alert__actions\"><ng-content select=\"[alert-actions]\" /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"gbt-alert__close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"dismissed.emit()\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n }\n</div>\n"],"mappings":";;;AAiBA,MAAM,qCAAgD,IAAI,IAAI,CAAC,WAAW,OAAO,CAAC;AAElF,MAAM,gBAA8C;CAClD,SAAS;CACT,OAAO;CACP,SAAS;CACT,MAAM;CACN,SAAS;AACV;AAUD,IAAa,QAAb,MAAa,MAAK;CAChB,UAAU,MAAoB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACrC,cAAc,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACxD,aAAa,MAAc,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAErC,OAAO,MAAiB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,UAAU,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,OAAO,MAAiB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,aAAa,MAAuB,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAC9C,YAAY,MAAsB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAEzC,YAAY,OAAM;CAEC,OAAO,eAAc;EACtC,QAAQ,KAAK,KAAI,GAAjB;GACE,KAAK,aACH,OAAO;GACT,KAAK,UACH,OAAO;GACT,KAAK,OACH,O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":3,"file":"masmarino-gabarit-alert.mjs","names":[],"sources":["../../../projects/gabarit/alert/alert.ts","../../../projects/gabarit/alert/alert.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n computed,\n input,\n output,\n} from '@angular/core'\nimport { Icon } from '@masmarino/gabarit/icon'\n\nexport type AlertVariant = 'info' | 'success' | 'warning' | 'error' | 'neutral'\n\nexport type AlertLive = 'auto' | 'assertive' | 'polite' | 'off'\nexport type AlertSize = 'md' | 'sm'\nexport type AlertAppearance = 'default' | 'subtle'\nexport type AlertIconAlign = 'auto' | 'center' | 'start'\n\nconst ASSERTIVE_VARIANTS: ReadonlySet<AlertVariant> = new Set(['warning', 'error'])\n\nconst VARIANT_ICONS: Record<AlertVariant, string> = {\n success: 'check-circle',\n error: 'alert-circle',\n warning: 'alert-triangle',\n info: 'info',\n neutral: 'info',\n}\n\n@Component({\n selector: 'gbt-alert',\n standalone: true,\n imports: [Icon],\n templateUrl: './alert.html',\n styleUrl: './alert.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Alert {\n variant = input<AlertVariant>('info')\n dismissible = input(false, { transform: booleanAttribute })\n closeLabel = input<string>('Dismiss')\n\n live = input<AlertLive>('auto')\n heading = input<string>('')\n size = input<AlertSize>('md')\n appearance = input<AlertAppearance>('default')\n iconAlign = input<AlertIconAlign>('auto')\n\n dismissed = output<void>()\n\n protected readonly role = computed(() => {\n switch (this.live()) {\n case 'assertive':\n return 'alert'\n case 'polite':\n return 'status'\n case 'off':\n return null\n default:\n return ASSERTIVE_VARIANTS.has(this.variant()) ? 'alert' : 'status'\n }\n })\n\n protected readonly icon = computed(() => VARIANT_ICONS[this.variant()])\n}\n","<div\n class=\"gbt-alert\"\n [attr.data-variant]=\"variant()\"\n [attr.data-heading]=\"heading() ? '' : null\"\n [attr.data-size]=\"size() === 'md' ? null : size()\"\n [attr.data-appearance]=\"appearance() === 'default' ? null : appearance()\"\n [attr.data-icon-align]=\"iconAlign() === 'auto' ? null : iconAlign()\"\n [attr.role]=\"role()\"\n [attr.aria-atomic]=\"role() ? 'true' : null\"\n>\n <span class=\"gbt-alert__icon\">\n <gbt-icon [name]=\"icon()\" aria-hidden=\"true\" />\n </span>\n <div class=\"gbt-alert__content\">\n <div class=\"gbt-alert__message\">\n @if (heading()) {\n <p class=\"gbt-alert__heading\">{{ heading() }}</p>\n }\n <ng-content />\n </div>\n <div class=\"gbt-alert__actions\"><ng-content select=\"[alert-actions]\" /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"gbt-alert__close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"dismissed.emit()\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n }\n</div>\n"],"mappings":";;;AAiBA,MAAM,qCAAgD,IAAI,IAAI,CAAC,WAAW,OAAO,CAAC;AAElF,MAAM,gBAA8C;CAClD,SAAS;CACT,OAAO;CACP,SAAS;CACT,MAAM;CACN,SAAS;AACV;AAUD,IAAa,QAAb,MAAa,MAAK;CAChB,UAAU,MAAoB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACrC,cAAc,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACxD,aAAa,MAAc,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAErC,OAAO,MAAiB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,UAAU,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,OAAO,MAAiB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,aAAa,MAAuB,WAAU,GAAA,YAAA,CAAA,EAAA,WAA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