@liner-fe/icon 0.0.49 → 0.0.50
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/CHANGELOG.md +6 -0
- package/index.tsx +8 -6
- package/lib/index.js +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/index.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { BasicColorType } from '@liner-fe/design-token-primitive';
|
|
3
|
-
import {
|
|
3
|
+
import { captureException } from '@sentry/nextjs';
|
|
4
4
|
import { ArrowUpward } from './assets/arrow-upward';
|
|
5
5
|
import { ArrowDownward } from './assets/arrow-downward';
|
|
6
6
|
import { ArrowBack } from './assets/arrow-back';
|
|
@@ -402,9 +402,11 @@ export interface IconProps {
|
|
|
402
402
|
|
|
403
403
|
export const Icon = forwardRef<SVGSVGElement, IconProps>(({name, size = "m", ...props}, ref) => {
|
|
404
404
|
const IconComponent = IconMap[name];
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
405
|
+
|
|
406
|
+
if (!IconComponent) {
|
|
407
|
+
captureException(new Error(`Icon ${name} not found`));
|
|
408
|
+
return null;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
return <IconComponent {...props} ref={ref} size={iconSizeMap[size]} />;
|
|
410
412
|
});
|
package/lib/index.js
CHANGED
|
@@ -8259,7 +8259,11 @@ var iconSizeMap = {
|
|
|
8259
8259
|
};
|
|
8260
8260
|
var Icon = (0, import_react188.forwardRef)(({ name, size = "m", ...props }, ref) => {
|
|
8261
8261
|
const IconComponent = IconMap[name];
|
|
8262
|
-
|
|
8262
|
+
if (!IconComponent) {
|
|
8263
|
+
(0, import_nextjs.captureException)(new Error(`Icon ${name} not found`));
|
|
8264
|
+
return null;
|
|
8265
|
+
}
|
|
8266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(IconComponent, { ...props, ref, size: iconSizeMap[size] });
|
|
8263
8267
|
});
|
|
8264
8268
|
/*! Bundled license information:
|
|
8265
8269
|
|