@fountain-ui/core 3.0.0-alpha.5 → 3.0.0-alpha.6
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/Accordion/Accordion.js +4 -1
- package/build/commonjs/Accordion/Accordion.js.map +1 -1
- package/build/commonjs/Accordion/useVariantStyleMap.js +7 -4
- package/build/commonjs/Accordion/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js +1 -0
- package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
- package/build/commonjs/Checkbox/useVariantStyleMap.js +2 -1
- package/build/commonjs/Checkbox/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/Empty/Empty.js +1 -1
- package/build/commonjs/Empty/Empty.js.map +1 -1
- package/build/commonjs/ListItem/ListItem.js +2 -2
- package/build/commonjs/ListItem/ListItem.js.map +1 -1
- package/build/commonjs/ListItemText/ListItemText.js +2 -2
- package/build/commonjs/ListItemText/ListItemText.js.map +1 -1
- package/build/commonjs/ListSubheader/ListSubheader.js +1 -1
- package/build/commonjs/ListSubheader/ListSubheader.js.map +1 -1
- package/build/commonjs/Radio/Radio.js +5 -1
- package/build/commonjs/Radio/Radio.js.map +1 -1
- package/build/commonjs/SnackbarContent/SnackbarContent.js +24 -7
- package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
- package/build/commonjs/Tabs/Tabs.js +6 -1
- package/build/commonjs/Tabs/Tabs.js.map +1 -1
- package/build/commonjs/Tabs/useTabsStyle.js +39 -0
- package/build/commonjs/Tabs/useTabsStyle.js.map +1 -0
- package/build/commonjs/Tooltip/Tooltip.js +11 -18
- package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
- package/build/module/Accordion/Accordion.js +4 -1
- package/build/module/Accordion/Accordion.js.map +1 -1
- package/build/module/Accordion/useVariantStyleMap.js +7 -4
- package/build/module/Accordion/useVariantStyleMap.js.map +1 -1
- package/build/module/BottomSheetTitle/BottomSheetTitle.js +1 -0
- package/build/module/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
- package/build/module/Checkbox/useVariantStyleMap.js +2 -1
- package/build/module/Checkbox/useVariantStyleMap.js.map +1 -1
- package/build/module/Empty/Empty.js +1 -1
- package/build/module/Empty/Empty.js.map +1 -1
- package/build/module/ListItem/ListItem.js +2 -2
- package/build/module/ListItem/ListItem.js.map +1 -1
- package/build/module/ListItemText/ListItemText.js +2 -2
- package/build/module/ListItemText/ListItemText.js.map +1 -1
- package/build/module/ListSubheader/ListSubheader.js +1 -1
- package/build/module/ListSubheader/ListSubheader.js.map +1 -1
- package/build/module/Radio/Radio.js +4 -1
- package/build/module/Radio/Radio.js.map +1 -1
- package/build/module/SnackbarContent/SnackbarContent.js +24 -7
- package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
- package/build/module/Tabs/Tabs.js +5 -1
- package/build/module/Tabs/Tabs.js.map +1 -1
- package/build/module/Tabs/useTabsStyle.js +30 -0
- package/build/module/Tabs/useTabsStyle.js.map +1 -0
- package/build/module/Tooltip/Tooltip.js +4 -10
- package/build/module/Tooltip/Tooltip.js.map +1 -1
- package/build/typescript/Accordion/useVariantStyleMap.d.ts +1 -0
- package/build/typescript/Tabs/useTabsStyle.d.ts +7 -0
- package/package.json +3 -3
- package/src/Accordion/Accordion.tsx +4 -1
- package/src/Accordion/useVariantStyleMap.ts +8 -4
- package/src/BottomSheetTitle/BottomSheetTitle.tsx +1 -0
- package/src/Checkbox/useVariantStyleMap.ts +1 -0
- package/src/Empty/Empty.tsx +1 -1
- package/src/ListItem/ListItem.tsx +2 -2
- package/src/ListItemText/ListItemText.tsx +2 -2
- package/src/ListSubheader/ListSubheader.tsx +1 -1
- package/src/Radio/Radio.tsx +7 -1
- package/src/SnackbarContent/SnackbarContent.tsx +35 -14
- package/src/Tabs/Tabs.tsx +4 -0
- package/src/Tabs/useTabsStyle.ts +35 -0
- package/src/Tooltip/Tooltip.tsx +4 -9
|
@@ -75,6 +75,7 @@ function Accordion(props) {
|
|
|
75
75
|
container: containerStyle,
|
|
76
76
|
content: contentStyle,
|
|
77
77
|
contentFont: contentFontStyle,
|
|
78
|
+
iconContainer: iconContainerStyle,
|
|
78
79
|
subTitleFont: subTitleFontStyle,
|
|
79
80
|
title: titleStyle,
|
|
80
81
|
titleFont: titleFontStyle
|
|
@@ -126,7 +127,9 @@ function Accordion(props) {
|
|
|
126
127
|
flexShrink: 1
|
|
127
128
|
}, /*#__PURE__*/_react.default.createElement(_Row.default, {
|
|
128
129
|
alignItems: 'center'
|
|
129
|
-
}, LeftComponent ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
130
|
+
}, LeftComponent ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
131
|
+
style: iconContainerStyle
|
|
132
|
+
}, LeftComponent), /*#__PURE__*/_react.default.createElement(_Spacer.default, {
|
|
130
133
|
size: 1.5
|
|
131
134
|
})) : null, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
132
135
|
allowFontScaling: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ROTATE_HIDE_DEGREE","ROTATE_SHOW_DEGREE","ANIMATION_CONFIG","duration","INITIAL_EXPANDED_DELAY_MILLIS","CONTENT_OPACITY_DELAY_MILLIS","useStyles","theme","useTheme","root","marginBottom","spacing","rightIcon","alignItems","height","justifyContent","width","Accordion","props","title","subTitle","content","RightIcon","LeftComponent","isInitialExpanded","variant","styles","CONTENT_MARGIN_HEIGHT","isExpanded","setIsExpanded","useState","shouldInitialExpandedRef","useRef","container","containerStyle","contentStyle","contentFont","contentFontStyle","subTitleFont","subTitleFontStyle","titleStyle","titleFont","titleFontStyle","useVariantStyleMap","rotate","useSharedValue","animatedOpacity","animatedHeight","contentHeight","setContentHeight","animatedChevronDownStyles","useAnimatedStyle","transform","value","animatedContentBackgroundStyles","overflow","animatedContentStyle","opacity","onPress","prev","onLayout","event","nativeEvent","layout","current","setTimeout","useEffect","withTiming","withDelay","rootStyle","css"],"sources":["Accordion.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { LayoutChangeEvent, Text, View, ViewStyle } from 'react-native';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withTiming,\n WithTimingConfig,\n} from 'react-native-reanimated';\nimport { css, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { ChevronDown } from '../internal/icons';\nimport ButtonBase from '../ButtonBase';\nimport Column from '../Column';\nimport Row from '../Row';\nimport Spacer from '../Spacer';\nimport type AccordionProps from './AccordionProps';\nimport type { AccordionVariant } from './AccordionProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\ntype AccordionStyles = NamedStylesStringUnion<'root' | 'rightIcon'>;\n\nconst ROTATE_HIDE_DEGREE = 0;\nconst ROTATE_SHOW_DEGREE = 180;\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = { duration: 200 };\nconst INITIAL_EXPANDED_DELAY_MILLIS = 100;\nconst CONTENT_OPACITY_DELAY_MILLIS = 200;\n\nconst useStyles: UseStyles<AccordionStyles> = function (): AccordionStyles {\n const theme = useTheme();\n\n return {\n root: { marginBottom: theme.spacing(3) },\n rightIcon: {\n alignItems: 'center',\n height: 32,\n justifyContent: 'center',\n width: 32,\n },\n };\n};\n\nexport default function Accordion(props: AccordionProps) {\n const {\n title,\n subTitle,\n content,\n RightIcon,\n LeftComponent,\n isInitialExpanded = false,\n variant = 'solid' as AccordionVariant,\n } = props;\n\n const styles = useStyles();\n const theme = useTheme();\n const CONTENT_MARGIN_HEIGHT = theme.spacing(2);\n\n const [isExpanded, setIsExpanded] = useState<boolean>(false);\n const shouldInitialExpandedRef = useRef<boolean>(isInitialExpanded);\n\n const {\n container: containerStyle,\n content: contentStyle,\n contentFont: contentFontStyle,\n subTitleFont: subTitleFontStyle,\n title: titleStyle,\n titleFont: titleFontStyle,\n } = useVariantStyleMap(variant);\n\n const rotate = useSharedValue(ROTATE_HIDE_DEGREE);\n const animatedOpacity = useSharedValue(0);\n\n const animatedHeight = useSharedValue(0);\n const [contentHeight, setContentHeight] = useState(0);\n\n const animatedChevronDownStyles = useAnimatedStyle(() => ({\n transform: [{ rotate: `${rotate.value}deg` }],\n }), []);\n\n const animatedContentBackgroundStyles = useAnimatedStyle(() => ({\n height: animatedHeight.value,\n overflow: 'hidden',\n } as ViewStyle), []);\n\n const animatedContentStyle = useAnimatedStyle(() => ({\n opacity: animatedOpacity.value,\n }), []);\n\n const onPress = () => {\n setIsExpanded(prev => !prev);\n };\n\n const onLayout = (event: LayoutChangeEvent) => {\n const height = event.nativeEvent.layout.height + CONTENT_MARGIN_HEIGHT;\n setContentHeight(height);\n\n if (shouldInitialExpandedRef.current) {\n shouldInitialExpandedRef.current = false;\n setTimeout(() => setIsExpanded(true), INITIAL_EXPANDED_DELAY_MILLIS);\n }\n };\n\n useEffect(() => {\n rotate.value = withTiming(isExpanded ? ROTATE_SHOW_DEGREE : ROTATE_HIDE_DEGREE, ANIMATION_CONFIG);\n\n animatedHeight.value = withTiming(isExpanded ? contentHeight : 0, ANIMATION_CONFIG);\n\n animatedOpacity.value = isExpanded\n ? withDelay(CONTENT_OPACITY_DELAY_MILLIS, withTiming(1, ANIMATION_CONFIG))\n : withTiming(0, ANIMATION_CONFIG);\n }, [isExpanded, contentHeight]);\n\n const rootStyle = css([\n styles.root,\n containerStyle,\n ]);\n\n return (\n <Column style={rootStyle}>\n <ButtonBase onPress={onPress}>\n <Row style={titleStyle}>\n <Column flexShrink={1}>\n <Row alignItems={'center'}>\n {LeftComponent ? (\n <React.Fragment>\n {LeftComponent}\n\n <Spacer size={1.5}/>\n </React.Fragment>\n ) : null}\n\n <Text\n allowFontScaling={false}\n children={title}\n numberOfLines={1}\n style={titleFontStyle}\n />\n </Row>\n\n {subTitle && variant === 'solid' ?\n typeof subTitle === 'string' ? (\n <React.Fragment>\n <Spacer size={1.5}/>\n\n <Text\n allowFontScaling={false}\n children={subTitle}\n numberOfLines={1}\n style={subTitleFontStyle}\n />\n </React.Fragment>\n ) : (subTitle)\n : null}\n </Column>\n\n <Spacer flex={1}/>\n\n <Spacer size={3}/>\n\n <Animated.View style={animatedChevronDownStyles}>\n <View style={styles.rightIcon}>\n {RightIcon ? RightIcon : (\n <ChevronDown\n width={16}\n height={16}\n color={'base'}\n />\n )}\n </View>\n </Animated.View>\n </Row>\n </ButtonBase>\n\n <Animated.View style={animatedContentBackgroundStyles}>\n <View\n onLayout={onLayout}\n style={contentStyle}\n >\n <Animated.View style={animatedContentStyle}>\n {typeof content === 'string' ? (\n <Text\n allowFontScaling={false}\n children={content}\n style={contentFontStyle}\n />\n ) : (content)}\n </Animated.View>\n </View>\n </Animated.View>\n </Column>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;;;AAIA,MAAMA,kBAAkB,GAAG,CAA3B;AACA,MAAMC,kBAAkB,GAAG,GAA3B;AACA,MAAMC,gBAA4C,GAAG;EAAEC,QAAQ,EAAE;AAAZ,CAArD;AACA,MAAMC,6BAA6B,GAAG,GAAtC;AACA,MAAMC,4BAA4B,GAAG,GAArC;;AAEA,MAAMC,SAAqC,GAAG,YAA6B;EACvE,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MAAEC,YAAY,EAAEH,KAAK,CAACI,OAAN,CAAc,CAAd;IAAhB,CADH;IAEHC,SAAS,EAAE;MACPC,UAAU,EAAE,QADL;MAEPC,MAAM,EAAE,EAFD;MAGPC,cAAc,EAAE,QAHT;MAIPC,KAAK,EAAE;IAJA;EAFR,CAAP;AASH,CAZD;;AAce,SAASC,SAAT,CAAmBC,KAAnB,EAA0C;EACrD,MAAM;IACFC,KADE;IAEFC,QAFE;IAGFC,OAHE;IAIFC,SAJE;IAKFC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KAAK,EAAEzB;EAFX,gBAII,6BAAC,8BAAD,CAAU,IAAV;IAAe,KAAK,EAAEqB;EAAtB,GACK,OAAOnC,OAAP,KAAmB,QAAnB,gBACG,6BAAC,iBAAD;IACI,gBAAgB,EAAE,KADtB;IAEI,QAAQ,EAAEA,OAFd;IAGI,KAAK,EAAEgB;EAHX,EADH,GAMIhB,OAPT,CAJJ,CADJ,CAvDJ,CADJ;AA0EH"}
|
|
1
|
+
{"version":3,"names":["ROTATE_HIDE_DEGREE","ROTATE_SHOW_DEGREE","ANIMATION_CONFIG","duration","INITIAL_EXPANDED_DELAY_MILLIS","CONTENT_OPACITY_DELAY_MILLIS","useStyles","theme","useTheme","root","marginBottom","spacing","rightIcon","alignItems","height","justifyContent","width","Accordion","props","title","subTitle","content","RightIcon","LeftComponent","isInitialExpanded","variant","styles","CONTENT_MARGIN_HEIGHT","isExpanded","setIsExpanded","useState","shouldInitialExpandedRef","useRef","container","containerStyle","contentStyle","contentFont","contentFontStyle","iconContainer","iconContainerStyle","subTitleFont","subTitleFontStyle","titleStyle","titleFont","titleFontStyle","useVariantStyleMap","rotate","useSharedValue","animatedOpacity","animatedHeight","contentHeight","setContentHeight","animatedChevronDownStyles","useAnimatedStyle","transform","value","animatedContentBackgroundStyles","overflow","animatedContentStyle","opacity","onPress","prev","onLayout","event","nativeEvent","layout","current","setTimeout","useEffect","withTiming","withDelay","rootStyle","css"],"sources":["Accordion.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { LayoutChangeEvent, Text, View, ViewStyle } from 'react-native';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withTiming,\n WithTimingConfig,\n} from 'react-native-reanimated';\nimport { css, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { ChevronDown } from '../internal/icons';\nimport ButtonBase from '../ButtonBase';\nimport Column from '../Column';\nimport Row from '../Row';\nimport Spacer from '../Spacer';\nimport type AccordionProps from './AccordionProps';\nimport type { AccordionVariant } from './AccordionProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\ntype AccordionStyles = NamedStylesStringUnion<'root' | 'rightIcon'>;\n\nconst ROTATE_HIDE_DEGREE = 0;\nconst ROTATE_SHOW_DEGREE = 180;\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = { duration: 200 };\nconst INITIAL_EXPANDED_DELAY_MILLIS = 100;\nconst CONTENT_OPACITY_DELAY_MILLIS = 200;\n\nconst useStyles: UseStyles<AccordionStyles> = function (): AccordionStyles {\n const theme = useTheme();\n\n return {\n root: { marginBottom: theme.spacing(3) },\n rightIcon: {\n alignItems: 'center',\n height: 32,\n justifyContent: 'center',\n width: 32,\n },\n };\n};\n\nexport default function Accordion(props: AccordionProps) {\n const {\n title,\n subTitle,\n content,\n RightIcon,\n LeftComponent,\n isInitialExpanded = false,\n variant = 'solid' as AccordionVariant,\n } = props;\n\n const styles = useStyles();\n const theme = useTheme();\n const CONTENT_MARGIN_HEIGHT = theme.spacing(2);\n\n const [isExpanded, setIsExpanded] = useState<boolean>(false);\n const shouldInitialExpandedRef = useRef<boolean>(isInitialExpanded);\n\n const {\n container: containerStyle,\n content: contentStyle,\n contentFont: contentFontStyle,\n iconContainer: iconContainerStyle,\n subTitleFont: subTitleFontStyle,\n title: titleStyle,\n titleFont: titleFontStyle,\n } = useVariantStyleMap(variant);\n\n const rotate = useSharedValue(ROTATE_HIDE_DEGREE);\n const animatedOpacity = useSharedValue(0);\n\n const animatedHeight = useSharedValue(0);\n const [contentHeight, setContentHeight] = useState(0);\n\n const animatedChevronDownStyles = useAnimatedStyle(() => ({\n transform: [{ rotate: `${rotate.value}deg` }],\n }), []);\n\n const animatedContentBackgroundStyles = useAnimatedStyle(() => ({\n height: animatedHeight.value,\n overflow: 'hidden',\n } as ViewStyle), []);\n\n const animatedContentStyle = useAnimatedStyle(() => ({\n opacity: animatedOpacity.value,\n }), []);\n\n const onPress = () => {\n setIsExpanded(prev => !prev);\n };\n\n const onLayout = (event: LayoutChangeEvent) => {\n const height = event.nativeEvent.layout.height + CONTENT_MARGIN_HEIGHT;\n setContentHeight(height);\n\n if (shouldInitialExpandedRef.current) {\n shouldInitialExpandedRef.current = false;\n setTimeout(() => setIsExpanded(true), INITIAL_EXPANDED_DELAY_MILLIS);\n }\n };\n\n useEffect(() => {\n rotate.value = withTiming(isExpanded ? ROTATE_SHOW_DEGREE : ROTATE_HIDE_DEGREE, ANIMATION_CONFIG);\n\n animatedHeight.value = withTiming(isExpanded ? contentHeight : 0, ANIMATION_CONFIG);\n\n animatedOpacity.value = isExpanded\n ? withDelay(CONTENT_OPACITY_DELAY_MILLIS, withTiming(1, ANIMATION_CONFIG))\n : withTiming(0, ANIMATION_CONFIG);\n }, [isExpanded, contentHeight]);\n\n const rootStyle = css([\n styles.root,\n containerStyle,\n ]);\n\n return (\n <Column style={rootStyle}>\n <ButtonBase onPress={onPress}>\n <Row style={titleStyle}>\n <Column flexShrink={1}>\n <Row alignItems={'center'}>\n {LeftComponent ? (\n <React.Fragment>\n <View style={iconContainerStyle}>\n {LeftComponent}\n </View>\n\n <Spacer size={1.5}/>\n </React.Fragment>\n ) : null}\n\n <Text\n allowFontScaling={false}\n children={title}\n numberOfLines={1}\n style={titleFontStyle}\n />\n </Row>\n\n {subTitle && variant === 'solid' ?\n typeof subTitle === 'string' ? (\n <React.Fragment>\n <Spacer size={1.5}/>\n\n <Text\n allowFontScaling={false}\n children={subTitle}\n numberOfLines={1}\n style={subTitleFontStyle}\n />\n </React.Fragment>\n ) : (subTitle)\n : null}\n </Column>\n\n <Spacer flex={1}/>\n\n <Spacer size={3}/>\n\n <Animated.View style={animatedChevronDownStyles}>\n <View style={styles.rightIcon}>\n {RightIcon ? RightIcon : (\n <ChevronDown\n width={16}\n height={16}\n color={'base'}\n />\n )}\n </View>\n </Animated.View>\n </Row>\n </ButtonBase>\n\n <Animated.View style={animatedContentBackgroundStyles}>\n <View\n onLayout={onLayout}\n style={contentStyle}\n >\n <Animated.View style={animatedContentStyle}>\n {typeof content === 'string' ? (\n <Text\n allowFontScaling={false}\n children={content}\n style={contentFontStyle}\n />\n ) : (content)}\n </Animated.View>\n </View>\n </Animated.View>\n </Column>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;;;AAIA,MAAMA,kBAAkB,GAAG,CAA3B;AACA,MAAMC,kBAAkB,GAAG,GAA3B;AACA,MAAMC,gBAA4C,GAAG;EAAEC,QAAQ,EAAE;AAAZ,CAArD;AACA,MAAMC,6BAA6B,GAAG,GAAtC;AACA,MAAMC,4BAA4B,GAAG,GAArC;;AAEA,MAAMC,SAAqC,GAAG,YAA6B;EACvE,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MAAEC,YAAY,EAAEH,KAAK,CAACI,OAAN,CAAc,CAAd;IAAhB,CADH;IAEHC,SAAS,EAAE;MACPC,UAAU,EAAE,QADL;MAEPC,MAAM,EAAE,EAFD;MAGPC,cAAc,EAAE,QAHT;MAIPC,KAAK,EAAE;IAJA;EAFR,CAAP;AASH,CAZD;;AAce,SAASC,SAAT,CAAmBC,KAAnB,EAA0C;EACrD,MAAM;IACFC,KADE;IAEFC,QAFE;IAGFC,OAHE;IAIFC,SAJE;IAKFC,aALE;IAMFC,iBAAiB,GAAG,KANlB;IAOFC,OAAO,GAAG;EAPR,IAQFP,KARJ;EAUA,MAAMQ,MAAM,GAAGpB,SAAS,EAAxB;EACA,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EACA,MAAMmB,qBAAqB,GAAGpB,KAAK,CAACI,OAAN,CAAc,CAAd,CAA9B;EAEA,MAAM,CAACiB,UAAD,EAAaC,aAAb,IAA8B,IAAAC,eAAA,EAAkB,KAAlB,CAApC;EACA,MAAMC,wBAAwB,GAAG,IAAAC,aAAA,EAAgBR,iBAAhB,CAAjC;EAEA,MAA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StyleMap(variant) {
|
|
|
46
46
|
},
|
|
47
47
|
titleFont: (0, _styles2.createFontStyle)(theme, {
|
|
48
48
|
selector: _ => (0, _styles.typographyOf)({
|
|
49
|
-
fontSize:
|
|
50
|
-
lineHeight:
|
|
49
|
+
fontSize: 16,
|
|
50
|
+
lineHeight: 20.8,
|
|
51
51
|
fontFamily: 'PretendardStd-SemiBold',
|
|
52
52
|
letterSpacing: 0
|
|
53
53
|
}),
|
|
@@ -74,6 +74,9 @@ function useVariantStyleMap(variant) {
|
|
|
74
74
|
selector: typography => typography.caption2.regular,
|
|
75
75
|
color: theme.palette.text.base
|
|
76
76
|
}),
|
|
77
|
+
iconContainer: {
|
|
78
|
+
paddingTop: 1
|
|
79
|
+
},
|
|
77
80
|
title: {
|
|
78
81
|
alignItems: 'center',
|
|
79
82
|
paddingBottom: theme.spacing(1),
|
|
@@ -112,8 +115,8 @@ function useVariantStyleMap(variant) {
|
|
|
112
115
|
},
|
|
113
116
|
titleFont: (0, _styles2.createFontStyle)(theme, {
|
|
114
117
|
selector: _ => (0, _styles.typographyOf)({
|
|
115
|
-
fontSize:
|
|
116
|
-
lineHeight:
|
|
118
|
+
fontSize: 16,
|
|
119
|
+
lineHeight: 20.8,
|
|
117
120
|
fontFamily: 'PretendardStd-SemiBold',
|
|
118
121
|
letterSpacing: 0
|
|
119
122
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useVariantStyleMap","variant","theme","useTheme","useMemo","container","backgroundColor","palette","surface","supportive","borderRadius","shape","radius","md","content","borderTopColor","border","weak","borderTopWidth","marginHorizontal","spacing","paddingBottom","paddingTop","position","contentFont","createFontStyle","selector","typography","body3","regular","color","text","base","subTitleFont","caption1","title","alignItems","paddingLeft","paddingRight","paddingVertical","titleFont","_","typographyOf","fontSize","lineHeight","fontFamily","letterSpacing","strong","borderColor","borderWidth","caption2","caption1short","semiBold","borderBottomColor","borderBottomWidth"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { AccordionVariant } from './AccordionProps';\n\ninterface VariantStyle {\n container: FountainUiStyle;\n content: FountainUiStyle;\n contentFont: TextStyle;\n subTitleFont?: TextStyle;\n title: FountainUiStyle;\n titleFont: TextStyle;\n}\n\nexport default function useVariantStyleMap(variant: AccordionVariant): VariantStyle {\n const theme = useTheme();\n\n return useMemo(() => {\n switch (variant) {\n default:\n case 'solid':\n return {\n container: {\n backgroundColor: theme.palette.surface.supportive,\n borderRadius: theme.shape.radius.md,\n },\n content: {\n borderTopColor: theme.palette.border.weak,\n borderTopWidth: 0.5,\n marginHorizontal: theme.spacing(4),\n paddingBottom: theme.spacing(5),\n paddingTop: theme.spacing(4),\n position: 'absolute',\n },\n contentFont: createFontStyle(theme, {\n selector: (typography) => typography.body3.regular,\n color: theme.palette.text.base,\n }),\n subTitleFont: createFontStyle(theme, {\n selector: (typography) => typography.caption1.regular,\n color: theme.palette.text.base,\n }),\n title: {\n alignItems: 'center',\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(2),\n paddingVertical: theme.spacing(4),\n },\n titleFont: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 15,\n lineHeight: 19.5,\n fontFamily: 'PretendardStd-SemiBold',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strong,\n }),\n };\n case 'line':\n return {\n container: {\n borderColor: theme.palette.border.weak,\n borderRadius: theme.shape.radius.md,\n borderWidth: 1,\n },\n content: {\n borderTopColor: theme.palette.border.weak,\n borderTopWidth: 0.5,\n marginHorizontal: theme.spacing(4),\n paddingBottom: theme.spacing(4),\n paddingTop: theme.spacing(3),\n position: 'absolute',\n },\n contentFont: createFontStyle(theme, {\n selector: (typography) => typography.caption2.regular,\n color: theme.palette.text.base,\n }),\n title: {\n alignItems: 'center',\n paddingBottom: theme.spacing(1),\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(2),\n paddingTop: theme.spacing(0.75),\n },\n titleFont: createFontStyle(theme, {\n selector: (typography) => typography.caption1short.semiBold,\n color: theme.palette.text.base,\n }),\n };\n case 'underline':\n return {\n container: {\n borderBottomColor: theme.palette.border.weak,\n borderBottomWidth: 1,\n },\n content: {\n borderTopColor: theme.palette.border.weak,\n borderTopWidth: 0.5,\n paddingBottom: theme.spacing(5),\n paddingLeft: theme.spacing(0.5),\n paddingRight: theme.spacing(2),\n paddingTop: theme.spacing(4),\n },\n contentFont: createFontStyle(theme, {\n selector: (typography) => typography.body3.regular,\n color: theme.palette.text.base,\n }),\n title: {\n alignItems: 'center',\n paddingLeft: theme.spacing(0.5),\n paddingVertical: theme.spacing(2),\n },\n titleFont: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 15,\n lineHeight: 19.5,\n fontFamily: 'PretendardStd-SemiBold',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strong,\n }),\n };\n }\n }, [theme, variant]);\n}\n"],"mappings":";;;;;;;AAAA;;AAGA;;AACA;;AAYe,SAASA,kBAAT,CAA4BC,OAA5B,EAAqE;EAChF,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAQ,MAAM;IACjB,QAAQH,OAAR;MACI;MACA,KAAK,OAAL;QACI,OAAO;UACHI,SAAS,EAAE;YACPC,eAAe,EAAEJ,KAAK,CAACK,OAAN,CAAcC,OAAd,CAAsBC,UADhC;YAEPC,YAAY,EAAER,KAAK,CAACS,KAAN,CAAYC,MAAZ,CAAmBC;UAF1B,CADR;UAKHC,OAAO,EAAE;YACLC,cAAc,EAAEb,KAAK,CAACK,OAAN,CAAcS,MAAd,CAAqBC,IADhC;YAELC,cAAc,EAAE,GAFX;YAGLC,gBAAgB,EAAEjB,KAAK,CAACkB,OAAN,CAAc,CAAd,CAHb;YAILC,aAAa,EAAEnB,KAAK,CAACkB,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o","container","backgroundColor","palette","surface","supportive","borderRadius","shape","radius","md","content","borderTopColor","border","weak","borderTopWidth","marginHorizontal","spacing","paddingBottom","paddingTop","position","contentFont","createFontStyle","selector","typography","body3","regular","color","text","base","subTitleFont","caption1","title","alignItems","paddingLeft","paddingRight","paddingVertical","titleFont","_","typographyOf","fontSize","lineHeight","fontFamily","letterSpacing","strong","borderColor","borderWidth","caption2","iconContainer","caption1short","semiBold","borderBottomColor","borderBottomWidth"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { AccordionVariant } from './AccordionProps';\n\ninterface VariantStyle {\n container: FountainUiStyle;\n content: FountainUiStyle;\n contentFont: TextStyle;\n iconContainer?: FountainUiStyle;\n subTitleFont?: TextStyle;\n title: FountainUiStyle;\n titleFont: TextStyle;\n}\n\nexport default function useVariantStyleMap(variant: AccordionVariant): VariantStyle {\n const theme = useTheme();\n\n return useMemo(() => {\n switch (variant) {\n default:\n case 'solid':\n return {\n container: {\n backgroundColor: theme.palette.surface.supportive,\n borderRadius: theme.shape.radius.md,\n },\n content: {\n borderTopColor: theme.palette.border.weak,\n borderTopWidth: 0.5,\n marginHorizontal: theme.spacing(4),\n paddingBottom: theme.spacing(5),\n paddingTop: theme.spacing(4),\n position: 'absolute',\n },\n contentFont: createFontStyle(theme, {\n selector: (typography) => typography.body3.regular,\n color: theme.palette.text.base,\n }),\n subTitleFont: createFontStyle(theme, {\n selector: (typography) => typography.caption1.regular,\n color: theme.palette.text.base,\n }),\n title: {\n alignItems: 'center',\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(2),\n paddingVertical: theme.spacing(4),\n },\n titleFont: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 16,\n lineHeight: 20.8,\n fontFamily: 'PretendardStd-SemiBold',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strong,\n }),\n };\n case 'line':\n return {\n container: {\n borderColor: theme.palette.border.weak,\n borderRadius: theme.shape.radius.md,\n borderWidth: 1,\n },\n content: {\n borderTopColor: theme.palette.border.weak,\n borderTopWidth: 0.5,\n marginHorizontal: theme.spacing(4),\n paddingBottom: theme.spacing(4),\n paddingTop: theme.spacing(3),\n position: 'absolute',\n },\n contentFont: createFontStyle(theme, {\n selector: (typography) => typography.caption2.regular,\n color: theme.palette.text.base,\n }),\n iconContainer: {\n paddingTop: 1,\n },\n title: {\n alignItems: 'center',\n paddingBottom: theme.spacing(1),\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(2),\n paddingTop: theme.spacing(0.75),\n },\n titleFont: createFontStyle(theme, {\n selector: (typography) => typography.caption1short.semiBold,\n color: theme.palette.text.base,\n }),\n };\n case 'underline':\n return {\n container: {\n borderBottomColor: theme.palette.border.weak,\n borderBottomWidth: 1,\n },\n content: {\n borderTopColor: theme.palette.border.weak,\n borderTopWidth: 0.5,\n paddingBottom: theme.spacing(5),\n paddingLeft: theme.spacing(0.5),\n paddingRight: theme.spacing(2),\n paddingTop: theme.spacing(4),\n },\n contentFont: createFontStyle(theme, {\n selector: (typography) => typography.body3.regular,\n color: theme.palette.text.base,\n }),\n title: {\n alignItems: 'center',\n paddingLeft: theme.spacing(0.5),\n paddingVertical: theme.spacing(2),\n },\n titleFont: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 16,\n lineHeight: 20.8,\n fontFamily: 'PretendardStd-SemiBold',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strong,\n }),\n };\n }\n }, [theme, variant]);\n}\n"],"mappings":";;;;;;;AAAA;;AAGA;;AACA;;AAae,SAASA,kBAAT,CAA4BC,OAA5B,EAAqE;EAChF,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAQ,MAAM;IACjB,QAAQH,OAAR;MACI;MACA,KAAK,OA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A,EAAgBvB,KAAhB,EAAuB;YAC9BwB,QAAQ,EAAGe,CAAD,IAAO,IAAAC,oBAAA,EAAa;cAC1BC,QAAQ,EAAE,EADgB;cAE1BC,UAAU,EAAE,IAFc;cAG1BC,UAAU,EAAE,wBAHc;cAI1BC,aAAa,EAAE;YAJW,CAAb,CADa;YAO9BhB,KAAK,EAAE5B,KAAK,CAACK,OAAN,CAAcwB,IAAd,CAAmBgB;UAPI,CAAvB;QAtBR,CAAP;IA3ER;EA4GH,CA7GM,EA6GJ,CAAC7C,KAAD,EAAQD,OAAR,CA7GI,CAAP;AA8GH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","theme","useTheme","root","alignItems","gap","spacing","justifyContent","marginBottom","paddingHorizontal","title","paddingBottom","paddingTop","actionButton","BottomSheetTitle","props","actionButtonProps","children","style","styleProp","otherProps","styles","rootStyle","css","titleFontStyle","createFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle","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: 'center',\n gap: theme.spacing(8),\n justifyContent: 'space-between',\n marginBottom: theme.spacing(4),\n paddingHorizontal: theme.spacing(6),\n },\n title: {\n paddingBottom: theme.spacing(1.25),\n paddingTop: theme.spacing(1),\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 disableMinWidth={true}\n onPress={actionButtonProps.onPress}\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,QADV;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,aAAa,EAAEV,KAAK,CAACK,OAAN,CAAc,IAAd,CADZ;MAEHM,UAAU,EAAEX,KAAK,CAACK,OAAN,CAAc,CAAd;IAFT,CARJ;IAYHO,YAAY,EAAE;MACVF,aAAa,EAAEV,KAAK,CAACK,OAAN,CAAc,IAAd,CADL;MAEVG,iBAAiB,EAAE,CAFT;MAGVG,UAAU,EAAEX,KAAK,CAACK,OAAN,CAAc,IAAd;IAHF;EAZX,CAAP;AAkBH,CArBD;;AAuBe,SAASQ,gBAAT,CAA0BC,KAA1B,EAAwD;EACnE,MAAM;IACFC,iBADE;IAEFC,QAFE;IAGFC,KAAK,EAAEC,SAHL;IAIF,GAAGC;EAJD,IAKFL,KALJ;EAOA,MAAMd,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAMmB,MAAM,GAAGrB,SAAS,EAAxB;EAEA,MAAMsB,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBF,MAAM,CAAClB,IADW,EAElBgB,SAFkB,CAAJ,CAAlB;EAKA,MAAMK,cAAc,GAAG,IAAAC,uBAAA,EAAgBxB,KAAhB,EAAuB;IAC1CyB,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,OAAX,CAAmBC,QADH;IAE1CC,KAAK,EAAE7B,KAAK,CAAC8B,OAAN,CAAcC,IAAd,CAAmBC;EAFgB,CAAvB,CAAvB;EAKA,MAAMC,UAAU,GAAG,IAAAX,WAAA,EAAI,CACnBF,MAAM,CAACX,KADY,EAEnBc,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,CAACN,KADhC;IAEI,KAAK,EAAE,QAFX;IAGI,eAAe,EAAE,IAHrB;IAII,OAAO,EAAEM,iBAAiB,CAACmB,OAJ/B;IAKI,KAAK,EAAEd,MAAM,CAACR,
|
|
1
|
+
{"version":3,"names":["useStyles","theme","useTheme","root","alignItems","gap","spacing","justifyContent","marginBottom","paddingHorizontal","title","paddingBottom","paddingTop","actionButton","BottomSheetTitle","props","actionButtonProps","children","style","styleProp","otherProps","styles","rootStyle","css","titleFontStyle","createFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle","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: 'center',\n gap: theme.spacing(8),\n justifyContent: 'space-between',\n marginBottom: theme.spacing(4),\n paddingHorizontal: theme.spacing(6),\n },\n title: {\n paddingBottom: theme.spacing(1.25),\n paddingTop: theme.spacing(1),\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 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,QADV;MAEFC,GAAG,EAAEJ,KAAK,CAACK,OAAN,CAAc,CAAd,CAFH;MAGF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EiB;EAFX,EAJJ,EASKlB,iBAAiB,gBACd,6BAAC,eAAD;IACI,QAAQ,EAAEA,iBAAiB,CAACN,KADhC;IAEI,KAAK,EAAE,QAFX;IAGI,eAAe,EAAE,IAHrB;IAII,OAAO,EAAEM,iBAAiB,CAACmB,OAJ/B;IAKI,IAAI,EAAE,OALV;IAMI,KAAK,EAAEd,MAAM,CAACR,YANlB;IAOI,OAAO,EAAE;EAPb,EADc,GAUd,IAnBR,CADJ;AAuBH"}
|
|
@@ -38,7 +38,8 @@ function useVariantStyleMap(variant, checked) {
|
|
|
38
38
|
containerStyle: {
|
|
39
39
|
alignItems: 'center',
|
|
40
40
|
flexDirection: 'row',
|
|
41
|
-
gap: theme.spacing(3)
|
|
41
|
+
gap: theme.spacing(3),
|
|
42
|
+
paddingVertical: theme.spacing(2)
|
|
42
43
|
},
|
|
43
44
|
iconColor: theme.palette.fill.baseAlt
|
|
44
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["styles","StyleSheet","create","checkbox","alignItems","borderWidth","justifyContent","useVariantStyleMap","variant","checked","theme","useTheme","checkboxStyle","css","borderColor","palette","border","base","borderRadius","shape","radius","xs","height","width","backgroundColor","fill","containerStyle","flexDirection","gap","spacing","iconColor","baseAlt","full","accent","borderBottomColor","weak","borderBottomWidth","
|
|
1
|
+
{"version":3,"names":["styles","StyleSheet","create","checkbox","alignItems","borderWidth","justifyContent","useVariantStyleMap","variant","checked","theme","useTheme","checkboxStyle","css","borderColor","palette","border","base","borderRadius","shape","radius","xs","height","width","backgroundColor","fill","containerStyle","flexDirection","gap","spacing","paddingVertical","iconColor","baseAlt","full","accent","borderBottomColor","weak","borderBottomWidth","commonColors","static","strongInverse"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport { commonColors, FountainUiStyle } from '@fountain-ui/styles';\nimport { css, useTheme } from '../styles';\nimport type { CheckboxVariant } from './CheckboxProps';\n\nconst styles = StyleSheet.create({\n checkbox: {\n alignItems: 'center',\n borderWidth: 1,\n justifyContent: 'center',\n },\n});\n\ntype useVariantStyleMapReturns = {\n checkboxStyle?: FountainUiStyle;\n containerStyle?: FountainUiStyle;\n iconColor?: string;\n};\n\nexport default function useVariantStyleMap(variant: CheckboxVariant, checked: boolean): useVariantStyleMapReturns {\n const theme = useTheme();\n\n switch (variant) {\n case 'square':\n return {\n checkboxStyle: css([\n styles.checkbox,\n {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.xs,\n height: 18,\n width: 18,\n ...(checked ? {\n backgroundColor: theme.palette.fill.base,\n borderColor: theme.palette.fill.base,\n } : {}),\n },\n ]),\n containerStyle: {\n alignItems: 'center',\n flexDirection: 'row',\n gap: theme.spacing(3),\n paddingVertical: theme.spacing(2),\n },\n iconColor: theme.palette.fill.baseAlt,\n };\n case 'round':\n return {\n checkboxStyle: css([\n styles.checkbox,\n {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.full,\n height: 20,\n width: 20,\n ...(checked ? {\n backgroundColor: theme.palette.fill.accent,\n borderColor: theme.palette.fill.accent,\n } : {}),\n },\n ]),\n containerStyle: {\n alignItems: 'center',\n borderBottomColor: theme.palette.border.weak,\n borderBottomWidth: 0.5,\n flexDirection: 'row-reverse',\n gap: theme.spacing(8),\n paddingVertical: theme.spacing(3.5),\n },\n iconColor: commonColors.static.strongInverse,\n };\n default:\n return {};\n }\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAGA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC7BC,QAAQ,EAAE;IACNC,UAAU,EAAE,QADN;IAENC,WAAW,EAAE,CAFP;IAGNC,cAAc,EAAE;EAHV;AADmB,CAAlB,CAAf;;AAce,SAASC,kBAAT,CAA4BC,OAA5B,EAAsDC,OAAtD,EAAmG;EAC9G,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;;EAEA,QAAQH,OAAR;IACI,KAAK,QAAL;MACI,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,EAAE;UACZtB,UAAU,EAAE,QADA;UAEZ+B,iBAAiB,EAAEzB,KAAK,CAACK,OAAN,CAAcC,MAAd,CAAqBoB,IAF5B;UAGZC,iBAAiB,EAAE,GAHP;UAIZV,aAAa,EAAE,aAJH;UAKZC,GAAG,EAAElB,KAAK,CAACmB,OAAN,CAAc,CAAd,CALO;UAMZC,eAAe,EAAEpB,KAAK,CAACmB,OAAN,CAAc,GAAd;QANL,CAdb;QAsBHE,SAAS,EAAEO,oBAAA,CAAaC,MAAb,CAAoBC;MAtB5B,CAAP;;IAwBJ;MACI,OAAO,EAAP;EAlDR;AAoDH"}
|
|
@@ -57,7 +57,7 @@ function Empty(props) {
|
|
|
57
57
|
color: theme.palette.text.strong
|
|
58
58
|
});
|
|
59
59
|
const descriptionFontStyle = (0, _styles.createFontStyle)(theme, {
|
|
60
|
-
selector: typography => typography.
|
|
60
|
+
selector: typography => typography.body3.regular,
|
|
61
61
|
color: theme.palette.text.base
|
|
62
62
|
});
|
|
63
63
|
return /*#__PURE__*/_react.default.createElement(_Column.default, _extends({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","theme","useTheme","root","alignItems","flex","justifyContent","paddingHorizontal","spacing","cta","alignSelf","Empty","props","buttonTitle","description","headerContent","headerContentProp","onButtonPress","style","styleProp","title","otherProps","styles","rootStyle","css","cloneElementSafely","titleFontStyle","createFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","descriptionFontStyle","
|
|
1
|
+
{"version":3,"names":["useStyles","theme","useTheme","root","alignItems","flex","justifyContent","paddingHorizontal","spacing","cta","alignSelf","Empty","props","buttonTitle","description","headerContent","headerContentProp","onButtonPress","style","styleProp","title","otherProps","styles","rootStyle","css","cloneElementSafely","titleFontStyle","createFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","descriptionFontStyle","body3","regular","base"],"sources":["Empty.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport Button from '../Button/Button';\nimport Column from '../Column';\nimport Spacer from '../Spacer';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type { FalsyReactElement } from '../utils';\nimport { cloneElementSafely } from '../utils';\nimport type EmptyProps from './EmptyProps';\n\ntype EmptyStyles = NamedStylesStringUnion<'root' | 'cta'>;\n\nconst useStyles: UseStyles<EmptyStyles> = function (): EmptyStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'center',\n flex: 1,\n justifyContent: 'center',\n paddingHorizontal: theme.spacing(5),\n },\n cta: {\n alignSelf: 'center',\n },\n };\n};\n\nexport default function Empty(props: EmptyProps) {\n const {\n buttonTitle,\n description,\n headerContent: headerContentProp,\n onButtonPress,\n style: styleProp,\n title,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const theme = useTheme();\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n const headerContent = cloneElementSafely(headerContentProp as FalsyReactElement);\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.header3.semiBold,\n color: theme.palette.text.strong,\n });\n\n const descriptionFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.body3.regular,\n color: theme.palette.text.base,\n });\n\n return (\n <Column\n style={rootStyle}\n {...otherProps}\n >\n {headerContent ? (\n <React.Fragment>\n {headerContent}\n\n <Spacer size={6}/>\n </React.Fragment>\n ) : null}\n\n <Text\n children={title}\n style={titleFontStyle}\n />\n\n {description ? (\n <React.Fragment>\n <Spacer size={2}/>\n\n <Text\n children={description}\n style={descriptionFontStyle}\n />\n </React.Fragment>\n ) : null}\n\n {buttonTitle && onButtonPress ? (\n <React.Fragment>\n <Spacer size={6}/>\n\n <Button\n children={buttonTitle}\n color={'accent'}\n onPress={onButtonPress}\n style={styles.cta}\n variant={'capsuleSolid'}\n />\n </React.Fragment>\n ) : null}\n </Column>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAEA;;;;;;A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,EAAEhB;EADX,GAEQF,UAFR,GAIKN,aAAa,gBACV,6BAAC,cAAD,CAAO,QAAP,QACKA,aADL,eAGI,6BAAC,eAAD;IAAQ,IAAI,EAAE;EAAd,EAHJ,CADU,GAMV,IAVR,eAYI,6BAAC,iBAAD;IACI,QAAQ,EAAEK,KADd;IAEI,KAAK,EAAEM;EAFX,EAZJ,EAiBKZ,WAAW,gBACR,6BAAC,cAAD,CAAO,QAAP,qBACI,6BAAC,eAAD;IAAQ,IAAI,EAAE;EAAd,EADJ,eAGI,6BAAC,iBAAD;IACI,QAAQ,EAAEA,WADd;IAEI,KAAK,EAAEsB;EAFX,EAHJ,CADQ,GASR,IA1BR,EA4BKvB,WAAW,IAAII,aAAf,gBACG,6BAAC,cAAD,CAAO,QAAP,qBACI,6BAAC,eAAD;IAAQ,IAAI,EAAE;EAAd,EADJ,eAGI,6BAAC,eAAD;IACI,QAAQ,EAAEJ,WADd;IAEI,KAAK,EAAE,QAFX;IAGI,OAAO,EAAEI,aAHb;IAII,KAAK,EAAEK,MAAM,CAACb,GAJlB;IAKI,OAAO,EAAE;EALb,EAHJ,CADH,GAYG,IAxCR,CADJ;AA4CH"}
|
|
@@ -61,8 +61,8 @@ function ListItem(props) {
|
|
|
61
61
|
const contentWrapperStyle = (0, _styles2.css)([styles.content, style]);
|
|
62
62
|
const descriptionFontStyle = (0, _styles2.createFontStyle)(theme, {
|
|
63
63
|
selector: _ => (0, _styles.typographyOf)({
|
|
64
|
-
fontSize:
|
|
65
|
-
lineHeight:
|
|
64
|
+
fontSize: 14,
|
|
65
|
+
lineHeight: 19.6,
|
|
66
66
|
fontFamily: 'PretendardStd-Regular',
|
|
67
67
|
letterSpacing: 0
|
|
68
68
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","theme","useTheme","content","gap","spacing","paddingVertical","paddingHorizontal","width","description","paddingRight","divider","borderBottomColor","palette","border","weak","borderBottomWidth","dividerWrapper","ListItem","props","alignItems","button","children","disabled","onPress","style","otherProps","styles","rootComponentProps","accessibilityRole","Platform","OS","undefined","contentWrapperStyle","css","descriptionFontStyle","createFontStyle","selector","_","typographyOf","fontSize","lineHeight","fontFamily","letterSpacing","color","text","base"],"sources":["ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport type { FlexStyle } from 'react-native';\nimport { Platform, Text, View } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type ListItemProps from './ListItemProps';\n\ntype ListItemStyles = NamedStylesStringUnion<'content' | 'description' | 'divider' | 'dividerWrapper'>;\n\nconst useStyles: UseStyles<ListItemStyles> = function (): ListItemStyles {\n const theme = useTheme();\n\n return {\n content: {\n gap: theme.spacing(2),\n paddingVertical: theme.spacing(3.75),\n paddingHorizontal: theme.spacing(4),\n width: '100%',\n },\n description: {\n paddingRight: theme.spacing(20),\n },\n divider: {\n borderBottomColor: theme.palette.border.weak,\n borderBottomWidth: 0.5,\n },\n dividerWrapper: {\n paddingHorizontal: theme.spacing(4),\n },\n };\n};\n\nexport default function ListItem(props: ListItemProps) {\n const {\n alignItems = 'center' as FlexStyle['alignItems'],\n button = false,\n children,\n description,\n disabled = false,\n onPress,\n style,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const rootComponentProps = {\n accessibilityRole: Platform.OS === 'web' ? 'listitem' : undefined,\n ...otherProps,\n };\n\n const contentWrapperStyle = css([\n styles.content,\n style,\n ]);\n\n const descriptionFontStyle = createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize:
|
|
1
|
+
{"version":3,"names":["useStyles","theme","useTheme","content","gap","spacing","paddingVertical","paddingHorizontal","width","description","paddingRight","divider","borderBottomColor","palette","border","weak","borderBottomWidth","dividerWrapper","ListItem","props","alignItems","button","children","disabled","onPress","style","otherProps","styles","rootComponentProps","accessibilityRole","Platform","OS","undefined","contentWrapperStyle","css","descriptionFontStyle","createFontStyle","selector","_","typographyOf","fontSize","lineHeight","fontFamily","letterSpacing","color","text","base"],"sources":["ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport type { FlexStyle } from 'react-native';\nimport { Platform, Text, View } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type ListItemProps from './ListItemProps';\n\ntype ListItemStyles = NamedStylesStringUnion<'content' | 'description' | 'divider' | 'dividerWrapper'>;\n\nconst useStyles: UseStyles<ListItemStyles> = function (): ListItemStyles {\n const theme = useTheme();\n\n return {\n content: {\n gap: theme.spacing(2),\n paddingVertical: theme.spacing(3.75),\n paddingHorizontal: theme.spacing(4),\n width: '100%',\n },\n description: {\n paddingRight: theme.spacing(20),\n },\n divider: {\n borderBottomColor: theme.palette.border.weak,\n borderBottomWidth: 0.5,\n },\n dividerWrapper: {\n paddingHorizontal: theme.spacing(4),\n },\n };\n};\n\nexport default function ListItem(props: ListItemProps) {\n const {\n alignItems = 'center' as FlexStyle['alignItems'],\n button = false,\n children,\n description,\n disabled = false,\n onPress,\n style,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const rootComponentProps = {\n accessibilityRole: Platform.OS === 'web' ? 'listitem' : undefined,\n ...otherProps,\n };\n\n const contentWrapperStyle = css([\n styles.content,\n style,\n ]);\n\n const descriptionFontStyle = createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 14,\n lineHeight: 19.6,\n fontFamily: 'PretendardStd-Regular',\n letterSpacing: 0,\n }),\n color: theme.palette.text.base,\n });\n\n const content = (\n <React.Fragment>\n <Row alignItems={alignItems}>\n {children}\n </Row>\n\n {description ? (\n <Text style={css([\n styles.description,\n descriptionFontStyle,\n ])}>\n {description}\n </Text>\n ) : null}\n </React.Fragment>\n );\n\n return (\n // @ts-ignore\n <View {...rootComponentProps}>\n {button ? (\n <ButtonBase\n disabled={disabled}\n onPress={onPress}\n style={contentWrapperStyle}\n >\n {content}\n </ButtonBase>\n ) : (\n <View style={contentWrapperStyle}>\n {content}\n </View>\n )}\n\n <View style={styles.dividerWrapper}>\n <View style={styles.divider}/>\n </View>\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;;;AAKA,MAAMA,SAAoC,GAAG,YAA4B;EACrE,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO;IACHC,OAAO,EAAE;MACLC,GAAG,EAAEH,KAAK,CAACI,OAAN,CAAc,CAAd,CADA;MAELC,eAAe,EAAEL,KAAK,CAACI,OAAN,CAAc,IAAd,CAFZ;MAGLE,iBAAiB,EAAEN,KAAK,CAACI,OAAN,CAAc,CAAd,CAHd;MAILG,KAAK,EAAE;IAJF,CADN;IAOHC,WAAW,EAAE;MACTC,YAAY,EAAET,KAAK,CAACI,OAAN,CAAc,EAAd;IADL,CAPV;IAUHM,OAAO,EAAE;MACLC,iBAAiB,EAAEX,KAAK,CAACY,OAAN,CAAcC,MAAd,CAAqBC,IADnC;MAELC,iBAAiB,EAAE;IAFd,CAVN;IAcHC,cAAc,EAAE;MACZV,iBAAiB,EAAEN,KAAK,CAACI,OAAN,CAAc,CAAd;IADP;EAdb,CAAP;AAkBH,CArBD;;AAuBe,SAASa,QAAT,CAAkBC,KAAlB,EAAwC;EACnD,MAAM;IACFC,UAAU,GAAG,QADX;IAEFC,MAAM,GAAG,KAFP;IAGFC,QAHE;IAIFb,WAJE;IAKFc,QAAQ,GAAG,KALT;IAMFC,OANE;IAOFC,KAPE;IAQF,GAAGC;EARD,IASFP,KATJ;EAWA,MAAMlB,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,MAAMyB,MAAM,GAAG3B,SAAS,EAAxB;EAEA,MAAM4B,k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AAAA"}
|
|
@@ -38,8 +38,8 @@ function ListItemText(props) {
|
|
|
38
38
|
const styles = useStyles();
|
|
39
39
|
const fontStyle = (0, _styles2.createFontStyle)(theme, {
|
|
40
40
|
selector: _ => (0, _styles.typographyOf)({
|
|
41
|
-
fontSize:
|
|
42
|
-
lineHeight:
|
|
41
|
+
fontSize: 16,
|
|
42
|
+
lineHeight: 19.2,
|
|
43
43
|
fontFamily: 'PretendardStd-Medium',
|
|
44
44
|
letterSpacing: 0
|
|
45
45
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","root","flexGrow","flexShrink","ListItemText","props","children","style","otherProps","theme","useTheme","styles","fontStyle","createFontStyle","selector","_","typographyOf","fontSize","lineHeight","fontFamily","letterSpacing","color","palette","text","strong","css"],"sources":["ListItemText.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport Column from '../Column';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type ListItemTextProps from './ListItemTextProps';\n\ntype ListItemTextStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: UseStyles<ListItemTextStyles> = function (): ListItemTextStyles {\n return {\n root: {\n flexGrow: 1,\n flexShrink: 1,\n },\n };\n};\n\nexport default function ListItemText(props: ListItemTextProps) {\n const {\n children,\n style,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const fontStyle = createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize:
|
|
1
|
+
{"version":3,"names":["useStyles","root","flexGrow","flexShrink","ListItemText","props","children","style","otherProps","theme","useTheme","styles","fontStyle","createFontStyle","selector","_","typographyOf","fontSize","lineHeight","fontFamily","letterSpacing","color","palette","text","strong","css"],"sources":["ListItemText.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport Column from '../Column';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type ListItemTextProps from './ListItemTextProps';\n\ntype ListItemTextStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: UseStyles<ListItemTextStyles> = function (): ListItemTextStyles {\n return {\n root: {\n flexGrow: 1,\n flexShrink: 1,\n },\n };\n};\n\nexport default function ListItemText(props: ListItemTextProps) {\n const {\n children,\n style,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const fontStyle = createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 16,\n lineHeight: 19.2,\n fontFamily: 'PretendardStd-Medium',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strong,\n });\n\n return (\n <Column\n style={css([\n styles.root,\n style,\n ])}\n {...otherProps}\n >\n <Text style={fontStyle}>\n {children}\n </Text>\n </Column>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAKA,MAAMA,SAAwC,GAAG,YAAgC;EAC7E,OAAO;IACHC,IAAI,EAAE;MACFC,QAAQ,EAAE,CADR;MAEFC,UAAU,EAAE;IAFV;EADH,CAAP;AAMH,CAPD;;AASe,SAASC,YAAT,CAAsBC,KAAtB,EAAgD;EAC3D,MAAM;IACFC,QADE;IAEFC,KAFE;IAGF,GAAGC;EAHD,IAIFH,KAJJ;EAMA,MAAMI,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,MAAMC,MAAM,GAAGX,SAAS,EAAxB;EAEA,MAAMY,SAAS,GAAG,IAAAC,wBAAA,EAAgBJ,KAAhB,EAAuB;IACrCK,QAAQ,EAAGC,CAAD,IAAO,IAAAC,oBAAA,EAAa;MAC1BC,QAAQ,EAAE,EADgB;MAE1BC,UAAU,EAAE,IAFc;MAG1BC,UAAU,EAAE,sBAHc;MAI1BC,aAAa,EAAE;IAJW,CAAb,CADoB;IAOrCC,KAAK,EAAEZ,KAAK,CAACa,OAAN,CAAcC,IAAd,CAAmBC;EAPW,CAAvB,CAAlB;EAUA,oBACI,6BAAC,eAAD;IACI,KAAK,EAAE,IAAAC,YAAA,EAAI,CACPd,MAAM,CAACV,IADA,EAEPM,KAFO,CAAJ;EADX,GAKQC,UALR,gBAOI,6BAAC,iBAAD;IAAM,KAAK,EAAEI;EAAb,GACKN,QADL,CAPJ,CADJ;AAaH;;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ListSubheader","props","children","disableTypography","otherProps","accessibilityRole","Platform","OS","undefined","EdgeInsets","horizontal"],"sources":["ListSubheader.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform } from 'react-native';\nimport Row from '../Row';\nimport Typography from '../Typography';\nimport { EdgeInsets } from '../styles';\nimport type ListSubheaderProps from './ListSubheaderProps';\n\nexport default function ListSubheader(props: ListSubheaderProps) {\n const {\n children,\n disableTypography = false,\n ...otherProps\n } = props;\n\n const accessibilityRole = Platform.OS === 'web' ? 'listitem' : undefined;\n\n return (\n <Row\n // @ts-ignore\n accessibilityRole={accessibilityRole}\n insets={EdgeInsets.horizontal(4)}\n {...otherProps}\n >\n {disableTypography ? (\n children\n ) : (\n <Typography\n children={children}\n color={'strong'}\n variant={'
|
|
1
|
+
{"version":3,"names":["ListSubheader","props","children","disableTypography","otherProps","accessibilityRole","Platform","OS","undefined","EdgeInsets","horizontal"],"sources":["ListSubheader.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform } from 'react-native';\nimport Row from '../Row';\nimport Typography from '../Typography';\nimport { EdgeInsets } from '../styles';\nimport type ListSubheaderProps from './ListSubheaderProps';\n\nexport default function ListSubheader(props: ListSubheaderProps) {\n const {\n children,\n disableTypography = false,\n ...otherProps\n } = props;\n\n const accessibilityRole = Platform.OS === 'web' ? 'listitem' : undefined;\n\n return (\n <Row\n // @ts-ignore\n accessibilityRole={accessibilityRole}\n insets={EdgeInsets.horizontal(4)}\n {...otherProps}\n >\n {disableTypography ? (\n children\n ) : (\n <Typography\n children={children}\n color={'strong'}\n variant={'caption2'}\n />\n )}\n </Row>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAGe,SAASA,aAAT,CAAuBC,KAAvB,EAAkD;EAC7D,MAAM;IACFC,QADE;IAEFC,iBAAiB,GAAG,KAFlB;IAGF,GAAGC;EAHD,IAIFH,KAJJ;EAMA,MAAMI,iBAAiB,GAAGC,qBAAA,CAASC,EAAT,KAAgB,KAAhB,GAAwB,UAAxB,GAAqCC,SAA/D;EAEA,oBACI,6BAAC,YAAD,CACI;EADJ;IAEI,iBAAiB,EAAEH,iBAFvB;IAGI,MAAM,EAAEI,kBAAA,CAAWC,UAAX,CAAsB,CAAtB;EAHZ,GAIQN,UAJR,GAMKD,iBAAiB,GACdD,QADc,gBAGd,6BAAC,mBAAD;IACI,QAAQ,EAAEA,QADd;IAEI,KAAK,EAAE,QAFX;IAGI,OAAO,EAAE;EAHb,EATR,CADJ;AAkBH;;AAAA"}
|
|
@@ -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 DEFAULT_START_ICON_SIZE = 21;
|
|
33
|
+
|
|
32
34
|
const useStyles = function () {
|
|
33
35
|
const theme = (0, _styles.useTheme)();
|
|
34
36
|
return {
|
|
@@ -78,7 +80,9 @@ function Radio(props) {
|
|
|
78
80
|
const checkedIcon = checkIconProp ?? defaultCheckedIcon;
|
|
79
81
|
const icon = isChecked ? checkedIcon : null;
|
|
80
82
|
const startIcon = (0, _utils.cloneElementSafely)(startIconProp, {
|
|
81
|
-
color: 'strong'
|
|
83
|
+
color: 'strong',
|
|
84
|
+
height: DEFAULT_START_ICON_SIZE,
|
|
85
|
+
width: DEFAULT_START_ICON_SIZE
|
|
82
86
|
});
|
|
83
87
|
const rootStyle = (0, _styles.css)([styles.root, style]);
|
|
84
88
|
const fontStyle = (0, _styles.createFontStyle)(theme, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","theme","useTheme","root","alignItems","flexDirection","gap","spacing","justifyContent","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","rootStyle","css","fontStyle","createFontStyle","selector","typography","body1","regular","palette","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\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 flexDirection: 'row',\n gap: theme.spacing(8),\n justifyContent: 'space-between',\n },\n content: {\n gap: theme.spacing(2),\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, {
|
|
1
|
+
{"version":3,"names":["DEFAULT_START_ICON_SIZE","useStyles","theme","useTheme","root","alignItems","flexDirection","gap","spacing","justifyContent","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","palette","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 flexDirection: 'row',\n gap: theme.spacing(8),\n justifyContent: 'space-between',\n },\n content: {\n gap: theme.spacing(2),\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 alignItems={'center'}\n style={styles.content}\n >\n {startIcon}\n\n <Text\n children={children}\n style={fontStyle}\n />\n </Row>\n\n {icon}\n </ButtonBase>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAGA,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,aAAa,EAAE,KAFb;MAGFC,GAAG,EAAEL,KAAK,CAACM,OAAN,CAAc,CAAd,CAHH;MAIFC,cAAc,EAAE;IAJd,CADH;IAOHC,OAAO,EAAE;MACLH,GAAG,EAAEL,KAAK,CAACM,OAAN,CAAc,CAAd,CADA;MAELG,SAAS,EAAE;IAFN;EAPN,CAAP;AAYH,CAfD;;AAiBe,SAASC,KAAT,CAAeC,KAAf,EAAkC;EAC7C,MAAM;IACFC,OAAO,GAAG,KADR;IAEFC,QAFE;IAGFC,WAAW,EAAEC,aAHX;IAIFC,QAAQ,GAAG,KAJT;IAKFC,QAAQ,EAAEC,YALR;IAMFC,SAAS,EAAEC,aANT;IAOFC,KAPE;IAQFC,KAR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B,QADd;IAEI,OAAO,EAAEY,WAFb;IAGI,KAAK,EAAEQ;EAHX,GAIQb,UAJR,gBAMI,6BAAC,YAAD;IACI,UAAU,EAAE,QADhB;IAEI,KAAK,EAAEC,MAAM,CAAChB;EAFlB,GAIKW,SAJL,eAMI,6BAAC,iBAAD;IACI,QAAQ,EAAEN,QADd;IAEI,KAAK,EAAEyB;EAFX,EANJ,CANJ,EAkBKP,IAlBL,CADJ;AAsBH;;AAAA"}
|
|
@@ -43,6 +43,14 @@ const useStyles = function () {
|
|
|
43
43
|
},
|
|
44
44
|
actionButton: {
|
|
45
45
|
marginLeft: theme.spacing(6)
|
|
46
|
+
},
|
|
47
|
+
actionLabel: {
|
|
48
|
+
paddingBottom: theme.spacing(1.5),
|
|
49
|
+
paddingTop: theme.spacing(1.25)
|
|
50
|
+
},
|
|
51
|
+
actionElement: {
|
|
52
|
+
paddingLeft: theme.spacing(2),
|
|
53
|
+
paddingVertical: theme.spacing(1.25)
|
|
46
54
|
}
|
|
47
55
|
};
|
|
48
56
|
};
|
|
@@ -62,17 +70,22 @@ function SnackbarContent(props) {
|
|
|
62
70
|
const theme = (0, _styles2.useTheme)();
|
|
63
71
|
const titleFontStyle = (0, _styles2.createFontStyle)(theme, {
|
|
64
72
|
selector: _ => (0, _styles.typographyOf)({
|
|
65
|
-
fontSize:
|
|
66
|
-
lineHeight:
|
|
73
|
+
fontSize: 15,
|
|
74
|
+
lineHeight: 19.5,
|
|
67
75
|
fontFamily: 'PretendardStd-SemiBold',
|
|
68
76
|
letterSpacing: 0
|
|
69
77
|
}),
|
|
70
78
|
color: theme.palette.text.strongInverse
|
|
71
79
|
});
|
|
72
80
|
const messageFontStyle = (0, _styles2.createFontStyle)(theme, {
|
|
73
|
-
selector: _ => (0, _styles.typographyOf)({
|
|
74
|
-
fontSize:
|
|
75
|
-
lineHeight:
|
|
81
|
+
selector: _ => title ? (0, _styles.typographyOf)({
|
|
82
|
+
fontSize: 12,
|
|
83
|
+
lineHeight: 15.6,
|
|
84
|
+
fontFamily: 'PretendardStd-Regular',
|
|
85
|
+
letterSpacing: 0
|
|
86
|
+
}) : (0, _styles.typographyOf)({
|
|
87
|
+
fontSize: 14,
|
|
88
|
+
lineHeight: 18.2,
|
|
76
89
|
fontFamily: 'PretendardStd-Regular',
|
|
77
90
|
letterSpacing: 0
|
|
78
91
|
}),
|
|
@@ -113,10 +126,14 @@ function SnackbarContent(props) {
|
|
|
113
126
|
flex: 1
|
|
114
127
|
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
115
128
|
style: styles.actionButton
|
|
116
|
-
}, typeof actionContent === 'string' ? /*#__PURE__*/_react.default.createElement(_reactNative.
|
|
129
|
+
}, typeof actionContent === 'string' ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
130
|
+
style: styles.actionLabel
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
117
132
|
children: actionContent,
|
|
118
133
|
style: labelFontStyle
|
|
119
|
-
}) :
|
|
134
|
+
})) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
135
|
+
style: styles.actionElement
|
|
136
|
+
}, actionContent))) : null);
|
|
120
137
|
}
|
|
121
138
|
|
|
122
139
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","theme","useTheme","root","flexDirection","alignItems","alignSelf","backgroundColor","palette","surface","accent","borderRadius","maxWidth","paddingBottom","spacing","paddingHorizontal","paddingTop","actionButton","marginLeft","SnackbarContent","props","actionContent","message","title","onPress","style","styleProp","status","startIcon","otherProps","styles","titleFontStyle","createFontStyle","selector","_","typographyOf","fontSize","lineHeight","fontFamily","letterSpacing","color","text","strongInverse","messageFontStyle","labelFontStyle","hasActionButton","rootStyle","css","shape","radius","xl","undefined","width"],"sources":["SnackbarContent.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { typographyOf } from '@fountain-ui/styles';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport ButtonBase from '../ButtonBase/ButtonBase';\nimport Column from '../Column';\nimport Spacer from '../Spacer';\nimport Typography from '../Typography';\nimport type SnackbarContentProps from './SnackbarContentProps';\nimport StatusIcon from './StatusIcon';\n\ntype SnackBarContentStyles = NamedStylesStringUnion<'root' | 'actionButton'>;\n\nconst useStyles: UseStyles<SnackBarContentStyles> = function (): SnackBarContentStyles {\n const theme = useTheme();\n\n return {\n root: {\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: 'center',\n backgroundColor: theme.palette.surface.accent,\n borderRadius: 22,\n maxWidth: 400,\n paddingBottom: theme.spacing(2.25),\n paddingHorizontal: theme.spacing(4),\n paddingTop: theme.spacing(2),\n },\n actionButton: {\n marginLeft: theme.spacing(6),\n },\n };\n};\n\nexport default function SnackbarContent(props: SnackbarContentProps) {\n const {\n actionContent,\n message,\n title,\n onPress,\n style: styleProp,\n status = 'info',\n startIcon,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const theme = useTheme();\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize:
|
|
1
|
+
{"version":3,"names":["useStyles","theme","useTheme","root","flexDirection","alignItems","alignSelf","backgroundColor","palette","surface","accent","borderRadius","maxWidth","paddingBottom","spacing","paddingHorizontal","paddingTop","actionButton","marginLeft","actionLabel","actionElement","paddingLeft","paddingVertical","SnackbarContent","props","actionContent","message","title","onPress","style","styleProp","status","startIcon","otherProps","styles","titleFontStyle","createFontStyle","selector","_","typographyOf","fontSize","lineHeight","fontFamily","letterSpacing","color","text","strongInverse","messageFontStyle","labelFontStyle","hasActionButton","rootStyle","css","shape","radius","xl","undefined","width"],"sources":["SnackbarContent.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { typographyOf } from '@fountain-ui/styles';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport ButtonBase from '../ButtonBase/ButtonBase';\nimport Column from '../Column';\nimport Spacer from '../Spacer';\nimport Typography from '../Typography';\nimport type SnackbarContentProps from './SnackbarContentProps';\nimport StatusIcon from './StatusIcon';\n\ntype SnackBarContentStyles = NamedStylesStringUnion<'root' | 'actionButton' | 'actionLabel' | 'actionElement'>;\n\nconst useStyles: UseStyles<SnackBarContentStyles> = function (): SnackBarContentStyles {\n const theme = useTheme();\n\n return {\n root: {\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: 'center',\n backgroundColor: theme.palette.surface.accent,\n borderRadius: 22,\n maxWidth: 400,\n paddingBottom: theme.spacing(2.25),\n paddingHorizontal: theme.spacing(4),\n paddingTop: theme.spacing(2),\n },\n actionButton: {\n marginLeft: theme.spacing(6),\n },\n actionLabel: {\n paddingBottom: theme.spacing(1.5),\n paddingTop: theme.spacing(1.25),\n },\n actionElement: {\n paddingLeft: theme.spacing(2),\n paddingVertical: theme.spacing(1.25),\n },\n };\n};\n\nexport default function SnackbarContent(props: SnackbarContentProps) {\n const {\n actionContent,\n message,\n title,\n onPress,\n style: styleProp,\n status = 'info',\n startIcon,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const theme = useTheme();\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 15,\n lineHeight: 19.5,\n fontFamily: 'PretendardStd-SemiBold',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strongInverse,\n });\n\n const messageFontStyle = createFontStyle(theme, {\n selector: (_) => title\n ? typographyOf({\n fontSize: 12,\n lineHeight: 15.6,\n fontFamily: 'PretendardStd-Regular',\n letterSpacing: 0,\n })\n : typographyOf({\n fontSize: 14,\n lineHeight: 18.2,\n fontFamily: 'PretendardStd-Regular',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strongInverse,\n });\n\n const labelFontStyle = createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 13,\n lineHeight: 16.25,\n fontFamily: 'LexendDeca-SemiBold',\n letterSpacing: -0.26,\n }),\n color: theme.palette.text.accent,\n });\n\n const hasActionButton = !!(actionContent && onPress);\n\n const rootStyle = css([\n styles.root,\n startIcon ? { borderRadius: theme.shape.radius.xl } : undefined,\n hasActionButton ? { width: '100%' } : undefined,\n styleProp,\n ]);\n\n return (\n <ButtonBase\n disabled={!onPress}\n onPress={onPress}\n style={rootStyle}\n {...otherProps}\n >\n {startIcon ? (\n <React.Fragment>\n {startIcon}\n\n <Spacer size={3}/>\n </React.Fragment>\n ) : status !== 'info' ? (\n <React.Fragment>\n <StatusIcon status={status}/>\n\n <Spacer size={1.5}/>\n </React.Fragment>\n ) : null}\n\n <Column>\n {title ? (\n <Typography\n children={title}\n style={css([titleFontStyle])}\n />\n ) : null}\n\n <Text\n children={message}\n style={css([messageFontStyle])}\n />\n </Column>\n\n {actionContent ? (\n <React.Fragment>\n <Spacer flex={1}/>\n\n <View style={styles.actionButton}>\n {typeof actionContent === 'string' ? (\n <View style={styles.actionLabel}>\n <Text\n children={actionContent}\n style={labelFontStyle}\n />\n </View>\n ) : (\n <View style={styles.actionElement}>\n {actionContent}\n </View>\n )}\n </View>\n </React.Fragment>\n ) : null}\n </ButtonBase>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAIA,MAAMA,SAA2C,GAAG,YAAmC;EACnF,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,aAAa,EAAE,KADb;MAEFC,UAAU,EAAE,QAFV;MAGFC,SAAS,EAAE,QAHT;MAIFC,eAAe,EAAEN,KAAK,CAACO,OAAN,CAAcC,OAAd,CAAsBC,MAJrC;MAKFC,YAAY,EAAE,EALZ;MAMFC,QAAQ,EAAE,GANR;MAOFC,aAAa,EAAEZ,KAAK,CAACa,OAAN,CAAc,IAAd,CAPb;MAQFC,iBAAiB,EAAEd,KAAK,CAACa,OAAN,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M,GAMND,MAAM,KAAK,MAAX,gBACA,6BAAC,cAAD,CAAO,QAAP,qBACI,6BAAC,mBAAD;IAAY,MAAM,EAAEA;EAApB,EADJ,eAGI,6BAAC,eAAD;IAAQ,IAAI,EAAE;EAAd,EAHJ,CADA,GAMA,IAlBR,eAoBI,6BAAC,eAAD,QACKJ,KAAK,gBACF,6BAAC,mBAAD;IACI,QAAQ,EAAEA,KADd;IAEI,KAAK,EAAE,IAAAwB,YAAA,EAAI,CAAChB,cAAD,CAAJ;EAFX,EADE,GAKF,IANR,eAQI,6BAAC,iBAAD;IACI,QAAQ,EAAET,OADd;IAEI,KAAK,EAAE,IAAAyB,YAAA,EAAI,CAACJ,gBAAD,CAAJ;EAFX,EARJ,CApBJ,EAkCKtB,aAAa,gBACV,6BAAC,cAAD,CAAO,QAAP,qBACI,6BAAC,eAAD;IAAQ,IAAI,EAAE;EAAd,EADJ,eAGI,6BAAC,iBAAD;IAAM,KAAK,EAAES,MAAM,CAACjB;EAApB,GACK,OAAOQ,aAAP,KAAyB,QAAzB,gBACG,6BAAC,iBAAD;IAAM,KAAK,EAAES,MAAM,CAACf;EAApB,gBACI,6BAAC,iBAAD;IACI,QAAQ,EAAEM,aADd;IAEI,KAAK,EAAEuB;EAFX,EADJ,CADH,gBAQG,6BAAC,iBAAD;IAAM,KAAK,EAAEd,MAAM,CAACd;EAApB,GACKK,aADL,CATR,CAHJ,CADU,GAmBV,IArDR,CADJ;AAyDH;;AAAA"}
|
|
@@ -29,6 +29,8 @@ var _InternalContext = _interopRequireDefault(require("./InternalContext"));
|
|
|
29
29
|
|
|
30
30
|
var _utils = require("./utils");
|
|
31
31
|
|
|
32
|
+
var _useTabsStyle = _interopRequireDefault(require("./useTabsStyle"));
|
|
33
|
+
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
34
36
|
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); }
|
|
@@ -81,6 +83,9 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)(function Tabs(props, ref) {
|
|
|
81
83
|
const sharedIndex = UNSTABLE_sharedIndex ?? fallbackSharedIndex;
|
|
82
84
|
const realInitialIndex = sharedIndex.initialValue;
|
|
83
85
|
const currentIndexRef = (0, _react.useRef)(initialIndex);
|
|
86
|
+
const {
|
|
87
|
+
container: containerStyle
|
|
88
|
+
} = (0, _useTabsStyle.default)(variant);
|
|
84
89
|
|
|
85
90
|
const setTab = newIndex => {
|
|
86
91
|
const currentIndex = currentIndexRef.current;
|
|
@@ -195,7 +200,7 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)(function Tabs(props, ref) {
|
|
|
195
200
|
indexStore
|
|
196
201
|
}
|
|
197
202
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
198
|
-
style: (0, _styles.css)([styles.root, {
|
|
203
|
+
style: (0, _styles.css)([styles.root, containerStyle, {
|
|
199
204
|
backgroundColor: backgroundColorMap[color]
|
|
200
205
|
}, showDivider ? styles.bottomDivider : undefined, scrollable ? undefined : styles.fixedRoot, style])
|
|
201
206
|
}, scrollable ? /*#__PURE__*/_react.default.createElement(_ScrollableTabsView.default, {
|