@tecsinapse/react-native-kit 1.12.13 → 1.13.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/components/atoms/Skeleton/Pulse.d.ts +2 -0
  3. package/dist/components/atoms/Skeleton/Pulse.js +44 -0
  4. package/dist/components/atoms/Skeleton/Pulse.js.map +1 -0
  5. package/dist/components/atoms/Skeleton/Skeleton.d.ts +12 -0
  6. package/dist/components/atoms/Skeleton/Skeleton.js +73 -0
  7. package/dist/components/atoms/Skeleton/Skeleton.js.map +1 -0
  8. package/dist/components/atoms/Skeleton/Wave.d.ts +2 -0
  9. package/dist/components/atoms/Skeleton/Wave.js +65 -0
  10. package/dist/components/atoms/Skeleton/Wave.js.map +1 -0
  11. package/dist/components/atoms/Skeleton/animation.d.ts +3 -0
  12. package/dist/components/atoms/Skeleton/animation.js +52 -0
  13. package/dist/components/atoms/Skeleton/animation.js.map +1 -0
  14. package/dist/components/atoms/Skeleton/index.d.ts +1 -0
  15. package/dist/components/atoms/Skeleton/index.js +24 -0
  16. package/dist/components/atoms/Skeleton/index.js.map +1 -0
  17. package/dist/components/atoms/Skeleton/styled.d.ts +7 -0
  18. package/dist/components/atoms/Skeleton/styled.js +29 -0
  19. package/dist/components/atoms/Skeleton/styled.js.map +1 -0
  20. package/dist/components/atoms/Skeleton/types.d.ts +12 -0
  21. package/dist/components/atoms/Skeleton/types.js +6 -0
  22. package/dist/components/atoms/Skeleton/types.js.map +1 -0
  23. package/dist/components/atoms/Text/styled.js +3 -1
  24. package/dist/components/atoms/Text/styled.js.map +1 -1
  25. package/dist/components/molecules/Calendar/Calendar.d.ts +1 -4
  26. package/dist/components/molecules/Calendar/Calendar.js.map +1 -1
  27. package/dist/components/molecules/DatePicker/DatePicker.d.ts +3 -2
  28. package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
  29. package/dist/components/molecules/DatePicker/index.d.ts +1 -1
  30. package/dist/components/molecules/DatePicker/index.js +6 -0
  31. package/dist/components/molecules/DatePicker/index.js.map +1 -1
  32. package/dist/components/molecules/DateTimePicker/DateTimePicker.d.ts +2 -1
  33. package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
  34. package/dist/components/molecules/DateTimePicker/index.d.ts +1 -1
  35. package/dist/components/molecules/DateTimePicker/index.js +6 -0
  36. package/dist/components/molecules/DateTimePicker/index.js.map +1 -1
  37. package/dist/index.d.ts +5 -4
  38. package/dist/index.js +31 -1
  39. package/dist/index.js.map +1 -1
  40. package/package.json +5 -3
  41. package/src/components/atoms/Skeleton/Pulse.tsx +33 -0
  42. package/src/components/atoms/Skeleton/Skeleton.tsx +71 -0
  43. package/src/components/atoms/Skeleton/Wave.tsx +53 -0
  44. package/src/components/atoms/Skeleton/animation.ts +49 -0
  45. package/src/components/atoms/Skeleton/index.ts +1 -0
  46. package/src/components/atoms/Skeleton/styled.ts +12 -0
  47. package/src/components/atoms/Skeleton/types.ts +13 -0
  48. package/src/components/atoms/Text/styled.ts +2 -1
  49. package/src/components/molecules/Calendar/Calendar.tsx +2 -2
  50. package/src/components/molecules/DatePicker/DatePicker.tsx +3 -1
  51. package/src/components/molecules/DatePicker/index.ts +1 -1
  52. package/src/components/molecules/DateTimePicker/DateTimePicker.tsx +3 -1
  53. package/src/components/molecules/DateTimePicker/index.ts +1 -1
  54. package/src/index.ts +24 -4
package/CHANGELOG.md CHANGED
@@ -3,6 +3,38 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.13.0](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-native-kit@1.12.16...@tecsinapse/react-native-kit@1.13.0) (2022-02-02)
7
+
8
+ **Note:** Version bump only for package @tecsinapse/react-native-kit
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.12.16](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-native-kit@1.12.15...@tecsinapse/react-native-kit@1.12.16) (2022-01-28)
15
+
16
+ **Note:** Version bump only for package @tecsinapse/react-native-kit
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.12.15](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-native-kit@1.12.14...@tecsinapse/react-native-kit@1.12.15) (2022-01-24)
23
+
24
+ **Note:** Version bump only for package @tecsinapse/react-native-kit
25
+
26
+
27
+
28
+
29
+
30
+ ## [1.12.14](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-native-kit@1.12.13...@tecsinapse/react-native-kit@1.12.14) (2022-01-19)
31
+
32
+ **Note:** Version bump only for package @tecsinapse/react-native-kit
33
+
34
+
35
+
36
+
37
+
6
38
  ## [1.12.13](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-native-kit@1.12.12...@tecsinapse/react-native-kit@1.12.13) (2022-01-18)
7
39
 
8
40
  **Note:** Version bump only for package @tecsinapse/react-native-kit
@@ -0,0 +1,2 @@
1
+ import { IAnimationComponent } from './types';
2
+ export declare const Pulse: ({ active, width, height, childrenLayout, }: IAnimationComponent) => JSX.Element;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Pulse = void 0;
7
+
8
+ var _reactNative = require("react-native");
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _animation = require("./animation");
13
+
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+
16
+ 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
+
18
+ const Pulse = ({
19
+ active = true,
20
+ width,
21
+ height,
22
+ childrenLayout
23
+ }) => {
24
+ const animatedValue = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
25
+ (0, _react.useEffect)(() => {
26
+ (0, _animation.pulseAnimation)(active, animatedValue);
27
+ }, [active]);
28
+ return _react.default.createElement(_reactNative.Animated.View, {
29
+ style: {
30
+ width: width ?? childrenLayout.width,
31
+ height: height ?? childrenLayout.height,
32
+ backgroundColor: 'rgba(0,0,0,0.05)',
33
+ position: 'absolute',
34
+ top: childrenLayout.x ?? 0,
35
+ left: childrenLayout.y ?? 0,
36
+ zIndex: 2,
37
+ overflow: 'hidden',
38
+ opacity: animatedValue
39
+ }
40
+ });
41
+ };
42
+
43
+ exports.Pulse = Pulse;
44
+ //# sourceMappingURL=Pulse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Pulse.tsx"],"names":["Pulse","active","width","height","childrenLayout","animatedValue","Animated","Value","current","backgroundColor","position","top","x","left","y","zIndex","overflow","opacity"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAGO,MAAMA,KAAK,GAAG,CAAC;AACpBC,EAAAA,MAAM,GAAG,IADW;AAEpBC,EAAAA,KAFoB;AAGpBC,EAAAA,MAHoB;AAIpBC,EAAAA;AAJoB,CAAD,KAKM;AACzB,QAAMC,aAAa,GAAG,mBAAO,IAAIC,sBAASC,KAAb,CAAmB,CAAnB,CAAP,EAA8BC,OAApD;AAEA,wBAAU,MAAM;AACd,mCAAeP,MAAf,EAAuBI,aAAvB;AACD,GAFD,EAEG,CAACJ,MAAD,CAFH;AAIA,SACE,6BAAC,qBAAD,CAAU,IAAV;AACE,IAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAEA,KAAK,IAAIE,cAAc,CAACF,KAD1B;AAELC,MAAAA,MAAM,EAAEA,MAAM,IAAIC,cAAc,CAACD,MAF5B;AAGLM,MAAAA,eAAe,EAAE,kBAHZ;AAILC,MAAAA,QAAQ,EAAE,UAJL;AAKLC,MAAAA,GAAG,EAAEP,cAAc,CAACQ,CAAf,IAAoB,CALpB;AAMLC,MAAAA,IAAI,EAAET,cAAc,CAACU,CAAf,IAAoB,CANrB;AAOLC,MAAAA,MAAM,EAAE,CAPH;AAQLC,MAAAA,QAAQ,EAAE,QARL;AASLC,MAAAA,OAAO,EAAEZ;AATJ;AADT,IADF;AAeD,CA3BM","sourcesContent":["import { Animated } from 'react-native';\nimport React, { useEffect, useRef } from 'react';\nimport { pulseAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nexport const Pulse = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n useEffect(() => {\n pulseAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <Animated.View\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n backgroundColor: 'rgba(0,0,0,0.05)',\n position: 'absolute',\n top: childrenLayout.x ?? 0,\n left: childrenLayout.y ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n opacity: animatedValue,\n }}\n />\n );\n};\n"],"file":"Pulse.js"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { BorderRadiusType } from '@tecsinapse/react-core';
3
+ import { ViewProps } from 'react-native';
4
+ export interface SkeletonProps extends ViewProps {
5
+ width?: number;
6
+ height?: number;
7
+ radius?: BorderRadiusType;
8
+ active?: boolean;
9
+ animation?: 'wave' | 'pulse';
10
+ }
11
+ declare const Skeleton: React.FC<SkeletonProps>;
12
+ export default Skeleton;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _styled = require("./styled");
13
+
14
+ var _Wave = require("./Wave");
15
+
16
+ var _Pulse = require("./Pulse");
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ 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; }
21
+
22
+ 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); }
23
+
24
+ const Skeleton = ({
25
+ children,
26
+ width,
27
+ height,
28
+ radius,
29
+ active = true,
30
+ animation = 'wave',
31
+ ...rest
32
+ }) => {
33
+ const [childrenLayout, setChildrenLayout] = (0, _react.useState)({
34
+ width: 0,
35
+ height: 0,
36
+ y: 0,
37
+ x: 0
38
+ });
39
+
40
+ if (!width && !height && !children) {
41
+ throw new Error('[Skeleton] You should provide children or specify width and height');
42
+ }
43
+
44
+ const getChildrenLayout = event => {
45
+ setChildrenLayout(event.nativeEvent.layout);
46
+ };
47
+
48
+ return _react.default.createElement(_styled.Wrapper, _extends({
49
+ width: width,
50
+ height: height,
51
+ radius: radius
52
+ }, rest), active && animation === 'wave' ? _react.default.createElement(_Wave.Wave, {
53
+ active: active,
54
+ width: width,
55
+ height: height,
56
+ childrenLayout: childrenLayout
57
+ }) : _react.default.createElement(_Pulse.Pulse, {
58
+ active: active,
59
+ width: width,
60
+ height: height,
61
+ childrenLayout: childrenLayout
62
+ }), _react.default.createElement(_reactNative.View, {
63
+ onLayout: event => getChildrenLayout(event),
64
+ style: {
65
+ opacity: active ? 0 : 1
66
+ },
67
+ pointerEvents: active ? 'none' : 'auto'
68
+ }, children));
69
+ };
70
+
71
+ var _default = Skeleton;
72
+ exports.default = _default;
73
+ //# sourceMappingURL=Skeleton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Skeleton.tsx"],"names":["Skeleton","children","width","height","radius","active","animation","rest","childrenLayout","setChildrenLayout","y","x","Error","getChildrenLayout","event","nativeEvent","layout","opacity"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAWA,MAAMA,QAAiC,GAAG,CAAC;AACzCC,EAAAA,QADyC;AAEzCC,EAAAA,KAFyC;AAGzCC,EAAAA,MAHyC;AAIzCC,EAAAA,MAJyC;AAKzCC,EAAAA,MAAM,GAAG,IALgC;AAMzCC,EAAAA,SAAS,GAAG,MAN6B;AAOzC,KAAGC;AAPsC,CAAD,KAQpC;AACJ,QAAM,CAACC,cAAD,EAAiBC,iBAAjB,IAAsC,qBAAyB;AACnEP,IAAAA,KAAK,EAAE,CAD4D;AAEnEC,IAAAA,MAAM,EAAE,CAF2D;AAGnEO,IAAAA,CAAC,EAAE,CAHgE;AAInEC,IAAAA,CAAC,EAAE;AAJgE,GAAzB,CAA5C;;AAOA,MAAI,CAACT,KAAD,IAAU,CAACC,MAAX,IAAqB,CAACF,QAA1B,EAAoC;AAClC,UAAM,IAAIW,KAAJ,CACJ,oEADI,CAAN;AAGD;;AAED,QAAMC,iBAAiB,GAAIC,KAAD,IAA8B;AACtDL,IAAAA,iBAAiB,CAACK,KAAK,CAACC,WAAN,CAAkBC,MAAnB,CAAjB;AACD,GAFD;;AAIA,SACE,6BAAC,eAAD;AAAS,IAAA,KAAK,EAAEd,KAAhB;AAAuB,IAAA,MAAM,EAAEC,MAA/B;AAAuC,IAAA,MAAM,EAAEC;AAA/C,KAA2DG,IAA3D,GACGF,MAAM,IAAIC,SAAS,KAAK,MAAxB,GACC,6BAAC,UAAD;AACE,IAAA,MAAM,EAAED,MADV;AAEE,IAAA,KAAK,EAAEH,KAFT;AAGE,IAAA,MAAM,EAAEC,MAHV;AAIE,IAAA,cAAc,EAAEK;AAJlB,IADD,GAQC,6BAAC,YAAD;AACE,IAAA,MAAM,EAAEH,MADV;AAEE,IAAA,KAAK,EAAEH,KAFT;AAGE,IAAA,MAAM,EAAEC,MAHV;AAIE,IAAA,cAAc,EAAEK;AAJlB,IATJ,EAgBE,6BAAC,iBAAD;AACE,IAAA,QAAQ,EAAEM,KAAK,IAAID,iBAAiB,CAACC,KAAD,CADtC;AAEE,IAAA,KAAK,EAAE;AAAEG,MAAAA,OAAO,EAAEZ,MAAM,GAAG,CAAH,GAAO;AAAxB,KAFT;AAGE,IAAA,aAAa,EAAEA,MAAM,GAAG,MAAH,GAAY;AAHnC,KAKGJ,QALH,CAhBF,CADF;AA0BD,CApDD;;eAsDeD,Q","sourcesContent":["import React, { useState } from 'react';\nimport { BorderRadiusType } from '@tecsinapse/react-core';\nimport { LayoutChangeEvent, View, ViewProps } from 'react-native';\nimport { Wrapper } from './styled';\nimport { Wave } from './Wave';\nimport { Pulse } from './Pulse';\nimport { ChildrenLayout } from './types';\n\nexport interface SkeletonProps extends ViewProps {\n width?: number;\n height?: number;\n radius?: BorderRadiusType;\n active?: boolean;\n animation?: 'wave' | 'pulse';\n}\n\nconst Skeleton: React.FC<SkeletonProps> = ({\n children,\n width,\n height,\n radius,\n active = true,\n animation = 'wave',\n ...rest\n}) => {\n const [childrenLayout, setChildrenLayout] = useState<ChildrenLayout>({\n width: 0,\n height: 0,\n y: 0,\n x: 0,\n });\n\n if (!width && !height && !children) {\n throw new Error(\n '[Skeleton] You should provide children or specify width and height'\n );\n }\n\n const getChildrenLayout = (event: LayoutChangeEvent) => {\n setChildrenLayout(event.nativeEvent.layout);\n };\n\n return (\n <Wrapper width={width} height={height} radius={radius} {...rest}>\n {active && animation === 'wave' ? (\n <Wave\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n ) : (\n <Pulse\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n )}\n <View\n onLayout={event => getChildrenLayout(event)}\n style={{ opacity: active ? 0 : 1 }}\n pointerEvents={active ? 'none' : 'auto'}\n >\n {children}\n </View>\n </Wrapper>\n );\n};\n\nexport default Skeleton;\n"],"file":"Skeleton.js"}
@@ -0,0 +1,2 @@
1
+ import { IAnimationComponent } from './types';
2
+ export declare const Wave: ({ active, width, height, childrenLayout, }: IAnimationComponent) => JSX.Element;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Wave = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _reactNativeLinearGradient = _interopRequireDefault(require("react-native-linear-gradient"));
13
+
14
+ var _animation = require("./animation");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ 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; }
21
+
22
+ const AnimatedLinearGradient = _reactNative.Animated.createAnimatedComponent(_reactNativeLinearGradient.default);
23
+
24
+ const Wave = ({
25
+ active = true,
26
+ width,
27
+ height,
28
+ childrenLayout
29
+ }) => {
30
+ const range = width ?? childrenLayout.width;
31
+ const animatedValue = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
32
+ const translateX = animatedValue.interpolate({
33
+ inputRange: [0, 1],
34
+ outputRange: [-range, range]
35
+ });
36
+ (0, _react.useEffect)(() => {
37
+ (0, _animation.waveAnimation)(active, animatedValue);
38
+ }, [active]);
39
+ return _react.default.createElement(AnimatedLinearGradient, {
40
+ colors: ['transparent', 'rgba(0,0,0,0.05)', 'rgba(0,0,0,0.1)', 'transparent'],
41
+ start: {
42
+ x: 0,
43
+ y: 0
44
+ },
45
+ end: {
46
+ x: 1,
47
+ y: 0
48
+ },
49
+ style: {
50
+ width: width ?? childrenLayout.width,
51
+ height: height ?? childrenLayout.height,
52
+ position: 'absolute',
53
+ top: childrenLayout.y ?? 0,
54
+ left: childrenLayout.x ?? 0,
55
+ zIndex: 2,
56
+ overflow: 'hidden',
57
+ transform: [{
58
+ translateX: translateX
59
+ }]
60
+ }
61
+ });
62
+ };
63
+
64
+ exports.Wave = Wave;
65
+ //# sourceMappingURL=Wave.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Wave.tsx"],"names":["AnimatedLinearGradient","Animated","createAnimatedComponent","LinearGradient","Wave","active","width","height","childrenLayout","range","animatedValue","Value","current","translateX","interpolate","inputRange","outputRange","x","y","position","top","left","zIndex","overflow","transform"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AAGA,MAAMA,sBAAsB,GAAGC,sBAASC,uBAAT,CAAiCC,kCAAjC,CAA/B;;AAEO,MAAMC,IAAI,GAAG,CAAC;AACnBC,EAAAA,MAAM,GAAG,IADU;AAEnBC,EAAAA,KAFmB;AAGnBC,EAAAA,MAHmB;AAInBC,EAAAA;AAJmB,CAAD,KAKO;AACzB,QAAMC,KAAK,GAAGH,KAAK,IAAIE,cAAc,CAACF,KAAtC;AACA,QAAMI,aAAa,GAAG,mBAAO,IAAIT,sBAASU,KAAb,CAAmB,CAAnB,CAAP,EAA8BC,OAApD;AAEA,QAAMC,UAAU,GAAGH,aAAa,CAACI,WAAd,CAA0B;AAC3CC,IAAAA,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CAD+B;AAE3CC,IAAAA,WAAW,EAAE,CAAC,CAACP,KAAF,EAASA,KAAT;AAF8B,GAA1B,CAAnB;AAKA,wBAAU,MAAM;AACd,kCAAcJ,MAAd,EAAsBK,aAAtB;AACD,GAFD,EAEG,CAACL,MAAD,CAFH;AAIA,SACE,6BAAC,sBAAD;AACE,IAAA,MAAM,EAAE,CACN,aADM,EAEN,kBAFM,EAGN,iBAHM,EAIN,aAJM,CADV;AAOE,IAAA,KAAK,EAAE;AAAEY,MAAAA,CAAC,EAAE,CAAL;AAAQC,MAAAA,CAAC,EAAE;AAAX,KAPT;AAQE,IAAA,GAAG,EAAE;AAAED,MAAAA,CAAC,EAAE,CAAL;AAAQC,MAAAA,CAAC,EAAE;AAAX,KARP;AASE,IAAA,KAAK,EAAE;AACLZ,MAAAA,KAAK,EAAEA,KAAK,IAAIE,cAAc,CAACF,KAD1B;AAELC,MAAAA,MAAM,EAAEA,MAAM,IAAIC,cAAc,CAACD,MAF5B;AAGLY,MAAAA,QAAQ,EAAE,UAHL;AAILC,MAAAA,GAAG,EAAEZ,cAAc,CAACU,CAAf,IAAoB,CAJpB;AAKLG,MAAAA,IAAI,EAAEb,cAAc,CAACS,CAAf,IAAoB,CALrB;AAMLK,MAAAA,MAAM,EAAE,CANH;AAOLC,MAAAA,QAAQ,EAAE,QAPL;AAQLC,MAAAA,SAAS,EAAE,CACT;AACEX,QAAAA,UAAU,EAAEA;AADd,OADS;AARN;AATT,IADF;AA0BD,CA5CM","sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Animated } from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\nimport { waveAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nconst AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient);\n\nexport const Wave = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const range = width ?? childrenLayout.width;\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n const translateX = animatedValue.interpolate({\n inputRange: [0, 1],\n outputRange: [-range, range],\n });\n\n useEffect(() => {\n waveAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <AnimatedLinearGradient\n colors={[\n 'transparent',\n 'rgba(0,0,0,0.05)',\n 'rgba(0,0,0,0.1)',\n 'transparent',\n ]}\n start={{ x: 0, y: 0 }}\n end={{ x: 1, y: 0 }}\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n position: 'absolute',\n top: childrenLayout.y ?? 0,\n left: childrenLayout.x ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n transform: [\n {\n translateX: translateX,\n },\n ],\n }}\n />\n );\n};\n"],"file":"Wave.js"}
@@ -0,0 +1,3 @@
1
+ import { Animated } from 'react-native';
2
+ export declare const waveAnimation: (active: boolean, animatedValue: Animated.Value) => void;
3
+ export declare const pulseAnimation: (active: boolean, animatedValue: Animated.Value) => void;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.pulseAnimation = exports.waveAnimation = void 0;
7
+
8
+ var _reactNative = require("react-native");
9
+
10
+ const waveAnimation = (active, animatedValue) => {
11
+ if (active) {
12
+ _reactNative.Animated.loop(_reactNative.Animated.timing(animatedValue, {
13
+ toValue: 1,
14
+ duration: 1600,
15
+ easing: _reactNative.Easing.inOut(_reactNative.Easing.linear),
16
+ useNativeDriver: true
17
+ })).start();
18
+
19
+ return;
20
+ }
21
+
22
+ _reactNative.Animated.timing(animatedValue, {
23
+ toValue: 0,
24
+ useNativeDriver: true
25
+ }).start();
26
+ };
27
+
28
+ exports.waveAnimation = waveAnimation;
29
+
30
+ const pulseAnimation = (active, animatedValue) => {
31
+ if (active) {
32
+ _reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.timing(animatedValue, {
33
+ toValue: 1,
34
+ duration: 800,
35
+ useNativeDriver: true
36
+ }), _reactNative.Animated.timing(animatedValue, {
37
+ toValue: 0,
38
+ duration: 800,
39
+ useNativeDriver: true
40
+ })])).start();
41
+
42
+ return;
43
+ }
44
+
45
+ _reactNative.Animated.timing(animatedValue, {
46
+ toValue: 0,
47
+ useNativeDriver: true
48
+ }).start();
49
+ };
50
+
51
+ exports.pulseAnimation = pulseAnimation;
52
+ //# sourceMappingURL=animation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/atoms/Skeleton/animation.ts"],"names":["waveAnimation","active","animatedValue","Animated","loop","timing","toValue","duration","easing","Easing","inOut","linear","useNativeDriver","start","pulseAnimation","sequence"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,aAAa,GAAG,CAC3BC,MAD2B,EAE3BC,aAF2B,KAGlB;AACT,MAAID,MAAJ,EAAY;AACVE,0BAASC,IAAT,CACED,sBAASE,MAAT,CAAgBH,aAAhB,EAA+B;AAC7BI,MAAAA,OAAO,EAAE,CADoB;AAE7BC,MAAAA,QAAQ,EAAE,IAFmB;AAG7BC,MAAAA,MAAM,EAAEC,oBAAOC,KAAP,CAAaD,oBAAOE,MAApB,CAHqB;AAI7BC,MAAAA,eAAe,EAAE;AAJY,KAA/B,CADF,EAOEC,KAPF;;AAQA;AACD;;AACDV,wBAASE,MAAT,CAAgBH,aAAhB,EAA+B;AAC7BI,IAAAA,OAAO,EAAE,CADoB;AAE7BM,IAAAA,eAAe,EAAE;AAFY,GAA/B,EAGGC,KAHH;AAID,CAnBM;;;;AAqBA,MAAMC,cAAc,GAAG,CAC5Bb,MAD4B,EAE5BC,aAF4B,KAGnB;AACT,MAAID,MAAJ,EAAY;AACVE,0BAASC,IAAT,CACED,sBAASY,QAAT,CAAkB,CAChBZ,sBAASE,MAAT,CAAgBH,aAAhB,EAA+B;AAC7BI,MAAAA,OAAO,EAAE,CADoB;AAE7BC,MAAAA,QAAQ,EAAE,GAFmB;AAG7BK,MAAAA,eAAe,EAAE;AAHY,KAA/B,CADgB,EAMhBT,sBAASE,MAAT,CAAgBH,aAAhB,EAA+B;AAC7BI,MAAAA,OAAO,EAAE,CADoB;AAE7BC,MAAAA,QAAQ,EAAE,GAFmB;AAG7BK,MAAAA,eAAe,EAAE;AAHY,KAA/B,CANgB,CAAlB,CADF,EAaEC,KAbF;;AAcA;AACD;;AACDV,wBAASE,MAAT,CAAgBH,aAAhB,EAA+B;AAC7BI,IAAAA,OAAO,EAAE,CADoB;AAE7BM,IAAAA,eAAe,EAAE;AAFY,GAA/B,EAGGC,KAHH;AAID,CAzBM","sourcesContent":["import { Animated, Easing } from 'react-native';\n\nexport const waveAnimation = (\n active: boolean,\n animatedValue: Animated.Value\n): void => {\n if (active) {\n Animated.loop(\n Animated.timing(animatedValue, {\n toValue: 1,\n duration: 1600,\n easing: Easing.inOut(Easing.linear),\n useNativeDriver: true,\n })\n ).start();\n return;\n }\n Animated.timing(animatedValue, {\n toValue: 0,\n useNativeDriver: true,\n }).start();\n};\n\nexport const pulseAnimation = (\n active: boolean,\n animatedValue: Animated.Value\n): void => {\n if (active) {\n Animated.loop(\n Animated.sequence([\n Animated.timing(animatedValue, {\n toValue: 1,\n duration: 800,\n useNativeDriver: true,\n }),\n Animated.timing(animatedValue, {\n toValue: 0,\n duration: 800,\n useNativeDriver: true,\n }),\n ])\n ).start();\n return;\n }\n Animated.timing(animatedValue, {\n toValue: 0,\n useNativeDriver: true,\n }).start();\n};\n"],"file":"animation.js"}
@@ -0,0 +1 @@
1
+ export { default as Skeleton, SkeletonProps } from './Skeleton';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Skeleton", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _Skeleton.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "SkeletonProps", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _Skeleton.SkeletonProps;
16
+ }
17
+ });
18
+
19
+ var _Skeleton = _interopRequireWildcard(require("./Skeleton"));
20
+
21
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
22
+
23
+ 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; }
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/atoms/Skeleton/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as Skeleton, SkeletonProps } from './Skeleton';\n"],"file":"index.js"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare const Wrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ } & Partial<any>, {}, {
6
+ ref?: import("react").Ref<import("react-native").View> | undefined;
7
+ }>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Wrapper = void 0;
7
+
8
+ var _native = _interopRequireDefault(require("@emotion/native"));
9
+
10
+ var _reactCore = require("@tecsinapse/react-core");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ const Wrapper = _native.default.View`
15
+ width: ${({
16
+ width
17
+ }) => width ? `${(0, _reactCore.RFValueStr)(`${width}px`)}` : '100%'};
18
+ height: ${({
19
+ height
20
+ }) => height ? `${(0, _reactCore.RFValueStr)(`${height}px`)}` : 'auto'};
21
+ border-radius: ${({
22
+ theme,
23
+ radius
24
+ }) => radius ? theme.borderRadius[radius] : 0};
25
+ overflow: hidden;
26
+ position: relative;
27
+ `;
28
+ exports.Wrapper = Wrapper;
29
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/atoms/Skeleton/styled.ts"],"names":["Wrapper","styled","View","width","height","theme","radius","borderRadius"],"mappings":";;;;;;;AAAA;;AACA;;;;AAGO,MAAMA,OAAO,GAAGC,gBAAOC,IAA0C;AACxE,WAAW,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAgBA,KAAK,GAAI,GAAE,2BAAY,GAAEA,KAAM,IAApB,CAAyB,EAA/B,GAAmC,MAAQ;AAC3E,YAAY,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAiBA,MAAM,GAAI,GAAE,2BAAY,GAAEA,MAAO,IAArB,CAA0B,EAAhC,GAAoC,MAAQ;AAC/E,mBAAmB,CAAC;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAD,KACfA,MAAM,GAAGD,KAAK,CAACE,YAAN,CAAmBD,MAAnB,CAAH,GAAgC,CAAE;AAC5C;AACA;AACA,CAPO","sourcesContent":["import styled from '@emotion/native';\nimport { RFValueStr, StyleProps } from '@tecsinapse/react-core';\nimport { SkeletonProps } from './Skeleton';\n\nexport const Wrapper = styled.View<Partial<StyleProps & SkeletonProps>>`\n width: ${({ width }) => (width ? `${RFValueStr(`${width}px`)}` : '100%')};\n height: ${({ height }) => (height ? `${RFValueStr(`${height}px`)}` : 'auto')};\n border-radius: ${({ theme, radius }: StyleProps & Partial<SkeletonProps>) =>\n radius ? theme.borderRadius[radius] : 0};\n overflow: hidden;\n position: relative;\n`;\n"],"file":"styled.js"}
@@ -0,0 +1,12 @@
1
+ export declare type ChildrenLayout = {
2
+ width: number;
3
+ height: number;
4
+ x: number;
5
+ y: number;
6
+ };
7
+ export interface IAnimationComponent {
8
+ width?: number;
9
+ height?: number;
10
+ active?: boolean;
11
+ childrenLayout: ChildrenLayout;
12
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"}
@@ -9,6 +9,8 @@ var _native = _interopRequireWildcard(require("@emotion/native"));
9
9
 
10
10
  var _reactCore = require("@tecsinapse/react-core");
11
11
 
12
+ var _reactNative = require("react-native");
13
+
12
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
15
 
14
16
  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; }
@@ -21,7 +23,7 @@ const fontStyles = ({
21
23
  const fontFamily = (theme === null || theme === void 0 ? void 0 : theme.font.stack[fontStack]) || '';
22
24
  const fontStyle = theme === null || theme === void 0 ? void 0 : theme.font.files[fontWeight];
23
25
  return (0, _native.css)`
24
- font-weight: normal;
26
+ ${_reactNative.Platform.OS === 'android' ? 'font-weight: normal;' : undefined}
25
27
  font-family: ${fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.replace('{0}', fontFamily)};
26
28
  `;
27
29
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Text/styled.ts"],"names":["fontStyles","theme","fontStack","fontWeight","fontFamily","font","stack","fontStyle","files","replace","StyledNativeText","Text"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAaO,MAAMA,UAAU,GAAG,CAAC;AACzBC,EAAAA,KADyB;AAEzBC,EAAAA,SAAS,GAAG,SAFa;AAGzBC,EAAAA,UAAU,GAAG;AAHY,CAAD,KAIiB;AACzC,QAAMC,UAAU,GAAG,CAAAH,KAAK,SAAL,IAAAA,KAAK,WAAL,YAAAA,KAAK,CAAEI,IAAP,CAAYC,KAAZ,CAAkBJ,SAAlB,MAAgC,EAAnD;AACA,QAAMK,SAAS,GAAGN,KAAH,aAAGA,KAAH,uBAAGA,KAAK,CAAEI,IAAP,CAAYG,KAAZ,CAAkBL,UAAlB,CAAlB;AACA,SAAO,gBAAI;AACb;AACA,mBAAmBI,SAFP,aAEOA,SAFP,uBAEOA,SAAS,CAAEE,OAAX,CAAmB,KAAnB,EAA0BL,UAA1B,CAAsC;AACzD,GAHE;AAID,CAXM;;;AAaA,MAAMM,gBAAgB,GAAG,qBAAOC,eAAP,EAE9BX,UAF8B,CAAzB","sourcesContent":["import styled, { css } from '@emotion/native';\nimport {\n FontStackType,\n FontWeightType,\n StyleProps,\n Text,\n} from '@tecsinapse/react-core';\nimport { TextNativeProps } from './Text';\n\nexport interface Font {\n fontStack?: FontStackType;\n fontWeight?: FontWeightType;\n}\n\nexport const fontStyles = ({\n theme,\n fontStack = 'default',\n fontWeight = 'regular',\n}: Partial<Font & Partial<StyleProps>>) => {\n const fontFamily = theme?.font.stack[fontStack] || '';\n const fontStyle = theme?.font.files[fontWeight];\n return css`\n font-weight: normal;\n font-family: ${fontStyle?.replace('{0}', fontFamily)};\n `;\n};\n\nexport const StyledNativeText = styled(Text)<\n Font & Partial<TextNativeProps> & Partial<StyleProps>\n>(fontStyles);\n"],"file":"styled.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Text/styled.ts"],"names":["fontStyles","theme","fontStack","fontWeight","fontFamily","font","stack","fontStyle","files","Platform","OS","undefined","replace","StyledNativeText","Text"],"mappings":";;;;;;;AAAA;;AACA;;AAMA;;;;;;AAQO,MAAMA,UAAU,GAAG,CAAC;AACzBC,EAAAA,KADyB;AAEzBC,EAAAA,SAAS,GAAG,SAFa;AAGzBC,EAAAA,UAAU,GAAG;AAHY,CAAD,KAIiB;AACzC,QAAMC,UAAU,GAAG,CAAAH,KAAK,SAAL,IAAAA,KAAK,WAAL,YAAAA,KAAK,CAAEI,IAAP,CAAYC,KAAZ,CAAkBJ,SAAlB,MAAgC,EAAnD;AACA,QAAMK,SAAS,GAAGN,KAAH,aAAGA,KAAH,uBAAGA,KAAK,CAAEI,IAAP,CAAYG,KAAZ,CAAkBL,UAAlB,CAAlB;AACA,SAAO,gBAAI;AACb,MAAMM,sBAASC,EAAT,KAAgB,SAAhB,GAA4B,sBAA5B,GAAqDC,SAAU;AACrE,mBAAmBJ,SAFP,aAEOA,SAFP,uBAEOA,SAAS,CAAEK,OAAX,CAAmB,KAAnB,EAA0BR,UAA1B,CAAsC;AACzD,GAHE;AAID,CAXM;;;AAaA,MAAMS,gBAAgB,GAAG,qBAAOC,eAAP,EAE9Bd,UAF8B,CAAzB","sourcesContent":["import styled, { css } from '@emotion/native';\nimport {\n FontStackType,\n FontWeightType,\n StyleProps,\n Text,\n} from '@tecsinapse/react-core';\nimport { Platform } from 'react-native';\nimport { TextNativeProps } from './Text';\n\nexport interface Font {\n fontStack?: FontStackType;\n fontWeight?: FontWeightType;\n}\n\nexport const fontStyles = ({\n theme,\n fontStack = 'default',\n fontWeight = 'regular',\n}: Partial<Font & Partial<StyleProps>>) => {\n const fontFamily = theme?.font.stack[fontStack] || '';\n const fontStyle = theme?.font.files[fontWeight];\n return css`\n ${Platform.OS === 'android' ? 'font-weight: normal;' : undefined}\n font-family: ${fontStyle?.replace('{0}', fontFamily)};\n `;\n};\n\nexport const StyledNativeText = styled(Text)<\n Font & Partial<TextNativeProps> & Partial<StyleProps>\n>(fontStyles);\n"],"file":"styled.js"}
@@ -1,4 +1 @@
1
- export declare const Calendar: <T extends any>({ locale, ...rest }: {
2
- [x: string]: any;
3
- locale: any;
4
- }) => JSX.Element;
1
+ export declare const Calendar: <T extends any>({ locale, ...rest }: any) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/molecules/Calendar/Calendar.tsx"],"names":["Calendar","locale","rest","Text"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAEO,MAAMA,QAAQ,GAAG,CAA0B;AAChDC,EAAAA,MADgD;AAEhD,KAAGC;AAF6C,CAA1B,KAGL;AACjB,SACE,6BAAC,mBAAD,eACMA,IADN;AAEE,IAAA,aAAa,EAAEC,UAFjB;AAGE,IAAA,MAAM,EAAEF,MAAM,IAAI;AAHpB,KADF;AAOD,CAXM","sourcesContent":["import { Calendar as CalendarCore, SelectionType } from '@tecsinapse/react-core';\nimport React from 'react';\nimport { getLocale } from '../../../utils/date';\nimport { Text } from '../../atoms/Text';\n\nexport const Calendar = <T extends SelectionType>({\n locale,\n ...rest\n}): JSX.Element => {\n return (\n <CalendarCore\n {...rest}\n TextComponent={Text}\n locale={locale ?? getLocale()}\n />\n );\n};\n"],"file":"Calendar.js"}
1
+ {"version":3,"sources":["../../../../src/components/molecules/Calendar/Calendar.tsx"],"names":["Calendar","locale","rest","Text"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAEO,MAAMA,QAAQ,GAAG,CAA0B;AAChDC,EAAAA,MADgD;AAEhD,KAAGC;AAF6C,CAA1B,KAGa;AACnC,SACE,6BAAC,mBAAD,eACMA,IADN;AAEE,IAAA,aAAa,EAAEC,UAFjB;AAGE,IAAA,MAAM,EAAEF,MAAM,IAAI;AAHpB,KADF;AAOD,CAXM","sourcesContent":["import { Calendar as CalendarCore, CalendarProps, SelectionType } from '@tecsinapse/react-core';\nimport React from 'react';\nimport { getLocale } from '../../../utils/date';\nimport { Text } from '../../atoms/Text';\n\nexport const Calendar = <T extends SelectionType>({\n locale,\n ...rest\n}: CalendarProps<T>): JSX.Element => {\n return (\n <CalendarCore\n {...rest}\n TextComponent={Text}\n locale={locale ?? getLocale()}\n />\n );\n};\n"],"file":"Calendar.js"}
@@ -1,2 +1,3 @@
1
- import { DatePickerProps } from '@tecsinapse/react-core';
2
- export declare const DatePicker: <T extends any>({ locale, onChange, ...rest }: Omit<any, "CalendarComponent" | "renderCalendar" | "requestCloseCalendar" | "requestShowCalendar">) => JSX.Element;
1
+ import { DatePickerProps, SelectionType } from '@tecsinapse/react-core';
2
+ export declare type NativeDatePickerProps<T extends SelectionType> = Omit<DatePickerProps<T>, 'CalendarComponent' | 'renderCalendar' | 'requestCloseCalendar' | 'requestShowCalendar'>;
3
+ export declare const DatePicker: <T extends any>({ locale, onChange, ...rest }: NativeDatePickerProps<T>) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/molecules/DatePicker/DatePicker.tsx"],"names":["DatePicker","locale","onChange","rest","modal","handleChange","value","requestUpdate","Text","Calendar","show","close","calendar","blur","sync","NativeModal","children","others","CalendarBoxContent"],"mappings":";;;;;;;AAAA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEO,MAAMA,UAAU,GAAG,CAA0B;AAAEC,EAAAA,MAAF;AAAUC,EAAAA,QAAV;AAAoB,KAAGC;AAAvB,CAA1B,KAA4L;AAEpN,QAAMC,KAAK,GAAG,iCAAd;;AAEA,QAAMC,YAAY,GAAIC,KAAD,IAAsB;AACzCJ,IAAAA,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAGI,KAAH,CAAR;AACAF,IAAAA,KAAK,CAACG,aAAN;AACD,GAHD;;AAKA,SACE,6BAAC,qBAAD,eACMJ,IADN;AAEE,IAAA,aAAa,EAAEK,UAFjB;AAGE,IAAA,iBAAiB,EAAEC,kBAHrB;AAIE,IAAA,MAAM,EAAER,MAAM,IAAI,sBAJpB;AAKE,IAAA,QAAQ,EAAEI,YALZ;AAME,IAAA,mBAAmB,EAAE,MAAMD,KAAK,CAACM,IAAN,EAN7B;AAOE,IAAA,oBAAoB,EAAE,MAAMN,KAAK,CAACO,KAAN,EAP9B;AAQE,IAAA,cAAc,EAAE,CAACC,QAAD,EAAWC,IAAX,KAAoBT,KAAK,CAACU,IAAN,CAClC,6BAAC,WAAD;AAAa,MAAA,OAAO,EAAED;AAAtB,OACGD,QADH,CADkC;AARtC,KADF;AAiBD,CA1BM;;;;AA4BP,MAAMG,WAA2B,GAAG,CAAC;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAD,KAA6B;AAC/D,SACE,6BAAC,gBAAD;AAAW,IAAA,YAAY,EAAEC;AAAzB,KAAiDD,MAAjD,GACGD,QADH,CADF;AAKD,CAND","sourcesContent":["import {\n DatePicker as DatePickerCore, DatePickerProps, SelectionType, Value\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { getLocale } from '../../../utils/date';\nimport { IBaseModal, ModalView, useLazyModalManager } from '../../atoms/Modal';\nimport { Text } from '../../atoms/Text';\nimport { Calendar } from '../Calendar';\nimport { CalendarBoxContent } from './styled';\n\nexport const DatePicker = <T extends SelectionType>({ locale, onChange, ...rest }: Omit<DatePickerProps<T>, 'CalendarComponent' | 'renderCalendar' | 'requestCloseCalendar' | 'requestShowCalendar'>): JSX.Element => {\n\n const modal = useLazyModalManager()\n \n const handleChange = (value?: Value<T>) => {\n onChange?.(value)\n modal.requestUpdate()\n }\n \n return (\n <DatePickerCore\n {...rest}\n TextComponent={Text}\n CalendarComponent={Calendar}\n locale={locale ?? getLocale()}\n onChange={handleChange}\n requestShowCalendar={() => modal.show()}\n requestCloseCalendar={() => modal.close()}\n renderCalendar={(calendar, blur) => modal.sync(\n <NativeModal onClose={blur}>\n {calendar}\n </NativeModal>\n )}\n />\n );\n\n};\n\nconst NativeModal: FC<IBaseModal> = ({ children, ...others }) => {\n return (\n <ModalView BoxComponent={CalendarBoxContent} {...others}>\n {children}\n </ModalView>\n )\n}"],"file":"DatePicker.js"}
1
+ {"version":3,"sources":["../../../../src/components/molecules/DatePicker/DatePicker.tsx"],"names":["DatePicker","locale","onChange","rest","modal","handleChange","value","requestUpdate","Text","Calendar","show","close","calendar","blur","sync","NativeModal","children","others","CalendarBoxContent"],"mappings":";;;;;;;AAAA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAIO,MAAMA,UAAU,GAAG,CAA0B;AAAEC,EAAAA,MAAF;AAAUC,EAAAA,QAAV;AAAoB,KAAGC;AAAvB,CAA1B,KAAmG;AAE3H,QAAMC,KAAK,GAAG,iCAAd;;AAEA,QAAMC,YAAY,GAAIC,KAAD,IAAsB;AACzCJ,IAAAA,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAGI,KAAH,CAAR;AACAF,IAAAA,KAAK,CAACG,aAAN;AACD,GAHD;;AAKA,SACE,6BAAC,qBAAD,eACMJ,IADN;AAEE,IAAA,aAAa,EAAEK,UAFjB;AAGE,IAAA,iBAAiB,EAAEC,kBAHrB;AAIE,IAAA,MAAM,EAAER,MAAM,IAAI,sBAJpB;AAKE,IAAA,QAAQ,EAAEI,YALZ;AAME,IAAA,mBAAmB,EAAE,MAAMD,KAAK,CAACM,IAAN,EAN7B;AAOE,IAAA,oBAAoB,EAAE,MAAMN,KAAK,CAACO,KAAN,EAP9B;AAQE,IAAA,cAAc,EAAE,CAACC,QAAD,EAAWC,IAAX,KAAoBT,KAAK,CAACU,IAAN,CAClC,6BAAC,WAAD;AAAa,MAAA,OAAO,EAAED;AAAtB,OACGD,QADH,CADkC;AARtC,KADF;AAiBD,CA1BM;;;;AA4BP,MAAMG,WAA2B,GAAG,CAAC;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAD,KAA6B;AAC/D,SACE,6BAAC,gBAAD;AAAW,IAAA,YAAY,EAAEC;AAAzB,KAAiDD,MAAjD,GACGD,QADH,CADF;AAKD,CAND","sourcesContent":["import {\n DatePicker as DatePickerCore, DatePickerProps, SelectionType, Value\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { getLocale } from '../../../utils/date';\nimport { IBaseModal, ModalView, useLazyModalManager } from '../../atoms/Modal';\nimport { Text } from '../../atoms/Text';\nimport { Calendar } from '../Calendar';\nimport { CalendarBoxContent } from './styled';\n\nexport type NativeDatePickerProps<T extends SelectionType> = Omit<DatePickerProps<T>, 'CalendarComponent' | 'renderCalendar' | 'requestCloseCalendar' | 'requestShowCalendar'>\n\nexport const DatePicker = <T extends SelectionType>({ locale, onChange, ...rest }: NativeDatePickerProps<T>): JSX.Element => {\n\n const modal = useLazyModalManager()\n \n const handleChange = (value?: Value<T>) => {\n onChange?.(value)\n modal.requestUpdate()\n }\n \n return (\n <DatePickerCore\n {...rest}\n TextComponent={Text}\n CalendarComponent={Calendar}\n locale={locale ?? getLocale()}\n onChange={handleChange}\n requestShowCalendar={() => modal.show()}\n requestCloseCalendar={() => modal.close()}\n renderCalendar={(calendar, blur) => modal.sync(\n <NativeModal onClose={blur}>\n {calendar}\n </NativeModal>\n )}\n />\n );\n\n};\n\nconst NativeModal: FC<IBaseModal> = ({ children, ...others }) => {\n return (\n <ModalView BoxComponent={CalendarBoxContent} {...others}>\n {children}\n </ModalView>\n )\n}"],"file":"DatePicker.js"}
@@ -1 +1 @@
1
- export { DatePicker } from './DatePicker';
1
+ export { DatePicker, NativeDatePickerProps } from './DatePicker';
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "DatePicker", {
9
9
  return _DatePicker.DatePicker;
10
10
  }
11
11
  });
12
+ Object.defineProperty(exports, "NativeDatePickerProps", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _DatePicker.NativeDatePickerProps;
16
+ }
17
+ });
12
18
 
13
19
  var _DatePicker = require("./DatePicker");
14
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/molecules/DatePicker/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA","sourcesContent":["export { DatePicker } from './DatePicker';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/components/molecules/DatePicker/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { DatePicker, NativeDatePickerProps } from './DatePicker';\n"],"file":"index.js"}
@@ -1,3 +1,4 @@
1
1
  import { DateTimePickerProps } from '@tecsinapse/react-core';
2
2
  import { FC } from 'react';
3
- export declare const DateTimePicker: FC<Omit<DateTimePickerProps, 'DateTimeSelectorComponent' | 'renderSelector' | 'requestCloseSelector' | 'requestShowSelector'>>;
3
+ export declare type NativeDateTimePickerProps = Omit<DateTimePickerProps, 'DateTimeSelectorComponent' | 'renderSelector' | 'requestCloseSelector' | 'requestShowSelector'>;
4
+ export declare const DateTimePicker: FC<NativeDateTimePickerProps>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/molecules/DateTimePicker/DateTimePicker.tsx"],"names":["DateTimePicker","locale","rest","modal","Text","DateTimeSelector","show","close","selector","blur","sync","NativeModal","children","others"],"mappings":";;;;;;;AAAA;;AAIA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEO,MAAMA,cAA8I,GAAG,CAAC;AAAEC,EAAAA,MAAF;AAAU,KAAGC;AAAb,CAAD,KAAyB;AAErL,QAAMC,KAAK,GAAG,iCAAd;AAEA,SACE,6BAAC,yBAAD,eACMD,IADN;AAEE,IAAA,aAAa,EAAEE,UAFjB;AAGE,IAAA,yBAAyB,EAAEC,kCAH7B;AAIE,IAAA,MAAM,EAAEJ,MAAM,IAAI,sBAJpB;AAKE,IAAA,mBAAmB,EAAE,MAAME,KAAK,CAACG,IAAN,EAL7B;AAME,IAAA,oBAAoB,EAAE,MAAMH,KAAK,CAACI,KAAN,EAN9B;AAOE,IAAA,cAAc,EAAE,CAACC,QAAD,EAAWC,IAAX,KAAoBN,KAAK,CAACO,IAAN,CAClC,6BAAC,WAAD;AAAa,MAAA,OAAO,EAAED;AAAtB,OACGD,QADH,CADkC;AAPtC,KADF;AAeD,CAnBM;;;;AAqBP,MAAMG,WAA2B,GAAG,CAAC;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAD,KAA6B;AAC/D,SACE,6BAAC,gBAAD,EAAeA,MAAf,EACGD,QADH,CADF;AAKD,CAND","sourcesContent":["import {\n DateTimePicker as DateTimePickerCore,\n DateTimePickerProps\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { getLocale } from '../../../utils/date';\nimport { IBaseModal, ModalView, useLazyModalManager } from '../../atoms/Modal';\nimport { Text } from '../../atoms/Text';\nimport { DateTimeSelector } from '../DateTimeSelector';\n\nexport const DateTimePicker: FC<Omit<DateTimePickerProps, 'DateTimeSelectorComponent' | 'renderSelector' | 'requestCloseSelector' | 'requestShowSelector'>> = ({ locale, ...rest }) => {\n\n const modal = useLazyModalManager()\n\n return (\n <DateTimePickerCore\n {...rest}\n TextComponent={Text}\n DateTimeSelectorComponent={DateTimeSelector}\n locale={locale ?? getLocale()}\n requestShowSelector={() => modal.show()}\n requestCloseSelector={() => modal.close()}\n renderSelector={(selector, blur) => modal.sync(\n <NativeModal onClose={blur}>\n {selector}\n </NativeModal>\n )}\n />\n );\n};\n\nconst NativeModal: FC<IBaseModal> = ({ children, ...others }) => {\n return (\n <ModalView {...others}>\n {children}\n </ModalView>\n )\n}"],"file":"DateTimePicker.js"}
1
+ {"version":3,"sources":["../../../../src/components/molecules/DateTimePicker/DateTimePicker.tsx"],"names":["DateTimePicker","locale","rest","modal","Text","DateTimeSelector","show","close","selector","blur","sync","NativeModal","children","others"],"mappings":";;;;;;;AAAA;;AAIA;;AACA;;AACA;;AACA;;AACA;;;;;;AAIO,MAAMA,cAA6C,GAAG,CAAC;AAAEC,EAAAA,MAAF;AAAU,KAAGC;AAAb,CAAD,KAAyB;AAEpF,QAAMC,KAAK,GAAG,iCAAd;AAEA,SACE,6BAAC,yBAAD,eACMD,IADN;AAEE,IAAA,aAAa,EAAEE,UAFjB;AAGE,IAAA,yBAAyB,EAAEC,kCAH7B;AAIE,IAAA,MAAM,EAAEJ,MAAM,IAAI,sBAJpB;AAKE,IAAA,mBAAmB,EAAE,MAAME,KAAK,CAACG,IAAN,EAL7B;AAME,IAAA,oBAAoB,EAAE,MAAMH,KAAK,CAACI,KAAN,EAN9B;AAOE,IAAA,cAAc,EAAE,CAACC,QAAD,EAAWC,IAAX,KAAoBN,KAAK,CAACO,IAAN,CAClC,6BAAC,WAAD;AAAa,MAAA,OAAO,EAAED;AAAtB,OACGD,QADH,CADkC;AAPtC,KADF;AAeD,CAnBM;;;;AAqBP,MAAMG,WAA2B,GAAG,CAAC;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAD,KAA6B;AAC/D,SACE,6BAAC,gBAAD,EAAeA,MAAf,EACGD,QADH,CADF;AAKD,CAND","sourcesContent":["import {\n DateTimePicker as DateTimePickerCore,\n DateTimePickerProps\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { getLocale } from '../../../utils/date';\nimport { IBaseModal, ModalView, useLazyModalManager } from '../../atoms/Modal';\nimport { Text } from '../../atoms/Text';\nimport { DateTimeSelector } from '../DateTimeSelector';\n\nexport type NativeDateTimePickerProps = Omit<DateTimePickerProps, 'DateTimeSelectorComponent' | 'renderSelector' | 'requestCloseSelector' | 'requestShowSelector'>\n\nexport const DateTimePicker: FC<NativeDateTimePickerProps> = ({ locale, ...rest }) => {\n\n const modal = useLazyModalManager()\n\n return (\n <DateTimePickerCore\n {...rest}\n TextComponent={Text}\n DateTimeSelectorComponent={DateTimeSelector}\n locale={locale ?? getLocale()}\n requestShowSelector={() => modal.show()}\n requestCloseSelector={() => modal.close()}\n renderSelector={(selector, blur) => modal.sync(\n <NativeModal onClose={blur}>\n {selector}\n </NativeModal>\n )}\n />\n );\n};\n\nconst NativeModal: FC<IBaseModal> = ({ children, ...others }) => {\n return (\n <ModalView {...others}>\n {children}\n </ModalView>\n )\n}"],"file":"DateTimePicker.js"}
@@ -1 +1 @@
1
- export { DateTimePicker } from './DateTimePicker';
1
+ export { DateTimePicker, NativeDateTimePickerProps } from './DateTimePicker';
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "DateTimePicker", {
9
9
  return _DateTimePicker.DateTimePicker;
10
10
  }
11
11
  });
12
+ Object.defineProperty(exports, "NativeDateTimePickerProps", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _DateTimePicker.NativeDateTimePickerProps;
16
+ }
17
+ });
12
18
 
13
19
  var _DateTimePicker = require("./DateTimePicker");
14
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/molecules/DateTimePicker/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA","sourcesContent":["export { DateTimePicker } from './DateTimePicker';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/components/molecules/DateTimePicker/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { DateTimePicker, NativeDateTimePickerProps } from './DateTimePicker';\n"],"file":"index.js"}
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { Select, SelectNativeProps } from './components/molecules/Select';
4
4
  export { Input, InputNativeProps } from './components/atoms/Input';
5
5
  export { TextArea, TextAreaProps } from './components/atoms/TextArea';
6
6
  export { Text, TextNativeProps } from './components/atoms/Text';
7
- export { Error, Loading, Success, Button, ButtonNativeProps } from './components/atoms/Button';
7
+ export { Error, Loading, Success, Button, ButtonNativeProps, } from './components/atoms/Button';
8
8
  export { GroupButtonOption } from './components/atoms/GroupButton';
9
9
  export { InputPassword, InputPasswordNativeProps, } from './components/molecules/InputPassword';
10
10
  export { BottomNavigator, BottomNavigatorProps, } from './components/atoms/BottomNavigator';
@@ -12,9 +12,10 @@ export { Tag, TagProps } from './components/atoms/Tag';
12
12
  export { SnappingSlider, SnappingSliderProps, } from './components/atoms/SnappingSlider';
13
13
  export { Badge, BadgeNativeProps } from './components/atoms/Badge';
14
14
  export { Snackbar, SnackbarNativeProps } from './components/molecules/Snackbar';
15
- export { DatePicker } from './components/molecules/DatePicker';
16
- export { DateTimePicker } from './components/molecules/DateTimePicker';
15
+ export { DatePicker, NativeDatePickerProps, } from './components/molecules/DatePicker';
16
+ export { DateTimePicker, NativeDateTimePickerProps, } from './components/molecules/DateTimePicker';
17
17
  export { Avatar } from './components/atoms/Avatar';
18
18
  export { Calendar } from './components/molecules/Calendar';
19
19
  export { DateTimeSelector } from './components/molecules/DateTimeSelector';
20
- export { ModalGroupManager, ModalView, ModalLifecycleHandler, useLazyModalManager, useModalManager, IBaseModal } from './components/atoms/Modal';
20
+ export { ModalGroupManager, ModalView, ModalLifecycleHandler, useLazyModalManager, useModalManager, IBaseModal, } from './components/atoms/Modal';
21
+ export { Skeleton, SkeletonProps } from './components/atoms/Skeleton';
package/dist/index.js CHANGED
@@ -33,7 +33,9 @@ var _exportNames = {
33
33
  Snackbar: true,
34
34
  SnackbarNativeProps: true,
35
35
  DatePicker: true,
36
+ NativeDatePickerProps: true,
36
37
  DateTimePicker: true,
38
+ NativeDateTimePickerProps: true,
37
39
  Avatar: true,
38
40
  Calendar: true,
39
41
  DateTimeSelector: true,
@@ -42,7 +44,9 @@ var _exportNames = {
42
44
  ModalLifecycleHandler: true,
43
45
  useLazyModalManager: true,
44
46
  useModalManager: true,
45
- IBaseModal: true
47
+ IBaseModal: true,
48
+ Skeleton: true,
49
+ SkeletonProps: true
46
50
  };
47
51
  Object.defineProperty(exports, "Header", {
48
52
  enumerable: true,
@@ -218,12 +222,24 @@ Object.defineProperty(exports, "DatePicker", {
218
222
  return _DatePicker.DatePicker;
219
223
  }
220
224
  });
225
+ Object.defineProperty(exports, "NativeDatePickerProps", {
226
+ enumerable: true,
227
+ get: function () {
228
+ return _DatePicker.NativeDatePickerProps;
229
+ }
230
+ });
221
231
  Object.defineProperty(exports, "DateTimePicker", {
222
232
  enumerable: true,
223
233
  get: function () {
224
234
  return _DateTimePicker.DateTimePicker;
225
235
  }
226
236
  });
237
+ Object.defineProperty(exports, "NativeDateTimePickerProps", {
238
+ enumerable: true,
239
+ get: function () {
240
+ return _DateTimePicker.NativeDateTimePickerProps;
241
+ }
242
+ });
227
243
  Object.defineProperty(exports, "Avatar", {
228
244
  enumerable: true,
229
245
  get: function () {
@@ -278,6 +294,18 @@ Object.defineProperty(exports, "IBaseModal", {
278
294
  return _Modal.IBaseModal;
279
295
  }
280
296
  });
297
+ Object.defineProperty(exports, "Skeleton", {
298
+ enumerable: true,
299
+ get: function () {
300
+ return _Skeleton.Skeleton;
301
+ }
302
+ });
303
+ Object.defineProperty(exports, "SkeletonProps", {
304
+ enumerable: true,
305
+ get: function () {
306
+ return _Skeleton.SkeletonProps;
307
+ }
308
+ });
281
309
 
282
310
  var _reactCore = require("@tecsinapse/react-core");
283
311
 
@@ -330,4 +358,6 @@ var _Calendar = require("./components/molecules/Calendar");
330
358
  var _DateTimeSelector = require("./components/molecules/DateTimeSelector");
331
359
 
332
360
  var _Modal = require("./components/atoms/Modal");
361
+
362
+ var _Skeleton = require("./components/atoms/Skeleton");
333
363
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AAIA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["export * from '@tecsinapse/react-core';\nexport { Header, HeaderProps } from './components/atoms/Header';\nexport { Select, SelectNativeProps } from './components/molecules/Select';\nexport { Input, InputNativeProps } from './components/atoms/Input';\nexport { TextArea, TextAreaProps } from './components/atoms/TextArea';\nexport { Text, TextNativeProps } from './components/atoms/Text';\nexport { Error, Loading, Success, Button, ButtonNativeProps } from './components/atoms/Button';\nexport { GroupButtonOption } from './components/atoms/GroupButton';\nexport {\n InputPassword,\n InputPasswordNativeProps,\n} from './components/molecules/InputPassword';\nexport {\n BottomNavigator,\n BottomNavigatorProps,\n} from './components/atoms/BottomNavigator';\nexport { Tag, TagProps } from './components/atoms/Tag';\nexport {\n SnappingSlider,\n SnappingSliderProps,\n} from './components/atoms/SnappingSlider';\nexport { Badge, BadgeNativeProps } from './components/atoms/Badge';\nexport { Snackbar, SnackbarNativeProps } from './components/molecules/Snackbar';\nexport { DatePicker } from './components/molecules/DatePicker';\nexport { DateTimePicker } from './components/molecules/DateTimePicker';\nexport { Avatar } from './components/atoms/Avatar';\nexport { Calendar } from './components/molecules/Calendar';\nexport { DateTimeSelector } from './components/molecules/DateTimeSelector';\nexport { ModalGroupManager, ModalView, ModalLifecycleHandler, useLazyModalManager, useModalManager, IBaseModal } from './components/atoms/Modal';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AAIA;;AAIA;;AACA;;AAIA;;AACA;;AACA;;AAIA;;AAIA;;AACA;;AACA;;AACA;;AAQA","sourcesContent":["export * from '@tecsinapse/react-core';\nexport { Header, HeaderProps } from './components/atoms/Header';\nexport { Select, SelectNativeProps } from './components/molecules/Select';\nexport { Input, InputNativeProps } from './components/atoms/Input';\nexport { TextArea, TextAreaProps } from './components/atoms/TextArea';\nexport { Text, TextNativeProps } from './components/atoms/Text';\nexport {\n Error,\n Loading,\n Success,\n Button,\n ButtonNativeProps,\n} from './components/atoms/Button';\nexport { GroupButtonOption } from './components/atoms/GroupButton';\nexport {\n InputPassword,\n InputPasswordNativeProps,\n} from './components/molecules/InputPassword';\nexport {\n BottomNavigator,\n BottomNavigatorProps,\n} from './components/atoms/BottomNavigator';\nexport { Tag, TagProps } from './components/atoms/Tag';\nexport {\n SnappingSlider,\n SnappingSliderProps,\n} from './components/atoms/SnappingSlider';\nexport { Badge, BadgeNativeProps } from './components/atoms/Badge';\nexport { Snackbar, SnackbarNativeProps } from './components/molecules/Snackbar';\nexport {\n DatePicker,\n NativeDatePickerProps,\n} from './components/molecules/DatePicker';\nexport {\n DateTimePicker,\n NativeDateTimePickerProps,\n} from './components/molecules/DateTimePicker';\nexport { Avatar } from './components/atoms/Avatar';\nexport { Calendar } from './components/molecules/Calendar';\nexport { DateTimeSelector } from './components/molecules/DateTimeSelector';\nexport {\n ModalGroupManager,\n ModalView,\n ModalLifecycleHandler,\n useLazyModalManager,\n useModalManager,\n IBaseModal,\n} from './components/atoms/Modal';\nexport { Skeleton, SkeletonProps } from './components/atoms/Skeleton';\n"],"file":"index.js"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tecsinapse/react-native-kit",
3
3
  "description": "TecSinapse React Native components",
4
- "version": "1.12.13",
4
+ "version": "1.13.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "MIT",
@@ -13,7 +13,8 @@
13
13
  "dependencies": {
14
14
  "@emotion/native": "^11.0.0",
15
15
  "@emotion/react": "^11.4.1",
16
- "@tecsinapse/react-core": "^1.12.9"
16
+ "@tecsinapse/react-core": "^1.12.10",
17
+ "react-native-linear-gradient": "^2.5.6"
17
18
  },
18
19
  "repository": {
19
20
  "type": "git",
@@ -27,6 +28,7 @@
27
28
  "peerDependencies": {
28
29
  "react": ">=16.8.0",
29
30
  "react-native": ">=0.64.0",
31
+ "react-native-linear-gradient": "^2.5.6",
30
32
  "react-native-safe-area-context": "^3.1.9",
31
33
  "react-native-vector-icons": ">=8.1.0",
32
34
  "uuid": "^8.3.2"
@@ -34,5 +36,5 @@
34
36
  "devDependencies": {
35
37
  "@types/uuid": "^8.3.3"
36
38
  },
37
- "gitHead": "e4ceaaed1fb32ed77967fe54a056954be7b4151a"
39
+ "gitHead": "7ab04c72670707ce71d0874c37347d20cf94e329"
38
40
  }
@@ -0,0 +1,33 @@
1
+ import { Animated } from 'react-native';
2
+ import React, { useEffect, useRef } from 'react';
3
+ import { pulseAnimation } from './animation';
4
+ import { IAnimationComponent } from './types';
5
+
6
+ export const Pulse = ({
7
+ active = true,
8
+ width,
9
+ height,
10
+ childrenLayout,
11
+ }: IAnimationComponent) => {
12
+ const animatedValue = useRef(new Animated.Value(0)).current;
13
+
14
+ useEffect(() => {
15
+ pulseAnimation(active, animatedValue);
16
+ }, [active]);
17
+
18
+ return (
19
+ <Animated.View
20
+ style={{
21
+ width: width ?? childrenLayout.width,
22
+ height: height ?? childrenLayout.height,
23
+ backgroundColor: 'rgba(0,0,0,0.05)',
24
+ position: 'absolute',
25
+ top: childrenLayout.x ?? 0,
26
+ left: childrenLayout.y ?? 0,
27
+ zIndex: 2,
28
+ overflow: 'hidden',
29
+ opacity: animatedValue,
30
+ }}
31
+ />
32
+ );
33
+ };
@@ -0,0 +1,71 @@
1
+ import React, { useState } from 'react';
2
+ import { BorderRadiusType } from '@tecsinapse/react-core';
3
+ import { LayoutChangeEvent, View, ViewProps } from 'react-native';
4
+ import { Wrapper } from './styled';
5
+ import { Wave } from './Wave';
6
+ import { Pulse } from './Pulse';
7
+ import { ChildrenLayout } from './types';
8
+
9
+ export interface SkeletonProps extends ViewProps {
10
+ width?: number;
11
+ height?: number;
12
+ radius?: BorderRadiusType;
13
+ active?: boolean;
14
+ animation?: 'wave' | 'pulse';
15
+ }
16
+
17
+ const Skeleton: React.FC<SkeletonProps> = ({
18
+ children,
19
+ width,
20
+ height,
21
+ radius,
22
+ active = true,
23
+ animation = 'wave',
24
+ ...rest
25
+ }) => {
26
+ const [childrenLayout, setChildrenLayout] = useState<ChildrenLayout>({
27
+ width: 0,
28
+ height: 0,
29
+ y: 0,
30
+ x: 0,
31
+ });
32
+
33
+ if (!width && !height && !children) {
34
+ throw new Error(
35
+ '[Skeleton] You should provide children or specify width and height'
36
+ );
37
+ }
38
+
39
+ const getChildrenLayout = (event: LayoutChangeEvent) => {
40
+ setChildrenLayout(event.nativeEvent.layout);
41
+ };
42
+
43
+ return (
44
+ <Wrapper width={width} height={height} radius={radius} {...rest}>
45
+ {active && animation === 'wave' ? (
46
+ <Wave
47
+ active={active}
48
+ width={width}
49
+ height={height}
50
+ childrenLayout={childrenLayout}
51
+ />
52
+ ) : (
53
+ <Pulse
54
+ active={active}
55
+ width={width}
56
+ height={height}
57
+ childrenLayout={childrenLayout}
58
+ />
59
+ )}
60
+ <View
61
+ onLayout={event => getChildrenLayout(event)}
62
+ style={{ opacity: active ? 0 : 1 }}
63
+ pointerEvents={active ? 'none' : 'auto'}
64
+ >
65
+ {children}
66
+ </View>
67
+ </Wrapper>
68
+ );
69
+ };
70
+
71
+ export default Skeleton;
@@ -0,0 +1,53 @@
1
+ import React, { useEffect, useRef } from 'react';
2
+ import { Animated } from 'react-native';
3
+ import LinearGradient from 'react-native-linear-gradient';
4
+ import { waveAnimation } from './animation';
5
+ import { IAnimationComponent } from './types';
6
+
7
+ const AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient);
8
+
9
+ export const Wave = ({
10
+ active = true,
11
+ width,
12
+ height,
13
+ childrenLayout,
14
+ }: IAnimationComponent) => {
15
+ const range = width ?? childrenLayout.width;
16
+ const animatedValue = useRef(new Animated.Value(0)).current;
17
+
18
+ const translateX = animatedValue.interpolate({
19
+ inputRange: [0, 1],
20
+ outputRange: [-range, range],
21
+ });
22
+
23
+ useEffect(() => {
24
+ waveAnimation(active, animatedValue);
25
+ }, [active]);
26
+
27
+ return (
28
+ <AnimatedLinearGradient
29
+ colors={[
30
+ 'transparent',
31
+ 'rgba(0,0,0,0.05)',
32
+ 'rgba(0,0,0,0.1)',
33
+ 'transparent',
34
+ ]}
35
+ start={{ x: 0, y: 0 }}
36
+ end={{ x: 1, y: 0 }}
37
+ style={{
38
+ width: width ?? childrenLayout.width,
39
+ height: height ?? childrenLayout.height,
40
+ position: 'absolute',
41
+ top: childrenLayout.y ?? 0,
42
+ left: childrenLayout.x ?? 0,
43
+ zIndex: 2,
44
+ overflow: 'hidden',
45
+ transform: [
46
+ {
47
+ translateX: translateX,
48
+ },
49
+ ],
50
+ }}
51
+ />
52
+ );
53
+ };
@@ -0,0 +1,49 @@
1
+ import { Animated, Easing } from 'react-native';
2
+
3
+ export const waveAnimation = (
4
+ active: boolean,
5
+ animatedValue: Animated.Value
6
+ ): void => {
7
+ if (active) {
8
+ Animated.loop(
9
+ Animated.timing(animatedValue, {
10
+ toValue: 1,
11
+ duration: 1600,
12
+ easing: Easing.inOut(Easing.linear),
13
+ useNativeDriver: true,
14
+ })
15
+ ).start();
16
+ return;
17
+ }
18
+ Animated.timing(animatedValue, {
19
+ toValue: 0,
20
+ useNativeDriver: true,
21
+ }).start();
22
+ };
23
+
24
+ export const pulseAnimation = (
25
+ active: boolean,
26
+ animatedValue: Animated.Value
27
+ ): void => {
28
+ if (active) {
29
+ Animated.loop(
30
+ Animated.sequence([
31
+ Animated.timing(animatedValue, {
32
+ toValue: 1,
33
+ duration: 800,
34
+ useNativeDriver: true,
35
+ }),
36
+ Animated.timing(animatedValue, {
37
+ toValue: 0,
38
+ duration: 800,
39
+ useNativeDriver: true,
40
+ }),
41
+ ])
42
+ ).start();
43
+ return;
44
+ }
45
+ Animated.timing(animatedValue, {
46
+ toValue: 0,
47
+ useNativeDriver: true,
48
+ }).start();
49
+ };
@@ -0,0 +1 @@
1
+ export { default as Skeleton, SkeletonProps } from './Skeleton';
@@ -0,0 +1,12 @@
1
+ import styled from '@emotion/native';
2
+ import { RFValueStr, StyleProps } from '@tecsinapse/react-core';
3
+ import { SkeletonProps } from './Skeleton';
4
+
5
+ export const Wrapper = styled.View<Partial<StyleProps & SkeletonProps>>`
6
+ width: ${({ width }) => (width ? `${RFValueStr(`${width}px`)}` : '100%')};
7
+ height: ${({ height }) => (height ? `${RFValueStr(`${height}px`)}` : 'auto')};
8
+ border-radius: ${({ theme, radius }: StyleProps & Partial<SkeletonProps>) =>
9
+ radius ? theme.borderRadius[radius] : 0};
10
+ overflow: hidden;
11
+ position: relative;
12
+ `;
@@ -0,0 +1,13 @@
1
+ export type ChildrenLayout = {
2
+ width: number;
3
+ height: number;
4
+ x: number;
5
+ y: number;
6
+ };
7
+
8
+ export interface IAnimationComponent {
9
+ width?: number;
10
+ height?: number;
11
+ active?: boolean;
12
+ childrenLayout: ChildrenLayout;
13
+ }
@@ -5,6 +5,7 @@ import {
5
5
  StyleProps,
6
6
  Text,
7
7
  } from '@tecsinapse/react-core';
8
+ import { Platform } from 'react-native';
8
9
  import { TextNativeProps } from './Text';
9
10
 
10
11
  export interface Font {
@@ -20,7 +21,7 @@ export const fontStyles = ({
20
21
  const fontFamily = theme?.font.stack[fontStack] || '';
21
22
  const fontStyle = theme?.font.files[fontWeight];
22
23
  return css`
23
- font-weight: normal;
24
+ ${Platform.OS === 'android' ? 'font-weight: normal;' : undefined}
24
25
  font-family: ${fontStyle?.replace('{0}', fontFamily)};
25
26
  `;
26
27
  };
@@ -1,4 +1,4 @@
1
- import { Calendar as CalendarCore, SelectionType } from '@tecsinapse/react-core';
1
+ import { Calendar as CalendarCore, CalendarProps, SelectionType } from '@tecsinapse/react-core';
2
2
  import React from 'react';
3
3
  import { getLocale } from '../../../utils/date';
4
4
  import { Text } from '../../atoms/Text';
@@ -6,7 +6,7 @@ import { Text } from '../../atoms/Text';
6
6
  export const Calendar = <T extends SelectionType>({
7
7
  locale,
8
8
  ...rest
9
- }): JSX.Element => {
9
+ }: CalendarProps<T>): JSX.Element => {
10
10
  return (
11
11
  <CalendarCore
12
12
  {...rest}
@@ -8,7 +8,9 @@ import { Text } from '../../atoms/Text';
8
8
  import { Calendar } from '../Calendar';
9
9
  import { CalendarBoxContent } from './styled';
10
10
 
11
- export const DatePicker = <T extends SelectionType>({ locale, onChange, ...rest }: Omit<DatePickerProps<T>, 'CalendarComponent' | 'renderCalendar' | 'requestCloseCalendar' | 'requestShowCalendar'>): JSX.Element => {
11
+ export type NativeDatePickerProps<T extends SelectionType> = Omit<DatePickerProps<T>, 'CalendarComponent' | 'renderCalendar' | 'requestCloseCalendar' | 'requestShowCalendar'>
12
+
13
+ export const DatePicker = <T extends SelectionType>({ locale, onChange, ...rest }: NativeDatePickerProps<T>): JSX.Element => {
12
14
 
13
15
  const modal = useLazyModalManager()
14
16
 
@@ -1 +1 @@
1
- export { DatePicker } from './DatePicker';
1
+ export { DatePicker, NativeDatePickerProps } from './DatePicker';
@@ -8,7 +8,9 @@ import { IBaseModal, ModalView, useLazyModalManager } from '../../atoms/Modal';
8
8
  import { Text } from '../../atoms/Text';
9
9
  import { DateTimeSelector } from '../DateTimeSelector';
10
10
 
11
- export const DateTimePicker: FC<Omit<DateTimePickerProps, 'DateTimeSelectorComponent' | 'renderSelector' | 'requestCloseSelector' | 'requestShowSelector'>> = ({ locale, ...rest }) => {
11
+ export type NativeDateTimePickerProps = Omit<DateTimePickerProps, 'DateTimeSelectorComponent' | 'renderSelector' | 'requestCloseSelector' | 'requestShowSelector'>
12
+
13
+ export const DateTimePicker: FC<NativeDateTimePickerProps> = ({ locale, ...rest }) => {
12
14
 
13
15
  const modal = useLazyModalManager()
14
16
 
@@ -1 +1 @@
1
- export { DateTimePicker } from './DateTimePicker';
1
+ export { DateTimePicker, NativeDateTimePickerProps } from './DateTimePicker';
package/src/index.ts CHANGED
@@ -4,7 +4,13 @@ export { Select, SelectNativeProps } from './components/molecules/Select';
4
4
  export { Input, InputNativeProps } from './components/atoms/Input';
5
5
  export { TextArea, TextAreaProps } from './components/atoms/TextArea';
6
6
  export { Text, TextNativeProps } from './components/atoms/Text';
7
- export { Error, Loading, Success, Button, ButtonNativeProps } from './components/atoms/Button';
7
+ export {
8
+ Error,
9
+ Loading,
10
+ Success,
11
+ Button,
12
+ ButtonNativeProps,
13
+ } from './components/atoms/Button';
8
14
  export { GroupButtonOption } from './components/atoms/GroupButton';
9
15
  export {
10
16
  InputPassword,
@@ -21,9 +27,23 @@ export {
21
27
  } from './components/atoms/SnappingSlider';
22
28
  export { Badge, BadgeNativeProps } from './components/atoms/Badge';
23
29
  export { Snackbar, SnackbarNativeProps } from './components/molecules/Snackbar';
24
- export { DatePicker } from './components/molecules/DatePicker';
25
- export { DateTimePicker } from './components/molecules/DateTimePicker';
30
+ export {
31
+ DatePicker,
32
+ NativeDatePickerProps,
33
+ } from './components/molecules/DatePicker';
34
+ export {
35
+ DateTimePicker,
36
+ NativeDateTimePickerProps,
37
+ } from './components/molecules/DateTimePicker';
26
38
  export { Avatar } from './components/atoms/Avatar';
27
39
  export { Calendar } from './components/molecules/Calendar';
28
40
  export { DateTimeSelector } from './components/molecules/DateTimeSelector';
29
- export { ModalGroupManager, ModalView, ModalLifecycleHandler, useLazyModalManager, useModalManager, IBaseModal } from './components/atoms/Modal';
41
+ export {
42
+ ModalGroupManager,
43
+ ModalView,
44
+ ModalLifecycleHandler,
45
+ useLazyModalManager,
46
+ useModalManager,
47
+ IBaseModal,
48
+ } from './components/atoms/Modal';
49
+ export { Skeleton, SkeletonProps } from './components/atoms/Skeleton';