react-restyle-components 0.2.69 → 0.2.71

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/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.2.68",
3
+ "version": "0.2.70",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {
@@ -1 +1 @@
1
- {"version":3,"file":"icons.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/icons/icons.component.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAI9C,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,IAAI,0DAMd,SAAS,KAAG,WAqFd,CAAC"}
1
+ {"version":3,"file":"icons.component.d.ts","sourceRoot":"","sources":["../../../../../src/core-components/atoms/icons/icons.component.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAI9C,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,IAAI,0DAMd,SAAS,KAAG,WA8Ed,CAAC"}
@@ -11,10 +11,18 @@ export const Icon = ({ nameIcon, propsIcon, tooltip = '', isDisable = false, onC
11
11
  ...propsIcon,
12
12
  color: isDisable ? '#808080' : propsIcon?.color || 'rgb(36 48 63)',
13
13
  };
14
- const lib = nameIcon
15
- .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
16
- .split(' ')[0]
17
- .toLocaleLowerCase();
14
+ // const lib = nameIcon
15
+ // .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
16
+ // .split(' ')[0]
17
+ // .toLowerCase();
18
+ const lib = nameIcon.startsWith('IoIo')
19
+ ? 'io'
20
+ : nameIcon.startsWith('Io')
21
+ ? 'io5'
22
+ : nameIcon
23
+ .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
24
+ .split(' ')[0]
25
+ .toLowerCase();
18
26
  const iconLibraries = {
19
27
  fa: () => import('react-icons/fa'),
20
28
  md: () => import('react-icons/md'),
@@ -44,28 +52,14 @@ export const Icon = ({ nameIcon, propsIcon, tooltip = '', isDisable = false, onC
44
52
  ci: () => import('react-icons/ci'),
45
53
  lib: () => import('react-icons/lib'),
46
54
  lia: () => import('react-icons/lia'),
55
+ pi: () => import('react-icons/pi'),
56
+ tfi: () => import('react-icons/tfi'),
57
+ fa6: () => import('react-icons/fa6'),
47
58
  };
48
59
  const loadLibrary = iconLibraries[lib] || (() => import('react-icons/md'));
49
60
  const ElementIcon = loadable(loadLibrary, {
50
61
  resolveComponent: (el) => el[nameIcon] != null ? el[nameIcon] : el[Object.keys(el.default)[0]],
51
62
  });
52
- console.log({ lib });
53
- // let ElementIcon: any;
54
- // if (lib == 'md')
55
- // ElementIcon = loadable(() => import('react-icons/md'), {
56
- // resolveComponent: (el) =>
57
- // el[nameIcon] != null ? el[nameIcon] : el[Object.keys(el.default)[0]],
58
- // });
59
- // else if (lib == 'lia')
60
- // ElementIcon = loadable(() => import('react-icons/lia'), {
61
- // resolveComponent: (el) =>
62
- // el[nameIcon] != null ? el[nameIcon] : el[Object.keys(el.default)[0]],
63
- // });
64
- // else
65
- // ElementIcon = loadable(() => import('react-icons/fa'), {
66
- // resolveComponent: (el) =>
67
- // el[nameIcon] != null ? el[nameIcon] : el[Object.keys(el.default)[0]],
68
- // });
69
63
  return (_jsx("div", { className: cn(s.iconContainer), onClick: () => {
70
64
  if (!isDisable)
71
65
  onClick && onClick();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.2.69",
3
+ "version": "0.2.71",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {