@tcn/ui 0.18.0 → 0.18.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/AI_USAGE.md +59 -0
- package/CHANGELOG.md +1009 -0
- package/ai-docs/actions.md +43 -0
- package/ai-docs/decorators.md +34 -0
- package/ai-docs/feedback.md +31 -0
- package/ai-docs/form.md +58 -0
- package/ai-docs/inputs.md +71 -0
- package/ai-docs/layouts.md +76 -0
- package/ai-docs/mobile.md +34 -0
- package/ai-docs/navigation.md +48 -0
- package/ai-docs/overlay.md +58 -0
- package/ai-docs/stacks.md +59 -0
- package/ai-docs/surfaces.md +79 -0
- package/ai-docs/themes.md +47 -0
- package/ai-docs/tokens.md +35 -0
- package/ai-docs/typography.md +38 -0
- package/ai-docs/utils.md +51 -0
- package/package.json +6 -2
- package/src/overlay/popper/legacy/popper.stories.tsx +9 -2
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Tokens
|
|
2
|
+
|
|
3
|
+
> **Scaffold placeholder.** Read the source files below for full implementation details. This document will be expanded with usage patterns and examples.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Source Files
|
|
8
|
+
|
|
9
|
+
| File | Purpose |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `src/tokens/chip/chip.tsx` | Selectable chip/tag |
|
|
12
|
+
| `src/tokens/badge/badge.tsx` | Badge indicator |
|
|
13
|
+
| `src/tokens/bubble/bubble.tsx` | Bubble/pill token |
|
|
14
|
+
| `src/tokens/key/key.tsx` | Keyboard key display |
|
|
15
|
+
| `src/tokens/value/value.tsx` | Value display token |
|
|
16
|
+
| `src/tokens/term/term.tsx` | Key-value term container |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Imports
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { Chip, Badge, Bubble, Key, Value, Term } from '@tcn/ui/tokens';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Quick Reference
|
|
29
|
+
|
|
30
|
+
- `Chip` is a selectable tag (filter chips, choice chips)
|
|
31
|
+
- `Badge` is a small indicator overlay (counts, status dots)
|
|
32
|
+
- `Bubble` is a pill-shaped text container
|
|
33
|
+
- `Key` displays a keyboard key (for shortcut hints)
|
|
34
|
+
- `Value` displays a formatted value
|
|
35
|
+
- `Term` pairs a key label with a value (key-value display)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Typography
|
|
2
|
+
|
|
3
|
+
> **Scaffold placeholder.** Read the source files below for full implementation details. This document will be expanded with usage patterns and examples.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Source Files
|
|
8
|
+
|
|
9
|
+
| File | Purpose |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `src/typography/headline/headline.tsx` | Large heading text |
|
|
12
|
+
| `src/typography/title/title.tsx` | Title text |
|
|
13
|
+
| `src/typography/subheadline/subheadline.tsx` | Subheading text |
|
|
14
|
+
| `src/typography/body_text/body_text.tsx` | Body paragraph text |
|
|
15
|
+
| `src/typography/caption/caption.tsx` | Small caption text |
|
|
16
|
+
| `src/typography/callout/callout.tsx` | Highlighted callout text |
|
|
17
|
+
| `src/typography/footnote/footnote.tsx` | Footnote text |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Imports
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import {
|
|
25
|
+
Headline, Title, Subheadline,
|
|
26
|
+
BodyText, Caption, Callout, Footnote,
|
|
27
|
+
} from '@tcn/ui/typography';
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Quick Reference
|
|
33
|
+
|
|
34
|
+
- Typography components define semantic text roles, not visual sizes — themes control appearance
|
|
35
|
+
- Hierarchy (largest to smallest): Headline > Title > Subheadline > BodyText > Caption > Footnote
|
|
36
|
+
- `Callout` is for highlighted/emphasized text blocks
|
|
37
|
+
- All typography uses the polymorphic `as` prop to render as the correct HTML element
|
|
38
|
+
- Font family, size, weight, and color come from theme variables
|
package/ai-docs/utils.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Utilities
|
|
2
|
+
|
|
3
|
+
> **Scaffold placeholder.** Read the source files below for full implementation details. This document will be expanded with usage patterns and examples.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Source Files
|
|
8
|
+
|
|
9
|
+
| File | Purpose |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `src/utils/hooks/use_fork_ref.ts` | Compose multiple refs into one |
|
|
12
|
+
| `src/utils/hooks/use_resize_observer.ts` | Track element resize events |
|
|
13
|
+
| `src/utils/hooks/use_media_query.ts` | React hook for CSS media queries |
|
|
14
|
+
| `src/utils/hooks/make_context_hook.ts` | Factory for typed context hooks |
|
|
15
|
+
| `src/utils/listeners/` | Event listener utilities |
|
|
16
|
+
| `src/utils/calendar/` | Date utilities (CalendarDate, month generators) |
|
|
17
|
+
| `src/utils/types/` | Shared type definitions (Dimensions, Sides) |
|
|
18
|
+
| `src/utils/system/` | System-level utilities |
|
|
19
|
+
| `src/utils/default_value.ts` | Default value handling |
|
|
20
|
+
| `src/utils/css_utils.ts` | CSS utility functions |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Imports
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import {
|
|
28
|
+
useForkRef, useResizeObserver, useMediaQuery,
|
|
29
|
+
makeContextHook,
|
|
30
|
+
} from '@tcn/ui/utils';
|
|
31
|
+
|
|
32
|
+
// Calendar utilities
|
|
33
|
+
import {
|
|
34
|
+
CalendarDate, CalendarDatesGenerator,
|
|
35
|
+
getMonthsOfYear, getDaysOfWeek,
|
|
36
|
+
} from '@tcn/ui/utils';
|
|
37
|
+
|
|
38
|
+
// Decorators (see ai-docs/decorators.md)
|
|
39
|
+
import { Draggable, DragHandle, Resizable } from '@tcn/ui/utils';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Quick Reference
|
|
45
|
+
|
|
46
|
+
- `useForkRef` composes multiple refs — essential for `forwardRef` + internal ref
|
|
47
|
+
- `useResizeObserver` tracks element dimensions reactively
|
|
48
|
+
- `useMediaQuery` evaluates CSS media queries in React
|
|
49
|
+
- `makeContextHook` creates typed context hooks with descriptive error messages
|
|
50
|
+
- Calendar utilities power the DatePicker (not general-purpose date libraries)
|
|
51
|
+
- For decorators (Draggable, Resizable), see [decorators.md](decorators.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tcn/ui",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "TCN",
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"src",
|
|
22
22
|
"types",
|
|
23
23
|
"README.md",
|
|
24
|
+
"CHANGELOG.md",
|
|
25
|
+
"AI_USAGE.md",
|
|
26
|
+
"ai-docs",
|
|
27
|
+
"!ai-docs/*.local.md",
|
|
24
28
|
"tsconfig.json"
|
|
25
29
|
],
|
|
26
30
|
"sideEffects": [
|
|
@@ -138,7 +142,7 @@
|
|
|
138
142
|
"react-color": "^2.19.3",
|
|
139
143
|
"react-phone-number-input": "^3.4.16",
|
|
140
144
|
"@tcn/icons": "2.4.0",
|
|
141
|
-
"@tcn/state": "1.3.
|
|
145
|
+
"@tcn/state": "1.3.4"
|
|
142
146
|
},
|
|
143
147
|
"scripts": {
|
|
144
148
|
"build": "vite build",
|
|
@@ -97,8 +97,15 @@ export function Popper(props: PopoverStoryProps) {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
return (
|
|
100
|
-
<VStack
|
|
101
|
-
|
|
100
|
+
<VStack
|
|
101
|
+
height="100%"
|
|
102
|
+
width="100%"
|
|
103
|
+
minHeight="600px"
|
|
104
|
+
hAlign="center"
|
|
105
|
+
vAlign="center"
|
|
106
|
+
style={{ display: 'flex', alignItems: 'flex-end' }}
|
|
107
|
+
>
|
|
108
|
+
<button onClick={open}>Open me</button>
|
|
102
109
|
<PopperComponent
|
|
103
110
|
anchorElement={anchorElement}
|
|
104
111
|
open={isOpen}
|