@synerise/ds-icon 1.11.1 → 1.12.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.
@@ -1,14 +1,14 @@
1
- export { default as UserColor } from './UserColor';
2
1
  export { default as ShopingBagColor } from './ShopingBagColor';
3
- export { default as ScoreColor } from './ScoreColor';
2
+ export { default as UserColor } from './UserColor';
3
+ export { default as VisualSimilarityColor } from './VisualSimilarityColor';
4
4
  export { default as QueryDetailsColor } from './QueryDetailsColor';
5
+ export { default as ScoreColor } from './ScoreColor';
6
+ export { default as PredefinedColor } from './PredefinedColor';
7
+ export { default as ProductBundleColor } from './ProductBundleColor';
5
8
  export { default as ProductsSimilarColor } from './ProductsSimilarColor';
9
+ export { default as FormulaColor } from './FormulaColor';
6
10
  export { default as ProductLastSeenColor } from './ProductLastSeenColor';
7
- export { default as ProductBundleColor } from './ProductBundleColor';
8
- export { default as PredefinedColor } from './PredefinedColor';
9
- export { default as IntegrationColor } from './IntegrationColor';
10
11
  export { default as FunnelColor } from './FunnelColor';
11
- export { default as FormulaColor } from './FormulaColor';
12
- export { default as ABtestColor } from './ABtestColor';
13
12
  export { default as CreatingFromScratchColor } from './CreatingFromScratchColor';
14
- export { default as VisualSimilarityColor } from './VisualSimilarityColor';
13
+ export { default as ABtestColor } from './ABtestColor';
14
+ export { default as IntegrationColor } from './IntegrationColor';
@@ -1,14 +1,14 @@
1
- export { default as UserColor } from './UserColor';
2
1
  export { default as ShopingBagColor } from './ShopingBagColor';
3
- export { default as ScoreColor } from './ScoreColor';
2
+ export { default as UserColor } from './UserColor';
3
+ export { default as VisualSimilarityColor } from './VisualSimilarityColor';
4
4
  export { default as QueryDetailsColor } from './QueryDetailsColor';
5
+ export { default as ScoreColor } from './ScoreColor';
6
+ export { default as PredefinedColor } from './PredefinedColor';
7
+ export { default as ProductBundleColor } from './ProductBundleColor';
5
8
  export { default as ProductsSimilarColor } from './ProductsSimilarColor';
9
+ export { default as FormulaColor } from './FormulaColor';
6
10
  export { default as ProductLastSeenColor } from './ProductLastSeenColor';
7
- export { default as ProductBundleColor } from './ProductBundleColor';
8
- export { default as PredefinedColor } from './PredefinedColor';
9
- export { default as IntegrationColor } from './IntegrationColor';
10
11
  export { default as FunnelColor } from './FunnelColor';
11
- export { default as FormulaColor } from './FormulaColor';
12
- export { default as ABtestColor } from './ABtestColor';
13
12
  export { default as CreatingFromScratchColor } from './CreatingFromScratchColor';
14
- export { default as VisualSimilarityColor } from './VisualSimilarityColor';
13
+ export { default as ABtestColor } from './ABtestColor';
14
+ export { default as IntegrationColor } from './IntegrationColor';
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './icons/colorIcons';
7
7
  export * from './icons/XL';
8
8
  export * from './icons/additional';
9
9
  export { default as MimeTypeIcon } from './MimeTypeIcon/MimeTypeIcon';
10
- export { DynamicIcon, type DynamicIconProps } from './DynamicIcon/DynamicIcon';
10
+ export { DynamicIcon, type DynamicIconProps, type DynamicIconName, } from './DynamicIcon/DynamicIcon';
11
+ export { useIconComponent, getIconComponent } from './useIconComponent';
11
12
  export type { MimeTypeIconsProps } from './MimeTypeIcon/MimeTypeIcon.types';
12
- export type { IconProps } from './Icon.types';
13
+ export type { IconProps, IconName } from './Icon.types';
package/dist/index.js CHANGED
@@ -8,4 +8,5 @@ export * from './icons/XL';
8
8
  // Some of this icons are duplicated in XL folder, consider removing it before uploading new version
9
9
  export * from './icons/additional';
10
10
  export { default as MimeTypeIcon } from './MimeTypeIcon/MimeTypeIcon';
11
- export { DynamicIcon } from './DynamicIcon/DynamicIcon';
11
+ export { DynamicIcon } from './DynamicIcon/DynamicIcon';
12
+ export { useIconComponent, getIconComponent } from './useIconComponent';
@@ -0,0 +1,7 @@
1
+ import { type ComponentType, type SVGProps } from 'react';
2
+ import { iconManifest } from './DynamicIcon/iconManifest';
3
+ export type IconName = keyof typeof iconManifest;
4
+ type IconComponent = ComponentType<SVGProps<SVGSVGElement>>;
5
+ export declare const getIconComponent: (name: string) => IconComponent | null;
6
+ export declare const useIconComponent: (name?: string) => IconComponent | null;
7
+ export {};
@@ -0,0 +1,18 @@
1
+ import { useMemo } from 'react';
2
+ import { iconManifest } from './DynamicIcon/iconManifest';
3
+ export var getIconComponent = function getIconComponent(name) {
4
+ var iconModule = iconManifest[name];
5
+ if (!iconModule) {
6
+ return null;
7
+ }
8
+ var component = iconModule[name];
9
+ return component && typeof component === 'function' ? component : null;
10
+ };
11
+ export var useIconComponent = function useIconComponent(name) {
12
+ return useMemo(function () {
13
+ if (!name) {
14
+ return null;
15
+ }
16
+ return getIconComponent(name);
17
+ }, [name]);
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-icon",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
4
4
  "description": "Icon UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -51,5 +51,5 @@
51
51
  "glob": "^11.0.2",
52
52
  "string-hash": "^1.1.3"
53
53
  },
54
- "gitHead": "ac8decd9736940735bf05198b24b3eeeb5900b18"
54
+ "gitHead": "4a93898aa311430f21ea9604d03438eaac780027"
55
55
  }