@unizap/uniui 1.0.59 → 1.0.60
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 +187 -187
- package/dist/components/Accordion/Accordion.d.ts +2 -3
- package/dist/components/Accordion/Accordion.types.d.ts +12 -13
- package/dist/components/Accordion/index.d.ts +1 -1
- package/dist/components/ActionMenu/ActionMenu.d.ts +1 -2
- package/dist/components/ActionMenu/ActionMenu.types.d.ts +14 -15
- package/dist/components/ActionMenu/index.d.ts +1 -1
- package/dist/components/Alert/Alert.d.ts +2 -3
- package/dist/components/Alert/Alert.types.d.ts +8 -8
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +2 -3
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +24 -24
- package/dist/components/Autocomplete/index.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts +2 -3
- package/dist/components/Avatar/Avatar.types.d.ts +9 -10
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Backdrop/Backdrop.d.ts +2 -3
- package/dist/components/Backdrop/Backdrop.types.d.ts +6 -6
- package/dist/components/Backdrop/index.d.ts +1 -1
- package/dist/components/Badge/Badge.d.ts +2 -3
- package/dist/components/Badge/Badge.types.d.ts +8 -9
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.d.ts +2 -3
- package/dist/components/BottomNavigation/BottomNavigation.types.d.ts +14 -14
- package/dist/components/BottomNavigation/index.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +2 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +12 -12
- package/dist/components/Breadcrumbs/index.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -3
- package/dist/components/Button/Button.types.d.ts +17 -18
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Card/Card.d.ts +2 -3
- package/dist/components/Card/Card.types.d.ts +16 -17
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/CardWrapper/CardWrapper.d.ts +7 -8
- package/dist/components/CardWrapper/CardWrapper.types.d.ts +1 -1
- package/dist/components/CardWrapper/index.d.ts +1 -1
- package/dist/components/Carousel/Carousel.d.ts +2 -3
- package/dist/components/Carousel/Carousel.types.d.ts +32 -33
- package/dist/components/Carousel/index.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +2 -3
- package/dist/components/Checkbox/Checkbox.types.d.ts +9 -9
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/CollapsableCard/CollapsableCard.d.ts +2 -3
- package/dist/components/CollapsableCard/CollapsableCard.types.d.ts +17 -18
- package/dist/components/CollapsableCard/index.d.ts +1 -1
- package/dist/components/DashboardStatBoxes/DashboardStatBoxes.d.ts +2 -3
- package/dist/components/DashboardStatBoxes/DashboardStatBoxes.types.d.ts +12 -12
- package/dist/components/DashboardStatBoxes/index.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +2 -3
- package/dist/components/DatePicker/DatePicker.types.d.ts +32 -27
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/Dialog/Dialog.d.ts +2 -3
- package/dist/components/Dialog/Dialog.types.d.ts +17 -18
- package/dist/components/Dialog/index.d.ts +1 -1
- package/dist/components/Divider/Divider.d.ts +2 -3
- package/dist/components/Divider/Divider.types.d.ts +6 -6
- package/dist/components/Divider/index.d.ts +1 -1
- package/dist/components/Drawer/Drawer.d.ts +2 -3
- package/dist/components/Drawer/Drawer.types.d.ts +11 -12
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +2 -3
- package/dist/components/Dropdown/Dropdown.types.d.ts +11 -11
- package/dist/components/Dropdown/index.d.ts +1 -1
- package/dist/components/DropzoneUploader/DropzoneUploader.d.ts +2 -3
- package/dist/components/DropzoneUploader/DropzoneUploader.types.d.ts +23 -23
- package/dist/components/DropzoneUploader/index.d.ts +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +2 -3
- package/dist/components/EmptyState/EmptyState.types.d.ts +19 -20
- package/dist/components/EmptyState/index.d.ts +1 -1
- package/dist/components/IconButton/IconButton.d.ts +2 -3
- package/dist/components/IconButton/IconButton.types.d.ts +11 -12
- package/dist/components/IconButton/index.d.ts +1 -1
- package/dist/components/List/List.d.ts +2 -3
- package/dist/components/List/List.types.d.ts +9 -10
- package/dist/components/List/ListItem/ListItem.d.ts +2 -3
- package/dist/components/List/ListItem/index.d.ts +1 -1
- package/dist/components/List/index.d.ts +1 -1
- package/dist/components/Menu/Menu.d.ts +8 -8
- package/dist/components/Menu/Menu.types.d.ts +1 -1
- package/dist/components/Menu/index.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +2 -3
- package/dist/components/NumberInput/NumberInput.types.d.ts +16 -16
- package/dist/components/NumberInput/index.d.ts +1 -1
- package/dist/components/Pagination/Pagination.d.ts +2 -3
- package/dist/components/Pagination/Pagination.types.d.ts +10 -10
- package/dist/components/Pagination/index.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +2 -3
- package/dist/components/PasswordInput/index.d.ts +1 -1
- package/dist/components/Pill/Pill.d.ts +2 -3
- package/dist/components/Pill/Pill.type.d.ts +18 -19
- package/dist/components/Pill/index.d.ts +1 -1
- package/dist/components/ProfileImageShowcase/ProfileShowcase.d.ts +11 -12
- package/dist/components/ProfileImageShowcase/ProfileShowcase.type.d.ts +1 -1
- package/dist/components/ProfileImageShowcase/index.d.ts +1 -1
- package/dist/components/Progress/Progress.d.ts +2 -3
- package/dist/components/Progress/Progress.types.d.ts +47 -48
- package/dist/components/Progress/index.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +2 -3
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +32 -17
- package/dist/components/RadioGroup/index.d.ts +1 -1
- package/dist/components/Rating/Rating.d.ts +2 -3
- package/dist/components/Rating/Rating.types.d.ts +17 -18
- package/dist/components/Rating/index.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +2 -3
- package/dist/components/Select/Select.types.d.ts +18 -18
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.d.ts +11 -11
- package/dist/components/Sidebar/Sidebar.types.d.ts +16 -17
- package/dist/components/Sidebar/index.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +2 -3
- package/dist/components/Skeleton/Skeleton.types.d.ts +28 -28
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Slider/Slider.d.ts +2 -3
- package/dist/components/Slider/Slider.types.d.ts +39 -39
- package/dist/components/Slider/index.d.ts +1 -1
- package/dist/components/Snackbar/Snackbar.d.ts +2 -3
- package/dist/components/Snackbar/Snackbar.types.d.ts +40 -41
- package/dist/components/Snackbar/index.d.ts +1 -1
- package/dist/components/Stepper/Stepper.d.ts +18 -19
- package/dist/components/Stepper/Stepper.type.d.ts +1 -1
- package/dist/components/Stepper/index.d.ts +1 -1
- package/dist/components/Table/Table.d.ts +4 -5
- package/dist/components/Table/Table.types.d.ts +16 -17
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +2 -3
- package/dist/components/Tabs/Tabs.types.d.ts +18 -19
- package/dist/components/Tabs/index.d.ts +1 -1
- package/dist/components/TextArea/TextArea.d.ts +2 -3
- package/dist/components/TextArea/TextArea.types.d.ts +9 -9
- package/dist/components/TextArea/index.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +2 -3
- package/dist/components/TextInput/TextInput.types.d.ts +18 -18
- package/dist/components/TextInput/index.d.ts +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +2 -3
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.types.d.ts +18 -19
- package/dist/components/ToggleButtonGroup/index.d.ts +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +2 -3
- package/dist/components/ToggleSwitch/ToggleSwitch.types.d.ts +9 -10
- package/dist/components/ToggleSwitch/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +2 -3
- package/dist/components/Tooltip/Tooltip.type.d.ts +5 -5
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/Typography/Typography.d.ts +2 -3
- package/dist/components/Typography/Typography.types.d.ts +8 -9
- package/dist/components/Typography/index.d.ts +1 -1
- package/dist/components/index.d.ts +49 -49
- package/dist/components/otpInput/OtpInput.d.ts +2 -3
- package/dist/components/otpInput/OtpInput.type.d.ts +12 -13
- package/dist/components/otpInput/index.d.ts +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/uniui.js +2115 -1835
- package/dist/uniui.umd.cjs +73 -69
- package/dist/utils/ColorMap.d.ts +31 -31
- package/dist/utils/constants.d.ts +1 -1
- package/package.json +94 -91
package/README.md
CHANGED
|
@@ -1,187 +1,187 @@
|
|
|
1
|
-
<p></p>
|
|
2
|
-
<p align="center">
|
|
3
|
-
<img src="https://ik.imagekit.io/unizap/uniui.svg" alt="UniUI Logo" height="80"/>
|
|
4
|
-
</p>
|
|
5
|
-
|
|
6
|
-
<p align="center">
|
|
7
|
-
<b>UniUI is a comprehensive and highly customizable UI component library built for React. Inspired by modern design principles, UniUI offers a wide range of high-quality, flexible, and easy-to-use components to build elegant and functional user interfaces for web applications.</b>
|
|
8
|
-
</p>
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## 🚀 Installation
|
|
13
|
-
|
|
14
|
-
```sh
|
|
15
|
-
npm i @unizap/uniui
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## ⚡ Usage
|
|
21
|
-
|
|
22
|
-
Import the UniUI CSS in your main entry file (e.g. `app.js`):
|
|
23
|
-
|
|
24
|
-
```js
|
|
25
|
-
import '@unizap/uniui/uniui.css'
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Now you can use UniUI components anywhere in your app:
|
|
29
|
-
|
|
30
|
-
```jsx
|
|
31
|
-
import {Button, IconButton, Badge, Carousel, EmptyState, PasswordInput,} from '@unizap/uniui';
|
|
32
|
-
|
|
33
|
-
<Button color="amber" variant="filled">
|
|
34
|
-
Hello UniUI
|
|
35
|
-
</Button>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## 🧩 Components
|
|
41
|
-
|
|
42
|
-
- **Accordion**
|
|
43
|
-
- **Alert**
|
|
44
|
-
- **Avatar**
|
|
45
|
-
- **Badge**
|
|
46
|
-
- **Backdrop**
|
|
47
|
-
- **Button**
|
|
48
|
-
- **Card**
|
|
49
|
-
- **Carousel**
|
|
50
|
-
- **Checkbox**
|
|
51
|
-
- **Datepicker**
|
|
52
|
-
- **Dialog**
|
|
53
|
-
- **Divider**
|
|
54
|
-
- **Drawer**
|
|
55
|
-
- **EmptyState**
|
|
56
|
-
- **IconButton**
|
|
57
|
-
- **Input**
|
|
58
|
-
- **List**
|
|
59
|
-
- **OTPInput**
|
|
60
|
-
- **PasswordInput**
|
|
61
|
-
- **Progress**
|
|
62
|
-
- **RadioGroup**
|
|
63
|
-
- **Rating**
|
|
64
|
-
- **Select**
|
|
65
|
-
- **Sheet**
|
|
66
|
-
- **Skeleton**
|
|
67
|
-
- **Slider**
|
|
68
|
-
- **Stepper**
|
|
69
|
-
- **Switch**
|
|
70
|
-
- **Table**
|
|
71
|
-
- **Tabs**
|
|
72
|
-
- **Textarea**
|
|
73
|
-
- **ToggleButton**
|
|
74
|
-
- **ToggleSwitch**
|
|
75
|
-
- **Tooltip**
|
|
76
|
-
- **Typography**
|
|
77
|
-
- **Dropdown**
|
|
78
|
-
- **ActionMenu**
|
|
79
|
-
- **Registration**
|
|
80
|
-
- **DashboardStatistic**
|
|
81
|
-
- **DropzoneUploader**
|
|
82
|
-
- **ProfileShowcase**
|
|
83
|
-
- **Sidebar**
|
|
84
|
-
- **BottomNavigation**
|
|
85
|
-
- **Breadcrumbs**
|
|
86
|
-
- **Snackbar**
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
## 🎨 Default Colors
|
|
90
|
-
|
|
91
|
-
UniUI provides a set of default colors you can use out of the box:
|
|
92
|
-
|
|
93
|
-
- **dark**
|
|
94
|
-
- **gray**
|
|
95
|
-
- **light**
|
|
96
|
-
- **pearl**
|
|
97
|
-
- **red**
|
|
98
|
-
- **orange**
|
|
99
|
-
- **amber**
|
|
100
|
-
- **yellow**
|
|
101
|
-
- **lime**
|
|
102
|
-
- **green**
|
|
103
|
-
- **emerald**
|
|
104
|
-
- **teal**
|
|
105
|
-
- **cyan**
|
|
106
|
-
- **sky**
|
|
107
|
-
- **blue**
|
|
108
|
-
- **indigo**
|
|
109
|
-
- **violet**
|
|
110
|
-
- **purple**
|
|
111
|
-
- **fuchsia**
|
|
112
|
-
- **pink**
|
|
113
|
-
- **rose**
|
|
114
|
-
|
|
115
|
-
To use the default color, simply pass its name to the `color` prop:
|
|
116
|
-
|
|
117
|
-
```tsx
|
|
118
|
-
<Button color="amber">Amber Button</Button>
|
|
119
|
-
<Button color="blue">Blue Button</Button>
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## 🎨 How to Extend Color
|
|
123
|
-
|
|
124
|
-
To Extend and build sleek interfaces straight from your markup, you can install **UniCSS**:
|
|
125
|
-
[](https://www.npmjs.com/package/@unizap/unicss)
|
|
126
|
-
|
|
127
|
-
```sh
|
|
128
|
-
npm i @unizap/unicss
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
You can add custom colors to UniUI's color system using the exported `extendColorMap` and `extendRangeColorMap` functions.
|
|
132
|
-
|
|
133
|
-
**Example:**
|
|
134
|
-
|
|
135
|
-
1. Create a file in your project (e.g. `brandColor.js`):
|
|
136
|
-
|
|
137
|
-
```js
|
|
138
|
-
import { extendColorMap } from '@unizap/uniui'
|
|
139
|
-
|
|
140
|
-
extendColorMap({
|
|
141
|
-
brand: {
|
|
142
|
-
filled: "bg-color-violet-500 text-color-white",
|
|
143
|
-
outline: "border-color-violet-500 text-color-violet-500",
|
|
144
|
-
transparent: "text-color-violet-500",
|
|
145
|
-
accent: "accent-color-violet-500",
|
|
146
|
-
peer: "peer-checked:border-color-violet-500 peer-checked:text-color-violet-500",
|
|
147
|
-
text: "text-color-violet-500",
|
|
148
|
-
},
|
|
149
|
-
})
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
2. Use your new color in any component:
|
|
153
|
-
|
|
154
|
-
```jsx
|
|
155
|
-
import './brandColor.js';
|
|
156
|
-
|
|
157
|
-
<Button color="brand">Brand Button</Button>
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
3. Run the UniCSS CLI to generate your CSS file:
|
|
161
|
-
|
|
162
|
-
```sh
|
|
163
|
-
npx unicss -w -o src/style.css --skip-base
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
You can also extend Slider colors:
|
|
169
|
-
|
|
170
|
-
```js
|
|
171
|
-
import { extendRangeColorMap } from '@unizap/uniui'
|
|
172
|
-
|
|
173
|
-
extendRangeColorMap({
|
|
174
|
-
brand: {
|
|
175
|
-
track: 'bg-color-brand-200',
|
|
176
|
-
progress: 'bg-color-brand-500',
|
|
177
|
-
thumb: 'bg-color-brand-500 border-color-brand-600 shadow-color-brand-200',
|
|
178
|
-
thumbHover: 'bg-color-brand-600',
|
|
179
|
-
},
|
|
180
|
-
})
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
## 📄 License
|
|
186
|
-
|
|
187
|
-
MIT
|
|
1
|
+
<p></p>
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img src="https://ik.imagekit.io/unizap/uniui.svg" alt="UniUI Logo" height="80"/>
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
<p align="center">
|
|
7
|
+
<b>UniUI is a comprehensive and highly customizable UI component library built for React. Inspired by modern design principles, UniUI offers a wide range of high-quality, flexible, and easy-to-use components to build elegant and functional user interfaces for web applications.</b>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 🚀 Installation
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm i @unizap/uniui
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## ⚡ Usage
|
|
21
|
+
|
|
22
|
+
Import the UniUI CSS in your main entry file (e.g. `app.js`):
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import '@unizap/uniui/uniui.css'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Now you can use UniUI components anywhere in your app:
|
|
29
|
+
|
|
30
|
+
```jsx
|
|
31
|
+
import {Button, IconButton, Badge, Carousel, EmptyState, PasswordInput,} from '@unizap/uniui';
|
|
32
|
+
|
|
33
|
+
<Button color="amber" variant="filled">
|
|
34
|
+
Hello UniUI
|
|
35
|
+
</Button>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 🧩 Components
|
|
41
|
+
|
|
42
|
+
- **Accordion**
|
|
43
|
+
- **Alert**
|
|
44
|
+
- **Avatar**
|
|
45
|
+
- **Badge**
|
|
46
|
+
- **Backdrop**
|
|
47
|
+
- **Button**
|
|
48
|
+
- **Card**
|
|
49
|
+
- **Carousel**
|
|
50
|
+
- **Checkbox**
|
|
51
|
+
- **Datepicker**
|
|
52
|
+
- **Dialog**
|
|
53
|
+
- **Divider**
|
|
54
|
+
- **Drawer**
|
|
55
|
+
- **EmptyState**
|
|
56
|
+
- **IconButton**
|
|
57
|
+
- **Input**
|
|
58
|
+
- **List**
|
|
59
|
+
- **OTPInput**
|
|
60
|
+
- **PasswordInput**
|
|
61
|
+
- **Progress**
|
|
62
|
+
- **RadioGroup**
|
|
63
|
+
- **Rating**
|
|
64
|
+
- **Select**
|
|
65
|
+
- **Sheet**
|
|
66
|
+
- **Skeleton**
|
|
67
|
+
- **Slider**
|
|
68
|
+
- **Stepper**
|
|
69
|
+
- **Switch**
|
|
70
|
+
- **Table**
|
|
71
|
+
- **Tabs**
|
|
72
|
+
- **Textarea**
|
|
73
|
+
- **ToggleButton**
|
|
74
|
+
- **ToggleSwitch**
|
|
75
|
+
- **Tooltip**
|
|
76
|
+
- **Typography**
|
|
77
|
+
- **Dropdown**
|
|
78
|
+
- **ActionMenu**
|
|
79
|
+
- **Registration**
|
|
80
|
+
- **DashboardStatistic**
|
|
81
|
+
- **DropzoneUploader**
|
|
82
|
+
- **ProfileShowcase**
|
|
83
|
+
- **Sidebar**
|
|
84
|
+
- **BottomNavigation**
|
|
85
|
+
- **Breadcrumbs**
|
|
86
|
+
- **Snackbar**
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## 🎨 Default Colors
|
|
90
|
+
|
|
91
|
+
UniUI provides a set of default colors you can use out of the box:
|
|
92
|
+
|
|
93
|
+
- **dark**
|
|
94
|
+
- **gray**
|
|
95
|
+
- **light**
|
|
96
|
+
- **pearl**
|
|
97
|
+
- **red**
|
|
98
|
+
- **orange**
|
|
99
|
+
- **amber**
|
|
100
|
+
- **yellow**
|
|
101
|
+
- **lime**
|
|
102
|
+
- **green**
|
|
103
|
+
- **emerald**
|
|
104
|
+
- **teal**
|
|
105
|
+
- **cyan**
|
|
106
|
+
- **sky**
|
|
107
|
+
- **blue**
|
|
108
|
+
- **indigo**
|
|
109
|
+
- **violet**
|
|
110
|
+
- **purple**
|
|
111
|
+
- **fuchsia**
|
|
112
|
+
- **pink**
|
|
113
|
+
- **rose**
|
|
114
|
+
|
|
115
|
+
To use the default color, simply pass its name to the `color` prop:
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
<Button color="amber">Amber Button</Button>
|
|
119
|
+
<Button color="blue">Blue Button</Button>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## 🎨 How to Extend Color
|
|
123
|
+
|
|
124
|
+
To Extend and build sleek interfaces straight from your markup, you can install **UniCSS**:
|
|
125
|
+
[](https://www.npmjs.com/package/@unizap/unicss)
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
npm i @unizap/unicss
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
You can add custom colors to UniUI's color system using the exported `extendColorMap` and `extendRangeColorMap` functions.
|
|
132
|
+
|
|
133
|
+
**Example:**
|
|
134
|
+
|
|
135
|
+
1. Create a file in your project (e.g. `brandColor.js`):
|
|
136
|
+
|
|
137
|
+
```js
|
|
138
|
+
import { extendColorMap } from '@unizap/uniui'
|
|
139
|
+
|
|
140
|
+
extendColorMap({
|
|
141
|
+
brand: {
|
|
142
|
+
filled: "bg-color-violet-500 text-color-white",
|
|
143
|
+
outline: "border-color-violet-500 text-color-violet-500",
|
|
144
|
+
transparent: "text-color-violet-500",
|
|
145
|
+
accent: "accent-color-violet-500",
|
|
146
|
+
peer: "peer-checked:border-color-violet-500 peer-checked:text-color-violet-500",
|
|
147
|
+
text: "text-color-violet-500",
|
|
148
|
+
},
|
|
149
|
+
})
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
2. Use your new color in any component:
|
|
153
|
+
|
|
154
|
+
```jsx
|
|
155
|
+
import './brandColor.js';
|
|
156
|
+
|
|
157
|
+
<Button color="brand">Brand Button</Button>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
3. Run the UniCSS CLI to generate your CSS file:
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
npx unicss -w -o src/style.css --skip-base
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
You can also extend Slider colors:
|
|
169
|
+
|
|
170
|
+
```js
|
|
171
|
+
import { extendRangeColorMap } from '@unizap/uniui'
|
|
172
|
+
|
|
173
|
+
extendRangeColorMap({
|
|
174
|
+
brand: {
|
|
175
|
+
track: 'bg-color-brand-200',
|
|
176
|
+
progress: 'bg-color-brand-500',
|
|
177
|
+
thumb: 'bg-color-brand-500 border-color-brand-600 shadow-color-brand-200',
|
|
178
|
+
thumbHover: 'bg-color-brand-600',
|
|
179
|
+
},
|
|
180
|
+
})
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 📄 License
|
|
186
|
+
|
|
187
|
+
MIT
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
2
|
+
export interface AccordionProps {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
expandIcon?: ReactNode;
|
|
6
|
+
collapseIcon?: ReactNode;
|
|
7
|
+
isOpen?: boolean;
|
|
8
|
+
defaultExpanded?: boolean;
|
|
9
|
+
onToggle?: (expanded: boolean) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
titleClass?: string;
|
|
12
|
+
contentClass?: string;
|
|
13
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './Accordion';
|
|
1
|
+
export { default } from './Accordion';
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { ActionMenuProps } from './ActionMenu.types';
|
|
2
|
-
|
|
3
|
-
export default function ActionMenu({ items, trigger, className, dropdownItemClass, positioning }: ActionMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function ActionMenu({ items, trigger, className, dropdownItemClass, positioning }: ActionMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
2
|
+
export interface ActionMenuItem {
|
|
3
|
+
label?: string;
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
itemClass?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface ActionMenuProps {
|
|
10
|
+
items: ActionMenuItem[];
|
|
11
|
+
trigger: ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
dropdownItemClass?: string;
|
|
14
|
+
positioning?: 'absolute' | 'fixed';
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './ActionMenu';
|
|
1
|
+
export { default } from './ActionMenu';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface AlertProps {
|
|
2
|
-
message: string;
|
|
3
|
-
variant?: 'info' | 'success' | 'danger' | 'warning' | 'dark';
|
|
4
|
-
onClose?: () => void;
|
|
5
|
-
autoClose?: boolean;
|
|
6
|
-
autoCloseDuration?: number;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
1
|
+
export interface AlertProps {
|
|
2
|
+
message: string;
|
|
3
|
+
variant?: 'info' | 'success' | 'danger' | 'warning' | 'dark';
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
autoClose?: boolean;
|
|
6
|
+
autoCloseDuration?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './Alert';
|
|
1
|
+
export { default } from './Alert';
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export interface SearchBarProps {
|
|
2
|
-
/** Current search value (controlled) */
|
|
3
|
-
value: string;
|
|
4
|
-
/** Called on every keystroke */
|
|
5
|
-
onChange: (v: string) => void;
|
|
6
|
-
/** Optional list shown under the field */
|
|
7
|
-
suggestions?: string[];
|
|
8
|
-
/** Fired when user picks a suggestion (click or Enter) */
|
|
9
|
-
onSelect?: (v: string) => void;
|
|
10
|
-
/** Placeholder text */
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
/** Debounce delay (ms) before firing onChange; 0 = none */
|
|
13
|
-
debounce?: number;
|
|
14
|
-
/** Width of the component (CSS size) */
|
|
15
|
-
width?: string | number;
|
|
16
|
-
/** If true, filter suggestions client-side */
|
|
17
|
-
filterLocal?: boolean;
|
|
18
|
-
/** Custom empty-state text when no suggestions */
|
|
19
|
-
emptyLabel?: string;
|
|
20
|
-
iconStyle?: string;
|
|
21
|
-
inputClass?: string;
|
|
22
|
-
className?: string;
|
|
23
|
-
startIcon?: React.ReactNode;
|
|
24
|
-
}
|
|
1
|
+
export interface SearchBarProps {
|
|
2
|
+
/** Current search value (controlled) */
|
|
3
|
+
value: string;
|
|
4
|
+
/** Called on every keystroke */
|
|
5
|
+
onChange: (v: string) => void;
|
|
6
|
+
/** Optional list shown under the field */
|
|
7
|
+
suggestions?: string[];
|
|
8
|
+
/** Fired when user picks a suggestion (click or Enter) */
|
|
9
|
+
onSelect?: (v: string) => void;
|
|
10
|
+
/** Placeholder text */
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
/** Debounce delay (ms) before firing onChange; 0 = none */
|
|
13
|
+
debounce?: number;
|
|
14
|
+
/** Width of the component (CSS size) */
|
|
15
|
+
width?: string | number;
|
|
16
|
+
/** If true, filter suggestions client-side */
|
|
17
|
+
filterLocal?: boolean;
|
|
18
|
+
/** Custom empty-state text when no suggestions */
|
|
19
|
+
emptyLabel?: string;
|
|
20
|
+
iconStyle?: string;
|
|
21
|
+
inputClass?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
startIcon?: React.ReactNode;
|
|
24
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './Autocomplete';
|
|
1
|
+
export { default } from './Autocomplete';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { AvatarProps } from './Avatar.types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default Avatar;
|
|
2
|
+
declare const Avatar: ({ src, alt, size, fallback, className, color, shape, }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default Avatar;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { CompColor } from '../../utils/ColorMap';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
2
|
+
export interface AvatarProps {
|
|
3
|
+
src?: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
fallback?: React.ReactNode;
|
|
6
|
+
size?: 'small' | 'medium' | 'large' | 'extra-large';
|
|
7
|
+
shape?: 'circle' | 'rounded' | 'square';
|
|
8
|
+
color?: CompColor;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './Avatar';
|
|
1
|
+
export { default } from './Avatar';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface BackdropProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
-
open: boolean;
|
|
3
|
-
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
4
|
-
className?: string;
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
}
|
|
1
|
+
export interface BackdropProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
4
|
+
className?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './Backdrop';
|
|
1
|
+
export { default } from './Backdrop';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { CompColor } from '../../utils/ColorMap';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
2
|
+
export interface BadgeProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
count?: number;
|
|
5
|
+
showDot?: boolean;
|
|
6
|
+
max?: number;
|
|
7
|
+
color?: CompColor;
|
|
8
|
+
position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './Badge';
|
|
1
|
+
export { default } from './Badge';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { BottomNavigationProps } from './BottomNavigation.types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default BottomNavigation;
|
|
3
|
+
declare const BottomNavigation: React.FC<BottomNavigationProps>;
|
|
4
|
+
export default BottomNavigation;
|