@rhavenside/custom-ui-library 1.0.1 → 1.0.3
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 +539 -140
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @rhavenside/custom-ui-library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A reusable React UI component library with CSS variables for complete customization.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ Eine wiederverwendbare React UI-Komponenten-Bibliothek mit CSS-Variablen für vo
|
|
|
8
8
|
npm install @rhavenside/custom-ui-library
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Usage
|
|
12
12
|
|
|
13
13
|
### JavaScript Import
|
|
14
14
|
|
|
@@ -19,56 +19,467 @@ import { Button, Input, Modal, Progress } from '@rhavenside/custom-ui-library';
|
|
|
19
19
|
### CSS Import
|
|
20
20
|
|
|
21
21
|
```javascript
|
|
22
|
+
// Option 1: Direct path (recommended for Vite projects)
|
|
22
23
|
import '@rhavenside/custom-ui-library/dist/style.css';
|
|
24
|
+
|
|
25
|
+
// Option 2: Using the exports field (may require package reinstall)
|
|
26
|
+
import '@rhavenside/custom-ui-library/style.css';
|
|
23
27
|
```
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
**Note:** If the CSS import doesn't resolve:
|
|
30
|
+
1. Make sure you've installed the latest version: `npm install @rhavenside/custom-ui-library@latest`
|
|
31
|
+
2. Try using the direct path: `import '@rhavenside/custom-ui-library/dist/style.css'`
|
|
32
|
+
3. If using Vite, you may need to restart the dev server after installing the package
|
|
33
|
+
|
|
34
|
+
### Example
|
|
26
35
|
|
|
27
36
|
```jsx
|
|
28
37
|
import React from 'react';
|
|
29
38
|
import { Button, Input, Modal } from '@rhavenside/custom-ui-library';
|
|
30
|
-
import '@rhavenside/custom-ui-library/
|
|
39
|
+
import '@rhavenside/custom-ui-library/style.css';
|
|
31
40
|
|
|
32
41
|
function App() {
|
|
33
42
|
return (
|
|
34
43
|
<div>
|
|
35
|
-
<Button variant="primary">
|
|
36
|
-
<Input label="Name" placeholder="
|
|
44
|
+
<Button variant="primary">Click me</Button>
|
|
45
|
+
<Input label="Name" placeholder="Your name" />
|
|
37
46
|
<Modal isOpen={true} onClose={() => {}}>
|
|
38
|
-
<h2>Modal
|
|
39
|
-
<p>Modal
|
|
47
|
+
<h2>Modal Title</h2>
|
|
48
|
+
<p>Modal Content</p>
|
|
40
49
|
</Modal>
|
|
41
50
|
</div>
|
|
42
51
|
);
|
|
43
52
|
}
|
|
44
53
|
```
|
|
45
54
|
|
|
46
|
-
##
|
|
55
|
+
## Components
|
|
56
|
+
|
|
57
|
+
- **Button** - Customizable buttons with various variants
|
|
58
|
+
- **Input** - Text input fields with labels and error states
|
|
59
|
+
- **Modal** - Modals with various sizes and positions
|
|
60
|
+
- **Card** - Card components for content display
|
|
61
|
+
- **Badge** - Badges with various variants
|
|
62
|
+
- **Dropdown** - Dropdown menus with options
|
|
63
|
+
- **Toggle** - Toggle/Switch components
|
|
64
|
+
- **Textarea** - Multi-line text input fields
|
|
65
|
+
- **Select** - Select dropdowns with custom dropdown
|
|
66
|
+
- **Checkbox** - Checkbox components
|
|
67
|
+
- **Radio** - Radio button components
|
|
68
|
+
- **Progress** - Horizontal progress bars
|
|
69
|
+
- **ProgressRadio** - Progress bars with radio button control
|
|
70
|
+
- **ProgressCircle** - Circular progress bars (HSL-based)
|
|
71
|
+
- **ProgressBubble** - Progress bars with water effect
|
|
72
|
+
|
|
73
|
+
## Component API (Props)
|
|
74
|
+
|
|
75
|
+
### Button
|
|
76
|
+
|
|
77
|
+
```jsx
|
|
78
|
+
<Button
|
|
79
|
+
variant="primary" // 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'outline' | 'ghost' | 'link'
|
|
80
|
+
size="medium" // 'small' | 'medium' | 'large'
|
|
81
|
+
disabled={false} // boolean
|
|
82
|
+
loading={false} // boolean - shows spinner
|
|
83
|
+
icon={null} // ReactNode - Icon-Element
|
|
84
|
+
iconPosition="left" // 'left' | 'right'
|
|
85
|
+
fullWidth={false} // boolean
|
|
86
|
+
type="button" // 'button' | 'submit' | 'reset'
|
|
87
|
+
onClick={handler} // function
|
|
88
|
+
className="" // string
|
|
89
|
+
style={{}} // object - inline styles
|
|
90
|
+
>
|
|
91
|
+
Button Text
|
|
92
|
+
</Button>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Input
|
|
96
|
+
|
|
97
|
+
```jsx
|
|
98
|
+
<Input
|
|
99
|
+
type="text" // string - HTML input type
|
|
100
|
+
variant="default" // 'default' | 'filled' | 'outlined'
|
|
101
|
+
label="Label" // string
|
|
102
|
+
placeholder="Placeholder" // string
|
|
103
|
+
value={value} // string (controlled)
|
|
104
|
+
defaultValue="" // string (uncontrolled)
|
|
105
|
+
error="Error message" // string
|
|
106
|
+
helperText="Helper text" // string
|
|
107
|
+
icon={null} // ReactNode
|
|
108
|
+
iconPosition="left" // 'left' | 'right'
|
|
109
|
+
disabled={false} // boolean
|
|
110
|
+
required={false} // boolean
|
|
111
|
+
fullWidth={false} // boolean
|
|
112
|
+
floatingLabel={false} // boolean
|
|
113
|
+
onChange={handler} // function
|
|
114
|
+
onFocus={handler} // function
|
|
115
|
+
onBlur={handler} // function
|
|
116
|
+
className="" // string
|
|
117
|
+
style={{}} // object
|
|
118
|
+
wrapperStyle={{}} // object
|
|
119
|
+
inputStyle={{}} // object
|
|
120
|
+
/>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Modal
|
|
124
|
+
|
|
125
|
+
```jsx
|
|
126
|
+
<Modal
|
|
127
|
+
isOpen={false} // boolean
|
|
128
|
+
onClose={handler} // function
|
|
129
|
+
title="Modal Title" // string
|
|
130
|
+
size="medium" // 'small' | 'medium' | 'large' | 'xlarge'
|
|
131
|
+
variant="center" // 'center' | 'top' | 'bottom' | 'left' | 'right'
|
|
132
|
+
closeOnOverlayClick={true} // boolean
|
|
133
|
+
showCloseButton={true} // boolean
|
|
134
|
+
footer={null} // ReactNode
|
|
135
|
+
className="" // string
|
|
136
|
+
style={{}} // object
|
|
137
|
+
overlayStyle={{}} // object
|
|
138
|
+
>
|
|
139
|
+
Modal Content
|
|
140
|
+
</Modal>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Card
|
|
144
|
+
|
|
145
|
+
```jsx
|
|
146
|
+
<Card
|
|
147
|
+
variant="default" // 'default' | 'outlined' | 'elevated'
|
|
148
|
+
hover={false} // boolean - hover effect
|
|
149
|
+
padding="medium" // 'none' | 'small' | 'medium' | 'large'
|
|
150
|
+
title="Card Title" // string
|
|
151
|
+
subtitle="Subtitle" // string
|
|
152
|
+
image="url" // string
|
|
153
|
+
imageAlt="Alt text" // string
|
|
154
|
+
actions={null} // ReactNode - Footer-Actions
|
|
155
|
+
onClick={handler} // function
|
|
156
|
+
className="" // string
|
|
157
|
+
style={{}} // object
|
|
158
|
+
>
|
|
159
|
+
Card Content
|
|
160
|
+
</Card>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Badge
|
|
164
|
+
|
|
165
|
+
```jsx
|
|
166
|
+
<Badge
|
|
167
|
+
text="Badge" // string - or use children
|
|
168
|
+
variant="default" // 'default' | 'primary' | 'success' | 'danger' | 'warning' | 'info'
|
|
169
|
+
size="medium" // 'small' | 'medium' | 'large'
|
|
170
|
+
className="" // string
|
|
171
|
+
style={{}} // object
|
|
172
|
+
>
|
|
173
|
+
Badge Text
|
|
174
|
+
</Badge>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Dropdown
|
|
178
|
+
|
|
179
|
+
```jsx
|
|
180
|
+
<Dropdown
|
|
181
|
+
options={[]} // Array<{value: any, label: string, disabled?: boolean}>
|
|
182
|
+
value={value} // any (controlled)
|
|
183
|
+
defaultValue={null} // any (uncontrolled)
|
|
184
|
+
onChange={handler} // function
|
|
185
|
+
placeholder="Select..." // string
|
|
186
|
+
disabled={false} // boolean
|
|
187
|
+
searchable={false} // boolean
|
|
188
|
+
multiSelect={false} // boolean
|
|
189
|
+
error={false} // boolean
|
|
190
|
+
className="" // string
|
|
191
|
+
style={{}} // object
|
|
192
|
+
triggerStyle={{}} // object
|
|
193
|
+
menuStyle={{}} // object
|
|
194
|
+
/>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Select
|
|
198
|
+
|
|
199
|
+
```jsx
|
|
200
|
+
<Select
|
|
201
|
+
options={[]} // Array<{value: any, label: string, disabled?: boolean}>
|
|
202
|
+
value={value} // any (controlled)
|
|
203
|
+
defaultValue={null} // any (uncontrolled)
|
|
204
|
+
onChange={handler} // function - receives synthetic event
|
|
205
|
+
placeholder="Select..." // string
|
|
206
|
+
label="Label" // string
|
|
207
|
+
error="Error message" // string
|
|
208
|
+
helperText="Helper text" // string
|
|
209
|
+
disabled={false} // boolean
|
|
210
|
+
required={false} // boolean
|
|
211
|
+
fullWidth={false} // boolean
|
|
212
|
+
searchable={false} // boolean
|
|
213
|
+
name="select" // string
|
|
214
|
+
className="" // string
|
|
215
|
+
style={{}} // object
|
|
216
|
+
/>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Toggle
|
|
220
|
+
|
|
221
|
+
```jsx
|
|
222
|
+
<Toggle
|
|
223
|
+
checked={false} // boolean
|
|
224
|
+
onChange={handler} // function(checked: boolean)
|
|
225
|
+
disabled={false} // boolean
|
|
226
|
+
size="medium" // 'small' | 'medium' | 'large'
|
|
227
|
+
variant="default" // 'default' | 'primary' | 'success' | 'danger' | 'warning' | 'info'
|
|
228
|
+
label="Toggle Label" // string
|
|
229
|
+
labelPosition="right" // 'left' | 'right'
|
|
230
|
+
className="" // string
|
|
231
|
+
style={{}} // object
|
|
232
|
+
switchStyle={{}} // object
|
|
233
|
+
/>
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Textarea
|
|
237
|
+
|
|
238
|
+
```jsx
|
|
239
|
+
<Textarea
|
|
240
|
+
variant="default" // 'default' | 'filled' | 'outlined'
|
|
241
|
+
label="Label" // string
|
|
242
|
+
placeholder="Placeholder" // string
|
|
243
|
+
value={value} // string (controlled)
|
|
244
|
+
defaultValue="" // string (uncontrolled)
|
|
245
|
+
error="Error message" // string
|
|
246
|
+
helperText="Helper text" // string
|
|
247
|
+
disabled={false} // boolean
|
|
248
|
+
required={false} // boolean
|
|
249
|
+
fullWidth={false} // boolean
|
|
250
|
+
rows={4} // number
|
|
251
|
+
resize="vertical" // 'none' | 'both' | 'horizontal' | 'vertical'
|
|
252
|
+
onChange={handler} // function
|
|
253
|
+
onFocus={handler} // function
|
|
254
|
+
onBlur={handler} // function
|
|
255
|
+
className="" // string
|
|
256
|
+
style={{}} // object
|
|
257
|
+
wrapperStyle={{}} // object
|
|
258
|
+
textareaStyle={{}} // object
|
|
259
|
+
/>
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Checkbox
|
|
263
|
+
|
|
264
|
+
```jsx
|
|
265
|
+
<Checkbox
|
|
266
|
+
checked={false} // boolean
|
|
267
|
+
onChange={handler} // function(checked: boolean)
|
|
268
|
+
disabled={false} // boolean
|
|
269
|
+
label="Checkbox Label" // string
|
|
270
|
+
labelPosition="right" // 'left' | 'right'
|
|
271
|
+
size="medium" // 'small' | 'medium' | 'large'
|
|
272
|
+
variant="default" // 'default' | 'primary' | 'success' | 'danger' | 'warning' | 'info'
|
|
273
|
+
indeterminate={false} // boolean
|
|
274
|
+
className="" // string
|
|
275
|
+
style={{}} // object
|
|
276
|
+
boxStyle={{}} // object
|
|
277
|
+
/>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Radio
|
|
281
|
+
|
|
282
|
+
```jsx
|
|
283
|
+
<Radio
|
|
284
|
+
checked={false} // boolean
|
|
285
|
+
onChange={handler} // function(value: any)
|
|
286
|
+
disabled={false} // boolean
|
|
287
|
+
label="Radio Label" // string
|
|
288
|
+
labelPosition="right" // 'left' | 'right'
|
|
289
|
+
size="medium" // 'small' | 'medium' | 'large'
|
|
290
|
+
variant="default" // 'default' | 'primary' | 'success' | 'danger' | 'warning' | 'info'
|
|
291
|
+
name="radio-group" // string - for radio groups
|
|
292
|
+
value="radio-value" // any
|
|
293
|
+
className="" // string
|
|
294
|
+
style={{}} // object
|
|
295
|
+
circleStyle={{}} // object
|
|
296
|
+
/>
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Progress
|
|
300
|
+
|
|
301
|
+
```jsx
|
|
302
|
+
<Progress
|
|
303
|
+
value={50} // number - current value
|
|
304
|
+
max={100} // number - maximum value
|
|
305
|
+
variant="default" // 'default' | 'success' | 'danger' | 'warning' | 'info'
|
|
306
|
+
size="medium" // 'small' | 'medium' | 'large'
|
|
307
|
+
showLabel={false} // boolean - shows percentage
|
|
308
|
+
label="50%" // string - custom label
|
|
309
|
+
animated={false} // boolean - enable animation
|
|
310
|
+
striped={false} // boolean - striped pattern
|
|
311
|
+
pulse={false} // boolean - pulse animation
|
|
312
|
+
shimmer={false} // boolean - shimmer animation
|
|
313
|
+
animationSpeed="normal" // 'slow' | 'normal' | 'fast' | number (seconds)
|
|
314
|
+
vertical={false} // boolean - vertical orientation
|
|
315
|
+
className="" // string
|
|
316
|
+
style={{}} // object
|
|
317
|
+
barStyle={{}} // object
|
|
318
|
+
/>
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### ProgressRadio
|
|
322
|
+
|
|
323
|
+
```jsx
|
|
324
|
+
<ProgressRadio
|
|
325
|
+
options={[ // Array<{value: number, label: string, color: string}>
|
|
326
|
+
{ value: 5, label: '5%', color: '#f63a0f' },
|
|
327
|
+
{ value: 25, label: '25%', color: '#f27011' },
|
|
328
|
+
{ value: 50, label: '50%', color: '#f2b01e' },
|
|
329
|
+
{ value: 75, label: '75%', color: '#f2d31b' },
|
|
330
|
+
{ value: 100, label: '100%', color: '#86e01e' }
|
|
331
|
+
]}
|
|
332
|
+
defaultValue={25} // number
|
|
333
|
+
name="progress" // string
|
|
334
|
+
className="" // string
|
|
335
|
+
style={{}} // object
|
|
336
|
+
barStyle={{}} // object
|
|
337
|
+
/>
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### ProgressCircle
|
|
47
341
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- **ProgressCircle** - Kreisförmige Progress Bars (HSL-basiert)
|
|
62
|
-
- **ProgressBubble** - Progress Bars mit Wasser-Effekt
|
|
342
|
+
```jsx
|
|
343
|
+
<ProgressCircle
|
|
344
|
+
value={50} // number - current value
|
|
345
|
+
max={100} // number - maximum value
|
|
346
|
+
size="medium" // 'small' | 'medium' | 'large'
|
|
347
|
+
showLabel={false} // boolean - shows percentage
|
|
348
|
+
label="50%" // string - custom label
|
|
349
|
+
textFormat={(value) => `${value}%`} // function - custom text formatting
|
|
350
|
+
animationDuration={400} // number - animation duration in ms
|
|
351
|
+
className="" // string
|
|
352
|
+
style={{}} // object
|
|
353
|
+
/>
|
|
354
|
+
```
|
|
63
355
|
|
|
64
|
-
|
|
356
|
+
### ProgressBubble
|
|
65
357
|
|
|
66
|
-
|
|
358
|
+
```jsx
|
|
359
|
+
<ProgressBubble
|
|
360
|
+
value={50} // number - current value
|
|
361
|
+
max={100} // number - maximum value
|
|
362
|
+
size="medium" // 'small' | 'medium' | 'large'
|
|
363
|
+
showLabel={false} // boolean - shows percentage
|
|
364
|
+
label="50%" // string - custom label
|
|
365
|
+
animationSpeed="normal" // 'slow' | 'normal' | 'fast' | number (seconds)
|
|
366
|
+
animateCounter={false} // boolean - animates counter with jQuery
|
|
367
|
+
counterDuration={5000} // number - counter animation duration in ms
|
|
368
|
+
className="" // string
|
|
369
|
+
style={{}} // object
|
|
370
|
+
/>
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**Note:** All components additionally support:
|
|
374
|
+
- `className` - for additional CSS classes
|
|
375
|
+
- `style` - for inline styles
|
|
376
|
+
- Additional HTML attributes are passed through via `{...props}`
|
|
377
|
+
|
|
378
|
+
### Practical Examples
|
|
67
379
|
|
|
68
|
-
|
|
380
|
+
#### Button with Icon and Loading State
|
|
381
|
+
|
|
382
|
+
```jsx
|
|
383
|
+
import { Button } from '@rhavenside/custom-ui-library';
|
|
384
|
+
|
|
385
|
+
<Button
|
|
386
|
+
variant="primary"
|
|
387
|
+
size="large"
|
|
388
|
+
icon={<Icon />}
|
|
389
|
+
iconPosition="left"
|
|
390
|
+
loading={isLoading}
|
|
391
|
+
onClick={handleSubmit}
|
|
392
|
+
>
|
|
393
|
+
Save
|
|
394
|
+
</Button>
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
#### Input with Floating Label and Validation
|
|
398
|
+
|
|
399
|
+
```jsx
|
|
400
|
+
import { Input } from '@rhavenside/custom-ui-library';
|
|
401
|
+
|
|
402
|
+
<Input
|
|
403
|
+
type="email"
|
|
404
|
+
label="Email"
|
|
405
|
+
floatingLabel={true}
|
|
406
|
+
required={true}
|
|
407
|
+
error={errors.email}
|
|
408
|
+
helperText="Please enter a valid email address"
|
|
409
|
+
icon={<MailIcon />}
|
|
410
|
+
iconPosition="left"
|
|
411
|
+
value={email}
|
|
412
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
413
|
+
/>
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
#### Modal with Footer Actions
|
|
417
|
+
|
|
418
|
+
```jsx
|
|
419
|
+
import { Modal, Button } from '@rhavenside/custom-ui-library';
|
|
420
|
+
|
|
421
|
+
<Modal
|
|
422
|
+
isOpen={isOpen}
|
|
423
|
+
onClose={() => setIsOpen(false)}
|
|
424
|
+
title="Confirmation"
|
|
425
|
+
size="medium"
|
|
426
|
+
footer={
|
|
427
|
+
<>
|
|
428
|
+
<Button variant="outline" onClick={() => setIsOpen(false)}>
|
|
429
|
+
Cancel
|
|
430
|
+
</Button>
|
|
431
|
+
<Button variant="primary" onClick={handleConfirm}>
|
|
432
|
+
Confirm
|
|
433
|
+
</Button>
|
|
434
|
+
</>
|
|
435
|
+
}
|
|
436
|
+
>
|
|
437
|
+
Are you sure you want to continue?
|
|
438
|
+
</Modal>
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
#### Progress with Animations
|
|
442
|
+
|
|
443
|
+
```jsx
|
|
444
|
+
import { Progress } from '@rhavenside/custom-ui-library';
|
|
445
|
+
|
|
446
|
+
<Progress
|
|
447
|
+
value={75}
|
|
448
|
+
variant="success"
|
|
449
|
+
animated={true}
|
|
450
|
+
striped={true}
|
|
451
|
+
pulse={true}
|
|
452
|
+
showLabel={true}
|
|
453
|
+
animationSpeed="fast"
|
|
454
|
+
/>
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
#### Dropdown with Search and Multi-Select
|
|
458
|
+
|
|
459
|
+
```jsx
|
|
460
|
+
import { Dropdown } from '@rhavenside/custom-ui-library';
|
|
461
|
+
|
|
462
|
+
<Dropdown
|
|
463
|
+
options={[
|
|
464
|
+
{ value: '1', label: 'Option 1' },
|
|
465
|
+
{ value: '2', label: 'Option 2' },
|
|
466
|
+
{ value: '3', label: 'Option 3' }
|
|
467
|
+
]}
|
|
468
|
+
searchable={true}
|
|
469
|
+
multiSelect={true}
|
|
470
|
+
placeholder="Select multiple..."
|
|
471
|
+
onChange={(values) => console.log(values)}
|
|
472
|
+
/>
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
## CSS Variables Override
|
|
476
|
+
|
|
477
|
+
All components use CSS Custom Properties that can be overridden.
|
|
478
|
+
|
|
479
|
+
### Global Override
|
|
69
480
|
|
|
70
481
|
```css
|
|
71
|
-
/* In
|
|
482
|
+
/* In your project */
|
|
72
483
|
:root {
|
|
73
484
|
--btn-bg: #ff6b6b;
|
|
74
485
|
--btn-color: #ffffff;
|
|
@@ -82,10 +493,10 @@ Alle Komponenten verwenden CSS Custom Properties, die überschrieben werden kön
|
|
|
82
493
|
}
|
|
83
494
|
```
|
|
84
495
|
|
|
85
|
-
###
|
|
496
|
+
### Contextual Override
|
|
86
497
|
|
|
87
498
|
```css
|
|
88
|
-
/*
|
|
499
|
+
/* Only for specific areas */
|
|
89
500
|
.dark-theme {
|
|
90
501
|
--btn-bg: #1e40af;
|
|
91
502
|
--btn-color: #f3f4f6;
|
|
@@ -94,128 +505,128 @@ Alle Komponenten verwenden CSS Custom Properties, die überschrieben werden kön
|
|
|
94
505
|
}
|
|
95
506
|
```
|
|
96
507
|
|
|
97
|
-
##
|
|
508
|
+
## Available CSS Variables
|
|
98
509
|
|
|
99
510
|
### Button
|
|
100
|
-
- `--btn-bg` -
|
|
101
|
-
- `--btn-bg-hover` -
|
|
102
|
-
- `--btn-bg-active` -
|
|
103
|
-
- `--btn-color` -
|
|
104
|
-
- `--btn-radius` -
|
|
105
|
-
- `--btn-padding-x` -
|
|
106
|
-
- `--btn-padding-y` -
|
|
107
|
-
- `--btn-font-size` -
|
|
108
|
-
- `--btn-font-weight` -
|
|
109
|
-
- `--btn-shadow` -
|
|
110
|
-
- `--btn-shadow-hover` -
|
|
111
|
-
- `--btn-transition` -
|
|
511
|
+
- `--btn-bg` - background color
|
|
512
|
+
- `--btn-bg-hover` - hover background color
|
|
513
|
+
- `--btn-bg-active` - active background color
|
|
514
|
+
- `--btn-color` - text color
|
|
515
|
+
- `--btn-radius` - border radius
|
|
516
|
+
- `--btn-padding-x` - horizontal padding
|
|
517
|
+
- `--btn-padding-y` - vertical padding
|
|
518
|
+
- `--btn-font-size` - font size
|
|
519
|
+
- `--btn-font-weight` - font weight
|
|
520
|
+
- `--btn-shadow` - box shadow
|
|
521
|
+
- `--btn-shadow-hover` - hover box shadow
|
|
522
|
+
- `--btn-transition` - transition
|
|
112
523
|
|
|
113
524
|
### Input
|
|
114
|
-
- `--input-bg` -
|
|
115
|
-
- `--input-border` -
|
|
116
|
-
- `--input-border-focus` -
|
|
117
|
-
- `--input-color` -
|
|
118
|
-
- `--input-placeholder-color` -
|
|
119
|
-
- `--input-radius` -
|
|
120
|
-
- `--input-padding-x` -
|
|
121
|
-
- `--input-padding-y` -
|
|
122
|
-
- `--input-font-size` -
|
|
123
|
-
- `--input-shadow-focus` -
|
|
525
|
+
- `--input-bg` - background color
|
|
526
|
+
- `--input-border` - border
|
|
527
|
+
- `--input-border-focus` - focus border
|
|
528
|
+
- `--input-color` - text color
|
|
529
|
+
- `--input-placeholder-color` - placeholder color
|
|
530
|
+
- `--input-radius` - border radius
|
|
531
|
+
- `--input-padding-x` - horizontal padding
|
|
532
|
+
- `--input-padding-y` - vertical padding
|
|
533
|
+
- `--input-font-size` - font size
|
|
534
|
+
- `--input-shadow-focus` - focus box shadow
|
|
124
535
|
|
|
125
536
|
### Modal
|
|
126
|
-
- `--modal-bg` -
|
|
127
|
-
- `--modal-overlay-bg` -
|
|
128
|
-
- `--modal-radius` -
|
|
129
|
-
- `--modal-shadow` -
|
|
130
|
-
- `--modal-padding` -
|
|
131
|
-
- `--modal-max-width-small` -
|
|
132
|
-
- `--modal-max-width-medium` -
|
|
133
|
-
- `--modal-max-width-large` -
|
|
134
|
-
- `--modal-max-width-xlarge` -
|
|
537
|
+
- `--modal-bg` - background color
|
|
538
|
+
- `--modal-overlay-bg` - overlay background color
|
|
539
|
+
- `--modal-radius` - border radius
|
|
540
|
+
- `--modal-shadow` - box shadow
|
|
541
|
+
- `--modal-padding` - padding
|
|
542
|
+
- `--modal-max-width-small` - max width (small)
|
|
543
|
+
- `--modal-max-width-medium` - max width (medium)
|
|
544
|
+
- `--modal-max-width-large` - max width (large)
|
|
545
|
+
- `--modal-max-width-xlarge` - max width (xlarge)
|
|
135
546
|
|
|
136
547
|
### Progress
|
|
137
|
-
- `--progress-bg` -
|
|
138
|
-
- `--progress-color` -
|
|
139
|
-
- `--progress-height` -
|
|
140
|
-
- `--progress-radius` -
|
|
141
|
-
- `--progress-shadow` -
|
|
142
|
-
- `--progress-success-color` -
|
|
143
|
-
- `--progress-danger-color` -
|
|
144
|
-
- `--progress-warning-color` -
|
|
145
|
-
- `--progress-info-color` -
|
|
548
|
+
- `--progress-bg` - background color
|
|
549
|
+
- `--progress-color` - progress color
|
|
550
|
+
- `--progress-height` - height
|
|
551
|
+
- `--progress-radius` - border radius
|
|
552
|
+
- `--progress-shadow` - box shadow
|
|
553
|
+
- `--progress-success-color` - success variant color
|
|
554
|
+
- `--progress-danger-color` - danger variant color
|
|
555
|
+
- `--progress-warning-color` - warning variant color
|
|
556
|
+
- `--progress-info-color` - info variant color
|
|
146
557
|
|
|
147
558
|
### Card
|
|
148
|
-
- `--card-bg` -
|
|
149
|
-
- `--card-border` -
|
|
150
|
-
- `--card-radius` -
|
|
151
|
-
- `--card-shadow` -
|
|
152
|
-
- `--card-shadow-hover` -
|
|
153
|
-
- `--card-padding` -
|
|
559
|
+
- `--card-bg` - background color
|
|
560
|
+
- `--card-border` - border
|
|
561
|
+
- `--card-radius` - border radius
|
|
562
|
+
- `--card-shadow` - box shadow
|
|
563
|
+
- `--card-shadow-hover` - hover box shadow
|
|
564
|
+
- `--card-padding` - padding
|
|
154
565
|
|
|
155
566
|
### Badge
|
|
156
|
-
- `--badge-bg` -
|
|
157
|
-
- `--badge-color` -
|
|
158
|
-
- `--badge-radius` -
|
|
159
|
-
- `--badge-font-size` -
|
|
160
|
-
- `--badge-padding-x` -
|
|
161
|
-
- `--badge-padding-y` -
|
|
162
|
-
- `--badge-primary-bg` -
|
|
163
|
-
- `--badge-primary-color` -
|
|
164
|
-
- (
|
|
567
|
+
- `--badge-bg` - background color
|
|
568
|
+
- `--badge-color` - text color
|
|
569
|
+
- `--badge-radius` - border radius
|
|
570
|
+
- `--badge-font-size` - font size
|
|
571
|
+
- `--badge-padding-x` - horizontal padding
|
|
572
|
+
- `--badge-padding-y` - vertical padding
|
|
573
|
+
- `--badge-primary-bg` - primary variant background
|
|
574
|
+
- `--badge-primary-color` - primary variant text color
|
|
575
|
+
- (Similar for success, danger, warning, info)
|
|
165
576
|
|
|
166
577
|
### Dropdown
|
|
167
|
-
- `--dropdown-bg` -
|
|
168
|
-
- `--dropdown-border` -
|
|
169
|
-
- `--dropdown-radius` -
|
|
170
|
-
- `--dropdown-shadow` -
|
|
171
|
-
- `--dropdown-item-hover-bg` -
|
|
172
|
-
- `--dropdown-item-padding` -
|
|
578
|
+
- `--dropdown-bg` - background color
|
|
579
|
+
- `--dropdown-border` - border
|
|
580
|
+
- `--dropdown-radius` - border radius
|
|
581
|
+
- `--dropdown-shadow` - box shadow
|
|
582
|
+
- `--dropdown-item-hover-bg` - item hover background
|
|
583
|
+
- `--dropdown-item-padding` - item padding
|
|
173
584
|
|
|
174
585
|
### Toggle
|
|
175
|
-
- `--toggle-bg` -
|
|
176
|
-
- `--toggle-bg-checked` -
|
|
177
|
-
- `--toggle-thumb-bg` -
|
|
178
|
-
- `--toggle-radius` -
|
|
179
|
-
- `--toggle-shadow` -
|
|
586
|
+
- `--toggle-bg` - background color
|
|
587
|
+
- `--toggle-bg-checked` - checked background color
|
|
588
|
+
- `--toggle-thumb-bg` - thumb background color
|
|
589
|
+
- `--toggle-radius` - border radius
|
|
590
|
+
- `--toggle-shadow` - box shadow
|
|
180
591
|
|
|
181
592
|
### Textarea
|
|
182
|
-
- `--textarea-bg` -
|
|
183
|
-
- `--textarea-border` -
|
|
184
|
-
- `--textarea-border-focus` -
|
|
185
|
-
- `--textarea-color` -
|
|
186
|
-
- `--textarea-radius` -
|
|
187
|
-
- `--textarea-padding` -
|
|
593
|
+
- `--textarea-bg` - background color
|
|
594
|
+
- `--textarea-border` - border
|
|
595
|
+
- `--textarea-border-focus` - focus border
|
|
596
|
+
- `--textarea-color` - text color
|
|
597
|
+
- `--textarea-radius` - border radius
|
|
598
|
+
- `--textarea-padding` - padding
|
|
188
599
|
|
|
189
600
|
### Checkbox/Radio
|
|
190
|
-
- `--checkbox-bg` -
|
|
191
|
-
- `--checkbox-border` -
|
|
192
|
-
- `--checkbox-border-checked` -
|
|
193
|
-
- `--checkbox-check-bg` -
|
|
194
|
-
- `--checkbox-check-color` -
|
|
195
|
-
- `--checkbox-radius` -
|
|
601
|
+
- `--checkbox-bg` - background color
|
|
602
|
+
- `--checkbox-border` - border
|
|
603
|
+
- `--checkbox-border-checked` - checked border
|
|
604
|
+
- `--checkbox-check-bg` - check mark background color
|
|
605
|
+
- `--checkbox-check-color` - check mark color
|
|
606
|
+
- `--checkbox-radius` - border radius
|
|
196
607
|
|
|
197
608
|
### Select
|
|
198
|
-
- `--select-bg` -
|
|
199
|
-
- `--select-border` -
|
|
200
|
-
- `--select-border-focus` -
|
|
201
|
-
- `--select-color` -
|
|
202
|
-
- `--select-radius` -
|
|
609
|
+
- `--select-bg` - background color
|
|
610
|
+
- `--select-border` - border
|
|
611
|
+
- `--select-border-focus` - focus border
|
|
612
|
+
- `--select-color` - text color
|
|
613
|
+
- `--select-radius` - border radius
|
|
203
614
|
|
|
204
615
|
### ProgressCircle
|
|
205
|
-
- `--circle-progress-bg` -
|
|
206
|
-
- `--circle-progress-color` -
|
|
207
|
-
- `--circle-progress-stroke-width` -
|
|
208
|
-
- `--circle-progress-value-stroke-width` -
|
|
616
|
+
- `--circle-progress-bg` - background circle color
|
|
617
|
+
- `--circle-progress-color` - progress color (HSL-based)
|
|
618
|
+
- `--circle-progress-stroke-width` - background circle stroke width
|
|
619
|
+
- `--circle-progress-value-stroke-width` - progress path stroke width
|
|
209
620
|
|
|
210
621
|
### ProgressBubble
|
|
211
|
-
- `--bubble-progress-bg` -
|
|
212
|
-
- `--bubble-progress-border-color` -
|
|
213
|
-
- `--bubble-progress-water-alpha` -
|
|
214
|
-
- `--bubble-progress-glare-bg` -
|
|
622
|
+
- `--bubble-progress-bg` - background color
|
|
623
|
+
- `--bubble-progress-border-color` - border color
|
|
624
|
+
- `--bubble-progress-water-alpha` - water transparency
|
|
625
|
+
- `--bubble-progress-glare-bg` - glare background color
|
|
215
626
|
|
|
216
|
-
## Theme
|
|
627
|
+
## Theme Override
|
|
217
628
|
|
|
218
|
-
###
|
|
629
|
+
### Global Theme
|
|
219
630
|
|
|
220
631
|
```css
|
|
221
632
|
/* theme.css */
|
|
@@ -227,11 +638,11 @@ Alle Komponenten verwenden CSS Custom Properties, die überschrieben werden kön
|
|
|
227
638
|
```
|
|
228
639
|
|
|
229
640
|
```javascript
|
|
230
|
-
import '@rhavenside/custom-ui-library/
|
|
231
|
-
import './theme.css'; //
|
|
641
|
+
import '@rhavenside/custom-ui-library/style.css';
|
|
642
|
+
import './theme.css'; // Import after custom-ui-library
|
|
232
643
|
```
|
|
233
644
|
|
|
234
|
-
###
|
|
645
|
+
### Contextual Theme
|
|
235
646
|
|
|
236
647
|
```css
|
|
237
648
|
/* dark-theme.css */
|
|
@@ -250,19 +661,7 @@ import './theme.css'; // Nach custom-ui-library importieren
|
|
|
250
661
|
</div>
|
|
251
662
|
```
|
|
252
663
|
|
|
253
|
-
## Entwicklung
|
|
254
|
-
|
|
255
|
-
```bash
|
|
256
|
-
# Lokale Entwicklung
|
|
257
|
-
npm run dev
|
|
258
|
-
|
|
259
|
-
# Library bauen
|
|
260
|
-
npm run build
|
|
261
|
-
|
|
262
|
-
# Watch-Mode
|
|
263
|
-
npm run build:watch
|
|
264
|
-
```
|
|
265
664
|
|
|
266
|
-
##
|
|
665
|
+
## License
|
|
267
666
|
|
|
268
667
|
MIT
|
package/package.json
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rhavenside/custom-ui-library",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A customizable React UI component library with CSS variables",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
7
7
|
"module": "dist/index.esm.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.esm.js",
|
|
12
|
+
"require": "./dist/index.cjs.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./dist/style.css": "./dist/style.css",
|
|
16
|
+
"./style.css": "./dist/style.css",
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
9
19
|
"files": [
|
|
10
20
|
"dist",
|
|
11
21
|
"README.md"
|