@santi020k/lumen-react 0.1.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/LICENSE +21 -0
- package/README.md +132 -0
- package/dist/components.d.ts +634 -0
- package/dist/components.d.ts.map +1 -0
- package/dist/components.js +842 -0
- package/dist/hooks.d.ts +378 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +2056 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/package.json +71 -0
- package/styles.css +5 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Santiago Molina
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# @santi020k/lumen-react
|
|
2
|
+
|
|
3
|
+
React primitives for Lumen UI.
|
|
4
|
+
|
|
5
|
+
This package provides React components for the shared Lumen primitive catalog using the standalone
|
|
6
|
+
Lumen stylesheet.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pnpm add @santi020k/lumen-react
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Load the shared stylesheet once from your app entry or global CSS.
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import '@santi020k/lumen-react/styles.css'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { Button, Card, Input } from '@santi020k/lumen-react'
|
|
24
|
+
|
|
25
|
+
export function SubscribeForm() {
|
|
26
|
+
return (
|
|
27
|
+
<Card>
|
|
28
|
+
<label htmlFor="email">Email</label>
|
|
29
|
+
<Input id="email" type="email" placeholder="you@example.com" />
|
|
30
|
+
<Button>Subscribe</Button>
|
|
31
|
+
</Card>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Use `Icon` for Lucide icons by name across framework adapters.
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { Button, Icon } from '@santi020k/lumen-react'
|
|
40
|
+
|
|
41
|
+
export function SettingsButton() {
|
|
42
|
+
return (
|
|
43
|
+
<Button variant="secondary">
|
|
44
|
+
<Icon name="wand-sparkles" decorative />
|
|
45
|
+
Generate
|
|
46
|
+
</Button>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Optimized images
|
|
52
|
+
|
|
53
|
+
The React `Image` uses a lazy native `img` by default. In Next.js, pass `next/image` through `as` so
|
|
54
|
+
Next keeps control of image sizing, format negotiation, caching, placeholders, and preloading while
|
|
55
|
+
Lumen supplies its presentation class.
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import NextImage from 'next/image'
|
|
59
|
+
import { Image as LumenImage } from '@santi020k/lumen-react'
|
|
60
|
+
|
|
61
|
+
<LumenImage
|
|
62
|
+
alt="Team collaborating around a table"
|
|
63
|
+
as={NextImage}
|
|
64
|
+
height={800}
|
|
65
|
+
sizes="(max-width: 768px) 100vw, 50vw"
|
|
66
|
+
src="/team.jpg"
|
|
67
|
+
width={1200}
|
|
68
|
+
/>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Keep the default lazy loading for images below the fold. For the single likely LCP image, follow
|
|
72
|
+
your framework's preload or fetch-priority guidance. `invertOnDark` is available for monochrome
|
|
73
|
+
artwork authored for light surfaces; leave it off for photos and colorful illustrations.
|
|
74
|
+
|
|
75
|
+
`AnimatedLogo` accepts your own inline SVG rather than imposing brand artwork. Put the accessible
|
|
76
|
+
name on the SVG itself.
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import { AnimatedLogo } from '@santi020k/lumen-react'
|
|
80
|
+
|
|
81
|
+
<AnimatedLogo style={{ height: '3rem' }}>
|
|
82
|
+
<svg aria-label="Acme" role="img" viewBox="0 0 120 32">
|
|
83
|
+
{/* Your logo artwork */}
|
|
84
|
+
</svg>
|
|
85
|
+
</AnimatedLogo>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
For a choreographed logo, set `animation="sequence"` and mark individual SVG layers with
|
|
89
|
+
`data-ui-logo-pop`, `data-ui-logo-draw`, or `data-ui-logo-reveal`. Timing can be adjusted per layer
|
|
90
|
+
with `--ui-logo-delay`.
|
|
91
|
+
|
|
92
|
+
React is Lumen's visual adapter layer plus headless behavior hooks. The components emit the same
|
|
93
|
+
`ui-*` classes and `data-ui-*` attributes as Astro, while hooks such as `useDialog`, `usePopover`,
|
|
94
|
+
`useDropdownMenu`, `useContextMenu`, `useTabs`, `useSelect`, `useFormValidation`, `useCalendar`,
|
|
95
|
+
`useInputOTP`, `useDateRangePicker`, `useRichTextEditor`, `useSchedule`, `useThemeBuilder`,
|
|
96
|
+
`useResizable`, `useToast`, and
|
|
97
|
+
`useTooltip` track the Astro runtime's ARIA, keyboard, Escape, dismissal, context menu, form
|
|
98
|
+
validation, calendar grids, OTP segmentation, date range syncing, rich text command, schedule
|
|
99
|
+
drag/drop, theme export, resizable pane sizing, and toast controller semantics for React
|
|
100
|
+
applications.
|
|
101
|
+
`useRichTextEditor` also provides `getEditableProps`, value-bearing commands, common formatting
|
|
102
|
+
shortcuts, active toolbar state, and `{ html, text }` change details.
|
|
103
|
+
`DataTable` can render structured `columns` and `rows` with the same selectable/sortable data
|
|
104
|
+
attributes, and `VirtualList` exposes the shared range sizing attributes for app-level adapters.
|
|
105
|
+
|
|
106
|
+
## Motion
|
|
107
|
+
|
|
108
|
+
Use `ScrollReveal` for one entrance, `RevealGroup` for tokenized child staggering, and
|
|
109
|
+
`AnimatedNumber` for meaningful metric changes. Their `duration` prop uses the shared `fast`,
|
|
110
|
+
`standard`, and `slow` vocabulary, and every primitive honors reduced-motion preferences.
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
<RevealGroup stagger={80}>
|
|
114
|
+
<Card>Plan</Card>
|
|
115
|
+
<Card>Build</Card>
|
|
116
|
+
<Card>Ship</Card>
|
|
117
|
+
</RevealGroup>
|
|
118
|
+
|
|
119
|
+
<AnimatedNumber decimals={1} suffix="%" value={99.8} />
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Glass surfaces
|
|
123
|
+
|
|
124
|
+
Load `@santi020k/lumen-react/styles.css` once in your app, then use the shared glass API from React.
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
<Card glass>Glass card</Card>
|
|
128
|
+
<Dialog glass>Glass dialog</Dialog>
|
|
129
|
+
<Popover glass>Glass popover</Popover>
|
|
130
|
+
<DatePicker glass="subtle" />
|
|
131
|
+
<Select glass="strong" options={['Astro', 'React']} />
|
|
132
|
+
```
|