@fountain-ui/core 3.0.0-alpha.42 → 3.0.0-alpha.44
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/AspectRatio/AspectRatioNative.js +1 -1
- package/build/commonjs/AspectRatio/AspectRatioNative.js.map +1 -1
- package/build/commonjs/AspectRatio/AspectRatioWeb.js +1 -1
- package/build/commonjs/AspectRatio/AspectRatioWeb.js.map +1 -1
- package/build/commonjs/Button/useVariantStyleMap.js +9 -0
- package/build/commonjs/Button/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/Image/Image.js +6 -2
- package/build/commonjs/Image/Image.js.map +1 -1
- package/build/commonjs/Image/OverlayCloseButton/OverlayCloseButton.js +46 -0
- package/build/commonjs/Image/OverlayCloseButton/OverlayCloseButton.js.map +1 -0
- package/build/commonjs/Image/OverlayCloseButton/OverlayCloseButtonProps.js +2 -0
- package/build/commonjs/Image/OverlayCloseButton/OverlayCloseButtonProps.js.map +1 -0
- package/build/commonjs/Image/OverlayCloseButton/index.js +16 -0
- package/build/commonjs/Image/OverlayCloseButton/index.js.map +1 -0
- package/build/commonjs/ImageCore/ImageCoreNative.js +2 -2
- package/build/commonjs/ImageCore/ImageCoreNative.js.map +1 -1
- package/build/commonjs/Radio/Radio.js +15 -2
- package/build/commonjs/Radio/Radio.js.map +1 -1
- package/build/commonjs/Radio/RadioProps.js.map +1 -1
- package/build/commonjs/Slider/Slider.js +22 -18
- package/build/commonjs/Slider/Slider.js.map +1 -1
- package/build/commonjs/internal/icons/CloseCircleFillPierced.js +23 -0
- package/build/commonjs/internal/icons/CloseCircleFillPierced.js.map +1 -0
- package/build/commonjs/internal/icons/index.js +8 -0
- package/build/commonjs/internal/icons/index.js.map +1 -1
- package/build/module/AspectRatio/AspectRatioNative.js +1 -1
- package/build/module/AspectRatio/AspectRatioNative.js.map +1 -1
- package/build/module/AspectRatio/AspectRatioWeb.js +1 -1
- package/build/module/AspectRatio/AspectRatioWeb.js.map +1 -1
- package/build/module/Button/useVariantStyleMap.js +9 -0
- package/build/module/Button/useVariantStyleMap.js.map +1 -1
- package/build/module/Image/Image.js +5 -2
- package/build/module/Image/Image.js.map +1 -1
- package/build/module/Image/OverlayCloseButton/OverlayCloseButton.js +31 -0
- package/build/module/Image/OverlayCloseButton/OverlayCloseButton.js.map +1 -0
- package/build/module/Image/OverlayCloseButton/OverlayCloseButtonProps.js +2 -0
- package/build/module/Image/OverlayCloseButton/OverlayCloseButtonProps.js.map +1 -0
- package/build/module/Image/OverlayCloseButton/index.js +2 -0
- package/build/module/Image/OverlayCloseButton/index.js.map +1 -0
- package/build/module/ImageCore/ImageCoreNative.js +2 -2
- package/build/module/ImageCore/ImageCoreNative.js.map +1 -1
- package/build/module/Radio/Radio.js +13 -2
- package/build/module/Radio/Radio.js.map +1 -1
- package/build/module/Radio/RadioProps.js.map +1 -1
- package/build/module/Slider/Slider.js +22 -18
- package/build/module/Slider/Slider.js.map +1 -1
- package/build/module/internal/icons/CloseCircleFillPierced.js +9 -0
- package/build/module/internal/icons/CloseCircleFillPierced.js.map +1 -0
- package/build/module/internal/icons/index.js +1 -0
- package/build/module/internal/icons/index.js.map +1 -1
- package/build/typescript/Dialog/useDialogSectionStyle.d.ts +1 -2
- package/build/typescript/Image/Image.d.ts +5 -1
- package/build/typescript/Image/OverlayCloseButton/OverlayCloseButton.d.ts +2 -0
- package/build/typescript/Image/OverlayCloseButton/OverlayCloseButtonProps.d.ts +3 -0
- package/build/typescript/Image/OverlayCloseButton/index.d.ts +2 -0
- package/build/typescript/Radio/RadioProps.d.ts +4 -0
- package/build/typescript/Slider/Slider.d.ts +1 -1
- package/build/typescript/Tabs/Tabs.d.ts +1 -1
- package/build/typescript/animated/AnimatedAppBar.d.ts +1 -2
- package/build/typescript/animated/AnimatedFlatList.d.ts +1 -2
- package/build/typescript/animated/AnimatedTypography.d.ts +1 -2
- package/build/typescript/internal/icons/AppBarChevronLeft.d.ts +300 -73
- package/build/typescript/internal/icons/Check.d.ts +300 -73
- package/build/typescript/internal/icons/CheckCircle.d.ts +300 -73
- package/build/typescript/internal/icons/Checkbox.d.ts +300 -73
- package/build/typescript/internal/icons/CheckboxChecked.d.ts +300 -73
- package/build/typescript/internal/icons/CheckboxOn.d.ts +300 -73
- package/build/typescript/internal/icons/ChevronDown.d.ts +300 -73
- package/build/typescript/internal/icons/ChevronLeft.d.ts +300 -73
- package/build/typescript/internal/icons/ChevronRight.d.ts +300 -73
- package/build/typescript/internal/icons/ChipClose.d.ts +300 -73
- package/build/typescript/internal/icons/Clear.d.ts +300 -73
- package/build/typescript/internal/icons/Close.d.ts +300 -73
- package/build/typescript/internal/icons/CloseCircleFillPierced.d.ts +358 -0
- package/build/typescript/internal/icons/EyeOff.d.ts +300 -73
- package/build/typescript/internal/icons/EyeOn.d.ts +300 -73
- package/build/typescript/internal/icons/InfoCircle.d.ts +300 -73
- package/build/typescript/internal/icons/Radio.d.ts +300 -73
- package/build/typescript/internal/icons/RadioChecked.d.ts +300 -73
- package/build/typescript/internal/icons/Search.d.ts +300 -73
- package/build/typescript/internal/icons/index.d.ts +1 -0
- package/package.json +8 -8
- package/src/AspectRatio/AspectRatioNative.tsx +2 -2
- package/src/AspectRatio/AspectRatioWeb.tsx +3 -3
- package/src/Button/useVariantStyleMap.ts +9 -0
- package/src/Image/Image.tsx +7 -2
- package/src/Image/OverlayCloseButton/OverlayCloseButton.tsx +41 -0
- package/src/Image/OverlayCloseButton/OverlayCloseButtonProps.ts +3 -0
- package/src/Image/OverlayCloseButton/index.ts +2 -0
- package/src/ImageCore/ImageCoreNative.tsx +2 -2
- package/src/Radio/Radio.tsx +27 -10
- package/src/Radio/RadioProps.ts +6 -0
- package/src/Slider/Slider.tsx +1 -0
- package/src/internal/icons/CloseCircleFillPierced.tsx +13 -0
- package/src/internal/icons/index.ts +1 -0
|
@@ -42,7 +42,7 @@ function AspectRatio(props) {
|
|
|
42
42
|
|
|
43
43
|
const containerStyle = (0, _styles.css)([{
|
|
44
44
|
aspectRatio: ratio,
|
|
45
|
-
width
|
|
45
|
+
width: width
|
|
46
46
|
}, styles.root, style]);
|
|
47
47
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
48
48
|
style: containerStyle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","root","overflow","AspectRatio","props","children","ratio","defaultRatio","style","width","defaultWidth","otherProps","styles","warnRatioNotPositive","containerStyle","css","aspectRatio"],"sources":["AspectRatioNative.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { css } from '../styles';\nimport type AspectRatioProps from './AspectRatioProps';\nimport { defaultRatio, defaultWidth, warnRatioNotPositive } from './utils';\n\ntype AspectRatioStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: UseStyles<AspectRatioStyles> = function (): AspectRatioStyles {\n return {\n root: {\n overflow: 'hidden',\n },\n };\n};\n\nexport default function AspectRatio(props: AspectRatioProps) {\n const {\n children,\n ratio = defaultRatio,\n style,\n width = defaultWidth,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n if (ratio <= 0) {\n warnRatioNotPositive(ratio);\n return null;\n }\n\n const containerStyle = css([\n { aspectRatio: ratio, width },\n styles.root,\n style,\n ]);\n\n return (\n <View\n style={containerStyle}\n {...otherProps}\n >\n {children}\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAEA;;;;;;AAIA,MAAMA,SAAuC,GAAG,YAA+B;EAC3E,OAAO;IACHC,IAAI,EAAE;MACFC,QAAQ,EAAE;IADR;EADH,CAAP;AAKH,CAND;;AAQe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,QADE;IAEFC,KAAK,GAAGC,mBAFN;IAGFC,KAHE;IAIFC,KAAK,GAAGC,mBAJN;IAKF,GAAGC;EALD,IAMFP,KANJ;EAQA,MAAMQ,MAAM,GAAGZ,SAAS,EAAxB;;EAEA,IAAIM,KAAK,IAAI,CAAb,EAAgB;IACZ,IAAAO,2BAAA,EAAqBP,KAArB;IACA,OAAO,IAAP;EACH;;EAED,MAAMQ,cAAc,GAAG,IAAAC,WAAA,EAAI,CACvB;IAAEC,WAAW,EAAEV,KAAf;IAAsBG;
|
|
1
|
+
{"version":3,"names":["useStyles","root","overflow","AspectRatio","props","children","ratio","defaultRatio","style","width","defaultWidth","otherProps","styles","warnRatioNotPositive","containerStyle","css","aspectRatio"],"sources":["AspectRatioNative.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { css } from '../styles';\nimport type AspectRatioProps from './AspectRatioProps';\nimport { defaultRatio, defaultWidth, warnRatioNotPositive } from './utils';\n\ntype AspectRatioStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: UseStyles<AspectRatioStyles> = function (): AspectRatioStyles {\n return {\n root: {\n overflow: 'hidden',\n },\n };\n};\n\nexport default function AspectRatio(props: AspectRatioProps) {\n const {\n children,\n ratio = defaultRatio,\n style,\n width = defaultWidth,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n if (ratio <= 0) {\n warnRatioNotPositive(ratio);\n return null;\n }\n\n const containerStyle = css([\n { aspectRatio: ratio, width: width as DimensionValue},\n styles.root,\n style,\n ]);\n\n return (\n <View\n style={containerStyle}\n {...otherProps}\n >\n {children}\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAEA;;;;;;AAIA,MAAMA,SAAuC,GAAG,YAA+B;EAC3E,OAAO;IACHC,IAAI,EAAE;MACFC,QAAQ,EAAE;IADR;EADH,CAAP;AAKH,CAND;;AAQe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,QADE;IAEFC,KAAK,GAAGC,mBAFN;IAGFC,KAHE;IAIFC,KAAK,GAAGC,mBAJN;IAKF,GAAGC;EALD,IAMFP,KANJ;EAQA,MAAMQ,MAAM,GAAGZ,SAAS,EAAxB;;EAEA,IAAIM,KAAK,IAAI,CAAb,EAAgB;IACZ,IAAAO,2BAAA,EAAqBP,KAArB;IACA,OAAO,IAAP;EACH;;EAED,MAAMQ,cAAc,GAAG,IAAAC,WAAA,EAAI,CACvB;IAAEC,WAAW,EAAEV,KAAf;IAAsBG,KAAK,EAAEA;EAA7B,CADuB,EAEvBG,MAAM,CAACX,IAFgB,EAGvBO,KAHuB,CAAJ,CAAvB;EAMA,oBACI,6BAAC,iBAAD;IACI,KAAK,EAAEM;EADX,GAEQH,UAFR,GAIKN,QAJL,CADJ;AAQH;;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","root","inner","height","overflow","child","StyleSheet","absoluteFillObject","AspectRatio","props","children","ratio","defaultRatio","style","width","defaultWidth","otherProps","styles","warnRatioNotPositive","outerStyle","css","innerStyle","paddingBottom","toFixed","childStyle","React","cloneElement"],"sources":["AspectRatioWeb.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { css, StyleSheet } from '../styles';\nimport type AspectRatioProps from './AspectRatioProps';\nimport { defaultRatio, defaultWidth, warnRatioNotPositive } from './utils';\n\ntype AspectRatioStyles = NamedStylesStringUnion<'root' | 'inner' | 'child'>;\n\nconst useStyles: UseStyles<AspectRatioStyles> = function (): AspectRatioStyles {\n return {\n root: {},\n inner: {\n height: 0,\n overflow: 'hidden',\n },\n child: {\n ...StyleSheet.absoluteFillObject,\n },\n };\n};\n\nexport default function AspectRatio(props: AspectRatioProps) {\n const {\n children,\n ratio = defaultRatio,\n style,\n width = defaultWidth,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n if (ratio <= 0) {\n warnRatioNotPositive(ratio);\n return null;\n }\n\n const outerStyle = css([\n styles.root,\n { width },\n style,\n ]);\n\n const innerStyle = css([\n { paddingBottom: `${(100 / ratio).toFixed(6)}%` },\n styles.inner,\n ]);\n\n const childStyle = css([\n children.props.style,\n styles.child,\n ]);\n\n return (\n <View\n style={outerStyle}\n {...otherProps}\n >\n <View style={innerStyle}>\n {React.cloneElement(children, {\n style: childStyle,\n })}\n </View>\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAEA;;;;;;AAIA,MAAMA,SAAuC,GAAG,YAA+B;EAC3E,OAAO;IACHC,IAAI,EAAE,EADH;IAEHC,KAAK,EAAE;MACHC,MAAM,EAAE,CADL;MAEHC,QAAQ,EAAE;IAFP,CAFJ;IAMHC,KAAK,EAAE,EACH,GAAGC,kBAAA,CAAWC;IADX;EANJ,CAAP;AAUH,CAXD;;AAae,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,QADE;IAEFC,KAAK,GAAGC,mBAFN;IAGFC,KAHE;IAIFC,KAAK,GAAGC,mBAJN;IAKF,GAAGC;EALD,IAMFP,KANJ;EAQA,MAAMQ,MAAM,GAAGjB,SAAS,EAAxB;;EAEA,IAAIW,KAAK,IAAI,CAAb,EAAgB;IACZ,IAAAO,2BAAA,EAAqBP,KAArB;IACA,OAAO,IAAP;EACH;;EAED,MAAMQ,UAAU,GAAG,IAAAC,WAAA,EAAI,CACnBH,MAAM,CAAChB,IADY,EAEnB;IAAEa;
|
|
1
|
+
{"version":3,"names":["useStyles","root","inner","height","overflow","child","StyleSheet","absoluteFillObject","AspectRatio","props","children","ratio","defaultRatio","style","width","defaultWidth","otherProps","styles","warnRatioNotPositive","outerStyle","css","innerStyle","paddingBottom","toFixed","childStyle","React","cloneElement"],"sources":["AspectRatioWeb.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { css, StyleSheet } from '../styles';\nimport type AspectRatioProps from './AspectRatioProps';\nimport { defaultRatio, defaultWidth, warnRatioNotPositive } from './utils';\n\ntype AspectRatioStyles = NamedStylesStringUnion<'root' | 'inner' | 'child'>;\n\nconst useStyles: UseStyles<AspectRatioStyles> = function (): AspectRatioStyles {\n return {\n root: {},\n inner: {\n height: 0,\n overflow: 'hidden',\n },\n child: {\n ...StyleSheet.absoluteFillObject,\n },\n };\n};\n\nexport default function AspectRatio(props: AspectRatioProps) {\n const {\n children,\n ratio = defaultRatio,\n style,\n width = defaultWidth,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n if (ratio <= 0) {\n warnRatioNotPositive(ratio);\n return null;\n }\n\n const outerStyle = css([\n styles.root,\n { width: width as DimensionValue },\n style,\n ]);\n\n const innerStyle = css([\n { paddingBottom: `${(100 / ratio).toFixed(6)}%` as DimensionValue},\n styles.inner,\n ]);\n\n const childStyle = css([\n children.props.style,\n styles.child,\n ]);\n\n return (\n <View\n style={outerStyle}\n {...otherProps}\n >\n <View style={innerStyle}>\n {React.cloneElement(children, {\n style: childStyle,\n })}\n </View>\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAEA;;;;;;AAIA,MAAMA,SAAuC,GAAG,YAA+B;EAC3E,OAAO;IACHC,IAAI,EAAE,EADH;IAEHC,KAAK,EAAE;MACHC,MAAM,EAAE,CADL;MAEHC,QAAQ,EAAE;IAFP,CAFJ;IAMHC,KAAK,EAAE,EACH,GAAGC,kBAAA,CAAWC;IADX;EANJ,CAAP;AAUH,CAXD;;AAae,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,QADE;IAEFC,KAAK,GAAGC,mBAFN;IAGFC,KAHE;IAIFC,KAAK,GAAGC,mBAJN;IAKF,GAAGC;EALD,IAMFP,KANJ;EAQA,MAAMQ,MAAM,GAAGjB,SAAS,EAAxB;;EAEA,IAAIW,KAAK,IAAI,CAAb,EAAgB;IACZ,IAAAO,2BAAA,EAAqBP,KAArB;IACA,OAAO,IAAP;EACH;;EAED,MAAMQ,UAAU,GAAG,IAAAC,WAAA,EAAI,CACnBH,MAAM,CAAChB,IADY,EAEnB;IAAEa,KAAK,EAAEA;EAAT,CAFmB,EAGnBD,KAHmB,CAAJ,CAAnB;EAMA,MAAMQ,UAAU,GAAG,IAAAD,WAAA,EAAI,CACnB;IAAEE,aAAa,EAAG,GAAE,CAAC,MAAMX,KAAP,EAAcY,OAAd,CAAsB,CAAtB,CAAyB;EAA7C,CADmB,EAEnBN,MAAM,CAACf,KAFY,CAAJ,CAAnB;EAKA,MAAMsB,UAAU,GAAG,IAAAJ,WAAA,EAAI,CACnBV,QAAQ,CAACD,KAAT,CAAeI,KADI,EAEnBI,MAAM,CAACZ,KAFY,CAAJ,CAAnB;EAKA,oBACI,6BAAC,iBAAD;IACI,KAAK,EAAEc;EADX,GAEQH,UAFR,gBAII,6BAAC,iBAAD;IAAM,KAAK,EAAEK;EAAb,gBACKI,cAAA,CAAMC,YAAN,CAAmBhB,QAAnB,EAA6B;IAC1BG,KAAK,EAAEW;EADmB,CAA7B,CADL,CAJJ,CADJ;AAYH;;AAAA"}
|
|
@@ -171,6 +171,15 @@ function useVariantStyleMap(variant, color) {
|
|
|
171
171
|
},
|
|
172
172
|
labelColor: theme.palette.text.accent,
|
|
173
173
|
iconColor: theme.palette.icon.accent
|
|
174
|
+
},
|
|
175
|
+
danger: {
|
|
176
|
+
container: {
|
|
177
|
+
borderColor: theme.palette.status.danger,
|
|
178
|
+
borderRadius: theme.shape.radius.full,
|
|
179
|
+
borderWidth: 1
|
|
180
|
+
},
|
|
181
|
+
labelColor: theme.palette.status.danger,
|
|
182
|
+
iconColor: theme.palette.status.danger
|
|
174
183
|
}
|
|
175
184
|
}
|
|
176
185
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useVariantStyleMap","variant","color","theme","useTheme","useMemo","palette","variantStyleMap","solid","accent","container","backgroundColor","fill","labelColor","commonColors","static","strongInverse","iconColor","primary","base","text","icon","danger","status","disabled","onDisabled","outlined","borderColor","border","borderWidth","disabledLabel","strong","secondary","accentAlt","capsuleSolid","borderRadius","shape","radius","full","capsuleOutlined","process","env","NODE_ENV","console","warn"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { commonColors } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { ButtonColor, ButtonVariant } from './ButtonProps';\n\ntype UseVariantStyleMapReturns = {\n container?: FountainUiStyle;\n iconColor?: string;\n labelColor?: string;\n}\n\ntype VariantStyleMap = {\n [variant in ButtonVariant]: {\n [color in ButtonColor]?: UseVariantStyleMapReturns;\n }\n};\n\nexport default function useVariantStyleMap(variant: ButtonVariant, color: ButtonColor): UseVariantStyleMapReturns {\n const theme = useTheme();\n\n return useMemo(() => {\n const { palette } = theme;\n\n const variantStyleMap: VariantStyleMap = {\n solid: {\n accent: {\n container: {\n backgroundColor: palette.fill.accent,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n primary: {\n container: {\n backgroundColor: palette.fill.base,\n },\n labelColor: palette.text.strongInverse,\n iconColor: palette.icon.strongInverse,\n },\n danger: {\n container: {\n backgroundColor: palette.status.danger,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n disabled: {\n container: {\n backgroundColor: palette.status.disabled,\n },\n labelColor: palette.status.onDisabled,\n iconColor: palette.status.onDisabled,\n },\n },\n outlined: {\n accent: {\n container: {\n borderColor: palette.border.accent,\n borderWidth: 1,\n },\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n primary: {\n container: {\n borderColor: palette.border.base,\n borderWidth: 1,\n },\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n disabled: {\n container: {\n borderColor: palette.status.disabled,\n borderWidth: 1,\n },\n labelColor: palette.status.disabledLabel,\n iconColor: palette.status.disabledLabel,\n },\n },\n text: {\n primary: {\n labelColor: palette.text.strong,\n iconColor: palette.icon.strong,\n },\n secondary: {\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n accent: {\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n accentAlt: {\n labelColor: palette.text.accentAlt,\n iconColor: palette.icon.accentAlt,\n },\n danger: {\n labelColor: palette.status.danger,\n iconColor: palette.status.danger,\n },\n disabled: {\n labelColor: palette.status.disabledLabel,\n iconColor: palette.status.disabledLabel,\n },\n },\n capsuleSolid: {\n accent: {\n container: {\n backgroundColor: theme.palette.fill.accent,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n primary: {\n container: {\n backgroundColor: theme.palette.fill.base,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: palette.text.strongInverse,\n iconColor: palette.icon.strongInverse,\n },\n danger: {\n container: {\n backgroundColor: theme.palette.status.danger,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n secondary: {\n container: {\n backgroundColor: commonColors.static.strongInverse,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: theme.palette.text.strong,\n iconColor: theme.palette.icon.strong,\n },\n disabled: {\n container: {\n backgroundColor: theme.palette.status.disabled,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: theme.palette.status.onDisabled,\n iconColor: theme.palette.status.onDisabled,\n },\n },\n capsuleOutlined: {\n primary: {\n container: {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.text.strong,\n iconColor: theme.palette.icon.strong,\n },\n disabled: {\n container: {\n borderColor: theme.palette.status.disabled,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.status.disabledLabel,\n iconColor: theme.palette.status.disabledLabel,\n },\n accent: {\n container: {\n borderColor: theme.palette.border.accent,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.text.accent,\n iconColor: theme.palette.icon.accent,\n },\n },\n };\n\n if (variantStyleMap[variant]?.[color]) {\n return variantStyleMap[variant][color] as UseVariantStyleMapReturns;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n console.warn('The selected color is not supported for the chosen variant.');\n }\n\n return {};\n }, [theme, variant, color]);\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAee,SAASA,kBAAT,CAA4BC,OAA5B,EAAoDC,KAApD,EAAmG;EAC9G,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAQ,MAAM;IAAA;;IACjB,MAAM;MAAEC;IAAF,IAAcH,KAApB;IAEA,MAAMI,eAAgC,GAAG;MACrCC,KAAK,EAAE;QACHC,MAAM,EAAE;UACJC,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACM,IAAR,CAAaH;UADvB,CADP;UAIJI,UAAU,EAAEC,oBAAA,CAAaC,MAAb,CAAoBC,aAJ5B;UAKJC,SAAS,EAAEH,oBAAA,CAAaC,MAAb,CAAoBC;QAL3B,CADL;QAQHE,OAAO,EAAE;UACLR,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACM,IAAR,CAAaO;UADvB,CADN;UAILN,UAAU,EAAEP,OAAO,CAACc,IAAR,CAAaJ,aAJpB;UAKLC,SAAS,EAAEX,OAAO,CAACe,IAAR,CAAaL;QALnB,CARN;QAeHM,MAAM,EAAE;UACJZ,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACiB,MAAR,CAAeD;UADzB,CADP;UAIJT,UAAU,EAAEC,oBAAA,CAAaC,MAAb,CAAoBC,aAJ5B;UAKJC,SAAS,EAAEH,oBAAA,CAAaC,MAAb,CAAoBC;QAL3B,CAfL;QAsBHQ,QAAQ,EAAE;UACNd,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACiB,MAAR,CAAeC;UADzB,CADL;UAINX,UAAU,EAAEP,OAAO,CAACiB,MAAR,CAAeE,UAJrB;UAKNR,SAA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AF1B;YAGPT,WAAW,EAAE;UAHN,CADL;UAMNhB,UAAU,EAAEV,KAAK,CAACG,OAAN,CAAciB,MAAd,CAAqBO,aAN3B;UAONb,SAAS,EAAEd,KAAK,CAACG,OAAN,CAAciB,MAAd,CAAqBO;QAP1B,CAVG;QAmBbrB,MAAM,EAAE;UACJC,SAAS,EAAE;YACPiB,WAAW,EAAExB,KAAK,CAACG,OAAN,CAAcsB,MAAd,CAAqBnB,MAD3B;YAEP0B,YAAY,EAAEhC,KAAK,CAACiC,KAAN,CAAYC,MAAZ,CAAmBC,IAF1B;YAGPT,WAAW,EAAE;UAHN,CADP;UAMJhB,UAAU,EAAEV,KAAK,CAACG,OAAN,CAAcc,IAAd,CAAmBX,MAN3B;UAOJQ,SAAS,EAAEd,KAAK,CAACG,OAAN,CAAce,IAAd,CAAmBZ;QAP1B;MAnBK;IA7HoB,CAAzC;;IA4JA,6BAAIF,eAAe,CAACN,OAAD,CAAnB,kDAAI,sBAA2BC,KAA3B,CAAJ,EAAuC;MACnC,OAAOK,eAAe,CAACN,OAAD,CAAf,CAAyBC,KAAzB,CAAP;IACH;;IAED,IAAIsC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;MACvCC,OAAO,CAACC,IAAR,CAAa,6DAAb;IACH;;IAED,OAAO,EAAP;EACH,CAxKM,EAwKJ,CAACzC,KAAD,EAAQF,OAAR,EAAiBC,KAAjB,CAxKI,CAAP;AAyKH"}
|
|
1
|
+
{"version":3,"names":["useVariantStyleMap","variant","color","theme","useTheme","useMemo","palette","variantStyleMap","solid","accent","container","backgroundColor","fill","labelColor","commonColors","static","strongInverse","iconColor","primary","base","text","icon","danger","status","disabled","onDisabled","outlined","borderColor","border","borderWidth","disabledLabel","strong","secondary","accentAlt","capsuleSolid","borderRadius","shape","radius","full","capsuleOutlined","process","env","NODE_ENV","console","warn"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { commonColors } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { ButtonColor, ButtonVariant } from './ButtonProps';\n\ntype UseVariantStyleMapReturns = {\n container?: FountainUiStyle;\n iconColor?: string;\n labelColor?: string;\n}\n\ntype VariantStyleMap = {\n [variant in ButtonVariant]: {\n [color in ButtonColor]?: UseVariantStyleMapReturns;\n }\n};\n\nexport default function useVariantStyleMap(variant: ButtonVariant, color: ButtonColor): UseVariantStyleMapReturns {\n const theme = useTheme();\n\n return useMemo(() => {\n const { palette } = theme;\n\n const variantStyleMap: VariantStyleMap = {\n solid: {\n accent: {\n container: {\n backgroundColor: palette.fill.accent,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n primary: {\n container: {\n backgroundColor: palette.fill.base,\n },\n labelColor: palette.text.strongInverse,\n iconColor: palette.icon.strongInverse,\n },\n danger: {\n container: {\n backgroundColor: palette.status.danger,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n disabled: {\n container: {\n backgroundColor: palette.status.disabled,\n },\n labelColor: palette.status.onDisabled,\n iconColor: palette.status.onDisabled,\n },\n },\n outlined: {\n accent: {\n container: {\n borderColor: palette.border.accent,\n borderWidth: 1,\n },\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n primary: {\n container: {\n borderColor: palette.border.base,\n borderWidth: 1,\n },\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n disabled: {\n container: {\n borderColor: palette.status.disabled,\n borderWidth: 1,\n },\n labelColor: palette.status.disabledLabel,\n iconColor: palette.status.disabledLabel,\n },\n },\n text: {\n primary: {\n labelColor: palette.text.strong,\n iconColor: palette.icon.strong,\n },\n secondary: {\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n accent: {\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n accentAlt: {\n labelColor: palette.text.accentAlt,\n iconColor: palette.icon.accentAlt,\n },\n danger: {\n labelColor: palette.status.danger,\n iconColor: palette.status.danger,\n },\n disabled: {\n labelColor: palette.status.disabledLabel,\n iconColor: palette.status.disabledLabel,\n },\n },\n capsuleSolid: {\n accent: {\n container: {\n backgroundColor: theme.palette.fill.accent,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n primary: {\n container: {\n backgroundColor: theme.palette.fill.base,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: palette.text.strongInverse,\n iconColor: palette.icon.strongInverse,\n },\n danger: {\n container: {\n backgroundColor: theme.palette.status.danger,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n secondary: {\n container: {\n backgroundColor: commonColors.static.strongInverse,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: theme.palette.text.strong,\n iconColor: theme.palette.icon.strong,\n },\n disabled: {\n container: {\n backgroundColor: theme.palette.status.disabled,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: theme.palette.status.onDisabled,\n iconColor: theme.palette.status.onDisabled,\n },\n },\n capsuleOutlined: {\n primary: {\n container: {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.text.strong,\n iconColor: theme.palette.icon.strong,\n },\n disabled: {\n container: {\n borderColor: theme.palette.status.disabled,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.status.disabledLabel,\n iconColor: theme.palette.status.disabledLabel,\n },\n accent: {\n container: {\n borderColor: theme.palette.border.accent,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.text.accent,\n iconColor: theme.palette.icon.accent,\n },\n danger: {\n container: {\n borderColor: theme.palette.status.danger,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.status.danger,\n iconColor: theme.palette.status.danger,\n },\n },\n };\n\n if (variantStyleMap[variant]?.[color]) {\n return variantStyleMap[variant][color] as UseVariantStyleMapReturns;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n console.warn('The selected color is not supported for the chosen variant.');\n }\n\n return {};\n }, [theme, variant, color]);\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAee,SAASA,kBAAT,CAA4BC,OAA5B,EAAoDC,KAApD,EAAmG;EAC9G,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAQ,MAAM;IAAA;;IACjB,MAAM;MAAEC;IAAF,IAAcH,KAApB;IAEA,MAAMI,eAAgC,GAAG;MACrCC,KAAK,EAAE;QACHC,MAAM,EAAE;UACJC,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACM,IAAR,CAAaH;UADvB,CADP;UAIJI,UAAU,EAAEC,oBAAA,CAAaC,MAAb,CAAoBC,aAJ5B;UAKJC,SAAS,EAAEH,oBAAA,CAAaC,MAAb,CAAoBC;QAL3B,CADL;QAQHE,OAAO,EAAE;UACLR,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACM,IAAR,CAAaO;UADvB,CADN;UAILN,UAAU,EAAEP,OAAO,CAACc,IAAR,CAAaJ,aAJpB;UAKLC,SAAS,EAAEX,OAAO,CAACe,IAAR,CAAaL;QALnB,CARN;QAeHM,MAAM,EAAE;UACJZ,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACiB,MAAR,CAAeD;UADzB,CADP;UAIJT,UAAU,EAAEC,oBAAA,CAAaC,MAAb,CAAoBC,aAJ5B;UAKJC,SAAS,EAAEH,oBAAA,CAAaC,MAAb,CAAoBC;QAL3B,CAfL;QAsBHQ,QAAQ,EAAE;UACNd,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACiB,MAAR,CAAeC;UADzB,CADL;UAINX,UAAU,EAAEP,OAAO,CAACiB,MAAR,CAAeE,UAJrB;UAKNR,SAAS,EAAEX,OAAO,C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;AAkLH"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
@@ -13,6 +13,8 @@ var _ImageCore = _interopRequireDefault(require("../ImageCore"));
|
|
|
13
13
|
|
|
14
14
|
var _styles = require("../styles");
|
|
15
15
|
|
|
16
|
+
var _OverlayCloseButton = _interopRequireDefault(require("./OverlayCloseButton"));
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -124,5 +126,7 @@ function Image(props) {
|
|
|
124
126
|
}, overlaidChildren) : null);
|
|
125
127
|
}
|
|
126
128
|
|
|
127
|
-
;
|
|
129
|
+
Image.OverlayCloseButton = _OverlayCloseButton.default;
|
|
130
|
+
var _default = Image;
|
|
131
|
+
exports.default = _default;
|
|
128
132
|
//# sourceMappingURL=Image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","theme","useTheme","root","rounded","borderRadius","shape","roundness","overflow","placeholder","backgroundColor","palette","paper","grey","outlined","borderWidth","borderStyle","borderColor","border","weak","error","alignItems","height","justifyContent","width","errorText","color","text","primary","fontFamily","fontSize","letterSpacing","lineHeight","textAlign","determinePlaceholderMode","props","disablePlaceholder","Image","alt","cache","disableDrag","disableLongClick","disableOutline","loading","onError","onErrorProp","onLoad","onLoadProp","overlaidChildren","resizeMode","source","style","square","otherProps","failed","setFailed","useState","styles","placeholderMode","css","undefined","StyleSheet","absoluteFill","zIndex","uri"],"sources":["Image.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Text, View } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport type { ImageCoreProps } from '../ImageCore';\nimport ImageCore from '../ImageCore';\nimport { css, StyleSheet, useTheme } from '../styles';\nimport type ImageProps from './ImageProps';\n\ntype PlaceholderMode =\n | 'default'\n | 'custom'\n | 'none';\n\ntype ImageStyleKeys =\n | 'root'\n | 'rounded'\n | 'placeholder'\n | 'outlined'\n | 'error'\n | 'errorText';\n\ntype ImageStyles = NamedStylesStringUnion<ImageStyleKeys>;\n\nconst useStyles: UseStyles<ImageStyles> = function (): ImageStyles {\n const theme = useTheme();\n\n return {\n root: {},\n rounded: {\n borderRadius: theme.shape.roundness,\n overflow: 'hidden',\n },\n placeholder: {\n backgroundColor: theme.palette.paper.grey,\n },\n outlined: {\n borderWidth: 0.5,\n borderStyle: 'solid',\n borderColor: theme.palette.border.weak,\n },\n error: {\n alignItems: 'center',\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n },\n errorText: {\n color: theme.palette.text.primary,\n fontFamily: 'Inter-Medium',\n fontSize: 12,\n letterSpacing: 0,\n lineHeight: 18,\n textAlign: 'center',\n },\n };\n};\n\nfunction determinePlaceholderMode(props: ImageProps): PlaceholderMode {\n if (props.disablePlaceholder) {\n return 'none';\n }\n\n return props.placeholder ? 'custom' : 'default';\n}\n\
|
|
1
|
+
{"version":3,"names":["useStyles","theme","useTheme","root","rounded","borderRadius","shape","roundness","overflow","placeholder","backgroundColor","palette","paper","grey","outlined","borderWidth","borderStyle","borderColor","border","weak","error","alignItems","height","justifyContent","width","errorText","color","text","primary","fontFamily","fontSize","letterSpacing","lineHeight","textAlign","determinePlaceholderMode","props","disablePlaceholder","Image","alt","cache","disableDrag","disableLongClick","disableOutline","loading","onError","onErrorProp","onLoad","onLoadProp","overlaidChildren","resizeMode","source","style","square","otherProps","failed","setFailed","useState","styles","placeholderMode","css","undefined","StyleSheet","absoluteFill","zIndex","uri","OverlayCloseButton"],"sources":["Image.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Text, View } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport type { ImageCoreProps } from '../ImageCore';\nimport ImageCore from '../ImageCore';\nimport { css, StyleSheet, useTheme } from '../styles';\nimport type ImageProps from './ImageProps';\nimport OverlayCloseButton from './OverlayCloseButton';\n\ntype PlaceholderMode =\n | 'default'\n | 'custom'\n | 'none';\n\ntype ImageStyleKeys =\n | 'root'\n | 'rounded'\n | 'placeholder'\n | 'outlined'\n | 'error'\n | 'errorText';\n\ntype ImageStyles = NamedStylesStringUnion<ImageStyleKeys>;\n\nconst useStyles: UseStyles<ImageStyles> = function (): ImageStyles {\n const theme = useTheme();\n\n return {\n root: {},\n rounded: {\n borderRadius: theme.shape.roundness,\n overflow: 'hidden',\n },\n placeholder: {\n backgroundColor: theme.palette.paper.grey,\n },\n outlined: {\n borderWidth: 0.5,\n borderStyle: 'solid',\n borderColor: theme.palette.border.weak,\n },\n error: {\n alignItems: 'center',\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n },\n errorText: {\n color: theme.palette.text.primary,\n fontFamily: 'Inter-Medium',\n fontSize: 12,\n letterSpacing: 0,\n lineHeight: 18,\n textAlign: 'center',\n },\n };\n};\n\nfunction determinePlaceholderMode(props: ImageProps): PlaceholderMode {\n if (props.disablePlaceholder) {\n return 'none';\n }\n\n return props.placeholder ? 'custom' : 'default';\n}\n\nfunction Image(props: ImageProps) {\n const {\n alt,\n cache = 'immutable',\n disableDrag,\n disableLongClick,\n disableOutline,\n disablePlaceholder,\n error,\n loading = 'lazy',\n onError: onErrorProp,\n onLoad: onLoadProp,\n overlaidChildren,\n placeholder,\n resizeMode = 'cover',\n source,\n style,\n square = false,\n ...otherProps\n } = props;\n\n const [failed, setFailed] = useState(false);\n\n const styles = useStyles();\n\n const onLoad: ImageCoreProps['onLoad'] = () => {\n setFailed(false);\n\n onLoadProp?.();\n };\n\n const onError: ImageCoreProps['onError'] = () => {\n setFailed(true);\n\n onErrorProp?.();\n };\n\n const placeholderMode = determinePlaceholderMode(props);\n\n return (\n <View\n style={css([\n styles.root,\n !disableOutline ? styles.outlined : undefined,\n !square ? styles.rounded : undefined,\n placeholderMode === 'default' ? styles.placeholder : undefined,\n style,\n ])}\n {...otherProps}\n >\n {placeholderMode === 'custom' ? (\n <View\n style={css([\n StyleSheet.absoluteFill,\n { zIndex: -1 },\n ])}\n >\n {placeholder}\n </View>\n ) : null}\n\n {failed ? (\n <View style={styles.error}>\n {error ?? (\n <Text\n children={alt}\n style={styles.errorText}\n />\n )}\n </View>\n ) : source.uri ? (\n <ImageCore\n alt={alt}\n cache={cache}\n disableDrag={disableDrag}\n disableLongClick={disableLongClick}\n height={'100%'}\n loading={loading}\n onError={onError}\n onLoad={onLoad}\n resizeMode={resizeMode}\n source={source}\n width={'100%'}\n />\n ) : null}\n\n {overlaidChildren ? (\n <View style={StyleSheet.absoluteFill}>\n {overlaidChildren}\n </View>\n ) : null}\n </View>\n );\n}\n\nImage.OverlayCloseButton = OverlayCloseButton;\n\nexport default Image;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;AACA;;AAEA;;;;;;;;;;AAiBA,MAAMA,SAAiC,GAAG,YAAyB;EAC/D,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE,EADH;IAEHC,OAAO,EAAE;MACLC,YAAY,EAAEJ,KAAK,CAACK,KAAN,CAAYC,SADrB;MAELC,QAAQ,EAAE;IAFL,CAFN;IAMHC,WAAW,EAAE;MACTC,eAAe,EAAET,KAAK,CAACU,OAAN,CAAcC,KAAd,CAAoBC;IAD5B,CANV;IASHC,QAAQ,EAAE;MACNC,WAAW,EAAE,GADP;MAENC,WAAW,EAAE,OAFP;MAGNC,WAAW,EAAEhB,KAAK,CAACU,OAAN,CAAcO,M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;IAAM,KAAK,EAAEa,kBAAA,CAAWC;EAAxB,GACKd,gBADL,CADa,GAIb,IAlDR,CADJ;AAsDH;;AAEDX,KAAK,CAAC4B,kBAAN,GAA2BA,2BAA3B;eAEe5B,K"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = OverlayCloseButton;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _styles = require("@fountain-ui/styles");
|
|
11
|
+
|
|
12
|
+
var _IconButton = _interopRequireDefault(require("../../IconButton"));
|
|
13
|
+
|
|
14
|
+
var _internal = require("../../internal");
|
|
15
|
+
|
|
16
|
+
var _styles2 = require("../../styles");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
22
|
+
const styles = _styles2.StyleSheet.create({
|
|
23
|
+
root: {
|
|
24
|
+
height: 40,
|
|
25
|
+
left: 8,
|
|
26
|
+
position: 'absolute',
|
|
27
|
+
top: 8,
|
|
28
|
+
width: 40
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
function OverlayCloseButton(props) {
|
|
33
|
+
const {
|
|
34
|
+
style: styleProp,
|
|
35
|
+
...otherProps
|
|
36
|
+
} = props;
|
|
37
|
+
const rootStyle = (0, _styles2.css)([styles.root, styleProp]);
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_IconButton.default, _extends({
|
|
39
|
+
style: rootStyle
|
|
40
|
+
}, otherProps), /*#__PURE__*/_react.default.createElement(_internal.CloseCircleFillPierced, {
|
|
41
|
+
fill: _styles.commonColors.static.baseOpacityInverse,
|
|
42
|
+
height: 21,
|
|
43
|
+
width: 21
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=OverlayCloseButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["styles","StyleSheet","create","root","height","left","position","top","width","OverlayCloseButton","props","style","styleProp","otherProps","rootStyle","css","commonColors","static","baseOpacityInverse"],"sources":["OverlayCloseButton.tsx"],"sourcesContent":["import React from 'react';\nimport { commonColors } from '@fountain-ui/styles';\nimport IconButton from '../../IconButton';\nimport { CloseCircleFillPierced } from '../../internal';\nimport { css, StyleSheet } from '../../styles';\nimport type OverlayCloseButtonProps from './OverlayCloseButtonProps';\n\nconst styles = StyleSheet.create({\n root: {\n height: 40,\n left: 8,\n position: 'absolute',\n top: 8,\n width: 40,\n },\n});\n\nexport default function OverlayCloseButton(props: OverlayCloseButtonProps) {\n const {\n style: styleProp,\n ...otherProps\n } = props;\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n return (\n <IconButton\n style={rootStyle}\n {...otherProps}\n >\n <CloseCircleFillPierced\n fill={commonColors.static.baseOpacityInverse}\n height={21}\n width={21}\n />\n </IconButton>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAGA,MAAMA,MAAM,GAAGC,mBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,MAAM,EAAE,EADN;IAEFC,IAAI,EAAE,CAFJ;IAGFC,QAAQ,EAAE,UAHR;IAIFC,GAAG,EAAE,CAJH;IAKFC,KAAK,EAAE;EALL;AADuB,CAAlB,CAAf;;AAUe,SAASC,kBAAT,CAA4BC,KAA5B,EAA4D;EACvE,MAAM;IACFC,KAAK,EAAEC,SADL;IAEF,GAAGC;EAFD,IAGFH,KAHJ;EAKA,MAAMI,SAAS,GAAG,IAAAC,YAAA,EAAI,CAClBf,MAAM,CAACG,IADW,EAElBS,SAFkB,CAAJ,CAAlB;EAKA,oBACI,6BAAC,mBAAD;IACI,KAAK,EAAEE;EADX,GAEQD,UAFR,gBAII,6BAAC,gCAAD;IACI,IAAI,EAAEG,oBAAA,CAAaC,MAAb,CAAoBC,kBAD9B;IAEI,MAAM,EAAE,EAFZ;IAGI,KAAK,EAAE;EAHX,EAJJ,CADJ;AAYH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["OverlayCloseButtonProps.ts"],"sourcesContent":["import type { IconButtonProps } from '../../IconButton';\n\nexport default interface OverlayCloseButtonProps extends Omit<IconButtonProps, 'children'> {}"],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _OverlayCloseButton.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _OverlayCloseButton = _interopRequireDefault(require("./OverlayCloseButton"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './OverlayCloseButton';\nexport type { default as OverlayCloseButtonProps } from './OverlayCloseButtonProps';"],"mappings":";;;;;;;;;;;;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AnimatedFastImage","Animated","createAnimatedComponent","FastImage","INITIAL_OPACITY","LOADED_OPACITY","ANIMATION_DURATION","ImageCore","props","cache","height","onError","onLoad","resizeMode","source","width","opacity","useAnimatedValue","acceptHeader","useContext","ImageFileExtensionContext","handleLoad","useCallback","timing","toValue","duration","useNativeDriver","isNotAndroid12","start","uri","headers"],"sources":["ImageCoreNative.tsx"],"sourcesContent":["import React, { useCallback, useContext } from 'react';\nimport { Animated } from 'react-native';\nimport FastImage from '@d11/react-native-fast-image';\nimport { useAnimatedValue } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\nimport type ImageCoreProps from './ImageCoreProps';\nimport ImageFileExtensionContext from './ImageFileExtensionContext';\n\n// @ts-ignore\nconst AnimatedFastImage = Animated.createAnimatedComponent(FastImage);\n\nconst INITIAL_OPACITY = 0;\nconst LOADED_OPACITY = 1;\n\nconst ANIMATION_DURATION = 200;\n\nexport default function ImageCore(props: ImageCoreProps) {\n const {\n cache,\n height,\n onError,\n onLoad,\n resizeMode,\n source,\n width,\n } = props;\n\n const opacity = useAnimatedValue(INITIAL_OPACITY);\n\n const acceptHeader = useContext(ImageFileExtensionContext);\n\n const handleLoad = useCallback(() => {\n Animated.timing(opacity, {\n toValue: LOADED_OPACITY,\n duration: ANIMATION_DURATION,\n useNativeDriver: isNotAndroid12,\n }).start();\n\n onLoad?.();\n }, [onLoad]);\n\n return (\n <AnimatedFastImage\n onError={onError}\n onLoad={handleLoad}\n resizeMode={resizeMode}\n source={{\n cache,\n uri: source.uri,\n headers: {\n 'Accept': acceptHeader,\n },\n }}\n style={[\n { opacity },\n { width, height },\n ]}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAEA;AACA,MAAMA,iBAAiB,GAAGC,qBAAA,CAASC,uBAAT,CAAiCC,6BAAjC,CAA1B;;AAEA,MAAMC,eAAe,GAAG,CAAxB;AACA,MAAMC,cAAc,GAAG,CAAvB;AAEA,MAAMC,kBAAkB,GAAG,GAA3B;;AAEe,SAASC,SAAT,CAAmBC,KAAnB,EAA0C;EACrD,MAAM;IACFC,KADE;IAEFC,MAFE;IAGFC,OAHE;IAIFC,MAJE;IAKFC,UALE;IAMFC,MANE;IAOFC;EAPE,IAQFP,KARJ;EAUA,MAAMQ,OAAO,GAAG,IAAAC,uBAAA,EAAiBb,eAAjB,CAAhB;EAEA,MAAMc,YAAY,GAAG,IAAAC,iBAAA,EAAWC,kCAAX,CAArB;EAEA,MAAMC,UAAU,GAAG,IAAAC,kBAAA,EAAY,MAAM;IACjCrB,qBAAA,CAASsB,MAAT,CAAgBP,OAAhB,EAAyB;MACrBQ,OAAO,EAAEnB,cADY;MAErBoB,QAAQ,EAAEnB,kBAFW;MAGrBoB,eAAe,EAAEC;IAHI,CAAzB,EAIGC,KAJH;;IAMAhB,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM;EACT,CARkB,EAQhB,CAACA,MAAD,CARgB,CAAnB;EAUA,oBACI,6BAAC,iBAAD;IACI,OAAO,EAAED,OADb;IAEI,MAAM,EAAEU,UAFZ;IAGI,UAAU,EAAER,UAHhB;IAII,MAAM,EAAE;MACJJ,KADI;MAEJoB,GAAG,EAAEf,MAAM,CAACe,GAFR;MAGJC,OAAO,EAAE;QACL,UAAUZ;MADL;IAHL,CAJZ;IAWI,KAAK,EAAE,CACH;MAAEF;IAAF,CADG,EAEH;MAAED,
|
|
1
|
+
{"version":3,"names":["AnimatedFastImage","Animated","createAnimatedComponent","FastImage","INITIAL_OPACITY","LOADED_OPACITY","ANIMATION_DURATION","ImageCore","props","cache","height","onError","onLoad","resizeMode","source","width","opacity","useAnimatedValue","acceptHeader","useContext","ImageFileExtensionContext","handleLoad","useCallback","timing","toValue","duration","useNativeDriver","isNotAndroid12","start","uri","headers"],"sources":["ImageCoreNative.tsx"],"sourcesContent":["import React, { useCallback, useContext } from 'react';\nimport { Animated, DimensionValue } from 'react-native';\nimport FastImage from '@d11/react-native-fast-image';\nimport { useAnimatedValue } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\nimport type ImageCoreProps from './ImageCoreProps';\nimport ImageFileExtensionContext from './ImageFileExtensionContext';\n\n// @ts-ignore\nconst AnimatedFastImage = Animated.createAnimatedComponent(FastImage);\n\nconst INITIAL_OPACITY = 0;\nconst LOADED_OPACITY = 1;\n\nconst ANIMATION_DURATION = 200;\n\nexport default function ImageCore(props: ImageCoreProps) {\n const {\n cache,\n height,\n onError,\n onLoad,\n resizeMode,\n source,\n width,\n } = props;\n\n const opacity = useAnimatedValue(INITIAL_OPACITY);\n\n const acceptHeader = useContext(ImageFileExtensionContext);\n\n const handleLoad = useCallback(() => {\n Animated.timing(opacity, {\n toValue: LOADED_OPACITY,\n duration: ANIMATION_DURATION,\n useNativeDriver: isNotAndroid12,\n }).start();\n\n onLoad?.();\n }, [onLoad]);\n\n return (\n <AnimatedFastImage\n onError={onError}\n onLoad={handleLoad}\n resizeMode={resizeMode}\n source={{\n cache,\n uri: source.uri,\n headers: {\n 'Accept': acceptHeader,\n },\n }}\n style={[\n { opacity },\n { width: width as DimensionValue, height: height as DimensionValue },\n ]}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAEA;AACA,MAAMA,iBAAiB,GAAGC,qBAAA,CAASC,uBAAT,CAAiCC,6BAAjC,CAA1B;;AAEA,MAAMC,eAAe,GAAG,CAAxB;AACA,MAAMC,cAAc,GAAG,CAAvB;AAEA,MAAMC,kBAAkB,GAAG,GAA3B;;AAEe,SAASC,SAAT,CAAmBC,KAAnB,EAA0C;EACrD,MAAM;IACFC,KADE;IAEFC,MAFE;IAGFC,OAHE;IAIFC,MAJE;IAKFC,UALE;IAMFC,MANE;IAOFC;EAPE,IAQFP,KARJ;EAUA,MAAMQ,OAAO,GAAG,IAAAC,uBAAA,EAAiBb,eAAjB,CAAhB;EAEA,MAAMc,YAAY,GAAG,IAAAC,iBAAA,EAAWC,kCAAX,CAArB;EAEA,MAAMC,UAAU,GAAG,IAAAC,kBAAA,EAAY,MAAM;IACjCrB,qBAAA,CAASsB,MAAT,CAAgBP,OAAhB,EAAyB;MACrBQ,OAAO,EAAEnB,cADY;MAErBoB,QAAQ,EAAEnB,kBAFW;MAGrBoB,eAAe,EAAEC;IAHI,CAAzB,EAIGC,KAJH;;IAMAhB,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM;EACT,CARkB,EAQhB,CAACA,MAAD,CARgB,CAAnB;EAUA,oBACI,6BAAC,iBAAD;IACI,OAAO,EAAED,OADb;IAEI,MAAM,EAAEU,UAFZ;IAGI,UAAU,EAAER,UAHhB;IAII,MAAM,EAAE;MACJJ,KADI;MAEJoB,GAAG,EAAEf,MAAM,CAACe,GAFR;MAGJC,OAAO,EAAE;QACL,UAAUZ;MADL;IAHL,CAJZ;IAWI,KAAK,EAAE,CACH;MAAEF;IAAF,CADG,EAEH;MAAED,KAAK,EAAEA,KAAT;MAAkCL,MAAM,EAAEA;IAA1C,CAFG;EAXX,EADJ;AAkBH;;AAAA"}
|
|
@@ -11,6 +11,8 @@ var _reactNative = require("react-native");
|
|
|
11
11
|
|
|
12
12
|
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
13
13
|
|
|
14
|
+
var _Column = _interopRequireDefault(require("../Column"));
|
|
15
|
+
|
|
14
16
|
var _internal = require("../internal");
|
|
15
17
|
|
|
16
18
|
var _Row = _interopRequireDefault(require("../Row"));
|
|
@@ -21,6 +23,8 @@ var _utils = require("../utils");
|
|
|
21
23
|
|
|
22
24
|
var _RadioContextProvider = require("../RadioGroup/RadioContextProvider");
|
|
23
25
|
|
|
26
|
+
var _Typography = _interopRequireDefault(require("../Typography"));
|
|
27
|
+
|
|
24
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
29
|
|
|
26
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -60,6 +64,7 @@ function Radio(props) {
|
|
|
60
64
|
startIcon: startIconProp,
|
|
61
65
|
style,
|
|
62
66
|
value,
|
|
67
|
+
description,
|
|
63
68
|
...otherProps
|
|
64
69
|
} = props;
|
|
65
70
|
const theme = (0, _styles.useTheme)();
|
|
@@ -96,13 +101,21 @@ function Radio(props) {
|
|
|
96
101
|
disabled: disabled,
|
|
97
102
|
onPress: handlePress,
|
|
98
103
|
style: rootStyle
|
|
99
|
-
}, otherProps), /*#__PURE__*/_react.default.createElement(
|
|
104
|
+
}, otherProps), /*#__PURE__*/_react.default.createElement(_Column.default, {
|
|
105
|
+
gap: 2,
|
|
106
|
+
flexShrink: 1
|
|
107
|
+
}, /*#__PURE__*/_react.default.createElement(_Row.default, {
|
|
100
108
|
alignItems: 'center',
|
|
101
109
|
style: styles.content
|
|
102
110
|
}, startIcon, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
103
111
|
children: children,
|
|
104
112
|
style: fontStyle
|
|
105
|
-
})),
|
|
113
|
+
})), description ? /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
114
|
+
variant: 'body3',
|
|
115
|
+
color: 'base',
|
|
116
|
+
weight: 'regular',
|
|
117
|
+
children: description
|
|
118
|
+
}) : null), icon);
|
|
106
119
|
}
|
|
107
120
|
|
|
108
121
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_START_ICON_SIZE","useStyles","theme","useTheme","root","alignItems","borderBottomColor","palette","border","weak","borderBottomWidth","flexDirection","gap","justifyContent","paddingVertical","content","minHeight","Radio","props","checked","children","checkedIcon","checkIconProp","disabled","onChange","onChangeProp","startIcon","startIconProp","style","value","otherProps","styles","context","useContext","RadioContext","handlePress","isChecked","defaultCheckedIcon","icon","cloneElementSafely","color","height","width","rootStyle","css","fontStyle","createFontStyle","selector","typography","body1","regular","text","strong"],"sources":["Radio.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { Text } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport { Check as CheckedIcon } from '../internal';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport { RadioContext } from '../RadioGroup/RadioContextProvider';\nimport type RadioProps from './RadioProps';\n\nconst DEFAULT_START_ICON_SIZE = 21;\n\ntype RadioStyles = NamedStylesStringUnion<'root' | 'content'>;\n\nconst useStyles: UseStyles<RadioStyles> = function (): RadioStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'center',\n borderBottomColor: theme.palette.border.weak,\n borderBottomWidth: 0.5,\n flexDirection: 'row',\n gap: 32,\n justifyContent: 'space-between',\n paddingVertical: 14,\n },\n content: {\n gap: 8,\n minHeight: 20,\n },\n };\n};\n\nexport default function Radio(props: RadioProps) {\n const {\n checked = false,\n children,\n checkedIcon: checkIconProp,\n disabled = false,\n onChange: onChangeProp,\n startIcon: startIconProp,\n style,\n value,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const context = useContext(RadioContext);\n\n const handlePress = () => {\n const onChange = context?.onChange ?? onChangeProp;\n if (onChange) {\n onChange(value);\n }\n };\n\n const isChecked = context?.value === value ?? checked;\n\n const defaultCheckedIcon = (\n <CheckedIcon color={'accent'}/>\n );\n\n const checkedIcon = checkIconProp ?? defaultCheckedIcon;\n const icon = isChecked ? checkedIcon : null;\n\n const startIcon = cloneElementSafely(startIconProp, {\n color: 'strong',\n height: DEFAULT_START_ICON_SIZE,\n width: DEFAULT_START_ICON_SIZE,\n });\n\n const rootStyle = css([\n styles.root,\n style,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typography) => typography.body1.regular,\n color: theme.palette.text.strong,\n });\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={rootStyle}\n {...otherProps}\n >\n <Row\n
|
|
1
|
+
{"version":3,"names":["DEFAULT_START_ICON_SIZE","useStyles","theme","useTheme","root","alignItems","borderBottomColor","palette","border","weak","borderBottomWidth","flexDirection","gap","justifyContent","paddingVertical","content","minHeight","Radio","props","checked","children","checkedIcon","checkIconProp","disabled","onChange","onChangeProp","startIcon","startIconProp","style","value","description","otherProps","styles","context","useContext","RadioContext","handlePress","isChecked","defaultCheckedIcon","icon","cloneElementSafely","color","height","width","rootStyle","css","fontStyle","createFontStyle","selector","typography","body1","regular","text","strong"],"sources":["Radio.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { Text } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport Column from '../Column';\nimport { Check as CheckedIcon } from '../internal';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport { RadioContext } from '../RadioGroup/RadioContextProvider';\nimport type RadioProps from './RadioProps';\nimport Typography from '../Typography';\n\nconst DEFAULT_START_ICON_SIZE = 21;\n\ntype RadioStyles = NamedStylesStringUnion<'root' | 'content'>;\n\nconst useStyles: UseStyles<RadioStyles> = function (): RadioStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'center',\n borderBottomColor: theme.palette.border.weak,\n borderBottomWidth: 0.5,\n flexDirection: 'row',\n gap: 32,\n justifyContent: 'space-between',\n paddingVertical: 14,\n },\n content: {\n gap: 8,\n minHeight: 20,\n },\n };\n};\n\nexport default function Radio(props: RadioProps) {\n const {\n checked = false,\n children,\n checkedIcon: checkIconProp,\n disabled = false,\n onChange: onChangeProp,\n startIcon: startIconProp,\n style,\n value,\n description,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const context = useContext(RadioContext);\n\n const handlePress = () => {\n const onChange = context?.onChange ?? onChangeProp;\n if (onChange) {\n onChange(value);\n }\n };\n\n const isChecked = context?.value === value ?? checked;\n\n const defaultCheckedIcon = (\n <CheckedIcon color={'accent'}/>\n );\n\n const checkedIcon = checkIconProp ?? defaultCheckedIcon;\n const icon = isChecked ? checkedIcon : null;\n\n const startIcon = cloneElementSafely(startIconProp, {\n color: 'strong',\n height: DEFAULT_START_ICON_SIZE,\n width: DEFAULT_START_ICON_SIZE,\n });\n\n const rootStyle = css([\n styles.root,\n style,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typography) => typography.body1.regular,\n color: theme.palette.text.strong,\n });\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={rootStyle}\n {...otherProps}\n >\n <Column\n gap={2}\n flexShrink={1}\n >\n <Row\n alignItems={'center'}\n style={styles.content}\n >\n {startIcon}\n\n <Text\n children={children}\n style={fontStyle}\n />\n </Row>\n\n {description ? (\n <Typography\n variant={'body3'}\n color={'base'}\n weight={'regular'}\n children={description}\n />\n ) : null}\n </Column>\n\n {icon}\n </ButtonBase>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,MAAMA,uBAAuB,GAAG,EAAhC;;AAIA,MAAMC,SAAiC,GAAG,YAAyB;EAC/D,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,iBAAiB,EAAEJ,KAAK,CAACK,OAAN,CAAcC,MAAd,CAAqBC,IAFtC;MAGFC,iBAAiB,EAAE,GAHjB;MAIFC,aAAa,EAAE,KAJb;MAKFC,GAAG,EAAE,EALH;MAMFC,cAAc,EAAE,eANd;MAOFC,eAAe,EAAE;IAPf,CADH;IAUHC,OAAO,EAAE;MACLH,GAAG,EAAE,CADA;MAELI,SAAS,EAAE;IAFN;EAVN,CAAP;AAeH,CAlBD;;AAoBe,SAASC,KAAT,CAAeC,KAAf,EAAkC;EAC7C,MAAM;IACFC,OAAO,GAAG,KADR;IAEFC,QAFE;IAGFC,WAAW,EAAEC,aAHX;IAIFC,QAA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C,KAAK,CAACK,OAAN,CAAc6C,IAAd,CAAmBC;EAFW,CAAvB,CAAlB;EAKA,oBACI,6BAAC,mBAAD;IACI,QAAQ,EAAE9B,QADd;IAEI,OAAO,EAAEa,WAFb;IAGI,KAAK,EAAEQ;EAHX,GAIQb,UAJR,gBAMI,6BAAC,eAAD;IACI,GAAG,EAAE,CADT;IAEI,UAAU,EAAE;EAFhB,gBAII,6BAAC,YAAD;IACI,UAAU,EAAE,QADhB;IAEI,KAAK,EAAEC,MAAM,CAACjB;EAFlB,GAIKW,SAJL,eAMI,6BAAC,iBAAD;IACI,QAAQ,EAAEN,QADd;IAEI,KAAK,EAAE0B;EAFX,EANJ,CAJJ,EAgBKhB,WAAW,gBACR,6BAAC,mBAAD;IACI,OAAO,EAAE,OADb;IAEI,KAAK,EAAE,MAFX;IAGI,MAAM,EAAE,SAHZ;IAII,QAAQ,EAAEA;EAJd,EADQ,GAOR,IAvBR,CANJ,EAgCKS,IAhCL,CADJ;AAoCH;;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["RadioProps.ts"],"sourcesContent":["import React from 'react';\nimport type { OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\ntype BaseProps = Omit<ButtonBaseProps, 'onPress' | 'children'>;\n\nexport default interface RadioProps extends OverridableComponentProps<BaseProps, {\n /**\n * If `true`, the component is checked.\n * @default false\n */\n checked?: boolean;\n\n /**\n * Custom icon element to display when the radio is checked.\n */\n checkedIcon?: React.ReactNode;\n\n /**\n * Content which is sharing pressable next to radio.\n */\n children?: string;\n\n /**\n * If `true`, the radio is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback fired when the component is pressed.\n */\n onChange?: (newValue: string) => void;\n\n /**\n * Element placed before the children.\n */\n startIcon?: React.ReactElement;\n\n /**\n * Value of the component.\n */\n value: string;\n}> {}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["RadioProps.ts"],"sourcesContent":["import React from 'react';\nimport type { OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\ntype BaseProps = Omit<ButtonBaseProps, 'onPress' | 'children'>;\n\nexport default interface RadioProps extends OverridableComponentProps<BaseProps, {\n /**\n * If `true`, the component is checked.\n * @default false\n */\n checked?: boolean;\n\n /**\n * Custom icon element to display when the radio is checked.\n */\n checkedIcon?: React.ReactNode;\n\n /**\n * Content which is sharing pressable next to radio.\n */\n children?: string;\n\n /**\n * If `true`, the radio is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback fired when the component is pressed.\n */\n onChange?: (newValue: string) => void;\n\n /**\n * Element placed before the children.\n */\n startIcon?: React.ReactElement;\n\n /**\n * Value of the component.\n */\n value: string;\n\n\n /**\n * Helper text displayed below the children.\n */\n description?: string;\n}> {}\n"],"mappings":""}
|
|
@@ -48,24 +48,28 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function Slider(props, ref
|
|
|
48
48
|
const minimumTrackTintColor = theme.palette.primary.main;
|
|
49
49
|
const maximumTrackTintColor = theme.palette.tertiary.main;
|
|
50
50
|
const thumbTintColor = _reactNative.Platform.OS === 'android' ? theme.palette.primary.main : undefined;
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
51
|
+
return (
|
|
52
|
+
/*#__PURE__*/
|
|
53
|
+
// @ts-ignore - @react-native-community/slider has incorrect type definitions for JSX usage
|
|
54
|
+
_react.default.createElement(_slider.default, _extends({
|
|
55
|
+
disabled: disabled,
|
|
56
|
+
maximumValue: maximumValue,
|
|
57
|
+
maximumTrackTintColor: maximumTrackTintColor,
|
|
58
|
+
minimumValue: minimumValue,
|
|
59
|
+
minimumTrackTintColor: minimumTrackTintColor,
|
|
60
|
+
onSlidingComplete: onSlidingComplete,
|
|
61
|
+
onValueChange: onValueChange //@ts-ignore
|
|
62
|
+
,
|
|
63
|
+
ref: ref,
|
|
64
|
+
step: step,
|
|
65
|
+
thumbTintColor: thumbTintColor,
|
|
66
|
+
value: value,
|
|
67
|
+
style: [platformStyle, commonStyle, style],
|
|
68
|
+
thumbImage: require('./resources/knob.png'),
|
|
69
|
+
minimumTrackImage: require('./resources/min-track.png'),
|
|
70
|
+
maximumTrackImage: require('./resources/max-track.png')
|
|
71
|
+
}, otherProps))
|
|
72
|
+
);
|
|
69
73
|
});
|
|
70
74
|
|
|
71
75
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","Slider","props","ref","disabled","step","minimumValue","maximumValue","onSlidingComplete","onValueChange","value","style","otherProps","theme","useTheme","platformStyle","Platform","select","ios","marginLeft","spacing","marginRight","android","commonStyle","height","minimumTrackTintColor","palette","primary","main","maximumTrackTintColor","tertiary","thumbTintColor","OS","undefined","require"],"sources":["Slider.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform } from 'react-native';\nimport RNSlider from '@react-native-community/slider';\nimport { useTheme } from '../styles';\nimport type SliderProps from './SliderProps';\n\nexport default React.forwardRef<RNSlider, SliderProps>(function Slider(props, ref) {\n const {\n disabled = false,\n step = 0,\n minimumValue = 0,\n maximumValue = 1,\n onSlidingComplete,\n onValueChange,\n value = 0,\n style,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n const platformStyle = Platform.select({\n ios: {\n marginLeft: -theme.spacing(1),\n marginRight: -theme.spacing(1),\n },\n android: {\n marginLeft: -theme.spacing(4),\n marginRight: -theme.spacing(4),\n },\n });\n const commonStyle = {\n height: 18,\n };\n\n const minimumTrackTintColor = theme.palette.primary.main;\n const maximumTrackTintColor = theme.palette.tertiary.main;\n const thumbTintColor = Platform.OS === 'android' ? theme.palette.primary.main : undefined;\n\n return (\n <RNSlider\n disabled={disabled}\n maximumValue={maximumValue}\n maximumTrackTintColor={maximumTrackTintColor}\n minimumValue={minimumValue}\n minimumTrackTintColor={minimumTrackTintColor}\n onSlidingComplete={onSlidingComplete}\n onValueChange={onValueChange}\n //@ts-ignore\n ref={ref}\n step={step}\n thumbTintColor={thumbTintColor}\n value={value}\n style={[platformStyle, commonStyle, style]}\n thumbImage={require('./resources/knob.png')}\n minimumTrackImage={require('./resources/min-track.png')}\n maximumTrackImage={require('./resources/max-track.png')}\n {...otherProps}\n />\n );\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;4BAGeA,cAAA,CAAMC,UAAN,CAAwC,SAASC,MAAT,CAAgBC,KAAhB,EAAuBC,GAAvB,EAA4B;EAC/E,MAAM;IACFC,QAAQ,GAAG,KADT;IAEFC,IAAI,GAAG,CAFL;IAGFC,YAAY,GAAG,CAHb;IAIFC,YAAY,GAAG,CAJb;IAKFC,iBALE;IAMFC,aANE;IAOFC,KAAK,GAAG,CAPN;IAQFC,KARE;IASF,GAAGC;EATD,IAUFV,KAVJ;EAYA,MAAMW,KAAK,GAAG,IAAAC,gBAAA,GAAd;;EACA,MAAMC,aAAa,GAAGC,qBAAA,CAASC,MAAT,CAAgB;IAClCC,GAAG,EAAE;MACDC,UAAU,EAAE,CAACN,KAAK,CAACO,OAAN,CAAc,CAAd,CADZ;MAEDC,WAAW,EAAE,CAACR,KAAK,CAACO,OAAN,CAAc,CAAd;IAFb,CAD6B;IAKlCE,OAAO,EAAE;MACLH,UAAU,EAAE,CAACN,KAAK,CAACO,OAAN,CAAc,CAAd,CADR;MAELC,WAAW,EAAE,CAACR,KAAK,CAACO,OAAN,CAAc,CAAd;IAFT;EALyB,CAAhB,CAAtB;;EAUA,MAAMG,WAAW,GAAG;IAChBC,MAAM,EAAE;EADQ,CAApB;EAIA,MAAMC,qBAAqB,GAAGZ,KAAK,CAACa,OAAN,CAAcC,OAAd,CAAsBC,IAApD;EACA,MAAMC,qBAAqB,GAAGhB,KAAK,CAACa,OAAN,CAAcI,QAAd,CAAuBF,IAArD;EACA,MAAMG,cAAc,GAAGf,qBAAA,CAASgB,EAAT,KAAgB,SAAhB,GAA4BnB,KAAK,CAACa,OAAN,CAAcC,OAAd,CAAsBC,IAAlD,GAAyDK,SAAhF;EAEA,
|
|
1
|
+
{"version":3,"names":["React","forwardRef","Slider","props","ref","disabled","step","minimumValue","maximumValue","onSlidingComplete","onValueChange","value","style","otherProps","theme","useTheme","platformStyle","Platform","select","ios","marginLeft","spacing","marginRight","android","commonStyle","height","minimumTrackTintColor","palette","primary","main","maximumTrackTintColor","tertiary","thumbTintColor","OS","undefined","require"],"sources":["Slider.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform } from 'react-native';\nimport RNSlider from '@react-native-community/slider';\nimport { useTheme } from '../styles';\nimport type SliderProps from './SliderProps';\n\nexport default React.forwardRef<RNSlider, SliderProps>(function Slider(props, ref) {\n const {\n disabled = false,\n step = 0,\n minimumValue = 0,\n maximumValue = 1,\n onSlidingComplete,\n onValueChange,\n value = 0,\n style,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n const platformStyle = Platform.select({\n ios: {\n marginLeft: -theme.spacing(1),\n marginRight: -theme.spacing(1),\n },\n android: {\n marginLeft: -theme.spacing(4),\n marginRight: -theme.spacing(4),\n },\n });\n const commonStyle = {\n height: 18,\n };\n\n const minimumTrackTintColor = theme.palette.primary.main;\n const maximumTrackTintColor = theme.palette.tertiary.main;\n const thumbTintColor = Platform.OS === 'android' ? theme.palette.primary.main : undefined;\n\n return (\n // @ts-ignore - @react-native-community/slider has incorrect type definitions for JSX usage\n <RNSlider\n disabled={disabled}\n maximumValue={maximumValue}\n maximumTrackTintColor={maximumTrackTintColor}\n minimumValue={minimumValue}\n minimumTrackTintColor={minimumTrackTintColor}\n onSlidingComplete={onSlidingComplete}\n onValueChange={onValueChange}\n //@ts-ignore\n ref={ref}\n step={step}\n thumbTintColor={thumbTintColor}\n value={value}\n style={[platformStyle, commonStyle, style]}\n thumbImage={require('./resources/knob.png')}\n minimumTrackImage={require('./resources/min-track.png')}\n maximumTrackImage={require('./resources/max-track.png')}\n {...otherProps}\n />\n );\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;4BAGeA,cAAA,CAAMC,UAAN,CAAwC,SAASC,MAAT,CAAgBC,KAAhB,EAAuBC,GAAvB,EAA4B;EAC/E,MAAM;IACFC,QAAQ,GAAG,KADT;IAEFC,IAAI,GAAG,CAFL;IAGFC,YAAY,GAAG,CAHb;IAIFC,YAAY,GAAG,CAJb;IAKFC,iBALE;IAMFC,aANE;IAOFC,KAAK,GAAG,CAPN;IAQFC,KARE;IASF,GAAGC;EATD,IAUFV,KAVJ;EAYA,MAAMW,KAAK,GAAG,IAAAC,gBAAA,GAAd;;EACA,MAAMC,aAAa,GAAGC,qBAAA,CAASC,MAAT,CAAgB;IAClCC,GAAG,EAAE;MACDC,UAAU,EAAE,CAACN,KAAK,CAACO,OAAN,CAAc,CAAd,CADZ;MAEDC,WAAW,EAAE,CAACR,KAAK,CAACO,OAAN,CAAc,CAAd;IAFb,CAD6B;IAKlCE,OAAO,EAAE;MACLH,UAAU,EAAE,CAACN,KAAK,CAACO,OAAN,CAAc,CAAd,CADR;MAELC,WAAW,EAAE,CAACR,KAAK,CAACO,OAAN,CAAc,CAAd;IAFT;EALyB,CAAhB,CAAtB;;EAUA,MAAMG,WAAW,GAAG;IAChBC,MAAM,EAAE;EADQ,CAApB;EAIA,MAAMC,qBAAqB,GAAGZ,KAAK,CAACa,OAAN,CAAcC,OAAd,CAAsBC,IAApD;EACA,MAAMC,qBAAqB,GAAGhB,KAAK,CAACa,OAAN,CAAcI,QAAd,CAAuBF,IAArD;EACA,MAAMG,cAAc,GAAGf,qBAAA,CAASgB,EAAT,KAAgB,SAAhB,GAA4BnB,KAAK,CAACa,OAAN,CAAcC,OAAd,CAAsBC,IAAlD,GAAyDK,SAAhF;EAEA;IAAA;IACI;IACA,6BAAC,eAAD;MACI,QAAQ,EAAE7B,QADd;MAEI,YAAY,EAAEG,YAFlB;MAGI,qBAAqB,EAAEsB,qBAH3B;MAII,YAAY,EAAEvB,YAJlB;MAKI,qBAAqB,EAAEmB,qBAL3B;MAMI,iBAAiB,EAAEjB,iBANvB;MAOI,aAAa,EAAEC,aAPnB,CAQI;MARJ;MASI,GAAG,EAAEN,GATT;MAUI,IAAI,EAAEE,IAVV;MAWI,cAAc,EAAE0B,cAXpB;MAYI,KAAK,EAAErB,KAZX;MAaI,KAAK,EAAE,CAACK,aAAD,EAAgBQ,WAAhB,EAA6BZ,KAA7B,CAbX;MAcI,UAAU,EAAEuB,OAAO,CAAC,sBAAD,CAdvB;MAeI,iBAAiB,EAAEA,OAAO,CAAC,2BAAD,CAf9B;MAgBI,iBAAiB,EAAEA,OAAO,CAAC,2BAAD;IAhB9B,GAiBQtB,UAjBR;EAFJ;AAsBH,CAtDc,C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNativeSvg = require("react-native-svg");
|
|
11
|
+
|
|
12
|
+
var _utils = require("../../utils");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
var _default = (0, _utils.createSvgIcon)( /*#__PURE__*/_react.default.createElement(_reactNativeSvg.Path, {
|
|
17
|
+
fillRule: "evenodd",
|
|
18
|
+
clipRule: "evenodd",
|
|
19
|
+
d: "M11 1C4.92487 1 0 5.92487 0 12C0 18.0751 4.92487 23 11 23C17.0751 23 22 18.0751 22 12C22 5.92487 17.0751 1 11 1ZM8.70711 8.29289C8.31658 7.90237 7.68342 7.90237 7.29289 8.29289C6.90237 8.68342 6.90237 9.31658 7.29289 9.70711L9.58579 12L7.29289 14.2929C6.90237 14.6834 6.90237 15.3166 7.29289 15.7071C7.68342 16.0976 8.31658 16.0976 8.70711 15.7071L11 13.4142L13.2929 15.7071C13.6834 16.0976 14.3166 16.0976 14.7071 15.7071C15.0976 15.3166 15.0976 14.6834 14.7071 14.2929L12.4142 12L14.7071 9.70711C15.0976 9.31658 15.0976 8.68342 14.7071 8.29289C14.3166 7.90237 13.6834 7.90237 13.2929 8.29289L11 10.5858L8.70711 8.29289Z"
|
|
20
|
+
}), 'CloseCircleFillPierced', '0 0 22 24');
|
|
21
|
+
|
|
22
|
+
exports.default = _default;
|
|
23
|
+
//# sourceMappingURL=CloseCircleFillPierced.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSvgIcon"],"sources":["CloseCircleFillPierced.tsx"],"sourcesContent":["import React from 'react';\nimport { Path } from 'react-native-svg';\nimport { createSvgIcon } from '../../utils';\n\nexport default createSvgIcon(\n <Path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11 1C4.92487 1 0 5.92487 0 12C0 18.0751 4.92487 23 11 23C17.0751 23 22 18.0751 22 12C22 5.92487 17.0751 1 11 1ZM8.70711 8.29289C8.31658 7.90237 7.68342 7.90237 7.29289 8.29289C6.90237 8.68342 6.90237 9.31658 7.29289 9.70711L9.58579 12L7.29289 14.2929C6.90237 14.6834 6.90237 15.3166 7.29289 15.7071C7.68342 16.0976 8.31658 16.0976 8.70711 15.7071L11 13.4142L13.2929 15.7071C13.6834 16.0976 14.3166 16.0976 14.7071 15.7071C15.0976 15.3166 15.0976 14.6834 14.7071 14.2929L12.4142 12L14.7071 9.70711C15.0976 9.31658 15.0976 8.68342 14.7071 8.29289C14.3166 7.90237 13.6834 7.90237 13.2929 8.29289L11 10.5858L8.70711 8.29289Z\"\n />,\n 'CloseCircleFillPierced',\n '0 0 22 24',\n);\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;eAEe,IAAAA,oBAAA,gBACX,6BAAC,oBAAD;EACI,QAAQ,EAAC,SADb;EAEI,QAAQ,EAAC,SAFb;EAGI,CAAC,EAAC;AAHN,EADW,EAMX,wBANW,EAOX,WAPW,C"}
|
|
@@ -81,6 +81,12 @@ Object.defineProperty(exports, "Close", {
|
|
|
81
81
|
return _Close.default;
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
+
Object.defineProperty(exports, "CloseCircleFillPierced", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _CloseCircleFillPierced.default;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
84
90
|
Object.defineProperty(exports, "EyeOff", {
|
|
85
91
|
enumerable: true,
|
|
86
92
|
get: function () {
|
|
@@ -150,6 +156,8 @@ var _Clear = _interopRequireDefault(require("./Clear"));
|
|
|
150
156
|
|
|
151
157
|
var _Close = _interopRequireDefault(require("./Close"));
|
|
152
158
|
|
|
159
|
+
var _CloseCircleFillPierced = _interopRequireDefault(require("./CloseCircleFillPierced"));
|
|
160
|
+
|
|
153
161
|
var _EyeOff = _interopRequireDefault(require("./EyeOff"));
|
|
154
162
|
|
|
155
163
|
var _EyeOn = _interopRequireDefault(require("./EyeOn"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default as AppBarChevronLeft } from './AppBarChevronLeft';\nexport { default as Check } from './Check';\nexport { default as Checkbox } from './Checkbox';\nexport { default as CheckboxChecked } from './CheckboxChecked';\nexport { default as CheckboxOn } from './CheckboxOn';\nexport { default as CheckCircle } from './CheckCircle';\nexport { default as ChevronDown } from './ChevronDown';\nexport { default as ChevronLeft } from './ChevronLeft';\nexport { default as ChevronRight } from './ChevronRight';\nexport { default as ChipClose } from './ChipClose';\nexport { default as CircularProgress } from './CircularProgress';\nexport { default as Clear } from './Clear';\nexport { default as Close } from './Close';\nexport { default as EyeOff } from './EyeOff';\nexport { default as EyeOn } from './EyeOn';\nexport { default as InfoCircle } from './InfoCircle';\nexport { default as LoadingSpinner } from './LoadingSpinner';\nexport { default as Radio } from './Radio';\nexport { default as RadioChecked } from './RadioChecked';\nexport { default as Search } from './Search';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default as AppBarChevronLeft } from './AppBarChevronLeft';\nexport { default as Check } from './Check';\nexport { default as Checkbox } from './Checkbox';\nexport { default as CheckboxChecked } from './CheckboxChecked';\nexport { default as CheckboxOn } from './CheckboxOn';\nexport { default as CheckCircle } from './CheckCircle';\nexport { default as ChevronDown } from './ChevronDown';\nexport { default as ChevronLeft } from './ChevronLeft';\nexport { default as ChevronRight } from './ChevronRight';\nexport { default as ChipClose } from './ChipClose';\nexport { default as CircularProgress } from './CircularProgress';\nexport { default as Clear } from './Clear';\nexport { default as Close } from './Close';\nexport { default as CloseCircleFillPierced } from './CloseCircleFillPierced';\nexport { default as EyeOff } from './EyeOff';\nexport { default as EyeOn } from './EyeOn';\nexport { default as InfoCircle } from './InfoCircle';\nexport { default as LoadingSpinner } from './LoadingSpinner';\nexport { default as Radio } from './Radio';\nexport { default as RadioChecked } from './RadioChecked';\nexport { default as Search } from './Search';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","css","defaultRatio","defaultWidth","warnRatioNotPositive","useStyles","root","overflow","AspectRatio","props","children","ratio","style","width","otherProps","styles","containerStyle","aspectRatio"],"sources":["AspectRatioNative.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { css } from '../styles';\nimport type AspectRatioProps from './AspectRatioProps';\nimport { defaultRatio, defaultWidth, warnRatioNotPositive } from './utils';\n\ntype AspectRatioStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: UseStyles<AspectRatioStyles> = function (): AspectRatioStyles {\n return {\n root: {\n overflow: 'hidden',\n },\n };\n};\n\nexport default function AspectRatio(props: AspectRatioProps) {\n const {\n children,\n ratio = defaultRatio,\n style,\n width = defaultWidth,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n if (ratio <= 0) {\n warnRatioNotPositive(ratio);\n return null;\n }\n\n const containerStyle = css([\n { aspectRatio: ratio, width },\n styles.root,\n style,\n ]);\n\n return (\n <View\n style={containerStyle}\n {...otherProps}\n >\n {children}\n </View>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,
|
|
1
|
+
{"version":3,"names":["React","View","css","defaultRatio","defaultWidth","warnRatioNotPositive","useStyles","root","overflow","AspectRatio","props","children","ratio","style","width","otherProps","styles","containerStyle","aspectRatio"],"sources":["AspectRatioNative.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { css } from '../styles';\nimport type AspectRatioProps from './AspectRatioProps';\nimport { defaultRatio, defaultWidth, warnRatioNotPositive } from './utils';\n\ntype AspectRatioStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: UseStyles<AspectRatioStyles> = function (): AspectRatioStyles {\n return {\n root: {\n overflow: 'hidden',\n },\n };\n};\n\nexport default function AspectRatio(props: AspectRatioProps) {\n const {\n children,\n ratio = defaultRatio,\n style,\n width = defaultWidth,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n if (ratio <= 0) {\n warnRatioNotPositive(ratio);\n return null;\n }\n\n const containerStyle = css([\n { aspectRatio: ratio, width: width as DimensionValue},\n styles.root,\n style,\n ]);\n\n return (\n <View\n style={containerStyle}\n {...otherProps}\n >\n {children}\n </View>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAyBC,IAAzB,QAAqC,cAArC;AAEA,SAASC,GAAT,QAAoB,WAApB;AAEA,SAASC,YAAT,EAAuBC,YAAvB,EAAqCC,oBAArC,QAAiE,SAAjE;;AAIA,MAAMC,SAAuC,GAAG,YAA+B;EAC3E,OAAO;IACHC,IAAI,EAAE;MACFC,QAAQ,EAAE;IADR;EADH,CAAP;AAKH,CAND;;AAQA,eAAe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,QADE;IAEFC,KAAK,GAAGT,YAFN;IAGFU,KAHE;IAIFC,KAAK,GAAGV,YAJN;IAKF,GAAGW;EALD,IAMFL,KANJ;EAQA,MAAMM,MAAM,GAAGV,SAAS,EAAxB;;EAEA,IAAIM,KAAK,IAAI,CAAb,EAAgB;IACZP,oBAAoB,CAACO,KAAD,CAApB;IACA,OAAO,IAAP;EACH;;EAED,MAAMK,cAAc,GAAGf,GAAG,CAAC,CACvB;IAAEgB,WAAW,EAAEN,KAAf;IAAsBE,KAAK,EAAEA;EAA7B,CADuB,EAEvBE,MAAM,CAACT,IAFgB,EAGvBM,KAHuB,CAAD,CAA1B;EAMA,oBACI,oBAAC,IAAD;IACI,KAAK,EAAEI;EADX,GAEQF,UAFR,GAIKJ,QAJL,CADJ;AAQH;AAAA"}
|