@citygross/components 0.8.97 → 0.8.98

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.
@@ -2,14 +2,14 @@ import React from 'react';
2
2
  import { TRadioColor } from '../FormElements/Radio/Radio';
3
3
  import * as styles from './RadioBoxItem.styles';
4
4
  export declare type TRadioBox = styles.TBaseRadioBox & {
5
- children: React.ReactNode;
6
- radioColor?: keyof TRadioColor;
7
- name: string;
8
- setActive?: () => void;
9
5
  background?: string;
10
6
  border?: string;
7
+ children: React.ReactNode;
8
+ hideRadioButton?: boolean;
11
9
  flexDirection?: string;
10
+ name: string;
11
+ radioColor?: keyof TRadioColor;
12
12
  padding?: number;
13
- hideRadioButton?: boolean;
13
+ setActive?: () => void;
14
14
  };
15
- export declare function RadioBoxItem({ radioColor, checked, isDisabled, name, align, setActive, background, border, boxShadow, children, flexDirection, padding, hideRadioButton }: TRadioBox): JSX.Element;
15
+ export declare const RadioBoxItem: ({ align, background, border, boxShadow, checked, children, hideRadioButton, flexDirection, isDisabled, name, padding, radioColor, setActive }: TRadioBox) => JSX.Element;
@@ -11,13 +11,21 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
11
11
 
12
12
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
13
 
14
- function RadioBoxItem(_a) {
14
+ var RadioBoxItem = function (_a) {
15
15
  var _b, _c, _d;
16
- var _e = _a.radioColor, radioColor = _e === void 0 ? 'alertGreen' : _e, checked = _a.checked, isDisabled = _a.isDisabled, name = _a.name, _f = _a.align, align = _f === void 0 ? 'flex-start' : _f, setActive = _a.setActive, _g = _a.background, background = _g === void 0 ? (_b = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.white : _g, _h = _a.border, border = _h === void 0 ? (_c = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.border : _h, _j = _a.boxShadow, boxShadow = _j === void 0 ? true : _j, children = _a.children, flexDirection = _a.flexDirection, _k = _a.padding, padding = _k === void 0 ? (_d = designTokens.theme.spacings) === null || _d === void 0 ? void 0 : _d.md : _k, _l = _a.hideRadioButton, hideRadioButton = _l === void 0 ? false : _l;
17
- return (React__default["default"].createElement(RadioBoxItem_styles.BaseRadioBox, { align: align, checked: checked, isDisabled: isDisabled, onClick: !isDisabled ? setActive : function () { }, background: background, border: border, boxShadow: boxShadow, flexDirection: flexDirection, padding: padding },
18
- !hideRadioButton && React__default["default"].createElement(Radio.Radio, { customColor: radioColor, checked: checked, disabled: isDisabled, name: name, onChange: function () { return setActive; } }),
16
+ var _e = _a.align, align = _e === void 0 ? 'flex-start' : _e, _f = _a.background, background = _f === void 0 ? (_b = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.white : _f, _g = _a.border, border = _g === void 0 ? (_c = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.border : _g, _h = _a.boxShadow, boxShadow = _h === void 0 ? true : _h, checked = _a.checked, children = _a.children, _j = _a.hideRadioButton, hideRadioButton = _j === void 0 ? false : _j, flexDirection = _a.flexDirection, isDisabled = _a.isDisabled, name = _a.name, _k = _a.padding, padding = _k === void 0 ? (_d = designTokens.theme.spacings) === null || _d === void 0 ? void 0 : _d.md : _k, _l = _a.radioColor, radioColor = _l === void 0 ? 'alertGreen' : _l, setActive = _a.setActive;
17
+ return (React__default["default"].createElement(RadioBoxItem_styles.BaseRadioBox, { align: align, "aria-checked": checked, background: background, border: border, boxShadow: boxShadow, checked: checked, flexDirection: flexDirection, isDisabled: isDisabled, onClick: !isDisabled ? setActive : undefined, onKeyDown: !isDisabled && setActive
18
+ ? function (e) {
19
+ if (e.key === 'Enter' || e.key === ' ') {
20
+ if (e.key === ' ')
21
+ e.preventDefault();
22
+ setActive();
23
+ }
24
+ }
25
+ : undefined, padding: padding, role: "radio", tabIndex: 0 },
26
+ !hideRadioButton && (React__default["default"].createElement(Radio.Radio, { checked: checked, customColor: radioColor, disabled: isDisabled, name: name, onChange: setActive !== null && setActive !== void 0 ? setActive : undefined })),
19
27
  children));
20
- }
28
+ };
21
29
 
22
30
  exports.RadioBoxItem = RadioBoxItem;
23
31
  //# sourceMappingURL=RadioBoxItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioBoxItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"RadioBoxItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,13 +3,21 @@ import { theme } from '@citygross/design-tokens';
3
3
  import { Radio } from '../FormElements/Radio/Radio.js';
4
4
  import { BaseRadioBox } from './RadioBoxItem.styles.js';
5
5
 
6
- function RadioBoxItem(_a) {
6
+ var RadioBoxItem = function (_a) {
7
7
  var _b, _c, _d;
8
- var _e = _a.radioColor, radioColor = _e === void 0 ? 'alertGreen' : _e, checked = _a.checked, isDisabled = _a.isDisabled, name = _a.name, _f = _a.align, align = _f === void 0 ? 'flex-start' : _f, setActive = _a.setActive, _g = _a.background, background = _g === void 0 ? (_b = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _b === void 0 ? void 0 : _b.white : _g, _h = _a.border, border = _h === void 0 ? (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.border : _h, _j = _a.boxShadow, boxShadow = _j === void 0 ? true : _j, children = _a.children, flexDirection = _a.flexDirection, _k = _a.padding, padding = _k === void 0 ? (_d = theme.spacings) === null || _d === void 0 ? void 0 : _d.md : _k, _l = _a.hideRadioButton, hideRadioButton = _l === void 0 ? false : _l;
9
- return (React.createElement(BaseRadioBox, { align: align, checked: checked, isDisabled: isDisabled, onClick: !isDisabled ? setActive : function () { }, background: background, border: border, boxShadow: boxShadow, flexDirection: flexDirection, padding: padding },
10
- !hideRadioButton && React.createElement(Radio, { customColor: radioColor, checked: checked, disabled: isDisabled, name: name, onChange: function () { return setActive; } }),
8
+ var _e = _a.align, align = _e === void 0 ? 'flex-start' : _e, _f = _a.background, background = _f === void 0 ? (_b = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _b === void 0 ? void 0 : _b.white : _f, _g = _a.border, border = _g === void 0 ? (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.border : _g, _h = _a.boxShadow, boxShadow = _h === void 0 ? true : _h, checked = _a.checked, children = _a.children, _j = _a.hideRadioButton, hideRadioButton = _j === void 0 ? false : _j, flexDirection = _a.flexDirection, isDisabled = _a.isDisabled, name = _a.name, _k = _a.padding, padding = _k === void 0 ? (_d = theme.spacings) === null || _d === void 0 ? void 0 : _d.md : _k, _l = _a.radioColor, radioColor = _l === void 0 ? 'alertGreen' : _l, setActive = _a.setActive;
9
+ return (React.createElement(BaseRadioBox, { align: align, "aria-checked": checked, background: background, border: border, boxShadow: boxShadow, checked: checked, flexDirection: flexDirection, isDisabled: isDisabled, onClick: !isDisabled ? setActive : undefined, onKeyDown: !isDisabled && setActive
10
+ ? function (e) {
11
+ if (e.key === 'Enter' || e.key === ' ') {
12
+ if (e.key === ' ')
13
+ e.preventDefault();
14
+ setActive();
15
+ }
16
+ }
17
+ : undefined, padding: padding, role: "radio", tabIndex: 0 },
18
+ !hideRadioButton && (React.createElement(Radio, { checked: checked, customColor: radioColor, disabled: isDisabled, name: name, onChange: setActive !== null && setActive !== void 0 ? setActive : undefined })),
11
19
  children));
12
- }
20
+ };
13
21
 
14
22
  export { RadioBoxItem };
15
23
  //# sourceMappingURL=RadioBoxItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioBoxItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"RadioBoxItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.8.97",
3
+ "version": "0.8.98",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -76,5 +76,5 @@
76
76
  "react-slick": "^0.30.1",
77
77
  "slick-carousel": "^1.8.1"
78
78
  },
79
- "gitHead": "4644ac1270bec4117344df0e2c7e88d1bbf3b65d"
79
+ "gitHead": "8bbb9d2dba82e657408150305de3e4ab39aa1aa8"
80
80
  }