@zimyo/ui 1.1.5 → 1.1.7

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,7 +1,126 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import React from 'react';
2
+ import React, { forwardRef, createElement } from 'react';
3
3
  import { useTheme, Accordion as Accordion$1, AccordionSummary, AccordionDetails } from '@mui/material';
4
- import { ExpandMore } from '@mui/icons-material';
4
+
5
+ /**
6
+ * @license lucide-react v0.525.0 - ISC
7
+ *
8
+ * This source code is licensed under the ISC license.
9
+ * See the LICENSE file in the root directory of this source tree.
10
+ */
11
+
12
+ const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
13
+ const toCamelCase = (string) => string.replace(
14
+ /^([A-Z])|[\s-_]+(\w)/g,
15
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
16
+ );
17
+ const toPascalCase = (string) => {
18
+ const camelCase = toCamelCase(string);
19
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
20
+ };
21
+ const mergeClasses = (...classes) => classes.filter((className, index, array) => {
22
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
23
+ }).join(" ").trim();
24
+ const hasA11yProp = (props) => {
25
+ for (const prop in props) {
26
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
27
+ return true;
28
+ }
29
+ }
30
+ };
31
+
32
+ /**
33
+ * @license lucide-react v0.525.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */
38
+
39
+ var defaultAttributes = {
40
+ xmlns: "http://www.w3.org/2000/svg",
41
+ width: 24,
42
+ height: 24,
43
+ viewBox: "0 0 24 24",
44
+ fill: "none",
45
+ stroke: "currentColor",
46
+ strokeWidth: 2,
47
+ strokeLinecap: "round",
48
+ strokeLinejoin: "round"
49
+ };
50
+
51
+ /**
52
+ * @license lucide-react v0.525.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */
57
+
58
+
59
+ const Icon = forwardRef(
60
+ ({
61
+ color = "currentColor",
62
+ size = 24,
63
+ strokeWidth = 2,
64
+ absoluteStrokeWidth,
65
+ className = "",
66
+ children,
67
+ iconNode,
68
+ ...rest
69
+ }, ref) => createElement(
70
+ "svg",
71
+ {
72
+ ref,
73
+ ...defaultAttributes,
74
+ width: size,
75
+ height: size,
76
+ stroke: color,
77
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
78
+ className: mergeClasses("lucide", className),
79
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
80
+ ...rest
81
+ },
82
+ [
83
+ ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
84
+ ...Array.isArray(children) ? children : [children]
85
+ ]
86
+ )
87
+ );
88
+
89
+ /**
90
+ * @license lucide-react v0.525.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */
95
+
96
+
97
+ const createLucideIcon = (iconName, iconNode) => {
98
+ const Component = forwardRef(
99
+ ({ className, ...props }, ref) => createElement(Icon, {
100
+ ref,
101
+ iconNode,
102
+ className: mergeClasses(
103
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
104
+ `lucide-${iconName}`,
105
+ className
106
+ ),
107
+ ...props
108
+ })
109
+ );
110
+ Component.displayName = toPascalCase(iconName);
111
+ return Component;
112
+ };
113
+
114
+ /**
115
+ * @license lucide-react v0.525.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */
120
+
121
+
122
+ const __iconNode = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
123
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode);
5
124
 
6
125
  const AccordionContext = React.createContext({});
7
126
  // Main Accordion Container Component
@@ -75,7 +194,7 @@ const AccordionItem = React.forwardRef(({ value: itemValue, children, sx = {}, .
75
194
  // AccordionTrigger Component
76
195
  const AccordionTrigger = React.forwardRef(({ children, sx = {}, expandIcon, ...props }, ref) => {
77
196
  const theme = useTheme();
78
- const defaultExpandIcon = expandIcon !== undefined ? expandIcon : jsx(ExpandMore, {});
197
+ const defaultExpandIcon = expandIcon !== undefined ? expandIcon : jsx(ChevronDown, {});
79
198
  return (jsx(AccordionSummary, { ref: ref, expandIcon: defaultExpandIcon, sx: {
80
199
  borderRadius: theme.radius?.sm || theme.shape.borderRadius,
81
200
  minHeight: 56,
@@ -5,7 +5,126 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
7
  var material = require('@mui/material');
8
- var iconsMaterial = require('@mui/icons-material');
8
+
9
+ /**
10
+ * @license lucide-react v0.525.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+
16
+ const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
17
+ const toCamelCase = (string) => string.replace(
18
+ /^([A-Z])|[\s-_]+(\w)/g,
19
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
20
+ );
21
+ const toPascalCase = (string) => {
22
+ const camelCase = toCamelCase(string);
23
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
24
+ };
25
+ const mergeClasses = (...classes) => classes.filter((className, index, array) => {
26
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
27
+ }).join(" ").trim();
28
+ const hasA11yProp = (props) => {
29
+ for (const prop in props) {
30
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
31
+ return true;
32
+ }
33
+ }
34
+ };
35
+
36
+ /**
37
+ * @license lucide-react v0.525.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */
42
+
43
+ var defaultAttributes = {
44
+ xmlns: "http://www.w3.org/2000/svg",
45
+ width: 24,
46
+ height: 24,
47
+ viewBox: "0 0 24 24",
48
+ fill: "none",
49
+ stroke: "currentColor",
50
+ strokeWidth: 2,
51
+ strokeLinecap: "round",
52
+ strokeLinejoin: "round"
53
+ };
54
+
55
+ /**
56
+ * @license lucide-react v0.525.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */
61
+
62
+
63
+ const Icon = React.forwardRef(
64
+ ({
65
+ color = "currentColor",
66
+ size = 24,
67
+ strokeWidth = 2,
68
+ absoluteStrokeWidth,
69
+ className = "",
70
+ children,
71
+ iconNode,
72
+ ...rest
73
+ }, ref) => React.createElement(
74
+ "svg",
75
+ {
76
+ ref,
77
+ ...defaultAttributes,
78
+ width: size,
79
+ height: size,
80
+ stroke: color,
81
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
82
+ className: mergeClasses("lucide", className),
83
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
84
+ ...rest
85
+ },
86
+ [
87
+ ...iconNode.map(([tag, attrs]) => React.createElement(tag, attrs)),
88
+ ...Array.isArray(children) ? children : [children]
89
+ ]
90
+ )
91
+ );
92
+
93
+ /**
94
+ * @license lucide-react v0.525.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */
99
+
100
+
101
+ const createLucideIcon = (iconName, iconNode) => {
102
+ const Component = React.forwardRef(
103
+ ({ className, ...props }, ref) => React.createElement(Icon, {
104
+ ref,
105
+ iconNode,
106
+ className: mergeClasses(
107
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
108
+ `lucide-${iconName}`,
109
+ className
110
+ ),
111
+ ...props
112
+ })
113
+ );
114
+ Component.displayName = toPascalCase(iconName);
115
+ return Component;
116
+ };
117
+
118
+ /**
119
+ * @license lucide-react v0.525.0 - ISC
120
+ *
121
+ * This source code is licensed under the ISC license.
122
+ * See the LICENSE file in the root directory of this source tree.
123
+ */
124
+
125
+
126
+ const __iconNode = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
127
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode);
9
128
 
10
129
  const AccordionContext = React.createContext({});
11
130
  // Main Accordion Container Component
@@ -79,7 +198,7 @@ const AccordionItem = React.forwardRef(({ value: itemValue, children, sx = {}, .
79
198
  // AccordionTrigger Component
80
199
  const AccordionTrigger = React.forwardRef(({ children, sx = {}, expandIcon, ...props }, ref) => {
81
200
  const theme = material.useTheme();
82
- const defaultExpandIcon = expandIcon !== undefined ? expandIcon : jsxRuntime.jsx(iconsMaterial.ExpandMore, {});
201
+ const defaultExpandIcon = expandIcon !== undefined ? expandIcon : jsxRuntime.jsx(ChevronDown, {});
83
202
  return (jsxRuntime.jsx(material.AccordionSummary, { ref: ref, expandIcon: defaultExpandIcon, sx: {
84
203
  borderRadius: theme.radius?.sm || theme.shape.borderRadius,
85
204
  minHeight: 56,
@@ -1,7 +1,140 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import React from 'react';
2
+ import React, { forwardRef, createElement } from 'react';
3
3
  import { useTheme, FormControl, Select as Select$1, OutlinedInput, IconButton, MenuItem, ListItemText, FormHelperText, Box, Chip } from '@mui/material';
4
- import { ExpandMore, Clear } from '@mui/icons-material';
4
+
5
+ /**
6
+ * @license lucide-react v0.525.0 - ISC
7
+ *
8
+ * This source code is licensed under the ISC license.
9
+ * See the LICENSE file in the root directory of this source tree.
10
+ */
11
+
12
+ const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
13
+ const toCamelCase = (string) => string.replace(
14
+ /^([A-Z])|[\s-_]+(\w)/g,
15
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
16
+ );
17
+ const toPascalCase = (string) => {
18
+ const camelCase = toCamelCase(string);
19
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
20
+ };
21
+ const mergeClasses = (...classes) => classes.filter((className, index, array) => {
22
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
23
+ }).join(" ").trim();
24
+ const hasA11yProp = (props) => {
25
+ for (const prop in props) {
26
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
27
+ return true;
28
+ }
29
+ }
30
+ };
31
+
32
+ /**
33
+ * @license lucide-react v0.525.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */
38
+
39
+ var defaultAttributes = {
40
+ xmlns: "http://www.w3.org/2000/svg",
41
+ width: 24,
42
+ height: 24,
43
+ viewBox: "0 0 24 24",
44
+ fill: "none",
45
+ stroke: "currentColor",
46
+ strokeWidth: 2,
47
+ strokeLinecap: "round",
48
+ strokeLinejoin: "round"
49
+ };
50
+
51
+ /**
52
+ * @license lucide-react v0.525.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */
57
+
58
+
59
+ const Icon = forwardRef(
60
+ ({
61
+ color = "currentColor",
62
+ size = 24,
63
+ strokeWidth = 2,
64
+ absoluteStrokeWidth,
65
+ className = "",
66
+ children,
67
+ iconNode,
68
+ ...rest
69
+ }, ref) => createElement(
70
+ "svg",
71
+ {
72
+ ref,
73
+ ...defaultAttributes,
74
+ width: size,
75
+ height: size,
76
+ stroke: color,
77
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
78
+ className: mergeClasses("lucide", className),
79
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
80
+ ...rest
81
+ },
82
+ [
83
+ ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
84
+ ...Array.isArray(children) ? children : [children]
85
+ ]
86
+ )
87
+ );
88
+
89
+ /**
90
+ * @license lucide-react v0.525.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */
95
+
96
+
97
+ const createLucideIcon = (iconName, iconNode) => {
98
+ const Component = forwardRef(
99
+ ({ className, ...props }, ref) => createElement(Icon, {
100
+ ref,
101
+ iconNode,
102
+ className: mergeClasses(
103
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
104
+ `lucide-${iconName}`,
105
+ className
106
+ ),
107
+ ...props
108
+ })
109
+ );
110
+ Component.displayName = toPascalCase(iconName);
111
+ return Component;
112
+ };
113
+
114
+ /**
115
+ * @license lucide-react v0.525.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */
120
+
121
+
122
+ const __iconNode$1 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
123
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$1);
124
+
125
+ /**
126
+ * @license lucide-react v0.525.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */
131
+
132
+
133
+ const __iconNode = [
134
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
135
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
136
+ ];
137
+ const X = createLucideIcon("x", __iconNode);
5
138
 
6
139
  const Select = React.forwardRef(({ label = '', options = [], value, onChange, error = false, helperText = '', required = false, placeholder = 'Select...', isMulti = false, disabled = false, ...rest }, ref) => {
7
140
  useTheme();
@@ -56,7 +189,7 @@ const Select = React.forwardRef(({ label = '', options = [], value, onChange, er
56
189
  },
57
190
  }, children: [jsx(Select$1, { displayEmpty: true,
58
191
  // labelId={labelId}
59
- multiple: isMulti, value: value || (isMulti ? [] : ''), onChange: onChange, input: jsx(OutlinedInput, { label: label }), renderValue: renderValue, ref: ref, IconComponent: ExpandMore, endAdornment: value && !isMulti && ((isMulti && value.length > 0) || (!isMulti && value !== '')) ? (jsx(IconButton, { sx: { marginRight: '1rem' }, size: "small", onClick: handleClearSelection, children: jsx(Clear, { fontSize: "small" }) })) : null, variant: "outlined", ...rest, children: options && options.map((option) => (jsx(MenuItem, { value: option.value, children: isMulti ? (jsx(Fragment, { children: jsx(ListItemText, { primary: option.label }) })) : (option.label || placeholder) }, option.value))) }), helperText && jsx(FormHelperText, { children: helperText })] }));
192
+ multiple: isMulti, value: value || (isMulti ? [] : ''), onChange: onChange, input: jsx(OutlinedInput, { label: label }), renderValue: renderValue, ref: ref, IconComponent: ChevronDown, endAdornment: value && !isMulti && ((isMulti && value.length > 0) || (!isMulti && value !== '')) ? (jsx(IconButton, { sx: { marginRight: '1rem' }, size: "small", onClick: handleClearSelection, children: jsx(X, { fontSize: "small" }) })) : null, variant: "outlined", ...rest, children: options && options.map((option) => (jsx(MenuItem, { value: option.value, children: isMulti ? (jsx(Fragment, { children: jsx(ListItemText, { primary: option.label }) })) : (option.label || placeholder) }, option.value))) }), helperText && jsx(FormHelperText, { children: helperText })] }));
60
193
  });
61
194
 
62
195
  export { Select, Select as default };
@@ -5,7 +5,140 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
7
  var material = require('@mui/material');
8
- var iconsMaterial = require('@mui/icons-material');
8
+
9
+ /**
10
+ * @license lucide-react v0.525.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+
16
+ const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
17
+ const toCamelCase = (string) => string.replace(
18
+ /^([A-Z])|[\s-_]+(\w)/g,
19
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
20
+ );
21
+ const toPascalCase = (string) => {
22
+ const camelCase = toCamelCase(string);
23
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
24
+ };
25
+ const mergeClasses = (...classes) => classes.filter((className, index, array) => {
26
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
27
+ }).join(" ").trim();
28
+ const hasA11yProp = (props) => {
29
+ for (const prop in props) {
30
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
31
+ return true;
32
+ }
33
+ }
34
+ };
35
+
36
+ /**
37
+ * @license lucide-react v0.525.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */
42
+
43
+ var defaultAttributes = {
44
+ xmlns: "http://www.w3.org/2000/svg",
45
+ width: 24,
46
+ height: 24,
47
+ viewBox: "0 0 24 24",
48
+ fill: "none",
49
+ stroke: "currentColor",
50
+ strokeWidth: 2,
51
+ strokeLinecap: "round",
52
+ strokeLinejoin: "round"
53
+ };
54
+
55
+ /**
56
+ * @license lucide-react v0.525.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */
61
+
62
+
63
+ const Icon = React.forwardRef(
64
+ ({
65
+ color = "currentColor",
66
+ size = 24,
67
+ strokeWidth = 2,
68
+ absoluteStrokeWidth,
69
+ className = "",
70
+ children,
71
+ iconNode,
72
+ ...rest
73
+ }, ref) => React.createElement(
74
+ "svg",
75
+ {
76
+ ref,
77
+ ...defaultAttributes,
78
+ width: size,
79
+ height: size,
80
+ stroke: color,
81
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
82
+ className: mergeClasses("lucide", className),
83
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
84
+ ...rest
85
+ },
86
+ [
87
+ ...iconNode.map(([tag, attrs]) => React.createElement(tag, attrs)),
88
+ ...Array.isArray(children) ? children : [children]
89
+ ]
90
+ )
91
+ );
92
+
93
+ /**
94
+ * @license lucide-react v0.525.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */
99
+
100
+
101
+ const createLucideIcon = (iconName, iconNode) => {
102
+ const Component = React.forwardRef(
103
+ ({ className, ...props }, ref) => React.createElement(Icon, {
104
+ ref,
105
+ iconNode,
106
+ className: mergeClasses(
107
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
108
+ `lucide-${iconName}`,
109
+ className
110
+ ),
111
+ ...props
112
+ })
113
+ );
114
+ Component.displayName = toPascalCase(iconName);
115
+ return Component;
116
+ };
117
+
118
+ /**
119
+ * @license lucide-react v0.525.0 - ISC
120
+ *
121
+ * This source code is licensed under the ISC license.
122
+ * See the LICENSE file in the root directory of this source tree.
123
+ */
124
+
125
+
126
+ const __iconNode$1 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
127
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$1);
128
+
129
+ /**
130
+ * @license lucide-react v0.525.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */
135
+
136
+
137
+ const __iconNode = [
138
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
139
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
140
+ ];
141
+ const X = createLucideIcon("x", __iconNode);
9
142
 
10
143
  const Select = React.forwardRef(({ label = '', options = [], value, onChange, error = false, helperText = '', required = false, placeholder = 'Select...', isMulti = false, disabled = false, ...rest }, ref) => {
11
144
  material.useTheme();
@@ -60,7 +193,7 @@ const Select = React.forwardRef(({ label = '', options = [], value, onChange, er
60
193
  },
61
194
  }, children: [jsxRuntime.jsx(material.Select, { displayEmpty: true,
62
195
  // labelId={labelId}
63
- multiple: isMulti, value: value || (isMulti ? [] : ''), onChange: onChange, input: jsxRuntime.jsx(material.OutlinedInput, { label: label }), renderValue: renderValue, ref: ref, IconComponent: iconsMaterial.ExpandMore, endAdornment: value && !isMulti && ((isMulti && value.length > 0) || (!isMulti && value !== '')) ? (jsxRuntime.jsx(material.IconButton, { sx: { marginRight: '1rem' }, size: "small", onClick: handleClearSelection, children: jsxRuntime.jsx(iconsMaterial.Clear, { fontSize: "small" }) })) : null, variant: "outlined", ...rest, children: options && options.map((option) => (jsxRuntime.jsx(material.MenuItem, { value: option.value, children: isMulti ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(material.ListItemText, { primary: option.label }) })) : (option.label || placeholder) }, option.value))) }), helperText && jsxRuntime.jsx(material.FormHelperText, { children: helperText })] }));
196
+ multiple: isMulti, value: value || (isMulti ? [] : ''), onChange: onChange, input: jsxRuntime.jsx(material.OutlinedInput, { label: label }), renderValue: renderValue, ref: ref, IconComponent: ChevronDown, endAdornment: value && !isMulti && ((isMulti && value.length > 0) || (!isMulti && value !== '')) ? (jsxRuntime.jsx(material.IconButton, { sx: { marginRight: '1rem' }, size: "small", onClick: handleClearSelection, children: jsxRuntime.jsx(X, { fontSize: "small" }) })) : null, variant: "outlined", ...rest, children: options && options.map((option) => (jsxRuntime.jsx(material.MenuItem, { value: option.value, children: isMulti ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(material.ListItemText, { primary: option.label }) })) : (option.label || placeholder) }, option.value))) }), helperText && jsxRuntime.jsx(material.FormHelperText, { children: helperText })] }));
64
197
  });
65
198
 
66
199
  exports.Select = Select;
package/dist/index.esm.js CHANGED
@@ -1,9 +1,8 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import React from 'react';
2
+ import React, { forwardRef, createElement } from 'react';
3
3
  import { useTheme, Button as Button$1, CircularProgress, Card, CardHeader as CardHeader$1, Typography, CardActions as CardActions$1, Box, Skeleton, FormControl, Select as Select$1, OutlinedInput, IconButton, MenuItem, ListItemText, FormHelperText, Chip, Accordion as Accordion$1, AccordionSummary, AccordionDetails, FormControlLabel, Switch as Switch$1, TextField, InputAdornment, FormLabel, RadioGroup as RadioGroup$1, Radio, GlobalStyles, CssBaseline } from '@mui/material';
4
4
  import MuiCardContent from '@mui/material/CardContent';
5
5
  import CardMedia from '@mui/material/CardMedia';
6
- import { ExpandMore, Clear } from '@mui/icons-material';
7
6
  import { createTheme, ThemeProvider } from '@mui/material/styles';
8
7
 
9
8
  const Button = React.forwardRef(({ children, loading = false, loadingText, loaderSize = 18, loaderPosition = 'start', variant = 'contained', color = 'primary', size = 'medium', sx = {}, disabled, startIcon, endIcon, ...props }, ref) => {
@@ -54,6 +53,140 @@ Object.assign(CardRoot, {
54
53
  Skeleton: CardSkeleton,
55
54
  });
56
55
 
56
+ /**
57
+ * @license lucide-react v0.525.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */
62
+
63
+ const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
64
+ const toCamelCase = (string) => string.replace(
65
+ /^([A-Z])|[\s-_]+(\w)/g,
66
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
67
+ );
68
+ const toPascalCase = (string) => {
69
+ const camelCase = toCamelCase(string);
70
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
71
+ };
72
+ const mergeClasses = (...classes) => classes.filter((className, index, array) => {
73
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
74
+ }).join(" ").trim();
75
+ const hasA11yProp = (props) => {
76
+ for (const prop in props) {
77
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
78
+ return true;
79
+ }
80
+ }
81
+ };
82
+
83
+ /**
84
+ * @license lucide-react v0.525.0 - ISC
85
+ *
86
+ * This source code is licensed under the ISC license.
87
+ * See the LICENSE file in the root directory of this source tree.
88
+ */
89
+
90
+ var defaultAttributes = {
91
+ xmlns: "http://www.w3.org/2000/svg",
92
+ width: 24,
93
+ height: 24,
94
+ viewBox: "0 0 24 24",
95
+ fill: "none",
96
+ stroke: "currentColor",
97
+ strokeWidth: 2,
98
+ strokeLinecap: "round",
99
+ strokeLinejoin: "round"
100
+ };
101
+
102
+ /**
103
+ * @license lucide-react v0.525.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */
108
+
109
+
110
+ const Icon = forwardRef(
111
+ ({
112
+ color = "currentColor",
113
+ size = 24,
114
+ strokeWidth = 2,
115
+ absoluteStrokeWidth,
116
+ className = "",
117
+ children,
118
+ iconNode,
119
+ ...rest
120
+ }, ref) => createElement(
121
+ "svg",
122
+ {
123
+ ref,
124
+ ...defaultAttributes,
125
+ width: size,
126
+ height: size,
127
+ stroke: color,
128
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
129
+ className: mergeClasses("lucide", className),
130
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
131
+ ...rest
132
+ },
133
+ [
134
+ ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
135
+ ...Array.isArray(children) ? children : [children]
136
+ ]
137
+ )
138
+ );
139
+
140
+ /**
141
+ * @license lucide-react v0.525.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */
146
+
147
+
148
+ const createLucideIcon = (iconName, iconNode) => {
149
+ const Component = forwardRef(
150
+ ({ className, ...props }, ref) => createElement(Icon, {
151
+ ref,
152
+ iconNode,
153
+ className: mergeClasses(
154
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
155
+ `lucide-${iconName}`,
156
+ className
157
+ ),
158
+ ...props
159
+ })
160
+ );
161
+ Component.displayName = toPascalCase(iconName);
162
+ return Component;
163
+ };
164
+
165
+ /**
166
+ * @license lucide-react v0.525.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */
171
+
172
+
173
+ const __iconNode$1 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
174
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$1);
175
+
176
+ /**
177
+ * @license lucide-react v0.525.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */
182
+
183
+
184
+ const __iconNode = [
185
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
186
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
187
+ ];
188
+ const X = createLucideIcon("x", __iconNode);
189
+
57
190
  const Select = React.forwardRef(({ label = '', options = [], value, onChange, error = false, helperText = '', required = false, placeholder = 'Select...', isMulti = false, disabled = false, ...rest }, ref) => {
58
191
  useTheme();
59
192
  const handleRemoveChip = (chipValue) => (e) => {
@@ -107,7 +240,7 @@ const Select = React.forwardRef(({ label = '', options = [], value, onChange, er
107
240
  },
108
241
  }, children: [jsx(Select$1, { displayEmpty: true,
109
242
  // labelId={labelId}
110
- multiple: isMulti, value: value || (isMulti ? [] : ''), onChange: onChange, input: jsx(OutlinedInput, { label: label }), renderValue: renderValue, ref: ref, IconComponent: ExpandMore, endAdornment: value && !isMulti && ((isMulti && value.length > 0) || (!isMulti && value !== '')) ? (jsx(IconButton, { sx: { marginRight: '1rem' }, size: "small", onClick: handleClearSelection, children: jsx(Clear, { fontSize: "small" }) })) : null, variant: "outlined", ...rest, children: options && options.map((option) => (jsx(MenuItem, { value: option.value, children: isMulti ? (jsx(Fragment, { children: jsx(ListItemText, { primary: option.label }) })) : (option.label || placeholder) }, option.value))) }), helperText && jsx(FormHelperText, { children: helperText })] }));
243
+ multiple: isMulti, value: value || (isMulti ? [] : ''), onChange: onChange, input: jsx(OutlinedInput, { label: label }), renderValue: renderValue, ref: ref, IconComponent: ChevronDown, endAdornment: value && !isMulti && ((isMulti && value.length > 0) || (!isMulti && value !== '')) ? (jsx(IconButton, { sx: { marginRight: '1rem' }, size: "small", onClick: handleClearSelection, children: jsx(X, { fontSize: "small" }) })) : null, variant: "outlined", ...rest, children: options && options.map((option) => (jsx(MenuItem, { value: option.value, children: isMulti ? (jsx(Fragment, { children: jsx(ListItemText, { primary: option.label }) })) : (option.label || placeholder) }, option.value))) }), helperText && jsx(FormHelperText, { children: helperText })] }));
111
244
  });
112
245
 
113
246
  const AccordionContext = React.createContext({});
@@ -182,7 +315,7 @@ const AccordionItem = React.forwardRef(({ value: itemValue, children, sx = {}, .
182
315
  // AccordionTrigger Component
183
316
  const AccordionTrigger = React.forwardRef(({ children, sx = {}, expandIcon, ...props }, ref) => {
184
317
  const theme = useTheme();
185
- const defaultExpandIcon = expandIcon !== undefined ? expandIcon : jsx(ExpandMore, {});
318
+ const defaultExpandIcon = expandIcon !== undefined ? expandIcon : jsx(ChevronDown, {});
186
319
  return (jsx(AccordionSummary, { ref: ref, expandIcon: defaultExpandIcon, sx: {
187
320
  borderRadius: theme.radius?.sm || theme.shape.borderRadius,
188
321
  minHeight: 56,
package/dist/index.js CHANGED
@@ -5,7 +5,6 @@ var React = require('react');
5
5
  var material = require('@mui/material');
6
6
  var MuiCardContent = require('@mui/material/CardContent');
7
7
  var CardMedia = require('@mui/material/CardMedia');
8
- var iconsMaterial = require('@mui/icons-material');
9
8
  var styles = require('@mui/material/styles');
10
9
 
11
10
  const Button = React.forwardRef(({ children, loading = false, loadingText, loaderSize = 18, loaderPosition = 'start', variant = 'contained', color = 'primary', size = 'medium', sx = {}, disabled, startIcon, endIcon, ...props }, ref) => {
@@ -56,6 +55,140 @@ Object.assign(CardRoot, {
56
55
  Skeleton: CardSkeleton,
57
56
  });
58
57
 
58
+ /**
59
+ * @license lucide-react v0.525.0 - ISC
60
+ *
61
+ * This source code is licensed under the ISC license.
62
+ * See the LICENSE file in the root directory of this source tree.
63
+ */
64
+
65
+ const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
66
+ const toCamelCase = (string) => string.replace(
67
+ /^([A-Z])|[\s-_]+(\w)/g,
68
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
69
+ );
70
+ const toPascalCase = (string) => {
71
+ const camelCase = toCamelCase(string);
72
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
73
+ };
74
+ const mergeClasses = (...classes) => classes.filter((className, index, array) => {
75
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
76
+ }).join(" ").trim();
77
+ const hasA11yProp = (props) => {
78
+ for (const prop in props) {
79
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
80
+ return true;
81
+ }
82
+ }
83
+ };
84
+
85
+ /**
86
+ * @license lucide-react v0.525.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */
91
+
92
+ var defaultAttributes = {
93
+ xmlns: "http://www.w3.org/2000/svg",
94
+ width: 24,
95
+ height: 24,
96
+ viewBox: "0 0 24 24",
97
+ fill: "none",
98
+ stroke: "currentColor",
99
+ strokeWidth: 2,
100
+ strokeLinecap: "round",
101
+ strokeLinejoin: "round"
102
+ };
103
+
104
+ /**
105
+ * @license lucide-react v0.525.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */
110
+
111
+
112
+ const Icon = React.forwardRef(
113
+ ({
114
+ color = "currentColor",
115
+ size = 24,
116
+ strokeWidth = 2,
117
+ absoluteStrokeWidth,
118
+ className = "",
119
+ children,
120
+ iconNode,
121
+ ...rest
122
+ }, ref) => React.createElement(
123
+ "svg",
124
+ {
125
+ ref,
126
+ ...defaultAttributes,
127
+ width: size,
128
+ height: size,
129
+ stroke: color,
130
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
131
+ className: mergeClasses("lucide", className),
132
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
133
+ ...rest
134
+ },
135
+ [
136
+ ...iconNode.map(([tag, attrs]) => React.createElement(tag, attrs)),
137
+ ...Array.isArray(children) ? children : [children]
138
+ ]
139
+ )
140
+ );
141
+
142
+ /**
143
+ * @license lucide-react v0.525.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */
148
+
149
+
150
+ const createLucideIcon = (iconName, iconNode) => {
151
+ const Component = React.forwardRef(
152
+ ({ className, ...props }, ref) => React.createElement(Icon, {
153
+ ref,
154
+ iconNode,
155
+ className: mergeClasses(
156
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
157
+ `lucide-${iconName}`,
158
+ className
159
+ ),
160
+ ...props
161
+ })
162
+ );
163
+ Component.displayName = toPascalCase(iconName);
164
+ return Component;
165
+ };
166
+
167
+ /**
168
+ * @license lucide-react v0.525.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */
173
+
174
+
175
+ const __iconNode$1 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
176
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$1);
177
+
178
+ /**
179
+ * @license lucide-react v0.525.0 - ISC
180
+ *
181
+ * This source code is licensed under the ISC license.
182
+ * See the LICENSE file in the root directory of this source tree.
183
+ */
184
+
185
+
186
+ const __iconNode = [
187
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
188
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
189
+ ];
190
+ const X = createLucideIcon("x", __iconNode);
191
+
59
192
  const Select = React.forwardRef(({ label = '', options = [], value, onChange, error = false, helperText = '', required = false, placeholder = 'Select...', isMulti = false, disabled = false, ...rest }, ref) => {
60
193
  material.useTheme();
61
194
  const handleRemoveChip = (chipValue) => (e) => {
@@ -109,7 +242,7 @@ const Select = React.forwardRef(({ label = '', options = [], value, onChange, er
109
242
  },
110
243
  }, children: [jsxRuntime.jsx(material.Select, { displayEmpty: true,
111
244
  // labelId={labelId}
112
- multiple: isMulti, value: value || (isMulti ? [] : ''), onChange: onChange, input: jsxRuntime.jsx(material.OutlinedInput, { label: label }), renderValue: renderValue, ref: ref, IconComponent: iconsMaterial.ExpandMore, endAdornment: value && !isMulti && ((isMulti && value.length > 0) || (!isMulti && value !== '')) ? (jsxRuntime.jsx(material.IconButton, { sx: { marginRight: '1rem' }, size: "small", onClick: handleClearSelection, children: jsxRuntime.jsx(iconsMaterial.Clear, { fontSize: "small" }) })) : null, variant: "outlined", ...rest, children: options && options.map((option) => (jsxRuntime.jsx(material.MenuItem, { value: option.value, children: isMulti ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(material.ListItemText, { primary: option.label }) })) : (option.label || placeholder) }, option.value))) }), helperText && jsxRuntime.jsx(material.FormHelperText, { children: helperText })] }));
245
+ multiple: isMulti, value: value || (isMulti ? [] : ''), onChange: onChange, input: jsxRuntime.jsx(material.OutlinedInput, { label: label }), renderValue: renderValue, ref: ref, IconComponent: ChevronDown, endAdornment: value && !isMulti && ((isMulti && value.length > 0) || (!isMulti && value !== '')) ? (jsxRuntime.jsx(material.IconButton, { sx: { marginRight: '1rem' }, size: "small", onClick: handleClearSelection, children: jsxRuntime.jsx(X, { fontSize: "small" }) })) : null, variant: "outlined", ...rest, children: options && options.map((option) => (jsxRuntime.jsx(material.MenuItem, { value: option.value, children: isMulti ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(material.ListItemText, { primary: option.label }) })) : (option.label || placeholder) }, option.value))) }), helperText && jsxRuntime.jsx(material.FormHelperText, { children: helperText })] }));
113
246
  });
114
247
 
115
248
  const AccordionContext = React.createContext({});
@@ -184,7 +317,7 @@ const AccordionItem = React.forwardRef(({ value: itemValue, children, sx = {}, .
184
317
  // AccordionTrigger Component
185
318
  const AccordionTrigger = React.forwardRef(({ children, sx = {}, expandIcon, ...props }, ref) => {
186
319
  const theme = material.useTheme();
187
- const defaultExpandIcon = expandIcon !== undefined ? expandIcon : jsxRuntime.jsx(iconsMaterial.ExpandMore, {});
320
+ const defaultExpandIcon = expandIcon !== undefined ? expandIcon : jsxRuntime.jsx(ChevronDown, {});
188
321
  return (jsxRuntime.jsx(material.AccordionSummary, { ref: ref, expandIcon: defaultExpandIcon, sx: {
189
322
  borderRadius: theme.radius?.sm || theme.shape.borderRadius,
190
323
  minHeight: 56,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zimyo/ui",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
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,6 @@
82
82
  "peerDependencies": {
83
83
  "@emotion/react": ">=11.0.0",
84
84
  "@emotion/styled": ">=11.0.0",
85
- "@mui/icons-material": ">=5.0.0",
86
85
  "@mui/material": ">=5.0.0",
87
86
  "react": ">=17.0.0",
88
87
  "react-dom": ">=17.0.0"
@@ -118,8 +117,8 @@
118
117
  "@emotion/react": ">=11.0.0",
119
118
  "@emotion/styled": ">=11.0.0",
120
119
  "@fontsource/inter": "^5.2.6",
121
- "@mui/icons-material": ">=5.0.0",
122
- "@mui/material": ">=5.0.0"
120
+ "@mui/material": ">=5.0.0",
121
+ "lucide-react": "^0.525.0"
123
122
  },
124
123
  "eslintConfig": {
125
124
  "extends": [