@masmarino/gabarit 4.0.1 → 4.1.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.
Files changed (104) hide show
  1. package/button/README.md +11 -4
  2. package/fesm2022/masmarino-gabarit-alert.mjs +2 -2
  3. package/fesm2022/masmarino-gabarit-alert.mjs.map +1 -1
  4. package/fesm2022/masmarino-gabarit-app-shell.mjs +2 -2
  5. package/fesm2022/masmarino-gabarit-app-shell.mjs.map +1 -1
  6. package/fesm2022/masmarino-gabarit-auth-register.mjs +2 -2
  7. package/fesm2022/masmarino-gabarit-auth-register.mjs.map +1 -1
  8. package/fesm2022/masmarino-gabarit-autocomplete.mjs +2 -2
  9. package/fesm2022/masmarino-gabarit-autocomplete.mjs.map +1 -1
  10. package/fesm2022/masmarino-gabarit-avatar-group.mjs +2 -2
  11. package/fesm2022/masmarino-gabarit-avatar-group.mjs.map +1 -1
  12. package/fesm2022/masmarino-gabarit-badge.mjs +4 -4
  13. package/fesm2022/masmarino-gabarit-badge.mjs.map +1 -1
  14. package/fesm2022/masmarino-gabarit-button.mjs +2 -2
  15. package/fesm2022/masmarino-gabarit-button.mjs.map +1 -1
  16. package/fesm2022/masmarino-gabarit-card.mjs +4 -4
  17. package/fesm2022/masmarino-gabarit-card.mjs.map +1 -1
  18. package/fesm2022/masmarino-gabarit-chart.mjs +6 -6
  19. package/fesm2022/masmarino-gabarit-chart.mjs.map +1 -1
  20. package/fesm2022/masmarino-gabarit-checkbox.mjs +4 -4
  21. package/fesm2022/masmarino-gabarit-checkbox.mjs.map +1 -1
  22. package/fesm2022/masmarino-gabarit-command-palette.mjs +4 -4
  23. package/fesm2022/masmarino-gabarit-command-palette.mjs.map +1 -1
  24. package/fesm2022/masmarino-gabarit-copy-field.mjs +2 -2
  25. package/fesm2022/masmarino-gabarit-copy-field.mjs.map +1 -1
  26. package/fesm2022/masmarino-gabarit-date-picker.mjs +4 -4
  27. package/fesm2022/masmarino-gabarit-date-picker.mjs.map +1 -1
  28. package/fesm2022/masmarino-gabarit-disclosure.mjs +2 -2
  29. package/fesm2022/masmarino-gabarit-disclosure.mjs.map +1 -1
  30. package/fesm2022/masmarino-gabarit-docs.mjs +10 -10
  31. package/fesm2022/masmarino-gabarit-docs.mjs.map +1 -1
  32. package/fesm2022/masmarino-gabarit-drawer.mjs +2 -2
  33. package/fesm2022/masmarino-gabarit-drawer.mjs.map +1 -1
  34. package/fesm2022/masmarino-gabarit-file-upload.mjs +2 -2
  35. package/fesm2022/masmarino-gabarit-file-upload.mjs.map +1 -1
  36. package/fesm2022/masmarino-gabarit-input.mjs +2 -2
  37. package/fesm2022/masmarino-gabarit-input.mjs.map +1 -1
  38. package/fesm2022/masmarino-gabarit-job-graph.mjs +2 -2
  39. package/fesm2022/masmarino-gabarit-job-graph.mjs.map +1 -1
  40. package/fesm2022/masmarino-gabarit-list-row.mjs +2 -2
  41. package/fesm2022/masmarino-gabarit-list-row.mjs.map +1 -1
  42. package/fesm2022/masmarino-gabarit-list-toolbar.mjs +2 -2
  43. package/fesm2022/masmarino-gabarit-list-toolbar.mjs.map +1 -1
  44. package/fesm2022/masmarino-gabarit-menu.mjs +2 -2
  45. package/fesm2022/masmarino-gabarit-menu.mjs.map +1 -1
  46. package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs +4 -4
  47. package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs.map +1 -1
  48. package/fesm2022/masmarino-gabarit-mfa-settings.mjs +2 -2
  49. package/fesm2022/masmarino-gabarit-mfa-settings.mjs.map +1 -1
  50. package/fesm2022/masmarino-gabarit-modal.mjs +2 -2
  51. package/fesm2022/masmarino-gabarit-modal.mjs.map +1 -1
  52. package/fesm2022/masmarino-gabarit-nav-tabs.mjs +2 -2
  53. package/fesm2022/masmarino-gabarit-nav-tabs.mjs.map +1 -1
  54. package/fesm2022/masmarino-gabarit-pagination.mjs +2 -2
  55. package/fesm2022/masmarino-gabarit-pagination.mjs.map +1 -1
  56. package/fesm2022/masmarino-gabarit-passkey-settings.mjs +2 -2
  57. package/fesm2022/masmarino-gabarit-passkey-settings.mjs.map +1 -1
  58. package/fesm2022/masmarino-gabarit-popover.mjs +2 -2
  59. package/fesm2022/masmarino-gabarit-popover.mjs.map +1 -1
  60. package/fesm2022/masmarino-gabarit-search-bar.mjs +2 -2
  61. package/fesm2022/masmarino-gabarit-search-bar.mjs.map +1 -1
  62. package/fesm2022/masmarino-gabarit-secret-reveal.mjs +2 -2
  63. package/fesm2022/masmarino-gabarit-secret-reveal.mjs.map +1 -1
  64. package/fesm2022/masmarino-gabarit-segmented-control.mjs +47 -5
  65. package/fesm2022/masmarino-gabarit-segmented-control.mjs.map +1 -1
  66. package/fesm2022/masmarino-gabarit-select.mjs +2 -2
  67. package/fesm2022/masmarino-gabarit-select.mjs.map +1 -1
  68. package/fesm2022/masmarino-gabarit-skeleton-list.mjs +2 -2
  69. package/fesm2022/masmarino-gabarit-skeleton-list.mjs.map +1 -1
  70. package/fesm2022/masmarino-gabarit-skeleton.mjs +2 -2
  71. package/fesm2022/masmarino-gabarit-skeleton.mjs.map +1 -1
  72. package/fesm2022/masmarino-gabarit-slider.mjs +2 -2
  73. package/fesm2022/masmarino-gabarit-slider.mjs.map +1 -1
  74. package/fesm2022/masmarino-gabarit-sparkline.mjs +2 -2
  75. package/fesm2022/masmarino-gabarit-sparkline.mjs.map +1 -1
  76. package/fesm2022/masmarino-gabarit-stat-tile.mjs +2 -2
  77. package/fesm2022/masmarino-gabarit-stat-tile.mjs.map +1 -1
  78. package/fesm2022/masmarino-gabarit-stepper.mjs +2 -2
  79. package/fesm2022/masmarino-gabarit-stepper.mjs.map +1 -1
  80. package/fesm2022/masmarino-gabarit-switch.mjs +2 -2
  81. package/fesm2022/masmarino-gabarit-switch.mjs.map +1 -1
  82. package/fesm2022/masmarino-gabarit-tabs.mjs +54 -5
  83. package/fesm2022/masmarino-gabarit-tabs.mjs.map +1 -1
  84. package/fesm2022/masmarino-gabarit-tag-input.mjs +2 -2
  85. package/fesm2022/masmarino-gabarit-tag-input.mjs.map +1 -1
  86. package/fesm2022/masmarino-gabarit-tag.mjs +2 -2
  87. package/fesm2022/masmarino-gabarit-tag.mjs.map +1 -1
  88. package/fesm2022/masmarino-gabarit-textarea.mjs +2 -2
  89. package/fesm2022/masmarino-gabarit-textarea.mjs.map +1 -1
  90. package/fesm2022/masmarino-gabarit-tooltip.mjs +2 -2
  91. package/fesm2022/masmarino-gabarit-tooltip.mjs.map +1 -1
  92. package/fesm2022/masmarino-gabarit-tree.mjs +2 -2
  93. package/fesm2022/masmarino-gabarit-tree.mjs.map +1 -1
  94. package/fesm2022/masmarino-gabarit.mjs +1 -1
  95. package/fesm2022/masmarino-gabarit.mjs.map +1 -1
  96. package/package.json +1 -1
  97. package/src/lib/tokens/_glass.scss +140 -0
  98. package/src/lib/tokens/_grounds.scss +10 -0
  99. package/src/lib/tokens/_themes.scss +2 -0
  100. package/src/lib/tokens/_utilities.scss +54 -4
  101. package/types/masmarino-gabarit-button.d.ts +1 -1
  102. package/types/masmarino-gabarit-segmented-control.d.ts +14 -0
  103. package/types/masmarino-gabarit-tabs.d.ts +14 -0
  104. package/types/masmarino-gabarit.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"masmarino-gabarit-secret-reveal.mjs","names":[],"sources":["../../../projects/gabarit/secret-reveal/secret-reveal.ts","../../../projects/gabarit/secret-reveal/secret-reveal.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Injector,\n effect,\n untracked,\n afterNextRender,\n inject,\n input,\n model,\n output,\n viewChild,\n} from '@angular/core'\nimport { Button } from '@masmarino/gabarit/button'\nimport { CopyButton, CopyButtonFeedback } from '@masmarino/gabarit/copy-button'\nimport { selectContents } from '@masmarino/gabarit/copy-button'\n\nlet nextSecretRevealId = 0\n\n@Component({\n selector: 'gbt-secret-reveal',\n standalone: true,\n imports: [Button, CopyButton],\n templateUrl: './secret-reveal.html',\n styleUrl: './secret-reveal.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-revealed]': 'revealed() ? \"\" : null',\n },\n})\nexport class SecretReveal {\n value = input.required<string>()\n revealed = model(false)\n label = input<string | null>(null)\n showLabel = input('Show the secret')\n hideLabel = input('Hide the secret')\n hiddenLabel = input('Secret hidden')\n copyLabel = input('Copy the secret')\n copiedText = input('Copied')\n failedText = input('Copy failed, secret shown and selected')\n feedbackMs = input(2000)\n feedback = input<CopyButtonFeedback>('bubble')\n maskLength = input(24)\n\n copied = output<string>()\n copyFailed = output<void>()\n\n protected readonly id = `gbt-secret-reveal-${++nextSecretRevealId}`\n protected readonly valueId = `${this.id}-value`\n protected readonly labelId = `${this.id}-label`\n\n private readonly code = viewChild<ElementRef<HTMLElement>>('code')\n private readonly copyButton = viewChild(CopyButton)\n private readonly injector = inject(Injector)\n\n constructor() {\n effect(() => {\n if (!this.revealed()) {\n untracked(() => this.copyButton()?.reset())\n }\n })\n }\n\n protected mask(): string {\n return '•'.repeat(Math.max(1, Math.round(this.maskLength())))\n }\n\n protected toggle(): void {\n this.revealed.set(!this.revealed())\n }\n\n protected onCopyFailed(): void {\n this.copyFailed.emit()\n if (!this.revealed()) {\n this.revealed.set(true)\n }\n afterNextRender(() => selectContents(this.code()?.nativeElement), { injector: this.injector })\n }\n}\n","@if (label(); as text) {\n <span class=\"gbt-secret-reveal__label\" [id]=\"labelId\">{{ text }}</span>\n}\n<div\n class=\"gbt-secret-reveal__box\"\n [attr.role]=\"label() ? 'group' : null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n>\n <!-- prettier-ignore -->\n <code #code class=\"gbt-secret-reveal__value\" [id]=\"valueId\">@if (revealed()) {{{ value() }}} @else {<span aria-hidden=\"true\">{{ mask() }}</span><span class=\"sr-only\">{{ hiddenLabel() }}</span>}</code>\n <gbt-button\n class=\"gbt-secret-reveal__toggle\"\n variant=\"secondary\"\n size=\"small\"\n [iconOnly]=\"true\"\n [iconName]=\"revealed() ? 'eye-off' : 'eye'\"\n [ariaLabel]=\"revealed() ? hideLabel() : showLabel()\"\n [ariaControls]=\"valueId\"\n (clicked)=\"toggle()\"\n />\n <gbt-copy-button\n class=\"gbt-secret-reveal__copy\"\n [value]=\"value()\"\n [ariaLabel]=\"copyLabel()\"\n [copiedText]=\"copiedText()\"\n [failedText]=\"failedText()\"\n [feedbackMs]=\"feedbackMs()\"\n [feedback]=\"feedback()\"\n (copied)=\"copied.emit($event)\"\n (copyFailed)=\"onCopyFailed()\"\n />\n</div>\n"],"mappings":";;;;AAkBA,IAAI,qBAAqB;AAazB,IAAa,eAAb,MAAa,aAAY;CACvB,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,WAAW,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CACvB,QAAQ,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,YAAY,MAAM,mBAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,YAAY,MAAM,mBAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,cAAc,MAAM,iBAAgB,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,YAAY,MAAM,mBAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,aAAa,MAAM,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAC5B,aAAa,MAAM,0CAAyC,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAC5D,aAAa,MAAM,KAAK,GAAA,YAAA,CAAA,EAAA,WAAA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AAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBACzB,UAAU,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"masmarino-gabarit-secret-reveal.mjs","names":[],"sources":["../../../projects/gabarit/secret-reveal/secret-reveal.ts","../../../projects/gabarit/secret-reveal/secret-reveal.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Injector,\n effect,\n untracked,\n afterNextRender,\n inject,\n input,\n model,\n output,\n viewChild,\n} from '@angular/core'\nimport { Button } from '@masmarino/gabarit/button'\nimport { CopyButton, CopyButtonFeedback } from '@masmarino/gabarit/copy-button'\nimport { selectContents } from '@masmarino/gabarit/copy-button'\n\nlet nextSecretRevealId = 0\n\n@Component({\n selector: 'gbt-secret-reveal',\n standalone: true,\n imports: [Button, CopyButton],\n templateUrl: './secret-reveal.html',\n styleUrl: './secret-reveal.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-revealed]': 'revealed() ? \"\" : null',\n },\n})\nexport class SecretReveal {\n value = input.required<string>()\n revealed = model(false)\n label = input<string | null>(null)\n showLabel = input('Show the secret')\n hideLabel = input('Hide the secret')\n hiddenLabel = input('Secret hidden')\n copyLabel = input('Copy the secret')\n copiedText = input('Copied')\n failedText = input('Copy failed, secret shown and selected')\n feedbackMs = input(2000)\n feedback = input<CopyButtonFeedback>('bubble')\n maskLength = input(24)\n\n copied = output<string>()\n copyFailed = output<void>()\n\n protected readonly id = `gbt-secret-reveal-${++nextSecretRevealId}`\n protected readonly valueId = `${this.id}-value`\n protected readonly labelId = `${this.id}-label`\n\n private readonly code = viewChild<ElementRef<HTMLElement>>('code')\n private readonly copyButton = viewChild(CopyButton)\n private readonly injector = inject(Injector)\n\n constructor() {\n effect(() => {\n if (!this.revealed()) {\n untracked(() => this.copyButton()?.reset())\n }\n })\n }\n\n protected mask(): string {\n return '•'.repeat(Math.max(1, Math.round(this.maskLength())))\n }\n\n protected toggle(): void {\n this.revealed.set(!this.revealed())\n }\n\n protected onCopyFailed(): void {\n this.copyFailed.emit()\n if (!this.revealed()) {\n this.revealed.set(true)\n }\n afterNextRender(() => selectContents(this.code()?.nativeElement), { injector: this.injector })\n }\n}\n","@if (label(); as text) {\n <span class=\"gbt-secret-reveal__label\" [id]=\"labelId\">{{ text }}</span>\n}\n<div\n class=\"gbt-secret-reveal__box\"\n [attr.role]=\"label() ? 'group' : null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n>\n <!-- prettier-ignore -->\n <code #code class=\"gbt-secret-reveal__value\" [id]=\"valueId\">@if (revealed()) {{{ value() }}} @else {<span aria-hidden=\"true\">{{ mask() }}</span><span class=\"sr-only\">{{ hiddenLabel() }}</span>}</code>\n <gbt-button\n class=\"gbt-secret-reveal__toggle\"\n variant=\"secondary\"\n size=\"small\"\n [iconOnly]=\"true\"\n [iconName]=\"revealed() ? 'eye-off' : 'eye'\"\n [ariaLabel]=\"revealed() ? hideLabel() : showLabel()\"\n [ariaControls]=\"valueId\"\n (clicked)=\"toggle()\"\n />\n <gbt-copy-button\n class=\"gbt-secret-reveal__copy\"\n [value]=\"value()\"\n [ariaLabel]=\"copyLabel()\"\n [copiedText]=\"copiedText()\"\n [failedText]=\"failedText()\"\n [feedbackMs]=\"feedbackMs()\"\n [feedback]=\"feedback()\"\n (copied)=\"copied.emit($event)\"\n (copyFailed)=\"onCopyFailed()\"\n />\n</div>\n"],"mappings":";;;;AAkBA,IAAI,qBAAqB;AAazB,IAAa,eAAb,MAAa,aAAY;CACvB,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,WAAW,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CACvB,QAAQ,MAAqB,MAAK,G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,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAM,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBACzB,UAAU,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from "@angular/core";
2
- import { ChangeDetectionStrategy, Component, booleanAttribute, input, model, viewChild } from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DestroyRef, afterRenderEffect, booleanAttribute, inject, input, model, signal, viewChild } from "@angular/core";
3
3
  let nextSegmentedControlId = 0;
4
4
  var SegmentedControl = class SegmentedControl {
5
5
  group = viewChild("group", ...ngDevMode ? [{ debugName: "group" }] : /* istanbul ignore next */ []);
@@ -25,6 +25,47 @@ var SegmentedControl = class SegmentedControl {
25
25
  transform: booleanAttribute
26
26
  });
27
27
  labelId = `gbt-segmented-control-label-${++nextSegmentedControlId}`;
28
+ lens = signal(null, ...ngDevMode ? [{ debugName: "lens" }] : /* istanbul ignore next */ []);
29
+ lensGlides = signal(false, ...ngDevMode ? [{ debugName: "lensGlides" }] : /* istanbul ignore next */ []);
30
+ constructor() {
31
+ const layout = signal(0, ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
32
+ if (typeof ResizeObserver !== "undefined") {
33
+ const observer = new ResizeObserver(() => layout.update((n) => n + 1));
34
+ afterRenderEffect(() => {
35
+ const group = this.group()?.nativeElement;
36
+ if (group) {
37
+ observer.disconnect();
38
+ observer.observe(group);
39
+ }
40
+ });
41
+ inject(DestroyRef).onDestroy(() => observer.disconnect());
42
+ }
43
+ afterRenderEffect({ read: () => {
44
+ layout();
45
+ this.value();
46
+ this.options();
47
+ this.place();
48
+ } });
49
+ }
50
+ place() {
51
+ const group = this.group()?.nativeElement;
52
+ const chosen = group?.querySelector("[role=\"radio\"][aria-checked=\"true\"]");
53
+ if (!group || !chosen || chosen.offsetWidth === 0) {
54
+ this.lens.set(null);
55
+ return;
56
+ }
57
+ const box = {
58
+ x: chosen.offsetLeft,
59
+ y: chosen.offsetTop,
60
+ width: chosen.offsetWidth,
61
+ height: chosen.offsetHeight
62
+ };
63
+ const current = this.lens();
64
+ if (current && current.x === box.x && current.y === box.y && current.width === box.width && current.height === box.height) return;
65
+ const first = current === null;
66
+ this.lens.set(box);
67
+ if (first && typeof requestAnimationFrame !== "undefined") requestAnimationFrame(() => this.lensGlides.set(true));
68
+ }
28
69
  isSelected(value) {
29
70
  return this.value() === value;
30
71
  }
@@ -160,8 +201,8 @@ var SegmentedControl = class SegmentedControl {
160
201
  isSignal: true
161
202
  }],
162
203
  ngImport: i0,
163
- template: "@if (label()) {\n <span [id]=\"labelId\" class=\"gbt-segmented-control__label\">{{ label() }}</span>\n}\n<div\n #group\n class=\"gbt-segmented-control\"\n [class.gbt-segmented-control--sm]=\"size() === 'sm'\"\n [class.gbt-segmented-control--wrap]=\"wrap()\"\n [class.gbt-segmented-control--tinted]=\"tinted()\"\n role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n>\n @for (option of options(); track option.value; let i = $index) {\n <button\n type=\"button\"\n role=\"radio\"\n class=\"gbt-segmented-control__option\"\n [class.gbt-segmented-control__option--selected]=\"isSelected(option.value)\"\n [attr.aria-checked]=\"isSelected(option.value)\"\n [tabIndex]=\"isSelected(option.value) ? 0 : -1\"\n [disabled]=\"disabled() || !!option.disabled\"\n (click)=\"select(option)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ option.label }}\n </button>\n }\n</div>\n",
164
- styles: [":host(.gbt-segmented-control-host--labelled){display:inline-block}:host(.gbt-segmented-control-host--full){display:block}.gbt-segmented-control__label{display:block;margin-bottom:.375rem;color:var(--text-secondary);font-size:.8125rem;font-weight:600}.gbt-segmented-control{display:inline-flex;gap:2px;padding:2px;background:var(--bg-panel);border-radius:var(--site-border-radius-sm);box-shadow:var(--gbt-depth-hollow)}.gbt-segmented-control__option{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:calc(var(--gbt-control-height-sm) - 4px);padding:.375rem .75rem;background:none;border:none;border-radius:calc(var(--site-border-radius-sm) - 2px);color:var(--text-secondary);font-size:13px;font-weight:600;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1),color .12s cubic-bezier(.4,0,.2,1)}.gbt-segmented-control__option:hover:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-hover);color:var(--text-primary)}.gbt-segmented-control__option:active:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-press);color:var(--text-primary)}.gbt-segmented-control__option:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-segmented-control__option:disabled{cursor:not-allowed;opacity:.5}.gbt-segmented-control__option--selected{background:var(--bg-principal);color:var(--text-primary);background-image:var(--gbt-sheen);box-shadow:var(--gbt-depth-raised)}.gbt-segmented-control__option--selected:hover:not(:disabled){background-image:var(--gbt-sheen-hover);box-shadow:var(--gbt-depth-raised-hover)}.gbt-segmented-control__option--selected:active:not(:disabled){background-image:var(--gbt-sunk);box-shadow:none}@media(prefers-reduced-motion:no-preference){.gbt-segmented-control__option--selected:active:not(:disabled){transform:translateY(.5px)}}.gbt-segmented-control--tinted{background:var(--bg-track)}.gbt-segmented-control--sm .gbt-segmented-control__option{padding:.1875rem .625rem;font-size:12px}.gbt-segmented-control--wrap{flex-wrap:wrap}.gbt-segmented-control--wrap .gbt-segmented-control__option{white-space:nowrap}:host(.gbt-segmented-control-host--full) .gbt-segmented-control{display:flex}:host(.gbt-segmented-control-host--full) .gbt-segmented-control__option{flex:1 1 0;min-width:0}:host(.gbt-segmented-control-host--full) .gbt-segmented-control--wrap .gbt-segmented-control__option{flex:1 1 auto}@media(prefers-reduced-motion:reduce){.gbt-segmented-control__option{transition:none}}\n"],
204
+ template: "@if (label()) {\n <span [id]=\"labelId\" class=\"gbt-segmented-control__label\">{{ label() }}</span>\n}\n<div\n #group\n class=\"gbt-segmented-control\"\n [class.gbt-segmented-control--sm]=\"size() === 'sm'\"\n [class.gbt-segmented-control--wrap]=\"wrap()\"\n [class.gbt-segmented-control--tinted]=\"tinted()\"\n [class.gbt-segmented-control--lens]=\"!!lens()\"\n role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n>\n @if (lens(); as box) {\n <span\n class=\"gbt-segmented-control__lens\"\n [class.gbt-segmented-control__lens--glides]=\"lensGlides()\"\n aria-hidden=\"true\"\n [style.width.px]=\"box.width\"\n [style.height.px]=\"box.height\"\n [style.transform]=\"'translate(' + box.x + 'px, ' + box.y + 'px)'\"\n ></span>\n }\n @for (option of options(); track option.value; let i = $index) {\n <button\n type=\"button\"\n role=\"radio\"\n class=\"gbt-segmented-control__option\"\n [class.gbt-segmented-control__option--selected]=\"isSelected(option.value)\"\n [attr.aria-checked]=\"isSelected(option.value)\"\n [tabIndex]=\"isSelected(option.value) ? 0 : -1\"\n [disabled]=\"disabled() || !!option.disabled\"\n (click)=\"select(option)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ option.label }}\n </button>\n }\n</div>\n",
205
+ styles: [":host(.gbt-segmented-control-host--labelled){display:inline-block}:host(.gbt-segmented-control-host--full){display:block}.gbt-segmented-control__label{display:block;margin-bottom:.375rem;color:var(--text-secondary);font-size:.8125rem;font-weight:600}.gbt-segmented-control{position:relative;display:inline-flex;gap:2px;padding:2px;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--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);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control{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-segmented-control{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control{box-shadow:inset 0 1px 0 var(--gbt-liquid-rim-top),inset 0 -1px 0 var(--gbt-liquid-rim-bottom)}@media(prefers-contrast:more){.gbt-segmented-control{box-shadow:inset 0 0 0 1px var(--border-color),inset 0 1px 0 var(--gbt-liquid-rim-top),inset 0 -1px 0 var(--gbt-liquid-rim-bottom)}}.gbt-segmented-control__lens{position:absolute;top:0;left:0;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--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);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control__lens{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-segmented-control__lens{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control__lens{color:var(--text-primary);background-image:linear-gradient(var(--gbt-relief-highlight),var(--gbt-relief-highlight));pointer-events:none}@media(prefers-reduced-motion:no-preference){.gbt-segmented-control__lens--glides{transition:transform .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),width .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),height .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1)}}.gbt-segmented-control__option{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:calc(var(--gbt-control-height-sm) - 4px);padding:.375rem .75rem;background:none;border:none;position:relative;border-radius:999px;color:var(--text-secondary);font-size:13px;font-weight:600;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1),color .12s cubic-bezier(.4,0,.2,1)}.gbt-segmented-control__option:hover:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-hover);color:var(--text-primary)}.gbt-segmented-control__option:active:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-press);color:var(--text-primary)}.gbt-segmented-control__option:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-segmented-control__option:disabled{cursor:not-allowed;opacity:.5}.gbt-segmented-control__option--selected{background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--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);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control__option--selected{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-segmented-control__option--selected{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control__option--selected{color:var(--text-primary)}.gbt-segmented-control--lens .gbt-segmented-control__option--selected,.gbt-segmented-control--lens .gbt-segmented-control__option--selected:hover:not(:disabled),.gbt-segmented-control--lens .gbt-segmented-control__option--selected:active:not(:disabled){background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;transform:none;transition:color .12s cubic-bezier(.4,0,.2,1)}@media(prefers-reduced-motion:reduce){.gbt-segmented-control--lens .gbt-segmented-control__option--selected,.gbt-segmented-control--lens .gbt-segmented-control__option--selected:hover:not(:disabled),.gbt-segmented-control--lens .gbt-segmented-control__option--selected:active:not(:disabled){transition:none}}.gbt-segmented-control--tinted{background:var(--bg-track)}.gbt-segmented-control--sm .gbt-segmented-control__option{padding:.1875rem .625rem;font-size:12px}.gbt-segmented-control--wrap{flex-wrap:wrap}.gbt-segmented-control--wrap .gbt-segmented-control__option{white-space:nowrap}:host(.gbt-segmented-control-host--full) .gbt-segmented-control{display:flex}:host(.gbt-segmented-control-host--full) .gbt-segmented-control__option{flex:1 1 0;min-width:0}:host(.gbt-segmented-control-host--full) .gbt-segmented-control--wrap .gbt-segmented-control__option{flex:1 1 auto}@media(prefers-reduced-motion:reduce){.gbt-segmented-control__option{transition:none}}\n"],
165
206
  changeDetection: i0.ChangeDetectionStrategy.OnPush
166
207
  });
167
208
  };
@@ -181,10 +222,11 @@ i0.ɵɵngDeclareClassMetadata({
181
222
  "[class.gbt-segmented-control-host--full]": "fullWidth()",
182
223
  "[class.gbt-segmented-control-host--labelled]": "!!label()"
183
224
  },
184
- template: "@if (label()) {\n <span [id]=\"labelId\" class=\"gbt-segmented-control__label\">{{ label() }}</span>\n}\n<div\n #group\n class=\"gbt-segmented-control\"\n [class.gbt-segmented-control--sm]=\"size() === 'sm'\"\n [class.gbt-segmented-control--wrap]=\"wrap()\"\n [class.gbt-segmented-control--tinted]=\"tinted()\"\n role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n>\n @for (option of options(); track option.value; let i = $index) {\n <button\n type=\"button\"\n role=\"radio\"\n class=\"gbt-segmented-control__option\"\n [class.gbt-segmented-control__option--selected]=\"isSelected(option.value)\"\n [attr.aria-checked]=\"isSelected(option.value)\"\n [tabIndex]=\"isSelected(option.value) ? 0 : -1\"\n [disabled]=\"disabled() || !!option.disabled\"\n (click)=\"select(option)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ option.label }}\n </button>\n }\n</div>\n",
185
- styles: [":host(.gbt-segmented-control-host--labelled){display:inline-block}:host(.gbt-segmented-control-host--full){display:block}.gbt-segmented-control__label{display:block;margin-bottom:.375rem;color:var(--text-secondary);font-size:.8125rem;font-weight:600}.gbt-segmented-control{display:inline-flex;gap:2px;padding:2px;background:var(--bg-panel);border-radius:var(--site-border-radius-sm);box-shadow:var(--gbt-depth-hollow)}.gbt-segmented-control__option{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:calc(var(--gbt-control-height-sm) - 4px);padding:.375rem .75rem;background:none;border:none;border-radius:calc(var(--site-border-radius-sm) - 2px);color:var(--text-secondary);font-size:13px;font-weight:600;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1),color .12s cubic-bezier(.4,0,.2,1)}.gbt-segmented-control__option:hover:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-hover);color:var(--text-primary)}.gbt-segmented-control__option:active:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-press);color:var(--text-primary)}.gbt-segmented-control__option:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-segmented-control__option:disabled{cursor:not-allowed;opacity:.5}.gbt-segmented-control__option--selected{background:var(--bg-principal);color:var(--text-primary);background-image:var(--gbt-sheen);box-shadow:var(--gbt-depth-raised)}.gbt-segmented-control__option--selected:hover:not(:disabled){background-image:var(--gbt-sheen-hover);box-shadow:var(--gbt-depth-raised-hover)}.gbt-segmented-control__option--selected:active:not(:disabled){background-image:var(--gbt-sunk);box-shadow:none}@media(prefers-reduced-motion:no-preference){.gbt-segmented-control__option--selected:active:not(:disabled){transform:translateY(.5px)}}.gbt-segmented-control--tinted{background:var(--bg-track)}.gbt-segmented-control--sm .gbt-segmented-control__option{padding:.1875rem .625rem;font-size:12px}.gbt-segmented-control--wrap{flex-wrap:wrap}.gbt-segmented-control--wrap .gbt-segmented-control__option{white-space:nowrap}:host(.gbt-segmented-control-host--full) .gbt-segmented-control{display:flex}:host(.gbt-segmented-control-host--full) .gbt-segmented-control__option{flex:1 1 0;min-width:0}:host(.gbt-segmented-control-host--full) .gbt-segmented-control--wrap .gbt-segmented-control__option{flex:1 1 auto}@media(prefers-reduced-motion:reduce){.gbt-segmented-control__option{transition:none}}\n"]
225
+ template: "@if (label()) {\n <span [id]=\"labelId\" class=\"gbt-segmented-control__label\">{{ label() }}</span>\n}\n<div\n #group\n class=\"gbt-segmented-control\"\n [class.gbt-segmented-control--sm]=\"size() === 'sm'\"\n [class.gbt-segmented-control--wrap]=\"wrap()\"\n [class.gbt-segmented-control--tinted]=\"tinted()\"\n [class.gbt-segmented-control--lens]=\"!!lens()\"\n role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n>\n @if (lens(); as box) {\n <span\n class=\"gbt-segmented-control__lens\"\n [class.gbt-segmented-control__lens--glides]=\"lensGlides()\"\n aria-hidden=\"true\"\n [style.width.px]=\"box.width\"\n [style.height.px]=\"box.height\"\n [style.transform]=\"'translate(' + box.x + 'px, ' + box.y + 'px)'\"\n ></span>\n }\n @for (option of options(); track option.value; let i = $index) {\n <button\n type=\"button\"\n role=\"radio\"\n class=\"gbt-segmented-control__option\"\n [class.gbt-segmented-control__option--selected]=\"isSelected(option.value)\"\n [attr.aria-checked]=\"isSelected(option.value)\"\n [tabIndex]=\"isSelected(option.value) ? 0 : -1\"\n [disabled]=\"disabled() || !!option.disabled\"\n (click)=\"select(option)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ option.label }}\n </button>\n }\n</div>\n",
226
+ styles: [":host(.gbt-segmented-control-host--labelled){display:inline-block}:host(.gbt-segmented-control-host--full){display:block}.gbt-segmented-control__label{display:block;margin-bottom:.375rem;color:var(--text-secondary);font-size:.8125rem;font-weight:600}.gbt-segmented-control{position:relative;display:inline-flex;gap:2px;padding:2px;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--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);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control{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-segmented-control{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control{box-shadow:inset 0 1px 0 var(--gbt-liquid-rim-top),inset 0 -1px 0 var(--gbt-liquid-rim-bottom)}@media(prefers-contrast:more){.gbt-segmented-control{box-shadow:inset 0 0 0 1px var(--border-color),inset 0 1px 0 var(--gbt-liquid-rim-top),inset 0 -1px 0 var(--gbt-liquid-rim-bottom)}}.gbt-segmented-control__lens{position:absolute;top:0;left:0;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--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);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control__lens{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-segmented-control__lens{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control__lens{color:var(--text-primary);background-image:linear-gradient(var(--gbt-relief-highlight),var(--gbt-relief-highlight));pointer-events:none}@media(prefers-reduced-motion:no-preference){.gbt-segmented-control__lens--glides{transition:transform .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),width .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),height .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1)}}.gbt-segmented-control__option{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:calc(var(--gbt-control-height-sm) - 4px);padding:.375rem .75rem;background:none;border:none;position:relative;border-radius:999px;color:var(--text-secondary);font-size:13px;font-weight:600;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1),color .12s cubic-bezier(.4,0,.2,1)}.gbt-segmented-control__option:hover:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-hover);color:var(--text-primary)}.gbt-segmented-control__option:active:not(:disabled):not(.gbt-segmented-control__option--selected){background:var(--bg-press);color:var(--text-primary)}.gbt-segmented-control__option:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-segmented-control__option:disabled{cursor:not-allowed;opacity:.5}.gbt-segmented-control__option--selected{background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--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);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-segmented-control__option--selected{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-segmented-control__option--selected{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-segmented-control__option--selected{color:var(--text-primary)}.gbt-segmented-control--lens .gbt-segmented-control__option--selected,.gbt-segmented-control--lens .gbt-segmented-control__option--selected:hover:not(:disabled),.gbt-segmented-control--lens .gbt-segmented-control__option--selected:active:not(:disabled){background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;transform:none;transition:color .12s cubic-bezier(.4,0,.2,1)}@media(prefers-reduced-motion:reduce){.gbt-segmented-control--lens .gbt-segmented-control__option--selected,.gbt-segmented-control--lens .gbt-segmented-control__option--selected:hover:not(:disabled),.gbt-segmented-control--lens .gbt-segmented-control__option--selected:active:not(:disabled){transition:none}}.gbt-segmented-control--tinted{background:var(--bg-track)}.gbt-segmented-control--sm .gbt-segmented-control__option{padding:.1875rem .625rem;font-size:12px}.gbt-segmented-control--wrap{flex-wrap:wrap}.gbt-segmented-control--wrap .gbt-segmented-control__option{white-space:nowrap}:host(.gbt-segmented-control-host--full) .gbt-segmented-control{display:flex}:host(.gbt-segmented-control-host--full) .gbt-segmented-control__option{flex:1 1 0;min-width:0}:host(.gbt-segmented-control-host--full) .gbt-segmented-control--wrap .gbt-segmented-control__option{flex:1 1 auto}@media(prefers-reduced-motion:reduce){.gbt-segmented-control__option{transition:none}}\n"]
186
227
  }]
187
228
  }],
229
+ ctorParameters: () => [],
188
230
  propDecorators: {
189
231
  group: [{
190
232
  type: i0.ViewChild,
@@ -1 +1 @@
1
- {"version":3,"file":"masmarino-gabarit-segmented-control.mjs","names":[],"sources":["../../../projects/gabarit/segmented-control/segmented-control.ts","../../../projects/gabarit/segmented-control/segmented-control.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n booleanAttribute,\n input,\n model,\n viewChild,\n} from '@angular/core'\n\nexport interface SegmentedControlOption<T = string> {\n value: T\n label: string\n disabled?: boolean\n}\n\nexport type SegmentedControlSize = 'md' | 'sm'\n\nlet nextSegmentedControlId = 0\n\n@Component({\n selector: 'gbt-segmented-control',\n standalone: true,\n imports: [],\n templateUrl: './segmented-control.html',\n styleUrl: './segmented-control.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.gbt-segmented-control-host--full]': 'fullWidth()',\n '[class.gbt-segmented-control-host--labelled]': '!!label()',\n },\n})\nexport class SegmentedControl<T = string> {\n private readonly group = viewChild<ElementRef<HTMLElement>>('group')\n\n options = input.required<SegmentedControlOption<T>[]>()\n value = model.required<T>()\n ariaLabel = input<string>('')\n disabled = input(false, { transform: booleanAttribute })\n label = input<string>('')\n fullWidth = input(false, { transform: booleanAttribute })\n wrap = input(false, { transform: booleanAttribute })\n size = input<SegmentedControlSize>('md')\n tinted = input(false, { transform: booleanAttribute })\n\n protected readonly labelId = `gbt-segmented-control-label-${++nextSegmentedControlId}`\n\n protected isSelected(value: T): boolean {\n return this.value() === value\n }\n\n protected select(option: SegmentedControlOption<T>): void {\n if (this.disabled() || option.disabled) {\n return\n }\n this.value.set(option.value)\n }\n\n protected onKeydown(event: KeyboardEvent, index: number): void {\n const options = this.options()\n const count = options.length\n if (count === 0) {\n return\n }\n let next: number | null = null\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n next = this.nextEnabledIndex(index, 1)\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n next = this.nextEnabledIndex(index, -1)\n break\n case 'Home':\n next = this.nextEnabledIndex(-1, 1)\n break\n case 'End':\n next = this.nextEnabledIndex(count, -1)\n break\n }\n if (next === null) {\n return\n }\n event.preventDefault()\n this.select(options[next])\n this.focusButton(next)\n }\n\n private nextEnabledIndex(from: number, direction: 1 | -1): number | null {\n const options = this.options()\n const count = options.length\n for (let step = 1; step <= count; step++) {\n const candidate = (from + direction * step + count) % count\n if (!options[candidate].disabled) {\n return candidate\n }\n }\n return null\n }\n\n private focusButton(index: number): void {\n this.group()?.nativeElement.querySelectorAll<HTMLElement>('[role=\"radio\"]')[index]?.focus()\n }\n}\n","@if (label()) {\n <span [id]=\"labelId\" class=\"gbt-segmented-control__label\">{{ label() }}</span>\n}\n<div\n #group\n class=\"gbt-segmented-control\"\n [class.gbt-segmented-control--sm]=\"size() === 'sm'\"\n [class.gbt-segmented-control--wrap]=\"wrap()\"\n [class.gbt-segmented-control--tinted]=\"tinted()\"\n role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n>\n @for (option of options(); track option.value; let i = $index) {\n <button\n type=\"button\"\n role=\"radio\"\n class=\"gbt-segmented-control__option\"\n [class.gbt-segmented-control__option--selected]=\"isSelected(option.value)\"\n [attr.aria-checked]=\"isSelected(option.value)\"\n [tabIndex]=\"isSelected(option.value) ? 0 : -1\"\n [disabled]=\"disabled() || !!option.disabled\"\n (click)=\"select(option)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ option.label }}\n </button>\n }\n</div>\n"],"mappings":";;AAkBA,IAAI,yBAAyB;AAc7B,IAAa,mBAAb,MAAa,iBAAgB;CACV,QAAQ,UAAmC,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEpE,UAAU,MAAM,SAAuC,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACvD,QAAQ,MAAM,SAAa,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,YAAY,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACrD,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,YAAY,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACtD,OAAO,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,OAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACjD,OAAO,MAA4B,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACxC,SAAS,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAEhC,UAAU,+BAA+B,EAAE;CAEpD,WAAW,OAAQ;EAC3B,OAAO,KAAK,MAAK,MAAO;CAC1B;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AAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"masmarino-gabarit-segmented-control.mjs","names":[],"sources":["../../../projects/gabarit/segmented-control/segmented-control.ts","../../../projects/gabarit/segmented-control/segmented-control.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n afterRenderEffect,\n booleanAttribute,\n inject,\n input,\n model,\n signal,\n viewChild,\n} from '@angular/core'\n\nexport interface SegmentedControlOption<T = string> {\n value: T\n label: string\n disabled?: boolean\n}\n\nexport type SegmentedControlSize = 'md' | 'sm'\n\nlet nextSegmentedControlId = 0\n\n/** Where the lens sits, in the group's box (px). */\ninterface LensBox {\n x: number\n y: number\n width: number\n height: number\n}\n\n@Component({\n selector: 'gbt-segmented-control',\n standalone: true,\n imports: [],\n templateUrl: './segmented-control.html',\n styleUrl: './segmented-control.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.gbt-segmented-control-host--full]': 'fullWidth()',\n '[class.gbt-segmented-control-host--labelled]': '!!label()',\n },\n})\nexport class SegmentedControl<T = string> {\n private readonly group = viewChild<ElementRef<HTMLElement>>('group')\n\n options = input.required<SegmentedControlOption<T>[]>()\n value = model.required<T>()\n ariaLabel = input<string>('')\n disabled = input(false, { transform: booleanAttribute })\n label = input<string>('')\n fullWidth = input(false, { transform: booleanAttribute })\n wrap = input(false, { transform: booleanAttribute })\n size = input<SegmentedControlSize>('md')\n tinted = input(false, { transform: booleanAttribute })\n\n protected readonly labelId = `gbt-segmented-control-label-${++nextSegmentedControlId}`\n\n /** The lens of liquid glass under the chosen option (4.1): measured once the options are laid out, null before (the\n * chosen option then shows its own ground, as on a server render). */\n protected readonly lens = signal<LensBox | null>(null)\n /** The lens glides only once it has a place: it does not fly in from the corner on the first render. */\n protected readonly lensGlides = signal(false)\n\n constructor() {\n const layout = signal(0)\n if (typeof ResizeObserver !== 'undefined') {\n const observer = new ResizeObserver(() => layout.update((n) => n + 1))\n afterRenderEffect(() => {\n const group = this.group()?.nativeElement\n if (group) {\n observer.disconnect()\n observer.observe(group)\n }\n })\n inject(DestroyRef).onDestroy(() => observer.disconnect())\n }\n afterRenderEffect({\n read: () => {\n layout()\n this.value()\n this.options()\n this.place()\n },\n })\n }\n\n private place(): void {\n const group = this.group()?.nativeElement\n const chosen = group?.querySelector<HTMLElement>('[role=\"radio\"][aria-checked=\"true\"]')\n if (!group || !chosen || chosen.offsetWidth === 0) {\n this.lens.set(null)\n return\n }\n const box = {\n x: chosen.offsetLeft,\n y: chosen.offsetTop,\n width: chosen.offsetWidth,\n height: chosen.offsetHeight,\n }\n const current = this.lens()\n if (\n current &&\n current.x === box.x &&\n current.y === box.y &&\n current.width === box.width &&\n current.height === box.height\n ) {\n return\n }\n const first = current === null\n this.lens.set(box)\n if (first && typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(() => this.lensGlides.set(true))\n }\n }\n\n protected isSelected(value: T): boolean {\n return this.value() === value\n }\n\n protected select(option: SegmentedControlOption<T>): void {\n if (this.disabled() || option.disabled) {\n return\n }\n this.value.set(option.value)\n }\n\n protected onKeydown(event: KeyboardEvent, index: number): void {\n const options = this.options()\n const count = options.length\n if (count === 0) {\n return\n }\n let next: number | null = null\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n next = this.nextEnabledIndex(index, 1)\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n next = this.nextEnabledIndex(index, -1)\n break\n case 'Home':\n next = this.nextEnabledIndex(-1, 1)\n break\n case 'End':\n next = this.nextEnabledIndex(count, -1)\n break\n }\n if (next === null) {\n return\n }\n event.preventDefault()\n this.select(options[next])\n this.focusButton(next)\n }\n\n private nextEnabledIndex(from: number, direction: 1 | -1): number | null {\n const options = this.options()\n const count = options.length\n for (let step = 1; step <= count; step++) {\n const candidate = (from + direction * step + count) % count\n if (!options[candidate].disabled) {\n return candidate\n }\n }\n return null\n }\n\n private focusButton(index: number): void {\n this.group()?.nativeElement.querySelectorAll<HTMLElement>('[role=\"radio\"]')[index]?.focus()\n }\n}\n","@if (label()) {\n <span [id]=\"labelId\" class=\"gbt-segmented-control__label\">{{ label() }}</span>\n}\n<div\n #group\n class=\"gbt-segmented-control\"\n [class.gbt-segmented-control--sm]=\"size() === 'sm'\"\n [class.gbt-segmented-control--wrap]=\"wrap()\"\n [class.gbt-segmented-control--tinted]=\"tinted()\"\n [class.gbt-segmented-control--lens]=\"!!lens()\"\n role=\"radiogroup\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n>\n @if (lens(); as box) {\n <span\n class=\"gbt-segmented-control__lens\"\n [class.gbt-segmented-control__lens--glides]=\"lensGlides()\"\n aria-hidden=\"true\"\n [style.width.px]=\"box.width\"\n [style.height.px]=\"box.height\"\n [style.transform]=\"'translate(' + box.x + 'px, ' + box.y + 'px)'\"\n ></span>\n }\n @for (option of options(); track option.value; let i = $index) {\n <button\n type=\"button\"\n role=\"radio\"\n class=\"gbt-segmented-control__option\"\n [class.gbt-segmented-control__option--selected]=\"isSelected(option.value)\"\n [attr.aria-checked]=\"isSelected(option.value)\"\n [tabIndex]=\"isSelected(option.value) ? 0 : -1\"\n [disabled]=\"disabled() || !!option.disabled\"\n (click)=\"select(option)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n {{ option.label }}\n </button>\n }\n</div>\n"],"mappings":";;AAsBA,IAAI,yBAAyB;AAsB7B,IAAa,mBAAb,MAAa,iBAAgB;CACV,QAAQ,UAAmC,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEpE,UAAU,MAAM,SAAuC,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACvD,QAAQ,MAAM,SAAa,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,YAAY,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA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A;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -326,7 +326,7 @@ var Select = class Select {
326
326
  }],
327
327
  ngImport: i0,
328
328
  template: "<div class=\"gbt-select\" [class.gbt-select--disabled]=\"isDisabled()\">\n @if (label()) {\n <label\n [id]=\"labelId()\"\n [for]=\"id()\"\n class=\"gbt-select__label\"\n [class.gbt-select__label--hidden]=\"hideLabel()\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n\n <button\n type=\"button\"\n [id]=\"id()\"\n class=\"gbt-select__trigger\"\n [class.gbt-select__trigger--open]=\"open()\"\n [disabled]=\"isDisabled()\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"open() ? id() + '-listbox' : null\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-labelledby]=\"label() ? labelId() + ' ' + id() : null\"\n [attr.aria-label]=\"label() ? null : placeholder() || null\"\n [attr.aria-required]=\"required() ? true : null\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"toggleOpen()\"\n >\n @if (triggerIcon(); as icon) {\n <gbt-icon [name]=\"icon\" class=\"gbt-select__trigger-icon\" aria-hidden=\"true\" />\n }\n <span\n class=\"gbt-select__trigger-label\"\n [class.gbt-select__trigger-label--placeholder]=\"selectedOptions().length === 0\"\n >\n {{ triggerLabel() }}\n </span>\n <gbt-icon name=\"chevron-down\" class=\"gbt-select__chevron\" aria-hidden=\"true\" />\n </button>\n @if (chipsVisible()) {\n <div class=\"gbt-select__chips\" [id]=\"chipsId()\">\n @for (option of selectedOptions(); track option.value; let i = $index) {\n <gbt-tag\n [color]=\"option.color ?? '#6b7280'\"\n [removable]=\"!isDisabled()\"\n [disabled]=\"isDisabled()\"\n [removeLabel]=\"chipRemoveLabel()(option.label)\"\n (removed)=\"removeChip(option.value, i)\"\n >\n {{ option.label }}\n </gbt-tag>\n }\n </div>\n }\n @if (chips() && multiple()) {\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n {{ selectedCountLabel()(selectedOptions().length) }}\n </div>\n }\n @if (open() && panelStyle(); as style) {\n @if (hasNoOptions()) {\n <div\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel gbt-select__empty\"\n role=\"status\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n {{ noOptionsMessage() }}\n </div>\n } @else {\n <ul\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel\"\n role=\"listbox\"\n [attr.aria-label]=\"label() || placeholder()\"\n [attr.aria-multiselectable]=\"multiple()\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n @for (option of options(); track option.value; let i = $index) {\n <li role=\"presentation\">\n <button\n [id]=\"id() + '-option-' + i\"\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"gbt-select__option\"\n [class.gbt-select__option--selected]=\"isSelected(option.value)\"\n [class.gbt-select__option--active]=\"i === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n (click)=\"selectOption(option.value)\"\n (mouseenter)=\"activeIndex.set(i)\"\n >\n @if (option.icon) {\n <gbt-icon [name]=\"option.icon\" class=\"gbt-select__option-icon\" aria-hidden=\"true\" />\n }\n <span class=\"gbt-select__option-label\">{{ option.label }}</span>\n @if (isSelected(option.value)) {\n <gbt-icon name=\"check\" class=\"gbt-select__option-check\" aria-hidden=\"true\" />\n }\n </button>\n </li>\n }\n </ul>\n }\n }\n @if (showHint()) {\n <p [id]=\"hintId()\" class=\"gbt-select__hint\">{{ hint() }}</p>\n }\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-select__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
329
- styles: [":host{position:relative;display:inline-block;min-width:180px}.gbt-select{display:flex;flex-direction:column;gap:.375rem}.gbt-select--disabled{opacity:.5}.gbt-select__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-select__label--hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(.gbt-select--full){display:block;width:100%}.gbt-select__trigger{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;height:var(--gbt-control-height-md);padding:0 10px;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:14px;cursor:pointer;background-image:var(--gbt-sheen);box-shadow:var(--gbt-depth-raised);transition:border-color .15s cubic-bezier(.4,0,.2,1),box-shadow .15s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger:hover:not(:disabled){border-color:var(--text-discret);background-image:linear-gradient(var(--bg-hover),var(--bg-hover)),var(--gbt-sheen-hover);box-shadow:var(--gbt-depth-raised-hover)}.gbt-select__trigger:active:not(:disabled){background-image:var(--gbt-sunk),linear-gradient(var(--bg-press),var(--bg-press));box-shadow:none}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger:active:not(:disabled){transform:translateY(.5px)}}.gbt-select__trigger--open,.gbt-select__trigger--open:hover:not(:disabled){border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-select__trigger:disabled{cursor:not-allowed}:host(.gbt-select--sm){min-width:120px}:host(.gbt-select--sm) .gbt-select__trigger{height:var(--gbt-control-height-sm);padding:0 8px;font-size:13px}.gbt-select__trigger-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__trigger-label{flex:1;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__trigger-label--placeholder{color:var(--text-discret)}.gbt-select__chevron{flex-shrink:0;color:var(--text-secondary);transition:transform .2s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger--open .gbt-select__chevron{transform:rotate(180deg)}.gbt-select__panel{position:fixed;z-index:1000;margin:0;padding:6px;list-style:none;max-height:280px;overflow-y:auto;border-radius:var(--site-border-radius-lg);background:var(--gbt-glass-thick);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--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);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__panel{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-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__panel{box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-select__panel{animation:gbt-select-scale-in .15s cubic-bezier(.34,1.56,.64,1) both}.gbt-select__panel::-webkit-scrollbar{width:6px}.gbt-select__panel::-webkit-scrollbar-track{background:transparent}.gbt-select__panel::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:3px}.gbt-select__empty{box-sizing:border-box;padding:10px 12px;color:var(--text-secondary);font-size:13px}.gbt-select__option{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;background:transparent;border:none;border-radius:var(--gbt-radius-menu, var(--site-border-radius-sm));color:var(--text-primary);font-size:14px;text-align:left;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1)}.gbt-select__option:hover,.gbt-select__option--active{background:var(--bg-hover)}.gbt-select__option:active{background:var(--bg-press)}.gbt-select__option--selected{color:var(--primary);font-weight:600}.gbt-select__option-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__option--selected .gbt-select__option-icon{color:var(--primary)}.gbt-select__option-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__option-check{flex-shrink:0;color:var(--primary)}@keyframes gbt-select-scale-in{0%{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}.gbt-select__chips{display:flex;flex-wrap:wrap;gap:4px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.gbt-select__hint{margin:0;font-size:.75rem;color:var(--text-secondary)}.gbt-select__error{margin:0;font-size:.75rem;color:var(--color-error-text)}@media(prefers-reduced-motion:reduce){.gbt-select__panel{animation:none}.gbt-select__trigger,.gbt-select__option,.gbt-select__chevron{transition:none}}\n"],
329
+ styles: [":host{position:relative;display:inline-block;min-width:180px}.gbt-select{display:flex;flex-direction:column;gap:.375rem}.gbt-select--disabled{opacity:.5}.gbt-select__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-select__label--hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(.gbt-select--full){display:block;width:100%}.gbt-select__trigger{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;height:var(--gbt-control-height-md);padding:0 10px;border:1px solid transparent;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--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);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__trigger{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-select__trigger{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__trigger{color:var(--text-primary);font-size:14px;cursor:pointer}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger{transition:transform .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),background-color var(--site-transition-fast),color var(--site-transition-fast),box-shadow var(--site-transition-fast),opacity var(--site-transition-fast)}}.gbt-select__trigger:hover:not(:disabled){background-image:linear-gradient(var(--bg-hover),var(--bg-hover))}.gbt-select__trigger:active:not(:disabled){background-image:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24)}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger:active:not(:disabled){transform:scale(1.04)}}.gbt-select__trigger--open,.gbt-select__trigger--open:hover:not(:disabled){border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-select__trigger:disabled{cursor:not-allowed}:host(.gbt-select--sm){min-width:120px}:host(.gbt-select--sm) .gbt-select__trigger{height:var(--gbt-control-height-sm);padding:0 8px;font-size:13px}.gbt-select__trigger-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__trigger-label{flex:1;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__trigger-label--placeholder{color:var(--text-discret)}.gbt-select__chevron{flex-shrink:0;color:var(--text-secondary);transition:transform .2s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger--open .gbt-select__chevron{transform:rotate(180deg)}.gbt-select__panel{position:fixed;z-index:1000;margin:0;padding:6px;list-style:none;max-height:280px;overflow-y:auto;border-radius:var(--gbt-radius-glass);background:var(--gbt-glass-thick);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--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);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__panel{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-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__panel{box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-select__panel{animation:gbt-select-scale-in .15s cubic-bezier(.34,1.56,.64,1) both}.gbt-select__panel::-webkit-scrollbar{width:6px}.gbt-select__panel::-webkit-scrollbar-track{background:transparent}.gbt-select__panel::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:3px}.gbt-select__empty{box-sizing:border-box;padding:10px 12px;color:var(--text-secondary);font-size:13px}.gbt-select__option{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;background:transparent;border:none;border-radius:var(--gbt-radius-menu, var(--gbt-radius-row));color:var(--text-primary);font-size:14px;text-align:left;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1)}.gbt-select__option:hover,.gbt-select__option--active{background:var(--bg-hover)}.gbt-select__option:active{background:var(--bg-press)}.gbt-select__option--selected{color:var(--primary);font-weight:600}.gbt-select__option-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__option--selected .gbt-select__option-icon{color:var(--primary)}.gbt-select__option-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__option-check{flex-shrink:0;color:var(--primary)}@keyframes gbt-select-scale-in{0%{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}.gbt-select__chips{display:flex;flex-wrap:wrap;gap:4px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.gbt-select__hint{margin:0;font-size:.75rem;color:var(--text-secondary)}.gbt-select__error{margin:0;font-size:.75rem;color:var(--color-error-text)}@media(prefers-reduced-motion:reduce){.gbt-select__panel{animation:none}.gbt-select__trigger,.gbt-select__option,.gbt-select__chevron{transition:none}}\n"],
330
330
  dependencies: [{
331
331
  kind: "component",
332
332
  type: Icon,
@@ -372,7 +372,7 @@ i0.ɵɵngDeclareClassMetadata({
372
372
  multi: true
373
373
  }],
374
374
  template: "<div class=\"gbt-select\" [class.gbt-select--disabled]=\"isDisabled()\">\n @if (label()) {\n <label\n [id]=\"labelId()\"\n [for]=\"id()\"\n class=\"gbt-select__label\"\n [class.gbt-select__label--hidden]=\"hideLabel()\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n\n <button\n type=\"button\"\n [id]=\"id()\"\n class=\"gbt-select__trigger\"\n [class.gbt-select__trigger--open]=\"open()\"\n [disabled]=\"isDisabled()\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"open() ? id() + '-listbox' : null\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-labelledby]=\"label() ? labelId() + ' ' + id() : null\"\n [attr.aria-label]=\"label() ? null : placeholder() || null\"\n [attr.aria-required]=\"required() ? true : null\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"toggleOpen()\"\n >\n @if (triggerIcon(); as icon) {\n <gbt-icon [name]=\"icon\" class=\"gbt-select__trigger-icon\" aria-hidden=\"true\" />\n }\n <span\n class=\"gbt-select__trigger-label\"\n [class.gbt-select__trigger-label--placeholder]=\"selectedOptions().length === 0\"\n >\n {{ triggerLabel() }}\n </span>\n <gbt-icon name=\"chevron-down\" class=\"gbt-select__chevron\" aria-hidden=\"true\" />\n </button>\n @if (chipsVisible()) {\n <div class=\"gbt-select__chips\" [id]=\"chipsId()\">\n @for (option of selectedOptions(); track option.value; let i = $index) {\n <gbt-tag\n [color]=\"option.color ?? '#6b7280'\"\n [removable]=\"!isDisabled()\"\n [disabled]=\"isDisabled()\"\n [removeLabel]=\"chipRemoveLabel()(option.label)\"\n (removed)=\"removeChip(option.value, i)\"\n >\n {{ option.label }}\n </gbt-tag>\n }\n </div>\n }\n @if (chips() && multiple()) {\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n {{ selectedCountLabel()(selectedOptions().length) }}\n </div>\n }\n @if (open() && panelStyle(); as style) {\n @if (hasNoOptions()) {\n <div\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel gbt-select__empty\"\n role=\"status\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n {{ noOptionsMessage() }}\n </div>\n } @else {\n <ul\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel\"\n role=\"listbox\"\n [attr.aria-label]=\"label() || placeholder()\"\n [attr.aria-multiselectable]=\"multiple()\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n @for (option of options(); track option.value; let i = $index) {\n <li role=\"presentation\">\n <button\n [id]=\"id() + '-option-' + i\"\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"gbt-select__option\"\n [class.gbt-select__option--selected]=\"isSelected(option.value)\"\n [class.gbt-select__option--active]=\"i === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n (click)=\"selectOption(option.value)\"\n (mouseenter)=\"activeIndex.set(i)\"\n >\n @if (option.icon) {\n <gbt-icon [name]=\"option.icon\" class=\"gbt-select__option-icon\" aria-hidden=\"true\" />\n }\n <span class=\"gbt-select__option-label\">{{ option.label }}</span>\n @if (isSelected(option.value)) {\n <gbt-icon name=\"check\" class=\"gbt-select__option-check\" aria-hidden=\"true\" />\n }\n </button>\n </li>\n }\n </ul>\n }\n }\n @if (showHint()) {\n <p [id]=\"hintId()\" class=\"gbt-select__hint\">{{ hint() }}</p>\n }\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-select__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
375
- styles: [":host{position:relative;display:inline-block;min-width:180px}.gbt-select{display:flex;flex-direction:column;gap:.375rem}.gbt-select--disabled{opacity:.5}.gbt-select__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-select__label--hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(.gbt-select--full){display:block;width:100%}.gbt-select__trigger{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;height:var(--gbt-control-height-md);padding:0 10px;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:14px;cursor:pointer;background-image:var(--gbt-sheen);box-shadow:var(--gbt-depth-raised);transition:border-color .15s cubic-bezier(.4,0,.2,1),box-shadow .15s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger:hover:not(:disabled){border-color:var(--text-discret);background-image:linear-gradient(var(--bg-hover),var(--bg-hover)),var(--gbt-sheen-hover);box-shadow:var(--gbt-depth-raised-hover)}.gbt-select__trigger:active:not(:disabled){background-image:var(--gbt-sunk),linear-gradient(var(--bg-press),var(--bg-press));box-shadow:none}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger:active:not(:disabled){transform:translateY(.5px)}}.gbt-select__trigger--open,.gbt-select__trigger--open:hover:not(:disabled){border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-select__trigger:disabled{cursor:not-allowed}:host(.gbt-select--sm){min-width:120px}:host(.gbt-select--sm) .gbt-select__trigger{height:var(--gbt-control-height-sm);padding:0 8px;font-size:13px}.gbt-select__trigger-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__trigger-label{flex:1;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__trigger-label--placeholder{color:var(--text-discret)}.gbt-select__chevron{flex-shrink:0;color:var(--text-secondary);transition:transform .2s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger--open .gbt-select__chevron{transform:rotate(180deg)}.gbt-select__panel{position:fixed;z-index:1000;margin:0;padding:6px;list-style:none;max-height:280px;overflow-y:auto;border-radius:var(--site-border-radius-lg);background:var(--gbt-glass-thick);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--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);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__panel{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-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__panel{box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-select__panel{animation:gbt-select-scale-in .15s cubic-bezier(.34,1.56,.64,1) both}.gbt-select__panel::-webkit-scrollbar{width:6px}.gbt-select__panel::-webkit-scrollbar-track{background:transparent}.gbt-select__panel::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:3px}.gbt-select__empty{box-sizing:border-box;padding:10px 12px;color:var(--text-secondary);font-size:13px}.gbt-select__option{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;background:transparent;border:none;border-radius:var(--gbt-radius-menu, var(--site-border-radius-sm));color:var(--text-primary);font-size:14px;text-align:left;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1)}.gbt-select__option:hover,.gbt-select__option--active{background:var(--bg-hover)}.gbt-select__option:active{background:var(--bg-press)}.gbt-select__option--selected{color:var(--primary);font-weight:600}.gbt-select__option-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__option--selected .gbt-select__option-icon{color:var(--primary)}.gbt-select__option-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__option-check{flex-shrink:0;color:var(--primary)}@keyframes gbt-select-scale-in{0%{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}.gbt-select__chips{display:flex;flex-wrap:wrap;gap:4px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.gbt-select__hint{margin:0;font-size:.75rem;color:var(--text-secondary)}.gbt-select__error{margin:0;font-size:.75rem;color:var(--color-error-text)}@media(prefers-reduced-motion:reduce){.gbt-select__panel{animation:none}.gbt-select__trigger,.gbt-select__option,.gbt-select__chevron{transition:none}}\n"]
375
+ styles: [":host{position:relative;display:inline-block;min-width:180px}.gbt-select{display:flex;flex-direction:column;gap:.375rem}.gbt-select--disabled{opacity:.5}.gbt-select__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-select__label--hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host(.gbt-select--full){display:block;width:100%}.gbt-select__trigger{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;height:var(--gbt-control-height-md);padding:0 10px;border:1px solid transparent;border-radius:999px;background:var(--gbt-glass-liquid);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--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);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__trigger{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-select__trigger{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__trigger{color:var(--text-primary);font-size:14px;cursor:pointer}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger{transition:transform .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1),background-color var(--site-transition-fast),color var(--site-transition-fast),box-shadow var(--site-transition-fast),opacity var(--site-transition-fast)}}.gbt-select__trigger:hover:not(:disabled){background-image:linear-gradient(var(--bg-hover),var(--bg-hover))}.gbt-select__trigger:active:not(:disabled){background-image:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24)}@media(prefers-reduced-motion:no-preference){.gbt-select__trigger:active:not(:disabled){transform:scale(1.04)}}.gbt-select__trigger--open,.gbt-select__trigger--open:hover:not(:disabled){border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-select__trigger:disabled{cursor:not-allowed}:host(.gbt-select--sm){min-width:120px}:host(.gbt-select--sm) .gbt-select__trigger{height:var(--gbt-control-height-sm);padding:0 8px;font-size:13px}.gbt-select__trigger-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__trigger-label{flex:1;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__trigger-label--placeholder{color:var(--text-discret)}.gbt-select__chevron{flex-shrink:0;color:var(--text-secondary);transition:transform .2s cubic-bezier(.4,0,.2,1)}.gbt-select__trigger--open .gbt-select__chevron{transform:rotate(180deg)}.gbt-select__panel{position:fixed;z-index:1000;margin:0;padding:6px;list-style:none;max-height:280px;overflow-y:auto;border-radius:var(--gbt-radius-glass);background:var(--gbt-glass-thick);-webkit-backdrop-filter:var(--gbt-liquid-blur);backdrop-filter:var(--gbt-liquid-blur);box-shadow:var(--gbt-depth-liquid);--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);--text-secondary: var(--gbt-liquid-text);--text-discret: var(--gbt-liquid-text)}@media(prefers-reduced-transparency:reduce){.gbt-select__panel{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-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-select__panel{box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-select__panel{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-select__panel{animation:gbt-select-scale-in .15s cubic-bezier(.34,1.56,.64,1) both}.gbt-select__panel::-webkit-scrollbar{width:6px}.gbt-select__panel::-webkit-scrollbar-track{background:transparent}.gbt-select__panel::-webkit-scrollbar-thumb{background:var(--bg-hover);border-radius:3px}.gbt-select__empty{box-sizing:border-box;padding:10px 12px;color:var(--text-secondary);font-size:13px}.gbt-select__option{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;background:transparent;border:none;border-radius:var(--gbt-radius-menu, var(--gbt-radius-row));color:var(--text-primary);font-size:14px;text-align:left;cursor:pointer;transition:background .12s cubic-bezier(.4,0,.2,1)}.gbt-select__option:hover,.gbt-select__option--active{background:var(--bg-hover)}.gbt-select__option:active{background:var(--bg-press)}.gbt-select__option--selected{color:var(--primary);font-weight:600}.gbt-select__option-icon{flex-shrink:0;color:var(--text-secondary)}.gbt-select__option--selected .gbt-select__option-icon{color:var(--primary)}.gbt-select__option-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gbt-select__option-check{flex-shrink:0;color:var(--primary)}@keyframes gbt-select-scale-in{0%{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}.gbt-select__chips{display:flex;flex-wrap:wrap;gap:4px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.gbt-select__hint{margin:0;font-size:.75rem;color:var(--text-secondary)}.gbt-select__error{margin:0;font-size:.75rem;color:var(--color-error-text)}@media(prefers-reduced-motion:reduce){.gbt-select__panel{animation:none}.gbt-select__trigger,.gbt-select__option,.gbt-select__chevron{transition:none}}\n"]
376
376
  }]
377
377
  }],
378
378
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"masmarino-gabarit-select.mjs","names":[],"sources":["../../../projects/gabarit/select/select.ts","../../../projects/gabarit/select/select.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n signal,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { Icon } from '@masmarino/gabarit/icon'\nimport { Tag } from '@masmarino/gabarit/tag'\nimport { floatingPanelAnchor, followPageScroll } from '@masmarino/gabarit/floating-panel'\n\nexport interface SelectOption<T = string> {\n value: T\n label: string\n icon?: string\n color?: string\n}\n\nlet nextSelectId = 0\n\n@Component({\n selector: 'gbt-select',\n standalone: true,\n imports: [Icon, Tag],\n templateUrl: './select.html',\n styleUrl: './select.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:click)': 'handleClickOutside($event)',\n '(keydown)': 'onKeydown($event)',\n '(window:resize)': 'updatePanelPosition()',\n '[class.gbt-select--sm]': \"size() === 'sm'\",\n '[class.gbt-select--full]': 'fullWidth()',\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Select),\n multi: true,\n },\n ],\n})\nexport class Select<T = string> implements ControlValueAccessor {\n private readonly elementRef = inject(ElementRef)\n\n id = input<string>(`gbt-select-${++nextSelectId}`)\n label = input<string>('')\n size = input<'md' | 'sm'>('md')\n hint = input<string>('')\n hideLabel = input(false, { transform: booleanAttribute })\n fullWidth = input(false, { transform: booleanAttribute })\n options = input.required<SelectOption<T>[]>()\n multiple = input(false, { transform: booleanAttribute })\n chips = input(false, { transform: booleanAttribute })\n placeholder = input<string>('Select…')\n disabled = input(false, { transform: booleanAttribute })\n required = input(false, { transform: booleanAttribute })\n errorMessage = input<string | null>(null)\n selectedCountLabel = input<(count: number) => string>((count) => `${count} selected`)\n chipRemoveLabel = input<(label: string) => string>((label) => `Remove ${label}`)\n noOptionsMessage = input<string>('No options')\n\n protected readonly open = signal(false)\n protected readonly activeIndex = signal(-1)\n protected readonly selected = signal<T[]>([])\n protected readonly panelStyle = signal<{ top: string; left: string; width: string } | null>(null)\n private readonly formDisabled = signal(false)\n\n protected readonly labelId = computed(() => `${this.id()}-label`)\n protected readonly chipsId = computed(() => `${this.id()}-chips`)\n protected readonly hintId = computed(() => `${this.id()}-hint`)\n protected readonly showHint = computed(() => !!this.hint() && !this.errorMessage())\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n private onChange: (value: T | T[] | null) => void = () => {}\n private onTouched: () => void = () => {}\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n writeValue(value: T | T[] | null): void {\n if (this.multiple()) {\n this.selected.set(Array.isArray(value) ? (value as T[]) : [])\n } else {\n this.selected.set(value === null || value === undefined ? [] : [value as T])\n }\n }\n\n registerOnChange(fn: (value: T | T[] | null) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n protected readonly selectedOptions = computed(() => {\n const selected = this.selected()\n return this.options().filter((option) => selected.includes(option.value))\n })\n\n protected readonly triggerLabel = computed(() => {\n const opts = this.selectedOptions()\n if (opts.length === 0) {\n return this.placeholder()\n }\n if (this.chips() && this.multiple()) {\n return this.placeholder()\n }\n if (this.multiple() && opts.length > 1) {\n return this.selectedCountLabel()(opts.length)\n }\n return opts[0].label\n })\n\n protected readonly chipsVisible = computed(\n () => this.chips() && this.multiple() && this.selectedOptions().length > 0,\n )\n\n protected readonly describedBy = computed(() => {\n const ids: string[] = []\n if (this.chipsVisible()) {\n ids.push(this.chipsId())\n }\n if (this.errorMessage()) {\n ids.push(`${this.id()}-error`)\n } else if (this.showHint()) {\n ids.push(this.hintId())\n }\n return ids.length > 0 ? ids.join(' ') : null\n })\n\n protected readonly triggerIcon = computed(() => {\n const opts = this.selectedOptions()\n return opts.length === 1 ? opts[0].icon : undefined\n })\n\n protected readonly activeOptionId = computed(() =>\n this.open() && this.activeIndex() >= 0 ? `${this.id()}-option-${this.activeIndex()}` : null,\n )\n\n protected readonly hasNoOptions = computed(() => this.options().length === 0)\n\n protected isSelected(value: T): boolean {\n return this.selected().includes(value)\n }\n\n protected toggleOpen(): void {\n if (this.isDisabled()) {\n return\n }\n this.open.update((value) => !value)\n if (this.open()) {\n const options = this.options()\n this.activeIndex.set(\n options.length === 0\n ? -1\n : Math.max(\n 0,\n options.findIndex((o) => this.isSelected(o.value)),\n ),\n )\n this.updatePanelPosition()\n } else {\n this.onTouched()\n }\n }\n\n constructor() {\n followPageScroll(() => this.updatePanelPosition())\n }\n\n protected updatePanelPosition(): void {\n const trigger = this.elementRef.nativeElement.querySelector(\n '.gbt-select__trigger',\n ) as HTMLElement | null\n const anchor = floatingPanelAnchor(this.open(), trigger, (rect) => {\n const chipRow = this.elementRef.nativeElement.querySelector(\n '.gbt-select__chips',\n ) as HTMLElement | null\n return chipRow ? Math.max(rect.bottom, chipRow.getBoundingClientRect().bottom) : rect.bottom\n })\n if (anchor) {\n this.panelStyle.set({\n top: `${anchor.bottom}px`,\n left: `${anchor.left}px`,\n width: `${anchor.rect.width}px`,\n })\n }\n }\n\n protected removeChip(value: T, index: number): void {\n if (this.isDisabled()) {\n return\n }\n const host = this.elementRef.nativeElement as HTMLElement\n const removeButtons = Array.from(\n host.querySelectorAll<HTMLElement>('.gbt-select__chips .gbt-tag__remove'),\n )\n const nextFocus =\n removeButtons[index + 1] ??\n removeButtons[index - 1] ??\n host.querySelector<HTMLElement>('.gbt-select__trigger')\n this.selectOption(value)\n nextFocus?.focus()\n }\n\n protected selectOption(value: T): void {\n if (this.multiple()) {\n const current = this.selected()\n const next = current.includes(value)\n ? current.filter((v) => v !== value)\n : [...current, value]\n this.selected.set(next)\n this.onChange(next)\n this.onTouched()\n } else {\n this.selected.set([value])\n this.onChange(value)\n this.open.set(false)\n this.onTouched()\n }\n }\n\n protected handleClickOutside(event: MouseEvent): void {\n if (this.open() && !this.elementRef.nativeElement.contains(event.target)) {\n this.open.set(false)\n this.onTouched()\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.isDisabled()) {\n return\n }\n if (!this.open()) {\n if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n this.toggleOpen()\n }\n return\n }\n const options = this.options()\n switch (event.key) {\n case 'Escape':\n event.preventDefault()\n event.stopPropagation()\n this.open.set(false)\n this.onTouched()\n break\n case 'ArrowDown':\n event.preventDefault()\n if (options.length > 0) {\n this.activeIndex.update((i) => Math.min(i + 1, options.length - 1))\n }\n break\n case 'ArrowUp':\n event.preventDefault()\n if (options.length > 0) {\n this.activeIndex.update((i) => Math.max(i - 1, 0))\n }\n break\n case 'Enter':\n case ' ': {\n event.preventDefault()\n const active = options[this.activeIndex()]\n if (active) {\n this.selectOption(active.value)\n }\n break\n }\n }\n }\n}\n","<div class=\"gbt-select\" [class.gbt-select--disabled]=\"isDisabled()\">\n @if (label()) {\n <label\n [id]=\"labelId()\"\n [for]=\"id()\"\n class=\"gbt-select__label\"\n [class.gbt-select__label--hidden]=\"hideLabel()\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n\n <button\n type=\"button\"\n [id]=\"id()\"\n class=\"gbt-select__trigger\"\n [class.gbt-select__trigger--open]=\"open()\"\n [disabled]=\"isDisabled()\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"open() ? id() + '-listbox' : null\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-labelledby]=\"label() ? labelId() + ' ' + id() : null\"\n [attr.aria-label]=\"label() ? null : placeholder() || null\"\n [attr.aria-required]=\"required() ? true : null\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"toggleOpen()\"\n >\n @if (triggerIcon(); as icon) {\n <gbt-icon [name]=\"icon\" class=\"gbt-select__trigger-icon\" aria-hidden=\"true\" />\n }\n <span\n class=\"gbt-select__trigger-label\"\n [class.gbt-select__trigger-label--placeholder]=\"selectedOptions().length === 0\"\n >\n {{ triggerLabel() }}\n </span>\n <gbt-icon name=\"chevron-down\" class=\"gbt-select__chevron\" aria-hidden=\"true\" />\n </button>\n @if (chipsVisible()) {\n <div class=\"gbt-select__chips\" [id]=\"chipsId()\">\n @for (option of selectedOptions(); track option.value; let i = $index) {\n <gbt-tag\n [color]=\"option.color ?? '#6b7280'\"\n [removable]=\"!isDisabled()\"\n [disabled]=\"isDisabled()\"\n [removeLabel]=\"chipRemoveLabel()(option.label)\"\n (removed)=\"removeChip(option.value, i)\"\n >\n {{ option.label }}\n </gbt-tag>\n }\n </div>\n }\n @if (chips() && multiple()) {\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n {{ selectedCountLabel()(selectedOptions().length) }}\n </div>\n }\n @if (open() && panelStyle(); as style) {\n @if (hasNoOptions()) {\n <div\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel gbt-select__empty\"\n role=\"status\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n {{ noOptionsMessage() }}\n </div>\n } @else {\n <ul\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel\"\n role=\"listbox\"\n [attr.aria-label]=\"label() || placeholder()\"\n [attr.aria-multiselectable]=\"multiple()\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n @for (option of options(); track option.value; let i = $index) {\n <li role=\"presentation\">\n <button\n [id]=\"id() + '-option-' + i\"\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"gbt-select__option\"\n [class.gbt-select__option--selected]=\"isSelected(option.value)\"\n [class.gbt-select__option--active]=\"i === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n (click)=\"selectOption(option.value)\"\n (mouseenter)=\"activeIndex.set(i)\"\n >\n @if (option.icon) {\n <gbt-icon [name]=\"option.icon\" class=\"gbt-select__option-icon\" aria-hidden=\"true\" />\n }\n <span class=\"gbt-select__option-label\">{{ option.label }}</span>\n @if (isSelected(option.value)) {\n <gbt-icon name=\"check\" class=\"gbt-select__option-check\" aria-hidden=\"true\" />\n }\n </button>\n </li>\n }\n </ul>\n }\n }\n @if (showHint()) {\n <p [id]=\"hintId()\" class=\"gbt-select__hint\">{{ hint() }}</p>\n }\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-select__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n"],"mappings":";;;;;;AAuBA,IAAI,eAAe;AAwBnB,IAAa,SAAb,MAAa,OAAM;CACA,aAAa,OAAO,UAAU;CAE/C,KAAK,MAAc,cAAc,EAAE,gBAAe,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAClD,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,OAAO,MAAmB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,OAAO,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACxB,YAAY,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACtD,YAAY,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACtD,UAAU,MAAM,SAA6B,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC7C,WA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,0BAA0B;IAC1B,4BAA4B;GAC7B;GAAA,WACU,CACT;IACE,SAAS;IACT,aAAa,iBAAgB,MAAO;IACpC,OAAO;GACR,CACF;GAAA,UAAA;GAAA,QAAA,CAAA,umKAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"masmarino-gabarit-select.mjs","names":[],"sources":["../../../projects/gabarit/select/select.ts","../../../projects/gabarit/select/select.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n signal,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { Icon } from '@masmarino/gabarit/icon'\nimport { Tag } from '@masmarino/gabarit/tag'\nimport { floatingPanelAnchor, followPageScroll } from '@masmarino/gabarit/floating-panel'\n\nexport interface SelectOption<T = string> {\n value: T\n label: string\n icon?: string\n color?: string\n}\n\nlet nextSelectId = 0\n\n@Component({\n selector: 'gbt-select',\n standalone: true,\n imports: [Icon, Tag],\n templateUrl: './select.html',\n styleUrl: './select.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:click)': 'handleClickOutside($event)',\n '(keydown)': 'onKeydown($event)',\n '(window:resize)': 'updatePanelPosition()',\n '[class.gbt-select--sm]': \"size() === 'sm'\",\n '[class.gbt-select--full]': 'fullWidth()',\n },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Select),\n multi: true,\n },\n ],\n})\nexport class Select<T = string> implements ControlValueAccessor {\n private readonly elementRef = inject(ElementRef)\n\n id = input<string>(`gbt-select-${++nextSelectId}`)\n label = input<string>('')\n size = input<'md' | 'sm'>('md')\n hint = input<string>('')\n hideLabel = input(false, { transform: booleanAttribute })\n fullWidth = input(false, { transform: booleanAttribute })\n options = input.required<SelectOption<T>[]>()\n multiple = input(false, { transform: booleanAttribute })\n chips = input(false, { transform: booleanAttribute })\n placeholder = input<string>('Select…')\n disabled = input(false, { transform: booleanAttribute })\n required = input(false, { transform: booleanAttribute })\n errorMessage = input<string | null>(null)\n selectedCountLabel = input<(count: number) => string>((count) => `${count} selected`)\n chipRemoveLabel = input<(label: string) => string>((label) => `Remove ${label}`)\n noOptionsMessage = input<string>('No options')\n\n protected readonly open = signal(false)\n protected readonly activeIndex = signal(-1)\n protected readonly selected = signal<T[]>([])\n protected readonly panelStyle = signal<{ top: string; left: string; width: string } | null>(null)\n private readonly formDisabled = signal(false)\n\n protected readonly labelId = computed(() => `${this.id()}-label`)\n protected readonly chipsId = computed(() => `${this.id()}-chips`)\n protected readonly hintId = computed(() => `${this.id()}-hint`)\n protected readonly showHint = computed(() => !!this.hint() && !this.errorMessage())\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n private onChange: (value: T | T[] | null) => void = () => {}\n private onTouched: () => void = () => {}\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n writeValue(value: T | T[] | null): void {\n if (this.multiple()) {\n this.selected.set(Array.isArray(value) ? (value as T[]) : [])\n } else {\n this.selected.set(value === null || value === undefined ? [] : [value as T])\n }\n }\n\n registerOnChange(fn: (value: T | T[] | null) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n protected readonly selectedOptions = computed(() => {\n const selected = this.selected()\n return this.options().filter((option) => selected.includes(option.value))\n })\n\n protected readonly triggerLabel = computed(() => {\n const opts = this.selectedOptions()\n if (opts.length === 0) {\n return this.placeholder()\n }\n if (this.chips() && this.multiple()) {\n return this.placeholder()\n }\n if (this.multiple() && opts.length > 1) {\n return this.selectedCountLabel()(opts.length)\n }\n return opts[0].label\n })\n\n protected readonly chipsVisible = computed(\n () => this.chips() && this.multiple() && this.selectedOptions().length > 0,\n )\n\n protected readonly describedBy = computed(() => {\n const ids: string[] = []\n if (this.chipsVisible()) {\n ids.push(this.chipsId())\n }\n if (this.errorMessage()) {\n ids.push(`${this.id()}-error`)\n } else if (this.showHint()) {\n ids.push(this.hintId())\n }\n return ids.length > 0 ? ids.join(' ') : null\n })\n\n protected readonly triggerIcon = computed(() => {\n const opts = this.selectedOptions()\n return opts.length === 1 ? opts[0].icon : undefined\n })\n\n protected readonly activeOptionId = computed(() =>\n this.open() && this.activeIndex() >= 0 ? `${this.id()}-option-${this.activeIndex()}` : null,\n )\n\n protected readonly hasNoOptions = computed(() => this.options().length === 0)\n\n protected isSelected(value: T): boolean {\n return this.selected().includes(value)\n }\n\n protected toggleOpen(): void {\n if (this.isDisabled()) {\n return\n }\n this.open.update((value) => !value)\n if (this.open()) {\n const options = this.options()\n this.activeIndex.set(\n options.length === 0\n ? -1\n : Math.max(\n 0,\n options.findIndex((o) => this.isSelected(o.value)),\n ),\n )\n this.updatePanelPosition()\n } else {\n this.onTouched()\n }\n }\n\n constructor() {\n followPageScroll(() => this.updatePanelPosition())\n }\n\n protected updatePanelPosition(): void {\n const trigger = this.elementRef.nativeElement.querySelector(\n '.gbt-select__trigger',\n ) as HTMLElement | null\n const anchor = floatingPanelAnchor(this.open(), trigger, (rect) => {\n const chipRow = this.elementRef.nativeElement.querySelector(\n '.gbt-select__chips',\n ) as HTMLElement | null\n return chipRow ? Math.max(rect.bottom, chipRow.getBoundingClientRect().bottom) : rect.bottom\n })\n if (anchor) {\n this.panelStyle.set({\n top: `${anchor.bottom}px`,\n left: `${anchor.left}px`,\n width: `${anchor.rect.width}px`,\n })\n }\n }\n\n protected removeChip(value: T, index: number): void {\n if (this.isDisabled()) {\n return\n }\n const host = this.elementRef.nativeElement as HTMLElement\n const removeButtons = Array.from(\n host.querySelectorAll<HTMLElement>('.gbt-select__chips .gbt-tag__remove'),\n )\n const nextFocus =\n removeButtons[index + 1] ??\n removeButtons[index - 1] ??\n host.querySelector<HTMLElement>('.gbt-select__trigger')\n this.selectOption(value)\n nextFocus?.focus()\n }\n\n protected selectOption(value: T): void {\n if (this.multiple()) {\n const current = this.selected()\n const next = current.includes(value)\n ? current.filter((v) => v !== value)\n : [...current, value]\n this.selected.set(next)\n this.onChange(next)\n this.onTouched()\n } else {\n this.selected.set([value])\n this.onChange(value)\n this.open.set(false)\n this.onTouched()\n }\n }\n\n protected handleClickOutside(event: MouseEvent): void {\n if (this.open() && !this.elementRef.nativeElement.contains(event.target)) {\n this.open.set(false)\n this.onTouched()\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.isDisabled()) {\n return\n }\n if (!this.open()) {\n if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n this.toggleOpen()\n }\n return\n }\n const options = this.options()\n switch (event.key) {\n case 'Escape':\n event.preventDefault()\n event.stopPropagation()\n this.open.set(false)\n this.onTouched()\n break\n case 'ArrowDown':\n event.preventDefault()\n if (options.length > 0) {\n this.activeIndex.update((i) => Math.min(i + 1, options.length - 1))\n }\n break\n case 'ArrowUp':\n event.preventDefault()\n if (options.length > 0) {\n this.activeIndex.update((i) => Math.max(i - 1, 0))\n }\n break\n case 'Enter':\n case ' ': {\n event.preventDefault()\n const active = options[this.activeIndex()]\n if (active) {\n this.selectOption(active.value)\n }\n break\n }\n }\n }\n}\n","<div class=\"gbt-select\" [class.gbt-select--disabled]=\"isDisabled()\">\n @if (label()) {\n <label\n [id]=\"labelId()\"\n [for]=\"id()\"\n class=\"gbt-select__label\"\n [class.gbt-select__label--hidden]=\"hideLabel()\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n\n <button\n type=\"button\"\n [id]=\"id()\"\n class=\"gbt-select__trigger\"\n [class.gbt-select__trigger--open]=\"open()\"\n [disabled]=\"isDisabled()\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"open() ? id() + '-listbox' : null\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-labelledby]=\"label() ? labelId() + ' ' + id() : null\"\n [attr.aria-label]=\"label() ? null : placeholder() || null\"\n [attr.aria-required]=\"required() ? true : null\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"toggleOpen()\"\n >\n @if (triggerIcon(); as icon) {\n <gbt-icon [name]=\"icon\" class=\"gbt-select__trigger-icon\" aria-hidden=\"true\" />\n }\n <span\n class=\"gbt-select__trigger-label\"\n [class.gbt-select__trigger-label--placeholder]=\"selectedOptions().length === 0\"\n >\n {{ triggerLabel() }}\n </span>\n <gbt-icon name=\"chevron-down\" class=\"gbt-select__chevron\" aria-hidden=\"true\" />\n </button>\n @if (chipsVisible()) {\n <div class=\"gbt-select__chips\" [id]=\"chipsId()\">\n @for (option of selectedOptions(); track option.value; let i = $index) {\n <gbt-tag\n [color]=\"option.color ?? '#6b7280'\"\n [removable]=\"!isDisabled()\"\n [disabled]=\"isDisabled()\"\n [removeLabel]=\"chipRemoveLabel()(option.label)\"\n (removed)=\"removeChip(option.value, i)\"\n >\n {{ option.label }}\n </gbt-tag>\n }\n </div>\n }\n @if (chips() && multiple()) {\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\">\n {{ selectedCountLabel()(selectedOptions().length) }}\n </div>\n }\n @if (open() && panelStyle(); as style) {\n @if (hasNoOptions()) {\n <div\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel gbt-select__empty\"\n role=\"status\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n {{ noOptionsMessage() }}\n </div>\n } @else {\n <ul\n [id]=\"id() + '-listbox'\"\n class=\"gbt-select__panel\"\n role=\"listbox\"\n [attr.aria-label]=\"label() || placeholder()\"\n [attr.aria-multiselectable]=\"multiple()\"\n [style.top]=\"style.top\"\n [style.left]=\"style.left\"\n [style.width]=\"style.width\"\n >\n @for (option of options(); track option.value; let i = $index) {\n <li role=\"presentation\">\n <button\n [id]=\"id() + '-option-' + i\"\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"gbt-select__option\"\n [class.gbt-select__option--selected]=\"isSelected(option.value)\"\n [class.gbt-select__option--active]=\"i === activeIndex()\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n (click)=\"selectOption(option.value)\"\n (mouseenter)=\"activeIndex.set(i)\"\n >\n @if (option.icon) {\n <gbt-icon [name]=\"option.icon\" class=\"gbt-select__option-icon\" aria-hidden=\"true\" />\n }\n <span class=\"gbt-select__option-label\">{{ option.label }}</span>\n @if (isSelected(option.value)) {\n <gbt-icon name=\"check\" class=\"gbt-select__option-check\" aria-hidden=\"true\" />\n }\n </button>\n </li>\n }\n </ul>\n }\n }\n @if (showHint()) {\n <p [id]=\"hintId()\" class=\"gbt-select__hint\">{{ hint() }}</p>\n }\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-select__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n"],"mappings":";;;;;;AAuBA,IAAI,eAAe;AAwBnB,IAAa,SAAb,MAAa,OAAM;CACA,aAAa,OAAO,UAAU;CAE/C,KAAK,MAAc,cAAc,EAAE,gBAAe,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAClD,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,OAAO,MAAmB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,OAAO,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACxB,YAAY,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACtD,YAAY,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACtD,UAAU,MAAM,SAA6B,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,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AoB;IACpB,aAAa;IACb,mBAAmB;IACnB,0BAA0B;IAC1B,4BAA4B;GAC7B;GAAA,WACU,CACT;IACE,SAAS;IACT,aAAa,iBAAgB,MAAO;IACpC,OAAO;GACR,CACF;GAAA,UAAA;GAAA,QAAA,CAAA,05LAAA;EAAA,CAAA"}
@@ -84,7 +84,7 @@ var SkeletonList = class SkeletonList {
84
84
  },
85
85
  ngImport: i0,
86
86
  template: "<div class=\"gbt-skeleton-list\" [attr.data-padded]=\"padded() ? '' : null\">\n <span class=\"sr-only\" role=\"status\">{{ loadingLabel() }}</span>\n <div aria-hidden=\"true\">\n @for (item of items(); track item.row) {\n <div class=\"gbt-skeleton-list__row\">\n @if (leading() !== 'none') {\n <gbt-skeleton\n class=\"gbt-skeleton-list__leading\"\n [variant]=\"leading() === 'circle' ? 'circle' : 'rect'\"\n [attr.data-leading]=\"leading()\"\n [width]=\"leadingSize()\"\n [height]=\"leadingSize()\"\n />\n }\n <div class=\"gbt-skeleton-list__lines\">\n @for (width of item.widths; track $index) {\n <gbt-skeleton [width]=\"width\" [height]=\"$index === 0 ? '0.875rem' : '0.625rem'\" />\n }\n </div>\n </div>\n }\n </div>\n</div>\n",
87
- styles: [":host{display:block}.gbt-skeleton-list__row{display:flex;align-items:flex-start;gap:.75rem;padding:.875rem 0}.gbt-skeleton-list[data-padded] .gbt-skeleton-list__row{padding-inline:1rem}.gbt-skeleton-list__leading{flex:none;margin-top:.125rem}.gbt-skeleton-list__leading[data-leading=square]{border-radius:.25rem}.gbt-skeleton-list__lines{display:flex;flex:1;flex-direction:column;gap:.5rem;min-width:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n"],
87
+ styles: [":host{display:block}.gbt-skeleton-list__row{display:flex;align-items:flex-start;gap:.75rem;padding:.875rem 0}.gbt-skeleton-list[data-padded] .gbt-skeleton-list__row{padding-inline:1rem}.gbt-skeleton-list__leading{flex:none;margin-top:.125rem}.gbt-skeleton-list__leading[data-leading=square]{border-radius:var(--site-border-radius)}.gbt-skeleton-list__lines{display:flex;flex:1;flex-direction:column;gap:.5rem;min-width:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n"],
88
88
  dependencies: [{
89
89
  kind: "component",
90
90
  type: Skeleton,
@@ -111,7 +111,7 @@ i0.ɵɵngDeclareClassMetadata({
111
111
  imports: [Skeleton],
112
112
  changeDetection: ChangeDetectionStrategy.OnPush,
113
113
  template: "<div class=\"gbt-skeleton-list\" [attr.data-padded]=\"padded() ? '' : null\">\n <span class=\"sr-only\" role=\"status\">{{ loadingLabel() }}</span>\n <div aria-hidden=\"true\">\n @for (item of items(); track item.row) {\n <div class=\"gbt-skeleton-list__row\">\n @if (leading() !== 'none') {\n <gbt-skeleton\n class=\"gbt-skeleton-list__leading\"\n [variant]=\"leading() === 'circle' ? 'circle' : 'rect'\"\n [attr.data-leading]=\"leading()\"\n [width]=\"leadingSize()\"\n [height]=\"leadingSize()\"\n />\n }\n <div class=\"gbt-skeleton-list__lines\">\n @for (width of item.widths; track $index) {\n <gbt-skeleton [width]=\"width\" [height]=\"$index === 0 ? '0.875rem' : '0.625rem'\" />\n }\n </div>\n </div>\n }\n </div>\n</div>\n",
114
- styles: [":host{display:block}.gbt-skeleton-list__row{display:flex;align-items:flex-start;gap:.75rem;padding:.875rem 0}.gbt-skeleton-list[data-padded] .gbt-skeleton-list__row{padding-inline:1rem}.gbt-skeleton-list__leading{flex:none;margin-top:.125rem}.gbt-skeleton-list__leading[data-leading=square]{border-radius:.25rem}.gbt-skeleton-list__lines{display:flex;flex:1;flex-direction:column;gap:.5rem;min-width:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n"]
114
+ styles: [":host{display:block}.gbt-skeleton-list__row{display:flex;align-items:flex-start;gap:.75rem;padding:.875rem 0}.gbt-skeleton-list[data-padded] .gbt-skeleton-list__row{padding-inline:1rem}.gbt-skeleton-list__leading{flex:none;margin-top:.125rem}.gbt-skeleton-list__leading[data-leading=square]{border-radius:var(--site-border-radius)}.gbt-skeleton-list__lines{display:flex;flex:1;flex-direction:column;gap:.5rem;min-width:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n"]
115
115
  }]
116
116
  }],
117
117
  propDecorators: {
@@ -1 +1 @@
1
- {"version":3,"file":"masmarino-gabarit-skeleton-list.mjs","names":[],"sources":["../../../projects/gabarit/skeleton-list/skeleton-list.ts","../../../projects/gabarit/skeleton-list/skeleton-list.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n computed,\n input,\n} from '@angular/core'\nimport { Skeleton } from '@masmarino/gabarit/skeleton'\n\nexport type SkeletonListLeading = 'circle' | 'square' | 'none'\n\nconst TITLE_WIDTHS = ['62%', '48%', '70%', '55%', '66%', '44%']\nconst DETAIL_WIDTHS = ['36%', '24%']\n\n@Component({\n selector: 'gbt-skeleton-list',\n standalone: true,\n imports: [Skeleton],\n templateUrl: './skeleton-list.html',\n styleUrl: './skeleton-list.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkeletonList {\n rows = input(4)\n leading = input<SkeletonListLeading>('circle')\n leadingSize = input('1rem')\n lines = input<1 | 2 | 3>(2)\n loadingLabel = input('Loading…')\n padded = input(true, { transform: booleanAttribute })\n\n protected readonly items = computed(() =>\n Array.from({ length: Math.max(0, Math.round(this.rows())) }, (_, row) => ({\n row,\n widths: Array.from({ length: this.lines() }, (_, line) =>\n line === 0\n ? TITLE_WIDTHS[row % TITLE_WIDTHS.length]\n : DETAIL_WIDTHS[Math.min(line - 1, DETAIL_WIDTHS.length - 1)],\n ),\n })),\n )\n}\n","<div class=\"gbt-skeleton-list\" [attr.data-padded]=\"padded() ? '' : null\">\n <span class=\"sr-only\" role=\"status\">{{ loadingLabel() }}</span>\n <div aria-hidden=\"true\">\n @for (item of items(); track item.row) {\n <div class=\"gbt-skeleton-list__row\">\n @if (leading() !== 'none') {\n <gbt-skeleton\n class=\"gbt-skeleton-list__leading\"\n [variant]=\"leading() === 'circle' ? 'circle' : 'rect'\"\n [attr.data-leading]=\"leading()\"\n [width]=\"leadingSize()\"\n [height]=\"leadingSize()\"\n />\n }\n <div class=\"gbt-skeleton-list__lines\">\n @for (width of item.widths; track $index) {\n <gbt-skeleton [width]=\"width\" [height]=\"$index === 0 ? '0.875rem' : '0.625rem'\" />\n }\n </div>\n </div>\n }\n </div>\n</div>\n"],"mappings":";;;AAWA,MAAM,eAAe;CAAC;CAAO;CAAO;CAAO;CAAO;CAAO;AAAK;AAC9D,MAAM,gBAAgB,CAAC,OAAO,KAAK;AAUnC,IAAa,eAAb,MAAa,aAAY;CACvB,OAAO,MAAM,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACf,UAAU,MAA2B,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC9C,cAAc,MAAM,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,QAAQ,MAAiB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,eAAe,MAAM,YAAW,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,SAAS,MAAM,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAE/B,QAAQ,eACzB,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,KAAI,CAAE,CAAC,EAAC,IAAK,GAAG,SAAS;EACxE;EACA,QAAQ,MAAM,KAAK,EAA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,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAmB,YACjB;GAAI,SACP,CAAC,QAAQ;GAAC,iBAGF,wBAAwB;GAAM,UAAA;GAAA,QAAA,CAAA,6hBAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"masmarino-gabarit-skeleton-list.mjs","names":[],"sources":["../../../projects/gabarit/skeleton-list/skeleton-list.ts","../../../projects/gabarit/skeleton-list/skeleton-list.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n computed,\n input,\n} from '@angular/core'\nimport { Skeleton } from '@masmarino/gabarit/skeleton'\n\nexport type SkeletonListLeading = 'circle' | 'square' | 'none'\n\nconst TITLE_WIDTHS = ['62%', '48%', '70%', '55%', '66%', '44%']\nconst DETAIL_WIDTHS = ['36%', '24%']\n\n@Component({\n selector: 'gbt-skeleton-list',\n standalone: true,\n imports: [Skeleton],\n templateUrl: './skeleton-list.html',\n styleUrl: './skeleton-list.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkeletonList {\n rows = input(4)\n leading = input<SkeletonListLeading>('circle')\n leadingSize = input('1rem')\n lines = input<1 | 2 | 3>(2)\n loadingLabel = input('Loading…')\n padded = input(true, { transform: booleanAttribute })\n\n protected readonly items = computed(() =>\n Array.from({ length: Math.max(0, Math.round(this.rows())) }, (_, row) => ({\n row,\n widths: Array.from({ length: this.lines() }, (_, line) =>\n line === 0\n ? TITLE_WIDTHS[row % TITLE_WIDTHS.length]\n : DETAIL_WIDTHS[Math.min(line - 1, DETAIL_WIDTHS.length - 1)],\n ),\n })),\n )\n}\n","<div class=\"gbt-skeleton-list\" [attr.data-padded]=\"padded() ? '' : null\">\n <span class=\"sr-only\" role=\"status\">{{ loadingLabel() }}</span>\n <div aria-hidden=\"true\">\n @for (item of items(); track item.row) {\n <div class=\"gbt-skeleton-list__row\">\n @if (leading() !== 'none') {\n <gbt-skeleton\n class=\"gbt-skeleton-list__leading\"\n [variant]=\"leading() === 'circle' ? 'circle' : 'rect'\"\n [attr.data-leading]=\"leading()\"\n [width]=\"leadingSize()\"\n [height]=\"leadingSize()\"\n />\n }\n <div class=\"gbt-skeleton-list__lines\">\n @for (width of item.widths; track $index) {\n <gbt-skeleton [width]=\"width\" [height]=\"$index === 0 ? '0.875rem' : '0.625rem'\" />\n }\n </div>\n </div>\n }\n </div>\n</div>\n"],"mappings":";;;AAWA,MAAM,eAAe;CAAC;CAAO;CAAO;CAAO;CAAO;CAAO;AAAK;AAC9D,MAAM,gBAAgB,CAAC,OAAO,KAAK;AAUnC,IAAa,eAAb,MAAa,aAAY;CACvB,OAAO,MAAM,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACf,UAAU,MAA2B,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC9C,cAAc,MAAM,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,QAAQ,MAAiB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,eAAe,MAAM,YAAW,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,SAAS,MAAM,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAE/B,QAAQ,eACzB,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,KAAI,CAAE,CAAC,EAAC,IAAK,GAAG,SAAS;EACxE;EACA,QAAQ,MAAM,KAAK,EAAE,QAAQ,KAAK,MAAK,EAAE,IAAK,GAAG,SAC/C,SAAS,IACL,aAAa,MAAM,aAAa,UAChC,cAAc,KAAK,IAAI,OAAO,GAAG,cAAc,SAAS,CAAC,EAAE;CAElE,EAAC,GACH,GAAA,YAAA,CAAA,E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leton = class Skeleton {
52
52
  ngImport: i0,
53
53
  template: "",
54
54
  isInline: true,
55
- styles: [":host{display:block;position:relative;overflow:hidden;background:var(--border-color);opacity:.35}:host[data-variant=text]{height:1em;border-radius:4px}:host[data-variant=circle]{aspect-ratio:1;border-radius:50%}:host[data-variant=rect]{height:100px;border-radius:var(--site-border-radius-sm)}:host:after{content:\"\";position:absolute;inset:0;transform:translate(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.4),transparent);animation:gbt-skeleton-sweep 1.6s ease-in-out infinite}@keyframes gbt-skeleton-sweep{to{transform:translate(100%)}}@media(prefers-reduced-motion:reduce){:host:after{animation:none}}\n"],
55
+ styles: [":host{display:block;position:relative;overflow:hidden;background:var(--border-color);opacity:.35}:host[data-variant=text]{height:1em;border-radius:var(--site-border-radius)}:host[data-variant=circle]{aspect-ratio:1;border-radius:50%}:host[data-variant=rect]{height:100px;border-radius:var(--gbt-radius-row)}:host:after{content:\"\";position:absolute;inset:0;transform:translate(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.4),transparent);animation:gbt-skeleton-sweep 1.6s ease-in-out infinite}@keyframes gbt-skeleton-sweep{to{transform:translate(100%)}}@media(prefers-reduced-motion:reduce){:host:after{animation:none}}\n"],
56
56
  changeDetection: i0.ChangeDetectionStrategy.OnPush
57
57
  });
58
58
  };
@@ -74,7 +74,7 @@ i0.ɵɵngDeclareClassMetadata({
74
74
  "[style.height]": "height()",
75
75
  "aria-hidden": "true"
76
76
  },
77
- styles: [":host{display:block;position:relative;overflow:hidden;background:var(--border-color);opacity:.35}:host[data-variant=text]{height:1em;border-radius:4px}:host[data-variant=circle]{aspect-ratio:1;border-radius:50%}:host[data-variant=rect]{height:100px;border-radius:var(--site-border-radius-sm)}:host:after{content:\"\";position:absolute;inset:0;transform:translate(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.4),transparent);animation:gbt-skeleton-sweep 1.6s ease-in-out infinite}@keyframes gbt-skeleton-sweep{to{transform:translate(100%)}}@media(prefers-reduced-motion:reduce){:host:after{animation:none}}\n"]
77
+ styles: [":host{display:block;position:relative;overflow:hidden;background:var(--border-color);opacity:.35}:host[data-variant=text]{height:1em;border-radius:var(--site-border-radius)}:host[data-variant=circle]{aspect-ratio:1;border-radius:50%}:host[data-variant=rect]{height:100px;border-radius:var(--gbt-radius-row)}:host:after{content:\"\";position:absolute;inset:0;transform:translate(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.4),transparent);animation:gbt-skeleton-sweep 1.6s ease-in-out infinite}@keyframes gbt-skeleton-sweep{to{transform:translate(100%)}}@media(prefers-reduced-motion:reduce){:host:after{animation:none}}\n"]
78
78
  }]
79
79
  }],
80
80
  propDecorators: {
@@ -1 +1 @@
1
- {"version":3,"file":"masmarino-gabarit-skeleton.mjs","names":[],"sources":["../../../projects/gabarit/skeleton/skeleton.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core'\n\nexport type SkeletonVariant = 'text' | 'circle' | 'rect'\n\n@Component({\n selector: 'gbt-skeleton',\n standalone: true,\n template: '',\n styleUrl: './skeleton.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-variant]': 'variant()',\n '[style.width]': 'width()',\n '[style.height]': 'height()',\n 'aria-hidden': 'true',\n },\n})\nexport class Skeleton {\n variant = input<SkeletonVariant>('text')\n width = input<string>('100%')\n height = input<string | null>(null)\n}\n"],"mappings":";;AAiBA,IAAa,WAAb,MAAa,SAAQ;CACnB,UAAU,MAAuB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACxC,QAAQ,MAAc,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,SAAS,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAHxB,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAQ,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAR,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAQ,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,eAAA,OAAA;GAAA,YAAA;IAAA,qBAAA;IAAA,eAAA;IAAA,gBAAA;GAAA;EAAA;EAAA,UAAA;EAAA,UAVT;EAAE,UAAA;EAAA,QAAA,CAAA,0nBAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAUD,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EAbpB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAc,YACZ;GAAI,UACN;GAAE,iBAEK,wBAAwB;GAAM,MACzC;IACJ,uBAAuB;IACvB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;GAChB;GAAA,QAAA,CAAA,0nBAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"masmarino-gabarit-skeleton.mjs","names":[],"sources":["../../../projects/gabarit/skeleton/skeleton.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core'\n\nexport type SkeletonVariant = 'text' | 'circle' | 'rect'\n\n@Component({\n selector: 'gbt-skeleton',\n standalone: true,\n template: '',\n styleUrl: './skeleton.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-variant]': 'variant()',\n '[style.width]': 'width()',\n '[style.height]': 'height()',\n 'aria-hidden': 'true',\n },\n})\nexport class Skeleton {\n variant = input<SkeletonVariant>('text')\n width = input<string>('100%')\n height = input<string | null>(null)\n}\n"],"mappings":";;AAiBA,IAAa,WAAb,MAAa,SAAQ;CACnB,UAAU,MAAuB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACxC,QAAQ,MAAc,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,SAAS,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAHxB,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAQ,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAR,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAQ,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,eAAA,OAAA;GAAA,YAAA;IAAA,qBAAA;IAAA,eAAA;IAAA,gBAAA;GAAA;EAAA;EAAA,UAAA;EAAA,UAVT;EAAE,UAAA;EAAA,QAAA,CAAA,yoBAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAUD,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EAbpB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAc,YACZ;GAAI,UACN;GAAE,iBAEK,wBAAwB;GAAM,MACzC;IACJ,uBAAuB;IACvB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;GAChB;GAAA,QAAA,CAAA,yoBAAA;EAAA,CAAA"}
@@ -134,7 +134,7 @@ var Slider = class Slider {
134
134
  }],
135
135
  ngImport: i0,
136
136
  template: "<div class=\"gbt-slider\">\n <div class=\"gbt-slider__header\">\n <label [for]=\"id()\">{{ label() }}</label>\n @if (showValue()) {\n <span class=\"gbt-slider__value\">{{ formatValue()(value()) }}</span>\n }\n </div>\n <input\n type=\"range\"\n [id]=\"id()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [step]=\"step()\"\n [value]=\"value()\"\n [disabled]=\"isDisabled()\"\n [style.--gbt-slider-fill.%]=\"fillPercent()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-slider__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
137
- styles: [".gbt-slider{display:flex;flex-direction:column;gap:.375rem}.gbt-slider label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-slider__header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.gbt-slider__value{font-size:.8125rem;font-weight:600;color:var(--text-primary)}.gbt-slider__error{margin:0;font-size:.75rem;color:var(--color-error-text)}input[type=range]{--gbt-slider-fill: 0;box-sizing:border-box;width:100%;height:20px;padding:0;background:transparent;appearance:none;cursor:pointer}input[type=range]:disabled{cursor:not-allowed;opacity:.5}input[type=range]:focus-visible{outline:none}input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--gbt-slider-fill),var(--border-color) var(--gbt-slider-fill),var(--border-color) 100%)}input[type=range]::-webkit-slider-thumb{box-sizing:border-box;width:18px;height:18px;margin-top:-7px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);appearance:none;cursor:pointer}input[type=range]:not(:disabled):hover::-webkit-slider-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:var(--accent);box-shadow:var(--gbt-glow)}input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}input[type=range]::-moz-range-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:var(--border-color)}input[type=range]::-moz-range-progress{height:4px;border-radius:999px;background:var(--accent);box-shadow:var(--gbt-glow)}input[type=range]::-moz-range-thumb{box-sizing:border-box;width:18px;height:18px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);cursor:pointer}input[type=range]:not(:disabled):hover::-moz-range-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-moz-range-thumb{border-color:var(--accent);box-shadow:var(--gbt-glow)}input[type=range]:focus-visible::-moz-range-thumb{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}\n"],
137
+ styles: [".gbt-slider{display:flex;flex-direction:column;gap:.375rem}.gbt-slider label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-slider__header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.gbt-slider__value{font-size:.8125rem;font-weight:600;color:var(--text-primary)}.gbt-slider__error{margin:0;font-size:.75rem;color:var(--color-error-text)}input[type=range]{--gbt-slider-fill: 0;box-sizing:border-box;width:100%;height:20px;padding:0;background:transparent;appearance:none;cursor:pointer}input[type=range]:disabled{cursor:not-allowed;opacity:.5}input[type=range]:focus-visible{outline:none}input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--gbt-slider-fill),var(--border-color) var(--gbt-slider-fill),var(--border-color) 100%)}input[type=range]::-webkit-slider-thumb{box-sizing:border-box;width:18px;height:18px;margin-top:-7px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);appearance:none;cursor:pointer;transition:scale .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1)}@media(prefers-reduced-motion:reduce){input[type=range]::-webkit-slider-thumb{transition:none}}input[type=range]:not(:disabled):hover::-webkit-slider-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:transparent;background:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24),var(--gbt-glass-regular);box-shadow:var(--gbt-depth-liquid),0 1px 4px var(--gbt-liquid-shadow)}@media(prefers-reduced-motion:no-preference){input[type=range]:not(:disabled):active::-webkit-slider-thumb{scale:1.04}}@media(prefers-reduced-transparency:reduce){input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:var(--accent);background:var(--gbt-knob);-webkit-backdrop-filter:none;backdrop-filter:none}}input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}input[type=range]::-moz-range-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:var(--border-color)}input[type=range]::-moz-range-progress{height:4px;border-radius:999px;background:var(--accent);box-shadow:var(--gbt-glow)}input[type=range]::-moz-range-thumb{box-sizing:border-box;width:18px;height:18px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);cursor:pointer}input[type=range]:not(:disabled):hover::-moz-range-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-moz-range-thumb{border-color:transparent;background:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24),var(--gbt-glass-regular);box-shadow:var(--gbt-depth-liquid),0 1px 4px var(--gbt-liquid-shadow)}@media(prefers-reduced-motion:no-preference){input[type=range]:not(:disabled):active::-moz-range-thumb{scale:1.04}}@media(prefers-reduced-transparency:reduce){input[type=range]:not(:disabled):active::-moz-range-thumb{border-color:var(--accent);background:var(--gbt-knob);-webkit-backdrop-filter:none;backdrop-filter:none}}input[type=range]:focus-visible::-moz-range-thumb{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}\n"],
138
138
  changeDetection: i0.ChangeDetectionStrategy.OnPush
139
139
  });
140
140
  };
@@ -156,7 +156,7 @@ i0.ɵɵngDeclareClassMetadata({
156
156
  multi: true
157
157
  }],
158
158
  template: "<div class=\"gbt-slider\">\n <div class=\"gbt-slider__header\">\n <label [for]=\"id()\">{{ label() }}</label>\n @if (showValue()) {\n <span class=\"gbt-slider__value\">{{ formatValue()(value()) }}</span>\n }\n </div>\n <input\n type=\"range\"\n [id]=\"id()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [step]=\"step()\"\n [value]=\"value()\"\n [disabled]=\"isDisabled()\"\n [style.--gbt-slider-fill.%]=\"fillPercent()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-slider__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
159
- styles: [".gbt-slider{display:flex;flex-direction:column;gap:.375rem}.gbt-slider label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-slider__header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.gbt-slider__value{font-size:.8125rem;font-weight:600;color:var(--text-primary)}.gbt-slider__error{margin:0;font-size:.75rem;color:var(--color-error-text)}input[type=range]{--gbt-slider-fill: 0;box-sizing:border-box;width:100%;height:20px;padding:0;background:transparent;appearance:none;cursor:pointer}input[type=range]:disabled{cursor:not-allowed;opacity:.5}input[type=range]:focus-visible{outline:none}input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--gbt-slider-fill),var(--border-color) var(--gbt-slider-fill),var(--border-color) 100%)}input[type=range]::-webkit-slider-thumb{box-sizing:border-box;width:18px;height:18px;margin-top:-7px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);appearance:none;cursor:pointer}input[type=range]:not(:disabled):hover::-webkit-slider-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:var(--accent);box-shadow:var(--gbt-glow)}input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}input[type=range]::-moz-range-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:var(--border-color)}input[type=range]::-moz-range-progress{height:4px;border-radius:999px;background:var(--accent);box-shadow:var(--gbt-glow)}input[type=range]::-moz-range-thumb{box-sizing:border-box;width:18px;height:18px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);cursor:pointer}input[type=range]:not(:disabled):hover::-moz-range-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-moz-range-thumb{border-color:var(--accent);box-shadow:var(--gbt-glow)}input[type=range]:focus-visible::-moz-range-thumb{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}\n"]
159
+ styles: [".gbt-slider{display:flex;flex-direction:column;gap:.375rem}.gbt-slider label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-slider__header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.gbt-slider__value{font-size:.8125rem;font-weight:600;color:var(--text-primary)}.gbt-slider__error{margin:0;font-size:.75rem;color:var(--color-error-text)}input[type=range]{--gbt-slider-fill: 0;box-sizing:border-box;width:100%;height:20px;padding:0;background:transparent;appearance:none;cursor:pointer}input[type=range]:disabled{cursor:not-allowed;opacity:.5}input[type=range]:focus-visible{outline:none}input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--gbt-slider-fill),var(--border-color) var(--gbt-slider-fill),var(--border-color) 100%)}input[type=range]::-webkit-slider-thumb{box-sizing:border-box;width:18px;height:18px;margin-top:-7px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);appearance:none;cursor:pointer;transition:scale .6s linear(0,.089,.28,.494,.685,.834,.938,1.001,1.034,1.045,1.044,1.036,1.027,1.017,1.01,1.004,1.001,.999,.998 85%,1)}@media(prefers-reduced-motion:reduce){input[type=range]::-webkit-slider-thumb{transition:none}}input[type=range]:not(:disabled):hover::-webkit-slider-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:transparent;background:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24),var(--gbt-glass-regular);box-shadow:var(--gbt-depth-liquid),0 1px 4px var(--gbt-liquid-shadow)}@media(prefers-reduced-motion:no-preference){input[type=range]:not(:disabled):active::-webkit-slider-thumb{scale:1.04}}@media(prefers-reduced-transparency:reduce){input[type=range]:not(:disabled):active::-webkit-slider-thumb{border-color:var(--accent);background:var(--gbt-knob);-webkit-backdrop-filter:none;backdrop-filter:none}}input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}input[type=range]::-moz-range-track{height:4px;border-radius:999px;box-shadow:var(--gbt-depth-hollow);background:var(--border-color)}input[type=range]::-moz-range-progress{height:4px;border-radius:999px;background:var(--accent);box-shadow:var(--gbt-glow)}input[type=range]::-moz-range-thumb{box-sizing:border-box;width:18px;height:18px;background:var(--gbt-knob);border:1px solid var(--border-color);border-radius:50%;box-shadow:var(--gbt-depth-knob);cursor:pointer}input[type=range]:not(:disabled):hover::-moz-range-thumb{border-color:var(--text-discret);box-shadow:var(--gbt-depth-knob-hover)}input[type=range]:not(:disabled):active::-moz-range-thumb{border-color:transparent;background:linear-gradient(#ffffff24,#ffffff0a 50%,#ffffff24),var(--gbt-glass-regular);box-shadow:var(--gbt-depth-liquid),0 1px 4px var(--gbt-liquid-shadow)}@media(prefers-reduced-motion:no-preference){input[type=range]:not(:disabled):active::-moz-range-thumb{scale:1.04}}@media(prefers-reduced-transparency:reduce){input[type=range]:not(:disabled):active::-moz-range-thumb{border-color:var(--accent);background:var(--gbt-knob);-webkit-backdrop-filter:none;backdrop-filter:none}}input[type=range]:focus-visible::-moz-range-thumb{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}\n"]
160
160
  }]
161
161
  }],
162
162
  propDecorators: {