@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.
- package/COMPONENTS.md +683 -0
- package/DEVELOPMENT_GUIDE.md +1102 -0
- package/LICENSE +21 -0
- package/README.md +69 -0
- package/THEMING.md +130 -0
- package/core/headline/README.md +121 -0
- package/core/icon/README.md +173 -0
- package/core/image/README.md +210 -0
- package/core/link/README.md +297 -0
- package/core/separator/README.md +145 -0
- package/core/text/README.md +240 -0
- package/directives/infinite-scroll/README.md +102 -0
- package/directives/spotlight/README.md +154 -0
- package/directives/tooltip/README.md +147 -0
- package/docs/endpoint-link/README.md +142 -0
- package/docs/method-badge/README.md +154 -0
- package/fesm2022/frame-kit-ui-ng-core-headline.mjs +122 -0
- package/fesm2022/frame-kit-ui-ng-core-headline.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-icon.mjs +189 -0
- package/fesm2022/frame-kit-ui-ng-core-icon.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-image.mjs +123 -0
- package/fesm2022/frame-kit-ui-ng-core-image.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-link.mjs +369 -0
- package/fesm2022/frame-kit-ui-ng-core-link.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-separator.mjs +59 -0
- package/fesm2022/frame-kit-ui-ng-core-separator.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-text.mjs +204 -0
- package/fesm2022/frame-kit-ui-ng-core-text.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-directives-infinite-scroll.mjs +74 -0
- package/fesm2022/frame-kit-ui-ng-directives-infinite-scroll.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-directives-spotlight.mjs +76 -0
- package/fesm2022/frame-kit-ui-ng-directives-spotlight.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-directives-tooltip.mjs +425 -0
- package/fesm2022/frame-kit-ui-ng-directives-tooltip.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs +63 -0
- package/fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-docs-method-badge.mjs +43 -0
- package/fesm2022/frame-kit-ui-ng-docs-method-badge.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-forms.mjs +3632 -0
- package/fesm2022/frame-kit-ui-ng-forms.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-layouts-app-shell.mjs +239 -0
- package/fesm2022/frame-kit-ui-ng-layouts-app-shell.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-layouts-content-split.mjs +132 -0
- package/fesm2022/frame-kit-ui-ng-layouts-content-split.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-services-overlay-orchestrator.mjs +133 -0
- package/fesm2022/frame-kit-ui-ng-services-overlay-orchestrator.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-services-spotlight.mjs +60 -0
- package/fesm2022/frame-kit-ui-ng-services-spotlight.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-services-toast.mjs +166 -0
- package/fesm2022/frame-kit-ui-ng-services-toast.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-accordion.mjs +214 -0
- package/fesm2022/frame-kit-ui-ng-ui-accordion.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-alert.mjs +82 -0
- package/fesm2022/frame-kit-ui-ng-ui-alert.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-avatar-stack.mjs +76 -0
- package/fesm2022/frame-kit-ui-ng-ui-avatar-stack.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-avatar.mjs +81 -0
- package/fesm2022/frame-kit-ui-ng-ui-avatar.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-badge.mjs +81 -0
- package/fesm2022/frame-kit-ui-ng-ui-badge.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-breadcrumb.mjs +68 -0
- package/fesm2022/frame-kit-ui-ng-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-button.mjs +108 -0
- package/fesm2022/frame-kit-ui-ng-ui-button.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-callout.mjs +58 -0
- package/fesm2022/frame-kit-ui-ng-ui-callout.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-card.mjs +70 -0
- package/fesm2022/frame-kit-ui-ng-ui-card.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-copyable-field.mjs +113 -0
- package/fesm2022/frame-kit-ui-ng-ui-copyable-field.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-data-table.mjs +1288 -0
- package/fesm2022/frame-kit-ui-ng-ui-data-table.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-dialog.mjs +456 -0
- package/fesm2022/frame-kit-ui-ng-ui-dialog.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-drawer.mjs +398 -0
- package/fesm2022/frame-kit-ui-ng-ui-drawer.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-dropdown-menu.mjs +398 -0
- package/fesm2022/frame-kit-ui-ng-ui-dropdown-menu.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-editable-field.mjs +125 -0
- package/fesm2022/frame-kit-ui-ng-ui-editable-field.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-icon-badge.mjs +113 -0
- package/fesm2022/frame-kit-ui-ng-ui-icon-badge.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-icon-list.mjs +111 -0
- package/fesm2022/frame-kit-ui-ng-ui-icon-list.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-inline-edit.mjs +103 -0
- package/fesm2022/frame-kit-ui-ng-ui-inline-edit.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-list-editor.mjs +135 -0
- package/fesm2022/frame-kit-ui-ng-ui-list-editor.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-loader.mjs +81 -0
- package/fesm2022/frame-kit-ui-ng-ui-loader.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-menu-item.mjs +79 -0
- package/fesm2022/frame-kit-ui-ng-ui-menu-item.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-brand.mjs +40 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-brand.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-group.mjs +110 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-group.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-separator.mjs +91 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-separator.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-node-tree-breadcrumb.mjs +86 -0
- package/fesm2022/frame-kit-ui-ng-ui-node-tree-breadcrumb.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-node-tree.mjs +443 -0
- package/fesm2022/frame-kit-ui-ng-ui-node-tree.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-note.mjs +56 -0
- package/fesm2022/frame-kit-ui-ng-ui-note.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-numbered-list.mjs +105 -0
- package/fesm2022/frame-kit-ui-ng-ui-numbered-list.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-pagination.mjs +110 -0
- package/fesm2022/frame-kit-ui-ng-ui-pagination.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-progress-bar.mjs +129 -0
- package/fesm2022/frame-kit-ui-ng-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-sidenav-link.mjs +42 -0
- package/fesm2022/frame-kit-ui-ng-ui-sidenav-link.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-tabs.mjs +894 -0
- package/fesm2022/frame-kit-ui-ng-ui-tabs.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-timeline.mjs +81 -0
- package/fesm2022/frame-kit-ui-ng-ui-timeline.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-toast.mjs +179 -0
- package/fesm2022/frame-kit-ui-ng-ui-toast.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-user-menu.mjs +143 -0
- package/fesm2022/frame-kit-ui-ng-ui-user-menu.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-wizard-dialog.mjs +191 -0
- package/fesm2022/frame-kit-ui-ng-ui-wizard-dialog.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng.mjs +58 -0
- package/fesm2022/frame-kit-ui-ng.mjs.map +1 -0
- package/layouts/app-shell/README.md +357 -0
- package/layouts/content-split/README.md +180 -0
- package/package.json +253 -0
- package/services/overlay-orchestrator/README.md +184 -0
- package/services/spotlight/README.md +61 -0
- package/services/toast/README.md +118 -0
- package/types/frame-kit-ui-ng-core-headline.d.ts +38 -0
- package/types/frame-kit-ui-ng-core-icon.d.ts +74 -0
- package/types/frame-kit-ui-ng-core-image.d.ts +93 -0
- package/types/frame-kit-ui-ng-core-link.d.ts +251 -0
- package/types/frame-kit-ui-ng-core-separator.d.ts +28 -0
- package/types/frame-kit-ui-ng-core-text.d.ts +186 -0
- package/types/frame-kit-ui-ng-directives-infinite-scroll.d.ts +42 -0
- package/types/frame-kit-ui-ng-directives-spotlight.d.ts +51 -0
- package/types/frame-kit-ui-ng-directives-tooltip.d.ts +70 -0
- package/types/frame-kit-ui-ng-docs-endpoint-link.d.ts +43 -0
- package/types/frame-kit-ui-ng-docs-method-badge.d.ts +30 -0
- package/types/frame-kit-ui-ng-forms.d.ts +1674 -0
- package/types/frame-kit-ui-ng-layouts-app-shell.d.ts +75 -0
- package/types/frame-kit-ui-ng-layouts-content-split.d.ts +43 -0
- package/types/frame-kit-ui-ng-services-overlay-orchestrator.d.ts +96 -0
- package/types/frame-kit-ui-ng-services-spotlight.d.ts +32 -0
- package/types/frame-kit-ui-ng-services-toast.d.ts +100 -0
- package/types/frame-kit-ui-ng-ui-accordion.d.ts +86 -0
- package/types/frame-kit-ui-ng-ui-alert.d.ts +34 -0
- package/types/frame-kit-ui-ng-ui-avatar-stack.d.ts +38 -0
- package/types/frame-kit-ui-ng-ui-avatar.d.ts +36 -0
- package/types/frame-kit-ui-ng-ui-badge.d.ts +33 -0
- package/types/frame-kit-ui-ng-ui-breadcrumb.d.ts +45 -0
- package/types/frame-kit-ui-ng-ui-button.d.ts +48 -0
- package/types/frame-kit-ui-ng-ui-callout.d.ts +26 -0
- package/types/frame-kit-ui-ng-ui-card.d.ts +30 -0
- package/types/frame-kit-ui-ng-ui-copyable-field.d.ts +62 -0
- package/types/frame-kit-ui-ng-ui-data-table.d.ts +482 -0
- package/types/frame-kit-ui-ng-ui-dialog.d.ts +166 -0
- package/types/frame-kit-ui-ng-ui-drawer.d.ts +130 -0
- package/types/frame-kit-ui-ng-ui-dropdown-menu.d.ts +77 -0
- package/types/frame-kit-ui-ng-ui-editable-field.d.ts +65 -0
- package/types/frame-kit-ui-ng-ui-icon-badge.d.ts +45 -0
- package/types/frame-kit-ui-ng-ui-icon-list.d.ts +67 -0
- package/types/frame-kit-ui-ng-ui-inline-edit.d.ts +44 -0
- package/types/frame-kit-ui-ng-ui-list-editor.d.ts +56 -0
- package/types/frame-kit-ui-ng-ui-loader.d.ts +32 -0
- package/types/frame-kit-ui-ng-ui-menu-item.d.ts +27 -0
- package/types/frame-kit-ui-ng-ui-nav-brand.d.ts +25 -0
- package/types/frame-kit-ui-ng-ui-nav-group.d.ts +60 -0
- package/types/frame-kit-ui-ng-ui-nav-separator.d.ts +33 -0
- package/types/frame-kit-ui-ng-ui-node-tree-breadcrumb.d.ts +35 -0
- package/types/frame-kit-ui-ng-ui-node-tree.d.ts +135 -0
- package/types/frame-kit-ui-ng-ui-note.d.ts +22 -0
- package/types/frame-kit-ui-ng-ui-numbered-list.d.ts +52 -0
- package/types/frame-kit-ui-ng-ui-pagination.d.ts +49 -0
- package/types/frame-kit-ui-ng-ui-progress-bar.d.ts +50 -0
- package/types/frame-kit-ui-ng-ui-sidenav-link.d.ts +24 -0
- package/types/frame-kit-ui-ng-ui-tabs.d.ts +266 -0
- package/types/frame-kit-ui-ng-ui-timeline.d.ts +42 -0
- package/types/frame-kit-ui-ng-ui-toast.d.ts +56 -0
- package/types/frame-kit-ui-ng-ui-user-menu.d.ts +87 -0
- package/types/frame-kit-ui-ng-ui-wizard-dialog.d.ts +116 -0
- package/types/frame-kit-ui-ng.d.ts +53 -0
- package/ui/accordion/README.md +261 -0
- package/ui/alert/README.md +211 -0
- package/ui/avatar/README.md +167 -0
- package/ui/avatar-stack/README.md +164 -0
- package/ui/badge/README.md +162 -0
- package/ui/breadcrumb/README.md +240 -0
- package/ui/button/README.md +184 -0
- package/ui/callout/README.md +159 -0
- package/ui/card/README.md +174 -0
- package/ui/copyable-field/README.md +235 -0
- package/ui/data-table/README.md +408 -0
- package/ui/dialog/README.md +222 -0
- package/ui/drawer/README.md +274 -0
- package/ui/dropdown-menu/README.md +336 -0
- package/ui/editable-field/README.md +171 -0
- package/ui/icon-badge/README.md +131 -0
- package/ui/icon-list/README.md +205 -0
- package/ui/inline-edit/README.md +135 -0
- package/ui/list-editor/README.md +162 -0
- package/ui/loader/README.md +160 -0
- package/ui/menu-item/README.md +204 -0
- package/ui/nav-brand/README.md +111 -0
- package/ui/nav-group/README.md +145 -0
- package/ui/nav-separator/README.md +44 -0
- package/ui/node-tree/README.md +278 -0
- package/ui/node-tree-breadcrumb/README.md +164 -0
- package/ui/note/README.md +146 -0
- package/ui/numbered-list/README.md +187 -0
- package/ui/pagination/README.md +174 -0
- package/ui/progress-bar/README.md +223 -0
- package/ui/sidenav-link/README.md +214 -0
- package/ui/tabs/README.md +204 -0
- package/ui/timeline/README.md +285 -0
- package/ui/toast/README.md +243 -0
- package/ui/user-menu/README.md +260 -0
- package/ui/wizard-dialog/README.md +283 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
# fk-text
|
|
2
|
+
|
|
3
|
+
A flexible typography component that renders semantic text elements with design-token-driven variants, tones, alignment, truncation, and accessibility options.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## API
|
|
8
|
+
|
|
9
|
+
### Inputs
|
|
10
|
+
|
|
11
|
+
| Input | Type | Default | Description |
|
|
12
|
+
| ----------------- | --------------------------------------------------------------- | ----------- | ------------------------------------------------------ |
|
|
13
|
+
| `as` | `'p' \| 'span' \| 'div' \| 'label' \| 'small'` | `'p'` | Underlying HTML element to render |
|
|
14
|
+
| `variant` | `'body' \| 'lead' \| 'small' \| 'caption' \| 'label' \| 'code'` | `'body'` | Typography variant (type scale) |
|
|
15
|
+
| `tone` | `'default' \| 'muted' \| 'subtle' \| 'danger' \| 'success'` | `'default'` | Color tone |
|
|
16
|
+
| `align` | `'inherit' \| 'start' \| 'center' \| 'end' \| 'justify'` | `'inherit'` | Text alignment |
|
|
17
|
+
| `weight` | `'normal' \| 'medium' \| 'semibold' \| 'bold' \| null` | `null` | Font weight override (uses variant default when null) |
|
|
18
|
+
| `truncate` | `boolean` | `false` | Single-line truncation with ellipsis |
|
|
19
|
+
| `maxLines` | `number \| null` | `null` | Multi-line clamp count; adds ellipsis after N lines |
|
|
20
|
+
| `gutterBottom` | `boolean` | `false` | Adds bottom margin |
|
|
21
|
+
| `italic` | `boolean` | `false` | Italic style |
|
|
22
|
+
| `visuallyHidden` | `boolean` | `false` | Visually hide text while keeping it for screen readers |
|
|
23
|
+
| `className` | `string` | `''` | Additional CSS classes |
|
|
24
|
+
| `id` | `string \| null` | `null` | ID attribute |
|
|
25
|
+
| `ariaLabel` | `string \| null` | `null` | ARIA label |
|
|
26
|
+
| `ariaDescribedBy` | `string \| null` | `null` | ARIA described-by |
|
|
27
|
+
| `role` | `string \| null` | `null` | ARIA role (usually not needed) |
|
|
28
|
+
| `htmlFor` | `string \| null` | `null` | `for` attribute when `as="label"` |
|
|
29
|
+
|
|
30
|
+
### Outputs
|
|
31
|
+
|
|
32
|
+
`fk-text` is presentational and does not emit outputs.
|
|
33
|
+
|
|
34
|
+
### Content
|
|
35
|
+
|
|
36
|
+
Content is provided via projection:
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<fk-text variant="body" tone="muted">Last updated 2 hours ago</fk-text>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- Unified API for semantic text elements (`p`, `span`, `div`, `label`, `small`)
|
|
47
|
+
- Variant-driven typography scale
|
|
48
|
+
- Tone and weight controls
|
|
49
|
+
- Single-line and multi-line truncation
|
|
50
|
+
- Alignment, gutter, italic, and screen-reader-only options
|
|
51
|
+
- Token-driven styling
|
|
52
|
+
- Self-sufficient rendering without any theme file loaded
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Quick Start
|
|
57
|
+
|
|
58
|
+
```html
|
|
59
|
+
<fk-text>This is body text.</fk-text>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Import
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import { TextComponent } from '@frame-kit/ui-ng';
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
@Component({
|
|
72
|
+
selector: 'app-example',
|
|
73
|
+
imports: [TextComponent],
|
|
74
|
+
templateUrl: './example.component.html',
|
|
75
|
+
})
|
|
76
|
+
export class ExampleComponent {}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Selector
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<fk-text></fk-text>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Examples
|
|
90
|
+
|
|
91
|
+
### Variants
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<fk-text variant="body">Body text</fk-text>
|
|
95
|
+
<fk-text variant="lead">Lead text</fk-text>
|
|
96
|
+
<fk-text variant="small">Small text</fk-text>
|
|
97
|
+
<fk-text variant="caption">Caption text</fk-text>
|
|
98
|
+
<fk-text variant="label">Label text</fk-text>
|
|
99
|
+
<fk-text variant="code">Code text</fk-text>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Tones
|
|
103
|
+
|
|
104
|
+
```html
|
|
105
|
+
<fk-text tone="default">Default tone</fk-text>
|
|
106
|
+
<fk-text tone="muted">Muted tone</fk-text>
|
|
107
|
+
<fk-text tone="subtle">Subtle tone</fk-text>
|
|
108
|
+
<fk-text tone="danger">Danger tone</fk-text>
|
|
109
|
+
<fk-text tone="success">Success tone</fk-text>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Weight override
|
|
113
|
+
|
|
114
|
+
```html
|
|
115
|
+
<fk-text weight="bold">Bold body text</fk-text>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Truncated single-line
|
|
119
|
+
|
|
120
|
+
```html
|
|
121
|
+
<fk-text [truncate]="true">This is a very long piece of text that will be truncated with an ellipsis when it overflows the container.</fk-text>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Multi-line clamp
|
|
125
|
+
|
|
126
|
+
```html
|
|
127
|
+
<fk-text [maxLines]="3">Long description that will be clamped to three lines with ellipsis.</fk-text>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Label usage
|
|
131
|
+
|
|
132
|
+
```html
|
|
133
|
+
<fk-text as="label" variant="label" htmlFor="email-input">Email address</fk-text> <input id="email-input" type="email" />
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Inline span
|
|
137
|
+
|
|
138
|
+
```html
|
|
139
|
+
<fk-text as="span" variant="small" tone="muted">Inline text</fk-text>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Accessibility
|
|
145
|
+
|
|
146
|
+
- `visuallyHidden` adds a screen-reader-only class, preserving content for assistive technologies.
|
|
147
|
+
- When used as `"label"`, `htmlFor` should be set to the corresponding input's ID.
|
|
148
|
+
- `ariaLabel`, `ariaDescribedBy`, and `role` are available for advanced scenarios; in most cases, semantic HTML and visible text are sufficient.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Design Tokens
|
|
153
|
+
|
|
154
|
+
`fk-text` is styled entirely through design tokens.
|
|
155
|
+
|
|
156
|
+
### Component tokens
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
--fk-text-margin-block-start
|
|
160
|
+
--fk-text-margin-block-end
|
|
161
|
+
--fk-text-color-default
|
|
162
|
+
--fk-text-color-muted
|
|
163
|
+
--fk-text-color-subtle
|
|
164
|
+
--fk-text-color-danger
|
|
165
|
+
--fk-text-color-success
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Typography scale tokens (per variant)
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
--fk-typography-body-font-size
|
|
172
|
+
--fk-typography-body-font-weight
|
|
173
|
+
--fk-typography-body-line-height
|
|
174
|
+
--fk-typography-body-letter-spacing
|
|
175
|
+
|
|
176
|
+
--fk-typography-lead-font-size
|
|
177
|
+
--fk-typography-lead-font-weight
|
|
178
|
+
--fk-typography-lead-line-height
|
|
179
|
+
--fk-typography-lead-letter-spacing
|
|
180
|
+
|
|
181
|
+
--fk-typography-small-font-size
|
|
182
|
+
--fk-typography-small-font-weight
|
|
183
|
+
--fk-typography-small-line-height
|
|
184
|
+
--fk-typography-small-letter-spacing
|
|
185
|
+
|
|
186
|
+
--fk-typography-caption-font-size
|
|
187
|
+
--fk-typography-caption-font-weight
|
|
188
|
+
--fk-typography-caption-line-height
|
|
189
|
+
--fk-typography-caption-letter-spacing
|
|
190
|
+
|
|
191
|
+
--fk-typography-label-font-size
|
|
192
|
+
--fk-typography-label-font-weight
|
|
193
|
+
--fk-typography-label-line-height
|
|
194
|
+
--fk-typography-label-letter-spacing
|
|
195
|
+
|
|
196
|
+
--fk-typography-code-font-family
|
|
197
|
+
--fk-typography-code-font-size
|
|
198
|
+
--fk-typography-code-font-weight
|
|
199
|
+
--fk-typography-code-line-height
|
|
200
|
+
--fk-typography-code-letter-spacing
|
|
201
|
+
|
|
202
|
+
--fk-typography-gutter-bottom
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Font weight tokens
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
--fk-font-weight-normal
|
|
209
|
+
--fk-font-weight-medium
|
|
210
|
+
--fk-font-weight-semibold
|
|
211
|
+
--fk-font-weight-bold
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Customizing Tokens
|
|
215
|
+
|
|
216
|
+
Override tokens in your application's global stylesheet or a scoped selector:
|
|
217
|
+
|
|
218
|
+
```scss
|
|
219
|
+
:root {
|
|
220
|
+
--fk-text-color-default: #111827;
|
|
221
|
+
--fk-typography-body-font-size: 1rem;
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Or scope overrides to a specific context:
|
|
226
|
+
|
|
227
|
+
```scss
|
|
228
|
+
.dark-theme fk-text {
|
|
229
|
+
--fk-text-color-default: #e2e8f0;
|
|
230
|
+
--fk-text-color-muted: #94a3b8;
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Behavior Notes
|
|
237
|
+
|
|
238
|
+
- When both `truncate` and `maxLines` are set, `maxLines` takes precedence for multi-line clamping.
|
|
239
|
+
- Use semantic `as` values (`p`, `label`, etc.) appropriate for the content's role in the document.
|
|
240
|
+
- `weight` overrides the variant's default font weight. When `null`, the variant's own weight applies.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# fkInfiniteScroll
|
|
2
|
+
|
|
3
|
+
A sentinel-based infinite-scroll directive. Apply it to a small marker element at the bottom of a scrollable list — when that element enters the viewport the directive emits `(scrolled)`, which the parent uses to load the next page.
|
|
4
|
+
|
|
5
|
+
Implemented with `IntersectionObserver` instead of scroll-event listening, so there's no debounce or throttle to tune and no work runs on every scroll frame.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## API
|
|
10
|
+
|
|
11
|
+
### Inputs
|
|
12
|
+
|
|
13
|
+
| Input | Type | Default | Description |
|
|
14
|
+
| ------------ | -------- | ------- | ------------------------------------------------------------------------------------------------------ |
|
|
15
|
+
| `threshold` | `number` | `0.1` | Visibility ratio (0–1) at which the sentinel is considered intersecting. Default fires at 10% visible. |
|
|
16
|
+
| `rootMargin` | `string` | `"0px"` | CSS-margin syntax that expands or shrinks the detection area (e.g. `"200px 0px"` to pre-fetch early). |
|
|
17
|
+
|
|
18
|
+
### Outputs
|
|
19
|
+
|
|
20
|
+
| Output | Type | Description |
|
|
21
|
+
| ---------- | ------ | ----------------------------------------------------- |
|
|
22
|
+
| `scrolled` | `void` | Fires every time the sentinel re-enters the viewport. |
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
- Zero scroll-event work — `IntersectionObserver` runs off the main thread.
|
|
29
|
+
- SSR-safe: setup is gated on `isPlatformBrowser`, so server render does nothing and the browser pass wires up after hydration.
|
|
30
|
+
- Pre-fetch via `rootMargin` to load the next page before the user reaches the bottom.
|
|
31
|
+
- Tear-down via `ngOnDestroy` disconnects the observer — safe to mount/unmount inside `@if`.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
@for (item of items(); track item.id) {
|
|
39
|
+
<div>{{ item.name }}</div>
|
|
40
|
+
} @if (hasMore()) {
|
|
41
|
+
<div fkInfiniteScroll (scrolled)="loadNextPage()">
|
|
42
|
+
@if (loading()) {
|
|
43
|
+
<fk-loader />
|
|
44
|
+
}
|
|
45
|
+
</div>
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
To stop firing, remove the sentinel from the DOM (set `hasMore()` to `false`).
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Import
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { FkInfiniteScrollDirective } from '@frame-kit/ui-ng';
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
@Component({
|
|
61
|
+
selector: 'app-example',
|
|
62
|
+
imports: [FkInfiniteScrollDirective],
|
|
63
|
+
templateUrl: './example.component.html',
|
|
64
|
+
})
|
|
65
|
+
export class ExampleComponent {}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Examples
|
|
71
|
+
|
|
72
|
+
### Pre-fetch before the user hits the bottom
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<div fkInfiniteScroll rootMargin="400px 0px" (scrolled)="loadNextPage()"></div>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
A 400px bottom margin fires `scrolled` while the sentinel is still 400px below the viewport — enough headroom for the next page to land before the user notices.
|
|
79
|
+
|
|
80
|
+
### Higher visibility threshold
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<div fkInfiniteScroll [threshold]="0.5" (scrolled)="loadNextPage()"></div>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Fire only when the sentinel is at least 50% in view.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Accessibility
|
|
91
|
+
|
|
92
|
+
The sentinel itself is non-interactive — it doesn't take focus, doesn't announce, and doesn't appear in the tab order. Place it inside the same scrollable container as the list so screen-reader users encountering the loader see it in the natural reading order.
|
|
93
|
+
|
|
94
|
+
If the loader inside the sentinel is animated, respect `prefers-reduced-motion` in your loader component (the shared `fk-loader` already does).
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Behavior Notes
|
|
99
|
+
|
|
100
|
+
- The directive sets up the observer in `ngAfterViewInit` and tears it down in `ngOnDestroy`. Re-mounting via `@if` resets the observer — there's no internal state to reset.
|
|
101
|
+
- `scrolled` fires every time the sentinel re-enters the viewport, so the parent must guard against double-firing while a page is loading (typical pattern: track a `loading` signal and short-circuit `loadNextPage()` while it's `true`).
|
|
102
|
+
- On SSR the directive does nothing — the observer only exists in the browser.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# fkSpotlightTrigger / fkSpotlightTarget
|
|
2
|
+
|
|
3
|
+
A pair of directives that coordinate a "spotlight" pulse across unrelated parts of the DOM. Apply `fkSpotlightTrigger="<key>"` to a hover/focus zone (e.g. an open-the-help-panel button); apply `fkSpotlightTarget="<key>"` to one or more elements that should pulse while the trigger is hovered/focused. Triggers and targets bound to the same key activate together.
|
|
4
|
+
|
|
5
|
+
The directives talk through `SpotlightService`, which is reference-counted — a hover-driven trigger and a programmatic activation can hold the same key at the same time without one cancelling the other.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## API
|
|
10
|
+
|
|
11
|
+
### `fkSpotlightTrigger`
|
|
12
|
+
|
|
13
|
+
#### Inputs
|
|
14
|
+
|
|
15
|
+
| Input | Type | Default | Description |
|
|
16
|
+
| -------------------- | -------- | -------- | ------------------------------------------------------------------------------------- |
|
|
17
|
+
| `fkSpotlightTrigger` | `string` | required | Key broadcast on enter (mouseenter/focusin); released on leave (mouseleave/focusout). |
|
|
18
|
+
|
|
19
|
+
#### Outputs
|
|
20
|
+
|
|
21
|
+
None.
|
|
22
|
+
|
|
23
|
+
### `fkSpotlightTarget`
|
|
24
|
+
|
|
25
|
+
#### Inputs
|
|
26
|
+
|
|
27
|
+
| Input | Type | Default | Description |
|
|
28
|
+
| ------------------- | -------------------- | --------- | -------------------------------------------------------------------------------------------- |
|
|
29
|
+
| `fkSpotlightTarget` | `string` | required | Key the target listens for. Multiple targets may share a key. |
|
|
30
|
+
| `treatment` | `SpotlightTreatment` | `"pulse"` | Visual treatment while active. `"pulse"` = animated ring, `"overlay"` = static tinted layer. |
|
|
31
|
+
|
|
32
|
+
#### Outputs
|
|
33
|
+
|
|
34
|
+
None.
|
|
35
|
+
|
|
36
|
+
#### Types
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
type SpotlightTreatment = 'pulse' | 'overlay';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- Decoupled trigger ↔ target communication via `SpotlightService` — no `@Input`/`@Output` plumbing between unrelated components.
|
|
47
|
+
- Reference-counted holders: a hover trigger and a programmatic one-shot can coexist; the key clears when the last holder releases.
|
|
48
|
+
- Two visual treatments: `pulse` for compact action-anchored targets (buttons, list rows) and `overlay` for wide surfaces (panels, columns) where the pulse animation would feel busy.
|
|
49
|
+
- Single global active key — last activation wins, which matches the "find this thing" onboarding use case (mutually exclusive cues).
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Quick Start
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<button [fkSpotlightTrigger]="'open-roadmap'">Open setup roadmap</button>
|
|
57
|
+
|
|
58
|
+
<lib-button [fkSpotlightTarget]="'open-roadmap'">Setup</lib-button>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Hovering or focusing the trigger pulses every target sharing the same key.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Import
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
import { SpotlightTriggerDirective, SpotlightTargetDirective, type SpotlightTreatment } from '@frame-kit/ui-ng';
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
@Component({
|
|
73
|
+
selector: 'app-example',
|
|
74
|
+
imports: [SpotlightTriggerDirective, SpotlightTargetDirective],
|
|
75
|
+
templateUrl: './example.component.html',
|
|
76
|
+
})
|
|
77
|
+
export class ExampleComponent {}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Examples
|
|
83
|
+
|
|
84
|
+
### Multiple targets per key
|
|
85
|
+
|
|
86
|
+
```html
|
|
87
|
+
<button [fkSpotlightTrigger]="'invite-flow'">Invite an admin</button>
|
|
88
|
+
|
|
89
|
+
<a [fkSpotlightTarget]="'invite-flow'" routerLink="/users">Users</a>
|
|
90
|
+
<button [fkSpotlightTarget]="'invite-flow'">+ Invite</button>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Both list-nav links and the invite button pulse together while the trigger is hovered, walking the user through a multi-step path.
|
|
94
|
+
|
|
95
|
+
### Overlay treatment for wide surfaces
|
|
96
|
+
|
|
97
|
+
```html
|
|
98
|
+
<button [fkSpotlightTrigger]="'permissions-column'">Where do permissions appear?</button>
|
|
99
|
+
|
|
100
|
+
<div class="dashboard-column" [fkSpotlightTarget]="'permissions-column'" treatment="overlay">...</div>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`treatment="overlay"` swaps the pulse ring for a static tinted overlay — much less busy on a column-wide surface.
|
|
104
|
+
|
|
105
|
+
### Programmatic activation
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
constructor(private readonly spotlight: SpotlightService) {}
|
|
109
|
+
|
|
110
|
+
ngAfterViewInit(): void {
|
|
111
|
+
// Auto-spotlight the setup roadmap on first open
|
|
112
|
+
this.spotlight.activate("open-roadmap");
|
|
113
|
+
setTimeout(() => this.spotlight.deactivate("open-roadmap"), 2000);
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
A programmatic holder coexists with hover-driven triggers — the spotlight only clears once every holder releases.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Accessibility
|
|
122
|
+
|
|
123
|
+
- Triggers listen on both pointer and keyboard (`mouseenter`/`mouseleave` and `focusin`/`focusout`), so keyboard-only users get the same cue as pointer users.
|
|
124
|
+
- Targets are non-focusable by default; the spotlight is a visual hint, not an interactive surface. The element underneath the target keeps its own keyboard semantics.
|
|
125
|
+
- The `pulse` animation respects `prefers-reduced-motion` via the SCSS in `fk-spotlight-target` (no JavaScript-driven animation to gate).
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Design Tokens
|
|
130
|
+
|
|
131
|
+
The treatments draw their colors and timing from these tokens:
|
|
132
|
+
|
|
133
|
+
```scss
|
|
134
|
+
--fk-spotlight-pulse-color
|
|
135
|
+
--fk-spotlight-pulse-duration
|
|
136
|
+
--fk-spotlight-overlay-color
|
|
137
|
+
--fk-spotlight-overlay-fade-duration
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Override in your app stylesheet:
|
|
141
|
+
|
|
142
|
+
```scss
|
|
143
|
+
:root {
|
|
144
|
+
--fk-spotlight-pulse-color: var(--fk-color-primary);
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Behavior Notes
|
|
151
|
+
|
|
152
|
+
- The active key is single-valued: activating a different key while one is held replaces the active key (last write wins). The previous key's holders still count, so re-activating it later restores the spotlight.
|
|
153
|
+
- `SpotlightService` is provided in root — there's a single coordinator across the whole app. Targets in any feature module pick up triggers in any other feature module, as long as the keys match.
|
|
154
|
+
- The visual `.fk-spotlight-target--active` and `.fk-spotlight-target--overlay` classes are the directive's contract with the SCSS — overriding the tokens is the supported customization path; redefining the classes is not.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# fkTooltip
|
|
2
|
+
|
|
3
|
+
A token-driven tooltip directive for Angular. Applied as an attribute on any element to display informational text on hover, focus, or touch.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## API
|
|
8
|
+
|
|
9
|
+
### Inputs
|
|
10
|
+
|
|
11
|
+
| Input | Type | Default | Description |
|
|
12
|
+
| -------------------- | ----------------- | -------- | -------------------------------------- |
|
|
13
|
+
| `fkTooltip` | `string` | required | Tooltip text content |
|
|
14
|
+
| `fkTooltipPosition` | `TooltipPosition` | `'top'` | Preferred placement |
|
|
15
|
+
| `fkTooltipOffset` | `number` | `8` | Gap (px) between anchor and tooltip |
|
|
16
|
+
| `fkTooltipShowDelay` | `number` | `200` | Delay (ms) before showing |
|
|
17
|
+
| `fkTooltipHideDelay` | `number` | `0` | Delay (ms) before hiding |
|
|
18
|
+
| `fkTooltipDisabled` | `boolean` | `false` | Suppresses tooltip |
|
|
19
|
+
| `fkTooltipClassName` | `string` | `''` | Extra CSS class on the tooltip element |
|
|
20
|
+
|
|
21
|
+
### Types
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
type TooltipPosition = 'top' | 'right' | 'bottom' | 'left';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- Attribute directive — works on any element
|
|
32
|
+
- Automatic flip when near viewport edge
|
|
33
|
+
- Shift along cross-axis to stay in viewport
|
|
34
|
+
- Arrow indicator pointing at anchor
|
|
35
|
+
- Show on hover and focus, hide on blur and Escape
|
|
36
|
+
- Touch support with auto-hide
|
|
37
|
+
- Configurable show/hide delays
|
|
38
|
+
- Token-driven styling with two-tier fallbacks
|
|
39
|
+
- `prefers-reduced-motion` disables animations
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Quick Start
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<button fkTooltip="Save changes">Save</button>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Import
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { TooltipDirective } from '@frame-kit/ui-ng';
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
@Component({
|
|
59
|
+
imports: [TooltipDirective],
|
|
60
|
+
})
|
|
61
|
+
export class ExampleComponent {}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Selector
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<any-element fkTooltip="text" />
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Examples
|
|
73
|
+
|
|
74
|
+
### On a Button
|
|
75
|
+
|
|
76
|
+
```html
|
|
77
|
+
<button fkTooltip="Save your changes" fkTooltipPosition="bottom">Save</button>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### On an Icon
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<fk-icon name="info" fkTooltip="This field is required" />
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### With Custom Delay
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<button fkTooltip="Slow tooltip" [fkTooltipShowDelay]="500">Hover me</button>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Disabled
|
|
93
|
+
|
|
94
|
+
```html
|
|
95
|
+
<button fkTooltip="Hidden tooltip" [fkTooltipDisabled]="true">No tooltip</button>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Accessibility
|
|
101
|
+
|
|
102
|
+
- Tooltip element has `role="tooltip"` and a unique `id`
|
|
103
|
+
- `aria-describedby` set on host when tooltip is visible, removed when hidden
|
|
104
|
+
- Shows on `focusin`, hides on `focusout`
|
|
105
|
+
- Hides on `Escape` key
|
|
106
|
+
- Touch: shows on `touchstart`, auto-hides after 1500ms
|
|
107
|
+
- `prefers-reduced-motion: reduce` disables all animations
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Design Tokens
|
|
112
|
+
|
|
113
|
+
`fkTooltip` is styled entirely through design tokens.
|
|
114
|
+
|
|
115
|
+
### Token Reference
|
|
116
|
+
|
|
117
|
+
| Token | Default | Description |
|
|
118
|
+
| ---------------------------- | -------------------------------- | -------------------- |
|
|
119
|
+
| `--fk-tooltip-bg` | `var(--fk-color-text)` | Background color |
|
|
120
|
+
| `--fk-tooltip-color` | `var(--fk-color-surface)` | Text color |
|
|
121
|
+
| `--fk-tooltip-font-size` | `var(--fk-typography-caption-…)` | Font size |
|
|
122
|
+
| `--fk-tooltip-font-weight` | `var(--fk-font-weight-medium)` | Font weight |
|
|
123
|
+
| `--fk-tooltip-padding` | `0.25rem 0.5rem` | Inner padding |
|
|
124
|
+
| `--fk-tooltip-border-radius` | `var(--fk-radius-sm)` | Corner radius |
|
|
125
|
+
| `--fk-tooltip-shadow` | `0 2px 8px rgba(0,0,0,0.15)` | Box shadow |
|
|
126
|
+
| `--fk-tooltip-max-width` | `20rem` | Maximum width |
|
|
127
|
+
| `--fk-tooltip-arrow-size` | `6px` | Arrow indicator size |
|
|
128
|
+
| `--fk-tooltip-z-index` | `1100` | Stacking order |
|
|
129
|
+
|
|
130
|
+
### Customizing Tokens
|
|
131
|
+
|
|
132
|
+
```css
|
|
133
|
+
:root {
|
|
134
|
+
--fk-tooltip-bg: #1e293b;
|
|
135
|
+
--fk-tooltip-border-radius: 0.5rem;
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Behavior Notes
|
|
142
|
+
|
|
143
|
+
- Tooltip is appended to `document.body` to escape `overflow: hidden` ancestors
|
|
144
|
+
- Uses `position: fixed` with `getBoundingClientRect()` for positioning
|
|
145
|
+
- Flips to opposite side when insufficient space, then shifts along cross-axis
|
|
146
|
+
- Arrow offset adjusts dynamically to always point at the anchor center
|
|
147
|
+
- Repositions on scroll and resize while visible
|