@semcore/icon 2.29.5 → 2.30.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [2.30.0] - 2022-08-18
6
+
7
+ ### Added
8
+
9
+ - Added `onKeyDown` functionality.
10
+
5
11
  ## [2.29.5] - 2022-08-18
6
12
 
7
13
  ### Changed
package/lib/cjs/Icon.js CHANGED
@@ -46,16 +46,16 @@ var styles = (
46
46
  /*__reshadow_css_start__*/
47
47
  _core.sstyled.insert(
48
48
  /*__inner_css_start__*/
49
- ".___SIcon_2xx8d_gg_{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;shape-rendering:geometricPrecision;box-sizing:content-box;fill:currentColor;flex-shrink:0;outline:none;color:var(--color_2xx8d)}.___SIcon_2xx8d_gg_.__keyboardFocused_2xx8d_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SIcon_2xx8d_gg_.__interactive_2xx8d_gg_{cursor:pointer}.___SIcon_2xx8d_gg_.__interactive_2xx8d_gg_:hover{color:var(--color-interactive_2xx8d)}"
49
+ ".___SIcon_65xbq_gg_{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;shape-rendering:geometricPrecision;box-sizing:content-box;fill:currentColor;flex-shrink:0;outline:none;color:var(--color_65xbq)}.___SIcon_65xbq_gg_.__keyboardFocused_65xbq_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SIcon_65xbq_gg_.__interactive_65xbq_gg_{cursor:pointer}.___SIcon_65xbq_gg_.__interactive_65xbq_gg_:hover{color:var(--color-interactive_65xbq)}"
50
50
  /*__inner_css_end__*/
51
- , "2xx8d_gg_")
51
+ , "65xbq_gg_")
52
52
  /*__reshadow_css_end__*/
53
53
  , {
54
- "__SIcon": "___SIcon_2xx8d_gg_",
55
- "--color": "--color_2xx8d",
56
- "_keyboardFocused": "__keyboardFocused_2xx8d_gg_",
57
- "_interactive": "__interactive_2xx8d_gg_",
58
- "--color-interactive": "--color-interactive_2xx8d"
54
+ "__SIcon": "___SIcon_65xbq_gg_",
55
+ "--color": "--color_65xbq",
56
+ "_keyboardFocused": "__keyboardFocused_65xbq_gg_",
57
+ "_interactive": "__interactive_65xbq_gg_",
58
+ "--color-interactive": "--color-interactive_65xbq"
59
59
  });
60
60
 
61
61
  function Icon(props, ref) {
@@ -91,9 +91,20 @@ function Icon(props, ref) {
91
91
  className = _sstyles$cn.className,
92
92
  style = _sstyles$cn.style;
93
93
 
94
+ function onKeyDown(event) {
95
+ if (props.onKeyDown) {
96
+ return;
97
+ }
98
+
99
+ if (event.code === 'Enter' && interactive) {
100
+ props.onClick && props.onClick();
101
+ }
102
+ }
103
+
94
104
  return /*#__PURE__*/_react["default"].createElement(SIcon, (0, _extends2["default"])({}, (0, _propsForElement["default"])(propsWithKeyboardEnhance), {
95
105
  style: Object.assign({}, style, propsWithKeyboardEnhance.style, props.style),
96
- className: (0, _classnames["default"])(className, propsWithKeyboardEnhance.className, props.className) || undefined
106
+ className: (0, _classnames["default"])(className, propsWithKeyboardEnhance.className, props.className) || undefined,
107
+ onKeyDown: onKeyDown
97
108
  }));
98
109
  }
99
110
 
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","names":["Icon","props","ref","useBox","tag","width","height","viewBox","SIcon","other","interactive","colorProps","color","resolveColor","keyboardFocusEnhance","disabled","keyboardFocused","propsWithKeyboardEnhance","sstyles","sstyled","styles","cn","shade","className","style","propsForElement","Object","assign","undefined","displayName","createBaseComponent"],"sources":["../../src/Icon.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { createBaseComponent, sstyled } from '@semcore/core';\nimport { useBox } from '@semcore/flex-box';\nimport resolveColor, { shade } from '@semcore/utils/lib/color';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport propsForElement from '@semcore/utils/lib/propsForElement';\n\nimport styles from './style/icon.shadow.css';\n\nfunction Icon(props, ref) {\n const [SIcon, other] = useBox(\n {\n tag: 'svg',\n 'data-ui-name': 'Icon',\n width: 16,\n height: 16,\n viewBox: '0 0 16 16',\n ...props,\n },\n ref,\n );\n\n const { interactive, color: colorProps } = props;\n const color = resolveColor(colorProps);\n const { keyboardFocused, ...propsWithKeyboardEnhance } = keyboardFocusEnhance()({\n disabled: !interactive,\n ...other,\n });\n const sstyles = sstyled(styles);\n const { className, style } = sstyles.cn('SIcon', {\n 'color-interactive': shade(color, -0.12),\n 'use:color': color,\n interactive: interactive,\n keyboardFocused: keyboardFocused,\n });\n\n return (\n <SIcon\n {...propsForElement(propsWithKeyboardEnhance)}\n style={Object.assign({}, style, propsWithKeyboardEnhance.style, props.style)}\n className={cn(className, propsWithKeyboardEnhance.className, props.className) || undefined}\n />\n );\n}\n\nIcon.displayName = 'Icon';\n\nexport default createBaseComponent(Icon);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,IAAT,CAAcC,KAAd,EAAqBC,GAArB,EAA0B;EACxB,cAAuB,IAAAC,eAAA;IAEnBC,GAAG,EAAE,KAFc;IAGnB,gBAAgB,MAHG;IAInBC,KAAK,EAAE,EAJY;IAKnBC,MAAM,EAAE,EALW;IAMnBC,OAAO,EAAE;EANU,GAOhBN,KAPgB,GASrBC,GATqB,CAAvB;EAAA;EAAA,IAAOM,KAAP;EAAA,IAAcC,KAAd;;EAYA,IAAQC,WAAR,GAA2CT,KAA3C,CAAQS,WAAR;EAAA,IAA4BC,UAA5B,GAA2CV,KAA3C,CAAqBW,KAArB;EACA,IAAMA,KAAK,GAAG,IAAAC,iBAAA,EAAaF,UAAb,CAAd;;EACA,4BAAyD,IAAAG,iCAAA;IACvDC,QAAQ,EAAE,CAACL;EAD4C,GAEpDD,KAFoD,EAAzD;EAAA,IAAQO,eAAR,yBAAQA,eAAR;EAAA,IAA4BC,wBAA5B;;EAIA,IAAMC,OAAO,GAAG,IAAAC,aAAA,EAAQC,MAAR,CAAhB;;EACA,kBAA6BF,OAAO,CAACG,EAAR,CAAW,OAAX,EAAoB;IAC/C,qBAAqB,IAAAC,YAAA,EAAMV,KAAN,EAAa,CAAC,IAAd,CAD0B;IAE/C,aAAaA,KAFkC;IAG/CF,WAAW,EAAEA,WAHkC;IAI/CM,eAAe,EAAEA;EAJ8B,CAApB,CAA7B;EAAA,IAAQO,SAAR,eAAQA,SAAR;EAAA,IAAmBC,KAAnB,eAAmBA,KAAnB;;EAOA,oBACE,gCAAC,KAAD,gCACM,IAAAC,2BAAA,EAAgBR,wBAAhB,CADN;IAEE,KAAK,EAAES,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBH,KAAlB,EAAyBP,wBAAwB,CAACO,KAAlD,EAAyDvB,KAAK,CAACuB,KAA/D,CAFT;IAGE,SAAS,EAAE,IAAAH,sBAAA,EAAGE,SAAH,EAAcN,wBAAwB,CAACM,SAAvC,EAAkDtB,KAAK,CAACsB,SAAxD,KAAsEK;EAHnF,GADF;AAOD;;AAED5B,IAAI,CAAC6B,WAAL,GAAmB,MAAnB;;eAEe,IAAAC,yBAAA,EAAoB9B,IAApB,C"}
1
+ {"version":3,"file":"Icon.js","names":["Icon","props","ref","useBox","tag","width","height","viewBox","SIcon","other","interactive","colorProps","color","resolveColor","keyboardFocusEnhance","disabled","keyboardFocused","propsWithKeyboardEnhance","sstyles","sstyled","styles","cn","shade","className","style","onKeyDown","event","code","onClick","propsForElement","Object","assign","undefined","displayName","createBaseComponent"],"sources":["../../src/Icon.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { createBaseComponent, sstyled } from '@semcore/core';\nimport { useBox } from '@semcore/flex-box';\nimport resolveColor, { shade } from '@semcore/utils/lib/color';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport propsForElement from '@semcore/utils/lib/propsForElement';\n\nimport styles from './style/icon.shadow.css';\n\nfunction Icon(props, ref) {\n const [SIcon, other] = useBox(\n {\n tag: 'svg',\n 'data-ui-name': 'Icon',\n width: 16,\n height: 16,\n viewBox: '0 0 16 16',\n ...props,\n },\n ref,\n );\n\n const { interactive, color: colorProps } = props;\n const color = resolveColor(colorProps);\n const { keyboardFocused, ...propsWithKeyboardEnhance } = keyboardFocusEnhance()({\n disabled: !interactive,\n ...other,\n });\n const sstyles = sstyled(styles);\n const { className, style } = sstyles.cn('SIcon', {\n 'color-interactive': shade(color, -0.12),\n 'use:color': color,\n interactive: interactive,\n keyboardFocused: keyboardFocused,\n });\n\n function onKeyDown(event) {\n if (props.onKeyDown) {\n return;\n }\n\n if (event.code === 'Enter' && interactive) {\n props.onClick && props.onClick();\n }\n }\n\n return (\n <SIcon\n {...propsForElement(propsWithKeyboardEnhance)}\n style={Object.assign({}, style, propsWithKeyboardEnhance.style, props.style)}\n className={cn(className, propsWithKeyboardEnhance.className, props.className) || undefined}\n onKeyDown={onKeyDown}\n />\n );\n}\n\nIcon.displayName = 'Icon';\n\nexport default createBaseComponent(Icon);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,IAAT,CAAcC,KAAd,EAAqBC,GAArB,EAA0B;EACxB,cAAuB,IAAAC,eAAA;IAEnBC,GAAG,EAAE,KAFc;IAGnB,gBAAgB,MAHG;IAInBC,KAAK,EAAE,EAJY;IAKnBC,MAAM,EAAE,EALW;IAMnBC,OAAO,EAAE;EANU,GAOhBN,KAPgB,GASrBC,GATqB,CAAvB;EAAA;EAAA,IAAOM,KAAP;EAAA,IAAcC,KAAd;;EAYA,IAAQC,WAAR,GAA2CT,KAA3C,C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B,MAAnB;;eAEe,IAAAC,yBAAA,EAAoBlC,IAApB,C"}
package/lib/es6/Icon.js CHANGED
@@ -22,16 +22,16 @@ var styles = (
22
22
  /*__reshadow_css_start__*/
23
23
  _sstyled.insert(
24
24
  /*__inner_css_start__*/
25
- ".___SIcon_2xx8d_gg_{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;shape-rendering:geometricPrecision;box-sizing:content-box;fill:currentColor;flex-shrink:0;outline:none;color:var(--color_2xx8d)}.___SIcon_2xx8d_gg_.__keyboardFocused_2xx8d_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SIcon_2xx8d_gg_.__interactive_2xx8d_gg_{cursor:pointer}.___SIcon_2xx8d_gg_.__interactive_2xx8d_gg_:hover{color:var(--color-interactive_2xx8d)}"
25
+ ".___SIcon_65xbq_gg_{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;shape-rendering:geometricPrecision;box-sizing:content-box;fill:currentColor;flex-shrink:0;outline:none;color:var(--color_65xbq)}.___SIcon_65xbq_gg_.__keyboardFocused_65xbq_gg_{box-shadow:0 0 0 3px rgba(0, 143, 248, 0.2)}.___SIcon_65xbq_gg_.__interactive_65xbq_gg_{cursor:pointer}.___SIcon_65xbq_gg_.__interactive_65xbq_gg_:hover{color:var(--color-interactive_65xbq)}"
26
26
  /*__inner_css_end__*/
27
- , "2xx8d_gg_")
27
+ , "65xbq_gg_")
28
28
  /*__reshadow_css_end__*/
29
29
  , {
30
- "__SIcon": "___SIcon_2xx8d_gg_",
31
- "--color": "--color_2xx8d",
32
- "_keyboardFocused": "__keyboardFocused_2xx8d_gg_",
33
- "_interactive": "__interactive_2xx8d_gg_",
34
- "--color-interactive": "--color-interactive_2xx8d"
30
+ "__SIcon": "___SIcon_65xbq_gg_",
31
+ "--color": "--color_65xbq",
32
+ "_keyboardFocused": "__keyboardFocused_65xbq_gg_",
33
+ "_interactive": "__interactive_65xbq_gg_",
34
+ "--color-interactive": "--color-interactive_65xbq"
35
35
  });
36
36
 
37
37
  function Icon(props, ref) {
@@ -67,9 +67,20 @@ function Icon(props, ref) {
67
67
  className = _sstyles$cn.className,
68
68
  style = _sstyles$cn.style;
69
69
 
70
+ function onKeyDown(event) {
71
+ if (props.onKeyDown) {
72
+ return;
73
+ }
74
+
75
+ if (event.code === 'Enter' && interactive) {
76
+ props.onClick && props.onClick();
77
+ }
78
+ }
79
+
70
80
  return /*#__PURE__*/React.createElement(SIcon, _extends({}, propsForElement(propsWithKeyboardEnhance), {
71
81
  style: Object.assign({}, style, propsWithKeyboardEnhance.style, props.style),
72
- className: cn(className, propsWithKeyboardEnhance.className, props.className) || undefined
82
+ className: cn(className, propsWithKeyboardEnhance.className, props.className) || undefined,
83
+ onKeyDown: onKeyDown
73
84
  }));
74
85
  }
75
86
 
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","names":["React","cn","createBaseComponent","sstyled","useBox","resolveColor","shade","keyboardFocusEnhance","propsForElement","Icon","props","ref","tag","width","height","viewBox","SIcon","other","interactive","colorProps","color","disabled","keyboardFocused","propsWithKeyboardEnhance","sstyles","styles","className","style","Object","assign","undefined","displayName"],"sources":["../../src/Icon.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { createBaseComponent, sstyled } from '@semcore/core';\nimport { useBox } from '@semcore/flex-box';\nimport resolveColor, { shade } from '@semcore/utils/lib/color';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport propsForElement from '@semcore/utils/lib/propsForElement';\n\nimport styles from './style/icon.shadow.css';\n\nfunction Icon(props, ref) {\n const [SIcon, other] = useBox(\n {\n tag: 'svg',\n 'data-ui-name': 'Icon',\n width: 16,\n height: 16,\n viewBox: '0 0 16 16',\n ...props,\n },\n ref,\n );\n\n const { interactive, color: colorProps } = props;\n const color = resolveColor(colorProps);\n const { keyboardFocused, ...propsWithKeyboardEnhance } = keyboardFocusEnhance()({\n disabled: !interactive,\n ...other,\n });\n const sstyles = sstyled(styles);\n const { className, style } = sstyles.cn('SIcon', {\n 'color-interactive': shade(color, -0.12),\n 'use:color': color,\n interactive: interactive,\n keyboardFocused: keyboardFocused,\n });\n\n return (\n <SIcon\n {...propsForElement(propsWithKeyboardEnhance)}\n style={Object.assign({}, style, propsWithKeyboardEnhance.style, props.style)}\n className={cn(className, propsWithKeyboardEnhance.className, props.className) || undefined}\n />\n );\n}\n\nIcon.displayName = 'Icon';\n\nexport default createBaseComponent(Icon);\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,EAAP,MAAe,YAAf;AACA,SAASC,mBAAT,EAA8BC,OAA9B,QAA6C,eAA7C;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,OAAOC,YAAP,IAAuBC,KAAvB,QAAoC,0BAApC;AACA,OAAOC,oBAAP,MAAiC,kDAAjC;AACA,OAAOC,eAAP,MAA4B,oCAA5B;;;;;;;;;;;;;;;;;;;AAIA,SAASC,IAAT,CAAcC,KAAd,EAAqBC,GAArB,EAA0B;EACxB,cAAuBP,MAAM;IAEzBQ,GAAG,EAAE,KAFoB;IAGzB,gBAAgB,MAHS;IAIzBC,KAAK,EAAE,EAJkB;IAKzBC,MAAM,EAAE,EALiB;IAMzBC,OAAO,EAAE;EANgB,GAOtBL,KAPsB,GAS3BC,GAT2B,CAA7B;EAAA;EAAA,IAAOK,KAAP;EAAA,IAAcC,KAAd;;EAYA,IAAQC,WAAR,GAA2CR,KAA3C,CAAQQ,WAAR;EAAA,IAA4BC,UAA5B,GAA2CT,KAA3C,CAAqBU,KAArB;EACA,IAAMA,KAAK,GAAGf,YAAY,CAACc,UAAD,CAA1B;;EACA,4BAAyDZ,oBAAoB;IAC3Ec,QAAQ,EAAE,CAACH;EADgE,GAExED,KAFwE,EAA7E;EAAA,IAAQK,eAAR,yBAAQA,eAAR;EAAA,IAA4BC,wBAA5B;;EAIA,IAAMC,OAAO,GAAGrB,OAAO,CAACsB,MAAD,CAAvB;;EACA,kBAA6BD,OAAO,CAACvB,EAAR,CAAW,OAAX,EAAoB;IAC/C,qBAAqBK,KAAK,CAACc,KAAD,EAAQ,CAAC,IAAT,CADqB;IAE/C,aAAaA,KAFkC;IAG/CF,WAAW,EAAEA,WAHkC;IAI/CI,eAAe,EAAEA;EAJ8B,CAApB,CAA7B;EAAA,IAAQI,SAAR,eAAQA,SAAR;EAAA,IAAmBC,KAAnB,eAAmBA,KAAnB;;EAOA,oBACE,oBAAC,KAAD,eACMnB,eAAe,CAACe,wBAAD,CADrB;IAEE,KAAK,EAAEK,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBF,KAAlB,EAAyBJ,wBAAwB,CAACI,KAAlD,EAAyDjB,KAAK,CAACiB,KAA/D,CAFT;IAGE,SAAS,EAAE1B,EAAE,CAACyB,SAAD,EAAYH,wBAAwB,CAACG,SAArC,EAAgDhB,KAAK,CAACgB,SAAtD,CAAF,IAAsEI;EAHnF,GADF;AAOD;;AAEDrB,IAAI,CAACsB,WAAL,GAAmB,MAAnB;AAEA,eAAe7B,mBAAmB,CAACO,IAAD,CAAlC"}
1
+ {"version":3,"file":"Icon.js","names":["React","cn","createBaseComponent","sstyled","useBox","resolveColor","shade","keyboardFocusEnhance","propsForElement","Icon","props","ref","tag","width","height","viewBox","SIcon","other","interactive","colorProps","color","disabled","keyboardFocused","propsWithKeyboardEnhance","sstyles","styles","className","style","onKeyDown","event","code","onClick","Object","assign","undefined","displayName"],"sources":["../../src/Icon.jsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { createBaseComponent, sstyled } from '@semcore/core';\nimport { useBox } from '@semcore/flex-box';\nimport resolveColor, { shade } from '@semcore/utils/lib/color';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport propsForElement from '@semcore/utils/lib/propsForElement';\n\nimport styles from './style/icon.shadow.css';\n\nfunction Icon(props, ref) {\n const [SIcon, other] = useBox(\n {\n tag: 'svg',\n 'data-ui-name': 'Icon',\n width: 16,\n height: 16,\n viewBox: '0 0 16 16',\n ...props,\n },\n ref,\n );\n\n const { interactive, color: colorProps } = props;\n const color = resolveColor(colorProps);\n const { keyboardFocused, ...propsWithKeyboardEnhance } = keyboardFocusEnhance()({\n disabled: !interactive,\n ...other,\n });\n const sstyles = sstyled(styles);\n const { className, style } = sstyles.cn('SIcon', {\n 'color-interactive': shade(color, -0.12),\n 'use:color': color,\n interactive: interactive,\n keyboardFocused: keyboardFocused,\n });\n\n function onKeyDown(event) {\n if (props.onKeyDown) {\n return;\n }\n\n if (event.code === 'Enter' && interactive) {\n props.onClick && props.onClick();\n }\n }\n\n return (\n <SIcon\n {...propsForElement(propsWithKeyboardEnhance)}\n style={Object.assign({}, style, propsWithKeyboardEnhance.style, props.style)}\n className={cn(className, propsWithKeyboardEnhance.className, props.className) || undefined}\n onKeyDown={onKeyDown}\n />\n );\n}\n\nIcon.displayName = 'Icon';\n\nexport default createBaseComponent(Icon);\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,EAAP,MAAe,YAAf;AACA,SAASC,mBAAT,EAA8BC,OAA9B,QAA6C,eAA7C;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,OAAOC,YAAP,IAAuBC,KAAvB,QAAoC,0BAApC;AACA,OAAOC,oBAAP,MAAiC,kDAAjC;AACA,OAAOC,eAAP,MAA4B,oCAA5B;;;;;;;;;;;;;;;;;;;AAIA,SAASC,IAAT,CAAcC,KAAd,EAAqBC,GAArB,EAA0B;EACxB,cAAuBP,MAAM;IAEzBQ,GAAG,EAAE,KAFoB;IAGzB,gBAAgB,MAHS;IAIzBC,KAAK,EAAE,EAJkB;IAKzBC,MAAM,EAAE,EALiB;IAMzBC,OAAO,EAAE;EANgB,GAOtBL,KAPsB,GAS3BC,GAT2B,CAA7B;EAAA;EAAA,IAAOK,KAAP;EAAA,IAAcC,KAAd;;EAYA,IAA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B;AAEA,eAAejC,mBAAmB,CAACO,IAAD,CAAlC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/icon",
3
3
  "description": "Semrush Icon Component",
4
- "version": "2.29.5",
4
+ "version": "2.30.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",