@sydsoft/base 1.47.0 → 1.49.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/README.md +8 -1
- package/{dist/esm → _dist}/_lib/baseFunctions.d.ts +0 -1
- package/{dist/esm → _dist}/_lib/baseFunctions.js +25 -38
- package/{dist/esm → _dist}/_lib/inputMask.js +66 -69
- package/{dist/esm → _dist}/_lib/listFunctions.js +12 -13
- package/_dist/_lib/storage/cookies.d.ts +4 -0
- package/_dist/_lib/storage/cookies.js +33 -0
- package/_dist/_lib/storage/encData.js +41 -0
- package/{dist/esm → _dist}/_lib/storage/localStorage.js +10 -10
- package/{dist/esm → _dist}/_lib/storage/sessionStorage.js +10 -10
- package/{dist/esm → _dist}/_lib/useInterval.js +5 -5
- package/{dist/esm → _dist}/alert/index.js +28 -30
- package/_dist/box/Box.js +14 -0
- package/_dist/box/BoxContent.js +5 -0
- package/_dist/box/BoxFooter.js +10 -0
- package/_dist/box/BoxHeader.js +10 -0
- package/_dist/countDown/index.js +92 -0
- package/{dist/esm → _dist}/dateTime/index.js +25 -31
- package/_dist/form/Button.js +82 -0
- package/_dist/form/Checkbox.js +22 -0
- package/_dist/form/Dialog.js +53 -0
- package/_dist/form/Form.js +10 -0
- package/_dist/form/FormOlustur.js +50 -0
- package/{dist/esm → _dist}/form/Input.js +57 -56
- package/_dist/form/Label.js +7 -0
- package/{dist/esm → _dist}/form/SearchableInput.d.ts +0 -1
- package/_dist/form/SearchableInput.js +260 -0
- package/_dist/form/UploadBase.js +84 -0
- package/_dist/grid/index.js +96 -0
- package/{dist/esm → _dist}/icon/icons.js +1 -1
- package/{dist/esm → _dist}/icon/index.d.ts +1 -1
- package/_dist/icon/index.js +34 -0
- package/_dist/menu/index.js +50 -0
- package/_dist/modal/index.js +64 -0
- package/{dist/esm → _dist}/popover/index.js +100 -100
- package/_dist/tooltip/index.js +202 -0
- package/_lib/baseFunctions.ts +94 -0
- package/_lib/inputMask.ts +257 -0
- package/_lib/listFunctions.ts +106 -0
- package/_lib/storage/cookies.ts +39 -0
- package/_lib/storage/encData.ts +41 -0
- package/_lib/storage/localStorage.ts +67 -0
- package/_lib/storage/sessionStorage.ts +67 -0
- package/_lib/useInterval.ts +30 -0
- package/alert/index.module.css +119 -0
- package/alert/index.tsx +131 -0
- package/box/Box.module.css +153 -0
- package/box/Box.tsx +33 -0
- package/box/BoxContent.tsx +18 -0
- package/box/BoxFooter.tsx +25 -0
- package/box/BoxHeader.tsx +46 -0
- package/box/index.ts +10 -0
- package/countDown/index.tsx +116 -0
- package/dateTime/index.ts +79 -0
- package/form/Button.tsx +143 -0
- package/form/Checkbox.tsx +48 -0
- package/form/Dialog.tsx +109 -0
- package/form/Form.tsx +19 -0
- package/form/FormOlustur.tsx +105 -0
- package/form/Input.tsx +364 -0
- package/form/Label.tsx +20 -0
- package/form/SearchableInput.tsx +406 -0
- package/form/UploadBase.tsx +133 -0
- package/form/index.ts +10 -0
- package/form/styles/Button.module.css +145 -0
- package/form/styles/Input.module.css +221 -0
- package/form/styles/Label.module.css +31 -0
- package/form/styles/SearchableInput.module.css +80 -0
- package/global.d.ts +9 -0
- package/grid/index.module.css +805 -0
- package/grid/index.tsx +171 -0
- package/icon/icons.tsx +33 -0
- package/icon/index.tsx +95 -0
- package/icon/mui.tsx +5932 -0
- package/index.ts +21 -0
- package/menu/index.module.css +92 -0
- package/menu/index.tsx +143 -0
- package/modal/index.module.css +77 -0
- package/modal/index.tsx +106 -0
- package/npm_recovery_codes.txt +5 -0
- package/package.json +18 -11
- package/popover/index.module.css +89 -0
- package/popover/index.tsx +392 -0
- package/tooltip/index.tsx +216 -0
- package/tsconfig.json +24 -0
- package/dist/esm/_lib/storage/cookies.d.ts +0 -4
- package/dist/esm/_lib/storage/cookies.js +0 -34
- package/dist/esm/_lib/storage/encData.js +0 -43
- package/dist/esm/box/Box.js +0 -15
- package/dist/esm/box/BoxContent.js +0 -7
- package/dist/esm/box/BoxFooter.js +0 -8
- package/dist/esm/box/BoxHeader.js +0 -9
- package/dist/esm/countDown/index.js +0 -97
- package/dist/esm/form/Button.js +0 -76
- package/dist/esm/form/Checkbox.js +0 -23
- package/dist/esm/form/Dialog.js +0 -40
- package/dist/esm/form/Form.js +0 -12
- package/dist/esm/form/FormOlustur.js +0 -52
- package/dist/esm/form/Label.js +0 -9
- package/dist/esm/form/SearchableInput.js +0 -272
- package/dist/esm/form/UploadBase.js +0 -86
- package/dist/esm/grid/index.js +0 -97
- package/dist/esm/icon/index.js +0 -26
- package/dist/esm/menu/index.js +0 -52
- package/dist/esm/modal/index.js +0 -66
- package/dist/esm/tooltip/index.js +0 -119
- /package/{dist/esm → _dist}/_lib/inputMask.d.ts +0 -0
- /package/{dist/esm → _dist}/_lib/listFunctions.d.ts +0 -0
- /package/{dist/esm → _dist}/_lib/storage/encData.d.ts +0 -0
- /package/{dist/esm → _dist}/_lib/storage/localStorage.d.ts +0 -0
- /package/{dist/esm → _dist}/_lib/storage/sessionStorage.d.ts +0 -0
- /package/{dist/esm → _dist}/_lib/useInterval.d.ts +0 -0
- /package/{dist/esm → _dist}/alert/index.d.ts +0 -0
- /package/{dist/esm → _dist}/alert/index.module.css +0 -0
- /package/{dist/esm → _dist}/box/Box.d.ts +0 -0
- /package/{dist/esm → _dist}/box/Box.module.css +0 -0
- /package/{dist/esm → _dist}/box/BoxContent.d.ts +0 -0
- /package/{dist/esm → _dist}/box/BoxFooter.d.ts +0 -0
- /package/{dist/esm → _dist}/box/BoxHeader.d.ts +0 -0
- /package/{dist/esm → _dist}/box/index.d.ts +0 -0
- /package/{dist/esm → _dist}/box/index.js +0 -0
- /package/{dist/esm → _dist}/countDown/index.d.ts +0 -0
- /package/{dist/esm → _dist}/dateTime/index.d.ts +0 -0
- /package/{dist/esm → _dist}/form/Button.d.ts +0 -0
- /package/{dist/esm → _dist}/form/Checkbox.d.ts +0 -0
- /package/{dist/esm → _dist}/form/Dialog.d.ts +0 -0
- /package/{dist/esm → _dist}/form/Form.d.ts +0 -0
- /package/{dist/esm → _dist}/form/FormOlustur.d.ts +0 -0
- /package/{dist/esm → _dist}/form/Input.d.ts +0 -0
- /package/{dist/esm → _dist}/form/Label.d.ts +0 -0
- /package/{dist/esm → _dist}/form/UploadBase.d.ts +0 -0
- /package/{dist/esm → _dist}/form/index.d.ts +0 -0
- /package/{dist/esm → _dist}/form/index.js +0 -0
- /package/{dist/esm → _dist}/form/styles/Button.module.css +0 -0
- /package/{dist/esm → _dist}/form/styles/Input.module.css +0 -0
- /package/{dist/esm → _dist}/form/styles/Label.module.css +0 -0
- /package/{dist/esm → _dist}/form/styles/SearchableInput.module.css +0 -0
- /package/{dist/esm → _dist}/grid/index.d.ts +0 -0
- /package/{dist/esm → _dist}/grid/index.module.css +0 -0
- /package/{dist/esm → _dist}/icon/icons.d.ts +0 -0
- /package/{dist/esm → _dist}/icon/mui.d.ts +0 -0
- /package/{dist/esm → _dist}/icon/mui.js +0 -0
- /package/{dist/esm → _dist}/index.d.ts +0 -0
- /package/{dist/esm → _dist}/index.js +0 -0
- /package/{dist/esm → _dist}/menu/index.d.ts +0 -0
- /package/{dist/esm → _dist}/menu/index.module.css +0 -0
- /package/{dist/esm → _dist}/modal/index.d.ts +0 -0
- /package/{dist/esm → _dist}/modal/index.module.css +0 -0
- /package/{dist/esm → _dist}/popover/index.d.ts +0 -0
- /package/{dist/esm → _dist}/popover/index.module.css +0 -0
- /package/{dist/esm → _dist}/tooltip/index.d.ts +0 -0
package/grid/index.tsx
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import styles from './index.module.css';
|
|
4
|
+
|
|
5
|
+
// Row Component
|
|
6
|
+
export type typeSpacingValues = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
7
|
+
export type typeJustifyContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
8
|
+
export type typeAlignItems = 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline';
|
|
9
|
+
export type typeAlignContent = 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
10
|
+
|
|
11
|
+
export interface RowProps {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
16
|
+
flexWrap?: 'wrap' | 'wrap-reverse' | 'nowrap';
|
|
17
|
+
justifyContent?: typeJustifyContent;
|
|
18
|
+
alignContent?: typeAlignContent;
|
|
19
|
+
alignItems?: typeAlignItems;
|
|
20
|
+
rowSpacing?: typeSpacingValues;
|
|
21
|
+
colSpacing?: typeSpacingValues;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Row: React.FC<RowProps> = ({
|
|
25
|
+
children,
|
|
26
|
+
className = '',
|
|
27
|
+
style,
|
|
28
|
+
flexDirection = 'row',
|
|
29
|
+
flexWrap = 'wrap',
|
|
30
|
+
justifyContent = 'flex-start',
|
|
31
|
+
alignContent = 'center',
|
|
32
|
+
alignItems = 'center',
|
|
33
|
+
rowSpacing = 2,
|
|
34
|
+
colSpacing = 2,
|
|
35
|
+
...other
|
|
36
|
+
}) => {
|
|
37
|
+
const classes = [
|
|
38
|
+
styles.row,
|
|
39
|
+
rowSpacing !== undefined && styles[`row-spacing-${rowSpacing}`],
|
|
40
|
+
colSpacing !== undefined && styles[`col-spacing-${colSpacing}`],
|
|
41
|
+
flexDirection !== 'row' && styles[`flex-${flexDirection.replace('-', '-')}`],
|
|
42
|
+
flexWrap !== 'wrap' && styles[`flex-${flexWrap}`],
|
|
43
|
+
justifyContent !== 'flex-start' && styles[`justify-${justifyContent.replace('flex-', '').replace('space-', '')}`],
|
|
44
|
+
alignItems !== 'center' && styles[`align-items-${alignItems.replace('flex-', '')}`],
|
|
45
|
+
alignContent !== 'center' && styles[`align-content-${alignContent.replace('flex-', '')}`],
|
|
46
|
+
className
|
|
47
|
+
]
|
|
48
|
+
.filter(Boolean)
|
|
49
|
+
.join(' ');
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<div className={classes} style={style} {...other}>
|
|
53
|
+
{children}
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Col Component
|
|
59
|
+
export type GridValues = 'auto' | 'full' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
60
|
+
|
|
61
|
+
export interface ColProps {
|
|
62
|
+
children?: React.ReactNode;
|
|
63
|
+
className?: string;
|
|
64
|
+
style?: React.CSSProperties;
|
|
65
|
+
xs?: GridValues;
|
|
66
|
+
sm?: GridValues;
|
|
67
|
+
md?: GridValues;
|
|
68
|
+
lg?: GridValues;
|
|
69
|
+
xl?: GridValues;
|
|
70
|
+
xxl?: GridValues;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const Col: React.FC<ColProps> = ({ children, className = '', style, xs, sm, md, lg, xl, xxl, ...other }) => {
|
|
74
|
+
// Cascading logic - aynı sizin component'inizdeki gibi
|
|
75
|
+
|
|
76
|
+
const classes = [
|
|
77
|
+
styles.col,
|
|
78
|
+
// Sadece belirtilen breakpoint'ler için class ekle
|
|
79
|
+
xs && styles[`col-xs-${xs}`],
|
|
80
|
+
sm && styles[`col-sm-${sm}`],
|
|
81
|
+
md && styles[`col-md-${md}`],
|
|
82
|
+
lg && styles[`col-lg-${lg}`],
|
|
83
|
+
xl && styles[`col-xl-${xl}`],
|
|
84
|
+
xxl && styles[`col-xxl-${xxl}`],
|
|
85
|
+
className
|
|
86
|
+
]
|
|
87
|
+
.filter(Boolean)
|
|
88
|
+
.join(' ');
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<div className={classes} style={style} {...other}>
|
|
92
|
+
{children}
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// Hidden Component
|
|
98
|
+
export interface HiddenProps {
|
|
99
|
+
children: React.ReactElement;
|
|
100
|
+
hidden?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
101
|
+
onlyHidden?: ('xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl')[];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export const Hidden: React.FC<HiddenProps> = ({ children, hidden, onlyHidden, ...other }) => {
|
|
105
|
+
const existingClassName = children.props.className || '';
|
|
106
|
+
const hiddenClasses: string[] = [];
|
|
107
|
+
|
|
108
|
+
if (onlyHidden) {
|
|
109
|
+
onlyHidden.forEach((breakpoint) => {
|
|
110
|
+
hiddenClasses.push(styles[`hidden-${breakpoint}`]);
|
|
111
|
+
});
|
|
112
|
+
} else if (hidden) {
|
|
113
|
+
// Orijinal mantık: seçilen breakpoint ve altındaki tüm breakpoint'ler gizlenir
|
|
114
|
+
const breakpoints = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
|
115
|
+
const targetIndex = breakpoints.indexOf(hidden);
|
|
116
|
+
|
|
117
|
+
if (targetIndex !== -1) {
|
|
118
|
+
for (let i = 0; i <= targetIndex; i++) {
|
|
119
|
+
hiddenClasses.push(styles[`hidden-${breakpoints[i]}`]);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const newClassName = [existingClassName, ...hiddenClasses].filter(Boolean).join(' ');
|
|
125
|
+
|
|
126
|
+
return React.cloneElement(children, {
|
|
127
|
+
className: newClassName,
|
|
128
|
+
...other
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
export const DevelopGridComponent: React.FC = () => {
|
|
134
|
+
const [currentBreakpoint, setCurrentBreakpoint] = useState('');
|
|
135
|
+
|
|
136
|
+
// Breakpoint detector
|
|
137
|
+
React.useEffect(() => {
|
|
138
|
+
const updateBreakpoint = () => {
|
|
139
|
+
const width = window.innerWidth;
|
|
140
|
+
let breakpoint = '';
|
|
141
|
+
if (width <= 576) breakpoint = 'XS (≤576px)';
|
|
142
|
+
else if (width <= 768) breakpoint = 'SM (577-768px)';
|
|
143
|
+
else if (width <= 992) breakpoint = 'MD (769-992px)';
|
|
144
|
+
else if (width <= 1200) breakpoint = 'LG (993-1200px)';
|
|
145
|
+
else if (width <= 1400) breakpoint = 'XL (1201-1400px)';
|
|
146
|
+
else breakpoint = 'XXL (≥1401px)';
|
|
147
|
+
setCurrentBreakpoint(breakpoint);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
updateBreakpoint();
|
|
151
|
+
window.addEventListener('resize', updateBreakpoint);
|
|
152
|
+
return () => window.removeEventListener('resize', updateBreakpoint);
|
|
153
|
+
}, []);
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<div
|
|
157
|
+
style={{
|
|
158
|
+
position: 'fixed',
|
|
159
|
+
bottom: '10px',
|
|
160
|
+
right: '10px',
|
|
161
|
+
background: '#333',
|
|
162
|
+
color: 'white',
|
|
163
|
+
padding: '10px',
|
|
164
|
+
borderRadius: '4px',
|
|
165
|
+
zIndex: 9999999
|
|
166
|
+
}}
|
|
167
|
+
>
|
|
168
|
+
Current: {currentBreakpoint}
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
171
|
+
};
|
package/icon/icons.tsx
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const iconMap = {
|
|
2
|
+
close: {
|
|
3
|
+
viewBox: '0 -960 960 960',
|
|
4
|
+
content: (
|
|
5
|
+
<>
|
|
6
|
+
<path d="m336-280-56-56 144-144-144-143 56-56 144 144 143-144 56 56-144 143 144 144-56 56-143-144-144 144Z" />
|
|
7
|
+
</>
|
|
8
|
+
)
|
|
9
|
+
},
|
|
10
|
+
search: {
|
|
11
|
+
viewBox: '0 0 24 24',
|
|
12
|
+
content: (
|
|
13
|
+
<>
|
|
14
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
15
|
+
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" />
|
|
16
|
+
</>
|
|
17
|
+
)
|
|
18
|
+
},
|
|
19
|
+
edit: {
|
|
20
|
+
viewBox: '0 -960 960 960',
|
|
21
|
+
content: (
|
|
22
|
+
<path d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z" />
|
|
23
|
+
)
|
|
24
|
+
},
|
|
25
|
+
keyboard_arrow_up: {
|
|
26
|
+
viewBox: '0 -960 960 960',
|
|
27
|
+
content: <path d="M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z" />
|
|
28
|
+
},
|
|
29
|
+
keyboard_arrow_down: {
|
|
30
|
+
viewBox: '0 -960 960 960',
|
|
31
|
+
content: <path d="M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z" />
|
|
32
|
+
}
|
|
33
|
+
};
|
package/icon/index.tsx
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// https://fonts.google.com/icons adresinden ikonu seçtikten sonra kopyalayalıp alıyoruz. Icon adı da en atta hangisiyse onu ekleyelim, isimler karışmasın
|
|
2
|
+
// https://icons8.com/icons/set/google-drive adresinden ikonu seçtikten sonra kopyalayalıp alıyoruz. Icon adı da en atta hangisiyse onu ekleyelim, isimler karışmasın
|
|
3
|
+
// https://www.svgrepo.com/svg/353811/google-drive?edit=true adresinden ikonu seçtikten sonra kopyalayalıp alıyoruz. Icon adı da en atta hangisiyse onu ekleyelim, isimler karışmasın
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { iconMap } from './icons';
|
|
7
|
+
import { MaterialIconName } from './mui';
|
|
8
|
+
|
|
9
|
+
export const iconList = Object.keys(iconMap) as IconName[];
|
|
10
|
+
export type IconName = keyof typeof iconMap;
|
|
11
|
+
|
|
12
|
+
interface BaseProps {
|
|
13
|
+
color?: string;
|
|
14
|
+
fontSize?: number | string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
className?: string;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// name ile customIcon mutually exclusive
|
|
21
|
+
interface NameIconProps extends BaseProps {
|
|
22
|
+
name: IconName;
|
|
23
|
+
customIcon?: never;
|
|
24
|
+
iconMui?: never;
|
|
25
|
+
}
|
|
26
|
+
export type CustomIcon = { viewBox: string; content: React.ReactNode };
|
|
27
|
+
interface CustomIconProps extends BaseProps {
|
|
28
|
+
customIcon: CustomIcon;
|
|
29
|
+
name?: never;
|
|
30
|
+
iconMui?: never;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// materialIcon ekleme
|
|
34
|
+
interface MUIIconProps extends BaseProps {
|
|
35
|
+
iconMui: MaterialIconName;
|
|
36
|
+
name?: never;
|
|
37
|
+
customIcon?: never;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type Props = NameIconProps | MUIIconProps | CustomIconProps;
|
|
41
|
+
|
|
42
|
+
const defaultIconStyle: React.CSSProperties = {
|
|
43
|
+
userSelect: 'none',
|
|
44
|
+
width: '1em',
|
|
45
|
+
height: '1em',
|
|
46
|
+
// display: 'inline-block',
|
|
47
|
+
verticalAlign: 'middle',
|
|
48
|
+
flexShrink: 0,
|
|
49
|
+
display: 'flex',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
justifyContent: 'center'
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const Icon: React.FC<Props> = ({ name, iconMui, customIcon, fontSize, color, className, style, ...other }) => {
|
|
55
|
+
if (iconMui) {
|
|
56
|
+
return (
|
|
57
|
+
<span
|
|
58
|
+
className={`material-icons ${className || ''}`}
|
|
59
|
+
style={{
|
|
60
|
+
...defaultIconStyle,
|
|
61
|
+
...style,
|
|
62
|
+
fontSize: fontSize || '1.3rem',
|
|
63
|
+
color: color || 'inherit'
|
|
64
|
+
}}
|
|
65
|
+
aria-hidden="true"
|
|
66
|
+
{...other}
|
|
67
|
+
>
|
|
68
|
+
{iconMui}
|
|
69
|
+
</span>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const iconComponent = name ? iconMap[name] : customIcon;
|
|
74
|
+
|
|
75
|
+
if (!iconComponent) {
|
|
76
|
+
return <span>⚠️</span>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<span
|
|
81
|
+
className={className}
|
|
82
|
+
style={{
|
|
83
|
+
...defaultIconStyle,
|
|
84
|
+
...style,
|
|
85
|
+
fontSize: fontSize || '1.5rem',
|
|
86
|
+
color: color || 'inherit'
|
|
87
|
+
}}
|
|
88
|
+
{...other}
|
|
89
|
+
>
|
|
90
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox={iconComponent.viewBox} fill={'currentColor'} width="1em" height="1em" style={{ display: 'block', flexShrink: 0 }}>
|
|
91
|
+
{iconComponent.content}
|
|
92
|
+
</svg>
|
|
93
|
+
</span>
|
|
94
|
+
);
|
|
95
|
+
};
|