@shoplflow/base 0.3.0 → 0.5.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/dist/animation/fadeInOut.d.ts +17 -0
- package/dist/components/BackDrop/BackDrop.d.ts +3 -0
- package/dist/components/BackDrop/BackDrop.types.d.ts +5 -0
- package/dist/components/BackDrop/index.d.ts +2 -0
- package/dist/components/Modal/Modal.styled.d.ts +28 -0
- package/dist/components/Modal/Modal.types.d.ts +55 -0
- package/dist/components/Modal/ModalBody.d.ts +3 -0
- package/dist/components/Modal/ModalContainer.d.ts +3 -0
- package/dist/components/Modal/ModalFooter.d.ts +3 -0
- package/dist/components/Modal/ModalHeader.d.ts +3 -0
- package/dist/components/Modal/index.d.ts +7 -0
- package/dist/components/Stack/Stack.d.ts +12 -0
- package/dist/components/Stack/Stack.styled.d.ts +6 -0
- package/dist/components/Stack/Stack.types.d.ts +52 -0
- package/dist/components/Stack/index.d.ts +4 -0
- package/dist/components/Text/Text.d.ts +4 -0
- package/dist/components/Text/Text.styled.d.ts +6 -0
- package/dist/components/Text/Text.types.d.ts +23 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/{index.css → global.css} +3 -2
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/useDomain.d.ts +6 -0
- package/dist/hooks/useHandleModal.d.ts +5 -0
- package/dist/hooks/useModalStore.d.ts +15 -0
- package/dist/hooks/useModalValue.d.ts +3 -0
- package/dist/hooks/useOutsideClick.d.ts +14 -0
- package/dist/hooks/useResizeObserver.d.ts +9 -0
- package/dist/index.cjs +110 -6877
- package/dist/index.d.ts +5 -212
- package/dist/index.mjs +112 -0
- package/dist/providers/ShoplflowProvider.d.ts +8 -0
- package/dist/providers/index.d.ts +3 -0
- package/dist/styles/index.d.ts +9 -0
- package/dist/styles/tokens.d.ts +99 -0
- package/dist/types/Domain.d.ts +1 -0
- package/dist/utils/noop.d.ts +1 -0
- package/dist/utils/type/$values.d.ts +1 -0
- package/dist/utils/type/ComponentProps.d.ts +91 -0
- package/package.json +52 -37
- package/dist/emotion.d.cjs +0 -5
- package/dist/emotion.d.cjs.map +0 -1
- package/dist/emotion.d.d.cts +0 -5
- package/dist/emotion.d.d.ts +0 -5
- package/dist/emotion.d.js +0 -3
- package/dist/emotion.d.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.css.map +0 -1
- package/dist/index.d.cts +0 -212
- package/dist/index.js +0 -6851
- package/dist/index.js.map +0 -1
|
@@ -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,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,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,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,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;
|