@tecsinapse/react-core 1.15.1 → 1.16.2
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 +30 -0
- package/dist/components/atoms/Avatar/Avatar.js +1 -3
- package/dist/components/atoms/Avatar/Avatar.js.map +1 -1
- package/dist/components/atoms/Avatar/helpers.js +1 -3
- package/dist/components/atoms/Avatar/helpers.js.map +1 -1
- package/dist/components/atoms/Avatar/index.js +5 -15
- package/dist/components/atoms/Avatar/index.js.map +1 -1
- package/dist/components/atoms/Avatar/styled.js +1 -3
- package/dist/components/atoms/Avatar/styled.js.map +1 -1
- package/dist/components/atoms/Badge/Badge.js +1 -3
- package/dist/components/atoms/Badge/Badge.js.map +1 -1
- package/dist/components/atoms/Badge/index.js +5 -15
- package/dist/components/atoms/Badge/index.js.map +1 -1
- package/dist/components/atoms/Badge/styled.js +1 -3
- package/dist/components/atoms/Badge/styled.js.map +1 -1
- package/dist/components/atoms/BoxContent/BoxContent.js +1 -3
- package/dist/components/atoms/BoxContent/BoxContent.js.map +1 -1
- package/dist/components/atoms/BoxContent/index.js +5 -15
- package/dist/components/atoms/BoxContent/index.js.map +1 -1
- package/dist/components/atoms/BoxContent/styled.js +2 -4
- package/dist/components/atoms/BoxContent/styled.js.map +1 -1
- package/dist/components/atoms/Button/Button.js +1 -3
- package/dist/components/atoms/Button/Button.js.map +1 -1
- package/dist/components/atoms/Button/States/BaseState.js +1 -3
- package/dist/components/atoms/Button/States/BaseState.js.map +1 -1
- package/dist/components/atoms/Button/States/Error.js +1 -3
- package/dist/components/atoms/Button/States/Error.js.map +1 -1
- package/dist/components/atoms/Button/States/Loading.js +1 -3
- package/dist/components/atoms/Button/States/Loading.js.map +1 -1
- package/dist/components/atoms/Button/States/Success.js +1 -3
- package/dist/components/atoms/Button/States/Success.js.map +1 -1
- package/dist/components/atoms/Button/States/index.js +8 -21
- package/dist/components/atoms/Button/States/index.js.map +1 -1
- package/dist/components/atoms/Button/States/styled.js +1 -3
- package/dist/components/atoms/Button/States/styled.js.map +1 -1
- package/dist/components/atoms/Button/index.js +12 -51
- package/dist/components/atoms/Button/index.js.map +1 -1
- package/dist/components/atoms/Button/styled.js +1 -3
- package/dist/components/atoms/Button/styled.js.map +1 -1
- package/dist/components/atoms/Card/Card.js +1 -3
- package/dist/components/atoms/Card/Card.js.map +1 -1
- package/dist/components/atoms/Card/Footer/Footer.js +1 -3
- package/dist/components/atoms/Card/Footer/Footer.js.map +1 -1
- package/dist/components/atoms/Card/Footer/index.js +5 -15
- package/dist/components/atoms/Card/Footer/index.js.map +1 -1
- package/dist/components/atoms/Card/Header/Header.js +1 -3
- package/dist/components/atoms/Card/Header/Header.js.map +1 -1
- package/dist/components/atoms/Card/Header/index.js +5 -15
- package/dist/components/atoms/Card/Header/index.js.map +1 -1
- package/dist/components/atoms/Card/index.js +5 -15
- package/dist/components/atoms/Card/index.js.map +1 -1
- package/dist/components/atoms/Card/styled.js +1 -3
- package/dist/components/atoms/Card/styled.js.map +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js +1 -3
- package/dist/components/atoms/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/atoms/Checkbox/index.js +5 -15
- package/dist/components/atoms/Checkbox/index.js.map +1 -1
- package/dist/components/atoms/Checkbox/styled.js +1 -3
- package/dist/components/atoms/Checkbox/styled.js.map +1 -1
- package/dist/components/atoms/Divider/Divider.js +1 -3
- package/dist/components/atoms/Divider/Divider.js.map +1 -1
- package/dist/components/atoms/Divider/index.js +5 -15
- package/dist/components/atoms/Divider/index.js.map +1 -1
- package/dist/components/atoms/Divider/styled.js +1 -3
- package/dist/components/atoms/Divider/styled.js.map +1 -1
- package/dist/components/atoms/GroupButton/GroupButton.js +7 -9
- package/dist/components/atoms/GroupButton/GroupButton.js.map +1 -1
- package/dist/components/atoms/GroupButton/GroupButtonOption.js +1 -3
- package/dist/components/atoms/GroupButton/GroupButtonOption.js.map +1 -1
- package/dist/components/atoms/GroupButton/index.js +9 -33
- package/dist/components/atoms/GroupButton/index.js.map +1 -1
- package/dist/components/atoms/GroupButton/styled.js +12 -14
- package/dist/components/atoms/GroupButton/styled.js.map +1 -1
- package/dist/components/atoms/Icon/Icon.js +1 -3
- package/dist/components/atoms/Icon/Icon.js.map +1 -1
- package/dist/components/atoms/Icon/helpers.js +1 -3
- package/dist/components/atoms/Icon/helpers.js.map +1 -1
- package/dist/components/atoms/Icon/index.js +5 -15
- package/dist/components/atoms/Icon/index.js.map +1 -1
- package/dist/components/atoms/Input/Hint.js +1 -3
- package/dist/components/atoms/Input/Hint.js.map +1 -1
- package/dist/components/atoms/Input/InputContainer/InputContainer.js +1 -3
- package/dist/components/atoms/Input/InputContainer/InputContainer.js.map +1 -1
- package/dist/components/atoms/Input/InputElement/InputElement.d.ts +2 -5
- package/dist/components/atoms/Input/InputElement/InputElement.js +5 -49
- package/dist/components/atoms/Input/InputElement/InputElement.js.map +1 -1
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.d.ts +17 -0
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js +84 -0
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js.map +1 -0
- package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js +1 -3
- package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js.map +1 -1
- package/dist/components/atoms/Input/PressableInputContainer/index.js +5 -15
- package/dist/components/atoms/Input/PressableInputContainer/index.js.map +1 -1
- package/dist/components/atoms/Input/PressableInputContainer/styled.js +1 -3
- package/dist/components/atoms/Input/PressableInputContainer/styled.js.map +1 -1
- package/dist/components/atoms/Input/hooks/useInputFocus.js +1 -3
- package/dist/components/atoms/Input/hooks/useInputFocus.js.map +1 -1
- package/dist/components/atoms/Input/hooks/useNumberMask.js +3 -5
- package/dist/components/atoms/Input/hooks/useNumberMask.js.map +1 -1
- package/dist/components/atoms/Input/hooks/useStringMask.js +3 -5
- package/dist/components/atoms/Input/hooks/useStringMask.js.map +1 -1
- package/dist/components/atoms/Input/index.d.ts +1 -0
- package/dist/components/atoms/Input/index.js +28 -82
- package/dist/components/atoms/Input/index.js.map +1 -1
- package/dist/components/atoms/Input/styled.js +4 -6
- package/dist/components/atoms/Input/styled.js.map +1 -1
- package/dist/components/atoms/Paper/Paper.js +1 -3
- package/dist/components/atoms/Paper/Paper.js.map +1 -1
- package/dist/components/atoms/Paper/index.js +5 -15
- package/dist/components/atoms/Paper/index.js.map +1 -1
- package/dist/components/atoms/Paper/styled.js +1 -3
- package/dist/components/atoms/Paper/styled.js.map +1 -1
- package/dist/components/atoms/PressableSurface/PressableSurface.js +1 -3
- package/dist/components/atoms/PressableSurface/PressableSurface.js.map +1 -1
- package/dist/components/atoms/PressableSurface/index.js +5 -15
- package/dist/components/atoms/PressableSurface/index.js.map +1 -1
- package/dist/components/atoms/ProgressBar/ProgressBar.js +4 -8
- package/dist/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/atoms/ProgressBar/index.js +5 -15
- package/dist/components/atoms/ProgressBar/index.js.map +1 -1
- package/dist/components/atoms/ProgressBar/styled.js +1 -3
- package/dist/components/atoms/ProgressBar/styled.js.map +1 -1
- package/dist/components/atoms/RadioButton/RadioButton.js +1 -3
- package/dist/components/atoms/RadioButton/RadioButton.js.map +1 -1
- package/dist/components/atoms/RadioButton/index.js +5 -15
- package/dist/components/atoms/RadioButton/index.js.map +1 -1
- package/dist/components/atoms/RadioButton/styled.js +1 -3
- package/dist/components/atoms/RadioButton/styled.js.map +1 -1
- package/dist/components/atoms/Switch/Switch.js +1 -3
- package/dist/components/atoms/Switch/Switch.js.map +1 -1
- package/dist/components/atoms/Switch/animation.js +1 -3
- package/dist/components/atoms/Switch/animation.js.map +1 -1
- package/dist/components/atoms/Switch/index.js +5 -15
- package/dist/components/atoms/Switch/index.js.map +1 -1
- package/dist/components/atoms/Switch/styled.js +1 -3
- package/dist/components/atoms/Switch/styled.js.map +1 -1
- package/dist/components/atoms/Tag/Tag.js +2 -4
- package/dist/components/atoms/Tag/Tag.js.map +1 -1
- package/dist/components/atoms/Tag/index.js +5 -15
- package/dist/components/atoms/Tag/index.js.map +1 -1
- package/dist/components/atoms/Tag/styled.js +1 -3
- package/dist/components/atoms/Tag/styled.js.map +1 -1
- package/dist/components/atoms/Text/Text.d.ts +2 -0
- package/dist/components/atoms/Text/Text.js +8 -5
- package/dist/components/atoms/Text/Text.js.map +1 -1
- package/dist/components/atoms/Text/functions.d.ts +2 -0
- package/dist/components/atoms/Text/functions.js +13 -0
- package/dist/components/atoms/Text/functions.js.map +1 -0
- package/dist/components/atoms/Text/index.js +5 -15
- package/dist/components/atoms/Text/index.js.map +1 -1
- package/dist/components/atoms/Text/styled.js +4 -3
- package/dist/components/atoms/Text/styled.js.map +1 -1
- package/dist/components/atoms/shared/PaperAndCard.js +1 -3
- package/dist/components/atoms/shared/PaperAndCard.js.map +1 -1
- package/dist/components/molecules/Calendar/Calendar.js +3 -5
- package/dist/components/molecules/Calendar/Calendar.js.map +1 -1
- package/dist/components/molecules/Calendar/components/MonthWeek.js +4 -6
- package/dist/components/molecules/Calendar/components/MonthWeek.js.map +1 -1
- package/dist/components/molecules/Calendar/components/Weekdays.js +1 -3
- package/dist/components/molecules/Calendar/components/Weekdays.js.map +1 -1
- package/dist/components/molecules/Calendar/components/index.js +6 -15
- package/dist/components/molecules/Calendar/components/index.js.map +1 -1
- package/dist/components/molecules/Calendar/index.js +8 -33
- package/dist/components/molecules/Calendar/index.js.map +1 -1
- package/dist/components/molecules/Calendar/styled.js +4 -6
- package/dist/components/molecules/Calendar/styled.js.map +1 -1
- package/dist/components/molecules/DatePicker/DatePicker.js +1 -3
- package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/molecules/DatePicker/index.js +5 -15
- package/dist/components/molecules/DatePicker/index.js.map +1 -1
- package/dist/components/molecules/DatePicker/styled.js +2 -4
- package/dist/components/molecules/DatePicker/styled.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/DateTimePicker.js +2 -4
- package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/index.js +5 -15
- package/dist/components/molecules/DateTimePicker/index.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/styled.js +1 -3
- package/dist/components/molecules/DateTimePicker/styled.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js +2 -4
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/Selector.js +1 -3
- package/dist/components/molecules/DateTimeSelector/Selector.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/index.js +6 -21
- package/dist/components/molecules/DateTimeSelector/index.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/styled.js +1 -3
- package/dist/components/molecules/DateTimeSelector/styled.js.map +1 -1
- package/dist/components/molecules/Grid/Grid.js +3 -5
- package/dist/components/molecules/Grid/Grid.js.map +1 -1
- package/dist/components/molecules/Grid/Item/Item.js +4 -6
- package/dist/components/molecules/Grid/Item/Item.js.map +1 -1
- package/dist/components/molecules/Grid/Item/index.js +5 -15
- package/dist/components/molecules/Grid/Item/index.js.map +1 -1
- package/dist/components/molecules/Grid/index.js +8 -27
- package/dist/components/molecules/Grid/index.js.map +1 -1
- package/dist/components/molecules/HintInputContainer/HintInputContainer.js +1 -3
- package/dist/components/molecules/HintInputContainer/HintInputContainer.js.map +1 -1
- package/dist/components/molecules/HintInputContainer/index.js +4 -9
- package/dist/components/molecules/HintInputContainer/index.js.map +1 -1
- package/dist/components/molecules/InputPassword/InputPasswordIcon.js +1 -3
- package/dist/components/molecules/InputPassword/InputPasswordIcon.js.map +1 -1
- package/dist/components/molecules/InputPassword/index.js +4 -9
- package/dist/components/molecules/InputPassword/index.js.map +1 -1
- package/dist/components/molecules/InputPassword/styled.js +1 -3
- package/dist/components/molecules/InputPassword/styled.js.map +1 -1
- package/dist/components/molecules/Snackbar/Snackbar.js +3 -5
- package/dist/components/molecules/Snackbar/Snackbar.js.map +1 -1
- package/dist/components/molecules/Snackbar/index.js +5 -15
- package/dist/components/molecules/Snackbar/index.js.map +1 -1
- package/dist/components/molecules/Snackbar/styled.js +1 -3
- package/dist/components/molecules/Snackbar/styled.js.map +1 -1
- package/dist/components/molecules/TextArea/TextArea.js +1 -3
- package/dist/components/molecules/TextArea/TextArea.js.map +1 -1
- package/dist/components/molecules/TextArea/index.js +7 -21
- package/dist/components/molecules/TextArea/index.js.map +1 -1
- package/dist/components/molecules/TextArea/styled.js +1 -3
- package/dist/components/molecules/TextArea/styled.js.map +1 -1
- package/dist/hooks/index.js +6 -15
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useDebouncedState.js +1 -3
- package/dist/hooks/useDebouncedState.js.map +1 -1
- package/dist/hooks/useTheme.js +1 -3
- package/dist/hooks/useTheme.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +123 -531
- package/dist/index.js.map +1 -1
- package/dist/styles/ThemeProvider.js +1 -3
- package/dist/styles/ThemeProvider.js.map +1 -1
- package/dist/styles/definitions.js +1 -3
- package/dist/styles/definitions.js.map +1 -1
- package/dist/styles/light.js +1 -3
- package/dist/styles/light.js.map +1 -1
- package/dist/types/defaults.d.ts +2 -0
- package/dist/types/defaults.js +1 -3
- package/dist/utils/IPhoneXHelper.js +1 -3
- package/dist/utils/IPhoneXHelper.js.map +1 -1
- package/dist/utils/ResponsiveFontSize.js +1 -3
- package/dist/utils/ResponsiveFontSize.js.map +1 -1
- package/dist/utils/extractNumbersFromString.js +1 -3
- package/dist/utils/extractNumbersFromString.js.map +1 -1
- package/dist/utils/formatWithMask.js +1 -3
- package/dist/utils/formatWithMask.js.map +1 -1
- package/dist/utils/index.js +11 -45
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/lightenDarkenColor.js +1 -3
- package/dist/utils/lightenDarkenColor.js.map +1 -1
- package/dist/utils/masks.js +3 -5
- package/dist/utils/masks.js.map +1 -1
- package/package.json +2 -2
- package/src/components/atoms/Input/InputElement/InputElement.tsx +5 -74
- package/src/components/atoms/Input/InputMaskElement/InputMaskElement.tsx +120 -0
- package/src/components/atoms/Input/hooks/useNumberMask.ts +1 -1
- package/src/components/atoms/Input/index.ts +4 -0
- package/src/components/atoms/Input/styled.ts +1 -1
- package/src/components/atoms/ProgressBar/ProgressBar.tsx +2 -1
- package/src/components/atoms/Text/Text.tsx +7 -1
- package/src/components/atoms/Text/functions.ts +8 -0
- package/src/components/atoms/Text/styled.ts +1 -0
- package/src/index.ts +2 -0
- package/src/types/defaults.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/ProgressBar/ProgressBar.tsx"],"names":["ProgressBar","segments","_segments","valueMin","valueNow","_valueNow","valueMax","color","colorTone","animate","animationParameters","rest","theme","
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/ProgressBar/ProgressBar.tsx"],"names":["ProgressBar","segments","_segments","valueMin","valueNow","_valueNow","valueMax","color","colorTone","animate","animationParameters","rest","theme","animationValue","React","useRef","Animated","Value","current","totalProgress","Math","max","segmentWidth","items","Array","keys","segmentsRender","map","index","min","minmax","width","progressPercent","timing","toValue","duration","length","useNativeDriver","delay","direction","start","rangeAnimation","interpolate","inputRange","outputRange","borderRightWidth","backgroundColor"],"mappings":"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","sourcesContent":["import { useTheme } from '@emotion/react';\nimport * as React from 'react';\nimport { Animated, ViewProps } from 'react-native';\nimport {\n ColorGradationType,\n ColorType,\n ThemeProp\n} from '../../../types/defaults';\nimport { extractNumbersFromString } from '../../../utils';\nimport { Container, Progress, Segment } from './styled';\n\nexport interface ProgressBarProps extends ViewProps {\n /** Number of segments. Defaults to 1. Set to 1 when 0 or less */\n segments?: number;\n /** Minimum possible value (0% of the bar). Defaults to 0 */\n valueMin?: number;\n /** Maximum possible value (100% of the bar). Defaults to 100 */\n valueMax?: number;\n /** Current value */\n valueNow: number | string;\n /** Filled partition color. Defaults to 'primary' */\n color?: ColorType;\n /** Filled partition color tone. Defaults to 'medium' */\n colorTone?: ColorGradationType;\n /** Animation */\n animate: boolean;\n /** Parameters animation */\n animationParameters?: { direction: 'left' | 'right'; duration: number };\n}\n\nconst ProgressBar: React.FC<ProgressBarProps> = ({\n segments: _segments = 1,\n valueMin = 0,\n valueNow: _valueNow,\n valueMax = 100,\n color = 'primary',\n colorTone = 'medium',\n animate,\n animationParameters,\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n const animationValue = React.useRef(new Animated.Value(0)).current;\n\n const valueNow =\n typeof _valueNow === 'string'\n ? extractNumbersFromString(_valueNow)\n : _valueNow;\n\n const totalProgress = ((valueNow - valueMin) / (valueMax - valueMin)) * 100;\n const segments = Math.max(1, _segments);\n const segmentWidth = 100 / Math.max(segments);\n\n const items = [...Array(segments).keys()];\n\n const segmentsRender = items.map(index => {\n \n\n const max = segmentWidth * (index + 1);\n const min = segmentWidth * index;\n const minmax = (totalProgress - min) / (max - min);\n const width = (minmax > 1 ? 1 : minmax < 0 ? 0 : minmax) * 100;\n\n let progressPercent: string | Animated.AnimatedInterpolation = `${width}%`;\n\n if (animate && animationParameters) {\n Animated.timing(animationValue, {\n toValue: 1,\n duration: animationParameters.duration / items.length,\n useNativeDriver: false,\n delay:\n animationParameters.direction === 'right'\n ? index * (animationParameters.duration / items.length)\n : (items.length - index - 1) *\n (animationParameters.duration / items.length),\n }).start();\n\n const rangeAnimation =\n animationParameters?.direction === 'right'\n ? [`${valueMin < 0 ? 0 : valueMin}%`, `${width}%`]\n : [`${valueMax}%`, `${width}%`];\n\n progressPercent = animationValue.interpolate?.({\n inputRange: [0, 1],\n outputRange: rangeAnimation,\n });\n }\n\n return (\n <Segment\n key={index}\n style={{\n borderRightWidth: index == segments - 1 ? 0 : 2,\n }}\n >\n <Progress\n style={{\n width: progressPercent,\n backgroundColor: theme.color[color][colorTone],\n borderRightWidth: width > 0 && width < 100 ? 2 : 0,\n }}\n />\n </Segment>\n );\n });\n\n return <Container {...rest}>{segmentsRender}</Container>;\n};\n\nexport default ProgressBar;\n"],"file":"ProgressBar.js"}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "ProgressBar", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _ProgressBar.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "ProgressBarProps", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _ProgressBar.ProgressBarProps;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.ProgressBarProps = exports.ProgressBar = void 0;
|
|
18
5
|
|
|
19
6
|
var _ProgressBar = _interopRequireWildcard(require("./ProgressBar"));
|
|
20
7
|
|
|
8
|
+
exports.ProgressBar = _ProgressBar.default;
|
|
9
|
+
exports.ProgressBarProps = _ProgressBar.ProgressBarProps;
|
|
10
|
+
|
|
21
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); }
|
|
22
12
|
|
|
23
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; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/ProgressBar/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/ProgressBar/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as ProgressBar, ProgressBarProps } from './ProgressBar';\n"],"file":"index.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/ProgressBar/styled.ts"],"names":["Container","styled","View","theme","spacing","mili","Segment","color","secondary","light","xlight","Progress","Animated"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/ProgressBar/styled.ts"],"names":["Container","styled","View","theme","spacing","mili","Segment","color","secondary","light","xlight","Progress","Animated"],"mappings":";;;;;AAAA;;AACA;;AAEA;;;;AAEO,MAAMA,SAAS,GAAGC,gBAAOC,IAA0B;AAC1D;AACA,YAAY,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAcC,IAAK;AAC9C,mBAAmB,CAAC;AAAEF,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAcC,IAAK;AACrD;AACA;AACA;AACA,CAPO;;AASA,MAAMC,OAAO,GAAGL,gBAAOC,IAA0B;AACxD;AACA,sBAAsB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,KAAN,CAAYC,SAAZ,CAAsBC,KAAM;AACjE,wBAAwB,uBAAW,KAAX,CAAkB;AAC1C,kBAAkB,CAAC;AAAEN,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,KAAN,CAAYC,SAAZ,CAAsBE,MAAO;AAC9D,CALO;;AAOA,MAAMC,QAAQ,GAAG,qBAAOC,sBAASV,IAAhB,CAA2C;AACnE;AACA,kBAAkB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,KAAN,CAAYC,SAAZ,CAAsBE,MAAO;AAC9D,CAHO","sourcesContent":["import styled from '@emotion/native';\nimport { Animated } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { RFValueStr } from '../../../utils';\n\nexport const Container = styled.View<Partial<StyleProps>>`\n display: flex;\n height: ${({ theme }) => theme.spacing.mili};\n border-radius: ${({ theme }) => theme.spacing.mili};\n width: 100%;\n flex-direction: row;\n overflow: hidden;\n`;\n\nexport const Segment = styled.View<Partial<StyleProps>>`\n flex: 1;\n background-color: ${({ theme }) => theme.color.secondary.light};\n border-right-width: ${RFValueStr('2px')};\n border-color: ${({ theme }) => theme.color.secondary.xlight};\n`;\n\nexport const Progress = styled(Animated.View)<Partial<StyleProps>>`\n height: 100%;\n border-color: ${({ theme }) => theme.color.secondary.xlight};\n`;\n"],"file":"styled.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/RadioButton/RadioButton.tsx"],"names":["RadioButton","children","onChange","checked","labelPosition","disabled","color","colorTone","rest","handleChange"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/RadioButton/RadioButton.tsx"],"names":["RadioButton","children","onChange","checked","labelPosition","disabled","color","colorTone","rest","handleChange"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAkBA,MAAMA,WAAiC,GAAG,CAAC;AACzCC,EAAAA,QADyC;AAEzCC,EAAAA,QAFyC;AAGzCC,EAAAA,OAHyC;AAIzCC,EAAAA,aAAa,GAAG,OAJyB;AAKzCC,EAAAA,QAAQ,GAAG,KAL8B;AAMzCC,EAAAA,KAAK,GAAG,SANiC;AAOzCC,EAAAA,SAAS,GAAG,QAP6B;AAQzC,KAAGC;AARsC,CAAD,KASvB;AACjB,QAAMC,YAAY,GAAG,MAAM;AACzBP,IAAAA,QAAQ,IAAIA,QAAQ,CAAC,CAACC,OAAF,CAApB;AACD,GAFD;;AAIA,SACE,6BAAC,sBAAD,eACMK,IADN;AAEE,IAAA,QAAQ,EAAEH,QAFZ;AAGE,IAAA,OAAO,EAAEI,YAHX;AAIE,IAAA,iBAAiB,EAAC;AAJpB,MAME,6BAAC,kBAAD,QACGL,aAAa,KAAK,MAAlB,IAA4BH,QAD/B,EAEGE,OAAO,IACN,6BAAC,sBAAD,QACE,6BAAC,mBAAD,QACE,6BAAC,kBAAD,QACE,6BAAC,UAAD;AACE,IAAA,IAAI,EAAC,QADP;AAEE,IAAA,YAAY,EAAEG,KAFhB;AAGE,IAAA,SAAS,EAAEC,SAHb;AAIE,IAAA,IAAI,EAAC,oBAJP;AAKE,IAAA,IAAI,EAAC;AALP,IADF,CADF,CADF,CAHJ,EAiBG,CAACJ,OAAD,IACC,6BAAC,sBAAD,QACE,6BAAC,mBAAD,QACE,6BAAC,kBAAD,QACE,6BAAC,UAAD;AACE,IAAA,IAAI,EAAC,QADP;AAEE,IAAA,SAAS,EAAC,OAFZ;AAGE,IAAA,IAAI,EAAC,oBAHP;AAIE,IAAA,IAAI,EAAC;AAJP,IADF,CADF,CADF,CAlBJ,EA+BGC,aAAa,KAAK,OAAlB,IAA6BH,QA/BhC,CANF,CADF;AA0CD,CAxDD;;eA0DeD,W","sourcesContent":["import React, { FC } from 'react';\nimport { Pressable, StyleProp, ViewStyle } from 'react-native';\nimport { ColorGradationType, ColorType } from '../../../types/defaults';\nimport { Icon } from '../Icon';\nimport { IconViewStyled, IconWrapper, ScaledView, ViewStyled } from './styled';\n\nexport interface RadioButtonProps {\n /** Element is checked */\n checked?: boolean;\n /** Change handler */\n onChange?: (checked: boolean) => void;\n /** Position of children */\n labelPosition?: 'left' | 'right';\n /** Element is not clickable */\n disabled?: boolean;\n /** Color definition from theme */\n color?: ColorType;\n /** Color gradation from theme */\n colorTone?: ColorGradationType;\n style?: StyleProp<ViewStyle>;\n}\n\nconst RadioButton: FC<RadioButtonProps> = ({\n children,\n onChange,\n checked,\n labelPosition = 'right',\n disabled = false,\n color = 'primary',\n colorTone = 'medium',\n ...rest\n}): JSX.Element => {\n const handleChange = () => {\n onChange && onChange(!checked);\n };\n\n return (\n <Pressable\n {...rest}\n disabled={disabled}\n onPress={handleChange}\n accessibilityRole=\"radio\"\n >\n <ViewStyled>\n {labelPosition === 'left' && children}\n {checked && (\n <IconViewStyled>\n <IconWrapper>\n <ScaledView>\n <Icon\n name=\"circle\"\n colorVariant={color}\n colorTone={colorTone}\n type=\"material-community\"\n size=\"centi\"\n />\n </ScaledView>\n </IconWrapper>\n </IconViewStyled>\n )}\n {!checked && (\n <IconViewStyled>\n <IconWrapper>\n <ScaledView>\n <Icon\n name=\"circle\"\n fontColor=\"light\"\n type=\"material-community\"\n size=\"centi\"\n />\n </ScaledView>\n </IconWrapper>\n </IconViewStyled>\n )}\n {labelPosition === 'right' && children}\n </ViewStyled>\n </Pressable>\n );\n};\n\nexport default RadioButton;\n"],"file":"RadioButton.js"}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "RadioButton", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _RadioButton.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "RadioButtonProps", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _RadioButton.RadioButtonProps;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.RadioButtonProps = exports.RadioButton = void 0;
|
|
18
5
|
|
|
19
6
|
var _RadioButton = _interopRequireWildcard(require("./RadioButton"));
|
|
20
7
|
|
|
8
|
+
exports.RadioButton = _RadioButton.default;
|
|
9
|
+
exports.RadioButtonProps = _RadioButton.RadioButtonProps;
|
|
10
|
+
|
|
21
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); }
|
|
22
12
|
|
|
23
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; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/RadioButton/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/RadioButton/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as RadioButton, RadioButtonProps } from './RadioButton';\n"],"file":"index.js"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.ViewStyled = exports.IconViewStyled = exports.ScaledView = exports.IconWrapper = void 0;
|
|
7
5
|
|
|
8
6
|
var _native = _interopRequireDefault(require("@emotion/native"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/RadioButton/styled.ts"],"names":["IconWrapper","View","theme","borderRadius","pill","color","colorTone","borderWidth","nano","miscellaneous","surfaceColor","ScaledView","IconViewStyled","spacing","mili","ViewStyled"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/RadioButton/styled.ts"],"names":["IconWrapper","View","theme","borderRadius","pill","color","colorTone","borderWidth","nano","miscellaneous","surfaceColor","ScaledView","IconViewStyled","spacing","mili","ViewStyled"],"mappings":";;;;;AAAA;;AACA;;;;AAIO,MAAMA,WAAW,GAAG,qBAAOC,iBAAP,CAAqD;AAChF,mBAAmB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAA2BA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AACtE,kBAAkB,CAAC;AACfF,EAAAA,KADe;AAEfG,EAAAA,KAAK,GAAG,SAFO;AAGfC,EAAAA,SAAS,GAAG;AAHG,CAAD,KAIqBJ,KAAK,CAACG,KAAN,CAAYA,KAAZ,EAAmBC,SAAnB,CAA8B;AACrE,kBAAkB,CAAC;AAAEJ,EAAAA;AAAF,CAAD,KAA2BA,KAAK,CAACK,WAAN,CAAkBC,IAAK;AACpE,sBAAsB,CAAC;AAAEN,EAAAA;AAAF,CAAD,KAClBA,KAAK,CAACO,aAAN,CAAoBC,YAAa;AACrC,CAVO;;AAYA,MAAMC,UAAU,GAAG,qBAAOV,iBAAP,CAAa;AACvC;AACA,CAFO;;AAIA,MAAMW,cAAc,GAAG,qBAAOX,iBAAP,CAAkC;AAChE,aAAa,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAA2BA,KAAK,CAACW,OAAN,CAAcC,IAAK;AAC3D,CAFO;;AAIA,MAAMC,UAAU,GAAG,qBAAOd,iBAAP,CAAa;AACvC;AACA;AACA,CAHO","sourcesContent":["import styled from '@emotion/native';\nimport { View } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { RadioButtonProps } from './RadioButton';\n\nexport const IconWrapper = styled(View)<Partial<RadioButtonProps & StyleProps>>`\n border-radius: ${({ theme }: StyleProps) => theme.borderRadius.pill};\n border-color: ${({\n theme,\n color = 'primary',\n colorTone = 'medium',\n }: StyleProps & RadioButtonProps) => theme.color[color][colorTone]};\n border-width: ${({ theme }: StyleProps) => theme.borderWidth.nano};\n background-color: ${({ theme }: StyleProps) =>\n theme.miscellaneous.surfaceColor};\n`;\n\nexport const ScaledView = styled(View)`\n transform: scale(0.8);\n`;\n\nexport const IconViewStyled = styled(View)<Partial<StyleProps>>`\n padding: ${({ theme }: StyleProps) => theme.spacing.mili};\n`;\n\nexport const ViewStyled = styled(View)`\n align-items: center;\n flex-direction: row;\n`;\n"],"file":"styled.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Switch/Switch.tsx"],"names":["Switch","onChange","activeColor","activeColorTone","inactiveColor","inactiveColorTone","active","dotStyle","disabled","rest","theme","width","React","useRef","transitionValue","Animated","Value","current","animatedColor","calculateTranslate","spacing","micro","SWITCH_PIN_WIDTH","getBackgroundColor","color","interpolateColor","interpolate","inputRange","outputRange","translate","handleChange","handleSwitchLayout","lce","nativeEvent","layout","backgroundColor","transform","translateX"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Switch/Switch.tsx"],"names":["Switch","onChange","activeColor","activeColorTone","inactiveColor","inactiveColorTone","active","dotStyle","disabled","rest","theme","width","React","useRef","transitionValue","Animated","Value","current","animatedColor","calculateTranslate","spacing","micro","SWITCH_PIN_WIDTH","getBackgroundColor","color","interpolateColor","interpolate","inputRange","outputRange","translate","handleChange","handleSwitchLayout","lce","nativeEvent","layout","backgroundColor","transform","translateX"],"mappings":"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","sourcesContent":["import { useTheme } from '@emotion/react';\nimport React, { FC, useCallback, useEffect } from 'react';\nimport { Animated, LayoutChangeEvent, StyleProp, ViewStyle } from 'react-native';\nimport {\n ColorGradationType,\n ColorType,\n ThemeProp\n} from '../../../types/defaults';\nimport { extractNumbersFromString, lightenDarkenColor, RFValueStr } from '../../../utils';\nimport { PressableSurface } from '../PressableSurface';\nimport { transitionSwitch } from './animation';\nimport { StyledSwitch, StyledSwitchContent, SWITCH_PIN_WIDTH } from './styled';\n\nexport interface SwitchProps {\n onChange: (active: boolean) => void;\n active: boolean;\n activeColor?: ColorType;\n activeColorTone?: ColorGradationType;\n inactiveColor?: ColorType;\n inactiveColorTone?: ColorGradationType;\n style?: StyleProp<ViewStyle>;\n dotStyle?: StyleProp<ViewStyle>;\n disabled?: boolean;\n}\n\nconst Switch: FC<SwitchProps> = ({\n onChange,\n activeColor = 'primary',\n activeColorTone = 'medium',\n inactiveColor = 'secondary',\n inactiveColorTone = 'light',\n active,\n dotStyle,\n disabled = false,\n ...rest\n}): JSX.Element => {\n const theme = useTheme() as ThemeProp;\n\n const width = React.useRef(0)\n const transitionValue = React.useRef(new Animated.Value(0)).current\n const animatedColor = React.useRef(new Animated.Value(0)).current\n \n const calculateTranslate = () => {\n if (width.current > 0) {\n return width.current - (extractNumbersFromString(theme.spacing.micro) * 2) - (extractNumbersFromString(RFValueStr(SWITCH_PIN_WIDTH)))\n }\n return 0\n }\n\n const getBackgroundColor = (color: string) => {\n return disabled ? lightenDarkenColor(theme.color[inactiveColor][inactiveColorTone], 20) : color;\n };\n\n const interpolateColor = animatedColor.interpolate({\n inputRange: [0, 1],\n outputRange: [\n getBackgroundColor(theme.color[inactiveColor][inactiveColorTone]),\n getBackgroundColor(theme.color[activeColor][activeColorTone]),\n ]\n });\n\n useEffect(() => {\n const translate = calculateTranslate()\n transitionSwitch(active, translate, transitionValue, animatedColor);\n }, [active]);\n\n const handleChange = useCallback(() => {\n onChange(!active);\n }, [active, onChange]);\n\n const handleSwitchLayout = (lce: LayoutChangeEvent) => {\n width.current = lce.nativeEvent.layout.width\n const translate = calculateTranslate()\n transitionSwitch(active, translate, transitionValue, animatedColor);\n }\n\n return (\n <PressableSurface\n {...rest}\n onPress={handleChange}\n effect=\"none\"\n disabled={disabled}\n >\n <StyledSwitchContent onLayout={handleSwitchLayout} style={{ backgroundColor: interpolateColor }}>\n <StyledSwitch style={[dotStyle, { transform: [{ translateX: transitionValue }] }]}/>\n </StyledSwitchContent>\n </PressableSurface>\n );\n};\n\nexport default Switch;\n"],"file":"Switch.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Switch/animation.ts"],"names":["ANIMATION_SPEED","transitionSwitch","active","translate","transitionValue","animatedColor","Animated","timing","toValue","duration","easing","Easing","out","ease","useNativeDriver","start"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Switch/animation.ts"],"names":["ANIMATION_SPEED","transitionSwitch","active","translate","transitionValue","animatedColor","Animated","timing","toValue","duration","easing","Easing","out","ease","useNativeDriver","start"],"mappings":";;;;;AAAA;;AAEA,MAAMA,eAAe,GAAG,GAAxB;;AAEO,MAAMC,gBAAgB,GAAG,CAC9BC,MAD8B,EAE9BC,SAF8B,EAG9BC,eAH8B,EAI9BC,aAJ8B,KAKrB;AAET,MAAIF,SAAS,IAAI,CAAjB,EAAoB;;AAEpB,MAAID,MAAJ,EAAY;AACVI,0BAASC,MAAT,CAAgBH,eAAhB,EAAiC;AAC/BI,MAAAA,OAAO,EAAEL,SADsB;AAE/BM,MAAAA,QAAQ,EAAET,eAFqB;AAG/BU,MAAAA,MAAM,EAAEC,oBAAOC,GAAP,CAAWD,oBAAOE,IAAlB,CAHuB;AAI/BC,MAAAA,eAAe,EAAE;AAJc,KAAjC,EAKGC,KALH;;AAMAT,0BAASC,MAAT,CAAgBF,aAAhB,EAA+B;AAC7BG,MAAAA,OAAO,EAAE,CADoB;AAE7BC,MAAAA,QAAQ,EAAET,eAFmB;AAG7Bc,MAAAA,eAAe,EAAE;AAHY,KAA/B,EAIGC,KAJH;;AAKA;AACD;;AAEDT,wBAASC,MAAT,CAAgBH,eAAhB,EAAiC;AAC/BI,IAAAA,OAAO,EAAE,CADsB;AAE/BC,IAAAA,QAAQ,EAAET,eAFqB;AAG/BU,IAAAA,MAAM,EAAEC,oBAAOC,GAAP,CAAWD,oBAAOE,IAAlB,CAHuB;AAI/BC,IAAAA,eAAe,EAAE;AAJc,GAAjC,EAKGC,KALH;;AAMAT,wBAASC,MAAT,CAAgBF,aAAhB,EAA+B;AAC7BG,IAAAA,OAAO,EAAE,CADoB;AAE7BC,IAAAA,QAAQ,EAAET,eAFmB;AAG7Bc,IAAAA,eAAe,EAAE;AAHY,GAA/B,EAIGC,KAJH;AAMD,CApCM","sourcesContent":["import { Animated, Easing } from 'react-native';\n\nconst ANIMATION_SPEED = 140\n\nexport const transitionSwitch = (\n active: boolean,\n translate: number,\n transitionValue: Animated.Value,\n animatedColor: Animated.Value\n): void => {\n\n if (translate <= 0) return\n \n if (active) {\n Animated.timing(transitionValue, {\n toValue: translate,\n duration: ANIMATION_SPEED,\n easing: Easing.out(Easing.ease),\n useNativeDriver: true,\n }).start();\n Animated.timing(animatedColor, {\n toValue: 1,\n duration: ANIMATION_SPEED,\n useNativeDriver: false,\n }).start();\n return\n } \n\n Animated.timing(transitionValue, {\n toValue: 0,\n duration: ANIMATION_SPEED,\n easing: Easing.out(Easing.ease),\n useNativeDriver: true,\n }).start();\n Animated.timing(animatedColor, {\n toValue: 0,\n duration: ANIMATION_SPEED,\n useNativeDriver: false,\n }).start();\n\n};\n"],"file":"animation.js"}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Switch", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _Switch.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "SwitchProps", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _Switch.SwitchProps;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.SwitchProps = exports.Switch = void 0;
|
|
18
5
|
|
|
19
6
|
var _Switch = _interopRequireWildcard(require("./Switch"));
|
|
20
7
|
|
|
8
|
+
exports.Switch = _Switch.default;
|
|
9
|
+
exports.SwitchProps = _Switch.SwitchProps;
|
|
10
|
+
|
|
21
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); }
|
|
22
12
|
|
|
23
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; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Switch/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Switch/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as Switch, SwitchProps } from './Switch';\n"],"file":"index.js"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.StyledSwitch = exports.StyledSwitchContent = exports.SWITCH_PIN_WIDTH = exports.SWITCH_BODY_WIDTH = void 0;
|
|
7
5
|
|
|
8
6
|
var _native = _interopRequireDefault(require("@emotion/native"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Switch/styled.ts"],"names":["SWITCH_BODY_WIDTH","SWITCH_PIN_WIDTH","StyledSwitchContent","Animated","View","theme","borderRadius","pill","spacing","micro","StyledSwitch","miscellaneous","surfaceColor"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Switch/styled.ts"],"names":["SWITCH_BODY_WIDTH","SWITCH_PIN_WIDTH","StyledSwitchContent","Animated","View","theme","borderRadius","pill","spacing","micro","StyledSwitch","miscellaneous","surfaceColor"],"mappings":";;;;;AAAA;;AACA;;AAEA;;;;AAEO,MAAMA,iBAAiB,GAAG,MAA1B;;AACA,MAAMC,gBAAgB,GAAG,MAAzB;;AAEA,MAAMC,mBAAmB,GAAG,qBAAOC,sBAASC,IAAhB,CAEjC;AACF,mBAAmB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AAC1D,eAAe,CAAC;AAAEF,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACG,OAAN,CAAcC,KAAM;AAClD;AACA,WAAW,uBAAWT,iBAAX,CAA8B;AACzC,YAAY,uBAAW,MAAX,CAAmB;AAC/B,CARO;;AAUA,MAAMU,YAAY,GAAG,qBAAOP,sBAASC,IAAhB,CAA2C;AACvE,mBAAmB,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AAC1D,sBAAsB,CAAC;AAAEF,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACM,aAAN,CAAoBC,YAAa;AACtE,WAAW,uBAAWX,gBAAX,CAA6B;AACxC,YAAY,uBAAW,MAAX,CAAmB;AAC/B,CALO","sourcesContent":["import styled from '@emotion/native';\nimport { Animated } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { RFValueStr } from '../../../utils';\n\nexport const SWITCH_BODY_WIDTH = '40px'\nexport const SWITCH_PIN_WIDTH = '16px'\n\nexport const StyledSwitchContent = styled(Animated.View)<\n Partial<StyleProps>\n>`\n border-radius: ${({ theme }) => theme.borderRadius.pill};\n padding: 0 ${({ theme }) => theme.spacing.micro};\n justify-content: center;\n width: ${RFValueStr(SWITCH_BODY_WIDTH)};\n height: ${RFValueStr('22px')};\n`;\n\nexport const StyledSwitch = styled(Animated.View)<Partial<StyleProps>>`\n border-radius: ${({ theme }) => theme.borderRadius.pill};\n background-color: ${({ theme }) => theme.miscellaneous.surfaceColor};\n width: ${RFValueStr(SWITCH_PIN_WIDTH)};\n height: ${RFValueStr('16px')};\n`;\n"],"file":"styled.js"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.default = void 0;
|
|
7
5
|
|
|
8
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -43,7 +41,7 @@ const Tag = ({
|
|
|
43
41
|
};
|
|
44
42
|
|
|
45
43
|
const handleDismiss = (0, _react.useCallback)(() => {
|
|
46
|
-
onDismiss
|
|
44
|
+
onDismiss == null ? void 0 : onDismiss();
|
|
47
45
|
fadeOut();
|
|
48
46
|
setTimeout(() => setDismiss(true), duration);
|
|
49
47
|
}, [onDismiss]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Tag/Tag.tsx"],"names":["Tag","value","icon","variant","dismiss","canDismiss","onDismiss","style","rest","setDismiss","fadeAnim","React","useRef","Animated","Value","current","duration","fadeOut","timing","toValue","useNativeDriver","start","handleDismiss","setTimeout","opacity","size","colorVariant"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Tag/Tag.tsx"],"names":["Tag","value","icon","variant","dismiss","canDismiss","onDismiss","style","rest","setDismiss","fadeAnim","React","useRef","Animated","Value","current","duration","fadeOut","timing","toValue","useNativeDriver","start","handleDismiss","setTimeout","opacity","size","colorVariant"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;AAUA,MAAMA,GAAuB,GAAG,CAAC;AAC/BC,EAAAA,KAD+B;AAE/BC,EAAAA,IAF+B;AAG/BC,EAAAA,OAAO,GAAG,OAHqB;AAI/BC,EAAAA,OAAO,EAAEC,UAAU,GAAG,KAJS;AAK/BC,EAAAA,SAL+B;AAM/BC,EAAAA,KAN+B;AAO/B,KAAGC;AAP4B,CAAD,KAQb;AACjB,QAAM,CAACJ,OAAD,EAAUK,UAAV,IAAwB,qBAAS,KAAT,CAA9B;;AACA,QAAMC,QAAQ,GAAGC,eAAMC,MAAN,CAAa,IAAIC,sBAASC,KAAb,CAAmB,CAAnB,CAAb,EAAoCC,OAArD;;AACA,QAAMC,QAAQ,GAAG,GAAjB;;AAEA,QAAMC,OAAO,GAAG,MAAM;AACpBJ,0BAASK,MAAT,CAAgBR,QAAhB,EAA0B;AACxBS,MAAAA,OAAO,EAAE,CADe;AAExBH,MAAAA,QAFwB;AAGxBI,MAAAA,eAAe,EAAE;AAHO,KAA1B,EAIGC,KAJH;AAKD,GAND;;AAQA,QAAMC,aAAa,GAAG,wBAAY,MAAM;AACtChB,IAAAA,SAAS,QAAT,YAAAA,SAAS;AACTW,IAAAA,OAAO;AACPM,IAAAA,UAAU,CAAC,MAAMd,UAAU,CAAC,IAAD,CAAjB,EAAyBO,QAAzB,CAAV;AACD,GAJqB,EAInB,CAACV,SAAD,CAJmB,CAAtB;AAMA,SACE,6BAAC,0BAAD,eACME,IADN;AAEE,IAAA,OAAO,EAAEL,OAFX;AAGE,IAAA,KAAK,EAAE,CAAC;AAAEqB,MAAAA,OAAO,EAAGd;AAAZ,KAAD,EAA+CH,KAA/C,CAHT;AAIE,IAAA,OAAO,EAAE,CAACH;AAJZ,MAMGF,IAAI,IACH,6BAAC,sBAAD;AACE,IAAA,IAAI,EAAEA,IAAI,CAACuB,IAAL,IAAa,OADrB;AAEE,IAAA,YAAY,EAAEvB,IAAI,CAACwB,YAAL,IAAqB;AAFrC,KAGMxB,IAHN,EAPJ,EAaGD,KAbH,EAcGI,UAAU,IACT,6BAAC,kCAAD;AAAkB,IAAA,OAAO,EAAEiB;AAA3B,KACE,6BAAC,uBAAD;AACE,IAAA,IAAI,EAAC,eADP;AAEE,IAAA,IAAI,EAAC,SAFP;AAGE,IAAA,IAAI,EAAC,OAHP;AAIE,IAAA,SAAS,EAAC;AAJZ,IADF,CAfJ,CADF;AA2BD,CAtDD;;eAwDetB,G","sourcesContent":["import React, { useCallback, useState } from 'react';\nimport { Animated, ViewProps } from 'react-native';\nimport { IconProps } from '../Icon';\nimport { PressableSurface } from '../PressableSurface';\nimport { StyledCloseIcon, StyledLeftIcon, StyledTagContainer } from './styled';\n\nexport interface TagProps extends ViewProps {\n value: React.ReactNode;\n icon?: IconProps;\n dismiss?: boolean;\n onDismiss?: () => void;\n variant?: 'small' | 'default';\n}\n\nconst Tag: React.FC<TagProps> = ({\n value,\n icon,\n variant = 'small',\n dismiss: canDismiss = false,\n onDismiss,\n style,\n ...rest\n}): JSX.Element => {\n const [dismiss, setDismiss] = useState(false);\n const fadeAnim = React.useRef(new Animated.Value(1)).current;\n const duration = 300;\n\n const fadeOut = () => {\n Animated.timing(fadeAnim, {\n toValue: 0,\n duration,\n useNativeDriver: true,\n }).start();\n };\n\n const handleDismiss = useCallback(() => {\n onDismiss?.();\n fadeOut();\n setTimeout(() => setDismiss(true), duration);\n }, [onDismiss]);\n\n return (\n <StyledTagContainer\n {...rest}\n variant={variant}\n style={[{ opacity: (fadeAnim as unknown) as number }, style]}\n visible={!dismiss}\n >\n {icon && (\n <StyledLeftIcon\n size={icon.size || 'micro'}\n colorVariant={icon.colorVariant || 'primary'}\n {...icon}\n />\n )}\n {value}\n {canDismiss && (\n <PressableSurface onPress={handleDismiss}>\n <StyledCloseIcon\n name=\"close-outline\"\n type=\"ionicon\"\n size=\"centi\"\n fontColor=\"medium\"\n />\n </PressableSurface>\n )}\n </StyledTagContainer>\n );\n};\n\nexport default Tag;\n"],"file":"Tag.js"}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Tag", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _Tag.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "TagProps", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _Tag.TagProps;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.TagProps = exports.Tag = void 0;
|
|
18
5
|
|
|
19
6
|
var _Tag = _interopRequireWildcard(require("./Tag"));
|
|
20
7
|
|
|
8
|
+
exports.Tag = _Tag.default;
|
|
9
|
+
exports.TagProps = _Tag.TagProps;
|
|
10
|
+
|
|
21
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); }
|
|
22
12
|
|
|
23
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; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Tag/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Tag/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as Tag, TagProps } from './Tag';\n"],"file":"index.js"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.StyledCloseIcon = exports.StyledLeftIcon = exports.StyledTagContainer = void 0;
|
|
7
5
|
|
|
8
6
|
var _native = _interopRequireWildcard(require("@emotion/native"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Tag/styled.ts"],"names":["smallVariant","theme","variant","borderRadius","micro","spacing","nano","mili","defaultVariant","centi","StyledTagContainerBase","Animated","View","miscellaneous","bodyColor","visible","StyledTagContainer","props","StyledLeftIcon","Icon","StyledCloseIcon"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Tag/styled.ts"],"names":["smallVariant","theme","variant","borderRadius","micro","spacing","nano","mili","defaultVariant","centi","StyledTagContainerBase","Animated","View","miscellaneous","bodyColor","visible","StyledTagContainer","props","StyledLeftIcon","Icon","StyledCloseIcon"],"mappings":";;;;;AAAA;;AACA;;AAEA;;;;;;AAGA,MAAMA,YAAY,GAAG,CAAC;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAD,KACnBA,OAAO,KAAK,OAAZ,IACA,gBAAI;AACN,qBAAqBD,KAAK,CAACE,YAAN,CAAmBC,KAAM;AAC9C,eAAeH,KAAK,CAACI,OAAN,CAAcC,IAAK,IAAGL,KAAK,CAACI,OAAN,CAAcE,IAAK;AACxD,GALA;;AAOA,MAAMC,cAAc,GAAG,CAAC;AAAEP,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAD,KACrBA,OAAO,KAAK,SAAZ,IACA,gBAAI;AACN,qBAAqBD,KAAK,CAACE,YAAN,CAAmBI,IAAK;AAC7C,eAAeN,KAAK,CAACI,OAAN,CAAcD,KAAM,IAAGH,KAAK,CAACI,OAAN,CAAcI,KAAM;AAC1D,GALA;;AAOA,MAAMC,sBAAsB,GAAG,qBAAOC,sBAASC,IAAhB,CAE7B;AACF,sBAAsB,CAAC;AAAEX,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACY,aAAN,CAAoBC,SAAU;AACnE;AACA;AACA;AACA;AACA,aAAa,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAkBA,OAAO,GAAG,MAAH,GAAY,MAAQ;AAC1D,CATA;AAWO,MAAMC,kBAAkB,GAAG,qBAAON,sBAAP,EAChCO,KAAK,IAAI,gBAAI;AACf,MAAMjB,YAAY,CAACiB,KAAD,CAAQ;AAC1B,MAAMT,cAAc,CAACS,KAAD,CAAQ;AAC5B,GAJkC,CAA3B;;AAOA,MAAMC,cAAc,GAAG,qBAAOC,UAAP,CAA8C;AAC5E,kBAAkB,CAAC;AAAElB,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,OAAN,CAAcD,KAAM;AACrD,CAFO;;AAIA,MAAMgB,eAAe,GAAG,qBAAOD,UAAP,CAA8C;AAC7E,iBAAiB,CAAC;AAAElB,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACI,OAAN,CAAcC,IAAK;AACnD,CAFO","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { Animated, ViewProps } from 'react-native';\nimport { StyleProps } from '../../../types/defaults';\nimport { Icon, IconProps } from '../Icon';\nimport { TagProps } from './Tag';\n\nconst smallVariant = ({ theme, variant }: Partial<TagProps> & StyleProps) =>\n variant === 'small' &&\n css`\n border-radius: ${theme.borderRadius.micro};\n padding: ${theme.spacing.nano} ${theme.spacing.mili};\n `;\n\nconst defaultVariant = ({ theme, variant }: Partial<TagProps> & StyleProps) =>\n variant === 'default' &&\n css`\n border-radius: ${theme.borderRadius.mili};\n padding: ${theme.spacing.micro} ${theme.spacing.centi};\n `;\n\nconst StyledTagContainerBase = styled(Animated.View)<\n Partial<TagProps> & Partial<StyleProps> & ViewProps & { visible: boolean }\n>`\n background-color: ${({ theme }) => theme.miscellaneous.bodyColor};\n flex-direction: row;\n justify-content: center;\n align-items: center;\n align-self: center;\n display: ${({ visible }) => (visible ? 'flex' : 'none')};\n`;\n\nexport const StyledTagContainer = styled(StyledTagContainerBase)(\n props => css`\n ${smallVariant(props)}\n ${defaultVariant(props)}\n `\n);\n\nexport const StyledLeftIcon = styled(Icon)<Partial<StyleProps> & IconProps>`\n margin-right: ${({ theme }) => theme.spacing.micro};\n`;\n\nexport const StyledCloseIcon = styled(Icon)<Partial<StyleProps> & IconProps>`\n margin-left: ${({ theme }) => theme.spacing.nano};\n`;\n"],"file":"styled.js"}
|
|
@@ -10,6 +10,8 @@ export interface TextProps {
|
|
|
10
10
|
colorTone?: ColorGradationType;
|
|
11
11
|
numberOfLines?: number;
|
|
12
12
|
ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';
|
|
13
|
+
textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize';
|
|
14
|
+
capitalFirst?: boolean;
|
|
13
15
|
style?: StyleProp<TextStyle>;
|
|
14
16
|
}
|
|
15
17
|
declare const Text: FC<TextProps>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.default = void 0;
|
|
7
5
|
|
|
8
6
|
var _react = _interopRequireDefault(require("react"));
|
|
9
7
|
|
|
10
8
|
var _styled = require("./styled");
|
|
11
9
|
|
|
10
|
+
var _functions = require("./functions");
|
|
11
|
+
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
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); }
|
|
@@ -23,6 +23,8 @@ const Text = ({
|
|
|
23
23
|
typography = 'base',
|
|
24
24
|
numberOfLines,
|
|
25
25
|
ellipsizeMode,
|
|
26
|
+
textTransform = 'none',
|
|
27
|
+
capitalFirst = false,
|
|
26
28
|
...rest
|
|
27
29
|
}) => {
|
|
28
30
|
return _react.default.createElement(_styled.StyledColoredText, _extends({}, rest, {
|
|
@@ -33,8 +35,9 @@ const Text = ({
|
|
|
33
35
|
fontWeight: fontWeight,
|
|
34
36
|
typography: typography,
|
|
35
37
|
numberOfLines: numberOfLines,
|
|
36
|
-
ellipsizeMode: ellipsizeMode
|
|
37
|
-
|
|
38
|
+
ellipsizeMode: ellipsizeMode,
|
|
39
|
+
textTransform: textTransform
|
|
40
|
+
}), (0, _functions.getLabel)(children, capitalFirst));
|
|
38
41
|
};
|
|
39
42
|
|
|
40
43
|
var _default = Text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Text/Text.tsx"],"names":["Text","children","style","fontColor","colorTone","colorVariant","fontWeight","typography","numberOfLines","ellipsizeMode","rest"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Text/Text.tsx"],"names":["Text","children","style","fontColor","colorTone","colorVariant","fontWeight","typography","numberOfLines","ellipsizeMode","textTransform","capitalFirst","rest"],"mappings":";;;;;AAAA;;AAUA;;AACA;;;;;;AAuBA,MAAMA,IAAmB,GAAG,CAAC;AAC3BC,EAAAA,QAD2B;AAE3BC,EAAAA,KAF2B;AAG3BC,EAAAA,SAAS,GAAG,MAHe;AAI3BC,EAAAA,SAAS,GAAG,QAJe;AAK3BC,EAAAA,YAL2B;AAM3BC,EAAAA,UAAU,GAAG,SANc;AAO3BC,EAAAA,UAAU,GAAG,MAPc;AAQ3BC,EAAAA,aAR2B;AAS3BC,EAAAA,aAT2B;AAU3BC,EAAAA,aAAa,GAAG,MAVW;AAW3BC,EAAAA,YAAY,GAAG,KAXY;AAY3B,KAAGC;AAZwB,CAAD,KAaT;AACjB,SACE,6BAAC,yBAAD,eACMA,IADN;AAEE,IAAA,KAAK,EAAEV,KAFT;AAGE,IAAA,SAAS,EAAEC,SAHb;AAIE,IAAA,SAAS,EAAEC,SAJb;AAKE,IAAA,YAAY,EAAEC,YALhB;AAME,IAAA,UAAU,EAAEC,UANd;AAOE,IAAA,UAAU,EAAEC,UAPd;AAQE,IAAA,aAAa,EAAEC,aARjB;AASE,IAAA,aAAa,EAAEC,aATjB;AAUE,IAAA,aAAa,EAAEC;AAVjB,MAYG,yBAAST,QAAT,EAAmBU,YAAnB,CAZH,CADF;AAgBD,CA9BD;;eAgCeX,I","sourcesContent":["import React, { FC } from 'react';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n FontStackType,\n FontWeightType,\n TypographyVariationType,\n} from '@tecsinapse/react-core';\nimport { StyleProp, TextStyle } from 'react-native';\nimport { StyledColoredText } from './styled';\nimport { getLabel } from './functions';\n\nexport interface TextProps {\n /** Font theme text color */\n fontColor?: FontColorType;\n /** Font theme weight */\n fontWeight?: FontWeightType;\n /** Font theme sizes */\n typography?: TypographyVariationType;\n /** Font theme stack */\n fontStack?: FontStackType;\n /** Palette theme colors. You can specify this prop to override theme fontColor */\n colorVariant?: ColorType;\n /** Palette theme colors gradation */\n colorTone?: ColorGradationType;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize';\n capitalFirst?: boolean;\n style?: StyleProp<TextStyle>;\n}\n\n/** NOTE: When using colors, be careful to not override fontColor by using colorVariant and colorTone, referent to theme colors and not text colors. */\nconst Text: FC<TextProps> = ({\n children,\n style,\n fontColor = 'dark',\n colorTone = 'medium',\n colorVariant,\n fontWeight = 'regular',\n typography = 'base',\n numberOfLines,\n ellipsizeMode,\n textTransform = 'none',\n capitalFirst = false,\n ...rest\n}): JSX.Element => {\n return (\n <StyledColoredText\n {...rest}\n style={style}\n fontColor={fontColor}\n colorTone={colorTone}\n colorVariant={colorVariant}\n fontWeight={fontWeight}\n typography={typography}\n numberOfLines={numberOfLines}\n ellipsizeMode={ellipsizeMode}\n textTransform={textTransform}\n >\n {getLabel(children, capitalFirst)}\n </StyledColoredText>\n );\n};\n\nexport default Text;\n"],"file":"Text.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.getLabel = exports.getFirstCapitalCharacter = void 0;
|
|
5
|
+
|
|
6
|
+
const getFirstCapitalCharacter = value => value.charAt(0).toUpperCase().concat(value.slice(1));
|
|
7
|
+
|
|
8
|
+
exports.getFirstCapitalCharacter = getFirstCapitalCharacter;
|
|
9
|
+
|
|
10
|
+
const getLabel = (children, capitalFirst) => typeof children === 'string' && capitalFirst ? getFirstCapitalCharacter(children) : children;
|
|
11
|
+
|
|
12
|
+
exports.getLabel = getLabel;
|
|
13
|
+
//# sourceMappingURL=functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Text/functions.ts"],"names":["getFirstCapitalCharacter","value","charAt","toUpperCase","concat","slice","getLabel","children","capitalFirst"],"mappings":";;;;;AAAO,MAAMA,wBAAwB,GAAIC,KAAD,IACtCA,KAAK,CAACC,MAAN,CAAa,CAAb,EAAgBC,WAAhB,GAA8BC,MAA9B,CAAqCH,KAAK,CAACI,KAAN,CAAY,CAAZ,CAArC,CADK;;;;AAIA,MAAMC,QAAQ,GAAG,CAACC,QAAD,EAAWC,YAAX,KACtB,OAAOD,QAAP,KAAoB,QAApB,IAAgCC,YAAhC,GACIR,wBAAwB,CAACO,QAAD,CAD5B,GAEIA,QAHC","sourcesContent":["export const getFirstCapitalCharacter = (value: string): string =>\n value.charAt(0).toUpperCase().concat(value.slice(1));\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport const getLabel = (children, capitalFirst: boolean) =>\n typeof children === 'string' && capitalFirst\n ? getFirstCapitalCharacter(children)\n : children;\n"],"file":"functions.js"}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Text", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _Text.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "TextProps", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _Text.TextProps;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.TextProps = exports.Text = void 0;
|
|
18
5
|
|
|
19
6
|
var _Text = _interopRequireWildcard(require("./Text"));
|
|
20
7
|
|
|
8
|
+
exports.Text = _Text.default;
|
|
9
|
+
exports.TextProps = _Text.TextProps;
|
|
10
|
+
|
|
21
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); }
|
|
22
12
|
|
|
23
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; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Text/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Text/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as Text, TextProps } from './Text';\n"],"file":"index.js"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.StyledColoredText = exports.StyledText = void 0;
|
|
7
5
|
|
|
8
6
|
var _native = _interopRequireWildcard(require("@emotion/native"));
|
|
@@ -34,6 +32,9 @@ const StyledText = (0, _native.default)(_reactNative.Text)`
|
|
|
34
32
|
theme,
|
|
35
33
|
fontStack = 'default'
|
|
36
34
|
}) => `'${theme.font.stack[fontStack]}'`};
|
|
35
|
+
text-transform: ${({
|
|
36
|
+
textTransform = 'none'
|
|
37
|
+
}) => `${textTransform}`};
|
|
37
38
|
`;
|
|
38
39
|
exports.StyledText = StyledText;
|
|
39
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Text/styled.ts"],"names":["StyledText","RNText","theme","fontColor","font","color","fontWeight","weight","typography","fontSize","lineHeight","fontStack","stack","colorStyles","colorVariant","colorTone","StyledColoredText"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Text/styled.ts"],"names":["StyledText","RNText","theme","fontColor","font","color","fontWeight","weight","typography","fontSize","lineHeight","fontStack","stack","textTransform","colorStyles","colorVariant","colorTone","StyledColoredText"],"mappings":";;;;;AAAA;;AAEA;;;;;;AAEO,MAAMA,UAAU,GAAG,qBAAOC,iBAAP,CAAgD;AAC1E,WAAW,CAAC;AAAEC,EAAAA,KAAF;AAASC,EAAAA,SAAS,GAAG;AAArB,CAAD,KAAmCD,KAAK,CAACE,IAAN,CAAWC,KAAX,CAAiBF,SAAjB,CAA4B;AAC1E,iBAAiB,CAAC;AAAED,EAAAA,KAAF;AAASI,EAAAA,UAAU,GAAG;AAAtB,CAAD,KACbJ,KAAK,CAACE,IAAN,CAAWG,MAAX,CAAkBD,UAAlB,CAA8B;AAClC,eAAe,CAAC;AAAEJ,EAAAA,KAAF;AAASM,EAAAA,UAAU,GAAG;AAAtB,CAAD,KACXN,KAAK,CAACM,UAAN,CAAiBA,UAAjB,EAA6BC,QAAS;AAC1C,iBAAiB,CAAC;AAAEP,EAAAA,KAAF;AAASM,EAAAA,UAAU,GAAG;AAAtB,CAAD,KACbN,KAAK,CAACM,UAAN,CAAiBA,UAAjB,EAA6BE,UAAW;AAC5C,iBAAiB,CAAC;AAAER,EAAAA,KAAF;AAASS,EAAAA,SAAS,GAAG;AAArB,CAAD,KACZ,IAAGT,KAAK,CAACE,IAAN,CAAWQ,KAAX,CAAiBD,SAAjB,CAA4B,GAAG;AACvC,oBAAoB,CAAC;AAAEE,EAAAA,aAAa,GAAG;AAAlB,CAAD,KAAiC,GAAEA,aAAc,EAAE;AACvE,CAXO;;;AAaP,MAAMC,WAAW,GAAG,CAAC;AACnBC,EAAAA,YADmB;AAEnBC,EAAAA,SAFmB;AAGnBd,EAAAA;AAHmB,CAAD,KAKlBa,YAAY,IACZC,SADA,IAEA,gBAAI;AACN,aAAad,KAAK,CAACG,KAAN,CAAYU,YAAZ,EAA0BC,SAA1B,CAAqC;AAClD,GATA;;AAWO,MAAMC,iBAAiB,GAAG,qBAAOjB,UAAP,EAE/Bc,WAF+B,CAA1B","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { StyleProps, TextProps } from '@tecsinapse/react-core';\nimport { Text as RNText } from 'react-native';\n\nexport const StyledText = styled(RNText)<TextProps & Partial<StyleProps>>`\n color: ${({ theme, fontColor = 'dark' }) => theme.font.color[fontColor]};\n font-weight: ${({ theme, fontWeight = 'regular' }) =>\n theme.font.weight[fontWeight]};\n font-size: ${({ theme, typography = 'base' }) =>\n theme.typography[typography].fontSize};\n line-height: ${({ theme, typography = 'base' }) =>\n theme.typography[typography].lineHeight};\n font-family: ${({ theme, fontStack = 'default' }) =>\n `'${theme.font.stack[fontStack]}'`};\n text-transform: ${({ textTransform = 'none' }) => `${textTransform}`};\n`;\n\nconst colorStyles = ({\n colorVariant,\n colorTone,\n theme,\n}: TextProps & StyleProps) =>\n colorVariant &&\n colorTone &&\n css`\n color: ${theme.color[colorVariant][colorTone]};\n `;\n\nexport const StyledColoredText = styled(StyledText)<\n TextProps & Partial<StyleProps>\n>(colorStyles);\n"],"file":"styled.js"}
|