@citygross/components 0.8.148 → 0.8.149

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,6 +1,7 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  export declare type TRadio = {
3
+ hideRadioButton?: boolean;
3
4
  label: string;
4
5
  showLabel?: boolean;
5
6
  } & InputHTMLAttributes<HTMLInputElement>;
6
- export declare const Radio: ({ label, showLabel, ...props }: TRadio) => JSX.Element;
7
+ export declare const Radio: ({ hideRadioButton, label, showLabel, ...props }: TRadio) => JSX.Element;
@@ -15,10 +15,13 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
15
15
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
16
 
17
17
  var Radio = function (_a) {
18
- var label = _a.label, showLabel = _a.showLabel, props = _tslib.__rest(_a, ["label", "showLabel"]);
18
+ var hideRadioButton = _a.hideRadioButton, label = _a.label, showLabel = _a.showLabel, props = _tslib.__rest(_a, ["hideRadioButton", "label", "showLabel"]);
19
19
  var checked = props.checked, disabled = props.disabled;
20
20
  var borderSize = formElement.getBorderSize(checked, disabled);
21
21
  var _b = formElement.getColorAttributes(checked, disabled, true), labelColor = _b.labelColor, attributes = _tslib.__rest(_b, ["labelColor"]);
22
+ if (hideRadioButton) {
23
+ return React__default["default"].createElement(FormElement_styles.HiddenInput, _tslib.__assign({ type: "radio" }, props));
24
+ }
22
25
  return (React__default["default"].createElement(FormElement_styles.OptionInputWrapper, { as: "label", disabled: disabled },
23
26
  React__default["default"].createElement(FormElement_styles.HiddenInput, _tslib.__assign({ type: "radio" }, props)),
24
27
  React__default["default"].createElement(Radio_styles.RadioContainer, { attributes: attributes, borderSize: borderSize, checked: checked, disabled: disabled }),
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Radio.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -16,7 +16,7 @@ var RadioBoxItem = function (_a) {
16
16
  var _e = _a.align, align = _e === void 0 ? 'flex-start' : _e, ariaLabel = _a.ariaLabel, _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, id = _a.id, 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, setActive = _a.setActive;
17
17
  return (React__default["default"].createElement(RadioBoxItem_styles.RadioBoxWrapper, { disabled: isDisabled },
18
18
  React__default["default"].createElement(RadioBoxItem_styles.BaseRadioBox, { align: align, background: background, border: border, boxShadow: boxShadow, checked: checked, flexDirection: flexDirection, isDisabled: isDisabled, padding: padding },
19
- !hideRadioButton && (React__default["default"].createElement(Radio.Radio, { checked: checked, disabled: isDisabled, id: id, label: ariaLabel, name: name, onChange: setActive !== null && setActive !== void 0 ? setActive : undefined })),
19
+ React__default["default"].createElement(Radio.Radio, { checked: checked, disabled: isDisabled, hideRadioButton: hideRadioButton, id: id, label: ariaLabel, name: name, onChange: setActive !== null && setActive !== void 0 ? setActive : undefined }),
20
20
  React__default["default"].createElement(RadioBoxItem_styles.RadioBoxLabel, { htmlFor: id }, children))));
21
21
  };
22
22
 
@@ -4,13 +4,16 @@ import { ScreenReader } from '../../ScreenReader/ScreenReader.js';
4
4
  import { BodyText, TextTypes } from '@citygross/typography';
5
5
  import { getColorAttributes, getBorderSize } from '../../../helpers/form-element.js';
6
6
  import { RadioContainer } from './Radio.styles.js';
7
- import { OptionInputWrapper, HiddenInput } from '../FormElement.styles.js';
7
+ import { HiddenInput, OptionInputWrapper } from '../FormElement.styles.js';
8
8
 
9
9
  var Radio = function (_a) {
10
- var label = _a.label, showLabel = _a.showLabel, props = __rest(_a, ["label", "showLabel"]);
10
+ var hideRadioButton = _a.hideRadioButton, label = _a.label, showLabel = _a.showLabel, props = __rest(_a, ["hideRadioButton", "label", "showLabel"]);
11
11
  var checked = props.checked, disabled = props.disabled;
12
12
  var borderSize = getBorderSize(checked, disabled);
13
13
  var _b = getColorAttributes(checked, disabled, true), labelColor = _b.labelColor, attributes = __rest(_b, ["labelColor"]);
14
+ if (hideRadioButton) {
15
+ return React.createElement(HiddenInput, __assign({ type: "radio" }, props));
16
+ }
14
17
  return (React.createElement(OptionInputWrapper, { as: "label", disabled: disabled },
15
18
  React.createElement(HiddenInput, __assign({ type: "radio" }, props)),
16
19
  React.createElement(RadioContainer, { attributes: attributes, borderSize: borderSize, checked: checked, disabled: disabled }),
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Radio.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -8,7 +8,7 @@ var RadioBoxItem = function (_a) {
8
8
  var _e = _a.align, align = _e === void 0 ? 'flex-start' : _e, ariaLabel = _a.ariaLabel, _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, id = _a.id, 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, setActive = _a.setActive;
9
9
  return (React.createElement(RadioBoxWrapper, { disabled: isDisabled },
10
10
  React.createElement(BaseRadioBox, { align: align, background: background, border: border, boxShadow: boxShadow, checked: checked, flexDirection: flexDirection, isDisabled: isDisabled, padding: padding },
11
- !hideRadioButton && (React.createElement(Radio, { checked: checked, disabled: isDisabled, id: id, label: ariaLabel, name: name, onChange: setActive !== null && setActive !== void 0 ? setActive : undefined })),
11
+ React.createElement(Radio, { checked: checked, disabled: isDisabled, hideRadioButton: hideRadioButton, id: id, label: ariaLabel, name: name, onChange: setActive !== null && setActive !== void 0 ? setActive : undefined }),
12
12
  React.createElement(RadioBoxLabel, { htmlFor: id }, children))));
13
13
  };
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.8.148",
3
+ "version": "0.8.149",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -74,5 +74,5 @@
74
74
  "react-slick": "^0.30.1",
75
75
  "slick-carousel": "^1.8.1"
76
76
  },
77
- "gitHead": "a0129a936899683ac110fb67b51694695e9c0dc3"
77
+ "gitHead": "d5bed235b25278ed25df5511b658c02073f4b18b"
78
78
  }