mainbase-ui 1.2.4
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/LICENSE +21 -0
- package/README.md +279 -0
- package/dist/index.cjs +6457 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +3747 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +789 -0
- package/dist/index.d.ts +789 -0
- package/dist/index.js +6495 -0
- package/dist/index.js.map +1 -0
- package/package.json +72 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mainbase
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
# Mainbase UI
|
|
2
|
+
|
|
3
|
+
Mainbase UI is a React component library built with React and TypeScript.
|
|
4
|
+
|
|
5
|
+
The library provides reusable interface components, a customizable theme system,
|
|
6
|
+
CSS variables, and typed component APIs for building web applications.
|
|
7
|
+
|
|
8
|
+
## Requirements
|
|
9
|
+
|
|
10
|
+
- React 18 or higher
|
|
11
|
+
- React DOM 18 or higher
|
|
12
|
+
- TypeScript 5 or higher (recommended)
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Install the package using npm:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install mainbase-ui
|
|
20
|
+
|
|
21
|
+
or using pnpm:
|
|
22
|
+
|
|
23
|
+
pnpm add mainbase-ui
|
|
24
|
+
|
|
25
|
+
or using yarn:
|
|
26
|
+
|
|
27
|
+
yarn add mainbase-ui
|
|
28
|
+
Basic Usage
|
|
29
|
+
|
|
30
|
+
Import the global styles:
|
|
31
|
+
|
|
32
|
+
import "mainbase-ui/styles.css";
|
|
33
|
+
|
|
34
|
+
Import required components:
|
|
35
|
+
|
|
36
|
+
import {
|
|
37
|
+
MainbaseProvider,
|
|
38
|
+
Button,
|
|
39
|
+
} from "mainbase-ui";
|
|
40
|
+
|
|
41
|
+
Example:
|
|
42
|
+
|
|
43
|
+
export default function App() {
|
|
44
|
+
return (
|
|
45
|
+
<MainbaseProvider>
|
|
46
|
+
<Button>
|
|
47
|
+
Click me
|
|
48
|
+
</Button>
|
|
49
|
+
</MainbaseProvider>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
MainbaseProvider
|
|
53
|
+
|
|
54
|
+
MainbaseProvider is the root configuration component.
|
|
55
|
+
|
|
56
|
+
It provides:
|
|
57
|
+
|
|
58
|
+
theme configuration;
|
|
59
|
+
component default values;
|
|
60
|
+
design tokens;
|
|
61
|
+
CSS variables.
|
|
62
|
+
|
|
63
|
+
Example:
|
|
64
|
+
|
|
65
|
+
<MainbaseProvider
|
|
66
|
+
theme={{
|
|
67
|
+
colors: {
|
|
68
|
+
primary: "#ff8a1f",
|
|
69
|
+
primaryHover: "#f47c0f",
|
|
70
|
+
primaryActive: "#dd6d06",
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
radii: {
|
|
74
|
+
sm: 4,
|
|
75
|
+
md: 4,
|
|
76
|
+
lg: 4,
|
|
77
|
+
xl: 4,
|
|
78
|
+
full: 999,
|
|
79
|
+
},
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
<App />
|
|
83
|
+
</MainbaseProvider>
|
|
84
|
+
Theme Configuration
|
|
85
|
+
|
|
86
|
+
The theme system allows changing global interface values.
|
|
87
|
+
|
|
88
|
+
Supported theme sections:
|
|
89
|
+
|
|
90
|
+
colors;
|
|
91
|
+
typography;
|
|
92
|
+
radii;
|
|
93
|
+
spacing;
|
|
94
|
+
shadows;
|
|
95
|
+
transitions;
|
|
96
|
+
z-index;
|
|
97
|
+
component defaults.
|
|
98
|
+
|
|
99
|
+
Example:
|
|
100
|
+
|
|
101
|
+
<MainbaseProvider
|
|
102
|
+
theme={{
|
|
103
|
+
typography: {
|
|
104
|
+
fontFamily:
|
|
105
|
+
"Manrope, sans-serif",
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
colors: {
|
|
109
|
+
primary: "#2563eb",
|
|
110
|
+
},
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
<App />
|
|
114
|
+
</MainbaseProvider>
|
|
115
|
+
Colors
|
|
116
|
+
|
|
117
|
+
Available color tokens:
|
|
118
|
+
|
|
119
|
+
colors: {
|
|
120
|
+
primary,
|
|
121
|
+
primaryHover,
|
|
122
|
+
primaryActive,
|
|
123
|
+
|
|
124
|
+
text,
|
|
125
|
+
textSecondary,
|
|
126
|
+
textMuted,
|
|
127
|
+
|
|
128
|
+
background,
|
|
129
|
+
backgroundSecondary,
|
|
130
|
+
|
|
131
|
+
border,
|
|
132
|
+
borderHover,
|
|
133
|
+
|
|
134
|
+
success,
|
|
135
|
+
warning,
|
|
136
|
+
danger,
|
|
137
|
+
info
|
|
138
|
+
}
|
|
139
|
+
Border Radius
|
|
140
|
+
|
|
141
|
+
Global component radius can be configured:
|
|
142
|
+
|
|
143
|
+
<MainbaseProvider
|
|
144
|
+
theme={{
|
|
145
|
+
radii: {
|
|
146
|
+
sm: 4,
|
|
147
|
+
md: 4,
|
|
148
|
+
lg: 4,
|
|
149
|
+
xl: 4,
|
|
150
|
+
full: 999,
|
|
151
|
+
},
|
|
152
|
+
}}
|
|
153
|
+
>
|
|
154
|
+
|
|
155
|
+
These values are used by components automatically.
|
|
156
|
+
|
|
157
|
+
Typography
|
|
158
|
+
|
|
159
|
+
Example:
|
|
160
|
+
|
|
161
|
+
<MainbaseProvider
|
|
162
|
+
theme={{
|
|
163
|
+
typography: {
|
|
164
|
+
fontFamily:
|
|
165
|
+
"Manrope, sans-serif",
|
|
166
|
+
},
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
Components
|
|
170
|
+
|
|
171
|
+
Mainbase UI includes the following components.
|
|
172
|
+
|
|
173
|
+
Layout
|
|
174
|
+
Stack
|
|
175
|
+
Group
|
|
176
|
+
Card
|
|
177
|
+
Divider
|
|
178
|
+
Typography
|
|
179
|
+
Text
|
|
180
|
+
Title
|
|
181
|
+
Buttons
|
|
182
|
+
Button
|
|
183
|
+
IconButton
|
|
184
|
+
Inputs
|
|
185
|
+
Input
|
|
186
|
+
Textarea
|
|
187
|
+
PasswordInput
|
|
188
|
+
PinInput
|
|
189
|
+
Select
|
|
190
|
+
FileInput
|
|
191
|
+
DatePicker
|
|
192
|
+
Selection
|
|
193
|
+
Checkbox
|
|
194
|
+
Radio
|
|
195
|
+
Switch
|
|
196
|
+
Feedback
|
|
197
|
+
Alert
|
|
198
|
+
Badge
|
|
199
|
+
Spinner
|
|
200
|
+
Progress
|
|
201
|
+
Skeleton
|
|
202
|
+
Toast
|
|
203
|
+
Navigation
|
|
204
|
+
Tabs
|
|
205
|
+
Accordion
|
|
206
|
+
Pagination
|
|
207
|
+
Overlay
|
|
208
|
+
Modal
|
|
209
|
+
Drawer
|
|
210
|
+
Menu
|
|
211
|
+
Popover
|
|
212
|
+
Tooltip
|
|
213
|
+
User Components
|
|
214
|
+
Avatar
|
|
215
|
+
AvatarGroup
|
|
216
|
+
Component Defaults
|
|
217
|
+
|
|
218
|
+
Default component settings can be configured through the theme.
|
|
219
|
+
|
|
220
|
+
Example:
|
|
221
|
+
|
|
222
|
+
<MainbaseProvider
|
|
223
|
+
theme={{
|
|
224
|
+
components: {
|
|
225
|
+
Button: {
|
|
226
|
+
size: "lg",
|
|
227
|
+
variant: "primary",
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
Card: {
|
|
231
|
+
radius: "md",
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
}}
|
|
235
|
+
>
|
|
236
|
+
TypeScript Support
|
|
237
|
+
|
|
238
|
+
Mainbase UI provides TypeScript definitions for all public components.
|
|
239
|
+
|
|
240
|
+
Example:
|
|
241
|
+
|
|
242
|
+
import type {
|
|
243
|
+
ButtonProps,
|
|
244
|
+
DatePickerProps,
|
|
245
|
+
} from "mainbase-ui";
|
|
246
|
+
CSS Variables
|
|
247
|
+
|
|
248
|
+
Mainbase UI exposes CSS variables that can be customized.
|
|
249
|
+
|
|
250
|
+
Example:
|
|
251
|
+
|
|
252
|
+
:root {
|
|
253
|
+
--mb-primary: #ff8a1f;
|
|
254
|
+
--mb-radius: 8px;
|
|
255
|
+
}
|
|
256
|
+
Accessibility
|
|
257
|
+
|
|
258
|
+
Components are designed with accessibility support:
|
|
259
|
+
|
|
260
|
+
keyboard navigation;
|
|
261
|
+
ARIA attributes;
|
|
262
|
+
focus states;
|
|
263
|
+
disabled states.
|
|
264
|
+
Browser Support
|
|
265
|
+
|
|
266
|
+
Mainbase UI supports modern browsers:
|
|
267
|
+
|
|
268
|
+
Chrome
|
|
269
|
+
Edge
|
|
270
|
+
Firefox
|
|
271
|
+
Safari
|
|
272
|
+
License
|
|
273
|
+
|
|
274
|
+
Mainbase UI is distributed under the MIT License.
|
|
275
|
+
|
|
276
|
+
You are free to use, modify, and distribute this software
|
|
277
|
+
according to the terms of the license.
|
|
278
|
+
|
|
279
|
+
See the LICENSE file for full license text.
|