fluent-styles 1.33.0 → 1.35.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/lib/commonjs/package/dialog/index.js +3 -2
- package/lib/commonjs/package/dialog/index.js.map +1 -1
- package/lib/commonjs/package/form/index.js +1 -1
- package/lib/commonjs/package/form/index.js.map +1 -1
- package/lib/module/package/dialog/index.js +3 -2
- package/lib/module/package/dialog/index.js.map +1 -1
- package/lib/module/package/form/index.js +1 -1
- package/lib/module/package/form/index.js.map +1 -1
- package/package.json +1 -1
- package/src/package/dialog/index.jsx +3 -2
- package/src/package/form/index.jsx +1 -1
|
@@ -53,7 +53,8 @@ const StyledConfirmDialog = ({
|
|
|
53
53
|
cancel = 'Cancel',
|
|
54
54
|
onNeural,
|
|
55
55
|
confirm = 'Confirm',
|
|
56
|
-
neutral = 'Neutral'
|
|
56
|
+
neutral = 'Neutral',
|
|
57
|
+
isNeutral = false
|
|
57
58
|
} = rest;
|
|
58
59
|
const handleConfirm = () => {
|
|
59
60
|
setShow(false);
|
|
@@ -120,7 +121,7 @@ const StyledConfirmDialog = ({
|
|
|
120
121
|
fontWeight: _theme.theme.fontWeight.normal
|
|
121
122
|
}, cancel)), /*#__PURE__*/_react.default.createElement(_spacer.StyledSpacer, {
|
|
122
123
|
marginHorizontal: 2
|
|
123
|
-
}), onNeural && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_button.StyledButton, {
|
|
124
|
+
}), onNeural && isNeutral && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_button.StyledButton, {
|
|
124
125
|
backgroundColor: _theme.theme.colors.orange[400],
|
|
125
126
|
borderColor: _theme.theme.colors.orange[400],
|
|
126
127
|
borderRadius: 30,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_stack","_text","_button","_spacer","_styled","_theme","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","Dialog","styled","Modal","base","backgroundColor","theme","colors","gray","padding","borderRadius","StyledDialog","children","animationType","transparent","visible","rest","createElement","exports","StyledConfirmDialog","row","onCancel","onConfirm","dialogProps","show","setShow","useState","title","description","cancel","onNeural","confirm","neutral","handleConfirm","handleCancel","handleNeural","YStack","flex","justifyContent","alignItems","width","paddingVertical","paddingHorizontal","StyledText","color","fontSize","normal","fontWeight","bold","StyledSpacer","marginVertical","large","XStack","StyledButton","red","borderColor","onPress","marginHorizontal","Fragment","orange","green","StyledOkDialog","ok","onOk","handleOk","cyan"],"sources":["index.jsx"],"sourcesContent":["import React, { useState } from 'react'\r\nimport { Modal } from 'react-native'\r\nimport { XStack, YStack } from '../stack'\r\nimport { StyledText } from '../text'\r\nimport { StyledButton } from '../button'\r\nimport { StyledSpacer } from '../spacer'\r\nimport { styled } from '../styled'\r\nimport { theme } from '../theme'\r\n\r\nconst Dialog = styled(Modal, {\r\n base: {\r\n backgroundColor: theme.colors.gray[100],\r\n padding: 20,\r\n borderRadius: 10\r\n }\r\n})\r\n\r\nconst StyledDialog = ({\r\n children,\r\n animationType = 'fade',\r\n transparent = true,\r\n visible = false,\r\n ...rest\r\n}) => {\r\n return (\r\n <Dialog\r\n visible={visible}\r\n transparent={transparent}\r\n animationType={animationType}\r\n {...rest}\r\n >\r\n {children}\r\n </Dialog>\r\n )\r\n}\r\n\r\nconst StyledConfirmDialog = ({\r\n visible = false,\r\n row,\r\n animationType = 'fade',\r\n onCancel,\r\n onConfirm,\r\n transparent = true,\r\n dialogProps,\r\n ...rest\r\n}) => {\r\n const [show, setShow] = useState(visible)\r\n const {\r\n title,\r\n description,\r\n cancel = 'Cancel',\r\n onNeural,\r\n confirm = 'Confirm',\r\n neutral = 'Neutral'\r\n } = rest\r\n\r\n const handleConfirm = () => {\r\n setShow(false)\r\n if (typeof onConfirm === 'function') {\r\n if (typeof row === 'object' && row !== null) {\r\n onConfirm(row)\r\n } else {\r\n onConfirm()\r\n }\r\n }\r\n }\r\n const handleCancel = () => {\r\n setShow(false)\r\n if (typeof onCancel === 'function') {\r\n onCancel()\r\n }\r\n }\r\n\r\n const handleNeural = () => {\r\n setShow(false)\r\n if (typeof onNeural === 'function') {\r\n onNeural()\r\n }\r\n }\r\n return (\r\n <Dialog\r\n visible={show}\r\n transparent={transparent}\r\n animationType={animationType}\r\n {...rest}\r\n >\r\n <YStack\r\n transparent\r\n flex={1}\r\n justifyContent='center'\r\n alignItems='center'\r\n {...dialogProps}\r\n >\r\n <YStack\r\n width={'90%'}\r\n borderRadius={8}\r\n paddingVertical={16}\r\n paddingHorizontal={16}\r\n backgroundColor={theme.colors.gray[1]}\r\n >\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.bold}\r\n >\r\n {title}\r\n </StyledText>\r\n <StyledSpacer marginVertical={1} />\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.large}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {description}\r\n </StyledText>\r\n <StyledSpacer marginVertical={4} />\r\n <XStack justifyContent='flex-end' alignItems='center'>\r\n <StyledButton\r\n backgroundColor={theme.colors.red[400]}\r\n borderColor={theme.colors.red[400]}\r\n borderRadius={30}\r\n onPress={() => handleCancel()}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={4}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {cancel}\r\n </StyledText>\r\n </StyledButton>\r\n <StyledSpacer marginHorizontal={2} />\r\n {onNeural && (\r\n <>\r\n <StyledButton\r\n backgroundColor={theme.colors.orange[400]}\r\n borderColor={theme.colors.orange[400]}\r\n borderRadius={30}\r\n onPress={() => handleNeural()}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={4}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {neutral}\r\n </StyledText>\r\n </StyledButton>\r\n <StyledSpacer marginHorizontal={2} />\r\n </>\r\n )}\r\n <StyledButton\r\n backgroundColor={theme.colors.green[500]}\r\n borderColor={theme.colors.green[500]}\r\n onPress={() => handleConfirm()}\r\n borderRadius={30}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={4}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {confirm}\r\n </StyledText>\r\n </StyledButton>\r\n </XStack>\r\n </YStack>\r\n </YStack>\r\n </Dialog>\r\n )\r\n}\r\n\r\nconst StyledOkDialog = ({\r\n visible = false,\r\n animationType = 'fade',\r\n transparent = true,\r\n dialogProps,\r\n ...rest\r\n}) => {\r\n const [show, setShow] = useState(visible)\r\n const {\r\n title = \"We're sorry, something went wrong.\",\r\n description = 'Please try again later',\r\n ok = 'Ok',\r\n onOk\r\n } = rest\r\n\r\n const handleOk = () => {\r\n setShow(false)\r\n if (typeof onOk === 'function') {\r\n onOk()\r\n }\r\n }\r\n return (\r\n <Dialog\r\n visible={show}\r\n transparent={transparent}\r\n animationType={animationType}\r\n {...rest}\r\n >\r\n <YStack\r\n transparent\r\n flex={1}\r\n justifyContent='center'\r\n alignItems='center'\r\n {...dialogProps}\r\n >\r\n <YStack\r\n width={'90%'}\r\n borderRadius={8}\r\n paddingVertical={16}\r\n paddingHorizontal={16}\r\n backgroundColor={theme.colors.gray[1]}\r\n >\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.bold}\r\n >\r\n {title}\r\n </StyledText>\r\n <StyledSpacer marginVertical={2} />\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {description}\r\n </StyledText>\r\n <StyledSpacer marginVertical={8} />\r\n <XStack justifyContent='flex-end' alignItems='center'>\r\n <StyledButton\r\n flex={1}\r\n backgroundColor={theme.colors.cyan[500]}\r\n borderColor={theme.colors.cyan[500]}\r\n onPress={handleOk}\r\n borderRadius={30}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={8}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.large}\r\n fontWeight={theme.fontWeight.bold}\r\n >\r\n {ok}\r\n </StyledText>\r\n </StyledButton>\r\n </XStack>\r\n </YStack>\r\n </YStack>\r\n </Dialog>\r\n )\r\n}\r\n\r\nexport { StyledDialog, StyledConfirmDialog, StyledOkDialog }\r\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAgC,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG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M,CAAC0D,IAAI,CAAC,GAAG,CAAE;IACpCT,OAAO,EAAEQ,QAAS;IAClBtD,YAAY,EAAE;EAAG,gBAEjB7C,MAAA,CAAAgB,OAAA,CAAAoC,aAAA,CAAC/C,KAAA,CAAAyE,UAAU;IACTD,iBAAiB,EAAE,EAAG;IACtBD,eAAe,EAAE,CAAE;IACnBG,KAAK,EAAEtC,YAAK,CAACC,MAAM,CAACC,IAAI,CAAC,CAAC,CAAE;IAC5BqC,QAAQ,EAAEvC,YAAK,CAACuC,QAAQ,CAACM,KAAM;IAC/BJ,UAAU,EAAEzC,YAAK,CAACyC,UAAU,CAACC;EAAK,GAEjCc,EACS,CACA,CACR,CACF,CACF,CACF,CAAC;AAEb,CAAC;AAAA5C,OAAA,CAAA2C,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_stack","_text","_button","_spacer","_styled","_theme","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","Dialog","styled","Modal","base","backgroundColor","theme","colors","gray","padding","borderRadius","StyledDialog","children","animationType","transparent","visible","rest","createElement","exports","StyledConfirmDialog","row","onCancel","onConfirm","dialogProps","show","setShow","useState","title","description","cancel","onNeural","confirm","neutral","isNeutral","handleConfirm","handleCancel","handleNeural","YStack","flex","justifyContent","alignItems","width","paddingVertical","paddingHorizontal","StyledText","color","fontSize","normal","fontWeight","bold","StyledSpacer","marginVertical","large","XStack","StyledButton","red","borderColor","onPress","marginHorizontal","Fragment","orange","green","StyledOkDialog","ok","onOk","handleOk","cyan"],"sources":["index.jsx"],"sourcesContent":["import React, { useState } from 'react'\r\nimport { Modal } from 'react-native'\r\nimport { XStack, YStack } from '../stack'\r\nimport { StyledText } from '../text'\r\nimport { StyledButton } from '../button'\r\nimport { StyledSpacer } from '../spacer'\r\nimport { styled } from '../styled'\r\nimport { theme } from '../theme'\r\n\r\nconst Dialog = styled(Modal, {\r\n base: {\r\n backgroundColor: theme.colors.gray[100],\r\n padding: 20,\r\n borderRadius: 10\r\n }\r\n})\r\n\r\nconst StyledDialog = ({\r\n children,\r\n animationType = 'fade',\r\n transparent = true,\r\n visible = false,\r\n ...rest\r\n}) => {\r\n return (\r\n <Dialog\r\n visible={visible}\r\n transparent={transparent}\r\n animationType={animationType}\r\n {...rest}\r\n >\r\n {children}\r\n </Dialog>\r\n )\r\n}\r\n\r\nconst StyledConfirmDialog = ({\r\n visible = false,\r\n row,\r\n animationType = 'fade',\r\n onCancel,\r\n onConfirm,\r\n transparent = true,\r\n dialogProps,\r\n ...rest\r\n}) => {\r\n const [show, setShow] = useState(visible)\r\n const {\r\n title,\r\n description,\r\n cancel = 'Cancel',\r\n onNeural,\r\n confirm = 'Confirm',\r\n neutral = 'Neutral',\r\n isNeutral= false\r\n } = rest\r\n\r\n const handleConfirm = () => {\r\n setShow(false)\r\n if (typeof onConfirm === 'function') {\r\n if (typeof row === 'object' && row !== null) {\r\n onConfirm(row)\r\n } else {\r\n onConfirm()\r\n }\r\n }\r\n }\r\n const handleCancel = () => {\r\n setShow(false)\r\n if (typeof onCancel === 'function') {\r\n onCancel()\r\n }\r\n }\r\n\r\n const handleNeural = () => {\r\n setShow(false)\r\n if (typeof onNeural === 'function') {\r\n onNeural()\r\n }\r\n }\r\n return (\r\n <Dialog\r\n visible={show}\r\n transparent={transparent}\r\n animationType={animationType}\r\n {...rest}\r\n >\r\n <YStack\r\n transparent\r\n flex={1}\r\n justifyContent='center'\r\n alignItems='center'\r\n {...dialogProps}\r\n >\r\n <YStack\r\n width={'90%'}\r\n borderRadius={8}\r\n paddingVertical={16}\r\n paddingHorizontal={16}\r\n backgroundColor={theme.colors.gray[1]}\r\n >\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.bold}\r\n >\r\n {title}\r\n </StyledText>\r\n <StyledSpacer marginVertical={1} />\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.large}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {description}\r\n </StyledText>\r\n <StyledSpacer marginVertical={4} />\r\n <XStack justifyContent='flex-end' alignItems='center'>\r\n <StyledButton\r\n backgroundColor={theme.colors.red[400]}\r\n borderColor={theme.colors.red[400]}\r\n borderRadius={30}\r\n onPress={() => handleCancel()}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={4}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {cancel}\r\n </StyledText>\r\n </StyledButton>\r\n <StyledSpacer marginHorizontal={2} />\r\n {(onNeural && isNeutral) && (\r\n <>\r\n <StyledButton\r\n backgroundColor={theme.colors.orange[400]}\r\n borderColor={theme.colors.orange[400]}\r\n borderRadius={30}\r\n onPress={() => handleNeural()}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={4}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {neutral}\r\n </StyledText>\r\n </StyledButton>\r\n <StyledSpacer marginHorizontal={2} />\r\n </>\r\n )}\r\n <StyledButton\r\n backgroundColor={theme.colors.green[500]}\r\n borderColor={theme.colors.green[500]}\r\n onPress={() => handleConfirm()}\r\n borderRadius={30}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={4}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {confirm}\r\n </StyledText>\r\n </StyledButton>\r\n </XStack>\r\n </YStack>\r\n </YStack>\r\n </Dialog>\r\n )\r\n}\r\n\r\nconst StyledOkDialog = ({\r\n visible = false,\r\n animationType = 'fade',\r\n transparent = true,\r\n dialogProps,\r\n ...rest\r\n}) => {\r\n const [show, setShow] = useState(visible)\r\n const {\r\n title = \"We're sorry, something went wrong.\",\r\n description = 'Please try again later',\r\n ok = 'Ok',\r\n onOk\r\n } = rest\r\n\r\n const handleOk = () => {\r\n setShow(false)\r\n if (typeof onOk === 'function') {\r\n onOk()\r\n }\r\n }\r\n return (\r\n <Dialog\r\n visible={show}\r\n transparent={transparent}\r\n animationType={animationType}\r\n {...rest}\r\n >\r\n <YStack\r\n transparent\r\n flex={1}\r\n justifyContent='center'\r\n alignItems='center'\r\n {...dialogProps}\r\n >\r\n <YStack\r\n width={'90%'}\r\n borderRadius={8}\r\n paddingVertical={16}\r\n paddingHorizontal={16}\r\n backgroundColor={theme.colors.gray[1]}\r\n >\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.bold}\r\n >\r\n {title}\r\n </StyledText>\r\n <StyledSpacer marginVertical={2} />\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {description}\r\n </StyledText>\r\n <StyledSpacer marginVertical={8} />\r\n <XStack justifyContent='flex-end' alignItems='center'>\r\n <StyledButton\r\n flex={1}\r\n backgroundColor={theme.colors.cyan[500]}\r\n borderColor={theme.colors.cyan[500]}\r\n onPress={handleOk}\r\n borderRadius={30}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={8}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.large}\r\n fontWeight={theme.fontWeight.bold}\r\n >\r\n {ok}\r\n </StyledText>\r\n </StyledButton>\r\n </XStack>\r\n </YStack>\r\n </YStack>\r\n </Dialog>\r\n )\r\n}\r\n\r\nexport { StyledDialog, StyledConfirmDialog, StyledOkDialog }\r\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAA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
76
76
|
borderRadius: value
|
|
77
77
|
};
|
|
78
78
|
},
|
|
79
|
-
borderColor: (value = _theme.theme.colors.gray[
|
|
79
|
+
borderColor: (value = _theme.theme.colors.gray[800]) => {
|
|
80
80
|
if (!(0, _utils.isValidColor)(value)) {
|
|
81
81
|
throw new Error('Invalid borderColor value');
|
|
82
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_stack","_text","_spacer","_theme","_styled","_utils","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","StyledInputText","exports","InputText","styled","TextInput","base","borderColor","theme","colors","gray","borderWidth","borderRadius","backgroundColor","fontWeight","normal","width","color","paddingHorizontal","paddingVertical","fontSize","placeholderTextColor","variants","size","isValidString","Error","isValidColor","isValidNumber","fontFamily","font","textAlign","align","validAlignments","includes","value","noBorder","true","StyledInput","forwardRef","label","containerProps","errorMessage","error","errorProps","labelProps","rest","ref","createElement","Fragment","YStack","justifyContent","alignItems","StyledText","StyledSpacer","marginVertical","pink","marginHorizontal","bold","small","StyledMultiInput","textAlignVertical","multiline","numberOfLines","inputMode","_default"],"sources":["index.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\r\nimport { TextInput } from 'react-native';\r\nimport { YStack } from '../stack';\r\nimport { StyledText } from '../text';\r\nimport { StyledSpacer } from '../spacer';\r\nimport { theme } from '../theme';\r\nimport { styled } from '../styled';\r\nimport { isValidColor, isValidNumber, isValidString } from '../utils';\r\n\r\nconst StyledInputText = styled(TextInput, {\r\n base: {\r\n borderColor: theme.colors.gray[800],\r\n borderWidth: 1,\r\n borderRadius: 30,\r\n backgroundColor: theme.fontWeight.normal[1],\r\n width: '100%',\r\n color: theme.colors.gray[800],\r\n paddingHorizontal: 16,\r\n paddingVertical: 8,\r\n fontSize: theme.fontSize.normal,\r\n placeholderTextColor: theme.colors.gray[1],\r\n },\r\n variants: {\r\n fontWeight: (size = theme.fontWeight.normal) => {\r\n if (!isValidString(size)) {\r\n throw new Error('Invalid fontWeight value');\r\n }\r\n return { fontWeight: size };\r\n },\r\n color: (color = theme.colors.gray[800]) => {\r\n if (!isValidColor(color)) {\r\n throw new Error('Invalid color value');\r\n }\r\n return { color: color };\r\n },\r\n fontSize: (size = theme.fontSize.normal) => {\r\n if (!isValidNumber(size)) {\r\n throw new Error('Invalid fontSize value');\r\n }\r\n return { fontSize: size };\r\n },\r\n fontFamily: font => {\r\n if (!font) return\r\n return {\r\n fontFamily: font\r\n }\r\n },\r\n textAlign: (align = 'left') => {\r\n const validAlignments = ['auto', 'left', 'right', 'center', 'justify'];\r\n if (!validAlignments.includes(align)) {\r\n throw new Error('Invalid textAlign value');\r\n }\r\n return { textAlign: align };\r\n },\r\n borderRadius: (value = 16) => {\r\n if (!isValidNumber(value)) {\r\n throw new Error('Invalid borderRadius value');\r\n }\r\n return { borderRadius: value };\r\n },\r\n borderColor: (value = theme.colors.gray[100]) => {\r\n if (!isValidColor(value)) {\r\n throw new Error('Invalid borderColor value');\r\n }\r\n return { borderColor: value };\r\n },\r\n backgroundColor: (value = theme.colors.gray[1]) => {\r\n if (!isValidColor(value)) {\r\n throw new Error('Invalid backgroundColor value');\r\n }\r\n return { backgroundColor: value };\r\n },\r\n noBorder: {\r\n true: { borderWidth: 0 }\r\n },\r\n placeholderTextColor: (value = theme.colors.gray[800]) => {\r\n if (!isValidColor(value)) {\r\n throw new Error('Invalid placeholderTextColor value');\r\n }\r\n return { placeholderTextColor: value };\r\n } \r\n }\r\n});\r\n\r\nconst StyledInput = forwardRef(({ label, containerProps, borderColor, errorMessage, error, errorProps, labelProps, ...rest }, ref) => {\r\n return (\r\n <>\r\n {\r\n label && (\r\n <YStack width={'100%'} justifyContent='flex-start' alignItems='flex-start' {...containerProps} >\r\n <StyledText paddingHorizontal={8} color={theme.colors.gray[800]} fontSize={theme.fontSize.normal} fontWeight={theme.fontWeight.normal} {...labelProps}>\r\n {label}\r\n </StyledText>\r\n <StyledSpacer marginVertical={4} />\r\n </YStack>\r\n )\r\n }\r\n <StyledInputText placeholderTextColor={theme.colors.gray[400]} ref={ref} {...rest} borderColor={error ? theme.colors.pink[500] : borderColor} />\r\n {\r\n errorMessage && (\r\n <YStack width={'100%'} justifyContent='flex-start' alignItems='flex-start' {...containerProps} >\r\n <StyledSpacer marginVertical={1} />\r\n <StyledText marginHorizontal={8} fontWeight={theme.fontWeight.bold} fontSize={theme.fontSize.small} color={theme.colors.pink[500]} {...errorProps}>\r\n {errorMessage}\r\n </StyledText>\r\n </YStack>\r\n )\r\n }\r\n </>\r\n )\r\n})\r\nconst StyledMultiInput = ({ label, errorMessage, borderColor, error, errorProps, labelProps, ...rest }) => {\r\n return (\r\n <YStack width={'100%'} justifyContent='flex-start' alignItems='flex-start'>\r\n {\r\n label && (\r\n <>\r\n <StyledSpacer marginVertical={4} />\r\n <StyledText paddingHorizontal={8} color={theme.colors.gray[800]} fontSize={theme.fontSize.normal} fontWeight={theme.fontWeight.normal} {...labelProps}>\r\n {label}\r\n </StyledText>\r\n <StyledSpacer marginVertical={4} />\r\n </>\r\n\r\n )\r\n }\r\n <StyledInputText borderRadius={16} textAlignVertical='top' multiline numberOfLines={5} inputMode='text' {...rest} borderColor={error ? theme.colors.pink[500] : borderColor} />\r\n {\r\n errorMessage && (\r\n <>\r\n <StyledSpacer marginVertical={1} />\r\n <StyledText marginHorizontal={8} fontWeight={theme.fontWeight.bold} fontSize={theme.fontSize.small} color={theme.colors.pink[500]} {...errorProps}>\r\n {errorMessage}\r\n </StyledText>\r\n </>\r\n )\r\n }\r\n\r\n </YStack>\r\n )\r\n}\r\n\r\nexport { StyledInput, StyledMultiInput, StyledInputText as InputText }\r\nexport default StyledInputText"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,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AA,CAAAkE,aAAA,CAAC9C,eAAe,EAAAN,QAAA;IAACiB,YAAY,EAAE,EAAG;IAACgD,iBAAiB,EAAC,KAAK;IAACC,SAAS;IAACC,aAAa,EAAE,CAAE;IAACC,SAAS,EAAC;EAAM,GAAKlB,IAAI;IAAEtC,WAAW,EAAEmC,KAAK,GAAGlC,YAAK,CAACC,MAAM,CAAC8C,IAAI,CAAC,GAAG,CAAC,GAAGhD;EAAY,EAAE,CAAC,EAE3KkC,YAAY,iBACR5E,MAAA,CAAAgB,OAAA,CAAAkE,aAAA,CAAAlF,MAAA,CAAAgB,OAAA,CAAAmE,QAAA,qBACInF,MAAA,CAAAgB,OAAA,CAAAkE,aAAA,CAAC5E,OAAA,CAAAkF,YAAY;IAACC,cAAc,EAAE;EAAE,CAAE,CAAC,eACnCzF,MAAA,CAAAgB,OAAA,CAAAkE,aAAA,CAAC7E,KAAA,CAAAkF,UAAU,EAAAzD,QAAA;IAAC6D,gBAAgB,EAAE,CAAE;IAAC1C,UAAU,EAAEN,YAAK,CAACM,UAAU,CAAC2C,IAAK;IAACrC,QAAQ,EAAEZ,YAAK,CAACY,QAAQ,CAACsC,KAAM;IAACzC,KAAK,EAAET,YAAK,CAACC,MAAM,CAAC8C,IAAI,CAAC,GAAG;EAAE,GAAKZ,UAAU,GAC5IF,YACO,CACd,CAIN,CAAC;AAEjB,CAAC;AAAAvC,OAAA,CAAAyD,gBAAA,GAAAA,gBAAA;AAAA,IAAAK,QAAA,GAAA9D,OAAA,CAAArB,OAAA,GAGcoB,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_stack","_text","_spacer","_theme","_styled","_utils","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","StyledInputText","exports","InputText","styled","TextInput","base","borderColor","theme","colors","gray","borderWidth","borderRadius","backgroundColor","fontWeight","normal","width","color","paddingHorizontal","paddingVertical","fontSize","placeholderTextColor","variants","size","isValidString","Error","isValidColor","isValidNumber","fontFamily","font","textAlign","align","validAlignments","includes","value","noBorder","true","StyledInput","forwardRef","label","containerProps","errorMessage","error","errorProps","labelProps","rest","ref","createElement","Fragment","YStack","justifyContent","alignItems","StyledText","StyledSpacer","marginVertical","pink","marginHorizontal","bold","small","StyledMultiInput","textAlignVertical","multiline","numberOfLines","inputMode","_default"],"sources":["index.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\r\nimport { TextInput } from 'react-native';\r\nimport { YStack } from '../stack';\r\nimport { StyledText } from '../text';\r\nimport { StyledSpacer } from '../spacer';\r\nimport { theme } from '../theme';\r\nimport { styled } from '../styled';\r\nimport { isValidColor, isValidNumber, isValidString } from '../utils';\r\n\r\nconst StyledInputText = styled(TextInput, {\r\n base: {\r\n borderColor: theme.colors.gray[800],\r\n borderWidth: 1,\r\n borderRadius: 30,\r\n backgroundColor: theme.fontWeight.normal[1],\r\n width: '100%',\r\n color: theme.colors.gray[800],\r\n paddingHorizontal: 16,\r\n paddingVertical: 8,\r\n fontSize: theme.fontSize.normal,\r\n placeholderTextColor: theme.colors.gray[1],\r\n },\r\n variants: {\r\n fontWeight: (size = theme.fontWeight.normal) => {\r\n if (!isValidString(size)) {\r\n throw new Error('Invalid fontWeight value');\r\n }\r\n return { fontWeight: size };\r\n },\r\n color: (color = theme.colors.gray[800]) => {\r\n if (!isValidColor(color)) {\r\n throw new Error('Invalid color value');\r\n }\r\n return { color: color };\r\n },\r\n fontSize: (size = theme.fontSize.normal) => {\r\n if (!isValidNumber(size)) {\r\n throw new Error('Invalid fontSize value');\r\n }\r\n return { fontSize: size };\r\n },\r\n fontFamily: font => {\r\n if (!font) return\r\n return {\r\n fontFamily: font\r\n }\r\n },\r\n textAlign: (align = 'left') => {\r\n const validAlignments = ['auto', 'left', 'right', 'center', 'justify'];\r\n if (!validAlignments.includes(align)) {\r\n throw new Error('Invalid textAlign value');\r\n }\r\n return { textAlign: align };\r\n },\r\n borderRadius: (value = 16) => {\r\n if (!isValidNumber(value)) {\r\n throw new Error('Invalid borderRadius value');\r\n }\r\n return { borderRadius: value };\r\n },\r\n borderColor: (value = theme.colors.gray[800]) => {\r\n if (!isValidColor(value)) {\r\n throw new Error('Invalid borderColor value');\r\n }\r\n return { borderColor: value };\r\n },\r\n backgroundColor: (value = theme.colors.gray[1]) => {\r\n if (!isValidColor(value)) {\r\n throw new Error('Invalid backgroundColor value');\r\n }\r\n return { backgroundColor: value };\r\n },\r\n noBorder: {\r\n true: { borderWidth: 0 }\r\n },\r\n placeholderTextColor: (value = theme.colors.gray[800]) => {\r\n if (!isValidColor(value)) {\r\n throw new Error('Invalid placeholderTextColor value');\r\n }\r\n return { placeholderTextColor: value };\r\n } \r\n }\r\n});\r\n\r\nconst StyledInput = forwardRef(({ label, containerProps, borderColor, errorMessage, error, errorProps, labelProps, ...rest }, ref) => {\r\n return (\r\n <>\r\n {\r\n label && (\r\n <YStack width={'100%'} justifyContent='flex-start' alignItems='flex-start' {...containerProps} >\r\n <StyledText paddingHorizontal={8} color={theme.colors.gray[800]} fontSize={theme.fontSize.normal} fontWeight={theme.fontWeight.normal} {...labelProps}>\r\n {label}\r\n </StyledText>\r\n <StyledSpacer marginVertical={4} />\r\n </YStack>\r\n )\r\n }\r\n <StyledInputText placeholderTextColor={theme.colors.gray[400]} ref={ref} {...rest} borderColor={error ? theme.colors.pink[500] : borderColor} />\r\n {\r\n errorMessage && (\r\n <YStack width={'100%'} justifyContent='flex-start' alignItems='flex-start' {...containerProps} >\r\n <StyledSpacer marginVertical={1} />\r\n <StyledText marginHorizontal={8} fontWeight={theme.fontWeight.bold} fontSize={theme.fontSize.small} color={theme.colors.pink[500]} {...errorProps}>\r\n {errorMessage}\r\n </StyledText>\r\n </YStack>\r\n )\r\n }\r\n </>\r\n )\r\n})\r\nconst StyledMultiInput = ({ label, errorMessage, borderColor, error, errorProps, labelProps, ...rest }) => {\r\n return (\r\n <YStack width={'100%'} justifyContent='flex-start' alignItems='flex-start'>\r\n {\r\n label && (\r\n <>\r\n <StyledSpacer marginVertical={4} />\r\n <StyledText paddingHorizontal={8} color={theme.colors.gray[800]} fontSize={theme.fontSize.normal} fontWeight={theme.fontWeight.normal} {...labelProps}>\r\n {label}\r\n </StyledText>\r\n <StyledSpacer marginVertical={4} />\r\n </>\r\n\r\n )\r\n }\r\n <StyledInputText borderRadius={16} textAlignVertical='top' multiline numberOfLines={5} inputMode='text' {...rest} borderColor={error ? theme.colors.pink[500] : borderColor} />\r\n {\r\n errorMessage && (\r\n <>\r\n <StyledSpacer marginVertical={1} />\r\n <StyledText marginHorizontal={8} fontWeight={theme.fontWeight.bold} fontSize={theme.fontSize.small} color={theme.colors.pink[500]} {...errorProps}>\r\n {errorMessage}\r\n </StyledText>\r\n </>\r\n )\r\n }\r\n\r\n </YStack>\r\n )\r\n}\r\n\r\nexport { StyledInput, StyledMultiInput, StyledInputText as InputText }\r\nexport default StyledInputText"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAsE,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,C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zF,MAAA,CAAAgB,OAAA,CAAAkE,aAAA,CAAC7E,KAAA,CAAAkF,UAAU,EAAAzD,QAAA;IAAC6D,gBAAgB,EAAE,CAAE;IAAC1C,UAAU,EAAEN,YAAK,CAACM,UAAU,CAAC2C,IAAK;IAACrC,QAAQ,EAAEZ,YAAK,CAACY,QAAQ,CAACsC,KAAM;IAACzC,KAAK,EAAET,YAAK,CAACC,MAAM,CAAC8C,IAAI,CAAC,GAAG;EAAE,GAAKZ,UAAU,GAC5IF,YACO,CACd,CAIN,CAAC;AAEjB,CAAC;AAAAvC,OAAA,CAAAyD,gBAAA,GAAAA,gBAAA;AAAA,IAAAK,QAAA,GAAA9D,OAAA,CAAArB,OAAA,GAGcoB,eAAe","ignoreList":[]}
|
|
@@ -44,7 +44,8 @@ const StyledConfirmDialog = ({
|
|
|
44
44
|
cancel = 'Cancel',
|
|
45
45
|
onNeural,
|
|
46
46
|
confirm = 'Confirm',
|
|
47
|
-
neutral = 'Neutral'
|
|
47
|
+
neutral = 'Neutral',
|
|
48
|
+
isNeutral = false
|
|
48
49
|
} = rest;
|
|
49
50
|
const handleConfirm = () => {
|
|
50
51
|
setShow(false);
|
|
@@ -111,7 +112,7 @@ const StyledConfirmDialog = ({
|
|
|
111
112
|
fontWeight: theme.fontWeight.normal
|
|
112
113
|
}, cancel)), /*#__PURE__*/React.createElement(StyledSpacer, {
|
|
113
114
|
marginHorizontal: 2
|
|
114
|
-
}), onNeural && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledButton, {
|
|
115
|
+
}), onNeural && isNeutral && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledButton, {
|
|
115
116
|
backgroundColor: theme.colors.orange[400],
|
|
116
117
|
borderColor: theme.colors.orange[400],
|
|
117
118
|
borderRadius: 30,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","Modal","XStack","YStack","StyledText","StyledButton","StyledSpacer","styled","theme","Dialog","base","backgroundColor","colors","gray","padding","borderRadius","StyledDialog","children","animationType","transparent","visible","rest","createElement","_extends","StyledConfirmDialog","row","onCancel","onConfirm","dialogProps","show","setShow","title","description","cancel","onNeural","confirm","neutral","handleConfirm","handleCancel","handleNeural","flex","justifyContent","alignItems","width","paddingVertical","paddingHorizontal","color","fontSize","normal","fontWeight","bold","marginVertical","large","red","borderColor","onPress","marginHorizontal","Fragment","orange","green","StyledOkDialog","ok","onOk","handleOk","cyan"],"sources":["index.jsx"],"sourcesContent":["import React, { useState } from 'react'\r\nimport { Modal } from 'react-native'\r\nimport { XStack, YStack } from '../stack'\r\nimport { StyledText } from '../text'\r\nimport { StyledButton } from '../button'\r\nimport { StyledSpacer } from '../spacer'\r\nimport { styled } from '../styled'\r\nimport { theme } from '../theme'\r\n\r\nconst Dialog = styled(Modal, {\r\n base: {\r\n backgroundColor: theme.colors.gray[100],\r\n padding: 20,\r\n borderRadius: 10\r\n }\r\n})\r\n\r\nconst StyledDialog = ({\r\n children,\r\n animationType = 'fade',\r\n transparent = true,\r\n visible = false,\r\n ...rest\r\n}) => {\r\n return (\r\n <Dialog\r\n visible={visible}\r\n transparent={transparent}\r\n animationType={animationType}\r\n {...rest}\r\n >\r\n {children}\r\n </Dialog>\r\n )\r\n}\r\n\r\nconst StyledConfirmDialog = ({\r\n visible = false,\r\n row,\r\n animationType = 'fade',\r\n onCancel,\r\n onConfirm,\r\n transparent = true,\r\n dialogProps,\r\n ...rest\r\n}) => {\r\n const [show, setShow] = useState(visible)\r\n const {\r\n title,\r\n description,\r\n cancel = 'Cancel',\r\n onNeural,\r\n confirm = 'Confirm',\r\n neutral = 'Neutral'\r\n } = rest\r\n\r\n const handleConfirm = () => {\r\n setShow(false)\r\n if (typeof onConfirm === 'function') {\r\n if (typeof row === 'object' && row !== null) {\r\n onConfirm(row)\r\n } else {\r\n onConfirm()\r\n }\r\n }\r\n }\r\n const handleCancel = () => {\r\n setShow(false)\r\n if (typeof onCancel === 'function') {\r\n onCancel()\r\n }\r\n }\r\n\r\n const handleNeural = () => {\r\n setShow(false)\r\n if (typeof onNeural === 'function') {\r\n onNeural()\r\n }\r\n }\r\n return (\r\n <Dialog\r\n visible={show}\r\n transparent={transparent}\r\n animationType={animationType}\r\n {...rest}\r\n >\r\n <YStack\r\n transparent\r\n flex={1}\r\n justifyContent='center'\r\n alignItems='center'\r\n {...dialogProps}\r\n >\r\n <YStack\r\n width={'90%'}\r\n borderRadius={8}\r\n paddingVertical={16}\r\n paddingHorizontal={16}\r\n backgroundColor={theme.colors.gray[1]}\r\n >\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.bold}\r\n >\r\n {title}\r\n </StyledText>\r\n <StyledSpacer marginVertical={1} />\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.large}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {description}\r\n </StyledText>\r\n <StyledSpacer marginVertical={4} />\r\n <XStack justifyContent='flex-end' alignItems='center'>\r\n <StyledButton\r\n backgroundColor={theme.colors.red[400]}\r\n borderColor={theme.colors.red[400]}\r\n borderRadius={30}\r\n onPress={() => handleCancel()}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={4}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {cancel}\r\n </StyledText>\r\n </StyledButton>\r\n <StyledSpacer marginHorizontal={2} />\r\n {onNeural && (\r\n <>\r\n <StyledButton\r\n backgroundColor={theme.colors.orange[400]}\r\n borderColor={theme.colors.orange[400]}\r\n borderRadius={30}\r\n onPress={() => handleNeural()}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={4}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {neutral}\r\n </StyledText>\r\n </StyledButton>\r\n <StyledSpacer marginHorizontal={2} />\r\n </>\r\n )}\r\n <StyledButton\r\n backgroundColor={theme.colors.green[500]}\r\n borderColor={theme.colors.green[500]}\r\n onPress={() => handleConfirm()}\r\n borderRadius={30}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={4}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {confirm}\r\n </StyledText>\r\n </StyledButton>\r\n </XStack>\r\n </YStack>\r\n </YStack>\r\n </Dialog>\r\n )\r\n}\r\n\r\nconst StyledOkDialog = ({\r\n visible = false,\r\n animationType = 'fade',\r\n transparent = true,\r\n dialogProps,\r\n ...rest\r\n}) => {\r\n const [show, setShow] = useState(visible)\r\n const {\r\n title = \"We're sorry, something went wrong.\",\r\n description = 'Please try again later',\r\n ok = 'Ok',\r\n onOk\r\n } = rest\r\n\r\n const handleOk = () => {\r\n setShow(false)\r\n if (typeof onOk === 'function') {\r\n onOk()\r\n }\r\n }\r\n return (\r\n <Dialog\r\n visible={show}\r\n transparent={transparent}\r\n animationType={animationType}\r\n {...rest}\r\n >\r\n <YStack\r\n transparent\r\n flex={1}\r\n justifyContent='center'\r\n alignItems='center'\r\n {...dialogProps}\r\n >\r\n <YStack\r\n width={'90%'}\r\n borderRadius={8}\r\n paddingVertical={16}\r\n paddingHorizontal={16}\r\n backgroundColor={theme.colors.gray[1]}\r\n >\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.bold}\r\n >\r\n {title}\r\n </StyledText>\r\n <StyledSpacer marginVertical={2} />\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {description}\r\n </StyledText>\r\n <StyledSpacer marginVertical={8} />\r\n <XStack justifyContent='flex-end' alignItems='center'>\r\n <StyledButton\r\n flex={1}\r\n backgroundColor={theme.colors.cyan[500]}\r\n borderColor={theme.colors.cyan[500]}\r\n onPress={handleOk}\r\n borderRadius={30}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={8}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.large}\r\n fontWeight={theme.fontWeight.bold}\r\n >\r\n {ok}\r\n </StyledText>\r\n </StyledButton>\r\n </XStack>\r\n </YStack>\r\n </YStack>\r\n </Dialog>\r\n )\r\n}\r\n\r\nexport { StyledDialog, StyledConfirmDialog, StyledOkDialog }\r\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,KAAK,QAAQ,cAAc;AACpC,SAASC,MAAM,EAAEC,MAAM,QAAQ,UAAU;AACzC,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,KAAK,QAAQ,UAAU;AAEhC,MAAMC,MAAM,GAAGF,MAAM,CAACN,KAAK,EAAE;EAC3BS,IAAI,EAAE;IACJC,eAAe,EAAEH,KAAK,CAACI,MAAM,CAACC,IAAI,CAAC,GAAG,CAAC;IACvCC,OAAO,EAAE,EAAE;IACXC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,MAAMC,YAAY,GAAGA,CAAC;EACpBC,QAAQ;EACRC,aAAa,GAAG,MAAM;EACtBC,WAAW,GAAG,IAAI;EAClBC,OAAO,GAAG,KAAK;EACf,GAAGC;AACL,CAAC,KAAK;EACJ,oBACEtB,KAAA,CAAAuB,aAAA,CAACb,MAAM,EAAAc,QAAA;IACLH,OAAO,EAAEA,OAAQ;IACjBD,WAAW,EAAEA,WAAY;IACzBD,aAAa,EAAEA;EAAc,GACzBG,IAAI,GAEPJ,QACK,CAAC;AAEb,CAAC;AAED,MAAMO,mBAAmB,GAAGA,CAAC;EAC3BJ,OAAO,GAAG,KAAK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AE;IACpCT,OAAO,EAAEQ,QAAS;IAClBhD,YAAY,EAAE;EAAG,gBAEjBhB,KAAA,CAAAuB,aAAA,CAAClB,UAAU;IACTyC,iBAAiB,EAAE,EAAG;IACtBD,eAAe,EAAE,CAAE;IACnBE,KAAK,EAAEtC,KAAK,CAACI,MAAM,CAACC,IAAI,CAAC,CAAC,CAAE;IAC5BkC,QAAQ,EAAEvC,KAAK,CAACuC,QAAQ,CAACK,KAAM;IAC/BH,UAAU,EAAEzC,KAAK,CAACyC,UAAU,CAACC;EAAK,GAEjCW,EACS,CACA,CACR,CACF,CACF,CACF,CAAC;AAEb,CAAC;AAED,SAAS7C,YAAY,EAAEQ,mBAAmB,EAAEoC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useState","Modal","XStack","YStack","StyledText","StyledButton","StyledSpacer","styled","theme","Dialog","base","backgroundColor","colors","gray","padding","borderRadius","StyledDialog","children","animationType","transparent","visible","rest","createElement","_extends","StyledConfirmDialog","row","onCancel","onConfirm","dialogProps","show","setShow","title","description","cancel","onNeural","confirm","neutral","isNeutral","handleConfirm","handleCancel","handleNeural","flex","justifyContent","alignItems","width","paddingVertical","paddingHorizontal","color","fontSize","normal","fontWeight","bold","marginVertical","large","red","borderColor","onPress","marginHorizontal","Fragment","orange","green","StyledOkDialog","ok","onOk","handleOk","cyan"],"sources":["index.jsx"],"sourcesContent":["import React, { useState } from 'react'\r\nimport { Modal } from 'react-native'\r\nimport { XStack, YStack } from '../stack'\r\nimport { StyledText } from '../text'\r\nimport { StyledButton } from '../button'\r\nimport { StyledSpacer } from '../spacer'\r\nimport { styled } from '../styled'\r\nimport { theme } from '../theme'\r\n\r\nconst Dialog = styled(Modal, {\r\n base: {\r\n backgroundColor: theme.colors.gray[100],\r\n padding: 20,\r\n borderRadius: 10\r\n }\r\n})\r\n\r\nconst StyledDialog = ({\r\n children,\r\n animationType = 'fade',\r\n transparent = true,\r\n visible = false,\r\n ...rest\r\n}) => {\r\n return (\r\n <Dialog\r\n visible={visible}\r\n transparent={transparent}\r\n animationType={animationType}\r\n {...rest}\r\n >\r\n {children}\r\n </Dialog>\r\n )\r\n}\r\n\r\nconst StyledConfirmDialog = ({\r\n visible = false,\r\n row,\r\n animationType = 'fade',\r\n onCancel,\r\n onConfirm,\r\n transparent = true,\r\n dialogProps,\r\n ...rest\r\n}) => {\r\n const [show, setShow] = useState(visible)\r\n const {\r\n title,\r\n description,\r\n cancel = 'Cancel',\r\n onNeural,\r\n confirm = 'Confirm',\r\n neutral = 'Neutral',\r\n isNeutral= false\r\n } = rest\r\n\r\n const handleConfirm = () => {\r\n setShow(false)\r\n if (typeof onConfirm === 'function') {\r\n if (typeof row === 'object' && row !== null) {\r\n onConfirm(row)\r\n } else {\r\n onConfirm()\r\n }\r\n }\r\n }\r\n const handleCancel = () => {\r\n setShow(false)\r\n if (typeof onCancel === 'function') {\r\n onCancel()\r\n }\r\n }\r\n\r\n const handleNeural = () => {\r\n setShow(false)\r\n if (typeof onNeural === 'function') {\r\n onNeural()\r\n }\r\n }\r\n return (\r\n <Dialog\r\n visible={show}\r\n transparent={transparent}\r\n animationType={animationType}\r\n {...rest}\r\n >\r\n <YStack\r\n transparent\r\n flex={1}\r\n justifyContent='center'\r\n alignItems='center'\r\n {...dialogProps}\r\n >\r\n <YStack\r\n width={'90%'}\r\n borderRadius={8}\r\n paddingVertical={16}\r\n paddingHorizontal={16}\r\n backgroundColor={theme.colors.gray[1]}\r\n >\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.bold}\r\n >\r\n {title}\r\n </StyledText>\r\n <StyledSpacer marginVertical={1} />\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.large}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {description}\r\n </StyledText>\r\n <StyledSpacer marginVertical={4} />\r\n <XStack justifyContent='flex-end' alignItems='center'>\r\n <StyledButton\r\n backgroundColor={theme.colors.red[400]}\r\n borderColor={theme.colors.red[400]}\r\n borderRadius={30}\r\n onPress={() => handleCancel()}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={4}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {cancel}\r\n </StyledText>\r\n </StyledButton>\r\n <StyledSpacer marginHorizontal={2} />\r\n {(onNeural && isNeutral) && (\r\n <>\r\n <StyledButton\r\n backgroundColor={theme.colors.orange[400]}\r\n borderColor={theme.colors.orange[400]}\r\n borderRadius={30}\r\n onPress={() => handleNeural()}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={4}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {neutral}\r\n </StyledText>\r\n </StyledButton>\r\n <StyledSpacer marginHorizontal={2} />\r\n </>\r\n )}\r\n <StyledButton\r\n backgroundColor={theme.colors.green[500]}\r\n borderColor={theme.colors.green[500]}\r\n onPress={() => handleConfirm()}\r\n borderRadius={30}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={4}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {confirm}\r\n </StyledText>\r\n </StyledButton>\r\n </XStack>\r\n </YStack>\r\n </YStack>\r\n </Dialog>\r\n )\r\n}\r\n\r\nconst StyledOkDialog = ({\r\n visible = false,\r\n animationType = 'fade',\r\n transparent = true,\r\n dialogProps,\r\n ...rest\r\n}) => {\r\n const [show, setShow] = useState(visible)\r\n const {\r\n title = \"We're sorry, something went wrong.\",\r\n description = 'Please try again later',\r\n ok = 'Ok',\r\n onOk\r\n } = rest\r\n\r\n const handleOk = () => {\r\n setShow(false)\r\n if (typeof onOk === 'function') {\r\n onOk()\r\n }\r\n }\r\n return (\r\n <Dialog\r\n visible={show}\r\n transparent={transparent}\r\n animationType={animationType}\r\n {...rest}\r\n >\r\n <YStack\r\n transparent\r\n flex={1}\r\n justifyContent='center'\r\n alignItems='center'\r\n {...dialogProps}\r\n >\r\n <YStack\r\n width={'90%'}\r\n borderRadius={8}\r\n paddingVertical={16}\r\n paddingHorizontal={16}\r\n backgroundColor={theme.colors.gray[1]}\r\n >\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.bold}\r\n >\r\n {title}\r\n </StyledText>\r\n <StyledSpacer marginVertical={2} />\r\n <StyledText\r\n color={theme.colors.gray[800]}\r\n fontSize={theme.fontSize.normal}\r\n fontWeight={theme.fontWeight.normal}\r\n >\r\n {description}\r\n </StyledText>\r\n <StyledSpacer marginVertical={8} />\r\n <XStack justifyContent='flex-end' alignItems='center'>\r\n <StyledButton\r\n flex={1}\r\n backgroundColor={theme.colors.cyan[500]}\r\n borderColor={theme.colors.cyan[500]}\r\n onPress={handleOk}\r\n borderRadius={30}\r\n >\r\n <StyledText\r\n paddingHorizontal={20}\r\n paddingVertical={8}\r\n color={theme.colors.gray[1]}\r\n fontSize={theme.fontSize.large}\r\n fontWeight={theme.fontWeight.bold}\r\n >\r\n {ok}\r\n </StyledText>\r\n </StyledButton>\r\n </XStack>\r\n </YStack>\r\n </YStack>\r\n </Dialog>\r\n )\r\n}\r\n\r\nexport { StyledDialog, StyledConfirmDialog, StyledOkDialog }\r\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,KAAK,QAAQ,cAAc;AACpC,SAASC,MAAM,EAAEC,MAAM,QAAQ,UAAU;AACzC,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,KAAK,QAAQ,UAAU;AAEhC,MAAMC,MAAM,GAAGF,MAAM,CAACN,K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AA,CAAClB,UAAU;IACT2C,KAAK,EAAEvC,KAAK,CAACI,MAAM,CAACC,IAAI,CAAC,GAAG,CAAE;IAC9BmC,QAAQ,EAAExC,KAAK,CAACwC,QAAQ,CAACC,MAAO;IAChCC,UAAU,EAAE1C,KAAK,CAAC0C,UAAU,CAACD;EAAO,GAEnCjB,WACS,CAAC,eACbjC,KAAA,CAAAuB,aAAA,CAAChB,YAAY;IAAC8C,cAAc,EAAE;EAAE,CAAE,CAAC,eACnCrD,KAAA,CAAAuB,aAAA,CAACpB,MAAM;IAACwC,cAAc,EAAC,UAAU;IAACC,UAAU,EAAC;EAAQ,gBACnD5C,KAAA,CAAAuB,aAAA,CAACjB,YAAY;IACXoC,IAAI,EAAE,CAAE;IACR9B,eAAe,EAAEH,KAAK,CAACI,MAAM,CAACqD,IAAI,CAAC,GAAG,CAAE;IACxCV,WAAW,EAAE/C,KAAK,CAACI,MAAM,CAACqD,IAAI,CAAC,GAAG,CAAE;IACpCT,OAAO,EAAEQ,QAAS;IAClBjD,YAAY,EAAE;EAAG,gBAEjBhB,KAAA,CAAAuB,aAAA,CAAClB,UAAU;IACT0C,iBAAiB,EAAE,EAAG;IACtBD,eAAe,EAAE,CAAE;IACnBE,KAAK,EAAEvC,KAAK,CAACI,MAAM,CAACC,IAAI,CAAC,CAAC,CAAE;IAC5BmC,QAAQ,EAAExC,KAAK,CAACwC,QAAQ,CAACK,KAAM;IAC/BH,UAAU,EAAE1C,KAAK,CAAC0C,UAAU,CAACC;EAAK,GAEjCW,EACS,CACA,CACR,CACF,CACF,CACF,CAAC;AAEb,CAAC;AAED,SAAS9C,YAAY,EAAEQ,mBAAmB,EAAEqC,cAAc","ignoreList":[]}
|
|
@@ -68,7 +68,7 @@ const StyledInputText = styled(TextInput, {
|
|
|
68
68
|
borderRadius: value
|
|
69
69
|
};
|
|
70
70
|
},
|
|
71
|
-
borderColor: (value = theme.colors.gray[
|
|
71
|
+
borderColor: (value = theme.colors.gray[800]) => {
|
|
72
72
|
if (!isValidColor(value)) {
|
|
73
73
|
throw new Error('Invalid borderColor value');
|
|
74
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","TextInput","YStack","StyledText","StyledSpacer","theme","styled","isValidColor","isValidNumber","isValidString","StyledInputText","base","borderColor","colors","gray","borderWidth","borderRadius","backgroundColor","fontWeight","normal","width","color","paddingHorizontal","paddingVertical","fontSize","placeholderTextColor","variants","size","Error","fontFamily","font","textAlign","align","validAlignments","includes","value","noBorder","true","StyledInput","label","containerProps","errorMessage","error","errorProps","labelProps","rest","ref","createElement","Fragment","_extends","justifyContent","alignItems","marginVertical","pink","marginHorizontal","bold","small","StyledMultiInput","textAlignVertical","multiline","numberOfLines","inputMode","InputText"],"sources":["index.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\r\nimport { TextInput } from 'react-native';\r\nimport { YStack } from '../stack';\r\nimport { StyledText } from '../text';\r\nimport { StyledSpacer } from '../spacer';\r\nimport { theme } from '../theme';\r\nimport { styled } from '../styled';\r\nimport { isValidColor, isValidNumber, isValidString } from '../utils';\r\n\r\nconst StyledInputText = styled(TextInput, {\r\n base: {\r\n borderColor: theme.colors.gray[800],\r\n borderWidth: 1,\r\n borderRadius: 30,\r\n backgroundColor: theme.fontWeight.normal[1],\r\n width: '100%',\r\n color: theme.colors.gray[800],\r\n paddingHorizontal: 16,\r\n paddingVertical: 8,\r\n fontSize: theme.fontSize.normal,\r\n placeholderTextColor: theme.colors.gray[1],\r\n },\r\n variants: {\r\n fontWeight: (size = theme.fontWeight.normal) => {\r\n if (!isValidString(size)) {\r\n throw new Error('Invalid fontWeight value');\r\n }\r\n return { fontWeight: size };\r\n },\r\n color: (color = theme.colors.gray[800]) => {\r\n if (!isValidColor(color)) {\r\n throw new Error('Invalid color value');\r\n }\r\n return { color: color };\r\n },\r\n fontSize: (size = theme.fontSize.normal) => {\r\n if (!isValidNumber(size)) {\r\n throw new Error('Invalid fontSize value');\r\n }\r\n return { fontSize: size };\r\n },\r\n fontFamily: font => {\r\n if (!font) return\r\n return {\r\n fontFamily: font\r\n }\r\n },\r\n textAlign: (align = 'left') => {\r\n const validAlignments = ['auto', 'left', 'right', 'center', 'justify'];\r\n if (!validAlignments.includes(align)) {\r\n throw new Error('Invalid textAlign value');\r\n }\r\n return { textAlign: align };\r\n },\r\n borderRadius: (value = 16) => {\r\n if (!isValidNumber(value)) {\r\n throw new Error('Invalid borderRadius value');\r\n }\r\n return { borderRadius: value };\r\n },\r\n borderColor: (value = theme.colors.gray[100]) => {\r\n if (!isValidColor(value)) {\r\n throw new Error('Invalid borderColor value');\r\n }\r\n return { borderColor: value };\r\n },\r\n backgroundColor: (value = theme.colors.gray[1]) => {\r\n if (!isValidColor(value)) {\r\n throw new Error('Invalid backgroundColor value');\r\n }\r\n return { backgroundColor: value };\r\n },\r\n noBorder: {\r\n true: { borderWidth: 0 }\r\n },\r\n placeholderTextColor: (value = theme.colors.gray[800]) => {\r\n if (!isValidColor(value)) {\r\n throw new Error('Invalid placeholderTextColor value');\r\n }\r\n return { placeholderTextColor: value };\r\n } \r\n }\r\n});\r\n\r\nconst StyledInput = forwardRef(({ label, containerProps, borderColor, errorMessage, error, errorProps, labelProps, ...rest }, ref) => {\r\n return (\r\n <>\r\n {\r\n label && (\r\n <YStack width={'100%'} justifyContent='flex-start' alignItems='flex-start' {...containerProps} >\r\n <StyledText paddingHorizontal={8} color={theme.colors.gray[800]} fontSize={theme.fontSize.normal} fontWeight={theme.fontWeight.normal} {...labelProps}>\r\n {label}\r\n </StyledText>\r\n <StyledSpacer marginVertical={4} />\r\n </YStack>\r\n )\r\n }\r\n <StyledInputText placeholderTextColor={theme.colors.gray[400]} ref={ref} {...rest} borderColor={error ? theme.colors.pink[500] : borderColor} />\r\n {\r\n errorMessage && (\r\n <YStack width={'100%'} justifyContent='flex-start' alignItems='flex-start' {...containerProps} >\r\n <StyledSpacer marginVertical={1} />\r\n <StyledText marginHorizontal={8} fontWeight={theme.fontWeight.bold} fontSize={theme.fontSize.small} color={theme.colors.pink[500]} {...errorProps}>\r\n {errorMessage}\r\n </StyledText>\r\n </YStack>\r\n )\r\n }\r\n </>\r\n )\r\n})\r\nconst StyledMultiInput = ({ label, errorMessage, borderColor, error, errorProps, labelProps, ...rest }) => {\r\n return (\r\n <YStack width={'100%'} justifyContent='flex-start' alignItems='flex-start'>\r\n {\r\n label && (\r\n <>\r\n <StyledSpacer marginVertical={4} />\r\n <StyledText paddingHorizontal={8} color={theme.colors.gray[800]} fontSize={theme.fontSize.normal} fontWeight={theme.fontWeight.normal} {...labelProps}>\r\n {label}\r\n </StyledText>\r\n <StyledSpacer marginVertical={4} />\r\n </>\r\n\r\n )\r\n }\r\n <StyledInputText borderRadius={16} textAlignVertical='top' multiline numberOfLines={5} inputMode='text' {...rest} borderColor={error ? theme.colors.pink[500] : borderColor} />\r\n {\r\n errorMessage && (\r\n <>\r\n <StyledSpacer marginVertical={1} />\r\n <StyledText marginHorizontal={8} fontWeight={theme.fontWeight.bold} fontSize={theme.fontSize.small} color={theme.colors.pink[500]} {...errorProps}>\r\n {errorMessage}\r\n </StyledText>\r\n </>\r\n )\r\n }\r\n\r\n </YStack>\r\n )\r\n}\r\n\r\nexport { StyledInput, StyledMultiInput, StyledInputText as InputText }\r\nexport default StyledInputText"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,aAAa,EAAEC,aAAa,QAAQ,UAAU;AAErE,MAAMC,eAAe,GAAGJ,MAAM,CAACL,SAAS,EAAE;EACtCU,IAAI,EAAE;IACFC,WAAW,EAAEP,KAAK,CAACQ,MAAM,CAACC,IAAI,CAAC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AAEnB,KAAK,CAACmB,QAAQ,CAACL,MAAO;IAACD,UAAU,EAAEb,KAAK,CAACa,UAAU,CAACC;EAAO,GAAKyB,UAAU,GAChJL,KACO,CAAC,eACbxC,KAAA,CAAAgD,aAAA,CAAC3C,YAAY;IAACgD,cAAc,EAAE;EAAE,CAAE,CACpC,CAEL,eAELrD,KAAA,CAAAgD,aAAA,CAACrC,eAAe,EAAAuC,QAAA;IAACjC,YAAY,EAAE,EAAG;IAAC0C,iBAAiB,EAAC,KAAK;IAACC,SAAS;IAACC,aAAa,EAAE,CAAE;IAACC,SAAS,EAAC;EAAM,GAAKhB,IAAI;IAAEjC,WAAW,EAAE8B,KAAK,GAAGrC,KAAK,CAACQ,MAAM,CAACwC,IAAI,CAAC,GAAG,CAAC,GAAGzC;EAAY,EAAE,CAAC,EAE3K6B,YAAY,iBACR1C,KAAA,CAAAgD,aAAA,CAAAhD,KAAA,CAAAiD,QAAA,qBACIjD,KAAA,CAAAgD,aAAA,CAAC3C,YAAY;IAACgD,cAAc,EAAE;EAAE,CAAE,CAAC,eACnCrD,KAAA,CAAAgD,aAAA,CAAC5C,UAAU,EAAA8C,QAAA;IAACK,gBAAgB,EAAE,CAAE;IAACpC,UAAU,EAAEb,KAAK,CAACa,UAAU,CAACqC,IAAK;IAAC/B,QAAQ,EAAEnB,KAAK,CAACmB,QAAQ,CAACgC,KAAM;IAACnC,KAAK,EAAEhB,KAAK,CAACQ,MAAM,CAACwC,IAAI,CAAC,GAAG;EAAE,GAAKV,UAAU,GAC5IF,YACO,CACd,CAIN,CAAC;AAEjB,CAAC;AAED,SAASH,WAAW,EAAEmB,gBAAgB,EAAE/C,eAAe,IAAIoD,SAAS;AACpE,eAAepD,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","forwardRef","TextInput","YStack","StyledText","StyledSpacer","theme","styled","isValidColor","isValidNumber","isValidString","StyledInputText","base","borderColor","colors","gray","borderWidth","borderRadius","backgroundColor","fontWeight","normal","width","color","paddingHorizontal","paddingVertical","fontSize","placeholderTextColor","variants","size","Error","fontFamily","font","textAlign","align","validAlignments","includes","value","noBorder","true","StyledInput","label","containerProps","errorMessage","error","errorProps","labelProps","rest","ref","createElement","Fragment","_extends","justifyContent","alignItems","marginVertical","pink","marginHorizontal","bold","small","StyledMultiInput","textAlignVertical","multiline","numberOfLines","inputMode","InputText"],"sources":["index.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\r\nimport { TextInput } from 'react-native';\r\nimport { YStack } from '../stack';\r\nimport { StyledText } from '../text';\r\nimport { StyledSpacer } from '../spacer';\r\nimport { theme } from '../theme';\r\nimport { styled } from '../styled';\r\nimport { isValidColor, isValidNumber, isValidString } from '../utils';\r\n\r\nconst StyledInputText = styled(TextInput, {\r\n base: {\r\n borderColor: theme.colors.gray[800],\r\n borderWidth: 1,\r\n borderRadius: 30,\r\n backgroundColor: theme.fontWeight.normal[1],\r\n width: '100%',\r\n color: theme.colors.gray[800],\r\n paddingHorizontal: 16,\r\n paddingVertical: 8,\r\n fontSize: theme.fontSize.normal,\r\n placeholderTextColor: theme.colors.gray[1],\r\n },\r\n variants: {\r\n fontWeight: (size = theme.fontWeight.normal) => {\r\n if (!isValidString(size)) {\r\n throw new Error('Invalid fontWeight value');\r\n }\r\n return { fontWeight: size };\r\n },\r\n color: (color = theme.colors.gray[800]) => {\r\n if (!isValidColor(color)) {\r\n throw new Error('Invalid color value');\r\n }\r\n return { color: color };\r\n },\r\n fontSize: (size = theme.fontSize.normal) => {\r\n if (!isValidNumber(size)) {\r\n throw new Error('Invalid fontSize value');\r\n }\r\n return { fontSize: size };\r\n },\r\n fontFamily: font => {\r\n if (!font) return\r\n return {\r\n fontFamily: font\r\n }\r\n },\r\n textAlign: (align = 'left') => {\r\n const validAlignments = ['auto', 'left', 'right', 'center', 'justify'];\r\n if (!validAlignments.includes(align)) {\r\n throw new Error('Invalid textAlign value');\r\n }\r\n return { textAlign: align };\r\n },\r\n borderRadius: (value = 16) => {\r\n if (!isValidNumber(value)) {\r\n throw new Error('Invalid borderRadius value');\r\n }\r\n return { borderRadius: value };\r\n },\r\n borderColor: (value = theme.colors.gray[800]) => {\r\n if (!isValidColor(value)) {\r\n throw new Error('Invalid borderColor value');\r\n }\r\n return { borderColor: value };\r\n },\r\n backgroundColor: (value = theme.colors.gray[1]) => {\r\n if (!isValidColor(value)) {\r\n throw new Error('Invalid backgroundColor value');\r\n }\r\n return { backgroundColor: value };\r\n },\r\n noBorder: {\r\n true: { borderWidth: 0 }\r\n },\r\n placeholderTextColor: (value = theme.colors.gray[800]) => {\r\n if (!isValidColor(value)) {\r\n throw new Error('Invalid placeholderTextColor value');\r\n }\r\n return { placeholderTextColor: value };\r\n } \r\n }\r\n});\r\n\r\nconst StyledInput = forwardRef(({ label, containerProps, borderColor, errorMessage, error, errorProps, labelProps, ...rest }, ref) => {\r\n return (\r\n <>\r\n {\r\n label && (\r\n <YStack width={'100%'} justifyContent='flex-start' alignItems='flex-start' {...containerProps} >\r\n <StyledText paddingHorizontal={8} color={theme.colors.gray[800]} fontSize={theme.fontSize.normal} fontWeight={theme.fontWeight.normal} {...labelProps}>\r\n {label}\r\n </StyledText>\r\n <StyledSpacer marginVertical={4} />\r\n </YStack>\r\n )\r\n }\r\n <StyledInputText placeholderTextColor={theme.colors.gray[400]} ref={ref} {...rest} borderColor={error ? theme.colors.pink[500] : borderColor} />\r\n {\r\n errorMessage && (\r\n <YStack width={'100%'} justifyContent='flex-start' alignItems='flex-start' {...containerProps} >\r\n <StyledSpacer marginVertical={1} />\r\n <StyledText marginHorizontal={8} fontWeight={theme.fontWeight.bold} fontSize={theme.fontSize.small} color={theme.colors.pink[500]} {...errorProps}>\r\n {errorMessage}\r\n </StyledText>\r\n </YStack>\r\n )\r\n }\r\n </>\r\n )\r\n})\r\nconst StyledMultiInput = ({ label, errorMessage, borderColor, error, errorProps, labelProps, ...rest }) => {\r\n return (\r\n <YStack width={'100%'} justifyContent='flex-start' alignItems='flex-start'>\r\n {\r\n label && (\r\n <>\r\n <StyledSpacer marginVertical={4} />\r\n <StyledText paddingHorizontal={8} color={theme.colors.gray[800]} fontSize={theme.fontSize.normal} fontWeight={theme.fontWeight.normal} {...labelProps}>\r\n {label}\r\n </StyledText>\r\n <StyledSpacer marginVertical={4} />\r\n </>\r\n\r\n )\r\n }\r\n <StyledInputText borderRadius={16} textAlignVertical='top' multiline numberOfLines={5} inputMode='text' {...rest} borderColor={error ? theme.colors.pink[500] : borderColor} />\r\n {\r\n errorMessage && (\r\n <>\r\n <StyledSpacer marginVertical={1} />\r\n <StyledText marginHorizontal={8} fontWeight={theme.fontWeight.bold} fontSize={theme.fontSize.small} color={theme.colors.pink[500]} {...errorProps}>\r\n {errorMessage}\r\n </StyledText>\r\n </>\r\n )\r\n }\r\n\r\n </YStack>\r\n )\r\n}\r\n\r\nexport { StyledInput, StyledMultiInput, StyledInputText as InputText }\r\nexport default StyledInputText"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,EAAEC,aAAa,EAAEC,aAAa,QAAQ,UAAU;AAErE,MAAMC,eAAe,GAAGJ,MAAM,CAACL,SAAS,EAAE;EACtCU,IAAI,EAAE;IACFC,WAAW,EAAEP,KAAK,CAACQ,MAAM,CAACC,IAAI,CAAC,GAAG,CAAC;IACnCC,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAEZ,KAAK,CAACa,UAAU,CAACC,MAAM,CAAC,CAAC,CAAC;IAC3CC,KAAK,EAAE,MAAM;IACbC,KAAK,EAAEhB,KAAK,CAACQ,MAAM,CAACC,IAAI,CAAC,GAAG,CAAC;IAC7BQ,iBAAi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Ae,EAAAuC,QAAA;IAACjC,YAAY,EAAE,EAAG;IAAC0C,iBAAiB,EAAC,KAAK;IAACC,SAAS;IAACC,aAAa,EAAE,CAAE;IAACC,SAAS,EAAC;EAAM,GAAKhB,IAAI;IAAEjC,WAAW,EAAE8B,KAAK,GAAGrC,KAAK,CAACQ,MAAM,CAACwC,IAAI,CAAC,GAAG,CAAC,GAAGzC;EAAY,EAAE,CAAC,EAE3K6B,YAAY,iBACR1C,KAAA,CAAAgD,aAAA,CAAAhD,KAAA,CAAAiD,QAAA,qBACIjD,KAAA,CAAAgD,aAAA,CAAC3C,YAAY;IAACgD,cAAc,EAAE;EAAE,CAAE,CAAC,eACnCrD,KAAA,CAAAgD,aAAA,CAAC5C,UAAU,EAAA8C,QAAA;IAACK,gBAAgB,EAAE,CAAE;IAACpC,UAAU,EAAEb,KAAK,CAACa,UAAU,CAACqC,IAAK;IAAC/B,QAAQ,EAAEnB,KAAK,CAACmB,QAAQ,CAACgC,KAAM;IAACnC,KAAK,EAAEhB,KAAK,CAACQ,MAAM,CAACwC,IAAI,CAAC,GAAG;EAAE,GAAKV,UAAU,GAC5IF,YACO,CACd,CAIN,CAAC;AAEjB,CAAC;AAED,SAASH,WAAW,EAAEmB,gBAAgB,EAAE/C,eAAe,IAAIoD,SAAS;AACpE,eAAepD,eAAe","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -51,7 +51,8 @@ const StyledConfirmDialog = ({
|
|
|
51
51
|
cancel = 'Cancel',
|
|
52
52
|
onNeural,
|
|
53
53
|
confirm = 'Confirm',
|
|
54
|
-
neutral = 'Neutral'
|
|
54
|
+
neutral = 'Neutral',
|
|
55
|
+
isNeutral= false
|
|
55
56
|
} = rest
|
|
56
57
|
|
|
57
58
|
const handleConfirm = () => {
|
|
@@ -132,7 +133,7 @@ const StyledConfirmDialog = ({
|
|
|
132
133
|
</StyledText>
|
|
133
134
|
</StyledButton>
|
|
134
135
|
<StyledSpacer marginHorizontal={2} />
|
|
135
|
-
{onNeural && (
|
|
136
|
+
{(onNeural && isNeutral) && (
|
|
136
137
|
<>
|
|
137
138
|
<StyledButton
|
|
138
139
|
backgroundColor={theme.colors.orange[400]}
|
|
@@ -58,7 +58,7 @@ const StyledInputText = styled(TextInput, {
|
|
|
58
58
|
}
|
|
59
59
|
return { borderRadius: value };
|
|
60
60
|
},
|
|
61
|
-
borderColor: (value = theme.colors.gray[
|
|
61
|
+
borderColor: (value = theme.colors.gray[800]) => {
|
|
62
62
|
if (!isValidColor(value)) {
|
|
63
63
|
throw new Error('Invalid borderColor value');
|
|
64
64
|
}
|