@toss/tds-react-native 1.3.8 → 2.0.0-next.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 (208) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/components/agreement/Collapsible/AgreementCollapsibleTrigger.d.ts +10 -3
  3. package/dist/cjs/components/agreement/Collapsible/CollapsibleTrigger.d.ts +9 -3
  4. package/dist/cjs/components/dropdown/components/FixedFloatingDropdown.js +1 -1
  5. package/dist/cjs/components/dropdown/components/Trigger.js +1 -1
  6. package/dist/cjs/components/dropdown/contexts/DropdownContext.d.ts +2 -2
  7. package/dist/cjs/components/dropdown/types.d.ts +1 -1
  8. package/dist/cjs/components/highlight/hooks/useTimestampRef.d.ts +1 -1
  9. package/dist/cjs/components/icon-button/IconButton.d.ts +1 -1
  10. package/dist/cjs/components/keypad/FullSecureKeypad/SecureKeyButton.js +1 -1
  11. package/dist/cjs/components/keypad/FullSecureKeypad/index.d.ts +1 -1
  12. package/dist/cjs/components/navbar/ReactNavigationHelper/HeaderLeft.d.ts +1 -1
  13. package/dist/cjs/components/navbar/ReactNavigationHelper/HeaderRight.d.ts +1 -1
  14. package/dist/cjs/components/navbar/ReactNavigationHelper/HeaderTitle.d.ts +1 -1
  15. package/dist/cjs/components/navbar/ReactNavigationHelper/Right.d.ts +5 -2
  16. package/dist/cjs/components/navbar/ReactNavigationHelper/Right.js +1 -1
  17. package/dist/cjs/components/navbar/ReactNavigationHelper/index.d.ts +2 -2
  18. package/dist/cjs/components/numeric-spinner/useAccelerateInterval.js +1 -1
  19. package/dist/cjs/components/post/Header.d.ts +4 -4
  20. package/dist/cjs/components/post/List/PostList.js +1 -1
  21. package/dist/cjs/components/post/Post.d.ts +4 -4
  22. package/dist/cjs/components/radio/Radio.d.ts +0 -31
  23. package/dist/cjs/components/radio/Radio.js +1 -1
  24. package/dist/cjs/components/radio/index.d.ts +1 -1
  25. package/dist/cjs/components/radio/index.js +1 -1
  26. package/dist/cjs/components/search-field/SearchField.d.ts +1 -1
  27. package/dist/cjs/components/segmented-control/components/Item/Item.js +1 -1
  28. package/dist/cjs/components/segmented-control/contexts/ScrollContext.d.ts +1 -1
  29. package/dist/cjs/components/slider/Slider.js +1 -1
  30. package/dist/cjs/components/text-field/OldTextField/TDSTextField.d.ts +1 -1
  31. package/dist/cjs/components/text-field/OldTextField/hooks.d.ts +5 -5
  32. package/dist/cjs/components/text-field/OldTextField/index.d.ts +1 -1
  33. package/dist/cjs/components/text-field/OldTextField/styles.d.ts +3 -3
  34. package/dist/cjs/components/text-field/TextField/hooks/useTextFieldClearButtonControls.js +1 -1
  35. package/dist/cjs/components/text-field/TextField/variants/TextFieldBig/TextFieldBig.Button.js +1 -1
  36. package/dist/cjs/components/text-field/TextField/variants/TextFieldBig/TextFieldBig.js +1 -1
  37. package/dist/cjs/components/text-field/TextField/variants/TextFieldHero/TextFieldHero.Button.js +1 -1
  38. package/dist/cjs/components/text-field/TextField/variants/TextFieldHero/TextFieldHero.js +1 -1
  39. package/dist/cjs/components/text-field/TextField/variants/TextFieldLine/TextFieldLine.Button.js +1 -1
  40. package/dist/cjs/components/text-field/TextField/variants/TextFieldLine/TextFieldLine.js +1 -1
  41. package/dist/cjs/components/toast/hooks/useTextLine.d.ts +1 -1
  42. package/dist/cjs/components/tooltip/components/Tooltip/FloatingTooltip.js +1 -1
  43. package/dist/cjs/components/tooltip/contexts/TooltipContext.d.ts +2 -2
  44. package/dist/cjs/components/tooltip/hooks/useCloseTooltip.js +1 -1
  45. package/dist/cjs/components/tooltip/hooks/useOnPressOutside.d.ts +1 -1
  46. package/dist/cjs/components/tooltip/hooks/useOnPressOutside.js +1 -1
  47. package/dist/cjs/components/txt/Txt.js +2 -1
  48. package/dist/cjs/core/color/Color.js +1 -1
  49. package/dist/cjs/core/color/ColorPreference.js +1 -1
  50. package/dist/cjs/core/contexts/AdaptiveColorProvider.js +1 -1
  51. package/dist/cjs/core/contexts/ColorPreferenceProvider.js +1 -1
  52. package/dist/cjs/core/contexts/GlobalEventProvider.js +1 -15
  53. package/dist/cjs/core/contexts/HideAccessibility.js +1 -1
  54. package/dist/cjs/core/contexts/SafeAreaProvider.js +1 -1
  55. package/dist/cjs/core/contexts/TDSProvider.js +1 -1
  56. package/dist/cjs/core/contexts/TypographyProvider.js +2 -2
  57. package/dist/cjs/core/contexts/index.js +1 -1
  58. package/dist/cjs/core/hooks/index.js +1 -1
  59. package/dist/cjs/core/hooks/useA11yCondition.js +1 -1
  60. package/dist/cjs/core/hooks/useTypographyLevel.js +1 -1
  61. package/dist/cjs/core/index.js +1 -1
  62. package/dist/cjs/core/overlay/OverlayController.js +1 -1
  63. package/dist/cjs/core/overlay/OverlayProvider.js +1 -1
  64. package/dist/cjs/core/overlay/_OverlayProvider.js +1 -1
  65. package/dist/cjs/core/overlay/index.js +1 -1
  66. package/dist/cjs/core/overlay/types.d.ts +1 -0
  67. package/dist/cjs/core/overlay/types.js +1 -1
  68. package/dist/cjs/core/overlay/useOverlay.js +1 -1
  69. package/dist/cjs/core/overlay/useOverlayBase.js +4 -1
  70. package/dist/cjs/core/overlay/useOverlayCache.js +1 -1
  71. package/dist/cjs/core/theme/ThemeProvider.js +1 -1
  72. package/dist/cjs/core/theme/deriveToken/BaseDerivedTokenGenerator.js +1 -1
  73. package/dist/cjs/core/theme/deriveToken/batchDerivedTokenGenerators.js +1 -1
  74. package/dist/cjs/core/theme/deriveToken/deriveToken.js +1 -1
  75. package/dist/cjs/core/theme/deriveToken/index.js +1 -1
  76. package/dist/cjs/core/theme/index.js +1 -1
  77. package/dist/cjs/core/theme/seedToken/index.js +1 -1
  78. package/dist/cjs/core/theme/seedToken/seedToken.js +1 -1
  79. package/dist/cjs/extensions/bridge/components/Icon.d.ts +2 -2
  80. package/dist/cjs/extensions/bridge/useBridge.js +1 -1
  81. package/dist/cjs/extensions/navigation/Navigation.d.ts +5 -4
  82. package/dist/cjs/extensions/navigation/Navigation.js +1 -1
  83. package/dist/cjs/extensions/overlay-extension/components/CapturePress.d.ts +1 -1
  84. package/dist/cjs/extensions/overlay-extension/components/CapturePress.js +1 -1
  85. package/dist/cjs/extensions/page-navbar/PageNavbar.d.ts +1 -1
  86. package/dist/cjs/extensions/tab-view/TabsContext.d.ts +1 -1
  87. package/dist/cjs/extensions/tab-view/TabsList.js +1 -1
  88. package/dist/cjs/extensions/tab-view/TabsViews.d.ts +1 -1
  89. package/dist/cjs/extensions/tab-view/TabsViews.js +1 -1
  90. package/dist/cjs/extensions/tab-view/hooks/useScrollStateChangedHandler.d.ts +1 -1
  91. package/dist/cjs/extensions/tab-view/utils/getTabData.js +1 -1
  92. package/dist/cjs/extensions/top-navigation/TopNavigation.d.ts +4 -16
  93. package/dist/cjs/extensions/top-navigation/TopNavigation.js +1 -1
  94. package/dist/cjs/extensions/top-navigation/constants.d.ts +15 -0
  95. package/dist/cjs/extensions/top-navigation/constants.js +1 -0
  96. package/dist/cjs/extensions/top-navigation/index.d.ts +1 -0
  97. package/dist/cjs/extensions/top-navigation/index.js +1 -1
  98. package/dist/cjs/interactions/pressable-effect/PressableEffect.d.ts +3 -1
  99. package/dist/cjs/utils/compat.d.ts +17 -0
  100. package/dist/cjs/utils/compat.js +1 -0
  101. package/dist/cjs/utils/isReactText.d.ts +2 -2
  102. package/dist/cjs/utils/mergeRefs.d.ts +2 -1
  103. package/dist/cjs/utils/testing/index.d.ts +1 -0
  104. package/dist/cjs/utils/testing/index.js +1 -1
  105. package/dist/cjs/utils/testing/mockAccessibilityInfo.d.ts +5 -2
  106. package/dist/cjs/utils/testing/mockAccessibilityInfo.js +1 -1
  107. package/dist/cjs/utils/testing/mockViewLayout.d.ts +27 -0
  108. package/dist/cjs/utils/testing/mockViewLayout.js +1 -0
  109. package/dist/esm/components/agreement/Collapsible/AgreementCollapsibleTrigger.d.ts +10 -3
  110. package/dist/esm/components/agreement/Collapsible/CollapsibleTrigger.d.ts +9 -3
  111. package/dist/esm/components/dropdown/components/FixedFloatingDropdown.js +1 -1
  112. package/dist/esm/components/dropdown/components/Trigger.js +1 -1
  113. package/dist/esm/components/dropdown/contexts/DropdownContext.d.ts +2 -2
  114. package/dist/esm/components/dropdown/types.d.ts +1 -1
  115. package/dist/esm/components/highlight/hooks/useTimestampRef.d.ts +1 -1
  116. package/dist/esm/components/icon-button/IconButton.d.ts +1 -1
  117. package/dist/esm/components/keypad/FullSecureKeypad/SecureKeyButton.js +1 -1
  118. package/dist/esm/components/keypad/FullSecureKeypad/index.d.ts +1 -1
  119. package/dist/esm/components/navbar/ReactNavigationHelper/HeaderLeft.d.ts +1 -1
  120. package/dist/esm/components/navbar/ReactNavigationHelper/HeaderRight.d.ts +1 -1
  121. package/dist/esm/components/navbar/ReactNavigationHelper/HeaderTitle.d.ts +1 -1
  122. package/dist/esm/components/navbar/ReactNavigationHelper/Right.d.ts +5 -2
  123. package/dist/esm/components/navbar/ReactNavigationHelper/Right.js +1 -1
  124. package/dist/esm/components/navbar/ReactNavigationHelper/index.d.ts +2 -2
  125. package/dist/esm/components/numeric-spinner/useAccelerateInterval.js +1 -1
  126. package/dist/esm/components/post/Header.d.ts +4 -4
  127. package/dist/esm/components/post/List/PostList.js +1 -1
  128. package/dist/esm/components/post/Post.d.ts +4 -4
  129. package/dist/esm/components/radio/Radio.d.ts +0 -31
  130. package/dist/esm/components/radio/Radio.js +1 -1
  131. package/dist/esm/components/radio/index.d.ts +1 -1
  132. package/dist/esm/components/radio/index.js +1 -1
  133. package/dist/esm/components/search-field/SearchField.d.ts +1 -1
  134. package/dist/esm/components/segmented-control/components/Item/Item.js +1 -1
  135. package/dist/esm/components/segmented-control/contexts/ScrollContext.d.ts +1 -1
  136. package/dist/esm/components/slider/Slider.js +1 -1
  137. package/dist/esm/components/text-field/OldTextField/TDSTextField.d.ts +1 -1
  138. package/dist/esm/components/text-field/OldTextField/hooks.d.ts +5 -5
  139. package/dist/esm/components/text-field/OldTextField/index.d.ts +1 -1
  140. package/dist/esm/components/text-field/OldTextField/styles.d.ts +3 -3
  141. package/dist/esm/components/text-field/TextField/hooks/useTextFieldClearButtonControls.js +1 -1
  142. package/dist/esm/components/text-field/TextField/variants/TextFieldBig/TextFieldBig.Button.js +1 -1
  143. package/dist/esm/components/text-field/TextField/variants/TextFieldBig/TextFieldBig.js +1 -1
  144. package/dist/esm/components/text-field/TextField/variants/TextFieldHero/TextFieldHero.Button.js +1 -1
  145. package/dist/esm/components/text-field/TextField/variants/TextFieldHero/TextFieldHero.js +1 -1
  146. package/dist/esm/components/text-field/TextField/variants/TextFieldLine/TextFieldLine.Button.js +1 -1
  147. package/dist/esm/components/text-field/TextField/variants/TextFieldLine/TextFieldLine.js +1 -1
  148. package/dist/esm/components/toast/hooks/useTextLine.d.ts +1 -1
  149. package/dist/esm/components/tooltip/components/Tooltip/FloatingTooltip.js +1 -1
  150. package/dist/esm/components/tooltip/contexts/TooltipContext.d.ts +2 -2
  151. package/dist/esm/components/tooltip/hooks/useCloseTooltip.js +1 -1
  152. package/dist/esm/components/tooltip/hooks/useOnPressOutside.d.ts +1 -1
  153. package/dist/esm/components/tooltip/hooks/useOnPressOutside.js +1 -1
  154. package/dist/esm/components/txt/Txt.js +2 -1
  155. package/dist/esm/core/color/Color.js +1 -3
  156. package/dist/esm/core/contexts/AdaptiveColorProvider.js +1 -1
  157. package/dist/esm/core/contexts/ColorPreferenceProvider.js +1 -3
  158. package/dist/esm/core/contexts/GlobalEventProvider.js +2 -1
  159. package/dist/esm/core/contexts/HideAccessibility.js +3 -1
  160. package/dist/esm/core/contexts/SafeAreaProvider.js +2 -1
  161. package/dist/esm/core/contexts/TDSProvider.js +1 -1
  162. package/dist/esm/core/contexts/TypographyProvider.js +1 -1
  163. package/dist/esm/core/hooks/useA11yCondition.js +2 -1
  164. package/dist/esm/core/hooks/useTypographyLevel.js +1 -1
  165. package/dist/esm/core/overlay/OverlayController.js +1 -1
  166. package/dist/esm/core/overlay/OverlayProvider.js +1 -1
  167. package/dist/esm/core/overlay/_OverlayProvider.js +1 -1
  168. package/dist/esm/core/overlay/types.d.ts +1 -0
  169. package/dist/esm/core/overlay/useOverlay.js +1 -1
  170. package/dist/esm/core/overlay/useOverlayBase.js +1 -1
  171. package/dist/esm/core/theme/ThemeProvider.js +1 -1
  172. package/dist/esm/core/theme/deriveToken/deriveToken.js +1 -1
  173. package/dist/esm/core/theme/seedToken/seedToken.js +1 -1
  174. package/dist/esm/extensions/bridge/components/Icon.d.ts +2 -2
  175. package/dist/esm/extensions/bridge/useBridge.js +1 -1
  176. package/dist/esm/extensions/navigation/Navigation.d.ts +5 -4
  177. package/dist/esm/extensions/navigation/Navigation.js +1 -1
  178. package/dist/esm/extensions/overlay-extension/components/CapturePress.d.ts +1 -1
  179. package/dist/esm/extensions/overlay-extension/components/CapturePress.js +1 -1
  180. package/dist/esm/extensions/page-navbar/PageNavbar.d.ts +1 -1
  181. package/dist/esm/extensions/tab-view/TabsContext.d.ts +1 -1
  182. package/dist/esm/extensions/tab-view/TabsList.js +1 -1
  183. package/dist/esm/extensions/tab-view/TabsViews.d.ts +1 -1
  184. package/dist/esm/extensions/tab-view/TabsViews.js +1 -1
  185. package/dist/esm/extensions/tab-view/hooks/useScrollStateChangedHandler.d.ts +1 -1
  186. package/dist/esm/extensions/tab-view/utils/getTabData.js +1 -1
  187. package/dist/esm/extensions/top-navigation/TopNavigation.d.ts +4 -16
  188. package/dist/esm/extensions/top-navigation/TopNavigation.js +1 -1
  189. package/dist/esm/extensions/top-navigation/constants.d.ts +15 -0
  190. package/dist/esm/extensions/top-navigation/constants.js +1 -0
  191. package/dist/esm/extensions/top-navigation/index.d.ts +1 -0
  192. package/dist/esm/extensions/top-navigation/index.js +1 -1
  193. package/dist/esm/interactions/pressable-effect/PressableEffect.d.ts +3 -1
  194. package/dist/esm/utils/compat.d.ts +17 -0
  195. package/dist/esm/utils/compat.js +1 -0
  196. package/dist/esm/utils/isReactText.d.ts +2 -2
  197. package/dist/esm/utils/mergeRefs.d.ts +2 -1
  198. package/dist/esm/utils/testing/index.d.ts +1 -0
  199. package/dist/esm/utils/testing/index.js +1 -1
  200. package/dist/esm/utils/testing/mockAccessibilityInfo.d.ts +5 -2
  201. package/dist/esm/utils/testing/mockAccessibilityInfo.js +1 -1
  202. package/dist/esm/utils/testing/mockViewLayout.d.ts +27 -0
  203. package/dist/esm/utils/testing/mockViewLayout.js +1 -0
  204. package/package.json +21 -19
  205. package/dist/cjs/components/checkbox/utils/useId.d.ts +0 -1
  206. package/dist/cjs/components/checkbox/utils/useId.js +0 -1
  207. package/dist/esm/components/checkbox/utils/useId.d.ts +0 -1
  208. package/dist/esm/components/checkbox/utils/useId.js +0 -1
@@ -1,6 +1,8 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ViewProps } from 'react-native';
3
3
  import type { Icon } from '../../components/icon';
4
+ import type { NavigationTheme } from './constants';
5
+ import { COLOR_PALETTE } from './constants';
4
6
  type Icon = {
5
7
  source: {
6
8
  uri: string;
@@ -30,29 +32,15 @@ export interface TopNavigationProps {
30
32
  leftVisible?: boolean;
31
33
  }
32
34
  export declare function TopNavigation({ title, icon, onPressTitle, onPressDots, onPressClose, fixedRightButton, children, withHome, contentVisible, theme, leftVisible, }: TopNavigationProps): import("react/jsx-runtime").JSX.Element;
33
- export type NavigationTheme = 'light' | 'dark';
35
+ export type { NavigationTheme };
34
36
  export interface NavigationRightContentProps extends ViewProps {
35
37
  fixedRightButton: TopNavigationProps['fixedRightButton'];
36
38
  onPressDots?: () => void;
37
39
  onPressClose?: () => void;
38
40
  theme?: NavigationTheme;
39
41
  }
40
- export declare const COLOR_PALETTE: {
41
- light: {
42
- titleTextColor: string;
43
- backgroundColor: string;
44
- iconTintColor: string;
45
- dividerColor: string;
46
- };
47
- dark: {
48
- titleTextColor: string;
49
- backgroundColor: string;
50
- iconTintColor: string;
51
- dividerColor: string;
52
- };
53
- };
42
+ export { COLOR_PALETTE };
54
43
  export declare function NavigationRightContent({ fixedRightButton, onPressDots, onPressClose, theme, ...viewProps }: NavigationRightContentProps): import("react/jsx-runtime").JSX.Element;
55
44
  export declare function CloseWithDotsMono({ onPressDots, onPressClose, theme, }: Pick<TopNavigationProps, 'onPressDots' | 'onPressClose'> & {
56
45
  theme?: NavigationTheme;
57
46
  }): import("react/jsx-runtime").JSX.Element;
58
- export {};
@@ -1 +1 @@
1
- "use strict";import{jsx as o,jsxs as a,Fragment as v}from"react/jsx-runtime";import{useNavigation as T}from"@granite-js/native/@react-navigation/native";import{closeView as k}from"@granite-js/react-native";import{colors as p}from"@toss/tds-colors";import{useLayoutEffect as F}from"react";import{View as n}from"react-native";import{Navigation as N,NavigationBackButton as P,NavigationContent as w,NavigationLeft as _,NavigationRight as x,NavigationTitleIcon as y,NavigationTitleText as E}from"../navigation";import{tdsEvent as I}from"../partner-navigation/event";import{IconButton as h}from"./IconButton";const b=157,L=b+44+4;export function TopNavigation({title:i,icon:e,onPressTitle:r,onPressDots:t,onPressClose:c,fixedRightButton:l,children:d,withHome:u=!1,contentVisible:g=!0,theme:s="light",leftVisible:C=!0}){const m=T(),f=m.canGoBack();return F(()=>{if(!g){m.setOptions({headerBackVisible:!1,headerTitle:()=>null,headerLeft:()=>null});return}},[g,m]),a(N,{children:[g&&a(v,{children:[o(_,{visible:C,children:o(P,{theme:s,canGoBack:f})}),a(w,{onPressTitle:r,horizontalSafeMargin:l!=null?L:b,withHome:u,theme:s,leftVisible:C,children:[o(y,{...e}),i!=null&&o(E,{theme:s,children:i}),u&&o(y,{name:"icon-home-mono"})]})]}),o(x,{children:o(NavigationRightContent,{fixedRightButton:l,onPressDots:t,onPressClose:c,theme:s})}),d]})}export const COLOR_PALETTE={light:{titleTextColor:"#191F28",backgroundColor:p.greyOpacity50,iconTintColor:p.greyOpacity600,dividerColor:p.greyOpacity200},dark:{titleTextColor:"#FFFFFF",backgroundColor:"rgba(2, 3, 7, 0.58)",iconTintColor:"rgba(253, 253, 255, 0.75))",dividerColor:"rgba(222, 222, 255, 0.19)"}};export function NavigationRightContent({fixedRightButton:i,onPressDots:e,onPressClose:r,theme:t="light",...c}){const{style:l,...d}=c;return a(n,{style:[{flexDirection:"row",gap:4},l],...d,children:[i!=null?o(n,{style:{borderRadius:99,overflow:"hidden"},children:o(h,{name:i.icon.name??"",accessibilityLabel:i.title,onPress:()=>{i.onPress?.(),I.emit("navigationAccessoryEvent",{id:i.id})},style:{paddingVertical:7,paddingHorizontal:12,backgroundColor:COLOR_PALETTE[t].backgroundColor},color:COLOR_PALETTE[t].iconTintColor,disabled:i.disabled})}):o(n,{style:{width:44,height:34}}),o(CloseWithDotsMono,{onPressDots:e,onPressClose:r,theme:t})]})}export function CloseWithDotsMono({onPressDots:i,onPressClose:e=k,theme:r="light"}){return o(n,{style:{borderRadius:99,overflow:"hidden"},children:a(n,{style:{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:12,height:34,paddingHorizontal:12,backgroundColor:COLOR_PALETTE[r].backgroundColor},children:[o(h,{name:"icon-dots-mono",accessibilityLabel:"\uB354\uBCF4\uAE30",onPress:i,color:COLOR_PALETTE[r].iconTintColor}),o(n,{style:{width:1,height:16,backgroundColor:COLOR_PALETTE[r].dividerColor}}),o(h,{name:"icon-appsintoss-close-mono",accessibilityLabel:"\uB2EB\uAE30",color:COLOR_PALETTE[r].iconTintColor,onPress:()=>{e()}})]})})}
1
+ "use strict";import{jsx as o,jsxs as a,Fragment as y}from"react/jsx-runtime";import{useNavigation as T}from"@granite-js/native/@react-navigation/native";import{closeView as N}from"@granite-js/react-native";import{useLayoutEffect as P}from"react";import{View as r}from"react-native";import{Navigation as k,NavigationBackButton as w,NavigationContent as _,NavigationLeft as E,NavigationRight as I,NavigationTitleIcon as v,NavigationTitleText as L}from"../navigation";import{tdsEvent as x}from"../partner-navigation/event";import{COLOR_PALETTE as e}from"./constants";import{IconButton as h}from"./IconButton";const C=157,A=C+44+4;export function TopNavigation({title:i,icon:t,onPressTitle:n,onPressDots:s,onPressClose:d,fixedRightButton:l,children:g,withHome:u=!1,contentVisible:m=!0,theme:c="light",leftVisible:f=!0}){const p=T(),b=p.canGoBack();return P(()=>{if(!m){p.setOptions({headerBackVisible:!1,headerTitle:()=>null,headerLeft:()=>null});return}},[m,p]),a(k,{children:[m&&a(y,{children:[o(E,{visible:f,children:o(w,{theme:c,canGoBack:b})}),a(_,{onPressTitle:n,horizontalSafeMargin:l!=null?A:C,withHome:u,theme:c,leftVisible:f,children:[o(v,{...t}),i!=null&&o(L,{theme:c,children:i}),u&&o(v,{name:"icon-home-mono"})]})]}),o(I,{children:o(NavigationRightContent,{fixedRightButton:l,onPressDots:s,onPressClose:d,theme:c})}),g]})}export{e as COLOR_PALETTE};export function NavigationRightContent({fixedRightButton:i,onPressDots:t,onPressClose:n,theme:s="light",...d}){const{style:l,...g}=d;return a(r,{style:[{flexDirection:"row",gap:4},l],...g,children:[i!=null?o(r,{style:{borderRadius:99,overflow:"hidden"},children:o(h,{name:i.icon.name??"",accessibilityLabel:i.title,onPress:()=>{i.onPress?.(),x.emit("navigationAccessoryEvent",{id:i.id})},style:{paddingVertical:7,paddingHorizontal:12,backgroundColor:e[s].backgroundColor},color:e[s].iconTintColor,disabled:i.disabled})}):o(r,{style:{width:44,height:34}}),o(CloseWithDotsMono,{onPressDots:t,onPressClose:n,theme:s})]})}export function CloseWithDotsMono({onPressDots:i,onPressClose:t=N,theme:n="light"}){return o(r,{style:{borderRadius:99,overflow:"hidden"},children:a(r,{style:{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:12,height:34,paddingHorizontal:12,backgroundColor:e[n].backgroundColor},children:[o(h,{name:"icon-dots-mono",accessibilityLabel:"\uB354\uBCF4\uAE30",onPress:i,color:e[n].iconTintColor}),o(r,{style:{width:1,height:16,backgroundColor:e[n].dividerColor}}),o(h,{name:"icon-appsintoss-close-mono",accessibilityLabel:"\uB2EB\uAE30",color:e[n].iconTintColor,onPress:()=>{t()}})]})})}
@@ -0,0 +1,15 @@
1
+ export type NavigationTheme = 'light' | 'dark';
2
+ export declare const COLOR_PALETTE: {
3
+ light: {
4
+ titleTextColor: string;
5
+ backgroundColor: string;
6
+ iconTintColor: string;
7
+ dividerColor: string;
8
+ };
9
+ dark: {
10
+ titleTextColor: string;
11
+ backgroundColor: string;
12
+ iconTintColor: string;
13
+ dividerColor: string;
14
+ };
15
+ };
@@ -0,0 +1 @@
1
+ "use strict";import{colors as o}from"@toss/tds-colors";export const COLOR_PALETTE={light:{titleTextColor:"#191F28",backgroundColor:o.greyOpacity50,iconTintColor:o.greyOpacity600,dividerColor:o.greyOpacity200},dark:{titleTextColor:"#FFFFFF",backgroundColor:"rgba(2, 3, 7, 0.58)",iconTintColor:"rgba(253, 253, 255, 0.75))",dividerColor:"rgba(222, 222, 255, 0.19)"}};
@@ -1,2 +1,3 @@
1
+ export * from './constants';
1
2
  export * from './TopNavigation';
2
3
  export * from './useTopNavigation';
@@ -1 +1 @@
1
- "use strict";export*from"./TopNavigation";export*from"./useTopNavigation";
1
+ "use strict";export*from"./constants";export*from"./TopNavigation";export*from"./useTopNavigation";
@@ -4,7 +4,9 @@ import { View } from 'react-native';
4
4
  import { PressableUnderlay } from './PressableUnderlay';
5
5
  interface PressableEffectProps extends PressableProps {
6
6
  style?: StyleProp<ViewStyle>;
7
- underlay?: ReactElement | null;
7
+ underlay?: ReactElement<{
8
+ style?: StyleProp<ViewStyle>;
9
+ }> | null;
8
10
  children?: ReactNode;
9
11
  }
10
12
  /**
@@ -0,0 +1,17 @@
1
+ interface RNVersionBranch<T> {
2
+ '0.72': T;
3
+ '0.84': T;
4
+ }
5
+ /**
6
+ * React Native 버전에 따라 적절한 값을 선택합니다.
7
+ * @param options - 버전별 값 객체
8
+ * @returns 현재 RN 버전에 맞는 값
9
+ *
10
+ * @example
11
+ * const Component = selectByRNVersion({
12
+ * '0.72': LegacyComponent,
13
+ * '0.84': ModernComponent,
14
+ * });
15
+ */
16
+ export declare function selectByRNVersion<T>(options: RNVersionBranch<T>): T;
17
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";import{Platform as e}from"react-native";export function selectByRNVersion(r){const t=e.constants.reactNativeVersion;return t&&t.minor>=84?r["0.84"]:r["0.72"]}
@@ -1,2 +1,2 @@
1
- import type { ReactNode, ReactText } from 'react';
2
- export declare function isReactText(node: ReactNode): node is ReactText;
1
+ import type { ReactNode } from 'react';
2
+ export declare function isReactText(node: ReactNode): node is string | number;
@@ -1 +1,2 @@
1
- export declare function mergeRefs<T = any>(...refs: Array<React.MutableRefObject<T> | React.LegacyRef<T>>): React.RefCallback<T>;
1
+ import type { RefObject } from 'react';
2
+ export declare function mergeRefs<T = any>(...refs: Array<RefObject<T | null> | React.LegacyRef<T>>): React.Ref<T>;
@@ -1 +1,2 @@
1
1
  export { mockAccessibilityInfo } from './mockAccessibilityInfo';
2
+ export { mockViewLayout } from './mockViewLayout';
@@ -1 +1 @@
1
- "use strict";export{mockAccessibilityInfo}from"./mockAccessibilityInfo";
1
+ "use strict";export{mockAccessibilityInfo}from"./mockAccessibilityInfo";export{mockViewLayout}from"./mockViewLayout";
@@ -1,6 +1,9 @@
1
1
  import { AccessibilityInfo } from 'react-native';
2
2
  type EnableAccessibilityInfoKey = keyof Pick<AccessibilityInfo, 'isReduceMotionEnabled' | 'isScreenReaderEnabled'>;
3
- export declare function mockAccessibilityInfo(accessibilityinfo: {
3
+ export declare function setupAccessibilityMock(): void;
4
+ export declare function mockAccessibilityInfo(accessibilityInfo: {
4
5
  [key in EnableAccessibilityInfoKey]?: boolean;
5
- }): void;
6
+ }): {
7
+ expectAnnounced: (message: string) => void;
8
+ };
6
9
  export {};
@@ -1 +1 @@
1
- "use strict";import{AccessibilityInfo as e}from"react-native";export function mockAccessibilityInfo(n){Object.entries(n).forEach(([t,c])=>{jest.spyOn(e,t).mockImplementationOnce(async()=>c)}),jest.spyOn(e,"addEventListener").mockReturnValueOnce({remove:()=>{}})}
1
+ "use strict";import{AccessibilityInfo as e}from"react-native";export function setupAccessibilityMock(){jest.mocked(e.isReduceMotionEnabled).mockReturnValue(Promise.resolve(!1)),jest.mocked(e.addEventListener).mockReturnValue({remove:jest.fn()}),e.announceForAccessibilityWithOptions||=jest.fn()}export function mockAccessibilityInfo(t){Object.entries(t).forEach(([n,s])=>{jest.mocked(e[n]).mockReturnValue(Promise.resolve(s))}),jest.spyOn(e,"addEventListener").mockReturnValue({remove:jest.fn()});const o=jest.spyOn(e,"announceForAccessibilityWithOptions");function c(n){expect(o).toHaveBeenCalledWith(n,expect.anything())}return{expectAnnounced:c}}
@@ -0,0 +1,27 @@
1
+ import { fireEvent } from '@testing-library/react-native';
2
+ interface LayoutRect {
3
+ x?: number;
4
+ y?: number;
5
+ width?: number;
6
+ height?: number;
7
+ }
8
+ /**
9
+ * jest 환경에서 View의 레이아웃 측정을 모킹합니다.
10
+ * `measure`, `measureInWindow`, `onLayout` 세 가지가 동일한 dimensions를 사용합니다.
11
+ *
12
+ * jest.restoreAllMocks()가 afterEach에서 호출되어야 spy가 정리됩니다.
13
+ * 또는 반환된 `restore()`를 직접 호출할 수 있습니다.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const { fireLayout } = mockViewLayout({ width: 200, height: 50 });
18
+ * render(<Component />);
19
+ * await act(async () => { jest.advanceTimersByTime(16); }); // requestAnimationFrame
20
+ * await act(async () => { fireLayout(element); }); // onLayout
21
+ * ```
22
+ */
23
+ export declare function mockViewLayout(layout?: LayoutRect): {
24
+ fireLayout: (element: Parameters<typeof fireEvent>[0], overrides?: LayoutRect) => void;
25
+ restore: () => void;
26
+ };
27
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";import{View as o}from"react-native";import{fireEvent as y}from"@testing-library/react-native";const p={x:0,y:0,width:100,height:40};export function mockViewLayout(n){const t={...p,...n},i=jest.spyOn(o.prototype,"measure").mockImplementation(function(e){e(t.x,t.y,t.width,t.height,t.x,t.y)}),r=jest.spyOn(o.prototype,"measureInWindow").mockImplementation(function(e){e(t.x,t.y,t.width,t.height)});function m(e,c){const u={...t,...c};y(e,"layout",{nativeEvent:{layout:u}})}function s(){i.mockRestore(),r.mockRestore()}return{fireLayout:m,restore:s}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toss/tds-react-native",
3
- "version": "1.3.8",
3
+ "version": "2.0.0-next.0",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",
@@ -34,7 +34,7 @@
34
34
  "prepack": "yarn build",
35
35
  "build": "./scripts/build.sh",
36
36
  "test": "jest",
37
- "typecheck": "tsc --noEmit",
37
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.spec.json",
38
38
  "lint": "eslint ./src/**/*.{js,jsx,ts,tsx}"
39
39
  },
40
40
  "devDependencies": {
@@ -42,49 +42,51 @@
42
42
  "@babel/plugin-proposal-class-properties": "^7.16.7",
43
43
  "@babel/plugin-proposal-private-methods": "^7.18.6",
44
44
  "@babel/plugin-proposal-private-property-in-object": "^7.18.6",
45
- "@babel/plugin-transform-flow-strip-types": "^7.19.0",
45
+ "@babel/plugin-transform-flow-strip-types": "7.27.1",
46
46
  "@babel/preset-env": "^7.15.0",
47
47
  "@babel/preset-react": "^7.16.7",
48
48
  "@babel/preset-typescript": "^7.16.7",
49
49
  "@babel/runtime": "7.18.9",
50
- "@granite-js/native": "0.1.28",
51
- "@granite-js/react-native": "0.1.28",
50
+ "@granite-js/native": "1.0.4",
51
+ "@granite-js/react-native": "1.0.4",
52
52
  "@jest/globals": "^28",
53
- "@testing-library/react-native": "^0.0.4",
54
- "@tools/javascript-obfuscator": "0.0.0",
55
- "@tools/obfuscator": "0.0.0",
53
+ "@testing-library/react-native": "^12.4.1",
54
+ "@tools/javascript-obfuscator": "0.0.1",
55
+ "@tools/obfuscator": "0.0.1",
56
56
  "@types/culori": "^2.1.1",
57
57
  "@types/jest": "^29",
58
- "@types/react": "^18",
58
+ "@types/react": "19.2.3",
59
+ "babel-preset-granite": "1.0.4",
60
+ "brick-module": "0.5.0",
59
61
  "esbuild": "^0.25.8",
60
62
  "jest": "^29.7.0",
61
63
  "jest-cli": "^29.7.0",
62
64
  "jest-react-native": "^18.0.0",
63
- "react": "18.2.0",
64
- "react-native": "0.72.6",
65
- "react-test-renderer": "^18",
65
+ "react": "19.2.3",
66
+ "react-native": "0.84.0",
67
+ "react-test-renderer": "19.2.3",
66
68
  "typescript": "5.9.2"
67
69
  },
68
70
  "peerDependencies": {
69
- "@granite-js/native": ">=0.1.28",
70
- "@granite-js/react-native": "*",
71
+ "@granite-js/native": ">=1",
72
+ "@granite-js/react-native": ">=1",
73
+ "brick-module": "*",
71
74
  "react": "*",
72
75
  "react-native": "*"
73
76
  },
74
77
  "dependencies": {
75
- "@react-spring/native": "9.5.2",
76
- "@react-stately/radio": "^3.6.0",
78
+ "@react-spring/native": "10.0.3",
79
+ "@react-stately/radio": "^3.11.3",
77
80
  "@toss/tds-color-utils": "0.0.2",
78
81
  "@toss/tds-colors": "^0.1.0",
79
82
  "@toss/tds-easings": "^0.0.1",
80
83
  "@toss/tds-spring-easing": "^0.0.1",
81
84
  "@toss/tds-typography": "0.0.3",
82
85
  "@toss/utils": "^1.6.1",
86
+ "@types/node": "22.15.0",
83
87
  "culori": "^4.0.1",
84
88
  "es-hangul": "^2.3.0",
85
- "hex-to-rgba": "^2.0.1",
86
- "react-hook-form": "^7.33.1",
87
- "react-uid": "^2.3.2"
89
+ "hex-to-rgba": "^2.0.1"
88
90
  },
89
91
  "sideEffects": false,
90
92
  "packageManager": "yarn@3.2.1",
@@ -1 +0,0 @@
1
- export default function useId(prefix?: string): string;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=useId;const react_uid_1=require("react-uid");function useId(e){const t=(0,react_uid_1.useUID)();return e!==void 0?`${e}-${t}`:t}
@@ -1 +0,0 @@
1
- export default function useId(prefix?: string): string;
@@ -1 +0,0 @@
1
- "use strict";import{useUID as t}from"react-uid";export default function u(e){const n=t();return e!==void 0?`${e}-${n}`:n}