@0610studio/zs-ui 0.5.3 → 0.6.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.
package/build/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { useTheme, OverlayProvider, ThemeProvider } from './model';
2
- import { ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton } from './ui';
2
+ import { ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup } from './ui';
3
3
  import ErrorComponent from './ui/ZSTextField/ui/ErrorComponent';
4
4
  import { AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, PopOverButton, PopOverMenu } from './overlay';
5
- export { useTheme, OverlayProvider, ThemeProvider, ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton, ErrorComponent, AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, PopOverButton, PopOverMenu, };
5
+ export { useTheme, OverlayProvider, ThemeProvider, ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ErrorComponent, AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, PopOverButton, PopOverMenu, };
6
6
  import type { ThemeProviderProps, ThemeProps, Palette } from "./model/useThemeProvider";
7
7
  import { ZSTextProps } from "./ui/ZSText";
8
8
  import { BoxStyle } from "./ui/ZSTextField";
@@ -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,WA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Y,EACV,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,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,WAAW,EACX,cAAc,EACf,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,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACb,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,EACR,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EAEd,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,WAAW,GACZ,CAAC;AAIF,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,kBAAkB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,YAAY,EACV,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,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,WAAW,EACX,cAAc,EACf,CAAC"}
package/build/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { useTheme, OverlayProvider, ThemeProvider, } from './model';
2
- import { ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton, } from './ui';
2
+ import { ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, } from './ui';
3
3
  import ErrorComponent from './ui/ZSTextField/ui/ErrorComponent';
4
4
  import { AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, PopOverButton, PopOverMenu, } from './overlay';
5
5
  export { useTheme, OverlayProvider, ThemeProvider,
6
6
  // ---
7
- ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton, ErrorComponent,
7
+ ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ErrorComponent,
8
8
  // ---
9
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,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,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 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 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 TypoColorOptions\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\";\nimport { ZSContainerRef } from \"./ui/ZSContainer\";\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 TypoColorOptions,\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 ZSContainerRef\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,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,GACb,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,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,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 ZSContainer,\n ZSPressable,\n ZSText,\n ThrottleButton,\n ZSTextField,\n ZSRadioGroup,\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 ZSContainer,\n ZSPressable,\n ZSText,\n ThrottleButton,\n ZSTextField,\n ZSRadioGroup,\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 TypoColorOptions\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\";\nimport { ZSContainerRef } from \"./ui/ZSContainer\";\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 TypoColorOptions,\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 ZSContainerRef\n};\n"]}
@@ -10,6 +10,7 @@ export declare const Z_INDEX_VALUE: {
10
10
  BOTTOM_SHEET2: number;
11
11
  POPOVER: number;
12
12
  ALERT: number;
13
+ BOTTOM_CTA: number;
13
14
  ABOVE_KEYBOARD: number;
14
15
  SNACKBAR: number;
15
16
  LOADING: number;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/model/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,YAAY,GACrB,OAAO,SAAS,CAAC,SAAS,CAAC,EAC3B,WAAW,MAAM,SAAS,KAC3B,SAAS,CAAC,MAAM,SAAS,CAAC,GAAG,SAQ/B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;CAazB,CAAC;AAEF,eAAO,MAAM,iBAAiB,MAAM,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/model/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,YAAY,GACrB,OAAO,SAAS,CAAC,SAAS,CAAC,EAC3B,WAAW,MAAM,SAAS,KAC3B,SAAS,CAAC,MAAM,SAAS,CAAC,GAAG,SAQ/B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;CAczB,CAAC;AAEF,eAAO,MAAM,iBAAiB,MAAM,CAAC"}
@@ -18,8 +18,9 @@ export const Z_INDEX_VALUE = {
18
18
  BOTTOM_SHEET2: 8102,
19
19
  POPOVER: 8200,
20
20
  ALERT: 8300,
21
- ABOVE_KEYBOARD: 8400,
22
- SNACKBAR: 8500,
21
+ BOTTOM_CTA: 8400,
22
+ ABOVE_KEYBOARD: 8500,
23
+ SNACKBAR: 8600,
23
24
  LOADING: 8999,
24
25
  };
25
26
  export const MAX_OVERLAY_WIDTH = 500;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/model/utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG,CACxB,KAA2B,EAC3B,SAA0B,EACY,EAAE;IACxC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,SAAS,IAAI,IAAI,CAAC,CAAC;QACtG,OAAO,UAAU,EAAE,CAAC,SAAoC,CAAC,CAAC;IAC9D,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;QAC3E,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,cAAc,EAAE,IAAI;IACpB,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC","sourcesContent":["import { StyleProp, TextStyle } from \"react-native\";\n\nexport const extractStyle = (\n style: StyleProp<TextStyle>,\n attribute: keyof TextStyle\n): TextStyle[keyof TextStyle] | undefined => {\n if (Array.isArray(style)) {\n const foundStyle = style.find(item => typeof item === 'object' && item !== null && attribute in item);\n return foundStyle?.[attribute as keyof typeof foundStyle];\n } else if (typeof style === 'object' && style !== null && attribute in style) {\n return style[attribute];\n }\n return undefined;\n};\n\nexport const Z_INDEX_VALUE = {\n DEFAULT: 8000,\n MODAL1: 8001,\n MODAL2: 8002,\n MODAL3: 8003,\n MODAL4: 8004,\n BOTTOM_SHEET1: 8101,\n BOTTOM_SHEET2: 8102,\n POPOVER: 8200,\n ALERT: 8300,\n ABOVE_KEYBOARD: 8400,\n SNACKBAR: 8500,\n LOADING: 8999,\n};\n\nexport const MAX_OVERLAY_WIDTH = 500;"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/model/utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG,CACxB,KAA2B,EAC3B,SAA0B,EACY,EAAE;IACxC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,SAAS,IAAI,IAAI,CAAC,CAAC;QACtG,OAAO,UAAU,EAAE,CAAC,SAAoC,CAAC,CAAC;IAC9D,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;QAC3E,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,IAAI;IACpB,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC","sourcesContent":["import { StyleProp, TextStyle } from \"react-native\";\n\nexport const extractStyle = (\n style: StyleProp<TextStyle>,\n attribute: keyof TextStyle\n): TextStyle[keyof TextStyle] | undefined => {\n if (Array.isArray(style)) {\n const foundStyle = style.find(item => typeof item === 'object' && item !== null && attribute in item);\n return foundStyle?.[attribute as keyof typeof foundStyle];\n } else if (typeof style === 'object' && style !== null && attribute in style) {\n return style[attribute];\n }\n return undefined;\n};\n\nexport const Z_INDEX_VALUE = {\n DEFAULT: 8000,\n MODAL1: 8001,\n MODAL2: 8002,\n MODAL3: 8003,\n MODAL4: 8004,\n BOTTOM_SHEET1: 8101,\n BOTTOM_SHEET2: 8102,\n POPOVER: 8200,\n ALERT: 8300,\n BOTTOM_CTA: 8400,\n ABOVE_KEYBOARD: 8500,\n SNACKBAR: 8600,\n LOADING: 8999,\n};\n\nexport const MAX_OVERLAY_WIDTH = 500;"]}
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ render: () => React.ReactNode;
3
+ offset?: number;
4
+ }
5
+ declare function ZSBottomCta({ render, offset, }: Props): import("react").JSX.Element;
6
+ export default ZSBottomCta;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSBottomCta/index.tsx"],"names":[],"mappings":"AAKA,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,iBAAS,WAAW,CAAC,EACnB,MAAM,EACN,MAAU,GACX,EAAE,KAAK,+BA2BP;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { useEffect, useState } from "react";
2
+ import { Keyboard, Platform, StyleSheet } from "react-native";
3
+ import Animated, { FadeInDown, FadeOutDown } from "react-native-reanimated";
4
+ import { Z_INDEX_VALUE } from "../../model/utils";
5
+ function ZSBottomCta({ render, offset = 0, }) {
6
+ const [bottomValue, setBottomValue] = useState(0);
7
+ const [isKeyboardVisible, setIsKeyboardVisible] = useState(false);
8
+ useEffect(() => {
9
+ const showEvent = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';
10
+ const hideEvent = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';
11
+ const keyboardShowSubscription = Keyboard.addListener(showEvent, (event) => {
12
+ setBottomValue(Platform.OS === 'ios' ? event.endCoordinates.height : 0);
13
+ setIsKeyboardVisible(true);
14
+ });
15
+ const keyboardHideSubscription = Keyboard.addListener(hideEvent, () => {
16
+ });
17
+ return () => {
18
+ keyboardShowSubscription.remove();
19
+ keyboardHideSubscription.remove();
20
+ };
21
+ }, []);
22
+ return (<Animated.View entering={FadeInDown} exiting={FadeOutDown} style={[styles.container, { bottom: bottomValue + (isKeyboardVisible ? offset : 0) }]}>
23
+ {render()}
24
+ </Animated.View>);
25
+ }
26
+ export default ZSBottomCta;
27
+ const styles = StyleSheet.create({
28
+ container: {
29
+ position: 'absolute',
30
+ justifyContent: 'center',
31
+ alignItems: 'center',
32
+ zIndex: Z_INDEX_VALUE.BOTTOM_CTA,
33
+ width: '100%',
34
+ },
35
+ });
36
+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ACtE,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,wBAAwB,CAAC,MAAM,EAAE,CAAC;YAClC,wBAAwB,CAAC,MAAM,EAAE,CAAC;QACpC,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,WAAW,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAC/I;MAAA,CAAC,MAAM,EAAE,CACX;IAAA,EAAE,QAAQ,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC;AAE3B,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,QAAQ,EAAE,UAAU;QACpB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,aAAa,CAAC,UAAU;QAChC,KAAK,EAAE,MAAM;KACd;CACF,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Keyboard, Platform, StyleSheet } from \"react-native\";\nimport Animated, { FadeInDown, FadeOutDown } from \"react-native-reanimated\";\nimport { Z_INDEX_VALUE } from \"../../model/utils\";\n\ninterface Props {\n render: () => React.ReactNode;\n offset?: number;\n}\n\nfunction ZSBottomCta({\n render,\n offset = 0,\n}: Props) {\n const [bottomValue, setBottomValue] = useState(0);\n const [isKeyboardVisible, setIsKeyboardVisible] = useState(false);\n\n useEffect(() => {\n const showEvent = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';\n const hideEvent = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';\n\n const keyboardShowSubscription = Keyboard.addListener(showEvent, (event) => {\n setBottomValue(Platform.OS === 'ios' ? event.endCoordinates.height : 0)\n setIsKeyboardVisible(true);\n });\n\n const keyboardHideSubscription = Keyboard.addListener(hideEvent, () => {\n });\n\n return () => {\n keyboardShowSubscription.remove();\n keyboardHideSubscription.remove();\n };\n }, []);\n\n return (\n <Animated.View entering={FadeInDown} exiting={FadeOutDown} style={[styles.container, { bottom: bottomValue + (isKeyboardVisible ? offset : 0) }]}>\n {render()}\n </Animated.View>\n );\n}\n\nexport default ZSBottomCta;\n\nconst styles = StyleSheet.create({\n container: {\n position: 'absolute',\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: Z_INDEX_VALUE.BOTTOM_CTA,\n width: '100%',\n },\n});"]}
@@ -3,7 +3,7 @@ import { ScrollView, View } from 'react-native';
3
3
  export default function VariantView({ children, scrollViewDisabled, style, scrollViewRef, variantWidth, showsVerticalScrollIndicator, automaticallyAdjustKeyboardInsets, handleScroll, handleTouch, scrollEventThrottle, keyboardHeight }) {
4
4
  return (scrollViewDisabled ? (<View style={[style, { width: variantWidth }]}>
5
5
  {children}
6
- </View>) : (<ScrollView ref={scrollViewRef} style={{ width: variantWidth, paddingBottom: keyboardHeight || 0 }} contentContainerStyle={styles.scrollContainerStyle} bounces={false} overScrollMode="never" showsVerticalScrollIndicator={showsVerticalScrollIndicator} keyboardShouldPersistTaps="handled" automaticallyAdjustKeyboardInsets={automaticallyAdjustKeyboardInsets} onScroll={handleScroll} onTouchStart={handleTouch} scrollEventThrottle={scrollEventThrottle}>
6
+ </View>) : (<ScrollView ref={scrollViewRef} style={{ width: variantWidth }} contentContainerStyle={[styles.scrollContainerStyle, { paddingBottom: keyboardHeight || 0 }]} bounces={false} overScrollMode="never" showsVerticalScrollIndicator={showsVerticalScrollIndicator} keyboardShouldPersistTaps="handled" automaticallyAdjustKeyboardInsets={automaticallyAdjustKeyboardInsets} onScroll={handleScroll} onTouchStart={handleTouch} scrollEventThrottle={scrollEventThrottle}>
7
7
  <View style={[styles.splitView, style, { width: '100%' }]}>
8
8
  {children}
9
9
  </View>
@@ -1 +1 @@
1
- {"version":3,"file":"VariantView.js","sourceRoot":"","sources":["../../../../src/ui/ZSContainer/ui/VariantView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,UAAU,EAA2C,IAAI,EAAwC,MAAM,cAAc,CAAC;AAgB/H,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,4BAA4B,EAAE,iCAAiC,EAAE,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,cAAc,EAAoB;IACzP,OAAO,CACL,kBAAkB,CAAC,CAAC,CAAC,CACnB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC,CAC5C;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,CAAC,UAAU,CACT,GAAG,CAAC,CAAC,aAAa,CAAC,CACnB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,IAAI,CAAC,EAAE,CAAC,CACnE,qBAAqB,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CACnD,OAAO,CAAC,CAAC,KAAK,CAAC,CACf,cAAc,CAAC,OAAO,CACtB,4BAA4B,CAAC,CAAC,4BAA4B,CAAC,CAC3D,yBAAyB,CAAC,SAAS,CACnC,iCAAiC,CAAC,CAAC,iCAAiC,CAAC,CACrE,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,YAAY,CAAC,CAAC,WAAW,CAAC,CAC1B,mBAAmB,CAAC,CAAC,mBAAmB,CAAC,CAEzC;QAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CACxD;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,UAAU,CAAC,CACd,CACF,CAAA;AACH,CAAC","sourcesContent":["import { styles } from '..';\nimport { ScrollView, NativeSyntheticEvent, NativeScrollEvent, View, DimensionValue, StyleProp, ViewStyle } from 'react-native';\n\ninterface VariantViewProps {\n children: React.ReactNode;\n scrollViewDisabled?: boolean;\n style: StyleProp<ViewStyle>;\n scrollViewRef?: React.RefObject<ScrollView>;\n variantWidth?: DimensionValue;\n showsVerticalScrollIndicator?: boolean;\n automaticallyAdjustKeyboardInsets?: boolean;\n handleScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;\n handleTouch?: (event: any) => void;\n scrollEventThrottle?: number;\n keyboardHeight?: number;\n}\n\nexport default function VariantView({ children, scrollViewDisabled, style, scrollViewRef, variantWidth, showsVerticalScrollIndicator, automaticallyAdjustKeyboardInsets, handleScroll, handleTouch, scrollEventThrottle, keyboardHeight }: VariantViewProps) {\n return (\n scrollViewDisabled ? (\n <View style={[style, { width: variantWidth }]}>\n {children}\n </View>\n ) : (\n <ScrollView\n ref={scrollViewRef}\n style={{ width: variantWidth, paddingBottom: keyboardHeight || 0 }}\n contentContainerStyle={styles.scrollContainerStyle}\n bounces={false}\n overScrollMode=\"never\"\n showsVerticalScrollIndicator={showsVerticalScrollIndicator}\n keyboardShouldPersistTaps=\"handled\"\n automaticallyAdjustKeyboardInsets={automaticallyAdjustKeyboardInsets}\n onScroll={handleScroll}\n onTouchStart={handleTouch}\n scrollEventThrottle={scrollEventThrottle}\n >\n <View style={[styles.splitView, style, { width: '100%' }]}>\n {children}\n </View>\n </ScrollView>\n )\n )\n}"]}
1
+ {"version":3,"file":"VariantView.js","sourceRoot":"","sources":["../../../../src/ui/ZSContainer/ui/VariantView.tsx"],"names":[],"mappings":"AAAA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AE,UAAU,CAAC,CACd,CACF,CAAA;AACH,CAAC","sourcesContent":["import { styles } from '..';\nimport { ScrollView, NativeSyntheticEvent, NativeScrollEvent, View, DimensionValue, StyleProp, ViewStyle } from 'react-native';\n\ninterface VariantViewProps {\n children: React.ReactNode;\n scrollViewDisabled?: boolean;\n style: StyleProp<ViewStyle>;\n scrollViewRef?: React.RefObject<ScrollView>;\n variantWidth?: DimensionValue;\n showsVerticalScrollIndicator?: boolean;\n automaticallyAdjustKeyboardInsets?: boolean;\n handleScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;\n handleTouch?: (event: any) => void;\n scrollEventThrottle?: number;\n keyboardHeight?: number;\n}\n\nexport default function VariantView({ children, scrollViewDisabled, style, scrollViewRef, variantWidth, showsVerticalScrollIndicator, automaticallyAdjustKeyboardInsets, handleScroll, handleTouch, scrollEventThrottle, keyboardHeight }: VariantViewProps) {\n return (\n scrollViewDisabled ? (\n <View style={[style, { width: variantWidth }]}>\n {children}\n </View>\n ) : (\n <ScrollView\n ref={scrollViewRef}\n style={{ width: variantWidth }}\n contentContainerStyle={[styles.scrollContainerStyle, { paddingBottom: keyboardHeight || 0 }]}\n bounces={false}\n overScrollMode=\"never\"\n showsVerticalScrollIndicator={showsVerticalScrollIndicator}\n keyboardShouldPersistTaps=\"handled\"\n automaticallyAdjustKeyboardInsets={automaticallyAdjustKeyboardInsets}\n onScroll={handleScroll}\n onTouchStart={handleTouch}\n scrollEventThrottle={scrollEventThrottle}\n >\n <View style={[styles.splitView, style, { width: '100%' }]}>\n {children}\n </View>\n </ScrollView>\n )\n )\n}"]}
@@ -7,7 +7,7 @@ import ZSText from './ZSText';
7
7
  import ThrottleButton from './ThrottleButton';
8
8
  import ZSTextField from './ZSTextField';
9
9
  import ZSRadioGroup from './ZSRadioGroup';
10
- import ZSBottomButton from './ZSBottomButton';
10
+ import ZSBottomCta from './ZSBottomCta';
11
11
  import * as types from './types';
12
- export { ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton, types };
12
+ export { ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomCta, types };
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,OAAO,EACL,MAAM,EACN,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EACd,KAAK,EACN,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,OAAO,EACL,MAAM,EACN,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,EACX,KAAK,EACN,CAAC"}
package/build/ui/index.js CHANGED
@@ -7,7 +7,7 @@ import ZSText from './ZSText';
7
7
  import ThrottleButton from './ThrottleButton';
8
8
  import ZSTextField from './ZSTextField';
9
9
  import ZSRadioGroup from './ZSRadioGroup';
10
- import ZSBottomButton from './ZSBottomButton';
10
+ import ZSBottomCta from './ZSBottomCta';
11
11
  import * as types from './types';
12
- export { ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton, types };
12
+ export { ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomCta, types };
13
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,OAAO,EACL,MAAM,EACN,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EACd,KAAK,EACN,CAAC","sourcesContent":["import ZSView from './ZSView';\nimport AnimatedWrapper from './atoms/AnimatedWrapper';\nimport TextAtom from './atoms/TextAtom';\nimport ZSContainer from './ZSContainer';\nimport ZSPressable from './ZSPressable';\nimport ZSText from './ZSText';\nimport ThrottleButton from './ThrottleButton';\nimport ZSTextField from './ZSTextField';\nimport ZSRadioGroup from './ZSRadioGroup';\nimport ZSBottomButton from './ZSBottomButton';\nimport * as types from './types';\n\nexport {\n ZSView,\n AnimatedWrapper,\n TextAtom,\n ZSContainer,\n ZSPressable,\n ZSText,\n ThrottleButton,\n ZSTextField,\n ZSRadioGroup,\n ZSBottomButton,\n types\n};"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,OAAO,EACL,MAAM,EACN,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,EACX,KAAK,EACN,CAAC","sourcesContent":["import ZSView from './ZSView';\nimport AnimatedWrapper from './atoms/AnimatedWrapper';\nimport TextAtom from './atoms/TextAtom';\nimport ZSContainer from './ZSContainer';\nimport ZSPressable from './ZSPressable';\nimport ZSText from './ZSText';\nimport ThrottleButton from './ThrottleButton';\nimport ZSTextField from './ZSTextField';\nimport ZSRadioGroup from './ZSRadioGroup';\nimport ZSBottomCta from './ZSBottomCta';\nimport * as types from './types';\n\nexport {\n ZSView,\n AnimatedWrapper,\n TextAtom,\n ZSContainer,\n ZSPressable,\n ZSText,\n ThrottleButton,\n ZSTextField,\n ZSRadioGroup,\n ZSBottomCta,\n types\n};"]}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@0610studio/zs-ui",
3
- "version": "0.5.3",
3
+ "version": "0.6.0",
4
4
  "private": false,
5
5
  "description": "EXPO ZS-UI",
6
- "type": "module",
6
+ "type": "commonjs",
7
7
  "main": "build/index.js",
8
8
  "types": "build/index.d.ts",
9
9
  "files": [
@@ -1,16 +0,0 @@
1
- import React from "react";
2
- import { TouchableOpacityProps } from "react-native";
3
- interface Props {
4
- loadingComponent?: React.ReactNode;
5
- height?: number;
6
- disabled?: boolean;
7
- primaryOnPress: () => Promise<any>;
8
- primaryLabelComponent: React.ReactNode;
9
- primaryButtonStyle?: TouchableOpacityProps['style'];
10
- secondaryOnPress?: () => void;
11
- secondaryLabelComponent?: React.ReactNode;
12
- secondaryButtonStyle?: TouchableOpacityProps['style'];
13
- }
14
- declare function ZSBottomButton({ loadingComponent, height, disabled, primaryLabelComponent, primaryOnPress, primaryButtonStyle, secondaryOnPress, secondaryLabelComponent, secondaryButtonStyle }: Props): React.JSX.Element;
15
- export default ZSBottomButton;
16
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ZSBottomButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,EAAuE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAS1H,UAAU,KAAK;IACb,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IACnC,qBAAqB,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,kBAAkB,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACpD,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,uBAAuB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1C,oBAAoB,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;CACvD;AAED,iBAAS,cAAc,CAAC,EACtB,gBAAwC,EACxC,MAAW,EACX,QAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,kBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAyB,EAC1B,EAAE,KAAK,qBAkGP;AA0BD,eAAe,cAAc,CAAC"}
@@ -1,94 +0,0 @@
1
- import React, { useCallback, useEffect, useState } from "react";
2
- import { ActivityIndicator, Keyboard, Platform, StyleSheet, TouchableOpacity } from "react-native";
3
- import Animated, { interpolate, useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
4
- import { useSafeAreaInsets } from "react-native-safe-area-context";
5
- const DEFAULT_MARGIN_X = 20;
6
- const DEFAULT_MARGIN_BOTTOM = 10;
7
- const DEFAULT_BORDER_RADIUS = 14;
8
- const DURATION = { duration: 250 };
9
- function ZSBottomButton({ loadingComponent = <ActivityIndicator />, height = 55, disabled = false, primaryLabelComponent, primaryOnPress, primaryButtonStyle = {}, secondaryOnPress, secondaryLabelComponent, secondaryButtonStyle = {} }) {
10
- const isKeyboardVisible = useSharedValue(0);
11
- const keyboardHeight = useSharedValue(0);
12
- const [isLoading, setIsLoading] = useState(false);
13
- const { bottom } = useSafeAreaInsets();
14
- const handlePress = useCallback(async () => {
15
- setIsLoading(true);
16
- try {
17
- await primaryOnPress();
18
- }
19
- finally {
20
- setIsLoading(false);
21
- }
22
- }, [primaryOnPress]);
23
- // ** 소프트 키보드 핸들링
24
- useEffect(() => {
25
- const showEvent = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';
26
- const hideEvent = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';
27
- const keyboardShowSubscription = Keyboard.addListener(showEvent, (event) => {
28
- keyboardHeight.value = event.endCoordinates.height - bottom;
29
- isKeyboardVisible.value = withTiming(1, { duration: 200 });
30
- });
31
- const keyboardHideSubscription = Keyboard.addListener(hideEvent, () => {
32
- isKeyboardVisible.value = withTiming(0, { duration: 200 });
33
- });
34
- return () => {
35
- isKeyboardVisible.value = 0;
36
- keyboardHeight.value = 0;
37
- keyboardShowSubscription.remove();
38
- keyboardHideSubscription.remove();
39
- };
40
- }, []);
41
- // 키보드가 올라왔을때 INPUT의 위치 조정
42
- const rootViewStyle = useAnimatedStyle(() => {
43
- return {
44
- height: withTiming(isKeyboardVisible.value ? height : 0, DURATION),
45
- };
46
- });
47
- const animatedStyle = useAnimatedStyle(() => {
48
- const getBottom = interpolate(isKeyboardVisible.value, [0, 1], [DEFAULT_MARGIN_BOTTOM, Platform.OS === 'ios' ? keyboardHeight.value : 0], 'clamp');
49
- const getMargin = interpolate(isKeyboardVisible.value, [0, 1], [DEFAULT_MARGIN_X, 0], 'clamp');
50
- const getRadius = interpolate(isKeyboardVisible.value, [0, 1], [DEFAULT_BORDER_RADIUS, 0], 'clamp');
51
- return {
52
- bottom: withTiming(getBottom, DURATION),
53
- marginLeft: withTiming(getMargin, DURATION),
54
- marginRight: withTiming(getMargin, DURATION),
55
- borderRadius: withTiming(getRadius, DURATION),
56
- };
57
- });
58
- return (<Animated.View style={rootViewStyle}>
59
- <Animated.View style={[styles.container, animatedStyle]}>
60
- {secondaryLabelComponent && (<TouchableOpacity activeOpacity={0.7} style={[secondaryButtonStyle, { height }, styles.touchSecondaryContainer]} onPress={secondaryOnPress}>
61
- {secondaryLabelComponent}
62
- </TouchableOpacity>)}
63
-
64
- <TouchableOpacity activeOpacity={0.7} style={[primaryButtonStyle, { height }, styles.touchContainer]} onPress={handlePress} disabled={disabled || isLoading}>
65
- {isLoading ? loadingComponent : primaryLabelComponent}
66
- </TouchableOpacity>
67
- </Animated.View>
68
- </Animated.View>);
69
- }
70
- const styles = StyleSheet.create({
71
- touchContainer: {
72
- justifyContent: 'center',
73
- alignItems: 'center',
74
- flex: 2,
75
- },
76
- touchSecondaryContainer: {
77
- justifyContent: 'center',
78
- alignItems: 'center',
79
- flex: 1,
80
- },
81
- container: {
82
- justifyContent: 'center',
83
- alignItems: 'center',
84
- borderRadius: DEFAULT_BORDER_RADIUS,
85
- bottom: DEFAULT_MARGIN_BOTTOM,
86
- marginLeft: DEFAULT_MARGIN_X,
87
- marginRight: DEFAULT_MARGIN_X,
88
- overflow: 'hidden',
89
- flexDirection: 'row',
90
- position: 'absolute'
91
- },
92
- });
93
- export default ZSBottomButton;
94
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/ZSBottomButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAyB,MAAM,cAAc,CAAC;AAC1H,OAAO,QAAQ,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC9G,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,QAAQ,GAAG,EAAE,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qB,CACvD;QAAA,EAAE,gBAAgB,CACpB;MAAA,EAAE,QAAQ,CAAC,IAAI,CACjB;IAAA,EAAE,QAAQ,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,cAAc,EAAE;QACd,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,IAAI,EAAE,CAAC;KACR;IACD,uBAAuB,EAAE;QACvB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,IAAI,EAAE,CAAC;KACR;IACD,SAAS,EAAE;QACT,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,qBAAqB;QACnC,MAAM,EAAE,qBAAqB;QAC7B,UAAU,EAAE,gBAAgB;QAC5B,WAAW,EAAE,gBAAgB;QAC7B,QAAQ,EAAE,QAAQ;QAClB,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC","sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport { ActivityIndicator, Keyboard, Platform, StyleSheet, TouchableOpacity, TouchableOpacityProps } from \"react-native\";\nimport Animated, { interpolate, useAnimatedStyle, useSharedValue, withTiming } from \"react-native-reanimated\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\n\nconst DEFAULT_MARGIN_X = 20;\nconst DEFAULT_MARGIN_BOTTOM = 10;\nconst DEFAULT_BORDER_RADIUS = 14;\nconst DURATION = { duration: 250 };\n\ninterface Props {\n loadingComponent?: React.ReactNode;\n height?: number;\n disabled?: boolean;\n primaryOnPress: () => Promise<any>;\n primaryLabelComponent: React.ReactNode;\n primaryButtonStyle?: TouchableOpacityProps['style'];\n secondaryOnPress?: () => void;\n secondaryLabelComponent?: React.ReactNode;\n secondaryButtonStyle?: TouchableOpacityProps['style'];\n}\n\nfunction ZSBottomButton({\n loadingComponent = <ActivityIndicator />,\n height = 55,\n disabled = false,\n primaryLabelComponent,\n primaryOnPress,\n primaryButtonStyle = {},\n secondaryOnPress,\n secondaryLabelComponent,\n secondaryButtonStyle = {}\n}: Props) {\n const isKeyboardVisible = useSharedValue(0);\n const keyboardHeight = useSharedValue(0);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const { bottom } = useSafeAreaInsets();\n\n const handlePress = useCallback(async () => {\n setIsLoading(true);\n try {\n await primaryOnPress();\n } finally {\n setIsLoading(false);\n }\n }, [primaryOnPress]);\n\n // ** 소프트 키보드 핸들링\n useEffect(() => {\n const showEvent = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';\n const hideEvent = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';\n\n const keyboardShowSubscription = Keyboard.addListener(showEvent, (event) => {\n keyboardHeight.value = event.endCoordinates.height - bottom;\n isKeyboardVisible.value = withTiming(1, { duration: 200 });\n });\n\n const keyboardHideSubscription = Keyboard.addListener(hideEvent, () => {\n isKeyboardVisible.value = withTiming(0, { duration: 200 });\n });\n\n return () => {\n isKeyboardVisible.value = 0;\n keyboardHeight.value = 0;\n keyboardShowSubscription.remove();\n keyboardHideSubscription.remove();\n };\n }, []);\n\n // 키보드가 올라왔을때 INPUT의 위치 조정\n const rootViewStyle = useAnimatedStyle(() => {\n return {\n height: withTiming(isKeyboardVisible.value ? height : 0, DURATION),\n };\n });\n\n const animatedStyle = useAnimatedStyle(() => {\n const getBottom = interpolate(\n isKeyboardVisible.value,\n [0, 1],\n [DEFAULT_MARGIN_BOTTOM, Platform.OS === 'ios' ? keyboardHeight.value : 0],\n 'clamp',\n );\n\n const getMargin = interpolate(\n isKeyboardVisible.value,\n [0, 1],\n [DEFAULT_MARGIN_X, 0],\n 'clamp',\n );\n\n const getRadius = interpolate(\n isKeyboardVisible.value,\n [0, 1],\n [DEFAULT_BORDER_RADIUS, 0],\n 'clamp',\n );\n\n return {\n bottom: withTiming(getBottom, DURATION),\n marginLeft: withTiming(getMargin, DURATION),\n marginRight: withTiming(getMargin, DURATION),\n borderRadius: withTiming(getRadius, DURATION),\n };\n });\n\n return (\n <Animated.View style={rootViewStyle}>\n <Animated.View style={[styles.container, animatedStyle]}>\n {secondaryLabelComponent && (\n <TouchableOpacity\n activeOpacity={0.7}\n style={[secondaryButtonStyle, { height }, styles.touchSecondaryContainer]}\n onPress={secondaryOnPress}\n >\n {secondaryLabelComponent}\n </TouchableOpacity>\n )}\n\n <TouchableOpacity\n activeOpacity={0.7}\n style={[primaryButtonStyle, { height }, styles.touchContainer]}\n onPress={handlePress}\n disabled={disabled || isLoading}\n >\n {isLoading ? loadingComponent : primaryLabelComponent}\n </TouchableOpacity>\n </Animated.View>\n </Animated.View>\n );\n}\n\nconst styles = StyleSheet.create({\n touchContainer: {\n justifyContent: 'center',\n alignItems: 'center',\n flex: 2,\n },\n touchSecondaryContainer: {\n justifyContent: 'center',\n alignItems: 'center',\n flex: 1,\n },\n container: {\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: DEFAULT_BORDER_RADIUS,\n bottom: DEFAULT_MARGIN_BOTTOM,\n marginLeft: DEFAULT_MARGIN_X,\n marginRight: DEFAULT_MARGIN_X,\n overflow: 'hidden',\n flexDirection: 'row',\n position: 'absolute'\n },\n});\n\nexport default ZSBottomButton;\n"]}