@fountain-ui/core 3.0.0-alpha.23 → 3.0.0-alpha.24

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.
@@ -38,7 +38,8 @@ function Chip(props) {
38
38
  } = props;
39
39
  const {
40
40
  container: containerStyle,
41
- closeButton: closeButtonStyle,
41
+ closeButtonContainer: closeButtonContainerStyle,
42
+ closeIconSize,
42
43
  label: labelStyle,
43
44
  startElement: startElementStyle,
44
45
  startElementContainer: startElementContainerStyle
@@ -59,9 +60,12 @@ function Chip(props) {
59
60
  children: children,
60
61
  numberOfLines: numberOfLines,
61
62
  style: labelStyle
62
- }), selected ? /*#__PURE__*/_react.default.createElement(_internal.Close, {
63
+ }), selected ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
64
+ style: closeButtonContainerStyle
65
+ }, /*#__PURE__*/_react.default.createElement(_internal.ChipClose, {
63
66
  color: 'baseInverse',
64
- style: closeButtonStyle
65
- }) : null);
67
+ height: closeIconSize === null || closeIconSize === void 0 ? void 0 : closeIconSize.height,
68
+ width: closeIconSize === null || closeIconSize === void 0 ? void 0 : closeIconSize.width
69
+ })) : null);
66
70
  }
67
71
  //# sourceMappingURL=Chip.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Chip","props","children","color","numberOfLines","onPress","selected","size","startElement","startElementProp","startElementVariant","style","styleProp","otherProps","container","containerStyle","closeButton","closeButtonStyle","label","labelStyle","startElementStyle","startElementContainer","startElementContainerStyle","useChipStyle","chipStyle","css","cloneElementSafely"],"sources":["Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { Close } from '../internal';\nimport { css } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type ChipProps from './ChipProps';\nimport type { ChipColor, ChipSize } from './ChipProps';\nimport useChipStyle from './useChipStyle';\n\nexport default function Chip(props: ChipProps) {\n const {\n children,\n color = 'default' as ChipColor,\n numberOfLines,\n onPress,\n selected = false,\n size = 'small' as ChipSize,\n startElement: startElementProp,\n startElementVariant = 'default',\n style: styleProp,\n ...otherProps\n } = props;\n\n const {\n container: containerStyle,\n closeButton: closeButtonStyle,\n label: labelStyle,\n startElement: startElementStyle,\n startElementContainer: startElementContainerStyle,\n } = useChipStyle(size, startElementVariant, color, selected);\n\n const chipStyle = css([\n containerStyle,\n styleProp,\n ]);\n\n const startElement = (\n <View style={startElementContainerStyle}>\n {cloneElementSafely(startElementProp, { style: startElementStyle })}\n </View>\n );\n\n return (\n <ButtonBase\n disabled={!onPress}\n onPress={onPress}\n style={chipStyle}\n {...otherProps}\n >\n {startElement}\n\n <Text\n children={children}\n numberOfLines={numberOfLines}\n style={labelStyle}\n />\n\n {selected ? (\n <Close\n color={'baseInverse'}\n style={closeButtonStyle}\n />\n ) : null}\n </ButtonBase>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;AAEe,SAASA,IAAT,CAAcC,KAAd,EAAgC;EAC3C,MAAM;IACFC,QADE;IAEFC,KAAK,GAAG,SAFN;IAGFC,aAHE;IAIFC,OAJE;IAKFC,QAAQ,GAAG,KALT;IAMFC,IAAI,GAAG,OANL;IAOFC,YAAY,EAAEC,gBAPZ;IAQFC,mBAAmB,GAAG,SARpB;IASFC,KAAK,EAAEC,SATL;IAUF,GAAGC;EAVD,IAWFZ,KAXJ;EAaA,MAAM;IACFa,SAAS,EAAEC,cADT;IAEFC,WAAW,EAAEC,gBAFX;IAGFC,KAAK,EAAEC,UAHL;IAIFX,YAAY,EAAEY,iBAJZ;IAKFC,qBAAqB,EAAEC;EALrB,IAMF,IAAAC,qBAAA,EAAahB,IAAb,EAAmBG,mBAAnB,EAAwCP,KAAxC,EAA+CG,QAA/C,CANJ;EAQA,MAAMkB,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBV,cADkB,EAElBH,SAFkB,CAAJ,CAAlB;;EAKA,MAAMJ,YAAY,gBACd,6BAAC,iBAAD;IAAM,KAAK,EAAEc;EAAb,GACK,IAAAI,yBAAA,EAAmBjB,gBAAnB,EAAqC;IAAEE,KAAK,EAAES;EAAT,CAArC,CADL,CADJ;;EAMA,oBACI,6BAAC,mBAAD;IACI,QAAQ,EAAE,CAACf,OADf;IAEI,OAAO,EAAEA,OAFb;IAGI,KAAK,EAAEmB;EAHX,GAIQX,UAJR,GAMKL,YANL,eAQI,6BAAC,iBAAD;IACI,QAAQ,EAAEN,QADd;IAEI,aAAa,EAAEE,aAFnB;IAGI,KAAK,EAAEe;EAHX,EARJ,EAcKb,QAAQ,gBACL,6BAAC,eAAD;IACI,KAAK,EAAE,aADX;IAEI,KAAK,EAAEW;EAFX,EADK,GAKL,IAnBR,CADJ;AAuBH"}
1
+ {"version":3,"names":["Chip","props","children","color","numberOfLines","onPress","selected","size","startElement","startElementProp","startElementVariant","style","styleProp","otherProps","container","containerStyle","closeButtonContainer","closeButtonContainerStyle","closeIconSize","label","labelStyle","startElementStyle","startElementContainer","startElementContainerStyle","useChipStyle","chipStyle","css","cloneElementSafely","height","width"],"sources":["Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { ChipClose } from '../internal';\nimport { css } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type ChipProps from './ChipProps';\nimport type { ChipColor, ChipSize } from './ChipProps';\nimport useChipStyle from './useChipStyle';\n\nexport default function Chip(props: ChipProps) {\n const {\n children,\n color = 'default' as ChipColor,\n numberOfLines,\n onPress,\n selected = false,\n size = 'small' as ChipSize,\n startElement: startElementProp,\n startElementVariant = 'default',\n style: styleProp,\n ...otherProps\n } = props;\n\n const {\n container: containerStyle,\n closeButtonContainer: closeButtonContainerStyle,\n closeIconSize,\n label: labelStyle,\n startElement: startElementStyle,\n startElementContainer: startElementContainerStyle,\n } = useChipStyle(size, startElementVariant, color, selected);\n\n const chipStyle = css([\n containerStyle,\n styleProp,\n ]);\n\n const startElement = (\n <View style={startElementContainerStyle}>\n {cloneElementSafely(startElementProp, { style: startElementStyle })}\n </View>\n );\n\n return (\n <ButtonBase\n disabled={!onPress}\n onPress={onPress}\n style={chipStyle}\n {...otherProps}\n >\n {startElement}\n\n <Text\n children={children}\n numberOfLines={numberOfLines}\n style={labelStyle}\n />\n\n {selected ? (\n <View style={closeButtonContainerStyle}>\n <ChipClose\n color={'baseInverse'}\n height={closeIconSize?.height}\n width={closeIconSize?.width}\n />\n </View>\n ) : null}\n </ButtonBase>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;AAEe,SAASA,IAAT,CAAcC,KAAd,EAAgC;EAC3C,MAAM;IACFC,QADE;IAEFC,KAAK,GAAG,SAFN;IAGFC,aAHE;IAIFC,OAJE;IAKFC,QAAQ,GAAG,KALT;IAMFC,IAAI,GAAG,OANL;IAOFC,YAAY,EAAEC,gBAPZ;IAQFC,mBAAmB,GAAG,SARpB;IASFC,KAAK,EAAEC,SATL;IAUF,GAAGC;EAVD,IAWFZ,KAXJ;EAaA,MAAM;IACFa,SAAS,EAAEC,cADT;IAEFC,oBAAoB,EAAEC,yBAFpB;IAGFC,aAHE;IAIFC,KAAK,EAAEC,UAJL;IAKFZ,YAAY,EAAEa,iBALZ;IAMFC,qBAAqB,EAAEC;EANrB,IAOF,IAAAC,qBAAA,EAAajB,IAAb,EAAmBG,mBAAnB,EAAwCP,KAAxC,EAA+CG,QAA/C,CAPJ;EASA,MAAMmB,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBX,cADkB,EAElBH,SAFkB,CAAJ,CAAlB;;EAKA,MAAMJ,YAAY,gBACd,6BAAC,iBAAD;IAAM,KAAK,EAAEe;EAAb,GACK,IAAAI,yBAAA,EAAmBlB,gBAAnB,EAAqC;IAAEE,KAAK,EAAEU;EAAT,CAArC,CADL,CADJ;;EAMA,oBACI,6BAAC,mBAAD;IACI,QAAQ,EAAE,CAAChB,OADf;IAEI,OAAO,EAAEA,OAFb;IAGI,KAAK,EAAEoB;EAHX,GAIQZ,UAJR,GAMKL,YANL,eAQI,6BAAC,iBAAD;IACI,QAAQ,EAAEN,QADd;IAEI,aAAa,EAAEE,aAFnB;IAGI,KAAK,EAAEgB;EAHX,EARJ,EAcKd,QAAQ,gBACL,6BAAC,iBAAD;IAAM,KAAK,EAAEW;EAAb,gBACI,6BAAC,mBAAD;IACI,KAAK,EAAE,aADX;IAEI,MAAM,EAAEC,aAAF,aAAEA,aAAF,uBAAEA,aAAa,CAAEU,MAF3B;IAGI,KAAK,EAAEV,aAAF,aAAEA,aAAF,uBAAEA,aAAa,CAAEW;EAH1B,EADJ,CADK,GAQL,IAtBR,CADJ;AA0BH"}
@@ -9,7 +9,27 @@ var _react = require("react");
9
9
 
10
10
  var _styles = require("../styles");
11
11
 
12
- // TODO: need to refactoring...
12
+ const closeButtonContainerStyleMap = {
13
+ small: {
14
+ marginLeft: 8,
15
+ paddingTop: 1
16
+ },
17
+ large: {
18
+ marginLeft: 10,
19
+ paddingTop: 1
20
+ }
21
+ };
22
+ const closeIconSize = {
23
+ small: {
24
+ height: 14,
25
+ width: 8.17
26
+ },
27
+ large: {
28
+ height: 16,
29
+ width: 9
30
+ }
31
+ }; // TODO: need to refactoring...
32
+
13
33
  function useChipStyle(size, startElementVariant, color, selected) {
14
34
  const theme = (0, _styles.useTheme)();
15
35
  return (0, _react.useMemo)(() => {
@@ -25,18 +45,6 @@ function useChipStyle(size, startElementVariant, color, selected) {
25
45
  color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong
26
46
  })
27
47
  };
28
- const closeButtonStyleMap = {
29
- small: {
30
- height: 14,
31
- marginLeft: theme.spacing(2),
32
- width: 8.17
33
- },
34
- large: {
35
- height: 17,
36
- marginLeft: theme.spacing(2.5),
37
- width: 9
38
- }
39
- };
40
48
  const baseContainerStyle = {
41
49
  alignItems: 'center',
42
50
  backgroundColor: selected ? theme.palette.fill.base : color === 'white' ? theme.palette.surface.base : theme.palette.fill.weaker,
@@ -97,7 +105,8 @@ function useChipStyle(size, startElementVariant, color, selected) {
97
105
  default: {
98
106
  container: {
99
107
  paddingBottom: theme.spacing(1.75),
100
- paddingHorizontal: theme.spacing(isLarge ? 3.5 : 3),
108
+ paddingLeft: theme.spacing(isLarge ? 3.5 : 3),
109
+ paddingRight: theme.spacing(isLarge ? 3.5 : 3),
101
110
  paddingTop: theme.spacing(1.5)
102
111
  }
103
112
  }
@@ -109,7 +118,8 @@ function useChipStyle(size, startElementVariant, color, selected) {
109
118
  paddingRight: theme.spacing(isLarge ? 2.5 : 2.25)
110
119
  } : {})
111
120
  },
112
- closeButton: closeButtonStyleMap[size],
121
+ closeButtonContainer: closeButtonContainerStyleMap[size],
122
+ closeIconSize: closeIconSize[size],
113
123
  label: fontStyleMap[size],
114
124
  startElement: (_variantStyleMap$star2 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star2 === void 0 ? void 0 : _variantStyleMap$star2.startElement,
115
125
  startElementContainer: (_variantStyleMap$star3 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star3 === void 0 ? void 0 : _variantStyleMap$star3.startElementContainer
@@ -1 +1 @@
1
- {"version":3,"names":["useChipStyle","size","startElementVariant","color","selected","theme","useTheme","useMemo","fontStyleMap","small","createFontStyle","selector","typography","caption1","medium","palette","text","strongInverse","strong","large","body2","closeButtonStyleMap","height","marginLeft","spacing","width","baseContainerStyle","alignItems","backgroundColor","fill","base","surface","weaker","borderRadius","shape","radius","full","flexDirection","overflow","isLarge","variantStyleMap","avatar","container","paddingLeft","paddingRight","paddingVertical","startElement","startElementContainer","marginRight","icon","justifyContent","image","default","paddingBottom","paddingHorizontal","paddingTop","closeButton","label"],"sources":["useChipStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { ChipColor, ChipSize, ChipStartElementVariant } from './ChipProps';\n\ninterface ChipStyle {\n container: FountainUiStyle;\n closeButton?: FountainUiStyle;\n label: TextStyle;\n startElement?: FountainUiStyle;\n startElementContainer?: FountainUiStyle;\n}\n\ntype VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;\n\n// TODO: need to refactoring...\nexport default function useChipStyle(\n size: ChipSize,\n startElementVariant: ChipStartElementVariant,\n color: ChipColor,\n selected: boolean,\n): ChipStyle {\n const theme = useTheme();\n\n return useMemo<ChipStyle>(() => {\n const fontStyleMap: Record<ChipSize, TextStyle> = {\n small: createFontStyle(theme, {\n selector: (typography) => typography.caption1.medium,\n color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,\n }),\n large: createFontStyle(theme, {\n selector: (typography) => typography.body2.medium,\n color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,\n }),\n };\n\n const closeButtonStyleMap: Record<ChipSize, FountainUiStyle> = {\n small: {\n height: 14,\n marginLeft: theme.spacing(2),\n width: 8.17,\n },\n large: {\n height: 17,\n marginLeft: theme.spacing(2.5),\n width: 9,\n },\n };\n\n const baseContainerStyle: FountainUiStyle = {\n alignItems: 'center',\n backgroundColor: selected ? theme.palette.fill.base\n : color === 'white'\n ? theme.palette.surface.base\n : theme.palette.fill.weaker,\n borderRadius: theme.shape.radius.full,\n flexDirection: 'row',\n overflow: 'hidden',\n };\n\n const isLarge = size === 'large';\n\n const variantStyleMap: VariantStyleMap = {\n avatar: {\n container: {\n paddingLeft: theme.spacing(isLarge ? 1.5 : 1.25),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.25 : 1),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 26 : 23,\n width: isLarge ? 26 : 23,\n },\n startElementContainer: {\n marginRight: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n },\n icon: {\n container: {\n paddingLeft: theme.spacing(1.5),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n startElement: {\n color: selected\n ? theme.palette.icon.strongInverse\n : theme.palette.icon.strong,\n height: isLarge ? 17 : 16,\n width: isLarge ? 17 : 16,\n },\n startElementContainer: {\n alignItems: 'center',\n height: isLarge ? 24 : 21,\n justifyContent: 'center',\n marginRight: theme.spacing(isLarge ? 1 : 0.75),\n width: isLarge ? 24 : 21,\n },\n },\n image: {\n container: {\n alignItems: 'center',\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 36 : 31,\n width: isLarge ? 48 : 40,\n },\n startElementContainer: {\n marginRight: theme.spacing(1.5),\n },\n },\n default: {\n container: {\n paddingBottom: theme.spacing(1.75),\n paddingHorizontal: theme.spacing(isLarge ? 3.5 : 3),\n paddingTop: theme.spacing(1.5),\n },\n },\n };\n\n return {\n container: {\n ...baseContainerStyle,\n ...variantStyleMap[startElementVariant]?.container,\n ...(selected ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),\n },\n closeButton: closeButtonStyleMap[size],\n label: fontStyleMap[size],\n startElement: variantStyleMap[startElementVariant]?.startElement,\n startElementContainer: variantStyleMap[startElementVariant]?.startElementContainer,\n };\n }, [theme, size, startElementVariant, color, selected]);\n}\n"],"mappings":";;;;;;;AAAA;;AAGA;;AAaA;AACe,SAASA,YAAT,CACXC,IADW,EAEXC,mBAFW,EAGXC,KAHW,EAIXC,QAJW,EAKF;EACT,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAmB,MAAM;IAAA;;IAC5B,MAAMC,YAAyC,GAAG;MAC9CC,KAAK,EAAE,IAAAC,uBAAA,EAAgBL,KAAhB,EAAuB;QAC1BM,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,QAAX,CAAoBC,MADpB;QAE1BX,KAAK,EAAEC,QAAQ,GAAGC,KAAK,CAACU,OAAN,CAAcC,IA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,CAACtC,mBAAD,CAAjB,2DAAE,uBAAsC4C,YARjD;MASHC,qBAAqB,4BAAEP,eAAe,CAACtC,mBAAD,CAAjB,2DAAE,uBAAsC6C;IAT1D,CAAP;EAWH,CA7GM,EA6GJ,CAAC1C,KAAD,EAAQJ,IAAR,EAAcC,mBAAd,EAAmCC,KAAnC,EAA0CC,QAA1C,CA7GI,CAAP;AA8GH"}
1
+ {"version":3,"names":["closeButtonContainerStyleMap","small","marginLeft","paddingTop","large","closeIconSize","height","width","useChipStyle","size","startElementVariant","color","selected","theme","useTheme","useMemo","fontStyleMap","createFontStyle","selector","typography","caption1","medium","palette","text","strongInverse","strong","body2","baseContainerStyle","alignItems","backgroundColor","fill","base","surface","weaker","borderRadius","shape","radius","full","flexDirection","overflow","isLarge","variantStyleMap","avatar","container","paddingLeft","spacing","paddingRight","paddingVertical","startElement","startElementContainer","marginRight","icon","justifyContent","image","default","paddingBottom","closeButtonContainer","label"],"sources":["useChipStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport type { SvgIconProps } from '../SvgIcon';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { ChipColor, ChipSize, ChipStartElementVariant } from './ChipProps';\n\ninterface ChipStyle {\n container: FountainUiStyle;\n closeButtonContainer?: FountainUiStyle;\n closeIconSize?: Pick<SvgIconProps, 'height' | 'width'>;\n label: TextStyle;\n startElement?: FountainUiStyle;\n startElementContainer?: FountainUiStyle;\n}\n\ntype VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;\n\nconst closeButtonContainerStyleMap: Record<ChipSize, FountainUiStyle> = {\n small: {\n marginLeft: 8,\n paddingTop: 1,\n },\n large: {\n marginLeft: 10,\n paddingTop: 1,\n },\n};\n\nconst closeIconSize: Record<ChipSize, ChipStyle['closeIconSize']> = {\n small: {\n height: 14,\n width: 8.17,\n },\n large: {\n height: 16,\n width: 9,\n },\n};\n\n// TODO: need to refactoring...\nexport default function useChipStyle(\n size: ChipSize,\n startElementVariant: ChipStartElementVariant,\n color: ChipColor,\n selected: boolean,\n): ChipStyle {\n const theme = useTheme();\n\n return useMemo<ChipStyle>(() => {\n const fontStyleMap: Record<ChipSize, TextStyle> = {\n small: createFontStyle(theme, {\n selector: (typography) => typography.caption1.medium,\n color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,\n }),\n large: createFontStyle(theme, {\n selector: (typography) => typography.body2.medium,\n color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,\n }),\n };\n\n const baseContainerStyle: FountainUiStyle = {\n alignItems: 'center',\n backgroundColor: selected ? theme.palette.fill.base\n : color === 'white'\n ? theme.palette.surface.base\n : theme.palette.fill.weaker,\n borderRadius: theme.shape.radius.full,\n flexDirection: 'row',\n overflow: 'hidden',\n };\n\n const isLarge = size === 'large';\n\n const variantStyleMap: VariantStyleMap = {\n avatar: {\n container: {\n paddingLeft: theme.spacing(isLarge ? 1.5 : 1.25),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.25 : 1),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 26 : 23,\n width: isLarge ? 26 : 23,\n },\n startElementContainer: {\n marginRight: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n },\n icon: {\n container: {\n paddingLeft: theme.spacing(1.5),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n startElement: {\n color: selected\n ? theme.palette.icon.strongInverse\n : theme.palette.icon.strong,\n height: isLarge ? 17 : 16,\n width: isLarge ? 17 : 16,\n },\n startElementContainer: {\n alignItems: 'center',\n height: isLarge ? 24 : 21,\n justifyContent: 'center',\n marginRight: theme.spacing(isLarge ? 1 : 0.75),\n width: isLarge ? 24 : 21,\n },\n },\n image: {\n container: {\n alignItems: 'center',\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 36 : 31,\n width: isLarge ? 48 : 40,\n },\n startElementContainer: {\n marginRight: theme.spacing(1.5),\n },\n },\n default: {\n container: {\n paddingBottom: theme.spacing(1.75),\n paddingLeft: theme.spacing(isLarge ? 3.5 : 3),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingTop: theme.spacing(1.5),\n },\n },\n };\n\n return {\n container: {\n ...baseContainerStyle,\n ...variantStyleMap[startElementVariant]?.container,\n ...(selected ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),\n },\n closeButtonContainer: closeButtonContainerStyleMap[size],\n closeIconSize: closeIconSize[size],\n label: fontStyleMap[size],\n startElement: variantStyleMap[startElementVariant]?.startElement,\n startElementContainer: variantStyleMap[startElementVariant]?.startElementContainer,\n };\n }, [theme, size, startElementVariant, color, selected]);\n}\n"],"mappings":";;;;;;;AAAA;;AAIA;;AAcA,MAAMA,4BAA+D,GAAG;EACpEC,KAAK,EAAE;IACHC,UAAU,EAAE,CADT;IAEHC,UAAU,EAAE;EAFT,CAD6D;EAKpEC,KAAK,EAAE;IACHF,UAAU,EAAE,EADT;IAEHC,UAAU,EAAE;EAFT;AAL6D,CAAxE;AAWA,MAAME,aAA2D,GAAG;EAChEJ,KAAK,EAAE;IACHK,MAAM,EAAE,EADL;IAEHC,KAAK,EAAE;EAFJ,CADyD;EAKhEH,KAAK,EAAE;IACHE,MAAM,EAAE,EADL;IAEHC,KAAK,EAAE;EAFJ;AALyD,CAApE,C,CAWA;;AACe,SAASC,YAAT,CACXC,IADW,EAEXC,mBAFW,EAGXC,KAHW,EAIXC,QAJW,EAKF;EACT,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAmB,MAAM;IAAA;;IAC5B,MAAMC,YAAyC,GAAG;MAC9Cf,KAAK,EAAE,IAAAgB,uBAAA,EAAgBJ,KAAhB,EAAuB;QAC1BK,QAAQ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YATjD;MAUHC,qBAAqB,4BAAER,eAAe,CAAC/B,mBAAD,CAAjB,2DAAE,uBAAsCuC;IAV1D,CAAP;EAYH,CAlGM,EAkGJ,CAACpC,KAAD,EAAQJ,IAAR,EAAcC,mBAAd,EAAmCC,KAAnC,EAA0CC,QAA1C,CAlGI,CAAP;AAmGH"}
@@ -40,7 +40,7 @@ function useDialogStyle(size) {
40
40
  },
41
41
  full: {
42
42
  paddingBottom: bottomSafeAreaInset,
43
- paddingTop: topSafeAreaInset
43
+ paddingTop: Math.max(0, topSafeAreaInset - 3)
44
44
  }
45
45
  };
46
46
  const containerPaddingVertical = 24;
@@ -1 +1 @@
1
- {"version":3,"names":["useDialogStyle","size","theme","useTheme","height","windowHeight","width","windowWidth","useWindowDimensions","bottom","bottomSafeAreaInset","top","topSafeAreaInset","useSafeAreaInsets","useMemo","sizeStyleMap","small","maxWidth","medium","large","minHeight","full","paddingBottom","paddingTop","containerPaddingVertical","dialogMaxHeight","dialogMaxWidth","isFullScreen","root","alignItems","justifyContent","zIndex","dialog","container","paddingHorizontal","breakpoints","values","xs","paddingVertical","paper","backgroundColor","palette","surface","base","borderRadius","shape","radius","xl","maxHeight","overflow","topElementContainer","topElementContent","position"],"sources":["useDialogStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useWindowDimensions } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport type { FountainUiStyle, NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport type { DialogSize } from './DialogProps';\n\ntype DialogStyleKeys =\n | 'root'\n | 'container'\n | 'paper'\n | 'topElementContainer'\n | 'topElementContent';\n\ntype DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;\n\nexport default function useDialogStyle(size: DialogSize): DialogStyles {\n const theme = useTheme();\n\n const {\n height: windowHeight,\n width: windowWidth,\n } = useWindowDimensions();\n\n const {\n bottom: bottomSafeAreaInset,\n top: topSafeAreaInset,\n } = useSafeAreaInsets();\n\n return useMemo(() => {\n const sizeStyleMap: Record<DialogSize, FountainUiStyle> = {\n small: {\n maxWidth: 260,\n },\n medium: {\n maxWidth: 400,\n },\n large: {\n maxWidth: 512,\n minHeight: 360,\n width: 512,\n },\n full: {\n paddingBottom: bottomSafeAreaInset,\n paddingTop: topSafeAreaInset,\n },\n };\n\n const containerPaddingVertical = 24;\n const dialogMaxHeight = windowHeight - containerPaddingVertical * 2;\n const dialogMaxWidth = sizeStyleMap[size]?.maxWidth;\n\n const isFullScreen = size === 'full';\n\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: theme.zIndex.dialog,\n },\n container: isFullScreen ? {\n height: '100%',\n width: '100%',\n } : {\n alignItems: 'center',\n paddingHorizontal: windowWidth > theme.breakpoints.values.xs ? 24 : 16,\n paddingVertical: containerPaddingVertical,\n width: '100%',\n },\n paper: isFullScreen ? {\n backgroundColor: theme.palette.surface.base,\n height: '100%',\n width: '100%',\n ...sizeStyleMap[size],\n } : {\n backgroundColor: theme.palette.surface.base,\n borderRadius: theme.shape.radius.xl,\n maxHeight: dialogMaxHeight,\n overflow: 'hidden',\n width: '100%',\n ...sizeStyleMap[size],\n },\n topElementContainer: {\n maxWidth: dialogMaxWidth,\n width: '100%',\n },\n topElementContent: {\n position: 'absolute',\n bottom: 0,\n width: '100%',\n },\n };\n }, [theme, windowHeight, windowWidth, size, bottomSafeAreaInset, topSafeAreaInset]);\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAYe,SAASA,cAAT,CAAwBC,IAAxB,EAAwD;EACnE,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAM;IACFC,MAAM,EAAEC,YADN;IAEFC,KAAK,EAAEC;EAFL,IAGF,IAAAC,gCAAA,GAHJ;EAKA,MAAM;IACFC,MAAM,EAAEC,mBADN;IAEFC,GAAG,EAAEC;EAFH,IAGF,IAAAC,6CAAA,GAHJ;EAKA,OAAO,IAAAC,cAAA,EAAQ,MA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,OAAN,CAAcC,OAAd,CAAsBC,IADvC;QAEAC,YAAY,EAAE1C,KAAK,CAAC2C,KAAN,CAAYC,MAAZ,CAAmBC,EAFjC;QAGAC,SAAS,EAAEvB,eAHX;QAIAwB,QAAQ,EAAE,QAJV;QAKA3C,KAAK,EAAE,MALP;QAMA,GAAGS,YAAY,CAACd,IAAD;MANf,CApBD;MA4BHiD,mBAAmB,EAAE;QACjBjC,QAAQ,EAAES,cADO;QAEjBpB,KAAK,EAAE;MAFU,CA5BlB;MAgCH6C,iBAAiB,EAAE;QACfC,QAAQ,EAAE,UADK;QAEf3C,MAAM,EAAE,CAFO;QAGfH,KAAK,EAAE;MAHQ;IAhChB,CAAP;EAsCH,CA/DM,EA+DJ,CAACJ,KAAD,EAAQG,YAAR,EAAsBE,WAAtB,EAAmCN,IAAnC,EAAyCS,mBAAzC,EAA8DE,gBAA9D,CA/DI,CAAP;AAgEH"}
1
+ {"version":3,"names":["useDialogStyle","size","theme","useTheme","height","windowHeight","width","windowWidth","useWindowDimensions","bottom","bottomSafeAreaInset","top","topSafeAreaInset","useSafeAreaInsets","useMemo","sizeStyleMap","small","maxWidth","medium","large","minHeight","full","paddingBottom","paddingTop","Math","max","containerPaddingVertical","dialogMaxHeight","dialogMaxWidth","isFullScreen","root","alignItems","justifyContent","zIndex","dialog","container","paddingHorizontal","breakpoints","values","xs","paddingVertical","paper","backgroundColor","palette","surface","base","borderRadius","shape","radius","xl","maxHeight","overflow","topElementContainer","topElementContent","position"],"sources":["useDialogStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useWindowDimensions } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport type { FountainUiStyle, NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport type { DialogSize } from './DialogProps';\n\ntype DialogStyleKeys =\n | 'root'\n | 'container'\n | 'paper'\n | 'topElementContainer'\n | 'topElementContent';\n\ntype DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;\n\nexport default function useDialogStyle(size: DialogSize): DialogStyles {\n const theme = useTheme();\n\n const {\n height: windowHeight,\n width: windowWidth,\n } = useWindowDimensions();\n\n const {\n bottom: bottomSafeAreaInset,\n top: topSafeAreaInset,\n } = useSafeAreaInsets();\n\n return useMemo(() => {\n const sizeStyleMap: Record<DialogSize, FountainUiStyle> = {\n small: {\n maxWidth: 260,\n },\n medium: {\n maxWidth: 400,\n },\n large: {\n maxWidth: 512,\n minHeight: 360,\n width: 512,\n },\n full: {\n paddingBottom: bottomSafeAreaInset,\n paddingTop: Math.max(0, topSafeAreaInset - 3),\n },\n };\n\n const containerPaddingVertical = 24;\n const dialogMaxHeight = windowHeight - containerPaddingVertical * 2;\n const dialogMaxWidth = sizeStyleMap[size]?.maxWidth;\n\n const isFullScreen = size === 'full';\n\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: theme.zIndex.dialog,\n },\n container: isFullScreen ? {\n height: '100%',\n width: '100%',\n } : {\n alignItems: 'center',\n paddingHorizontal: windowWidth > theme.breakpoints.values.xs ? 24 : 16,\n paddingVertical: containerPaddingVertical,\n width: '100%',\n },\n paper: isFullScreen ? {\n backgroundColor: theme.palette.surface.base,\n height: '100%',\n width: '100%',\n ...sizeStyleMap[size],\n } : {\n backgroundColor: theme.palette.surface.base,\n borderRadius: theme.shape.radius.xl,\n maxHeight: dialogMaxHeight,\n overflow: 'hidden',\n width: '100%',\n ...sizeStyleMap[size],\n },\n topElementContainer: {\n maxWidth: dialogMaxWidth,\n width: '100%',\n },\n topElementContent: {\n position: 'absolute',\n bottom: 0,\n width: '100%',\n },\n };\n }, [theme, windowHeight, windowWidth, size, bottomSafeAreaInset, topSafeAreaInset]);\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAYe,SAASA,cAAT,CAAwBC,IAAxB,EAAwD;EACnE,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAM;IACFC,MAAM,EAAEC,YADN;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eHmC,KAAK,EAAEZ,YAAY,GAAG;QAClBa,eAAe,EAAExC,KAAK,CAACyC,OAAN,CAAcC,OAAd,CAAsBC,IADrB;QAElBzC,MAAM,EAAE,MAFU;QAGlBE,KAAK,EAAE,MAHW;QAIlB,GAAGS,YAAY,CAACd,IAAD;MAJG,CAAH,GAKf;QACAyC,eAAe,EAAExC,KAAK,CAACyC,OAAN,CAAcC,OAAd,CAAsBC,IADvC;QAEAC,YAAY,EAAE5C,KAAK,CAAC6C,KAAN,CAAYC,MAAZ,CAAmBC,EAFjC;QAGAC,SAAS,EAAEvB,eAHX;QAIAwB,QAAQ,EAAE,QAJV;QAKA7C,KAAK,EAAE,MALP;QAMA,GAAGS,YAAY,CAACd,IAAD;MANf,CApBD;MA4BHmD,mBAAmB,EAAE;QACjBnC,QAAQ,EAAEW,cADO;QAEjBtB,KAAK,EAAE;MAFU,CA5BlB;MAgCH+C,iBAAiB,EAAE;QACfC,QAAQ,EAAE,UADK;QAEf7C,MAAM,EAAE,CAFO;QAGfH,KAAK,EAAE;MAHQ;IAhChB,CAAP;EAsCH,CA/DM,EA+DJ,CAACJ,KAAD,EAAQG,YAAR,EAAsBE,WAAtB,EAAmCN,IAAnC,EAAyCS,mBAAzC,EAA8DE,gBAA9D,CA/DI,CAAP;AAgEH"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _reactNativeSvg = require("react-native-svg");
11
+
12
+ var _utils = require("../../utils");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ var _default = (0, _utils.createSvgIcon)( /*#__PURE__*/_react.default.createElement(_reactNativeSvg.Path, {
17
+ fillRule: "evenodd",
18
+ clipRule: "evenodd",
19
+ d: "M0.170854 3.58753C0.39866 3.35972 0.768006 3.35972 0.995812 3.58753L4.08333 6.67505L7.17085 3.58753C7.39866 3.35972 7.76801 3.35972 7.99581 3.58753C8.22362 3.81533 8.22362 4.18468 7.99581 4.41248L4.90829 7.5L7.99581 10.5875C8.22362 10.8153 8.22362 11.1847 7.99581 11.4125C7.76801 11.6403 7.39866 11.6403 7.17085 11.4125L4.08333 8.32496L0.995812 11.4125C0.768006 11.6403 0.39866 11.6403 0.170854 11.4125C-0.0569515 11.1847 -0.0569515 10.8153 0.170854 10.5875L3.25838 7.5L0.170854 4.41248C-0.0569515 4.18468 -0.0569515 3.81533 0.170854 3.58753Z"
20
+ }), 'ChipClose', '0 0 9 15');
21
+
22
+ exports.default = _default;
23
+ //# sourceMappingURL=ChipClose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createSvgIcon"],"sources":["ChipClose.tsx"],"sourcesContent":["import React from 'react';\nimport { Path } from 'react-native-svg';\nimport { createSvgIcon } from '../../utils';\n\nexport default createSvgIcon(\n <Path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.170854 3.58753C0.39866 3.35972 0.768006 3.35972 0.995812 3.58753L4.08333 6.67505L7.17085 3.58753C7.39866 3.35972 7.76801 3.35972 7.99581 3.58753C8.22362 3.81533 8.22362 4.18468 7.99581 4.41248L4.90829 7.5L7.99581 10.5875C8.22362 10.8153 8.22362 11.1847 7.99581 11.4125C7.76801 11.6403 7.39866 11.6403 7.17085 11.4125L4.08333 8.32496L0.995812 11.4125C0.768006 11.6403 0.39866 11.6403 0.170854 11.4125C-0.0569515 11.1847 -0.0569515 10.8153 0.170854 10.5875L3.25838 7.5L0.170854 4.41248C-0.0569515 4.18468 -0.0569515 3.81533 0.170854 3.58753Z\"\n />,\n 'ChipClose',\n '0 0 9 15',\n);\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;eAEe,IAAAA,oBAAA,gBACX,6BAAC,oBAAD;EACI,QAAQ,EAAC,SADb;EAEI,QAAQ,EAAC,SAFb;EAGI,CAAC,EAAC;AAHN,EADW,EAMX,WANW,EAOX,UAPW,C"}
@@ -57,6 +57,12 @@ Object.defineProperty(exports, "ChevronRight", {
57
57
  return _ChevronRight.default;
58
58
  }
59
59
  });
60
+ Object.defineProperty(exports, "ChipClose", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _ChipClose.default;
64
+ }
65
+ });
60
66
  Object.defineProperty(exports, "CircularProgress", {
61
67
  enumerable: true,
62
68
  get: function () {
@@ -136,6 +142,8 @@ var _ChevronLeft = _interopRequireDefault(require("./ChevronLeft"));
136
142
 
137
143
  var _ChevronRight = _interopRequireDefault(require("./ChevronRight"));
138
144
 
145
+ var _ChipClose = _interopRequireDefault(require("./ChipClose"));
146
+
139
147
  var _CircularProgress = _interopRequireDefault(require("./CircularProgress"));
140
148
 
141
149
  var _Clear = _interopRequireDefault(require("./Clear"));
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default as AppBarChevronLeft } from './AppBarChevronLeft';\nexport { default as Check } from './Check';\nexport { default as Checkbox } from './Checkbox';\nexport { default as CheckboxChecked } from './CheckboxChecked';\nexport { default as CheckboxOn } from './CheckboxOn';\nexport { default as CheckCircle } from './CheckCircle';\nexport { default as ChevronDown } from './ChevronDown';\nexport { default as ChevronLeft } from './ChevronLeft';\nexport { default as ChevronRight } from './ChevronRight';\nexport { default as CircularProgress } from './CircularProgress';\nexport { default as Clear } from './Clear';\nexport { default as Close } from './Close';\nexport { default as EyeOff } from './EyeOff';\nexport { default as EyeOn } from './EyeOn';\nexport { default as InfoCircle } from './InfoCircle';\nexport { default as LoadingSpinner } from './LoadingSpinner';\nexport { default as Radio } from './Radio';\nexport { default as RadioChecked } from './RadioChecked';\nexport { default as Search } from './Search';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default as AppBarChevronLeft } from './AppBarChevronLeft';\nexport { default as Check } from './Check';\nexport { default as Checkbox } from './Checkbox';\nexport { default as CheckboxChecked } from './CheckboxChecked';\nexport { default as CheckboxOn } from './CheckboxOn';\nexport { default as CheckCircle } from './CheckCircle';\nexport { default as ChevronDown } from './ChevronDown';\nexport { default as ChevronLeft } from './ChevronLeft';\nexport { default as ChevronRight } from './ChevronRight';\nexport { default as ChipClose } from './ChipClose';\nexport { default as CircularProgress } from './CircularProgress';\nexport { default as Clear } from './Clear';\nexport { default as Close } from './Close';\nexport { default as EyeOff } from './EyeOff';\nexport { default as EyeOn } from './EyeOn';\nexport { default as InfoCircle } from './InfoCircle';\nexport { default as LoadingSpinner } from './LoadingSpinner';\nexport { default as Radio } from './Radio';\nexport { default as RadioChecked } from './RadioChecked';\nexport { default as Search } from './Search';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  import React from 'react';
4
4
  import { Text, View } from 'react-native';
5
5
  import ButtonBase from '../ButtonBase';
6
- import { Close } from '../internal';
6
+ import { ChipClose } from '../internal';
7
7
  import { css } from '../styles';
8
8
  import { cloneElementSafely } from '../utils';
9
9
  import useChipStyle from './useChipStyle';
@@ -22,7 +22,8 @@ export default function Chip(props) {
22
22
  } = props;
23
23
  const {
24
24
  container: containerStyle,
25
- closeButton: closeButtonStyle,
25
+ closeButtonContainer: closeButtonContainerStyle,
26
+ closeIconSize,
26
27
  label: labelStyle,
27
28
  startElement: startElementStyle,
28
29
  startElementContainer: startElementContainerStyle
@@ -41,9 +42,12 @@ export default function Chip(props) {
41
42
  children: children,
42
43
  numberOfLines: numberOfLines,
43
44
  style: labelStyle
44
- }), selected ? /*#__PURE__*/React.createElement(Close, {
45
+ }), selected ? /*#__PURE__*/React.createElement(View, {
46
+ style: closeButtonContainerStyle
47
+ }, /*#__PURE__*/React.createElement(ChipClose, {
45
48
  color: 'baseInverse',
46
- style: closeButtonStyle
47
- }) : null);
49
+ height: closeIconSize === null || closeIconSize === void 0 ? void 0 : closeIconSize.height,
50
+ width: closeIconSize === null || closeIconSize === void 0 ? void 0 : closeIconSize.width
51
+ })) : null);
48
52
  }
49
53
  //# sourceMappingURL=Chip.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","ButtonBase","Close","css","cloneElementSafely","useChipStyle","Chip","props","children","color","numberOfLines","onPress","selected","size","startElement","startElementProp","startElementVariant","style","styleProp","otherProps","container","containerStyle","closeButton","closeButtonStyle","label","labelStyle","startElementStyle","startElementContainer","startElementContainerStyle","chipStyle"],"sources":["Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { Close } from '../internal';\nimport { css } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type ChipProps from './ChipProps';\nimport type { ChipColor, ChipSize } from './ChipProps';\nimport useChipStyle from './useChipStyle';\n\nexport default function Chip(props: ChipProps) {\n const {\n children,\n color = 'default' as ChipColor,\n numberOfLines,\n onPress,\n selected = false,\n size = 'small' as ChipSize,\n startElement: startElementProp,\n startElementVariant = 'default',\n style: styleProp,\n ...otherProps\n } = props;\n\n const {\n container: containerStyle,\n closeButton: closeButtonStyle,\n label: labelStyle,\n startElement: startElementStyle,\n startElementContainer: startElementContainerStyle,\n } = useChipStyle(size, startElementVariant, color, selected);\n\n const chipStyle = css([\n containerStyle,\n styleProp,\n ]);\n\n const startElement = (\n <View style={startElementContainerStyle}>\n {cloneElementSafely(startElementProp, { style: startElementStyle })}\n </View>\n );\n\n return (\n <ButtonBase\n disabled={!onPress}\n onPress={onPress}\n style={chipStyle}\n {...otherProps}\n >\n {startElement}\n\n <Text\n children={children}\n numberOfLines={numberOfLines}\n style={labelStyle}\n />\n\n {selected ? (\n <Close\n color={'baseInverse'}\n style={closeButtonStyle}\n />\n ) : null}\n </ButtonBase>\n );\n}\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SAASC,KAAT,QAAsB,aAAtB;AACA,SAASC,GAAT,QAAoB,WAApB;AACA,SAASC,kBAAT,QAAmC,UAAnC;AAGA,OAAOC,YAAP,MAAyB,gBAAzB;AAEA,eAAe,SAASC,IAAT,CAAcC,KAAd,EAAgC;EAC3C,MAAM;IACFC,QADE;IAEFC,KAAK,GAAG,SAFN;IAGFC,aAHE;IAIFC,OAJE;IAKFC,QAAQ,GAAG,KALT;IAMFC,IAAI,GAAG,OANL;IAOFC,YAAY,EAAEC,gBAPZ;IAQFC,mBAAmB,GAAG,SARpB;IASFC,KAAK,EAAEC,SATL;IAUF,GAAGC;EAVD,IAWFZ,KAXJ;EAaA,MAAM;IACFa,SAAS,EAAEC,cADT;IAEFC,WAAW,EAAEC,gBAFX;IAGFC,KAAK,EAAEC,UAHL;IAIFX,YAAY,EAAEY,iBAJZ;IAKFC,qBAAqB,EAAEC;EALrB,IAMFvB,YAAY,CAACQ,IAAD,EAAOG,mBAAP,EAA4BP,KAA5B,EAAmCG,QAAnC,CANhB;EAQA,MAAMiB,SAAS,GAAG1B,GAAG,CAAC,CAClBkB,cADkB,EAElBH,SAFkB,CAAD,CAArB;EAKA,MAAMJ,YAAY,gBACd,oBAAC,IAAD;IAAM,KAAK,EAAEc;EAAb,GACKxB,kBAAkB,CAACW,gBAAD,EAAmB;IAAEE,KAAK,EAAES;EAAT,CAAnB,CADvB,CADJ;EAMA,oBACI,oBAAC,UAAD;IACI,QAAQ,EAAE,CAACf,OADf;IAEI,OAAO,EAAEA,OAFb;IAGI,KAAK,EAAEkB;EAHX,GAIQV,UAJR,GAMKL,YANL,eAQI,oBAAC,IAAD;IACI,QAAQ,EAAEN,QADd;IAEI,aAAa,EAAEE,aAFnB;IAGI,KAAK,EAAEe;EAHX,EARJ,EAcKb,QAAQ,gBACL,oBAAC,KAAD;IACI,KAAK,EAAE,aADX;IAEI,KAAK,EAAEW;EAFX,EADK,GAKL,IAnBR,CADJ;AAuBH"}
1
+ {"version":3,"names":["React","Text","View","ButtonBase","ChipClose","css","cloneElementSafely","useChipStyle","Chip","props","children","color","numberOfLines","onPress","selected","size","startElement","startElementProp","startElementVariant","style","styleProp","otherProps","container","containerStyle","closeButtonContainer","closeButtonContainerStyle","closeIconSize","label","labelStyle","startElementStyle","startElementContainer","startElementContainerStyle","chipStyle","height","width"],"sources":["Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { ChipClose } from '../internal';\nimport { css } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type ChipProps from './ChipProps';\nimport type { ChipColor, ChipSize } from './ChipProps';\nimport useChipStyle from './useChipStyle';\n\nexport default function Chip(props: ChipProps) {\n const {\n children,\n color = 'default' as ChipColor,\n numberOfLines,\n onPress,\n selected = false,\n size = 'small' as ChipSize,\n startElement: startElementProp,\n startElementVariant = 'default',\n style: styleProp,\n ...otherProps\n } = props;\n\n const {\n container: containerStyle,\n closeButtonContainer: closeButtonContainerStyle,\n closeIconSize,\n label: labelStyle,\n startElement: startElementStyle,\n startElementContainer: startElementContainerStyle,\n } = useChipStyle(size, startElementVariant, color, selected);\n\n const chipStyle = css([\n containerStyle,\n styleProp,\n ]);\n\n const startElement = (\n <View style={startElementContainerStyle}>\n {cloneElementSafely(startElementProp, { style: startElementStyle })}\n </View>\n );\n\n return (\n <ButtonBase\n disabled={!onPress}\n onPress={onPress}\n style={chipStyle}\n {...otherProps}\n >\n {startElement}\n\n <Text\n children={children}\n numberOfLines={numberOfLines}\n style={labelStyle}\n />\n\n {selected ? (\n <View style={closeButtonContainerStyle}>\n <ChipClose\n color={'baseInverse'}\n height={closeIconSize?.height}\n width={closeIconSize?.width}\n />\n </View>\n ) : null}\n </ButtonBase>\n );\n}\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,GAAT,QAAoB,WAApB;AACA,SAASC,kBAAT,QAAmC,UAAnC;AAGA,OAAOC,YAAP,MAAyB,gBAAzB;AAEA,eAAe,SAASC,IAAT,CAAcC,KAAd,EAAgC;EAC3C,MAAM;IACFC,QADE;IAEFC,KAAK,GAAG,SAFN;IAGFC,aAHE;IAIFC,OAJE;IAKFC,QAAQ,GAAG,KALT;IAMFC,IAAI,GAAG,OANL;IAOFC,YAAY,EAAEC,gBAPZ;IAQFC,mBAAmB,GAAG,SARpB;IASFC,KAAK,EAAEC,SATL;IAUF,GAAGC;EAVD,IAWFZ,KAXJ;EAaA,MAAM;IACFa,SAAS,EAAEC,cADT;IAEFC,oBAAoB,EAAEC,yBAFpB;IAGFC,aAHE;IAIFC,KAAK,EAAEC,UAJL;IAKFZ,YAAY,EAAEa,iBALZ;IAMFC,qBAAqB,EAAEC;EANrB,IAOFxB,YAAY,CAACQ,IAAD,EAAOG,mBAAP,EAA4BP,KAA5B,EAAmCG,QAAnC,CAPhB;EASA,MAAMkB,SAAS,GAAG3B,GAAG,CAAC,CAClBkB,cADkB,EAElBH,SAFkB,CAAD,CAArB;EAKA,MAAMJ,YAAY,gBACd,oBAAC,IAAD;IAAM,KAAK,EAAEe;EAAb,GACKzB,kBAAkB,CAACW,gBAAD,EAAmB;IAAEE,KAAK,EAAEU;EAAT,CAAnB,CADvB,CADJ;EAMA,oBACI,oBAAC,UAAD;IACI,QAAQ,EAAE,CAAChB,OADf;IAEI,OAAO,EAAEA,OAFb;IAGI,KAAK,EAAEmB;EAHX,GAIQX,UAJR,GAMKL,YANL,eAQI,oBAAC,IAAD;IACI,QAAQ,EAAEN,QADd;IAEI,aAAa,EAAEE,aAFnB;IAGI,KAAK,EAAEgB;EAHX,EARJ,EAcKd,QAAQ,gBACL,oBAAC,IAAD;IAAM,KAAK,EAAEW;EAAb,gBACI,oBAAC,SAAD;IACI,KAAK,EAAE,aADX;IAEI,MAAM,EAAEC,aAAF,aAAEA,aAAF,uBAAEA,aAAa,CAAEO,MAF3B;IAGI,KAAK,EAAEP,aAAF,aAAEA,aAAF,uBAAEA,aAAa,CAAEQ;EAH1B,EADJ,CADK,GAQL,IAtBR,CADJ;AA0BH"}
@@ -1,6 +1,26 @@
1
1
  import { useMemo } from 'react';
2
2
  import { createFontStyle, useTheme } from '../styles';
3
- // TODO: need to refactoring...
3
+ const closeButtonContainerStyleMap = {
4
+ small: {
5
+ marginLeft: 8,
6
+ paddingTop: 1
7
+ },
8
+ large: {
9
+ marginLeft: 10,
10
+ paddingTop: 1
11
+ }
12
+ };
13
+ const closeIconSize = {
14
+ small: {
15
+ height: 14,
16
+ width: 8.17
17
+ },
18
+ large: {
19
+ height: 16,
20
+ width: 9
21
+ }
22
+ }; // TODO: need to refactoring...
23
+
4
24
  export default function useChipStyle(size, startElementVariant, color, selected) {
5
25
  const theme = useTheme();
6
26
  return useMemo(() => {
@@ -16,18 +36,6 @@ export default function useChipStyle(size, startElementVariant, color, selected)
16
36
  color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong
17
37
  })
18
38
  };
19
- const closeButtonStyleMap = {
20
- small: {
21
- height: 14,
22
- marginLeft: theme.spacing(2),
23
- width: 8.17
24
- },
25
- large: {
26
- height: 17,
27
- marginLeft: theme.spacing(2.5),
28
- width: 9
29
- }
30
- };
31
39
  const baseContainerStyle = {
32
40
  alignItems: 'center',
33
41
  backgroundColor: selected ? theme.palette.fill.base : color === 'white' ? theme.palette.surface.base : theme.palette.fill.weaker,
@@ -88,7 +96,8 @@ export default function useChipStyle(size, startElementVariant, color, selected)
88
96
  default: {
89
97
  container: {
90
98
  paddingBottom: theme.spacing(1.75),
91
- paddingHorizontal: theme.spacing(isLarge ? 3.5 : 3),
99
+ paddingLeft: theme.spacing(isLarge ? 3.5 : 3),
100
+ paddingRight: theme.spacing(isLarge ? 3.5 : 3),
92
101
  paddingTop: theme.spacing(1.5)
93
102
  }
94
103
  }
@@ -100,7 +109,8 @@ export default function useChipStyle(size, startElementVariant, color, selected)
100
109
  paddingRight: theme.spacing(isLarge ? 2.5 : 2.25)
101
110
  } : {})
102
111
  },
103
- closeButton: closeButtonStyleMap[size],
112
+ closeButtonContainer: closeButtonContainerStyleMap[size],
113
+ closeIconSize: closeIconSize[size],
104
114
  label: fontStyleMap[size],
105
115
  startElement: (_variantStyleMap$star2 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star2 === void 0 ? void 0 : _variantStyleMap$star2.startElement,
106
116
  startElementContainer: (_variantStyleMap$star3 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star3 === void 0 ? void 0 : _variantStyleMap$star3.startElementContainer
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","createFontStyle","useTheme","useChipStyle","size","startElementVariant","color","selected","theme","fontStyleMap","small","selector","typography","caption1","medium","palette","text","strongInverse","strong","large","body2","closeButtonStyleMap","height","marginLeft","spacing","width","baseContainerStyle","alignItems","backgroundColor","fill","base","surface","weaker","borderRadius","shape","radius","full","flexDirection","overflow","isLarge","variantStyleMap","avatar","container","paddingLeft","paddingRight","paddingVertical","startElement","startElementContainer","marginRight","icon","justifyContent","image","default","paddingBottom","paddingHorizontal","paddingTop","closeButton","label"],"sources":["useChipStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { ChipColor, ChipSize, ChipStartElementVariant } from './ChipProps';\n\ninterface ChipStyle {\n container: FountainUiStyle;\n closeButton?: FountainUiStyle;\n label: TextStyle;\n startElement?: FountainUiStyle;\n startElementContainer?: FountainUiStyle;\n}\n\ntype VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;\n\n// TODO: need to refactoring...\nexport default function useChipStyle(\n size: ChipSize,\n startElementVariant: ChipStartElementVariant,\n color: ChipColor,\n selected: boolean,\n): ChipStyle {\n const theme = useTheme();\n\n return useMemo<ChipStyle>(() => {\n const fontStyleMap: Record<ChipSize, TextStyle> = {\n small: createFontStyle(theme, {\n selector: (typography) => typography.caption1.medium,\n color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,\n }),\n large: createFontStyle(theme, {\n selector: (typography) => typography.body2.medium,\n color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,\n }),\n };\n\n const closeButtonStyleMap: Record<ChipSize, FountainUiStyle> = {\n small: {\n height: 14,\n marginLeft: theme.spacing(2),\n width: 8.17,\n },\n large: {\n height: 17,\n marginLeft: theme.spacing(2.5),\n width: 9,\n },\n };\n\n const baseContainerStyle: FountainUiStyle = {\n alignItems: 'center',\n backgroundColor: selected ? theme.palette.fill.base\n : color === 'white'\n ? theme.palette.surface.base\n : theme.palette.fill.weaker,\n borderRadius: theme.shape.radius.full,\n flexDirection: 'row',\n overflow: 'hidden',\n };\n\n const isLarge = size === 'large';\n\n const variantStyleMap: VariantStyleMap = {\n avatar: {\n container: {\n paddingLeft: theme.spacing(isLarge ? 1.5 : 1.25),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.25 : 1),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 26 : 23,\n width: isLarge ? 26 : 23,\n },\n startElementContainer: {\n marginRight: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n },\n icon: {\n container: {\n paddingLeft: theme.spacing(1.5),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n startElement: {\n color: selected\n ? theme.palette.icon.strongInverse\n : theme.palette.icon.strong,\n height: isLarge ? 17 : 16,\n width: isLarge ? 17 : 16,\n },\n startElementContainer: {\n alignItems: 'center',\n height: isLarge ? 24 : 21,\n justifyContent: 'center',\n marginRight: theme.spacing(isLarge ? 1 : 0.75),\n width: isLarge ? 24 : 21,\n },\n },\n image: {\n container: {\n alignItems: 'center',\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 36 : 31,\n width: isLarge ? 48 : 40,\n },\n startElementContainer: {\n marginRight: theme.spacing(1.5),\n },\n },\n default: {\n container: {\n paddingBottom: theme.spacing(1.75),\n paddingHorizontal: theme.spacing(isLarge ? 3.5 : 3),\n paddingTop: theme.spacing(1.5),\n },\n },\n };\n\n return {\n container: {\n ...baseContainerStyle,\n ...variantStyleMap[startElementVariant]?.container,\n ...(selected ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),\n },\n closeButton: closeButtonStyleMap[size],\n label: fontStyleMap[size],\n startElement: variantStyleMap[startElementVariant]?.startElement,\n startElementContainer: variantStyleMap[startElementVariant]?.startElementContainer,\n };\n }, [theme, size, startElementVariant, color, selected]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAGA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AAaA;AACA,eAAe,SAASC,YAAT,CACXC,IADW,EAEXC,mBAFW,EAGXC,KAHW,EAIXC,QAJW,EAKF;EACT,MAAMC,KAAK,GAAGN,QAAQ,EAAtB;EAEA,OAAOF,OAAO,CAAY,MAAM;IAAA;;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GAAH,GAAS,IAA9B;QAAhB,CAAH,GAA2D,EAAvE;MAHO,CADR;MAMHiB,WAAW,EAAEnC,mBAAmB,CAACjB,IAAD,CAN7B;MAOHqD,KAAK,EAAEhD,YAAY,CAACL,IAAD,CAPhB;MAQH0C,YAAY,4BAAEN,eAAe,CAACnC,mBAAD,CAAjB,2DAAE,uBAAsCyC,YARjD;MASHC,qBAAqB,4BAAEP,eAAe,CAACnC,mBAAD,CAAjB,2DAAE,uBAAsC0C;IAT1D,CAAP;EAWH,CA7Ga,EA6GX,CAACvC,KAAD,EAAQJ,IAAR,EAAcC,mBAAd,EAAmCC,KAAnC,EAA0CC,QAA1C,CA7GW,CAAd;AA8GH"}
1
+ {"version":3,"names":["useMemo","createFontStyle","useTheme","closeButtonContainerStyleMap","small","marginLeft","paddingTop","large","closeIconSize","height","width","useChipStyle","size","startElementVariant","color","selected","theme","fontStyleMap","selector","typography","caption1","medium","palette","text","strongInverse","strong","body2","baseContainerStyle","alignItems","backgroundColor","fill","base","surface","weaker","borderRadius","shape","radius","full","flexDirection","overflow","isLarge","variantStyleMap","avatar","container","paddingLeft","spacing","paddingRight","paddingVertical","startElement","startElementContainer","marginRight","icon","justifyContent","image","default","paddingBottom","closeButtonContainer","label"],"sources":["useChipStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport type { SvgIconProps } from '../SvgIcon';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { ChipColor, ChipSize, ChipStartElementVariant } from './ChipProps';\n\ninterface ChipStyle {\n container: FountainUiStyle;\n closeButtonContainer?: FountainUiStyle;\n closeIconSize?: Pick<SvgIconProps, 'height' | 'width'>;\n label: TextStyle;\n startElement?: FountainUiStyle;\n startElementContainer?: FountainUiStyle;\n}\n\ntype VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;\n\nconst closeButtonContainerStyleMap: Record<ChipSize, FountainUiStyle> = {\n small: {\n marginLeft: 8,\n paddingTop: 1,\n },\n large: {\n marginLeft: 10,\n paddingTop: 1,\n },\n};\n\nconst closeIconSize: Record<ChipSize, ChipStyle['closeIconSize']> = {\n small: {\n height: 14,\n width: 8.17,\n },\n large: {\n height: 16,\n width: 9,\n },\n};\n\n// TODO: need to refactoring...\nexport default function useChipStyle(\n size: ChipSize,\n startElementVariant: ChipStartElementVariant,\n color: ChipColor,\n selected: boolean,\n): ChipStyle {\n const theme = useTheme();\n\n return useMemo<ChipStyle>(() => {\n const fontStyleMap: Record<ChipSize, TextStyle> = {\n small: createFontStyle(theme, {\n selector: (typography) => typography.caption1.medium,\n color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,\n }),\n large: createFontStyle(theme, {\n selector: (typography) => typography.body2.medium,\n color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,\n }),\n };\n\n const baseContainerStyle: FountainUiStyle = {\n alignItems: 'center',\n backgroundColor: selected ? theme.palette.fill.base\n : color === 'white'\n ? theme.palette.surface.base\n : theme.palette.fill.weaker,\n borderRadius: theme.shape.radius.full,\n flexDirection: 'row',\n overflow: 'hidden',\n };\n\n const isLarge = size === 'large';\n\n const variantStyleMap: VariantStyleMap = {\n avatar: {\n container: {\n paddingLeft: theme.spacing(isLarge ? 1.5 : 1.25),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.25 : 1),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 26 : 23,\n width: isLarge ? 26 : 23,\n },\n startElementContainer: {\n marginRight: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n },\n icon: {\n container: {\n paddingLeft: theme.spacing(1.5),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n startElement: {\n color: selected\n ? theme.palette.icon.strongInverse\n : theme.palette.icon.strong,\n height: isLarge ? 17 : 16,\n width: isLarge ? 17 : 16,\n },\n startElementContainer: {\n alignItems: 'center',\n height: isLarge ? 24 : 21,\n justifyContent: 'center',\n marginRight: theme.spacing(isLarge ? 1 : 0.75),\n width: isLarge ? 24 : 21,\n },\n },\n image: {\n container: {\n alignItems: 'center',\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 36 : 31,\n width: isLarge ? 48 : 40,\n },\n startElementContainer: {\n marginRight: theme.spacing(1.5),\n },\n },\n default: {\n container: {\n paddingBottom: theme.spacing(1.75),\n paddingLeft: theme.spacing(isLarge ? 3.5 : 3),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingTop: theme.spacing(1.5),\n },\n },\n };\n\n return {\n container: {\n ...baseContainerStyle,\n ...variantStyleMap[startElementVariant]?.container,\n ...(selected ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),\n },\n closeButtonContainer: closeButtonContainerStyleMap[size],\n closeIconSize: closeIconSize[size],\n label: fontStyleMap[size],\n startElement: variantStyleMap[startElementVariant]?.startElement,\n startElementContainer: variantStyleMap[startElementVariant]?.startElementContainer,\n };\n }, [theme, size, startElementVariant, color, selected]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAIA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AAcA,MAAMC,4BAA+D,GAAG;EACpEC,KAAK,EAAE;IACHC,UAAU,EAAE,CADT;IAEHC,UAAU,EAAE;EAFT,CAD6D;EAKpEC,KAAK,EAAE;IACHF,UAAU,EAAE,EADT;IAEHC,UAAU,EAAE;EAFT;AAL6D,CAAxE;AAWA,MAAME,aAA2D,GAAG;EAChEJ,KAAK,EAAE;IACHK,MAAM,EAAE,EADL;IAEHC,KAAK,EAAE;EAFJ,CADyD;EAKhEH,KAAK,EAAE;IACHE,MAAM,EAAE,EADL;IAEHC,KAAK,EAAE;EAFJ;AALyD,CAApE,C,CAWA;;AACA,eAAe,SAASC,YAAT,C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vE;MAHO,CADR;MAMHgB,oBAAoB,EAAErD,4BAA4B,CAACS,IAAD,CAN/C;MAOHJ,aAAa,EAAEA,aAAa,CAACI,IAAD,CAPzB;MAQH6C,KAAK,EAAExC,YAAY,CAACL,IAAD,CARhB;MASHoC,YAAY,4BAAEP,eAAe,CAAC5B,mBAAD,CAAjB,2DAAE,uBAAsCmC,YATjD;MAUHC,qBAAqB,4BAAER,eAAe,CAAC5B,mBAAD,CAAjB,2DAAE,uBAAsCoC;IAV1D,CAAP;EAYH,CAlGa,EAkGX,CAACjC,KAAD,EAAQJ,IAAR,EAAcC,mBAAd,EAAmCC,KAAnC,EAA0CC,QAA1C,CAlGW,CAAd;AAmGH"}
@@ -29,7 +29,7 @@ export default function useDialogStyle(size) {
29
29
  },
30
30
  full: {
31
31
  paddingBottom: bottomSafeAreaInset,
32
- paddingTop: topSafeAreaInset
32
+ paddingTop: Math.max(0, topSafeAreaInset - 3)
33
33
  }
34
34
  };
35
35
  const containerPaddingVertical = 24;
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useWindowDimensions","useSafeAreaInsets","useTheme","useDialogStyle","size","theme","height","windowHeight","width","windowWidth","bottom","bottomSafeAreaInset","top","topSafeAreaInset","sizeStyleMap","small","maxWidth","medium","large","minHeight","full","paddingBottom","paddingTop","containerPaddingVertical","dialogMaxHeight","dialogMaxWidth","isFullScreen","root","alignItems","justifyContent","zIndex","dialog","container","paddingHorizontal","breakpoints","values","xs","paddingVertical","paper","backgroundColor","palette","surface","base","borderRadius","shape","radius","xl","maxHeight","overflow","topElementContainer","topElementContent","position"],"sources":["useDialogStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useWindowDimensions } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport type { FountainUiStyle, NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport type { DialogSize } from './DialogProps';\n\ntype DialogStyleKeys =\n | 'root'\n | 'container'\n | 'paper'\n | 'topElementContainer'\n | 'topElementContent';\n\ntype DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;\n\nexport default function useDialogStyle(size: DialogSize): DialogStyles {\n const theme = useTheme();\n\n const {\n height: windowHeight,\n width: windowWidth,\n } = useWindowDimensions();\n\n const {\n bottom: bottomSafeAreaInset,\n top: topSafeAreaInset,\n } = useSafeAreaInsets();\n\n return useMemo(() => {\n const sizeStyleMap: Record<DialogSize, FountainUiStyle> = {\n small: {\n maxWidth: 260,\n },\n medium: {\n maxWidth: 400,\n },\n large: {\n maxWidth: 512,\n minHeight: 360,\n width: 512,\n },\n full: {\n paddingBottom: bottomSafeAreaInset,\n paddingTop: topSafeAreaInset,\n },\n };\n\n const containerPaddingVertical = 24;\n const dialogMaxHeight = windowHeight - containerPaddingVertical * 2;\n const dialogMaxWidth = sizeStyleMap[size]?.maxWidth;\n\n const isFullScreen = size === 'full';\n\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: theme.zIndex.dialog,\n },\n container: isFullScreen ? {\n height: '100%',\n width: '100%',\n } : {\n alignItems: 'center',\n paddingHorizontal: windowWidth > theme.breakpoints.values.xs ? 24 : 16,\n paddingVertical: containerPaddingVertical,\n width: '100%',\n },\n paper: isFullScreen ? {\n backgroundColor: theme.palette.surface.base,\n height: '100%',\n width: '100%',\n ...sizeStyleMap[size],\n } : {\n backgroundColor: theme.palette.surface.base,\n borderRadius: theme.shape.radius.xl,\n maxHeight: dialogMaxHeight,\n overflow: 'hidden',\n width: '100%',\n ...sizeStyleMap[size],\n },\n topElementContainer: {\n maxWidth: dialogMaxWidth,\n width: '100%',\n },\n topElementContent: {\n position: 'absolute',\n bottom: 0,\n width: '100%',\n },\n };\n }, [theme, windowHeight, windowWidth, size, bottomSafeAreaInset, topSafeAreaInset]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AACA,SAASC,mBAAT,QAAoC,cAApC;AACA,SAASC,iBAAT,QAAkC,gCAAlC;AAEA,SAASC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AFpE;QAGAC,eAAe,EAAEd,wBAHjB;QAIAf,KAAK,EAAE;MAJP,CATD;MAeH8B,KAAK,EAAEZ,YAAY,GAAG;QAClBa,eAAe,EAAElC,KAAK,CAACmC,OAAN,CAAcC,OAAd,CAAsBC,IADrB;QAElBpC,MAAM,EAAE,MAFU;QAGlBE,KAAK,EAAE,MAHW;QAIlB,GAAGM,YAAY,CAACV,IAAD;MAJG,CAAH,GAKf;QACAmC,eAAe,EAAElC,KAAK,CAACmC,OAAN,CAAcC,OAAd,CAAsBC,IADvC;QAEAC,YAAY,EAAEtC,KAAK,CAACuC,KAAN,CAAYC,MAAZ,CAAmBC,EAFjC;QAGAC,SAAS,EAAEvB,eAHX;QAIAwB,QAAQ,EAAE,QAJV;QAKAxC,KAAK,EAAE,MALP;QAMA,GAAGM,YAAY,CAACV,IAAD;MANf,CApBD;MA4BH6C,mBAAmB,EAAE;QACjBjC,QAAQ,EAAES,cADO;QAEjBjB,KAAK,EAAE;MAFU,CA5BlB;MAgCH0C,iBAAiB,EAAE;QACfC,QAAQ,EAAE,UADK;QAEfzC,MAAM,EAAE,CAFO;QAGfF,KAAK,EAAE;MAHQ;IAhChB,CAAP;EAsCH,CA/Da,EA+DX,CAACH,KAAD,EAAQE,YAAR,EAAsBE,WAAtB,EAAmCL,IAAnC,EAAyCO,mBAAzC,EAA8DE,gBAA9D,CA/DW,CAAd;AAgEH"}
1
+ {"version":3,"names":["useMemo","useWindowDimensions","useSafeAreaInsets","useTheme","useDialogStyle","size","theme","height","windowHeight","width","windowWidth","bottom","bottomSafeAreaInset","top","topSafeAreaInset","sizeStyleMap","small","maxWidth","medium","large","minHeight","full","paddingBottom","paddingTop","Math","max","containerPaddingVertical","dialogMaxHeight","dialogMaxWidth","isFullScreen","root","alignItems","justifyContent","zIndex","dialog","container","paddingHorizontal","breakpoints","values","xs","paddingVertical","paper","backgroundColor","palette","surface","base","borderRadius","shape","radius","xl","maxHeight","overflow","topElementContainer","topElementContent","position"],"sources":["useDialogStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useWindowDimensions } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport type { FountainUiStyle, NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport type { DialogSize } from './DialogProps';\n\ntype DialogStyleKeys =\n | 'root'\n | 'container'\n | 'paper'\n | 'topElementContainer'\n | 'topElementContent';\n\ntype DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;\n\nexport default function useDialogStyle(size: DialogSize): DialogStyles {\n const theme = useTheme();\n\n const {\n height: windowHeight,\n width: windowWidth,\n } = useWindowDimensions();\n\n const {\n bottom: bottomSafeAreaInset,\n top: topSafeAreaInset,\n } = useSafeAreaInsets();\n\n return useMemo(() => {\n const sizeStyleMap: Record<DialogSize, FountainUiStyle> = {\n small: {\n maxWidth: 260,\n },\n medium: {\n maxWidth: 400,\n },\n large: {\n maxWidth: 512,\n minHeight: 360,\n width: 512,\n },\n full: {\n paddingBottom: bottomSafeAreaInset,\n paddingTop: Math.max(0, topSafeAreaInset - 3),\n },\n };\n\n const containerPaddingVertical = 24;\n const dialogMaxHeight = windowHeight - containerPaddingVertical * 2;\n const dialogMaxWidth = sizeStyleMap[size]?.maxWidth;\n\n const isFullScreen = size === 'full';\n\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: theme.zIndex.dialog,\n },\n container: isFullScreen ? {\n height: '100%',\n width: '100%',\n } : {\n alignItems: 'center',\n paddingHorizontal: windowWidth > theme.breakpoints.values.xs ? 24 : 16,\n paddingVertical: containerPaddingVertical,\n width: '100%',\n },\n paper: isFullScreen ? {\n backgroundColor: theme.palette.surface.base,\n height: '100%',\n width: '100%',\n ...sizeStyleMap[size],\n } : {\n backgroundColor: theme.palette.surface.base,\n borderRadius: theme.shape.radius.xl,\n maxHeight: dialogMaxHeight,\n overflow: 'hidden',\n width: '100%',\n ...sizeStyleMap[size],\n },\n topElementContainer: {\n maxWidth: dialogMaxWidth,\n width: '100%',\n },\n topElementContent: {\n position: 'absolute',\n bottom: 0,\n width: '100%',\n },\n };\n }, [theme, windowHeight, windowWidth, size, bottomSafeAreaInset, topSafeAreaInset]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AACA,SAASC,mBAAT,QAAoC,cAApC;AACA,SAASC,iBAAT,QAAkC,gCAAlC;AAEA,SAASC,QAAT,QAAyB,WAAzB;AAYA,eAAe,SAASC,cAAT,CAAwBC,IAAxB,EAAwD;EACnE,MAAMC,KAAK,GAAGH,QAAQ,EAAtB;EAEA,MAAM;IACFI,MAAM,EAAEC,YADN;IAEFC,KAAK,EAAEC;EAFL,IAGFT,mBAAmB,EAHvB;EAKA,MAAM;IACFU,MAAM,EAAEC,mBADN;IAEFC,GAAG,EAAEC;EAFH,IAGFZ,iBAAiB,EAHrB;EAKA,OAAOF,OAAO,CAAC,MAAM;IAAA;;IACjB,MAAMe,YAAiD,GAAG;MACtDC,KAAK,EAAE;QACHC,QAAQ,EAAE;MADP,CAD+C;MAItDC,MAAM,EAAE;QACJD,QAAQ,EAAE;MADN,CAJ8C;MAOtDE,KAAK,EAAE;QACHF,QAAQ,EAAE,GADP;QAEHG,SAAS,EAAE,GAFR;QAGHX,KAAK,EAAE;MAHJ,CAP+C;MAYtDY,IAAI,EAAE;QACFC,aAAa,EAAEV,mBADb;QAEFW,UAAU,EAAEC,IAAI,CAACC,GAAL,CAAS,CAAT,EAAYX,gBAAgB,GAAG,CAA/B;MAFV;IAZgD,CAA1D;IAkBA,MAAMY,wBAAwB,GAAG,EAAjC;IACA,MAAMC,eAAe,GAAGnB,YAAY,GAAGkB,wBAAwB,GAAG,CAAlE;IACA,MAAME,cAAc,yBAAGb,YAAY,CAACV,IAAD,CAAf,uDAAG,mBAAoBY,QAA3C;IAEA,MAAMY,YAAY,GAAGxB,IAAI,KAAK,MAA9B;IAEA,OAAO;MACHyB,IAAI,EAAE;QACFC,UAAU,EAAE,QADV;QAEFC,c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'react-native-svg';
3
+ import { createSvgIcon } from '../../utils';
4
+ export default createSvgIcon( /*#__PURE__*/React.createElement(Path, {
5
+ fillRule: "evenodd",
6
+ clipRule: "evenodd",
7
+ d: "M0.170854 3.58753C0.39866 3.35972 0.768006 3.35972 0.995812 3.58753L4.08333 6.67505L7.17085 3.58753C7.39866 3.35972 7.76801 3.35972 7.99581 3.58753C8.22362 3.81533 8.22362 4.18468 7.99581 4.41248L4.90829 7.5L7.99581 10.5875C8.22362 10.8153 8.22362 11.1847 7.99581 11.4125C7.76801 11.6403 7.39866 11.6403 7.17085 11.4125L4.08333 8.32496L0.995812 11.4125C0.768006 11.6403 0.39866 11.6403 0.170854 11.4125C-0.0569515 11.1847 -0.0569515 10.8153 0.170854 10.5875L3.25838 7.5L0.170854 4.41248C-0.0569515 4.18468 -0.0569515 3.81533 0.170854 3.58753Z"
8
+ }), 'ChipClose', '0 0 9 15');
9
+ //# sourceMappingURL=ChipClose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Path","createSvgIcon"],"sources":["ChipClose.tsx"],"sourcesContent":["import React from 'react';\nimport { Path } from 'react-native-svg';\nimport { createSvgIcon } from '../../utils';\n\nexport default createSvgIcon(\n <Path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.170854 3.58753C0.39866 3.35972 0.768006 3.35972 0.995812 3.58753L4.08333 6.67505L7.17085 3.58753C7.39866 3.35972 7.76801 3.35972 7.99581 3.58753C8.22362 3.81533 8.22362 4.18468 7.99581 4.41248L4.90829 7.5L7.99581 10.5875C8.22362 10.8153 8.22362 11.1847 7.99581 11.4125C7.76801 11.6403 7.39866 11.6403 7.17085 11.4125L4.08333 8.32496L0.995812 11.4125C0.768006 11.6403 0.39866 11.6403 0.170854 11.4125C-0.0569515 11.1847 -0.0569515 10.8153 0.170854 10.5875L3.25838 7.5L0.170854 4.41248C-0.0569515 4.18468 -0.0569515 3.81533 0.170854 3.58753Z\"\n />,\n 'ChipClose',\n '0 0 9 15',\n);\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,kBAArB;AACA,SAASC,aAAT,QAA8B,aAA9B;AAEA,eAAeA,aAAa,eACxB,oBAAC,IAAD;EACI,QAAQ,EAAC,SADb;EAEI,QAAQ,EAAC,SAFb;EAGI,CAAC,EAAC;AAHN,EADwB,EAMxB,WANwB,EAOxB,UAPwB,CAA5B"}
@@ -7,6 +7,7 @@ export { default as CheckCircle } from './CheckCircle';
7
7
  export { default as ChevronDown } from './ChevronDown';
8
8
  export { default as ChevronLeft } from './ChevronLeft';
9
9
  export { default as ChevronRight } from './ChevronRight';
10
+ export { default as ChipClose } from './ChipClose';
10
11
  export { default as CircularProgress } from './CircularProgress';
11
12
  export { default as Clear } from './Clear';
12
13
  export { default as Close } from './Close';
@@ -1 +1 @@
1
- {"version":3,"names":["default","AppBarChevronLeft","Check","Checkbox","CheckboxChecked","CheckboxOn","CheckCircle","ChevronDown","ChevronLeft","ChevronRight","CircularProgress","Clear","Close","EyeOff","EyeOn","InfoCircle","LoadingSpinner","Radio","RadioChecked","Search"],"sources":["index.ts"],"sourcesContent":["export { default as AppBarChevronLeft } from './AppBarChevronLeft';\nexport { default as Check } from './Check';\nexport { default as Checkbox } from './Checkbox';\nexport { default as CheckboxChecked } from './CheckboxChecked';\nexport { default as CheckboxOn } from './CheckboxOn';\nexport { default as CheckCircle } from './CheckCircle';\nexport { default as ChevronDown } from './ChevronDown';\nexport { default as ChevronLeft } from './ChevronLeft';\nexport { default as ChevronRight } from './ChevronRight';\nexport { default as CircularProgress } from './CircularProgress';\nexport { default as Clear } from './Clear';\nexport { default as Close } from './Close';\nexport { default as EyeOff } from './EyeOff';\nexport { default as EyeOn } from './EyeOn';\nexport { default as InfoCircle } from './InfoCircle';\nexport { default as LoadingSpinner } from './LoadingSpinner';\nexport { default as Radio } from './Radio';\nexport { default as RadioChecked } from './RadioChecked';\nexport { default as Search } from './Search';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,iBAApB,QAA6C,qBAA7C;AACA,SAASD,OAAO,IAAIE,KAApB,QAAiC,SAAjC;AACA,SAASF,OAAO,IAAIG,QAApB,QAAoC,YAApC;AACA,SAASH,OAAO,IAAII,eAApB,QAA2C,mBAA3C;AACA,SAASJ,OAAO,IAAIK,UAApB,QAAsC,cAAtC;AACA,SAASL,OAAO,IAAIM,WAApB,QAAuC,eAAvC;AACA,SAASN,OAAO,IAAIO,WAApB,QAAuC,eAAvC;AACA,SAASP,OAAO,IAAIQ,WAApB,QAAuC,eAAvC;AACA,SAASR,OAAO,IAAIS,YAApB,QAAwC,gBAAxC;AACA,SAAST,OAAO,IAAIU,gBAApB,QAA4C,oBAA5C;AACA,SAASV,OAAO,IAAIW,KAApB,QAAiC,SAAjC;AACA,SAASX,OAAO,IAAIY,KAApB,QAAiC,SAAjC;AACA,SAASZ,OAAO,IAAIa,MAApB,QAAkC,UAAlC;AACA,SAASb,OAAO,IAAIc,KAApB,QAAiC,SAAjC;AACA,SAASd,OAAO,IAAIe,UAApB,QAAsC,cAAtC;AACA,SAASf,OAAO,IAAIgB,cAApB,QAA0C,kBAA1C;AACA,SAAShB,OAAO,IAAIiB,KAApB,QAAiC,SAAjC;AACA,SAASjB,OAAO,IAAIkB,YAApB,QAAwC,gBAAxC;AACA,SAASlB,OAAO,IAAImB,MAApB,QAAkC,UAAlC"}
1
+ {"version":3,"names":["default","AppBarChevronLeft","Check","Checkbox","CheckboxChecked","CheckboxOn","CheckCircle","ChevronDown","ChevronLeft","ChevronRight","ChipClose","CircularProgress","Clear","Close","EyeOff","EyeOn","InfoCircle","LoadingSpinner","Radio","RadioChecked","Search"],"sources":["index.ts"],"sourcesContent":["export { default as AppBarChevronLeft } from './AppBarChevronLeft';\nexport { default as Check } from './Check';\nexport { default as Checkbox } from './Checkbox';\nexport { default as CheckboxChecked } from './CheckboxChecked';\nexport { default as CheckboxOn } from './CheckboxOn';\nexport { default as CheckCircle } from './CheckCircle';\nexport { default as ChevronDown } from './ChevronDown';\nexport { default as ChevronLeft } from './ChevronLeft';\nexport { default as ChevronRight } from './ChevronRight';\nexport { default as ChipClose } from './ChipClose';\nexport { default as CircularProgress } from './CircularProgress';\nexport { default as Clear } from './Clear';\nexport { default as Close } from './Close';\nexport { default as EyeOff } from './EyeOff';\nexport { default as EyeOn } from './EyeOn';\nexport { default as InfoCircle } from './InfoCircle';\nexport { default as LoadingSpinner } from './LoadingSpinner';\nexport { default as Radio } from './Radio';\nexport { default as RadioChecked } from './RadioChecked';\nexport { default as Search } from './Search';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,iBAApB,QAA6C,qBAA7C;AACA,SAASD,OAAO,IAAIE,KAApB,QAAiC,SAAjC;AACA,SAASF,OAAO,IAAIG,QAApB,QAAoC,YAApC;AACA,SAASH,OAAO,IAAII,eAApB,QAA2C,mBAA3C;AACA,SAASJ,OAAO,IAAIK,UAApB,QAAsC,cAAtC;AACA,SAASL,OAAO,IAAIM,WAApB,QAAuC,eAAvC;AACA,SAASN,OAAO,IAAIO,WAApB,QAAuC,eAAvC;AACA,SAASP,OAAO,IAAIQ,WAApB,QAAuC,eAAvC;AACA,SAASR,OAAO,IAAIS,YAApB,QAAwC,gBAAxC;AACA,SAAST,OAAO,IAAIU,SAApB,QAAqC,aAArC;AACA,SAASV,OAAO,IAAIW,gBAApB,QAA4C,oBAA5C;AACA,SAASX,OAAO,IAAIY,KAApB,QAAiC,SAAjC;AACA,SAASZ,OAAO,IAAIa,KAApB,QAAiC,SAAjC;AACA,SAASb,OAAO,IAAIc,MAApB,QAAkC,UAAlC;AACA,SAASd,OAAO,IAAIe,KAApB,QAAiC,SAAjC;AACA,SAASf,OAAO,IAAIgB,UAApB,QAAsC,cAAtC;AACA,SAAShB,OAAO,IAAIiB,cAApB,QAA0C,kBAA1C;AACA,SAASjB,OAAO,IAAIkB,KAApB,QAAiC,SAAjC;AACA,SAASlB,OAAO,IAAImB,YAApB,QAAwC,gBAAxC;AACA,SAASnB,OAAO,IAAIoB,MAApB,QAAkC,UAAlC"}
@@ -1,9 +1,11 @@
1
1
  import type { TextStyle } from 'react-native';
2
2
  import type { FountainUiStyle } from '@fountain-ui/styles';
3
+ import type { SvgIconProps } from '../SvgIcon';
3
4
  import type { ChipColor, ChipSize, ChipStartElementVariant } from './ChipProps';
4
5
  interface ChipStyle {
5
6
  container: FountainUiStyle;
6
- closeButton?: FountainUiStyle;
7
+ closeButtonContainer?: FountainUiStyle;
8
+ closeIconSize?: Pick<SvgIconProps, 'height' | 'width'>;
7
9
  label: TextStyle;
8
10
  startElement?: FountainUiStyle;
9
11
  startElementContainer?: FountainUiStyle;
@@ -0,0 +1,131 @@
1
+ import React from 'react';
2
+ declare const _default: React.MemoExoticComponent<{
3
+ (props: {
4
+ readonly color?: "accent" | "base" | "strong" | "strongInverse" | "baseInverse" | "baseOpacity" | "baseOpacityInverse" | "weak" | "weakInverse" | "weakOpacity" | "weakOpacityInverse" | "accentAlt" | undefined;
5
+ fontFamily?: string | undefined;
6
+ fontSize?: import("react-native-svg").NumberProp | undefined;
7
+ fontWeight?: import("react-native-svg").FontWeight | undefined;
8
+ letterSpacing?: import("react-native-svg").NumberProp | undefined;
9
+ readonly fill?: import("react-native").ColorValue | undefined;
10
+ fontStyle?: import("react-native-svg").FontStyle | undefined;
11
+ testID?: string | undefined;
12
+ fontVariant?: import("react-native-svg").FontVariant | undefined;
13
+ opacity?: import("react-native-svg").NumberProp | undefined;
14
+ readonly height?: import("react-native-svg").NumberProp | undefined;
15
+ readonly width?: import("react-native-svg").NumberProp | undefined;
16
+ transform?: string | (import("react-native").PerpectiveTransform | import("react-native").RotateTransform | import("react-native").RotateXTransform | import("react-native").RotateYTransform | import("react-native").RotateZTransform | import("react-native").ScaleTransform | import("react-native").ScaleXTransform | import("react-native").ScaleYTransform | import("react-native").TranslateXTransform | import("react-native").TranslateYTransform | import("react-native").SkewXTransform | import("react-native").SkewYTransform | import("react-native").MatrixTransform)[] | import("react-native-svg").ColumnMajorTransformMatrix | undefined;
17
+ rotation?: import("react-native-svg").NumberProp | undefined;
18
+ scaleX?: import("react-native-svg").NumberProp | undefined;
19
+ scaleY?: import("react-native-svg").NumberProp | undefined;
20
+ translateX?: import("react-native-svg").NumberProp | undefined;
21
+ translateY?: import("react-native-svg").NumberProp | undefined;
22
+ readonly style?: import("@fountain-ui/styles").FountainUiStyle | import("@fountain-ui/styles").FountainUiStyle[] | undefined;
23
+ onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined;
24
+ title?: string | undefined;
25
+ clipPath?: string | undefined;
26
+ marker?: string | undefined;
27
+ mask?: string | undefined;
28
+ scale?: import("react-native-svg").NumberArray | undefined;
29
+ skewX?: import("react-native-svg").NumberProp | undefined;
30
+ skewY?: import("react-native-svg").NumberProp | undefined;
31
+ readonly viewBox?: string | undefined;
32
+ preserveAspectRatio?: string | undefined;
33
+ fillOpacity?: import("react-native-svg").NumberProp | undefined;
34
+ fillRule?: import("react-native-svg").FillRule | undefined;
35
+ stroke?: import("react-native").ColorValue | undefined;
36
+ strokeWidth?: import("react-native-svg").NumberProp | undefined;
37
+ strokeOpacity?: import("react-native-svg").NumberProp | undefined;
38
+ strokeDasharray?: import("react-native-svg").NumberProp | readonly import("react-native-svg").NumberProp[] | undefined;
39
+ strokeDashoffset?: import("react-native-svg").NumberProp | undefined;
40
+ strokeLinecap?: import("react-native-svg").Linecap | undefined;
41
+ strokeLinejoin?: import("react-native-svg").Linejoin | undefined;
42
+ strokeMiterlimit?: import("react-native-svg").NumberProp | undefined;
43
+ vectorEffect?: import("react-native-svg").VectorEffect | undefined;
44
+ clipRule?: import("react-native-svg").FillRule | undefined;
45
+ translate?: import("react-native-svg").NumberArray | undefined;
46
+ origin?: import("react-native-svg").NumberArray | undefined;
47
+ originX?: import("react-native-svg").NumberProp | undefined;
48
+ originY?: import("react-native-svg").NumberProp | undefined;
49
+ skew?: import("react-native-svg").NumberArray | undefined;
50
+ x?: import("react-native-svg").NumberArray | undefined;
51
+ y?: import("react-native-svg").NumberArray | undefined;
52
+ pointerEvents?: "auto" | "none" | "box-none" | "box-only" | undefined;
53
+ onStartShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined;
54
+ onMoveShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined;
55
+ onResponderEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
56
+ onResponderGrant?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
57
+ onResponderReject?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
58
+ onResponderMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
59
+ onResponderRelease?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
60
+ onResponderStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
61
+ onResponderTerminationRequest?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined;
62
+ onResponderTerminate?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
63
+ onStartShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined;
64
+ onMoveShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined;
65
+ disabled?: boolean | undefined;
66
+ onPress?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
67
+ onPressIn?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
68
+ onPressOut?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
69
+ onLongPress?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
70
+ delayPressIn?: number | undefined;
71
+ delayPressOut?: number | undefined;
72
+ delayLongPress?: number | undefined;
73
+ id?: string | undefined;
74
+ markerStart?: string | undefined;
75
+ markerMid?: string | undefined;
76
+ markerEnd?: string | undefined;
77
+ accessibilityLabel?: string | undefined;
78
+ accessible?: boolean | undefined;
79
+ font?: import("react-native-svg").FontObject | undefined;
80
+ fontStretch?: import("react-native-svg").FontStretch | undefined;
81
+ textAnchor?: import("react-native-svg").TextAnchor | undefined;
82
+ textDecoration?: import("react-native-svg").TextDecoration | undefined;
83
+ wordSpacing?: import("react-native-svg").NumberProp | undefined;
84
+ kerning?: import("react-native-svg").NumberProp | undefined;
85
+ fontFeatureSettings?: string | undefined;
86
+ fontVariantLigatures?: import("react-native-svg").FontVariantLigatures | undefined;
87
+ fontVariationSettings?: string | undefined;
88
+ hitSlop?: import("react-native").Insets | undefined;
89
+ removeClippedSubviews?: boolean | undefined;
90
+ nativeID?: string | undefined;
91
+ collapsable?: boolean | undefined;
92
+ needsOffscreenAlphaCompositing?: boolean | undefined;
93
+ renderToHardwareTextureAndroid?: boolean | undefined;
94
+ focusable?: boolean | undefined;
95
+ shouldRasterizeIOS?: boolean | undefined;
96
+ isTVSelectable?: boolean | undefined;
97
+ hasTVPreferredFocus?: boolean | undefined;
98
+ tvParallaxProperties?: import("react-native").TVParallaxProperties | undefined;
99
+ tvParallaxShiftDistanceX?: number | undefined;
100
+ tvParallaxShiftDistanceY?: number | undefined;
101
+ tvParallaxTiltAngle?: number | undefined;
102
+ tvParallaxMagnification?: number | undefined;
103
+ onTouchStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
104
+ onTouchMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
105
+ onTouchEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
106
+ onTouchCancel?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
107
+ onTouchEndCapture?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
108
+ accessibilityActions?: readonly Readonly<{
109
+ name: string;
110
+ label?: string | undefined;
111
+ }>[] | undefined;
112
+ accessibilityRole?: import("react-native").AccessibilityRole | undefined;
113
+ accessibilityState?: import("react-native").AccessibilityState | undefined;
114
+ accessibilityHint?: string | undefined;
115
+ accessibilityValue?: import("react-native").AccessibilityValue | undefined;
116
+ onAccessibilityAction?: ((event: import("react-native").AccessibilityActionEvent) => void) | undefined;
117
+ accessibilityLabelledBy?: string | string[] | undefined;
118
+ accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined;
119
+ importantForAccessibility?: "auto" | "yes" | "no" | "no-hide-descendants" | undefined;
120
+ accessibilityElementsHidden?: boolean | undefined;
121
+ accessibilityLanguage?: string | undefined;
122
+ accessibilityViewIsModal?: boolean | undefined;
123
+ onAccessibilityEscape?: (() => void) | undefined;
124
+ onAccessibilityTap?: (() => void) | undefined;
125
+ onMagicTap?: (() => void) | undefined;
126
+ accessibilityIgnoresInvertColors?: boolean | undefined;
127
+ readonly size?: "medium" | "small" | "large" | undefined;
128
+ }): JSX.Element;
129
+ displayName: string;
130
+ }>;
131
+ export default _default;
@@ -7,6 +7,7 @@ export { default as CheckCircle } from './CheckCircle';
7
7
  export { default as ChevronDown } from './ChevronDown';
8
8
  export { default as ChevronLeft } from './ChevronLeft';
9
9
  export { default as ChevronRight } from './ChevronRight';
10
+ export { default as ChipClose } from './ChipClose';
10
11
  export { default as CircularProgress } from './CircularProgress';
11
12
  export { default as Clear } from './Clear';
12
13
  export { default as Close } from './Close';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fountain-ui/core",
3
- "version": "3.0.0-alpha.23",
3
+ "version": "3.0.0-alpha.24",
4
4
  "author": "Fountain-UI Team",
5
5
  "description": "React components that implement Tappytoon's Fountain Design.",
6
6
  "license": "MIT",
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "dbe78bda34eeeb856ce85619c48e3591fbe9bd86"
70
+ "gitHead": "0476888c17d395e280cec48f558280c9816189ea"
71
71
  }
package/src/Chip/Chip.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Text, View } from 'react-native';
3
3
  import ButtonBase from '../ButtonBase';
4
- import { Close } from '../internal';
4
+ import { ChipClose } from '../internal';
5
5
  import { css } from '../styles';
6
6
  import { cloneElementSafely } from '../utils';
7
7
  import type ChipProps from './ChipProps';
@@ -24,7 +24,8 @@ export default function Chip(props: ChipProps) {
24
24
 
25
25
  const {
26
26
  container: containerStyle,
27
- closeButton: closeButtonStyle,
27
+ closeButtonContainer: closeButtonContainerStyle,
28
+ closeIconSize,
28
29
  label: labelStyle,
29
30
  startElement: startElementStyle,
30
31
  startElementContainer: startElementContainerStyle,
@@ -57,10 +58,13 @@ export default function Chip(props: ChipProps) {
57
58
  />
58
59
 
59
60
  {selected ? (
60
- <Close
61
- color={'baseInverse'}
62
- style={closeButtonStyle}
63
- />
61
+ <View style={closeButtonContainerStyle}>
62
+ <ChipClose
63
+ color={'baseInverse'}
64
+ height={closeIconSize?.height}
65
+ width={closeIconSize?.width}
66
+ />
67
+ </View>
64
68
  ) : null}
65
69
  </ButtonBase>
66
70
  );
@@ -1,12 +1,14 @@
1
1
  import { useMemo } from 'react';
2
2
  import type { TextStyle } from 'react-native';
3
3
  import type { FountainUiStyle } from '@fountain-ui/styles';
4
+ import type { SvgIconProps } from '../SvgIcon';
4
5
  import { createFontStyle, useTheme } from '../styles';
5
6
  import type { ChipColor, ChipSize, ChipStartElementVariant } from './ChipProps';
6
7
 
7
8
  interface ChipStyle {
8
9
  container: FountainUiStyle;
9
- closeButton?: FountainUiStyle;
10
+ closeButtonContainer?: FountainUiStyle;
11
+ closeIconSize?: Pick<SvgIconProps, 'height' | 'width'>;
10
12
  label: TextStyle;
11
13
  startElement?: FountainUiStyle;
12
14
  startElementContainer?: FountainUiStyle;
@@ -14,6 +16,28 @@ interface ChipStyle {
14
16
 
15
17
  type VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;
16
18
 
19
+ const closeButtonContainerStyleMap: Record<ChipSize, FountainUiStyle> = {
20
+ small: {
21
+ marginLeft: 8,
22
+ paddingTop: 1,
23
+ },
24
+ large: {
25
+ marginLeft: 10,
26
+ paddingTop: 1,
27
+ },
28
+ };
29
+
30
+ const closeIconSize: Record<ChipSize, ChipStyle['closeIconSize']> = {
31
+ small: {
32
+ height: 14,
33
+ width: 8.17,
34
+ },
35
+ large: {
36
+ height: 16,
37
+ width: 9,
38
+ },
39
+ };
40
+
17
41
  // TODO: need to refactoring...
18
42
  export default function useChipStyle(
19
43
  size: ChipSize,
@@ -35,19 +59,6 @@ export default function useChipStyle(
35
59
  }),
36
60
  };
37
61
 
38
- const closeButtonStyleMap: Record<ChipSize, FountainUiStyle> = {
39
- small: {
40
- height: 14,
41
- marginLeft: theme.spacing(2),
42
- width: 8.17,
43
- },
44
- large: {
45
- height: 17,
46
- marginLeft: theme.spacing(2.5),
47
- width: 9,
48
- },
49
- };
50
-
51
62
  const baseContainerStyle: FountainUiStyle = {
52
63
  alignItems: 'center',
53
64
  backgroundColor: selected ? theme.palette.fill.base
@@ -115,7 +126,8 @@ export default function useChipStyle(
115
126
  default: {
116
127
  container: {
117
128
  paddingBottom: theme.spacing(1.75),
118
- paddingHorizontal: theme.spacing(isLarge ? 3.5 : 3),
129
+ paddingLeft: theme.spacing(isLarge ? 3.5 : 3),
130
+ paddingRight: theme.spacing(isLarge ? 3.5 : 3),
119
131
  paddingTop: theme.spacing(1.5),
120
132
  },
121
133
  },
@@ -127,7 +139,8 @@ export default function useChipStyle(
127
139
  ...variantStyleMap[startElementVariant]?.container,
128
140
  ...(selected ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),
129
141
  },
130
- closeButton: closeButtonStyleMap[size],
142
+ closeButtonContainer: closeButtonContainerStyleMap[size],
143
+ closeIconSize: closeIconSize[size],
131
144
  label: fontStyleMap[size],
132
145
  startElement: variantStyleMap[startElementVariant]?.startElement,
133
146
  startElementContainer: variantStyleMap[startElementVariant]?.startElementContainer,
@@ -42,7 +42,7 @@ export default function useDialogStyle(size: DialogSize): DialogStyles {
42
42
  },
43
43
  full: {
44
44
  paddingBottom: bottomSafeAreaInset,
45
- paddingTop: topSafeAreaInset,
45
+ paddingTop: Math.max(0, topSafeAreaInset - 3),
46
46
  },
47
47
  };
48
48
 
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Path } from 'react-native-svg';
3
+ import { createSvgIcon } from '../../utils';
4
+
5
+ export default createSvgIcon(
6
+ <Path
7
+ fillRule="evenodd"
8
+ clipRule="evenodd"
9
+ d="M0.170854 3.58753C0.39866 3.35972 0.768006 3.35972 0.995812 3.58753L4.08333 6.67505L7.17085 3.58753C7.39866 3.35972 7.76801 3.35972 7.99581 3.58753C8.22362 3.81533 8.22362 4.18468 7.99581 4.41248L4.90829 7.5L7.99581 10.5875C8.22362 10.8153 8.22362 11.1847 7.99581 11.4125C7.76801 11.6403 7.39866 11.6403 7.17085 11.4125L4.08333 8.32496L0.995812 11.4125C0.768006 11.6403 0.39866 11.6403 0.170854 11.4125C-0.0569515 11.1847 -0.0569515 10.8153 0.170854 10.5875L3.25838 7.5L0.170854 4.41248C-0.0569515 4.18468 -0.0569515 3.81533 0.170854 3.58753Z"
10
+ />,
11
+ 'ChipClose',
12
+ '0 0 9 15',
13
+ );
@@ -7,6 +7,7 @@ export { default as CheckCircle } from './CheckCircle';
7
7
  export { default as ChevronDown } from './ChevronDown';
8
8
  export { default as ChevronLeft } from './ChevronLeft';
9
9
  export { default as ChevronRight } from './ChevronRight';
10
+ export { default as ChipClose } from './ChipClose';
10
11
  export { default as CircularProgress } from './CircularProgress';
11
12
  export { default as Clear } from './Clear';
12
13
  export { default as Close } from './Close';