@thecb/components 11.4.0-beta.0 → 11.4.1-beta.1
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/index.cjs.js +29 -19
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +29 -19
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/form-layouts/FormTextarea.js +0 -1
- package/src/components/molecules/tabs/Tabs.js +18 -9
- package/src/components/molecules/tabs/index.d.ts +21 -0
package/dist/index.cjs.js
CHANGED
|
@@ -25394,9 +25394,6 @@ var FormTextarea = function FormTextarea(_ref8) {
|
|
|
25394
25394
|
onChange: function onChange(e) {
|
|
25395
25395
|
return setValue(e.target.value);
|
|
25396
25396
|
},
|
|
25397
|
-
onBlur: function onBlur(e) {
|
|
25398
|
-
return handleOnBlur(e.target.value);
|
|
25399
|
-
},
|
|
25400
25397
|
value: field.rawValue,
|
|
25401
25398
|
field: field,
|
|
25402
25399
|
showErrors: showErrors,
|
|
@@ -48422,14 +48419,27 @@ var Tab = function Tab(_ref) {
|
|
|
48422
48419
|
}, /*#__PURE__*/React__default.createElement(Text$1, null, label));
|
|
48423
48420
|
};
|
|
48424
48421
|
|
|
48422
|
+
var _excluded$N = ["tabsConfig", "tabsDisplayMode"];
|
|
48425
48423
|
var HORIZONTAL = "horizontal";
|
|
48426
48424
|
var Tabs = function Tabs(_ref) {
|
|
48425
|
+
var _tabsConfig$tabs$;
|
|
48427
48426
|
var tabsConfig = _ref.tabsConfig,
|
|
48428
|
-
tabsDisplayMode = _ref.tabsDisplayMode
|
|
48429
|
-
|
|
48427
|
+
_ref$tabsDisplayMode = _ref.tabsDisplayMode,
|
|
48428
|
+
tabsDisplayMode = _ref$tabsDisplayMode === void 0 ? HORIZONTAL : _ref$tabsDisplayMode,
|
|
48429
|
+
props = _objectWithoutProperties(_ref, _excluded$N);
|
|
48430
|
+
var _useState = React.useState(((_tabsConfig$tabs$ = tabsConfig.tabs[0]) === null || _tabsConfig$tabs$ === void 0 ? void 0 : _tabsConfig$tabs$.label) || null),
|
|
48430
48431
|
_useState2 = _slicedToArray(_useState, 2),
|
|
48431
48432
|
activeTab = _useState2[0],
|
|
48432
48433
|
toggleActiveTab = _useState2[1];
|
|
48434
|
+
React.useEffect(function () {
|
|
48435
|
+
var currentTabExists = tabsConfig.tabs.some(function (tab) {
|
|
48436
|
+
return tab.label === activeTab;
|
|
48437
|
+
});
|
|
48438
|
+
if (!activeTab || !currentTabExists) {
|
|
48439
|
+
var _tabsConfig$tabs$2;
|
|
48440
|
+
toggleActiveTab(((_tabsConfig$tabs$2 = tabsConfig.tabs[0]) === null || _tabsConfig$tabs$2 === void 0 ? void 0 : _tabsConfig$tabs$2.label) || null);
|
|
48441
|
+
}
|
|
48442
|
+
}, [tabsConfig, activeTab]);
|
|
48433
48443
|
var createTabs = function createTabs(tabConfig, activeTab) {
|
|
48434
48444
|
return tabConfig.tabs.map(function (tab) {
|
|
48435
48445
|
return /*#__PURE__*/React__default.createElement(Tab, {
|
|
@@ -48442,7 +48452,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
48442
48452
|
});
|
|
48443
48453
|
});
|
|
48444
48454
|
};
|
|
48445
|
-
var
|
|
48455
|
+
var showHorizontal = function showHorizontal(tabsConfig, activeTab) {
|
|
48446
48456
|
return /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48447
48457
|
justify: "space-around"
|
|
48448
48458
|
}, createTabs(tabsConfig, activeTab));
|
|
@@ -48450,11 +48460,11 @@ var Tabs = function Tabs(_ref) {
|
|
|
48450
48460
|
var showVertical = function showVertical(tabsConfig, activeTab) {
|
|
48451
48461
|
return /*#__PURE__*/React__default.createElement(Stack, null, createTabs(tabsConfig, activeTab));
|
|
48452
48462
|
};
|
|
48453
|
-
return /*#__PURE__*/React__default.createElement(Box, {
|
|
48463
|
+
return /*#__PURE__*/React__default.createElement(Box, _extends({
|
|
48454
48464
|
className: "tabs"
|
|
48455
|
-
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
48465
|
+
}, props), /*#__PURE__*/React__default.createElement(Box, {
|
|
48456
48466
|
className: "tab-list"
|
|
48457
|
-
}, tabsDisplayMode == HORIZONTAL ?
|
|
48467
|
+
}, tabsDisplayMode == HORIZONTAL ? showHorizontal(tabsConfig, activeTab) : showVertical(tabsConfig, activeTab)), /*#__PURE__*/React__default.createElement(Box, {
|
|
48458
48468
|
className: "tab-content"
|
|
48459
48469
|
}, /*#__PURE__*/React__default.createElement(Box, null, tabsConfig.tabs.map(function (tab, idx) {
|
|
48460
48470
|
if (tab.label !== activeTab) return undefined;
|
|
@@ -48563,7 +48573,7 @@ var Timeout = function Timeout(_ref) {
|
|
|
48563
48573
|
};
|
|
48564
48574
|
var Timeout$1 = withWindowSize(Timeout);
|
|
48565
48575
|
|
|
48566
|
-
var _excluded$
|
|
48576
|
+
var _excluded$O = ["variant", "message", "toastOpen", "closeToastNotification", "extraStyles", "minWidth", "maxWidth", "height", "childGap", "backgroundColor", "role", "ariaLive", "screenReaderMessage", "showScreenReaderMessage"];
|
|
48567
48577
|
var VARIANTS = {
|
|
48568
48578
|
SUCCESS: "success",
|
|
48569
48579
|
ERROR: "error"
|
|
@@ -48592,7 +48602,7 @@ var ToastNotification = function ToastNotification(_ref) {
|
|
|
48592
48602
|
screenReaderMessage = _ref.screenReaderMessage,
|
|
48593
48603
|
_ref$showScreenReader = _ref.showScreenReaderMessage,
|
|
48594
48604
|
showScreenReaderMessage = _ref$showScreenReader === void 0 ? true : _ref$showScreenReader,
|
|
48595
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
48605
|
+
rest = _objectWithoutProperties(_ref, _excluded$O);
|
|
48596
48606
|
var screenReaderMessageRef = React.useRef();
|
|
48597
48607
|
var LIVEREGION_TRANSITION_DELAY = 1000;
|
|
48598
48608
|
React.useEffect(function () {
|
|
@@ -48775,7 +48785,7 @@ var PopupMenuItemContainer = styled__default(ButtonWithAction).withConfig({
|
|
|
48775
48785
|
return "\n background-color: ".concat(isDeleteAction ? theme.menuItemHoverBackgroundColorDelete : theme.menuItemHoverBackgroundColor, ";\n ");
|
|
48776
48786
|
});
|
|
48777
48787
|
|
|
48778
|
-
var _excluded$
|
|
48788
|
+
var _excluded$P = ["id", "closeMenuCallback", "action", "themeValues", "text", "hasIcon", "isDeleteAction", "icon", "textExtraStyles", "hoverStyles", "activeStyles", "extraStyles"];
|
|
48779
48789
|
var PopupMenuItem = function PopupMenuItem(_ref) {
|
|
48780
48790
|
var id = _ref.id,
|
|
48781
48791
|
closeMenuCallback = _ref.closeMenuCallback,
|
|
@@ -48791,7 +48801,7 @@ var PopupMenuItem = function PopupMenuItem(_ref) {
|
|
|
48791
48801
|
hoverStyles = _ref.hoverStyles,
|
|
48792
48802
|
activeStyles = _ref.activeStyles,
|
|
48793
48803
|
extraStyles = _ref.extraStyles,
|
|
48794
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
48804
|
+
rest = _objectWithoutProperties(_ref, _excluded$P);
|
|
48795
48805
|
return /*#__PURE__*/React__default.createElement(PopupMenuItemContainer, _extends({
|
|
48796
48806
|
id: id,
|
|
48797
48807
|
role: "menuItem",
|
|
@@ -49030,7 +49040,7 @@ var ActionLinkButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
49030
49040
|
});
|
|
49031
49041
|
});
|
|
49032
49042
|
|
|
49033
|
-
var _excluded$
|
|
49043
|
+
var _excluded$Q = ["width", "height", "color"];
|
|
49034
49044
|
var DropdownIconV2 = function DropdownIconV2(_ref) {
|
|
49035
49045
|
var _ref$width = _ref.width,
|
|
49036
49046
|
width = _ref$width === void 0 ? "18" : _ref$width,
|
|
@@ -49038,7 +49048,7 @@ var DropdownIconV2 = function DropdownIconV2(_ref) {
|
|
|
49038
49048
|
height = _ref$height === void 0 ? "19" : _ref$height,
|
|
49039
49049
|
_ref$color = _ref.color,
|
|
49040
49050
|
color = _ref$color === void 0 ? "#292A33" : _ref$color,
|
|
49041
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
49051
|
+
props = _objectWithoutProperties(_ref, _excluded$Q);
|
|
49042
49052
|
return /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
49043
49053
|
width: width,
|
|
49044
49054
|
height: height,
|
|
@@ -49185,7 +49195,7 @@ var SearchBox = function SearchBox(_ref) {
|
|
|
49185
49195
|
}));
|
|
49186
49196
|
};
|
|
49187
49197
|
|
|
49188
|
-
var _excluded$
|
|
49198
|
+
var _excluded$R = ["width", "height", "color"];
|
|
49189
49199
|
var CheckboxCheckmarkIcon = function CheckboxCheckmarkIcon(_ref) {
|
|
49190
49200
|
var _ref$width = _ref.width,
|
|
49191
49201
|
width = _ref$width === void 0 ? "18" : _ref$width,
|
|
@@ -49193,7 +49203,7 @@ var CheckboxCheckmarkIcon = function CheckboxCheckmarkIcon(_ref) {
|
|
|
49193
49203
|
height = _ref$height === void 0 ? "18" : _ref$height,
|
|
49194
49204
|
_ref$color = _ref.color,
|
|
49195
49205
|
color = _ref$color === void 0 ? "#FEFEFE" : _ref$color,
|
|
49196
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
49206
|
+
props = _objectWithoutProperties(_ref, _excluded$R);
|
|
49197
49207
|
return /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
49198
49208
|
xmlns: "http://www.w3.org/2000/svg",
|
|
49199
49209
|
width: width,
|
|
@@ -49889,7 +49899,7 @@ var fallbackValues$11 = {
|
|
|
49889
49899
|
justifyContent: justifyContent
|
|
49890
49900
|
};
|
|
49891
49901
|
|
|
49892
|
-
var _excluded$
|
|
49902
|
+
var _excluded$S = ["variant", "imageUrl", "isMobile", "theme", "extraStyles"],
|
|
49893
49903
|
_excluded2$2 = ["theme", "isMobile"],
|
|
49894
49904
|
_excluded3 = ["theme", "isMobile"],
|
|
49895
49905
|
_excluded4 = ["theme", "isMobile"];
|
|
@@ -49912,7 +49922,7 @@ var HeroContainer = styled__default(function (_ref2) {
|
|
|
49912
49922
|
isMobile = _ref2.isMobile,
|
|
49913
49923
|
theme = _ref2.theme,
|
|
49914
49924
|
extraStyles = _ref2.extraStyles,
|
|
49915
|
-
props = _objectWithoutProperties(_ref2, _excluded$
|
|
49925
|
+
props = _objectWithoutProperties(_ref2, _excluded$S);
|
|
49916
49926
|
return /*#__PURE__*/React__default.createElement(Box, props);
|
|
49917
49927
|
}).withConfig({
|
|
49918
49928
|
displayName: "HeroImagestyled__HeroContainer",
|