@mdigital_ui/ui 0.2.0 → 0.2.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
@@ -19,45 +19,42 @@ Modern React component library built with Tailwind CSS v4, designed for multi-br
19
19
  npm install @mdigital_ui/ui
20
20
  ```
21
21
 
22
- **That's it!** All dependencies are included. Tree-shaking ensures only the components you import end up in your production bundle.
22
+ **That's it!** All dependencies and styles are included. Tree-shaking ensures only the components you import end up in your production bundle.
23
23
 
24
24
  ### Peer Dependencies
25
25
 
26
26
  You need to have these in your project:
27
27
 
28
28
  ```bash
29
- npm install react react-dom tailwindcss
29
+ npm install react react-dom
30
30
  ```
31
31
 
32
32
  ## Quick Start
33
33
 
34
- ### 1. Configure Tailwind
34
+ ### 1. Import Styles
35
35
 
36
- Add the package path to your `tailwind.config.js`:
36
+ In your main application entry point (e.g., `app/layout.tsx` or `src/main.tsx`):
37
37
 
38
- ```javascript
39
- export default {
40
- content: [
41
- './src/**/*.{js,ts,jsx,tsx}',
42
- './node_modules/@mdigital/ui/dist/**/*.{js,ts,jsx,tsx}',
43
- ],
44
- }
38
+ ```tsx
39
+ // Import the base styles
40
+ import '@mdigital_ui/ui/styles/base.css'
41
+ // Import light theme (default)
42
+ import '@mdigital_ui/ui/styles/themes/light.css'
43
+ // Optional: Import dark theme for dark mode support
44
+ import '@mdigital_ui/ui/styles/themes/dark.css'
45
45
  ```
46
46
 
47
- ### 2. Import Styles
48
-
49
- In your main CSS file or layout:
47
+ **Or** import in your CSS file:
50
48
 
51
49
  ```css
52
50
  /* app/globals.css or src/index.css */
53
- @import '@mdigital/ui/styles/base.css';
54
- @import '@mdigital/ui/styles/themes/light.css';
55
-
51
+ @import '@mdigital_ui/ui/styles/base.css';
52
+ @import '@mdigital_ui/ui/styles/themes/light.css';
56
53
  /* Optional: Dark mode */
57
- @import '@mdigital/ui/styles/themes/dark.css';
54
+ @import '@mdigital_ui/ui/styles/themes/dark.css';
58
55
  ```
59
56
 
60
- ### 3. Use Components
57
+ ### 2. Use Components
61
58
 
62
59
  ```tsx
63
60
  import { Button, Input, Card } from '@mdigital/ui'
@@ -103,24 +100,225 @@ Both import styles work identically. Use whichever you prefer.
103
100
  import type { ButtonProps, InputProps } from '@mdigital_ui/ui'
104
101
  ```
105
102
 
106
- ## Theming
103
+ ## Theming & Customization
104
+
105
+ The UI Kit uses **CSS custom properties (variables)** for all design tokens, making it easy to customize without touching Tailwind's configuration.
107
106
 
108
- ### CSS Variable Overrides
107
+ ### Quick Customization
109
108
 
110
- Customize the design system by overriding CSS variables:
109
+ Create a CSS file to override any design tokens:
111
110
 
112
111
  ```css
112
+ /* app/theme.css or src/theme.css */
113
113
  :root {
114
- /* Brand colors */
115
- --color-primary: oklch(0.55 0.22 270);
116
- --color-accent: oklch(0.75 0.18 45);
114
+ /* Brand Colors */
115
+ --color-primary: oklch(0.55 0.22 270); /* Purple primary */
116
+ --color-primary-hover: oklch(0.50 0.24 270);
117
+ --color-accent: oklch(0.75 0.18 45); /* Orange accent */
118
+
119
+ /* Semantic Colors */
120
+ --color-success: oklch(0.65 0.20 140);
121
+ --color-error: oklch(0.60 0.25 20);
117
122
 
118
- /* Component sizes */
123
+ /* Component Sizing */
119
124
  --button-height-md: 2.5rem;
120
125
  --input-height-md: 2.5rem;
121
-
122
- /* Border radius */
123
126
  --radius-md: 0.5rem;
127
+
128
+ /* Typography */
129
+ --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
130
+ --text-base: 1rem;
131
+ }
132
+ ```
133
+
134
+ Then import it **after** the UI Kit styles:
135
+
136
+ ```tsx
137
+ import '@mdigital_ui/ui/styles/base.css'
138
+ import '@mdigital_ui/ui/styles/themes/light.css'
139
+ import './theme.css' // Your customizations
140
+ ```
141
+
142
+ ### Available Variables
143
+
144
+ <details>
145
+ <summary><strong>🎨 Colors (Click to expand)</strong></summary>
146
+
147
+ ```css
148
+ /* Brand Colors */
149
+ --color-primary
150
+ --color-primary-hover
151
+ --color-primary-active
152
+ --color-primary-foreground
153
+ --color-secondary
154
+ --color-secondary-hover
155
+ --color-secondary-active
156
+ --color-secondary-foreground
157
+ --color-accent
158
+ --color-accent-hover
159
+ --color-accent-active
160
+ --color-accent-foreground
161
+
162
+ /* Semantic Colors */
163
+ --color-success
164
+ --color-success-hover
165
+ --color-success-active
166
+ --color-error
167
+ --color-error-hover
168
+ --color-error-active
169
+ --color-warning
170
+ --color-warning-hover
171
+ --color-warning-active
172
+ --color-info
173
+ --color-info-hover
174
+ --color-info-active
175
+
176
+ /* Backgrounds & Surfaces */
177
+ --color-background
178
+ --color-background-secondary
179
+ --color-surface
180
+ --color-border
181
+ --color-border-primary
182
+
183
+ /* Text Colors */
184
+ --color-text-primary
185
+ --color-text-secondary
186
+ --color-text-muted
187
+
188
+ /* Grayscale */
189
+ --color-gray-50 through --color-gray-950
190
+ --color-white
191
+ --color-black
192
+ ```
193
+ </details>
194
+
195
+ <details>
196
+ <summary><strong>📐 Sizing & Spacing (Click to expand)</strong></summary>
197
+
198
+ ```css
199
+ /* Button Sizes */
200
+ --button-height-xs: 1.75rem
201
+ --button-height-sm: 2rem
202
+ --button-height-md: 2.25rem
203
+ --button-height-lg: 2.75rem
204
+ --button-padding-x-xs: 0.5rem
205
+ --button-padding-x-sm: 0.75rem
206
+ --button-padding-x-md: 0.875rem
207
+ --button-padding-x-lg: 1.25rem
208
+
209
+ /* Input Sizes */
210
+ --input-height-xs: 1.75rem
211
+ --input-height-sm: 2rem
212
+ --input-height-md: 2.25rem
213
+ --input-height-lg: 2.75rem
214
+ --input-padding-x-xs through --input-padding-x-lg
215
+
216
+ /* Select Sizes */
217
+ --select-height-xs through --select-height-lg
218
+ --select-padding-x-xs through --select-padding-x-lg
219
+
220
+ /* Checkbox/Radio Sizes */
221
+ --checkbox-size-xs: 0.875rem
222
+ --checkbox-size-sm: 1rem
223
+ --checkbox-size-md: 1.125rem
224
+ --checkbox-size-lg: 1.375rem
225
+
226
+ /* Switch Sizes */
227
+ --switch-width-xs through --switch-width-lg
228
+ --switch-height-xs through --switch-height-lg
229
+
230
+ /* Spacing Scale */
231
+ --spacing-0 through --spacing-12
232
+ ```
233
+ </details>
234
+
235
+ <details>
236
+ <summary><strong>✏️ Typography (Click to expand)</strong></summary>
237
+
238
+ ```css
239
+ /* Font Families */
240
+ --font-sans: ui-sans-serif, system-ui, sans-serif
241
+ --font-mono: ui-monospace, 'SF Mono', monospace
242
+
243
+ /* Font Sizes */
244
+ --text-xs: 0.75rem
245
+ --text-sm: 0.875rem
246
+ --text-base: 0.9rem
247
+ --text-lg: 1.125rem
248
+
249
+ /* Font Weights */
250
+ --font-weight-normal: 400
251
+ --font-weight-medium: 500
252
+ --font-weight-semibold: 600
253
+ --font-weight-bold: 700
254
+
255
+ /* Label Sizes */
256
+ --label-font-size-xs through --label-font-size-lg
257
+ ```
258
+ </details>
259
+
260
+ <details>
261
+ <summary><strong>🎭 Effects & Decoration (Click to expand)</strong></summary>
262
+
263
+ ```css
264
+ /* Border Radius */
265
+ --radius-none: 0px
266
+ --radius-sm: 0.25rem
267
+ --radius-md: 0.375rem
268
+ --radius-lg: 0.5rem
269
+ --radius-xl: 0.625rem
270
+ --radius-2xl: 0.75rem
271
+ --radius-3xl: 1rem
272
+ --radius-full: 9999px
273
+
274
+ /* Shadows */
275
+ --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05)
276
+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1)
277
+ --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1)
278
+ --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1)
279
+ --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25)
280
+
281
+ /* Transitions */
282
+ --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1)
283
+ --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1)
284
+ --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1)
285
+
286
+ /* Z-Index Layers */
287
+ --z-dropdown: 1000
288
+ --z-sticky: 1020
289
+ --z-modal: 1040
290
+ --z-popover: 1050
291
+ --z-tooltip: 1060
292
+ ```
293
+ </details>
294
+
295
+ ### Example: Custom Brand Theme
296
+
297
+ See [`examples/custom-theme.css`](./examples/custom-theme.css) for a complete template with all available variables and comments.
298
+
299
+ Quick example:
300
+
301
+ ```css
302
+ /* brand-theme.css */
303
+ :root {
304
+ /* Acme Corp Brand Colors */
305
+ --color-primary: oklch(0.60 0.20 200); /* Acme Blue */
306
+ --color-primary-hover: oklch(0.55 0.22 200);
307
+ --color-secondary: oklch(0.55 0.15 320); /* Acme Purple */
308
+ --color-accent: oklch(0.75 0.18 160); /* Acme Green */
309
+
310
+ /* Rounded Everything */
311
+ --radius-sm: 0.5rem;
312
+ --radius-md: 0.75rem;
313
+ --radius-lg: 1rem;
314
+
315
+ /* Larger Buttons */
316
+ --button-height-sm: 2.25rem;
317
+ --button-height-md: 2.75rem;
318
+ --button-height-lg: 3.25rem;
319
+
320
+ /* Custom Font */
321
+ --font-sans: 'Poppins', ui-sans-serif, system-ui, sans-serif;
124
322
  }
125
323
  ```
126
324
 
package/dist/index.js CHANGED
@@ -3,24 +3,24 @@ export { Transfer } from './chunk-EYTOKUBM.js';
3
3
  export { tree_select_default as TreeSelect } from './chunk-JZCHZ4B3.js';
4
4
  export { tree_default as Tree } from './chunk-SAVE5ACL.js';
5
5
  export { upload_default as Upload } from './chunk-I5ANSIDK.js';
6
- export { slider_default as Slider } from './chunk-NNSS366W.js';
6
+ export { select_default as Select } from './chunk-CLLQDCDR.js';
7
7
  export { stepper_default as Stepper } from './chunk-MLDX3Z67.js';
8
8
  export { switch_default as Switch } from './chunk-AOITJRSV.js';
9
+ export { tabs_default as Tabs } from './chunk-OW5A5IIF.js';
9
10
  export { table_default as Table } from './chunk-L3SP7GHC.js';
10
11
  export { toggle_group_default as ToggleGroup } from './chunk-SK5ECBBK.js';
11
- export { tabs_default as Tabs } from './chunk-OW5A5IIF.js';
12
12
  export { textarea_default as Textarea } from './chunk-FPOXTCYV.js';
13
13
  export { toggle_default as Toggle } from './chunk-DPOSWW22.js';
14
- export { progress_default as Progress } from './chunk-RQBXZKTH.js';
15
14
  export { radio_default as Radio } from './chunk-KTBPIEP2.js';
15
+ export { progress_default as Progress } from './chunk-RQBXZKTH.js';
16
16
  export { radio_group_default as RadioGroup } from './chunk-DOKTHDG3.js';
17
17
  export { rating_default as Rating } from './chunk-FYHQDFKE.js';
18
18
  export { ribbon_default as Ribbon } from './chunk-C7SXY3ZV.js';
19
- export { select_default as Select } from './chunk-CLLQDCDR.js';
20
19
  export { skeleton_default as Skeleton } from './chunk-75XESYGN.js';
20
+ export { slider_default as Slider } from './chunk-NNSS366W.js';
21
21
  export { input_group_default as InputGroup } from './chunk-KBCBVH7B.js';
22
- export { input_otp_default as InputOTP } from './chunk-R225A5II.js';
23
22
  export { input_password_default as InputPassword } from './chunk-E2CYDDYC.js';
23
+ export { input_otp_default as InputOTP } from './chunk-R225A5II.js';
24
24
  export { kbd_default as Kbd } from './chunk-OQANRZPV.js';
25
25
  export { multi_select_default as MultiSelect } from './chunk-W7BQYIXF.js';
26
26
  export { notification_default as Notification } from './chunk-YZVSDRJD.js';
@@ -30,8 +30,8 @@ export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, Dr
30
30
  export { empty_default as Empty } from './chunk-ROR4E6IE.js';
31
31
  export { fetching_overlay_default as FetchingOverlay } from './chunk-BNILRB4T.js';
32
32
  export { grid_default as Grid } from './chunk-7PKVBUGL.js';
33
- export { image_default as Image } from './chunk-XMAH5PDW.js';
34
33
  export { input_default as Input } from './chunk-2JGAYDZR.js';
34
+ export { image_default as Image } from './chunk-XMAH5PDW.js';
35
35
  export { cascader_default as Cascader } from './chunk-SERJ3TZE.js';
36
36
  export { AreaChart, BarChart, ComposedChart, LineChart, PieChart } from './chunk-BP434VYV.js';
37
37
  export { checkbox_default as Checkbox } from './chunk-H2HIBD5Y.js';
@@ -41,16 +41,16 @@ export { collapse_default as Collapse } from './chunk-SOV4PE3P.js';
41
41
  export { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandModal, CommandSeparator, CommandShortcut } from './chunk-4P5EMRFI.js';
42
42
  export { modal_default as Modal } from './chunk-5VCGW53O.js';
43
43
  export { DatePicker, RangePickerComponent as RangePicker, TimePickerComponent as TimePicker } from './chunk-52M2PO3O.js';
44
- export { accordion_default as Accordion } from './chunk-CWHFK7ZC.js';
45
44
  export { badge_default as Badge } from './chunk-FTJOSVTY.js';
45
+ export { accordion_default as Accordion } from './chunk-CWHFK7ZC.js';
46
46
  export { breadcrumbs_default as Breadcrumbs } from './chunk-HUVXKOJC.js';
47
47
  export { dropdown_default as Dropdown } from './chunk-KNQ7UQ2W.js';
48
48
  export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from './chunk-3PFA3YG6.js';
49
+ export { button_group_default as ButtonGroup } from './chunk-56IXGP5C.js';
50
+ export { card_default as Card } from './chunk-XOBGEMQY.js';
49
51
  export { button_default as Button } from './chunk-LBJG2UWT.js';
50
52
  export { spinner_default as Spinner } from './chunk-J3G5WWGR.js';
51
53
  export { buttonColors, commonSpacing, componentColors, componentSizeVariants, createAllColorVariants, createDashedColorVariants, createDefaultColorVariants, createGhostColorVariants, createLinkColorVariants, createOutlineColorVariants, createSoftColorVariants, createSolidColorVariants, extendedComponentSizeVariants, getAccordionColorClass, getCheckboxColorClass, getIconColorClass, iconColorClasses, textColorVariants } from './chunk-5UEWVFF6.js';
52
- export { button_group_default as ButtonGroup } from './chunk-56IXGP5C.js';
53
- export { card_default as Card } from './chunk-XOBGEMQY.js';
54
54
  export { cn, getValidationStatus, iconSizes } from './chunk-YNNAOXU5.js';
55
55
  export { carousel_default as Carousel } from './chunk-C3MX5EXL.js';
56
56
  //# sourceMappingURL=index.js.map