reusify-ui 2.0.1 → 2.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 CHANGED
@@ -1,4 +1,5 @@
1
1
  # Reusify UI
2
+ Add [Reusify UI](https://reusify-ui.vercel.app) components to your projects.
2
3
 
3
4
  Reusable, accessible React components with built-in dark mode and CSS-variable theming.
4
5
  Works with or without Tailwind CSS.
@@ -60,35 +61,66 @@ export default function App() {
60
61
 
61
62
  | Category | Components |
62
63
  | -------------- | -------------------------------------------------------------------------- |
63
- | Actions | `Button` |
64
- | Forms | `Input`, `Textarea`, `Select`, `Checkbox`, `Radio`, `RadioGroup`, `Switch` |
65
- | Data display | `Card`, `CardHeader`, `CardBody`, `CardFooter`, `Badge`, `Avatar`, `AvatarGroup`, `Table`, `Divider`, `Kbd` |
66
- | Feedback | `Alert`, `ToastProvider` + `useToast`, `Spinner`, `Progress`, `Skeleton` |
64
+ | Actions | `Button`, `ButtonGroup` |
65
+ | Forms | `Input`, `Textarea`, `Select`, `Checkbox`, `Radio`, `RadioGroup`, `Switch`, `Calendar`, `Dropzone`, `FileItem`, `SignaturePad` |
66
+ | Data display | `Card`, `CardHeader`, `CardBody`, `CardFooter`, `Badge`, `Avatar`, `AvatarGroup`, `Table`, `Divider`, `Kbd`, `FrameCard`, `Stat`, `DateTile`, `StepList`, `StatusIcon` |
67
+ | Feedback | `Alert`, `ToastProvider` + `useToast`, `Spinner`, `Progress`, `ProgressRing`, `StackedProgress`, `Skeleton` |
67
68
  | Overlays | `Modal`, `Drawer`, `Tooltip`, `Dropdown` |
68
- | Navigation | `Tabs`, `Accordion`, `Pagination`, `Breadcrumbs` |
69
- | Effects | `SpotlightCard`, `Pattern` |
69
+ | Navigation | `Tabs`, `Accordion`, `Pagination`, `Breadcrumbs`, `SegmentedControl` |
70
+ | Effects | `SpotlightCard`, `Pattern`, `DotText`, `IconTile` |
70
71
  | Hooks & utils | `useDisclosure`, `useClickOutside`, `useControllableState`, `cn` |
71
72
 
72
73
  ### Button
73
74
 
75
+ Pick a **variant** by emphasis, then a **color** for meaning:
76
+
77
+ | Emphasis | Variants | Use for |
78
+ | --- | --- | --- |
79
+ | High | `solid` (default), `brand`, `gradient`, `glossy`, `pixel` | The main action; one brand or gradient hero CTA per page |
80
+ | Medium | `secondary`, `soft`, `outline`, `subtle`, `raised`, `framed`, `key` | Partners of the main action, menus, actions in cards |
81
+ | Low | `ghost`, `text`, `link`, `dashed` | Toolbars, "Learn more", inline and "add" actions |
82
+
83
+ Every button also takes **any CSS color**, a text color, a corner radius and a content alignment:
84
+
74
85
  ```jsx
75
- <Button>Primary</Button>
76
- <Button variant="secondary">Secondary</Button>
77
- <Button variant="outline" size="sm">Outline</Button>
78
- <Button variant="ghost">Ghost</Button>
79
- <Button variant="danger" loading>Deleting</Button>
80
- <Button leftIcon={<PlusIcon />} fullWidth>Add item</Button>
86
+ <Button variant="pixel" color="#2563eb" justify="between" rightIcon={<TerminalIcon />}>Copy build notes</Button>
87
+ <Button variant="glossy" color="oklch(0.6 0.2 260)" radius="xl">Sign up</Button>
88
+ <Button color="#facc15" textColor="#1c1917" radius={4}>Yellow</Button>
81
89
  ```
82
90
 
83
- | Prop | Type | Default |
84
- | ----------- | ----------------------------------------------------------------------------- | ----------- |
85
- | `variant` | `'primary' \| 'secondary' \| 'outline' \| 'ghost' \| 'danger' \| 'success' \| 'link'` | `'primary'` |
86
- | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` |
87
- | `loading` | `boolean` | `false` |
88
- | `fullWidth` | `boolean` | `false` |
89
- | `leftIcon`, `rightIcon` | `ReactNode` | — |
91
+ ```jsx
92
+ <Button>Save</Button>
93
+ <Button variant="brand" rightIcon={<ArrowRight />}>Start your first lab</Button> {/* emerald, gold in dark mode */}
94
+ <Button variant="gradient" rightIcon={<ArrowRight />}>Get started</Button>
95
+ <Button variant="secondary">Cancel</Button>
96
+ <Button variant="soft" color="success">Approve</Button>
97
+ <Button color="danger" loading>Deleting</Button>
98
+ <Button variant="text">Learn more</Button>
99
+
100
+ <Button iconOnly aria-label="Edit" variant="ghost"><EditIcon /></Button>
101
+ <Button pill leftIcon={<PlusIcon />}>Follow</Button>
102
+ <Button href="/docs">Read the docs</Button> {/* renders an <a> */}
103
+
104
+ <ButtonGroup attached aria-label="Period">
105
+ <Button variant="secondary">Day</Button>
106
+ <Button>Week</Button>
107
+ <Button variant="secondary">Month</Button>
108
+ </ButtonGroup>
109
+ ```
110
+
111
+ | Prop | Type | Default |
112
+ | ----------- | ---- | ------- |
113
+ | `variant` | `'solid' \| 'brand' \| 'gradient' \| 'glossy' \| 'pixel' \| 'secondary' \| 'soft' \| 'outline' \| 'subtle' \| 'raised' \| 'framed' \| 'ghost' \| 'text' \| 'link' \| 'dashed'` | `'solid'` |
114
+ | `color` | `'primary' \| 'secondary' \| 'success' \| 'danger' \| 'warning' \| 'info'` or any CSS color | `'primary'` |
115
+ | `textColor` | CSS color | — |
116
+ | `radius` | `'none' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl' \| 'full'`, a number (px) or a CSS length | size default |
117
+ | `justify` | `'center' \| 'start' \| 'between'` | `'center'` |
118
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` |
119
+ | `iconOnly`, `pill`, `fullWidth`, `loading` | `boolean` | `false` |
120
+ | `leftIcon`, `rightIcon` | `ReactNode` | — |
121
+ | `href` | `string` (renders an `<a>`) | — |
90
122
 
91
- All native `<button>` props are supported too.
123
+ All native `<button>` (or `<a>`) props are supported too. `variant="primary" | "danger" | "success"` from 2.0 still work.
92
124
 
93
125
  ### Form controls
94
126
 
@@ -175,6 +207,11 @@ Options: `title`, `description`, `variant`, `duration` (ms, `Infinity` keeps it
175
207
  <Button variant="ghost">Copy</Button>
176
208
  </Tooltip>
177
209
 
210
+ {/* size sm|md|lg, arrow on by default, any colors, open pins it */}
211
+ <Tooltip content="Reusify UI" placement="bottom" size="lg" color="#0a0a0a" textColor="#fff" open>
212
+ <Button variant="raised" iconOnly radius="xl" aria-label="Reusify UI"><Logo /></Button>
213
+ </Tooltip>
214
+
178
215
  <Dropdown
179
216
  trigger={<Button variant="outline">Actions</Button>}
180
217
  align="end"
@@ -224,6 +261,24 @@ Both support controlled (`value` + `onChange`) and uncontrolled (`defaultValue`)
224
261
  />
225
262
  ```
226
263
 
264
+ #### Pagination
265
+
266
+ ```jsx
267
+ // Client-side: the table slices `data` for you
268
+ <Table rowKey="id" columns={columns} data={users} pagination={{ pageSize: 10, pageSizeOptions: [10, 25, 50] }} />
269
+
270
+ // Server-side: `data` is the current page, totalRows is the full count
271
+ <Table
272
+ rowKey="id"
273
+ columns={columns}
274
+ data={rows}
275
+ loading={loading}
276
+ pagination={{ page, onPageChange: setPage, pageSize: 20, totalRows: total }}
277
+ />
278
+ ```
279
+
280
+ `pagination` accepts `true` (10 rows per page) or `{ pageSize, defaultPageSize, pageSizeOptions, onPageSizeChange, page, defaultPage, onPageChange, totalRows, siblingCount }`. The footer shows "Showing 1–10 of 57", an optional rows-per-page select and page buttons.
281
+
227
282
  ### Other components
228
283
 
229
284
  ```jsx
@@ -237,6 +292,45 @@ Both support controlled (`value` + `onChange`) and uncontrolled (`defaultValue`)
237
292
  <Pagination page={page} totalPages={20} onChange={setPage} />
238
293
  <Breadcrumbs items={[{ label: 'Home', href: '/' }, { label: 'Settings' }]} />
239
294
  <Divider label="OR" />
295
+ <Avatar name="Mia Johnson" status="online" badge={1} ring="primary" />
296
+ ```
297
+
298
+ ### New in 2.2
299
+
300
+ ```jsx
301
+ <SegmentedControl options={['Day', 'Week', 'Month']} defaultValue="Week" aria-label="Range" />
302
+ <ProgressRing value={64} size={64} showValue />
303
+ <Stat label="New users" value="5,9k" trend={8.2} />
304
+ <DateTile date="2026-10-20" />
305
+ <StackedProgress segments={[{ label: 'Work', value: 54, color: '#3f9d5d' }, { label: 'Other', value: 46, color: '#e07a7a' }]} />
306
+ <StepList items={[{ title: 'Build', status: 'complete' }, { title: 'Deploy', status: 'running' }]} />
307
+ <Dropzone maxSize={10_000_000} onFiles={upload} />
308
+ <FileItem name="report.pdf" size={2457600} status="uploading" progress={42} onRemove={cancel} />
309
+ <SignaturePad onChange={setSignature} />
310
+ <IconTile color="#7c6fff" badge={<FiKey />} label="Acme"><YourLogo /></IconTile>
311
+ <DotText dot={4} style={{ fontSize: 48 }}>YYZ</DotText>
312
+ <Progress variant="ticks" value={67} showValue /> {/* also variant="bars", and glow */}
313
+ <Progress variant="capsule" value={46} glow icon={<PlaneIcon />} endLabel="-7H 01M" />
314
+ <Button variant="key" color="#f472b6" aria-pressed>Pressed</Button>
315
+ ```
316
+
317
+ ### FrameCard & Calendar
318
+
319
+ ```jsx
320
+ <FrameCard
321
+ title="Tasks Project"
322
+ color="warning" // semantic name or any CSS color
323
+ collapsible
324
+ footer={<button className="ru-frame-card__link">View All Tasks</button>}
325
+ onPrev={prev}
326
+ onNext={next}
327
+ >
328
+ <Checkbox label="Design Homepage" defaultChecked />
329
+ </FrameCard>
330
+
331
+ <FrameCard title="Start Project" color="#2563eb" titlePlacement="frame" onPrev={prev} onNext={next}>
332
+ <Calendar mode="range" value={range} onChange={setRange} color="#2563eb" />
333
+ </FrameCard>
240
334
  ```
241
335
 
242
336
  ## Dark mode