@micromag/element-share-incentive 0.4.71 → 0.4.77

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.
Files changed (2) hide show
  1. package/es/index.js +118 -29
  2. package/package.json +10 -8
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import _objectSpread from '@babel/runtime/helpers/objectSpread2';
1
+ import { c } from 'react/compiler-runtime';
2
2
  import classNames from 'classnames';
3
3
  import { getColorAsString, getStyleFromBox } from '@micromag/core/utils';
4
4
  import Text from '@micromag/element-text';
@@ -6,35 +6,124 @@ import { jsx, jsxs } from 'react/jsx-runtime';
6
6
 
7
7
  var styles = {"box":"micromag-element-share-incentive-box","tip":"micromag-element-share-incentive-tip"};
8
8
 
9
- function ShareIncentive(_ref) {
10
- var _ref$className = _ref.className,
11
- className = _ref$className === void 0 ? null : _ref$className,
12
- _ref$label = _ref.label,
13
- label = _ref$label === void 0 ? null : _ref$label,
14
- _ref$boxStyle = _ref.boxStyle,
15
- boxStyle = _ref$boxStyle === void 0 ? null : _ref$boxStyle;
16
- var _ref2 = boxStyle || {},
17
- _ref2$backgroundColor = _ref2.backgroundColor,
18
- backgroundColor = _ref2$backgroundColor === void 0 ? null : _ref2$backgroundColor;
19
- var bgColor = getColorAsString(backgroundColor);
20
- return /*#__PURE__*/jsx("div", {
21
- className: classNames([styles.container, className]),
22
- children: /*#__PURE__*/jsxs("div", {
9
+ function ShareIncentive(t0) {
10
+ const $ = c(22);
11
+ const {
12
+ className: t1,
13
+ label: t2,
14
+ boxStyle: t3
15
+ } = t0;
16
+ const className = t1 === undefined ? null : t1;
17
+ const label = t2 === undefined ? null : t2;
18
+ const boxStyle = t3 === undefined ? null : t3;
19
+ let t4;
20
+ if ($[0] !== boxStyle) {
21
+ t4 = boxStyle || {};
22
+ $[0] = boxStyle;
23
+ $[1] = t4;
24
+ } else {
25
+ t4 = $[1];
26
+ }
27
+ const {
28
+ backgroundColor: t5
29
+ } = t4;
30
+ const backgroundColor = t5 === undefined ? null : t5;
31
+ let t6;
32
+ if ($[2] !== backgroundColor) {
33
+ t6 = getColorAsString(backgroundColor);
34
+ $[2] = backgroundColor;
35
+ $[3] = t6;
36
+ } else {
37
+ t6 = $[3];
38
+ }
39
+ const bgColor = t6;
40
+ let t7;
41
+ if ($[4] !== className) {
42
+ t7 = classNames([styles.container, className]);
43
+ $[4] = className;
44
+ $[5] = t7;
45
+ } else {
46
+ t7 = $[5];
47
+ }
48
+ let t8;
49
+ if ($[6] !== boxStyle) {
50
+ t8 = getStyleFromBox(boxStyle);
51
+ $[6] = boxStyle;
52
+ $[7] = t8;
53
+ } else {
54
+ t8 = $[7];
55
+ }
56
+ let t9;
57
+ if ($[8] !== t8) {
58
+ t9 = {
59
+ ...t8
60
+ };
61
+ $[8] = t8;
62
+ $[9] = t9;
63
+ } else {
64
+ t9 = $[9];
65
+ }
66
+ let t10;
67
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
68
+ t10 = /*#__PURE__*/jsx("polygon", {
69
+ points: "0,0 0,10 10,10"
70
+ });
71
+ $[10] = t10;
72
+ } else {
73
+ t10 = $[10];
74
+ }
75
+ let t11;
76
+ if ($[11] !== bgColor) {
77
+ t11 = /*#__PURE__*/jsx("svg", {
78
+ xmlns: "http://www.w3.org/2000/svg",
79
+ viewBox: "0 0 10 10",
80
+ className: styles.tip,
81
+ fill: bgColor,
82
+ children: t10
83
+ });
84
+ $[11] = bgColor;
85
+ $[12] = t11;
86
+ } else {
87
+ t11 = $[12];
88
+ }
89
+ let t12;
90
+ if ($[13] !== label) {
91
+ t12 = /*#__PURE__*/jsx(Text, {
92
+ className: styles.text,
93
+ ...label
94
+ });
95
+ $[13] = label;
96
+ $[14] = t12;
97
+ } else {
98
+ t12 = $[14];
99
+ }
100
+ let t13;
101
+ if ($[15] !== t11 || $[16] !== t12 || $[17] !== t9) {
102
+ t13 = /*#__PURE__*/jsxs("div", {
23
103
  className: styles.box,
24
- style: _objectSpread({}, getStyleFromBox(boxStyle)),
25
- children: [/*#__PURE__*/jsx("svg", {
26
- xmlns: "http://www.w3.org/2000/svg",
27
- viewBox: "0 0 10 10",
28
- className: styles.tip,
29
- fill: bgColor,
30
- children: /*#__PURE__*/jsx("polygon", {
31
- points: "0,0 0,10 10,10"
32
- })
33
- }), /*#__PURE__*/jsx(Text, _objectSpread({
34
- className: styles.text
35
- }, label))]
36
- })
37
- });
104
+ style: t9,
105
+ children: [t11, t12]
106
+ });
107
+ $[15] = t11;
108
+ $[16] = t12;
109
+ $[17] = t9;
110
+ $[18] = t13;
111
+ } else {
112
+ t13 = $[18];
113
+ }
114
+ let t14;
115
+ if ($[19] !== t13 || $[20] !== t7) {
116
+ t14 = /*#__PURE__*/jsx("div", {
117
+ className: t7,
118
+ children: t13
119
+ });
120
+ $[19] = t13;
121
+ $[20] = t7;
122
+ $[21] = t14;
123
+ } else {
124
+ t14 = $[21];
125
+ }
126
+ return t14;
38
127
  }
39
128
 
40
129
  export { ShareIncentive as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-share-incentive",
3
- "version": "0.4.71",
3
+ "version": "0.4.77",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -32,9 +32,11 @@
32
32
  "license": "ISC",
33
33
  "type": "module",
34
34
  "module": "es/index.js",
35
+ "style": "./assets/css/styles.css",
35
36
  "exports": {
36
37
  ".": {
37
38
  "types": "./es/index.d.ts",
39
+ "style": "./assets/css/styles.css",
38
40
  "import": "./es/index.js"
39
41
  },
40
42
  "./assets/css/styles": "./assets/css/styles.css",
@@ -51,17 +53,17 @@
51
53
  "build": "../../scripts/prepare-package.sh --types"
52
54
  },
53
55
  "devDependencies": {
54
- "react": "^18.3.0 || ^19.0.0",
55
- "react-dom": "^18.3.0 || ^19.0.0"
56
+ "react": "^19.0.0",
57
+ "react-dom": "^19.0.0"
56
58
  },
57
59
  "peerDependencies": {
58
- "react": "^18.3.0 || ^19.0.0",
59
- "react-dom": "^18.3.0 || ^19.0.0"
60
+ "react": "^19.0.0",
61
+ "react-dom": "^19.0.0"
60
62
  },
61
63
  "dependencies": {
62
64
  "@babel/runtime": "^7.28.6",
63
- "@micromag/core": "^0.4.71",
64
- "@micromag/element-text": "^0.4.71",
65
+ "@micromag/core": "^0.4.77",
66
+ "@micromag/element-text": "^0.4.77",
65
67
  "classnames": "^2.2.6",
66
68
  "react-intl": "^8.1.3 || ^10.0.0",
67
69
  "uuid": "^9.0.0"
@@ -70,6 +72,6 @@
70
72
  "access": "public",
71
73
  "registry": "https://registry.npmjs.org/"
72
74
  },
73
- "gitHead": "9101554bc5761e32b4a002a10d26800608c69773",
75
+ "gitHead": "b55c2c748383d30c8ff0ca7594e499dbdc8d1c10",
74
76
  "types": "es/index.d.ts"
75
77
  }