@shoplflow/base 0.4.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.
Files changed (51) 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/Modal/Modal.styled.d.ts +28 -0
  6. package/dist/components/Modal/Modal.types.d.ts +55 -0
  7. package/dist/components/Modal/ModalBody.d.ts +3 -0
  8. package/dist/components/Modal/ModalContainer.d.ts +3 -0
  9. package/dist/components/Modal/ModalFooter.d.ts +3 -0
  10. package/dist/components/Modal/ModalHeader.d.ts +3 -0
  11. package/dist/components/Modal/index.d.ts +7 -0
  12. package/dist/components/Stack/Stack.d.ts +12 -0
  13. package/dist/components/Stack/Stack.styled.d.ts +6 -0
  14. package/dist/components/Stack/Stack.types.d.ts +52 -0
  15. package/dist/components/Stack/index.d.ts +4 -0
  16. package/dist/components/Text/Text.d.ts +4 -0
  17. package/dist/components/Text/Text.styled.d.ts +6 -0
  18. package/dist/components/Text/Text.types.d.ts +23 -0
  19. package/dist/components/Text/index.d.ts +2 -0
  20. package/dist/components/index.d.ts +4 -0
  21. package/dist/{index.css → global.css} +3 -2
  22. package/dist/hooks/index.d.ts +6 -0
  23. package/dist/hooks/useDomain.d.ts +6 -0
  24. package/dist/hooks/useHandleModal.d.ts +5 -0
  25. package/dist/hooks/useModalStore.d.ts +15 -0
  26. package/dist/hooks/useModalValue.d.ts +3 -0
  27. package/dist/hooks/useOutsideClick.d.ts +14 -0
  28. package/dist/hooks/useResizeObserver.d.ts +9 -0
  29. package/dist/index.cjs +110 -6877
  30. package/dist/index.d.ts +5 -212
  31. package/dist/index.mjs +112 -0
  32. package/dist/providers/ShoplflowProvider.d.ts +8 -0
  33. package/dist/providers/index.d.ts +3 -0
  34. package/dist/styles/index.d.ts +9 -0
  35. package/dist/styles/tokens.d.ts +99 -0
  36. package/dist/types/Domain.d.ts +1 -0
  37. package/dist/utils/noop.d.ts +1 -0
  38. package/dist/utils/type/$values.d.ts +1 -0
  39. package/dist/utils/type/ComponentProps.d.ts +91 -0
  40. package/package.json +52 -37
  41. package/dist/emotion.d.cjs +0 -5
  42. package/dist/emotion.d.cjs.map +0 -1
  43. package/dist/emotion.d.d.cts +0 -5
  44. package/dist/emotion.d.d.ts +0 -5
  45. package/dist/emotion.d.js +0 -3
  46. package/dist/emotion.d.js.map +0 -1
  47. package/dist/index.cjs.map +0 -1
  48. package/dist/index.css.map +0 -1
  49. package/dist/index.d.cts +0 -212
  50. package/dist/index.js +0 -6851
  51. package/dist/index.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,212 +1,5 @@
1
- import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
2
- import * as React from 'react';
3
- import React__default, { ElementType, ComponentPropsWithoutRef, ComponentPropsWithRef, ReactElement, CSSProperties } from 'react';
4
- import { CustomDomComponent } from 'framer-motion';
5
- import * as _emotion_styled from '@emotion/styled';
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,112 @@
1
+ import{useEffect as E,useState as no}from"react";var O=({domain:o="SHOPL"})=>{let[t,e]=no(void 0);E(()=>{o&&e(o)},[o]),E(()=>{t&&(document.documentElement.dataset.shoplflow=t?.toLowerCase())},[t])};import{create as ao}from"zustand";var m=ao(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)),p=!!e,s=!e&&!a,i=!!String(a)&&!e;if(n)throw new Error("id\uC640 deps\uB294 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");if(p){o(r=>({modal:[...r.modal.filter(l=>l.id!==e)]}));return}if(s||a===1){o(r=>({modal:[...r.modal.slice(0,-1)]}));return}if(i){o(r=>({modal:[...r.modal.slice(0,-a+1)]}));return}}}));var Vt=()=>{let o=m(e=>e.addModal),t=m(e=>e.removeModal);return{addModal:o,removeModal:t}};var Nt=()=>({modal:m(t=>t.modal)});import{useCallback as io,useEffect as po,useRef as so}from"react";var co=(o,t)=>{let e=t??so(null),a=io(n=>{e.current?.parentNode&&!e.current?.contains(n.target)&&o(n.target)},[e,o]);return po(()=>{let n=e.current?.parentNode;if(n)return n.addEventListener("click",a),()=>{n.removeEventListener("click",a)}},[e,a]),{ref:e}},B=co;import{useEffect as lo,useState as mo}from"react";var L=(o,t={trackWidth:!0,trackHeight:!0})=>{let[e,a]=mo({width:0,height:0});return lo(()=>{let n=new ResizeObserver(p=>{p.forEach(s=>{if(s.target===o){let{width:i,height:r}=s.contentRect,d={...e};t.trackWidth&&i!==e.width&&(d.width=i),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};var $={initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}}};import fo from"@emotion/styled";import{motion as yo}from"framer-motion";var A=fo(yo.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
+ `;import{jsx as ho}from"@emotion/react/jsx-runtime";var uo=({children:o})=>ho(A,{variants:$,initial:"initial",animate:"animate",exit:"exit",children:o}),F=uo;import{createPortal as xo}from"react-dom";import{AnimatePresence as go,motion as Mo}from"framer-motion";import vo from"@emotion/styled";import{Fragment as So,jsx as v}from"@emotion/react/jsx-runtime";var To=vo(Mo.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
+ `,ko=()=>{let o=m(t=>t.modal);return v(So,{children:xo(v(go,{children:o.map((t,e)=>v(F,{children:v(To,{children:t.component})},e))}),document.body)})},_=ko;import{Fragment as wo,jsx as Po,jsxs as Ro}from"@emotion/react/jsx-runtime";var bo=({children:o,domain:t="SHOPL"})=>(O({domain:t}),Ro(wo,{children:[Po(_,{}),o]})),_o=bo;var Ho="var(--font-weight-regular)",Co="var(--font-weight-medium)",Do="var(--font-weight-bold)",Eo={fontWeightRegular:Ho,fontWeightMedium:Co,fontWeightBold:Do},Oo="var(--border-radius04)",Bo="var(--border-radius06)",Lo="var(--border-radius08)",$o="var(--border-radius12)",Ao="var(--border-radius16)",h={borderRadius04:Oo,borderRadius06:Bo,borderRadius08:Lo,borderRadius12:$o,borderRadius16:Ao},Fo="var(--coolgray300)",zo="var(--coolgray200)",Xo="var(--coolgray100)",Vo="var(--coolgray50)",Io="var(--navy400)",Wo="var(--navy300)",No="var(--neutral0)",Yo="var(--neutral100)",Ko="var(--neutral150)",Zo="var(--neutral200)",Uo="var(--neutral300)",Go="var(--neutral350)",qo="var(--neutral400)",Jo="var(--neutral500)",Qo="var(--neutral600)",jo="var(--neutral700)",oe="var(--neutral400_5)",ee="var(--red300)",te="var(--red200)",re="var(--red100)",ne="var(--ocean300)",ae="var(--ocean200)",ie="var(--ocean100)",pe="var(--purple400)",se="var(--purple300)",de="var(--purple100)",ce="var(--yellow300)",le="var(--yellow200)",me="var(--yellow100)",fe="var(--green300)",ye="var(--green200)",ue="var(--green100)",he="var(--shopl400)",xe="var(--shopl300)",ge="var(--shopl200)",Me="var(--shopl150)",ve="var(--shopl100)",Te="var(--hada400)",ke="var(--hada300)",Se="var(--hada200)",be="var(--hada150)",_e="var(--hada100)",Pe="var(--background)",we="var(--primary100)",Re="var(--primary150)",He="var(--primary200)",Ce="var(--primary300)",De="var(--primary400)",c={coolgray300:Fo,coolgray200:zo,coolgray100:Xo,coolgray50:Vo,navy400:Io,navy300:Wo,neutral0:No,neutral100:Yo,neutral150:Ko,neutral200:Zo,neutral300:Uo,neutral350:Go,neutral400:qo,neutral500:Jo,neutral600:Qo,neutral700:jo,neutral400_5:oe,red300:ee,red200:te,red100:re,ocean300:ne,ocean200:ae,ocean100:ie,purple400:pe,purple300:se,purple100:de,yellow300:ce,yellow200:le,yellow100:me,green300:fe,green200:ye,green100:ue,shopl400:he,shopl300:xe,shopl200:ge,shopl150:Me,shopl100:ve,hada400:Te,hada300:ke,hada200:Se,hada150:be,hada100:_e,background:Pe,primary100:we,primary150:Re,primary200:He,primary300:Ce,primary400:De},Ee="var(--spacing04)",Oe="var(--spacing06)",Be="var(--spacing08)",Le="var(--spacing12)",$e="var(--spacing16)",Ae="var(--spacing20)",Fe="var(--spacing24)",ze="var(--spacing30)",Xe="var(--spacing32)",Ve="var(--spacing40)",P={spacing04:Ee,spacing06:Oe,spacing08:Be,spacing12:Le,spacing16:$e,spacing20:Ae,spacing24:Fe,spacing30:ze,spacing32:Xe,spacing40:Ve},Ie="var(--dropShadow)",w={dropShadow:Ie},We=".heading1_700",Ne=".heading1_400",Ye=".heading2_700",Ke=".heading2_400",Ze=".heading3_700",Ue=".heading3_400",Ge=".title1_700",qe=".title1_400",Je=".title2_700",Qe=".title2_500",je=".title2_400",ot=".body1_700",et=".body1_500",tt=".body1_400",rt=".body2_700",nt=".body2_500",at=".body2_400",it=".body3_400",pt=".body3_500",st=".caption_400",dt={heading1_700:We,heading1_400:Ne,heading2_700:Ye,heading2_400:Ke,heading3_700:Ze,heading3_400:Ue,title1_700:Ge,title1_400:qe,title2_700:Je,title2_500:Qe,title2_400:je,body1_700:ot,body1_500:et,body1_400:tt,body2_700:rt,body2_500:nt,body2_400:at,body3_400:it,body3_500:pt,caption_400:st};import{forwardRef as lt}from"react";import{motion as R}from"framer-motion";import ct from"@emotion/styled";var z=ct.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&&P[o]};
30
+ flex-wrap: ${({flexWrap:o})=>o};
31
+ flex: ${({flex:o})=>o};
32
+ background: ${({background:o})=>o?c[o]:"transparent"};
33
+ border-radius: ${({radius:o})=>o&&h[o]};
34
+ animation: 0.2s all ease-in-out;
35
+ `;import{jsx as ft}from"@emotion/react/jsx-runtime";var H=o=>lt(function({as:e="div",spacing:a=o?.spacing??"spacing08",direction:n=o?.direction??"column",align:p=o?.align??"flex-start",justify:s=o?.justify??"flex-start",width:i=o?.width??"initial",height:r=o?.height??"initial",flexWrap:d=o?.flexWrap??"initial",flex:l=o?.flex??"initial",radius:g=o?.radius,background:b=o?.background,...M},u){return ft(z,{as:e,spacing:a,ref:u,direction:n,align:p,justify:s,width:i,height:r,flexWrap:d,flex:l,background:b,radius:g,...M,children:M.children})}),f=H();f.Vertical=H({direction:"column"});f.Horizontal=H({direction:"row"});var X=R(f);X.Vertical=R(f.Vertical);X.Horizontal=R(f.Horizontal);var mt=f;import{forwardRef as ht}from"react";import{css as T}from"@emotion/react";import yt from"@emotion/styled";var ut=o=>T`
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
+ `,V=yt.span`
43
+ display: ${({display:o})=>o&&o};
44
+ align-items: center;
45
+ color: ${({color:o})=>o&&c[o]};
46
+ ${({lineClamp:o})=>o&&ut(o)};
47
+ text-align: ${({textAlign:o})=>o&&o};
48
+ white-space: ${({whiteSpace:o})=>o&&o};
49
+ ${({textDecorations:o})=>o&&T`
50
+ text-decoration: ${o};
51
+ `};
52
+ ${({opacity:o})=>o&&T`
53
+ opacity: ${o};
54
+ `}
55
+ ${({wordBreak:o})=>o&&T`
56
+ word-break: ${o};
57
+ `};
58
+ `;import{jsx as Mt}from"@emotion/react/jsx-runtime";var xt=ht(({children:o,typography:t="body1_400",whiteSpace:e,color:a="neutral700",display:n="inline-block",textAlign:p="inherit",className:s,...i},r)=>Mt(V,{ref:r,whiteSpace:e,className:s?`${t} ${s}`:t,color:a,display:n,textAlign:p,...i,children:o})),gt=xt;import y,{Children as Rt}from"react";import x from"@emotion/styled";import{css as I}from"@emotion/react";var vt=400,Tt=500,kt=560,W=640,St=768,bt=1040,_t=1280,C=o=>{switch(o){case"XXS":return vt;case"XS":return Tt;case"S":return kt;case"M":return W;case"L":return St;case"XL":return bt;case"XXL":return _t;default:return W}},Pt=o=>o?I`
59
+ padding-top: 16px;
60
+ padding-bottom: 24px;
61
+ `:I`
62
+ padding-top: 24px;
63
+ padding-bottom: 24px;
64
+ `,N=x.div`
65
+ display: flex;
66
+ flex-direction: column;
67
+ border-radius: ${h.borderRadius08};
68
+ background: ${c.neutral0};
69
+ box-shadow: ${w.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})=>C(o)}px;
76
+ max-width: ${({sizeVar:o})=>C(o)}px;
77
+ `,Y=x.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
+ `,K=x.div`
85
+ display: flex;
86
+ width: 100%;
87
+ height: 100%;
88
+ overflow: hidden;
89
+ flex-direction: column;
90
+ background: ${c.neutral0};
91
+ min-height: ${({height:o})=>o};
92
+ flex: 1;
93
+ ${({isIncludeHeader:o})=>Pt(o)}
94
+ `,Z=x.div`
95
+ display: flex;
96
+ flex-direction: column;
97
+ width: 100%;
98
+ max-width: ${({sizeVar:o})=>C(o)}px;
99
+ box-sizing: border-box;
100
+ padding: 0 24px;
101
+ overflow: hidden;
102
+ background: ${c.neutral0};
103
+ `,U=x.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
+ background: ${c.neutral0};
112
+ `;var wt=(i=>(i.XXS="XXS",i.XS="XS",i.S="S",i.M="M",i.L="L",i.XL="XL",i.XXL="XXL",i))(wt||{}),k=Symbol("MODAL_HEADER"),G=Symbol("MODAL_BODY"),S=Symbol("MODAL_FOOTER");var q=function(){};import{jsx as Ct}from"@emotion/react/jsx-runtime";var Ht=({children:o,outsideClick:t=q,...e})=>{let a=y.useRef(null);B(t,a);let n=y.Children.toArray(o),p=n.find(r=>{if(!y.isValidElement(r)||r.type[k])return r}),s=n.find(r=>{if(!y.isValidElement(r)||r.type[S])return r}),i=Rt.map(n,r=>y.isValidElement(r)?y.cloneElement(r,{isIncludeHeader:!!p,isIncludeFooter:!!s,sizeVar:e.sizeVar,height:e.height}):r);return Ct(N,{ref:a,...e,children:i})},J=Ht;import{jsx as Dt}from"@emotion/react/jsx-runtime";var Q=({children:o})=>Dt(U,{children:o});Q[S]=!0;var j=Q;import{useCallback as Et,useMemo as Ot}from"react";import Bt from"react-custom-scrollbars-2";import{jsx as D}from"@emotion/react/jsx-runtime";var oo=({children:o,isIncludeHeader:t=!1,isIncludeFooter:e=!1,sizeVar:a,height:n})=>{let{height:p}=L(document.body,{trackHeight:!0}),s=64,i=64,r=64,d=Et(()=>{let u=0;return t&&(u+=s),e&&(u+=i),u},[e,t]),l=Ot(()=>d(),[d]),g=()=>n?n-l:"100%",b=p-r-l,M=1200-r-l;return D(K,{isIncludeHeader:t,height:g(),children:D(Bt,{id:"scrollbar",autoHeight:!n,autoHeightMin:g(),autoHeightMax:p>1200?M:b,autoHide:!0,autoHideTimeout:1e3,autoHideDuration:200,style:{height:"100%",overflow:"hidden"},children:D(Z,{isIncludeHeader:t,sizeVar:a,children:o})})})};oo[G]=!0;var eo=oo;import{jsx as Lt}from"@emotion/react/jsx-runtime";var to=({children:o})=>Lt(Y,{children:o});to[k]=!0;var ro=to;var Ln={Container:J,Header:ro,Body:eo,Footer:j};export{G as MODAL_BODY_KEY,S as MODAL_FOOTER_KEY,k as MODAL_HEADER_KEY,Ln as Modal,_ as ModalProvider,wt as ModalSize,X as MotionStack,_o as ShoplflowProvider,mt as Stack,z as StyledStack,gt as Text,h as borderRadiusTokens,w as boxShadowTokens,c as colorTokens,Eo as fontWeightTokens,P as spacingTokens,dt as typographyTokens,O as useDomain,Vt as useHandleModal,m as useModalStore,Nt as useModalValue,co as useOutsideClick,L 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,3 @@
1
+ export { default as ShoplflowProvider } from './ShoplflowProvider';
2
+ export type { ShoplflowProviderProps } from './ShoplflowProvider';
3
+ export { default as ModalProvider } from '../portal/ModalPortal';
@@ -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,99 @@
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
+ };
13
+ export declare const colorTokens: {
14
+ coolgray300: string;
15
+ coolgray200: string;
16
+ coolgray100: string;
17
+ coolgray50: string;
18
+ navy400: string;
19
+ navy300: string;
20
+ neutral0: string;
21
+ neutral100: string;
22
+ neutral150: string;
23
+ neutral200: string;
24
+ neutral300: string;
25
+ neutral350: string;
26
+ neutral400: string;
27
+ neutral500: string;
28
+ neutral600: string;
29
+ neutral700: string;
30
+ neutral400_5: string;
31
+ red300: string;
32
+ red200: string;
33
+ red100: string;
34
+ ocean300: string;
35
+ ocean200: string;
36
+ ocean100: string;
37
+ purple400: string;
38
+ purple300: string;
39
+ purple100: string;
40
+ yellow300: string;
41
+ yellow200: string;
42
+ yellow100: string;
43
+ green300: string;
44
+ green200: string;
45
+ green100: string;
46
+ shopl400: string;
47
+ shopl300: string;
48
+ shopl200: string;
49
+ shopl150: string;
50
+ shopl100: string;
51
+ hada400: string;
52
+ hada300: string;
53
+ hada200: string;
54
+ hada150: string;
55
+ hada100: string;
56
+ background: string;
57
+ primary100: string;
58
+ primary150: string;
59
+ primary200: string;
60
+ primary300: string;
61
+ primary400: string;
62
+ };
63
+ export declare const spacingTokens: {
64
+ spacing04: string;
65
+ spacing06: string;
66
+ spacing08: string;
67
+ spacing12: string;
68
+ spacing16: string;
69
+ spacing20: string;
70
+ spacing24: string;
71
+ spacing30: string;
72
+ spacing32: string;
73
+ spacing40: string;
74
+ };
75
+ export declare const boxShadowTokens: {
76
+ dropShadow: string;
77
+ };
78
+ export declare const typographyTokens: {
79
+ heading1_700: string;
80
+ heading1_400: string;
81
+ heading2_700: string;
82
+ heading2_400: string;
83
+ heading3_700: string;
84
+ heading3_400: string;
85
+ title1_700: string;
86
+ title1_400: string;
87
+ title2_700: string;
88
+ title2_500: string;
89
+ title2_400: string;
90
+ body1_700: string;
91
+ body1_500: string;
92
+ body1_400: string;
93
+ body2_700: string;
94
+ body2_500: string;
95
+ body2_400: string;
96
+ body3_400: string;
97
+ body3_500: string;
98
+ caption_400: string;
99
+ };
@@ -0,0 +1 @@
1
+ export type DomainType = 'SHOPL' | 'HADA';
@@ -0,0 +1 @@
1
+ export declare const noop: () => void;
@@ -0,0 +1 @@
1
+ export type $Values<T extends object> = T[keyof T];
@@ -0,0 +1,91 @@
1
+ import type { ComponentPropsWithoutRef, ElementType, ReactElement, ReactNode } from 'react';
2
+ import type React from 'react';
3
+ import type { ColorTokens } from '../../styles';
4
+ export type StringElementType = ElementType & string;
5
+ export type HTMLPropsWithOutRef<T extends StringElementType> = ComponentPropsWithoutRef<T>;
6
+ export type RenderConfigProps = {
7
+ /**
8
+ * 랜더하려고 하는 HTML tag로 변환할 수 있습니다.
9
+ *
10
+ * 예를 들어 a tag로 변환한다면 as='a'로 작성해주세요.
11
+ *
12
+ * @see https://emotion.sh/docs/styled#as-prop
13
+ */
14
+ as?: StringElementType;
15
+ };
16
+ export interface SizeVariantProps<Size> {
17
+ /**
18
+ * 컴포넌트의 크기를 설정합니다.
19
+ */
20
+ sizeVar?: Size;
21
+ }
22
+ export interface StyleVariantProps<Style> {
23
+ /**
24
+ * 컴포넌트의 스타일을 설정합니다.
25
+ */
26
+ styleVar?: Style;
27
+ }
28
+ export interface ChildrenProps<Children = React.ReactNode> {
29
+ /**
30
+ * 컴포넌트 내부에 들어갈 children을 설정합니다.
31
+ */
32
+ children?: Children;
33
+ }
34
+ export interface DisableProps {
35
+ /**
36
+ * 비활성화 여부를 설정합니다.
37
+ */
38
+ disabled?: boolean;
39
+ }
40
+ export interface ColorTokenProps {
41
+ /**
42
+ * 텍스트 혹은 아이콘의 색상을 설정합니다.
43
+ */
44
+ color?: ColorTokens;
45
+ }
46
+ export interface BorderColorProps {
47
+ /**
48
+ * 테두리의 색상을 설정합니다.
49
+ */
50
+ borderColor?: ColorTokens;
51
+ }
52
+ export interface BackgroundColorProps {
53
+ /**
54
+ * 배경의 색상을 설정합니다.
55
+ */
56
+ background?: ColorTokens;
57
+ }
58
+ export interface IconSourceProps {
59
+ /**
60
+ * Icon을 설정합니다.
61
+ */
62
+ iconSource?: HTMLOrSVGElement;
63
+ }
64
+ export interface LeftNodeProps {
65
+ /**
66
+ * 텍스트를 기준으로 왼쪽에 위치할 ReactNode를 설정합니다.
67
+ */
68
+ leftSource?: ReactNode;
69
+ }
70
+ export interface RightNodeProps {
71
+ /**
72
+ * 텍스트를 기준으로 오른쪽에 위치할 ReactNode를 설정합니다.
73
+ */
74
+ rightSource?: ReactNode;
75
+ }
76
+ export interface LeftAndRightNodeProps extends RightNodeProps, LeftNodeProps {
77
+ }
78
+ export interface LeftElementProps {
79
+ /**
80
+ * 텍스트를 기준으로 왼쪽에 위치할 ReactElement를 설정합니다.
81
+ */
82
+ leftSource?: ReactElement;
83
+ }
84
+ export interface RightElementProps {
85
+ /**
86
+ * 텍스트를 기준으로 오른쪽에 위치할 ReactElement를 설정합니다.
87
+ */
88
+ rightSource?: ReactElement;
89
+ }
90
+ export interface LeftAndRightElementProps extends RightElementProps, LeftElementProps {
91
+ }