@widergy/energy-ui 2.12.2 → 2.12.3
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/dist/components/EnergyThemeProvider/index.js +13 -36
- package/dist/components/Loading/constants.js +1 -2
- package/dist/components/Loading/index.js +13 -12
- package/dist/components/Loading/theme.js +4 -2
- package/dist/components/UTAlert/AlertHandler.js +75 -101
- package/dist/components/UTAlert/index.js +65 -87
- package/dist/components/UTAlert/theme.js +32 -32
- package/dist/components/UTAttachment/components/Preview/index.js +8 -9
- package/dist/components/UTAttachment/constants.js +7 -13
- package/dist/components/UTAttachment/index.js +159 -250
- package/dist/components/UTAttachment/layout.js +26 -27
- package/dist/components/UTAttachment/theme.js +4 -2
- package/dist/components/UTAttachment/utils.js +34 -117
- package/dist/components/UTAutocomplete/components/ListBox/index.js +13 -21
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +9 -11
- package/dist/components/UTAutocomplete/constants.js +12 -23
- package/dist/components/UTAutocomplete/index.js +54 -94
- package/dist/components/UTAutocomplete/theme.js +6 -4
- package/dist/components/UTAvatar/constants.js +2 -3
- package/dist/components/UTAvatar/index.js +18 -17
- package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +22 -22
- package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +1 -1
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +21 -22
- package/dist/components/UTBarChart/components/Bars/constants.js +3 -6
- package/dist/components/UTBarChart/components/Bars/index.js +70 -80
- package/dist/components/UTBarChart/components/Legend/constants.js +12 -18
- package/dist/components/UTBarChart/components/Legend/index.js +75 -93
- package/dist/components/UTBarChart/components/Legend/utils.js +1 -5
- package/dist/components/UTBarChart/components/Levels/index.js +16 -14
- package/dist/components/UTBarChart/components/Levels/utils.js +25 -27
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +3 -5
- package/dist/components/UTBarChart/components/LinearPlot/index.js +25 -20
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +37 -39
- package/dist/components/UTBarChart/components/Pagination/constants.js +1 -2
- package/dist/components/UTBarChart/components/Pagination/index.js +20 -24
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +21 -32
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +2 -4
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +20 -19
- package/dist/components/UTBarChart/components/XAxis/constants.js +1 -2
- package/dist/components/UTBarChart/components/XAxis/index.js +54 -65
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +12 -11
- package/dist/components/UTBarChart/components/YAxis/constants.js +1 -2
- package/dist/components/UTBarChart/components/YAxis/index.js +30 -37
- package/dist/components/UTBarChart/components/YAxis/utils.js +4 -6
- package/dist/components/UTBarChart/constants.js +4 -8
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +23 -40
- package/dist/components/UTBarChart/index.js +152 -166
- package/dist/components/UTBarChart/theme.js +4 -2
- package/dist/components/UTBarChart/types.js +10 -19
- package/dist/components/UTBarChart/utils.js +107 -111
- package/dist/components/UTBreadcrumbs/constants.js +23 -31
- package/dist/components/UTBreadcrumbs/index.js +76 -101
- package/dist/components/UTBreadcrumbs/theme.js +4 -2
- package/dist/components/UTButton/constants.js +11 -17
- package/dist/components/UTButton/index.js +28 -31
- package/dist/components/UTButton/theme.js +23 -23
- package/dist/components/UTCBUInput/index.js +36 -40
- package/dist/components/UTCBUInput/theme.js +4 -2
- package/dist/components/UTCaptcha/index.js +19 -45
- package/dist/components/UTCard/components/UTCardFooter/index.js +15 -16
- package/dist/components/UTCard/index.js +85 -120
- package/dist/components/UTCard/theme.js +11 -12
- package/dist/components/UTCard/types.js +2 -3
- package/dist/components/UTCarousel/components/Button/index.js +13 -13
- package/dist/components/UTCarousel/components/Legend/index.js +13 -15
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +16 -16
- package/dist/components/UTCarousel/components/Slider/constants.js +5 -10
- package/dist/components/UTCarousel/components/Slider/index.js +204 -273
- package/dist/components/UTCarousel/components/Slider/layout.js +67 -94
- package/dist/components/UTCarousel/index.js +14 -15
- package/dist/components/UTCarousel/theme.js +4 -2
- package/dist/components/UTCheckList/constants.js +1 -2
- package/dist/components/UTCheckList/index.js +72 -93
- package/dist/components/UTCheckList/theme.js +31 -31
- package/dist/components/UTCheckbox/constants.js +3 -6
- package/dist/components/UTCheckbox/index.js +32 -44
- package/dist/components/UTCheckbox/theme.js +35 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +9 -9
- package/dist/components/UTConsumptionBar/constants.js +3 -6
- package/dist/components/UTConsumptionBar/index.js +53 -80
- package/dist/components/UTCuit/index.js +109 -133
- package/dist/components/UTCuit/theme.js +51 -53
- package/dist/components/UTDatePicker/components/Day/constants.js +1 -2
- package/dist/components/UTDatePicker/components/Day/index.js +12 -12
- package/dist/components/UTDatePicker/constants.js +20 -31
- package/dist/components/UTDatePicker/index.js +60 -102
- package/dist/components/UTDatePicker/theme.js +5 -3
- package/dist/components/UTDatePicker/types.js +2 -3
- package/dist/components/UTDatePicker/utils.js +2 -6
- package/dist/components/UTDialog/constants.js +2 -4
- package/dist/components/UTDialog/index.js +38 -37
- package/dist/components/UTDialog/theme.js +4 -2
- package/dist/components/UTDialog/types.js +2 -3
- package/dist/components/UTDotMenu/index.js +39 -61
- package/dist/components/UTEmojiPicker/constants.js +6 -11
- package/dist/components/UTEmojiPicker/index.js +45 -65
- package/dist/components/UTEmojiPicker/theme.js +4 -2
- package/dist/components/UTEmojiPicker/utils.js +21 -51
- package/dist/components/UTExternalLink/constants.js +3 -5
- package/dist/components/UTExternalLink/index.js +18 -15
- package/dist/components/UTExternalLink/theme.js +8 -6
- package/dist/components/UTFileInput/constants.js +2 -4
- package/dist/components/UTFileInput/index.js +7 -31
- package/dist/components/UTFileInput/layout.js +68 -97
- package/dist/components/UTIconButton/index.js +49 -72
- package/dist/components/UTIconButton/theme.js +4 -2
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +53 -58
- package/dist/components/UTImageRadio/constants.js +3 -6
- package/dist/components/UTImageRadio/index.js +39 -47
- package/dist/components/UTImageRadio/theme.js +11 -12
- package/dist/components/UTImageRadio/types.js +2 -3
- package/dist/components/UTImageRadio/utils.js +2 -6
- package/dist/components/UTLabel/constants.js +14 -20
- package/dist/components/UTLabel/index.js +18 -20
- package/dist/components/UTLabel/theme.js +15 -15
- package/dist/components/UTList/index.js +15 -18
- package/dist/components/UTLoading/index.js +15 -15
- package/dist/components/UTMap/components/GoogleMaps/constants.js +8 -11
- package/dist/components/UTMap/components/GoogleMaps/index.js +63 -91
- package/dist/components/UTMap/components/GoogleMaps/styles.js +2 -3
- package/dist/components/UTMap/constants.js +6 -12
- package/dist/components/UTMap/index.js +163 -198
- package/dist/components/UTMap/types.js +4 -6
- package/dist/components/UTMap/utils.js +29 -46
- package/dist/components/UTMap/withGoogleMapScript.js +18 -22
- package/dist/components/UTMenu/index.js +52 -69
- package/dist/components/UTMenu/theme.js +5 -3
- package/dist/components/UTMenu/utils.js +5 -11
- package/dist/components/UTModal/constants.js +9 -13
- package/dist/components/UTModal/index.js +26 -30
- package/dist/components/UTModal/theme.js +4 -2
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +11 -10
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +7 -13
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTPagination/components/Pagination/index.js +28 -39
- package/dist/components/UTPagination/components/Pagination/utils.js +8 -14
- package/dist/components/UTPagination/constants.js +3 -6
- package/dist/components/UTPagination/index.js +16 -17
- package/dist/components/UTPagination/theme.js +4 -2
- package/dist/components/UTPanel/index.js +38 -44
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +13 -10
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +22 -19
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +63 -50
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +25 -26
- package/dist/components/UTPasswordField/index.js +26 -23
- package/dist/components/UTPasswordField/theme.js +4 -2
- package/dist/components/UTPhoneInput/constants.js +3 -6
- package/dist/components/UTPhoneInput/index.js +180 -205
- package/dist/components/UTPhoneInput/theme.js +77 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +4 -8
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +24 -23
- package/dist/components/UTPieChart/components/Legend/contants.js +3 -6
- package/dist/components/UTPieChart/components/Legend/index.js +27 -24
- package/dist/components/UTPieChart/constants.js +13 -26
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +15 -33
- package/dist/components/UTPieChart/index.js +73 -76
- package/dist/components/UTPieChart/theme.js +4 -2
- package/dist/components/UTPieChart/utils.js +4 -2
- package/dist/components/UTProgressBar/constants.js +2 -4
- package/dist/components/UTProgressBar/index.js +15 -17
- package/dist/components/UTProgressBar/theme.js +4 -2
- package/dist/components/UTProgressBar/types.js +2 -3
- package/dist/components/UTRadioGroup/index.js +56 -83
- package/dist/components/UTRadioGroup/theme.js +52 -52
- package/dist/components/UTRating/components/Circle/index.js +41 -56
- package/dist/components/UTRating/components/Faces/constants.js +2 -4
- package/dist/components/UTRating/components/Faces/index.js +34 -36
- package/dist/components/UTRating/components/Star/index.js +36 -40
- package/dist/components/UTRating/constants.js +4 -8
- package/dist/components/UTRating/index.js +31 -46
- package/dist/components/UTRating/theme.js +4 -2
- package/dist/components/UTRipple/Ripple.js +22 -39
- package/dist/components/UTRipple/index.js +18 -37
- package/dist/components/UTSelect/components/Option/index.js +13 -13
- package/dist/components/UTSelect/constants.js +4 -8
- package/dist/components/UTSelect/index.js +63 -85
- package/dist/components/UTSelect/stylesJS.js +2 -3
- package/dist/components/UTSelect/theme.js +6 -4
- package/dist/components/UTSelect/utils.js +3 -13
- package/dist/components/UTSidebar/components/ListOption/index.js +34 -49
- package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +8 -8
- package/dist/components/UTSidebar/components/LogosContainer/index.js +14 -14
- package/dist/components/UTSidebar/components/Option/constants.js +2 -3
- package/dist/components/UTSidebar/components/Option/index.js +28 -32
- package/dist/components/UTSidebar/components/Toggler/index.js +11 -11
- package/dist/components/UTSidebar/index.js +42 -53
- package/dist/components/UTSidebar/theme.js +4 -2
- package/dist/components/UTSidebar/types.js +5 -10
- package/dist/components/UTSkeleton/index.js +10 -36
- package/dist/components/UTStatus/constants.js +5 -9
- package/dist/components/UTStatus/index.js +16 -15
- package/dist/components/UTStatus/theme.js +66 -49
- package/dist/components/UTSwitch/constants.js +3 -6
- package/dist/components/UTSwitch/index.js +42 -57
- package/dist/components/UTSwitch/theme.js +4 -2
- package/dist/components/UTTable/components/ActionIcons/constants.js +1 -2
- package/dist/components/UTTable/components/ActionIcons/index.js +47 -85
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +10 -12
- package/dist/components/UTTable/components/Cell/index.js +18 -23
- package/dist/components/UTTable/components/HeaderCell/constants.js +2 -3
- package/dist/components/UTTable/components/HeaderCell/index.js +23 -30
- package/dist/components/UTTable/components/HeaderCell/utils.js +3 -3
- package/dist/components/UTTable/components/PrimaryAction/index.js +12 -11
- package/dist/components/UTTable/components/ResponsiveCell/index.js +19 -20
- package/dist/components/UTTable/components/Status/index.js +18 -19
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +10 -9
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +7 -13
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +21 -32
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +8 -14
- package/dist/components/UTTable/components/TableFooter/constants.js +1 -2
- package/dist/components/UTTable/components/TableFooter/index.js +15 -15
- package/dist/components/UTTable/components/TableHeader/index.js +11 -11
- package/dist/components/UTTable/components/TableRow/constants.js +3 -6
- package/dist/components/UTTable/components/TableRow/index.js +82 -95
- package/dist/components/UTTable/components/TableRow/styles.module.scss +8 -1
- package/dist/components/UTTable/components/TableRow/utils.js +15 -0
- package/dist/components/UTTable/constants.js +26 -43
- package/dist/components/UTTable/hook.js +11 -26
- package/dist/components/UTTable/index.js +129 -220
- package/dist/components/UTTable/theme.js +17 -17
- package/dist/components/UTTable/types.js +4 -8
- package/dist/components/UTTable/utils.js +70 -74
- package/dist/components/UTTabs/components/TooltipTab/index.js +20 -30
- package/dist/components/UTTabs/constants.js +4 -8
- package/dist/components/UTTabs/index.js +57 -86
- package/dist/components/UTTabs/theme.js +4 -2
- package/dist/components/UTTabs/utils.js +1 -1
- package/dist/components/UTTextArea/constants.js +3 -6
- package/dist/components/UTTextArea/index.js +23 -23
- package/dist/components/UTTextArea/theme.js +4 -2
- package/dist/components/UTTextInput/constants.js +2 -3
- package/dist/components/UTTextInput/index.js +137 -165
- package/dist/components/UTTextInput/theme.js +6 -4
- package/dist/components/UTThirdPartyCookieChecker/index.js +17 -21
- package/dist/components/UTToggle/components/ToggleOption/index.js +16 -17
- package/dist/components/UTToggle/index.js +25 -26
- package/dist/components/UTToggle/theme.js +4 -2
- package/dist/components/UTTooltip/index.js +23 -30
- package/dist/components/UTTooltip/theme.js +4 -2
- package/dist/components/UTTopbar/components/Notifications/index.js +11 -14
- package/dist/components/UTTopbar/components/UserMenu/index.js +15 -15
- package/dist/components/UTTopbar/index.js +28 -31
- package/dist/components/UTTopbar/theme.js +4 -2
- package/dist/components/UTTopbar/types.js +5 -9
- package/dist/components/UTTouchableWithoutFeedback/index.js +14 -27
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +2 -4
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +34 -31
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +4 -4
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +6 -12
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +8 -18
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +23 -47
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +31 -34
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +81 -93
- package/dist/components/UTVirtualizedList/constants.js +4 -8
- package/dist/components/UTVirtualizedList/index.js +26 -38
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +17 -21
- package/dist/components/UTWorkflowContainer/constants.js +3 -6
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +3 -3
- package/dist/components/UTWorkflowContainer/index.js +32 -51
- package/dist/components/UTWorkflowContainer/theme.js +60 -53
- package/dist/components/UTWorkflowContainer/types.js +2 -3
- package/dist/components/WithLoading/index.js +10 -15
- package/dist/components/WithTheme/index.js +10 -17
- package/dist/components/WithTheme/layout.js +22 -28
- package/dist/components/WithTouch/index.js +12 -19
- package/dist/constants/UTTable.js +2 -3
- package/dist/index.js +58 -58
- package/dist/theme.js +6 -5
- package/dist/types/commonTypes.js +3 -5
- package/dist/types/consumptionTypes.js +3 -5
- package/dist/types/formTypes.js +4 -7
- package/dist/types/tableTypes.js +2 -3
- package/dist/utils/classesUtils.js +5 -13
- package/dist/utils/componentUtils.js +10 -13
- package/dist/utils/helperFunctions.js +4 -4
- package/dist/utils/shadowUtils.js +13 -11
- package/dist/utils/useScreenSize.js +2 -3
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -15,76 +14,55 @@ var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
|
15
14
|
var _theme = require("./theme");
|
|
16
15
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
-
function _getRequireWildcardCache(
|
|
19
|
-
function _interopRequireWildcard(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
const variants = ['base', 'primary', 'secondary', 'alternative', 'gray', 'disabled'];
|
|
20
|
+
class UTIconButton extends _react.Component {
|
|
21
|
+
render() {
|
|
22
|
+
const {
|
|
23
|
+
type,
|
|
24
|
+
onClick,
|
|
25
|
+
disabled,
|
|
26
|
+
loading,
|
|
27
|
+
small,
|
|
28
|
+
large,
|
|
29
|
+
classes,
|
|
30
|
+
className,
|
|
31
|
+
children,
|
|
32
|
+
autoFocus,
|
|
33
|
+
imgSrc,
|
|
34
|
+
imgClassName,
|
|
35
|
+
style,
|
|
36
|
+
loadingClassName
|
|
37
|
+
} = this.props;
|
|
38
|
+
const size = small ? 'small' : large ? 'large' : 'medium';
|
|
39
|
+
const classNames = (0, _style.retrieveClassNamesFromProps)(variants, classes, this.props);
|
|
40
|
+
return loading ? /*#__PURE__*/_react.default.createElement("div", {
|
|
41
|
+
className: "".concat(_stylesModule.default.loadingContainer, " ").concat(loadingClassName)
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
43
|
+
size: 24,
|
|
44
|
+
className: classes.loading
|
|
45
|
+
})) : imgSrc ? /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
46
|
+
onClick: onClick,
|
|
47
|
+
className: classes.imgIcon,
|
|
48
|
+
withRipple: true
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
50
|
+
src: imgSrc,
|
|
51
|
+
alt: "",
|
|
52
|
+
className: imgClassName
|
|
53
|
+
})) : /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
54
|
+
onClick: onClick,
|
|
55
|
+
disabled: disabled || loading,
|
|
56
|
+
size: size,
|
|
57
|
+
type: type,
|
|
58
|
+
autoFocus: autoFocus,
|
|
59
|
+
style: style,
|
|
60
|
+
classes: {
|
|
61
|
+
root: "".concat(classNames, " ").concat(small ? classes.small : large && classes.large, " ").concat(className)
|
|
62
|
+
}
|
|
63
|
+
}, children);
|
|
39
64
|
}
|
|
40
|
-
|
|
41
|
-
key: "render",
|
|
42
|
-
value: function render() {
|
|
43
|
-
var _this$props = this.props,
|
|
44
|
-
type = _this$props.type,
|
|
45
|
-
onClick = _this$props.onClick,
|
|
46
|
-
disabled = _this$props.disabled,
|
|
47
|
-
loading = _this$props.loading,
|
|
48
|
-
small = _this$props.small,
|
|
49
|
-
large = _this$props.large,
|
|
50
|
-
classes = _this$props.classes,
|
|
51
|
-
className = _this$props.className,
|
|
52
|
-
children = _this$props.children,
|
|
53
|
-
autoFocus = _this$props.autoFocus,
|
|
54
|
-
imgSrc = _this$props.imgSrc,
|
|
55
|
-
imgClassName = _this$props.imgClassName,
|
|
56
|
-
style = _this$props.style,
|
|
57
|
-
loadingClassName = _this$props.loadingClassName;
|
|
58
|
-
var size = small ? 'small' : large ? 'large' : 'medium';
|
|
59
|
-
var classNames = (0, _style.retrieveClassNamesFromProps)(variants, classes, this.props);
|
|
60
|
-
return loading ? /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
-
className: "".concat(_stylesModule.default.loadingContainer, " ").concat(loadingClassName)
|
|
62
|
-
}, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
63
|
-
size: 24,
|
|
64
|
-
className: classes.loading
|
|
65
|
-
})) : imgSrc ? /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
66
|
-
onClick: onClick,
|
|
67
|
-
className: classes.imgIcon,
|
|
68
|
-
withRipple: true
|
|
69
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
70
|
-
src: imgSrc,
|
|
71
|
-
alt: "",
|
|
72
|
-
className: imgClassName
|
|
73
|
-
})) : /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
74
|
-
onClick: onClick,
|
|
75
|
-
disabled: disabled || loading,
|
|
76
|
-
size: size,
|
|
77
|
-
type: type,
|
|
78
|
-
autoFocus: autoFocus,
|
|
79
|
-
style: style,
|
|
80
|
-
classes: {
|
|
81
|
-
root: "".concat(classNames, " ").concat(small ? classes.small : large && classes.large, " ").concat(className)
|
|
82
|
-
}
|
|
83
|
-
}, children);
|
|
84
|
-
}
|
|
85
|
-
}]);
|
|
86
|
-
return UTIconButton;
|
|
87
|
-
}(_react.Component);
|
|
65
|
+
}
|
|
88
66
|
UTIconButton.propTypes = {
|
|
89
67
|
small: _propTypes.bool,
|
|
90
68
|
large: _propTypes.bool,
|
|
@@ -99,5 +77,4 @@ UTIconButton.propTypes = {
|
|
|
99
77
|
imgClassName: _propTypes.string,
|
|
100
78
|
loadingClassName: _propTypes.string
|
|
101
79
|
};
|
|
102
|
-
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTIconButton);
|
|
103
|
-
exports.default = _default;
|
|
80
|
+
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTIconButton);
|
|
@@ -5,8 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const retrieveStyle = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
theme
|
|
11
|
+
} = _ref;
|
|
10
12
|
return {
|
|
11
13
|
base: {
|
|
12
14
|
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTIconButton', 'base', 'backgroundColor']),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -13,61 +12,58 @@ var _UTTouchableWithoutFeedback = _interopRequireDefault(require("../../../UTTou
|
|
|
13
12
|
var _types = require("../../types");
|
|
14
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
function _interopRequireWildcard(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
option =
|
|
21
|
-
compact
|
|
22
|
-
oneColumn
|
|
23
|
-
isSelected
|
|
24
|
-
onChange
|
|
25
|
-
classes
|
|
26
|
-
disabled
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
configuration =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
className: "".concat(classes.description, " ").concat(_stylesModule.default.text, " ").concat(isSelected && _stylesModule.default.selectedText)
|
|
69
|
-
}, description)));
|
|
70
|
-
};
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
+
const ImageRadioCard = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
option = {},
|
|
20
|
+
compact,
|
|
21
|
+
oneColumn,
|
|
22
|
+
isSelected,
|
|
23
|
+
onChange,
|
|
24
|
+
classes,
|
|
25
|
+
disabled,
|
|
26
|
+
variant = {}
|
|
27
|
+
} = _ref;
|
|
28
|
+
const {
|
|
29
|
+
value,
|
|
30
|
+
name,
|
|
31
|
+
configuration = {}
|
|
32
|
+
} = option;
|
|
33
|
+
const {
|
|
34
|
+
transparent_background: transparent,
|
|
35
|
+
vertical
|
|
36
|
+
} = variant;
|
|
37
|
+
const {
|
|
38
|
+
image_url: imageUrl,
|
|
39
|
+
selected_image_url: selectedImageUrl,
|
|
40
|
+
UnselectedImageComponent,
|
|
41
|
+
SelectedImageComponent,
|
|
42
|
+
tooltip,
|
|
43
|
+
description
|
|
44
|
+
} = configuration;
|
|
45
|
+
const handleOnChange = () => onChange(value);
|
|
46
|
+
const ImageComponent = isSelected && SelectedImageComponent || UnselectedImageComponent;
|
|
47
|
+
const renderImage = (0, _react.useMemo)(() => selected => selected && selectedImageUrl ? /*#__PURE__*/_react.default.createElement("img", {
|
|
48
|
+
alt: "imageRadioSelected",
|
|
49
|
+
src: selectedImageUrl
|
|
50
|
+
}) : /*#__PURE__*/_react.default.createElement("img", {
|
|
51
|
+
alt: "imageRadioUnselected",
|
|
52
|
+
src: imageUrl
|
|
53
|
+
}), [imageUrl, selectedImageUrl]);
|
|
54
|
+
const Content = () => /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
55
|
+
className: "".concat(_stylesModule.default.container, " ").concat(classes.containerCard, " ").concat(isSelected && "".concat(_stylesModule.default.isSelected, " ").concat(classes.isSelected), " ").concat(oneColumn && _stylesModule.default.oneColumn, " ").concat(compact && _stylesModule.default.compact, " ").concat(disabled && _stylesModule.default.disabled, " ").concat(transparent && _stylesModule.default.transparent, " ").concat(vertical && classes.vertical, " ").concat(tooltip && _stylesModule.default.contentWithTooltip, " "),
|
|
56
|
+
onClick: handleOnChange
|
|
57
|
+
}, (imageUrl || ImageComponent) && /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
+
className: "".concat(classes.image, " ").concat(_stylesModule.default.image)
|
|
59
|
+
}, imageUrl && renderImage(isSelected), ImageComponent && /*#__PURE__*/_react.default.createElement(ImageComponent, null)), /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
+
className: "".concat(_stylesModule.default.containerText, " ").concat(classes.containerText)
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
62
|
+
className: "".concat(classes.name, " ").concat(_stylesModule.default.text, " ").concat(isSelected && !transparent && classes.selectedText)
|
|
63
|
+
}, name), description && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
64
|
+
weight: "light",
|
|
65
|
+
className: "".concat(classes.description, " ").concat(_stylesModule.default.text, " ").concat(isSelected && _stylesModule.default.selectedText)
|
|
66
|
+
}, description)));
|
|
71
67
|
return tooltip ? /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
72
68
|
content: tooltip,
|
|
73
69
|
tippyProps: {
|
|
@@ -90,5 +86,4 @@ ImageRadioCard.propTypes = {
|
|
|
90
86
|
}),
|
|
91
87
|
classes: (0, _propTypes.objectOf)(_propTypes.string)
|
|
92
88
|
};
|
|
93
|
-
var _default = /*#__PURE__*/(0, _react.memo)(ImageRadioCard);
|
|
94
|
-
exports.default = _default;
|
|
89
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(ImageRadioCard);
|
|
@@ -4,9 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.validPaddings = exports.defaultGridGap = exports.DEFAULT_ONE_COLUMN_BREAKPOINT = void 0;
|
|
7
|
-
|
|
8
|
-
exports.
|
|
9
|
-
|
|
10
|
-
exports.validPaddings = validPaddings;
|
|
11
|
-
var defaultGridGap = 16;
|
|
12
|
-
exports.defaultGridGap = defaultGridGap;
|
|
7
|
+
const DEFAULT_ONE_COLUMN_BREAKPOINT = exports.DEFAULT_ONE_COLUMN_BREAKPOINT = 1000;
|
|
8
|
+
const validPaddings = exports.validPaddings = [16, 24];
|
|
9
|
+
const defaultGridGap = exports.defaultGridGap = 16;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -20,53 +19,47 @@ var _utils = require("./utils");
|
|
|
20
19
|
var _constants = require("./constants");
|
|
21
20
|
var _types = require("./types");
|
|
22
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
function _getRequireWildcardCache(
|
|
24
|
-
function _interopRequireWildcard(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
containerRef = _useComponentDimensio.ref,
|
|
51
|
-
containerWidth = _useComponentDimensio.width;
|
|
52
|
-
var alignToLeft = leftAligned || (field === null || field === void 0 ? void 0 : field.configuration.left_aligned);
|
|
53
|
-
var classes = (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
22
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
23
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
|
+
const UTImageRadio = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
oneColumnBreakpoint = _constants.DEFAULT_ONE_COLUMN_BREAKPOINT,
|
|
27
|
+
oneColumn,
|
|
28
|
+
leftAligned,
|
|
29
|
+
compact,
|
|
30
|
+
input = {},
|
|
31
|
+
field,
|
|
32
|
+
meta,
|
|
33
|
+
options = [],
|
|
34
|
+
disabled,
|
|
35
|
+
classNames,
|
|
36
|
+
classes: themeClasses
|
|
37
|
+
} = _ref;
|
|
38
|
+
const mutableOptions = [...options];
|
|
39
|
+
const {
|
|
40
|
+
value,
|
|
41
|
+
onChange
|
|
42
|
+
} = input;
|
|
43
|
+
const {
|
|
44
|
+
ref: containerRef,
|
|
45
|
+
width: containerWidth
|
|
46
|
+
} = (0, _energyHooks.useComponentDimensions)();
|
|
47
|
+
const alignToLeft = leftAligned || (field === null || field === void 0 ? void 0 : field.configuration.left_aligned);
|
|
48
|
+
const classes = (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
54
49
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
55
50
|
ref: containerRef,
|
|
56
51
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container, " ").concat(alignToLeft && _stylesModule.default.leftAligned)
|
|
57
|
-
}, mutableOptions.sort(_utils.sortOptions).map(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
})), meta && (0, _form.shouldShowErrors)(meta) && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
52
|
+
}, mutableOptions.sort(_utils.sortOptions).map(item => /*#__PURE__*/_react.default.createElement(_ImageRadioCard.default, {
|
|
53
|
+
key: item.value,
|
|
54
|
+
option: item,
|
|
55
|
+
variant: field === null || field === void 0 ? void 0 : field.configuration,
|
|
56
|
+
compact: compact,
|
|
57
|
+
disabled: disabled,
|
|
58
|
+
oneColumn: oneColumn || containerWidth < oneColumnBreakpoint,
|
|
59
|
+
isSelected: value === item.value,
|
|
60
|
+
onChange: onChange,
|
|
61
|
+
classes: classes
|
|
62
|
+
}))), meta && (0, _form.shouldShowErrors)(meta) && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
70
63
|
colorTheme: "error",
|
|
71
64
|
className: _stylesModule.default.error,
|
|
72
65
|
variant: "small"
|
|
@@ -85,5 +78,4 @@ UTImageRadio.propTypes = {
|
|
|
85
78
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
86
79
|
classes: (0, _propTypes.objectOf)(_propTypes.string)
|
|
87
80
|
};
|
|
88
|
-
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)( /*#__PURE__*/(0, _react.memo)(UTImageRadio));
|
|
89
|
-
exports.default = _default;
|
|
81
|
+
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)( /*#__PURE__*/(0, _react.memo)(UTImageRadio));
|
|
@@ -10,14 +10,12 @@ var _classesUtils = require("../../utils/classesUtils");
|
|
|
10
10
|
var _constants = require("./constants");
|
|
11
11
|
var _utils = require("./utils");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
17
|
-
var retrieveStyle = function retrieveStyle(_ref) {
|
|
13
|
+
const retrieveStyle = _ref => {
|
|
18
14
|
var _theme$UTImageRadio, _theme$UTImageRadio2, _theme$UTImageRadio3, _theme$UTImageRadio4, _theme$UTImageRadio5, _theme$UTImageRadio6, _theme$UTImageRadio7, _theme$UTImageRadio8, _theme$UTImageRadio9, _theme$UTImageRadio10, _theme$UTImageRadio11;
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
let {
|
|
16
|
+
theme
|
|
17
|
+
} = _ref;
|
|
18
|
+
const tabletMobile = (0, _seamlessImmutable.getIn)(theme, ['Media', 'tabletMobile']);
|
|
21
19
|
return {
|
|
22
20
|
containerCard: {
|
|
23
21
|
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTImageRadio', 'containerCard', 'backgroundColor'], _colorsModule.default.imageRadioBackground),
|
|
@@ -35,11 +33,12 @@ var retrieveStyle = function retrieveStyle(_ref) {
|
|
|
35
33
|
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTImageRadio', 'isSelected', 'backgroundColor'], _colorsModule.default.blue),
|
|
36
34
|
pointerEvents: (0, _seamlessImmutable.getIn)(theme, ['UTImageRadio', 'isSelected', 'pointerEvents'], 'none')
|
|
37
35
|
},
|
|
38
|
-
containerText:
|
|
39
|
-
width: (0, _classesUtils.withImportant)((theme === null || theme === void 0 || (_theme$UTImageRadio = theme.UTImageRadio) === null || _theme$UTImageRadio === void 0 || (_theme$UTImageRadio = _theme$UTImageRadio.containerText) === null || _theme$UTImageRadio === void 0 ? void 0 : _theme$UTImageRadio.width) || '100%')
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
containerText: {
|
|
37
|
+
width: (0, _classesUtils.withImportant)((theme === null || theme === void 0 || (_theme$UTImageRadio = theme.UTImageRadio) === null || _theme$UTImageRadio === void 0 || (_theme$UTImageRadio = _theme$UTImageRadio.containerText) === null || _theme$UTImageRadio === void 0 ? void 0 : _theme$UTImageRadio.width) || '100%'),
|
|
38
|
+
[tabletMobile]: {
|
|
39
|
+
width: '100%'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
43
42
|
image: {
|
|
44
43
|
height: (0, _seamlessImmutable.getIn)(theme, ['UTImageRadio', 'image', 'height']),
|
|
45
44
|
width: (0, _seamlessImmutable.getIn)(theme, ['UTImageRadio', 'image', 'width'], '56px')
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.optionType = void 0;
|
|
7
7
|
var _propTypes = require("prop-types");
|
|
8
|
-
|
|
8
|
+
const optionType = exports.optionType = (0, _propTypes.shape)({
|
|
9
9
|
configuration: (0, _propTypes.shape)({
|
|
10
10
|
image_url: _propTypes.string,
|
|
11
11
|
selected_image_url: _propTypes.string,
|
|
@@ -15,5 +15,4 @@ var optionType = (0, _propTypes.shape)({
|
|
|
15
15
|
}),
|
|
16
16
|
value: _propTypes.string,
|
|
17
17
|
name: _propTypes.string
|
|
18
|
-
});
|
|
19
|
-
exports.optionType = optionType;
|
|
18
|
+
});
|
|
@@ -5,11 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.standarizePadding = exports.sortOptions = void 0;
|
|
7
7
|
var _constants = require("./constants");
|
|
8
|
-
|
|
9
|
-
return a.order - b.order;
|
|
10
|
-
};
|
|
8
|
+
const sortOptions = (a, b) => a.order - b.order;
|
|
11
9
|
exports.sortOptions = sortOptions;
|
|
12
|
-
|
|
13
|
-
return _constants.validPaddings.includes(padding) || _constants.validPaddings[1];
|
|
14
|
-
};
|
|
10
|
+
const standarizePadding = padding => _constants.validPaddings.includes(padding) || _constants.validPaddings[1];
|
|
15
11
|
exports.standarizePadding = standarizePadding;
|
|
@@ -8,15 +8,14 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
9
|
/* eslint-disable react/prop-types */
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const SHADES = exports.SHADES = {
|
|
12
12
|
shade01: '01',
|
|
13
13
|
shade02: '02',
|
|
14
14
|
shade03: '03',
|
|
15
15
|
shade04: '04',
|
|
16
16
|
shade05: '05'
|
|
17
17
|
};
|
|
18
|
-
exports.
|
|
19
|
-
var VARIANTS = {
|
|
18
|
+
const VARIANTS = exports.VARIANTS = {
|
|
20
19
|
title1: 'h1',
|
|
21
20
|
title2: 'h2',
|
|
22
21
|
title3: 'h3',
|
|
@@ -28,8 +27,7 @@ var VARIANTS = {
|
|
|
28
27
|
th: 'th',
|
|
29
28
|
td: 'td'
|
|
30
29
|
};
|
|
31
|
-
exports.
|
|
32
|
-
var VARIANTS_SIZES = {
|
|
30
|
+
const VARIANTS_SIZES = exports.VARIANTS_SIZES = {
|
|
33
31
|
title1: '1.875rem',
|
|
34
32
|
title2: '1.5rem',
|
|
35
33
|
title3: '1.375rem',
|
|
@@ -41,8 +39,7 @@ var VARIANTS_SIZES = {
|
|
|
41
39
|
th: '1rem',
|
|
42
40
|
td: '1rem'
|
|
43
41
|
};
|
|
44
|
-
exports.
|
|
45
|
-
var VARIANTS_LINE_HEIGHT = {
|
|
42
|
+
const VARIANTS_LINE_HEIGHT = exports.VARIANTS_LINE_HEIGHT = {
|
|
46
43
|
title1: '100%',
|
|
47
44
|
title2: '100%',
|
|
48
45
|
title3: '100%',
|
|
@@ -54,8 +51,7 @@ var VARIANTS_LINE_HEIGHT = {
|
|
|
54
51
|
th: '1.375rem',
|
|
55
52
|
td: '1.375rem'
|
|
56
53
|
};
|
|
57
|
-
exports.
|
|
58
|
-
var WEIGHTS = {
|
|
54
|
+
const WEIGHTS = exports.WEIGHTS = {
|
|
59
55
|
thin: 100,
|
|
60
56
|
extralight: 200,
|
|
61
57
|
light: 300,
|
|
@@ -66,8 +62,7 @@ var WEIGHTS = {
|
|
|
66
62
|
extrabold: 800,
|
|
67
63
|
black: 900
|
|
68
64
|
};
|
|
69
|
-
exports.
|
|
70
|
-
var COLOR_THEMES = {
|
|
65
|
+
const COLOR_THEMES = exports.COLOR_THEMES = {
|
|
71
66
|
dark: 'dark',
|
|
72
67
|
gray: 'gray',
|
|
73
68
|
light: 'light',
|
|
@@ -76,11 +71,12 @@ var COLOR_THEMES = {
|
|
|
76
71
|
warning: 'warning',
|
|
77
72
|
information: 'information'
|
|
78
73
|
};
|
|
79
|
-
exports.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
children
|
|
74
|
+
const MARKDOWN_RENDERERS = exports.MARKDOWN_RENDERERS = {
|
|
75
|
+
a: _ref => {
|
|
76
|
+
let {
|
|
77
|
+
href,
|
|
78
|
+
children
|
|
79
|
+
} = _ref;
|
|
84
80
|
return /*#__PURE__*/_react.default.createElement("a", {
|
|
85
81
|
href: href,
|
|
86
82
|
rel: "noopener noreferrer",
|
|
@@ -88,13 +84,11 @@ var MARKDOWN_RENDERERS = {
|
|
|
88
84
|
}, children);
|
|
89
85
|
}
|
|
90
86
|
};
|
|
91
|
-
exports.
|
|
92
|
-
var DEFAULT_PROPS = {
|
|
87
|
+
const DEFAULT_PROPS = exports.DEFAULT_PROPS = {
|
|
93
88
|
colorTheme: 'dark',
|
|
94
89
|
field: {},
|
|
95
90
|
markdownRenderers: MARKDOWN_RENDERERS,
|
|
96
91
|
variant: 'body',
|
|
97
92
|
weight: 'regular',
|
|
98
93
|
withMarkdown: false
|
|
99
|
-
};
|
|
100
|
-
exports.DEFAULT_PROPS = DEFAULT_PROPS;
|
|
94
|
+
};
|