@egose/shadcn-theme-ng 0.1.0 → 0.3.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 (162) hide show
  1. package/README.md +2 -2
  2. package/accordion/README.md +405 -2
  3. package/alert/README.md +372 -2
  4. package/alert-dialog/README.md +471 -5
  5. package/aspect-ratio/README.md +272 -5
  6. package/autocomplete/README.md +502 -2
  7. package/autocomplete/fesm2022/autocomplete.mjs +1 -1
  8. package/avatar/README.md +357 -5
  9. package/badge/README.md +318 -2
  10. package/basic-alert/README.md +353 -2
  11. package/breadcrumb/README.md +406 -5
  12. package/button/README.md +482 -2
  13. package/button/fesm2022/button.mjs +85 -107
  14. package/button/types/button.d.ts +5 -8
  15. package/button-group/README.md +318 -5
  16. package/calendar/README.md +357 -2
  17. package/card/README.md +331 -5
  18. package/carousel/README.md +333 -5
  19. package/carousel/fesm2022/carousel.mjs +4 -1
  20. package/checkbox/README.md +320 -2
  21. package/checkbox/fesm2022/checkbox.mjs +6 -7
  22. package/checkbox/types/checkbox.d.ts +1 -1
  23. package/collapsible/README.md +332 -5
  24. package/combobox/README.md +507 -5
  25. package/combobox/fesm2022/combobox.mjs +5 -2
  26. package/command/README.md +435 -5
  27. package/confirmation-dialog/README.md +301 -2
  28. package/context-menu/README.md +366 -5
  29. package/date-picker/README.md +469 -2
  30. package/date-picker/fesm2022/date-picker.mjs +150 -32
  31. package/date-picker/types/date-picker.d.ts +102 -9
  32. package/dialog/README.md +448 -2
  33. package/drawer/README.md +395 -5
  34. package/dropdown-menu/README.md +417 -5
  35. package/empty/README.md +329 -5
  36. package/field/README.md +385 -5
  37. package/form-autocomplete/README.md +177 -0
  38. package/form-autocomplete/fesm2022/form-autocomplete.mjs +125 -0
  39. package/form-autocomplete/package.json +24 -0
  40. package/form-autocomplete/types/form-autocomplete.d.ts +61 -0
  41. package/form-checkbox/README.md +322 -2
  42. package/form-checkbox/fesm2022/form-checkbox.mjs +22 -9
  43. package/form-checkbox/types/form-checkbox.d.ts +23 -4
  44. package/form-combobox/README.md +202 -0
  45. package/form-combobox/fesm2022/form-combobox.mjs +147 -0
  46. package/form-combobox/package.json +24 -0
  47. package/form-combobox/types/form-combobox.d.ts +73 -0
  48. package/form-date-picker/README.md +348 -2
  49. package/form-date-picker/fesm2022/form-date-picker.mjs +38 -12
  50. package/form-date-picker/types/form-date-picker.d.ts +17 -1
  51. package/form-date-picker-multi/README.md +191 -0
  52. package/form-date-picker-multi/fesm2022/form-date-picker-multi.mjs +129 -0
  53. package/form-date-picker-multi/package.json +24 -0
  54. package/form-date-picker-multi/types/form-date-picker-multi.d.ts +58 -0
  55. package/form-date-range-picker/README.md +253 -0
  56. package/form-date-range-picker/fesm2022/form-date-range-picker.mjs +130 -0
  57. package/form-date-range-picker/package.json +24 -0
  58. package/form-date-range-picker/types/form-date-range-picker.d.ts +55 -0
  59. package/form-field/README.md +356 -2
  60. package/form-field-simple/README.md +340 -2
  61. package/form-input-otp/README.md +194 -0
  62. package/form-input-otp/fesm2022/form-input-otp.mjs +106 -0
  63. package/form-input-otp/package.json +24 -0
  64. package/form-input-otp/types/form-input-otp.d.ts +58 -0
  65. package/form-month-year-picker/README.md +188 -0
  66. package/form-month-year-picker/fesm2022/form-month-year-picker.mjs +125 -0
  67. package/form-month-year-picker/package.json +24 -0
  68. package/form-month-year-picker/types/form-month-year-picker.d.ts +53 -0
  69. package/form-native-select/README.md +205 -0
  70. package/form-native-select/fesm2022/form-native-select.mjs +103 -0
  71. package/form-native-select/package.json +24 -0
  72. package/form-native-select/types/form-native-select.d.ts +57 -0
  73. package/form-phone-input/README.md +188 -0
  74. package/form-phone-input/fesm2022/form-phone-input.mjs +113 -0
  75. package/form-phone-input/package.json +24 -0
  76. package/form-phone-input/types/form-phone-input.d.ts +58 -0
  77. package/form-radio-group/README.md +198 -0
  78. package/form-radio-group/fesm2022/form-radio-group.mjs +111 -0
  79. package/form-radio-group/package.json +24 -0
  80. package/form-radio-group/types/form-radio-group.d.ts +63 -0
  81. package/form-searchable-multiselect/README.md +371 -2
  82. package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +19 -10
  83. package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +18 -1
  84. package/form-select/README.md +360 -2
  85. package/form-select/fesm2022/form-select.mjs +20 -11
  86. package/form-select/types/form-select.d.ts +18 -1
  87. package/form-slider/README.md +182 -0
  88. package/form-slider/fesm2022/form-slider.mjs +106 -0
  89. package/form-slider/package.json +24 -0
  90. package/form-slider/types/form-slider.d.ts +60 -0
  91. package/form-switch/README.md +173 -0
  92. package/form-switch/fesm2022/form-switch.mjs +100 -0
  93. package/form-switch/package.json +24 -0
  94. package/form-switch/types/form-switch.d.ts +50 -0
  95. package/form-text-input/README.md +381 -2
  96. package/form-text-input/fesm2022/form-text-input.mjs +19 -10
  97. package/form-text-input/types/form-text-input.d.ts +18 -1
  98. package/form-textarea/README.md +357 -2
  99. package/form-textarea/fesm2022/form-textarea.mjs +19 -10
  100. package/form-textarea/types/form-textarea.d.ts +18 -1
  101. package/form-toggle/README.md +186 -0
  102. package/form-toggle/fesm2022/form-toggle.mjs +159 -0
  103. package/form-toggle/package.json +24 -0
  104. package/form-toggle/types/form-toggle.d.ts +82 -0
  105. package/form-toggle-group/README.md +176 -0
  106. package/form-toggle-group/fesm2022/form-toggle-group.mjs +116 -0
  107. package/form-toggle-group/package.json +24 -0
  108. package/form-toggle-group/types/form-toggle-group.d.ts +65 -0
  109. package/hover-card/README.md +256 -5
  110. package/icon/README.md +239 -2
  111. package/input/README.md +269 -2
  112. package/input-group/README.md +335 -5
  113. package/input-group/fesm2022/input-group.mjs +22 -12
  114. package/input-group/types/input-group.d.ts +4 -1
  115. package/input-otp/README.md +375 -5
  116. package/item/README.md +385 -5
  117. package/item/fesm2022/item.mjs +3 -3
  118. package/kbd/README.md +291 -5
  119. package/label/README.md +272 -2
  120. package/layout-simple/README.md +193 -2
  121. package/layout-simple/fesm2022/layout-simple.mjs +472 -236
  122. package/layout-simple/types/layout-simple.d.ts +174 -137
  123. package/menu/README.md +417 -2
  124. package/menubar/README.md +343 -5
  125. package/native-select/README.md +323 -5
  126. package/native-select/fesm2022/native-select.mjs +18 -6
  127. package/native-select/types/native-select.d.ts +7 -2
  128. package/navigation-menu/README.md +369 -5
  129. package/package.json +57 -1
  130. package/pagination/README.md +388 -5
  131. package/phone-input/README.md +114 -0
  132. package/phone-input/fesm2022/phone-input.mjs +191 -0
  133. package/phone-input/package.json +24 -0
  134. package/phone-input/types/phone-input.d.ts +67 -0
  135. package/popover/README.md +331 -2
  136. package/progress/README.md +311 -5
  137. package/radio-group/README.md +364 -2
  138. package/radio-group/fesm2022/radio-group.mjs +5 -1
  139. package/resizable/README.md +269 -5
  140. package/scroll-area/README.md +233 -5
  141. package/searchable-multiselect/README.md +323 -2
  142. package/select/README.md +437 -2
  143. package/separator/README.md +222 -2
  144. package/sheet/README.md +311 -2
  145. package/sidebar/README.md +457 -5
  146. package/skeleton/README.md +217 -5
  147. package/slider/README.md +273 -5
  148. package/slider/fesm2022/slider.mjs +3 -3
  149. package/sonner/README.md +346 -2
  150. package/spinner/README.md +284 -2
  151. package/switch/README.md +310 -2
  152. package/switch/fesm2022/switch.mjs +7 -5
  153. package/switch/types/switch.d.ts +2 -1
  154. package/table/README.md +423 -5
  155. package/tabs/README.md +411 -2
  156. package/tabs/fesm2022/tabs.mjs +2 -2
  157. package/textarea/README.md +282 -5
  158. package/toggle/README.md +270 -5
  159. package/toggle-group/README.md +340 -5
  160. package/tooltip/README.md +269 -2
  161. package/typography/README.md +271 -5
  162. package/utils/README.md +303 -2
@@ -1,11 +1,477 @@
1
- # AlertDialog
1
+ # Alert Dialog (`@egose/shadcn-theme-ng/alert-dialog`)
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli).
3
+ A modal confirmation dialog in the shadcn/ui Alert Dialog style: an overlay plus a centered panel
4
+ with a title, description, optional media illustration, and an action/cancel footer. Use it for
5
+ destructive or consequential confirmations ("Delete project?") that require an explicit choice.
4
6
 
5
- ## Building
7
+ The implementation styles the headless
8
+ [`BrnAlertDialog*` primitives from `@spartan-ng/brain/alert-dialog`](https://www.spartan-ng.com/)
9
+ (plus `BrnDialogClose` and the shared `BrnDialog` plumbing from `@spartan-ng/brain/dialog`).
10
+ `HlmAlertDialog` is a component extending `BrnAlertDialog` that renders the overlay and projects
11
+ the rest; every other piece is a thin directive adding `data-slot` attributes and shadcn classes
12
+ via `classes()` / `hlm()`. The action/cancel buttons reuse `HlmBtn` from
13
+ `@egose/shadcn-theme-ng/button` through `hostDirectives`, so `variant`/`size` inputs work on them
14
+ directly.
6
15
 
7
- To build the library, run:
16
+ > **Ships as:** `@egose/shadcn-theme-ng/alert-dialog` and `@egose/shadcn-theme-ng-tw/alert-dialog`
17
+ > (the `tw:`-prefixed Tailwind variant). Both expose the identical TypeScript surface; only the
18
+ > emitted Tailwind class strings differ. See the [package README](../../README.md) for install
19
+ > steps, peer dependencies, and Tailwind setup. Do not publish this project directory independently.
20
+
21
+ ## Installation
8
22
 
9
23
  ```bash
10
- ng build alert-dialog
24
+ # Plain Tailwind (no prefix)
25
+ npm install @egose/shadcn-theme-ng
26
+
27
+ # tw:-prefixed Tailwind variant
28
+ npm install @egose/shadcn-theme-ng-tw
29
+ ```
30
+
31
+ Peer dependencies (Angular, `@spartan-ng/brain`, `@ng-icons/*`, `rxjs`, …) are documented in the
32
+ [package README](../../README.md#peer-dependencies). This subpath additionally relies at runtime on
33
+ `@egose/shadcn-theme-ng/utils` (`classes()`/`hlm()`) and
34
+ `@egose/shadcn-theme-ng/button` (`HlmBtn`, `provideBrnButtonConfig`).
35
+
36
+ ## Imports
37
+
38
+ All symbols are exported from the subpath root (`projects/alert-dialog/src/public-api.ts`):
39
+
40
+ ```ts
41
+ import {
42
+ HlmAlertDialog,
43
+ HlmAlertDialogTrigger,
44
+ HlmAlertDialogPortal,
45
+ HlmAlertDialogOverlay,
46
+ HlmAlertDialogContent,
47
+ HlmAlertDialogHeader,
48
+ HlmAlertDialogMedia,
49
+ HlmAlertDialogTitle,
50
+ HlmAlertDialogDescription,
51
+ HlmAlertDialogFooter,
52
+ HlmAlertDialogAction,
53
+ HlmAlertDialogCancel,
54
+ HlmAlertDialogImports,
55
+ HlmAlertDialogModule,
56
+ } from '@egose/shadcn-theme-ng/alert-dialog';
57
+ // tw variant: replace with '@egose/shadcn-theme-ng-tw/alert-dialog'
58
+ ```
59
+
60
+ Standalone component — spread the `*Imports` array:
61
+
62
+ ```ts
63
+ import { Component } from '@angular/core';
64
+ import { HlmAlertDialogImports } from '@egose/shadcn-theme-ng/alert-dialog';
65
+
66
+ @Component({
67
+ selector: 'app-demo',
68
+ standalone: true,
69
+ imports: [...HlmAlertDialogImports],
70
+ template: `...`,
71
+ })
72
+ export class DemoComponent {}
11
73
  ```
74
+
75
+ NgModule-based consumer — import the module:
76
+
77
+ ```ts
78
+ import { NgModule } from '@angular/core';
79
+ import { HlmAlertDialogModule } from '@egose/shadcn-theme-ng/alert-dialog';
80
+
81
+ @NgModule({ imports: [HlmAlertDialogModule] })
82
+ export class DemoModule {}
83
+ ```
84
+
85
+ ## Anatomy / Structure
86
+
87
+ ```html
88
+ <hlm-alert-dialog>
89
+ <button hlmAlertDialogTrigger>Delete project</button>
90
+
91
+ <div hlmAlertDialogPortal>
92
+ <div hlmAlertDialogContent size="default">
93
+ <div hlmAlertDialogHeader>
94
+ <div hlmAlertDialogMedia>
95
+ <ng-icon name="lucideTrash" />
96
+ </div>
97
+ <h2 hlmAlertDialogTitle>Delete project?</h2>
98
+ <p hlmAlertDialogDescription>This cannot be undone.</p>
99
+ </div>
100
+ <div hlmAlertDialogFooter>
101
+ <button hlmAlertDialogCancel>Cancel</button>
102
+ <button hlmAlertDialogAction>Delete</button>
103
+ </div>
104
+ </div>
105
+ </div>
106
+ </hlm-alert-dialog>
107
+ ```
108
+
109
+ Real selectors (from source):
110
+
111
+ | Class | Selector(s) | Kind |
112
+ | --------------------------- | ----------------------------------------------------------------- | --------- |
113
+ | `HlmAlertDialog` | `hlm-alert-dialog` (`exportAs: hlmAlertDialog`) | Component |
114
+ | `HlmAlertDialogTrigger` | `button[hlmAlertDialogTrigger], button[hlmAlertDialogTriggerFor]` | Directive |
115
+ | `HlmAlertDialogPortal` | `[hlmAlertDialogPortal]` | Directive |
116
+ | `HlmAlertDialogOverlay` | `[hlmAlertDialogOverlay], hlm-alert-dialog-overlay` | Directive |
117
+ | `HlmAlertDialogContent` | `[hlmAlertDialogContent], hlm-alert-dialog-content` | Directive |
118
+ | `HlmAlertDialogHeader` | `[hlmAlertDialogHeader], hlm-alert-dialog-header` | Directive |
119
+ | `HlmAlertDialogMedia` | `[hlmAlertDialogMedia], hlm-alert-dialog-media` | Directive |
120
+ | `HlmAlertDialogTitle` | `[hlmAlertDialogTitle]` | Directive |
121
+ | `HlmAlertDialogDescription` | `[hlmAlertDialogDescription]` | Directive |
122
+ | `HlmAlertDialogFooter` | `[hlmAlertDialogFooter], hlm-alert-dialog-footer` | Directive |
123
+ | `HlmAlertDialogAction` | `button[hlmAlertDialogAction]` | Directive |
124
+ | `HlmAlertDialogCancel` | `button[hlmAlertDialogCancel]` | Directive |
125
+
126
+ `HlmAlertDialog` itself renders `<hlm-alert-dialog-overlay />` plus `<ng-content />`, and provides
127
+ `BrnDialog` (aliased to itself) with `BRN_ALERT_DIALOG_DEFAULT_OPTIONS`, so open/close state,
128
+ focus trapping, and outside-pointer handling come from the brain dialog.
129
+
130
+ ## API reference
131
+
132
+ ### `HlmAlertDialog` — `hlm-alert-dialog`
133
+
134
+ Root component extending `BrnAlertDialog`. No own inputs — the full `BrnAlertDialog` surface
135
+ (open state, context) is inherited. Exposed as template ref `hlmAlertDialog`.
136
+
137
+ ### `HlmAlertDialogTrigger` — `button[hlmAlertDialogTrigger], button[hlmAlertDialogTriggerFor]`
138
+
139
+ Wraps `BrnAlertDialogTrigger`.
140
+
141
+ | Input (via `BrnAlertDialogTrigger`) | Description |
142
+ | ---------------------------------------------------------------- | ---------------------------------- |
143
+ | `id` | Dialog id to toggle. |
144
+ | `hlmAlertDialogTriggerFor` (alias of `brnAlertDialogTriggerFor`) | Template/dialog reference to open. |
145
+ | `type` | Button type passthrough. |
146
+
147
+ ### `HlmAlertDialogPortal` — `[hlmAlertDialogPortal]`
148
+
149
+ Wraps `BrnAlertDialogContent` (the CDK-portal outlet).
150
+
151
+ | Input (via brain) | Description |
152
+ | ----------------- | --------------------------------------- |
153
+ | `context` | Template context for the portal. |
154
+ | `class` | Classes forwarded to the portal outlet. |
155
+
156
+ ### `HlmAlertDialogContent` — `[hlmAlertDialogContent], hlm-alert-dialog-content`
157
+
158
+ The visible panel. Reads live open/closed state from the injected `ExposesStateProvider`
159
+ (`state()` signal, defaulting to `'closed'`) and reflects it as `data-state`; `size()` is
160
+ reflected as `data-size`, which the footer/header/media styles key off.
161
+
162
+ | Input | Type | Default | Description |
163
+ | ------- | ------------------- | ----------- | ------------------------------------------------------------ |
164
+ | `size` | `'sm' \| 'default'` | `'default'` | Panel width (`sm` renders a compact two-column footer grid). |
165
+ | `state` | `Signal<string>` | inherited | Read-only live dialog state (`'open' \| 'closed'`). |
166
+
167
+ ### `HlmAlertDialogOverlay` — `[hlmAlertDialogOverlay], hlm-alert-dialog-overlay`
168
+
169
+ Wraps `BrnAlertDialogOverlay` and forwards the computed dim/backdrop-blur classes to the
170
+ custom element via `injectCustomClassSettable`.
171
+
172
+ | Input | Type | Default | Description |
173
+ | ------- | ------------ | ------- | --------------------------------- |
174
+ | `class` | `ClassValue` | `''` | Extra classes merged via `hlm()`. |
175
+
176
+ ### `HlmAlertDialogTitle` / `HlmAlertDialogDescription`
177
+
178
+ Thin wrappers around `BrnAlertDialogTitle` / `BrnAlertDialogDescription`. No own inputs; they add
179
+ `data-slot` and shadcn type styles.
180
+
181
+ ### `HlmAlertDialogHeader` / `HlmAlertDialogFooter` / `HlmAlertDialogMedia`
182
+
183
+ Layout-only directives, no inputs. Header centers content (switching to start-aligned on `sm`
184
+ screens for `size="default"`); footer stacks buttons in a column on mobile and a right-aligned row
185
+ on `sm+` (a 2-column grid for `size="sm"`); media renders the `size-16` muted illustration box.
186
+
187
+ ### `HlmAlertDialogAction` — `button[hlmAlertDialogAction]`
188
+
189
+ Confirm button. Composes `HlmBtn` (`variant`/`size` inputs forwarded), **not** `BrnDialogClose` —
190
+ closing on confirm is your handler's job.
191
+
192
+ | Input | Type | Default | Description |
193
+ | --------- | --------------------------------- | ------------- | ------------------- |
194
+ | `variant` | via `HlmBtn` | (btn default) | Button tone. |
195
+ | `size` | via `HlmBtn` | (btn default) | Button size. |
196
+ | `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | Native button type. |
197
+
198
+ ### `HlmAlertDialogCancel` — `button[hlmAlertDialogCancel]`
199
+
200
+ Cancel button. Composes `BrnDialogClose` (closes automatically) + `HlmBtn`, with
201
+ `provideBrnButtonConfig({ variant: 'outline' })` so it renders outlined by default.
202
+
203
+ | Input | Type | Default | Description |
204
+ | --------- | --------------------------------- | ------------- | -------------------------- |
205
+ | `variant` | via `HlmBtn` | `'outline'` | Button tone (overridable). |
206
+ | `size` | via `HlmBtn` | (btn default) | Button size. |
207
+ | `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | Native button type. |
208
+
209
+ ## Examples
210
+
211
+ ### 1. Basic delete confirmation
212
+
213
+ ```ts
214
+ import { Component } from '@angular/core';
215
+ import { HlmAlertDialogImports } from '@egose/shadcn-theme-ng/alert-dialog';
216
+
217
+ @Component({
218
+ selector: 'app-alert-dialog-basic',
219
+ standalone: true,
220
+ imports: [...HlmAlertDialogImports],
221
+ template: `
222
+ <hlm-alert-dialog>
223
+ <button hlmAlertDialogTrigger>Delete project</button>
224
+ <div hlmAlertDialogPortal>
225
+ <div hlmAlertDialogContent>
226
+ <div hlmAlertDialogHeader>
227
+ <h2 hlmAlertDialogTitle>Delete project?</h2>
228
+ <p hlmAlertDialogDescription>This permanently removes the project and its data. This cannot be undone.</p>
229
+ </div>
230
+ <div hlmAlertDialogFooter>
231
+ <button hlmAlertDialogCancel>Cancel</button>
232
+ <button hlmAlertDialogAction (click)="remove()">Delete</button>
233
+ </div>
234
+ </div>
235
+ </div>
236
+ </hlm-alert-dialog>
237
+ `,
238
+ })
239
+ export class AlertDialogBasicComponent {
240
+ remove() {
241
+ /* call the delete API, then the dialog stays until Cancel/close */
242
+ }
243
+ }
244
+ ```
245
+
246
+ ```html
247
+ <app-alert-dialog-basic />
248
+ ```
249
+
250
+ ### 2. Compact (`size="sm"`) dialog with media illustration
251
+
252
+ ```ts
253
+ import { Component } from '@angular/core';
254
+ import { NgIcon, provideIcons } from '@ng-icons/core';
255
+ import { lucideTriangleAlert } from '@ng-icons/lucide';
256
+ import { HlmAlertDialogImports } from '@egose/shadcn-theme-ng/alert-dialog';
257
+
258
+ @Component({
259
+ selector: 'app-alert-dialog-media',
260
+ standalone: true,
261
+ imports: [...HlmAlertDialogImports, NgIcon],
262
+ providers: [provideIcons({ lucideTriangleAlert })],
263
+ template: `
264
+ <hlm-alert-dialog>
265
+ <button hlmAlertDialogTrigger>Leave page</button>
266
+ <div hlmAlertDialogPortal>
267
+ <div hlmAlertDialogContent size="sm">
268
+ <div hlmAlertDialogHeader>
269
+ <div hlmAlertDialogMedia>
270
+ <ng-icon name="lucideTriangleAlert" />
271
+ </div>
272
+ <h2 hlmAlertDialogTitle>Discard changes?</h2>
273
+ <p hlmAlertDialogDescription>You have unsaved edits that will be lost.</p>
274
+ </div>
275
+ <div hlmAlertDialogFooter>
276
+ <button hlmAlertDialogCancel>Keep editing</button>
277
+ <button hlmAlertDialogAction (click)="discard()">Discard</button>
278
+ </div>
279
+ </div>
280
+ </div>
281
+ </hlm-alert-dialog>
282
+ `,
283
+ })
284
+ export class AlertDialogMediaComponent {
285
+ discard() {}
286
+ }
287
+ ```
288
+
289
+ ### 3. Custom button tones via `HlmBtn` inputs
290
+
291
+ `hlmAlertDialogAction` / `hlmAlertDialogCancel` forward `variant` and `size` to `HlmBtn`:
292
+
293
+ ```ts
294
+ import { Component } from '@angular/core';
295
+ import { HlmAlertDialogImports } from '@egose/shadcn-theme-ng/alert-dialog';
296
+
297
+ @Component({
298
+ selector: 'app-alert-dialog-tones',
299
+ standalone: true,
300
+ imports: [...HlmAlertDialogImports],
301
+ template: `
302
+ <hlm-alert-dialog>
303
+ <button hlmAlertDialogTrigger>Archive workspace</button>
304
+ <div hlmAlertDialogPortal>
305
+ <div hlmAlertDialogContent>
306
+ <div hlmAlertDialogHeader>
307
+ <h2 hlmAlertDialogTitle>Archive workspace?</h2>
308
+ <p hlmAlertDialogDescription>Members lose access until you restore it.</p>
309
+ </div>
310
+ <div hlmAlertDialogFooter>
311
+ <button hlmAlertDialogCancel variant="ghost" size="sm">Back</button>
312
+ <button hlmAlertDialogAction variant="destructive" size="sm" (click)="archive()">Archive</button>
313
+ </div>
314
+ </div>
315
+ </div>
316
+ </hlm-alert-dialog>
317
+ `,
318
+ })
319
+ export class AlertDialogTonesComponent {
320
+ archive() {}
321
+ }
322
+ ```
323
+
324
+ ### 4. Programmatic control with a template reference
325
+
326
+ `HlmAlertDialog` has `exportAs: hlmAlertDialog` and extends `BrnAlertDialog`, so the brain's
327
+ open/close API is available from the template or a `@ViewChild`:
328
+
329
+ ```ts
330
+ import { Component, viewChild } from '@angular/core';
331
+ import { HlmAlertDialog, HlmAlertDialogImports } from '@egose/shadcn-theme-ng/alert-dialog';
332
+
333
+ @Component({
334
+ selector: 'app-alert-dialog-programmatic',
335
+ standalone: true,
336
+ imports: [...HlmAlertDialogImports],
337
+ template: `
338
+ <hlm-alert-dialog #dialog="hlmAlertDialog">
339
+ <div hlmAlertDialogPortal>
340
+ <div hlmAlertDialogContent>
341
+ <div hlmAlertDialogHeader>
342
+ <h2 hlmAlertDialogTitle>Session expired</h2>
343
+ <p hlmAlertDialogDescription>Sign in again to continue.</p>
344
+ </div>
345
+ <div hlmAlertDialogFooter>
346
+ <button hlmAlertDialogCancel>Later</button>
347
+ <button hlmAlertDialogAction (click)="reauth()">Sign in</button>
348
+ </div>
349
+ </div>
350
+ </div>
351
+ </hlm-alert-dialog>
352
+ <button (click)="open()">Check session</button>
353
+ `,
354
+ })
355
+ export class AlertDialogProgrammaticComponent {
356
+ private readonly dialog = viewChild<HlmAlertDialog>('dialog');
357
+
358
+ open() {
359
+ this.dialog()?.open?.();
360
+ }
361
+ reauth() {
362
+ /* ... */ this.dialog()?.close?.();
363
+ }
364
+ }
365
+ ```
366
+
367
+ > The exact open/close method names live on `BrnAlertDialog` from `@spartan-ng/brain/alert-dialog`;
368
+ > consult that class for the current API — this package adds no methods of its own.
369
+
370
+ ### 5. Element-form variants (element selectors)
371
+
372
+ Header, footer, media, and content also match element selectors, which reads better in long
373
+ templates:
374
+
375
+ ```html
376
+ <hlm-alert-dialog>
377
+ <button hlmAlertDialogTrigger>Reset settings</button>
378
+ <div hlmAlertDialogPortal>
379
+ <hlm-alert-dialog-content>
380
+ <hlm-alert-dialog-header>
381
+ <h2 hlmAlertDialogTitle>Reset to defaults?</h2>
382
+ <p hlmAlertDialogDescription>Custom themes and shortcuts will be removed.</p>
383
+ </hlm-alert-dialog-header>
384
+ <hlm-alert-dialog-footer>
385
+ <button hlmAlertDialogCancel>Cancel</button>
386
+ <button hlmAlertDialogAction (click)="reset()">Reset</button>
387
+ </hlm-alert-dialog-footer>
388
+ </hlm-alert-dialog-content>
389
+ </div>
390
+ </hlm-alert-dialog>
391
+ ```
392
+
393
+ ```ts
394
+ import { Component } from '@angular/core';
395
+ import { HlmAlertDialogImports } from '@egose/shadcn-theme-ng/alert-dialog';
396
+
397
+ @Component({
398
+ selector: 'app-alert-dialog-elements',
399
+ standalone: true,
400
+ imports: [...HlmAlertDialogImports],
401
+ templateUrl: './alert-dialog-elements.html',
402
+ })
403
+ export class AlertDialogElementsComponent {
404
+ reset() {}
405
+ }
406
+ ```
407
+
408
+ ### 6. Async confirm with a loading button
409
+
410
+ Combine the footer action with the loading state of `HlmButton` for server round-trips:
411
+
412
+ ```ts
413
+ import { Component, signal } from '@angular/core';
414
+ import { HlmAlertDialogImports } from '@egose/shadcn-theme-ng/alert-dialog';
415
+ import { HlmButtonImports } from '@egose/shadcn-theme-ng/button';
416
+
417
+ @Component({
418
+ selector: 'app-alert-dialog-async',
419
+ standalone: true,
420
+ imports: [...HlmAlertDialogImports, ...HlmButtonImports],
421
+ template: `
422
+ <hlm-alert-dialog>
423
+ <button hlmAlertDialogTrigger>Transfer ownership</button>
424
+ <div hlmAlertDialogPortal>
425
+ <div hlmAlertDialogContent>
426
+ <div hlmAlertDialogHeader>
427
+ <h2 hlmAlertDialogTitle>Transfer ownership?</h2>
428
+ <p hlmAlertDialogDescription>You will become a regular member.</p>
429
+ </div>
430
+ <div hlmAlertDialogFooter>
431
+ <button hlmAlertDialogCancel [disabled]="saving()">Cancel</button>
432
+ <button hlmButton variant="primary" [loading]="saving()" (click)="transfer()">Transfer</button>
433
+ </div>
434
+ </div>
435
+ </div>
436
+ </hlm-alert-dialog>
437
+ `,
438
+ })
439
+ export class AlertDialogAsyncComponent {
440
+ readonly saving = signal(false);
441
+
442
+ async transfer() {
443
+ this.saving.set(true);
444
+ try {
445
+ await fetch('/api/transfer', { method: 'POST' });
446
+ } finally {
447
+ this.saving.set(false);
448
+ }
449
+ }
450
+ }
451
+ ```
452
+
453
+ ## Accessibility notes
454
+
455
+ - The dialog is modal: the brain traps focus inside, restores focus to the trigger on close, and
456
+ exposes the panel as an `alertdialog` to assistive technology. Titles and descriptions are wired
457
+ to the panel via `BrnAlertDialogTitle` / `BrnAlertDialogDescription` — always include both so
458
+ screen readers announce purpose and consequence.
459
+ - `HlmAlertDialogCancel` closes via `BrnDialogClose` (Escape and overlay dismissal behave per
460
+ `BRN_ALERT_DIALOG_DEFAULT_OPTIONS`). `HlmAlertDialogAction` deliberately does **not** auto-close:
461
+ keep it that way for destructive flows so a failed request cannot silently dismiss the prompt.
462
+ - The action/cancel buttons are native `<button>` elements — keep their labels verb-led
463
+ ("Delete project", not "OK") and distinct from each other.
464
+
465
+ ## Theming / CSS variables
466
+
467
+ Class-based styling (popover tokens, `ring-foreground/10`, `animate-in/out` utilities); no
468
+ component-specific CSS variables. The overlay uses `bg-black/10` with a subtle backdrop blur, and
469
+ the panel animates on `data-state` (`fade` + `zoom`). Override via `class` on the overlay
470
+ (forwarded through the custom-element class settable) or any other piece.
471
+
472
+ ## Related subpaths
473
+
474
+ - `@egose/shadcn-theme-ng/dialog` — general (non-alert) modal dialogs
475
+ - `@egose/shadcn-theme-ng/confirmation-dialog` — higher-level confirm helper
476
+ - `@egose/shadcn-theme-ng/button` — `HlmBtn` / `HlmButton` used by the footer actions
477
+ - `@egose/shadcn-theme-ng/sonner` — non-blocking toast feedback after confirm