@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,90 +1,210 @@
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
-
5
- /** Available control sizes. `md` is the 44/40px touch target; `lg` and `xl` are the 48px sheet and sign-in fields. */
6
- const CONTROL_SIZES = ['sm', 'md', 'lg', 'xl'];
7
- const CONTROL_BASE_CLASSES = 'w-full rounded-control px-3 text-body text-(--foreground) shadow-[inset_0_0_0_1px_var(--border)] placeholder:text-(--muted-foreground) focus-visible:shadow-[inset_0_0_0_2px_var(--ring)] aria-invalid:shadow-[inset_0_0_0_2px_var(--negative)] disabled:cursor-not-allowed disabled:opacity-50';
8
- const CONTROL_SURFACES = ['background', 'card'];
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
+ const CONTROL_SIZES = [
5
+ "sm",
6
+ "md",
7
+ "lg",
8
+ "xl"
9
+ ];
10
+ const CONTROL_BASE_CLASSES = "w-full rounded-control px-3 text-body text-(--foreground) shadow-[inset_0_0_0_1px_var(--border)] placeholder:text-(--muted-foreground) focus-visible:shadow-[inset_0_0_0_2px_var(--ring)] aria-invalid:shadow-[inset_0_0_0_2px_var(--negative)] disabled:cursor-not-allowed disabled:opacity-50";
11
+ const CONTROL_SURFACES = ["background", "card"];
9
12
  const CONTROL_SURFACE_CLASSES = {
10
- background: 'bg-(--background)',
11
- card: 'bg-(--card)',
13
+ background: "bg-(--background)",
14
+ card: "bg-(--card)"
12
15
  };
13
16
  const CONTROL_SIZE_CLASSES = {
14
- sm: 'h-9',
15
- md: 'min-h-(--row-min)',
16
- lg: 'min-h-12 lg:min-h-(--row-min)',
17
- xl: 'h-12 lg:h-11',
17
+ sm: "h-9",
18
+ md: "min-h-(--row-min)",
19
+ lg: "min-h-12 lg:min-h-(--row-min)",
20
+ xl: "h-12 lg:h-11"
18
21
  };
19
- const SEARCH_CLASSES = '[&::-webkit-search-cancel-button]:appearance-none';
20
- /**
21
- * Styled native text input. A directive (not a wrapper component) so the host
22
- * stays a plain <input>: every forms flavor (ngModel, reactive, signal forms)
23
- * and every native attribute keep working without any plumbing.
24
- *
25
- * Declares the `errors` and `touched` inputs Angular's `[formField]` fills, so a `ui-field` around
26
- * it can show the message without any binding here.
27
- *
28
- * @example
29
- * <input uiInput type="email" placeholder="you@example.com" />
30
- */
31
- class UiInput {
32
- size = input('md', /* @ts-ignore */
33
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
34
- surface = input('background', /* @ts-ignore */
35
- ...(ngDevMode ? [{ debugName: "surface" }] : /* istanbul ignore next */ []));
36
- errors = input([], /* @ts-ignore */
37
- ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
38
- touched = input(false, /* @ts-ignore */
39
- ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
40
- classes = computed(() => `${CONTROL_BASE_CLASSES} ${SEARCH_CLASSES} ${CONTROL_SURFACE_CLASSES[this.surface()]} ${CONTROL_SIZE_CLASSES[this.size()]}`, /* @ts-ignore */
41
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
42
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
43
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: UiInput, isStandalone: true, selector: "input[uiInput]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, surface: { classPropertyName: "surface", publicName: "surface", 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(() => UiInput) }], ngImport: i0 });
44
- }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInput, decorators: [{
46
- type: Directive,
47
- args: [{
48
- selector: 'input[uiInput]',
49
- host: {
50
- '[class]': 'classes()',
51
- },
52
- providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiInput) }],
53
- }]
54
- }], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], surface: [{ type: i0.Input, args: [{ isSignal: true, alias: "surface", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }] } });
55
- /**
56
- * Styled native textarea. Lives beside the input because it shares every one of its
57
- * classes; it takes no size, since a textarea grows from a floor instead of sitting
58
- * at a fixed height.
59
- *
60
- * Declares the `errors` and `touched` inputs Angular's `[formField]` fills, so a `ui-field` around
61
- * it can show the message without any binding here.
62
- *
63
- * @example
64
- * <textarea uiTextarea maxlength="280"></textarea>
65
- */
66
- class UiTextarea {
67
- errors = input([], /* @ts-ignore */
68
- ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
69
- touched = input(false, /* @ts-ignore */
70
- ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
71
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTextarea, deps: [], target: i0.ɵɵFactoryTarget.Directive });
72
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: UiTextarea, isStandalone: true, selector: "textarea[uiTextarea]", inputs: { errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "w-full rounded-control px-3 text-body text-(--foreground) shadow-[inset_0_0_0_1px_var(--border)] placeholder:text-(--muted-foreground) focus-visible:shadow-[inset_0_0_0_2px_var(--ring)] aria-invalid:shadow-[inset_0_0_0_2px_var(--negative)] disabled:cursor-not-allowed disabled:opacity-50 bg-(--background) min-h-24 py-2" }, providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiTextarea) }], ngImport: i0 });
73
- }
74
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTextarea, decorators: [{
75
- type: Directive,
76
- args: [{
77
- selector: 'textarea[uiTextarea]',
78
- host: {
79
- class: `${CONTROL_BASE_CLASSES} bg-(--background) min-h-24 py-2`,
80
- },
81
- providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiTextarea) }],
82
- }]
83
- }], propDecorators: { errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }] } });
84
-
85
- /**
86
- * Generated bundle index. Do not edit.
87
- */
88
-
22
+ const SEARCH_CLASSES = "[&::-webkit-search-cancel-button]:appearance-none";
23
+ var UiInput = class UiInput {
24
+ size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
25
+ surface = input("background", ...ngDevMode ? [{ debugName: "surface" }] : /* istanbul ignore next */ []);
26
+ errors = input([], ...ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []);
27
+ touched = input(false, ...ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []);
28
+ classes = computed(() => `${CONTROL_BASE_CLASSES} ${SEARCH_CLASSES} ${CONTROL_SURFACE_CLASSES[this.surface()]} ${CONTROL_SIZE_CLASSES[this.size()]}`, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
29
+ static ɵfac = i0.ɵɵngDeclareFactory({
30
+ minVersion: "12.0.0",
31
+ version: "22.2.0",
32
+ ngImport: i0,
33
+ type: UiInput,
34
+ deps: [],
35
+ target: i0.ɵɵFactoryTarget.Directive
36
+ });
37
+ static ɵdir = i0.ɵɵngDeclareDirective({
38
+ minVersion: "17.1.0",
39
+ version: "22.2.0",
40
+ type: UiInput,
41
+ isStandalone: true,
42
+ selector: "input[uiInput]",
43
+ inputs: {
44
+ size: {
45
+ classPropertyName: "size",
46
+ publicName: "size",
47
+ isSignal: true,
48
+ isRequired: false,
49
+ transformFunction: null
50
+ },
51
+ surface: {
52
+ classPropertyName: "surface",
53
+ publicName: "surface",
54
+ isSignal: true,
55
+ isRequired: false,
56
+ transformFunction: null
57
+ },
58
+ errors: {
59
+ classPropertyName: "errors",
60
+ publicName: "errors",
61
+ isSignal: true,
62
+ isRequired: false,
63
+ transformFunction: null
64
+ },
65
+ touched: {
66
+ classPropertyName: "touched",
67
+ publicName: "touched",
68
+ isSignal: true,
69
+ isRequired: false,
70
+ transformFunction: null
71
+ }
72
+ },
73
+ host: { properties: { "class": "classes()" } },
74
+ providers: [{
75
+ provide: UI_CONTROL,
76
+ useExisting: forwardRef(() => UiInput)
77
+ }],
78
+ ngImport: i0
79
+ });
80
+ };
81
+ i0.ɵɵngDeclareClassMetadata({
82
+ minVersion: "12.0.0",
83
+ version: "22.2.0",
84
+ ngImport: i0,
85
+ type: UiInput,
86
+ decorators: [{
87
+ type: Directive,
88
+ args: [{
89
+ selector: "input[uiInput]",
90
+ host: { "[class]": "classes()" },
91
+ providers: [{
92
+ provide: UI_CONTROL,
93
+ useExisting: forwardRef(() => UiInput)
94
+ }]
95
+ }]
96
+ }],
97
+ propDecorators: {
98
+ size: [{
99
+ type: i0.Input,
100
+ args: [{
101
+ isSignal: true,
102
+ alias: "size",
103
+ required: false
104
+ }]
105
+ }],
106
+ surface: [{
107
+ type: i0.Input,
108
+ args: [{
109
+ isSignal: true,
110
+ alias: "surface",
111
+ required: false
112
+ }]
113
+ }],
114
+ errors: [{
115
+ type: i0.Input,
116
+ args: [{
117
+ isSignal: true,
118
+ alias: "errors",
119
+ required: false
120
+ }]
121
+ }],
122
+ touched: [{
123
+ type: i0.Input,
124
+ args: [{
125
+ isSignal: true,
126
+ alias: "touched",
127
+ required: false
128
+ }]
129
+ }]
130
+ }
131
+ });
132
+ var UiTextarea = class UiTextarea {
133
+ errors = input([], ...ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []);
134
+ touched = input(false, ...ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []);
135
+ static ɵfac = i0.ɵɵngDeclareFactory({
136
+ minVersion: "12.0.0",
137
+ version: "22.2.0",
138
+ ngImport: i0,
139
+ type: UiTextarea,
140
+ deps: [],
141
+ target: i0.ɵɵFactoryTarget.Directive
142
+ });
143
+ static ɵdir = i0.ɵɵngDeclareDirective({
144
+ minVersion: "17.1.0",
145
+ version: "22.2.0",
146
+ type: UiTextarea,
147
+ isStandalone: true,
148
+ selector: "textarea[uiTextarea]",
149
+ inputs: {
150
+ errors: {
151
+ classPropertyName: "errors",
152
+ publicName: "errors",
153
+ isSignal: true,
154
+ isRequired: false,
155
+ transformFunction: null
156
+ },
157
+ touched: {
158
+ classPropertyName: "touched",
159
+ publicName: "touched",
160
+ isSignal: true,
161
+ isRequired: false,
162
+ transformFunction: null
163
+ }
164
+ },
165
+ host: { classAttribute: "w-full rounded-control px-3 text-body text-(--foreground) shadow-[inset_0_0_0_1px_var(--border)] placeholder:text-(--muted-foreground) focus-visible:shadow-[inset_0_0_0_2px_var(--ring)] aria-invalid:shadow-[inset_0_0_0_2px_var(--negative)] disabled:cursor-not-allowed disabled:opacity-50 bg-(--background) min-h-24 py-2" },
166
+ providers: [{
167
+ provide: UI_CONTROL,
168
+ useExisting: forwardRef(() => UiTextarea)
169
+ }],
170
+ ngImport: i0
171
+ });
172
+ };
173
+ i0.ɵɵngDeclareClassMetadata({
174
+ minVersion: "12.0.0",
175
+ version: "22.2.0",
176
+ ngImport: i0,
177
+ type: UiTextarea,
178
+ decorators: [{
179
+ type: Directive,
180
+ args: [{
181
+ selector: "textarea[uiTextarea]",
182
+ host: { class: `${CONTROL_BASE_CLASSES} bg-(--background) min-h-24 py-2` },
183
+ providers: [{
184
+ provide: UI_CONTROL,
185
+ useExisting: forwardRef(() => UiTextarea)
186
+ }]
187
+ }]
188
+ }],
189
+ propDecorators: {
190
+ errors: [{
191
+ type: i0.Input,
192
+ args: [{
193
+ isSignal: true,
194
+ alias: "errors",
195
+ required: false
196
+ }]
197
+ }],
198
+ touched: [{
199
+ type: i0.Input,
200
+ args: [{
201
+ isSignal: true,
202
+ alias: "touched",
203
+ required: false
204
+ }]
205
+ }]
206
+ }
207
+ });
89
208
  export { CONTROL_BASE_CLASSES, CONTROL_SIZES, CONTROL_SIZE_CLASSES, CONTROL_SURFACES, CONTROL_SURFACE_CLASSES, UiInput, UiTextarea };
90
- //# sourceMappingURL=joanroucoux-cairn-ui-input.mjs.map
209
+
210
+ //# sourceMappingURL=joanroucoux-cairn-ui-input.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"joanroucoux-cairn-ui-input.mjs","sources":["../../../projects/ui/input/input.ts","../../../projects/ui/input/joanroucoux-cairn-ui-input.ts"],"sourcesContent":["import { Directive, computed, forwardRef, input } from '@angular/core';\n\nimport { UI_CONTROL, type UiControl, type UiControlError } from '@joanroucoux/cairn-ui/control';\n\n/** Available control sizes. `md` is the 44/40px touch target; `lg` and `xl` are the 48px sheet and sign-in fields. */\nexport const CONTROL_SIZES = ['sm', 'md', 'lg', 'xl'] as const;\nexport type ControlSize = (typeof CONTROL_SIZES)[number];\n\nexport const CONTROL_BASE_CLASSES =\n 'w-full rounded-control px-3 text-body text-(--foreground) shadow-[inset_0_0_0_1px_var(--border)] placeholder:text-(--muted-foreground) focus-visible:shadow-[inset_0_0_0_2px_var(--ring)] aria-invalid:shadow-[inset_0_0_0_2px_var(--negative)] disabled:cursor-not-allowed disabled:opacity-50';\n\nexport const CONTROL_SURFACES = ['background', 'card'] as const;\nexport type ControlSurface = (typeof CONTROL_SURFACES)[number];\n\nexport const CONTROL_SURFACE_CLASSES: Record<ControlSurface, string> = {\n background: 'bg-(--background)',\n card: 'bg-(--card)',\n};\n\nexport const CONTROL_SIZE_CLASSES: Record<ControlSize, string> = {\n sm: 'h-9',\n md: 'min-h-(--row-min)',\n lg: 'min-h-12 lg:min-h-(--row-min)',\n xl: 'h-12 lg:h-11',\n};\n\nconst SEARCH_CLASSES = '[&::-webkit-search-cancel-button]:appearance-none';\n\n/**\n * Styled native text input. A directive (not a wrapper component) so the host\n * stays a plain <input>: every forms flavor (ngModel, reactive, signal forms)\n * and every native attribute keep working without any plumbing.\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 * <input uiInput type=\"email\" placeholder=\"you@example.com\" />\n */\n@Directive({\n selector: 'input[uiInput]',\n host: {\n '[class]': 'classes()',\n },\n providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiInput) }],\n})\nexport class UiInput implements UiControl {\n readonly size = input<ControlSize>('md');\n readonly surface = input<ControlSurface>('background');\n readonly errors = input<readonly UiControlError[]>([]);\n readonly touched = input(false);\n\n protected readonly classes = computed(\n () =>\n `${CONTROL_BASE_CLASSES} ${SEARCH_CLASSES} ${CONTROL_SURFACE_CLASSES[this.surface()]} ${CONTROL_SIZE_CLASSES[this.size()]}`,\n );\n}\n\n/**\n * Styled native textarea. Lives beside the input because it shares every one of its\n * classes; it takes no size, since a textarea grows from a floor instead of sitting\n * at a fixed height.\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 * <textarea uiTextarea maxlength=\"280\"></textarea>\n */\n@Directive({\n selector: 'textarea[uiTextarea]',\n host: {\n class: `${CONTROL_BASE_CLASSES} bg-(--background) min-h-24 py-2`,\n },\n providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiTextarea) }],\n})\nexport class UiTextarea implements UiControl {\n readonly errors = input<readonly UiControlError[]>([]);\n readonly touched = input(false);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;AACO,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;AAG7C,MAAM,oBAAoB,GAC/B;MAEW,gBAAgB,GAAG,CAAC,YAAY,EAAE,MAAM;AAG9C,MAAM,uBAAuB,GAAmC;AACrE,IAAA,UAAU,EAAE,mBAAmB;AAC/B,IAAA,IAAI,EAAE,aAAa;;AAGd,MAAM,oBAAoB,GAAgC;AAC/D,IAAA,EAAE,EAAE,KAAK;AACT,IAAA,EAAE,EAAE,mBAAmB;AACvB,IAAA,EAAE,EAAE,+BAA+B;AACnC,IAAA,EAAE,EAAE,cAAc;;AAGpB,MAAM,cAAc,GAAG,mDAAmD;AAE1E;;;;;;;;;;AAUG;MAQU,OAAO,CAAA;IACT,IAAI,GAAG,K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A,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAV,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,qqBAFV,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,UAAU,CAAC,EAAE,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAEpE,UAAU,EAAA,UAAA,EAAA,CAAA;kBAPtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,IAAI,EAAE;wBACJ,KAAK,EAAE,CAAA,EAAG,oBAAoB,CAAA,gCAAA,CAAkC;AACjE,qBAAA;AACD,oBAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,MAAK,UAAW,CAAC,EAAE,CAAC;AAChF,iBAAA;;;AC3ED;;AAEG;;;;"}
1
+ {"version":3,"file":"joanroucoux-cairn-ui-input.mjs","names":[],"sources":["../../../projects/ui/input/input.ts"],"sourcesContent":["import { Directive, computed, forwardRef, input } from '@angular/core';\n\nimport { UI_CONTROL, type UiControl, type UiControlError } from '@joanroucoux/cairn-ui/control';\n\n/** Available control sizes. */\nexport const CONTROL_SIZES = ['sm', 'md', 'lg', 'xl'] as const;\nexport type ControlSize = (typeof CONTROL_SIZES)[number];\n\nexport const CONTROL_BASE_CLASSES =\n 'w-full rounded-control px-3 text-body text-(--foreground) shadow-[inset_0_0_0_1px_var(--border)] placeholder:text-(--muted-foreground) focus-visible:shadow-[inset_0_0_0_2px_var(--ring)] aria-invalid:shadow-[inset_0_0_0_2px_var(--negative)] disabled:cursor-not-allowed disabled:opacity-50';\n\nexport const CONTROL_SURFACES = ['background', 'card'] as const;\nexport type ControlSurface = (typeof CONTROL_SURFACES)[number];\n\nexport const CONTROL_SURFACE_CLASSES: Record<ControlSurface, string> = {\n background: 'bg-(--background)',\n card: 'bg-(--card)',\n};\n\nexport const CONTROL_SIZE_CLASSES: Record<ControlSize, string> = {\n sm: 'h-9',\n md: 'min-h-(--row-min)',\n lg: 'min-h-12 lg:min-h-(--row-min)',\n xl: 'h-12 lg:h-11',\n};\n\nconst SEARCH_CLASSES = '[&::-webkit-search-cancel-button]:appearance-none';\n\n/**\n * Styled native text input. The host stays a plain `<input>`, so every forms flavor and native\n * attribute keeps working. Declares the `errors` and `touched` inputs Angular's `[formField]` fills,\n * so a surrounding `ui-field` can show the message.\n *\n * @example\n * <input uiInput type=\"email\" placeholder=\"you@example.com\" />\n */\n@Directive({\n selector: 'input[uiInput]',\n host: {\n '[class]': 'classes()',\n },\n providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiInput) }],\n})\nexport class UiInput implements UiControl {\n readonly size = input<ControlSize>('md');\n readonly surface = input<ControlSurface>('background');\n readonly errors = input<readonly UiControlError[]>([]);\n readonly touched = input(false);\n\n protected readonly classes = computed(\n () =>\n `${CONTROL_BASE_CLASSES} ${SEARCH_CLASSES} ${CONTROL_SURFACE_CLASSES[this.surface()]} ${CONTROL_SIZE_CLASSES[this.size()]}`,\n );\n}\n\n/**\n * Styled native textarea. It takes no size: it grows from a minimum height. Declares the `errors`\n * and `touched` inputs Angular's `[formField]` fills, so a surrounding `ui-field` can show the message.\n *\n * @example\n * <textarea uiTextarea maxlength=\"280\"></textarea>\n */\n@Directive({\n selector: 'textarea[uiTextarea]',\n host: {\n class: `${CONTROL_BASE_CLASSES} bg-(--background) min-h-24 py-2`,\n },\n providers: [{ provide: UI_CONTROL, useExisting: forwardRef(() => UiTextarea) }],\n})\nexport class UiTextarea implements UiControl {\n readonly errors = input<readonly UiControlError[]>([]);\n readonly touched = input(false);\n}\n"],"mappings":";;;AAKA,MAAa,gBAAgB;CAAC;CAAM;CAAM;CAAM;AAAI;AAGpD,M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