@vkzstudio/muza-ui 1.0.1 → 1.0.3
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/CLAUDE_CONSUMER.md +238 -238
- package/README.md +168 -168
- package/dist/components/DatePicker/DatePicker.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +33 -31
- package/dist/components/DatePicker/DatePicker.stories.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.js +162 -157
- package/dist/components/ExpandableTable/Table.d.ts +4 -1
- package/dist/components/ExpandableTable/Table.d.ts.map +1 -1
- package/dist/components/ExpandableTable/Table.js +82 -78
- package/dist/components/Loader/Loader.js +6 -6
- package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
- package/dist/components/Searchbar/Searchbar.js +64 -54
- package/dist/components/Searchbar/Searchbar.stories.d.ts.map +1 -1
- package/dist/muza-ui.css +1 -1
- package/package.json +3 -2
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,EAGvB,MAAM,aAAa,CAAA;AAKpB,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,sBAAsB,CAAA;AAEjE,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAA;IAC1C,cAAc,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;KAAE,EAAE,CAAA;IACnE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;QACnB,cAAc,EAAE,MAAM,CAAA;QACtB,cAAc,EAAE,MAAM,CAAA;QACtB,KAAK,EAAE,MAAM,CAAA;QACb,eAAe,EAAE,MAAM,CAAA;KACxB,CAAC,CAAA;IACF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IAC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AAA;IACpB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,mBAAmB,CAAC,EAAE,MAAM,SAAS,CAAA;IACrC,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,GAAG,IAAI,CACN,iBAAiB,EACf,gBAAgB,GAChB,WAAW,GACX,SAAS,GACT,YAAY,GACZ,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,GACf,oBAAoB,CACvB,GACC,CAAC,KAAK,GAAG,MAAM,CAAC,CAAA;AAElB,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC7B,YAAY,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACpC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;IACpC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,MAAM,CAAA;CAC5C,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,QAAQ,CAAA;IACd,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IACxB,YAAY,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IAC/B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;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
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useIsDesktop as
|
|
4
|
-
import { useIsMobile as
|
|
5
|
-
import { Popover as
|
|
6
|
-
import { getDateRange as
|
|
7
|
-
import { typographyVariants as
|
|
8
|
-
import { Input as
|
|
9
|
-
import { formatDate as
|
|
10
|
-
import { formatDateRange as
|
|
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
|
|
14
|
-
const
|
|
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
|
-
},
|
|
37
|
-
const F =
|
|
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
|
-
|
|
41
|
+
Z(() => {
|
|
41
42
|
f !== void 0 && (D(f), n(f));
|
|
42
43
|
}, [f]);
|
|
43
|
-
const
|
|
44
|
+
const Q = x == null ? void 0 : x.map((i) => /* @__PURE__ */ e(
|
|
44
45
|
"button",
|
|
45
46
|
{
|
|
46
47
|
className: u(
|
|
47
|
-
|
|
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
|
|
61
|
-
n(
|
|
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" ?
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
|
|
67
|
+
)), k = z ?? (v === "single" ? O : h);
|
|
68
|
+
return /* @__PURE__ */ W(
|
|
69
|
+
g,
|
|
69
70
|
{
|
|
70
|
-
open:
|
|
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
|
-
|
|
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
|
-
|
|
85
|
+
s,
|
|
85
86
|
{
|
|
86
|
-
ref:
|
|
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(
|
|
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
|
-
|
|
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" && !
|
|
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
|
-
|
|
155
|
+
N.displayName = "DatePicker";
|
|
154
156
|
export {
|
|
155
|
-
|
|
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":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;AAED,MAAM,WAAW,0BAA0B,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAA;CACpC;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAA;IACrB,qBAAqB,CAAC,EAClB,0BAA0B,CAAC,CAAC,CAAC,EAAE,GAC/B,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;CAClD;
|
|
1
|
+
{"version":3,"file":"ExpandableTable.d.ts","sourceRoot":"","sources":["../../../src/components/ExpandableTable/ExpandableTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAA;AAgBnE,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,SAAS,CAAA;IACrD,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CACvC;AAED,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,SAAS,CAAA;IAChB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,SAAS,CAAA;CACtD;AAED,MAAM,WAAW,0BAA0B,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,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