@shoplflow/base 0.4.0 → 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.
Files changed (63) hide show
  1. package/dist/animation/fadeInOut.d.ts +17 -0
  2. package/dist/components/BackDrop/BackDrop.d.ts +3 -0
  3. package/dist/components/BackDrop/BackDrop.types.d.ts +5 -0
  4. package/dist/components/BackDrop/index.d.ts +2 -0
  5. package/dist/components/Chips/ChipButton/ChipButton.d.ts +3 -0
  6. package/dist/components/Chips/ChipButton/ChipButton.styled.d.ts +8 -0
  7. package/dist/components/Chips/ChipButton/ChipButton.types.d.ts +16 -0
  8. package/dist/components/Chips/ChipButton/index.d.ts +3 -0
  9. package/dist/components/Chips/ChipToggle/ChipToggle.d.ts +3 -0
  10. package/dist/components/Chips/ChipToggle/ChipToggle.styled.d.ts +8 -0
  11. package/dist/components/Chips/ChipToggle/ChipToggle.types.d.ts +16 -0
  12. package/dist/components/Chips/ChipToggle/index.d.ts +3 -0
  13. package/dist/components/Chips/index.d.ts +2 -0
  14. package/dist/components/Modal/Modal.styled.d.ts +28 -0
  15. package/dist/components/Modal/Modal.types.d.ts +55 -0
  16. package/dist/components/Modal/ModalBody.d.ts +3 -0
  17. package/dist/components/Modal/ModalContainer.d.ts +3 -0
  18. package/dist/components/Modal/ModalFooter.d.ts +3 -0
  19. package/dist/components/Modal/ModalHeader.d.ts +3 -0
  20. package/dist/components/Modal/index.d.ts +7 -0
  21. package/dist/components/Stack/Stack.d.ts +12 -0
  22. package/dist/components/Stack/Stack.styled.d.ts +6 -0
  23. package/dist/components/Stack/Stack.types.d.ts +52 -0
  24. package/dist/components/Stack/index.d.ts +4 -0
  25. package/dist/components/Text/Text.d.ts +4 -0
  26. package/dist/components/Text/Text.styled.d.ts +6 -0
  27. package/dist/components/Text/Text.types.d.ts +23 -0
  28. package/dist/components/Text/index.d.ts +2 -0
  29. package/dist/components/index.d.ts +5 -0
  30. package/dist/{index.css → global.css} +4 -2
  31. package/dist/hooks/index.d.ts +6 -0
  32. package/dist/hooks/useDomain.d.ts +6 -0
  33. package/dist/hooks/useHandleModal.d.ts +5 -0
  34. package/dist/hooks/useModalStore.d.ts +15 -0
  35. package/dist/hooks/useModalValue.d.ts +3 -0
  36. package/dist/hooks/useOnToggle.d.ts +11 -0
  37. package/dist/hooks/useOutsideClick.d.ts +14 -0
  38. package/dist/hooks/useResizeObserver.d.ts +9 -0
  39. package/dist/index.cjs +176 -6877
  40. package/dist/index.d.ts +5 -212
  41. package/dist/index.mjs +178 -0
  42. package/dist/providers/ShoplflowProvider.d.ts +8 -0
  43. package/dist/providers/index.d.ts +3 -0
  44. package/dist/styles/index.d.ts +9 -0
  45. package/dist/styles/tokens.d.ts +100 -0
  46. package/dist/styles/utils/getDisabledStyle.d.ts +1 -0
  47. package/dist/types/Domain.d.ts +1 -0
  48. package/dist/utils/getNextColor.d.ts +11 -0
  49. package/dist/utils/noop.d.ts +1 -0
  50. package/dist/utils/type/$values.d.ts +1 -0
  51. package/dist/utils/type/ComponentProps.d.ts +134 -0
  52. package/package.json +55 -38
  53. package/dist/emotion.d.cjs +0 -5
  54. package/dist/emotion.d.cjs.map +0 -1
  55. package/dist/emotion.d.d.cts +0 -5
  56. package/dist/emotion.d.d.ts +0 -5
  57. package/dist/emotion.d.js +0 -3
  58. package/dist/emotion.d.js.map +0 -1
  59. package/dist/index.cjs.map +0 -1
  60. package/dist/index.css.map +0 -1
  61. package/dist/index.d.cts +0 -212
  62. package/dist/index.js +0 -6851
  63. package/dist/index.js.map +0 -1
@@ -0,0 +1,17 @@
1
+ export declare const fadeInOut: {
2
+ initial: {
3
+ opacity: number;
4
+ };
5
+ animate: {
6
+ opacity: number;
7
+ transition: {
8
+ duration: number;
9
+ };
10
+ };
11
+ exit: {
12
+ opacity: number;
13
+ transition: {
14
+ duration: number;
15
+ };
16
+ };
17
+ };
@@ -0,0 +1,3 @@
1
+ import type { BackDropProps } from './BackDrop.types';
2
+ declare const BackDrop: ({ children }: BackDropProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
3
+ export default BackDrop;
@@ -0,0 +1,5 @@
1
+ import type { ChildrenProps } from '../../utils/type/ComponentProps';
2
+ export interface BackDropProps extends ChildrenProps, BackDropOptionProps {
3
+ }
4
+ export interface BackDropOptionProps {
5
+ }
@@ -0,0 +1,2 @@
1
+ export * from './BackDrop.types';
2
+ export * from './BackDrop';
@@ -0,0 +1,3 @@
1
+ import type { ChipButtonProps } from './ChipButton.types';
2
+ declare const ChipButton: ({ styleVar, color, sizeVar, text, onClick, disabled, ...rest }: ChipButtonProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
3
+ export default ChipButton;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { TypographyTokens } from '../../../styles';
3
+ import type { ChipButtonProps } from './ChipButton.types';
4
+ export declare const getLineTypographyBySizeVar: (sizeVar: ChipButtonProps['sizeVar']) => TypographyTokens;
5
+ export declare const StyledChipButton: import("@emotion/styled").StyledComponent<{
6
+ theme?: import("@emotion/react").Theme | undefined;
7
+ as?: import("react").ElementType<any> | undefined;
8
+ } & ChipButtonProps, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
@@ -0,0 +1,16 @@
1
+ import type { ColorTokenProps, LeftAndRightElementProps, SizeVariantProps, StyleVariantProps, TextProps, DisableProps, BackgroundColorProps } from '../../../utils/type/ComponentProps';
2
+ import type { $Values } from '@shoplflow/utils';
3
+ import type { HTMLAttributes } from 'react';
4
+ export declare const ChipButtonStyleVariants: {
5
+ readonly LINE: "LINE";
6
+ };
7
+ export declare const ChipButtonSizeVariants: {
8
+ readonly S: "S";
9
+ readonly XS: "XS";
10
+ };
11
+ export type ChipButtonStyleVariantType = $Values<typeof ChipButtonStyleVariants>;
12
+ export type ChipButtonSizeVariantType = $Values<typeof ChipButtonSizeVariants>;
13
+ export interface ChipButtonProps extends ChipButtonOptionProps, Omit<HTMLAttributes<HTMLButtonElement>, 'color'>, TextProps, DisableProps, LeftAndRightElementProps, SizeVariantProps<ChipButtonSizeVariantType>, StyleVariantProps<ChipButtonStyleVariantType>, ColorTokenProps, BackgroundColorProps {
14
+ }
15
+ export interface ChipButtonOptionProps {
16
+ }
@@ -0,0 +1,3 @@
1
+ export { default as ChipButton } from './ChipButton';
2
+ export * from './ChipButton.styled';
3
+ export * from './ChipButton.types';
@@ -0,0 +1,3 @@
1
+ import type { ChipToggleProps } from './ChipToggle.types';
2
+ declare const ChipToggle: ({ text, isSelected, defaultSelected, color, styleVar, sizeVar, leftSource, rightSource, onClick, disabled, ...rest }: ChipToggleProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
3
+ export default ChipToggle;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { ChipToggleProps } from './ChipToggle.types';
3
+ import type { TypographyTokens } from '../../../styles';
4
+ export declare const getLineTypographyBySizeVar: (sizeVar: ChipToggleProps['sizeVar']) => TypographyTokens;
5
+ export declare const StyledChip: import("@emotion/styled").StyledComponent<{
6
+ theme?: import("@emotion/react").Theme | undefined;
7
+ as?: import("react").ElementType<any> | undefined;
8
+ } & ChipToggleProps, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
@@ -0,0 +1,16 @@
1
+ import type { $Values } from '../../../utils/type/$values';
2
+ import type { ColorTokenProps, SizeVariantProps, StyleVariantProps, LeftAndRightElementProps, TextProps, SelectedProps, RadiusBooleanProps, DefaultSelectedProps, DisableProps } from '../../../utils/type/ComponentProps';
3
+ import type { HTMLAttributes } from 'react';
4
+ export declare const ChipToggleStyleVariants: {
5
+ readonly SOLID: "SOLID";
6
+ };
7
+ export declare const ChipToggleSizeVariants: {
8
+ readonly S: "S";
9
+ readonly XS: "XS";
10
+ };
11
+ export type ChipToggleStyleVariantType = $Values<typeof ChipToggleStyleVariants>;
12
+ export type ChipToggleSizeVariantType = $Values<typeof ChipToggleSizeVariants>;
13
+ export interface ChipToggleProps extends ChipToggleOptionProps, SelectedProps, DefaultSelectedProps, ColorTokenProps, StyleVariantProps<ChipToggleStyleVariantType>, SizeVariantProps<ChipToggleSizeVariantType>, LeftAndRightElementProps, RadiusBooleanProps, TextProps, DisableProps, Omit<HTMLAttributes<HTMLButtonElement>, 'color'> {
14
+ }
15
+ export interface ChipToggleOptionProps {
16
+ }
@@ -0,0 +1,3 @@
1
+ export { default as ChipToggle } from './ChipToggle';
2
+ export * from './ChipToggle.styled';
3
+ export * from './ChipToggle.types';
@@ -0,0 +1,2 @@
1
+ export * from './ChipToggle';
2
+ export * from './ChipButton';
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ import type { ModalContainerProps } from './Modal.types';
3
+ export declare const Container: import("@emotion/styled").StyledComponent<{
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ as?: import("react").ElementType<any> | undefined;
6
+ } & ModalContainerProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
7
+ export declare const HeaderContainer: import("@emotion/styled").StyledComponent<{
8
+ theme?: import("@emotion/react").Theme | undefined;
9
+ as?: import("react").ElementType<any> | undefined;
10
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
11
+ export declare const BodyContainer: import("@emotion/styled").StyledComponent<{
12
+ theme?: import("@emotion/react").Theme | undefined;
13
+ as?: import("react").ElementType<any> | undefined;
14
+ } & {
15
+ isIncludeHeader: boolean;
16
+ height: string | number;
17
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
18
+ export declare const ModalBodyContent: import("@emotion/styled").StyledComponent<{
19
+ theme?: import("@emotion/react").Theme | undefined;
20
+ as?: import("react").ElementType<any> | undefined;
21
+ } & {
22
+ isIncludeHeader: boolean;
23
+ sizeVar: ModalContainerProps['sizeVar'];
24
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
25
+ export declare const FooterContainer: import("@emotion/styled").StyledComponent<{
26
+ theme?: import("@emotion/react").Theme | undefined;
27
+ as?: import("react").ElementType<any> | undefined;
28
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,55 @@
1
+ /// <reference types="react" />
2
+ import type { ChildrenProps, SizeVariantProps } from '../../utils/type/ComponentProps';
3
+ import type { $Values } from '../../utils/type/$values';
4
+ export declare enum ModalSize {
5
+ XXS = "XXS",
6
+ XS = "XS",
7
+ S = "S",
8
+ M = "M",
9
+ L = "L",
10
+ XL = "XL",
11
+ XXL = "XXL"
12
+ }
13
+ export type ModalSizeType = $Values<typeof ModalSize>;
14
+ export interface ModalContainerProps extends ModalContainerOptionProps, SizeVariantProps<ModalSizeType> {
15
+ children?: React.ReactNode | React.ReactNode[];
16
+ }
17
+ export interface ModalContainerOptionProps {
18
+ /**
19
+ * 모달의 높이를 설정합니다.
20
+ */
21
+ height?: number;
22
+ /**
23
+ * 모달의 외부를 클릭했을 때 실행되는 함수입니다.
24
+ * @param args
25
+ */
26
+ outsideClick?: (args?: any) => void;
27
+ }
28
+ export interface ModalHeaderProps extends ModalHeaderOptionProps, ChildrenProps {
29
+ }
30
+ export interface ModalHeaderOptionProps {
31
+ }
32
+ export declare const MODAL_HEADER_KEY: unique symbol;
33
+ export interface ModalHeaderType extends React.FC<ModalHeaderProps> {
34
+ [MODAL_HEADER_KEY]?: boolean;
35
+ }
36
+ export interface ModalBodyProps extends ModalBodyOptionProps, ChildrenProps {
37
+ }
38
+ export interface ModalBodyOptionProps {
39
+ isIncludeHeader?: boolean;
40
+ isIncludeFooter?: boolean;
41
+ height?: number;
42
+ sizeVar?: ModalSizeType;
43
+ }
44
+ export declare const MODAL_BODY_KEY: unique symbol;
45
+ export interface ModalBodyType extends React.FC<ModalBodyProps> {
46
+ [MODAL_BODY_KEY]?: boolean;
47
+ }
48
+ export interface ModalFooterProps extends ModalFooterOptionProps, ChildrenProps {
49
+ }
50
+ export interface ModalFooterOptionProps {
51
+ }
52
+ export declare const MODAL_FOOTER_KEY: unique symbol;
53
+ export interface ModalFooterType extends React.FC<ModalBodyProps> {
54
+ [MODAL_FOOTER_KEY]?: boolean;
55
+ }
@@ -0,0 +1,3 @@
1
+ import type { ModalBodyType } from './Modal.types';
2
+ declare const ModalBody: ModalBodyType;
3
+ export default ModalBody;
@@ -0,0 +1,3 @@
1
+ import type { ModalContainerProps } from './Modal.types';
2
+ declare const ModalContainer: ({ children, outsideClick, ...rest }: ModalContainerProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
3
+ export default ModalContainer;
@@ -0,0 +1,3 @@
1
+ import type { ModalFooterType } from './Modal.types';
2
+ declare const ModalFooter: ModalFooterType;
3
+ export default ModalFooter;
@@ -0,0 +1,3 @@
1
+ import type { ModalHeaderType } from './Modal.types';
2
+ declare const ModalHeader: ModalHeaderType;
3
+ export default ModalHeader;
@@ -0,0 +1,7 @@
1
+ export declare const Modal: {
2
+ Container: ({ children, outsideClick, ...rest }: import("./Modal.types").ModalContainerProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
3
+ Header: import("./Modal.types").ModalHeaderType;
4
+ Body: import("./Modal.types").ModalBodyType;
5
+ Footer: import("./Modal.types").ModalFooterType;
6
+ };
7
+ export * from './Modal.types';
@@ -0,0 +1,12 @@
1
+ import type { MotionStackComponentType, StackComponentType } from './Stack.types';
2
+ interface StackType extends StackComponentType {
3
+ Vertical: StackComponentType;
4
+ Horizontal: StackComponentType;
5
+ }
6
+ export declare const Stack: StackType;
7
+ interface MotionStackType extends MotionStackComponentType {
8
+ Vertical: MotionStackComponentType;
9
+ Horizontal: MotionStackComponentType;
10
+ }
11
+ export declare const MotionStack: MotionStackType;
12
+ export default Stack;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import type { StackOptionProps } from './Stack.types';
3
+ export declare const StyledStack: import("@emotion/styled").StyledComponent<{
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ as?: import("react").ElementType<any> | undefined;
6
+ } & StackOptionProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,52 @@
1
+ import type { ComponentPropsWithRef, CSSProperties, ReactElement } from 'react';
2
+ import type { CustomDomComponent } from 'framer-motion';
3
+ import type { BorderRadiusTokens, ColorTokens, SpacingTokens } from '../../styles';
4
+ import type { ChildrenProps, HTMLPropsWithOutRef, RenderConfigProps, StringElementType } from '../../utils/type/ComponentProps';
5
+ export type StackGenericProps<T extends StringElementType = 'div'> = RenderConfigProps & StackProps & HTMLPropsWithOutRef<T>;
6
+ export type StackComponentType = <T extends StringElementType = 'div'>(props: StackGenericProps<T> & Pick<ComponentPropsWithRef<T>, 'ref'>) => ReactElement | null;
7
+ export type MotionStackComponentType<T extends StringElementType = 'div'> = CustomDomComponent<RenderConfigProps & HTMLPropsWithOutRef<T> & StackProps>;
8
+ export interface StackProps extends StackOptionProps, ChildrenProps {
9
+ }
10
+ export interface StackOptionProps {
11
+ /**
12
+ * 요소들의 align-items 값
13
+ */
14
+ align?: CSSProperties['alignItems'];
15
+ /**
16
+ * 요소들의 justify-content 값
17
+ */
18
+ justify?: CSSProperties['justifyContent'];
19
+ /**
20
+ * 요소들의 flex-direction 값
21
+ * (값: row, column)
22
+ */
23
+ direction?: CSSProperties['flexDirection'];
24
+ /**
25
+ * 요소들 사이의 간격
26
+ */
27
+ spacing?: SpacingTokens;
28
+ /**
29
+ * flex-wrap 설정
30
+ */
31
+ flexWrap?: CSSProperties['flexWrap'];
32
+ /**
33
+ * width 설정
34
+ */
35
+ width?: CSSProperties['width'];
36
+ /**
37
+ * height 설정
38
+ */
39
+ height?: CSSProperties['height'];
40
+ /**
41
+ * flex 설정
42
+ */
43
+ flex?: CSSProperties['flex'];
44
+ /**
45
+ * background 설정
46
+ */
47
+ background?: ColorTokens;
48
+ /**
49
+ * border-radius 설정
50
+ */
51
+ radius?: BorderRadiusTokens;
52
+ }
@@ -0,0 +1,4 @@
1
+ export { default as Stack } from './Stack';
2
+ export * from './Stack';
3
+ export * from './Stack.types';
4
+ export * from './Stack.styled';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { TextProps } from './Text.types';
3
+ declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLElement>>;
4
+ export default Text;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import type { TextOptionProps } from './Text.types';
3
+ export declare const StyledText: import("@emotion/styled").StyledComponent<{
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ as?: import("react").ElementType<any> | undefined;
6
+ } & TextOptionProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -0,0 +1,23 @@
1
+ import type { CSSProperties, HTMLAttributes } from 'react';
2
+ import type { ColorTokens, TypographyTokens } from '../../styles';
3
+ import type { ChildrenProps, RenderConfigProps } from '../../utils/type/ComponentProps';
4
+ export interface TextOptionProps {
5
+ /**
6
+ * 타이포그레피를 설정합니다.
7
+ */
8
+ typography?: TypographyTokens;
9
+ color?: ColorTokens;
10
+ /**
11
+ * 텍스트를 몇 줄까지 보여줄지를 설정합니다.
12
+ */
13
+ lineClamp?: number;
14
+ whiteSpace?: CSSProperties['whiteSpace'];
15
+ display?: CSSProperties['display'];
16
+ textAlign?: CSSProperties['textAlign'];
17
+ textOverflow?: CSSProperties['textOverflow'];
18
+ textDecorations?: CSSProperties['textDecoration'];
19
+ opacity?: CSSProperties['opacity'];
20
+ wordBreak?: CSSProperties['wordBreak'];
21
+ }
22
+ export interface TextProps extends TextOptionProps, ChildrenProps, RenderConfigProps, Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {
23
+ }
@@ -0,0 +1,2 @@
1
+ export { default as Text } from './Text';
2
+ export * from './Text.types';
@@ -0,0 +1,5 @@
1
+ export * from './Stack';
2
+ export * from './Text';
3
+ export * from './Modal';
4
+ export * from './BackDrop';
5
+ export * from './Chips';
@@ -1,4 +1,6 @@
1
- /* src/styles/global.css */
1
+ * {
2
+ box-sizing: border-box;
3
+ }
2
4
  :root[data-shoplflow] {
3
5
  --font-weight-regular: 400;
4
6
  --font-weight-medium: 500;
@@ -8,6 +10,7 @@
8
10
  --border-radius08: 8px;
9
11
  --border-radius12: 12px;
10
12
  --border-radius16: 16px;
13
+ --border-radius20: 20px;
11
14
  --spacing04: 4px;
12
15
  --spacing06: 6px;
13
16
  --spacing08: 8px;
@@ -320,4 +323,3 @@
320
323
  font-size: 12px;
321
324
  }
322
325
  }
323
- /*# sourceMappingURL=index.css.map */
@@ -0,0 +1,6 @@
1
+ export * from './useDomain';
2
+ export * from './useHandleModal';
3
+ export * from './useModalValue';
4
+ export * from './useModalStore';
5
+ export * from './useOutsideClick';
6
+ export * from './useResizeObserver';
@@ -0,0 +1,6 @@
1
+ import type { DomainType } from '../types/Domain';
2
+ type UseDomainProps = {
3
+ domain?: DomainType;
4
+ };
5
+ export declare const useDomain: ({ domain }: UseDomainProps) => void;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const useHandleModal: () => {
3
+ addModal: (modal: import("react").ReactNode, id?: string | undefined) => void;
4
+ removeModal: (props?: import("./useModalStore").RemoveModalProps | undefined) => void;
5
+ };
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from 'react';
2
+ export type ModalStateType = {
3
+ component: ReactNode;
4
+ id?: string;
5
+ };
6
+ export type RemoveModalProps = {
7
+ id?: string;
8
+ deps?: number;
9
+ };
10
+ export type UseModalStore = {
11
+ modal: ModalStateType[];
12
+ addModal: (modal: ReactNode, id?: string) => void;
13
+ removeModal: (props?: RemoveModalProps) => void;
14
+ };
15
+ export declare const useModalStore: import("zustand").UseBoundStore<import("zustand").StoreApi<UseModalStore>>;
@@ -0,0 +1,3 @@
1
+ export declare const useModalValue: () => {
2
+ modal: import("./useModalStore").ModalStateType[];
3
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * toggle 기능을 추상화한 hook입니다.
3
+ * selected, defaultSelected를 받아서 토글을 관리하는 hook입니다.
4
+ * selected가 있으면 controlled, 없으면 uncontrolled로 동작합니다.
5
+ * defaultSelected가 있으면 초기값으로 설정됩니다.
6
+ * @param {boolean} selected
7
+ * @param {boolean} defaultSelected
8
+ * @return {[boolean, (() => void)]}
9
+ */
10
+ export type UseOnToggle = (selected?: boolean, defaultSelected?: boolean) => [boolean, () => void];
11
+ export declare const useOnToggle: UseOnToggle;
@@ -0,0 +1,14 @@
1
+ import type React from 'react';
2
+ /**
3
+ * @description
4
+ * outsideClick 이벤트를 감지하는 hook
5
+ * return되는 ref를 컴포넌트에 적용하거나 외부에서 생성한 ref를 기준으로 부모 요소를 클릭하는 경우 outsideClick 함수를 실행합니다.
6
+ * 외부에서 생성한 ref를 사용할 경우 initialRef를 통해 ref를 전달해야 합니다.
7
+ *
8
+ * @param onClickOutside
9
+ * @param initialRef
10
+ */
11
+ export declare const useOutsideClick: <T extends HTMLElement>(onClickOutside: (target: EventTarget | null) => void, initialRef?: React.RefObject<T> | undefined) => {
12
+ ref: React.RefObject<T>;
13
+ };
14
+ export default useOutsideClick;
@@ -0,0 +1,9 @@
1
+ type ResizeOptions = {
2
+ trackWidth?: boolean;
3
+ trackHeight?: boolean;
4
+ };
5
+ export declare const useResizeObserver: <T extends HTMLElement>(element: T, options?: ResizeOptions) => {
6
+ width: number;
7
+ height: number;
8
+ };
9
+ export {};