@yomologic/react-ui 0.2.7 → 0.3.1
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 +48 -18
- package/dist/base.css +294 -0
- package/dist/index.d.mts +732 -338
- package/dist/index.d.ts +732 -338
- package/dist/index.js +3856 -1225
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3842 -1220
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1535 -400
- package/dist/styles.css.map +1 -1
- package/package.json +25 -5
package/README.md
CHANGED
|
@@ -4,12 +4,13 @@ A modern, lightweight React UI component library built with TypeScript and desig
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- 🎨 **Modern Design** - Clean, professional components
|
|
7
|
+
- 🎨 **Modern Design** - Clean, professional components inspired by Tailwind UI
|
|
8
8
|
- 📦 **Tree-shakeable** - Import only what you need
|
|
9
9
|
- 🎯 **TypeScript** - Full type safety
|
|
10
|
-
- ⚡ **
|
|
11
|
-
- 🎭 **
|
|
10
|
+
- ⚡ **Lightweight** - Minimal dependencies
|
|
11
|
+
- 🎭 **Themeable** - CSS variables for easy customization
|
|
12
12
|
- ♿ **Accessible** - Built with accessibility in mind
|
|
13
|
+
- 📱 **Responsive** - Mobile-first design patterns
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
15
16
|
|
|
@@ -27,14 +28,14 @@ npm install @yomologic/react-ui
|
|
|
27
28
|
import { Button, Input, Card } from "@yomologic/react-ui";
|
|
28
29
|
|
|
29
30
|
function App() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
return (
|
|
32
|
+
<Card padding="lg">
|
|
33
|
+
<Input label="Email" type="email" placeholder="you@example.com" />
|
|
34
|
+
<Button variant="primary" size="md">
|
|
35
|
+
Submit
|
|
36
|
+
</Button>
|
|
37
|
+
</Card>
|
|
38
|
+
);
|
|
38
39
|
}
|
|
39
40
|
```
|
|
40
41
|
|
|
@@ -50,7 +51,9 @@ function App() {
|
|
|
50
51
|
- **RadioGroup** - Radio button groups for single selections
|
|
51
52
|
- **Dropdown** - Select dropdowns with search and custom options
|
|
52
53
|
- **Spinner** - Loading indicators
|
|
53
|
-
- **CodeSnippet** - Syntax-highlighted code display
|
|
54
|
+
- **CodeSnippet** - Syntax-highlighted code display with copy button
|
|
55
|
+
- **Dialog** - Modal dialogs with header, content, and footer sections
|
|
56
|
+
- **Divider** - Visual separators for content sections
|
|
54
57
|
|
|
55
58
|
### Feedback Components
|
|
56
59
|
|
|
@@ -58,14 +61,37 @@ function App() {
|
|
|
58
61
|
|
|
59
62
|
### Layout Components
|
|
60
63
|
|
|
61
|
-
- **Container** - Responsive page container
|
|
62
|
-
- **SectionLayout** - Layout wrapper for sections
|
|
63
|
-
- **
|
|
64
|
-
- **
|
|
64
|
+
- **Container** - Responsive page container with max-width constraints
|
|
65
|
+
- **SectionLayout** - Layout wrapper for documentation sections
|
|
66
|
+
- **Nav** - Navigation bar with mobile menu support (dropdown or drawer)
|
|
67
|
+
- **Drawer** - Slide-out drawer/sidebar for navigation
|
|
65
68
|
|
|
66
|
-
|
|
69
|
+
## Theming
|
|
67
70
|
|
|
68
|
-
|
|
71
|
+
The library uses CSS variables for theming, allowing easy customization:
|
|
72
|
+
|
|
73
|
+
```css
|
|
74
|
+
:root {
|
|
75
|
+
--color-primary: #3b82f6;
|
|
76
|
+
--color-secondary: #6b7280;
|
|
77
|
+
--color-success: #10b981;
|
|
78
|
+
--color-error: #ef4444;
|
|
79
|
+
--color-warning: #f59e0b;
|
|
80
|
+
/* ... more variables */
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Z-Index System
|
|
85
|
+
|
|
86
|
+
Components follow a structured z-index system to prevent stacking conflicts:
|
|
87
|
+
|
|
88
|
+
- **Base Layer (0-9)**: Normal content, code buttons
|
|
89
|
+
- **Sticky/Fixed (10-99)**: Navigation, sticky headers
|
|
90
|
+
- **Overlay (100-999)**: Dropdowns, popovers, drawers
|
|
91
|
+
- **Modal (1000-1999)**: Dialogs, tooltips
|
|
92
|
+
- **Notification (2000+)**: Toasts, snackbars
|
|
93
|
+
|
|
94
|
+
All z-index values are defined as CSS variables (e.g., `--z-index-nav`, `--z-index-modal`) for consistency.
|
|
69
95
|
|
|
70
96
|
## Development
|
|
71
97
|
|
|
@@ -83,6 +109,10 @@ yarn dev
|
|
|
83
109
|
yarn type-check
|
|
84
110
|
```
|
|
85
111
|
|
|
112
|
+
## Contributing
|
|
113
|
+
|
|
114
|
+
This is a private component library for Yomologic projects. For internal development documentation, see the implementation guides in the repository.
|
|
115
|
+
|
|
86
116
|
## License
|
|
87
117
|
|
|
88
118
|
MIT
|
package/dist/base.css
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/* Custom CSS Variables - Dark Theme Defaults */
|
|
2
|
+
:root {
|
|
3
|
+
/* Colors - Default to dark theme */
|
|
4
|
+
--color-primary: #19bfb7;
|
|
5
|
+
--color-primary-hover: #16a39d;
|
|
6
|
+
--color-primary-active: #138883;
|
|
7
|
+
--color-secondary: #8b9ba8;
|
|
8
|
+
--color-secondary-hover: #a3b4c2;
|
|
9
|
+
--color-success: #4ec9b0;
|
|
10
|
+
--color-error: #e07088;
|
|
11
|
+
--color-warning: #d4a574;
|
|
12
|
+
--color-info: #4d9de0;
|
|
13
|
+
--color-background: #0f1419;
|
|
14
|
+
--color-foreground: #e3e8ed;
|
|
15
|
+
--color-muted: #1a2028;
|
|
16
|
+
--color-muted-foreground: #8b9ba8;
|
|
17
|
+
--color-placeholder: #5a6b7a;
|
|
18
|
+
--color-border: #2d3843;
|
|
19
|
+
|
|
20
|
+
/* Semantic color variants for dark theme */
|
|
21
|
+
--color-info-foreground: #0f1419;
|
|
22
|
+
--color-info-muted: #1a3a52;
|
|
23
|
+
--color-info-muted-foreground: #4d9de0;
|
|
24
|
+
--color-info-border: #4d9de0;
|
|
25
|
+
|
|
26
|
+
--color-success-foreground: #0f1419;
|
|
27
|
+
--color-success-muted: #1a3d2e;
|
|
28
|
+
--color-success-muted-foreground: #4ec9b0;
|
|
29
|
+
--color-success-border: #4ec9b0;
|
|
30
|
+
|
|
31
|
+
--color-warning-foreground: #0f1419;
|
|
32
|
+
--color-warning-muted: #3d311a;
|
|
33
|
+
--color-warning-muted-foreground: #d4a574;
|
|
34
|
+
--color-warning-border: #d4a574;
|
|
35
|
+
|
|
36
|
+
--color-error-foreground: #0f1419;
|
|
37
|
+
--color-error-muted: #3d1a25;
|
|
38
|
+
--color-error-muted-foreground: #e07088;
|
|
39
|
+
--color-error-border: #e07088;
|
|
40
|
+
|
|
41
|
+
/* Spacing */
|
|
42
|
+
--spacing-xs: 0.25rem;
|
|
43
|
+
--spacing-sm: 0.5rem;
|
|
44
|
+
--spacing-md: 1rem;
|
|
45
|
+
--spacing-lg: 1.5rem;
|
|
46
|
+
--spacing-xl: 2rem;
|
|
47
|
+
--spacing-2xl: 2.5rem;
|
|
48
|
+
|
|
49
|
+
/* Border Radius */
|
|
50
|
+
--radius-none: 0;
|
|
51
|
+
--radius-sm: 0.25rem;
|
|
52
|
+
--radius-md: 0.5rem;
|
|
53
|
+
--radius-lg: 0.75rem;
|
|
54
|
+
--radius-xl: 1rem;
|
|
55
|
+
--radius-full: 9999px;
|
|
56
|
+
|
|
57
|
+
/* Typography */
|
|
58
|
+
--text-xs: 0.75rem;
|
|
59
|
+
--text-sm: 0.875rem;
|
|
60
|
+
--text-base: 1rem;
|
|
61
|
+
--text-lg: 1.125rem;
|
|
62
|
+
--text-xl: 1.25rem;
|
|
63
|
+
--text-2xl: 1.5rem;
|
|
64
|
+
--text-3xl: 1.875rem;
|
|
65
|
+
|
|
66
|
+
--font-normal: 400;
|
|
67
|
+
--font-medium: 500;
|
|
68
|
+
--font-semibold: 600;
|
|
69
|
+
--font-bold: 700;
|
|
70
|
+
|
|
71
|
+
/* Component: Button */
|
|
72
|
+
--button-padding-xs-x: 0.5rem;
|
|
73
|
+
--button-padding-xs-y: 0.375rem;
|
|
74
|
+
--button-padding-sm-x: 0.75rem;
|
|
75
|
+
--button-padding-sm-y: 0.5rem;
|
|
76
|
+
--button-padding-md-x: 1rem;
|
|
77
|
+
--button-padding-md-y: 0.625rem;
|
|
78
|
+
--button-padding-lg-x: 1.5rem;
|
|
79
|
+
--button-padding-lg-y: 0.75rem;
|
|
80
|
+
--button-padding-xl-x: 2rem;
|
|
81
|
+
--button-padding-xl-y: 1rem;
|
|
82
|
+
--button-font-size-xs: 0.75rem;
|
|
83
|
+
--button-font-size-sm: 0.875rem;
|
|
84
|
+
--button-font-size-md: 1rem;
|
|
85
|
+
--button-font-size-lg: 1.125rem;
|
|
86
|
+
--button-font-size-xl: 1.25rem;
|
|
87
|
+
--button-radius: 0.5rem;
|
|
88
|
+
--button-font-weight: 500;
|
|
89
|
+
--button-border-width: 2px;
|
|
90
|
+
--button-primary-text: #0f1419;
|
|
91
|
+
--button-secondary-text: #e3e8ed;
|
|
92
|
+
--button-ghost-hover-bg: rgba(99, 102, 241, 0.08);
|
|
93
|
+
--button-ghost-active-bg: rgba(99, 102, 241, 0.16);
|
|
94
|
+
--button-outline-hover-bg: rgba(59, 130, 246, 0.12);
|
|
95
|
+
--button-outline-active-bg: rgba(59, 130, 246, 0.24);
|
|
96
|
+
--button-ghost-active-bg: rgba(0, 0, 0, 0.1);
|
|
97
|
+
--button-outline-hover-bg: rgba(59, 130, 246, 0.1);
|
|
98
|
+
--button-outline-active-bg: rgba(59, 130, 246, 0.2);
|
|
99
|
+
|
|
100
|
+
/* Component: Card */
|
|
101
|
+
--card-padding-none: 0;
|
|
102
|
+
--card-padding-sm: 1rem;
|
|
103
|
+
--card-padding-md: 1.5rem;
|
|
104
|
+
--card-padding-lg: 2rem;
|
|
105
|
+
--card-radius: 0.75rem;
|
|
106
|
+
--card-border-width: 1px;
|
|
107
|
+
--card-shadow-flat: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
108
|
+
--card-shadow-elevated: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
109
|
+
|
|
110
|
+
/* Component: Input */
|
|
111
|
+
--input-padding-x: 0.75rem;
|
|
112
|
+
--input-padding-y: 0.5rem;
|
|
113
|
+
--input-border-radius: 0.5rem;
|
|
114
|
+
--input-border-width: 1px;
|
|
115
|
+
--input-font-size: 1rem;
|
|
116
|
+
|
|
117
|
+
/* Component: Container */
|
|
118
|
+
--container-padding-x: 1rem;
|
|
119
|
+
--container-max-width-sm: 640px;
|
|
120
|
+
--container-max-width-md: 768px;
|
|
121
|
+
--container-max-width-lg: 1024px;
|
|
122
|
+
--container-max-width-xl: 1280px;
|
|
123
|
+
--container-max-width-2xl: 1536px;
|
|
124
|
+
|
|
125
|
+
/* Z-Index Scale - Organized by layer
|
|
126
|
+
* Base: 0-9 (normal content, code blocks, relative elements)
|
|
127
|
+
* Sticky/Fixed: 10-99 (sticky headers, fixed footers)
|
|
128
|
+
* Overlays: 100-999 (dropdowns, popovers, drawers)
|
|
129
|
+
* Modals: 1000-1999 (dialogs, modals, tooltips)
|
|
130
|
+
* Notifications: 2000+ (toasts, alerts, snackbars)
|
|
131
|
+
*/
|
|
132
|
+
|
|
133
|
+
/* Base Layer (0-9) */
|
|
134
|
+
--z-index-base: 0;
|
|
135
|
+
--z-index-code-button: 1;
|
|
136
|
+
|
|
137
|
+
/* Sticky/Fixed Layer (10-99) */
|
|
138
|
+
--z-index-sticky: 10;
|
|
139
|
+
--z-index-nav: 50;
|
|
140
|
+
--z-index-nav-mobile-overlay: 60;
|
|
141
|
+
--z-index-nav-mobile-menu: 70;
|
|
142
|
+
|
|
143
|
+
/* Overlay Layer (100-999) */
|
|
144
|
+
--z-index-drawer-overlay: 100;
|
|
145
|
+
--z-index-drawer-panel: 110;
|
|
146
|
+
--z-index-drawer-header: 120;
|
|
147
|
+
--z-index-drawer-button: 121;
|
|
148
|
+
--z-index-dropdown: 200;
|
|
149
|
+
--z-index-popover: 300;
|
|
150
|
+
--z-index-overlay: 400;
|
|
151
|
+
|
|
152
|
+
/* Modal Layer (1000-1999) */
|
|
153
|
+
--z-index-modal-backdrop: 1000;
|
|
154
|
+
--z-index-modal: 1100;
|
|
155
|
+
--z-index-tooltip: 1200;
|
|
156
|
+
|
|
157
|
+
/* Notification Layer (2000+) */
|
|
158
|
+
--z-index-snackbar: 2000;
|
|
159
|
+
--z-index-toast: 2100;
|
|
160
|
+
|
|
161
|
+
/* Component: Nav */
|
|
162
|
+
--nav-height: 3.5rem;
|
|
163
|
+
--nav-gap: 0.5rem;
|
|
164
|
+
--nav-border-radius: 0.5rem;
|
|
165
|
+
|
|
166
|
+
/* Nav Item Padding */
|
|
167
|
+
--nav-item-padding-xs-x: 0.5rem;
|
|
168
|
+
--nav-item-padding-xs-y: 0.25rem;
|
|
169
|
+
--nav-item-padding-sm-x: 0.75rem;
|
|
170
|
+
--nav-item-padding-sm-y: 0.5rem;
|
|
171
|
+
--nav-item-padding-md-x: 1rem;
|
|
172
|
+
--nav-item-padding-md-y: 0.625rem;
|
|
173
|
+
--nav-item-padding-lg-x: 1.5rem;
|
|
174
|
+
--nav-item-padding-lg-y: 0.75rem;
|
|
175
|
+
--nav-item-padding-xl-x: 2rem;
|
|
176
|
+
--nav-item-padding-xl-y: 1rem;
|
|
177
|
+
|
|
178
|
+
/* Nav Font Sizes */
|
|
179
|
+
--nav-font-size-xs: 0.75rem;
|
|
180
|
+
--nav-font-size-sm: 0.875rem;
|
|
181
|
+
--nav-font-size-md: 1rem;
|
|
182
|
+
--nav-font-size-lg: 1.125rem;
|
|
183
|
+
--nav-font-size-xl: 1.25rem;
|
|
184
|
+
|
|
185
|
+
/* Component: Checkbox */
|
|
186
|
+
--checkbox-size-xs: 1rem;
|
|
187
|
+
--checkbox-size-sm: 1.25rem;
|
|
188
|
+
--checkbox-size-md: 1.5rem;
|
|
189
|
+
--checkbox-size-lg: 1.75rem;
|
|
190
|
+
--checkbox-size-xl: 2rem;
|
|
191
|
+
--checkbox-label-font-size-xs: 0.75rem;
|
|
192
|
+
--checkbox-label-font-size-sm: 0.875rem;
|
|
193
|
+
--checkbox-label-font-size-md: 1rem;
|
|
194
|
+
--checkbox-label-font-size-lg: 1.125rem;
|
|
195
|
+
--checkbox-label-font-size-xl: 1.25rem;
|
|
196
|
+
--checkbox-label-spacing-xs: 0.5rem;
|
|
197
|
+
--checkbox-label-spacing-sm: 0.625rem;
|
|
198
|
+
--checkbox-label-spacing-md: 0.75rem;
|
|
199
|
+
--checkbox-label-spacing-lg: 0.875rem;
|
|
200
|
+
--checkbox-label-spacing-xl: 1rem;
|
|
201
|
+
--checkbox-radius: 0.25rem;
|
|
202
|
+
--checkbox-border-color: #9ca3af;
|
|
203
|
+
--checkbox-checked-color: #2563eb;
|
|
204
|
+
--checkbox-label-color: #4b5563;
|
|
205
|
+
--checkbox-hover-bg: rgba(37, 99, 235, 0.1);
|
|
206
|
+
--checkbox-hover-size: 2rem;
|
|
207
|
+
--checkbox-disabled-opacity: 0.5;
|
|
208
|
+
|
|
209
|
+
/* Component: Radio */
|
|
210
|
+
--radio-size-xs: 1rem;
|
|
211
|
+
--radio-size-sm: 1.25rem;
|
|
212
|
+
--radio-size-md: 1.5rem;
|
|
213
|
+
--radio-size-lg: 1.75rem;
|
|
214
|
+
--radio-size-xl: 2rem;
|
|
215
|
+
--radio-label-font-size-xs: 0.75rem;
|
|
216
|
+
--radio-label-font-size-sm: 0.875rem;
|
|
217
|
+
--radio-label-font-size-md: 1rem;
|
|
218
|
+
--radio-label-font-size-lg: 1.125rem;
|
|
219
|
+
--radio-label-font-size-xl: 1.25rem;
|
|
220
|
+
--radio-label-spacing-xs: 0.5rem;
|
|
221
|
+
--radio-label-spacing-sm: 0.625rem;
|
|
222
|
+
--radio-label-spacing-md: 0.75rem;
|
|
223
|
+
--radio-label-spacing-lg: 0.875rem;
|
|
224
|
+
--radio-label-spacing-xl: 1rem;
|
|
225
|
+
--radio-border-color: #9ca3af;
|
|
226
|
+
--radio-checked-color: #2563eb;
|
|
227
|
+
--radio-label-color: #4b5563;
|
|
228
|
+
--radio-hover-bg: rgba(37, 99, 235, 0.1);
|
|
229
|
+
--radio-hover-size: 2rem;
|
|
230
|
+
--radio-disabled-opacity: 0.5;
|
|
231
|
+
|
|
232
|
+
/* Form Controls: Shared spacing between control and label */
|
|
233
|
+
--form-control-label-gap: 0.5rem; /* 8px / gap-2 */
|
|
234
|
+
|
|
235
|
+
/* Component: Drawer */
|
|
236
|
+
--drawer-section-padding-y: 1rem;
|
|
237
|
+
--drawer-title-margin-bottom: 0.5rem;
|
|
238
|
+
--drawer-item-spacing: 0.25rem;
|
|
239
|
+
--drawer-item-padding-x: 1rem;
|
|
240
|
+
--drawer-item-padding-y: 0.625rem;
|
|
241
|
+
--drawer-font-size: 0.875rem;
|
|
242
|
+
--drawer-border-radius: 0.5rem;
|
|
243
|
+
|
|
244
|
+
/* Component: Dropdown */
|
|
245
|
+
--dropdown-radius: 0.5rem;
|
|
246
|
+
|
|
247
|
+
/* Dropdown Trigger Padding */
|
|
248
|
+
--dropdown-padding-xs-x: 0.5rem;
|
|
249
|
+
--dropdown-padding-xs-y: 0.375rem;
|
|
250
|
+
--dropdown-padding-sm-x: 0.75rem;
|
|
251
|
+
--dropdown-padding-sm-y: 0.5rem;
|
|
252
|
+
--dropdown-padding-md-x: 0.75rem;
|
|
253
|
+
--dropdown-padding-md-y: 0.625rem;
|
|
254
|
+
--dropdown-padding-lg-x: 1rem;
|
|
255
|
+
--dropdown-padding-lg-y: 0.75rem;
|
|
256
|
+
--dropdown-padding-xl-x: 1.25rem;
|
|
257
|
+
--dropdown-padding-xl-y: 0.875rem;
|
|
258
|
+
|
|
259
|
+
/* Dropdown Font Sizes */
|
|
260
|
+
--dropdown-font-size-xs: 0.75rem;
|
|
261
|
+
--dropdown-font-size-sm: 0.875rem;
|
|
262
|
+
--dropdown-font-size-md: 1rem;
|
|
263
|
+
--dropdown-font-size-lg: 1.125rem;
|
|
264
|
+
--dropdown-font-size-xl: 1.25rem;
|
|
265
|
+
|
|
266
|
+
/* Dropdown Icon Sizes */
|
|
267
|
+
--dropdown-icon-size-xs: 0.875rem;
|
|
268
|
+
--dropdown-icon-size-sm: 1rem;
|
|
269
|
+
--dropdown-icon-size-md: 1.25rem;
|
|
270
|
+
--dropdown-icon-size-lg: 1.5rem;
|
|
271
|
+
--dropdown-icon-size-xl: 1.75rem;
|
|
272
|
+
|
|
273
|
+
/* Dropdown Option Padding */
|
|
274
|
+
--dropdown-option-padding-xs-x: 0.5rem;
|
|
275
|
+
--dropdown-option-padding-xs-y: 0.375rem;
|
|
276
|
+
--dropdown-option-padding-sm-x: 0.75rem;
|
|
277
|
+
--dropdown-option-padding-sm-y: 0.5rem;
|
|
278
|
+
--dropdown-option-padding-md-x: 0.75rem;
|
|
279
|
+
--dropdown-option-padding-md-y: 0.625rem;
|
|
280
|
+
--dropdown-option-padding-lg-x: 1rem;
|
|
281
|
+
--dropdown-option-padding-lg-y: 0.75rem;
|
|
282
|
+
--dropdown-option-padding-xl-x: 1.25rem;
|
|
283
|
+
--dropdown-option-padding-xl-y: 0.875rem;
|
|
284
|
+
|
|
285
|
+
/* Dropdown Option Font Sizes */
|
|
286
|
+
--dropdown-option-font-size-xs: 0.75rem;
|
|
287
|
+
--dropdown-option-font-size-sm: 0.875rem;
|
|
288
|
+
--dropdown-option-font-size-md: 1rem;
|
|
289
|
+
--dropdown-option-font-size-lg: 1.125rem;
|
|
290
|
+
--dropdown-option-font-size-xl: 1.25rem;
|
|
291
|
+
|
|
292
|
+
/* Component: Rating */
|
|
293
|
+
--star-size: 1.5rem;
|
|
294
|
+
}
|