@zimyo/ui 1.1.2 → 1.1.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/package.json +6 -3
- package/dist/Accordion/index.d.ts +0 -34
- package/dist/Accordion/index.esm.js +0 -125
- package/dist/Accordion/index.js +0 -133
- package/dist/Button/index.d.ts +0 -15
- package/dist/Button/index.esm.js +0 -23
- package/dist/Button/index.js +0 -28
- package/dist/Card/index.d.ts +0 -41
- package/dist/Card/index.esm.js +0 -36
- package/dist/Card/index.js +0 -38
- package/dist/Popover/index.d.ts +0 -19
- package/dist/Popover/index.esm.js +0 -22
- package/dist/Popover/index.js +0 -27
- package/dist/RadioGroup/index.d.ts +0 -31
- package/dist/RadioGroup/index.esm.js +0 -92
- package/dist/RadioGroup/index.js +0 -97
- package/dist/Select/index.d.ts +0 -22
- package/dist/Select/index.esm.js +0 -63
- package/dist/Select/index.js +0 -68
- package/dist/Switch/index.d.ts +0 -14
- package/dist/Switch/index.esm.js +0 -9
- package/dist/Switch/index.js +0 -11
- package/dist/Tabs/index.d.ts +0 -36
- package/dist/Tabs/index.esm.js +0 -202
- package/dist/Tabs/index.js +0 -207
- package/dist/TextInput/index.d.ts +0 -18
- package/dist/TextInput/index.esm.js +0 -34
- package/dist/TextInput/index.js +0 -36
- package/dist/Typography/index.d.ts +0 -30
- package/dist/Typography/index.esm.js +0 -57
- package/dist/Typography/index.js +0 -66
- package/dist/index.d.ts +0 -185
- package/dist/index.esm.js +0 -253
- package/dist/index.js +0 -261
- package/dist/theme/index.d.ts +0 -91
- package/dist/theme/index.esm.js +0 -137
- package/dist/theme/index.js +0 -142
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zimyo/ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Zimyo UI library built on MUI Material",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"@emotion/react": ">=11.0.0",
|
|
84
84
|
"@emotion/styled": ">=11.0.0",
|
|
85
|
-
"@mui/icons-material": "
|
|
85
|
+
"@mui/icons-material": ">=5.0.0",
|
|
86
86
|
"@mui/material": ">=5.0.0",
|
|
87
87
|
"react": ">=17.0.0",
|
|
88
88
|
"react-dom": ">=17.0.0"
|
|
@@ -92,6 +92,8 @@
|
|
|
92
92
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
93
93
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
94
94
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
95
|
+
"@storybook/addon-docs": "^9.0.15",
|
|
96
|
+
"@storybook/addon-themes": "^9.0.15",
|
|
95
97
|
"@storybook/addon-webpack5-compiler-swc": "^3.0.0",
|
|
96
98
|
"@storybook/react-webpack5": "^9.0.14",
|
|
97
99
|
"@testing-library/jest-dom": "^6.6.3",
|
|
@@ -114,7 +116,8 @@
|
|
|
114
116
|
"dependencies": {
|
|
115
117
|
"@emotion/react": ">=11.0.0",
|
|
116
118
|
"@emotion/styled": ">=11.0.0",
|
|
117
|
-
"@
|
|
119
|
+
"@fontsource/inter": "^5.2.6",
|
|
120
|
+
"@mui/icons-material": ">=5.0.0",
|
|
118
121
|
"@mui/material": ">=5.0.0"
|
|
119
122
|
},
|
|
120
123
|
"eslintConfig": {
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AccordionProps as AccordionProps$1, AccordionSummaryProps, AccordionDetailsProps } from '@mui/material';
|
|
3
|
-
import { SxProps } from '@mui/system';
|
|
4
|
-
|
|
5
|
-
interface AccordionProps extends Omit<AccordionProps$1, 'sx' | 'onChange' | 'expanded'> {
|
|
6
|
-
type?: 'single' | 'multiple';
|
|
7
|
-
collapsible?: boolean;
|
|
8
|
-
value?: string | string[];
|
|
9
|
-
defaultValue?: string | string[];
|
|
10
|
-
onValueChange?: (value: string | string[]) => void;
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
sx?: SxProps;
|
|
13
|
-
}
|
|
14
|
-
interface AccordionItemProps extends Omit<AccordionProps$1, 'sx'> {
|
|
15
|
-
value: string;
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
sx?: SxProps;
|
|
18
|
-
}
|
|
19
|
-
interface AccordionTriggerProps extends Omit<AccordionSummaryProps, 'sx'> {
|
|
20
|
-
children: React.ReactNode;
|
|
21
|
-
sx?: SxProps;
|
|
22
|
-
expandIcon?: React.ReactNode;
|
|
23
|
-
}
|
|
24
|
-
interface AccordionContentProps extends Omit<AccordionDetailsProps, 'sx'> {
|
|
25
|
-
children: React.ReactNode;
|
|
26
|
-
sx?: SxProps;
|
|
27
|
-
}
|
|
28
|
-
declare const Accordion: React.ForwardRefExoticComponent<Omit<AccordionProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
-
declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
-
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionTriggerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
-
declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
-
|
|
33
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Accordion as default };
|
|
34
|
-
export type { AccordionContentProps, AccordionItemProps, AccordionProps, AccordionTriggerProps };
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useTheme, Accordion as Accordion$1, AccordionSummary, AccordionDetails } from '@mui/material';
|
|
4
|
-
import { ExpandMore } from '@mui/icons-material';
|
|
5
|
-
|
|
6
|
-
const AccordionContext = React.createContext({});
|
|
7
|
-
// Main Accordion Container Component
|
|
8
|
-
const Accordion = React.forwardRef(({ type = 'single', collapsible = false, value: controlledValue, defaultValue, onValueChange, children, sx = {}, ...props }, ref) => {
|
|
9
|
-
const theme = useTheme();
|
|
10
|
-
// Internal state management
|
|
11
|
-
const [internalValue, setInternalValue] = React.useState(() => {
|
|
12
|
-
if (controlledValue !== undefined)
|
|
13
|
-
return controlledValue;
|
|
14
|
-
if (defaultValue !== undefined)
|
|
15
|
-
return defaultValue;
|
|
16
|
-
return type === 'multiple' ? [] : '';
|
|
17
|
-
});
|
|
18
|
-
const value = controlledValue !== undefined ? controlledValue : internalValue;
|
|
19
|
-
const handleValueChange = React.useCallback((newValue) => {
|
|
20
|
-
if (controlledValue === undefined) {
|
|
21
|
-
setInternalValue(newValue);
|
|
22
|
-
}
|
|
23
|
-
onValueChange?.(newValue);
|
|
24
|
-
}, [controlledValue, onValueChange]);
|
|
25
|
-
const contextValue = React.useMemo(() => ({
|
|
26
|
-
type,
|
|
27
|
-
collapsible,
|
|
28
|
-
value,
|
|
29
|
-
defaultValue,
|
|
30
|
-
onValueChange: handleValueChange,
|
|
31
|
-
}), [type, collapsible, value, defaultValue, handleValueChange]);
|
|
32
|
-
return (jsx(AccordionContext.Provider, { value: contextValue, children: jsx("div", { ref: ref, style: {
|
|
33
|
-
display: 'flex',
|
|
34
|
-
flexDirection: 'column',
|
|
35
|
-
gap: theme.spacing(1),
|
|
36
|
-
}, ...props, children: children }) }));
|
|
37
|
-
});
|
|
38
|
-
// AccordionItem Component
|
|
39
|
-
const AccordionItem = React.forwardRef(({ value: itemValue, children, sx = {}, ...props }, ref) => {
|
|
40
|
-
const theme = useTheme();
|
|
41
|
-
const context = React.useContext(AccordionContext);
|
|
42
|
-
const isExpanded = React.useMemo(() => {
|
|
43
|
-
if (context.type === 'multiple') {
|
|
44
|
-
return Array.isArray(context.value) && context.value.includes(itemValue);
|
|
45
|
-
}
|
|
46
|
-
return context.value === itemValue;
|
|
47
|
-
}, [context.value, context.type, itemValue]);
|
|
48
|
-
const handleChange = React.useCallback(() => {
|
|
49
|
-
if (!context.onValueChange)
|
|
50
|
-
return;
|
|
51
|
-
if (context.type === 'multiple') {
|
|
52
|
-
const currentValue = Array.isArray(context.value) ? context.value : [];
|
|
53
|
-
const newValue = isExpanded
|
|
54
|
-
? currentValue.filter(v => v !== itemValue)
|
|
55
|
-
: [...currentValue, itemValue];
|
|
56
|
-
context.onValueChange(newValue);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
const newValue = isExpanded && context.collapsible ? '' : itemValue;
|
|
60
|
-
context.onValueChange(newValue);
|
|
61
|
-
}
|
|
62
|
-
}, [context, itemValue, isExpanded]);
|
|
63
|
-
return (jsx(Accordion$1, { ref: ref, expanded: isExpanded, onChange: handleChange, variant: "outlined", sx: {
|
|
64
|
-
borderRadius: theme.radius?.sm || theme.shape.borderRadius,
|
|
65
|
-
'&:before': {
|
|
66
|
-
display: 'none',
|
|
67
|
-
},
|
|
68
|
-
'&.Mui-expanded': {
|
|
69
|
-
margin: 0,
|
|
70
|
-
},
|
|
71
|
-
border: `1px solid ${theme.palette.divider}`,
|
|
72
|
-
...sx,
|
|
73
|
-
}, ...props, children: children }));
|
|
74
|
-
});
|
|
75
|
-
// AccordionTrigger Component
|
|
76
|
-
const AccordionTrigger = React.forwardRef(({ children, sx = {}, expandIcon, ...props }, ref) => {
|
|
77
|
-
const theme = useTheme();
|
|
78
|
-
const defaultExpandIcon = expandIcon !== undefined ? expandIcon : jsx(ExpandMore, {});
|
|
79
|
-
return (jsx(AccordionSummary, { ref: ref, expandIcon: defaultExpandIcon, sx: {
|
|
80
|
-
borderRadius: theme.radius?.sm || theme.shape.borderRadius,
|
|
81
|
-
minHeight: 56,
|
|
82
|
-
fontWeight: 500,
|
|
83
|
-
'&.Mui-expanded': {
|
|
84
|
-
minHeight: 56,
|
|
85
|
-
borderBottomLeftRadius: 0,
|
|
86
|
-
borderBottomRightRadius: 0,
|
|
87
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
88
|
-
},
|
|
89
|
-
'& .MuiAccordionSummary-content': {
|
|
90
|
-
margin: '12px 0',
|
|
91
|
-
'&.Mui-expanded': {
|
|
92
|
-
margin: '12px 0',
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
'& .MuiAccordionSummary-expandIconWrapper': {
|
|
96
|
-
transition: theme.transitions.create('transform', {
|
|
97
|
-
duration: theme.transitions.duration.shortest,
|
|
98
|
-
}),
|
|
99
|
-
'&.Mui-expanded': {
|
|
100
|
-
transform: 'rotate(180deg)',
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
'&:hover': {
|
|
104
|
-
backgroundColor: theme.palette.action.hover,
|
|
105
|
-
},
|
|
106
|
-
...sx,
|
|
107
|
-
}, ...props, children: children }));
|
|
108
|
-
});
|
|
109
|
-
// AccordionContent Component
|
|
110
|
-
const AccordionContent = React.forwardRef(({ children, sx = {}, ...props }, ref) => {
|
|
111
|
-
const theme = useTheme();
|
|
112
|
-
return (jsx(AccordionDetails, { ref: ref, sx: {
|
|
113
|
-
padding: theme.spacing(2),
|
|
114
|
-
borderBottomLeftRadius: theme.radius?.sm || theme.shape.borderRadius,
|
|
115
|
-
borderBottomRightRadius: theme.radius?.sm || theme.shape.borderRadius,
|
|
116
|
-
...sx,
|
|
117
|
-
}, ...props, children: children }));
|
|
118
|
-
});
|
|
119
|
-
// Set display names
|
|
120
|
-
Accordion.displayName = 'Accordion';
|
|
121
|
-
AccordionItem.displayName = 'AccordionItem';
|
|
122
|
-
AccordionTrigger.displayName = 'AccordionTrigger';
|
|
123
|
-
AccordionContent.displayName = 'AccordionContent';
|
|
124
|
-
|
|
125
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Accordion as default };
|
package/dist/Accordion/index.js
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var material = require('@mui/material');
|
|
8
|
-
var iconsMaterial = require('@mui/icons-material');
|
|
9
|
-
|
|
10
|
-
const AccordionContext = React.createContext({});
|
|
11
|
-
// Main Accordion Container Component
|
|
12
|
-
const Accordion = React.forwardRef(({ type = 'single', collapsible = false, value: controlledValue, defaultValue, onValueChange, children, sx = {}, ...props }, ref) => {
|
|
13
|
-
const theme = material.useTheme();
|
|
14
|
-
// Internal state management
|
|
15
|
-
const [internalValue, setInternalValue] = React.useState(() => {
|
|
16
|
-
if (controlledValue !== undefined)
|
|
17
|
-
return controlledValue;
|
|
18
|
-
if (defaultValue !== undefined)
|
|
19
|
-
return defaultValue;
|
|
20
|
-
return type === 'multiple' ? [] : '';
|
|
21
|
-
});
|
|
22
|
-
const value = controlledValue !== undefined ? controlledValue : internalValue;
|
|
23
|
-
const handleValueChange = React.useCallback((newValue) => {
|
|
24
|
-
if (controlledValue === undefined) {
|
|
25
|
-
setInternalValue(newValue);
|
|
26
|
-
}
|
|
27
|
-
onValueChange?.(newValue);
|
|
28
|
-
}, [controlledValue, onValueChange]);
|
|
29
|
-
const contextValue = React.useMemo(() => ({
|
|
30
|
-
type,
|
|
31
|
-
collapsible,
|
|
32
|
-
value,
|
|
33
|
-
defaultValue,
|
|
34
|
-
onValueChange: handleValueChange,
|
|
35
|
-
}), [type, collapsible, value, defaultValue, handleValueChange]);
|
|
36
|
-
return (jsxRuntime.jsx(AccordionContext.Provider, { value: contextValue, children: jsxRuntime.jsx("div", { ref: ref, style: {
|
|
37
|
-
display: 'flex',
|
|
38
|
-
flexDirection: 'column',
|
|
39
|
-
gap: theme.spacing(1),
|
|
40
|
-
}, ...props, children: children }) }));
|
|
41
|
-
});
|
|
42
|
-
// AccordionItem Component
|
|
43
|
-
const AccordionItem = React.forwardRef(({ value: itemValue, children, sx = {}, ...props }, ref) => {
|
|
44
|
-
const theme = material.useTheme();
|
|
45
|
-
const context = React.useContext(AccordionContext);
|
|
46
|
-
const isExpanded = React.useMemo(() => {
|
|
47
|
-
if (context.type === 'multiple') {
|
|
48
|
-
return Array.isArray(context.value) && context.value.includes(itemValue);
|
|
49
|
-
}
|
|
50
|
-
return context.value === itemValue;
|
|
51
|
-
}, [context.value, context.type, itemValue]);
|
|
52
|
-
const handleChange = React.useCallback(() => {
|
|
53
|
-
if (!context.onValueChange)
|
|
54
|
-
return;
|
|
55
|
-
if (context.type === 'multiple') {
|
|
56
|
-
const currentValue = Array.isArray(context.value) ? context.value : [];
|
|
57
|
-
const newValue = isExpanded
|
|
58
|
-
? currentValue.filter(v => v !== itemValue)
|
|
59
|
-
: [...currentValue, itemValue];
|
|
60
|
-
context.onValueChange(newValue);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
const newValue = isExpanded && context.collapsible ? '' : itemValue;
|
|
64
|
-
context.onValueChange(newValue);
|
|
65
|
-
}
|
|
66
|
-
}, [context, itemValue, isExpanded]);
|
|
67
|
-
return (jsxRuntime.jsx(material.Accordion, { ref: ref, expanded: isExpanded, onChange: handleChange, variant: "outlined", sx: {
|
|
68
|
-
borderRadius: theme.radius?.sm || theme.shape.borderRadius,
|
|
69
|
-
'&:before': {
|
|
70
|
-
display: 'none',
|
|
71
|
-
},
|
|
72
|
-
'&.Mui-expanded': {
|
|
73
|
-
margin: 0,
|
|
74
|
-
},
|
|
75
|
-
border: `1px solid ${theme.palette.divider}`,
|
|
76
|
-
...sx,
|
|
77
|
-
}, ...props, children: children }));
|
|
78
|
-
});
|
|
79
|
-
// AccordionTrigger Component
|
|
80
|
-
const AccordionTrigger = React.forwardRef(({ children, sx = {}, expandIcon, ...props }, ref) => {
|
|
81
|
-
const theme = material.useTheme();
|
|
82
|
-
const defaultExpandIcon = expandIcon !== undefined ? expandIcon : jsxRuntime.jsx(iconsMaterial.ExpandMore, {});
|
|
83
|
-
return (jsxRuntime.jsx(material.AccordionSummary, { ref: ref, expandIcon: defaultExpandIcon, sx: {
|
|
84
|
-
borderRadius: theme.radius?.sm || theme.shape.borderRadius,
|
|
85
|
-
minHeight: 56,
|
|
86
|
-
fontWeight: 500,
|
|
87
|
-
'&.Mui-expanded': {
|
|
88
|
-
minHeight: 56,
|
|
89
|
-
borderBottomLeftRadius: 0,
|
|
90
|
-
borderBottomRightRadius: 0,
|
|
91
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
92
|
-
},
|
|
93
|
-
'& .MuiAccordionSummary-content': {
|
|
94
|
-
margin: '12px 0',
|
|
95
|
-
'&.Mui-expanded': {
|
|
96
|
-
margin: '12px 0',
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
'& .MuiAccordionSummary-expandIconWrapper': {
|
|
100
|
-
transition: theme.transitions.create('transform', {
|
|
101
|
-
duration: theme.transitions.duration.shortest,
|
|
102
|
-
}),
|
|
103
|
-
'&.Mui-expanded': {
|
|
104
|
-
transform: 'rotate(180deg)',
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
'&:hover': {
|
|
108
|
-
backgroundColor: theme.palette.action.hover,
|
|
109
|
-
},
|
|
110
|
-
...sx,
|
|
111
|
-
}, ...props, children: children }));
|
|
112
|
-
});
|
|
113
|
-
// AccordionContent Component
|
|
114
|
-
const AccordionContent = React.forwardRef(({ children, sx = {}, ...props }, ref) => {
|
|
115
|
-
const theme = material.useTheme();
|
|
116
|
-
return (jsxRuntime.jsx(material.AccordionDetails, { ref: ref, sx: {
|
|
117
|
-
padding: theme.spacing(2),
|
|
118
|
-
borderBottomLeftRadius: theme.radius?.sm || theme.shape.borderRadius,
|
|
119
|
-
borderBottomRightRadius: theme.radius?.sm || theme.shape.borderRadius,
|
|
120
|
-
...sx,
|
|
121
|
-
}, ...props, children: children }));
|
|
122
|
-
});
|
|
123
|
-
// Set display names
|
|
124
|
-
Accordion.displayName = 'Accordion';
|
|
125
|
-
AccordionItem.displayName = 'AccordionItem';
|
|
126
|
-
AccordionTrigger.displayName = 'AccordionTrigger';
|
|
127
|
-
AccordionContent.displayName = 'AccordionContent';
|
|
128
|
-
|
|
129
|
-
exports.Accordion = Accordion;
|
|
130
|
-
exports.AccordionContent = AccordionContent;
|
|
131
|
-
exports.AccordionItem = AccordionItem;
|
|
132
|
-
exports.AccordionTrigger = AccordionTrigger;
|
|
133
|
-
exports.default = Accordion;
|
package/dist/Button/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ButtonProps as ButtonProps$1 } from '@mui/material';
|
|
3
|
-
import { SxProps } from '@mui/system';
|
|
4
|
-
|
|
5
|
-
interface ButtonProps extends Omit<ButtonProps$1, 'sx'> {
|
|
6
|
-
loading?: boolean;
|
|
7
|
-
loadingText?: string;
|
|
8
|
-
sx?: SxProps;
|
|
9
|
-
loaderSize?: number;
|
|
10
|
-
loaderPosition?: 'start' | 'end' | 'center';
|
|
11
|
-
}
|
|
12
|
-
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
-
|
|
14
|
-
export { Button, Button as default };
|
|
15
|
-
export type { ButtonProps };
|
package/dist/Button/index.esm.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useTheme, Button as Button$1, CircularProgress } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
const Button = React.forwardRef(({ children, loading = false, loadingText, loaderSize = 18, loaderPosition = 'start', variant = 'contained', color = 'primary', size = 'medium', sx = {}, disabled, startIcon, endIcon, ...props }, ref) => {
|
|
6
|
-
const theme = useTheme();
|
|
7
|
-
const showStartSpinner = loading && loaderPosition === 'start';
|
|
8
|
-
const showEndSpinner = loading && loaderPosition === 'end';
|
|
9
|
-
const showCenterSpinner = loading && loaderPosition === 'center';
|
|
10
|
-
return (jsx(Button$1, { ref: ref, variant: variant, color: color, size: size, disabled: disabled || loading, startIcon: showStartSpinner ? (jsx(CircularProgress, { size: loaderSize, color: "inherit" })) : (startIcon), endIcon: showEndSpinner ? (jsx(CircularProgress, { size: loaderSize, color: "inherit" })) : (endIcon), sx: {
|
|
11
|
-
borderRadius: theme.radius.sm,
|
|
12
|
-
fontWeight: 500,
|
|
13
|
-
textTransform: 'none',
|
|
14
|
-
letterSpacing: '0.5px',
|
|
15
|
-
px: size === 'small' ? 1.5 : size === 'large' ? 3 : 2,
|
|
16
|
-
py: size === 'small' ? 0.5 : size === 'large' ? 1.5 : 1,
|
|
17
|
-
position: 'relative',
|
|
18
|
-
...sx,
|
|
19
|
-
}, ...props, children: showCenterSpinner ? (jsx(CircularProgress, { size: loaderSize, color: "inherit" })) : loading && loadingText ? (loadingText) : (children) }));
|
|
20
|
-
});
|
|
21
|
-
Button.displayName = 'Button';
|
|
22
|
-
|
|
23
|
-
export { Button, Button as default };
|
package/dist/Button/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var material = require('@mui/material');
|
|
8
|
-
|
|
9
|
-
const Button = React.forwardRef(({ children, loading = false, loadingText, loaderSize = 18, loaderPosition = 'start', variant = 'contained', color = 'primary', size = 'medium', sx = {}, disabled, startIcon, endIcon, ...props }, ref) => {
|
|
10
|
-
const theme = material.useTheme();
|
|
11
|
-
const showStartSpinner = loading && loaderPosition === 'start';
|
|
12
|
-
const showEndSpinner = loading && loaderPosition === 'end';
|
|
13
|
-
const showCenterSpinner = loading && loaderPosition === 'center';
|
|
14
|
-
return (jsxRuntime.jsx(material.Button, { ref: ref, variant: variant, color: color, size: size, disabled: disabled || loading, startIcon: showStartSpinner ? (jsxRuntime.jsx(material.CircularProgress, { size: loaderSize, color: "inherit" })) : (startIcon), endIcon: showEndSpinner ? (jsxRuntime.jsx(material.CircularProgress, { size: loaderSize, color: "inherit" })) : (endIcon), sx: {
|
|
15
|
-
borderRadius: theme.radius.sm,
|
|
16
|
-
fontWeight: 500,
|
|
17
|
-
textTransform: 'none',
|
|
18
|
-
letterSpacing: '0.5px',
|
|
19
|
-
px: size === 'small' ? 1.5 : size === 'large' ? 3 : 2,
|
|
20
|
-
py: size === 'small' ? 0.5 : size === 'large' ? 1.5 : 1,
|
|
21
|
-
position: 'relative',
|
|
22
|
-
...sx,
|
|
23
|
-
}, ...props, children: showCenterSpinner ? (jsxRuntime.jsx(material.CircularProgress, { size: loaderSize, color: "inherit" })) : loading && loadingText ? (loadingText) : (children) }));
|
|
24
|
-
});
|
|
25
|
-
Button.displayName = 'Button';
|
|
26
|
-
|
|
27
|
-
exports.Button = Button;
|
|
28
|
-
exports.default = Button;
|
package/dist/Card/index.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React$1 from 'react';
|
|
3
|
-
import React__default from 'react';
|
|
4
|
-
import { CardProps } from '@mui/material';
|
|
5
|
-
import { SxProps } from '@mui/system';
|
|
6
|
-
|
|
7
|
-
interface CardRootProps extends CardProps {
|
|
8
|
-
sx?: SxProps;
|
|
9
|
-
variant?: 'elevated' | 'outlined' | 'bordered';
|
|
10
|
-
children: React__default.ReactNode;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
declare const Card: React$1.FC<CardRootProps> & {
|
|
14
|
-
Header: ({ title, subtitle, action, }: {
|
|
15
|
-
title?: string | React.ReactNode;
|
|
16
|
-
subtitle?: string | React.ReactNode;
|
|
17
|
-
action?: React.ReactNode;
|
|
18
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
19
|
-
Content: ({ children, sx }: {
|
|
20
|
-
children: React.ReactNode;
|
|
21
|
-
sx?: any;
|
|
22
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
23
|
-
Body: ({ children, sx }: {
|
|
24
|
-
children: React.ReactNode;
|
|
25
|
-
sx?: any;
|
|
26
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
27
|
-
Actions: ({ children, sx }: {
|
|
28
|
-
children: React.ReactNode;
|
|
29
|
-
sx?: any;
|
|
30
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
31
|
-
Image: ({ src, height, alt }: {
|
|
32
|
-
src: string;
|
|
33
|
-
height?: number | string;
|
|
34
|
-
alt?: string;
|
|
35
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
36
|
-
Skeleton: ({ lines }: {
|
|
37
|
-
lines?: number;
|
|
38
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export { Card as default };
|
package/dist/Card/index.esm.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useTheme, Card as Card$1, CardHeader as CardHeader$1, Typography, CardActions as CardActions$1, Box, Skeleton } from '@mui/material';
|
|
3
|
-
import MuiCardContent from '@mui/material/CardContent';
|
|
4
|
-
import CardMedia from '@mui/material/CardMedia';
|
|
5
|
-
|
|
6
|
-
const CardRoot = ({ children, sx = {}, elevation = 1, variant = 'elevated', ...props }) => {
|
|
7
|
-
const theme = useTheme();
|
|
8
|
-
return (jsx(Card$1, { elevation: variant === 'elevated' ? elevation : 0, variant: variant === 'outlined' ? 'outlined' : 'elevation', sx: {
|
|
9
|
-
borderRadius: theme.radius?.sm || 8,
|
|
10
|
-
border: variant === 'bordered' ? `1px solid ${theme.palette.divider}` : 'none',
|
|
11
|
-
overflow: 'hidden',
|
|
12
|
-
backgroundColor: theme.palette.background.paper,
|
|
13
|
-
...sx,
|
|
14
|
-
}, ...props, children: children }));
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const CardHeader = ({ title, subtitle, action, }) => (jsx(CardHeader$1, { title: typeof title === 'string' ? (jsx(Typography, { variant: "h6", fontWeight: 600, children: title })) : (title), subheader: typeof subtitle === 'string' ? (jsx(Typography, { variant: "body2", color: "text.secondary", children: subtitle })) : (subtitle), action: action }));
|
|
18
|
-
|
|
19
|
-
const CardContent = ({ children, sx }) => (jsx(MuiCardContent, { sx: sx, children: children }));
|
|
20
|
-
|
|
21
|
-
const CardActions = ({ children, sx }) => (jsx(CardActions$1, { sx: sx, children: children }));
|
|
22
|
-
|
|
23
|
-
const CardImage = ({ src, height = 160, alt = 'card image' }) => (jsx(CardMedia, { component: "img", height: height, image: src, alt: alt }));
|
|
24
|
-
|
|
25
|
-
const CardSkeleton = ({ lines = 3 }) => (jsxs(Box, { p: 2, children: [jsx(Skeleton, { variant: "rectangular", height: 140 }), [...Array(lines)].map((_, i) => (jsx(Skeleton, { variant: "text", height: 20, sx: { mt: 1 } }, i)))] }));
|
|
26
|
-
|
|
27
|
-
const Card = Object.assign(CardRoot, {
|
|
28
|
-
Header: CardHeader,
|
|
29
|
-
Content: CardContent,
|
|
30
|
-
Body: CardContent, // alias
|
|
31
|
-
Actions: CardActions,
|
|
32
|
-
Image: CardImage,
|
|
33
|
-
Skeleton: CardSkeleton,
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export { Card as default };
|
package/dist/Card/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var material = require('@mui/material');
|
|
5
|
-
var MuiCardContent = require('@mui/material/CardContent');
|
|
6
|
-
var CardMedia = require('@mui/material/CardMedia');
|
|
7
|
-
|
|
8
|
-
const CardRoot = ({ children, sx = {}, elevation = 1, variant = 'elevated', ...props }) => {
|
|
9
|
-
const theme = material.useTheme();
|
|
10
|
-
return (jsxRuntime.jsx(material.Card, { elevation: variant === 'elevated' ? elevation : 0, variant: variant === 'outlined' ? 'outlined' : 'elevation', sx: {
|
|
11
|
-
borderRadius: theme.radius?.sm || 8,
|
|
12
|
-
border: variant === 'bordered' ? `1px solid ${theme.palette.divider}` : 'none',
|
|
13
|
-
overflow: 'hidden',
|
|
14
|
-
backgroundColor: theme.palette.background.paper,
|
|
15
|
-
...sx,
|
|
16
|
-
}, ...props, children: children }));
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const CardHeader = ({ title, subtitle, action, }) => (jsxRuntime.jsx(material.CardHeader, { title: typeof title === 'string' ? (jsxRuntime.jsx(material.Typography, { variant: "h6", fontWeight: 600, children: title })) : (title), subheader: typeof subtitle === 'string' ? (jsxRuntime.jsx(material.Typography, { variant: "body2", color: "text.secondary", children: subtitle })) : (subtitle), action: action }));
|
|
20
|
-
|
|
21
|
-
const CardContent = ({ children, sx }) => (jsxRuntime.jsx(MuiCardContent, { sx: sx, children: children }));
|
|
22
|
-
|
|
23
|
-
const CardActions = ({ children, sx }) => (jsxRuntime.jsx(material.CardActions, { sx: sx, children: children }));
|
|
24
|
-
|
|
25
|
-
const CardImage = ({ src, height = 160, alt = 'card image' }) => (jsxRuntime.jsx(CardMedia, { component: "img", height: height, image: src, alt: alt }));
|
|
26
|
-
|
|
27
|
-
const CardSkeleton = ({ lines = 3 }) => (jsxRuntime.jsxs(material.Box, { p: 2, children: [jsxRuntime.jsx(material.Skeleton, { variant: "rectangular", height: 140 }), [...Array(lines)].map((_, i) => (jsxRuntime.jsx(material.Skeleton, { variant: "text", height: 20, sx: { mt: 1 } }, i)))] }));
|
|
28
|
-
|
|
29
|
-
const Card = Object.assign(CardRoot, {
|
|
30
|
-
Header: CardHeader,
|
|
31
|
-
Content: CardContent,
|
|
32
|
-
Body: CardContent, // alias
|
|
33
|
-
Actions: CardActions,
|
|
34
|
-
Image: CardImage,
|
|
35
|
-
Skeleton: CardSkeleton,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
module.exports = Card;
|
package/dist/Popover/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { PopoverProps as PopoverProps$1 } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
interface PopoverProps extends Partial<PopoverProps$1> {
|
|
6
|
-
open: boolean;
|
|
7
|
-
onClose: () => void;
|
|
8
|
-
anchorEl: HTMLElement | null;
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
width?: number | string;
|
|
11
|
-
maxWidth?: number | string;
|
|
12
|
-
minWidth?: number | string;
|
|
13
|
-
padding?: number;
|
|
14
|
-
border?: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const Popover: ({ open, onClose, anchorEl, children, width, maxWidth, minWidth, padding, border, anchorOrigin, transformOrigin, ...rest }: PopoverProps) => react_jsx_runtime.JSX.Element;
|
|
17
|
-
|
|
18
|
-
export { Popover, Popover as default };
|
|
19
|
-
export type { PopoverProps };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useTheme, Popover as Popover$1, Fade } from '@mui/material';
|
|
3
|
-
|
|
4
|
-
const Popover = ({ open, onClose, anchorEl, children, width = 240, maxWidth = '100%', minWidth = 200, padding = 2, border = true, anchorOrigin = { vertical: 'bottom', horizontal: 'left' }, transformOrigin = { vertical: 'top', horizontal: 'left' }, ...rest }) => {
|
|
5
|
-
const theme = useTheme();
|
|
6
|
-
return (jsx(Popover$1, { open: open, anchorEl: anchorEl, onClose: onClose, disableScrollLock: true, TransitionComponent: Fade, transitionDuration: 150, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, PaperProps: {
|
|
7
|
-
elevation: 0,
|
|
8
|
-
sx: {
|
|
9
|
-
boxShadow: 'none',
|
|
10
|
-
bgcolor: theme.palette.background.paper,
|
|
11
|
-
border: border ? `1px solid ${theme.palette.divider}` : 'none',
|
|
12
|
-
borderRadius: theme.radius.md,
|
|
13
|
-
px: theme.spacing(padding),
|
|
14
|
-
py: theme.spacing(padding),
|
|
15
|
-
width,
|
|
16
|
-
maxWidth,
|
|
17
|
-
minWidth,
|
|
18
|
-
},
|
|
19
|
-
}, ...rest, children: children }));
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export { Popover, Popover as default };
|
package/dist/Popover/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var material = require('@mui/material');
|
|
7
|
-
|
|
8
|
-
const Popover = ({ open, onClose, anchorEl, children, width = 240, maxWidth = '100%', minWidth = 200, padding = 2, border = true, anchorOrigin = { vertical: 'bottom', horizontal: 'left' }, transformOrigin = { vertical: 'top', horizontal: 'left' }, ...rest }) => {
|
|
9
|
-
const theme = material.useTheme();
|
|
10
|
-
return (jsxRuntime.jsx(material.Popover, { open: open, anchorEl: anchorEl, onClose: onClose, disableScrollLock: true, TransitionComponent: material.Fade, transitionDuration: 150, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, PaperProps: {
|
|
11
|
-
elevation: 0,
|
|
12
|
-
sx: {
|
|
13
|
-
boxShadow: 'none',
|
|
14
|
-
bgcolor: theme.palette.background.paper,
|
|
15
|
-
border: border ? `1px solid ${theme.palette.divider}` : 'none',
|
|
16
|
-
borderRadius: theme.radius.md,
|
|
17
|
-
px: theme.spacing(padding),
|
|
18
|
-
py: theme.spacing(padding),
|
|
19
|
-
width,
|
|
20
|
-
maxWidth,
|
|
21
|
-
minWidth,
|
|
22
|
-
},
|
|
23
|
-
}, ...rest, children: children }));
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
exports.Popover = Popover;
|
|
27
|
-
exports.default = Popover;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SxProps } from '@mui/system';
|
|
3
|
-
|
|
4
|
-
interface RadioOption {
|
|
5
|
-
value: string;
|
|
6
|
-
label: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
description?: string;
|
|
9
|
-
}
|
|
10
|
-
interface RadioGroupProps {
|
|
11
|
-
label?: string;
|
|
12
|
-
options: RadioOption[];
|
|
13
|
-
value?: string;
|
|
14
|
-
defaultValue?: string;
|
|
15
|
-
onChange?: (value: string) => void;
|
|
16
|
-
name?: string;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
required?: boolean;
|
|
19
|
-
error?: boolean;
|
|
20
|
-
helperText?: string;
|
|
21
|
-
row?: boolean;
|
|
22
|
-
size?: 'small' | 'medium';
|
|
23
|
-
color?: 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
|
|
24
|
-
sx?: SxProps;
|
|
25
|
-
radioSx?: SxProps;
|
|
26
|
-
labelSx?: SxProps;
|
|
27
|
-
}
|
|
28
|
-
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
-
|
|
30
|
-
export { RadioGroup, RadioGroup as default };
|
|
31
|
-
export type { RadioGroupProps, RadioOption };
|