@activecollab/components 1.0.13 → 1.0.17
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/cjs/components/Transitions/Slide/Slide.js +14 -9
- package/dist/cjs/components/Transitions/Slide/Slide.js.map +1 -1
- package/dist/cjs/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.js +6 -3
- package/dist/cjs/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.js.map +1 -1
- package/dist/cjs/components/Transitions/SlideLeftRightTransition/Styles.js +4 -16
- package/dist/cjs/components/Transitions/SlideLeftRightTransition/Styles.js.map +1 -1
- package/dist/esm/components/Transitions/Slide/Slide.d.ts.map +1 -1
- package/dist/esm/components/Transitions/Slide/Slide.js +8 -9
- package/dist/esm/components/Transitions/Slide/Slide.js.map +1 -1
- package/dist/esm/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.d.ts.map +1 -1
- package/dist/esm/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.js +6 -4
- package/dist/esm/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.js.map +1 -1
- package/dist/esm/components/Transitions/SlideLeftRightTransition/Styles.d.ts +2 -3
- package/dist/esm/components/Transitions/SlideLeftRightTransition/Styles.d.ts.map +1 -1
- package/dist/esm/components/Transitions/SlideLeftRightTransition/Styles.js +2 -7
- package/dist/esm/components/Transitions/SlideLeftRightTransition/Styles.js.map +1 -1
- package/dist/index.js +114 -119
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,27 +11,35 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _reactTransitionGroup = require("react-transition-group");
|
|
13
13
|
|
|
14
|
+
var _excluded = ["in", "children", "style", "timeout", "initialDirection"];
|
|
15
|
+
|
|
14
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
17
|
|
|
16
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
19
|
|
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
18
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
23
|
|
|
20
24
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
25
|
|
|
22
26
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
27
|
|
|
28
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
+
|
|
30
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
+
|
|
24
32
|
var Slide = function Slide(_ref) {
|
|
25
33
|
var _ref$in = _ref.in,
|
|
26
34
|
inProp = _ref$in === void 0 ? false : _ref$in,
|
|
27
|
-
onEnter = _ref.onEnter,
|
|
28
|
-
onExited = _ref.onExited,
|
|
29
35
|
children = _ref.children,
|
|
30
36
|
style = _ref.style,
|
|
31
37
|
_ref$timeout = _ref.timeout,
|
|
32
38
|
timeout = _ref$timeout === void 0 ? 300 : _ref$timeout,
|
|
33
39
|
_ref$initialDirection = _ref.initialDirection,
|
|
34
|
-
initialDirection = _ref$initialDirection === void 0 ? "left" : _ref$initialDirection
|
|
40
|
+
initialDirection = _ref$initialDirection === void 0 ? "left" : _ref$initialDirection,
|
|
41
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
42
|
+
|
|
35
43
|
var directionSign;
|
|
36
44
|
|
|
37
45
|
switch (initialDirection) {
|
|
@@ -71,13 +79,10 @@ var Slide = function Slide(_ref) {
|
|
|
71
79
|
transform: "translate(".concat(directionSign, ")")
|
|
72
80
|
}
|
|
73
81
|
};
|
|
74
|
-
return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.Transition, {
|
|
75
|
-
appear: true,
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.Transition, _extends({
|
|
76
83
|
in: inProp,
|
|
77
|
-
timeout: timeout
|
|
78
|
-
|
|
79
|
-
onExited: onExited
|
|
80
|
-
}, function (state) {
|
|
84
|
+
timeout: timeout
|
|
85
|
+
}, rest), function (state) {
|
|
81
86
|
return /*#__PURE__*/(0, _react.cloneElement)(children, {
|
|
82
87
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
83
88
|
visibility: state === "exited" && !inProp ? "hidden" : undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Transitions/Slide/Slide.tsx"],"names":["Slide","in","inProp","
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Transitions/Slide/Slide.tsx"],"names":["Slide","in","inProp","children","style","timeout","initialDirection","rest","directionSign","defaultStyle","transition","transitionStyles","entering","transform","entered","exiting","exited","state","visibility","undefined","props","displayName"],"mappings":";;;;;;;;;AAAA;;AACA;;;;;;;;;;;;;;;;;;;;AASO,IAAMA,KAAiB,GAAG,SAApBA,KAAoB,OAO3B;AAAA,qBANJC,EAMI;AAAA,MANAC,MAMA,wBANS,KAMT;AAAA,MALJC,QAKI,QALJA,QAKI;AAAA,MAJJC,KAII,QAJJA,KAII;AAAA,0BAHJC,OAGI;AAAA,MAHJA,OAGI,6BAHM,GAGN;AAAA,mCAFJC,gBAEI;AAAA,MAFJA,gBAEI,sCAFe,MAEf;AAAA,MADDC,IACC;;AACJ,MAAIC,aAAJ;;AAEA,UAAQF,gBAAR;AACE,SAAK,OAAL;AACEE,MAAAA,aAAa,GAAG,SAAhB;AACA;;AACF,SAAK,KAAL;AACEA,MAAAA,aAAa,GAAG,UAAhB;AACA;;AACF,SAAK,QAAL;AACEA,MAAAA,aAAa,GAAG,SAAhB;AACA;;AACF;AACEA,MAAAA,aAAa,GAAG,UAAhB;AAXJ;;AAcA,MAAMC,YAAY,GAAG,SAAfA,YAAe,CAACJ,OAAD;AAAA,WAAuD;AAC1EK,MAAAA,UAAU,gBAASL,OAAT;AADgE,KAAvD;AAAA,GAArB;;AAIA,MAAMM,gBAAgB,GAAG;AACvBC,IAAAA,QAAQ,EAAE;AACRC,MAAAA,SAAS;AADD,KADa;AAIvBC,IAAAA,OAAO,EAAE;AACPD,MAAAA,SAAS;AADF,KAJc;AAOvBE,IAAAA,OAAO,EAAE;AACPF,MAAAA,SAAS,sBAAeL,aAAf;AADF,KAPc;AAUvBQ,IAAAA,MAAM,EAAE;AACNH,MAAAA,SAAS,sBAAeL,aAAf;AADH;AAVe,GAAzB;AAeA,sBACE,6BAAC,gCAAD;AAAY,IAAA,EAAE,EAAEN,MAAhB;AAAwB,IAAA,OAAO,EAAEG;AAAjC,KAA8CE,IAA9C,GACG,UAACU,KAAD,EAAyB;AACxB,wBAAO,yBAAad,QAAb,EAAuB;AAC5BC,MAAAA,KAAK;AACHc,QAAAA,UAAU,EAAED,KAAK,KAAK,QAAV,IAAsB,CAACf,MAAvB,GAAgC,QAAhC,GAA2CiB;AADpD,SAEAV,YAAY,CAACJ,OAAD,CAFZ,GAGAM,gBAAgB,CAACM,KAAD,CAHhB,GAIAb,KAJA,GAKAD,QAAQ,CAACiB,KAAT,CAAehB,KALf;AADuB,KAAvB,CAAP;AASD,GAXH,CADF;AAeD,CA1DM;;;AA4DPJ,KAAK,CAACqB,WAAN,GAAoB,OAApB","sourcesContent":["import React, { FC, ReactElement, cloneElement } from \"react\";\nimport { Transition } from \"react-transition-group\";\nimport { TransitionProps } from \"../types\";\n\ninterface ISlide extends Omit<TransitionProps, \"timeout\"> {\n children: ReactElement;\n timeout?: number;\n initialDirection?: string;\n}\n\nexport const Slide: FC<ISlide> = ({\n in: inProp = false,\n children,\n style,\n timeout = 300,\n initialDirection = \"left\",\n ...rest\n}) => {\n let directionSign: string;\n\n switch (initialDirection) {\n case \"right\":\n directionSign = \"100%, 0\";\n break;\n case \"top\":\n directionSign = \"0, -100%\";\n break;\n case \"bottom\":\n directionSign = \"0, 100%\";\n break;\n default:\n directionSign = \"-100%, 0\";\n }\n\n const defaultStyle = (timeout: number): Partial<{ transition: string }> => ({\n transition: `all ${timeout}ms ease`,\n });\n\n const transitionStyles = {\n entering: {\n transform: `translate(0,0)`,\n },\n entered: {\n transform: `translate(0,0)`,\n },\n exiting: {\n transform: `translate(${directionSign})`,\n },\n exited: {\n transform: `translate(${directionSign})`,\n },\n };\n\n return (\n <Transition in={inProp} timeout={timeout} {...rest}>\n {(state): ReactElement => {\n return cloneElement(children, {\n style: {\n visibility: state === \"exited\" && !inProp ? \"hidden\" : undefined,\n ...defaultStyle(timeout),\n ...transitionStyles[state],\n ...style,\n ...children.props.style,\n },\n });\n }}\n </Transition>\n );\n};\n\nSlide.displayName = \"Slide\";\n"],"file":"Slide.js"}
|
package/dist/cjs/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.js
CHANGED
|
@@ -7,6 +7,8 @@ exports.SlideLeftRightTransition = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _reactTransitionGroup = require("react-transition-group");
|
|
11
|
+
|
|
10
12
|
var _Styles = require("./Styles");
|
|
11
13
|
|
|
12
14
|
var _excluded = ["children", "direction"];
|
|
@@ -25,12 +27,13 @@ var SlideLeftRightTransition = function SlideLeftRightTransition(_ref) {
|
|
|
25
27
|
direction = _ref$direction === void 0 ? "left" : _ref$direction,
|
|
26
28
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
29
|
|
|
28
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, _extends({
|
|
29
31
|
timeout: 200,
|
|
30
32
|
classNames: "c-slide",
|
|
31
|
-
unmountOnExit: true
|
|
33
|
+
unmountOnExit: true
|
|
34
|
+
}, props), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children, /*#__PURE__*/_react.default.createElement(_Styles.StyledSlideLeftRight, {
|
|
32
35
|
$direction: direction
|
|
33
|
-
}
|
|
36
|
+
})));
|
|
34
37
|
};
|
|
35
38
|
|
|
36
39
|
exports.SlideLeftRightTransition = SlideLeftRightTransition;
|
package/dist/cjs/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.tsx"],"names":["SlideLeftRightTransition","children","direction","props","displayName"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;;;;;;;AAOO,IAAMA,wBAAuD,GAAG,SAA1DA,wBAA0D,OAIjE;AAAA,MAHJC,QAGI,QAHJA,QAGI;AAAA,4BAFJC,SAEI;AAAA,MAFJA,SAEI,+BAFQ,MAER;AAAA,MADDC,KACC;;AACJ,sBACE,6BAAC,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.tsx"],"names":["SlideLeftRightTransition","children","direction","props","displayName"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;;;;;;;;;;;AAOO,IAAMA,wBAAuD,GAAG,SAA1DA,wBAA0D,OAIjE;AAAA,MAHJC,QAGI,QAHJA,QAGI;AAAA,4BAFJC,SAEI;AAAA,MAFJA,SAEI,+BAFQ,MAER;AAAA,MADDC,KACC;;AACJ,sBACE,6BAAC,mCAAD;AAAe,IAAA,OAAO,EAAE,GAAxB;AAA6B,IAAA,UAAU,EAAC,SAAxC;AAAkD,IAAA,aAAa;AAA/D,KAAoEA,KAApE,gBACE,4DACGF,QADH,eAEE,6BAAC,4BAAD;AAAsB,IAAA,UAAU,EAAEC;AAAlC,IAFF,CADF,CADF;AAQD,CAbM;;;AAePF,wBAAwB,CAACI,WAAzB,GAAuC,0BAAvC","sourcesContent":["import React, { FC, ReactElement } from \"react\";\nimport { TransitionProps } from \"../types\";\nimport { CSSTransition } from \"react-transition-group\";\nimport { StyledSlideLeftRight } from \"./Styles\";\n\ninterface ISlideLeftRightTransition extends TransitionProps {\n children: ReactElement;\n direction?: \"left\" | \"right\";\n}\n\nexport const SlideLeftRightTransition: FC<ISlideLeftRightTransition> = ({\n children,\n direction = \"left\",\n ...props\n}) => {\n return (\n <CSSTransition timeout={200} classNames=\"c-slide\" unmountOnExit {...props}>\n <>\n {children}\n <StyledSlideLeftRight $direction={direction} />\n </>\n </CSSTransition>\n );\n};\n\nSlideLeftRightTransition.displayName = \"SlideLeftRightTransition\";\n"],"file":"SlideLeftRightTransition.js"}
|
|
@@ -1,28 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
10
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
-
|
|
12
|
-
var _reactTransitionGroup = require("react-transition-group");
|
|
13
|
-
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
6
|
+
exports.StyledSlideLeftRight = void 0;
|
|
15
7
|
|
|
16
|
-
|
|
8
|
+
var _styledComponents = require("styled-components");
|
|
17
9
|
|
|
18
|
-
var
|
|
19
|
-
displayName: "Styles__StyledSlideLeftRightTransition",
|
|
20
|
-
componentId: "sc-ewkpq8-0"
|
|
21
|
-
})(["", " ", ""], function (props) {
|
|
10
|
+
var StyledSlideLeftRight = (0, _styledComponents.createGlobalStyle)(["", " ", ""], function (props) {
|
|
22
11
|
return props.$direction === "left" && (0, _styledComponents.css)(["&.c-slide-enter{position:absolute;transform:translateX(100%);}&.c-slide-enter-active{transform:translateX(0%);transition:all 200ms ease;}&.c-slide-exit{position:absolute;}&.c-slide-exit-active{transform:translateX(-100%);transition:all 200ms ease;}"]);
|
|
23
12
|
}, function (props) {
|
|
24
13
|
return props.$direction === "right" && (0, _styledComponents.css)(["&.c-slide-enter{position:absolute;transform:translateX(-100%);}&.c-slide-enter-active{transform:translateX(0%);transition:all 200ms ease;}&.c-slide-exit{position:absolute;}&.c-slide-exit-active{transform:translateX(100%);transition:all 200ms ease;}"]);
|
|
25
14
|
});
|
|
26
|
-
exports.
|
|
27
|
-
StyledSlideLeftRightTransition.displayName = "StyledSlideLeftRightTransition";
|
|
15
|
+
exports.StyledSlideLeftRight = StyledSlideLeftRight;
|
|
28
16
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Transitions/SlideLeftRightTransition/Styles.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Transitions/SlideLeftRightTransition/Styles.ts"],"names":["StyledSlideLeftRight","createGlobalStyle","props","$direction","css"],"mappings":";;;;;;;AAAA;;AAEO,IAAMA,oBAAoB,OAAGC,mCAAH,iBAI/B,UAACC,KAAD;AAAA,SACAA,KAAK,CAACC,UAAN,KAAqB,MAArB,QACAC,qBADA,+PADA;AAAA,CAJ+B,EAwB7B,UAACF,KAAD;AAAA,SACAA,KAAK,CAACC,UAAN,KAAqB,OAArB,QACAC,qBADA,+PADA;AAAA,CAxB6B,CAA1B","sourcesContent":["import { createGlobalStyle, css } from \"styled-components\";\n\nexport const StyledSlideLeftRight = createGlobalStyle<{\n $direction: \"left\" | \"right\";\n}>`\n\n${(props) =>\n props.$direction === \"left\" &&\n css`\n &.c-slide-enter {\n position: absolute;\n transform: translateX(100%);\n }\n &.c-slide-enter-active {\n transform: translateX(0%);\n transition: all 200ms ease;\n }\n &.c-slide-exit {\n position: absolute;\n }\n &.c-slide-exit-active {\n transform: translateX(-100%);\n transition: all 200ms ease;\n }\n `}\n\n ${(props) =>\n props.$direction === \"right\" &&\n css`\n &.c-slide-enter {\n position: absolute;\n transform: translateX(-100%);\n }\n &.c-slide-enter-active {\n transform: translateX(0%);\n transition: all 200ms ease;\n }\n\n &.c-slide-exit {\n position: absolute;\n }\n\n &.c-slide-exit-active {\n transform: translateX(100%);\n transition: all 200ms ease;\n }\n `}\n\n`;\n"],"file":"Styles.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slide.d.ts","sourceRoot":"","sources":["../../../../../src/components/Transitions/Slide/Slide.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,YAAY,EAAgB,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,UAAU,MAAO,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC;IACvD,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"Slide.d.ts","sourceRoot":"","sources":["../../../../../src/components/Transitions/Slide/Slide.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,YAAY,EAAgB,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,UAAU,MAAO,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC;IACvD,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,MAAM,CA0D5B,CAAC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["in", "children", "style", "timeout", "initialDirection"];
|
|
2
4
|
import React, { cloneElement } from "react";
|
|
3
5
|
import { Transition } from "react-transition-group";
|
|
4
6
|
export var Slide = function Slide(_ref) {
|
|
5
7
|
var _ref$in = _ref.in,
|
|
6
8
|
inProp = _ref$in === void 0 ? false : _ref$in,
|
|
7
|
-
onEnter = _ref.onEnter,
|
|
8
|
-
onExited = _ref.onExited,
|
|
9
9
|
children = _ref.children,
|
|
10
10
|
style = _ref.style,
|
|
11
11
|
_ref$timeout = _ref.timeout,
|
|
12
12
|
timeout = _ref$timeout === void 0 ? 300 : _ref$timeout,
|
|
13
13
|
_ref$initialDirection = _ref.initialDirection,
|
|
14
|
-
initialDirection = _ref$initialDirection === void 0 ? "left" : _ref$initialDirection
|
|
14
|
+
initialDirection = _ref$initialDirection === void 0 ? "left" : _ref$initialDirection,
|
|
15
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
|
+
|
|
15
17
|
var directionSign;
|
|
16
18
|
|
|
17
19
|
switch (initialDirection) {
|
|
@@ -51,13 +53,10 @@ export var Slide = function Slide(_ref) {
|
|
|
51
53
|
transform: "translate(" + directionSign + ")"
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
|
-
return /*#__PURE__*/React.createElement(Transition, {
|
|
55
|
-
appear: true,
|
|
56
|
+
return /*#__PURE__*/React.createElement(Transition, _extends({
|
|
56
57
|
in: inProp,
|
|
57
|
-
timeout: timeout
|
|
58
|
-
|
|
59
|
-
onExited: onExited
|
|
60
|
-
}, function (state) {
|
|
58
|
+
timeout: timeout
|
|
59
|
+
}, rest), function (state) {
|
|
61
60
|
return /*#__PURE__*/cloneElement(children, {
|
|
62
61
|
style: _extends({
|
|
63
62
|
visibility: state === "exited" && !inProp ? "hidden" : undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Transitions/Slide/Slide.tsx"],"names":["React","cloneElement","Transition","Slide","in","inProp","
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Transitions/Slide/Slide.tsx"],"names":["React","cloneElement","Transition","Slide","in","inProp","children","style","timeout","initialDirection","rest","directionSign","defaultStyle","transition","transitionStyles","entering","transform","entered","exiting","exited","state","visibility","undefined","props","displayName"],"mappings":";;;AAAA,OAAOA,KAAP,IAAkCC,YAAlC,QAAsD,OAAtD;AACA,SAASC,UAAT,QAA2B,wBAA3B;AASA,OAAO,IAAMC,KAAiB,GAAG,SAApBA,KAAoB,OAO3B;AAAA,qBANJC,EAMI;AAAA,MANAC,MAMA,wBANS,KAMT;AAAA,MALJC,QAKI,QALJA,QAKI;AAAA,MAJJC,KAII,QAJJA,KAII;AAAA,0BAHJC,OAGI;AAAA,MAHJA,OAGI,6BAHM,GAGN;AAAA,mCAFJC,gBAEI;AAAA,MAFJA,gBAEI,sCAFe,MAEf;AAAA,MADDC,IACC;;AACJ,MAAIC,aAAJ;;AAEA,UAAQF,gBAAR;AACE,SAAK,OAAL;AACEE,MAAAA,aAAa,GAAG,SAAhB;AACA;;AACF,SAAK,KAAL;AACEA,MAAAA,aAAa,GAAG,UAAhB;AACA;;AACF,SAAK,QAAL;AACEA,MAAAA,aAAa,GAAG,SAAhB;AACA;;AACF;AACEA,MAAAA,aAAa,GAAG,UAAhB;AAXJ;;AAcA,MAAMC,YAAY,GAAG,SAAfA,YAAe,CAACJ,OAAD;AAAA,WAAuD;AAC1EK,MAAAA,UAAU,WAASL,OAAT;AADgE,KAAvD;AAAA,GAArB;;AAIA,MAAMM,gBAAgB,GAAG;AACvBC,IAAAA,QAAQ,EAAE;AACRC,MAAAA,SAAS;AADD,KADa;AAIvBC,IAAAA,OAAO,EAAE;AACPD,MAAAA,SAAS;AADF,KAJc;AAOvBE,IAAAA,OAAO,EAAE;AACPF,MAAAA,SAAS,iBAAeL,aAAf;AADF,KAPc;AAUvBQ,IAAAA,MAAM,EAAE;AACNH,MAAAA,SAAS,iBAAeL,aAAf;AADH;AAVe,GAAzB;AAeA,sBACE,oBAAC,UAAD;AAAY,IAAA,EAAE,EAAEN,MAAhB;AAAwB,IAAA,OAAO,EAAEG;AAAjC,KAA8CE,IAA9C,GACG,UAACU,KAAD,EAAyB;AACxB,wBAAOnB,YAAY,CAACK,QAAD,EAAW;AAC5BC,MAAAA,KAAK;AACHc,QAAAA,UAAU,EAAED,KAAK,KAAK,QAAV,IAAsB,CAACf,MAAvB,GAAgC,QAAhC,GAA2CiB;AADpD,SAEAV,YAAY,CAACJ,OAAD,CAFZ,EAGAM,gBAAgB,CAACM,KAAD,CAHhB,EAIAb,KAJA,EAKAD,QAAQ,CAACiB,KAAT,CAAehB,KALf;AADuB,KAAX,CAAnB;AASD,GAXH,CADF;AAeD,CA1DM;AA4DPJ,KAAK,CAACqB,WAAN,GAAoB,OAApB","sourcesContent":["import React, { FC, ReactElement, cloneElement } from \"react\";\nimport { Transition } from \"react-transition-group\";\nimport { TransitionProps } from \"../types\";\n\ninterface ISlide extends Omit<TransitionProps, \"timeout\"> {\n children: ReactElement;\n timeout?: number;\n initialDirection?: string;\n}\n\nexport const Slide: FC<ISlide> = ({\n in: inProp = false,\n children,\n style,\n timeout = 300,\n initialDirection = \"left\",\n ...rest\n}) => {\n let directionSign: string;\n\n switch (initialDirection) {\n case \"right\":\n directionSign = \"100%, 0\";\n break;\n case \"top\":\n directionSign = \"0, -100%\";\n break;\n case \"bottom\":\n directionSign = \"0, 100%\";\n break;\n default:\n directionSign = \"-100%, 0\";\n }\n\n const defaultStyle = (timeout: number): Partial<{ transition: string }> => ({\n transition: `all ${timeout}ms ease`,\n });\n\n const transitionStyles = {\n entering: {\n transform: `translate(0,0)`,\n },\n entered: {\n transform: `translate(0,0)`,\n },\n exiting: {\n transform: `translate(${directionSign})`,\n },\n exited: {\n transform: `translate(${directionSign})`,\n },\n };\n\n return (\n <Transition in={inProp} timeout={timeout} {...rest}>\n {(state): ReactElement => {\n return cloneElement(children, {\n style: {\n visibility: state === \"exited\" && !inProp ? \"hidden\" : undefined,\n ...defaultStyle(timeout),\n ...transitionStyles[state],\n ...style,\n ...children.props.style,\n },\n });\n }}\n </Transition>\n );\n};\n\nSlide.displayName = \"Slide\";\n"],"file":"Slide.js"}
|
package/dist/esm/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideLeftRightTransition.d.ts","sourceRoot":"","sources":["../../../../../src/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"SlideLeftRightTransition.d.ts","sourceRoot":"","sources":["../../../../../src/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI3C,UAAU,yBAA0B,SAAQ,eAAe;IACzD,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,yBAAyB,CAalE,CAAC"}
|
package/dist/esm/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.js
CHANGED
|
@@ -2,19 +2,21 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["children", "direction"];
|
|
4
4
|
import React from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { CSSTransition } from "react-transition-group";
|
|
6
|
+
import { StyledSlideLeftRight } from "./Styles";
|
|
6
7
|
export var SlideLeftRightTransition = function SlideLeftRightTransition(_ref) {
|
|
7
8
|
var children = _ref.children,
|
|
8
9
|
_ref$direction = _ref.direction,
|
|
9
10
|
direction = _ref$direction === void 0 ? "left" : _ref$direction,
|
|
10
11
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
11
12
|
|
|
12
|
-
return /*#__PURE__*/React.createElement(
|
|
13
|
+
return /*#__PURE__*/React.createElement(CSSTransition, _extends({
|
|
13
14
|
timeout: 200,
|
|
14
15
|
classNames: "c-slide",
|
|
15
|
-
unmountOnExit: true
|
|
16
|
+
unmountOnExit: true
|
|
17
|
+
}, props), /*#__PURE__*/React.createElement(React.Fragment, null, children, /*#__PURE__*/React.createElement(StyledSlideLeftRight, {
|
|
16
18
|
$direction: direction
|
|
17
|
-
}
|
|
19
|
+
})));
|
|
18
20
|
};
|
|
19
21
|
SlideLeftRightTransition.displayName = "SlideLeftRightTransition";
|
|
20
22
|
//# sourceMappingURL=SlideLeftRightTransition.js.map
|
package/dist/esm/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.tsx"],"names":["React","
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Transitions/SlideLeftRightTransition/SlideLeftRightTransition.tsx"],"names":["React","CSSTransition","StyledSlideLeftRight","SlideLeftRightTransition","children","direction","props","displayName"],"mappings":";;;AAAA,OAAOA,KAAP,MAAwC,OAAxC;AAEA,SAASC,aAAT,QAA8B,wBAA9B;AACA,SAASC,oBAAT,QAAqC,UAArC;AAOA,OAAO,IAAMC,wBAAuD,GAAG,SAA1DA,wBAA0D,OAIjE;AAAA,MAHJC,QAGI,QAHJA,QAGI;AAAA,4BAFJC,SAEI;AAAA,MAFJA,SAEI,+BAFQ,MAER;AAAA,MADDC,KACC;;AACJ,sBACE,oBAAC,aAAD;AAAe,IAAA,OAAO,EAAE,GAAxB;AAA6B,IAAA,UAAU,EAAC,SAAxC;AAAkD,IAAA,aAAa;AAA/D,KAAoEA,KAApE,gBACE,0CACGF,QADH,eAEE,oBAAC,oBAAD;AAAsB,IAAA,UAAU,EAAEC;AAAlC,IAFF,CADF,CADF;AAQD,CAbM;AAePF,wBAAwB,CAACI,WAAzB,GAAuC,0BAAvC","sourcesContent":["import React, { FC, ReactElement } from \"react\";\nimport { TransitionProps } from \"../types\";\nimport { CSSTransition } from \"react-transition-group\";\nimport { StyledSlideLeftRight } from \"./Styles\";\n\ninterface ISlideLeftRightTransition extends TransitionProps {\n children: ReactElement;\n direction?: \"left\" | \"right\";\n}\n\nexport const SlideLeftRightTransition: FC<ISlideLeftRightTransition> = ({\n children,\n direction = \"left\",\n ...props\n}) => {\n return (\n <CSSTransition timeout={200} classNames=\"c-slide\" unmountOnExit {...props}>\n <>\n {children}\n <StyledSlideLeftRight $direction={direction} />\n </>\n </CSSTransition>\n );\n};\n\nSlideLeftRightTransition.displayName = \"SlideLeftRightTransition\";\n"],"file":"SlideLeftRightTransition.js"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const StyledSlideLeftRightTransition: import("styled-components").StyledComponent<typeof CSSTransition, any, {
|
|
1
|
+
export declare const StyledSlideLeftRight: import("styled-components").GlobalStyleComponent<{
|
|
3
2
|
$direction: "left" | "right";
|
|
4
|
-
},
|
|
3
|
+
}, import("styled-components").DefaultTheme>;
|
|
5
4
|
//# sourceMappingURL=Styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Transitions/SlideLeftRightTransition/Styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Transitions/SlideLeftRightTransition/Styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB;gBACnB,MAAM,GAAG,OAAO;4CA6C7B,CAAC"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export var StyledSlideLeftRightTransition = styled(CSSTransition).withConfig({
|
|
4
|
-
displayName: "Styles__StyledSlideLeftRightTransition",
|
|
5
|
-
componentId: "sc-ewkpq8-0"
|
|
6
|
-
})(["", " ", ""], function (props) {
|
|
1
|
+
import { createGlobalStyle, css } from "styled-components";
|
|
2
|
+
export var StyledSlideLeftRight = createGlobalStyle(["", " ", ""], function (props) {
|
|
7
3
|
return props.$direction === "left" && css(["&.c-slide-enter{position:absolute;transform:translateX(100%);}&.c-slide-enter-active{transform:translateX(0%);transition:all 200ms ease;}&.c-slide-exit{position:absolute;}&.c-slide-exit-active{transform:translateX(-100%);transition:all 200ms ease;}"]);
|
|
8
4
|
}, function (props) {
|
|
9
5
|
return props.$direction === "right" && css(["&.c-slide-enter{position:absolute;transform:translateX(-100%);}&.c-slide-enter-active{transform:translateX(0%);transition:all 200ms ease;}&.c-slide-exit{position:absolute;}&.c-slide-exit-active{transform:translateX(100%);transition:all 200ms ease;}"]);
|
|
10
6
|
});
|
|
11
|
-
StyledSlideLeftRightTransition.displayName = "StyledSlideLeftRightTransition";
|
|
12
7
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Transitions/SlideLeftRightTransition/Styles.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Transitions/SlideLeftRightTransition/Styles.ts"],"names":["createGlobalStyle","css","StyledSlideLeftRight","props","$direction"],"mappings":"AAAA,SAASA,iBAAT,EAA4BC,GAA5B,QAAuC,mBAAvC;AAEA,OAAO,IAAMC,oBAAoB,GAAGF,iBAAH,gBAI/B,UAACG,KAAD;AAAA,SACAA,KAAK,CAACC,UAAN,KAAqB,MAArB,IACAH,GADA,8PADA;AAAA,CAJ+B,EAwB7B,UAACE,KAAD;AAAA,SACAA,KAAK,CAACC,UAAN,KAAqB,OAArB,IACAH,GADA,8PADA;AAAA,CAxB6B,CAA1B","sourcesContent":["import { createGlobalStyle, css } from \"styled-components\";\n\nexport const StyledSlideLeftRight = createGlobalStyle<{\n $direction: \"left\" | \"right\";\n}>`\n\n${(props) =>\n props.$direction === \"left\" &&\n css`\n &.c-slide-enter {\n position: absolute;\n transform: translateX(100%);\n }\n &.c-slide-enter-active {\n transform: translateX(0%);\n transition: all 200ms ease;\n }\n &.c-slide-exit {\n position: absolute;\n }\n &.c-slide-exit-active {\n transform: translateX(-100%);\n transition: all 200ms ease;\n }\n `}\n\n ${(props) =>\n props.$direction === \"right\" &&\n css`\n &.c-slide-enter {\n position: absolute;\n transform: translateX(-100%);\n }\n &.c-slide-enter-active {\n transform: translateX(0%);\n transition: all 200ms ease;\n }\n\n &.c-slide-exit {\n position: absolute;\n }\n\n &.c-slide-exit-active {\n transform: translateX(100%);\n transition: all 200ms ease;\n }\n `}\n\n`;\n"],"file":"Styles.js"}
|