@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,237 @@
1
+ # Input Group
2
+
3
+ Grouped input primitives for prefixes, suffixes, stacked helper rows, and inline actions.
4
+
5
+ Use Input Group when the field and its addon content should read as a single control boundary instead of separate neighboring elements.
6
+
7
+ ## Import
8
+
9
+ ```ts
10
+ import {
11
+ FormControlDirective,
12
+ FormDescriptionComponent,
13
+ FormFieldComponent,
14
+ FormLabelComponent,
15
+ } from '@ojiepermana/angular-component/form';
16
+ import {
17
+ InputGroupAddonComponent,
18
+ InputGroupButtonComponent,
19
+ InputGroupComponent,
20
+ InputGroupInputComponent,
21
+ InputGroupTextComponent,
22
+ InputGroupTextareaComponent,
23
+ } from '@ojiepermana/angular-component/input-group';
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ Keep the input or textarea first in the DOM, then append one or more addons after it.
29
+ Use the `align` input on `InputGroupAddon` to place the addon at the inline or block edge.
30
+
31
+ ```html
32
+ <FormField>
33
+ <FormLabel>Search</FormLabel>
34
+ <InputGroup>
35
+ <input InputGroupInput FormControl placeholder="Search documentation..." />
36
+ <InputGroupAddon>
37
+ <span aria-hidden="true">⌕</span>
38
+ </InputGroupAddon>
39
+ <InputGroupAddon align="inline-end">
40
+ <InputGroupText>12 results</InputGroupText>
41
+ </InputGroupAddon>
42
+ </InputGroup>
43
+ <FormDescription>Keep addons after the control in the DOM and use align for visual placement.</FormDescription>
44
+ </FormField>
45
+ ```
46
+
47
+ ## Composition
48
+
49
+ ```text
50
+ InputGroup
51
+ ├── input[InputGroupInput] or textarea[InputGroupTextarea]
52
+ ├── InputGroupAddon
53
+ │ ├── InputGroupText
54
+ │ └── button[InputGroupButton]
55
+ └── InputGroupAddon
56
+ ```
57
+
58
+ ## Common Patterns
59
+
60
+ ### Inline search
61
+
62
+ ```html
63
+ <InputGroup class="max-w-md">
64
+ <input InputGroupInput placeholder="Search..." />
65
+ <InputGroupAddon>
66
+ <span aria-hidden="true">⌕</span>
67
+ </InputGroupAddon>
68
+ <InputGroupAddon align="inline-end">
69
+ <InputGroupText>12 results</InputGroupText>
70
+ </InputGroupAddon>
71
+ </InputGroup>
72
+ ```
73
+
74
+ ### Text addons
75
+
76
+ ```html
77
+ <InputGroup>
78
+ <input InputGroupInput placeholder="0.00" />
79
+ <InputGroupAddon>
80
+ <InputGroupText>$</InputGroupText>
81
+ </InputGroupAddon>
82
+ <InputGroupAddon align="inline-end">
83
+ <InputGroupText>USD</InputGroupText>
84
+ </InputGroupAddon>
85
+ </InputGroup>
86
+ ```
87
+
88
+ ### Textarea footer
89
+
90
+ ```html
91
+ <InputGroup>
92
+ <textarea InputGroupTextarea placeholder="Write a comment..."></textarea>
93
+ <InputGroupAddon align="block-end">
94
+ <InputGroupText>0/280</InputGroupText>
95
+ <button InputGroupButton type="button" size="sm" variant="default" class="ml-auto">Post</button>
96
+ </InputGroupAddon>
97
+ </InputGroup>
98
+ ```
99
+
100
+ ### Custom control
101
+
102
+ ```html
103
+ <InputGroup>
104
+ <textarea
105
+ data-slot="input-group-control"
106
+ class="min-h-20 w-full resize-none bg-transparent px-3 py-2.5 text-sm outline-none placeholder:text-muted-foreground"
107
+ placeholder="Use any custom control that matches the group contract..."></textarea>
108
+ <InputGroupAddon align="block-end">
109
+ <button InputGroupButton type="button" variant="default" size="sm" class="ml-auto">Submit</button>
110
+ </InputGroupAddon>
111
+ </InputGroup>
112
+ ```
113
+
114
+ ### Keyboard shortcut badge
115
+
116
+ ```html
117
+ <InputGroup class="max-w-sm">
118
+ <input InputGroupInput placeholder="Search..." />
119
+ <InputGroupAddon>
120
+ <span aria-hidden="true">⌕</span>
121
+ </InputGroupAddon>
122
+ <InputGroupAddon align="inline-end">
123
+ <span
124
+ aria-hidden="true"
125
+ class="inline-flex h-6 items-center rounded-md border border-border bg-background px-2 font-mono text-[11px] font-medium text-foreground shadow-sm">
126
+ ⌘K
127
+ </span>
128
+ </InputGroupAddon>
129
+ </InputGroup>
130
+ ```
131
+
132
+ ### Dropdown composition
133
+
134
+ Use the local menu primitives when the grouped field needs scoped actions or search destinations.
135
+
136
+ ```html
137
+ <InputGroup>
138
+ <input InputGroupInput placeholder="Enter file name" />
139
+ <InputGroupAddon align="inline-end">
140
+ <button
141
+ InputGroupButton
142
+ type="button"
143
+ size="icon-xs"
144
+ aria-label="Open file actions"
145
+ [MenuTrigger]="fileActionsMenu">
146
+
147
+ </button>
148
+ </InputGroupAddon>
149
+ </InputGroup>
150
+
151
+ <ng-template MenuContent #fileActionsMenu="MenuContent">
152
+ <MenuSurface>
153
+ <MenuLabel>File actions</MenuLabel>
154
+ <button MenuItem type="button">Settings</button>
155
+ <button MenuItem type="button">Copy path</button>
156
+ <MenuSeparator />
157
+ <button MenuItem type="button">Open location</button>
158
+ </MenuSurface>
159
+ </ng-template>
160
+ ```
161
+
162
+ ### Spinner status row
163
+
164
+ ```html
165
+ <InputGroup>
166
+ <input InputGroupInput placeholder="Saving changes..." />
167
+ <InputGroupAddon align="inline-end">
168
+ <InputGroupText>Saving...</InputGroupText>
169
+ <span
170
+ aria-hidden="true"
171
+ class="inline-flex size-4 animate-spin rounded-full border-2 border-muted border-t-foreground"></span>
172
+ </InputGroupAddon>
173
+ </InputGroup>
174
+ ```
175
+
176
+ ## API Reference
177
+
178
+ ### `InputGroupComponent`
179
+
180
+ | Input | Type | Default |
181
+ | ------- | -------- | ------------ |
182
+ | `class` | `string` | empty string |
183
+
184
+ ### `InputGroupAddonComponent`
185
+
186
+ | Input | Type | Default |
187
+ | ------- | ------------------------------------------------------------- | ---------------- |
188
+ | `align` | `'inline-start', 'inline-end', 'block-start', or 'block-end'` | `'inline-start'` |
189
+ | `class` | `string` | empty string |
190
+
191
+ ### `InputGroupButtonComponent`
192
+
193
+ | Input | Type | Default |
194
+ | --------- | ------------------------------------- | ------------ |
195
+ | `variant` | `ButtonVariant` | `'ghost'` |
196
+ | `size` | `'xs', 'icon-xs', 'sm', or 'icon-sm'` | `'xs'` |
197
+ | `class` | `string` | empty string |
198
+
199
+ ### `InputGroupInputComponent` and `InputGroupTextareaComponent`
200
+
201
+ | Input | Type | Default |
202
+ | ------- | -------- | ------------ |
203
+ | `class` | `string` | empty string |
204
+
205
+ All other native input and textarea attributes pass through unchanged.
206
+
207
+ ## Styling And Theming
208
+
209
+ - `InputGroup` owns the shared border, focus ring, radius, and background surface.
210
+ - `InputGroupAddon` uses logical separators so start and end alignments still read correctly in RTL layouts.
211
+ - Override `--radius` on the group root when the grouped field should be sharper or more pill-shaped.
212
+ - Add spacing or typography utilities through `class` on any primitive without breaking the core layout contract.
213
+
214
+ ## Accessibility
215
+
216
+ - Keep the input or textarea before addons in the DOM so tab order and assistive reading order stay predictable.
217
+ - Provide a visible label with `FormLabel`, `Label`, or another accessible name source.
218
+ - Give icon-only `InputGroupButton` elements an `aria-label`.
219
+ - Use `FormControl` inside `FormField` when labels, descriptions, and invalid messaging should auto-wire to the grouped control.
220
+
221
+ ## Keyboard Interactions
222
+
223
+ - Text input and textarea editing remain native.
224
+ - Buttons inside addons participate in the normal tab sequence after the text control.
225
+ - Changing `align` only affects visual placement; it does not change keyboard order.
226
+
227
+ ## Angular Notes
228
+
229
+ - `InputGroupInput` and `InputGroupTextarea` are attribute selectors on native controls, so native input and textarea behavior remains intact.
230
+ - For custom controls, set `data-slot="input-group-control"` and provide your own spacing utilities so the wrapper can still coordinate focus and addon layout.
231
+ - Upstream shadcn `Field` examples map to the local `FormField`, `FormLabel`, and `FormDescription` primitives rather than a separate `field` runtime component.
232
+
233
+ ## Source Parity
234
+
235
+ This Angular implementation covers the core shadcn Input Group primitives, all four addon alignments, textarea support, custom control guidance, and RTL composition.
236
+
237
+ Keyboard shortcut badges, dropdown triggers, and spinner/status rows are composed from the same primitives plus the local menu surface and inline status markup instead of requiring input-group-specific wrappers.
@@ -0,0 +1,278 @@
1
+ # Input OTP
2
+
3
+ Accessible one-time password input with grouped slots, copy-paste distribution, roving focus, signal-friendly control, and reactive-form support.
4
+
5
+ Use Input OTP for verification codes, step-up authentication, banking PIN entry, and short recovery codes where each character should be visually separated without losing keyboard or paste ergonomics.
6
+
7
+ ## Import
8
+
9
+ ```ts
10
+ import {
11
+ InputOtpComponent,
12
+ InputOtpGroupComponent,
13
+ InputOtpSeparatorComponent,
14
+ InputOtpSlotComponent,
15
+ REGEXP_ONLY_DIGITS,
16
+ REGEXP_ONLY_DIGITS_AND_CHARS,
17
+ } from '@ojiepermana/angular-component/input-otp';
18
+ ```
19
+
20
+ When the code input belongs to a richer field layout, pair it with the existing form primitives:
21
+
22
+ ```ts
23
+ import {
24
+ FormDescriptionComponent,
25
+ FormFieldComponent,
26
+ FormLabelComponent,
27
+ FormMessageComponent,
28
+ } from '@ojiepermana/angular-component/form';
29
+ ```
30
+
31
+ ## Composition
32
+
33
+ The Angular structure follows the shadcn Input OTP information architecture while translating it to standalone selectors.
34
+
35
+ ```text
36
+ InputOtp
37
+ ├── InputOtpGroup
38
+ │ ├── InputOtpSlot
39
+ │ ├── InputOtpSlot
40
+ │ └── InputOtpSlot
41
+ ├── InputOtpSeparator
42
+ └── InputOtpGroup
43
+ ├── InputOtpSlot
44
+ ├── InputOtpSlot
45
+ └── InputOtpSlot
46
+ ```
47
+
48
+ ## Basic Usage
49
+
50
+ Use the root component for value flow and the projected parts for layout.
51
+
52
+ ```ts
53
+ protected readonly code = signal('');
54
+ protected readonly digitsPattern = REGEXP_ONLY_DIGITS;
55
+ ```
56
+
57
+ ```html
58
+ <FormField>
59
+ <FormLabel>Verification code</FormLabel>
60
+ <InputOtp [maxLength]="6" [pattern]="digitsPattern" [value]="code()" (valueChange)="code.set($event)">
61
+ <InputOtpGroup>
62
+ <InputOtpSlot [index]="0" />
63
+ <InputOtpSlot [index]="1" />
64
+ <InputOtpSlot [index]="2" />
65
+ <InputOtpSlot [index]="3" />
66
+ <InputOtpSlot [index]="4" />
67
+ <InputOtpSlot [index]="5" />
68
+ </InputOtpGroup>
69
+ </InputOtp>
70
+ <FormDescription>Paste the code from your email or authenticator app.</FormDescription>
71
+ </FormField>
72
+ ```
73
+
74
+ ## Common Patterns
75
+
76
+ ### Separator groups
77
+
78
+ Split longer codes into smaller clusters when the verification flow benefits from visual chunking.
79
+
80
+ ```html
81
+ <InputOtp [maxLength]="6" [pattern]="digitsPattern" [value]="code()" (valueChange)="code.set($event)">
82
+ <InputOtpGroup>
83
+ <InputOtpSlot [index]="0" />
84
+ <InputOtpSlot [index]="1" />
85
+ </InputOtpGroup>
86
+ <InputOtpSeparator />
87
+ <InputOtpGroup>
88
+ <InputOtpSlot [index]="2" />
89
+ <InputOtpSlot [index]="3" />
90
+ </InputOtpGroup>
91
+ <InputOtpSeparator />
92
+ <InputOtpGroup>
93
+ <InputOtpSlot [index]="4" />
94
+ <InputOtpSlot [index]="5" />
95
+ </InputOtpGroup>
96
+ </InputOtp>
97
+ ```
98
+
99
+ ### Reactive forms
100
+
101
+ The root component implements `ControlValueAccessor` and also integrates directly with `FormField`, so labels, descriptions, and invalid-state wiring work without `FormControl`.
102
+
103
+ ```ts
104
+ readonly verificationForm = new FormGroup({
105
+ code: new FormControl('', {
106
+ nonNullable: true,
107
+ validators: [Validators.required, Validators.minLength(6)],
108
+ }),
109
+ });
110
+ ```
111
+
112
+ ```html
113
+ <FormField>
114
+ <FormLabel>Verification code</FormLabel>
115
+ <InputOtp formControlName="code" [maxLength]="6" [pattern]="digitsPattern">
116
+ <InputOtpGroup
117
+ class="*:data-[slot=input-otp-slot]:h-12 *:data-[slot=input-otp-slot]:w-11 *:data-[slot=input-otp-slot]:text-xl">
118
+ <InputOtpSlot [index]="0" />
119
+ <InputOtpSlot [index]="1" />
120
+ <InputOtpSlot [index]="2" />
121
+ </InputOtpGroup>
122
+ <InputOtpSeparator class="mx-2" />
123
+ <InputOtpGroup
124
+ class="*:data-[slot=input-otp-slot]:h-12 *:data-[slot=input-otp-slot]:w-11 *:data-[slot=input-otp-slot]:text-xl">
125
+ <InputOtpSlot [index]="3" />
126
+ <InputOtpSlot [index]="4" />
127
+ <InputOtpSlot [index]="5" />
128
+ </InputOtpGroup>
129
+ </InputOtp>
130
+ <FormDescription>Enter the 6-digit code sent to m@example.com.</FormDescription>
131
+ <FormMessage />
132
+ </FormField>
133
+ ```
134
+
135
+ ### Disabled and invalid states
136
+
137
+ Use the native `disabled` input when the code should remain visible but unavailable, and forward `aria-invalid="true"` when an expired or rejected code needs the destructive treatment.
138
+
139
+ ```html
140
+ <InputOtp [maxLength]="6" [pattern]="digitsPattern" value="123456" disabled>
141
+ <InputOtpGroup>
142
+ <InputOtpSlot [index]="0" />
143
+ <InputOtpSlot [index]="1" />
144
+ <InputOtpSlot [index]="2" />
145
+ </InputOtpGroup>
146
+ <InputOtpSeparator />
147
+ <InputOtpGroup>
148
+ <InputOtpSlot [index]="3" />
149
+ <InputOtpSlot [index]="4" />
150
+ <InputOtpSlot [index]="5" />
151
+ </InputOtpGroup>
152
+ </InputOtp>
153
+ ```
154
+
155
+ ```html
156
+ <InputOtp
157
+ aria-invalid="true"
158
+ [maxLength]="6"
159
+ [pattern]="digitsPattern"
160
+ [value]="invalidCode()"
161
+ (valueChange)="invalidCode.set($event)">
162
+ <InputOtpGroup>
163
+ <InputOtpSlot [index]="0" />
164
+ <InputOtpSlot [index]="1" />
165
+ <InputOtpSlot [index]="2" />
166
+ </InputOtpGroup>
167
+ <InputOtpSeparator />
168
+ <InputOtpGroup>
169
+ <InputOtpSlot [index]="3" />
170
+ <InputOtpSlot [index]="4" />
171
+ <InputOtpSlot [index]="5" />
172
+ </InputOtpGroup>
173
+ </InputOtp>
174
+ ```
175
+
176
+ ### Four digits and alphanumeric codes
177
+
178
+ Use `REGEXP_ONLY_DIGITS` for numeric OTPs and `REGEXP_ONLY_DIGITS_AND_CHARS` for mixed recovery codes.
179
+
180
+ ```html
181
+ <InputOtp [maxLength]="4" [pattern]="digitsPattern" [inputmode]="'numeric'">
182
+ <InputOtpGroup>
183
+ <InputOtpSlot [index]="0" />
184
+ <InputOtpSlot [index]="1" />
185
+ <InputOtpSlot [index]="2" />
186
+ <InputOtpSlot [index]="3" />
187
+ </InputOtpGroup>
188
+ </InputOtp>
189
+ ```
190
+
191
+ ```html
192
+ <InputOtp [maxLength]="6" [pattern]="digitsAndCharsPattern" [inputmode]="'text'">
193
+ <InputOtpGroup>
194
+ <InputOtpSlot [index]="0" />
195
+ <InputOtpSlot [index]="1" />
196
+ <InputOtpSlot [index]="2" />
197
+ </InputOtpGroup>
198
+ <InputOtpSeparator />
199
+ <InputOtpGroup>
200
+ <InputOtpSlot [index]="3" />
201
+ <InputOtpSlot [index]="4" />
202
+ <InputOtpSlot [index]="5" />
203
+ </InputOtpGroup>
204
+ </InputOtp>
205
+ ```
206
+
207
+ ## API Reference
208
+
209
+ ### `InputOtpComponent`
210
+
211
+ | Input | Type | Default |
212
+ | ------------------ | -------------------------- | ----------------- |
213
+ | `maxLength` | `number` | `6` |
214
+ | `value` | `string` | `undefined` |
215
+ | `pattern` | `RegExp \| string \| null` | `null` |
216
+ | `required` | `boolean` | `false` |
217
+ | `disabled` | `boolean` | `false` |
218
+ | `inputmode` | `string \| null` | `'numeric'` |
219
+ | `autocomplete` | `string \| null` | `'one-time-code'` |
220
+ | `aria-label` | `string \| null` | `null` |
221
+ | `aria-labelledby` | `string \| null` | `null` |
222
+ | `aria-describedby` | `string \| null` | `null` |
223
+ | `class` | `string` | `''` |
224
+
225
+ ### Output
226
+
227
+ | Output | Type |
228
+ | ------------- | -------- |
229
+ | `valueChange` | `string` |
230
+
231
+ ### Parts
232
+
233
+ | Part | Selector | Notes |
234
+ | ---------------------------- | ------------------- | ------------------------------------------------------------- |
235
+ | `InputOtpGroupComponent` | `InputOtpGroup` | Groups adjacent slots into one bordered cluster. |
236
+ | `InputOtpSlotComponent` | `InputOtpSlot` | Requires an `index` and renders the focusable character slot. |
237
+ | `InputOtpSeparatorComponent` | `InputOtpSeparator` | Inserts an optional visual separator between groups. |
238
+
239
+ Convenience exports: `REGEXP_ONLY_DIGITS` and `REGEXP_ONLY_DIGITS_AND_CHARS`.
240
+
241
+ ## Styling and Theming
242
+
243
+ The component exposes shadcn-style `data-slot` hooks on the root, group, separator, and slot hosts. Use `*:data-[slot=input-otp-slot]` utilities on `InputOtpGroup` when a layout needs taller or wider cells, for example:
244
+
245
+ ```html
246
+ <InputOtpGroup
247
+ class="*:data-[slot=input-otp-slot]:h-12 *:data-[slot=input-otp-slot]:w-11 *:data-[slot=input-otp-slot]:text-xl">
248
+ ...
249
+ </InputOtpGroup>
250
+ ```
251
+
252
+ The default styles use the shared border, ring, destructive, foreground, and muted-foreground tokens from the library theme.
253
+
254
+ ## Accessibility
255
+
256
+ - Each slot is a real input with an accessible name that includes its position in the sequence.
257
+ - `FormField` labels and descriptions wire to the component automatically when the OTP lives inside the field wrapper.
258
+ - `aria-invalid="true"` on the root forwards the destructive treatment across the slot set.
259
+ - Keep the surrounding label and helper text descriptive. Users should understand where the code came from and how many characters are expected.
260
+
261
+ ## Keyboard Interactions
262
+
263
+ - Typing a character replaces the current slot and advances focus.
264
+ - Paste distributes accepted characters from the current slot onward.
265
+ - Arrow keys move across slots and flip direction under RTL layouts.
266
+ - `Backspace` removes the current or previous slot and shifts the remaining value left.
267
+ - `Delete` removes the current slot and shifts the remaining value left.
268
+
269
+ ## Angular Notes
270
+
271
+ - Use `[value]` plus `(valueChange)` for signal-backed local state.
272
+ - Use `formControlName`, `[formControl]`, or `[(ngModel)]` for form-driven flows.
273
+ - There is no separate `defaultValue` input; seed the initial code with the bound signal or form control value.
274
+ - Unlike native inputs, this component does not need `FormControl`; it integrates with the form-field context directly.
275
+
276
+ ## Source Parity
277
+
278
+ This Angular slice keeps the shadcn composition, grouped separators, pattern filtering, paste handling, and verification-form examples. The deliberate Angular deviation is the runtime implementation: each slot is a visible input coordinated by the root CVA instead of the upstream single hidden-input package. Browser one-time-code autofill works best through the first slot with the default `autocomplete="one-time-code"` behavior.