@0610studio/zs-ui 0.18.1 → 0.19.0

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.
Files changed (106) hide show
  1. package/build/assets/SvgTooltipTail.d.ts +7 -0
  2. package/build/assets/SvgTooltipTail.d.ts.map +1 -0
  3. package/build/assets/SvgTooltipTail.js +7 -0
  4. package/build/assets/SvgTooltipTail.js.map +1 -0
  5. package/build/context/ThemeContext.d.ts.map +1 -1
  6. package/build/context/ThemeContext.js +17 -5
  7. package/build/context/ThemeContext.js.map +1 -1
  8. package/build/index.d.ts +15 -2
  9. package/build/index.d.ts.map +1 -1
  10. package/build/index.js +7 -1
  11. package/build/index.js.map +1 -1
  12. package/build/model/types.d.ts +1 -0
  13. package/build/model/types.d.ts.map +1 -1
  14. package/build/model/types.js.map +1 -1
  15. package/build/model/useFoldingState.d.ts.map +1 -1
  16. package/build/model/useFoldingState.js +51 -32
  17. package/build/model/useFoldingState.js.map +1 -1
  18. package/build/overlay/AlertOverlay/index.d.ts +1 -2
  19. package/build/overlay/AlertOverlay/index.d.ts.map +1 -1
  20. package/build/overlay/AlertOverlay/index.js +11 -9
  21. package/build/overlay/AlertOverlay/index.js.map +1 -1
  22. package/build/overlay/BottomSheetOverlay/index.d.ts.map +1 -1
  23. package/build/overlay/BottomSheetOverlay/index.js +4 -3
  24. package/build/overlay/BottomSheetOverlay/index.js.map +1 -1
  25. package/build/overlay/LoadingNotify/index.d.ts +2 -2
  26. package/build/overlay/LoadingNotify/index.d.ts.map +1 -1
  27. package/build/overlay/LoadingNotify/index.js +2 -2
  28. package/build/overlay/LoadingNotify/index.js.map +1 -1
  29. package/build/overlay/Modality/index.d.ts.map +1 -1
  30. package/build/overlay/Modality/index.js +3 -3
  31. package/build/overlay/Modality/index.js.map +1 -1
  32. package/build/overlay/PopOver/PopOverMenu.d.ts.map +1 -1
  33. package/build/overlay/PopOver/PopOverMenu.js +5 -3
  34. package/build/overlay/PopOver/PopOverMenu.js.map +1 -1
  35. package/build/overlay/SnackbarNotify/ui/SnackbarItem.d.ts +3 -3
  36. package/build/overlay/SnackbarNotify/ui/SnackbarItem.d.ts.map +1 -1
  37. package/build/overlay/SnackbarNotify/ui/SnackbarItem.js +5 -5
  38. package/build/overlay/SnackbarNotify/ui/SnackbarItem.js.map +1 -1
  39. package/build/theme/intentColors.d.ts +9 -0
  40. package/build/theme/intentColors.d.ts.map +1 -0
  41. package/build/theme/intentColors.js +30 -0
  42. package/build/theme/intentColors.js.map +1 -0
  43. package/build/theme/tokens.d.ts +35 -0
  44. package/build/theme/tokens.d.ts.map +1 -0
  45. package/build/theme/tokens.js +35 -0
  46. package/build/theme/tokens.js.map +1 -0
  47. package/build/theme/typography.d.ts.map +1 -1
  48. package/build/theme/typography.js +36 -72
  49. package/build/theme/typography.js.map +1 -1
  50. package/build/ui/ZSBlockButton/index.d.ts.map +1 -1
  51. package/build/ui/ZSBlockButton/index.js +4 -19
  52. package/build/ui/ZSBlockButton/index.js.map +1 -1
  53. package/build/ui/ZSBorderBeam/index.d.ts +48 -0
  54. package/build/ui/ZSBorderBeam/index.d.ts.map +1 -0
  55. package/build/ui/ZSBorderBeam/index.js +135 -0
  56. package/build/ui/ZSBorderBeam/index.js.map +1 -0
  57. package/build/ui/ZSCheckBox/index.d.ts +18 -0
  58. package/build/ui/ZSCheckBox/index.d.ts.map +1 -0
  59. package/build/ui/ZSCheckBox/index.js +60 -0
  60. package/build/ui/ZSCheckBox/index.js.map +1 -0
  61. package/build/ui/ZSChip/index.d.ts +28 -0
  62. package/build/ui/ZSChip/index.d.ts.map +1 -0
  63. package/build/ui/ZSChip/index.js +76 -0
  64. package/build/ui/ZSChip/index.js.map +1 -0
  65. package/build/ui/ZSContainer/index.d.ts +0 -1
  66. package/build/ui/ZSContainer/index.d.ts.map +1 -1
  67. package/build/ui/ZSContainer/index.js +3 -2
  68. package/build/ui/ZSContainer/index.js.map +1 -1
  69. package/build/ui/ZSPressable/index.d.ts.map +1 -1
  70. package/build/ui/ZSPressable/index.js +9 -4
  71. package/build/ui/ZSPressable/index.js.map +1 -1
  72. package/build/ui/ZSRadioGroup/index.d.ts +2 -3
  73. package/build/ui/ZSRadioGroup/index.d.ts.map +1 -1
  74. package/build/ui/ZSRadioGroup/index.js +12 -4
  75. package/build/ui/ZSRadioGroup/index.js.map +1 -1
  76. package/build/ui/ZSSegmented/index.d.ts +26 -0
  77. package/build/ui/ZSSegmented/index.d.ts.map +1 -0
  78. package/build/ui/ZSSegmented/index.js +124 -0
  79. package/build/ui/ZSSegmented/index.js.map +1 -0
  80. package/build/ui/ZSSkeleton/SkiaShimmer.d.ts +18 -0
  81. package/build/ui/ZSSkeleton/SkiaShimmer.d.ts.map +1 -0
  82. package/build/ui/ZSSkeleton/SkiaShimmer.js +73 -0
  83. package/build/ui/ZSSkeleton/SkiaShimmer.js.map +1 -0
  84. package/build/ui/ZSSkeleton/index.d.ts +7 -2
  85. package/build/ui/ZSSkeleton/index.d.ts.map +1 -1
  86. package/build/ui/ZSSkeleton/index.js +12 -43
  87. package/build/ui/ZSSkeleton/index.js.map +1 -1
  88. package/build/ui/ZSSkeletonBox/index.d.ts +8 -2
  89. package/build/ui/ZSSkeletonBox/index.d.ts.map +1 -1
  90. package/build/ui/ZSSkeletonBox/index.js +6 -46
  91. package/build/ui/ZSSkeletonBox/index.js.map +1 -1
  92. package/build/ui/ZSSwitch/index.d.ts +2 -1
  93. package/build/ui/ZSSwitch/index.d.ts.map +1 -1
  94. package/build/ui/ZSSwitch/index.js +6 -4
  95. package/build/ui/ZSSwitch/index.js.map +1 -1
  96. package/build/ui/ZSTextField/index.d.ts.map +1 -1
  97. package/build/ui/ZSTextField/index.js +17 -13
  98. package/build/ui/ZSTextField/index.js.map +1 -1
  99. package/build/ui/ZSTextField/ui/ButtonClose.d.ts.map +1 -1
  100. package/build/ui/ZSTextField/ui/ButtonClose.js +4 -1
  101. package/build/ui/ZSTextField/ui/ButtonClose.js.map +1 -1
  102. package/build/ui/ZSTooltip/index.d.ts +38 -0
  103. package/build/ui/ZSTooltip/index.d.ts.map +1 -0
  104. package/build/ui/ZSTooltip/index.js +99 -0
  105. package/build/ui/ZSTooltip/index.js.map +1 -0
  106. package/package.json +6 -1
@@ -6,11 +6,12 @@ import ButtonClose from './ui/ButtonClose';
6
6
  import ErrorComponent from './ui/ErrorComponent';
7
7
  import { extractStyle } from '../../model/utils';
8
8
  import { useTheme } from '../../context/ThemeContext';
9
+ import { DISABLED_OPACITY, DURATION, RADIUS } from '../../theme/tokens';
9
10
  import ViewAtom from '../atoms/ViewAtom';
10
11
  const iosOffset = Platform.OS === 'ios' ? 8 : 4;
11
- const ANIM_DURATION = 150;
12
+ const ANIM_DURATION = DURATION.fast;
12
13
  const TIMING_CONFIG = { duration: ANIM_DURATION, reduceMotion: ReduceMotion.System };
13
- const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, onChangeText, label = 'Placeholder', labelColor, placeHolderColor, inputBgColor, labelBgColor, borderWidth = 1.2, borderColor, focusColor, errorColor, borderRadius = 14, paddingHorizontal = 15, errorMessage, textInputProps, boxStyle = 'outline', innerBoxStyle, disabled = false, allowFontScaling = true, isTextArea = false, }, ref) => {
14
+ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, onChangeText, label = 'Placeholder', labelColor, placeHolderColor, inputBgColor, labelBgColor, borderWidth = 1.2, borderColor, focusColor, errorColor, borderRadius = RADIUS.lg, paddingHorizontal = 15, errorMessage, textInputProps, boxStyle = 'outline', innerBoxStyle, disabled = false, allowFontScaling = true, isTextArea = false, }, ref) => {
14
15
  const { typography, palette } = useTheme();
15
16
  const [primaryStyle, subStyle] = typo.split('.');
16
17
  const fErrorColor = errorColor || palette.danger.main;
@@ -80,7 +81,7 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
80
81
  boxHeightValue.value = height;
81
82
  }
82
83
  }, []);
83
- const handleFocus = useCallback(() => {
84
+ const handleFocus = useCallback((event) => {
84
85
  isFocusedRef.current = true;
85
86
  if (floatProgress.value !== 1) {
86
87
  floatProgress.value = withTiming(1, TIMING_CONFIG);
@@ -89,8 +90,9 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
89
90
  focusProgress.value = withTiming(1, TIMING_CONFIG);
90
91
  }
91
92
  setIsFocusedForUI(true);
92
- }, []);
93
- const handleBlur = useCallback(() => {
93
+ textInputProps?.onFocus?.(event);
94
+ }, [textInputProps?.onFocus]);
95
+ const handleBlur = useCallback((event) => {
94
96
  isFocusedRef.current = false;
95
97
  const target = hasValueRef.current ? 1 : 0;
96
98
  if (floatProgress.value !== target) {
@@ -100,7 +102,8 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
100
102
  focusProgress.value = withTiming(0, TIMING_CONFIG);
101
103
  }
102
104
  setIsFocusedForUI(false);
103
- }, []);
105
+ textInputProps?.onBlur?.(event);
106
+ }, [textInputProps?.onBlur]);
104
107
  const styleConfig = useMemo(() => {
105
108
  const baseStyle = {
106
109
  width: '100%',
@@ -156,10 +159,10 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
156
159
  }), [fontSize, animationConstants.baseTop, paddingHorizontal, labelBgColor, palette.background.base, boxStyle, fontFamily]);
157
160
  const boxStyleArray = useMemo(() => [styleConfig, animatedBorderStyle], [styleConfig, animatedBorderStyle]);
158
161
  const labelStyleArray = useMemo(() => [labelTextStyle, animatedLabelStyle], [labelTextStyle, animatedLabelStyle]);
159
- const handleTextChange = (text) => {
160
- if (onChangeText)
161
- onChangeText(text);
162
- };
162
+ const handleTextChange = useCallback((text) => {
163
+ onChangeText?.(text);
164
+ textInputProps?.onChangeText?.(text);
165
+ }, [onChangeText, textInputProps?.onChangeText]);
163
166
  const textInputStyle = useMemo(() => [
164
167
  {
165
168
  paddingTop: 7 + iosOffset,
@@ -173,9 +176,10 @@ const ZSTextField = forwardRef(({ typo = 'body.2', status = 'default', value, on
173
176
  },
174
177
  textInputProps?.style,
175
178
  ], [palette.text.base, fontSize, fontFamily, textInputProps?.style]);
176
- const shouldShowCloseButton = value && isFocusedForUI;
177
- const shouldShowError = status === 'error' && errorMessage;
178
- return (_jsxs(ViewAtom, { style: { alignSelf: 'stretch', width: '100%' }, children: [_jsxs(Animated.View, { style: boxStyleArray, onLayout: handleLayout, pointerEvents: disabled ? 'none' : 'auto', children: [_jsx(TextInput, { ...textInputProps, ref: ref, style: textInputStyle, value: value, onFocus: handleFocus, onBlur: handleBlur, onChangeText: handleTextChange, allowFontScaling: allowFontScaling, selectionColor: palette.grey[50], autoCorrect: false, spellCheck: false }), _jsx(ViewAtom, { pointerEvents: "none", style: { position: 'absolute' }, children: _jsx(Animated.Text, { allowFontScaling: allowFontScaling, style: labelStyleArray, children: label }) }), shouldShowCloseButton && (_jsx(ButtonClose, { marginTop: isTextArea ? 13 : undefined, onChangeText: onChangeText }))] }), shouldShowError && (_jsx(ErrorComponent, { errorMessage: errorMessage, errorColor: fErrorColor }))] }));
179
+ // 문자열이 View 자식으로 렌더되지 않도록 boolean 으로 강제 (web 'Unexpected text node' 경고 방지)
180
+ const shouldShowCloseButton = Boolean(value) && isFocusedForUI;
181
+ const shouldShowError = status === 'error' && errorMessage !== undefined && errorMessage !== '';
182
+ return (_jsxs(ViewAtom, { style: { alignSelf: 'stretch', width: '100%', opacity: disabled ? DISABLED_OPACITY : 1 }, children: [_jsxs(Animated.View, { style: boxStyleArray, onLayout: handleLayout, pointerEvents: disabled ? 'none' : 'auto', children: [_jsx(TextInput, { ...textInputProps, ref: ref, style: textInputStyle, value: value, onFocus: handleFocus, onBlur: handleBlur, onChangeText: handleTextChange, allowFontScaling: allowFontScaling, selectionColor: palette.grey[50], autoCorrect: false, spellCheck: false }), _jsx(ViewAtom, { pointerEvents: "none", style: { position: 'absolute' }, children: _jsx(Animated.Text, { allowFontScaling: allowFontScaling, style: labelStyleArray, children: label }) }), shouldShowCloseButton && (_jsx(ButtonClose, { marginTop: isTextArea ? 13 : undefined, onChangeText: onChangeText }))] }), shouldShowError && (_jsx(ErrorComponent, { errorMessage: errorMessage, errorColor: fErrorColor }))] }));
179
183
  });
180
184
  ZSTextField.displayName = 'ZSTextField';
181
185
  export default ZSTextField;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSTextField/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,EAAqB,QAAQ,EAAa,SAAS,EAA6B,MAAM,cAAc,CAAC;AAC5G,OAAO,QAAQ,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC9I,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAIzC,MAAM,SAAS,GAAG,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChD,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,aAAa,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,CAAC,MAAM,EAAE,CAAC;AA8BrF,MAAM,WAAW,GAAG,UAAU,CAAiC,CAAC,EAC9D,IAAI,GAAG,QAAQ,EACf,MAAM,GAAG,SAAS,EAClB,KAAK,EACL,YAAY,EACZ,KAAK,GAAG,aAAa,EACrB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,GAAG,GAAG,EACjB,WAAW,EACX,UAAU,EAC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B,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAChC,WAAW,EAAE,KAAK,EAClB,UAAU,EAAE,KAAK,GACjB,EAEF,KAAC,QAAQ,IAAC,aAAa,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,YAC5D,KAAC,QAAQ,CAAC,IAAI,IAAC,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,EAAE,eAAe,YACtE,KAAK,GACQ,GACP,EAEV,qBAAqB,IAAI,CACxB,KAAC,WAAW,IAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,EAAE,YAAY,GAAI,CACpF,IACa,EAEf,eAAe,IAAI,CAClB,KAAC,cAAc,IAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,GAAI,CACxE,IACQ,CACZ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,eAAe,WAAW,CAAC","sourcesContent":["import { useMemo, useCallback, useState, forwardRef, useEffect, useRef } from 'react';\nimport { LayoutChangeEvent, Platform, StyleProp, TextInput, TextInputProps, TextStyle } from 'react-native';\nimport Animated, { interpolate, interpolateColor, useAnimatedStyle, useSharedValue, withTiming, ReduceMotion } from 'react-native-reanimated';\nimport ButtonClose from './ui/ButtonClose';\nimport ErrorComponent from './ui/ErrorComponent';\nimport { TypoOptions, TypoStyle, TypoSubStyle } from '../../theme/types';\nimport { extractStyle } from '../../model/utils';\nimport { useTheme } from '../../context/ThemeContext';\nimport ViewAtom from '../atoms/ViewAtom';\n\nexport type BoxStyle = 'outline' | 'underline' | 'inbox';\n\nconst iosOffset = Platform.OS === 'ios' ? 8 : 4;\nconst ANIM_DURATION = 150;\nconst TIMING_CONFIG = { duration: ANIM_DURATION, reduceMotion: ReduceMotion.System };\n\ninterface TextFieldProps {\n typo?: TypoOptions;\n status?: 'default' | 'error';\n value: string;\n onChangeText?: (text: string) => void;\n inputBgColor?: string;\n labelBgColor?: string;\n label?: string;\n labelColor?: string;\n placeHolderColor?: string;\n fontSize?: number;\n borderColor?: string;\n borderRadius?: number;\n focusColor?: string;\n errorColor?: string;\n paddingHorizontal?: number;\n borderWidth?: number;\n errorMessage?: string;\n textInputProps?: TextInputProps;\n boxStyle?: BoxStyle;\n innerBoxStyle?: 'top' | 'middle' | 'bottom';\n disabled?: boolean;\n allowFontScaling?: boolean;\n isTextArea?: boolean;\n}\n\nexport type ZSTextFieldRef = TextInput;\n\nconst ZSTextField = forwardRef<ZSTextFieldRef, TextFieldProps>(({\n typo = 'body.2',\n status = 'default',\n value,\n onChangeText,\n label = 'Placeholder',\n labelColor,\n placeHolderColor,\n inputBgColor,\n labelBgColor,\n borderWidth = 1.2,\n borderColor,\n focusColor,\n errorColor,\n borderRadius = 14,\n paddingHorizontal = 15,\n errorMessage,\n textInputProps,\n boxStyle = 'outline',\n innerBoxStyle,\n disabled = false,\n allowFontScaling = true,\n isTextArea = false,\n}, ref) => {\n const { typography, palette } = useTheme();\n const [primaryStyle, subStyle] = typo.split('.') as [TypoStyle, TypoSubStyle];\n const fErrorColor = errorColor || palette.danger.main;\n\n const fontSize = extractStyle(typography[primaryStyle][subStyle], 'fontSize') as number || 17;\n const fontFamily = extractStyle(typography[primaryStyle][subStyle], 'fontFamily') as string || '';\n\n const isError = status === 'error';\n const hasValue = value !== '';\n\n const floatProgress = useSharedValue(hasValue ? 1 : 0);\n const focusProgress = useSharedValue(0);\n const errorProgress = useSharedValue(isError ? 1 : 0);\n const boxHeightValue = useSharedValue(0);\n\n const [isFocusedForUI, setIsFocusedForUI] = useState<boolean>(false);\n\n const isFocusedRef = useRef(false);\n const hasValueRef = useRef(hasValue);\n hasValueRef.current = hasValue;\n\n useEffect(() => {\n const target = hasValue ? 1 : 0;\n if (!isFocusedRef.current && floatProgress.value !== target) {\n floatProgress.value = withTiming(target, TIMING_CONFIG);\n }\n }, [hasValue]);\n\n useEffect(() => {\n const target = isError ? 1 : 0;\n if (errorProgress.value !== target) {\n errorProgress.value = withTiming(target, TIMING_CONFIG);\n }\n }, [isError]);\n\n const animationConstants = useMemo(() => ({\n baseFontSize: fontSize + (boxStyle === 'inbox' ? 1 : 0),\n targetFontSize: boxStyle === 'inbox' ? 10 : 11,\n baseTop: isTextArea ? 12 : 0,\n targetTopOffset: boxStyle === 'inbox' ? 17 : 2,\n }), [fontSize, boxStyle, isTextArea]);\n\n const colorConfig = useMemo(() => ({\n primaryColor: focusColor || palette.primary.main,\n defaultBorderColor: borderColor || palette.grey[30],\n defaultLabelColor: labelColor || palette.text.secondary,\n placeholderColor: placeHolderColor || palette.grey[40],\n errorColor: fErrorColor,\n }), [focusColor, palette.primary.main, borderColor, palette.grey, labelColor, palette.text.secondary, placeHolderColor, fErrorColor]);\n\n const nonFocusLabelColor = useMemo(\n () => (hasValue ? colorConfig.defaultLabelColor : colorConfig.placeholderColor),\n [hasValue, colorConfig.defaultLabelColor, colorConfig.placeholderColor]\n );\n\n const animatedLabelStyle = useAnimatedStyle(() => {\n const progress = floatProgress.value;\n\n const labelTranslateY = interpolate(\n progress,\n [0, 1],\n [\n 0,\n isTextArea ? -24 : -(boxHeightValue.value / 2) - 1 + animationConstants.targetTopOffset - animationConstants.baseTop,\n ],\n 'clamp'\n );\n\n const labelScale = interpolate(\n progress,\n [0, 1],\n [1, animationConstants.targetFontSize / animationConstants.baseFontSize],\n 'clamp'\n );\n\n const focusedColor = interpolateColor(focusProgress.value, [0, 1], [nonFocusLabelColor, colorConfig.primaryColor]);\n const color = interpolateColor(errorProgress.value, [0, 1], [focusedColor, colorConfig.errorColor]);\n\n return {\n color,\n transform: [\n { translateY: labelTranslateY },\n { scale: labelScale },\n ],\n };\n }, [animationConstants, isTextArea, nonFocusLabelColor, colorConfig.primaryColor, colorConfig.errorColor]);\n\n const animatedBorderStyle = useAnimatedStyle(() => {\n const focusedColor = interpolateColor(focusProgress.value, [0, 1], [colorConfig.defaultBorderColor, colorConfig.primaryColor]);\n const borderColor = interpolateColor(errorProgress.value, [0, 1], [focusedColor, colorConfig.errorColor]);\n return { borderColor };\n }, [colorConfig.defaultBorderColor, colorConfig.primaryColor, colorConfig.errorColor]);\n\n const handleLayout = useCallback((event: LayoutChangeEvent) => {\n const { height } = event.nativeEvent.layout;\n if (boxHeightValue.value !== height) {\n boxHeightValue.value = height;\n }\n }, []);\n\n const handleFocus = useCallback(() => {\n isFocusedRef.current = true;\n if (floatProgress.value !== 1) {\n floatProgress.value = withTiming(1, TIMING_CONFIG);\n }\n if (focusProgress.value !== 1) {\n focusProgress.value = withTiming(1, TIMING_CONFIG);\n }\n setIsFocusedForUI(true);\n }, []);\n\n const handleBlur = useCallback(() => {\n isFocusedRef.current = false;\n const target = hasValueRef.current ? 1 : 0;\n if (floatProgress.value !== target) {\n floatProgress.value = withTiming(target, TIMING_CONFIG);\n }\n if (focusProgress.value !== 0) {\n focusProgress.value = withTiming(0, TIMING_CONFIG);\n }\n setIsFocusedForUI(false);\n }, []);\n\n const styleConfig = useMemo(() => {\n const baseStyle = {\n width: '100%' as const,\n justifyContent: isTextArea ? 'flex-start' as const : 'center' as const,\n borderRadius,\n paddingHorizontal,\n backgroundColor: inputBgColor || palette.background.base,\n paddingTop: boxStyle === 'inbox' ? 13 : 0,\n };\n\n let borderStyle = {};\n if (boxStyle === 'outline' || boxStyle === 'inbox') {\n borderStyle = { borderWidth };\n } else if (boxStyle === 'underline') {\n borderStyle = { borderBottomWidth: borderWidth };\n }\n\n let innerStyle = {};\n if (innerBoxStyle === 'top') {\n innerStyle = {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomWidth: borderWidth / 2\n };\n } else if (innerBoxStyle === 'middle') {\n innerStyle = {\n borderRadius: 0,\n borderTopWidth: borderWidth / 2,\n borderBottomWidth: borderWidth / 2\n };\n } else if (innerBoxStyle === 'bottom') {\n innerStyle = {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTopWidth: borderWidth / 2\n };\n }\n\n return { ...baseStyle, ...borderStyle, ...innerStyle };\n }, [isTextArea, borderRadius, paddingHorizontal, inputBgColor, borderWidth, boxStyle, innerBoxStyle, palette.background.base]);\n\n const labelTextStyle: StyleProp<TextStyle> = useMemo(() => ({\n fontSize,\n top: animationConstants.baseTop,\n left: paddingHorizontal,\n transformOrigin: 'left center',\n backgroundColor: labelBgColor || palette.background.base,\n paddingHorizontal: boxStyle === 'outline' ? 5 : 0,\n paddingVertical: 2,\n textAlignVertical: 'center' as const,\n fontFamily,\n borderRadius: boxStyle === 'outline' ? 5 : 0,\n ...(Platform.OS === 'android' ? { overflow: 'hidden' as const } : {}),\n }), [fontSize, animationConstants.baseTop, paddingHorizontal, labelBgColor, palette.background.base, boxStyle, fontFamily]);\n\n const boxStyleArray = useMemo(\n () => [styleConfig, animatedBorderStyle],\n [styleConfig, animatedBorderStyle]\n );\n\n const labelStyleArray = useMemo(\n () => [labelTextStyle, animatedLabelStyle],\n [labelTextStyle, animatedLabelStyle]\n );\n\n const handleTextChange = (text: string) => {\n if (onChangeText) onChangeText(text);\n };\n\n const textInputStyle = useMemo(() => [\n {\n paddingTop: 7 + iosOffset,\n paddingBottom: 5 + iosOffset,\n color: palette.text.base,\n fontSize,\n width: '100%' as const,\n paddingRight: 25,\n fontFamily,\n ...(Platform.OS === 'web' ? { outline: 'none' } : {}),\n },\n textInputProps?.style,\n ], [palette.text.base, fontSize, fontFamily, textInputProps?.style]);\n\n const shouldShowCloseButton = value && isFocusedForUI;\n const shouldShowError = status === 'error' && errorMessage;\n\n return (\n <ViewAtom style={{ alignSelf: 'stretch', width: '100%' }}>\n <Animated.View\n style={boxStyleArray}\n onLayout={handleLayout}\n pointerEvents={disabled ? 'none' : 'auto'}\n >\n <TextInput\n {...textInputProps}\n ref={ref}\n style={textInputStyle}\n value={value}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={handleTextChange}\n allowFontScaling={allowFontScaling}\n selectionColor={palette.grey[50]}\n autoCorrect={false}\n spellCheck={false}\n />\n\n <ViewAtom pointerEvents=\"none\" style={{ position: 'absolute' }}>\n <Animated.Text allowFontScaling={allowFontScaling} style={labelStyleArray}>\n {label}\n </Animated.Text>\n </ViewAtom>\n\n {shouldShowCloseButton && (\n <ButtonClose marginTop={isTextArea ? 13 : undefined} onChangeText={onChangeText} />\n )}\n </Animated.View>\n\n {shouldShowError && (\n <ErrorComponent errorMessage={errorMessage} errorColor={fErrorColor} />\n )}\n </ViewAtom>\n );\n});\n\nZSTextField.displayName = 'ZSTextField';\n\nexport default ZSTextField;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSTextField/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,EAAqB,QAAQ,EAAa,SAAS,EAA6B,MAAM,cAAc,CAAC;AAC5G,OAAO,QAAQ,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC9I,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAIzC,MAAM,SAAS,GAAG,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChD,MAAM,aAAa,GA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AC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,EAAE,YAAY,GAAI,CACpF,IACa,EAEf,eAAe,IAAI,CAClB,KAAC,cAAc,IAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,GAAI,CACxE,IACQ,CACZ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,eAAe,WAAW,CAAC","sourcesContent":["import { useMemo, useCallback, useState, forwardRef, useEffect, useRef } from 'react';\nimport { LayoutChangeEvent, Platform, StyleProp, TextInput, TextInputProps, TextStyle } from 'react-native';\nimport Animated, { interpolate, interpolateColor, useAnimatedStyle, useSharedValue, withTiming, ReduceMotion } from 'react-native-reanimated';\nimport ButtonClose from './ui/ButtonClose';\nimport ErrorComponent from './ui/ErrorComponent';\nimport { TypoOptions, TypoStyle, TypoSubStyle } from '../../theme/types';\nimport { extractStyle } from '../../model/utils';\nimport { useTheme } from '../../context/ThemeContext';\nimport { DISABLED_OPACITY, DURATION, RADIUS } from '../../theme/tokens';\nimport ViewAtom from '../atoms/ViewAtom';\n\nexport type BoxStyle = 'outline' | 'underline' | 'inbox';\n\nconst iosOffset = Platform.OS === 'ios' ? 8 : 4;\nconst ANIM_DURATION = DURATION.fast;\nconst TIMING_CONFIG = { duration: ANIM_DURATION, reduceMotion: ReduceMotion.System };\n\ninterface TextFieldProps {\n typo?: TypoOptions;\n status?: 'default' | 'error';\n value: string;\n onChangeText?: (text: string) => void;\n inputBgColor?: string;\n labelBgColor?: string;\n label?: string;\n labelColor?: string;\n placeHolderColor?: string;\n fontSize?: number;\n borderColor?: string;\n borderRadius?: number;\n focusColor?: string;\n errorColor?: string;\n paddingHorizontal?: number;\n borderWidth?: number;\n errorMessage?: string;\n textInputProps?: TextInputProps;\n boxStyle?: BoxStyle;\n innerBoxStyle?: 'top' | 'middle' | 'bottom';\n disabled?: boolean;\n allowFontScaling?: boolean;\n isTextArea?: boolean;\n}\n\nexport type ZSTextFieldRef = TextInput;\n\nconst ZSTextField = forwardRef<ZSTextFieldRef, TextFieldProps>(({\n typo = 'body.2',\n status = 'default',\n value,\n onChangeText,\n label = 'Placeholder',\n labelColor,\n placeHolderColor,\n inputBgColor,\n labelBgColor,\n borderWidth = 1.2,\n borderColor,\n focusColor,\n errorColor,\n borderRadius = RADIUS.lg,\n paddingHorizontal = 15,\n errorMessage,\n textInputProps,\n boxStyle = 'outline',\n innerBoxStyle,\n disabled = false,\n allowFontScaling = true,\n isTextArea = false,\n}, ref) => {\n const { typography, palette } = useTheme();\n const [primaryStyle, subStyle] = typo.split('.') as [TypoStyle, TypoSubStyle];\n const fErrorColor = errorColor || palette.danger.main;\n\n const fontSize = extractStyle(typography[primaryStyle][subStyle], 'fontSize') as number || 17;\n const fontFamily = extractStyle(typography[primaryStyle][subStyle], 'fontFamily') as string || '';\n\n const isError = status === 'error';\n const hasValue = value !== '';\n\n const floatProgress = useSharedValue(hasValue ? 1 : 0);\n const focusProgress = useSharedValue(0);\n const errorProgress = useSharedValue(isError ? 1 : 0);\n const boxHeightValue = useSharedValue(0);\n\n const [isFocusedForUI, setIsFocusedForUI] = useState<boolean>(false);\n\n const isFocusedRef = useRef(false);\n const hasValueRef = useRef(hasValue);\n hasValueRef.current = hasValue;\n\n useEffect(() => {\n const target = hasValue ? 1 : 0;\n if (!isFocusedRef.current && floatProgress.value !== target) {\n floatProgress.value = withTiming(target, TIMING_CONFIG);\n }\n }, [hasValue]);\n\n useEffect(() => {\n const target = isError ? 1 : 0;\n if (errorProgress.value !== target) {\n errorProgress.value = withTiming(target, TIMING_CONFIG);\n }\n }, [isError]);\n\n const animationConstants = useMemo(() => ({\n baseFontSize: fontSize + (boxStyle === 'inbox' ? 1 : 0),\n targetFontSize: boxStyle === 'inbox' ? 10 : 11,\n baseTop: isTextArea ? 12 : 0,\n targetTopOffset: boxStyle === 'inbox' ? 17 : 2,\n }), [fontSize, boxStyle, isTextArea]);\n\n const colorConfig = useMemo(() => ({\n primaryColor: focusColor || palette.primary.main,\n defaultBorderColor: borderColor || palette.grey[30],\n defaultLabelColor: labelColor || palette.text.secondary,\n placeholderColor: placeHolderColor || palette.grey[40],\n errorColor: fErrorColor,\n }), [focusColor, palette.primary.main, borderColor, palette.grey, labelColor, palette.text.secondary, placeHolderColor, fErrorColor]);\n\n const nonFocusLabelColor = useMemo(\n () => (hasValue ? colorConfig.defaultLabelColor : colorConfig.placeholderColor),\n [hasValue, colorConfig.defaultLabelColor, colorConfig.placeholderColor]\n );\n\n const animatedLabelStyle = useAnimatedStyle(() => {\n const progress = floatProgress.value;\n\n const labelTranslateY = interpolate(\n progress,\n [0, 1],\n [\n 0,\n isTextArea ? -24 : -(boxHeightValue.value / 2) - 1 + animationConstants.targetTopOffset - animationConstants.baseTop,\n ],\n 'clamp'\n );\n\n const labelScale = interpolate(\n progress,\n [0, 1],\n [1, animationConstants.targetFontSize / animationConstants.baseFontSize],\n 'clamp'\n );\n\n const focusedColor = interpolateColor(focusProgress.value, [0, 1], [nonFocusLabelColor, colorConfig.primaryColor]);\n const color = interpolateColor(errorProgress.value, [0, 1], [focusedColor, colorConfig.errorColor]);\n\n return {\n color,\n transform: [\n { translateY: labelTranslateY },\n { scale: labelScale },\n ],\n };\n }, [animationConstants, isTextArea, nonFocusLabelColor, colorConfig.primaryColor, colorConfig.errorColor]);\n\n const animatedBorderStyle = useAnimatedStyle(() => {\n const focusedColor = interpolateColor(focusProgress.value, [0, 1], [colorConfig.defaultBorderColor, colorConfig.primaryColor]);\n const borderColor = interpolateColor(errorProgress.value, [0, 1], [focusedColor, colorConfig.errorColor]);\n return { borderColor };\n }, [colorConfig.defaultBorderColor, colorConfig.primaryColor, colorConfig.errorColor]);\n\n const handleLayout = useCallback((event: LayoutChangeEvent) => {\n const { height } = event.nativeEvent.layout;\n if (boxHeightValue.value !== height) {\n boxHeightValue.value = height;\n }\n }, []);\n\n const handleFocus = useCallback<NonNullable<TextInputProps['onFocus']>>((event) => {\n isFocusedRef.current = true;\n if (floatProgress.value !== 1) {\n floatProgress.value = withTiming(1, TIMING_CONFIG);\n }\n if (focusProgress.value !== 1) {\n focusProgress.value = withTiming(1, TIMING_CONFIG);\n }\n setIsFocusedForUI(true);\n textInputProps?.onFocus?.(event);\n }, [textInputProps?.onFocus]);\n\n const handleBlur = useCallback<NonNullable<TextInputProps['onBlur']>>((event) => {\n isFocusedRef.current = false;\n const target = hasValueRef.current ? 1 : 0;\n if (floatProgress.value !== target) {\n floatProgress.value = withTiming(target, TIMING_CONFIG);\n }\n if (focusProgress.value !== 0) {\n focusProgress.value = withTiming(0, TIMING_CONFIG);\n }\n setIsFocusedForUI(false);\n textInputProps?.onBlur?.(event);\n }, [textInputProps?.onBlur]);\n\n const styleConfig = useMemo(() => {\n const baseStyle = {\n width: '100%' as const,\n justifyContent: isTextArea ? 'flex-start' as const : 'center' as const,\n borderRadius,\n paddingHorizontal,\n backgroundColor: inputBgColor || palette.background.base,\n paddingTop: boxStyle === 'inbox' ? 13 : 0,\n };\n\n let borderStyle = {};\n if (boxStyle === 'outline' || boxStyle === 'inbox') {\n borderStyle = { borderWidth };\n } else if (boxStyle === 'underline') {\n borderStyle = { borderBottomWidth: borderWidth };\n }\n\n let innerStyle = {};\n if (innerBoxStyle === 'top') {\n innerStyle = {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomWidth: borderWidth / 2\n };\n } else if (innerBoxStyle === 'middle') {\n innerStyle = {\n borderRadius: 0,\n borderTopWidth: borderWidth / 2,\n borderBottomWidth: borderWidth / 2\n };\n } else if (innerBoxStyle === 'bottom') {\n innerStyle = {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTopWidth: borderWidth / 2\n };\n }\n\n return { ...baseStyle, ...borderStyle, ...innerStyle };\n }, [isTextArea, borderRadius, paddingHorizontal, inputBgColor, borderWidth, boxStyle, innerBoxStyle, palette.background.base]);\n\n const labelTextStyle: StyleProp<TextStyle> = useMemo(() => ({\n fontSize,\n top: animationConstants.baseTop,\n left: paddingHorizontal,\n transformOrigin: 'left center',\n backgroundColor: labelBgColor || palette.background.base,\n paddingHorizontal: boxStyle === 'outline' ? 5 : 0,\n paddingVertical: 2,\n textAlignVertical: 'center' as const,\n fontFamily,\n borderRadius: boxStyle === 'outline' ? 5 : 0,\n ...(Platform.OS === 'android' ? { overflow: 'hidden' as const } : {}),\n }), [fontSize, animationConstants.baseTop, paddingHorizontal, labelBgColor, palette.background.base, boxStyle, fontFamily]);\n\n const boxStyleArray = useMemo(\n () => [styleConfig, animatedBorderStyle],\n [styleConfig, animatedBorderStyle]\n );\n\n const labelStyleArray = useMemo(\n () => [labelTextStyle, animatedLabelStyle],\n [labelTextStyle, animatedLabelStyle]\n );\n\n const handleTextChange = useCallback((text: string) => {\n onChangeText?.(text);\n textInputProps?.onChangeText?.(text);\n }, [onChangeText, textInputProps?.onChangeText]);\n\n const textInputStyle = useMemo(() => [\n {\n paddingTop: 7 + iosOffset,\n paddingBottom: 5 + iosOffset,\n color: palette.text.base,\n fontSize,\n width: '100%' as const,\n paddingRight: 25,\n fontFamily,\n ...(Platform.OS === 'web' ? { outline: 'none' } : {}),\n },\n textInputProps?.style,\n ], [palette.text.base, fontSize, fontFamily, textInputProps?.style]);\n\n // 빈 문자열이 View 자식으로 렌더되지 않도록 boolean 으로 강제 (web 'Unexpected text node' 경고 방지)\n const shouldShowCloseButton = Boolean(value) && isFocusedForUI;\n const shouldShowError = status === 'error' && errorMessage !== undefined && errorMessage !== '';\n\n return (\n <ViewAtom style={{ alignSelf: 'stretch', width: '100%', opacity: disabled ? DISABLED_OPACITY : 1 }}>\n <Animated.View\n style={boxStyleArray}\n onLayout={handleLayout}\n pointerEvents={disabled ? 'none' : 'auto'}\n >\n <TextInput\n {...textInputProps}\n ref={ref}\n style={textInputStyle}\n value={value}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={handleTextChange}\n allowFontScaling={allowFontScaling}\n selectionColor={palette.grey[50]}\n autoCorrect={false}\n spellCheck={false}\n />\n\n <ViewAtom pointerEvents=\"none\" style={{ position: 'absolute' }}>\n <Animated.Text allowFontScaling={allowFontScaling} style={labelStyleArray}>\n {label}\n </Animated.Text>\n </ViewAtom>\n\n {shouldShowCloseButton && (\n <ButtonClose marginTop={isTextArea ? 13 : undefined} onChangeText={onChangeText} />\n )}\n </Animated.View>\n\n {shouldShowError && (\n <ErrorComponent errorMessage={errorMessage} errorColor={fErrorColor} />\n )}\n </ViewAtom>\n );\n});\n\nZSTextField.displayName = 'ZSTextField';\n\nexport default ZSTextField;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonClose.d.ts","sourceRoot":"","sources":["../../../../src/ui/ZSTextField/ui/ButtonClose.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAG5E,QAAA,MAAM,WAAW,GAAI,uCAIlB;IACC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,qBAAqB,gCAUxB,CAAA;AAED,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"ButtonClose.d.ts","sourceRoot":"","sources":["../../../../src/ui/ZSTextField/ui/ButtonClose.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAK5E,QAAA,MAAM,WAAW,GAAI,uCAIlB;IACC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,qBAAqB,gCAYxB,CAAA;AAED,eAAe,WAAW,CAAC"}
@@ -1,8 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { TouchableOpacity } from "react-native";
3
3
  import { SvgX } from "../../../assets/SvgX";
4
+ import { useTheme } from "../../../context/ThemeContext";
5
+ import { RADIUS } from "../../../theme/tokens";
4
6
  const ButtonClose = ({ onChangeText, marginTop, ...props }) => {
5
- return (_jsx(TouchableOpacity, { style: { position: 'absolute', padding: 3, right: 15, borderRadius: 30, backgroundColor: '#e6e6e6', justifyContent: 'center', alignItems: 'center', ...marginTop && { top: marginTop } }, hitSlop: { top: 10, right: 10, bottom: 10, left: 10 }, onPress: () => { onChangeText?.(''); }, ...props, children: _jsx(SvgX, { color: "#5E696E" }) }));
7
+ const { palette } = useTheme();
8
+ return (_jsx(TouchableOpacity, { style: { position: 'absolute', padding: 3, right: 15, borderRadius: RADIUS.pill, backgroundColor: palette.grey[30], justifyContent: 'center', alignItems: 'center', ...marginTop && { top: marginTop } }, hitSlop: { top: 10, right: 10, bottom: 10, left: 10 }, onPress: () => { onChangeText?.(''); }, ...props, children: _jsx(SvgX, { color: palette.grey[60] }) }));
6
9
  };
7
10
  export default ButtonClose;
8
11
  //# sourceMappingURL=ButtonClose.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonClose.js","sourceRoot":"","sources":["../../../../src/ui/ZSTextField/ui/ButtonClose.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAA8B,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,MAAM,WAAW,GAAG,CAAC,EACjB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EAIa,EAAE,EAAE;IACzB,OAAO,CACH,KAAC,gBAAgB,IACb,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,SAAS,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EACxL,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EACrD,OAAO,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAClC,KAAK,YACT,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,GAAG,GACT,CACtB,CAAA;AACL,CAAC,CAAA;AAED,eAAe,WAAW,CAAC","sourcesContent":["import { TouchableOpacity, type TouchableOpacityProps } from \"react-native\";\nimport { SvgX } from \"../../../assets/SvgX\";\n\nconst ButtonClose = ({\n onChangeText,\n marginTop,\n ...props\n}: {\n onChangeText?: (text: string) => void;\n marginTop?: number;\n} & TouchableOpacityProps) => {\n return (\n <TouchableOpacity\n style={{ position: 'absolute', padding: 3, right: 15, borderRadius: 30, backgroundColor: '#e6e6e6', justifyContent: 'center', alignItems: 'center', ...marginTop && { top: marginTop } }}\n hitSlop={{ top: 10, right: 10, bottom: 10, left: 10 }}\n onPress={() => { onChangeText?.(''); }}\n {...props}>\n <SvgX color=\"#5E696E\" />\n </TouchableOpacity>\n )\n}\n\nexport default ButtonClose;\n"]}
1
+ {"version":3,"file":"ButtonClose.js","sourceRoot":"","sources":["../../../../src/ui/ZSTextField/ui/ButtonClose.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAA8B,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,WAAW,GAAG,CAAC,EACjB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EAIa,EAAE,EAAE;IACzB,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC;IAE/B,OAAO,CACH,KAAC,gBAAgB,IACb,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,SAAS,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EACxM,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EACrD,OAAO,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAClC,KAAK,YACT,KAAC,IAAI,IAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAI,GAClB,CACtB,CAAA;AACL,CAAC,CAAA;AAED,eAAe,WAAW,CAAC","sourcesContent":["import { TouchableOpacity, type TouchableOpacityProps } from \"react-native\";\nimport { SvgX } from \"../../../assets/SvgX\";\nimport { useTheme } from \"../../../context/ThemeContext\";\nimport { RADIUS } from \"../../../theme/tokens\";\n\nconst ButtonClose = ({\n onChangeText,\n marginTop,\n ...props\n}: {\n onChangeText?: (text: string) => void;\n marginTop?: number;\n} & TouchableOpacityProps) => {\n const { palette } = useTheme();\n\n return (\n <TouchableOpacity\n style={{ position: 'absolute', padding: 3, right: 15, borderRadius: RADIUS.pill, backgroundColor: palette.grey[30], justifyContent: 'center', alignItems: 'center', ...marginTop && { top: marginTop } }}\n hitSlop={{ top: 10, right: 10, bottom: 10, left: 10 }}\n onPress={() => { onChangeText?.(''); }}\n {...props}>\n <SvgX color={palette.grey[60]} />\n </TouchableOpacity>\n )\n}\n\nexport default ButtonClose;\n"]}
@@ -0,0 +1,38 @@
1
+ import React from "react";
2
+ import { type StyleProp, type ViewProps, type ViewStyle } from "react-native";
3
+ import type { TypoOptions } from "../../theme/types";
4
+ export type ZSTooltipPlacement = 'top' | 'bottom';
5
+ export type ZSTooltipTailAlign = 'start' | 'center' | 'end';
6
+ export interface ZSTooltipProps extends ViewProps {
7
+ /** 말풍선 메시지 (children 지정 시 children 우선) */
8
+ message?: string;
9
+ /** 커스텀 콘텐츠 */
10
+ children?: React.ReactNode;
11
+ /** 표시 여부를 외부에서 제어할 때 사용 (미지정 시 내부 상태로 동작) */
12
+ visible?: boolean;
13
+ /** 비제어 모드의 초기 표시 상태 */
14
+ initialVisible?: boolean;
15
+ /** 닫기 버튼 탭 시 호출 */
16
+ onClose?: () => void;
17
+ /** 앵커 기준 말풍선 위치 — top 이면 꼬리가 아래를 향함 (기본: top) */
18
+ placement?: ZSTooltipPlacement;
19
+ /** true면 닫기(X) 버튼 표시 */
20
+ showClose?: boolean;
21
+ /** true면 위아래로 살짝 떠다니는 애니메이션 */
22
+ floating?: boolean;
23
+ /** 말풍선 배경색 (기본: 테마 반전 색 — light 는 어두운 배경, dark 는 밝은 배경) */
24
+ backgroundColor?: string;
25
+ /** 메시지·닫기 아이콘 색 (기본: palette.background.base) */
26
+ textColor?: string;
27
+ typo?: TypoOptions;
28
+ /** 꼬리 정렬 (기본: start) */
29
+ tailAlign?: ZSTooltipTailAlign;
30
+ /** start/end 정렬 시 가장자리에서 꼬리까지의 간격 */
31
+ tailOffset?: number;
32
+ closeAccessibilityLabel?: string;
33
+ style?: StyleProp<ViewStyle>;
34
+ }
35
+ declare function ZSTooltip({ message, children, visible, initialVisible, onClose, placement, showClose, floating, backgroundColor, textColor, typo, tailAlign, tailOffset, closeAccessibilityLabel, style, ...props }: ZSTooltipProps): React.JSX.Element | null;
36
+ declare const _default: React.MemoExoticComponent<typeof ZSTooltip>;
37
+ export default _default;
38
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSTooltip/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAA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eAAe,EACf,SAAS,EACT,IAAe,EACf,SAAmB,EACnB,UAAe,EACf,uBAAiC,EACjC,KAAK,EACL,GAAG,KAAK,EACT,EAAE,cAAc,4BAgGhB;;AAED,wBAAqC"}
@@ -0,0 +1,99 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useEffect, useState } from "react";
3
+ import { Pressable, StyleSheet, View } from "react-native";
4
+ import Animated, { cancelAnimation, Easing, FadeInDown, FadeInUp, FadeOutDown, FadeOutUp, useAnimatedStyle, useSharedValue, withDelay, withRepeat, withTiming, } from "react-native-reanimated";
5
+ import ZSText from "../ZSText";
6
+ import { useTheme } from "../../context/ThemeContext";
7
+ import { DURATION, RADIUS } from "../../theme/tokens";
8
+ import { SvgX } from "../../assets/SvgX";
9
+ import { SvgTooltipTail } from "../../assets/SvgTooltipTail";
10
+ const FLOATING_START_DELAY = 220;
11
+ const FLOATING_ANIMATION_DURATION = 1100;
12
+ const FLOATING_OFFSET = 2;
13
+ const TAIL_WIDTH = 12;
14
+ const TAIL_HEIGHT = 7;
15
+ const CLOSE_HIT_SLOP = { top: 8, bottom: 8, left: 8, right: 8 };
16
+ function ZSTooltip({ message, children, visible, initialVisible = true, onClose, placement = 'top', showClose = false, floating = false, backgroundColor, textColor, typo = 'body.4', tailAlign = 'start', tailOffset = 16, closeAccessibilityLabel = '툴팁 닫기', style, ...props }) {
17
+ const { palette } = useTheme();
18
+ const [internalVisible, setInternalVisible] = useState(initialVisible);
19
+ const isVisible = visible ?? internalVisible;
20
+ const floatingTranslateY = useSharedValue(0);
21
+ // 테마 반전 표면: light 는 어두운 말풍선 + 밝은 텍스트, dark 는 그 반대
22
+ const bubbleColor = backgroundColor ?? palette.grey[90];
23
+ const contentColor = textColor ?? palette.background.base;
24
+ useEffect(() => {
25
+ if (!floating || !isVisible)
26
+ return;
27
+ floatingTranslateY.value = 0;
28
+ floatingTranslateY.value = withDelay(FLOATING_START_DELAY, withRepeat(withTiming(-FLOATING_OFFSET, {
29
+ duration: FLOATING_ANIMATION_DURATION,
30
+ easing: Easing.inOut(Easing.ease),
31
+ }), -1, true));
32
+ return () => {
33
+ cancelAnimation(floatingTranslateY);
34
+ };
35
+ }, [floating, isVisible, floatingTranslateY]);
36
+ const floatingStyle = useAnimatedStyle(() => ({
37
+ transform: [{ translateY: floatingTranslateY.value }],
38
+ }));
39
+ const handleClose = () => {
40
+ if (visible === undefined)
41
+ setInternalVisible(false);
42
+ onClose?.();
43
+ };
44
+ if (!isVisible)
45
+ return null;
46
+ const isTop = placement === 'top';
47
+ const tail = (_jsx(View, { pointerEvents: 'none', style: [
48
+ tailAlign === 'center'
49
+ ? styles.tailCenter
50
+ : tailAlign === 'end'
51
+ ? { alignSelf: 'flex-end', marginRight: tailOffset }
52
+ : { alignSelf: 'flex-start', marginLeft: tailOffset },
53
+ // 말풍선과 꼬리 사이 헤어라인 틈 방지 오버랩 · bottom 은 180도 회전
54
+ isTop ? styles.tailTop : styles.tailBottom,
55
+ ], children: _jsx(SvgTooltipTail, { width: TAIL_WIDTH, height: TAIL_HEIGHT, color: bubbleColor }) }));
56
+ return (_jsx(Animated.View, { entering: (isTop ? FadeInUp : FadeInDown).duration(DURATION.fast).easing(Easing.out(Easing.quad)), exiting: (isTop ? FadeOutDown : FadeOutUp).duration(DURATION.fast).easing(Easing.in(Easing.quad)), pointerEvents: 'box-none', style: [styles.container, { shadowColor: palette.grey[100] }, style], ...props, children: _jsxs(Animated.View, { style: floatingStyle, children: [!isTop && tail, _jsx(View, { style: [styles.bubble, { backgroundColor: bubbleColor }], children: _jsxs(View, { style: styles.contentRow, children: [children ?? (_jsx(ZSText, { typo: typo, style: [styles.message, { color: contentColor }], children: message })), showClose && (_jsx(Pressable, { accessibilityLabel: closeAccessibilityLabel, accessibilityRole: 'button', hitSlop: CLOSE_HIT_SLOP, onPress: handleClose, style: styles.closeButton, testID: 'zs-tooltip-close', children: _jsx(SvgX, { size: 10, color: contentColor }) }))] }) }), isTop && tail] }) }));
57
+ }
58
+ export default React.memo(ZSTooltip);
59
+ const styles = StyleSheet.create({
60
+ container: {
61
+ alignSelf: 'flex-start',
62
+ maxWidth: '100%',
63
+ shadowOffset: { width: 0, height: 4 },
64
+ shadowOpacity: 0.16,
65
+ shadowRadius: 8,
66
+ elevation: 6,
67
+ },
68
+ bubble: {
69
+ borderRadius: RADIUS.lg,
70
+ maxWidth: '100%',
71
+ paddingHorizontal: 12,
72
+ paddingVertical: 8,
73
+ },
74
+ contentRow: {
75
+ alignItems: 'center',
76
+ flexDirection: 'row',
77
+ gap: 6,
78
+ },
79
+ message: {
80
+ flexShrink: 1,
81
+ },
82
+ closeButton: {
83
+ alignItems: 'center',
84
+ justifyContent: 'center',
85
+ width: 20,
86
+ height: 20,
87
+ },
88
+ tailCenter: {
89
+ alignSelf: 'center',
90
+ },
91
+ tailTop: {
92
+ marginTop: -0.5,
93
+ },
94
+ tailBottom: {
95
+ marginBottom: -0.5,
96
+ transform: [{ rotate: '180deg' }],
97
+ },
98
+ });
99
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSTooltip/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAkD,MAAM,cAAc,CAAC;AAC3G,OAAO,QAAQ,EAAE,EACf,eAAe,EACf,MAAM,EACN,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,UAAU,EACV,UAAU,GACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACt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KAClC;CACF,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { Pressable, StyleSheet, View, type StyleProp, type ViewProps, type ViewStyle } from \"react-native\";\nimport Animated, {\n cancelAnimation,\n Easing,\n FadeInDown,\n FadeInUp,\n FadeOutDown,\n FadeOutUp,\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withRepeat,\n withTiming,\n} from \"react-native-reanimated\";\nimport ZSText from \"../ZSText\";\nimport { useTheme } from \"../../context/ThemeContext\";\nimport { DURATION, RADIUS } from \"../../theme/tokens\";\nimport { SvgX } from \"../../assets/SvgX\";\nimport { SvgTooltipTail } from \"../../assets/SvgTooltipTail\";\nimport type { TypoOptions } from \"../../theme/types\";\n\nconst FLOATING_START_DELAY = 220;\nconst FLOATING_ANIMATION_DURATION = 1100;\nconst FLOATING_OFFSET = 2;\nconst TAIL_WIDTH = 12;\nconst TAIL_HEIGHT = 7;\nconst CLOSE_HIT_SLOP = { top: 8, bottom: 8, left: 8, right: 8 };\n\nexport type ZSTooltipPlacement = 'top' | 'bottom';\nexport type ZSTooltipTailAlign = 'start' | 'center' | 'end';\n\nexport interface ZSTooltipProps extends ViewProps {\n /** 말풍선 메시지 (children 지정 시 children 우선) */\n message?: string;\n /** 커스텀 콘텐츠 */\n children?: React.ReactNode;\n /** 표시 여부를 외부에서 제어할 때 사용 (미지정 시 내부 상태로 동작) */\n visible?: boolean;\n /** 비제어 모드의 초기 표시 상태 */\n initialVisible?: boolean;\n /** 닫기 버튼 탭 시 호출 */\n onClose?: () => void;\n /** 앵커 기준 말풍선 위치 — top 이면 꼬리가 아래를 향함 (기본: top) */\n placement?: ZSTooltipPlacement;\n /** true면 닫기(X) 버튼 표시 */\n showClose?: boolean;\n /** true면 위아래로 살짝 떠다니는 애니메이션 */\n floating?: boolean;\n /** 말풍선 배경색 (기본: 테마 반전 색 — light 는 어두운 배경, dark 는 밝은 배경) */\n backgroundColor?: string;\n /** 메시지·닫기 아이콘 색 (기본: palette.background.base) */\n textColor?: string;\n typo?: TypoOptions;\n /** 꼬리 정렬 (기본: start) */\n tailAlign?: ZSTooltipTailAlign;\n /** start/end 정렬 시 가장자리에서 꼬리까지의 간격 */\n tailOffset?: number;\n closeAccessibilityLabel?: string;\n style?: StyleProp<ViewStyle>;\n}\n\nfunction ZSTooltip({\n message,\n children,\n visible,\n initialVisible = true,\n onClose,\n placement = 'top',\n showClose = false,\n floating = false,\n backgroundColor,\n textColor,\n typo = 'body.4',\n tailAlign = 'start',\n tailOffset = 16,\n closeAccessibilityLabel = '툴팁 닫기',\n style,\n ...props\n}: ZSTooltipProps) {\n const { palette } = useTheme();\n const [internalVisible, setInternalVisible] = useState(initialVisible);\n const isVisible = visible ?? internalVisible;\n const floatingTranslateY = useSharedValue(0);\n\n // 테마 반전 표면: light 는 어두운 말풍선 + 밝은 텍스트, dark 는 그 반대\n const bubbleColor = backgroundColor ?? palette.grey[90];\n const contentColor = textColor ?? palette.background.base;\n\n useEffect(() => {\n if (!floating || !isVisible) return;\n\n floatingTranslateY.value = 0;\n floatingTranslateY.value = withDelay(\n FLOATING_START_DELAY,\n withRepeat(\n withTiming(-FLOATING_OFFSET, {\n duration: FLOATING_ANIMATION_DURATION,\n easing: Easing.inOut(Easing.ease),\n }),\n -1,\n true,\n ),\n );\n\n return () => {\n cancelAnimation(floatingTranslateY);\n };\n }, [floating, isVisible, floatingTranslateY]);\n\n const floatingStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: floatingTranslateY.value }],\n }));\n\n const handleClose = () => {\n if (visible === undefined) setInternalVisible(false);\n onClose?.();\n };\n\n if (!isVisible) return null;\n\n const isTop = placement === 'top';\n\n const tail = (\n <View\n pointerEvents='none'\n style={[\n tailAlign === 'center'\n ? styles.tailCenter\n : tailAlign === 'end'\n ? { alignSelf: 'flex-end', marginRight: tailOffset }\n : { alignSelf: 'flex-start', marginLeft: tailOffset },\n // 말풍선과 꼬리 사이 헤어라인 틈 방지 오버랩 · bottom 은 180도 회전\n isTop ? styles.tailTop : styles.tailBottom,\n ]}\n >\n <SvgTooltipTail width={TAIL_WIDTH} height={TAIL_HEIGHT} color={bubbleColor} />\n </View>\n );\n\n return (\n <Animated.View\n entering={(isTop ? FadeInUp : FadeInDown).duration(DURATION.fast).easing(Easing.out(Easing.quad))}\n exiting={(isTop ? FadeOutDown : FadeOutUp).duration(DURATION.fast).easing(Easing.in(Easing.quad))}\n pointerEvents='box-none'\n style={[styles.container, { shadowColor: palette.grey[100] }, style]}\n {...props}\n >\n <Animated.View style={floatingStyle}>\n {!isTop && tail}\n <View style={[styles.bubble, { backgroundColor: bubbleColor }]}>\n <View style={styles.contentRow}>\n {children ?? (\n <ZSText typo={typo} style={[styles.message, { color: contentColor }]}>\n {message}\n </ZSText>\n )}\n {showClose && (\n <Pressable\n accessibilityLabel={closeAccessibilityLabel}\n accessibilityRole='button'\n hitSlop={CLOSE_HIT_SLOP}\n onPress={handleClose}\n style={styles.closeButton}\n testID='zs-tooltip-close'\n >\n <SvgX size={10} color={contentColor} />\n </Pressable>\n )}\n </View>\n </View>\n {isTop && tail}\n </Animated.View>\n </Animated.View>\n );\n}\n\nexport default React.memo(ZSTooltip);\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: 'flex-start',\n maxWidth: '100%',\n shadowOffset: { width: 0, height: 4 },\n shadowOpacity: 0.16,\n shadowRadius: 8,\n elevation: 6,\n },\n bubble: {\n borderRadius: RADIUS.lg,\n maxWidth: '100%',\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n contentRow: {\n alignItems: 'center',\n flexDirection: 'row',\n gap: 6,\n },\n message: {\n flexShrink: 1,\n },\n closeButton: {\n alignItems: 'center',\n justifyContent: 'center',\n width: 20,\n height: 20,\n },\n tailCenter: {\n alignSelf: 'center',\n },\n tailTop: {\n marginTop: -0.5,\n },\n tailBottom: {\n marginBottom: -0.5,\n transform: [{ rotate: '180deg' }],\n },\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0610studio/zs-ui",
3
- "version": "0.18.1",
3
+ "version": "0.19.0",
4
4
  "private": false,
5
5
  "description": "EXPO ZS-UI",
6
6
  "type": "commonjs",
@@ -42,6 +42,7 @@
42
42
  "homepage": "https://github.com/0610studio/zs-ui",
43
43
  "devDependencies": {
44
44
  "@babel/core": "^7.20.0",
45
+ "@shopify/react-native-skia": "2.6.6",
45
46
  "@babel/plugin-transform-modules-commonjs": "^7.29.7",
46
47
  "@babel/preset-react": "^7.29.7",
47
48
  "@babel/preset-typescript": "^7.29.7",
@@ -75,6 +76,7 @@
75
76
  },
76
77
  "peerDependencies": {
77
78
  "@react-native-async-storage/async-storage": "*",
79
+ "@shopify/react-native-skia": ">=2.0.0",
78
80
  "expo": ">=56.0.0",
79
81
  "expo-navigation-bar": ">=56.0.0",
80
82
  "expo-router": "*",
@@ -89,6 +91,9 @@
89
91
  "@react-native-async-storage/async-storage": {
90
92
  "optional": false
91
93
  },
94
+ "@shopify/react-native-skia": {
95
+ "optional": false
96
+ },
92
97
  "expo-navigation-bar": {
93
98
  "optional": false
94
99
  },