@micromag/element-badge 0.4.69 → 0.4.74

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 +129 -32
  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 { getStyleFromBox } from '@micromag/core/utils';
4
4
  import Text from '@micromag/element-text';
@@ -6,38 +6,135 @@ import { jsx } from 'react/jsx-runtime';
6
6
 
7
7
  var styles = {"container":"micromag-element-badge-container","label":"micromag-element-badge-label"};
8
8
 
9
- function Badge(_ref) {
10
- var _ref$label = _ref.label,
11
- label = _ref$label === void 0 ? null : _ref$label,
12
- _ref$boxStyle = _ref.boxStyle,
13
- boxStyle = _ref$boxStyle === void 0 ? null : _ref$boxStyle,
14
- _ref$className = _ref.className,
15
- className = _ref$className === void 0 ? null : _ref$className,
16
- _ref$labelClassName = _ref.labelClassName,
17
- labelClassName = _ref$labelClassName === void 0 ? null : _ref$labelClassName;
18
- var _ref2 = label || {},
19
- _ref2$textStyle = _ref2.textStyle,
20
- textStyle = _ref2$textStyle === void 0 ? null : _ref2$textStyle;
21
- var _ref3 = textStyle || {},
22
- _ref3$lineHeight = _ref3.lineHeight,
23
- lineHeight = _ref3$lineHeight === void 0 ? null : _ref3$lineHeight;
24
- var boxStyles = null;
9
+ function Badge(t0) {
10
+ const $ = c(25);
11
+ const {
12
+ label: t1,
13
+ boxStyle: t2,
14
+ className: t3,
15
+ labelClassName: t4
16
+ } = t0;
17
+ const label = t1 === undefined ? null : t1;
18
+ const boxStyle = t2 === undefined ? null : t2;
19
+ const className = t3 === undefined ? null : t3;
20
+ const labelClassName = t4 === undefined ? null : t4;
21
+ let t5;
22
+ if ($[0] !== label) {
23
+ t5 = label || {};
24
+ $[0] = label;
25
+ $[1] = t5;
26
+ } else {
27
+ t5 = $[1];
28
+ }
29
+ const {
30
+ textStyle: t6
31
+ } = t5;
32
+ const textStyle = t6 === undefined ? null : t6;
33
+ let t7;
34
+ if ($[2] !== textStyle) {
35
+ t7 = textStyle || {};
36
+ $[2] = textStyle;
37
+ $[3] = t7;
38
+ } else {
39
+ t7 = $[3];
40
+ }
41
+ const {
42
+ lineHeight: t8
43
+ } = t7;
44
+ const lineHeight = t8 === undefined ? null : t8;
45
+ let boxStyles = null;
25
46
  if (boxStyle !== null) {
26
- boxStyles = _objectSpread(_objectSpread({}, boxStyles), getStyleFromBox(boxStyle));
27
- }
28
- return /*#__PURE__*/jsx("div", {
29
- className: classNames([styles.container, className]),
30
- style: boxStyles,
31
- children: /*#__PURE__*/jsx("span", {
32
- className: classNames([styles.label, labelClassName]),
33
- children: /*#__PURE__*/jsx(Text, _objectSpread(_objectSpread({}, label), {}, {
34
- textStyle: _objectSpread(_objectSpread({}, textStyle), {}, {
35
- lineHeight: lineHeight || 1
36
- }),
37
- inline: true
38
- }))
39
- })
40
- });
47
+ let t9;
48
+ if ($[4] !== boxStyle) {
49
+ t9 = getStyleFromBox(boxStyle);
50
+ $[4] = boxStyle;
51
+ $[5] = t9;
52
+ } else {
53
+ t9 = $[5];
54
+ }
55
+ let t10;
56
+ if ($[6] !== t9) {
57
+ t10 = {
58
+ ...null,
59
+ ...t9
60
+ };
61
+ $[6] = t9;
62
+ $[7] = t10;
63
+ } else {
64
+ t10 = $[7];
65
+ }
66
+ boxStyles = t10;
67
+ }
68
+ let t9;
69
+ if ($[8] !== className) {
70
+ t9 = classNames([styles.container, className]);
71
+ $[8] = className;
72
+ $[9] = t9;
73
+ } else {
74
+ t9 = $[9];
75
+ }
76
+ const t10 = boxStyles;
77
+ let t11;
78
+ if ($[10] !== labelClassName) {
79
+ t11 = classNames([styles.label, labelClassName]);
80
+ $[10] = labelClassName;
81
+ $[11] = t11;
82
+ } else {
83
+ t11 = $[11];
84
+ }
85
+ const t12 = lineHeight || 1;
86
+ let t13;
87
+ if ($[12] !== t12 || $[13] !== textStyle) {
88
+ t13 = {
89
+ ...textStyle,
90
+ lineHeight: t12
91
+ };
92
+ $[12] = t12;
93
+ $[13] = textStyle;
94
+ $[14] = t13;
95
+ } else {
96
+ t13 = $[14];
97
+ }
98
+ let t14;
99
+ if ($[15] !== label || $[16] !== t13) {
100
+ t14 = /*#__PURE__*/jsx(Text, {
101
+ ...label,
102
+ textStyle: t13,
103
+ inline: true
104
+ });
105
+ $[15] = label;
106
+ $[16] = t13;
107
+ $[17] = t14;
108
+ } else {
109
+ t14 = $[17];
110
+ }
111
+ let t15;
112
+ if ($[18] !== t11 || $[19] !== t14) {
113
+ t15 = /*#__PURE__*/jsx("span", {
114
+ className: t11,
115
+ children: t14
116
+ });
117
+ $[18] = t11;
118
+ $[19] = t14;
119
+ $[20] = t15;
120
+ } else {
121
+ t15 = $[20];
122
+ }
123
+ let t16;
124
+ if ($[21] !== boxStyles || $[22] !== t15 || $[23] !== t9) {
125
+ t16 = /*#__PURE__*/jsx("div", {
126
+ className: t9,
127
+ style: t10,
128
+ children: t15
129
+ });
130
+ $[21] = boxStyles;
131
+ $[22] = t15;
132
+ $[23] = t9;
133
+ $[24] = t16;
134
+ } else {
135
+ t16 = $[24];
136
+ }
137
+ return t16;
41
138
  }
42
139
 
43
140
  export { Badge as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-badge",
3
- "version": "0.4.69",
3
+ "version": "0.4.74",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -28,9 +28,11 @@
28
28
  "license": "ISC",
29
29
  "type": "module",
30
30
  "module": "es/index.js",
31
+ "style": "./assets/css/styles.css",
31
32
  "exports": {
32
33
  ".": {
33
34
  "types": "./es/index.d.ts",
35
+ "style": "./assets/css/styles.css",
34
36
  "import": "./es/index.js"
35
37
  },
36
38
  "./assets/css/styles": "./assets/css/styles.css",
@@ -47,17 +49,17 @@
47
49
  "build": "../../scripts/prepare-package.sh --types"
48
50
  },
49
51
  "devDependencies": {
50
- "react": "^18.3.0 || ^19.0.0",
51
- "react-dom": "^18.3.0 || ^19.0.0"
52
+ "react": "^19.0.0",
53
+ "react-dom": "^19.0.0"
52
54
  },
53
55
  "peerDependencies": {
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
  "dependencies": {
58
60
  "@babel/runtime": "^7.28.6",
59
- "@micromag/core": "^0.4.69",
60
- "@micromag/element-text": "^0.4.69",
61
+ "@micromag/core": "^0.4.74",
62
+ "@micromag/element-text": "^0.4.74",
61
63
  "classnames": "^2.2.6",
62
64
  "lodash": "^4.17.23",
63
65
  "react-intl": "^8.1.3 || ^10.0.0",
@@ -67,6 +69,6 @@
67
69
  "access": "public",
68
70
  "registry": "https://registry.npmjs.org/"
69
71
  },
70
- "gitHead": "509e113dc06022d6092e4aac9f47ccd5facfd59d",
72
+ "gitHead": "fe510ee87845280d0760cb292aef9d2eb69e67c1",
71
73
  "types": "es/index.d.ts"
72
74
  }