@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
@@ -0,0 +1,351 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, Directive, inject, effect, booleanAttribute, computed, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
3
+ import * as i1 from '@spartan-ng/brain/field';
4
+ import { BrnField, BrnFieldA11yService } from '@spartan-ng/brain/field';
5
+ import { classes } from '@egose/shadcn-theme-ng/utils';
6
+ import { cva } from 'class-variance-authority';
7
+ import * as i1$1 from '@egose/shadcn-theme-ng/label';
8
+ import { HlmLabel } from '@egose/shadcn-theme-ng/label';
9
+ import { HlmSeparator } from '@egose/shadcn-theme-ng/separator';
10
+
11
+ const fieldVariants = cva("data-[matches-spartan-invalid=true]:text-destructive gap-3 group/field flex w-full", {
12
+ variants: {
13
+ orientation: {
14
+ vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
15
+ horizontal: [
16
+ "flex-row items-center",
17
+ "*:data-[slot=field-label]:flex-auto",
18
+ "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
19
+ ],
20
+ responsive: [
21
+ "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto [&>.sr-only]:w-auto",
22
+ "@md/field-group:*:data-[slot=field-label]:flex-auto",
23
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
24
+ ],
25
+ },
26
+ },
27
+ defaultVariants: {
28
+ orientation: 'vertical',
29
+ },
30
+ });
31
+ class HlmField {
32
+ orientation = input('vertical', /* @ts-ignore */
33
+ ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
34
+ constructor() {
35
+ classes(() => fieldVariants({ orientation: this.orientation() }));
36
+ }
37
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmField, deps: [], target: i0.ɵɵFactoryTarget.Directive });
38
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmField, isStandalone: true, selector: "[hlmField],hlm-field", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group", "data-slot": "field" }, properties: { "attr.data-orientation": "orientation()" } }, hostDirectives: [{ directive: i1.BrnField, inputs: ["data-invalid", "data-invalid", "forceInvalid", "forceInvalid"] }], ngImport: i0 });
39
+ }
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmField, decorators: [{
41
+ type: Directive,
42
+ args: [{
43
+ selector: '[hlmField],hlm-field',
44
+ hostDirectives: [{ directive: BrnField, inputs: ['data-invalid', 'forceInvalid'] }],
45
+ host: {
46
+ role: 'group',
47
+ 'data-slot': 'field',
48
+ '[attr.data-orientation]': 'orientation()',
49
+ },
50
+ }]
51
+ }], ctorParameters: () => [], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }] } });
52
+
53
+ class HlmFieldContent {
54
+ constructor() {
55
+ classes(() => "gap-1 group/field-content flex flex-1 flex-col leading-snug");
56
+ }
57
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
58
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmFieldContent, isStandalone: true, selector: "[hlmFieldContent],hlm-field-content", host: { attributes: { "data-slot": "field-content" } }, ngImport: i0 });
59
+ }
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldContent, decorators: [{
61
+ type: Directive,
62
+ args: [{
63
+ selector: '[hlmFieldContent],hlm-field-content',
64
+ host: { 'data-slot': 'field-content' },
65
+ }]
66
+ }], ctorParameters: () => [] });
67
+
68
+ class HlmFieldDescription {
69
+ static _id = 0;
70
+ _a11y = inject(BrnFieldA11yService, { optional: true, host: true });
71
+ id = input(`hlm-field-description-${HlmFieldDescription._id++}`, /* @ts-ignore */
72
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
73
+ _registeredId;
74
+ _cleanup = this._a11y
75
+ ? effect(() => {
76
+ const a11y = this._a11y;
77
+ if (!a11y)
78
+ return;
79
+ const id = this.id();
80
+ if (this._registeredId && this._registeredId !== id) {
81
+ a11y.unregisterDescription(this._registeredId);
82
+ }
83
+ if (this._registeredId !== id) {
84
+ a11y.registerDescription(id);
85
+ this._registeredId = id;
86
+ }
87
+ })
88
+ : null;
89
+ constructor() {
90
+ classes(() => [
91
+ "text-muted-foreground text-start text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance",
92
+ "last:mt-0 nth-last-2:-mt-1",
93
+ "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
94
+ ]);
95
+ }
96
+ ngOnDestroy() {
97
+ this._cleanup?.destroy();
98
+ if (this._registeredId) {
99
+ this._a11y?.unregisterDescription(this._registeredId);
100
+ }
101
+ }
102
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive });
103
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmFieldDescription, isStandalone: true, selector: "[hlmFieldDescription],hlm-field-description", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "field-description" }, properties: { "attr.id": "id()" } }, ngImport: i0 });
104
+ }
105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldDescription, decorators: [{
106
+ type: Directive,
107
+ args: [{
108
+ selector: '[hlmFieldDescription],hlm-field-description',
109
+ host: {
110
+ 'data-slot': 'field-description',
111
+ '[attr.id]': 'id()',
112
+ },
113
+ }]
114
+ }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
115
+
116
+ class HlmFieldError {
117
+ static _id = 0;
118
+ _field = inject(BrnField, { optional: true });
119
+ _a11y = inject(BrnFieldA11yService, { optional: true, host: true });
120
+ _registeredId;
121
+ _hasParentField = !!this._field;
122
+ /** The unique ID for the field error. If none is supplied, it will be auto-generated. */
123
+ id = input(`hlm-field-error-${HlmFieldError._id++}`, /* @ts-ignore */
124
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
125
+ /**
126
+ * The name of the specific validator error key to match (e.g. 'required').
127
+ * When omitted, the error is shown if any validation error is present.
128
+ */
129
+ validator = input(/* @ts-ignore */
130
+ ...(ngDevMode ? [undefined, { debugName: "validator" }] : /* istanbul ignore next */ []));
131
+ /** Forces the error message to be visible regardless of the control's validation state. */
132
+ forceShow = input(false, { ...(ngDevMode ? { debugName: "forceShow" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
133
+ _display = computed(() => !this._hasParentField || this.forceShow() || this._hasError(), /* @ts-ignore */
134
+ ...(ngDevMode ? [{ debugName: "_display" }] : /* istanbul ignore next */ []));
135
+ _hasError = computed(() => {
136
+ const errors = this._field?.errors();
137
+ if (!errors)
138
+ return false;
139
+ const validator = this.validator();
140
+ const spartanInvalid = this._field?.controlState()?.spartanInvalid;
141
+ if (!spartanInvalid)
142
+ return false;
143
+ return validator ? validator in errors : Object.keys(errors).length > 0;
144
+ }, /* @ts-ignore */
145
+ ...(ngDevMode ? [{ debugName: "_hasError" }] : /* istanbul ignore next */ []));
146
+ _cleanup = this._a11y
147
+ ? effect(() => {
148
+ const a11y = this._a11y;
149
+ if (!a11y)
150
+ return;
151
+ const id = this.id();
152
+ const hasError = this._hasError();
153
+ if (this._registeredId && (this._registeredId !== id || !hasError)) {
154
+ a11y.unregisterError(this._registeredId);
155
+ this._registeredId = undefined;
156
+ }
157
+ if (hasError && this._registeredId !== id) {
158
+ a11y.registerError(id);
159
+ this._registeredId = id;
160
+ }
161
+ })
162
+ : null;
163
+ constructor() {
164
+ classes(() => "text-destructive text-sm font-normal");
165
+ }
166
+ ngOnDestroy() {
167
+ this._cleanup?.destroy();
168
+ if (this._registeredId) {
169
+ this._a11y?.unregisterError(this._registeredId);
170
+ }
171
+ }
172
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldError, deps: [], target: i0.ɵɵFactoryTarget.Component });
173
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: HlmFieldError, isStandalone: true, selector: "hlm-field-error", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, validator: { classPropertyName: "validator", publicName: "validator", isSignal: true, isRequired: false, transformFunction: null }, forceShow: { classPropertyName: "forceShow", publicName: "forceShow", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "alert", "data-slot": "field-error" }, properties: { "attr.id": "id()", "hidden": "!_display()" } }, ngImport: i0, template: `
174
+ @if (_display()) {
175
+ <ng-content />
176
+ }
177
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
178
+ }
179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldError, decorators: [{
180
+ type: Component,
181
+ args: [{
182
+ selector: 'hlm-field-error',
183
+ changeDetection: ChangeDetectionStrategy.OnPush,
184
+ host: {
185
+ role: 'alert',
186
+ 'data-slot': 'field-error',
187
+ '[attr.id]': 'id()',
188
+ '[hidden]': '!_display()',
189
+ },
190
+ template: `
191
+ @if (_display()) {
192
+ <ng-content />
193
+ }
194
+ `,
195
+ }]
196
+ }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], validator: [{ type: i0.Input, args: [{ isSignal: true, alias: "validator", required: false }] }], forceShow: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceShow", required: false }] }] } });
197
+
198
+ class HlmFieldGroup {
199
+ constructor() {
200
+ classes(() => "gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col");
201
+ }
202
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
203
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmFieldGroup, isStandalone: true, selector: "[hlmFieldGroup],hlm-field-group", host: { attributes: { "data-slot": "field-group" } }, ngImport: i0 });
204
+ }
205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldGroup, decorators: [{
206
+ type: Directive,
207
+ args: [{
208
+ selector: '[hlmFieldGroup],hlm-field-group',
209
+ host: { 'data-slot': 'field-group' },
210
+ }]
211
+ }], ctorParameters: () => [] });
212
+
213
+ class HlmFieldLabel {
214
+ constructor() {
215
+ classes(() => [
216
+ "has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 group/field-label peer/field-label flex w-fit",
217
+ "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",
218
+ ]);
219
+ }
220
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
221
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmFieldLabel, isStandalone: true, selector: "[hlmFieldLabel],hlm-field-label", host: { attributes: { "data-slot": "field-label" } }, hostDirectives: [{ directive: i1$1.HlmLabel }], ngImport: i0 });
222
+ }
223
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldLabel, decorators: [{
224
+ type: Directive,
225
+ args: [{
226
+ selector: '[hlmFieldLabel],hlm-field-label',
227
+ hostDirectives: [HlmLabel],
228
+ host: { 'data-slot': 'field-label' },
229
+ }]
230
+ }], ctorParameters: () => [] });
231
+
232
+ class HlmFieldLegend {
233
+ variant = input('legend', /* @ts-ignore */
234
+ ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
235
+ constructor() {
236
+ classes(() => "mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base");
237
+ }
238
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldLegend, deps: [], target: i0.ɵɵFactoryTarget.Directive });
239
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmFieldLegend, isStandalone: true, selector: "legend[hlmFieldLegend]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "field-legend" }, properties: { "attr.data-variant": "variant()" } }, ngImport: i0 });
240
+ }
241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldLegend, decorators: [{
242
+ type: Directive,
243
+ args: [{
244
+ selector: 'legend[hlmFieldLegend]',
245
+ host: {
246
+ 'data-slot': 'field-legend',
247
+ '[attr.data-variant]': 'variant()',
248
+ },
249
+ }]
250
+ }], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
251
+
252
+ class HlmFieldSeparator {
253
+ constructor() {
254
+ classes(() => "-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative");
255
+ }
256
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldSeparator, deps: [], target: i0.ɵɵFactoryTarget.Component });
257
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.3", type: HlmFieldSeparator, isStandalone: true, selector: "hlm-field-separator", host: { attributes: { "data-slot": "field-separator" } }, ngImport: i0, template: "\n <hlm-separator class=\"absolute inset-0 top-1/2\" />\n <span\n data-slot=\"field-separator-content\"\n class=\"text-muted-foreground px-2 bg-background relative mx-auto block w-fit\"\n >\n <ng-content />\n </span>\n ", isInline: true, dependencies: [{ kind: "directive", type: HlmSeparator, selector: "[hlmSeparator],hlm-separator" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
258
+ }
259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldSeparator, decorators: [{
260
+ type: Component,
261
+ args: [{
262
+ selector: 'hlm-field-separator',
263
+ imports: [HlmSeparator],
264
+ changeDetection: ChangeDetectionStrategy.OnPush,
265
+ host: { 'data-slot': 'field-separator' },
266
+ template: "\n <hlm-separator class=\"absolute inset-0 top-1/2\" />\n <span\n data-slot=\"field-separator-content\"\n class=\"text-muted-foreground px-2 bg-background relative mx-auto block w-fit\"\n >\n <ng-content />\n </span>\n ",
267
+ }]
268
+ }], ctorParameters: () => [] });
269
+
270
+ class HlmFieldSet {
271
+ constructor() {
272
+ classes(() => "gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col");
273
+ }
274
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldSet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
275
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmFieldSet, isStandalone: true, selector: "fieldset[hlmFieldSet]", host: { attributes: { "data-slot": "field-set" } }, ngImport: i0 });
276
+ }
277
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldSet, decorators: [{
278
+ type: Directive,
279
+ args: [{
280
+ selector: 'fieldset[hlmFieldSet]',
281
+ host: { 'data-slot': 'field-set' },
282
+ }]
283
+ }], ctorParameters: () => [] });
284
+
285
+ class HlmFieldTitle {
286
+ constructor() {
287
+ classes(() => "gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center");
288
+ }
289
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
290
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmFieldTitle, isStandalone: true, selector: "[hlmFieldTitle],hlm-field-title", host: { attributes: { "data-slot": "field-label" } }, ngImport: i0 });
291
+ }
292
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldTitle, decorators: [{
293
+ type: Directive,
294
+ args: [{
295
+ selector: '[hlmFieldTitle],hlm-field-title',
296
+ host: { 'data-slot': 'field-label' },
297
+ }]
298
+ }], ctorParameters: () => [] });
299
+
300
+ /*
301
+ * Public API Surface of field
302
+ */
303
+ const HlmFieldImports = [
304
+ HlmField,
305
+ HlmFieldContent,
306
+ HlmFieldDescription,
307
+ HlmFieldError,
308
+ HlmFieldGroup,
309
+ HlmFieldLabel,
310
+ HlmFieldLegend,
311
+ HlmFieldSeparator,
312
+ HlmFieldSet,
313
+ HlmFieldTitle,
314
+ ];
315
+ class HlmFieldModule {
316
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
317
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldModule, imports: [HlmField,
318
+ HlmFieldContent,
319
+ HlmFieldDescription,
320
+ HlmFieldError,
321
+ HlmFieldGroup,
322
+ HlmFieldLabel,
323
+ HlmFieldLegend,
324
+ HlmFieldSeparator,
325
+ HlmFieldSet,
326
+ HlmFieldTitle], exports: [HlmField,
327
+ HlmFieldContent,
328
+ HlmFieldDescription,
329
+ HlmFieldError,
330
+ HlmFieldGroup,
331
+ HlmFieldLabel,
332
+ HlmFieldLegend,
333
+ HlmFieldSeparator,
334
+ HlmFieldSet,
335
+ HlmFieldTitle] });
336
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldModule });
337
+ }
338
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmFieldModule, decorators: [{
339
+ type: NgModule,
340
+ args: [{
341
+ imports: [...HlmFieldImports],
342
+ exports: [...HlmFieldImports],
343
+ }]
344
+ }] });
345
+
346
+ /**
347
+ * Generated bundle index. Do not edit.
348
+ */
349
+
350
+ export { HlmField, HlmFieldContent, HlmFieldDescription, HlmFieldError, HlmFieldGroup, HlmFieldImports, HlmFieldLabel, HlmFieldLegend, HlmFieldModule, HlmFieldSeparator, HlmFieldSet, HlmFieldTitle };
351
+
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "field",
3
+ "version": "0.0.1",
4
+ "peerDependencies": {
5
+ "@angular/common": "^22.0.0",
6
+ "@angular/core": "^22.0.0",
7
+ "@spartan-ng/brain": "^1.1.1"
8
+ },
9
+ "dependencies": {
10
+ "tslib": "^2.3.0"
11
+ },
12
+ "sideEffects": false,
13
+ "module": "fesm2022/field.mjs",
14
+ "typings": "types/field.d.ts",
15
+ "exports": {
16
+ "./package.json": {
17
+ "default": "./package.json"
18
+ },
19
+ ".": {
20
+ "types": "./types/field.d.ts",
21
+ "default": "./fesm2022/field.mjs"
22
+ }
23
+ },
24
+ "type": "module"
25
+ }
@@ -0,0 +1,107 @@
1
+ import * as i0 from '@angular/core';
2
+ import { OnDestroy } from '@angular/core';
3
+ import * as class_variance_authority_types from 'class-variance-authority/types';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import * as i1 from '@spartan-ng/brain/field';
6
+ import { BooleanInput } from '@angular/cdk/coercion';
7
+ import * as i1$1 from '@egose/shadcn-theme-ng/label';
8
+
9
+ declare const fieldVariants: (props?: ({
10
+ orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
11
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
12
+ type FieldVariants = VariantProps<typeof fieldVariants>;
13
+ declare class HlmField {
14
+ readonly orientation: i0.InputSignal<"vertical" | "horizontal" | "responsive" | null | undefined>;
15
+ constructor();
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmField, never>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmField, "[hlmField],hlm-field", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.BrnField; inputs: { "data-invalid": "data-invalid"; "forceInvalid": "forceInvalid"; }; outputs: {}; }]>;
18
+ }
19
+
20
+ declare class HlmFieldContent {
21
+ constructor();
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmFieldContent, never>;
23
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmFieldContent, "[hlmFieldContent],hlm-field-content", never, {}, {}, never, never, true, never>;
24
+ }
25
+
26
+ declare class HlmFieldDescription implements OnDestroy {
27
+ private static _id;
28
+ private readonly _a11y;
29
+ readonly id: i0.InputSignal<string>;
30
+ private _registeredId?;
31
+ private readonly _cleanup;
32
+ constructor();
33
+ ngOnDestroy(): void;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmFieldDescription, never>;
35
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmFieldDescription, "[hlmFieldDescription],hlm-field-description", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
36
+ }
37
+
38
+ declare class HlmFieldError implements OnDestroy {
39
+ private static _id;
40
+ private readonly _field;
41
+ private readonly _a11y;
42
+ private _registeredId?;
43
+ private readonly _hasParentField;
44
+ /** The unique ID for the field error. If none is supplied, it will be auto-generated. */
45
+ readonly id: i0.InputSignal<string>;
46
+ /**
47
+ * The name of the specific validator error key to match (e.g. 'required').
48
+ * When omitted, the error is shown if any validation error is present.
49
+ */
50
+ readonly validator: i0.InputSignal<string | undefined>;
51
+ /** Forces the error message to be visible regardless of the control's validation state. */
52
+ readonly forceShow: i0.InputSignalWithTransform<boolean, BooleanInput>;
53
+ protected readonly _display: i0.Signal<boolean>;
54
+ protected readonly _hasError: i0.Signal<boolean>;
55
+ private readonly _cleanup;
56
+ constructor();
57
+ ngOnDestroy(): void;
58
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmFieldError, never>;
59
+ static ɵcmp: i0.ɵɵComponentDeclaration<HlmFieldError, "hlm-field-error", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "validator": { "alias": "validator"; "required": false; "isSignal": true; }; "forceShow": { "alias": "forceShow"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
60
+ }
61
+
62
+ declare class HlmFieldGroup {
63
+ constructor();
64
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmFieldGroup, never>;
65
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmFieldGroup, "[hlmFieldGroup],hlm-field-group", never, {}, {}, never, never, true, never>;
66
+ }
67
+
68
+ declare class HlmFieldLabel {
69
+ constructor();
70
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmFieldLabel, never>;
71
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmFieldLabel, "[hlmFieldLabel],hlm-field-label", never, {}, {}, never, never, true, [{ directive: typeof i1$1.HlmLabel; inputs: {}; outputs: {}; }]>;
72
+ }
73
+
74
+ declare class HlmFieldLegend {
75
+ readonly variant: i0.InputSignal<"label" | "legend">;
76
+ constructor();
77
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmFieldLegend, never>;
78
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmFieldLegend, "legend[hlmFieldLegend]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
79
+ }
80
+
81
+ declare class HlmFieldSeparator {
82
+ constructor();
83
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmFieldSeparator, never>;
84
+ static ɵcmp: i0.ɵɵComponentDeclaration<HlmFieldSeparator, "hlm-field-separator", never, {}, {}, never, ["*"], true, never>;
85
+ }
86
+
87
+ declare class HlmFieldSet {
88
+ constructor();
89
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmFieldSet, never>;
90
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmFieldSet, "fieldset[hlmFieldSet]", never, {}, {}, never, never, true, never>;
91
+ }
92
+
93
+ declare class HlmFieldTitle {
94
+ constructor();
95
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmFieldTitle, never>;
96
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HlmFieldTitle, "[hlmFieldTitle],hlm-field-title", never, {}, {}, never, never, true, never>;
97
+ }
98
+
99
+ declare const HlmFieldImports: readonly [typeof HlmField, typeof HlmFieldContent, typeof HlmFieldDescription, typeof HlmFieldError, typeof HlmFieldGroup, typeof HlmFieldLabel, typeof HlmFieldLegend, typeof HlmFieldSeparator, typeof HlmFieldSet, typeof HlmFieldTitle];
100
+ declare class HlmFieldModule {
101
+ static ɵfac: i0.ɵɵFactoryDeclaration<HlmFieldModule, never>;
102
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HlmFieldModule, never, [typeof HlmField, typeof HlmFieldContent, typeof HlmFieldDescription, typeof HlmFieldError, typeof HlmFieldGroup, typeof HlmFieldLabel, typeof HlmFieldLegend, typeof HlmFieldSeparator, typeof HlmFieldSet, typeof HlmFieldTitle], [typeof HlmField, typeof HlmFieldContent, typeof HlmFieldDescription, typeof HlmFieldError, typeof HlmFieldGroup, typeof HlmFieldLabel, typeof HlmFieldLegend, typeof HlmFieldSeparator, typeof HlmFieldSet, typeof HlmFieldTitle]>;
103
+ static ɵinj: i0.ɵɵInjectorDeclaration<HlmFieldModule>;
104
+ }
105
+
106
+ export { HlmField, HlmFieldContent, HlmFieldDescription, HlmFieldError, HlmFieldGroup, HlmFieldImports, HlmFieldLabel, HlmFieldLegend, HlmFieldModule, HlmFieldSeparator, HlmFieldSet, HlmFieldTitle };
107
+ export type { FieldVariants };
@@ -0,0 +1,3 @@
1
+ # Form Checkbox Subpath
2
+
3
+ This project ships only as `@egose/shadcn-theme-ng/form-checkbox` or `@egose/shadcn-theme-ng-tw/form-checkbox`. See the [package README](../../README.md) for installation, compatibility, Tailwind variant, test, and release guidance. Do not publish this project directory independently.
@@ -0,0 +1,94 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import * as i1 from '@angular/forms';
4
+ import { FormGroupDirective, ReactiveFormsModule, ControlContainer } from '@angular/forms';
5
+ import { HlmLabel } from '@egose/shadcn-theme-ng/label';
6
+ import { HlmCheckbox } from '@egose/shadcn-theme-ng/checkbox';
7
+ import { HlmFormIdGenerator, HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';
8
+ import { EgFormField } from '@egose/shadcn-theme-ng/form-field-simple';
9
+ import { hlm } from '@egose/shadcn-theme-ng/utils';
10
+
11
+ class EgFormCheckbox {
12
+ formGroupDirective = inject(FormGroupDirective);
13
+ generatedId = inject(HlmFormIdGenerator).generate('eg-form-checkbox');
14
+ // Classes
15
+ userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
16
+ _computedClass = computed(() => hlm('', this.userClass()), /* @ts-ignore */
17
+ ...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
18
+ // Inputs
19
+ label = input('', /* @ts-ignore */
20
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
21
+ controlId = input(undefined, /* @ts-ignore */
22
+ ...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
23
+ controlName = input('', /* @ts-ignore */
24
+ ...(ngDevMode ? [{ debugName: "controlName" }] : /* istanbul ignore next */ []));
25
+ error = input(undefined, /* @ts-ignore */
26
+ ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
27
+ hint = input(undefined, /* @ts-ignore */
28
+ ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
29
+ id = input(undefined, /* @ts-ignore */
30
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
31
+ name = input(undefined, /* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
33
+ checked = input(false, /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
35
+ required = input(false, /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
37
+ disabled = input(false, /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
39
+ effectiveId = computed(() => this.controlId() || this.id() || this.generatedId, /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "effectiveId" }] : /* istanbul ignore next */ []));
41
+ errorId = computed(() => `${this.effectiveId()}-error`, /* @ts-ignore */
42
+ ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
43
+ hintId = computed(() => `${this.effectiveId()}-hint`, /* @ts-ignore */
44
+ ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
45
+ describedBy() {
46
+ const control = this.formGroupDirective.form.get(this.controlName());
47
+ return this.error() && control?.invalid && (control.dirty || control.touched)
48
+ ? this.errorId()
49
+ : this.hint()
50
+ ? this.hintId()
51
+ : null;
52
+ }
53
+ // Styling
54
+ checkboxClass = input('', /* @ts-ignore */
55
+ ...(ngDevMode ? [{ debugName: "checkboxClass" }] : /* istanbul ignore next */ []));
56
+ labelClass = input('', /* @ts-ignore */
57
+ ...(ngDevMode ? [{ debugName: "labelClass" }] : /* istanbul ignore next */ []));
58
+ // Computed styling
59
+ $checkboxClass = computed(() => hlm(this.checkboxClass()), /* @ts-ignore */
60
+ ...(ngDevMode ? [{ debugName: "$checkboxClass" }] : /* istanbul ignore next */ []));
61
+ $labelClass = computed(() => hlm(this.labelClass()), /* @ts-ignore */
62
+ ...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
63
+ $errorClass = input('', /* @ts-ignore */
64
+ ...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
65
+ $hintClass = input('', /* @ts-ignore */
66
+ ...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
67
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
68
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormCheckbox, isStandalone: true, selector: "eg-form-checkbox", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: false, transformFunction: null }, controlName: { classPropertyName: "controlName", publicName: "controlName", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, checkboxClass: { classPropertyName: "checkboxClass", publicName: "checkboxClass", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, $errorClass: { classPropertyName: "$errorClass", publicName: "$errorClass", isSignal: true, isRequired: false, transformFunction: null }, $hintClass: { classPropertyName: "$hintClass", publicName: "$hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: "\n @let lbl = label();\n @let cnm = controlName();\n @let err = error();\n @let hnt = hint();\n @let rqrd = required();\n\n <eg-form-field>\n <div class=\"flex items-center gap-1\">\n <hlm-checkbox\n [id]=\"effectiveId()\"\n [name]=\"cnm || name() || null\"\n [formControlName]=\"cnm\"\n [class]=\"$checkboxClass()\"\n [checked]=\"checked()\"\n [required]=\"rqrd\"\n [wrapperDisabled]=\"disabled()\"\n [aria-describedby]=\"describedBy()\"\n />\n <label hlmLabel [for]=\"effectiveId()\" [class]=\"$labelClass()\">\n {{ lbl }}\n @if (rqrd) {\n <span class=\"text-red-500\">*</span>\n }\n </label>\n </div>\n\n @if (err) {\n <hlm-error [id]=\"errorId()\" [class]=\"$errorClass()\">\n {{ err }}\n </hlm-error>\n }\n\n @if (hnt) {\n <hlm-hint [id]=\"hintId()\" [class]=\"$hintClass()\">\n {{ hnt }}\n </hlm-hint>\n }\n </eg-form-field>\n ", isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: HlmCheckbox, selector: "hlm-checkbox", inputs: ["class", "id", "aria-label", "aria-labelledby", "aria-describedby", "checked", "name", "required", "disabled", "wrapperDisabled"], outputs: ["checkedChange", "changed"] }, { kind: "directive", type: HlmLabel, selector: "[hlmLabel]", inputs: ["class"] }, { kind: "component", type: EgFormField, selector: "eg-form-field", inputs: ["class"] }, { kind: "directive", type: HlmError, selector: "hlm-error", inputs: ["class"] }, { kind: "directive", type: HlmHint, selector: "hlm-hint", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
69
+ }
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormCheckbox, decorators: [{
71
+ type: Component,
72
+ args: [{
73
+ selector: 'eg-form-checkbox',
74
+ standalone: true,
75
+ host: {
76
+ '[class]': '_computedClass()',
77
+ },
78
+ changeDetection: ChangeDetectionStrategy.OnPush,
79
+ imports: [ReactiveFormsModule, HlmCheckbox, HlmLabel, EgFormField, HlmError, HlmHint],
80
+ providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
81
+ template: "\n @let lbl = label();\n @let cnm = controlName();\n @let err = error();\n @let hnt = hint();\n @let rqrd = required();\n\n <eg-form-field>\n <div class=\"flex items-center gap-1\">\n <hlm-checkbox\n [id]=\"effectiveId()\"\n [name]=\"cnm || name() || null\"\n [formControlName]=\"cnm\"\n [class]=\"$checkboxClass()\"\n [checked]=\"checked()\"\n [required]=\"rqrd\"\n [wrapperDisabled]=\"disabled()\"\n [aria-describedby]=\"describedBy()\"\n />\n <label hlmLabel [for]=\"effectiveId()\" [class]=\"$labelClass()\">\n {{ lbl }}\n @if (rqrd) {\n <span class=\"text-red-500\">*</span>\n }\n </label>\n </div>\n\n @if (err) {\n <hlm-error [id]=\"errorId()\" [class]=\"$errorClass()\">\n {{ err }}\n </hlm-error>\n }\n\n @if (hnt) {\n <hlm-hint [id]=\"hintId()\" [class]=\"$hintClass()\">\n {{ hnt }}\n </hlm-hint>\n }\n </eg-form-field>\n ",
82
+ }]
83
+ }], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], controlId: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlId", required: false }] }], controlName: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlName", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], checkboxClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxClass", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], $errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "$errorClass", required: false }] }], $hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "$hintClass", required: false }] }] } });
84
+
85
+ /*
86
+ * Public API Surface of form-checkbox
87
+ */
88
+
89
+ /**
90
+ * Generated bundle index. Do not edit.
91
+ */
92
+
93
+ export { EgFormCheckbox };
94
+
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "form-checkbox",
3
+ "version": "0.0.1",
4
+ "peerDependencies": {
5
+ "@angular/common": "^20.3.0 || ^22.0.0",
6
+ "@angular/core": "^20.3.0 || ^22.0.0"
7
+ },
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
10
+ },
11
+ "sideEffects": false,
12
+ "module": "fesm2022/form-checkbox.mjs",
13
+ "typings": "types/form-checkbox.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./types/form-checkbox.d.ts",
20
+ "default": "./fesm2022/form-checkbox.mjs"
21
+ }
22
+ },
23
+ "type": "module"
24
+ }