@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.
- package/README.md +485 -158
- package/dist/{Buttons/Button.cjs → chunk-LI4N7JWK.js} +11 -14
- package/dist/esm-5T53WHPT.js +27362 -0
- package/dist/main.cjs +36982 -762
- package/dist/main.css +13256 -193
- package/dist/main.d.cts +1526 -15
- package/dist/main.d.ts +1526 -15
- package/dist/main.js +8039 -45
- package/package.json +14 -3
- package/dist/Buttons/Button.d.cjs +0 -17
- package/dist/Buttons/Button.d.cts +0 -10
- package/dist/Buttons/Button.d.d.cts +0 -10
- package/dist/Buttons/Button.d.d.ts +0 -10
- package/dist/Buttons/Button.d.js +0 -0
- package/dist/Buttons/Button.d.ts +0 -10
- package/dist/Buttons/Button.js +0 -6
- package/dist/CheckBoxes/CheckBox.cjs +0 -62
- package/dist/CheckBoxes/CheckBox.d.cjs +0 -17
- package/dist/CheckBoxes/CheckBox.d.cts +0 -15
- package/dist/CheckBoxes/CheckBox.d.d.cts +0 -15
- package/dist/CheckBoxes/CheckBox.d.d.ts +0 -15
- package/dist/CheckBoxes/CheckBox.d.js +0 -0
- package/dist/CheckBoxes/CheckBox.d.ts +0 -15
- package/dist/CheckBoxes/CheckBox.js +0 -6
- package/dist/Contexts/rufousThemeProvider.cjs +0 -177
- package/dist/Contexts/rufousThemeProvider.d.cts +0 -8
- package/dist/Contexts/rufousThemeProvider.d.ts +0 -8
- package/dist/Contexts/rufousThemeProvider.js +0 -9
- package/dist/TextFields/FloatingInput.cjs +0 -65
- package/dist/TextFields/FloatingInput.d.cjs +0 -17
- package/dist/TextFields/FloatingInput.d.cts +0 -23
- package/dist/TextFields/FloatingInput.d.d.cts +0 -23
- package/dist/TextFields/FloatingInput.d.d.ts +0 -23
- package/dist/TextFields/FloatingInput.d.js +0 -0
- package/dist/TextFields/FloatingInput.d.ts +0 -23
- package/dist/TextFields/FloatingInput.js +0 -6
- package/dist/chunk-2FHTGYR4.js +0 -83
- package/dist/chunk-3IBCGGN3.js +0 -48
- package/dist/chunk-6FEUS4CQ.js +0 -41
- package/dist/chunk-73G3VTVS.js +0 -48
- package/dist/chunk-ASP3DBRX.js +0 -9
- package/dist/chunk-AWA5Y5LH.js +0 -32
- package/dist/chunk-BCGCLMKA.js +0 -71
- package/dist/chunk-D7SFBVJY.js +0 -155
- package/dist/chunk-H372BAXA.js +0 -42
- package/dist/chunk-PULIGWAP.js +0 -62
- package/dist/chunk-QJPQC544.js +0 -29
- package/dist/chunk-QKDJLUKZ.js +0 -29
- package/dist/chunk-QZFGQ5JM.js +0 -157
- package/dist/chunk-WZAU77G7.js +0 -55
- package/dist/chunk-ZZ37BKUK.js +0 -0
- package/dist/icons/archivedIcon.cjs +0 -77
- package/dist/icons/archivedIcon.d.cts +0 -8
- package/dist/icons/archivedIcon.d.ts +0 -8
- package/dist/icons/archivedIcon.js +0 -6
- package/dist/icons/copyIcon.cjs +0 -70
- package/dist/icons/copyIcon.d.cts +0 -8
- package/dist/icons/copyIcon.d.ts +0 -8
- package/dist/icons/copyIcon.js +0 -6
- package/dist/icons/editIcon.cjs +0 -71
- package/dist/icons/editIcon.d.cts +0 -8
- package/dist/icons/editIcon.d.ts +0 -8
- package/dist/icons/editIcon.js +0 -6
- package/dist/icons/helpOutlinedIcon.cjs +0 -91
- package/dist/icons/helpOutlinedIcon.d.cts +0 -8
- package/dist/icons/helpOutlinedIcon.d.ts +0 -8
- package/dist/icons/helpOutlinedIcon.js +0 -6
- package/dist/icons/hierarchyIcon.cjs +0 -84
- package/dist/icons/hierarchyIcon.d.cts +0 -8
- package/dist/icons/hierarchyIcon.d.ts +0 -8
- package/dist/icons/hierarchyIcon.js +0 -6
- package/dist/icons/index.cjs +0 -664
- package/dist/icons/index.d.cts +0 -10
- package/dist/icons/index.d.ts +0 -10
- package/dist/icons/index.js +0 -39
- package/dist/icons/nineDotMenuIcon.cjs +0 -184
- package/dist/icons/nineDotMenuIcon.d.cts +0 -8
- package/dist/icons/nineDotMenuIcon.d.ts +0 -8
- package/dist/icons/nineDotMenuIcon.js +0 -6
- package/dist/icons/rufousLauncherBird.cjs +0 -186
- package/dist/icons/rufousLauncherBird.d.cts +0 -8
- package/dist/icons/rufousLauncherBird.d.ts +0 -8
- package/dist/icons/rufousLauncherBird.js +0 -6
- package/dist/icons/unArchivedIcon.cjs +0 -77
- package/dist/icons/unArchivedIcon.d.cts +0 -8
- package/dist/icons/unArchivedIcon.d.ts +0 -8
- package/dist/icons/unArchivedIcon.js +0 -6
- package/dist/icons/workItemIcon.cjs +0 -58
- package/dist/icons/workItemIcon.d.cts +0 -8
- package/dist/icons/workItemIcon.d.ts +0 -8
- package/dist/icons/workItemIcon.js +0 -6
- package/dist/style.css +0 -246
- package/dist/style.d.cts +0 -2
- package/dist/style.d.ts +0 -2
- package/dist/utils/constants.cjs +0 -106
- package/dist/utils/constants.d.cts +0 -80
- package/dist/utils/constants.d.ts +0 -80
- package/dist/utils/constants.js +0 -6
package/README.md
CHANGED
|
@@ -1,242 +1,569 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Rufous UI
|
|
2
2
|
|
|
3
|
-
A
|
|
4
|
-
|
|
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
|
-
##
|
|
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
|
-
##
|
|
19
|
+
## Setup
|
|
23
20
|
|
|
24
|
-
|
|
21
|
+
Import the global styles once in your app entry:
|
|
25
22
|
|
|
26
|
-
```
|
|
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
|
-
##
|
|
42
|
+
## Components
|
|
43
|
+
|
|
44
|
+
### Buttons
|
|
33
45
|
|
|
34
|
-
|
|
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
|
-
###
|
|
64
|
+
### TextField
|
|
39
65
|
|
|
40
|
-
```
|
|
41
|
-
import
|
|
42
|
-
import { Button } from "@rufous/ui";
|
|
43
|
-
import "@rufous/ui/style.css";
|
|
66
|
+
```tsx
|
|
67
|
+
import { TextField } from "@rufous/ui";
|
|
44
68
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
###
|
|
92
|
+
### Select
|
|
55
93
|
|
|
56
|
-
```
|
|
57
|
-
import
|
|
58
|
-
import { FloatingInput } from "@rufous/ui";
|
|
59
|
-
import "@rufous/ui/style.css";
|
|
94
|
+
```tsx
|
|
95
|
+
import { Select } from "@rufous/ui";
|
|
60
96
|
|
|
61
|
-
|
|
62
|
-
|
|
97
|
+
<Select
|
|
98
|
+
options={[{ value: "us", label: "United States" }]}
|
|
99
|
+
value={country}
|
|
100
|
+
onChange={setCountry}
|
|
101
|
+
label="Country"
|
|
102
|
+
/>
|
|
63
103
|
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
###
|
|
110
|
+
### DateField / DateRangeField
|
|
79
111
|
|
|
80
|
-
```
|
|
81
|
-
import
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
86
|
-
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
### Autocomplete
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
import { Autocomplete } from "@rufous/ui";
|
|
87
130
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
###
|
|
141
|
+
### Checkbox
|
|
108
142
|
|
|
109
|
-
```
|
|
110
|
-
import React from "react";
|
|
143
|
+
```tsx
|
|
111
144
|
import { Checkbox } from "@rufous/ui";
|
|
112
|
-
import "@rufous/ui/style.css";
|
|
113
145
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
###
|
|
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
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
134
|
-
|
|
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
|
-
|
|
197
|
+
### Switch
|
|
146
198
|
|
|
147
|
-
|
|
199
|
+
```tsx
|
|
200
|
+
import { Switch } from "@rufous/ui";
|
|
148
201
|
|
|
149
|
-
|
|
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
|
-
###
|
|
207
|
+
### RadioGroup
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
import { RadioGroup, Radio } from "@rufous/ui";
|
|
158
211
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
###
|
|
223
|
+
### Rating
|
|
224
|
+
|
|
225
|
+
```tsx
|
|
226
|
+
import { Rating } from "@rufous/ui";
|
|
170
227
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
|
|
234
|
+
### ToggleButton
|
|
180
235
|
|
|
181
|
-
|
|
236
|
+
```tsx
|
|
237
|
+
import { ToggleButtonGroup, ToggleButton } from "@rufous/ui";
|
|
182
238
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
201
|
-
<div style={{ padding: "20px" }}>
|
|
202
|
-
<h1>Rufous UI Demo</h1>
|
|
445
|
+
### Menu
|
|
203
446
|
|
|
204
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
##
|
|
567
|
+
## License
|
|
241
568
|
|
|
242
569
|
MIT © Rufous UI
|