@tecsinapse/react-web-kit 1.16.1 → 1.17.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.
- package/CHANGELOG.md +12 -0
- package/dist/components/atoms/InputMask/InputMask.d.ts +6 -0
- package/dist/components/atoms/InputMask/InputMask.js +81 -0
- package/dist/components/atoms/InputMask/InputMask.js.map +1 -0
- package/dist/components/atoms/InputMask/index.d.ts +1 -0
- package/dist/components/atoms/InputMask/index.js +24 -0
- package/dist/components/atoms/InputMask/index.js.map +1 -0
- package/dist/components/atoms/InputMask/styled.d.ts +4 -0
- package/dist/components/atoms/InputMask/styled.js +20 -0
- package/dist/components/atoms/InputMask/styled.js.map +1 -0
- package/dist/components/atoms/Skeleton/Skeleton.d.ts +1 -0
- package/dist/components/atoms/Skeleton/Skeleton.js +10 -1
- package/dist/components/atoms/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/atoms/Skeleton/styled.js +7 -5
- package/dist/components/atoms/Skeleton/styled.js.map +1 -1
- package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/atoms/Input/Input.stories.tsx +0 -71
- package/src/components/atoms/InputMask/InputMask.stories.tsx +80 -0
- package/src/components/atoms/InputMask/InputMask.tsx +84 -0
- package/src/components/atoms/InputMask/index.ts +1 -0
- package/src/components/atoms/InputMask/styled.ts +10 -0
- package/src/components/atoms/Skeleton/Skeleton.stories.tsx +23 -0
- package/src/components/atoms/Skeleton/Skeleton.tsx +10 -1
- package/src/components/atoms/Skeleton/styled.ts +7 -3
- package/src/components/molecules/DatePicker/DatePicker.tsx +1 -1
- package/src/index.ts +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.17.0](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.16.1...@tecsinapse/react-web-kit@1.17.0) (2022-05-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* inputMask accepting undefined. ([6037162](https://github.com/tecsinapse/design-system/commit/6037162a564c118c8faed8359418ff7eda6d1645))
|
|
12
|
+
* wrong storybook title ([c421df4](https://github.com/tecsinapse/design-system/commit/c421df46fec3d8c9119af9ca70c4efad693921dd))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [1.16.1](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.16.0...@tecsinapse/react-web-kit@1.16.1) (2022-04-01)
|
|
7
19
|
|
|
8
20
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InputContainerProps, InputMaskElementProps } from '@tecsinapse/react-core';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export interface InputMaskWebProps extends Omit<InputMaskElementProps, 'style'>, InputContainerProps {
|
|
4
|
+
}
|
|
5
|
+
declare const InputMask: FC<InputMaskWebProps>;
|
|
6
|
+
export default InputMask;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactCore = require("@tecsinapse/react-core");
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _reactNativeWeb = require("react-native-web");
|
|
13
|
+
|
|
14
|
+
var _styled = require("./styled");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
const InputMask = _react.default.forwardRef(({
|
|
21
|
+
label,
|
|
22
|
+
labelColor,
|
|
23
|
+
labelColorVariant,
|
|
24
|
+
labelColorTone,
|
|
25
|
+
labelTypography,
|
|
26
|
+
labelStack,
|
|
27
|
+
labelWeight,
|
|
28
|
+
leftComponent,
|
|
29
|
+
rightComponent,
|
|
30
|
+
disabled,
|
|
31
|
+
style,
|
|
32
|
+
borderColor,
|
|
33
|
+
borderColorGradation,
|
|
34
|
+
inputContainerStyle,
|
|
35
|
+
variant = 'default',
|
|
36
|
+
hintComponent,
|
|
37
|
+
hint,
|
|
38
|
+
onFocus,
|
|
39
|
+
onBlur,
|
|
40
|
+
...rest
|
|
41
|
+
}, ref) => {
|
|
42
|
+
const _hint = hintComponent || _react.default.createElement(_reactCore.Hint, {
|
|
43
|
+
text: hint,
|
|
44
|
+
variant: variant
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const {
|
|
48
|
+
focused,
|
|
49
|
+
handleBlur,
|
|
50
|
+
handleFocus
|
|
51
|
+
} = (0, _reactCore.useInputFocus)(onFocus, onBlur, !disabled);
|
|
52
|
+
return _react.default.createElement(_reactNativeWeb.View, {
|
|
53
|
+
style: style
|
|
54
|
+
}, _react.default.createElement(_reactCore.InputContainer, {
|
|
55
|
+
label: label,
|
|
56
|
+
labelColor: labelColor,
|
|
57
|
+
labelColorVariant: labelColorVariant,
|
|
58
|
+
labelColorTone: labelColorTone,
|
|
59
|
+
labelTypography: labelTypography,
|
|
60
|
+
labelStack: labelStack,
|
|
61
|
+
labelWeight: labelWeight,
|
|
62
|
+
leftComponent: leftComponent,
|
|
63
|
+
rightComponent: rightComponent,
|
|
64
|
+
borderColor: borderColor,
|
|
65
|
+
borderColorGradation: borderColorGradation,
|
|
66
|
+
inputContainerStyle: inputContainerStyle,
|
|
67
|
+
focused: focused,
|
|
68
|
+
disabled: disabled,
|
|
69
|
+
variant: variant
|
|
70
|
+
}, _react.default.createElement(_styled.StyledWebTextInputMask, _extends({}, rest, {
|
|
71
|
+
ref: ref,
|
|
72
|
+
disabled: disabled,
|
|
73
|
+
onFocus: handleFocus,
|
|
74
|
+
onBlur: handleBlur
|
|
75
|
+
}))), hint && _hint);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
InputMask.displayName = 'InputMask';
|
|
79
|
+
var _default = InputMask;
|
|
80
|
+
exports.default = _default;
|
|
81
|
+
//# sourceMappingURL=InputMask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/InputMask/InputMask.tsx"],"names":["InputMask","React","forwardRef","label","labelColor","labelColorVariant","labelColorTone","labelTypography","labelStack","labelWeight","leftComponent","rightComponent","disabled","style","borderColor","borderColorGradation","inputContainerStyle","variant","hintComponent","hint","onFocus","onBlur","rest","ref","_hint","focused","handleBlur","handleFocus","displayName"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;AACA;;;;;;AAMA,MAAMA,SAAgC,GAAGC,eAAMC,UAAN,CACvC,CACE;AACEC,EAAAA,KADF;AAEEC,EAAAA,UAFF;AAGEC,EAAAA,iBAHF;AAIEC,EAAAA,cAJF;AAKEC,EAAAA,eALF;AAMEC,EAAAA,UANF;AAOEC,EAAAA,WAPF;AAQEC,EAAAA,aARF;AASEC,EAAAA,cATF;AAUEC,EAAAA,QAVF;AAWEC,EAAAA,KAXF;AAYEC,EAAAA,WAZF;AAaEC,EAAAA,oBAbF;AAcEC,EAAAA,mBAdF;AAeEC,EAAAA,OAAO,GAAG,SAfZ;AAgBEC,EAAAA,aAhBF;AAiBEC,EAAAA,IAjBF;AAkBEC,EAAAA,OAlBF;AAmBEC,EAAAA,MAnBF;AAoBE,KAAGC;AApBL,CADF,EAuBEC,GAvBF,KAwBK;AACH,QAAMC,KAAK,GAAGN,aAAa,IAAI,6BAAC,eAAD;AAAM,IAAA,IAAI,EAAEC,IAAZ;AAAkB,IAAA,OAAO,EAAEF;AAA3B,IAA/B;;AACA,QAAM;AAAEQ,IAAAA,OAAF;AAAWC,IAAAA,UAAX;AAAuBC,IAAAA;AAAvB,MAAuC,8BAC3CP,OAD2C,EAE3CC,MAF2C,EAG3C,CAACT,QAH0C,CAA7C;AAMA,SACE,6BAAC,oBAAD;AAAM,IAAA,KAAK,EAAEC;AAAb,KACE,6BAAC,yBAAD;AACE,IAAA,KAAK,EAAEV,KADT;AAEE,IAAA,UAAU,EAAEC,UAFd;AAGE,IAAA,iBAAiB,EAAEC,iBAHrB;AAIE,IAAA,cAAc,EAAEC,cAJlB;AAKE,IAAA,eAAe,EAAEC,eALnB;AAME,IAAA,UAAU,EAAEC,UANd;AAOE,IAAA,WAAW,EAAEC,WAPf;AAQE,IAAA,aAAa,EAAEC,aARjB;AASE,IAAA,cAAc,EAAEC,cATlB;AAUE,IAAA,WAAW,EAAEG,WAVf;AAWE,IAAA,oBAAoB,EAAEC,oBAXxB;AAYE,IAAA,mBAAmB,EAAEC,mBAZvB;AAaE,IAAA,OAAO,EAAES,OAbX;AAcE,IAAA,QAAQ,EAAEb,QAdZ;AAeE,IAAA,OAAO,EAAEK;AAfX,KAiBE,6BAAC,8BAAD,eACMK,IADN;AAEE,IAAA,GAAG,EAAEC,GAFP;AAGE,IAAA,QAAQ,EAAEX,QAHZ;AAIE,IAAA,OAAO,EAAEe,WAJX;AAKE,IAAA,MAAM,EAAED;AALV,KAjBF,CADF,EA0BGP,IAAI,IAAIK,KA1BX,CADF;AA8BD,CA/DsC,CAAzC;;AAkEAxB,SAAS,CAAC4B,WAAV,GAAwB,WAAxB;eAEe5B,S","sourcesContent":["import {\n Hint,\n InputContainer,\n InputContainerProps,\n InputMaskElementProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { View } from 'react-native';\nimport { StyledWebTextInputMask } from './styled';\n\nexport interface InputMaskWebProps\n extends Omit<InputMaskElementProps, 'style'>,\n InputContainerProps {}\n\nconst InputMask: FC<InputMaskWebProps> = React.forwardRef(\n (\n {\n label,\n labelColor,\n labelColorVariant,\n labelColorTone,\n labelTypography,\n labelStack,\n labelWeight,\n leftComponent,\n rightComponent,\n disabled,\n style,\n borderColor,\n borderColorGradation,\n inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n onFocus,\n onBlur,\n ...rest\n },\n ref\n ) => {\n const _hint = hintComponent || <Hint text={hint} variant={variant} />;\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n return (\n <View style={style}>\n <InputContainer\n label={label}\n labelColor={labelColor}\n labelColorVariant={labelColorVariant}\n labelColorTone={labelColorTone}\n labelTypography={labelTypography}\n labelStack={labelStack}\n labelWeight={labelWeight}\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n borderColor={borderColor}\n borderColorGradation={borderColorGradation}\n inputContainerStyle={inputContainerStyle}\n focused={focused}\n disabled={disabled}\n variant={variant}\n >\n <StyledWebTextInputMask\n {...rest}\n ref={ref}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </InputContainer>\n {hint && _hint}\n </View>\n );\n }\n);\n\nInputMask.displayName = 'InputMask';\n\nexport default InputMask;\n"],"file":"InputMask.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as InputMask, InputMaskWebProps } from './InputMask';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "InputMask", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _InputMask.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "InputMaskWebProps", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _InputMask.InputMaskWebProps;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _InputMask = _interopRequireWildcard(require("./InputMask"));
|
|
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/InputMask/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as InputMask, InputMaskWebProps } from './InputMask';\n"],"file":"index.js"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledWebTextInputMask = 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 StyledWebTextInputMask = (0, _native.default)(_reactCore.InputMaskElement)`
|
|
15
|
+
&:focus-visible {
|
|
16
|
+
outline-width: 0;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
exports.StyledWebTextInputMask = StyledWebTextInputMask;
|
|
20
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/InputMask/styled.ts"],"names":["StyledWebTextInputMask","InputMaskElement"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEO,MAAMA,sBAAsB,GAAG,qBAAOC,2BAAP,CAEpC;AACF;AACA;AACA;AACA,CANO","sourcesContent":["import styled from '@emotion/native';\nimport { InputMaskElement, StyleProps } from '@tecsinapse/react-core';\n\nexport const StyledWebTextInputMask = styled(InputMaskElement)<\n Partial<StyleProps>\n>`\n &:focus-visible {\n outline-width: 0;\n }\n`;\n"],"file":"styled.js"}
|
|
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _styled = require("./styled");
|
|
11
11
|
|
|
12
|
+
var _reactNativeWeb = require("react-native-web");
|
|
13
|
+
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
14
16
|
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); }
|
|
@@ -18,6 +20,7 @@ const Skeleton = ({
|
|
|
18
20
|
width,
|
|
19
21
|
height,
|
|
20
22
|
animation = 'wave',
|
|
23
|
+
active = true,
|
|
21
24
|
radius,
|
|
22
25
|
...rest
|
|
23
26
|
}) => {
|
|
@@ -29,8 +32,14 @@ const Skeleton = ({
|
|
|
29
32
|
width: width,
|
|
30
33
|
height: height,
|
|
31
34
|
animation: animation,
|
|
35
|
+
active: active,
|
|
32
36
|
radius: radius
|
|
33
|
-
}, rest),
|
|
37
|
+
}, rest), _react.default.createElement(_reactNativeWeb.View, {
|
|
38
|
+
style: {
|
|
39
|
+
opacity: active ? 0 : 1
|
|
40
|
+
},
|
|
41
|
+
pointerEvents: active ? 'none' : 'auto'
|
|
42
|
+
}, children));
|
|
34
43
|
};
|
|
35
44
|
|
|
36
45
|
var _default = Skeleton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Skeleton/Skeleton.tsx"],"names":["Skeleton","children","width","height","animation","radius","rest","Error"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAUA,MAAMA,QAAiC,GAAG,CAAC;AACzCC,EAAAA,QADyC;AAEzCC,EAAAA,KAFyC;AAGzCC,EAAAA,MAHyC;AAIzCC,EAAAA,SAAS,GAAG,MAJ6B;AAKzCC,EAAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Skeleton/Skeleton.tsx"],"names":["Skeleton","children","width","height","animation","active","radius","rest","Error","opacity"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;AAUA,MAAMA,QAAiC,GAAG,CAAC;AACzCC,EAAAA,QADyC;AAEzCC,EAAAA,KAFyC;AAGzCC,EAAAA,MAHyC;AAIzCC,EAAAA,SAAS,GAAG,MAJ6B;AAKzCC,EAAAA,MAAM,GAAG,IALgC;AAMzCC,EAAAA,MANyC;AAOzC,KAAGC;AAPsC,CAAD,KAQpC;AACJ,MAAI,CAACL,KAAD,IAAU,CAACC,MAAX,IAAqB,CAACF,QAA1B,EAAoC;AAClC,UAAM,IAAIO,KAAJ,CACJ,oEADI,CAAN;AAGD;;AAED,SACE,6BAAC,eAAD;AACE,IAAA,KAAK,EAAEN,KADT;AAEE,IAAA,MAAM,EAAEC,MAFV;AAGE,IAAA,SAAS,EAAEC,SAHb;AAIE,IAAA,MAAM,EAAEC,MAJV;AAKE,IAAA,MAAM,EAAEC;AALV,KAMMC,IANN,GAQE,6BAAC,oBAAD;AACE,IAAA,KAAK,EAAE;AAAEE,MAAAA,OAAO,EAAEJ,MAAM,GAAG,CAAH,GAAO;AAAxB,KADT;AAEE,IAAA,aAAa,EAAEA,MAAM,GAAG,MAAH,GAAY;AAFnC,KAIGJ,QAJH,CARF,CADF;AAiBD,CAhCD;;eAkCeD,Q","sourcesContent":["import React from 'react';\nimport { Wrapper } from './styled';\nimport { BorderRadiusType } from '@tecsinapse/react-core';\nimport { View } from 'react-native';\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n width?: number;\n height?: number;\n animation?: 'pulse' | 'wave';\n active?: boolean;\n radius?: BorderRadiusType;\n}\n\nconst Skeleton: React.FC<SkeletonProps> = ({\n children,\n width,\n height,\n animation = 'wave',\n active = true,\n radius,\n ...rest\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 return (\n <Wrapper\n width={width}\n height={height}\n animation={animation}\n active={active}\n radius={radius}\n {...rest}\n >\n <View\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"}
|
|
@@ -16,7 +16,7 @@ const pulseKf = (0, _react.keyframes)`
|
|
|
16
16
|
opacity: 1;
|
|
17
17
|
}
|
|
18
18
|
50% {
|
|
19
|
-
opacity: 0.
|
|
19
|
+
opacity: 0.1;
|
|
20
20
|
}
|
|
21
21
|
100% {
|
|
22
22
|
opacity: 1;
|
|
@@ -59,8 +59,9 @@ const pulseAnim = (0, _react.css)`
|
|
|
59
59
|
const Wrapper = (0, _styled.default)('div')`
|
|
60
60
|
background-color: ${({
|
|
61
61
|
theme,
|
|
62
|
-
animation
|
|
63
|
-
|
|
62
|
+
animation,
|
|
63
|
+
active
|
|
64
|
+
}) => !active ? undefined : animation === 'pulse' ? theme.miscellaneous.bodyColor : theme.miscellaneous.surfaceColor};
|
|
64
65
|
width: ${({
|
|
65
66
|
width
|
|
66
67
|
}) => `${width}px` ?? '100%'};
|
|
@@ -72,8 +73,9 @@ const Wrapper = (0, _styled.default)('div')`
|
|
|
72
73
|
radius
|
|
73
74
|
}) => radius ? theme.borderRadius[radius] : 'unset'};
|
|
74
75
|
${({
|
|
75
|
-
animation
|
|
76
|
-
|
|
76
|
+
animation,
|
|
77
|
+
active
|
|
78
|
+
}) => !active ? undefined : animation === 'pulse' ? pulseAnim : waveAnim};
|
|
77
79
|
`;
|
|
78
80
|
exports.Wrapper = Wrapper;
|
|
79
81
|
//# sourceMappingURL=styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Skeleton/styled.ts"],"names":["pulseKf","waveKf","waveAnim","pulseAnim","Wrapper","theme","animation","miscellaneous","bodyColor","surfaceColor","width","height","radius","borderRadius"],"mappings":";;;;;;;AAAA;;AACA;;;;AAIA,MAAMA,OAAO,GAAG,qBAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAVA;AAYA,MAAMC,MAAM,GAAG,qBAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAVA;AAYA,MAAMC,QAAQ,GAAG,eAAI;AACrB;AACA;AACA;AACA,iBAAiBD,MAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAnBA;AAqBA,MAAME,SAAS,GAAG,eAAI;AACtB,eAAeH,OAAQ;AACvB,CAFA;AAIO,MAAMI,OAAO,GAAG,qBAAO,KAAP,CAAmD;AAC1E,sBAAsB,CAAC;AACnBC,EAAAA,KADmB;AAEnBC,EAAAA;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Skeleton/styled.ts"],"names":["pulseKf","waveKf","waveAnim","pulseAnim","Wrapper","theme","animation","active","undefined","miscellaneous","bodyColor","surfaceColor","width","height","radius","borderRadius"],"mappings":";;;;;;;AAAA;;AACA;;;;AAIA,MAAMA,OAAO,GAAG,qBAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAVA;AAYA,MAAMC,MAAM,GAAG,qBAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAVA;AAYA,MAAMC,QAAQ,GAAG,eAAI;AACrB;AACA;AACA;AACA,iBAAiBD,MAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAnBA;AAqBA,MAAME,SAAS,GAAG,eAAI;AACtB,eAAeH,OAAQ;AACvB,CAFA;AAIO,MAAMI,OAAO,GAAG,qBAAO,KAAP,CAAmD;AAC1E,sBAAsB,CAAC;AACnBC,EAAAA,KADmB;AAEnBC,EAAAA,SAFmB;AAGnBC,EAAAA;AAHmB,CAAD,KAKlB,CAACA,MAAD,GACIC,SADJ,GAEIF,SAAS,KAAK,OAAd,GACAD,KAAK,CAACI,aAAN,CAAoBC,SADpB,GAEAL,KAAK,CAACI,aAAN,CAAoBE,YAAa;AACzC,WAAW,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAgB,GAAEA,KAAM,IAAT,IAAgB,MAAO;AACjD,YAAY,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAiB,GAAEA,MAAO,IAAV,IAAiB,MAAO;AACpD,mBAAmB,CAAC;AAAER,EAAAA,KAAF;AAASS,EAAAA;AAAT,CAAD,KACfA,MAAM,GAAGT,KAAK,CAACU,YAAN,CAAmBD,MAAnB,CAAH,GAAgC,OAAQ;AAClD,IAAI,CAAC;AAAER,EAAAA,SAAF;AAAaC,EAAAA;AAAb,CAAD,KACA,CAACA,MAAD,GAAUC,SAAV,GAAsBF,SAAS,KAAK,OAAd,GAAwBH,SAAxB,GAAoCD,QAAS;AACvE,CAjBO","sourcesContent":["import { css, keyframes } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { StyleProps } from '@tecsinapse/react-core';\nimport { SkeletonProps } from './Skeleton';\n\nconst pulseKf = keyframes`\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.1;\n }\n 100% {\n opacity: 1;\n }\n`;\n\nconst waveKf = keyframes`\n 0% {\n transform: translateX(-100%);\n }\n 50% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(100%);\n }\n`;\n\nconst waveAnim = css`\n position: relative;\n overflow: hidden;\n &::after {\n animation: ${waveKf} 1.6s linear 0.5s infinite;\n background: linear-gradient(\n 90deg,\n transparent,\n rgba(0, 0, 0, 0.04),\n transparent\n );\n content: '';\n position: absolute;\n transform: translateX(-100%);\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n }\n`;\n\nconst pulseAnim = css`\n animation: ${pulseKf} 1.5s ease-in-out 0.5s infinite;\n`;\n\nexport const Wrapper = styled('div')<Partial<StyleProps & SkeletonProps>>`\n background-color: ${({\n theme,\n animation,\n active,\n }: StyleProps & Partial<SkeletonProps>) =>\n !active\n ? undefined\n : animation === 'pulse'\n ? theme.miscellaneous.bodyColor\n : theme.miscellaneous.surfaceColor};\n width: ${({ width }) => `${width}px` ?? '100%'};\n height: ${({ height }) => `${height}px` ?? 'auto'};\n border-radius: ${({ theme, radius }: StyleProps & Partial<SkeletonProps>) =>\n radius ? theme.borderRadius[radius] : 'unset'};\n ${({ animation, active }) =>\n !active ? undefined : animation === 'pulse' ? pulseAnim : waveAnim};\n`;\n"],"file":"styled.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/molecules/DatePicker/DatePicker.tsx"],"names":["DatePicker","value","type","rest","visible","setVisible","show","close","getYear","lowest","undefined","Date","getFullYear","getMonth","Calendar","calendar"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;;;;;;;AAUO,MAAMA,UAAU,GAAG,CAA0B;AAClDC,EAAAA,KADkD;AAElDC,EAAAA,IAFkD;AAGlD,KAAGC;AAH+C,CAA1B,KAIgB;AACxC,QAAM,CAACC,OAAD,EAAUC,UAAV,IAAwB,qBAAS,KAAT,CAA9B;AACA,QAAMC,IAAI,GAAG,wBAAY,MAAMD,UAAU,CAAC,IAAD,CAA5B,EAAoC,EAApC,CAAb;AACA,QAAME,KAAK,GAAG,wBAAY,MAAMF,UAAU,CAAC,KAAD,CAA5B,EAAqC,EAArC,CAAd;AAEA,QAAMG,OAAO,GAAG,oBAAQ,MAAM;AAC5B,QAAIP,KAAJ,EAAW;AACT,UAAIC,IAAI,KAAK,OAAb,EAAsB;AACpB,YAAKD,KAAD,CAAqBQ,MAArB,KAAgCC,SAApC,EACE,OAAO,IAAIC,IAAJ,CAAUV,KAAD,CAAqBQ,MAA9B,EAAsCG,WAAtC,EAAP;AACH,OAHD,MAGO;AACL,eAAO,IAAID,IAAJ,CAASV,KAAT,EAAwBW,WAAxB,EAAP;AACD;AACF;;AACD,WAAOF,SAAP;AACD,GAVe,EAUb,CAACT,KAAD,CAVa,CAAhB;AAYA,QAAMY,QAAQ,GAAG,oBAAQ,MAAM;AAC7B,QAAIZ,KAAJ,EAAW;AACT,UAAIC,IAAI,KAAK,OAAb,EAAsB;AACpB,YAAKD,KAAD,CAAqBQ,MAArB,KAAgCC,SAApC,EACE,OAAO,IAAIC,IAAJ,CAAUV,KAAD,CAAqBQ,MAA9B,EAAsCI,QAAtC,EAAP;AACH,OAHD,MAGO;AACL,eAAO,IAAIF,IAAJ,CAASV,KAAT,EAAwBY,QAAxB,EAAP;AACD;AACF;;AACD,WAAOH,SAAP;AACD,GAVgB,EAUd,CAACT,KAAD,CAVc,CAAjB;AAYA,SACE,6BAAC,qBAAD,eACME,IADN;AAEE,IAAA,iBAAiB,EAAEW,mBAFrB;AAGE,IAAA,KAAK,EAAEb,KAHT;AAIE,IAAA,IAAI,EAAEC,IAJR;AAKE,IAAA,IAAI,EAAEM,OALR;AAME,IAAA,KAAK,EAAEK,QANT;AAOE,IAAA,mBAAmB,EAAEP,IAPvB;AAQE,IAAA,oBAAoB,EAAEC,KARxB;AASE,IAAA,cAAc,EAAEQ,QAAQ,IACtB,6BAAC,kBAAD;AAAU,MAAA,OAAO,EAAEX,OAAnB;AAA4B,MAAA,UAAU,EAAEC;AAAxC,OACGU,QADH;AAVJ,KADF;AAiBD,CAlDM","sourcesContent":["import {\n Calendar,\n DatePicker as DatePickerCore,\n DatePickerProps,\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/DatePicker/DatePicker.tsx"],"names":["DatePicker","value","type","rest","visible","setVisible","show","close","getYear","lowest","undefined","Date","getFullYear","getMonth","Calendar","calendar"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;;;;;;;AAUO,MAAMA,UAAU,GAAG,CAA0B;AAClDC,EAAAA,KADkD;AAElDC,EAAAA,IAFkD;AAGlD,KAAGC;AAH+C,CAA1B,KAIgB;AACxC,QAAM,CAACC,OAAD,EAAUC,UAAV,IAAwB,qBAAS,KAAT,CAA9B;AACA,QAAMC,IAAI,GAAG,wBAAY,MAAMD,UAAU,CAAC,IAAD,CAA5B,EAAoC,EAApC,CAAb;AACA,QAAME,KAAK,GAAG,wBAAY,MAAMF,UAAU,CAAC,KAAD,CAA5B,EAAqC,EAArC,CAAd;AAEA,QAAMG,OAAO,GAAG,oBAAQ,MAAM;AAC5B,QAAIP,KAAJ,EAAW;AACT,UAAIC,IAAI,KAAK,OAAb,EAAsB;AACpB,YAAKD,KAAD,CAAqBQ,MAArB,KAAgCC,SAApC,EACE,OAAO,IAAIC,IAAJ,CAAUV,KAAD,CAAqBQ,MAA9B,EAAsCG,WAAtC,EAAP;AACH,OAHD,MAGO;AACL,eAAO,IAAID,IAAJ,CAASV,KAAT,EAAwBW,WAAxB,EAAP;AACD;AACF;;AACD,WAAOF,SAAP;AACD,GAVe,EAUb,CAACT,KAAD,CAVa,CAAhB;AAYA,QAAMY,QAAQ,GAAG,oBAAQ,MAAM;AAC7B,QAAIZ,KAAJ,EAAW;AACT,UAAIC,IAAI,KAAK,OAAb,EAAsB;AACpB,YAAKD,KAAD,CAAqBQ,MAArB,KAAgCC,SAApC,EACE,OAAO,IAAIC,IAAJ,CAAUV,KAAD,CAAqBQ,MAA9B,EAAsCI,QAAtC,EAAP;AACH,OAHD,MAGO;AACL,eAAO,IAAIF,IAAJ,CAASV,KAAT,EAAwBY,QAAxB,EAAP;AACD;AACF;;AACD,WAAOH,SAAP;AACD,GAVgB,EAUd,CAACT,KAAD,CAVc,CAAjB;AAYA,SACE,6BAAC,qBAAD,eACME,IADN;AAEE,IAAA,iBAAiB,EAAEW,mBAFrB;AAGE,IAAA,KAAK,EAAEb,KAHT;AAIE,IAAA,IAAI,EAAEC,IAJR;AAKE,IAAA,IAAI,EAAEM,OALR;AAME,IAAA,KAAK,EAAEK,QANT;AAOE,IAAA,mBAAmB,EAAEP,IAPvB;AAQE,IAAA,oBAAoB,EAAEC,KARxB;AASE,IAAA,cAAc,EAAEQ,QAAQ,IACtB,6BAAC,kBAAD;AAAU,MAAA,OAAO,EAAEX,OAAnB;AAA4B,MAAA,UAAU,EAAEC;AAAxC,OACGU,QADH;AAVJ,KADF;AAiBD,CAlDM","sourcesContent":["import {\n Calendar,\n DatePicker as DatePickerCore,\n DatePickerProps,\n DateRange,\n SelectionType,\n} from '@tecsinapse/react-core';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { Dropdown } from '../../atoms/Dropdown';\n\nexport type WebDatePickerProps<T extends SelectionType> = Omit<\n DatePickerProps<T>,\n | 'CalendarComponent'\n | 'renderCalendar'\n | 'requestCloseCalendar'\n | 'requestShowCalendar'\n>;\n\nexport const DatePicker = <T extends SelectionType>({\n value,\n type,\n ...rest\n}: WebDatePickerProps<T>): JSX.Element => {\n const [visible, setVisible] = useState(false);\n const show = useCallback(() => setVisible(true), []);\n const close = useCallback(() => setVisible(false), []);\n\n const getYear = useMemo(() => {\n if (value) {\n if (type === 'range') {\n if ((value as DateRange).lowest !== undefined)\n return new Date((value as DateRange).lowest).getFullYear();\n } else {\n return new Date(value as Date).getFullYear();\n }\n }\n return undefined;\n }, [value]);\n\n const getMonth = useMemo(() => {\n if (value) {\n if (type === 'range') {\n if ((value as DateRange).lowest !== undefined)\n return new Date((value as DateRange).lowest).getMonth();\n } else {\n return new Date(value as Date).getMonth();\n }\n }\n return undefined;\n }, [value]);\n\n return (\n <DatePickerCore\n {...rest}\n CalendarComponent={Calendar}\n value={value}\n type={type}\n year={getYear}\n month={getMonth}\n requestShowCalendar={show}\n requestCloseCalendar={close}\n renderCalendar={calendar => (\n <Dropdown visible={visible} setVisible={setVisible}>\n {calendar}\n </Dropdown>\n )}\n />\n );\n};\n"],"file":"DatePicker.js"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { Button, useMouseHover, WebButtonProps, } from './components/atoms/Butto
|
|
|
4
4
|
export { Input, InputWebProps } from './components/atoms/Input';
|
|
5
5
|
export { Tag, TagProps } from './components/atoms/Tag';
|
|
6
6
|
export { InputPassword, InputPasswordWebProps, } from './components/molecules/InputPassword';
|
|
7
|
+
export { InputMask, InputMaskWebProps } from './components/atoms/InputMask';
|
|
7
8
|
export { Menubar, MenubarProps, MenubarOptionsType, MenubarItemsOptions, MenubarMostUsedType, } from './components/molecules/Menubar';
|
|
8
9
|
export { Drawer, DrawerProps } from './components/molecules/Drawer';
|
|
9
10
|
export { Select, SelectProps } from './components/molecules/Select';
|
|
@@ -16,5 +17,5 @@ export { Modal, ModalProps } from './components/atoms/Modal';
|
|
|
16
17
|
export { TextArea, TextAreaProps } from './components/molecules/TextArea';
|
|
17
18
|
export { Tooltip, ITooltip } from './components/atoms/Tooltip';
|
|
18
19
|
export * from './hooks';
|
|
19
|
-
export { DatePicker, WebDatePickerProps } from './components/molecules/DatePicker';
|
|
20
|
-
export { DateTimePicker, WebDateTimePickerProps } from './components/molecules/DateTimePicker';
|
|
20
|
+
export { DatePicker, WebDatePickerProps, } from './components/molecules/DatePicker';
|
|
21
|
+
export { DateTimePicker, WebDateTimePickerProps, } from './components/molecules/DateTimePicker';
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,8 @@ var _exportNames = {
|
|
|
15
15
|
TagProps: true,
|
|
16
16
|
InputPassword: true,
|
|
17
17
|
InputPasswordWebProps: true,
|
|
18
|
+
InputMask: true,
|
|
19
|
+
InputMaskWebProps: true,
|
|
18
20
|
Menubar: true,
|
|
19
21
|
MenubarProps: true,
|
|
20
22
|
MenubarOptionsType: true,
|
|
@@ -113,6 +115,18 @@ Object.defineProperty(exports, "InputPasswordWebProps", {
|
|
|
113
115
|
return _InputPassword.InputPasswordWebProps;
|
|
114
116
|
}
|
|
115
117
|
});
|
|
118
|
+
Object.defineProperty(exports, "InputMask", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () {
|
|
121
|
+
return _InputMask.InputMask;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(exports, "InputMaskWebProps", {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
get: function () {
|
|
127
|
+
return _InputMask.InputMaskWebProps;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
116
130
|
Object.defineProperty(exports, "Menubar", {
|
|
117
131
|
enumerable: true,
|
|
118
132
|
get: function () {
|
|
@@ -324,6 +338,8 @@ var _Tag = require("./components/atoms/Tag");
|
|
|
324
338
|
|
|
325
339
|
var _InputPassword = require("./components/molecules/InputPassword");
|
|
326
340
|
|
|
341
|
+
var _InputMask = require("./components/atoms/InputMask");
|
|
342
|
+
|
|
327
343
|
var _Menubar = require("./components/molecules/Menubar");
|
|
328
344
|
|
|
329
345
|
var _Drawer = require("./components/molecules/Drawer");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AAIA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAIA","sourcesContent":["export * from '@tecsinapse/react-core';\nexport {\n default as Badge,\n BadgeWebProps,\n} from './components/atoms/Badge/Badge';\nexport {\n Button,\n useMouseHover,\n WebButtonProps,\n} from './components/atoms/Button';\nexport { Input, InputWebProps } from './components/atoms/Input';\nexport { Tag, TagProps } from './components/atoms/Tag';\nexport {\n InputPassword,\n InputPasswordWebProps,\n} from './components/molecules/InputPassword';\nexport { InputMask, InputMaskWebProps } from './components/atoms/InputMask';\nexport {\n Menubar,\n MenubarProps,\n MenubarOptionsType,\n MenubarItemsOptions,\n MenubarMostUsedType,\n} from './components/molecules/Menubar';\nexport { Drawer, DrawerProps } from './components/molecules/Drawer';\nexport { Select, SelectProps } from './components/molecules/Select';\nexport { Snackbar, SnackbarWebProps } from './components/molecules/Snackbar';\nexport {\n Breadcrumbs,\n BreadcrumbsProps,\n BreadcrumbType,\n} from './components/molecules/Breadcrumbs';\nexport { Skeleton, SkeletonProps } from './components/atoms/Skeleton';\nexport { Accordion, AccordionProps } from './components/atoms/Accordion';\nexport {\n DataGrid,\n DataGridProps,\n HeadersType,\n} from './components/organisms/DataGrid';\nexport { Modal, ModalProps } from './components/atoms/Modal';\nexport { TextArea, TextAreaProps } from './components/molecules/TextArea';\nexport { Tooltip, ITooltip } from './components/atoms/Tooltip';\nexport * from './hooks';\nexport {\n DatePicker,\n WebDatePickerProps,\n} from './components/molecules/DatePicker';\nexport {\n DateTimePicker,\n WebDateTimePickerProps,\n} from './components/molecules/DateTimePicker';\n"],"file":"index.js"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/react-web-kit",
|
|
3
3
|
"description": "TecSinapse React components",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.17.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@emotion/native": "^11.0.0",
|
|
15
15
|
"@emotion/react": "^11.4.1",
|
|
16
16
|
"@emotion/styled": "^11.3.0",
|
|
17
|
-
"@tecsinapse/react-core": "^1.
|
|
17
|
+
"@tecsinapse/react-core": "^1.16.0",
|
|
18
18
|
"@types/react-native": "^0.64.4",
|
|
19
19
|
"react-native-vector-icons": "^9.1.0",
|
|
20
20
|
"react-transition-group": "^4.4.2"
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
34
34
|
"react-native-web": "^0.17.1"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "ae6f88727b5e35210ada1c7ea0b54d24094af22c"
|
|
37
37
|
}
|
|
@@ -2,8 +2,6 @@ import { action } from '@storybook/addon-actions';
|
|
|
2
2
|
import { Story } from '@storybook/react';
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
import Input, { InputWebProps } from './Input';
|
|
5
|
-
import { Masks } from '@tecsinapse/react-core/src';
|
|
6
|
-
import { CurrencyOptions } from '@tecsinapse/react-core/src/components/atoms/Input/hooks/useNumberMask';
|
|
7
5
|
|
|
8
6
|
export default {
|
|
9
7
|
title: 'Hybrid/Input',
|
|
@@ -39,72 +37,3 @@ Base.args = {
|
|
|
39
37
|
disabled: false,
|
|
40
38
|
label: 'Login',
|
|
41
39
|
};
|
|
42
|
-
|
|
43
|
-
const TemplateStringMask: Story<InputWebProps> = args => {
|
|
44
|
-
const [value, setValue] = useState<string>('');
|
|
45
|
-
|
|
46
|
-
const onChange = text => {
|
|
47
|
-
setValue(text);
|
|
48
|
-
if (args.onChange) {
|
|
49
|
-
args.onChange(text);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<Input
|
|
55
|
-
{...args}
|
|
56
|
-
label={args.label}
|
|
57
|
-
value={value}
|
|
58
|
-
onChange={onChange}
|
|
59
|
-
placeholder={args.placeholder}
|
|
60
|
-
mask={Masks.COMBINED_PHONE}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const StringMask = TemplateStringMask.bind({});
|
|
66
|
-
|
|
67
|
-
StringMask.args = {
|
|
68
|
-
onChange: value => action('onChange')(value),
|
|
69
|
-
placeholder: 'Type your phone',
|
|
70
|
-
disabled: false,
|
|
71
|
-
label: 'Phone',
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const TemplateNumberMask: Story<InputWebProps> = args => {
|
|
75
|
-
const [value, setValue] = useState<number>(1200.2);
|
|
76
|
-
|
|
77
|
-
const onChange = text => {
|
|
78
|
-
setValue(text);
|
|
79
|
-
if (args.onChange) {
|
|
80
|
-
args.onChange(text);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const numberMaskExample: CurrencyOptions = {
|
|
85
|
-
symbol: 'R$ ',
|
|
86
|
-
separator: '.',
|
|
87
|
-
decimal: ',',
|
|
88
|
-
precision: 2,
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
return (
|
|
92
|
-
<Input
|
|
93
|
-
{...args}
|
|
94
|
-
label={args.label}
|
|
95
|
-
value={value}
|
|
96
|
-
onChange={onChange}
|
|
97
|
-
placeholder={args.placeholder}
|
|
98
|
-
mask={numberMaskExample}
|
|
99
|
-
/>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export const NumberMask = TemplateNumberMask.bind({});
|
|
104
|
-
|
|
105
|
-
NumberMask.args = {
|
|
106
|
-
onChange: value => action('onChange')(value),
|
|
107
|
-
placeholder: 'Type the price in R$',
|
|
108
|
-
disabled: false,
|
|
109
|
-
label: 'Price',
|
|
110
|
-
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
import { Story } from '@storybook/react';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import InputMask, { InputMaskWebProps } from './InputMask';
|
|
5
|
+
import { Masks } from '@tecsinapse/react-core/src';
|
|
6
|
+
import { CurrencyOptions } from '@tecsinapse/react-core/dist/components/atoms/Input';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Hybrid/InputMask',
|
|
10
|
+
component: InputMask,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const TemplateStringMask: Story<InputMaskWebProps> = args => {
|
|
14
|
+
const [value, setValue] = useState<string>();
|
|
15
|
+
|
|
16
|
+
const onChange = text => {
|
|
17
|
+
setValue(text);
|
|
18
|
+
if (args.onChange) {
|
|
19
|
+
args.onChange(text);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<InputMask
|
|
25
|
+
{...args}
|
|
26
|
+
label={args.label}
|
|
27
|
+
value={value}
|
|
28
|
+
onChange={onChange}
|
|
29
|
+
placeholder={args.placeholder}
|
|
30
|
+
mask={Masks.COMBINED_PHONE}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const StringMask = TemplateStringMask.bind({});
|
|
36
|
+
|
|
37
|
+
StringMask.args = {
|
|
38
|
+
onChange: value => action('onChange')(value),
|
|
39
|
+
placeholder: 'Type your phone',
|
|
40
|
+
disabled: false,
|
|
41
|
+
label: 'Phone',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const TemplateNumberMask: Story<InputMaskWebProps> = args => {
|
|
45
|
+
const [value, setValue] = useState<number>(1200.2);
|
|
46
|
+
|
|
47
|
+
const onChange = text => {
|
|
48
|
+
setValue(text);
|
|
49
|
+
if (args.onChange) {
|
|
50
|
+
args.onChange(text);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const numberMaskExample: CurrencyOptions = {
|
|
55
|
+
symbol: 'R$ ',
|
|
56
|
+
separator: '.',
|
|
57
|
+
decimal: ',',
|
|
58
|
+
precision: 2,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<InputMask
|
|
63
|
+
{...args}
|
|
64
|
+
label={args.label}
|
|
65
|
+
value={value}
|
|
66
|
+
onChange={onChange}
|
|
67
|
+
placeholder={args.placeholder}
|
|
68
|
+
mask={numberMaskExample}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const NumberMask = TemplateNumberMask.bind({});
|
|
74
|
+
|
|
75
|
+
NumberMask.args = {
|
|
76
|
+
onChange: value => action('onChange')(value),
|
|
77
|
+
placeholder: 'Type the price in R$',
|
|
78
|
+
disabled: false,
|
|
79
|
+
label: 'Price',
|
|
80
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Hint,
|
|
3
|
+
InputContainer,
|
|
4
|
+
InputContainerProps,
|
|
5
|
+
InputMaskElementProps,
|
|
6
|
+
useInputFocus,
|
|
7
|
+
} from '@tecsinapse/react-core';
|
|
8
|
+
import React, { FC } from 'react';
|
|
9
|
+
import { View } from 'react-native';
|
|
10
|
+
import { StyledWebTextInputMask } from './styled';
|
|
11
|
+
|
|
12
|
+
export interface InputMaskWebProps
|
|
13
|
+
extends Omit<InputMaskElementProps, 'style'>,
|
|
14
|
+
InputContainerProps {}
|
|
15
|
+
|
|
16
|
+
const InputMask: FC<InputMaskWebProps> = React.forwardRef(
|
|
17
|
+
(
|
|
18
|
+
{
|
|
19
|
+
label,
|
|
20
|
+
labelColor,
|
|
21
|
+
labelColorVariant,
|
|
22
|
+
labelColorTone,
|
|
23
|
+
labelTypography,
|
|
24
|
+
labelStack,
|
|
25
|
+
labelWeight,
|
|
26
|
+
leftComponent,
|
|
27
|
+
rightComponent,
|
|
28
|
+
disabled,
|
|
29
|
+
style,
|
|
30
|
+
borderColor,
|
|
31
|
+
borderColorGradation,
|
|
32
|
+
inputContainerStyle,
|
|
33
|
+
variant = 'default',
|
|
34
|
+
hintComponent,
|
|
35
|
+
hint,
|
|
36
|
+
onFocus,
|
|
37
|
+
onBlur,
|
|
38
|
+
...rest
|
|
39
|
+
},
|
|
40
|
+
ref
|
|
41
|
+
) => {
|
|
42
|
+
const _hint = hintComponent || <Hint text={hint} variant={variant} />;
|
|
43
|
+
const { focused, handleBlur, handleFocus } = useInputFocus(
|
|
44
|
+
onFocus,
|
|
45
|
+
onBlur,
|
|
46
|
+
!disabled
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<View style={style}>
|
|
51
|
+
<InputContainer
|
|
52
|
+
label={label}
|
|
53
|
+
labelColor={labelColor}
|
|
54
|
+
labelColorVariant={labelColorVariant}
|
|
55
|
+
labelColorTone={labelColorTone}
|
|
56
|
+
labelTypography={labelTypography}
|
|
57
|
+
labelStack={labelStack}
|
|
58
|
+
labelWeight={labelWeight}
|
|
59
|
+
leftComponent={leftComponent}
|
|
60
|
+
rightComponent={rightComponent}
|
|
61
|
+
borderColor={borderColor}
|
|
62
|
+
borderColorGradation={borderColorGradation}
|
|
63
|
+
inputContainerStyle={inputContainerStyle}
|
|
64
|
+
focused={focused}
|
|
65
|
+
disabled={disabled}
|
|
66
|
+
variant={variant}
|
|
67
|
+
>
|
|
68
|
+
<StyledWebTextInputMask
|
|
69
|
+
{...rest}
|
|
70
|
+
ref={ref}
|
|
71
|
+
disabled={disabled}
|
|
72
|
+
onFocus={handleFocus}
|
|
73
|
+
onBlur={handleBlur}
|
|
74
|
+
/>
|
|
75
|
+
</InputContainer>
|
|
76
|
+
{hint && _hint}
|
|
77
|
+
</View>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
InputMask.displayName = 'InputMask';
|
|
83
|
+
|
|
84
|
+
export default InputMask;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as InputMask, InputMaskWebProps } from './InputMask';
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Story } from '@storybook/react';
|
|
3
3
|
import Skeleton from './Skeleton';
|
|
4
4
|
import { SkeletonProps } from './Skeleton';
|
|
5
|
+
import { Text, Card } from '@tecsinapse/react-web-kit';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: 'Web/Skeleton',
|
|
@@ -13,3 +14,25 @@ const Template: Story<SkeletonProps> = args => <Skeleton {...args} />;
|
|
|
13
14
|
export const Base = Template.bind({});
|
|
14
15
|
|
|
15
16
|
Base.args = { width: 100, height: 50 };
|
|
17
|
+
|
|
18
|
+
const ChildrenTemplate: Story<SkeletonProps> = args => {
|
|
19
|
+
return (
|
|
20
|
+
<Skeleton {...args}>
|
|
21
|
+
<Card
|
|
22
|
+
elevated
|
|
23
|
+
style={{
|
|
24
|
+
height: '100px',
|
|
25
|
+
width: '200px',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
<Text>Skeleton card!</Text>
|
|
31
|
+
</Card>
|
|
32
|
+
</Skeleton>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Children = ChildrenTemplate.bind({});
|
|
37
|
+
|
|
38
|
+
Children.args = { animation: 'pulse' };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Wrapper } from './styled';
|
|
3
3
|
import { BorderRadiusType } from '@tecsinapse/react-core';
|
|
4
|
+
import { View } from 'react-native';
|
|
4
5
|
|
|
5
6
|
export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
7
|
width?: number;
|
|
7
8
|
height?: number;
|
|
8
9
|
animation?: 'pulse' | 'wave';
|
|
10
|
+
active?: boolean;
|
|
9
11
|
radius?: BorderRadiusType;
|
|
10
12
|
}
|
|
11
13
|
|
|
@@ -14,6 +16,7 @@ const Skeleton: React.FC<SkeletonProps> = ({
|
|
|
14
16
|
width,
|
|
15
17
|
height,
|
|
16
18
|
animation = 'wave',
|
|
19
|
+
active = true,
|
|
17
20
|
radius,
|
|
18
21
|
...rest
|
|
19
22
|
}) => {
|
|
@@ -28,10 +31,16 @@ const Skeleton: React.FC<SkeletonProps> = ({
|
|
|
28
31
|
width={width}
|
|
29
32
|
height={height}
|
|
30
33
|
animation={animation}
|
|
34
|
+
active={active}
|
|
31
35
|
radius={radius}
|
|
32
36
|
{...rest}
|
|
33
37
|
>
|
|
34
|
-
|
|
38
|
+
<View
|
|
39
|
+
style={{ opacity: active ? 0 : 1 }}
|
|
40
|
+
pointerEvents={active ? 'none' : 'auto'}
|
|
41
|
+
>
|
|
42
|
+
{children}
|
|
43
|
+
</View>
|
|
35
44
|
</Wrapper>
|
|
36
45
|
);
|
|
37
46
|
};
|
|
@@ -8,7 +8,7 @@ const pulseKf = keyframes`
|
|
|
8
8
|
opacity: 1;
|
|
9
9
|
}
|
|
10
10
|
50% {
|
|
11
|
-
opacity: 0.
|
|
11
|
+
opacity: 0.1;
|
|
12
12
|
}
|
|
13
13
|
100% {
|
|
14
14
|
opacity: 1;
|
|
@@ -56,13 +56,17 @@ export const Wrapper = styled('div')<Partial<StyleProps & SkeletonProps>>`
|
|
|
56
56
|
background-color: ${({
|
|
57
57
|
theme,
|
|
58
58
|
animation,
|
|
59
|
+
active,
|
|
59
60
|
}: StyleProps & Partial<SkeletonProps>) =>
|
|
60
|
-
|
|
61
|
+
!active
|
|
62
|
+
? undefined
|
|
63
|
+
: animation === 'pulse'
|
|
61
64
|
? theme.miscellaneous.bodyColor
|
|
62
65
|
: theme.miscellaneous.surfaceColor};
|
|
63
66
|
width: ${({ width }) => `${width}px` ?? '100%'};
|
|
64
67
|
height: ${({ height }) => `${height}px` ?? 'auto'};
|
|
65
68
|
border-radius: ${({ theme, radius }: StyleProps & Partial<SkeletonProps>) =>
|
|
66
69
|
radius ? theme.borderRadius[radius] : 'unset'};
|
|
67
|
-
${({ animation }) =>
|
|
70
|
+
${({ animation, active }) =>
|
|
71
|
+
!active ? undefined : animation === 'pulse' ? pulseAnim : waveAnim};
|
|
68
72
|
`;
|
package/src/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ export {
|
|
|
14
14
|
InputPassword,
|
|
15
15
|
InputPasswordWebProps,
|
|
16
16
|
} from './components/molecules/InputPassword';
|
|
17
|
+
export { InputMask, InputMaskWebProps } from './components/atoms/InputMask';
|
|
17
18
|
export {
|
|
18
19
|
Menubar,
|
|
19
20
|
MenubarProps,
|
|
@@ -40,5 +41,11 @@ export { Modal, ModalProps } from './components/atoms/Modal';
|
|
|
40
41
|
export { TextArea, TextAreaProps } from './components/molecules/TextArea';
|
|
41
42
|
export { Tooltip, ITooltip } from './components/atoms/Tooltip';
|
|
42
43
|
export * from './hooks';
|
|
43
|
-
export {
|
|
44
|
-
|
|
44
|
+
export {
|
|
45
|
+
DatePicker,
|
|
46
|
+
WebDatePickerProps,
|
|
47
|
+
} from './components/molecules/DatePicker';
|
|
48
|
+
export {
|
|
49
|
+
DateTimePicker,
|
|
50
|
+
WebDateTimePickerProps,
|
|
51
|
+
} from './components/molecules/DateTimePicker';
|