@ntbjs/react-components 1.3.0-rc.4 → 1.3.0-rc.41
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/.eslintrc +7 -8
- package/{ActionButton-46735b89.js → ActionButton-581e717e.js} +23 -18
- package/{Alert-13b75102.js → Alert-b79a8fcc.js} +30 -29
- package/{AssetGallery-7d05ac94.js → AssetAction-06d40708.js} +790 -655
- package/AssetPreviewTopBar-1b5dfde2.js +118 -0
- package/{Badge-757b0a39.js → Badge-a35c7018.js} +44 -54
- package/Button-70230131.js +284 -0
- package/Checkbox-92d07052.js +152 -0
- package/CompactAutocompleteSelect-c7a11d3d.js +478 -0
- package/CompactStarRating-86673c4f.js +343 -0
- package/CompactTextInput-f1824946.js +380 -0
- package/{ContextMenu-4ec3d9f3.js → ContextMenu-999756c8.js} +9 -7
- package/ContextMenuItem-ae4357ba.js +114 -0
- package/{InputGroup-49fbc423.js → InputGroup-0423e24c.js} +9 -7
- package/{Instructions-e5947be9.js → Instructions-9910f44d.js} +109 -82
- package/{MultiLevelCheckboxSelect-b897d605.js → MultiLevelCheckboxSelect-7a036b16.js} +158 -168
- package/MultiSelect-9d8c24e5.js +406 -0
- package/{Popover-569cd272.js → Popover-0d9a689b.js} +24 -24
- package/Radio-a0610a91.js +90 -0
- package/{SectionSeparator-259a22ed.js → SectionSeparator-5025c8f4.js} +9 -7
- package/Switch-b7193858.js +122 -0
- package/{Tab-f499ecbc.js → Tab-7c817d4d.js} +10 -8
- package/{Tabs-a8c77f71.js → Tabs-318feff9.js} +54 -44
- package/TextArea-ecfd3418.js +382 -0
- package/TextInput-91d6341d.js +252 -0
- package/{Tooltip-66daf6e3.js → Tooltip-478ec993.js} +16 -14
- package/{VerificationStatusIcon-d5bfb67a.js → VerificationStatusIcon-ecec5f07.js} +30 -32
- package/{close-ebf2f3cf.js → close-1751121a.js} +8 -12
- package/data/Alert/index.js +2 -2
- package/data/Badge/index.js +2 -2
- package/data/Popover/index.js +3 -3
- package/data/Tab/index.js +2 -2
- package/data/Tabs/index.js +3 -3
- package/data/Tooltip/index.js +3 -3
- package/data/index.js +9 -9
- package/{defaultTheme-ea44e34a.js → defaultTheme-573a9150.js} +205 -263
- package/edit-note-cefe2215.js +37 -0
- package/{expand-more-94585605.js → expand-more-d74e2bd2.js} +8 -12
- package/inputs/ActionButton/index.js +2 -2
- package/inputs/Button/index.js +6 -6
- package/inputs/Checkbox/index.js +2 -2
- package/inputs/CompactAutocompleteSelect/index.js +13 -13
- package/inputs/CompactStarRating/index.js +10 -10
- package/inputs/CompactTextInput/index.js +11 -11
- package/inputs/MultiSelect/index.js +4 -4
- package/inputs/Radio/index.js +2 -2
- package/inputs/Switch/index.js +2 -2
- package/inputs/TextArea/index.js +12 -12
- package/inputs/TextInput/index.js +3 -3
- package/inputs/index.js +28 -28
- package/layout/InputGroup/index.js +2 -2
- package/layout/SectionSeparator/index.js +2 -2
- package/layout/index.js +3 -3
- package/package.json +6 -5
- package/{react-select-creatable.esm-2f23d6c6.js → react-select-creatable.esm-8bf8566a.js} +1500 -1074
- package/{shift-away-subtle-0bed9a3c.js → shift-away-subtle-a9da38b8.js} +1 -1
- package/ssr/index.js +1 -3
- package/widgets/AssetGallery/index.js +34 -32
- package/widgets/AssetPreview/AssetPreviewTopBar/index.js +3 -3
- package/widgets/ContextMenu/ContextMenuItem/index.js +2 -2
- package/widgets/ContextMenu/ContextMenuItemsGroup/index.js +9 -7
- package/widgets/ContextMenu/index.js +2 -2
- package/widgets/Instructions/index.js +16 -17
- package/widgets/index.js +37 -35
- package/AssetPreviewTopBar-912c3469.js +0 -99
- package/Button-49f82b31.js +0 -264
- package/Checkbox-68dc38a8.js +0 -140
- package/CompactAutocompleteSelect-755b1869.js +0 -451
- package/CompactStarRating-bcfb78ac.js +0 -339
- package/CompactTextInput-9e507306.js +0 -349
- package/ContextMenuItem-ba2b697e.js +0 -110
- package/MultiSelect-efd60232.js +0 -377
- package/Radio-32d0513a.js +0 -86
- package/Switch-4a41585f.js +0 -107
- package/TextArea-8f62da6e.js +0 -353
- package/TextInput-0d109708.js +0 -236
- package/edit-note-c47d292e.js +0 -41
- package/warning-circle-24522402.js +0 -41
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var defaultTheme = require('./defaultTheme-573a9150.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var nanoid = require('nanoid');
|
|
6
|
+
var polished = require('polished');
|
|
7
|
+
var styled = require('styled-components');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
13
|
+
|
|
14
|
+
var switchButtonSize = '16px';
|
|
15
|
+
var Switch$1 = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
16
|
+
displayName: "Switchstyled__Switch",
|
|
17
|
+
componentId: "sc-1ijpqlg-0"
|
|
18
|
+
})(["*{box-sizing:border-box;}display:flex;flex-direction:column;", " ", ""], function (props) {
|
|
19
|
+
return props.readOnly && styled.css(["opacity:0.5;> *{pointer-events:none;user-select:text;}"]);
|
|
20
|
+
}, function (props) {
|
|
21
|
+
return props.disabled && styled.css(["opacity:0.5;cursor:not-allowed;*{pointer-events:none;user-select:text;}"]);
|
|
22
|
+
});
|
|
23
|
+
var SwitchIndicator = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
24
|
+
displayName: "Switchstyled__SwitchIndicator",
|
|
25
|
+
componentId: "sc-1ijpqlg-1"
|
|
26
|
+
})(["display:inline-block;position:relative;", " height:", ";width:32px;border-radius:20px;border:1px solid;", " transition:background 200ms;"], function (props) {
|
|
27
|
+
return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('gray-200'));
|
|
28
|
+
}, polished.math("".concat(switchButtonSize, " + 2px")), function (props) {
|
|
29
|
+
return props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-300'));
|
|
30
|
+
});
|
|
31
|
+
var SwitchIndicatorButton = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
32
|
+
displayName: "Switchstyled__SwitchIndicatorButton",
|
|
33
|
+
componentId: "sc-1ijpqlg-2"
|
|
34
|
+
})(["position:absolute;", " height:", ";width:", ";border-radius:50%;box-shadow:", " 0 0px 2px 0px;transition:left 200ms;"], function (props) {
|
|
35
|
+
return props.theme.themeProp('background', props.theme.getColor('gray-200'), props.theme.getColor('white'));
|
|
36
|
+
}, switchButtonSize, switchButtonSize, function (props) {
|
|
37
|
+
return props.theme.getColor('gray-500');
|
|
38
|
+
});
|
|
39
|
+
var SwitchIndicatorLabelText = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
40
|
+
displayName: "Switchstyled__SwitchIndicatorLabelText",
|
|
41
|
+
componentId: "sc-1ijpqlg-3"
|
|
42
|
+
})(["padding-left:10px;font-weight:400;font-size:0.875rem;line-height:18px;", ";"], function (props) {
|
|
43
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'));
|
|
44
|
+
});
|
|
45
|
+
var SwitchLabel = styled__default["default"].label.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
46
|
+
displayName: "Switchstyled__SwitchLabel",
|
|
47
|
+
componentId: "sc-1ijpqlg-4"
|
|
48
|
+
})(["display:inline-flex;margin-right:auto;cursor:pointer;input[type='checkbox']{position:absolute;opacity:0;}&:has(input[type='checkbox']:not(:checked)){", "{left:0;}}&:has(input[type='checkbox']:checked){", "{left:calc(100% - ", ");}", "{background:", ";", "}}&:has(input[type='checkbox']:focus-visible){", "{", "}}"], SwitchIndicatorButton, SwitchIndicatorButton, switchButtonSize, SwitchIndicator, function (props) {
|
|
49
|
+
return props.theme.getColor('emerald-500');
|
|
50
|
+
}, function (props) {
|
|
51
|
+
return props.theme.themeProp('border-color', props.theme.getColor('gray-400'), props.theme.getColor('gray-300'), 1);
|
|
52
|
+
}, SwitchIndicatorButton, function (props) {
|
|
53
|
+
return props.theme.themeProp('outline', "8px solid ".concat(polished.rgba(props.theme.getColor('emerald-500'), 0.5)), "8px solid ".concat(polished.rgba(props.theme.getColor('emerald-500'), 0.3)), 1);
|
|
54
|
+
});
|
|
55
|
+
var Description = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
56
|
+
displayName: "Switchstyled__Description",
|
|
57
|
+
componentId: "sc-1ijpqlg-5"
|
|
58
|
+
})(["margin:", " 0 0 0;font-size:0.75rem;line-height:1.333;", ";"], function (props) {
|
|
59
|
+
return props.spaciousDescription ? '16px' : '6px';
|
|
60
|
+
}, function (props) {
|
|
61
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'));
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
var Switch = React__default["default"].forwardRef(function Switch(_ref, forwardedRef) {
|
|
65
|
+
var name = _ref.name,
|
|
66
|
+
checked = _ref.checked,
|
|
67
|
+
defaultChecked = _ref.defaultChecked,
|
|
68
|
+
label = _ref.label,
|
|
69
|
+
disabled = _ref.disabled,
|
|
70
|
+
readOnly = _ref.readOnly,
|
|
71
|
+
description = _ref.description,
|
|
72
|
+
spaciousDescription = _ref.spaciousDescription,
|
|
73
|
+
className = _ref.className,
|
|
74
|
+
style = _ref.style,
|
|
75
|
+
onChange = _ref.onChange,
|
|
76
|
+
onBlur = _ref.onBlur;
|
|
77
|
+
var _useState = React.useState(nanoid.nanoid()),
|
|
78
|
+
_useState2 = defaultTheme._slicedToArray(_useState, 1),
|
|
79
|
+
uniqueId = _useState2[0];
|
|
80
|
+
return React__default["default"].createElement(Switch$1, {
|
|
81
|
+
disabled: disabled,
|
|
82
|
+
readOnly: readOnly,
|
|
83
|
+
className: className,
|
|
84
|
+
style: style
|
|
85
|
+
}, React__default["default"].createElement(SwitchLabel, {
|
|
86
|
+
htmlFor: uniqueId
|
|
87
|
+
}, React__default["default"].createElement("input", {
|
|
88
|
+
ref: forwardedRef,
|
|
89
|
+
checked: checked,
|
|
90
|
+
defaultChecked: defaultChecked,
|
|
91
|
+
disabled: disabled,
|
|
92
|
+
readOnly: readOnly,
|
|
93
|
+
id: uniqueId,
|
|
94
|
+
name: name,
|
|
95
|
+
type: "checkbox",
|
|
96
|
+
onBlur: onBlur,
|
|
97
|
+
onChange: onChange
|
|
98
|
+
}), React__default["default"].createElement(SwitchIndicator, null, React__default["default"].createElement(SwitchIndicatorButton, null)), typeof label === 'string' && label.length > 0 && React__default["default"].createElement(SwitchIndicatorLabelText, null, label)), typeof description === 'string' && description.length > 0 && React__default["default"].createElement(Description, {
|
|
99
|
+
spaciousDescription: spaciousDescription
|
|
100
|
+
}, description));
|
|
101
|
+
});
|
|
102
|
+
Switch.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
103
|
+
children: defaultTheme.PropTypes.any,
|
|
104
|
+
name: defaultTheme.PropTypes.string.isRequired,
|
|
105
|
+
checked: defaultTheme.PropTypes.bool,
|
|
106
|
+
defaultChecked: defaultTheme.PropTypes.bool,
|
|
107
|
+
label: defaultTheme.PropTypes.string,
|
|
108
|
+
disabled: defaultTheme.PropTypes.bool,
|
|
109
|
+
readOnly: defaultTheme.PropTypes.bool,
|
|
110
|
+
description: defaultTheme.PropTypes.string,
|
|
111
|
+
spaciousDescription: defaultTheme.PropTypes.bool,
|
|
112
|
+
className: defaultTheme.PropTypes.string,
|
|
113
|
+
style: defaultTheme.PropTypes.object,
|
|
114
|
+
onChange: defaultTheme.PropTypes.func,
|
|
115
|
+
onBlur: defaultTheme.PropTypes.func
|
|
116
|
+
} : {};
|
|
117
|
+
Switch.defaultProps = {
|
|
118
|
+
disabled: false,
|
|
119
|
+
readOnly: false
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
exports.Switch = Switch;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var defaultTheme = require('./defaultTheme-
|
|
3
|
+
var defaultTheme = require('./defaultTheme-573a9150.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var styled = require('styled-components');
|
|
6
6
|
|
|
@@ -9,18 +9,20 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
10
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
|
|
12
|
+
var Tab$1 = styled__default["default"].p.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
13
|
+
displayName: "Tabstyled__Tab",
|
|
14
|
+
componentId: "sc-hxlbpx-0"
|
|
15
|
+
})(["font-family:", ";font-size:1rem;font-weight:500;border-bottom:1px solid;min-height:35px;"], function (props) {
|
|
14
16
|
return props.theme.primaryFontFamily;
|
|
15
17
|
});
|
|
16
18
|
|
|
17
|
-
var
|
|
19
|
+
var _excluded = ["children", "hidden"];
|
|
20
|
+
var Tab = React__default["default"].forwardRef(function Tab(_ref, forwardedRef) {
|
|
18
21
|
var children = _ref.children,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
hidden = _ref.hidden,
|
|
23
|
+
props = defaultTheme._objectWithoutProperties(_ref, _excluded);
|
|
22
24
|
if (hidden) return null;
|
|
23
|
-
return React__default[
|
|
25
|
+
return React__default["default"].createElement(Tab$1, defaultTheme._extends({
|
|
24
26
|
ref: forwardedRef
|
|
25
27
|
}, props), children);
|
|
26
28
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var defaultTheme = require('./defaultTheme-
|
|
3
|
+
var defaultTheme = require('./defaultTheme-573a9150.js');
|
|
4
4
|
var lodash = require('lodash');
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var Tab = require('./Tab-
|
|
6
|
+
var Tab = require('./Tab-7c817d4d.js');
|
|
7
7
|
var styled = require('styled-components');
|
|
8
8
|
|
|
9
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -11,15 +11,27 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
12
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
var Tabs$1 = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
15
|
+
displayName: "Tabsstyled__Tabs",
|
|
16
|
+
componentId: "sc-1tow7gi-0"
|
|
17
|
+
})(["display:block;position:relative;", ";"], function (props) {
|
|
18
|
+
return props.backgroundColor && styled.css(["background-color:", ";"], props.backgroundColor);
|
|
17
19
|
});
|
|
18
|
-
var TabHeaders = styled__default[
|
|
19
|
-
|
|
20
|
+
var TabHeaders = styled__default["default"].ul.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
21
|
+
displayName: "Tabsstyled__TabHeaders",
|
|
22
|
+
componentId: "sc-1tow7gi-1"
|
|
23
|
+
})(["display:flex;overflow-x:auto;overflow-y:hidden;white-space:nowrap;gap:24px;margin:0;", ";", ";"], function (props) {
|
|
24
|
+
return !props.customPadding && styled.css(["padding:0;"]);
|
|
25
|
+
}, function (props) {
|
|
26
|
+
return props.customPadding && styled.css(["padding:0 ", ";"], props.customPadding);
|
|
27
|
+
});
|
|
28
|
+
var TabHeader = styled__default["default"].li.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
29
|
+
displayName: "Tabsstyled__TabHeader",
|
|
30
|
+
componentId: "sc-1tow7gi-2"
|
|
31
|
+
})(["font-family:", ";text-transform:uppercase;font-weight:600;font-size:0.875rem;display:flex;padding-bottom:8px;letter-spacing:0.6px;cursor:pointer;border-bottom:1px solid;border-color:transparent;margin-bottom:1px;", ";&&:hover:not(:focus){", ";}"], function (props) {
|
|
20
32
|
return props.theme.secondaryFontFamily;
|
|
21
33
|
}, function (props) {
|
|
22
|
-
return props.active && styled.css(
|
|
34
|
+
return props.active && styled.css(["", ""], function (props) {
|
|
23
35
|
return props.theme.themeProp('border-color', props.theme.getColor('gray-400'), props.theme.getColor('gray-700'));
|
|
24
36
|
});
|
|
25
37
|
}, function (props) {
|
|
@@ -37,53 +49,49 @@ var TabHeader = styled__default['default'].li.attrs(defaultTheme.applyDefaultThe
|
|
|
37
49
|
}
|
|
38
50
|
});
|
|
39
51
|
});
|
|
40
|
-
var TabContent = styled__default[
|
|
52
|
+
var TabContent = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
53
|
+
displayName: "Tabsstyled__TabContent",
|
|
54
|
+
componentId: "sc-1tow7gi-3"
|
|
55
|
+
})(["display:block;"]);
|
|
56
|
+
var TabHeaderBorder = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
57
|
+
displayName: "Tabsstyled__TabHeaderBorder",
|
|
58
|
+
componentId: "sc-1tow7gi-4"
|
|
59
|
+
})(["border-top:1px solid;", ";", ";", ";"], function (props) {
|
|
41
60
|
return props.theme.themeProp('border-color', props.theme.getColor('gray-600'), '#F0F2F5');
|
|
61
|
+
}, function (props) {
|
|
62
|
+
return !props.customPadding && styled.css(["margin:-2px 0;"]);
|
|
63
|
+
}, function (props) {
|
|
64
|
+
return props.customPadding && styled.css(["margin:-2px ", ";"], props.customPadding);
|
|
42
65
|
});
|
|
43
66
|
|
|
44
|
-
var
|
|
67
|
+
var _excluded = ["children", "defaultMinHeight", "customPadding"];
|
|
68
|
+
var Tabs = React__default["default"].forwardRef(function Tabs(_ref, forwardedRef) {
|
|
45
69
|
var children = _ref.children,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
70
|
+
defaultMinHeight = _ref.defaultMinHeight,
|
|
71
|
+
customPadding = _ref.customPadding,
|
|
72
|
+
props = defaultTheme._objectWithoutProperties(_ref, _excluded);
|
|
49
73
|
var _useState = React.useState(0),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var _useState3 = React.useState(),
|
|
55
|
-
_useState4 = defaultTheme._slicedToArray(_useState3, 2),
|
|
56
|
-
defaultHeight = _useState4[0],
|
|
57
|
-
setDefaultHeight = _useState4[1];
|
|
58
|
-
|
|
74
|
+
_useState2 = defaultTheme._slicedToArray(_useState, 2),
|
|
75
|
+
activeTab = _useState2[0],
|
|
76
|
+
setActiveTab = _useState2[1];
|
|
59
77
|
var contentRef = React.useRef(null);
|
|
60
|
-
React.useEffect(function () {
|
|
61
|
-
setDefaultHeight(defaultMinHeight);
|
|
62
|
-
}, []);
|
|
63
78
|
var tabs = React.useMemo(function () {
|
|
64
79
|
var tabs = [];
|
|
65
|
-
|
|
66
80
|
function extractChildren(children) {
|
|
67
81
|
React.Children.forEach(children, function (child, index) {
|
|
68
82
|
var _child$props2;
|
|
69
|
-
|
|
70
83
|
if (lodash.isNil(child)) {
|
|
71
84
|
return null;
|
|
72
85
|
}
|
|
73
|
-
|
|
74
86
|
if (child.type === React.Fragment) {
|
|
75
87
|
var _child$props;
|
|
76
|
-
|
|
77
88
|
extractChildren((_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.children);
|
|
78
89
|
}
|
|
79
|
-
|
|
80
90
|
if ((_child$props2 = child.props) !== null && _child$props2 !== void 0 && _child$props2.hidden) {
|
|
81
91
|
return null;
|
|
82
92
|
}
|
|
83
|
-
|
|
84
93
|
if (child.type === Tab.Tab) {
|
|
85
94
|
var _child$props3, _child$props4;
|
|
86
|
-
|
|
87
95
|
tabs.push({
|
|
88
96
|
key: index,
|
|
89
97
|
trigger: (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.trigger,
|
|
@@ -92,25 +100,23 @@ var Tabs = React__default['default'].forwardRef(function Tabs(_ref, forwardedRef
|
|
|
92
100
|
}
|
|
93
101
|
});
|
|
94
102
|
}
|
|
95
|
-
|
|
96
103
|
extractChildren(children);
|
|
97
|
-
|
|
98
104
|
if (!tabs.some(function (tab) {
|
|
99
105
|
return (tab === null || tab === void 0 ? void 0 : tab.key) === activeTab;
|
|
100
106
|
})) {
|
|
101
107
|
var _tabs$;
|
|
102
|
-
|
|
103
108
|
setActiveTab((_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.key);
|
|
104
109
|
}
|
|
105
|
-
|
|
106
110
|
return tabs;
|
|
107
111
|
}, [children]);
|
|
108
|
-
return React__default[
|
|
112
|
+
return React__default["default"].createElement(Tabs$1, defaultTheme._extends({
|
|
109
113
|
ref: forwardedRef
|
|
110
114
|
}, props, {
|
|
111
115
|
role: "tablist"
|
|
112
|
-
}), React__default[
|
|
113
|
-
|
|
116
|
+
}), React__default["default"].createElement(TabHeaders, {
|
|
117
|
+
customPadding: customPadding
|
|
118
|
+
}, tabs.map(function (tab) {
|
|
119
|
+
return React__default["default"].createElement(TabHeader, {
|
|
114
120
|
key: tab.key,
|
|
115
121
|
hidden: tab.hidden,
|
|
116
122
|
active: tab.key === activeTab,
|
|
@@ -119,25 +125,29 @@ var Tabs = React__default['default'].forwardRef(function Tabs(_ref, forwardedRef
|
|
|
119
125
|
},
|
|
120
126
|
role: "tab"
|
|
121
127
|
}, tab.trigger);
|
|
122
|
-
})), React__default[
|
|
123
|
-
|
|
128
|
+
})), React__default["default"].createElement(TabHeaderBorder, {
|
|
129
|
+
customPadding: customPadding
|
|
130
|
+
}), React__default["default"].createElement(TabContent, null, tabs.map(function (tab) {
|
|
131
|
+
return React__default["default"].createElement("div", {
|
|
124
132
|
ref: tab.key === (activeTab === null || activeTab === void 0 ? void 0 : activeTab.key) ? contentRef : null,
|
|
125
133
|
key: tab.key,
|
|
126
134
|
role: "tabpanel",
|
|
127
135
|
hidden: tab.key !== activeTab,
|
|
128
136
|
style: {
|
|
129
|
-
minHeight: !lodash.isEmpty(
|
|
137
|
+
minHeight: !lodash.isEmpty(defaultMinHeight) ? defaultMinHeight : ''
|
|
130
138
|
}
|
|
131
139
|
}, tab.content);
|
|
132
140
|
})));
|
|
133
141
|
});
|
|
134
142
|
Tabs.defaultProps = {
|
|
135
|
-
defaultMinHeight: ''
|
|
143
|
+
defaultMinHeight: '',
|
|
144
|
+
customPadding: 0
|
|
136
145
|
};
|
|
137
146
|
Tabs.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
138
147
|
children: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.array, defaultTheme.PropTypes.object]),
|
|
139
148
|
backgroundColor: defaultTheme.PropTypes.string,
|
|
140
|
-
defaultMinHeight: defaultTheme.PropTypes.string
|
|
149
|
+
defaultMinHeight: defaultTheme.PropTypes.string,
|
|
150
|
+
customPadding: defaultTheme.PropTypes.string
|
|
141
151
|
} : {};
|
|
142
152
|
|
|
143
153
|
exports.Tabs = Tabs;
|