@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
@@ -14,7 +14,6 @@ $ pnpm add @ultraviolet/icons
14
14
 
15
15
  Checkout our [documentation website](https://storybook.ultraviolet.scaleway.com/).
16
16
 
17
-
18
17
  ## Contributing
19
18
 
20
19
  📝 You can participate in the development and [start contributing](/CONTRIBUTING.md) to it.
@@ -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:", _ref => {
8
- let {
9
- theme
10
- } = _ref;
11
- return theme.colors.other.icon.category.primary.fill;
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 = _ref3 => {
23
- let {
24
- name
25
- } = _ref3;
26
- return jsx(StyledIcon, {
27
- width: "20",
28
- height: "20",
29
- viewBox: "0 0 20 20",
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 = _ref => {
338
- let {
339
- size
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:", _ref2 => {
354
- let {
355
- theme,
356
- color,
357
- prominence,
358
- disabled
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((_ref3, ref) => {
370
- let {
371
- name = 'alert',
372
- color = 'currentColor',
373
- size = '1em',
374
- prominence = 'default',
375
- className,
376
- 'data-testid': dataTestId,
377
- stroke,
378
- cursor,
379
- strokeWidth,
380
- disabled
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:", _ref => {
15
- let {
16
- size
17
- } = _ref;
18
- return `${SIZES[size]}px`;
19
- }, ";min-width:", _ref2 => {
20
- let {
21
- size
22
- } = _ref2;
23
- return `${SIZES[size]}px`;
24
- }, ";height:", _ref3 => {
25
- let {
26
- size
27
- } = _ref3;
28
- return `${SIZES[size]}px`;
29
- }, ";}path[fill].fill,g[fill].fill>*,g.fill>*{fill:", _ref4 => {
30
- let {
31
- theme,
32
- variant,
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 = _ref7 => {
57
- let {
58
- name,
59
- variant = 'primary',
60
- disabled,
61
- size = 'small'
62
- } = _ref7;
63
- return jsx(StyledIcon, {
64
- variant: variant,
65
- disabled: disabled,
66
- size: size,
67
- viewBox: "0 0 64 64",
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.0",
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.5",
41
+ "@babel/core": "7.23.6",
42
42
  "@emotion/babel-plugin": "11.11.0",
43
- "@types/react": "18.2.43",
44
- "@types/react-dom": "18.2.17"
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"