@joanroucoux/cairn-ui 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/README.md +2 -0
  3. package/fesm2022/joanroucoux-cairn-ui-action-bar.mjs +57 -53
  4. package/fesm2022/joanroucoux-cairn-ui-action-bar.mjs.map +1 -1
  5. package/fesm2022/joanroucoux-cairn-ui-alert.mjs +155 -47
  6. package/fesm2022/joanroucoux-cairn-ui-alert.mjs.map +1 -1
  7. package/fesm2022/joanroucoux-cairn-ui-amount.mjs +220 -110
  8. package/fesm2022/joanroucoux-cairn-ui-amount.mjs.map +1 -1
  9. package/fesm2022/joanroucoux-cairn-ui-async.mjs +392 -216
  10. package/fesm2022/joanroucoux-cairn-ui-async.mjs.map +1 -1
  11. package/fesm2022/joanroucoux-cairn-ui-avatar.mjs +145 -68
  12. package/fesm2022/joanroucoux-cairn-ui-avatar.mjs.map +1 -1
  13. package/fesm2022/joanroucoux-cairn-ui-back-link.mjs +87 -47
  14. package/fesm2022/joanroucoux-cairn-ui-back-link.mjs.map +1 -1
  15. package/fesm2022/joanroucoux-cairn-ui-badge.mjs +83 -43
  16. package/fesm2022/joanroucoux-cairn-ui-badge.mjs.map +1 -1
  17. package/fesm2022/joanroucoux-cairn-ui-button.mjs +184 -104
  18. package/fesm2022/joanroucoux-cairn-ui-button.mjs.map +1 -1
  19. package/fesm2022/joanroucoux-cairn-ui-card.mjs +232 -137
  20. package/fesm2022/joanroucoux-cairn-ui-card.mjs.map +1 -1
  21. package/fesm2022/joanroucoux-cairn-ui-choice-chips.mjs +298 -102
  22. package/fesm2022/joanroucoux-cairn-ui-choice-chips.mjs.map +1 -1
  23. package/fesm2022/joanroucoux-cairn-ui-control.mjs +4 -17
  24. package/fesm2022/joanroucoux-cairn-ui-control.mjs.map +1 -1
  25. package/fesm2022/joanroucoux-cairn-ui-delta.mjs +150 -83
  26. package/fesm2022/joanroucoux-cairn-ui-delta.mjs.map +1 -1
  27. package/fesm2022/joanroucoux-cairn-ui-dialog.mjs +508 -471
  28. package/fesm2022/joanroucoux-cairn-ui-dialog.mjs.map +1 -1
  29. package/fesm2022/joanroucoux-cairn-ui-donut.mjs +255 -157
  30. package/fesm2022/joanroucoux-cairn-ui-donut.mjs.map +1 -1
  31. package/fesm2022/joanroucoux-cairn-ui-drawer.mjs +303 -0
  32. package/fesm2022/joanroucoux-cairn-ui-drawer.mjs.map +1 -0
  33. package/fesm2022/joanroucoux-cairn-ui-empty.mjs +76 -35
  34. package/fesm2022/joanroucoux-cairn-ui-empty.mjs.map +1 -1
  35. package/fesm2022/joanroucoux-cairn-ui-external-link.mjs +40 -31
  36. package/fesm2022/joanroucoux-cairn-ui-external-link.mjs.map +1 -1
  37. package/fesm2022/joanroucoux-cairn-ui-fact.mjs +188 -79
  38. package/fesm2022/joanroucoux-cairn-ui-fact.mjs.map +1 -1
  39. package/fesm2022/joanroucoux-cairn-ui-field.mjs +309 -173
  40. package/fesm2022/joanroucoux-cairn-ui-field.mjs.map +1 -1
  41. package/fesm2022/joanroucoux-cairn-ui-filter-chips.mjs +165 -87
  42. package/fesm2022/joanroucoux-cairn-ui-filter-chips.mjs.map +1 -1
  43. package/fesm2022/joanroucoux-cairn-ui-group-header.mjs +269 -0
  44. package/fesm2022/joanroucoux-cairn-ui-group-header.mjs.map +1 -0
  45. package/fesm2022/joanroucoux-cairn-ui-input.mjs +205 -85
  46. package/fesm2022/joanroucoux-cairn-ui-input.mjs.map +1 -1
  47. package/fesm2022/joanroucoux-cairn-ui-line-chart.mjs +838 -512
  48. package/fesm2022/joanroucoux-cairn-ui-line-chart.mjs.map +1 -1
  49. package/fesm2022/joanroucoux-cairn-ui-menu.mjs +401 -225
  50. package/fesm2022/joanroucoux-cairn-ui-menu.mjs.map +1 -1
  51. package/fesm2022/joanroucoux-cairn-ui-meter.mjs +143 -57
  52. package/fesm2022/joanroucoux-cairn-ui-meter.mjs.map +1 -1
  53. package/fesm2022/joanroucoux-cairn-ui-motion.mjs +367 -399
  54. package/fesm2022/joanroucoux-cairn-ui-motion.mjs.map +1 -1
  55. package/fesm2022/joanroucoux-cairn-ui-nav-item.mjs +73 -44
  56. package/fesm2022/joanroucoux-cairn-ui-nav-item.mjs.map +1 -1
  57. package/fesm2022/joanroucoux-cairn-ui-result-group.mjs +191 -0
  58. package/fesm2022/joanroucoux-cairn-ui-result-group.mjs.map +1 -0
  59. package/fesm2022/joanroucoux-cairn-ui-row.mjs +376 -146
  60. package/fesm2022/joanroucoux-cairn-ui-row.mjs.map +1 -1
  61. package/fesm2022/joanroucoux-cairn-ui-segmented.mjs +183 -81
  62. package/fesm2022/joanroucoux-cairn-ui-segmented.mjs.map +1 -1
  63. package/fesm2022/joanroucoux-cairn-ui-select-pill.mjs +233 -0
  64. package/fesm2022/joanroucoux-cairn-ui-select-pill.mjs.map +1 -0
  65. package/fesm2022/joanroucoux-cairn-ui-select.mjs +121 -67
  66. package/fesm2022/joanroucoux-cairn-ui-select.mjs.map +1 -1
  67. package/fesm2022/joanroucoux-cairn-ui-skeleton.mjs +129 -51
  68. package/fesm2022/joanroucoux-cairn-ui-skeleton.mjs.map +1 -1
  69. package/fesm2022/joanroucoux-cairn-ui-stale-link.mjs +80 -39
  70. package/fesm2022/joanroucoux-cairn-ui-stale-link.mjs.map +1 -1
  71. package/fesm2022/joanroucoux-cairn-ui-stat.mjs +85 -55
  72. package/fesm2022/joanroucoux-cairn-ui-stat.mjs.map +1 -1
  73. package/fesm2022/joanroucoux-cairn-ui-switch.mjs +48 -35
  74. package/fesm2022/joanroucoux-cairn-ui-switch.mjs.map +1 -1
  75. package/fesm2022/joanroucoux-cairn-ui-tab-bar.mjs +113 -69
  76. package/fesm2022/joanroucoux-cairn-ui-tab-bar.mjs.map +1 -1
  77. package/fesm2022/joanroucoux-cairn-ui-table.mjs +1036 -310
  78. package/fesm2022/joanroucoux-cairn-ui-table.mjs.map +1 -1
  79. package/fesm2022/joanroucoux-cairn-ui-toast.mjs +240 -127
  80. package/fesm2022/joanroucoux-cairn-ui-toast.mjs.map +1 -1
  81. package/fesm2022/joanroucoux-cairn-ui.mjs +0 -4
  82. package/package.json +17 -1
  83. package/styles/motion.css +1 -13
  84. package/styles/tokens.css +35 -64
  85. package/types/joanroucoux-cairn-ui-action-bar.d.ts +9 -14
  86. package/types/joanroucoux-cairn-ui-alert.d.ts +29 -15
  87. package/types/joanroucoux-cairn-ui-amount.d.ts +64 -32
  88. package/types/joanroucoux-cairn-ui-async.d.ts +85 -38
  89. package/types/joanroucoux-cairn-ui-avatar.d.ts +34 -22
  90. package/types/joanroucoux-cairn-ui-back-link.d.ts +20 -15
  91. package/types/joanroucoux-cairn-ui-badge.d.ts +22 -14
  92. package/types/joanroucoux-cairn-ui-button.d.ts +36 -18
  93. package/types/joanroucoux-cairn-ui-card.d.ts +48 -23
  94. package/types/joanroucoux-cairn-ui-choice-chips.d.ts +91 -35
  95. package/types/joanroucoux-cairn-ui-control.d.ts +9 -18
  96. package/types/joanroucoux-cairn-ui-delta.d.ts +46 -24
  97. package/types/joanroucoux-cairn-ui-dialog.d.ts +124 -57
  98. package/types/joanroucoux-cairn-ui-donut.d.ts +83 -46
  99. package/types/joanroucoux-cairn-ui-drawer.d.ts +73 -0
  100. package/types/joanroucoux-cairn-ui-empty.d.ts +20 -13
  101. package/types/joanroucoux-cairn-ui-external-link.d.ts +6 -10
  102. package/types/joanroucoux-cairn-ui-fact.d.ts +49 -25
  103. package/types/joanroucoux-cairn-ui-field.d.ts +72 -49
  104. package/types/joanroucoux-cairn-ui-filter-chips.d.ts +35 -20
  105. package/types/joanroucoux-cairn-ui-group-header.d.ts +58 -0
  106. package/types/joanroucoux-cairn-ui-input.d.ts +59 -37
  107. package/types/joanroucoux-cairn-ui-line-chart.d.ts +199 -89
  108. package/types/joanroucoux-cairn-ui-menu.d.ts +81 -44
  109. package/types/joanroucoux-cairn-ui-meter.d.ts +44 -22
  110. package/types/joanroucoux-cairn-ui-motion.d.ts +61 -75
  111. package/types/joanroucoux-cairn-ui-nav-item.d.ts +15 -13
  112. package/types/joanroucoux-cairn-ui-result-group.d.ts +52 -0
  113. package/types/joanroucoux-cairn-ui-row.d.ts +79 -37
  114. package/types/joanroucoux-cairn-ui-segmented.d.ts +51 -27
  115. package/types/joanroucoux-cairn-ui-select-pill.d.ts +52 -0
  116. package/types/joanroucoux-cairn-ui-select.d.ts +28 -18
  117. package/types/joanroucoux-cairn-ui-skeleton.d.ts +35 -18
  118. package/types/joanroucoux-cairn-ui-stale-link.d.ts +23 -16
  119. package/types/joanroucoux-cairn-ui-stat.d.ts +26 -21
  120. package/types/joanroucoux-cairn-ui-switch.d.ts +7 -11
  121. package/types/joanroucoux-cairn-ui-tab-bar.d.ts +20 -17
  122. package/types/joanroucoux-cairn-ui-table.d.ts +251 -89
  123. package/types/joanroucoux-cairn-ui-toast.d.ts +46 -36
  124. package/types/joanroucoux-cairn-ui.d.ts +1 -2
  125. package/fesm2022/joanroucoux-cairn-ui.mjs.map +0 -1
@@ -1,48 +1,56 @@
1
- import * as i0 from '@angular/core';
2
- import { input, computed, Component } from '@angular/core';
3
-
4
- /** Available stat sizes. `StatSize` is derived from this tuple. */
5
- const STAT_SIZES = ['hero', 'tile'];
1
+ import * as i0 from "@angular/core";
2
+ import { Component, computed, input } from "@angular/core";
3
+ const STAT_SIZES = ["hero", "tile"];
6
4
  const VALUE_CLASSES = {
7
- hero: 'text-display font-semibold tracking-(--tracking-display) text-(--foreground)',
8
- tile: 'text-title font-semibold tabular-nums text-(--foreground)',
5
+ hero: "text-display font-semibold tracking-(--tracking-display) text-(--foreground)",
6
+ tile: "text-title font-semibold tabular-nums text-(--foreground)"
9
7
  };
10
8
  const LABEL_CLASSES = {
11
- hero: 'text-label font-medium text-(--muted-foreground)',
12
- tile: 'text-label font-normal text-(--muted-foreground)',
9
+ hero: "text-label font-medium text-(--muted-foreground)",
10
+ tile: "text-label font-normal text-(--muted-foreground)"
13
11
  };
14
12
  const STACK_CLASSES = {
15
- hero: 'flex flex-col gap-1',
16
- tile: 'flex flex-col gap-0.5',
13
+ hero: "flex flex-col gap-1",
14
+ tile: "flex flex-col gap-0.5"
17
15
  };
18
- /**
19
- * Label, figure and a named period of change, at two sizes: a `hero` for a screen's single
20
- * headline number, or a smaller `tile` repeated in a grid. The figure itself, its delta and its
21
- * caption are all projected, so the component carries no formatting and no currency of its own.
22
- *
23
- * The `hero` size never sets `tabular-nums` on the figure: a lone headline number reads better
24
- * with its digits at their natural width, unlike a column of aligned figures.
25
- *
26
- * @example
27
- * <ui-stat label="Net worth" size="hero">
28
- * <span uiStatValue>128,656 EUR</span>
29
- * <ui-delta uiStatDelta [value]="dayChange()" unknownLabel="Not available">+316.54 EUR</ui-delta>
30
- * <span uiStatCaption>today</span>
31
- * </ui-stat>
32
- */
33
- class UiStat {
34
- label = input.required(/* @ts-ignore */
35
- ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
36
- size = input('tile', /* @ts-ignore */
37
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
38
- labelClasses = computed(() => LABEL_CLASSES[this.size()], /* @ts-ignore */
39
- ...(ngDevMode ? [{ debugName: "labelClasses" }] : /* istanbul ignore next */ []));
40
- stackClasses = computed(() => STACK_CLASSES[this.size()], /* @ts-ignore */
41
- ...(ngDevMode ? [{ debugName: "stackClasses" }] : /* istanbul ignore next */ []));
42
- valueClasses = computed(() => VALUE_CLASSES[this.size()], /* @ts-ignore */
43
- ...(ngDevMode ? [{ debugName: "valueClasses" }] : /* istanbul ignore next */ []));
44
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiStat, deps: [], target: i0.ɵɵFactoryTarget.Component });
45
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: UiStat, isStandalone: true, selector: "ui-stat", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
16
+ var UiStat = class UiStat {
17
+ label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
18
+ size = input("tile", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
19
+ labelClasses = computed(() => LABEL_CLASSES[this.size()], ...ngDevMode ? [{ debugName: "labelClasses" }] : /* istanbul ignore next */ []);
20
+ stackClasses = computed(() => STACK_CLASSES[this.size()], ...ngDevMode ? [{ debugName: "stackClasses" }] : /* istanbul ignore next */ []);
21
+ valueClasses = computed(() => VALUE_CLASSES[this.size()], ...ngDevMode ? [{ debugName: "valueClasses" }] : /* istanbul ignore next */ []);
22
+ static ɵfac = i0.ɵɵngDeclareFactory({
23
+ minVersion: "12.0.0",
24
+ version: "22.2.0",
25
+ ngImport: i0,
26
+ type: UiStat,
27
+ deps: [],
28
+ target: i0.ɵɵFactoryTarget.Component
29
+ });
30
+ static ɵcmp = i0.ɵɵngDeclareComponent({
31
+ minVersion: "17.1.0",
32
+ version: "22.2.0",
33
+ type: UiStat,
34
+ isStandalone: true,
35
+ selector: "ui-stat",
36
+ inputs: {
37
+ label: {
38
+ classPropertyName: "label",
39
+ publicName: "label",
40
+ isSignal: true,
41
+ isRequired: true,
42
+ transformFunction: null
43
+ },
44
+ size: {
45
+ classPropertyName: "size",
46
+ publicName: "size",
47
+ isSignal: true,
48
+ isRequired: false,
49
+ transformFunction: null
50
+ }
51
+ },
52
+ ngImport: i0,
53
+ template: `
46
54
  <div class="flex items-start justify-between gap-4">
47
55
  <div [class]="stackClasses()">
48
56
  <dl [class]="stackClasses()">
@@ -60,13 +68,20 @@ class UiStat {
60
68
 
61
69
  <ng-content select="[uiStatAside]" />
62
70
  </div>
63
- `, isInline: true });
64
- }
65
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiStat, decorators: [{
66
- type: Component,
67
- args: [{
68
- selector: 'ui-stat',
69
- template: `
71
+ `,
72
+ isInline: true
73
+ });
74
+ };
75
+ i0.ɵɵngDeclareClassMetadata({
76
+ minVersion: "12.0.0",
77
+ version: "22.2.0",
78
+ ngImport: i0,
79
+ type: UiStat,
80
+ decorators: [{
81
+ type: Component,
82
+ args: [{
83
+ selector: "ui-stat",
84
+ template: `
70
85
  <div class="flex items-start justify-between gap-4">
71
86
  <div [class]="stackClasses()">
72
87
  <dl [class]="stackClasses()">
@@ -84,13 +99,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
84
99
 
85
100
  <ng-content select="[uiStatAside]" />
86
101
  </div>
87
- `,
88
- }]
89
- }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
90
-
91
- /**
92
- * Generated bundle index. Do not edit.
93
- */
94
-
102
+ `
103
+ }]
104
+ }],
105
+ propDecorators: {
106
+ label: [{
107
+ type: i0.Input,
108
+ args: [{
109
+ isSignal: true,
110
+ alias: "label",
111
+ required: true
112
+ }]
113
+ }],
114
+ size: [{
115
+ type: i0.Input,
116
+ args: [{
117
+ isSignal: true,
118
+ alias: "size",
119
+ required: false
120
+ }]
121
+ }]
122
+ }
123
+ });
95
124
  export { STAT_SIZES, UiStat };
96
- //# sourceMappingURL=joanroucoux-cairn-ui-stat.mjs.map
125
+
126
+ //# sourceMappingURL=joanroucoux-cairn-ui-stat.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"joanroucoux-cairn-ui-stat.mjs","sources":["../../../projects/ui/stat/stat.ts","../../../projects/ui/stat/joanroucoux-cairn-ui-stat.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\n\n/** Available stat sizes. `StatSize` is derived from this tuple. */\nexport const STAT_SIZES = ['hero', 'tile'] as const;\nexport type StatSize = (typeof STAT_SIZES)[number];\n\nconst VALUE_CLASSES: Record<StatSize, string> = {\n hero: 'text-display font-semibold tracking-(--tracking-display) text-(--foreground)',\n tile: 'text-title font-semibold tabular-nums text-(--foreground)',\n};\n\nconst LABEL_CLASSES: Record<StatSize, string> = {\n hero: 'text-label font-medium text-(--muted-foreground)',\n tile: 'text-label font-normal text-(--muted-foreground)',\n};\n\nconst STACK_CLASSES: Record<StatSize, string> = {\n hero: 'flex flex-col gap-1',\n tile: 'flex flex-col gap-0.5',\n};\n\n/**\n * Label, figure and a named period of change, at two sizes: a `hero` for a screen's single\n * headline number, or a smaller `tile` repeated in a grid. The figure itself, its delta and its\n * caption are all projected, so the component carries no formatting and no currency of its own.\n *\n * The `hero` size never sets `tabular-nums` on the figure: a lone headline number reads better\n * with its digits at their natural width, unlike a column of aligned figures.\n *\n * @example\n * <ui-stat label=\"Net worth\" size=\"hero\">\n * <span uiStatValue>128,656 EUR</span>\n * <ui-delta uiStatDelta [value]=\"dayChange()\" unknownLabel=\"Not available\">+316.54 EUR</ui-delta>\n * <span uiStatCaption>today</span>\n * </ui-stat>\n */\n@Component({\n selector: 'ui-stat',\n template: `\n <div class=\"flex items-start justify-between gap-4\">\n <div [class]=\"stackClasses()\">\n <dl [class]=\"stackClasses()\">\n <dt [class]=\"labelClasses()\">{{ label() }}</dt>\n <dd [class]=\"valueClasses()\">\n <ng-content select=\"[uiStatValue]\" />\n </dd>\n </dl>\n\n <div class=\"text-label flex flex-wrap items-center gap-x-1.5 gap-y-1 text-(--muted-foreground)\">\n <ng-content select=\"[uiStatDelta]\" />\n <ng-content select=\"[uiStatCaption]\" />\n </div>\n </div>\n\n <ng-content select=\"[uiStatAside]\" />\n </div>\n `,\n})\nexport class UiStat {\n readonly label = input.required<string>();\n readonly size = input<StatSize>('tile');\n\n protected readonly labelClasses = computed(() => LABEL_CLASSES[this.size()]);\n\n protected readonly stackClasses = computed(() => STACK_CLASSES[this.size()]);\n\n protected readonly valueClasses = computed(() => VALUE_CLAS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,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EApBP;;;;;;;;;;;;;;;;;;AAkBT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEU,MAAM,EAAA,UAAA,EAAA,CAAA;kBAtBlB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,SAAS;AACnB,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;AAkBT,EAAA,CAAA;AACF,iBAAA;;;ACzDD;;AAEG;;;;"}
1
+ {"version":3,"file":"joanroucoux-cairn-ui-stat.mjs","names":[],"sources":["../../../projects/ui/stat/stat.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\n\n/** Available stat sizes. */\nexport const STAT_SIZES = ['hero', 'tile'] as const;\nexport type StatSize = (typeof STAT_SIZES)[number];\n\nconst VALUE_CLASSES: Record<StatSize, string> = {\n hero: 'text-display font-semibold tracking-(--tracking-display) text-(--foreground)',\n tile: 'text-title font-semibold tabular-nums text-(--foreground)',\n};\n\nconst LABEL_CLASSES: Record<StatSize, string> = {\n hero: 'text-label font-medium text-(--muted-foreground)',\n tile: 'text-label font-normal text-(--muted-foreground)',\n};\n\nconst STACK_CLASSES: Record<StatSize, string> = {\n hero: 'flex flex-col gap-1',\n tile: 'flex flex-col gap-0.5',\n};\n\n/**\n * Label, figure and a named period of change: a `hero` for a screen's single headline number, or a\n * smaller `tile` repeated in a grid. The figure, its delta and its caption are projected, so the\n * component does no formatting. The `hero` figure does not use `tabular-nums`.\n *\n * @example\n * <ui-stat label=\"Net worth\" size=\"hero\">\n * <span uiStatValue>128,656 EUR</span>\n * <ui-delta uiStatDelta [value]=\"dayChange()\" unknownLabel=\"Not available\">+316.54 EUR</ui-delta>\n * <span uiStatCaption>today</span>\n * </ui-stat>\n */\n@Component({\n selector: 'ui-stat',\n template: `\n <div class=\"flex items-start justify-between gap-4\">\n <div [class]=\"stackClasses()\">\n <dl [class]=\"stackClasses()\">\n <dt [class]=\"labelClasses()\">{{ label() }}</dt>\n <dd [class]=\"valueClasses()\">\n <ng-content select=\"[uiStatValue]\" />\n </dd>\n </dl>\n\n <div class=\"text-label flex flex-wrap items-center gap-x-1.5 gap-y-1 text-(--muted-foreground)\">\n <ng-content select=\"[uiStatDelta]\" />\n <ng-content select=\"[uiStatCaption]\" />\n </div>\n </div>\n\n <ng-content select=\"[uiStatAside]\" />\n </div>\n `,\n})\nexport class UiStat {\n readonly label = input.required<string>();\n readonly size = input<StatSize>('tile');\n\n protected readonly labelClasses = computed(() => LABEL_CLASSES[this.size()]);\n\n protected readonly stackClasses = computed(() => STACK_CLASSES[this.size()]);\n\n protected readonly valueClasses = computed(() => VALUE_CLASSES[this.size()]);\n}\n"],"mappings":";;AAGA,MAAa,aAAa,CAAC,QAAQ,MAAM;AAGzC,MAAM,gBAA0C;CAC9C,MAAM;CACN,MAAM;AACP;AAED,MAAM,gBAA0C;CAC9C,MAAM;CACN,MAAM;AACP;AAED,MAAM,gBAA0C;CAC9C,MAAM;CACN,MAAM;AACP;AAoCD,IAAa,SAAb,MAAa,OAAM;CACR,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,OAAO,MAAgB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAEpB,eAAe,eAAe,cAAc,KAAK,KAAI,IAAI,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAEzD,eAAe,eAAe,cAAc,KAAK,KAAI,IAAI,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAEzD,eAAe,eAAe,cAAc,KAAK,KAAI,IAAI,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CARjE,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAM,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAN,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAM,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,UAAA;EAAA,UApBP;;;;;;;;;;;;;;;;;;;EAkBT,UAAA;CAAA,CAAA;;AAEU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAM,YAAA,CAAA;EAtBlB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;;;;;;;;;;;;;;;;;;;EAmBX,CAAA"}
@@ -1,37 +1,50 @@
1
- import * as i0 from '@angular/core';
2
- import { Directive } from '@angular/core';
3
- import { holdTransitionsUntilRendered } from '@joanroucoux/cairn-ui/motion';
4
-
1
+ import * as i0 from "@angular/core";
2
+ import { Directive } from "@angular/core";
3
+ import { holdTransitionsUntilRendered } from "@joanroucoux/cairn-ui/motion";
5
4
  const CLASSES = "relative shrink-0 w-[51px] h-[31px] pointer-fine:w-10 pointer-fine:h-6 appearance-none cursor-pointer rounded-pill bg-(--muted) checked:bg-(--primary) transition-[background-color] duration-(--duration-fast) ease-out disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:-translate-y-1/2 before:h-(--row-min) before:content-[''] after:absolute after:top-0.5 after:left-0.5 after:size-[27px] pointer-fine:after:size-5 after:rounded-pill after:bg-(--card) after:shadow-[0_1px_3px_rgb(0_0_0/0.2)] after:transition-transform after:duration-(--duration-fast) after:ease-out after:content-[''] checked:after:translate-x-[20px] pointer-fine:checked:after:translate-x-4";
6
- /**
7
- * Native checkbox styled as an iOS-style switch, exposed to assistive technology as `role="switch"`.
8
- * 51 by 31 on touch, 40 by 24 with a mouse.
9
- *
10
- * @example
11
- * <input type="checkbox" uiSwitch [checked]="hidden()" (change)="toggle()" aria-label="Hide amounts" />
12
- */
13
- class UiSwitch {
14
- classes = CLASSES;
15
- constructor() {
16
- holdTransitionsUntilRendered();
17
- }
18
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiSwitch, deps: [], target: i0.ɵɵFactoryTarget.Directive });
19
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: UiSwitch, isStandalone: true, selector: "input[type=checkbox][uiSwitch]", host: { attributes: { "role": "switch" }, properties: { "class": "classes" } }, ngImport: i0 });
20
- }
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiSwitch, decorators: [{
22
- type: Directive,
23
- args: [{
24
- selector: 'input[type=checkbox][uiSwitch]',
25
- host: {
26
- role: 'switch',
27
- '[class]': 'classes',
28
- },
29
- }]
30
- }], ctorParameters: () => [] });
31
-
32
- /**
33
- * Generated bundle index. Do not edit.
34
- */
35
-
5
+ var UiSwitch = class UiSwitch {
6
+ classes = CLASSES;
7
+ constructor() {
8
+ holdTransitionsUntilRendered();
9
+ }
10
+ static ɵfac = i0.ɵɵngDeclareFactory({
11
+ minVersion: "12.0.0",
12
+ version: "22.2.0",
13
+ ngImport: i0,
14
+ type: UiSwitch,
15
+ deps: [],
16
+ target: i0.ɵɵFactoryTarget.Directive
17
+ });
18
+ static ɵdir = i0.ɵɵngDeclareDirective({
19
+ minVersion: "14.0.0",
20
+ version: "22.2.0",
21
+ type: UiSwitch,
22
+ isStandalone: true,
23
+ selector: "input[type=checkbox][uiSwitch]",
24
+ host: {
25
+ attributes: { "role": "switch" },
26
+ properties: { "class": "classes" }
27
+ },
28
+ ngImport: i0
29
+ });
30
+ };
31
+ i0.ɵɵngDeclareClassMetadata({
32
+ minVersion: "12.0.0",
33
+ version: "22.2.0",
34
+ ngImport: i0,
35
+ type: UiSwitch,
36
+ decorators: [{
37
+ type: Directive,
38
+ args: [{
39
+ selector: "input[type=checkbox][uiSwitch]",
40
+ host: {
41
+ role: "switch",
42
+ "[class]": "classes"
43
+ }
44
+ }]
45
+ }],
46
+ ctorParameters: () => []
47
+ });
36
48
  export { UiSwitch };
37
- //# sourceMappingURL=joanroucoux-cairn-ui-switch.mjs.map
49
+
50
+ //# sourceMappingURL=joanroucoux-cairn-ui-switch.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"joanroucoux-cairn-ui-switch.mjs","sources":["../../../projects/ui/switch/switch.ts","../../../projects/ui/switch/joanroucoux-cairn-ui-switch.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\nimport { holdTransitionsUntilRendered } from '@joanroucoux/cairn-ui/motion';\n\nconst CLASSES =\n \"relative shrink-0 w-[51px] h-[31px] pointer-fine:w-10 pointer-fine:h-6 appearance-none cursor-pointer rounded-pill bg-(--muted) checked:bg-(--primary) transition-[background-color] duration-(--duration-fast) ease-out disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:-translate-y-1/2 before:h-(--row-min) before:content-[''] after:absolute after:top-0.5 after:left-0.5 after:size-[27px] pointer-fine:after:size-5 after:rounded-pill after:bg-(--card) after:shadow-[0_1px_3px_rgb(0_0_0/0.2)] after:transition-transform after:duration-(--duration-fast) after:ease-out after:content-[''] checked:after:translate-x-[20px] pointer-fine:checked:after:translate-x-4\";\n\n/**\n * Native checkbox styled as an iOS-style switch, exposed to assistive technology as `role=\"switch\"`.\n * 51 by 31 on touch, 40 by 24 with a mouse.\n *\n * @example\n * <input type=\"checkbox\" uiSwitch [checked]=\"hidden()\" (change)=\"toggle()\" aria-label=\"Hide amounts\" />\n */\n@Directive({\n selector: 'input[type=checkbox][uiSwitch]',\n host: {\n role: 'switch',\n '[class]': 'classes',\n },\n})\nexport class UiSwitch {\n protected readonly classes = CLASSES;\n\n constructor() {\n holdTransitionsUntilRendered();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA,MAAM,OAAO,GACX,+xBAA+xB;AAEjyB;;;;;;AAMG;MAQU,QAAQ,CAAA;IACA,OAAO,GAAG,OAAO;AAEpC,IAAA,WAAA,GAAA;AACE,QAAA,4BAA4B,EAAE;IAChC;uGALW,QAAQ,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAR,QAAQ,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gCAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAPpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gCAAgC;AAC1C,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,SAAS,EAAE,SAAS;AACrB,qBAAA;AACF,iBAAA;;;ACpBD;;AAEG;;;;"}
1
+ {"version":3,"file":"joanroucoux-cairn-ui-switch.mjs","names":[],"sources":["../../../projects/ui/switch/switch.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\nimport { holdTransitionsUntilRendered } from '@joanroucoux/cairn-ui/motion';\n\nconst CLASSES =\n \"relative shrink-0 w-[51px] h-[31px] pointer-fine:w-10 pointer-fine:h-6 appearance-none cursor-pointer rounded-pill bg-(--muted) checked:bg-(--primary) transition-[background-color] duration-(--duration-fast) ease-out disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:-translate-y-1/2 before:h-(--row-min) before:content-[''] after:absolute after:top-0.5 after:left-0.5 after:size-[27px] pointer-fine:after:size-5 after:rounded-pill after:bg-(--card) after:shadow-[0_1px_3px_rgb(0_0_0/0.2)] after:transition-transform after:duration-(--duration-fast) after:ease-out after:content-[''] checked:after:translate-x-[20px] pointer-fine:checked:after:translate-x-4\";\n\n/**\n * Native checkbox styled as an iOS-style switch, exposed to assistive technology as `role=\"switch\"`.\n *\n * @example\n * <input type=\"checkbox\" uiSwitch [checked]=\"hidden()\" (change)=\"toggle()\" aria-label=\"Hide amounts\" />\n */\n@Directive({\n selector: 'input[type=checkbox][uiSwitch]',\n host: {\n role: 'switch',\n '[class]': 'classes',\n },\n})\nexport class UiSwitch {\n protected readonly classes = CLASSES;\n\n constructor() {\n holdTransitionsUntilRendered();\n }\n}\n"],"mappings":";;;AAIA,MAAM,UACJ;AAeF,IAAa,WAAb,MAAa,SAAQ;CACA,UAAU;CAE7B,cAAA;EACE,6BAA4B;CAC9B;CALW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAQ,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAR,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAQ,cAAA;EAAA,UAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,SAAA;GAAA,YAAA,EAAA,SAAA,UAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAR,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EAPpB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM;IACJ,MAAM;IACN,WAAW;GACZ;EACF,CAAA"}
@@ -1,75 +1,119 @@
1
- import { DOCUMENT } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { inject, DestroyRef, Component, input, booleanAttribute, computed } from '@angular/core';
4
-
5
- const HEIGHT_PROPERTY = '--tab-bar-height';
6
- const HEIGHT = 'calc(52px + env(safe-area-inset-bottom))';
7
- const TAB_CLASSES = 'flex h-[52px] flex-col items-center justify-center gap-[3px] touch-manipulation select-none transition-transform duration-(--duration-press) ease-out active:scale-(--press-scale) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--ring)';
8
- const INACTIVE_TAB_CLASSES = 'font-medium text-(--muted-foreground)';
9
- const ACTIVE_TAB_CLASSES = 'font-semibold text-(--foreground)';
10
- /**
11
- * Bottom navigation bar for iPhone: 52px of tabs plus the home indicator's safe area. While it is on the
12
- * page it publishes that height as `--tab-bar-height` on the root element, which `ui-action-bar` and
13
- * `ui-toaster` sit above; use it rather than restating 52px for anything that must clear the bar.
14
- *
15
- * @example
16
- * <nav ui-tab-bar>
17
- * <a ui-tab [active]="url === '/'" routerLink="/"><lucide-icon tabIcon name="house" />Portfolio</a>
18
- * </nav>
19
- */
20
- class UiTabBar {
21
- constructor() {
22
- const root = inject(DOCUMENT).documentElement;
23
- root.style.setProperty(HEIGHT_PROPERTY, HEIGHT);
24
- inject(DestroyRef).onDestroy(() => root.style.removeProperty(HEIGHT_PROPERTY));
25
- }
26
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTabBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
27
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: UiTabBar, isStandalone: true, selector: "nav[ui-tab-bar]", host: { classAttribute: "grid grid-flow-col auto-cols-fr items-stretch bg-(--background)/90 backdrop-blur [@media(prefers-reduced-transparency:reduce)]:bg-(--background) shadow-[inset_0_1px_0_var(--hairline)] pb-[env(safe-area-inset-bottom)]" }, ngImport: i0, template: '<ng-content />', isInline: true });
28
- }
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTabBar, decorators: [{
30
- type: Component,
31
- args: [{
32
- selector: 'nav[ui-tab-bar]',
33
- template: '<ng-content />',
34
- host: {
35
- class: 'grid grid-flow-col auto-cols-fr items-stretch bg-(--background)/90 backdrop-blur [@media(prefers-reduced-transparency:reduce)]:bg-(--background) shadow-[inset_0_1px_0_var(--hairline)] pb-[env(safe-area-inset-bottom)]',
36
- },
37
- }]
38
- }], ctorParameters: () => [] });
39
- /**
40
- * One destination of `ui-tab-bar`.
41
- *
42
- * @example
43
- * <a ui-tab active routerLink="/"><lucide-icon tabIcon name="house" />Portfolio</a>
44
- */
45
- class UiTab {
46
- active = input(false, { ...(ngDevMode ? { debugName: "active" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
47
- classes = computed(() => `${TAB_CLASSES} ${this.active() ? ACTIVE_TAB_CLASSES : INACTIVE_TAB_CLASSES}`, /* @ts-ignore */
48
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
49
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTab, deps: [], target: i0.ɵɵFactoryTarget.Component });
50
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: UiTab, isStandalone: true, selector: "a[ui-tab]", inputs: { active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.aria-current": "active() ? 'page' : null" } }, ngImport: i0, template: `
1
+ import { DOCUMENT } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Component, DestroyRef, booleanAttribute, computed, inject, input } from "@angular/core";
4
+ const HEIGHT_PROPERTY = "--tab-bar-height";
5
+ const HEIGHT = "calc(52px + env(safe-area-inset-bottom))";
6
+ const TAB_CLASSES = "flex h-[52px] flex-col items-center justify-center gap-[3px] touch-manipulation select-none transition-transform duration-(--duration-press) ease-out active:scale-(--press-scale) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--ring)";
7
+ const INACTIVE_TAB_CLASSES = "font-medium text-(--muted-foreground)";
8
+ const ACTIVE_TAB_CLASSES = "font-semibold text-(--foreground)";
9
+ var UiTabBar = class UiTabBar {
10
+ constructor() {
11
+ const root = inject(DOCUMENT).documentElement;
12
+ root.style.setProperty(HEIGHT_PROPERTY, HEIGHT);
13
+ inject(DestroyRef).onDestroy(() => root.style.removeProperty(HEIGHT_PROPERTY));
14
+ }
15
+ static ɵfac = i0.ɵɵngDeclareFactory({
16
+ minVersion: "12.0.0",
17
+ version: "22.2.0",
18
+ ngImport: i0,
19
+ type: UiTabBar,
20
+ deps: [],
21
+ target: i0.ɵɵFactoryTarget.Component
22
+ });
23
+ static ɵcmp = i0.ɵɵngDeclareComponent({
24
+ minVersion: "14.0.0",
25
+ version: "22.2.0",
26
+ type: UiTabBar,
27
+ isStandalone: true,
28
+ selector: "nav[ui-tab-bar]",
29
+ host: { classAttribute: "grid grid-flow-col auto-cols-fr items-stretch bg-(--background)/90 backdrop-blur [@media(prefers-reduced-transparency:reduce)]:bg-(--background) shadow-[inset_0_1px_0_var(--hairline)] pb-[env(safe-area-inset-bottom)]" },
30
+ ngImport: i0,
31
+ template: "<ng-content />",
32
+ isInline: true
33
+ });
34
+ };
35
+ i0.ɵɵngDeclareClassMetadata({
36
+ minVersion: "12.0.0",
37
+ version: "22.2.0",
38
+ ngImport: i0,
39
+ type: UiTabBar,
40
+ decorators: [{
41
+ type: Component,
42
+ args: [{
43
+ selector: "nav[ui-tab-bar]",
44
+ template: "<ng-content />",
45
+ host: { class: "grid grid-flow-col auto-cols-fr items-stretch bg-(--background)/90 backdrop-blur [@media(prefers-reduced-transparency:reduce)]:bg-(--background) shadow-[inset_0_1px_0_var(--hairline)] pb-[env(safe-area-inset-bottom)]" }
46
+ }]
47
+ }],
48
+ ctorParameters: () => []
49
+ });
50
+ var UiTab = class UiTab {
51
+ active = input(false, {
52
+ ...ngDevMode ? { debugName: "active" } : /* istanbul ignore next */ {},
53
+ transform: booleanAttribute
54
+ });
55
+ classes = computed(() => `${TAB_CLASSES} ${this.active() ? ACTIVE_TAB_CLASSES : INACTIVE_TAB_CLASSES}`, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
56
+ static ɵfac = i0.ɵɵngDeclareFactory({
57
+ minVersion: "12.0.0",
58
+ version: "22.2.0",
59
+ ngImport: i0,
60
+ type: UiTab,
61
+ deps: [],
62
+ target: i0.ɵɵFactoryTarget.Component
63
+ });
64
+ static ɵcmp = i0.ɵɵngDeclareComponent({
65
+ minVersion: "17.1.0",
66
+ version: "22.2.0",
67
+ type: UiTab,
68
+ isStandalone: true,
69
+ selector: "a[ui-tab]",
70
+ inputs: { active: {
71
+ classPropertyName: "active",
72
+ publicName: "active",
73
+ isSignal: true,
74
+ isRequired: false,
75
+ transformFunction: null
76
+ } },
77
+ host: { properties: {
78
+ "class": "classes()",
79
+ "attr.aria-current": "active() ? 'page' : null"
80
+ } },
81
+ ngImport: i0,
82
+ template: `
51
83
  <span class="size-6" data-tab-icon><ng-content select="[tabIcon]" /></span>
52
84
  <span class="text-caption leading-none" data-tab-label><ng-content /></span>
53
- `, isInline: true });
54
- }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTab, decorators: [{
56
- type: Component,
57
- args: [{
58
- selector: 'a[ui-tab]',
59
- template: `
85
+ `,
86
+ isInline: true
87
+ });
88
+ };
89
+ i0.ɵɵngDeclareClassMetadata({
90
+ minVersion: "12.0.0",
91
+ version: "22.2.0",
92
+ ngImport: i0,
93
+ type: UiTab,
94
+ decorators: [{
95
+ type: Component,
96
+ args: [{
97
+ selector: "a[ui-tab]",
98
+ template: `
60
99
  <span class="size-6" data-tab-icon><ng-content select="[tabIcon]" /></span>
61
100
  <span class="text-caption leading-none" data-tab-label><ng-content /></span>
62
101
  `,
63
- host: {
64
- '[class]': 'classes()',
65
- '[attr.aria-current]': "active() ? 'page' : null",
66
- },
67
- }]
68
- }], propDecorators: { active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }] } });
69
-
70
- /**
71
- * Generated bundle index. Do not edit.
72
- */
73
-
102
+ host: {
103
+ "[class]": "classes()",
104
+ "[attr.aria-current]": "active() ? 'page' : null"
105
+ }
106
+ }]
107
+ }],
108
+ propDecorators: { active: [{
109
+ type: i0.Input,
110
+ args: [{
111
+ isSignal: true,
112
+ alias: "active",
113
+ required: false
114
+ }]
115
+ }] }
116
+ });
74
117
  export { UiTab, UiTabBar };
75
- //# sourceMappingURL=joanroucoux-cairn-ui-tab-bar.mjs.map
118
+
119
+ //# sourceMappingURL=joanroucoux-cairn-ui-tab-bar.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"joanroucoux-cairn-ui-tab-bar.mjs","sources":["../../../projects/ui/tab-bar/tab-bar.ts","../../../projects/ui/tab-bar/joanroucoux-cairn-ui-tab-bar.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { Component, DestroyRef, booleanAttribute, computed, inject, input } from '@angular/core';\n\nconst HEIGHT_PROPERTY = '--tab-bar-height';\n\nconst HEIGHT = 'calc(52px + env(safe-area-inset-bottom))';\n\nconst TAB_CLASSES =\n 'flex h-[52px] flex-col items-center justify-center gap-[3px] touch-manipulation select-none transition-transform duration-(--duration-press) ease-out active:scale-(--press-scale) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--ring)';\n\nconst INACTIVE_TAB_CLASSES = 'font-medium text-(--muted-foreground)';\n\nconst ACTIVE_TAB_CLASSES = 'font-semibold text-(--foreground)';\n\n/**\n * Bottom navigation bar for iPhone: 52px of tabs plus the home indicator's safe area. While it is on the\n * page it publishes that height as `--tab-bar-height` on the root element, which `ui-action-bar` and\n * `ui-toaster` sit above; use it rather than restating 52px for anything that must clear the bar.\n *\n * @example\n * <nav ui-tab-bar>\n * <a ui-tab [active]=\"url === '/'\" routerLink=\"/\"><lucide-icon tabIcon name=\"house\" />Portfolio</a>\n * </nav>\n */\n@Component({\n selector: 'nav[ui-tab-bar]',\n template: '<ng-content />',\n host: {\n class:\n 'grid grid-flow-col auto-cols-fr items-stretch bg-(--background)/90 backdrop-blur [@media(prefers-reduced-transparency:reduce)]:bg-(--background) shadow-[inset_0_1px_0_var(--hairline)] pb-[env(safe-area-inset-bottom)]',\n },\n})\nexport class UiTabBar {\n constructor() {\n const root = inject(DOCUMENT).documentElement;\n\n root.style.setProperty(HEIGHT_PROPERTY, HEIGHT);\n inject(DestroyRef).onDestroy(() => root.style.removeProperty(HEIGHT_PROPERTY));\n }\n}\n\n/**\n * One destination of `ui-tab-bar`.\n *\n * @example\n * <a ui-tab active routerLink=\"/\"><lucide-icon tabIcon name=\"house\" />Portfolio</a>\n */\n@Component({\n selector: 'a[ui-tab]',\n template: `\n <span class=\"size-6\" data-tab-icon><ng-content select=\"[tabIcon]\" /></span>\n <span class=\"text-caption leading-none\" data-tab-label><ng-content /></span>\n `,\n host: {\n '[class]': 'classes()',\n '[attr.aria-current]': \"active() ? 'page' : null\",\n },\n})\nexport class UiTab {\n readonly active = input(false, { transform: booleanAttribute });\n\n protected readonly classes = computed(\n () => `${TAB_CLASSES} ${this.active() ? ACTIVE_TAB_CLASSES : INACTIVE_TAB_CLASSES}`,\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA,MAAM,eAAe,GAAG,kBAAkB;AAE1C,MAAM,MAAM,GAAG,0CAA0C;A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,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAL,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAK,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,mBAAA,EAAA,0BAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EATN;;;AAGT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAMU,KAAK,EAAA,UAAA,EAAA,CAAA;kBAXjB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,QAAQ,EAAE;;;AAGT,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,qBAAqB,EAAE,0BAA0B;AAClD,qBAAA;AACF,iBAAA;;;ACzDD;;AAEG;;;;"}
1
+ {"version":3,"file":"joanroucoux-cairn-ui-tab-bar.mjs","names":[],"sources":["../../../projects/ui/tab-bar/tab-bar.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { Component, DestroyRef, booleanAttribute, computed, inject, input } from '@angular/core';\n\nconst HEIGHT_PROPERTY = '--tab-bar-height';\n\nconst HEIGHT = 'calc(52px + env(safe-area-inset-bottom))';\n\nconst TAB_CLASSES =\n 'flex h-[52px] flex-col items-center justify-center gap-[3px] touch-manipulation select-none transition-transform duration-(--duration-press) ease-out active:scale-(--press-scale) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--ring)';\n\nconst INACTIVE_TAB_CLASSES = 'font-medium text-(--muted-foreground)';\n\nconst ACTIVE_TAB_CLASSES = 'font-semibold text-(--foreground)';\n\n/**\n * Bottom navigation bar for iPhone. While it is on the page it publishes its height as\n * `--tab-bar-height` on the root element, which `ui-action-bar` and `ui-toaster` sit above: use it\n * for anything else that must clear the bar.\n *\n * @example\n * <nav ui-tab-bar>\n * <a ui-tab [active]=\"url === '/'\" routerLink=\"/\"><lucide-icon tabIcon name=\"house\" />Portfolio</a>\n * </nav>\n */\n@Component({\n selector: 'nav[ui-tab-bar]',\n template: '<ng-content />',\n host: {\n class:\n 'grid grid-flow-col auto-cols-fr items-stretch bg-(--background)/90 backdrop-blur [@media(prefers-reduced-transparency:reduce)]:bg-(--background) shadow-[inset_0_1px_0_var(--hairline)] pb-[env(safe-area-inset-bottom)]',\n },\n})\nexport class UiTabBar {\n constructor() {\n const root = inject(DOCUMENT).documentElement;\n\n root.style.setProperty(HEIGHT_PROPERTY, HEIGHT);\n inject(DestroyRef).onDestroy(() => root.style.removeProperty(HEIGHT_PROPERTY));\n }\n}\n\n/**\n * One destination of `ui-tab-bar`.\n *\n * @example\n * <a ui-tab active routerLink=\"/\"><lucide-icon tabIcon name=\"house\" />Portfolio</a>\n */\n@Component({\n selector: 'a[ui-tab]',\n template: `\n <span class=\"size-6\" data-tab-icon><ng-content select=\"[tabIcon]\" /></span>\n <span class=\"text-caption leading-none\" data-tab-label><ng-content /></span>\n `,\n host: {\n '[class]': 'classes()',\n '[attr.aria-current]': \"active() ? 'page' : null\",\n },\n})\nexport class UiTab {\n readonly active = input(false, { transform: booleanAttribute });\n\n protected readonly classes = computed(\n () => `${TAB_CLASSES} ${this.active() ? ACTIVE_TAB_CLASSES : INACTIVE_TAB_CLASSES}`,\n );\n}\n"],"mappings":";;;AAGA,MAAM,kBAAkB;AAExB,MAAM,SAAS;AAEf,MAA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