@yomologic/react-ui 0.2.7 → 0.4.0

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 CHANGED
@@ -1,71 +1,74 @@
1
1
  # @yomologic/react-ui
2
2
 
3
- A modern, lightweight React UI component library built with TypeScript and designed for flexibility and ease of use.
3
+ A modern, lightweight React UI component library built with TypeScript and Tailwind CSS.
4
+
5
+ > **📚 [View Full Documentation & Live Examples →](https://react-ui.yomologic.com/)**
4
6
 
5
7
  ## Features
6
8
 
7
- - 🎨 **Modern Design** - Clean, professional components
9
+ - 🎨 **Themeable** - Built-in dark theme with CSS variables
10
+ - 🎯 **TypeScript** - Complete type safety
8
11
  - 📦 **Tree-shakeable** - Import only what you need
9
- - 🎯 **TypeScript** - Full type safety
10
- - **Zero Dependencies** - Minimal bundle size (except lucide-react for icons)
11
- - 🎭 **Customizable** - Easy to style and extend
12
- - ♿ **Accessible** - Built with accessibility in mind
12
+ - **Framework-agnostic** - Works with Next.js, Remix, Vite, etc.
13
+ - **Accessible** - ARIA compliant
14
+ - 📱 **Responsive** - Mobile-first design
13
15
 
14
16
  ## Installation
15
17
 
16
18
  ```bash
17
- # Using yarn
18
- yarn add @yomologic/react-ui
19
-
20
- # Using npm
21
19
  npm install @yomologic/react-ui
20
+ # or
21
+ yarn add @yomologic/react-ui
22
22
  ```
23
23
 
24
- ## Usage
24
+ ## Quick Start
25
25
 
26
26
  ```tsx
27
- import { Button, Input, Card } from "@yomologic/react-ui";
27
+ import "@yomologic/react-ui/dist/base.css";
28
+ import "@yomologic/react-ui/dist/styles.css";
29
+ import { Button, Card, Input } from "@yomologic/react-ui";
28
30
 
29
31
  function App() {
30
- return (
31
- <Card padding="lg">
32
- <Input label="Email" type="email" placeholder="you@example.com" />
33
- <Button variant="primary" size="md">
34
- Submit
35
- </Button>
36
- </Card>
37
- );
32
+ return (
33
+ <Card padding="lg">
34
+ <Input label="Email" type="email" />
35
+ <Button variant="primary">Submit</Button>
36
+ </Card>
37
+ );
38
38
  }
39
39
  ```
40
40
 
41
- ## Components
42
-
43
- ### UI Components
41
+ ## Theming
44
42
 
45
- - **Button** - Interactive buttons with variants (primary, secondary, outline, ghost, danger)
46
- - **Input** - Text inputs with labels, icons, and validation states
47
- - **Card** - Flexible container with variants and padding options
48
- - **Badge** - Status indicators and labels
49
- - **Checkbox** - Single checkboxes and checkbox groups
50
- - **RadioGroup** - Radio button groups for single selections
51
- - **Dropdown** - Select dropdowns with search and custom options
52
- - **Spinner** - Loading indicators
53
- - **CodeSnippet** - Syntax-highlighted code display
43
+ Override CSS variables to customize the built-in dark theme:
54
44
 
55
- ### Feedback Components
45
+ ```css
46
+ /* custom-theme.css */
47
+ :root {
48
+ --color-primary: #3b82f6;
49
+ --color-primary-hover: #2563eb;
50
+ --color-background: #ffffff;
51
+ --color-foreground: #111827;
52
+ --color-muted: #f3f4f6;
53
+ --color-border: #e5e7eb;
54
+ /* ...more variables */
55
+ }
56
+ ```
56
57
 
57
- - **Alert** - Contextual feedback messages (info, success, warning, error)
58
+ Import your custom theme **after** the base styles:
58
59
 
59
- ### Layout Components
60
+ ```tsx
61
+ import "@yomologic/react-ui/dist/base.css";
62
+ import "@yomologic/react-ui/dist/styles.css";
63
+ import "./custom-theme.css"; // Your overrides
64
+ ```
60
65
 
61
- - **Container** - Responsive page container
62
- - **SectionLayout** - Layout wrapper for sections
63
- - **Drawer** - Navigation drawer/sidebar
64
- - **SidebarNav** - (Deprecated, use Drawer instead)
66
+ ## Documentation
65
67
 
66
- ### Shared Components
68
+ **Full documentation, live examples, and interactive demos:**
69
+ 👉 **[react-ui.yomologic.com](https://react-ui.yomologic.com/)**
67
70
 
68
- - **EmptyState** - Empty state placeholders
71
+ Browse all components, see code examples, and experiment with variants in our interactive showcase.
69
72
 
70
73
  ## Development
71
74
 
@@ -83,6 +86,10 @@ yarn dev
83
86
  yarn type-check
84
87
  ```
85
88
 
89
+ ## Contributing
90
+
91
+ This is a private component library for Yomologic projects. For internal development documentation, see the implementation guides in the repository.
92
+
86
93
  ## License
87
94
 
88
95
  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
+ }