@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,846 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, inject, PLATFORM_ID, REQUEST, DOCUMENT, signal, computed, DestroyRef, afterNextRender, Injectable, input, effect, ChangeDetectionStrategy, Component, Directive, booleanAttribute, NgModule } from '@angular/core';
3
+ import { isPlatformServer, NgTemplateOutlet } from '@angular/common';
4
+ import * as i1 from '@spartan-ng/brain/sheet';
5
+ import { BrnSheetImports } from '@spartan-ng/brain/sheet';
6
+ import * as i2 from '@egose/shadcn-theme-ng/sheet';
7
+ import { HlmSheetImports } from '@egose/shadcn-theme-ng/sheet';
8
+ import { hlm, classes } from '@egose/shadcn-theme-ng/utils';
9
+ import * as i1$1 from '@egose/shadcn-theme-ng/input';
10
+ import { HlmInput } from '@egose/shadcn-theme-ng/input';
11
+ import * as i1$2 from '@spartan-ng/brain/tooltip';
12
+ import { BrnTooltip, provideBrnTooltipDefaultOptions } from '@spartan-ng/brain/tooltip';
13
+ import { tooltipPositionVariants, DEFAULT_TOOLTIP_SVG_CLASS, DEFAULT_TOOLTIP_CONTENT_CLASSES } from '@egose/shadcn-theme-ng/tooltip';
14
+ import { cva } from 'class-variance-authority';
15
+ import * as i1$3 from '@egose/shadcn-theme-ng/skeleton';
16
+ import { HlmSkeletonImports } from '@egose/shadcn-theme-ng/skeleton';
17
+ import * as i1$4 from '@egose/shadcn-theme-ng/separator';
18
+ import { HlmSeparator } from '@egose/shadcn-theme-ng/separator';
19
+ import { NgIcon, provideIcons } from '@ng-icons/core';
20
+ import { lucidePanelLeft } from '@ng-icons/lucide';
21
+ import * as i1$5 from '@egose/shadcn-theme-ng/button';
22
+ import { provideBrnButtonConfig, HlmBtn } from '@egose/shadcn-theme-ng/button';
23
+
24
+ const defaultConfig = {
25
+ sidebarWidth: '16rem',
26
+ sidebarWidthMobile: '18rem',
27
+ sidebarWidthIcon: '3rem',
28
+ sidebarCookieName: 'sidebar_state',
29
+ sidebarCookieMaxAge: 60 * 60 * 24 * 7, // 7 days in seconds
30
+ sidebarKeyboardShortcut: 'b',
31
+ mobileBreakpoint: '768px',
32
+ closeMobileSidebarOnMenuButtonClick: false,
33
+ };
34
+ const HlmSidebarConfigToken = new InjectionToken('HlmSidebarConfig');
35
+ function provideHlmSidebarConfig(config) {
36
+ return { provide: HlmSidebarConfigToken, useValue: { ...defaultConfig, ...config } };
37
+ }
38
+ function injectHlmSidebarConfig() {
39
+ return inject(HlmSidebarConfigToken, { optional: true }) ?? defaultConfig;
40
+ }
41
+
42
+ class HlmSidebarService {
43
+ _platformId = inject(PLATFORM_ID);
44
+ _request = inject(REQUEST, { optional: true });
45
+ _config = injectHlmSidebarConfig();
46
+ _document = inject(DOCUMENT);
47
+ _window = this._document.defaultView;
48
+ _open = signal(true, /* @ts-ignore */
49
+ ...(ngDevMode ? [{ debugName: "_open" }] : /* istanbul ignore next */ []));
50
+ _openMobile = signal(false, /* @ts-ignore */
51
+ ...(ngDevMode ? [{ debugName: "_openMobile" }] : /* istanbul ignore next */ []));
52
+ _isMobile = signal(false, /* @ts-ignore */
53
+ ...(ngDevMode ? [{ debugName: "_isMobile" }] : /* istanbul ignore next */ []));
54
+ _variant = signal('sidebar', /* @ts-ignore */
55
+ ...(ngDevMode ? [{ debugName: "_variant" }] : /* istanbul ignore next */ []));
56
+ _mediaQuery = null;
57
+ open = this._open.asReadonly();
58
+ openMobile = this._openMobile.asReadonly();
59
+ isMobile = this._isMobile.asReadonly();
60
+ variant = this._variant.asReadonly();
61
+ state = computed(() => (this._open() ? 'expanded' : 'collapsed'), /* @ts-ignore */
62
+ ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
63
+ constructor() {
64
+ const destroyRef = inject(DestroyRef);
65
+ this.restoreStateFromCookie();
66
+ afterNextRender(() => {
67
+ if (!this._window || typeof this._window.matchMedia !== 'function')
68
+ return;
69
+ // Initialize MediaQueryList
70
+ this._mediaQuery = this._window.matchMedia(`(max-width: ${this._config.mobileBreakpoint})`);
71
+ this._isMobile.set(this._mediaQuery.matches);
72
+ // Add media query listener
73
+ const mediaQueryHandler = (e) => {
74
+ this._isMobile.set(e.matches);
75
+ // If switching from mobile to desktop, close mobile sidebar
76
+ if (!e.matches)
77
+ this._openMobile.set(false);
78
+ };
79
+ this._mediaQuery.addEventListener('change', mediaQueryHandler);
80
+ // Add keyboard shortcut listener
81
+ const keydownHandler = (event) => {
82
+ if (event.key === this._config.sidebarKeyboardShortcut && (event.ctrlKey || event.metaKey)) {
83
+ event.preventDefault();
84
+ this.toggleSidebar();
85
+ }
86
+ };
87
+ this._window.addEventListener('keydown', keydownHandler);
88
+ // Add resize listener with debounce
89
+ let resizeTimeout;
90
+ const resizeHandler = () => {
91
+ if (!this._window)
92
+ return;
93
+ if (resizeTimeout)
94
+ this._window.clearTimeout(resizeTimeout);
95
+ resizeTimeout = this._window.setTimeout(() => {
96
+ if (this._mediaQuery)
97
+ this._isMobile.set(this._mediaQuery.matches);
98
+ }, 100);
99
+ };
100
+ this._window.addEventListener('resize', resizeHandler);
101
+ // Cleanup listeners on destroy
102
+ destroyRef.onDestroy(() => {
103
+ if (!this._window)
104
+ return;
105
+ if (this._mediaQuery)
106
+ this._mediaQuery.removeEventListener('change', mediaQueryHandler);
107
+ this._window.removeEventListener('keydown', keydownHandler);
108
+ this._window.removeEventListener('resize', resizeHandler);
109
+ if (resizeTimeout)
110
+ this._window.clearTimeout(resizeTimeout);
111
+ });
112
+ });
113
+ }
114
+ setOpen(open) {
115
+ this._open.set(open);
116
+ this._document.cookie = `${this._config.sidebarCookieName}=${open}; path=/; max-age=${this._config.sidebarCookieMaxAge}`;
117
+ }
118
+ setOpenMobile(open) {
119
+ if (this._isMobile()) {
120
+ this._openMobile.set(open);
121
+ }
122
+ }
123
+ setVariant(variant) {
124
+ this._variant.set(variant);
125
+ }
126
+ toggleSidebar() {
127
+ if (this._isMobile()) {
128
+ this._openMobile.update((value) => !value);
129
+ }
130
+ else {
131
+ this.setOpen(!this._open());
132
+ }
133
+ }
134
+ restoreStateFromCookie() {
135
+ const cookieString = isPlatformServer(this._platformId)
136
+ ? this._request?.headers.get('cookie')
137
+ : this._document.cookie;
138
+ if (!cookieString)
139
+ return;
140
+ const prefix = `${this._config.sidebarCookieName}=`;
141
+ const cookieValue = cookieString
142
+ .split(';')
143
+ .map((c) => c.trim())
144
+ .find((c) => c.startsWith(prefix))
145
+ ?.slice(prefix.length);
146
+ if (cookieValue !== undefined) {
147
+ this._open.set(cookieValue === 'true');
148
+ }
149
+ }
150
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
151
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarService, providedIn: 'root' });
152
+ }
153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarService, decorators: [{
154
+ type: Injectable,
155
+ args: [{ providedIn: 'root' }]
156
+ }], ctorParameters: () => [] });
157
+
158
+ class HlmSidebar {
159
+ _sidebarService = inject(HlmSidebarService);
160
+ _config = injectHlmSidebarConfig();
161
+ sidebarWidthMobile = input(this._config.sidebarWidthMobile, /* @ts-ignore */
162
+ ...(ngDevMode ? [{ debugName: "sidebarWidthMobile" }] : /* istanbul ignore next */ []));
163
+ side = input('left', /* @ts-ignore */
164
+ ...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
165
+ variant = input(this._sidebarService.variant(), /* @ts-ignore */
166
+ ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
167
+ collapsible = input('offcanvas', /* @ts-ignore */
168
+ ...(ngDevMode ? [{ debugName: "collapsible" }] : /* istanbul ignore next */ []));
169
+ _sidebarGapComputedClass = computed(() => hlm("transition-[width] duration-200 ease-linear relative w-(--sidebar-width) bg-transparent", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", this.variant() === 'floating' || this.variant() === 'inset'
170
+ ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
171
+ : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"), /* @ts-ignore */
172
+ ...(ngDevMode ? [{ debugName: "_sidebarGapComputedClass" }] : /* istanbul ignore next */ []));
173
+ sidebarContainerClass = input('', /* @ts-ignore */
174
+ ...(ngDevMode ? [{ debugName: "sidebarContainerClass" }] : /* istanbul ignore next */ []));
175
+ _sidebarContainerComputedClass = computed(() => hlm("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex", this.variant() === 'floating' || this.variant() === 'inset'
176
+ ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
177
+ : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", this.sidebarContainerClass()), /* @ts-ignore */
178
+ ...(ngDevMode ? [{ debugName: "_sidebarContainerComputedClass" }] : /* istanbul ignore next */ []));
179
+ _dataSlot = computed(() => {
180
+ return !this._sidebarService.isMobile() ? 'sidebar' : undefined;
181
+ }, /* @ts-ignore */
182
+ ...(ngDevMode ? [{ debugName: "_dataSlot" }] : /* istanbul ignore next */ []));
183
+ _collapsibleAndNonMobile = computed(() => {
184
+ return this.collapsible() !== 'none' && !this._sidebarService.isMobile();
185
+ }, /* @ts-ignore */
186
+ ...(ngDevMode ? [{ debugName: "_collapsibleAndNonMobile" }] : /* istanbul ignore next */ []));
187
+ _dataState = computed(() => {
188
+ return this._collapsibleAndNonMobile() ? this._sidebarService.state() : undefined;
189
+ }, /* @ts-ignore */
190
+ ...(ngDevMode ? [{ debugName: "_dataState" }] : /* istanbul ignore next */ []));
191
+ _dataCollapsible = computed(() => {
192
+ if (this._collapsibleAndNonMobile()) {
193
+ return this._sidebarService.state() === 'collapsed' ? this.collapsible() : '';
194
+ }
195
+ return undefined;
196
+ }, /* @ts-ignore */
197
+ ...(ngDevMode ? [{ debugName: "_dataCollapsible" }] : /* istanbul ignore next */ []));
198
+ _dataVariant = computed(() => {
199
+ return this._collapsibleAndNonMobile() ? this.variant() : undefined;
200
+ }, /* @ts-ignore */
201
+ ...(ngDevMode ? [{ debugName: "_dataVariant" }] : /* istanbul ignore next */ []));
202
+ _dataSide = computed(() => {
203
+ return this._collapsibleAndNonMobile() ? this.side() : undefined;
204
+ }, /* @ts-ignore */
205
+ ...(ngDevMode ? [{ debugName: "_dataSide" }] : /* istanbul ignore next */ []));
206
+ constructor() {
207
+ // Sync variant input with service
208
+ effect(() => {
209
+ this._sidebarService.setVariant(this.variant());
210
+ });
211
+ classes(() => {
212
+ if (this.collapsible() === 'none') {
213
+ return hlm("bg-sidebar text-sidebar-foreground flex h-svh w-(--sidebar-width) flex-col");
214
+ }
215
+ else if (this._sidebarService.isMobile()) {
216
+ return '';
217
+ }
218
+ else {
219
+ return hlm("group peer text-sidebar-foreground hidden md:block");
220
+ }
221
+ });
222
+ }
223
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebar, deps: [], target: i0.ɵɵFactoryTarget.Component });
224
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: HlmSidebar, isStandalone: true, selector: "hlm-sidebar", inputs: { sidebarWidthMobile: { classPropertyName: "sidebarWidthMobile", publicName: "sidebarWidthMobile", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, sidebarContainerClass: { classPropertyName: "sidebarContainerClass", publicName: "sidebarContainerClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-slot": "_dataSlot()", "attr.data-state": "_dataState()", "attr.data-collapsible": "_dataCollapsible()", "attr.data-variant": "_dataVariant()", "attr.data-side": "_dataSide()" } }, ngImport: i0, template: "\n <ng-template #contentContainer>\n <ng-content />\n </ng-template>\n\n @if (collapsible() === 'none') {\n <ng-container *ngTemplateOutlet=\"contentContainer\"></ng-container>\n } @else if (_sidebarService.isMobile()) {\n <hlm-sheet\n [side]=\"side()\"\n [state]=\"_sidebarService.openMobile() ? 'open' : 'closed'\"\n (stateChanged)=\"_sidebarService.setOpenMobile($event === 'open')\"\n >\n <hlm-sheet-content\n *brnSheetContent=\"let ctx\"\n data-slot=\"sidebar\"\n data-sidebar=\"sidebar\"\n data-mobile=\"true\"\n class=\"bg-sidebar text-sidebar-foreground h-svh w-(--sidebar-width) p-0 [&>button]:hidden\"\n [style.--sidebar-width]=\"sidebarWidthMobile()\"\n >\n <div class=\"flex h-full w-full flex-col\">\n <ng-container *ngTemplateOutlet=\"contentContainer\" />\n </div>\n </hlm-sheet-content>\n </hlm-sheet>\n } @else {\n <!-- Sidebar gap on desktop -->\n <div data-slot=\"sidebar-gap\" [class]=\"_sidebarGapComputedClass()\"></div>\n <div data-slot=\"sidebar-container\" [attr.data-side]=\"_dataSide()\" [class]=\"_sidebarContainerComputedClass()\">\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n class=\"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col\"\n >\n <ng-container *ngTemplateOutlet=\"contentContainer\" />\n </div>\n </div>\n }\n ", isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.BrnSheetContent, selector: "[brnSheetContent]" }, { kind: "component", type: i2.HlmSheet, selector: "hlm-sheet", exportAs: ["hlmSheet"] }, { kind: "component", type: i2.HlmSheetContent, selector: "hlm-sheet-content", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
225
+ }
226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebar, decorators: [{
227
+ type: Component,
228
+ args: [{
229
+ selector: 'hlm-sidebar',
230
+ imports: [NgTemplateOutlet, BrnSheetImports, HlmSheetImports],
231
+ changeDetection: ChangeDetectionStrategy.OnPush,
232
+ host: {
233
+ '[attr.data-slot]': '_dataSlot()',
234
+ '[attr.data-state]': '_dataState()',
235
+ '[attr.data-collapsible]': '_dataCollapsible()',
236
+ '[attr.data-variant]': '_dataVariant()',
237
+ '[attr.data-side]': '_dataSide()',
238
+ },
239
+ template: "\n <ng-template #contentContainer>\n <ng-content />\n </ng-template>\n\n @if (collapsible() === 'none') {\n <ng-container *ngTemplateOutlet=\"contentContainer\"></ng-container>\n } @else if (_sidebarService.isMobile()) {\n <hlm-sheet\n [side]=\"side()\"\n [state]=\"_sidebarService.openMobile() ? 'open' : 'closed'\"\n (stateChanged)=\"_sidebarService.setOpenMobile($event === 'open')\"\n >\n <hlm-sheet-content\n *brnSheetContent=\"let ctx\"\n data-slot=\"sidebar\"\n data-sidebar=\"sidebar\"\n data-mobile=\"true\"\n class=\"bg-sidebar text-sidebar-foreground h-svh w-(--sidebar-width) p-0 [&>button]:hidden\"\n [style.--sidebar-width]=\"sidebarWidthMobile()\"\n >\n <div class=\"flex h-full w-full flex-col\">\n <ng-container *ngTemplateOutlet=\"contentContainer\" />\n </div>\n </hlm-sheet-content>\n </hlm-sheet>\n } @else {\n <!-- Sidebar gap on desktop -->\n <div data-slot=\"sidebar-gap\" [class]=\"_sidebarGapComputedClass()\"></div>\n <div data-slot=\"sidebar-container\" [attr.data-side]=\"_dataSide()\" [class]=\"_sidebarContainerComputedClass()\">\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n class=\"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col\"\n >\n <ng-container *ngTemplateOutlet=\"contentContainer\" />\n </div>\n </div>\n }\n ",
240
+ }]
241
+ }], ctorParameters: () => [], propDecorators: { sidebarWidthMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarWidthMobile", required: false }] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }], sidebarContainerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarContainerClass", required: false }] }] } });
242
+
243
+ class HlmSidebarContent {
244
+ constructor() {
245
+ classes(() => "no-scrollbar gap-2 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden");
246
+ }
247
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
248
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarContent, isStandalone: true, selector: "[hlmSidebarContent],hlm-sidebar-content", host: { attributes: { "data-slot": "sidebar-content", "data-sidebar": "content" } }, ngImport: i0 });
249
+ }
250
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarContent, decorators: [{
251
+ type: Directive,
252
+ args: [{
253
+ selector: '[hlmSidebarContent],hlm-sidebar-content',
254
+ host: {
255
+ 'data-slot': 'sidebar-content',
256
+ 'data-sidebar': 'content',
257
+ },
258
+ }]
259
+ }], ctorParameters: () => [] });
260
+
261
+ class HlmSidebarFooter {
262
+ constructor() {
263
+ classes(() => "gap-2 p-2 flex flex-col");
264
+ }
265
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarFooter, deps: [], target: i0.ɵɵFactoryTarget.Directive });
266
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarFooter, isStandalone: true, selector: "[hlmSidebarFooter],hlm-sidebar-footer", host: { attributes: { "data-slot": "sidebar-footer", "data-sidebar": "footer" } }, ngImport: i0 });
267
+ }
268
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarFooter, decorators: [{
269
+ type: Directive,
270
+ args: [{
271
+ selector: '[hlmSidebarFooter],hlm-sidebar-footer',
272
+ host: {
273
+ 'data-slot': 'sidebar-footer',
274
+ 'data-sidebar': 'footer',
275
+ },
276
+ }]
277
+ }], ctorParameters: () => [] });
278
+
279
+ class HlmSidebarGroup {
280
+ constructor() {
281
+ classes(() => "p-2 relative flex w-full min-w-0 flex-col");
282
+ }
283
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
284
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarGroup, isStandalone: true, selector: "[hlmSidebarGroup],hlm-sidebar-group", host: { attributes: { "data-slot": "sidebar-group", "data-sidebar": "group" } }, ngImport: i0 });
285
+ }
286
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarGroup, decorators: [{
287
+ type: Directive,
288
+ args: [{
289
+ selector: '[hlmSidebarGroup],hlm-sidebar-group',
290
+ host: {
291
+ 'data-slot': 'sidebar-group',
292
+ 'data-sidebar': 'group',
293
+ },
294
+ }]
295
+ }], ctorParameters: () => [] });
296
+
297
+ class HlmSidebarGroupAction {
298
+ constructor() {
299
+ classes(() => "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute end-3 top-3.5 w-5 rounded-md p-0 focus-visible:ring-2 [&>ng-icon]:text-[length:--spacing(4)] flex aspect-square items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>ng-icon]:shrink-0");
300
+ }
301
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarGroupAction, deps: [], target: i0.ɵɵFactoryTarget.Directive });
302
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarGroupAction, isStandalone: true, selector: "button[hlmSidebarGroupAction]", host: { attributes: { "data-slot": "sidebar-group-action", "data-sidebar": "group-action" } }, ngImport: i0 });
303
+ }
304
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarGroupAction, decorators: [{
305
+ type: Directive,
306
+ args: [{
307
+ selector: 'button[hlmSidebarGroupAction]',
308
+ host: {
309
+ 'data-slot': 'sidebar-group-action',
310
+ 'data-sidebar': 'group-action',
311
+ },
312
+ }]
313
+ }], ctorParameters: () => [] });
314
+
315
+ class HlmSidebarGroupContent {
316
+ constructor() {
317
+ classes(() => "text-sm w-full");
318
+ }
319
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarGroupContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
320
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarGroupContent, isStandalone: true, selector: "div[hlmSidebarGroupContent]", host: { attributes: { "data-slot": "sidebar-group-content", "data-sidebar": "group-content" } }, ngImport: i0 });
321
+ }
322
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarGroupContent, decorators: [{
323
+ type: Directive,
324
+ args: [{
325
+ selector: 'div[hlmSidebarGroupContent]',
326
+ host: {
327
+ 'data-slot': 'sidebar-group-content',
328
+ 'data-sidebar': 'group-content',
329
+ },
330
+ }]
331
+ }], ctorParameters: () => [] });
332
+
333
+ class HlmSidebarGroupLabel {
334
+ constructor() {
335
+ classes(() => "text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>ng-icon]:text-[length:--spacing(4)] flex shrink-0 items-center outline-hidden [&>ng-icon]:shrink-0");
336
+ }
337
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarGroupLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
338
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarGroupLabel, isStandalone: true, selector: "div[hlmSidebarGroupLabel], button[hlmSidebarGroupLabel]", host: { attributes: { "data-slot": "sidebar-group-label", "data-sidebar": "group-label" } }, ngImport: i0 });
339
+ }
340
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarGroupLabel, decorators: [{
341
+ type: Directive,
342
+ args: [{
343
+ selector: 'div[hlmSidebarGroupLabel], button[hlmSidebarGroupLabel]',
344
+ host: {
345
+ 'data-slot': 'sidebar-group-label',
346
+ 'data-sidebar': 'group-label',
347
+ },
348
+ }]
349
+ }], ctorParameters: () => [] });
350
+
351
+ class HlmSidebarHeader {
352
+ constructor() {
353
+ classes(() => "gap-2 p-2 flex flex-col");
354
+ }
355
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive });
356
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarHeader, isStandalone: true, selector: "[hlmSidebarHeader],hlm-sidebar-header", host: { attributes: { "data-slot": "sidebar-header", "data-sidebar": "header" } }, ngImport: i0 });
357
+ }
358
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarHeader, decorators: [{
359
+ type: Directive,
360
+ args: [{
361
+ selector: '[hlmSidebarHeader],hlm-sidebar-header',
362
+ host: {
363
+ 'data-slot': 'sidebar-header',
364
+ 'data-sidebar': 'header',
365
+ },
366
+ }]
367
+ }], ctorParameters: () => [] });
368
+
369
+ class HlmSidebarInput {
370
+ constructor() {
371
+ classes(() => "bg-background h-8 w-full shadow-none");
372
+ }
373
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
374
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarInput, isStandalone: true, selector: "input[hlmSidebarInput]", host: { attributes: { "data-slot": "sidebar-input", "data-sidebar": "input" } }, hostDirectives: [{ directive: i1$1.HlmInput }], ngImport: i0 });
375
+ }
376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarInput, decorators: [{
377
+ type: Directive,
378
+ args: [{
379
+ selector: 'input[hlmSidebarInput]',
380
+ hostDirectives: [HlmInput],
381
+ host: {
382
+ 'data-slot': 'sidebar-input',
383
+ 'data-sidebar': 'input',
384
+ },
385
+ }]
386
+ }], ctorParameters: () => [] });
387
+
388
+ class HlmSidebarInset {
389
+ constructor() {
390
+ classes(() => "bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2 relative flex w-full flex-1 flex-col");
391
+ }
392
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarInset, deps: [], target: i0.ɵɵFactoryTarget.Directive });
393
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarInset, isStandalone: true, selector: "main[hlmSidebarInset]", host: { attributes: { "data-slot": "sidebar-inset" } }, ngImport: i0 });
394
+ }
395
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarInset, decorators: [{
396
+ type: Directive,
397
+ args: [{
398
+ selector: 'main[hlmSidebarInset]',
399
+ host: { 'data-slot': 'sidebar-inset' },
400
+ }]
401
+ }], ctorParameters: () => [] });
402
+
403
+ class HlmSidebarMenu {
404
+ constructor() {
405
+ classes(() => "gap-1 flex w-full min-w-0 flex-col");
406
+ }
407
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive });
408
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarMenu, isStandalone: true, selector: "ul[hlmSidebarMenu]", host: { attributes: { "data-slot": "sidebar-menu", "data-sidebar": "menu" } }, ngImport: i0 });
409
+ }
410
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenu, decorators: [{
411
+ type: Directive,
412
+ args: [{
413
+ selector: 'ul[hlmSidebarMenu]',
414
+ host: {
415
+ 'data-slot': 'sidebar-menu',
416
+ 'data-sidebar': 'menu',
417
+ },
418
+ }]
419
+ }], ctorParameters: () => [] });
420
+
421
+ class HlmSidebarMenuAction {
422
+ showOnHover = input(false, { ...(ngDevMode ? { debugName: "showOnHover" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
423
+ constructor() {
424
+ classes(() => [
425
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute end-1 top-1.5 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>ng-icon]:text-[length:--spacing(4)] flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>ng-icon]:shrink-0",
426
+ this.showOnHover() &&
427
+ "peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",
428
+ ]);
429
+ }
430
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuAction, deps: [], target: i0.ɵɵFactoryTarget.Directive });
431
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmSidebarMenuAction, isStandalone: true, selector: "button[hlmSidebarMenuAction]", inputs: { showOnHover: { classPropertyName: "showOnHover", publicName: "showOnHover", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-menu-action", "data-sidebar": "menu-action" } }, ngImport: i0 });
432
+ }
433
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuAction, decorators: [{
434
+ type: Directive,
435
+ args: [{
436
+ selector: 'button[hlmSidebarMenuAction]',
437
+ host: {
438
+ 'data-slot': 'sidebar-menu-action',
439
+ 'data-sidebar': 'menu-action',
440
+ },
441
+ }]
442
+ }], ctorParameters: () => [], propDecorators: { showOnHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "showOnHover", required: false }] }] } });
443
+
444
+ class HlmSidebarMenuBadge {
445
+ constructor() {
446
+ classes(() => "text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute end-1 h-5 min-w-5 rounded-md px-1 text-xs font-medium peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 flex items-center justify-center tabular-nums select-none group-data-[collapsible=icon]:hidden");
447
+ }
448
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuBadge, deps: [], target: i0.ɵɵFactoryTarget.Directive });
449
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarMenuBadge, isStandalone: true, selector: "[hlmSidebarMenuBadge],hlm-sidebar-menu-badge", host: { attributes: { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge" } }, ngImport: i0 });
450
+ }
451
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuBadge, decorators: [{
452
+ type: Directive,
453
+ args: [{
454
+ selector: '[hlmSidebarMenuBadge],hlm-sidebar-menu-badge',
455
+ host: {
456
+ 'data-slot': 'sidebar-menu-badge',
457
+ 'data-sidebar': 'menu-badge',
458
+ },
459
+ }]
460
+ }], ctorParameters: () => [] });
461
+
462
+ const sidebarMenuButtonVariants = cva("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-start text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button group/menu-button flex w-full items-center overflow-hidden outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_ng-icon]:shrink-0 [&_ng-icon]:text-[length:--spacing(4)] [&>span:last-child]:truncate", {
463
+ variants: {
464
+ variant: {
465
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
466
+ outline: "bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_var(--sidebar-border)] hover:shadow-[0_0_0_1px_var(--sidebar-accent)]",
467
+ },
468
+ size: {
469
+ default: "h-8 text-sm",
470
+ sm: "h-7 text-xs",
471
+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
472
+ },
473
+ },
474
+ defaultVariants: {
475
+ variant: 'default',
476
+ size: 'default',
477
+ },
478
+ });
479
+ class HlmSidebarMenuButton {
480
+ _config = injectHlmSidebarConfig();
481
+ _sidebarService = inject(HlmSidebarService);
482
+ _brnTooltip = inject(BrnTooltip);
483
+ variant = input('default', /* @ts-ignore */
484
+ ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
485
+ size = input('default', /* @ts-ignore */
486
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
487
+ isActive = input(false, { ...(ngDevMode ? { debugName: "isActive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
488
+ closeMobileSidebarOnClick = input(this._config.closeMobileSidebarOnMenuButtonClick, { ...(ngDevMode ? { debugName: "closeMobileSidebarOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
489
+ _isTooltipHidden = computed(() => this._sidebarService.state() !== 'collapsed' || this._sidebarService.isMobile(), /* @ts-ignore */
490
+ ...(ngDevMode ? [{ debugName: "_isTooltipHidden" }] : /* istanbul ignore next */ []));
491
+ constructor() {
492
+ classes(() => sidebarMenuButtonVariants({ variant: this.variant(), size: this.size() }));
493
+ effect(() => this._brnTooltip.mutableTooltipDisabled.set(this._isTooltipHidden()));
494
+ }
495
+ onClick() {
496
+ if (this.closeMobileSidebarOnClick()) {
497
+ this._sidebarService.setOpenMobile(false);
498
+ }
499
+ }
500
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuButton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
501
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmSidebarMenuButton, isStandalone: true, selector: "button[hlmSidebarMenuButton], a[hlmSidebarMenuButton]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, isActive: { classPropertyName: "isActive", publicName: "isActive", isSignal: true, isRequired: false, transformFunction: null }, closeMobileSidebarOnClick: { classPropertyName: "closeMobileSidebarOnClick", publicName: "closeMobileSidebarOnClick", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-menu-button", "data-sidebar": "menu-button" }, listeners: { "click": "onClick()" }, properties: { "attr.data-size": "size()", "attr.data-active": "isActive()" } }, providers: [
502
+ provideBrnTooltipDefaultOptions({
503
+ showDelay: 150,
504
+ hideDelay: 0,
505
+ tooltipContentClasses: DEFAULT_TOOLTIP_CONTENT_CLASSES,
506
+ svgClasses: DEFAULT_TOOLTIP_SVG_CLASS,
507
+ arrowClasses: (position) => hlm(tooltipPositionVariants({ position })),
508
+ position: 'right',
509
+ }),
510
+ ], hostDirectives: [{ directive: i1$2.BrnTooltip, inputs: ["brnTooltip", "tooltip"] }], ngImport: i0 });
511
+ }
512
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuButton, decorators: [{
513
+ type: Directive,
514
+ args: [{
515
+ selector: 'button[hlmSidebarMenuButton], a[hlmSidebarMenuButton]',
516
+ providers: [
517
+ provideBrnTooltipDefaultOptions({
518
+ showDelay: 150,
519
+ hideDelay: 0,
520
+ tooltipContentClasses: DEFAULT_TOOLTIP_CONTENT_CLASSES,
521
+ svgClasses: DEFAULT_TOOLTIP_SVG_CLASS,
522
+ arrowClasses: (position) => hlm(tooltipPositionVariants({ position })),
523
+ position: 'right',
524
+ }),
525
+ ],
526
+ hostDirectives: [
527
+ {
528
+ directive: BrnTooltip,
529
+ inputs: ['brnTooltip: tooltip'],
530
+ },
531
+ ],
532
+ host: {
533
+ 'data-slot': 'sidebar-menu-button',
534
+ 'data-sidebar': 'menu-button',
535
+ '[attr.data-size]': 'size()',
536
+ '[attr.data-active]': 'isActive()',
537
+ '(click)': 'onClick()',
538
+ },
539
+ }]
540
+ }], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], isActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isActive", required: false }] }], closeMobileSidebarOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeMobileSidebarOnClick", required: false }] }] } });
541
+
542
+ class HlmSidebarMenuItem {
543
+ constructor() {
544
+ classes(() => "group/menu-item relative");
545
+ }
546
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
547
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarMenuItem, isStandalone: true, selector: "li[hlmSidebarMenuItem]", host: { attributes: { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item" } }, ngImport: i0 });
548
+ }
549
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuItem, decorators: [{
550
+ type: Directive,
551
+ args: [{
552
+ selector: 'li[hlmSidebarMenuItem]',
553
+ host: {
554
+ 'data-slot': 'sidebar-menu-item',
555
+ 'data-sidebar': 'menu-item',
556
+ },
557
+ }]
558
+ }], ctorParameters: () => [] });
559
+
560
+ class HlmSidebarMenuSkeleton {
561
+ showIcon = input(false, { ...(ngDevMode ? { debugName: "showIcon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
562
+ _width = `${Math.floor(Math.random() * 40) + 50}%`;
563
+ constructor() {
564
+ classes(() => "h-8 gap-2 rounded-md px-2 flex items-center");
565
+ }
566
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuSkeleton, deps: [], target: i0.ɵɵFactoryTarget.Component });
567
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: HlmSidebarMenuSkeleton, isStandalone: true, selector: "hlm-sidebar-menu-skeleton,div[hlmSidebarMenuSkeleton]", inputs: { showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-menu-skeleton", "data-sidebar": "menu-skeleton" } }, ngImport: i0, template: "\n @if (showIcon()) {\n <hlm-skeleton data-sidebar=\"menu-skeleton-icon\" class=\"size-4 rounded-md\" />\n } @else {\n <hlm-skeleton\n data-sidebar=\"menu-skeleton-text\"\n class=\"h-4 max-w-(--skeleton-width) flex-1\"\n [style.--skeleton-width]=\"_width\"\n />\n }\n ", isInline: true, dependencies: [{ kind: "directive", type: i1$3.HlmSkeleton, selector: "[hlmSkeleton],hlm-skeleton" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
568
+ }
569
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuSkeleton, decorators: [{
570
+ type: Component,
571
+ args: [{
572
+ selector: 'hlm-sidebar-menu-skeleton,div[hlmSidebarMenuSkeleton]',
573
+ imports: [HlmSkeletonImports],
574
+ changeDetection: ChangeDetectionStrategy.OnPush,
575
+ host: {
576
+ 'data-slot': 'sidebar-menu-skeleton',
577
+ 'data-sidebar': 'menu-skeleton',
578
+ },
579
+ template: "\n @if (showIcon()) {\n <hlm-skeleton data-sidebar=\"menu-skeleton-icon\" class=\"size-4 rounded-md\" />\n } @else {\n <hlm-skeleton\n data-sidebar=\"menu-skeleton-text\"\n class=\"h-4 max-w-(--skeleton-width) flex-1\"\n [style.--skeleton-width]=\"_width\"\n />\n }\n ",
580
+ }]
581
+ }], ctorParameters: () => [], propDecorators: { showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }] } });
582
+
583
+ class HlmSidebarMenuSub {
584
+ constructor() {
585
+ classes(() => "border-sidebar-border mx-3.5 translate-x-px gap-1 border-s px-2.5 py-0.5 group-data-[collapsible=icon]:hidden rtl:-translate-x-px flex min-w-0 flex-col");
586
+ }
587
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuSub, deps: [], target: i0.ɵɵFactoryTarget.Directive });
588
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarMenuSub, isStandalone: true, selector: "ul[hlmSidebarMenuSub]", host: { attributes: { "data-slot": "sidebar-menu-sub", "data-sidebar": "menu-sub" } }, ngImport: i0 });
589
+ }
590
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuSub, decorators: [{
591
+ type: Directive,
592
+ args: [{
593
+ selector: 'ul[hlmSidebarMenuSub]',
594
+ host: {
595
+ 'data-slot': 'sidebar-menu-sub',
596
+ 'data-sidebar': 'menu-sub',
597
+ },
598
+ }]
599
+ }], ctorParameters: () => [] });
600
+
601
+ class HlmSidebarMenuSubButton {
602
+ _sidebarService = inject(HlmSidebarService);
603
+ _config = injectHlmSidebarConfig();
604
+ closeMobileSidebarOnClick = input(this._config.closeMobileSidebarOnMenuButtonClick, { ...(ngDevMode ? { debugName: "closeMobileSidebarOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
605
+ size = input('md', /* @ts-ignore */
606
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
607
+ isActive = input(false, { ...(ngDevMode ? { debugName: "isActive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
608
+ constructor() {
609
+ classes(() => "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>ng-icon]:text-[length:--spacing(4)] flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>ng-icon]:shrink-0 [&>span:last-child]:truncate");
610
+ }
611
+ onClick() {
612
+ if (this.closeMobileSidebarOnClick()) {
613
+ this._sidebarService.setOpenMobile(false);
614
+ }
615
+ }
616
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuSubButton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
617
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmSidebarMenuSubButton, isStandalone: true, selector: "a[hlmSidebarMenuSubButton], button[hlmSidebarMenuSubButton]", inputs: { closeMobileSidebarOnClick: { classPropertyName: "closeMobileSidebarOnClick", publicName: "closeMobileSidebarOnClick", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, isActive: { classPropertyName: "isActive", publicName: "isActive", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-menu-sub-button", "data-sidebar": "menu-sub-button" }, listeners: { "click": "onClick()" }, properties: { "attr.data-active": "isActive()", "attr.data-size": "size()" } }, ngImport: i0 });
618
+ }
619
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuSubButton, decorators: [{
620
+ type: Directive,
621
+ args: [{
622
+ selector: 'a[hlmSidebarMenuSubButton], button[hlmSidebarMenuSubButton]',
623
+ host: {
624
+ 'data-slot': 'sidebar-menu-sub-button',
625
+ 'data-sidebar': 'menu-sub-button',
626
+ '[attr.data-active]': 'isActive()',
627
+ '[attr.data-size]': 'size()',
628
+ '(click)': 'onClick()',
629
+ },
630
+ }]
631
+ }], ctorParameters: () => [], propDecorators: { closeMobileSidebarOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeMobileSidebarOnClick", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], isActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isActive", required: false }] }] } });
632
+
633
+ class HlmSidebarMenuSubItem {
634
+ constructor() {
635
+ classes(() => "group/menu-sub-item relative");
636
+ }
637
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuSubItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
638
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarMenuSubItem, isStandalone: true, selector: "li[hlmSidebarMenuSubItem]", host: { attributes: { "data-slot": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item" } }, ngImport: i0 });
639
+ }
640
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarMenuSubItem, decorators: [{
641
+ type: Directive,
642
+ args: [{
643
+ selector: 'li[hlmSidebarMenuSubItem]',
644
+ host: {
645
+ 'data-slot': 'sidebar-menu-sub-item',
646
+ 'data-sidebar': 'menu-sub-item',
647
+ },
648
+ }]
649
+ }], ctorParameters: () => [] });
650
+
651
+ class HlmSidebarRail {
652
+ _sidebarService = inject(HlmSidebarService);
653
+ ariaLabel = input('Toggle Sidebar', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
654
+ constructor() {
655
+ classes(() => [
656
+ "hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",
657
+ "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
658
+ "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
659
+ "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
660
+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
661
+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
662
+ ]);
663
+ }
664
+ onClick() {
665
+ this._sidebarService.toggleSidebar();
666
+ }
667
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarRail, deps: [], target: i0.ɵɵFactoryTarget.Directive });
668
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmSidebarRail, isStandalone: true, selector: "button[hlmSidebarRail]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-sidebar": "rail", "data-slot": "sidebar-rail", "tabindex": "-1" }, listeners: { "click": "onClick()" }, properties: { "attr.aria-label": "ariaLabel()" } }, ngImport: i0 });
669
+ }
670
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarRail, decorators: [{
671
+ type: Directive,
672
+ args: [{
673
+ selector: 'button[hlmSidebarRail]',
674
+ host: {
675
+ 'data-sidebar': 'rail',
676
+ 'data-slot': 'sidebar-rail',
677
+ '[attr.aria-label]': 'ariaLabel()',
678
+ tabindex: '-1',
679
+ '(click)': 'onClick()',
680
+ },
681
+ }]
682
+ }], ctorParameters: () => [], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] } });
683
+
684
+ class HlmSidebarSeparator {
685
+ constructor() {
686
+ classes(() => "bg-sidebar-border mx-2 w-auto");
687
+ }
688
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarSeparator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
689
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmSidebarSeparator, isStandalone: true, selector: "[hlmSidebarSeparator],hlm-sidebar-separator", host: { attributes: { "data-slot": "sidebar-separator", "data-sidebar": "separator" } }, hostDirectives: [{ directive: i1$4.HlmSeparator }], ngImport: i0 });
690
+ }
691
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarSeparator, decorators: [{
692
+ type: Directive,
693
+ args: [{
694
+ selector: '[hlmSidebarSeparator],hlm-sidebar-separator',
695
+ hostDirectives: [HlmSeparator],
696
+ host: {
697
+ 'data-slot': 'sidebar-separator',
698
+ 'data-sidebar': 'separator',
699
+ },
700
+ }]
701
+ }], ctorParameters: () => [] });
702
+
703
+ class HlmSidebarTrigger {
704
+ _sidebarService = inject(HlmSidebarService);
705
+ srOnlyText = input('Toggle Sidebar', /* @ts-ignore */
706
+ ...(ngDevMode ? [{ debugName: "srOnlyText" }] : /* istanbul ignore next */ []));
707
+ _onClick() {
708
+ this._sidebarService.toggleSidebar();
709
+ }
710
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarTrigger, deps: [], target: i0.ɵɵFactoryTarget.Component });
711
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: HlmSidebarTrigger, isStandalone: true, selector: "button[hlmSidebarTrigger]", inputs: { srOnlyText: { classPropertyName: "srOnlyText", publicName: "srOnlyText", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-trigger", "data-sidebar": "trigger" }, listeners: { "click": "_onClick()" } }, providers: [provideIcons({ lucidePanelLeft }), provideBrnButtonConfig({ variant: 'ghost', size: 'icon-sm' })], hostDirectives: [{ directive: i1$5.HlmBtn, inputs: ["variant", "variant", "size", "size"] }], ngImport: i0, template: "\n <ng-icon name=\"lucidePanelLeft\" />\n <span class=\"sr-only\">{{ srOnlyText() }}</span>\n ", isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
712
+ }
713
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarTrigger, decorators: [{
714
+ type: Component,
715
+ args: [{
716
+ // eslint-disable-next-line @angular-eslint/component-selector
717
+ selector: 'button[hlmSidebarTrigger]',
718
+ imports: [NgIcon],
719
+ providers: [provideIcons({ lucidePanelLeft }), provideBrnButtonConfig({ variant: 'ghost', size: 'icon-sm' })],
720
+ changeDetection: ChangeDetectionStrategy.OnPush,
721
+ hostDirectives: [{ directive: HlmBtn, inputs: ['variant', 'size'] }],
722
+ host: {
723
+ 'data-slot': 'sidebar-trigger',
724
+ 'data-sidebar': 'trigger',
725
+ '(click)': '_onClick()',
726
+ },
727
+ template: "\n <ng-icon name=\"lucidePanelLeft\" />\n <span class=\"sr-only\">{{ srOnlyText() }}</span>\n ",
728
+ }]
729
+ }], propDecorators: { srOnlyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "srOnlyText", required: false }] }] } });
730
+
731
+ class HlmSidebarWrapper {
732
+ _config = injectHlmSidebarConfig();
733
+ sidebarWidth = input(this._config.sidebarWidth, /* @ts-ignore */
734
+ ...(ngDevMode ? [{ debugName: "sidebarWidth" }] : /* istanbul ignore next */ []));
735
+ sidebarWidthIcon = input(this._config.sidebarWidthIcon, /* @ts-ignore */
736
+ ...(ngDevMode ? [{ debugName: "sidebarWidthIcon" }] : /* istanbul ignore next */ []));
737
+ constructor() {
738
+ classes(() => "group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full");
739
+ }
740
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarWrapper, deps: [], target: i0.ɵɵFactoryTarget.Directive });
741
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmSidebarWrapper, isStandalone: true, selector: "[hlmSidebarWrapper],hlm-sidebar-wrapper", inputs: { sidebarWidth: { classPropertyName: "sidebarWidth", publicName: "sidebarWidth", isSignal: true, isRequired: false, transformFunction: null }, sidebarWidthIcon: { classPropertyName: "sidebarWidthIcon", publicName: "sidebarWidthIcon", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "sidebar-wrapper" }, properties: { "style.--sidebar-width": "sidebarWidth()", "style.--sidebar-width-icon": "sidebarWidthIcon()" } }, ngImport: i0 });
742
+ }
743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarWrapper, decorators: [{
744
+ type: Directive,
745
+ args: [{
746
+ selector: '[hlmSidebarWrapper],hlm-sidebar-wrapper',
747
+ host: {
748
+ 'data-slot': 'sidebar-wrapper',
749
+ '[style.--sidebar-width]': 'sidebarWidth()',
750
+ '[style.--sidebar-width-icon]': 'sidebarWidthIcon()',
751
+ },
752
+ }]
753
+ }], ctorParameters: () => [], propDecorators: { sidebarWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarWidth", required: false }] }], sidebarWidthIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebarWidthIcon", required: false }] }] } });
754
+
755
+ /*
756
+ * Public API Surface of sidebar
757
+ */
758
+ const HlmSidebarImports = [
759
+ HlmSidebar,
760
+ HlmSidebarContent,
761
+ HlmSidebarFooter,
762
+ HlmSidebarGroup,
763
+ HlmSidebarGroupAction,
764
+ HlmSidebarGroupContent,
765
+ HlmSidebarGroupLabel,
766
+ HlmSidebarHeader,
767
+ HlmSidebarInput,
768
+ HlmSidebarInset,
769
+ HlmSidebarMenu,
770
+ HlmSidebarMenuSkeleton,
771
+ HlmSidebarMenuAction,
772
+ HlmSidebarMenuBadge,
773
+ HlmSidebarMenuButton,
774
+ HlmSidebarMenuItem,
775
+ HlmSidebarMenuSub,
776
+ HlmSidebarMenuSubButton,
777
+ HlmSidebarRail,
778
+ HlmSidebarSeparator,
779
+ HlmSidebarTrigger,
780
+ HlmSidebarWrapper,
781
+ HlmSidebarMenuSubItem,
782
+ ];
783
+ class HlmSidebarModule {
784
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
785
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarModule, imports: [HlmSidebar,
786
+ HlmSidebarContent,
787
+ HlmSidebarFooter,
788
+ HlmSidebarGroup,
789
+ HlmSidebarGroupAction,
790
+ HlmSidebarGroupContent,
791
+ HlmSidebarGroupLabel,
792
+ HlmSidebarHeader,
793
+ HlmSidebarInput,
794
+ HlmSidebarInset,
795
+ HlmSidebarMenu,
796
+ HlmSidebarMenuSkeleton,
797
+ HlmSidebarMenuAction,
798
+ HlmSidebarMenuBadge,
799
+ HlmSidebarMenuButton,
800
+ HlmSidebarMenuItem,
801
+ HlmSidebarMenuSub,
802
+ HlmSidebarMenuSubButton,
803
+ HlmSidebarRail,
804
+ HlmSidebarSeparator,
805
+ HlmSidebarTrigger,
806
+ HlmSidebarWrapper,
807
+ HlmSidebarMenuSubItem], exports: [HlmSidebar,
808
+ HlmSidebarContent,
809
+ HlmSidebarFooter,
810
+ HlmSidebarGroup,
811
+ HlmSidebarGroupAction,
812
+ HlmSidebarGroupContent,
813
+ HlmSidebarGroupLabel,
814
+ HlmSidebarHeader,
815
+ HlmSidebarInput,
816
+ HlmSidebarInset,
817
+ HlmSidebarMenu,
818
+ HlmSidebarMenuSkeleton,
819
+ HlmSidebarMenuAction,
820
+ HlmSidebarMenuBadge,
821
+ HlmSidebarMenuButton,
822
+ HlmSidebarMenuItem,
823
+ HlmSidebarMenuSub,
824
+ HlmSidebarMenuSubButton,
825
+ HlmSidebarRail,
826
+ HlmSidebarSeparator,
827
+ HlmSidebarTrigger,
828
+ HlmSidebarWrapper,
829
+ HlmSidebarMenuSubItem] });
830
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarModule, imports: [HlmSidebar,
831
+ HlmSidebarTrigger] });
832
+ }
833
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSidebarModule, decorators: [{
834
+ type: NgModule,
835
+ args: [{
836
+ imports: [...HlmSidebarImports],
837
+ exports: [...HlmSidebarImports],
838
+ }]
839
+ }] });
840
+
841
+ /**
842
+ * Generated bundle index. Do not edit.
843
+ */
844
+
845
+ export { HlmSidebar, HlmSidebarContent, HlmSidebarFooter, HlmSidebarGroup, HlmSidebarGroupAction, HlmSidebarGroupContent, HlmSidebarGroupLabel, HlmSidebarHeader, HlmSidebarImports, HlmSidebarInput, HlmSidebarInset, HlmSidebarMenu, HlmSidebarMenuAction, HlmSidebarMenuBadge, HlmSidebarMenuButton, HlmSidebarMenuItem, HlmSidebarMenuSkeleton, HlmSidebarMenuSub, HlmSidebarMenuSubButton, HlmSidebarMenuSubItem, HlmSidebarModule, HlmSidebarRail, HlmSidebarSeparator, HlmSidebarService, HlmSidebarTrigger, HlmSidebarWrapper, injectHlmSidebarConfig, provideHlmSidebarConfig };
846
+