@0610studio/zs-ui 0.0.50 → 0.0.52

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 (61) hide show
  1. package/README.md +1 -1
  2. package/build/index.d.ts +4 -5
  3. package/build/index.d.ts.map +1 -1
  4. package/build/index.js +2 -2
  5. package/build/index.js.map +1 -1
  6. package/build/model/types.d.ts +11 -16
  7. package/build/model/types.d.ts.map +1 -1
  8. package/build/model/types.js +0 -1
  9. package/build/model/types.js.map +1 -1
  10. package/build/model/useOverlayProvider.d.ts.map +1 -1
  11. package/build/model/useOverlayProvider.js +37 -38
  12. package/build/model/useOverlayProvider.js.map +1 -1
  13. package/build/model/useThemeProvider.d.ts.map +1 -1
  14. package/build/model/useThemeProvider.js +4 -4
  15. package/build/model/useThemeProvider.js.map +1 -1
  16. package/build/overlay/AlertOverlay/index.d.ts.map +1 -1
  17. package/build/overlay/AlertOverlay/index.js +20 -37
  18. package/build/overlay/AlertOverlay/index.js.map +1 -1
  19. package/build/overlay/BottomSheetOverlay/index.d.ts +3 -19
  20. package/build/overlay/BottomSheetOverlay/index.d.ts.map +1 -1
  21. package/build/overlay/BottomSheetOverlay/index.js +111 -74
  22. package/build/overlay/BottomSheetOverlay/index.js.map +1 -1
  23. package/build/overlay/LoadingNotify/index.d.ts.map +1 -1
  24. package/build/overlay/LoadingNotify/index.js +2 -13
  25. package/build/overlay/LoadingNotify/index.js.map +1 -1
  26. package/build/overlay/Modality/index.d.ts +1 -2
  27. package/build/overlay/Modality/index.d.ts.map +1 -1
  28. package/build/overlay/Modality/index.js +2 -2
  29. package/build/overlay/Modality/index.js.map +1 -1
  30. package/build/overlay/PopOver/PopOverMenu.d.ts.map +1 -1
  31. package/build/overlay/PopOver/PopOverMenu.js +1 -15
  32. package/build/overlay/PopOver/PopOverMenu.js.map +1 -1
  33. package/build/overlay/SnackbarNotify/ui/SnackbarItem.d.ts.map +1 -1
  34. package/build/overlay/SnackbarNotify/ui/SnackbarItem.js +7 -25
  35. package/build/overlay/SnackbarNotify/ui/SnackbarItem.js.map +1 -1
  36. package/build/overlay/index.d.ts +1 -2
  37. package/build/overlay/index.d.ts.map +1 -1
  38. package/build/overlay/index.js +1 -2
  39. package/build/overlay/index.js.map +1 -1
  40. package/build/overlay/ui/ModalBackground.d.ts.map +1 -1
  41. package/build/overlay/ui/ModalBackground.js +11 -4
  42. package/build/overlay/ui/ModalBackground.js.map +1 -1
  43. package/build/ui/ZSBottomButton/index.js +1 -1
  44. package/build/ui/ZSBottomButton/index.js.map +1 -1
  45. package/package.json +1 -3
  46. package/build/overlay/BottomSheetOverlay/model/useBottomSheetOverlay.d.ts +0 -43
  47. package/build/overlay/BottomSheetOverlay/model/useBottomSheetOverlay.d.ts.map +0 -1
  48. package/build/overlay/BottomSheetOverlay/model/useBottomSheetOverlay.js +0 -222
  49. package/build/overlay/BottomSheetOverlay/model/useBottomSheetOverlay.js.map +0 -1
  50. package/build/overlay/BottomSheetOverlay/types/index.d.ts +0 -4
  51. package/build/overlay/BottomSheetOverlay/types/index.d.ts.map +0 -1
  52. package/build/overlay/BottomSheetOverlay/types/index.js +0 -2
  53. package/build/overlay/BottomSheetOverlay/types/index.js.map +0 -1
  54. package/build/overlay/BottomSheetOverlay/ui/BSTextInput/index.d.ts +0 -4
  55. package/build/overlay/BottomSheetOverlay/ui/BSTextInput/index.d.ts.map +0 -1
  56. package/build/overlay/BottomSheetOverlay/ui/BSTextInput/index.js +0 -14
  57. package/build/overlay/BottomSheetOverlay/ui/BSTextInput/index.js.map +0 -1
  58. package/build/overlay/BottomSheetOverlay/ui/ContentsComponent/index.d.ts +0 -22
  59. package/build/overlay/BottomSheetOverlay/ui/ContentsComponent/index.d.ts.map +0 -1
  60. package/build/overlay/BottomSheetOverlay/ui/ContentsComponent/index.js +0 -35
  61. package/build/overlay/BottomSheetOverlay/ui/ContentsComponent/index.js.map +0 -1
package/README.md CHANGED
@@ -14,7 +14,7 @@ ZS-ui는 JavaScript만으로 구현된 Expo용 UI 컴포넌트 라이브러리
14
14
  ### 설치
15
15
 
16
16
  ```bash
17
- npx expo install @react-native-async-storage/async-storage react-native-gesture-handler react-native-reanimated react-native-svg react-native-safe-area-context
17
+ npx expo install @react-native-async-storage/async-storage react-native-reanimated react-native-svg react-native-safe-area-context
18
18
 
19
19
  npx expo install @0610studio/zs-ui
20
20
  ```
package/build/index.d.ts CHANGED
@@ -1,14 +1,13 @@
1
1
  import { useTheme, OverlayProvider, ThemeProvider } from './model';
2
2
  import { ZSView, AnimatedWrapper, TextAtom, ScrollViewAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton } from './ui';
3
3
  import ErrorComponent from './ui/ZSTextField/ui/ErrorComponent';
4
- import { AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, BSTextInput, PopOverButton, PopOverMenu } from './overlay';
5
- export { useTheme, OverlayProvider, ThemeProvider, ZSView, AnimatedWrapper, TextAtom, ScrollViewAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton, ErrorComponent, AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, BSTextInput, PopOverButton, PopOverMenu, };
6
- import { BottomSheetOverlayRef } from "./overlay/BottomSheetOverlay/types";
4
+ import { AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, PopOverButton, PopOverMenu } from './overlay';
5
+ export { useTheme, OverlayProvider, ThemeProvider, ZSView, AnimatedWrapper, TextAtom, ScrollViewAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton, ErrorComponent, AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, PopOverButton, PopOverMenu, };
7
6
  import type { ThemeProviderProps, ThemeProps, Palette } from "./model/useThemeProvider";
8
7
  import { ZSTextProps } from "./ui/ZSText";
9
8
  import { BoxStyle } from "./ui/ZSTextField";
10
9
  import { ColorPalette, ColorPaletteExtend, ThemeTextType, ThemeBorderType, ThemeBackground, MainColors, Theme, TypographyVariants, ThemeFonts, TypoNumber, TypographyVariantsProps, TypoStyle, TypoOptions, TypoSubStyle, TextColorOptions } from "./theme/types";
11
- import { SnackItem, ShowAlertProps, ShowSnackBarProps, ShowBottomSheetProps, PopOverMenuProps, CustomSnackbarProps, OverlayProviderProps, AlertAction, AlertActions, SnackType, HideOption, BottomSheetRef } from "./model/types";
10
+ import { SnackItem, ShowAlertProps, ShowSnackBarProps, ShowBottomSheetProps, PopOverMenuProps, CustomSnackbarProps, OverlayProviderProps, AlertAction, AlertActions, SnackType, HideOption, BottomSheetOptions } from "./model/types";
12
11
  import { RadioOption, ShadowLevel, ShadowStyle } from "./ui/types";
13
- export type { BottomSheetOverlayRef, ThemeProviderProps, ThemeProps, Palette, ZSTextProps, BoxStyle, ColorPalette, ColorPaletteExtend, ThemeTextType, ThemeBorderType, ThemeBackground, MainColors, Theme, TypographyVariants, ThemeFonts, TypoNumber, TypographyVariantsProps, TypoStyle, TypoOptions, TypoSubStyle, TextColorOptions, SnackItem, ShowAlertProps, ShowSnackBarProps, ShowBottomSheetProps, PopOverMenuProps, CustomSnackbarProps, OverlayProviderProps, AlertAction, AlertActions, SnackType, HideOption, BottomSheetRef, RadioOption, ShadowLevel, ShadowStyle };
12
+ export type { ThemeProviderProps, ThemeProps, Palette, ZSTextProps, BoxStyle, ColorPalette, ColorPaletteExtend, ThemeTextType, ThemeBorderType, ThemeBackground, MainColors, Theme, TypographyVariants, ThemeFonts, TypoNumber, TypographyVariantsProps, TypoStyle, TypoOptions, TypoSubStyle, TextColorOptions, SnackItem, ShowAlertProps, ShowSnackBarProps, ShowBottomSheetProps, PopOverMenuProps, CustomSnackbarProps, OverlayProviderProps, AlertAction, AlertActions, SnackType, HideOption, BottomSheetOptions, RadioOption, ShadowLevel, ShadowStyle };
14
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACd,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,MAAM,EACN,eAAe,EACf,QAAQ,EACR,cAAc,EACd,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EACf,MAAM,MAAM,CAAC;AAEd,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAEhE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EAEb,MAAM,EACN,eAAe,EACf,QAAQ,EACR,cAAc,EACd,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EACd,cAAc,EAEd,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,GACZ,CAAC;AAIF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,OAAO,EACR,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,eAAe,EACf,UAAU,EACV,KAAK,EACL,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,UAAU,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,eAAe,EACf,UAAU,EACV,KAAK,EACL,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,cAAc,EACd,WAAW,EACX,WAAW,EACX,WAAW,EACZ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACd,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,MAAM,EACN,eAAe,EACf,QAAQ,EACR,cAAc,EACd,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EACf,MAAM,MAAM,CAAC;AAEd,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAEhE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,WAAW,EACZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EAEb,MAAM,EACN,eAAe,EACf,QAAQ,E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AAU,EACV,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,WAAW,EACZ,CAAC"}
package/build/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { useTheme, OverlayProvider, ThemeProvider, } from './model';
2
2
  import { ZSView, AnimatedWrapper, TextAtom, ScrollViewAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton, } from './ui';
3
3
  import ErrorComponent from './ui/ZSTextField/ui/ErrorComponent';
4
- import { AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, BSTextInput, PopOverButton, PopOverMenu, } from './overlay';
4
+ import { AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, PopOverButton, PopOverMenu, } from './overlay';
5
5
  export { useTheme, OverlayProvider, ThemeProvider,
6
6
  // ---
7
7
  ZSView, AnimatedWrapper, TextAtom, ScrollViewAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton, ErrorComponent,
8
8
  // ---
9
- AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, BSTextInput, PopOverButton, PopOverMenu, };
9
+ AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, PopOverButton, PopOverMenu, };
10
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,GACd,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,MAAM,EACN,eAAe,EACf,QAAQ,EACR,cAAc,EACd,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,GACf,MAAM,MAAM,CAAC;AAEd,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAEhE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,GACZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa;AACb,MAAM;AACN,MAAM,EACN,eAAe,EACf,QAAQ,EACR,cAAc,EACd,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EACd,cAAc;AACd,MAAM;AACN,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,GACZ,CAAC","sourcesContent":["import {\n useTheme,\n OverlayProvider,\n ThemeProvider,\n} from './model'\n\nimport {\n ZSView,\n AnimatedWrapper,\n TextAtom,\n ScrollViewAtom,\n ZSContainer,\n ZSPressable,\n ZSText,\n ThrottleButton,\n ZSTextField,\n ZSRadioGroup,\n ZSBottomButton,\n} from './ui';\n\nimport ErrorComponent from './ui/ZSTextField/ui/ErrorComponent';\n\nimport {\n AlertOverlay,\n BottomSheetOverlay,\n SnackbarNotify,\n useOverlayProvider,\n useOverlay,\n BSTextInput,\n PopOverButton,\n PopOverMenu,\n} from './overlay';\n\nexport {\n useTheme,\n OverlayProvider,\n ThemeProvider,\n // ---\n ZSView,\n AnimatedWrapper,\n TextAtom,\n ScrollViewAtom,\n ZSContainer,\n ZSPressable,\n ZSText,\n ThrottleButton,\n ZSTextField,\n ZSRadioGroup,\n ZSBottomButton,\n ErrorComponent,\n // ---\n AlertOverlay,\n BottomSheetOverlay,\n SnackbarNotify,\n useOverlayProvider,\n useOverlay,\n BSTextInput,\n PopOverButton,\n PopOverMenu,\n};\n\n// ------------------------------------------------------\n\nimport { BottomSheetOverlayRef } from \"./overlay/BottomSheetOverlay/types\";\nimport type {\n ThemeProviderProps,\n ThemeProps,\n Palette,\n} from \"./model/useThemeProvider\";\nimport { ZSTextProps } from \"./ui/ZSText\";\nimport { BoxStyle } from \"./ui/ZSTextField\";\nimport {\n ColorPalette,\n ColorPaletteExtend,\n ThemeTextType,\n ThemeBorderType,\n ThemeBackground,\n MainColors,\n Theme,\n TypographyVariants,\n ThemeFonts,\n TypoNumber,\n TypographyVariantsProps,\n TypoStyle,\n TypoOptions,\n TypoSubStyle,\n TextColorOptions\n} from \"./theme/types\";\nimport {\n SnackItem,\n ShowAlertProps,\n ShowSnackBarProps,\n ShowBottomSheetProps,\n PopOverMenuProps,\n CustomSnackbarProps,\n OverlayProviderProps,\n AlertAction,\n AlertActions,\n SnackType,\n HideOption,\n BottomSheetRef\n} from \"./model/types\";\nimport {\n RadioOption,\n ShadowLevel,\n ShadowStyle,\n} from \"./ui/types\";\n\nexport type {\n BottomSheetOverlayRef,\n ThemeProviderProps,\n ThemeProps,\n Palette,\n ZSTextProps,\n BoxStyle,\n ColorPalette,\n ColorPaletteExtend,\n ThemeTextType,\n ThemeBorderType,\n ThemeBackground,\n MainColors,\n Theme,\n TypographyVariants,\n ThemeFonts,\n TypoNumber,\n TypographyVariantsProps,\n TypoStyle,\n TypoOptions,\n TypoSubStyle,\n TextColorOptions,\n SnackItem,\n ShowAlertProps,\n ShowSnackBarProps,\n ShowBottomSheetProps,\n PopOverMenuProps,\n CustomSnackbarProps,\n OverlayProviderProps,\n AlertAction,\n AlertActions,\n SnackType,\n HideOption,\n BottomSheetRef,\n RadioOption,\n ShadowLevel,\n ShadowStyle\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,GACd,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,MAAM,EACN,eAAe,EACf,QAAQ,EACR,cAAc,EACd,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,GACf,MAAM,MAAM,CAAC;AAEd,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAEhE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,WAAW,GACZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa;AACb,MAAM;AACN,MAAM,EACN,eAAe,EACf,QAAQ,EACR,cAAc,EACd,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EACd,cAAc;AACd,MAAM;AACN,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,WAAW,GACZ,CAAC","sourcesContent":["import {\n useTheme,\n OverlayProvider,\n ThemeProvider,\n} from './model'\n\nimport {\n ZSView,\n AnimatedWrapper,\n TextAtom,\n ScrollViewAtom,\n ZSContainer,\n ZSPressable,\n ZSText,\n ThrottleButton,\n ZSTextField,\n ZSRadioGroup,\n ZSBottomButton,\n} from './ui';\n\nimport ErrorComponent from './ui/ZSTextField/ui/ErrorComponent';\n\nimport {\n AlertOverlay,\n BottomSheetOverlay,\n SnackbarNotify,\n useOverlayProvider,\n useOverlay,\n PopOverButton,\n PopOverMenu,\n} from './overlay';\n\nexport {\n useTheme,\n OverlayProvider,\n ThemeProvider,\n // ---\n ZSView,\n AnimatedWrapper,\n TextAtom,\n ScrollViewAtom,\n ZSContainer,\n ZSPressable,\n ZSText,\n ThrottleButton,\n ZSTextField,\n ZSRadioGroup,\n ZSBottomButton,\n ErrorComponent,\n // ---\n AlertOverlay,\n BottomSheetOverlay,\n SnackbarNotify,\n useOverlayProvider,\n useOverlay,\n PopOverButton,\n PopOverMenu,\n};\n\n// ------------------------------------------------------\n\nimport type {\n ThemeProviderProps,\n ThemeProps,\n Palette,\n} from \"./model/useThemeProvider\";\nimport { ZSTextProps } from \"./ui/ZSText\";\nimport { BoxStyle } from \"./ui/ZSTextField\";\nimport {\n ColorPalette,\n ColorPaletteExtend,\n ThemeTextType,\n ThemeBorderType,\n ThemeBackground,\n MainColors,\n Theme,\n TypographyVariants,\n ThemeFonts,\n TypoNumber,\n TypographyVariantsProps,\n TypoStyle,\n TypoOptions,\n TypoSubStyle,\n TextColorOptions\n} from \"./theme/types\";\nimport {\n SnackItem,\n ShowAlertProps,\n ShowSnackBarProps,\n ShowBottomSheetProps,\n PopOverMenuProps,\n CustomSnackbarProps,\n OverlayProviderProps,\n AlertAction,\n AlertActions,\n SnackType,\n HideOption,\n BottomSheetOptions\n} from \"./model/types\";\nimport {\n RadioOption,\n ShadowLevel,\n ShadowStyle,\n} from \"./ui/types\";\n\nexport type {\n ThemeProviderProps,\n ThemeProps,\n Palette,\n ZSTextProps,\n BoxStyle,\n ColorPalette,\n ColorPaletteExtend,\n ThemeTextType,\n ThemeBorderType,\n ThemeBackground,\n MainColors,\n Theme,\n TypographyVariants,\n ThemeFonts,\n TypoNumber,\n TypographyVariantsProps,\n TypoStyle,\n TypoOptions,\n TypoSubStyle,\n TextColorOptions,\n SnackItem,\n ShowAlertProps,\n ShowSnackBarProps,\n ShowBottomSheetProps,\n PopOverMenuProps,\n CustomSnackbarProps,\n OverlayProviderProps,\n AlertAction,\n AlertActions,\n SnackType,\n HideOption,\n BottomSheetOptions,\n RadioOption,\n ShadowLevel,\n ShadowStyle\n};\n"]}
@@ -28,20 +28,6 @@ export interface PopOverMenuProps {
28
28
  export interface ModalityProps {
29
29
  component: React.ReactNode;
30
30
  }
31
- export interface ShowBottomSheetProps {
32
- backgroundColor?: string;
33
- isBottomRadius?: boolean;
34
- marginHorizontal?: number;
35
- isHandleVisible?: boolean;
36
- marginBottom?: number;
37
- padding?: number;
38
- component: React.ReactNode;
39
- contentsGestureEnable?: boolean;
40
- maxHeight?: number;
41
- isScrollView?: boolean;
42
- showsVerticalScrollIndicator?: boolean;
43
- headerComponent?: React.ReactNode;
44
- }
45
31
  export interface CustomSnackbarProps {
46
32
  snackType: SnackType;
47
33
  snackMessage: string;
@@ -86,7 +72,16 @@ export interface ShowSnackBarProps {
86
72
  index?: number;
87
73
  snackbarDuration?: number;
88
74
  }
89
- export interface BottomSheetRef {
90
- handleVisible: (isOpen: boolean) => void;
75
+ export interface BottomSheetOptions {
76
+ isBackgroundTouchClose?: boolean;
77
+ marginHorizontal?: number;
78
+ marginBottom?: number;
79
+ height?: number;
80
+ padding?: number;
81
+ }
82
+ export interface ShowBottomSheetProps {
83
+ headerComponent?: React.ReactNode;
84
+ component: React.ReactNode;
85
+ options?: BottomSheetOptions;
91
86
  }
92
87
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/model/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,WAAW,YAAY;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAE5C,cAAc,EAAE,SAAS,EAAE,CAAC;IAC5B,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEtC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qBAAqB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAElD,aAAa,EAAE,OAAO,CAAC;IAEvB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAE9C,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAE/C,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3C,YAAY,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjD,eAAe,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IA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Y;IACzB,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,EAAE,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpG,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAMD,MAAM,WAAW,kBAAkB;IAC/B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,WAAW,oBAAoB;IACjC,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAChC"}
@@ -6,6 +6,5 @@
6
6
  ;
7
7
  ;
8
8
  ;
9
- ;
10
9
  export {};
11
10
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/model/types.ts"],"names":[],"mappings":"AAsDC,CAAC;AAKD,CAAC;AAMD,CAAC;AAKD,CAAC;AAcD,CAAC;AAKD,CAAC;AAOD,CAAC;AAWD,CAAC;AAID,CAAC","sourcesContent":["import { ReactNode } from \"react\";\nimport { TextProps, TouchableOpacityProps } from \"react-native\";\n\nexport interface OverlayProps {\n alertVisible: boolean;\n setAlertVisible: (visible: boolean) => void;\n // ---\n snackItemStack: SnackItem[];\n hideSnackBar: (index: number) => void;\n // ---\n bottomSheetVisible: boolean;\n setBottomSheetVisible: (visible: boolean) => void;\n // ---\n loaderVisible: boolean;\n // ---\n modalityVisible: boolean;\n setPopOverVisible: (visible: boolean) => void;\n // ---\n popOverVisible: boolean;\n setModalityVisible: (visible: boolean) => void;\n // ---\n showAlert: (props: ShowAlertProps) => void;\n showSnackBar: (props: ShowSnackBarProps) => void;\n showBottomSheet: (props: ShowBottomSheetProps) => void;\n showLoader: () => void;\n showPopOverMenu: (props: PopOverMenuProps) => void;\n showModality: (props: ModalityProps) => void;\n // ---\n hideOverlay: (option: HideOption) => void;\n}\n\nexport interface PopOverMenuProps {\n px: number;\n py: number;\n component: React.ReactNode;\n}\n\nexport interface ModalityProps {\n component: React.ReactNode;\n}\n\nexport interface ShowBottomSheetProps {\n backgroundColor?: string;\n isBottomRadius?: boolean;\n marginHorizontal?: number;\n isHandleVisible?: boolean;\n marginBottom?: number;\n padding?: number;\n component: React.ReactNode;\n contentsGestureEnable?: boolean;\n maxHeight?: number;\n isScrollView?: boolean;\n showsVerticalScrollIndicator?: boolean;\n headerComponent?: React.ReactNode;\n};\n\nexport interface CustomSnackbarProps {\n snackType: SnackType;\n snackMessage: string;\n};\n\nexport interface OverlayProviderProps {\n children: ReactNode;\n customSnackbar?: (props: CustomSnackbarProps) => React.ReactNode;\n loaderComponent?: () => React.ReactNode;\n};\n\nexport interface AlertAction {\n label: string;\n onPress?: () => void;\n};\n\nexport interface ShowAlertProps {\n title?: string;\n informative?: string;\n actions?: AlertActions;\n isBackgroundTouchClose?: boolean;\n titleStyle?: TextProps['style'];\n informativeStyle?: TextProps['style'];\n secondaryButtonStyle?: TouchableOpacityProps['style'];\n primaryButtonStyle?: TouchableOpacityProps['style'];\n secondaryButtonTextStyle?: TextProps['style'];\n primaryButtonTextStyle?: TextProps['style'];\n singleButtonTextStyle?: TextProps['style'];\n};\n\nexport interface AlertActions {\n primary: AlertAction;\n secondary?: AlertAction;\n};\n\nexport interface SnackItem {\n message: string;\n type: SnackType;\n index: number;\n snackbarDuration?: number;\n};\n\nexport type SnackType = 'success' | 'error' | '';\n\nexport type HideOption = 'all' | 'snack' | 'alert' | 'bottomSheet' | 'loader' | 'popOver' | 'modal';\n\nexport interface ShowSnackBarProps {\n message: string;\n type?: SnackType;\n index?: number;\n snackbarDuration?: number;\n};\n\nexport interface BottomSheetRef {\n handleVisible: (isOpen: boolean) => void;\n};"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/model/types.ts"],"names":[],"mappings":"AA4CC,CAAC;AAMD,CAAC;AAKD,CAAC;AAcD,CAAC;AAKD,CAAC;AAOD,CAAC;AAWD,CAAC;AAmBD,CAAC","sourcesContent":["import { ReactNode } from \"react\";\nimport { TextProps, TouchableOpacityProps } from \"react-native\";\n\nexport interface OverlayProps {\n alertVisible: boolean;\n setAlertVisible: (visible: boolean) => void;\n // ---\n snackItemStack: SnackItem[];\n hideSnackBar: (index: number) => void;\n // ---\n bottomSheetVisible: boolean;\n setBottomSheetVisible: (visible: boolean) => void;\n // ---\n loaderVisible: boolean;\n // ---\n modalityVisible: boolean;\n setPopOverVisible: (visible: boolean) => void;\n // ---\n popOverVisible: boolean;\n setModalityVisible: (visible: boolean) => void;\n // ---\n showAlert: (props: ShowAlertProps) => void;\n showSnackBar: (props: ShowSnackBarProps) => void;\n showBottomSheet: (props: ShowBottomSheetProps) => void;\n showLoader: () => void;\n showPopOverMenu: (props: PopOverMenuProps) => void;\n showModality: (props: ModalityProps) => void;\n // ---\n hideOverlay: (option: HideOption) => void;\n}\n\nexport interface PopOverMenuProps {\n px: number;\n py: number;\n component: React.ReactNode;\n}\n\nexport interface ModalityProps {\n component: React.ReactNode;\n}\n\nexport interface CustomSnackbarProps {\n snackType: SnackType;\n snackMessage: string;\n};\n\nexport interface OverlayProviderProps {\n children: ReactNode;\n customSnackbar?: (props: CustomSnackbarProps) => React.ReactNode;\n loaderComponent?: () => React.ReactNode;\n};\n\nexport interface AlertAction {\n label: string;\n onPress?: () => void;\n};\n\nexport interface ShowAlertProps {\n title?: string;\n informative?: string;\n actions?: AlertActions;\n isBackgroundTouchClose?: boolean;\n titleStyle?: TextProps['style'];\n informativeStyle?: TextProps['style'];\n secondaryButtonStyle?: TouchableOpacityProps['style'];\n primaryButtonStyle?: TouchableOpacityProps['style'];\n secondaryButtonTextStyle?: TextProps['style'];\n primaryButtonTextStyle?: TextProps['style'];\n singleButtonTextStyle?: TextProps['style'];\n};\n\nexport interface AlertActions {\n primary: AlertAction;\n secondary?: AlertAction;\n};\n\nexport interface SnackItem {\n message: string;\n type: SnackType;\n index: number;\n snackbarDuration?: number;\n};\n\nexport type SnackType = 'success' | 'error' | '';\n\nexport type HideOption = 'all' | 'snack' | 'alert' | 'bottomSheet' | 'loader' | 'popOver' | 'modal';\n\nexport interface ShowSnackBarProps {\n message: string;\n type?: SnackType;\n index?: number;\n snackbarDuration?: number;\n};\n\n\n\n\n\nexport interface BottomSheetOptions {\n isBackgroundTouchClose?: boolean;\n marginHorizontal?: number;\n marginBottom?: number;\n height?: number;\n padding?: number;\n}\n\n\nexport interface ShowBottomSheetProps {\n headerComponent?: React.ReactNode;\n component: React.ReactNode;\n options?: BottomSheetOptions;\n};"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useOverlayProvider.d.ts","sourceRoot":"","sources":["../../src/model/useOverlayProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA2D,oBAAoB,EAAwF,MAAM,SAAS,CAAC;AAQ9L,wBAAgB,eAAe,CAAC,EAC5B,cAAc,EACd,eAAe,EACf,QAAQ,EACX,EAAE,oBAAoB,+BAuQtB"}
1
+ {"version":3,"file":"useOverlayProvider.d.ts","sourceRoot":"","sources":["../../src/model/useOverlayProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA+D,oBAAoB,EAAwF,MAAM,SAAS,CAAC;AAQlM,wBAAgB,eAAe,CAAC,EAC9B,cAAc,EACd,eAAe,EACf,QAAQ,EACT,EAAE,oBAAoB,+BAoPtB"}
@@ -1,5 +1,5 @@
1
- import { useCallback, useRef, useState } from 'react';
2
- import { Keyboard } from 'react-native';
1
+ import { useCallback, useEffect, useState } from 'react';
2
+ import { BackHandler, Keyboard } from 'react-native';
3
3
  import OverlayContext from './useOverlay';
4
4
  import AlertOverlay from '../overlay/AlertOverlay';
5
5
  import SnackbarNotify from '../overlay/SnackbarNotify';
@@ -24,20 +24,10 @@ export function OverlayProvider({ customSnackbar, loaderComponent, children }) {
24
24
  // Snackbar
25
25
  const [snackItemStack, setSnackItemStack] = useState([]);
26
26
  // BottomSheet
27
- const [contentsGestureEnable, setContentsGestureEnable] = useState(false);
28
27
  const [bottomSheetVisible, setBottomSheetVisible] = useState(false);
29
- const [bottomSheetBackgroundColor, setBottomSheetBackgroundColor] = useState();
30
- const [bottomSheetComponent, setBottomSheetComponent] = useState(false);
31
- const [bottomSheetPadding, setBottomSheetPadding] = useState(undefined);
32
- const [bottomSheetMarginX, setBottomSheetMarginX] = useState(undefined);
33
- const [bottomSheetMaxHeight, setBottomSheetMaxHeight] = useState();
34
- const [bottomSheetScrollView, setBottomSheetScrollView] = useState(true);
35
- const [isBottomRadius, setIsBottomRadius] = useState(true);
36
- const [handleVisible, setHandleVisible] = useState(true);
37
- const [marginBottomBS, setMarginBottomBs] = useState(undefined);
38
- const [showsVerticalScrollIndicator, setShowsVerticalScrollIndicator] = useState(false);
39
- const [headerComponent, setHeaderComponent] = useState(undefined);
40
- const bottomSheetRef = useRef(null);
28
+ const [bottomSheetComponent, setBottomSheetComponent] = useState(null);
29
+ const [bottomSheetHeader, setBottomSheetHeader] = useState(null);
30
+ const [bottomSheetOptions, setBottomSheetOptions] = useState();
41
31
  // Loading
42
32
  const [loaderVisible, setLoaderVisible] = useState(false);
43
33
  // PopOver
@@ -65,31 +55,24 @@ export function OverlayProvider({ customSnackbar, loaderComponent, children }) {
65
55
  setSingleButtonTextStyle(singleButtonTextStyle);
66
56
  setFontFamily(fontFamily);
67
57
  };
68
- const showBottomSheet = ({ isHandleVisible = true, component, contentsGestureEnable = true, marginHorizontal, padding, marginBottom, backgroundColor, isBottomRadius = true, maxHeight, isScrollView = true, showsVerticalScrollIndicator = false, headerComponent = undefined }) => {
58
+ const showBottomSheet = ({ headerComponent, component, options, }) => {
69
59
  Keyboard.dismiss();
70
- padding && setBottomSheetPadding(padding);
71
- marginBottom && setMarginBottomBs(marginBottom);
72
- marginHorizontal && setBottomSheetMarginX(marginHorizontal);
73
- backgroundColor && setBottomSheetBackgroundColor(backgroundColor);
74
- maxHeight && setBottomSheetMaxHeight(maxHeight);
75
- setShowsVerticalScrollIndicator(showsVerticalScrollIndicator);
76
- setHeaderComponent(headerComponent);
77
- setContentsGestureEnable(contentsGestureEnable);
78
- setHandleVisible(isHandleVisible);
79
- setBottomSheetScrollView(isScrollView);
80
- setIsBottomRadius(isBottomRadius);
81
60
  setBottomSheetComponent(component);
82
- bottomSheetRef.current?.handleVisible(true);
61
+ setBottomSheetHeader(headerComponent);
62
+ setBottomSheetOptions(options);
63
+ setBottomSheetVisible(true);
83
64
  };
84
65
  const showLoader = () => {
85
66
  setLoaderVisible(true);
86
67
  };
87
68
  const showPopOverMenu = ({ px, py, component }) => {
69
+ Keyboard.dismiss();
88
70
  setPopOverLocation({ px, py });
89
71
  setPopOverComponent(component);
90
72
  setPopOverVisible(true);
91
73
  };
92
74
  const showModality = ({ component }) => {
75
+ Keyboard.dismiss();
93
76
  setModalityComponent(component);
94
77
  setModalityVisible(true);
95
78
  };
@@ -120,7 +103,7 @@ export function OverlayProvider({ customSnackbar, loaderComponent, children }) {
120
103
  setSnackItemStack([]);
121
104
  break;
122
105
  case 'bottomSheet':
123
- bottomSheetRef.current?.handleVisible(false);
106
+ setBottomSheetVisible(false);
124
107
  break;
125
108
  case 'loader':
126
109
  setLoaderVisible(false);
@@ -134,13 +117,29 @@ export function OverlayProvider({ customSnackbar, loaderComponent, children }) {
134
117
  setSnackItemStack([]);
135
118
  setLoaderVisible(false);
136
119
  setPopOverVisible(false);
137
- bottomSheetRef.current?.handleVisible(false);
120
+ setBottomSheetVisible(false);
138
121
  break;
139
122
  default:
140
123
  break;
141
124
  }
142
125
  ;
143
126
  }, []);
127
+ // 안드로이드 뒤로가기 버튼 제어
128
+ const backPressHandler = useCallback(() => {
129
+ if (loaderVisible) {
130
+ return true;
131
+ }
132
+ if (alertVisible || modalityVisible || popOverVisible || bottomSheetVisible) {
133
+ hideOverlay('all');
134
+ return true;
135
+ }
136
+ return false;
137
+ }, [alertVisible, loaderVisible, modalityVisible, popOverVisible, hideOverlay]);
138
+ useEffect(() => {
139
+ const backHandler = BackHandler.addEventListener('hardwareBackPress', backPressHandler);
140
+ return () => backHandler.remove();
141
+ }, [backPressHandler]);
142
+ // ------------------------------------------------------------
144
143
  return (<OverlayContext.Provider value={{
145
144
  alertVisible,
146
145
  setAlertVisible,
@@ -168,19 +167,19 @@ export function OverlayProvider({ customSnackbar, loaderComponent, children }) {
168
167
  // ---
169
168
  hideOverlay,
170
169
  }}>
171
- {children}
170
+ {children}
172
171
 
173
- <BottomSheetOverlay ref={bottomSheetRef} bottomSheetComponent={bottomSheetComponent} contentsGestureEnable={contentsGestureEnable} bottomSheetPadding={bottomSheetPadding} marginBottomBS={marginBottomBS} isHandleVisible={handleVisible} bottomSheetMarginX={bottomSheetMarginX} isBottomRadius={isBottomRadius} bottomSheetBackgroundColor={bottomSheetBackgroundColor} maxHeight={bottomSheetMaxHeight} isScrollView={bottomSheetScrollView} showsVerticalScrollIndicator={showsVerticalScrollIndicator} headerComponent={headerComponent}/>
172
+ <BottomSheetOverlay headerComponent={bottomSheetHeader} component={bottomSheetComponent} options={bottomSheetOptions}/>
174
173
 
175
- <PopOverMenu px={popOverLocation?.px} py={popOverLocation?.py} component={popOverComponent}/>
174
+ <PopOverMenu px={popOverLocation?.px} py={popOverLocation?.py} component={popOverComponent}/>
176
175
 
177
- <SnackbarNotify customSnackbar={customSnackbar}/>
176
+ <SnackbarNotify customSnackbar={customSnackbar}/>
178
177
 
179
- <AlertOverlay title={title} informative={informative} actions={actions || {}} isBackgroundTouchClose={isBackgroundTouchClose} titleStyle={titleStyle} informativeStyle={informativeStyle} secondaryButtonStyle={secondaryButtonStyle} primaryButtonStyle={primaryButtonStyle} secondaryButtonTextStyle={secondaryButtonTextStyle} primaryButtonTextStyle={primaryButtonTextStyle} singleButtonTextStyle={singleButtonTextStyle}/>
178
+ <AlertOverlay title={title} informative={informative} actions={actions || {}} isBackgroundTouchClose={isBackgroundTouchClose} titleStyle={titleStyle} informativeStyle={informativeStyle} secondaryButtonStyle={secondaryButtonStyle} primaryButtonStyle={primaryButtonStyle} secondaryButtonTextStyle={secondaryButtonTextStyle} primaryButtonTextStyle={primaryButtonTextStyle} singleButtonTextStyle={singleButtonTextStyle}/>
180
179
 
181
- <Modality modalityComponent={modalityComponent}/>
180
+ <Modality modalityComponent={modalityComponent}/>
182
181
 
183
- <LoadingNotify loaderComponent={loaderComponent}/>
184
- </OverlayContext.Provider>);
182
+ <LoadingNotify loaderComponent={loaderComponent}/>
183
+ </OverlayContext.Provider>);
185
184
  }
186
185
  //# sourceMappingURL=useOverlayProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useOverlayProvider.js","sourceRoot":"","sources":["../../src/model/useOverlayProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAoC,MAAM,cAAc,CAAC;AAC1E,OAAO,cAAc,MAAM,cAAc,CAAC;AAE1C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,cAAc,MAAM,2BAA2B,CAAC;AACvD,OAAO,kB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C,eAAe,CAAC,EAEzC;QAAA,EAAE,cAAc,CAAC,QAAQ,CAAC,CAC7B,CAAC;AACN,CAAC","sourcesContent":["import { useCallback, useRef, useState } from 'react';\nimport { Keyboard, TextProps, TouchableOpacityProps } from 'react-native';\nimport OverlayContext from './useOverlay';\nimport { AlertActions, BottomSheetRef, HideOption, ModalityProps, OverlayProviderProps, PopOverMenuProps, ShowAlertProps, ShowBottomSheetProps, ShowSnackBarProps, SnackItem } from './types';\nimport AlertOverlay from '../overlay/AlertOverlay';\nimport SnackbarNotify from '../overlay/SnackbarNotify';\nimport BottomSheetOverlay from '../overlay/BottomSheetOverlay';\nimport LoadingNotify from '../overlay/LoadingNotify';\nimport PopOverMenu from '../overlay/PopOver/PopOverMenu';\nimport Modality from '../overlay/Modality';\n\nexport function OverlayProvider({\n customSnackbar,\n loaderComponent,\n children\n}: OverlayProviderProps) {\n // Alert\n const [title, setTitle] = useState<string>('');\n const [informative, setInformative] = useState<string>('');\n const [alertVisible, setAlertVisible] = useState<boolean>(false);\n const [actions, setActions] = useState<AlertActions>();\n const [isBackgroundTouchClose, setIsBackgroundTouchClose] = useState<boolean>(true);\n const [titleStyle, setTitleStyle] = useState<TextProps['style']>();\n const [informativeStyle, setInformativeStyle] = useState<TextProps['style']>();\n const [secondaryButtonStyle, setSecondaryButtonStyle] = useState<TouchableOpacityProps['style']>();\n const [primaryButtonStyle, setPrimaryButtonStyle] = useState<TouchableOpacityProps['style']>();\n const [secondaryButtonTextStyle, setSecondaryButtonTextStyle] = useState<TextProps['style']>();\n const [primaryButtonTextStyle, setPrimaryButtonTextStyle] = useState<TextProps['style']>();\n const [singleButtonTextStyle, setSingleButtonTextStyle] = useState<TextProps['style']>();\n\n // Snackbar\n const [snackItemStack, setSnackItemStack] = useState<SnackItem[]>([]);\n\n // BottomSheet\n const [contentsGestureEnable, setContentsGestureEnable] = useState<boolean>(false);\n const [bottomSheetVisible, setBottomSheetVisible] = useState<boolean>(false);\n const [bottomSheetBackgroundColor, setBottomSheetBackgroundColor] = useState<string>();\n const [bottomSheetComponent, setBottomSheetComponent] = useState<React.ReactNode>(false);\n const [bottomSheetPadding, setBottomSheetPadding] = useState<number | undefined>(undefined);\n const [bottomSheetMarginX, setBottomSheetMarginX] = useState<number | undefined>(undefined);\n const [bottomSheetMaxHeight, setBottomSheetMaxHeight] = useState<number>();\n const [bottomSheetScrollView, setBottomSheetScrollView] = useState<boolean>(true);\n const [isBottomRadius, setIsBottomRadius] = useState<boolean>(true);\n const [handleVisible, setHandleVisible] = useState<boolean>(true);\n const [marginBottomBS, setMarginBottomBs] = useState<number | undefined>(undefined);\n const [showsVerticalScrollIndicator, setShowsVerticalScrollIndicator] = useState<boolean>(false);\n const [headerComponent, setHeaderComponent] = useState<React.ReactNode | undefined>(undefined);\n const bottomSheetRef = useRef<BottomSheetRef | null>(null);\n\n // Loading\n const [loaderVisible, setLoaderVisible] = useState<boolean>(false);\n\n // PopOver\n const [popOverVisible, setPopOverVisible] = useState<boolean>(false);\n const [popOverLocation, setPopOverLocation] = useState<{ px: PopOverMenuProps['px'], py: PopOverMenuProps['py'] }>({ px: 0, py: 0 });\n const [popOverComponent, setPopOverComponent] = useState<React.ReactNode>(false);\n\n // Modality\n const [modalityVisible, setModalityVisible] = useState<boolean>(false);\n const [modalityComponent, setModalityComponent] = useState<React.ReactNode>(false);\n\n // ---\n const [fontFamily, setFontFamily] = useState<string | undefined | { title?: string; info?: string; label?: string; }>(undefined);\n\n\n const showAlert = ({\n title,\n informative,\n actions,\n isBackgroundTouchClose = true,\n titleStyle,\n informativeStyle,\n secondaryButtonStyle,\n primaryButtonStyle,\n secondaryButtonTextStyle,\n primaryButtonTextStyle,\n singleButtonTextStyle,\n }: ShowAlertProps) => {\n Keyboard.dismiss();\n setTitle(title || '');\n setInformative(informative || '');\n setActions(actions || {} as AlertActions);\n setIsBackgroundTouchClose(isBackgroundTouchClose);\n setAlertVisible(true);\n\n setTitleStyle(titleStyle);\n setInformativeStyle(informativeStyle);\n setSecondaryButtonStyle(secondaryButtonStyle);\n setPrimaryButtonStyle(primaryButtonStyle);\n setSecondaryButtonTextStyle(secondaryButtonTextStyle);\n setPrimaryButtonTextStyle(primaryButtonTextStyle);\n setSingleButtonTextStyle(singleButtonTextStyle);\n\n setFontFamily(fontFamily);\n };\n\n const showBottomSheet = ({\n isHandleVisible = true,\n component,\n contentsGestureEnable = true,\n marginHorizontal,\n padding,\n marginBottom,\n backgroundColor,\n isBottomRadius = true,\n maxHeight,\n isScrollView = true,\n showsVerticalScrollIndicator = false,\n headerComponent = undefined\n }: ShowBottomSheetProps) => {\n Keyboard.dismiss();\n padding && setBottomSheetPadding(padding);\n marginBottom && setMarginBottomBs(marginBottom);\n marginHorizontal && setBottomSheetMarginX(marginHorizontal);\n backgroundColor && setBottomSheetBackgroundColor(backgroundColor);\n maxHeight && setBottomSheetMaxHeight(maxHeight);\n setShowsVerticalScrollIndicator(showsVerticalScrollIndicator);\n setHeaderComponent(headerComponent);\n setContentsGestureEnable(contentsGestureEnable);\n setHandleVisible(isHandleVisible);\n setBottomSheetScrollView(isScrollView);\n setIsBottomRadius(isBottomRadius);\n setBottomSheetComponent(component);\n bottomSheetRef.current?.handleVisible(true);\n };\n\n const showLoader = () => {\n setLoaderVisible(true);\n };\n\n const showPopOverMenu = ({\n px,\n py,\n component\n }: PopOverMenuProps) => {\n setPopOverLocation({ px, py });\n setPopOverComponent(component);\n setPopOverVisible(true);\n }\n\n const showModality = ({\n component\n }: ModalityProps) => {\n setModalityComponent(component);\n setModalityVisible(true);\n }\n\n const showSnackBar = ({\n message,\n type = 'success',\n index = Date.now(),\n snackbarDuration = 3000\n }: ShowSnackBarProps) => {\n // TODO: 스택 쌓고싶은데 삭제될 때 참조를 잃어서 삭제가 안되는 문제가 있음.\n setSnackItemStack((prev) => {\n if (prev.length === 0) {\n return [...prev, { message, type, index: index, snackbarDuration: snackbarDuration }];\n } else {\n return prev;\n };\n });\n };\n\n const hideSnackBar = (index: number) => {\n setSnackItemStack((prev) => prev.filter((item) => item.index !== index));\n };\n\n const hideOverlay = useCallback((option: HideOption) => {\n switch (option) {\n case 'alert':\n setAlertVisible(false);\n break;\n case 'modal':\n setModalityVisible(false);\n break;\n case 'snack':\n setSnackItemStack([]);\n break;\n case 'bottomSheet':\n bottomSheetRef.current?.handleVisible(false);\n break;\n case 'loader':\n setLoaderVisible(false);\n break;\n case 'popOver':\n setPopOverVisible(false);\n break;\n case 'all':\n setModalityVisible(false);\n setAlertVisible(false);\n setSnackItemStack([]);\n setLoaderVisible(false);\n setPopOverVisible(false);\n bottomSheetRef.current?.handleVisible(false);\n break;\n default:\n break;\n };\n }, []);\n\n\n return (\n <OverlayContext.Provider value={{\n alertVisible,\n setAlertVisible,\n // ---\n snackItemStack,\n hideSnackBar,\n // ---\n bottomSheetVisible,\n setBottomSheetVisible,\n // ---\n loaderVisible,\n // ---\n popOverVisible,\n setPopOverVisible,\n // ---\n modalityVisible,\n setModalityVisible,\n // ---\n showAlert,\n showSnackBar,\n showBottomSheet,\n showLoader,\n showPopOverMenu,\n showModality,\n // ---\n hideOverlay,\n }}>\n {children}\n\n <BottomSheetOverlay\n ref={bottomSheetRef}\n bottomSheetComponent={bottomSheetComponent}\n contentsGestureEnable={contentsGestureEnable}\n bottomSheetPadding={bottomSheetPadding}\n marginBottomBS={marginBottomBS}\n isHandleVisible={handleVisible}\n bottomSheetMarginX={bottomSheetMarginX}\n isBottomRadius={isBottomRadius}\n bottomSheetBackgroundColor={bottomSheetBackgroundColor}\n maxHeight={bottomSheetMaxHeight}\n isScrollView={bottomSheetScrollView}\n showsVerticalScrollIndicator={showsVerticalScrollIndicator}\n headerComponent={headerComponent}\n />\n\n <PopOverMenu\n px={popOverLocation?.px}\n py={popOverLocation?.py}\n component={popOverComponent}\n />\n\n <SnackbarNotify\n customSnackbar={customSnackbar}\n />\n\n <AlertOverlay\n title={title}\n informative={informative}\n actions={actions || {} as AlertActions}\n isBackgroundTouchClose={isBackgroundTouchClose}\n titleStyle={titleStyle}\n informativeStyle={informativeStyle}\n secondaryButtonStyle={secondaryButtonStyle}\n primaryButtonStyle={primaryButtonStyle}\n secondaryButtonTextStyle={secondaryButtonTextStyle}\n primaryButtonTextStyle={primaryButtonTextStyle}\n singleButtonTextStyle={singleButtonTextStyle}\n />\n\n <Modality modalityComponent={modalityComponent} />\n\n <LoadingNotify\n loaderComponent={loaderComponent}\n />\n </OverlayContext.Provider>\n );\n}\n"]}
1
+ {"version":3,"file":"useOverlayProvider.js","sourceRoot":"","sources":["../../src/model/useOverlayProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAoC,MAAM,cAAc,CAAC;AACvF,OAAO,cAAc,MAAM,cAAc,CAAC;AAE1C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,cAAc,MAAM,2BAA2B,CAAC;AACvD,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAE3C,MAAM,UAAU,eAAe,CAAC,EAC9B,cAAc,EACd,eAAe,EACf,QAAQ,EACa;IACrB,QAAQ;IACR,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAC/C,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IACjE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAgB,CAAC;IACvD,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,QAAQ,CAAU,IAAI,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,EAAE,CAAC,CACxB,SAAS,CAAC,CAAC,gBAAgB,CAAC,EAG9B;;MAAA,CAAC,cAAc,CACb,cAAc,CAAC,CAAC,cAAc,CAAC,EAGjC;;MAAA,CAAC,YAAY,CACX,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,IAAI,EAAkB,CAAC,CACvC,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,CAC/C,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CACnC,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,wBAAwB,CAAC,CAAC,wBAAwB,CAAC,CACnD,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,CAC/C,qBAAqB,CAAC,CAAC,qBAAqB,CAAC,EAG/C;;MAAA,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,EAE/C;;MAAA,CAAC,aAAa,CACZ,eAAe,CAAC,CAAC,eAAe,CAAC,EAErC;IAAA,EAAE,cAAc,CAAC,QAAQ,CAAC,CAC3B,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useEffect, useState } from 'react';\nimport { BackHandler, Keyboard, TextProps, TouchableOpacityProps } from 'react-native';\nimport OverlayContext from './useOverlay';\nimport { AlertActions, BottomSheetOptions, HideOption, ModalityProps, OverlayProviderProps, PopOverMenuProps, ShowAlertProps, ShowBottomSheetProps, ShowSnackBarProps, SnackItem } from './types';\nimport AlertOverlay from '../overlay/AlertOverlay';\nimport SnackbarNotify from '../overlay/SnackbarNotify';\nimport BottomSheetOverlay from '../overlay/BottomSheetOverlay';\nimport LoadingNotify from '../overlay/LoadingNotify';\nimport PopOverMenu from '../overlay/PopOver/PopOverMenu';\nimport Modality from '../overlay/Modality';\n\nexport function OverlayProvider({\n customSnackbar,\n loaderComponent,\n children\n}: OverlayProviderProps) {\n // Alert\n const [title, setTitle] = useState<string>('');\n const [informative, setInformative] = useState<string>('');\n const [alertVisible, setAlertVisible] = useState<boolean>(false);\n const [actions, setActions] = useState<AlertActions>();\n const [isBackgroundTouchClose, setIsBackgroundTouchClose] = useState<boolean>(true);\n const [titleStyle, setTitleStyle] = useState<TextProps['style']>();\n const [informativeStyle, setInformativeStyle] = useState<TextProps['style']>();\n const [secondaryButtonStyle, setSecondaryButtonStyle] = useState<TouchableOpacityProps['style']>();\n const [primaryButtonStyle, setPrimaryButtonStyle] = useState<TouchableOpacityProps['style']>();\n const [secondaryButtonTextStyle, setSecondaryButtonTextStyle] = useState<TextProps['style']>();\n const [primaryButtonTextStyle, setPrimaryButtonTextStyle] = useState<TextProps['style']>();\n const [singleButtonTextStyle, setSingleButtonTextStyle] = useState<TextProps['style']>();\n\n // Snackbar\n const [snackItemStack, setSnackItemStack] = useState<SnackItem[]>([]);\n\n // BottomSheet\n const [bottomSheetVisible, setBottomSheetVisible] = useState<boolean>(false);\n const [bottomSheetComponent, setBottomSheetComponent] = useState<React.ReactNode>(null);\n const [bottomSheetHeader, setBottomSheetHeader] = useState<React.ReactNode>(null);\n const [bottomSheetOptions, setBottomSheetOptions] = useState<BottomSheetOptions>();\n\n // Loading\n const [loaderVisible, setLoaderVisible] = useState<boolean>(false);\n\n // PopOver\n const [popOverVisible, setPopOverVisible] = useState<boolean>(false);\n const [popOverLocation, setPopOverLocation] = useState<{ px: PopOverMenuProps['px'], py: PopOverMenuProps['py'] }>({ px: 0, py: 0 });\n const [popOverComponent, setPopOverComponent] = useState<React.ReactNode>(false);\n\n // Modality\n const [modalityVisible, setModalityVisible] = useState<boolean>(false);\n const [modalityComponent, setModalityComponent] = useState<React.ReactNode>(false);\n\n // ---\n const [fontFamily, setFontFamily] = useState<string | undefined | { title?: string; info?: string; label?: string; }>(undefined);\n\n const showAlert = ({\n title,\n informative,\n actions,\n isBackgroundTouchClose = true,\n titleStyle,\n informativeStyle,\n secondaryButtonStyle,\n primaryButtonStyle,\n secondaryButtonTextStyle,\n primaryButtonTextStyle,\n singleButtonTextStyle,\n }: ShowAlertProps) => {\n Keyboard.dismiss();\n setTitle(title || '');\n setInformative(informative || '');\n setActions(actions || {} as AlertActions);\n setIsBackgroundTouchClose(isBackgroundTouchClose);\n setAlertVisible(true);\n\n setTitleStyle(titleStyle);\n setInformativeStyle(informativeStyle);\n setSecondaryButtonStyle(secondaryButtonStyle);\n setPrimaryButtonStyle(primaryButtonStyle);\n setSecondaryButtonTextStyle(secondaryButtonTextStyle);\n setPrimaryButtonTextStyle(primaryButtonTextStyle);\n setSingleButtonTextStyle(singleButtonTextStyle);\n\n setFontFamily(fontFamily);\n };\n\n const showBottomSheet = ({\n headerComponent,\n component,\n options,\n }: ShowBottomSheetProps) => {\n Keyboard.dismiss();\n setBottomSheetComponent(component);\n setBottomSheetHeader(headerComponent);\n setBottomSheetOptions(options);\n setBottomSheetVisible(true);\n };\n\n const showLoader = () => {\n setLoaderVisible(true);\n };\n\n const showPopOverMenu = ({\n px,\n py,\n component\n }: PopOverMenuProps) => {\n Keyboard.dismiss();\n setPopOverLocation({ px, py });\n setPopOverComponent(component);\n setPopOverVisible(true);\n }\n\n const showModality = ({\n component\n }: ModalityProps) => {\n Keyboard.dismiss();\n setModalityComponent(component);\n setModalityVisible(true);\n }\n\n const showSnackBar = ({\n message,\n type = 'success',\n index = Date.now(),\n snackbarDuration = 3000\n }: ShowSnackBarProps) => {\n // TODO: 스택 쌓고싶은데 삭제될 때 참조를 잃어서 삭제가 안되는 문제가 있음.\n setSnackItemStack((prev) => {\n if (prev.length === 0) {\n return [...prev, { message, type, index: index, snackbarDuration: snackbarDuration }];\n } else {\n return prev;\n };\n });\n };\n\n const hideSnackBar = (index: number) => {\n setSnackItemStack((prev) => prev.filter((item) => item.index !== index));\n };\n\n const hideOverlay = useCallback((option: HideOption) => {\n switch (option) {\n case 'alert':\n setAlertVisible(false);\n break;\n case 'modal':\n setModalityVisible(false);\n break;\n case 'snack':\n setSnackItemStack([]);\n break;\n case 'bottomSheet':\n setBottomSheetVisible(false);\n break;\n case 'loader':\n setLoaderVisible(false);\n break;\n case 'popOver':\n setPopOverVisible(false);\n break;\n case 'all':\n setModalityVisible(false);\n setAlertVisible(false);\n setSnackItemStack([]);\n setLoaderVisible(false);\n setPopOverVisible(false);\n setBottomSheetVisible(false);\n break;\n default:\n break;\n };\n }, []);\n\n // 안드로이드 뒤로가기 버튼 제어\n const backPressHandler = useCallback(() => {\n if (loaderVisible) {\n return true;\n }\n if (alertVisible || modalityVisible || popOverVisible || bottomSheetVisible) {\n hideOverlay('all');\n return true;\n }\n return false;\n }, [alertVisible, loaderVisible, modalityVisible, popOverVisible, hideOverlay]);\n\n useEffect(() => {\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backPressHandler);\n return () => backHandler.remove();\n }, [backPressHandler]);\n\n // ------------------------------------------------------------\n\n return (\n <OverlayContext.Provider value={{\n alertVisible,\n setAlertVisible,\n // ---\n snackItemStack,\n hideSnackBar,\n // ---\n bottomSheetVisible,\n setBottomSheetVisible,\n // ---\n loaderVisible,\n // ---\n popOverVisible,\n setPopOverVisible,\n // ---\n modalityVisible,\n setModalityVisible,\n // ---\n showAlert,\n showSnackBar,\n showBottomSheet,\n showLoader,\n showPopOverMenu,\n showModality,\n // ---\n hideOverlay,\n }}>\n {children}\n\n <BottomSheetOverlay\n headerComponent={bottomSheetHeader}\n component={bottomSheetComponent}\n options={bottomSheetOptions}\n />\n\n <PopOverMenu\n px={popOverLocation?.px}\n py={popOverLocation?.py}\n component={popOverComponent}\n />\n\n <SnackbarNotify\n customSnackbar={customSnackbar}\n />\n\n <AlertOverlay\n title={title}\n informative={informative}\n actions={actions || {} as AlertActions}\n isBackgroundTouchClose={isBackgroundTouchClose}\n titleStyle={titleStyle}\n informativeStyle={informativeStyle}\n secondaryButtonStyle={secondaryButtonStyle}\n primaryButtonStyle={primaryButtonStyle}\n secondaryButtonTextStyle={secondaryButtonTextStyle}\n primaryButtonTextStyle={primaryButtonTextStyle}\n singleButtonTextStyle={singleButtonTextStyle}\n />\n\n <Modality modalityComponent={modalityComponent} />\n\n <LoadingNotify\n loaderComponent={loaderComponent}\n />\n </OverlayContext.Provider>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeProvider.d.ts","sourceRoot":"","sources":["../../src/model/useThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAIvF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,OAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,WAAW,kBAAkB;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,UAAU;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,uBAAuB,CAAC;IACpC,SAAS,EAAE,eAAe,CAAC;CAC9B;AAED,MAAM,WAAW,OAAQ,SAAQ,KAAK;IAClC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,wBAAwB,EAAE,OAAO,CAAC;IAClC,uBAAuB,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B;AAID,eAAO,MAAM,QAAQ,kBAMpB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAiEtD,CAAA"}
1
+ {"version":3,"file":"useThemeProvider.d.ts","sourceRoot":"","sources":["../../src/model/useThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAIvF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,OAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,uBAAuB,CAAC;IACpC,SAAS,EAAE,eAAe,CAAC;CAC5B;AAED,MAAM,WAAW,OAAQ,SAAQ,KAAK;IACpC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,wBAAwB,EAAE,OAAO,CAAC;IAClC,uBAAuB,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAID,eAAO,MAAM,QAAQ,kBAMpB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAiEtD,CAAA"}
@@ -37,13 +37,13 @@ export const ThemeProvider = ({ themeFonts, children }) => {
37
37
  }
38
38
  };
39
39
  loadSettings();
40
- }, [systemColorScheme]);
40
+ }, []);
41
41
  // 시스템 다크 모드 변경에 따른 효과 적용
42
42
  useEffect(() => {
43
43
  if (isUsingSystemColorScheme) {
44
44
  setMode(systemColorScheme === 'dark' ? 'dark' : 'light');
45
45
  }
46
- }, [systemColorScheme, isUsingSystemColorScheme]);
46
+ }, [isUsingSystemColorScheme]);
47
47
  // 테마 토글 함수
48
48
  const toggleTheme = async () => {
49
49
  setUseSystemColorScheme(false); // 사용자 지정 모드로 전환
@@ -69,7 +69,7 @@ export const ThemeProvider = ({ themeFonts, children }) => {
69
69
  elevation: elevation(palette({ mode }))
70
70
  }), [mode, isUsingSystemColorScheme, typography, themeFonts]);
71
71
  return (<ThemeContext.Provider value={themeValue}>
72
- {children}
73
- </ThemeContext.Provider>);
72
+ {children}
73
+ </ThemeContext.Provider>);
74
74
  };
75
75
  //# sourceMappingURL=useThem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AAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa;YACzD,OAAO,OAAO,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,qBAAqB;IACrB,MAAM,6BAA6B,GAAG,KAAK,EAAE,SAAkB,EAAE,EAAE;QAC/D,uBAAuB,CAAC,SAAS,CAAC,CAAC;QACnC,MAAM,YAAY,CAAC,OAAO,CAAC,sBAAsB,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC7E,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC9B,OAAO,EAAE;YACL,wBAAwB;YACxB,uBAAuB,EAAE,6BAA6B;YACtD,WAAW;YACX,GAAG,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,oBAAoB;SAC7C;QACD,UAAU,EAAE,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;QACtC,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;KAC1C,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;IAE9D,OAAO,CACH,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CACrC;YAAA,CAAC,QAAQ,CACb;QAAA,EAAE,YAAY,CAAC,QAAQ,CAAC,CAC3B,CAAC;AACN,CAAC,CAAA","sourcesContent":["import React, { createContext, useContext, useMemo, useState, useEffect } from 'react';\nimport { useColorScheme } from 'react-native';\nimport AsyncStorage from '@react-native-async-storage/async-storage';\nimport palette from '../theme/palette';\nimport { Theme, ThemeFonts, TypographyVariantsProps } from '../theme/types';\nimport typography from '../theme/typography';\nimport elevation, { ElevationStyles } from '../theme/elevation';\n\nexport interface ThemeProviderProps {\n themeFonts?: ThemeFonts;\n children: React.ReactNode;\n}\n\nexport interface ThemeProps {\n palette: Palette;\n typography: TypographyVariantsProps;\n elevation: ElevationStyles;\n}\n\nexport interface Palette extends Theme {\n mode: 'light' | 'dark';\n isUsingSystemColorScheme: boolean;\n setUseSystemColorScheme: (useSystem: boolean) => void;\n toggleTheme: () => void;\n}\n\nconst ThemeContext = createContext<ThemeProps | null>(null);\n\nexport const useTheme = () => {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context;\n}\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({ themeFonts, children }) => {\n const systemColorScheme = useColorScheme(); // 시스템 다크 모드 감지\n const [isUsingSystemColorScheme, setUseSystemColorScheme] = useState(true);\n const [mode, setMode] = useState<'light' | 'dark'>(systemColorScheme === 'dark' ? 'dark' : 'light');\n\n // AsyncStorage에서 시스템 모드 사용 설정 값 로드\n useEffect(() => {\n const loadSettings = async () => {\n try {\n const storedUseSystemColorScheme = await AsyncStorage.getItem('useSystemColorScheme');\n if (storedUseSystemColorScheme !== null) {\n setUseSystemColorScheme(storedUseSystemColorScheme === 'true');\n }\n const storedMode = await AsyncStorage.getItem('themeMode');\n if (storedMode) {\n setMode(storedMode === 'dark' ? 'dark' : 'light');\n } else {\n setMode(systemColorScheme === 'dark' ? 'dark' : 'light');\n }\n } catch (error) {\n console.error('Failed to load theme settings', error);\n }\n };\n loadSettings();\n }, [systemColorScheme]);\n\n // 시스템 다크 모드 변경에 따른 효과 적용\n useEffect(() => {\n if (isUsingSystemColorScheme) {\n setMode(systemColorScheme === 'dark' ? 'dark' : 'light');\n }\n }, [systemColorScheme, isUsingSystemColorScheme]);\n\n // 테마 토글 함수\n const toggleTheme = async () => {\n setUseSystemColorScheme(false); // 사용자 지정 모드로 전환\n setMode((prevMode) => {\n const newMode = prevMode === 'light' ? 'dark' : 'light';\n AsyncStorage.setItem('themeMode', newMode); // 로컬스토리지에 저장\n return newMode;\n });\n };\n\n // 시스템 모드 사용 설정 변경 함수\n const handleSetUseSystemColorScheme = async (useSystem: boolean) => {\n setUseSystemColorScheme(useSystem);\n await AsyncStorage.setItem('useSystemColorScheme', useSystem.toString());\n };\n\n const themeValue = useMemo(() => ({\n palette: {\n isUsingSystemColorScheme,\n setUseSystemColorScheme: handleSetUseSystemColorScheme,\n toggleTheme,\n ...palette({ mode }), // 선택된 모드에 따른 팔레트 적용\n },\n typography: typography({ themeFonts }),\n elevation: elevation(palette({ mode }))\n }), [mode, isUsingSystemColorScheme, typography, themeFonts]);\n\n return (\n <ThemeContext.Provider value={themeValue}>\n {children}\n </ThemeContext.Provider>\n );\n}\n"]}
1
+ {"version":3,"file":"useThemeProvider.js","sourceRoot":"","sources":["../../src/model/useThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,YAAY,MAAM,2CAA2C,CAAC;AACrE,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,SAA8B,MAAM,oBAAoB,CAAC;AAoBhE,MAAM,YAAY,GAAG,aAAa,CAAoB,IAAI,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtF,MAAM,iBAAiB,GAAG,cAAc,EAAE,CAAC,CAAC,eAAe;IAC3D,MAAM,CAAC,wBAAwB,EAAE,uBAAuB,C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, useContext, useMemo, useState, useEffect } from 'react';\nimport { useColorScheme } from 'react-native';\nimport AsyncStorage from '@react-native-async-storage/async-storage';\nimport palette from '../theme/palette';\nimport { Theme, ThemeFonts, TypographyVariantsProps } from '../theme/types';\nimport typography from '../theme/typography';\nimport elevation, { ElevationStyles } from '../theme/elevation';\n\nexport interface ThemeProviderProps {\n themeFonts?: ThemeFonts;\n children: React.ReactNode;\n}\n\nexport interface ThemeProps {\n palette: Palette;\n typography: TypographyVariantsProps;\n elevation: ElevationStyles;\n}\n\nexport interface Palette extends Theme {\n mode: 'light' | 'dark';\n isUsingSystemColorScheme: boolean;\n setUseSystemColorScheme: (useSystem: boolean) => void;\n toggleTheme: () => void;\n}\n\nconst ThemeContext = createContext<ThemeProps | null>(null);\n\nexport const useTheme = () => {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context;\n}\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({ themeFonts, children }) => {\n const systemColorScheme = useColorScheme(); // 시스템 다크 모드 감지\n const [isUsingSystemColorScheme, setUseSystemColorScheme] = useState(true);\n const [mode, setMode] = useState<'light' | 'dark'>(systemColorScheme === 'dark' ? 'dark' : 'light');\n\n // AsyncStorage에서 시스템 모드 사용 설정 값 로드\n useEffect(() => {\n const loadSettings = async () => {\n try {\n const storedUseSystemColorScheme = await AsyncStorage.getItem('useSystemColorScheme');\n if (storedUseSystemColorScheme !== null) {\n setUseSystemColorScheme(storedUseSystemColorScheme === 'true');\n }\n const storedMode = await AsyncStorage.getItem('themeMode');\n if (storedMode) {\n setMode(storedMode === 'dark' ? 'dark' : 'light');\n } else {\n setMode(systemColorScheme === 'dark' ? 'dark' : 'light');\n }\n } catch (error) {\n console.error('Failed to load theme settings', error);\n }\n };\n loadSettings();\n }, []);\n\n // 시스템 다크 모드 변경에 따른 효과 적용\n useEffect(() => {\n if (isUsingSystemColorScheme) {\n setMode(systemColorScheme === 'dark' ? 'dark' : 'light');\n }\n }, [isUsingSystemColorScheme]);\n\n // 테마 토글 함수\n const toggleTheme = async () => {\n setUseSystemColorScheme(false); // 사용자 지정 모드로 전환\n setMode((prevMode) => {\n const newMode = prevMode === 'light' ? 'dark' : 'light';\n AsyncStorage.setItem('themeMode', newMode); // 로컬스토리지에 저장\n return newMode;\n });\n };\n\n // 시스템 모드 사용 설정 변경 함수\n const handleSetUseSystemColorScheme = async (useSystem: boolean) => {\n setUseSystemColorScheme(useSystem);\n await AsyncStorage.setItem('useSystemColorScheme', useSystem.toString());\n };\n\n const themeValue = useMemo(() => ({\n palette: {\n isUsingSystemColorScheme,\n setUseSystemColorScheme: handleSetUseSystemColorScheme,\n toggleTheme,\n ...palette({ mode }), // 선택된 모드에 따른 팔레트 적용\n },\n typography: typography({ themeFonts }),\n elevation: elevation(palette({ mode }))\n }), [mode, isUsingSystemColorScheme, typography, themeFonts]);\n\n return (\n <ThemeContext.Provider value={themeValue}>\n {children}\n </ThemeContext.Provider>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/overlay/AlertOverlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAgB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAUjE,iBAAS,YAAY,CAAC,EACpB,OAAO,EACP,KAAK,EACL,WAAW,EACX,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,GACtB,EAAE,cAAc,4BAmGhB;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/overlay/AlertOverlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAgB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAUjE,iBAAS,YAAY,CAAC,EACpB,OAAO,EACP,KAAK,EACL,WAAW,EACX,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,GACtB,EAAE,cAAc,4BA2EhB;AAED,eAAe,YAAY,CAAC"}
@@ -1,5 +1,5 @@
1
- import React, { useCallback, useEffect, useMemo } from 'react';
2
- import { Dimensions, KeyboardAvoidingView, Platform, Pressable, StyleSheet, TouchableOpacity, BackHandler } from 'react-native';
1
+ import React, { useCallback, useMemo } from 'react';
2
+ import { Dimensions, StyleSheet, TouchableOpacity } from 'react-native';
3
3
  import Animated, { FadeInDown, FadeOutDown } from 'react-native-reanimated';
4
4
  import { useOverlay } from '../../model/useOverlay';
5
5
  import { useTheme } from '../../model/useThemeProvider';
@@ -11,58 +11,39 @@ function AlertOverlay({ actions, title, informative, isBackgroundTouchClose, tit
11
11
  const { alertVisible, setAlertVisible } = useOverlay();
12
12
  const { palette: { background, text, primary: primaryColor } } = useTheme();
13
13
  const styles = useMemo(() => createStyles({ background }), [background, text, primaryColor]);
14
- // 버튼 클릭 핸들러 함수, 콜백 메모이제이션으로 성능 최적화
15
14
  const handleButtonPress = useCallback((onPressFunction) => () => {
16
15
  if (onPressFunction) {
17
16
  onPressFunction();
18
17
  }
19
18
  setAlertVisible(false);
20
19
  }, [setAlertVisible]);
21
- // 뒤로가기 버튼 핸들러 함수
22
- const backPressHandler = useCallback(() => {
23
- if (alertVisible) {
24
- setAlertVisible(false);
25
- return true;
26
- }
27
- return false;
28
- }, [alertVisible, setAlertVisible]);
29
- // 뒤로가기 버튼 리스너 설정
30
- useEffect(() => {
31
- const backHandler = BackHandler.addEventListener('hardwareBackPress', backPressHandler);
32
- return () => backHandler.remove();
33
- }, [backPressHandler]);
34
- // content를 useMemo로 감싸서 불필요한 재렌더링 방지
35
20
  const content = useMemo(() => {
36
21
  const { primary, secondary } = actions || {};
37
- return (<Animated.View entering={FadeInDown.duration(300)} exiting={FadeOutDown.duration(100)}>
38
- <Pressable style={[styles.contentContainer, { width: modalWidth }]}>
39
- {title && (<ZSText typo='subTitle.1' style={[styles.title, titleStyle]}>{title}</ZSText>)}
40
- {informative && (<ZSText typo='body.2' style={[styles.informative, informativeStyle]}>{informative}</ZSText>)}
41
- {actions && (<ViewAtom style={styles.buttonContainer}>
42
- {secondary ? (<>
43
- <TouchableOpacity style={[
22
+ return (<Animated.View entering={FadeInDown.duration(300)} exiting={FadeOutDown.duration(100)} style={[styles.contentContainer, { width: modalWidth }]}>
23
+ {title && (<ZSText typo='subTitle.1' style={[styles.title, titleStyle]}>{title}</ZSText>)}
24
+ {informative && (<ZSText typo='body.2' style={[styles.informative, informativeStyle]}>{informative}</ZSText>)}
25
+ {actions && (<ViewAtom style={styles.buttonContainer}>
26
+ {secondary ? (<>
27
+ <TouchableOpacity style={[
44
28
  styles.button,
45
29
  { backgroundColor: background.neutral, marginRight: 8 },
46
30
  secondaryButtonStyle
47
31
  ]} onPress={handleButtonPress(secondary?.onPress)}>
48
- <ZSText typo='label.2' style={[secondaryButtonTextStyle]}>{secondary.label}</ZSText>
49
- </TouchableOpacity>
32
+ <ZSText typo='label.2' style={[secondaryButtonTextStyle]}>{secondary.label}</ZSText>
33
+ </TouchableOpacity>
50
34
 
51
- <TouchableOpacity style={[styles.button, { backgroundColor: primaryColor.main }, primaryButtonStyle]} onPress={handleButtonPress(primary?.onPress)}>
52
- <ZSText typo='label.2' color='white' style={[secondaryButtonTextStyle]}>{primary?.label || '확인'}</ZSText>
53
- </TouchableOpacity>
54
- </>) : (<TouchableOpacity style={[styles.button, { backgroundColor: primaryColor.main }, primaryButtonStyle]} onPress={handleButtonPress(primary?.onPress)}>
35
+ <TouchableOpacity style={[styles.button, { backgroundColor: primaryColor.main }, primaryButtonStyle]} onPress={handleButtonPress(primary?.onPress)}>
55
36
  <ZSText typo='label.2' color='white' style={[secondaryButtonTextStyle]}>{primary?.label || '확인'}</ZSText>
56
- </TouchableOpacity>)}
57
- </ViewAtom>)}
58
- </Pressable>
37
+ </TouchableOpacity>
38
+ </>) : (<TouchableOpacity style={[styles.button, { backgroundColor: primaryColor.main }, primaryButtonStyle]} onPress={handleButtonPress(primary?.onPress)}>
39
+ <ZSText typo='label.2' color='white' style={[secondaryButtonTextStyle]}>{primary?.label || '확인'}</ZSText>
40
+ </TouchableOpacity>)}
41
+ </ViewAtom>)}
59
42
  </Animated.View>);
60
43
  }, [title, informative, actions, handleButtonPress, titleStyle, informativeStyle, secondaryButtonStyle, primaryButtonStyle, secondaryButtonTextStyle, primaryButtonTextStyle, singleButtonTextStyle]);
61
44
  return alertVisible ? (<ModalBackground onPress={() => { if (isBackgroundTouchClose)
62
45
  setAlertVisible(false); }}>
63
- <KeyboardAvoidingView style={styles.avoidingView} behavior={Platform.OS === 'ios' ? 'padding' : undefined} enabled>
64
- {content}
65
- </KeyboardAvoidingView>
46
+ {content}
66
47
  </ModalBackground>) : null;
67
48
  }
68
49
  export default AlertOverlay;
@@ -101,7 +82,9 @@ const createStyles = ({ background, }) => StyleSheet.create({
101
82
  borderRadius: 22,
102
83
  paddingBottom: 18,
103
84
  paddingTop: 24,
104
- paddingHorizontal: 20
85
+ paddingHorizontal: 20,
86
+ position: 'absolute',
87
+ top: '35%',
105
88
  },
106
89
  });
107
90
  //# sourceMappingURL=index.js.map