@mriqbox/ui-kit 2.1.0 → 3.1.0
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/bin/cli.js +75 -28
- package/dist/components/{ui → atoms}/MriButton.d.ts +1 -0
- package/dist/components/{ui → atoms}/MriButton.stories.d.ts +1 -0
- package/dist/components/atoms/MriInput.d.ts +8 -0
- package/dist/components/{ui → atoms}/MriInput.stories.d.ts +4 -2
- package/dist/components/atoms/MriSkeleton.d.ts +2 -0
- package/dist/components/atoms/MriSkeleton.stories.d.ts +16 -0
- package/dist/components/atoms/MriStatusBadge.d.ts +7 -0
- package/dist/components/atoms/MriStatusBadge.stories.d.ts +10 -0
- package/dist/components/{ui → atoms}/mri-badge-variants.d.ts +1 -1
- package/dist/components/{ui → atoms}/mri-button-variants.d.ts +1 -1
- package/dist/components/{ui → molecules}/MriCommand.d.ts +3 -3
- package/dist/components/{ui → molecules}/MriCompactSearch.d.ts +3 -1
- package/dist/components/{ui → molecules}/MriCompactSearch.stories.d.ts +2 -0
- package/dist/components/molecules/MriCopyButton.d.ts +7 -0
- package/dist/components/molecules/MriCopyButton.stories.d.ts +8 -0
- package/dist/components/{ui → molecules}/MriDatePicker.d.ts +3 -1
- package/dist/components/{ui → molecules}/MriDatePicker.stories.d.ts +2 -0
- package/dist/components/molecules/MriDrawer.d.ts +19 -0
- package/dist/components/molecules/MriDrawer.stories.d.ts +13 -0
- package/dist/components/molecules/MriEconomyCard.d.ts +8 -0
- package/dist/components/molecules/MriEconomyCard.stories.d.ts +8 -0
- package/dist/components/molecules/MriGridActionButton.d.ts +11 -0
- package/dist/components/molecules/MriGridActionButton.stories.d.ts +9 -0
- package/dist/components/{ui → molecules}/MriModal.stories.d.ts +1 -0
- package/dist/components/molecules/MriSearchInput.d.ts +10 -0
- package/dist/components/molecules/MriSearchInput.stories.d.ts +10 -0
- package/dist/components/molecules/MriSectionHeader.d.ts +8 -0
- package/dist/components/molecules/MriSectionHeader.stories.d.ts +8 -0
- package/dist/components/{ui → molecules}/MriSelectSearch.d.ts +4 -1
- package/dist/components/{ui → molecules}/MriSelectSearch.stories.d.ts +3 -0
- package/dist/components/{ui → molecules}/MriTimePicker.d.ts +3 -1
- package/dist/components/{ui → molecules}/MriTimePicker.stories.d.ts +2 -0
- package/dist/index.d.ts +28 -15
- package/dist/index.es.js +8239 -4453
- package/dist/index.umd.js +107 -62
- package/dist/style.css +1 -1
- package/package.json +3 -2
- package/dist/components/ui/MriInput.d.ts +0 -2
- package/dist/components/ui/index.d.ts +0 -22
- /package/dist/components/{ui → atoms}/MriBadge.d.ts +0 -0
- /package/dist/components/{ui → atoms}/MriBadge.stories.d.ts +0 -0
- /package/dist/components/{ui → atoms}/MriIcons.d.ts +0 -0
- /package/dist/components/{ui → atoms}/MriIcons.stories.d.ts +0 -0
- /package/dist/components/{ui → atoms}/MriScrollArea.d.ts +0 -0
- /package/dist/components/{ui → molecules}/MriButtonGroup.d.ts +0 -0
- /package/dist/components/{ui → molecules}/MriButtonGroup.stories.d.ts +0 -0
- /package/dist/components/{ui → molecules}/MriCard.d.ts +0 -0
- /package/dist/components/{ui → molecules}/MriCard.stories.d.ts +0 -0
- /package/dist/components/{ui → molecules}/MriCommand.stories.d.ts +0 -0
- /package/dist/components/{ui → molecules}/MriDialog.d.ts +0 -0
- /package/dist/components/{ui → molecules}/MriDialog.stories.d.ts +0 -0
- /package/dist/components/{ui → molecules}/MriModal.d.ts +0 -0
- /package/dist/components/{ui → molecules}/MriPopover.d.ts +0 -0
- /package/dist/components/{ui → molecules}/MriPopover.stories.d.ts +0 -0
- /package/dist/components/{ui → molecules}/MriThemeToggle.d.ts +0 -0
- /package/dist/components/{ui → molecules}/MriThemeToggle.stories.d.ts +0 -0
- /package/dist/components/{ui → organisms}/MriCalendar.d.ts +0 -0
- /package/dist/components/{ui → organisms}/MriPageHeader.d.ts +0 -0
- /package/dist/components/{ui → organisms}/MriPageHeader.stories.d.ts +0 -0
- /package/dist/components/{ui → organisms}/MriSidebar.d.ts +0 -0
- /package/dist/components/{ui → organisms}/MriSidebar.stories.d.ts +0 -0
- /package/dist/components/{ui → organisms}/MriTable.d.ts +0 -0
- /package/dist/components/{ui → organisms}/MriTable.stories.d.ts +0 -0
package/bin/cli.js
CHANGED
|
@@ -13,7 +13,43 @@ import path from 'path';
|
|
|
13
13
|
import https from 'https';
|
|
14
14
|
|
|
15
15
|
const program = new Command();
|
|
16
|
-
const
|
|
16
|
+
const BASE_PREFIX = 'https://raw.githubusercontent.com/mri-Qbox-Brasil/mri-ui-kit/main/src/components';
|
|
17
|
+
|
|
18
|
+
const COMPONENT_MAP = {
|
|
19
|
+
// Atoms
|
|
20
|
+
'MriBadge': 'atoms',
|
|
21
|
+
'MriButton': 'atoms',
|
|
22
|
+
'MriIcons': 'atoms',
|
|
23
|
+
'MriInput': 'atoms',
|
|
24
|
+
'MriScrollArea': 'atoms',
|
|
25
|
+
'MriStatusBadge': 'atoms',
|
|
26
|
+
'mri-badge-variants': 'atoms',
|
|
27
|
+
'mri-button-variants': 'atoms',
|
|
28
|
+
|
|
29
|
+
// Molecules
|
|
30
|
+
'MriButtonGroup': 'molecules',
|
|
31
|
+
'MriCard': 'molecules',
|
|
32
|
+
'MriCompactSearch': 'molecules',
|
|
33
|
+
'MriDialog': 'molecules',
|
|
34
|
+
'MriModal': 'molecules',
|
|
35
|
+
'MriPopover': 'molecules',
|
|
36
|
+
'MriSelectSearch': 'molecules',
|
|
37
|
+
'MriThemeToggle': 'molecules',
|
|
38
|
+
'MriTimePicker': 'molecules',
|
|
39
|
+
'MriCommand': 'molecules',
|
|
40
|
+
'MriCopyButton': 'molecules',
|
|
41
|
+
'MriEconomyCard': 'molecules',
|
|
42
|
+
'MriGridActionButton': 'molecules',
|
|
43
|
+
'MriSearchInput': 'molecules',
|
|
44
|
+
'MriSectionHeader': 'molecules',
|
|
45
|
+
'MriDatePicker': 'molecules',
|
|
46
|
+
|
|
47
|
+
// Organisms
|
|
48
|
+
'MriCalendar': 'organisms',
|
|
49
|
+
'MriPageHeader': 'organisms',
|
|
50
|
+
'MriSidebar': 'organisms',
|
|
51
|
+
'MriTable': 'organisms',
|
|
52
|
+
};
|
|
17
53
|
|
|
18
54
|
function toPascalCase(str) {
|
|
19
55
|
return str
|
|
@@ -25,21 +61,17 @@ function ensureDirectory(dir) {
|
|
|
25
61
|
}
|
|
26
62
|
}
|
|
27
63
|
|
|
28
|
-
function
|
|
64
|
+
function fetchFileContent(url) {
|
|
29
65
|
return new Promise((resolve, reject) => {
|
|
30
|
-
const file = fs.createWriteStream(dest);
|
|
31
66
|
https.get(url, (response) => {
|
|
32
67
|
if (response.statusCode === 200) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
68
|
+
let data = '';
|
|
69
|
+
response.on('data', (chunk) => data += chunk);
|
|
70
|
+
response.on('end', () => resolve(data));
|
|
37
71
|
} else {
|
|
38
|
-
fs.unlink(dest, () => { });
|
|
39
72
|
reject(new Error(`Failed to download: ${response.statusCode} ${response.statusMessage}`));
|
|
40
73
|
}
|
|
41
74
|
}).on('error', (err) => {
|
|
42
|
-
fs.unlink(dest, () => { });
|
|
43
75
|
reject(err);
|
|
44
76
|
});
|
|
45
77
|
});
|
|
@@ -48,8 +80,6 @@ function downloadFile(url, dest) {
|
|
|
48
80
|
const visited = new Set();
|
|
49
81
|
|
|
50
82
|
async function processComponent(componentName, installDir) {
|
|
51
|
-
let targetName = componentName;
|
|
52
|
-
|
|
53
83
|
let fileName = componentName;
|
|
54
84
|
let isVariant = componentName.includes('variants');
|
|
55
85
|
|
|
@@ -60,46 +90,58 @@ async function processComponent(componentName, installDir) {
|
|
|
60
90
|
if (!fileName.startsWith('Mri')) {
|
|
61
91
|
fileName = `Mri${fileName}`;
|
|
62
92
|
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Check map for directory
|
|
96
|
+
const componentKey = isVariant ? fileName.replace(/\.ts$/, '') : fileName.replace(/\.tsx$/, '');
|
|
97
|
+
const category = COMPONENT_MAP[componentKey];
|
|
98
|
+
|
|
99
|
+
if (!category) {
|
|
100
|
+
console.warn(chalk.yellow(`⚠️ Component ${fileName} not found in atomic map. Trying legacy path...`));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (!isVariant) {
|
|
63
104
|
if (!fileName.endsWith('.tsx')) fileName += '.tsx';
|
|
64
105
|
} else {
|
|
65
106
|
if (!fileName.endsWith('.ts')) fileName += '.ts';
|
|
66
107
|
}
|
|
108
|
+
|
|
67
109
|
if (visited.has(fileName)) return;
|
|
68
110
|
visited.add(fileName);
|
|
69
111
|
|
|
70
112
|
const destPath = path.join(installDir, fileName);
|
|
71
|
-
|
|
113
|
+
|
|
114
|
+
// Construct URL
|
|
115
|
+
const remoteDir = category || 'ui';
|
|
116
|
+
const fileUrl = `${BASE_PREFIX}/${remoteDir}/${fileName}`;
|
|
72
117
|
|
|
73
118
|
if (fs.existsSync(destPath)) {
|
|
74
119
|
console.log(chalk.gray(` ${fileName} already exists.`));
|
|
75
|
-
|
|
76
|
-
// Maybe the user has an outdated version.
|
|
77
|
-
// For detailed recursion, strictly we should read it.
|
|
78
|
-
// But let's assume if it exists, its deps are likely handled or user manages it.
|
|
79
|
-
// To be safe for "fresh" installs, let's scan it anyway if we can read it.
|
|
80
|
-
// But standard 'add' usually skips or prompts overwrite.
|
|
81
|
-
// Let's just skip download but continues to scan deps if we want to be thorough.
|
|
82
|
-
// For this "Simple CLI", let's stop at existence to avoid overwriting user changes.
|
|
83
|
-
// BUT we must check its imports to ensure children exist.
|
|
84
|
-
checkDependencies(destPath, installDir);
|
|
120
|
+
await checkDependencies(destPath, installDir);
|
|
85
121
|
return;
|
|
86
122
|
}
|
|
87
123
|
|
|
88
124
|
console.log(chalk.cyan(`⬇️ Downloading ${fileName}...`));
|
|
89
125
|
try {
|
|
90
|
-
await
|
|
126
|
+
let content = await fetchFileContent(fileUrl);
|
|
127
|
+
|
|
128
|
+
// Rewrite imports to be flat
|
|
129
|
+
// Replace @/components/(atoms|molecules|organisms)/ with @/components/ui/
|
|
130
|
+
content = content.replace(/@\/components\/(?:atoms|molecules|organisms)\//g, '@/components/ui/');
|
|
131
|
+
|
|
132
|
+
fs.writeFileSync(destPath, content);
|
|
133
|
+
|
|
91
134
|
console.log(chalk.green(`✅ ${fileName} added.`));
|
|
92
135
|
|
|
93
|
-
await
|
|
136
|
+
await checkDependenciesContent(content, installDir);
|
|
94
137
|
|
|
95
138
|
} catch (err) {
|
|
96
139
|
console.error(chalk.red(`❌ Error downloading ${fileName}: ${err.message}`));
|
|
97
140
|
}
|
|
98
141
|
}
|
|
99
142
|
|
|
100
|
-
async function
|
|
143
|
+
async function checkDependenciesContent(content, installDir) {
|
|
101
144
|
try {
|
|
102
|
-
const content = fs.readFileSync(filePath, 'utf8');
|
|
103
145
|
const importRegex = /from\s+['"](?:@\/components\/ui\/|\.\/)([^'"]+)['"]/g;
|
|
104
146
|
let match;
|
|
105
147
|
|
|
@@ -110,14 +152,19 @@ async function checkDependencies(filePath, installDir) {
|
|
|
110
152
|
}
|
|
111
153
|
}
|
|
112
154
|
} catch (e) {
|
|
113
|
-
console.warn(chalk.yellow(`Could not parse dependencies
|
|
155
|
+
console.warn(chalk.yellow(`Could not parse dependencies.`));
|
|
114
156
|
}
|
|
115
157
|
}
|
|
116
158
|
|
|
159
|
+
async function checkDependencies(filePath, installDir) {
|
|
160
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
161
|
+
await checkDependenciesContent(content, installDir);
|
|
162
|
+
}
|
|
163
|
+
|
|
117
164
|
program
|
|
118
165
|
.name('mri-ui')
|
|
119
166
|
.description('Add Mri UI components to your project')
|
|
120
|
-
.version('
|
|
167
|
+
.version('3.1.0');
|
|
121
168
|
|
|
122
169
|
program
|
|
123
170
|
.command('add <component>')
|
|
@@ -3,5 +3,6 @@ import { mriButtonVariants } from './mri-button-variants';
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
export interface MriButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof mriButtonVariants> {
|
|
5
5
|
asChild?: boolean;
|
|
6
|
+
isLoading?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const MriButton: React.ForwardRefExoticComponent<MriButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface MriInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
3
|
+
size?: 'default' | 'sm';
|
|
4
|
+
leftIcon?: React.ReactNode;
|
|
5
|
+
rightIcon?: React.ReactNode;
|
|
6
|
+
error?: boolean | string;
|
|
7
|
+
}
|
|
8
|
+
export declare const MriInput: React.ForwardRefExoticComponent<MriInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
|
-
import { MriInput } from './MriInput';
|
|
3
2
|
|
|
4
3
|
declare const meta: {
|
|
5
4
|
title: string;
|
|
6
|
-
component:
|
|
5
|
+
component: import('react').ForwardRefExoticComponent<import('./MriInput').MriInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
7
6
|
parameters: {
|
|
8
7
|
layout: string;
|
|
9
8
|
};
|
|
@@ -22,3 +21,6 @@ type Story = StoryObj<typeof meta>;
|
|
|
22
21
|
export declare const Default: Story;
|
|
23
22
|
export declare const Disabled: Story;
|
|
24
23
|
export declare const WithValue: Story;
|
|
24
|
+
export declare const Small: Story;
|
|
25
|
+
export declare const WithIcons: Story;
|
|
26
|
+
export declare const ErrorState: Story;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { MriSkeleton } from './MriSkeleton';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: typeof MriSkeleton;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
tags: string[];
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Default: Story;
|
|
15
|
+
export declare const Circle: Story;
|
|
16
|
+
export declare const CardDemo: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface MriStatusBadgeProps {
|
|
2
|
+
label: string | number;
|
|
3
|
+
variant?: 'default' | 'destructive' | 'warning' | 'success' | 'outline' | 'ghost';
|
|
4
|
+
className?: string;
|
|
5
|
+
size?: 'xs' | 'sm' | 'md';
|
|
6
|
+
}
|
|
7
|
+
export declare function MriStatusBadge({ label, variant, className, size }: MriStatusBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MriStatusBadge } from './MriStatusBadge';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof MriStatusBadge>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof MriStatusBadge>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const Success: Story;
|
|
9
|
+
export declare const Warning: Story;
|
|
10
|
+
export declare const Destructive: Story;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const mriBadgeVariants: (props?: ({
|
|
2
|
-
variant?: "default" | "
|
|
2
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
|
|
3
3
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const mriButtonVariants: (props?: ({
|
|
2
|
-
variant?: "default" | "
|
|
2
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "link" | "ghost" | null | undefined;
|
|
3
3
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
4
4
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -20,7 +20,7 @@ declare const MriCommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pi
|
|
|
20
20
|
ref?: React.Ref<HTMLInputElement>;
|
|
21
21
|
} & {
|
|
22
22
|
asChild?: boolean;
|
|
23
|
-
}, "asChild" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "
|
|
23
|
+
}, "asChild" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
24
24
|
value?: string;
|
|
25
25
|
onValueChange?: (search: string) => void;
|
|
26
26
|
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -46,7 +46,7 @@ declare const MriCommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
|
46
46
|
ref?: React.Ref<HTMLDivElement>;
|
|
47
47
|
} & {
|
|
48
48
|
asChild?: boolean;
|
|
49
|
-
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "
|
|
49
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
|
|
50
50
|
heading?: React.ReactNode;
|
|
51
51
|
value?: string;
|
|
52
52
|
forceMount?: boolean;
|
|
@@ -64,7 +64,7 @@ declare const MriCommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
|
64
64
|
ref?: React.Ref<HTMLDivElement>;
|
|
65
65
|
} & {
|
|
66
66
|
asChild?: boolean;
|
|
67
|
-
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "
|
|
67
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "onSelect" | "disabled" | "value"> & {
|
|
68
68
|
disabled?: boolean;
|
|
69
69
|
onSelect?: (value: string) => void;
|
|
70
70
|
value?: string;
|
|
@@ -11,6 +11,8 @@ interface MriCompactSearchProps {
|
|
|
11
11
|
emptyMessage?: string;
|
|
12
12
|
className?: string;
|
|
13
13
|
disabled?: boolean;
|
|
14
|
+
size?: "default" | "sm";
|
|
15
|
+
error?: boolean | string;
|
|
14
16
|
}
|
|
15
|
-
export declare function MriCompactSearch({ options, value, onChange, searchPlaceholder, emptyMessage, className, disabled }: MriCompactSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function MriCompactSearch({ options, value, onChange, searchPlaceholder, emptyMessage, className, disabled, size, error }: MriCompactSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
16
18
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface MriCopyButtonProps {
|
|
2
|
+
text: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
iconSize?: number;
|
|
5
|
+
variant?: 'ghost' | 'outline' | 'default' | 'secondary' | 'link';
|
|
6
|
+
}
|
|
7
|
+
export declare function MriCopyButton({ text, className, iconSize, variant }: MriCopyButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MriCopyButton } from './MriCopyButton';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof MriCopyButton>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof MriCopyButton>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const WithCustomSize: Story;
|
|
@@ -6,6 +6,8 @@ interface MriDatePickerProps {
|
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
locale?: Locale;
|
|
9
|
+
size?: "default" | "sm";
|
|
10
|
+
error?: boolean | string;
|
|
9
11
|
}
|
|
10
|
-
export declare function MriDatePicker({ value, onChange, placeholder, disabled, locale }: MriDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function MriDatePicker({ value, onChange, placeholder, disabled, locale, size, error }: MriDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
declare const MriDrawer: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const MriDrawerTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const MriDrawerPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const MriDrawerClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const MriDrawerOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const MriDrawerContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const MriDrawerHeader: {
|
|
10
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
declare const MriDrawerFooter: {
|
|
14
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
declare const MriDrawerTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
18
|
+
declare const MriDrawerDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
export { MriDrawer, MriDrawerPortal, MriDrawerOverlay, MriDrawerTrigger, MriDrawerClose, MriDrawerContent, MriDrawerHeader, MriDrawerFooter, MriDrawerTitle, MriDrawerDescription, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import('react').FC<import('@radix-ui/react-dialog').DialogProps>;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface MriEconomyCardProps {
|
|
2
|
+
label: string;
|
|
3
|
+
amount: number | string;
|
|
4
|
+
amountColorClass?: string;
|
|
5
|
+
onAdd?: () => void;
|
|
6
|
+
onRemove?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function MriEconomyCard({ label, amount, amountColorClass, onAdd, onRemove }: MriEconomyCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MriEconomyCard } from './MriEconomyCard';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof MriEconomyCard>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof MriEconomyCard>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const Negative: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
export interface MriGridActionButtonProps {
|
|
4
|
+
icon: LucideIcon;
|
|
5
|
+
label: string;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
variant?: 'default' | 'destructive' | 'warning';
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function MriGridActionButton({ icon: Icon, label, onClick, variant, disabled, className }: MriGridActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MriGridActionButton } from './MriGridActionButton';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof MriGridActionButton>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof MriGridActionButton>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const Destructive: Story;
|
|
9
|
+
export declare const Warning: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface MriSearchInputProps {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
width?: string;
|
|
7
|
+
size?: "default" | "sm";
|
|
8
|
+
error?: boolean | string;
|
|
9
|
+
}
|
|
10
|
+
export declare function MriSearchInput({ value, onChange, placeholder, className, width, size, error }: MriSearchInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MriSearchInput } from './MriSearchInput';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof MriSearchInput>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof MriSearchInput>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const CustomWidth: Story;
|
|
9
|
+
export declare const Small: Story;
|
|
10
|
+
export declare const ErrorState: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
export interface MriSectionHeaderProps {
|
|
4
|
+
icon: LucideIcon;
|
|
5
|
+
title: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function MriSectionHeader({ icon: Icon, title, className }: MriSectionHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MriSectionHeader } from './MriSectionHeader';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof MriSectionHeader>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof MriSectionHeader>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const CustomColor: Story;
|
|
@@ -11,6 +11,9 @@ interface MriSelectSearchProps {
|
|
|
11
11
|
emptyMessage?: string;
|
|
12
12
|
className?: string;
|
|
13
13
|
disabled?: boolean;
|
|
14
|
+
size?: "default" | "sm";
|
|
15
|
+
isLoading?: boolean;
|
|
16
|
+
error?: boolean | string;
|
|
14
17
|
}
|
|
15
|
-
export declare function MriSelectSearch({ options, value, onChange, placeholder, searchPlaceholder, emptyMessage, className, disabled }: MriSelectSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function MriSelectSearch({ options, value, onChange, placeholder, searchPlaceholder, emptyMessage, className, disabled, size, isLoading, error }: MriSelectSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
16
19
|
export {};
|
|
@@ -4,3 +4,6 @@ import { MriSelectSearch } from './MriSelectSearch';
|
|
|
4
4
|
declare const meta: Meta<typeof MriSelectSearch>;
|
|
5
5
|
export default meta;
|
|
6
6
|
export declare const Default: StoryObj<typeof MriSelectSearch>;
|
|
7
|
+
export declare const Loading: StoryObj<typeof MriSelectSearch>;
|
|
8
|
+
export declare const ErrorState: StoryObj<typeof MriSelectSearch>;
|
|
9
|
+
export declare const Small: StoryObj<typeof MriSelectSearch>;
|
|
@@ -4,6 +4,8 @@ interface MriTimePickerProps {
|
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
hourLabel?: string;
|
|
6
6
|
minuteLabel?: string;
|
|
7
|
+
size?: "default" | "sm";
|
|
8
|
+
error?: boolean | string;
|
|
7
9
|
}
|
|
8
|
-
export declare function MriTimePicker({ value, onChange, disabled, hourLabel, minuteLabel }: MriTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function MriTimePicker({ value, onChange, disabled, hourLabel, minuteLabel, size, error }: MriTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
|
|
2
|
-
export * from './components/
|
|
3
|
-
export * from './components/
|
|
4
|
-
export * from './components/
|
|
5
|
-
export * from './components/
|
|
6
|
-
export * from './components/
|
|
7
|
-
export * from './components/
|
|
8
|
-
export * from './components/
|
|
9
|
-
export * from './components/
|
|
10
|
-
export * from './components/
|
|
11
|
-
export * from './components/
|
|
12
|
-
export * from './components/
|
|
13
|
-
export * from './components/
|
|
2
|
+
export * from './components/atoms/MriBadge';
|
|
3
|
+
export * from './components/atoms/MriButton';
|
|
4
|
+
export * from './components/atoms/MriIcons';
|
|
5
|
+
export * from './components/atoms/MriInput';
|
|
6
|
+
export * from './components/atoms/MriScrollArea';
|
|
7
|
+
export * from './components/atoms/MriStatusBadge';
|
|
8
|
+
export * from './components/atoms/mri-badge-variants';
|
|
9
|
+
export * from './components/atoms/mri-button-variants';
|
|
10
|
+
export * from './components/molecules/MriButtonGroup';
|
|
11
|
+
export * from './components/molecules/MriCard';
|
|
12
|
+
export * from './components/molecules/MriCompactSearch';
|
|
13
|
+
export * from './components/molecules/MriDialog';
|
|
14
|
+
export * from './components/molecules/MriModal';
|
|
15
|
+
export * from './components/molecules/MriPopover';
|
|
16
|
+
export * from './components/molecules/MriSelectSearch';
|
|
17
|
+
export * from './components/molecules/MriThemeToggle';
|
|
18
|
+
export * from './components/molecules/MriTimePicker';
|
|
19
|
+
export * from './components/molecules/MriCommand';
|
|
20
|
+
export * from './components/molecules/MriCopyButton';
|
|
21
|
+
export * from './components/molecules/MriEconomyCard';
|
|
22
|
+
export * from './components/molecules/MriGridActionButton';
|
|
23
|
+
export * from './components/molecules/MriSearchInput';
|
|
24
|
+
export * from './components/molecules/MriSectionHeader';
|
|
25
|
+
export * from './components/molecules/MriDatePicker';
|
|
26
|
+
export * from './components/organisms/MriCalendar';
|
|
27
|
+
export * from './components/organisms/MriPageHeader';
|
|
28
|
+
export * from './components/organisms/MriSidebar';
|
|
29
|
+
export * from './components/organisms/MriTable';
|
|
14
30
|
export * from './lib/utils';
|
|
15
|
-
export * from './components/ui/MriSidebar';
|
|
16
|
-
export * from './components/ui/mri-button-variants';
|
|
17
|
-
export * from './components/ui/mri-badge-variants';
|