@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,69 +1,123 @@
1
- import * as i0 from '@angular/core';
2
- import { input, computed, forwardRef, Directive } from '@angular/core';
3
- import { UI_CONTROL } from '@joanroucoux/cairn-ui/control';
4
- import { CONTROL_BASE_CLASSES, CONTROL_SIZE_CLASSES } from '@joanroucoux/cairn-ui/input';
5
-
6
- const SELECT_CLASSES = 'cursor-pointer appearance-none pr-10 bg-(image:--chevron-down) bg-no-repeat bg-[position:right_0.75rem_center] bg-[size:1.125rem]';
7
- // Spelled out prefix included: Tailwind scans for literal strings, so a prefix applied in code
8
- // emits nothing.
1
+ import * as i0 from "@angular/core";
2
+ import { Directive, computed, forwardRef, input } from "@angular/core";
3
+ import { UI_CONTROL } from "@joanroucoux/cairn-ui/control";
4
+ import { CONTROL_BASE_CLASSES, CONTROL_SIZE_CLASSES } from "@joanroucoux/cairn-ui/input";
5
+ const SELECT_CLASSES = "cursor-pointer appearance-none pr-10 bg-(image:--chevron-down) bg-no-repeat bg-[position:right_0.75rem_center] bg-[size:1.125rem]";
9
6
  const PICKER_CLASSES = [
10
- 'pointer-fine:supports-[appearance:base-select]:[appearance:base-select]',
11
- 'pointer-fine:supports-[appearance:base-select]:items-center',
12
- 'pointer-fine:supports-[appearance:base-select]:[&_option]:cursor-pointer',
13
- 'pointer-fine:supports-[appearance:base-select]:[&_option]:rounded-control',
14
- 'pointer-fine:supports-[appearance:base-select]:[&_option]:px-2.5',
15
- 'pointer-fine:supports-[appearance:base-select]:[&_option]:py-2',
16
- 'pointer-fine:supports-[appearance:base-select]:[&_option:hover]:bg-(--soft)',
17
- 'pointer-fine:supports-[appearance:base-select]:[&_option:focus]:bg-(--soft)',
18
- 'pointer-fine:supports-[appearance:base-select]:[&_option:checked]:font-medium',
19
- '[&::picker-icon]:hidden',
20
- '[&::picker(select)]:[appearance:base-select]',
21
- '[&::picker(select)]:my-1.5',
22
- '[&::picker(select)]:rounded-control',
23
- '[&::picker(select)]:border',
24
- '[&::picker(select)]:border-(--border)',
25
- '[&::picker(select)]:bg-(--card)',
26
- '[&::picker(select)]:[position-try-fallbacks:none]',
27
- '[&::picker(select)]:overflow-y-auto',
28
- '[&::picker(select)]:p-1',
29
- '[&::picker(select)]:text-(--card-foreground)',
30
- ].join(' ');
31
- /**
32
- * Styled native select, drop-down list included where the browser allows it. It stays a native
33
- * `<select>`: keyboard, typeahead and semantics come from the platform, not from a rebuilt listbox.
34
- *
35
- * Declares the `errors` and `touched` inputs Angular's `[formField]` fills, so a `ui-field` around
36
- * it can show the message without any binding here.
37
- *
38
- * @example
39
- * <select uiSelect><option value="pea">PEA</option></select>
40
- */
41
- class UiSelect {
42
- size = input('md', /* @ts-ignore */
43
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
44
- errors = input([], /* @ts-ignore */
45
- ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
46
- touched = input(false, /* @ts-ignore */
47
- ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
48
- classes = computed(() => `${CONTROL_BASE_CLASSES} bg-(--background) ${SELECT_CLASSES} ${PICKER_CLASSES} ${CONTROL_SIZE_CLASSES[this.size()]}`, /* @ts-ignore */
49
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
50
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiSelect, deps: [], target: i0.ɵɵFactoryTarget.Directive });
51
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: UiSelect, isStandalone: true, selector: "select[uiSelect]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiSelect) }], ngImport: i0 });
52
- }
53
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiSelect, decorators: [{
54
- type: Directive,
55
- args: [{
56
- selector: 'select[uiSelect]',
57
- host: {
58
- '[class]': 'classes()',
59
- },
60
- providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiSelect) }],
61
- }]
62
- }], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }] } });
63
-
64
- /**
65
- * Generated bundle index. Do not edit.
66
- */
67
-
7
+ "pointer-fine:supports-[appearance:base-select]:[appearance:base-select]",
8
+ "pointer-fine:supports-[appearance:base-select]:items-center",
9
+ "pointer-fine:supports-[appearance:base-select]:[&_option]:cursor-pointer",
10
+ "pointer-fine:supports-[appearance:base-select]:[&_option]:rounded-control",
11
+ "pointer-fine:supports-[appearance:base-select]:[&_option]:px-2.5",
12
+ "pointer-fine:supports-[appearance:base-select]:[&_option]:py-2",
13
+ "pointer-fine:supports-[appearance:base-select]:[&_option:hover]:bg-(--soft)",
14
+ "pointer-fine:supports-[appearance:base-select]:[&_option:focus]:bg-(--soft)",
15
+ "pointer-fine:supports-[appearance:base-select]:[&_option:checked]:font-medium",
16
+ "[&::picker-icon]:hidden",
17
+ "[&::picker(select)]:[appearance:base-select]",
18
+ "[&::picker(select)]:my-1.5",
19
+ "[&::picker(select)]:rounded-control",
20
+ "[&::picker(select)]:border",
21
+ "[&::picker(select)]:border-(--border)",
22
+ "[&::picker(select)]:bg-(--card)",
23
+ "[&::picker(select)]:[position-try-fallbacks:none]",
24
+ "[&::picker(select)]:overflow-y-auto",
25
+ "[&::picker(select)]:p-1",
26
+ "[&::picker(select)]:text-(--card-foreground)"
27
+ ].join(" ");
28
+ var UiSelect = class UiSelect {
29
+ size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
30
+ errors = input([], ...ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []);
31
+ touched = input(false, ...ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []);
32
+ classes = computed(() => `${CONTROL_BASE_CLASSES} bg-(--background) ${SELECT_CLASSES} ${PICKER_CLASSES} ${CONTROL_SIZE_CLASSES[this.size()]}`, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
33
+ static ɵfac = i0.ɵɵngDeclareFactory({
34
+ minVersion: "12.0.0",
35
+ version: "22.2.0",
36
+ ngImport: i0,
37
+ type: UiSelect,
38
+ deps: [],
39
+ target: i0.ɵɵFactoryTarget.Directive
40
+ });
41
+ static ɵdir = i0.ɵɵngDeclareDirective({
42
+ minVersion: "17.1.0",
43
+ version: "22.2.0",
44
+ type: UiSelect,
45
+ isStandalone: true,
46
+ selector: "select[uiSelect]",
47
+ inputs: {
48
+ size: {
49
+ classPropertyName: "size",
50
+ publicName: "size",
51
+ isSignal: true,
52
+ isRequired: false,
53
+ transformFunction: null
54
+ },
55
+ errors: {
56
+ classPropertyName: "errors",
57
+ publicName: "errors",
58
+ isSignal: true,
59
+ isRequired: false,
60
+ transformFunction: null
61
+ },
62
+ touched: {
63
+ classPropertyName: "touched",
64
+ publicName: "touched",
65
+ isSignal: true,
66
+ isRequired: false,
67
+ transformFunction: null
68
+ }
69
+ },
70
+ host: { properties: { "class": "classes()" } },
71
+ providers: [{
72
+ provide: UI_CONTROL,
73
+ useExisting: forwardRef(() => UiSelect)
74
+ }],
75
+ ngImport: i0
76
+ });
77
+ };
78
+ i0.ɵɵngDeclareClassMetadata({
79
+ minVersion: "12.0.0",
80
+ version: "22.2.0",
81
+ ngImport: i0,
82
+ type: UiSelect,
83
+ decorators: [{
84
+ type: Directive,
85
+ args: [{
86
+ selector: "select[uiSelect]",
87
+ host: { "[class]": "classes()" },
88
+ providers: [{
89
+ provide: UI_CONTROL,
90
+ useExisting: forwardRef(() => UiSelect)
91
+ }]
92
+ }]
93
+ }],
94
+ propDecorators: {
95
+ size: [{
96
+ type: i0.Input,
97
+ args: [{
98
+ isSignal: true,
99
+ alias: "size",
100
+ required: false
101
+ }]
102
+ }],
103
+ errors: [{
104
+ type: i0.Input,
105
+ args: [{
106
+ isSignal: true,
107
+ alias: "errors",
108
+ required: false
109
+ }]
110
+ }],
111
+ touched: [{
112
+ type: i0.Input,
113
+ args: [{
114
+ isSignal: true,
115
+ alias: "touched",
116
+ required: false
117
+ }]
118
+ }]
119
+ }
120
+ });
68
121
  export { UiSelect };
69
- //# sourceMappingURL=joanroucoux-cairn-ui-select.mjs.map
122
+
123
+ //# sourceMappingURL=joanroucoux-cairn-ui-select.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"joanroucoux-cairn-ui-select.mjs","sources":["../../../projects/ui/select/select.ts","../../../projects/ui/select/joanroucoux-cairn-ui-select.ts"],"sourcesContent":["import { Directive, computed, forwardRef, input } from '@angular/core';\n\nimport { UI_CONTROL, type UiControl, type UiControlError } from '@joanroucoux/cairn-ui/control';\nimport { CONTROL_BASE_CLASSES, CONTROL_SIZE_CLASSES, type ControlSize } from '@joanroucoux/cairn-ui/input';\n\nconst SELECT_CLASSES =\n 'cursor-pointer appearance-none pr-10 bg-(image:--chevron-down) bg-no-repeat bg-[position:right_0.75rem_center] bg-[size:1.125rem]';\n\n// Spelled out prefix included: Tailwind scans for literal strings, so a prefix applied in code\n// emits nothing.\nconst PICKER_CLASSES = [\n 'pointer-fine:supports-[appearance:base-select]:[appearance:base-select]',\n 'pointer-fine:supports-[appearance:base-select]:items-center',\n 'pointer-fine:supports-[appearance:base-select]:[&_option]:cursor-pointer',\n 'pointer-fine:supports-[appearance:base-select]:[&_option]:rounded-control',\n 'pointer-fine:supports-[appearance:base-select]:[&_option]:px-2.5',\n 'pointer-fine:supports-[appearance:base-select]:[&_option]:py-2',\n 'pointer-fine:supports-[appearance:base-select]:[&_option:hover]:bg-(--soft)',\n 'pointer-fine:supports-[appearance:base-select]:[&_option:focus]:bg-(--soft)',\n 'pointer-fine:supports-[appearance:base-select]:[&_option:checked]:font-medium',\n '[&::picker-icon]:hidden',\n '[&::picker(select)]:[appearance:base-select]',\n '[&::picker(select)]:my-1.5',\n '[&::picker(select)]:rounded-control',\n '[&::picker(select)]:border',\n '[&::picker(select)]:border-(--border)',\n '[&::picker(select)]:bg-(--card)',\n '[&::picker(select)]:[position-try-fallbacks:none]',\n '[&::picker(select)]:overflow-y-auto',\n '[&::picker(select)]:p-1',\n '[&::picker(select)]:text-(--card-foreground)',\n].join(' ');\n\n/**\n * Styled native select, drop-down list included where the browser allows it. It stays a native\n * `<select>`: keyboard, typeahead and semantics come from the platform, not from a rebuilt listbox.\n *\n * Declares the `errors` and `touched` inputs Angular's `[formField]` fills, so a `ui-field` around\n * it can show the message without any binding here.\n *\n * @example\n * <select uiSelect><option value=\"pea\">PEA</option></select>\n */\n@Directive({\n selector: 'select[uiSelect]',\n host: {\n '[class]': 'classes()',\n },\n providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiSelect) }],\n})\nexport class UiSelect implements UiControl {\n readonly size = input<ControlSize>('md');\n readonly errors = input<readonly UiControlError[]>([]);\n readonly touched = input(false);\n\n protected readonly classes = computed(\n () =>\n `${CONTROL_BASE_CLASSES} bg-(--background) ${SELECT_CLASSES} ${PICKER_CLASSES} ${CONTROL_SIZE_CLASSES[this.size()]}`,\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAKA,MAAM,cAAc,GAClB,mIAAmI;AAErI;AACA;AACA,MAAM,cAAc,GAAG;IACrB,yEAAyE;IACzE,6DAA6D;IAC7D,0EAA0E;IAC1E,2EAA2E;IAC3E,kEAAkE;IAClE,gEAAgE;IAChE,6EAA6E;IAC7E,6EAA6E;IAC7E,+EAA+E;IAC/E,yBAAyB;IACzB,8CAA8C;IAC9C,4BAA4B;IAC5B,qCAAqC;IACrC,4BAA4B;IAC5B,uCAAuC;IACvC,iCAAiC;IACjC,mDAAmD;IACnD,qCAAqC;IACrC,yBAAyB;IACzB,8CAA8C;AAC/C,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC;AAEX;;;;;;;;;AASG;MAQU,QAAQ,CAAA;IACV,IAAI,GAAG,KAAK,CAAc,IAAI;6EAAC;IAC/B,MAAM,GAAG,KAAK,CAA4B,EAAE;+EAAC;IAC7C,OAAO,GAAG,KAAK,CAAC,KAAK;gFAAC;IAEZ,OAAO,GAAG,QAAQ,CACnC,MACE,CAAA,EAAG,oBAAoB,CAAA,mBAAA,EAAsB,cAAc,IAAI,cAAc,CAAA,CAAA,EAAI,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA,CAAE;gFACvH;uGARU,QAAQ,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAR,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,QAAQ,yeAFR,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,QAAQ,CAAC,EAAE,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAElE,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAPpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,WAAW;AACvB,qBAAA;AACD,oBAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,MAAK,QAAS,CAAC,EAAE,CAAC;AAC9E,iBAAA;;;ACjDD;;AAEG;;;;"}
1
+ {"version":3,"file":"joanroucoux-cairn-ui-select.mjs","names":[],"sources":["../../../projects/ui/select/select.ts"],"sourcesContent":["import { Directive, computed, forwardRef, input } from '@angular/core';\n\nimport { UI_CONTROL, type UiControl, type UiControlError } from '@joanroucoux/cairn-ui/control';\nimport { CONTROL_BASE_CLASSES, CONTROL_SIZE_CLASSES, type ControlSize } from '@joanroucoux/cairn-ui/input';\n\nconst SELECT_CLASSES =\n 'cursor-pointer appearance-none pr-10 bg-(image:--chevron-down) bg-no-repeat bg-[position:right_0.75rem_center] bg-[size:1.125rem]';\n\n// Tailwind scans for literal strings: build no class by prefixing in code.\nconst PICKER_CLASSES = [\n 'pointer-fine:supports-[appearance:base-select]:[appearance:base-select]',\n 'pointer-fine:supports-[appearance:base-select]:items-center',\n 'pointer-fine:supports-[appearance:base-select]:[&_option]:cursor-pointer',\n 'pointer-fine:supports-[appearance:base-select]:[&_option]:rounded-control',\n 'pointer-fine:supports-[appearance:base-select]:[&_option]:px-2.5',\n 'pointer-fine:supports-[appearance:base-select]:[&_option]:py-2',\n 'pointer-fine:supports-[appearance:base-select]:[&_option:hover]:bg-(--soft)',\n 'pointer-fine:supports-[appearance:base-select]:[&_option:focus]:bg-(--soft)',\n 'pointer-fine:supports-[appearance:base-select]:[&_option:checked]:font-medium',\n '[&::picker-icon]:hidden',\n '[&::picker(select)]:[appearance:base-select]',\n '[&::picker(select)]:my-1.5',\n '[&::picker(select)]:rounded-control',\n '[&::picker(select)]:border',\n '[&::picker(select)]:border-(--border)',\n '[&::picker(select)]:bg-(--card)',\n '[&::picker(select)]:[position-try-fallbacks:none]',\n '[&::picker(select)]:overflow-y-auto',\n '[&::picker(select)]:p-1',\n '[&::picker(select)]:text-(--card-foreground)',\n].join(' ');\n\n/**\n * Styled native select, drop-down list included where the browser allows it. Declares the `errors`\n * and `touched` inputs Angular's `[formField]` fills, so a surrounding `ui-field` can show the message.\n *\n * @example\n * <select uiSelect><option value=\"pea\">PEA</option></select>\n */\n@Directive({\n selector: 'select[uiSelect]',\n host: {\n '[class]': 'classes()',\n },\n providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiSelect) }],\n})\nexport class UiSelect implements UiControl {\n readonly size = input<ControlSize>('md');\n readonly errors = input<readonly UiControlError[]>([]);\n readonly touched = input(false);\n\n protected readonly classes = computed(\n () =>\n `${CONTROL_BASE_CLASSES} bg-(--background) ${SELECT_CLASSES} ${PICKER_CLASSES} ${CONTROL_SIZE_CLASSES[this.size()]}`,\n );\n}\n"],"mappings":";;;;AAKA,MAAM,iBACJ;AAGF,MAAM,iBAAiB;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAA,CAAC,KAAK,GAAG;AAgBV,IAAa,WAAb,MAAa,SAAQ;CACV,OAAO,MAAmB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC/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from '@angular/core';
2
- import { input, computed, Component } from '@angular/core';
3
-
4
- /** Available skeleton shapes. `SkeletonShape` is derived from this tuple. */
5
- const SKELETON_SHAPES = ['text', 'figure', 'row', 'chart', 'ring', 'dot'];
6
- const LAST_LINE_WIDTH = '62%';
7
- const PULSE_ANIMATION = 'cairn-pulse var(--pulse-duration) var(--ease-out) infinite alternate';
8
- const BAR_CLASSES = 'block rounded-control bg-(--muted)';
9
- /**
10
- * Decorative, pulsing placeholder for content that is still loading, at the shape of the content
11
- * it stands in for.
12
- *
13
- * @example
14
- * <ui-skeleton shape="figure" />
15
- * <ui-skeleton [lines]="3" />
16
- */
17
- class UiSkeleton {
18
- shape = input('text', /* @ts-ignore */
19
- ...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
20
- lines = input(1, /* @ts-ignore */
21
- ...(ngDevMode ? [{ debugName: "lines" }] : /* istanbul ignore next */ []));
22
- height = input(12, /* @ts-ignore */
23
- ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
24
- size = input(232, /* @ts-ignore */
25
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
26
- animation = PULSE_ANIMATION;
27
- bars = computed(() => {
28
- const count = Math.max(1, this.lines());
29
- return Array.from({ length: count }, (_, index) => (index === count - 1 && count > 1 ? LAST_LINE_WIDTH : '100%'));
30
- }, /* @ts-ignore */
31
- ...(ngDevMode ? [{ debugName: "bars" }] : /* istanbul ignore next */ []));
32
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiSkeleton, deps: [], target: i0.ɵɵFactoryTarget.Component });
33
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiSkeleton, isStandalone: true, selector: "ui-skeleton", inputs: { shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, lines: { classPropertyName: "lines", publicName: "lines", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, classAttribute: "flex flex-col gap-2" }, ngImport: i0, template: "\n @switch (shape()) {\n @case ('figure') {\n <span class=\"block rounded-control bg-(--muted) h-10 w-65\" [style.animation]=\"animation\"></span>\n }\n @case ('row') {\n <span class=\"flex h-14 items-center justify-between gap-4\">\n <span class=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <span class=\"block rounded-control bg-(--muted) h-4 w-3/5\" [style.animation]=\"animation\"></span>\n <span class=\"block rounded-control bg-(--muted) h-3 w-20\" [style.animation]=\"animation\"></span>\n </span>\n <span class=\"block rounded-control bg-(--muted) h-4 w-[90px] flex-none\" [style.animation]=\"animation\"></span>\n </span>\n }\n @case ('chart') {\n <span class=\"rounded-control min-h-50 w-full flex-1 bg-(--muted)\" [style.animation]=\"animation\"></span>\n }\n @case ('dot') {\n <span class=\"rounded-pill size-3 bg-(--muted)\" [style.animation]=\"animation\"></span>\n }\n @case ('ring') {\n <span\n class=\"rounded-pill shadow-[inset_0_0_0_30px_var(--muted)]\"\n [style.animation]=\"animation\"\n [style.height.px]=\"size()\"\n [style.width.px]=\"size()\"\n ></span>\n }\n @default {\n @for (line of bars(); track $index) {\n <span\n class=\"block rounded-control bg-(--muted)\"\n [style.animation]=\"animation\"\n [style.height.px]=\"height()\"\n [style.width]=\"line\"\n ></span>\n }\n }\n }\n ", isInline: true });
34
- }
35
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiSkeleton, decorators: [{
36
- type: Component,
37
- args: [{
38
- selector: 'ui-skeleton',
39
- template: `
1
+ import * as i0 from "@angular/core";
2
+ import { Component, computed, input } from "@angular/core";
3
+ const SKELETON_SHAPES = [
4
+ "text",
5
+ "figure",
6
+ "row",
7
+ "chart",
8
+ "ring",
9
+ "dot"
10
+ ];
11
+ const LAST_LINE_WIDTH = "62%";
12
+ const PULSE_ANIMATION = "cairn-pulse var(--pulse-duration) var(--ease-out) infinite alternate";
13
+ const BAR_CLASSES = "block rounded-control bg-(--muted)";
14
+ var UiSkeleton = class UiSkeleton {
15
+ shape = input("text", ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
16
+ lines = input(1, ...ngDevMode ? [{ debugName: "lines" }] : /* istanbul ignore next */ []);
17
+ height = input(12, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
18
+ size = input(232, ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
19
+ animation = PULSE_ANIMATION;
20
+ bars = computed(() => {
21
+ const count = Math.max(1, this.lines());
22
+ return Array.from({ length: count }, (_, index) => index === count - 1 && count > 1 ? LAST_LINE_WIDTH : "100%");
23
+ }, ...ngDevMode ? [{ debugName: "bars" }] : /* istanbul ignore next */ []);
24
+ static ɵfac = i0.ɵɵngDeclareFactory({
25
+ minVersion: "12.0.0",
26
+ version: "22.2.0",
27
+ ngImport: i0,
28
+ type: UiSkeleton,
29
+ deps: [],
30
+ target: i0.ɵɵFactoryTarget.Component
31
+ });
32
+ static ɵcmp = i0.ɵɵngDeclareComponent({
33
+ minVersion: "17.0.0",
34
+ version: "22.2.0",
35
+ type: UiSkeleton,
36
+ isStandalone: true,
37
+ selector: "ui-skeleton",
38
+ inputs: {
39
+ shape: {
40
+ classPropertyName: "shape",
41
+ publicName: "shape",
42
+ isSignal: true,
43
+ isRequired: false,
44
+ transformFunction: null
45
+ },
46
+ lines: {
47
+ classPropertyName: "lines",
48
+ publicName: "lines",
49
+ isSignal: true,
50
+ isRequired: false,
51
+ transformFunction: null
52
+ },
53
+ height: {
54
+ classPropertyName: "height",
55
+ publicName: "height",
56
+ isSignal: true,
57
+ isRequired: false,
58
+ transformFunction: null
59
+ },
60
+ size: {
61
+ classPropertyName: "size",
62
+ publicName: "size",
63
+ isSignal: true,
64
+ isRequired: false,
65
+ transformFunction: null
66
+ }
67
+ },
68
+ host: {
69
+ attributes: { "aria-hidden": "true" },
70
+ classAttribute: "flex flex-col gap-2"
71
+ },
72
+ ngImport: i0,
73
+ template: "\n @switch (shape()) {\n @case ('figure') {\n <span class=\"block rounded-control bg-(--muted) h-10 w-65\" [style.animation]=\"animation\"></span>\n }\n @case ('row') {\n <span class=\"flex h-14 items-center justify-between gap-4\">\n <span class=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <span class=\"block rounded-control bg-(--muted) h-4 w-3/5\" [style.animation]=\"animation\"></span>\n <span class=\"block rounded-control bg-(--muted) h-3 w-20\" [style.animation]=\"animation\"></span>\n </span>\n <span class=\"block rounded-control bg-(--muted) h-4 w-[90px] flex-none\" [style.animation]=\"animation\"></span>\n </span>\n }\n @case ('chart') {\n <span class=\"rounded-control min-h-50 w-full flex-1 bg-(--muted)\" [style.animation]=\"animation\"></span>\n }\n @case ('dot') {\n <span class=\"rounded-pill size-3 bg-(--muted)\" [style.animation]=\"animation\"></span>\n }\n @case ('ring') {\n <span\n class=\"rounded-pill shadow-[inset_0_0_0_30px_var(--muted)]\"\n [style.animation]=\"animation\"\n [style.height.px]=\"size()\"\n [style.width.px]=\"size()\"\n ></span>\n }\n @default {\n @for (line of bars(); track $index) {\n <span\n class=\"block rounded-control bg-(--muted)\"\n [style.animation]=\"animation\"\n [style.height.px]=\"height()\"\n [style.width]=\"line\"\n ></span>\n }\n }\n }\n ",
74
+ isInline: true
75
+ });
76
+ };
77
+ i0.ɵɵngDeclareClassMetadata({
78
+ minVersion: "12.0.0",
79
+ version: "22.2.0",
80
+ ngImport: i0,
81
+ type: UiSkeleton,
82
+ decorators: [{
83
+ type: Component,
84
+ args: [{
85
+ selector: "ui-skeleton",
86
+ template: `
40
87
  @switch (shape()) {
41
88
  @case ('figure') {
42
89
  <span class="${BAR_CLASSES} h-10 w-65" [style.animation]="animation"></span>
@@ -76,16 +123,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
76
123
  }
77
124
  }
78
125
  `,
79
- host: {
80
- 'aria-hidden': 'true',
81
- class: 'flex flex-col gap-2',
82
- },
83
- }]
84
- }], propDecorators: { shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], lines: [{ type: i0.Input, args: [{ isSignal: true, alias: "lines", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
85
-
86
- /**
87
- * Generated bundle index. Do not edit.
88
- */
89
-
126
+ host: {
127
+ "aria-hidden": "true",
128
+ class: "flex flex-col gap-2"
129
+ }
130
+ }]
131
+ }],
132
+ propDecorators: {
133
+ shape: [{
134
+ type: i0.Input,
135
+ args: [{
136
+ isSignal: true,
137
+ alias: "shape",
138
+ required: false
139
+ }]
140
+ }],
141
+ lines: [{
142
+ type: i0.Input,
143
+ args: [{
144
+ isSignal: true,
145
+ alias: "lines",
146
+ required: false
147
+ }]
148
+ }],
149
+ height: [{
150
+ type: i0.Input,
151
+ args: [{
152
+ isSignal: true,
153
+ alias: "height",
154
+ required: false
155
+ }]
156
+ }],
157
+ size: [{
158
+ type: i0.Input,
159
+ args: [{
160
+ isSignal: true,
161
+ alias: "size",
162
+ required: false
163
+ }]
164
+ }]
165
+ }
166
+ });
90
167
  export { SKELETON_SHAPES, UiSkeleton };
91
- //# sourceMappingURL=joanroucoux-cairn-ui-skeleton.mjs.map
168
+
169
+ //# sourceMappingURL=joanroucoux-cairn-ui-skeleton.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"joanroucoux-cairn-ui-skeleton.mjs","sources":["../../../projects/ui/skeleton/skeleton.ts","../../../projects/ui/skeleton/joanroucoux-cairn-ui-skeleton.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\n\n/** Available skeleton shapes. `SkeletonShape` is derived from this tuple. */\nexport const SKELETON_SHAPES = ['text', 'figure', 'row', 'chart', 'ring', 'dot'] as const;\nexport type SkeletonShape = (typeof SKELETON_SHAPES)[number];\n\nconst LAST_LINE_WIDTH = '62%';\n\nconst PULSE_ANIMATION = 'cairn-pulse var(--pulse-duration) var(--ease-out) infinite alternate';\n\nconst BAR_CLASSES = 'block rounded-control bg-(--muted)';\n\n/**\n * Decorative, pulsing placeholder for content that is still loading, at the shape of the content\n * it stands in for.\n *\n * @example\n * <ui-skeleton shape=\"figure\" />\n * <ui-skeleton [lines]=\"3\" />\n */\n@Component({\n selector: 'ui-skeleton',\n template: `\n @switch (shape()) {\n @case ('figure') {\n <span class=\"${BAR_CLASSES} h-10 w-65\" [style.animation]=\"animation\"></span>\n }\n @case ('row') {\n <span class=\"flex h-14 items-center justify-between gap-4\">\n <span class=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <span class=\"${BAR_CLASSES} h-4 w-3/5\" [style.animation]=\"animation\"></span>\n <span class=\"${BAR_CLASSES} h-3 w-20\" [style.animation]=\"animation\"></span>\n </span>\n <span class=\"${BAR_CLASSES} h-4 w-[90px] flex-none\" [style.animation]=\"animation\"></span>\n </span>\n }\n @case ('chart') {\n <span class=\"rounded-control min-h-50 w-full flex-1 bg-(--muted)\" [style.animation]=\"animation\"></span>\n }\n @case ('dot') {\n <span class=\"rounded-pill size-3 bg-(--muted)\" [style.animation]=\"animation\"></span>\n }\n @case ('ring') {\n <span\n class=\"rounded-pill shadow-[inset_0_0_0_30px_var(--muted)]\"\n [style.animation]=\"animation\"\n [style.height.px]=\"size()\"\n [style.width.px]=\"size()\"\n ></span>\n }\n @default {\n @for (line of bars(); track $index) {\n <span\n class=\"${BAR_CLASSES}\"\n [style.animation]=\"animation\"\n [style.height.px]=\"height()\"\n [style.width]=\"line\"\n ></span>\n }\n }\n }\n `,\n host: {\n 'aria-hidden': 'true',\n class: 'flex flex-col gap-2',\n },\n})\nexport class UiSkeleton {\n readonly shape = input<SkeletonShape>('text');\n readonly lines = input(1);\n readonly height = input(12);\n readonly size = input(232);\n\n protected readonly animation = PULSE_ANIMATION;\n\n protected readonly bars = computed(() => {\n const count = Math.max(1, this.lines());\n\n return Array.from({ length: count }, (_, index) => (index === count - 1 && count > 1 ? LAST_LINE_WIDTH : '100%'));\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;AACO,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK;AAG/E,MAAM,eAAe,GAAG,KAAK;AAE7B,MAAM,eAAe,GAAG,sEAAsE;AAE9F,MAAM,WAAW,GAAG,oCAAoC;AAExD;;;;;;;AAOG;MAgDU,UAAU,CAAA;IACZ,KAAK,GAAG,KAAK,CAAgB,MAAM;8EAAC;IACpC,KAAK,GAAG,KAAK,CAAC,CAAC;8EAAC;IAChB,MAAM,GAAG,KAAK,CAAC,EAAE;+EAAC;IAClB,IAAI,GAAG,KAAK,CAAC,GAAG;6EAAC;IAEP,SAAS,GAAG,eAAe;AAE3B,IAAA,IAAI,GAAG,QAAQ,CAAC,MAAK;AACtC,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;AAEvC,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,MAAM,KAAK,KAAK,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,eAAe,GAAG,MAAM,CAAC,CAAC;IACnH,CAAC;6EAAC;uGAZS,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EA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/skeleton/skeleton.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\n\n/** Available skeleton shapes. */\nexport const SKELETON_SHAPES = ['text', 'figure', 'row', 'chart', 'ring', 'dot'] as const;\nexport type SkeletonShape = (typeof SKELETON_SHAPES)[number];\n\nconst LAST_LINE_WIDTH = '62%';\n\nconst PULSE_ANIMATION = 'cairn-pulse var(--pulse-duration) var(--ease-out) infinite alternate';\n\nconst BAR_CLASSES = 'block rounded-control bg-(--muted)';\n\n/**\n * Decorative, pulsing placeholder for content that is still loading.\n *\n * @example\n * <ui-skeleton shape=\"figure\" />\n * <ui-skeleton [lines]=\"3\" />\n */\n@Component({\n selector: 'ui-skeleton',\n template: `\n @switch (shape()) {\n @case ('figure') {\n <span class=\"${BAR_CLASSES} h-10 w-65\" [style.animation]=\"animation\"></span>\n }\n @case ('row') {\n <span class=\"flex h-14 items-center justify-between gap-4\">\n <span class=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <span class=\"${BAR_CLASSES} h-4 w-3/5\" [style.animation]=\"animation\"></span>\n <span class=\"${BAR_CLASSES} h-3 w-20\" [style.animation]=\"animation\"></span>\n </span>\n <span class=\"${BAR_CLASSES} h-4 w-[90px] flex-none\" [style.animation]=\"animation\"></span>\n </span>\n }\n @case ('chart') {\n <span class=\"rounded-control min-h-50 w-full flex-1 bg-(--muted)\" [style.animation]=\"animation\"></span>\n }\n @case ('dot') {\n <span class=\"rounded-pill size-3 bg-(--muted)\" [style.animation]=\"animation\"></span>\n }\n @case ('ring') {\n <span\n class=\"rounded-pill shadow-[inset_0_0_0_30px_var(--muted)]\"\n [style.animation]=\"animation\"\n [style.height.px]=\"size()\"\n [style.width.px]=\"size()\"\n ></span>\n }\n @default {\n @for (line of bars(); track $index) {\n <span\n class=\"${BAR_CLASSES}\"\n [style.animation]=\"animation\"\n [style.height.px]=\"height()\"\n [style.width]=\"line\"\n ></span>\n }\n }\n }\n `,\n host: {\n 'aria-hidden': 'true',\n class: 'flex flex-col gap-2',\n },\n})\nexport class UiSkeleton {\n readonly shape = input<SkeletonShape>('text');\n readonly lines = input(1);\n readonly height = input(12);\n readonly size = input(232);\n\n protected readonly animation = PULSE_ANIMATION;\n\n protected readonly bars = computed(() => {\n const count = Math.max(1, this.lines());\n\n return Array.from({ length: count }, (_, index) => (index === count - 1 && count > 1 ? LAST_LINE_WIDTH : '100%'));\n });\n}\n"],"mappings":";;AAGA,MAAa,kBAAkB;CAAC;CAAQ;CAAU;CAAO;CAAS;CAAQ;AAAK;AAG/E,MAAM,kBAAkB;AAExB,MAAM,kBAAkB;AAExB,MAAM,cAAc;AAwDpB,IAAa,aAAb,MAAa,WAAU;CACZ,QAAQ,MAAqB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,QAAQ,MAAM,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChB,SAAS,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAClB,OAAO,MAAM,KAAI,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAEP,YAAY;CAEZ,OAAO,eAAc;EACtC,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,MAAK,CAAE;EAEtC,OAAO,MAAM,KAAK,EAAE,QAAQ,MAAK,IAAK,GAAG,UAAW,UAAU,QAAQ,KAAK,QAAQ,IAAI,kBAAkB,MAAO;CAClH,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAZS,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAU,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAV,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAU,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,eAAA,OAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UAAA;EAAA,UAAA;CAAA,CAAA;;AAAV,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAU,YAAA,CAAA;EA/CtB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;;;uBAGW,YAAW;;;;;2BAKP,YAAW;2BACX,YAAW;;yBAEb,YAAW;;;;;;;;;;;;;;;;;;;;qBAoBf,YAAW;;;;;;;;;GAS9B,MAAM;IACJ,eAAe;IACf,OAAO;GACR;EACF,CAAA"}
@@ -1,43 +1,84 @@
1
- import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, computed, Directive } from '@angular/core';
3
-
4
- /** Available stale link sizes. `StaleLinkSize` is derived from this tuple. */
5
- const STALE_LINK_SIZES = ['caption', 'label'];
6
- const BASE_CLASSES = "relative inline-flex items-center gap-0.5 rounded-[4px] font-medium text-(--stale) hover:underline underline-offset-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:h-11 pointer-fine:before:h-10 before:-translate-y-1/2 before:content-['']";
1
+ import * as i0 from "@angular/core";
2
+ import { Directive, booleanAttribute, computed, input } from "@angular/core";
3
+ const STALE_LINK_SIZES = ["caption", "label"];
4
+ const BASE_CLASSES = "relative inline-flex items-center gap-1 pointer-fine:gap-0.5 rounded-[4px] font-medium text-(--stale) hover:underline underline-offset-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:h-11 pointer-fine:before:h-10 before:-translate-y-1/2 before:content-['']";
7
5
  const SIZE_CLASSES = {
8
- caption: 'text-caption',
9
- label: 'text-label',
6
+ caption: "text-caption",
7
+ label: "text-label"
10
8
  };
11
9
  const CHEVRON_CLASSES = "after:size-4 after:flex-none after:bg-current after:content-[''] after:mask-center after:mask-no-repeat after:mask-[url(data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m9%2018%206-6-6-6%27%2F%3E%3C%2Fsvg%3E)]";
12
- /**
13
- * Link in the stale tone, for a caption about data that is late or left out of a total, such as
14
- * "1 ligne sans cours, non comptée". Weight 500, underlined on hover, with an optional trailing
15
- * chevron. `size` is `caption` (12/17, the default) or `label` (14/20, the dashboard total's
16
- * "1 cours en retard").
17
- *
18
- * @example
19
- * <a uiStaleLink chevron size="label" routerLink="/holdings">1 cours en retard</a>
20
- */
21
- class UiStaleLink {
22
- chevron = input(false, { ...(ngDevMode ? { debugName: "chevron" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
23
- size = input('caption', /* @ts-ignore */
24
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
25
- classes = computed(() => `${BASE_CLASSES} ${SIZE_CLASSES[this.size()]}${this.chevron() ? ` ${CHEVRON_CLASSES}` : ''}`, /* @ts-ignore */
26
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
27
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiStaleLink, deps: [], target: i0.ɵɵFactoryTarget.Directive });
28
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: UiStaleLink, isStandalone: true, selector: "a[uiStaleLink]", inputs: { chevron: { classPropertyName: "chevron", publicName: "chevron", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 });
29
- }
30
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiStaleLink, decorators: [{
31
- type: Directive,
32
- args: [{
33
- selector: 'a[uiStaleLink]',
34
- host: { '[class]': 'classes()' },
35
- }]
36
- }], propDecorators: { chevron: [{ type: i0.Input, args: [{ isSignal: true, alias: "chevron", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
37
-
38
- /**
39
- * Generated bundle index. Do not edit.
40
- */
41
-
10
+ var UiStaleLink = class UiStaleLink {
11
+ chevron = input(false, {
12
+ ...ngDevMode ? { debugName: "chevron" } : /* istanbul ignore next */ {},
13
+ transform: booleanAttribute
14
+ });
15
+ size = input("caption", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
16
+ classes = computed(() => `${BASE_CLASSES} ${SIZE_CLASSES[this.size()]}${this.chevron() ? ` ${CHEVRON_CLASSES}` : ""}`, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
17
+ static ɵfac = i0.ɵɵngDeclareFactory({
18
+ minVersion: "12.0.0",
19
+ version: "22.2.0",
20
+ ngImport: i0,
21
+ type: UiStaleLink,
22
+ deps: [],
23
+ target: i0.ɵɵFactoryTarget.Directive
24
+ });
25
+ static ɵdir = i0.ɵɵngDeclareDirective({
26
+ minVersion: "17.1.0",
27
+ version: "22.2.0",
28
+ type: UiStaleLink,
29
+ isStandalone: true,
30
+ selector: "a[uiStaleLink]",
31
+ inputs: {
32
+ chevron: {
33
+ classPropertyName: "chevron",
34
+ publicName: "chevron",
35
+ isSignal: true,
36
+ isRequired: false,
37
+ transformFunction: null
38
+ },
39
+ size: {
40
+ classPropertyName: "size",
41
+ publicName: "size",
42
+ isSignal: true,
43
+ isRequired: false,
44
+ transformFunction: null
45
+ }
46
+ },
47
+ host: { properties: { "class": "classes()" } },
48
+ ngImport: i0
49
+ });
50
+ };
51
+ i0.ɵɵngDeclareClassMetadata({
52
+ minVersion: "12.0.0",
53
+ version: "22.2.0",
54
+ ngImport: i0,
55
+ type: UiStaleLink,
56
+ decorators: [{
57
+ type: Directive,
58
+ args: [{
59
+ selector: "a[uiStaleLink]",
60
+ host: { "[class]": "classes()" }
61
+ }]
62
+ }],
63
+ propDecorators: {
64
+ chevron: [{
65
+ type: i0.Input,
66
+ args: [{
67
+ isSignal: true,
68
+ alias: "chevron",
69
+ required: false
70
+ }]
71
+ }],
72
+ size: [{
73
+ type: i0.Input,
74
+ args: [{
75
+ isSignal: true,
76
+ alias: "size",
77
+ required: false
78
+ }]
79
+ }]
80
+ }
81
+ });
42
82
  export { STALE_LINK_SIZES, UiStaleLink };
43
- //# sourceMappingURL=joanroucoux-cairn-ui-stale-link.mjs.map
83
+
84
+ //# sourceMappingURL=joanroucoux-cairn-ui-stale-link.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"joanroucoux-cairn-ui-stale-link.mjs","sources":["../../../projects/ui/stale-link/stale-link.ts","../../../projects/ui/stale-link/joanroucoux-cairn-ui-stale-link.ts"],"sourcesContent":["import { Directive, booleanAttribute, computed, input } from '@angular/core';\n\n/** Available stale link sizes. `StaleLinkSize` is derived from this tuple. */\nexport const STALE_LINK_SIZES = ['caption', 'label'] as const;\nexport type StaleLinkSize = (typeof STALE_LINK_SIZES)[number];\n\nconst BASE_CLASSES =\n \"relative inline-flex items-center gap-0.5 rounded-[4px] font-medium text-(--stale) hover:underline underline-offset-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:h-11 pointer-fine:before:h-10 before:-translate-y-1/2 before:content-['']\";\n\nconst SIZE_CLASSES: Record<StaleLinkSize, string> = {\n caption: 'text-caption',\n label: 'text-label',\n};\n\nconst CHEVRON_CLASSES =\n \"after:size-4 after:flex-none after:bg-current after:content-[''] after:mask-center after:mask-no-repeat after:mask-[url(data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m9%2018%206-6-6-6%27%2F%3E%3C%2Fsvg%3E)]\";\n\n/**\n * Link in the stale tone, for a caption about data that is late or left out of a total, such as\n * \"1 ligne sans cours, non comptée\". Weight 500, underlined on hover, with an optional trailing\n * chevron. `size` is `caption` (12/17, the default) or `label` (14/20, the dashboard total's\n * \"1 cours en retard\").\n *\n * @example\n * <a uiStaleLink chevron size=\"label\" routerLink=\"/holdings\">1 cours en retard</a>\n */\n@Directive({\n selector: 'a[uiStaleLink]',\n host: { '[class]': 'classes()' },\n})\nexport class UiStaleLink {\n readonly chevron = input(false, { transform: booleanAttribute });\n readonly size = input<StaleLinkSize>('caption');\n\n protected readonly classes = computed(\n () => `${BASE_CLASSES} ${SIZE_CLASSES[this.size()]}${this.chevron() ? ` ${CHEVRON_CLASSES}` : ''}`,\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;MACa,gBAAgB,GAAG,CAAC,SAAS,EAAE,OAAO;AAGnD,MAAM,YAAY,GAChB,8UAA8U;AAEhV,MAAM,YAAY,GAAkC;AAClD,IAAA,OAAO,EAAE,cAAc;AACvB,IAAA,KAAK,EAAE,YAAY;CACpB;AAED,MAAM,eAAe,GACnB,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link.mjs","names":[],"sources":["../../../projects/ui/stale-link/stale-link.ts"],"sourcesContent":["import { Directive, booleanAttribute, computed, input } from '@angular/core';\n\n/** Available stale link sizes. */\nexport const STALE_LINK_SIZES = ['caption', 'label'] as const;\nexport type StaleLinkSize = (typeof STALE_LINK_SIZES)[number];\n\nconst BASE_CLASSES =\n \"relative inline-flex items-center gap-1 pointer-fine:gap-0.5 rounded-[4px] font-medium text-(--stale) hover:underline underline-offset-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) before:absolute before:inset-x-0 before:top-1/2 before:h-11 pointer-fine:before:h-10 before:-translate-y-1/2 before:content-['']\";\n\nconst SIZE_CLASSES: Record<StaleLinkSize, string> = {\n caption: 'text-caption',\n label: 'text-label',\n};\n\nconst CHEVRON_CLASSES =\n \"after:size-4 after:flex-none after:bg-current after:content-[''] after:mask-center after:mask-no-repeat after:mask-[url(data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m9%2018%206-6-6-6%27%2F%3E%3C%2Fsvg%3E)]\";\n\n/**\n * Link in the stale tone, for a caption about data that is late or left out of a total, such as\n * \"1 ligne sans cours, non comptée\". `chevron` adds a trailing chevron, `size` is `caption` (the\n * default) or `label`.\n *\n * @example\n * <a uiStaleLink chevron size=\"label\" routerLink=\"/holdings\">1 cours en retard</a>\n */\n@Directive({\n selector: 'a[uiStaleLink]',\n host: { '[class]': 'classes()' },\n})\nexport class UiStaleLink {\n readonly chevron = input(false, { transform: booleanAttribute });\n readonly size = input<StaleLinkSize>('caption');\n\n protected readonly classes = computed(\n () => `${BASE_CLASSES} ${SIZE_CLASSES[this.size()]}${this.chevron() ? ` ${CHEVRON_CLASSES}` : ''}`,\n );\n}\n"],"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