@frame-kit/ui-ng 0.0.1

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 (220) hide show
  1. package/COMPONENTS.md +683 -0
  2. package/DEVELOPMENT_GUIDE.md +1102 -0
  3. package/LICENSE +21 -0
  4. package/README.md +69 -0
  5. package/THEMING.md +130 -0
  6. package/core/headline/README.md +121 -0
  7. package/core/icon/README.md +173 -0
  8. package/core/image/README.md +210 -0
  9. package/core/link/README.md +297 -0
  10. package/core/separator/README.md +145 -0
  11. package/core/text/README.md +240 -0
  12. package/directives/infinite-scroll/README.md +102 -0
  13. package/directives/spotlight/README.md +154 -0
  14. package/directives/tooltip/README.md +147 -0
  15. package/docs/endpoint-link/README.md +142 -0
  16. package/docs/method-badge/README.md +154 -0
  17. package/fesm2022/frame-kit-ui-ng-core-headline.mjs +122 -0
  18. package/fesm2022/frame-kit-ui-ng-core-headline.mjs.map +1 -0
  19. package/fesm2022/frame-kit-ui-ng-core-icon.mjs +189 -0
  20. package/fesm2022/frame-kit-ui-ng-core-icon.mjs.map +1 -0
  21. package/fesm2022/frame-kit-ui-ng-core-image.mjs +123 -0
  22. package/fesm2022/frame-kit-ui-ng-core-image.mjs.map +1 -0
  23. package/fesm2022/frame-kit-ui-ng-core-link.mjs +369 -0
  24. package/fesm2022/frame-kit-ui-ng-core-link.mjs.map +1 -0
  25. package/fesm2022/frame-kit-ui-ng-core-separator.mjs +59 -0
  26. package/fesm2022/frame-kit-ui-ng-core-separator.mjs.map +1 -0
  27. package/fesm2022/frame-kit-ui-ng-core-text.mjs +204 -0
  28. package/fesm2022/frame-kit-ui-ng-core-text.mjs.map +1 -0
  29. package/fesm2022/frame-kit-ui-ng-directives-infinite-scroll.mjs +74 -0
  30. package/fesm2022/frame-kit-ui-ng-directives-infinite-scroll.mjs.map +1 -0
  31. package/fesm2022/frame-kit-ui-ng-directives-spotlight.mjs +76 -0
  32. package/fesm2022/frame-kit-ui-ng-directives-spotlight.mjs.map +1 -0
  33. package/fesm2022/frame-kit-ui-ng-directives-tooltip.mjs +425 -0
  34. package/fesm2022/frame-kit-ui-ng-directives-tooltip.mjs.map +1 -0
  35. package/fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs +63 -0
  36. package/fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs.map +1 -0
  37. package/fesm2022/frame-kit-ui-ng-docs-method-badge.mjs +43 -0
  38. package/fesm2022/frame-kit-ui-ng-docs-method-badge.mjs.map +1 -0
  39. package/fesm2022/frame-kit-ui-ng-forms.mjs +3632 -0
  40. package/fesm2022/frame-kit-ui-ng-forms.mjs.map +1 -0
  41. package/fesm2022/frame-kit-ui-ng-layouts-app-shell.mjs +239 -0
  42. package/fesm2022/frame-kit-ui-ng-layouts-app-shell.mjs.map +1 -0
  43. package/fesm2022/frame-kit-ui-ng-layouts-content-split.mjs +132 -0
  44. package/fesm2022/frame-kit-ui-ng-layouts-content-split.mjs.map +1 -0
  45. package/fesm2022/frame-kit-ui-ng-services-overlay-orchestrator.mjs +133 -0
  46. package/fesm2022/frame-kit-ui-ng-services-overlay-orchestrator.mjs.map +1 -0
  47. package/fesm2022/frame-kit-ui-ng-services-spotlight.mjs +60 -0
  48. package/fesm2022/frame-kit-ui-ng-services-spotlight.mjs.map +1 -0
  49. package/fesm2022/frame-kit-ui-ng-services-toast.mjs +166 -0
  50. package/fesm2022/frame-kit-ui-ng-services-toast.mjs.map +1 -0
  51. package/fesm2022/frame-kit-ui-ng-ui-accordion.mjs +214 -0
  52. package/fesm2022/frame-kit-ui-ng-ui-accordion.mjs.map +1 -0
  53. package/fesm2022/frame-kit-ui-ng-ui-alert.mjs +82 -0
  54. package/fesm2022/frame-kit-ui-ng-ui-alert.mjs.map +1 -0
  55. package/fesm2022/frame-kit-ui-ng-ui-avatar-stack.mjs +76 -0
  56. package/fesm2022/frame-kit-ui-ng-ui-avatar-stack.mjs.map +1 -0
  57. package/fesm2022/frame-kit-ui-ng-ui-avatar.mjs +81 -0
  58. package/fesm2022/frame-kit-ui-ng-ui-avatar.mjs.map +1 -0
  59. package/fesm2022/frame-kit-ui-ng-ui-badge.mjs +81 -0
  60. package/fesm2022/frame-kit-ui-ng-ui-badge.mjs.map +1 -0
  61. package/fesm2022/frame-kit-ui-ng-ui-breadcrumb.mjs +68 -0
  62. package/fesm2022/frame-kit-ui-ng-ui-breadcrumb.mjs.map +1 -0
  63. package/fesm2022/frame-kit-ui-ng-ui-button.mjs +108 -0
  64. package/fesm2022/frame-kit-ui-ng-ui-button.mjs.map +1 -0
  65. package/fesm2022/frame-kit-ui-ng-ui-callout.mjs +58 -0
  66. package/fesm2022/frame-kit-ui-ng-ui-callout.mjs.map +1 -0
  67. package/fesm2022/frame-kit-ui-ng-ui-card.mjs +70 -0
  68. package/fesm2022/frame-kit-ui-ng-ui-card.mjs.map +1 -0
  69. package/fesm2022/frame-kit-ui-ng-ui-copyable-field.mjs +113 -0
  70. package/fesm2022/frame-kit-ui-ng-ui-copyable-field.mjs.map +1 -0
  71. package/fesm2022/frame-kit-ui-ng-ui-data-table.mjs +1288 -0
  72. package/fesm2022/frame-kit-ui-ng-ui-data-table.mjs.map +1 -0
  73. package/fesm2022/frame-kit-ui-ng-ui-dialog.mjs +456 -0
  74. package/fesm2022/frame-kit-ui-ng-ui-dialog.mjs.map +1 -0
  75. package/fesm2022/frame-kit-ui-ng-ui-drawer.mjs +398 -0
  76. package/fesm2022/frame-kit-ui-ng-ui-drawer.mjs.map +1 -0
  77. package/fesm2022/frame-kit-ui-ng-ui-dropdown-menu.mjs +398 -0
  78. package/fesm2022/frame-kit-ui-ng-ui-dropdown-menu.mjs.map +1 -0
  79. package/fesm2022/frame-kit-ui-ng-ui-editable-field.mjs +125 -0
  80. package/fesm2022/frame-kit-ui-ng-ui-editable-field.mjs.map +1 -0
  81. package/fesm2022/frame-kit-ui-ng-ui-icon-badge.mjs +113 -0
  82. package/fesm2022/frame-kit-ui-ng-ui-icon-badge.mjs.map +1 -0
  83. package/fesm2022/frame-kit-ui-ng-ui-icon-list.mjs +111 -0
  84. package/fesm2022/frame-kit-ui-ng-ui-icon-list.mjs.map +1 -0
  85. package/fesm2022/frame-kit-ui-ng-ui-inline-edit.mjs +103 -0
  86. package/fesm2022/frame-kit-ui-ng-ui-inline-edit.mjs.map +1 -0
  87. package/fesm2022/frame-kit-ui-ng-ui-list-editor.mjs +135 -0
  88. package/fesm2022/frame-kit-ui-ng-ui-list-editor.mjs.map +1 -0
  89. package/fesm2022/frame-kit-ui-ng-ui-loader.mjs +81 -0
  90. package/fesm2022/frame-kit-ui-ng-ui-loader.mjs.map +1 -0
  91. package/fesm2022/frame-kit-ui-ng-ui-menu-item.mjs +79 -0
  92. package/fesm2022/frame-kit-ui-ng-ui-menu-item.mjs.map +1 -0
  93. package/fesm2022/frame-kit-ui-ng-ui-nav-brand.mjs +40 -0
  94. package/fesm2022/frame-kit-ui-ng-ui-nav-brand.mjs.map +1 -0
  95. package/fesm2022/frame-kit-ui-ng-ui-nav-group.mjs +110 -0
  96. package/fesm2022/frame-kit-ui-ng-ui-nav-group.mjs.map +1 -0
  97. package/fesm2022/frame-kit-ui-ng-ui-nav-separator.mjs +91 -0
  98. package/fesm2022/frame-kit-ui-ng-ui-nav-separator.mjs.map +1 -0
  99. package/fesm2022/frame-kit-ui-ng-ui-node-tree-breadcrumb.mjs +86 -0
  100. package/fesm2022/frame-kit-ui-ng-ui-node-tree-breadcrumb.mjs.map +1 -0
  101. package/fesm2022/frame-kit-ui-ng-ui-node-tree.mjs +443 -0
  102. package/fesm2022/frame-kit-ui-ng-ui-node-tree.mjs.map +1 -0
  103. package/fesm2022/frame-kit-ui-ng-ui-note.mjs +56 -0
  104. package/fesm2022/frame-kit-ui-ng-ui-note.mjs.map +1 -0
  105. package/fesm2022/frame-kit-ui-ng-ui-numbered-list.mjs +105 -0
  106. package/fesm2022/frame-kit-ui-ng-ui-numbered-list.mjs.map +1 -0
  107. package/fesm2022/frame-kit-ui-ng-ui-pagination.mjs +110 -0
  108. package/fesm2022/frame-kit-ui-ng-ui-pagination.mjs.map +1 -0
  109. package/fesm2022/frame-kit-ui-ng-ui-progress-bar.mjs +129 -0
  110. package/fesm2022/frame-kit-ui-ng-ui-progress-bar.mjs.map +1 -0
  111. package/fesm2022/frame-kit-ui-ng-ui-sidenav-link.mjs +42 -0
  112. package/fesm2022/frame-kit-ui-ng-ui-sidenav-link.mjs.map +1 -0
  113. package/fesm2022/frame-kit-ui-ng-ui-tabs.mjs +894 -0
  114. package/fesm2022/frame-kit-ui-ng-ui-tabs.mjs.map +1 -0
  115. package/fesm2022/frame-kit-ui-ng-ui-timeline.mjs +81 -0
  116. package/fesm2022/frame-kit-ui-ng-ui-timeline.mjs.map +1 -0
  117. package/fesm2022/frame-kit-ui-ng-ui-toast.mjs +179 -0
  118. package/fesm2022/frame-kit-ui-ng-ui-toast.mjs.map +1 -0
  119. package/fesm2022/frame-kit-ui-ng-ui-user-menu.mjs +143 -0
  120. package/fesm2022/frame-kit-ui-ng-ui-user-menu.mjs.map +1 -0
  121. package/fesm2022/frame-kit-ui-ng-ui-wizard-dialog.mjs +191 -0
  122. package/fesm2022/frame-kit-ui-ng-ui-wizard-dialog.mjs.map +1 -0
  123. package/fesm2022/frame-kit-ui-ng.mjs +58 -0
  124. package/fesm2022/frame-kit-ui-ng.mjs.map +1 -0
  125. package/layouts/app-shell/README.md +357 -0
  126. package/layouts/content-split/README.md +180 -0
  127. package/package.json +253 -0
  128. package/services/overlay-orchestrator/README.md +184 -0
  129. package/services/spotlight/README.md +61 -0
  130. package/services/toast/README.md +118 -0
  131. package/types/frame-kit-ui-ng-core-headline.d.ts +38 -0
  132. package/types/frame-kit-ui-ng-core-icon.d.ts +74 -0
  133. package/types/frame-kit-ui-ng-core-image.d.ts +93 -0
  134. package/types/frame-kit-ui-ng-core-link.d.ts +251 -0
  135. package/types/frame-kit-ui-ng-core-separator.d.ts +28 -0
  136. package/types/frame-kit-ui-ng-core-text.d.ts +186 -0
  137. package/types/frame-kit-ui-ng-directives-infinite-scroll.d.ts +42 -0
  138. package/types/frame-kit-ui-ng-directives-spotlight.d.ts +51 -0
  139. package/types/frame-kit-ui-ng-directives-tooltip.d.ts +70 -0
  140. package/types/frame-kit-ui-ng-docs-endpoint-link.d.ts +43 -0
  141. package/types/frame-kit-ui-ng-docs-method-badge.d.ts +30 -0
  142. package/types/frame-kit-ui-ng-forms.d.ts +1674 -0
  143. package/types/frame-kit-ui-ng-layouts-app-shell.d.ts +75 -0
  144. package/types/frame-kit-ui-ng-layouts-content-split.d.ts +43 -0
  145. package/types/frame-kit-ui-ng-services-overlay-orchestrator.d.ts +96 -0
  146. package/types/frame-kit-ui-ng-services-spotlight.d.ts +32 -0
  147. package/types/frame-kit-ui-ng-services-toast.d.ts +100 -0
  148. package/types/frame-kit-ui-ng-ui-accordion.d.ts +86 -0
  149. package/types/frame-kit-ui-ng-ui-alert.d.ts +34 -0
  150. package/types/frame-kit-ui-ng-ui-avatar-stack.d.ts +38 -0
  151. package/types/frame-kit-ui-ng-ui-avatar.d.ts +36 -0
  152. package/types/frame-kit-ui-ng-ui-badge.d.ts +33 -0
  153. package/types/frame-kit-ui-ng-ui-breadcrumb.d.ts +45 -0
  154. package/types/frame-kit-ui-ng-ui-button.d.ts +48 -0
  155. package/types/frame-kit-ui-ng-ui-callout.d.ts +26 -0
  156. package/types/frame-kit-ui-ng-ui-card.d.ts +30 -0
  157. package/types/frame-kit-ui-ng-ui-copyable-field.d.ts +62 -0
  158. package/types/frame-kit-ui-ng-ui-data-table.d.ts +482 -0
  159. package/types/frame-kit-ui-ng-ui-dialog.d.ts +166 -0
  160. package/types/frame-kit-ui-ng-ui-drawer.d.ts +130 -0
  161. package/types/frame-kit-ui-ng-ui-dropdown-menu.d.ts +77 -0
  162. package/types/frame-kit-ui-ng-ui-editable-field.d.ts +65 -0
  163. package/types/frame-kit-ui-ng-ui-icon-badge.d.ts +45 -0
  164. package/types/frame-kit-ui-ng-ui-icon-list.d.ts +67 -0
  165. package/types/frame-kit-ui-ng-ui-inline-edit.d.ts +44 -0
  166. package/types/frame-kit-ui-ng-ui-list-editor.d.ts +56 -0
  167. package/types/frame-kit-ui-ng-ui-loader.d.ts +32 -0
  168. package/types/frame-kit-ui-ng-ui-menu-item.d.ts +27 -0
  169. package/types/frame-kit-ui-ng-ui-nav-brand.d.ts +25 -0
  170. package/types/frame-kit-ui-ng-ui-nav-group.d.ts +60 -0
  171. package/types/frame-kit-ui-ng-ui-nav-separator.d.ts +33 -0
  172. package/types/frame-kit-ui-ng-ui-node-tree-breadcrumb.d.ts +35 -0
  173. package/types/frame-kit-ui-ng-ui-node-tree.d.ts +135 -0
  174. package/types/frame-kit-ui-ng-ui-note.d.ts +22 -0
  175. package/types/frame-kit-ui-ng-ui-numbered-list.d.ts +52 -0
  176. package/types/frame-kit-ui-ng-ui-pagination.d.ts +49 -0
  177. package/types/frame-kit-ui-ng-ui-progress-bar.d.ts +50 -0
  178. package/types/frame-kit-ui-ng-ui-sidenav-link.d.ts +24 -0
  179. package/types/frame-kit-ui-ng-ui-tabs.d.ts +266 -0
  180. package/types/frame-kit-ui-ng-ui-timeline.d.ts +42 -0
  181. package/types/frame-kit-ui-ng-ui-toast.d.ts +56 -0
  182. package/types/frame-kit-ui-ng-ui-user-menu.d.ts +87 -0
  183. package/types/frame-kit-ui-ng-ui-wizard-dialog.d.ts +116 -0
  184. package/types/frame-kit-ui-ng.d.ts +53 -0
  185. package/ui/accordion/README.md +261 -0
  186. package/ui/alert/README.md +211 -0
  187. package/ui/avatar/README.md +167 -0
  188. package/ui/avatar-stack/README.md +164 -0
  189. package/ui/badge/README.md +162 -0
  190. package/ui/breadcrumb/README.md +240 -0
  191. package/ui/button/README.md +184 -0
  192. package/ui/callout/README.md +159 -0
  193. package/ui/card/README.md +174 -0
  194. package/ui/copyable-field/README.md +235 -0
  195. package/ui/data-table/README.md +408 -0
  196. package/ui/dialog/README.md +222 -0
  197. package/ui/drawer/README.md +274 -0
  198. package/ui/dropdown-menu/README.md +336 -0
  199. package/ui/editable-field/README.md +171 -0
  200. package/ui/icon-badge/README.md +131 -0
  201. package/ui/icon-list/README.md +205 -0
  202. package/ui/inline-edit/README.md +135 -0
  203. package/ui/list-editor/README.md +162 -0
  204. package/ui/loader/README.md +160 -0
  205. package/ui/menu-item/README.md +204 -0
  206. package/ui/nav-brand/README.md +111 -0
  207. package/ui/nav-group/README.md +145 -0
  208. package/ui/nav-separator/README.md +44 -0
  209. package/ui/node-tree/README.md +278 -0
  210. package/ui/node-tree-breadcrumb/README.md +164 -0
  211. package/ui/note/README.md +146 -0
  212. package/ui/numbered-list/README.md +187 -0
  213. package/ui/pagination/README.md +174 -0
  214. package/ui/progress-bar/README.md +223 -0
  215. package/ui/sidenav-link/README.md +214 -0
  216. package/ui/tabs/README.md +204 -0
  217. package/ui/timeline/README.md +285 -0
  218. package/ui/toast/README.md +243 -0
  219. package/ui/user-menu/README.md +260 -0
  220. package/ui/wizard-dialog/README.md +283 -0
@@ -0,0 +1,164 @@
1
+ # fk-avatar-stack
2
+
3
+ A token-driven avatar stack molecule that displays a row of overlapping user avatars with an overflow badge for additional users.
4
+
5
+ ---
6
+
7
+ ## API
8
+
9
+ ### Inputs
10
+
11
+ | Input | Type | Default | Description |
12
+ | ------------ | ------------------- | ------- | ----------------------------------------------- |
13
+ | `users` | `AvatarStackUser[]` | `[]` | Array of users to display in the stack |
14
+ | `maxVisible` | `number` | `5` | Maximum number of avatars shown before overflow |
15
+ | `size` | `AvatarStackSize` | `'sm'` | Avatar size variant (`'sm'`, `'md'`, `'lg'`) |
16
+ | `className` | `string` | `''` | Additional CSS classes for the host element |
17
+ | `id` | `string \| null` | `null` | ID bound to the host element |
18
+ | `ariaLabel` | `string \| null` | `null` | `aria-label` bound to the host element |
19
+
20
+ ### Outputs
21
+
22
+ | Output | Type | Description |
23
+ | --------------- | ----------------- | ------------------------------------------ |
24
+ | `avatarClick` | `AvatarStackUser` | Emitted when a visible avatar is clicked |
25
+ | `overflowClick` | `void` | Emitted when the overflow badge is clicked |
26
+
27
+ ### AvatarStackUser
28
+
29
+ ```ts
30
+ interface AvatarStackUser {
31
+ id: string;
32
+ name: string;
33
+ avatarUrl?: string | null;
34
+ }
35
+ ```
36
+
37
+ `AvatarStackSize` is an alias for `AvatarSize` (`'sm' | 'md' | 'lg'`).
38
+
39
+ ---
40
+
41
+ ## Features
42
+
43
+ - Displays overlapping user avatars with configurable visibility limit
44
+ - Overflow badge shows the count of hidden users (e.g. "+3")
45
+ - Tooltip on each avatar shows the user's name
46
+ - Tooltip on the overflow badge lists all hidden user names
47
+ - Three size variants: `sm`, `md`, `lg`
48
+ - Delegates avatar rendering to `fk-avatar` (supports images and initials fallback)
49
+ - Token-driven styling for full theme customization
50
+
51
+ ---
52
+
53
+ ## Quick Start
54
+
55
+ ```html
56
+ <fk-avatar-stack [users]="teamMembers" [maxVisible]="4" (avatarClick)="onUserClick($event)" (overflowClick)="showAllMembers()"></fk-avatar-stack>
57
+ ```
58
+
59
+ ```ts
60
+ onUserClick(user: AvatarStackUser): void {
61
+ console.log("Clicked user:", user.name);
62
+ }
63
+
64
+ showAllMembers(): void {
65
+ // Open a dialog or panel showing all team members
66
+ }
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Import
72
+
73
+ ```ts
74
+ import { AvatarStackComponent } from '@frame-kit/ui-ng';
75
+ ```
76
+
77
+ ```ts
78
+ @Component({
79
+ selector: 'app-example',
80
+ imports: [AvatarStackComponent],
81
+ templateUrl: './example.component.html',
82
+ })
83
+ export class ExampleComponent {}
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Selector
89
+
90
+ ```html
91
+ <fk-avatar-stack></fk-avatar-stack>
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Examples
97
+
98
+ ### Basic stack
99
+
100
+ ```html
101
+ <fk-avatar-stack [users]="users" [maxVisible]="5"></fk-avatar-stack>
102
+ ```
103
+
104
+ ### Medium size with click handlers
105
+
106
+ ```html
107
+ <fk-avatar-stack [users]="users" [maxVisible]="3" size="md" (avatarClick)="onUserClick($event)" (overflowClick)="showAll()"></fk-avatar-stack>
108
+ ```
109
+
110
+ ### Large size with custom aria-label
111
+
112
+ ```html
113
+ <fk-avatar-stack [users]="users" size="lg" ariaLabel="Project team members"></fk-avatar-stack>
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Accessibility
119
+
120
+ - Each avatar item displays a tooltip with the user's name via `fkTooltip`
121
+ - The overflow button uses `aria-label="Show all users"` for screen readers
122
+ - The overflow button is a native `<button>` element, ensuring keyboard focus and activation
123
+ - The host element supports `aria-label` binding for group-level labeling
124
+
125
+ ---
126
+
127
+ ## Design Tokens
128
+
129
+ ```scss
130
+ /* Ring / border around avatars */
131
+ --fk-avatar-stack-ring
132
+
133
+ /* Overlap spacing between avatars */
134
+ --fk-avatar-stack-overlap
135
+
136
+ /* Overflow badge colors */
137
+ --fk-avatar-stack-overflow-color
138
+ --fk-avatar-stack-overflow-bg
139
+ --fk-avatar-stack-overflow-bg-hover
140
+
141
+ /* Overflow badge focus ring */
142
+ --fk-avatar-stack-overflow-focus-ring
143
+
144
+ /* Size-specific overflow badge font sizes */
145
+ --fk-avatar-stack-overflow-font-size-sm
146
+ --fk-avatar-stack-overflow-font-size-md
147
+ --fk-avatar-stack-overflow-font-size-lg
148
+
149
+ /* Avatar size tokens (shared with fk-avatar) */
150
+ --fk-avatar-size-sm
151
+ --fk-avatar-size-md
152
+ --fk-avatar-size-lg
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Behavior Notes
158
+
159
+ - `visibleUsers` is computed as `users.slice(0, maxVisible)` -- only the first N users are rendered as avatars
160
+ - `overflowCount` is `total - maxVisible` when there are more users than `maxVisible`, otherwise `0`
161
+ - `overflowTooltip` joins the names of all hidden users with commas (e.g. "Frank Miller, Grace Lee, Hank Wilson")
162
+ - The overflow badge is only rendered when `overflowCount > 0`
163
+ - Avatar items have `cursor: pointer` and a `z-index` bump on hover for visual stacking feedback
164
+ - The component uses `ChangeDetectionStrategy.OnPush` for optimal performance
@@ -0,0 +1,162 @@
1
+ # fk-badge
2
+
3
+ A small, token-driven label for secondary metadata such as statuses, counts, and tags.
4
+
5
+ ---
6
+
7
+ ## API
8
+
9
+ ### Inputs
10
+
11
+ | Input | Type | Default | Description |
12
+ | ----------------- | ---------------- | ----------- | -------------------------------------------------------------------------- |
13
+ | `variant` | `BadgeVariant` | `"default"` | Visual style of the badge (e.g. `default`, `success`, `warning`, `danger`) |
14
+ | `color` | `string \| null` | `null` | Overrides text color via inline `color` style |
15
+ | `backgroundColor` | `string \| null` | `null` | Overrides background color via inline `background-color` style |
16
+ | `borderColor` | `string \| null` | `null` | Optional border color (`1px solid {borderColor}`) |
17
+ | `padding` | `string \| null` | `null` | Overrides full padding (e.g. `"2px 8px"`) |
18
+ | `paddingInline` | `string \| null` | `null` | Overrides horizontal padding only |
19
+ | `className` | `string` | `''` | Additional CSS classes merged onto the host element |
20
+ | `id` | `string \| null` | `null` | Optional ID applied to the host element |
21
+ | `ariaLabel` | `string \| null` | `null` | Accessible label when badge content alone is not sufficient |
22
+
23
+ ### Content
24
+
25
+ `fk-badge` projects its content:
26
+
27
+ ```html
28
+ <fk-badge>New</fk-badge>
29
+ ```
30
+
31
+ ---
32
+
33
+ ## Features
34
+
35
+ - Token-driven visual variants for statuses and labels
36
+ - Compact, inline-friendly layout for chips, tags, and counters
37
+ - Customizable colors and padding via inputs and design tokens
38
+ - Works inside buttons, cards, tables, and lists
39
+ - Simple content projection for arbitrary text or inline elements
40
+
41
+ ---
42
+
43
+ ## Quick Start
44
+
45
+ ```html
46
+ <fk-badge>New</fk-badge>
47
+ ```
48
+
49
+ ```html
50
+ <fk-badge variant="success">Active</fk-badge>
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Import
56
+
57
+ ```ts
58
+ import { BadgeComponent } from '@frame-kit/ui-ng';
59
+ ```
60
+
61
+ ```ts
62
+ @Component({
63
+ selector: 'app-example',
64
+ imports: [BadgeComponent],
65
+ templateUrl: './example.component.html',
66
+ })
67
+ export class ExampleComponent {}
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Selector
73
+
74
+ ```html
75
+ <fk-badge></fk-badge>
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Examples
81
+
82
+ ### Status badges
83
+
84
+ ```html
85
+ <fk-badge variant="default">Draft</fk-badge>
86
+ <fk-badge variant="success">Active</fk-badge>
87
+ <fk-badge variant="warning">Pending</fk-badge>
88
+ <fk-badge variant="danger">Overdue</fk-badge>
89
+ ```
90
+
91
+ ### With custom colors
92
+
93
+ ```html
94
+ <fk-badge variant="default" color="#1f2933" backgroundColor="#e0f2fe" borderColor="#7fb4ff"> Beta </fk-badge>
95
+ ```
96
+
97
+ ### Inside other components
98
+
99
+ ```html
100
+ <fk-text as="div" variant="body">
101
+ Order #1234
102
+ <fk-badge variant="success">Closed</fk-badge>
103
+ </fk-text>
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Accessibility
109
+
110
+ - Renders as a semantic inline element (typically `span`) with visible text
111
+ - `ariaLabel` can be used when the visual label is abbreviated or symbolic
112
+ - Can be associated with other elements via `id` and `aria-describedby` on the target
113
+ - Intended as supplementary information; do not use for critical messaging without text
114
+
115
+ Recommended for abbreviations:
116
+
117
+ ```html
118
+ <fk-badge ariaLabel="High priority">P1</fk-badge>
119
+ ```
120
+
121
+ ---
122
+
123
+ ## Design Tokens
124
+
125
+ `fk-badge` is styled via badge-related design tokens and host classes such as
126
+ `fk-badge` and `fk-badge--{variant}`.
127
+
128
+ Example tokens (see the theme token files for the full contract):
129
+
130
+ ```scss
131
+ --fk-badge-font-size;
132
+ --fk-badge-font-weight;
133
+ --fk-badge-radius;
134
+ --fk-badge-padding-inline;
135
+
136
+ --fk-badge-bg-default;
137
+ --fk-badge-color-default;
138
+ --fk-badge-border-color-default;
139
+
140
+ --fk-badge-bg-success;
141
+ --fk-badge-color-success;
142
+ --fk-badge-border-color-success;
143
+ ```
144
+
145
+ Override tokens in your app stylesheet:
146
+
147
+ ```scss
148
+ :root {
149
+ --fk-badge-radius: 9999px;
150
+ --fk-badge-font-size: 11px;
151
+ }
152
+ ```
153
+
154
+ ---
155
+
156
+ ## Behavior Notes
157
+
158
+ - When `borderColor` is provided, a `1px solid` border is applied automatically
159
+ - `paddingInline` overrides only horizontal padding, allowing vertical spacing
160
+ to remain token-driven
161
+ - Prefer using `variant` and tokens for consistent theming; fall back to `color`
162
+ and `backgroundColor` only for one-off customizations
@@ -0,0 +1,240 @@
1
+ # fk-breadcrumb
2
+
3
+ A generic, route-driven breadcrumb for page navigation. Consumers pass an
4
+ ordered list of crumbs; the component renders each earlier crumb as a
5
+ router-linked `<a>` (or plain text when no `routerLink` is provided) and
6
+ the final crumb as the current location, marked with `aria-current="page"`.
7
+
8
+ Use this for URL-path breadcrumbs (e.g. `Docs > API Reference > Get an
9
+ organization`). For breadcrumbs that reflect a tree/hierarchy selection
10
+ (e.g. org-node ancestry) use [`fk-node-tree-breadcrumb`](../node-tree-breadcrumb/README.md)
11
+ instead.
12
+
13
+ ---
14
+
15
+ ## API
16
+
17
+ ### Inputs
18
+
19
+ | Input | Type | Default | Description |
20
+ | ----------- | --------------------------- | -------------- | -------------------------------------------------------------- |
21
+ | `items` | `readonly BreadcrumbItem[]` | _required_ | Ordered crumbs, first is root and last is the current location |
22
+ | `ariaLabel` | `string` | `'Breadcrumb'` | Accessible label for the navigation landmark |
23
+ | `className` | `string` | `''` | Additional CSS classes merged onto the host element |
24
+
25
+ ### Outputs
26
+
27
+ None. Navigation happens via Angular's `routerLink` on each crumb's anchor.
28
+
29
+ ### Content Projection Slots
30
+
31
+ | Slot | Kind | Description |
32
+ | ------------------------ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
33
+ | `#fkBreadcrumbSeparator` | `ng-template` reference | Optional custom separator instantiated once per gap between crumbs. Defaults to an inline chevron SVG shipped by the component. |
34
+
35
+ ```html
36
+ <fk-breadcrumb [items]="crumbs">
37
+ <ng-template #fkBreadcrumbSeparator>
38
+ <span>/</span>
39
+ </ng-template>
40
+ </fk-breadcrumb>
41
+ ```
42
+
43
+ If the slot isn't populated, the library renders its own inline chevron —
44
+ no consumer setup required.
45
+
46
+ ### `BreadcrumbItem`
47
+
48
+ ```ts
49
+ interface BreadcrumbItem {
50
+ label: string;
51
+ routerLink?: string | any[];
52
+ icon?: string;
53
+ }
54
+ ```
55
+
56
+ - `label` — text shown for the crumb
57
+ - `routerLink` — optional router command array or path. When present on a
58
+ non-terminal crumb, the crumb renders as an `<a [routerLink]>` anchor
59
+ - `icon` — optional icon name (reserved for consumers; not rendered by the
60
+ component itself)
61
+
62
+ ---
63
+
64
+ ## Features
65
+
66
+ - Route-driven navigation via Angular `routerLink`
67
+ - Automatic current-location marking on the last crumb
68
+ - Non-navigable ancestors supported (crumbs without `routerLink` render as
69
+ plain text)
70
+ - Inline SVG chevron separators
71
+ - Token-driven styling with two-tier fallbacks
72
+ - Renders correctly with no theme file loaded
73
+
74
+ ---
75
+
76
+ ## Quick Start
77
+
78
+ ```html
79
+ <fk-breadcrumb [items]="crumbs" />
80
+ ```
81
+
82
+ ```ts
83
+ crumbs: BreadcrumbItem[] = [
84
+ { label: "Docs", routerLink: ["/docs"] },
85
+ { label: "Introduction" },
86
+ ];
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Import
92
+
93
+ ```ts
94
+ import { BreadcrumbComponent } from '@frame-kit/ui-ng';
95
+ ```
96
+
97
+ ```ts
98
+ @Component({
99
+ selector: 'app-example',
100
+ imports: [BreadcrumbComponent],
101
+ templateUrl: './example.component.html',
102
+ })
103
+ export class ExampleComponent {}
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Selector
109
+
110
+ ```html
111
+ <fk-breadcrumb [items]="items" />
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Examples
117
+
118
+ ### Two-level breadcrumb
119
+
120
+ ```html
121
+ <fk-breadcrumb
122
+ [items]="[
123
+ { label: 'Docs', routerLink: ['/docs'] },
124
+ { label: 'Introduction' },
125
+ ]"
126
+ />
127
+ ```
128
+
129
+ Renders: Docs > **Introduction**
130
+
131
+ ### Deep path
132
+
133
+ ```html
134
+ <fk-breadcrumb
135
+ [items]="[
136
+ { label: 'Docs', routerLink: ['/docs'] },
137
+ { label: 'API Reference', routerLink: ['/docs/api-reference'] },
138
+ { label: 'Get an organization' },
139
+ ]"
140
+ />
141
+ ```
142
+
143
+ Renders: Docs > API Reference > **Get an organization**
144
+
145
+ ### With a non-navigable ancestor
146
+
147
+ ```html
148
+ <fk-breadcrumb
149
+ [items]="[
150
+ { label: 'Section' },
151
+ { label: 'Article', routerLink: ['/article'] },
152
+ { label: 'Current' },
153
+ ]"
154
+ />
155
+ ```
156
+
157
+ `Section` renders as plain text (no `routerLink`), `Article` as a link,
158
+ `Current` as the current-page span.
159
+
160
+ ### Custom aria-label
161
+
162
+ ```html
163
+ <fk-breadcrumb [items]="crumbs" ariaLabel="Docs trail" />
164
+ ```
165
+
166
+ ---
167
+
168
+ ## Accessibility
169
+
170
+ - Host element exposes `role="navigation"` and `aria-label="Breadcrumb"`
171
+ (customize with the `ariaLabel` input)
172
+ - Rendered as an ordered list (`<ol>`) for semantic structure
173
+ - The current (last) crumb is marked with `aria-current="page"`
174
+ - Non-terminal crumbs with `routerLink` are `<a>` elements — Tab + Enter
175
+ navigates
176
+ - Chevron separators are `aria-hidden="true"`
177
+ - Focus ring uses `--fk-focus-ring`
178
+
179
+ ---
180
+
181
+ ## Design Tokens
182
+
183
+ `fk-breadcrumb` is styled entirely through design tokens.
184
+
185
+ ### Component-specific tokens
186
+
187
+ ```
188
+ --fk-breadcrumb-gap
189
+ --fk-breadcrumb-font-size
190
+ --fk-breadcrumb-link-color
191
+ --fk-breadcrumb-link-color-hover
192
+ --fk-breadcrumb-current-color
193
+ --fk-breadcrumb-current-font-weight
194
+ --fk-breadcrumb-separator-color
195
+ ```
196
+
197
+ ### Shared tokens
198
+
199
+ ```
200
+ --fk-rhythm-1
201
+ --fk-typography-caption-font-size
202
+ --fk-font-weight-medium
203
+ --fk-color-muted
204
+ --fk-color-text
205
+ --fk-focus-ring
206
+ --fk-radius-sm
207
+ ```
208
+
209
+ ### Customizing Tokens
210
+
211
+ Override tokens in your application's stylesheet:
212
+
213
+ ```scss
214
+ :root {
215
+ --fk-breadcrumb-font-size: 0.875rem;
216
+ --fk-breadcrumb-link-color: #475569;
217
+ --fk-breadcrumb-current-font-weight: 600;
218
+ }
219
+ ```
220
+
221
+ Or scope overrides to a specific surface:
222
+
223
+ ```scss
224
+ ca-docs-shell {
225
+ --fk-breadcrumb-link-color: #94a3b8;
226
+ --fk-breadcrumb-current-color: #e2e8f0;
227
+ }
228
+ ```
229
+
230
+ ---
231
+
232
+ ## Behavior Notes
233
+
234
+ - When `items` is empty, the component renders an empty `<ol>` (no crumbs)
235
+ - The last crumb is always rendered as the current-location span,
236
+ regardless of whether a `routerLink` is provided — this matches the
237
+ typical breadcrumb pattern where the final segment represents the page
238
+ the user is already on
239
+ - `text-transform` is not applied by the component; consumers can apply it
240
+ externally via CSS