@searchspring/snap-preact-components 0.63.0 → 0.63.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AA6B5D,eAAO,MAAM,QAAQ,eAAyB,aAAa,KAAG,WAiG5D,CAAC;AAKH,MAAM,WAAW,aAAc,SAAQ,cAAc;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,GAAG,eAAe,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACxF,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB"}
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AA4B5D,eAAO,MAAM,QAAQ,eAAyB,aAAa,KAAG,WAmG5D,CAAC;AAKH,MAAM,WAAW,aAAc,SAAQ,cAAc;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,GAAG,eAAe,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACxF,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -27,21 +27,20 @@ var CSS = {
27
27
  checkbox: function (_a) {
28
28
  var _b;
29
29
  var size = _a.size, color = _a.color, theme = _a.theme;
30
- var pixelSize = isNaN(Number(size)) ? size : "".concat(size, "px");
31
30
  return (0, react_1.css)({
32
31
  display: 'inline-flex',
33
32
  alignItems: 'center',
34
33
  justifyContent: 'center',
35
- height: pixelSize,
36
- width: pixelSize,
34
+ height: size,
35
+ width: size,
37
36
  border: "1px solid ".concat(color || ((_b = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _b === void 0 ? void 0 : _b.primary) || '#333'),
38
37
  '&.ss__checkbox--disabled': {
39
38
  opacity: 0.7,
40
39
  },
41
40
  '& .ss__checkbox__empty': {
42
41
  display: 'inline-block',
43
- width: "calc(".concat(pixelSize, " - 30%)"),
44
- height: "calc(".concat(pixelSize, " - 30%)"),
42
+ width: "calc(".concat(size, " - 30%)"),
43
+ height: "calc(".concat(size, " - 30%)"),
45
44
  },
46
45
  });
47
46
  },
@@ -56,6 +55,7 @@ exports.Checkbox = (0, mobx_react_1.observer)(function (properties) {
56
55
  // default props
57
56
  size: '12px', startChecked: false, disableA11y: false }, (_b = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _b === void 0 ? void 0 : _b.checkbox), properties), (_d = (_c = properties.theme) === null || _c === void 0 ? void 0 : _c.components) === null || _d === void 0 ? void 0 : _d.checkbox);
58
57
  var checked = props.checked, color = props.color, disabled = props.disabled, icon = props.icon, iconColor = props.iconColor, onClick = props.onClick, size = props.size, startChecked = props.startChecked, native = props.native, disableA11y = props.disableA11y, disableStyles = props.disableStyles, className = props.className, style = props.style;
58
+ var pixelSize = isNaN(Number(size)) ? size : "".concat(size, "px");
59
59
  var subProps = {
60
60
  icon: __assign(__assign(__assign({
61
61
  // default props
@@ -63,7 +63,7 @@ exports.Checkbox = (0, mobx_react_1.observer)(function (properties) {
63
63
  color: iconColor || color || ((_f = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _f === void 0 ? void 0 : _f.primary),
64
64
  disableStyles: disableStyles,
65
65
  icon: icon,
66
- size: size && "calc(".concat(size, " - 30%)"),
66
+ size: pixelSize && "calc(".concat(pixelSize, " - 30%)"),
67
67
  })), {
68
68
  // component theme overrides
69
69
  theme: props.theme }),
@@ -93,7 +93,7 @@ exports.Checkbox = (0, mobx_react_1.observer)(function (properties) {
93
93
  styling.css = [CSS.native(), style];
94
94
  }
95
95
  else {
96
- styling.css = [CSS.checkbox({ size: size, color: color, theme: theme }), style];
96
+ styling.css = [CSS.checkbox({ size: pixelSize, color: color, theme: theme }), style];
97
97
  }
98
98
  }
99
99
  else if (style) {
@@ -34,7 +34,7 @@ exports.BundleSelector = (0, mobx_react_1.observer)(function (properties) {
34
34
  className: 'ss__recommendation-bundle__wrapper__selector__icon', size: 15 }, (_a = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _a === void 0 ? void 0 : _a.icon), {
35
35
  // component theme overrides
36
36
  theme: props === null || props === void 0 ? void 0 : props.theme }),
37
- checkbox: __assign(__assign({ className: 'ss__recommendation-bundle__wrapper__selector__result-wrapper__checkbox', checked: checked, size: 18, onClick: onCheck }, (_b = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _b === void 0 ? void 0 : _b.checkbox), {
37
+ checkbox: __assign(__assign({ className: 'ss__recommendation-bundle__wrapper__selector__result-wrapper__checkbox', checked: checked, size: '18px', onClick: onCheck }, (_b = globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.components) === null || _b === void 0 ? void 0 : _b.checkbox), {
38
38
  // component theme overrides
39
39
  theme: props === null || props === void 0 ? void 0 : props.theme }),
40
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AA6B5D,eAAO,MAAM,QAAQ,eAAyB,aAAa,KAAG,WAiG5D,CAAC;AAKH,MAAM,WAAW,aAAc,SAAQ,cAAc;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,GAAG,eAAe,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACxF,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB"}
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/Molecules/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AA4B5D,eAAO,MAAM,QAAQ,eAAyB,aAAa,KAAG,WAmG5D,CAAC;AAKH,MAAM,WAAW,aAAc,SAAQ,cAAc;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,GAAG,eAAe,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACxF,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -8,21 +8,20 @@ import { Icon } from '../../Atoms/Icon';
8
8
  import { useA11y } from '../../../hooks/useA11y';
9
9
  const CSS = {
10
10
  checkbox: ({ size, color, theme }) => {
11
- const pixelSize = isNaN(Number(size)) ? size : `${size}px`;
12
11
  return css({
13
12
  display: 'inline-flex',
14
13
  alignItems: 'center',
15
14
  justifyContent: 'center',
16
- height: pixelSize,
17
- width: pixelSize,
15
+ height: size,
16
+ width: size,
18
17
  border: `1px solid ${color || theme?.colors?.primary || '#333'}`,
19
18
  '&.ss__checkbox--disabled': {
20
19
  opacity: 0.7,
21
20
  },
22
21
  '& .ss__checkbox__empty': {
23
22
  display: 'inline-block',
24
- width: `calc(${pixelSize} - 30%)`,
25
- height: `calc(${pixelSize} - 30%)`,
23
+ width: `calc(${size} - 30%)`,
24
+ height: `calc(${size} - 30%)`,
26
25
  },
27
26
  });
28
27
  },
@@ -43,6 +42,7 @@ export const Checkbox = observer((properties) => {
43
42
  ...properties.theme?.components?.checkbox,
44
43
  };
45
44
  const { checked, color, disabled, icon, iconColor, onClick, size, startChecked, native, disableA11y, disableStyles, className, style } = props;
45
+ const pixelSize = isNaN(Number(size)) ? size : `${size}px`;
46
46
  const subProps = {
47
47
  icon: {
48
48
  // default props
@@ -55,7 +55,7 @@ export const Checkbox = observer((properties) => {
55
55
  color: iconColor || color || theme?.colors?.primary,
56
56
  disableStyles,
57
57
  icon,
58
- size: size && `calc(${size} - 30%)`,
58
+ size: pixelSize && `calc(${pixelSize} - 30%)`,
59
59
  }),
60
60
  // component theme overrides
61
61
  theme: props.theme,
@@ -86,7 +86,7 @@ export const Checkbox = observer((properties) => {
86
86
  styling.css = [CSS.native(), style];
87
87
  }
88
88
  else {
89
- styling.css = [CSS.checkbox({ size, color, theme }), style];
89
+ styling.css = [CSS.checkbox({ size: pixelSize, color, theme }), style];
90
90
  }
91
91
  }
92
92
  else if (style) {
@@ -26,7 +26,7 @@ export const BundleSelector = observer((properties) => {
26
26
  checkbox: {
27
27
  className: 'ss__recommendation-bundle__wrapper__selector__result-wrapper__checkbox',
28
28
  checked: checked,
29
- size: 18,
29
+ size: '18px',
30
30
  onClick: onCheck,
31
31
  // global theme
32
32
  ...globalTheme?.components?.checkbox,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@searchspring/snap-preact-components",
3
- "version": "0.63.0",
3
+ "version": "0.63.2",
4
4
  "description": "Snap Preact Component Library",
5
5
  "author": "Searchspring",
6
6
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "@cypress/react": "^8.0.0",
31
31
  "@emotion/react": "11.9.0",
32
- "@searchspring/snap-toolbox": "^0.63.0",
32
+ "@searchspring/snap-toolbox": "^0.63.2",
33
33
  "classnames": "^2.3.2",
34
34
  "cypress": "^13.7.1",
35
35
  "cypress-wait-until": "^1.7.2",
@@ -52,14 +52,14 @@
52
52
  "@babel/preset-env": "^7.21.4",
53
53
  "@babel/preset-react": "^7.18.6",
54
54
  "@babel/runtime": "^7.21.0",
55
- "@searchspring/snap-client": "^0.63.0",
56
- "@searchspring/snap-controller": "^0.63.0",
57
- "@searchspring/snap-event-manager": "^0.63.0",
58
- "@searchspring/snap-logger": "^0.63.0",
59
- "@searchspring/snap-profiler": "^0.63.0",
60
- "@searchspring/snap-store-mobx": "^0.63.0",
61
- "@searchspring/snap-tracker": "^0.63.0",
62
- "@searchspring/snap-url-manager": "^0.63.0",
55
+ "@searchspring/snap-client": "^0.63.2",
56
+ "@searchspring/snap-controller": "^0.63.2",
57
+ "@searchspring/snap-event-manager": "^0.63.2",
58
+ "@searchspring/snap-logger": "^0.63.2",
59
+ "@searchspring/snap-profiler": "^0.63.2",
60
+ "@searchspring/snap-store-mobx": "^0.63.2",
61
+ "@searchspring/snap-tracker": "^0.63.2",
62
+ "@searchspring/snap-url-manager": "^0.63.2",
63
63
  "@storybook/addon-actions": "6.4.22",
64
64
  "@storybook/addon-controls": "6.4.22",
65
65
  "@storybook/addon-docs": "6.4.22",
@@ -84,5 +84,5 @@
84
84
  "webpack-merge": "^5.8.0"
85
85
  },
86
86
  "sideEffects": false,
87
- "gitHead": "46278e19380f22e90fdff4afc01359be27feb5a8"
87
+ "gitHead": "e0cbff5ebba37135d0ead609f6dc4b4b8db48916"
88
88
  }