@fountain-ui/core 2.0.0-beta.2 → 2.0.0-beta.3
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/build/commonjs/Button/Button.js +1 -1
- package/build/commonjs/Button/Button.js.map +1 -1
- package/build/commonjs/Chip/Chip.js +1 -1
- package/build/commonjs/Chip/Chip.js.map +1 -1
- package/build/commonjs/Fab/Fab.js +1 -1
- package/build/commonjs/Fab/Fab.js.map +1 -1
- package/build/commonjs/SvgIcon/SvgIcon.js +1 -2
- package/build/commonjs/SvgIcon/SvgIcon.js.map +1 -1
- package/build/commonjs/utils/cloneElementSafely.js +3 -1
- package/build/commonjs/utils/cloneElementSafely.js.map +1 -1
- package/build/module/Button/Button.js +1 -1
- package/build/module/Button/Button.js.map +1 -1
- package/build/module/Chip/Chip.js +1 -1
- package/build/module/Chip/Chip.js.map +1 -1
- package/build/module/Fab/Fab.js +1 -1
- package/build/module/Fab/Fab.js.map +1 -1
- package/build/module/SvgIcon/SvgIcon.js +1 -2
- package/build/module/SvgIcon/SvgIcon.js.map +1 -1
- package/build/module/utils/cloneElementSafely.js +3 -1
- package/build/module/utils/cloneElementSafely.js.map +1 -1
- package/build/typescript/SvgIcon/SvgIconProps.d.ts +1 -1
- package/build/typescript/internal/icons/Checkbox.d.ts +1 -2
- package/build/typescript/internal/icons/CheckboxChecked.d.ts +1 -2
- package/build/typescript/internal/icons/ChevronDown.d.ts +1 -2
- package/build/typescript/internal/icons/ChevronLeft.d.ts +1 -2
- package/build/typescript/internal/icons/ChevronRight.d.ts +1 -2
- package/build/typescript/internal/icons/Close.d.ts +1 -2
- package/build/typescript/internal/icons/Radio.d.ts +1 -2
- package/build/typescript/internal/icons/RadioChecked.d.ts +1 -2
- package/package.json +4 -4
- package/src/Button/Button.tsx +1 -1
- package/src/Chip/Chip.tsx +1 -1
- package/src/Fab/Fab.tsx +1 -1
- package/src/SvgIcon/SvgIcon.tsx +1 -2
- package/src/SvgIcon/SvgIconProps.ts +1 -1
- package/src/utils/cloneElementSafely.ts +1 -1
|
@@ -79,7 +79,7 @@ function Button(props) {
|
|
|
79
79
|
const iconProps = {
|
|
80
80
|
width: iconSizes[size],
|
|
81
81
|
height: iconSizes[size],
|
|
82
|
-
|
|
82
|
+
fill: fontColor
|
|
83
83
|
};
|
|
84
84
|
const startIcon = (0, _utils.cloneElementSafely)(startIconProp, iconProps);
|
|
85
85
|
const endIcon = (0, _utils.cloneElementSafely)(endIconProp, iconProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Button.tsx"],"names":["iconSizes","small","medium","styles","StyleSheet","create","root","flexDirection","justifyContent","alignItems","fullWidth","width","minWidth","height","Button","props","children","clipHorizontalSpacing","color","disabled","endIcon","endIconProp","href","onPress","size","startIcon","startIconProp","style","styleProp","variant","otherProps","theme","mainColor","palette","main","fontColor","contrastTextColor","variantStyleMap","contained","backgroundColor","outlined","borderColor","borderStyle","borderWidth","text","iconProps","
|
|
1
|
+
{"version":3,"sources":["Button.tsx"],"names":["iconSizes","small","medium","styles","StyleSheet","create","root","flexDirection","justifyContent","alignItems","fullWidth","width","minWidth","height","Button","props","children","clipHorizontalSpacing","color","disabled","endIcon","endIconProp","href","onPress","size","startIcon","startIconProp","style","styleProp","variant","otherProps","theme","mainColor","palette","main","fontColor","contrastTextColor","variantStyleMap","contained","backgroundColor","outlined","borderColor","borderStyle","borderWidth","text","iconProps","fill","paddingSize","spacing","paddingLeft","paddingRight","borderRadius","shape","roundness","buttonBaseStyle","undefined","fontStyle","selector","typo","button2","button1","textMarginSize","textMarginStyle","marginLeft","marginRight","textStyle","textAlign","handlePress","Linking","canOpenURL","openURL"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAMA,MAAMA,SAAoB,GAAG;AACzBC,EAAAA,KAAK,EAAE,EADkB;AAEzBC,EAAAA,MAAM,EAAE;AAFiB,CAA7B;;AAKA,MAAMC,MAAM,GAAGC,mBA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HX,KAIQxB,UAJR,GAMKL,SANL,eAQI,6BAAC,iBAAD;AACI,IAAA,QAAQ,EAAET,QADd;AAEI,IAAA,KAAK,EAAEiD;AAFX,IARJ,EAaK7C,OAbL,CADJ;AAiBH;;AAAA","sourcesContent":["import React from 'react';\nimport { Linking, Text } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type ButtonProps from './ButtonProps';\nimport type { ButtonSize } from './ButtonProps';\n\ntype IconSizes = { [n in ButtonSize]: number };\n\nconst iconSizes: IconSizes = {\n small: 20,\n medium: 24,\n};\n\nconst styles = StyleSheet.create({\n root: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n },\n fullWidth: {\n width: '100%',\n },\n medium: {\n minWidth: 104,\n height: 48,\n },\n small: {\n minWidth: 56,\n height: 32,\n },\n});\n\nexport default function Button(props: ButtonProps) {\n const {\n children,\n clipHorizontalSpacing = false,\n color = 'primary',\n disabled = false,\n endIcon: endIconProp,\n fullWidth = false,\n href,\n onPress,\n size = 'medium',\n startIcon: startIconProp,\n style: styleProp,\n variant = 'contained',\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const mainColor = theme.palette[color].main;\n\n const fontColor = variant === 'contained'\n ? theme.palette[color].contrastTextColor\n : theme.palette[color].main;\n\n const variantStyleMap = {\n contained: {\n backgroundColor: mainColor,\n },\n outlined: {\n backgroundColor: 'transparent',\n borderColor: mainColor,\n borderStyle: 'solid',\n borderWidth: 1,\n },\n text: {\n backgroundColor: 'transparent',\n },\n };\n\n const iconProps = {\n width: iconSizes[size],\n height: iconSizes[size],\n fill: fontColor,\n };\n\n const startIcon = cloneElementSafely(startIconProp, iconProps);\n const endIcon = cloneElementSafely(endIconProp, iconProps);\n\n const paddingSize = size === 'small' ? theme.spacing(2) : theme.spacing(4);\n const paddingLeft = startIcon ? paddingSize - theme.spacing(1) : paddingSize;\n const paddingRight = endIcon ? paddingSize - theme.spacing(1) : paddingSize;\n\n const borderRadius = theme.shape.roundness;\n const buttonBaseStyle = css([\n styles.root,\n variantStyleMap[variant],\n size === 'medium' ? styles.medium : styles.small,\n fullWidth ? styles.fullWidth : undefined,\n { borderRadius, color: fontColor },\n (variant === 'text' && clipHorizontalSpacing)\n ? { minWidth: 0 }\n : { paddingLeft, paddingRight },\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => size === 'small' ? typo.button2 : typo.button1,\n color: fontColor,\n });\n\n const textMarginSize = size === 'small' ? theme.spacing(1) : theme.spacing(2);\n const textMarginStyle = startIcon\n ? { marginLeft: textMarginSize }\n : endIcon\n ? { marginRight: textMarginSize }\n : undefined;\n\n const textStyle = css([\n fontStyle,\n textMarginStyle,\n { textAlign: 'center' },\n ]);\n\n const handlePress = async () => {\n if (disabled) {\n return;\n }\n if (onPress) {\n onPress();\n return;\n }\n if (href) {\n if (await Linking.canOpenURL(href)) {\n await Linking.openURL(href);\n }\n }\n };\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={buttonBaseStyle}\n {...otherProps}\n >\n {startIcon}\n\n <Text\n children={children}\n style={textStyle}\n />\n\n {endIcon}\n </ButtonBase>\n );\n};\n"]}
|
|
@@ -81,7 +81,7 @@ function Chip(props) {
|
|
|
81
81
|
const iconProps = {
|
|
82
82
|
width: ICON_SIZE,
|
|
83
83
|
height: ICON_SIZE,
|
|
84
|
-
|
|
84
|
+
fill: fontColor
|
|
85
85
|
};
|
|
86
86
|
const startIcon = (0, _utils.cloneElementSafely)(startIconProp, iconProps);
|
|
87
87
|
const endIcon = (0, _utils.cloneElementSafely)(endIconProp, iconProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Chip.tsx"],"names":["ICON_SIZE","useStyles","theme","root","alignItems","borderRadius","flexDirection","height","justifyContent","paddingLeft","spacing","paddingRight","Chip","props","children","endIcon","endIconProp","onPress","startIcon","startIconProp","style","styleProp","variant","otherProps","styles","fontColor","palette","tertiary","main","primary","variantStyleMap","outlined","backgroundColor","paper","default","borderColor","border","borderWidth","filled","grey","bold","chipStyle","fontStyle","selector","typo","subtitle2","color","textMarginSize","textMarginStyle","marginLeft","marginRight","undefined","textStyle","textAlign","iconProps","width","
|
|
1
|
+
{"version":3,"sources":["Chip.tsx"],"names":["ICON_SIZE","useStyles","theme","root","alignItems","borderRadius","flexDirection","height","justifyContent","paddingLeft","spacing","paddingRight","Chip","props","children","endIcon","endIconProp","onPress","startIcon","startIconProp","style","styleProp","variant","otherProps","styles","fontColor","palette","tertiary","main","primary","variantStyleMap","outlined","backgroundColor","paper","default","borderColor","border","borderWidth","filled","grey","bold","chipStyle","fontStyle","selector","typo","subtitle2","color","textMarginSize","textMarginStyle","marginLeft","marginRight","undefined","textStyle","textAlign","iconProps","width","fill"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAKA,MAAMA,SAAS,GAAG,EAAlB;;AAEA,MAAMC,SAAgC,GAAG,YAAwB;AAC7D,QAAMC,KAAK,GAAG,uBAAd;AAEA,SAAO;AACHC,IAAAA,IAAI,EAAE;AACFC,MAAAA,UAAU,EAAE,QADV;AAEFC,MAAAA,YAAY,EAAE,EAFZ;AAGFC,MAAAA,aAAa,EAAE,KAHb;AAIFC,MAAAA,MAAM,EAAE,EAJN;AAKFC,MAAAA,cAAc,EAAE,QALd;AAMFC,MAAAA,WAAW,EAAEP,KAAK,CAACQ,OAAN,CAAc,CAAd,CANX;AAOFC,MAAAA,YAAY,EAAET,KAAK,CAACQ,OAAN,CAAc,CAAd;AAPZ;AADH,GAAP;AAWH,CAdD;;AAgBe,SAASE,IAAT,CAAcC,KAAd,EAAgC;AAC3C,QAAM;AACFC,IAAAA,QADE;AAEFC,IAAAA,OAAO,EAAEC,WAFP;AAGFC,IAAAA,OAHE;AAIFC,IAAAA,SAAS,EAAEC,aAJT;AAKFC,IAAAA,KAAK,EAAEC,SALL;AAMFC,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C/B;AAAE8B,IAAAA,UAAU,EAAEF;AAAd,GAD+B,GAE/B/B,WAAW,GACP;AAAEkC,IAAAA,WAAW,EAAEH;AAAf,GADO,GAEPI,SAJV;AAMA,QAAMC,SAAS,GAAG,iBAAI,CAClBV,SADkB,EAElBM,eAFkB,EAGlB;AAAEK,IAAAA,SAAS,EAAE;AAAb,GAHkB,CAAJ,CAAlB;AAMA,QAAMC,SAAS,GAAG;AACdC,IAAAA,KAAK,EAAEvD,SADO;AAEdO,IAAAA,MAAM,EAAEP,SAFM;AAGdwD,IAAAA,IAAI,EAAE/B;AAHQ,GAAlB;AAMA,QAAMP,SAAS,GAAG,+BAAmBC,aAAnB,EAAkCmC,SAAlC,CAAlB;AACA,QAAMvC,OAAO,GAAG,+BAAmBC,WAAnB,EAAgCsC,SAAhC,CAAhB;AAEA,sBACI,6BAAC,mBAAD;AACI,IAAA,OAAO,EAAErC,OADb;AAEI,IAAA,KAAK,EAAEwB;AAFX,KAGQlB,UAHR,GAKKL,SALL,eAOI,6BAAC,iBAAD;AACI,IAAA,QAAQ,EAAEJ,QADd;AAEI,IAAA,KAAK,EAAEsC;AAFX,IAPJ,EAYKrC,OAZL,CADJ;AAgBH","sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport ButtonBase from '../ButtonBase';\nimport type ChipProps from './ChipProps';\n\ntype ChipStyles = NamedStylesStringUnion<'root'>;\n\nconst ICON_SIZE = 16;\n\nconst useStyles: UseStyles<ChipStyles> = function (): ChipStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'center',\n borderRadius: 20,\n flexDirection: 'row',\n height: 32,\n justifyContent: 'center',\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n },\n };\n};\n\nexport default function Chip(props: ChipProps) {\n const {\n children,\n endIcon: endIconProp,\n onPress,\n startIcon: startIconProp,\n style: styleProp,\n variant = 'outlined',\n ...otherProps\n } = props;\n\n const theme = useTheme();\n const styles = useStyles();\n\n const fontColor = variant === 'outlined'\n ? theme.palette.tertiary.main\n : theme.palette.primary.main;\n\n const variantStyleMap = {\n outlined: {\n backgroundColor: theme.palette.paper.default,\n borderColor: theme.palette.border,\n borderWidth: 2,\n },\n filled: {\n backgroundColor: theme.palette.paper.grey,\n },\n bold: {\n backgroundColor: theme.palette.paper.grey,\n borderColor: theme.palette.primary.main,\n borderWidth: 2,\n },\n };\n\n const chipStyle = css([\n styles.root,\n variantStyleMap[variant],\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => typo.subtitle2,\n color: fontColor,\n });\n\n const textMarginSize = theme.spacing(1);\n const textMarginStyle = startIconProp\n ? { marginLeft: textMarginSize }\n : endIconProp\n ? { marginRight: textMarginSize }\n : undefined;\n\n const textStyle = css([\n fontStyle,\n textMarginStyle,\n { textAlign: 'center' },\n ]);\n\n const iconProps = {\n width: ICON_SIZE,\n height: ICON_SIZE,\n fill: fontColor,\n };\n\n const startIcon = cloneElementSafely(startIconProp, iconProps);\n const endIcon = cloneElementSafely(endIconProp, iconProps);\n\n return (\n <ButtonBase\n onPress={onPress}\n style={chipStyle}\n {...otherProps}\n >\n {startIcon}\n\n <Text\n children={children}\n style={textStyle}\n />\n\n {endIcon}\n </ButtonBase>\n );\n}\n"]}
|
|
@@ -70,7 +70,7 @@ function Fab(props) {
|
|
|
70
70
|
const icon = (0, _utils.cloneElementSafely)(children, {
|
|
71
71
|
width: iconSizes[size],
|
|
72
72
|
height: iconSizes[size],
|
|
73
|
-
|
|
73
|
+
fill: fontColor
|
|
74
74
|
});
|
|
75
75
|
const elevationStyle = (0, _hooks.useElevationStyle)(elevation);
|
|
76
76
|
const width = variant === 'circular' ? size === 'medium' ? MEDIUM : SMALL : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Fab.tsx"],"names":["SMALL","MEDIUM","iconSizes","small","medium","styles","StyleSheet","create","borderRadius","height","root","alignItems","justifyContent","row","flexDirection","reverse","Fab","props","children","color","disabled","elevation","label","numberOfLines","onPress","size","style","styleProp","variant","otherProps","theme","backgroundColor","palette","main","fontColor","contrastTextColor","icon","width","
|
|
1
|
+
{"version":3,"sources":["Fab.tsx"],"names":["SMALL","MEDIUM","iconSizes","small","medium","styles","StyleSheet","create","borderRadius","height","root","alignItems","justifyContent","row","flexDirection","reverse","Fab","props","children","color","disabled","elevation","label","numberOfLines","onPress","size","style","styleProp","variant","otherProps","theme","backgroundColor","palette","main","fontColor","contrastTextColor","icon","width","fill","elevationStyle","undefined","paddingSize","spacing","iconPadding","paddingLeft","paddingRight","buttonBaseStyle","fontStyle","selector","typo","button2","button1","textMarginSize","textMarginStyle","marginRight","marginLeft","textStyle","handlePress"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAIA,MAAMA,KAAK,GAAG,EAAd;AACA,MAAMC,MAAM,GAAG,EAAf;AAIA,MAAMC,SAAoB,GAAG;AACzBC,EAAAA,KAAK,EAAE,EADkB;AAEzBC,EAAAA,MAAM,EAAE;AAFiB,CAA7B;;AAKA,MAAMC,MAAM,GAAGC,mBAAWC,MAAX,CAAkB;AAC7BH,EAAAA,MAAM,EAAE;AACJI,IAAAA,YAAY,EAAEP,MAAM,GAAG,GADnB;AAEJQ,IAAAA,MAAM,EAAER;AAFJ,GADqB;AAK7BS,EAAAA,IAAI,EAAE;AACFC,IAAAA,UAAU,EAAE,QADV;AAEFC,IAAAA,cAAc,EAAE;AAFd,GALuB;AAS7BC,EAAAA,GAAG,EAAE;AACDC,IAAAA,aAAa,EAAE;AADd,GATwB;AAY7BC,EAAAA,OAAO,EAAE;AACLD,IAAAA,aAAa,EAAE;AADV,GAZoB;AAe7BX,EAAAA,KAAK,EAAE;AACHK,IAAAA,YAAY,EAAER,KAAK,GAAG,GADnB;AAEHS,IAAAA,MAAM,EAAET;AAFL;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,QAAJ,EAAc;AACV;AACH;;AACD,QAAII,OAAJ,EAAa;AACTA,MAAAA,OAAO;AACP;AACH;AACJ,GARD;;AAUA,sBACI,6BAAC,mBAAD;AACI,IAAA,QAAQ,EAAEJ,QADd;AAEI,IAAA,OAAO,EAAEqC,WAFb;AAGI,IAAA,KAAK,EAAEX;AAHX,KAIQjB,UAJR,GAMKO,IANL,EAQKR,OAAO,KAAK,UAAZ,IAA0BN,KAA1B,gBACG,6BAAC,iBAAD;AACI,IAAA,QAAQ,EAAEA,KADd;AAEI,IAAA,aAAa,EAAEC,aAFnB;AAGI,IAAA,KAAK,EAAEiC;AAHX,IADH,GAMG,IAdR,CADJ;AAkBH;;AAAA","sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { useElevationStyle } from '../hooks';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type FabProps from './FabProps';\nimport type { FabSize } from './FabProps';\n\nconst SMALL = 32;\nconst MEDIUM = 48;\n\ntype IconSizes = { [n in FabSize]: number };\n\nconst iconSizes: IconSizes = {\n small: 20,\n medium: 24,\n};\n\nconst styles = StyleSheet.create({\n medium: {\n borderRadius: MEDIUM * 0.5,\n height: MEDIUM,\n },\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n row: {\n flexDirection: 'row',\n },\n reverse: {\n flexDirection: 'row-reverse',\n },\n small: {\n borderRadius: SMALL * 0.5,\n height: SMALL,\n },\n});\n\nexport default function Fab(props: FabProps) {\n const {\n children,\n color = 'primary',\n disabled = false,\n elevation = 2,\n label,\n numberOfLines = 1,\n onPress,\n reverse,\n size = 'medium',\n style: styleProp,\n variant = 'circular',\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const backgroundColor = theme.palette[color].main;\n const fontColor = theme.palette[color].contrastTextColor;\n\n const icon = cloneElementSafely(children, {\n width: iconSizes[size],\n height: iconSizes[size],\n fill: fontColor,\n });\n\n const elevationStyle = useElevationStyle(elevation);\n const width = variant === 'circular' ? (size === 'medium' ? MEDIUM : SMALL) : undefined;\n const paddingSize = size === 'medium' ? theme.spacing(5) : theme.spacing(3);\n const iconPadding = icon ? paddingSize - theme.spacing(1) : paddingSize;\n\n const paddingLeft = variant === 'circular'\n ? undefined\n : icon\n ? (reverse ? paddingSize : iconPadding)\n : paddingSize;\n\n const paddingRight = variant === 'circular'\n ? undefined\n : icon\n ? (reverse ? iconPadding : paddingSize)\n : paddingSize;\n\n const buttonBaseStyle = css([\n styles.root,\n reverse ? styles.reverse : styles.row,\n size === 'medium' ? styles.medium : styles.small,\n { width, backgroundColor, paddingLeft, paddingRight },\n elevationStyle,\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => size === 'small' ? typo.button2 : typo.button1,\n color: fontColor,\n });\n\n const textMarginSize = size === 'small' ? theme.spacing(1) : theme.spacing(2);\n const textMarginStyle = icon\n ? (reverse ? { marginRight: textMarginSize } : { marginLeft: textMarginSize })\n : undefined;\n\n const textStyle = css([\n fontStyle,\n textMarginStyle,\n ]);\n\n const handlePress = async () => {\n if (disabled) {\n return;\n }\n if (onPress) {\n onPress();\n return;\n }\n };\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={buttonBaseStyle}\n {...otherProps}\n >\n {icon}\n\n {variant === 'extended' && label ? (\n <Text\n children={label}\n numberOfLines={numberOfLines}\n style={textStyle}\n />\n ) : null}\n </ButtonBase>\n );\n};\n"]}
|
|
@@ -18,7 +18,6 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
18
18
|
function SvgIcon(props) {
|
|
19
19
|
const {
|
|
20
20
|
color: colorProp = 'primary',
|
|
21
|
-
colorValue,
|
|
22
21
|
height = 24,
|
|
23
22
|
style: styleProp,
|
|
24
23
|
viewBox = '0 0 20 20',
|
|
@@ -26,7 +25,7 @@ function SvgIcon(props) {
|
|
|
26
25
|
...otherProps
|
|
27
26
|
} = props;
|
|
28
27
|
const theme = (0, _styles.useTheme)();
|
|
29
|
-
const color =
|
|
28
|
+
const color = theme.palette[colorProp].main;
|
|
30
29
|
const style = (0, _styles.css)([{
|
|
31
30
|
flexShrink: 0
|
|
32
31
|
}, styleProp]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SvgIcon.tsx"],"names":["SvgIcon","props","color","colorProp","
|
|
1
|
+
{"version":3,"sources":["SvgIcon.tsx"],"names":["SvgIcon","props","color","colorProp","height","style","styleProp","viewBox","width","otherProps","theme","palette","main","flexShrink"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAGe,SAASA,OAAT,CAAiBC,KAAjB,EAAsC;AACjD,QAAM;AACFC,IAAAA,KAAK,EAAEC,SAAS,GAAG,SADjB;AAEFC,IAAAA,MAAM,GAAG,EAFP;AAGFC,IAAAA,KAAK,EAAEC,SAHL;AAIFC,IAAAA,OAAO,GAAG,WAJR;AAKFC,IAAAA,KAAK,GAAG,EALN;AAMF,OAAGC;AAND,MAOYR,KAPlB;AASA,QAAMS,KAAK,GAAG,uBAAd;AAEA,QAAMR,KAAK,GAAGQ,KAAK,CAACC,OAAN,CAAcR,SAAd,EAAyBS,IAAvC;AAEA,QAAMP,KAAK,GAAG,iBAAI,CACd;AAAEQ,IAAAA,UAAU,EAAE;AAAd,GADc,EAEdP,SAFc,CAAJ,CAAd;AAKA,sBACI,6BAAC,uBAAD;AACI,IAAA,KAAK,EAAEJ,KADX;AAEI,IAAA,IAAI,EAAE,cAFV;AAGI,IAAA,MAAM,EAAEE,MAHZ;AAII,IAAA,KAAK,EAAEC,KAJX;AAKI,IAAA,OAAO,EAAEE,OALb;AAMI,IAAA,KAAK,EAAEC;AANX,KAOQC,UAPR,EADJ;AAWH;;AAAA","sourcesContent":["import React from 'react';\nimport Svg from 'react-native-svg';\nimport { css, useTheme } from '../styles';\nimport type SvgIconProps from './SvgIconProps';\n\nexport default function SvgIcon(props: SvgIconProps) {\n const {\n color: colorProp = 'primary',\n height = 24,\n style: styleProp,\n viewBox = '0 0 20 20',\n width = 24,\n ...otherProps\n }: SvgIconProps = props;\n\n const theme = useTheme();\n\n const color = theme.palette[colorProp].main;\n\n const style = css([\n { flexShrink: 0 },\n styleProp,\n ]);\n\n return (\n <Svg\n color={color}\n fill={'currentColor'}\n height={height}\n style={style}\n viewBox={viewBox}\n width={width}\n {...otherProps}\n />\n );\n};\n"]}
|
|
@@ -8,7 +8,9 @@ exports.default = cloneElementSafely;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
|
|
10
10
|
function cloneElementSafely(element, props) {
|
|
11
|
-
return element ? /*#__PURE__*/(0, _react.cloneElement)(element, props
|
|
11
|
+
return element ? /*#__PURE__*/(0, _react.cloneElement)(element, { ...props,
|
|
12
|
+
...(element === null || element === void 0 ? void 0 : element.props)
|
|
13
|
+
}) : null;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["cloneElementSafely.ts"],"names":["cloneElementSafely","element","props"],"mappings":";;;;;;;AAAA;;AAIe,SAASA,kBAAT,CAA4BC,OAA5B,EAAwDC,KAAxD,EAAwF;AACnG,SAAOD,OAAO,gBACR,yBAAaA,OAAb,
|
|
1
|
+
{"version":3,"sources":["cloneElementSafely.ts"],"names":["cloneElementSafely","element","props"],"mappings":";;;;;;;AAAA;;AAIe,SAASA,kBAAT,CAA4BC,OAA5B,EAAwDC,KAAxD,EAAwF;AACnG,SAAOD,OAAO,gBACR,yBAAaA,OAAb,EAAsB,EAAE,GAAGC,KAAL;AAAY,QAAGD,OAAH,aAAGA,OAAH,uBAAGA,OAAO,CAAEC,KAAZ;AAAZ,GAAtB,CADQ,GAER,IAFN;AAGH;;AAAA","sourcesContent":["import { cloneElement, ReactElement } from 'react';\n\ntype FalsyReactElement = ReactElement | null | undefined;\n\nexport default function cloneElementSafely(element: FalsyReactElement, props?: any): FalsyReactElement {\n return element\n ? cloneElement(element, { ...props, ...element?.props })\n : null;\n};\n"]}
|
|
@@ -63,7 +63,7 @@ export default function Button(props) {
|
|
|
63
63
|
const iconProps = {
|
|
64
64
|
width: iconSizes[size],
|
|
65
65
|
height: iconSizes[size],
|
|
66
|
-
|
|
66
|
+
fill: fontColor
|
|
67
67
|
};
|
|
68
68
|
const startIcon = cloneElementSafely(startIconProp, iconProps);
|
|
69
69
|
const endIcon = cloneElementSafely(endIconProp, iconProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Button.tsx"],"names":["React","Linking","Text","ButtonBase","createFontStyle","css","StyleSheet","useTheme","cloneElementSafely","iconSizes","small","medium","styles","create","root","flexDirection","justifyContent","alignItems","fullWidth","width","minWidth","height","Button","props","children","clipHorizontalSpacing","color","disabled","endIcon","endIconProp","href","onPress","size","startIcon","startIconProp","style","styleProp","variant","otherProps","theme","mainColor","palette","main","fontColor","contrastTextColor","variantStyleMap","contained","backgroundColor","outlined","borderColor","borderStyle","borderWidth","text","iconProps","
|
|
1
|
+
{"version":3,"sources":["Button.tsx"],"names":["React","Linking","Text","ButtonBase","createFontStyle","css","StyleSheet","useTheme","cloneElementSafely","iconSizes","small","medium","styles","create","root","flexDirection","justifyContent","alignItems","fullWidth","width","minWidth","height","Button","props","children","clipHorizontalSpacing","color","disabled","endIcon","endIconProp","href","onPress","size","startIcon","startIconProp","style","styleProp","variant","otherProps","theme","mainColor","palette","main","fontColor","contrastTextColor","variantStyleMap","contained","backgroundColor","outlined","borderColor","borderStyle","borderWidth","text","iconProps","fill","paddingSize","spacing","paddingLeft","paddingRight","borderRadius","shape","roundness","buttonBaseStyle","undefined","fontStyle","selector","typo","button2","button1","textMarginSize","textMarginStyle","marginLeft","marginRight","textStyle","textAlign","handlePress","canOpenURL","openURL"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,OAAT,EAAkBC,IAAlB,QAA8B,cAA9B;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SAASC,e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QAAID,IAAJ,EAAU;AACN,UAAI,MAAM7B,OAAO,CAAC2E,UAAR,CAAmB9C,IAAnB,CAAV,EAAoC;AAChC,cAAM7B,OAAO,CAAC4E,OAAR,CAAgB/C,IAAhB,CAAN;AACH;AACJ;AACJ,GAbD;;AAeA,sBACI,oBAAC,UAAD;AACI,IAAA,QAAQ,EAAEH,QADd;AAEI,IAAA,OAAO,EAAEgD,WAFb;AAGI,IAAA,KAAK,EAAEb;AAHX,KAIQxB,UAJR,GAMKL,SANL,eAQI,oBAAC,IAAD;AACI,IAAA,QAAQ,EAAET,QADd;AAEI,IAAA,KAAK,EAAEiD;AAFX,IARJ,EAaK7C,OAbL,CADJ;AAiBH;AAAA","sourcesContent":["import React from 'react';\nimport { Linking, Text } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type ButtonProps from './ButtonProps';\nimport type { ButtonSize } from './ButtonProps';\n\ntype IconSizes = { [n in ButtonSize]: number };\n\nconst iconSizes: IconSizes = {\n small: 20,\n medium: 24,\n};\n\nconst styles = StyleSheet.create({\n root: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n },\n fullWidth: {\n width: '100%',\n },\n medium: {\n minWidth: 104,\n height: 48,\n },\n small: {\n minWidth: 56,\n height: 32,\n },\n});\n\nexport default function Button(props: ButtonProps) {\n const {\n children,\n clipHorizontalSpacing = false,\n color = 'primary',\n disabled = false,\n endIcon: endIconProp,\n fullWidth = false,\n href,\n onPress,\n size = 'medium',\n startIcon: startIconProp,\n style: styleProp,\n variant = 'contained',\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const mainColor = theme.palette[color].main;\n\n const fontColor = variant === 'contained'\n ? theme.palette[color].contrastTextColor\n : theme.palette[color].main;\n\n const variantStyleMap = {\n contained: {\n backgroundColor: mainColor,\n },\n outlined: {\n backgroundColor: 'transparent',\n borderColor: mainColor,\n borderStyle: 'solid',\n borderWidth: 1,\n },\n text: {\n backgroundColor: 'transparent',\n },\n };\n\n const iconProps = {\n width: iconSizes[size],\n height: iconSizes[size],\n fill: fontColor,\n };\n\n const startIcon = cloneElementSafely(startIconProp, iconProps);\n const endIcon = cloneElementSafely(endIconProp, iconProps);\n\n const paddingSize = size === 'small' ? theme.spacing(2) : theme.spacing(4);\n const paddingLeft = startIcon ? paddingSize - theme.spacing(1) : paddingSize;\n const paddingRight = endIcon ? paddingSize - theme.spacing(1) : paddingSize;\n\n const borderRadius = theme.shape.roundness;\n const buttonBaseStyle = css([\n styles.root,\n variantStyleMap[variant],\n size === 'medium' ? styles.medium : styles.small,\n fullWidth ? styles.fullWidth : undefined,\n { borderRadius, color: fontColor },\n (variant === 'text' && clipHorizontalSpacing)\n ? { minWidth: 0 }\n : { paddingLeft, paddingRight },\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => size === 'small' ? typo.button2 : typo.button1,\n color: fontColor,\n });\n\n const textMarginSize = size === 'small' ? theme.spacing(1) : theme.spacing(2);\n const textMarginStyle = startIcon\n ? { marginLeft: textMarginSize }\n : endIcon\n ? { marginRight: textMarginSize }\n : undefined;\n\n const textStyle = css([\n fontStyle,\n textMarginStyle,\n { textAlign: 'center' },\n ]);\n\n const handlePress = async () => {\n if (disabled) {\n return;\n }\n if (onPress) {\n onPress();\n return;\n }\n if (href) {\n if (await Linking.canOpenURL(href)) {\n await Linking.openURL(href);\n }\n }\n };\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={buttonBaseStyle}\n {...otherProps}\n >\n {startIcon}\n\n <Text\n children={children}\n style={textStyle}\n />\n\n {endIcon}\n </ButtonBase>\n );\n};\n"]}
|
|
@@ -67,7 +67,7 @@ export default function Chip(props) {
|
|
|
67
67
|
const iconProps = {
|
|
68
68
|
width: ICON_SIZE,
|
|
69
69
|
height: ICON_SIZE,
|
|
70
|
-
|
|
70
|
+
fill: fontColor
|
|
71
71
|
};
|
|
72
72
|
const startIcon = cloneElementSafely(startIconProp, iconProps);
|
|
73
73
|
const endIcon = cloneElementSafely(endIconProp, iconProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Chip.tsx"],"names":["React","Text","createFontStyle","css","useTheme","cloneElementSafely","ButtonBase","ICON_SIZE","useStyles","theme","root","alignItems","borderRadius","flexDirection","height","justifyContent","paddingLeft","spacing","paddingRight","Chip","props","children","endIcon","endIconProp","onPress","startIcon","startIconProp","style","styleProp","variant","otherProps","styles","fontColor","palette","tertiary","main","primary","variantStyleMap","outlined","backgroundColor","paper","default","borderColor","border","borderWidth","filled","grey","bold","chipStyle","fontStyle","selector","typo","subtitle2","color","textMarginSize","textMarginStyle","marginLeft","marginRight","undefined","textStyle","textAlign","iconProps","width","
|
|
1
|
+
{"version":3,"sources":["Chip.tsx"],"names":["React","Text","createFontStyle","css","useTheme","cloneElementSafely","ButtonBase","ICON_SIZE","useStyles","theme","root","alignItems","borderRadius","flexDirection","height","justifyContent","paddingLeft","spacing","paddingRight","Chip","props","children","endIcon","endIconProp","onPress","startIcon","startIconProp","style","styleProp","variant","otherProps","styles","fontColor","palette","tertiary","main","primary","variantStyleMap","outlined","backgroundColor","paper","default","borderColor","border","borderWidth","filled","grey","bold","chipStyle","fontStyle","selector","typo","subtitle2","color","textMarginSize","textMarginStyle","marginLeft","marginRight","undefined","textStyle","textAlign","iconProps","width","fill"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,QAA/B,QAA+C,WAA/C;AACA,SAASC,kBAAT,QAAmC,UAAnC;AACA,OAAOC,UAAP,MAAuB,eAAvB;AAKA,MAAMC,SAAS,GAAG,EAAlB;;AAEA,MAAMC,SAAgC,GAAG,YAAwB;AAC7D,QAAMC,KAAK,GAAGL,QAAQ,EAAtB;AAEA,SAAO;AACHM,IAAAA,IAAI,EAAE;AAC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KAAK,EAAEsC;AAFX,IAPJ,EAYKrC,OAZL,CADJ;AAgBH","sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport ButtonBase from '../ButtonBase';\nimport type ChipProps from './ChipProps';\n\ntype ChipStyles = NamedStylesStringUnion<'root'>;\n\nconst ICON_SIZE = 16;\n\nconst useStyles: UseStyles<ChipStyles> = function (): ChipStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'center',\n borderRadius: 20,\n flexDirection: 'row',\n height: 32,\n justifyContent: 'center',\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n },\n };\n};\n\nexport default function Chip(props: ChipProps) {\n const {\n children,\n endIcon: endIconProp,\n onPress,\n startIcon: startIconProp,\n style: styleProp,\n variant = 'outlined',\n ...otherProps\n } = props;\n\n const theme = useTheme();\n const styles = useStyles();\n\n const fontColor = variant === 'outlined'\n ? theme.palette.tertiary.main\n : theme.palette.primary.main;\n\n const variantStyleMap = {\n outlined: {\n backgroundColor: theme.palette.paper.default,\n borderColor: theme.palette.border,\n borderWidth: 2,\n },\n filled: {\n backgroundColor: theme.palette.paper.grey,\n },\n bold: {\n backgroundColor: theme.palette.paper.grey,\n borderColor: theme.palette.primary.main,\n borderWidth: 2,\n },\n };\n\n const chipStyle = css([\n styles.root,\n variantStyleMap[variant],\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => typo.subtitle2,\n color: fontColor,\n });\n\n const textMarginSize = theme.spacing(1);\n const textMarginStyle = startIconProp\n ? { marginLeft: textMarginSize }\n : endIconProp\n ? { marginRight: textMarginSize }\n : undefined;\n\n const textStyle = css([\n fontStyle,\n textMarginStyle,\n { textAlign: 'center' },\n ]);\n\n const iconProps = {\n width: ICON_SIZE,\n height: ICON_SIZE,\n fill: fontColor,\n };\n\n const startIcon = cloneElementSafely(startIconProp, iconProps);\n const endIcon = cloneElementSafely(endIconProp, iconProps);\n\n return (\n <ButtonBase\n onPress={onPress}\n style={chipStyle}\n {...otherProps}\n >\n {startIcon}\n\n <Text\n children={children}\n style={textStyle}\n />\n\n {endIcon}\n </ButtonBase>\n );\n}\n"]}
|
package/build/module/Fab/Fab.js
CHANGED
|
@@ -53,7 +53,7 @@ export default function Fab(props) {
|
|
|
53
53
|
const icon = cloneElementSafely(children, {
|
|
54
54
|
width: iconSizes[size],
|
|
55
55
|
height: iconSizes[size],
|
|
56
|
-
|
|
56
|
+
fill: fontColor
|
|
57
57
|
});
|
|
58
58
|
const elevationStyle = useElevationStyle(elevation);
|
|
59
59
|
const width = variant === 'circular' ? size === 'medium' ? MEDIUM : SMALL : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Fab.tsx"],"names":["React","Text","ButtonBase","useElevationStyle","createFontStyle","css","StyleSheet","useTheme","cloneElementSafely","SMALL","MEDIUM","iconSizes","small","medium","styles","create","borderRadius","height","root","alignItems","justifyContent","row","flexDirection","reverse","Fab","props","children","color","disabled","elevation","label","numberOfLines","onPress","size","style","styleProp","variant","otherProps","theme","backgroundColor","palette","main","fontColor","contrastTextColor","icon","width","
|
|
1
|
+
{"version":3,"sources":["Fab.tsx"],"names":["React","Text","ButtonBase","useElevationStyle","createFontStyle","css","StyleSheet","useTheme","cloneElementSafely","SMALL","MEDIUM","iconSizes","small","medium","styles","create","borderRadius","height","root","alignItems","justifyContent","row","flexDirection","reverse","Fab","props","children","color","disabled","elevation","label","numberOfLines","onPress","size","style","styleProp","variant","otherProps","theme","backgroundColor","palette","main","fontColor","contrastTextColor","icon","width","fill","elevationStyle","undefined","paddingSize","spacing","iconPadding","paddingLeft","paddingRight","buttonBaseStyle","fontStyle","selector","typo","button2","button1","textMarginSize","textMarginStyle","marginRight","marginLeft","textStyle","handlePress"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,I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AAa,EAAEC,aAFnB;AAGI,IAAA,KAAK,EAAEiC;AAHX,IADH,GAMG,IAdR,CADJ;AAkBH;AAAA","sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { useElevationStyle } from '../hooks';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type FabProps from './FabProps';\nimport type { FabSize } from './FabProps';\n\nconst SMALL = 32;\nconst MEDIUM = 48;\n\ntype IconSizes = { [n in FabSize]: number };\n\nconst iconSizes: IconSizes = {\n small: 20,\n medium: 24,\n};\n\nconst styles = StyleSheet.create({\n medium: {\n borderRadius: MEDIUM * 0.5,\n height: MEDIUM,\n },\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n row: {\n flexDirection: 'row',\n },\n reverse: {\n flexDirection: 'row-reverse',\n },\n small: {\n borderRadius: SMALL * 0.5,\n height: SMALL,\n },\n});\n\nexport default function Fab(props: FabProps) {\n const {\n children,\n color = 'primary',\n disabled = false,\n elevation = 2,\n label,\n numberOfLines = 1,\n onPress,\n reverse,\n size = 'medium',\n style: styleProp,\n variant = 'circular',\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const backgroundColor = theme.palette[color].main;\n const fontColor = theme.palette[color].contrastTextColor;\n\n const icon = cloneElementSafely(children, {\n width: iconSizes[size],\n height: iconSizes[size],\n fill: fontColor,\n });\n\n const elevationStyle = useElevationStyle(elevation);\n const width = variant === 'circular' ? (size === 'medium' ? MEDIUM : SMALL) : undefined;\n const paddingSize = size === 'medium' ? theme.spacing(5) : theme.spacing(3);\n const iconPadding = icon ? paddingSize - theme.spacing(1) : paddingSize;\n\n const paddingLeft = variant === 'circular'\n ? undefined\n : icon\n ? (reverse ? paddingSize : iconPadding)\n : paddingSize;\n\n const paddingRight = variant === 'circular'\n ? undefined\n : icon\n ? (reverse ? iconPadding : paddingSize)\n : paddingSize;\n\n const buttonBaseStyle = css([\n styles.root,\n reverse ? styles.reverse : styles.row,\n size === 'medium' ? styles.medium : styles.small,\n { width, backgroundColor, paddingLeft, paddingRight },\n elevationStyle,\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => size === 'small' ? typo.button2 : typo.button1,\n color: fontColor,\n });\n\n const textMarginSize = size === 'small' ? theme.spacing(1) : theme.spacing(2);\n const textMarginStyle = icon\n ? (reverse ? { marginRight: textMarginSize } : { marginLeft: textMarginSize })\n : undefined;\n\n const textStyle = css([\n fontStyle,\n textMarginStyle,\n ]);\n\n const handlePress = async () => {\n if (disabled) {\n return;\n }\n if (onPress) {\n onPress();\n return;\n }\n };\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={buttonBaseStyle}\n {...otherProps}\n >\n {icon}\n\n {variant === 'extended' && label ? (\n <Text\n children={label}\n numberOfLines={numberOfLines}\n style={textStyle}\n />\n ) : null}\n </ButtonBase>\n );\n};\n"]}
|
|
@@ -6,7 +6,6 @@ import { css, useTheme } from '../styles';
|
|
|
6
6
|
export default function SvgIcon(props) {
|
|
7
7
|
const {
|
|
8
8
|
color: colorProp = 'primary',
|
|
9
|
-
colorValue,
|
|
10
9
|
height = 24,
|
|
11
10
|
style: styleProp,
|
|
12
11
|
viewBox = '0 0 20 20',
|
|
@@ -14,7 +13,7 @@ export default function SvgIcon(props) {
|
|
|
14
13
|
...otherProps
|
|
15
14
|
} = props;
|
|
16
15
|
const theme = useTheme();
|
|
17
|
-
const color =
|
|
16
|
+
const color = theme.palette[colorProp].main;
|
|
18
17
|
const style = css([{
|
|
19
18
|
flexShrink: 0
|
|
20
19
|
}, styleProp]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SvgIcon.tsx"],"names":["React","Svg","css","useTheme","SvgIcon","props","color","colorProp","
|
|
1
|
+
{"version":3,"sources":["SvgIcon.tsx"],"names":["React","Svg","css","useTheme","SvgIcon","props","color","colorProp","height","style","styleProp","viewBox","width","otherProps","theme","palette","main","flexShrink"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,GAAP,MAAgB,kBAAhB;AACA,SAASC,GAAT,EAAcC,QAAd,QAA8B,WAA9B;AAGA,eAAe,SAASC,OAAT,CAAiBC,KAAjB,EAAsC;AACjD,QAAM;AACFC,IAAAA,KAAK,EAAEC,SAAS,GAAG,SADjB;AAEFC,IAAAA,MAAM,GAAG,EAFP;AAGFC,IAAAA,KAAK,EAAEC,SAHL;AAIFC,IAAAA,OAAO,GAAG,WAJR;AAKFC,IAAAA,KAAK,GAAG,EALN;AAMF,OAAGC;AAND,MAOYR,KAPlB;AASA,QAAMS,KAAK,GAAGX,QAAQ,EAAtB;AAEA,QAAMG,KAAK,GAAGQ,KAAK,CAACC,OAAN,CAAcR,SAAd,EAAyBS,IAAvC;AAEA,QAAMP,KAAK,GAAGP,GAAG,CAAC,CACd;AAAEe,IAAAA,UAAU,EAAE;AAAd,GADc,EAEdP,SAFc,CAAD,CAAjB;AAKA,sBACI,oBAAC,GAAD;AACI,IAAA,KAAK,EAAEJ,KADX;AAEI,IAAA,IAAI,EAAE,cAFV;AAGI,IAAA,MAAM,EAAEE,MAHZ;AAII,IAAA,KAAK,EAAEC,KAJX;AAKI,IAAA,OAAO,EAAEE,OALb;AAMI,IAAA,KAAK,EAAEC;AANX,KAOQC,UAPR,EADJ;AAWH;AAAA","sourcesContent":["import React from 'react';\nimport Svg from 'react-native-svg';\nimport { css, useTheme } from '../styles';\nimport type SvgIconProps from './SvgIconProps';\n\nexport default function SvgIcon(props: SvgIconProps) {\n const {\n color: colorProp = 'primary',\n height = 24,\n style: styleProp,\n viewBox = '0 0 20 20',\n width = 24,\n ...otherProps\n }: SvgIconProps = props;\n\n const theme = useTheme();\n\n const color = theme.palette[colorProp].main;\n\n const style = css([\n { flexShrink: 0 },\n styleProp,\n ]);\n\n return (\n <Svg\n color={color}\n fill={'currentColor'}\n height={height}\n style={style}\n viewBox={viewBox}\n width={width}\n {...otherProps}\n />\n );\n};\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { cloneElement } from 'react';
|
|
2
2
|
export default function cloneElementSafely(element, props) {
|
|
3
|
-
return element ? /*#__PURE__*/cloneElement(element, props
|
|
3
|
+
return element ? /*#__PURE__*/cloneElement(element, { ...props,
|
|
4
|
+
...(element === null || element === void 0 ? void 0 : element.props)
|
|
5
|
+
}) : null;
|
|
4
6
|
}
|
|
5
7
|
;
|
|
6
8
|
//# sourceMappingURL=cloneElementSafely.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["cloneElementSafely.ts"],"names":["cloneElement","cloneElementSafely","element","props"],"mappings":"AAAA,SAASA,YAAT,QAA2C,OAA3C;AAIA,eAAe,SAASC,kBAAT,CAA4BC,OAA5B,EAAwDC,KAAxD,EAAwF;AACnG,SAAOD,OAAO,gBACRF,YAAY,CAACE,OAAD,
|
|
1
|
+
{"version":3,"sources":["cloneElementSafely.ts"],"names":["cloneElement","cloneElementSafely","element","props"],"mappings":"AAAA,SAASA,YAAT,QAA2C,OAA3C;AAIA,eAAe,SAASC,kBAAT,CAA4BC,OAA5B,EAAwDC,KAAxD,EAAwF;AACnG,SAAOD,OAAO,gBACRF,YAAY,CAACE,OAAD,EAAU,EAAE,GAAGC,KAAL;AAAY,QAAGD,OAAH,aAAGA,OAAH,uBAAGA,OAAO,CAAEC,KAAZ;AAAZ,GAAV,CADJ,GAER,IAFN;AAGH;AAAA","sourcesContent":["import { cloneElement, ReactElement } from 'react';\n\ntype FalsyReactElement = ReactElement | null | undefined;\n\nexport default function cloneElementSafely(element: FalsyReactElement, props?: any): FalsyReactElement {\n return element\n ? cloneElement(element, { ...props, ...element?.props })\n : null;\n};\n"]}
|
|
@@ -15,7 +15,7 @@ export default interface SvgIconProps extends OverridableComponentProps<SvgProps
|
|
|
15
15
|
/**
|
|
16
16
|
* The color of the component. It is treated as higher priority than `color` prop if provided.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
fill?: SvgProps['fill'];
|
|
19
19
|
/**
|
|
20
20
|
* The height applied to the icon.
|
|
21
21
|
* @default 24
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare const _default: React.MemoExoticComponent<{
|
|
3
3
|
(props: {
|
|
4
4
|
readonly color?: import("../..").CommonComponentColor | undefined;
|
|
5
|
-
fill?: import("react-native-svg").Color | undefined;
|
|
5
|
+
readonly fill?: import("react-native-svg").Color | undefined;
|
|
6
6
|
testID?: string | undefined;
|
|
7
7
|
opacity?: import("react-native-svg").NumberProp | undefined;
|
|
8
8
|
readonly height?: import("react-native-svg").NumberProp | undefined;
|
|
@@ -107,7 +107,6 @@ declare const _default: React.MemoExoticComponent<{
|
|
|
107
107
|
onAccessibilityTap?: (() => void) | undefined;
|
|
108
108
|
onMagicTap?: (() => void) | undefined;
|
|
109
109
|
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
110
|
-
readonly colorValue?: string | undefined;
|
|
111
110
|
}): JSX.Element;
|
|
112
111
|
displayName: string;
|
|
113
112
|
}>;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare const _default: React.MemoExoticComponent<{
|
|
3
3
|
(props: {
|
|
4
4
|
readonly color?: import("../..").CommonComponentColor | undefined;
|
|
5
|
-
fill?: import("react-native-svg").Color | undefined;
|
|
5
|
+
readonly fill?: import("react-native-svg").Color | undefined;
|
|
6
6
|
testID?: string | undefined;
|
|
7
7
|
opacity?: import("react-native-svg").NumberProp | undefined;
|
|
8
8
|
readonly height?: import("react-native-svg").NumberProp | undefined;
|
|
@@ -107,7 +107,6 @@ declare const _default: React.MemoExoticComponent<{
|
|
|
107
107
|
onAccessibilityTap?: (() => void) | undefined;
|
|
108
108
|
onMagicTap?: (() => void) | undefined;
|
|
109
109
|
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
110
|
-
readonly colorValue?: string | undefined;
|
|
111
110
|
}): JSX.Element;
|
|
112
111
|
displayName: string;
|
|
113
112
|
}>;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare const _default: React.MemoExoticComponent<{
|
|
3
3
|
(props: {
|
|
4
4
|
readonly color?: import("../..").CommonComponentColor | undefined;
|
|
5
|
-
fill?: import("react-native-svg").Color | undefined;
|
|
5
|
+
readonly fill?: import("react-native-svg").Color | undefined;
|
|
6
6
|
testID?: string | undefined;
|
|
7
7
|
opacity?: import("react-native-svg").NumberProp | undefined;
|
|
8
8
|
readonly height?: import("react-native-svg").NumberProp | undefined;
|
|
@@ -107,7 +107,6 @@ declare const _default: React.MemoExoticComponent<{
|
|
|
107
107
|
onAccessibilityTap?: (() => void) | undefined;
|
|
108
108
|
onMagicTap?: (() => void) | undefined;
|
|
109
109
|
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
110
|
-
readonly colorValue?: string | undefined;
|
|
111
110
|
}): JSX.Element;
|
|
112
111
|
displayName: string;
|
|
113
112
|
}>;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare const _default: React.MemoExoticComponent<{
|
|
3
3
|
(props: {
|
|
4
4
|
readonly color?: import("../..").CommonComponentColor | undefined;
|
|
5
|
-
fill?: import("react-native-svg").Color | undefined;
|
|
5
|
+
readonly fill?: import("react-native-svg").Color | undefined;
|
|
6
6
|
testID?: string | undefined;
|
|
7
7
|
opacity?: import("react-native-svg").NumberProp | undefined;
|
|
8
8
|
readonly height?: import("react-native-svg").NumberProp | undefined;
|
|
@@ -107,7 +107,6 @@ declare const _default: React.MemoExoticComponent<{
|
|
|
107
107
|
onAccessibilityTap?: (() => void) | undefined;
|
|
108
108
|
onMagicTap?: (() => void) | undefined;
|
|
109
109
|
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
110
|
-
readonly colorValue?: string | undefined;
|
|
111
110
|
}): JSX.Element;
|
|
112
111
|
displayName: string;
|
|
113
112
|
}>;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare const _default: React.MemoExoticComponent<{
|
|
3
3
|
(props: {
|
|
4
4
|
readonly color?: import("../..").CommonComponentColor | undefined;
|
|
5
|
-
fill?: import("react-native-svg").Color | undefined;
|
|
5
|
+
readonly fill?: import("react-native-svg").Color | undefined;
|
|
6
6
|
testID?: string | undefined;
|
|
7
7
|
opacity?: import("react-native-svg").NumberProp | undefined;
|
|
8
8
|
readonly height?: import("react-native-svg").NumberProp | undefined;
|
|
@@ -107,7 +107,6 @@ declare const _default: React.MemoExoticComponent<{
|
|
|
107
107
|
onAccessibilityTap?: (() => void) | undefined;
|
|
108
108
|
onMagicTap?: (() => void) | undefined;
|
|
109
109
|
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
110
|
-
readonly colorValue?: string | undefined;
|
|
111
110
|
}): JSX.Element;
|
|
112
111
|
displayName: string;
|
|
113
112
|
}>;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare const _default: React.MemoExoticComponent<{
|
|
3
3
|
(props: {
|
|
4
4
|
readonly color?: import("../..").CommonComponentColor | undefined;
|
|
5
|
-
fill?: import("react-native-svg").Color | undefined;
|
|
5
|
+
readonly fill?: import("react-native-svg").Color | undefined;
|
|
6
6
|
testID?: string | undefined;
|
|
7
7
|
opacity?: import("react-native-svg").NumberProp | undefined;
|
|
8
8
|
readonly height?: import("react-native-svg").NumberProp | undefined;
|
|
@@ -107,7 +107,6 @@ declare const _default: React.MemoExoticComponent<{
|
|
|
107
107
|
onAccessibilityTap?: (() => void) | undefined;
|
|
108
108
|
onMagicTap?: (() => void) | undefined;
|
|
109
109
|
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
110
|
-
readonly colorValue?: string | undefined;
|
|
111
110
|
}): JSX.Element;
|
|
112
111
|
displayName: string;
|
|
113
112
|
}>;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare const _default: React.MemoExoticComponent<{
|
|
3
3
|
(props: {
|
|
4
4
|
readonly color?: import("../..").CommonComponentColor | undefined;
|
|
5
|
-
fill?: import("react-native-svg").Color | undefined;
|
|
5
|
+
readonly fill?: import("react-native-svg").Color | undefined;
|
|
6
6
|
testID?: string | undefined;
|
|
7
7
|
opacity?: import("react-native-svg").NumberProp | undefined;
|
|
8
8
|
readonly height?: import("react-native-svg").NumberProp | undefined;
|
|
@@ -107,7 +107,6 @@ declare const _default: React.MemoExoticComponent<{
|
|
|
107
107
|
onAccessibilityTap?: (() => void) | undefined;
|
|
108
108
|
onMagicTap?: (() => void) | undefined;
|
|
109
109
|
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
110
|
-
readonly colorValue?: string | undefined;
|
|
111
110
|
}): JSX.Element;
|
|
112
111
|
displayName: string;
|
|
113
112
|
}>;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare const _default: React.MemoExoticComponent<{
|
|
3
3
|
(props: {
|
|
4
4
|
readonly color?: import("../..").CommonComponentColor | undefined;
|
|
5
|
-
fill?: import("react-native-svg").Color | undefined;
|
|
5
|
+
readonly fill?: import("react-native-svg").Color | undefined;
|
|
6
6
|
testID?: string | undefined;
|
|
7
7
|
opacity?: import("react-native-svg").NumberProp | undefined;
|
|
8
8
|
readonly height?: import("react-native-svg").NumberProp | undefined;
|
|
@@ -107,7 +107,6 @@ declare const _default: React.MemoExoticComponent<{
|
|
|
107
107
|
onAccessibilityTap?: (() => void) | undefined;
|
|
108
108
|
onMagicTap?: (() => void) | undefined;
|
|
109
109
|
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
110
|
-
readonly colorValue?: string | undefined;
|
|
111
110
|
}): JSX.Element;
|
|
112
111
|
displayName: string;
|
|
113
112
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fountain-ui/core",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.3",
|
|
4
4
|
"author": "Fountain-UI Team",
|
|
5
5
|
"description": "React components that implement Tappytoon's Fountain Design.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"prepare": "bob build"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@fountain-ui/styles": "^2.0.0-beta.
|
|
18
|
-
"@fountain-ui/utils": "^2.0.0-beta.
|
|
17
|
+
"@fountain-ui/styles": "^2.0.0-beta.3",
|
|
18
|
+
"@fountain-ui/utils": "^2.0.0-beta.3"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@react-native-community/slider": "^4.1.6",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "9834b77f8529c853aede39ff73725a211907964d"
|
|
71
71
|
}
|
package/src/Button/Button.tsx
CHANGED
package/src/Chip/Chip.tsx
CHANGED
package/src/Fab/Fab.tsx
CHANGED
|
@@ -62,7 +62,7 @@ export default function Fab(props: FabProps) {
|
|
|
62
62
|
const icon = cloneElementSafely(children, {
|
|
63
63
|
width: iconSizes[size],
|
|
64
64
|
height: iconSizes[size],
|
|
65
|
-
|
|
65
|
+
fill: fontColor,
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
const elevationStyle = useElevationStyle(elevation);
|
package/src/SvgIcon/SvgIcon.tsx
CHANGED
|
@@ -6,7 +6,6 @@ import type SvgIconProps from './SvgIconProps';
|
|
|
6
6
|
export default function SvgIcon(props: SvgIconProps) {
|
|
7
7
|
const {
|
|
8
8
|
color: colorProp = 'primary',
|
|
9
|
-
colorValue,
|
|
10
9
|
height = 24,
|
|
11
10
|
style: styleProp,
|
|
12
11
|
viewBox = '0 0 20 20',
|
|
@@ -16,7 +15,7 @@ export default function SvgIcon(props: SvgIconProps) {
|
|
|
16
15
|
|
|
17
16
|
const theme = useTheme();
|
|
18
17
|
|
|
19
|
-
const color =
|
|
18
|
+
const color = theme.palette[colorProp].main;
|
|
20
19
|
|
|
21
20
|
const style = css([
|
|
22
21
|
{ flexShrink: 0 },
|
|
@@ -19,7 +19,7 @@ export default interface SvgIconProps extends OverridableComponentProps<SvgProps
|
|
|
19
19
|
/**
|
|
20
20
|
* The color of the component. It is treated as higher priority than `color` prop if provided.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
fill?: SvgProps['fill'];
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* The height applied to the icon.
|
|
@@ -4,6 +4,6 @@ type FalsyReactElement = ReactElement | null | undefined;
|
|
|
4
4
|
|
|
5
5
|
export default function cloneElementSafely(element: FalsyReactElement, props?: any): FalsyReactElement {
|
|
6
6
|
return element
|
|
7
|
-
? cloneElement(element, props)
|
|
7
|
+
? cloneElement(element, { ...props, ...element?.props })
|
|
8
8
|
: null;
|
|
9
9
|
};
|