@fountain-ui/core 3.0.0-alpha.44 → 3.0.0-alpha.46
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/BottomSheetTitle/BottomSheetTitle.js +1 -1
- package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
- package/build/commonjs/BottomSheetTitle/BottomSheetTitleProps.js.map +1 -1
- package/build/commonjs/Image/Image.js +5 -0
- package/build/commonjs/Image/Image.js.map +1 -1
- package/build/commonjs/Image/ImageProps.js.map +1 -1
- package/build/commonjs/Image/preload.js +10 -0
- package/build/commonjs/Image/preload.js.map +1 -0
- package/build/commonjs/Image/preload.native.js +22 -0
- package/build/commonjs/Image/preload.native.js.map +1 -0
- package/build/commonjs/ImageCore/ImageCoreNative.js +10 -7
- package/build/commonjs/ImageCore/ImageCoreNative.js.map +1 -1
- package/build/commonjs/ImageCore/ImageCoreProps.js.map +1 -1
- package/build/commonjs/TextField/TextField.js +33 -3
- package/build/commonjs/TextField/TextField.js.map +1 -1
- package/build/commonjs/Tooltip/Tooltip.js +5 -1
- package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
- package/build/module/BottomSheetTitle/BottomSheetTitle.js +1 -1
- package/build/module/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
- package/build/module/BottomSheetTitle/BottomSheetTitleProps.js.map +1 -1
- package/build/module/Image/Image.js +4 -0
- package/build/module/Image/Image.js.map +1 -1
- package/build/module/Image/ImageProps.js.map +1 -1
- package/build/module/Image/preload.js +3 -0
- package/build/module/Image/preload.js.map +1 -0
- package/build/module/Image/preload.native.js +12 -0
- package/build/module/Image/preload.native.js.map +1 -0
- package/build/module/ImageCore/ImageCoreNative.js +11 -7
- package/build/module/ImageCore/ImageCoreNative.js.map +1 -1
- package/build/module/ImageCore/ImageCoreProps.js.map +1 -1
- package/build/module/TextField/TextField.js +33 -4
- package/build/module/TextField/TextField.js.map +1 -1
- package/build/module/Tooltip/Tooltip.js +6 -2
- package/build/module/Tooltip/Tooltip.js.map +1 -1
- package/build/typescript/BottomSheetTitle/BottomSheetTitleProps.d.ts +3 -4
- package/build/typescript/Image/Image.d.ts +1 -0
- package/build/typescript/Image/ImageProps.d.ts +6 -0
- package/build/typescript/Image/preload.d.ts +2 -0
- package/build/typescript/Image/preload.native.d.ts +2 -0
- package/build/typescript/ImageCore/ImageCoreProps.d.ts +1 -0
- package/package.json +2 -2
- package/src/BottomSheetTitle/BottomSheetTitle.tsx +1 -1
- package/src/BottomSheetTitle/BottomSheetTitleProps.ts +3 -4
- package/src/Image/Image.tsx +4 -0
- package/src/Image/ImageProps.ts +7 -0
- package/src/Image/preload.native.ts +6 -0
- package/src/Image/preload.ts +5 -0
- package/src/ImageCore/ImageCoreNative.tsx +10 -7
- package/src/ImageCore/ImageCoreProps.ts +1 -0
- package/src/TextField/TextField.tsx +33 -3
- package/src/Tooltip/Tooltip.tsx +6 -1
|
@@ -65,7 +65,7 @@ function BottomSheetTitle(props) {
|
|
|
65
65
|
style: titleStyle
|
|
66
66
|
}), actionButtonProps ? /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
67
67
|
children: actionButtonProps.title,
|
|
68
|
-
color: 'accent',
|
|
68
|
+
color: actionButtonProps.color ?? 'accent',
|
|
69
69
|
disabled: actionButtonProps.disabled ?? false,
|
|
70
70
|
disableMinWidth: true,
|
|
71
71
|
onPress: actionButtonProps.onPress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","theme","useTheme","root","alignItems","gap","spacing","justifyContent","marginBottom","paddingHorizontal","title","flexShrink","paddingBottom","paddingTop","minWidth","actionButton","BottomSheetTitle","props","actionButtonProps","children","style","styleProp","otherProps","styles","rootStyle","css","titleFontStyle","createFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle","disabled","onPress"],"sources":["BottomSheetTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport Button from '../Button/Button';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type BottomSheetTitleProps from './BottomSheetTitleProps';\n\ntype BottomSheetTitleStyles = NamedStylesStringUnion<'root' | 'title' | 'actionButton'>;\n\nconst useStyles: UseStyles<BottomSheetTitleStyles> = function (): BottomSheetTitleStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'flex-start',\n gap: theme.spacing(8),\n justifyContent: 'space-between',\n marginBottom: theme.spacing(4),\n paddingHorizontal: theme.spacing(6),\n },\n title: {\n flexShrink: 1,\n paddingBottom: theme.spacing(1.25),\n paddingTop: theme.spacing(1),\n minWidth: 0,\n },\n actionButton: {\n paddingBottom: theme.spacing(1.75),\n paddingHorizontal: 0,\n paddingTop: theme.spacing(1.25),\n },\n };\n};\n\nexport default function BottomSheetTitle(props: BottomSheetTitleProps) {\n const {\n actionButtonProps,\n children,\n style: styleProp,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.header3.semiBold,\n color: theme.palette.text.strong,\n });\n\n const titleStyle = css([\n styles.title,\n titleFontStyle,\n ]);\n\n return (\n <Row\n style={rootStyle}\n {...otherProps}\n >\n <Text\n children={children}\n style={titleStyle}\n />\n\n {actionButtonProps ? (\n <Button\n children={actionButtonProps.title}\n color={'accent'}\n disabled={actionButtonProps.disabled ?? false}\n disableMinWidth={true}\n onPress={actionButtonProps.onPress}\n size={'large'}\n style={styles.actionButton}\n variant={'text'}\n />\n ) : null}\n </Row>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAKA,MAAMA,SAA4C,GAAG,YAAoC;EACrF,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAE,Y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;EAKA,oBACI,6BAAC,YAAD;IACI,KAAK,EAAEF;EADX,GAEQF,UAFR,gBAII,6BAAC,iBAAD;IACI,QAAQ,EAAEH,QADd;IAEI,KAAK,EAAEiB;EAFX,EAJJ,EASKlB,iBAAiB,gBACd,6BAAC,eAAD;IACI,QAAQ,EAAEA,iBAAiB,CAACR,KADhC;IAEI,KAAK,
|
|
1
|
+
{"version":3,"names":["useStyles","theme","useTheme","root","alignItems","gap","spacing","justifyContent","marginBottom","paddingHorizontal","title","flexShrink","paddingBottom","paddingTop","minWidth","actionButton","BottomSheetTitle","props","actionButtonProps","children","style","styleProp","otherProps","styles","rootStyle","css","titleFontStyle","createFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle","disabled","onPress"],"sources":["BottomSheetTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport Button from '../Button/Button';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type BottomSheetTitleProps from './BottomSheetTitleProps';\n\ntype BottomSheetTitleStyles = NamedStylesStringUnion<'root' | 'title' | 'actionButton'>;\n\nconst useStyles: UseStyles<BottomSheetTitleStyles> = function (): BottomSheetTitleStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'flex-start',\n gap: theme.spacing(8),\n justifyContent: 'space-between',\n marginBottom: theme.spacing(4),\n paddingHorizontal: theme.spacing(6),\n },\n title: {\n flexShrink: 1,\n paddingBottom: theme.spacing(1.25),\n paddingTop: theme.spacing(1),\n minWidth: 0,\n },\n actionButton: {\n paddingBottom: theme.spacing(1.75),\n paddingHorizontal: 0,\n paddingTop: theme.spacing(1.25),\n },\n };\n};\n\nexport default function BottomSheetTitle(props: BottomSheetTitleProps) {\n const {\n actionButtonProps,\n children,\n style: styleProp,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.header3.semiBold,\n color: theme.palette.text.strong,\n });\n\n const titleStyle = css([\n styles.title,\n titleFontStyle,\n ]);\n\n return (\n <Row\n style={rootStyle}\n {...otherProps}\n >\n <Text\n children={children}\n style={titleStyle}\n />\n\n {actionButtonProps ? (\n <Button\n children={actionButtonProps.title}\n color={actionButtonProps.color ?? 'accent'}\n disabled={actionButtonProps.disabled ?? false}\n disableMinWidth={true}\n onPress={actionButtonProps.onPress}\n size={'large'}\n style={styles.actionButton}\n variant={'text'}\n />\n ) : null}\n </Row>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAKA,MAAMA,SAA4C,GAAG,YAAoC;EACrF,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAE,YADV;MAEFC,GAAG,EAAEJ,KAAK,CAACK,OAAN,CAAc,CAAd,CAFH;MAGFC,cAAc,EAAE,eAHd;MAIFC,YAAY,EAAEP,KAAK,CAACK,OAAN,CAAc,CAAd,CAJZ;MAKFG,iBAAiB,EAAER,KAAK,CAACK,OAAN,CAAc,CAAd;IALjB,CADH;IAQHI,KAAK,EAAE;MACHC,UAAU,EAAE,CADT;MAEHC,aAAa,EAAEX,KAAK,CAACK,OAAN,CAAc,IAAd,CAFZ;MAGHO,UAAU,EAAEZ,KAAK,CAACK,OAAN,CAAc,CAAd,CAHT;MAIHQ,QAAQ,EAAE;IAJP,CARJ;IAcHC,YAAY,EAAE;MACVH,aAAa,EAAEX,KAAK,CAACK,OAAN,CAAc,IAAd,CADL;MAEVG,iBAAiB,EAAE,CAFT;MAGVI,UAAU,EAAEZ,KAAK,CAACK,OAAN,CAAc,IAAd;IAHF;EAdX,CAAP;AAoBH,CAvBD;;AAyBe,SAASU,gBAAT,CAA0BC,KAA1B,EAAwD;EACnE,MAAM;IACFC,iBADE;IAEFC,QAFE;IAGFC,KAAK,EAAEC,SAHL;IAIF,GAAGC;EAJD,IAKFL,KALJ;EAOA,MAAMhB,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAMqB,MAAM,GAAGvB,SAAS,EAAxB;EAEA,MAAMwB,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBF,MAAM,CAACpB,IADW,EAElBkB,SAFkB,CAAJ,CAAlB;EAKA,MAAMK,cAAc,GAAG,IAAAC,uBAAA,EAAgB1B,KAAhB,EAAuB;IAC1C2B,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,OAAX,CAAmBC,QADH;IAE1CC,KAAK,EAAE/B,KAAK,CAACgC,OAAN,CAAcC,IAAd,CAAmBC;EAFgB,CAAvB,CAAvB;EAKA,MAAMC,UAAU,GAAG,IAAAX,WAAA,EAAI,CACnBF,MAAM,CAACb,KADY,EAEnBgB,cAFmB,CAAJ,CAAnB;EAKA,oBACI,6BAAC,YAAD;IACI,KAAK,EAAEF;EADX,GAEQF,UAFR,gBAII,6BAAC,iBAAD;IACI,QAAQ,EAAEH,QADd;IAEI,KAAK,EAAEiB;EAFX,EAJJ,EASKlB,iBAAiB,gBACd,6BAAC,eAAD;IACI,QAAQ,EAAEA,iBAAiB,CAACR,KADhC;IAEI,KAAK,EAAEQ,iBAAiB,CAACc,KAAlB,IAA2B,QAFtC;IAGI,QAAQ,EAAEd,iBAAiB,CAACmB,QAAlB,IAA8B,KAH5C;IAII,eAAe,EAAE,IAJrB;IAKI,OAAO,EAAEnB,iBAAiB,CAACoB,OAL/B;IAMI,IAAI,EAAE,OANV;IAOI,KAAK,EAAEf,MAAM,CAACR,YAPlB;IAQI,OAAO,EAAE;EARb,EADc,GAWd,IApBR,CADJ;AAwBH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["BottomSheetTitleProps.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":[],"sources":["BottomSheetTitleProps.ts"],"sourcesContent":["import type { ButtonProps } from '../Button';\nimport type { RowProps } from '../Row';\nimport type { OverridableComponentProps } from '../types';\n\ntype ActionButtonProps = Pick<ButtonProps, 'color' | 'disabled' | 'onPress'> & {\n title: string;\n};\n\nexport default interface BottomSheetTitleProps extends OverridableComponentProps<RowProps, {\n children: string;\n actionButtonProps?: ActionButtonProps;\n}> {}\n"],"mappings":""}
|
|
@@ -15,6 +15,8 @@ var _styles = require("../styles");
|
|
|
15
15
|
|
|
16
16
|
var _OverlayCloseButton = _interopRequireDefault(require("./OverlayCloseButton"));
|
|
17
17
|
|
|
18
|
+
var _preload = _interopRequireDefault(require("./preload"));
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
22
|
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); }
|
|
@@ -69,6 +71,7 @@ function Image(props) {
|
|
|
69
71
|
alt,
|
|
70
72
|
cache = 'immutable',
|
|
71
73
|
disableDrag,
|
|
74
|
+
disableFadeIn,
|
|
72
75
|
disableLongClick,
|
|
73
76
|
disableOutline,
|
|
74
77
|
disablePlaceholder,
|
|
@@ -113,6 +116,7 @@ function Image(props) {
|
|
|
113
116
|
alt: alt,
|
|
114
117
|
cache: cache,
|
|
115
118
|
disableDrag: disableDrag,
|
|
119
|
+
disableFadeIn: disableFadeIn,
|
|
116
120
|
disableLongClick: disableLongClick,
|
|
117
121
|
height: '100%',
|
|
118
122
|
loading: loading,
|
|
@@ -127,6 +131,7 @@ function Image(props) {
|
|
|
127
131
|
}
|
|
128
132
|
|
|
129
133
|
Image.OverlayCloseButton = _OverlayCloseButton.default;
|
|
134
|
+
Image.preload = _preload.default;
|
|
130
135
|
var _default = Image;
|
|
131
136
|
exports.default = _default;
|
|
132
137
|
//# 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","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,MAAd,CAAqBC;IAH5B,CATP;IAcHC,KAAK,EAAE;MACHC,UAAU,EAAE,QADT;MAEHC,MAAM,EAAE,MAFL;MAGHC,cAAc,EAAE,QAHb;MAIHC,KAAK,EAAE;IAJJ,CAdJ;IAoBHC,SAAS,EAAE;MACPC,KAAK,EAAEzB,KAAK,CAACU,OAAN,CAAcgB,IAAd,CAAmBC,OADnB;MAEPC,UAAU,EAAE,cAFL;MAGPC,QAAQ,EAAE,EAHH;MAIPC,aAAa,EAAE,CAJR;MAKPC,UAAU,EAAE,EALL;MAMPC,SAAS,EAAE;IANJ;EApBR,CAAP;AA6BH,CAhCD;;AAkCA,SAASC,wBAAT,CAAkCC,KAAlC,EAAsE;EAClE,IAAIA,KAAK,CAACC,kBAAV,EAA8B;IAC1B,OAAO,MAAP;EACH;;EAED,OAAOD,KAAK,CAAC1B,WAAN,GAAoB,QAApB,GAA+B,SAAtC;AACH;;AAED,SAAS4B,KAAT,CAAeF,KAAf,EAAkC;EAC9B,MAAM;IACFG,GADE;IAEFC,KAAK,GAAG,WAFN;IAGFC,WAHE;IAIFC,
|
|
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","disableFadeIn","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","preload"],"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';\nimport preload from './preload';\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 disableFadeIn,\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 disableFadeIn={disableFadeIn}\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;\nImage.preload = preload;\n\nexport default Image;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;AACA;;AAEA;;AACA;;;;;;;;;;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,E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JnB;IAKI,gBAAgB,EAAEC,gBALtB;IAMI,MAAM,EAAE,MANZ;IAOI,OAAO,EAAEE,OAPb;IAQI,OAAO,EAAEC,OARb;IASI,MAAM,EAAEE,MATZ;IAUI,UAAU,EAAEG,UAVhB;IAWI,MAAM,EAAEC,MAXZ;IAYI,KAAK,EAAE;EAZX,EADA,GAeA,IA7CR,EA+CKF,gBAAgB,gBACb,6BAAC,iBAAD;IAAM,KAAK,EAAEa,kBAAA,CAAWC;EAAxB,GACKd,gBADL,CADa,GAIb,IAnDR,CADJ;AAuDH;;AAEDZ,KAAK,CAAC6B,kBAAN,GAA2BA,2BAA3B;AACA7B,KAAK,CAAC8B,OAAN,GAAgBA,gBAAhB;eAEe9B,K"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["ImageProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\nimport type { ImageSource, Loading, ResizeMode, CacheControl } from '../ImageCore';\n\n/**\n * Image file quality.\n * Request image by query string.\n */\nexport type ImageQuality = 'small' | 'medium' | 'large';\n\nexport default interface ImageProps extends OverridableComponentProps<ViewProps, {\n /**\n * Indicating the alternate fallback content to be displayed\n * if the image has not been loaded.\n */\n alt?: string;\n\n /**\n * Disable drag event for web.\n * @default false\n */\n disableDrag?: boolean,\n\n /**\n * Disable Long click event for web.\n * @default false\n */\n disableLongClick?: boolean,\n\n /**\n * If `true`, the image outline is not rendered.\n * @default false\n */\n disableOutline?: boolean;\n\n /**\n * If `true`, the placeholder is not rendered.\n * @default false\n */\n disablePlaceholder?: boolean;\n\n /**\n * Custom error element. Default is simple alt text.\n */\n error?: React.ReactElement | null;\n\n /**\n * Web only. Loading the document by determining whether to load\n * the image immediately (`eager`) or on an as-needed basis (`lazy`).\n * On React Native, it always works as `lazy`.\n * @default 'lazy'\n */\n loading?: Loading;\n\n /**\n * error event handler\n */\n onError?: () => void;\n\n /**\n * image loaded event handler\n */\n onLoad?: () => void;\n\n /**\n * The children on top this image.\n */\n overlaidChildren?: React.ReactElement;\n\n /**\n * Custom placeholder element.\n */\n placeholder?: React.ReactElement;\n\n /**\n * Determines how to resize the image when the frame doesn't match the raw image dimensions.\n * @default 'cover'\n */\n resizeMode?: ResizeMode;\n\n /**\n * The image source.\n */\n source: ImageSource;\n\n /**\n * If `true`, rounded corners are disabled.\n * @default false\n */\n square?: boolean;\n\n /***\n * FastImage cache control value.\n * @default 'immutable'\n */\n cache?: CacheControl;\n}> {}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["ImageProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\nimport type { ImageSource, Loading, ResizeMode, CacheControl } from '../ImageCore';\n\n/**\n * Image file quality.\n * Request image by query string.\n */\nexport type ImageQuality = 'small' | 'medium' | 'large';\n\nexport default interface ImageProps extends OverridableComponentProps<ViewProps, {\n /**\n * Indicating the alternate fallback content to be displayed\n * if the image has not been loaded.\n */\n alt?: string;\n\n /**\n * Disable drag event for web.\n * @default false\n */\n disableDrag?: boolean,\n\n /**\n * Disable Long click event for web.\n * @default false\n */\n disableLongClick?: boolean,\n\n /**\n * If true, disables the fade-in opacity animation on image load.\n * Only affects native platforms.\n * @default false\n */\n disableFadeIn?: boolean;\n\n /**\n * If `true`, the image outline is not rendered.\n * @default false\n */\n disableOutline?: boolean;\n\n /**\n * If `true`, the placeholder is not rendered.\n * @default false\n */\n disablePlaceholder?: boolean;\n\n /**\n * Custom error element. Default is simple alt text.\n */\n error?: React.ReactElement | null;\n\n /**\n * Web only. Loading the document by determining whether to load\n * the image immediately (`eager`) or on an as-needed basis (`lazy`).\n * On React Native, it always works as `lazy`.\n * @default 'lazy'\n */\n loading?: Loading;\n\n /**\n * error event handler\n */\n onError?: () => void;\n\n /**\n * image loaded event handler\n */\n onLoad?: () => void;\n\n /**\n * The children on top this image.\n */\n overlaidChildren?: React.ReactElement;\n\n /**\n * Custom placeholder element.\n */\n placeholder?: React.ReactElement;\n\n /**\n * Determines how to resize the image when the frame doesn't match the raw image dimensions.\n * @default 'cover'\n */\n resizeMode?: ResizeMode;\n\n /**\n * The image source.\n */\n source: ImageSource;\n\n /**\n * If `true`, rounded corners are disabled.\n * @default false\n */\n square?: boolean;\n\n /***\n * FastImage cache control value.\n * @default 'immutable'\n */\n cache?: CacheControl;\n}> {}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["preload","_sources"],"sources":["preload.ts"],"sourcesContent":["import type { ImageSource } from '../ImageCore';\n\nexport default function preload(_sources: ImageSource[]) {\n // No-op on web\n}\n"],"mappings":";;;;;;;AAEe,SAASA,OAAT,CAAiBC,QAAjB,EAA0C,CACrD;AACH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = preload;
|
|
7
|
+
|
|
8
|
+
var _reactNativeFastImage = _interopRequireDefault(require("@d11/react-native-fast-image"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
function preload(sources) {
|
|
13
|
+
_reactNativeFastImage.default.preload(sources.map(_ref => {
|
|
14
|
+
let {
|
|
15
|
+
uri
|
|
16
|
+
} = _ref;
|
|
17
|
+
return {
|
|
18
|
+
uri
|
|
19
|
+
};
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=preload.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["preload","sources","FastImage","map","uri"],"sources":["preload.native.ts"],"sourcesContent":["import FastImage from '@d11/react-native-fast-image';\nimport type { ImageSource } from '../ImageCore';\n\nexport default function preload(sources: ImageSource[]) {\n FastImage.preload(sources.map(({ uri }) => ({ uri })));\n}\n"],"mappings":";;;;;;;AAAA;;;;AAGe,SAASA,OAAT,CAAiBC,OAAjB,EAAyC;EACpDC,6BAAA,CAAUF,OAAV,CAAkBC,OAAO,CAACE,GAAR,CAAY;IAAA,IAAC;MAAEC;IAAF,CAAD;IAAA,OAAc;MAAEA;IAAF,CAAd;EAAA,CAAZ,CAAlB;AACH"}
|
|
@@ -33,6 +33,7 @@ const ANIMATION_DURATION = 200;
|
|
|
33
33
|
function ImageCore(props) {
|
|
34
34
|
const {
|
|
35
35
|
cache,
|
|
36
|
+
disableFadeIn,
|
|
36
37
|
height,
|
|
37
38
|
onError,
|
|
38
39
|
onLoad,
|
|
@@ -40,17 +41,19 @@ function ImageCore(props) {
|
|
|
40
41
|
source,
|
|
41
42
|
width
|
|
42
43
|
} = props;
|
|
43
|
-
const opacity = (0, _hooks.useAnimatedValue)(INITIAL_OPACITY);
|
|
44
|
+
const opacity = (0, _hooks.useAnimatedValue)(disableFadeIn ? LOADED_OPACITY : INITIAL_OPACITY);
|
|
44
45
|
const acceptHeader = (0, _react.useContext)(_ImageFileExtensionContext.default);
|
|
45
46
|
const handleLoad = (0, _react.useCallback)(() => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
if (!disableFadeIn) {
|
|
48
|
+
_reactNative.Animated.timing(opacity, {
|
|
49
|
+
toValue: LOADED_OPACITY,
|
|
50
|
+
duration: ANIMATION_DURATION,
|
|
51
|
+
useNativeDriver: _utils.isNotAndroid12
|
|
52
|
+
}).start();
|
|
53
|
+
}
|
|
51
54
|
|
|
52
55
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad();
|
|
53
|
-
}, [onLoad]);
|
|
56
|
+
}, [disableFadeIn, onLoad]);
|
|
54
57
|
return /*#__PURE__*/_react.default.createElement(AnimatedFastImage, {
|
|
55
58
|
onError: onError,
|
|
56
59
|
onLoad: handleLoad,
|
|
@@ -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, 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
|
|
1
|
+
{"version":3,"names":["AnimatedFastImage","Animated","createAnimatedComponent","FastImage","INITIAL_OPACITY","LOADED_OPACITY","ANIMATION_DURATION","ImageCore","props","cache","disableFadeIn","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 disableFadeIn,\n height,\n onError,\n onLoad,\n resizeMode,\n source,\n width,\n } = props;\n\n const opacity = useAnimatedValue(disableFadeIn ? LOADED_OPACITY : INITIAL_OPACITY);\n\n const acceptHeader = useContext(ImageFileExtensionContext);\n\n const handleLoad = useCallback(() => {\n if (!disableFadeIn) {\n Animated.timing(opacity, {\n toValue: LOADED_OPACITY,\n duration: ANIMATION_DURATION,\n useNativeDriver: isNotAndroid12,\n }).start();\n }\n\n onLoad?.();\n }, [disableFadeIn, 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,aAFE;IAGFC,MAHE;IAIFC,OAJE;IAKFC,MALE;IAMFC,UANE;IAOFC,MAPE;IAQFC;EARE,IASFR,KATJ;EAWA,MAAMS,OAAO,GAAG,IAAAC,uBAAA,EAAiBR,aAAa,GAAGL,cAAH,GAAoBD,eAAlD,CAAhB;EAEA,MAAMe,YAAY,GAAG,IAAAC,iBAAA,EAAWC,kCAAX,CAArB;EAEA,MAAMC,UAAU,GAAG,IAAAC,kBAAA,EAAY,MAAM;IACjC,IAAI,CAACb,aAAL,EAAoB;MAChBT,qBAAA,CAASuB,MAAT,CAAgBP,OAAhB,EAAyB;QACrBQ,OAAO,EAAEpB,cADY;QAErBqB,QAAQ,EAAEpB,kBAFW;QAGrBqB,eAAe,EAAEC;MAHI,CAAzB,EAIGC,KAJH;IAKH;;IAEDhB,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM;EACT,CAVkB,EAUhB,CAACH,aAAD,EAAgBG,MAAhB,CAVgB,CAAnB;EAYA,oBACI,6BAAC,iBAAD;IACI,OAAO,EAAED,OADb;IAEI,MAAM,EAAEU,UAFZ;IAGI,UAAU,EAAER,UAHhB;IAII,MAAM,EAAE;MACJL,KADI;MAEJqB,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["ImageCoreProps.ts"],"sourcesContent":["export interface ImageSource {\n uri?: string;\n}\n\nexport type ResizeMode = 'cover' | 'contain';\n\nexport type Loading = 'lazy' | 'eager';\n\nexport type CacheControl = 'immutable' | 'web' | 'cacheOnly';\n\nexport default interface ImageCoreProps extends Readonly<{\n alt?: string;\n cache?: CacheControl;\n disableDrag?: boolean,\n disableLongClick?: boolean,\n height?: number | string;\n loading: Loading;\n onError?: () => void;\n onLoad?: () => void;\n resizeMode: ResizeMode;\n source: ImageSource;\n width?: number | string;\n}> {}"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["ImageCoreProps.ts"],"sourcesContent":["export interface ImageSource {\n uri?: string;\n}\n\nexport type ResizeMode = 'cover' | 'contain';\n\nexport type Loading = 'lazy' | 'eager';\n\nexport type CacheControl = 'immutable' | 'web' | 'cacheOnly';\n\nexport default interface ImageCoreProps extends Readonly<{\n alt?: string;\n cache?: CacheControl;\n disableDrag?: boolean,\n disableFadeIn?: boolean,\n disableLongClick?: boolean,\n height?: number | string;\n loading: Loading;\n onError?: () => void;\n onLoad?: () => void;\n resizeMode: ResizeMode;\n source: ImageSource;\n width?: number | string;\n}> {}"],"mappings":""}
|
|
@@ -29,6 +29,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
29
|
|
|
30
30
|
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); }
|
|
31
31
|
|
|
32
|
+
const isWeb = _reactNative.Platform.OS === 'web';
|
|
33
|
+
|
|
32
34
|
const styles = _reactNative.StyleSheet.create({
|
|
33
35
|
root: {
|
|
34
36
|
alignItems: 'center',
|
|
@@ -74,6 +76,7 @@ const TextField = /*#__PURE__*/_react.default.forwardRef(function TextField(prop
|
|
|
74
76
|
const {
|
|
75
77
|
autoFocus,
|
|
76
78
|
containerStyle: containerStyleProp,
|
|
79
|
+
multiline,
|
|
77
80
|
editable = true,
|
|
78
81
|
hint,
|
|
79
82
|
isLoading,
|
|
@@ -96,6 +99,16 @@ const TextField = /*#__PURE__*/_react.default.forwardRef(function TextField(prop
|
|
|
96
99
|
const theme = (0, _styles2.useTheme)();
|
|
97
100
|
const [isFocused, setIsFocused] = (0, _react.useState)(autoFocus ?? false);
|
|
98
101
|
const [secureTextEntry, setSecureTextEntry] = (0, _react.useState)(secureTextEntryProp ?? false);
|
|
102
|
+
const internalRef = (0, _react.useRef)(null);
|
|
103
|
+
const mergedRef = (0, _react.useCallback)(node => {
|
|
104
|
+
internalRef.current = node;
|
|
105
|
+
|
|
106
|
+
if (typeof ref === 'function') {
|
|
107
|
+
ref(node);
|
|
108
|
+
} else if (ref) {
|
|
109
|
+
ref.current = node;
|
|
110
|
+
}
|
|
111
|
+
}, [ref]);
|
|
99
112
|
const variantStyles = (0, _useVariantStyleMap.default)(variant, status, isFocused);
|
|
100
113
|
|
|
101
114
|
const handleBlur = event => {
|
|
@@ -112,6 +125,22 @@ const TextField = /*#__PURE__*/_react.default.forwardRef(function TextField(prop
|
|
|
112
125
|
setSecureTextEntry(current => !current);
|
|
113
126
|
};
|
|
114
127
|
|
|
128
|
+
const resizeHeight = (0, _react.useCallback)(() => {
|
|
129
|
+
const el = internalRef.current;
|
|
130
|
+
|
|
131
|
+
if (el) {
|
|
132
|
+
el.style.height = 'auto';
|
|
133
|
+
el.style.height = `${el.scrollHeight}px`;
|
|
134
|
+
}
|
|
135
|
+
}, []);
|
|
136
|
+
(0, _react.useLayoutEffect)(() => {
|
|
137
|
+
const shouldResizeHeight = multiline && isWeb;
|
|
138
|
+
|
|
139
|
+
if (shouldResizeHeight) {
|
|
140
|
+
resizeHeight();
|
|
141
|
+
}
|
|
142
|
+
}, [resizeHeight, multiline, value]);
|
|
143
|
+
|
|
115
144
|
const handleChangeText = text => {
|
|
116
145
|
onChangeTextProp === null || onChangeTextProp === void 0 ? void 0 : onChangeTextProp(text);
|
|
117
146
|
};
|
|
@@ -125,7 +154,7 @@ const TextField = /*#__PURE__*/_react.default.forwardRef(function TextField(prop
|
|
|
125
154
|
selector: typography => typography.caption1['semiBold'],
|
|
126
155
|
color: theme.palette.text.strong
|
|
127
156
|
});
|
|
128
|
-
const inputStyle = (0, _styles.css)([styles.input, variantStyles.inputStyle, variantStyles.inputFontStyle,
|
|
157
|
+
const inputStyle = (0, _styles.css)([styles.input, variantStyles.inputStyle, variantStyles.inputFontStyle, isWeb ? {
|
|
129
158
|
outlineWidth: 0
|
|
130
159
|
} : {}, styleProp]);
|
|
131
160
|
const placeholderFontStyle = (0, _styles.css)([variantStyles.inputFontStyle, {
|
|
@@ -162,10 +191,11 @@ const TextField = /*#__PURE__*/_react.default.forwardRef(function TextField(prop
|
|
|
162
191
|
onBlur: handleBlur,
|
|
163
192
|
onChangeText: handleChangeText,
|
|
164
193
|
onFocus: handleFocus,
|
|
165
|
-
ref:
|
|
194
|
+
ref: mergedRef,
|
|
166
195
|
secureTextEntry: secureTextEntry,
|
|
167
196
|
style: inputStyle,
|
|
168
|
-
value: value
|
|
197
|
+
value: value,
|
|
198
|
+
multiline: multiline
|
|
169
199
|
}, otherProps)))), showClearButton && value !== null && value !== void 0 && value.length && value.length > 0 ? /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
170
200
|
color: 'base',
|
|
171
201
|
children: /*#__PURE__*/_react.default.createElement(_icons.Clear, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["styles","StyleSheet","create","root","alignItems","flexGrow","input","inputWrapper","flexShrink","placeholderWrapper","absoluteFillObject","justifyContent","secureToggleButton","padding","position","right","searchIconContainer","left","loadingSinner","height","width","clearButton","secureButtonContainer","TextField","React","forwardRef","props","ref","autoFocus","containerStyle","containerStyleProp","editable","hint","isLoading","onBlur","onChangeText","onChangeTextProp","onFocus","placeholder","placeholderProp","placeholderTextColor","placeholderTextColorProp","secureTextEntry","secureTextEntryProp","showClearButton","showClearButtonProp","status","style","styleProp","title","value","variant","otherProps","isSearch","disabled","theme","useTheme","isFocused","setIsFocused","useState","setSecureTextEntry","variantStyles","useVariantStyleMap","handleBlur","event","handleFocus","handleSecureTogglePress","current","handleChangeText","text","handleClear","titleFontStyle","createFontStyle","selector","typography","caption1","color","palette","strong","inputStyle","css","inputFontStyle","Platform","OS","outlineWidth","placeholderFontStyle","disabledLabel","opacity","length","hintStyle"],"sources":["TextField.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport type { NativeSyntheticEvent, TextInputFocusEventData } from 'react-native';\nimport { Platform, StyleSheet, Text, TextInput, View } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { css } from '@fountain-ui/styles';\nimport IconButton from '../IconButton/IconButton';\nimport { Clear, EyeOff, EyeOn, LoadingSpinner, Search } from '../internal/icons';\nimport Row from '../Row';\nimport { createFontStyle, useTheme } from '../styles';\nimport type TextFieldProps from './TextFieldProps';\nimport type { TextFieldStatus, TextFieldVariant } from './TextFieldProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: 'center',\n flexGrow: 1,\n },\n input: {\n flexGrow: 1,\n },\n inputWrapper: {\n flexGrow: 1,\n flexShrink: 1,\n },\n placeholderWrapper: {\n ...StyleSheet.absoluteFillObject,\n justifyContent: 'center',\n },\n secureToggleButton: {\n alignItems: 'flex-end',\n padding: 0,\n position: 'absolute',\n right: 0,\n },\n searchIconContainer: {\n left: 12,\n position: 'absolute',\n },\n loadingSinner: {\n height: 19,\n width: 19,\n },\n clearButton: {\n height: 36,\n position: 'absolute',\n right: 2,\n width: 32,\n },\n secureButtonContainer: {\n justifyContent: 'center',\n width: 32,\n },\n});\n\nconst TextField = React.forwardRef<TextInput, TextFieldProps>(function TextField(props, ref) {\n const {\n autoFocus,\n containerStyle: containerStyleProp,\n editable = true,\n hint,\n isLoading,\n onBlur,\n onChangeText: onChangeTextProp,\n onFocus,\n placeholder: placeholderProp,\n placeholderTextColor: placeholderTextColorProp,\n secureTextEntry: secureTextEntryProp,\n showClearButton: showClearButtonProp,\n status = 'default' as TextFieldStatus,\n style: styleProp,\n title,\n value,\n variant = 'default' as TextFieldVariant,\n ...otherProps\n } = props;\n\n const isSearch = variant === 'search';\n\n const disabled = !editable || isLoading;\n\n const theme = useTheme();\n\n const [isFocused, setIsFocused] = useState<boolean>(autoFocus ?? false);\n const [secureTextEntry, setSecureTextEntry] = useState<boolean>(secureTextEntryProp ?? false);\n\n const variantStyles = useVariantStyleMap(variant, status, isFocused);\n\n const handleBlur = (event: NativeSyntheticEvent<TextInputFocusEventData>) => {\n setIsFocused(false);\n onBlur?.(event);\n };\n\n const handleFocus = (event: NativeSyntheticEvent<TextInputFocusEventData>) => {\n setIsFocused(true);\n onFocus?.(event);\n };\n\n const handleSecureTogglePress = () => {\n setSecureTextEntry((current) => !current);\n };\n\n const handleChangeText = (text: string) => {\n onChangeTextProp?.(text);\n };\n\n const handleClear = () => {\n handleChangeText('');\n };\n\n const showClearButton = showClearButtonProp ?? isSearch;\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.caption1['semiBold'],\n color: theme.palette.text.strong,\n });\n\n const inputStyle = css([\n styles.input,\n variantStyles.inputStyle,\n variantStyles.inputFontStyle,\n Platform.OS === 'web' ? { outlineWidth: 0 } as FountainUiStyle : {},\n styleProp,\n ]);\n\n const placeholderFontStyle = css([\n variantStyles.inputFontStyle,\n { color: placeholderTextColorProp ?? theme.palette.status.disabledLabel },\n ]);\n\n const containerStyle = css([\n styles.root,\n variantStyles.containerStyle,\n { opacity: disabled ? 0.3 : 1 },\n containerStyleProp,\n ]);\n\n return (\n <View>\n {title && !isSearch ? (\n <Text\n children={title}\n style={titleFontStyle}\n />\n ) : null}\n\n <Row style={containerStyle}>\n <React.Fragment>\n {isSearch ? (\n <View style={styles.searchIconContainer}>\n {isLoading ? (\n <LoadingSpinner style={styles.loadingSinner}/>\n ) : (\n <Search\n color={'base'}\n height={19}\n width={19}\n />\n )}\n </View>\n ) : null}\n\n <View style={styles.inputWrapper}>\n <View\n pointerEvents={'none'}\n style={styles.placeholderWrapper}\n >\n {placeholderProp && !value ? (\n <Text\n children={placeholderProp}\n numberOfLines={1}\n style={placeholderFontStyle}\n />\n ) : null}\n </View>\n\n <TextInput\n autoFocus={autoFocus}\n editable={!disabled}\n onBlur={handleBlur}\n onChangeText={handleChangeText}\n onFocus={handleFocus}\n ref={ref}\n secureTextEntry={secureTextEntry}\n style={inputStyle}\n value={value}\n {...otherProps}\n />\n </View>\n </React.Fragment>\n\n {showClearButton && value?.length && value.length > 0 ? (\n <IconButton\n color={'base'}\n children={\n <Clear\n height={17.31}\n width={15.9}\n />\n }\n onPress={handleClear}\n style={styles.clearButton}\n />\n ) : null}\n\n {secureTextEntryProp && !isSearch ? (\n <View style={styles.secureButtonContainer}>\n <IconButton\n color={'base'}\n onPress={handleSecureTogglePress}\n style={styles.secureToggleButton}\n >\n {secureTextEntry ? (\n <EyeOff\n height={19}\n width={17.42}\n />\n ) : (\n <EyeOn\n height={19}\n width={17.42}\n />\n )}\n </IconButton>\n </View>\n ) : null}\n </Row>\n\n {hint && !isSearch ? (\n <Text\n children={hint}\n style={variantStyles.hintStyle}\n />\n ) : null}\n </View>\n );\n});\n\nexport default TextField;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;;;;;AAEA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,UAAU,EAAE,QADV;IAEFC,QAAQ,EAAE;EAFR,CADuB;EAK7BC,KAAK,EAAE;IACHD,QAAQ,EAAE;EADP,CALsB;EAQ7BE,YAAY,EAAE;IACVF,QAAQ,EAAE,CADA;IAEVG,UAAU,EAAE;EAFF,CARe;EAY7BC,kBAAkB,EAAE,EAChB,GAAGR,uBAAA,CAAWS,kBADE;IAEhBC,cAAc,EAAE;EAFA,CAZS;EAgB7BC,kBAAkB,EAAE;IAChBR,UAAU,EAAE,UADI;IAEhBS,OAAO,EAAE,CAFO;IAGhBC,QAAQ,EAAE,UAHM;IAIhBC,KAAK,EAAE;EAJS,CAhBS;EAsB7BC,mBAAmB,EAAE;IACjBC,IAAI,EAAE,EADW;IAEjBH,QAAQ,EAAE;EAFO,CAtBQ;EA0B7BI,aAAa,EAAE;IACXC,MAAM,EAAE,EADG;IAEXC,KAAK,EAAE;EAFI,CA1Bc;EA8B7BC,WAAW,EAAE;IACTF,MAAM,EAAE,EADC;IAETL,QAAQ,EAAE,UAFD;IAGTC,KAAK,EAAE,CAHE;IAITK,KAAK,EAAE;E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EA6CKR,eAAe,IAAIM,KAAJ,aAAIA,KAAJ,eAAIA,KAAK,CAAEsC,MAA1B,IAAoCtC,KAAK,CAACsC,MAAN,GAAe,CAAnD,gBACG,6BAAC,mBAAD;IACI,KAAK,EAAE,MADX;IAEI,QAAQ,eACJ,6BAAC,YAAD;MACI,MAAM,EAAE,KADZ;MAEI,KAAK,EAAE;IAFX,EAHR;IAQI,OAAO,EAAElB,WARb;IASI,KAAK,EAAEtE,MAAM,CAACqB;EATlB,EADH,GAYG,IAzDR,EA2DKsB,mBAAmB,IAAI,CAACU,QAAxB,gBACG,6BAAC,iBAAD;IAAM,KAAK,EAAErD,MAAM,CAACsB;EAApB,gBACI,6BAAC,mBAAD;IACI,KAAK,EAAE,MADX;IAEI,OAAO,EAAE4C,uBAFb;IAGI,KAAK,EAAElE,MAAM,CAACY;EAHlB,GAKK8B,eAAe,gBACZ,6BAAC,aAAD;IACI,MAAM,EAAE,EADZ;IAEI,KAAK,EAAE;EAFX,EADY,gBAMZ,6BAAC,YAAD;IACI,MAAM,EAAE,EADZ;IAEI,KAAK,EAAE;EAFX,EAXR,CADJ,CADH,GAoBG,IA/ER,CARJ,EA0FKV,IAAI,IAAI,CAACqB,QAAT,gBACG,6BAAC,iBAAD;IACI,QAAQ,EAAErB,IADd;IAEI,KAAK,EAAE6B,aAAa,CAAC4B;EAFzB,EADH,GAKG,IA/FR,CADJ;AAmGH,CArLiB,CAAlB;;eAuLelE,S"}
|
|
1
|
+
{"version":3,"names":["isWeb","Platform","OS","styles","StyleSheet","create","root","alignItems","flexGrow","input","inputWrapper","flexShrink","placeholderWrapper","absoluteFillObject","justifyContent","secureToggleButton","padding","position","right","searchIconContainer","left","loadingSinner","height","width","clearButton","secureButtonContainer","TextField","React","forwardRef","props","ref","autoFocus","containerStyle","containerStyleProp","multiline","editable","hint","isLoading","onBlur","onChangeText","onChangeTextProp","onFocus","placeholder","placeholderProp","placeholderTextColor","placeholderTextColorProp","secureTextEntry","secureTextEntryProp","showClearButton","showClearButtonProp","status","style","styleProp","title","value","variant","otherProps","isSearch","disabled","theme","useTheme","isFocused","setIsFocused","useState","setSecureTextEntry","internalRef","useRef","mergedRef","useCallback","node","current","variantStyles","useVariantStyleMap","handleBlur","event","handleFocus","handleSecureTogglePress","resizeHeight","el","scrollHeight","useLayoutEffect","shouldResizeHeight","handleChangeText","text","handleClear","titleFontStyle","createFontStyle","selector","typography","caption1","color","palette","strong","inputStyle","css","inputFontStyle","outlineWidth","placeholderFontStyle","disabledLabel","opacity","length","hintStyle"],"sources":["TextField.tsx"],"sourcesContent":["import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport type { NativeSyntheticEvent, TextInputFocusEventData } from 'react-native';\nimport { Platform, StyleSheet, Text, TextInput, View } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { css } from '@fountain-ui/styles';\nimport IconButton from '../IconButton/IconButton';\nimport { Clear, EyeOff, EyeOn, LoadingSpinner, Search } from '../internal/icons';\nimport Row from '../Row';\nimport { createFontStyle, useTheme } from '../styles';\nimport type TextFieldProps from './TextFieldProps';\nimport type { TextFieldStatus, TextFieldVariant } from './TextFieldProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\nconst isWeb = Platform.OS === 'web';\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: 'center',\n flexGrow: 1,\n },\n input: {\n flexGrow: 1,\n },\n inputWrapper: {\n flexGrow: 1,\n flexShrink: 1,\n },\n placeholderWrapper: {\n ...StyleSheet.absoluteFillObject,\n justifyContent: 'center',\n },\n secureToggleButton: {\n alignItems: 'flex-end',\n padding: 0,\n position: 'absolute',\n right: 0,\n },\n searchIconContainer: {\n left: 12,\n position: 'absolute',\n },\n loadingSinner: {\n height: 19,\n width: 19,\n },\n clearButton: {\n height: 36,\n position: 'absolute',\n right: 2,\n width: 32,\n },\n secureButtonContainer: {\n justifyContent: 'center',\n width: 32,\n },\n});\n\nconst TextField = React.forwardRef<TextInput, TextFieldProps>(function TextField(props, ref) {\n const {\n autoFocus,\n containerStyle: containerStyleProp,\n multiline,\n editable = true,\n hint,\n isLoading,\n onBlur,\n onChangeText: onChangeTextProp,\n onFocus,\n placeholder: placeholderProp,\n placeholderTextColor: placeholderTextColorProp,\n secureTextEntry: secureTextEntryProp,\n showClearButton: showClearButtonProp,\n status = 'default' as TextFieldStatus,\n style: styleProp,\n title,\n value,\n variant = 'default' as TextFieldVariant,\n ...otherProps\n } = props;\n\n const isSearch = variant === 'search';\n\n const disabled = !editable || isLoading;\n\n const theme = useTheme();\n\n const [isFocused, setIsFocused] = useState<boolean>(autoFocus ?? false);\n const [secureTextEntry, setSecureTextEntry] = useState<boolean>(secureTextEntryProp ?? false);\n\n const internalRef = useRef<TextInput>(null);\n\n const mergedRef = useCallback((node: TextInput | null) => {\n (internalRef as React.MutableRefObject<TextInput | null>).current = node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<TextInput | null>).current = node;\n }\n }, [ref]);\n\n const variantStyles = useVariantStyleMap(variant, status, isFocused);\n\n const handleBlur = (event: NativeSyntheticEvent<TextInputFocusEventData>) => {\n setIsFocused(false);\n onBlur?.(event);\n };\n\n const handleFocus = (event: NativeSyntheticEvent<TextInputFocusEventData>) => {\n setIsFocused(true);\n onFocus?.(event);\n };\n\n const handleSecureTogglePress = () => {\n setSecureTextEntry((current) => !current);\n };\n\n const resizeHeight = useCallback(() => {\n const el = internalRef.current as unknown as HTMLTextAreaElement | null;\n if (el) {\n el.style.height = 'auto';\n el.style.height = `${el.scrollHeight}px`;\n }\n }, []);\n\n useLayoutEffect(() => {\n const shouldResizeHeight = multiline && isWeb;\n if (shouldResizeHeight) {\n resizeHeight();\n }\n }, [resizeHeight, multiline, value]);\n\n const handleChangeText = (text: string) => {\n onChangeTextProp?.(text);\n };\n\n const handleClear = () => {\n handleChangeText('');\n };\n\n const showClearButton = showClearButtonProp ?? isSearch;\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.caption1['semiBold'],\n color: theme.palette.text.strong,\n });\n\n const inputStyle = css([\n styles.input,\n variantStyles.inputStyle,\n variantStyles.inputFontStyle,\n isWeb ? { outlineWidth: 0 } as FountainUiStyle : {},\n styleProp,\n ]);\n\n const placeholderFontStyle = css([\n variantStyles.inputFontStyle,\n { color: placeholderTextColorProp ?? theme.palette.status.disabledLabel },\n ]);\n\n const containerStyle = css([\n styles.root,\n variantStyles.containerStyle,\n { opacity: disabled ? 0.3 : 1 },\n containerStyleProp,\n ]);\n\n return (\n <View>\n {title && !isSearch ? (\n <Text\n children={title}\n style={titleFontStyle}\n />\n ) : null}\n\n <Row style={containerStyle}>\n <React.Fragment>\n {isSearch ? (\n <View style={styles.searchIconContainer}>\n {isLoading ? (\n <LoadingSpinner style={styles.loadingSinner}/>\n ) : (\n <Search\n color={'base'}\n height={19}\n width={19}\n />\n )}\n </View>\n ) : null}\n\n <View style={styles.inputWrapper}>\n <View\n pointerEvents={'none'}\n style={styles.placeholderWrapper}\n >\n {placeholderProp && !value ? (\n <Text\n children={placeholderProp}\n numberOfLines={1}\n style={placeholderFontStyle}\n />\n ) : null}\n </View>\n\n <TextInput\n autoFocus={autoFocus}\n editable={!disabled}\n onBlur={handleBlur}\n onChangeText={handleChangeText}\n onFocus={handleFocus}\n ref={mergedRef}\n secureTextEntry={secureTextEntry}\n style={inputStyle}\n value={value}\n multiline={multiline}\n {...otherProps}\n />\n </View>\n </React.Fragment>\n\n {showClearButton && value?.length && value.length > 0 ? (\n <IconButton\n color={'base'}\n children={\n <Clear\n height={17.31}\n width={15.9}\n />\n }\n onPress={handleClear}\n style={styles.clearButton}\n />\n ) : null}\n\n {secureTextEntryProp && !isSearch ? (\n <View style={styles.secureButtonContainer}>\n <IconButton\n color={'base'}\n onPress={handleSecureTogglePress}\n style={styles.secureToggleButton}\n >\n {secureTextEntry ? (\n <EyeOff\n height={19}\n width={17.42}\n />\n ) : (\n <EyeOn\n height={19}\n width={17.42}\n />\n )}\n </IconButton>\n </View>\n ) : null}\n </Row>\n\n {hint && !isSearch ? (\n <Text\n children={hint}\n style={variantStyles.hintStyle}\n />\n ) : null}\n </View>\n );\n});\n\nexport default TextField;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;;;;;AAEA,MAAMA,KAAK,GAAGC,qBAAA,CAASC,EAAT,KAAgB,KAA9B;;AAEA,MAAMC,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,UAAU,EAAE,QADV;IAEFC,QAAQ,EAAE;EAFR,CADuB;EAK7BC,KAAK,EAAE;IACHD,QAAQ,EAAE;EADP,CALsB;EAQ7BE,YAAY,EAAE;IACVF,QAAQ,EAAE,CADA;IAEVG,UAAU,EAAE;EAFF,CARe;EAY7BC,kBAAkB,EAAE,EAChB,GAAGR,uBAAA,CAAWS,kBADE;IAEhBC,cAAc,EAAE;EAFA,CAZS;EAgB7BC,kBAAkB,EAAE;IAChBR,UAAU,EAAE,UADI;IAEhBS,OAAO,EAAE,CAFO;IAGhBC,QAAQ,EAAE,UAHM;IAIhBC,KAAK,EAAE;EAJS,CAhBS;EAsB7BC,mBAAmB,EAAE;IACjBC,IAAI,EAAE,EADW;IAEjBH,QAAQ,EAAE;EAFO,CAtBQ;EA0B7BI,aAAa,EAAE;IACXC,MAAM,EAAE,EADG;IAEXC,KAAK,EAAE;EAFI,CA1Bc;EA8B7BC,WAAW,EAAE;IACTF,MAAM,EAAE,EADC;IAETL,QAAQ,EAAE,UAFD;IAGTC,KAAK,EAAE,CAHE;IAITK,KAAK,EAAE;EAJE,CA9BgB;EAoC7BE,qBAAqB,EAAE;IACnBX,cAAc,EAAE,QADG;IAEnBS,KAAK,EAAE;EAFY;AApCM,CAAlB,CAAf;;AA0CA,MAAMG,SAAS,gBAAGC,cAAA,CAAMC,UAAN,CAA4C,SAASF,SAAT,CAAmBG,KAAnB,EAA0BC,GAA1B,EAA+B;EACzF,MA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AAD;IACI,MAAM,EAAE,EADZ;IAEI,KAAK,EAAE;EAFX,EADY,gBAMZ,6BAAC,YAAD;IACI,MAAM,EAAE,EADZ;IAEI,KAAK,EAAE;EAFX,EAXR,CADJ,CADH,GAoBG,IAhFR,CARJ,EA2FKV,IAAI,IAAI,CAACqB,QAAT,gBACG,6BAAC,iBAAD;IACI,QAAQ,EAAErB,IADd;IAEI,KAAK,EAAEmC,aAAa,CAAC8B;EAFzB,EADH,GAKG,IAhGR,CADJ;AAoGH,CAjNiB,CAAlB;;eAmNe3E,S"}
|
|
@@ -148,12 +148,16 @@ function Tooltip(props) {
|
|
|
148
148
|
const textStyle = (0, _styles.css)([fontStyle, {
|
|
149
149
|
flexShrink: 1
|
|
150
150
|
}]);
|
|
151
|
+
const beakOverlapStyle = {
|
|
152
|
+
[placement === 'top' ? 'marginTop' : placement === 'bottom' ? 'marginBottom' : placement === 'left' ? 'marginLeft' : 'marginRight']: -_reactNative.StyleSheet.hairlineWidth
|
|
153
|
+
};
|
|
151
154
|
const beakStyle = (0, _styles.css)({
|
|
152
155
|
transform: [isVerticalPlacement ? {
|
|
153
156
|
translateX: beakOffset
|
|
154
157
|
} : {
|
|
155
158
|
translateY: beakOffset
|
|
156
|
-
}]
|
|
159
|
+
}],
|
|
160
|
+
...beakOverlapStyle
|
|
157
161
|
});
|
|
158
162
|
|
|
159
163
|
const buttonElem = /*#__PURE__*/_react.default.createElement(_ButtonBase.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_BEAK_LAYOUT","offset","placement","INITIAL_LAYOUT","width","height","x","y","ANIMATION_CONFIG","duration","getFlexDirection","useStyles","theme","useTheme","root","position","zIndex","tooltip","content","backgroundColor","palette","fill","base","paddingHorizontal","spacing","paddingVertical","small","borderRadius","shape","radius","sm","paddingBottom","paddingTop","large","Tooltip","props","beakLayout","children","initialLayout","left","onClose","right","numberOfTitleLines","size","style","title","tooltipStyle","verticalOffset","visible","otherProps","beakOffset","beakPlacement","styles","layout","setLayout","useState","scale","useSharedValue","animatedStyle","useAnimatedStyle","transform","value","flexDirection","isVerticalPlacement","totalOffset","tooltipLayoutStyle","alignItems","undefined","overflow","Platform","select","web","display","default","contentStyle","css","flexGrow","flexShrink","useEffect","nextScaleValue","withTiming","fontStyle","createFontStyle","selector","typo","body3","regular","caption2","color","text","strongInverse","textStyle","beakStyle","translateX","translateY","buttonElem","beakElem","event","nativeEvent"],"sources":["Tooltip.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { Platform, Text, View, ViewProps } from 'react-native';\nimport type { WithTimingConfig } from 'react-native-reanimated';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type TooltipProps from './TooltipProps';\nimport type { TooltipBeakLayout, TooltipPlacement, TooltipSize } from './TooltipProps';\nimport Beak from './Beaks';\n\nconst DEFAULT_BEAK_LAYOUT: TooltipBeakLayout = {\n offset: 0,\n placement: 'middle',\n};\n\nconst INITIAL_LAYOUT = { width: 0, height: 0, x: 0, y: 0 };\n\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = { duration: 150 };\n\ntype FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';\n\nconst getFlexDirection = (placement: TooltipPlacement): FlexDirection => {\n switch (placement) {\n case 'right':\n return 'row-reverse';\n case 'bottom':\n return 'column-reverse';\n case 'left':\n return 'row';\n case 'top':\n default:\n return 'column';\n }\n};\n\ntype TooltipStyles = NamedStylesStringUnion<'root' | 'content' | 'small' | 'large'>;\n\nconst useStyles: UseStyles<TooltipStyles> = function (): TooltipStyles {\n const theme = useTheme();\n\n return {\n root: {\n position: 'absolute',\n zIndex: theme.zIndex.tooltip,\n },\n content: {\n backgroundColor: theme.palette.fill.base,\n paddingHorizontal: theme.spacing(2),\n paddingVertical: theme.spacing(1.5),\n },\n small: {\n borderRadius: theme.shape.radius.sm,\n paddingBottom: theme.spacing(1.75),\n paddingHorizontal: theme.spacing(2),\n paddingTop: theme.spacing(1.5),\n },\n large: {\n borderRadius: 5,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(2),\n },\n };\n};\n\nexport default function Tooltip(props: TooltipProps) {\n const {\n beakLayout = DEFAULT_BEAK_LAYOUT,\n children,\n initialLayout = INITIAL_LAYOUT,\n left,\n onClose,\n placement = 'top' as TooltipPlacement,\n right,\n numberOfTitleLines = 1,\n size = 'small' as TooltipSize,\n style,\n title,\n tooltipStyle,\n verticalOffset = 4,\n visible = false,\n ...otherProps\n } = props;\n\n const {\n offset: beakOffset,\n placement: beakPlacement,\n } = beakLayout;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const [layout, setLayout] = useState(initialLayout);\n\n const scale = useSharedValue(0);\n\n const animatedStyle = useAnimatedStyle(() => ({\n transform: [{ scale: scale.value }],\n }), [scale]);\n\n const flexDirection = getFlexDirection(placement);\n\n const isVerticalPlacement = placement === 'top' || placement === 'bottom';\n\n const totalOffset = -((isVerticalPlacement ? layout.height : layout.width) + verticalOffset);\n const tooltipLayoutStyle: ViewProps['style'] = {\n alignItems: beakPlacement === 'start'\n ? 'flex-start'\n : beakPlacement === 'end'\n ? 'flex-end'\n : 'center',\n flexDirection,\n left,\n right,\n height: visible ? undefined : 0,\n overflow: visible ? undefined : 'hidden',\n ...Platform.select({\n web: {\n display: visible ? 'flex' : 'none',\n },\n default: {},\n }),\n [placement]: totalOffset,\n };\n\n const contentStyle = css([\n styles.content,\n styles[size],\n isVerticalPlacement\n ? { width: '100%' }\n : { flexGrow: 1, flexShrink: 1 },\n ]);\n\n useEffect(() => {\n const nextScaleValue = visible ? 1 : 0;\n\n scale.value = withTiming(nextScaleValue, ANIMATION_CONFIG);\n }, [visible]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => size === 'large'\n ? typo.body3.regular\n : typo.caption2.regular,\n color: theme.palette.text.strongInverse,\n });\n\n const textStyle = css([\n fontStyle,\n { flexShrink: 1 },\n ]);\n\n const beakStyle = css({\n transform: [isVerticalPlacement ? { translateX: beakOffset } : { translateY: beakOffset }],\n });\n\n const buttonElem = (\n <ButtonBase\n pressEffect={'none'}\n onPress={onClose}\n style={contentStyle}\n >\n <Text\n // TODO: Should we provide text prop customization?\n numberOfLines={numberOfTitleLines}\n style={textStyle}\n >\n {title}\n </Text>\n </ButtonBase>\n );\n\n const beakElem = (\n <View style={beakStyle}>\n <Beak\n fill={theme.palette.fill.base}\n placement={placement}\n size={size}\n />\n </View>\n );\n\n return (\n <View\n style={style}\n {...otherProps}\n >\n {children}\n\n <Animated.View\n onLayout={(event) => {\n if (event.nativeEvent.layout.height === 0) {\n return;\n }\n\n setLayout(event.nativeEvent.layout);\n }}\n style={[\n styles.root,\n animatedStyle,\n tooltipLayoutStyle,\n tooltipStyle,\n ]}\n >\n {buttonElem}\n\n {beakElem}\n </Animated.View>\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAEA;;AACA;;AAGA;;;;;;;;;;AAEA,MAAMA,mBAAsC,GAAG;EAC3CC,MAAM,EAAE,CADmC;EAE3CC,SAAS,EAAE;AAFgC,CAA/C;AAKA,MAAMC,cAAc,GAAG;EAAEC,KAAK,EAAE,CAAT;EAAYC,MAAM,EAAE,CAApB;EAAuBC,CAAC,EAAE,CAA1B;EAA6BC,CAAC,EAAE;AAAhC,CAAvB;AAEA,MAAMC,gBAA4C,GAAG;EAAEC,QAAQ,EAAE;AAAZ,CAArD;;AAIA,MAAMC,gBAAgB,GAAIR,SAAD,IAAgD;EACrE,QAAQA,SAAR;IACI,KAAK,OAAL;MACI,OAAO,aAAP;;IACJ,KAAK,QAAL;MACI,OAAO,gBAAP;;IACJ,KAAK,MAAL;MACI,OAAO,KAAP;;IACJ,KAAK,KAAL;IACA;MACI,OAAO,QAAP;EATR;AAWH,CAZD;;AAgBA,MAAMS,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ALL,CALJ,CADJ;;EAgBA,MAAMmD,QAAQ,gBACV,6BAAC,iBAAD;IAAM,KAAK,EAAEJ;EAAb,gBACI,6BAAC,cAAD;IACI,IAAI,EAAEhF,KAAK,CAACQ,OAAN,CAAcC,IAAd,CAAmBC,IAD7B;IAEI,SAAS,EAAEpB,SAFf;IAGI,IAAI,EAAEyC;EAHV,EADJ,CADJ;;EAUA,oBACI,6BAAC,iBAAD;IACI,KAAK,EAAEC;EADX,GAEQK,UAFR,GAIKZ,QAJL,eAMI,6BAAC,8BAAD,CAAU,IAAV;IACI,QAAQ,EAAG4D,KAAD,IAAW;MACjB,IAAIA,KAAK,CAACC,WAAN,CAAkB7C,MAAlB,CAAyBhD,MAAzB,KAAoC,CAAxC,EAA2C;QACvC;MACH;;MAEDiD,SAAS,CAAC2C,KAAK,CAACC,WAAN,CAAkB7C,MAAnB,CAAT;IACH,CAPL;IAQI,KAAK,EAAE,CACHD,MAAM,CAACtC,IADJ,EAEH4C,aAFG,EAGHO,kBAHG,EAIHnB,YAJG;EARX,GAeKiD,UAfL,EAiBKC,QAjBL,CANJ,CADJ;AA4BH;;AAAA"}
|
|
1
|
+
{"version":3,"names":["DEFAULT_BEAK_LAYOUT","offset","placement","INITIAL_LAYOUT","width","height","x","y","ANIMATION_CONFIG","duration","getFlexDirection","useStyles","theme","useTheme","root","position","zIndex","tooltip","content","backgroundColor","palette","fill","base","paddingHorizontal","spacing","paddingVertical","small","borderRadius","shape","radius","sm","paddingBottom","paddingTop","large","Tooltip","props","beakLayout","children","initialLayout","left","onClose","right","numberOfTitleLines","size","style","title","tooltipStyle","verticalOffset","visible","otherProps","beakOffset","beakPlacement","styles","layout","setLayout","useState","scale","useSharedValue","animatedStyle","useAnimatedStyle","transform","value","flexDirection","isVerticalPlacement","totalOffset","tooltipLayoutStyle","alignItems","undefined","overflow","Platform","select","web","display","default","contentStyle","css","flexGrow","flexShrink","useEffect","nextScaleValue","withTiming","fontStyle","createFontStyle","selector","typo","body3","regular","caption2","color","text","strongInverse","textStyle","beakOverlapStyle","StyleSheet","hairlineWidth","beakStyle","translateX","translateY","buttonElem","beakElem","event","nativeEvent"],"sources":["Tooltip.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { Platform, StyleSheet, Text, View, ViewProps } from 'react-native';\nimport type { WithTimingConfig } from 'react-native-reanimated';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type TooltipProps from './TooltipProps';\nimport type { TooltipBeakLayout, TooltipPlacement, TooltipSize } from './TooltipProps';\nimport Beak from './Beaks';\n\nconst DEFAULT_BEAK_LAYOUT: TooltipBeakLayout = {\n offset: 0,\n placement: 'middle',\n};\n\nconst INITIAL_LAYOUT = { width: 0, height: 0, x: 0, y: 0 };\n\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = { duration: 150 };\n\ntype FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';\n\nconst getFlexDirection = (placement: TooltipPlacement): FlexDirection => {\n switch (placement) {\n case 'right':\n return 'row-reverse';\n case 'bottom':\n return 'column-reverse';\n case 'left':\n return 'row';\n case 'top':\n default:\n return 'column';\n }\n};\n\ntype TooltipStyles = NamedStylesStringUnion<'root' | 'content' | 'small' | 'large'>;\n\nconst useStyles: UseStyles<TooltipStyles> = function (): TooltipStyles {\n const theme = useTheme();\n\n return {\n root: {\n position: 'absolute',\n zIndex: theme.zIndex.tooltip,\n },\n content: {\n backgroundColor: theme.palette.fill.base,\n paddingHorizontal: theme.spacing(2),\n paddingVertical: theme.spacing(1.5),\n },\n small: {\n borderRadius: theme.shape.radius.sm,\n paddingBottom: theme.spacing(1.75),\n paddingHorizontal: theme.spacing(2),\n paddingTop: theme.spacing(1.5),\n },\n large: {\n borderRadius: 5,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(2),\n },\n };\n};\n\nexport default function Tooltip(props: TooltipProps) {\n const {\n beakLayout = DEFAULT_BEAK_LAYOUT,\n children,\n initialLayout = INITIAL_LAYOUT,\n left,\n onClose,\n placement = 'top' as TooltipPlacement,\n right,\n numberOfTitleLines = 1,\n size = 'small' as TooltipSize,\n style,\n title,\n tooltipStyle,\n verticalOffset = 4,\n visible = false,\n ...otherProps\n } = props;\n\n const {\n offset: beakOffset,\n placement: beakPlacement,\n } = beakLayout;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const [layout, setLayout] = useState(initialLayout);\n\n const scale = useSharedValue(0);\n\n const animatedStyle = useAnimatedStyle(() => ({\n transform: [{ scale: scale.value }],\n }), [scale]);\n\n const flexDirection = getFlexDirection(placement);\n\n const isVerticalPlacement = placement === 'top' || placement === 'bottom';\n\n const totalOffset = -((isVerticalPlacement ? layout.height : layout.width) + verticalOffset);\n const tooltipLayoutStyle: ViewProps['style'] = {\n alignItems: beakPlacement === 'start'\n ? 'flex-start'\n : beakPlacement === 'end'\n ? 'flex-end'\n : 'center',\n flexDirection,\n left,\n right,\n height: visible ? undefined : 0,\n overflow: visible ? undefined : 'hidden',\n ...Platform.select({\n web: {\n display: visible ? 'flex' : 'none',\n },\n default: {},\n }),\n [placement]: totalOffset,\n };\n\n const contentStyle = css([\n styles.content,\n styles[size],\n isVerticalPlacement\n ? { width: '100%' }\n : { flexGrow: 1, flexShrink: 1 },\n ]);\n\n useEffect(() => {\n const nextScaleValue = visible ? 1 : 0;\n\n scale.value = withTiming(nextScaleValue, ANIMATION_CONFIG);\n }, [visible]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => size === 'large'\n ? typo.body3.regular\n : typo.caption2.regular,\n color: theme.palette.text.strongInverse,\n });\n\n const textStyle = css([\n fontStyle,\n { flexShrink: 1 },\n ]);\n\n const beakOverlapStyle = {\n [placement === 'top' ? 'marginTop' : placement === 'bottom' ? 'marginBottom' : placement === 'left' ? 'marginLeft' : 'marginRight']: -StyleSheet.hairlineWidth,\n };\n\n const beakStyle = css({\n transform: [isVerticalPlacement ? { translateX: beakOffset } : { translateY: beakOffset }],\n ...beakOverlapStyle,\n });\n\n const buttonElem = (\n <ButtonBase\n pressEffect={'none'}\n onPress={onClose}\n style={contentStyle}\n >\n <Text\n // TODO: Should we provide text prop customization?\n numberOfLines={numberOfTitleLines}\n style={textStyle}\n >\n {title}\n </Text>\n </ButtonBase>\n );\n\n const beakElem = (\n <View style={beakStyle}>\n <Beak\n fill={theme.palette.fill.base}\n placement={placement}\n size={size}\n />\n </View>\n );\n\n return (\n <View\n style={style}\n {...otherProps}\n >\n {children}\n\n <Animated.View\n onLayout={(event) => {\n if (event.nativeEvent.layout.height === 0) {\n return;\n }\n\n setLayout(event.nativeEvent.layout);\n }}\n style={[\n styles.root,\n animatedStyle,\n tooltipLayoutStyle,\n tooltipStyle,\n ]}\n >\n {buttonElem}\n\n {beakElem}\n </Animated.View>\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAEA;;AACA;;AAGA;;;;;;;;;;AAEA,MAAMA,mBAAsC,GAAG;EAC3CC,MAAM,EAAE,CADmC;EAE3CC,SAAS,EAAE;AAFgC,CAA/C;AAKA,MAAMC,cAAc,GAAG;EAAEC,KAAK,EAAE,CAAT;EAAYC,MAAM,EAAE,CAApB;EAAuBC,CAAC,EAAE,CAA1B;EAA6BC,CAAC,EAAE;AAAhC,CAAvB;AAEA,MAAMC,gBAA4C,GAAG;EAAEC,QAAQ,EAAE;AAAZ,CAArD;;AAIA,MAAMC,gBAAgB,GAAIR,SAAD,IAAgD;EACrE,QAAQA,SAAR;IACI,KAAK,OAAL;MACI,OAAO,aAAP;;IACJ,KAAK,QAAL;MACI,OAAO,gBAAP;;IACJ,KAAK,MAAL;MACI,OAAO,KAAP;;IACJ,KAAK,KAAL;IACA;MACI,OAAO,QAAP;EATR;AAWH,CAZD;;AAgBA,MAAMS,SAAmC,GAAG,YAA2B;EACnE,MAAMC,K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U,gBACZ,6BAAC,mBAAD;IACI,WAAW,EAAE,MADjB;IAEI,OAAO,EAAE1D,OAFb;IAGI,KAAK,EAAEkC;EAHX,gBAKI,6BAAC,iBAAD,CACI;EADJ;IAEI,aAAa,EAAEhC,kBAFnB;IAGI,KAAK,EAAEiD;EAHX,GAKK9C,KALL,CALJ,CADJ;;EAgBA,MAAMsD,QAAQ,gBACV,6BAAC,iBAAD;IAAM,KAAK,EAAEJ;EAAb,gBACI,6BAAC,cAAD;IACI,IAAI,EAAEnF,KAAK,CAACQ,OAAN,CAAcC,IAAd,CAAmBC,IAD7B;IAEI,SAAS,EAAEpB,SAFf;IAGI,IAAI,EAAEyC;EAHV,EADJ,CADJ;;EAUA,oBACI,6BAAC,iBAAD;IACI,KAAK,EAAEC;EADX,GAEQK,UAFR,GAIKZ,QAJL,eAMI,6BAAC,8BAAD,CAAU,IAAV;IACI,QAAQ,EAAG+D,KAAD,IAAW;MACjB,IAAIA,KAAK,CAACC,WAAN,CAAkBhD,MAAlB,CAAyBhD,MAAzB,KAAoC,CAAxC,EAA2C;QACvC;MACH;;MAEDiD,SAAS,CAAC8C,KAAK,CAACC,WAAN,CAAkBhD,MAAnB,CAAT;IACH,CAPL;IAQI,KAAK,EAAE,CACHD,MAAM,CAACtC,IADJ,EAEH4C,aAFG,EAGHO,kBAHG,EAIHnB,YAJG;EARX,GAeKoD,UAfL,EAiBKC,QAjBL,CANJ,CADJ;AA4BH;;AAAA"}
|
|
@@ -52,7 +52,7 @@ export default function BottomSheetTitle(props) {
|
|
|
52
52
|
style: titleStyle
|
|
53
53
|
}), actionButtonProps ? /*#__PURE__*/React.createElement(Button, {
|
|
54
54
|
children: actionButtonProps.title,
|
|
55
|
-
color: 'accent',
|
|
55
|
+
color: actionButtonProps.color ?? 'accent',
|
|
56
56
|
disabled: actionButtonProps.disabled ?? false,
|
|
57
57
|
disableMinWidth: true,
|
|
58
58
|
onPress: actionButtonProps.onPress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","Button","Row","createFontStyle","css","useTheme","useStyles","theme","root","alignItems","gap","spacing","justifyContent","marginBottom","paddingHorizontal","title","flexShrink","paddingBottom","paddingTop","minWidth","actionButton","BottomSheetTitle","props","actionButtonProps","children","style","styleProp","otherProps","styles","rootStyle","titleFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle","disabled","onPress"],"sources":["BottomSheetTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport Button from '../Button/Button';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type BottomSheetTitleProps from './BottomSheetTitleProps';\n\ntype BottomSheetTitleStyles = NamedStylesStringUnion<'root' | 'title' | 'actionButton'>;\n\nconst useStyles: UseStyles<BottomSheetTitleStyles> = function (): BottomSheetTitleStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'flex-start',\n gap: theme.spacing(8),\n justifyContent: 'space-between',\n marginBottom: theme.spacing(4),\n paddingHorizontal: theme.spacing(6),\n },\n title: {\n flexShrink: 1,\n paddingBottom: theme.spacing(1.25),\n paddingTop: theme.spacing(1),\n minWidth: 0,\n },\n actionButton: {\n paddingBottom: theme.spacing(1.75),\n paddingHorizontal: 0,\n paddingTop: theme.spacing(1.25),\n },\n };\n};\n\nexport default function BottomSheetTitle(props: BottomSheetTitleProps) {\n const {\n actionButtonProps,\n children,\n style: styleProp,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.header3.semiBold,\n color: theme.palette.text.strong,\n });\n\n const titleStyle = css([\n styles.title,\n titleFontStyle,\n ]);\n\n return (\n <Row\n style={rootStyle}\n {...otherProps}\n >\n <Text\n children={children}\n style={titleStyle}\n />\n\n {actionButtonProps ? (\n <Button\n children={actionButtonProps.title}\n color={'accent'}\n disabled={actionButtonProps.disabled ?? false}\n disableMinWidth={true}\n onPress={actionButtonProps.onPress}\n size={'large'}\n style={styles.actionButton}\n variant={'text'}\n />\n ) : null}\n </Row>\n );\n}\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,GAAP,MAAgB,QAAhB;AACA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,QAA/B,QAA+C,WAA/C;;AAKA,MAAMC,SAA4C,GAAG,YAAoC;EACrF,MAAMC,KAAK,GAAGF,QAAQ,EAAtB;EAEA,OAAO;IACHG,IAAI,EAAE;MACFC,UAAU,EAAE,YADV;MAEFC,GAAG,EAAEH,KAAK,CAACI,OAAN,CAAc,CAAd,CAFH;MAGFC,cAAc,EAAE,eAHd;MAIFC,YAAY,EAAEN,KAAK,CAACI,OAAN,CAAc,CAAd,CAJZ;MAKFG,iBAAiB,EAAEP,KAAK,CAACI,OAAN,CAAc,CAAd;IALjB,CADH;IAQHI,KAAK,EAAE;MACHC,UAAU,EAAE,CADT;MAEHC,aAAa,EAAEV,KAAK,CAACI,OAAN,CAAc,IAAd,CAFZ;MAGHO,UAAU,EAAEX,KAAK,CAACI,OAAN,CAAc,CAAd,CAHT;MAIHQ,QAAQ,EAAE;IAJP,CARJ;IAcHC,YAAY,EAAE;MACVH,aAAa,EAAEV,KAAK,CAACI,OAAN,CAAc,IAAd,CADL;MAEVG,iBAAiB,EAAE,CAFT;MAGVI,UAAU,EAAEX,KAAK,CAACI,OAAN,CAAc,IAAd;IAHF;EAdX,CAAP;AAoBH,CAvBD;;AAyBA,eAAe,SAASU,gBAAT,CAA0BC,KAA1B,EAAwD;EACnE,MAAM;IACFC,iBADE;IAEFC,QAFE;IAGFC,KAAK,EAAEC,SAHL;IAIF,GAAGC;EAJD,IAKFL,KALJ;EAOA,MAAMf,KAAK,GAAGF,QAAQ,EAAtB;EAEA,MAAMuB,MAAM,GAAGtB,SAAS,EAAxB;EAEA,MAAMuB,SAAS,GAAGzB,GAAG,CAAC,CAClBwB,MAAM,CAACpB,IADW,EAElBkB,SAFkB,CAAD,CAArB;EAKA,MAAMI,cAAc,GAAG3B,eAAe,CAACI,KAAD,EAAQ;IAC1CwB,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,OAAX,CAAmBC,QADH;IAE1CC,KAAK,EAAE5B,KAAK,CAAC6B,OAAN,CAAcC,IAAd,CAAmBC;EAFgB,CAAR,CAAtC;EAKA,MAAMC,UAAU,GAAGnC,GAAG,CAAC,CACnBwB,MAAM,CAACb,KADY,EAEnBe,cAFmB,CAAD,CAAtB;EAKA,oBACI,oBAAC,GAAD;IACI,KAAK,EAAED;EADX,GAEQF,UAFR,gBAII,oBAAC,IAAD;IACI,QAAQ,EAAEH,QADd;IAEI,KAAK,EAAEe;EAFX,EAJJ,EASKhB,iBAAiB,gBACd,oBAAC,MAAD;IACI,QAAQ,EAAEA,iBAAiB,CAACR,KADhC;IAEI,KAAK,
|
|
1
|
+
{"version":3,"names":["React","Text","Button","Row","createFontStyle","css","useTheme","useStyles","theme","root","alignItems","gap","spacing","justifyContent","marginBottom","paddingHorizontal","title","flexShrink","paddingBottom","paddingTop","minWidth","actionButton","BottomSheetTitle","props","actionButtonProps","children","style","styleProp","otherProps","styles","rootStyle","titleFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle","disabled","onPress"],"sources":["BottomSheetTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport Button from '../Button/Button';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type BottomSheetTitleProps from './BottomSheetTitleProps';\n\ntype BottomSheetTitleStyles = NamedStylesStringUnion<'root' | 'title' | 'actionButton'>;\n\nconst useStyles: UseStyles<BottomSheetTitleStyles> = function (): BottomSheetTitleStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'flex-start',\n gap: theme.spacing(8),\n justifyContent: 'space-between',\n marginBottom: theme.spacing(4),\n paddingHorizontal: theme.spacing(6),\n },\n title: {\n flexShrink: 1,\n paddingBottom: theme.spacing(1.25),\n paddingTop: theme.spacing(1),\n minWidth: 0,\n },\n actionButton: {\n paddingBottom: theme.spacing(1.75),\n paddingHorizontal: 0,\n paddingTop: theme.spacing(1.25),\n },\n };\n};\n\nexport default function BottomSheetTitle(props: BottomSheetTitleProps) {\n const {\n actionButtonProps,\n children,\n style: styleProp,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.header3.semiBold,\n color: theme.palette.text.strong,\n });\n\n const titleStyle = css([\n styles.title,\n titleFontStyle,\n ]);\n\n return (\n <Row\n style={rootStyle}\n {...otherProps}\n >\n <Text\n children={children}\n style={titleStyle}\n />\n\n {actionButtonProps ? (\n <Button\n children={actionButtonProps.title}\n color={actionButtonProps.color ?? 'accent'}\n disabled={actionButtonProps.disabled ?? false}\n disableMinWidth={true}\n onPress={actionButtonProps.onPress}\n size={'large'}\n style={styles.actionButton}\n variant={'text'}\n />\n ) : null}\n </Row>\n );\n}\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,GAAP,MAAgB,QAAhB;AACA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,QAA/B,QAA+C,WAA/C;;AAKA,MAAMC,SAA4C,GAAG,YAAoC;EACrF,MAAMC,KAAK,GAAGF,QAAQ,EAAtB;EAEA,OAAO;IACHG,IAAI,EAAE;MACFC,UAAU,EAAE,YADV;MAEFC,GAAG,EAAEH,KAAK,CAACI,OAAN,CAAc,CAAd,CAFH;MA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AQ,EAAEH,QADd;IAEI,KAAK,EAAEe;EAFX,EAJJ,EASKhB,iBAAiB,gBACd,oBAAC,MAAD;IACI,QAAQ,EAAEA,iBAAiB,CAACR,KADhC;IAEI,KAAK,EAAEQ,iBAAiB,CAACY,KAAlB,IAA2B,QAFtC;IAGI,QAAQ,EAAEZ,iBAAiB,CAACiB,QAAlB,IAA8B,KAH5C;IAII,eAAe,EAAE,IAJrB;IAKI,OAAO,EAAEjB,iBAAiB,CAACkB,OAL/B;IAMI,IAAI,EAAE,OANV;IAOI,KAAK,EAAEb,MAAM,CAACR,YAPlB;IAQI,OAAO,EAAE;EARb,EADc,GAWd,IApBR,CADJ;AAwBH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["BottomSheetTitleProps.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":[],"sources":["BottomSheetTitleProps.ts"],"sourcesContent":["import type { ButtonProps } from '../Button';\nimport type { RowProps } from '../Row';\nimport type { OverridableComponentProps } from '../types';\n\ntype ActionButtonProps = Pick<ButtonProps, 'color' | 'disabled' | 'onPress'> & {\n title: string;\n};\n\nexport default interface BottomSheetTitleProps extends OverridableComponentProps<RowProps, {\n children: string;\n actionButtonProps?: ActionButtonProps;\n}> {}\n"],"mappings":""}
|
|
@@ -5,6 +5,7 @@ import { Text, View } from 'react-native';
|
|
|
5
5
|
import ImageCore from '../ImageCore';
|
|
6
6
|
import { css, StyleSheet, useTheme } from '../styles';
|
|
7
7
|
import OverlayCloseButton from './OverlayCloseButton';
|
|
8
|
+
import preload from './preload';
|
|
8
9
|
|
|
9
10
|
const useStyles = function () {
|
|
10
11
|
const theme = useTheme();
|
|
@@ -52,6 +53,7 @@ function Image(props) {
|
|
|
52
53
|
alt,
|
|
53
54
|
cache = 'immutable',
|
|
54
55
|
disableDrag,
|
|
56
|
+
disableFadeIn,
|
|
55
57
|
disableLongClick,
|
|
56
58
|
disableOutline,
|
|
57
59
|
disablePlaceholder,
|
|
@@ -96,6 +98,7 @@ function Image(props) {
|
|
|
96
98
|
alt: alt,
|
|
97
99
|
cache: cache,
|
|
98
100
|
disableDrag: disableDrag,
|
|
101
|
+
disableFadeIn: disableFadeIn,
|
|
99
102
|
disableLongClick: disableLongClick,
|
|
100
103
|
height: '100%',
|
|
101
104
|
loading: loading,
|
|
@@ -110,5 +113,6 @@ function Image(props) {
|
|
|
110
113
|
}
|
|
111
114
|
|
|
112
115
|
Image.OverlayCloseButton = OverlayCloseButton;
|
|
116
|
+
Image.preload = preload;
|
|
113
117
|
export default Image;
|
|
114
118
|
//# sourceMappingURL=Image.js.map
|