@loomui-ng/ui 0.0.0-stage → 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 (270) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +46 -2
  3. package/accordion/README.md +38 -0
  4. package/alert/README.md +32 -0
  5. package/alert-dialog/README.md +37 -0
  6. package/aspect-ratio/README.md +24 -0
  7. package/attachment/README.md +40 -0
  8. package/avatar/README.md +34 -0
  9. package/badge/README.md +29 -0
  10. package/breadcrumb/README.md +33 -0
  11. package/bubble/README.md +32 -0
  12. package/button/README.md +31 -0
  13. package/button-group/README.md +30 -0
  14. package/calendar/README.md +35 -0
  15. package/card/README.md +41 -0
  16. package/carousel/README.md +41 -0
  17. package/chart/README.md +25 -0
  18. package/checkbox/README.md +31 -0
  19. package/collapsible/README.md +31 -0
  20. package/combobox/README.md +47 -0
  21. package/command/README.md +44 -0
  22. package/context-menu/README.md +36 -0
  23. package/data-table/README.md +39 -0
  24. package/date-picker/README.md +23 -0
  25. package/dialog/README.md +52 -0
  26. package/direction/README.md +19 -0
  27. package/drawer/README.md +37 -0
  28. package/dropdown-menu/README.md +46 -0
  29. package/empty/README.md +38 -0
  30. package/fesm2022/loomui-ng-ui-accordion.mjs +555 -0
  31. package/fesm2022/loomui-ng-ui-accordion.mjs.map +1 -0
  32. package/fesm2022/loomui-ng-ui-alert-dialog.mjs +652 -0
  33. package/fesm2022/loomui-ng-ui-alert-dialog.mjs.map +1 -0
  34. package/fesm2022/loomui-ng-ui-alert.mjs +286 -0
  35. package/fesm2022/loomui-ng-ui-alert.mjs.map +1 -0
  36. package/fesm2022/loomui-ng-ui-aspect-ratio.mjs +97 -0
  37. package/fesm2022/loomui-ng-ui-aspect-ratio.mjs.map +1 -0
  38. package/fesm2022/loomui-ng-ui-attachment.mjs +713 -0
  39. package/fesm2022/loomui-ng-ui-attachment.mjs.map +1 -0
  40. package/fesm2022/loomui-ng-ui-avatar.mjs +561 -0
  41. package/fesm2022/loomui-ng-ui-avatar.mjs.map +1 -0
  42. package/fesm2022/loomui-ng-ui-badge.mjs +102 -0
  43. package/fesm2022/loomui-ng-ui-badge.mjs.map +1 -0
  44. package/fesm2022/loomui-ng-ui-breadcrumb.mjs +520 -0
  45. package/fesm2022/loomui-ng-ui-breadcrumb.mjs.map +1 -0
  46. package/fesm2022/loomui-ng-ui-bubble.mjs +386 -0
  47. package/fesm2022/loomui-ng-ui-bubble.mjs.map +1 -0
  48. package/fesm2022/loomui-ng-ui-button-group.mjs +193 -0
  49. package/fesm2022/loomui-ng-ui-button-group.mjs.map +1 -0
  50. package/fesm2022/loomui-ng-ui-button.mjs +162 -0
  51. package/fesm2022/loomui-ng-ui-button.mjs.map +1 -0
  52. package/fesm2022/loomui-ng-ui-calendar.mjs +681 -0
  53. package/fesm2022/loomui-ng-ui-calendar.mjs.map +1 -0
  54. package/fesm2022/loomui-ng-ui-card.mjs +461 -0
  55. package/fesm2022/loomui-ng-ui-card.mjs.map +1 -0
  56. package/fesm2022/loomui-ng-ui-carousel.mjs +532 -0
  57. package/fesm2022/loomui-ng-ui-carousel.mjs.map +1 -0
  58. package/fesm2022/loomui-ng-ui-chart.mjs +373 -0
  59. package/fesm2022/loomui-ng-ui-chart.mjs.map +1 -0
  60. package/fesm2022/loomui-ng-ui-checkbox.mjs +265 -0
  61. package/fesm2022/loomui-ng-ui-checkbox.mjs.map +1 -0
  62. package/fesm2022/loomui-ng-ui-collapsible.mjs +274 -0
  63. package/fesm2022/loomui-ng-ui-collapsible.mjs.map +1 -0
  64. package/fesm2022/loomui-ng-ui-combobox.mjs +971 -0
  65. package/fesm2022/loomui-ng-ui-combobox.mjs.map +1 -0
  66. package/fesm2022/loomui-ng-ui-command.mjs +982 -0
  67. package/fesm2022/loomui-ng-ui-command.mjs.map +1 -0
  68. package/fesm2022/loomui-ng-ui-context-menu.mjs +1359 -0
  69. package/fesm2022/loomui-ng-ui-context-menu.mjs.map +1 -0
  70. package/fesm2022/loomui-ng-ui-data-table.mjs +535 -0
  71. package/fesm2022/loomui-ng-ui-data-table.mjs.map +1 -0
  72. package/fesm2022/loomui-ng-ui-date-picker.mjs +312 -0
  73. package/fesm2022/loomui-ng-ui-date-picker.mjs.map +1 -0
  74. package/fesm2022/loomui-ng-ui-dialog.mjs +508 -0
  75. package/fesm2022/loomui-ng-ui-dialog.mjs.map +1 -0
  76. package/fesm2022/loomui-ng-ui-direction.mjs +112 -0
  77. package/fesm2022/loomui-ng-ui-direction.mjs.map +1 -0
  78. package/fesm2022/loomui-ng-ui-drawer.mjs +590 -0
  79. package/fesm2022/loomui-ng-ui-drawer.mjs.map +1 -0
  80. package/fesm2022/loomui-ng-ui-dropdown-menu.mjs +1322 -0
  81. package/fesm2022/loomui-ng-ui-dropdown-menu.mjs.map +1 -0
  82. package/fesm2022/loomui-ng-ui-empty.mjs +408 -0
  83. package/fesm2022/loomui-ng-ui-empty.mjs.map +1 -0
  84. package/fesm2022/loomui-ng-ui-field.mjs +630 -0
  85. package/fesm2022/loomui-ng-ui-field.mjs.map +1 -0
  86. package/fesm2022/loomui-ng-ui-hover-card.mjs +230 -0
  87. package/fesm2022/loomui-ng-ui-hover-card.mjs.map +1 -0
  88. package/fesm2022/loomui-ng-ui-icon.mjs +498 -0
  89. package/fesm2022/loomui-ng-ui-icon.mjs.map +1 -0
  90. package/fesm2022/loomui-ng-ui-input-group.mjs +463 -0
  91. package/fesm2022/loomui-ng-ui-input-group.mjs.map +1 -0
  92. package/fesm2022/loomui-ng-ui-input-otp.mjs +586 -0
  93. package/fesm2022/loomui-ng-ui-input-otp.mjs.map +1 -0
  94. package/fesm2022/loomui-ng-ui-input.mjs +289 -0
  95. package/fesm2022/loomui-ng-ui-input.mjs.map +1 -0
  96. package/fesm2022/loomui-ng-ui-item.mjs +598 -0
  97. package/fesm2022/loomui-ng-ui-item.mjs.map +1 -0
  98. package/fesm2022/loomui-ng-ui-kbd.mjs +129 -0
  99. package/fesm2022/loomui-ng-ui-kbd.mjs.map +1 -0
  100. package/fesm2022/loomui-ng-ui-label.mjs +68 -0
  101. package/fesm2022/loomui-ng-ui-label.mjs.map +1 -0
  102. package/fesm2022/loomui-ng-ui-marker.mjs +234 -0
  103. package/fesm2022/loomui-ng-ui-marker.mjs.map +1 -0
  104. package/fesm2022/loomui-ng-ui-menubar.mjs +1523 -0
  105. package/fesm2022/loomui-ng-ui-menubar.mjs.map +1 -0
  106. package/fesm2022/loomui-ng-ui-message-scroller.mjs +519 -0
  107. package/fesm2022/loomui-ng-ui-message-scroller.mjs.map +1 -0
  108. package/fesm2022/loomui-ng-ui-message.mjs +408 -0
  109. package/fesm2022/loomui-ng-ui-message.mjs.map +1 -0
  110. package/fesm2022/loomui-ng-ui-native-select.mjs +389 -0
  111. package/fesm2022/loomui-ng-ui-native-select.mjs.map +1 -0
  112. package/fesm2022/loomui-ng-ui-navigation-menu.mjs +609 -0
  113. package/fesm2022/loomui-ng-ui-navigation-menu.mjs.map +1 -0
  114. package/fesm2022/loomui-ng-ui-pagination.mjs +611 -0
  115. package/fesm2022/loomui-ng-ui-pagination.mjs.map +1 -0
  116. package/fesm2022/loomui-ng-ui-popover.mjs +358 -0
  117. package/fesm2022/loomui-ng-ui-popover.mjs.map +1 -0
  118. package/fesm2022/loomui-ng-ui-progress.mjs +159 -0
  119. package/fesm2022/loomui-ng-ui-progress.mjs.map +1 -0
  120. package/fesm2022/loomui-ng-ui-questionnaire.mjs +1012 -0
  121. package/fesm2022/loomui-ng-ui-questionnaire.mjs.map +1 -0
  122. package/fesm2022/loomui-ng-ui-radio-group.mjs +399 -0
  123. package/fesm2022/loomui-ng-ui-radio-group.mjs.map +1 -0
  124. package/fesm2022/loomui-ng-ui-resizable.mjs +518 -0
  125. package/fesm2022/loomui-ng-ui-resizable.mjs.map +1 -0
  126. package/fesm2022/loomui-ng-ui-scroll-area.mjs +135 -0
  127. package/fesm2022/loomui-ng-ui-scroll-area.mjs.map +1 -0
  128. package/fesm2022/loomui-ng-ui-select.mjs +863 -0
  129. package/fesm2022/loomui-ng-ui-select.mjs.map +1 -0
  130. package/fesm2022/loomui-ng-ui-separator.mjs +114 -0
  131. package/fesm2022/loomui-ng-ui-separator.mjs.map +1 -0
  132. package/fesm2022/loomui-ng-ui-sheet.mjs +530 -0
  133. package/fesm2022/loomui-ng-ui-sheet.mjs.map +1 -0
  134. package/fesm2022/loomui-ng-ui-sidebar.mjs +1918 -0
  135. package/fesm2022/loomui-ng-ui-sidebar.mjs.map +1 -0
  136. package/fesm2022/loomui-ng-ui-skeleton.mjs +69 -0
  137. package/fesm2022/loomui-ng-ui-skeleton.mjs.map +1 -0
  138. package/fesm2022/loomui-ng-ui-slider.mjs +390 -0
  139. package/fesm2022/loomui-ng-ui-slider.mjs.map +1 -0
  140. package/fesm2022/loomui-ng-ui-spinner.mjs +85 -0
  141. package/fesm2022/loomui-ng-ui-spinner.mjs.map +1 -0
  142. package/fesm2022/loomui-ng-ui-switch.mjs +212 -0
  143. package/fesm2022/loomui-ng-ui-switch.mjs.map +1 -0
  144. package/fesm2022/loomui-ng-ui-table.mjs +559 -0
  145. package/fesm2022/loomui-ng-ui-table.mjs.map +1 -0
  146. package/fesm2022/loomui-ng-ui-tabs.mjs +544 -0
  147. package/fesm2022/loomui-ng-ui-tabs.mjs.map +1 -0
  148. package/fesm2022/loomui-ng-ui-textarea.mjs +206 -0
  149. package/fesm2022/loomui-ng-ui-textarea.mjs.map +1 -0
  150. package/fesm2022/loomui-ng-ui-toast.mjs +432 -0
  151. package/fesm2022/loomui-ng-ui-toast.mjs.map +1 -0
  152. package/fesm2022/loomui-ng-ui-toggle-group.mjs +477 -0
  153. package/fesm2022/loomui-ng-ui-toggle-group.mjs.map +1 -0
  154. package/fesm2022/loomui-ng-ui-toggle.mjs +219 -0
  155. package/fesm2022/loomui-ng-ui-toggle.mjs.map +1 -0
  156. package/fesm2022/loomui-ng-ui-tooltip.mjs +240 -0
  157. package/fesm2022/loomui-ng-ui-tooltip.mjs.map +1 -0
  158. package/fesm2022/loomui-ng-ui-typography.mjs +129 -0
  159. package/fesm2022/loomui-ng-ui-typography.mjs.map +1 -0
  160. package/fesm2022/loomui-ng-ui-utils.mjs +1533 -0
  161. package/fesm2022/loomui-ng-ui-utils.mjs.map +1 -0
  162. package/fesm2022/loomui-ng-ui.mjs +4 -0
  163. package/fesm2022/loomui-ng-ui.mjs.map +1 -0
  164. package/field/README.md +43 -0
  165. package/hover-card/README.md +31 -0
  166. package/icon/README.md +42 -0
  167. package/input/README.md +26 -0
  168. package/input-group/README.md +40 -0
  169. package/input-otp/README.md +35 -0
  170. package/item/README.md +33 -0
  171. package/kbd/README.md +21 -0
  172. package/label/README.md +24 -0
  173. package/marker/README.md +24 -0
  174. package/menubar/README.md +40 -0
  175. package/message/README.md +32 -0
  176. package/message-scroller/README.md +40 -0
  177. package/native-select/README.md +26 -0
  178. package/navigation-menu/README.md +39 -0
  179. package/package.json +325 -3
  180. package/pagination/README.md +37 -0
  181. package/popover/README.md +37 -0
  182. package/progress/README.md +25 -0
  183. package/questionnaire/README.md +52 -0
  184. package/radio-group/README.md +33 -0
  185. package/resizable/README.md +37 -0
  186. package/scroll-area/README.md +25 -0
  187. package/select/README.md +45 -0
  188. package/separator/README.md +28 -0
  189. package/sheet/README.md +38 -0
  190. package/sidebar/README.md +60 -0
  191. package/skeleton/README.md +21 -0
  192. package/slider/README.md +29 -0
  193. package/spinner/README.md +15 -0
  194. package/styles/loomui.css +330 -0
  195. package/switch/README.md +29 -0
  196. package/table/README.md +31 -0
  197. package/tabs/README.md +42 -0
  198. package/textarea/README.md +28 -0
  199. package/toast/README.md +27 -0
  200. package/toggle/README.md +27 -0
  201. package/toggle-group/README.md +37 -0
  202. package/tooltip/README.md +31 -0
  203. package/types/loomui-ng-ui-accordion.d.ts +141 -0
  204. package/types/loomui-ng-ui-alert-dialog.d.ts +175 -0
  205. package/types/loomui-ng-ui-alert.d.ts +77 -0
  206. package/types/loomui-ng-ui-aspect-ratio.d.ts +31 -0
  207. package/types/loomui-ng-ui-attachment.d.ts +192 -0
  208. package/types/loomui-ng-ui-avatar.d.ts +147 -0
  209. package/types/loomui-ng-ui-badge.d.ts +32 -0
  210. package/types/loomui-ng-ui-breadcrumb.d.ts +118 -0
  211. package/types/loomui-ng-ui-bubble.d.ts +100 -0
  212. package/types/loomui-ng-ui-button-group.d.ts +51 -0
  213. package/types/loomui-ng-ui-button.d.ts +57 -0
  214. package/types/loomui-ng-ui-calendar.d.ts +171 -0
  215. package/types/loomui-ng-ui-card.d.ts +123 -0
  216. package/types/loomui-ng-ui-carousel.d.ts +140 -0
  217. package/types/loomui-ng-ui-chart.d.ts +95 -0
  218. package/types/loomui-ng-ui-checkbox.d.ts +62 -0
  219. package/types/loomui-ng-ui-collapsible.d.ts +74 -0
  220. package/types/loomui-ng-ui-combobox.d.ts +229 -0
  221. package/types/loomui-ng-ui-command.d.ts +231 -0
  222. package/types/loomui-ng-ui-context-menu.d.ts +288 -0
  223. package/types/loomui-ng-ui-data-table.d.ts +111 -0
  224. package/types/loomui-ng-ui-date-picker.d.ts +63 -0
  225. package/types/loomui-ng-ui-dialog.d.ts +127 -0
  226. package/types/loomui-ng-ui-direction.d.ts +42 -0
  227. package/types/loomui-ng-ui-drawer.d.ts +149 -0
  228. package/types/loomui-ng-ui-dropdown-menu.d.ts +258 -0
  229. package/types/loomui-ng-ui-empty.d.ts +109 -0
  230. package/types/loomui-ng-ui-field.d.ts +169 -0
  231. package/types/loomui-ng-ui-hover-card.d.ts +62 -0
  232. package/types/loomui-ng-ui-icon.d.ts +156 -0
  233. package/types/loomui-ng-ui-input-group.d.ts +130 -0
  234. package/types/loomui-ng-ui-input-otp.d.ts +149 -0
  235. package/types/loomui-ng-ui-input.d.ts +89 -0
  236. package/types/loomui-ng-ui-item.d.ts +157 -0
  237. package/types/loomui-ng-ui-kbd.d.ts +36 -0
  238. package/types/loomui-ng-ui-label.d.ts +19 -0
  239. package/types/loomui-ng-ui-marker.d.ts +61 -0
  240. package/types/loomui-ng-ui-menubar.d.ts +321 -0
  241. package/types/loomui-ng-ui-message-scroller.d.ts +138 -0
  242. package/types/loomui-ng-ui-message.d.ts +109 -0
  243. package/types/loomui-ng-ui-native-select.d.ts +84 -0
  244. package/types/loomui-ng-ui-navigation-menu.d.ts +160 -0
  245. package/types/loomui-ng-ui-pagination.d.ts +130 -0
  246. package/types/loomui-ng-ui-popover.d.ts +90 -0
  247. package/types/loomui-ng-ui-progress.d.ts +39 -0
  248. package/types/loomui-ng-ui-questionnaire.d.ts +274 -0
  249. package/types/loomui-ng-ui-radio-group.d.ts +109 -0
  250. package/types/loomui-ng-ui-resizable.d.ts +121 -0
  251. package/types/loomui-ng-ui-scroll-area.d.ts +44 -0
  252. package/types/loomui-ng-ui-select.d.ts +204 -0
  253. package/types/loomui-ng-ui-separator.d.ts +35 -0
  254. package/types/loomui-ng-ui-sheet.d.ts +124 -0
  255. package/types/loomui-ng-ui-sidebar.d.ts +485 -0
  256. package/types/loomui-ng-ui-skeleton.d.ts +20 -0
  257. package/types/loomui-ng-ui-slider.d.ts +103 -0
  258. package/types/loomui-ng-ui-spinner.d.ts +19 -0
  259. package/types/loomui-ng-ui-switch.d.ts +56 -0
  260. package/types/loomui-ng-ui-table.d.ts +148 -0
  261. package/types/loomui-ng-ui-tabs.d.ts +148 -0
  262. package/types/loomui-ng-ui-textarea.d.ts +52 -0
  263. package/types/loomui-ng-ui-toast.d.ts +97 -0
  264. package/types/loomui-ng-ui-toggle-group.d.ts +138 -0
  265. package/types/loomui-ng-ui-toggle.d.ts +63 -0
  266. package/types/loomui-ng-ui-tooltip.d.ts +63 -0
  267. package/types/loomui-ng-ui-typography.d.ts +42 -0
  268. package/types/loomui-ng-ui-utils.d.ts +392 -0
  269. package/types/loomui-ng-ui.d.ts +5 -0
  270. package/typography/README.md +29 -0
@@ -0,0 +1,555 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, Directive, ElementRef, booleanAttribute, computed, contentChildren, effect, forwardRef, inject, input, model, signal, untracked, viewChild } from "@angular/core";
3
+ import { Directionality } from "@angular/cdk/bidi";
4
+ import * as i1 from "@loomui-ng/ui/utils";
5
+ import { UiElementHost, cn, nextId, whenAnimationDone } from "@loomui-ng/ui/utils";
6
+ import { UiIconSvg } from "@loomui-ng/ui/icon";
7
+ const accordionClass = "flex w-full flex-col";
8
+ const accordionItemClass = "not-last:border-b border-b px-4 last:border-b-0";
9
+ const accordionTriggerClass = "group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-start text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring disabled:pointer-events-none disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ms-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground";
10
+ const accordionContentClass = "overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up";
11
+ const UI_ACCORDION_GENERATED = [];
12
+ var UiAccordion = class UiAccordion {
13
+ type = input("single", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
14
+ collapsible = input(true, {
15
+ ...ngDevMode ? { debugName: "collapsible" } : /* istanbul ignore next */ {},
16
+ transform: booleanAttribute
17
+ });
18
+ orientation = input("vertical", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
19
+ value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
20
+ userClass = input("", {
21
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
22
+ alias: "class"
23
+ });
24
+ baseId = nextId("ui-accordion");
25
+ dir = inject(Directionality);
26
+ triggers = contentChildren(forwardRef(() => UiAccordionTrigger), {
27
+ ...ngDevMode ? { debugName: "triggers" } : /* istanbul ignore next */ {},
28
+ descendants: true
29
+ });
30
+ classes = computed(() => cn(accordionClass, this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
31
+ isOpen(v) {
32
+ return this.value().includes(v);
33
+ }
34
+ toggle(v) {
35
+ const open = this.isOpen(v);
36
+ if (this.type() === "multiple") this.value.update((list) => open ? list.filter((x) => x !== v) : [...list, v]);
37
+ else if (open) {
38
+ if (this.collapsible()) this.value.set([]);
39
+ } else this.value.set([v]);
40
+ }
41
+ onKeydown(e) {
42
+ const enabled = this.triggers().filter((t) => !t.isDisabled());
43
+ const i = enabled.findIndex((t) => t.el === document.activeElement);
44
+ if (i < 0) return;
45
+ const horizontal = this.orientation() === "horizontal";
46
+ const rtl = this.dir.value === "rtl";
47
+ const next = horizontal ? rtl ? "ArrowLeft" : "ArrowRight" : "ArrowDown";
48
+ const prev = horizontal ? rtl ? "ArrowRight" : "ArrowLeft" : "ArrowUp";
49
+ let target = -1;
50
+ if (e.key === next) target = (i + 1) % enabled.length;
51
+ else if (e.key === prev) target = (i - 1 + enabled.length) % enabled.length;
52
+ else if (e.key === "Home") target = 0;
53
+ else if (e.key === "End") target = enabled.length - 1;
54
+ if (target >= 0) {
55
+ e.preventDefault();
56
+ enabled[target].el.focus();
57
+ }
58
+ }
59
+ static ɵfac = i0.ɵɵngDeclareFactory({
60
+ minVersion: "12.0.0",
61
+ version: "22.2.2",
62
+ ngImport: i0,
63
+ type: UiAccordion,
64
+ deps: [],
65
+ target: i0.ɵɵFactoryTarget.Directive
66
+ });
67
+ static ɵdir = i0.ɵɵngDeclareDirective({
68
+ minVersion: "17.2.0",
69
+ version: "22.2.2",
70
+ type: UiAccordion,
71
+ isStandalone: true,
72
+ selector: "[uiAccordion], ui-accordion",
73
+ inputs: {
74
+ type: {
75
+ classPropertyName: "type",
76
+ publicName: "type",
77
+ isSignal: true,
78
+ isRequired: false,
79
+ transformFunction: null
80
+ },
81
+ collapsible: {
82
+ classPropertyName: "collapsible",
83
+ publicName: "collapsible",
84
+ isSignal: true,
85
+ isRequired: false,
86
+ transformFunction: null
87
+ },
88
+ orientation: {
89
+ classPropertyName: "orientation",
90
+ publicName: "orientation",
91
+ isSignal: true,
92
+ isRequired: false,
93
+ transformFunction: null
94
+ },
95
+ value: {
96
+ classPropertyName: "value",
97
+ publicName: "value",
98
+ isSignal: true,
99
+ isRequired: false,
100
+ transformFunction: null
101
+ },
102
+ userClass: {
103
+ classPropertyName: "userClass",
104
+ publicName: "class",
105
+ isSignal: true,
106
+ isRequired: false,
107
+ transformFunction: null
108
+ }
109
+ },
110
+ outputs: { value: "valueChange" },
111
+ host: {
112
+ attributes: { "data-slot": "accordion" },
113
+ listeners: { "keydown": "onKeydown($event)" },
114
+ properties: {
115
+ "attr.data-orientation": "orientation()",
116
+ "attr.class": "classes()"
117
+ }
118
+ },
119
+ queries: [{
120
+ propertyName: "triggers",
121
+ predicate: i0.forwardRef(() => UiAccordionTrigger),
122
+ descendants: true,
123
+ isSignal: true
124
+ }],
125
+ exportAs: ["uiAccordion"],
126
+ hostDirectives: [{ directive: i1.UiElementHost }],
127
+ ngImport: i0
128
+ });
129
+ };
130
+ i0.ɵɵngDeclareClassMetadata({
131
+ minVersion: "12.0.0",
132
+ version: "22.2.2",
133
+ ngImport: i0,
134
+ type: UiAccordion,
135
+ decorators: [{
136
+ type: Directive,
137
+ args: [{
138
+ selector: "[uiAccordion], ui-accordion",
139
+ hostDirectives: [UiElementHost],
140
+ exportAs: "uiAccordion",
141
+ host: {
142
+ "data-slot": "accordion",
143
+ "[attr.data-orientation]": "orientation()",
144
+ "[attr.class]": "classes()",
145
+ "(keydown)": "onKeydown($event)"
146
+ }
147
+ }]
148
+ }],
149
+ propDecorators: {
150
+ type: [{
151
+ type: i0.Input,
152
+ args: [{
153
+ isSignal: true,
154
+ alias: "type",
155
+ required: false
156
+ }]
157
+ }],
158
+ collapsible: [{
159
+ type: i0.Input,
160
+ args: [{
161
+ isSignal: true,
162
+ alias: "collapsible",
163
+ required: false
164
+ }]
165
+ }],
166
+ orientation: [{
167
+ type: i0.Input,
168
+ args: [{
169
+ isSignal: true,
170
+ alias: "orientation",
171
+ required: false
172
+ }]
173
+ }],
174
+ value: [{
175
+ type: i0.Input,
176
+ args: [{
177
+ isSignal: true,
178
+ alias: "value",
179
+ required: false
180
+ }]
181
+ }, {
182
+ type: i0.Output,
183
+ args: ["valueChange"]
184
+ }],
185
+ userClass: [{
186
+ type: i0.Input,
187
+ args: [{
188
+ isSignal: true,
189
+ alias: "class",
190
+ required: false
191
+ }]
192
+ }],
193
+ triggers: [{
194
+ type: i0.ContentChildren,
195
+ args: [forwardRef(() => UiAccordionTrigger), {
196
+ descendants: true,
197
+ isSignal: true
198
+ }]
199
+ }]
200
+ }
201
+ });
202
+ var UiAccordionItem = class UiAccordionItem {
203
+ root = inject(UiAccordion);
204
+ value = input("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
205
+ disabled = input(false, {
206
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
207
+ transform: booleanAttribute
208
+ });
209
+ userClass = input("", {
210
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
211
+ alias: "class"
212
+ });
213
+ open = computed(() => this.root.isOpen(this.value()), ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
214
+ triggerId = computed(() => `${this.root.baseId}-trigger-${this.value()}`, ...ngDevMode ? [{ debugName: "triggerId" }] : /* istanbul ignore next */ []);
215
+ contentId = computed(() => `${this.root.baseId}-content-${this.value()}`, ...ngDevMode ? [{ debugName: "contentId" }] : /* istanbul ignore next */ []);
216
+ classes = computed(() => cn(accordionItemClass, this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
217
+ static ɵfac = i0.ɵɵngDeclareFactory({
218
+ minVersion: "12.0.0",
219
+ version: "22.2.2",
220
+ ngImport: i0,
221
+ type: UiAccordionItem,
222
+ deps: [],
223
+ target: i0.ɵɵFactoryTarget.Directive
224
+ });
225
+ static ɵdir = i0.ɵɵngDeclareDirective({
226
+ minVersion: "17.1.0",
227
+ version: "22.2.2",
228
+ type: UiAccordionItem,
229
+ isStandalone: true,
230
+ selector: "[uiAccordionItem], ui-accordion-item",
231
+ inputs: {
232
+ value: {
233
+ classPropertyName: "value",
234
+ publicName: "value",
235
+ isSignal: true,
236
+ isRequired: false,
237
+ transformFunction: null
238
+ },
239
+ disabled: {
240
+ classPropertyName: "disabled",
241
+ publicName: "disabled",
242
+ isSignal: true,
243
+ isRequired: false,
244
+ transformFunction: null
245
+ },
246
+ userClass: {
247
+ classPropertyName: "userClass",
248
+ publicName: "class",
249
+ isSignal: true,
250
+ isRequired: false,
251
+ transformFunction: null
252
+ }
253
+ },
254
+ host: {
255
+ attributes: { "data-slot": "accordion-item" },
256
+ properties: {
257
+ "attr.data-state": "open() ? \"open\" : \"closed\"",
258
+ "attr.data-orientation": "root.orientation()",
259
+ "attr.data-disabled": "disabled() ? \"\" : null",
260
+ "attr.class": "classes()"
261
+ }
262
+ },
263
+ hostDirectives: [{ directive: i1.UiElementHost }],
264
+ ngImport: i0
265
+ });
266
+ };
267
+ i0.ɵɵngDeclareClassMetadata({
268
+ minVersion: "12.0.0",
269
+ version: "22.2.2",
270
+ ngImport: i0,
271
+ type: UiAccordionItem,
272
+ decorators: [{
273
+ type: Directive,
274
+ args: [{
275
+ selector: "[uiAccordionItem], ui-accordion-item",
276
+ hostDirectives: [UiElementHost],
277
+ host: {
278
+ "data-slot": "accordion-item",
279
+ "[attr.data-state]": "open() ? \"open\" : \"closed\"",
280
+ "[attr.data-orientation]": "root.orientation()",
281
+ "[attr.data-disabled]": "disabled() ? \"\" : null",
282
+ "[attr.class]": "classes()"
283
+ }
284
+ }]
285
+ }],
286
+ propDecorators: {
287
+ value: [{
288
+ type: i0.Input,
289
+ args: [{
290
+ isSignal: true,
291
+ alias: "value",
292
+ required: false
293
+ }]
294
+ }],
295
+ disabled: [{
296
+ type: i0.Input,
297
+ args: [{
298
+ isSignal: true,
299
+ alias: "disabled",
300
+ required: false
301
+ }]
302
+ }],
303
+ userClass: [{
304
+ type: i0.Input,
305
+ args: [{
306
+ isSignal: true,
307
+ alias: "class",
308
+ required: false
309
+ }]
310
+ }]
311
+ }
312
+ });
313
+ var UiAccordionTrigger = class UiAccordionTrigger {
314
+ root = inject(UiAccordion);
315
+ item = inject(UiAccordionItem);
316
+ el = inject(ElementRef).nativeElement;
317
+ userClass = input("", {
318
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
319
+ alias: "class"
320
+ });
321
+ isDisabled = () => this.item.disabled();
322
+ classes = computed(() => cn(accordionTriggerClass, this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
323
+ static ɵfac = i0.ɵɵngDeclareFactory({
324
+ minVersion: "12.0.0",
325
+ version: "22.2.2",
326
+ ngImport: i0,
327
+ type: UiAccordionTrigger,
328
+ deps: [],
329
+ target: i0.ɵɵFactoryTarget.Component
330
+ });
331
+ static ɵcmp = i0.ɵɵngDeclareComponent({
332
+ minVersion: "17.1.0",
333
+ version: "22.2.2",
334
+ type: UiAccordionTrigger,
335
+ isStandalone: true,
336
+ selector: "button[uiAccordionTrigger], ui-accordion-trigger",
337
+ inputs: { userClass: {
338
+ classPropertyName: "userClass",
339
+ publicName: "class",
340
+ isSignal: true,
341
+ isRequired: false,
342
+ transformFunction: null
343
+ } },
344
+ host: {
345
+ attributes: {
346
+ "type": "button",
347
+ "data-slot": "accordion-trigger"
348
+ },
349
+ listeners: { "click": "root.toggle(item.value())" },
350
+ properties: {
351
+ "id": "item.triggerId()",
352
+ "attr.aria-expanded": "item.open()",
353
+ "attr.aria-controls": "item.contentId()",
354
+ "attr.data-state": "item.open() ? \"open\" : \"closed\"",
355
+ "attr.data-orientation": "root.orientation()",
356
+ "attr.data-disabled": "isDisabled() ? \"\" : null",
357
+ "attr.disabled": "(isDisabled()) ? \"\" : null",
358
+ "attr.class": "classes()"
359
+ }
360
+ },
361
+ hostDirectives: [{ directive: i1.UiElementHost }],
362
+ ngImport: i0,
363
+ template: `
364
+ <ng-content />
365
+ <svg uiIcon="chevron-down" data-slot="accordion-trigger-icon" class="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"></svg>
366
+ <svg uiIcon="chevron-up" data-slot="accordion-trigger-icon" class="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"></svg>
367
+ `,
368
+ isInline: true,
369
+ dependencies: [{
370
+ kind: "directive",
371
+ type: UiIconSvg,
372
+ selector: "svg[uiIcon]",
373
+ inputs: [
374
+ "uiIcon",
375
+ "icon",
376
+ "size",
377
+ "strokeWidth",
378
+ "absoluteStrokeWidth",
379
+ "color",
380
+ "label",
381
+ "class"
382
+ ]
383
+ }],
384
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
385
+ });
386
+ };
387
+ i0.ɵɵngDeclareClassMetadata({
388
+ minVersion: "12.0.0",
389
+ version: "22.2.2",
390
+ ngImport: i0,
391
+ type: UiAccordionTrigger,
392
+ decorators: [{
393
+ type: Component,
394
+ args: [{
395
+ selector: "button[uiAccordionTrigger], ui-accordion-trigger",
396
+ hostDirectives: [UiElementHost],
397
+ imports: [UiIconSvg],
398
+ changeDetection: ChangeDetectionStrategy.OnPush,
399
+ host: {
400
+ type: "button",
401
+ "data-slot": "accordion-trigger",
402
+ "[id]": "item.triggerId()",
403
+ "[attr.aria-expanded]": "item.open()",
404
+ "[attr.aria-controls]": "item.contentId()",
405
+ "[attr.data-state]": "item.open() ? \"open\" : \"closed\"",
406
+ "[attr.data-orientation]": "root.orientation()",
407
+ "[attr.data-disabled]": "isDisabled() ? \"\" : null",
408
+ "[attr.disabled]": "(isDisabled()) ? \"\" : null",
409
+ "[attr.class]": "classes()",
410
+ "(click)": "root.toggle(item.value())"
411
+ },
412
+ template: `
413
+ <ng-content />
414
+ <svg uiIcon="chevron-down" data-slot="accordion-trigger-icon" class="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"></svg>
415
+ <svg uiIcon="chevron-up" data-slot="accordion-trigger-icon" class="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"></svg>
416
+ `
417
+ }]
418
+ }],
419
+ propDecorators: { userClass: [{
420
+ type: i0.Input,
421
+ args: [{
422
+ isSignal: true,
423
+ alias: "class",
424
+ required: false
425
+ }]
426
+ }] }
427
+ });
428
+ var UiAccordionContent = class UiAccordionContent {
429
+ root = inject(UiAccordion);
430
+ item = inject(UiAccordionItem);
431
+ el = inject(ElementRef).nativeElement;
432
+ inner = viewChild.required("inner", ...ngDevMode ? [{ debugName: "inner" }] : /* istanbul ignore next */ []);
433
+ userClass = input("", {
434
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
435
+ alias: "class"
436
+ });
437
+ present = signal(false, ...ngDevMode ? [{ debugName: "present" }] : /* istanbul ignore next */ []);
438
+ classes = computed(() => cn(accordionContentClass, this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
439
+ constructor() {
440
+ effect(() => {
441
+ const open = this.item.open();
442
+ untracked(() => {
443
+ if (open) {
444
+ this.present.set(true);
445
+ setTimeout(() => this.setHeight(), 0);
446
+ } else if (this.present()) {
447
+ this.setHeight();
448
+ whenAnimationDone(this.el, 400).then(() => !this.item.open() && this.present.set(false));
449
+ }
450
+ });
451
+ });
452
+ }
453
+ setHeight() {
454
+ this.el.style.setProperty("--radix-accordion-content-height", `${this.inner().nativeElement.scrollHeight}px`);
455
+ }
456
+ static ɵfac = i0.ɵɵngDeclareFactory({
457
+ minVersion: "12.0.0",
458
+ version: "22.2.2",
459
+ ngImport: i0,
460
+ type: UiAccordionContent,
461
+ deps: [],
462
+ target: i0.ɵɵFactoryTarget.Component
463
+ });
464
+ static ɵcmp = i0.ɵɵngDeclareComponent({
465
+ minVersion: "17.2.0",
466
+ version: "22.2.2",
467
+ type: UiAccordionContent,
468
+ isStandalone: true,
469
+ selector: "[uiAccordionContent], ui-accordion-content",
470
+ inputs: { userClass: {
471
+ classPropertyName: "userClass",
472
+ publicName: "class",
473
+ isSignal: true,
474
+ isRequired: false,
475
+ transformFunction: null
476
+ } },
477
+ host: {
478
+ attributes: {
479
+ "role": "region",
480
+ "data-slot": "accordion-content"
481
+ },
482
+ properties: {
483
+ "id": "item.contentId()",
484
+ "attr.aria-labelledby": "item.triggerId()",
485
+ "attr.data-state": "item.open() ? \"open\" : \"closed\"",
486
+ "attr.data-orientation": "root.orientation()",
487
+ "attr.data-disabled": "item.disabled() ? \"\" : null",
488
+ "hidden": "!present()",
489
+ "attr.class": "classes()"
490
+ }
491
+ },
492
+ viewQueries: [{
493
+ propertyName: "inner",
494
+ first: true,
495
+ predicate: ["inner"],
496
+ descendants: true,
497
+ isSignal: true
498
+ }],
499
+ hostDirectives: [{ directive: i1.UiElementHost }],
500
+ ngImport: i0,
501
+ template: `<div #inner class="pt-0 pb-2.5"><ng-content /></div>`,
502
+ isInline: true,
503
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
504
+ });
505
+ };
506
+ i0.ɵɵngDeclareClassMetadata({
507
+ minVersion: "12.0.0",
508
+ version: "22.2.2",
509
+ ngImport: i0,
510
+ type: UiAccordionContent,
511
+ decorators: [{
512
+ type: Component,
513
+ args: [{
514
+ selector: "[uiAccordionContent], ui-accordion-content",
515
+ hostDirectives: [UiElementHost],
516
+ changeDetection: ChangeDetectionStrategy.OnPush,
517
+ host: {
518
+ role: "region",
519
+ "data-slot": "accordion-content",
520
+ "[id]": "item.contentId()",
521
+ "[attr.aria-labelledby]": "item.triggerId()",
522
+ "[attr.data-state]": "item.open() ? \"open\" : \"closed\"",
523
+ "[attr.data-orientation]": "root.orientation()",
524
+ "[attr.data-disabled]": "item.disabled() ? \"\" : null",
525
+ "[hidden]": "!present()",
526
+ "[attr.class]": "classes()"
527
+ },
528
+ template: `<div #inner class="pt-0 pb-2.5"><ng-content /></div>`
529
+ }]
530
+ }],
531
+ ctorParameters: () => [],
532
+ propDecorators: {
533
+ inner: [{
534
+ type: i0.ViewChild,
535
+ args: ["inner", { isSignal: true }]
536
+ }],
537
+ userClass: [{
538
+ type: i0.Input,
539
+ args: [{
540
+ isSignal: true,
541
+ alias: "class",
542
+ required: false
543
+ }]
544
+ }]
545
+ }
546
+ });
547
+ const UI_ACCORDION = [
548
+ UiAccordion,
549
+ UiAccordionItem,
550
+ UiAccordionTrigger,
551
+ UiAccordionContent
552
+ ];
553
+ export { UI_ACCORDION, UI_ACCORDION_GENERATED, UiAccordion, UiAccordionContent, UiAccordionItem, UiAccordionTrigger, accordionClass, accordionContentClass, accordionItemClass, accordionTriggerClass };
554
+
555
+ //# sourceMappingURL=loomui-ng-ui-accordion.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loomui-ng-ui-accordion.mjs","names":[],"sources":["../../../libs/ui/accordion/accordion.ts","../../../libs/ui/accordion/accordion.manual.ts"],"sourcesContent":["// GENERATED by tools/gen-ui.mjs from docs/evidence/slots/accordion.json.\n// Change tools/ui-specs.mjs and regenerate; hand-written parts live in ./accordion.manual.ts.\nimport { Directive, computed, input } from '@angular/core';\nimport { cn } from '@loomui-ng/ui/utils';\n\nexport const accordionClass =\n 'flex w-full flex-col';\n\nexport const accordionItemClass =\n 'not-last:border-b border-b px-4 last:border-b-0';\n\nexport const accordionTriggerClass =\n 'group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-start text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring disabled:pointer-events-none disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ms-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground';\n\nexport const accordionContentClass =\n 'overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up';\n\nexport const UI_ACCORDION_GENERATED = [] as const;\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n forwardRef,\n inject,\n input,\n model,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { cn } from '@loomui-ng/ui/utils';\nimport { nextId, whenAnimationDone } from '@loomui-ng/ui/utils';\nimport {\n accordionClass,\n accordionContentClass,\n accordionItemClass,\n accordionTriggerClass,\n} from './accordion';\nimport { UiIconSvg } from '@loomui-ng/ui/icon';\nimport { UiElementHost } from '@loomui-ng/ui/utils';\n\n/**\n * <div uiAccordion type=\"single\" [(value)]=\"open\" class=\"rounded-lg border\">\n * <div uiAccordionItem value=\"a\">\n * <button uiAccordionTrigger>Question</button>\n * <div uiAccordionContent>Answer</div>\n * </div>\n * </div>\n * `value` is always an array (single mode holds at most one entry).\n */\n@Directive({\n selector: '[uiAccordion], ui-accordion', hostDirectives: [UiElementHost],\n exportAs: 'uiAccordion',\n host: {\n 'data-slot': 'accordion',\n '[attr.data-orientation]': 'orientation()',\n '[attr.class]': 'classes()',\n '(keydown)': 'onKeydown($event)',\n },\n})\nexport class UiAccordion {\n readonly type = input<'single' | 'multiple'>('single');\n readonly collapsible = input(true, { transform: booleanAttribute });\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n readonly value = model<string[]>([]);\n readonly userClass = input<string>('', { alias: 'class' });\n readonly baseId = nextId('ui-accordion');\n\n private readonly dir = inject(Directionality);\n private readonly triggers = contentChildren(forwardRef(() => UiAccordionTrigger), { descendants: true });\n protected readonly classes = computed(() => cn(accordionClass, this.userClass()));\n\n isOpen(v: string): boolean {\n return this.value().includes(v);\n }\n\n toggle(v: string): void {\n const open = this.isOpen(v);\n if (this.type() === 'multiple') {\n this.value.update((list) => (open ? list.filter((x) => x !== v) : [...list, v]));\n } else if (open) {\n if (this.collapsible()) this.value.set([]);\n } else {\n this.value.set([v]);\n }\n }\n\n protected onKeydown(e: KeyboardEvent): void {\n const enabled = this.triggers().filter((t) => !t.isDisabled());\n const i = enabled.findIndex((t) => t.el === document.activeElement);\n if (i < 0) return;\n const horizontal = this.orientation() === 'horizontal';\n const rtl = this.dir.value === 'rtl';\n const next = horizontal ? (rtl ? 'ArrowLeft' : 'ArrowRight') : 'ArrowDown';\n const prev = horizontal ? (rtl ? 'ArrowRight' : 'ArrowLeft') : 'ArrowUp';\n let target = -1;\n if (e.key === next) target = (i + 1) % enabled.length;\n else if (e.key === prev) target = (i - 1 + enabled.length) % enabled.length;\n else if (e.key === 'Home') target = 0;\n else if (e.key === 'End') target = enabled.length - 1;\n if (target >= 0) {\n e.preventDefault();\n enabled[target].el.focus();\n }\n }\n}\n\n@Directive({\n selector: '[uiAccordionItem], ui-accordion-item', hostDirectives: [UiElementHost],\n host: {\n 'data-slot': 'accordion-item',\n '[attr.data-state]': 'open() ? \"open\" : \"closed\"',\n '[attr.data-orientation]': 'root.orientation()',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.class]': 'classes()',\n },\n})\nexport class UiAccordionItem {\n protected readonly root = inject(UiAccordion);\n readonly value = input<string>('');\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly userClass = input<string>('', { alias: 'class' });\n readonly open = computed(() => this.root.isOpen(this.value()));\n readonly triggerId = computed(() => `${this.root.baseId}-trigger-${this.value()}`);\n readonly contentId = computed(() => `${this.root.baseId}-content-${this.value()}`);\n protected readonly classes = computed(() => cn(accordionItemClass, this.userClass()));\n}\n\nconst CHEVRON =\n 'viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"';\n\n@Component({\n selector: 'button[uiAccordionTrigger], ui-accordion-trigger', hostDirectives: [UiElementHost],\n imports: [UiIconSvg],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n type: 'button',\n 'data-slot': 'accordion-trigger',\n '[id]': 'item.triggerId()',\n '[attr.aria-expanded]': 'item.open()',\n '[attr.aria-controls]': 'item.contentId()',\n '[attr.data-state]': 'item.open() ? \"open\" : \"closed\"',\n '[attr.data-orientation]': 'root.orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : null',\n '[attr.disabled]': '(isDisabled()) ? \"\" : null',\n '[attr.class]': 'classes()',\n '(click)': 'root.toggle(item.value())',\n },\n template: `\n <ng-content />\n <svg uiIcon=\"chevron-down\" data-slot=\"accordion-trigger-icon\" class=\"pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden\"></svg>\n <svg uiIcon=\"chevron-up\" data-slot=\"accordion-trigger-icon\" class=\"pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline\"></svg>\n `,\n})\nexport class UiAccordionTrigger {\n protected readonly root = inject(UiAccordion);\n protected readonly item = inject(UiAccordionItem);\n readonly el = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n readonly userClass = input<string>('', { alias: 'class' });\n isDisabled = () => this.item.disabled();\n protected readonly classes = computed(() => cn(accordionTriggerClass, this.userClass()));\n}\n\n@Component({\n selector: '[uiAccordionContent], ui-accordion-content', hostDirectives: [UiElementHost],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n role: 'region',\n 'data-slot': 'accordion-content',\n '[id]': 'item.contentId()',\n '[attr.aria-labelledby]': 'item.triggerId()',\n '[attr.data-state]': 'item.open() ? \"open\" : \"closed\"',\n '[attr.data-orientation]': 'root.orientation()',\n '[attr.data-disabled]': 'item.disabled() ? \"\" : null',\n '[hidden]': '!present()',\n '[attr.class]': 'classes()',\n },\n template: `<div #inner class=\"pt-0 pb-2.5\"><ng-content /></div>`,\n})\nexport class UiAccordionContent {\n protected readonly root = inject(UiAccordion);\n protected readonly item = inject(UiAccordionItem);\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly inner = viewChild.required<ElementRef<HTMLElement>>('inner');\n readonly userClass = input<string>('', { alias: 'class' });\n /** Stays true during the exit animation so `animate-accordion-up` can play. */\n protected readonly present = signal(false);\n protected readonly classes = computed(() => cn(accordionContentClass, this.userClass()));\n\n constructor() {\n effect(() => {\n const open = this.item.open();\n untracked(() => {\n if (open) {\n this.present.set(true);\n setTimeout(() => this.setHeight(), 0);\n } else if (this.present()) {\n this.setHeight();\n void whenAnimationDone(this.el, 400).then(() => !this.item.open() && this.present.set(false));\n }\n });\n });\n }\n\n private setHeight(): void {\n this.el.style.setProperty('--radix-accordion-content-height', `${this.inner().nativeElement.scrollHeight}px`);\n }\n}\n\nexport const UI_ACCORDION = [UiAccordion, UiAccordionItem, UiAccordionTrigger, UiAccordionContent] as const;\n"],"mappings":";;;;;;AAKA,MAAa,iBACX;AAEF,MAAa,qBACX;AAEF,MAAa,wBACX;AAEF,MAAa,wBACX;AAEF,MAAa,yBAAyB,CAAA;AC+BtC,IAAa,cAAb,MAAa,YAAW;CACb,OAAO,MAA6B,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC7C,cAAc,MAAM,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACvD,cAAc,MAAiC,YAAW,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAC1D,QAAQ,MAAgB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,YAAY,MAAc,IAAE;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,OAAO;CAAO,CAAA;CAC9C,SAAS,OAAO,cAAc;CAEtB,MAAM,OAAO,cAAc;CAC3B,WAAW,gBAAgB,iBAAiB,kBAAkB,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,aAAa;CAAI,CAAA;CAClF,UAAU,eAAe,GAAG,gBAAgB,KAAK,UAAS,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAEjF,OAAO,GAAS;EACd,OAAO,KAAK,MAAK,CAAE,CAAC,SAAS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