@0610studio/zs-ui 0.18.0 → 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 (164) hide show
  1. package/build/ZsUiModule.d.ts.map +1 -1
  2. package/build/ZsUiModule.js +0 -2
  3. package/build/ZsUiModule.js.map +1 -1
  4. package/build/assets/SvgExclamation.d.ts.map +1 -1
  5. package/build/assets/SvgExclamation.js.map +1 -1
  6. package/build/assets/SvgTooltipTail.d.ts +7 -0
  7. package/build/assets/SvgTooltipTail.d.ts.map +1 -0
  8. package/build/assets/SvgTooltipTail.js +7 -0
  9. package/build/assets/SvgTooltipTail.js.map +1 -0
  10. package/build/context/OverlayContext.d.ts.map +1 -1
  11. package/build/context/OverlayContext.js +11 -14
  12. package/build/context/OverlayContext.js.map +1 -1
  13. package/build/context/ThemeContext.d.ts +9 -0
  14. package/build/context/ThemeContext.d.ts.map +1 -1
  15. package/build/context/ThemeContext.js +24 -15
  16. package/build/context/ThemeContext.js.map +1 -1
  17. package/build/index.d.ts +16 -3
  18. package/build/index.d.ts.map +1 -1
  19. package/build/index.js +7 -7
  20. package/build/index.js.map +1 -1
  21. package/build/model/globalOverlay.d.ts +0 -8
  22. package/build/model/globalOverlay.d.ts.map +1 -1
  23. package/build/model/globalOverlay.js +0 -9
  24. package/build/model/globalOverlay.js.map +1 -1
  25. package/build/model/types.d.ts +2 -1
  26. package/build/model/types.d.ts.map +1 -1
  27. package/build/model/types.js.map +1 -1
  28. package/build/model/useFoldingState.d.ts.map +1 -1
  29. package/build/model/useFoldingState.js +51 -32
  30. package/build/model/useFoldingState.js.map +1 -1
  31. package/build/model/useKeyboard.d.ts.map +1 -1
  32. package/build/model/useKeyboard.js +8 -4
  33. package/build/model/useKeyboard.js.map +1 -1
  34. package/build/model/utils.d.ts +1 -1
  35. package/build/model/utils.d.ts.map +1 -1
  36. package/build/model/utils.js +2 -1
  37. package/build/model/utils.js.map +1 -1
  38. package/build/overlay/AlertOverlay/index.d.ts +1 -2
  39. package/build/overlay/AlertOverlay/index.d.ts.map +1 -1
  40. package/build/overlay/AlertOverlay/index.js +13 -11
  41. package/build/overlay/AlertOverlay/index.js.map +1 -1
  42. package/build/overlay/BottomSheetOverlay/index.d.ts.map +1 -1
  43. package/build/overlay/BottomSheetOverlay/index.js +22 -11
  44. package/build/overlay/BottomSheetOverlay/index.js.map +1 -1
  45. package/build/overlay/LoadingNotify/index.d.ts +2 -2
  46. package/build/overlay/LoadingNotify/index.d.ts.map +1 -1
  47. package/build/overlay/LoadingNotify/index.js +2 -2
  48. package/build/overlay/LoadingNotify/index.js.map +1 -1
  49. package/build/overlay/Modality/index.d.ts.map +1 -1
  50. package/build/overlay/Modality/index.js +6 -12
  51. package/build/overlay/Modality/index.js.map +1 -1
  52. package/build/overlay/PopOver/PopOverMenu.d.ts.map +1 -1
  53. package/build/overlay/PopOver/PopOverMenu.js +7 -8
  54. package/build/overlay/PopOver/PopOverMenu.js.map +1 -1
  55. package/build/overlay/SnackbarNotify/index.d.ts +3 -3
  56. package/build/overlay/SnackbarNotify/index.d.ts.map +1 -1
  57. package/build/overlay/SnackbarNotify/index.js +5 -4
  58. package/build/overlay/SnackbarNotify/index.js.map +1 -1
  59. package/build/overlay/SnackbarNotify/ui/SnackbarItem.d.ts +4 -4
  60. package/build/overlay/SnackbarNotify/ui/SnackbarItem.d.ts.map +1 -1
  61. package/build/overlay/SnackbarNotify/ui/SnackbarItem.js +9 -9
  62. package/build/overlay/SnackbarNotify/ui/SnackbarItem.js.map +1 -1
  63. package/build/overlay/ZSPortal/index.d.ts.map +1 -1
  64. package/build/overlay/ZSPortal/index.js +15 -4
  65. package/build/overlay/ZSPortal/index.js.map +1 -1
  66. package/build/overlay/ui/ModalBackground.js.map +1 -1
  67. package/build/theme/elevation.d.ts +94 -10
  68. package/build/theme/elevation.d.ts.map +1 -1
  69. package/build/theme/elevation.js +39 -35
  70. package/build/theme/elevation.js.map +1 -1
  71. package/build/theme/intentColors.d.ts +9 -0
  72. package/build/theme/intentColors.d.ts.map +1 -0
  73. package/build/theme/intentColors.js +30 -0
  74. package/build/theme/intentColors.js.map +1 -0
  75. package/build/theme/palette.d.ts +1 -5
  76. package/build/theme/palette.d.ts.map +1 -1
  77. package/build/theme/palette.js +3 -12
  78. package/build/theme/palette.js.map +1 -1
  79. package/build/theme/resolveColor.d.ts +4 -0
  80. package/build/theme/resolveColor.d.ts.map +1 -0
  81. package/build/theme/resolveColor.js +29 -0
  82. package/build/theme/resolveColor.js.map +1 -0
  83. package/build/theme/tokens.d.ts +35 -0
  84. package/build/theme/tokens.d.ts.map +1 -0
  85. package/build/theme/tokens.js +35 -0
  86. package/build/theme/tokens.js.map +1 -0
  87. package/build/theme/typography.d.ts.map +1 -1
  88. package/build/theme/typography.js +36 -72
  89. package/build/theme/typography.js.map +1 -1
  90. package/build/ui/ZSBlockButton/index.d.ts +4 -2
  91. package/build/ui/ZSBlockButton/index.d.ts.map +1 -1
  92. package/build/ui/ZSBlockButton/index.js +17 -80
  93. package/build/ui/ZSBlockButton/index.js.map +1 -1
  94. package/build/ui/ZSBorderBeam/index.d.ts +48 -0
  95. package/build/ui/ZSBorderBeam/index.d.ts.map +1 -0
  96. package/build/ui/ZSBorderBeam/index.js +135 -0
  97. package/build/ui/ZSBorderBeam/index.js.map +1 -0
  98. package/build/ui/ZSCheckBox/index.d.ts +18 -0
  99. package/build/ui/ZSCheckBox/index.d.ts.map +1 -0
  100. package/build/ui/ZSCheckBox/index.js +60 -0
  101. package/build/ui/ZSCheckBox/index.js.map +1 -0
  102. package/build/ui/ZSChip/index.d.ts +28 -0
  103. package/build/ui/ZSChip/index.d.ts.map +1 -0
  104. package/build/ui/ZSChip/index.js +76 -0
  105. package/build/ui/ZSChip/index.js.map +1 -0
  106. package/build/ui/ZSContainer/index.d.ts +19 -0
  107. package/build/ui/ZSContainer/index.d.ts.map +1 -1
  108. package/build/ui/ZSContainer/index.js +29 -15
  109. package/build/ui/ZSContainer/index.js.map +1 -1
  110. package/build/ui/ZSPressable/index.d.ts.map +1 -1
  111. package/build/ui/ZSPressable/index.js +9 -6
  112. package/build/ui/ZSPressable/index.js.map +1 -1
  113. package/build/ui/ZSRadioGroup/index.d.ts +4 -4
  114. package/build/ui/ZSRadioGroup/index.d.ts.map +1 -1
  115. package/build/ui/ZSRadioGroup/index.js +72 -52
  116. package/build/ui/ZSRadioGroup/index.js.map +1 -1
  117. package/build/ui/ZSSegmented/index.d.ts +26 -0
  118. package/build/ui/ZSSegmented/index.d.ts.map +1 -0
  119. package/build/ui/ZSSegmented/index.js +124 -0
  120. package/build/ui/ZSSegmented/index.js.map +1 -0
  121. package/build/ui/ZSSkeleton/SkiaShimmer.d.ts +18 -0
  122. package/build/ui/ZSSkeleton/SkiaShimmer.d.ts.map +1 -0
  123. package/build/ui/ZSSkeleton/SkiaShimmer.js +73 -0
  124. package/build/ui/ZSSkeleton/SkiaShimmer.js.map +1 -0
  125. package/build/ui/ZSSkeleton/index.d.ts +9 -3
  126. package/build/ui/ZSSkeleton/index.d.ts.map +1 -1
  127. package/build/ui/ZSSkeleton/index.js +13 -44
  128. package/build/ui/ZSSkeleton/index.js.map +1 -1
  129. package/build/ui/ZSSkeletonBox/index.d.ts +10 -3
  130. package/build/ui/ZSSkeletonBox/index.d.ts.map +1 -1
  131. package/build/ui/ZSSkeletonBox/index.js +9 -47
  132. package/build/ui/ZSSkeletonBox/index.js.map +1 -1
  133. package/build/ui/ZSSwitch/index.d.ts +4 -2
  134. package/build/ui/ZSSwitch/index.d.ts.map +1 -1
  135. package/build/ui/ZSSwitch/index.js +8 -6
  136. package/build/ui/ZSSwitch/index.js.map +1 -1
  137. package/build/ui/ZSText/index.d.ts +3 -2
  138. package/build/ui/ZSText/index.d.ts.map +1 -1
  139. package/build/ui/ZSText/index.js +5 -16
  140. package/build/ui/ZSText/index.js.map +1 -1
  141. package/build/ui/ZSTextField/index.d.ts.map +1 -1
  142. package/build/ui/ZSTextField/index.js +57 -40
  143. package/build/ui/ZSTextField/index.js.map +1 -1
  144. package/build/ui/ZSTextField/ui/ButtonClose.d.ts.map +1 -1
  145. package/build/ui/ZSTextField/ui/ButtonClose.js +4 -1
  146. package/build/ui/ZSTextField/ui/ButtonClose.js.map +1 -1
  147. package/build/ui/ZSTooltip/index.d.ts +38 -0
  148. package/build/ui/ZSTooltip/index.d.ts.map +1 -0
  149. package/build/ui/ZSTooltip/index.js +99 -0
  150. package/build/ui/ZSTooltip/index.js.map +1 -0
  151. package/build/ui/ZSView/index.d.ts +3 -2
  152. package/build/ui/ZSView/index.d.ts.map +1 -1
  153. package/build/ui/ZSView/index.js +7 -8
  154. package/build/ui/ZSView/index.js.map +1 -1
  155. package/build/ui/atoms/AnimatedWrapper.d.ts.map +1 -1
  156. package/build/ui/atoms/AnimatedWrapper.js +33 -40
  157. package/build/ui/atoms/AnimatedWrapper.js.map +1 -1
  158. package/build/ui/atoms/TextAtom.d.ts +1 -2
  159. package/build/ui/atoms/TextAtom.d.ts.map +1 -1
  160. package/build/ui/atoms/TextAtom.js.map +1 -1
  161. package/build/ui/atoms/ViewAtom.d.ts +1 -2
  162. package/build/ui/atoms/ViewAtom.d.ts.map +1 -1
  163. package/build/ui/atoms/ViewAtom.js.map +1 -1
  164. package/package.json +6 -1
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { useEffect, useMemo, useState } from "react";
3
+ import { StyleSheet, View } from "react-native";
4
+ import { Canvas, LinearGradient, Rect, vec } from "@shopify/react-native-skia";
5
+ import { Easing, cancelAnimation, useDerivedValue, useSharedValue, withRepeat, withTiming, } from "react-native-reanimated";
6
+ const clamp01 = (value) => Math.min(Math.max(value, 0), 1);
7
+ /** #RGB / #RRGGBB hex만 정규화, 그 외 형식은 null */
8
+ const toRgbHex = (color) => {
9
+ if (/^#[0-9a-fA-F]{6}$/.test(color))
10
+ return color;
11
+ if (/^#[0-9a-fA-F]{3}$/.test(color)) {
12
+ const [r, g, b] = color.slice(1);
13
+ return `#${r}${r}${g}${g}${b}${b}`;
14
+ }
15
+ return null;
16
+ };
17
+ const withAlpha = (rgbHex, alpha) => `${rgbHex}${Math.round(clamp01(alpha) * 255)
18
+ .toString(16)
19
+ .padStart(2, "0")}`;
20
+ /**
21
+ * 부모를 가득 채우는 shimmer 오버레이.
22
+ * 같은 hue의 알파 그라데이션(투명 → 하이라이트 → 투명)을 대각선으로 흘려보내
23
+ * 아래 콘텐츠가 실제로 비쳐 보인다.
24
+ */
25
+ function SkiaShimmer({ color, opacity = 0.6, duration = 1100 }) {
26
+ const [size, setSize] = useState({ width: 0, height: 0 });
27
+ const progress = useSharedValue(0);
28
+ // 밴드 폭·이동 거리는 실제 측정된 크기 기준 (기존 구현의 DEVICE_WIDTH 하드코딩 제거)
29
+ const bandWidth = size.width * 0.65;
30
+ const startOffset = bandWidth + size.height;
31
+ const travel = size.width + bandWidth * 2 + size.height;
32
+ const gradient = useMemo(() => {
33
+ const rgb = toRgbHex(color);
34
+ const peak = clamp01(opacity);
35
+ if (!rgb) {
36
+ // hex가 아니면 알파 조절이 불가하므로 색상 그대로 중앙에 사용
37
+ return { colors: ["transparent", color, "transparent"], positions: [0, 0.5, 1] };
38
+ }
39
+ // 같은 hue로만 알파를 올렸다 내리는 종 모양 프로파일 → 경계선 없는 부드러운 광택
40
+ return {
41
+ colors: [
42
+ withAlpha(rgb, 0),
43
+ withAlpha(rgb, peak * 0.4),
44
+ withAlpha(rgb, peak),
45
+ withAlpha(rgb, peak * 0.4),
46
+ withAlpha(rgb, 0),
47
+ ],
48
+ positions: [0, 0.3, 0.5, 0.7, 1],
49
+ };
50
+ }, [color, opacity]);
51
+ useEffect(() => {
52
+ if (size.width === 0)
53
+ return;
54
+ progress.value = 0;
55
+ progress.value = withRepeat(withTiming(1, { duration, easing: Easing.inOut(Easing.ease) }), -1, false);
56
+ return () => cancelAnimation(progress);
57
+ }, [duration, size.width]);
58
+ const gradientStart = useDerivedValue(() => {
59
+ const x = -startOffset + travel * progress.value;
60
+ return vec(x, 0);
61
+ });
62
+ const gradientEnd = useDerivedValue(() => {
63
+ const x = -startOffset + travel * progress.value;
64
+ return vec(x + bandWidth, size.height);
65
+ });
66
+ const handleLayout = (event) => {
67
+ const { width, height } = event.nativeEvent.layout;
68
+ setSize((prev) => (prev.width === width && prev.height === height ? prev : { width, height }));
69
+ };
70
+ return (_jsx(View, { pointerEvents: "none", style: StyleSheet.absoluteFill, onLayout: handleLayout, children: size.width > 0 && size.height > 0 && (_jsx(Canvas, { style: StyleSheet.absoluteFill, children: _jsx(Rect, { x: 0, y: 0, width: size.width, height: size.height, children: _jsx(LinearGradient, { start: gradientStart, end: gradientEnd, colors: gradient.colors, positions: gradient.positions }) }) })) }));
71
+ }
72
+ export default React.memo(SkiaShimmer);
73
+ //# sourceMappingURL=SkiaShimmer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkiaShimmer.js","sourceRoot":"","sources":["../../../src/ui/ZSSkeleton/SkiaShimmer.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,IAAI,EAA0B,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EACL,MAAM,EACN,eAAe,EACf,eAAe,EACf,cAAc,EACd,UAAU,EACV,UAAU,GACX,MAAM,yBAAyB,CAAC;AAWjC,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEnE,4CAA4C;AAC5C,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAiB,EAAE;IAChD,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,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AC,SAAS,GAC7B,GACG,GACA,CACV,GACI,CACR,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC","sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, View, type LayoutChangeEvent } from \"react-native\";\nimport { Canvas, LinearGradient, Rect, vec } from \"@shopify/react-native-skia\";\nimport {\n Easing,\n cancelAnimation,\n useDerivedValue,\n useSharedValue,\n withRepeat,\n withTiming,\n} from \"react-native-reanimated\";\n\nexport interface SkiaShimmerProps {\n /** 하이라이트 색상 (#RGB / #RRGGBB) */\n color: string;\n /** 밴드 중심의 최대 불투명도 (0~1) */\n opacity?: number;\n /** 밴드가 한 번 지나가는 시간(ms) */\n duration?: number;\n}\n\nconst clamp01 = (value: number) => Math.min(Math.max(value, 0), 1);\n\n/** #RGB / #RRGGBB hex만 정규화, 그 외 형식은 null */\nconst toRgbHex = (color: string): string | null => {\n if (/^#[0-9a-fA-F]{6}$/.test(color)) return color;\n if (/^#[0-9a-fA-F]{3}$/.test(color)) {\n const [r, g, b] = color.slice(1);\n return `#${r}${r}${g}${g}${b}${b}`;\n }\n return null;\n};\n\nconst withAlpha = (rgbHex: string, alpha: number): string =>\n `${rgbHex}${Math.round(clamp01(alpha) * 255)\n .toString(16)\n .padStart(2, \"0\")}`;\n\n/**\n * 부모를 가득 채우는 shimmer 오버레이.\n * 같은 hue의 알파 그라데이션(투명 → 하이라이트 → 투명)을 대각선으로 흘려보내\n * 아래 콘텐츠가 실제로 비쳐 보인다.\n */\nfunction SkiaShimmer({ color, opacity = 0.6, duration = 1100 }: SkiaShimmerProps) {\n const [size, setSize] = useState({ width: 0, height: 0 });\n const progress = useSharedValue(0);\n\n // 밴드 폭·이동 거리는 실제 측정된 크기 기준 (기존 구현의 DEVICE_WIDTH 하드코딩 제거)\n const bandWidth = size.width * 0.65;\n const startOffset = bandWidth + size.height;\n const travel = size.width + bandWidth * 2 + size.height;\n\n const gradient = useMemo(() => {\n const rgb = toRgbHex(color);\n const peak = clamp01(opacity);\n if (!rgb) {\n // hex가 아니면 알파 조절이 불가하므로 색상 그대로 중앙에 사용\n return { colors: [\"transparent\", color, \"transparent\"], positions: [0, 0.5, 1] };\n }\n // 같은 hue로만 알파를 올렸다 내리는 종 모양 프로파일 → 경계선 없는 부드러운 광택\n return {\n colors: [\n withAlpha(rgb, 0),\n withAlpha(rgb, peak * 0.4),\n withAlpha(rgb, peak),\n withAlpha(rgb, peak * 0.4),\n withAlpha(rgb, 0),\n ],\n positions: [0, 0.3, 0.5, 0.7, 1],\n };\n }, [color, opacity]);\n\n useEffect(() => {\n if (size.width === 0) return;\n\n progress.value = 0;\n progress.value = withRepeat(\n withTiming(1, { duration, easing: Easing.inOut(Easing.ease) }),\n -1,\n false\n );\n\n return () => cancelAnimation(progress);\n }, [duration, size.width]);\n\n const gradientStart = useDerivedValue(() => {\n const x = -startOffset + travel * progress.value;\n return vec(x, 0);\n });\n const gradientEnd = useDerivedValue(() => {\n const x = -startOffset + travel * progress.value;\n return vec(x + bandWidth, size.height);\n });\n\n const handleLayout = (event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setSize((prev) => (prev.width === width && prev.height === height ? prev : { width, height }));\n };\n\n return (\n <View pointerEvents=\"none\" style={StyleSheet.absoluteFill} onLayout={handleLayout}>\n {size.width > 0 && size.height > 0 && (\n <Canvas style={StyleSheet.absoluteFill}>\n <Rect x={0} y={0} width={size.width} height={size.height}>\n <LinearGradient\n start={gradientStart}\n end={gradientEnd}\n colors={gradient.colors}\n positions={gradient.positions}\n />\n </Rect>\n </Canvas>\n )}\n </View>\n );\n}\n\nexport default React.memo(SkiaShimmer);\n"]}
@@ -1,11 +1,17 @@
1
1
  import React from "react";
2
2
  import { type StyleProp, type ViewStyle, type ViewProps } from "react-native";
3
- interface ZSSkeletonProps extends ViewProps {
3
+ export interface ZSSkeletonProps extends ViewProps {
4
4
  isFetching?: boolean;
5
5
  style?: StyleProp<ViewStyle>;
6
6
  children?: React.ReactNode;
7
+ /** shimmer 하이라이트 색상 (기본: palette.background.base) */
7
8
  overlayColor?: string;
9
+ /** shimmer 밴드 중심의 최대 불투명도 0~1 (기본 0.6) */
10
+ overlayOpacity?: number;
11
+ /** shimmer 한 사이클(ms) */
12
+ duration?: number;
8
13
  }
9
- declare function ZSSkeleton({ isFetching, style, children, overlayColor, ...props }: ZSSkeletonProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
10
- export default ZSSkeleton;
14
+ declare function ZSSkeleton({ isFetching, style, children, overlayColor, overlayOpacity, duration, ...props }: ZSSkeletonProps): React.JSX.Element;
15
+ declare const _default: React.MemoExoticComponent<typeof ZSSkeleton>;
16
+ export default _default;
11
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSSkeleton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAc,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAM5G,UAAU,eAAgB,SAAQ,SAAS;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,iBAAS,UAAU,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,mSAuC3F;AAED,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSSkeleton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIhG,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,iBAAS,UAAU,CAAC,EAClB,UAAU,EACV,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,cAAoB,EACpB,QAAe,EACf,GAAG,KAAK,EACT,EAAE,eAAe,qBAYjB;;AAED,wBAAsC"}
@@ -1,54 +1,23 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect } from "react";
3
- import { Dimensions, StyleSheet, View } from "react-native";
4
- import Animated, { useSharedValue, useAnimatedStyle, withRepeat, withTiming, cancelAnimation } from "react-native-reanimated";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { StyleSheet, View } from "react-native";
5
4
  import { useTheme } from "../../context/ThemeContext";
6
- const DEVICE_WIDTH = Dimensions.get("window").width;
7
- function ZSSkeleton({ isFetching, style, children, overlayColor, ...props }) {
8
- const translateX = useSharedValue(-DEVICE_WIDTH * 1.2);
5
+ import SkiaShimmer from "./SkiaShimmer";
6
+ function ZSSkeleton({ isFetching, style, children, overlayColor, overlayOpacity = 0.6, duration = 1100, ...props }) {
9
7
  const { palette } = useTheme();
10
- const effectColor = overlayColor || palette.background.base;
11
- useEffect(() => {
12
- if (isFetching) {
13
- translateX.value = withRepeat(withTiming(DEVICE_WIDTH * 1.2, { duration: 800 }), -1, false);
14
- }
15
- else {
16
- cancelAnimation(translateX);
17
- translateX.value = -DEVICE_WIDTH * 1.2;
18
- }
19
- return () => {
20
- cancelAnimation(translateX);
21
- };
22
- }, [isFetching]);
23
- const animatedStyle = useAnimatedStyle(() => {
24
- return {
25
- transform: [{ translateX: translateX.value }],
26
- };
27
- });
28
- return isFetching ? (_jsx(View, { style: [style, { overflow: "hidden" }], ...props, children: _jsxs(View, { style: styles.container, children: [children, _jsxs(Animated.View, { style: [styles.shimmer, animatedStyle], children: [_jsx(View, { style: [styles.shimmerSub, { backgroundColor: effectColor }] }), _jsx(View, { style: [styles.shimmerCenter, { backgroundColor: effectColor }] }), _jsx(View, { style: [styles.shimmerSub, { backgroundColor: effectColor }] })] })] }) })) : (children);
8
+ const highlightColor = overlayColor || palette.background.base;
9
+ if (!isFetching)
10
+ return _jsx(_Fragment, { children: children });
11
+ return (_jsxs(View, { style: [style, styles.host], ...props, children: [_jsx(View, { style: styles.content, children: children }), _jsx(SkiaShimmer, { color: highlightColor, opacity: overlayOpacity, duration: duration })] }));
29
12
  }
30
- export default ZSSkeleton;
13
+ export default React.memo(ZSSkeleton);
31
14
  const styles = StyleSheet.create({
32
- container: {
15
+ host: {
33
16
  overflow: "hidden",
34
- opacity: 0.6,
35
- width: "100%",
36
17
  },
37
- shimmer: {
18
+ content: {
38
19
  width: "100%",
39
- height: "100%",
40
- position: "absolute",
41
- flexDirection: "row",
42
- },
43
- shimmerSub: {
44
- height: "100%",
45
- opacity: 0.3,
46
- width: DEVICE_WIDTH * 0.3,
47
- },
48
- shimmerCenter: {
49
- height: "100%",
50
- opacity: 0.6,
51
- width: DEVICE_WIDTH * 0.4,
20
+ opacity: 0.5,
52
21
  },
53
22
  });
54
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["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;QACX,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,GAAG;QACZ,KAAK,EAAE,YAAY,GAAG,GAAG;KAC5B;CACJ,CAAC,CAAC","sourcesContent":["import React, { useEffect } from \"react\";\nimport { Dimensions, type StyleProp, StyleSheet, View, type ViewStyle, type ViewProps } from \"react-native\";\nimport Animated, { useSharedValue, useAnimatedStyle, withRepeat, withTiming, cancelAnimation } from \"react-native-reanimated\";\nimport { useTheme } from \"../../context/ThemeContext\";\n\nconst DEVICE_WIDTH = Dimensions.get(\"window\").width;\n\ninterface ZSSkeletonProps extends ViewProps {\n isFetching?: boolean;\n style?: StyleProp<ViewStyle>;\n children?: React.ReactNode;\n overlayColor?: string;\n}\n\nfunction ZSSkeleton({ isFetching, style, children, overlayColor, ...props }: ZSSkeletonProps) {\n const translateX = useSharedValue(-DEVICE_WIDTH * 1.2);\n const { palette } = useTheme();\n const effectColor = overlayColor || palette.background.base;\n\n useEffect(() => {\n if (isFetching) {\n translateX.value = withRepeat(withTiming(DEVICE_WIDTH * 1.2, { duration: 800 }), -1, false);\n } else {\n cancelAnimation(translateX);\n translateX.value = -DEVICE_WIDTH * 1.2;\n }\n\n return () => {\n cancelAnimation(translateX);\n };\n }, [isFetching]);\n\n const animatedStyle = useAnimatedStyle(() => {\n return {\n transform: [{ translateX: translateX.value }],\n };\n });\n\n return isFetching ? (\n <View style={[style, { overflow: \"hidden\" }]} {...props}>\n <View style={styles.container}>\n {children}\n\n <Animated.View style={[styles.shimmer, animatedStyle]}>\n <View style={[styles.shimmerSub, { backgroundColor: effectColor }]} />\n <View style={[styles.shimmerCenter, { backgroundColor: effectColor }]} />\n <View style={[styles.shimmerSub, { backgroundColor: effectColor }]} />\n </Animated.View>\n </View>\n </View>\n ) : (\n children\n );\n}\n\nexport default ZSSkeleton;\n\nconst styles = StyleSheet.create({\n container: {\n overflow: \"hidden\",\n opacity: 0.6,\n width: \"100%\",\n },\n shimmer: {\n width: \"100%\",\n height: \"100%\",\n position: \"absolute\",\n flexDirection: \"row\",\n },\n shimmerSub: {\n height: \"100%\",\n opacity: 0.3,\n width: DEVICE_WIDTH * 0.3,\n },\n shimmerCenter: {\n height: \"100%\",\n opacity: 0.6,\n width: DEVICE_WIDTH * 0.4,\n },\n});\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSSkeleton/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,UAAU,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,WAAW,MAAM,eAAe,CAAC;AAcxC,SAAS,UAAU,CAAC,EAClB,UAAU,EACV,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,cAAc,GAAG,GAAG,EACpB,QAAQ,GAAG,IAAI,EACf,GAAG,KAAK,EACQ;IAChB,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC/B,MAAM,cAAc,GAAG,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;IAE/D,IAAI,CAAC,UAAU;QAAE,OAAO,4BAAG,QAAQ,GAAI,CAAC;IAExC,OAAO,CACL,MAAC,IAAI,IAAC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAM,KAAK,aAC1C,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,YAAG,QAAQ,GAAQ,EAC9C,KAAC,WAAW,IAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,GAAI,IAC9E,CACR,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAEtC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,QAAQ,EAAE,QAAQ;KACnB;IACD,OAAO,EAAE;QACP,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,GAAG;KACb;CACF,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { type StyleProp, StyleSheet, View, type ViewStyle, type ViewProps } from \"react-native\";\nimport { useTheme } from \"../../context/ThemeContext\";\nimport SkiaShimmer from \"./SkiaShimmer\";\n\nexport interface ZSSkeletonProps extends ViewProps {\n isFetching?: boolean;\n style?: StyleProp<ViewStyle>;\n children?: React.ReactNode;\n /** shimmer 하이라이트 색상 (기본: palette.background.base) */\n overlayColor?: string;\n /** shimmer 밴드 중심의 최대 불투명도 0~1 (기본 0.6) */\n overlayOpacity?: number;\n /** shimmer 사이클(ms) */\n duration?: number;\n}\n\nfunction ZSSkeleton({\n isFetching,\n style,\n children,\n overlayColor,\n overlayOpacity = 0.6,\n duration = 1100,\n ...props\n}: ZSSkeletonProps) {\n const { palette } = useTheme();\n const highlightColor = overlayColor || palette.background.base;\n\n if (!isFetching) return <>{children}</>;\n\n return (\n <View style={[style, styles.host]} {...props}>\n <View style={styles.content}>{children}</View>\n <SkiaShimmer color={highlightColor} opacity={overlayOpacity} duration={duration} />\n </View>\n );\n}\n\nexport default React.memo(ZSSkeleton);\n\nconst styles = StyleSheet.create({\n host: {\n overflow: \"hidden\",\n },\n content: {\n width: \"100%\",\n opacity: 0.5,\n },\n});\n"]}
@@ -1,12 +1,19 @@
1
1
  import React from "react";
2
2
  import { type StyleProp, type ViewStyle, type ViewProps } from "react-native";
3
3
  import { ViewColorOptions } from "../../theme/types";
4
- interface ZSSkeletonBoxProps extends ViewProps {
4
+ export interface ZSSkeletonBoxProps extends ViewProps {
5
5
  height: number;
6
6
  style?: StyleProp<ViewStyle>;
7
+ /** shimmer 하이라이트 색상 (기본: palette.background.layer1) */
7
8
  overlayColor?: string;
9
+ /** shimmer 밴드 중심의 최대 불투명도 0~1 (기본 0.7) */
10
+ overlayOpacity?: number;
11
+ /** shimmer 한 사이클(ms) */
12
+ duration?: number;
13
+ /** 박스 배경 색상 토큰 */
8
14
  color?: ViewColorOptions;
9
15
  }
10
- declare function ZSSkeletonBox({ height, style, overlayColor, color, ...props }: ZSSkeletonBoxProps): React.JSX.Element;
11
- export default ZSSkeletonBox;
16
+ declare function ZSSkeletonBox({ height, style, overlayColor, overlayOpacity, duration, color, ...props }: ZSSkeletonBoxProps): React.JSX.Element;
17
+ declare const _default: React.MemoExoticComponent<typeof ZSSkeletonBox>;
18
+ export default _default;
12
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSSkeletonBox/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAc,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAIrD,UAAU,kBAAmB,SAAQ,SAAS;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED,iBAAS,aAAa,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,KAAiB,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,qBAuCtG;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSSkeletonBox/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhG,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAIrD,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB;IAClB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,KAAK,EACL,YAAY,EACZ,cAAoB,EACpB,QAAe,EACf,KAAiB,EACjB,GAAG,KAAK,EACT,EAAE,kBAAkB,qBAUpB;;AAED,wBAAyC"}
@@ -1,56 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect } from "react";
3
- import { Dimensions, StyleSheet, View } from "react-native";
4
- import Animated, { useSharedValue, useAnimatedStyle, withRepeat, withTiming, cancelAnimation } from "react-native-reanimated";
5
- import { useTheme } from "../../context/ThemeContext";
2
+ import React from "react";
3
+ import { StyleSheet, View } from "react-native";
6
4
  import ZSView from "../ZSView";
7
- const DEVICE_WIDTH = Dimensions.get("window").width;
8
- function ZSSkeletonBox({ height, style, overlayColor, color = 'neutral', ...props }) {
9
- const translateX = useSharedValue(-DEVICE_WIDTH * 1.2);
5
+ import { useTheme } from "../../context/ThemeContext";
6
+ import SkiaShimmer from "../ZSSkeleton/SkiaShimmer";
7
+ function ZSSkeletonBox({ height, style, overlayColor, overlayOpacity = 0.7, duration = 1100, color = "neutral", ...props }) {
10
8
  const { palette } = useTheme();
11
- const effectColor = overlayColor || palette.background.layer1;
12
- useEffect(() => {
13
- translateX.value = withRepeat(withTiming(DEVICE_WIDTH * 1.2, { duration: 800 }), -1, false);
14
- return () => {
15
- cancelAnimation(translateX);
16
- };
17
- }, []);
18
- const animatedStyle = useAnimatedStyle(() => {
19
- return {
20
- transform: [{ translateX: translateX.value }],
21
- };
22
- });
23
- return (_jsx(View, { style: [{ width: '100%' }, style, { height, overflow: "hidden" }], ...props, children: _jsx(ZSView, { style: [
24
- styles.container,
25
- {
26
- width: DEVICE_WIDTH,
27
- height,
28
- },
29
- ], color: color, children: _jsxs(Animated.View, { style: [styles.shimmer, animatedStyle], children: [_jsx(View, { style: [styles.shimmerSub, { backgroundColor: effectColor }] }), _jsx(View, { style: [styles.shimmerCenter, { backgroundColor: effectColor }] }), _jsx(View, { style: [styles.shimmerSub, { backgroundColor: effectColor }] })] }) }) }));
9
+ const highlightColor = overlayColor || palette.background.layer1;
10
+ return (_jsxs(View, { style: [styles.fullWidth, style, { height, overflow: "hidden" }], ...props, children: [_jsx(ZSView, { style: StyleSheet.absoluteFill, color: color }), _jsx(SkiaShimmer, { color: highlightColor, opacity: overlayOpacity, duration: duration })] }));
30
11
  }
31
- export default ZSSkeletonBox;
12
+ export default React.memo(ZSSkeletonBox);
32
13
  const styles = StyleSheet.create({
33
- container: {
34
- overflow: "hidden",
35
- opacity: 0.4,
36
- },
37
- shimmer: {
14
+ fullWidth: {
38
15
  width: "100%",
39
- height: "100%",
40
- position: "absolute",
41
- flexDirection: "row",
42
- },
43
- shimmerSub: {
44
- height: "100%",
45
- backgroundColor: "#ebebeb",
46
- opacity: 0.3,
47
- width: DEVICE_WIDTH * 0.3,
48
- },
49
- shimmerCenter: {
50
- height: "100%",
51
- backgroundColor: "#f5f5f5",
52
- opacity: 0.7,
53
- width: DEVICE_WIDTH * 0.4,
54
16
  },
55
17
  });
56
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSSkeletonBox/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,UAAU,EAAkB,UAAU,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAC;AAC5G,OAAO,Q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,IACH,KAAK,EAAE;gBACH,MAAM,CAAC,SAAS;gBAChB;oBACI,KAAK,EAAE,YAAY;oBACnB,MAAM;iBACT;aACJ,EACD,KAAK,EAAE,KAAK,YAEZ,MAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,aACjD,KAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,GAAI,EACtE,KAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,GAAI,EACzE,KAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,GAAI,IAC1D,GACX,GACN,CACV,CAAC;AACN,CAAC;AAED,eAAe,aAAa,CAAC;AAE7B,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC7B,SAAS,EAAE;QACP,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,GAAG;KACf;IACD,OAAO,EAAE;QACL,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,UAAU;QACpB,aAAa,EAAE,KAAK;KACvB;IACD,UAAU,EAAE;QACR,MAAM,EAAE,MAAM;QACd,eAAe,EAAE,SAAS;QAC1B,OAAO,EAAE,GAAG;QACZ,KAAK,EAAE,YAAY,GAAG,GAAG;KAC5B;IACD,aAAa,EAAE;QACX,MAAM,EAAE,MAAM;QACd,eAAe,EAAE,SAAS;QAC1B,OAAO,EAAE,GAAG;QACZ,KAAK,EAAE,YAAY,GAAG,GAAG;KAC5B;CACJ,CAAC,CAAC","sourcesContent":["import React, { useEffect } from \"react\";\nimport { Dimensions, type StyleProp, StyleSheet, View, type ViewStyle, type ViewProps } from \"react-native\";\nimport Animated, { useSharedValue, useAnimatedStyle, withRepeat, withTiming, cancelAnimation } from \"react-native-reanimated\";\nimport { useTheme } from \"../../context/ThemeContext\";\nimport ZSView from \"../ZSView\";\nimport { ViewColorOptions } from \"../../theme/types\";\n\nconst DEVICE_WIDTH = Dimensions.get(\"window\").width;\n\ninterface ZSSkeletonBoxProps extends ViewProps {\n height: number;\n style?: StyleProp<ViewStyle>;\n overlayColor?: string;\n color?: ViewColorOptions;\n}\n\nfunction ZSSkeletonBox({ height, style, overlayColor, color = 'neutral', ...props }: ZSSkeletonBoxProps) {\n const translateX = useSharedValue(-DEVICE_WIDTH * 1.2);\n const { palette } = useTheme();\n const effectColor = overlayColor || palette.background.layer1;\n\n useEffect(() => {\n translateX.value = withRepeat(withTiming(DEVICE_WIDTH * 1.2, { duration: 800 }), -1, false);\n\n return () => {\n cancelAnimation(translateX);\n };\n }, []);\n\n const animatedStyle = useAnimatedStyle(() => {\n return {\n transform: [{ translateX: translateX.value }],\n };\n });\n\n return (\n <View style={[{ width: '100%' }, style, { height, overflow: \"hidden\" }]} {...props}>\n <ZSView\n style={[\n styles.container,\n {\n width: DEVICE_WIDTH,\n height,\n },\n ]}\n color={color}\n >\n <Animated.View style={[styles.shimmer, animatedStyle]}>\n <View style={[styles.shimmerSub, { backgroundColor: effectColor }]} />\n <View style={[styles.shimmerCenter, { backgroundColor: effectColor }]} />\n <View style={[styles.shimmerSub, { backgroundColor: effectColor }]} />\n </Animated.View>\n </ZSView>\n </View>\n );\n}\n\nexport default ZSSkeletonBox;\n\nconst styles = StyleSheet.create({\n container: {\n overflow: \"hidden\",\n opacity: 0.4,\n },\n shimmer: {\n width: \"100%\",\n height: \"100%\",\n position: \"absolute\",\n flexDirection: \"row\",\n },\n shimmerSub: {\n height: \"100%\",\n backgroundColor: \"#ebebeb\",\n opacity: 0.3,\n width: DEVICE_WIDTH * 0.3,\n },\n shimmerCenter: {\n height: \"100%\",\n backgroundColor: \"#f5f5f5\",\n opacity: 0.7,\n width: DEVICE_WIDTH * 0.4,\n },\n});\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSSkeletonBox/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,UAAU,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAC;AAChG,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,WAAW,MAAM,2BAA2B,CAAC;AAepD,SAAS,aAAa,CAAC,EACrB,MAAM,EACN,KAAK,EACL,YAAY,EACZ,cAAc,GAAG,GAAG,EACpB,QAAQ,GAAG,IAAI,EACf,KAAK,GAAG,SAAS,EACjB,GAAG,KAAK,EACW;IACnB,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC/B,MAAM,cAAc,GAAG,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;IAEjE,OAAO,CACL,MAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,KAAM,KAAK,aAC/E,KAAC,MAAM,IAAC,KAAK,EAAE,UAAU,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,GAAI,EACxD,KAAC,WAAW,IAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,GAAI,IAC9E,CACR,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAEzC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,KAAK,EAAE,MAAM;KACd;CACF,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { type StyleProp, StyleSheet, View, type ViewStyle, type ViewProps } from \"react-native\";\nimport ZSView from \"../ZSView\";\nimport { ViewColorOptions } from \"../../theme/types\";\nimport { useTheme } from \"../../context/ThemeContext\";\nimport SkiaShimmer from \"../ZSSkeleton/SkiaShimmer\";\n\nexport interface ZSSkeletonBoxProps extends ViewProps {\n height: number;\n style?: StyleProp<ViewStyle>;\n /** shimmer 하이라이트 색상 (기본: palette.background.layer1) */\n overlayColor?: string;\n /** shimmer 밴드 중심의 최대 불투명도 0~1 (기본 0.7) */\n overlayOpacity?: number;\n /** shimmer 사이클(ms) */\n duration?: number;\n /** 박스 배경 색상 토큰 */\n color?: ViewColorOptions;\n}\n\nfunction ZSSkeletonBox({\n height,\n style,\n overlayColor,\n overlayOpacity = 0.7,\n duration = 1100,\n color = \"neutral\",\n ...props\n}: ZSSkeletonBoxProps) {\n const { palette } = useTheme();\n const highlightColor = overlayColor || palette.background.layer1;\n\n return (\n <View style={[styles.fullWidth, style, { height, overflow: \"hidden\" }]} {...props}>\n <ZSView style={StyleSheet.absoluteFill} color={color} />\n <SkiaShimmer color={highlightColor} opacity={overlayOpacity} duration={duration} />\n </View>\n );\n}\n\nexport default React.memo(ZSSkeletonBox);\n\nconst styles = StyleSheet.create({\n fullWidth: {\n width: \"100%\",\n },\n});\n"]}
@@ -8,7 +8,9 @@ interface ZSSwitchProps extends ViewProps {
8
8
  trackColorInactive?: string;
9
9
  trackColorActive?: string;
10
10
  thumbColor?: string;
11
+ disabled?: boolean;
11
12
  }
12
- declare function ZSSwitch({ isActive, onToggle, style, width, trackColorInactive, trackColorActive, thumbColor, ...props }: ZSSwitchProps): React.JSX.Element;
13
- export default ZSSwitch;
13
+ declare function ZSSwitch({ isActive, onToggle, style, width, trackColorInactive, trackColorActive, thumbColor, disabled, ...props }: ZSSwitchProps): React.JSX.Element;
14
+ declare const _default: React.MemoExoticComponent<typeof ZSSwitch>;
15
+ export default _default;
14
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSSwitch/index.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B,QAAgB,EAChB,QAAQ,EACR,KAAK,EACL,KAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,UAAkB,EAClB,QAAgB,EAChB,GAAG,KAAK,EACT,EAAE,aAAa,qBAgDf;;AAED,wBAAoC"}
@@ -1,18 +1,21 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from "react";
2
3
  import { Pressable } from "react-native";
3
4
  import Animated from "react-native-reanimated";
4
5
  import { useTheme } from "../../context/ThemeContext";
5
- const SWITCH_TRANSITION_DURATION = 200;
6
+ import { WHITE } from "../../theme/primitive";
7
+ import { DISABLED_OPACITY, DURATION } from "../../theme/tokens";
8
+ const SWITCH_TRANSITION_DURATION = DURATION.base;
6
9
  const SWITCH_TRANSITION = {
7
10
  transitionDuration: SWITCH_TRANSITION_DURATION,
8
11
  transitionTimingFunction: 'ease-in-out',
9
12
  };
10
- function ZSSwitch({ isActive = false, onToggle, style, width = 50, trackColorInactive, trackColorActive, thumbColor = '#ffffff', ...props }) {
13
+ function ZSSwitch({ isActive = false, onToggle, style, width = 50, trackColorInactive, trackColorActive, thumbColor = WHITE, disabled = false, ...props }) {
11
14
  const { palette } = useTheme();
12
15
  const height = width * 0.6;
13
16
  const padding = width * 0.04;
14
17
  const thumbSize = height - padding * 2;
15
- const toggleBorderRadius = height * 1.2;
18
+ const toggleBorderRadius = height / 2;
16
19
  const thumbBorderRadius = thumbSize / 2;
17
20
  const inactiveColor = trackColorInactive ?? palette.grey[30];
18
21
  const activeColor = trackColorActive ?? palette.primary.main;
@@ -37,8 +40,7 @@ function ZSSwitch({ isActive = false, onToggle, style, width = 50, trackColorIna
37
40
  transitionProperty: 'transform',
38
41
  ...SWITCH_TRANSITION,
39
42
  };
40
- return (_jsx(Pressable, { onPress: onToggle, style: style, ...props, children: _jsx(Animated.View, { style: toggleStyle, children: _jsx(Animated.View, { style: thumbStyle }) }) }));
43
+ return (_jsx(Pressable, { onPress: onToggle, style: [style, disabled && { opacity: DISABLED_OPACITY }], disabled: disabled, accessibilityRole: 'switch', accessibilityState: { checked: isActive, disabled }, ...props, children: _jsx(Animated.View, { style: toggleStyle, children: _jsx(Animated.View, { style: thumbStyle }) }) }));
41
44
  }
42
- ;
43
- export default ZSSwitch;
45
+ export default React.memo(ZSSwitch);
44
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSSwitch/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAkC,SAAS,EAAkB,MAAM,cAAc,CAAC;AACzF,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC,MAAM,iBAAiB,GAAG;IACxB,kBAAkB,EAAE,0BAA0B;IAC9C,wBAAwB,EAAE,aAAa;CAC/B,CAAC;AAYX,SAAS,QAAQ,CAAC,EAChB,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,KAAK,EACL,KAAK,GAAG,EAAE,EACV,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,GAAG,SAAS,EACtB,GAAG,KAAK,EACM;IACd,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,KAAK,GAAG,GAAG,CAAC;IAC3B,MAAM,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;IAC7B,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,CAAC,CAAC;IACvC,MAAM,kBAAkB,GAAG,MAAM,GAAG,GAAG,CAAC;IACxC,MAAM,iBAAiB,GAAG,SAAS,GAAG,CAAC,CAAC;IAExC,MAAM,aAAa,GAAG,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7D,MAAM,WAAW,GAAG,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IAC7D,MAAM,eAAe,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvE,MAAM,WAAW,GAAG;QAClB,KAAK;QACL,MAAM;QACN,YAAY,EAAE,kBAAkB;QAChC,OAAO;QACP,cAAc,EAAE,QAAiB;QACjC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa;QACvD,kBAAkB,EAAE,iBAA0B;QAC9C,GAAG,iBAAiB;KACrB,CAAC;IAEF,MAAM,UAAU,GAAG;QACjB,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,SAAS;QACjB,YAAY,EAAE,iBAAiB;QAC/B,cAAc,EAAE,QAAiB;QACjC,eAAe,EAAE,UAAU;QAC3B,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;QAC5C,kBAAkB,EAAE,WAAoB;QACxC,GAAG,iBAAiB;KACrB,CAAC;IAEF,OAAO,CACL,KAAC,SAAS,IAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,YACnD,KAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,WAAW,YAC/B,KAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,UAAU,GAAI,GACtB,GACN,CACb,CAAC;AACJ,CAAC;AAAA,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import React from \"react\";\nimport { type StyleProp, type ViewStyle, Pressable, type ViewProps } from \"react-native\";\nimport Animated from \"react-native-reanimated\";\nimport { useTheme } from \"../../context/ThemeContext\";\n\nconst SWITCH_TRANSITION_DURATION = 200;\nconst SWITCH_TRANSITION = {\n transitionDuration: SWITCH_TRANSITION_DURATION,\n transitionTimingFunction: 'ease-in-out',\n} as const;\n\ninterface ZSSwitchProps extends ViewProps {\n isActive: boolean;\n onToggle: () => void;\n style?: StyleProp<ViewStyle>;\n width?: number;\n trackColorInactive?: string;\n trackColorActive?: string;\n thumbColor?: string;\n}\n\nfunction ZSSwitch({\n isActive = false,\n onToggle,\n style,\n width = 50,\n trackColorInactive,\n trackColorActive,\n thumbColor = '#ffffff',\n ...props\n}: ZSSwitchProps) {\n const { palette } = useTheme();\n const height = width * 0.6;\n const padding = width * 0.04;\n const thumbSize = height - padding * 2;\n const toggleBorderRadius = height * 1.2;\n const thumbBorderRadius = thumbSize / 2;\n\n const inactiveColor = trackColorInactive ?? palette.grey[30];\n const activeColor = trackColorActive ?? palette.primary.main;\n const thumbTranslateX = isActive ? width - thumbSize - padding * 2 : 0;\n\n const toggleStyle = {\n width,\n height,\n borderRadius: toggleBorderRadius,\n padding,\n justifyContent: \"center\" as const,\n backgroundColor: isActive ? activeColor : inactiveColor,\n transitionProperty: 'backgroundColor' as const,\n ...SWITCH_TRANSITION,\n };\n\n const thumbStyle = {\n width: thumbSize,\n height: thumbSize,\n borderRadius: thumbBorderRadius,\n justifyContent: \"center\" as const,\n backgroundColor: thumbColor,\n transform: [{ translateX: thumbTranslateX }],\n transitionProperty: 'transform' as const,\n ...SWITCH_TRANSITION,\n };\n\n return (\n <Pressable onPress={onToggle} style={style} {...props}>\n <Animated.View style={toggleStyle}>\n <Animated.View style={thumbStyle} />\n </Animated.View>\n </Pressable>\n );\n};\n\nexport default ZSSwitch;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSSwitch/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkC,SAAS,EAAkB,MAAM,cAAc,CAAC;AACzF,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,0BA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AE,SAAS;QACjB,YAAY,EAAE,iBAAiB;QAC/B,cAAc,EAAE,QAAiB;QACjC,eAAe,EAAE,UAAU;QAC3B,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;QAC5C,kBAAkB,EAAE,WAAoB;QACxC,GAAG,iBAAiB;KACrB,CAAC;IAEF,OAAO,CACL,KAAC,SAAS,IACR,OAAO,EAAE,QAAQ,EACjB,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC,EACzD,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAC,QAAQ,EAC1B,kBAAkB,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAC/C,KAAK,YAET,KAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,WAAW,YAC/B,KAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,UAAU,GAAI,GACtB,GACN,CACb,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { type StyleProp, type ViewStyle, Pressable, type ViewProps } from \"react-native\";\nimport Animated from \"react-native-reanimated\";\nimport { useTheme } from \"../../context/ThemeContext\";\nimport { WHITE } from \"../../theme/primitive\";\nimport { DISABLED_OPACITY, DURATION } from \"../../theme/tokens\";\n\nconst SWITCH_TRANSITION_DURATION = DURATION.base;\nconst SWITCH_TRANSITION = {\n transitionDuration: SWITCH_TRANSITION_DURATION,\n transitionTimingFunction: 'ease-in-out',\n} as const;\n\ninterface ZSSwitchProps extends ViewProps {\n isActive: boolean;\n onToggle: () => void;\n style?: StyleProp<ViewStyle>;\n width?: number;\n trackColorInactive?: string;\n trackColorActive?: string;\n thumbColor?: string;\n disabled?: boolean;\n}\n\nfunction ZSSwitch({\n isActive = false,\n onToggle,\n style,\n width = 50,\n trackColorInactive,\n trackColorActive,\n thumbColor = WHITE,\n disabled = false,\n ...props\n}: ZSSwitchProps) {\n const { palette } = useTheme();\n const height = width * 0.6;\n const padding = width * 0.04;\n const thumbSize = height - padding * 2;\n const toggleBorderRadius = height / 2;\n const thumbBorderRadius = thumbSize / 2;\n\n const inactiveColor = trackColorInactive ?? palette.grey[30];\n const activeColor = trackColorActive ?? palette.primary.main;\n const thumbTranslateX = isActive ? width - thumbSize - padding * 2 : 0;\n\n const toggleStyle = {\n width,\n height,\n borderRadius: toggleBorderRadius,\n padding,\n justifyContent: \"center\" as const,\n backgroundColor: isActive ? activeColor : inactiveColor,\n transitionProperty: 'backgroundColor' as const,\n ...SWITCH_TRANSITION,\n };\n\n const thumbStyle = {\n width: thumbSize,\n height: thumbSize,\n borderRadius: thumbBorderRadius,\n justifyContent: \"center\" as const,\n backgroundColor: thumbColor,\n transform: [{ translateX: thumbTranslateX }],\n transitionProperty: 'transform' as const,\n ...SWITCH_TRANSITION,\n };\n\n return (\n <Pressable\n onPress={onToggle}\n style={[style, disabled && { opacity: DISABLED_OPACITY }]}\n disabled={disabled}\n accessibilityRole='switch'\n accessibilityState={{ checked: isActive, disabled }}\n {...props}\n >\n <Animated.View style={toggleStyle}>\n <Animated.View style={thumbStyle} />\n </Animated.View>\n </Pressable>\n );\n}\n\nexport default React.memo(ZSSwitch);\n"]}
@@ -1,10 +1,11 @@
1
1
  import React from "react";
2
2
  import { TextProps } from "react-native";
3
- import { TypoOptions, TypoColorOptions } from "../../theme/types";
3
+ import { TypoColorOptions, TypoOptions } from "../../theme/types";
4
4
  export interface ZSTextProps extends TextProps {
5
5
  typo?: TypoOptions;
6
6
  color?: TypoColorOptions;
7
7
  }
8
8
  declare function ZSText({ typo, color, ...props }: ZSTextProps): React.JSX.Element;
9
- export default ZSText;
9
+ declare const _default: React.MemoExoticComponent<typeof ZSText>;
10
+ export default _default;
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSText/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAA+B,WAAW,EAAa,gBAAgB,EAAiC,MAAM,mBAAmB,CAAC;AAUzI,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC1C,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED,iBAAS,MAAM,CAAC,EACd,IAAe,EACf,KAAc,EACd,GAAG,KAAK,EACT,EAAE,WAAW,qBAcb;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSText/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAA2B,MAAM,mBAAmB,CAAC;AAI3F,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED,iBAAS,MAAM,CAAC,EACd,IAAe,EACf,KAAc,EACd,GAAG,KAAK,EACT,EAAE,WAAW,qBAUb;;AAED,wBAAkC"}
@@ -1,24 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from "react";
2
3
  import { useTheme } from "../../context/ThemeContext";
4
+ import { resolveTextColor } from "../../theme/resolveColor";
3
5
  import TextAtom from "../atoms/TextAtom";
4
- function isColorMap(value) {
5
- return typeof value === 'object' && value !== null;
6
- }
7
6
  function ZSText({ typo = 'body.2', color = 'base', ...props }) {
8
7
  const { palette, typography } = useTheme();
9
8
  const [s01, s02] = typo.split('.');
10
- const [c01, c02] = color.split('.');
11
- const textColor = (() => {
12
- if (!c02)
13
- return palette.text[c01];
14
- if (c01 === 'text')
15
- return palette.text[c02];
16
- if (c01 === 'background')
17
- return palette.background[c02];
18
- const semanticPalette = palette[c01];
19
- return isColorMap(semanticPalette) ? semanticPalette[c02] : undefined;
20
- })();
21
- return _jsx(TextAtom, { ...props, style: [typography[s01][s02], { color: textColor }, props.style], children: props.children });
9
+ const textColor = resolveTextColor(palette, color);
10
+ return (_jsx(TextAtom, { ...props, style: [typography[s01][s02], { color: textColor }, props.style], children: props.children }));
22
11
  }
23
- export default ZSText;
12
+ export default React.memo(ZSText);
24
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSText/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AAKxC,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAOD,SAAS,MAAM,CAAC,EACd,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,MAAM,EACd,GAAG,KAAK,EACI;IACV,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC3C,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA8B,CAAC;IAChE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAiC,CAAC;IACpE,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE;QACtB,IAAI,CAAC,GAAG;YAAE,OAAO,OAAO,CAAC,IAAI,CAAC,GAA0B,CAAC,CAAC;QAC1D,IAAI,GAAG,KAAK,MAAM;YAAE,OAAO,OAAO,CAAC,IAAI,CAAC,GAA0B,CAAC,CAAC;QACpE,IAAI,GAAG,KAAK,YAAY;YAAE,OAAO,OAAO,CAAC,UAAU,CAAC,GAA4B,CAAC,CAAC;QAElF,MAAM,eAAe,GAAG,OAAO,CAAC,GAAyB,CAAC,CAAC;QAC3D,OAAO,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GAAmB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxF,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,KAAC,QAAQ,OAAK,KAAK,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,YAAG,KAAK,CAAC,QAAQ,GAAY,CAAA;AAC7H,CAAC;AAED,eAAe,MAAM,CAAC","sourcesContent":["import React from \"react\";\nimport { TextProps } from \"react-native\";\nimport { useTheme } from \"../../context/ThemeContext\";\nimport { ColorPalette, ThemeTextType, TypoOptions, TypoStyle, TypoColorOptions, TypoSubStyle, ThemeBackground } from \"../../theme/types\";\nimport TextAtom from \"../atoms/TextAtom\"\n\ntype SemanticPaletteKey = 'primary' | 'secondary' | 'danger' | 'warning' | 'success' | 'information' | 'grey';\ntype PaletteShade = keyof ColorPalette;\n\nfunction isColorMap(value: unknown): value is Record<string, string> {\n return typeof value === 'object' && value !== null;\n}\n\nexport interface ZSTextProps extends TextProps {\n typo?: TypoOptions;\n color?: TypoColorOptions;\n}\n\nfunction ZSText({\n typo = 'body.2',\n color = 'base',\n ...props\n}: ZSTextProps) {\n const { palette, typography } = useTheme();\n const [s01, s02] = typo.split('.') as [TypoStyle, TypoSubStyle];\n const [c01, c02] = color.split('.') as [string, string | undefined];\n const textColor = (() => {\n if (!c02) return palette.text[c01 as keyof ThemeTextType];\n if (c01 === 'text') return palette.text[c02 as keyof ThemeTextType];\n if (c01 === 'background') return palette.background[c02 as keyof ThemeBackground];\n\n const semanticPalette = palette[c01 as SemanticPaletteKey];\n return isColorMap(semanticPalette) ? semanticPalette[c02 as PaletteShade] : undefined;\n })();\n\n return <TextAtom {...props} style={[typography[s01][s02], { color: textColor }, props.style]}>{props.children}</TextAtom>\n}\n\nexport default ZSText;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSText/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAOzC,SAAS,MAAM,CAAC,EACd,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,MAAM,EACd,GAAG,KAAK,EACI;IACZ,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC3C,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA8B,CAAC;IAChE,MAAM,SAAS,GAAG,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAEnD,OAAO,CACL,KAAC,QAAQ,OAAK,KAAK,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,YAClF,KAAK,CAAC,QAAQ,GACN,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { TextProps } from \"react-native\";\nimport { useTheme } from \"../../context/ThemeContext\";\nimport { TypoColorOptions, TypoOptions, TypoStyle, TypoSubStyle } from \"../../theme/types\";\nimport { resolveTextColor } from \"../../theme/resolveColor\";\nimport TextAtom from \"../atoms/TextAtom\";\n\nexport interface ZSTextProps extends TextProps {\n typo?: TypoOptions;\n color?: TypoColorOptions;\n}\n\nfunction ZSText({\n typo = 'body.2',\n color = 'base',\n ...props\n}: ZSTextProps) {\n const { palette, typography } = useTheme();\n const [s01, s02] = typo.split('.') as [TypoStyle, TypoSubStyle];\n const textColor = resolveTextColor(palette, color);\n\n return (\n <TextAtom {...props} style={[typography[s01][s02], { color: textColor }, props.style]}>\n {props.children}\n </TextAtom>\n );\n}\n\nexport default React.memo(ZSText);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSTextField/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAA0C,SAAS,EAAE,cAAc,EAAa,MAAM,cAAc,CAAC;AAI5G,OAAO,EAAE,WAAW,EAA2B,MAAM,mBAAmB,CAAC;AAKzE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AAMzD,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cA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