@egose/shadcn-theme-ng-tw 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 (244) hide show
  1. package/README.md +130 -13
  2. package/accordion/README.md +376 -34
  3. package/accordion/fesm2022/accordion.mjs +20 -20
  4. package/alert/README.md +343 -34
  5. package/alert/fesm2022/alert.mjs +18 -18
  6. package/alert-dialog/README.md +471 -5
  7. package/alert-dialog/fesm2022/alert-dialog.mjs +48 -48
  8. package/alert-dialog/types/alert-dialog.d.ts +1 -1
  9. package/aspect-ratio/README.md +272 -5
  10. package/aspect-ratio/fesm2022/aspect-ratio.mjs +9 -9
  11. package/autocomplete/README.md +473 -34
  12. package/autocomplete/fesm2022/autocomplete.mjs +54 -54
  13. package/autocomplete/types/autocomplete.d.ts +1 -1
  14. package/avatar/README.md +357 -5
  15. package/avatar/fesm2022/avatar.mjs +32 -32
  16. package/badge/README.md +289 -34
  17. package/badge/fesm2022/badge.mjs +4 -4
  18. package/basic-alert/README.md +324 -34
  19. package/basic-alert/fesm2022/basic-alert.mjs +4 -4
  20. package/basic-alert/types/basic-alert.d.ts +1 -1
  21. package/breadcrumb/README.md +406 -5
  22. package/breadcrumb/fesm2022/breadcrumb.mjs +34 -34
  23. package/button/README.md +453 -34
  24. package/button/fesm2022/button.mjs +96 -118
  25. package/button/types/button.d.ts +7 -10
  26. package/button-group/README.md +318 -5
  27. package/button-group/fesm2022/button-group.mjs +20 -20
  28. package/calendar/README.md +328 -34
  29. package/calendar/fesm2022/calendar.mjs +154 -154
  30. package/card/README.md +331 -5
  31. package/card/fesm2022/card.mjs +33 -33
  32. package/carousel/README.md +333 -5
  33. package/carousel/fesm2022/carousel.mjs +47 -44
  34. package/carousel/types/carousel.d.ts +1 -1
  35. package/checkbox/README.md +291 -34
  36. package/checkbox/fesm2022/checkbox.mjs +22 -20
  37. package/checkbox/types/checkbox.d.ts +5 -4
  38. package/collapsible/README.md +332 -5
  39. package/collapsible/fesm2022/collapsible.mjs +15 -15
  40. package/combobox/README.md +507 -5
  41. package/combobox/fesm2022/combobox.mjs +95 -92
  42. package/combobox/types/combobox.d.ts +1 -1
  43. package/command/README.md +435 -5
  44. package/command/fesm2022/command.mjs +56 -56
  45. package/confirmation-dialog/README.md +272 -34
  46. package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +13 -12
  47. package/confirmation-dialog/types/confirmation-dialog.d.ts +9 -5
  48. package/context-menu/README.md +366 -5
  49. package/context-menu/fesm2022/context-menu.mjs +9 -9
  50. package/date-picker/README.md +436 -34
  51. package/date-picker/fesm2022/date-picker.mjs +79 -68
  52. package/date-picker/types/date-picker.d.ts +8 -4
  53. package/dialog/README.md +419 -34
  54. package/dialog/fesm2022/dialog.mjs +48 -48
  55. package/drawer/README.md +395 -5
  56. package/drawer/fesm2022/drawer.mjs +45 -45
  57. package/dropdown-menu/README.md +417 -5
  58. package/dropdown-menu/fesm2022/dropdown-menu.mjs +85 -73
  59. package/dropdown-menu/types/dropdown-menu.d.ts +4 -0
  60. package/empty/README.md +329 -5
  61. package/empty/fesm2022/empty.mjs +31 -31
  62. package/field/README.md +385 -5
  63. package/field/fesm2022/field.mjs +59 -59
  64. package/field/types/field.d.ts +1 -1
  65. package/form-checkbox/README.md +283 -34
  66. package/form-checkbox/fesm2022/form-checkbox.mjs +37 -19
  67. package/form-checkbox/types/form-checkbox.d.ts +7 -1
  68. package/form-date-picker/README.md +293 -34
  69. package/form-date-picker/fesm2022/form-date-picker.mjs +59 -24
  70. package/form-date-picker/types/form-date-picker.d.ts +7 -1
  71. package/form-field/README.md +327 -34
  72. package/form-field/fesm2022/form-field.mjs +30 -16
  73. package/form-field/types/form-field.d.ts +28 -20
  74. package/form-field-simple/README.md +311 -34
  75. package/form-field-simple/fesm2022/form-field-simple.mjs +4 -4
  76. package/form-searchable-multiselect/README.md +332 -34
  77. package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +41 -21
  78. package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +8 -2
  79. package/form-select/README.md +321 -34
  80. package/form-select/fesm2022/form-select.mjs +62 -29
  81. package/form-select/types/form-select.d.ts +7 -1
  82. package/form-text-input/README.md +342 -34
  83. package/form-text-input/fesm2022/form-text-input.mjs +43 -55
  84. package/form-text-input/types/form-text-input.d.ts +9 -12
  85. package/form-textarea/README.md +318 -34
  86. package/form-textarea/fesm2022/form-textarea.mjs +42 -23
  87. package/form-textarea/types/form-textarea.d.ts +8 -1
  88. package/hover-card/README.md +256 -5
  89. package/hover-card/fesm2022/hover-card.mjs +19 -19
  90. package/icon/README.md +210 -34
  91. package/icon/fesm2022/icon.mjs +8 -8
  92. package/input/README.md +240 -34
  93. package/input/fesm2022/input.mjs +17 -12
  94. package/input/types/input.d.ts +2 -1
  95. package/input-group/README.md +335 -5
  96. package/input-group/fesm2022/input-group.mjs +37 -37
  97. package/input-group/types/input-group.d.ts +3 -3
  98. package/input-otp/README.md +375 -5
  99. package/input-otp/fesm2022/input-otp.mjs +27 -27
  100. package/item/README.md +385 -5
  101. package/item/fesm2022/item.mjs +54 -54
  102. package/kbd/README.md +291 -5
  103. package/kbd/fesm2022/kbd.mjs +13 -13
  104. package/label/README.md +243 -34
  105. package/label/fesm2022/label.mjs +9 -9
  106. package/label/types/label.d.ts +1 -1
  107. package/layout-simple/README.md +174 -44
  108. package/layout-simple/fesm2022/layout-simple.mjs +917 -398
  109. package/layout-simple/types/layout-simple.d.ts +180 -129
  110. package/menu/README.md +418 -0
  111. package/menu/fesm2022/menu.mjs +461 -0
  112. package/menu/package.json +24 -0
  113. package/menu/types/menu.d.ts +137 -0
  114. package/menubar/README.md +343 -5
  115. package/menubar/fesm2022/menubar.mjs +13 -13
  116. package/native-select/README.md +323 -5
  117. package/native-select/fesm2022/native-select.mjs +19 -19
  118. package/navigation-menu/README.md +369 -5
  119. package/navigation-menu/fesm2022/navigation-menu.mjs +37 -37
  120. package/package.json +183 -154
  121. package/pagination/README.md +388 -5
  122. package/pagination/fesm2022/pagination.mjs +63 -63
  123. package/popover/README.md +302 -34
  124. package/popover/fesm2022/popover.mjs +30 -30
  125. package/progress/README.md +311 -5
  126. package/progress/fesm2022/progress.mjs +13 -13
  127. package/radio-group/README.md +335 -34
  128. package/radio-group/fesm2022/radio-group.mjs +26 -19
  129. package/resizable/README.md +269 -5
  130. package/resizable/fesm2022/resizable.mjs +19 -19
  131. package/scroll-area/README.md +233 -5
  132. package/scroll-area/fesm2022/scroll-area.mjs +9 -9
  133. package/searchable-multiselect/README.md +294 -34
  134. package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +63 -16
  135. package/searchable-multiselect/types/searchable-multiselect.d.ts +8 -2
  136. package/select/README.md +408 -34
  137. package/select/fesm2022/select.mjs +80 -72
  138. package/select/types/select.d.ts +3 -1
  139. package/separator/README.md +193 -34
  140. package/separator/fesm2022/separator.mjs +9 -9
  141. package/separator/types/separator.d.ts +1 -1
  142. package/sheet/README.md +282 -34
  143. package/sheet/fesm2022/sheet.mjs +30 -30
  144. package/sidebar/README.md +457 -5
  145. package/sidebar/fesm2022/sidebar.mjs +136 -134
  146. package/sidebar/types/sidebar.d.ts +3 -3
  147. package/skeleton/README.md +217 -5
  148. package/skeleton/fesm2022/skeleton.mjs +9 -9
  149. package/slider/README.md +273 -5
  150. package/slider/fesm2022/slider.mjs +29 -25
  151. package/sonner/README.md +317 -34
  152. package/sonner/fesm2022/sonner.mjs +9 -9
  153. package/spinner/README.md +255 -34
  154. package/spinner/fesm2022/spinner.mjs +8 -8
  155. package/switch/README.md +281 -34
  156. package/switch/fesm2022/switch.mjs +12 -14
  157. package/table/README.md +423 -5
  158. package/table/fesm2022/table.mjs +41 -41
  159. package/tabs/README.md +382 -34
  160. package/tabs/fesm2022/tabs.mjs +48 -38
  161. package/textarea/README.md +282 -5
  162. package/textarea/fesm2022/textarea.mjs +9 -9
  163. package/toggle/README.md +270 -5
  164. package/toggle/fesm2022/toggle.mjs +14 -14
  165. package/toggle-group/README.md +340 -5
  166. package/toggle-group/fesm2022/toggle-group.mjs +13 -13
  167. package/toggle-group/types/toggle-group.d.ts +13 -7
  168. package/tooltip/README.md +240 -34
  169. package/tooltip/fesm2022/tooltip.mjs +14 -14
  170. package/typography/README.md +271 -5
  171. package/typography/fesm2022/typography.mjs +53 -53
  172. package/typography/types/typography.d.ts +12 -12
  173. package/utils/README.md +274 -34
  174. package/utils/fesm2022/utils.mjs +68 -44
  175. package/accordion/fesm2022/accordion.mjs.map +0 -1
  176. package/alert/fesm2022/alert.mjs.map +0 -1
  177. package/alert-dialog/fesm2022/alert-dialog.mjs.map +0 -1
  178. package/aspect-ratio/fesm2022/aspect-ratio.mjs.map +0 -1
  179. package/autocomplete/fesm2022/autocomplete.mjs.map +0 -1
  180. package/avatar/fesm2022/avatar.mjs.map +0 -1
  181. package/badge/fesm2022/badge.mjs.map +0 -1
  182. package/basic-alert/fesm2022/basic-alert.mjs.map +0 -1
  183. package/breadcrumb/fesm2022/breadcrumb.mjs.map +0 -1
  184. package/button/fesm2022/button.mjs.map +0 -1
  185. package/button-group/fesm2022/button-group.mjs.map +0 -1
  186. package/calendar/fesm2022/calendar.mjs.map +0 -1
  187. package/card/fesm2022/card.mjs.map +0 -1
  188. package/carousel/fesm2022/carousel.mjs.map +0 -1
  189. package/checkbox/fesm2022/checkbox.mjs.map +0 -1
  190. package/collapsible/fesm2022/collapsible.mjs.map +0 -1
  191. package/combobox/fesm2022/combobox.mjs.map +0 -1
  192. package/command/fesm2022/command.mjs.map +0 -1
  193. package/confirmation-dialog/fesm2022/confirmation-dialog.mjs.map +0 -1
  194. package/context-menu/fesm2022/context-menu.mjs.map +0 -1
  195. package/date-picker/fesm2022/date-picker.mjs.map +0 -1
  196. package/dialog/fesm2022/dialog.mjs.map +0 -1
  197. package/drawer/fesm2022/drawer.mjs.map +0 -1
  198. package/dropdown-menu/fesm2022/dropdown-menu.mjs.map +0 -1
  199. package/empty/fesm2022/empty.mjs.map +0 -1
  200. package/field/fesm2022/field.mjs.map +0 -1
  201. package/form-checkbox/fesm2022/form-checkbox.mjs.map +0 -1
  202. package/form-date-picker/fesm2022/form-date-picker.mjs.map +0 -1
  203. package/form-field/fesm2022/form-field.mjs.map +0 -1
  204. package/form-field-simple/fesm2022/form-field-simple.mjs.map +0 -1
  205. package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs.map +0 -1
  206. package/form-select/fesm2022/form-select.mjs.map +0 -1
  207. package/form-text-input/fesm2022/form-text-input.mjs.map +0 -1
  208. package/form-textarea/fesm2022/form-textarea.mjs.map +0 -1
  209. package/hover-card/fesm2022/hover-card.mjs.map +0 -1
  210. package/icon/fesm2022/icon.mjs.map +0 -1
  211. package/input/fesm2022/input.mjs.map +0 -1
  212. package/input-group/fesm2022/input-group.mjs.map +0 -1
  213. package/input-otp/fesm2022/input-otp.mjs.map +0 -1
  214. package/item/fesm2022/item.mjs.map +0 -1
  215. package/kbd/fesm2022/kbd.mjs.map +0 -1
  216. package/label/fesm2022/label.mjs.map +0 -1
  217. package/layout-simple/fesm2022/layout-simple.mjs.map +0 -1
  218. package/menubar/fesm2022/menubar.mjs.map +0 -1
  219. package/native-select/fesm2022/native-select.mjs.map +0 -1
  220. package/navigation-menu/fesm2022/navigation-menu.mjs.map +0 -1
  221. package/pagination/fesm2022/pagination.mjs.map +0 -1
  222. package/popover/fesm2022/popover.mjs.map +0 -1
  223. package/progress/fesm2022/progress.mjs.map +0 -1
  224. package/radio-group/fesm2022/radio-group.mjs.map +0 -1
  225. package/resizable/fesm2022/resizable.mjs.map +0 -1
  226. package/scroll-area/fesm2022/scroll-area.mjs.map +0 -1
  227. package/searchable-multiselect/fesm2022/searchable-multiselect.mjs.map +0 -1
  228. package/select/fesm2022/select.mjs.map +0 -1
  229. package/separator/fesm2022/separator.mjs.map +0 -1
  230. package/sheet/fesm2022/sheet.mjs.map +0 -1
  231. package/sidebar/fesm2022/sidebar.mjs.map +0 -1
  232. package/skeleton/fesm2022/skeleton.mjs.map +0 -1
  233. package/slider/fesm2022/slider.mjs.map +0 -1
  234. package/sonner/fesm2022/sonner.mjs.map +0 -1
  235. package/spinner/fesm2022/spinner.mjs.map +0 -1
  236. package/switch/fesm2022/switch.mjs.map +0 -1
  237. package/table/fesm2022/table.mjs.map +0 -1
  238. package/tabs/fesm2022/tabs.mjs.map +0 -1
  239. package/textarea/fesm2022/textarea.mjs.map +0 -1
  240. package/toggle/fesm2022/toggle.mjs.map +0 -1
  241. package/toggle-group/fesm2022/toggle-group.mjs.map +0 -1
  242. package/tooltip/fesm2022/tooltip.mjs.map +0 -1
  243. package/typography/fesm2022/typography.mjs.map +0 -1
  244. package/utils/fesm2022/utils.mjs.map +0 -1
package/tooltip/README.md CHANGED
@@ -1,64 +1,270 @@
1
- # Tooltip
1
+ # Tooltip (`@egose/shadcn-theme-ng/tooltip`)
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.2.0.
3
+ Contextual hints, equivalent to [shadcn/ui Tooltip](https://ui.shadcn.com/docs/components/tooltip). This subpath ships a single thin directive, `HlmTooltip` (`[hlmTooltip]`), that configures spartan-ng's `BrnTooltip` primitive with shadcn styling: it provides default content classes (`DEFAULT_TOOLTIP_CONTENT_CLASSES`), arrow SVG classes (`DEFAULT_TOOLTIP_SVG_CLASS`), and per-position arrow placement (`tooltipPositionVariants`). All show/hide behavior comes from `BrnTooltip` — this package only themes it.
4
4
 
5
- ## Code scaffolding
5
+ > **Ships as:** `@egose/shadcn-theme-ng/tooltip` and `@egose/shadcn-theme-ng-tw/tooltip` (the `tw:`-prefixed Tailwind variant). See the [package README](../../README.md) for install steps, peer dependencies, Tailwind setup, and testing/release guidance. Do not publish this project directory independently.
6
6
 
7
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
7
+ ## Installation
8
8
 
9
9
  ```bash
10
- ng generate component component-name
10
+ # Plain Tailwind (no prefix)
11
+ npm install @egose/shadcn-theme-ng
12
+
13
+ # Or the tw:-prefixed variant
14
+ npm install @egose/shadcn-theme-ng-tw
11
15
  ```
12
16
 
13
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
17
+ `@spartan-ng/brain` and `class-variance-authority` arrive transitively. See the [package README](../../README.md) for the full peer-dependency table.
14
18
 
15
- ```bash
16
- ng generate --help
19
+ ## Imports
20
+
21
+ All public symbols are re-exported from `projects/tooltip/src/public-api.ts`:
22
+
23
+ ```ts
24
+ import {
25
+ DEFAULT_TOOLTIP_CONTENT_CLASSES,
26
+ DEFAULT_TOOLTIP_SVG_CLASS,
27
+ HlmTooltip,
28
+ HlmTooltipImports,
29
+ HlmTooltipModule,
30
+ tooltipPositionVariants,
31
+ } from '@egose/shadcn-theme-ng/tooltip';
32
+ // tw variant: swap to '@egose/shadcn-theme-ng-tw/tooltip'
17
33
  ```
18
34
 
19
- ## Building
35
+ Standalone-component usage (preferred):
20
36
 
21
- To build the library, run:
37
+ ```ts
38
+ import { Component } from '@angular/core';
39
+ import { HlmTooltipImports } from '@egose/shadcn-theme-ng/tooltip';
22
40
 
23
- ```bash
24
- ng build tooltip
41
+ @Component({
42
+ selector: 'app-demo',
43
+ standalone: true,
44
+ imports: [...HlmTooltipImports],
45
+ template: `<button [hlmTooltip]="'Save document'">Save</button>`,
46
+ })
47
+ export class DemoComponent {}
25
48
  ```
26
49
 
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
50
+ NgModule usage:
28
51
 
29
- ### Publishing the Library
52
+ ```ts
53
+ import { NgModule } from '@angular/core';
54
+ import { HlmTooltipModule } from '@egose/shadcn-theme-ng/tooltip';
30
55
 
31
- Once the project is built, you can publish your library by following these steps:
56
+ @NgModule({ imports: [HlmTooltipModule] })
57
+ export class FeatureModule {}
58
+ ```
32
59
 
33
- 1. Navigate to the `dist` directory:
60
+ | Symbol | Kind | Description |
61
+ | --------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
62
+ | `HlmTooltip` | Directive | `[hlmTooltip]` — themed `BrnTooltip` with shadcn defaults. |
63
+ | `DEFAULT_TOOLTIP_CONTENT_CLASSES` | `const` (string) | Default bubble classes (`bg-foreground text-background rounded-md px-3 py-1.5 text-xs …`). |
64
+ | `DEFAULT_TOOLTIP_SVG_CLASS` | `const` (string) | Default arrow classes (`bg-foreground fill-foreground size-2.5 rotate-45 …`). (Note: unprefixed utilities; overridden by the provider with `hlm()`.) |
65
+ | `tooltipPositionVariants` | cva fn | `tooltipPositionVariants({ position })` — arrow placement for `top/bottom/left/right`. |
66
+ | `HlmTooltipImports` | `const` array | `[HlmTooltip]` — spread into `imports: [...]`. |
67
+ | `HlmTooltipModule` | NgModule | Imports + re-exports `HlmTooltip`. |
34
68
 
35
- ```bash
36
- cd dist/tooltip
37
- ```
69
+ ## Anatomy / Structure
38
70
 
39
- 2. Run the `npm publish` command to publish your library to the npm registry:
40
- ```bash
41
- npm publish
42
- ```
71
+ ```html
72
+ <!-- basic: string content -->
73
+ <button hlmBtn [hlmTooltip]="'Add to library'">Add</button>
43
74
 
44
- ## Running unit tests
75
+ <!-- positioned, delayed -->
76
+ <button hlmBtn [hlmTooltip]="'Settings'" position="right" [showDelay]="300" [hideDelay]="100">Settings</button>
45
77
 
46
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
78
+ <!-- disabled tooltip -->
79
+ <button hlmBtn [hlmTooltip]="'Hidden hint'" [tooltipDisabled]="true">No tooltip</button>
80
+ ```
47
81
 
48
- ```bash
49
- ng test
82
+ The directive takes the tooltip **text as its input value** (`brnTooltip: hlmTooltip`) and renders the floating bubble + arrow via the CDK overlay. No extra outlet component is needed.
83
+
84
+ ## API reference
85
+
86
+ ### `HlmTooltip` — selector `[hlmTooltip]` (directive, hosts `BrnTooltip`)
87
+
88
+ The directive declares **no own inputs** — everything is forwarded to `BrnTooltip` (plus provider defaults):
89
+
90
+ | Input | Type | Default (via provider) | Description |
91
+ | ----------------- | --------------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------- |
92
+ | `hlmTooltip` | `string` (forwarded as `brnTooltip`) | — | Tooltip text content. Required to show anything. |
93
+ | `position` | `BrnTooltipPosition` (`'top' \| 'bottom' \| 'left' \| 'right'`) | — (Brn default) | Bubble side + arrow placement (arrow via `tooltipPositionVariants`). |
94
+ | `showDelay` | `number` (forwarded) | — (Brn default) | ms before the tooltip appears on hover/focus. |
95
+ | `hideDelay` | `number` (forwarded) | — (Brn default) | ms before the tooltip hides on leave/blur. |
96
+ | `tooltipDisabled` | `boolean` (forwarded) | — (Brn default) | Suppress the tooltip entirely. |
97
+
98
+ Provider defaults (`provideBrnTooltipDefaultOptions`, applied automatically): `svgClasses: DEFAULT_TOOLTIP_SVG_CLASS`, `tooltipContentClasses: DEFAULT_TOOLTIP_CONTENT_CLASSES`, `arrowClasses: (position) => hlm(tooltipPositionVariants({ position }))`.
99
+
100
+ No outputs. Can attach to any element (buttons, icons, toggles, links).
101
+
102
+ ## Examples
103
+
104
+ ### 1. Basic usage
105
+
106
+ ```ts
107
+ // demo-basic.component.ts
108
+ import { Component } from '@angular/core';
109
+ import { HlmTooltipImports } from '@egose/shadcn-theme-ng/tooltip';
110
+ import { HlmButtonImports } from '@egose/shadcn-theme-ng/button';
111
+
112
+ @Component({
113
+ selector: 'demo-basic',
114
+ standalone: true,
115
+ imports: [...HlmTooltipImports, ...HlmButtonImports],
116
+ template: ` <button hlmBtn variant="outline" [hlmTooltip]="'Add to library'">Add</button> `,
117
+ })
118
+ export class DemoBasic {}
50
119
  ```
51
120
 
52
- ## Running end-to-end tests
121
+ ### 2. All positions
53
122
 
54
- For end-to-end (e2e) testing, run:
123
+ ```ts
124
+ // demo-positions.component.ts
125
+ import { Component } from '@angular/core';
126
+ import { HlmTooltipImports } from '@egose/shadcn-theme-ng/tooltip';
127
+ import { HlmButtonImports } from '@egose/shadcn-theme-ng/button';
55
128
 
56
- ```bash
57
- ng e2e
129
+ @Component({
130
+ selector: 'demo-positions',
131
+ standalone: true,
132
+ imports: [...HlmTooltipImports, ...HlmButtonImports],
133
+ template: `
134
+ <div class="flex flex-wrap gap-2">
135
+ <button hlmBtn variant="outline" [hlmTooltip]="'On top'" position="top">Top</button>
136
+ <button hlmBtn variant="outline" [hlmTooltip]="'Below'" position="bottom">Bottom</button>
137
+ <button hlmBtn variant="outline" [hlmTooltip]="'On the left'" position="left">Left</button>
138
+ <button hlmBtn variant="outline" [hlmTooltip]="'On the right'" position="right">Right</button>
139
+ </div>
140
+ `,
141
+ })
142
+ export class DemoPositions {}
58
143
  ```
59
144
 
60
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
145
+ The arrow repositions automatically per side via `tooltipPositionVariants({ position })`.
146
+
147
+ ### 3. Delays + disabled state
148
+
149
+ ```ts
150
+ // demo-delays.component.ts
151
+ import { Component, signal } from '@angular/core';
152
+ import { HlmTooltipImports } from '@egose/shadcn-theme-ng/tooltip';
153
+ import { HlmButtonImports } from '@egose/shadcn-theme-ng/button';
154
+
155
+ @Component({
156
+ selector: 'demo-delays',
157
+ standalone: true,
158
+ imports: [...HlmTooltipImports, ...HlmButtonImports],
159
+ template: `
160
+ <div class="flex gap-2">
161
+ <button hlmBtn variant="outline" [hlmTooltip]="'Slow to appear'" [showDelay]="600" [hideDelay]="100">
162
+ Hover me
163
+ </button>
164
+ <button hlmBtn variant="outline" [hlmTooltip]="'Never shows'" [tooltipDisabled]="muted()">
165
+ {{ muted() ? 'Muted (no tip)' : 'Unmuted' }}
166
+ </button>
167
+ <button hlmBtn size="sm" (click)="muted.set(!muted())">Toggle mute</button>
168
+ </div>
169
+ `,
170
+ })
171
+ export class DemoDelays {
172
+ readonly muted = signal(false);
173
+ }
174
+ ```
175
+
176
+ ### 4. Icon-only buttons and toggles (accessible names still required)
177
+
178
+ ```ts
179
+ // demo-icons.component.ts
180
+ import { Component } from '@angular/core';
181
+ import { HlmTooltipImports } from '@egose/shadcn-theme-ng/tooltip';
182
+ import { HlmToggleImports } from '@egose/shadcn-theme-ng/toggle';
183
+ import { NgIcon, provideIcons } from '@ng-icons/core';
184
+ import { lucideBold, lucideItalic } from '@ng-icons/lucide';
185
+
186
+ @Component({
187
+ selector: 'demo-icons',
188
+ standalone: true,
189
+ imports: [...HlmTooltipImports, ...HlmToggleImports, NgIcon],
190
+ providers: [provideIcons({ lucideBold, lucideItalic })],
191
+ template: `
192
+ <div class="flex gap-1">
193
+ <button hlmToggle aria-label="Toggle bold" [hlmTooltip]="'Bold (Ctrl+B)'">
194
+ <ng-icon name="lucideBold" />
195
+ </button>
196
+ <button hlmToggle aria-label="Toggle italic" [hlmTooltip]="'Italic (Ctrl+I)'" position="bottom">
197
+ <ng-icon name="lucideItalic" />
198
+ </button>
199
+ </div>
200
+ `,
201
+ })
202
+ export class DemoIcons {}
203
+ ```
204
+
205
+ > The tooltip is a visual hint only — icon buttons still need `aria-label` (tooltips are not reliably announced).
206
+
207
+ ### 5. Dynamic content from signals
208
+
209
+ ```ts
210
+ // demo-dynamic.component.ts
211
+ import { Component, computed, signal } from '@angular/core';
212
+ import { HlmTooltipImports } from '@egose/shadcn-theme-ng/tooltip';
213
+ import { HlmButtonImports } from '@egose/shadcn-theme-ng/button';
214
+
215
+ @Component({
216
+ selector: 'demo-dynamic',
217
+ standalone: true,
218
+ imports: [...HlmTooltipImports, ...HlmButtonImports],
219
+ template: `
220
+ <button hlmBtn variant="outline" [hlmTooltip]="tip()" (click)="count.set(count() + 1)">
221
+ Clicked {{ count() }}×
222
+ </button>
223
+ `,
224
+ })
225
+ export class DemoDynamic {
226
+ readonly count = signal(0);
227
+ readonly tip = computed(() => (this.count() === 0 ? 'Click to start' : `Clicked ${this.count()} times`));
228
+ }
229
+ ```
230
+
231
+ ### 6. Advanced: reusing the class constants
232
+
233
+ ```ts
234
+ // demo-classes.component.ts
235
+ import { Component } from '@angular/core';
236
+ import { DEFAULT_TOOLTIP_CONTENT_CLASSES, tooltipPositionVariants } from '@egose/shadcn-theme-ng/tooltip';
237
+ import { hlm } from '@egose/shadcn-theme-ng/utils';
238
+
239
+ @Component({
240
+ selector: 'demo-classes',
241
+ standalone: true,
242
+ template: `<p class="text-sm">Content classes length: {{ len }}</p>`,
243
+ })
244
+ export class DemoClasses {
245
+ readonly len = DEFAULT_TOOLTIP_CONTENT_CLASSES.length;
246
+
247
+ arrowFor(position: 'top' | 'bottom' | 'left' | 'right') {
248
+ return hlm(tooltipPositionVariants({ position }));
249
+ }
250
+ }
251
+ ```
252
+
253
+ ## Accessibility notes
254
+
255
+ - Tooltips appear on hover **and** focus (via Brn) — keyboard users get them automatically; do not gate hints behind hover-only behavior.
256
+ - Never put essential information _only_ in a tooltip: screen-reader and touch support is best-effort. Mirror critical hints as visible text or `aria-label`s.
257
+ - Icon-only triggers need `aria-label` regardless of tooltip text.
258
+ - Keep tooltip text short (a few words); long prose belongs in a popover/dialog.
259
+ - `tooltipDisabled` removes the hint entirely — only use it when the control is self-explanatory in that state, not to hide errors.
260
+
261
+ ## Theming / CSS variables
262
+
263
+ The bubble uses `bg-foreground text-background` with entrance/exit animations per side and theme-aware shadows; the arrow inherits the same fill. Follows your shadcn theme automatically. Override globally by providing your own `provideBrnTooltipDefaultOptions`, or per case by wrapping triggers with custom classes.
61
264
 
62
- ## Additional Resources
265
+ ## Related subpaths
63
266
 
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.
267
+ - `@egose/shadcn-theme-ng/button` — most common tooltip anchor.
268
+ - `@egose/shadcn-theme-ng/toggle` / `@egose/shadcn-theme-ng/toggle-group` — icon toggles that pair well with hints.
269
+ - `@egose/shadcn-theme-ng/popover` / `@egose/shadcn-theme-ng/hover-card` — richer floating content (vs. short tooltip text).
270
+ - `@egose/shadcn-theme-ng/utils` — `hlm()` used to compose arrow/content classes.
@@ -6,20 +6,20 @@ import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
6
6
  import { cva } from 'class-variance-authority';
7
7
 
8
8
  const DEFAULT_TOOLTIP_SVG_CLASS = 'bg-foreground fill-foreground z-50 block size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]';
9
- const DEFAULT_TOOLTIP_CONTENT_CLASSES = hlm('data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs bg-foreground text-background data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) text-balance');
10
- const tooltipPositionVariants = cva('absolute', {
9
+ const DEFAULT_TOOLTIP_CONTENT_CLASSES = hlm('tw:data-open:animate-in data-open:fade-in-0 tw:data-open:zoom-in-95 tw:data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 tw:data-[state=delayed-open]:zoom-in-95 tw:data-closed:animate-out data-closed:fade-out-0 tw:data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 tw:rounded-md tw:px-3 tw:py-1.5 tw:text-xs tw:bg-foreground tw:text-background tw:data-open:animate-in data-open:fade-in-0 tw:data-open:zoom-in-95 tw:data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 tw:data-[state=delayed-open]:zoom-in-95 tw:data-closed:animate-out data-closed:fade-out-0 tw:data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 tw:z-50 tw:w-fit tw:origin-(--radix-tooltip-content-transform-origin) tw:text-balance');
10
+ const tooltipPositionVariants = cva('tw:absolute', {
11
11
  variants: {
12
12
  position: {
13
- top: 'bottom-0 left-[calc(50%-5px)] translate-y-full',
14
- bottom: '-top-2.5 left-[calc(50%-5px)] translate-y-0 rotate-180',
15
- left: '-end-2.5 top-[calc(50%-5px)] translate-y-0 rotate-270 rtl:-rotate-270',
16
- right: '-start-2.5 top-[calc(50%-5px)] translate-y-0 rotate-90 rtl:-rotate-90',
13
+ top: 'tw:bottom-0 tw:left-[calc(50%-5px)] tw:translate-y-full',
14
+ bottom: 'tw:-top-2.5 tw:left-[calc(50%-5px)] tw:translate-y-0 tw:rotate-180',
15
+ left: 'tw:-end-2.5 tw:top-[calc(50%-5px)] tw:translate-y-0 tw:rotate-270 tw:rtl:-rotate-270',
16
+ right: 'tw:-start-2.5 tw:top-[calc(50%-5px)] tw:translate-y-0 tw:rotate-90 tw:rtl:-rotate-90',
17
17
  },
18
18
  },
19
19
  });
20
20
  class HlmTooltip {
21
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive });
22
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmTooltip, isStandalone: true, selector: "[hlmTooltip]", providers: [
21
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive });
22
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmTooltip, isStandalone: true, selector: "[hlmTooltip]", providers: [
23
23
  provideBrnTooltipDefaultOptions({
24
24
  svgClasses: DEFAULT_TOOLTIP_SVG_CLASS,
25
25
  tooltipContentClasses: DEFAULT_TOOLTIP_CONTENT_CLASSES,
@@ -27,7 +27,7 @@ class HlmTooltip {
27
27
  }),
28
28
  ], hostDirectives: [{ directive: i1.BrnTooltip, inputs: ["brnTooltip", "hlmTooltip", "position", "position", "hideDelay", "hideDelay", "showDelay", "showDelay", "tooltipDisabled", "tooltipDisabled"] }], ngImport: i0 });
29
29
  }
30
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmTooltip, decorators: [{
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmTooltip, decorators: [{
31
31
  type: Directive,
32
32
  args: [{
33
33
  selector: '[hlmTooltip]',
@@ -52,11 +52,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
52
52
  */
53
53
  const HlmTooltipImports = [HlmTooltip];
54
54
  class HlmTooltipModule {
55
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
56
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.7", ngImport: i0, type: HlmTooltipModule, imports: [HlmTooltip], exports: [HlmTooltip] });
57
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmTooltipModule });
55
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
56
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmTooltipModule, imports: [HlmTooltip], exports: [HlmTooltip] });
57
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmTooltipModule });
58
58
  }
59
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmTooltipModule, decorators: [{
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmTooltipModule, decorators: [{
60
60
  type: NgModule,
61
61
  args: [{
62
62
  imports: [...HlmTooltipImports],
@@ -69,4 +69,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
69
69
  */
70
70
 
71
71
  export { DEFAULT_TOOLTIP_CONTENT_CLASSES, DEFAULT_TOOLTIP_SVG_CLASS, HlmTooltip, HlmTooltipImports, HlmTooltipModule, tooltipPositionVariants };
72
- //# sourceMappingURL=tooltip.mjs.map
72
+
@@ -1,11 +1,277 @@
1
- # Typography
1
+ # Typography (`@egose/shadcn-theme-ng/typography`)
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli).
3
+ Document type styles, equivalent to [shadcn/ui Typography](https://ui.shadcn.com/docs/components/typography). This subpath ships twelve **thin styling directives** — no behavior, no primitives, no inputs/outputs. Attach them to native elements (`h1`–`h4`, `p`, `blockquote`, `code`, `ul`, …) for shadcn type scale, plus matching exported class constants (`hlmH1`, `hlmP`, …) for reuse in custom components.
4
4
 
5
- ## Building
5
+ > **Ships as:** `@egose/shadcn-theme-ng/typography` and `@egose/shadcn-theme-ng-tw/typography` (the `tw:`-prefixed Tailwind variant). See the [package README](../../README.md) for install steps, peer dependencies, Tailwind setup, and testing/release guidance. Do not publish this project directory independently.
6
6
 
7
- To build the library, run:
7
+ ## Installation
8
8
 
9
9
  ```bash
10
- ng build typography
10
+ # Plain Tailwind (no prefix)
11
+ npm install @egose/shadcn-theme-ng
12
+
13
+ # Or the tw:-prefixed variant
14
+ npm install @egose/shadcn-theme-ng-tw
15
+ ```
16
+
17
+ No extra runtime dependencies. See the [package README](../../README.md) for the peer-dependency table.
18
+
19
+ ## Imports
20
+
21
+ All public symbols are re-exported from `projects/typography/src/public-api.ts`:
22
+
23
+ ```ts
24
+ import {
25
+ HlmBlockquote,
26
+ HlmCode,
27
+ HlmH1,
28
+ HlmH2,
29
+ HlmH3,
30
+ HlmH4,
31
+ HlmLarge,
32
+ HlmLead,
33
+ HlmMuted,
34
+ HlmP,
35
+ HlmSmall,
36
+ HlmTypographyImports,
37
+ HlmTypographyModule,
38
+ HlmUl,
39
+ } from '@egose/shadcn-theme-ng/typography';
40
+ // tw variant: swap to '@egose/shadcn-theme-ng-tw/typography'
41
+ ```
42
+
43
+ Class constants are exported alongside (`hlmH1`, `hlmH2`, `hlmH3`, `hlmH4`, `hlmP`, `hlmBlockquote`, `hlmCode`, `hlmLarge`, `hlmLead`, `hlmMuted`, `hlmSmall`, `hlmUl`).
44
+
45
+ Standalone-component usage (preferred):
46
+
47
+ ```ts
48
+ import { Component } from '@angular/core';
49
+ import { HlmTypographyImports } from '@egose/shadcn-theme-ng/typography';
50
+
51
+ @Component({
52
+ selector: 'app-demo',
53
+ standalone: true,
54
+ imports: [...HlmTypographyImports],
55
+ template: `<h1 hlmH1>Title</h1>`,
56
+ })
57
+ export class DemoComponent {}
58
+ ```
59
+
60
+ NgModule usage:
61
+
62
+ ```ts
63
+ import { NgModule } from '@angular/core';
64
+ import { HlmTypographyModule } from '@egose/shadcn-theme-ng/typography';
65
+
66
+ @NgModule({ imports: [HlmTypographyModule] })
67
+ export class FeatureModule {}
68
+ ```
69
+
70
+ | Symbol | Kind | Host selector (real) |
71
+ | ---------------------- | ------------- | -------------------------------- |
72
+ | `HlmH1` | Directive | `[hlmH1]` |
73
+ | `HlmH2` | Directive | `[hlmH2]` |
74
+ | `HlmH3` | Directive | `[hlmH3]` |
75
+ | `HlmH4` | Directive | `[hlmH4]` |
76
+ | `HlmP` | Directive | `[hlmP]` |
77
+ | `HlmBlockquote` | Directive | `[hlmBlockquote]` |
78
+ | `HlmCode` | Directive | `[hlmCode]` |
79
+ | `HlmLarge` | Directive | `[hlmLarge]` |
80
+ | `HlmLead` | Directive | `[hlmLead]` |
81
+ | `HlmMuted` | Directive | `[hlmMuted]` |
82
+ | `HlmSmall` | Directive | `[hlmSmall]` |
83
+ | `HlmUl` | Directive | `[hlmUl]` |
84
+ | `HlmTypographyImports` | `const` array | All twelve directives. |
85
+ | `HlmTypographyModule` | NgModule | Imports + re-exports all twelve. |
86
+
87
+ ## Anatomy / Structure
88
+
89
+ ```html
90
+ <h1 hlmH1>The Joke Tax Chronicles</h1>
91
+ <p hlmLead>Once upon a time, in a far-off land, there was a very lazy king.</p>
92
+ <h2 hlmH2>The King's Plan</h2>
93
+ <p hlmP>The king thought…</p>
94
+ <blockquote hlmBlockquote>"After all," he said, "everyone enjoys a good joke."</blockquote>
95
+ <h3 hlmH3>The Joke Tax</h3>
96
+ <ul hlmUl>
97
+ <li>1st level of puns: 5 gold coins</li>
98
+ <li>2nd level of jokes: 10 gold coins</li>
99
+ </ul>
100
+ <p hlmP>Learn more with <code hlmCode>ng add</code>.</p>
101
+ <p hlmLarge>Large callout line.</p>
102
+ <p hlmMuted>Muted fine print.</p>
103
+ <p hlmSmall>Small label text.</p>
104
+ <h4 hlmH4>Appendix</h4>
105
+ ```
106
+
107
+ Attach each directive to its matching semantic element (`HlmH1`→`<h1>`, `HlmUl`→`<ul>`, `HlmCode`→`<code>`, …) — the directive adds classes only and does not change semantics.
108
+
109
+ ## API reference
110
+
111
+ None of the twelve directives declare inputs, outputs, or methods. Each merges a fixed class string (also exported as a constant) via `classes()`:
112
+
113
+ | Directive / constant | Element | Fixed classes (abridged) |
114
+ | --------------------------------- | -------------- | ----------------------------------------------------------------------------------- |
115
+ | `HlmH1` / `hlmH1` | `<h1>` | `scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl` |
116
+ | `HlmH2` / `hlmH2` | `<h2>` | `scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0` |
117
+ | `HlmH3` / `hlmH3` | `<h3>` | `scroll-m-20 text-2xl font-semibold tracking-tight` |
118
+ | `HlmH4` / `hlmH4` | `<h4>` | `scroll-m-20 text-xl font-semibold tracking-tight` |
119
+ | `HlmP` / `hlmP` | `<p>` | `leading-7 [&:not(:first-child)]:mt-6` |
120
+ | `HlmBlockquote` / `hlmBlockquote` | `<blockquote>` | `mt-6 border-l-2 pl-6 italic` |
121
+ | `HlmCode` / `hlmCode` | `<code>` | `relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold` |
122
+ | `HlmUl` / `hlmUl` | `<ul>` | `my-6 ml-6 list-disc [&>li]:mt-2` |
123
+ | `HlmLarge` / `hlmLarge` | any | `text-lg font-semibold` |
124
+ | `HlmLead` / `hlmLead` | `<p>` | `text-xl text-muted-foreground` |
125
+ | `HlmMuted` / `hlmMuted` | `<p>` | `text-sm text-muted-foreground` |
126
+ | `HlmSmall` / `hlmSmall` | any | `text-sm font-medium leading-none` |
127
+
128
+ User `class` attributes merge (not clobbered) through the shared `classes()` helper.
129
+
130
+ ## Examples
131
+
132
+ ### 1. Full article page
133
+
134
+ ```ts
135
+ // demo-article.component.ts
136
+ import { Component } from '@angular/core';
137
+ import { HlmTypographyImports } from '@egose/shadcn-theme-ng/typography';
138
+
139
+ @Component({
140
+ selector: 'demo-article',
141
+ standalone: true,
142
+ imports: [...HlmTypographyImports],
143
+ template: `
144
+ <article class="max-w-2xl">
145
+ <h1 hlmH1>Taxing Laughter: The Joke Tax</h1>
146
+ <p hlmLead>Once upon a time, a king decided to tax every joke told in his kingdom.</p>
147
+ <h2 hlmH2>The King's Plan</h2>
148
+ <p hlmP>The king thought long and hard, and finally came up with a brilliant plan.</p>
149
+ <blockquote hlmBlockquote>"After all," he said, "everyone enjoys a good joke, so it's only fair."</blockquote>
150
+ <h3 hlmH3>The Joke Tax</h3>
151
+ <p hlmP>The king's subjects were not amused. They grumbled and complained.</p>
152
+ <ul hlmUl>
153
+ <li>1st level of puns: 5 gold coins</li>
154
+ <li>2nd level of jokes: 10 gold coins</li>
155
+ <li>3rd level of one-liners: 20 gold coins</li>
156
+ </ul>
157
+ </article>
158
+ `,
159
+ })
160
+ export class DemoArticle {}
161
+ ```
162
+
163
+ ### 2. Headings hierarchy (h1–h4)
164
+
165
+ ```ts
166
+ // demo-headings.component.ts
167
+ import { Component } from '@angular/core';
168
+ import { HlmTypographyImports } from '@egose/shadcn-theme-ng/typography';
169
+
170
+ @Component({
171
+ selector: 'demo-headings',
172
+ standalone: true,
173
+ imports: [...HlmTypographyImports],
174
+ template: `
175
+ <h1 hlmH1>Heading 1 — page title</h1>
176
+ <h2 hlmH2>Heading 2 — section (with bottom border)</h2>
177
+ <h3 hlmH3>Heading 3 — subsection</h3>
178
+ <h4 hlmH4>Heading 4 — detail header</h4>
179
+ `,
180
+ })
181
+ export class DemoHeadings {}
182
+ ```
183
+
184
+ Keep one `<h1>` per page and nest levels without skipping (h1→h2→h3).
185
+
186
+ ### 3. Lead, large, muted, small
187
+
188
+ ```ts
189
+ // demo-scale.component.ts
190
+ import { Component } from '@angular/core';
191
+ import { HlmTypographyImports } from '@egose/shadcn-theme-ng/typography';
192
+
193
+ @Component({
194
+ selector: 'demo-scale',
195
+ standalone: true,
196
+ imports: [...HlmTypographyImports],
197
+ template: `
198
+ <p hlmLead>A lead paragraph introduces the page — larger, muted.</p>
199
+ <p hlmP>Body copy with comfortable <code hlmCode>leading-7</code> rhythm.</p>
200
+ <div hlmLarge>Large: callouts, card titles, key figures.</div>
201
+ <p hlmMuted>Muted: timestamps, helper text, captions.</p>
202
+ <span hlmSmall>Small: labels, badges, table meta.</span>
203
+ `,
204
+ })
205
+ export class DemoScale {}
206
+ ```
207
+
208
+ ### 4. Inline code + blockquote
209
+
210
+ ```html
211
+ <p hlmP>Run <code hlmCode>ng build my-lib</code> to build, then ship the output.</p>
212
+ <blockquote hlmBlockquote>
213
+ "Design is the silent ambassador of your brand." — pair with a <cite>cite</cite> for attribution.
214
+ </blockquote>
215
+ ```
216
+
217
+ ### 5. Lists (bulleted + mixed content)
218
+
219
+ ```html
220
+ <ul hlmUl>
221
+ <li>Ship one library per component.</li>
222
+ <li>
223
+ Consume via subpath imports:
224
+ <code hlmCode>@egose/shadcn-theme-ng/button</code>
225
+ </li>
226
+ <li>Theme with CSS variables — no forks.</li>
227
+ </ul>
228
+ ```
229
+
230
+ ### 6. Advanced: reusing class constants in custom components
231
+
232
+ ```ts
233
+ // prose.component.ts
234
+ import { Component, input } from '@angular/core';
235
+ import { hlm } from '@egose/shadcn-theme-ng/utils';
236
+ import { hlmH2, hlmP } from '@egose/shadcn-theme-ng/typography';
237
+
238
+ @Component({
239
+ selector: 'app-prose-title',
240
+ standalone: true,
241
+ template: `<h2 [class]="classes()"><ng-content /></h2>`,
242
+ })
243
+ export class ProseTitle {
244
+ readonly tone = input<'default' | 'muted'>('default');
245
+
246
+ protected classes() {
247
+ return hlm(hlmH2, this.tone() === 'muted' && 'text-muted-foreground');
248
+ }
249
+ }
250
+
251
+ @Component({
252
+ selector: 'app-prose-body',
253
+ standalone: true,
254
+ template: `<p [class]="hlmP"><ng-content /></p>`,
255
+ })
256
+ export class ProseBody {
257
+ protected readonly hlmP = hlmP;
258
+ }
11
259
  ```
260
+
261
+ ## Accessibility notes
262
+
263
+ - Use real heading levels in order (`h1`→`h2`→`h3`); the directives style but never repair skipped levels — screen-reader navigation depends on the elements you choose.
264
+ - `HlmMuted`/`HlmSmall` reduce size/contrast — verify contrast ratios for body text (muted grays can fail on light backgrounds at small sizes).
265
+ - `<blockquote>` should contain the quote; add `<cite>`/attribution outside or within per your style guide.
266
+ - `<code hlmCode>` is inline; for multi-line samples use `<pre><code>` with your own overflow handling and a plaintext alternative when meaning depends on formatting.
267
+
268
+ ## Theming / CSS variables
269
+
270
+ Type styles key off `border-border`, `bg-muted`, and `text-muted-foreground` tokens, so they track your shadcn theme automatically. No per-component CSS variables.
271
+
272
+ ## Related subpaths
273
+
274
+ - `@egose/shadcn-theme-ng/card` — `CardTitle`/`CardDescription` surfaces that pair with type scale.
275
+ - `@egose/shadcn-theme-ng/table` — tabular content styled alongside prose.
276
+ - `@egose/shadcn-theme-ng/badge` / `@egose/shadcn-theme-ng/kbd` — inline semantics to mix into paragraphs.
277
+ - `@egose/shadcn-theme-ng/utils` — `hlm()` for composing the exported class constants.