@vkzstudio/muza-ui 1.0.1 → 1.0.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.
@@ -1,238 +1,238 @@
1
- # Muza UI Library Integration
2
-
3
- This project uses the `@vkzstudio/muza-ui` component library. Follow these guidelines when working with Muza UI components.
4
-
5
- ## Quick Reference
6
-
7
- ```tsx
8
- // Import styles (required - should already be in main entry file)
9
- // Alternative: import '@vkzstudio/muza-ui/dist/muza-ui.css'
10
- // Import components
11
- import { Alert, Button, Input, Select } from '@vkzstudio/muza-ui'
12
- import '@vkzstudio/muza-ui/styles'
13
- ```
14
-
15
- ## Component Usage Rules
16
-
17
- ### 1. Always Use Library Components
18
-
19
- NEVER create new UI components that duplicate Muza UI functionality. Check available components first:
20
-
21
- **Complete Component List (42 components)**
22
-
23
- **Form & Input Components (13)**:
24
- Button, Input, PasswordInput, Textarea, Checkbox, Radio, Switch, Toggle, ToggleGroup, Select, MultiSelect, Searchbar, FileUpload
25
-
26
- **Layout & Structure (5)**:
27
- Accordion, Flex, Typography, Dialog, ExpandableTable
28
-
29
- **Feedback & Status (7)**:
30
- Alert, Tag, Loader, EmptyState, Snackbar, PinIndicator, SliderIndicators
31
-
32
- **Navigation (8)**:
33
- Breadcrumb, DropdownMenu, SegmentedControl, SegmentedIconControl, Stepper, SwipeButton, EdgeButton, LanguageSwitcher
34
-
35
- **Media & Display (3)**:
36
- Avatar, Lightbox, Tooltip
37
-
38
- **Date & Time (3)**:
39
- Calendar, DatePicker, TimePicker
40
-
41
- **Specialized (3)**:
42
- Popover, LoginScreen, Icons
43
-
44
- ### 2. Component Variants
45
-
46
- Use consistent variants across the app:
47
-
48
- ```tsx
49
- // Button variants
50
- variant: "primary" | "secondary" | "tertiary" | "invert" | "dashed" | "link" | "linkInvert"
51
- size: "xs" | "sm" | "md" | "lg"
52
-
53
- // Button modifiers (can combine with any variant)
54
- ghost: boolean // Ghost styling overlay
55
- danger: boolean // Danger styling overlay
56
-
57
- // Examples of combinations
58
- <Button variant="primary" ghost>Ghost Primary</Button>
59
- <Button variant="secondary" danger>Danger Secondary</Button>
60
- <Button variant="tertiary" ghost danger>Ghost Danger Tertiary</Button>
61
-
62
- // Other Button props
63
- loading, fullWidth, icon, iconPosition
64
-
65
- // Input states
66
- <Input error={hasError} disabled={isDisabled} />
67
- <Input mask="(000) 000-0000" placeholder="Phone" /> // With masking
68
-
69
- // Alert types (use 'type' not 'variant')
70
- <Alert type="info" | "success" | "warning" | "error" />
71
- ```
72
-
73
- ### 3. Styling Guidelines
74
-
75
- - **DO NOT** recreate Muza UI components with custom CSS
76
- - **DO** use the `className` prop to add utility classes when needed
77
- - **DO** use design tokens for custom components that extend Muza UI
78
-
79
- ```tsx
80
- // Good - extending with utilities
81
- <Button className="w-full mt-4" variant="primary">
82
- Submit
83
- </Button>
84
-
85
- // Bad - recreating component styles
86
- <button className="bg-purple-500 hover:bg-purple-600 px-4 py-2 rounded">
87
- Submit
88
- </button>
89
- ```
90
-
91
- ### 4. Form Patterns
92
-
93
- Always use Muza UI form components:
94
-
95
- ```tsx
96
- // Good - using library components
97
- import { Input, Button, Checkbox, Radio } from '@vkzstudio/muza-ui'
98
-
99
- function Form() {
100
- return (
101
- <form>
102
- <Input name="email" type="email" required />
103
- <Checkbox id="terms" label="I agree to terms" />
104
- <Radio value="option1" label="Option 1" />
105
- <Button type="submit" variant="primary">
106
- Submit
107
- </Button>
108
- </form>
109
- )
110
- }
111
-
112
- // Bad - using native HTML elements
113
- function Form() {
114
- return (
115
- <form>
116
- <input type="email" />
117
- <input type="checkbox" />
118
- <button>Submit</button>
119
- </form>
120
- )
121
- }
122
- ```
123
-
124
- ### 5. Icons
125
-
126
- Use Muza UI icons from the Solar Icons integration:
127
-
128
- ```tsx
129
- import { Button } from '@vkzstudio/muza-ui'
130
-
131
- // Icons are integrated with @solar-icons/react-perf
132
- // Import from Solar Icons directly in your project
133
- // Muza UI components support icon props where applicable
134
-
135
- ;<Button icon={<SearchIcon />} iconPosition="start">
136
- Search
137
- </Button>
138
- ```
139
-
140
- ### 7. Accessibility
141
-
142
- All Muza UI components include proper ARIA attributes. Maintain accessibility when extending:
143
-
144
- ```tsx
145
- <Button aria-label="Save document" aria-busy={isLoading} disabled={isLoading}>
146
- {isLoading ? 'Saving...' : 'Save'}
147
- </Button>
148
- ```
149
-
150
- ## TypeScript Integration
151
-
152
- The library is fully typed. Use the exported types:
153
-
154
- ```tsx
155
- import type { ButtonProps, InputProps } from '@vkzstudio/muza-ui'
156
-
157
- interface CustomButtonProps extends ButtonProps {
158
- customProp?: boolean
159
- }
160
- ```
161
-
162
- ## Performance Guidelines
163
-
164
- 1. **Import only needed components** - Tree shaking is supported
165
- 2. **Use lazy loading for large components** like Calendar or DatePicker
166
- 3. **Memoize complex forms** when using many Muza UI inputs
167
-
168
- ## DO NOT
169
-
170
- - Create custom Button, Input, or other basic components
171
- - Use native HTML form elements when Muza UI equivalents exist
172
- - Override core component styles with !important
173
- - Mix different UI libraries (Material-UI, Ant Design, etc.) with Muza UI
174
- - Create custom toast/notification systems
175
-
176
- ## DO
177
-
178
- - Use Muza UI components consistently throughout the app
179
- - Extend components with className for spacing/layout
180
- - Follow the established variant patterns
181
- - Maintain accessibility standards
182
- - Report any missing components or features needed
183
-
184
- ## Package Exports
185
-
186
- The library supports multiple export paths for flexibility:
187
-
188
- ```tsx
189
- // Main components export
190
- import { Button, Input } from '@vkzstudio/muza-ui'
191
-
192
- // Styles
193
- import '@vkzstudio/muza-ui/styles'
194
-
195
- // Individual component exports (tree-shaking friendly)
196
- import { Button } from '@vkzstudio/muza-ui/components/Button'
197
-
198
- // Utilities
199
- import { cn } from '@vkzstudio/muza-ui/utils'
200
-
201
- // Global styles
202
- import '@vkzstudio/muza-ui/globals.css'
203
-
204
- // Third-party library styles (required for components like Lightbox)
205
- import '@vkzstudio/muza-ui/3rd-parties.css'
206
-
207
- // 3D Models (for LoginScreen)
208
- import modelPath from '@vkzstudio/muza-ui/models/Login3D.glb'
209
-
210
- // Individual style tokens (granular imports)
211
- import '@vkzstudio/muza-ui/styles/token-colors.css'
212
- import '@vkzstudio/muza-ui/styles/typography.css'
213
- ```
214
-
215
- ## Troubleshooting
216
-
217
- If a component isn't rendering:
218
-
219
- 1. Check that `@vkzstudio/muza-ui/styles` is imported in your entry file
220
- 2. Verify React 18+ is installed
221
- 3. Ensure all required peer dependencies are installed (see package.json)
222
- 4. Verify the component is properly imported
223
- 5. Check browser console for errors
224
- 6. Ensure Tailwind CSS is properly configured if using custom utilities
225
-
226
- **For LoginScreen 3D issues:**
227
-
228
- - Ensure the GLB file is copied to `public/models/Login3D.glb`
229
- - Check that `@react-three/fiber`, `@react-three/drei`, and `three` are installed
230
- - The 3D scene only renders on desktop (screen width > 1024px)
231
-
232
- **For Lightbox image gallery issues:**
233
-
234
- - **REQUIRED:** Import third-party styles: `import '@vkzstudio/muza-ui/3rd-parties.css'` in your entry file
235
- - Check that `photoswipe` and `react-photoswipe-gallery` peer dependencies are installed
236
- - Ensure images have proper `width` and `height` props for the lightbox to display correctly
237
-
238
- Remember: The goal is consistency. Use Muza UI components as designed to maintain a unified design system across the application.
1
+ # Muza UI Library Integration
2
+
3
+ This project uses the `@vkzstudio/muza-ui` component library. Follow these guidelines when working with Muza UI components.
4
+
5
+ ## Quick Reference
6
+
7
+ ```tsx
8
+ // Import styles (required - should already be in main entry file)
9
+ // Alternative: import '@vkzstudio/muza-ui/dist/muza-ui.css'
10
+ // Import components
11
+ import { Alert, Button, Input, Select } from '@vkzstudio/muza-ui'
12
+ import '@vkzstudio/muza-ui/styles'
13
+ ```
14
+
15
+ ## Component Usage Rules
16
+
17
+ ### 1. Always Use Library Components
18
+
19
+ NEVER create new UI components that duplicate Muza UI functionality. Check available components first:
20
+
21
+ **Complete Component List (42 components)**
22
+
23
+ **Form & Input Components (13)**:
24
+ Button, Input, PasswordInput, Textarea, Checkbox, Radio, Switch, Toggle, ToggleGroup, Select, MultiSelect, Searchbar, FileUpload
25
+
26
+ **Layout & Structure (5)**:
27
+ Accordion, Flex, Typography, Dialog, ExpandableTable
28
+
29
+ **Feedback & Status (7)**:
30
+ Alert, Tag, Loader, EmptyState, Snackbar, PinIndicator, SliderIndicators
31
+
32
+ **Navigation (8)**:
33
+ Breadcrumb, DropdownMenu, SegmentedControl, SegmentedIconControl, Stepper, SwipeButton, EdgeButton, LanguageSwitcher
34
+
35
+ **Media & Display (3)**:
36
+ Avatar, Lightbox, Tooltip
37
+
38
+ **Date & Time (3)**:
39
+ Calendar, DatePicker, TimePicker
40
+
41
+ **Specialized (3)**:
42
+ Popover, LoginScreen, Icons
43
+
44
+ ### 2. Component Variants
45
+
46
+ Use consistent variants across the app:
47
+
48
+ ```tsx
49
+ // Button variants
50
+ variant: "primary" | "secondary" | "tertiary" | "invert" | "dashed" | "link" | "linkInvert"
51
+ size: "xs" | "sm" | "md" | "lg"
52
+
53
+ // Button modifiers (can combine with any variant)
54
+ ghost: boolean // Ghost styling overlay
55
+ danger: boolean // Danger styling overlay
56
+
57
+ // Examples of combinations
58
+ <Button variant="primary" ghost>Ghost Primary</Button>
59
+ <Button variant="secondary" danger>Danger Secondary</Button>
60
+ <Button variant="tertiary" ghost danger>Ghost Danger Tertiary</Button>
61
+
62
+ // Other Button props
63
+ loading, fullWidth, icon, iconPosition
64
+
65
+ // Input states
66
+ <Input error={hasError} disabled={isDisabled} />
67
+ <Input mask="(000) 000-0000" placeholder="Phone" /> // With masking
68
+
69
+ // Alert types (use 'type' not 'variant')
70
+ <Alert type="info" | "success" | "warning" | "error" />
71
+ ```
72
+
73
+ ### 3. Styling Guidelines
74
+
75
+ - **DO NOT** recreate Muza UI components with custom CSS
76
+ - **DO** use the `className` prop to add utility classes when needed
77
+ - **DO** use design tokens for custom components that extend Muza UI
78
+
79
+ ```tsx
80
+ // Good - extending with utilities
81
+ <Button className="w-full mt-4" variant="primary">
82
+ Submit
83
+ </Button>
84
+
85
+ // Bad - recreating component styles
86
+ <button className="bg-purple-500 hover:bg-purple-600 px-4 py-2 rounded">
87
+ Submit
88
+ </button>
89
+ ```
90
+
91
+ ### 4. Form Patterns
92
+
93
+ Always use Muza UI form components:
94
+
95
+ ```tsx
96
+ // Good - using library components
97
+ import { Input, Button, Checkbox, Radio } from '@vkzstudio/muza-ui'
98
+
99
+ function Form() {
100
+ return (
101
+ <form>
102
+ <Input name="email" type="email" required />
103
+ <Checkbox id="terms" label="I agree to terms" />
104
+ <Radio value="option1" label="Option 1" />
105
+ <Button type="submit" variant="primary">
106
+ Submit
107
+ </Button>
108
+ </form>
109
+ )
110
+ }
111
+
112
+ // Bad - using native HTML elements
113
+ function Form() {
114
+ return (
115
+ <form>
116
+ <input type="email" />
117
+ <input type="checkbox" />
118
+ <button>Submit</button>
119
+ </form>
120
+ )
121
+ }
122
+ ```
123
+
124
+ ### 5. Icons
125
+
126
+ Use Muza UI icons from the Solar Icons integration:
127
+
128
+ ```tsx
129
+ import { Button } from '@vkzstudio/muza-ui'
130
+
131
+ // Icons are integrated with @solar-icons/react-perf
132
+ // Import from Solar Icons directly in your project
133
+ // Muza UI components support icon props where applicable
134
+
135
+ ;<Button icon={<SearchIcon />} iconPosition="start">
136
+ Search
137
+ </Button>
138
+ ```
139
+
140
+ ### 7. Accessibility
141
+
142
+ All Muza UI components include proper ARIA attributes. Maintain accessibility when extending:
143
+
144
+ ```tsx
145
+ <Button aria-label="Save document" aria-busy={isLoading} disabled={isLoading}>
146
+ {isLoading ? 'Saving...' : 'Save'}
147
+ </Button>
148
+ ```
149
+
150
+ ## TypeScript Integration
151
+
152
+ The library is fully typed. Use the exported types:
153
+
154
+ ```tsx
155
+ import type { ButtonProps, InputProps } from '@vkzstudio/muza-ui'
156
+
157
+ interface CustomButtonProps extends ButtonProps {
158
+ customProp?: boolean
159
+ }
160
+ ```
161
+
162
+ ## Performance Guidelines
163
+
164
+ 1. **Import only needed components** - Tree shaking is supported
165
+ 2. **Use lazy loading for large components** like Calendar or DatePicker
166
+ 3. **Memoize complex forms** when using many Muza UI inputs
167
+
168
+ ## DO NOT
169
+
170
+ - Create custom Button, Input, or other basic components
171
+ - Use native HTML form elements when Muza UI equivalents exist
172
+ - Override core component styles with !important
173
+ - Mix different UI libraries (Material-UI, Ant Design, etc.) with Muza UI
174
+ - Create custom toast/notification systems
175
+
176
+ ## DO
177
+
178
+ - Use Muza UI components consistently throughout the app
179
+ - Extend components with className for spacing/layout
180
+ - Follow the established variant patterns
181
+ - Maintain accessibility standards
182
+ - Report any missing components or features needed
183
+
184
+ ## Package Exports
185
+
186
+ The library supports multiple export paths for flexibility:
187
+
188
+ ```tsx
189
+ // Main components export
190
+ import { Button, Input } from '@vkzstudio/muza-ui'
191
+
192
+ // Styles
193
+ import '@vkzstudio/muza-ui/styles'
194
+
195
+ // Individual component exports (tree-shaking friendly)
196
+ import { Button } from '@vkzstudio/muza-ui/components/Button'
197
+
198
+ // Utilities
199
+ import { cn } from '@vkzstudio/muza-ui/utils'
200
+
201
+ // Global styles
202
+ import '@vkzstudio/muza-ui/globals.css'
203
+
204
+ // Third-party library styles (required for components like Lightbox)
205
+ import '@vkzstudio/muza-ui/3rd-parties.css'
206
+
207
+ // 3D Models (for LoginScreen)
208
+ import modelPath from '@vkzstudio/muza-ui/models/Login3D.glb'
209
+
210
+ // Individual style tokens (granular imports)
211
+ import '@vkzstudio/muza-ui/styles/token-colors.css'
212
+ import '@vkzstudio/muza-ui/styles/typography.css'
213
+ ```
214
+
215
+ ## Troubleshooting
216
+
217
+ If a component isn't rendering:
218
+
219
+ 1. Check that `@vkzstudio/muza-ui/styles` is imported in your entry file
220
+ 2. Verify React 18+ is installed
221
+ 3. Ensure all required peer dependencies are installed (see package.json)
222
+ 4. Verify the component is properly imported
223
+ 5. Check browser console for errors
224
+ 6. Ensure Tailwind CSS is properly configured if using custom utilities
225
+
226
+ **For LoginScreen 3D issues:**
227
+
228
+ - Ensure the GLB file is copied to `public/models/Login3D.glb`
229
+ - Check that `@react-three/fiber`, `@react-three/drei`, and `three` are installed
230
+ - The 3D scene only renders on desktop (screen width > 1024px)
231
+
232
+ **For Lightbox image gallery issues:**
233
+
234
+ - **REQUIRED:** Import third-party styles: `import '@vkzstudio/muza-ui/3rd-parties.css'` in your entry file
235
+ - Check that `photoswipe` and `react-photoswipe-gallery` peer dependencies are installed
236
+ - Ensure images have proper `width` and `height` props for the lightbox to display correctly
237
+
238
+ Remember: The goal is consistency. Use Muza UI components as designed to maintain a unified design system across the application.
package/README.md CHANGED
@@ -1,168 +1,168 @@
1
- # Muza UI
2
-
3
- A modern React component library built with Vite, shadcn/ui, and Tailwind CSS 4.
4
-
5
- ## Prerequisites
6
-
7
- - Node.js 22 or higher
8
- - npm or yarn
9
-
10
- ## Quick Start
11
-
12
- 1. **Clone and install dependencies:**
13
-
14
- ```bash
15
- npm install
16
- ```
17
-
18
- 2. **Start development server:**
19
- ```bash
20
- npm run dev
21
- ```
22
- This starts Storybook at [http://localhost:6006](http://localhost:6006)
23
-
24
- ## Development
25
-
26
- ### Node.js Version Management
27
-
28
- This project requires Node.js 22+. If you're using nvm:
29
-
30
- ```bash
31
- nvm use
32
- ```
33
-
34
- ### Available Scripts
35
-
36
- | Script | Description |
37
- | ---------------------------------- | ----------------------------------------------- |
38
- | `npm run dev` | Start Storybook development server on port 6006 |
39
- | `npm run build` | Build the component library for production |
40
- | `npm run build-storybook` | Build Storybook for deployment |
41
- | `npm run typecheck` | Run TypeScript type checking |
42
- | `npm run lint` | Run ESLint |
43
- | `npm run lint:fix` | Run ESLint with auto-fix |
44
- | `npm run add-component <name>` | Add shadcn/ui component (macOS/Linux) |
45
- | `npm run add-component:win <name>` | Add shadcn/ui component (Windows) |
46
- | `npm run format` | Run prettier |
47
-
48
- ### Project Structure
49
-
50
- ```
51
- src/
52
- ├── components/ # React components
53
- │ ├── Button/ # Example component
54
- │ │ ├── Button.tsx
55
- │ │ ├── Button.stories.tsx
56
- │ │ └── index.ts
57
- │ └── index.ts # Component exports
58
- ├── utils/ # Utility functions
59
- │ ├── cn.ts # Class name utility
60
- │ └── index.ts # Utility exports
61
- ├── globals.css # Global Tailwind styles
62
- └── index.ts # Main library export
63
- ```
64
-
65
- ### Adding Components
66
-
67
- For automated component installation using shadcn/ui, see: **[Component Installation Guide](docs/components.md)**
68
-
69
- #### Manual Component Creation
70
-
71
- 1. **Create component directory:**
72
-
73
- ```bash
74
- mkdir src/components/YourComponent
75
- ```
76
-
77
- 2. **Create component files:**
78
- - `YourComponent.tsx` - Main component
79
- - `YourComponent.stories.tsx` - Storybook stories
80
- - `index.ts` - Export file
81
-
82
- 3. **Export from main index:**
83
- Add to `src/components/index.ts`:
84
- ```typescript
85
- export * from './YourComponent'
86
- ```
87
-
88
- ### Storybook Development
89
-
90
- Components are showcased and developed using Storybook:
91
-
92
- - **View components:** `npm run dev` → [http://localhost:6006](http://localhost:6006)
93
- - **Create stories:** Follow the pattern in `Button.stories.tsx`
94
- - **Auto-docs:** Stories are automatically documented
95
-
96
- ## Build Process
97
-
98
- ### Library Build
99
-
100
- ```bash
101
- npm run build
102
- ```
103
-
104
- This creates:
105
-
106
- - `dist/index.js` - ES module bundle
107
- - `dist/index.d.ts` - TypeScript declarations
108
- - `dist/muza-ui.css` - Compiled CSS with all design tokens
109
- - `dist/components/` - Individual component modules
110
- - `dist/styles/` - Design system token files
111
-
112
- ### Storybook Build
113
-
114
- ```bash
115
- npm run build-storybook
116
- ```
117
-
118
- Creates `storybook-static/` directory for deployment.
119
-
120
- ## Technologies
121
-
122
- - **React 18** - UI framework
123
- - **Vite** - Build tool and dev server
124
- - **TypeScript** - Type safety
125
- - **Tailwind CSS 4** - Utility-first CSS framework
126
- - **shadcn/ui** - Component patterns and utilities
127
- - **Storybook** - Component development and documentation
128
- - **class-variance-authority** - Component variant management
129
-
130
- ## Library Usage
131
-
132
- Install the package:
133
-
134
- ```bash
135
- npm install @vkzstudio/muza-ui
136
- ```
137
-
138
- **Important:** This library requires Tailwind CSS 4 to be configured in your project.
139
-
140
- ```typescript
141
- import { Button } from '@vkzstudio/muza-ui'
142
- import '@vkzstudio/muza-ui/styles'
143
-
144
- function App() {
145
- return <Button variant="primary">Click me</Button>
146
- }
147
- ```
148
-
149
- ## Styling
150
-
151
- - Uses Tailwind CSS 4 with CSS variables
152
- - Follows shadcn/ui design system patterns
153
- - Custom utility function `cn()` for class merging
154
- - Dark mode support built-in
155
-
156
- ## Quality Assurance
157
-
158
- - **TypeScript** - Static type checking
159
- - **ESLint** - Code linting
160
- - **Prettier** - Code formating
161
- - **Storybook** - Visual testing and documentation
162
-
163
- ## Contributing
164
-
165
- 1. Create components following the established patterns
166
- 2. Include comprehensive Storybook stories
167
- 3. Run type checking and linting before committing
168
- 4. Test components in Storybook
1
+ # Muza UI
2
+
3
+ A modern React component library built with Vite, shadcn/ui, and Tailwind CSS 4.
4
+
5
+ ## Prerequisites
6
+
7
+ - Node.js 22 or higher
8
+ - npm or yarn
9
+
10
+ ## Quick Start
11
+
12
+ 1. **Clone and install dependencies:**
13
+
14
+ ```bash
15
+ npm install
16
+ ```
17
+
18
+ 2. **Start development server:**
19
+ ```bash
20
+ npm run dev
21
+ ```
22
+ This starts Storybook at [http://localhost:6006](http://localhost:6006)
23
+
24
+ ## Development
25
+
26
+ ### Node.js Version Management
27
+
28
+ This project requires Node.js 22+. If you're using nvm:
29
+
30
+ ```bash
31
+ nvm use
32
+ ```
33
+
34
+ ### Available Scripts
35
+
36
+ | Script | Description |
37
+ | ---------------------------------- | ----------------------------------------------- |
38
+ | `npm run dev` | Start Storybook development server on port 6006 |
39
+ | `npm run build` | Build the component library for production |
40
+ | `npm run build-storybook` | Build Storybook for deployment |
41
+ | `npm run typecheck` | Run TypeScript type checking |
42
+ | `npm run lint` | Run ESLint |
43
+ | `npm run lint:fix` | Run ESLint with auto-fix |
44
+ | `npm run add-component <name>` | Add shadcn/ui component (macOS/Linux) |
45
+ | `npm run add-component:win <name>` | Add shadcn/ui component (Windows) |
46
+ | `npm run format` | Run prettier |
47
+
48
+ ### Project Structure
49
+
50
+ ```
51
+ src/
52
+ ├── components/ # React components
53
+ │ ├── Button/ # Example component
54
+ │ │ ├── Button.tsx
55
+ │ │ ├── Button.stories.tsx
56
+ │ │ └── index.ts
57
+ │ └── index.ts # Component exports
58
+ ├── utils/ # Utility functions
59
+ │ ├── cn.ts # Class name utility
60
+ │ └── index.ts # Utility exports
61
+ ├── globals.css # Global Tailwind styles
62
+ └── index.ts # Main library export
63
+ ```
64
+
65
+ ### Adding Components
66
+
67
+ For automated component installation using shadcn/ui, see: **[Component Installation Guide](docs/components.md)**
68
+
69
+ #### Manual Component Creation
70
+
71
+ 1. **Create component directory:**
72
+
73
+ ```bash
74
+ mkdir src/components/YourComponent
75
+ ```
76
+
77
+ 2. **Create component files:**
78
+ - `YourComponent.tsx` - Main component
79
+ - `YourComponent.stories.tsx` - Storybook stories
80
+ - `index.ts` - Export file
81
+
82
+ 3. **Export from main index:**
83
+ Add to `src/components/index.ts`:
84
+ ```typescript
85
+ export * from './YourComponent'
86
+ ```
87
+
88
+ ### Storybook Development
89
+
90
+ Components are showcased and developed using Storybook:
91
+
92
+ - **View components:** `npm run dev` → [http://localhost:6006](http://localhost:6006)
93
+ - **Create stories:** Follow the pattern in `Button.stories.tsx`
94
+ - **Auto-docs:** Stories are automatically documented
95
+
96
+ ## Build Process
97
+
98
+ ### Library Build
99
+
100
+ ```bash
101
+ npm run build
102
+ ```
103
+
104
+ This creates:
105
+
106
+ - `dist/index.js` - ES module bundle
107
+ - `dist/index.d.ts` - TypeScript declarations
108
+ - `dist/muza-ui.css` - Compiled CSS with all design tokens
109
+ - `dist/components/` - Individual component modules
110
+ - `dist/styles/` - Design system token files
111
+
112
+ ### Storybook Build
113
+
114
+ ```bash
115
+ npm run build-storybook
116
+ ```
117
+
118
+ Creates `storybook-static/` directory for deployment.
119
+
120
+ ## Technologies
121
+
122
+ - **React 18** - UI framework
123
+ - **Vite** - Build tool and dev server
124
+ - **TypeScript** - Type safety
125
+ - **Tailwind CSS 4** - Utility-first CSS framework
126
+ - **shadcn/ui** - Component patterns and utilities
127
+ - **Storybook** - Component development and documentation
128
+ - **class-variance-authority** - Component variant management
129
+
130
+ ## Library Usage
131
+
132
+ Install the package:
133
+
134
+ ```bash
135
+ npm install @vkzstudio/muza-ui
136
+ ```
137
+
138
+ **Important:** This library requires Tailwind CSS 4 to be configured in your project.
139
+
140
+ ```typescript
141
+ import { Button } from '@vkzstudio/muza-ui'
142
+ import '@vkzstudio/muza-ui/styles'
143
+
144
+ function App() {
145
+ return <Button variant="primary">Click me</Button>
146
+ }
147
+ ```
148
+
149
+ ## Styling
150
+
151
+ - Uses Tailwind CSS 4 with CSS variables
152
+ - Follows shadcn/ui design system patterns
153
+ - Custom utility function `cn()` for class merging
154
+ - Dark mode support built-in
155
+
156
+ ## Quality Assurance
157
+
158
+ - **TypeScript** - Static type checking
159
+ - **ESLint** - Code linting
160
+ - **Prettier** - Code formating
161
+ - **Storybook** - Visual testing and documentation
162
+
163
+ ## Contributing
164
+
165
+ 1. Create components following the established patterns
166
+ 2. Include comprehensive Storybook stories
167
+ 3. Run type checking and linting before committing
168
+ 4. Test components in Storybook
@@ -25,6 +25,7 @@ export type DatePickerProps = {
25
25
  avoidCollisions?: boolean;
26
26
  renderCustomTrigger?: () => ReactNode;
27
27
  shouldResetToDefaultValue?: boolean;
28
+ required?: boolean;
28
29
  } & Omit<CalendarBaseProps, 'numberOfMonths' | 'onConfirm' | 'onReset' | 'isExpanded' | 'leftPanelChildren' | 'bottomTextDefault' | 'dateFormatter' | 'dateRangeFormatter'> & (Range | Single);
29
30
  type Range = {
30
31
  mode: 'range';
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAmC,MAAM,OAAO,CAAA;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAIjD,OAAO,EAEL,KAAK,iBAAiB,EA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AA;IAC/B,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAA;CACvC,CAAA;AAED,eAAO,MAAM,UAAU,8GAqLtB,CAAA"}
@@ -1,17 +1,17 @@
1
- import { jsx as e, jsxs as U } from "react/jsx-runtime";
2
- import { forwardRef as W, useState as S, useEffect as X } from "react";
3
- import { useIsDesktop as Z } from "../../hooks/use-is-desktop.js";
4
- import { useIsMobile as _ } from "../../hooks/use-is-mobile.js";
5
- import { Popover as $, PopoverTrigger as g, PopoverContent as w } from "../Popover/Popover.js";
6
- import { getDateRange as T } from "./utils/getDateRange.js";
7
- import { typographyVariants as a } from "../Typography/Typography.js";
8
- import { Input as V } from "../Input/Input.js";
9
- import { formatDate as s } from "../Calendar/utils/formatDate.js";
10
- import { formatDateRange as O } from "../Calendar/utils/formatDateRange.js";
1
+ import { jsx as e, jsxs as W } from "react/jsx-runtime";
2
+ import { forwardRef as X, useState as S, useEffect as Z } from "react";
3
+ import { useIsDesktop as _ } from "../../hooks/use-is-desktop.js";
4
+ import { useIsMobile as $ } from "../../hooks/use-is-mobile.js";
5
+ import { Popover as g, PopoverTrigger as w, PopoverContent as T } from "../Popover/Popover.js";
6
+ import { getDateRange as a } from "./utils/getDateRange.js";
7
+ import { typographyVariants as V } from "../Typography/Typography.js";
8
+ import { Input as s } from "../Input/Input.js";
9
+ import { formatDate as O } from "../Calendar/utils/formatDate.js";
10
+ import { formatDateRange as h } from "../Calendar/utils/formatDateRange.js";
11
11
  import { Calendar as R } from "../Calendar/Calendar.js";
12
12
  import { cn as u } from "../../utils/cn.js";
13
- import { CalendarBold as h } from "@solar-icons/react-perf";
14
- const C = W(
13
+ import { CalendarBold as C } from "@solar-icons/react-perf";
14
+ const N = X(
15
15
  ({
16
16
  alignCalendar: j,
17
17
  mode: v,
@@ -32,19 +32,20 @@ const C = W(
32
32
  side: q = "bottom",
33
33
  renderCustomTrigger: I,
34
34
  shouldResetToDefaultValue: c,
35
+ required: G,
35
36
  ...M
36
- }, G) => {
37
- const F = Z(), H = _(), [J, y] = S(!1), K = typeof d == "boolean" ? d : J, [b, D] = S(
37
+ }, H) => {
38
+ const F = _(), J = $(), [K, y] = S(!1), L = typeof d == "boolean" ? d : K, [b, D] = S(
38
39
  f ?? p
39
40
  ), [o, n] = S(f ?? p);
40
- X(() => {
41
+ Z(() => {
41
42
  f !== void 0 && (D(f), n(f));
42
43
  }, [f]);
43
- const L = x == null ? void 0 : x.map((i) => /* @__PURE__ */ e(
44
+ const Q = x == null ? void 0 : x.map((i) => /* @__PURE__ */ e(
44
45
  "button",
45
46
  {
46
47
  className: u(
47
- a({
48
+ V({
48
49
  variant: "cta",
49
50
  weight: "medium",
50
51
  size: "sm",
@@ -57,23 +58,23 @@ const C = W(
57
58
  t == null ? void 0 : t.leftPanelButton
58
59
  ),
59
60
  onClick: () => {
60
- const Q = T(i.type);
61
- n(Q);
61
+ const U = a(i.type);
62
+ n(U);
62
63
  },
63
64
  children: i.name
64
65
  },
65
66
  i.type
66
- )), k = z ?? (v === "single" ? s : O);
67
- return /* @__PURE__ */ U(
68
- $,
67
+ )), k = z ?? (v === "single" ? O : h);
68
+ return /* @__PURE__ */ W(
69
+ g,
69
70
  {
70
- open: K,
71
+ open: L,
71
72
  onOpenChange: (i) => {
72
73
  d === void 0 && y(i), r == null || r(i);
73
74
  },
74
75
  children: [
75
76
  /* @__PURE__ */ e(
76
- g,
77
+ w,
77
78
  {
78
79
  className: u(
79
80
  "group cursor-pointer rounded-full text-left focus-visible-default",
@@ -81,9 +82,9 @@ const C = W(
81
82
  ),
82
83
  disabled: l,
83
84
  children: I ? I() : /* @__PURE__ */ e(
84
- V,
85
+ s,
85
86
  {
86
- ref: G,
87
+ ref: H,
87
88
  value: b ? k(b) : "",
88
89
  placeholder: P,
89
90
  error: B,
@@ -91,18 +92,19 @@ const C = W(
91
92
  label: E,
92
93
  hint: A,
93
94
  tabIndex: -1,
95
+ required: G,
94
96
  className: u(
95
97
  "pointer-events-none",
96
98
  t == null ? void 0 : t.input,
97
99
  "group-hover:border-comp-input-stroke-hover"
98
100
  ),
99
- suffix: /* @__PURE__ */ e(h, { className: "size-icon-medium text-icon-dark-secondary-def" })
101
+ suffix: /* @__PURE__ */ e(C, { className: "size-icon-medium text-icon-dark-secondary-def" })
100
102
  }
101
103
  )
102
104
  }
103
105
  ),
104
106
  /* @__PURE__ */ e(
105
- w,
107
+ T,
106
108
  {
107
109
  className: u("flex w-auto p-0", t == null ? void 0 : t.popoverContent),
108
110
  align: j,
@@ -139,7 +141,7 @@ const C = W(
139
141
  (o !== void 0 || c) && (D(o), m == null || m(o)), d === void 0 && y(!1), r == null || r(!1);
140
142
  },
141
143
  numberOfMonths: F ? 2 : 1,
142
- leftPanelChildren: v === "range" && !H && L,
144
+ leftPanelChildren: v === "range" && !J && Q,
143
145
  dateRangeFormatter: k
144
146
  }
145
147
  )
@@ -150,7 +152,7 @@ const C = W(
150
152
  );
151
153
  }
152
154
  );
153
- C.displayName = "DatePicker";
155
+ N.displayName = "DatePicker";
154
156
  export {
155
- C as DatePicker
157
+ N as DatePicker
156
158
  };
@@ -14,4 +14,5 @@ export declare const DatePickerWithDisabledDates: Story;
14
14
  export declare const ControlledDatePickerWithCustomTrigger: Story;
15
15
  export declare const ResetButtonResetsToUndefined: Story;
16
16
  export declare const ResetButtonResetsToStoryDate: Story;
17
+ export declare const Required: Story;
17
18
  //# sourceMappingURL=DatePicker.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.stories.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAI3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAKzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAkBjC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAA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,eAAO,MAAM,2BAA2B,EAAE,KAkCzC,CAAA;AAED,eAAO,MAAM,qCAAqC,EAAE,KA6CnD,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAwB1C,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAwB1C,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAyBtB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Searchbar.d.ts","sourceRoot":"","sources":["../../../src/components/Searchbar/Searchbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,WAAW,cACf,SAAQ,IAAI,CACV,UAAU,EACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,cAAc,GACd,QAAQ,GACR,OAAO,GACP,cAAc,CACjB;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;CACzD;AAED,QAAA,MAAM,SAAS,GAAI,gKAchB,cAAc,4CA0FhB,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"Searchbar.d.ts","sourceRoot":"","sources":["../../../src/components/Searchbar/Searchbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,WAAW,cACf,SAAQ,IAAI,CACV,UAAU,EACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,cAAc,GACd,QAAQ,GACR,OAAO,GACP,cAAc,CACjB;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;CACzD;AAED,QAAA,MAAM,SAAS,GAAI,gKAchB,cAAc,4CAiGhB,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,80 +1,80 @@
1
- import { jsxs as C, jsx as e } from "react/jsx-runtime";
2
- import * as c from "react";
3
- import { MagnifyingGlass as R } from "../Icons/CustomIcons.js";
1
+ import { jsxs as R, jsx as r } from "react/jsx-runtime";
2
+ import * as n from "react";
3
+ import { MagnifyingGlass as j } from "../Icons/CustomIcons.js";
4
4
  import { cn as a } from "../../utils/cn.js";
5
- import { CloseCircleBold as S } from "@solar-icons/react-perf";
6
- import { Input as j } from "../Input/Input.js";
5
+ import { CloseCircleBold as w } from "@solar-icons/react-perf";
6
+ import { Input as I } from "../Input/Input.js";
7
7
  const E = ({
8
- className: u,
9
- error: m = !1,
10
- showButtons: p = !0,
11
- clearButtonAriaLabel: x,
12
- searchButtonAriaLabel: d,
13
- disabled: t = !1,
8
+ className: m,
9
+ error: p = !1,
10
+ showButtons: x = !0,
11
+ clearButtonAriaLabel: d,
12
+ searchButtonAriaLabel: y,
13
+ disabled: e = !1,
14
14
  value: o,
15
- defaultValue: y,
16
- name: h,
17
- placeholder: k,
15
+ defaultValue: h,
16
+ name: k,
17
+ placeholder: v,
18
18
  onChange: s,
19
- onSubmit: v,
19
+ onSubmit: i,
20
20
  ...g
21
21
  }) => {
22
- const n = c.useRef(null), [l, i] = c.useState(
23
- o ?? y ?? ""
22
+ const f = n.useRef(null), [c, l] = n.useState(
23
+ o ?? h ?? ""
24
24
  );
25
- c.useEffect(() => {
26
- o !== void 0 && i(o);
25
+ n.useEffect(() => {
26
+ o !== void 0 && l(o);
27
27
  }, [o]);
28
- const N = (r) => {
29
- i(r.target.value), s && s(r);
30
- }, b = () => {
31
- var r, f;
32
- i(""), (f = (r = n.current) == null ? void 0 : r.querySelector("input")) == null || f.focus(), s && s({
28
+ const N = (t) => {
29
+ l(t.target.value), s && s(t);
30
+ }, z = () => {
31
+ var t, u;
32
+ l(""), (u = (t = f.current) == null ? void 0 : t.querySelector("input")) == null || u.focus(), s && s({
33
33
  target: { value: "" }
34
34
  });
35
- }, z = p ? /* @__PURE__ */ C("div", { className: "flex gap-sm", children: [
36
- /* @__PURE__ */ e(
35
+ }, C = x ? /* @__PURE__ */ R("div", { className: "flex gap-sm", children: [
36
+ /* @__PURE__ */ r(
37
37
  "button",
38
38
  {
39
39
  className: a(
40
40
  "flex shrink-0 cursor-pointer items-center focus-visible-default transition-opacity",
41
41
  {
42
- "opacity-0": !l,
43
- "cursor-not-allowed": t
42
+ "opacity-0": !c,
43
+ "cursor-not-allowed": e
44
44
  }
45
45
  ),
46
- "aria-label": x,
46
+ "aria-label": d,
47
47
  type: "button",
48
- onClick: b,
49
- children: /* @__PURE__ */ e(
50
- S,
48
+ onClick: z,
49
+ children: /* @__PURE__ */ r(
50
+ w,
51
51
  {
52
52
  className: a("size-icon-small text-icon-dark-secondary-def", {
53
- "text-text-dark-tertiary": t
53
+ "text-text-dark-tertiary": e
54
54
  })
55
55
  }
56
56
  )
57
57
  }
58
58
  ),
59
- /* @__PURE__ */ e(
59
+ /* @__PURE__ */ r(
60
60
  "button",
61
61
  {
62
62
  className: a(
63
63
  "flex shrink-0 cursor-pointer items-center focus-visible-default",
64
64
  {
65
- "cursor-not-allowed": t
65
+ "cursor-not-allowed": e
66
66
  }
67
67
  ),
68
- "aria-label": d,
68
+ "aria-label": y,
69
69
  type: "submit",
70
- children: /* @__PURE__ */ e(
71
- R,
70
+ children: /* @__PURE__ */ r(
71
+ j,
72
72
  {
73
73
  className: a(
74
74
  "size-icon-small text-icon-dark-primary-def transition-colors",
75
75
  {
76
- "text-text-dark-tertiary": t,
77
- "group-hover:text-icon-dark-primary-hover": !t
76
+ "text-text-dark-tertiary": e,
77
+ "group-hover:text-icon-dark-primary-hover": !e
78
78
  }
79
79
  )
80
80
  }
@@ -82,22 +82,32 @@ const E = ({
82
82
  }
83
83
  )
84
84
  ] }) : void 0;
85
- return /* @__PURE__ */ e("form", { ref: n, onSubmit: v, className: u, children: /* @__PURE__ */ e(
86
- j,
85
+ return /* @__PURE__ */ r(
86
+ "form",
87
87
  {
88
- suffix: z,
89
- type: "text",
90
- size: "sm",
91
- error: m,
92
- disabled: t,
93
- value: l,
94
- name: h,
95
- onChange: N,
96
- placeholder: k,
97
- className: "group",
98
- ...g
88
+ ref: f,
89
+ onSubmit: (t) => {
90
+ t.preventDefault(), c.length > 0 && (i == null || i(t));
91
+ },
92
+ className: m,
93
+ children: /* @__PURE__ */ r(
94
+ I,
95
+ {
96
+ suffix: C,
97
+ type: "text",
98
+ size: "sm",
99
+ error: p,
100
+ disabled: e,
101
+ value: c,
102
+ name: k,
103
+ onChange: N,
104
+ placeholder: v,
105
+ className: "group",
106
+ ...g
107
+ }
108
+ )
99
109
  }
100
- ) });
110
+ );
101
111
  };
102
112
  export {
103
113
  E as Searchbar
@@ -1 +1 @@
1
- {"version":3,"file":"Searchbar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Searchbar/Searchbar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAiEhC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvC,eAAO,MAAM,OAAO,EAAE,KAmBrB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAmBpB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAoBtB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAoBnB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAoBrB,CAAA"}
1
+ {"version":3,"file":"Searchbar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Searchbar/Searchbar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAiEhC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvC,eAAO,MAAM,OAAO,EAAE,KAkBrB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAkBpB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAmBtB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAmBnB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAmBrB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkzstudio/muza-ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "React component library built with Vite, shadcn/ui, and Tailwind CSS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -47,7 +47,8 @@
47
47
  "add-component": "chmod +x scripts/add-component.sh && ./scripts/add-component.sh",
48
48
  "add-component:win": "powershell -ExecutionPolicy Bypass -File scripts/add-component.ps1",
49
49
  "format": "prettier --write .",
50
- "chromatic": "npx chromatic --project-token=chpt_23ce248b589dbff"
50
+ "chromatic": "npx chromatic --project-token=chpt_23ce248b589dbff",
51
+ "local-publish": "npm run build && npx shx rm -rf ../internal-benefits-frontend/node_modules/@vkzstudio/muza-ui/dist && npx shx cp -r dist ../internal-benefits-frontend/node_modules/@vkzstudio/muza-ui/dist"
51
52
  },
52
53
  "dependencies": {
53
54
  "react-day-picker": "^9.9.0",