@tecsinapse/react-native-kit 1.18.6 → 1.19.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 +20 -0
- package/dist/components/atoms/Button/Button.d.ts +2 -2
- package/dist/components/atoms/Button/Button.js.map +1 -1
- package/dist/components/molecules/Grid/Grid.d.ts +5 -0
- package/dist/components/molecules/Grid/Grid.js +57 -0
- package/dist/components/molecules/Grid/Grid.js.map +1 -0
- package/dist/components/molecules/Grid/Item/Item.d.ts +7 -0
- package/dist/components/molecules/Grid/Item/Item.js +78 -0
- package/dist/components/molecules/Grid/Item/Item.js.map +1 -0
- package/dist/components/molecules/Grid/Item/index.d.ts +1 -0
- package/dist/components/molecules/Grid/Item/index.js +14 -0
- package/dist/components/molecules/Grid/Item/index.js.map +1 -0
- package/dist/components/molecules/Grid/index.d.ts +2 -0
- package/dist/components/molecules/Grid/index.js +15 -0
- package/dist/components/molecules/Grid/index.js.map +1 -0
- package/dist/components/molecules/IconTextButton/IconTextButton.d.ts +6 -0
- package/dist/components/molecules/IconTextButton/IconTextButton.js +50 -0
- package/dist/components/molecules/IconTextButton/IconTextButton.js.map +1 -0
- package/dist/components/molecules/IconTextButton/TextComponent.d.ts +12 -0
- package/dist/components/molecules/IconTextButton/TextComponent.js +34 -0
- package/dist/components/molecules/IconTextButton/TextComponent.js.map +1 -0
- package/dist/components/molecules/IconTextButton/index.d.ts +1 -0
- package/dist/components/molecules/IconTextButton/index.js +14 -0
- package/dist/components/molecules/IconTextButton/index.js.map +1 -0
- package/dist/components/molecules/IconTextButton/styled.d.ts +2 -0
- package/dist/components/molecules/IconTextButton/styled.js +46 -0
- package/dist/components/molecules/IconTextButton/styled.js.map +1 -0
- package/dist/components/molecules/LabeledSwitch/LabelComponent.d.ts +13 -0
- package/dist/components/molecules/LabeledSwitch/LabelComponent.js +36 -0
- package/dist/components/molecules/LabeledSwitch/LabelComponent.js.map +1 -0
- package/dist/components/molecules/LabeledSwitch/LabeledSwitch.d.ts +8 -0
- package/dist/components/molecules/LabeledSwitch/LabeledSwitch.js +53 -0
- package/dist/components/molecules/LabeledSwitch/LabeledSwitch.js.map +1 -0
- package/dist/components/molecules/LabeledSwitch/index.d.ts +1 -0
- package/dist/components/molecules/LabeledSwitch/index.js +14 -0
- package/dist/components/molecules/LabeledSwitch/index.js.map +1 -0
- package/dist/components/molecules/LabeledSwitch/styled.d.ts +9 -0
- package/dist/components/molecules/LabeledSwitch/styled.js +35 -0
- package/dist/components/molecules/LabeledSwitch/styled.js.map +1 -0
- package/dist/components/molecules/Select/Select.js +1 -1
- package/dist/components/molecules/Select/Select.js.map +1 -1
- package/dist/index.d.ts +17 -14
- package/dist/index.js +112 -91
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/atoms/Button/Button.tsx +19 -13
- package/src/components/molecules/Grid/Grid.tsx +68 -0
- package/src/components/molecules/Grid/Item/Item.tsx +77 -0
- package/src/components/molecules/Grid/Item/index.ts +1 -0
- package/src/components/molecules/Grid/index.ts +2 -0
- package/src/components/molecules/IconTextButton/IconTextButton.tsx +55 -0
- package/src/components/molecules/IconTextButton/TextComponent.tsx +43 -0
- package/src/components/molecules/IconTextButton/index.ts +4 -0
- package/src/components/molecules/IconTextButton/styled.ts +35 -0
- package/src/components/molecules/LabeledSwitch/LabelComponent.tsx +46 -0
- package/src/components/molecules/LabeledSwitch/LabeledSwitch.tsx +59 -0
- package/src/components/molecules/LabeledSwitch/index.ts +4 -0
- package/src/components/molecules/LabeledSwitch/styled.ts +27 -0
- package/src/components/molecules/Select/Select.tsx +1 -1
- package/src/index.ts +38 -29
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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.19.0](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-native-kit@1.18.6...@tecsinapse/react-native-kit@1.19.0) (2022-08-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* add key to native grid children clone ([2f7d8db](https://github.com/tecsinapse/design-system/commit/2f7d8db616d79b7b48ed6192c909b53df13c759f))
|
|
12
|
+
* change PressableSurface with Pressable on LabeledSwitch label ([5029a74](https://github.com/tecsinapse/design-system/commit/5029a74bfc272f5aecb3bdae9152f0920a36c8bb))
|
|
13
|
+
* LabeledSwitch disabled and react-core exports ([855f12f](https://github.com/tecsinapse/design-system/commit/855f12f0dff1ce4c5969eba723707340e60a3310))
|
|
14
|
+
* native grid extends view props ([525d923](https://github.com/tecsinapse/design-system/commit/525d923137388996fa67b17b019abb6ad77ccf95))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* grid web responsive support ([fd91539](https://github.com/tecsinapse/design-system/commit/fd91539dae6df151beeb48ce3749623e2bb4dedc))
|
|
20
|
+
* LabeledSwitch implementation. ([519fe87](https://github.com/tecsinapse/design-system/commit/519fe8769d687f15af09c9fb77fe98a727f9078b))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [1.18.6](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-native-kit@1.18.5...@tecsinapse/react-native-kit@1.18.6) (2022-08-19)
|
|
7
27
|
|
|
8
28
|
**Note:** Version bump only for package @tecsinapse/react-native-kit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Button/Button.tsx"],"names":["Button","autoDismissKeyboard","onPress","others","handleOnPress","event","Keyboard","dismiss"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;;;;;AAMO,MAAMA,MAA6B,GAAG,CAAC;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Button/Button.tsx"],"names":["Button","autoDismissKeyboard","onPress","others","handleOnPress","event","Keyboard","dismiss"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;;;;;AAMO,MAAMA,MAA6B,GAAG,CAAC;AAC5CC,EAAAA,mBAAmB,GAAG,IADsB;AAE5CC,EAAAA,OAF4C;AAG5C,KAAGC;AAHyC,CAAD,KAIvC;AACJ,QAAMC,aAAa,GAAG,wBACpBC,KAAK,IAAI;AACPJ,IAAAA,mBAAmB,IAAIK,sBAASC,OAAT,EAAvB;AACAL,IAAAA,OAAO,QAAP,YAAAA,OAAO,CAAGG,KAAH,CAAP;AACD,GAJmB,EAKpB,CAACH,OAAD,CALoB,CAAtB;AAQA,SAAO,6BAAC,iBAAD,eAAgBC,MAAhB;AAAwB,IAAA,OAAO,EAAEC;AAAjC,KAAP;AACD,CAdM","sourcesContent":["import { Button as ButtonCore, ButtonProps } from '@tecsinapse/react-core';\nimport React, { FC, useCallback } from 'react';\nimport { Keyboard } from 'react-native';\n\nexport type ButtonNativeProps = ButtonProps & {\n autoDismissKeyboard?: boolean;\n};\n\nexport const Button: FC<ButtonNativeProps> = ({\n autoDismissKeyboard = true,\n onPress,\n ...others\n}) => {\n const handleOnPress = useCallback(\n event => {\n autoDismissKeyboard && Keyboard.dismiss();\n onPress?.(event);\n },\n [onPress]\n );\n\n return <ButtonCore {...others} onPress={handleOnPress} />;\n};\n"],"file":"Button.js"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ViewProps } from 'react-native';
|
|
2
|
+
import { IGrid } from '@tecsinapse/react-core';
|
|
3
|
+
export declare type IGridNative = IGrid & ViewProps;
|
|
4
|
+
declare const Grid: ({ children, columns, layout, style, spacing, ...rest }: IGridNative) => JSX.Element;
|
|
5
|
+
export default Grid;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
var _Item = require("./Item");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
const Grid = ({
|
|
17
|
+
children,
|
|
18
|
+
columns = 12,
|
|
19
|
+
layout,
|
|
20
|
+
style,
|
|
21
|
+
spacing,
|
|
22
|
+
...rest
|
|
23
|
+
}) => {
|
|
24
|
+
if (layout) {
|
|
25
|
+
const flatLayout = layout.flat();
|
|
26
|
+
return _react.default.createElement(_reactNative.View, _extends({
|
|
27
|
+
style: [style, {
|
|
28
|
+
display: 'flex',
|
|
29
|
+
flexDirection: 'row',
|
|
30
|
+
flexWrap: 'wrap'
|
|
31
|
+
}]
|
|
32
|
+
}, rest), _react.default.Children.map(children, (child, index) => _react.default.createElement(_Item.GridItem, {
|
|
33
|
+
key: `child-${index}`,
|
|
34
|
+
columns: columns,
|
|
35
|
+
span: flatLayout[index],
|
|
36
|
+
spacing: spacing
|
|
37
|
+
}, child)));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return _react.default.createElement(_reactNative.View, _extends({
|
|
41
|
+
style: [style, {
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flexDirection: 'row',
|
|
44
|
+
flexWrap: 'wrap'
|
|
45
|
+
}]
|
|
46
|
+
}, rest), _react.default.Children.map(children, (child, index) => {
|
|
47
|
+
return _react.default.cloneElement(child, { ...(child == null ? void 0 : child.props),
|
|
48
|
+
columns,
|
|
49
|
+
spacing: (child == null ? void 0 : child.props.spacing) ?? spacing,
|
|
50
|
+
key: `child-${index}`
|
|
51
|
+
});
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var _default = Grid;
|
|
56
|
+
exports.default = _default;
|
|
57
|
+
//# sourceMappingURL=Grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/Grid/Grid.tsx"],"names":["Grid","children","columns","layout","style","spacing","rest","flatLayout","flat","display","flexDirection","flexWrap","React","Children","map","child","index","cloneElement","props","key"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;;;AAKA,MAAMA,IAAI,GAAG,CAAC;AACZC,EAAAA,QADY;AAEZC,EAAAA,OAAO,GAAG,EAFE;AAGZC,EAAAA,MAHY;AAIZC,EAAAA,KAJY;AAKZC,EAAAA,OALY;AAMZ,KAAGC;AANS,CAAD,KAOmB;AAC9B,MAAIH,MAAJ,EAAY;AACV,UAAMI,UAAU,GAAGJ,MAAM,CAACK,IAAP,EAAnB;AACA,WACE,6BAAC,iBAAD;AACE,MAAA,KAAK,EAAE,CACLJ,KADK,EAEL;AACEK,QAAAA,OAAO,EAAE,MADX;AAEEC,QAAAA,aAAa,EAAE,KAFjB;AAGEC,QAAAA,QAAQ,EAAE;AAHZ,OAFK;AADT,OASML,IATN,GAWGM,eAAMC,QAAN,CAAeC,GAAf,CAAmBb,QAAnB,EAA6B,CAACc,KAAD,EAAQC,KAAR,KAC5B,6BAAC,cAAD;AACE,MAAA,GAAG,EAAG,SAAQA,KAAM,EADtB;AAEE,MAAA,OAAO,EAAEd,OAFX;AAGE,MAAA,IAAI,EAAEK,UAAU,CAACS,KAAD,CAHlB;AAIE,MAAA,OAAO,EAAEX;AAJX,OAMGU,KANH,CADD,CAXH,CADF;AAwBD;;AAED,SACE,6BAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CACLX,KADK,EAEL;AACEK,MAAAA,OAAO,EAAE,MADX;AAEEC,MAAAA,aAAa,EAAE,KAFjB;AAGEC,MAAAA,QAAQ,EAAE;AAHZ,KAFK;AADT,KASML,IATN,GAWGM,eAAMC,QAAN,CAAeC,GAAf,CAAmBb,QAAnB,EAA6B,CAACc,KAAD,EAAQC,KAAR,KAAkB;AAC9C,WAAOJ,eAAMK,YAAN,CAAmBF,KAAnB,EAA0B,EAC/B,IAAGA,KAAH,oBAAGA,KAAK,CAAEG,KAAV,CAD+B;AAE/BhB,MAAAA,OAF+B;AAG/BG,MAAAA,OAAO,EAAE,CAAAU,KAAK,QAAL,YAAAA,KAAK,CAAEG,KAAP,CAAab,OAAb,KAAwBA,OAHF;AAI/Bc,MAAAA,GAAG,EAAG,SAAQH,KAAM;AAJW,KAA1B,CAAP;AAMD,GAPA,CAXH,CADF;AAsBD,CA1DD;;eA4DehB,I","sourcesContent":["import React from 'react';\nimport { View, ViewProps } from 'react-native';\nimport { GridItem } from './Item';\nimport { IGrid } from '@tecsinapse/react-core';\n\nexport type IGridNative = IGrid & ViewProps;\n\nconst Grid = ({\n children,\n columns = 12,\n layout,\n style,\n spacing,\n ...rest\n}: IGridNative): JSX.Element => {\n if (layout) {\n const flatLayout = layout.flat();\n return (\n <View\n style={[\n style,\n {\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n ]}\n {...rest}\n >\n {React.Children.map(children, (child, index) => (\n <GridItem\n key={`child-${index}`}\n columns={columns}\n span={flatLayout[index]}\n spacing={spacing}\n >\n {child}\n </GridItem>\n ))}\n </View>\n );\n }\n\n return (\n <View\n style={[\n style,\n {\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n ]}\n {...rest}\n >\n {React.Children.map(children, (child, index) => {\n return React.cloneElement(child, {\n ...child?.props,\n columns,\n spacing: child?.props.spacing ?? spacing,\n key: `child-${index}`,\n });\n })}\n </View>\n );\n};\n\nexport default Grid;\n"],"file":"Grid.js"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ViewProps } from 'react-native';
|
|
2
|
+
import { IGridItem } from '@tecsinapse/react-core';
|
|
3
|
+
export declare type IGridItemNative = IGridItem & ViewProps & {
|
|
4
|
+
flexBasis?: string | 'auto';
|
|
5
|
+
};
|
|
6
|
+
declare const GridItem: ({ children, span, columns, loadingComponent, loading, spacing: _spacing, wrapper, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, justifyContent, flexBasis, style, ...rest }: IGridItemNative) => JSX.Element;
|
|
7
|
+
export default GridItem;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
var _reactCore = require("@tecsinapse/react-core");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
const GridItem = ({
|
|
17
|
+
children,
|
|
18
|
+
span,
|
|
19
|
+
columns = 12,
|
|
20
|
+
loadingComponent,
|
|
21
|
+
loading = false,
|
|
22
|
+
spacing: _spacing,
|
|
23
|
+
wrapper = false,
|
|
24
|
+
alignContent,
|
|
25
|
+
alignItems,
|
|
26
|
+
alignSelf,
|
|
27
|
+
flex,
|
|
28
|
+
flexDirection,
|
|
29
|
+
flexGrow,
|
|
30
|
+
flexShrink,
|
|
31
|
+
justifyContent,
|
|
32
|
+
flexBasis,
|
|
33
|
+
style,
|
|
34
|
+
...rest
|
|
35
|
+
}) => {
|
|
36
|
+
const {
|
|
37
|
+
spacing
|
|
38
|
+
} = (0, _reactCore.useTheme)();
|
|
39
|
+
|
|
40
|
+
if (!_react.default.Children.only(children)) {
|
|
41
|
+
throw new Error('The number of children in GridItem should be one');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (loadingComponent && loading) {
|
|
45
|
+
return loadingComponent;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const _style = {
|
|
49
|
+
alignContent,
|
|
50
|
+
alignItems,
|
|
51
|
+
alignSelf,
|
|
52
|
+
flex,
|
|
53
|
+
flexDirection,
|
|
54
|
+
flexGrow,
|
|
55
|
+
flexShrink,
|
|
56
|
+
justifyContent,
|
|
57
|
+
boxSizing: 'border-box',
|
|
58
|
+
flexBasis: flexBasis ?? `${(0, _reactCore.getGridItemColumSpan)(columns, span)}%`,
|
|
59
|
+
paddingTop: (0, _reactCore.getGridItemPadding)('top', _spacing, spacing),
|
|
60
|
+
paddingBottom: (0, _reactCore.getGridItemPadding)('bottom', _spacing, spacing),
|
|
61
|
+
paddingRight: (0, _reactCore.getGridItemPadding)('right', _spacing, spacing),
|
|
62
|
+
paddingLeft: (0, _reactCore.getGridItemPadding)('left', _spacing, spacing)
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const clone = _react.default.cloneElement(children, { ...(children == null ? void 0 : children.props),
|
|
66
|
+
style: wrapper ? children == null ? void 0 : children.props.style : { ..._style,
|
|
67
|
+
...(children == null ? void 0 : children.props.style)
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return wrapper ? _react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
72
|
+
style: [style, _style]
|
|
73
|
+
}), clone) : clone;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
var _default = GridItem;
|
|
77
|
+
exports.default = _default;
|
|
78
|
+
//# sourceMappingURL=Item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/molecules/Grid/Item/Item.tsx"],"names":["GridItem","children","span","columns","loadingComponent","loading","spacing","_spacing","wrapper","alignContent","alignItems","alignSelf","flex","flexDirection","flexGrow","flexShrink","justifyContent","flexBasis","style","rest","React","Children","only","Error","_style","boxSizing","paddingTop","paddingBottom","paddingRight","paddingLeft","clone","cloneElement","props"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;;;AAaA,MAAMA,QAAQ,GAAG,CAAC;AAChBC,EAAAA,QADgB;AAEhBC,EAAAA,IAFgB;AAGhBC,EAAAA,OAAO,GAAG,EAHM;AAIhBC,EAAAA,gBAJgB;AAKhBC,EAAAA,OAAO,GAAG,KALM;AAMhBC,EAAAA,OAAO,EAAEC,QANO;AAOhBC,EAAAA,OAAO,GAAG,KAPM;AAQhBC,EAAAA,YARgB;AAShBC,EAAAA,UATgB;AAUhBC,EAAAA,SAVgB;AAWhBC,EAAAA,IAXgB;AAYhBC,EAAAA,aAZgB;AAahBC,EAAAA,QAbgB;AAchBC,EAAAA,UAdgB;AAehBC,EAAAA,cAfgB;AAgBhBC,EAAAA,SAhBgB;AAiBhBC,EAAAA,KAjBgB;AAkBhB,KAAGC;AAlBa,CAAD,KAmBmB;AAClC,QAAM;AAAEb,IAAAA;AAAF,MAAc,0BAApB;;AACA,MAAI,CAACc,eAAMC,QAAN,CAAeC,IAAf,CAAoBrB,QAApB,CAAL,EAAoC;AAClC,UAAM,IAAIsB,KAAJ,CAAU,kDAAV,CAAN;AACD;;AACD,MAAInB,gBAAgB,IAAIC,OAAxB,EAAiC;AAC/B,WAAOD,gBAAP;AACD;;AAED,QAAMoB,MAAM,GAAG;AACbf,IAAAA,YADa;AAEbC,IAAAA,UAFa;AAGbC,IAAAA,SAHa;AAIbC,IAAAA,IAJa;AAKbC,IAAAA,aALa;AAMbC,IAAAA,QANa;AAObC,IAAAA,UAPa;AAQbC,IAAAA,cARa;AASbS,IAAAA,SAAS,EAAE,YATE;AAUbR,IAAAA,SAAS,EAAEA,SAAS,IAAK,GAAE,qCAAqBd,OAArB,EAA8BD,IAA9B,CAAoC,GAVlD;AAWbwB,IAAAA,UAAU,EAAE,mCAAmB,KAAnB,EAA0BnB,QAA1B,EAAoCD,OAApC,CAXC;AAYbqB,IAAAA,aAAa,EAAE,mCAAmB,QAAnB,EAA6BpB,QAA7B,EAAuCD,OAAvC,CAZF;AAabsB,IAAAA,YAAY,EAAE,mCAAmB,OAAnB,EAA4BrB,QAA5B,EAAsCD,OAAtC,CAbD;AAcbuB,IAAAA,WAAW,EAAE,mCAAmB,MAAnB,EAA2BtB,QAA3B,EAAqCD,OAArC;AAdA,GAAf;;AAiBA,QAAMwB,KAAK,GAAGV,eAAMW,YAAN,CAAmB9B,QAAnB,EAA6B,EACzC,IAAGA,QAAH,oBAAGA,QAAQ,CAAE+B,KAAb,CADyC;AAEzCd,IAAAA,KAAK,EAAEV,OAAO,GACVP,QADU,oBACVA,QAAQ,CAAE+B,KAAV,CAAgBd,KADN,GAEV,EAAE,GAAGM,MAAL;AAAa,UAAGvB,QAAH,oBAAGA,QAAQ,CAAE+B,KAAV,CAAgBd,KAAnB;AAAb;AAJqC,GAA7B,CAAd;;AAOA,SAAOV,OAAO,GACZ,6BAAC,iBAAD,eAAUW,IAAV;AAAgB,IAAA,KAAK,EAAE,CAACD,KAAD,EAAQM,MAAR;AAAvB,MACGM,KADH,CADY,GAKZA,KALF;AAOD,CA3DD;;eA6De9B,Q","sourcesContent":["import React from 'react';\nimport { View, ViewProps } from 'react-native';\nimport {\n IGridItem,\n useTheme,\n getGridItemColumSpan,\n getGridItemPadding,\n} from '@tecsinapse/react-core';\n\nexport type IGridItemNative = IGridItem &\n ViewProps & {\n /** Only specify this property if the GridItem will be 'dynamic', adjusting itself to content. Use this with `wrapper` for better result. */\n flexBasis?: string | 'auto';\n };\n\nconst GridItem = ({\n children,\n span,\n columns = 12,\n loadingComponent,\n loading = false,\n spacing: _spacing,\n wrapper = false,\n alignContent,\n alignItems,\n alignSelf,\n flex,\n flexDirection,\n flexGrow,\n flexShrink,\n justifyContent,\n flexBasis,\n style,\n ...rest\n}: IGridItemNative): JSX.Element => {\n const { spacing } = useTheme();\n if (!React.Children.only(children)) {\n throw new Error('The number of children in GridItem should be one');\n }\n if (loadingComponent && loading) {\n return loadingComponent;\n }\n\n const _style = {\n alignContent,\n alignItems,\n alignSelf,\n flex,\n flexDirection,\n flexGrow,\n flexShrink,\n justifyContent,\n boxSizing: 'border-box',\n flexBasis: flexBasis ?? `${getGridItemColumSpan(columns, span)}%`,\n paddingTop: getGridItemPadding('top', _spacing, spacing),\n paddingBottom: getGridItemPadding('bottom', _spacing, spacing),\n paddingRight: getGridItemPadding('right', _spacing, spacing),\n paddingLeft: getGridItemPadding('left', _spacing, spacing),\n };\n\n const clone = React.cloneElement(children, {\n ...children?.props,\n style: wrapper\n ? children?.props.style\n : { ..._style, ...children?.props.style },\n });\n\n return wrapper ? (\n <View {...rest} style={[style, _style]}>\n {clone}\n </View>\n ) : (\n clone\n );\n};\n\nexport default GridItem;\n"],"file":"Item.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as GridItem, IGridItemNative } from './Item';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.IGridItemNative = exports.GridItem = void 0;
|
|
5
|
+
|
|
6
|
+
var _Item = _interopRequireWildcard(require("./Item"));
|
|
7
|
+
|
|
8
|
+
exports.GridItem = _Item.default;
|
|
9
|
+
exports.IGridItemNative = _Item.IGridItemNative;
|
|
10
|
+
|
|
11
|
+
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); }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/molecules/Grid/Item/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as GridItem, IGridItemNative } from './Item';\n"],"file":"index.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.Grid = exports.GridItem = void 0;
|
|
5
|
+
|
|
6
|
+
var _Item = require("./Item");
|
|
7
|
+
|
|
8
|
+
exports.GridItem = _Item.GridItem;
|
|
9
|
+
|
|
10
|
+
var _Grid = _interopRequireDefault(require("./Grid"));
|
|
11
|
+
|
|
12
|
+
exports.Grid = _Grid.default;
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/Grid/index.ts"],"names":[],"mappings":";;;;;AAAA;;;;AACA","sourcesContent":["export { GridItem } from './Item';\nexport { default as Grid } from './Grid';\n"],"file":"index.js"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IconTextButtonProps } from '@tecsinapse/react-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ButtonNativeProps } from '../../atoms/Button';
|
|
4
|
+
export declare type NativeIconTextButtonProps = IconTextButtonProps & Omit<ButtonNativeProps, 'ButtonProps'>;
|
|
5
|
+
declare const IconTextButton: React.FC<NativeIconTextButtonProps>;
|
|
6
|
+
export default IconTextButton;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _reactCore = require("@tecsinapse/react-core");
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _styled = require("./styled");
|
|
11
|
+
|
|
12
|
+
var _TextComponent = _interopRequireDefault(require("./TextComponent"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
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); }
|
|
17
|
+
|
|
18
|
+
const IconTextButton = ({
|
|
19
|
+
iconProps,
|
|
20
|
+
iconPosition = 'left',
|
|
21
|
+
textProps,
|
|
22
|
+
label,
|
|
23
|
+
variant = 'filled',
|
|
24
|
+
size = 'default',
|
|
25
|
+
...rest
|
|
26
|
+
}) => {
|
|
27
|
+
return _react.default.createElement(_styled.StyledIconTextButton, _extends({
|
|
28
|
+
boxed: !label,
|
|
29
|
+
variant: variant
|
|
30
|
+
}, rest), iconPosition === 'left' ? _react.default.createElement(_reactCore.IconComponent, {
|
|
31
|
+
iconProps: iconProps,
|
|
32
|
+
size: size,
|
|
33
|
+
defaultFontColor: _reactCore.fontColorVC[variant]
|
|
34
|
+
}) : _react.default.createElement(_react.default.Fragment, null), _react.default.createElement(_TextComponent.default, {
|
|
35
|
+
label: label,
|
|
36
|
+
defaultFontColor: _reactCore.fontColorVC[variant],
|
|
37
|
+
hasIcon: !!iconProps,
|
|
38
|
+
iconPosition: iconPosition,
|
|
39
|
+
textProps: textProps,
|
|
40
|
+
size: size
|
|
41
|
+
}), iconPosition === 'right' ? _react.default.createElement(_reactCore.IconComponent, {
|
|
42
|
+
iconProps: iconProps,
|
|
43
|
+
size: size,
|
|
44
|
+
defaultFontColor: _reactCore.fontColorVC[variant]
|
|
45
|
+
}) : _react.default.createElement(_react.default.Fragment, null));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var _default = IconTextButton;
|
|
49
|
+
exports.default = _default;
|
|
50
|
+
//# sourceMappingURL=IconTextButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/IconTextButton/IconTextButton.tsx"],"names":["IconTextButton","iconProps","iconPosition","textProps","label","variant","size","rest","fontColorVC"],"mappings":";;;;;AAAA;;AAKA;;AAEA;;AACA;;;;;;AAKA,MAAMA,cAAmD,GAAG,CAAC;AAC3DC,EAAAA,SAD2D;AAE3DC,EAAAA,YAAY,GAAG,MAF4C;AAG3DC,EAAAA,SAH2D;AAI3DC,EAAAA,KAJ2D;AAK3DC,EAAAA,OAAO,GAAG,QALiD;AAM3DC,EAAAA,IAAI,GAAG,SANoD;AAO3D,KAAGC;AAPwD,CAAD,KAQtD;AACJ,SACE,6BAAC,4BAAD;AAAsB,IAAA,KAAK,EAAE,CAACH,KAA9B;AAAqC,IAAA,OAAO,EAAEC;AAA9C,KAA2DE,IAA3D,GACGL,YAAY,KAAK,MAAjB,GACC,6BAAC,wBAAD;AACE,IAAA,SAAS,EAAED,SADb;AAEE,IAAA,IAAI,EAAEK,IAFR;AAGE,IAAA,gBAAgB,EAAEE,uBAAYH,OAAZ;AAHpB,IADD,GAOC,2DARJ,EAUE,6BAAC,sBAAD;AACE,IAAA,KAAK,EAAED,KADT;AAEE,IAAA,gBAAgB,EAAEI,uBAAYH,OAAZ,CAFpB;AAGE,IAAA,OAAO,EAAE,CAAC,CAACJ,SAHb;AAIE,IAAA,YAAY,EAAEC,YAJhB;AAKE,IAAA,SAAS,EAAEC,SALb;AAME,IAAA,IAAI,EAAEG;AANR,IAVF,EAkBGJ,YAAY,KAAK,OAAjB,GACC,6BAAC,wBAAD;AACE,IAAA,SAAS,EAAED,SADb;AAEE,IAAA,IAAI,EAAEK,IAFR;AAGE,IAAA,gBAAgB,EAAEE,uBAAYH,OAAZ;AAHpB,IADD,GAOC,2DAzBJ,CADF;AA8BD,CAvCD;;eAyCeL,c","sourcesContent":["import {\n fontColorVC,\n IconComponent,\n IconTextButtonProps,\n} from '@tecsinapse/react-core';\nimport React from 'react';\nimport { ButtonNativeProps } from '../../atoms/Button';\nimport { StyledIconTextButton } from './styled';\nimport TextComponent from './TextComponent';\n\nexport type NativeIconTextButtonProps = IconTextButtonProps &\n Omit<ButtonNativeProps, 'ButtonProps'>;\n\nconst IconTextButton: React.FC<NativeIconTextButtonProps> = ({\n iconProps,\n iconPosition = 'left',\n textProps,\n label,\n variant = 'filled',\n size = 'default',\n ...rest\n}) => {\n return (\n <StyledIconTextButton boxed={!label} variant={variant} {...rest}>\n {iconPosition === 'left' ? (\n <IconComponent\n iconProps={iconProps}\n size={size}\n defaultFontColor={fontColorVC[variant]}\n />\n ) : (\n <></>\n )}\n <TextComponent\n label={label}\n defaultFontColor={fontColorVC[variant]}\n hasIcon={!!iconProps}\n iconPosition={iconPosition}\n textProps={textProps}\n size={size}\n />\n {iconPosition === 'right' ? (\n <IconComponent\n iconProps={iconProps}\n size={size}\n defaultFontColor={fontColorVC[variant]}\n />\n ) : (\n <></>\n )}\n </StyledIconTextButton>\n );\n};\n\nexport default IconTextButton;\n"],"file":"IconTextButton.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ButtonSizeType, FontColor, IconPositionOptions, TextProps } from '@tecsinapse/react-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface TextComponentProps {
|
|
4
|
+
textProps?: TextProps;
|
|
5
|
+
size?: ButtonSizeType;
|
|
6
|
+
defaultFontColor: keyof FontColor;
|
|
7
|
+
label?: string;
|
|
8
|
+
iconPosition?: IconPositionOptions;
|
|
9
|
+
hasIcon?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: React.NamedExoticComponent<TextComponentProps>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _styled = require("./styled");
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
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); }
|
|
13
|
+
|
|
14
|
+
const TextComponent = ({
|
|
15
|
+
textProps,
|
|
16
|
+
size = 'default',
|
|
17
|
+
defaultFontColor,
|
|
18
|
+
label,
|
|
19
|
+
iconPosition = 'left',
|
|
20
|
+
hasIcon = false
|
|
21
|
+
}) => {
|
|
22
|
+
return label ? _react.default.createElement(_styled.StyledText, _extends({
|
|
23
|
+
typography: (textProps == null ? void 0 : textProps.typography) ?? size === 'small' ? 'sub' : 'base',
|
|
24
|
+
fontWeight: (textProps == null ? void 0 : textProps.fontWeight) ?? 'bold',
|
|
25
|
+
fontColor: (textProps == null ? void 0 : textProps.fontColor) ?? defaultFontColor,
|
|
26
|
+
iconPosition: iconPosition,
|
|
27
|
+
hasIcon: hasIcon
|
|
28
|
+
}, textProps), label) : _react.default.createElement(_react.default.Fragment, null);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var _default = _react.default.memo(TextComponent);
|
|
32
|
+
|
|
33
|
+
exports.default = _default;
|
|
34
|
+
//# sourceMappingURL=TextComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/IconTextButton/TextComponent.tsx"],"names":["TextComponent","textProps","size","defaultFontColor","label","iconPosition","hasIcon","typography","fontWeight","fontColor","React","memo"],"mappings":";;;;;AAMA;;AACA;;;;;;AAWA,MAAMA,aAAqC,GAAG,CAAC;AAC7CC,EAAAA,SAD6C;AAE7CC,EAAAA,IAAI,GAAG,SAFsC;AAG7CC,EAAAA,gBAH6C;AAI7CC,EAAAA,KAJ6C;AAK7CC,EAAAA,YAAY,GAAG,MAL8B;AAM7CC,EAAAA,OAAO,GAAG;AANmC,CAAD,KAOxC;AACJ,SAAOF,KAAK,GACV,6BAAC,kBAAD;AACE,IAAA,UAAU,EAAE,CAAAH,SAAS,QAAT,YAAAA,SAAS,CAAEM,UAAX,KAAyBL,IAAI,KAAK,OAAlC,GAA4C,KAA5C,GAAoD,MADlE;AAEE,IAAA,UAAU,EAAE,CAAAD,SAAS,QAAT,YAAAA,SAAS,CAAEO,UAAX,KAAyB,MAFvC;AAGE,IAAA,SAAS,EAAE,CAAAP,SAAS,QAAT,YAAAA,SAAS,CAAEQ,SAAX,KAAwBN,gBAHrC;AAIE,IAAA,YAAY,EAAEE,YAJhB;AAKE,IAAA,OAAO,EAAEC;AALX,KAMML,SANN,GAQGG,KARH,CADU,GAYV,2DAZF;AAcD,CAtBD;;eAwBeM,eAAMC,IAAN,CAAWX,aAAX,C","sourcesContent":["import {\n ButtonSizeType,\n FontColor,\n IconPositionOptions,\n TextProps,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { StyledText } from './styled';\n\ninterface TextComponentProps {\n textProps?: TextProps;\n size?: ButtonSizeType;\n defaultFontColor: keyof FontColor;\n label?: string;\n iconPosition?: IconPositionOptions;\n hasIcon?: boolean;\n}\n\nconst TextComponent: FC<TextComponentProps> = ({\n textProps,\n size = 'default',\n defaultFontColor,\n label,\n iconPosition = 'left',\n hasIcon = false,\n}) => {\n return label ? (\n <StyledText\n typography={textProps?.typography ?? size === 'small' ? 'sub' : 'base'}\n fontWeight={textProps?.fontWeight ?? 'bold'}\n fontColor={textProps?.fontColor ?? defaultFontColor}\n iconPosition={iconPosition}\n hasIcon={hasIcon}\n {...textProps}\n >\n {label}\n </StyledText>\n ) : (\n <></>\n );\n};\n\nexport default React.memo(TextComponent);\n"],"file":"TextComponent.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IconTextButton, NativeIconTextButtonProps, } from './IconTextButton';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.NativeIconTextButtonProps = exports.IconTextButton = void 0;
|
|
5
|
+
|
|
6
|
+
var _IconTextButton = _interopRequireWildcard(require("./IconTextButton"));
|
|
7
|
+
|
|
8
|
+
exports.IconTextButton = _IconTextButton.default;
|
|
9
|
+
exports.NativeIconTextButtonProps = _IconTextButton.NativeIconTextButtonProps;
|
|
10
|
+
|
|
11
|
+
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); }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/IconTextButton/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export {\n default as IconTextButton,\n NativeIconTextButtonProps,\n} from './IconTextButton';\n"],"file":"index.js"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.StyledText = exports.StyledIconTextButton = void 0;
|
|
5
|
+
|
|
6
|
+
var _native = _interopRequireWildcard(require("@emotion/native"));
|
|
7
|
+
|
|
8
|
+
var _Button = require("../../atoms/Button");
|
|
9
|
+
|
|
10
|
+
var _Text = require("../../atoms/Text");
|
|
11
|
+
|
|
12
|
+
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
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
const boxedStyle = ({
|
|
17
|
+
theme
|
|
18
|
+
}) => `
|
|
19
|
+
padding: ${theme == null ? void 0 : theme.spacing.centi};
|
|
20
|
+
aspect-ratio: 1;
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
const StyledIconTextButton = (0, _native.default)(_Button.Button)`
|
|
24
|
+
${({
|
|
25
|
+
boxed,
|
|
26
|
+
theme
|
|
27
|
+
}) => boxed && boxedStyle({
|
|
28
|
+
theme
|
|
29
|
+
})};
|
|
30
|
+
`;
|
|
31
|
+
exports.StyledIconTextButton = StyledIconTextButton;
|
|
32
|
+
const StyledText = (0, _native.default)(_Text.Text)`
|
|
33
|
+
${({
|
|
34
|
+
theme,
|
|
35
|
+
iconPosition,
|
|
36
|
+
hasIcon = false
|
|
37
|
+
}) => {
|
|
38
|
+
if (hasIcon && iconPosition === 'left') return (0, _native.css)`
|
|
39
|
+
margin-left: ${theme == null ? void 0 : theme.spacing.mili};
|
|
40
|
+
`;else if (hasIcon && iconPosition === 'right') return (0, _native.css)`
|
|
41
|
+
margin-right: ${theme == null ? void 0 : theme.spacing.mili};
|
|
42
|
+
`;
|
|
43
|
+
}}
|
|
44
|
+
`;
|
|
45
|
+
exports.StyledText = StyledText;
|
|
46
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/IconTextButton/styled.ts"],"names":["boxedStyle","theme","spacing","centi","StyledIconTextButton","Button","boxed","StyledText","Text","iconPosition","hasIcon","mili"],"mappings":";;;;;AAAA;;AAEA;;AACA;;;;;;AAEA,MAAMA,UAAU,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAqC;AACxD,eAAeA,KADwC,oBACxCA,KAAK,CAAEC,OAAP,CAAeC,KAAM;AACpC;AACA,GAHA;;AAKO,MAAMC,oBAAoB,GAAG,qBAAOC,cAAP,CAIlC;AACF,IAAI,CAAC;AAAEC,EAAAA,KAAF;AAASL,EAAAA;AAAT,CAAD,KAAsBK,KAAK,IAAIN,UAAU,CAAC;AAAEC,EAAAA;AAAF,CAAD,CAAY;AACzD,CANO;;AAQA,MAAMM,UAAU,GAAG,qBAAOC,UAAP,CAKxB;AACF,IAAI,CAAC;AAAEP,EAAAA,KAAF;AAASQ,EAAAA,YAAT;AAAuBC,EAAAA,OAAO,GAAG;AAAjC,CAAD,KAA8C;AAC9C,MAAIA,OAAO,IAAID,YAAY,KAAK,MAAhC,EACE,OAAO,gBAAI;AACjB,uBAAuBR,KADP,oBACOA,KAAK,CAAEC,OAAP,CAAeS,IAAK;AAC3C,OAFM,CADF,KAIK,IAAID,OAAO,IAAID,YAAY,KAAK,OAAhC,EACH,OAAO,gBAAI;AACjB,wBAAwBR,KADR,oBACQA,KAAK,CAAEC,OAAP,CAAeS,IAAK;AAC5C,OAFM;AAGH,CAAC;AACJ,CAhBO","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { IconPositionOptions, StyleProps } from '@tecsinapse/react-core';\nimport { Button } from '../../atoms/Button';\nimport { Text } from '../../atoms/Text';\n\nconst boxedStyle = ({ theme }: Partial<StyleProps>) => `\n padding: ${theme?.spacing.centi};\n aspect-ratio: 1;\n `;\n\nexport const StyledIconTextButton = styled(Button)<\n Partial<StyleProps> & {\n boxed: boolean;\n }\n>`\n ${({ boxed, theme }) => boxed && boxedStyle({ theme })};\n`;\n\nexport const StyledText = styled(Text)<\n Partial<StyleProps> & {\n iconPosition: IconPositionOptions;\n hasIcon?: boolean;\n }\n>`\n ${({ theme, iconPosition, hasIcon = false }) => {\n if (hasIcon && iconPosition === 'left')\n return css`\n margin-left: ${theme?.spacing.mili};\n `;\n else if (hasIcon && iconPosition === 'right')\n return css`\n margin-right: ${theme?.spacing.mili};\n `;\n }}\n`;\n"],"file":"styled.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LabelPositionOptions } from '@tecsinapse/react-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { PressableProps } from 'react-native';
|
|
4
|
+
import { TextNativeProps } from '../../atoms/Text';
|
|
5
|
+
export interface LabelComponentProps extends PressableProps {
|
|
6
|
+
label: string;
|
|
7
|
+
labelPosition: LabelPositionOptions;
|
|
8
|
+
labelProps?: TextNativeProps;
|
|
9
|
+
active: boolean;
|
|
10
|
+
switchDisabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: React.NamedExoticComponent<LabelComponentProps>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
var _styled = require("./styled");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
const LabelComponent = ({
|
|
17
|
+
label,
|
|
18
|
+
labelPosition,
|
|
19
|
+
labelProps,
|
|
20
|
+
active,
|
|
21
|
+
switchDisabled = false,
|
|
22
|
+
...rest
|
|
23
|
+
}) => {
|
|
24
|
+
const defaultFontColor = active && !switchDisabled ? 'dark' : 'medium';
|
|
25
|
+
const defaultFontWeight = active && !switchDisabled ? 'bold' : 'regular';
|
|
26
|
+
return _react.default.createElement(_reactNative.Pressable, rest, _react.default.createElement(_styled.StyledLabel, _extends({
|
|
27
|
+
labelPosition: labelPosition,
|
|
28
|
+
fontColor: (labelProps == null ? void 0 : labelProps.fontColor) ?? defaultFontColor,
|
|
29
|
+
fontWeight: (labelProps == null ? void 0 : labelProps.fontWeight) ?? defaultFontWeight
|
|
30
|
+
}, labelProps), label));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var _default = _react.default.memo(LabelComponent);
|
|
34
|
+
|
|
35
|
+
exports.default = _default;
|
|
36
|
+
//# sourceMappingURL=LabelComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/LabeledSwitch/LabelComponent.tsx"],"names":["LabelComponent","label","labelPosition","labelProps","active","switchDisabled","rest","defaultFontColor","defaultFontWeight","fontColor","fontWeight","React","memo"],"mappings":";;;;;AAKA;;AACA;;AAEA;;;;;;AAUA,MAAMA,cAAuC,GAAG,CAAC;AAC/CC,EAAAA,KAD+C;AAE/CC,EAAAA,aAF+C;AAG/CC,EAAAA,UAH+C;AAI/CC,EAAAA,MAJ+C;AAK/CC,EAAAA,cAAc,GAAG,KAL8B;AAM/C,KAAGC;AAN4C,CAAD,KAO1C;AACJ,QAAMC,gBAAiC,GACrCH,MAAM,IAAI,CAACC,cAAX,GAA4B,MAA5B,GAAqC,QADvC;AAEA,QAAMG,iBAAmC,GACvCJ,MAAM,IAAI,CAACC,cAAX,GAA4B,MAA5B,GAAqC,SADvC;AAGA,SACE,6BAAC,sBAAD,EAAeC,IAAf,EACE,6BAAC,mBAAD;AACE,IAAA,aAAa,EAAEJ,aADjB;AAEE,IAAA,SAAS,EAAE,CAAAC,UAAU,QAAV,YAAAA,UAAU,CAAEM,SAAZ,KAAyBF,gBAFtC;AAGE,IAAA,UAAU,EAAE,CAAAJ,UAAU,QAAV,YAAAA,UAAU,CAAEO,UAAZ,KAA0BF;AAHxC,KAIML,UAJN,GAMGF,KANH,CADF,CADF;AAYD,CAzBD;;eA2BeU,eAAMC,IAAN,CAAWZ,cAAX,C","sourcesContent":["import {\n FontColor,\n FontWeight,\n LabelPositionOptions,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { Pressable, PressableProps } from 'react-native';\nimport { TextNativeProps } from '../../atoms/Text';\nimport { StyledLabel } from './styled';\n\nexport interface LabelComponentProps extends PressableProps {\n label: string;\n labelPosition: LabelPositionOptions;\n labelProps?: TextNativeProps;\n active: boolean;\n switchDisabled?: boolean;\n}\n\nconst LabelComponent: FC<LabelComponentProps> = ({\n label,\n labelPosition,\n labelProps,\n active,\n switchDisabled = false,\n ...rest\n}) => {\n const defaultFontColor: keyof FontColor =\n active && !switchDisabled ? 'dark' : 'medium';\n const defaultFontWeight: keyof FontWeight =\n active && !switchDisabled ? 'bold' : 'regular';\n\n return (\n <Pressable {...rest}>\n <StyledLabel\n labelPosition={labelPosition}\n fontColor={labelProps?.fontColor ?? defaultFontColor}\n fontWeight={labelProps?.fontWeight ?? defaultFontWeight}\n {...labelProps}\n >\n {label}\n </StyledLabel>\n </Pressable>\n );\n};\n\nexport default React.memo(LabelComponent);\n"],"file":"LabelComponent.js"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LabeledSwitchProps } from '@tecsinapse/react-core';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { TextNativeProps } from '../../atoms/Text';
|
|
4
|
+
export declare type LabeledSwitchNativeProps = LabeledSwitchProps & {
|
|
5
|
+
labelProps?: TextNativeProps;
|
|
6
|
+
};
|
|
7
|
+
declare const LabeledSwitch: FC<LabeledSwitchNativeProps>;
|
|
8
|
+
export default LabeledSwitch;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _reactCore = require("@tecsinapse/react-core");
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _LabelComponent = _interopRequireDefault(require("./LabelComponent"));
|
|
11
|
+
|
|
12
|
+
var _styled = require("./styled");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
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); }
|
|
17
|
+
|
|
18
|
+
const LabeledSwitch = ({
|
|
19
|
+
label,
|
|
20
|
+
labelPosition = 'right',
|
|
21
|
+
labelProps,
|
|
22
|
+
pressableLabel = false,
|
|
23
|
+
active,
|
|
24
|
+
disabled,
|
|
25
|
+
onChange,
|
|
26
|
+
...rest
|
|
27
|
+
}) => {
|
|
28
|
+
return _react.default.createElement(_styled.StyledView, null, labelPosition === 'left' ? _react.default.createElement(_LabelComponent.default, {
|
|
29
|
+
active: active,
|
|
30
|
+
label: label,
|
|
31
|
+
labelPosition: 'left',
|
|
32
|
+
labelProps: labelProps,
|
|
33
|
+
disabled: !pressableLabel || disabled,
|
|
34
|
+
switchDisabled: disabled,
|
|
35
|
+
onPress: () => onChange(!active)
|
|
36
|
+
}) : _react.default.createElement(_react.default.Fragment, null), _react.default.createElement(_reactCore.Switch, _extends({
|
|
37
|
+
active: active,
|
|
38
|
+
onChange: onChange,
|
|
39
|
+
disabled: disabled
|
|
40
|
+
}, rest)), labelPosition === 'right' ? _react.default.createElement(_LabelComponent.default, {
|
|
41
|
+
active: active,
|
|
42
|
+
label: label,
|
|
43
|
+
labelPosition: 'right',
|
|
44
|
+
labelProps: labelProps,
|
|
45
|
+
disabled: !pressableLabel || disabled,
|
|
46
|
+
switchDisabled: disabled,
|
|
47
|
+
onPress: () => onChange(!active)
|
|
48
|
+
}) : _react.default.createElement(_react.default.Fragment, null));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var _default = LabeledSwitch;
|
|
52
|
+
exports.default = _default;
|
|
53
|
+
//# sourceMappingURL=LabeledSwitch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/LabeledSwitch/LabeledSwitch.tsx"],"names":["LabeledSwitch","label","labelPosition","labelProps","pressableLabel","active","disabled","onChange","rest"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAMA,MAAMA,aAA2C,GAAG,CAAC;AACnDC,EAAAA,KADmD;AAEnDC,EAAAA,aAAa,GAAG,OAFmC;AAGnDC,EAAAA,UAHmD;AAInDC,EAAAA,cAAc,GAAG,KAJkC;AAKnDC,EAAAA,MALmD;AAMnDC,EAAAA,QANmD;AAOnDC,EAAAA,QAPmD;AAQnD,KAAGC;AARgD,CAAD,KAS9C;AACJ,SACE,6BAAC,kBAAD,QACGN,aAAa,KAAK,MAAlB,GACC,6BAAC,uBAAD;AACE,IAAA,MAAM,EAAEG,MADV;AAEE,IAAA,KAAK,EAAEJ,KAFT;AAGE,IAAA,aAAa,EAAE,MAHjB;AAIE,IAAA,UAAU,EAAEE,UAJd;AAKE,IAAA,QAAQ,EAAE,CAACC,cAAD,IAAmBE,QAL/B;AAME,IAAA,cAAc,EAAEA,QANlB;AAOE,IAAA,OAAO,EAAE,MAAMC,QAAQ,CAAC,CAACF,MAAF;AAPzB,IADD,GAWC,2DAZJ,EAcE,6BAAC,iBAAD;AACE,IAAA,MAAM,EAAEA,MADV;AAEE,IAAA,QAAQ,EAAEE,QAFZ;AAGE,IAAA,QAAQ,EAAED;AAHZ,KAIME,IAJN,EAdF,EAoBGN,aAAa,KAAK,OAAlB,GACC,6BAAC,uBAAD;AACE,IAAA,MAAM,EAAEG,MADV;AAEE,IAAA,KAAK,EAAEJ,KAFT;AAGE,IAAA,aAAa,EAAE,OAHjB;AAIE,IAAA,UAAU,EAAEE,UAJd;AAKE,IAAA,QAAQ,EAAE,CAACC,cAAD,IAAmBE,QAL/B;AAME,IAAA,cAAc,EAAEA,QANlB;AAOE,IAAA,OAAO,EAAE,MAAMC,QAAQ,CAAC,CAACF,MAAF;AAPzB,IADD,GAWC,2DA/BJ,CADF;AAoCD,CA9CD;;eAgDeL,a","sourcesContent":["import { LabeledSwitchProps, Switch } from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { TextNativeProps } from '../../atoms/Text';\nimport LabelComponent from './LabelComponent';\nimport { StyledView } from './styled';\n\nexport type LabeledSwitchNativeProps = LabeledSwitchProps & {\n labelProps?: TextNativeProps;\n};\n\nconst LabeledSwitch: FC<LabeledSwitchNativeProps> = ({\n label,\n labelPosition = 'right',\n labelProps,\n pressableLabel = false,\n active,\n disabled,\n onChange,\n ...rest\n}) => {\n return (\n <StyledView>\n {labelPosition === 'left' ? (\n <LabelComponent\n active={active}\n label={label}\n labelPosition={'left'}\n labelProps={labelProps}\n disabled={!pressableLabel || disabled}\n switchDisabled={disabled}\n onPress={() => onChange(!active)}\n />\n ) : (\n <></>\n )}\n <Switch\n active={active}\n onChange={onChange}\n disabled={disabled}\n {...rest}\n />\n {labelPosition === 'right' ? (\n <LabelComponent\n active={active}\n label={label}\n labelPosition={'right'}\n labelProps={labelProps}\n disabled={!pressableLabel || disabled}\n switchDisabled={disabled}\n onPress={() => onChange(!active)}\n />\n ) : (\n <></>\n )}\n </StyledView>\n );\n};\n\nexport default LabeledSwitch;\n"],"file":"LabeledSwitch.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LabeledSwitch, LabeledSwitchNativeProps, } from './LabeledSwitch';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.LabeledSwitchNativeProps = exports.LabeledSwitch = void 0;
|
|
5
|
+
|
|
6
|
+
var _LabeledSwitch = _interopRequireWildcard(require("./LabeledSwitch"));
|
|
7
|
+
|
|
8
|
+
exports.LabeledSwitch = _LabeledSwitch.default;
|
|
9
|
+
exports.LabeledSwitchNativeProps = _LabeledSwitch.LabeledSwitchNativeProps;
|
|
10
|
+
|
|
11
|
+
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); }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/LabeledSwitch/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export {\n default as LabeledSwitch,\n LabeledSwitchNativeProps,\n} from './LabeledSwitch';\n"],"file":"index.js"}
|