@santi020k/lumen-react 0.4.0 → 1.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.
- package/README.md +77 -7
- package/dist/components.d.ts +474 -64
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +810 -164
- package/dist/hooks.d.ts +17 -4
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +490 -139
- package/package.json +14 -6
package/README.md
CHANGED
|
@@ -37,8 +37,31 @@ export function SubscribeForm() {
|
|
|
37
37
|
}
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
## Forms
|
|
41
|
+
|
|
42
|
+
`Form`, `Field`, `Label`, `FieldError`, and `ErrorSummary` provide the presentation and
|
|
43
|
+
accessibility contract without replacing form state. Native-backed controls forward refs to their
|
|
44
|
+
submitted DOM controls and work directly with React Hook Form's `register()`.
|
|
45
|
+
|
|
46
|
+
For controlled composites, install the optional adapter:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pnpm add @santi020k/lumen-react-hook-form react-hook-form
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
It exports adapters for `Select`, `DatePicker`, `InputOTP`, and `ListBox`. React Hook Form owns
|
|
53
|
+
validation, dirty/touched state, and submission state in this mode; do not also mount
|
|
54
|
+
`useFormValidation` unless two validation sources are intentional.
|
|
55
|
+
|
|
56
|
+
Zod and Yup schemas work through the official `@hookform/resolvers` package. Schema libraries stay
|
|
57
|
+
optional application dependencies; Lumen consumes the resulting React Hook Form field errors
|
|
58
|
+
without wrapping or changing the resolver contract.
|
|
59
|
+
|
|
60
|
+
See the [forms guide](https://lumen.santi020k.com/docs/forms/react-hook-form) for typed examples.
|
|
61
|
+
|
|
62
|
+
For long articles, `Anchor` accepts optional `depth`, `index`, and `description` metadata plus an
|
|
63
|
+
`activationOffset`. It synchronizes the current link on click and scroll. `ScrollProgress` tracks
|
|
64
|
+
the document without requiring a separate hook.
|
|
42
65
|
|
|
43
66
|
```tsx
|
|
44
67
|
import { Anchor, ScrollProgress } from '@santi020k/lumen-react'
|
|
@@ -50,6 +73,13 @@ import { Anchor, ScrollProgress } from '@santi020k/lumen-react'
|
|
|
50
73
|
]} />
|
|
51
74
|
```
|
|
52
75
|
|
|
76
|
+
Use `CopyButton` for clipboard actions on generated names, descriptions, messages, and links. Pass
|
|
77
|
+
either a `value` or a `target` selector; `toast` opts into Lumen Toast feedback.
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
<CopyButton value="https://lumen.santi020k.com" toast>Copy link</CopyButton>
|
|
81
|
+
```
|
|
82
|
+
|
|
53
83
|
## Data visualization
|
|
54
84
|
|
|
55
85
|
`Sparkline`, `BarChart`, `LineChart`, and `PieChart` use the shared `LumenChartSeries` contract and
|
|
@@ -95,23 +125,55 @@ Other React applications continue to consume the same package and exports normal
|
|
|
95
125
|
## Compatibility wrappers
|
|
96
126
|
|
|
97
127
|
The common wrapper primitives preserve their underlying DOM handles with React 19's ref-as-prop
|
|
98
|
-
contract. `Button`, `
|
|
99
|
-
|
|
128
|
+
contract. `Button`, `ButtonLink`, `Link`, `Input`, `Textarea`, `Label`, `Badge`, `Card`, and
|
|
129
|
+
`Skeleton` accept `ref` directly. Use `Button asChild` or `ButtonLink asChild` to apply the
|
|
130
|
+
corresponding contract to one existing React element without adding another DOM node:
|
|
100
131
|
|
|
101
132
|
```tsx
|
|
102
|
-
import { Button } from '@santi020k/lumen-react'
|
|
133
|
+
import { Button, ButtonLink, NativeSelect } from '@santi020k/lumen-react'
|
|
103
134
|
import NextLink from 'next/link'
|
|
104
135
|
|
|
105
136
|
<Button asChild variant="secondary">
|
|
106
137
|
<NextLink href="/projects">Projects</NextLink>
|
|
107
138
|
</Button>
|
|
139
|
+
|
|
140
|
+
<ButtonLink asChild variant="ghost">
|
|
141
|
+
<NextLink href="/docs">Docs</NextLink>
|
|
142
|
+
</ButtonLink>
|
|
108
143
|
```
|
|
109
144
|
|
|
110
|
-
`Input`
|
|
111
|
-
Lumen's visual size modifiers:
|
|
145
|
+
`Input` and `NativeSelect` keep the native numeric `size` attribute. Use `visualSize="sm"` or
|
|
146
|
+
`visualSize="lg"` for Lumen's visual size modifiers:
|
|
112
147
|
|
|
113
148
|
```tsx
|
|
114
149
|
<Input size={32} visualSize="sm" />
|
|
150
|
+
<NativeSelect size={8} visualSize="lg" />
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Context navigation
|
|
154
|
+
|
|
155
|
+
Use `ContextNavigation` below a primary header when links change with a selected platform,
|
|
156
|
+
product, or workspace. Pass the stable selector or identity through `context` and compose the
|
|
157
|
+
related links with one independently named `NavigationMenu`. Long link sets scroll horizontally.
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
import { ContextNavigation, NativeSelect, NavigationMenu } from '@santi020k/lumen-react'
|
|
161
|
+
|
|
162
|
+
<ContextNavigation
|
|
163
|
+
context={(
|
|
164
|
+
<NativeSelect aria-label="Documentation platform" visualSize="sm">
|
|
165
|
+
<option>Web</option>
|
|
166
|
+
<option>Apple</option>
|
|
167
|
+
<option>Android</option>
|
|
168
|
+
</NativeSelect>
|
|
169
|
+
)}
|
|
170
|
+
>
|
|
171
|
+
<NavigationMenu aria-label="Web documentation" variant="unstyled">
|
|
172
|
+
<a href="/docs/web" aria-current="page">Overview</a>
|
|
173
|
+
<a href="/docs/components">Components</a>
|
|
174
|
+
<a href="/docs/web/playground">Playground</a>
|
|
175
|
+
</NavigationMenu>
|
|
176
|
+
</ContextNavigation>
|
|
115
177
|
```
|
|
116
178
|
|
|
117
179
|
Use `Icon` for Lucide icons by name across framework adapters.
|
|
@@ -184,6 +246,14 @@ shortcuts, active toolbar state, and `{ html, text }` change details.
|
|
|
184
246
|
`DataTable` can render structured `columns` and `rows` with the same selectable/sortable data
|
|
185
247
|
attributes, and `VirtualList` exposes the shared range sizing attributes for app-level adapters.
|
|
186
248
|
|
|
249
|
+
## Kanban boards
|
|
250
|
+
|
|
251
|
+
Use `KanbanBoard`, `KanbanColumn`, and ordinary `Card` items for status-based workspaces. The
|
|
252
|
+
`useKanban` hook supplies root, column, item, and dedicated handle props and emits controlled move
|
|
253
|
+
requests for keyboard, mouse, and touch input. It never moves application data or DOM. Keep pending
|
|
254
|
+
state, persistence, rollback, and workflow rules in the host. Use `Empty variant="compact"` inside
|
|
255
|
+
columns and card-shaped `Skeleton` blocks while loading.
|
|
256
|
+
|
|
187
257
|
## Motion
|
|
188
258
|
|
|
189
259
|
Use `ScrollReveal` for one entrance, `RevealGroup` for tokenized child staggering, and
|