@molecule/app-ui-angular 1.0.6 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/README.md +11740 -1143
  2. package/dist/components/accordion.component.d.ts +114 -0
  3. package/dist/components/accordion.component.d.ts.map +1 -0
  4. package/dist/components/accordion.component.js +286 -0
  5. package/dist/components/accordion.component.js.map +1 -0
  6. package/dist/components/alert.component.d.ts +81 -37
  7. package/dist/components/alert.component.d.ts.map +1 -1
  8. package/dist/components/alert.component.js +232 -146
  9. package/dist/components/alert.component.js.map +1 -1
  10. package/dist/components/auth-guard.component.d.ts +94 -0
  11. package/dist/components/auth-guard.component.d.ts.map +1 -0
  12. package/dist/components/auth-guard.component.js +212 -0
  13. package/dist/components/auth-guard.component.js.map +1 -0
  14. package/dist/components/avatar.component.d.ts +97 -0
  15. package/dist/components/avatar.component.d.ts.map +1 -0
  16. package/dist/components/avatar.component.js +216 -0
  17. package/dist/components/avatar.component.js.map +1 -0
  18. package/dist/components/badge.component.d.ts +27 -12
  19. package/dist/components/badge.component.d.ts.map +1 -1
  20. package/dist/components/badge.component.js +47 -47
  21. package/dist/components/badge.component.js.map +1 -1
  22. package/dist/components/button.component.d.ts +96 -14
  23. package/dist/components/button.component.d.ts.map +1 -1
  24. package/dist/components/button.component.js +232 -87
  25. package/dist/components/button.component.js.map +1 -1
  26. package/dist/components/card.component.d.ts +135 -0
  27. package/dist/components/card.component.d.ts.map +1 -0
  28. package/dist/components/card.component.js +291 -0
  29. package/dist/components/card.component.js.map +1 -0
  30. package/dist/components/checkbox.component.d.ts +102 -29
  31. package/dist/components/checkbox.component.d.ts.map +1 -1
  32. package/dist/components/checkbox.component.js +222 -113
  33. package/dist/components/checkbox.component.js.map +1 -1
  34. package/dist/components/confirm-button.component.d.ts +130 -0
  35. package/dist/components/confirm-button.component.d.ts.map +1 -0
  36. package/dist/components/confirm-button.component.js +322 -0
  37. package/dist/components/confirm-button.component.js.map +1 -0
  38. package/dist/components/confirm-dialog.component.d.ts +60 -0
  39. package/dist/components/confirm-dialog.component.d.ts.map +1 -0
  40. package/dist/components/confirm-dialog.component.js +152 -0
  41. package/dist/components/confirm-dialog.component.js.map +1 -0
  42. package/dist/components/dropdown.component.d.ts +313 -0
  43. package/dist/components/dropdown.component.d.ts.map +1 -0
  44. package/dist/components/dropdown.component.js +919 -0
  45. package/dist/components/dropdown.component.js.map +1 -0
  46. package/dist/components/empty-state.component.d.ts +73 -0
  47. package/dist/components/empty-state.component.d.ts.map +1 -0
  48. package/dist/components/empty-state.component.js +180 -0
  49. package/dist/components/empty-state.component.js.map +1 -0
  50. package/dist/components/floating-input.component.d.ts +86 -0
  51. package/dist/components/floating-input.component.d.ts.map +1 -0
  52. package/dist/components/floating-input.component.js +167 -0
  53. package/dist/components/floating-input.component.js.map +1 -0
  54. package/dist/components/form-field.component.d.ts +111 -0
  55. package/dist/components/form-field.component.d.ts.map +1 -0
  56. package/dist/components/form-field.component.js +300 -0
  57. package/dist/components/form-field.component.js.map +1 -0
  58. package/dist/components/form.component.d.ts +77 -0
  59. package/dist/components/form.component.d.ts.map +1 -0
  60. package/dist/components/form.component.js +222 -0
  61. package/dist/components/form.component.js.map +1 -0
  62. package/dist/components/icon.component.d.ts +85 -0
  63. package/dist/components/icon.component.d.ts.map +1 -0
  64. package/dist/components/icon.component.js +187 -0
  65. package/dist/components/icon.component.js.map +1 -0
  66. package/dist/components/index.d.ts +49 -0
  67. package/dist/components/index.d.ts.map +1 -1
  68. package/dist/components/index.js +49 -0
  69. package/dist/components/index.js.map +1 -1
  70. package/dist/components/input.component.d.ts +157 -54
  71. package/dist/components/input.component.d.ts.map +1 -1
  72. package/dist/components/input.component.js +437 -222
  73. package/dist/components/input.component.js.map +1 -1
  74. package/dist/components/label.component.d.ts +29 -0
  75. package/dist/components/label.component.d.ts.map +1 -0
  76. package/dist/components/label.component.js +60 -0
  77. package/dist/components/label.component.js.map +1 -0
  78. package/dist/components/language-picker.component.d.ts +124 -0
  79. package/dist/components/language-picker.component.d.ts.map +1 -0
  80. package/dist/components/language-picker.component.js +305 -0
  81. package/dist/components/language-picker.component.js.map +1 -0
  82. package/dist/components/layout.component.d.ts +167 -0
  83. package/dist/components/layout.component.d.ts.map +1 -0
  84. package/dist/components/layout.component.js +364 -0
  85. package/dist/components/layout.component.js.map +1 -0
  86. package/dist/components/load-error-banner.component.d.ts +103 -0
  87. package/dist/components/load-error-banner.component.d.ts.map +1 -0
  88. package/dist/components/load-error-banner.component.js +263 -0
  89. package/dist/components/load-error-banner.component.js.map +1 -0
  90. package/dist/components/modal.component.d.ts +125 -95
  91. package/dist/components/modal.component.d.ts.map +1 -1
  92. package/dist/components/modal.component.js +458 -271
  93. package/dist/components/modal.component.js.map +1 -1
  94. package/dist/components/molecule/alert.component.d.ts +77 -0
  95. package/dist/components/molecule/alert.component.d.ts.map +1 -0
  96. package/dist/components/molecule/alert.component.js +229 -0
  97. package/dist/components/molecule/alert.component.js.map +1 -0
  98. package/dist/components/molecule/badge.component.d.ts +27 -0
  99. package/dist/components/molecule/badge.component.d.ts.map +1 -0
  100. package/dist/components/molecule/badge.component.js +79 -0
  101. package/dist/components/molecule/badge.component.js.map +1 -0
  102. package/dist/components/molecule/button.component.d.ts +38 -0
  103. package/dist/components/molecule/button.component.d.ts.map +1 -0
  104. package/dist/components/molecule/button.component.js +137 -0
  105. package/dist/components/molecule/button.component.js.map +1 -0
  106. package/dist/components/molecule/checkbox.component.d.ts +53 -0
  107. package/dist/components/molecule/checkbox.component.d.ts.map +1 -0
  108. package/dist/components/molecule/checkbox.component.js +166 -0
  109. package/dist/components/molecule/checkbox.component.js.map +1 -0
  110. package/dist/components/molecule/index.d.ts +18 -0
  111. package/dist/components/molecule/index.d.ts.map +1 -0
  112. package/dist/components/molecule/index.js +18 -0
  113. package/dist/components/molecule/index.js.map +1 -0
  114. package/dist/components/molecule/input.component.d.ts +93 -0
  115. package/dist/components/molecule/input.component.d.ts.map +1 -0
  116. package/dist/components/molecule/input.component.js +314 -0
  117. package/dist/components/molecule/input.component.js.map +1 -0
  118. package/dist/components/molecule/modal.component.d.ts +148 -0
  119. package/dist/components/molecule/modal.component.d.ts.map +1 -0
  120. package/dist/components/molecule/modal.component.js +382 -0
  121. package/dist/components/molecule/modal.component.js.map +1 -0
  122. package/dist/components/molecule/radio-group.component.d.ts +63 -0
  123. package/dist/components/molecule/radio-group.component.d.ts.map +1 -0
  124. package/dist/components/molecule/radio-group.component.js +208 -0
  125. package/dist/components/molecule/radio-group.component.js.map +1 -0
  126. package/dist/components/molecule/select.component.d.ts +72 -0
  127. package/dist/components/molecule/select.component.d.ts.map +1 -0
  128. package/dist/components/molecule/select.component.js +274 -0
  129. package/dist/components/molecule/select.component.js.map +1 -0
  130. package/dist/components/molecule/spinner.component.d.ts +42 -0
  131. package/dist/components/molecule/spinner.component.d.ts.map +1 -0
  132. package/dist/components/molecule/spinner.component.js +122 -0
  133. package/dist/components/molecule/spinner.component.js.map +1 -0
  134. package/dist/components/molecule/switch.component.d.ts +54 -0
  135. package/dist/components/molecule/switch.component.d.ts.map +1 -0
  136. package/dist/components/molecule/switch.component.js +148 -0
  137. package/dist/components/molecule/switch.component.js.map +1 -0
  138. package/dist/components/molecule/toast.component.d.ts +98 -0
  139. package/dist/components/molecule/toast.component.d.ts.map +1 -0
  140. package/dist/components/molecule/toast.component.js +305 -0
  141. package/dist/components/molecule/toast.component.js.map +1 -0
  142. package/dist/components/molecule/tooltip.component.d.ts +77 -0
  143. package/dist/components/molecule/tooltip.component.d.ts.map +1 -0
  144. package/dist/components/molecule/tooltip.component.js +316 -0
  145. package/dist/components/molecule/tooltip.component.js.map +1 -0
  146. package/dist/components/optimistic-toggle-button.component.d.ts +125 -0
  147. package/dist/components/optimistic-toggle-button.component.d.ts.map +1 -0
  148. package/dist/components/optimistic-toggle-button.component.js +296 -0
  149. package/dist/components/optimistic-toggle-button.component.js.map +1 -0
  150. package/dist/components/page-header.component.d.ts +77 -0
  151. package/dist/components/page-header.component.d.ts.map +1 -0
  152. package/dist/components/page-header.component.js +225 -0
  153. package/dist/components/page-header.component.js.map +1 -0
  154. package/dist/components/page-shell.component.d.ts +101 -0
  155. package/dist/components/page-shell.component.d.ts.map +1 -0
  156. package/dist/components/page-shell.component.js +221 -0
  157. package/dist/components/page-shell.component.js.map +1 -0
  158. package/dist/components/pagination.component.d.ts +137 -0
  159. package/dist/components/pagination.component.d.ts.map +1 -0
  160. package/dist/components/pagination.component.js +419 -0
  161. package/dist/components/pagination.component.js.map +1 -0
  162. package/dist/components/panel-close.component.d.ts +43 -0
  163. package/dist/components/panel-close.component.d.ts.map +1 -0
  164. package/dist/components/panel-close.component.js +75 -0
  165. package/dist/components/panel-close.component.js.map +1 -0
  166. package/dist/components/progress.component.d.ts +84 -0
  167. package/dist/components/progress.component.d.ts.map +1 -0
  168. package/dist/components/progress.component.js +219 -0
  169. package/dist/components/progress.component.js.map +1 -0
  170. package/dist/components/prompt-dialog.component.d.ts +121 -0
  171. package/dist/components/prompt-dialog.component.d.ts.map +1 -0
  172. package/dist/components/prompt-dialog.component.js +332 -0
  173. package/dist/components/prompt-dialog.component.js.map +1 -0
  174. package/dist/components/radio-group.component.d.ts +66 -34
  175. package/dist/components/radio-group.component.d.ts.map +1 -1
  176. package/dist/components/radio-group.component.js +146 -125
  177. package/dist/components/radio-group.component.js.map +1 -1
  178. package/dist/components/responsive-app-shell.component.d.ts +408 -0
  179. package/dist/components/responsive-app-shell.component.d.ts.map +1 -0
  180. package/dist/components/responsive-app-shell.component.js +1144 -0
  181. package/dist/components/responsive-app-shell.component.js.map +1 -0
  182. package/dist/components/select.component.d.ts +135 -38
  183. package/dist/components/select.component.d.ts.map +1 -1
  184. package/dist/components/select.component.js +373 -181
  185. package/dist/components/select.component.js.map +1 -1
  186. package/dist/components/separator.component.d.ts +39 -0
  187. package/dist/components/separator.component.d.ts.map +1 -0
  188. package/dist/components/separator.component.js +73 -0
  189. package/dist/components/separator.component.js.map +1 -0
  190. package/dist/components/sidebar-user-card.component.d.ts +106 -0
  191. package/dist/components/sidebar-user-card.component.d.ts.map +1 -0
  192. package/dist/components/sidebar-user-card.component.js +277 -0
  193. package/dist/components/sidebar-user-card.component.js.map +1 -0
  194. package/dist/components/skeleton.component.d.ts +100 -0
  195. package/dist/components/skeleton.component.d.ts.map +1 -0
  196. package/dist/components/skeleton.component.js +214 -0
  197. package/dist/components/skeleton.component.js.map +1 -0
  198. package/dist/components/spinner.component.d.ts +36 -19
  199. package/dist/components/spinner.component.d.ts.map +1 -1
  200. package/dist/components/spinner.component.js +69 -71
  201. package/dist/components/spinner.component.js.map +1 -1
  202. package/dist/components/switch.component.d.ts +72 -29
  203. package/dist/components/switch.component.d.ts.map +1 -1
  204. package/dist/components/switch.component.js +163 -91
  205. package/dist/components/switch.component.js.map +1 -1
  206. package/dist/components/table.component.d.ts +193 -0
  207. package/dist/components/table.component.d.ts.map +1 -0
  208. package/dist/components/table.component.js +550 -0
  209. package/dist/components/table.component.js.map +1 -0
  210. package/dist/components/tabs.component.d.ts +140 -0
  211. package/dist/components/tabs.component.d.ts.map +1 -0
  212. package/dist/components/tabs.component.js +390 -0
  213. package/dist/components/tabs.component.js.map +1 -0
  214. package/dist/components/template-outlet.directive.d.ts +50 -0
  215. package/dist/components/template-outlet.directive.d.ts.map +1 -0
  216. package/dist/components/template-outlet.directive.js +81 -0
  217. package/dist/components/template-outlet.directive.js.map +1 -0
  218. package/dist/components/textarea.component.d.ts +151 -0
  219. package/dist/components/textarea.component.d.ts.map +1 -0
  220. package/dist/components/textarea.component.js +340 -0
  221. package/dist/components/textarea.component.js.map +1 -0
  222. package/dist/components/theme-toggle.component.d.ts +58 -0
  223. package/dist/components/theme-toggle.component.d.ts.map +1 -0
  224. package/dist/components/theme-toggle.component.js +124 -0
  225. package/dist/components/theme-toggle.component.js.map +1 -0
  226. package/dist/components/toast.component.d.ts +237 -49
  227. package/dist/components/toast.component.d.ts.map +1 -1
  228. package/dist/components/toast.component.js +636 -201
  229. package/dist/components/toast.component.js.map +1 -1
  230. package/dist/components/tooltip.component.d.ts +95 -45
  231. package/dist/components/tooltip.component.d.ts.map +1 -1
  232. package/dist/components/tooltip.component.js +372 -221
  233. package/dist/components/tooltip.component.js.map +1 -1
  234. package/dist/components/user-menu-popover.component.d.ts +283 -0
  235. package/dist/components/user-menu-popover.component.d.ts.map +1 -0
  236. package/dist/components/user-menu-popover.component.js +646 -0
  237. package/dist/components/user-menu-popover.component.js.map +1 -0
  238. package/dist/components/user-menu.component.d.ts +95 -0
  239. package/dist/components/user-menu.component.d.ts.map +1 -0
  240. package/dist/components/user-menu.component.js +218 -0
  241. package/dist/components/user-menu.component.js.map +1 -0
  242. package/dist/hooks/index.d.ts +7 -0
  243. package/dist/hooks/index.d.ts.map +1 -0
  244. package/dist/hooks/index.js +7 -0
  245. package/dist/hooks/index.js.map +1 -0
  246. package/dist/hooks/use-is-desktop.d.ts +22 -0
  247. package/dist/hooks/use-is-desktop.d.ts.map +1 -0
  248. package/dist/hooks/use-is-desktop.js +37 -0
  249. package/dist/hooks/use-is-desktop.js.map +1 -0
  250. package/dist/index.d.ts +32 -17
  251. package/dist/index.d.ts.map +1 -1
  252. package/dist/index.js +32 -17
  253. package/dist/index.js.map +1 -1
  254. package/dist/types.d.ts +1 -1
  255. package/dist/types.d.ts.map +1 -1
  256. package/dist/utilities/dom-context.d.ts +42 -0
  257. package/dist/utilities/dom-context.d.ts.map +1 -0
  258. package/dist/utilities/dom-context.js +66 -0
  259. package/dist/utilities/dom-context.js.map +1 -0
  260. package/dist/utilities/focus.d.ts +32 -0
  261. package/dist/utilities/focus.d.ts.map +1 -0
  262. package/dist/utilities/focus.js +47 -0
  263. package/dist/utilities/focus.js.map +1 -0
  264. package/dist/utilities/form-field-context.d.ts +34 -0
  265. package/dist/utilities/form-field-context.d.ts.map +1 -0
  266. package/dist/utilities/form-field-context.js +28 -0
  267. package/dist/utilities/form-field-context.js.map +1 -0
  268. package/dist/utilities/form-submit-error.d.ts +17 -0
  269. package/dist/utilities/form-submit-error.d.ts.map +1 -0
  270. package/dist/utilities/form-submit-error.js +42 -0
  271. package/dist/utilities/form-submit-error.js.map +1 -0
  272. package/dist/utilities/icon-markup.d.ts +17 -0
  273. package/dist/utilities/icon-markup.d.ts.map +1 -0
  274. package/dist/utilities/icon-markup.js +46 -0
  275. package/dist/utilities/icon-markup.js.map +1 -0
  276. package/dist/utilities/ids.d.ts +15 -0
  277. package/dist/utilities/ids.d.ts.map +1 -0
  278. package/dist/utilities/ids.js +19 -0
  279. package/dist/utilities/ids.js.map +1 -0
  280. package/dist/utilities/index.d.ts +11 -0
  281. package/dist/utilities/index.d.ts.map +1 -1
  282. package/dist/utilities/index.js +11 -0
  283. package/dist/utilities/index.js.map +1 -1
  284. package/dist/utilities/initials.d.ts +13 -0
  285. package/dist/utilities/initials.d.ts.map +1 -0
  286. package/dist/utilities/initials.js +23 -0
  287. package/dist/utilities/initials.js.map +1 -0
  288. package/dist/utilities/node-value.d.ts +31 -0
  289. package/dist/utilities/node-value.d.ts.map +1 -0
  290. package/dist/utilities/node-value.js +37 -0
  291. package/dist/utilities/node-value.js.map +1 -0
  292. package/dist/utilities/optimistic-value.d.ts +81 -0
  293. package/dist/utilities/optimistic-value.d.ts.map +1 -0
  294. package/dist/utilities/optimistic-value.js +154 -0
  295. package/dist/utilities/optimistic-value.js.map +1 -0
  296. package/dist/utilities/render-icon.d.ts +77 -7
  297. package/dist/utilities/render-icon.d.ts.map +1 -1
  298. package/dist/utilities/render-icon.js +123 -33
  299. package/dist/utilities/render-icon.js.map +1 -1
  300. package/dist/utilities/rest-attrs.d.ts +21 -0
  301. package/dist/utilities/rest-attrs.d.ts.map +1 -0
  302. package/dist/utilities/rest-attrs.js +37 -0
  303. package/dist/utilities/rest-attrs.js.map +1 -0
  304. package/dist/utilities/style.d.ts +23 -0
  305. package/dist/utilities/style.d.ts.map +1 -0
  306. package/dist/utilities/style.js +86 -0
  307. package/dist/utilities/style.js.map +1 -0
  308. package/package.json +6 -4
@@ -0,0 +1,100 @@
1
+ import type { UIClassMap } from '@molecule/app-ui';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Skeleton loading placeholder.
5
+ *
6
+ * The host is the skeleton `<div>`; width/height/borderRadius accept React's
7
+ * number-or-string shapes (numbers become px), and a circle skeleton without
8
+ * a height uses the width for both, exactly like React.
9
+ */
10
+ export declare class Skeleton {
11
+ /** Width (number = px, or any CSS value). */
12
+ width?: number | string;
13
+ /** Height (number = px, or any CSS value). */
14
+ height?: number | string;
15
+ /** Whether the skeleton is a circle. */
16
+ circle: boolean;
17
+ /** Border radius override (number = px). */
18
+ borderRadius?: number | string;
19
+ /** Animation style. */
20
+ animation: 'pulse' | 'wave' | 'none';
21
+ /** Extra classes. */
22
+ className?: string;
23
+ /** Inline style object (React camelCase). */
24
+ style?: Record<string, unknown>;
25
+ /** `data-testid`. */
26
+ testId?: string;
27
+ /**
28
+ * The current class map.
29
+ * @returns The UIClassMap.
30
+ */
31
+ cm(): UIClassMap;
32
+ /**
33
+ * Computes the skeleton class list.
34
+ * @returns The class string.
35
+ */
36
+ classes(): string;
37
+ /**
38
+ * Serializes the merged inline style.
39
+ * @returns The style attribute text.
40
+ */
41
+ hostStyle(): string | null;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<Skeleton, never>;
43
+ static ɵcmp: i0.ɵɵComponentDeclaration<Skeleton, "div[mol-skeleton]", never, { "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "circle": { "alias": "circle"; "required": false; }; "borderRadius": { "alias": "borderRadius"; "required": false; }; "animation": { "alias": "animation"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, never, true, never>;
44
+ }
45
+ /**
46
+ * Skeleton text lines (a container with N skeleton bars; the last one is 60%).
47
+ */
48
+ export declare class SkeletonText {
49
+ /** Number of skeleton lines. */
50
+ lines: number;
51
+ /** Extra classes. */
52
+ className?: string;
53
+ /**
54
+ * The current class map.
55
+ * @returns The UIClassMap.
56
+ */
57
+ cm(): UIClassMap;
58
+ /**
59
+ * An array as long as the line count (template iteration).
60
+ * @returns Placeholder items.
61
+ */
62
+ get lineList(): number[];
63
+ /**
64
+ * Computes the container class list.
65
+ * @returns The class string.
66
+ */
67
+ classes(): string;
68
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkeletonText, never>;
69
+ static ɵcmp: i0.ɵɵComponentDeclaration<SkeletonText, "div[mol-skeleton-text]", never, { "lines": { "alias": "lines"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, never, true, never>;
70
+ }
71
+ /**
72
+ * Skeleton circle (avatar placeholder).
73
+ *
74
+ * React renders `<Skeleton circle width={size} height={size} className/>` —
75
+ * a single div; the host IS that div (no wrapper).
76
+ */
77
+ export declare class SkeletonCircle {
78
+ /** Circle diameter in pixels. */
79
+ size: number;
80
+ /** Extra classes. */
81
+ className?: string;
82
+ /**
83
+ * The current class map.
84
+ * @returns The UIClassMap.
85
+ */
86
+ cm(): UIClassMap;
87
+ /**
88
+ * Computes the class list (a circle skeleton).
89
+ * @returns The class string.
90
+ */
91
+ classes(): string;
92
+ /**
93
+ * Serializes the circle inline style.
94
+ * @returns The style attribute text.
95
+ */
96
+ hostStyle(): string | null;
97
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkeletonCircle, never>;
98
+ static ɵcmp: i0.ɵɵComponentDeclaration<SkeletonCircle, "div[mol-skeleton-circle]", never, { "size": { "alias": "size"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, never, true, never>;
99
+ }
100
+ //# sourceMappingURL=skeleton.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.component.d.ts","sourceRoot":"","sources":["../../src/components/skeleton.component.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAKlD;;;;;;GAMG;AACH,qBA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,214 @@
1
+ /**
2
+ * Skeleton components (React parity).
3
+ *
4
+ * @module
5
+ */
6
+ import { Component } from '@angular/core';
7
+ import { getClassMap } from '@molecule/app-ui';
8
+ import { styleText } from '../utilities/style.js';
9
+ import * as i0 from "@angular/core";
10
+ function SkeletonText_For_1_Template(rf, ctx) { if (rf & 1) {
11
+ i0.ɵɵelement(0, "div", 0);
12
+ } if (rf & 2) {
13
+ const $index_r1 = ctx.$index;
14
+ const ctx_r1 = i0.ɵɵnextContext();
15
+ i0.ɵɵproperty("height", 16)("width", $index_r1 === ctx_r1.lines - 1 ? "60%" : "100%");
16
+ } }
17
+ /**
18
+ * Skeleton loading placeholder.
19
+ *
20
+ * The host is the skeleton `<div>`; width/height/borderRadius accept React's
21
+ * number-or-string shapes (numbers become px), and a circle skeleton without
22
+ * a height uses the width for both, exactly like React.
23
+ */
24
+ export class Skeleton {
25
+ /** Width (number = px, or any CSS value). */
26
+ width;
27
+ /** Height (number = px, or any CSS value). */
28
+ height;
29
+ /** Whether the skeleton is a circle. */
30
+ circle = false;
31
+ /** Border radius override (number = px). */
32
+ borderRadius;
33
+ /** Animation style. */
34
+ animation = 'pulse';
35
+ /** Extra classes. */
36
+ className;
37
+ /** Inline style object (React camelCase). */
38
+ style;
39
+ /** `data-testid`. */
40
+ testId;
41
+ /**
42
+ * The current class map.
43
+ * @returns The UIClassMap.
44
+ */
45
+ cm() {
46
+ return getClassMap();
47
+ }
48
+ /**
49
+ * Computes the skeleton class list.
50
+ * @returns The class string.
51
+ */
52
+ classes() {
53
+ return this.cm().cn(this.cm().skeleton(), this.circle && this.cm().skeletonCircle, this.animation === 'none' && this.cm().skeletonNone, this.animation === 'wave' && this.cm().skeletonWave, this.className);
54
+ }
55
+ /**
56
+ * Serializes the merged inline style.
57
+ * @returns The style attribute text.
58
+ */
59
+ hostStyle() {
60
+ const computed = {
61
+ ...this.style,
62
+ width: typeof this.width === 'number' ? `${this.width}px` : this.width,
63
+ height: typeof this.height === 'number' ? `${this.height}px` : this.height,
64
+ borderRadius: this.circle
65
+ ? '9999px'
66
+ : typeof this.borderRadius === 'number'
67
+ ? `${this.borderRadius}px`
68
+ : this.borderRadius,
69
+ };
70
+ // If circle, make width and height equal.
71
+ if (this.circle && this.width && !this.height) {
72
+ computed.height = computed.width;
73
+ }
74
+ return styleText(computed);
75
+ }
76
+ static ɵfac = function Skeleton_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Skeleton)(); };
77
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Skeleton, selectors: [["div", "mol-skeleton", ""]], hostVars: 5, hostBindings: function Skeleton_HostBindings(rf, ctx) { if (rf & 2) {
78
+ i0.ɵɵattribute("data-testid", ctx.testId);
79
+ i0.ɵɵstyleMap(ctx.hostStyle());
80
+ i0.ɵɵclassMap(ctx.classes());
81
+ } }, inputs: { width: "width", height: "height", circle: "circle", borderRadius: "borderRadius", animation: "animation", className: "className", style: "style", testId: "testId" }, decls: 0, vars: 0, template: function Skeleton_Template(rf, ctx) { }, encapsulation: 2 });
82
+ }
83
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Skeleton, [{
84
+ type: Component,
85
+ args: [{
86
+ selector: 'div[mol-skeleton]',
87
+ standalone: true,
88
+ inputs: [
89
+ 'width',
90
+ 'height',
91
+ 'circle',
92
+ 'borderRadius',
93
+ 'animation',
94
+ 'className',
95
+ 'style',
96
+ 'testId',
97
+ ],
98
+ host: {
99
+ '[class]': 'classes()',
100
+ '[style]': 'hostStyle()',
101
+ '[attr.data-testid]': 'testId',
102
+ },
103
+ template: '',
104
+ }]
105
+ }], null, null); })();
106
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Skeleton, { className: "Skeleton", filePath: "components/skeleton.component.ts", lineNumber: 41 }); })();
107
+ /**
108
+ * Skeleton text lines (a container with N skeleton bars; the last one is 60%).
109
+ */
110
+ export class SkeletonText {
111
+ /** Number of skeleton lines. */
112
+ lines = 3;
113
+ /** Extra classes. */
114
+ className;
115
+ /**
116
+ * The current class map.
117
+ * @returns The UIClassMap.
118
+ */
119
+ cm() {
120
+ return getClassMap();
121
+ }
122
+ /**
123
+ * An array as long as the line count (template iteration).
124
+ * @returns Placeholder items.
125
+ */
126
+ get lineList() {
127
+ return Array.from({ length: this.lines });
128
+ }
129
+ /**
130
+ * Computes the container class list.
131
+ * @returns The class string.
132
+ */
133
+ classes() {
134
+ return this.cm().cn(this.cm().skeletonTextContainer, this.className);
135
+ }
136
+ static ɵfac = function SkeletonText_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SkeletonText)(); };
137
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SkeletonText, selectors: [["div", "mol-skeleton-text", ""]], hostVars: 2, hostBindings: function SkeletonText_HostBindings(rf, ctx) { if (rf & 2) {
138
+ i0.ɵɵclassMap(ctx.classes());
139
+ } }, inputs: { lines: "lines", className: "className" }, decls: 2, vars: 0, consts: [["mol-skeleton", "", 3, "height", "width"]], template: function SkeletonText_Template(rf, ctx) { if (rf & 1) {
140
+ i0.ɵɵrepeaterCreate(0, SkeletonText_For_1_Template, 1, 2, "div", 0, i0.ɵɵrepeaterTrackByIndex);
141
+ } if (rf & 2) {
142
+ i0.ɵɵrepeater(ctx.lineList);
143
+ } }, dependencies: [Skeleton], encapsulation: 2 });
144
+ }
145
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SkeletonText, [{
146
+ type: Component,
147
+ args: [{
148
+ selector: 'div[mol-skeleton-text]',
149
+ standalone: true,
150
+ imports: [Skeleton],
151
+ inputs: ['lines', 'className'],
152
+ host: {
153
+ '[class]': 'classes()',
154
+ },
155
+ template: `@for (line of lineList; track $index) {
156
+ <div mol-skeleton [height]="16" [width]="$index === lines - 1 ? '60%' : '100%'"></div>
157
+ }`,
158
+ }]
159
+ }], null, null); })();
160
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SkeletonText, { className: "SkeletonText", filePath: "components/skeleton.component.ts", lineNumber: 119 }); })();
161
+ /**
162
+ * Skeleton circle (avatar placeholder).
163
+ *
164
+ * React renders `<Skeleton circle width={size} height={size} className/>` —
165
+ * a single div; the host IS that div (no wrapper).
166
+ */
167
+ export class SkeletonCircle {
168
+ /** Circle diameter in pixels. */
169
+ size = 40;
170
+ /** Extra classes. */
171
+ className;
172
+ /**
173
+ * The current class map.
174
+ * @returns The UIClassMap.
175
+ */
176
+ cm() {
177
+ return getClassMap();
178
+ }
179
+ /**
180
+ * Computes the class list (a circle skeleton).
181
+ * @returns The class string.
182
+ */
183
+ classes() {
184
+ return this.cm().cn(this.cm().skeleton(), this.cm().skeletonCircle, this.className);
185
+ }
186
+ /**
187
+ * Serializes the circle inline style.
188
+ * @returns The style attribute text.
189
+ */
190
+ hostStyle() {
191
+ const px = typeof this.size === 'number' ? `${this.size}px` : this.size;
192
+ return styleText({ width: px, height: px, borderRadius: '9999px' });
193
+ }
194
+ static ɵfac = function SkeletonCircle_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SkeletonCircle)(); };
195
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SkeletonCircle, selectors: [["div", "mol-skeleton-circle", ""]], hostVars: 4, hostBindings: function SkeletonCircle_HostBindings(rf, ctx) { if (rf & 2) {
196
+ i0.ɵɵstyleMap(ctx.hostStyle());
197
+ i0.ɵɵclassMap(ctx.classes());
198
+ } }, inputs: { size: "size", className: "className" }, decls: 0, vars: 0, template: function SkeletonCircle_Template(rf, ctx) { }, encapsulation: 2 });
199
+ }
200
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SkeletonCircle, [{
201
+ type: Component,
202
+ args: [{
203
+ selector: 'div[mol-skeleton-circle]',
204
+ standalone: true,
205
+ inputs: ['size', 'className'],
206
+ host: {
207
+ '[class]': 'classes()',
208
+ '[style]': 'hostStyle()',
209
+ },
210
+ template: '',
211
+ }]
212
+ }], null, null); })();
213
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SkeletonCircle, { className: "SkeletonCircle", filePath: "components/skeleton.component.ts", lineNumber: 166 }); })();
214
+ //# sourceMappingURL=skeleton.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.component.js","sourceRoot":"","sources":["../../src/components/skeleton.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;;;IAwG7C,yBAAsF;;;;IAAtD,AAAd,2BAAa,0DAAgD;;AAtGnF;;;;;;GAMG;AAqBH,MAAM,OAAO,QAAQ;IACnB,6CAA6C;IAC7C,KAAK,CAAkB;IACvB,8CAA8C;IAC9C,MAAM,CAAkB;IACxB,wCAAwC;IACxC,MAAM,GAAG,KAAK,CAAA;IACd,4CAA4C;IAC5C,YAAY,CAAkB;IAC9B,uBAAuB;IACvB,SAAS,GAA8B,OAAO,CAAA;IAC9C,qBAAqB;IACrB,SAAS,CAAS;IAClB,6CAA6C;IAC7C,KAAK,CAA0B;IAC/B,qBAAqB;IACrB,MAAM,CAAS;IAEf;;;OAGG;IACH,EAAE;QACA,OAAO,WAAW,EAAE,CAAA;IACtB,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CACjB,IAAI,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,EACpB,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,cAAc,EACvC,IAAI,CAAC,SAAS,KAAK,MAAM,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,YAAY,EACnD,IAAI,CAAC,SAAS,KAAK,MAAM,IAAI,IAAI,C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AE,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;IACrF,CAAC;IAED;;;OAGG;IACH,SAAS;QACP,MAAM,EAAE,GAAG,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAA;QACvE,OAAO,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAA;IACrE,CAAC;wGA7BU,cAAc;6DAAd,cAAc;YAAd,cAAA,eAAW,CAAG;YAAd,cAAA,aAAS,CAAK;;;iFAAd,cAAc;cAV1B,SAAS;eAAC;gBACT,QAAQ,EAAE,0BAA0B;gBACpC,UAAU,EAAE,IAAI;gBAChB,MAAM,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;gBAC7B,IAAI,EAAE;oBACJ,SAAS,EAAE,WAAW;oBACtB,SAAS,EAAE,aAAa;iBACzB;gBACD,QAAQ,EAAE,EAAE;aACb;;kFACY,cAAc"}
@@ -1,36 +1,53 @@
1
- import type { ColorVariant, Size, UIClassMap } from '@molecule/app-ui';
1
+ import type { Size, UIClassMap } from '@molecule/app-ui';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
- * Angular Spinner UI component with UIClassMap-driven styling.
4
+ * Spinner component.
5
+ *
6
+ * The host element is the `<div role="status">` React renders. A raw CSS
7
+ * color (not a known color name) is expressed as inline border colors, and
8
+ * `data-*`/`aria-*` rest props land on the host (React's spread target).
5
9
  */
6
- export declare class MoleculeSpinner {
10
+ export declare class Spinner {
11
+ /** Spinner size. */
7
12
  size: Size;
8
- color?: ColorVariant | string;
13
+ /** Named color variant or a raw CSS color. */
14
+ color?: string;
15
+ /** Accessible label; also renders a screen-reader-only text node. */
9
16
  label?: string;
17
+ /** Extra classes joined onto the spinner classes. */
10
18
  className?: string;
11
- style?: Record<string, string>;
19
+ /** Inline style object (React camelCase). */
20
+ style?: Record<string, unknown>;
21
+ /** `data-testid`. */
12
22
  testId?: string;
13
23
  /**
14
- * Retrieves the current UI class map.
15
- * @returns The UIClassMap instance for styling.
24
+ * Reactive translation, read in the injection context. Its `t` reads the
25
+ * locale, so the view re-renders the text on a locale switch (the static `t`
26
+ * does not).
16
27
  */
17
- get cm(): UIClassMap;
28
+ private readonly i18n;
18
29
  /**
19
- * Computes the accessible spinner label.
20
- * @returns The localized aria-label for the spinner.
30
+ * The current class map.
31
+ * @returns The UIClassMap.
21
32
  */
22
- get spinnerLabel(): string;
33
+ cm(): UIClassMap;
23
34
  /**
24
- * Computes the combined CSS classes for the spinner element.
25
- * @returns The spinner class name string.
35
+ * The accessible label (localized default when not given).
36
+ * @returns The aria-label text.
26
37
  */
27
- get spinnerClasses(): string;
38
+ ariaLabel(): string;
28
39
  /**
29
- * Computes the merged inline styles including custom color.
30
- * @returns The computed style object with optional custom border color.
40
+ * Computes the spinner class list.
41
+ * @returns The class string.
31
42
  */
32
- get computedStyle(): Record<string, string>;
33
- static ɵfac: i0.ɵɵFactoryDeclaration<MoleculeSpinner, never>;
34
- static ɵcmp: i0.ɵɵComponentDeclaration<MoleculeSpinner, "mol-spinner", never, { "size": { "alias": "size"; "required": false; }; "color": { "alias": "color"; "required": false; }; "label": { "alias": "label"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, never, true, never>;
43
+ classes(): string;
44
+ /**
45
+ * Serializes the merged inline style (caller style plus a raw-color border
46
+ * override when `color` is a CSS color rather than a named variant).
47
+ * @returns The style attribute text.
48
+ */
49
+ hostStyle(): string | null;
50
+ static ɵfac: i0.ɵɵFactoryDeclaration<Spinner, never>;
51
+ static ɵcmp: i0.ɵɵComponentDeclaration<Spinner, "div[mol-spinner]", never, { "size": { "alias": "size"; "required": false; }; "color": { "alias": "color"; "required": false; }; "label": { "alias": "label"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, never, true, never>;
35
52
  }
36
53
  //# sourceMappingURL=spinner.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.component.d.ts","sourceRoot":"","sources":["../../src/components/spinner.component.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAGtE;;GAEG;AACH,qBAqBa,eAAe;IACjB,IAAI,EAAE,IAAI,CAAO;IACjB,KAAK,CAAC,EAAE,YAAY,GAAG,MAAM,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IAExB;;;OAGG;IACH,IAAI,EAAE,IAAI,UAAU,CAEnB;IAED;;;OAGG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED;;;OAGG;IACH,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED;;;OAGG;IACH,IAAI,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAW1C;yCA/CU,eAAe;2CAAf,eAAe;CAgD3B"}
1
+ {"version":3,"file":"spinner.component.d.ts","sourceRoot":"","sources":["../../src/components/spinner.component.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAQxD;;;;;;GAMG;AACH,qBAea,OAAO;IAClB,oBAAoB;IACpB,IAAI,EAAE,IAAI,CAAO;IACjB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;IAExC;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACH,OAAO,IAAI,MAAM;IAIjB;;;;OAIG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;yCAlDf,OAAO;2CAAP,OAAO;CA2DnB"}
@@ -1,115 +1,113 @@
1
1
  /**
2
- * Angular Spinner UI component with UIClassMap-driven styling.
2
+ * Spinner component (React parity).
3
3
  *
4
4
  * @module
5
5
  */
6
- import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
7
- import { t } from '@molecule/app-i18n';
6
+ import { Component } from '@angular/core';
7
+ import { useTranslation } from '@molecule/app-angular';
8
8
  import { getClassMap } from '@molecule/app-ui';
9
+ import { styleText } from '../utilities/style.js';
9
10
  import * as i0 from "@angular/core";
10
- function MoleculeSpinner_Conditional_1_Template(rf, ctx) { if (rf & 1) {
11
+ function Spinner_Conditional_0_Template(rf, ctx) { if (rf & 1) {
11
12
  i0.ɵɵdomElementStart(0, "span");
12
13
  i0.ɵɵtext(1);
13
14
  i0.ɵɵdomElementEnd();
14
15
  } if (rf & 2) {
15
16
  const ctx_r0 = i0.ɵɵnextContext();
16
- i0.ɵɵclassMap(ctx_r0.cm.srOnly);
17
+ i0.ɵɵclassMap(ctx_r0.cm().srOnly);
17
18
  i0.ɵɵadvance();
18
19
  i0.ɵɵtextInterpolate(ctx_r0.label);
19
20
  } }
21
+ /** Color names the class map knows — anything else is a raw CSS color. */
22
+ const NAMED_COLORS = ['primary', 'secondary', 'success', 'warning', 'error', 'info'];
20
23
  /**
21
- * Angular Spinner UI component with UIClassMap-driven styling.
22
- */
23
- /**
24
- * Molecule Spinner class.
24
+ * Spinner component.
25
+ *
26
+ * The host element is the `<div role="status">` React renders. A raw CSS
27
+ * color (not a known color name) is expressed as inline border colors, and
28
+ * `data-*`/`aria-*` rest props land on the host (React's spread target).
25
29
  */
26
- export class MoleculeSpinner {
30
+ export class Spinner {
31
+ /** Spinner size. */
27
32
  size = 'md';
33
+ /** Named color variant or a raw CSS color. */
28
34
  color;
35
+ /** Accessible label; also renders a screen-reader-only text node. */
29
36
  label;
37
+ /** Extra classes joined onto the spinner classes. */
30
38
  className;
39
+ /** Inline style object (React camelCase). */
31
40
  style;
41
+ /** `data-testid`. */
32
42
  testId;
33
43
  /**
34
- * Retrieves the current UI class map.
35
- * @returns The UIClassMap instance for styling.
44
+ * Reactive translation, read in the injection context. Its `t` reads the
45
+ * locale, so the view re-renders the text on a locale switch (the static `t`
46
+ * does not).
47
+ */
48
+ i18n = useTranslation();
49
+ /**
50
+ * The current class map.
51
+ * @returns The UIClassMap.
36
52
  */
37
- get cm() {
53
+ cm() {
38
54
  return getClassMap();
39
55
  }
40
56
  /**
41
- * Computes the accessible spinner label.
42
- * @returns The localized aria-label for the spinner.
57
+ * The accessible label (localized default when not given).
58
+ * @returns The aria-label text.
43
59
  */
44
- get spinnerLabel() {
45
- return this.label || t('ui.spinner.loading', undefined, { defaultValue: 'Loading' });
60
+ ariaLabel() {
61
+ return this.label || this.i18n.t('ui.spinner.loading', undefined, { defaultValue: 'Loading' });
46
62
  }
47
63
  /**
48
- * Computes the combined CSS classes for the spinner element.
49
- * @returns The spinner class name string.
64
+ * Computes the spinner class list.
65
+ * @returns The class string.
50
66
  */
51
- get spinnerClasses() {
52
- return this.cm.cn(this.cm.spinner({ size: this.size }), this.className);
67
+ classes() {
68
+ return this.cm().cn(this.cm().spinner({ size: this.size }), this.className);
53
69
  }
54
70
  /**
55
- * Computes the merged inline styles including custom color.
56
- * @returns The computed style object with optional custom border color.
71
+ * Serializes the merged inline style (caller style plus a raw-color border
72
+ * override when `color` is a CSS color rather than a named variant).
73
+ * @returns The style attribute text.
57
74
  */
58
- get computedStyle() {
59
- const base = { ...this.style };
60
- if (this.color &&
75
+ hostStyle() {
76
+ const colorStyle = this.color &&
61
77
  typeof this.color === 'string' &&
62
- !['primary', 'secondary', 'success', 'warning', 'error', 'info'].includes(this.color)) {
63
- base['borderColor'] = this.color;
64
- base['borderTopColor'] = 'transparent';
65
- }
66
- return base;
78
+ !NAMED_COLORS.includes(this.color)
79
+ ? { borderColor: this.color, borderTopColor: 'transparent' }
80
+ : undefined;
81
+ return styleText({ ...this.style, ...colorStyle });
67
82
  }
68
- static ɵfac = function MoleculeSpinner_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MoleculeSpinner)(); };
69
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MoleculeSpinner, selectors: [["mol-spinner"]], inputs: { size: "size", color: "color", label: "label", className: "className", style: "style", testId: "testId" }, decls: 2, vars: 7, consts: [["role", "status"], [3, "class"]], template: function MoleculeSpinner_Template(rf, ctx) { if (rf & 1) {
70
- i0.ɵɵdomElementStart(0, "div", 0);
71
- i0.ɵɵconditionalCreate(1, MoleculeSpinner_Conditional_1_Template, 2, 3, "span", 1);
72
- i0.ɵɵdomElementEnd();
83
+ static ɵfac = function Spinner_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Spinner)(); };
84
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Spinner, selectors: [["div", "mol-spinner", ""]], hostVars: 7, hostBindings: function Spinner_HostBindings(rf, ctx) { if (rf & 2) {
85
+ i0.ɵɵattribute("role", "status")("aria-label", ctx.ariaLabel())("data-testid", ctx.testId);
86
+ i0.ɵɵstyleMap(ctx.hostStyle());
87
+ i0.ɵɵclassMap(ctx.classes());
88
+ } }, inputs: { size: "size", color: "color", label: "label", className: "className", style: "style", testId: "testId" }, decls: 1, vars: 1, consts: [[3, "class"]], template: function Spinner_Template(rf, ctx) { if (rf & 1) {
89
+ i0.ɵɵconditionalCreate(0, Spinner_Conditional_0_Template, 2, 3, "span", 0);
73
90
  } if (rf & 2) {
74
- i0.ɵɵstyleMap(ctx.computedStyle);
75
- i0.ɵɵclassMap(ctx.spinnerClasses);
76
- i0.ɵɵattribute("aria-label", ctx.spinnerLabel)("data-testid", ctx.testId);
77
- i0.ɵɵadvance();
78
- i0.ɵɵconditional(ctx.label ? 1 : -1);
91
+ i0.ɵɵconditional(ctx.label ? 0 : -1);
79
92
  } }, encapsulation: 2 });
80
93
  }
81
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MoleculeSpinner, [{
94
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Spinner, [{
82
95
  type: Component,
83
96
  args: [{
84
- selector: 'mol-spinner',
97
+ selector: 'div[mol-spinner]',
85
98
  standalone: true,
86
- changeDetection: ChangeDetectionStrategy.OnPush,
87
- template: `
88
- <div
89
- role="status"
90
- [attr.aria-label]="spinnerLabel"
91
- [class]="spinnerClasses"
92
- [style]="computedStyle"
93
- [attr.data-testid]="testId"
94
- >
95
- @if (label) {
96
- <span [class]="cm.srOnly">{{ label }}</span>
97
- }
98
- </div>
99
- `,
99
+ inputs: ['size', 'color', 'label', 'className', 'style', 'testId'],
100
+ host: {
101
+ '[attr.role]': '"status"',
102
+ '[attr.aria-label]': 'ariaLabel()',
103
+ '[class]': 'classes()',
104
+ '[style]': 'hostStyle()',
105
+ '[attr.data-testid]': 'testId',
106
+ },
107
+ template: `@if (label) {
108
+ <span [class]="cm().srOnly">{{ label }}</span>
109
+ }`,
100
110
  }]
101
- }], null, { size: [{
102
- type: Input
103
- }], color: [{
104
- type: Input
105
- }], label: [{
106
- type: Input
107
- }], className: [{
108
- type: Input
109
- }], style: [{
110
- type: Input
111
- }], testId: [{
112
- type: Input
113
- }] }); })();
114
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MoleculeSpinner, { className: "MoleculeSpinner", filePath: "components/spinner.component.ts", lineNumber: 37 }); })();
111
+ }], null, null); })();
112
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Spinner, { className: "Spinner", filePath: "components/spinner.component.ts", lineNumber: 40 }); })();
115
113
  //# sourceMappingURL=spinner.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.component.js","sourceRoot":"","sources":["../../src/components/spinner.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAEzE,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAA;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;;;IAkBtC,+BAA0B;IAAA,YAAW;IAAA,oBAAO;;;IAAtC,+BAAmB;IAAC,cAAW;IAAX,kCAAW;;AAhB7C;;GAEG;AAmBH;;GAEG;AACH,MAAM,OAAO,eAAe;IACjB,IAAI,GAAS,IAAI,CAAA;IACjB,KAAK,CAAwB;IAC7B,KAAK,CAAS;IACd,SAAS,CAAS;IAClB,KAAK,CAAyB;IAC9B,MAAM,CAAS;IAExB;;;OAGG;IACH,IAAI,EAAE;QACJ,OAAO,WAAW,EAAE,CAAA;IACtB,CAAC;IAED;;;OAGG;IACH,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,oBAAoB,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAA;IACtF,CAAC;IAED;;;OAGG;IACH,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;IAC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