@mdigital_ui/ui 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,76 +16,45 @@ Modern React component library built with Tailwind CSS v4, designed for multi-br
16
16
  ## Installation
17
17
 
18
18
  ```bash
19
- npm install @mdigital/ui
19
+ npm install @mdigital_ui/ui
20
20
  ```
21
21
 
22
- ### Peer Dependencies
23
-
24
- Required dependencies:
22
+ **That's it!** All dependencies and styles are included. Tree-shaking ensures only the components you import end up in your production bundle.
25
23
 
26
- ```bash
27
- npm install react react-dom tailwindcss
28
- ```
24
+ ### Peer Dependencies
29
25
 
30
- Optional dependencies (install only what you need based on components you use):
26
+ You need to have these in your project:
31
27
 
32
28
  ```bash
33
- # For advanced components (Modal, Tooltip, Dropdown, Popover)
34
- npm install @radix-ui/react-dialog @radix-ui/react-popover @radix-ui/react-tooltip
35
-
36
- # For icons
37
- npm install lucide-react
38
-
39
- # For DatePicker
40
- npm install react-datepicker dayjs
41
-
42
- # For Table
43
- npm install @tanstack/react-table @tanstack/react-virtual
44
-
45
- # For Carousel
46
- npm install swiper
47
-
48
- # For Command
49
- npm install cmdk
50
-
51
- # For Charts
52
- npm install recharts
53
-
54
- # For Drawer
55
- npm install vaul
29
+ npm install react react-dom
56
30
  ```
57
31
 
58
- See [TREE_SHAKING_GUIDE.md](./TREE_SHAKING_GUIDE.md) for detailed information on optimizing your bundle.
59
-
60
32
  ## Quick Start
61
33
 
62
- ### 1. Configure Tailwind
34
+ ### 1. Import Styles
63
35
 
64
- 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`):
65
37
 
66
- ```javascript
67
- export default {
68
- content: [
69
- './src/**/*.{js,ts,jsx,tsx}',
70
- './node_modules/@mdigital/ui/dist/**/*.{js,ts,jsx,tsx}',
71
- ],
72
- }
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'
73
45
  ```
74
46
 
75
- ### 2. Import Styles
76
-
77
- In your main CSS file or layout:
47
+ **Or** import in your CSS file:
78
48
 
79
49
  ```css
80
50
  /* app/globals.css or src/index.css */
81
- @import '@mdigital/ui/styles/base.css';
82
- @import '@mdigital/ui/styles/themes/light.css';
83
-
51
+ @import '@mdigital_ui/ui/styles/base.css';
52
+ @import '@mdigital_ui/ui/styles/themes/light.css';
84
53
  /* Optional: Dark mode */
85
- @import '@mdigital/ui/styles/themes/dark.css';
54
+ @import '@mdigital_ui/ui/styles/themes/dark.css';
86
55
  ```
87
56
 
88
- ### 3. Use Components
57
+ ### 2. Use Components
89
58
 
90
59
  ```tsx
91
60
  import { Button, Input, Card } from '@mdigital/ui'
@@ -104,39 +73,33 @@ function App() {
104
73
 
105
74
  ## Import Patterns
106
75
 
107
- ### Subpath Imports (Recommended for Tree-Shaking)
108
-
109
- For optimal bundle size and to avoid installing unnecessary dependencies:
76
+ ### Subpath Imports (Recommended)
110
77
 
111
78
  ```tsx
112
- import Button from '@mdigital/ui/button'
113
- import Input from '@mdigital/ui/input'
114
- import Select from '@mdigital/ui/select'
79
+ import Button from '@mdigital_ui/ui/button'
80
+ import Input from '@mdigital_ui/ui/input'
81
+ import Table from '@mdigital_ui/ui/table'
115
82
  ```
116
83
 
117
- **Benefits:**
118
- - Only bundles the components you use
119
- - Avoids peer dependency warnings for unused components
120
- - Fastest build times
84
+ **Tree-shaking works automatically:**
85
+ - Import only `Button`? Only Button code ends up in your bundle
86
+ - Import `Table`? Table + @tanstack/react-table are bundled
87
+ - Don't import `Carousel`? Swiper never touches your bundle
121
88
 
122
- ### Named Imports (Requires All Peer Dependencies)
123
-
124
- If you've installed all optional peer dependencies, you can use named imports:
89
+ ### Named Imports
125
90
 
126
91
  ```tsx
127
- import { Button, Input, Select, Table, DatePicker } from '@mdigital/ui'
92
+ import { Button, Input, Select } from '@mdigital_ui/ui'
128
93
  ```
129
94
 
130
- **Note:** This requires installing all optional peer dependencies, even for components you don't use. Your bundler may fail if dependencies for unused components aren't installed.
95
+ Both import styles work identically. Use whichever you prefer.
131
96
 
132
97
  ### Type Imports
133
98
 
134
99
  ```tsx
135
- import type { ButtonProps, InputProps } from '@mdigital/ui'
100
+ import type { ButtonProps, InputProps } from '@mdigital_ui/ui'
136
101
  ```
137
102
 
138
- **See [TREE_SHAKING_GUIDE.md](./TREE_SHAKING_GUIDE.md) for detailed import strategies.**
139
-
140
103
  ## Theming
141
104
 
142
105
  ### CSS Variable Overrides
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
- export { tooltip_default as Tooltip } from './chunk-D3JWPGCA.js';
2
1
  export { Transfer } from './chunk-EYTOKUBM.js';
2
+ export { tooltip_default as Tooltip } from './chunk-D3JWPGCA.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
6
  export { slider_default as Slider } from './chunk-NNSS366W.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 { table_default as Table } from './chunk-L3SP7GHC.js';
10
- export { toggle_group_default as ToggleGroup } from './chunk-SK5ECBBK.js';
11
- export { tabs_default as Tabs } from './chunk-OW5A5IIF.js';
12
9
  export { textarea_default as Textarea } from './chunk-FPOXTCYV.js';
10
+ export { tabs_default as Tabs } from './chunk-OW5A5IIF.js';
13
11
  export { toggle_default as Toggle } from './chunk-DPOSWW22.js';
12
+ export { table_default as Table } from './chunk-L3SP7GHC.js';
13
+ export { toggle_group_default as ToggleGroup } from './chunk-SK5ECBBK.js';
14
14
  export { progress_default as Progress } from './chunk-RQBXZKTH.js';
15
15
  export { radio_default as Radio } from './chunk-KTBPIEP2.js';
16
16
  export { radio_group_default as RadioGroup } from './chunk-DOKTHDG3.js';