@micromag/element-keypad 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 +106 -38
  2. package/package.json +9 -7
package/es/index.js CHANGED
@@ -1,47 +1,115 @@
1
- import _objectSpread from '@babel/runtime/helpers/objectSpread2';
1
+ import { c } from 'react/compiler-runtime';
2
2
  import classNames from 'classnames';
3
3
  import { getStyleFromAlignment } from '@micromag/core/utils';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
6
  var styles = {"inner":"micromag-element-keypad-inner"};
7
7
 
8
- function Keypad(_ref) {
9
- var _ref$items = _ref.items,
10
- items = _ref$items === void 0 ? null : _ref$items,
11
- _ref$align = _ref.align,
12
- align = _ref$align === void 0 ? null : _ref$align,
13
- _ref$columns = _ref.columns,
14
- columns = _ref$columns === void 0 ? 1 : _ref$columns,
15
- _ref$spacing = _ref.spacing,
16
- spacing = _ref$spacing === void 0 ? 10 : _ref$spacing,
17
- _ref$className = _ref.className,
18
- className = _ref$className === void 0 ? null : _ref$className,
19
- _ref$itemClassName = _ref.itemClassName,
20
- itemClassName = _ref$itemClassName === void 0 ? null : _ref$itemClassName,
21
- _ref$innerClassName = _ref.innerClassName,
22
- innerClassName = _ref$innerClassName === void 0 ? null : _ref$innerClassName;
23
- var itemWidth = "".concat(100 / columns, "%");
24
- return /*#__PURE__*/jsx("div", {
25
- className: classNames([styles.container, className]),
26
- children: /*#__PURE__*/jsx("div", {
27
- className: classNames([styles.inner, innerClassName]),
28
- style: _objectSpread({}, getStyleFromAlignment({
29
- horizontal: align
30
- })),
31
- children: items !== null ? items.map(function (item) {
32
- var _ref2 = item || {},
33
- key = _ref2.key;
34
- return /*#__PURE__*/jsx("div", {
35
- className: classNames([styles.item, itemClassName]),
36
- style: {
37
- width: itemWidth,
38
- padding: spacing / 2
39
- },
40
- children: item
41
- }, key);
42
- }) : null
43
- })
44
- });
8
+ function Keypad(t0) {
9
+ const $ = c(20);
10
+ const {
11
+ items: t1,
12
+ align: t2,
13
+ columns: t3,
14
+ spacing: t4,
15
+ className: t5,
16
+ itemClassName: t6,
17
+ innerClassName: t7
18
+ } = t0;
19
+ const items = t1 === undefined ? null : t1;
20
+ const align = t2 === undefined ? null : t2;
21
+ const columns = t3 === undefined ? 1 : t3;
22
+ const spacing = t4 === undefined ? 10 : t4;
23
+ const className = t5 === undefined ? null : t5;
24
+ const itemClassName = t6 === undefined ? null : t6;
25
+ const innerClassName = t7 === undefined ? null : t7;
26
+ const itemWidth = `${100 / columns}%`;
27
+ let t8;
28
+ if ($[0] !== className) {
29
+ t8 = classNames([styles.container, className]);
30
+ $[0] = className;
31
+ $[1] = t8;
32
+ } else {
33
+ t8 = $[1];
34
+ }
35
+ let t9;
36
+ if ($[2] !== innerClassName) {
37
+ t9 = classNames([styles.inner, innerClassName]);
38
+ $[2] = innerClassName;
39
+ $[3] = t9;
40
+ } else {
41
+ t9 = $[3];
42
+ }
43
+ let t10;
44
+ if ($[4] !== align) {
45
+ t10 = getStyleFromAlignment({
46
+ horizontal: align
47
+ });
48
+ $[4] = align;
49
+ $[5] = t10;
50
+ } else {
51
+ t10 = $[5];
52
+ }
53
+ let t11;
54
+ if ($[6] !== t10) {
55
+ t11 = {
56
+ ...t10
57
+ };
58
+ $[6] = t10;
59
+ $[7] = t11;
60
+ } else {
61
+ t11 = $[7];
62
+ }
63
+ let t12;
64
+ if ($[8] !== itemClassName || $[9] !== itemWidth || $[10] !== items || $[11] !== spacing) {
65
+ t12 = items !== null ? items.map(item => {
66
+ const {
67
+ key
68
+ } = item || {};
69
+ return /*#__PURE__*/jsx("div", {
70
+ className: classNames([styles.item, itemClassName]),
71
+ style: {
72
+ width: itemWidth,
73
+ padding: spacing / 2
74
+ },
75
+ children: item
76
+ }, key);
77
+ }) : null;
78
+ $[8] = itemClassName;
79
+ $[9] = itemWidth;
80
+ $[10] = items;
81
+ $[11] = spacing;
82
+ $[12] = t12;
83
+ } else {
84
+ t12 = $[12];
85
+ }
86
+ let t13;
87
+ if ($[13] !== t11 || $[14] !== t12 || $[15] !== t9) {
88
+ t13 = /*#__PURE__*/jsx("div", {
89
+ className: t9,
90
+ style: t11,
91
+ children: t12
92
+ });
93
+ $[13] = t11;
94
+ $[14] = t12;
95
+ $[15] = t9;
96
+ $[16] = t13;
97
+ } else {
98
+ t13 = $[16];
99
+ }
100
+ let t14;
101
+ if ($[17] !== t13 || $[18] !== t8) {
102
+ t14 = /*#__PURE__*/jsx("div", {
103
+ className: t8,
104
+ children: t13
105
+ });
106
+ $[17] = t13;
107
+ $[18] = t8;
108
+ $[19] = t14;
109
+ } else {
110
+ t14 = $[19];
111
+ }
112
+ return t14;
45
113
  }
46
114
 
47
115
  export { Keypad as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-keypad",
3
- "version": "0.4.69",
3
+ "version": "0.4.74",
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,16 +53,16 @@
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.69",
65
+ "@micromag/core": "^0.4.74",
64
66
  "classnames": "^2.2.6",
65
67
  "lodash": "^4.17.23",
66
68
  "react-intl": "^8.1.3 || ^10.0.0",
@@ -70,6 +72,6 @@
70
72
  "access": "public",
71
73
  "registry": "https://registry.npmjs.org/"
72
74
  },
73
- "gitHead": "509e113dc06022d6092e4aac9f47ccd5facfd59d",
75
+ "gitHead": "fe510ee87845280d0760cb292aef9d2eb69e67c1",
74
76
  "types": "es/index.d.ts"
75
77
  }