@citygross/components 0.8.97 → 0.8.99

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;
@@ -20,7 +20,7 @@ function Header(_a) {
20
20
  var logOut = _a.logOut, logOutLabel = _a.logOutLabel, _d = _a.topLinkHref, topLinkHref = _d === void 0 ? '/' : _d, topLinkLabel = _a.topLinkLabel, logoImage = _a.logoImage, _e = _a.lowerContainerMaxWidth, lowerContainerMaxWidth = _e === void 0 ? (_b = designTokens.theme.constants) === null || _b === void 0 ? void 0 : _b.pageContentMaxWidth : _e, children = _a.children;
21
21
  var device = utils.useDetectDevice();
22
22
  return (React__default["default"].createElement(Header_styles.Wrapper, null,
23
- topLinkLabel && topLinkHref && (React__default["default"].createElement(HeaderLink.HeaderLink, { linkHref: topLinkHref, icon: React__default["default"].createElement(icons.Icons.ChevronLeft, { width: 20, height: 20, color: (_c = designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.white }), linkLabel: topLinkLabel })),
23
+ topLinkLabel && topLinkHref && (React__default["default"].createElement(HeaderLink.HeaderLink, { icon: React__default["default"].createElement(icons.Icons.ChevronLeft, { width: 20, height: 20, color: (_c = designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.white }), linkHref: topLinkHref, linkLabel: topLinkLabel })),
24
24
  (logoImage || logOutLabel) && (React__default["default"].createElement(Header_styles.HeaderWrapper, null,
25
25
  React__default["default"].createElement(Header_styles.HeaderContainer, { maxWidth: lowerContainerMaxWidth },
26
26
  logoImage && React__default["default"].createElement(Logo.Logo, { logoImage: logoImage }),
@@ -28,10 +28,10 @@ exports.ELinkVariant = void 0;
28
28
  ELinkVariant["TERTIARY"] = "tertiary";
29
29
  })(exports.ELinkVariant || (exports.ELinkVariant = {}));
30
30
  function Link(_a) {
31
- var asButton = _a.asButton, borderRadius = _a.borderRadius, children = _a.children, hrefPath = _a.hrefPath, icon = _a.icon, _b = _a.inverted, inverted = _b === void 0 ? false : _b, isDisabled = _a.isDisabled, noWrap = _a.noWrap, onClick = _a.onClick, _c = _a.size, size = _c === void 0 ? typography.TextTypes.TextSize.REGULAR : _c, _d = _a.target, target = _d === void 0 ? '_self' : _d, _e = _a.tabIndex, tabIndex = _e === void 0 ? 0 : _e, _f = _a.variant, variant = _f === void 0 ? exports.ELinkVariant.PRIMARY : _f, props = _tslib.__rest(_a, ["asButton", "borderRadius", "children", "hrefPath", "icon", "inverted", "isDisabled", "noWrap", "onClick", "size", "target", "tabIndex", "variant"]);
32
- return asButton ? (React__default["default"].createElement(Link_styles.LinkAsButton, _tslib.__assign({ borderRadius: borderRadius, icon: icon, inverted: inverted, isDisabled: isDisabled, noWrap: noWrap, onClick: onClick, size: size, tabIndex: isDisabled ? -1 : tabIndex, variant: variant }, props),
31
+ var asButton = _a.asButton, borderRadius = _a.borderRadius, children = _a.children, hrefPath = _a.hrefPath, icon = _a.icon, _b = _a.inverted, inverted = _b === void 0 ? false : _b, isDisabled = _a.isDisabled, noWrap = _a.noWrap, onClick = _a.onClick, _c = _a.size, size = _c === void 0 ? typography.TextTypes.TextSize.REGULAR : _c, _d = _a.target, target = _d === void 0 ? '_self' : _d, tabIndex = _a.tabIndex, _e = _a.variant, variant = _e === void 0 ? exports.ELinkVariant.PRIMARY : _e, props = _tslib.__rest(_a, ["asButton", "borderRadius", "children", "hrefPath", "icon", "inverted", "isDisabled", "noWrap", "onClick", "size", "target", "tabIndex", "variant"]);
32
+ return asButton ? (React__default["default"].createElement(Link_styles.LinkAsButton, _tslib.__assign({ borderRadius: borderRadius, disabled: isDisabled, icon: icon, inverted: inverted, isDisabled: isDisabled, noWrap: noWrap, onClick: onClick, size: size, variant: variant }, props),
33
33
  React__default["default"].createElement(typography.LinkText, { size: size }, children),
34
- icon && React__default["default"].createElement(Link_styles.IconWrapper, null, icon))) : (React__default["default"].createElement(Link_styles.BaseLink, _tslib.__assign({ borderRadius: borderRadius, href: hrefPath, isDisabled: isDisabled, icon: icon, inverted: inverted, noWrap: noWrap, onClick: onClick, size: size, tabIndex: isDisabled ? -1 : tabIndex, target: target, variant: variant }, props),
34
+ icon && React__default["default"].createElement(Link_styles.IconWrapper, null, icon))) : (React__default["default"].createElement(Link_styles.BaseLink, _tslib.__assign({ borderRadius: borderRadius, href: hrefPath, isDisabled: isDisabled, icon: icon, inverted: inverted, noWrap: noWrap, onClick: onClick, size: size, tabIndex: tabIndex, target: target, variant: variant }, props),
35
35
  React__default["default"].createElement(typography.LinkText, { size: size }, children),
36
36
  icon && React__default["default"].createElement(Link_styles.IconWrapper, null, icon)));
37
37
  }
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -12,7 +12,7 @@ function Header(_a) {
12
12
  var logOut = _a.logOut, logOutLabel = _a.logOutLabel, _d = _a.topLinkHref, topLinkHref = _d === void 0 ? '/' : _d, topLinkLabel = _a.topLinkLabel, logoImage = _a.logoImage, _e = _a.lowerContainerMaxWidth, lowerContainerMaxWidth = _e === void 0 ? (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.pageContentMaxWidth : _e, children = _a.children;
13
13
  var device = useDetectDevice();
14
14
  return (React.createElement(Wrapper, null,
15
- topLinkLabel && topLinkHref && (React.createElement(HeaderLink, { linkHref: topLinkHref, icon: React.createElement(Icons.ChevronLeft, { width: 20, height: 20, color: (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.white }), linkLabel: topLinkLabel })),
15
+ topLinkLabel && topLinkHref && (React.createElement(HeaderLink, { icon: React.createElement(Icons.ChevronLeft, { width: 20, height: 20, color: (_c = theme.palette) === null || _c === void 0 ? void 0 : _c.white }), linkHref: topLinkHref, linkLabel: topLinkLabel })),
16
16
  (logoImage || logOutLabel) && (React.createElement(HeaderWrapper, null,
17
17
  React.createElement(HeaderContainer, { maxWidth: lowerContainerMaxWidth },
18
18
  logoImage && React.createElement(Logo, { logoImage: logoImage }),
@@ -20,10 +20,10 @@ var ELinkVariant;
20
20
  ELinkVariant["TERTIARY"] = "tertiary";
21
21
  })(ELinkVariant || (ELinkVariant = {}));
22
22
  function Link(_a) {
23
- var asButton = _a.asButton, borderRadius = _a.borderRadius, children = _a.children, hrefPath = _a.hrefPath, icon = _a.icon, _b = _a.inverted, inverted = _b === void 0 ? false : _b, isDisabled = _a.isDisabled, noWrap = _a.noWrap, onClick = _a.onClick, _c = _a.size, size = _c === void 0 ? TextTypes.TextSize.REGULAR : _c, _d = _a.target, target = _d === void 0 ? '_self' : _d, _e = _a.tabIndex, tabIndex = _e === void 0 ? 0 : _e, _f = _a.variant, variant = _f === void 0 ? ELinkVariant.PRIMARY : _f, props = __rest(_a, ["asButton", "borderRadius", "children", "hrefPath", "icon", "inverted", "isDisabled", "noWrap", "onClick", "size", "target", "tabIndex", "variant"]);
24
- return asButton ? (React.createElement(LinkAsButton, __assign({ borderRadius: borderRadius, icon: icon, inverted: inverted, isDisabled: isDisabled, noWrap: noWrap, onClick: onClick, size: size, tabIndex: isDisabled ? -1 : tabIndex, variant: variant }, props),
23
+ var asButton = _a.asButton, borderRadius = _a.borderRadius, children = _a.children, hrefPath = _a.hrefPath, icon = _a.icon, _b = _a.inverted, inverted = _b === void 0 ? false : _b, isDisabled = _a.isDisabled, noWrap = _a.noWrap, onClick = _a.onClick, _c = _a.size, size = _c === void 0 ? TextTypes.TextSize.REGULAR : _c, _d = _a.target, target = _d === void 0 ? '_self' : _d, tabIndex = _a.tabIndex, _e = _a.variant, variant = _e === void 0 ? ELinkVariant.PRIMARY : _e, props = __rest(_a, ["asButton", "borderRadius", "children", "hrefPath", "icon", "inverted", "isDisabled", "noWrap", "onClick", "size", "target", "tabIndex", "variant"]);
24
+ return asButton ? (React.createElement(LinkAsButton, __assign({ borderRadius: borderRadius, disabled: isDisabled, icon: icon, inverted: inverted, isDisabled: isDisabled, noWrap: noWrap, onClick: onClick, size: size, variant: variant }, props),
25
25
  React.createElement(LinkText, { size: size }, children),
26
- icon && React.createElement(IconWrapper, null, icon))) : (React.createElement(BaseLink, __assign({ borderRadius: borderRadius, href: hrefPath, isDisabled: isDisabled, icon: icon, inverted: inverted, noWrap: noWrap, onClick: onClick, size: size, tabIndex: isDisabled ? -1 : tabIndex, target: target, variant: variant }, props),
26
+ icon && React.createElement(IconWrapper, null, icon))) : (React.createElement(BaseLink, __assign({ borderRadius: borderRadius, href: hrefPath, isDisabled: isDisabled, icon: icon, inverted: inverted, noWrap: noWrap, onClick: onClick, size: size, tabIndex: tabIndex, target: target, variant: variant }, props),
27
27
  React.createElement(LinkText, { size: size }, children),
28
28
  icon && React.createElement(IconWrapper, null, icon)));
29
29
  }
@@ -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.99",
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": "46e590444fb182878e6825d107b609690b3a2e7c"
80
80
  }