@wonderflow/react-components 9.1.0 → 9.2.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.
|
@@ -34,7 +34,7 @@ export declare const Icon: import("react").ForwardRefExoticComponent<SVGAttribut
|
|
|
34
34
|
* Set the size of the icon. To improve readability at any size, the style of the icon
|
|
35
35
|
* is automatically defined based on the dimension.
|
|
36
36
|
*/
|
|
37
|
-
dimension?: 16 | 24 | 32 | 40 | 48 | 56 | 12 | undefined;
|
|
37
|
+
dimension?: 16 | 24 | 32 | 40 | 48 | 56 | 12 | 18 | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* Set the weight of the icon.
|
|
40
40
|
* The default weight is `outline` if `dimension` is greather than `12` or `undefined`.
|
|
@@ -4,7 +4,7 @@ import sprite from '@wonderflow/icons/sprite.svg';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import styles from './icon.module.css';
|
|
6
6
|
export const Icon = forwardRef(({ className, source, dimension = 16, weight = 'outline', fill, ...otherProps }, forwardedRef) => {
|
|
7
|
-
const computedStyle = useMemo(() => dimension <
|
|
7
|
+
const computedStyle = useMemo(() => dimension < 18 ? 'solid' : weight, [weight, dimension]);
|
|
8
8
|
return (typeof source === 'string')
|
|
9
9
|
? (_jsx("svg", { "aria-hidden": "true", width: dimension, height: dimension, fill: fill, className: clsx(styles.Icon, className), ref: forwardedRef, ...otherProps, children: _jsx("use", { href: `${sprite}#${computedStyle}/${source}` }) }))
|
|
10
10
|
: (_jsx(_Fragment, { children: Children.map(source, (child) => cloneElement(child, {
|