@tecsinapse/react-core 1.17.3 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/dist/components/atoms/Avatar/Avatar.js.map +1 -1
- package/dist/components/atoms/Avatar/helpers.js.map +1 -1
- package/dist/components/atoms/Avatar/index.js.map +1 -1
- package/dist/components/atoms/Avatar/styled.js.map +1 -1
- package/dist/components/atoms/Badge/Badge.js.map +1 -1
- package/dist/components/atoms/Badge/index.js.map +1 -1
- package/dist/components/atoms/Badge/styled.js.map +1 -1
- package/dist/components/atoms/BoxContent/BoxContent.js.map +1 -1
- package/dist/components/atoms/BoxContent/index.js.map +1 -1
- package/dist/components/atoms/BoxContent/styled.js +1 -1
- package/dist/components/atoms/BoxContent/styled.js.map +1 -1
- package/dist/components/atoms/Button/Button.js +1 -1
- package/dist/components/atoms/Button/Button.js.map +1 -1
- package/dist/components/atoms/Button/States/BaseState.js.map +1 -1
- package/dist/components/atoms/Button/States/Error.js +1 -1
- package/dist/components/atoms/Button/States/Error.js.map +1 -1
- package/dist/components/atoms/Button/States/Loading.js.map +1 -1
- package/dist/components/atoms/Button/States/Success.js +1 -1
- package/dist/components/atoms/Button/States/Success.js.map +1 -1
- package/dist/components/atoms/Button/States/index.js.map +1 -1
- package/dist/components/atoms/Button/States/styled.js +1 -1
- package/dist/components/atoms/Button/States/styled.js.map +1 -1
- package/dist/components/atoms/Button/index.js +1 -1
- package/dist/components/atoms/Button/index.js.map +1 -1
- package/dist/components/atoms/Button/styled.js.map +1 -1
- package/dist/components/atoms/Card/Card.js +1 -1
- package/dist/components/atoms/Card/Card.js.map +1 -1
- package/dist/components/atoms/Card/Footer/Footer.js.map +1 -1
- package/dist/components/atoms/Card/Footer/index.js.map +1 -1
- package/dist/components/atoms/Card/Header/Header.js.map +1 -1
- package/dist/components/atoms/Card/Header/index.js.map +1 -1
- package/dist/components/atoms/Card/index.js.map +1 -1
- package/dist/components/atoms/Card/styled.js.map +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/atoms/Checkbox/index.js.map +1 -1
- package/dist/components/atoms/Checkbox/styled.js +1 -1
- package/dist/components/atoms/Checkbox/styled.js.map +1 -1
- package/dist/components/atoms/Divider/Divider.js.map +1 -1
- package/dist/components/atoms/Divider/index.js.map +1 -1
- package/dist/components/atoms/Divider/styled.js.map +1 -1
- package/dist/components/atoms/GroupButton/GroupButton.d.ts +1 -1
- package/dist/components/atoms/GroupButton/GroupButton.js +1 -1
- package/dist/components/atoms/GroupButton/GroupButton.js.map +1 -1
- package/dist/components/atoms/GroupButton/GroupButtonOption.js.map +1 -1
- package/dist/components/atoms/GroupButton/index.js +1 -1
- package/dist/components/atoms/GroupButton/index.js.map +1 -1
- package/dist/components/atoms/GroupButton/styled.js +1 -1
- package/dist/components/atoms/GroupButton/styled.js.map +1 -1
- package/dist/components/atoms/Icon/Icon.js +1 -1
- package/dist/components/atoms/Icon/Icon.js.map +1 -1
- package/dist/components/atoms/Icon/helpers.js +1 -1
- package/dist/components/atoms/Icon/helpers.js.map +1 -1
- package/dist/components/atoms/Icon/index.js.map +1 -1
- package/dist/components/atoms/Input/Hint.js.map +1 -1
- package/dist/components/atoms/Input/InputContainer/InputContainer.d.ts +1 -1
- package/dist/components/atoms/Input/InputContainer/InputContainer.js +1 -1
- package/dist/components/atoms/Input/InputContainer/InputContainer.js.map +1 -1
- package/dist/components/atoms/Input/InputElement/InputElement.d.ts +3 -4
- package/dist/components/atoms/Input/InputElement/InputElement.js +1 -1
- package/dist/components/atoms/Input/InputElement/InputElement.js.map +1 -1
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.d.ts +3 -4
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js +1 -1
- package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js.map +1 -1
- package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js +1 -1
- package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js.map +1 -1
- package/dist/components/atoms/Input/PressableInputContainer/index.js.map +1 -1
- package/dist/components/atoms/Input/PressableInputContainer/styled.js.map +1 -1
- package/dist/components/atoms/Input/hooks/useInputFocus.js.map +1 -1
- package/dist/components/atoms/Input/hooks/useNumberMask.js.map +1 -1
- package/dist/components/atoms/Input/hooks/useStringMask.js +1 -1
- package/dist/components/atoms/Input/hooks/useStringMask.js.map +1 -1
- package/dist/components/atoms/Input/index.js +1 -1
- package/dist/components/atoms/Input/index.js.map +1 -1
- package/dist/components/atoms/Input/styled.js +1 -1
- package/dist/components/atoms/Input/styled.js.map +1 -1
- package/dist/components/atoms/Paper/Paper.js +1 -1
- package/dist/components/atoms/Paper/Paper.js.map +1 -1
- package/dist/components/atoms/Paper/index.js.map +1 -1
- package/dist/components/atoms/Paper/styled.js.map +1 -1
- package/dist/components/atoms/PressableSurface/PressableSurface.js +1 -1
- package/dist/components/atoms/PressableSurface/PressableSurface.js.map +1 -1
- package/dist/components/atoms/PressableSurface/index.js.map +1 -1
- package/dist/components/atoms/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/atoms/ProgressBar/index.js.map +1 -1
- package/dist/components/atoms/ProgressBar/styled.js +1 -1
- package/dist/components/atoms/ProgressBar/styled.js.map +1 -1
- package/dist/components/atoms/RadioButton/RadioButton.js +1 -1
- package/dist/components/atoms/RadioButton/RadioButton.js.map +1 -1
- package/dist/components/atoms/RadioButton/index.js.map +1 -1
- package/dist/components/atoms/RadioButton/styled.js +1 -1
- package/dist/components/atoms/RadioButton/styled.js.map +1 -1
- package/dist/components/atoms/Switch/Switch.d.ts +1 -1
- package/dist/components/atoms/Switch/Switch.js +1 -1
- package/dist/components/atoms/Switch/Switch.js.map +1 -1
- package/dist/components/atoms/Switch/animation.js.map +1 -1
- package/dist/components/atoms/Switch/index.js.map +1 -1
- package/dist/components/atoms/Switch/styled.d.ts +2 -14
- package/dist/components/atoms/Switch/styled.js +1 -1
- package/dist/components/atoms/Switch/styled.js.map +1 -1
- package/dist/components/atoms/Tag/Tag.js +1 -1
- package/dist/components/atoms/Tag/Tag.js.map +1 -1
- package/dist/components/atoms/Tag/index.js.map +1 -1
- package/dist/components/atoms/Tag/styled.js +1 -1
- package/dist/components/atoms/Tag/styled.js.map +1 -1
- package/dist/components/atoms/Text/Text.js +1 -1
- package/dist/components/atoms/Text/Text.js.map +1 -1
- package/dist/components/atoms/Text/functions.js.map +1 -1
- package/dist/components/atoms/Text/index.js.map +1 -1
- package/dist/components/atoms/Text/styled.js +1 -1
- package/dist/components/atoms/Text/styled.js.map +1 -1
- package/dist/components/atoms/shared/PaperAndCard.js.map +1 -1
- package/dist/components/molecules/Calendar/Calendar.js.map +1 -1
- package/dist/components/molecules/Calendar/components/MonthWeek.js.map +1 -1
- package/dist/components/molecules/Calendar/components/Weekdays.js.map +1 -1
- package/dist/components/molecules/Calendar/components/index.js +1 -1
- package/dist/components/molecules/Calendar/components/index.js.map +1 -1
- package/dist/components/molecules/Calendar/index.d.ts +1 -1
- package/dist/components/molecules/Calendar/index.js +1 -1
- package/dist/components/molecules/Calendar/index.js.map +1 -1
- package/dist/components/molecules/Calendar/styled.js +1 -1
- package/dist/components/molecules/Calendar/styled.js.map +1 -1
- package/dist/components/molecules/DatePicker/DatePicker.js +1 -1
- package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/molecules/DatePicker/index.js.map +1 -1
- package/dist/components/molecules/DatePicker/styled.js +1 -1
- package/dist/components/molecules/DatePicker/styled.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/DateTimePicker.js +1 -1
- package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/index.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/styled.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js +2 -1
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/Selector.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/index.js +1 -1
- package/dist/components/molecules/DateTimeSelector/index.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/styled.js +1 -1
- package/dist/components/molecules/DateTimeSelector/styled.js.map +1 -1
- package/dist/components/molecules/Grid/functions.d.ts +3 -0
- package/dist/components/molecules/Grid/functions.js +21 -0
- package/dist/components/molecules/Grid/functions.js.map +1 -0
- package/dist/components/molecules/Grid/index.d.ts +42 -2
- package/dist/components/molecules/Grid/index.js +4 -13
- package/dist/components/molecules/Grid/index.js.map +1 -1
- package/dist/components/molecules/HintInputContainer/HintInputContainer.js +1 -1
- package/dist/components/molecules/HintInputContainer/HintInputContainer.js.map +1 -1
- package/dist/components/molecules/HintInputContainer/index.js.map +1 -1
- package/dist/components/molecules/HintInputContainer/styled.js.map +1 -1
- package/dist/components/molecules/IconTextButton/IconComponent.d.ts +9 -0
- package/dist/components/molecules/IconTextButton/IconComponent.js +28 -0
- package/dist/components/molecules/IconTextButton/IconComponent.js.map +1 -0
- package/dist/components/molecules/IconTextButton/IconTextButton.d.ts +8 -0
- package/dist/components/molecules/IconTextButton/IconTextButton.js +4 -0
- package/dist/components/molecules/IconTextButton/IconTextButton.js.map +1 -0
- package/dist/components/molecules/IconTextButton/index.d.ts +2 -0
- package/dist/components/molecules/IconTextButton/index.js +16 -0
- package/dist/components/molecules/IconTextButton/index.js.map +1 -0
- package/dist/components/molecules/IconTextButton/styled.d.ts +4 -0
- package/dist/components/molecules/{Grid/Item/index.js → IconTextButton/styled.js} +19 -5
- package/dist/components/molecules/IconTextButton/styled.js.map +1 -0
- package/dist/components/molecules/InputPassword/InputPasswordIcon.js +1 -1
- package/dist/components/molecules/InputPassword/InputPasswordIcon.js.map +1 -1
- package/dist/components/molecules/InputPassword/index.js.map +1 -1
- package/dist/components/molecules/InputPassword/styled.js.map +1 -1
- package/dist/components/molecules/LabeledSwitch/LabeledSwitch.d.ts +7 -0
- package/dist/components/molecules/LabeledSwitch/LabeledSwitch.js +4 -0
- package/dist/components/molecules/LabeledSwitch/LabeledSwitch.js.map +1 -0
- package/dist/components/molecules/LabeledSwitch/index.d.ts +1 -0
- package/dist/components/molecules/LabeledSwitch/index.js +10 -0
- package/dist/components/molecules/LabeledSwitch/index.js.map +1 -0
- package/dist/components/molecules/Snackbar/Snackbar.js +1 -1
- package/dist/components/molecules/Snackbar/Snackbar.js.map +1 -1
- package/dist/components/molecules/Snackbar/index.js.map +1 -1
- package/dist/components/molecules/Snackbar/styled.js +1 -1
- package/dist/components/molecules/Snackbar/styled.js.map +1 -1
- package/dist/components/molecules/TextArea/TextArea.d.ts +1 -1
- package/dist/components/molecules/TextArea/TextArea.js.map +1 -1
- package/dist/components/molecules/TextArea/index.js +1 -1
- package/dist/components/molecules/TextArea/index.js.map +1 -1
- package/dist/components/molecules/TextArea/styled.d.ts +2 -14
- package/dist/components/molecules/TextArea/styled.js.map +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useDebouncedState.js +1 -1
- package/dist/hooks/useDebouncedState.js.map +1 -1
- package/dist/hooks/useTheme.js.map +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.js +58 -30
- package/dist/index.js.map +1 -1
- package/dist/styles/ThemeProvider.js.map +1 -1
- package/dist/styles/definitions.d.ts +2 -1
- package/dist/styles/definitions.js +7 -1
- package/dist/styles/definitions.js.map +1 -1
- package/dist/styles/light.js +2 -1
- package/dist/styles/light.js.map +1 -1
- package/dist/types/defaults.d.ts +8 -2
- package/dist/types/defaults.js.map +1 -1
- package/dist/utils/IPhoneXHelper.js +3 -3
- package/dist/utils/IPhoneXHelper.js.map +1 -1
- package/dist/utils/ResponsiveFontSize.js +6 -6
- package/dist/utils/ResponsiveFontSize.js.map +1 -1
- package/dist/utils/extractNumbersFromString.js +1 -1
- package/dist/utils/extractNumbersFromString.js.map +1 -1
- package/dist/utils/formatWithMask.js.map +1 -1
- package/dist/utils/index.d.ts +5 -4
- package/dist/utils/index.js +28 -19
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/lightenDarkenColor.js.map +1 -1
- package/dist/utils/masks.js.map +1 -1
- package/dist/utils/variantComplement.d.ts +6 -0
- package/dist/utils/variantComplement.js +35 -0
- package/dist/utils/variantComplement.js.map +1 -0
- package/package.json +5 -5
- package/src/components/atoms/Badge/styled.ts +2 -3
- package/src/components/atoms/GroupButton/GroupButton.tsx +2 -5
- package/src/components/atoms/Input/InputContainer/InputContainer.tsx +3 -3
- package/src/components/atoms/Input/InputElement/InputElement.tsx +4 -5
- package/src/components/atoms/Input/InputMaskElement/InputMaskElement.tsx +4 -5
- package/src/components/atoms/ProgressBar/ProgressBar.tsx +2 -4
- package/src/components/atoms/Switch/Switch.tsx +39 -19
- package/src/components/atoms/Switch/animation.ts +4 -6
- package/src/components/atoms/Switch/styled.ts +4 -6
- package/src/components/atoms/Tag/Tag.tsx +1 -1
- package/src/components/atoms/shared/PaperAndCard.ts +1 -1
- package/src/components/molecules/Calendar/index.ts +1 -1
- package/src/components/molecules/DatePicker/DatePicker.tsx +12 -8
- package/src/components/molecules/DateTimePicker/DateTimePicker.tsx +19 -11
- package/src/components/molecules/DateTimeSelector/DateTimeSelector.tsx +0 -1
- package/src/components/molecules/Grid/functions.ts +29 -0
- package/src/components/molecules/Grid/index.ts +66 -2
- package/src/components/molecules/HintInputContainer/HintInputContainer.tsx +6 -1
- package/src/components/molecules/IconTextButton/IconComponent.tsx +31 -0
- package/src/components/molecules/IconTextButton/IconTextButton.tsx +10 -0
- package/src/components/molecules/IconTextButton/index.ts +2 -0
- package/src/components/molecules/IconTextButton/styled.ts +20 -0
- package/src/components/molecules/LabeledSwitch/LabeledSwitch.tsx +9 -0
- package/src/components/molecules/LabeledSwitch/index.ts +1 -0
- package/src/components/molecules/Snackbar/Snackbar.tsx +1 -1
- package/src/components/molecules/Snackbar/styled.ts +6 -2
- package/src/components/molecules/TextArea/TextArea.tsx +6 -2
- package/src/components/molecules/TextArea/styled.ts +5 -2
- package/src/hooks/useDebouncedState.ts +1 -1
- package/src/index.ts +26 -6
- package/src/styles/definitions.ts +8 -1
- package/src/styles/light.ts +2 -0
- package/src/types/defaults.ts +11 -1
- package/src/utils/IPhoneXHelper.ts +27 -22
- package/src/utils/ResponsiveFontSize.ts +55 -36
- package/src/utils/index.ts +5 -4
- package/src/utils/variantComplement.ts +36 -0
- package/dist/components/molecules/Grid/Grid.d.ts +0 -15
- package/dist/components/molecules/Grid/Grid.js +0 -55
- package/dist/components/molecules/Grid/Grid.js.map +0 -1
- package/dist/components/molecules/Grid/Item/Item.d.ts +0 -30
- package/dist/components/molecules/Grid/Item/Item.js +0 -68
- package/dist/components/molecules/Grid/Item/Item.js.map +0 -1
- package/dist/components/molecules/Grid/Item/index.d.ts +0 -1
- package/dist/components/molecules/Grid/Item/index.js.map +0 -1
- package/src/components/molecules/Grid/Grid.stories.tsx +0 -132
- package/src/components/molecules/Grid/Grid.tsx +0 -87
- package/src/components/molecules/Grid/Item/Item.tsx +0 -93
- package/src/components/molecules/Grid/Item/index.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"PressableSurface.js","names":["COLOR_VARIATION_FACTOR","PressableSurface","children","surfaceColor","effect","effectIntensity","effectStyle","style","rest","theme","useTheme","effectBaseColor","miscellaneous","bgColor","readyStyle","prepareStyle","props","effectColor","lighten","lightenDarkenColor","darken","composedStyle","backgroundColor","pressed","applyEffectStyle","variation"],"sources":["../../../../src/components/atoms/PressableSurface/PressableSurface.tsx"],"sourcesContent":["import { useTheme } from '@emotion/react';\nimport React, { FC } from 'react';\nimport { Pressable, PressableProps, StyleProp, ViewStyle } from 'react-native';\nimport { ThemeProp } from '../../../types/defaults';\nimport { lightenDarkenColor } from '../../../utils';\n\nconst COLOR_VARIATION_FACTOR = 25;\n\nexport interface PressableSurfaceProps extends PressableProps {\n effect?: 'darken' | 'lighten' | 'none';\n surfaceColor?: string;\n effectIntensity?: number;\n effectStyle?: (pressed: boolean) => StyleProp<ViewStyle>;\n}\n\nconst PressableSurface: FC<PressableSurfaceProps> = ({\n children,\n surfaceColor,\n effect,\n effectIntensity,\n effectStyle,\n style,\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n let effectBaseColor = theme.miscellaneous.surfaceColor;\n let bgColor = 'transparent';\n\n if (surfaceColor) {\n effectBaseColor = surfaceColor;\n bgColor = effectBaseColor;\n }\n\n const readyStyle = prepareStyle(\n { effect, effectIntensity, style, effectStyle },\n effectBaseColor,\n bgColor\n );\n return (\n <Pressable {...rest} style={readyStyle}>\n {children}\n </Pressable>\n );\n};\n\nconst prepareStyle = (\n props: PressableSurfaceProps,\n effectColor: string,\n bgColor: string\n): any => {\n const {\n effect = 'darken',\n effectIntensity = COLOR_VARIATION_FACTOR,\n style,\n effectStyle,\n } = props;\n\n const lighten = lightenDarkenColor(effectColor, effectIntensity);\n const darken = lightenDarkenColor(effectColor, -effectIntensity);\n const composedStyle = [{ backgroundColor: bgColor }, style];\n\n if (effectStyle) {\n return ({ pressed }) => [composedStyle, effectStyle(pressed)];\n }\n\n switch (effect) {\n case 'darken':\n return applyEffectStyle(composedStyle, darken);\n\n case 'lighten':\n return applyEffectStyle(composedStyle, lighten);\n\n case 'none':\n return composedStyle;\n }\n};\n\nconst applyEffectStyle = (style: any, variation: string) => {\n return ({ pressed }) => [style, pressed && { backgroundColor: variation }];\n};\n\nexport default PressableSurface;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAEA;;;;;;AAEA,MAAMA,sBAAsB,GAAG,EAA/B;;AASA,MAAMC,gBAA2C,GAAG,CAAC;EACnDC,QADmD;EAEnDC,YAFmD;EAGnDC,MAHmD;EAInDC,eAJmD;EAKnDC,WALmD;EAMnDC,KANmD;EAOnD,GAAGC;AAPgD,CAAD,KAQ9C;EACJ,MAAMC,KAAK,GAA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AMG,gBAAgB,GAAG,CAACjB,KAAD,EAAakB,SAAb,KAAmC;EAC1D,OAAO,CAAC;IAAEF;EAAF,CAAD,KAAiB,CAAChB,KAAD,EAAQgB,OAAO,IAAI;IAAED,eAAe,EAAEG;EAAnB,CAAnB,CAAxB;AACD,CAFD;;eAIexB,gB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/PressableSurface/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/atoms/PressableSurface/index.ts"],"sourcesContent":["export {\n default as PressableSurface,\n PressableSurfaceProps,\n} from './PressableSurface';\n"],"mappings":";;;;;AAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ViewProps } from 'react-native';
|
|
3
|
-
import { ColorGradationType, ColorType } from '
|
|
3
|
+
import { ColorGradationType, ColorType } from '@tecsinapse/react-core';
|
|
4
4
|
export interface ProgressBarProps extends ViewProps {
|
|
5
5
|
segments?: number;
|
|
6
6
|
valueMin?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","names":["ProgressBar","segments","_segments","valueMin","valueNow","_valueNow","valueMax","color","colorTone","animate","animationParameters","rest","theme","useTheme","animationValue","React","useRef","Animated","Value","current","extractNumbersFromString","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"],"sources":["../../../../src/components/atoms/ProgressBar/ProgressBar.tsx"],"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 '@tecsinapse/react-core';\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 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"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAMA;;AACA;;;;;;AAqBA,MAAMA,WAAuC,GAAG,CAAC;EAC/CC,QAAQ,EAAEC,SAAS,GAAG,CADyB;EAE/CC,QAAQ,GAAG,CAFoC;EAG/CC,QAAQ,EAAEC,SAHqC;EAI/CC,QAAQ,GAAG,GAJoC;EAK/CC,KAAK,GAAG,SALuC;EAM/CC,SAAS,GAAG,QANmC;EAO/CC,OAP+C;EAQ/CC,mBAR+C;EAS/C,GAAGC;AAT4C,CAAD,KAU1C;EACJ,MAAMC,KAAK,GAAG,IAAAC,eAAA,GAAd;EACA,MAAMC,cAAc,GAAGC,KAAK,CAACC,MAAN,CAAa,IAAIC,qBAAA,CAASC,KAAb,CAAmB,CAAnB,CAAb,EAAoCC,OAA3D;EAEA,MAAMf,QAAQ,GACZ,OAAOC,SAAP,KAAqB,QAArB,GACI,IAAAe,+BAAA,EAAyBf,SAAzB,CADJ,GAEIA,SAHN;EAKA,MAAMgB,aAAa,GAAI,CAACjB,QAAQ,GAAGD,QAAZ,KAAyBG,QAAQ,GAAGH,QAApC,CAAD,GAAkD,GAAxE;EACA,MAAMF,QAAQ,GAAGqB,IAAI,CAACC,GAAL,CAAS,CAAT,EAAYrB,SAAZ,CAAjB;EACA,MAAMsB,YAAY,GAAG,MAAMF,IAAI,CAACC,GAAL,CAAStB,QAAT,CAA3B;EAEA,MAAMwB,KAAK,GAAG,CAAC,GAAGC,KAAK,CAACzB,QAAD,CAAL,CAAgB0B,IAAhB,EAAJ,CAAd;EAEA,MAAMC,cAAc,GAA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9B,cAAc,CAAC8B,WAAf,CAA6B;QAC7CC,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CADiC;QAE7CC,WAAW,EAAEH;MAFgC,CAA7B,CAAlB;IAID;;IAED,OACE,oBAAC,eAAD;MACE,GAAG,EAAEb,KADP;MAEE,KAAK,EAAE;QACLiB,gBAAgB,EAAEjB,KAAK,IAAI7B,QAAQ,GAAG,CAApB,GAAwB,CAAxB,GAA4B;MADzC;IAFT,GAME,oBAAC,gBAAD;MACE,KAAK,EAAE;QACLgC,KAAK,EAAEC,eADF;QAELc,eAAe,EAAEpC,KAAK,CAACL,KAAN,CAAYA,KAAZ,EAAmBC,SAAnB,CAFZ;QAGLuC,gBAAgB,EAAEd,KAAK,GAAG,CAAR,IAAaA,KAAK,GAAG,GAArB,GAA2B,CAA3B,GAA+B;MAH5C;IADT,EANF,CADF;EAgBD,CA/CsB,CAAvB;EAiDA,OAAO,oBAAC,iBAAD,EAAetB,IAAf,EAAsBiB,cAAtB,CAAP;AACD,CA3ED;;eA6Ee5B,W"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/ProgressBar/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/atoms/ProgressBar/index.ts"],"sourcesContent":["export { default as ProgressBar, ProgressBarProps } from './ProgressBar';\n"],"mappings":";;;;;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"styled.js","names":["Container","styled","View","theme","spacing","mili","Segment","color","secondary","light","RFValueStr","xlight","Progress","Animated"],"sources":["../../../../src/components/atoms/ProgressBar/styled.ts"],"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"],"mappings":";;;;;AAAA;;AACA;;AAEA;;;;AAEO,MAAMA,SAAS,GAAGC,eAAA,CAAOC,IAA0B;AAC1D;AACA,YAAY,CAAC;EAAEC;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAcC,IAAK;AAC9C,mBAAmB,CAAC;EAAEF;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAcC,IAAK;AACrD;AACA;AACA;AACA,CAPO;;AASA,MAAMC,OAAO,GAAGL,eAAA,CAAOC,IAA0B;AACxD;AACA,sBAAsB,CAAC;EAAEC;AAAF,CAAD,KAAeA,KAAK,CAACI,KAAN,CAAYC,SAAZ,CAAsBC,KAAM;AACjE,wBAAwB,IAAAC,iBAAA,EAAW,KAAX,CAAkB;AAC1C,kBAAkB,CAAC;EAAEP;AAAF,CAAD,KAAeA,KAAK,CAACI,KAAN,CAAYC,SAAZ,CAAsBG,MAAO;AAC9D,CALO;;AAOA,MAAMC,QAAQ,GAAG,IAAAX,eAAA,EAAOY,qBAAA,CAASX,IAAhB,CAA2C;AACnE;AACA,kBAAkB,CAAC;EAAEC;AAAF,CAAD,KAAeA,KAAK,CAACI,KAAN,CAAYC,SAAZ,CAAsBG,MAAO;AAC9D,CAHO"}
|
|
@@ -13,7 +13,7 @@ var _styled = require("./styled");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
17
|
|
|
18
18
|
const RadioButton = ({
|
|
19
19
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"RadioButton.js","names":["RadioButton","children","onChange","checked","labelPosition","disabled","color","colorTone","rest","handleChange"],"sources":["../../../../src/components/atoms/RadioButton/RadioButton.tsx"],"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"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAkBA,MAAMA,WAAiC,GAAG,CAAC;EACzCC,QADyC;EAEzCC,QAFyC;EAGzCC,OAHyC;EAIzCC,aAAa,GAAG,OAJyB;EAKzCC,QAAQ,GAAG,KAL8B;EAMzCC,KAAK,GAAG,SANiC;EAOzCC,SAAS,GAAG,QAP6B;EAQzC,GAAGC;AARsC,CAAD,KASvB;EACjB,MAAMC,YAAY,GAAG,MAAM;IACzBP,QAAQ,IAAIA,QAAQ,CAAC,CAACC,OAAF,CAApB;EACD,CAFD;;EAIA,OACE,6BAAC,sBAAD,eACMK,IADN;IAEE,QAAQ,EAAEH,QAFZ;IAGE,OAAO,EAAEI,YAHX;IAIE,iBAAiB,EAAC;EAJpB,IAME,6BAAC,kBAAD,QACGL,aAAa,KAAK,MAAlB,IAA4BH,QAD/B,EAEGE,OAAO,IACN,6BAAC,sBAAD,QACE,6BAAC,mBAAD,QACE,6BAAC,kBAAD,QACE,6BAAC,UAAD;IACE,IAAI,EAAC,QADP;IAEE,YAAY,EAAEG,KAFhB;IAGE,SAAS,EAAEC,SAHb;IAIE,IAAI,EAAC,oBAJP;IAKE,IAAI,EAAC;EALP,EADF,CADF,CADF,CAHJ,EAiBG,CAACJ,OAAD,IACC,6BAAC,sBAAD,QACE,6BAAC,mBAAD,QACE,6BAAC,kBAAD,QACE,6BAAC,UAAD;IACE,IAAI,EAAC,QADP;IAEE,SAAS,EAAC,OAFZ;IAGE,IAAI,EAAC,oBAHP;IAIE,IAAI,EAAC;EAJP,EADF,CADF,CADF,CAlBJ,EA+BGC,aAAa,KAAK,OAAlB,IAA6BH,QA/BhC,CANF,CADF;AA0CD,CAxDD;;eA0DeD,W"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/RadioButton/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/atoms/RadioButton/index.ts"],"sourcesContent":["export { default as RadioButton, RadioButtonProps } from './RadioButton';\n"],"mappings":";;;;;AAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.ViewStyled = exports.
|
|
4
|
+
exports.ViewStyled = exports.ScaledView = exports.IconWrapper = exports.IconViewStyled = void 0;
|
|
5
5
|
|
|
6
6
|
var _native = _interopRequireDefault(require("@emotion/native"));
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"styled.js","names":["IconWrapper","styled","View","theme","borderRadius","pill","color","colorTone","borderWidth","nano","miscellaneous","surfaceColor","ScaledView","IconViewStyled","spacing","mili","ViewStyled"],"sources":["../../../../src/components/atoms/RadioButton/styled.ts"],"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"],"mappings":";;;;;AAAA;;AACA;;;;AAIO,MAAMA,WAAW,GAAG,IAAAC,eAAA,EAAOC,iBAAP,CAAqD;AAChF,mBAAmB,CAAC;EAAEC;AAAF,CAAD,KAA2BA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AACtE,kBAAkB,CAAC;EACfF,KADe;EAEfG,KAAK,GAAG,SAFO;EAGfC,SAAS,GAAG;AAHG,CAAD,KAIqBJ,KAAK,CAACG,KAAN,CAAYA,KAAZ,EAAmBC,SAAnB,CAA8B;AACrE,kBAAkB,CAAC;EAAEJ;AAAF,CAAD,KAA2BA,KAAK,CAACK,WAAN,CAAkBC,IAAK;AACpE,sBAAsB,CAAC;EAAEN;AAAF,CAAD,KAClBA,KAAK,CAACO,aAAN,CAAoBC,YAAa;AACrC,CAVO;;AAYA,MAAMC,UAAU,GAAG,IAAAX,eAAA,EAAOC,iBAAP,CAAa;AACvC;AACA,CAFO;;AAIA,MAAMW,cAAc,GAAG,IAAAZ,eAAA,EAAOC,iBAAP,CAAkC;AAChE,aAAa,CAAC;EAAEC;AAAF,CAAD,KAA2BA,KAAK,CAACW,OAAN,CAAcC,IAAK;AAC3D,CAFO;;AAIA,MAAMC,UAAU,GAAG,IAAAf,eAAA,EAAOC,iBAAP,CAAa;AACvC;AACA;AACA,CAHO"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import { ColorGradationType, ColorType } from '
|
|
3
|
+
import { ColorGradationType, ColorType } from '@tecsinapse/react-core';
|
|
4
4
|
export interface SwitchProps {
|
|
5
5
|
onChange: (active: boolean) => void;
|
|
6
6
|
active: boolean;
|
|
@@ -21,7 +21,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
|
-
function _extends() { _extends = Object.assign
|
|
24
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
25
25
|
|
|
26
26
|
const Switch = ({
|
|
27
27
|
onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Switch.js","names":["Switch","onChange","activeColor","activeColorTone","inactiveColor","inactiveColorTone","active","dotStyle","disabled","rest","theme","useTheme","width","React","useRef","transitionValue","Animated","Value","current","animatedColor","calculateTranslate","extractNumbersFromString","spacing","micro","RFValueStr","SWITCH_PIN_WIDTH","getBackgroundColor","color","lightenDarkenColor","interpolateColor","interpolate","inputRange","outputRange","useEffect","translate","transitionSwitch","handleChange","useCallback","handleSwitchLayout","lce","nativeEvent","layout","backgroundColor","transform","translateX"],"sources":["../../../../src/components/atoms/Switch/Switch.tsx"],"sourcesContent":["import { useTheme } from '@emotion/react';\nimport React, { FC, useCallback, useEffect } from 'react';\nimport {\n Animated,\n LayoutChangeEvent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport {\n ColorGradationType,\n ColorType,\n ThemeProp,\n} from '@tecsinapse/react-core';\nimport {\n extractNumbersFromString,\n lightenDarkenColor,\n RFValueStr,\n} 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 (\n width.current -\n extractNumbersFromString(theme.spacing.micro) * 2 -\n extractNumbersFromString(RFValueStr(SWITCH_PIN_WIDTH))\n );\n }\n return 0;\n };\n\n const getBackgroundColor = (color: string) => {\n return disabled\n ? lightenDarkenColor(theme.color[inactiveColor][inactiveColorTone], 20)\n : 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\n onLayout={handleSwitchLayout}\n style={{ backgroundColor: interpolateColor }}\n >\n <StyledSwitch\n style={[dotStyle, { transform: [{ translateX: transitionValue }] }]}\n />\n </StyledSwitchContent>\n </PressableSurface>\n );\n};\n\nexport default Switch;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAWA;;AAKA;;AACA;;AACA;;;;;;;;AAcA,MAAMA,MAAuB,GAAG,CAAC;EAC/BC,QAD+B;EAE/BC,WAAW,GAAG,SAFiB;EAG/BC,eAAe,GAAG,QAHa;EAI/BC,aAAa,GAAG,WAJe;EAK/BC,iBAAiB,GAAG,OALW;EAM/BC,MAN+B;EAO/BC,QAP+B;EAQ/BC,QAAQ,GAAG,KARoB;EAS/B,GAAGC;AAT4B,CAAD,KAUb;EACjB,MAAMC,KAAK,GAAG,IAAAC,eAAA,GAAd;;EAEA,MAAMC,KAAK,GAAGC,eAAA,CAAMC,MAAN,CAAa,CAAb,CAAd;;EACA,MAAMC,eAAe,GAAGF,eAAA,CAAMC,MAAN,CAAa,IAAIE,qBAAA,CAASC,KAAb,CAAmB,CAAnB,CAAb,EAAoCC,OAA5D;;EACA,MAAMC,aAAa,GAAGN,eAAA,CAAMC,MAAN,CAAa,IAAIE,qBAAA,CAASC,KAAb,CAAmB,CAAnB,CAAb,EAAoCC,OAA1D;;EAEA,MAAME,kBAAkB,GAAG,MAAM;IAC/B,IAAIR,KAAK,CAACM,OAAN,GAAgB,CAApB,EAAuB;MACrB,OACEN,KAAK,CAACM,OAAN,GACA,IAAAG,+BAAA,EAAyBX,KAAK,CAACY,OAAN,CAAcC,KAAvC,IAAgD,CADhD,GAEA,IAAAF,+BAAA,EAAyB,IAAAG,iBAAA,EAAWC,wBAAX,CAAzB,CAHF;IAKD;;IACD,OAAO,CAAP;EACD,CATD;;EAWA,MAAMC,kBAAkB,GAAIC,KAAD,IAAmB;IAC5C,OAAOnB,QAAQ,GACX,IAAAoB,yBAAA,EAAmBlB,KAAK,CAACiB,KAAN,CAAYvB,aAAZ,EAA2BC,i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EAAE,CAACtB,QAAD,EAAW;MAAEoC,SAAS,EAAE,CAAC;QAAEC,UAAU,EAAE7B;MAAd,CAAD;IAAb,CAAX;EADT,EAJF,CANF,CADF;AAiBD,CA1ED;;eA4Eef,M"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"animation.js","names":["ANIMATION_SPEED","transitionSwitch","active","translate","transitionValue","animatedColor","Animated","timing","toValue","duration","easing","Easing","out","ease","useNativeDriver","start"],"sources":["../../../../src/components/atoms/Switch/animation.ts"],"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 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"],"mappings":";;;;;AAAA;;AAEA,MAAMA,eAAe,GAAG,GAAxB;;AAEO,MAAMC,gBAAgB,GAAG,CAC9BC,MAD8B,EAE9BC,SAF8B,EAG9BC,eAH8B,EAI9BC,aAJ8B,KAKrB;EACT,IAAIF,SAAS,IAAI,CAAjB,EAAoB;;EAEpB,IAAID,MAAJ,EAAY;IACVI,qBAAA,CAASC,MAAT,CAAgBH,eAAhB,EAAiC;MAC/BI,OAAO,EAAEL,SADsB;MAE/BM,QAAQ,EAAET,eAFqB;MAG/BU,MAAM,EAAEC,mBAAA,CAAOC,GAAP,CAAWD,mBAAA,CAAOE,IAAlB,CAHuB;MAI/BC,eAAe,EAAE;IAJc,CAAjC,EAKGC,KALH;;IAMAT,qBAAA,CAASC,MAAT,CAAgBF,aAAhB,EAA+B;MAC7BG,OAAO,EAAE,CADoB;MAE7BC,QAAQ,EAAET,eAFmB;MAG7Bc,eAAe,EAAE;IAHY,CAA/B,EAIGC,KAJH;;IAKA;EACD;;EAEDT,qBAAA,CAASC,MAAT,CAAgBH,eAAhB,EAAiC;IAC/BI,OAAO,EAAE,CADsB;IAE/BC,QAAQ,EAAET,eAFqB;IAG/BU,MAAM,EAAEC,mBAAA,CAAOC,GAAP,CAAWD,mBAAA,CAAOE,IAAlB,CAHuB;IAI/BC,eAAe,EAAE;EAJc,CAAjC,EAKGC,KALH;;EAMAT,qBAAA,CAASC,MAAT,CAAgBF,aAAhB,EAA+B;IAC7BG,OAAO,EAAE,CADoB;IAE7BC,QAAQ,EAAET,eAFmB;IAG7Bc,eAAe,EAAE;EAHY,CAA/B,EAIGC,KAJH;AAKD,CAlCM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Switch/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/atoms/Switch/index.ts"],"sourcesContent":["export { default as Switch, SwitchProps } from './Switch';\n"],"mappings":";;;;;AAAA"}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Animated } from 'react-native';
|
|
3
1
|
export declare const SWITCH_BODY_WIDTH = "40px";
|
|
4
2
|
export declare const SWITCH_PIN_WIDTH = "16px";
|
|
5
|
-
export declare const StyledSwitchContent: import("@emotion/native").StyledComponent<
|
|
6
|
-
|
|
7
|
-
} & {
|
|
8
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
9
|
-
as?: import("react").ElementType<any> | undefined;
|
|
10
|
-
} & Partial<import("../../../types/defaults").ThemeProviderProps>, {}, {}>;
|
|
11
|
-
export declare const StyledSwitch: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>> & {
|
|
12
|
-
children?: import("react").ReactNode;
|
|
13
|
-
} & {
|
|
14
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
15
|
-
as?: import("react").ElementType<any> | undefined;
|
|
16
|
-
} & Partial<import("../../../types/defaults").ThemeProviderProps>, {}, {}>;
|
|
3
|
+
export declare const StyledSwitchContent: import("@emotion/native").StyledComponent<any, {}, {}>;
|
|
4
|
+
export declare const StyledSwitch: import("@emotion/native").StyledComponent<any, {}, {}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.StyledSwitchContent = exports.StyledSwitch = exports.SWITCH_PIN_WIDTH = exports.SWITCH_BODY_WIDTH = void 0;
|
|
5
5
|
|
|
6
6
|
var _native = _interopRequireDefault(require("@emotion/native"));
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"styled.js","names":["SWITCH_BODY_WIDTH","SWITCH_PIN_WIDTH","StyledSwitchContent","styled","Animated","View","theme","borderRadius","pill","spacing","micro","RFValueStr","StyledSwitch","miscellaneous","surfaceColor"],"sources":["../../../../src/components/atoms/Switch/styled.ts"],"sourcesContent":["import styled from '@emotion/native';\nimport { Animated } from 'react-native';\nimport { StyleProps } from '@tecsinapse/react-core';\nimport { RFValueStr } from '../../../utils';\n\nexport const SWITCH_BODY_WIDTH = '40px';\nexport const SWITCH_PIN_WIDTH = '16px';\n\nexport const StyledSwitchContent = styled(Animated.View)<Partial<StyleProps>>`\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"],"mappings":";;;;;AAAA;;AACA;;AAEA;;;;AAEO,MAAMA,iBAAiB,GAAG,MAA1B;;AACA,MAAMC,gBAAgB,GAAG,MAAzB;;AAEA,MAAMC,mBAAmB,GAAG,IAAAC,eAAA,EAAOC,qBAAA,CAASC,IAAhB,CAA2C;AAC9E,mBAAmB,CAAC;EAAEC;AAAF,CAAD,KAAeA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AAC1D,eAAe,CAAC;EAAEF;AAAF,CAAD,KAAeA,KAAK,CAACG,OAAN,CAAcC,KAAM;AAClD;AACA,WAAW,IAAAC,iBAAA,EAAWX,iBAAX,CAA8B;AACzC,YAAY,IAAAW,iBAAA,EAAW,MAAX,CAAmB;AAC/B,CANO;;AAQA,MAAMC,YAAY,GAAG,IAAAT,eAAA,EAAOC,qBAAA,CAASC,IAAhB,CAA2C;AACvE,mBAAmB,CAAC;EAAEC;AAAF,CAAD,KAAeA,KAAK,CAACC,YAAN,CAAmBC,IAAK;AAC1D,sBAAsB,CAAC;EAAEF;AAAF,CAAD,KAAeA,KAAK,CAACO,aAAN,CAAoBC,YAAa;AACtE,WAAW,IAAAH,iBAAA,EAAWV,gBAAX,CAA6B;AACxC,YAAY,IAAAU,iBAAA,EAAW,MAAX,CAAmB;AAC/B,CALO"}
|
|
@@ -15,7 +15,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
|
|
18
|
-
function _extends() { _extends = Object.assign
|
|
18
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
19
|
|
|
20
20
|
const Tag = ({
|
|
21
21
|
value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Tag.js","names":["Tag","value","icon","variant","dismiss","canDismiss","onDismiss","style","rest","setDismiss","useState","fadeAnim","React","useRef","Animated","Value","current","duration","fadeOut","timing","toValue","useNativeDriver","start","handleDismiss","useCallback","setTimeout","opacity","size","colorVariant"],"sources":["../../../../src/components/atoms/Tag/Tag.tsx"],"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"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;AAUA,MAAMA,GAAuB,GAAG,CAAC;EAC/BC,KAD+B;EAE/BC,IAF+B;EAG/BC,OAAO,GAAG,OAHqB;EAI/BC,OAAO,EAAEC,UAAU,GAAG,KAJS;EAK/BC,SAL+B;EAM/BC,KAN+B;EAO/B,GAAGC;AAP4B,CAAD,KAQb;EACjB,MAAM,CAACJ,OAAD,EAAUK,UAAV,IAAwB,IAAAC,eAAA,EAAS,KAAT,CAA9B;;EACA,MAAMC,QAAQ,GAAGC,cAAA,CAAMC,MAAN,CAAa,IAAIC,qBAAA,CAASC,KAAb,CAAmB,CAAnB,CAAb,EAAoCC,OAArD;;EACA,MAAMC,QAAQ,GAAG,GAAjB;;EAEA,MAAMC,OAAO,GAAG,MAAM;IACpBJ,qBAAA,CAASK,MAAT,CAAgBR,QAAhB,EAA0B;MACxBS,OAAO,EAAE,CADe;MAExBH,QAFwB;MAGxBI,eAAe,EAAE;IAHO,CAA1B,EAIGC,KAJH;EAKD,CAND;;EAQA,MAAMC,aAAa,GAAG,IAAAC,kBAAA,EAAY,MAAM;IACtClB,SAAS,QAAT,YAAAA,SAAS;IACTY,OAAO;IACPO,UAAU,CAAC,MAAMhB,UAAU,CAAC,IAAD,CAAjB,EAAyBQ,QAAzB,CAAV;EACD,CAJqB,EAInB,CAACX,SAAD,CAJmB,CAAtB;EAMA,OACE,6BAAC,0BAAD,eACME,IADN;IAEE,OAAO,EAAEL,OAFX;IAGE,KAAK,EAAE,CAAC;MAAEuB,OAAO,EAAEf;IAAX,CAAD,EAA6CJ,KAA7C,CAHT;IAIE,OAAO,EAAE,CAACH;EAJZ,IAMGF,IAAI,IACH,6BAAC,sBAAD;IACE,IAAI,EAAEA,IAAI,CAACyB,IAAL,IAAa,OADrB;IAEE,YAAY,EAAEzB,IAAI,CAAC0B,YAAL,IAAqB;EAFrC,GAGM1B,IAHN,EAPJ,EAaGD,KAbH,EAcGI,UAAU,IACT,6BAAC,kCAAD;IAAkB,OAAO,EAAEkB;EAA3B,GACE,6BAAC,uBAAD;IACE,IAAI,EAAC,eADP;IAEE,IAAI,EAAC,SAFP;IAGE,IAAI,EAAC,OAHP;IAIE,SAAS,EAAC;EAJZ,EADF,CAfJ,CADF;AA2BD,CAtDD;;eAwDevB,G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Tag/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/atoms/Tag/index.ts"],"sourcesContent":["export { default as Tag, TagProps } from './Tag';\n"],"mappings":";;;;;AAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.StyledTagContainer = exports.StyledLeftIcon = exports.StyledCloseIcon = void 0;
|
|
5
5
|
|
|
6
6
|
var _native = _interopRequireWildcard(require("@emotion/native"));
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"styled.js","names":["smallVariant","theme","variant","css","borderRadius","micro","spacing","nano","mili","defaultVariant","centi","StyledTagContainerBase","styled","Animated","View","miscellaneous","bodyColor","visible","StyledTagContainer","props","StyledLeftIcon","Icon","StyledCloseIcon"],"sources":["../../../../src/components/atoms/Tag/styled.ts"],"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"],"mappings":";;;;;AAAA;;AACA;;AAEA;;;;;;AAGA,MAAMA,YAAY,GAAG,CAAC;EAAEC,KAAF;EAASC;AAAT,CAAD,KACnBA,OAAO,KAAK,OAAZ,IACA,IAAAC,WAAA,CAAI;AACN,qBAAqBF,KAAK,CAACG,YAAN,CAAmBC,KAAM;AAC9C,eAAeJ,KAAK,CAACK,OAAN,CAAcC,IAAK,IAAGN,KAAK,CAACK,OAAN,CAAcE,IAAK;AACxD,GALA;;AAOA,MAAMC,cAAc,GAAG,CAAC;EAAER,KAAF;EAASC;AAAT,CAAD,KACrBA,OAAO,KAAK,SAAZ,IACA,IAAAC,WAAA,CAAI;AACN,qBAAqBF,KAAK,CAACG,YAAN,CAAmBI,IAAK;AAC7C,eAAeP,KAAK,CAACK,OAAN,CAAcD,KAAM,IAAGJ,KAAK,CAACK,OAAN,CAAcI,KAAM;AAC1D,GALA;;AAOA,MAAMC,sBAAsB,GAAG,IAAAC,eAAA,EAAOC,qBAAA,CAASC,IAAhB,CAE7B;AACF,sBAAsB,CAAC;EAAEb;AAAF,CAAD,KAAeA,KAAK,CAACc,aAAN,CAAoBC,SAAU;AACnE;AACA;AACA;AACA;AACA,aAAa,CAAC;EAAEC;AAAF,CAAD,KAAkBA,OAAO,GAAG,MAAH,GAAY,MAAQ;AAC1D,CATA;AAWO,MAAMC,kBAAkB,GAAG,IAAAN,eAAA,EAAOD,sBAAP,EAChCQ,KAAK,IAAI,IAAAhB,WAAA,CAAI;AACf,MAAMH,YAAY,CAACmB,KAAD,CAAQ;AAC1B,MAAMV,cAAc,CAACU,KAAD,CAAQ;AAC5B,GAJkC,CAA3B;;AAOA,MAAMC,cAAc,GAAG,IAAAR,eAAA,EAAOS,UAAP,CAA8C;AAC5E,kBAAkB,CAAC;EAAEpB;AAAF,CAAD,KAAeA,KAAK,CAACK,OAAN,CAAcD,KAAM;AACrD,CAFO;;AAIA,MAAMiB,eAAe,GAAG,IAAAV,eAAA,EAAOS,UAAP,CAA8C;AAC7E,iBAAiB,CAAC;EAAEpB;AAAF,CAAD,KAAeA,KAAK,CAACK,OAAN,CAAcC,IAAK;AACnD,CAFO"}
|
|
@@ -11,7 +11,7 @@ var _functions = require("./functions");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
function _extends() { _extends = Object.assign
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
15
|
|
|
16
16
|
const Text = ({
|
|
17
17
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Text.js","names":["Text","children","style","fontColor","colorTone","colorVariant","fontWeight","typography","numberOfLines","ellipsizeMode","textTransform","capitalFirst","rest","getLabel"],"sources":["../../../../src/components/atoms/Text/Text.tsx"],"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 children?: React.ReactNode;\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"],"mappings":";;;;;AAAA;;AAUA;;AACA;;;;;;AAwBA,MAAMA,IAAmB,GAAG,CAAC;EAC3BC,QAD2B;EAE3BC,KAF2B;EAG3BC,SAAS,GAAG,MAHe;EAI3BC,SAAS,GAAG,QAJe;EAK3BC,YAL2B;EAM3BC,UAAU,GAAG,SANc;EAO3BC,UAAU,GAAG,MAPc;EAQ3BC,aAR2B;EAS3BC,aAT2B;EAU3BC,aAAa,GAAG,MAVW;EAW3BC,YAAY,GAAG,KAXY;EAY3B,GAAGC;AAZwB,CAAD,KAaT;EACjB,OACE,6BAAC,yBAAD,eACMA,IADN;IAEE,KAAK,EAAEV,KAFT;IAGE,SAAS,EAAEC,SAHb;IAIE,SAAS,EAAEC,SAJb;IAKE,YAAY,EAAEC,YALhB;IAME,UAAU,EAAEC,UANd;IAOE,UAAU,EAAEC,UAPd;IAQE,aAAa,EAAEC,aARjB;IASE,aAAa,EAAEC,aATjB;IAUE,aAAa,EAAEC;EAVjB,IAYG,IAAAG,mBAAA,EAASZ,QAAT,EAAmBU,YAAnB,CAZH,CADF;AAgBD,CA9BD;;eAgCeX,I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"functions.js","names":["getFirstCapitalCharacter","value","charAt","toUpperCase","concat","slice","getLabel","children","capitalFirst"],"sources":["../../../../src/components/atoms/Text/functions.ts"],"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"],"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Text/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/atoms/Text/index.ts"],"sourcesContent":["export { default as Text, TextProps } from './Text';\n"],"mappings":";;;;;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"styled.js","names":["StyledText","styled","RNText","theme","fontColor","font","color","fontWeight","weight","typography","fontSize","lineHeight","fontStack","stack","textTransform","colorStyles","colorVariant","colorTone","css","StyledColoredText"],"sources":["../../../../src/components/atoms/Text/styled.ts"],"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"],"mappings":";;;;;AAAA;;AAEA;;;;;;AAEO,MAAMA,UAAU,GAAG,IAAAC,eAAA,EAAOC,iBAAP,CAAgD;AAC1E,WAAW,CAAC;EAAEC,KAAF;EAASC,SAAS,GAAG;AAArB,CAAD,KAAmCD,KAAK,CAACE,IAAN,CAAWC,KAAX,CAAiBF,SAAjB,CAA4B;AAC1E,iBAAiB,CAAC;EAAED,KAAF;EAASI,UAAU,GAAG;AAAtB,CAAD,KACbJ,KAAK,CAACE,IAAN,CAAWG,MAAX,CAAkBD,UAAlB,CAA8B;AAClC,eAAe,CAAC;EAAEJ,KAAF;EAASM,UAAU,GAAG;AAAtB,CAAD,KACXN,KAAK,CAACM,UAAN,CAAiBA,UAAjB,EAA6BC,QAAS;AAC1C,iBAAiB,CAAC;EAAEP,KAAF;EAASM,UAAU,GAAG;AAAtB,CAAD,KACbN,KAAK,CAACM,UAAN,CAAiBA,UAAjB,EAA6BE,UAAW;AAC5C,iBAAiB,CAAC;EAAER,KAAF;EAASS,SAAS,GAAG;AAArB,CAAD,KACZ,IAAGT,KAAK,CAACE,IAAN,CAAWQ,KAAX,CAAiBD,SAAjB,CAA4B,GAAG;AACvC,oBAAoB,CAAC;EAAEE,aAAa,GAAG;AAAlB,CAAD,KAAiC,GAAEA,aAAc,EAAE;AACvE,CAXO;;;AAaP,MAAMC,WAAW,GAAG,CAAC;EACnBC,YADmB;EAEnBC,SAFmB;EAGnBd;AAHmB,CAAD,KAKlBa,YAAY,IACZC,SADA,IAEA,IAAAC,WAAA,CAAI;AACN,aAAaf,KAAK,CAACG,KAAN,CAAYU,YAAZ,EAA0BC,SAA1B,CAAqC;AAClD,GATA;;AAWO,MAAME,iBAAiB,GAAG,IAAAlB,eAAA,EAAOD,UAAP,EAE/Be,WAF+B,CAA1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"PaperAndCard.js","names":["baseStyles","theme","css","borderRadius","mili","miscellaneous","surfaceColor","elevatedStyles","elevated","shadowColor","shadow","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation"],"sources":["../../../../src/components/atoms/shared/PaperAndCard.ts"],"sourcesContent":["import { css } from '@emotion/native';\nimport { StyleProps } from '@tecsinapse/react-core';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const baseStyles = ({ theme }: StyleProps): any => css`\n border-radius: ${theme.borderRadius.mili};\n background-color: ${theme.miscellaneous.surfaceColor};\n`;\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const elevatedStyles = ({\n theme,\n elevated = false,\n}: { elevated?: boolean } & StyleProps): any =>\n elevated && [\n css({\n shadowColor: theme.miscellaneous.shadow,\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.05,\n shadowRadius: 5,\n elevation: 2,\n }),\n ];\n/* eslint-enable @typescript-eslint/no-explicit-any */\n"],"mappings":";;;;;AAAA;;AAIO,MAAMA,UAAU,GAAG,CAAC;EAAEC;AAAF,CAAD,KAAgC,IAAAC,WAAA,CAAI;AAC9D,mBAAmBD,KAAK,CAACE,YAAN,CAAmBC,IAAK;AAC3C,sBAAsBH,KAAK,CAACI,aAAN,CAAoBC,YAAa;AACvD,CAHO;;;;AAMA,MAAMC,cAAc,GAAG,CAAC;EAC7BN,KAD6B;EAE7BO,QAAQ,GAAG;AAFkB,CAAD,KAI5BA,QAAQ,IAAI,CACV,IAAAN,WAAA,EAAI;EACFO,WAAW,EAAER,KAAK,CAACI,aAAN,CAAoBK,MAD/B;EAEFC,YAAY,EAAE;IAAEC,KAAK,EAAE,CAAT;IAAYC,MAAM,EAAE;EAApB,CAFZ;EAGFC,aAAa,EAAE,IAHb;EAIFC,YAAY,EAAE,CAJZ;EAKFC,SAAS,EAAE;AALT,CAAJ,CADU,CAJP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Calendar.js","names":["now","set","Date","date","hours","minutes","seconds","milliseconds","dayOfWeekFromWeekStart","dayOfWeek","weekStartsOn","Calendar","TextComponent","Text","year","_year","month","_month","value","type","onChange","locale","rest","_referenceDate","React","useMemo","getFullYear","referenceDate","setReferenceDate","useState","startingWeekDay","getDay","options","weeksInMonth","getWeeksInMonth","Capitalized","getCapitalizedTextComponent","calendar","Array","keys","map","week","weekDayIndex","add","days","handlePressNext","useCallback","months","handlePressPrev","format","index"],"sources":["../../../../src/components/molecules/Calendar/Calendar.tsx"],"sourcesContent":["import { add, format, getWeeksInMonth, set } from 'date-fns';\nimport * as React from 'react';\nimport { View, ViewProps } from 'react-native';\nimport { Icon } from '../../atoms/Icon';\nimport { Text, TextProps } from '../../atoms/Text';\nimport {\n Content,\n Control,\n getCapitalizedTextComponent,\n TitleContainer,\n} from './styled';\nimport { Weekdays, MonthWeek } from './components';\n\nexport type SelectionType = 'range' | 'day';\n\nexport type DateRange = { lowest: Date; highest?: Date };\n\nexport type Value<T extends SelectionType> = T extends 'range'\n ? DateRange\n : Date;\n\nexport interface CalendarProps<T extends SelectionType> extends ViewProps {\n TextComponent?: React.FC<TextProps>;\n year?: number;\n month?: number;\n onChange?: (value?: Value<T>) => void | never;\n type?: T;\n value?: Value<T>;\n locale?: Locale;\n}\n\nconst now = set(new Date(), {\n date: 1,\n hours: 0,\n minutes: 0,\n seconds: 0,\n milliseconds: 0,\n});\n\nfunction dayOfWeekFromWeekStart(dayOfWeek: number, weekStartsOn: number) {\n return dayOfWeek === 0 ? 0 : dayOfWeek - weekStartsOn;\n}\n\nfunction Calendar<T extends SelectionType>({\n TextComponent = Text,\n year: _year,\n month: _month,\n value,\n type,\n onChange,\n locale,\n ...rest\n}: CalendarProps<T>): JSX.Element {\n const _referenceDate = React.useMemo(\n () =>\n _year && _month\n ? new Date(_year, _month, 1, 0, 0, 0, 0)\n : _month\n ? new Date(now.getFullYear(), _month, 1, 0, 0, 0, 0)\n : now,\n [_year, _month]\n );\n\n const [referenceDate, setReferenceDate] = React.useState(_referenceDate);\n\n const startingWeekDay = React.useMemo(\n () =>\n dayOfWeekFromWeekStart(\n referenceDate.getDay(),\n locale?.options?.weekStartsOn ?? 0\n ),\n [referenceDate, locale]\n );\n\n const weeksInMonth = React.useMemo(\n () =>\n getWeeksInMonth(referenceDate, {\n weekStartsOn: locale?.options?.weekStartsOn ?? 0,\n }),\n [referenceDate, locale]\n );\n\n const Capitalized = React.useMemo(\n () => getCapitalizedTextComponent(TextComponent),\n [TextComponent]\n );\n\n const calendar = React.useMemo(\n () =>\n [...Array(weeksInMonth).keys()].map(week =>\n [...Array(7).keys()].map(weekDayIndex =>\n add(referenceDate, {\n days: 6 * week + week + weekDayIndex - startingWeekDay,\n })\n )\n ),\n [weeksInMonth, startingWeekDay, referenceDate]\n );\n\n const handlePressNext = React.useCallback(() => {\n setReferenceDate(add(referenceDate, { months: 1 }));\n }, [referenceDate, setReferenceDate]);\n\n const handlePressPrev = React.useCallback(() => {\n setReferenceDate(add(referenceDate, { months: -1 }));\n }, [referenceDate, setReferenceDate]);\n\n return (\n <View {...rest}>\n <TitleContainer>\n <Control onPress={handlePressPrev} align={'start'} isLeft>\n <Icon\n name={'chevron-left'}\n type={'material-community'}\n size={'kilo'}\n colorVariant={'secondary'}\n colorTone={'medium'}\n />\n </Control>\n <Capitalized\n colorVariant={'secondary'}\n colorTone={'xdark'}\n fontWeight={'bold'}\n >\n {format(referenceDate, 'MMMM yyyy', { locale })}\n </Capitalized>\n <Control onPress={handlePressNext} align={'end'} isRright>\n <Icon\n name={'chevron-right'}\n type={'material-community'}\n size={'kilo'}\n colorVariant={'secondary'}\n colorTone={'medium'}\n />\n </Control>\n </TitleContainer>\n <Content>\n <Weekdays\n locale={locale}\n calendar={calendar}\n Capitalized={Capitalized}\n />\n {calendar.map((week, index) => (\n <MonthWeek\n week={week}\n type={type}\n value={value}\n key={`week-${index}`}\n onChange={onChange}\n TextComponent={TextComponent}\n referenceDate={referenceDate}\n />\n ))}\n </Content>\n </View>\n );\n}\n\nexport default Calendar;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAMA;;;;;;AAoBA,MAAMA,GAAG,GAAG,IAAAC,YAAA,EAAI,IAAIC,IAAJ,EAAJ,EAAgB;EAC1BC,IAAI,EAAE,CADoB;EAE1BC,KAAK,EAAE,CAFmB;EAG1BC,OAAO,EAAE,CAHiB;EAI1BC,OAAO,EAAE,CAJiB;EAK1BC,YAAY,EAAE;AALY,CAAhB,CAAZ;;AAQA,SAASC,sBAAT,CAAgCC,SAAhC,EAAmDC,YAAnD,EAAyE;EACvE,OAAOD,SAAS,KAAK,CAAd,GAAkB,CAAlB,GAAsBA,SAAS,GAAGC,YAAzC;AACD;;AAED,SAASC,QAAT,CAA2C;EACzCC,aAAa,GAAGC,UADyB;EAEzCC,IAAI,EAAEC,KAFmC;EAGzCC,KAAK,EAAEC,MAHkC;EAIzCC,KAJyC;EAKzCC,IALyC;EAMzCC,QANyC;EAOzCC,MAPyC;EAQzC,GAAGC;AARsC,CAA3C,EASkC;EAChC,MAAMC,cAAc,GAAGC,KAAK,CAACC,OAAN,CACrB,MACEV,KAAK,IAAIE,MAAT,GACI,IAAIf,IAAJ,CAASa,KAAT,EAAgBE,MAAhB,EAAwB,CAAxB,EAA2B,CAA3B,EAA8B,CAA9B,EAAiC,CAAjC,EAAoC,CAApC,CADJ,GAEIA,MAAM,GACN,IAAIf,IAAJ,CAASF,GAAG,CAAC0B,WAAJ,EAAT,EAA4BT,MAA5B,EAAoC,CAApC,EAAuC,CAAvC,EAA0C,CAA1C,EAA6C,CAA7C,EAAgD,CAAhD,CADM,GAENjB,GANe,EAOrB,CAACe,KAAD,EAAQE,MAAR,CAPqB,CAAvB;;EAUA,MAAM,CAACU,aAAD,EAAgBC,gBAAhB,IAAoCJ,KAAK,CAACK,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,GAAT,CAAa,CAACC,IAAD,EAAOS,KAAP,KACZ,oBAAC,qBAAD;IACE,IAAI,EAAET,IADR;IAEE,IAAI,EAAEtB,IAFR;IAGE,KAAK,EAAED,KAHT;IAIE,GAAG,EAAG,QAAOgC,KAAM,EAJrB;IAKE,QAAQ,EAAE9B,QALZ;IAME,aAAa,EAAER,aANjB;IAOE,aAAa,EAAEe;EAPjB,EADD,CANH,CA5BF,CADF;AAiDD;;eAEchB,Q"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"MonthWeek.js","names":["MonthWeek","week","referenceDate","type","value","TextComponent","onChange","checkIfIsBetween","React","useCallback","date","_value","lowest","highest","compare","checkIfIsSelected","isSameDay","handlePressCell","newValue","undefined","map","index","isSelected","isBetween","isRangeStart","isRangeEnd","colorTone","getMonth","getDate","memo"],"sources":["../../../../../src/components/molecules/Calendar/components/MonthWeek.tsx"],"sourcesContent":["import React from 'react';\nimport { compareAsc as compare, isSameDay } from 'date-fns';\nimport { Cell, Selected, Week } from '../styled';\nimport { Value, DateRange, SelectionType } from '../Calendar';\nimport { TextProps } from '@tecsinapse/react-core';\n\ninterface IMonthWeek<T extends SelectionType> {\n TextComponent: React.FC<TextProps>;\n /** any as workaround for TS type mismatching */\n onChange?: (value?: any) => void | never;\n type?: T;\n value?: Value<T>;\n week: Date[];\n referenceDate: Date;\n}\n\nconst MonthWeek = <T extends SelectionType>({\n week,\n referenceDate,\n type,\n value,\n TextComponent,\n onChange,\n}: IMonthWeek<T>) => {\n const checkIfIsBetween = React.useCallback(\n (date: Date, _value?: Value<T>) => {\n if (type !== 'range' || !_value) return false;\n else {\n const { lowest, highest } = _value as DateRange;\n if (!highest) return false;\n return compare(lowest, date) <= 0 && compare(highest, date) >= 0;\n }\n },\n [type]\n );\n\n const checkIfIsSelected = React.useCallback(\n (date: Date, _value?: Value<T>) => {\n if (!_value) return false;\n else if (type === 'range' && _value) {\n const { lowest, highest } = _value as DateRange;\n return (\n isSameDay(lowest, date) ||\n (highest ? isSameDay(highest, date) : false)\n );\n } else {\n return isSameDay(_value as Date, date);\n }\n },\n [type]\n );\n\n const handlePressCell = React.useCallback(\n (date: Date, _value?: Value<T>) => () => {\n if (type === 'day') {\n onChange?.(date as never);\n } else if (!_value) {\n onChange?.({ lowest: date } as never);\n } else {\n let newValue;\n const { lowest, highest } = _value as DateRange;\n\n if (!highest) {\n if (compare(date, lowest) === -1) {\n newValue = { lowest: date, highest: undefined };\n } else if (compare(date, lowest) === 0) {\n newValue = undefined;\n } else {\n newValue = { lowest: lowest, highest: date };\n }\n } else {\n if (compare(date, lowest) === -1) {\n newValue = { lowest: date, highest: undefined };\n } else if (compare(date, lowest) === 0) {\n newValue = undefined;\n } else {\n if (compare(date, highest) === -1) {\n newValue = { lowest: lowest, highest: date };\n } else if (compare(date, highest) === 0) {\n newValue = { lowest: lowest, highest: undefined };\n } else {\n newValue = { lowest: lowest, highest: date };\n }\n }\n }\n\n onChange?.(newValue as never);\n }\n },\n [onChange, type]\n );\n\n return (\n <Week>\n {week.map((date, index) => {\n const isSelected = checkIfIsSelected(date, value);\n const isBetween = checkIfIsBetween(date, value);\n\n let isRangeStart, isRangeEnd;\n\n if (type === 'range' && value) {\n const { lowest, highest } = value as DateRange;\n isRangeStart = highest && isSameDay(lowest, date);\n isRangeEnd = !!highest && isSameDay(highest, date);\n } else {\n isRangeStart = false;\n isRangeEnd = false;\n }\n\n const colorTone = isSelected\n ? 'xlight'\n : date.getMonth() === referenceDate.getMonth()\n ? 'xdark'\n : 'light';\n\n return (\n <Cell\n key={date.getDate()}\n selected={isSelected}\n highlighted={isBetween}\n isLineEnd={index === 6}\n isLineStart={index === 0}\n isRangeStart={isRangeStart}\n isRangeEnd={isRangeEnd}\n onPress={handlePressCell(date, value)}\n >\n <Selected selected={isSelected} pointerEvents={'none'}>\n <TextComponent colorVariant={'secondary'} colorTone={colorTone}>\n {date.getDate()}\n </TextComponent>\n </Selected>\n </Cell>\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N,UAFZ;MAGE,WAAW,EAAEC,SAHf;MAIE,SAAS,EAAEF,KAAK,KAAK,CAJvB;MAKE,WAAW,EAAEA,KAAK,KAAK,CALzB;MAME,YAAY,EAAEG,YANhB;MAOE,UAAU,EAAEC,UAPd;MAQE,OAAO,EAAER,eAAe,CAACP,IAAD,EAAON,KAAP;IAR1B,GAUE,6BAAC,gBAAD;MAAU,QAAQ,EAAEkB,UAApB;MAAgC,aAAa,EAAE;IAA/C,GACE,6BAAC,aAAD;MAAe,YAAY,EAAE,WAA7B;MAA0C,SAAS,EAAEI;IAArD,GACGhB,IAAI,CAACkB,OAAL,EADH,CADF,CAVF,CADF;EAkBD,CAvCA,CADH,CADF;AA4CD,CAxHD;;eA0HepB,cAAA,CAAMqB,IAAN,CAAW7B,SAAX,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Weekdays.js","names":["Weekdays","calendar","locale","Capitalized","map","date","getDate","format","slice","React","memo"],"sources":["../../../../../src/components/molecules/Calendar/components/Weekdays.tsx"],"sourcesContent":["import React from 'react';\nimport { Cell, Week } from '../styled';\nimport { format } from 'date-fns';\n\ninterface IWeekdays {\n calendar: Date[][];\n locale?: Locale;\n Capitalized: React.ElementType;\n}\n\nconst Weekdays = ({ calendar, locale, Capitalized }: IWeekdays) => {\n return (\n <Week>\n {calendar[0].map(date => (\n <Cell\n key={date.getDate()}\n selected={false}\n highlighted={false}\n isLineEnd={false}\n isLineStart={false}\n isRangeStart={false}\n isRangeEnd={false}\n pointerEvents={'none'}\n >\n <Capitalized colorVariant={'secondary'} colorTone={'medium'}>\n {format(date, 'EEE', { locale }).slice(0, 3)}\n </Capitalized>\n </Cell>\n ))}\n </Week>\n );\n};\n\nexport default React.memo(Weekdays);\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAQA,MAAMA,QAAQ,GAAG,CAAC;EAAEC,QAAF;EAAYC,MAAZ;EAAoBC;AAApB,CAAD,KAAkD;EACjE,OACE,6BAAC,YAAD,QACGF,QAAQ,CAAC,CAAD,CAAR,CAAYG,GAAZ,CAAgBC,IAAI,IACnB,6BAAC,YAAD;IACE,GAAG,EAAEA,IAAI,CAACC,OAAL,EADP;IAEE,QAAQ,EAAE,KAFZ;IAGE,WAAW,EAAE,KAHf;IAIE,SAAS,EAAE,KAJb;IAKE,WAAW,EAAE,KALf;IAME,YAAY,EAAE,KANhB;IAOE,UAAU,EAAE,KAPd;IAQE,aAAa,EAAE;EARjB,GAUE,6BAAC,WAAD;IAAa,YAAY,EAAE,WAA3B;IAAwC,SAAS,EAAE;EAAnD,GACG,IAAAC,eAAA,EAAOF,IAAP,EAAa,KAAb,EAAoB;IAAEH;EAAF,CAApB,EAAgCM,KAAhC,CAAsC,CAAtC,EAAyC,CAAzC,CADH,CAVF,CADD,CADH,CADF;AAoBD,CArBD;;eAuBeC,cAAA,CAAMC,IAAN,CAAWV,QAAX,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/molecules/Calendar/components/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/molecules/Calendar/components/index.ts"],"sourcesContent":["export { default as Weekdays } from './Weekdays';\nexport { default as MonthWeek } from './MonthWeek';\n"],"mappings":";;;;;AAAA;;;;AACA"}
|