@ojiepermana/angular-component 22.0.27

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 (244) hide show
  1. package/README.md +82 -0
  2. package/accordion/README.md +193 -0
  3. package/alert/README.md +180 -0
  4. package/alert-dialog/README.md +239 -0
  5. package/aspect-ratio/README.md +112 -0
  6. package/avatar/README.md +176 -0
  7. package/badge/README.md +133 -0
  8. package/breadcrumb/README.md +216 -0
  9. package/button/README.md +139 -0
  10. package/button-group/README.md +208 -0
  11. package/calendar/README.md +135 -0
  12. package/card/README.md +220 -0
  13. package/carousel/README.md +276 -0
  14. package/checkbox/README.md +149 -0
  15. package/collapsible/README.md +195 -0
  16. package/combobox/README.md +198 -0
  17. package/command/README.md +275 -0
  18. package/composer/README.md +235 -0
  19. package/context-menu/README.md +267 -0
  20. package/date-picker/README.md +179 -0
  21. package/dialog/README.md +235 -0
  22. package/drawer/README.md +145 -0
  23. package/dropdown-menu/README.md +311 -0
  24. package/editor/README.md +136 -0
  25. package/empty/README.md +183 -0
  26. package/fesm2022/ojiepermana-angular-component-accordion.mjs +186 -0
  27. package/fesm2022/ojiepermana-angular-component-accordion.mjs.map +1 -0
  28. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +276 -0
  29. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs.map +1 -0
  30. package/fesm2022/ojiepermana-angular-component-alert.mjs +99 -0
  31. package/fesm2022/ojiepermana-angular-component-alert.mjs.map +1 -0
  32. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +37 -0
  33. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs.map +1 -0
  34. package/fesm2022/ojiepermana-angular-component-avatar.mjs +139 -0
  35. package/fesm2022/ojiepermana-angular-component-avatar.mjs.map +1 -0
  36. package/fesm2022/ojiepermana-angular-component-badge.mjs +50 -0
  37. package/fesm2022/ojiepermana-angular-component-badge.mjs.map +1 -0
  38. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +200 -0
  39. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs.map +1 -0
  40. package/fesm2022/ojiepermana-angular-component-button-group.mjs +103 -0
  41. package/fesm2022/ojiepermana-angular-component-button-group.mjs.map +1 -0
  42. package/fesm2022/ojiepermana-angular-component-button.mjs +68 -0
  43. package/fesm2022/ojiepermana-angular-component-button.mjs.map +1 -0
  44. package/fesm2022/ojiepermana-angular-component-calendar.mjs +103 -0
  45. package/fesm2022/ojiepermana-angular-component-calendar.mjs.map +1 -0
  46. package/fesm2022/ojiepermana-angular-component-card.mjs +152 -0
  47. package/fesm2022/ojiepermana-angular-component-card.mjs.map +1 -0
  48. package/fesm2022/ojiepermana-angular-component-carousel.mjs +334 -0
  49. package/fesm2022/ojiepermana-angular-component-carousel.mjs.map +1 -0
  50. package/fesm2022/ojiepermana-angular-component-checkbox.mjs +165 -0
  51. package/fesm2022/ojiepermana-angular-component-checkbox.mjs.map +1 -0
  52. package/fesm2022/ojiepermana-angular-component-collapsible.mjs +121 -0
  53. package/fesm2022/ojiepermana-angular-component-collapsible.mjs.map +1 -0
  54. package/fesm2022/ojiepermana-angular-component-combobox.mjs +274 -0
  55. package/fesm2022/ojiepermana-angular-component-combobox.mjs.map +1 -0
  56. package/fesm2022/ojiepermana-angular-component-command.mjs +297 -0
  57. package/fesm2022/ojiepermana-angular-component-command.mjs.map +1 -0
  58. package/fesm2022/ojiepermana-angular-component-composer.mjs +352 -0
  59. package/fesm2022/ojiepermana-angular-component-composer.mjs.map +1 -0
  60. package/fesm2022/ojiepermana-angular-component-context-menu.mjs +108 -0
  61. package/fesm2022/ojiepermana-angular-component-context-menu.mjs.map +1 -0
  62. package/fesm2022/ojiepermana-angular-component-date-picker.mjs +186 -0
  63. package/fesm2022/ojiepermana-angular-component-date-picker.mjs.map +1 -0
  64. package/fesm2022/ojiepermana-angular-component-dialog.mjs +283 -0
  65. package/fesm2022/ojiepermana-angular-component-dialog.mjs.map +1 -0
  66. package/fesm2022/ojiepermana-angular-component-drawer.mjs +6 -0
  67. package/fesm2022/ojiepermana-angular-component-drawer.mjs.map +1 -0
  68. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +494 -0
  69. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs.map +1 -0
  70. package/fesm2022/ojiepermana-angular-component-editor.mjs +680 -0
  71. package/fesm2022/ojiepermana-angular-component-editor.mjs.map +1 -0
  72. package/fesm2022/ojiepermana-angular-component-empty.mjs +145 -0
  73. package/fesm2022/ojiepermana-angular-component-empty.mjs.map +1 -0
  74. package/fesm2022/ojiepermana-angular-component-form.mjs +364 -0
  75. package/fesm2022/ojiepermana-angular-component-form.mjs.map +1 -0
  76. package/fesm2022/ojiepermana-angular-component-hover-card.mjs +275 -0
  77. package/fesm2022/ojiepermana-angular-component-hover-card.mjs.map +1 -0
  78. package/fesm2022/ojiepermana-angular-component-icon.mjs +86 -0
  79. package/fesm2022/ojiepermana-angular-component-icon.mjs.map +1 -0
  80. package/fesm2022/ojiepermana-angular-component-input-group.mjs +179 -0
  81. package/fesm2022/ojiepermana-angular-component-input-group.mjs.map +1 -0
  82. package/fesm2022/ojiepermana-angular-component-input-otp.mjs +517 -0
  83. package/fesm2022/ojiepermana-angular-component-input-otp.mjs.map +1 -0
  84. package/fesm2022/ojiepermana-angular-component-input.mjs +45 -0
  85. package/fesm2022/ojiepermana-angular-component-input.mjs.map +1 -0
  86. package/fesm2022/ojiepermana-angular-component-item.mjs +264 -0
  87. package/fesm2022/ojiepermana-angular-component-item.mjs.map +1 -0
  88. package/fesm2022/ojiepermana-angular-component-kanban.mjs +314 -0
  89. package/fesm2022/ojiepermana-angular-component-kanban.mjs.map +1 -0
  90. package/fesm2022/ojiepermana-angular-component-kbd.mjs +55 -0
  91. package/fesm2022/ojiepermana-angular-component-kbd.mjs.map +1 -0
  92. package/fesm2022/ojiepermana-angular-component-label.mjs +33 -0
  93. package/fesm2022/ojiepermana-angular-component-label.mjs.map +1 -0
  94. package/fesm2022/ojiepermana-angular-component-menubar.mjs +311 -0
  95. package/fesm2022/ojiepermana-angular-component-menubar.mjs.map +1 -0
  96. package/fesm2022/ojiepermana-angular-component-native-select.mjs +67 -0
  97. package/fesm2022/ojiepermana-angular-component-native-select.mjs.map +1 -0
  98. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +408 -0
  99. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs.map +1 -0
  100. package/fesm2022/ojiepermana-angular-component-pagination.mjs +226 -0
  101. package/fesm2022/ojiepermana-angular-component-pagination.mjs.map +1 -0
  102. package/fesm2022/ojiepermana-angular-component-pillbox.mjs +810 -0
  103. package/fesm2022/ojiepermana-angular-component-pillbox.mjs.map +1 -0
  104. package/fesm2022/ojiepermana-angular-component-popover.mjs +145 -0
  105. package/fesm2022/ojiepermana-angular-component-popover.mjs.map +1 -0
  106. package/fesm2022/ojiepermana-angular-component-progress.mjs +60 -0
  107. package/fesm2022/ojiepermana-angular-component-progress.mjs.map +1 -0
  108. package/fesm2022/ojiepermana-angular-component-radio.mjs +173 -0
  109. package/fesm2022/ojiepermana-angular-component-radio.mjs.map +1 -0
  110. package/fesm2022/ojiepermana-angular-component-resizable.mjs +478 -0
  111. package/fesm2022/ojiepermana-angular-component-resizable.mjs.map +1 -0
  112. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +54 -0
  113. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs.map +1 -0
  114. package/fesm2022/ojiepermana-angular-component-select.mjs +297 -0
  115. package/fesm2022/ojiepermana-angular-component-select.mjs.map +1 -0
  116. package/fesm2022/ojiepermana-angular-component-separator.mjs +37 -0
  117. package/fesm2022/ojiepermana-angular-component-separator.mjs.map +1 -0
  118. package/fesm2022/ojiepermana-angular-component-sheet.mjs +297 -0
  119. package/fesm2022/ojiepermana-angular-component-sheet.mjs.map +1 -0
  120. package/fesm2022/ojiepermana-angular-component-skeleton.mjs +31 -0
  121. package/fesm2022/ojiepermana-angular-component-skeleton.mjs.map +1 -0
  122. package/fesm2022/ojiepermana-angular-component-slider.mjs +423 -0
  123. package/fesm2022/ojiepermana-angular-component-slider.mjs.map +1 -0
  124. package/fesm2022/ojiepermana-angular-component-spinner.mjs +60 -0
  125. package/fesm2022/ojiepermana-angular-component-spinner.mjs.map +1 -0
  126. package/fesm2022/ojiepermana-angular-component-switch.mjs +140 -0
  127. package/fesm2022/ojiepermana-angular-component-switch.mjs.map +1 -0
  128. package/fesm2022/ojiepermana-angular-component-table.mjs +155 -0
  129. package/fesm2022/ojiepermana-angular-component-table.mjs.map +1 -0
  130. package/fesm2022/ojiepermana-angular-component-tabs.mjs +271 -0
  131. package/fesm2022/ojiepermana-angular-component-tabs.mjs.map +1 -0
  132. package/fesm2022/ojiepermana-angular-component-textarea.mjs +39 -0
  133. package/fesm2022/ojiepermana-angular-component-textarea.mjs.map +1 -0
  134. package/fesm2022/ojiepermana-angular-component-timeline.mjs +237 -0
  135. package/fesm2022/ojiepermana-angular-component-timeline.mjs.map +1 -0
  136. package/fesm2022/ojiepermana-angular-component-toast.mjs +161 -0
  137. package/fesm2022/ojiepermana-angular-component-toast.mjs.map +1 -0
  138. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +289 -0
  139. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs.map +1 -0
  140. package/fesm2022/ojiepermana-angular-component-toggle.mjs +82 -0
  141. package/fesm2022/ojiepermana-angular-component-toggle.mjs.map +1 -0
  142. package/fesm2022/ojiepermana-angular-component-tooltip.mjs +410 -0
  143. package/fesm2022/ojiepermana-angular-component-tooltip.mjs.map +1 -0
  144. package/fesm2022/ojiepermana-angular-component-utils.mjs +81 -0
  145. package/fesm2022/ojiepermana-angular-component-utils.mjs.map +1 -0
  146. package/fesm2022/ojiepermana-angular-component.mjs +11 -0
  147. package/fesm2022/ojiepermana-angular-component.mjs.map +1 -0
  148. package/form/README.md +210 -0
  149. package/hover-card/README.md +142 -0
  150. package/icon/README.md +25 -0
  151. package/input/README.md +159 -0
  152. package/input-group/README.md +237 -0
  153. package/input-otp/README.md +278 -0
  154. package/item/README.md +247 -0
  155. package/kanban/README.md +81 -0
  156. package/kbd/README.md +139 -0
  157. package/label/README.md +135 -0
  158. package/menubar/README.md +269 -0
  159. package/native-select/README.md +176 -0
  160. package/navigation-menu/README.md +160 -0
  161. package/package.json +291 -0
  162. package/pagination/README.md +144 -0
  163. package/pillbox/README.md +67 -0
  164. package/popover/README.md +43 -0
  165. package/progress/README.md +160 -0
  166. package/radio/README.md +209 -0
  167. package/resizable/README.md +168 -0
  168. package/scroll-area/README.md +143 -0
  169. package/select/README.md +174 -0
  170. package/separator/README.md +170 -0
  171. package/sheet/README.md +183 -0
  172. package/skeleton/README.md +158 -0
  173. package/slider/README.md +207 -0
  174. package/spinner/README.md +160 -0
  175. package/switch/README.md +166 -0
  176. package/table/README.md +291 -0
  177. package/tabs/README.md +214 -0
  178. package/textarea/README.md +153 -0
  179. package/timeline/README.md +94 -0
  180. package/toast/README.md +321 -0
  181. package/toggle/README.md +131 -0
  182. package/toggle-group/README.md +206 -0
  183. package/tooltip/README.md +207 -0
  184. package/types/ojiepermana-angular-component-accordion.d.ts +51 -0
  185. package/types/ojiepermana-angular-component-alert-dialog.d.ts +93 -0
  186. package/types/ojiepermana-angular-component-alert.d.ts +37 -0
  187. package/types/ojiepermana-angular-component-aspect-ratio.d.ts +12 -0
  188. package/types/ojiepermana-angular-component-avatar.d.ts +51 -0
  189. package/types/ojiepermana-angular-component-badge.d.ts +19 -0
  190. package/types/ojiepermana-angular-component-breadcrumb.d.ts +46 -0
  191. package/types/ojiepermana-angular-component-button-group.d.ts +26 -0
  192. package/types/ojiepermana-angular-component-button.d.ts +22 -0
  193. package/types/ojiepermana-angular-component-calendar.d.ts +39 -0
  194. package/types/ojiepermana-angular-component-card.d.ts +60 -0
  195. package/types/ojiepermana-angular-component-carousel.d.ts +86 -0
  196. package/types/ojiepermana-angular-component-checkbox.d.ts +42 -0
  197. package/types/ojiepermana-angular-component-collapsible.d.ts +42 -0
  198. package/types/ojiepermana-angular-component-combobox.d.ts +53 -0
  199. package/types/ojiepermana-angular-component-command.d.ts +102 -0
  200. package/types/ojiepermana-angular-component-composer.d.ts +90 -0
  201. package/types/ojiepermana-angular-component-context-menu.d.ts +36 -0
  202. package/types/ojiepermana-angular-component-date-picker.d.ts +48 -0
  203. package/types/ojiepermana-angular-component-dialog.d.ts +87 -0
  204. package/types/ojiepermana-angular-component-drawer.d.ts +1 -0
  205. package/types/ojiepermana-angular-component-dropdown-menu.d.ts +140 -0
  206. package/types/ojiepermana-angular-component-editor.d.ts +126 -0
  207. package/types/ojiepermana-angular-component-empty.d.ts +50 -0
  208. package/types/ojiepermana-angular-component-form.d.ts +140 -0
  209. package/types/ojiepermana-angular-component-hover-card.d.ts +75 -0
  210. package/types/ojiepermana-angular-component-icon.d.ts +31 -0
  211. package/types/ojiepermana-angular-component-input-group.d.ts +51 -0
  212. package/types/ojiepermana-angular-component-input-otp.d.ts +142 -0
  213. package/types/ojiepermana-angular-component-input.d.ts +16 -0
  214. package/types/ojiepermana-angular-component-item.d.ts +88 -0
  215. package/types/ojiepermana-angular-component-kanban.d.ts +70 -0
  216. package/types/ojiepermana-angular-component-kbd.d.ts +16 -0
  217. package/types/ojiepermana-angular-component-label.d.ts +11 -0
  218. package/types/ojiepermana-angular-component-menubar.d.ts +69 -0
  219. package/types/ojiepermana-angular-component-native-select.d.ts +26 -0
  220. package/types/ojiepermana-angular-component-navigation-menu.d.ts +98 -0
  221. package/types/ojiepermana-angular-component-pagination.d.ts +33 -0
  222. package/types/ojiepermana-angular-component-pillbox.d.ts +156 -0
  223. package/types/ojiepermana-angular-component-popover.d.ts +50 -0
  224. package/types/ojiepermana-angular-component-progress.d.ts +17 -0
  225. package/types/ojiepermana-angular-component-radio.d.ts +57 -0
  226. package/types/ojiepermana-angular-component-resizable.d.ts +99 -0
  227. package/types/ojiepermana-angular-component-scroll-area.d.ts +19 -0
  228. package/types/ojiepermana-angular-component-select.d.ts +56 -0
  229. package/types/ojiepermana-angular-component-separator.d.ts +14 -0
  230. package/types/ojiepermana-angular-component-sheet.d.ts +78 -0
  231. package/types/ojiepermana-angular-component-skeleton.d.ts +10 -0
  232. package/types/ojiepermana-angular-component-slider.d.ts +74 -0
  233. package/types/ojiepermana-angular-component-spinner.d.ts +13 -0
  234. package/types/ojiepermana-angular-component-switch.d.ts +44 -0
  235. package/types/ojiepermana-angular-component-table.d.ts +52 -0
  236. package/types/ojiepermana-angular-component-tabs.d.ts +92 -0
  237. package/types/ojiepermana-angular-component-textarea.d.ts +12 -0
  238. package/types/ojiepermana-angular-component-timeline.d.ts +63 -0
  239. package/types/ojiepermana-angular-component-toast.d.ts +51 -0
  240. package/types/ojiepermana-angular-component-toggle-group.d.ts +89 -0
  241. package/types/ojiepermana-angular-component-toggle.d.ts +25 -0
  242. package/types/ojiepermana-angular-component-tooltip.d.ts +101 -0
  243. package/types/ojiepermana-angular-component-utils.d.ts +30 -0
  244. package/types/ojiepermana-angular-component.d.ts +2 -0
@@ -0,0 +1,235 @@
1
+ # Dialog
2
+
3
+ Displays a modal surface over the current page, traps focus while open, and restores focus to the previously active element when it closes.
4
+
5
+ Use Dialog for confirmation flows, compact forms, link sharing, and long-form review tasks that should keep the user in the current context.
6
+
7
+ ## Import
8
+
9
+ ```ts
10
+ import { ButtonComponent } from '@ojiepermana/angular-component/button';
11
+ import {
12
+ DialogCloseDirective,
13
+ DialogComponent,
14
+ DialogContentComponent,
15
+ DialogDescriptionComponent,
16
+ DialogFooterComponent,
17
+ DialogHeaderComponent,
18
+ DialogTitleComponent,
19
+ } from '@ojiepermana/angular-component/dialog';
20
+ import { InputComponent } from '@ojiepermana/angular-component/input';
21
+ import { LabelComponent } from '@ojiepermana/angular-component/label';
22
+ ```
23
+
24
+ ## Composition
25
+
26
+ The Angular composition tracks the shadcn structure, with one intentional mapping difference: shadcn `DialogTrigger` becomes any external control that toggles the `open` signal.
27
+
28
+ ```text
29
+ button[Button] (external trigger; sets the open signal)
30
+ Dialog
31
+ ├── built-in close button (optional)
32
+ ├── DialogHeader
33
+ │ ├── DialogTitle
34
+ │ └── DialogDescription
35
+ ├── DialogContent (optional body wrapper)
36
+ └── DialogFooter
37
+ └── button[DialogClose] (optional custom close action)
38
+ ```
39
+
40
+ ## Basic usage
41
+
42
+ Use an external button or link to toggle the `open` signal, then declare the dialog structure inside `Dialog`.
43
+
44
+ ```html
45
+ <button type="button" Button variant="outline" (click)="open.set(true)">Edit profile</button>
46
+
47
+ <dialog [(open)]="open" aria-labelledby="dialog-title" aria-describedby="dialog-description" class="sm:max-w-sm">
48
+ <DialogHeader>
49
+ <DialogTitle id="dialog-title">Edit profile</DialogTitle>
50
+ <DialogDescription id="dialog-description">
51
+ Make changes to your profile here. Click save when you are done.
52
+ </DialogDescription>
53
+ </DialogHeader>
54
+
55
+ <DialogContent class="grid gap-4 py-2">
56
+ <div class="grid gap-2">
57
+ <label Label for="name">Name</label>
58
+ <input Input id="name" value="Pedro Duarte" />
59
+ </div>
60
+ <div class="grid gap-2">
61
+ <label Label for="username">Username</label>
62
+ <input Input id="username" value="@peduarte" />
63
+ </div>
64
+ </DialogContent>
65
+
66
+ <DialogFooter>
67
+ <button type="button" Button variant="outline" DialogClose>Cancel</button>
68
+ <button type="button" Button (click)="open.set(false)">Save changes</button>
69
+ </DialogFooter>
70
+ </dialog>
71
+ ```
72
+
73
+ ## Common patterns
74
+
75
+ ### Destructive confirmation
76
+
77
+ Use a short title, short body copy, and explicit cancel/confirm actions for destructive flows.
78
+
79
+ ```html
80
+ <button type="button" Button variant="destructive" (click)="confirmOpen.set(true)">Delete project</button>
81
+
82
+ <dialog [(open)]="confirmOpen">
83
+ <DialogHeader>
84
+ <DialogTitle>Delete this project?</DialogTitle>
85
+ <DialogDescription> This action cannot be undone. This permanently deletes your project. </DialogDescription>
86
+ </DialogHeader>
87
+ <DialogFooter>
88
+ <button type="button" Button variant="outline" DialogClose>Cancel</button>
89
+ <button type="button" Button variant="destructive" (click)="confirmOpen.set(false)">Delete</button>
90
+ </DialogFooter>
91
+ </dialog>
92
+ ```
93
+
94
+ ### Custom close button
95
+
96
+ Hide the built-in corner close control with `[showCloseButton]="false"` and place `button[DialogClose]` wherever dismissal should live.
97
+
98
+ ```html
99
+ <dialog [(open)]="shareOpen" [showCloseButton]="false" class="sm:max-w-md">
100
+ <DialogHeader>
101
+ <DialogTitle>Share link</DialogTitle>
102
+ <DialogDescription> Anyone who has this link can view this workspace. </DialogDescription>
103
+ </DialogHeader>
104
+ <DialogContent class="grid gap-4 py-2">
105
+ <div class="grid gap-2">
106
+ <label Label for="share-link">Link</label>
107
+ <input Input id="share-link" readonly value="https://ui.shadcn.com/docs/components/radix/dialog" />
108
+ </div>
109
+ </DialogContent>
110
+ <DialogFooter class="sm:justify-start">
111
+ <button type="button" Button DialogClose>Close</button>
112
+ </DialogFooter>
113
+ </dialog>
114
+ ```
115
+
116
+ ### No close button
117
+
118
+ Use `[showCloseButton]="false"` without an internal close action when Escape and backdrop dismissal are enough.
119
+
120
+ ```html
121
+ <dialog [(open)]="noCloseOpen" [showCloseButton]="false">
122
+ <DialogHeader>
123
+ <DialogTitle>No Close Button</DialogTitle>
124
+ <DialogDescription>
125
+ Dismiss this dialog with Escape, the backdrop, or another action you control.
126
+ </DialogDescription>
127
+ </DialogHeader>
128
+ </dialog>
129
+ ```
130
+
131
+ ### Sticky footer for long content
132
+
133
+ Move the scroll region into `DialogContent` and keep the footer outside that overflow container so primary actions remain visible.
134
+
135
+ ```html
136
+ <dialog [(open)]="stickyOpen" [showCloseButton]="false" class="max-h-[85vh] overflow-hidden p-0 sm:max-w-lg">
137
+ <DialogHeader class="px-6 pt-6">
138
+ <DialogTitle>Sticky Footer</DialogTitle>
139
+ <DialogDescription>Keep actions visible while the content scrolls.</DialogDescription>
140
+ </DialogHeader>
141
+ <DialogContent class="max-h-[45vh] overflow-y-auto px-6 pb-6">
142
+ <!-- long content -->
143
+ </DialogContent>
144
+ <DialogFooter class="border-t border-border bg-background px-6 py-4 sm:justify-start">
145
+ <button type="button" Button variant="outline" DialogClose>Close</button>
146
+ <button type="button" Button (click)="stickyOpen.set(false)">Save changes</button>
147
+ </DialogFooter>
148
+ </dialog>
149
+ ```
150
+
151
+ ### RTL
152
+
153
+ Wrap the trigger and dialog in a `dir="rtl"` container or set direction globally in the app shell.
154
+
155
+ ```html
156
+ <div dir="rtl" lang="ar" class="text-right">
157
+ <button type="button" Button variant="outline" (click)="rtlOpen.set(true)">فتح الحوار</button>
158
+
159
+ <dialog [(open)]="rtlOpen" [showCloseButton]="false" class="sm:max-w-sm">
160
+ <DialogHeader>
161
+ <DialogTitle>تعديل الملف الشخصي</DialogTitle>
162
+ <DialogDescription> قم بإجراء تغييرات على ملفك الشخصي هنا. انقر فوق حفظ عند الانتهاء. </DialogDescription>
163
+ </DialogHeader>
164
+ <DialogContent class="grid gap-4 py-2">
165
+ <div class="grid gap-2">...</div>
166
+ <div class="grid gap-2">...</div>
167
+ </DialogContent>
168
+ <DialogFooter>
169
+ <button type="button" Button variant="outline" DialogClose>إلغاء</button>
170
+ <button type="button" Button (click)="rtlOpen.set(false)">حفظ التغييرات</button>
171
+ </DialogFooter>
172
+ </dialog>
173
+ </div>
174
+ ```
175
+
176
+ ## API reference
177
+
178
+ ### `DialogComponent`
179
+
180
+ | Input | Type | Default |
181
+ | ---------------------- | ---------------- | --------- |
182
+ | `open` (model) | `boolean` | `false` |
183
+ | `closeOnEscape` | `boolean` | `true` |
184
+ | `closeOnBackdropClick` | `boolean` | `true` |
185
+ | `showCloseButton` | `boolean` | `true` |
186
+ | `closeButtonLabel` | `string` | `'Close'` |
187
+ | `aria-labelledby` | `string \| null` | `null` |
188
+ | `aria-describedby` | `string \| null` | `null` |
189
+ | `class` | `string` | `''` |
190
+
191
+ Output: `openedChange: boolean`. Method: `close()`.
192
+
193
+ ### Parts
194
+
195
+ | Part | Purpose |
196
+ | --------------------- | -------------------------------------------------------- |
197
+ | `DialogHeader` | Title and description wrapper |
198
+ | `DialogTitle` | Primary dialog label |
199
+ | `DialogDescription` | Supporting copy announced by assistive tech |
200
+ | `DialogContent` | Optional body wrapper for forms, grids, and scroll areas |
201
+ | `DialogFooter` | Action row |
202
+ | `button[DialogClose]` | Custom close action mapped to shadcn `DialogClose` |
203
+
204
+ Lower-level behavior is based on the Radix Dialog pattern: <https://www.radix-ui.com/primitives/docs/components/dialog#api-reference>.
205
+
206
+ ## Styling and theming
207
+
208
+ The dialog surface uses the shared theme tokens for background, border, foreground, and ring colors. Pass `class` to `Dialog` when you need to adjust width, max height, overflow strategy, or padding for a specific modal pattern.
209
+
210
+ Use `DialogContent` and `DialogFooter` classes to create scroll regions, sticky action rows, or wider content layouts without forking the primitive.
211
+
212
+ ## Accessibility
213
+
214
+ - The surface renders with `role="dialog"` and `aria-modal="true"`.
215
+ - Focus is trapped inside with `FocusTrap` from `@angular/cdk/a11y`.
216
+ - Focus returns to the previously active element when the dialog closes.
217
+ - Escape and backdrop dismissal are enabled by default but can be disabled for stricter flows.
218
+ - Keep titles and descriptions concise so screen readers announce useful context immediately.
219
+
220
+ ## Keyboard interactions
221
+
222
+ - `Tab` and `Shift+Tab` stay inside the dialog while it is open.
223
+ - `Escape` closes the dialog unless `closeOnEscape` is disabled.
224
+ - Native button activation handles `Enter` and `Space` for dialog actions.
225
+
226
+ ## Angular notes
227
+
228
+ - This implementation intentionally maps shadcn `DialogTrigger` to an external control that owns the `open` signal.
229
+ - `button[DialogClose]` is the Angular-friendly equivalent of shadcn `DialogClose` for internal dismissal actions.
230
+ - Seed open state with a signal in the owning component and keep the dialog content declarative.
231
+ - Hide the built-in close affordance with `[showCloseButton]="false"` when the footer or body owns dismissal explicitly.
232
+
233
+ ## Source parity
234
+
235
+ This Angular implementation follows the shadcn Dialog information architecture and examples while translating the interaction model to Angular selectors, signal-driven state, and explicit ownership of the trigger outside the modal content.
@@ -0,0 +1,145 @@
1
+ # Drawer
2
+
3
+ Bottom-first modal drawer built on the local Sheet overlay primitive. It mirrors the shadcn Drawer composition while using Angular signals and explicit standalone imports.
4
+
5
+ ## Import
6
+
7
+ ```ts
8
+ import { ButtonComponent } from '@ojiepermana/angular-component/button';
9
+ import {
10
+ DrawerCloseDirective,
11
+ DrawerComponent,
12
+ DrawerContentComponent,
13
+ DrawerDescriptionComponent,
14
+ DrawerFooterComponent,
15
+ DrawerHeaderComponent,
16
+ DrawerTitleComponent,
17
+ } from '@ojiepermana/angular-component/drawer';
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ```ts
23
+ import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
24
+ import { ButtonComponent } from '@ojiepermana/angular-component/button';
25
+ import {
26
+ DrawerCloseDirective,
27
+ DrawerComponent,
28
+ DrawerDescriptionComponent,
29
+ DrawerFooterComponent,
30
+ DrawerHeaderComponent,
31
+ DrawerTitleComponent,
32
+ } from '@ojiepermana/angular-component/drawer';
33
+
34
+ @Component({
35
+ selector: 'app-drawer-example',
36
+ changeDetection: ChangeDetectionStrategy.OnPush,
37
+ imports: [
38
+ ButtonComponent,
39
+ DrawerCloseDirective,
40
+ DrawerComponent,
41
+ DrawerDescriptionComponent,
42
+ DrawerFooterComponent,
43
+ DrawerHeaderComponent,
44
+ DrawerTitleComponent,
45
+ ],
46
+ template: `
47
+ <button type="button" Button variant="outline" (click)="open.set(true)">Open Drawer</button>
48
+
49
+ <Drawer [(open)]="open" aria-labelledby="drawer-title" aria-describedby="drawer-description">
50
+ <div class="mx-auto w-full max-w-sm">
51
+ <DrawerHeader>
52
+ <DrawerTitle id="drawer-title">Move Goal</DrawerTitle>
53
+ <DrawerDescription id="drawer-description">Set your daily activity goal.</DrawerDescription>
54
+ </DrawerHeader>
55
+ <DrawerFooter>
56
+ <button type="button" Button>Submit</button>
57
+ <button type="button" Button variant="outline" DrawerClose>Cancel</button>
58
+ </DrawerFooter>
59
+ </div>
60
+ </Drawer>
61
+ `,
62
+ })
63
+ export class DrawerExampleComponent {
64
+ protected readonly open = signal(false);
65
+ }
66
+ ```
67
+
68
+ ## Common Patterns
69
+
70
+ ### Sides
71
+
72
+ Drawer defaults to `bottom`, matching the common shadcn and Vaul pattern. Set `side` when the drawer should enter from a different edge.
73
+
74
+ ```html
75
+ <Drawer [(open)]="open" side="right" aria-labelledby="drawer-side-title">
76
+ <DrawerHeader>
77
+ <DrawerTitle id="drawer-side-title">Scrollable Content</DrawerTitle>
78
+ </DrawerHeader>
79
+ <DrawerContent class="max-h-[50vh] overflow-y-auto px-1">
80
+ <!-- long content -->
81
+ </DrawerContent>
82
+ </Drawer>
83
+ ```
84
+
85
+ ### Responsive Dialog
86
+
87
+ Use a desktop breakpoint in the owning component and render Dialog for larger viewports, Drawer for smaller viewports. Keep both surfaces bound to the same `open` signal so trigger and submit actions stay consistent.
88
+
89
+ ```html
90
+ @if (isDesktop()) {
91
+ <dialog [(open)]="open">...</dialog>
92
+ } @else {
93
+ <Drawer [(open)]="open">...</Drawer>
94
+ }
95
+ ```
96
+
97
+ ## API Reference
98
+
99
+ ### DrawerComponent
100
+
101
+ | Input | Type | Default |
102
+ | ---------------------- | ---------------------------------------- | ----------------------- |
103
+ | `open` | `boolean` model | `false` |
104
+ | `side` | `'top' \| 'right' \| 'bottom' \| 'left'` | `'bottom'` for `Drawer` |
105
+ | `closeOnEscape` | `boolean` | `true` |
106
+ | `closeOnBackdropClick` | `boolean` | `true` |
107
+ | `aria-labelledby` | `string \| null` | `null` |
108
+ | `aria-describedby` | `string \| null` | `null` |
109
+ | `class` | `string` | empty string |
110
+
111
+ ### Parts
112
+
113
+ | Part | Purpose |
114
+ | --------------------------------------- | ------------------------------------------------------------------------------------ |
115
+ | `DrawerHeader` | Title and description wrapper. |
116
+ | `DrawerTitle` | Accessible title. Provide an `id` and connect it with `aria-labelledby`. |
117
+ | `DrawerDescription` | Supporting text. Provide an `id` and connect it with `aria-describedby` when useful. |
118
+ | `DrawerContent` | Optional scroll/body region inside the surface. |
119
+ | `DrawerFooter` | Action row. |
120
+ | `button[DrawerClose]`, `a[DrawerClose]` | Projected close action equivalent to shadcn `DrawerClose`. |
121
+
122
+ ## Styling And Theming
123
+
124
+ The drawer uses the same theme tokens as Sheet: `bg-background`, `border-border`, `text-foreground`, and `text-muted-foreground`. Pass `class` to tune dimensions such as `max-h-[85vh]`, `sm:max-w-md`, or side-specific scroll behavior.
125
+
126
+ ## Accessibility
127
+
128
+ - The surface renders with `role="dialog"` and `aria-modal="true"`.
129
+ - Focus is trapped inside the CDK overlay while open and restored to the previously focused element on close.
130
+ - Provide `aria-labelledby` and `aria-describedby` when the drawer contains a title and description.
131
+ - Use native buttons for open, submit, and close actions.
132
+
133
+ ## Keyboard Interactions
134
+
135
+ - `Tab` and `Shift+Tab` move within the focus-trapped drawer content.
136
+ - `Escape` closes the drawer when `closeOnEscape` is `true`.
137
+ - Enter and Space activate native buttons, including `button[DrawerClose]`.
138
+
139
+ ## Angular Notes
140
+
141
+ The Angular Drawer deliberately uses an external trigger button and `[(open)]` signal binding instead of a `DrawerTrigger` component. This keeps ownership of state explicit and avoids hidden context wiring across overlay portals. `DrawerComponent` is exported as an alias over the same implementation as `SheetComponent`, so fixes to focus management, backdrop dismissal, and edge positioning are shared.
142
+
143
+ ## Source Parity
144
+
145
+ shadcn Drawer is built on Vaul and includes drag gestures and scale-background options. This Angular version maps the core modal drawer behavior to CDK Overlay and FocusTrap: bottom-first direction, side selection, focus trapping, Escape/backdrop dismissal, close actions, scrollable content, responsive dialog composition, and RTL-friendly content. It does not implement Vaul drag gestures.
@@ -0,0 +1,311 @@
1
+ # Dropdown Menu
2
+
3
+ Accessible menu rendered in a CDK overlay with keyboard navigation (arrow keys,
4
+ Home/End, type-ahead, Escape).
5
+
6
+ This Angular implementation follows the shadcn Dropdown Menu information architecture while mapping the React root
7
+ component to an explicit trigger directive and projected menu template.
8
+
9
+ ## Import
10
+
11
+ ```ts
12
+ import {
13
+ MenuCheckboxItemComponent,
14
+ MenuTriggerDirective,
15
+ MenuContentDirective,
16
+ MenuGroupComponent,
17
+ MenuSurfaceComponent,
18
+ MenuItemComponent,
19
+ MenuRadioGroupComponent,
20
+ MenuRadioItemComponent,
21
+ MenuSeparatorComponent,
22
+ MenuLabelComponent,
23
+ MenuShortcutComponent,
24
+ } from '@ojiepermana/angular-component/dropdown-menu';
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ ```html
30
+ <button
31
+ Button
32
+ type="button"
33
+ variant="outline"
34
+ #accountTrigger="MenuTrigger"
35
+ [MenuTrigger]="menu"
36
+ side="bottom"
37
+ align="end">
38
+ Open
39
+ </button>
40
+
41
+ <ng-template MenuContent #menu="MenuContent">
42
+ <MenuSurface class="w-56">
43
+ <MenuGroup>
44
+ <MenuLabel>My account</MenuLabel>
45
+ <button MenuItem type="button" (selected)="onProfile(); accountTrigger.close()">
46
+ Profile
47
+ <span MenuShortcut>⌘P</span>
48
+ </button>
49
+ <button MenuItem type="button" (selected)="onSettings(); accountTrigger.close()">Settings</button>
50
+ </MenuGroup>
51
+ <MenuSeparator />
52
+ <MenuGroup>
53
+ <button MenuItem type="button" disabled>Disabled</button>
54
+ <button MenuItem type="button" variant="destructive" (selected)="onSignOut(); accountTrigger.close()">
55
+ Sign out
56
+ </button>
57
+ </MenuGroup>
58
+ </MenuSurface>
59
+ </ng-template>
60
+ ```
61
+
62
+ Use the trigger export when a standard command row should dismiss the overlay. Checkbox and radio rows can stay open so
63
+ the user can adjust multiple settings in one pass.
64
+
65
+ ## Composition
66
+
67
+ ```text
68
+ button[Button][MenuTrigger]
69
+ └── ng-template[MenuContent]
70
+ └── MenuSurface
71
+ ├── MenuGroup
72
+ │ ├── MenuLabel
73
+ │ ├── button[MenuItem]
74
+ │ └── button[MenuItem][MenuTrigger]
75
+ │ └── ng-template[MenuContent]
76
+ │ └── MenuSurface
77
+ ├── MenuSeparator
78
+ ├── button[MenuCheckboxItem]
79
+ └── MenuRadioGroup
80
+ └── button[MenuRadioItem]
81
+ ```
82
+
83
+ ## Common patterns
84
+
85
+ ### Basic account menu
86
+
87
+ ```html
88
+ <button Button type="button" variant="outline" #menuTrigger="MenuTrigger" [MenuTrigger]="menu">Open</button>
89
+
90
+ <ng-template MenuContent #menu="MenuContent">
91
+ <MenuSurface class="w-56">
92
+ <MenuGroup>
93
+ <MenuLabel>My Account</MenuLabel>
94
+ <button MenuItem type="button" (selected)="menuTrigger.close()">Profile</button>
95
+ <button MenuItem type="button" (selected)="menuTrigger.close()">Billing</button>
96
+ <button MenuItem type="button" (selected)="menuTrigger.close()">Settings</button>
97
+ </MenuGroup>
98
+ <MenuSeparator />
99
+ <MenuGroup>
100
+ <button MenuItem type="button" (selected)="menuTrigger.close()">GitHub</button>
101
+ <button MenuItem type="button" (selected)="menuTrigger.close()">Support</button>
102
+ <button MenuItem type="button" [disabled]="true">API</button>
103
+ </MenuGroup>
104
+ </MenuSurface>
105
+ </ng-template>
106
+ ```
107
+
108
+ ### Submenu
109
+
110
+ Map shadcn `DropdownMenuSub` to `MenuTrigger` on a `button[MenuItem]`.
111
+
112
+ ```html
113
+ <ng-template MenuContent #inviteUsersMenu="MenuContent">
114
+ <MenuSurface class="w-48">
115
+ <button MenuItem type="button">Email</button>
116
+ <button MenuItem type="button">Message</button>
117
+ <button MenuItem type="button">Calendar invite</button>
118
+ </MenuSurface>
119
+ </ng-template>
120
+
121
+ <MenuSurface class="w-56">
122
+ <MenuGroup>
123
+ <button MenuItem type="button">Team</button>
124
+ <button MenuItem type="button" [MenuTrigger]="inviteUsersMenu" side="right" align="start">
125
+ Invite users
126
+ <span class="ml-auto text-xs text-muted-foreground">›</span>
127
+ </button>
128
+ </MenuGroup>
129
+ </MenuSurface>
130
+ ```
131
+
132
+ ### Checkboxes
133
+
134
+ Use checkbox rows when the menu exposes independent toggles.
135
+
136
+ ```ts
137
+ const showStatusBar = signal(true);
138
+ const showActivityBar = signal(false);
139
+ const showPanel = signal(false);
140
+ ```
141
+
142
+ ```html
143
+ <MenuSurface class="w-44">
144
+ <MenuGroup>
145
+ <MenuLabel>Appearance</MenuLabel>
146
+ <button MenuCheckboxItem type="button" [(checked)]="showStatusBar">Status Bar</button>
147
+ <button MenuCheckboxItem type="button" [(checked)]="showActivityBar">Activity Bar</button>
148
+ <button MenuCheckboxItem type="button" [(checked)]="showPanel">Panel</button>
149
+ </MenuGroup>
150
+ </MenuSurface>
151
+ ```
152
+
153
+ ### Radio group
154
+
155
+ Use a radio group for one exclusive choice.
156
+
157
+ ```ts
158
+ const panelPosition = signal<'top' | 'bottom' | 'right'>('bottom');
159
+ ```
160
+
161
+ ```html
162
+ <MenuSurface class="w-44">
163
+ <MenuLabel [inset]="true">Panel Position</MenuLabel>
164
+ <MenuRadioGroup [(value)]="panelPosition">
165
+ <button MenuRadioItem type="button" value="top">Top</button>
166
+ <button MenuRadioItem type="button" value="bottom">Bottom</button>
167
+ <button MenuRadioItem type="button" value="right">Right</button>
168
+ </MenuRadioGroup>
169
+ </MenuSurface>
170
+ ```
171
+
172
+ ### Shortcuts and icons
173
+
174
+ Project shortcut text and inline icons directly into the row content.
175
+
176
+ ```html
177
+ <MenuSurface class="w-56">
178
+ <button MenuItem type="button">
179
+ <svg aria-hidden="true" class="size-4" viewBox="0 0 24 24">...</svg>
180
+ Profile
181
+ <span MenuShortcut>⇧⌘P</span>
182
+ </button>
183
+ <button MenuItem type="button">
184
+ <svg aria-hidden="true" class="size-4" viewBox="0 0 24 24">...</svg>
185
+ Billing
186
+ <span MenuShortcut>⌘B</span>
187
+ </button>
188
+ </MenuSurface>
189
+ ```
190
+
191
+ ### Avatar trigger composition
192
+
193
+ Also import the avatar entrypoint when the trigger should be an account avatar.
194
+
195
+ ```ts
196
+ import { AvatarComponent, AvatarFallbackComponent, AvatarImageComponent } from '@ojiepermana/angular-component/avatar';
197
+ ```
198
+
199
+ ```html
200
+ <button
201
+ Button
202
+ type="button"
203
+ variant="ghost"
204
+ size="icon"
205
+ class="h-10 w-10 rounded-full p-0"
206
+ [MenuTrigger]="accountMenu"
207
+ align="end">
208
+ <Avatar>
209
+ <AvatarImage src="https://github.com/shadcn.png" alt="Ada Lovelace" />
210
+ <AvatarFallback>AL</AvatarFallback>
211
+ </Avatar>
212
+ </button>
213
+ ```
214
+
215
+ ### RTL
216
+
217
+ Set `dir="rtl"` and `lang` on the surface, and prefer `side="left"` when nested content should open toward the visual
218
+ start edge.
219
+
220
+ ```html
221
+ <ng-template MenuContent #rtlAccountMenu="MenuContent">
222
+ <MenuSurface dir="rtl" lang="ar" class="w-44 text-right">
223
+ <button MenuItem type="button">الملف الشخصي</button>
224
+ <button MenuItem type="button">الفوترة</button>
225
+ </MenuSurface>
226
+ </ng-template>
227
+
228
+ <MenuSurface dir="rtl" lang="ar" class="w-56 text-right">
229
+ <button MenuItem type="button" [MenuTrigger]="rtlAccountMenu" side="left" align="start">
230
+ الحساب
231
+ <span class="mr-auto text-xs text-muted-foreground">‹</span>
232
+ </button>
233
+ </MenuSurface>
234
+ ```
235
+
236
+ ## API
237
+
238
+ ### `[MenuTrigger]`
239
+
240
+ | Input | Type | Default |
241
+ | ------------- | ---------------------------------------- | ---------- |
242
+ | `MenuTrigger` | `MenuContentDirective` | _required_ |
243
+ | `side` | `'top' \| 'right' \| 'bottom' \| 'left'` | `'bottom'` |
244
+ | `align` | `'start' \| 'center' \| 'end'` | `'start'` |
245
+ | `disabled` | `boolean` | `false` |
246
+
247
+ Output: `openedChange: boolean`. Methods: `open()`, `close()`, `toggle()`.
248
+
249
+ ### `ng-template[MenuContent]`
250
+
251
+ Projected template wrapper for the menu surface that is consumed by `[MenuTrigger]`.
252
+
253
+ ### `MenuSurface`
254
+
255
+ Container with `role="menu"` and arrow key navigation wired through
256
+ `FocusKeyManager` (wrapping + type-ahead). Emits `closeRequested` on Tab.
257
+
258
+ ### `MenuItem`
259
+
260
+ `role="menuitem"`. Inputs: `disabled`, `inset`, `class`. Output: `selected`.
261
+
262
+ ### `MenuCheckboxItem`
263
+
264
+ `role="menuitemcheckbox"`. Inputs: `[(checked)]`, `disabled`, `variant`, `class`.
265
+
266
+ ### `MenuRadioGroup` and `MenuRadioItem`
267
+
268
+ Use `[(value)]` on the group and `value` on each radio row. Radio items expose `role="menuitemradio"`.
269
+
270
+ ### Auxiliary
271
+
272
+ - `MenuGroup` → structural wrapper with `role="group"`.
273
+ - `MenuSeparator` → `role="separator"`.
274
+ - `MenuLabel` — non-interactive label row.
275
+ - `MenuShortcut` — right-aligned shortcut badge.
276
+
277
+ ## Styling and theming
278
+
279
+ Pass `class` to the surface or individual rows to control width, spacing, and emphasis. Borders and separators use the
280
+ shared theme border tokens, destructive rows use the destructive palette, and projected icons inherit the current text
281
+ color.
282
+
283
+ ## Accessibility
284
+
285
+ - Trigger: `aria-haspopup="menu"`, `aria-expanded` reflects state.
286
+ - Surface: `role="menu"`, items receive `role="menuitem"`, disabled items get
287
+ `aria-disabled="true"`.
288
+ - Checkbox and radio items expose `aria-checked` semantics through the relevant menuitem roles.
289
+ - Close on outside click, Escape, or Tab. Focus returns to the trigger.
290
+
291
+ ## Keyboard interactions
292
+
293
+ - Enter, Space, and ArrowDown on the trigger open the menu.
294
+ - Arrow Up and Arrow Down move between enabled rows; Home and End jump to the first or last row.
295
+ - Typeahead matches the row label text.
296
+ - Enter and Space activate the focused row.
297
+
298
+ ## Angular notes
299
+
300
+ - There is no React-style `DropdownMenu` root component; the root behavior is handled by `MenuTrigger` and
301
+ `ng-template[MenuContent]`.
302
+ - Reuse `MenuTrigger` on `button[MenuItem]` when you need a submenu.
303
+ - Standard command rows can dismiss the overlay explicitly through a `#menuTrigger="MenuTrigger"` template reference,
304
+ while checkbox and radio rows can stay open for multi-step preference changes.
305
+
306
+ ## Source parity
307
+
308
+ This Angular entrypoint keeps the main shadcn dropdown-menu patterns: grouped commands, shortcuts, icons, nested menus,
309
+ checkbox items, radio groups, avatar triggers, destructive rows, and RTL guidance. The shadcn page includes additional
310
+ permutations such as checkbox-icons, radio-icons, and a very large complex menu; the local demos cover the same
311
+ primitives through representative compositions instead of duplicating every permutation one-to-one.