@ng-cn/core 1.0.15 → 1.0.17

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 (380) hide show
  1. package/package.json +34 -33
  2. package/schematics/component/index.js +454 -95
  3. package/schematics/component/index.ts +459 -98
  4. package/schematics/ng-add/index.js +539 -55
  5. package/schematics/ng-add/index.ts +555 -62
  6. package/schematics/ng-add/schema.json +8 -2
  7. package/schematics/test-schematic.js +1 -2
  8. package/src/app/lib/components/ui/.gitkeep +0 -0
  9. package/src/app/lib/components/ui/accordion/accordion-content.component.ts +16 -24
  10. package/src/app/lib/components/ui/accordion/accordion-context.ts +4 -9
  11. package/src/app/lib/components/ui/accordion/accordion-item.component.ts +33 -29
  12. package/src/app/lib/components/ui/accordion/accordion-trigger.component.ts +11 -14
  13. package/src/app/lib/components/ui/accordion/accordion.component.ts +60 -49
  14. package/src/app/lib/components/ui/accordion/index.ts +5 -6
  15. package/src/app/lib/components/ui/alert/alert-description.component.ts +3 -8
  16. package/src/app/lib/components/ui/alert/alert-title.component.ts +2 -7
  17. package/src/app/lib/components/ui/alert/alert-variants.ts +19 -5
  18. package/src/app/lib/components/ui/alert/alert.component.ts +2 -10
  19. package/src/app/lib/components/ui/alert/index.ts +0 -1
  20. package/src/app/lib/components/ui/alert-dialog/alert-dialog-action.component.ts +5 -12
  21. package/src/app/lib/components/ui/alert-dialog/alert-dialog-cancel.component.ts +5 -11
  22. package/src/app/lib/components/ui/alert-dialog/alert-dialog-content.component.ts +63 -66
  23. package/src/app/lib/components/ui/alert-dialog/alert-dialog-context.ts +10 -5
  24. package/src/app/lib/components/ui/alert-dialog/alert-dialog-description.component.ts +5 -10
  25. package/src/app/lib/components/ui/alert-dialog/alert-dialog-footer.component.ts +3 -7
  26. package/src/app/lib/components/ui/alert-dialog/alert-dialog-header.component.ts +3 -7
  27. package/src/app/lib/components/ui/alert-dialog/alert-dialog-title.component.ts +5 -12
  28. package/src/app/lib/components/ui/alert-dialog/alert-dialog-trigger.component.ts +8 -12
  29. package/src/app/lib/components/ui/alert-dialog/alert-dialog.component.ts +28 -34
  30. package/src/app/lib/components/ui/alert-dialog/index.ts +0 -1
  31. package/src/app/lib/components/ui/aspect-ratio/aspect-ratio.component.ts +3 -9
  32. package/src/app/lib/components/ui/avatar/avatar-context.ts +9 -0
  33. package/src/app/lib/components/ui/avatar/avatar-fallback.component.ts +7 -18
  34. package/src/app/lib/components/ui/avatar/avatar-image.component.ts +39 -17
  35. package/src/app/lib/components/ui/avatar/avatar.component.ts +17 -20
  36. package/src/app/lib/components/ui/avatar/index.ts +1 -1
  37. package/src/app/lib/components/ui/avatar/ui-avatar.component.ts +9 -30
  38. package/src/app/lib/components/ui/badge/badge-variants.ts +5 -5
  39. package/src/app/lib/components/ui/badge/badge.component.ts +4 -8
  40. package/src/app/lib/components/ui/badge/index.ts +0 -1
  41. package/src/app/lib/components/ui/breadcrumb/breadcrumb-ellipsis.component.ts +3 -7
  42. package/src/app/lib/components/ui/breadcrumb/breadcrumb-item.component.ts +5 -14
  43. package/src/app/lib/components/ui/breadcrumb/breadcrumb-link.component.ts +6 -18
  44. package/src/app/lib/components/ui/breadcrumb/breadcrumb-list.component.ts +6 -15
  45. package/src/app/lib/components/ui/breadcrumb/breadcrumb-page.component.ts +3 -7
  46. package/src/app/lib/components/ui/breadcrumb/breadcrumb-separator.component.ts +22 -31
  47. package/src/app/lib/components/ui/breadcrumb/breadcrumb.component.ts +3 -9
  48. package/src/app/lib/components/ui/breadcrumb/index.ts +0 -1
  49. package/src/app/lib/components/ui/button/button-variants.ts +6 -8
  50. package/src/app/lib/components/ui/button/button.component.ts +4 -8
  51. package/src/app/lib/components/ui/button/index.ts +0 -1
  52. package/src/app/lib/components/ui/button-group/button-group-variants.ts +12 -15
  53. package/src/app/lib/components/ui/button-group/button-group.component.ts +6 -14
  54. package/src/app/lib/components/ui/button-group/index.ts +1 -5
  55. package/src/app/lib/components/ui/calendar/calendar.component.ts +103 -115
  56. package/src/app/lib/components/ui/card/card-action.component.ts +2 -10
  57. package/src/app/lib/components/ui/card/card-content.component.ts +1 -6
  58. package/src/app/lib/components/ui/card/card-description.component.ts +2 -7
  59. package/src/app/lib/components/ui/card/card-footer.component.ts +2 -7
  60. package/src/app/lib/components/ui/card/card-header.component.ts +3 -8
  61. package/src/app/lib/components/ui/card/card-title.component.ts +2 -9
  62. package/src/app/lib/components/ui/card/card.component.ts +3 -8
  63. package/src/app/lib/components/ui/card/index.ts +0 -1
  64. package/src/app/lib/components/ui/carousel/carousel-content.component.ts +3 -9
  65. package/src/app/lib/components/ui/carousel/carousel-item.component.ts +5 -5
  66. package/src/app/lib/components/ui/carousel/carousel-next.component.ts +9 -8
  67. package/src/app/lib/components/ui/carousel/carousel-previous.component.ts +9 -8
  68. package/src/app/lib/components/ui/carousel/carousel.component.ts +14 -25
  69. package/src/app/lib/components/ui/carousel/index.ts +5 -2
  70. package/src/app/lib/components/ui/chart/chart-container.component.ts +20 -26
  71. package/src/app/lib/components/ui/chart/chart-legend-content.component.ts +6 -16
  72. package/src/app/lib/components/ui/chart/chart-legend.component.ts +2 -7
  73. package/src/app/lib/components/ui/chart/chart-tooltip-content.component.ts +2 -9
  74. package/src/app/lib/components/ui/chart/chart-tooltip.component.ts +2 -7
  75. package/src/app/lib/components/ui/chart/chart.component.ts +12 -32
  76. package/src/app/lib/components/ui/chart/index.ts +7 -8
  77. package/src/app/lib/components/ui/checkbox/checkbox.component.ts +55 -74
  78. package/src/app/lib/components/ui/collapsible/collapsible-content.component.ts +16 -25
  79. package/src/app/lib/components/ui/collapsible/collapsible-context.ts +0 -8
  80. package/src/app/lib/components/ui/collapsible/collapsible-trigger.component.ts +6 -16
  81. package/src/app/lib/components/ui/collapsible/collapsible.component.ts +29 -33
  82. package/src/app/lib/components/ui/collapsible/index.ts +0 -1
  83. package/src/app/lib/components/ui/combobox/combobox-content.component.ts +8 -15
  84. package/src/app/lib/components/ui/combobox/combobox-context.ts +5 -4
  85. package/src/app/lib/components/ui/combobox/combobox-empty.component.ts +5 -12
  86. package/src/app/lib/components/ui/combobox/combobox-group.component.ts +3 -7
  87. package/src/app/lib/components/ui/combobox/combobox-input.component.ts +25 -25
  88. package/src/app/lib/components/ui/combobox/combobox-item.component.ts +45 -44
  89. package/src/app/lib/components/ui/combobox/combobox-list.component.ts +14 -12
  90. package/src/app/lib/components/ui/combobox/combobox-trigger.component.ts +24 -14
  91. package/src/app/lib/components/ui/combobox/combobox-value.component.ts +27 -22
  92. package/src/app/lib/components/ui/combobox/combobox.component.ts +74 -54
  93. package/src/app/lib/components/ui/combobox/index.ts +1 -6
  94. package/src/app/lib/components/ui/command/command-context.ts +1 -5
  95. package/src/app/lib/components/ui/command/command-dialog.component.ts +12 -14
  96. package/src/app/lib/components/ui/command/command-empty.component.ts +2 -3
  97. package/src/app/lib/components/ui/command/command-group.component.ts +32 -25
  98. package/src/app/lib/components/ui/command/command-input.component.ts +29 -28
  99. package/src/app/lib/components/ui/command/command-item.component.ts +46 -58
  100. package/src/app/lib/components/ui/command/command-list.component.ts +5 -4
  101. package/src/app/lib/components/ui/command/command-separator.component.ts +2 -3
  102. package/src/app/lib/components/ui/command/command-shortcut.component.ts +2 -1
  103. package/src/app/lib/components/ui/command/command.component.ts +33 -22
  104. package/src/app/lib/components/ui/command/index.ts +0 -1
  105. package/src/app/lib/components/ui/context-menu/context-menu-checkbox-item.component.ts +20 -11
  106. package/src/app/lib/components/ui/context-menu/context-menu-content.component.ts +36 -43
  107. package/src/app/lib/components/ui/context-menu/context-menu-context.ts +1 -1
  108. package/src/app/lib/components/ui/context-menu/context-menu-item.component.ts +12 -13
  109. package/src/app/lib/components/ui/context-menu/context-menu-label.component.ts +2 -5
  110. package/src/app/lib/components/ui/context-menu/context-menu-radio-group.component.ts +9 -2
  111. package/src/app/lib/components/ui/context-menu/context-menu-radio-item.component.ts +14 -14
  112. package/src/app/lib/components/ui/context-menu/context-menu-separator.component.ts +2 -3
  113. package/src/app/lib/components/ui/context-menu/context-menu-shortcut.component.ts +2 -1
  114. package/src/app/lib/components/ui/context-menu/context-menu-sub-content.component.ts +5 -5
  115. package/src/app/lib/components/ui/context-menu/context-menu-sub-trigger.component.ts +8 -7
  116. package/src/app/lib/components/ui/context-menu/context-menu-sub.component.ts +9 -2
  117. package/src/app/lib/components/ui/context-menu/context-menu-trigger.component.ts +8 -7
  118. package/src/app/lib/components/ui/context-menu/context-menu.component.ts +1 -0
  119. package/src/app/lib/components/ui/context-menu/index.ts +15 -4
  120. package/src/app/lib/components/ui/data-table/data-table-content.component.ts +22 -28
  121. package/src/app/lib/components/ui/data-table/data-table-context.ts +1 -3
  122. package/src/app/lib/components/ui/data-table/data-table-pagination.component.ts +17 -27
  123. package/src/app/lib/components/ui/data-table/data-table-search.component.ts +6 -14
  124. package/src/app/lib/components/ui/data-table/data-table-toolbar.component.ts +3 -7
  125. package/src/app/lib/components/ui/data-table/data-table-view-options.component.ts +11 -20
  126. package/src/app/lib/components/ui/data-table/data-table.component.ts +41 -49
  127. package/src/app/lib/components/ui/data-table/index.ts +7 -8
  128. package/src/app/lib/components/ui/date-picker/date-picker.component.ts +24 -24
  129. package/src/app/lib/components/ui/dialog/dialog-close.component.ts +4 -8
  130. package/src/app/lib/components/ui/dialog/dialog-content.component.ts +72 -73
  131. package/src/app/lib/components/ui/dialog/dialog-context.ts +7 -5
  132. package/src/app/lib/components/ui/dialog/dialog-description.component.ts +5 -10
  133. package/src/app/lib/components/ui/dialog/dialog-footer.component.ts +3 -7
  134. package/src/app/lib/components/ui/dialog/dialog-header.component.ts +3 -7
  135. package/src/app/lib/components/ui/dialog/dialog-title.component.ts +5 -10
  136. package/src/app/lib/components/ui/dialog/dialog-trigger.component.ts +7 -11
  137. package/src/app/lib/components/ui/dialog/dialog.component.ts +29 -34
  138. package/src/app/lib/components/ui/dialog/index.ts +0 -1
  139. package/src/app/lib/components/ui/drawer/drawer-close.component.ts +4 -8
  140. package/src/app/lib/components/ui/drawer/drawer-content.component.ts +39 -35
  141. package/src/app/lib/components/ui/drawer/drawer-description.component.ts +5 -10
  142. package/src/app/lib/components/ui/drawer/drawer-footer.component.ts +3 -7
  143. package/src/app/lib/components/ui/drawer/drawer-header.component.ts +3 -7
  144. package/src/app/lib/components/ui/drawer/drawer-title.component.ts +5 -10
  145. package/src/app/lib/components/ui/drawer/drawer-trigger.component.ts +7 -11
  146. package/src/app/lib/components/ui/drawer/drawer.component.ts +25 -26
  147. package/src/app/lib/components/ui/drawer/index.ts +0 -1
  148. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.component.ts +20 -11
  149. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-content.component.ts +96 -61
  150. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-context.ts +1 -1
  151. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-group.component.ts +1 -0
  152. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-item.component.ts +10 -11
  153. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-label.component.ts +2 -5
  154. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.component.ts +14 -5
  155. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.component.ts +14 -14
  156. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-separator.component.ts +2 -3
  157. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.component.ts +2 -1
  158. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.component.ts +5 -5
  159. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.component.ts +8 -7
  160. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub.component.ts +9 -2
  161. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-trigger.component.ts +6 -5
  162. package/src/app/lib/components/ui/dropdown-menu/dropdown-menu.component.ts +1 -0
  163. package/src/app/lib/components/ui/dropdown-menu/index.ts +10 -3
  164. package/src/app/lib/components/ui/empty/empty-action.component.ts +2 -9
  165. package/src/app/lib/components/ui/empty/empty-description.component.ts +2 -10
  166. package/src/app/lib/components/ui/empty/empty-icon.component.ts +3 -8
  167. package/src/app/lib/components/ui/empty/empty-title.component.ts +2 -9
  168. package/src/app/lib/components/ui/empty/empty.component.ts +3 -8
  169. package/src/app/lib/components/ui/empty/index.ts +0 -1
  170. package/src/app/lib/components/ui/form/form-context.ts +1 -11
  171. package/src/app/lib/components/ui/form/form-control.component.ts +22 -22
  172. package/src/app/lib/components/ui/form/form-description.component.ts +4 -10
  173. package/src/app/lib/components/ui/form/form-field.component.ts +7 -10
  174. package/src/app/lib/components/ui/form/form-item.component.ts +2 -12
  175. package/src/app/lib/components/ui/form/form-label.component.ts +15 -15
  176. package/src/app/lib/components/ui/form/form-message.component.ts +7 -15
  177. package/src/app/lib/components/ui/form/form.component.ts +9 -20
  178. package/src/app/lib/components/ui/form/index.ts +4 -5
  179. package/src/app/lib/components/ui/hover-card/hover-card-content.component.ts +21 -33
  180. package/src/app/lib/components/ui/hover-card/hover-card-context.ts +0 -8
  181. package/src/app/lib/components/ui/hover-card/hover-card-trigger.component.ts +17 -26
  182. package/src/app/lib/components/ui/hover-card/hover-card.component.ts +18 -28
  183. package/src/app/lib/components/ui/hover-card/index.ts +9 -6
  184. package/src/app/lib/components/ui/input/input.component.ts +57 -75
  185. package/src/app/lib/components/ui/input-group/index.ts +0 -1
  186. package/src/app/lib/components/ui/input-group/input-group-addon.component.ts +4 -11
  187. package/src/app/lib/components/ui/input-group/input-group-input.component.ts +3 -8
  188. package/src/app/lib/components/ui/input-group/input-group.component.ts +4 -9
  189. package/src/app/lib/components/ui/input-otp/index.ts +4 -5
  190. package/src/app/lib/components/ui/input-otp/input-otp-context.ts +0 -8
  191. package/src/app/lib/components/ui/input-otp/input-otp-group.component.ts +2 -3
  192. package/src/app/lib/components/ui/input-otp/input-otp-separator.component.ts +4 -3
  193. package/src/app/lib/components/ui/input-otp/input-otp-slot.component.ts +8 -10
  194. package/src/app/lib/components/ui/input-otp/input-otp.component.ts +27 -45
  195. package/src/app/lib/components/ui/kbd/index.ts +0 -1
  196. package/src/app/lib/components/ui/kbd/kbd-variants.ts +1 -1
  197. package/src/app/lib/components/ui/kbd/kbd.component.ts +4 -8
  198. package/src/app/lib/components/ui/label/label.component.ts +15 -28
  199. package/src/app/lib/components/ui/menubar/index.ts +11 -8
  200. package/src/app/lib/components/ui/menubar/menubar-checkbox-item.component.ts +21 -12
  201. package/src/app/lib/components/ui/menubar/menubar-content.component.ts +46 -53
  202. package/src/app/lib/components/ui/menubar/menubar-context.ts +3 -9
  203. package/src/app/lib/components/ui/menubar/menubar-item.component.ts +13 -14
  204. package/src/app/lib/components/ui/menubar/menubar-label.component.ts +2 -5
  205. package/src/app/lib/components/ui/menubar/menubar-menu.component.ts +14 -2
  206. package/src/app/lib/components/ui/menubar/menubar-radio-group.component.ts +9 -2
  207. package/src/app/lib/components/ui/menubar/menubar-radio-item.component.ts +13 -13
  208. package/src/app/lib/components/ui/menubar/menubar-separator.component.ts +2 -3
  209. package/src/app/lib/components/ui/menubar/menubar-shortcut.component.ts +2 -1
  210. package/src/app/lib/components/ui/menubar/menubar-sub-content.component.ts +5 -5
  211. package/src/app/lib/components/ui/menubar/menubar-sub-trigger.component.ts +7 -6
  212. package/src/app/lib/components/ui/menubar/menubar-sub.component.ts +8 -1
  213. package/src/app/lib/components/ui/menubar/menubar-trigger.component.ts +26 -21
  214. package/src/app/lib/components/ui/menubar/menubar.component.ts +6 -13
  215. package/src/app/lib/components/ui/native-select/index.ts +1 -5
  216. package/src/app/lib/components/ui/native-select/native-select-variants.ts +1 -1
  217. package/src/app/lib/components/ui/native-select/native-select.component.ts +14 -15
  218. package/src/app/lib/components/ui/navigation-menu/index.ts +10 -8
  219. package/src/app/lib/components/ui/navigation-menu/navigation-menu-content.component.ts +18 -13
  220. package/src/app/lib/components/ui/navigation-menu/navigation-menu-context.ts +2 -10
  221. package/src/app/lib/components/ui/navigation-menu/navigation-menu-indicator.component.ts +3 -2
  222. package/src/app/lib/components/ui/navigation-menu/navigation-menu-item.component.ts +6 -1
  223. package/src/app/lib/components/ui/navigation-menu/navigation-menu-link.component.ts +3 -8
  224. package/src/app/lib/components/ui/navigation-menu/navigation-menu-list.component.ts +2 -4
  225. package/src/app/lib/components/ui/navigation-menu/navigation-menu-trigger-style.ts +1 -1
  226. package/src/app/lib/components/ui/navigation-menu/navigation-menu-trigger.component.ts +8 -7
  227. package/src/app/lib/components/ui/navigation-menu/navigation-menu-viewport.component.ts +3 -2
  228. package/src/app/lib/components/ui/navigation-menu/navigation-menu.component.ts +8 -15
  229. package/src/app/lib/components/ui/pagination/index.ts +0 -1
  230. package/src/app/lib/components/ui/pagination/pagination-content.component.ts +3 -7
  231. package/src/app/lib/components/ui/pagination/pagination-ellipsis.component.ts +3 -7
  232. package/src/app/lib/components/ui/pagination/pagination-item.component.ts +3 -9
  233. package/src/app/lib/components/ui/pagination/pagination-link.component.ts +4 -8
  234. package/src/app/lib/components/ui/pagination/pagination-next.component.ts +3 -11
  235. package/src/app/lib/components/ui/pagination/pagination-previous.component.ts +3 -11
  236. package/src/app/lib/components/ui/pagination/pagination.component.ts +3 -7
  237. package/src/app/lib/components/ui/popover/index.ts +9 -6
  238. package/src/app/lib/components/ui/popover/popover-anchor.component.ts +2 -13
  239. package/src/app/lib/components/ui/popover/popover-content.component.ts +119 -69
  240. package/src/app/lib/components/ui/popover/popover-context.ts +0 -8
  241. package/src/app/lib/components/ui/popover/popover-trigger.component.ts +22 -22
  242. package/src/app/lib/components/ui/popover/popover.component.ts +20 -33
  243. package/src/app/lib/components/ui/progress/index.ts +1 -6
  244. package/src/app/lib/components/ui/progress/progress.component.ts +15 -30
  245. package/src/app/lib/components/ui/radio-group/index.ts +1 -4
  246. package/src/app/lib/components/ui/radio-group/radio-group-context.ts +1 -7
  247. package/src/app/lib/components/ui/radio-group/radio-group-item.component.ts +36 -69
  248. package/src/app/lib/components/ui/radio-group/radio-group.component.ts +38 -67
  249. package/src/app/lib/components/ui/resizable/index.ts +0 -1
  250. package/src/app/lib/components/ui/resizable/resizable-handle.component.ts +25 -39
  251. package/src/app/lib/components/ui/resizable/resizable-panel-group.component.ts +15 -18
  252. package/src/app/lib/components/ui/resizable/resizable-panel.component.ts +12 -31
  253. package/src/app/lib/components/ui/scroll-area/index.ts +4 -5
  254. package/src/app/lib/components/ui/scroll-area/scroll-area.component.ts +5 -19
  255. package/src/app/lib/components/ui/scroll-area/scroll-bar.component.ts +8 -27
  256. package/src/app/lib/components/ui/segmented/index.ts +5 -9
  257. package/src/app/lib/components/ui/segmented/segmented-context.ts +1 -3
  258. package/src/app/lib/components/ui/segmented/segmented-item.component.ts +21 -29
  259. package/src/app/lib/components/ui/segmented/segmented-variants.ts +2 -2
  260. package/src/app/lib/components/ui/segmented/segmented.component.ts +24 -32
  261. package/src/app/lib/components/ui/select/index.ts +5 -6
  262. package/src/app/lib/components/ui/select/select-content.component.ts +34 -62
  263. package/src/app/lib/components/ui/select/select-context.ts +4 -14
  264. package/src/app/lib/components/ui/select/select-group.component.ts +6 -7
  265. package/src/app/lib/components/ui/select/select-item.component.ts +46 -55
  266. package/src/app/lib/components/ui/select/select-label.component.ts +2 -7
  267. package/src/app/lib/components/ui/select/select-separator.component.ts +3 -8
  268. package/src/app/lib/components/ui/select/select-trigger.component.ts +28 -25
  269. package/src/app/lib/components/ui/select/select-value.component.ts +7 -13
  270. package/src/app/lib/components/ui/select/select.component.ts +52 -64
  271. package/src/app/lib/components/ui/separator/index.ts +1 -6
  272. package/src/app/lib/components/ui/separator/separator.component.ts +4 -19
  273. package/src/app/lib/components/ui/sheet/index.ts +0 -1
  274. package/src/app/lib/components/ui/sheet/sheet-close.component.ts +4 -8
  275. package/src/app/lib/components/ui/sheet/sheet-content.component.ts +31 -36
  276. package/src/app/lib/components/ui/sheet/sheet-description.component.ts +5 -10
  277. package/src/app/lib/components/ui/sheet/sheet-footer.component.ts +3 -7
  278. package/src/app/lib/components/ui/sheet/sheet-header.component.ts +3 -7
  279. package/src/app/lib/components/ui/sheet/sheet-title.component.ts +5 -10
  280. package/src/app/lib/components/ui/sheet/sheet-trigger.component.ts +7 -11
  281. package/src/app/lib/components/ui/sheet/sheet-variants.ts +1 -1
  282. package/src/app/lib/components/ui/sheet/sheet.component.ts +36 -36
  283. package/src/app/lib/components/ui/sidebar/index.ts +14 -15
  284. package/src/app/lib/components/ui/sidebar/sidebar-content.component.ts +4 -8
  285. package/src/app/lib/components/ui/sidebar/sidebar-context.ts +1 -3
  286. package/src/app/lib/components/ui/sidebar/sidebar-footer.component.ts +3 -9
  287. package/src/app/lib/components/ui/sidebar/sidebar-group-action.component.ts +4 -8
  288. package/src/app/lib/components/ui/sidebar/sidebar-group-content.component.ts +3 -9
  289. package/src/app/lib/components/ui/sidebar/sidebar-group-label.component.ts +4 -8
  290. package/src/app/lib/components/ui/sidebar/sidebar-group.component.ts +3 -7
  291. package/src/app/lib/components/ui/sidebar/sidebar-header.component.ts +3 -9
  292. package/src/app/lib/components/ui/sidebar/sidebar-input.component.ts +4 -8
  293. package/src/app/lib/components/ui/sidebar/sidebar-inset.component.ts +4 -8
  294. package/src/app/lib/components/ui/sidebar/sidebar-menu-action.component.ts +4 -8
  295. package/src/app/lib/components/ui/sidebar/sidebar-menu-badge.component.ts +4 -8
  296. package/src/app/lib/components/ui/sidebar/sidebar-menu-button.component.ts +4 -9
  297. package/src/app/lib/components/ui/sidebar/sidebar-menu-item.component.ts +3 -9
  298. package/src/app/lib/components/ui/sidebar/sidebar-menu-skeleton.component.ts +6 -11
  299. package/src/app/lib/components/ui/sidebar/sidebar-menu-sub-button.component.ts +4 -8
  300. package/src/app/lib/components/ui/sidebar/sidebar-menu-sub-item.component.ts +2 -6
  301. package/src/app/lib/components/ui/sidebar/sidebar-menu-sub.component.ts +4 -8
  302. package/src/app/lib/components/ui/sidebar/sidebar-menu.component.ts +3 -7
  303. package/src/app/lib/components/ui/sidebar/sidebar-provider.component.ts +46 -52
  304. package/src/app/lib/components/ui/sidebar/sidebar-rail.component.ts +6 -11
  305. package/src/app/lib/components/ui/sidebar/sidebar-route-active.service.ts +17 -17
  306. package/src/app/lib/components/ui/sidebar/sidebar-separator.component.ts +3 -7
  307. package/src/app/lib/components/ui/sidebar/sidebar-trigger.component.ts +6 -11
  308. package/src/app/lib/components/ui/sidebar/sidebar.component.ts +20 -31
  309. package/src/app/lib/components/ui/skeleton/skeleton.component.ts +3 -8
  310. package/src/app/lib/components/ui/slider/index.ts +1 -6
  311. package/src/app/lib/components/ui/slider/slider.component.ts +73 -138
  312. package/src/app/lib/components/ui/spinner/index.ts +0 -1
  313. package/src/app/lib/components/ui/spinner/spinner-variants.ts +19 -22
  314. package/src/app/lib/components/ui/spinner/spinner.component.ts +4 -8
  315. package/src/app/lib/components/ui/switch/index.ts +1 -6
  316. package/src/app/lib/components/ui/switch/switch.component.ts +83 -108
  317. package/src/app/lib/components/ui/table/index.ts +0 -1
  318. package/src/app/lib/components/ui/table/table-body.component.ts +6 -10
  319. package/src/app/lib/components/ui/table/table-caption.component.ts +6 -8
  320. package/src/app/lib/components/ui/table/table-cell.component.ts +4 -8
  321. package/src/app/lib/components/ui/table/table-footer.component.ts +6 -8
  322. package/src/app/lib/components/ui/table/table-head.component.ts +4 -8
  323. package/src/app/lib/components/ui/table/table-header.component.ts +6 -10
  324. package/src/app/lib/components/ui/table/table-row.component.ts +6 -11
  325. package/src/app/lib/components/ui/table/table.component.ts +4 -8
  326. package/src/app/lib/components/ui/tabs/index.ts +14 -7
  327. package/src/app/lib/components/ui/tabs/tabs-content.component.ts +11 -36
  328. package/src/app/lib/components/ui/tabs/tabs-context.ts +0 -8
  329. package/src/app/lib/components/ui/tabs/tabs-list.component.ts +54 -60
  330. package/src/app/lib/components/ui/tabs/tabs-trigger.component.ts +20 -35
  331. package/src/app/lib/components/ui/tabs/tabs.component.ts +32 -49
  332. package/src/app/lib/components/ui/textarea/textarea.component.ts +3 -8
  333. package/src/app/lib/components/ui/toast/index.ts +6 -7
  334. package/src/app/lib/components/ui/toast/toast-action.component.ts +7 -18
  335. package/src/app/lib/components/ui/toast/toast-description.component.ts +2 -11
  336. package/src/app/lib/components/ui/toast/toast-title.component.ts +2 -9
  337. package/src/app/lib/components/ui/toast/toast-variants.ts +1 -1
  338. package/src/app/lib/components/ui/toast/toast.component.ts +18 -24
  339. package/src/app/lib/components/ui/toast/toast.service.ts +22 -37
  340. package/src/app/lib/components/ui/toast/toaster.component.ts +6 -16
  341. package/src/app/lib/components/ui/toggle/index.ts +1 -5
  342. package/src/app/lib/components/ui/toggle/toggle-variants.ts +2 -2
  343. package/src/app/lib/components/ui/toggle/toggle.component.ts +32 -51
  344. package/src/app/lib/components/ui/toggle-group/index.ts +1 -4
  345. package/src/app/lib/components/ui/toggle-group/toggle-group-context.ts +1 -7
  346. package/src/app/lib/components/ui/toggle-group/toggle-group-item.component.ts +38 -59
  347. package/src/app/lib/components/ui/toggle-group/toggle-group.component.ts +33 -51
  348. package/src/app/lib/components/ui/tooltip/index.ts +9 -6
  349. package/src/app/lib/components/ui/tooltip/tooltip-content.component.ts +6 -24
  350. package/src/app/lib/components/ui/tooltip/tooltip-context.ts +0 -8
  351. package/src/app/lib/components/ui/tooltip/tooltip-provider.component.ts +12 -24
  352. package/src/app/lib/components/ui/tooltip/tooltip-trigger.component.ts +4 -21
  353. package/src/app/lib/components/ui/tooltip/tooltip.component.ts +21 -33
  354. package/src/app/lib/components/ui/typography/index.ts +0 -1
  355. package/src/app/lib/components/ui/typography/typography-blockquote.component.ts +3 -7
  356. package/src/app/lib/components/ui/typography/typography-h1.component.ts +3 -10
  357. package/src/app/lib/components/ui/typography/typography-h2.component.ts +3 -10
  358. package/src/app/lib/components/ui/typography/typography-h3.component.ts +3 -7
  359. package/src/app/lib/components/ui/typography/typography-h4.component.ts +3 -7
  360. package/src/app/lib/components/ui/typography/typography-inline-code.component.ts +4 -8
  361. package/src/app/lib/components/ui/typography/typography-large.component.ts +3 -9
  362. package/src/app/lib/components/ui/typography/typography-lead.component.ts +3 -7
  363. package/src/app/lib/components/ui/typography/typography-list.component.ts +3 -7
  364. package/src/app/lib/components/ui/typography/typography-muted.component.ts +3 -7
  365. package/src/app/lib/components/ui/typography/typography-p.component.ts +3 -7
  366. package/src/app/lib/components/ui/typography/typography-small.component.ts +3 -7
  367. package/src/app/lib/utils/accessibility/click-outside.directive.ts +1 -8
  368. package/src/app/lib/utils/accessibility/focus-management.service.ts +4 -15
  369. package/src/app/lib/utils/accessibility/focus-trap.directive.ts +32 -106
  370. package/src/app/lib/utils/accessibility/index.ts +16 -5
  371. package/src/app/lib/utils/accessibility/keyboard-navigation.directive.ts +5 -8
  372. package/src/app/lib/utils/accessibility/live-region.directive.ts +10 -13
  373. package/src/app/lib/utils/accessibility/touch-target.directive.ts +1 -8
  374. package/src/app/lib/utils/animation/animation.utils.ts +4 -7
  375. package/src/app/lib/utils/animation/index.ts +15 -5
  376. package/src/app/lib/utils/animation/presence.component.ts +1 -1
  377. package/src/app/lib/utils/animation/presence.directive.ts +2 -2
  378. package/src/app/lib/utils/positioning/index.ts +40 -18
  379. package/src/app/lib/components/ui/index.ts +0 -551
  380. package/src/app/lib/index.ts +0 -7
@@ -1,10 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- input,
7
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
8
3
 
9
4
  /**
10
5
  * SidebarInput component - input field for sidebar.
@@ -13,6 +8,7 @@ import {
13
8
  selector: 'SidebarInput',
14
9
  template: ``,
15
10
  host: {
11
+ 'attr.data-slot': '"sidebar-input"',
16
12
  '[class]': 'computedClass()',
17
13
  'data-sidebar': 'input',
18
14
  },
@@ -25,7 +21,7 @@ export class SidebarInput {
25
21
  protected readonly computedClass = computed(() =>
26
22
  cn(
27
23
  'h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring',
28
- this.class()
29
- )
24
+ this.class(),
25
+ ),
30
26
  );
31
27
  }
@@ -1,10 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- input,
7
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
8
3
 
9
4
  /**
10
5
  * SidebarInset component - main content area next to sidebar.
@@ -13,6 +8,7 @@ import {
13
8
  selector: 'SidebarInset',
14
9
  template: `<ng-content />`,
15
10
  host: {
11
+ 'attr.data-slot': '"sidebar-inset"',
16
12
  '[class]': 'computedClass()',
17
13
  },
18
14
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -25,7 +21,7 @@ export class SidebarInset {
25
21
  cn(
26
22
  'relative flex min-h-svh flex-1 flex-col bg-background',
27
23
  'peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow',
28
- this.class()
29
- )
24
+ this.class(),
25
+ ),
30
26
  );
31
27
  }
@@ -1,10 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- input,
7
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
8
3
 
9
4
  /**
10
5
  * SidebarMenuAction component - action button in menu item.
@@ -16,6 +11,7 @@ import {
16
11
  selector: 'SidebarMenuAction',
17
12
  template: `<ng-content />`,
18
13
  host: {
14
+ 'attr.data-slot': '"sidebar-menu-action"',
19
15
  '[class]': 'computedClass()',
20
16
  'data-sidebar': 'menu-action',
21
17
  '[attr.role]': '"button"',
@@ -50,7 +46,7 @@ export class SidebarMenuAction {
50
46
  // Show on hover behavior
51
47
  this.showOnHover() &&
52
48
  'group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0',
53
- this.class()
54
- )
49
+ this.class(),
50
+ ),
55
51
  );
56
52
  }
@@ -1,10 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- input,
7
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
8
3
 
9
4
  /**
10
5
  * SidebarMenuBadge component - badge in menu item.
@@ -16,6 +11,7 @@ import {
16
11
  selector: 'SidebarMenuBadge',
17
12
  template: `<ng-content />`,
18
13
  host: {
14
+ 'attr.data-slot': '"sidebar-menu-badge"',
19
15
  '[class]': 'computedClass()',
20
16
  'data-sidebar': 'menu-badge',
21
17
  },
@@ -36,7 +32,7 @@ export class SidebarMenuBadge {
36
32
  'peer-data-[size=lg]/menu-button:top-2.5',
37
33
  // Hide in collapsed icon mode
38
34
  'group-data-[collapsible=icon]/sidebar-wrapper:hidden',
39
- this.class()
40
- )
35
+ this.class(),
36
+ ),
41
37
  );
42
38
  }
@@ -1,10 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- input,
7
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
8
3
  import type { AriaCurrentValue } from './sidebar-context';
9
4
 
10
5
  /**
@@ -17,6 +12,7 @@ import type { AriaCurrentValue } from './sidebar-context';
17
12
  selector: 'SidebarMenuButton',
18
13
  template: `<ng-content />`,
19
14
  host: {
15
+ 'attr.data-slot': '"sidebar-menu-button"',
20
16
  '[class]': 'computedClass()',
21
17
  'data-sidebar': 'menu-button',
22
18
  '[attr.data-size]': 'size()',
@@ -57,8 +53,7 @@ export class SidebarMenuButton {
57
53
  'group-data-[collapsible=icon]/sidebar-wrapper:!size-8 group-data-[collapsible=icon]/sidebar-wrapper:!p-2',
58
54
  this.size() === 'sm' && 'text-xs px-2 py-1.5',
59
55
  this.size() === 'lg' && 'text-sm group-data-[collapsible=icon]/sidebar-wrapper:!p-0',
60
- this.class()
61
- )
56
+ this.class(),
57
+ ),
62
58
  );
63
59
  }
64
-
@@ -1,10 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- input,
7
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
8
3
 
9
4
  /**
10
5
  * SidebarMenuItem component - individual menu item.
@@ -16,6 +11,7 @@ import {
16
11
  selector: 'SidebarMenuItem',
17
12
  template: `<ng-content />`,
18
13
  host: {
14
+ 'attr.data-slot': '"sidebar-menu-item"',
19
15
  '[class]': 'computedClass()',
20
16
  'data-sidebar': 'menu-item',
21
17
  '[attr.role]': '"presentation"',
@@ -26,7 +22,5 @@ export class SidebarMenuItem {
26
22
  /** Additional CSS classes */
27
23
  readonly class = input<string>('');
28
24
 
29
- protected readonly computedClass = computed(() =>
30
- cn('group/menu-item relative', this.class())
31
- );
25
+ protected readonly computedClass = computed(() => cn('group/menu-item relative', this.class()));
32
26
  }
@@ -1,10 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- input,
7
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
8
3
 
9
4
  /**
10
5
  * SidebarMenuSkeleton component - loading skeleton for menu items.
@@ -18,22 +13,22 @@ import {
18
13
  ></div>
19
14
  `,
20
15
  host: {
16
+ 'attr.data-slot': '"sidebar-menu-skeleton"',
21
17
  '[class]': 'computedClass()',
22
18
  'data-sidebar': 'menu-skeleton',
23
19
  },
24
20
  changeDetection: ChangeDetectionStrategy.OnPush,
25
21
  })
26
22
  export class SidebarMenuSkeleton {
27
- /** Width of the skeleton */
28
- readonly width = Math.floor(Math.random() * 40) + 50;
29
-
30
23
  /** Whether to show icon skeleton */
31
24
  readonly showIcon = input<boolean>(false);
32
-
33
25
  /** Additional CSS classes */
34
26
  readonly class = input<string>('');
35
27
 
36
28
  protected readonly computedClass = computed(() =>
37
- cn('rounded-md h-8 flex gap-2 px-2 items-center', this.class())
29
+ cn('rounded-md h-8 flex gap-2 px-2 items-center', this.class()),
38
30
  );
31
+
32
+ /** Width of the skeleton */
33
+ readonly width = Math.floor(Math.random() * 40) + 50;
39
34
  }
@@ -1,10 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- input,
7
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
8
3
  import type { AriaCurrentValue } from './sidebar-context';
9
4
 
10
5
  /**
@@ -17,6 +12,7 @@ import type { AriaCurrentValue } from './sidebar-context';
17
12
  selector: 'SidebarMenuSubButton',
18
13
  template: `<ng-content />`,
19
14
  host: {
15
+ 'attr.data-slot': '"sidebar-menu-sub-button"',
20
16
  '[class]': 'computedClass()',
21
17
  'data-sidebar': 'menu-sub-button',
22
18
  '[attr.data-size]': 'size()',
@@ -53,7 +49,7 @@ export class SidebarMenuSubButton {
53
49
  '[&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',
54
50
  this.size() === 'sm' && 'text-xs',
55
51
  this.size() === 'md' && 'text-sm',
56
- this.class()
57
- )
52
+ this.class(),
53
+ ),
58
54
  );
59
55
  }
@@ -1,10 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- input,
7
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
8
3
 
9
4
  /**
10
5
  * SidebarMenuSubItem component - item in submenu.
@@ -13,6 +8,7 @@ import {
13
8
  selector: 'SidebarMenuSubItem',
14
9
  template: `<ng-content />`,
15
10
  host: {
11
+ 'attr.data-slot': '"sidebar-menu-sub-item"',
16
12
  '[class]': 'computedClass()',
17
13
  },
18
14
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -1,10 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- input,
7
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
8
3
 
9
4
  /**
10
5
  * SidebarMenuSub component - submenu container.
@@ -13,6 +8,7 @@ import {
13
8
  selector: 'SidebarMenuSub',
14
9
  template: `<ng-content />`,
15
10
  host: {
11
+ 'attr.data-slot': '"sidebar-menu-sub"',
16
12
  '[class]': 'computedClass()',
17
13
  'data-sidebar': 'menu-sub',
18
14
  },
@@ -26,7 +22,7 @@ export class SidebarMenuSub {
26
22
  cn(
27
23
  'mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5',
28
24
  'group-data-[collapsible=icon]/sidebar-wrapper:hidden',
29
- this.class()
30
- )
25
+ this.class(),
26
+ ),
31
27
  );
32
28
  }
@@ -1,10 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- input,
7
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
8
3
 
9
4
  /**
10
5
  * SidebarMenu component - menu container in sidebar.
@@ -15,6 +10,7 @@ import {
15
10
  selector: 'SidebarMenu',
16
11
  template: `<ng-content />`,
17
12
  host: {
13
+ 'attr.data-slot': '"sidebar-menu"',
18
14
  '[class]': 'computedClass()',
19
15
  'data-sidebar': 'menu',
20
16
  '[attr.role]': '"menu"',
@@ -26,6 +22,6 @@ export class SidebarMenu {
26
22
  readonly class = input<string>('');
27
23
 
28
24
  protected readonly computedClass = computed(() =>
29
- cn('flex w-full min-w-0 flex-col gap-1', this.class())
25
+ cn('flex w-full min-w-0 flex-col gap-1', this.class()),
30
26
  );
31
27
  }
@@ -1,25 +1,25 @@
1
1
  import { cn } from '@/lib/utils';
2
2
  import {
3
- afterNextRender,
4
- booleanAttribute,
5
- ChangeDetectionStrategy,
6
- Component,
7
- computed,
8
- effect,
9
- forwardRef,
10
- HostListener,
11
- input,
12
- model,
13
- output,
14
- signal,
3
+ afterNextRender,
4
+ booleanAttribute,
5
+ ChangeDetectionStrategy,
6
+ Component,
7
+ computed,
8
+ effect,
9
+ forwardRef,
10
+ HostListener,
11
+ input,
12
+ model,
13
+ output,
14
+ signal,
15
15
  } from '@angular/core';
16
16
  import {
17
- SIDEBAR_CONTEXT,
18
- SIDEBAR_KEYBOARD_SHORTCUT,
19
- SIDEBAR_WIDTH,
20
- SIDEBAR_WIDTH_ICON,
21
- type SidebarContext,
22
- type SidebarState,
17
+ SIDEBAR_CONTEXT,
18
+ SIDEBAR_KEYBOARD_SHORTCUT,
19
+ SIDEBAR_WIDTH,
20
+ SIDEBAR_WIDTH_ICON,
21
+ type SidebarContext,
22
+ type SidebarState,
23
23
  } from './sidebar-context';
24
24
 
25
25
  /**
@@ -41,6 +41,7 @@ import {
41
41
  selector: 'SidebarProvider',
42
42
  template: `<ng-content />`,
43
43
  host: {
44
+ 'attr.data-slot': '"sidebar-provider"',
44
45
  '[class]': 'computedClass()',
45
46
  '[style.--sidebar-width]': 'sidebarWidth',
46
47
  '[style.--sidebar-width-icon]': 'SIDEBAR_WIDTH_ICON',
@@ -56,23 +57,42 @@ import {
56
57
  changeDetection: ChangeDetectionStrategy.OnPush,
57
58
  })
58
59
  export class SidebarProvider {
59
- /** Default open state */
60
- readonly defaultOpen = input<boolean, unknown>(true, {
61
- transform: booleanAttribute,
62
- });
60
+ constructor() {
61
+ // Check for mobile on init (browser-only)
62
+ afterNextRender(() => {
63
+ this.checkMobile();
64
+ });
63
65
 
64
- /** Controlled open state */
65
- readonly open = model<boolean>(true);
66
+ // Sync open state
67
+ effect(() => {
68
+ const openValue = this.open();
69
+ this.context.open.set(openValue);
70
+ this.context.state.set(openValue ? 'expanded' : 'collapsed');
71
+ });
72
+ }
66
73
 
67
74
  /** Open state change event */
68
75
  readonly openChange = output<boolean>();
69
76
 
77
+ /** Controlled open state */
78
+ readonly open = model<boolean>(true);
79
+
80
+ /** Default open state */
81
+ readonly defaultOpen = input<boolean, unknown>(true, {
82
+ transform: booleanAttribute,
83
+ });
70
84
  /** Additional CSS classes */
71
85
  readonly class = input<string>('');
72
86
 
87
+ protected readonly computedClass = computed(() =>
88
+ cn(
89
+ 'group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar',
90
+ this.class(),
91
+ ),
92
+ );
93
+
73
94
  protected readonly SIDEBAR_WIDTH_ICON = SIDEBAR_WIDTH_ICON;
74
95
  protected readonly sidebarWidth = SIDEBAR_WIDTH;
75
-
76
96
  /** Context for child components */
77
97
  readonly context: SidebarContext = {
78
98
  state: signal<SidebarState>('expanded'),
@@ -97,45 +117,19 @@ export class SidebarProvider {
97
117
  },
98
118
  };
99
119
 
100
- constructor() {
101
- // Check for mobile on init (browser-only)
102
- afterNextRender(() => {
103
- this.checkMobile();
104
- });
105
-
106
- // Sync open state
107
- effect(() => {
108
- const openValue = this.open();
109
- this.context.open.set(openValue);
110
- this.context.state.set(openValue ? 'expanded' : 'collapsed');
111
- });
112
- }
113
-
114
120
  @HostListener('window:resize')
115
121
  protected onResize(): void {
116
122
  this.checkMobile();
117
123
  }
118
-
119
124
  @HostListener('document:keydown', ['$event'])
120
125
  protected onKeydown(event: KeyboardEvent): void {
121
- if (
122
- event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
123
- (event.metaKey || event.ctrlKey)
124
- ) {
126
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
125
127
  event.preventDefault();
126
128
  this.context.toggleSidebar();
127
129
  }
128
130
  }
129
-
130
131
  private checkMobile(): void {
131
132
  const isMobile = typeof window !== 'undefined' && window.innerWidth < 768;
132
133
  this.context.isMobile.set(isMobile);
133
134
  }
134
-
135
- protected readonly computedClass = computed(() =>
136
- cn(
137
- 'group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar',
138
- this.class()
139
- )
140
- );
141
135
  }
@@ -1,11 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- inject,
7
- input,
8
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';
9
3
  import { SIDEBAR_CONTEXT } from './sidebar-context';
10
4
 
11
5
  /**
@@ -15,6 +9,7 @@ import { SIDEBAR_CONTEXT } from './sidebar-context';
15
9
  selector: 'SidebarRail',
16
10
  template: ``,
17
11
  host: {
12
+ 'attr.data-slot': '"sidebar-rail"',
18
13
  '[class]': 'computedClass()',
19
14
  '[attr.aria-label]': '"Toggle Sidebar"',
20
15
  '[attr.tabindex]': '-1',
@@ -24,11 +19,11 @@ import { SIDEBAR_CONTEXT } from './sidebar-context';
24
19
  changeDetection: ChangeDetectionStrategy.OnPush,
25
20
  })
26
21
  export class SidebarRail {
27
- protected readonly context = inject(SIDEBAR_CONTEXT);
28
-
29
22
  /** Additional CSS classes */
30
23
  readonly class = input<string>('');
31
24
 
25
+ protected readonly context = inject(SIDEBAR_CONTEXT);
26
+
32
27
  protected readonly computedClass = computed(() =>
33
28
  cn(
34
29
  'absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]/sidebar-wrapper:right-0 group-data-[side=right]/sidebar-wrapper:left-0 sm:flex',
@@ -37,8 +32,8 @@ export class SidebarRail {
37
32
  'group-data-[collapsible=offcanvas]/sidebar-wrapper:translate-x-0 group-data-[collapsible=offcanvas]/sidebar-wrapper:after:left-full group-data-[collapsible=offcanvas]/sidebar-wrapper:hover:bg-sidebar',
38
33
  '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',
39
34
  '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',
40
- this.class()
41
- )
35
+ this.class(),
36
+ ),
42
37
  );
43
38
 
44
39
  protected onClick(): void {
@@ -16,26 +16,26 @@ import { filter, map } from 'rxjs';
16
16
  providedIn: 'root',
17
17
  })
18
18
  export class SidebarRouteActiveService {
19
- private readonly router = inject(Router);
20
-
21
- /** Current active route */
22
- readonly currentRoute = signal<string>('');
23
-
24
19
  constructor() {
25
20
  // Initialize with current route
26
21
  this.updateCurrentRoute();
27
22
 
28
23
  // Subscribe to route changes
29
- this.router.events
24
+ this._router.events
30
25
  .pipe(
31
- filter(event => event instanceof NavigationEnd),
32
- map((event: NavigationEnd) => event.urlAfterRedirects || event.url)
26
+ filter((event) => event instanceof NavigationEnd),
27
+ map((event: NavigationEnd) => event.urlAfterRedirects || event.url),
33
28
  )
34
- .subscribe(url => {
29
+ .subscribe((url) => {
35
30
  this.currentRoute.set(url);
36
31
  });
37
32
  }
38
33
 
34
+ private readonly _router = inject(Router);
35
+
36
+ /** Current active route */
37
+ readonly currentRoute = signal<string>('');
38
+
39
39
  /**
40
40
  * Check if a route is currently active.
41
41
  * Supports both exact and partial matching.
@@ -61,7 +61,6 @@ export class SidebarRouteActiveService {
61
61
 
62
62
  return normalizedCurrent.startsWith(normalizedRoute);
63
63
  }
64
-
65
64
  /**
66
65
  * Check if any of the provided routes is active.
67
66
  *
@@ -73,9 +72,8 @@ export class SidebarRouteActiveService {
73
72
  * isAnyRouteActive(['dashboard', 'analytics'])
74
73
  */
75
74
  isAnyRouteActive(routes: string[], exact: boolean = false): boolean {
76
- return routes.some(route => this.isRouteActive(route, exact));
75
+ return routes.some((route) => this.isRouteActive(route, exact));
77
76
  }
78
-
79
77
  /**
80
78
  * Get the current route segment (the main route without parameters).
81
79
  *
@@ -86,10 +84,11 @@ export class SidebarRouteActiveService {
86
84
  * getMainRoute() // returns '/dashboard'
87
85
  */
88
86
  getMainRoute(): string {
89
- const parts = this.currentRoute().split('/').filter(p => p);
87
+ const parts = this.currentRoute()
88
+ .split('/')
89
+ .filter((p) => p);
90
90
  return parts.length > 0 ? `/${parts[0]}` : '';
91
91
  }
92
-
93
92
  /**
94
93
  * Get the current route level.
95
94
  *
@@ -100,7 +99,9 @@ export class SidebarRouteActiveService {
100
99
  * getRouteLevel() // returns 2
101
100
  */
102
101
  getRouteLevel(): number {
103
- return this.currentRoute().split('/').filter(p => p).length;
102
+ return this.currentRoute()
103
+ .split('/')
104
+ .filter((p) => p).length;
104
105
  }
105
106
 
106
107
  /**
@@ -112,13 +113,12 @@ export class SidebarRouteActiveService {
112
113
  private normalize(route: string): string {
113
114
  return `/${route}`.replace(/\/$/, '').toLowerCase();
114
115
  }
115
-
116
116
  /**
117
117
  * Update the current route based on the router's current URL.
118
118
  *
119
119
  * @private
120
120
  */
121
121
  private updateCurrentRoute(): void {
122
- this.currentRoute.set(this.router.url);
122
+ this.currentRoute.set(this._router.url);
123
123
  }
124
124
  }
@@ -1,10 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- input,
7
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
8
3
 
9
4
  /**
10
5
  * SidebarSeparator component - separator line in sidebar.
@@ -13,6 +8,7 @@ import {
13
8
  selector: 'SidebarSeparator',
14
9
  template: ``,
15
10
  host: {
11
+ 'attr.data-slot': '"sidebar-separator"',
16
12
  '[class]': 'computedClass()',
17
13
  'data-sidebar': 'separator',
18
14
  },
@@ -23,6 +19,6 @@ export class SidebarSeparator {
23
19
  readonly class = input<string>('');
24
20
 
25
21
  protected readonly computedClass = computed(() =>
26
- cn('mx-2 w-auto bg-sidebar-border', this.class())
22
+ cn('mx-2 w-auto bg-sidebar-border', this.class()),
27
23
  );
28
24
  }
@@ -1,11 +1,5 @@
1
1
  import { cn } from '@/lib/utils';
2
- import {
3
- ChangeDetectionStrategy,
4
- Component,
5
- computed,
6
- inject,
7
- input,
8
- } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';
9
3
  import { SIDEBAR_CONTEXT } from './sidebar-context';
10
4
 
11
5
  /**
@@ -33,22 +27,23 @@ import { SIDEBAR_CONTEXT } from './sidebar-context';
33
27
  <ng-content />
34
28
  `,
35
29
  host: {
30
+ 'attr.data-slot': '"sidebar-trigger"',
36
31
  '[class]': 'computedClass()',
37
32
  '(click)': 'onClick()',
38
33
  },
39
34
  changeDetection: ChangeDetectionStrategy.OnPush,
40
35
  })
41
36
  export class SidebarTrigger {
42
- protected readonly context = inject(SIDEBAR_CONTEXT);
43
-
44
37
  /** Additional CSS classes */
45
38
  readonly class = input<string>('');
46
39
 
40
+ protected readonly context = inject(SIDEBAR_CONTEXT);
41
+
47
42
  protected readonly computedClass = computed(() =>
48
43
  cn(
49
44
  'inline-flex h-7 w-7 items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
50
- this.class()
51
- )
45
+ this.class(),
46
+ ),
52
47
  );
53
48
 
54
49
  protected onClick(): void {