@shoplflow/base 0.9.0 → 0.11.3
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/index.cjs +1755 -179
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +525 -0
- package/dist/index.d.ts +525 -5
- package/dist/index.js +1747 -0
- package/dist/index.js.map +1 -0
- package/dist/{global.css → styles/global.css} +2 -0
- package/dist/styles/global.css.map +1 -0
- package/dist/styles/global.d.cts +2 -0
- package/dist/styles/global.d.ts +2 -0
- package/dist/styles/reset.css +65 -0
- package/dist/styles/reset.css.map +1 -0
- package/dist/styles/reset.d.cts +2 -0
- package/dist/styles/reset.d.ts +2 -0
- package/package.json +32 -22
- package/dist/animation/fadeInOut.d.ts +0 -17
- package/dist/components/BackDrop/BackDrop.d.ts +0 -3
- package/dist/components/BackDrop/BackDrop.types.d.ts +0 -5
- package/dist/components/BackDrop/index.d.ts +0 -2
- package/dist/components/Chips/ChipButton/ChipButton.d.ts +0 -3
- package/dist/components/Chips/ChipButton/ChipButton.styled.d.ts +0 -8
- package/dist/components/Chips/ChipButton/ChipButton.types.d.ts +0 -16
- package/dist/components/Chips/ChipButton/index.d.ts +0 -3
- package/dist/components/Chips/ChipToggle/ChipToggle.d.ts +0 -3
- package/dist/components/Chips/ChipToggle/ChipToggle.styled.d.ts +0 -8
- package/dist/components/Chips/ChipToggle/ChipToggle.types.d.ts +0 -16
- package/dist/components/Chips/ChipToggle/index.d.ts +0 -3
- package/dist/components/Chips/index.d.ts +0 -2
- package/dist/components/Modal/Modal.styled.d.ts +0 -28
- package/dist/components/Modal/Modal.types.d.ts +0 -55
- package/dist/components/Modal/ModalBody.d.ts +0 -3
- package/dist/components/Modal/ModalContainer.d.ts +0 -3
- package/dist/components/Modal/ModalFooter.d.ts +0 -3
- package/dist/components/Modal/ModalHeader.d.ts +0 -3
- package/dist/components/Modal/index.d.ts +0 -7
- package/dist/components/Stack/Stack.d.ts +0 -12
- package/dist/components/Stack/Stack.styled.d.ts +0 -6
- package/dist/components/Stack/Stack.types.d.ts +0 -52
- package/dist/components/Stack/index.d.ts +0 -4
- package/dist/components/Text/Text.d.ts +0 -4
- package/dist/components/Text/Text.styled.d.ts +0 -6
- package/dist/components/Text/Text.types.d.ts +0 -23
- package/dist/components/Text/index.d.ts +0 -2
- package/dist/components/index.d.ts +0 -5
- package/dist/hooks/index.d.ts +0 -6
- package/dist/hooks/useDomain.d.ts +0 -6
- package/dist/hooks/useHandleModal.d.ts +0 -5
- package/dist/hooks/useModalStore.d.ts +0 -15
- package/dist/hooks/useModalValue.d.ts +0 -3
- package/dist/hooks/useOnToggle.d.ts +0 -11
- package/dist/hooks/useOutsideClick.d.ts +0 -14
- package/dist/hooks/useResizeObserver.d.ts +0 -9
- package/dist/index.mjs +0 -179
- package/dist/providers/ShoplflowProvider.d.ts +0 -8
- package/dist/providers/index.d.ts +0 -3
- package/dist/styles/index.d.ts +0 -9
- package/dist/styles/tokens.d.ts +0 -100
- package/dist/styles/utils/getDisabledStyle.d.ts +0 -1
- package/dist/types/Domain.d.ts +0 -1
- package/dist/utils/getNextColor.d.ts +0 -11
- package/dist/utils/noop.d.ts +0 -1
- package/dist/utils/type/$values.d.ts +0 -1
- package/dist/utils/type/ComponentProps.d.ts +0 -134
|
@@ -1,7 +0,0 @@
|
|
|
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';
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
|
@@ -1,6 +0,0 @@
|
|
|
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>, {}>;
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
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>, {}>;
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/hooks/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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>>;
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,14 +0,0 @@
|
|
|
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;
|
package/dist/index.mjs
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import w from"react";import{useEffect as z,useState as Mo}from"react";var A=({domain:o="SHOPL"})=>{let[t,e]=Mo(void 0);z(()=>{o&&e(o)},[o]),z(()=>{t&&(document.documentElement.dataset.shoplflow=t?.toLowerCase())},[t])};import S from"react";import{create as ko}from"zustand";var y=ko(o=>({modal:[],addModal:(t,e)=>o(a=>({modal:[...a.modal,{component:t,id:e}]})),removeModal:t=>{let{id:e,deps:a=1}=t||{id:void 0,deps:0},n=!!(e&&String(a)),s=!!e,l=!e&&!a,p=!!String(a)&&!e;if(n)throw new Error("id\uC640 deps\uB294 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");if(s){o(r=>({modal:[...r.modal.filter(c=>c.id!==e)]}));return}if(l||a===1){o(r=>({modal:[...r.modal.slice(0,-1)]}));return}if(p){o(r=>({modal:[...r.modal.slice(0,-a+1)]}));return}}}));var mr=()=>{let o=y(e=>e.addModal),t=y(e=>e.removeModal);return{addModal:o,removeModal:t}};var yr=()=>({modal:y(t=>t.modal)});import{useCallback as vo,useEffect as Co,useRef as Po}from"react";var _o=(o,t)=>{let e=t??Po(null),a=vo(n=>{e.current?.parentNode&&!e.current?.contains(n.target)&&o(n.target)},[e,o]);return Co(()=>{let n=e.current?.parentNode;if(n)return n.addEventListener("click",a),()=>{n.removeEventListener("click",a)}},[e,a]),{ref:e}},N=_o;import{useEffect as Bo,useState as wo}from"react";var X=(o,t={trackWidth:!0,trackHeight:!0})=>{let[e,a]=wo({width:0,height:0});return Bo(()=>{let n=new ResizeObserver(s=>{s.forEach(l=>{if(l.target===o){let{width:p,height:r}=l.contentRect,d={...e};t.trackWidth&&p!==e.width&&(d.width=p),t.trackHeight&&r!==e.height&&(d.height=r),(d.width!==e.width||d.height!==e.height)&&a(d)}})});return n.observe(o),()=>{n.disconnect()}},[o,t.trackWidth,t.trackHeight,e]),e};import Oo from"react";var F={initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}}};import Eo from"@emotion/styled";import{motion as $o}from"framer-motion";var I=Eo($o.div)`
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
position: fixed;
|
|
6
|
-
top: 0;
|
|
7
|
-
left: 0;
|
|
8
|
-
z-index: 20000;
|
|
9
|
-
width: 100%;
|
|
10
|
-
height: 100%;
|
|
11
|
-
background: rgba(51, 51, 51, 0.6);
|
|
12
|
-
`;var Do=({children:o})=>Oo.createElement(I,{variants:F,initial:"initial",animate:"animate",exit:"exit"},o),W=Do;import{createPortal as Lo}from"react-dom";import{AnimatePresence as Ho,motion as Vo}from"framer-motion";import Ro from"@emotion/styled";var zo=Ro(Vo.div)`
|
|
13
|
-
position: relative;
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
justify-content: center;
|
|
17
|
-
flex-grow: 1;
|
|
18
|
-
z-index: 101;
|
|
19
|
-
padding: 32px 20px;
|
|
20
|
-
width: 100%;
|
|
21
|
-
height: 100%;
|
|
22
|
-
`,Ao=()=>{let o=y(t=>t.modal);return S.createElement(S.Fragment,null,Lo(S.createElement(Ho,null,o.map((t,e)=>S.createElement(W,{key:e},S.createElement(zo,null,t.component)))),document.body))},B=Ao;var No=({children:o,domain:t="SHOPL"})=>(A({domain:t}),w.createElement(w.Fragment,null,w.createElement(B,null),o)),Xo=No;var Fo="var(--font-weight-regular)",Io="var(--font-weight-medium)",Wo="var(--font-weight-bold)",Yo={fontWeightRegular:Fo,fontWeightMedium:Io,fontWeightBold:Wo},Ko="var(--border-radius04)",jo="var(--border-radius06)",Uo="var(--border-radius08)",Zo="var(--border-radius12)",Go="var(--border-radius16)",qo="var(--border-radius20)",m={borderRadius04:Ko,borderRadius06:jo,borderRadius08:Uo,borderRadius12:Zo,borderRadius16:Go,borderRadius20:qo},Jo="var(--coolgray300)",Qo="var(--coolgray200)",oe="var(--coolgray100)",ee="var(--coolgray50)",te="var(--navy400)",re="var(--navy300)",ne="var(--neutral0)",ae="var(--neutral100)",ie="var(--neutral150)",pe="var(--neutral200)",se="var(--neutral300)",le="var(--neutral350)",de="var(--neutral400)",ce="var(--neutral500)",me="var(--neutral600)",fe="var(--neutral700)",ue="var(--neutral400_5)",ye="var(--red300)",ge="var(--red200)",he="var(--red100)",xe="var(--ocean300)",Te="var(--ocean200)",Se="var(--ocean100)",be="var(--purple400)",Me="var(--purple300)",ke="var(--purple100)",ve="var(--yellow300)",Ce="var(--yellow200)",Pe="var(--yellow100)",_e="var(--green300)",Be="var(--green200)",we="var(--green100)",Ee="var(--shopl400)",$e="var(--shopl300)",Oe="var(--shopl200)",De="var(--shopl150)",Le="var(--shopl100)",He="var(--hada400)",Ve="var(--hada300)",Re="var(--hada200)",ze="var(--hada150)",Ae="var(--hada100)",Ne="var(--background)",Xe="var(--primary100)",Fe="var(--primary150)",Ie="var(--primary200)",We="var(--primary300)",Ye="var(--primary400)",i={coolgray300:Jo,coolgray200:Qo,coolgray100:oe,coolgray50:ee,navy400:te,navy300:re,neutral0:ne,neutral100:ae,neutral150:ie,neutral200:pe,neutral300:se,neutral350:le,neutral400:de,neutral500:ce,neutral600:me,neutral700:fe,neutral400_5:ue,red300:ye,red200:ge,red100:he,ocean300:xe,ocean200:Te,ocean100:Se,purple400:be,purple300:Me,purple100:ke,yellow300:ve,yellow200:Ce,yellow100:Pe,green300:_e,green200:Be,green100:we,shopl400:Ee,shopl300:$e,shopl200:Oe,shopl150:De,shopl100:Le,hada400:He,hada300:Ve,hada200:Re,hada150:ze,hada100:Ae,background:Ne,primary100:Xe,primary150:Fe,primary200:Ie,primary300:We,primary400:Ye},Ke="var(--spacing04)",je="var(--spacing06)",Ue="var(--spacing08)",Ze="var(--spacing12)",Ge="var(--spacing16)",qe="var(--spacing20)",Je="var(--spacing24)",Qe="var(--spacing30)",ot="var(--spacing32)",et="var(--spacing40)",E={spacing04:Ke,spacing06:je,spacing08:Ue,spacing12:Ze,spacing16:Ge,spacing20:qe,spacing24:Je,spacing30:Qe,spacing32:ot,spacing40:et},tt="var(--dropShadow)",$={dropShadow:tt},rt=".heading1_700",nt=".heading1_400",at=".heading2_700",it=".heading2_400",pt=".heading3_700",st=".heading3_400",lt=".title1_700",dt=".title1_400",ct=".title2_700",mt=".title2_500",ft=".title2_400",ut=".body1_700",yt=".body1_500",gt=".body1_400",ht=".body2_700",xt=".body2_500",Tt=".body2_400",St=".body3_400",bt=".body3_500",Mt=".caption_400",kt={heading1_700:rt,heading1_400:nt,heading2_700:at,heading2_400:it,heading3_700:pt,heading3_400:st,title1_700:lt,title1_400:dt,title2_700:ct,title2_500:mt,title2_400:ft,body1_700:ut,body1_500:yt,body1_400:gt,body2_700:ht,body2_500:xt,body2_400:Tt,body3_400:St,body3_500:bt,caption_400:Mt};import Ct,{forwardRef as Pt}from"react";import{motion as O}from"framer-motion";import vt from"@emotion/styled";var Y=vt.div`
|
|
23
|
-
display: flex;
|
|
24
|
-
width: ${({width:o})=>o};
|
|
25
|
-
height: ${({height:o})=>o};
|
|
26
|
-
flex-direction: ${({direction:o})=>o};
|
|
27
|
-
align-items: ${({align:o})=>o};
|
|
28
|
-
justify-content: ${({justify:o})=>o};
|
|
29
|
-
gap: ${({spacing:o})=>o&&E[o]};
|
|
30
|
-
flex-wrap: ${({flexWrap:o})=>o};
|
|
31
|
-
flex: ${({flex:o})=>o};
|
|
32
|
-
background: ${({background:o})=>o?i[o]:"transparent"};
|
|
33
|
-
border-radius: ${({radius:o})=>o&&m[o]};
|
|
34
|
-
animation: 0.2s all ease-in-out;
|
|
35
|
-
`;var D=o=>Pt(function({as:e="div",spacing:a=o?.spacing??"spacing08",direction:n=o?.direction??"column",align:s=o?.align??"flex-start",justify:l=o?.justify??"flex-start",width:p=o?.width??"initial",height:r=o?.height??"initial",flexWrap:d=o?.flexWrap??"initial",flex:c=o?.flex??"initial",radius:f=o?.radius,background:x=o?.background,...T},u){return Ct.createElement(Y,{as:e,spacing:a,ref:u,direction:n,align:s,justify:l,width:p,height:r,flexWrap:d,flex:c,background:x,radius:f,...T},T.children)}),h=D();h.Vertical=D({direction:"column"});h.Horizontal=D({direction:"row"});var K=O(h);K.Vertical=O(h.Vertical);K.Horizontal=O(h.Horizontal);var _t=h;import Et,{forwardRef as $t}from"react";import{css as k}from"@emotion/react";import Bt from"@emotion/styled";var wt=o=>k`
|
|
36
|
-
display: -webkit-box;
|
|
37
|
-
line-clamp: ${o};
|
|
38
|
-
-webkit-line-clamp: ${o};
|
|
39
|
-
-webkit-box-orient: vertical;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
text-overflow: ellipsis;
|
|
42
|
-
`,j=Bt.span`
|
|
43
|
-
display: ${({display:o})=>o&&o};
|
|
44
|
-
align-items: center;
|
|
45
|
-
color: ${({color:o})=>o&&i[o]};
|
|
46
|
-
${({lineClamp:o})=>o&&wt(o)};
|
|
47
|
-
text-align: ${({textAlign:o})=>o&&o};
|
|
48
|
-
white-space: ${({whiteSpace:o})=>o&&o};
|
|
49
|
-
${({textDecorations:o})=>o&&k`
|
|
50
|
-
text-decoration: ${o};
|
|
51
|
-
`};
|
|
52
|
-
${({opacity:o})=>o&&k`
|
|
53
|
-
opacity: ${o};
|
|
54
|
-
`}
|
|
55
|
-
${({wordBreak:o})=>o&&k`
|
|
56
|
-
word-break: ${o};
|
|
57
|
-
`};
|
|
58
|
-
`;var Ot=$t(({children:o,typography:t="body1_400",whiteSpace:e,color:a="neutral700",display:n="inline-block",textAlign:s="start",className:l,...p},r)=>Et.createElement(j,{ref:r,whiteSpace:e,className:l?`${t} ${l}`:t,color:a,display:n,textAlign:s,...p},o)),b=Ot;import g,{Children as Xt}from"react";import M from"@emotion/styled";import{css as U}from"@emotion/react";var Dt=400,Lt=500,Ht=560,Z=640,Vt=768,Rt=1040,zt=1280,L=o=>{switch(o){case"XXS":return Dt;case"XS":return Lt;case"S":return Ht;case"M":return Z;case"L":return Vt;case"XL":return Rt;case"XXL":return zt;default:return Z}},At=o=>o?U`
|
|
59
|
-
padding-top: 16px;
|
|
60
|
-
padding-bottom: 24px;
|
|
61
|
-
`:U`
|
|
62
|
-
padding-top: 24px;
|
|
63
|
-
padding-bottom: 24px;
|
|
64
|
-
`,G=M.div`
|
|
65
|
-
display: flex;
|
|
66
|
-
flex-direction: column;
|
|
67
|
-
border-radius: ${m.borderRadius08};
|
|
68
|
-
background: ${i.neutral0};
|
|
69
|
-
box-shadow: ${$.dropShadow};
|
|
70
|
-
overflow: hidden;
|
|
71
|
-
flex-grow: 1;
|
|
72
|
-
height: initial;
|
|
73
|
-
height: ${({height:o})=>o}px;
|
|
74
|
-
max-height: 1200px;
|
|
75
|
-
width: ${({sizeVar:o})=>L(o)}px;
|
|
76
|
-
max-width: ${({sizeVar:o})=>L(o)}px;
|
|
77
|
-
`,q=M.div`
|
|
78
|
-
display: flex;
|
|
79
|
-
width: 100%;
|
|
80
|
-
justify-content: space-between;
|
|
81
|
-
align-items: center;
|
|
82
|
-
padding: 12px 16px 12px 24px;
|
|
83
|
-
gap: 10px;
|
|
84
|
-
header: 64px;
|
|
85
|
-
`,J=M.div`
|
|
86
|
-
display: flex;
|
|
87
|
-
width: 100%;
|
|
88
|
-
height: 100%;
|
|
89
|
-
overflow: hidden;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
background: ${i.neutral0};
|
|
92
|
-
min-height: ${({height:o})=>o};
|
|
93
|
-
flex: 1;
|
|
94
|
-
${({isIncludeHeader:o})=>At(o)}
|
|
95
|
-
`,Q=M.div`
|
|
96
|
-
display: flex;
|
|
97
|
-
flex-direction: column;
|
|
98
|
-
width: 100%;
|
|
99
|
-
max-width: ${({sizeVar:o})=>L(o)}px;
|
|
100
|
-
box-sizing: border-box;
|
|
101
|
-
padding: 0 24px;
|
|
102
|
-
overflow: hidden;
|
|
103
|
-
background: ${i.neutral0};
|
|
104
|
-
`,oo=M.div`
|
|
105
|
-
display: flex;
|
|
106
|
-
width: 100%;
|
|
107
|
-
flex-direction: row;
|
|
108
|
-
align-items: center;
|
|
109
|
-
justify-content: flex-end;
|
|
110
|
-
padding: 16px 24px;
|
|
111
|
-
gap: 12px;
|
|
112
|
-
border-top: 1px solid ${i.neutral300};
|
|
113
|
-
background: ${i.neutral0};
|
|
114
|
-
`;var Nt=(p=>(p.XXS="XXS",p.XS="XS",p.S="S",p.M="M",p.L="L",p.XL="XL",p.XXL="XXL",p))(Nt||{}),v=Symbol("MODAL_HEADER"),eo=Symbol("MODAL_BODY"),C=Symbol("MODAL_FOOTER");var to=function(){};var Ft=({children:o,outsideClick:t=to,...e})=>{let a=g.useRef(null);N(t,a);let n=g.Children.toArray(o),s=n.find(r=>{if(!g.isValidElement(r)||r.type[v])return r}),l=n.find(r=>{if(!g.isValidElement(r)||r.type[C])return r}),p=Xt.map(n,r=>g.isValidElement(r)?g.cloneElement(r,{isIncludeHeader:!!s,isIncludeFooter:!!l,sizeVar:e.sizeVar,height:e.height}):r);return g.createElement(G,{ref:a,...e},p)},ro=Ft;import It from"react";var no=({children:o})=>It.createElement(oo,null,o);no[C]=!0;var ao=no;import H,{useCallback as Wt,useMemo as Yt}from"react";import Kt from"react-custom-scrollbars-2";var io=({children:o,isIncludeHeader:t=!1,isIncludeFooter:e=!1,sizeVar:a,height:n})=>{let{height:s}=X(document.body,{trackHeight:!0}),l=64,p=64,r=64,d=Wt(()=>{let u=0;return t&&(u+=l),e&&(u+=p),u},[e,t]),c=Yt(()=>d(),[d]),f=()=>n?n-c:"100%",x=s-r-c,T=1200-r-c;return H.createElement(J,{isIncludeHeader:t,height:f()},H.createElement(Kt,{id:"scrollbar",autoHeight:!n,autoHeightMin:f(),autoHeightMax:s>1200?T:x,autoHide:!0,autoHideTimeout:1e3,autoHideDuration:200,style:{height:"100%",overflow:"hidden"}},H.createElement(Q,{isIncludeHeader:t,sizeVar:a},o)))};io[eo]=!0;var po=io;import jt from"react";var so=({children:o})=>jt.createElement(q,null,o);so[v]=!0;var lo=so;var Qn={Container:ro,Header:lo,Body:po,Footer:ao};import go from"react";import{useEffect as co,useState as Ut}from"react";var mo=(o,t)=>{let[e,a]=Ut(!1),n=o!==void 0,s=()=>{!n&&a(l=>!l)};return co(()=>{n&&a(o)},[n,o]),co(()=>{t&&a(t)},[t,n]),[e,s]};var fo={SOLID:"SOLID"},ia={S:"S",XS:"XS"};import Gt from"@emotion/styled";import{css as V}from"@emotion/react";import{css as Zt}from"@emotion/react";var P=o=>{if(o)return Zt`
|
|
115
|
-
opacity: 50%;
|
|
116
|
-
cursor: not-allowed;
|
|
117
|
-
`};var uo=o=>{switch(o){case"XS":return"body3_400";case"S":return"body2_400";default:return"body2_400"}},qt=({isSelected:o,color:t,radius:e})=>V`
|
|
118
|
-
padding: 7px 12px;
|
|
119
|
-
gap: 4px;
|
|
120
|
-
background: ${i.neutral150};
|
|
121
|
-
border-radius: ${m.borderRadius06};
|
|
122
|
-
& > span {
|
|
123
|
-
color: ${i.neutral400};
|
|
124
|
-
}
|
|
125
|
-
&:hover {
|
|
126
|
-
background: ${i.neutral200};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
${e&&V`
|
|
130
|
-
border-radius: ${m.borderRadius16};
|
|
131
|
-
`};
|
|
132
|
-
${o&&V`
|
|
133
|
-
background: ${i[t]};
|
|
134
|
-
& > span {
|
|
135
|
-
color: ${i.neutral0};
|
|
136
|
-
}
|
|
137
|
-
&:hover {
|
|
138
|
-
background: ${i[t]};
|
|
139
|
-
}
|
|
140
|
-
`};
|
|
141
|
-
`,yo=Gt.button`
|
|
142
|
-
display: flex;
|
|
143
|
-
align-items: center;
|
|
144
|
-
justify-content: center;
|
|
145
|
-
border: none;
|
|
146
|
-
width: fit-content;
|
|
147
|
-
user-select: none;
|
|
148
|
-
cursor: pointer;
|
|
149
|
-
${o=>o.styleVar==="SOLID"&&qt(o)};
|
|
150
|
-
${({disabled:o})=>P(o)};
|
|
151
|
-
`;import{noop as Jt}from"@shoplflow/utils";var Qt=({text:o,isSelected:t,defaultSelected:e,color:a="neutral600",styleVar:n=fo.SOLID,sizeVar:s,leftSource:l,rightSource:p,onClick:r=Jt,disabled:d=!1,...c})=>{let[f,x]=mo(t,e);return go.createElement(yo,{...c,color:a,isSelected:f,styleVar:n,sizeVar:s,onClick:u=>{!d&&x(),!d&&r&&r(u)},disabled:d},l,go.createElement(b,{typography:uo(s)},o),p)},or=Qt;import bo from"react";import er from"@emotion/styled";import{css as _}from"@emotion/react";var R=(o,t=1)=>{let e=o.replace(/[0-9]|_/g,""),a=o.replace(/[a-z]|_/g,""),n=Number(a)+100*t,s=`${e}${n}`,l=Object.keys(i).filter(c=>c.includes(e)).sort((c,f)=>Number(c.replace(/[a-z]|_/g,""))-Number(f.replace(/[a-z]|_/g,""))),r=Object.keys(i).find(c=>c===s),d=l[l.length-1];return r||d};var ho=o=>{switch(o){case"XS":return"caption_400";case"S":return"body3_400";default:return"body3_400"}},tr=({color:o})=>_`
|
|
152
|
-
background: ${i.neutral0};
|
|
153
|
-
border: 1px solid ${i[o]};
|
|
154
|
-
border-radius: ${m.borderRadius20};
|
|
155
|
-
&:hover {
|
|
156
|
-
border: 1px solid ${i[R(o,2)]};
|
|
157
|
-
}
|
|
158
|
-
& > span {
|
|
159
|
-
color: ${i[R(o,4)]};
|
|
160
|
-
}
|
|
161
|
-
`,rr=o=>{switch(o){case"XS":return _`
|
|
162
|
-
padding: 4px 8px;
|
|
163
|
-
`;case"S":return _`
|
|
164
|
-
padding: 7px 12px;
|
|
165
|
-
`;default:return _`
|
|
166
|
-
padding: 7px 12px;
|
|
167
|
-
`}},xo=er.button`
|
|
168
|
-
display: flex;
|
|
169
|
-
align-items: center;
|
|
170
|
-
justify-content: center;
|
|
171
|
-
border: none;
|
|
172
|
-
width: fit-content;
|
|
173
|
-
gap: 4px;
|
|
174
|
-
cursor: pointer;
|
|
175
|
-
background: ${({background:o})=>o&&i[o]};
|
|
176
|
-
${({sizeVar:o})=>rr(o)};
|
|
177
|
-
${o=>o.styleVar==="LINE"&&tr(o)};
|
|
178
|
-
${({disabled:o})=>P(o)};
|
|
179
|
-
`;import{noop as nr}from"@shoplflow/utils";var To={LINE:"LINE"},So={S:"S",XS:"XS"};var ar=({styleVar:o=To.LINE,color:t="neutral200",sizeVar:e=So.S,text:a,onClick:n=nr,disabled:s=!1,...l})=>bo.createElement(xo,{styleVar:o,color:t,...l,onClick:r=>{!s&&n(r)},disabled:s},bo.createElement(b,{typography:ho(e)},a)),ir=ar;export{ir as ChipButton,So as ChipButtonSizeVariants,To as ChipButtonStyleVariants,or as ChipToggle,ia as ChipToggleSizeVariants,fo as ChipToggleStyleVariants,eo as MODAL_BODY_KEY,C as MODAL_FOOTER_KEY,v as MODAL_HEADER_KEY,Qn as Modal,B as ModalProvider,Nt as ModalSize,K as MotionStack,Xo as ShoplflowProvider,_t as Stack,yo as StyledChip,xo as StyledChipButton,Y as StyledStack,b as Text,m as borderRadiusTokens,$ as boxShadowTokens,i as colorTokens,Yo as fontWeightTokens,E as spacingTokens,kt as typographyTokens,A as useDomain,mr as useHandleModal,y as useModalStore,yr as useModalValue,_o as useOutsideClick,X as useResizeObserver};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { DomainType } from '../types/Domain';
|
|
3
|
-
export interface ShoplflowProviderProps {
|
|
4
|
-
domain?: DomainType;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
declare const ShoplflowProvider: ({ children, domain }: ShoplflowProviderProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
8
|
-
export default ShoplflowProvider;
|
package/dist/styles/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { borderRadiusTokens, boxShadowTokens, colorTokens, fontWeightTokens, spacingTokens, typographyTokens } from './tokens';
|
|
2
|
-
type ColorTokens = keyof typeof colorTokens;
|
|
3
|
-
type SpacingTokens = keyof typeof spacingTokens;
|
|
4
|
-
type BorderRadiusTokens = keyof typeof borderRadiusTokens;
|
|
5
|
-
type BoxShadowTokens = keyof typeof boxShadowTokens;
|
|
6
|
-
type FontWeightTokens = keyof typeof fontWeightTokens;
|
|
7
|
-
type TypographyTokens = keyof typeof typographyTokens;
|
|
8
|
-
export type { ColorTokens, SpacingTokens, BorderRadiusTokens, FontWeightTokens, TypographyTokens, BoxShadowTokens };
|
|
9
|
-
export { colorTokens, spacingTokens, fontWeightTokens, borderRadiusTokens, typographyTokens, boxShadowTokens };
|
package/dist/styles/tokens.d.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
export declare const fontWeightTokens: {
|
|
2
|
-
fontWeightRegular: string;
|
|
3
|
-
fontWeightMedium: string;
|
|
4
|
-
fontWeightBold: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const borderRadiusTokens: {
|
|
7
|
-
borderRadius04: string;
|
|
8
|
-
borderRadius06: string;
|
|
9
|
-
borderRadius08: string;
|
|
10
|
-
borderRadius12: string;
|
|
11
|
-
borderRadius16: string;
|
|
12
|
-
borderRadius20: string;
|
|
13
|
-
};
|
|
14
|
-
export declare const colorTokens: {
|
|
15
|
-
coolgray300: string;
|
|
16
|
-
coolgray200: string;
|
|
17
|
-
coolgray100: string;
|
|
18
|
-
coolgray50: string;
|
|
19
|
-
navy400: string;
|
|
20
|
-
navy300: string;
|
|
21
|
-
neutral0: string;
|
|
22
|
-
neutral100: string;
|
|
23
|
-
neutral150: string;
|
|
24
|
-
neutral200: string;
|
|
25
|
-
neutral300: string;
|
|
26
|
-
neutral350: string;
|
|
27
|
-
neutral400: string;
|
|
28
|
-
neutral500: string;
|
|
29
|
-
neutral600: string;
|
|
30
|
-
neutral700: string;
|
|
31
|
-
neutral400_5: string;
|
|
32
|
-
red300: string;
|
|
33
|
-
red200: string;
|
|
34
|
-
red100: string;
|
|
35
|
-
ocean300: string;
|
|
36
|
-
ocean200: string;
|
|
37
|
-
ocean100: string;
|
|
38
|
-
purple400: string;
|
|
39
|
-
purple300: string;
|
|
40
|
-
purple100: string;
|
|
41
|
-
yellow300: string;
|
|
42
|
-
yellow200: string;
|
|
43
|
-
yellow100: string;
|
|
44
|
-
green300: string;
|
|
45
|
-
green200: string;
|
|
46
|
-
green100: string;
|
|
47
|
-
shopl400: string;
|
|
48
|
-
shopl300: string;
|
|
49
|
-
shopl200: string;
|
|
50
|
-
shopl150: string;
|
|
51
|
-
shopl100: string;
|
|
52
|
-
hada400: string;
|
|
53
|
-
hada300: string;
|
|
54
|
-
hada200: string;
|
|
55
|
-
hada150: string;
|
|
56
|
-
hada100: string;
|
|
57
|
-
background: string;
|
|
58
|
-
primary100: string;
|
|
59
|
-
primary150: string;
|
|
60
|
-
primary200: string;
|
|
61
|
-
primary300: string;
|
|
62
|
-
primary400: string;
|
|
63
|
-
};
|
|
64
|
-
export declare const spacingTokens: {
|
|
65
|
-
spacing04: string;
|
|
66
|
-
spacing06: string;
|
|
67
|
-
spacing08: string;
|
|
68
|
-
spacing12: string;
|
|
69
|
-
spacing16: string;
|
|
70
|
-
spacing20: string;
|
|
71
|
-
spacing24: string;
|
|
72
|
-
spacing30: string;
|
|
73
|
-
spacing32: string;
|
|
74
|
-
spacing40: string;
|
|
75
|
-
};
|
|
76
|
-
export declare const boxShadowTokens: {
|
|
77
|
-
dropShadow: string;
|
|
78
|
-
};
|
|
79
|
-
export declare const typographyTokens: {
|
|
80
|
-
heading1_700: string;
|
|
81
|
-
heading1_400: string;
|
|
82
|
-
heading2_700: string;
|
|
83
|
-
heading2_400: string;
|
|
84
|
-
heading3_700: string;
|
|
85
|
-
heading3_400: string;
|
|
86
|
-
title1_700: string;
|
|
87
|
-
title1_400: string;
|
|
88
|
-
title2_700: string;
|
|
89
|
-
title2_500: string;
|
|
90
|
-
title2_400: string;
|
|
91
|
-
body1_700: string;
|
|
92
|
-
body1_500: string;
|
|
93
|
-
body1_400: string;
|
|
94
|
-
body2_700: string;
|
|
95
|
-
body2_500: string;
|
|
96
|
-
body2_400: string;
|
|
97
|
-
body3_400: string;
|
|
98
|
-
body3_500: string;
|
|
99
|
-
caption_400: string;
|
|
100
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getDisabledStyle: (disabled?: boolean) => import("@emotion/react").SerializedStyles | undefined;
|
package/dist/types/Domain.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type DomainType = 'SHOPL' | 'HADA';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ColorTokens } from '../styles';
|
|
2
|
-
/**
|
|
3
|
-
* 인자로 받은 색상의 다음 색상을 반환합니다.
|
|
4
|
-
* step을 통해 다음 색상의 단계를 설정할 수 있습니다.
|
|
5
|
-
* 만약 다음 색상이 없다면 가장 높은 단계의 색상을 반환합니다.
|
|
6
|
-
* 100단위만 반환하며 50, _5와 같이 예외적인 색상은 반환하지 않습니다.
|
|
7
|
-
* @param {ColorTokens} color
|
|
8
|
-
* @param {number} step
|
|
9
|
-
* @return {ColorTokens}
|
|
10
|
-
*/
|
|
11
|
-
export declare const getNextColor: (color: ColorTokens, step?: number) => ColorTokens;
|
package/dist/utils/noop.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const noop: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type $Values<T extends object> = T[keyof T];
|