@janiscommerce/ui-web 1.5.0-beta.8 → 1.6.0-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/CHANGELOG.md +36 -0
- package/dist/index.esm.js +15 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +15 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -36286,7 +36286,7 @@
|
|
|
36286
36286
|
ContentWrapper: ContentWrapper
|
|
36287
36287
|
};
|
|
36288
36288
|
|
|
36289
|
-
var AVAILABLE_ICONS = ['minus_big_light', 'plus_big_light', 'arrow_down_flat', 'arrow_up_flat'];
|
|
36289
|
+
var AVAILABLE_ICONS = ['minus_big_light', 'plus_big_light', 'arrow_down_flat', 'arrow_up_flat', 'chevron_down', 'chevron_up'];
|
|
36290
36290
|
var DEFAULT_TOGGLE_ICON = {
|
|
36291
36291
|
iconNames: {
|
|
36292
36292
|
opened: 'minus_big_light',
|
|
@@ -36329,14 +36329,25 @@
|
|
|
36329
36329
|
isOpenState = _useState2[0],
|
|
36330
36330
|
setIsOpenState = _useState2[1];
|
|
36331
36331
|
|
|
36332
|
+
var _useState3 = React.useState(isOpenState),
|
|
36333
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36334
|
+
isExpanding = _useState4[0],
|
|
36335
|
+
setIsExpanding = _useState4[1];
|
|
36336
|
+
|
|
36332
36337
|
var collapseState = React.useMemo(function () {
|
|
36333
36338
|
return {
|
|
36334
|
-
expandStart:
|
|
36339
|
+
expandStart: function expandStart() {
|
|
36340
|
+
setIsExpanding(true);
|
|
36341
|
+
expandStartHandler();
|
|
36342
|
+
},
|
|
36335
36343
|
expanding: expandingHandler,
|
|
36336
36344
|
expandEnd: expandEndHandler,
|
|
36337
36345
|
collapseStart: collapseStartHandler,
|
|
36338
36346
|
collapsing: collapsingHandler,
|
|
36339
|
-
collapseEnd:
|
|
36347
|
+
collapseEnd: function collapseEnd() {
|
|
36348
|
+
collapseEndHandler();
|
|
36349
|
+
setIsExpanding(false);
|
|
36350
|
+
}
|
|
36340
36351
|
};
|
|
36341
36352
|
}, [expandStartHandler, expandingHandler, expandEndHandler, collapseStartHandler, collapsingHandler, collapseEndHandler]);
|
|
36342
36353
|
|
|
@@ -36385,11 +36396,10 @@
|
|
|
36385
36396
|
if (!renderHeader || !isFunction(renderHeader) || !renderContent || !isFunction(renderContent)) return null;
|
|
36386
36397
|
return /*#__PURE__*/React__default["default"].createElement(styled.Wrapper, {
|
|
36387
36398
|
className: "collapse",
|
|
36388
|
-
|
|
36399
|
+
"data-is-expanding": isExpanding
|
|
36389
36400
|
}, /*#__PURE__*/React__default["default"].createElement(styled.HeaderWrapper, _extends$1({
|
|
36390
36401
|
className: "collapse__header"
|
|
36391
36402
|
}, getToggleProps(togglePropsParams), {
|
|
36392
|
-
isOpen: isOpenState,
|
|
36393
36403
|
position: position
|
|
36394
36404
|
}), /*#__PURE__*/React__default["default"].createElement(styled.CollapseButton, buttonProps), renderHeader()), /*#__PURE__*/React__default["default"].createElement("div", getCollapseProps(), /*#__PURE__*/React__default["default"].createElement(styled.ContentWrapper, {
|
|
36395
36405
|
className: "collapse__content",
|