@channel.io/bezier-react 2.4.0 → 2.5.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.
@@ -2,6 +2,8 @@
2
2
 
3
3
  var bezierIcons = require('@channel.io/bezier-icons');
4
4
 
5
+ const iconNames = new Set(Object.keys(bezierIcons.icons));
6
+
5
7
  /**
6
8
  * @deprecated Please import and use individual icons.
7
9
  * @example
@@ -16,7 +18,7 @@ var bezierIcons = require('@channel.io/bezier-icons');
16
18
  * import { LegacyIcon, type LegacyIconProps } from '@channel.io/bezier-react'
17
19
  * <LegacyIcon name="all" color="bg-black-dark" />
18
20
  */
19
- const isIconName = name => Object.keys(bezierIcons.icons).includes(name);
21
+ const isIconName = name => iconNames.has(name);
20
22
 
21
23
  exports.isIconName = isIconName;
22
24
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../src/components/LegacyIcon/utils.ts"],"sourcesContent":["import { type IconName, icons } from '@channel.io/bezier-icons'\n\n/**\n * @deprecated Please import and use individual icons.\n * @example\n * import { AllIcon } from '@channel.io/bezier-icons'\n * import { Icon, type IconProps } from '@channel.io/bezier-react'\n * <Icon source={AllIcon} color=\"bg-black-dark\" />\n * @example <caption>How to validate the bezier icon source</caption>\n * import { isBezierIcon, AllIcon } from '@channel.io/bezier-icons'\n * isBezierIcon(AllIcon) // true\n * isBezierIcon(() => <svg>...</svg>) // false\n * @example <caption>Legacy icon component is still available. but it will be removed in future versions!</caption>\n * import { LegacyIcon, type LegacyIconProps } from '@channel.io/bezier-react'\n * <LegacyIcon name=\"all\" color=\"bg-black-dark\" />\n */\nexport const isIconName = (name: any): name is IconName =>\n Object.keys(icons).includes(name)\n"],"names":["isIconName","name","Object","keys","icons","includes"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACaA,MAAAA,UAAU,GAAIC,IAAS,IAClCC,MAAM,CAACC,IAAI,CAACC,iBAAK,CAAC,CAACC,QAAQ,CAACJ,IAAI;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../src/components/LegacyIcon/utils.ts"],"sourcesContent":["import { type IconName, icons } from '@channel.io/bezier-icons'\n\nconst iconNames = new Set(Object.keys(icons))\n\n/**\n * @deprecated Please import and use individual icons.\n * @example\n * import { AllIcon } from '@channel.io/bezier-icons'\n * import { Icon, type IconProps } from '@channel.io/bezier-react'\n * <Icon source={AllIcon} color=\"bg-black-dark\" />\n * @example <caption>How to validate the bezier icon source</caption>\n * import { isBezierIcon, AllIcon } from '@channel.io/bezier-icons'\n * isBezierIcon(AllIcon) // true\n * isBezierIcon(() => <svg>...</svg>) // false\n * @example <caption>Legacy icon component is still available. but it will be removed in future versions!</caption>\n * import { LegacyIcon, type LegacyIconProps } from '@channel.io/bezier-react'\n * <LegacyIcon name=\"all\" color=\"bg-black-dark\" />\n */\nexport const isIconName = (name: any): name is IconName => iconNames.has(name)\n"],"names":["iconNames","Set","Object","keys","icons","isIconName","name","has"],"mappings":";;;;AAEA,MAAMA,SAAS,GAAG,IAAIC,GAAG,CAACC,MAAM,CAACC,IAAI,CAACC,iBAAK,CAAC,CAAC,CAAA;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,UAAU,GAAIC,IAAS,IAAuBN,SAAS,CAACO,GAAG,CAACD,IAAI;;;;"}