@joanroucoux/cairn-ui 0.9.2 → 0.10.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 (75) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +2 -0
  3. package/fesm2022/joanroucoux-cairn-ui-action-bar.mjs +3 -3
  4. package/fesm2022/joanroucoux-cairn-ui-alert.mjs +3 -3
  5. package/fesm2022/joanroucoux-cairn-ui-amount.mjs +3 -3
  6. package/fesm2022/joanroucoux-cairn-ui-async.mjs +3 -3
  7. package/fesm2022/joanroucoux-cairn-ui-async.mjs.map +1 -1
  8. package/fesm2022/joanroucoux-cairn-ui-avatar.mjs +6 -6
  9. package/fesm2022/joanroucoux-cairn-ui-back-link.mjs +3 -3
  10. package/fesm2022/joanroucoux-cairn-ui-badge.mjs +3 -3
  11. package/fesm2022/joanroucoux-cairn-ui-button.mjs +3 -3
  12. package/fesm2022/joanroucoux-cairn-ui-card.mjs +3 -3
  13. package/fesm2022/joanroucoux-cairn-ui-choice-chips.mjs +3 -3
  14. package/fesm2022/joanroucoux-cairn-ui-choice-chips.mjs.map +1 -1
  15. package/fesm2022/joanroucoux-cairn-ui-delta.mjs +3 -3
  16. package/fesm2022/joanroucoux-cairn-ui-dialog.mjs +3 -3
  17. package/fesm2022/joanroucoux-cairn-ui-dialog.mjs.map +1 -1
  18. package/fesm2022/joanroucoux-cairn-ui-donut.mjs +7 -7
  19. package/fesm2022/joanroucoux-cairn-ui-donut.mjs.map +1 -1
  20. package/fesm2022/joanroucoux-cairn-ui-drawer.mjs +3 -3
  21. package/fesm2022/joanroucoux-cairn-ui-drawer.mjs.map +1 -1
  22. package/fesm2022/joanroucoux-cairn-ui-empty.mjs +3 -3
  23. package/fesm2022/joanroucoux-cairn-ui-empty.mjs.map +1 -1
  24. package/fesm2022/joanroucoux-cairn-ui-external-link.mjs +3 -3
  25. package/fesm2022/joanroucoux-cairn-ui-fact.mjs +6 -6
  26. package/fesm2022/joanroucoux-cairn-ui-fact.mjs.map +1 -1
  27. package/fesm2022/joanroucoux-cairn-ui-field.mjs +9 -9
  28. package/fesm2022/joanroucoux-cairn-ui-filter-chips.mjs +3 -3
  29. package/fesm2022/joanroucoux-cairn-ui-group-header.mjs +3 -3
  30. package/fesm2022/joanroucoux-cairn-ui-group-header.mjs.map +1 -1
  31. package/fesm2022/joanroucoux-cairn-ui-icon-toggle.mjs +43 -0
  32. package/fesm2022/joanroucoux-cairn-ui-icon-toggle.mjs.map +1 -0
  33. package/fesm2022/joanroucoux-cairn-ui-input.mjs +6 -6
  34. package/fesm2022/joanroucoux-cairn-ui-input.mjs.map +1 -1
  35. package/fesm2022/joanroucoux-cairn-ui-line-chart.mjs +3 -3
  36. package/fesm2022/joanroucoux-cairn-ui-menu.mjs +17 -10
  37. package/fesm2022/joanroucoux-cairn-ui-menu.mjs.map +1 -1
  38. package/fesm2022/joanroucoux-cairn-ui-meter.mjs +3 -3
  39. package/fesm2022/joanroucoux-cairn-ui-motion.mjs +12 -12
  40. package/fesm2022/joanroucoux-cairn-ui-nav-item.mjs +3 -3
  41. package/fesm2022/joanroucoux-cairn-ui-result-group.mjs +3 -3
  42. package/fesm2022/joanroucoux-cairn-ui-result-group.mjs.map +1 -1
  43. package/fesm2022/joanroucoux-cairn-ui-row.mjs +15 -15
  44. package/fesm2022/joanroucoux-cairn-ui-row.mjs.map +1 -1
  45. package/fesm2022/joanroucoux-cairn-ui-segmented.mjs +3 -3
  46. package/fesm2022/joanroucoux-cairn-ui-select-pill.mjs +3 -3
  47. package/fesm2022/joanroucoux-cairn-ui-select.mjs +3 -3
  48. package/fesm2022/joanroucoux-cairn-ui-skeleton.mjs +3 -3
  49. package/fesm2022/joanroucoux-cairn-ui-stale-link.mjs +3 -3
  50. package/fesm2022/joanroucoux-cairn-ui-stale-link.mjs.map +1 -1
  51. package/fesm2022/joanroucoux-cairn-ui-stat.mjs +3 -3
  52. package/fesm2022/joanroucoux-cairn-ui-switch.mjs +3 -3
  53. package/fesm2022/joanroucoux-cairn-ui-tab-bar.mjs +6 -6
  54. package/fesm2022/joanroucoux-cairn-ui-table.mjs +27 -27
  55. package/fesm2022/joanroucoux-cairn-ui-table.mjs.map +1 -1
  56. package/fesm2022/joanroucoux-cairn-ui-toast.mjs +7 -7
  57. package/fesm2022/joanroucoux-cairn-ui-toast.mjs.map +1 -1
  58. package/mcp-manifest.json +1 -0
  59. package/package.json +9 -2
  60. package/types/joanroucoux-cairn-ui-async.d.ts +3 -3
  61. package/types/joanroucoux-cairn-ui-choice-chips.d.ts +2 -2
  62. package/types/joanroucoux-cairn-ui-dialog.d.ts +3 -0
  63. package/types/joanroucoux-cairn-ui-donut.d.ts +1 -1
  64. package/types/joanroucoux-cairn-ui-drawer.d.ts +1 -1
  65. package/types/joanroucoux-cairn-ui-empty.d.ts +3 -3
  66. package/types/joanroucoux-cairn-ui-fact.d.ts +1 -1
  67. package/types/joanroucoux-cairn-ui-group-header.d.ts +1 -1
  68. package/types/joanroucoux-cairn-ui-icon-toggle.d.ts +13 -0
  69. package/types/joanroucoux-cairn-ui-input.d.ts +3 -0
  70. package/types/joanroucoux-cairn-ui-menu.d.ts +3 -3
  71. package/types/joanroucoux-cairn-ui-result-group.d.ts +3 -3
  72. package/types/joanroucoux-cairn-ui-row.d.ts +1 -1
  73. package/types/joanroucoux-cairn-ui-stale-link.d.ts +2 -2
  74. package/types/joanroucoux-cairn-ui-table.d.ts +16 -6
  75. package/types/joanroucoux-cairn-ui-toast.d.ts +3 -3
@@ -19,7 +19,7 @@ var UiGroupHeader = class UiGroupHeader {
19
19
  }
20
20
  static ɵfac = i0.ɵɵngDeclareFactory({
21
21
  minVersion: "12.0.0",
22
- version: "22.2.0",
22
+ version: "22.2.1",
23
23
  ngImport: i0,
24
24
  type: UiGroupHeader,
25
25
  deps: [],
@@ -27,7 +27,7 @@ var UiGroupHeader = class UiGroupHeader {
27
27
  });
28
28
  static ɵcmp = i0.ɵɵngDeclareComponent({
29
29
  minVersion: "17.0.0",
30
- version: "22.2.0",
30
+ version: "22.2.1",
31
31
  type: UiGroupHeader,
32
32
  isStandalone: true,
33
33
  selector: "ui-group-header",
@@ -146,7 +146,7 @@ var UiGroupHeader = class UiGroupHeader {
146
146
  };
147
147
  i0.ɵɵngDeclareClassMetadata({
148
148
  minVersion: "12.0.0",
149
- version: "22.2.0",
149
+ version: "22.2.1",
150
150
  ngImport: i0,
151
151
  type: UiGroupHeader,
152
152
  decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"joanroucoux-cairn-ui-group-header.mjs","names":[],"sources":["../../../projects/ui/group-header/group-header.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport { Component, booleanAttribute, input, model } from '@angular/core';\n\n/**\n * Header of a card on a phone: the name, its meta underneath, the projected total on the right.\n *\n * With `collapsible` the header is a button inside the heading, with a chevron that turns when the\n * group is folded and a press scale. `expanded` is a model: the page keeps the fold memory and hides\n * the card body itself. `toggleDisabled` keeps the button focusable and announced, but a click\n * changes nothing (a filter holds the group open). `controls` is the id of the body it folds.\n *\n * @example\n * <ui-group-header name=\"Northwind PEA\" meta=\"PEA · 3 lignes\" collapsible [(expanded)]=\"open\">\n * <ui-amount [value]=\"total\" />\n * </ui-group-header>\n */\n@Component({\n selector: 'ui-group-header',\n imports: [NgTemplateOutlet],\n host: { class: 'block' },\n template: `\n <ng-template #total><ng-content /></ng-template>\n @if (collapsible()) {\n <h2 class=\"m-0 font-normal\">\n <button\n class=\"rounded-control flex min-h-11 w-full items-end justify-between gap-3 px-1 pt-3 text-left transition-transform [transition-duration:var(--duration-press)] ease-out not-aria-disabled:cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) not-aria-disabled:active:scale-(--press-scale)\"\n type=\"button\"\n [attr.aria-controls]=\"controls() || null\"\n [attr.aria-disabled]=\"toggleDisabled() ? 'true' : null\"\n [attr.aria-expanded]=\"expanded()\"\n (click)=\"toggle()\"\n >\n <span class=\"flex min-w-0 items-center gap-2\">\n <svg\n aria-hidden=\"true\"\n class=\"flex-none stroke-(--muted-foreground) transition-transform duration-(--duration-fast) ease-out\"\n fill=\"none\"\n height=\"20\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.75\"\n viewBox=\"0 0 24 24\"\n width=\"20\"\n [class.-rotate-90]=\"!expanded()\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n <span class=\"flex min-w-0 flex-col\">\n <span class=\"text-title font-semibold\">{{ name() }}</span>\n @if (meta()) {\n <span class=\"text-label text-(--muted-foreground)\">{{ meta() }}</span>\n }\n </span>\n </span>\n <span class=\"text-title font-semibold whitespace-nowrap tabular-nums\">\n <ng-container [ngTemplateOutlet]=\"total\" />\n </span>\n </button>\n </h2>\n } @else {\n <div class=\"flex min-h-11 w-full items-end justify-between gap-3 px-1 pt-3\">\n <div class=\"flex min-w-0 flex-col\">\n <h2 class=\"text-title m-0 font-semibold\">{{ name() }}</h2>\n @if (meta()) {\n <span class=\"text-label text-(--muted-foreground)\">{{ meta() }}</span>\n }\n </div>\n <span class=\"text-title font-semibold whitespace-nowrap tabular-nums\">\n <ng-container [ngTemplateOutlet]=\"total\" />\n </span>\n </div>\n }\n `,\n})\nexport class UiGroupHeader {\n readonly name = input.required<string>();\n readonly meta = input<string>();\n readonly collapsible = input(false, { transform: booleanAttribute });\n readonly expanded = model(true);\n readonly toggleDisabled = input(false, { transform: booleanAttribute });\n readonly controls = input<string>();\n\n protected toggle(): void {\n if (!this.toggleDisabled()) {\n this.expanded.update((expanded) => !expanded);\n }\n }\n}\n"],"mappings":";;;AA0EA,IAAa,gBAAb,MAAa,cAAa;CACf,OAAO,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,OAAO,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACtB,cAAc,MAAM,OA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QAAA;EAAA,UAAA;EAAA,UAtDd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDT,UAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MAtDS;GAAgB,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;GAAA;EAAA,CAAA;CAAA,CAAA;;AAwDf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EA1DzB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,SAAS,CAAC,gBAAgB;GAC1B,MAAM,EAAE,OAAO,QAAO;GACtB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDX,CAAA"}
1
+ {"version":3,"file":"joanroucoux-cairn-ui-group-header.mjs","names":[],"sources":["../../../projects/ui/group-header/group-header.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport { Component, booleanAttribute, input, model } from '@angular/core';\n\n/**\n * Header of a card on a phone: the name, its meta underneath, the projected total on the right.\n *\n * With `collapsible` the header is a button inside the heading, with a chevron that turns when the\n * group is folded and a press scale. `expanded` is a model: the page keeps the fold memory and hides\n * the card body itself. `toggleDisabled` keeps the button focusable and announced, but a click\n * changes nothing (a filter holds the group open). `controls` is the id of the body it folds.\n *\n * @example\n * <ui-group-header name=\"Northwind PEA\" meta=\"PEA · 3 holdings\" collapsible [(expanded)]=\"open\">\n * <ui-amount [value]=\"total\" />\n * </ui-group-header>\n */\n@Component({\n selector: 'ui-group-header',\n imports: [NgTemplateOutlet],\n host: { class: 'block' },\n template: `\n <ng-template #total><ng-content /></ng-template>\n @if (collapsible()) {\n <h2 class=\"m-0 font-normal\">\n <button\n class=\"rounded-control flex min-h-11 w-full items-end justify-between gap-3 px-1 pt-3 text-left transition-transform [transition-duration:var(--duration-press)] ease-out not-aria-disabled:cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) not-aria-disabled:active:scale-(--press-scale)\"\n type=\"button\"\n [attr.aria-controls]=\"controls() || null\"\n [attr.aria-disabled]=\"toggleDisabled() ? 'true' : null\"\n [attr.aria-expanded]=\"expanded()\"\n (click)=\"toggle()\"\n >\n <span class=\"flex min-w-0 items-center gap-2\">\n <svg\n aria-hidden=\"true\"\n class=\"flex-none stroke-(--muted-foreground) transition-transform duration-(--duration-fast) ease-out\"\n fill=\"none\"\n height=\"20\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.75\"\n viewBox=\"0 0 24 24\"\n width=\"20\"\n [class.-rotate-90]=\"!expanded()\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n <span class=\"flex min-w-0 flex-col\">\n <span class=\"text-title font-semibold\">{{ name() }}</span>\n @if (meta()) {\n <span class=\"text-label text-(--muted-foreground)\">{{ meta() }}</span>\n }\n </span>\n </span>\n <span class=\"text-title font-semibold whitespace-nowrap tabular-nums\">\n <ng-container [ngTemplateOutlet]=\"total\" />\n </span>\n </button>\n </h2>\n } @else {\n <div class=\"flex min-h-11 w-full items-end justify-between gap-3 px-1 pt-3\">\n <div class=\"flex min-w-0 flex-col\">\n <h2 class=\"text-title m-0 font-semibold\">{{ name() }}</h2>\n @if (meta()) {\n <span class=\"text-label text-(--muted-foreground)\">{{ meta() }}</span>\n }\n </div>\n <span class=\"text-title font-semibold whitespace-nowrap tabular-nums\">\n <ng-container [ngTemplateOutlet]=\"total\" />\n </span>\n </div>\n }\n `,\n})\nexport class UiGroupHeader {\n readonly name = input.required<string>();\n readonly meta = input<string>();\n readonly collapsible = input(false, { transform: booleanAttribute });\n readonly expanded = model(true);\n readonly toggleDisabled = input(false, { transform: booleanAttribute });\n readonly controls = input<string>();\n\n protected toggle(): void {\n if (!this.toggleDisabled()) {\n this.expanded.update((expanded) => !expanded);\n }\n }\n}\n"],"mappings":";;;AA0EA,IAAa,gBAAb,MAAa,cAAa;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YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA,EAAA,UAAA,iBAAA;EAAA,MAAA,EAAA,gBAAA,QAAA;EAAA,UAAA;EAAA,UAtDd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDT,UAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MAtDS;GAAgB,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;GAAA;EAAA,CAAA;CAAA,CAAA;;AAwDf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EA1DzB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,SAAS,CAAC,gBAAgB;GAC1B,MAAM,EAAE,OAAO,QAAO;GACtB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDX,CAAA"}
@@ -0,0 +1,43 @@
1
+ import * as i0 from "@angular/core";
2
+ import { Directive } from "@angular/core";
3
+ var UiIconToggle = class UiIconToggle {
4
+ static ɵfac = i0.ɵɵngDeclareFactory({
5
+ minVersion: "12.0.0",
6
+ version: "22.2.1",
7
+ ngImport: i0,
8
+ type: UiIconToggle,
9
+ deps: [],
10
+ target: i0.ɵɵFactoryTarget.Directive
11
+ });
12
+ static ɵdir = i0.ɵɵngDeclareDirective({
13
+ minVersion: "14.0.0",
14
+ version: "22.2.1",
15
+ type: UiIconToggle,
16
+ isStandalone: true,
17
+ selector: "button[uiIconToggle]",
18
+ host: {
19
+ attributes: { "type": "button" },
20
+ classAttribute: "rounded-pill grid size-11 lg:size-10 place-items-center text-(--foreground) cursor-pointer select-none touch-manipulation transition-[scale] duration-(--duration-press) ease-out pointer-fine:hover:bg-(--glow) aria-pressed:bg-[image:linear-gradient(var(--soft),var(--soft))] active:scale-(--press-scale) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)"
21
+ },
22
+ ngImport: i0
23
+ });
24
+ };
25
+ i0.ɵɵngDeclareClassMetadata({
26
+ minVersion: "12.0.0",
27
+ version: "22.2.1",
28
+ ngImport: i0,
29
+ type: UiIconToggle,
30
+ decorators: [{
31
+ type: Directive,
32
+ args: [{
33
+ selector: "button[uiIconToggle]",
34
+ host: {
35
+ type: "button",
36
+ class: "rounded-pill grid size-11 lg:size-10 place-items-center text-(--foreground) cursor-pointer select-none touch-manipulation transition-[scale] duration-(--duration-press) ease-out pointer-fine:hover:bg-(--glow) aria-pressed:bg-[image:linear-gradient(var(--soft),var(--soft))] active:scale-(--press-scale) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)"
37
+ }
38
+ }]
39
+ }]
40
+ });
41
+ export { UiIconToggle };
42
+
43
+ //# sourceMappingURL=joanroucoux-cairn-ui-icon-toggle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joanroucoux-cairn-ui-icon-toggle.mjs","names":[],"sources":["../../../projects/ui/icon-toggle/icon-toggle.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\n/**\n * Round icon button that switches something on and off, such as the header eye that hides the amounts.\n * The state lives in `aria-pressed`, which also draws the soft fill. Only the press scale transitions:\n * the fill changes at once.\n *\n * @example\n * <button uiIconToggle aria-label=\"Hide amounts\" [attr.aria-pressed]=\"hidden\"><svg>...</svg></button>\n */\n@Directive({\n selector: 'button[uiIconToggle]',\n host: {\n type: 'button',\n class:\n 'rounded-pill grid size-11 lg:size-10 place-items-center text-(--foreground) cursor-pointer select-none touch-manipulation transition-[scale] duration-(--duration-press) ease-out pointer-fine:hover:bg-(--glow) aria-pressed:bg-[image:linear-gradient(var(--soft),var(--soft))] active:scale-(--press-scale) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)',\n },\n})\nexport class UiIconToggle {}\n"],"mappings":";;AAkBA,IAAa,eAAb,MAAa,aAAY;CAAZ,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAY,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAZ,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAY,cAAA;EAAA,UAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,SAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAZ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EARxB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM;IACJ,MAAM;IACN,OACE;GACH;EACF,CAAA"}
@@ -28,7 +28,7 @@ var UiInput = class UiInput {
28
28
  classes = computed(() => `${CONTROL_BASE_CLASSES} ${SEARCH_CLASSES} ${CONTROL_SURFACE_CLASSES[this.surface()]} ${CONTROL_SIZE_CLASSES[this.size()]}`, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
29
29
  static ɵfac = i0.ɵɵngDeclareFactory({
30
30
  minVersion: "12.0.0",
31
- version: "22.2.0",
31
+ version: "22.2.1",
32
32
  ngImport: i0,
33
33
  type: UiInput,
34
34
  deps: [],
@@ -36,7 +36,7 @@ var UiInput = class UiInput {
36
36
  });
37
37
  static ɵdir = i0.ɵɵngDeclareDirective({
38
38
  minVersion: "17.1.0",
39
- version: "22.2.0",
39
+ version: "22.2.1",
40
40
  type: UiInput,
41
41
  isStandalone: true,
42
42
  selector: "input[uiInput]",
@@ -80,7 +80,7 @@ var UiInput = class UiInput {
80
80
  };
81
81
  i0.ɵɵngDeclareClassMetadata({
82
82
  minVersion: "12.0.0",
83
- version: "22.2.0",
83
+ version: "22.2.1",
84
84
  ngImport: i0,
85
85
  type: UiInput,
86
86
  decorators: [{
@@ -134,7 +134,7 @@ var UiTextarea = class UiTextarea {
134
134
  touched = input(false, ...ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []);
135
135
  static ɵfac = i0.ɵɵngDeclareFactory({
136
136
  minVersion: "12.0.0",
137
- version: "22.2.0",
137
+ version: "22.2.1",
138
138
  ngImport: i0,
139
139
  type: UiTextarea,
140
140
  deps: [],
@@ -142,7 +142,7 @@ var UiTextarea = class UiTextarea {
142
142
  });
143
143
  static ɵdir = i0.ɵɵngDeclareDirective({
144
144
  minVersion: "17.1.0",
145
- version: "22.2.0",
145
+ version: "22.2.1",
146
146
  type: UiTextarea,
147
147
  isStandalone: true,
148
148
  selector: "textarea[uiTextarea]",
@@ -172,7 +172,7 @@ var UiTextarea = class UiTextarea {
172
172
  };
173
173
  i0.ɵɵngDeclareClassMetadata({
174
174
  minVersion: "12.0.0",
175
- version: "22.2.0",
175
+ version: "22.2.1",
176
176
  ngImport: i0,
177
177
  type: UiTextarea,
178
178
  decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"joanroucoux-cairn-ui-input.mjs","names":[],"sources":["../../../projects/ui/input/input.ts"],"sourcesContent":["import { Directive, computed, forwardRef, input } from '@angular/core';\n\nimport { UI_CONTROL, type UiControl, type UiControlError } from '@joanroucoux/cairn-ui/control';\n\n/** Available control sizes. */\nexport const CONTROL_SIZES = ['sm', 'md', 'lg', 'xl'] as const;\nexport type ControlSize = (typeof CONTROL_SIZES)[number];\n\nexport const CONTROL_BASE_CLASSES =\n 'w-full rounded-control px-3 text-body text-(--foreground) shadow-[inset_0_0_0_1px_var(--border)] placeholder:text-(--muted-foreground) focus-visible:shadow-[inset_0_0_0_2px_var(--ring)] aria-invalid:shadow-[inset_0_0_0_2px_var(--negative)] disabled:cursor-not-allowed disabled:opacity-50';\n\nexport const CONTROL_SURFACES = ['background', 'card'] as const;\nexport type ControlSurface = (typeof CONTROL_SURFACES)[number];\n\nexport const CONTROL_SURFACE_CLASSES: Record<ControlSurface, string> = {\n background: 'bg-(--background)',\n card: 'bg-(--card)',\n};\n\nexport const CONTROL_SIZE_CLASSES: Record<ControlSize, string> = {\n sm: 'h-9',\n md: 'min-h-(--row-min)',\n lg: 'min-h-12 lg:min-h-(--row-min)',\n xl: 'h-12 lg:h-11',\n};\n\nconst SEARCH_CLASSES = '[&::-webkit-search-cancel-button]:appearance-none';\n\n/**\n * Styled native text input. The host stays a plain `<input>`, so every forms flavor and native\n * attribute keeps working. Declares the `errors` and `touched` inputs Angular's `[formField]` fills,\n * so a surrounding `ui-field` can show the message.\n *\n * @example\n * <input uiInput type=\"email\" placeholder=\"you@example.com\" />\n */\n@Directive({\n selector: 'input[uiInput]',\n host: {\n '[class]': 'classes()',\n },\n providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiInput) }],\n})\nexport class UiInput implements UiControl {\n readonly size = input<ControlSize>('md');\n readonly surface = input<ControlSurface>('background');\n readonly errors = input<readonly UiControlError[]>([]);\n readonly touched = input(false);\n\n protected readonly classes = computed(\n () =>\n `${CONTROL_BASE_CLASSES} ${SEARCH_CLASSES} ${CONTROL_SURFACE_CLASSES[this.surface()]} ${CONTROL_SIZE_CLASSES[this.size()]}`,\n );\n}\n\n/**\n * Styled native textarea. It takes no size: it grows from a minimum height. Declares the `errors`\n * and `touched` inputs Angular's `[formField]` fills, so a surrounding `ui-field` can show the message.\n *\n * @example\n * <textarea uiTextarea maxlength=\"280\"></textarea>\n */\n@Directive({\n selector: 'textarea[uiTextarea]',\n host: {\n class: `${CONTROL_BASE_CLASSES} bg-(--background) min-h-24 py-2`,\n },\n providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiTextarea) }],\n})\nexport class UiTextarea implements UiControl {\n readonly errors = input<readonly UiControlError[]>([]);\n readonly touched = input(false);\n}\n"],"mappings":";;;AAKA,MAAa,gBAAgB;CAAC;CAAM;CAAM;CAAM;AAAI;AAGpD,MAAa,uBACX;AAEF,MAAa,mBAAmB,CAAC,cAAc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CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAU,YAAA,CAAA;EAPtB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM,EACJ,OAAO,GAAG,qBAAoB,kCAC/B;GACD,WAAW,CAAC;IAAE,SAAS;IAAY,aAAa,iBAAgB,UAAW;GAAC,CAAE;EAC/E,CAAA"}
1
+ {"version":3,"file":"joanroucoux-cairn-ui-input.mjs","names":[],"sources":["../../../projects/ui/input/input.ts"],"sourcesContent":["import { Directive, computed, forwardRef, input } from '@angular/core';\n\nimport { UI_CONTROL, type UiControl, type UiControlError } from '@joanroucoux/cairn-ui/control';\n\n/** Available control sizes. */\nexport const CONTROL_SIZES = ['sm', 'md', 'lg', 'xl'] as const;\nexport type ControlSize = (typeof CONTROL_SIZES)[number];\n\n/** @internal Shared with `select` and `choice-chips`. */\nexport const CONTROL_BASE_CLASSES =\n 'w-full rounded-control px-3 text-body text-(--foreground) shadow-[inset_0_0_0_1px_var(--border)] placeholder:text-(--muted-foreground) focus-visible:shadow-[inset_0_0_0_2px_var(--ring)] aria-invalid:shadow-[inset_0_0_0_2px_var(--negative)] disabled:cursor-not-allowed disabled:opacity-50';\n\nexport const CONTROL_SURFACES = ['background', 'card'] as const;\nexport type ControlSurface = (typeof CONTROL_SURFACES)[number];\n\n/** @internal Shared with `select` and `choice-chips`. */\nexport const CONTROL_SURFACE_CLASSES: Record<ControlSurface, string> = {\n background: 'bg-(--background)',\n card: 'bg-(--card)',\n};\n\n/** @internal Shared with `select` and `choice-chips`. */\nexport const CONTROL_SIZE_CLASSES: Record<ControlSize, string> = {\n sm: 'h-9',\n md: 'min-h-(--row-min)',\n lg: 'min-h-12 lg:min-h-(--row-min)',\n xl: 'h-12 lg:h-11',\n};\n\nconst SEARCH_CLASSES = '[&::-webkit-search-cancel-button]:appearance-none';\n\n/**\n * Styled native text input. The host stays a plain `<input>`, so every forms flavor and native\n * attribute keeps working. Declares the `errors` and `touched` inputs Angular's `[formField]` fills,\n * so a surrounding `ui-field` can show the message.\n *\n * @example\n * <input uiInput type=\"email\" placeholder=\"you@example.com\" />\n */\n@Directive({\n selector: 'input[uiInput]',\n host: {\n '[class]': 'classes()',\n },\n providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiInput) }],\n})\nexport class UiInput implements UiControl {\n readonly size = input<ControlSize>('md');\n readonly surface = input<ControlSurface>('background');\n readonly errors = input<readonly UiControlError[]>([]);\n readonly touched = input(false);\n\n protected readonly classes = computed(\n () =>\n `${CONTROL_BASE_CLASSES} ${SEARCH_CLASSES} ${CONTROL_SURFACE_CLASSES[this.surface()]} ${CONTROL_SIZE_CLASSES[this.size()]}`,\n );\n}\n\n/**\n * Styled native textarea. It takes no size: it grows from a minimum height. Declares the `errors`\n * and `touched` inputs Angular's `[formField]` fills, so a surrounding `ui-field` can show the message.\n *\n * @example\n * <textarea uiTextarea maxlength=\"280\"></textarea>\n */\n@Directive({\n selector: 'textarea[uiTextarea]',\n host: {\n class: `${CONTROL_BASE_CLASSES} bg-(--background) min-h-24 py-2`,\n },\n providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiTextarea) }],\n})\nexport class UiTextarea implements UiControl {\n readonly errors = input<readonly UiControlError[]>([]);\n readonly touched = input(false);\n}\n"],"mappings":";;;AAKA,MAAa,gBAAgB;CAAC;CAAM;CAAM;CAAM;AAAI;AAIpD,MAAa,uBACX;AAEF,MAAa,mBAAmB,CAAC,cAAc,MAAM;AAIrD,MAAa,0BAA0D;CACrE,YAAY;CACZ,MAAM;AACP;AAGD,MAAa,uBAAoD;CAC/D,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACL;AAED,MAAM,iBAAiB;AAiBvB,IAAa,UAAb,MAAa,QAAO;CACT,OAAO,MAAmB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,UAAU,MAAsB,cAAa,GAAA,YAAA,CAAA,EAAA,WAAA,U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  minVersion: "12.0.0",
553
- version: "22.2.0",
553
+ version: "22.2.1",
554
554
  ngImport: i0,
555
555
  type: UiLineChart,
556
556
  deps: [],
@@ -558,7 +558,7 @@ var UiLineChart = class UiLineChart {
558
558
  });
559
559
  static ɵcmp = i0.ɵɵngDeclareComponent({
560
560
  minVersion: "17.0.0",
561
- version: "22.2.0",
561
+ version: "22.2.1",
562
562
  type: UiLineChart,
563
563
  isStandalone: true,
564
564
  selector: "ui-line-chart",
@@ -858,7 +858,7 @@ var UiLineChart = class UiLineChart {
858
858
  };
859
859
  i0.ɵɵngDeclareClassMetadata({
860
860
  minVersion: "12.0.0",
861
- version: "22.2.0",
861
+ version: "22.2.1",
862
862
  ngImport: i0,
863
863
  type: UiLineChart,
864
864
  decorators: [{
@@ -30,7 +30,7 @@ var UiMenuItem = class UiMenuItem {
30
30
  }
31
31
  static ɵfac = i0.ɵɵngDeclareFactory({
32
32
  minVersion: "12.0.0",
33
- version: "22.2.0",
33
+ version: "22.2.1",
34
34
  ngImport: i0,
35
35
  type: UiMenuItem,
36
36
  deps: [],
@@ -38,7 +38,7 @@ var UiMenuItem = class UiMenuItem {
38
38
  });
39
39
  static ɵdir = i0.ɵɵngDeclareDirective({
40
40
  minVersion: "17.1.0",
41
- version: "22.2.0",
41
+ version: "22.2.1",
42
42
  type: UiMenuItem,
43
43
  isStandalone: true,
44
44
  selector: "button[uiMenuItem]",
@@ -72,7 +72,7 @@ var UiMenuItem = class UiMenuItem {
72
72
  };
73
73
  i0.ɵɵngDeclareClassMetadata({
74
74
  minVersion: "12.0.0",
75
- version: "22.2.0",
75
+ version: "22.2.1",
76
76
  ngImport: i0,
77
77
  type: UiMenuItem,
78
78
  decorators: [{
@@ -184,11 +184,18 @@ var UiMenu = class UiMenu {
184
184
  #isSheet() {
185
185
  return this.sheet() && typeof window.matchMedia === "function" && !window.matchMedia("(min-width: 64rem)").matches;
186
186
  }
187
+ #layoutWidth() {
188
+ const style = getComputedStyle(this.#host);
189
+ const width = parseFloat(style.width);
190
+ if (Number.isNaN(width)) return this.#host.offsetWidth;
191
+ if (style.boxSizing === "border-box") return width;
192
+ return width + parseFloat(style.paddingLeft) + parseFloat(style.paddingRight) + parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);
193
+ }
187
194
  #position(trigger) {
188
195
  const margin = 8;
189
196
  const triggerRect = trigger.getBoundingClientRect();
190
197
  const menuRect = {
191
- width: this.#host.offsetWidth,
198
+ width: this.#layoutWidth(),
192
199
  height: this.#host.offsetHeight
193
200
  };
194
201
  const fitsBelow = window.innerHeight - triggerRect.bottom >= menuRect.height + margin;
@@ -203,7 +210,7 @@ var UiMenu = class UiMenu {
203
210
  }
204
211
  static ɵfac = i0.ɵɵngDeclareFactory({
205
212
  minVersion: "12.0.0",
206
- version: "22.2.0",
213
+ version: "22.2.1",
207
214
  ngImport: i0,
208
215
  type: UiMenu,
209
216
  deps: [],
@@ -211,7 +218,7 @@ var UiMenu = class UiMenu {
211
218
  });
212
219
  static ɵcmp = i0.ɵɵngDeclareComponent({
213
220
  minVersion: "17.0.0",
214
- version: "22.2.0",
221
+ version: "22.2.1",
215
222
  type: UiMenu,
216
223
  isStandalone: true,
217
224
  selector: "ui-menu",
@@ -280,7 +287,7 @@ var UiMenu = class UiMenu {
280
287
  };
281
288
  i0.ɵɵngDeclareClassMetadata({
282
289
  minVersion: "12.0.0",
283
- version: "22.2.0",
290
+ version: "22.2.1",
284
291
  ngImport: i0,
285
292
  type: UiMenu,
286
293
  decorators: [{
@@ -356,7 +363,7 @@ var UiMenuTrigger = class UiMenuTrigger {
356
363
  }
357
364
  static ɵfac = i0.ɵɵngDeclareFactory({
358
365
  minVersion: "12.0.0",
359
- version: "22.2.0",
366
+ version: "22.2.1",
360
367
  ngImport: i0,
361
368
  type: UiMenuTrigger,
362
369
  deps: [],
@@ -364,7 +371,7 @@ var UiMenuTrigger = class UiMenuTrigger {
364
371
  });
365
372
  static ɵdir = i0.ɵɵngDeclareDirective({
366
373
  minVersion: "17.1.0",
367
- version: "22.2.0",
374
+ version: "22.2.1",
368
375
  type: UiMenuTrigger,
369
376
  isStandalone: true,
370
377
  selector: "[uiMenuTrigger]",
@@ -388,7 +395,7 @@ var UiMenuTrigger = class UiMenuTrigger {
388
395
  };
389
396
  i0.ɵɵngDeclareClassMetadata({
390
397
  minVersion: "12.0.0",
391
- version: "22.2.0",
398
+ version: "22.2.1",
392
399
  ngImport: i0,
393
400
  type: UiMenuTrigger,
394
401
  decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"joanroucoux-cairn-ui-menu.mjs","names":[],"sources":["../../../projects/ui/menu/menu.ts"],"sourcesContent":["import {\n Component,\n Directive,\n ElementRef,\n booleanAttribute,\n computed,\n contentChildren,\n inject,\n input,\n numberAttribute,\n signal,\n} from '@angular/core';\n\nconst MENU_CLASSES =\n 'm-0 min-w-44 p-1 rounded-container bg-(--elevated) shadow-[0_8px_24px_rgb(0_0_0/0.16),inset_0_0_0_1px_var(--border)] text-(--foreground) transition-[opacity,scale,overlay,display] transition-discrete duration-(--duration-fast) not-open:duration-[120ms] ease-out starting:open:opacity-0 starting:open:scale-(--enter-scale) opacity-0 scale-(--enter-scale) open:opacity-100 open:scale-100';\n\nconst SHEET_CLASSES =\n 'max-lg:fixed max-lg:inset-x-4 max-lg:top-auto max-lg:w-auto max-lg:bottom-[calc(76px+env(safe-area-inset-bottom))] max-lg:min-w-0 max-lg:p-1.5 max-lg:bg-(--card) max-lg:shadow-[0_12px_32px_rgb(0_0_0/0.2),inset_0_0_0_1px_var(--border)] max-lg:backdrop:bg-[rgb(0_0_0/0.36)] max-lg:transition-[opacity,translate,overlay,display] max-lg:scale-100 max-lg:translate-y-4 max-lg:open:translate-y-0 max-lg:starting:open:scale-100 max-lg:starting:open:translate-y-4 max-lg:motion-reduce:translate-y-0 max-lg:motion-reduce:starting:open:translate-y-0';\n\nconst SHEET_ITEM_CLASSES =\n 'flex w-full items-center gap-3 lg:pointer-fine:gap-2.5 min-h-12 lg:min-h-11 lg:pointer-fine:min-h-9 px-3 lg:pointer-fine:px-2.5 rounded-[calc(var(--radius-container)-6px)] lg:rounded-[calc(var(--radius-container)-4px)] text-body lg:pointer-fine:text-label text-left whitespace-nowrap hover:bg-(--glow) focus-visible:bg-(--glow) active:bg-(--soft) transition-[background-color] duration-(--duration-fast) ease-out outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--ring) [:where(&>svg)]:size-5 [:where(&>svg)]:flex-none lg:[:where(&>svg)]:size-[18px] lg:pointer-fine:[:where(&>svg)]:size-4';\n\nconst ITEM_CLASSES =\n 'flex w-full items-center gap-3 pointer-fine:gap-2.5 min-h-11 pointer-fine:min-h-9 px-3 pointer-fine:px-2.5 rounded-[calc(var(--radius-container)-4px)] text-body pointer-fine:text-label text-left whitespace-nowrap hover:bg-(--glow) focus-visible:bg-(--glow) active:bg-(--soft) transition-[background-color] duration-(--duration-fast) ease-out outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--ring) [:where(&>svg)]:size-[18px] [:where(&>svg)]:flex-none pointer-fine:[:where(&>svg)]:size-4';\n\nconst CHECK_CLASSES =\n \"after:ms-auto after:block after:h-3 after:w-1.5 after:flex-none after:rotate-45 after:border-r-2 after:border-b-2 after:border-current after:content-['']\";\n\nconst nextId = (() => {\n let count = 0;\n\n return () => `ui-menu-${++count}`;\n})();\n\n/**\n * One action of a `ui-menu`; `destructive` paints it in `--negative`. Giving it `checked` makes it a radio\n * choice (`menuitemradio`): the current one carries a check mark and `aria-checked=\"true\"`.\n *\n * @example\n * <button uiMenuItem destructive (click)=\"remove()\">Delete the line</button>\n * <button uiMenuItem [checked]=\"account() === 'pea'\" (click)=\"account.set('pea')\">Northwind PEA</button>\n */\n@Directive({\n selector: 'button[uiMenuItem]',\n host: {\n '[attr.role]': 'role()',\n '[attr.aria-checked]': 'checked() === undefined ? null : checked()',\n tabindex: '-1',\n '[class]': 'classes()',\n '(click)': 'onClick()',\n },\n})\nexport class UiMenuItem {\n readonly destructive = input(false, { transform: booleanAttribute });\n readonly checked = input<boolean>();\n\n readonly #host = inject<ElementRef<HTMLButtonElement>>(ElementRef).nativeElement;\n readonly #menu = inject(UiMenu);\n\n protected readonly role = computed(() => (this.checked() === undefined ? 'menuitem' : 'menuitemradio'));\n\n protected readonly classes = computed(\n () =>\n `${this.#menu.sheet() ? SHEET_ITEM_CLASSES : ITEM_CLASSES}${this.destructive() ? ' text-(--negative)' : ''}${this.checked() ? ` ${CHECK_CLASSES}` : ''}`,\n );\n\n focus(): void {\n this.#host.focus();\n }\n\n hasFocus(): boolean {\n return this.#host === document.activeElement;\n }\n\n protected onClick(): void {\n this.#menu.close();\n }\n}\n\n/**\n * Secondary actions menu, opened from its trigger through the native Popover API. With `sheet`, below\n * 64rem it opens as a bottom action sheet instead of beside its trigger, and `heading` names what\n * the actions apply to. `width` fixes the popover width in pixels; without it the menu fits its content.\n *\n * @example\n * <button ui-button size=\"icon\" aria-label=\"More\" [uiMenuTrigger]=\"menu\">...</button>\n * <ui-menu #menu label=\"Line actions\">\n * <button uiMenuItem (click)=\"edit()\">Edit</button>\n * <button uiMenuItem destructive (click)=\"remove()\">Delete the line</button>\n * </ui-menu>\n */\n@Component({\n selector: 'ui-menu',\n template: `\n @if (sheet() && heading()) {\n <div aria-hidden=\"true\" class=\"text-label px-3 pt-2 pb-1.5 leading-[17px] text-(--muted-foreground) lg:hidden\">\n {{ heading() }}\n </div>\n }\n <ng-content />\n `,\n host: {\n role: 'menu',\n popover: 'auto',\n '[id]': 'menuId',\n '[style.--ui-menu-width]': 'widthVar()',\n '[class]': 'classes()',\n '[attr.aria-label]': 'label()',\n '(toggle)': 'onToggle($event)',\n '(keydown)': 'onKeydown($event)',\n },\n})\nexport class UiMenu {\n readonly label = input.required<string>();\n readonly sheet = input(false, { transform: booleanAttribute });\n readonly heading = input<string>();\n readonly width = input<number | undefined, unknown>(undefined, { transform: numberAttribute });\n\n readonly menuId = nextId();\n readonly isOpen = signal(false);\n\n protected readonly hasWidth = computed(() => Number.isFinite(this.width()));\n protected readonly widthVar = computed(() => (this.hasWidth() ? `${this.width()}px` : null));\n protected readonly classes = computed(() => {\n const width = !this.hasWidth() ? '' : this.sheet() ? ' lg:w-(--ui-menu-width)' : ' w-(--ui-menu-width)';\n return `${MENU_CLASSES}${this.sheet() ? ` ${SHEET_CLASSES}` : ''}${width}`;\n });\n protected readonly items = contentChildren(UiMenuItem);\n\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n #trigger: HTMLElement | null = null;\n\n open(trigger: HTMLElement): void {\n this.#trigger = trigger;\n this.isOpen.set(true);\n if (typeof this.#host.showPopover === 'function') {\n this.#host.showPopover();\n }\n if (this.#isSheet()) {\n this.#host.style.position = '';\n this.#host.style.top = '';\n this.#host.style.left = '';\n this.#host.style.right = '';\n this.#host.style.bottom = '';\n } else {\n this.#position(trigger);\n }\n (this.items().find((item) => item.checked()) ?? this.items()[0])?.focus();\n }\n\n close(): void {\n const wasOpen = this.isOpen();\n\n this.#applyClosed();\n\n if (wasOpen && typeof this.#host.hidePopover === 'function') {\n this.#host.hidePopover();\n }\n }\n\n #applyClosed(): void {\n this.isOpen.set(false);\n this.#trigger?.focus();\n this.#trigger = null;\n }\n\n protected onToggle(event: Event): void {\n if ((event as ToggleEvent).newState === 'closed') {\n this.#applyClosed();\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Tab' || event.key === 'Escape') {\n event.preventDefault();\n this.close();\n return;\n }\n\n const items = this.items();\n const currentIndex = items.findIndex((item) => item.hasFocus());\n const lastIndex = items.length - 1;\n\n let nextIndex: number | undefined;\n switch (event.key) {\n case 'ArrowDown':\n nextIndex = currentIndex >= lastIndex ? 0 : currentIndex + 1;\n break;\n case 'ArrowUp':\n nextIndex = currentIndex <= 0 ? lastIndex : currentIndex - 1;\n break;\n case 'Home':\n nextIndex = 0;\n break;\n case 'End':\n nextIndex = lastIndex;\n break;\n }\n\n if (nextIndex === undefined) {\n return;\n }\n event.preventDefault();\n items[nextIndex]?.focus();\n }\n\n #isSheet(): boolean {\n return this.sheet() && typeof window.matchMedia === 'function' && !window.matchMedia('(min-width: 64rem)').matches;\n }\n\n #position(trigger: HTMLElement): void {\n const margin = 8;\n const triggerRect = trigger.getBoundingClientRect();\n const menuRect = { width: this.#host.offsetWidth, height: this.#host.offsetHeight };\n const fitsBelow = window.innerHeight - triggerRect.bottom >= menuRect.height + margin;\n\n const top = fitsBelow ? triggerRect.bottom + 4 : Math.max(margin, triggerRect.top - menuRect.height - 4);\n const left = Math.min(\n Math.max(triggerRect.right - menuRect.width, margin),\n window.innerWidth - menuRect.width - margin,\n );\n\n this.#host.style.position = 'fixed';\n this.#host.style.top = `${Math.min(top, window.innerHeight - menuRect.height - margin)}px`;\n this.#host.style.left = `${left}px`;\n this.#host.style.right = 'auto';\n this.#host.style.bottom = 'auto';\n this.#host.style.transformOrigin = fitsBelow ? 'top right' : 'bottom right';\n }\n}\n\n/**\n * Opens a `ui-menu` from a trigger element and wires its ARIA attributes.\n *\n * @example\n * <button ui-button size=\"icon\" aria-label=\"More\" [uiMenuTrigger]=\"menu\">...</button>\n */\n@Directive({\n selector: '[uiMenuTrigger]',\n host: {\n 'aria-haspopup': 'menu',\n '[attr.aria-expanded]': 'uiMenuTrigger().isOpen()',\n '[attr.aria-controls]': 'uiMenuTrigger().menuId',\n '(click)': 'toggle()',\n },\n})\nexport class UiMenuTrigger {\n readonly uiMenuTrigger = input.required<UiMenu>();\n\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n protected toggle(): void {\n const menu = this.uiMenuTrigger();\n\n if (menu.isOpen()) {\n menu.close();\n } else {\n menu.open(this.#host);\n }\n }\n}\n"],"mappings":";;AAaA,MAAM,eACJ;AAEF,MAAM,gBACJ;AAEF,MAAM,qBACJ;AAEF,MAAM,eACJ;AAEF,MAAM,gBACJ;AAEF,MAAM,gBAAe;CACnB,IAAI,QAAQ;CAEZ,aAAa,WA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A;GACT,UAAU;GACV,MAAM;IACJ,iBAAiB;IACjB,wBAAwB;IACxB,wBAAwB;IACxB,WAAW;GACZ;EACF,CAAA"}
1
+ {"version":3,"file":"joanroucoux-cairn-ui-menu.mjs","names":[],"sources":["../../../projects/ui/menu/menu.ts"],"sourcesContent":["import {\n Component,\n Directive,\n ElementRef,\n booleanAttribute,\n computed,\n contentChildren,\n inject,\n input,\n numberAttribute,\n signal,\n} from '@angular/core';\n\nconst MENU_CLASSES =\n 'm-0 min-w-44 p-1 rounded-container bg-(--elevated) shadow-[0_8px_24px_rgb(0_0_0/0.16),inset_0_0_0_1px_var(--border)] text-(--foreground) transition-[opacity,scale,overlay,display] transition-discrete duration-(--duration-fast) not-open:duration-[120ms] ease-out starting:open:opacity-0 starting:open:scale-(--enter-scale) opacity-0 scale-(--enter-scale) open:opacity-100 open:scale-100';\n\nconst SHEET_CLASSES =\n 'max-lg:fixed max-lg:inset-x-4 max-lg:top-auto max-lg:w-auto max-lg:bottom-[calc(76px+env(safe-area-inset-bottom))] max-lg:min-w-0 max-lg:p-1.5 max-lg:bg-(--card) max-lg:shadow-[0_12px_32px_rgb(0_0_0/0.2),inset_0_0_0_1px_var(--border)] max-lg:backdrop:bg-[rgb(0_0_0/0.36)] max-lg:transition-[opacity,translate,overlay,display] max-lg:scale-100 max-lg:translate-y-4 max-lg:open:translate-y-0 max-lg:starting:open:scale-100 max-lg:starting:open:translate-y-4 max-lg:motion-reduce:translate-y-0 max-lg:motion-reduce:starting:open:translate-y-0';\n\nconst SHEET_ITEM_CLASSES =\n 'flex w-full items-center gap-3 lg:pointer-fine:gap-2.5 min-h-12 lg:min-h-11 lg:pointer-fine:min-h-9 px-3 lg:pointer-fine:px-2.5 rounded-[calc(var(--radius-container)-6px)] lg:rounded-[calc(var(--radius-container)-4px)] text-body lg:pointer-fine:text-label text-left whitespace-nowrap hover:bg-(--glow) focus-visible:bg-(--glow) active:bg-(--soft) transition-[background-color] duration-(--duration-fast) ease-out outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--ring) [:where(&>svg)]:size-5 [:where(&>svg)]:flex-none lg:[:where(&>svg)]:size-[18px] lg:pointer-fine:[:where(&>svg)]:size-4';\n\nconst ITEM_CLASSES =\n 'flex w-full items-center gap-3 pointer-fine:gap-2.5 min-h-11 pointer-fine:min-h-9 px-3 pointer-fine:px-2.5 rounded-[calc(var(--radius-container)-4px)] text-body pointer-fine:text-label text-left whitespace-nowrap hover:bg-(--glow) focus-visible:bg-(--glow) active:bg-(--soft) transition-[background-color] duration-(--duration-fast) ease-out outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--ring) [:where(&>svg)]:size-[18px] [:where(&>svg)]:flex-none pointer-fine:[:where(&>svg)]:size-4';\n\nconst CHECK_CLASSES =\n \"after:ms-auto after:block after:h-3 after:w-1.5 after:flex-none after:rotate-45 after:border-r-2 after:border-b-2 after:border-current after:content-['']\";\n\nconst nextId = (() => {\n let count = 0;\n\n return () => `ui-menu-${++count}`;\n})();\n\n/**\n * One action of a `ui-menu`; `destructive` paints it in `--negative`. Giving it `checked` makes it a radio\n * choice (`menuitemradio`): the current one carries a check mark and `aria-checked=\"true\"`.\n *\n * @example\n * <button uiMenuItem destructive (click)=\"remove()\">Delete the holding</button>\n * <button uiMenuItem [checked]=\"account() === 'pea'\" (click)=\"account.set('pea')\">Northwind PEA</button>\n */\n@Directive({\n selector: 'button[uiMenuItem]',\n host: {\n '[attr.role]': 'role()',\n '[attr.aria-checked]': 'checked() === undefined ? null : checked()',\n tabindex: '-1',\n '[class]': 'classes()',\n '(click)': 'onClick()',\n },\n})\nexport class UiMenuItem {\n readonly destructive = input(false, { transform: booleanAttribute });\n readonly checked = input<boolean>();\n\n readonly #host = inject<ElementRef<HTMLButtonElement>>(ElementRef).nativeElement;\n readonly #menu = inject(UiMenu);\n\n protected readonly role = computed(() => (this.checked() === undefined ? 'menuitem' : 'menuitemradio'));\n\n protected readonly classes = computed(\n () =>\n `${this.#menu.sheet() ? SHEET_ITEM_CLASSES : ITEM_CLASSES}${this.destructive() ? ' text-(--negative)' : ''}${this.checked() ? ` ${CHECK_CLASSES}` : ''}`,\n );\n\n focus(): void {\n this.#host.focus();\n }\n\n hasFocus(): boolean {\n return this.#host === document.activeElement;\n }\n\n protected onClick(): void {\n this.#menu.close();\n }\n}\n\n/**\n * Secondary actions menu, opened from its trigger through the native Popover API. With `sheet`, below\n * 64rem it opens as a bottom action sheet instead of beside its trigger, and `heading` names what\n * the actions apply to. `width` fixes the popover width in pixels; without it the menu fits its content.\n *\n * @example\n * <button ui-button size=\"icon\" aria-label=\"More\" [uiMenuTrigger]=\"menu\">...</button>\n * <ui-menu #menu label=\"Holding actions\">\n * <button uiMenuItem (click)=\"edit()\">Edit</button>\n * <button uiMenuItem destructive (click)=\"remove()\">Delete the holding</button>\n * </ui-menu>\n */\n@Component({\n selector: 'ui-menu',\n template: `\n @if (sheet() && heading()) {\n <div aria-hidden=\"true\" class=\"text-label px-3 pt-2 pb-1.5 leading-[17px] text-(--muted-foreground) lg:hidden\">\n {{ heading() }}\n </div>\n }\n <ng-content />\n `,\n host: {\n role: 'menu',\n popover: 'auto',\n '[id]': 'menuId',\n '[style.--ui-menu-width]': 'widthVar()',\n '[class]': 'classes()',\n '[attr.aria-label]': 'label()',\n '(toggle)': 'onToggle($event)',\n '(keydown)': 'onKeydown($event)',\n },\n})\nexport class UiMenu {\n readonly label = input.required<string>();\n readonly sheet = input(false, { transform: booleanAttribute });\n readonly heading = input<string>();\n readonly width = input<number | undefined, unknown>(undefined, { transform: numberAttribute });\n\n readonly menuId = nextId();\n readonly isOpen = signal(false);\n\n protected readonly hasWidth = computed(() => Number.isFinite(this.width()));\n protected readonly widthVar = computed(() => (this.hasWidth() ? `${this.width()}px` : null));\n protected readonly classes = computed(() => {\n const width = !this.hasWidth() ? '' : this.sheet() ? ' lg:w-(--ui-menu-width)' : ' w-(--ui-menu-width)';\n return `${MENU_CLASSES}${this.sheet() ? ` ${SHEET_CLASSES}` : ''}${width}`;\n });\n protected readonly items = contentChildren(UiMenuItem);\n\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n #trigger: HTMLElement | null = null;\n\n open(trigger: HTMLElement): void {\n this.#trigger = trigger;\n this.isOpen.set(true);\n if (typeof this.#host.showPopover === 'function') {\n this.#host.showPopover();\n }\n if (this.#isSheet()) {\n this.#host.style.position = '';\n this.#host.style.top = '';\n this.#host.style.left = '';\n this.#host.style.right = '';\n this.#host.style.bottom = '';\n } else {\n this.#position(trigger);\n }\n (this.items().find((item) => item.checked()) ?? this.items()[0])?.focus();\n }\n\n close(): void {\n const wasOpen = this.isOpen();\n\n this.#applyClosed();\n\n if (wasOpen && typeof this.#host.hidePopover === 'function') {\n this.#host.hidePopover();\n }\n }\n\n #applyClosed(): void {\n this.isOpen.set(false);\n this.#trigger?.focus();\n this.#trigger = null;\n }\n\n protected onToggle(event: Event): void {\n if ((event as ToggleEvent).newState === 'closed') {\n this.#applyClosed();\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Tab' || event.key === 'Escape') {\n event.preventDefault();\n this.close();\n return;\n }\n\n const items = this.items();\n const currentIndex = items.findIndex((item) => item.hasFocus());\n const lastIndex = items.length - 1;\n\n let nextIndex: number | undefined;\n switch (event.key) {\n case 'ArrowDown':\n nextIndex = currentIndex >= lastIndex ? 0 : currentIndex + 1;\n break;\n case 'ArrowUp':\n nextIndex = currentIndex <= 0 ? lastIndex : currentIndex - 1;\n break;\n case 'Home':\n nextIndex = 0;\n break;\n case 'End':\n nextIndex = lastIndex;\n break;\n }\n\n if (nextIndex === undefined) {\n return;\n }\n event.preventDefault();\n items[nextIndex]?.focus();\n }\n\n #isSheet(): boolean {\n return this.sheet() && typeof window.matchMedia === 'function' && !window.matchMedia('(min-width: 64rem)').matches;\n }\n\n #layoutWidth(): number {\n const style = getComputedStyle(this.#host);\n const width = parseFloat(style.width);\n\n if (Number.isNaN(width)) {\n return this.#host.offsetWidth;\n }\n\n if (style.boxSizing === 'border-box') {\n return width;\n }\n\n return (\n width +\n parseFloat(style.paddingLeft) +\n parseFloat(style.paddingRight) +\n parseFloat(style.borderLeftWidth) +\n parseFloat(style.borderRightWidth)\n );\n }\n\n #position(trigger: HTMLElement): void {\n const margin = 8;\n const triggerRect = trigger.getBoundingClientRect();\n const menuRect = { width: this.#layoutWidth(), height: this.#host.offsetHeight };\n const fitsBelow = window.innerHeight - triggerRect.bottom >= menuRect.height + margin;\n\n const top = fitsBelow ? triggerRect.bottom + 4 : Math.max(margin, triggerRect.top - menuRect.height - 4);\n const left = Math.min(\n Math.max(triggerRect.right - menuRect.width, margin),\n window.innerWidth - menuRect.width - margin,\n );\n\n this.#host.style.position = 'fixed';\n this.#host.style.top = `${Math.min(top, window.innerHeight - menuRect.height - margin)}px`;\n this.#host.style.left = `${left}px`;\n this.#host.style.right = 'auto';\n this.#host.style.bottom = 'auto';\n this.#host.style.transformOrigin = fitsBelow ? 'top right' : 'bottom right';\n }\n}\n\n/**\n * Opens a `ui-menu` from a trigger element and wires its ARIA attributes.\n *\n * @example\n * <button ui-button size=\"icon\" aria-label=\"More\" [uiMenuTrigger]=\"menu\">...</button>\n */\n@Directive({\n selector: '[uiMenuTrigger]',\n host: {\n 'aria-haspopup': 'menu',\n '[attr.aria-expanded]': 'uiMenuTrigger().isOpen()',\n '[attr.aria-controls]': 'uiMenuTrigger().menuId',\n '(click)': 'toggle()',\n },\n})\nexport class UiMenuTrigger {\n readonly uiMenuTrigger = input.required<UiMenu>();\n\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n protected toggle(): void {\n const menu = this.uiMenuTrigger();\n\n if (menu.isOpen()) {\n menu.close();\n } else {\n menu.open(this.#host);\n }\n }\n}\n"],"mappings":";;AAaA,MAAM,eACJ;AAEF,MAAM,gBACJ;AAEF,MAAM,qBACJ;AAEF,MAAM,eACJ;AAEF,MAAM,gBACJ;AAEF,MAAM,gBAAe;CACn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mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,iBAAA,OAAA;GAAA,WAAA,EAAA,SAAA,WAAA;GAAA,YAAA;IAAA,sBAAA;IAAA,sBAAA;GAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAb,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EATzB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM;IACJ,iBAAiB;IACjB,wBAAwB;IACxB,wBAAwB;IACxB,WAAW;GACZ;EACF,CAAA"}
@@ -32,7 +32,7 @@ var UiMeter = class UiMeter {
32
32
  fillClasses = computed(() => `h-full rounded-pill ${TONE_CLASSES[this.tone()]}`, ...ngDevMode ? [{ debugName: "fillClasses" }] : /* istanbul ignore next */ []);
33
33
  static ɵfac = i0.ɵɵngDeclareFactory({
34
34
  minVersion: "12.0.0",
35
- version: "22.2.0",
35
+ version: "22.2.1",
36
36
  ngImport: i0,
37
37
  type: UiMeter,
38
38
  deps: [],
@@ -40,7 +40,7 @@ var UiMeter = class UiMeter {
40
40
  });
41
41
  static ɵcmp = i0.ɵɵngDeclareComponent({
42
42
  minVersion: "17.1.0",
43
- version: "22.2.0",
43
+ version: "22.2.1",
44
44
  type: UiMeter,
45
45
  isStandalone: true,
46
46
  selector: "ui-meter",
@@ -101,7 +101,7 @@ var UiMeter = class UiMeter {
101
101
  };
102
102
  i0.ɵɵngDeclareClassMetadata({
103
103
  minVersion: "12.0.0",
104
- version: "22.2.0",
104
+ version: "22.2.1",
105
105
  ngImport: i0,
106
106
  type: UiMeter,
107
107
  decorators: [{
@@ -25,7 +25,7 @@ var FlipItems = class FlipItems {
25
25
  }
26
26
  static ɵfac = i0.ɵɵngDeclareFactory({
27
27
  minVersion: "12.0.0",
28
- version: "22.2.0",
28
+ version: "22.2.1",
29
29
  ngImport: i0,
30
30
  type: FlipItems,
31
31
  deps: [],
@@ -33,14 +33,14 @@ var FlipItems = class FlipItems {
33
33
  });
34
34
  static ɵprov = i0.ɵɵngDeclareInjectable({
35
35
  minVersion: "12.0.0",
36
- version: "22.2.0",
36
+ version: "22.2.1",
37
37
  ngImport: i0,
38
38
  type: FlipItems
39
39
  });
40
40
  };
41
41
  i0.ɵɵngDeclareClassMetadata({
42
42
  minVersion: "12.0.0",
43
- version: "22.2.0",
43
+ version: "22.2.1",
44
44
  ngImport: i0,
45
45
  type: FlipItems,
46
46
  decorators: [{ type: Injectable }]
@@ -151,7 +151,7 @@ var UiFlipList = class UiFlipList {
151
151
  }
152
152
  static ɵfac = i0.ɵɵngDeclareFactory({
153
153
  minVersion: "12.0.0",
154
- version: "22.2.0",
154
+ version: "22.2.1",
155
155
  ngImport: i0,
156
156
  type: UiFlipList,
157
157
  deps: [],
@@ -159,7 +159,7 @@ var UiFlipList = class UiFlipList {
159
159
  });
160
160
  static ɵdir = i0.ɵɵngDeclareDirective({
161
161
  minVersion: "14.0.0",
162
- version: "22.2.0",
162
+ version: "22.2.1",
163
163
  type: UiFlipList,
164
164
  isStandalone: true,
165
165
  selector: "[uiFlipList]",
@@ -169,7 +169,7 @@ var UiFlipList = class UiFlipList {
169
169
  };
170
170
  i0.ɵɵngDeclareClassMetadata({
171
171
  minVersion: "12.0.0",
172
- version: "22.2.0",
172
+ version: "22.2.1",
173
173
  ngImport: i0,
174
174
  type: UiFlipList,
175
175
  decorators: [{
@@ -192,7 +192,7 @@ var UiFlipItem = class UiFlipItem {
192
192
  }
193
193
  static ɵfac = i0.ɵɵngDeclareFactory({
194
194
  minVersion: "12.0.0",
195
- version: "22.2.0",
195
+ version: "22.2.1",
196
196
  ngImport: i0,
197
197
  type: UiFlipItem,
198
198
  deps: [],
@@ -200,7 +200,7 @@ var UiFlipItem = class UiFlipItem {
200
200
  });
201
201
  static ɵdir = i0.ɵɵngDeclareDirective({
202
202
  minVersion: "14.0.0",
203
- version: "22.2.0",
203
+ version: "22.2.1",
204
204
  type: UiFlipItem,
205
205
  isStandalone: true,
206
206
  selector: "[uiFlipItem]",
@@ -209,7 +209,7 @@ var UiFlipItem = class UiFlipItem {
209
209
  };
210
210
  i0.ɵɵngDeclareClassMetadata({
211
211
  minVersion: "12.0.0",
212
- version: "22.2.0",
212
+ version: "22.2.1",
213
213
  ngImport: i0,
214
214
  type: UiFlipItem,
215
215
  decorators: [{
@@ -332,7 +332,7 @@ var UiHighlight = class UiHighlight {
332
332
  }
333
333
  static ɵfac = i0.ɵɵngDeclareFactory({
334
334
  minVersion: "12.0.0",
335
- version: "22.2.0",
335
+ version: "22.2.1",
336
336
  ngImport: i0,
337
337
  type: UiHighlight,
338
338
  deps: [],
@@ -340,7 +340,7 @@ var UiHighlight = class UiHighlight {
340
340
  });
341
341
  static ɵdir = i0.ɵɵngDeclareDirective({
342
342
  minVersion: "17.1.0",
343
- version: "22.2.0",
343
+ version: "22.2.1",
344
344
  type: UiHighlight,
345
345
  isStandalone: true,
346
346
  selector: "[uiHighlight]",
@@ -357,7 +357,7 @@ var UiHighlight = class UiHighlight {
357
357
  };
358
358
  i0.ɵɵngDeclareClassMetadata({
359
359
  minVersion: "12.0.0",
360
- version: "22.2.0",
360
+ version: "22.2.1",
361
361
  ngImport: i0,
362
362
  type: UiHighlight,
363
363
  decorators: [{
@@ -15,7 +15,7 @@ var UiNavItem = class UiNavItem {
15
15
  }
16
16
  static ɵfac = i0.ɵɵngDeclareFactory({
17
17
  minVersion: "12.0.0",
18
- version: "22.2.0",
18
+ version: "22.2.1",
19
19
  ngImport: i0,
20
20
  type: UiNavItem,
21
21
  deps: [],
@@ -23,7 +23,7 @@ var UiNavItem = class UiNavItem {
23
23
  });
24
24
  static ɵcmp = i0.ɵɵngDeclareComponent({
25
25
  minVersion: "17.1.0",
26
- version: "22.2.0",
26
+ version: "22.2.1",
27
27
  type: UiNavItem,
28
28
  isStandalone: true,
29
29
  selector: "a[ui-nav-item]",
@@ -45,7 +45,7 @@ var UiNavItem = class UiNavItem {
45
45
  };
46
46
  i0.ɵɵngDeclareClassMetadata({
47
47
  minVersion: "12.0.0",
48
- version: "22.2.0",
48
+ version: "22.2.1",
49
49
  ngImport: i0,
50
50
  type: UiNavItem,
51
51
  decorators: [{
@@ -14,7 +14,7 @@ var UiResultGroup = class UiResultGroup {
14
14
  animation = PULSE_ANIMATION;
15
15
  static ɵfac = i0.ɵɵngDeclareFactory({
16
16
  minVersion: "12.0.0",
17
- version: "22.2.0",
17
+ version: "22.2.1",
18
18
  ngImport: i0,
19
19
  type: UiResultGroup,
20
20
  deps: [],
@@ -22,7 +22,7 @@ var UiResultGroup = class UiResultGroup {
22
22
  });
23
23
  static ɵcmp = i0.ɵɵngDeclareComponent({
24
24
  minVersion: "17.0.0",
25
- version: "22.2.0",
25
+ version: "22.2.1",
26
26
  type: UiResultGroup,
27
27
  isStandalone: true,
28
28
  selector: "ui-result-group",
@@ -93,7 +93,7 @@ var UiResultGroup = class UiResultGroup {
93
93
  };
94
94
  i0.ɵɵngDeclareClassMetadata({
95
95
  minVersion: "12.0.0",
96
- version: "22.2.0",
96
+ version: "22.2.1",
97
97
  ngImport: i0,
98
98
  type: UiResultGroup,
99
99
  decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"joanroucoux-cairn-ui-result-group.mjs","names":[],"sources":["../../../projects/ui/result-group/result-group.ts"],"sourcesContent":["import { Component, computed, input, output } from '@angular/core';\n\nimport { type AsyncState, UiAsync } from '@joanroucoux/cairn-ui/async';\n\nconst PULSE_ANIMATION = 'cairn-pulse var(--pulse-duration) var(--ease-out) infinite alternate';\n\nconst BAR_CLASSES = 'block h-4 rounded-control bg-(--muted)';\n\n/**\n * One source of a search: a two-tone heading, then its rows, or a skeleton while it answers, a\n * message when it has nothing, or an inline error with a retry.\n *\n * @example\n * <ui-result-group label=\"Yahoo Finance\" hint=\"cours en continu\" [state]=\"state()\"\n * errorMessage=\"Yahoo Finance n'a pas répondu.\" retryLabel=\"Réessayer\" (retry)=\"search()\">\n * <button ui-row size=\"dense\" type=\"button\">...</button>\n * <span resultGroupMessage>Aucun résultat chez Yahoo Finance.</span>\n * </ui-result-group>\n */\n@Component({\n selector: 'ui-result-group',\n imports: [UiAsync],\n template: `\n <div class=\"text-caption flex items-baseline gap-1.5 pt-3 pr-2.5 pb-1 pl-2.5 tracking-(--tracking-caption)\">\n <span class=\"font-semibold text-(--foreground)\">{{ label() }}</span>\n @if (hint()) {\n <span class=\"text-(--subtle-foreground)\">{{ hint() }}</span>\n }\n </div>\n <ui-async\n variant=\"inline\"\n [errorMessage]=\"errorMessage()\"\n [retryIcon]=\"false\"\n [retryLabel]=\"retryLabel()\"\n [state]=\"state()\"\n (retry)=\"retry.emit()\"\n >\n <div asyncLoading class=\"flex flex-col gap-3.5 px-2.5 pt-2.5 pb-3\">\n <span class=\"flex justify-between\">\n <span class=\"${BAR_CLASSES} w-50\" [style.animation]=\"animation\"></span>\n <span class=\"${BAR_CLASSES} w-16\" [style.animation]=\"animation\"></span>\n </span>\n <span class=\"flex justify-between\">\n <span class=\"${BAR_CLASSES} w-40\" [style.animation]=\"animation\"></span>\n <span class=\"${BAR_CLASSES} w-16\" [style.animation]=\"animation\"></span>\n </span>\n </div>\n <div asyncEmpty class=\"text-label px-2.5 pt-1 pb-2.5 text-pretty text-(--muted-foreground) empty:hidden\">\n <ng-content select=\"[resultGroupMessage]\" />\n </div>\n <ng-content />\n </ui-async>\n `,\n host: {\n class: 'block',\n role: 'group',\n '[attr.aria-label]': 'name()',\n },\n})\nexport class UiResultGroup {\n readonly label = input.required<string>();\n readonly hint = input<string>();\n readonly state = input<AsyncState>('ready');\n readonly errorMessage = input<string>();\n readonly retryLabel = input<string>();\n readonly retry = output<void>();\n\n protected readonly name = computed(() => (this.hint() ? `${this.label()}, ${this.hint()}` : this.label()));\n protected readonly animation = PULSE_ANIMATION;\n}\n"],"mappings":";;;AAIA,MAAM,kBAAkB;AAExB,MAAM,cAAc;AAqDpB,IAA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mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA,EAAA,OAAA,QAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,QAAA;GAAA,YAAA,EAAA,mBAAA,SAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UAAA;EAAA,UAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MAtCd;GAAO,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,OAAA;EAAA,CAAA;CAAA,CAAA;;AAsCN,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EAxCzB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,SAAS,CAAC,OAAO;GACjB,UAAU;;;;;;;;;;;;;;;;;yBAiBa,YAAW;yBACX,YAAW;;;yBAGX,YAAW;yBACX,YAAW;;;;;;;;;GASlC,MAAM;IACJ,OAAO;IACP,MAAM;IACN,qBAAqB;GACtB;EACF,CAAA"}
1
+ {"version":3,"file":"joanroucoux-cairn-ui-result-group.mjs","names":[],"sources":["../../../projects/ui/result-group/result-group.ts"],"sourcesContent":["import { Component, computed, input, output } from '@angular/core';\n\nimport { type AsyncState, UiAsync } from '@joanroucoux/cairn-ui/async';\n\nconst PULSE_ANIMATION = 'cairn-pulse var(--pulse-duration) var(--ease-out) infinite alternate';\n\nconst BAR_CLASSES = 'block h-4 rounded-control bg-(--muted)';\n\n/**\n * One source of a search: a two-tone heading, then its rows, or a skeleton while it answers, a\n * message when it has nothing, or an inline error with a retry.\n *\n * @example\n * <ui-result-group label=\"Yahoo Finance\" hint=\"live prices\" [state]=\"state()\"\n * errorMessage=\"Yahoo Finance didn’t respond.\" retryLabel=\"Try again\" (retry)=\"search()\">\n * <button ui-row size=\"dense\" type=\"button\">...</button>\n * <span resultGroupMessage>No results from Yahoo Finance.</span>\n * </ui-result-group>\n */\n@Component({\n selector: 'ui-result-group',\n imports: [UiAsync],\n template: `\n <div class=\"text-caption flex items-baseline gap-1.5 pt-3 pr-2.5 pb-1 pl-2.5 tracking-(--tracking-caption)\">\n <span class=\"font-semibold text-(--foreground)\">{{ label() }}</span>\n @if (hint()) {\n <span class=\"text-(--subtle-foreground)\">{{ hint() }}</span>\n }\n </div>\n <ui-async\n variant=\"inline\"\n [errorMessage]=\"errorMessage()\"\n [retryIcon]=\"false\"\n [retryLabel]=\"retryLabel()\"\n [state]=\"state()\"\n (retry)=\"retry.emit()\"\n >\n <div asyncLoading class=\"flex flex-col gap-3.5 px-2.5 pt-2.5 pb-3\">\n <span class=\"flex justify-between\">\n <span class=\"${BAR_CLASSES} w-50\" [style.animation]=\"animation\"></span>\n <span class=\"${BAR_CLASSES} w-16\" [style.animation]=\"animation\"></span>\n </span>\n <span class=\"flex justify-between\">\n <span class=\"${BAR_CLASSES} w-40\" [style.animation]=\"animation\"></span>\n <span class=\"${BAR_CLASSES} w-16\" [style.animation]=\"animation\"></span>\n </span>\n </div>\n <div asyncEmpty class=\"text-label px-2.5 pt-1 pb-2.5 text-pretty text-(--muted-foreground) empty:hidden\">\n <ng-content select=\"[resultGroupMessage]\" />\n </div>\n <ng-content />\n </ui-async>\n `,\n host: {\n class: 'block',\n role: 'group',\n '[attr.aria-label]': 'name()',\n },\n})\nexport class UiResultGroup {\n readonly label = input.required<string>();\n readonly hint = input<string>();\n readonly state = input<AsyncState>('ready');\n readonly errorMessage = input<string>();\n readonly retryLabel = input<string>();\n readonly retry = output<void>();\n\n protected readonly name = computed(() => (this.hint() ? `${this.label()}, ${this.hint()}` : this.label()));\n protected readonly animation = PULSE_ANIMATION;\n}\n"],"mappings":";;;AAIA,MAAM,kBAAkB;AAExB,MAAM,cAAc;AAqDpB,IAAa,gBAAb,MAAa,cAAa;CACf,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA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