@egose/shadcn-theme-ng 0.0.27 → 0.1.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 (316) hide show
  1. package/README.md +130 -13
  2. package/accordion/README.md +3 -0
  3. package/accordion/fesm2022/accordion.mjs +148 -0
  4. package/accordion/package.json +25 -0
  5. package/accordion/types/accordion.d.ts +49 -0
  6. package/alert/README.md +2 -63
  7. package/alert/fesm2022/alert.mjs +58 -53
  8. package/alert/package.json +25 -0
  9. package/alert-dialog/README.md +11 -0
  10. package/alert-dialog/fesm2022/alert-dialog.mjs +287 -0
  11. package/alert-dialog/package.json +25 -0
  12. package/alert-dialog/types/alert-dialog.d.ts +90 -0
  13. package/aspect-ratio/README.md +11 -0
  14. package/aspect-ratio/fesm2022/aspect-ratio.mjs +62 -0
  15. package/aspect-ratio/package.json +25 -0
  16. package/aspect-ratio/types/aspect-ratio.d.ts +21 -0
  17. package/autocomplete/README.md +3 -0
  18. package/autocomplete/fesm2022/autocomplete.mjs +391 -0
  19. package/autocomplete/package.json +24 -0
  20. package/autocomplete/types/autocomplete.d.ts +96 -0
  21. package/avatar/README.md +11 -0
  22. package/avatar/fesm2022/avatar.mjs +178 -0
  23. package/avatar/package.json +25 -0
  24. package/avatar/types/avatar.d.ts +50 -0
  25. package/badge/README.md +2 -63
  26. package/badge/fesm2022/badge.mjs +69 -63
  27. package/badge/package.json +25 -0
  28. package/basic-alert/README.md +2 -63
  29. package/basic-alert/fesm2022/basic-alert.mjs +14 -22
  30. package/basic-alert/package.json +24 -0
  31. package/breadcrumb/README.md +11 -0
  32. package/breadcrumb/fesm2022/breadcrumb.mjs +218 -0
  33. package/breadcrumb/package.json +25 -0
  34. package/breadcrumb/types/breadcrumb.d.ts +57 -0
  35. package/button/README.md +2 -63
  36. package/button/fesm2022/button.mjs +201 -177
  37. package/button/package.json +25 -0
  38. package/button/{index.d.ts → types/button.d.ts} +31 -10
  39. package/button-group/README.md +11 -0
  40. package/button-group/fesm2022/button-group.mjs +102 -0
  41. package/button-group/package.json +25 -0
  42. package/button-group/types/button-group.d.ts +30 -0
  43. package/calendar/README.md +2 -63
  44. package/calendar/fesm2022/calendar.mjs +178 -570
  45. package/calendar/package.json +24 -0
  46. package/calendar/types/calendar.d.ts +94 -0
  47. package/card/README.md +11 -0
  48. package/card/fesm2022/card.mjs +169 -0
  49. package/card/package.json +25 -0
  50. package/card/types/card.d.ts +54 -0
  51. package/carousel/README.md +11 -0
  52. package/carousel/fesm2022/carousel.mjs +267 -0
  53. package/carousel/package.json +25 -0
  54. package/carousel/types/carousel.d.ts +84 -0
  55. package/checkbox/README.md +3 -0
  56. package/checkbox/fesm2022/checkbox.mjs +113 -0
  57. package/checkbox/package.json +24 -0
  58. package/checkbox/types/checkbox.d.ts +56 -0
  59. package/collapsible/README.md +11 -0
  60. package/collapsible/fesm2022/collapsible.mjs +77 -0
  61. package/collapsible/package.json +25 -0
  62. package/collapsible/types/collapsible.d.ts +27 -0
  63. package/combobox/README.md +11 -0
  64. package/combobox/fesm2022/combobox.mjs +547 -0
  65. package/combobox/package.json +25 -0
  66. package/combobox/types/combobox.d.ts +151 -0
  67. package/command/README.md +11 -0
  68. package/command/fesm2022/command.mjs +301 -0
  69. package/command/package.json +25 -0
  70. package/command/types/command.d.ts +89 -0
  71. package/confirmation-dialog/README.md +3 -0
  72. package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +79 -0
  73. package/confirmation-dialog/package.json +24 -0
  74. package/confirmation-dialog/types/confirmation-dialog.d.ts +28 -0
  75. package/context-menu/README.md +11 -0
  76. package/context-menu/fesm2022/context-menu.mjs +89 -0
  77. package/context-menu/package.json +25 -0
  78. package/context-menu/types/context-menu.d.ts +34 -0
  79. package/date-picker/README.md +2 -63
  80. package/date-picker/fesm2022/date-picker.mjs +1104 -352
  81. package/date-picker/package.json +24 -0
  82. package/date-picker/types/date-picker.d.ts +555 -0
  83. package/dialog/README.md +3 -0
  84. package/dialog/fesm2022/dialog.mjs +281 -0
  85. package/dialog/package.json +24 -0
  86. package/dialog/types/dialog.d.ts +95 -0
  87. package/drawer/README.md +11 -0
  88. package/drawer/fesm2022/drawer.mjs +261 -0
  89. package/drawer/package.json +25 -0
  90. package/drawer/types/drawer.d.ts +76 -0
  91. package/dropdown-menu/README.md +11 -0
  92. package/dropdown-menu/fesm2022/dropdown-menu.mjs +554 -0
  93. package/dropdown-menu/package.json +25 -0
  94. package/dropdown-menu/types/dropdown-menu.d.ts +180 -0
  95. package/empty/README.md +11 -0
  96. package/empty/fesm2022/empty.mjs +151 -0
  97. package/empty/package.json +25 -0
  98. package/empty/types/empty.d.ts +54 -0
  99. package/field/README.md +11 -0
  100. package/field/fesm2022/field.mjs +351 -0
  101. package/field/package.json +25 -0
  102. package/field/types/field.d.ts +107 -0
  103. package/form-checkbox/README.md +3 -0
  104. package/form-checkbox/fesm2022/form-checkbox.mjs +94 -0
  105. package/form-checkbox/package.json +24 -0
  106. package/form-checkbox/types/form-checkbox.d.ts +33 -0
  107. package/form-date-picker/README.md +2 -63
  108. package/form-date-picker/fesm2022/form-date-picker.mjs +74 -120
  109. package/form-date-picker/package.json +24 -0
  110. package/form-date-picker/{index.d.ts → types/form-date-picker.d.ts} +7 -1
  111. package/form-field/README.md +2 -63
  112. package/form-field/fesm2022/form-field.mjs +54 -28
  113. package/form-field/package.json +25 -0
  114. package/form-field/types/form-field.d.ts +46 -0
  115. package/form-field-simple/README.md +2 -63
  116. package/form-field-simple/fesm2022/form-field-simple.mjs +15 -10
  117. package/form-field-simple/package.json +24 -0
  118. package/form-searchable-multiselect/README.md +3 -0
  119. package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +98 -0
  120. package/form-searchable-multiselect/package.json +24 -0
  121. package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +36 -0
  122. package/form-select/README.md +2 -63
  123. package/form-select/fesm2022/form-select.mjs +85 -141
  124. package/form-select/package.json +24 -0
  125. package/form-select/{index.d.ts → types/form-select.d.ts} +7 -1
  126. package/form-text-input/README.md +2 -63
  127. package/form-text-input/fesm2022/form-text-input.mjs +86 -171
  128. package/form-text-input/package.json +24 -0
  129. package/form-text-input/{index.d.ts → types/form-text-input.d.ts} +9 -12
  130. package/form-textarea/README.md +2 -63
  131. package/form-textarea/fesm2022/form-textarea.mjs +77 -128
  132. package/form-textarea/package.json +24 -0
  133. package/form-textarea/{index.d.ts → types/form-textarea.d.ts} +8 -1
  134. package/hover-card/README.md +11 -0
  135. package/hover-card/fesm2022/hover-card.mjs +123 -0
  136. package/hover-card/package.json +25 -0
  137. package/hover-card/types/hover-card.d.ts +36 -0
  138. package/icon/README.md +2 -63
  139. package/icon/fesm2022/icon.mjs +12 -10
  140. package/icon/package.json +25 -0
  141. package/input/README.md +2 -63
  142. package/input/fesm2022/input.mjs +25 -70
  143. package/input/package.json +25 -0
  144. package/input/types/input.d.ts +19 -0
  145. package/input-group/README.md +11 -0
  146. package/input-group/fesm2022/input-group.mjs +199 -0
  147. package/input-group/package.json +25 -0
  148. package/input-group/types/input-group.d.ts +52 -0
  149. package/input-otp/README.md +11 -0
  150. package/input-otp/fesm2022/input-otp.mjs +141 -0
  151. package/input-otp/package.json +25 -0
  152. package/input-otp/types/input-otp.d.ts +43 -0
  153. package/item/README.md +11 -0
  154. package/item/fesm2022/item.mjs +278 -0
  155. package/item/package.json +25 -0
  156. package/item/types/item.d.ts +101 -0
  157. package/kbd/README.md +11 -0
  158. package/kbd/fesm2022/kbd.mjs +61 -0
  159. package/kbd/package.json +25 -0
  160. package/kbd/types/kbd.d.ts +22 -0
  161. package/label/README.md +2 -63
  162. package/label/fesm2022/label.mjs +12 -11
  163. package/label/package.json +25 -0
  164. package/label/{index.d.ts → types/label.d.ts} +1 -1
  165. package/layout-simple/README.md +3 -0
  166. package/layout-simple/fesm2022/layout-simple.mjs +388 -0
  167. package/layout-simple/package.json +24 -0
  168. package/layout-simple/types/layout-simple.d.ts +167 -0
  169. package/menu/README.md +3 -0
  170. package/menu/fesm2022/menu.mjs +455 -0
  171. package/menu/package.json +24 -0
  172. package/menu/types/menu.d.ts +137 -0
  173. package/menubar/README.md +11 -0
  174. package/menubar/fesm2022/menubar.mjs +108 -0
  175. package/menubar/package.json +25 -0
  176. package/menubar/types/menubar.d.ts +40 -0
  177. package/native-select/README.md +11 -0
  178. package/native-select/fesm2022/native-select.mjs +207 -0
  179. package/native-select/package.json +25 -0
  180. package/native-select/types/native-select.d.ts +70 -0
  181. package/navigation-menu/README.md +11 -0
  182. package/navigation-menu/fesm2022/navigation-menu.mjs +194 -0
  183. package/navigation-menu/package.json +25 -0
  184. package/navigation-menu/types/navigation-menu.d.ts +54 -0
  185. package/package.json +284 -63
  186. package/pagination/README.md +11 -0
  187. package/pagination/fesm2022/pagination.mjs +522 -0
  188. package/pagination/package.json +25 -0
  189. package/pagination/types/pagination.d.ts +192 -0
  190. package/popover/README.md +2 -63
  191. package/popover/fesm2022/popover.mjs +124 -30
  192. package/popover/package.json +24 -0
  193. package/popover/types/popover.d.ts +54 -0
  194. package/progress/README.md +11 -0
  195. package/progress/fesm2022/progress.mjs +77 -0
  196. package/progress/package.json +25 -0
  197. package/progress/types/progress.d.ts +27 -0
  198. package/radio-group/README.md +3 -0
  199. package/radio-group/fesm2022/radio-group.mjs +207 -0
  200. package/radio-group/package.json +25 -0
  201. package/radio-group/types/radio-group.d.ts +71 -0
  202. package/resizable/README.md +11 -0
  203. package/resizable/fesm2022/resizable.mjs +103 -0
  204. package/resizable/package.json +25 -0
  205. package/resizable/types/resizable.d.ts +32 -0
  206. package/scroll-area/README.md +11 -0
  207. package/scroll-area/fesm2022/scroll-area.mjs +51 -0
  208. package/scroll-area/package.json +25 -0
  209. package/scroll-area/types/scroll-area.d.ts +16 -0
  210. package/searchable-multiselect/README.md +3 -0
  211. package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +136 -0
  212. package/searchable-multiselect/package.json +24 -0
  213. package/searchable-multiselect/types/searchable-multiselect.d.ts +45 -0
  214. package/select/README.md +2 -63
  215. package/select/fesm2022/select.mjs +340 -198
  216. package/select/package.json +25 -0
  217. package/select/types/select.d.ts +121 -0
  218. package/separator/README.md +2 -63
  219. package/separator/fesm2022/separator.mjs +17 -15
  220. package/separator/package.json +24 -0
  221. package/separator/{index.d.ts → types/separator.d.ts} +4 -5
  222. package/sheet/README.md +2 -63
  223. package/sheet/fesm2022/sheet.mjs +56 -61
  224. package/sheet/package.json +24 -0
  225. package/sidebar/README.md +11 -0
  226. package/sidebar/fesm2022/sidebar.mjs +846 -0
  227. package/sidebar/package.json +25 -0
  228. package/sidebar/types/sidebar.d.ts +237 -0
  229. package/skeleton/README.md +11 -0
  230. package/skeleton/fesm2022/skeleton.mjs +44 -0
  231. package/skeleton/package.json +25 -0
  232. package/skeleton/types/skeleton.d.ts +16 -0
  233. package/slider/README.md +11 -0
  234. package/slider/fesm2022/slider.mjs +74 -0
  235. package/slider/package.json +25 -0
  236. package/slider/types/slider.d.ts +19 -0
  237. package/sonner/README.md +2 -63
  238. package/sonner/fesm2022/sonner.mjs +34 -39
  239. package/sonner/package.json +25 -0
  240. package/spinner/README.md +2 -63
  241. package/spinner/fesm2022/spinner.mjs +20 -16
  242. package/spinner/package.json +25 -0
  243. package/switch/README.md +2 -63
  244. package/switch/fesm2022/switch.mjs +28 -27
  245. package/switch/package.json +25 -0
  246. package/table/README.md +11 -0
  247. package/table/fesm2022/table.mjs +211 -0
  248. package/table/package.json +25 -0
  249. package/table/types/table.d.ts +87 -0
  250. package/tabs/README.md +3 -0
  251. package/tabs/fesm2022/tabs.mjs +210 -0
  252. package/tabs/package.json +25 -0
  253. package/tabs/types/tabs.d.ts +71 -0
  254. package/textarea/README.md +11 -0
  255. package/textarea/fesm2022/textarea.mjs +47 -0
  256. package/textarea/package.json +25 -0
  257. package/textarea/types/textarea.d.ts +18 -0
  258. package/toggle/README.md +11 -0
  259. package/toggle/fesm2022/toggle.mjs +78 -0
  260. package/toggle/package.json +25 -0
  261. package/toggle/types/toggle.d.ts +27 -0
  262. package/toggle-group/README.md +11 -0
  263. package/toggle-group/fesm2022/toggle-group.mjs +117 -0
  264. package/toggle-group/package.json +25 -0
  265. package/toggle-group/types/toggle-group.d.ts +45 -0
  266. package/tooltip/README.md +3 -0
  267. package/tooltip/fesm2022/tooltip.mjs +72 -0
  268. package/tooltip/package.json +25 -0
  269. package/tooltip/types/tooltip.d.ts +22 -0
  270. package/typography/README.md +11 -0
  271. package/typography/fesm2022/typography.mjs +242 -0
  272. package/typography/package.json +25 -0
  273. package/typography/types/typography.d.ts +94 -0
  274. package/utils/README.md +2 -63
  275. package/utils/fesm2022/utils.mjs +209 -2
  276. package/utils/package.json +25 -0
  277. package/utils/types/utils.d.ts +13 -0
  278. package/alert/fesm2022/alert.mjs.map +0 -1
  279. package/badge/fesm2022/badge.mjs.map +0 -1
  280. package/basic-alert/fesm2022/basic-alert.mjs.map +0 -1
  281. package/button/fesm2022/button.mjs.map +0 -1
  282. package/calendar/fesm2022/calendar.mjs.map +0 -1
  283. package/calendar/index.d.ts +0 -111
  284. package/date-picker/fesm2022/date-picker.mjs.map +0 -1
  285. package/date-picker/index.d.ts +0 -227
  286. package/form-date-picker/fesm2022/form-date-picker.mjs.map +0 -1
  287. package/form-field/fesm2022/form-field.mjs.map +0 -1
  288. package/form-field/index.d.ts +0 -37
  289. package/form-field-simple/fesm2022/form-field-simple.mjs.map +0 -1
  290. package/form-select/fesm2022/form-select.mjs.map +0 -1
  291. package/form-text-input/fesm2022/form-text-input.mjs.map +0 -1
  292. package/form-textarea/fesm2022/form-textarea.mjs.map +0 -1
  293. package/icon/fesm2022/icon.mjs.map +0 -1
  294. package/input/fesm2022/input.mjs.map +0 -1
  295. package/input/index.d.ts +0 -41
  296. package/label/fesm2022/label.mjs.map +0 -1
  297. package/popover/fesm2022/popover.mjs.map +0 -1
  298. package/popover/index.d.ts +0 -30
  299. package/select/fesm2022/select.mjs.map +0 -1
  300. package/select/index.d.ts +0 -92
  301. package/separator/fesm2022/separator.mjs.map +0 -1
  302. package/sheet/fesm2022/sheet.mjs.map +0 -1
  303. package/sonner/fesm2022/sonner.mjs.map +0 -1
  304. package/spinner/fesm2022/spinner.mjs.map +0 -1
  305. package/switch/fesm2022/switch.mjs.map +0 -1
  306. package/utils/fesm2022/utils.mjs.map +0 -1
  307. package/utils/index.d.ts +0 -5
  308. /package/alert/{index.d.ts → types/alert.d.ts} +0 -0
  309. /package/badge/{index.d.ts → types/badge.d.ts} +0 -0
  310. /package/basic-alert/{index.d.ts → types/basic-alert.d.ts} +0 -0
  311. /package/form-field-simple/{index.d.ts → types/form-field-simple.d.ts} +0 -0
  312. /package/icon/{index.d.ts → types/icon.d.ts} +0 -0
  313. /package/sheet/{index.d.ts → types/sheet.d.ts} +0 -0
  314. /package/sonner/{index.d.ts → types/sonner.d.ts} +0 -0
  315. /package/spinner/{index.d.ts → types/spinner.d.ts} +0 -0
  316. /package/switch/{index.d.ts → types/switch.d.ts} +0 -0
@@ -1,71 +1,76 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, signal, computed, Component, NgModule } from '@angular/core';
3
- import { NgTemplateOutlet } from '@angular/common';
2
+ import { input, signal, computed, Component, InjectionToken, inject, Directive, NgModule } from '@angular/core';
4
3
  import * as i1 from '@spartan-ng/brain/button';
5
4
  import { BrnButton } from '@spartan-ng/brain/button';
5
+ import { hlm } from '@egose/shadcn-theme-ng/utils';
6
+ import { NgTemplateOutlet } from '@angular/common';
6
7
  import { HlmSpinner } from '@egose/shadcn-theme-ng/spinner';
7
8
  import { cva } from 'class-variance-authority';
8
- import { hlm } from '@egose/shadcn-theme-ng/utils';
9
9
 
10
10
  const buttonVariants = cva([
11
- 'cursor-pointer',
12
- 'active:translate-y-[0.5px]',
13
- 'disabled:pointer-events-none',
14
- 'disabled:opacity-50',
15
- 'focus-visible:outline-none',
16
- 'focus-visible:ring-1',
17
- 'focus-visible:ring-ring',
18
- 'font-medium',
19
- 'gap-2',
20
- 'inline-flex',
21
- 'items-center',
22
- 'justify-center',
23
- 'rounded-sm',
24
- 'text-sm',
25
- 'transform',
26
- 'transition',
27
- 'transition-colors',
28
- 'whitespace-nowrap',
29
- '[&_svg]:pointer-events-none',
30
- '[&_svg]:shrink-0',
31
- '[&_svg]:size-4',
32
- 'no-underline',
11
+ "cursor-pointer",
12
+ "active:translate-y-[0.5px]",
13
+ "disabled:pointer-events-none",
14
+ "disabled:opacity-50",
15
+ "focus-visible:outline-none",
16
+ "focus-visible:ring-1",
17
+ "focus-visible:ring-ring",
18
+ "font-medium",
19
+ "gap-2",
20
+ "inline-flex",
21
+ "items-center",
22
+ "justify-center",
23
+ "rounded-sm",
24
+ "text-sm",
25
+ "transform",
26
+ "transition",
27
+ "transition-colors",
28
+ "whitespace-nowrap",
29
+ "[&_svg]:pointer-events-none",
30
+ "[&_svg]:shrink-0",
31
+ "[&_svg]:size-4",
32
+ "no-underline",
33
33
  ], {
34
34
  variants: {
35
35
  variant: {
36
- primary: 'border border-primary bg-primary text-primary-foreground shadow-sm hover:bg-primary/90',
37
- secondary: 'border border-secondary bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/90',
38
- success: 'border border-success bg-success text-success-foreground shadow-sm hover:bg-success/90',
39
- warning: 'border border-warning bg-warning text-warning-foreground shadow-sm hover:bg-warning/90',
40
- danger: 'border border-danger bg-danger text-danger-foreground shadow-sm hover:bg-danger/90',
41
- info: 'border border-info bg-info text-info-foreground shadow-sm hover:bg-info/90',
42
- light: 'border border-light bg-light text-light-foreground shadow-sm hover:bg-light/90',
43
- dark: 'border border-dark bg-dark text-dark-foreground shadow-sm hover:bg-dark/90',
44
- accent: 'border border-accent bg-accent text-accent-foreground shadow-sm hover:bg-accent/90',
45
- destructive: 'border border-destructive bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
46
- muted: 'border border-muted bg-muted text-muted-foreground shadow-sm hover:bg-muted/90',
47
- link: 'text-primary underline-offset-4 hover:underline',
48
- ghost: 'hover:bg-light hover:text-light-foreground',
36
+ default: "border border-primary bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
37
+ primary: "border border-primary bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
38
+ secondary: "border border-secondary bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/90",
39
+ success: "border border-success bg-success text-success-foreground shadow-sm hover:bg-success/90",
40
+ warning: "border border-warning bg-warning text-warning-foreground shadow-sm hover:bg-warning/90",
41
+ danger: "border border-danger bg-danger text-danger-foreground shadow-sm hover:bg-danger/90",
42
+ info: "border border-info bg-info text-info-foreground shadow-sm hover:bg-info/90",
43
+ light: "border border-light bg-light text-light-foreground shadow-sm hover:bg-light/90",
44
+ dark: "border border-dark bg-dark text-dark-foreground shadow-sm hover:bg-dark/90",
45
+ accent: "border border-accent bg-accent text-accent-foreground shadow-sm hover:bg-accent/90",
46
+ destructive: "border border-destructive bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
47
+ muted: "border border-muted bg-muted text-muted-foreground shadow-sm hover:bg-muted/90",
48
+ outline: "border border-primary bg-white text-primary shadow-sm hover:bg-primary/10",
49
+ link: "text-primary underline-offset-4 hover:underline",
50
+ ghost: "hover:bg-light hover:text-light-foreground",
49
51
  },
50
52
  size: {
51
- xs: 'h-7 rounded-xs px-2 text-xs',
52
- sm: 'h-8 rounded-sm px-3',
53
- default: 'h-9 px-4 py-2',
54
- lg: 'h-10 rounded-sm px-7 text-base',
55
- icon: 'h-9 w-9',
56
- 'compact-xs': 'h-6 px-2 py-1 text-xs',
57
- 'compact-sm': 'h-7 px-2 py-1',
58
- 'compact-default': 'h-8 px-2 py-1',
59
- 'compact-lg': 'h-9 px-2 py-1 text-base',
60
- 'compact-icon': 'h-8 w-8',
53
+ xs: "h-7 rounded-xs px-2 text-xs",
54
+ sm: "h-8 rounded-sm px-3",
55
+ default: "h-9 px-4 py-2",
56
+ lg: "h-10 rounded-sm px-7 text-base",
57
+ icon: "h-9 w-9",
58
+ 'icon-xs': "h-6 w-6 rounded-xs",
59
+ 'icon-sm': "h-8 w-8 rounded-sm",
60
+ 'icon-lg': "h-10 w-10 rounded-sm",
61
+ 'compact-xs': "h-6 px-2 py-1 text-xs",
62
+ 'compact-sm': "h-7 px-2 py-1",
63
+ 'compact-default': "h-8 px-2 py-1",
64
+ 'compact-lg': "h-9 px-2 py-1 text-base",
65
+ 'compact-icon': "h-8 w-8",
61
66
  },
62
67
  appearance: {
63
68
  solid: '',
64
- outline: 'bg-white border',
65
- 'outline-filled': 'bg-white border',
69
+ outline: "bg-white border",
70
+ 'outline-filled': "bg-white border",
66
71
  },
67
72
  loading: {
68
- true: 'pointer-events-none',
73
+ true: "pointer-events-none",
69
74
  false: null,
70
75
  },
71
76
  },
@@ -78,17 +83,27 @@ const buttonVariants = cva([
78
83
  });
79
84
  class HlmButton {
80
85
  /** Props as signal-based inputs */
81
- variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : []));
82
- size = input('default', ...(ngDevMode ? [{ debugName: "size" }] : []));
83
- appearance = input('solid', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
84
- loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
85
- icon = input(undefined, ...(ngDevMode ? [{ debugName: "icon" }] : []));
86
- iconPosition = input('left', ...(ngDevMode ? [{ debugName: "iconPosition" }] : []));
87
- userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
88
- spinnerUserClass = input('', ...(ngDevMode ? [{ debugName: "spinnerUserClass" }] : []));
89
- disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
90
- type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : []));
91
- _additionalClasses = signal('', ...(ngDevMode ? [{ debugName: "_additionalClasses" }] : []));
86
+ variant = input('primary', /* @ts-ignore */
87
+ ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
88
+ size = input('default', /* @ts-ignore */
89
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
90
+ appearance = input('solid', /* @ts-ignore */
91
+ ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
92
+ loading = input(false, /* @ts-ignore */
93
+ ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
94
+ icon = input(undefined, /* @ts-ignore */
95
+ ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
96
+ iconPosition = input('left', /* @ts-ignore */
97
+ ...(ngDevMode ? [{ debugName: "iconPosition" }] : /* istanbul ignore next */ []));
98
+ userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
99
+ spinnerUserClass = input('', /* @ts-ignore */
100
+ ...(ngDevMode ? [{ debugName: "spinnerUserClass" }] : /* istanbul ignore next */ []));
101
+ disabled = input(false, /* @ts-ignore */
102
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
103
+ type = input('button', /* @ts-ignore */
104
+ ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
105
+ _additionalClasses = signal('', /* @ts-ignore */
106
+ ...(ngDevMode ? [{ debugName: "_additionalClasses" }] : /* istanbul ignore next */ []));
92
107
  /** Computed button class merging */
93
108
  _computedClass = computed(() => {
94
109
  const outlineClasses = this.appearance() === 'outline' || this.appearance() === 'outline-filled'
@@ -103,120 +118,105 @@ class HlmButton {
103
118
  appearance: this.appearance(),
104
119
  loading: this.loading(),
105
120
  className: this.userClass(),
106
- }), outlineClasses, this.loading() ? 'pointer-events-none' : '', this._additionalClasses());
107
- }, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
121
+ }), outlineClasses, this.loading() ? "pointer-events-none" : '', this._additionalClasses());
122
+ }, /* @ts-ignore */
123
+ ...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
108
124
  /** Computed spinner classes */
109
125
  spinnerClass = computed(() => {
110
126
  const base = this.appearance() === 'outline' || this.appearance() === 'outline-filled'
111
127
  ? this.getOutlineSpinnerClasses(this.variant())
112
128
  : this.getSpinnerClasses(this.variant());
113
129
  return hlm(base, this.spinnerUserClass());
114
- }, ...(ngDevMode ? [{ debugName: "spinnerClass" }] : []));
130
+ }, /* @ts-ignore */
131
+ ...(ngDevMode ? [{ debugName: "spinnerClass" }] : /* istanbul ignore next */ []));
115
132
  setClass(classes) {
116
133
  this._additionalClasses.set(classes);
117
134
  }
118
135
  /** Helper functions */
119
136
  getOutlineClasses(variant) {
120
137
  const colors = {
121
- primary: 'border-primary text-primary shadow-sm hover:bg-primary/10',
122
- secondary: 'border-secondary text-secondary shadow-sm hover:bg-secondary/10',
123
- success: 'border-success text-success shadow-sm hover:bg-success/10',
124
- warning: 'border-warning text-warning shadow-sm hover:bg-warning/10',
125
- danger: 'border-danger text-danger shadow-sm hover:bg-danger/10',
126
- info: 'border-info text-info shadow-sm hover:bg-info/10',
127
- light: 'border-light text-light-foreground shadow-sm hover:bg-light/10',
128
- dark: 'border-dark text-dark shadow-sm hover:bg-dark/10',
129
- accent: 'border-accent text-accent shadow-sm hover:bg-accent/10',
130
- destructive: 'border-destructive text-destructive shadow-sm hover:bg-destructive/10',
131
- muted: 'border-muted text-muted-foreground shadow-sm hover:bg-muted/10',
132
- link: 'text-primary',
133
- ghost: 'text-light-foreground',
138
+ default: "border-primary text-primary shadow-sm hover:bg-primary/10",
139
+ primary: "border-primary text-primary shadow-sm hover:bg-primary/10",
140
+ secondary: "border-secondary text-secondary shadow-sm hover:bg-secondary/10",
141
+ success: "border-success text-success shadow-sm hover:bg-success/10",
142
+ warning: "border-warning text-warning shadow-sm hover:bg-warning/10",
143
+ danger: "border-danger text-danger shadow-sm hover:bg-danger/10",
144
+ info: "border-info text-info shadow-sm hover:bg-info/10",
145
+ light: "border-light text-light-foreground shadow-sm hover:bg-light/10",
146
+ dark: "border-dark text-dark shadow-sm hover:bg-dark/10",
147
+ accent: "border-accent text-accent shadow-sm hover:bg-accent/10",
148
+ destructive: "border-destructive text-destructive shadow-sm hover:bg-destructive/10",
149
+ muted: "border-muted text-muted-foreground shadow-sm hover:bg-muted/10",
150
+ outline: "border-primary text-primary shadow-sm hover:bg-primary/10",
151
+ link: "text-primary",
152
+ ghost: "text-light-foreground",
134
153
  };
135
154
  return colors[variant];
136
155
  }
137
156
  getOutlineFilledClasses(variant) {
138
157
  const colors = {
139
- primary: 'hover:bg-primary hover:text-primary-foreground',
140
- secondary: 'hover:bg-secondary hover:text-secondary-foreground',
141
- success: 'hover:bg-success hover:text-success-foreground',
142
- warning: 'hover:bg-warning hover:text-warning-foreground',
143
- danger: 'hover:bg-danger hover:text-danger-foreground',
144
- info: 'hover:bg-info hover:text-info-foreground',
145
- light: 'hover:bg-light hover:text-light-foreground',
146
- dark: 'hover:bg-dark hover:text-dark-foreground',
147
- accent: 'hover:bg-accent hover:text-accent-foreground',
148
- destructive: 'hover:bg-destructive hover:text-destructive-foreground',
149
- muted: 'hover:bg-muted hover:text-muted-foreground',
150
- link: 'hover:underline',
151
- ghost: 'hover:bg-light',
158
+ default: "hover:bg-primary hover:text-primary-foreground",
159
+ primary: "hover:bg-primary hover:text-primary-foreground",
160
+ secondary: "hover:bg-secondary hover:text-secondary-foreground",
161
+ success: "hover:bg-success hover:text-success-foreground",
162
+ warning: "hover:bg-warning hover:text-warning-foreground",
163
+ danger: "hover:bg-danger hover:text-danger-foreground",
164
+ info: "hover:bg-info hover:text-info-foreground",
165
+ light: "hover:bg-light hover:text-light-foreground",
166
+ dark: "hover:bg-dark hover:text-dark-foreground",
167
+ accent: "hover:bg-accent hover:text-accent-foreground",
168
+ destructive: "hover:bg-destructive hover:text-destructive-foreground",
169
+ muted: "hover:bg-muted hover:text-muted-foreground",
170
+ outline: "hover:bg-primary hover:text-primary-foreground",
171
+ link: "hover:underline",
172
+ ghost: "hover:bg-light",
152
173
  };
153
174
  return colors[variant];
154
175
  }
155
176
  getSpinnerClasses(variant) {
156
177
  const colors = {
157
- primary: '[&>svg]:text-primary-foreground',
158
- secondary: '[&>svg]:text-secondary-foreground',
159
- success: '[&>svg]:text-success-foreground',
160
- warning: '[&>svg]:text-warning-foreground',
161
- danger: '[&>svg]:text-danger-foreground',
162
- info: '[&>svg]:text-info-foreground',
163
- light: '[&>svg]:text-light-foreground',
164
- dark: '[&>svg]:text-dark-foreground',
165
- accent: '[&>svg]:text-accent-foreground',
166
- destructive: '[&>svg]:text-destructive-foreground',
167
- muted: '[&>svg]:text-muted-foreground',
168
- link: '[&>svg]:text-primary',
169
- ghost: '[&>svg]:text-light-foreground',
178
+ default: "[&>svg]:text-primary-foreground",
179
+ primary: "[&>svg]:text-primary-foreground",
180
+ secondary: "[&>svg]:text-secondary-foreground",
181
+ success: "[&>svg]:text-success-foreground",
182
+ warning: "[&>svg]:text-warning-foreground",
183
+ danger: "[&>svg]:text-danger-foreground",
184
+ info: "[&>svg]:text-info-foreground",
185
+ light: "[&>svg]:text-light-foreground",
186
+ dark: "[&>svg]:text-dark-foreground",
187
+ accent: "[&>svg]:text-accent-foreground",
188
+ destructive: "[&>svg]:text-destructive-foreground",
189
+ muted: "[&>svg]:text-muted-foreground",
190
+ outline: "[&>svg]:text-primary",
191
+ link: "[&>svg]:text-primary",
192
+ ghost: "[&>svg]:text-light-foreground",
170
193
  };
171
194
  return colors[variant];
172
195
  }
173
196
  getOutlineSpinnerClasses(variant) {
174
197
  const colors = {
175
- primary: '[&>svg]:text-primary',
176
- secondary: '[&>svg]:text-secondary',
177
- success: '[&>svg]:text-success',
178
- warning: '[&>svg]:text-warning',
179
- danger: '[&>svg]:text-danger',
180
- info: '[&>svg]:text-info',
181
- light: '[&>svg]:text-light',
182
- dark: '[&>svg]:text-dark',
183
- accent: '[&>svg]:text-accent',
184
- destructive: '[&>svg]:text-destructive',
185
- muted: '[&>svg]:text-muted-foreground',
186
- link: '[&>svg]:text-primary',
187
- ghost: '[&>svg]:text-light-foreground',
198
+ default: "[&>svg]:text-primary",
199
+ primary: "[&>svg]:text-primary",
200
+ secondary: "[&>svg]:text-secondary",
201
+ success: "[&>svg]:text-success",
202
+ warning: "[&>svg]:text-warning",
203
+ danger: "[&>svg]:text-danger",
204
+ info: "[&>svg]:text-info",
205
+ light: "[&>svg]:text-light",
206
+ dark: "[&>svg]:text-dark",
207
+ accent: "[&>svg]:text-accent",
208
+ destructive: "[&>svg]:text-destructive",
209
+ muted: "[&>svg]:text-muted-foreground",
210
+ outline: "[&>svg]:text-primary",
211
+ link: "[&>svg]:text-primary",
212
+ ghost: "[&>svg]:text-light-foreground",
188
213
  };
189
214
  return colors[variant];
190
215
  }
191
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HlmButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
192
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: HlmButton, isStandalone: true, selector: "button[hlmButton], a[hlmButton]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, spinnerUserClass: { classPropertyName: "spinnerUserClass", publicName: "spinnerUserClass", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()", "attr.aria-busy": "loading() || null", "attr.disabled": "(loading() || disabled()) ? true : null", "attr.type": "type()" } }, hostDirectives: [{ directive: i1.BrnButton, inputs: ["disabled", "disabled"] }], ngImport: i0, template: `
193
- <ng-template #projected>
194
- <ng-content></ng-content>
195
- </ng-template>
196
-
197
- @if (loading()) {
198
- <div class="relative inline-flex items-center">
199
- <span class="invisible">
200
- <ng-container *ngTemplateOutlet="projected" />
201
- </span>
202
- <span class="absolute inset-0 flex items-center justify-center">
203
- <hlm-spinner [spinnerClass]="spinnerClass()" />
204
- </span>
205
- </div>
206
- } @else {
207
- <div class="flex items-center gap-1">
208
- @if (icon() && iconPosition() === 'left') {
209
- <ng-container *ngTemplateOutlet="icon()" />
210
- }
211
- <ng-container *ngTemplateOutlet="projected" />
212
- @if (icon() && iconPosition() === 'right') {
213
- <ng-container *ngTemplateOutlet="icon()" />
214
- }
215
- </div>
216
- }
217
- `, isInline: true, dependencies: [{ kind: "component", type: HlmSpinner, selector: "hlm-spinner", inputs: ["size", "show", "class", "spinnerClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
216
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
217
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: HlmButton, isStandalone: true, selector: "button[hlmButton], a[hlmButton]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, spinnerUserClass: { classPropertyName: "spinnerUserClass", publicName: "spinnerUserClass", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()", "attr.aria-busy": "loading() || null", "attr.disabled": "(loading() || disabled()) ? true : null", "attr.type": "type()" } }, hostDirectives: [{ directive: i1.BrnButton, inputs: ["disabled", "disabled"] }], ngImport: i0, template: "\n <ng-template #projected>\n <ng-content></ng-content>\n </ng-template>\n\n @if (loading()) {\n <div class=\"relative inline-flex items-center\">\n <span class=\"invisible\">\n <ng-container *ngTemplateOutlet=\"projected\" />\n </span>\n <span class=\"absolute inset-0 flex items-center justify-center\">\n <hlm-spinner [spinnerClass]=\"spinnerClass()\" />\n </span>\n </div>\n } @else {\n <div class=\"flex items-center gap-1\">\n @if (icon() && iconPosition() === 'left') {\n <ng-container *ngTemplateOutlet=\"icon()\" />\n }\n <ng-container *ngTemplateOutlet=\"projected\" />\n @if (icon() && iconPosition() === 'right') {\n <ng-container *ngTemplateOutlet=\"icon()\" />\n }\n </div>\n }\n ", isInline: true, dependencies: [{ kind: "component", type: HlmSpinner, selector: "hlm-spinner", inputs: ["size", "show", "class", "spinnerClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
218
218
  }
219
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HlmButton, decorators: [{
219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButton, decorators: [{
220
220
  type: Component,
221
221
  args: [{
222
222
  selector: 'button[hlmButton], a[hlmButton]',
@@ -229,45 +229,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
229
229
  '[attr.disabled]': '(loading() || disabled()) ? true : null',
230
230
  '[attr.type]': 'type()',
231
231
  },
232
- template: `
233
- <ng-template #projected>
234
- <ng-content></ng-content>
235
- </ng-template>
232
+ template: "\n <ng-template #projected>\n <ng-content></ng-content>\n </ng-template>\n\n @if (loading()) {\n <div class=\"relative inline-flex items-center\">\n <span class=\"invisible\">\n <ng-container *ngTemplateOutlet=\"projected\" />\n </span>\n <span class=\"absolute inset-0 flex items-center justify-center\">\n <hlm-spinner [spinnerClass]=\"spinnerClass()\" />\n </span>\n </div>\n } @else {\n <div class=\"flex items-center gap-1\">\n @if (icon() && iconPosition() === 'left') {\n <ng-container *ngTemplateOutlet=\"icon()\" />\n }\n <ng-container *ngTemplateOutlet=\"projected\" />\n @if (icon() && iconPosition() === 'right') {\n <ng-container *ngTemplateOutlet=\"icon()\" />\n }\n </div>\n }\n ",
233
+ }]
234
+ }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPosition", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], spinnerUserClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "spinnerUserClass", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
236
235
 
237
- @if (loading()) {
238
- <div class="relative inline-flex items-center">
239
- <span class="invisible">
240
- <ng-container *ngTemplateOutlet="projected" />
241
- </span>
242
- <span class="absolute inset-0 flex items-center justify-center">
243
- <hlm-spinner [spinnerClass]="spinnerClass()" />
244
- </span>
245
- </div>
246
- } @else {
247
- <div class="flex items-center gap-1">
248
- @if (icon() && iconPosition() === 'left') {
249
- <ng-container *ngTemplateOutlet="icon()" />
250
- }
251
- <ng-container *ngTemplateOutlet="projected" />
252
- @if (icon() && iconPosition() === 'right') {
253
- <ng-container *ngTemplateOutlet="icon()" />
254
- }
255
- </div>
236
+ const defaultConfig = {
237
+ variant: 'default',
238
+ size: 'default',
239
+ };
240
+ const BrnButtonConfigToken = new InjectionToken('BrnButtonConfig');
241
+ function provideBrnButtonConfig(config) {
242
+ return { provide: BrnButtonConfigToken, useValue: { ...defaultConfig, ...config } };
243
+ }
244
+ function injectBrnButtonConfig() {
245
+ return inject(BrnButtonConfigToken, { optional: true }) ?? defaultConfig;
246
+ }
247
+
248
+ class HlmBtn {
249
+ _config = injectBrnButtonConfig();
250
+ _additionalClasses = signal('', /* @ts-ignore */
251
+ ...(ngDevMode ? [{ debugName: "_additionalClasses" }] : /* istanbul ignore next */ []));
252
+ variant = input(this._config.variant, /* @ts-ignore */
253
+ ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
254
+ size = input(this._config.size, /* @ts-ignore */
255
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
256
+ userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
257
+ type = input('button', /* @ts-ignore */
258
+ ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
259
+ _computedClass = computed(() => hlm(buttonVariants({
260
+ variant: this.variant(),
261
+ size: this.size(),
262
+ }), this.userClass(), this._additionalClasses()), /* @ts-ignore */
263
+ ...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
264
+ setClass(classes) {
265
+ this._additionalClasses.set(classes);
256
266
  }
257
- `,
267
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmBtn, deps: [], target: i0.ɵɵFactoryTarget.Directive });
268
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmBtn, isStandalone: true, selector: "button[hlmBtn], a[hlmBtn]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "button" }, properties: { "class": "_computedClass()", "attr.type": "type()" } }, exportAs: ["hlmBtn"], hostDirectives: [{ directive: i1.BrnButton, inputs: ["disabled", "disabled"] }], ngImport: i0 });
269
+ }
270
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmBtn, decorators: [{
271
+ type: Directive,
272
+ args: [{
273
+ selector: 'button[hlmBtn], a[hlmBtn]',
274
+ exportAs: 'hlmBtn',
275
+ standalone: true,
276
+ hostDirectives: [{ directive: BrnButton, inputs: ['disabled'] }],
277
+ host: {
278
+ '[class]': '_computedClass()',
279
+ '[attr.type]': 'type()',
280
+ 'data-slot': 'button',
281
+ },
258
282
  }]
259
- }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPosition", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], spinnerUserClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "spinnerUserClass", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
283
+ }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
260
284
 
261
285
  /*
262
286
  * Public API Surface of button
263
287
  */
264
- const HlmButtonImports = [HlmButton];
288
+ const HlmButtonImports = [HlmButton, HlmBtn];
265
289
  class HlmButtonModule {
266
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HlmButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
267
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: HlmButtonModule, imports: [HlmButton], exports: [HlmButton] });
268
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HlmButtonModule, imports: [HlmButtonImports] });
290
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
291
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmButtonModule, imports: [HlmButton, HlmBtn], exports: [HlmButton, HlmBtn] });
292
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButtonModule, imports: [HlmButton] });
269
293
  }
270
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HlmButtonModule, decorators: [{
294
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButtonModule, decorators: [{
271
295
  type: NgModule,
272
296
  args: [{
273
297
  imports: [...HlmButtonImports],
@@ -279,5 +303,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
279
303
  * Generated bundle index. Do not edit.
280
304
  */
281
305
 
282
- export { HlmButton, HlmButtonImports, HlmButtonModule, buttonVariants };
283
- //# sourceMappingURL=button.mjs.map
306
+ export { HlmBtn, HlmButton, HlmButtonImports, HlmButtonModule, buttonVariants, injectBrnButtonConfig, provideBrnButtonConfig };
307
+
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "button",
3
+ "version": "0.0.1",
4
+ "peerDependencies": {
5
+ "@angular/common": "^20.2.0 || ^22.0.0",
6
+ "@angular/core": "^20.2.0 || ^22.0.0",
7
+ "@spartan-ng/brain": "^0.0.1-alpha.512"
8
+ },
9
+ "dependencies": {
10
+ "tslib": "^2.3.0"
11
+ },
12
+ "sideEffects": false,
13
+ "module": "fesm2022/button.mjs",
14
+ "typings": "types/button.d.ts",
15
+ "exports": {
16
+ "./package.json": {
17
+ "default": "./package.json"
18
+ },
19
+ ".": {
20
+ "types": "./types/button.d.ts",
21
+ "default": "./fesm2022/button.mjs"
22
+ }
23
+ },
24
+ "type": "module"
25
+ }
@@ -1,13 +1,27 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import * as class_variance_authority_types from 'class-variance-authority/types';
3
- import { VariantProps } from 'class-variance-authority';
2
+ import { TemplateRef, ValueProvider } from '@angular/core';
4
3
  import { ClassValue } from 'clsx';
5
4
  import * as i1 from '@spartan-ng/brain/button';
5
+ import * as class_variance_authority_types from 'class-variance-authority/types';
6
+ import { VariantProps } from 'class-variance-authority';
7
+
8
+ declare class HlmBtn {
9
+ private readonly _config;
10
+ private readonly _additionalClasses;
11
+ readonly variant: _angular_core.InputSignal<"default" | "primary" | "secondary" | "success" | "warning" | "danger" | "info" | "light" | "dark" | "accent" | "destructive" | "muted" | "outline" | "link" | "ghost" | null | undefined>;
12
+ readonly size: _angular_core.InputSignal<"default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "compact-xs" | "compact-sm" | "compact-default" | "compact-lg" | "compact-icon" | null | undefined>;
13
+ readonly userClass: _angular_core.InputSignal<ClassValue>;
14
+ readonly type: _angular_core.InputSignal<"button" | "submit" | "reset">;
15
+ protected readonly _computedClass: _angular_core.Signal<string>;
16
+ setClass(classes: string): void;
17
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmBtn, never>;
18
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HlmBtn, "button[hlmBtn], a[hlmBtn]", ["hlmBtn"], { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.BrnButton; inputs: { "disabled": "disabled"; }; outputs: {}; }]>;
19
+ }
6
20
 
7
21
  declare const buttonVariants: (props?: ({
8
- variant?: "primary" | "secondary" | "success" | "warning" | "danger" | "info" | "light" | "dark" | "accent" | "destructive" | "muted" | "link" | "ghost" | null | undefined;
9
- size?: "xs" | "sm" | "default" | "lg" | "icon" | "compact-xs" | "compact-sm" | "compact-default" | "compact-lg" | "compact-icon" | null | undefined;
10
- appearance?: "solid" | "outline" | "outline-filled" | null | undefined;
22
+ variant?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | "info" | "light" | "dark" | "accent" | "destructive" | "muted" | "outline" | "link" | "ghost" | null | undefined;
23
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "compact-xs" | "compact-sm" | "compact-default" | "compact-lg" | "compact-icon" | null | undefined;
24
+ appearance?: "outline" | "solid" | "outline-filled" | null | undefined;
11
25
  loading?: boolean | null | undefined;
12
26
  } & class_variance_authority_types.ClassProp) | undefined) => string;
13
27
  type ButtonVariants = VariantProps<typeof buttonVariants>;
@@ -20,7 +34,7 @@ declare class HlmButton {
20
34
  readonly size: _angular_core.InputSignal<SizeType>;
21
35
  readonly appearance: _angular_core.InputSignal<AppearanceType>;
22
36
  readonly loading: _angular_core.InputSignal<boolean>;
23
- readonly icon: _angular_core.InputSignal<any>;
37
+ readonly icon: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
24
38
  readonly iconPosition: _angular_core.InputSignal<"left" | "right">;
25
39
  readonly userClass: _angular_core.InputSignal<ClassValue>;
26
40
  readonly spinnerUserClass: _angular_core.InputSignal<ClassValue>;
@@ -41,12 +55,19 @@ declare class HlmButton {
41
55
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmButton, "button[hlmButton], a[hlmButton]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconPosition": { "alias": "iconPosition"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "spinnerUserClass": { "alias": "spinnerUserClass"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BrnButton; inputs: { "disabled": "disabled"; }; outputs: {}; }]>;
42
56
  }
43
57
 
44
- declare const HlmButtonImports: readonly [typeof HlmButton];
58
+ interface BrnButtonConfig {
59
+ variant: ButtonVariants['variant'];
60
+ size: ButtonVariants['size'];
61
+ }
62
+ declare function provideBrnButtonConfig(config: Partial<BrnButtonConfig>): ValueProvider;
63
+ declare function injectBrnButtonConfig(): BrnButtonConfig;
64
+
65
+ declare const HlmButtonImports: readonly [typeof HlmButton, typeof HlmBtn];
45
66
  declare class HlmButtonModule {
46
67
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmButtonModule, never>;
47
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<HlmButtonModule, never, [typeof HlmButton], [typeof HlmButton]>;
68
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<HlmButtonModule, never, [typeof HlmButton, typeof HlmBtn], [typeof HlmButton, typeof HlmBtn]>;
48
69
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<HlmButtonModule>;
49
70
  }
50
71
 
51
- export { HlmButton, HlmButtonImports, HlmButtonModule, buttonVariants };
52
- export type { AppearanceType, ButtonVariants, SizeType, VariantType };
72
+ export { HlmBtn, HlmButton, HlmButtonImports, HlmButtonModule, buttonVariants, injectBrnButtonConfig, provideBrnButtonConfig };
73
+ export type { AppearanceType, BrnButtonConfig, ButtonVariants, SizeType, VariantType };
@@ -0,0 +1,11 @@
1
+ # ButtonGroup
2
+
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli).
4
+
5
+ ## Building
6
+
7
+ To build the library, run:
8
+
9
+ ```bash
10
+ ng build button-group
11
+ ```