@mdigital_ui/ui 0.5.0 → 0.5.2

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,53 +1,110 @@
1
+ <div align="center">
2
+
1
3
  # @mdigital_ui/ui
2
4
 
3
- React component library. 76 components. Tailwind CSS v4, CVA, Radix UI.
5
+ **A modern React component library built for speed.**
6
+
7
+ 76 components · Tailwind CSS v4 · Slot-based theming · Tree-shakeable
8
+
9
+ [![CI](https://github.com/mstrluke/mdigital_uikit/actions/workflows/ci.yml/badge.svg)](https://github.com/mstrluke/mdigital_uikit/actions/workflows/ci.yml)
10
+ [![npm](https://img.shields.io/npm/v/@mdigital_ui/ui?color=blue)](https://www.npmjs.com/package/@mdigital_ui/ui)
11
+ [![downloads](https://img.shields.io/npm/dm/@mdigital_ui/ui?color=green)](https://www.npmjs.com/package/@mdigital_ui/ui)
12
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/@mdigital_ui/ui)](https://bundlephobia.com/package/@mdigital_ui/ui)
13
+ [![license](https://img.shields.io/github/license/mstrluke/mdigital_uikit)](https://github.com/mstrluke/mdigital_uikit/blob/main/LICENSE)
14
+
15
+ [Changelog](https://github.com/mstrluke/mdigital_uikit/releases) · [Report Bug](https://github.com/mstrluke/mdigital_uikit/issues/new?template=bug_report.md) · [Request Feature](https://github.com/mstrluke/mdigital_uikit/issues/new?template=feature_request.md)
16
+
17
+ </div>
18
+
19
+ ---
20
+
21
+ ## Why This Library?
22
+
23
+ | | @mdigital_ui/ui | shadcn/ui | Ant Design | Chakra UI |
24
+ |---|---|---|---|---|
25
+ | **Theming** | Slot-based color system — 1 prop themes everything | Copy-paste, manual | Token config object | colorScheme prop |
26
+ | **Tailwind** | v4 native (`@theme`, `@source`) | v3 with config | No Tailwind | No Tailwind |
27
+ | **Bundle** | Tree-shake per component | Copy into project | 300KB+ full bundle | 200KB+ full bundle |
28
+ | **Dark mode** | Zero-config CSS variables | Manual `dark:` classes | ConfigProvider | ColorModeProvider |
29
+ | **Components** | 76 production-ready | ~50 primitives | 60+ | 60+ |
30
+ | **Tests** | 1,556 tests | Community | Extensive | Moderate |
31
+
32
+ ### The Slot Color System
33
+
34
+ One `color` prop. Every part of the component responds — backgrounds, borders, text, hover states, focus rings. No manual mapping. No 49 color variants hardcoded per component.
35
+
36
+ ```tsx
37
+ <Button color="primary">Submit</Button>
38
+ <Button color="error">Delete</Button>
39
+ <Alert color="warning">Watch out</Alert>
40
+ <Badge color="success">Active</Badge>
41
+ ```
42
+
43
+ Under the hood, `color="primary"` sets a single CSS variable `--_c`. Every slot utility (`bg-slot`, `text-slot`, `border-slot-30`, `bg-slot-10`) derives from it automatically. Add a new color to your theme → every component supports it instantly.
44
+
45
+ ### Tailwind CSS v4 Native
46
+
47
+ Not "works with Tailwind" — **built on v4's architecture**:
48
+
49
+ - `@theme` block defines all tokens as CSS custom properties
50
+ - `@source` auto-scans compiled components — no manual safelist
51
+ - `@custom-variant dark` — dark mode via `.dark` class on `<html>`
52
+ - `@utility` defines the slot color system as real Tailwind utilities
53
+ - When Tailwind ships new features, you get them. No wrapper layer in the way.
54
+
55
+ ### Per-Component Imports
4
56
 
5
- ## Install
57
+ Every component is its own entry point. Import what you use, ship only what you use:
58
+
59
+ ```tsx
60
+ import Button from '@mdigital_ui/ui/button' // just Button
61
+ import Table from '@mdigital_ui/ui/table' // just Table
62
+ import { useTheme } from '@mdigital_ui/ui/theme' // just the hook
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Quick Start
6
68
 
7
69
  ```bash
8
70
  npm install @mdigital_ui/ui
9
71
  ```
10
72
 
11
- Peer deps: `react`, `react-dom`, `lucide-react`, `tailwindcss` (v4+)
12
-
13
- ## Setup
73
+ > **Peer deps:** `react` ≥18, `react-dom` ≥18, `lucide-react` ≥0.400, `tailwindcss` ≥4.0
14
74
 
15
- Your project needs Tailwind CSS v4 with either `@tailwindcss/vite` or `@tailwindcss/postcss`.
75
+ ### CSS Setup
16
76
 
17
- In your CSS entry point:
77
+ Your project needs Tailwind CSS v4 with `@tailwindcss/vite` or `@tailwindcss/postcss`.
18
78
 
19
79
  ```css
20
80
  @import "tailwindcss";
21
81
  @import "@mdigital_ui/ui/styles/global.css";
22
82
  ```
23
83
 
24
- That's it. Our CSS provides:
25
- - `@theme` — all design tokens as CSS variables (override in `:root`)
26
- - `@source "../dist"` — Tailwind auto-scans our compiled components for class names
27
- - `@custom-variant dark` — dark mode via `.dark` class
28
- - `@utility` — slot-based color system, stroke utilities
29
- - Component-specific styles (datepicker, animations)
84
+ That's it. One import. Tokens, dark mode, utilities, component styles — all included.
30
85
 
31
- Your Tailwind build processes everything. When Tailwind ships new utilities or features, you get them immediately.
32
-
33
- ## Usage
86
+ ### Use It
34
87
 
35
88
  ```tsx
36
89
  import Button from '@mdigital_ui/ui/button'
37
90
  import Input from '@mdigital_ui/ui/input'
38
- import { Card, CardHeader, CardTitle, CardContent } from '@mdigital_ui/ui/card'
91
+ import Select from '@mdigital_ui/ui/select'
92
+
93
+ function App() {
94
+ return (
95
+ <div className="flex gap-3">
96
+ <Input placeholder="Search..." />
97
+ <Select options={[{ label: 'React', value: 'react' }]} />
98
+ <Button color="primary">Go</Button>
99
+ </div>
100
+ )
101
+ }
39
102
  ```
40
103
 
41
- Barrel import also works:
42
-
43
- ```tsx
44
- import { Button, Input, Card } from '@mdigital_ui/ui'
45
- ```
104
+ ---
46
105
 
47
106
  ## Dark Mode
48
107
 
49
- Toggle `.dark` class on `<html>`:
50
-
51
108
  ```tsx
52
109
  import { ThemeProvider, useTheme } from '@mdigital_ui/ui/theme'
53
110
 
@@ -55,258 +112,264 @@ import { ThemeProvider, useTheme } from '@mdigital_ui/ui/theme'
55
112
  <App />
56
113
  </ThemeProvider>
57
114
 
58
- // anywhere:
59
- const { theme, setTheme, resolvedTheme } = useTheme()
115
+ // Toggle anywhere:
116
+ const { setTheme } = useTheme()
60
117
  setTheme('dark') // 'light' | 'dark' | 'system'
61
118
  ```
62
119
 
63
120
  SSR flash prevention — add to `<head>`:
64
121
 
65
122
  ```tsx
66
- import { themeScript } from '@mdigital_ui/ui/theme'
123
+ import { getThemeScript } from '@mdigital_ui/ui/theme'
67
124
 
68
- <script dangerouslySetInnerHTML={{ __html: themeScript }} />
125
+ <script dangerouslySetInnerHTML={{ __html: getThemeScript() }} />
69
126
  ```
70
127
 
71
- All components use CSS custom properties. Dark mode swaps values at `:root` level. No `dark:` prefixes needed.
128
+ All components use CSS custom properties. Dark mode swaps values at `:root`. Zero `dark:` prefixes in component code.
72
129
 
73
130
  ## Theme Presets
74
131
 
75
- ```tsx
76
- import '@mdigital_ui/ui/styles/global.css'
77
- import '@mdigital_ui/ui/styles/themes/presets/corporate.css'
132
+ ```css
133
+ @import "@mdigital_ui/ui/styles/global.css";
134
+ @import "@mdigital_ui/ui/styles/themes/presets/corporate.css";
78
135
  ```
79
136
 
80
137
  ```html
81
138
  <html data-theme="corporate" class="dark">
82
139
  ```
83
140
 
84
- Presets: `corporate`, `vibrant`, `minimal`. Independent of dark/light — combine freely.
141
+ Available: `corporate`, `vibrant`, `minimal`. Mix with dark/light freely.
85
142
 
86
143
  ## Custom Tokens
87
144
 
88
- All tokens live in one `@theme` block. Override after our import:
145
+ Override after our import no `!important` needed:
89
146
 
90
147
  ```css
148
+ @import "tailwindcss";
149
+ @import "@mdigital_ui/ui/styles/global.css";
150
+
151
+ /* Your overrides — just plain :root, wins by source order */
91
152
  :root {
92
153
  --color-primary: oklch(0.55 0.22 270);
93
154
  --color-primary-hover: oklch(0.50 0.24 270);
94
155
  --color-primary-foreground: oklch(1 0 0);
95
-
96
156
  --color-background: oklch(0.98 0 0);
97
- --color-surface: oklch(0.95 0 0);
98
- --color-border: oklch(0.90 0 0);
99
- --color-text-primary: oklch(0.15 0 0);
100
- --color-text-secondary: oklch(0.45 0 0);
101
-
102
- --button-height-md: 2.5rem;
103
- --input-height-md: 2.5rem;
104
157
  --font-sans: 'Inter', system-ui, sans-serif;
158
+ --button-height-md: 2.5rem;
159
+ }
160
+
161
+ /* Optional: different dark mode values */
162
+ .dark {
163
+ --color-primary: oklch(0.65 0.22 270);
164
+ --color-background: oklch(0.12 0.01 270);
105
165
  }
106
166
  ```
107
167
 
108
- Full token list in [CSS Variables](#css-variables).
168
+ Every token is a CSS variable. Change one, it propagates everywhere. Dark mode selectors use `:where()` to keep specificity flat — your overrides always win by source order.
109
169
 
110
- ## Common Props
170
+ ---
111
171
 
112
- ### color
172
+ ## Common API
173
+
174
+ ### `color`
113
175
 
114
176
  ```
115
177
  'default' | 'primary' | 'secondary' | 'accent' | 'success' | 'error' | 'warning' | 'info'
116
178
  ```
117
179
 
118
- ### size
180
+ ### `size`
119
181
 
120
182
  ```
121
183
  'xs' | 'sm' | 'md' | 'lg'
122
184
  ```
123
185
 
124
- ### variant
186
+ ### `variant`
125
187
 
126
- Per-component. Examples:
127
- - Button: `solid`, `outline`, `soft`, `dashed`, `link`, `ghost`
128
- - Card: `default`, `solid`, `outline`, `soft`, `ghost`, `elevated`
129
- - Input: `outline`, `filled`
130
- - Badge/Tag: `default`, `solid`, `outline`, `soft`
188
+ Per-component:
189
+ - **Button:** `solid` `outline` `soft` `dashed` `link` `ghost`
190
+ - **Card:** `default` `solid` `outline` `soft` `ghost` `elevated`
191
+ - **Checkbox / Toggle:** `solid` `outline` `soft`
192
+ - **Input:** `outline` `filled`
193
+ - **Badge / Tag:** `default` `solid` `outline` `soft`
131
194
 
132
195
  ### Validation
133
196
 
134
- Form components accept validation as string (message) or boolean:
135
-
136
197
  ```tsx
137
198
  <Input error="Required field" />
138
199
  <Input warning="Weak password" />
139
200
  <Input success />
140
201
  ```
141
202
 
142
- ## Styling
203
+ ### Styling Escape Hatches
143
204
 
144
- ### className
205
+ ```tsx
206
+ // Root element
207
+ <Button className="shadow-lg">Submit</Button>
145
208
 
146
- Root element:
209
+ // Internal parts
210
+ <Input classNames={{ root: 'mb-4', label: 'font-bold', input: 'tracking-wide' }} />
147
211
 
148
- ```tsx
149
- <Button className="shadow-lg mt-4">Submit</Button>
212
+ // CSS selectors — every part has a semantic class + data-slot
213
+ .input_label { font-weight: 700; }
214
+ [data-slot="trigger"] { min-width: 200px; }
150
215
  ```
151
216
 
152
- ### classNames
217
+ ---
153
218
 
154
- Target internal parts:
219
+ ## All 76 Components
155
220
 
156
- ```tsx
157
- <Input
158
- classNames={{
159
- root: 'mb-4',
160
- label: 'font-bold',
161
- input: 'tracking-wide',
162
- helper: 'italic',
163
- }}
164
- />
165
- ```
221
+ <details>
222
+ <summary><b>Data Entry (27)</b></summary>
223
+
224
+ | Component | Import |
225
+ |-----------|--------|
226
+ | Input | `@mdigital_ui/ui/input` |
227
+ | FloatInput | `@mdigital_ui/ui/float-input` |
228
+ | InputPassword | `@mdigital_ui/ui/input-password` |
229
+ | InputOTP | `@mdigital_ui/ui/input-otp` |
230
+ | InputGroup | `@mdigital_ui/ui/input-group` |
231
+ | NumberInput | `@mdigital_ui/ui/number-input` |
232
+ | Textarea | `@mdigital_ui/ui/textarea` |
233
+ | Select | `@mdigital_ui/ui/select` |
234
+ | MultiSelect | `@mdigital_ui/ui/multi-select` |
235
+ | Cascader | `@mdigital_ui/ui/cascader` |
236
+ | TreeSelect | `@mdigital_ui/ui/tree-select` |
237
+ | DatePicker | `@mdigital_ui/ui/date-picker` |
238
+ | ColorPicker | `@mdigital_ui/ui/color-picker` |
239
+ | Autocomplete | `@mdigital_ui/ui/autocomplete` |
240
+ | Mentions | `@mdigital_ui/ui/mentions` |
241
+ | Checkbox | `@mdigital_ui/ui/checkbox` |
242
+ | CheckboxGroup | `@mdigital_ui/ui/checkbox-group` |
243
+ | Radio | `@mdigital_ui/ui/radio` |
244
+ | RadioGroup | `@mdigital_ui/ui/radio-group` |
245
+ | Switch | `@mdigital_ui/ui/switch` |
246
+ | Slider | `@mdigital_ui/ui/slider` |
247
+ | Rating | `@mdigital_ui/ui/rating` |
248
+ | Toggle | `@mdigital_ui/ui/toggle` |
249
+ | ToggleGroup | `@mdigital_ui/ui/toggle-group` |
250
+ | Upload | `@mdigital_ui/ui/upload` |
251
+ | Clipboard | `@mdigital_ui/ui/clipboard` |
252
+ | TagsInput | `@mdigital_ui/ui/tags-input` |
166
253
 
167
- ### CSS selectors
254
+ </details>
168
255
 
169
- Every part gets a semantic class and `data-slot`:
256
+ <details>
257
+ <summary><b>Layout (9)</b></summary>
258
+
259
+ | Component | Import |
260
+ |-----------|--------|
261
+ | Button | `@mdigital_ui/ui/button` |
262
+ | ButtonGroup | `@mdigital_ui/ui/button-group` |
263
+ | Card | `@mdigital_ui/ui/card` |
264
+ | Grid | `@mdigital_ui/ui/grid` |
265
+ | Divider | `@mdigital_ui/ui/divider` |
266
+ | Collapse | `@mdigital_ui/ui/collapse` |
267
+ | Accordion | `@mdigital_ui/ui/accordion` |
268
+ | ScrollArea | `@mdigital_ui/ui/scroll-area` |
269
+ | Resizable | `@mdigital_ui/ui/resizable` |
170
270
 
171
- ```css
172
- .button_root { border-radius: 12px; }
173
- .input_label { font-weight: 700; }
174
- [data-slot="trigger"] { min-width: 200px; }
175
- ```
271
+ </details>
272
+
273
+ <details>
274
+ <summary><b>Navigation (12)</b></summary>
275
+
276
+ | Component | Import |
277
+ |-----------|--------|
278
+ | Tabs | `@mdigital_ui/ui/tabs` |
279
+ | Breadcrumbs | `@mdigital_ui/ui/breadcrumbs` |
280
+ | Pagination | `@mdigital_ui/ui/pagination` |
281
+ | Stepper | `@mdigital_ui/ui/stepper` |
282
+ | Dropdown | `@mdigital_ui/ui/dropdown` |
283
+ | ContextMenu | `@mdigital_ui/ui/context-menu` |
284
+ | Menubar | `@mdigital_ui/ui/menubar` |
285
+ | NavigationMenu | `@mdigital_ui/ui/navigation-menu` |
286
+ | Command | `@mdigital_ui/ui/command` |
287
+ | Anchor | `@mdigital_ui/ui/anchor` |
288
+ | Link | `@mdigital_ui/ui/link` |
289
+ | FloatButton | `@mdigital_ui/ui/float-button` |
176
290
 
177
- ## Components
178
-
179
- ### Inputs
180
-
181
- | Component | Path |
182
- |-----------|------|
183
- | Input | `input` |
184
- | FloatInput | `float-input` |
185
- | InputPassword | `input-password` |
186
- | InputOTP | `input-otp` |
187
- | InputGroup | `input-group` |
188
- | NumberInput | `number-input` |
189
- | Textarea | `textarea` |
190
- | Select | `select` |
191
- | MultiSelect | `multi-select` |
192
- | Cascader | `cascader` |
193
- | TreeSelect | `tree-select` |
194
- | DatePicker | `date-picker` |
195
- | ColorPicker | `color-picker` |
196
- | Autocomplete | `autocomplete` |
197
- | Mentions | `mentions` |
198
- | Checkbox | `checkbox` |
199
- | CheckboxGroup | `checkbox-group` |
200
- | Radio | `radio` |
201
- | RadioGroup | `radio-group` |
202
- | Switch | `switch` |
203
- | Slider | `slider` |
204
- | Rating | `rating` |
205
- | Toggle | `toggle` |
206
- | ToggleGroup | `toggle-group` |
207
- | Upload | `upload` |
208
- | Clipboard | `clipboard` |
209
- | TagsInput | `tags-input` |
210
-
211
- ### Layout
212
-
213
- | Component | Path |
214
- |-----------|------|
215
- | Button | `button` |
216
- | ButtonGroup | `button-group` |
217
- | Card | `card` |
218
- | Grid | `grid` |
219
- | Divider | `divider` |
220
- | Collapse | `collapse` |
221
- | Accordion | `accordion` |
222
- | ScrollArea | `scroll-area` |
223
- | Resizable | `resizable` |
224
-
225
- ### Navigation
226
-
227
- | Component | Path |
228
- |-----------|------|
229
- | Tabs | `tabs` |
230
- | Breadcrumbs | `breadcrumbs` |
231
- | Pagination | `pagination` |
232
- | Stepper | `stepper` |
233
- | Dropdown | `dropdown` |
234
- | ContextMenu | `context-menu` |
235
- | Menubar | `menubar` |
236
- | NavigationMenu | `navigation-menu` |
237
- | Command | `command` |
238
- | Anchor | `anchor` |
239
- | Link | `link` |
240
- | FloatButton | `float-button` |
241
-
242
- ### Overlays
243
-
244
- | Component | Path |
245
- |-----------|------|
246
- | Modal | `modal` |
247
- | Drawer | `drawer` |
248
- | Tooltip | `tooltip` |
249
- | Popover | `popover` |
250
- | Tour | `tour` |
251
-
252
- ### Feedback
253
-
254
- | Component | Path |
255
- |-----------|------|
256
- | Notification | `notification` |
257
- | Alert | `alert` |
258
- | Toast | `toast` |
259
- | Progress | `progress` |
260
- | Spinner | `spinner` |
261
- | Skeleton | `skeleton` |
262
- | Result | `result` |
263
- | FetchingOverlay | `fetching-overlay` |
264
-
265
- ### Data
266
-
267
- | Component | Path |
268
- |-----------|------|
269
- | Table | `table` |
270
- | Tree | `tree` |
271
- | Calendar | `calendar` |
272
- | Descriptions | `descriptions` |
273
- | Timeline | `timeline` |
274
- | Transfer | `transfer` |
275
- | Carousel | `carousel` |
276
- | Image | `image` |
277
- | QRCode | `qr-code` |
278
-
279
- ### Display
280
-
281
- | Component | Path |
282
- |-----------|------|
283
- | Badge | `badge` |
284
- | Tag | `tag` |
285
- | Avatar | `avatar` |
286
- | Kbd | `kbd` |
287
- | Typography | `typography` |
288
- | Watermark | `watermark` |
289
-
290
- ### Theme
291
-
292
- | Export | Path |
293
- |--------|------|
294
- | ThemeProvider, useTheme, themeScript | `theme` |
295
-
296
- ### Hooks
297
-
298
- | Hook | Path |
299
- |------|------|
300
- | useControllable | `hooks/useControllable` |
301
- | useDebounce | `hooks/useDebounce` |
302
- | useThrottle | `hooks/useThrottle` |
303
- | useMediaQuery | `hooks/useMediaQuery` |
304
- | useRipple | `hooks/useRipple` |
305
-
306
- ## CSS Variables
291
+ </details>
292
+
293
+ <details>
294
+ <summary><b>Overlays (5)</b></summary>
295
+
296
+ | Component | Import |
297
+ |-----------|--------|
298
+ | Modal | `@mdigital_ui/ui/modal` |
299
+ | Drawer | `@mdigital_ui/ui/drawer` |
300
+ | Tooltip | `@mdigital_ui/ui/tooltip` |
301
+ | Popover | `@mdigital_ui/ui/popover` |
302
+ | Tour | `@mdigital_ui/ui/tour` |
303
+
304
+ </details>
307
305
 
308
306
  <details>
309
- <summary>Colors</summary>
307
+ <summary><b>Feedback (8)</b></summary>
308
+
309
+ | Component | Import |
310
+ |-----------|--------|
311
+ | Notification | `@mdigital_ui/ui/notification` |
312
+ | Alert | `@mdigital_ui/ui/alert` |
313
+ | Toast | `@mdigital_ui/ui/toast` |
314
+ | Progress | `@mdigital_ui/ui/progress` |
315
+ | Spinner | `@mdigital_ui/ui/spinner` |
316
+ | Skeleton | `@mdigital_ui/ui/skeleton` |
317
+ | Result | `@mdigital_ui/ui/result` |
318
+ | FetchingOverlay | `@mdigital_ui/ui/fetching-overlay` |
319
+
320
+ </details>
321
+
322
+ <details>
323
+ <summary><b>Data Display (9)</b></summary>
324
+
325
+ | Component | Import |
326
+ |-----------|--------|
327
+ | Table | `@mdigital_ui/ui/table` |
328
+ | Tree | `@mdigital_ui/ui/tree` |
329
+ | Calendar | `@mdigital_ui/ui/calendar` |
330
+ | Descriptions | `@mdigital_ui/ui/descriptions` |
331
+ | Timeline | `@mdigital_ui/ui/timeline` |
332
+ | Transfer | `@mdigital_ui/ui/transfer` |
333
+ | Carousel | `@mdigital_ui/ui/carousel` |
334
+ | Image | `@mdigital_ui/ui/image` |
335
+ | QRCode | `@mdigital_ui/ui/qr-code` |
336
+
337
+ </details>
338
+
339
+ <details>
340
+ <summary><b>General (6)</b></summary>
341
+
342
+ | Component | Import |
343
+ |-----------|--------|
344
+ | Badge | `@mdigital_ui/ui/badge` |
345
+ | Tag | `@mdigital_ui/ui/tag` |
346
+ | Avatar | `@mdigital_ui/ui/avatar` |
347
+ | Kbd | `@mdigital_ui/ui/kbd` |
348
+ | Typography | `@mdigital_ui/ui/typography` |
349
+ | Watermark | `@mdigital_ui/ui/watermark` |
350
+
351
+ </details>
352
+
353
+ <details>
354
+ <summary><b>Theme & Hooks</b></summary>
355
+
356
+ | Export | Import |
357
+ |--------|--------|
358
+ | ThemeProvider, useTheme, getThemeScript | `@mdigital_ui/ui/theme` |
359
+ | useControllable | `@mdigital_ui/ui/hooks/useControllable` |
360
+ | useDebounce | `@mdigital_ui/ui/hooks/useDebounce` |
361
+ | useThrottle | `@mdigital_ui/ui/hooks/useThrottle` |
362
+ | useMediaQuery | `@mdigital_ui/ui/hooks/useMediaQuery` |
363
+ | useRipple | `@mdigital_ui/ui/hooks/useRipple` |
364
+
365
+ </details>
366
+
367
+ ---
368
+
369
+ ## CSS Variables Reference
370
+
371
+ <details>
372
+ <summary><b>Colors</b></summary>
310
373
 
311
374
  ```
312
375
  --color-primary / -hover / -active / -foreground
@@ -322,10 +385,7 @@ Every part gets a semantic class and `data-slot`:
322
385
  --color-card / -foreground
323
386
  --color-border / -primary / -hover / -focus
324
387
 
325
- --color-text-primary
326
- --color-text-secondary
327
- --color-text-muted
328
- --color-text-disabled
388
+ --color-text-primary / -secondary / -muted / -disabled
329
389
 
330
390
  --color-input-bg / -text / -placeholder / -border / -border-focus / -border-error
331
391
  --color-focus / -ring
@@ -336,61 +396,43 @@ Every part gets a semantic class and `data-slot`:
336
396
  </details>
337
397
 
338
398
  <details>
339
- <summary>Sizing</summary>
399
+ <summary><b>Sizing</b></summary>
340
400
 
341
401
  ```
342
- --size-xs / -sm / -md / -lg (shared base heights)
343
-
344
- --button-height-xs/sm/md/lg
345
- --button-padding-x-xs/sm/md/lg
346
-
347
- --input-height-xs/sm/md/lg
348
- --input-padding-x-xs/sm/md/lg
349
-
350
- --select-height-xs/sm/md/lg
351
- --select-padding-x-xs/sm/md/lg
352
-
353
- --toggle-height-xs/sm/md/lg
354
- --toggle-padding-x-xs/sm/md/lg
355
-
402
+ --button-height-xs/sm/md/lg --button-padding-x-xs/sm/md/lg
403
+ --input-height-xs/sm/md/lg --input-padding-x-xs/sm/md/lg
404
+ --select-height-xs/sm/md/lg --select-padding-x-xs/sm/md/lg
405
+ --toggle-height-xs/sm/md/lg --toggle-padding-x-xs/sm/md/lg
356
406
  --textarea-min-height-xs/sm/md/lg
357
- --textarea-padding-xs/sm/md/lg
358
-
359
407
  --checkbox-size-xs/sm/md/lg
360
- --switch-width-xs/sm/md/lg
361
- --switch-height-xs/sm/md/lg
408
+ --switch-width-xs/sm/md/lg --switch-height-xs/sm/md/lg
362
409
  --otp-size-xs/sm/md/lg
363
-
364
410
  --accordion-padding-x-xs/sm/md/lg
365
- --accordion-padding-y-xs/sm/md/lg
366
411
  ```
367
412
 
368
413
  </details>
369
414
 
370
415
  <details>
371
- <summary>Effects & Layout</summary>
416
+ <summary><b>Effects & Z-Index</b></summary>
372
417
 
373
418
  ```
374
419
  --shadow-sm / -md / -lg / -xl / -2xl
375
- --overlay-stripe
376
-
377
- --z-dropdown (1000)
378
- --z-sticky (1020)
379
- --z-modal (1040)
380
- --z-popover (1050)
381
- --z-tooltip (1060)
382
- --z-overlay (1070)
420
+
421
+ --z-dropdown (1000) --z-sticky (1020)
422
+ --z-modal (1040) --z-popover (1050)
423
+ --z-tooltip (1060) --z-overlay (1070)
383
424
  ```
384
425
 
385
426
  </details>
386
427
 
428
+ ---
429
+
387
430
  ## TypeScript
388
431
 
389
- All props and types exported:
432
+ Full type coverage. Every prop, variant, and callback is typed:
390
433
 
391
434
  ```tsx
392
- import type { ButtonProps, InputProps, SelectProps } from '@mdigital_ui/ui'
393
- import type { TableProps, ModalClassNames, CardVariant } from '@mdigital_ui/ui'
435
+ import type { ButtonProps, SelectOption, TableColumn } from '@mdigital_ui/ui'
394
436
  ```
395
437
 
396
438
  ## Browser Support
@@ -399,4 +441,4 @@ Chrome, Firefox, Safari, Edge — last 2 versions.
399
441
 
400
442
  ## License
401
443
 
402
- MIT
444
+ [MIT](./LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdigital_ui/ui",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Modern React component library built with Tailwind CSS v4",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/styles/global.css CHANGED
@@ -326,9 +326,9 @@
326
326
  /* ============================================
327
327
  DARK MODE
328
328
  ============================================ */
329
- :root.dark,
329
+ :root:where(.dark),
330
330
  .dark,
331
- :root[data-mode='dark'],
331
+ :root:where([data-mode='dark']),
332
332
  [data-mode='dark'] {
333
333
  --color-primary: oklch(62% 0.17 239);
334
334
  --color-primary-hover: oklch(67% 0.19 239);