@citygross/components 0.16.7 → 0.16.8
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.
- package/build/@types/components/RadioListItem/RadioListItem.d.ts +5 -1
- package/build/cjs/components/src/components/RadioListItem/RadioListItem.js +4 -7
- package/build/cjs/components/src/components/RadioListItem/RadioListItem.js.map +1 -1
- package/build/es/components/src/components/RadioListItem/RadioListItem.js +4 -7
- package/build/es/components/src/components/RadioListItem/RadioListItem.js.map +1 -1
- package/package.json +2 -2
|
@@ -12,5 +12,9 @@ export declare type TRadioListItemProps = styles.TBaseRadioItemInputWrapper & {
|
|
|
12
12
|
wrapMobile?: boolean;
|
|
13
13
|
children?: JSX.Element;
|
|
14
14
|
additionalInfo?: JSX.Element;
|
|
15
|
+
tabIndex?: number;
|
|
16
|
+
onFocus?: React.FocusEventHandler<HTMLDivElement>;
|
|
17
|
+
onBlur?: React.FocusEventHandler<HTMLDivElement>;
|
|
18
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
15
19
|
};
|
|
16
|
-
export declare function RadioListItem({ onClick, selected, flexGrow, isDisabled, transparent, noPadding, label, value, wrapMobile, additionalInfo, children }: TRadioListItemProps): React.JSX.Element;
|
|
20
|
+
export declare function RadioListItem({ onClick, selected, flexGrow, isDisabled, transparent, noPadding, label, value, wrapMobile, additionalInfo, children, tabIndex, onFocus, onBlur, onKeyDown }: TRadioListItemProps): React.JSX.Element;
|
|
@@ -4,19 +4,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var RadioListItem_styles = require('./RadioListItem.styles.js');
|
|
7
|
+
var utils = require('@citygross/utils');
|
|
7
8
|
|
|
8
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
10
|
|
|
10
11
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
12
|
|
|
12
13
|
function RadioListItem(_a) {
|
|
13
|
-
var onClick = _a.onClick, selected = _a.selected, _b = _a.flexGrow, flexGrow = _b === void 0 ? 1 : _b, isDisabled = _a.isDisabled, transparent = _a.transparent, noPadding = _a.noPadding, label = _a.label, value = _a.value, wrapMobile = _a.wrapMobile, additionalInfo = _a.additionalInfo, children = _a.children;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
event.preventDefault();
|
|
17
|
-
onClick(value);
|
|
18
|
-
}
|
|
19
|
-
} },
|
|
14
|
+
var onClick = _a.onClick, selected = _a.selected, _b = _a.flexGrow, flexGrow = _b === void 0 ? 1 : _b, isDisabled = _a.isDisabled, transparent = _a.transparent, noPadding = _a.noPadding, label = _a.label, value = _a.value, wrapMobile = _a.wrapMobile, additionalInfo = _a.additionalInfo, children = _a.children, tabIndex = _a.tabIndex, onFocus = _a.onFocus, onBlur = _a.onBlur, onKeyDown = _a.onKeyDown;
|
|
15
|
+
var defaultTabIndex = isDisabled ? -1 : selected ? 0 : -1;
|
|
16
|
+
return (React__default["default"].createElement(RadioListItem_styles.BaseRadioListItemContainer, { tabIndex: tabIndex !== null && tabIndex !== void 0 ? tabIndex : defaultTabIndex, role: "radio", "aria-checked": selected, "aria-disabled": isDisabled, "aria-live": "polite", transparent: transparent, isDisabled: isDisabled, noPadding: noPadding, selected: selected, onClick: isDisabled ? function () { } : function () { return onClick(value); }, onFocus: onFocus, onBlur: onBlur, onKeyDown: function (event) { return utils.selectKeyboardEventHandler({ event: event, isDisabled: isDisabled, onClick: onClick, value: value, onKeyDown: onKeyDown }); } },
|
|
20
17
|
React__default["default"].createElement(RadioListItem_styles.RadioFlex, { wrapMobile: wrapMobile },
|
|
21
18
|
React__default["default"].createElement(RadioListItem_styles.BaseRadioItemLeftWrapper, { isDisabled: isDisabled, flexGrow: flexGrow },
|
|
22
19
|
React__default["default"].createElement(RadioListItem_styles.LabelContentWrapper, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseRadioListItemContainer, RadioFlex, BaseRadioItemLeftWrapper, LabelContentWrapper, StyledH3, RadioRightWrapper } from './RadioListItem.styles.js';
|
|
3
|
+
import { selectKeyboardEventHandler } from '@citygross/utils';
|
|
3
4
|
|
|
4
5
|
function RadioListItem(_a) {
|
|
5
|
-
var onClick = _a.onClick, selected = _a.selected, _b = _a.flexGrow, flexGrow = _b === void 0 ? 1 : _b, isDisabled = _a.isDisabled, transparent = _a.transparent, noPadding = _a.noPadding, label = _a.label, value = _a.value, wrapMobile = _a.wrapMobile, additionalInfo = _a.additionalInfo, children = _a.children;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
event.preventDefault();
|
|
9
|
-
onClick(value);
|
|
10
|
-
}
|
|
11
|
-
} },
|
|
6
|
+
var onClick = _a.onClick, selected = _a.selected, _b = _a.flexGrow, flexGrow = _b === void 0 ? 1 : _b, isDisabled = _a.isDisabled, transparent = _a.transparent, noPadding = _a.noPadding, label = _a.label, value = _a.value, wrapMobile = _a.wrapMobile, additionalInfo = _a.additionalInfo, children = _a.children, tabIndex = _a.tabIndex, onFocus = _a.onFocus, onBlur = _a.onBlur, onKeyDown = _a.onKeyDown;
|
|
7
|
+
var defaultTabIndex = isDisabled ? -1 : selected ? 0 : -1;
|
|
8
|
+
return (React.createElement(BaseRadioListItemContainer, { tabIndex: tabIndex !== null && tabIndex !== void 0 ? tabIndex : defaultTabIndex, role: "radio", "aria-checked": selected, "aria-disabled": isDisabled, "aria-live": "polite", transparent: transparent, isDisabled: isDisabled, noPadding: noPadding, selected: selected, onClick: isDisabled ? function () { } : function () { return onClick(value); }, onFocus: onFocus, onBlur: onBlur, onKeyDown: function (event) { return selectKeyboardEventHandler({ event: event, isDisabled: isDisabled, onClick: onClick, value: value, onKeyDown: onKeyDown }); } },
|
|
12
9
|
React.createElement(RadioFlex, { wrapMobile: wrapMobile },
|
|
13
10
|
React.createElement(BaseRadioItemLeftWrapper, { isDisabled: isDisabled, flexGrow: flexGrow },
|
|
14
11
|
React.createElement(LabelContentWrapper, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.8",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./build/cjs/components/src/index.js",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"react-slick": "^0.30.1",
|
|
76
76
|
"slick-carousel": "^1.8.1"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "faaea20047ace6894dd4b9d3d5b56e5e867e7696"
|
|
79
79
|
}
|