@ultraviolet/icons 2.7.0 → 2.7.2
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/README.md
CHANGED
|
@@ -4,31 +4,22 @@ import { jsx } from '@emotion/react/jsx-runtime';
|
|
|
4
4
|
|
|
5
5
|
const StyledIcon = /*#__PURE__*/_styled("svg", {
|
|
6
6
|
target: "e1wwql4e0"
|
|
7
|
-
})(".fill{fill:",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, ";}.fillStrong{fill:", _ref2 => {
|
|
13
|
-
let {
|
|
14
|
-
theme
|
|
15
|
-
} = _ref2;
|
|
16
|
-
return theme.colors.other.icon.category.primary.fillStrong;
|
|
17
|
-
}, ";}");
|
|
7
|
+
})(".fill{fill:", ({
|
|
8
|
+
theme
|
|
9
|
+
}) => theme.colors.other.icon.category.primary.fill, ";}.fillStrong{fill:", ({
|
|
10
|
+
theme
|
|
11
|
+
}) => theme.colors.other.icon.category.primary.fillStrong, ";}");
|
|
18
12
|
/**
|
|
19
13
|
* CategoryIcon component is used to render category icons, those icons are more complex than system icons
|
|
20
14
|
* as they involve multiple colors that changes depending on theme.
|
|
21
15
|
*/
|
|
22
|
-
const CategoryIcon =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
children: CATEGORY_ICONS[name]
|
|
31
|
-
});
|
|
32
|
-
};
|
|
16
|
+
const CategoryIcon = ({
|
|
17
|
+
name
|
|
18
|
+
}) => jsx(StyledIcon, {
|
|
19
|
+
width: "20",
|
|
20
|
+
height: "20",
|
|
21
|
+
viewBox: "0 0 20 20",
|
|
22
|
+
children: CATEGORY_ICONS[name]
|
|
23
|
+
});
|
|
33
24
|
|
|
34
25
|
export { CategoryIcon };
|
|
@@ -334,10 +334,9 @@ const customViewBoxes = [{
|
|
|
334
334
|
icons: ['expand'],
|
|
335
335
|
viewBox: '0 0 20 14'
|
|
336
336
|
}];
|
|
337
|
-
const sizeStyles =
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
} = _ref;
|
|
337
|
+
const sizeStyles = ({
|
|
338
|
+
size
|
|
339
|
+
}) => {
|
|
341
340
|
const pxSize = typeof size === 'number' && !Number.isNaN(size) ? `${size}px` : size;
|
|
342
341
|
return /*#__PURE__*/css("height:", pxSize, ";width:", pxSize, ";min-width:", pxSize, ";min-height:", pxSize, ";");
|
|
343
342
|
};
|
|
@@ -350,13 +349,12 @@ const PROMINENCES = {
|
|
|
350
349
|
const StyledIcon = /*#__PURE__*/_styled('svg', {
|
|
351
350
|
shouldForwardProp: prop => !['size', 'color', 'prominence', 'disabled'].includes(prop),
|
|
352
351
|
target: "e1gt4cfo0"
|
|
353
|
-
})("vertical-align:middle;fill:",
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
} = _ref2;
|
|
352
|
+
})("vertical-align:middle;fill:", ({
|
|
353
|
+
theme,
|
|
354
|
+
color,
|
|
355
|
+
prominence,
|
|
356
|
+
disabled
|
|
357
|
+
}) => {
|
|
360
358
|
// stronger is available only for neutral color
|
|
361
359
|
const definedProminence = color !== 'neutral' && prominence === 'stronger' ? capitalize(PROMINENCES.default) : capitalize(PROMINENCES[prominence]);
|
|
362
360
|
theme.colors[color];
|
|
@@ -366,19 +364,18 @@ const StyledIcon = /*#__PURE__*/_styled('svg', {
|
|
|
366
364
|
/**
|
|
367
365
|
* Icon component is our set of system icons in the design system. All of them are SVGs.
|
|
368
366
|
*/
|
|
369
|
-
const Icon = /*#__PURE__*/forwardRef((
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
} = _ref3;
|
|
367
|
+
const Icon = /*#__PURE__*/forwardRef(({
|
|
368
|
+
name = 'alert',
|
|
369
|
+
color = 'currentColor',
|
|
370
|
+
size = '1em',
|
|
371
|
+
prominence = 'default',
|
|
372
|
+
className,
|
|
373
|
+
'data-testid': dataTestId,
|
|
374
|
+
stroke,
|
|
375
|
+
cursor,
|
|
376
|
+
strokeWidth,
|
|
377
|
+
disabled
|
|
378
|
+
}, ref) => {
|
|
382
379
|
const render = ICONS[name] || ICONS.alert;
|
|
383
380
|
const defaultViewBox = useMemo(() => customViewBoxes.find(vB => vB.icons.includes(name))?.viewBox ?? '0 0 24 24', [name]);
|
|
384
381
|
return jsx(StyledIcon, {
|
|
@@ -11,62 +11,41 @@ const SIZES = {
|
|
|
11
11
|
const StyledIcon = /*#__PURE__*/_styled('svg', {
|
|
12
12
|
shouldForwardProp: prop => !['variant', 'disabled'].includes(prop),
|
|
13
13
|
target: "euby9wl0"
|
|
14
|
-
})("&{width:",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
disabled
|
|
34
|
-
} = _ref4;
|
|
35
|
-
return `${theme.colors.other.icon.product[variant][disabled ? 'fillDisabled' : 'fill']}`;
|
|
36
|
-
}, ";}path[fill].fillStrong,g[fill].fillStrong>*,g.fillStrong>*{fill:", _ref5 => {
|
|
37
|
-
let {
|
|
38
|
-
theme,
|
|
39
|
-
variant,
|
|
40
|
-
disabled
|
|
41
|
-
} = _ref5;
|
|
42
|
-
return `${theme.colors.other.icon.product[variant][disabled ? 'fillStrongDisabled' : 'fillStrong']}`;
|
|
43
|
-
}, ";}path[fill].fillWeak,g[fill].fillWeak>*,g.fillWeak>*{fill:", _ref6 => {
|
|
44
|
-
let {
|
|
45
|
-
theme,
|
|
46
|
-
variant,
|
|
47
|
-
disabled
|
|
48
|
-
} = _ref6;
|
|
49
|
-
return `${theme.colors.other.icon.product[variant][disabled ? 'fillWeakDisabled' : 'fillWeak']}`;
|
|
50
|
-
}, ";}");
|
|
14
|
+
})("&{width:", ({
|
|
15
|
+
size
|
|
16
|
+
}) => `${SIZES[size]}px`, ";min-width:", ({
|
|
17
|
+
size
|
|
18
|
+
}) => `${SIZES[size]}px`, ";height:", ({
|
|
19
|
+
size
|
|
20
|
+
}) => `${SIZES[size]}px`, ";}path[fill].fill,g[fill].fill>*,g.fill>*{fill:", ({
|
|
21
|
+
theme,
|
|
22
|
+
variant,
|
|
23
|
+
disabled
|
|
24
|
+
}) => `${theme.colors.other.icon.product[variant][disabled ? 'fillDisabled' : 'fill']}`, ";}path[fill].fillStrong,g[fill].fillStrong>*,g.fillStrong>*{fill:", ({
|
|
25
|
+
theme,
|
|
26
|
+
variant,
|
|
27
|
+
disabled
|
|
28
|
+
}) => `${theme.colors.other.icon.product[variant][disabled ? 'fillStrongDisabled' : 'fillStrong']}`, ";}path[fill].fillWeak,g[fill].fillWeak>*,g.fillWeak>*{fill:", ({
|
|
29
|
+
theme,
|
|
30
|
+
variant,
|
|
31
|
+
disabled
|
|
32
|
+
}) => `${theme.colors.other.icon.product[variant][disabled ? 'fillWeakDisabled' : 'fillWeak']}`, ";}");
|
|
51
33
|
|
|
52
34
|
/**
|
|
53
35
|
* ProductIcon component is used to render a set of icons that are linked to a product or service.
|
|
54
36
|
* Those icons are made of multiple colors that changes automatically based on the current theme.
|
|
55
37
|
*/
|
|
56
|
-
const ProductIcon =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
children: PRODUCT_ICONS[name]
|
|
69
|
-
});
|
|
70
|
-
};
|
|
38
|
+
const ProductIcon = ({
|
|
39
|
+
name,
|
|
40
|
+
variant = 'primary',
|
|
41
|
+
disabled,
|
|
42
|
+
size = 'small'
|
|
43
|
+
}) => jsx(StyledIcon, {
|
|
44
|
+
variant: variant,
|
|
45
|
+
disabled: disabled,
|
|
46
|
+
size: size,
|
|
47
|
+
viewBox: "0 0 64 64",
|
|
48
|
+
children: PRODUCT_ICONS[name]
|
|
49
|
+
});
|
|
71
50
|
|
|
72
51
|
export { ProductIcon };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultraviolet/icons",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"description": "Ultraviolet Icons",
|
|
5
5
|
"homepage": "https://github.com/scaleway/ultraviolet#readme",
|
|
6
6
|
"repository": {
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"react-dom": "18.2.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@babel/core": "7.23.
|
|
41
|
+
"@babel/core": "7.23.6",
|
|
42
42
|
"@emotion/babel-plugin": "11.11.0",
|
|
43
|
-
"@types/react": "18.2.
|
|
44
|
-
"@types/react-dom": "18.2.
|
|
43
|
+
"@types/react": "18.2.45",
|
|
44
|
+
"@types/react-dom": "18.2.18"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@ultraviolet/themes": "1.5.0"
|