@egose/shadcn-theme-ng 0.0.28 → 0.2.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 (237) hide show
  1. package/README.md +130 -13
  2. package/accordion/README.md +376 -34
  3. package/accordion/fesm2022/accordion.mjs +27 -39
  4. package/alert/README.md +343 -34
  5. package/alert/fesm2022/alert.mjs +47 -47
  6. package/alert-dialog/README.md +471 -5
  7. package/alert-dialog/fesm2022/alert-dialog.mjs +47 -47
  8. package/aspect-ratio/README.md +272 -5
  9. package/aspect-ratio/fesm2022/aspect-ratio.mjs +9 -9
  10. package/autocomplete/README.md +473 -34
  11. package/autocomplete/fesm2022/autocomplete.mjs +53 -71
  12. package/avatar/README.md +357 -5
  13. package/avatar/fesm2022/avatar.mjs +32 -32
  14. package/badge/README.md +289 -34
  15. package/badge/fesm2022/badge.mjs +57 -57
  16. package/basic-alert/README.md +324 -34
  17. package/basic-alert/fesm2022/basic-alert.mjs +6 -18
  18. package/breadcrumb/README.md +406 -5
  19. package/breadcrumb/fesm2022/breadcrumb.mjs +33 -39
  20. package/button/README.md +453 -34
  21. package/button/fesm2022/button.mjs +147 -219
  22. package/button/types/button.d.ts +7 -10
  23. package/button-group/README.md +318 -5
  24. package/button-group/fesm2022/button-group.mjs +20 -20
  25. package/calendar/README.md +328 -34
  26. package/calendar/fesm2022/calendar.mjs +29 -743
  27. package/card/README.md +331 -5
  28. package/card/fesm2022/card.mjs +33 -33
  29. package/carousel/README.md +333 -5
  30. package/carousel/fesm2022/carousel.mjs +39 -78
  31. package/checkbox/README.md +291 -34
  32. package/checkbox/fesm2022/checkbox.mjs +20 -58
  33. package/checkbox/types/checkbox.d.ts +5 -4
  34. package/collapsible/README.md +332 -5
  35. package/collapsible/fesm2022/collapsible.mjs +15 -15
  36. package/combobox/README.md +507 -5
  37. package/combobox/fesm2022/combobox.mjs +91 -224
  38. package/command/README.md +435 -5
  39. package/command/fesm2022/command.mjs +49 -109
  40. package/confirmation-dialog/README.md +272 -34
  41. package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +15 -40
  42. package/confirmation-dialog/types/confirmation-dialog.d.ts +8 -4
  43. package/context-menu/README.md +366 -5
  44. package/context-menu/fesm2022/context-menu.mjs +9 -9
  45. package/date-picker/README.md +436 -34
  46. package/date-picker/fesm2022/date-picker.mjs +64 -267
  47. package/date-picker/types/date-picker.d.ts +7 -3
  48. package/dialog/README.md +419 -34
  49. package/dialog/fesm2022/dialog.mjs +45 -71
  50. package/drawer/README.md +395 -5
  51. package/drawer/fesm2022/drawer.mjs +44 -54
  52. package/dropdown-menu/README.md +417 -5
  53. package/dropdown-menu/fesm2022/dropdown-menu.mjs +82 -70
  54. package/dropdown-menu/types/dropdown-menu.d.ts +4 -0
  55. package/empty/README.md +329 -5
  56. package/empty/fesm2022/empty.mjs +30 -30
  57. package/field/README.md +385 -5
  58. package/field/fesm2022/field.mjs +56 -72
  59. package/form-checkbox/README.md +283 -34
  60. package/form-checkbox/fesm2022/form-checkbox.mjs +25 -85
  61. package/form-checkbox/types/form-checkbox.d.ts +7 -1
  62. package/form-date-picker/README.md +293 -34
  63. package/form-date-picker/fesm2022/form-date-picker.mjs +31 -84
  64. package/form-date-picker/types/form-date-picker.d.ts +7 -1
  65. package/form-field/README.md +327 -34
  66. package/form-field/fesm2022/form-field.mjs +33 -19
  67. package/form-field/types/form-field.d.ts +28 -20
  68. package/form-field-simple/README.md +311 -34
  69. package/form-field-simple/fesm2022/form-field-simple.mjs +4 -4
  70. package/form-searchable-multiselect/README.md +332 -34
  71. package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +31 -91
  72. package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +7 -1
  73. package/form-select/README.md +321 -34
  74. package/form-select/fesm2022/form-select.mjs +32 -149
  75. package/form-select/types/form-select.d.ts +7 -1
  76. package/form-text-input/README.md +342 -34
  77. package/form-text-input/fesm2022/form-text-input.mjs +35 -149
  78. package/form-text-input/types/form-text-input.d.ts +9 -12
  79. package/form-textarea/README.md +318 -34
  80. package/form-textarea/fesm2022/form-textarea.mjs +34 -109
  81. package/form-textarea/types/form-textarea.d.ts +8 -1
  82. package/hover-card/README.md +256 -5
  83. package/hover-card/fesm2022/hover-card.mjs +19 -19
  84. package/icon/README.md +210 -34
  85. package/icon/fesm2022/icon.mjs +8 -8
  86. package/input/README.md +240 -34
  87. package/input/fesm2022/input.mjs +17 -12
  88. package/input/types/input.d.ts +2 -1
  89. package/input-group/README.md +335 -5
  90. package/input-group/fesm2022/input-group.mjs +34 -34
  91. package/input-otp/README.md +375 -5
  92. package/input-otp/fesm2022/input-otp.mjs +26 -26
  93. package/item/README.md +385 -5
  94. package/item/fesm2022/item.mjs +53 -53
  95. package/kbd/README.md +291 -5
  96. package/kbd/fesm2022/kbd.mjs +12 -12
  97. package/label/README.md +243 -34
  98. package/label/fesm2022/label.mjs +10 -10
  99. package/label/types/label.d.ts +1 -1
  100. package/layout-simple/README.md +174 -44
  101. package/layout-simple/fesm2022/layout-simple.mjs +508 -603
  102. package/layout-simple/types/layout-simple.d.ts +179 -128
  103. package/menu/README.md +418 -0
  104. package/menu/fesm2022/menu.mjs +455 -0
  105. package/menu/package.json +24 -0
  106. package/menu/types/menu.d.ts +137 -0
  107. package/menubar/README.md +343 -5
  108. package/menubar/fesm2022/menubar.mjs +13 -13
  109. package/native-select/README.md +323 -5
  110. package/native-select/fesm2022/native-select.mjs +19 -19
  111. package/navigation-menu/README.md +369 -5
  112. package/navigation-menu/fesm2022/navigation-menu.mjs +35 -47
  113. package/package.json +183 -154
  114. package/pagination/README.md +388 -5
  115. package/pagination/fesm2022/pagination.mjs +45 -331
  116. package/popover/README.md +302 -34
  117. package/popover/fesm2022/popover.mjs +30 -30
  118. package/progress/README.md +311 -5
  119. package/progress/fesm2022/progress.mjs +13 -13
  120. package/radio-group/README.md +335 -34
  121. package/radio-group/fesm2022/radio-group.mjs +26 -19
  122. package/radio-group/types/radio-group.d.ts +1 -1
  123. package/resizable/README.md +269 -5
  124. package/resizable/fesm2022/resizable.mjs +18 -26
  125. package/scroll-area/README.md +233 -5
  126. package/scroll-area/fesm2022/scroll-area.mjs +9 -9
  127. package/searchable-multiselect/README.md +294 -34
  128. package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +28 -117
  129. package/searchable-multiselect/types/searchable-multiselect.d.ts +8 -2
  130. package/select/README.md +408 -34
  131. package/select/fesm2022/select.mjs +71 -111
  132. package/select/types/select.d.ts +3 -1
  133. package/separator/README.md +193 -34
  134. package/separator/fesm2022/separator.mjs +9 -9
  135. package/separator/types/separator.d.ts +1 -1
  136. package/sheet/README.md +282 -34
  137. package/sheet/fesm2022/sheet.mjs +41 -53
  138. package/sidebar/README.md +457 -5
  139. package/sidebar/fesm2022/sidebar.mjs +125 -227
  140. package/skeleton/README.md +217 -5
  141. package/skeleton/fesm2022/skeleton.mjs +9 -9
  142. package/slider/README.md +273 -5
  143. package/slider/fesm2022/slider.mjs +10 -80
  144. package/sonner/README.md +317 -34
  145. package/sonner/fesm2022/sonner.mjs +13 -13
  146. package/spinner/README.md +255 -34
  147. package/spinner/fesm2022/spinner.mjs +11 -11
  148. package/switch/README.md +281 -34
  149. package/switch/fesm2022/switch.mjs +13 -15
  150. package/table/README.md +423 -5
  151. package/table/fesm2022/table.mjs +41 -41
  152. package/tabs/README.md +382 -34
  153. package/tabs/fesm2022/tabs.mjs +35 -111
  154. package/textarea/README.md +282 -5
  155. package/textarea/fesm2022/textarea.mjs +9 -9
  156. package/toggle/README.md +270 -5
  157. package/toggle/fesm2022/toggle.mjs +13 -13
  158. package/toggle-group/README.md +340 -5
  159. package/toggle-group/fesm2022/toggle-group.mjs +13 -13
  160. package/toggle-group/types/toggle-group.d.ts +13 -7
  161. package/tooltip/README.md +240 -34
  162. package/tooltip/fesm2022/tooltip.mjs +14 -14
  163. package/typography/README.md +271 -5
  164. package/typography/fesm2022/typography.mjs +53 -53
  165. package/typography/types/typography.d.ts +19 -19
  166. package/utils/README.md +274 -34
  167. package/utils/fesm2022/utils.mjs +68 -44
  168. package/accordion/fesm2022/accordion.mjs.map +0 -1
  169. package/alert/fesm2022/alert.mjs.map +0 -1
  170. package/alert-dialog/fesm2022/alert-dialog.mjs.map +0 -1
  171. package/aspect-ratio/fesm2022/aspect-ratio.mjs.map +0 -1
  172. package/autocomplete/fesm2022/autocomplete.mjs.map +0 -1
  173. package/avatar/fesm2022/avatar.mjs.map +0 -1
  174. package/badge/fesm2022/badge.mjs.map +0 -1
  175. package/basic-alert/fesm2022/basic-alert.mjs.map +0 -1
  176. package/breadcrumb/fesm2022/breadcrumb.mjs.map +0 -1
  177. package/button/fesm2022/button.mjs.map +0 -1
  178. package/button-group/fesm2022/button-group.mjs.map +0 -1
  179. package/calendar/fesm2022/calendar.mjs.map +0 -1
  180. package/card/fesm2022/card.mjs.map +0 -1
  181. package/carousel/fesm2022/carousel.mjs.map +0 -1
  182. package/checkbox/fesm2022/checkbox.mjs.map +0 -1
  183. package/collapsible/fesm2022/collapsible.mjs.map +0 -1
  184. package/combobox/fesm2022/combobox.mjs.map +0 -1
  185. package/command/fesm2022/command.mjs.map +0 -1
  186. package/confirmation-dialog/fesm2022/confirmation-dialog.mjs.map +0 -1
  187. package/context-menu/fesm2022/context-menu.mjs.map +0 -1
  188. package/date-picker/fesm2022/date-picker.mjs.map +0 -1
  189. package/dialog/fesm2022/dialog.mjs.map +0 -1
  190. package/drawer/fesm2022/drawer.mjs.map +0 -1
  191. package/dropdown-menu/fesm2022/dropdown-menu.mjs.map +0 -1
  192. package/empty/fesm2022/empty.mjs.map +0 -1
  193. package/field/fesm2022/field.mjs.map +0 -1
  194. package/form-checkbox/fesm2022/form-checkbox.mjs.map +0 -1
  195. package/form-date-picker/fesm2022/form-date-picker.mjs.map +0 -1
  196. package/form-field/fesm2022/form-field.mjs.map +0 -1
  197. package/form-field-simple/fesm2022/form-field-simple.mjs.map +0 -1
  198. package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs.map +0 -1
  199. package/form-select/fesm2022/form-select.mjs.map +0 -1
  200. package/form-text-input/fesm2022/form-text-input.mjs.map +0 -1
  201. package/form-textarea/fesm2022/form-textarea.mjs.map +0 -1
  202. package/hover-card/fesm2022/hover-card.mjs.map +0 -1
  203. package/icon/fesm2022/icon.mjs.map +0 -1
  204. package/input/fesm2022/input.mjs.map +0 -1
  205. package/input-group/fesm2022/input-group.mjs.map +0 -1
  206. package/input-otp/fesm2022/input-otp.mjs.map +0 -1
  207. package/item/fesm2022/item.mjs.map +0 -1
  208. package/kbd/fesm2022/kbd.mjs.map +0 -1
  209. package/label/fesm2022/label.mjs.map +0 -1
  210. package/layout-simple/fesm2022/layout-simple.mjs.map +0 -1
  211. package/menubar/fesm2022/menubar.mjs.map +0 -1
  212. package/native-select/fesm2022/native-select.mjs.map +0 -1
  213. package/navigation-menu/fesm2022/navigation-menu.mjs.map +0 -1
  214. package/pagination/fesm2022/pagination.mjs.map +0 -1
  215. package/popover/fesm2022/popover.mjs.map +0 -1
  216. package/progress/fesm2022/progress.mjs.map +0 -1
  217. package/radio-group/fesm2022/radio-group.mjs.map +0 -1
  218. package/resizable/fesm2022/resizable.mjs.map +0 -1
  219. package/scroll-area/fesm2022/scroll-area.mjs.map +0 -1
  220. package/searchable-multiselect/fesm2022/searchable-multiselect.mjs.map +0 -1
  221. package/select/fesm2022/select.mjs.map +0 -1
  222. package/separator/fesm2022/separator.mjs.map +0 -1
  223. package/sheet/fesm2022/sheet.mjs.map +0 -1
  224. package/sidebar/fesm2022/sidebar.mjs.map +0 -1
  225. package/skeleton/fesm2022/skeleton.mjs.map +0 -1
  226. package/slider/fesm2022/slider.mjs.map +0 -1
  227. package/sonner/fesm2022/sonner.mjs.map +0 -1
  228. package/spinner/fesm2022/spinner.mjs.map +0 -1
  229. package/switch/fesm2022/switch.mjs.map +0 -1
  230. package/table/fesm2022/table.mjs.map +0 -1
  231. package/tabs/fesm2022/tabs.mjs.map +0 -1
  232. package/textarea/fesm2022/textarea.mjs.map +0 -1
  233. package/toggle/fesm2022/toggle.mjs.map +0 -1
  234. package/toggle-group/fesm2022/toggle-group.mjs.map +0 -1
  235. package/tooltip/fesm2022/tooltip.mjs.map +0 -1
  236. package/typography/fesm2022/typography.mjs.map +0 -1
  237. package/utils/fesm2022/utils.mjs.map +0 -1
@@ -1,64 +1,354 @@
1
- # BasicAlert
1
+ # Basic Alert (`@egose/shadcn-theme-ng/basic-alert`)
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.
3
+ A one-tag convenience alert in the shadcn/ui Alert style: icon + title + description with zero
4
+ composition boilerplate. Where `@egose/shadcn-theme-ng/alert` asks you to assemble `HlmAlert` /
5
+ `HlmAlertIcon` / `HlmAlertTitle` / `HlmAlertDescription` by hand, `EgBasicAlert` takes `variant`,
6
+ `appearance`, `title`, and `description` inputs and renders the whole banner — picking a matching
7
+ Lucide icon per tone automatically.
4
8
 
5
- ## Code scaffolding
9
+ This is a **standalone component with no `*Imports`/`*Module` wrapper** — import `EgBasicAlert`
10
+ itself. Internally it composes the `alert` subpath directives plus `NgIcon`/`HlmIcon`, and maps
11
+ each `VariantType` to an icon name through its `getIconName()` method.
6
12
 
7
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
13
+ > **Ships as:** `@egose/shadcn-theme-ng/basic-alert` and `@egose/shadcn-theme-ng-tw/basic-alert`
14
+ > (the `tw:`-prefixed Tailwind variant). Both expose the identical TypeScript surface; only the
15
+ > emitted Tailwind class strings differ. See the [package README](../../README.md) for install
16
+ > steps, peer dependencies, and Tailwind setup. Do not publish this project directory independently.
17
+
18
+ ## Installation
8
19
 
9
20
  ```bash
10
- ng generate component component-name
21
+ # Plain Tailwind (no prefix)
22
+ npm install @egose/shadcn-theme-ng
23
+
24
+ # tw:-prefixed Tailwind variant
25
+ npm install @egose/shadcn-theme-ng-tw
11
26
  ```
12
27
 
13
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
28
+ Peer dependencies (Angular, `@spartan-ng/brain`, `@ng-icons/*`, `rxjs`, …) are documented in the
29
+ [package README](../../README.md#peer-dependencies). This subpath depends at runtime on
30
+ `@egose/shadcn-theme-ng/alert` (`HlmAlert*`, `VariantType`, `AppearanceType`),
31
+ `@egose/shadcn-theme-ng/icon` (`HlmIcon`), and `@ng-icons/lucide` for its icon set.
14
32
 
15
- ```bash
16
- ng generate --help
33
+ ## Imports
34
+
35
+ `EgBasicAlert` is exported from the subpath root (`projects/basic-alert/src/public-api.ts`). Note
36
+ there is **no** `EgBasicAlertImports` array and **no** `*Module` — import the component directly:
37
+
38
+ ```ts
39
+ import { EgBasicAlert } from '@egose/shadcn-theme-ng/basic-alert';
40
+ // tw variant: replace with '@egose/shadcn-theme-ng-tw/basic-alert'
17
41
  ```
18
42
 
19
- ## Building
43
+ Standalone component usage:
20
44
 
21
- To build the library, run:
45
+ ```ts
46
+ import { Component } from '@angular/core';
47
+ import { EgBasicAlert } from '@egose/shadcn-theme-ng/basic-alert';
22
48
 
23
- ```bash
24
- ng build basic-alert
49
+ @Component({
50
+ selector: 'app-demo',
51
+ standalone: true,
52
+ imports: [EgBasicAlert],
53
+ template: `<eg-basic-alert variant="info" title="Heads up" description="..." />`,
54
+ })
55
+ export class DemoComponent {}
25
56
  ```
26
57
 
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
58
+ NgModule-based consumer — list the component in the module imports (it is standalone):
28
59
 
29
- ### Publishing the Library
60
+ ```ts
61
+ import { NgModule } from '@angular/core';
62
+ import { EgBasicAlert } from '@egose/shadcn-theme-ng/basic-alert';
30
63
 
31
- Once the project is built, you can publish your library by following these steps:
64
+ @NgModule({ imports: [EgBasicAlert] })
65
+ export class DemoModule {}
66
+ ```
32
67
 
33
- 1. Navigate to the `dist` directory:
68
+ ## Anatomy / Structure
34
69
 
35
- ```bash
36
- cd dist/basic-alert
37
- ```
70
+ ```html
71
+ <eg-basic-alert variant="success" appearance="solid" title="Saved" description="All changes stored." />
72
+ ```
38
73
 
39
- 2. Run the `npm publish` command to publish your library to the npm registry:
40
- ```bash
41
- npm publish
42
- ```
74
+ Real selector (from source):
43
75
 
44
- ## Running unit tests
76
+ | Class | Selector | Kind |
77
+ | -------------- | ---------------- | --------- |
78
+ | `EgBasicAlert` | `eg-basic-alert` | Component |
45
79
 
46
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
80
+ Its internal template (from source) is:
47
81
 
48
- ```bash
49
- ng test
82
+ ```html
83
+ <div hlmAlert [variant]="variant()" [appearance]="appearance()" class="">
84
+ <ng-icon hlm hlmAlertIcon [name]="getIconName(variant())" />
85
+ <h4 hlmAlertTitle class="tw:capitalize">{{ title() }}</h4>
86
+ <p hlmAlertDescription>{{ description() }}</p>
87
+ </div>
50
88
  ```
51
89
 
52
- ## Running end-to-end tests
90
+ So the rendered output is a standard `HlmAlert` banner whose title is auto-capitalized
91
+ (`tw:capitalize`) and whose icon is chosen by `getIconName(variant())`.
53
92
 
54
- For end-to-end (e2e) testing, run:
93
+ ## API reference
55
94
 
56
- ```bash
57
- ng e2e
95
+ ### `EgBasicAlert` — `eg-basic-alert`
96
+
97
+ | Input | Type | Default | Description |
98
+ | ------------- | ----------------------------------------------- | --------- | ------------------------------------------------- |
99
+ | `variant` | `VariantType` (re-exported from `.../alert`) | `'info'` | Color tone; also selects the icon (see table). |
100
+ | `appearance` | `AppearanceType` (re-exported from `.../alert`) | `'solid'` | `'solid'` or `'light'` — forwarded to `HlmAlert`. |
101
+ | `title` | `string` | `''` | Banner heading (rendered capitalized). |
102
+ | `description` | `string` | `''` | Banner body text. |
103
+
104
+ | Method | Signature | Description |
105
+ | ------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
106
+ | `getIconName` | `getIconName(variant: VariantType): string` | Returns the `ng-icon` name for a tone. Public — call it in your own templates to keep custom alerts visually consistent. |
107
+
108
+ Variant → icon mapping (read from `getIconName` source):
109
+
110
+ | `variant` | Icon |
111
+ | ------------------------------ | ---------------------- |
112
+ | `success` | `lucideCircleCheck` |
113
+ | `info` | `lucideInfo` |
114
+ | `warning` | `lucideBatteryWarning` |
115
+ | `danger`, `destructive` | `lucideCircleAlert` |
116
+ | `muted` | `lucideBell` |
117
+ | `accent` | `lucideStar` |
118
+ | `primary` | `lucideThumbsUp` |
119
+ | `secondary` | `lucideZap` |
120
+ | `link` | `lucideLink` |
121
+ | `ghost` | `lucideGhost` |
122
+ | `light`, `dark`, anything else | `lucideInfo` (default) |
123
+
124
+ `VariantType` values (from `.../alert`): `primary` · `secondary` · `success` · `warning` ·
125
+ `danger` · `info` · `light` · `dark` · `accent` · `destructive` · `muted` · `link` · `ghost`.
126
+
127
+ ## Examples
128
+
129
+ ### 1. Basic usage
130
+
131
+ ```ts
132
+ import { Component } from '@angular/core';
133
+ import { EgBasicAlert } from '@egose/shadcn-theme-ng/basic-alert';
134
+
135
+ @Component({
136
+ selector: 'app-basic-alert-basic',
137
+ standalone: true,
138
+ imports: [EgBasicAlert],
139
+ template: `
140
+ <eg-basic-alert
141
+ variant="info"
142
+ title="Maintenance scheduled"
143
+ description="The dashboard will be offline Sunday 02:00–04:00 UTC."
144
+ />
145
+ `,
146
+ })
147
+ export class BasicAlertBasicComponent {}
148
+ ```
149
+
150
+ ```html
151
+ <app-basic-alert-basic />
152
+ ```
153
+
154
+ ### 2. Semantic tones (success / warning / danger)
155
+
156
+ ```ts
157
+ import { Component } from '@angular/core';
158
+ import { EgBasicAlert } from '@egose/shadcn-theme-ng/basic-alert';
159
+
160
+ @Component({
161
+ selector: 'app-basic-alert-tones',
162
+ standalone: true,
163
+ imports: [EgBasicAlert],
164
+ template: `
165
+ <eg-basic-alert variant="success" title="Payment confirmed" description="Receipt emailed." class="tw:mb-3" />
166
+ <eg-basic-alert variant="warning" title="Storage almost full" description="9.2 of 10 GB used." class="tw:mb-3" />
167
+ <eg-basic-alert variant="danger" title="Sync failed" description="Retrying in 30 seconds." />
168
+ `,
169
+ })
170
+ export class BasicAlertTonesComponent {}
58
171
  ```
59
172
 
60
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
173
+ (`class` on the host works because every Angular component host accepts a `class` attribute;
174
+ inner banner styling still comes from the alert subpath.)
175
+
176
+ ### 3. Light appearance across variants
177
+
178
+ ```ts
179
+ import { Component } from '@angular/core';
180
+ import { EgBasicAlert } from '@egose/shadcn-theme-ng/basic-alert';
181
+ import type { VariantType } from '@egose/shadcn-theme-ng/alert';
182
+
183
+ @Component({
184
+ selector: 'app-basic-alert-light',
185
+ standalone: true,
186
+ imports: [EgBasicAlert],
187
+ template: `
188
+ @for (v of variants; track v) {
189
+ <eg-basic-alert
190
+ [variant]="v"
191
+ appearance="light"
192
+ [title]="v"
193
+ [description]="'The ' + v + ' tone in light appearance.'"
194
+ class="tw:mb-3 tw:block"
195
+ />
196
+ }
197
+ `,
198
+ })
199
+ export class BasicAlertLightComponent {
200
+ readonly variants: VariantType[] = ['primary', 'success', 'warning', 'danger', 'info', 'muted'];
201
+ }
202
+ ```
203
+
204
+ ### 4. Signal-driven form feedback
205
+
206
+ ```ts
207
+ import { Component, computed, signal } from '@angular/core';
208
+ import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
209
+ import { EgBasicAlert } from '@egose/shadcn-theme-ng/basic-alert';
210
+
211
+ @Component({
212
+ selector: 'app-basic-alert-form',
213
+ standalone: true,
214
+ imports: [EgBasicAlert, ReactiveFormsModule],
215
+ template: `
216
+ <label class="tw:mb-1 tw:block tw:text-sm tw:font-medium" for="email">Email</label>
217
+ <input id="email" [formControl]="email" placeholder="you@example.com" class="tw:mb-3 tw:block" />
218
+ @if (banner(); as b) {
219
+ <eg-basic-alert [variant]="b.variant" [title]="b.title" [description]="b.description" />
220
+ }
221
+ `,
222
+ })
223
+ export class BasicAlertFormComponent {
224
+ readonly email = new FormControl('', { validators: [Validators.required, Validators.email], nonNullable: true });
225
+ private readonly submitted = signal(false);
226
+
227
+ readonly banner = computed(() => {
228
+ if (!this.submitted()) return null;
229
+ return this.email.valid
230
+ ? { variant: 'success' as const, title: 'Looks good', description: 'We will send the receipt there.' }
231
+ : {
232
+ variant: 'destructive' as const,
233
+ title: 'Invalid email',
234
+ description: 'Enter an address like you@example.com.',
235
+ };
236
+ });
237
+
238
+ constructor() {
239
+ this.email.valueChanges.subscribe(() => this.submitted.set(true));
240
+ }
241
+ }
242
+ ```
243
+
244
+ ### 5. Dismissible + async loading pattern
245
+
246
+ ```ts
247
+ import { Component, signal } from '@angular/core';
248
+ import { EgBasicAlert } from '@egose/shadcn-theme-ng/basic-alert';
249
+
250
+ @Component({
251
+ selector: 'app-basic-alert-async',
252
+ standalone: true,
253
+ imports: [EgBasicAlert],
254
+ template: `
255
+ <button (click)="save()" [disabled]="saving()">Save settings</button>
256
+ @if (saving()) {
257
+ <eg-basic-alert variant="muted" title="Saving" description="Writing your settings…" class="tw:mt-3 tw:block" />
258
+ } @else if (saved()) {
259
+ <eg-basic-alert
260
+ variant="success"
261
+ title="Saved"
262
+ description="Settings updated just now."
263
+ class="tw:mt-3 tw:block"
264
+ />
265
+ } @else if (failed()) {
266
+ <eg-basic-alert
267
+ variant="destructive"
268
+ title="Save failed"
269
+ description="Check your connection and retry."
270
+ class="tw:mt-3 tw:block"
271
+ />
272
+ }
273
+ `,
274
+ })
275
+ export class BasicAlertAsyncComponent {
276
+ readonly saving = signal(false);
277
+ readonly saved = signal(false);
278
+ readonly failed = signal(false);
279
+
280
+ async save() {
281
+ this.saving.set(true);
282
+ this.saved.set(false);
283
+ this.failed.set(false);
284
+ try {
285
+ await fetch('/api/settings', { method: 'POST' });
286
+ this.saved.set(true);
287
+ } catch {
288
+ this.failed.set(true);
289
+ } finally {
290
+ this.saving.set(false);
291
+ }
292
+ }
293
+ }
294
+ ```
295
+
296
+ ### 6. Advanced: reusing `getIconName` for a custom banner
297
+
298
+ Because `getIconName` is public, custom compositions can stay icon-consistent with the built-in
299
+ mapping. Grab the component with a template ref (or `@ViewChild`) and call it:
300
+
301
+ ```ts
302
+ import { Component, viewChild } from '@angular/core';
303
+ import { NgIcon, provideIcons } from '@ng-icons/core';
304
+ import * as lucide from '@ng-icons/lucide';
305
+ import { EgBasicAlert } from '@egose/shadcn-theme-ng/basic-alert';
306
+ import { HlmAlertImports, type VariantType } from '@egose/shadcn-theme-ng/alert';
307
+ import { HlmIcon } from '@egose/shadcn-theme-ng/icon';
308
+
309
+ @Component({
310
+ selector: 'app-basic-alert-custom',
311
+ standalone: true,
312
+ imports: [...HlmAlertImports, EgBasicAlert, NgIcon, HlmIcon],
313
+ providers: [provideIcons({ ...lucide })],
314
+ template: `
315
+ <!-- hidden helper instance purely as an icon-name resolver -->
316
+ <eg-basic-alert #helper variant="info" title="" description="" class="tw:hidden" />
317
+ <div hlmAlert [variant]="variant">
318
+ <ng-icon hlm hlmAlertIcon [name]="helper.getIconName(variant)" />
319
+ <h4 hlmAlertTitle>Custom layout, stock icon</h4>
320
+ <p hlmAlertDescription>Extra actions or rich content here — the icon still matches the {{ variant }} tone.</p>
321
+ </div>
322
+ `,
323
+ })
324
+ export class BasicAlertCustomComponent {
325
+ readonly variant: VariantType = 'accent';
326
+ private readonly helper = viewChild<EgBasicAlert>('helper');
327
+ }
328
+ ```
329
+
330
+ > Prefer importing the `alert` subpath directly for hand-built banners; the helper-instance trick
331
+ > above is only for teams that want a single source of truth for the icon map.
332
+
333
+ ## Accessibility notes
334
+
335
+ - Inherits everything from `HlmAlert`: the banner carries `role="alert"`, so dynamically shown
336
+ instances (after save/fail) are announced. Do not render empty `title` + `description`
337
+ instances permanently — screen readers would announce an empty alert region.
338
+ - Titles render with `tw:capitalize` — keep them short, human-phrased headings ("Save failed",
339
+ not "ERR_SAVE_500"). The description should state the consequence and next step.
340
+ - The icon is decorative; all meaning must be in the text since icon names/tones alone are not
341
+ announced.
342
+
343
+ ## Theming / CSS variables
344
+
345
+ No variables of its own — theming flows through the composed `HlmAlert` (`variant` /
346
+ `appearance` + shadcn tokens). For layouts beyond icon/title/description, drop down to
347
+ `@egose/shadcn-theme-ng/alert` and compose the directives yourself.
61
348
 
62
- ## Additional Resources
349
+ ## Related subpaths
63
350
 
64
- For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
351
+ - `@egose/shadcn-theme-ng/alert` — hand-composed banners (`HlmAlert*`) and the `VariantType` / `AppearanceType` types
352
+ - `@egose/shadcn-theme-ng/badge` — inline chips for compact status
353
+ - `@egose/shadcn-theme-ng/sonner` — transient toasts for fire-and-forget feedback
354
+ - `@egose/shadcn-theme-ng/icon` — `HlmIcon` and icon configuration
@@ -43,8 +43,8 @@ class EgBasicAlert {
43
43
  return 'lucideInfo';
44
44
  }
45
45
  }
46
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EgBasicAlert, deps: [], target: i0.ɵɵFactoryTarget.Component });
47
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.7", type: EgBasicAlert, isStandalone: true, selector: "eg-basic-alert", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
46
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgBasicAlert, deps: [], target: i0.ɵɵFactoryTarget.Component });
47
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: EgBasicAlert, isStandalone: true, selector: "eg-basic-alert", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
48
48
  provideIcons({
49
49
  lucideCircleCheck,
50
50
  lucideInfo,
@@ -57,15 +57,9 @@ class EgBasicAlert {
57
57
  lucideLink,
58
58
  lucideGhost,
59
59
  }),
60
- ], ngImport: i0, template: `
61
- <div hlmAlert [variant]="variant()" [appearance]="appearance()" class="">
62
- <ng-icon hlm hlmAlertIcon [name]="getIconName(variant())" />
63
- <h4 hlmAlertTitle class="capitalize">{{ title() }}</h4>
64
- <p hlmAlertDescription>{{ description() }}</p>
65
- </div>
66
- `, isInline: true, dependencies: [{ kind: "directive", type: HlmAlert, selector: "[hlmAlert]", inputs: ["class", "variant", "appearance"] }, { kind: "directive", type: HlmAlertIcon, selector: "[hlmAlertIcon]" }, { kind: "directive", type: HlmAlertTitle, selector: "[hlmAlertTitle]", inputs: ["class"] }, { kind: "directive", type: HlmAlertDescription, selector: "[hlmAlertDesc],[hlmAlertDescription]", inputs: ["class"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: HlmIcon, selector: "ng-icon[hlm]", inputs: ["size"] }] });
60
+ ], ngImport: i0, template: "\n <div hlmAlert [variant]=\"variant()\" [appearance]=\"appearance()\" class=\"\">\n <ng-icon hlm hlmAlertIcon [name]=\"getIconName(variant())\" />\n <h4 hlmAlertTitle class=\"capitalize\">{{ title() }}</h4>\n <p hlmAlertDescription>{{ description() }}</p>\n </div>\n ", isInline: true, dependencies: [{ kind: "directive", type: HlmAlert, selector: "[hlmAlert]", inputs: ["class", "variant", "appearance"] }, { kind: "directive", type: HlmAlertIcon, selector: "[hlmAlertIcon]" }, { kind: "directive", type: HlmAlertTitle, selector: "[hlmAlertTitle]", inputs: ["class"] }, { kind: "directive", type: HlmAlertDescription, selector: "[hlmAlertDesc],[hlmAlertDescription]", inputs: ["class"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: HlmIcon, selector: "ng-icon[hlm]", inputs: ["size"] }] });
67
61
  }
68
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EgBasicAlert, decorators: [{
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgBasicAlert, decorators: [{
69
63
  type: Component,
70
64
  args: [{
71
65
  selector: 'eg-basic-alert',
@@ -85,13 +79,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
85
79
  lucideGhost,
86
80
  }),
87
81
  ],
88
- template: `
89
- <div hlmAlert [variant]="variant()" [appearance]="appearance()" class="">
90
- <ng-icon hlm hlmAlertIcon [name]="getIconName(variant())" />
91
- <h4 hlmAlertTitle class="capitalize">{{ title() }}</h4>
92
- <p hlmAlertDescription>{{ description() }}</p>
93
- </div>
94
- `,
82
+ template: "\n <div hlmAlert [variant]=\"variant()\" [appearance]=\"appearance()\" class=\"\">\n <ng-icon hlm hlmAlertIcon [name]=\"getIconName(variant())\" />\n <h4 hlmAlertTitle class=\"capitalize\">{{ title() }}</h4>\n <p hlmAlertDescription>{{ description() }}</p>\n </div>\n ",
95
83
  }]
96
84
  }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }] } });
97
85
 
@@ -104,4 +92,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
104
92
  */
105
93
 
106
94
  export { EgBasicAlert };
107
- //# sourceMappingURL=basic-alert.mjs.map
95
+