@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.
- 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/Chips/ChipButton/ChipButton.d.ts +3 -0
- package/dist/components/Chips/ChipButton/ChipButton.styled.d.ts +8 -0
- package/dist/components/Chips/ChipButton/ChipButton.types.d.ts +16 -0
- package/dist/components/Chips/ChipButton/index.d.ts +3 -0
- package/dist/components/Chips/ChipToggle/ChipToggle.d.ts +3 -0
- package/dist/components/Chips/ChipToggle/ChipToggle.styled.d.ts +8 -0
- package/dist/components/Chips/ChipToggle/ChipToggle.types.d.ts +16 -0
- package/dist/components/Chips/ChipToggle/index.d.ts +3 -0
- package/dist/components/Chips/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 +5 -0
- package/dist/{index.css → global.css} +4 -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/useOnToggle.d.ts +11 -0
- package/dist/hooks/useOutsideClick.d.ts +14 -0
- package/dist/hooks/useResizeObserver.d.ts +9 -0
- package/dist/index.cjs +176 -6877
- package/dist/index.d.ts +5 -212
- package/dist/index.mjs +178 -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 +100 -0
- package/dist/styles/utils/getDisabledStyle.d.ts +1 -0
- package/dist/types/Domain.d.ts +1 -0
- package/dist/utils/getNextColor.d.ts +11 -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 +134 -0
- package/package.json +55 -38
- 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
package/dist/index.d.ts
CHANGED
|
@@ -1,212 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import * as _emotion_react from '@emotion/react';
|
|
7
|
-
|
|
8
|
-
type DomainType = 'SHOPL' | 'HADA';
|
|
9
|
-
|
|
10
|
-
interface ShoplflowProviderProps {
|
|
11
|
-
domain?: DomainType;
|
|
12
|
-
children: React__default.ReactNode;
|
|
13
|
-
}
|
|
14
|
-
declare const ShoplflowProvider: ({ children, domain }: ShoplflowProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
15
|
-
|
|
16
|
-
type UseDarkModeProps = {
|
|
17
|
-
domain?: DomainType;
|
|
18
|
-
};
|
|
19
|
-
declare function useDomain({ domain }: UseDarkModeProps): null;
|
|
20
|
-
|
|
21
|
-
declare const fontWeightTokens: {
|
|
22
|
-
fontWeightRegular: string;
|
|
23
|
-
fontWeightMedium: string;
|
|
24
|
-
fontWeightBold: string;
|
|
25
|
-
};
|
|
26
|
-
declare const borderRadiusTokens: {
|
|
27
|
-
borderRadius04: string;
|
|
28
|
-
borderRadius06: string;
|
|
29
|
-
borderRadius08: string;
|
|
30
|
-
borderRadius12: string;
|
|
31
|
-
borderRadius16: string;
|
|
32
|
-
};
|
|
33
|
-
declare const colorTokens: {
|
|
34
|
-
coolgray300: string;
|
|
35
|
-
coolgray200: string;
|
|
36
|
-
coolgray100: string;
|
|
37
|
-
coolgray50: string;
|
|
38
|
-
navy400: string;
|
|
39
|
-
navy300: string;
|
|
40
|
-
neutral0: string;
|
|
41
|
-
neutral100: string;
|
|
42
|
-
neutral150: string;
|
|
43
|
-
neutral200: string;
|
|
44
|
-
neutral300: string;
|
|
45
|
-
neutral350: string;
|
|
46
|
-
neutral400: string;
|
|
47
|
-
neutral500: string;
|
|
48
|
-
neutral600: string;
|
|
49
|
-
neutral700: string;
|
|
50
|
-
neutral400_5: string;
|
|
51
|
-
red300: string;
|
|
52
|
-
red200: string;
|
|
53
|
-
red100: string;
|
|
54
|
-
ocean300: string;
|
|
55
|
-
ocean200: string;
|
|
56
|
-
ocean100: string;
|
|
57
|
-
purple400: string;
|
|
58
|
-
purple300: string;
|
|
59
|
-
purple100: string;
|
|
60
|
-
yellow300: string;
|
|
61
|
-
yellow200: string;
|
|
62
|
-
yellow100: string;
|
|
63
|
-
green300: string;
|
|
64
|
-
green200: string;
|
|
65
|
-
green100: string;
|
|
66
|
-
shopl400: string;
|
|
67
|
-
shopl300: string;
|
|
68
|
-
shopl200: string;
|
|
69
|
-
shopl150: string;
|
|
70
|
-
shopl100: string;
|
|
71
|
-
hada400: string;
|
|
72
|
-
hada300: string;
|
|
73
|
-
hada200: string;
|
|
74
|
-
hada150: string;
|
|
75
|
-
hada100: string;
|
|
76
|
-
background: string;
|
|
77
|
-
primary100: string;
|
|
78
|
-
primary150: string;
|
|
79
|
-
primary200: string;
|
|
80
|
-
primary300: string;
|
|
81
|
-
primary400: string;
|
|
82
|
-
};
|
|
83
|
-
declare const spacingTokens: {
|
|
84
|
-
spacing04: string;
|
|
85
|
-
spacing06: string;
|
|
86
|
-
spacing08: string;
|
|
87
|
-
spacing12: string;
|
|
88
|
-
spacing16: string;
|
|
89
|
-
spacing20: string;
|
|
90
|
-
spacing24: string;
|
|
91
|
-
spacing30: string;
|
|
92
|
-
spacing32: string;
|
|
93
|
-
spacing40: string;
|
|
94
|
-
};
|
|
95
|
-
declare const boxShadowTokens: {
|
|
96
|
-
dropShadow: string;
|
|
97
|
-
};
|
|
98
|
-
declare const typographyTokens: {
|
|
99
|
-
heading1_700: string;
|
|
100
|
-
heading1_400: string;
|
|
101
|
-
heading2_700: string;
|
|
102
|
-
heading2_400: string;
|
|
103
|
-
heading3_700: string;
|
|
104
|
-
heading3_400: string;
|
|
105
|
-
title1_700: string;
|
|
106
|
-
title1_400: string;
|
|
107
|
-
title2_700: string;
|
|
108
|
-
title2_500: string;
|
|
109
|
-
title2_400: string;
|
|
110
|
-
body1_700: string;
|
|
111
|
-
body1_500: string;
|
|
112
|
-
body1_400: string;
|
|
113
|
-
body2_700: string;
|
|
114
|
-
body2_500: string;
|
|
115
|
-
body2_400: string;
|
|
116
|
-
body3_400: string;
|
|
117
|
-
body3_500: string;
|
|
118
|
-
caption_400: string;
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
type ColorTokens = keyof typeof colorTokens;
|
|
122
|
-
type SpacingTokens = keyof typeof spacingTokens;
|
|
123
|
-
type BorderRadiusTokens = keyof typeof borderRadiusTokens;
|
|
124
|
-
type BoxShadowTokens = keyof typeof boxShadowTokens;
|
|
125
|
-
type FontWeightTokens = keyof typeof fontWeightTokens;
|
|
126
|
-
type TypographyTokens = keyof typeof typographyTokens;
|
|
127
|
-
|
|
128
|
-
type StringElementType = ElementType & string;
|
|
129
|
-
type HTMLPropsWithOutRef<T extends StringElementType> = ComponentPropsWithoutRef<T>;
|
|
130
|
-
type RenderConfigProps = {
|
|
131
|
-
/**
|
|
132
|
-
* 랜더하려고 하는 HTML tag로 변환할 수 있습니다.
|
|
133
|
-
*
|
|
134
|
-
* 예를 들어 a tag로 변환한다면 as='a'로 작성해주세요.
|
|
135
|
-
*
|
|
136
|
-
* @see https://emotion.sh/docs/styled#as-prop
|
|
137
|
-
*/
|
|
138
|
-
as?: StringElementType;
|
|
139
|
-
};
|
|
140
|
-
interface ChildrenProps<Children = React__default.ReactNode> {
|
|
141
|
-
/**
|
|
142
|
-
* 컴포넌트 내부에 들어갈 children을 설정합니다.
|
|
143
|
-
*/
|
|
144
|
-
children?: Children;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
type StackGenericProps<T extends StringElementType = 'div'> = RenderConfigProps & StackProps & HTMLPropsWithOutRef<T>;
|
|
148
|
-
type StackComponentType = <T extends StringElementType = 'div'>(props: StackGenericProps<T> & Pick<ComponentPropsWithRef<T>, 'ref'>) => ReactElement | null;
|
|
149
|
-
type MotionStackComponentType<T extends StringElementType = 'div'> = CustomDomComponent<RenderConfigProps & HTMLPropsWithOutRef<T> & StackProps>;
|
|
150
|
-
interface StackProps extends StackOptionProps, ChildrenProps {
|
|
151
|
-
}
|
|
152
|
-
interface StackOptionProps {
|
|
153
|
-
/**
|
|
154
|
-
* 요소들의 align-items 값
|
|
155
|
-
*/
|
|
156
|
-
align?: CSSProperties['alignItems'];
|
|
157
|
-
/**
|
|
158
|
-
* 요소들의 justify-content 값
|
|
159
|
-
*/
|
|
160
|
-
justify?: CSSProperties['justifyContent'];
|
|
161
|
-
/**
|
|
162
|
-
* 요소들의 flex-direction 값
|
|
163
|
-
* (값: row, column)
|
|
164
|
-
*/
|
|
165
|
-
direction?: CSSProperties['flexDirection'];
|
|
166
|
-
/**
|
|
167
|
-
* 요소들 사이의 간격
|
|
168
|
-
*/
|
|
169
|
-
spacing?: SpacingTokens;
|
|
170
|
-
/**
|
|
171
|
-
* flex-wrap 설정
|
|
172
|
-
*/
|
|
173
|
-
flexWrap?: CSSProperties['flexWrap'];
|
|
174
|
-
/**
|
|
175
|
-
* width 설정
|
|
176
|
-
*/
|
|
177
|
-
width?: CSSProperties['width'];
|
|
178
|
-
/**
|
|
179
|
-
* height 설정
|
|
180
|
-
*/
|
|
181
|
-
height?: CSSProperties['height'];
|
|
182
|
-
/**
|
|
183
|
-
* flex 설정
|
|
184
|
-
*/
|
|
185
|
-
flex?: CSSProperties['flex'];
|
|
186
|
-
/**
|
|
187
|
-
* background 설정
|
|
188
|
-
*/
|
|
189
|
-
background?: ColorTokens;
|
|
190
|
-
/**
|
|
191
|
-
* border-radius 설정
|
|
192
|
-
*/
|
|
193
|
-
radius?: BorderRadiusTokens;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
interface StackType extends StackComponentType {
|
|
197
|
-
Vertical: StackComponentType;
|
|
198
|
-
Horizontal: StackComponentType;
|
|
199
|
-
}
|
|
200
|
-
declare const Stack: StackType;
|
|
201
|
-
interface MotionStackType extends MotionStackComponentType {
|
|
202
|
-
Vertical: MotionStackComponentType;
|
|
203
|
-
Horizontal: MotionStackComponentType;
|
|
204
|
-
}
|
|
205
|
-
declare const MotionStack: MotionStackType;
|
|
206
|
-
|
|
207
|
-
declare const StyledStack: _emotion_styled.StyledComponent<{
|
|
208
|
-
theme?: _emotion_react.Theme | undefined;
|
|
209
|
-
as?: React.ElementType<any> | undefined;
|
|
210
|
-
} & StackOptionProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
211
|
-
|
|
212
|
-
export { BorderRadiusTokens, BoxShadowTokens, ColorTokens, FontWeightTokens, MotionStack, MotionStackComponentType, ShoplflowProvider, ShoplflowProviderProps, SpacingTokens, Stack, StackComponentType, StackGenericProps, StackOptionProps, StackProps, StyledStack, TypographyTokens, borderRadiusTokens, colorTokens, fontWeightTokens, spacingTokens, typographyTokens, useDomain };
|
|
1
|
+
export * from './providers';
|
|
2
|
+
export * from './hooks';
|
|
3
|
+
export * from './styles';
|
|
4
|
+
export * from './providers';
|
|
5
|
+
export * from './components';
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
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: 1000;
|
|
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="inherit",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
|
+
`,J=M.div`
|
|
85
|
+
display: flex;
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: 100%;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
background: ${i.neutral0};
|
|
91
|
+
min-height: ${({height:o})=>o};
|
|
92
|
+
flex: 1;
|
|
93
|
+
${({isIncludeHeader:o})=>At(o)}
|
|
94
|
+
`,Q=M.div`
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
width: 100%;
|
|
98
|
+
max-width: ${({sizeVar:o})=>L(o)}px;
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
padding: 0 24px;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
background: ${i.neutral0};
|
|
103
|
+
`,oo=M.div`
|
|
104
|
+
display: flex;
|
|
105
|
+
width: 100%;
|
|
106
|
+
flex-direction: row;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: flex-end;
|
|
109
|
+
padding: 16px 24px;
|
|
110
|
+
gap: 12px;
|
|
111
|
+
border-top: 1px solid ${i.neutral300};
|
|
112
|
+
background: ${i.neutral0};
|
|
113
|
+
`;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`
|
|
114
|
+
opacity: 50%;
|
|
115
|
+
cursor: not-allowed;
|
|
116
|
+
`};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`
|
|
117
|
+
padding: 7px 12px;
|
|
118
|
+
gap: 4px;
|
|
119
|
+
background: ${i.neutral150};
|
|
120
|
+
border-radius: ${m.borderRadius06};
|
|
121
|
+
& > span {
|
|
122
|
+
color: ${i.neutral400};
|
|
123
|
+
}
|
|
124
|
+
&:hover {
|
|
125
|
+
background: ${i.neutral200};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
${e&&V`
|
|
129
|
+
border-radius: ${m.borderRadius16};
|
|
130
|
+
`};
|
|
131
|
+
${o&&V`
|
|
132
|
+
background: ${i[t]};
|
|
133
|
+
& > span {
|
|
134
|
+
color: ${i.neutral0};
|
|
135
|
+
}
|
|
136
|
+
&:hover {
|
|
137
|
+
background: ${i[t]};
|
|
138
|
+
}
|
|
139
|
+
`};
|
|
140
|
+
`,yo=Gt.button`
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
border: none;
|
|
145
|
+
width: fit-content;
|
|
146
|
+
user-select: none;
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
${o=>o.styleVar==="SOLID"&&qt(o)};
|
|
149
|
+
${({disabled:o})=>P(o)};
|
|
150
|
+
`;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})=>_`
|
|
151
|
+
background: ${i.neutral0};
|
|
152
|
+
border: 1px solid ${i[o]};
|
|
153
|
+
border-radius: ${m.borderRadius20};
|
|
154
|
+
&:hover {
|
|
155
|
+
border: 1px solid ${i[R(o,2)]};
|
|
156
|
+
}
|
|
157
|
+
& > span {
|
|
158
|
+
color: ${i[R(o,4)]};
|
|
159
|
+
}
|
|
160
|
+
`,rr=o=>{switch(o){case"XS":return _`
|
|
161
|
+
padding: 4px 8px;
|
|
162
|
+
`;case"S":return _`
|
|
163
|
+
padding: 7px 12px;
|
|
164
|
+
`;default:return _`
|
|
165
|
+
padding: 7px 12px;
|
|
166
|
+
`}},xo=er.button`
|
|
167
|
+
display: flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
border: none;
|
|
171
|
+
width: fit-content;
|
|
172
|
+
gap: 4px;
|
|
173
|
+
cursor: pointer;
|
|
174
|
+
background: ${({background:o})=>o&&i[o]};
|
|
175
|
+
${({sizeVar:o})=>rr(o)};
|
|
176
|
+
${o=>o.styleVar==="LINE"&&tr(o)};
|
|
177
|
+
${({disabled:o})=>P(o)};
|
|
178
|
+
`;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};
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 };
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getDisabledStyle: (disabled?: boolean) => import("@emotion/react").SerializedStyles | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type DomainType = 'SHOPL' | 'HADA';
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const noop: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type $Values<T extends object> = T[keyof T];
|