@santi020k/lumen-react 0.4.0 → 1.0.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 CHANGED
@@ -37,8 +37,27 @@ export function SubscribeForm() {
37
37
  }
38
38
  ```
39
39
 
40
- For long articles, `Anchor` accepts an optional heading `depth` and `ScrollProgress` tracks the
41
- document without requiring a separate hook.
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
+ See the [forms guide](https://lumen.santi020k.com/docs/forms/react-hook-form) for typed examples.
57
+
58
+ For long articles, `Anchor` accepts optional `depth`, `index`, and `description` metadata plus an
59
+ `activationOffset`. It synchronizes the current link on click and scroll. `ScrollProgress` tracks
60
+ the document without requiring a separate hook.
42
61
 
43
62
  ```tsx
44
63
  import { Anchor, ScrollProgress } from '@santi020k/lumen-react'
@@ -50,6 +69,13 @@ import { Anchor, ScrollProgress } from '@santi020k/lumen-react'
50
69
  ]} />
51
70
  ```
52
71
 
72
+ Use `CopyButton` for clipboard actions on generated names, descriptions, messages, and links. Pass
73
+ either a `value` or a `target` selector; `toast` opts into Lumen Toast feedback.
74
+
75
+ ```tsx
76
+ <CopyButton value="https://lumen.santi020k.com" toast>Copy link</CopyButton>
77
+ ```
78
+
53
79
  ## Data visualization
54
80
 
55
81
  `Sparkline`, `BarChart`, `LineChart`, and `PieChart` use the shared `LumenChartSeries` contract and
@@ -95,23 +121,29 @@ Other React applications continue to consume the same package and exports normal
95
121
  ## Compatibility wrappers
96
122
 
97
123
  The common wrapper primitives preserve their underlying DOM handles with React 19's ref-as-prop
98
- contract. `Button`, `Link`, `ButtonLink`, and `Input` accept `ref` directly. Use `Button asChild`
99
- to apply the button contract to one existing React element without adding another DOM node:
124
+ contract. `Button`, `ButtonLink`, `Link`, `Input`, `Textarea`, `Label`, `Badge`, `Card`, and
125
+ `Skeleton` accept `ref` directly. Use `Button asChild` or `ButtonLink asChild` to apply the
126
+ corresponding contract to one existing React element without adding another DOM node:
100
127
 
101
128
  ```tsx
102
- import { Button } from '@santi020k/lumen-react'
129
+ import { Button, ButtonLink, NativeSelect } from '@santi020k/lumen-react'
103
130
  import NextLink from 'next/link'
104
131
 
105
132
  <Button asChild variant="secondary">
106
133
  <NextLink href="/projects">Projects</NextLink>
107
134
  </Button>
135
+
136
+ <ButtonLink asChild variant="ghost">
137
+ <NextLink href="/docs">Docs</NextLink>
138
+ </ButtonLink>
108
139
  ```
109
140
 
110
- `Input` keeps the native numeric `size` attribute. Use `visualSize="sm"` or `visualSize="lg"` for
111
- Lumen's visual size modifiers:
141
+ `Input` and `NativeSelect` keep the native numeric `size` attribute. Use `visualSize="sm"` or
142
+ `visualSize="lg"` for Lumen's visual size modifiers:
112
143
 
113
144
  ```tsx
114
145
  <Input size={32} visualSize="sm" />
146
+ <NativeSelect size={8} visualSize="lg" />
115
147
  ```
116
148
 
117
149
  Use `Icon` for Lucide icons by name across framework adapters.