@mdigital_ui/ui 0.2.1 → 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 +210 -9
- package/dist/index.js +11 -11
- package/dist/styles/base.css +63 -0
- package/dist/styles/global.css +79 -0
- package/examples/README.md +166 -0
- package/examples/custom-theme.css +189 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -100,24 +100,225 @@ Both import styles work identically. Use whichever you prefer.
|
|
|
100
100
|
import type { ButtonProps, InputProps } from '@mdigital_ui/ui'
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
## Theming
|
|
103
|
+
## Theming & Customization
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
The UI Kit uses **CSS custom properties (variables)** for all design tokens, making it easy to customize without touching Tailwind's configuration.
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
### Quick Customization
|
|
108
|
+
|
|
109
|
+
Create a CSS file to override any design tokens:
|
|
108
110
|
|
|
109
111
|
```css
|
|
112
|
+
/* app/theme.css or src/theme.css */
|
|
110
113
|
:root {
|
|
111
|
-
/* Brand
|
|
112
|
-
--color-primary: oklch(0.55 0.22 270);
|
|
113
|
-
--color-
|
|
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);
|
|
114
122
|
|
|
115
|
-
/* Component
|
|
123
|
+
/* Component Sizing */
|
|
116
124
|
--button-height-md: 2.5rem;
|
|
117
125
|
--input-height-md: 2.5rem;
|
|
118
|
-
|
|
119
|
-
/* Border radius */
|
|
120
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;
|
|
121
322
|
}
|
|
122
323
|
```
|
|
123
324
|
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export { Transfer } from './chunk-EYTOKUBM.js';
|
|
2
1
|
export { tooltip_default as Tooltip } from './chunk-D3JWPGCA.js';
|
|
2
|
+
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 {
|
|
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 { textarea_default as Textarea } from './chunk-FPOXTCYV.js';
|
|
10
9
|
export { tabs_default as Tabs } from './chunk-OW5A5IIF.js';
|
|
11
|
-
export { toggle_default as Toggle } from './chunk-DPOSWW22.js';
|
|
12
10
|
export { table_default as Table } from './chunk-L3SP7GHC.js';
|
|
13
11
|
export { toggle_group_default as ToggleGroup } from './chunk-SK5ECBBK.js';
|
|
14
|
-
export {
|
|
12
|
+
export { textarea_default as Textarea } from './chunk-FPOXTCYV.js';
|
|
13
|
+
export { toggle_default as Toggle } from './chunk-DPOSWW22.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';
|
|
@@ -29,9 +29,9 @@ export { descriptions_default as Descriptions } from './chunk-S5XJXU52.js';
|
|
|
29
29
|
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from './chunk-AWPKZYHT.js';
|
|
30
30
|
export { empty_default as Empty } from './chunk-ROR4E6IE.js';
|
|
31
31
|
export { fetching_overlay_default as FetchingOverlay } from './chunk-BNILRB4T.js';
|
|
32
|
-
export { image_default as Image } from './chunk-XMAH5PDW.js';
|
|
33
32
|
export { grid_default as Grid } from './chunk-7PKVBUGL.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
|
package/dist/styles/base.css
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
@layer theme {
|
|
5
5
|
:root, :host {
|
|
6
6
|
--font-sans: ui-sans-serif, system-ui, sans-serif;
|
|
7
|
+
--font-mono: ui-monospace, 'SF Mono', monospace;
|
|
7
8
|
--color-red-500: oklch(63.7% 0.237 25.331);
|
|
8
9
|
--color-red-600: oklch(57.7% 0.245 27.325);
|
|
9
10
|
--color-orange-500: oklch(70.5% 0.213 47.604);
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
--color-gray-700: oklch(37.3% 0.034 259.733);
|
|
27
28
|
--color-gray-800: oklch(27.8% 0.033 256.848);
|
|
28
29
|
--color-gray-900: oklch(21% 0.034 264.665);
|
|
30
|
+
--color-gray-950: oklch(13% 0.028 261.692);
|
|
29
31
|
--color-black: #000;
|
|
30
32
|
--color-white: #fff;
|
|
31
33
|
--spacing: 0.25rem;
|
|
@@ -39,9 +41,13 @@
|
|
|
39
41
|
--container-4xl: 56rem;
|
|
40
42
|
--container-6xl: 72rem;
|
|
41
43
|
--container-7xl: 80rem;
|
|
44
|
+
--text-xs: 0.75rem;
|
|
42
45
|
--text-xs--line-height: calc(1 / 0.75);
|
|
46
|
+
--text-sm: 0.875rem;
|
|
43
47
|
--text-sm--line-height: calc(1.25 / 0.875);
|
|
48
|
+
--text-base: 0.9rem;
|
|
44
49
|
--text-base--line-height: calc(1.5 / 1);
|
|
50
|
+
--text-lg: 1.125rem;
|
|
45
51
|
--text-lg--line-height: calc(1.75 / 1.125);
|
|
46
52
|
--text-xl: 1.25rem;
|
|
47
53
|
--text-xl--line-height: calc(1.75 / 1.25);
|
|
@@ -51,7 +57,10 @@
|
|
|
51
57
|
--text-3xl--line-height: calc(2.25 / 1.875);
|
|
52
58
|
--text-4xl: 2.25rem;
|
|
53
59
|
--text-4xl--line-height: calc(2.5 / 2.25);
|
|
60
|
+
--font-weight-normal: 400;
|
|
61
|
+
--font-weight-medium: 500;
|
|
54
62
|
--font-weight-semibold: 600;
|
|
63
|
+
--font-weight-bold: 700;
|
|
55
64
|
--tracking-tight: -0.025em;
|
|
56
65
|
--tracking-wider: 0.05em;
|
|
57
66
|
--tracking-widest: 0.1em;
|
|
@@ -60,8 +69,13 @@
|
|
|
60
69
|
--radius-md: 0.375rem;
|
|
61
70
|
--radius-lg: 0.5rem;
|
|
62
71
|
--radius-xl: 0.625rem;
|
|
72
|
+
--radius-2xl: 0.75rem;
|
|
73
|
+
--radius-3xl: 1rem;
|
|
74
|
+
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
63
75
|
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
|
|
64
76
|
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
|
77
|
+
--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
|
|
78
|
+
--shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
|
65
79
|
--ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
66
80
|
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
67
81
|
--animate-spin: spin 1s linear infinite;
|
|
@@ -81,30 +95,52 @@
|
|
|
81
95
|
--button-padding-x-sm: 0.75rem;
|
|
82
96
|
--button-padding-x-md: 0.875rem;
|
|
83
97
|
--button-padding-x-lg: 1.25rem;
|
|
98
|
+
--input-height-xs: 1.75rem;
|
|
84
99
|
--input-height-sm: 2rem;
|
|
85
100
|
--input-height-md: 2.25rem;
|
|
86
101
|
--input-height-lg: 2.75rem;
|
|
102
|
+
--input-padding-x-xs: 0.5rem;
|
|
103
|
+
--input-padding-x-lg: 1.125rem;
|
|
87
104
|
--textarea-min-height: 5rem;
|
|
88
105
|
--textarea-padding-sm: 0.625rem;
|
|
89
106
|
--textarea-padding-md: 0.6875rem;
|
|
90
107
|
--textarea-padding-lg: 0.875rem;
|
|
108
|
+
--select-height-xs: 1.75rem;
|
|
109
|
+
--select-height-lg: 2.75rem;
|
|
110
|
+
--select-padding-x-xs: 0.5rem;
|
|
111
|
+
--select-padding-x-lg: 1.125rem;
|
|
112
|
+
--checkbox-size-xs: 0.875rem;
|
|
91
113
|
--checkbox-size-sm: 1rem;
|
|
92
114
|
--checkbox-size-md: 1.125rem;
|
|
93
115
|
--checkbox-size-lg: 1.375rem;
|
|
116
|
+
--switch-width-xs: 1.75rem;
|
|
94
117
|
--switch-width-sm: 2rem;
|
|
95
118
|
--switch-width-md: 2.5rem;
|
|
96
119
|
--switch-width-lg: 3rem;
|
|
120
|
+
--switch-height-xs: 0.875rem;
|
|
97
121
|
--switch-height-sm: 1rem;
|
|
98
122
|
--switch-height-md: 1.25rem;
|
|
99
123
|
--switch-height-lg: 1.5rem;
|
|
124
|
+
--label-font-size-xs: 0.75rem;
|
|
125
|
+
--label-font-size-lg: 1.125rem;
|
|
126
|
+
--spacing-0: 0px;
|
|
100
127
|
--spacing-1: 0.25rem;
|
|
101
128
|
--spacing-2: 0.5rem;
|
|
102
129
|
--spacing-3: 0.75rem;
|
|
103
130
|
--spacing-4: 1rem;
|
|
104
131
|
--spacing-5: 1.25rem;
|
|
105
132
|
--spacing-6: 1.5rem;
|
|
133
|
+
--spacing-12: 3rem;
|
|
134
|
+
--radius-none: 0px;
|
|
106
135
|
--radius-full: 9999px;
|
|
136
|
+
--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
137
|
+
--transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
138
|
+
--transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
139
|
+
--z-dropdown: 1000;
|
|
140
|
+
--z-sticky: 1020;
|
|
141
|
+
--z-modal: 1040;
|
|
107
142
|
--z-popover: 1050;
|
|
143
|
+
--z-tooltip: 1060;
|
|
108
144
|
}
|
|
109
145
|
}
|
|
110
146
|
@layer base {
|
|
@@ -1342,6 +1378,9 @@
|
|
|
1342
1378
|
.rounded-3xl {
|
|
1343
1379
|
border-radius: 1rem;
|
|
1344
1380
|
}
|
|
1381
|
+
.rounded-\[var\(--radius-lg\)\] {
|
|
1382
|
+
border-radius: var(--radius-lg);
|
|
1383
|
+
}
|
|
1345
1384
|
.rounded-full {
|
|
1346
1385
|
border-radius: 9999px;
|
|
1347
1386
|
}
|
|
@@ -1456,6 +1495,12 @@
|
|
|
1456
1495
|
.border-t-transparent {
|
|
1457
1496
|
border-top-color: transparent;
|
|
1458
1497
|
}
|
|
1498
|
+
.bg-\[var\(--color-accent\)\] {
|
|
1499
|
+
background-color: var(--color-accent);
|
|
1500
|
+
}
|
|
1501
|
+
.bg-\[var\(--color-primary\)\] {
|
|
1502
|
+
background-color: var(--color-primary);
|
|
1503
|
+
}
|
|
1459
1504
|
.bg-black\/20 {
|
|
1460
1505
|
background-color: color-mix(in srgb, #000 20%, transparent);
|
|
1461
1506
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -1840,6 +1885,10 @@
|
|
|
1840
1885
|
--tw-leading: 1;
|
|
1841
1886
|
line-height: 1;
|
|
1842
1887
|
}
|
|
1888
|
+
.font-\[var\(--font-weight-semibold\)\] {
|
|
1889
|
+
--tw-font-weight: var(--font-weight-semibold);
|
|
1890
|
+
font-weight: var(--font-weight-semibold);
|
|
1891
|
+
}
|
|
1843
1892
|
.font-bold {
|
|
1844
1893
|
--tw-font-weight: 700;
|
|
1845
1894
|
font-weight: 700;
|
|
@@ -1870,6 +1919,9 @@
|
|
|
1870
1919
|
.whitespace-nowrap {
|
|
1871
1920
|
white-space: nowrap;
|
|
1872
1921
|
}
|
|
1922
|
+
.text-\[var\(--text-lg\)\] {
|
|
1923
|
+
color: var(--text-lg);
|
|
1924
|
+
}
|
|
1873
1925
|
.text-blue-500 {
|
|
1874
1926
|
color: var(--color-blue-500);
|
|
1875
1927
|
}
|
|
@@ -1967,6 +2019,10 @@
|
|
|
1967
2019
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
1968
2020
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
1969
2021
|
}
|
|
2022
|
+
.shadow-\[var\(--shadow-md\)\] {
|
|
2023
|
+
--tw-shadow: var(--shadow-md);
|
|
2024
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2025
|
+
}
|
|
1970
2026
|
.shadow-lg {
|
|
1971
2027
|
--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
1972
2028
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -2205,6 +2261,13 @@
|
|
|
2205
2261
|
}
|
|
2206
2262
|
}
|
|
2207
2263
|
}
|
|
2264
|
+
.hover\:bg-\[var\(--color-accent-hover\)\] {
|
|
2265
|
+
&:hover {
|
|
2266
|
+
@media (hover: hover) {
|
|
2267
|
+
background-color: var(--color-accent-hover);
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2208
2271
|
.hover\:bg-gray-50 {
|
|
2209
2272
|
&:hover {
|
|
2210
2273
|
@media (hover: hover) {
|
package/dist/styles/global.css
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
@layer theme {
|
|
5
5
|
:root, :host {
|
|
6
6
|
--font-sans: ui-sans-serif, system-ui, sans-serif;
|
|
7
|
+
--font-mono: ui-monospace, 'SF Mono', monospace;
|
|
7
8
|
--color-red-500: oklch(63.7% 0.237 25.331);
|
|
8
9
|
--color-red-600: oklch(57.7% 0.245 27.325);
|
|
9
10
|
--color-orange-500: oklch(70.5% 0.213 47.604);
|
|
@@ -23,6 +24,7 @@
|
|
|
23
24
|
--color-gray-600: oklch(45% 0 0);
|
|
24
25
|
--color-gray-700: oklch(35% 0 0);
|
|
25
26
|
--color-gray-900: oklch(15% 0 0);
|
|
27
|
+
--color-gray-950: oklch(10% 0 0);
|
|
26
28
|
--color-black: oklch(0% 0 0);
|
|
27
29
|
--color-white: oklch(100% 0 0);
|
|
28
30
|
--spacing: 0.25rem;
|
|
@@ -36,9 +38,13 @@
|
|
|
36
38
|
--container-4xl: 56rem;
|
|
37
39
|
--container-6xl: 72rem;
|
|
38
40
|
--container-7xl: 80rem;
|
|
41
|
+
--text-xs: 0.75rem;
|
|
39
42
|
--text-xs--line-height: calc(1 / 0.75);
|
|
43
|
+
--text-sm: 0.875rem;
|
|
40
44
|
--text-sm--line-height: calc(1.25 / 0.875);
|
|
45
|
+
--text-base: 0.9rem;
|
|
41
46
|
--text-base--line-height: calc(1.5 / 1);
|
|
47
|
+
--text-lg: 1.125rem;
|
|
42
48
|
--text-lg--line-height: calc(1.75 / 1.125);
|
|
43
49
|
--text-xl: 1.25rem;
|
|
44
50
|
--text-xl--line-height: calc(1.75 / 1.25);
|
|
@@ -48,7 +54,10 @@
|
|
|
48
54
|
--text-3xl--line-height: calc(2.25 / 1.875);
|
|
49
55
|
--text-4xl: 2.25rem;
|
|
50
56
|
--text-4xl--line-height: calc(2.5 / 2.25);
|
|
57
|
+
--font-weight-normal: 400;
|
|
58
|
+
--font-weight-medium: 500;
|
|
51
59
|
--font-weight-semibold: 600;
|
|
60
|
+
--font-weight-bold: 700;
|
|
52
61
|
--tracking-tight: -0.025em;
|
|
53
62
|
--tracking-wider: 0.05em;
|
|
54
63
|
--tracking-widest: 0.1em;
|
|
@@ -57,8 +66,13 @@
|
|
|
57
66
|
--radius-md: 0.375rem;
|
|
58
67
|
--radius-lg: 0.5rem;
|
|
59
68
|
--radius-xl: 0.625rem;
|
|
69
|
+
--radius-2xl: 0.75rem;
|
|
70
|
+
--radius-3xl: 1rem;
|
|
71
|
+
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
60
72
|
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
|
|
61
73
|
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
|
74
|
+
--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
|
|
75
|
+
--shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
|
62
76
|
--ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
63
77
|
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
64
78
|
--animate-spin: spin 1s linear infinite;
|
|
@@ -72,17 +86,33 @@
|
|
|
72
86
|
--default-mono-font-family: ui-monospace, 'SF Mono', monospace;
|
|
73
87
|
--color-primary: oklch(0.6029 0.15 239.2065);
|
|
74
88
|
--color-primary-hover: oklch(0.5029 0.2 239.2065);
|
|
89
|
+
--color-primary-active: oklch(0.4529 0.2 239.2065);
|
|
75
90
|
--color-primary-foreground: oklch(100% 0 0);
|
|
76
91
|
--color-secondary: oklch(50% 0.05 240);
|
|
92
|
+
--color-secondary-hover: oklch(45% 0.06 240);
|
|
93
|
+
--color-secondary-active: oklch(40% 0.07 240);
|
|
94
|
+
--color-secondary-foreground: oklch(100% 0 0);
|
|
77
95
|
--color-accent: oklch(0.8 0.1737 67);
|
|
96
|
+
--color-accent-hover: oklch(0.75 0.237 67);
|
|
97
|
+
--color-accent-active: oklch(0.7 0.1937 67);
|
|
98
|
+
--color-accent-foreground: oklch(15% 0 0);
|
|
78
99
|
--color-success: oklch(0.7 0.2 145);
|
|
100
|
+
--color-success-hover: oklch(0.65 0.22 145);
|
|
101
|
+
--color-success-active: oklch(0.5 0.24 145);
|
|
79
102
|
--color-error: oklch(65% 0.2 25);
|
|
103
|
+
--color-error-hover: oklch(75% 0.2 25);
|
|
104
|
+
--color-error-active: oklch(80% 0.2 25);
|
|
80
105
|
--color-warning: oklch(75% 0.15 85);
|
|
106
|
+
--color-warning-hover: oklch(70% 0.17 85);
|
|
107
|
+
--color-warning-active: oklch(65% 0.19 85);
|
|
81
108
|
--color-info: oklch(60% 0.19 255);
|
|
109
|
+
--color-info-hover: oklch(55% 0.21 255);
|
|
110
|
+
--color-info-active: oklch(50% 0.23 255);
|
|
82
111
|
--color-background: oklch(100% 0 0);
|
|
83
112
|
--color-background-secondary: oklch(98% 0 0);
|
|
84
113
|
--color-surface: oklch(96% 0 0);
|
|
85
114
|
--color-border: oklch(93% 0 0);
|
|
115
|
+
--color-border-primary: oklch(85% 0 0);
|
|
86
116
|
--color-text-primary: oklch(15% 0 0);
|
|
87
117
|
--color-text-secondary: oklch(45% 0 0);
|
|
88
118
|
--color-text-muted: oklch(60% 0 0);
|
|
@@ -94,30 +124,52 @@
|
|
|
94
124
|
--button-padding-x-sm: 0.75rem;
|
|
95
125
|
--button-padding-x-md: 0.875rem;
|
|
96
126
|
--button-padding-x-lg: 1.25rem;
|
|
127
|
+
--input-height-xs: 1.75rem;
|
|
97
128
|
--input-height-sm: 2rem;
|
|
98
129
|
--input-height-md: 2.25rem;
|
|
99
130
|
--input-height-lg: 2.75rem;
|
|
131
|
+
--input-padding-x-xs: 0.5rem;
|
|
132
|
+
--input-padding-x-lg: 1.125rem;
|
|
100
133
|
--textarea-min-height: 5rem;
|
|
101
134
|
--textarea-padding-sm: 0.625rem;
|
|
102
135
|
--textarea-padding-md: 0.6875rem;
|
|
103
136
|
--textarea-padding-lg: 0.875rem;
|
|
137
|
+
--select-height-xs: 1.75rem;
|
|
138
|
+
--select-height-lg: 2.75rem;
|
|
139
|
+
--select-padding-x-xs: 0.5rem;
|
|
140
|
+
--select-padding-x-lg: 1.125rem;
|
|
141
|
+
--checkbox-size-xs: 0.875rem;
|
|
104
142
|
--checkbox-size-sm: 1rem;
|
|
105
143
|
--checkbox-size-md: 1.125rem;
|
|
106
144
|
--checkbox-size-lg: 1.375rem;
|
|
145
|
+
--switch-width-xs: 1.75rem;
|
|
107
146
|
--switch-width-sm: 2rem;
|
|
108
147
|
--switch-width-md: 2.5rem;
|
|
109
148
|
--switch-width-lg: 3rem;
|
|
149
|
+
--switch-height-xs: 0.875rem;
|
|
110
150
|
--switch-height-sm: 1rem;
|
|
111
151
|
--switch-height-md: 1.25rem;
|
|
112
152
|
--switch-height-lg: 1.5rem;
|
|
153
|
+
--label-font-size-xs: 0.75rem;
|
|
154
|
+
--label-font-size-lg: 1.125rem;
|
|
155
|
+
--spacing-0: 0px;
|
|
113
156
|
--spacing-1: 0.25rem;
|
|
114
157
|
--spacing-2: 0.5rem;
|
|
115
158
|
--spacing-3: 0.75rem;
|
|
116
159
|
--spacing-4: 1rem;
|
|
117
160
|
--spacing-5: 1.25rem;
|
|
118
161
|
--spacing-6: 1.5rem;
|
|
162
|
+
--spacing-12: 3rem;
|
|
163
|
+
--radius-none: 0px;
|
|
119
164
|
--radius-full: 9999px;
|
|
165
|
+
--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
166
|
+
--transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
167
|
+
--transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
168
|
+
--z-dropdown: 1000;
|
|
169
|
+
--z-sticky: 1020;
|
|
170
|
+
--z-modal: 1040;
|
|
120
171
|
--z-popover: 1050;
|
|
172
|
+
--z-tooltip: 1060;
|
|
121
173
|
}
|
|
122
174
|
}
|
|
123
175
|
@layer base {
|
|
@@ -1360,6 +1412,9 @@
|
|
|
1360
1412
|
.rounded-3xl {
|
|
1361
1413
|
border-radius: 1rem;
|
|
1362
1414
|
}
|
|
1415
|
+
.rounded-\[var\(--radius-lg\)\] {
|
|
1416
|
+
border-radius: var(--radius-lg);
|
|
1417
|
+
}
|
|
1363
1418
|
.rounded-full {
|
|
1364
1419
|
border-radius: 9999px;
|
|
1365
1420
|
}
|
|
@@ -1630,6 +1685,12 @@
|
|
|
1630
1685
|
.border-l-warning {
|
|
1631
1686
|
border-left-color: oklch(75% 0.15 85);
|
|
1632
1687
|
}
|
|
1688
|
+
.bg-\[var\(--color-accent\)\] {
|
|
1689
|
+
background-color: var(--color-accent);
|
|
1690
|
+
}
|
|
1691
|
+
.bg-\[var\(--color-primary\)\] {
|
|
1692
|
+
background-color: var(--color-primary);
|
|
1693
|
+
}
|
|
1633
1694
|
.bg-accent {
|
|
1634
1695
|
background-color: oklch(0.8 0.1737 67);
|
|
1635
1696
|
}
|
|
@@ -2300,6 +2361,10 @@
|
|
|
2300
2361
|
--tw-leading: 1;
|
|
2301
2362
|
line-height: 1;
|
|
2302
2363
|
}
|
|
2364
|
+
.font-\[var\(--font-weight-semibold\)\] {
|
|
2365
|
+
--tw-font-weight: var(--font-weight-semibold);
|
|
2366
|
+
font-weight: var(--font-weight-semibold);
|
|
2367
|
+
}
|
|
2303
2368
|
.font-bold {
|
|
2304
2369
|
--tw-font-weight: 700;
|
|
2305
2370
|
font-weight: 700;
|
|
@@ -2330,6 +2395,9 @@
|
|
|
2330
2395
|
.whitespace-nowrap {
|
|
2331
2396
|
white-space: nowrap;
|
|
2332
2397
|
}
|
|
2398
|
+
.text-\[var\(--text-lg\)\] {
|
|
2399
|
+
color: var(--text-lg);
|
|
2400
|
+
}
|
|
2333
2401
|
.text-accent {
|
|
2334
2402
|
color: oklch(0.8 0.1737 67);
|
|
2335
2403
|
}
|
|
@@ -2499,6 +2567,10 @@
|
|
|
2499
2567
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
2500
2568
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2501
2569
|
}
|
|
2570
|
+
.shadow-\[var\(--shadow-md\)\] {
|
|
2571
|
+
--tw-shadow: var(--shadow-md);
|
|
2572
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2573
|
+
}
|
|
2502
2574
|
.shadow-lg {
|
|
2503
2575
|
--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
2504
2576
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -2887,6 +2959,13 @@
|
|
|
2887
2959
|
}
|
|
2888
2960
|
}
|
|
2889
2961
|
}
|
|
2962
|
+
.hover\:bg-\[var\(--color-accent-hover\)\] {
|
|
2963
|
+
&:hover {
|
|
2964
|
+
@media (hover: hover) {
|
|
2965
|
+
background-color: var(--color-accent-hover);
|
|
2966
|
+
}
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2890
2969
|
.hover\:bg-accent\/5 {
|
|
2891
2970
|
&:hover {
|
|
2892
2971
|
@media (hover: hover) {
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Theming Examples
|
|
2
|
+
|
|
3
|
+
## Quick Start
|
|
4
|
+
|
|
5
|
+
1. Copy `custom-theme.css` to your project
|
|
6
|
+
2. Customize the CSS variables
|
|
7
|
+
3. Import it **after** the UI Kit styles:
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
// app/layout.tsx or src/main.tsx
|
|
11
|
+
import '@mdigital_ui/ui/styles/base.css'
|
|
12
|
+
import '@mdigital_ui/ui/styles/themes/light.css'
|
|
13
|
+
import './custom-theme.css' // Your customizations
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Using Variables with Tailwind Utilities
|
|
17
|
+
|
|
18
|
+
While the UI components use these variables automatically, you can also use them in your own custom components with Tailwind:
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
// Using CSS variables with arbitrary values
|
|
22
|
+
<div className="bg-[var(--color-primary)]">
|
|
23
|
+
Primary background
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<button className="bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)]">
|
|
27
|
+
Custom Button
|
|
28
|
+
</button>
|
|
29
|
+
|
|
30
|
+
// Using design tokens
|
|
31
|
+
<div className="rounded-[var(--radius-lg)] shadow-[var(--shadow-md)]">
|
|
32
|
+
Custom Card
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
// Typography
|
|
36
|
+
<p className="text-[var(--text-lg)] font-[var(--font-weight-semibold)]">
|
|
37
|
+
Custom Text
|
|
38
|
+
</p>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Common Customization Patterns
|
|
42
|
+
|
|
43
|
+
### 1. Brand Colors
|
|
44
|
+
|
|
45
|
+
```css
|
|
46
|
+
:root {
|
|
47
|
+
--color-primary: oklch(0.60 0.20 260);
|
|
48
|
+
--color-primary-hover: oklch(0.55 0.22 260);
|
|
49
|
+
--color-primary-active: oklch(0.50 0.24 260);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. Component Sizing
|
|
54
|
+
|
|
55
|
+
Make all components larger:
|
|
56
|
+
|
|
57
|
+
```css
|
|
58
|
+
:root {
|
|
59
|
+
/* Buttons */
|
|
60
|
+
--button-height-sm: 2.25rem;
|
|
61
|
+
--button-height-md: 2.75rem;
|
|
62
|
+
--button-height-lg: 3.25rem;
|
|
63
|
+
|
|
64
|
+
/* Inputs */
|
|
65
|
+
--input-height-sm: 2.25rem;
|
|
66
|
+
--input-height-md: 2.75rem;
|
|
67
|
+
--input-height-lg: 3.25rem;
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 3. Border Radius
|
|
72
|
+
|
|
73
|
+
Make everything more rounded:
|
|
74
|
+
|
|
75
|
+
```css
|
|
76
|
+
:root {
|
|
77
|
+
--radius-sm: 0.5rem;
|
|
78
|
+
--radius-md: 0.75rem;
|
|
79
|
+
--radius-lg: 1rem;
|
|
80
|
+
--radius-xl: 1.5rem;
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 4. Custom Font
|
|
85
|
+
|
|
86
|
+
```css
|
|
87
|
+
:root {
|
|
88
|
+
--font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Don't forget to load the font:
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
// In your app
|
|
96
|
+
import { Inter } from 'next/font/google'
|
|
97
|
+
|
|
98
|
+
const inter = Inter({ subsets: ['latin'] })
|
|
99
|
+
|
|
100
|
+
export default function RootApp({ children }) {
|
|
101
|
+
return (
|
|
102
|
+
<html className={inter.className}>
|
|
103
|
+
<body>{children}</body>
|
|
104
|
+
</html>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 5. Dark Mode Colors
|
|
110
|
+
|
|
111
|
+
Customize dark mode appearance:
|
|
112
|
+
|
|
113
|
+
```css
|
|
114
|
+
.dark {
|
|
115
|
+
--color-primary: oklch(0.70 0.25 260);
|
|
116
|
+
--color-background: oklch(12% 0 0);
|
|
117
|
+
--color-surface: oklch(18% 0 0);
|
|
118
|
+
--color-border: oklch(25% 0 0);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## OKLCH Color Format
|
|
123
|
+
|
|
124
|
+
The UI Kit uses the OKLCH color format for better color perception and consistency. Here's a quick guide:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
oklch(L C H)
|
|
128
|
+
│ │ │
|
|
129
|
+
│ │ └─ Hue (0-360)
|
|
130
|
+
│ └─── Chroma (0-0.4)
|
|
131
|
+
└───── Lightness (0-1 or 0-100%)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Common Hues:**
|
|
135
|
+
- Red: 25-40
|
|
136
|
+
- Orange: 50-70
|
|
137
|
+
- Yellow: 85-100
|
|
138
|
+
- Green: 140-160
|
|
139
|
+
- Blue: 230-260
|
|
140
|
+
- Purple: 290-310
|
|
141
|
+
- Pink: 340-360
|
|
142
|
+
|
|
143
|
+
**Tips:**
|
|
144
|
+
- Keep Chroma between 0.15-0.25 for most UI colors
|
|
145
|
+
- Lower Lightness for darker colors (0.3-0.5)
|
|
146
|
+
- Higher Lightness for lighter colors (0.6-0.8)
|
|
147
|
+
|
|
148
|
+
**Example Palette:**
|
|
149
|
+
|
|
150
|
+
```css
|
|
151
|
+
/* Primary Blue */
|
|
152
|
+
--color-primary: oklch(0.60 0.20 260); /* Medium blue */
|
|
153
|
+
--color-primary-hover: oklch(0.55 0.22 260); /* Darker blue */
|
|
154
|
+
|
|
155
|
+
/* Success Green */
|
|
156
|
+
--color-success: oklch(0.65 0.20 145);
|
|
157
|
+
|
|
158
|
+
/* Error Red */
|
|
159
|
+
--color-error: oklch(0.60 0.25 25);
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Need Help?
|
|
163
|
+
|
|
164
|
+
- [OKLCH Color Picker](https://oklch.com/)
|
|
165
|
+
- [Tailwind CSS v4 Docs](https://tailwindcss.com/)
|
|
166
|
+
- [Complete Variable Reference](../README.md#theming--customization)
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example Custom Theme
|
|
3
|
+
*
|
|
4
|
+
* Copy this file to your project and customize the variables below.
|
|
5
|
+
* Import it AFTER the UI Kit styles:
|
|
6
|
+
*
|
|
7
|
+
* import '@mdigital_ui/ui/styles/base.css'
|
|
8
|
+
* import '@mdigital_ui/ui/styles/themes/light.css'
|
|
9
|
+
* import './custom-theme.css' // Your customizations
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
:root {
|
|
13
|
+
/* ============================================
|
|
14
|
+
BRAND COLORS
|
|
15
|
+
============================================ */
|
|
16
|
+
|
|
17
|
+
/* Primary Color - Used for main actions, links, focus states */
|
|
18
|
+
--color-primary: oklch(0.60 0.20 260); /* Blue */
|
|
19
|
+
--color-primary-hover: oklch(0.55 0.22 260);
|
|
20
|
+
--color-primary-active: oklch(0.50 0.24 260);
|
|
21
|
+
--color-primary-foreground: oklch(100% 0 0); /* White text on primary */
|
|
22
|
+
|
|
23
|
+
/* Secondary Color - Used for secondary actions */
|
|
24
|
+
--color-secondary: oklch(0.50 0.10 280);
|
|
25
|
+
--color-secondary-hover: oklch(0.45 0.12 280);
|
|
26
|
+
--color-secondary-active: oklch(0.40 0.14 280);
|
|
27
|
+
--color-secondary-foreground: oklch(100% 0 0);
|
|
28
|
+
|
|
29
|
+
/* Accent Color - Used for highlights and special elements */
|
|
30
|
+
--color-accent: oklch(0.75 0.18 160); /* Green */
|
|
31
|
+
--color-accent-hover: oklch(0.70 0.20 160);
|
|
32
|
+
--color-accent-active: oklch(0.65 0.22 160);
|
|
33
|
+
--color-accent-foreground: oklch(15% 0 0);
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/* ============================================
|
|
37
|
+
SEMANTIC COLORS
|
|
38
|
+
============================================ */
|
|
39
|
+
|
|
40
|
+
/* Success - Positive actions, confirmations */
|
|
41
|
+
--color-success: oklch(0.65 0.20 145);
|
|
42
|
+
--color-success-hover: oklch(0.60 0.22 145);
|
|
43
|
+
--color-success-foreground: oklch(100% 0 0);
|
|
44
|
+
|
|
45
|
+
/* Error - Destructive actions, errors */
|
|
46
|
+
--color-error: oklch(0.60 0.25 25);
|
|
47
|
+
--color-error-hover: oklch(0.65 0.25 25);
|
|
48
|
+
--color-error-foreground: oklch(100% 0 0);
|
|
49
|
+
|
|
50
|
+
/* Warning - Caution, important notices */
|
|
51
|
+
--color-warning: oklch(0.75 0.15 85);
|
|
52
|
+
--color-warning-hover: oklch(0.70 0.17 85);
|
|
53
|
+
--color-warning-foreground: oklch(15% 0 0);
|
|
54
|
+
|
|
55
|
+
/* Info - Informational messages */
|
|
56
|
+
--color-info: oklch(0.60 0.19 255);
|
|
57
|
+
--color-info-hover: oklch(0.55 0.21 255);
|
|
58
|
+
--color-info-foreground: oklch(100% 0 0);
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/* ============================================
|
|
62
|
+
BACKGROUNDS & SURFACES
|
|
63
|
+
============================================ */
|
|
64
|
+
|
|
65
|
+
--color-background: oklch(100% 0 0); /* Main background */
|
|
66
|
+
--color-background-secondary: oklch(98% 0 0); /* Secondary background */
|
|
67
|
+
--color-surface: oklch(96% 0 0); /* Card backgrounds */
|
|
68
|
+
--color-border: oklch(93% 0 0); /* Border color */
|
|
69
|
+
--color-border-primary: oklch(85% 0 0); /* Darker borders */
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
/* ============================================
|
|
73
|
+
TEXT COLORS
|
|
74
|
+
============================================ */
|
|
75
|
+
|
|
76
|
+
--color-text-primary: oklch(15% 0 0); /* Main text */
|
|
77
|
+
--color-text-secondary: oklch(45% 0 0); /* Secondary text */
|
|
78
|
+
--color-text-muted: oklch(60% 0 0); /* Muted/placeholder text */
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
/* ============================================
|
|
82
|
+
COMPONENT SIZING
|
|
83
|
+
============================================ */
|
|
84
|
+
|
|
85
|
+
/* Buttons */
|
|
86
|
+
--button-height-xs: 1.75rem; /* 28px */
|
|
87
|
+
--button-height-sm: 2rem; /* 32px */
|
|
88
|
+
--button-height-md: 2.25rem; /* 36px */
|
|
89
|
+
--button-height-lg: 2.75rem; /* 44px */
|
|
90
|
+
|
|
91
|
+
--button-padding-x-xs: 0.5rem;
|
|
92
|
+
--button-padding-x-sm: 0.75rem;
|
|
93
|
+
--button-padding-x-md: 0.875rem;
|
|
94
|
+
--button-padding-x-lg: 1.25rem;
|
|
95
|
+
|
|
96
|
+
/* Inputs */
|
|
97
|
+
--input-height-xs: 1.75rem;
|
|
98
|
+
--input-height-sm: 2rem;
|
|
99
|
+
--input-height-md: 2.25rem;
|
|
100
|
+
--input-height-lg: 2.75rem;
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
/* ============================================
|
|
104
|
+
TYPOGRAPHY
|
|
105
|
+
============================================ */
|
|
106
|
+
|
|
107
|
+
/* Font Families - Use web-safe fallbacks */
|
|
108
|
+
--font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
|
|
109
|
+
--font-mono: ui-monospace, 'SF Mono', monospace;
|
|
110
|
+
|
|
111
|
+
/* Font Sizes */
|
|
112
|
+
--text-xs: 0.75rem; /* 12px */
|
|
113
|
+
--text-sm: 0.875rem; /* 14px */
|
|
114
|
+
--text-base: 0.9rem; /* 14.4px */
|
|
115
|
+
--text-lg: 1.125rem; /* 18px */
|
|
116
|
+
|
|
117
|
+
/* Font Weights */
|
|
118
|
+
--font-weight-normal: 400;
|
|
119
|
+
--font-weight-medium: 500;
|
|
120
|
+
--font-weight-semibold: 600;
|
|
121
|
+
--font-weight-bold: 700;
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
/* ============================================
|
|
125
|
+
BORDER RADIUS
|
|
126
|
+
============================================ */
|
|
127
|
+
|
|
128
|
+
--radius-none: 0px;
|
|
129
|
+
--radius-sm: 0.25rem; /* 4px */
|
|
130
|
+
--radius-md: 0.375rem; /* 6px */
|
|
131
|
+
--radius-lg: 0.5rem; /* 8px */
|
|
132
|
+
--radius-xl: 0.625rem; /* 10px */
|
|
133
|
+
--radius-2xl: 0.75rem; /* 12px */
|
|
134
|
+
--radius-3xl: 1rem; /* 16px */
|
|
135
|
+
--radius-full: 9999px; /* Fully rounded */
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
/* ============================================
|
|
139
|
+
SHADOWS
|
|
140
|
+
============================================ */
|
|
141
|
+
|
|
142
|
+
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
143
|
+
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
|
|
144
|
+
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
|
145
|
+
--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
|
|
146
|
+
--shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
/* ============================================
|
|
150
|
+
TRANSITIONS
|
|
151
|
+
============================================ */
|
|
152
|
+
|
|
153
|
+
--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
154
|
+
--transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
155
|
+
--transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
/* ============================================
|
|
159
|
+
Z-INDEX LAYERS
|
|
160
|
+
============================================ */
|
|
161
|
+
|
|
162
|
+
--z-dropdown: 1000;
|
|
163
|
+
--z-sticky: 1020;
|
|
164
|
+
--z-modal: 1040;
|
|
165
|
+
--z-popover: 1050;
|
|
166
|
+
--z-tooltip: 1060;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
/* ============================================
|
|
171
|
+
DARK MODE OVERRIDES
|
|
172
|
+
============================================ */
|
|
173
|
+
|
|
174
|
+
.dark {
|
|
175
|
+
/* Brand Colors (Dark Mode) */
|
|
176
|
+
--color-primary: oklch(0.65 0.25 260);
|
|
177
|
+
--color-primary-hover: oklch(0.70 0.27 260);
|
|
178
|
+
|
|
179
|
+
/* Backgrounds (Dark Mode) */
|
|
180
|
+
--color-background: oklch(15% 0 0);
|
|
181
|
+
--color-background-secondary: oklch(18% 0 0);
|
|
182
|
+
--color-surface: oklch(20% 0 0);
|
|
183
|
+
--color-border: oklch(30% 0 0);
|
|
184
|
+
|
|
185
|
+
/* Text Colors (Dark Mode) */
|
|
186
|
+
--color-text-primary: oklch(95% 0 0);
|
|
187
|
+
--color-text-secondary: oklch(70% 0 0);
|
|
188
|
+
--color-text-muted: oklch(55% 0 0);
|
|
189
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdigital_ui/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Modern React component library built with Tailwind CSS v4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
11
|
+
"examples",
|
|
11
12
|
"README.md",
|
|
12
13
|
"LICENSE"
|
|
13
14
|
],
|