@tecsinapse/react-native-kit 1.22.7 → 1.22.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/atoms/Avatar/Avatar.js +3 -21
- package/dist/cjs/components/atoms/Avatar/Avatar.js.map +1 -1
- package/dist/cjs/components/atoms/Badge/Badge.js +9 -43
- package/dist/cjs/components/atoms/Badge/Badge.js.map +1 -1
- package/dist/cjs/components/atoms/BottomNavigator/BottomNavigator.js +14 -43
- package/dist/cjs/components/atoms/BottomNavigator/BottomNavigator.js.map +1 -1
- package/dist/cjs/components/atoms/BottomNavigator/Item.js +13 -43
- package/dist/cjs/components/atoms/BottomNavigator/Item.js.map +1 -1
- package/dist/cjs/components/atoms/Button/Button.js +9 -42
- package/dist/cjs/components/atoms/Button/Button.js.map +1 -1
- package/dist/cjs/components/atoms/Button/States/Error.js +5 -23
- package/dist/cjs/components/atoms/Button/States/Error.js.map +1 -1
- package/dist/cjs/components/atoms/Button/States/Loading.js +3 -21
- package/dist/cjs/components/atoms/Button/States/Loading.js.map +1 -1
- package/dist/cjs/components/atoms/Button/States/Success.js +3 -21
- package/dist/cjs/components/atoms/Button/States/Success.js.map +1 -1
- package/dist/cjs/components/atoms/GroupButton/GroupButtonOption.js +3 -21
- package/dist/cjs/components/atoms/GroupButton/GroupButtonOption.js.map +1 -1
- package/dist/cjs/components/atoms/Header/Header.js +18 -48
- package/dist/cjs/components/atoms/Header/Header.js.map +1 -1
- package/dist/cjs/components/atoms/Input/Input.js +32 -84
- package/dist/cjs/components/atoms/Input/Input.js.map +1 -1
- package/dist/cjs/components/atoms/InputMask/InputMask.js +29 -83
- package/dist/cjs/components/atoms/InputMask/InputMask.js.map +1 -1
- package/dist/cjs/components/atoms/Modal/ModalGroupManager.js +5 -33
- package/dist/cjs/components/atoms/Modal/ModalGroupManager.js.map +1 -1
- package/dist/cjs/components/atoms/Modal/ModalLifecycleHandler.js +67 -86
- package/dist/cjs/components/atoms/Modal/ModalLifecycleHandler.js.map +1 -1
- package/dist/cjs/components/atoms/Modal/useLazyModalManager.js +1 -1
- package/dist/cjs/components/atoms/Modal/useLazyModalManager.js.map +1 -1
- package/dist/cjs/components/atoms/Modal/useModalManager.js +1 -1
- package/dist/cjs/components/atoms/Modal/useModalManager.js.map +1 -1
- package/dist/cjs/components/atoms/Skeleton/Pulse.js +4 -5
- package/dist/cjs/components/atoms/Skeleton/Pulse.js.map +1 -1
- package/dist/cjs/components/atoms/Skeleton/Skeleton.js +13 -47
- package/dist/cjs/components/atoms/Skeleton/Skeleton.js.map +1 -1
- package/dist/cjs/components/atoms/Skeleton/Wave.js +5 -6
- package/dist/cjs/components/atoms/Skeleton/Wave.js.map +1 -1
- package/dist/cjs/components/atoms/SnappingSlider/SnappingSlider.js +11 -43
- package/dist/cjs/components/atoms/SnappingSlider/SnappingSlider.js.map +1 -1
- package/dist/cjs/components/atoms/Tag/Tag.js +5 -33
- package/dist/cjs/components/atoms/Tag/Tag.js.map +1 -1
- package/dist/cjs/components/atoms/Text/Text.js +4 -31
- package/dist/cjs/components/atoms/Text/Text.js.map +1 -1
- package/dist/cjs/components/atoms/Text/styled.js +3 -3
- package/dist/cjs/components/atoms/Text/styled.js.map +1 -1
- package/dist/cjs/components/atoms/TextArea/TextArea.js +29 -83
- package/dist/cjs/components/atoms/TextArea/TextArea.js.map +1 -1
- package/dist/cjs/components/molecules/Calendar/Calendar.js +8 -40
- package/dist/cjs/components/molecules/Calendar/Calendar.js.map +1 -1
- package/dist/cjs/components/molecules/DatePicker/DatePicker.js +15 -48
- package/dist/cjs/components/molecules/DatePicker/DatePicker.js.map +1 -1
- package/dist/cjs/components/molecules/DateTimePicker/DateTimePicker.js +12 -43
- package/dist/cjs/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/cjs/components/molecules/DateTimeSelector/DateTimeSelector.js +8 -40
- package/dist/cjs/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -1
- package/dist/cjs/components/molecules/Grid/Grid.js +20 -55
- package/dist/cjs/components/molecules/Grid/Grid.js.map +1 -1
- package/dist/cjs/components/molecules/Grid/Item/Item.js +28 -75
- package/dist/cjs/components/molecules/Grid/Item/Item.js.map +1 -1
- package/dist/cjs/components/molecules/IconTextButton/IconTextButton.js +13 -47
- package/dist/cjs/components/molecules/IconTextButton/IconTextButton.js.map +1 -1
- package/dist/cjs/components/molecules/IconTextButton/TextComponent.js +7 -23
- package/dist/cjs/components/molecules/IconTextButton/TextComponent.js.map +1 -1
- package/dist/cjs/components/molecules/IconTextButton/styled.js +3 -3
- package/dist/cjs/components/molecules/IconTextButton/styled.js.map +1 -1
- package/dist/cjs/components/molecules/InputPassword/InputPassword.js +4 -35
- package/dist/cjs/components/molecules/InputPassword/InputPassword.js.map +1 -1
- package/dist/cjs/components/molecules/LabeledSwitch/LabelComponent.js +15 -47
- package/dist/cjs/components/molecules/LabeledSwitch/LabelComponent.js.map +1 -1
- package/dist/cjs/components/molecules/LabeledSwitch/LabeledSwitch.js +14 -49
- package/dist/cjs/components/molecules/LabeledSwitch/LabeledSwitch.js.map +1 -1
- package/dist/cjs/components/molecules/LabeledSwitch/styled.js +2 -2
- package/dist/cjs/components/molecules/LabeledSwitch/styled.js.map +1 -1
- package/dist/cjs/components/molecules/Select/Modal.js +25 -71
- package/dist/cjs/components/molecules/Select/Modal.js.map +1 -1
- package/dist/cjs/components/molecules/Select/Select.js +37 -91
- package/dist/cjs/components/molecules/Select/Select.js.map +1 -1
- package/dist/cjs/components/molecules/Select/styled.js +3 -6
- package/dist/cjs/components/molecules/Select/styled.js.map +1 -1
- package/dist/cjs/components/molecules/Snackbar/Snackbar.js +10 -41
- package/dist/cjs/components/molecules/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/components/atoms/Avatar/Avatar.js +3 -21
- package/dist/esm/components/atoms/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/atoms/Badge/Badge.js +9 -43
- package/dist/esm/components/atoms/Badge/Badge.js.map +1 -1
- package/dist/esm/components/atoms/BottomNavigator/BottomNavigator.js +14 -43
- package/dist/esm/components/atoms/BottomNavigator/BottomNavigator.js.map +1 -1
- package/dist/esm/components/atoms/BottomNavigator/Item.js +13 -43
- package/dist/esm/components/atoms/BottomNavigator/Item.js.map +1 -1
- package/dist/esm/components/atoms/Button/Button.js +9 -42
- package/dist/esm/components/atoms/Button/Button.js.map +1 -1
- package/dist/esm/components/atoms/Button/States/Error.js +6 -24
- package/dist/esm/components/atoms/Button/States/Error.js.map +1 -1
- package/dist/esm/components/atoms/Button/States/Loading.js +3 -21
- package/dist/esm/components/atoms/Button/States/Loading.js.map +1 -1
- package/dist/esm/components/atoms/Button/States/Success.js +3 -21
- package/dist/esm/components/atoms/Button/States/Success.js.map +1 -1
- package/dist/esm/components/atoms/GroupButton/GroupButtonOption.js +3 -21
- package/dist/esm/components/atoms/GroupButton/GroupButtonOption.js.map +1 -1
- package/dist/esm/components/atoms/Header/Header.js +18 -48
- package/dist/esm/components/atoms/Header/Header.js.map +1 -1
- package/dist/esm/components/atoms/Input/Input.js +32 -84
- package/dist/esm/components/atoms/Input/Input.js.map +1 -1
- package/dist/esm/components/atoms/InputMask/InputMask.js +29 -83
- package/dist/esm/components/atoms/InputMask/InputMask.js.map +1 -1
- package/dist/esm/components/atoms/Modal/ModalGroupManager.js +5 -33
- package/dist/esm/components/atoms/Modal/ModalGroupManager.js.map +1 -1
- package/dist/esm/components/atoms/Modal/ModalLifecycleHandler.js +67 -86
- package/dist/esm/components/atoms/Modal/ModalLifecycleHandler.js.map +1 -1
- package/dist/esm/components/atoms/Modal/useLazyModalManager.js +1 -1
- package/dist/esm/components/atoms/Modal/useLazyModalManager.js.map +1 -1
- package/dist/esm/components/atoms/Modal/useModalManager.js +1 -1
- package/dist/esm/components/atoms/Modal/useModalManager.js.map +1 -1
- package/dist/esm/components/atoms/Skeleton/Pulse.js +4 -5
- package/dist/esm/components/atoms/Skeleton/Pulse.js.map +1 -1
- package/dist/esm/components/atoms/Skeleton/Skeleton.js +13 -47
- package/dist/esm/components/atoms/Skeleton/Skeleton.js.map +1 -1
- package/dist/esm/components/atoms/Skeleton/Wave.js +5 -6
- package/dist/esm/components/atoms/Skeleton/Wave.js.map +1 -1
- package/dist/esm/components/atoms/SnappingSlider/SnappingSlider.js +11 -43
- package/dist/esm/components/atoms/SnappingSlider/SnappingSlider.js.map +1 -1
- package/dist/esm/components/atoms/Tag/Tag.js +5 -33
- package/dist/esm/components/atoms/Tag/Tag.js.map +1 -1
- package/dist/esm/components/atoms/Text/Text.js +4 -31
- package/dist/esm/components/atoms/Text/Text.js.map +1 -1
- package/dist/esm/components/atoms/Text/styled.js +3 -3
- package/dist/esm/components/atoms/Text/styled.js.map +1 -1
- package/dist/esm/components/atoms/TextArea/TextArea.js +29 -83
- package/dist/esm/components/atoms/TextArea/TextArea.js.map +1 -1
- package/dist/esm/components/molecules/Calendar/Calendar.js +8 -40
- package/dist/esm/components/molecules/Calendar/Calendar.js.map +1 -1
- package/dist/esm/components/molecules/DatePicker/DatePicker.js +15 -48
- package/dist/esm/components/molecules/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/components/molecules/DateTimePicker/DateTimePicker.js +12 -43
- package/dist/esm/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/esm/components/molecules/DateTimeSelector/DateTimeSelector.js +8 -40
- package/dist/esm/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -1
- package/dist/esm/components/molecules/Grid/Grid.js +20 -55
- package/dist/esm/components/molecules/Grid/Grid.js.map +1 -1
- package/dist/esm/components/molecules/Grid/Item/Item.js +28 -75
- package/dist/esm/components/molecules/Grid/Item/Item.js.map +1 -1
- package/dist/esm/components/molecules/IconTextButton/IconTextButton.js +13 -47
- package/dist/esm/components/molecules/IconTextButton/IconTextButton.js.map +1 -1
- package/dist/esm/components/molecules/IconTextButton/TextComponent.js +7 -23
- package/dist/esm/components/molecules/IconTextButton/TextComponent.js.map +1 -1
- package/dist/esm/components/molecules/IconTextButton/styled.js +3 -3
- package/dist/esm/components/molecules/IconTextButton/styled.js.map +1 -1
- package/dist/esm/components/molecules/InputPassword/InputPassword.js +4 -35
- package/dist/esm/components/molecules/InputPassword/InputPassword.js.map +1 -1
- package/dist/esm/components/molecules/LabeledSwitch/LabelComponent.js +15 -47
- package/dist/esm/components/molecules/LabeledSwitch/LabelComponent.js.map +1 -1
- package/dist/esm/components/molecules/LabeledSwitch/LabeledSwitch.js +14 -49
- package/dist/esm/components/molecules/LabeledSwitch/LabeledSwitch.js.map +1 -1
- package/dist/esm/components/molecules/LabeledSwitch/styled.js +2 -2
- package/dist/esm/components/molecules/LabeledSwitch/styled.js.map +1 -1
- package/dist/esm/components/molecules/Select/Modal.js +25 -71
- package/dist/esm/components/molecules/Select/Modal.js.map +1 -1
- package/dist/esm/components/molecules/Select/Select.js +38 -92
- package/dist/esm/components/molecules/Select/Select.js.map +1 -1
- package/dist/esm/components/molecules/Select/styled.js +3 -6
- package/dist/esm/components/molecules/Select/styled.js.map +1 -1
- package/dist/esm/components/molecules/Snackbar/Snackbar.js +10 -41
- package/dist/esm/components/molecules/Snackbar/Snackbar.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLazyModalManager.js","sources":["../../../../../src/components/atoms/Modal/useLazyModalManager.ts"],"sourcesContent":["import { ReactElement, useCallback, useEffect, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { modalLifecycle } from './ModalGroupManager';\nimport { IBaseModal } from './ui/types';\n\n/**\n * Use this hook to tell the modal lifecycle handler that you want to add\n * a new modal component.\n *\n * @returns\n * @param modalId\n */\nexport const useLazyModalManager = (modalId?: string) => {\n const [id] = useState(modalId ?? uuidv4());\n\n const requestUpdate = useCallback(() => modalLifecycle.update(), []);\n\n const sync = useCallback(\n (modal: ReactElement<IBaseModal>) => {\n modalLifecycle.sync(id, () => modal);\n return null;\n },\n [id]\n );\n\n const show = useCallback(() => {\n modalLifecycle.show(id);\n }, [id]);\n\n const close = useCallback(() => {\n modalLifecycle.close(id);\n }, [id]);\n\n useEffect(() => {\n return () => modalLifecycle.destroy(id);\n }, []);\n\n return {\n requestUpdate,\n sync,\n show,\n close,\n };\n};\n"],"names":["useState","uuidv4","useCallback","modalLifecycle","useEffect"],"mappings":";;;;;;;;AAYa,MAAA,mBAAA,GAAsB,CAAC,OAAqB,KAAA;AACvD,EAAA,MAAM,CAAC,EAAE,CAAA,GAAIA,cAAS,CAAA,OAAA,
|
|
1
|
+
{"version":3,"file":"useLazyModalManager.js","sources":["../../../../../src/components/atoms/Modal/useLazyModalManager.ts"],"sourcesContent":["import { ReactElement, useCallback, useEffect, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { modalLifecycle } from './ModalGroupManager';\nimport { IBaseModal } from './ui/types';\n\n/**\n * Use this hook to tell the modal lifecycle handler that you want to add\n * a new modal component.\n *\n * @returns\n * @param modalId\n */\nexport const useLazyModalManager = (modalId?: string) => {\n const [id] = useState(modalId ?? uuidv4());\n\n const requestUpdate = useCallback(() => modalLifecycle.update(), []);\n\n const sync = useCallback(\n (modal: ReactElement<IBaseModal>) => {\n modalLifecycle.sync(id, () => modal);\n return null;\n },\n [id]\n );\n\n const show = useCallback(() => {\n modalLifecycle.show(id);\n }, [id]);\n\n const close = useCallback(() => {\n modalLifecycle.close(id);\n }, [id]);\n\n useEffect(() => {\n return () => modalLifecycle.destroy(id);\n }, []);\n\n return {\n requestUpdate,\n sync,\n show,\n close,\n };\n};\n"],"names":["useState","uuidv4","useCallback","modalLifecycle","useEffect"],"mappings":";;;;;;;;AAYa,MAAA,mBAAA,GAAsB,CAAC,OAAqB,KAAA;AACvD,EAAA,MAAM,CAAC,EAAE,CAAA,GAAIA,cAAS,CAAA,OAAA,IAAWC,SAAQ,CAAA,CAAA;AAEzC,EAAA,MAAM,gBAAgBC,iBAAY,CAAA,MAAMC,iCAAe,MAAO,EAAA,EAAG,EAAE,CAAA,CAAA;AAEnE,EAAA,MAAM,IAAO,GAAAD,iBAAA;AAAA,IACX,CAAC,KAAoC,KAAA;AACnC,MAAeC,gCAAA,CAAA,IAAA,CAAK,EAAI,EAAA,MAAM,KAAK,CAAA,CAAA;AACnC,MAAO,OAAA,IAAA,CAAA;AAAA,KACT;AAAA,IACA,CAAC,EAAE,CAAA;AAAA,GACL,CAAA;AAEA,EAAM,MAAA,IAAA,GAAOD,kBAAY,MAAM;AAC7B,IAAAC,gCAAA,CAAe,KAAK,EAAE,CAAA,CAAA;AAAA,GACxB,EAAG,CAAC,EAAE,CAAC,CAAA,CAAA;AAEP,EAAM,MAAA,KAAA,GAAQD,kBAAY,MAAM;AAC9B,IAAAC,gCAAA,CAAe,MAAM,EAAE,CAAA,CAAA;AAAA,GACzB,EAAG,CAAC,EAAE,CAAC,CAAA,CAAA;AAEP,EAAAC,eAAA,CAAU,MAAM;AACd,IAAO,OAAA,MAAMD,gCAAe,CAAA,OAAA,CAAQ,EAAE,CAAA,CAAA;AAAA,GACxC,EAAG,EAAE,CAAA,CAAA;AAEL,EAAO,OAAA;AAAA,IACL,aAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
|
@@ -7,7 +7,7 @@ var uuid = require('uuid');
|
|
|
7
7
|
var ModalGroupManager = require('./ModalGroupManager.js');
|
|
8
8
|
|
|
9
9
|
const useModalManager = (modal, modalId) => {
|
|
10
|
-
const [id] = React.useState(modalId
|
|
10
|
+
const [id] = React.useState(modalId ?? uuid.v4());
|
|
11
11
|
ModalGroupManager.modalLifecycle.sync(id, modal);
|
|
12
12
|
const show = React.useCallback(() => {
|
|
13
13
|
ModalGroupManager.modalLifecycle.show(id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModalManager.js","sources":["../../../../../src/components/atoms/Modal/useModalManager.ts"],"sourcesContent":["import { ReactElement, useCallback, useEffect, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { modalLifecycle } from './ModalGroupManager';\nimport { IBaseModal } from './ui/types';\n\n/**\n * Use this hook to tell the modal lifecycle handler that you want to add\n * a new modal component.\n *\n * @param id\n * @param modal\n * @returns\n */\nexport const useModalManager = (\n modal: () => ReactElement<IBaseModal>,\n modalId?: string\n) => {\n const [id] = useState(modalId ?? uuidv4());\n modalLifecycle.sync(id, modal);\n\n const show = useCallback(() => {\n modalLifecycle.show(id);\n }, [id]);\n\n const close = useCallback(() => {\n modalLifecycle.close(id);\n }, [id]);\n\n useEffect(() => {\n return () => modalLifecycle.destroy(id);\n }, []);\n\n return {\n show,\n close,\n };\n};\n"],"names":["useState","uuidv4","modalLifecycle","useCallback","useEffect"],"mappings":";;;;;;;;AAaa,MAAA,eAAA,GAAkB,CAC7B,KAAA,EACA,OACG,KAAA;AACH,EAAA,MAAM,CAAC,EAAE,CAAA,GAAIA,cAAS,CAAA,OAAA,
|
|
1
|
+
{"version":3,"file":"useModalManager.js","sources":["../../../../../src/components/atoms/Modal/useModalManager.ts"],"sourcesContent":["import { ReactElement, useCallback, useEffect, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { modalLifecycle } from './ModalGroupManager';\nimport { IBaseModal } from './ui/types';\n\n/**\n * Use this hook to tell the modal lifecycle handler that you want to add\n * a new modal component.\n *\n * @param id\n * @param modal\n * @returns\n */\nexport const useModalManager = (\n modal: () => ReactElement<IBaseModal>,\n modalId?: string\n) => {\n const [id] = useState(modalId ?? uuidv4());\n modalLifecycle.sync(id, modal);\n\n const show = useCallback(() => {\n modalLifecycle.show(id);\n }, [id]);\n\n const close = useCallback(() => {\n modalLifecycle.close(id);\n }, [id]);\n\n useEffect(() => {\n return () => modalLifecycle.destroy(id);\n }, []);\n\n return {\n show,\n close,\n };\n};\n"],"names":["useState","uuidv4","modalLifecycle","useCallback","useEffect"],"mappings":";;;;;;;;AAaa,MAAA,eAAA,GAAkB,CAC7B,KAAA,EACA,OACG,KAAA;AACH,EAAA,MAAM,CAAC,EAAE,CAAA,GAAIA,cAAS,CAAA,OAAA,IAAWC,SAAQ,CAAA,CAAA;AACzC,EAAeC,gCAAA,CAAA,IAAA,CAAK,IAAI,KAAK,CAAA,CAAA;AAE7B,EAAM,MAAA,IAAA,GAAOC,kBAAY,MAAM;AAC7B,IAAAD,gCAAA,CAAe,KAAK,EAAE,CAAA,CAAA;AAAA,GACxB,EAAG,CAAC,EAAE,CAAC,CAAA,CAAA;AAEP,EAAM,MAAA,KAAA,GAAQC,kBAAY,MAAM;AAC9B,IAAAD,gCAAA,CAAe,MAAM,EAAE,CAAA,CAAA;AAAA,GACzB,EAAG,CAAC,EAAE,CAAC,CAAA,CAAA;AAEP,EAAAE,eAAA,CAAU,MAAM;AACd,IAAO,OAAA,MAAMF,gCAAe,CAAA,OAAA,CAAQ,EAAE,CAAA,CAAA;AAAA,GACxC,EAAG,EAAE,CAAA,CAAA;AAEL,EAAO,OAAA;AAAA,IACL,IAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
|
@@ -16,19 +16,18 @@ const Pulse = ({
|
|
|
16
16
|
height,
|
|
17
17
|
childrenLayout
|
|
18
18
|
}) => {
|
|
19
|
-
var _a, _b;
|
|
20
19
|
const animatedValue = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
21
20
|
React.useEffect(() => {
|
|
22
21
|
animation.pulseAnimation(active, animatedValue);
|
|
23
22
|
}, [active]);
|
|
24
23
|
return /* @__PURE__ */ React__default["default"].createElement(reactNative.Animated.View, {
|
|
25
24
|
style: {
|
|
26
|
-
width: width
|
|
27
|
-
height: height
|
|
25
|
+
width: width ?? childrenLayout.width,
|
|
26
|
+
height: height ?? childrenLayout.height,
|
|
28
27
|
backgroundColor: "rgba(0,0,0,0.05)",
|
|
29
28
|
position: "absolute",
|
|
30
|
-
top:
|
|
31
|
-
left:
|
|
29
|
+
top: childrenLayout.x ?? 0,
|
|
30
|
+
left: childrenLayout.y ?? 0,
|
|
32
31
|
zIndex: 2,
|
|
33
32
|
overflow: "hidden",
|
|
34
33
|
opacity: animatedValue
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pulse.js","sources":["../../../../../src/components/atoms/Skeleton/Pulse.tsx"],"sourcesContent":["import { Animated } from 'react-native';\nimport React, { useEffect, useRef } from 'react';\nimport { pulseAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nexport const Pulse = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n useEffect(() => {\n pulseAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <Animated.View\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n backgroundColor: 'rgba(0,0,0,0.05)',\n position: 'absolute',\n top: childrenLayout.x ?? 0,\n left: childrenLayout.y ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n opacity: animatedValue,\n }}\n />\n );\n};\n"],"names":["useRef","Animated","useEffect","pulseAnimation","React"],"mappings":";;;;;;;;;;;;AAKO,MAAM,QAAQ,CAAC;AAAA,EACpB,MAAS,GAAA,IAAA;AAAA,EACT,KAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AACF,CAA2B,KAAA;
|
|
1
|
+
{"version":3,"file":"Pulse.js","sources":["../../../../../src/components/atoms/Skeleton/Pulse.tsx"],"sourcesContent":["import { Animated } from 'react-native';\nimport React, { useEffect, useRef } from 'react';\nimport { pulseAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nexport const Pulse = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n useEffect(() => {\n pulseAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <Animated.View\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n backgroundColor: 'rgba(0,0,0,0.05)',\n position: 'absolute',\n top: childrenLayout.x ?? 0,\n left: childrenLayout.y ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n opacity: animatedValue,\n }}\n />\n );\n};\n"],"names":["useRef","Animated","useEffect","pulseAnimation","React"],"mappings":";;;;;;;;;;;;AAKO,MAAM,QAAQ,CAAC;AAAA,EACpB,MAAS,GAAA,IAAA;AAAA,EACT,KAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AACF,CAA2B,KAAA;AACzB,EAAA,MAAM,gBAAgBA,YAAO,CAAA,IAAIC,qBAAS,KAAM,CAAA,CAAC,CAAC,CAAE,CAAA,OAAA,CAAA;AAEpD,EAAAC,eAAA,CAAU,MAAM;AACd,IAAAC,wBAAA,CAAe,QAAQ,aAAa,CAAA,CAAA;AAAA,GACtC,EAAG,CAAC,MAAM,CAAC,CAAA,CAAA;AAEX,EACE,uBAAAC,yBAAA,CAAA,aAAA,CAACH,qBAAS,IAAT,EAAA;AAAA,IACC,KAAO,EAAA;AAAA,MACL,KAAA,EAAO,SAAS,cAAe,CAAA,KAAA;AAAA,MAC/B,MAAA,EAAQ,UAAU,cAAe,CAAA,MAAA;AAAA,MACjC,eAAiB,EAAA,kBAAA;AAAA,MACjB,QAAU,EAAA,UAAA;AAAA,MACV,GAAA,EAAK,eAAe,CAAK,IAAA,CAAA;AAAA,MACzB,IAAA,EAAM,eAAe,CAAK,IAAA,CAAA;AAAA,MAC1B,MAAQ,EAAA,CAAA;AAAA,MACR,QAAU,EAAA,QAAA;AAAA,MACV,OAAS,EAAA,aAAA;AAAA,KACX;AAAA,GACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -10,50 +10,15 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (__getOwnPropSymbols)
|
|
23
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
24
|
-
if (__propIsEnum.call(b, prop))
|
|
25
|
-
__defNormalProp(a, prop, b[prop]);
|
|
26
|
-
}
|
|
27
|
-
return a;
|
|
28
|
-
};
|
|
29
|
-
var __objRest = (source, exclude) => {
|
|
30
|
-
var target = {};
|
|
31
|
-
for (var prop in source)
|
|
32
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
33
|
-
target[prop] = source[prop];
|
|
34
|
-
if (source != null && __getOwnPropSymbols)
|
|
35
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
36
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
37
|
-
target[prop] = source[prop];
|
|
38
|
-
}
|
|
39
|
-
return target;
|
|
40
|
-
};
|
|
41
|
-
const Skeleton = (_a) => {
|
|
42
|
-
var _b = _a, {
|
|
43
|
-
children,
|
|
44
|
-
width,
|
|
45
|
-
height,
|
|
46
|
-
radius,
|
|
47
|
-
active = true,
|
|
48
|
-
animation = "wave"
|
|
49
|
-
} = _b, rest = __objRest(_b, [
|
|
50
|
-
"children",
|
|
51
|
-
"width",
|
|
52
|
-
"height",
|
|
53
|
-
"radius",
|
|
54
|
-
"active",
|
|
55
|
-
"animation"
|
|
56
|
-
]);
|
|
13
|
+
const Skeleton = ({
|
|
14
|
+
children,
|
|
15
|
+
width,
|
|
16
|
+
height,
|
|
17
|
+
radius,
|
|
18
|
+
active = true,
|
|
19
|
+
animation = "wave",
|
|
20
|
+
...rest
|
|
21
|
+
}) => {
|
|
57
22
|
const [childrenLayout, setChildrenLayout] = React.useState({
|
|
58
23
|
width: 0,
|
|
59
24
|
height: 0,
|
|
@@ -68,11 +33,12 @@ const Skeleton = (_a) => {
|
|
|
68
33
|
const getChildrenLayout = (event) => {
|
|
69
34
|
setChildrenLayout(event.nativeEvent.layout);
|
|
70
35
|
};
|
|
71
|
-
return /* @__PURE__ */ React__default["default"].createElement(styled.Wrapper,
|
|
36
|
+
return /* @__PURE__ */ React__default["default"].createElement(styled.Wrapper, {
|
|
72
37
|
width,
|
|
73
38
|
height,
|
|
74
|
-
radius
|
|
75
|
-
|
|
39
|
+
radius,
|
|
40
|
+
...rest
|
|
41
|
+
}, active && animation === "wave" ? /* @__PURE__ */ React__default["default"].createElement(Wave.Wave, {
|
|
76
42
|
active,
|
|
77
43
|
width,
|
|
78
44
|
height,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.js","sources":["../../../../../src/components/atoms/Skeleton/Skeleton.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { BorderRadiusType } from '@tecsinapse/react-core';\nimport { LayoutChangeEvent, View, ViewProps } from 'react-native';\nimport { Wrapper } from './styled';\nimport { Wave } from './Wave';\nimport { Pulse } from './Pulse';\nimport { ChildrenLayout } from './types';\n\nexport interface SkeletonProps extends ViewProps {\n width?: number;\n height?: number;\n radius?: BorderRadiusType;\n active?: boolean;\n animation?: 'wave' | 'pulse';\n}\n\nconst Skeleton: React.FC<SkeletonProps> = ({\n children,\n width,\n height,\n radius,\n active = true,\n animation = 'wave',\n ...rest\n}) => {\n const [childrenLayout, setChildrenLayout] = useState<ChildrenLayout>({\n width: 0,\n height: 0,\n y: 0,\n x: 0,\n });\n\n if (!width && !height && !children) {\n throw new Error(\n '[Skeleton] You should provide children or specify width and height'\n );\n }\n\n const getChildrenLayout = (event: LayoutChangeEvent) => {\n setChildrenLayout(event.nativeEvent.layout);\n };\n\n return (\n <Wrapper width={width} height={height} radius={radius} {...rest}>\n {active && animation === 'wave' ? (\n <Wave\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n ) : (\n <></>\n )}\n\n {active && animation === 'pulse' ? (\n <Pulse\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n ) : (\n <></>\n )}\n <View\n onLayout={event => getChildrenLayout(event)}\n style={{ opacity: active ? 0 : 1 }}\n pointerEvents={active ? 'none' : 'auto'}\n >\n {children}\n </View>\n </Wrapper>\n );\n};\n\nexport default Skeleton;\n"],"names":["useState","React","Wrapper","Wave","Pulse","View"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Skeleton.js","sources":["../../../../../src/components/atoms/Skeleton/Skeleton.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { BorderRadiusType } from '@tecsinapse/react-core';\nimport { LayoutChangeEvent, View, ViewProps } from 'react-native';\nimport { Wrapper } from './styled';\nimport { Wave } from './Wave';\nimport { Pulse } from './Pulse';\nimport { ChildrenLayout } from './types';\n\nexport interface SkeletonProps extends ViewProps {\n width?: number;\n height?: number;\n radius?: BorderRadiusType;\n active?: boolean;\n animation?: 'wave' | 'pulse';\n}\n\nconst Skeleton: React.FC<SkeletonProps> = ({\n children,\n width,\n height,\n radius,\n active = true,\n animation = 'wave',\n ...rest\n}) => {\n const [childrenLayout, setChildrenLayout] = useState<ChildrenLayout>({\n width: 0,\n height: 0,\n y: 0,\n x: 0,\n });\n\n if (!width && !height && !children) {\n throw new Error(\n '[Skeleton] You should provide children or specify width and height'\n );\n }\n\n const getChildrenLayout = (event: LayoutChangeEvent) => {\n setChildrenLayout(event.nativeEvent.layout);\n };\n\n return (\n <Wrapper width={width} height={height} radius={radius} {...rest}>\n {active && animation === 'wave' ? (\n <Wave\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n ) : (\n <></>\n )}\n\n {active && animation === 'pulse' ? (\n <Pulse\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n ) : (\n <></>\n )}\n <View\n onLayout={event => getChildrenLayout(event)}\n style={{ opacity: active ? 0 : 1 }}\n pointerEvents={active ? 'none' : 'auto'}\n >\n {children}\n </View>\n </Wrapper>\n );\n};\n\nexport default Skeleton;\n"],"names":["useState","React","Wrapper","Wave","Pulse","View"],"mappings":";;;;;;;;;;;;AAgBA,MAAM,WAAoC,CAAC;AAAA,EACzC,QAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAS,GAAA,IAAA;AAAA,EACT,SAAY,GAAA,MAAA;AAAA,EACT,GAAA,IAAA;AACL,CAAM,KAAA;AACJ,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAIA,cAAyB,CAAA;AAAA,IACnE,KAAO,EAAA,CAAA;AAAA,IACP,MAAQ,EAAA,CAAA;AAAA,IACR,CAAG,EAAA,CAAA;AAAA,IACH,CAAG,EAAA,CAAA;AAAA,GACJ,CAAA,CAAA;AAED,EAAA,IAAI,CAAC,KAAA,IAAS,CAAC,MAAA,IAAU,CAAC,QAAU,EAAA;AAClC,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,oEAAA;AAAA,KACF,CAAA;AAAA,GACF;AAEA,EAAM,MAAA,iBAAA,GAAoB,CAAC,KAA6B,KAAA;AACtD,IAAkB,iBAAA,CAAA,KAAA,CAAM,YAAY,MAAM,CAAA,CAAA;AAAA,GAC5C,CAAA;AAEA,EAAA,uBACGC,yBAAA,CAAA,aAAA,CAAAC,cAAA,EAAA;AAAA,IAAQ,KAAA;AAAA,IAAc,MAAA;AAAA,IAAgB,MAAA;AAAA,IAAiB,GAAG,IAAA;AAAA,GACxD,EAAA,MAAA,IAAU,SAAc,KAAA,MAAA,mBACtBD,yBAAA,CAAA,aAAA,CAAAE,SAAA,EAAA;AAAA,IACC,MAAA;AAAA,IACA,KAAA;AAAA,IACA,MAAA;AAAA,IACA,cAAA;AAAA,GACF,oBAEEF,yBAAA,CAAA,aAAA,CAAAA,yBAAA,CAAA,QAAA,EAAA,IAAA,CAAA,EAGH,MAAU,IAAA,SAAA,KAAc,0BACtBA,yBAAA,CAAA,aAAA,CAAAG,WAAA,EAAA;AAAA,IACC,MAAA;AAAA,IACA,KAAA;AAAA,IACA,MAAA;AAAA,IACA,cAAA;AAAA,GACF,CAAA,mBAEEH,yBAAA,CAAA,aAAA,CAAAA,yBAAA,CAAA,QAAA,EAAA,IAAA,CAAA,kBAEHA,yBAAA,CAAA,aAAA,CAAAI,gBAAA,EAAA;AAAA,IACC,QAAA,EAAU,CAAS,KAAA,KAAA,iBAAA,CAAkB,KAAK,CAAA;AAAA,IAC1C,KAAO,EAAA,EAAE,OAAS,EAAA,MAAA,GAAS,IAAI,CAAE,EAAA;AAAA,IACjC,aAAA,EAAe,SAAS,MAAS,GAAA,MAAA;AAAA,GAAA,EAEhC,QACH,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -19,8 +19,7 @@ const Wave = ({
|
|
|
19
19
|
height,
|
|
20
20
|
childrenLayout
|
|
21
21
|
}) => {
|
|
22
|
-
|
|
23
|
-
const range = width != null ? width : childrenLayout.width;
|
|
22
|
+
const range = width ?? childrenLayout.width;
|
|
24
23
|
const animatedValue = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
25
24
|
const translateX = animatedValue.interpolate({
|
|
26
25
|
inputRange: [0, 1],
|
|
@@ -39,11 +38,11 @@ const Wave = ({
|
|
|
39
38
|
start: { x: 0, y: 0 },
|
|
40
39
|
end: { x: 1, y: 0 },
|
|
41
40
|
style: {
|
|
42
|
-
width: width
|
|
43
|
-
height: height
|
|
41
|
+
width: width ?? childrenLayout.width,
|
|
42
|
+
height: height ?? childrenLayout.height,
|
|
44
43
|
position: "absolute",
|
|
45
|
-
top:
|
|
46
|
-
left:
|
|
44
|
+
top: childrenLayout.y ?? 0,
|
|
45
|
+
left: childrenLayout.x ?? 0,
|
|
47
46
|
zIndex: 2,
|
|
48
47
|
overflow: "hidden",
|
|
49
48
|
transform: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wave.js","sources":["../../../../../src/components/atoms/Skeleton/Wave.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Animated } from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\nimport { waveAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nconst AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient);\n\nexport const Wave = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const range = width ?? childrenLayout.width;\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n const translateX = animatedValue.interpolate({\n inputRange: [0, 1],\n outputRange: [-range, range],\n });\n\n useEffect(() => {\n waveAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <AnimatedLinearGradient\n colors={[\n 'transparent',\n 'rgba(0,0,0,0.05)',\n 'rgba(0,0,0,0.1)',\n 'transparent',\n ]}\n start={{ x: 0, y: 0 }}\n end={{ x: 1, y: 0 }}\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n position: 'absolute',\n top: childrenLayout.y ?? 0,\n left: childrenLayout.x ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n transform: [\n {\n translateX: translateX,\n },\n ],\n }}\n />\n );\n};\n"],"names":["Animated","LinearGradient","useRef","useEffect","waveAnimation","React"],"mappings":";;;;;;;;;;;;;;AAMA,MAAM,sBAAA,GAAyBA,oBAAS,CAAA,uBAAA,CAAwBC,kCAAc,CAAA,CAAA;AAEvE,MAAM,OAAO,CAAC;AAAA,EACnB,MAAS,GAAA,IAAA;AAAA,EACT,KAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AACF,CAA2B,KAAA;
|
|
1
|
+
{"version":3,"file":"Wave.js","sources":["../../../../../src/components/atoms/Skeleton/Wave.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Animated } from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\nimport { waveAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nconst AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient);\n\nexport const Wave = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const range = width ?? childrenLayout.width;\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n const translateX = animatedValue.interpolate({\n inputRange: [0, 1],\n outputRange: [-range, range],\n });\n\n useEffect(() => {\n waveAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <AnimatedLinearGradient\n colors={[\n 'transparent',\n 'rgba(0,0,0,0.05)',\n 'rgba(0,0,0,0.1)',\n 'transparent',\n ]}\n start={{ x: 0, y: 0 }}\n end={{ x: 1, y: 0 }}\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n position: 'absolute',\n top: childrenLayout.y ?? 0,\n left: childrenLayout.x ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n transform: [\n {\n translateX: translateX,\n },\n ],\n }}\n />\n );\n};\n"],"names":["Animated","LinearGradient","useRef","useEffect","waveAnimation","React"],"mappings":";;;;;;;;;;;;;;AAMA,MAAM,sBAAA,GAAyBA,oBAAS,CAAA,uBAAA,CAAwBC,kCAAc,CAAA,CAAA;AAEvE,MAAM,OAAO,CAAC;AAAA,EACnB,MAAS,GAAA,IAAA;AAAA,EACT,KAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AACF,CAA2B,KAAA;AACzB,EAAM,MAAA,KAAA,GAAQ,SAAS,cAAe,CAAA,KAAA,CAAA;AACtC,EAAA,MAAM,gBAAgBC,YAAO,CAAA,IAAIF,qBAAS,KAAM,CAAA,CAAC,CAAC,CAAE,CAAA,OAAA,CAAA;AAEpD,EAAM,MAAA,UAAA,GAAa,cAAc,WAAY,CAAA;AAAA,IAC3C,UAAA,EAAY,CAAC,CAAA,EAAG,CAAC,CAAA;AAAA,IACjB,WAAa,EAAA,CAAC,CAAC,KAAA,EAAO,KAAK,CAAA;AAAA,GAC5B,CAAA,CAAA;AAED,EAAAG,eAAA,CAAU,MAAM;AACd,IAAAC,uBAAA,CAAc,QAAQ,aAAa,CAAA,CAAA;AAAA,GACrC,EAAG,CAAC,MAAM,CAAC,CAAA,CAAA;AAEX,EAAA,uBACGC,yBAAA,CAAA,aAAA,CAAA,sBAAA,EAAA;AAAA,IACC,MAAQ,EAAA;AAAA,MACN,aAAA;AAAA,MACA,kBAAA;AAAA,MACA,iBAAA;AAAA,MACA,aAAA;AAAA,KACF;AAAA,IACA,KAAO,EAAA,EAAE,CAAG,EAAA,CAAA,EAAG,GAAG,CAAE,EAAA;AAAA,IACpB,GAAK,EAAA,EAAE,CAAG,EAAA,CAAA,EAAG,GAAG,CAAE,EAAA;AAAA,IAClB,KAAO,EAAA;AAAA,MACL,KAAA,EAAO,SAAS,cAAe,CAAA,KAAA;AAAA,MAC/B,MAAA,EAAQ,UAAU,cAAe,CAAA,MAAA;AAAA,MACjC,QAAU,EAAA,UAAA;AAAA,MACV,GAAA,EAAK,eAAe,CAAK,IAAA,CAAA;AAAA,MACzB,IAAA,EAAM,eAAe,CAAK,IAAA,CAAA;AAAA,MAC1B,MAAQ,EAAA,CAAA;AAAA,MACR,QAAU,EAAA,QAAA;AAAA,MACV,SAAW,EAAA;AAAA,QACT;AAAA,UACE,UAAA;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,GACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -25,46 +25,13 @@ function _interopNamespace(e) {
|
|
|
25
25
|
|
|
26
26
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (__hasOwnProp.call(b, prop))
|
|
36
|
-
__defNormalProp(a, prop, b[prop]);
|
|
37
|
-
if (__getOwnPropSymbols)
|
|
38
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
39
|
-
if (__propIsEnum.call(b, prop))
|
|
40
|
-
__defNormalProp(a, prop, b[prop]);
|
|
41
|
-
}
|
|
42
|
-
return a;
|
|
43
|
-
};
|
|
44
|
-
var __objRest = (source, exclude) => {
|
|
45
|
-
var target = {};
|
|
46
|
-
for (var prop in source)
|
|
47
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
48
|
-
target[prop] = source[prop];
|
|
49
|
-
if (source != null && __getOwnPropSymbols)
|
|
50
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
51
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
52
|
-
target[prop] = source[prop];
|
|
53
|
-
}
|
|
54
|
-
return target;
|
|
55
|
-
};
|
|
56
|
-
const SnappingSlider = (_a) => {
|
|
57
|
-
var _b = _a, {
|
|
58
|
-
children,
|
|
59
|
-
showAmount,
|
|
60
|
-
scrollAmount,
|
|
61
|
-
spacing
|
|
62
|
-
} = _b, rest = __objRest(_b, [
|
|
63
|
-
"children",
|
|
64
|
-
"showAmount",
|
|
65
|
-
"scrollAmount",
|
|
66
|
-
"spacing"
|
|
67
|
-
]);
|
|
28
|
+
const SnappingSlider = ({
|
|
29
|
+
children,
|
|
30
|
+
showAmount,
|
|
31
|
+
scrollAmount,
|
|
32
|
+
spacing,
|
|
33
|
+
...rest
|
|
34
|
+
}) => {
|
|
68
35
|
const theme = react.useTheme();
|
|
69
36
|
const childCount = React__namespace.Children.count(children);
|
|
70
37
|
const screenWidth = reactNative.Dimensions.get("window").width;
|
|
@@ -77,13 +44,14 @@ const SnappingSlider = (_a) => {
|
|
|
77
44
|
const padCompensation = horizontalPadding * Math.sign(index);
|
|
78
45
|
return offset + padCompensation;
|
|
79
46
|
});
|
|
80
|
-
return /* @__PURE__ */ React__namespace.createElement(reactNative.ScrollView,
|
|
47
|
+
return /* @__PURE__ */ React__namespace.createElement(reactNative.ScrollView, {
|
|
81
48
|
horizontal: true,
|
|
82
49
|
snapToOffsets,
|
|
83
50
|
snapToStart: true,
|
|
84
51
|
snapToEnd: true,
|
|
85
|
-
showsHorizontalScrollIndicator: false
|
|
86
|
-
|
|
52
|
+
showsHorizontalScrollIndicator: false,
|
|
53
|
+
...rest
|
|
54
|
+
}, React__namespace.Children.map(children, (child, index) => {
|
|
87
55
|
const isFirst = index === 0;
|
|
88
56
|
const isLast = index === childCount - 1;
|
|
89
57
|
return /* @__PURE__ */ React__namespace.createElement(reactNative.View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SnappingSlider.js","sources":["../../../../../src/components/atoms/SnappingSlider/SnappingSlider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Dimensions, ScrollView, ScrollViewProps, View } from 'react-native';\nimport {\n extractNumbersFromString,\n SpacingType,\n ThemeProp,\n} from '@tecsinapse/react-core';\nimport { useTheme } from '@emotion/react';\n\nexport interface SnappingSliderProps\n extends Omit<ScrollViewProps, 'horizontal' | 'snapToOffsets'> {\n /**\n * Amount in screen elements.\n * Should never be lower than scrollAmount, otherwise some elements will be skipped.\n */\n showAmount: number;\n\n /**\n * Amount of items to scroll within a single swipe.\n * Should never be greater than showAmount, otherwise some elements will be skipped.\n */\n scrollAmount: number;\n\n /**\n * Spacing between elements.\n * Must be one of [nano, micro, mili, centi, deca, kilo, mega, giga, tera, peta, hexa]\n */\n spacing?: SpacingType;\n}\n\nconst SnappingSlider: React.FC<SnappingSliderProps> = ({\n children,\n showAmount,\n scrollAmount,\n spacing,\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n\n const childCount = React.Children.count(children);\n const screenWidth = Dimensions.get('window').width;\n const totalSlideWidth = Math.round(screenWidth / showAmount);\n const horizontalPadding = spacing\n ? extractNumbersFromString(theme.spacing[spacing]) / 2\n : 0;\n\n const snapToOffsets = [\n ...Array(Math.ceil(childCount / scrollAmount)).keys(),\n ].map(index => {\n const offset = totalSlideWidth * scrollAmount * index;\n const padCompensation = horizontalPadding * Math.sign(index);\n return offset + padCompensation;\n });\n\n return (\n <ScrollView\n horizontal\n snapToOffsets={snapToOffsets}\n snapToStart\n snapToEnd\n showsHorizontalScrollIndicator={false}\n {...rest}\n >\n {React.Children.map(children, (child, index) => {\n const isFirst = index === 0;\n const isLast = index === childCount - 1;\n\n return (\n <View\n style={{\n width: totalSlideWidth,\n paddingHorizontal: horizontalPadding,\n paddingLeft: isFirst ? 0 : horizontalPadding,\n paddingRight: isLast ? 0 : horizontalPadding,\n }}\n >\n {child}\n </View>\n );\n })}\n </ScrollView>\n );\n};\n\nexport default SnappingSlider;\n"],"names":["useTheme","React","Dimensions","extractNumbersFromString","ScrollView","View"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SnappingSlider.js","sources":["../../../../../src/components/atoms/SnappingSlider/SnappingSlider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Dimensions, ScrollView, ScrollViewProps, View } from 'react-native';\nimport {\n extractNumbersFromString,\n SpacingType,\n ThemeProp,\n} from '@tecsinapse/react-core';\nimport { useTheme } from '@emotion/react';\n\nexport interface SnappingSliderProps\n extends Omit<ScrollViewProps, 'horizontal' | 'snapToOffsets'> {\n /**\n * Amount in screen elements.\n * Should never be lower than scrollAmount, otherwise some elements will be skipped.\n */\n showAmount: number;\n\n /**\n * Amount of items to scroll within a single swipe.\n * Should never be greater than showAmount, otherwise some elements will be skipped.\n */\n scrollAmount: number;\n\n /**\n * Spacing between elements.\n * Must be one of [nano, micro, mili, centi, deca, kilo, mega, giga, tera, peta, hexa]\n */\n spacing?: SpacingType;\n}\n\nconst SnappingSlider: React.FC<SnappingSliderProps> = ({\n children,\n showAmount,\n scrollAmount,\n spacing,\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n\n const childCount = React.Children.count(children);\n const screenWidth = Dimensions.get('window').width;\n const totalSlideWidth = Math.round(screenWidth / showAmount);\n const horizontalPadding = spacing\n ? extractNumbersFromString(theme.spacing[spacing]) / 2\n : 0;\n\n const snapToOffsets = [\n ...Array(Math.ceil(childCount / scrollAmount)).keys(),\n ].map(index => {\n const offset = totalSlideWidth * scrollAmount * index;\n const padCompensation = horizontalPadding * Math.sign(index);\n return offset + padCompensation;\n });\n\n return (\n <ScrollView\n horizontal\n snapToOffsets={snapToOffsets}\n snapToStart\n snapToEnd\n showsHorizontalScrollIndicator={false}\n {...rest}\n >\n {React.Children.map(children, (child, index) => {\n const isFirst = index === 0;\n const isLast = index === childCount - 1;\n\n return (\n <View\n style={{\n width: totalSlideWidth,\n paddingHorizontal: horizontalPadding,\n paddingLeft: isFirst ? 0 : horizontalPadding,\n paddingRight: isLast ? 0 : horizontalPadding,\n }}\n >\n {child}\n </View>\n );\n })}\n </ScrollView>\n );\n};\n\nexport default SnappingSlider;\n"],"names":["useTheme","React","Dimensions","extractNumbersFromString","ScrollView","View"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,iBAAgD,CAAC;AAAA,EACrD,QAAA;AAAA,EACA,UAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACG,GAAA,IAAA;AACL,CAAM,KAAA;AACJ,EAAA,MAAM,QAAQA,cAAS,EAAA,CAAA;AAEvB,EAAA,MAAM,UAAa,GAAAC,gBAAA,CAAM,QAAS,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AAChD,EAAA,MAAM,WAAc,GAAAC,sBAAA,CAAW,GAAI,CAAA,QAAQ,CAAE,CAAA,KAAA,CAAA;AAC7C,EAAA,MAAM,eAAkB,GAAA,IAAA,CAAK,KAAM,CAAA,WAAA,GAAc,UAAU,CAAA,CAAA;AAC3D,EAAA,MAAM,oBAAoB,OACtB,GAAAC,kCAAA,CAAyB,MAAM,OAAQ,CAAA,OAAA,CAAQ,IAAI,CACnD,GAAA,CAAA,CAAA;AAEJ,EAAA,MAAM,aAAgB,GAAA;AAAA,IACpB,GAAG,MAAM,IAAK,CAAA,IAAA,CAAK,aAAa,YAAY,CAAC,EAAE,IAAK,EAAA;AAAA,GACtD,CAAE,IAAI,CAAS,KAAA,KAAA;AACb,IAAM,MAAA,MAAA,GAAS,kBAAkB,YAAe,GAAA,KAAA,CAAA;AAChD,IAAA,MAAM,eAAkB,GAAA,iBAAA,GAAoB,IAAK,CAAA,IAAA,CAAK,KAAK,CAAA,CAAA;AAC3D,IAAA,OAAO,MAAS,GAAA,eAAA,CAAA;AAAA,GACjB,CAAA,CAAA;AAED,EAAA,uBACGF,gBAAA,CAAA,aAAA,CAAAG,sBAAA,EAAA;AAAA,IACC,UAAU,EAAA,IAAA;AAAA,IACV,aAAA;AAAA,IACA,WAAW,EAAA,IAAA;AAAA,IACX,SAAS,EAAA,IAAA;AAAA,IACT,8BAAgC,EAAA,KAAA;AAAA,IAC/B,GAAG,IAAA;AAAA,GAAA,EAEHH,iBAAM,QAAS,CAAA,GAAA,CAAI,QAAU,EAAA,CAAC,OAAO,KAAU,KAAA;AAC9C,IAAA,MAAM,UAAU,KAAU,KAAA,CAAA,CAAA;AAC1B,IAAM,MAAA,MAAA,GAAS,UAAU,UAAa,GAAA,CAAA,CAAA;AAEtC,IAAA,uBACGA,gBAAA,CAAA,aAAA,CAAAI,gBAAA,EAAA;AAAA,MACC,KAAO,EAAA;AAAA,QACL,KAAO,EAAA,eAAA;AAAA,QACP,iBAAmB,EAAA,iBAAA;AAAA,QACnB,WAAA,EAAa,UAAU,CAAI,GAAA,iBAAA;AAAA,QAC3B,YAAA,EAAc,SAAS,CAAI,GAAA,iBAAA;AAAA,OAC7B;AAAA,KAAA,EAEC,KACH,CAAA,CAAA;AAAA,GAEH,CACH,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -8,45 +8,17 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
8
8
|
|
|
9
9
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
15
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16
|
-
var __spreadValues = (a, b) => {
|
|
17
|
-
for (var prop in b || (b = {}))
|
|
18
|
-
if (__hasOwnProp.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
if (__getOwnPropSymbols)
|
|
21
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
22
|
-
if (__propIsEnum.call(b, prop))
|
|
23
|
-
__defNormalProp(a, prop, b[prop]);
|
|
24
|
-
}
|
|
25
|
-
return a;
|
|
26
|
-
};
|
|
27
|
-
var __objRest = (source, exclude) => {
|
|
28
|
-
var target = {};
|
|
29
|
-
for (var prop in source)
|
|
30
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
31
|
-
target[prop] = source[prop];
|
|
32
|
-
if (source != null && __getOwnPropSymbols)
|
|
33
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
34
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
35
|
-
target[prop] = source[prop];
|
|
36
|
-
}
|
|
37
|
-
return target;
|
|
38
|
-
};
|
|
39
|
-
const Tag = (_a) => {
|
|
40
|
-
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
41
|
-
return /* @__PURE__ */ React__default["default"].createElement(reactCore.Tag, __spreadValues({
|
|
11
|
+
const Tag = ({ value, ...rest }) => {
|
|
12
|
+
return /* @__PURE__ */ React__default["default"].createElement(reactCore.Tag, {
|
|
42
13
|
value: /* @__PURE__ */ React__default["default"].createElement(Text, {
|
|
43
14
|
colorVariant: "secondary",
|
|
44
15
|
colorTone: "dark",
|
|
45
16
|
fontStack: "default",
|
|
46
17
|
fontWeight: "bold",
|
|
47
18
|
typography: rest.variant === "small" ? "sub" : "base"
|
|
48
|
-
}, value)
|
|
49
|
-
|
|
19
|
+
}, value),
|
|
20
|
+
...rest
|
|
21
|
+
});
|
|
50
22
|
};
|
|
51
23
|
|
|
52
24
|
module.exports = Tag;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sources":["../../../../../src/components/atoms/Tag/Tag.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Tag as TagCore,\n TagProps as TagCoreProps,\n} from '@tecsinapse/react-core';\nimport { Text } from '../Text';\n\nexport interface TagProps extends Omit<TagCoreProps, 'value'> {\n value: string;\n}\n\nconst Tag: React.FC<TagProps> = ({ value, ...rest }): JSX.Element => {\n return (\n <TagCore\n value={\n <Text\n colorVariant=\"secondary\"\n colorTone=\"dark\"\n fontStack=\"default\"\n fontWeight=\"bold\"\n typography={rest.variant === 'small' ? 'sub' : 'base'}\n >\n {value}\n </Text>\n }\n {...rest}\n />\n );\n};\n\nexport default Tag;\n"],"names":["React","TagCore"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tag.js","sources":["../../../../../src/components/atoms/Tag/Tag.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Tag as TagCore,\n TagProps as TagCoreProps,\n} from '@tecsinapse/react-core';\nimport { Text } from '../Text';\n\nexport interface TagProps extends Omit<TagCoreProps, 'value'> {\n value: string;\n}\n\nconst Tag: React.FC<TagProps> = ({ value, ...rest }): JSX.Element => {\n return (\n <TagCore\n value={\n <Text\n colorVariant=\"secondary\"\n colorTone=\"dark\"\n fontStack=\"default\"\n fontWeight=\"bold\"\n typography={rest.variant === 'small' ? 'sub' : 'base'}\n >\n {value}\n </Text>\n }\n {...rest}\n />\n );\n};\n\nexport default Tag;\n"],"names":["React","TagCore"],"mappings":";;;;;;;;;;AAWA,MAAM,GAA0B,GAAA,CAAC,EAAE,KAAA,EAAA,GAAU,MAAwB,KAAA;AACnE,EAAA,uBACGA,yBAAA,CAAA,aAAA,CAAAC,aAAA,EAAA;AAAA,IACC,uBACGD,yBAAA,CAAA,aAAA,CAAA,IAAA,EAAA;AAAA,MACC,YAAa,EAAA,WAAA;AAAA,MACb,SAAU,EAAA,MAAA;AAAA,MACV,SAAU,EAAA,SAAA;AAAA,MACV,UAAW,EAAA,MAAA;AAAA,MACX,UAAY,EAAA,IAAA,CAAK,OAAY,KAAA,OAAA,GAAU,KAAQ,GAAA,MAAA;AAAA,KAAA,EAE9C,KACH,CAAA;AAAA,IAED,GAAG,IAAA;AAAA,GACN,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -7,37 +7,10 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
7
7
|
|
|
8
8
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15
|
-
var __spreadValues = (a, b) => {
|
|
16
|
-
for (var prop in b || (b = {}))
|
|
17
|
-
if (__hasOwnProp.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
if (__getOwnPropSymbols)
|
|
20
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
21
|
-
if (__propIsEnum.call(b, prop))
|
|
22
|
-
__defNormalProp(a, prop, b[prop]);
|
|
23
|
-
}
|
|
24
|
-
return a;
|
|
25
|
-
};
|
|
26
|
-
var __objRest = (source, exclude) => {
|
|
27
|
-
var target = {};
|
|
28
|
-
for (var prop in source)
|
|
29
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
30
|
-
target[prop] = source[prop];
|
|
31
|
-
if (source != null && __getOwnPropSymbols)
|
|
32
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
33
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
34
|
-
target[prop] = source[prop];
|
|
35
|
-
}
|
|
36
|
-
return target;
|
|
37
|
-
};
|
|
38
|
-
const Text = (_a) => {
|
|
39
|
-
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
40
|
-
return /* @__PURE__ */ React__default["default"].createElement(styled.StyledNativeText, __spreadValues({}, rest), children);
|
|
10
|
+
const Text = ({ children, ...rest }) => {
|
|
11
|
+
return /* @__PURE__ */ React__default["default"].createElement(styled.StyledNativeText, {
|
|
12
|
+
...rest
|
|
13
|
+
}, children);
|
|
41
14
|
};
|
|
42
15
|
|
|
43
16
|
module.exports = Text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sources":["../../../../../src/components/atoms/Text/Text.tsx"],"sourcesContent":["import { TextProps } from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { StyledNativeText } from './styled';\n\nexport type TextNativeProps = TextProps;\n\nconst Text: FC<TextNativeProps> = ({ children, ...rest }): JSX.Element => {\n return <StyledNativeText {...rest}>{children}</StyledNativeText>;\n};\n\nexport default Text;\n"],"names":["React","StyledNativeText"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.js","sources":["../../../../../src/components/atoms/Text/Text.tsx"],"sourcesContent":["import { TextProps } from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { StyledNativeText } from './styled';\n\nexport type TextNativeProps = TextProps;\n\nconst Text: FC<TextNativeProps> = ({ children, ...rest }): JSX.Element => {\n return <StyledNativeText {...rest}>{children}</StyledNativeText>;\n};\n\nexport default Text;\n"],"names":["React","StyledNativeText"],"mappings":";;;;;;;;;AAMA,MAAM,IAA4B,GAAA,CAAC,EAAE,QAAA,EAAA,GAAa,MAAwB,KAAA;AACxE,EAAA,uBAAQA,yBAAA,CAAA,aAAA,CAAAC,uBAAA,EAAA;AAAA,IAAkB,GAAG,IAAA;AAAA,GAAA,EAAO,QAAS,CAAA,CAAA;AAC/C;;;;"}
|
|
@@ -15,11 +15,11 @@ const fontStyles = ({
|
|
|
15
15
|
fontStack = "default",
|
|
16
16
|
fontWeight = "regular"
|
|
17
17
|
}) => {
|
|
18
|
-
const fontFamily =
|
|
19
|
-
const fontStyle = theme
|
|
18
|
+
const fontFamily = theme?.font.stack[fontStack] || "";
|
|
19
|
+
const fontStyle = theme?.font.files[fontWeight];
|
|
20
20
|
return styled.css`
|
|
21
21
|
${reactNative.Platform.OS === "android" ? "font-weight: normal;" : void 0}
|
|
22
|
-
font-family: ${fontStyle
|
|
22
|
+
font-family: ${fontStyle?.replace("{0}", fontFamily)};
|
|
23
23
|
`;
|
|
24
24
|
};
|
|
25
25
|
const StyledNativeText = styled__default["default"](reactCore.Text)(fontStyles);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../../../../src/components/atoms/Text/styled.ts"],"sourcesContent":["import styled, { css } from '@emotion/native';\nimport {\n FontStackType,\n FontWeightType,\n StyleProps,\n Text,\n} from '@tecsinapse/react-core';\nimport { Platform } from 'react-native';\nimport { TextNativeProps } from './Text';\n\nexport interface Font {\n fontStack?: FontStackType;\n fontWeight?: FontWeightType;\n}\n\nexport const fontStyles = ({\n theme,\n fontStack = 'default',\n fontWeight = 'regular',\n}: Partial<Font & Partial<StyleProps>>) => {\n const fontFamily = theme?.font.stack[fontStack] || '';\n const fontStyle = theme?.font.files[fontWeight];\n return css`\n ${Platform.OS === 'android' ? 'font-weight: normal;' : undefined}\n font-family: ${fontStyle?.replace('{0}', fontFamily)};\n `;\n};\n\nexport const StyledNativeText = styled(Text)<\n Font & Partial<TextNativeProps> & Partial<StyleProps>\n>(fontStyles);\n"],"names":["css","Platform","styled","Text"],"mappings":";;;;;;;;;;;;AAeO,MAAM,aAAa,CAAC;AAAA,EACzB,KAAA;AAAA,EACA,SAAY,GAAA,SAAA;AAAA,EACZ,UAAa,GAAA,SAAA;AACf,CAA2C,KAAA;AACzC,EAAA,MAAM,UAAa,GAAA,
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../../../../src/components/atoms/Text/styled.ts"],"sourcesContent":["import styled, { css } from '@emotion/native';\nimport {\n FontStackType,\n FontWeightType,\n StyleProps,\n Text,\n} from '@tecsinapse/react-core';\nimport { Platform } from 'react-native';\nimport { TextNativeProps } from './Text';\n\nexport interface Font {\n fontStack?: FontStackType;\n fontWeight?: FontWeightType;\n}\n\nexport const fontStyles = ({\n theme,\n fontStack = 'default',\n fontWeight = 'regular',\n}: Partial<Font & Partial<StyleProps>>) => {\n const fontFamily = theme?.font.stack[fontStack] || '';\n const fontStyle = theme?.font.files[fontWeight];\n return css`\n ${Platform.OS === 'android' ? 'font-weight: normal;' : undefined}\n font-family: ${fontStyle?.replace('{0}', fontFamily)};\n `;\n};\n\nexport const StyledNativeText = styled(Text)<\n Font & Partial<TextNativeProps> & Partial<StyleProps>\n>(fontStyles);\n"],"names":["css","Platform","styled","Text"],"mappings":";;;;;;;;;;;;AAeO,MAAM,aAAa,CAAC;AAAA,EACzB,KAAA;AAAA,EACA,SAAY,GAAA,SAAA;AAAA,EACZ,UAAa,GAAA,SAAA;AACf,CAA2C,KAAA;AACzC,EAAA,MAAM,UAAa,GAAA,KAAA,EAAO,IAAK,CAAA,KAAA,CAAM,SAAc,CAAA,IAAA,EAAA,CAAA;AACnD,EAAM,MAAA,SAAA,GAAY,KAAO,EAAA,IAAA,CAAK,KAAM,CAAA,UAAA,CAAA,CAAA;AACpC,EAAO,OAAAA,UAAA,CAAA;AAAA,IACH,EAAAC,oBAAA,CAAS,EAAO,KAAA,SAAA,GAAY,sBAAyB,GAAA,KAAA,CAAA,CAAA;AAAA,iBACxC,EAAA,SAAA,EAAW,OAAQ,CAAA,KAAA,EAAO,UAAU,CAAA,CAAA;AAAA,EAAA,CAAA,CAAA;AAEvD,EAAA;AAEO,MAAM,gBAAmB,GAAAC,0BAAA,CAAOC,cAAI,CAAA,CAEzC,UAAU;;;;;"}
|
|
@@ -9,87 +9,32 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
|
|
10
10
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
39
|
-
target[prop] = source[prop];
|
|
40
|
-
}
|
|
41
|
-
return target;
|
|
42
|
-
};
|
|
43
|
-
const TextArea = (_a) => {
|
|
44
|
-
var _b = _a, {
|
|
45
|
-
label,
|
|
46
|
-
labelColor,
|
|
47
|
-
labelColorVariant,
|
|
48
|
-
labelColorTone,
|
|
49
|
-
labelTypography,
|
|
50
|
-
labelStack,
|
|
51
|
-
labelWeight,
|
|
52
|
-
leftComponent,
|
|
53
|
-
rightComponent,
|
|
54
|
-
disabled,
|
|
55
|
-
style,
|
|
56
|
-
borderColor,
|
|
57
|
-
borderColorGradation,
|
|
58
|
-
inputFontStack = "default",
|
|
59
|
-
inputFontWeight = "bold",
|
|
60
|
-
inputContainerStyle,
|
|
61
|
-
variant = "default",
|
|
62
|
-
hintComponent,
|
|
63
|
-
hint,
|
|
64
|
-
onFocus,
|
|
65
|
-
onBlur,
|
|
66
|
-
value,
|
|
67
|
-
maxLength
|
|
68
|
-
} = _b, rest = __objRest(_b, [
|
|
69
|
-
"label",
|
|
70
|
-
"labelColor",
|
|
71
|
-
"labelColorVariant",
|
|
72
|
-
"labelColorTone",
|
|
73
|
-
"labelTypography",
|
|
74
|
-
"labelStack",
|
|
75
|
-
"labelWeight",
|
|
76
|
-
"leftComponent",
|
|
77
|
-
"rightComponent",
|
|
78
|
-
"disabled",
|
|
79
|
-
"style",
|
|
80
|
-
"borderColor",
|
|
81
|
-
"borderColorGradation",
|
|
82
|
-
"inputFontStack",
|
|
83
|
-
"inputFontWeight",
|
|
84
|
-
"inputContainerStyle",
|
|
85
|
-
"variant",
|
|
86
|
-
"hintComponent",
|
|
87
|
-
"hint",
|
|
88
|
-
"onFocus",
|
|
89
|
-
"onBlur",
|
|
90
|
-
"value",
|
|
91
|
-
"maxLength"
|
|
92
|
-
]);
|
|
12
|
+
const TextArea = ({
|
|
13
|
+
label,
|
|
14
|
+
labelColor,
|
|
15
|
+
labelColorVariant,
|
|
16
|
+
labelColorTone,
|
|
17
|
+
labelTypography,
|
|
18
|
+
labelStack,
|
|
19
|
+
labelWeight,
|
|
20
|
+
leftComponent,
|
|
21
|
+
rightComponent,
|
|
22
|
+
disabled,
|
|
23
|
+
style,
|
|
24
|
+
borderColor,
|
|
25
|
+
borderColorGradation,
|
|
26
|
+
inputFontStack = "default",
|
|
27
|
+
inputFontWeight = "bold",
|
|
28
|
+
inputContainerStyle,
|
|
29
|
+
variant = "default",
|
|
30
|
+
hintComponent,
|
|
31
|
+
hint,
|
|
32
|
+
onFocus,
|
|
33
|
+
onBlur,
|
|
34
|
+
value,
|
|
35
|
+
maxLength,
|
|
36
|
+
...rest
|
|
37
|
+
}) => {
|
|
93
38
|
const { focused, handleBlur, handleFocus } = reactCore.useInputFocus(
|
|
94
39
|
onFocus,
|
|
95
40
|
onBlur,
|
|
@@ -118,7 +63,8 @@ const TextArea = (_a) => {
|
|
|
118
63
|
style,
|
|
119
64
|
TextComponent: Text,
|
|
120
65
|
maxLength
|
|
121
|
-
}, /* @__PURE__ */ React__default["default"].createElement(styled.StyledNativeInput,
|
|
66
|
+
}, /* @__PURE__ */ React__default["default"].createElement(styled.StyledNativeInput, {
|
|
67
|
+
...rest,
|
|
122
68
|
fontStack: inputFontStack,
|
|
123
69
|
fontWeight: inputFontWeight,
|
|
124
70
|
disabled,
|
|
@@ -128,7 +74,7 @@ const TextArea = (_a) => {
|
|
|
128
74
|
multiline: true,
|
|
129
75
|
value,
|
|
130
76
|
maxLength
|
|
131
|
-
}))
|
|
77
|
+
}));
|
|
132
78
|
};
|
|
133
79
|
|
|
134
80
|
module.exports = TextArea;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","sources":["../../../../../src/components/atoms/TextArea/TextArea.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport {\n useInputFocus,\n TextAreaProps as ITACore,\n TextArea as TACore,\n} from '@tecsinapse/react-core';\nimport { Text } from '../Text';\nimport { StyledNativeInput } from './styled';\n\nexport type TextAreaProps = Omit<ITACore, 'TextComponent' | 'focused'>;\n\nconst TextArea: FC<TextAreaProps> = ({\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 inputFontStack = 'default',\n inputFontWeight = 'bold',\n inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n onFocus,\n onBlur,\n value,\n maxLength,\n ...rest\n}) => {\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n return (\n <TACore\n label={label}\n labelColor={labelColor}\n labelColorVariant={labelColorVariant}\n labelColorTone={labelColorTone}\n labelTypography={labelTypography}\n labelStack={labelStack}\n labelWeight={labelWeight}\n LabelComponent={Text}\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 value={value}\n hintComponent={hintComponent}\n hint={hint}\n style={style}\n TextComponent={Text}\n maxLength={maxLength}\n >\n <StyledNativeInput\n {...rest}\n fontStack={inputFontStack}\n fontWeight={inputFontWeight}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n textAlignVertical={'top'}\n multiline\n value={value}\n maxLength={maxLength}\n />\n </TACore>\n );\n};\n\nexport default TextArea;\n"],"names":["useInputFocus","React","TACore","StyledNativeInput"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextArea.js","sources":["../../../../../src/components/atoms/TextArea/TextArea.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport {\n useInputFocus,\n TextAreaProps as ITACore,\n TextArea as TACore,\n} from '@tecsinapse/react-core';\nimport { Text } from '../Text';\nimport { StyledNativeInput } from './styled';\n\nexport type TextAreaProps = Omit<ITACore, 'TextComponent' | 'focused'>;\n\nconst TextArea: FC<TextAreaProps> = ({\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 inputFontStack = 'default',\n inputFontWeight = 'bold',\n inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n onFocus,\n onBlur,\n value,\n maxLength,\n ...rest\n}) => {\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n return (\n <TACore\n label={label}\n labelColor={labelColor}\n labelColorVariant={labelColorVariant}\n labelColorTone={labelColorTone}\n labelTypography={labelTypography}\n labelStack={labelStack}\n labelWeight={labelWeight}\n LabelComponent={Text}\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 value={value}\n hintComponent={hintComponent}\n hint={hint}\n style={style}\n TextComponent={Text}\n maxLength={maxLength}\n >\n <StyledNativeInput\n {...rest}\n fontStack={inputFontStack}\n fontWeight={inputFontWeight}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n textAlignVertical={'top'}\n multiline\n value={value}\n maxLength={maxLength}\n />\n </TACore>\n );\n};\n\nexport default TextArea;\n"],"names":["useInputFocus","React","TACore","StyledNativeInput"],"mappings":";;;;;;;;;;;AAWA,MAAM,WAA8B,CAAC;AAAA,EACnC,KAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,oBAAA;AAAA,EACA,cAAiB,GAAA,SAAA;AAAA,EACjB,eAAkB,GAAA,MAAA;AAAA,EAClB,mBAAA;AAAA,EACA,OAAU,GAAA,SAAA;AAAA,EACV,aAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACG,GAAA,IAAA;AACL,CAAM,KAAA;AACJ,EAAA,MAAM,EAAE,OAAA,EAAS,UAAY,EAAA,WAAA,EAAgB,GAAAA,uBAAA;AAAA,IAC3C,OAAA;AAAA,IACA,MAAA;AAAA,IACA,CAAC,QAAA;AAAA,GACH,CAAA;AAEA,EAAA,uBACGC,yBAAA,CAAA,aAAA,CAAAC,kBAAA,EAAA;AAAA,IACC,KAAA;AAAA,IACA,UAAA;AAAA,IACA,iBAAA;AAAA,IACA,cAAA;AAAA,IACA,eAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,cAAgB,EAAA,IAAA;AAAA,IAChB,aAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,oBAAA;AAAA,IACA,mBAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,IACA,aAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,aAAe,EAAA,IAAA;AAAA,IACf,SAAA;AAAA,GAAA,kBAECD,yBAAA,CAAA,aAAA,CAAAE,wBAAA,EAAA;AAAA,IACE,GAAG,IAAA;AAAA,IACJ,SAAW,EAAA,cAAA;AAAA,IACX,UAAY,EAAA,eAAA;AAAA,IACZ,QAAA;AAAA,IACA,OAAS,EAAA,WAAA;AAAA,IACT,MAAQ,EAAA,UAAA;AAAA,IACR,iBAAmB,EAAA,KAAA;AAAA,IACnB,SAAS,EAAA,IAAA;AAAA,IACT,KAAA;AAAA,IACA,SAAA;AAAA,GACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|