@rufous/ui 0.1.6 → 0.1.8

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.
Files changed (98) hide show
  1. package/README.md +485 -158
  2. package/dist/{Buttons/Button.cjs → chunk-LI4N7JWK.js} +11 -14
  3. package/dist/esm-5T53WHPT.js +27362 -0
  4. package/dist/main.cjs +36982 -762
  5. package/dist/main.css +13256 -193
  6. package/dist/main.d.cts +1526 -15
  7. package/dist/main.d.ts +1526 -15
  8. package/dist/main.js +8039 -45
  9. package/package.json +14 -3
  10. package/dist/Buttons/Button.d.cjs +0 -17
  11. package/dist/Buttons/Button.d.cts +0 -10
  12. package/dist/Buttons/Button.d.d.cts +0 -10
  13. package/dist/Buttons/Button.d.d.ts +0 -10
  14. package/dist/Buttons/Button.d.js +0 -0
  15. package/dist/Buttons/Button.d.ts +0 -10
  16. package/dist/Buttons/Button.js +0 -6
  17. package/dist/CheckBoxes/CheckBox.cjs +0 -62
  18. package/dist/CheckBoxes/CheckBox.d.cjs +0 -17
  19. package/dist/CheckBoxes/CheckBox.d.cts +0 -15
  20. package/dist/CheckBoxes/CheckBox.d.d.cts +0 -15
  21. package/dist/CheckBoxes/CheckBox.d.d.ts +0 -15
  22. package/dist/CheckBoxes/CheckBox.d.js +0 -0
  23. package/dist/CheckBoxes/CheckBox.d.ts +0 -15
  24. package/dist/CheckBoxes/CheckBox.js +0 -6
  25. package/dist/Contexts/rufousThemeProvider.cjs +0 -177
  26. package/dist/Contexts/rufousThemeProvider.d.cts +0 -8
  27. package/dist/Contexts/rufousThemeProvider.d.ts +0 -8
  28. package/dist/Contexts/rufousThemeProvider.js +0 -9
  29. package/dist/TextFields/FloatingInput.cjs +0 -65
  30. package/dist/TextFields/FloatingInput.d.cjs +0 -17
  31. package/dist/TextFields/FloatingInput.d.cts +0 -23
  32. package/dist/TextFields/FloatingInput.d.d.cts +0 -23
  33. package/dist/TextFields/FloatingInput.d.d.ts +0 -23
  34. package/dist/TextFields/FloatingInput.d.js +0 -0
  35. package/dist/TextFields/FloatingInput.d.ts +0 -23
  36. package/dist/TextFields/FloatingInput.js +0 -6
  37. package/dist/chunk-2FHTGYR4.js +0 -83
  38. package/dist/chunk-3IBCGGN3.js +0 -48
  39. package/dist/chunk-6FEUS4CQ.js +0 -41
  40. package/dist/chunk-73G3VTVS.js +0 -48
  41. package/dist/chunk-ASP3DBRX.js +0 -9
  42. package/dist/chunk-AWA5Y5LH.js +0 -32
  43. package/dist/chunk-BCGCLMKA.js +0 -71
  44. package/dist/chunk-D7SFBVJY.js +0 -155
  45. package/dist/chunk-H372BAXA.js +0 -42
  46. package/dist/chunk-PULIGWAP.js +0 -62
  47. package/dist/chunk-QJPQC544.js +0 -29
  48. package/dist/chunk-QKDJLUKZ.js +0 -29
  49. package/dist/chunk-QZFGQ5JM.js +0 -157
  50. package/dist/chunk-WZAU77G7.js +0 -55
  51. package/dist/chunk-ZZ37BKUK.js +0 -0
  52. package/dist/icons/archivedIcon.cjs +0 -77
  53. package/dist/icons/archivedIcon.d.cts +0 -8
  54. package/dist/icons/archivedIcon.d.ts +0 -8
  55. package/dist/icons/archivedIcon.js +0 -6
  56. package/dist/icons/copyIcon.cjs +0 -70
  57. package/dist/icons/copyIcon.d.cts +0 -8
  58. package/dist/icons/copyIcon.d.ts +0 -8
  59. package/dist/icons/copyIcon.js +0 -6
  60. package/dist/icons/editIcon.cjs +0 -71
  61. package/dist/icons/editIcon.d.cts +0 -8
  62. package/dist/icons/editIcon.d.ts +0 -8
  63. package/dist/icons/editIcon.js +0 -6
  64. package/dist/icons/helpOutlinedIcon.cjs +0 -91
  65. package/dist/icons/helpOutlinedIcon.d.cts +0 -8
  66. package/dist/icons/helpOutlinedIcon.d.ts +0 -8
  67. package/dist/icons/helpOutlinedIcon.js +0 -6
  68. package/dist/icons/hierarchyIcon.cjs +0 -84
  69. package/dist/icons/hierarchyIcon.d.cts +0 -8
  70. package/dist/icons/hierarchyIcon.d.ts +0 -8
  71. package/dist/icons/hierarchyIcon.js +0 -6
  72. package/dist/icons/index.cjs +0 -664
  73. package/dist/icons/index.d.cts +0 -10
  74. package/dist/icons/index.d.ts +0 -10
  75. package/dist/icons/index.js +0 -39
  76. package/dist/icons/nineDotMenuIcon.cjs +0 -184
  77. package/dist/icons/nineDotMenuIcon.d.cts +0 -8
  78. package/dist/icons/nineDotMenuIcon.d.ts +0 -8
  79. package/dist/icons/nineDotMenuIcon.js +0 -6
  80. package/dist/icons/rufousLauncherBird.cjs +0 -186
  81. package/dist/icons/rufousLauncherBird.d.cts +0 -8
  82. package/dist/icons/rufousLauncherBird.d.ts +0 -8
  83. package/dist/icons/rufousLauncherBird.js +0 -6
  84. package/dist/icons/unArchivedIcon.cjs +0 -77
  85. package/dist/icons/unArchivedIcon.d.cts +0 -8
  86. package/dist/icons/unArchivedIcon.d.ts +0 -8
  87. package/dist/icons/unArchivedIcon.js +0 -6
  88. package/dist/icons/workItemIcon.cjs +0 -58
  89. package/dist/icons/workItemIcon.d.cts +0 -8
  90. package/dist/icons/workItemIcon.d.ts +0 -8
  91. package/dist/icons/workItemIcon.js +0 -6
  92. package/dist/style.css +0 -246
  93. package/dist/style.d.cts +0 -2
  94. package/dist/style.d.ts +0 -2
  95. package/dist/utils/constants.cjs +0 -106
  96. package/dist/utils/constants.d.cts +0 -80
  97. package/dist/utils/constants.d.ts +0 -80
  98. package/dist/utils/constants.js +0 -6
package/README.md CHANGED
@@ -1,242 +1,569 @@
1
- # @rufous/ui
1
+ # Rufous UI
2
2
 
3
- A modern and reusable UI component library for React.
4
- Includes buttons, floating inputs, checkboxes, theme support, and icons.
3
+ A polished React component library built with design tokens, TypeScript, and zero runtime dependencies beyond React. Every component supports the `sx` prop for scoped style overrides.
4
+
5
+ **Live Showcase → [ui.dev.rufous.com](https://ui.dev.rufous.com/)**
5
6
 
6
7
  ---
7
8
 
8
- ## 📦 Installation
9
+ ## Installation
9
10
 
10
11
  ```bash
11
12
  npm install @rufous/ui
12
- ```
13
-
14
- or
15
-
16
- ```bash
13
+ # or
17
14
  yarn add @rufous/ui
18
15
  ```
19
16
 
20
17
  ---
21
18
 
22
- ## 🎯 Usage
19
+ ## Setup
23
20
 
24
- Before using any components, **import the global styles**:
21
+ Import the global styles once in your app entry:
25
22
 
26
- ```javascript
23
+ ```tsx
27
24
  import "@rufous/ui/style.css";
28
25
  ```
29
26
 
27
+ Wrap your app with the theme provider:
28
+
29
+ ```tsx
30
+ import { RufousThemeProvider } from "@rufous/ui";
31
+ import "@rufous/ui/style.css";
32
+
33
+ ReactDOM.createRoot(document.getElementById("root")!).render(
34
+ <RufousThemeProvider>
35
+ <App />
36
+ </RufousThemeProvider>
37
+ );
38
+ ```
39
+
30
40
  ---
31
41
 
32
- ## 🧩 Components Showcase
42
+ ## Components
43
+
44
+ ### Buttons
33
45
 
34
- Below are usage examples of all the components available in the showcase.
46
+ ```tsx
47
+ import { StandardButton, AddButton, SubmitButton, CancelButton } from "@rufous/ui";
48
+
49
+ <StandardButton onClick={fn}>Standard</StandardButton>
50
+ <AddButton onClick={fn}>Add Item</AddButton>
51
+ <SubmitButton onClick={asyncFn}>Save</SubmitButton>
52
+ <CancelButton onClick={fn}>Cancel</CancelButton>
53
+ ```
54
+
55
+ | Prop | Type | Default | Description |
56
+ |------|------|---------|-------------|
57
+ | `onClick` | `() => void \| Promise<void>` | — | Supports async; shows loader until resolved |
58
+ | `isLoading` | `boolean` | `false` | External loading state control |
59
+ | `disabled` | `boolean` | `false` | Disables the button |
60
+ | `sx` | `SxProp` | — | Scoped style overrides |
35
61
 
36
62
  ---
37
63
 
38
- ### 🧱 Button
64
+ ### TextField
39
65
 
40
- ```jsx
41
- import React from "react";
42
- import { Button } from "@rufous/ui";
43
- import "@rufous/ui/style.css";
66
+ ```tsx
67
+ import { TextField } from "@rufous/ui";
44
68
 
45
- export default function Example() {
46
- return (
47
- <Button onClick={() => alert("Rufous Button clicked!")}>Click Me</Button>
48
- );
49
- }
69
+ <TextField
70
+ label="Email"
71
+ value={email}
72
+ onChange={(e) => setEmail(e.target.value)}
73
+ variant="outlined"
74
+ required
75
+ />
50
76
  ```
51
77
 
78
+ | Prop | Type | Default |
79
+ |------|------|---------|
80
+ | `label` | `string` | — |
81
+ | `variant` | `'outlined' \| 'filled' \| 'standard'` | `'outlined'` |
82
+ | `size` | `'small' \| 'medium'` | `'medium'` |
83
+ | `color` | `'primary' \| 'secondary' \| 'error' \| 'success' \| 'warning' \| 'info'` | `'primary'` |
84
+ | `error` | `boolean` | `false` |
85
+ | `helperText` | `ReactNode` | — |
86
+ | `fullWidth` | `boolean` | `false` |
87
+ | `InputProps` | `{ startAdornment?, endAdornment? }` | — |
88
+ | `sx` | `SxProp` | — |
89
+
52
90
  ---
53
91
 
54
- ### ✍️ Floating Input
92
+ ### Select
55
93
 
56
- ```jsx
57
- import React, { useState } from "react";
58
- import { FloatingInput } from "@rufous/ui";
59
- import "@rufous/ui/style.css";
94
+ ```tsx
95
+ import { Select } from "@rufous/ui";
60
96
 
61
- export default function Example() {
62
- const [name, setName] = useState("");
97
+ <Select
98
+ options={[{ value: "us", label: "United States" }]}
99
+ value={country}
100
+ onChange={setCountry}
101
+ label="Country"
102
+ />
63
103
 
64
- return (
65
- <FloatingInput
66
- label="Your Name"
67
- name="name"
68
- value={name}
69
- onChange={(e) => setName(e.target.value)}
70
- required
71
- />
72
- );
73
- }
104
+ // Multiple selection
105
+ <Select options={options} value={selected} onChange={setSelected} multiple label="Tags" />
74
106
  ```
75
107
 
76
108
  ---
77
109
 
78
- ### 🎨 Theme Provider
110
+ ### DateField / DateRangeField
79
111
 
80
- ```jsx
81
- import React from "react";
82
- import { Button, useRufousTheme, APP_THEMES } from "@rufous/ui";
83
- import "@rufous/ui/style.css";
112
+ ```tsx
113
+ import { DateField, DateRangeField } from "@rufous/ui";
114
+
115
+ <DateField label="Start Date" value={date} onChange={setDate} />
116
+
117
+ <DateRangeField
118
+ label="Date Range"
119
+ value={range}
120
+ onChange={setRange}
121
+ />
122
+ ```
84
123
 
85
- export default function Example() {
86
- const { previewTheme } = useRufousTheme();
124
+ ---
125
+
126
+ ### Autocomplete
127
+
128
+ ```tsx
129
+ import { Autocomplete } from "@rufous/ui";
87
130
 
88
- return (
89
- <>
90
- <Button
91
- onClick={() => previewTheme(APP_THEMES.default.name.toLowerCase())}
92
- >
93
- Light
94
- </Button>
95
- <Button
96
- onClick={() => previewTheme(APP_THEMES.rufous.name.toLowerCase())}
97
- >
98
- Dark
99
- </Button>
100
- </>
101
- );
102
- }
131
+ <Autocomplete
132
+ options={["React", "Vue", "Angular"]}
133
+ value={val}
134
+ onChange={setVal}
135
+ label="Framework"
136
+ />
103
137
  ```
104
138
 
105
139
  ---
106
140
 
107
- ### ☑️ Checkbox
141
+ ### Checkbox
108
142
 
109
- ```jsx
110
- import React from "react";
143
+ ```tsx
111
144
  import { Checkbox } from "@rufous/ui";
112
- import "@rufous/ui/style.css";
113
145
 
114
- export default function Example() {
115
- return (
116
- <>
117
- <Checkbox label="Unchecked" />
118
- <Checkbox checked={true} label="Checked" />
119
- </>
120
- );
121
- }
146
+ <Checkbox
147
+ label="I agree to the terms"
148
+ checked={checked}
149
+ onChange={setChecked}
150
+ />
122
151
  ```
123
152
 
124
153
  ---
125
154
 
126
- ### 🖼 Icons (Extra Example)
155
+ ### Dialog
156
+
157
+ ```tsx
158
+ import { BaseDialog } from "@rufous/ui";
159
+
160
+ <BaseDialog
161
+ open={open}
162
+ title="Confirm Delete"
163
+ onClose={onClose}
164
+ onConfirm={onConfirm}
165
+ showCancelButton
166
+ fullWidth
167
+ >
168
+ <p>Are you sure you want to delete this item?</p>
169
+ </BaseDialog>
170
+ ```
127
171
 
128
- ```jsx
129
- import React from "react";
130
- import { CopyIcon, EditIcon } from "@rufous/ui";
131
- import "@rufous/ui/style.css";
172
+ | Prop | Type | Description |
173
+ |------|------|-------------|
174
+ | `open` | `boolean` | Controls visibility |
175
+ | `title` | `string` | Dialog title |
176
+ | `onClose` | `() => void` | Close handler |
177
+ | `onConfirm` | `() => void \| Promise<void>` | Async confirm; shows loader |
178
+ | `showCancelButton` | `boolean` | Show cancel button |
179
+ | `fullWidth` | `boolean` | Full container width |
180
+ | `sx` | `SxProp` | Scoped style overrides |
181
+
182
+ ---
183
+
184
+ ### Slider
185
+
186
+ ```tsx
187
+ import { Slider } from "@rufous/ui";
188
+
189
+ <Slider label="Volume" value={vol} onChange={setVol} valueLabelDisplay="auto" />
132
190
 
133
- export default function Example() {
134
- return (
135
- <div style={{ display: "flex", gap: "10px" }}>
136
- <CopyIcon onClick={() => alert("Copied!")} />
137
- <EditIcon onClick={() => alert("Edit clicked!")} />
138
- </div>
139
- );
140
- }
191
+ // Range
192
+ <Slider label="Price" value={[20, 80]} onChange={setRange} range min={0} max={200} />
141
193
  ```
142
194
 
143
195
  ---
144
196
 
145
- ## 📋 Props Reference
197
+ ### Switch
146
198
 
147
- ### **Button**
199
+ ```tsx
200
+ import { Switch } from "@rufous/ui";
148
201
 
149
- | Prop | Type | Default | Description |
150
- | ------- | -------- | ------- | --------------------- |
151
- | variant | string | primary | Sets the button style |
152
- | size | string | medium | Sets the button size |
153
- | onClick | function | - | Click event handler |
202
+ <Switch checked={on} onChange={setOn} label="Enable notifications" />
203
+ ```
154
204
 
155
205
  ---
156
206
 
157
- ### **FloatingInput**
207
+ ### RadioGroup
208
+
209
+ ```tsx
210
+ import { RadioGroup, Radio } from "@rufous/ui";
158
211
 
159
- | Prop | Type | Default | Description |
160
- | -------- | -------- | ------- | ---------------------- |
161
- | label | string | - | Floating label text |
162
- | name | string | - | Input name attribute |
163
- | value | string | - | Input value |
164
- | onChange | function | - | Change event handler |
165
- | required | boolean | false | Mark field as required |
212
+ <RadioGroup label="Payment" options={options} value={val} onChange={setVal} />
213
+
214
+ // Composed
215
+ <RadioGroup value={val} onChange={setVal}>
216
+ <Radio value="card" label="Credit Card" />
217
+ <Radio value="paypal" label="PayPal" />
218
+ </RadioGroup>
219
+ ```
166
220
 
167
221
  ---
168
222
 
169
- ### **Checkbox**
223
+ ### Rating
224
+
225
+ ```tsx
226
+ import { Rating } from "@rufous/ui";
170
227
 
171
- | Prop | Type | Default | Description |
172
- | -------- | -------- | ------- | -------------------- |
173
- | label | string | - | Checkbox label |
174
- | checked | boolean | false | Checked state |
175
- | onChange | function | - | Change event handler |
228
+ <Rating value={stars} onChange={setStars} />
229
+ <Rating value={4.5} precision={0.5} readOnly />
230
+ ```
176
231
 
177
232
  ---
178
233
 
179
- ## 📌 Quick Start Example
234
+ ### ToggleButton
180
235
 
181
- Here’s a **full example** using multiple components:
236
+ ```tsx
237
+ import { ToggleButtonGroup, ToggleButton } from "@rufous/ui";
182
238
 
183
- ```jsx
184
- import React, { useState } from "react";
185
- import {
186
- Button,
187
- FloatingInput,
188
- Checkbox,
189
- CopyIcon,
190
- EditIcon,
191
- useRufousTheme,
192
- APP_THEMES,
193
- } from "@rufous/ui";
194
- import "@rufous/ui/style.css";
239
+ // Exclusive (radio)
240
+ <ToggleButtonGroup value={alignment} onChange={setAlignment} exclusive>
241
+ <ToggleButton value="left">Left</ToggleButton>
242
+ <ToggleButton value="center">Center</ToggleButton>
243
+ <ToggleButton value="right">Right</ToggleButton>
244
+ </ToggleButtonGroup>
245
+
246
+ // Multi-select
247
+ <ToggleButtonGroup value={formats} onChange={setFormats}>
248
+ <ToggleButton value="bold"><strong>B</strong></ToggleButton>
249
+ <ToggleButton value="italic"><em>I</em></ToggleButton>
250
+ </ToggleButtonGroup>
251
+ ```
252
+
253
+ ---
254
+
255
+ ### Avatar
256
+
257
+ ```tsx
258
+ import { Avatar, AvatarGroup } from "@rufous/ui";
259
+
260
+ <Avatar src="/photo.jpg" alt="Alice Johnson" size="medium" />
261
+ <Avatar alt="Alice Johnson" color="#a41b06" /> // initials fallback
262
+
263
+ <AvatarGroup max={4}>
264
+ <Avatar alt="Alice" />
265
+ <Avatar alt="Bob" color="#1565c0" />
266
+ </AvatarGroup>
267
+ ```
268
+
269
+ ---
270
+
271
+ ### Chip
272
+
273
+ ```tsx
274
+ import { Chip } from "@rufous/ui";
275
+
276
+ <Chip label="React" color="primary" />
277
+ <Chip label="Remove me" color="error" onDelete={() => {}} />
278
+ <Chip label="Click me" color="default" variant="outlined" onClick={fn} />
279
+ ```
280
+
281
+ ---
282
+
283
+ ### Divider
284
+
285
+ ```tsx
286
+ import { Divider } from "@rufous/ui";
287
+
288
+ <Divider />
289
+ <Divider variant="middle" />
290
+ <Divider textAlign="center">OR</Divider>
291
+ <Divider orientation="vertical" flexItem />
292
+ ```
293
+
294
+ ---
295
+
296
+ ### List
297
+
298
+ ```tsx
299
+ import { List, ListItem, ListItemText, ListItemButton, ListItemIcon, ListSubheader } from "@rufous/ui";
300
+
301
+ <List subheader={<ListSubheader>Inbox</ListSubheader>}>
302
+ <ListItemButton selected onClick={fn}>
303
+ <ListItemIcon>📩</ListItemIcon>
304
+ <ListItemText primary="Messages" secondary="3 unread" />
305
+ </ListItemButton>
306
+ </List>
307
+ ```
308
+
309
+ ---
310
+
311
+ ### Typography
312
+
313
+ ```tsx
314
+ import { Typography } from "@rufous/ui";
315
+
316
+ <Typography variant="h1">Heading</Typography>
317
+ <Typography variant="body1" color="textSecondary">Paragraph text</Typography>
318
+ <Typography variant="caption" gutterBottom>Caption</Typography>
319
+ ```
320
+
321
+ ---
322
+
323
+ ### Skeleton
324
+
325
+ ```tsx
326
+ import { Skeleton } from "@rufous/ui";
327
+
328
+ <Skeleton variant="text" width={200} />
329
+ <Skeleton variant="circular" width={40} height={40} />
330
+ <Skeleton variant="rounded" width={300} height={120} animation="wave" />
331
+ ```
332
+
333
+ ---
334
+
335
+ ### Tooltip
336
+
337
+ ```tsx
338
+ import { Tooltip } from "@rufous/ui";
339
+
340
+ <Tooltip title="Delete this item" placement="top" arrow>
341
+ <button>Delete</button>
342
+ </Tooltip>
343
+ ```
344
+
345
+ ---
346
+
347
+ ### Progress
348
+
349
+ ```tsx
350
+ import { CircularProgress, RufousLogoLoader } from "@rufous/ui";
351
+
352
+ <CircularProgress size={36} />
353
+ <RufousLogoLoader />
354
+ ```
355
+
356
+ ---
357
+
358
+ ### Box / Stack / Grid
359
+
360
+ ```tsx
361
+ import { Box, Stack, Grid } from "@rufous/ui";
362
+
363
+ // Box — generic flex/layout container
364
+ <Box display="flex" gap={16} padding={24}>...</Box>
365
+
366
+ // Stack — 1D flex layout
367
+ <Stack direction="row" spacing={2}>
368
+ <div>A</div>
369
+ <div>B</div>
370
+ </Stack>
371
+
372
+ // Grid — 12-column responsive grid
373
+ <Grid container spacing={3}>
374
+ <Grid item xs={12} md={6}>Main</Grid>
375
+ <Grid item xs={12} md={6}>Sidebar</Grid>
376
+ </Grid>
377
+ ```
378
+
379
+ ---
380
+
381
+ ### Paper / Card / Accordion
382
+
383
+ ```tsx
384
+ import { Paper, Card, CardContent, CardHeader, CardActions, Accordion, AccordionSummary, AccordionDetails } from "@rufous/ui";
385
+
386
+ <Paper elevation={3}>Content</Paper>
387
+
388
+ <Card>
389
+ <CardHeader title="Title" subheader="Subtitle" />
390
+ <CardContent>Body</CardContent>
391
+ <CardActions><button>Action</button></CardActions>
392
+ </Card>
195
393
 
196
- export default function App() {
197
- const [name, setName] = useState("");
198
- const { previewTheme } = useRufousTheme();
394
+ <Accordion>
395
+ <AccordionSummary>FAQ Question</AccordionSummary>
396
+ <AccordionDetails>Answer text here.</AccordionDetails>
397
+ </Accordion>
398
+ ```
399
+
400
+ ---
401
+
402
+ ### Tabs
403
+
404
+ ```tsx
405
+ import { Tabs, Tab } from "@rufous/ui";
406
+
407
+ <Tabs value={tab} onChange={setTab}>
408
+ <Tab value="home" label="Home" />
409
+ <Tab value="settings" label="Settings" />
410
+ </Tabs>
411
+ ```
412
+
413
+ ---
414
+
415
+ ### Breadcrumbs
416
+
417
+ ```tsx
418
+ import { Breadcrumbs } from "@rufous/ui";
419
+
420
+ <Breadcrumbs separator="›">
421
+ <a href="/">Home</a>
422
+ <a href="/products">Products</a>
423
+ <span>Current</span>
424
+ </Breadcrumbs>
425
+ ```
426
+
427
+ ---
428
+
429
+ ### Stepper
430
+
431
+ ```tsx
432
+ import { Stepper, Step, StepLabel, StepContent } from "@rufous/ui";
433
+
434
+ <Stepper activeStep={activeStep}>
435
+ {steps.map((label) => (
436
+ <Step key={label}>
437
+ <StepLabel>{label}</StepLabel>
438
+ </Step>
439
+ ))}
440
+ </Stepper>
441
+ ```
442
+
443
+ ---
199
444
 
200
- return (
201
- <div style={{ padding: "20px" }}>
202
- <h1>Rufous UI Demo</h1>
445
+ ### Menu
203
446
 
204
- <Button onClick={() => alert("Hello!")}>Click Me</Button>
447
+ ```tsx
448
+ import { Menu, MenuItem, MenuList, MenuDivider } from "@rufous/ui";
449
+
450
+ <Menu open={open} anchorEl={anchorRef.current} onClose={() => setOpen(false)}>
451
+ <MenuList>
452
+ <MenuItem icon="👤">Profile</MenuItem>
453
+ <MenuItem icon="⚙️">Settings</MenuItem>
454
+ <MenuDivider />
455
+ <MenuItem icon="🚪">Sign Out</MenuItem>
456
+ </MenuList>
457
+ </Menu>
458
+ ```
459
+
460
+ ---
461
+
462
+ ### Drawer
463
+
464
+ ```tsx
465
+ import { Drawer } from "@rufous/ui";
466
+
467
+ <Drawer open={open} onClose={() => setOpen(false)} anchor="right" width={320}>
468
+ <div style={{ padding: 24 }}>Drawer content</div>
469
+ </Drawer>
470
+ ```
471
+
472
+ ---
473
+
474
+ ### Snackbar
475
+
476
+ ```tsx
477
+ import { Snackbar } from "@rufous/ui";
478
+
479
+ <Snackbar
480
+ open={open}
481
+ onClose={() => setOpen(false)}
482
+ message="Changes saved successfully"
483
+ severity="success"
484
+ autoHideDuration={4000}
485
+ anchorOrigin={{ vertical: "bottom", horizontal: "left" }}
486
+ />
487
+ ```
488
+
489
+ ---
490
+
491
+ ### Link
492
+
493
+ ```tsx
494
+ import { Link } from "@rufous/ui";
495
+
496
+ <Link href="/docs" color="primary">Documentation</Link>
497
+ <Link component="button" color="primary" onClick={fn}>Trigger action</Link>
498
+ ```
499
+
500
+ ---
501
+
502
+ ### Popper / Popover
503
+
504
+ ```tsx
505
+ import { Popper, Popover } from "@rufous/ui";
506
+
507
+ // Popper — no backdrop, low-level
508
+ <Popper open={open} anchorEl={anchorRef.current} placement="bottom-start">
509
+ <div>Custom dropdown content</div>
510
+ </Popper>
511
+
512
+ // Popover — backdrop, closes on outside click
513
+ <Popover open={open} anchorEl={anchorRef.current} onClose={() => setOpen(false)}>
514
+ <div style={{ padding: 20 }}>Popover content</div>
515
+ </Popover>
516
+ ```
517
+
518
+ ---
519
+
520
+ ### Transitions
521
+
522
+ ```tsx
523
+ import { Fade, Slide, Grow, Collapse, Zoom } from "@rufous/ui";
524
+
525
+ <Fade in={show}><div>Fades in/out</div></Fade>
526
+ <Slide in={show} direction="up"><div>Slides in from bottom</div></Slide>
527
+ <Grow in={show}><div>Grows from center</div></Grow>
528
+ <Collapse in={show}><div>Collapses vertically</div></Collapse>
529
+ <Zoom in={show}><div>Zooms in/out</div></Zoom>
530
+ ```
531
+
532
+ ---
533
+
534
+ ### Icons
535
+
536
+ ```tsx
537
+ import { CopyIcon, EditIcon, TrashIcon, DownloadIcon } from "@rufous/ui";
538
+
539
+ <CopyIcon onClick={() => copy(text)} />
540
+ <EditIcon />
541
+ <TrashIcon />
542
+ <DownloadIcon />
543
+ ```
544
+
545
+ ---
205
546
 
206
- <FloatingInput
207
- label="Your Name"
208
- name="name"
209
- value={name}
210
- onChange={(e) => setName(e.target.value)}
211
- required
212
- />
547
+ ## The `sx` Prop
213
548
 
214
- <Checkbox label="Accept Terms" />
549
+ Every component accepts an `sx` prop for scoped, per-instance style overrides using nested CSS selectors. Values are injected as a scoped `<style>` tag — no inline style conflicts.
215
550
 
216
- <div style={{ marginTop: "10px" }}>
217
- <Button
218
- onClick={() => previewTheme(APP_THEMES.default.name.toLowerCase())}
219
- >
220
- Light Theme
221
- </Button>
222
- <Button
223
- onClick={() => previewTheme(APP_THEMES.rufous.name.toLowerCase())}
224
- >
225
- Dark Theme
226
- </Button>
227
- </div>
551
+ ```tsx
552
+ import { TextField } from "@rufous/ui";
553
+ import type { SxProp } from "@rufous/ui";
228
554
 
229
- <div style={{ display: "flex", gap: "10px", marginTop: "10px" }}>
230
- <CopyIcon onClick={() => alert("Copied!")} />
231
- <EditIcon onClick={() => alert("Edit clicked!")} />
232
- </div>
233
- </div>
234
- );
235
- }
555
+ <TextField
556
+ label="Search"
557
+ sx={{
558
+ borderRadius: "12px",
559
+ "& .rf-text-field__input": { fontSize: "0.9rem" },
560
+ "&:hover": { boxShadow: "0 0 0 3px rgba(164,27,6,0.15)" },
561
+ }}
562
+ />
236
563
  ```
237
564
 
238
565
  ---
239
566
 
240
- ## 📄 License
567
+ ## License
241
568
 
242
569
  MIT © Rufous UI