@masmarino/gabarit 4.1.0 → 4.1.1

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 (82) hide show
  1. package/fesm2022/masmarino-gabarit-accordion.mjs +2 -2
  2. package/fesm2022/masmarino-gabarit-accordion.mjs.map +1 -1
  3. package/fesm2022/masmarino-gabarit-alert.mjs +2 -2
  4. package/fesm2022/masmarino-gabarit-alert.mjs.map +1 -1
  5. package/fesm2022/masmarino-gabarit-app-shell.mjs +2 -2
  6. package/fesm2022/masmarino-gabarit-app-shell.mjs.map +1 -1
  7. package/fesm2022/masmarino-gabarit-auth-register.mjs +2 -2
  8. package/fesm2022/masmarino-gabarit-auth-register.mjs.map +1 -1
  9. package/fesm2022/masmarino-gabarit-auth.mjs +2 -2
  10. package/fesm2022/masmarino-gabarit-auth.mjs.map +1 -1
  11. package/fesm2022/masmarino-gabarit-autocomplete.mjs +2 -2
  12. package/fesm2022/masmarino-gabarit-autocomplete.mjs.map +1 -1
  13. package/fesm2022/masmarino-gabarit-avatar-group.mjs +2 -2
  14. package/fesm2022/masmarino-gabarit-avatar-group.mjs.map +1 -1
  15. package/fesm2022/masmarino-gabarit-button.mjs +2 -2
  16. package/fesm2022/masmarino-gabarit-button.mjs.map +1 -1
  17. package/fesm2022/masmarino-gabarit-card.mjs +2 -2
  18. package/fesm2022/masmarino-gabarit-card.mjs.map +1 -1
  19. package/fesm2022/masmarino-gabarit-chart.mjs +2 -2
  20. package/fesm2022/masmarino-gabarit-chart.mjs.map +1 -1
  21. package/fesm2022/masmarino-gabarit-command-palette.mjs +2 -2
  22. package/fesm2022/masmarino-gabarit-command-palette.mjs.map +1 -1
  23. package/fesm2022/masmarino-gabarit-copy-field.mjs +2 -2
  24. package/fesm2022/masmarino-gabarit-copy-field.mjs.map +1 -1
  25. package/fesm2022/masmarino-gabarit-date-picker.mjs +4 -4
  26. package/fesm2022/masmarino-gabarit-date-picker.mjs.map +1 -1
  27. package/fesm2022/masmarino-gabarit-disclosure.mjs +2 -2
  28. package/fesm2022/masmarino-gabarit-disclosure.mjs.map +1 -1
  29. package/fesm2022/masmarino-gabarit-docs.mjs +2 -2
  30. package/fesm2022/masmarino-gabarit-docs.mjs.map +1 -1
  31. package/fesm2022/masmarino-gabarit-drawer.mjs +2 -2
  32. package/fesm2022/masmarino-gabarit-drawer.mjs.map +1 -1
  33. package/fesm2022/masmarino-gabarit-input.mjs +2 -2
  34. package/fesm2022/masmarino-gabarit-input.mjs.map +1 -1
  35. package/fesm2022/masmarino-gabarit-job-graph.mjs +2 -2
  36. package/fesm2022/masmarino-gabarit-job-graph.mjs.map +1 -1
  37. package/fesm2022/masmarino-gabarit-list-card.mjs +2 -2
  38. package/fesm2022/masmarino-gabarit-list-card.mjs.map +1 -1
  39. package/fesm2022/masmarino-gabarit-menu.mjs +2 -2
  40. package/fesm2022/masmarino-gabarit-menu.mjs.map +1 -1
  41. package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs +4 -4
  42. package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs.map +1 -1
  43. package/fesm2022/masmarino-gabarit-mfa-settings.mjs +2 -2
  44. package/fesm2022/masmarino-gabarit-mfa-settings.mjs.map +1 -1
  45. package/fesm2022/masmarino-gabarit-modal.mjs +2 -2
  46. package/fesm2022/masmarino-gabarit-modal.mjs.map +1 -1
  47. package/fesm2022/masmarino-gabarit-passkey-settings.mjs +2 -2
  48. package/fesm2022/masmarino-gabarit-passkey-settings.mjs.map +1 -1
  49. package/fesm2022/masmarino-gabarit-popover.mjs +2 -2
  50. package/fesm2022/masmarino-gabarit-popover.mjs.map +1 -1
  51. package/fesm2022/masmarino-gabarit-search-bar.mjs +2 -2
  52. package/fesm2022/masmarino-gabarit-search-bar.mjs.map +1 -1
  53. package/fesm2022/masmarino-gabarit-secret-reveal.mjs +2 -2
  54. package/fesm2022/masmarino-gabarit-secret-reveal.mjs.map +1 -1
  55. package/fesm2022/masmarino-gabarit-segmented-control.mjs +2 -2
  56. package/fesm2022/masmarino-gabarit-segmented-control.mjs.map +1 -1
  57. package/fesm2022/masmarino-gabarit-select.mjs +2 -2
  58. package/fesm2022/masmarino-gabarit-select.mjs.map +1 -1
  59. package/fesm2022/masmarino-gabarit-sparkline.mjs +2 -2
  60. package/fesm2022/masmarino-gabarit-sparkline.mjs.map +1 -1
  61. package/fesm2022/masmarino-gabarit-stat-grid.mjs +2 -2
  62. package/fesm2022/masmarino-gabarit-stat-grid.mjs.map +1 -1
  63. package/fesm2022/masmarino-gabarit-stat-tile.mjs +2 -2
  64. package/fesm2022/masmarino-gabarit-stat-tile.mjs.map +1 -1
  65. package/fesm2022/masmarino-gabarit-tabs.mjs +2 -2
  66. package/fesm2022/masmarino-gabarit-tabs.mjs.map +1 -1
  67. package/fesm2022/masmarino-gabarit-tag-input.mjs +2 -2
  68. package/fesm2022/masmarino-gabarit-tag-input.mjs.map +1 -1
  69. package/fesm2022/masmarino-gabarit-textarea.mjs +2 -2
  70. package/fesm2022/masmarino-gabarit-textarea.mjs.map +1 -1
  71. package/fesm2022/masmarino-gabarit-toaster.mjs +2 -2
  72. package/fesm2022/masmarino-gabarit-toaster.mjs.map +1 -1
  73. package/fesm2022/masmarino-gabarit-tooltip.mjs +2 -2
  74. package/fesm2022/masmarino-gabarit-tooltip.mjs.map +1 -1
  75. package/fesm2022/masmarino-gabarit.mjs +1 -1
  76. package/fesm2022/masmarino-gabarit.mjs.map +1 -1
  77. package/package.json +1 -1
  78. package/src/lib/tokens/_glass.scss +52 -1
  79. package/src/lib/tokens/_grounds.scss +6 -6
  80. package/src/lib/tokens/_themes.scss +3 -3
  81. package/src/lib/tokens/_utilities.scss +5 -1
  82. package/types/masmarino-gabarit.d.ts +1 -1
@@ -167,7 +167,7 @@ var TagInput = class TagInput {
167
167
  }],
168
168
  ngImport: i0,
169
169
  template: "<div class=\"gbt-tag-input\">\n @if (label()) {\n <label [for]=\"id()\" class=\"gbt-tag-input__label\">{{ label() }}</label>\n }\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"gbt-tag-input__field\"\n [class.gbt-tag-input__field--disabled]=\"isDisabled()\"\n (click)=\"focusInput()\"\n >\n @for (tag of tags(); track tag; let i = $index) {\n <gbt-tag\n [color]=\"color()\"\n [removable]=\"!isDisabled()\"\n [disabled]=\"isDisabled()\"\n [removeLabel]=\"removeLabel()(tag)\"\n (removed)=\"removeTagAt(i)\"\n >\n {{ tag }}\n </gbt-tag>\n }\n <input\n #input\n type=\"text\"\n [id]=\"id()\"\n class=\"gbt-tag-input__input\"\n [placeholder]=\"tags().length === 0 ? placeholder() : ''\"\n [disabled]=\"isDisabled()\"\n [value]=\"draft()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"onInputKeydown($event)\"\n (blur)=\"onBlur()\"\n />\n </div>\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-tag-input__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
170
- styles: [".gbt-tag-input{display:flex;flex-direction:column;gap:.375rem}.gbt-tag-input__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-tag-input__field{box-sizing:border-box;display:flex;flex-wrap:wrap;align-items:center;gap:.375rem;min-height:var(--gbt-control-height-md);padding:6px 8px;border-radius:calc(var(--gbt-control-height-md) / 2);background:var(--gbt-field-ground, var(--gbt-glass-thin));border:1px solid var(--gbt-field-border, transparent);box-shadow:var(--gbt-field-hollow, inset 0 1px 3px var(--gbt-glass-hollow), inset 0 -1px 0 var(--gbt-glass-rim-bottom))}@media(prefers-contrast:more){.gbt-tag-input__field{border-color:var(--gbt-field-border, var(--border-color))}}.gbt-tag-input__field{cursor:text}.gbt-tag-input__field:hover:not(:focus-within):not(.gbt-tag-input__field--disabled){background:var(--gbt-field-ground, var(--gbt-glass-regular))}.gbt-tag-input__field:focus-within{border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-tag-input__field--disabled{cursor:not-allowed;opacity:.5}.gbt-tag-input__input{flex:1;min-width:80px;padding:2px 0;background:none;border:none;color:var(--text-primary);font-size:14px}.gbt-tag-input__input:focus{outline:none}.gbt-tag-input__input:disabled{cursor:not-allowed}.gbt-tag-input__error{margin:0;font-size:.75rem;color:var(--color-error-text)}\n"],
170
+ styles: [".gbt-tag-input{display:flex;flex-direction:column;gap:.375rem}.gbt-tag-input__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-tag-input__field{box-sizing:border-box;display:flex;flex-wrap:wrap;align-items:center;gap:.375rem;min-height:var(--gbt-control-height-md);padding:6px 8px;border-radius:calc(var(--gbt-control-height-md) / 2);background:var(--gbt-field-ground, var(--gbt-glass-thin));border:1px solid var(--gbt-field-border, transparent);box-shadow:var(--gbt-field-hollow, inset 0 1px 2px var(--gbt-nested-hollow-shade, transparent), inset 0 0 0 1px var(--gbt-nested-hollow-trace, transparent), inset 0 -1px 0 var(--gbt-nested-hollow-light, transparent), inset 0 1px 3px var(--gbt-glass-hollow), inset 0 -1px 0 var(--gbt-glass-rim-bottom))}@media(prefers-contrast:more){.gbt-tag-input__field{border-color:var(--gbt-field-border, var(--border-color))}}.gbt-tag-input__field{cursor:text}.gbt-tag-input__field:hover:not(:focus-within):not(.gbt-tag-input__field--disabled){background:var(--gbt-field-ground, var(--gbt-glass-regular))}.gbt-tag-input__field:focus-within{border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-tag-input__field--disabled{cursor:not-allowed;opacity:.5}.gbt-tag-input__input{flex:1;min-width:80px;padding:2px 0;background:none;border:none;color:var(--text-primary);font-size:14px}.gbt-tag-input__input:focus{outline:none}.gbt-tag-input__input:disabled{cursor:not-allowed}.gbt-tag-input__error{margin:0;font-size:.75rem;color:var(--color-error-text)}\n"],
171
171
  dependencies: [{
172
172
  kind: "component",
173
173
  type: Tag,
@@ -201,7 +201,7 @@ i0.ɵɵngDeclareClassMetadata({
201
201
  multi: true
202
202
  }],
203
203
  template: "<div class=\"gbt-tag-input\">\n @if (label()) {\n <label [for]=\"id()\" class=\"gbt-tag-input__label\">{{ label() }}</label>\n }\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"gbt-tag-input__field\"\n [class.gbt-tag-input__field--disabled]=\"isDisabled()\"\n (click)=\"focusInput()\"\n >\n @for (tag of tags(); track tag; let i = $index) {\n <gbt-tag\n [color]=\"color()\"\n [removable]=\"!isDisabled()\"\n [disabled]=\"isDisabled()\"\n [removeLabel]=\"removeLabel()(tag)\"\n (removed)=\"removeTagAt(i)\"\n >\n {{ tag }}\n </gbt-tag>\n }\n <input\n #input\n type=\"text\"\n [id]=\"id()\"\n class=\"gbt-tag-input__input\"\n [placeholder]=\"tags().length === 0 ? placeholder() : ''\"\n [disabled]=\"isDisabled()\"\n [value]=\"draft()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"onInputKeydown($event)\"\n (blur)=\"onBlur()\"\n />\n </div>\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-tag-input__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
204
- styles: [".gbt-tag-input{display:flex;flex-direction:column;gap:.375rem}.gbt-tag-input__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-tag-input__field{box-sizing:border-box;display:flex;flex-wrap:wrap;align-items:center;gap:.375rem;min-height:var(--gbt-control-height-md);padding:6px 8px;border-radius:calc(var(--gbt-control-height-md) / 2);background:var(--gbt-field-ground, var(--gbt-glass-thin));border:1px solid var(--gbt-field-border, transparent);box-shadow:var(--gbt-field-hollow, inset 0 1px 3px var(--gbt-glass-hollow), inset 0 -1px 0 var(--gbt-glass-rim-bottom))}@media(prefers-contrast:more){.gbt-tag-input__field{border-color:var(--gbt-field-border, var(--border-color))}}.gbt-tag-input__field{cursor:text}.gbt-tag-input__field:hover:not(:focus-within):not(.gbt-tag-input__field--disabled){background:var(--gbt-field-ground, var(--gbt-glass-regular))}.gbt-tag-input__field:focus-within{border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-tag-input__field--disabled{cursor:not-allowed;opacity:.5}.gbt-tag-input__input{flex:1;min-width:80px;padding:2px 0;background:none;border:none;color:var(--text-primary);font-size:14px}.gbt-tag-input__input:focus{outline:none}.gbt-tag-input__input:disabled{cursor:not-allowed}.gbt-tag-input__error{margin:0;font-size:.75rem;color:var(--color-error-text)}\n"]
204
+ styles: [".gbt-tag-input{display:flex;flex-direction:column;gap:.375rem}.gbt-tag-input__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-tag-input__field{box-sizing:border-box;display:flex;flex-wrap:wrap;align-items:center;gap:.375rem;min-height:var(--gbt-control-height-md);padding:6px 8px;border-radius:calc(var(--gbt-control-height-md) / 2);background:var(--gbt-field-ground, var(--gbt-glass-thin));border:1px solid var(--gbt-field-border, transparent);box-shadow:var(--gbt-field-hollow, inset 0 1px 2px var(--gbt-nested-hollow-shade, transparent), inset 0 0 0 1px var(--gbt-nested-hollow-trace, transparent), inset 0 -1px 0 var(--gbt-nested-hollow-light, transparent), inset 0 1px 3px var(--gbt-glass-hollow), inset 0 -1px 0 var(--gbt-glass-rim-bottom))}@media(prefers-contrast:more){.gbt-tag-input__field{border-color:var(--gbt-field-border, var(--border-color))}}.gbt-tag-input__field{cursor:text}.gbt-tag-input__field:hover:not(:focus-within):not(.gbt-tag-input__field--disabled){background:var(--gbt-field-ground, var(--gbt-glass-regular))}.gbt-tag-input__field:focus-within{border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-tag-input__field--disabled{cursor:not-allowed;opacity:.5}.gbt-tag-input__input{flex:1;min-width:80px;padding:2px 0;background:none;border:none;color:var(--text-primary);font-size:14px}.gbt-tag-input__input:focus{outline:none}.gbt-tag-input__input:disabled{cursor:not-allowed}.gbt-tag-input__error{margin:0;font-size:.75rem;color:var(--color-error-text)}\n"]
205
205
  }]
206
206
  }],
207
207
  propDecorators: {
@@ -1 +1 @@
1
- {"version":3,"file":"masmarino-gabarit-tag-input.mjs","names":[],"sources":["../../../projects/gabarit/tag-input/tag-input.ts","../../../projects/gabarit/tag-input/tag-input.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n signal,\n viewChild,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { Tag } from '@masmarino/gabarit/tag'\n\nlet nextId = 0\n\n@Component({\n selector: 'gbt-tag-input',\n standalone: true,\n imports: [Tag],\n templateUrl: './tag-input.html',\n styleUrl: './tag-input.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TagInput),\n multi: true,\n },\n ],\n})\nexport class TagInput implements ControlValueAccessor {\n private readonly inputRef = viewChild<ElementRef<HTMLInputElement>>('input')\n\n id = input<string>(`gbt-tag-input-${++nextId}`)\n label = input<string>('')\n placeholder = input<string>('')\n disabled = input(false, { transform: booleanAttribute })\n errorMessage = input<string | null>(null)\n separatorKeys = input<string[]>(['Enter', ','])\n allowDuplicates = input(false, { transform: booleanAttribute })\n color = input<string>('#6b7280')\n removeLabel = input<(value: string) => string>((value) => `Remove ${value}`)\n\n protected readonly tags = signal<string[]>([])\n protected readonly draft = signal('')\n\n private readonly formDisabled = signal(false)\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n private onChange: (value: string[]) => void = () => {}\n private onTouched: () => void = () => {}\n\n writeValue(value: string[] | null): void {\n this.tags.set(value ?? [])\n }\n\n registerOnChange(fn: (value: string[]) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n protected focusInput(): void {\n if (!this.isDisabled()) {\n this.inputRef()?.nativeElement.focus()\n }\n }\n\n protected onInputChange(event: Event): void {\n this.draft.set((event.target as HTMLInputElement).value)\n }\n\n protected onInputKeydown(event: KeyboardEvent): void {\n if (this.separatorKeys().includes(event.key)) {\n event.preventDefault()\n this.commitDraft()\n return\n }\n if (event.key === 'Backspace' && this.draft() === '' && this.tags().length > 0) {\n event.preventDefault()\n this.removeTagAt(this.tags().length - 1)\n }\n }\n\n protected onBlur(): void {\n this.commitDraft()\n this.onTouched()\n }\n\n protected removeTagAt(index: number): void {\n if (this.isDisabled()) {\n return\n }\n const next = this.tags().filter((_, i) => i !== index)\n this.tags.set(next)\n this.onChange(next)\n }\n\n private commitDraft(): void {\n const value = this.draft().trim()\n this.draft.set('')\n if (!value || this.isDisabled()) {\n return\n }\n if (!this.allowDuplicates() && this.tags().includes(value)) {\n return\n }\n const next = [...this.tags(), value]\n this.tags.set(next)\n this.onChange(next)\n }\n}\n","<div class=\"gbt-tag-input\">\n @if (label()) {\n <label [for]=\"id()\" class=\"gbt-tag-input__label\">{{ label() }}</label>\n }\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"gbt-tag-input__field\"\n [class.gbt-tag-input__field--disabled]=\"isDisabled()\"\n (click)=\"focusInput()\"\n >\n @for (tag of tags(); track tag; let i = $index) {\n <gbt-tag\n [color]=\"color()\"\n [removable]=\"!isDisabled()\"\n [disabled]=\"isDisabled()\"\n [removeLabel]=\"removeLabel()(tag)\"\n (removed)=\"removeTagAt(i)\"\n >\n {{ tag }}\n </gbt-tag>\n }\n <input\n #input\n type=\"text\"\n [id]=\"id()\"\n class=\"gbt-tag-input__input\"\n [placeholder]=\"tags().length === 0 ? placeholder() : ''\"\n [disabled]=\"isDisabled()\"\n [value]=\"draft()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"onInputKeydown($event)\"\n (blur)=\"onBlur()\"\n />\n </div>\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-tag-input__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n"],"mappings":";;;;AAcA,IAAI,SAAS;AAiBb,IAAa,WAAb,MAAa,SAAQ;CACF,WAAW,UAAwC,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAE5E,KAAK,MAAc,iBAAiB,EAAE,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAC/C,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,cAAc,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACrD,eAAe,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CACzC,gBAAgB,MAAgB,CAAC,SAAS,GAAG,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;CAC/C,kBAAkB,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,kBAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAC5D,QAAQ,MAAc,WAAU,GAAA,YAAA,CAAA,EAAA,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,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,aAAA,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,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,iBAAA,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,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"masmarino-gabarit-tag-input.mjs","names":[],"sources":["../../../projects/gabarit/tag-input/tag-input.ts","../../../projects/gabarit/tag-input/tag-input.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n signal,\n viewChild,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { Tag } from '@masmarino/gabarit/tag'\n\nlet nextId = 0\n\n@Component({\n selector: 'gbt-tag-input',\n standalone: true,\n imports: [Tag],\n templateUrl: './tag-input.html',\n styleUrl: './tag-input.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TagInput),\n multi: true,\n },\n ],\n})\nexport class TagInput implements ControlValueAccessor {\n private readonly inputRef = viewChild<ElementRef<HTMLInputElement>>('input')\n\n id = input<string>(`gbt-tag-input-${++nextId}`)\n label = input<string>('')\n placeholder = input<string>('')\n disabled = input(false, { transform: booleanAttribute })\n errorMessage = input<string | null>(null)\n separatorKeys = input<string[]>(['Enter', ','])\n allowDuplicates = input(false, { transform: booleanAttribute })\n color = input<string>('#6b7280')\n removeLabel = input<(value: string) => string>((value) => `Remove ${value}`)\n\n protected readonly tags = signal<string[]>([])\n protected readonly draft = signal('')\n\n private readonly formDisabled = signal(false)\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n private onChange: (value: string[]) => void = () => {}\n private onTouched: () => void = () => {}\n\n writeValue(value: string[] | null): void {\n this.tags.set(value ?? [])\n }\n\n registerOnChange(fn: (value: string[]) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n protected focusInput(): void {\n if (!this.isDisabled()) {\n this.inputRef()?.nativeElement.focus()\n }\n }\n\n protected onInputChange(event: Event): void {\n this.draft.set((event.target as HTMLInputElement).value)\n }\n\n protected onInputKeydown(event: KeyboardEvent): void {\n if (this.separatorKeys().includes(event.key)) {\n event.preventDefault()\n this.commitDraft()\n return\n }\n if (event.key === 'Backspace' && this.draft() === '' && this.tags().length > 0) {\n event.preventDefault()\n this.removeTagAt(this.tags().length - 1)\n }\n }\n\n protected onBlur(): void {\n this.commitDraft()\n this.onTouched()\n }\n\n protected removeTagAt(index: number): void {\n if (this.isDisabled()) {\n return\n }\n const next = this.tags().filter((_, i) => i !== index)\n this.tags.set(next)\n this.onChange(next)\n }\n\n private commitDraft(): void {\n const value = this.draft().trim()\n this.draft.set('')\n if (!value || this.isDisabled()) {\n return\n }\n if (!this.allowDuplicates() && this.tags().includes(value)) {\n return\n }\n const next = [...this.tags(), value]\n this.tags.set(next)\n this.onChange(next)\n }\n}\n","<div class=\"gbt-tag-input\">\n @if (label()) {\n <label [for]=\"id()\" class=\"gbt-tag-input__label\">{{ label() }}</label>\n }\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"gbt-tag-input__field\"\n [class.gbt-tag-input__field--disabled]=\"isDisabled()\"\n (click)=\"focusInput()\"\n >\n @for (tag of tags(); track tag; let i = $index) {\n <gbt-tag\n [color]=\"color()\"\n [removable]=\"!isDisabled()\"\n [disabled]=\"isDisabled()\"\n [removeLabel]=\"removeLabel()(tag)\"\n (removed)=\"removeTagAt(i)\"\n >\n {{ tag }}\n </gbt-tag>\n }\n <input\n #input\n type=\"text\"\n [id]=\"id()\"\n class=\"gbt-tag-input__input\"\n [placeholder]=\"tags().length === 0 ? placeholder() : ''\"\n [disabled]=\"isDisabled()\"\n [value]=\"draft()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"onInputKeydown($event)\"\n (blur)=\"onBlur()\"\n />\n </div>\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-tag-input__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n"],"mappings":";;;;AAcA,IAAI,SAAS;AAiBb,IAAa,WAAb,MAAa,SAAQ;CACF,WAAW,UAAwC,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAE5E,KAAK,M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,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,iBAAA,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,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -223,7 +223,7 @@ var Textarea = class Textarea {
223
223
  }],
224
224
  ngImport: i0,
225
225
  template: "<div\n class=\"gbt-textarea\"\n [class.gbt-textarea--mono]=\"mono()\"\n [class.gbt-textarea--autosize]=\"autosize()\"\n>\n @if (label()) {\n <label [for]=\"id()\" [class.gbt-textarea__label--hidden]=\"hideLabel()\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n <textarea\n #field\n [id]=\"id()\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [disabled]=\"isDisabled()\"\n [rows]=\"rows()\"\n [value]=\"value()\"\n [attr.data-resize]=\"effectiveResize()\"\n [style.--gbt-textarea-max-rows]=\"maxRowsProperty()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n ></textarea>\n @if (showHint()) {\n <p [id]=\"hintId()\" class=\"gbt-textarea__hint\">{{ hint() }}</p>\n }\n @if (errorMessage()) {\n <p [id]=\"errorId()\" class=\"gbt-textarea__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
226
- styles: [":host{display:block}.gbt-textarea{display:flex;flex-direction:column;gap:.375rem}.gbt-textarea label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-textarea textarea{box-sizing:border-box;width:100%;padding:.5rem var(--gbt-field-padding, .75rem);font-family:var(--font-family);font-size:.875rem;color:var(--text-primary);border-radius:var(--gbt-radius-row);background:var(--gbt-field-ground, var(--gbt-glass-thin));border:1px solid var(--gbt-field-border, transparent);box-shadow:var(--gbt-field-hollow, inset 0 1px 3px var(--gbt-glass-hollow), inset 0 -1px 0 var(--gbt-glass-rim-bottom))}@media(prefers-contrast:more){.gbt-textarea textarea{border-color:var(--gbt-field-border, var(--border-color))}}.gbt-textarea textarea{resize:vertical;transition:border-color var(--site-transition-fast)}.gbt-textarea textarea:hover:not(:disabled):not(:focus){background:var(--gbt-field-ground, var(--gbt-glass-regular))}.gbt-textarea textarea:focus{outline:none;border-color:var(--primary)}.gbt-textarea textarea:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:1px}.gbt-textarea textarea[data-resize=none]{resize:none}.gbt-textarea textarea[data-resize=both]{resize:both}.gbt-textarea textarea[data-resize=horizontal]{resize:horizontal}.gbt-textarea textarea:disabled{background:var(--bg-panel);cursor:not-allowed;resize:none}.gbt-textarea--autosize textarea{overflow-y:auto;max-height:calc(var(--gbt-textarea-max-rows) * 1lh + 1rem + 2px)}.gbt-textarea--mono textarea{font-family:var(--gbt-font-mono, \"IBM Plex Mono\", ui-monospace, \"SF Mono\", Menlo, Consolas, monospace);font-size:.8125rem}.gbt-textarea__label--hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.gbt-textarea__hint{margin:0;font-size:.75rem;color:var(--text-secondary)}.gbt-textarea__error{margin:0;font-size:.75rem;color:var(--color-error-text)}@media(prefers-reduced-motion:reduce){.gbt-textarea textarea{transition:none}}\n"],
226
+ styles: [":host{display:block}.gbt-textarea{display:flex;flex-direction:column;gap:.375rem}.gbt-textarea label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-textarea textarea{box-sizing:border-box;width:100%;padding:.5rem var(--gbt-field-padding, .75rem);font-family:var(--font-family);font-size:.875rem;color:var(--text-primary);border-radius:var(--gbt-radius-row);background:var(--gbt-field-ground, var(--gbt-glass-thin));border:1px solid var(--gbt-field-border, transparent);box-shadow:var(--gbt-field-hollow, inset 0 1px 2px var(--gbt-nested-hollow-shade, transparent), inset 0 0 0 1px var(--gbt-nested-hollow-trace, transparent), inset 0 -1px 0 var(--gbt-nested-hollow-light, transparent), inset 0 1px 3px var(--gbt-glass-hollow), inset 0 -1px 0 var(--gbt-glass-rim-bottom))}@media(prefers-contrast:more){.gbt-textarea textarea{border-color:var(--gbt-field-border, var(--border-color))}}.gbt-textarea textarea{resize:vertical;transition:border-color var(--site-transition-fast)}.gbt-textarea textarea:hover:not(:disabled):not(:focus){background:var(--gbt-field-ground, var(--gbt-glass-regular))}.gbt-textarea textarea:focus{outline:none;border-color:var(--primary)}.gbt-textarea textarea:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:1px}.gbt-textarea textarea[data-resize=none]{resize:none}.gbt-textarea textarea[data-resize=both]{resize:both}.gbt-textarea textarea[data-resize=horizontal]{resize:horizontal}.gbt-textarea textarea:disabled{background:var(--bg-panel);cursor:not-allowed;resize:none}.gbt-textarea--autosize textarea{overflow-y:auto;max-height:calc(var(--gbt-textarea-max-rows) * 1lh + 1rem + 2px)}.gbt-textarea--mono textarea{font-family:var(--gbt-font-mono, \"IBM Plex Mono\", ui-monospace, \"SF Mono\", Menlo, Consolas, monospace);font-size:.8125rem}.gbt-textarea__label--hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.gbt-textarea__hint{margin:0;font-size:.75rem;color:var(--text-secondary)}.gbt-textarea__error{margin:0;font-size:.75rem;color:var(--color-error-text)}@media(prefers-reduced-motion:reduce){.gbt-textarea textarea{transition:none}}\n"],
227
227
  changeDetection: i0.ChangeDetectionStrategy.OnPush
228
228
  });
229
229
  };
@@ -245,7 +245,7 @@ i0.ɵɵngDeclareClassMetadata({
245
245
  multi: true
246
246
  }],
247
247
  template: "<div\n class=\"gbt-textarea\"\n [class.gbt-textarea--mono]=\"mono()\"\n [class.gbt-textarea--autosize]=\"autosize()\"\n>\n @if (label()) {\n <label [for]=\"id()\" [class.gbt-textarea__label--hidden]=\"hideLabel()\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n <textarea\n #field\n [id]=\"id()\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [disabled]=\"isDisabled()\"\n [rows]=\"rows()\"\n [value]=\"value()\"\n [attr.data-resize]=\"effectiveResize()\"\n [style.--gbt-textarea-max-rows]=\"maxRowsProperty()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n ></textarea>\n @if (showHint()) {\n <p [id]=\"hintId()\" class=\"gbt-textarea__hint\">{{ hint() }}</p>\n }\n @if (errorMessage()) {\n <p [id]=\"errorId()\" class=\"gbt-textarea__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
248
- styles: [":host{display:block}.gbt-textarea{display:flex;flex-direction:column;gap:.375rem}.gbt-textarea label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-textarea textarea{box-sizing:border-box;width:100%;padding:.5rem var(--gbt-field-padding, .75rem);font-family:var(--font-family);font-size:.875rem;color:var(--text-primary);border-radius:var(--gbt-radius-row);background:var(--gbt-field-ground, var(--gbt-glass-thin));border:1px solid var(--gbt-field-border, transparent);box-shadow:var(--gbt-field-hollow, inset 0 1px 3px var(--gbt-glass-hollow), inset 0 -1px 0 var(--gbt-glass-rim-bottom))}@media(prefers-contrast:more){.gbt-textarea textarea{border-color:var(--gbt-field-border, var(--border-color))}}.gbt-textarea textarea{resize:vertical;transition:border-color var(--site-transition-fast)}.gbt-textarea textarea:hover:not(:disabled):not(:focus){background:var(--gbt-field-ground, var(--gbt-glass-regular))}.gbt-textarea textarea:focus{outline:none;border-color:var(--primary)}.gbt-textarea textarea:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:1px}.gbt-textarea textarea[data-resize=none]{resize:none}.gbt-textarea textarea[data-resize=both]{resize:both}.gbt-textarea textarea[data-resize=horizontal]{resize:horizontal}.gbt-textarea textarea:disabled{background:var(--bg-panel);cursor:not-allowed;resize:none}.gbt-textarea--autosize textarea{overflow-y:auto;max-height:calc(var(--gbt-textarea-max-rows) * 1lh + 1rem + 2px)}.gbt-textarea--mono textarea{font-family:var(--gbt-font-mono, \"IBM Plex Mono\", ui-monospace, \"SF Mono\", Menlo, Consolas, monospace);font-size:.8125rem}.gbt-textarea__label--hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.gbt-textarea__hint{margin:0;font-size:.75rem;color:var(--text-secondary)}.gbt-textarea__error{margin:0;font-size:.75rem;color:var(--color-error-text)}@media(prefers-reduced-motion:reduce){.gbt-textarea textarea{transition:none}}\n"]
248
+ styles: [":host{display:block}.gbt-textarea{display:flex;flex-direction:column;gap:.375rem}.gbt-textarea label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-textarea textarea{box-sizing:border-box;width:100%;padding:.5rem var(--gbt-field-padding, .75rem);font-family:var(--font-family);font-size:.875rem;color:var(--text-primary);border-radius:var(--gbt-radius-row);background:var(--gbt-field-ground, var(--gbt-glass-thin));border:1px solid var(--gbt-field-border, transparent);box-shadow:var(--gbt-field-hollow, inset 0 1px 2px var(--gbt-nested-hollow-shade, transparent), inset 0 0 0 1px var(--gbt-nested-hollow-trace, transparent), inset 0 -1px 0 var(--gbt-nested-hollow-light, transparent), inset 0 1px 3px var(--gbt-glass-hollow), inset 0 -1px 0 var(--gbt-glass-rim-bottom))}@media(prefers-contrast:more){.gbt-textarea textarea{border-color:var(--gbt-field-border, var(--border-color))}}.gbt-textarea textarea{resize:vertical;transition:border-color var(--site-transition-fast)}.gbt-textarea textarea:hover:not(:disabled):not(:focus){background:var(--gbt-field-ground, var(--gbt-glass-regular))}.gbt-textarea textarea:focus{outline:none;border-color:var(--primary)}.gbt-textarea textarea:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:1px}.gbt-textarea textarea[data-resize=none]{resize:none}.gbt-textarea textarea[data-resize=both]{resize:both}.gbt-textarea textarea[data-resize=horizontal]{resize:horizontal}.gbt-textarea textarea:disabled{background:var(--bg-panel);cursor:not-allowed;resize:none}.gbt-textarea--autosize textarea{overflow-y:auto;max-height:calc(var(--gbt-textarea-max-rows) * 1lh + 1rem + 2px)}.gbt-textarea--mono textarea{font-family:var(--gbt-font-mono, \"IBM Plex Mono\", ui-monospace, \"SF Mono\", Menlo, Consolas, monospace);font-size:.8125rem}.gbt-textarea__label--hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.gbt-textarea__hint{margin:0;font-size:.75rem;color:var(--text-secondary)}.gbt-textarea__error{margin:0;font-size:.75rem;color:var(--color-error-text)}@media(prefers-reduced-motion:reduce){.gbt-textarea textarea{transition:none}}\n"]
249
249
  }]
250
250
  }],
251
251
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"masmarino-gabarit-textarea.mjs","names":[],"sources":["../../../projects/gabarit/textarea/textarea.ts","../../../projects/gabarit/textarea/textarea.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n afterRenderEffect,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nlet nextId = 0\n\nexport type TextareaResize = 'vertical' | 'none' | 'both' | 'horizontal'\n\n@Component({\n selector: 'gbt-textarea',\n standalone: true,\n imports: [],\n templateUrl: './textarea.html',\n styleUrl: './textarea.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Textarea),\n multi: true,\n },\n ],\n})\nexport class Textarea implements ControlValueAccessor {\n id = input<string>(`gbt-textarea-${++nextId}`)\n label = input<string>('')\n required = input(false, { transform: booleanAttribute })\n disabled = input(false, { transform: booleanAttribute })\n placeholder = input<string>('')\n errorMessage = input<string | null>(null)\n rows = input(3)\n\n hint = input<string>('')\n hideLabel = input(false, { transform: booleanAttribute })\n mono = input(false, { transform: booleanAttribute })\n autosize = input(false, { transform: booleanAttribute })\n maxRows = input<number | null>(null)\n resize = input<TextareaResize>('vertical')\n\n committed = output<string>()\n\n protected readonly value = signal('')\n\n private readonly field = viewChild.required<ElementRef<HTMLTextAreaElement>>('field')\n\n protected readonly hintId = computed(() => `${this.id()}-hint`)\n protected readonly errorId = computed(() => `${this.id()}-error`)\n protected readonly showHint = computed(() => !!this.hint() && !this.errorMessage())\n protected readonly describedBy = computed(() => {\n if (this.errorMessage()) {\n return this.errorId()\n }\n return this.showHint() ? this.hintId() : null\n })\n protected readonly effectiveResize = computed(() => (this.autosize() ? 'none' : this.resize()))\n protected readonly maxRowsProperty = computed(() => (this.autosize() ? this.maxRows() : null))\n\n private readonly formDisabled = signal(false)\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n constructor() {\n const host: HTMLElement = inject(ElementRef).nativeElement\n\n let wasAutosize = false\n afterRenderEffect(() => {\n const textarea = this.field().nativeElement\n this.value()\n this.rows()\n if (this.autosize()) {\n this.fitToContent(textarea)\n wasAutosize = true\n } else if (wasAutosize) {\n textarea.style.height = ''\n wasAutosize = false\n }\n })\n\n afterRenderEffect((onCleanup) => {\n if (!this.autosize() || typeof ResizeObserver === 'undefined') {\n return\n }\n let lastWidth = host.clientWidth\n const observer = new ResizeObserver(() => {\n if (host.clientWidth !== lastWidth) {\n lastWidth = host.clientWidth\n this.fitToContent(this.field().nativeElement)\n }\n })\n observer.observe(host)\n onCleanup(() => observer.disconnect())\n })\n }\n\n private fitToContent(textarea: HTMLTextAreaElement): void {\n textarea.style.height = 'auto'\n const borders = textarea.offsetHeight - textarea.clientHeight\n textarea.style.height = `${Math.ceil(textarea.scrollHeight + borders)}px`\n }\n\n private onChange: (value: string) => void = () => {}\n private onTouched: () => void = () => {}\n\n writeValue(value: string): void {\n this.value.set(value ?? '')\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n protected onInput(event: Event): void {\n const value = (event.target as HTMLTextAreaElement).value\n this.value.set(value)\n this.onChange(value)\n }\n\n protected onBlur(): void {\n this.onTouched()\n this.committed.emit(this.value())\n }\n}\n","<div\n class=\"gbt-textarea\"\n [class.gbt-textarea--mono]=\"mono()\"\n [class.gbt-textarea--autosize]=\"autosize()\"\n>\n @if (label()) {\n <label [for]=\"id()\" [class.gbt-textarea__label--hidden]=\"hideLabel()\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n <textarea\n #field\n [id]=\"id()\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [disabled]=\"isDisabled()\"\n [rows]=\"rows()\"\n [value]=\"value()\"\n [attr.data-resize]=\"effectiveResize()\"\n [style.--gbt-textarea-max-rows]=\"maxRowsProperty()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n ></textarea>\n @if (showHint()) {\n <p [id]=\"hintId()\" class=\"gbt-textarea__hint\">{{ hint() }}</p>\n }\n @if (errorMessage()) {\n <p [id]=\"errorId()\" class=\"gbt-textarea__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n"],"mappings":";;;AAgBA,IAAI,SAAS;AAmBb,I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sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n afterRenderEffect,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nlet nextId = 0\n\nexport type TextareaResize = 'vertical' | 'none' | 'both' | 'horizontal'\n\n@Component({\n selector: 'gbt-textarea',\n standalone: true,\n imports: [],\n templateUrl: './textarea.html',\n styleUrl: './textarea.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Textarea),\n multi: true,\n },\n ],\n})\nexport class Textarea implements ControlValueAccessor {\n id = input<string>(`gbt-textarea-${++nextId}`)\n label = input<string>('')\n required = input(false, { transform: booleanAttribute })\n disabled = input(false, { transform: booleanAttribute })\n placeholder = input<string>('')\n errorMessage = input<string | null>(null)\n rows = input(3)\n\n hint = input<string>('')\n hideLabel = input(false, { transform: booleanAttribute })\n mono = input(false, { transform: booleanAttribute })\n autosize = input(false, { transform: booleanAttribute })\n maxRows = input<number | null>(null)\n resize = input<TextareaResize>('vertical')\n\n committed = output<string>()\n\n protected readonly value = signal('')\n\n private readonly field = viewChild.required<ElementRef<HTMLTextAreaElement>>('field')\n\n protected readonly hintId = computed(() => `${this.id()}-hint`)\n protected readonly errorId = computed(() => `${this.id()}-error`)\n protected readonly showHint = computed(() => !!this.hint() && !this.errorMessage())\n protected readonly describedBy = computed(() => {\n if (this.errorMessage()) {\n return this.errorId()\n }\n return this.showHint() ? this.hintId() : null\n })\n protected readonly effectiveResize = computed(() => (this.autosize() ? 'none' : this.resize()))\n protected readonly maxRowsProperty = computed(() => (this.autosize() ? this.maxRows() : null))\n\n private readonly formDisabled = signal(false)\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled())\n\n constructor() {\n const host: HTMLElement = inject(ElementRef).nativeElement\n\n let wasAutosize = false\n afterRenderEffect(() => {\n const textarea = this.field().nativeElement\n this.value()\n this.rows()\n if (this.autosize()) {\n this.fitToContent(textarea)\n wasAutosize = true\n } else if (wasAutosize) {\n textarea.style.height = ''\n wasAutosize = false\n }\n })\n\n afterRenderEffect((onCleanup) => {\n if (!this.autosize() || typeof ResizeObserver === 'undefined') {\n return\n }\n let lastWidth = host.clientWidth\n const observer = new ResizeObserver(() => {\n if (host.clientWidth !== lastWidth) {\n lastWidth = host.clientWidth\n this.fitToContent(this.field().nativeElement)\n }\n })\n observer.observe(host)\n onCleanup(() => observer.disconnect())\n })\n }\n\n private fitToContent(textarea: HTMLTextAreaElement): void {\n textarea.style.height = 'auto'\n const borders = textarea.offsetHeight - textarea.clientHeight\n textarea.style.height = `${Math.ceil(textarea.scrollHeight + borders)}px`\n }\n\n private onChange: (value: string) => void = () => {}\n private onTouched: () => void = () => {}\n\n writeValue(value: string): void {\n this.value.set(value ?? '')\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled)\n }\n\n protected onInput(event: Event): void {\n const value = (event.target as HTMLTextAreaElement).value\n this.value.set(value)\n this.onChange(value)\n }\n\n protected onBlur(): void {\n this.onTouched()\n this.committed.emit(this.value())\n }\n}\n","<div\n class=\"gbt-textarea\"\n [class.gbt-textarea--mono]=\"mono()\"\n [class.gbt-textarea--autosize]=\"autosize()\"\n>\n @if (label()) {\n <label [for]=\"id()\" [class.gbt-textarea__label--hidden]=\"hideLabel()\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n <textarea\n #field\n [id]=\"id()\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [disabled]=\"isDisabled()\"\n [rows]=\"rows()\"\n [value]=\"value()\"\n [attr.data-resize]=\"effectiveResize()\"\n [style.--gbt-textarea-max-rows]=\"maxRowsProperty()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n ></textarea>\n @if (showHint()) {\n <p [id]=\"hintId()\" class=\"gbt-textarea__hint\">{{ hint() }}</p>\n }\n @if (errorMessage()) {\n <p [id]=\"errorId()\" class=\"gbt-textarea__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n"],"mappings":";;;AAgBA,IAAI,SAAS;AAmBb,IAAa,WAAb,MAAa,SAAQ;CACnB,KAAK,MAAc,gBAAgB,EAAE,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAC9C,QAAQ,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzB,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACrD,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACrD,cAAc,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,eAAe,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CACzC,OAAO,MAAM,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAEf,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,OAAO,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,OAAA,+BAAA,CAAA;EAAI,WAAW;CAAg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AA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -157,7 +157,7 @@ var Toaster = class Toaster {
157
157
  outputs: { dismissed: "dismissed" },
158
158
  ngImport: i0,
159
159
  template: "<div class=\"gbt-toaster\" [attr.data-position]=\"position()\">\n @for (toast of items(); track toast.id) {\n <div\n class=\"gbt-toaster__item\"\n [attr.data-variant]=\"toast.variant\"\n [attr.role]=\"roleFor(toast.variant)\"\n aria-atomic=\"true\"\n >\n <span class=\"gbt-toaster__icon\">\n <gbt-icon [name]=\"iconFor(toast.variant)\" aria-hidden=\"true\" />\n </span>\n <p class=\"gbt-toaster__message\">{{ toast.message }}</p>\n <button\n type=\"button\"\n class=\"gbt-toaster__close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"close(toast.id)\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n </div>\n }\n</div>\n",
160
- styles: [".gbt-toaster{position:fixed;z-index:1300;display:flex;flex-direction:column;gap:.5rem;max-width:min(90vw,360px);pointer-events:none}.gbt-toaster[data-position=top-right]{top:1rem;right:1rem;align-items:flex-end}.gbt-toaster[data-position=top-left]{top:1rem;left:1rem;align-items:flex-start}.gbt-toaster[data-position=top-center]{top:1rem;left:50%;align-items:center;transform:translate(-50%)}.gbt-toaster[data-position=bottom-right]{right:1rem;bottom:1rem;flex-direction:column-reverse;align-items:flex-end}.gbt-toaster[data-position=bottom-left]{bottom:1rem;left:1rem;flex-direction:column-reverse;align-items:flex-start}.gbt-toaster[data-position=bottom-center]{bottom:1rem;left:50%;flex-direction:column-reverse;align-items:center;transform:translate(-50%)}.gbt-toaster__item{box-sizing:border-box;display:flex;align-items:flex-start;gap:.625rem;width:100%;padding:.75rem 1rem;pointer-events:auto;border:none;border-radius:var(--gbt-radius-row);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-toaster__item{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-toaster__item{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-toaster__item{box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-toaster__item{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-toaster__item{animation:gbt-toaster-in var(--site-transition-base)}.gbt-toaster__item[data-variant=success] .gbt-toaster__icon{background:var(--color-success-vivid-base)}.gbt-toaster__item[data-variant=warning] .gbt-toaster__icon{background:var(--color-warning-vivid-base)}.gbt-toaster__item[data-variant=error] .gbt-toaster__icon{background:var(--color-error-vivid-base)}.gbt-toaster__item[data-variant=info] .gbt-toaster__icon{background:var(--color-info-vivid-base)}.gbt-toaster__icon{display:inline-flex;flex:none;align-items:center;justify-content:center;width:1.875rem;height:1.875rem;margin-top:.0625rem;color:var(--text-on-color);border-radius:50%}.gbt-toaster__icon gbt-icon{width:1.125em;height:1.125em}.gbt-toaster__message{flex:1 1 auto;margin:.3125rem 0;color:var(--text-primary);font-size:.875rem;line-height:1.4}.gbt-toaster__close{position:relative;display:inline-flex;flex:none;align-self:flex-start;margin-top:.3125rem;background:none;border:none;border-radius:50%;color:var(--text-secondary);cursor:pointer;transition:color var(--site-transition-fast)}.gbt-toaster__close:hover,.gbt-toaster__close:focus-visible{color:var(--text-primary)}.gbt-toaster__close:active{color:var(--text-secondary)}.gbt-toaster__close:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-toaster__close:before{content:\"\";position:absolute;inset:50% auto auto 50%;width:max(100%,24px);height:max(100%,24px);transform:translate(-50%,-50%)}@keyframes gbt-toaster-in{0%{opacity:0;transform:translateY(4px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.gbt-toaster__item{animation-duration:1ms}.gbt-toaster__close{transition:none}}\n"],
160
+ styles: [".gbt-toaster{position:fixed;z-index:1300;display:flex;flex-direction:column;gap:.5rem;max-width:min(90vw,360px);pointer-events:none}.gbt-toaster[data-position=top-right]{top:1rem;right:1rem;align-items:flex-end}.gbt-toaster[data-position=top-left]{top:1rem;left:1rem;align-items:flex-start}.gbt-toaster[data-position=top-center]{top:1rem;left:50%;align-items:center;transform:translate(-50%)}.gbt-toaster[data-position=bottom-right]{right:1rem;bottom:1rem;flex-direction:column-reverse;align-items:flex-end}.gbt-toaster[data-position=bottom-left]{bottom:1rem;left:1rem;flex-direction:column-reverse;align-items:flex-start}.gbt-toaster[data-position=bottom-center]{bottom:1rem;left:50%;flex-direction:column-reverse;align-items:center;transform:translate(-50%)}.gbt-toaster__item{box-sizing:border-box;display:flex;align-items:flex-start;gap:.625rem;width:100%;padding:.75rem 1rem;pointer-events:auto;border:none;border-radius:var(--gbt-radius-row);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-toaster__item{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-toaster__item{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-toaster__item{--gbt-nested-low: light-dark(color-mix(in srgb, var(--text-primary) 20%, transparent), transparent);--gbt-nested-low-soft: light-dark(color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);--gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);--gbt-nested-hollow-shade: light-dark(color-mix(in srgb, var(--text-primary) 14%, transparent), transparent);--gbt-nested-hollow-trace: light-dark(color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);--gbt-nested-hollow-light: light-dark(#fff, transparent);--gbt-nested-group-low: light-dark(color-mix(in srgb, var(--text-primary) 12%, transparent), transparent);--gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-toaster__item{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-toaster__item{animation:gbt-toaster-in var(--site-transition-base)}.gbt-toaster__item[data-variant=success] .gbt-toaster__icon{background:var(--color-success-vivid-base)}.gbt-toaster__item[data-variant=warning] .gbt-toaster__icon{background:var(--color-warning-vivid-base)}.gbt-toaster__item[data-variant=error] .gbt-toaster__icon{background:var(--color-error-vivid-base)}.gbt-toaster__item[data-variant=info] .gbt-toaster__icon{background:var(--color-info-vivid-base)}.gbt-toaster__icon{display:inline-flex;flex:none;align-items:center;justify-content:center;width:1.875rem;height:1.875rem;margin-top:.0625rem;color:var(--text-on-color);border-radius:50%}.gbt-toaster__icon gbt-icon{width:1.125em;height:1.125em}.gbt-toaster__message{flex:1 1 auto;margin:.3125rem 0;color:var(--text-primary);font-size:.875rem;line-height:1.4}.gbt-toaster__close{position:relative;display:inline-flex;flex:none;align-self:flex-start;margin-top:.3125rem;background:none;border:none;border-radius:50%;color:var(--text-secondary);cursor:pointer;transition:color var(--site-transition-fast)}.gbt-toaster__close:hover,.gbt-toaster__close:focus-visible{color:var(--text-primary)}.gbt-toaster__close:active{color:var(--text-secondary)}.gbt-toaster__close:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-toaster__close:before{content:\"\";position:absolute;inset:50% auto auto 50%;width:max(100%,24px);height:max(100%,24px);transform:translate(-50%,-50%)}@keyframes gbt-toaster-in{0%{opacity:0;transform:translateY(4px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.gbt-toaster__item{animation-duration:1ms}.gbt-toaster__close{transition:none}}\n"],
161
161
  dependencies: [{
162
162
  kind: "component",
163
163
  type: Icon,
@@ -180,7 +180,7 @@ i0.ɵɵngDeclareClassMetadata({
180
180
  imports: [Icon],
181
181
  changeDetection: ChangeDetectionStrategy.OnPush,
182
182
  template: "<div class=\"gbt-toaster\" [attr.data-position]=\"position()\">\n @for (toast of items(); track toast.id) {\n <div\n class=\"gbt-toaster__item\"\n [attr.data-variant]=\"toast.variant\"\n [attr.role]=\"roleFor(toast.variant)\"\n aria-atomic=\"true\"\n >\n <span class=\"gbt-toaster__icon\">\n <gbt-icon [name]=\"iconFor(toast.variant)\" aria-hidden=\"true\" />\n </span>\n <p class=\"gbt-toaster__message\">{{ toast.message }}</p>\n <button\n type=\"button\"\n class=\"gbt-toaster__close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"close(toast.id)\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n </div>\n }\n</div>\n",
183
- styles: [".gbt-toaster{position:fixed;z-index:1300;display:flex;flex-direction:column;gap:.5rem;max-width:min(90vw,360px);pointer-events:none}.gbt-toaster[data-position=top-right]{top:1rem;right:1rem;align-items:flex-end}.gbt-toaster[data-position=top-left]{top:1rem;left:1rem;align-items:flex-start}.gbt-toaster[data-position=top-center]{top:1rem;left:50%;align-items:center;transform:translate(-50%)}.gbt-toaster[data-position=bottom-right]{right:1rem;bottom:1rem;flex-direction:column-reverse;align-items:flex-end}.gbt-toaster[data-position=bottom-left]{bottom:1rem;left:1rem;flex-direction:column-reverse;align-items:flex-start}.gbt-toaster[data-position=bottom-center]{bottom:1rem;left:50%;flex-direction:column-reverse;align-items:center;transform:translate(-50%)}.gbt-toaster__item{box-sizing:border-box;display:flex;align-items:flex-start;gap:.625rem;width:100%;padding:.75rem 1rem;pointer-events:auto;border:none;border-radius:var(--gbt-radius-row);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-toaster__item{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-toaster__item{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-toaster__item{box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-toaster__item{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-toaster__item{animation:gbt-toaster-in var(--site-transition-base)}.gbt-toaster__item[data-variant=success] .gbt-toaster__icon{background:var(--color-success-vivid-base)}.gbt-toaster__item[data-variant=warning] .gbt-toaster__icon{background:var(--color-warning-vivid-base)}.gbt-toaster__item[data-variant=error] .gbt-toaster__icon{background:var(--color-error-vivid-base)}.gbt-toaster__item[data-variant=info] .gbt-toaster__icon{background:var(--color-info-vivid-base)}.gbt-toaster__icon{display:inline-flex;flex:none;align-items:center;justify-content:center;width:1.875rem;height:1.875rem;margin-top:.0625rem;color:var(--text-on-color);border-radius:50%}.gbt-toaster__icon gbt-icon{width:1.125em;height:1.125em}.gbt-toaster__message{flex:1 1 auto;margin:.3125rem 0;color:var(--text-primary);font-size:.875rem;line-height:1.4}.gbt-toaster__close{position:relative;display:inline-flex;flex:none;align-self:flex-start;margin-top:.3125rem;background:none;border:none;border-radius:50%;color:var(--text-secondary);cursor:pointer;transition:color var(--site-transition-fast)}.gbt-toaster__close:hover,.gbt-toaster__close:focus-visible{color:var(--text-primary)}.gbt-toaster__close:active{color:var(--text-secondary)}.gbt-toaster__close:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-toaster__close:before{content:\"\";position:absolute;inset:50% auto auto 50%;width:max(100%,24px);height:max(100%,24px);transform:translate(-50%,-50%)}@keyframes gbt-toaster-in{0%{opacity:0;transform:translateY(4px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.gbt-toaster__item{animation-duration:1ms}.gbt-toaster__close{transition:none}}\n"]
183
+ styles: [".gbt-toaster{position:fixed;z-index:1300;display:flex;flex-direction:column;gap:.5rem;max-width:min(90vw,360px);pointer-events:none}.gbt-toaster[data-position=top-right]{top:1rem;right:1rem;align-items:flex-end}.gbt-toaster[data-position=top-left]{top:1rem;left:1rem;align-items:flex-start}.gbt-toaster[data-position=top-center]{top:1rem;left:50%;align-items:center;transform:translate(-50%)}.gbt-toaster[data-position=bottom-right]{right:1rem;bottom:1rem;flex-direction:column-reverse;align-items:flex-end}.gbt-toaster[data-position=bottom-left]{bottom:1rem;left:1rem;flex-direction:column-reverse;align-items:flex-start}.gbt-toaster[data-position=bottom-center]{bottom:1rem;left:50%;flex-direction:column-reverse;align-items:center;transform:translate(-50%)}.gbt-toaster__item{box-sizing:border-box;display:flex;align-items:flex-start;gap:.625rem;width:100%;padding:.75rem 1rem;pointer-events:auto;border:none;border-radius:var(--gbt-radius-row);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-toaster__item{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-toaster__item{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-toaster__item{--gbt-nested-low: light-dark(color-mix(in srgb, var(--text-primary) 20%, transparent), transparent);--gbt-nested-low-soft: light-dark(color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);--gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);--gbt-nested-hollow-shade: light-dark(color-mix(in srgb, var(--text-primary) 14%, transparent), transparent);--gbt-nested-hollow-trace: light-dark(color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);--gbt-nested-hollow-light: light-dark(#fff, transparent);--gbt-nested-group-low: light-dark(color-mix(in srgb, var(--text-primary) 12%, transparent), transparent);--gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-toaster__item{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-toaster__item{animation:gbt-toaster-in var(--site-transition-base)}.gbt-toaster__item[data-variant=success] .gbt-toaster__icon{background:var(--color-success-vivid-base)}.gbt-toaster__item[data-variant=warning] .gbt-toaster__icon{background:var(--color-warning-vivid-base)}.gbt-toaster__item[data-variant=error] .gbt-toaster__icon{background:var(--color-error-vivid-base)}.gbt-toaster__item[data-variant=info] .gbt-toaster__icon{background:var(--color-info-vivid-base)}.gbt-toaster__icon{display:inline-flex;flex:none;align-items:center;justify-content:center;width:1.875rem;height:1.875rem;margin-top:.0625rem;color:var(--text-on-color);border-radius:50%}.gbt-toaster__icon gbt-icon{width:1.125em;height:1.125em}.gbt-toaster__message{flex:1 1 auto;margin:.3125rem 0;color:var(--text-primary);font-size:.875rem;line-height:1.4}.gbt-toaster__close{position:relative;display:inline-flex;flex:none;align-self:flex-start;margin-top:.3125rem;background:none;border:none;border-radius:50%;color:var(--text-secondary);cursor:pointer;transition:color var(--site-transition-fast)}.gbt-toaster__close:hover,.gbt-toaster__close:focus-visible{color:var(--text-primary)}.gbt-toaster__close:active{color:var(--text-secondary)}.gbt-toaster__close:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-toaster__close:before{content:\"\";position:absolute;inset:50% auto auto 50%;width:max(100%,24px);height:max(100%,24px);transform:translate(-50%,-50%)}@keyframes gbt-toaster-in{0%{opacity:0;transform:translateY(4px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){.gbt-toaster__item{animation-duration:1ms}.gbt-toaster__close{transition:none}}\n"]
184
184
  }]
185
185
  }],
186
186
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"masmarino-gabarit-toaster.mjs","names":[],"sources":["../../../projects/gabarit/toaster/toast.service.ts","../../../projects/gabarit/toaster/toaster.ts","../../../projects/gabarit/toaster/toaster.html"],"sourcesContent":["import { DestroyRef, Injectable, inject, signal } from '@angular/core'\nimport type { ToastItem, ToastVariant } from './toaster'\n\nexport type GbtToastKind = ToastVariant\n\nexport interface GbtToastOptions {\n duration?: number\n}\n\nlet nextToastId = 0\n\n@Injectable({ providedIn: 'root' })\nexport class GbtToastService {\n private readonly items = signal<ToastItem[]>([])\n private readonly timers = new Map<string, ReturnType<typeof setTimeout>>()\n\n readonly toasts = this.items.asReadonly()\n\n readonly defaultDuration = signal(5000)\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.clearTimers())\n }\n\n show(message: string, kind: GbtToastKind = 'success', options: GbtToastOptions = {}): string {\n const id = `gbt-toast-${++nextToastId}`\n const duration = options.duration ?? this.defaultDuration()\n this.items.update((current) => [...current, { id, variant: kind, message, duration }])\n\n if (Number.isFinite(duration) && duration > 0) {\n this.timers.set(\n id,\n setTimeout(() => this.dismiss(id), duration),\n )\n }\n return id\n }\n\n dismiss(id: string): void {\n const timer = this.timers.get(id)\n if (timer !== undefined) {\n clearTimeout(timer)\n this.timers.delete(id)\n }\n this.items.update((current) => {\n const next = current.filter((toast) => toast.id !== id)\n return next.length === current.length ? current : next\n })\n }\n\n clear(): void {\n this.clearTimers()\n this.items.set([])\n }\n\n private clearTimers(): void {\n for (const timer of this.timers.values()) {\n clearTimeout(timer)\n }\n this.timers.clear()\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n OnDestroy,\n computed,\n effect,\n inject,\n input,\n output,\n} from '@angular/core'\nimport { Icon } from '@masmarino/gabarit/icon'\nimport { GbtToastService } from './toast.service'\n\nconst DEFAULT_DURATION_MS = 5000\n\nexport type ToastVariant = 'success' | 'error' | 'warning' | 'info'\n\nexport type ToasterPosition =\n 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center'\n\nexport interface ToastItem {\n id: string\n variant: ToastVariant\n message: string\n duration?: number\n}\n\nconst ASSERTIVE_VARIANTS: ReadonlySet<ToastVariant> = new Set(['warning', 'error'])\n\nconst VARIANT_ICONS: Record<ToastVariant, string> = {\n success: 'check-circle',\n error: 'alert-circle',\n warning: 'alert-triangle',\n info: 'info',\n}\n\n@Component({\n selector: 'gbt-toaster',\n standalone: true,\n imports: [Icon],\n templateUrl: './toaster.html',\n styleUrl: './toaster.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Toaster implements OnDestroy {\n toasts = input<ToastItem[] | undefined>(undefined)\n position = input<ToasterPosition>('bottom-right')\n closeLabel = input<string>('Close')\n\n dismissed = output<string>()\n\n private readonly service = inject(GbtToastService)\n private readonly timers = new Map<string, ReturnType<typeof setTimeout>>()\n\n protected readonly items = computed(() => this.toasts() ?? this.service.toasts())\n\n constructor() {\n effect(() => {\n const explicit = this.toasts()\n const list = explicit ?? []\n const currentIds = new Set(list.map((toast) => toast.id))\n\n for (const [id, timer] of this.timers) {\n if (!currentIds.has(id)) {\n clearTimeout(timer)\n this.timers.delete(id)\n }\n }\n\n for (const toast of list) {\n if (this.timers.has(toast.id)) {\n continue\n }\n const duration = toast.duration ?? DEFAULT_DURATION_MS\n if (!Number.isFinite(duration) || duration <= 0) {\n continue\n }\n this.timers.set(\n toast.id,\n setTimeout(() => {\n this.timers.delete(toast.id)\n this.dismissed.emit(toast.id)\n }, duration),\n )\n }\n })\n }\n\n ngOnDestroy(): void {\n for (const timer of this.timers.values()) {\n clearTimeout(timer)\n }\n this.timers.clear()\n }\n\n protected close(id: string): void {\n this.dismissed.emit(id)\n if (this.toasts() === undefined) {\n this.service.dismiss(id)\n }\n }\n\n protected roleFor(variant: ToastVariant): 'alert' | 'status' {\n return ASSERTIVE_VARIANTS.has(variant) ? 'alert' : 'status'\n }\n\n protected iconFor(variant: ToastVariant): string {\n return VARIANT_ICONS[variant]\n }\n}\n","<div class=\"gbt-toaster\" [attr.data-position]=\"position()\">\n @for (toast of items(); track toast.id) {\n <div\n class=\"gbt-toaster__item\"\n [attr.data-variant]=\"toast.variant\"\n [attr.role]=\"roleFor(toast.variant)\"\n aria-atomic=\"true\"\n >\n <span class=\"gbt-toaster__icon\">\n <gbt-icon [name]=\"iconFor(toast.variant)\" aria-hidden=\"true\" />\n </span>\n <p class=\"gbt-toaster__message\">{{ toast.message }}</p>\n <button\n type=\"button\"\n class=\"gbt-toaster__close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"close(toast.id)\"\n >\n <gbt-icon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AAA,EAAA,WAAA,YAAA;EAAA,UAAA;EAAA,UC5CpB;EAuBA,QAAA,CAAA,mnHAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MDgBY;GAAI,UAAA;GAAA,QAAA,CAAA,MAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAKH,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAO,YAAA,CAAA;EARnB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,YACX;GAAI,SACP,CAAC,IAAI;GAAC,iBAGE,wBAAwB;GAAM,UAAA;GAAA,QAAA,CAAA,mnHAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"masmarino-gabarit-toaster.mjs","names":[],"sources":["../../../projects/gabarit/toaster/toast.service.ts","../../../projects/gabarit/toaster/toaster.ts","../../../projects/gabarit/toaster/toaster.html"],"sourcesContent":["import { DestroyRef, Injectable, inject, signal } from '@angular/core'\nimport type { ToastItem, ToastVariant } from './toaster'\n\nexport type GbtToastKind = ToastVariant\n\nexport interface GbtToastOptions {\n duration?: number\n}\n\nlet nextToastId = 0\n\n@Injectable({ providedIn: 'root' })\nexport class GbtToastService {\n private readonly items = signal<ToastItem[]>([])\n private readonly timers = new Map<string, ReturnType<typeof setTimeout>>()\n\n readonly toasts = this.items.asReadonly()\n\n readonly defaultDuration = signal(5000)\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.clearTimers())\n }\n\n show(message: string, kind: GbtToastKind = 'success', options: GbtToastOptions = {}): string {\n const id = `gbt-toast-${++nextToastId}`\n const duration = options.duration ?? this.defaultDuration()\n this.items.update((current) => [...current, { id, variant: kind, message, duration }])\n\n if (Number.isFinite(duration) && duration > 0) {\n this.timers.set(\n id,\n setTimeout(() => this.dismiss(id), duration),\n )\n }\n return id\n }\n\n dismiss(id: string): void {\n const timer = this.timers.get(id)\n if (timer !== undefined) {\n clearTimeout(timer)\n this.timers.delete(id)\n }\n this.items.update((current) => {\n const next = current.filter((toast) => toast.id !== id)\n return next.length === current.length ? current : next\n })\n }\n\n clear(): void {\n this.clearTimers()\n this.items.set([])\n }\n\n private clearTimers(): void {\n for (const timer of this.timers.values()) {\n clearTimeout(timer)\n }\n this.timers.clear()\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n OnDestroy,\n computed,\n effect,\n inject,\n input,\n output,\n} from '@angular/core'\nimport { Icon } from '@masmarino/gabarit/icon'\nimport { GbtToastService } from './toast.service'\n\nconst DEFAULT_DURATION_MS = 5000\n\nexport type ToastVariant = 'success' | 'error' | 'warning' | 'info'\n\nexport type ToasterPosition =\n 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center'\n\nexport interface ToastItem {\n id: string\n variant: ToastVariant\n message: string\n duration?: number\n}\n\nconst ASSERTIVE_VARIANTS: ReadonlySet<ToastVariant> = new Set(['warning', 'error'])\n\nconst VARIANT_ICONS: Record<ToastVariant, string> = {\n success: 'check-circle',\n error: 'alert-circle',\n warning: 'alert-triangle',\n info: 'info',\n}\n\n@Component({\n selector: 'gbt-toaster',\n standalone: true,\n imports: [Icon],\n templateUrl: './toaster.html',\n styleUrl: './toaster.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Toaster implements OnDestroy {\n toasts = input<ToastItem[] | undefined>(undefined)\n position = input<ToasterPosition>('bottom-right')\n closeLabel = input<string>('Close')\n\n dismissed = output<string>()\n\n private readonly service = inject(GbtToastService)\n private readonly timers = new Map<string, ReturnType<typeof setTimeout>>()\n\n protected readonly items = computed(() => this.toasts() ?? this.service.toasts())\n\n constructor() {\n effect(() => {\n const explicit = this.toasts()\n const list = explicit ?? []\n const currentIds = new Set(list.map((toast) => toast.id))\n\n for (const [id, timer] of this.timers) {\n if (!currentIds.has(id)) {\n clearTimeout(timer)\n this.timers.delete(id)\n }\n }\n\n for (const toast of list) {\n if (this.timers.has(toast.id)) {\n continue\n }\n const duration = toast.duration ?? DEFAULT_DURATION_MS\n if (!Number.isFinite(duration) || duration <= 0) {\n continue\n }\n this.timers.set(\n toast.id,\n setTimeout(() => {\n this.timers.delete(toast.id)\n this.dismissed.emit(toast.id)\n }, duration),\n )\n }\n })\n }\n\n ngOnDestroy(): void {\n for (const timer of this.timers.values()) {\n clearTimeout(timer)\n }\n this.timers.clear()\n }\n\n protected close(id: string): void {\n this.dismissed.emit(id)\n if (this.toasts() === undefined) {\n this.service.dismiss(id)\n }\n }\n\n protected roleFor(variant: ToastVariant): 'alert' | 'status' {\n return ASSERTIVE_VARIANTS.has(variant) ? 'alert' : 'status'\n }\n\n protected iconFor(variant: ToastVariant): string {\n return VARIANT_ICONS[variant]\n }\n}\n","<div class=\"gbt-toaster\" [attr.data-position]=\"position()\">\n @for (toast of items(); track toast.id) {\n <div\n class=\"gbt-toaster__item\"\n [attr.data-variant]=\"toast.variant\"\n [attr.role]=\"roleFor(toast.variant)\"\n aria-atomic=\"true\"\n >\n <span class=\"gbt-toaster__icon\">\n <gbt-icon [name]=\"iconFor(toast.variant)\" aria-hidden=\"true\" />\n </span>\n <p class=\"gbt-toaster__message\">{{ toast.message }}</p>\n <button\n type=\"button\"\n class=\"gbt-toaster__close\"\n [attr.aria-label]=\"closeLabel()\"\n (click)=\"close(toast.id)\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n </div>\n }\n</div>\n"],"mappings":";;;AASA,IAAI,cAAc;AAGlB,IAAa,kBAAb,MAAa,gBAAe;CACT,QAAQ,OAAoB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,yBAAS,IAAI,IAAG;CAExB,SAAS,KAAK,MAAM,WAAU;CAE9B,kBAAkB,OAAO,KAAK,GAAA,YAAA,CAAA,EAAA,WAAA,kBAAA,CAAA,+BAAA,CAAA,CAAA;CAEvC,cAAA;EACE,OAAO,UAAU,CAAC,CAAC,gBAAgB,KAAK,YAAW,CAAE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A,m1IAAA;EAAA,CAAA"}
@@ -130,7 +130,7 @@ var Tooltip = class Tooltip {
130
130
  exportAs: ["gbtTooltip"],
131
131
  ngImport: i0,
132
132
  template: "<ng-content />\n@if (visible() && coords(); as pos) {\n <span\n class=\"gbt-tooltip__bubble\"\n [class.gbt-tooltip__bubble--leaving]=\"closing()\"\n role=\"tooltip\"\n [id]=\"tooltipId\"\n [attr.data-position]=\"position()\"\n [style.top.px]=\"pos.top\"\n [style.left.px]=\"pos.left\"\n >\n {{ text() }}\n </span>\n}\n",
133
- styles: [".gbt-tooltip-host{display:inline-block}.gbt-tooltip__bubble{position:fixed;z-index:1100;max-width:240px;padding:.375rem .625rem;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-tooltip__bubble{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-tooltip__bubble{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-tooltip__bubble{box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-tooltip__bubble{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-tooltip__bubble{color:var(--text-primary);text-align:center;white-space:normal;border-radius:var(--gbt-radius-row);font-size:.8125rem;line-height:1.3;pointer-events:none}.gbt-tooltip__bubble[data-position=top]{transform:translate(-50%,-100%)}.gbt-tooltip__bubble[data-position=bottom]{transform:translate(-50%)}.gbt-tooltip__bubble[data-position=left]{transform:translate(-100%,-50%)}.gbt-tooltip__bubble[data-position=right]{transform:translateY(-50%)}.gbt-tooltip__bubble{animation:gbt-tooltip-fade-in .12s ease-out}.gbt-tooltip__bubble.gbt-tooltip__bubble--leaving{animation:gbt-tooltip-fade-out .12s ease-in forwards}@keyframes gbt-tooltip-fade-in{0%{opacity:0}to{opacity:1}}@keyframes gbt-tooltip-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.gbt-tooltip__bubble,.gbt-tooltip__bubble.gbt-tooltip__bubble--leaving{animation-duration:1ms}}\n"],
133
+ styles: [".gbt-tooltip-host{display:inline-block}.gbt-tooltip__bubble{position:fixed;z-index:1100;max-width:240px;padding:.375rem .625rem;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-tooltip__bubble{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-tooltip__bubble{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-tooltip__bubble{--gbt-nested-low: light-dark(color-mix(in srgb, var(--text-primary) 20%, transparent), transparent);--gbt-nested-low-soft: light-dark(color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);--gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);--gbt-nested-hollow-shade: light-dark(color-mix(in srgb, var(--text-primary) 14%, transparent), transparent);--gbt-nested-hollow-trace: light-dark(color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);--gbt-nested-hollow-light: light-dark(#fff, transparent);--gbt-nested-group-low: light-dark(color-mix(in srgb, var(--text-primary) 12%, transparent), transparent);--gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-tooltip__bubble{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-tooltip__bubble{color:var(--text-primary);text-align:center;white-space:normal;border-radius:var(--gbt-radius-row);font-size:.8125rem;line-height:1.3;pointer-events:none}.gbt-tooltip__bubble[data-position=top]{transform:translate(-50%,-100%)}.gbt-tooltip__bubble[data-position=bottom]{transform:translate(-50%)}.gbt-tooltip__bubble[data-position=left]{transform:translate(-100%,-50%)}.gbt-tooltip__bubble[data-position=right]{transform:translateY(-50%)}.gbt-tooltip__bubble{animation:gbt-tooltip-fade-in .12s ease-out}.gbt-tooltip__bubble.gbt-tooltip__bubble--leaving{animation:gbt-tooltip-fade-out .12s ease-in forwards}@keyframes gbt-tooltip-fade-in{0%{opacity:0}to{opacity:1}}@keyframes gbt-tooltip-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.gbt-tooltip__bubble,.gbt-tooltip__bubble.gbt-tooltip__bubble--leaving{animation-duration:1ms}}\n"],
134
134
  changeDetection: i0.ChangeDetectionStrategy.OnPush
135
135
  });
136
136
  };
@@ -157,7 +157,7 @@ i0.ɵɵngDeclareClassMetadata({
157
157
  "(window:resize)": "updatePosition()"
158
158
  },
159
159
  template: "<ng-content />\n@if (visible() && coords(); as pos) {\n <span\n class=\"gbt-tooltip__bubble\"\n [class.gbt-tooltip__bubble--leaving]=\"closing()\"\n role=\"tooltip\"\n [id]=\"tooltipId\"\n [attr.data-position]=\"position()\"\n [style.top.px]=\"pos.top\"\n [style.left.px]=\"pos.left\"\n >\n {{ text() }}\n </span>\n}\n",
160
- styles: [".gbt-tooltip-host{display:inline-block}.gbt-tooltip__bubble{position:fixed;z-index:1100;max-width:240px;padding:.375rem .625rem;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-tooltip__bubble{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-tooltip__bubble{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-tooltip__bubble{box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-tooltip__bubble{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-tooltip__bubble{color:var(--text-primary);text-align:center;white-space:normal;border-radius:var(--gbt-radius-row);font-size:.8125rem;line-height:1.3;pointer-events:none}.gbt-tooltip__bubble[data-position=top]{transform:translate(-50%,-100%)}.gbt-tooltip__bubble[data-position=bottom]{transform:translate(-50%)}.gbt-tooltip__bubble[data-position=left]{transform:translate(-100%,-50%)}.gbt-tooltip__bubble[data-position=right]{transform:translateY(-50%)}.gbt-tooltip__bubble{animation:gbt-tooltip-fade-in .12s ease-out}.gbt-tooltip__bubble.gbt-tooltip__bubble--leaving{animation:gbt-tooltip-fade-out .12s ease-in forwards}@keyframes gbt-tooltip-fade-in{0%{opacity:0}to{opacity:1}}@keyframes gbt-tooltip-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.gbt-tooltip__bubble,.gbt-tooltip__bubble.gbt-tooltip__bubble--leaving{animation-duration:1ms}}\n"]
160
+ styles: [".gbt-tooltip-host{display:inline-block}.gbt-tooltip__bubble{position:fixed;z-index:1100;max-width:240px;padding:.375rem .625rem;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-tooltip__bubble{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-tooltip__bubble{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid)}}.gbt-tooltip__bubble{--gbt-nested-low: light-dark(color-mix(in srgb, var(--text-primary) 20%, transparent), transparent);--gbt-nested-low-soft: light-dark(color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);--gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);--gbt-nested-hollow-shade: light-dark(color-mix(in srgb, var(--text-primary) 14%, transparent), transparent);--gbt-nested-hollow-trace: light-dark(color-mix(in srgb, var(--text-primary) 6%, transparent), transparent);--gbt-nested-hollow-light: light-dark(#fff, transparent);--gbt-nested-group-low: light-dark(color-mix(in srgb, var(--text-primary) 12%, transparent), transparent);--gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);box-shadow:var(--gbt-depth-liquid),var(--gbt-depth-glass)}@media(prefers-contrast:more){.gbt-tooltip__bubble{box-shadow:inset 0 0 0 1px var(--border-color),var(--gbt-depth-liquid),var(--gbt-depth-glass)}}.gbt-tooltip__bubble{color:var(--text-primary);text-align:center;white-space:normal;border-radius:var(--gbt-radius-row);font-size:.8125rem;line-height:1.3;pointer-events:none}.gbt-tooltip__bubble[data-position=top]{transform:translate(-50%,-100%)}.gbt-tooltip__bubble[data-position=bottom]{transform:translate(-50%)}.gbt-tooltip__bubble[data-position=left]{transform:translate(-100%,-50%)}.gbt-tooltip__bubble[data-position=right]{transform:translateY(-50%)}.gbt-tooltip__bubble{animation:gbt-tooltip-fade-in .12s ease-out}.gbt-tooltip__bubble.gbt-tooltip__bubble--leaving{animation:gbt-tooltip-fade-out .12s ease-in forwards}@keyframes gbt-tooltip-fade-in{0%{opacity:0}to{opacity:1}}@keyframes gbt-tooltip-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.gbt-tooltip__bubble,.gbt-tooltip__bubble.gbt-tooltip__bubble--leaving{animation-duration:1ms}}\n"]
161
161
  }]
162
162
  }],
163
163
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"masmarino-gabarit-tooltip.mjs","names":[],"sources":["../../../projects/gabarit/tooltip/tooltip.ts","../../../projects/gabarit/tooltip/tooltip.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n OnDestroy,\n inject,\n input,\n signal,\n} from '@angular/core'\nimport { followPageScroll } from '@masmarino/gabarit/floating-panel'\n\nexport type TooltipPosition = 'top' | 'bottom' | 'left' | 'right'\n\ninterface TooltipCoords {\n top: number\n left: number\n}\n\nconst SHOW_DELAY_MS = 400\nconst FADE_MS = 120\nconst GAP_PX = 8\n\nlet nextId = 0\n\n@Component({\n selector: 'gbt-tooltip',\n standalone: true,\n exportAs: 'gbtTooltip',\n imports: [],\n templateUrl: './tooltip.html',\n styleUrl: './tooltip.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'gbt-tooltip-host',\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'hide()',\n '(focusin)': 'onFocusIn()',\n '(focusout)': 'hide()',\n '(keydown.escape)': 'hide()',\n '(window:resize)': 'updatePosition()',\n },\n})\nexport class Tooltip implements OnDestroy {\n private readonly elementRef = inject(ElementRef<HTMLElement>)\n\n text = input.required<string>()\n position = input<TooltipPosition>('top')\n\n readonly tooltipId = `gbt-tooltip-${++nextId}`\n\n protected readonly visible = signal(false)\n protected readonly closing = signal(false)\n protected readonly coords = signal<TooltipCoords | null>(null)\n\n private showTimer: ReturnType<typeof setTimeout> | null = null\n private hideTimer: ReturnType<typeof setTimeout> | null = null\n\n protected onMouseEnter(): void {\n this.showTimer = setTimeout(() => {\n this.showTimer = null\n this.show()\n }, SHOW_DELAY_MS)\n }\n\n protected onFocusIn(): void {\n this.show()\n }\n\n private show(): void {\n if (this.hideTimer !== null) {\n clearTimeout(this.hideTimer)\n this.hideTimer = null\n }\n this.closing.set(false)\n this.updatePosition()\n this.visible.set(true)\n }\n\n constructor() {\n followPageScroll(() => this.updatePosition())\n }\n\n protected updatePosition(): void {\n const rect = this.elementRef.nativeElement.getBoundingClientRect()\n switch (this.position()) {\n case 'top':\n this.coords.set({ top: rect.top - GAP_PX, left: rect.left + rect.width / 2 })\n break\n case 'bottom':\n this.coords.set({ top: rect.bottom + GAP_PX, left: rect.left + rect.width / 2 })\n break\n case 'left':\n this.coords.set({ top: rect.top + rect.height / 2, left: rect.left - GAP_PX })\n break\n case 'right':\n this.coords.set({ top: rect.top + rect.height / 2, left: rect.right + GAP_PX })\n break\n }\n }\n\n protected hide(): void {\n if (this.showTimer !== null) {\n clearTimeout(this.showTimer)\n this.showTimer = null\n }\n if (!this.visible() || this.closing()) return\n this.closing.set(true)\n this.hideTimer = setTimeout(() => {\n this.hideTimer = null\n this.closing.set(false)\n this.visible.set(false)\n }, FADE_MS)\n }\n\n ngOnDestroy(): void {\n if (this.showTimer !== null) {\n clearTimeout(this.showTimer)\n this.showTimer = null\n }\n if (this.hideTimer !== null) {\n clearTimeout(this.hideTimer)\n this.hideTimer = null\n }\n }\n}\n","<ng-content />\n@if (visible() && coords(); as pos) {\n <span\n class=\"gbt-tooltip__bubble\"\n [class.gbt-tooltip__bubble--leaving]=\"closing()\"\n role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GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,WAAA;IAAA,cAAA;IAAA,cAAA;IAAA,WAAA;IAAA,YAAA;IAAA,kBAAA;IAAA,iBAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,UAAA,CAAA,YAAA;EAAA,UAAA;EAAA,UC1CpB;EAcA,QAAA,CAAA,s/DAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AD4Ba,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAO,YAAA,CAAA;EAlBnB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,YACX;GAAI,UACN;GAAY,SACb,CAAA;GAAE,iBAGM,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,gBAAgB;IAChB,gBAAgB;IAChB,aAAa;IACb,cAAc;IACd,oBAAoB;IACpB,mBAAmB;GACpB;GAAA,UAAA;GAAA,QAAA,CAAA,s/DAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"masmarino-gabarit-tooltip.mjs","names":[],"sources":["../../../projects/gabarit/tooltip/tooltip.ts","../../../projects/gabarit/tooltip/tooltip.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n OnDestroy,\n inject,\n input,\n signal,\n} from '@angular/core'\nimport { followPageScroll } from '@masmarino/gabarit/floating-panel'\n\nexport type TooltipPosition = 'top' | 'bottom' | 'left' | 'right'\n\ninterface TooltipCoords {\n top: number\n left: number\n}\n\nconst SHOW_DELAY_MS = 400\nconst FADE_MS = 120\nconst GAP_PX = 8\n\nlet nextId = 0\n\n@Component({\n selector: 'gbt-tooltip',\n standalone: true,\n exportAs: 'gbtTooltip',\n imports: [],\n templateUrl: './tooltip.html',\n styleUrl: './tooltip.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'gbt-tooltip-host',\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'hide()',\n '(focusin)': 'onFocusIn()',\n '(focusout)': 'hide()',\n '(keydown.escape)': 'hide()',\n '(window:resize)': 'updatePosition()',\n },\n})\nexport class Tooltip implements OnDestroy {\n private readonly elementRef = inject(ElementRef<HTMLElement>)\n\n text = input.required<string>()\n position = input<TooltipPosition>('top')\n\n readonly tooltipId = `gbt-tooltip-${++nextId}`\n\n protected readonly visible = signal(false)\n protected readonly closing = signal(false)\n protected readonly coords = signal<TooltipCoords | null>(null)\n\n private showTimer: ReturnType<typeof setTimeout> | null = null\n private hideTimer: ReturnType<typeof setTimeout> | null = null\n\n protected onMouseEnter(): void {\n this.showTimer = setTimeout(() => {\n this.showTimer = null\n this.show()\n }, SHOW_DELAY_MS)\n }\n\n protected onFocusIn(): void {\n this.show()\n }\n\n private show(): void {\n if (this.hideTimer !== null) {\n clearTimeout(this.hideTimer)\n this.hideTimer = null\n }\n this.closing.set(false)\n this.updatePosition()\n this.visible.set(true)\n }\n\n constructor() {\n followPageScroll(() => this.updatePosition())\n }\n\n protected updatePosition(): void {\n const rect = this.elementRef.nativeElement.getBoundingClientRect()\n switch (this.position()) {\n case 'top':\n this.coords.set({ top: rect.top - GAP_PX, left: rect.left + rect.width / 2 })\n break\n case 'bottom':\n this.coords.set({ top: rect.bottom + GAP_PX, left: rect.left + rect.width / 2 })\n break\n case 'left':\n this.coords.set({ top: rect.top + rect.height / 2, left: rect.left - GAP_PX })\n break\n case 'right':\n this.coords.set({ top: rect.top + rect.height / 2, left: rect.right + GAP_PX })\n break\n }\n }\n\n protected hide(): void {\n if (this.showTimer !== null) {\n clearTimeout(this.showTimer)\n this.showTimer = null\n }\n if (!this.visible() || this.closing()) return\n this.closing.set(true)\n this.hideTimer = setTimeout(() => {\n this.hideTimer = null\n this.closing.set(false)\n this.visible.set(false)\n }, FADE_MS)\n }\n\n ngOnDestroy(): void {\n if (this.showTimer !== null) {\n clearTimeout(this.showTimer)\n this.showTimer = null\n }\n if (this.hideTimer !== null) {\n clearTimeout(this.hideTimer)\n this.hideTimer = null\n }\n }\n}\n","<ng-content />\n@if (visible() && coords(); as pos) {\n <span\n class=\"gbt-tooltip__bubble\"\n [class.gbt-tooltip__bubble--leaving]=\"closing()\"\n role=\"tooltip\"\n [id]=\"tooltipId\"\n [attr.data-position]=\"position()\"\n [style.top.px]=\"pos.top\"\n [style.left.px]=\"pos.left\"\n >\n {{ text() }}\n </span>\n}\n"],"mappings":";;;AAkBA,MAAM,gBAAgB;AACtB,MAAM,UAAU;AAChB,MAAM,SAAS;AAEf,IAAI,SAAS;AAoBb,IAAa,UAAb,MAAa,QAAO;CACD,aAAa,OAAO,UAAuB;CAE5D,OAAO,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,WAAW,MAAuB,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAE/B,YAAY,eAAe,EAAE;CAEnB,UAAU,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACvB,UAAU,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACvB,SAAS,OAA6B,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAEtD,YAAkD;CAClD,YAAkD;CAEhD,eAAY;EACpB,KAAK,YAAY,iBAAgB;GAC/B,KAAK,YAAY;GACjB,KAAK,KAAI;EACX,GAAG,aAAa;CAClB;CAEU,YAAS;EACjB,KAAK,KAAI;CACX;CAEQ,OAAI;EACV,IAAI,KAAK,cAAc,MAAM;GAC3B,aAAa,KAAK,SAAS;GAC3B,KAAK,YAAY;EACnB;EACA,KAAK,QAAQ,IAAI,KAAK;EACtB,KAAK,eAAc;EACnB,KAAK,QAAQ,IAAI,IAAI;CAC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,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAO,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,WAAA;IAAA,cAAA;IAAA,cAAA;IAAA,WAAA;IAAA,YAAA;IAAA,kBAAA;IAAA,iBAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,UAAA,CAAA,YAAA;EAAA,UAAA;EAAA,UC1CpB;EAcA,QAAA,CAAA,stFAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AD4Ba,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAO,YAAA,CAAA;EAlBnB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,YACX;GAAI,UACN;GAAY,SACb,CAAA;GAAE,iBAGM,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,gBAAgB;IAChB,gBAAgB;IAChB,aAAa;IACb,cAAc;IACd,oBAAoB;IACpB,mBAAmB;GACpB;GAAA,UAAA;GAAA,QAAA,CAAA,stFAAA;EAAA,CAAA"}
@@ -80,7 +80,7 @@ import { AuthResetPassword } from "@masmarino/gabarit/auth-reset-password";
80
80
  import { MfaSettings } from "@masmarino/gabarit/mfa-settings";
81
81
  import { PasskeySettings } from "@masmarino/gabarit/passkey-settings";
82
82
  import { GitField } from "@masmarino/gabarit/git-field";
83
- const GABARIT_VERSION = "4.1.0";
83
+ const GABARIT_VERSION = "4.1.1";
84
84
  export { ACTIVATION_TOKEN_SHAPE, AUTH_LABELS, AUTH_PORT, AUTH_PORT_ERROR_BODIES, Accordion, AccordionItem, Alert, AppShell, AppShellNavGroup, AuthActivate, AuthFooter, AuthFooterLink, AuthLogin, AuthPanel, AuthRegister, AuthResetPassword, Autocomplete, Avatar, AvatarGroup, BackupCodes, Badge, BarChart, BarSeries, Breadcrumb, Button, CHART_CONTEXT, COPY_FIELD_WRAP_AT, Card, CardHeader, CardLink, ChartAxis, ChartEmpty, ChartFrame, ChartLegend, ChartTable, ChartTooltip, Checkbox, CheckboxGroup, ClipboardFeedback, CommandPalette, CommandPaletteTrigger, ConfirmDangerModal, CopyButton, CopyField, DEFAULT_ACTIVATE_LABELS, DEFAULT_BACKUP_CODES_LABELS, DEFAULT_LOGIN_LABELS, DEFAULT_MFA_ENROLLMENT_LABELS, DEFAULT_MFA_SETTINGS_LABELS, DEFAULT_PASSKEY_SETTINGS_LABELS, DEFAULT_REGISTER_LABELS, DEFAULT_RESET_PASSWORD_LABELS, DEFAULT_TOTP_QR_LABELS, DatePicker, DateRangePicker, DescriptionList, DimensionCard, Disclosure, Divider, Drawer, EmptyState, FileUpload, FunnelChart, GABARIT_VERSION, GaugeBar, GbtBytesPipe, GbtDateTimePipe, GbtInput, GbtRelativeTimePipe, GbtToastService, GitField, Icon, IconMarker, IconRegistry, JobGraph, JobStatus, LineChart, LineSeries, ListCard, ListRow, ListToolbar, MFA_PORT, MIN_PASSWORD_LENGTH, Menu, MenuItem, MenuTrigger, MfaEnrollment, MfaSettings, MfaSettingsState, Modal, NavTab, NavTabs, NotificationDot, PASSKEY_NAME_MAX, PageHeader, PageLayout, Pagination, Panel, PasskeySettings, PieChart, Popover, RadioGroup, SaveStatus, SearchBar, SecretReveal, SegmentedControl, Select, Skeleton, SkeletonList, Slider, Sparkline, Spinner, StatGrid, StatTile, StatTileLink, Stepper, Switch, TOTP_QR_RENDERER, Tab, Table, Tabs, Tag, TagInput, Textarea, TimelineChart, TimelineSeries, Toaster, Tooltip, TotpQr, Tree, USERNAME_PATTERN, UserChip, accountName, activationToken, arcPath, areaPath, bandScale, base64UrlToBuffer, bufferToBase64Url, classifyActivateFailure, classifyMfaFailure, classifyPasskeyError, classifyPasswordFailure, classifyRegisterFailure, computeInitials, copyToClipboard, createListToolbarState, createPasskeyCredential, emailProblem, formatBytes, formatCompact, formatDateTime, formatDuration, formatNumber, formatPercent, formatRelativeTime, getPasskeyAssertion, isAuthPortError, isTooManyPasskeys, linePath, linearScale, matchCommand, nearestIndex, niceTicks, niceXDomain, niceYDomain, passkeyNameProblem, passkeysSupported, passwordProblem, portErrorMessage, provideAuthLabels, selectContents, shortcutLabel, timeScale, timeTicks, usernameProblem };
85
85
 
86
86
  //# sourceMappingURL=masmarino-gabarit.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"masmarino-gabarit.mjs","names":[],"sources":["../../../projects/gabarit/src/lib/version.ts"],"sourcesContent":["export const GABARIT_VERSION = '4.1.0'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAa,kBAAkB"}
1
+ {"version":3,"file":"masmarino-gabarit.mjs","names":[],"sources":["../../../projects/gabarit/src/lib/version.ts"],"sourcesContent":["export const GABARIT_VERSION = '4.1.1'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAa,kBAAkB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masmarino/gabarit",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "Angular design system — UI components and dataviz for self-hosted applications.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/Masmarino/Gabarit",
@@ -49,6 +49,35 @@
49
49
  }
50
50
  }
51
51
 
52
+ // What a light glass tells the controls laid in it (4.1.1): colours, inherited by what it holds whatever its place in
53
+ // the DOM, laid as extra layers over a control's own light (`transparent` where none is posed). Only a light scheme
54
+ // takes them: `light-dark()` follows the `color-scheme` of the theme or of the ambiance, so the dark theme and the dark
55
+ // ambiances keep the controls they had (theirs stay visible on a dark glass).
56
+ @mixin holds-controls {
57
+ --gbt-nested-low: light-dark(#{ink($nested-low)}, transparent);
58
+ --gbt-nested-low-soft: light-dark(#{ink($nested-low-soft)}, transparent);
59
+ --gbt-nested-contact: light-dark(var(--gbt-glass-shadow-near), transparent);
60
+ --gbt-nested-hollow-shade: light-dark(#{ink($nested-hollow-shade)}, transparent);
61
+ --gbt-nested-hollow-trace: light-dark(#{ink($nested-hollow-trace)}, transparent);
62
+ --gbt-nested-hollow-light: light-dark(#fff, transparent);
63
+ --gbt-nested-group-low: light-dark(#{ink($nested-group-low)}, transparent);
64
+ --gbt-nested-group-shadow: light-dark(var(--gbt-glass-shadow), transparent);
65
+ }
66
+
67
+ // What floats in a light glass (a chip, a glass button, a select's face): the ink at its bottom edge, softer up the
68
+ // curve of its sides, and a tight contact shadow under it. Laid after the control's own light (its rim at the top).
69
+ $nested-float:
70
+ inset 0 -1px 0 var(--gbt-nested-low, transparent),
71
+ inset 0 -2px 3px -1px var(--gbt-nested-low-soft, transparent),
72
+ 0 1px 3px var(--gbt-nested-contact, transparent);
73
+
74
+ // What is hollowed in a light glass (a field): the ink's shade inside its top edge with a trace all around, the white
75
+ // at its bottom.
76
+ $nested-hollow:
77
+ inset 0 1px 2px var(--gbt-nested-hollow-shade, transparent),
78
+ inset 0 0 0 1px var(--gbt-nested-hollow-trace, transparent),
79
+ inset 0 -1px 0 var(--gbt-nested-hollow-light, transparent);
80
+
52
81
  // The content glass: a panel, a card, a sheet. `$density`: thin, regular or thick (a sheet, a drawer).
53
82
  // `$shadow: false` for a glass laid in another glass (no second shadow under it).
54
83
  @mixin glass($density: regular, $shadow: true) {
@@ -61,6 +90,7 @@
61
90
  backdrop-filter: var(--gbt-glass-blur);
62
91
  box-shadow: var(--gbt-glass-rim-light), $depth;
63
92
  @include on-ground;
93
+ @include holds-controls;
64
94
  @include dense-when-asked;
65
95
  @include edged-when-asked($depth);
66
96
  }
@@ -82,6 +112,7 @@
82
112
  // rises above the panels.
83
113
  @mixin floating-glass {
84
114
  @include liquid-glass(thick);
115
+ @include holds-controls;
85
116
  box-shadow: var(--gbt-depth-liquid), var(--gbt-depth-glass);
86
117
  @include edged-when-asked((var(--gbt-depth-liquid), var(--gbt-depth-glass)));
87
118
  }
@@ -101,6 +132,22 @@ $press-scale: 1.04;
101
132
  $press-light: 0.14;
102
133
  $prominent: 86%;
103
134
 
135
+ // Laid in a light surface (4.1.1, a trial): white on white loses its edges. The relief has its light above and its
136
+ // shade below, the hollow the other way round; on a light ground the dark half does the work. So what floats keeps its
137
+ // rim of light at the top and takes the ink at its bottom edge (`nested-low`), the curve of a capsule passing from the
138
+ // one to the other along its sides, and a contact shadow under it; a field's hollow takes the ink's shade inside its
139
+ // top edge (`nested-hollow-shade`, with a trace all around) and the white at its bottom; a form's card, a glass in the
140
+ // glass, a sharper near shadow and the ink at its bottom edge only (`nested-group-low`). No uniform line.
141
+ $nested-low: 0.2;
142
+ $nested-low-soft: 0.08;
143
+ $nested-hollow-shade: 0.14;
144
+ $nested-hollow-trace: 0.06;
145
+ $nested-group-low: 0.12;
146
+
147
+ @function ink($alpha) {
148
+ @return color-mix(in srgb, var(--text-primary) #{$alpha * 100%}, transparent);
149
+ }
150
+
104
151
  // The light of a held glass, from above and from below as the rims, never across: `pressLight` at its edges, a trace
105
152
  // at its middle where its label sits (white at 0.14 all over would take the ink under 7:1 on the dark ground's light).
106
153
  $press-light-core: 0.04;
@@ -151,6 +198,8 @@ $liquid-rims:
151
198
  // A control in liquid glass (a button, a chip, the lens of a segmented control): the clear glass, the ground's ink.
152
199
  @mixin liquid-control {
153
200
  @include liquid-glass;
201
+ // In a light glass (4.1.1, `holds-controls`), the ink at its bottom edge and a contact shadow.
202
+ box-shadow: var(--gbt-depth-liquid), $nested-float;
154
203
  color: var(--text-primary);
155
204
  }
156
205
 
@@ -199,12 +248,14 @@ $liquid-rims:
199
248
 
200
249
  // A text field: a hollow of thin glass, no edge at rest (its shade falls inside its top edge, a light lines its
201
250
  // bottom). With the focus it takes the ink's edge (3:1 at least, contrast.spec.ts) and the focus ring; with more
202
- // contrast asked, its edge stays. A form's card unsets the hollow (`--gbt-field-*`).
251
+ // contrast asked, its edge stays. A form's card unsets the hollow (`--gbt-field-*`). In a light glass the hollow
252
+ // deepens (`$nested-hollow`), its glass unchanged, no line at rest.
203
253
  @mixin glass-hollow {
204
254
  background: var(--gbt-field-ground, var(--gbt-glass-thin));
205
255
  border: 1px solid var(--gbt-field-border, transparent);
206
256
  box-shadow: var(
207
257
  --gbt-field-hollow,
258
+ $nested-hollow,
208
259
  inset 0 1px 3px var(--gbt-glass-hollow),
209
260
  inset 0 -1px 0 var(--gbt-glass-rim-bottom)
210
261
  );
@@ -24,9 +24,9 @@
24
24
  --gbt-liquid-rim-top: rgba(255, 255, 255, 0.7);
25
25
  --gbt-liquid-rim-bottom: rgba(255, 255, 255, 0.45);
26
26
  --gbt-liquid-sheen: rgba(255, 255, 255, 0.35);
27
- --gbt-glass-shadow: rgba(24, 32, 48, 0.22);
28
- --gbt-glass-shadow-near: rgba(24, 32, 48, 0.06);
29
- --gbt-liquid-shadow: rgba(24, 32, 48, 0.2);
27
+ --gbt-glass-shadow: rgba(24, 32, 48, 0.27);
28
+ --gbt-glass-shadow-near: rgba(24, 32, 48, 0.1);
29
+ --gbt-liquid-shadow: rgba(24, 32, 48, 0.26);
30
30
  --gbt-glass-hollow: rgba(24, 32, 48, 0.1);
31
31
  color-scheme: light;
32
32
  }
@@ -285,9 +285,9 @@
285
285
  --gbt-liquid-rim-top: rgba(255, 255, 255, 0.7);
286
286
  --gbt-liquid-rim-bottom: rgba(255, 255, 255, 0.45);
287
287
  --gbt-liquid-sheen: rgba(255, 255, 255, 0.35);
288
- --gbt-glass-shadow: rgba(70, 68, 74, 0.22);
289
- --gbt-glass-shadow-near: rgba(70, 68, 74, 0.06);
290
- --gbt-liquid-shadow: rgba(70, 68, 74, 0.2);
288
+ --gbt-glass-shadow: rgba(70, 68, 74, 0.27);
289
+ --gbt-glass-shadow-near: rgba(70, 68, 74, 0.1);
290
+ --gbt-liquid-shadow: rgba(70, 68, 74, 0.26);
291
291
  --gbt-glass-hollow: rgba(70, 68, 74, 0.1);
292
292
  color-scheme: light;
293
293
  }
@@ -123,9 +123,9 @@
123
123
  --gbt-liquid-rim-top: rgba(255, 255, 255, 0.7);
124
124
  --gbt-liquid-rim-bottom: rgba(255, 255, 255, 0.45);
125
125
  --gbt-liquid-sheen: rgba(255, 255, 255, 0.35);
126
- --gbt-glass-shadow: rgba(24, 32, 48, 0.22);
127
- --gbt-glass-shadow-near: rgba(24, 32, 48, 0.06);
128
- --gbt-liquid-shadow: rgba(24, 32, 48, 0.2);
126
+ --gbt-glass-shadow: rgba(24, 32, 48, 0.27);
127
+ --gbt-glass-shadow-near: rgba(24, 32, 48, 0.1);
128
+ --gbt-liquid-shadow: rgba(24, 32, 48, 0.26);
129
129
  --gbt-glass-hollow: rgba(24, 32, 48, 0.1);
130
130
  --gbt-glass-blur: blur(28px) saturate(1.5);
131
131
  --gbt-liquid-blur: blur(9px) saturate(1.9) brightness(1.06);
@@ -342,7 +342,8 @@
342
342
  @include glass.liquid-glass;
343
343
  }
344
344
 
345
- // A chip (4.1): a filter, a choice among several, a suggestion. A capsule of thin liquid glass; the chosen one
345
+ // A chip (4.1): a filter, a choice among several, a suggestion. A capsule of thin liquid glass (in a light glass, the
346
+ // ink at its bottom edge: white on white would lose it); the chosen one
346
347
  // (`aria-pressed`, `aria-selected` or `aria-checked` true, or `.gbt-chip--selected`) in the glass tinted by the accent.
347
348
  // Put it on a `<button>` (or a link). Never the content: a label inside a row is a `gbt-badge`.
348
349
  .gbt-chip {
@@ -362,6 +363,9 @@
362
363
  white-space: nowrap;
363
364
  cursor: pointer;
364
365
  @include glass.liquid-thin;
366
+ // In a light glass (4.1.1, `holds-controls`): its rim of light at the top, the ink at its bottom edge and a contact
367
+ // shadow; its glass unchanged.
368
+ box-shadow: glass.$liquid-rims, glass.$nested-float;
365
369
  color: var(--text-primary);
366
370
  @include glass.liquid-motion;
367
371
 
@@ -80,5 +80,5 @@ import { AuthResetPassword } from "@masmarino/gabarit/auth-reset-password";
80
80
  import { MfaSettings } from "@masmarino/gabarit/mfa-settings";
81
81
  import { PasskeySettings } from "@masmarino/gabarit/passkey-settings";
82
82
  import { GitField } from "@masmarino/gabarit/git-field";
83
- export declare const GABARIT_VERSION = "4.1.0";
83
+ export declare const GABARIT_VERSION = "4.1.1";
84
84
  export { ACTIVATION_TOKEN_SHAPE, AUTH_LABELS, AUTH_PORT, AUTH_PORT_ERROR_BODIES, Accordion, AccordionItem, type AccordionMode, type ActivateFailure, type ActivateLabels, Alert, type AlertAppearance, type AlertIconAlign, type AlertLive, type AlertSize, type AlertVariant, AppShell, AppShellNavGroup, type Arc, AuthActivate, type AuthConfig, AuthFooter, AuthFooterLink, type AuthLabels, AuthLogin, AuthPanel, type AuthPort, type AuthPortError, AuthRegister, AuthResetPassword, Autocomplete, type AutocompleteSearchFn, Avatar, AvatarGroup, type AvatarGroupItem, type AvatarSize, type AxisSpec, BackupCodes, type BackupCodesLabels, type BackupCodesResult, Badge, type BadgeAppearance, type BadgeSize, type BadgeVariant, type BandScale, BarChart, BarSeries, Breadcrumb, Button, type ButtonHaspopup, type ButtonSize, type ButtonVariant, CHART_CONTEXT, COPY_FIELD_WRAP_AT, type CalendarDay, Card, CardHeader, CardLink, type CardTone, ChartAxis, type ChartBox, ChartEmpty, ChartFrame, type ChartInterval, ChartLegend, type ChartMargin, type ChartPoint, type ChartReader, type ChartSeries, ChartTable, ChartTooltip, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupSection, ClipboardFeedback, type CommandGroup, type CommandItem, CommandPalette, CommandPaletteTrigger, ConfirmDangerModal, type ConfirmDangerModalTone, CopyButton, type CopyButtonFeedback, CopyField, type CopyOutcome, type CopyStatus, type CopyValue, DEFAULT_ACTIVATE_LABELS, DEFAULT_BACKUP_CODES_LABELS, DEFAULT_LOGIN_LABELS, DEFAULT_MFA_ENROLLMENT_LABELS, DEFAULT_MFA_SETTINGS_LABELS, DEFAULT_PASSKEY_SETTINGS_LABELS, DEFAULT_REGISTER_LABELS, DEFAULT_RESET_PASSWORD_LABELS, DEFAULT_TOTP_QR_LABELS, type DateInput, DatePicker, DateRangePicker, type DateRangeValue, DescriptionList, type DescriptionListEntry, type DescriptionListLayout, type DescriptionListResponsive, type DescriptionListValueAlign, DimensionCard, type DimensionRow, Disclosure, type DisclosureAppearance, type DisclosureHeadingLevel, Divider, type DividerOrientation, Drawer, type DrawerEdge, type EmailProblem, EmptyState, type EmptyStateHeadingLevel, type EmptyStateIllustration, type EmptyStateSize, type EmptyStateTone, type EnrolledFactor, FileUpload, type FlatTreeNode, type FormatBytesOptions, type FormatDurationOptions, type FormatRelativeTimeOptions, FunnelChart, type FunnelStep, GaugeBar, GbtBytesPipe, type GbtBytesPipeOptions, GbtDateTimePipe, type GbtDateTimePipeOptions, GbtInput, type GbtPipeLocale, GbtRelativeTimePipe, type GbtRelativeTimePipeOptions, type GbtToastKind, type GbtToastOptions, GbtToastService, GitField, Icon, IconMarker, type IconMarkerAppearance, type IconMarkerShape, type IconMarkerSize, type IconMarkerTone, IconRegistry, type InputCombobox, JobGraph, type JobGraphJob, type JobGraphStage, type JobGraphStatus, JobStatus, type JobStatusValue, type LegendEntry, LineChart, LineSeries, type LinearAxisSpec, ListCard, type ListCardState, ListRow, type ListRowTone, ListToolbar, type ListToolbarAccessors, type ListToolbarDirection, type ListToolbarSortOption, type ListToolbarSortValue, type ListToolbarState, type ListToolbarStateConfig, type LoginLabels, type LoginResponse, MFA_PORT, MIN_PASSWORD_LENGTH, Menu, MenuItem, type MenuItemVariant, MenuTrigger, MfaEnrollment, type MfaEnrollmentLabels, type MfaFailure, type MfaFormOwner, type MfaPort, type MfaProof, MfaSettings, type MfaSettingsLabels, MfaSettingsState, type MfaSetupResult, type MfaStatus, Modal, NavTab, NavTabs, type NavTabsOrientation, NotificationDot, type NotificationDotVariant, PASSKEY_NAME_MAX, PageHeader, type PageHeaderLevel, PageLayout, type PageLayoutAsidePosition, type PageLayoutAsideWidth, type PageLayoutWidth, Pagination, Panel, type PanelHeadingLevel, type Passkey, type PasskeyChallenge, type PasskeyFailure, type PasskeyNameProblem, PasskeySettings, type PasskeySettingsLabels, type PasswordGatedFailure, type PasswordProblem, PieChart, type PieSlice, type Point, type PointValue, Popover, type PopoverAlign, RadioGroup, type RadioOption, type RegisterFailure, type RegisterLabels, type ResetPasswordLabels, SaveStatus, type SaveStatusState, type Scale, SearchBar, type SearchBarCollapsible, type SearchResultCategory, SecretReveal, SegmentedControl, type SegmentedControlOption, type SegmentedControlSize, Select, type SelectOption, Skeleton, SkeletonList, type SkeletonListLeading, type SkeletonVariant, Slider, Sparkline, Spinner, type SpinnerSize, StatGrid, type StatGridColumns, StatTile, StatTileLink, type StatTileTrend, type StatTileTrendTone, Stepper, type StepperOrientation, type StepperStatus, type StepperStep, Switch, TOTP_QR_RENDERER, Tab, Table, type TableColumn, Tabs, Tag, TagInput, Textarea, type TimeTicks, type TimeUnit, TimelineChart, TimelineSeries, type ToastItem, type ToastVariant, Toaster, type ToasterPosition, Tooltip, type TooltipPoint, type TooltipPosition, type TooltipRow, type TotpEnrollment, TotpQr, type TotpQrLabels, type TotpQrRenderOptions, type TotpQrRenderer, Tree, type TreeNode, USERNAME_PATTERN, UserChip, type UserChipSize, type UsernameProblem, type WeekStartsOn, accountName, activationToken, arcPath, areaPath, bandScale, base64UrlToBuffer, bufferToBase64Url, classifyActivateFailure, classifyMfaFailure, classifyPasskeyError, classifyPasswordFailure, classifyRegisterFailure, computeInitials, copyToClipboard, createListToolbarState, createPasskeyCredential, emailProblem, formatBytes, formatCompact, formatDateTime, formatDuration, formatNumber, formatPercent, formatRelativeTime, getPasskeyAssertion, isAuthPortError, isTooManyPasskeys, linePath, linearScale, matchCommand, nearestIndex, niceTicks, niceXDomain, niceYDomain, passkeyNameProblem, passkeysSupported, passwordProblem, portErrorMessage, provideAuthLabels, selectContents, shortcutLabel, timeScale, timeTicks, usernameProblem };