@commercetools-uikit/collapsible-motion 19.20.0 → 19.21.0
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.
|
@@ -10,6 +10,9 @@ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/in
|
|
|
10
10
|
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
11
11
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
12
12
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
|
+
var _objectDestructuringEmpty = require('@babel/runtime-corejs3/helpers/objectDestructuringEmpty');
|
|
14
|
+
var _extends = require('@babel/runtime-corejs3/helpers/extends');
|
|
15
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
13
16
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
14
17
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
15
18
|
var _pt = require('prop-types');
|
|
@@ -33,11 +36,9 @@ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defin
|
|
|
33
36
|
var _pt__default = /*#__PURE__*/_interopDefault(_pt);
|
|
34
37
|
var isNil__default = /*#__PURE__*/_interopDefault(isNil);
|
|
35
38
|
|
|
39
|
+
const _excluded = ["minHeight"];
|
|
36
40
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
37
41
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
38
|
-
const defaultProps = {
|
|
39
|
-
minHeight: 0
|
|
40
|
-
};
|
|
41
42
|
const getMinHeight = minHeight => minHeight !== 0 ? `${minHeight}px` : minHeight;
|
|
42
43
|
const getVisibility = height => height === 0 ? 'hidden' : 'visible';
|
|
43
44
|
const createOpeningAnimation = function (height) {
|
|
@@ -125,20 +126,23 @@ ControlledCollapsibleMotion.propTypes = process.env.NODE_ENV !== "production" ?
|
|
|
125
126
|
isDefaultClosed: _pt__default["default"].bool
|
|
126
127
|
} : {};
|
|
127
128
|
ControlledCollapsibleMotion.displayName = 'ControlledCollapsibleMotion';
|
|
128
|
-
const UncontrolledCollapsibleMotion =
|
|
129
|
+
const UncontrolledCollapsibleMotion = _ref2 => {
|
|
130
|
+
let _ref2$minHeight = _ref2.minHeight,
|
|
131
|
+
minHeight = _ref2$minHeight === void 0 ? 0 : _ref2$minHeight,
|
|
132
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
129
133
|
const _useToggleState = hooks.useToggleState(!props.isDefaultClosed),
|
|
130
134
|
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
131
135
|
isOpen = _useToggleState2[0],
|
|
132
136
|
toggle = _useToggleState2[1];
|
|
133
|
-
const _useToggleAnimation3 = useToggleAnimation(isOpen, toggle,
|
|
137
|
+
const _useToggleAnimation3 = useToggleAnimation(isOpen, toggle, minHeight),
|
|
134
138
|
_useToggleAnimation4 = _slicedToArray(_useToggleAnimation3, 4),
|
|
135
139
|
animation = _useToggleAnimation4[0],
|
|
136
140
|
containerStyles = _useToggleAnimation4[1],
|
|
137
141
|
animationToggle = _useToggleAnimation4[2],
|
|
138
142
|
registerContentNode = _useToggleAnimation4[3];
|
|
139
143
|
return jsxRuntime.jsx(react.ClassNames, {
|
|
140
|
-
children:
|
|
141
|
-
let css =
|
|
144
|
+
children: _ref3 => {
|
|
145
|
+
let css = _ref3.css;
|
|
142
146
|
let animationStyle = {};
|
|
143
147
|
if (animation) {
|
|
144
148
|
// By calling `css`, emotion injects the required CSS into the document head.
|
|
@@ -168,8 +172,8 @@ UncontrolledCollapsibleMotion.propTypes = process.env.NODE_ENV !== "production"
|
|
|
168
172
|
isDefaultClosed: _pt__default["default"].bool
|
|
169
173
|
} : {};
|
|
170
174
|
UncontrolledCollapsibleMotion.displayName = 'UncontrolledCollapsibleMotion';
|
|
171
|
-
|
|
172
|
-
|
|
175
|
+
const CollapsibleMotion = _ref4 => {
|
|
176
|
+
let props = _extends({}, (_objectDestructuringEmpty(_ref4), _ref4));
|
|
173
177
|
const isControlledComponent = !isNil__default["default"](props.isClosed);
|
|
174
178
|
if (isControlledComponent) {
|
|
175
179
|
return jsxRuntime.jsx(ControlledCollapsibleMotion, _objectSpread({}, props));
|
|
@@ -184,11 +188,10 @@ CollapsibleMotion.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
184
188
|
isDefaultClosed: _pt__default["default"].bool
|
|
185
189
|
} : {};
|
|
186
190
|
CollapsibleMotion.displayName = 'CollapsibleMotion';
|
|
187
|
-
CollapsibleMotion.defaultProps = defaultProps;
|
|
188
191
|
var CollapsibleMotion$1 = CollapsibleMotion;
|
|
189
192
|
|
|
190
193
|
// NOTE: This string will be replaced on build time with the package version.
|
|
191
|
-
var version = "19.
|
|
194
|
+
var version = "19.21.0";
|
|
192
195
|
|
|
193
196
|
exports["default"] = CollapsibleMotion$1;
|
|
194
197
|
exports.version = version;
|
|
@@ -10,6 +10,9 @@ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/in
|
|
|
10
10
|
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
11
11
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
12
12
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
|
+
var _objectDestructuringEmpty = require('@babel/runtime-corejs3/helpers/objectDestructuringEmpty');
|
|
14
|
+
var _extends = require('@babel/runtime-corejs3/helpers/extends');
|
|
15
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
13
16
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
14
17
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
15
18
|
require('prop-types');
|
|
@@ -32,11 +35,9 @@ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$def
|
|
|
32
35
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
33
36
|
var isNil__default = /*#__PURE__*/_interopDefault(isNil);
|
|
34
37
|
|
|
38
|
+
const _excluded = ["minHeight"];
|
|
35
39
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
36
40
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
37
|
-
const defaultProps = {
|
|
38
|
-
minHeight: 0
|
|
39
|
-
};
|
|
40
41
|
const getMinHeight = minHeight => minHeight !== 0 ? `${minHeight}px` : minHeight;
|
|
41
42
|
const getVisibility = height => height === 0 ? 'hidden' : 'visible';
|
|
42
43
|
const createOpeningAnimation = function (height) {
|
|
@@ -116,20 +117,23 @@ const ControlledCollapsibleMotion = props => {
|
|
|
116
117
|
};
|
|
117
118
|
ControlledCollapsibleMotion.propTypes = {};
|
|
118
119
|
ControlledCollapsibleMotion.displayName = 'ControlledCollapsibleMotion';
|
|
119
|
-
const UncontrolledCollapsibleMotion =
|
|
120
|
+
const UncontrolledCollapsibleMotion = _ref2 => {
|
|
121
|
+
let _ref2$minHeight = _ref2.minHeight,
|
|
122
|
+
minHeight = _ref2$minHeight === void 0 ? 0 : _ref2$minHeight,
|
|
123
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
120
124
|
const _useToggleState = hooks.useToggleState(!props.isDefaultClosed),
|
|
121
125
|
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
122
126
|
isOpen = _useToggleState2[0],
|
|
123
127
|
toggle = _useToggleState2[1];
|
|
124
|
-
const _useToggleAnimation3 = useToggleAnimation(isOpen, toggle,
|
|
128
|
+
const _useToggleAnimation3 = useToggleAnimation(isOpen, toggle, minHeight),
|
|
125
129
|
_useToggleAnimation4 = _slicedToArray(_useToggleAnimation3, 4),
|
|
126
130
|
animation = _useToggleAnimation4[0],
|
|
127
131
|
containerStyles = _useToggleAnimation4[1],
|
|
128
132
|
animationToggle = _useToggleAnimation4[2],
|
|
129
133
|
registerContentNode = _useToggleAnimation4[3];
|
|
130
134
|
return jsxRuntime.jsx(react.ClassNames, {
|
|
131
|
-
children:
|
|
132
|
-
let css =
|
|
135
|
+
children: _ref3 => {
|
|
136
|
+
let css = _ref3.css;
|
|
133
137
|
let animationStyle = {};
|
|
134
138
|
if (animation) {
|
|
135
139
|
// By calling `css`, emotion injects the required CSS into the document head.
|
|
@@ -153,8 +157,8 @@ const UncontrolledCollapsibleMotion = props => {
|
|
|
153
157
|
};
|
|
154
158
|
UncontrolledCollapsibleMotion.propTypes = {};
|
|
155
159
|
UncontrolledCollapsibleMotion.displayName = 'UncontrolledCollapsibleMotion';
|
|
156
|
-
|
|
157
|
-
|
|
160
|
+
const CollapsibleMotion = _ref4 => {
|
|
161
|
+
let props = _extends({}, (_objectDestructuringEmpty(_ref4), _ref4));
|
|
158
162
|
const isControlledComponent = !isNil__default["default"](props.isClosed);
|
|
159
163
|
if (isControlledComponent) {
|
|
160
164
|
return jsxRuntime.jsx(ControlledCollapsibleMotion, _objectSpread({}, props));
|
|
@@ -163,11 +167,10 @@ const CollapsibleMotion = props => {
|
|
|
163
167
|
};
|
|
164
168
|
CollapsibleMotion.propTypes = {};
|
|
165
169
|
CollapsibleMotion.displayName = 'CollapsibleMotion';
|
|
166
|
-
CollapsibleMotion.defaultProps = defaultProps;
|
|
167
170
|
var CollapsibleMotion$1 = CollapsibleMotion;
|
|
168
171
|
|
|
169
172
|
// NOTE: This string will be replaced on build time with the package version.
|
|
170
|
-
var version = "19.
|
|
173
|
+
var version = "19.21.0";
|
|
171
174
|
|
|
172
175
|
exports["default"] = CollapsibleMotion$1;
|
|
173
176
|
exports.version = version;
|
|
@@ -6,6 +6,9 @@ import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/inst
|
|
|
6
6
|
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
7
7
|
import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
|
|
8
8
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
9
|
+
import _objectDestructuringEmpty from '@babel/runtime-corejs3/helpers/esm/objectDestructuringEmpty';
|
|
10
|
+
import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
|
|
11
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
9
12
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
10
13
|
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
11
14
|
import _pt from 'prop-types';
|
|
@@ -16,11 +19,9 @@ import isNil from 'lodash/isNil';
|
|
|
16
19
|
import { useToggleState, usePrevious } from '@commercetools-uikit/hooks';
|
|
17
20
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
18
21
|
|
|
22
|
+
const _excluded = ["minHeight"];
|
|
19
23
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
24
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
-
const defaultProps = {
|
|
22
|
-
minHeight: 0
|
|
23
|
-
};
|
|
24
25
|
const getMinHeight = minHeight => minHeight !== 0 ? `${minHeight}px` : minHeight;
|
|
25
26
|
const getVisibility = height => height === 0 ? 'hidden' : 'visible';
|
|
26
27
|
const createOpeningAnimation = function (height) {
|
|
@@ -108,20 +109,23 @@ ControlledCollapsibleMotion.propTypes = process.env.NODE_ENV !== "production" ?
|
|
|
108
109
|
isDefaultClosed: _pt.bool
|
|
109
110
|
} : {};
|
|
110
111
|
ControlledCollapsibleMotion.displayName = 'ControlledCollapsibleMotion';
|
|
111
|
-
const UncontrolledCollapsibleMotion =
|
|
112
|
+
const UncontrolledCollapsibleMotion = _ref2 => {
|
|
113
|
+
let _ref2$minHeight = _ref2.minHeight,
|
|
114
|
+
minHeight = _ref2$minHeight === void 0 ? 0 : _ref2$minHeight,
|
|
115
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
112
116
|
const _useToggleState = useToggleState(!props.isDefaultClosed),
|
|
113
117
|
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
114
118
|
isOpen = _useToggleState2[0],
|
|
115
119
|
toggle = _useToggleState2[1];
|
|
116
|
-
const _useToggleAnimation3 = useToggleAnimation(isOpen, toggle,
|
|
120
|
+
const _useToggleAnimation3 = useToggleAnimation(isOpen, toggle, minHeight),
|
|
117
121
|
_useToggleAnimation4 = _slicedToArray(_useToggleAnimation3, 4),
|
|
118
122
|
animation = _useToggleAnimation4[0],
|
|
119
123
|
containerStyles = _useToggleAnimation4[1],
|
|
120
124
|
animationToggle = _useToggleAnimation4[2],
|
|
121
125
|
registerContentNode = _useToggleAnimation4[3];
|
|
122
126
|
return jsx(ClassNames, {
|
|
123
|
-
children:
|
|
124
|
-
let css =
|
|
127
|
+
children: _ref3 => {
|
|
128
|
+
let css = _ref3.css;
|
|
125
129
|
let animationStyle = {};
|
|
126
130
|
if (animation) {
|
|
127
131
|
// By calling `css`, emotion injects the required CSS into the document head.
|
|
@@ -151,8 +155,8 @@ UncontrolledCollapsibleMotion.propTypes = process.env.NODE_ENV !== "production"
|
|
|
151
155
|
isDefaultClosed: _pt.bool
|
|
152
156
|
} : {};
|
|
153
157
|
UncontrolledCollapsibleMotion.displayName = 'UncontrolledCollapsibleMotion';
|
|
154
|
-
|
|
155
|
-
|
|
158
|
+
const CollapsibleMotion = _ref4 => {
|
|
159
|
+
let props = _extends({}, (_objectDestructuringEmpty(_ref4), _ref4));
|
|
156
160
|
const isControlledComponent = !isNil(props.isClosed);
|
|
157
161
|
if (isControlledComponent) {
|
|
158
162
|
return jsx(ControlledCollapsibleMotion, _objectSpread({}, props));
|
|
@@ -167,10 +171,9 @@ CollapsibleMotion.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
167
171
|
isDefaultClosed: _pt.bool
|
|
168
172
|
} : {};
|
|
169
173
|
CollapsibleMotion.displayName = 'CollapsibleMotion';
|
|
170
|
-
CollapsibleMotion.defaultProps = defaultProps;
|
|
171
174
|
var CollapsibleMotion$1 = CollapsibleMotion;
|
|
172
175
|
|
|
173
176
|
// NOTE: This string will be replaced on build time with the package version.
|
|
174
|
-
var version = "19.
|
|
177
|
+
var version = "19.21.0";
|
|
175
178
|
|
|
176
179
|
export { CollapsibleMotion$1 as default, version };
|
|
@@ -41,8 +41,7 @@ type TNodeRefObject = {
|
|
|
41
41
|
clientHeight: number;
|
|
42
42
|
} & LegacyRef<HTMLDivElement>;
|
|
43
43
|
declare const CollapsibleMotion: {
|
|
44
|
-
(props: TCollapsibleMotionProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
44
|
+
({ ...props }: TCollapsibleMotionProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
45
45
|
displayName: string;
|
|
46
|
-
defaultProps: Pick<TCollapsibleMotionProps, "minHeight">;
|
|
47
46
|
};
|
|
48
47
|
export default CollapsibleMotion;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/collapsible-motion",
|
|
3
3
|
"description": "A component which allows building collapsible elements with an arbitrary height.",
|
|
4
|
-
"version": "19.
|
|
4
|
+
"version": "19.21.0",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/hooks": "19.
|
|
25
|
-
"@commercetools-uikit/utils": "19.
|
|
24
|
+
"@commercetools-uikit/hooks": "19.21.0",
|
|
25
|
+
"@commercetools-uikit/utils": "19.21.0",
|
|
26
26
|
"@emotion/react": "^11.10.5",
|
|
27
27
|
"@emotion/styled": "^11.10.5",
|
|
28
28
|
"lodash": "4.17.21",
|