@foxford/ui 2.84.1-beta-d14403e-20251013 → 2.85.0-beta-d216815-20251015
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/components/DialogComponent/DialogComponent.js +1 -1
- package/components/DialogComponent/DialogComponent.js.map +1 -1
- package/components/DialogComponent/DialogComponent.mjs +1 -1
- package/components/DialogComponent/DialogComponent.mjs.map +1 -1
- package/components/DialogComponent/Header.js +2 -0
- package/components/DialogComponent/Header.js.map +1 -0
- package/components/DialogComponent/Header.mjs +2 -0
- package/components/DialogComponent/Header.mjs.map +1 -0
- package/components/DialogComponent/sizes.js +1 -1
- package/components/DialogComponent/sizes.js.map +1 -1
- package/components/DialogComponent/sizes.mjs +1 -1
- package/components/DialogComponent/sizes.mjs.map +1 -1
- package/components/DialogComponent/style.js +1 -1
- package/components/DialogComponent/style.js.map +1 -1
- package/components/DialogComponent/style.mjs +1 -1
- package/components/DialogComponent/style.mjs.map +1 -1
- package/dts/index.d.ts +32 -0
- package/package.json +2 -2
- package/shared/utils/renderSlot.js +2 -0
- package/shared/utils/renderSlot.js.map +1 -0
- package/shared/utils/renderSlot.mjs +2 -0
- package/shared/utils/renderSlot.mjs.map +1 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var useScrollThresholds=require('../../hooks/useScrollThresholds.js');var constants=require('../../shared/constants.js');var dom=require('../../shared/utils/dom.js');var dragging=require('./images/dragging.svg.js');var style=require('./style.js');var sizes=require('./sizes.js');var layouts=require('./layouts.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var AspectRatio=require('../AspectRatio/AspectRatio.js');var Skeleton=require('../Skeleton/Skeleton.js');var Text=require('../Text/Text.js');const DialogComponent=withMergedProps.withMergedProps(React.forwardRef(((e,
|
|
1
|
+
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var useScrollThresholds=require('../../hooks/useScrollThresholds.js');var constants=require('../../shared/constants.js');var dom=require('../../shared/utils/dom.js');var dragging=require('./images/dragging.svg.js');var style=require('./style.js');var sizes=require('./sizes.js');var layouts=require('./layouts.js');var Header=require('./Header.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var AspectRatio=require('../AspectRatio/AspectRatio.js');var Skeleton=require('../Skeleton/Skeleton.js');var Text=require('../Text/Text.js');const DialogComponent=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{const{size:t="s",layout:o="vertical",scrollable:n=!1,scrollFading:i=!1,sizeXXS:r,sizeXS:l,sizeS:a,sizeM:u,sizeL:c,sizeXL:d,layoutXXS:x,layoutXS:m,layoutS:j,layoutM:y,layoutL:R,layoutXL:S,root:g,floats:p,media:h,body:I,header:T,caption:z,title:A,subtitle:E,children:b,footer:k,closeButton:L,progressLine:P,fancy:C,imgSrcVertical:_,imgSrcHorizontal:v,draggable:w,loading:N,stickyHeader:f,className:O,backgroundClassName:B,onGrab:D,onNudge:X,...q}=e;const H={size:t,sizeXXS:r,sizeXS:l,sizeS:a,sizeM:u,sizeL:c,sizeXL:d};const Y={layout:o,layoutXXS:x,layoutXS:m,layoutS:j,layoutM:y,layoutL:R,layoutXL:S};const Z={...H,appearance:'body',color:'content-onmain-tertiary',wordBreak:'break-word',marginBottom:'0.8em',sizes:sizes.SIZES_CAPTION};const M={...H,as:'h2',appearance:'heading',color:'content-onmain-primary',wordBreak:'break-word',marginBottom:'0.5em',sizes:sizes.SIZES_TITLE};const V={...H,as:'p',appearance:'body',color:'content-onmain-primary',wordBreak:'break-word',marginBottom:'0.8em',sizes:sizes.SIZES_SUBTITLE};const F=C?{icon:'close',size:'xxl',secondary:!0}:{icon:'close',size:'l',marginTop:8,marginRight:8};const U={size:'xs'};const K=C?O:dom.concatClassNames(O,B);const G=n&&i;const[J,Q]=React.useState(null);const{scrollThresholds:W,setScrollThresholds:$}=useScrollThresholds.useScrollThresholds({enabled:G,target:J});return jsxRuntime.jsxs(style.Root,{...q,...H,...Y,layouts:C?layouts.LAYOUTS_FANCY:layouts.LAYOUTS,className:K,fancy:C,ref:s,children:[C?jsxRuntime.jsx(style.FancyBackground,{className:B}):null,React.isValidElement(g)?g:typeof g=='function'?g({captionProps:Z,titleProps:M,subtitleProps:V,closeButtonProps:F,progressLineProps:U,onGrab:D,onNudge:X}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[p,w?jsxRuntime.jsx(style.DraggingHandle,{...Y,layouts:layouts.VISIBILITY_VERTICAL,onPointerDown:D,children:jsxRuntime.jsx(style.DraggingIconContainer,{tabIndex:0,onKeyDown:X,children:jsxRuntime.jsx(Icon.Icon,{icon:jsxRuntime.jsx(dragging.default,{}),size:34,color:"content-onmain-tertiary"})})}):null,L?jsxRuntime.jsx(style.ButtonPosition,{children:React.isValidElement(L)?L:typeof L=='function'?L(F):null}):null,N||h||_?jsxRuntime.jsx(style.Media,{...Y,layouts:C?layouts.LAYOUTS_FANCY_MEDIA_VERTICAL:layouts.LAYOUTS_MEDIA_VERTICAL,children:N?jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"3:1",width:"100%",children:jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:0})}):React.isValidElement(h)?h:jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"3:1",width:"100%",children:jsxRuntime.jsx(style.Img,{src:_})})}):null,N||h||v?jsxRuntime.jsx(style.Media,{...Y,layouts:layouts.LAYOUTS_MEDIA_HORIZONTAL,children:N?jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"5:7",height:"100%",children:jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:0})}):React.isValidElement(h)?h:jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"5:7",height:"100%",children:jsxRuntime.jsx(style.Img,{src:v})})}):null,jsxRuntime.jsxs(style.Body,{children:[P&&!N?jsxRuntime.jsx(style.ProgressPosition,{...Y,layouts:C?layouts.LAYOUTS_FANCY_PROGRESS:layouts.LAYOUTS_PROGRESS,children:React.isValidElement(P)?P:typeof P=='function'?P(U):null}):null,w?jsxRuntime.jsx(style.DraggingHandle,{...Y,layouts:layouts.VISIBILITY_HORIZONTAL,onPointerDown:D,children:jsxRuntime.jsx(style.DraggingIconContainer,{tabIndex:0,onKeyDown:X,children:jsxRuntime.jsx(Icon.Icon,{icon:jsxRuntime.jsx(dragging.default,{}),size:34,color:"content-onmain-tertiary"})})}):null,C?jsxRuntime.jsx(style.LayoutSpacer,{...Y,layouts:layouts.VISIBILITY_HORIZONTAL,paddingTop:76}):null,N?jsxRuntime.jsx(style.Container,{...H,sizes:sizes.SIZES_CONTAINER,children:jsxRuntime.jsxs(style.Content,{...H,sizes:sizes.SIZES_CONTENT,children:[jsxRuntime.jsx(Skeleton.Skeleton,{children:jsxRuntime.jsx(Text.Text,{...M,marginBottom:"1.5em"})}),jsxRuntime.jsx(Skeleton.Skeleton,{width:"90%",children:jsxRuntime.jsx(Text.Text,{...V,marginBottom:"0.4em"})}),jsxRuntime.jsx(Skeleton.Skeleton,{width:"70%",children:jsxRuntime.jsx(Text.Text,{...V,marginBottom:"0.4em"})}),jsxRuntime.jsx(Skeleton.Skeleton,{width:"50%",children:jsxRuntime.jsx(Text.Text,{...V,marginBottom:"0.8em"})})]})}):React.isValidElement(I)?I:typeof I=='function'?I({captionProps:Z,titleProps:M,subtitleProps:V}):jsxRuntime.jsxs(style.Container,{...H,sizes:sizes.SIZES_CONTAINER,children:[f?jsxRuntime.jsx(style.StickyHeader,{...H,sizes:sizes.SIZES_STICKY_HEADER,children:jsxRuntime.jsx(Header.Header,{header:T,caption:z,title:A,subtitle:E,captionProps:Z,titleProps:M,subtitleProps:V})}):null,G?jsxRuntime.jsx(style.Fading,{visible:W.top===!1}):null,jsxRuntime.jsxs(style.Content,{...H,sizes:sizes.SIZES_CONTENT,ref:e=>{Q(e)},scrollable:n,tabIndex:n?0:void 0,onScroll:e=>{G&&$(e.currentTarget)},onKeyDown:e=>{constants.keyboardKeys.ArrowUp.validate(e.key)?(e.preventDefault(),e.currentTarget.scrollBy(0,-13)):constants.keyboardKeys.ArrowDown.validate(e.key)&&(e.preventDefault(),e.currentTarget.scrollBy(0,13))},children:[f?null:jsxRuntime.jsx(Header.Header,{header:T,caption:z,title:A,subtitle:E,captionProps:Z,titleProps:M,subtitleProps:V}),b]}),G?jsxRuntime.jsx(style.Fading,{visible:W.bottom===!1,after:!0}):null,k?jsxRuntime.jsx(style.Footer,{...H,sizes:sizes.SIZES_FOOTER,children:k}):null]})]})]})]})})),{sizes:e=>e.fancy?sizes.SIZES_FANCY:sizes.SIZES,displayName:'DialogComponent'});exports.DialogComponent=DialogComponent;
|
|
2
2
|
//# sourceMappingURL=DialogComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogComponent.js","sources":["../../../../src/components/DialogComponent/DialogComponent.tsx"],"sourcesContent":["import { forwardRef, useState, isValidElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { useScrollThresholds } from 'hooks/useScrollThresholds'\nimport { keyboardKeys } from 'shared/constants'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport { AspectRatio } from 'components/AspectRatio'\nimport type { TextProps } from 'components/Text'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { ProgressLineProps } from 'components/ProgressLine'\nimport { concatClassNames } from 'shared/utils/dom'\nimport Dragging from './images/dragging.svg?module'\nimport * as Styled from './style'\nimport {\n SIZES,\n SIZES_FANCY,\n SIZES_CONTAINER,\n SIZES_CONTENT,\n SIZES_FOOTER,\n SIZES_CAPTION,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n} from './sizes'\nimport {\n LAYOUTS,\n LAYOUTS_FANCY,\n LAYOUTS_MEDIA_VERTICAL,\n LAYOUTS_FANCY_MEDIA_VERTICAL,\n LAYOUTS_MEDIA_HORIZONTAL,\n LAYOUTS_PROGRESS,\n LAYOUTS_FANCY_PROGRESS,\n VISIBILITY_VERTICAL,\n VISIBILITY_HORIZONTAL,\n} from './layouts'\nimport type { DialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'DialogComponent'\n\nconst DialogComponent: React.ForwardRefExoticComponent<DialogComponentProps> = withMergedProps<\n DialogComponentProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<DialogComponentProps>>((props, ref) => {\n const {\n size = 's',\n layout = 'vertical',\n scrollable = false,\n scrollFading = false,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n root,\n floats,\n media,\n body,\n caption,\n title,\n subtitle,\n children,\n footer,\n closeButton,\n progressLine,\n fancy,\n imgSrcVertical,\n imgSrcHorizontal,\n draggable,\n loading,\n className,\n backgroundClassName,\n onGrab,\n onNudge,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const captionProps: TextProps = {\n ...sizeProps,\n appearance: 'body',\n color: 'content-onmain-tertiary',\n wordBreak: 'break-word',\n marginBottom: '0.8em',\n sizes: SIZES_CAPTION,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'h2',\n appearance: 'heading',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n marginBottom: '0.5em',\n sizes: SIZES_TITLE,\n }\n\n const subtitleProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n marginBottom: '0.8em',\n sizes: SIZES_SUBTITLE,\n }\n\n const closeButtonProps: IconButtonProps = fancy\n ? { icon: 'close', size: 'xxl', secondary: true }\n : { icon: 'close', size: 'l', marginTop: 8, marginRight: 8 }\n\n const progressLineProps: ProgressLineProps = {\n size: 'xs',\n }\n\n const rootClassName = !fancy ? concatClassNames(className, backgroundClassName) : className\n\n const scrollFadingEnabled = scrollable && scrollFading\n\n const [contentRef, setContentRef] = useState<HTMLDivElement | null>(null)\n\n const { scrollThresholds, setScrollThresholds } = useScrollThresholds({\n enabled: scrollFadingEnabled,\n target: contentRef,\n })\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n {...layoutProps}\n layouts={fancy ? LAYOUTS_FANCY : LAYOUTS}\n className={rootClassName}\n fancy={fancy}\n ref={ref}\n >\n {fancy ? <Styled.FancyBackground className={backgroundClassName} /> : null}\n {isValidElement(root) ? (\n root\n ) : typeof root === 'function' ? (\n root({\n captionProps,\n titleProps,\n subtitleProps,\n closeButtonProps,\n progressLineProps,\n onGrab,\n onNudge,\n })\n ) : (\n <>\n {floats}\n {draggable ? (\n <Styled.DraggingHandle {...layoutProps} layouts={VISIBILITY_VERTICAL} onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n ) : null}\n {closeButton ? (\n <Styled.ButtonPosition>\n {isValidElement(closeButton)\n ? closeButton\n : typeof closeButton === 'function'\n ? closeButton(closeButtonProps)\n : null}\n </Styled.ButtonPosition>\n ) : null}\n {loading || media || imgSrcVertical ? (\n <Styled.Media {...layoutProps} layouts={fancy ? LAYOUTS_FANCY_MEDIA_VERTICAL : LAYOUTS_MEDIA_VERTICAL}>\n {loading ? (\n <AspectRatio ratio='3:1' width='100%'>\n <Skeleton borderRadius={0} />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='3:1' width='100%'>\n <Styled.Img src={imgSrcVertical} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n {loading || media || imgSrcHorizontal ? (\n <Styled.Media {...layoutProps} layouts={LAYOUTS_MEDIA_HORIZONTAL}>\n {loading ? (\n <AspectRatio ratio='5:7' height='100%'>\n <Skeleton borderRadius={0} />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='5:7' height='100%'>\n <Styled.Img src={imgSrcHorizontal} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n <Styled.Body>\n {progressLine && !loading ? (\n <Styled.ProgressPosition {...layoutProps} layouts={fancy ? LAYOUTS_FANCY_PROGRESS : LAYOUTS_PROGRESS}>\n {isValidElement(progressLine)\n ? progressLine\n : typeof progressLine === 'function'\n ? progressLine(progressLineProps)\n : null}\n </Styled.ProgressPosition>\n ) : null}\n {draggable ? (\n <Styled.DraggingHandle {...layoutProps} layouts={VISIBILITY_HORIZONTAL} onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n ) : null}\n {fancy ? <Styled.LayoutSpacer {...layoutProps} layouts={VISIBILITY_HORIZONTAL} paddingTop={76} /> : null}\n {loading ? (\n <Styled.Container {...sizeProps} sizes={SIZES_CONTAINER}>\n <Styled.Content {...sizeProps} sizes={SIZES_CONTENT}>\n <Skeleton>\n <Text {...titleProps} marginBottom='1.5em' />\n </Skeleton>\n <Skeleton width='90%'>\n <Text {...subtitleProps} marginBottom='0.4em' />\n </Skeleton>\n <Skeleton width='70%'>\n <Text {...subtitleProps} marginBottom='0.4em' />\n </Skeleton>\n <Skeleton width='50%'>\n <Text {...subtitleProps} marginBottom='0.8em' />\n </Skeleton>\n </Styled.Content>\n </Styled.Container>\n ) : isValidElement(body) ? (\n body\n ) : typeof body === 'function' ? (\n body({\n captionProps,\n titleProps,\n subtitleProps,\n })\n ) : (\n <Styled.Container {...sizeProps} sizes={SIZES_CONTAINER}>\n {scrollFadingEnabled ? <Styled.Fading visible={scrollThresholds.top === false} /> : null}\n <Styled.Content\n {...sizeProps}\n sizes={SIZES_CONTENT}\n ref={(node) => {\n setContentRef(node)\n }}\n scrollable={scrollable}\n tabIndex={scrollable ? 0 : undefined}\n onScroll={(evt) => {\n if (scrollFadingEnabled) {\n setScrollThresholds(evt.currentTarget)\n }\n }}\n onKeyDown={(evt) => {\n if (keyboardKeys.ArrowUp.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, -13)\n } else if (keyboardKeys.ArrowDown.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, 13)\n }\n }}\n >\n {isValidElement(caption) ? (\n caption\n ) : typeof caption === 'function' ? (\n caption(captionProps)\n ) : typeof caption === 'string' || typeof caption === 'number' ? (\n <Text {...captionProps}>{caption}</Text>\n ) : null}\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title(titleProps)\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...titleProps}>{title}</Text>\n ) : null}\n {isValidElement(subtitle) ? (\n subtitle\n ) : typeof subtitle === 'function' ? (\n subtitle(subtitleProps)\n ) : typeof subtitle === 'string' || typeof subtitle === 'number' ? (\n <Text {...subtitleProps}>{subtitle}</Text>\n ) : null}\n {children}\n </Styled.Content>\n {scrollFadingEnabled ? <Styled.Fading visible={scrollThresholds.bottom === false} after /> : null}\n {footer ? (\n <Styled.Footer {...sizeProps} sizes={SIZES_FOOTER}>\n {footer}\n </Styled.Footer>\n ) : null}\n </Styled.Container>\n )}\n </Styled.Body>\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogComponent }\n"],"names":["DialogComponent","withMergedProps","forwardRef","props","ref","size","layout","scrollable","scrollFading","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","root","floats","media","body","caption","title","subtitle","children","footer","closeButton","progressLine","fancy","imgSrcVertical","imgSrcHorizontal","draggable","loading","className","backgroundClassName","onGrab","onNudge","restProps","sizeProps","layoutProps","captionProps","appearance","color","wordBreak","marginBottom","sizes","SIZES_CAPTION","titleProps","as","SIZES_TITLE","subtitleProps","SIZES_SUBTITLE","closeButtonProps","icon","secondary","marginTop","marginRight","progressLineProps","rootClassName","concatClassNames","scrollFadingEnabled","contentRef","setContentRef","useState","scrollThresholds","setScrollThresholds","useScrollThresholds","enabled","target","_jsxs","Styled","layouts","LAYOUTS_FANCY","LAYOUTS","_jsx","jsx","isValidElement","jsxs","_Fragment","VISIBILITY_VERTICAL","onPointerDown","tabIndex","onKeyDown","Icon","Dragging","default","LAYOUTS_FANCY_MEDIA_VERTICAL","LAYOUTS_MEDIA_VERTICAL","AspectRatio","ratio","width","Skeleton","borderRadius","src","LAYOUTS_MEDIA_HORIZONTAL","height","LAYOUTS_FANCY_PROGRESS","LAYOUTS_PROGRESS","VISIBILITY_HORIZONTAL","paddingTop","SIZES_CONTAINER","SIZES_CONTENT","Text","visible","top","node","undefined","onScroll","evt","currentTarget","keyboardKeys","ArrowUp","validate","key","preventDefault","scrollBy","ArrowDown","bottom","after","SIZES_FOOTER","SIZES_FANCY","SIZES","displayName"],"mappings":"6nBAwCMA,MAAAA,gBAAyEC,gBAAAA,gBAI7EC,MAAAA,YAA8D,CAACC,EAAOC,KACpE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,WAAUC,WACnBA,GAAa,EAAKC,aAClBA,GAAe,EAAKC,QACpBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,KACRA,EAAIC,OACJA,EAAMC,MACNA,EAAKC,KACLA,EAAIC,QACJA,EAAOC,MACPA,EAAKC,SACLA,EAAQC,SACRA,EAAQC,OACRA,E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GlB,CACEoB,MAAQ9C,GAAWA,EAAM6B,MAAQ4F,MAAWA,YAAGC,MAAMA,MACrDC,YAvSmB"}
|
|
1
|
+
{"version":3,"file":"DialogComponent.js","sources":["../../../../src/components/DialogComponent/DialogComponent.tsx"],"sourcesContent":["import { forwardRef, useState, isValidElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { useScrollThresholds } from 'hooks/useScrollThresholds'\nimport { keyboardKeys } from 'shared/constants'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport { AspectRatio } from 'components/AspectRatio'\nimport type { TextProps } from 'components/Text'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { ProgressLineProps } from 'components/ProgressLine'\nimport { concatClassNames } from 'shared/utils/dom'\nimport Dragging from './images/dragging.svg?module'\nimport * as Styled from './style'\nimport {\n SIZES,\n SIZES_FANCY,\n SIZES_CONTAINER,\n SIZES_CONTENT,\n SIZES_FOOTER,\n SIZES_CAPTION,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n SIZES_STICKY_HEADER,\n} from './sizes'\nimport {\n LAYOUTS,\n LAYOUTS_FANCY,\n LAYOUTS_MEDIA_VERTICAL,\n LAYOUTS_FANCY_MEDIA_VERTICAL,\n LAYOUTS_MEDIA_HORIZONTAL,\n LAYOUTS_PROGRESS,\n LAYOUTS_FANCY_PROGRESS,\n VISIBILITY_VERTICAL,\n VISIBILITY_HORIZONTAL,\n} from './layouts'\nimport type { DialogComponentProps } from './types'\nimport { Header } from './Header'\n\nconst COMPONENT_NAME = 'DialogComponent'\n\nconst DialogComponent: React.ForwardRefExoticComponent<DialogComponentProps> = withMergedProps<\n DialogComponentProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<DialogComponentProps>>((props, ref) => {\n const {\n size = 's',\n layout = 'vertical',\n scrollable = false,\n scrollFading = false,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n root,\n floats,\n media,\n body,\n header,\n caption,\n title,\n subtitle,\n children,\n footer,\n closeButton,\n progressLine,\n fancy,\n imgSrcVertical,\n imgSrcHorizontal,\n draggable,\n loading,\n stickyHeader,\n className,\n backgroundClassName,\n onGrab,\n onNudge,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const captionProps: TextProps = {\n ...sizeProps,\n appearance: 'body',\n color: 'content-onmain-tertiary',\n wordBreak: 'break-word',\n marginBottom: '0.8em',\n sizes: SIZES_CAPTION,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'h2',\n appearance: 'heading',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n marginBottom: '0.5em',\n sizes: SIZES_TITLE,\n }\n\n const subtitleProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n marginBottom: '0.8em',\n sizes: SIZES_SUBTITLE,\n }\n\n const closeButtonProps: IconButtonProps = fancy\n ? { icon: 'close', size: 'xxl', secondary: true }\n : { icon: 'close', size: 'l', marginTop: 8, marginRight: 8 }\n\n const progressLineProps: ProgressLineProps = {\n size: 'xs',\n }\n\n const rootClassName = !fancy ? concatClassNames(className, backgroundClassName) : className\n\n const scrollFadingEnabled = scrollable && scrollFading\n\n const [contentRef, setContentRef] = useState<HTMLDivElement | null>(null)\n\n const { scrollThresholds, setScrollThresholds } = useScrollThresholds({\n enabled: scrollFadingEnabled,\n target: contentRef,\n })\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n {...layoutProps}\n layouts={fancy ? LAYOUTS_FANCY : LAYOUTS}\n className={rootClassName}\n fancy={fancy}\n ref={ref}\n >\n {fancy ? <Styled.FancyBackground className={backgroundClassName} /> : null}\n {isValidElement(root) ? (\n root\n ) : typeof root === 'function' ? (\n root({\n captionProps,\n titleProps,\n subtitleProps,\n closeButtonProps,\n progressLineProps,\n onGrab,\n onNudge,\n })\n ) : (\n <>\n {floats}\n {draggable ? (\n <Styled.DraggingHandle {...layoutProps} layouts={VISIBILITY_VERTICAL} onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n ) : null}\n {closeButton ? (\n <Styled.ButtonPosition>\n {isValidElement(closeButton)\n ? closeButton\n : typeof closeButton === 'function'\n ? closeButton(closeButtonProps)\n : null}\n </Styled.ButtonPosition>\n ) : null}\n {loading || media || imgSrcVertical ? (\n <Styled.Media {...layoutProps} layouts={fancy ? LAYOUTS_FANCY_MEDIA_VERTICAL : LAYOUTS_MEDIA_VERTICAL}>\n {loading ? (\n <AspectRatio ratio='3:1' width='100%'>\n <Skeleton borderRadius={0} />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='3:1' width='100%'>\n <Styled.Img src={imgSrcVertical} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n {loading || media || imgSrcHorizontal ? (\n <Styled.Media {...layoutProps} layouts={LAYOUTS_MEDIA_HORIZONTAL}>\n {loading ? (\n <AspectRatio ratio='5:7' height='100%'>\n <Skeleton borderRadius={0} />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='5:7' height='100%'>\n <Styled.Img src={imgSrcHorizontal} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n <Styled.Body>\n {progressLine && !loading ? (\n <Styled.ProgressPosition {...layoutProps} layouts={fancy ? LAYOUTS_FANCY_PROGRESS : LAYOUTS_PROGRESS}>\n {isValidElement(progressLine)\n ? progressLine\n : typeof progressLine === 'function'\n ? progressLine(progressLineProps)\n : null}\n </Styled.ProgressPosition>\n ) : null}\n {draggable ? (\n <Styled.DraggingHandle {...layoutProps} layouts={VISIBILITY_HORIZONTAL} onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n ) : null}\n {fancy ? <Styled.LayoutSpacer {...layoutProps} layouts={VISIBILITY_HORIZONTAL} paddingTop={76} /> : null}\n {loading ? (\n <Styled.Container {...sizeProps} sizes={SIZES_CONTAINER}>\n <Styled.Content {...sizeProps} sizes={SIZES_CONTENT}>\n <Skeleton>\n <Text {...titleProps} marginBottom='1.5em' />\n </Skeleton>\n <Skeleton width='90%'>\n <Text {...subtitleProps} marginBottom='0.4em' />\n </Skeleton>\n <Skeleton width='70%'>\n <Text {...subtitleProps} marginBottom='0.4em' />\n </Skeleton>\n <Skeleton width='50%'>\n <Text {...subtitleProps} marginBottom='0.8em' />\n </Skeleton>\n </Styled.Content>\n </Styled.Container>\n ) : isValidElement(body) ? (\n body\n ) : typeof body === 'function' ? (\n body({\n captionProps,\n titleProps,\n subtitleProps,\n })\n ) : (\n <Styled.Container {...sizeProps} sizes={SIZES_CONTAINER}>\n {stickyHeader ? (\n <Styled.StickyHeader {...sizeProps} sizes={SIZES_STICKY_HEADER}>\n <Header\n header={header}\n caption={caption}\n title={title}\n subtitle={subtitle}\n captionProps={captionProps}\n titleProps={titleProps}\n subtitleProps={subtitleProps}\n />\n </Styled.StickyHeader>\n ) : null}\n {scrollFadingEnabled ? <Styled.Fading visible={scrollThresholds.top === false} /> : null}\n <Styled.Content\n {...sizeProps}\n sizes={SIZES_CONTENT}\n ref={(node) => {\n setContentRef(node)\n }}\n scrollable={scrollable}\n tabIndex={scrollable ? 0 : undefined}\n onScroll={(evt) => {\n if (scrollFadingEnabled) {\n setScrollThresholds(evt.currentTarget)\n }\n }}\n onKeyDown={(evt) => {\n if (keyboardKeys.ArrowUp.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, -13)\n } else if (keyboardKeys.ArrowDown.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, 13)\n }\n }}\n >\n {!stickyHeader ? (\n <Header\n header={header}\n caption={caption}\n title={title}\n subtitle={subtitle}\n captionProps={captionProps}\n titleProps={titleProps}\n subtitleProps={subtitleProps}\n />\n ) : null}\n {children}\n </Styled.Content>\n {scrollFadingEnabled ? <Styled.Fading visible={scrollThresholds.bottom === false} after /> : null}\n {footer ? (\n <Styled.Footer {...sizeProps} sizes={SIZES_FOOTER}>\n {footer}\n </Styled.Footer>\n ) : null}\n </Styled.Container>\n )}\n </Styled.Body>\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogComponent }\n"],"names":["DialogComponent","withMergedProps","forwardRef","props","ref","size","layout","scrollable","scrollFading","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","root","floats","media","body","header","caption","title","subtitle","children","footer","closeButton","progressLine","fancy","imgSrcVertical","imgSrcHorizontal","draggable","loading","stickyHeader","className","backgroundClassName","onGrab","onNudge","restProps","sizeProps","layoutProps","captionProps","appearance","color","wordBreak","marginBottom","sizes","SIZES_CAPTION","titleProps","as","SIZES_TITLE","subtitleProps","SIZES_SUBTITLE","closeButtonProps","icon","secondary","marginTop","marginRight","progressLineProps","rootClassName","concatClassNames","scrollFadingEnabled","contentRef","setContentRef","useState","scrollThresholds","setScrollThresholds","useScrollThresholds","enabled","target","_jsxs","Styled","layouts","LAYOUTS_FANCY","LAYOUTS","_jsx","jsx","isValidElement","jsxs","_Fragment","VISIBILITY_VERTICAL","onPointerDown","tabIndex","onKeyDown","Icon","Dragging","default","LAYOUTS_FANCY_MEDIA_VERTICAL","LAYOUTS_MEDIA_VERTICAL","AspectRatio","ratio","width","Skeleton","borderRadius","src","LAYOUTS_MEDIA_HORIZONTAL","height","LAYOUTS_FANCY_PROGRESS","LAYOUTS_PROGRESS","VISIBILITY_HORIZONTAL","paddingTop","SIZES_CONTAINER","SIZES_CONTENT","Text","SIZES_STICKY_HEADER","Header","visible","top","node","undefined","onScroll","evt","currentTarget","keyboardKeys","ArrowUp","validate","key","preventDefault","scrollBy","ArrowDown","bottom","after","SIZES_FOOTER","SIZES_FANCY","SIZES","displayName"],"mappings":"+pBA0CMA,MAAAA,gBAAyEC,gBAAAA,gBAI7EC,MAAAA,YAA8D,CAACC,EAAOC,KACpE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,WAAUC,WACnBA,GAAa,EAAKC,aAClBA,GAAe,EAAKC,QACpBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,KACRA,EAAIC,OACJA,EAAMC,MACNA,EAAKC,KACLA,EAAIC,OACJA,EAAMC,QACNA,EAAOC,MACPA,EAAKC,SACLA,EAAQC,SACRA,EAAQC,OACRA,EAAMC,YACNA,EAAWC,aACXA,EAAYC,MACZA,EAAKC,eACLA,EAAcC,iBACdA,EAAgBC,UAChBA,EAASC,QACTA,EAAOC,aACPA,EAAYC,UACZA,EAASC,oBACTA,EAAmBC,OACnBA,EAAMC,QACNA,KACGC,GACDxC,EAEJ,MAAMyC,EAAY,CAChBvC,OACAI,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAM+B,EAAc,CAClBvC,SACAS,YACAC,WACAC,UACAC,UACAC,UACAC,YAGF,MAAM0B,EAA0B,IAC3BF,EACHG,WAAY,OACZC,MAAO,0BACPC,UAAW,aACXC,aAAc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A,OAAa,CAACmC,QAASzC,EAAiB0C,OAAQ,IAAY,KACpFrC,WAAAQ,KAACP,cAAc,IACThC,EACJO,MAAOwD,MAAcA,cACrBvG,IAAM6G,IACJ7C,EAAc6C,EAAK,EAErB1G,WAAYA,EACZgF,SAAUhF,EAAa,OAAI2G,EAC3BC,SAAWC,IACLlD,GACFK,EAAoB6C,EAAIC,cAC1B,EAEF7B,UAAY4B,IACNE,UAAYA,aAACC,QAAQC,SAASJ,EAAIK,MACpCL,EAAIM,iBACJN,EAAIC,cAAcM,SAAS,GAAI,KACtBL,UAAYA,aAACM,UAAUJ,SAASJ,EAAIK,OAC7CL,EAAIM,iBACJN,EAAIC,cAAcM,SAAS,EAAG,IAChC,EACA9F,UAEAS,EAUE,KATF0C,WAAAA,IAAC8B,OAAAA,OAAM,CACLrF,OAAQA,EACRC,QAASA,EACTC,MAAOA,EACPC,SAAUA,EACVkB,aAAcA,EACdO,WAAYA,EACZG,cAAeA,IAGlB3B,KAEFqC,EAAsBc,WAAAC,IAACL,aAAa,CAACmC,QAASzC,EAAiBuD,UAAW,EAAOC,OAAK,IAAM,KAC5FhG,EACCkD,WAAAA,IAACJ,MAAAA,OAAa,IAAKhC,EAAWO,MAAO4E,MAAaA,aAAAlG,SAC/CC,IAED,gBAMF,IAGlB,CACEqB,MAAQhD,GAAWA,EAAM8B,MAAQ+F,MAAWA,YAAGC,MAAMA,MACrDC,YA5SmB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef,useState,isValidElement}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{useScrollThresholds}from'../../hooks/useScrollThresholds.mjs';import{keyboardKeys}from'../../shared/constants.mjs';import{concatClassNames}from'../../shared/utils/dom.mjs';import SvgDragging from'./images/dragging.svg.mjs';import{Root,FancyBackground,DraggingHandle,DraggingIconContainer,ButtonPosition,Media,Img,Body,ProgressPosition,LayoutSpacer,Container,Content,Fading,Footer}from'./style.mjs';import{SIZES_FANCY,SIZES,SIZES_CONTAINER,SIZES_CONTENT,SIZES_FOOTER,SIZES_CAPTION,SIZES_TITLE,SIZES_SUBTITLE}from'./sizes.mjs';import{LAYOUTS_FANCY,LAYOUTS,VISIBILITY_VERTICAL,LAYOUTS_FANCY_MEDIA_VERTICAL,LAYOUTS_MEDIA_VERTICAL,LAYOUTS_MEDIA_HORIZONTAL,LAYOUTS_FANCY_PROGRESS,LAYOUTS_PROGRESS,VISIBILITY_HORIZONTAL}from'./layouts.mjs';import{jsxs,jsx,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{AspectRatio}from'../AspectRatio/AspectRatio.mjs';import{Skeleton}from'../Skeleton/Skeleton.mjs';import{Text}from'../Text/Text.mjs';const DialogComponent=withMergedProps(forwardRef(((o
|
|
1
|
+
import{forwardRef,useState,isValidElement}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{useScrollThresholds}from'../../hooks/useScrollThresholds.mjs';import{keyboardKeys}from'../../shared/constants.mjs';import{concatClassNames}from'../../shared/utils/dom.mjs';import SvgDragging from'./images/dragging.svg.mjs';import{Root,FancyBackground,DraggingHandle,DraggingIconContainer,ButtonPosition,Media,Img,Body,ProgressPosition,LayoutSpacer,Container,Content,StickyHeader,Fading,Footer}from'./style.mjs';import{SIZES_FANCY,SIZES,SIZES_CONTAINER,SIZES_CONTENT,SIZES_STICKY_HEADER,SIZES_FOOTER,SIZES_CAPTION,SIZES_TITLE,SIZES_SUBTITLE}from'./sizes.mjs';import{LAYOUTS_FANCY,LAYOUTS,VISIBILITY_VERTICAL,LAYOUTS_FANCY_MEDIA_VERTICAL,LAYOUTS_MEDIA_VERTICAL,LAYOUTS_MEDIA_HORIZONTAL,LAYOUTS_FANCY_PROGRESS,LAYOUTS_PROGRESS,VISIBILITY_HORIZONTAL}from'./layouts.mjs';import{Header}from'./Header.mjs';import{jsxs,jsx,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{AspectRatio}from'../AspectRatio/AspectRatio.mjs';import{Skeleton}from'../Skeleton/Skeleton.mjs';import{Text}from'../Text/Text.mjs';const DialogComponent=withMergedProps(forwardRef(((e,o)=>{const{size:t="s",layout:s="vertical",scrollable:r=!1,scrollFading:n=!1,sizeXXS:i,sizeXS:a,sizeS:l,sizeM:c,sizeL:d,sizeXL:S,layoutXXS:m,layoutXS:g,layoutS:I,layoutM:p,layoutL:u,layoutXL:T,root:y,floats:x,media:j,body:E,header:h,caption:A,title:_,subtitle:L,children:O,footer:R,closeButton:C,progressLine:f,fancy:N,imgSrcVertical:b,imgSrcHorizontal:z,draggable:P,loading:Y,stickyHeader:D,className:k,backgroundClassName:B,onGrab:Z,onNudge:w,...F}=e;const V={size:t,sizeXXS:i,sizeXS:a,sizeS:l,sizeM:c,sizeL:d,sizeXL:S};const H={layout:s,layoutXXS:m,layoutXS:g,layoutS:I,layoutM:p,layoutL:u,layoutXL:T};const U={...V,appearance:'body',color:'content-onmain-tertiary',wordBreak:'break-word',marginBottom:'0.8em',sizes:SIZES_CAPTION};const M={...V,as:'h2',appearance:'heading',color:'content-onmain-primary',wordBreak:'break-word',marginBottom:'0.5em',sizes:SIZES_TITLE};const X={...V,as:'p',appearance:'body',color:'content-onmain-primary',wordBreak:'break-word',marginBottom:'0.8em',sizes:SIZES_SUBTITLE};const v=N?{icon:'close',size:'xxl',secondary:!0}:{icon:'close',size:'l',marginTop:8,marginRight:8};const K={size:'xs'};const G=N?k:concatClassNames(k,B);const q=r&&n;const[J,Q]=useState(null);const{scrollThresholds:W,setScrollThresholds:$}=useScrollThresholds({enabled:q,target:J});return jsxs(Root,{...F,...V,...H,layouts:N?LAYOUTS_FANCY:LAYOUTS,className:G,fancy:N,ref:o,children:[N?jsx(FancyBackground,{className:B}):null,isValidElement(y)?y:typeof y=='function'?y({captionProps:U,titleProps:M,subtitleProps:X,closeButtonProps:v,progressLineProps:K,onGrab:Z,onNudge:w}):jsxs(Fragment,{children:[x,P?jsx(DraggingHandle,{...H,layouts:VISIBILITY_VERTICAL,onPointerDown:Z,children:jsx(DraggingIconContainer,{tabIndex:0,onKeyDown:w,children:jsx(Icon,{icon:jsx(SvgDragging,{}),size:34,color:"content-onmain-tertiary"})})}):null,C?jsx(ButtonPosition,{children:isValidElement(C)?C:typeof C=='function'?C(v):null}):null,Y||j||b?jsx(Media,{...H,layouts:N?LAYOUTS_FANCY_MEDIA_VERTICAL:LAYOUTS_MEDIA_VERTICAL,children:Y?jsx(AspectRatio,{ratio:"3:1",width:"100%",children:jsx(Skeleton,{borderRadius:0})}):isValidElement(j)?j:jsx(AspectRatio,{ratio:"3:1",width:"100%",children:jsx(Img,{src:b})})}):null,Y||j||z?jsx(Media,{...H,layouts:LAYOUTS_MEDIA_HORIZONTAL,children:Y?jsx(AspectRatio,{ratio:"5:7",height:"100%",children:jsx(Skeleton,{borderRadius:0})}):isValidElement(j)?j:jsx(AspectRatio,{ratio:"5:7",height:"100%",children:jsx(Img,{src:z})})}):null,jsxs(Body,{children:[f&&!Y?jsx(ProgressPosition,{...H,layouts:N?LAYOUTS_FANCY_PROGRESS:LAYOUTS_PROGRESS,children:isValidElement(f)?f:typeof f=='function'?f(K):null}):null,P?jsx(DraggingHandle,{...H,layouts:VISIBILITY_HORIZONTAL,onPointerDown:Z,children:jsx(DraggingIconContainer,{tabIndex:0,onKeyDown:w,children:jsx(Icon,{icon:jsx(SvgDragging,{}),size:34,color:"content-onmain-tertiary"})})}):null,N?jsx(LayoutSpacer,{...H,layouts:VISIBILITY_HORIZONTAL,paddingTop:76}):null,Y?jsx(Container,{...V,sizes:SIZES_CONTAINER,children:jsxs(Content,{...V,sizes:SIZES_CONTENT,children:[jsx(Skeleton,{children:jsx(Text,{...M,marginBottom:"1.5em"})}),jsx(Skeleton,{width:"90%",children:jsx(Text,{...X,marginBottom:"0.4em"})}),jsx(Skeleton,{width:"70%",children:jsx(Text,{...X,marginBottom:"0.4em"})}),jsx(Skeleton,{width:"50%",children:jsx(Text,{...X,marginBottom:"0.8em"})})]})}):isValidElement(E)?E:typeof E=='function'?E({captionProps:U,titleProps:M,subtitleProps:X}):jsxs(Container,{...V,sizes:SIZES_CONTAINER,children:[D?jsx(StickyHeader,{...V,sizes:SIZES_STICKY_HEADER,children:jsx(Header,{header:h,caption:A,title:_,subtitle:L,captionProps:U,titleProps:M,subtitleProps:X})}):null,q?jsx(Fading,{visible:W.top===!1}):null,jsxs(Content,{...V,sizes:SIZES_CONTENT,ref:e=>{Q(e)},scrollable:r,tabIndex:r?0:void 0,onScroll:e=>{q&&$(e.currentTarget)},onKeyDown:e=>{keyboardKeys.ArrowUp.validate(e.key)?(e.preventDefault(),e.currentTarget.scrollBy(0,-13)):keyboardKeys.ArrowDown.validate(e.key)&&(e.preventDefault(),e.currentTarget.scrollBy(0,13))},children:[D?null:jsx(Header,{header:h,caption:A,title:_,subtitle:L,captionProps:U,titleProps:M,subtitleProps:X}),O]}),q?jsx(Fading,{visible:W.bottom===!1,after:!0}):null,R?jsx(Footer,{...V,sizes:SIZES_FOOTER,children:R}):null]})]})]})]})})),{sizes:e=>e.fancy?SIZES_FANCY:SIZES,displayName:'DialogComponent'});export{DialogComponent};
|
|
2
2
|
//# sourceMappingURL=DialogComponent.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogComponent.mjs","sources":["../../../../src/components/DialogComponent/DialogComponent.tsx"],"sourcesContent":["import { forwardRef, useState, isValidElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { useScrollThresholds } from 'hooks/useScrollThresholds'\nimport { keyboardKeys } from 'shared/constants'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport { AspectRatio } from 'components/AspectRatio'\nimport type { TextProps } from 'components/Text'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { ProgressLineProps } from 'components/ProgressLine'\nimport { concatClassNames } from 'shared/utils/dom'\nimport Dragging from './images/dragging.svg?module'\nimport * as Styled from './style'\nimport {\n SIZES,\n SIZES_FANCY,\n SIZES_CONTAINER,\n SIZES_CONTENT,\n SIZES_FOOTER,\n SIZES_CAPTION,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n} from './sizes'\nimport {\n LAYOUTS,\n LAYOUTS_FANCY,\n LAYOUTS_MEDIA_VERTICAL,\n LAYOUTS_FANCY_MEDIA_VERTICAL,\n LAYOUTS_MEDIA_HORIZONTAL,\n LAYOUTS_PROGRESS,\n LAYOUTS_FANCY_PROGRESS,\n VISIBILITY_VERTICAL,\n VISIBILITY_HORIZONTAL,\n} from './layouts'\nimport type { DialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'DialogComponent'\n\nconst DialogComponent: React.ForwardRefExoticComponent<DialogComponentProps> = withMergedProps<\n DialogComponentProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<DialogComponentProps>>((props, ref) => {\n const {\n size = 's',\n layout = 'vertical',\n scrollable = false,\n scrollFading = false,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n root,\n floats,\n media,\n body,\n caption,\n title,\n subtitle,\n children,\n footer,\n closeButton,\n progressLine,\n fancy,\n imgSrcVertical,\n imgSrcHorizontal,\n draggable,\n loading,\n className,\n backgroundClassName,\n onGrab,\n onNudge,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const captionProps: TextProps = {\n ...sizeProps,\n appearance: 'body',\n color: 'content-onmain-tertiary',\n wordBreak: 'break-word',\n marginBottom: '0.8em',\n sizes: SIZES_CAPTION,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'h2',\n appearance: 'heading',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n marginBottom: '0.5em',\n sizes: SIZES_TITLE,\n }\n\n const subtitleProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n marginBottom: '0.8em',\n sizes: SIZES_SUBTITLE,\n }\n\n const closeButtonProps: IconButtonProps = fancy\n ? { icon: 'close', size: 'xxl', secondary: true }\n : { icon: 'close', size: 'l', marginTop: 8, marginRight: 8 }\n\n const progressLineProps: ProgressLineProps = {\n size: 'xs',\n }\n\n const rootClassName = !fancy ? concatClassNames(className, backgroundClassName) : className\n\n const scrollFadingEnabled = scrollable && scrollFading\n\n const [contentRef, setContentRef] = useState<HTMLDivElement | null>(null)\n\n const { scrollThresholds, setScrollThresholds } = useScrollThresholds({\n enabled: scrollFadingEnabled,\n target: contentRef,\n })\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n {...layoutProps}\n layouts={fancy ? LAYOUTS_FANCY : LAYOUTS}\n className={rootClassName}\n fancy={fancy}\n ref={ref}\n >\n {fancy ? <Styled.FancyBackground className={backgroundClassName} /> : null}\n {isValidElement(root) ? (\n root\n ) : typeof root === 'function' ? (\n root({\n captionProps,\n titleProps,\n subtitleProps,\n closeButtonProps,\n progressLineProps,\n onGrab,\n onNudge,\n })\n ) : (\n <>\n {floats}\n {draggable ? (\n <Styled.DraggingHandle {...layoutProps} layouts={VISIBILITY_VERTICAL} onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n ) : null}\n {closeButton ? (\n <Styled.ButtonPosition>\n {isValidElement(closeButton)\n ? closeButton\n : typeof closeButton === 'function'\n ? closeButton(closeButtonProps)\n : null}\n </Styled.ButtonPosition>\n ) : null}\n {loading || media || imgSrcVertical ? (\n <Styled.Media {...layoutProps} layouts={fancy ? LAYOUTS_FANCY_MEDIA_VERTICAL : LAYOUTS_MEDIA_VERTICAL}>\n {loading ? (\n <AspectRatio ratio='3:1' width='100%'>\n <Skeleton borderRadius={0} />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='3:1' width='100%'>\n <Styled.Img src={imgSrcVertical} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n {loading || media || imgSrcHorizontal ? (\n <Styled.Media {...layoutProps} layouts={LAYOUTS_MEDIA_HORIZONTAL}>\n {loading ? (\n <AspectRatio ratio='5:7' height='100%'>\n <Skeleton borderRadius={0} />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='5:7' height='100%'>\n <Styled.Img src={imgSrcHorizontal} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n <Styled.Body>\n {progressLine && !loading ? (\n <Styled.ProgressPosition {...layoutProps} layouts={fancy ? LAYOUTS_FANCY_PROGRESS : LAYOUTS_PROGRESS}>\n {isValidElement(progressLine)\n ? progressLine\n : typeof progressLine === 'function'\n ? progressLine(progressLineProps)\n : null}\n </Styled.ProgressPosition>\n ) : null}\n {draggable ? (\n <Styled.DraggingHandle {...layoutProps} layouts={VISIBILITY_HORIZONTAL} onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n ) : null}\n {fancy ? <Styled.LayoutSpacer {...layoutProps} layouts={VISIBILITY_HORIZONTAL} paddingTop={76} /> : null}\n {loading ? (\n <Styled.Container {...sizeProps} sizes={SIZES_CONTAINER}>\n <Styled.Content {...sizeProps} sizes={SIZES_CONTENT}>\n <Skeleton>\n <Text {...titleProps} marginBottom='1.5em' />\n </Skeleton>\n <Skeleton width='90%'>\n <Text {...subtitleProps} marginBottom='0.4em' />\n </Skeleton>\n <Skeleton width='70%'>\n <Text {...subtitleProps} marginBottom='0.4em' />\n </Skeleton>\n <Skeleton width='50%'>\n <Text {...subtitleProps} marginBottom='0.8em' />\n </Skeleton>\n </Styled.Content>\n </Styled.Container>\n ) : isValidElement(body) ? (\n body\n ) : typeof body === 'function' ? (\n body({\n captionProps,\n titleProps,\n subtitleProps,\n })\n ) : (\n <Styled.Container {...sizeProps} sizes={SIZES_CONTAINER}>\n {scrollFadingEnabled ? <Styled.Fading visible={scrollThresholds.top === false} /> : null}\n <Styled.Content\n {...sizeProps}\n sizes={SIZES_CONTENT}\n ref={(node) => {\n setContentRef(node)\n }}\n scrollable={scrollable}\n tabIndex={scrollable ? 0 : undefined}\n onScroll={(evt) => {\n if (scrollFadingEnabled) {\n setScrollThresholds(evt.currentTarget)\n }\n }}\n onKeyDown={(evt) => {\n if (keyboardKeys.ArrowUp.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, -13)\n } else if (keyboardKeys.ArrowDown.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, 13)\n }\n }}\n >\n {isValidElement(caption) ? (\n caption\n ) : typeof caption === 'function' ? (\n caption(captionProps)\n ) : typeof caption === 'string' || typeof caption === 'number' ? (\n <Text {...captionProps}>{caption}</Text>\n ) : null}\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title(titleProps)\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...titleProps}>{title}</Text>\n ) : null}\n {isValidElement(subtitle) ? (\n subtitle\n ) : typeof subtitle === 'function' ? (\n subtitle(subtitleProps)\n ) : typeof subtitle === 'string' || typeof subtitle === 'number' ? (\n <Text {...subtitleProps}>{subtitle}</Text>\n ) : null}\n {children}\n </Styled.Content>\n {scrollFadingEnabled ? <Styled.Fading visible={scrollThresholds.bottom === false} after /> : null}\n {footer ? (\n <Styled.Footer {...sizeProps} sizes={SIZES_FOOTER}>\n {footer}\n </Styled.Footer>\n ) : null}\n </Styled.Container>\n )}\n </Styled.Body>\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogComponent }\n"],"names":["DialogComponent","withMergedProps","forwardRef","props","ref","size","layout","scrollable","scrollFading","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","root","floats","media","body","caption","title","subtitle","children","footer","closeButton","progressLine","fancy","imgSrcVertical","imgSrcHorizontal","draggable","loading","className","backgroundClassName","onGrab","onNudge","restProps","sizeProps","layoutProps","captionProps","appearance","color","wordBreak","marginBottom","sizes","SIZES_CAPTION","titleProps","as","SIZES_TITLE","subtitleProps","SIZES_SUBTITLE","closeButtonProps","icon","secondary","marginTop","marginRight","progressLineProps","rootClassName","concatClassNames","scrollFadingEnabled","contentRef","setContentRef","useState","scrollThresholds","setScrollThresholds","useScrollThresholds","enabled","target","_jsxs","Styled","layouts","LAYOUTS_FANCY","LAYOUTS","_jsx","isValidElement","_Fragment","VISIBILITY_VERTICAL","onPointerDown","tabIndex","onKeyDown","Icon","Dragging","LAYOUTS_FANCY_MEDIA_VERTICAL","LAYOUTS_MEDIA_VERTICAL","AspectRatio","ratio","width","Skeleton","borderRadius","src","LAYOUTS_MEDIA_HORIZONTAL","height","LAYOUTS_FANCY_PROGRESS","LAYOUTS_PROGRESS","VISIBILITY_HORIZONTAL","paddingTop","SIZES_CONTAINER","SIZES_CONTENT","Text","visible","top","node","undefined","onScroll","evt","currentTarget","keyboardKeys","ArrowUp","validate","key","preventDefault","scrollBy","ArrowDown","bottom","after","SIZES_FOOTER","SIZES_FANCY","SIZES","displayName"],"mappings":"ojCAwCMA,MAAAA,gBAAyEC,gBAI7EC,YAA8D,CAACC,EAAOC,KACpE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,WAAUC,WACnBA,GAAa,EAAKC,aAClBA,GAAe,EAAKC,QACpBA,EAAOC,OACPA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A,EACZ4E,SAAU5E,EAAa,OAAIoG,EAC3BC,SAAWC,IACL7C,GACFK,EAAoBwC,EAAIC,cAC1B,EAEF1B,UAAYyB,IACNE,aAAaC,QAAQC,SAASJ,EAAIK,MACpCL,EAAIM,iBACJN,EAAIC,cAAcM,SAAS,GAAI,KACtBL,aAAaM,UAAUJ,SAASJ,EAAIK,OAC7CL,EAAIM,iBACJN,EAAIC,cAAcM,SAAS,EAAG,IAChC,EACAxF,SAED,CAAAmD,eAAetD,GACdA,SACSA,GAAY,WACrBA,EAAQmB,UACCnB,GAAY,iBAAmBA,GAAY,SACpDqD,IAACyB,KAAI,IAAK3D,EAAYhB,SAAGH,IACvB,KACHsD,eAAerD,GACdA,SACSA,GAAU,WACnBA,EAAMyB,UACGzB,GAAU,iBAAmBA,GAAU,SAChDoD,IAACyB,KAAI,IAAKpD,EAAUvB,SAAGF,IACrB,KACHqD,eAAepD,GACdA,SACSA,GAAa,WACtBA,EAAS2B,UACA3B,GAAa,iBAAmBA,GAAa,SACtDmD,IAACyB,KAAI,IAAKjD,EAAa1B,SAAGD,IACxB,KACHC,KAEFoC,EAAsBc,IAACJ,OAAa,CAAC8B,QAASpC,EAAiBkD,UAAW,EAAOC,OAAK,IAAM,KAC5F1F,EACCiD,IAACJ,OAAa,IAAKhC,EAAWO,MAAOuE,aAAa5F,SAC/CC,IAED,gBAMF,IAGlB,CACEoB,MAAQ9C,GAAWA,EAAM6B,MAAQyF,YAAcC,MAC/CC,YAvSmB"}
|
|
1
|
+
{"version":3,"file":"DialogComponent.mjs","sources":["../../../../src/components/DialogComponent/DialogComponent.tsx"],"sourcesContent":["import { forwardRef, useState, isValidElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { useScrollThresholds } from 'hooks/useScrollThresholds'\nimport { keyboardKeys } from 'shared/constants'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport { AspectRatio } from 'components/AspectRatio'\nimport type { TextProps } from 'components/Text'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { ProgressLineProps } from 'components/ProgressLine'\nimport { concatClassNames } from 'shared/utils/dom'\nimport Dragging from './images/dragging.svg?module'\nimport * as Styled from './style'\nimport {\n SIZES,\n SIZES_FANCY,\n SIZES_CONTAINER,\n SIZES_CONTENT,\n SIZES_FOOTER,\n SIZES_CAPTION,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n SIZES_STICKY_HEADER,\n} from './sizes'\nimport {\n LAYOUTS,\n LAYOUTS_FANCY,\n LAYOUTS_MEDIA_VERTICAL,\n LAYOUTS_FANCY_MEDIA_VERTICAL,\n LAYOUTS_MEDIA_HORIZONTAL,\n LAYOUTS_PROGRESS,\n LAYOUTS_FANCY_PROGRESS,\n VISIBILITY_VERTICAL,\n VISIBILITY_HORIZONTAL,\n} from './layouts'\nimport type { DialogComponentProps } from './types'\nimport { Header } from './Header'\n\nconst COMPONENT_NAME = 'DialogComponent'\n\nconst DialogComponent: React.ForwardRefExoticComponent<DialogComponentProps> = withMergedProps<\n DialogComponentProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<DialogComponentProps>>((props, ref) => {\n const {\n size = 's',\n layout = 'vertical',\n scrollable = false,\n scrollFading = false,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n root,\n floats,\n media,\n body,\n header,\n caption,\n title,\n subtitle,\n children,\n footer,\n closeButton,\n progressLine,\n fancy,\n imgSrcVertical,\n imgSrcHorizontal,\n draggable,\n loading,\n stickyHeader,\n className,\n backgroundClassName,\n onGrab,\n onNudge,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const captionProps: TextProps = {\n ...sizeProps,\n appearance: 'body',\n color: 'content-onmain-tertiary',\n wordBreak: 'break-word',\n marginBottom: '0.8em',\n sizes: SIZES_CAPTION,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'h2',\n appearance: 'heading',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n marginBottom: '0.5em',\n sizes: SIZES_TITLE,\n }\n\n const subtitleProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n marginBottom: '0.8em',\n sizes: SIZES_SUBTITLE,\n }\n\n const closeButtonProps: IconButtonProps = fancy\n ? { icon: 'close', size: 'xxl', secondary: true }\n : { icon: 'close', size: 'l', marginTop: 8, marginRight: 8 }\n\n const progressLineProps: ProgressLineProps = {\n size: 'xs',\n }\n\n const rootClassName = !fancy ? concatClassNames(className, backgroundClassName) : className\n\n const scrollFadingEnabled = scrollable && scrollFading\n\n const [contentRef, setContentRef] = useState<HTMLDivElement | null>(null)\n\n const { scrollThresholds, setScrollThresholds } = useScrollThresholds({\n enabled: scrollFadingEnabled,\n target: contentRef,\n })\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n {...layoutProps}\n layouts={fancy ? LAYOUTS_FANCY : LAYOUTS}\n className={rootClassName}\n fancy={fancy}\n ref={ref}\n >\n {fancy ? <Styled.FancyBackground className={backgroundClassName} /> : null}\n {isValidElement(root) ? (\n root\n ) : typeof root === 'function' ? (\n root({\n captionProps,\n titleProps,\n subtitleProps,\n closeButtonProps,\n progressLineProps,\n onGrab,\n onNudge,\n })\n ) : (\n <>\n {floats}\n {draggable ? (\n <Styled.DraggingHandle {...layoutProps} layouts={VISIBILITY_VERTICAL} onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n ) : null}\n {closeButton ? (\n <Styled.ButtonPosition>\n {isValidElement(closeButton)\n ? closeButton\n : typeof closeButton === 'function'\n ? closeButton(closeButtonProps)\n : null}\n </Styled.ButtonPosition>\n ) : null}\n {loading || media || imgSrcVertical ? (\n <Styled.Media {...layoutProps} layouts={fancy ? LAYOUTS_FANCY_MEDIA_VERTICAL : LAYOUTS_MEDIA_VERTICAL}>\n {loading ? (\n <AspectRatio ratio='3:1' width='100%'>\n <Skeleton borderRadius={0} />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='3:1' width='100%'>\n <Styled.Img src={imgSrcVertical} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n {loading || media || imgSrcHorizontal ? (\n <Styled.Media {...layoutProps} layouts={LAYOUTS_MEDIA_HORIZONTAL}>\n {loading ? (\n <AspectRatio ratio='5:7' height='100%'>\n <Skeleton borderRadius={0} />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='5:7' height='100%'>\n <Styled.Img src={imgSrcHorizontal} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n <Styled.Body>\n {progressLine && !loading ? (\n <Styled.ProgressPosition {...layoutProps} layouts={fancy ? LAYOUTS_FANCY_PROGRESS : LAYOUTS_PROGRESS}>\n {isValidElement(progressLine)\n ? progressLine\n : typeof progressLine === 'function'\n ? progressLine(progressLineProps)\n : null}\n </Styled.ProgressPosition>\n ) : null}\n {draggable ? (\n <Styled.DraggingHandle {...layoutProps} layouts={VISIBILITY_HORIZONTAL} onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n ) : null}\n {fancy ? <Styled.LayoutSpacer {...layoutProps} layouts={VISIBILITY_HORIZONTAL} paddingTop={76} /> : null}\n {loading ? (\n <Styled.Container {...sizeProps} sizes={SIZES_CONTAINER}>\n <Styled.Content {...sizeProps} sizes={SIZES_CONTENT}>\n <Skeleton>\n <Text {...titleProps} marginBottom='1.5em' />\n </Skeleton>\n <Skeleton width='90%'>\n <Text {...subtitleProps} marginBottom='0.4em' />\n </Skeleton>\n <Skeleton width='70%'>\n <Text {...subtitleProps} marginBottom='0.4em' />\n </Skeleton>\n <Skeleton width='50%'>\n <Text {...subtitleProps} marginBottom='0.8em' />\n </Skeleton>\n </Styled.Content>\n </Styled.Container>\n ) : isValidElement(body) ? (\n body\n ) : typeof body === 'function' ? (\n body({\n captionProps,\n titleProps,\n subtitleProps,\n })\n ) : (\n <Styled.Container {...sizeProps} sizes={SIZES_CONTAINER}>\n {stickyHeader ? (\n <Styled.StickyHeader {...sizeProps} sizes={SIZES_STICKY_HEADER}>\n <Header\n header={header}\n caption={caption}\n title={title}\n subtitle={subtitle}\n captionProps={captionProps}\n titleProps={titleProps}\n subtitleProps={subtitleProps}\n />\n </Styled.StickyHeader>\n ) : null}\n {scrollFadingEnabled ? <Styled.Fading visible={scrollThresholds.top === false} /> : null}\n <Styled.Content\n {...sizeProps}\n sizes={SIZES_CONTENT}\n ref={(node) => {\n setContentRef(node)\n }}\n scrollable={scrollable}\n tabIndex={scrollable ? 0 : undefined}\n onScroll={(evt) => {\n if (scrollFadingEnabled) {\n setScrollThresholds(evt.currentTarget)\n }\n }}\n onKeyDown={(evt) => {\n if (keyboardKeys.ArrowUp.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, -13)\n } else if (keyboardKeys.ArrowDown.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, 13)\n }\n }}\n >\n {!stickyHeader ? (\n <Header\n header={header}\n caption={caption}\n title={title}\n subtitle={subtitle}\n captionProps={captionProps}\n titleProps={titleProps}\n subtitleProps={subtitleProps}\n />\n ) : null}\n {children}\n </Styled.Content>\n {scrollFadingEnabled ? <Styled.Fading visible={scrollThresholds.bottom === false} after /> : null}\n {footer ? (\n <Styled.Footer {...sizeProps} sizes={SIZES_FOOTER}>\n {footer}\n </Styled.Footer>\n ) : null}\n </Styled.Container>\n )}\n </Styled.Body>\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogComponent }\n"],"names":["DialogComponent","withMergedProps","forwardRef","props","ref","size","layout","scrollable","scrollFading","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","root","floats","media","body","header","caption","title","subtitle","children","footer","closeButton","progressLine","fancy","imgSrcVertical","imgSrcHorizontal","draggable","loading","stickyHeader","className","backgroundClassName","onGrab","onNudge","restProps","sizeProps","layoutProps","captionProps","appearance","color","wordBreak","marginBottom","sizes","SIZES_CAPTION","titleProps","as","SIZES_TITLE","subtitleProps","SIZES_SUBTITLE","closeButtonProps","icon","secondary","marginTop","marginRight","progressLineProps","rootClassName","concatClassNames","scrollFadingEnabled","contentRef","setContentRef","useState","scrollThresholds","setScrollThresholds","useScrollThresholds","enabled","target","_jsxs","Styled","layouts","LAYOUTS_FANCY","LAYOUTS","_jsx","isValidElement","_Fragment","VISIBILITY_VERTICAL","onPointerDown","tabIndex","onKeyDown","Icon","Dragging","LAYOUTS_FANCY_MEDIA_VERTICAL","LAYOUTS_MEDIA_VERTICAL","AspectRatio","ratio","width","Skeleton","borderRadius","src","LAYOUTS_MEDIA_HORIZONTAL","height","LAYOUTS_FANCY_PROGRESS","LAYOUTS_PROGRESS","VISIBILITY_HORIZONTAL","paddingTop","SIZES_CONTAINER","SIZES_CONTENT","Text","SIZES_STICKY_HEADER","Header","visible","top","node","undefined","onScroll","evt","currentTarget","keyboardKeys","ArrowUp","validate","key","preventDefault","scrollBy","ArrowDown","bottom","after","SIZES_FOOTER","SIZES_FANCY","SIZES","displayName"],"mappings":"snCA0CMA,M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EAAWO,MAAOoD,gBAAgB1E,UACrDS,EACC0C,IAACJ,aAAmB,IAAKhC,EAAWO,MAAOuD,oBAAoB7E,SAC7DmD,IAAC2B,OAAM,CACLlF,OAAQA,EACRC,QAASA,EACTC,MAAOA,EACPC,SAAUA,EACVkB,aAAcA,EACdO,WAAYA,EACZG,cAAeA,MAGjB,KACHU,EAAsBc,IAACJ,OAAa,CAACgC,QAAStC,EAAiBuC,OAAQ,IAAY,KACpFlC,KAACC,QAAc,IACThC,EACJO,MAAOqD,cACPpG,IAAM0G,IACJ1C,EAAc0C,EAAK,EAErBvG,WAAYA,EACZ8E,SAAU9E,EAAa,OAAIwG,EAC3BC,SAAWC,IACL/C,GACFK,EAAoB0C,EAAIC,cAC1B,EAEF5B,UAAY2B,IACNE,aAAaC,QAAQC,SAASJ,EAAIK,MACpCL,EAAIM,iBACJN,EAAIC,cAAcM,SAAS,GAAI,KACtBL,aAAaM,UAAUJ,SAASJ,EAAIK,OAC7CL,EAAIM,iBACJN,EAAIC,cAAcM,SAAS,EAAG,IAChC,EACA3F,UAEAS,EAUE,KATF0C,IAAC2B,OAAM,CACLlF,OAAQA,EACRC,QAASA,EACTC,MAAOA,EACPC,SAAUA,EACVkB,aAAcA,EACdO,WAAYA,EACZG,cAAeA,IAGlB3B,KAEFqC,EAAsBc,IAACJ,OAAa,CAACgC,QAAStC,EAAiBoD,UAAW,EAAOC,OAAK,IAAM,KAC5F7F,EACCkD,IAACJ,OAAa,IAAKhC,EAAWO,MAAOyE,aAAa/F,SAC/CC,IAED,gBAMF,IAGlB,CACEqB,MAAQhD,GAAWA,EAAM8B,MAAQ4F,YAAcC,MAC/CC,YA5SmB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var renderSlot=require('../../shared/utils/renderSlot.js');var jsxRuntime=require('react/jsx-runtime');var Text=require('../Text/Text.js');const createText=(e,t)=>typeof e=='string'||typeof e=='number'?jsxRuntime.jsx(Text.Text,{...t,children:e}):null;exports.Header=({header:e,caption:t,title:r,subtitle:s,captionProps:l,titleProps:o,subtitleProps:n})=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:renderSlot.renderSlot({slot:e,props:{captionProps:l,titleProps:o,subtitleProps:n},fallback:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[renderSlot.renderSlot({slot:t,props:l,fallback:createText(t,l)}),renderSlot.renderSlot({slot:r,props:o,fallback:createText(r,o)}),renderSlot.renderSlot({slot:s,props:n,fallback:createText(s,n)})]})})});
|
|
2
|
+
//# sourceMappingURL=Header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.js","sources":["../../../../src/components/DialogComponent/Header.tsx"],"sourcesContent":["import type { FC } from 'react'\nimport { renderSlot } from 'shared/utils/renderSlot'\nimport type { TextProps } from 'components/Text'\nimport { Text } from 'components/Text'\nimport type { HeaderProps } from './types'\n\nconst createText = (content: unknown, props: TextProps) => {\n return typeof content === 'string' || typeof content === 'number' ? <Text {...props}>{content}</Text> : null\n}\n\nconst Header: FC<HeaderProps> = ({ header, caption, title, subtitle, captionProps, titleProps, subtitleProps }) => (\n <>\n {renderSlot({\n slot: header,\n props: { captionProps, titleProps, subtitleProps },\n fallback: (\n <>\n {renderSlot({\n slot: caption,\n props: captionProps,\n fallback: createText(caption, captionProps),\n })}\n\n {renderSlot({\n slot: title,\n props: titleProps,\n fallback: createText(title, titleProps),\n })}\n\n {renderSlot({\n slot: subtitle,\n props: subtitleProps,\n fallback: createText(subtitle, subtitleProps),\n })}\n </>\n ),\n })}\n </>\n)\n\nexport { Header }\n"],"names":["createText","content","props","_jsx","jsx","Text","children","Header","header","caption","title","subtitle","captionProps","titleProps","subtitleProps","_Fragment","renderSlot","slot","fallback","_jsxs","jsxs"],"mappings":"wJAMA,MAAMA,WAAaA,CAACC,EAAkBC,WACtBD,GAAY,iBAAmBA,GAAY,SAAWE,WAAAC,IAACC,UAAI,IAAKH,EAAKI,SAAGL,IAAkB,oBAG1EM,EAAGC,SAAQC,UAASC,QAAOC,WAAUC,eAAcC,aAAYC,mBAC7FX,WAAAA,IAAAY,WAAAA,SAAA,CAAAT,SACGU,WAAAA,WAAW,CACVC,KAAMT,EACNN,MAAO,CAAEU,eAAcC,aAAYC,iBACnCI,SACEC,WAAAC,KAAAL,oBAAA,CAAAT,SAAA,CACGU,WAAAA,WAAW,CACVC,KAAMR,EACNP,MAAOU,EACPM,SAAUlB,WAAWS,EAASG,KAG/BI,WAAAA,WAAW,CACVC,KAAMP,EACNR,MAAOW,EACPK,SAAUlB,WAAWU,EAAOG,KAG7BG,WAAAA,WAAW,CACVC,KAAMN,EACNT,MAAOY,EACPI,SAAUlB,WAAWW,EAAUG"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{renderSlot}from'../../shared/utils/renderSlot.mjs';import{jsx,Fragment,jsxs}from'react/jsx-runtime';import{Text}from'../Text/Text.mjs';const createText=(e,t)=>typeof e=='string'||typeof e=='number'?jsx(Text,{...t,children:e}):null;const Header=({header:e,caption:t,title:r,subtitle:o,captionProps:s,titleProps:l,subtitleProps:a})=>jsx(Fragment,{children:renderSlot({slot:e,props:{captionProps:s,titleProps:l,subtitleProps:a},fallback:jsxs(Fragment,{children:[renderSlot({slot:t,props:s,fallback:createText(t,s)}),renderSlot({slot:r,props:l,fallback:createText(r,l)}),renderSlot({slot:o,props:a,fallback:createText(o,a)})]})})});export{Header};
|
|
2
|
+
//# sourceMappingURL=Header.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.mjs","sources":["../../../../src/components/DialogComponent/Header.tsx"],"sourcesContent":["import type { FC } from 'react'\nimport { renderSlot } from 'shared/utils/renderSlot'\nimport type { TextProps } from 'components/Text'\nimport { Text } from 'components/Text'\nimport type { HeaderProps } from './types'\n\nconst createText = (content: unknown, props: TextProps) => {\n return typeof content === 'string' || typeof content === 'number' ? <Text {...props}>{content}</Text> : null\n}\n\nconst Header: FC<HeaderProps> = ({ header, caption, title, subtitle, captionProps, titleProps, subtitleProps }) => (\n <>\n {renderSlot({\n slot: header,\n props: { captionProps, titleProps, subtitleProps },\n fallback: (\n <>\n {renderSlot({\n slot: caption,\n props: captionProps,\n fallback: createText(caption, captionProps),\n })}\n\n {renderSlot({\n slot: title,\n props: titleProps,\n fallback: createText(title, titleProps),\n })}\n\n {renderSlot({\n slot: subtitle,\n props: subtitleProps,\n fallback: createText(subtitle, subtitleProps),\n })}\n </>\n ),\n })}\n </>\n)\n\nexport { Header }\n"],"names":["createText","content","props","_jsx","Text","children","Header","header","caption","title","subtitle","captionProps","titleProps","subtitleProps","_Fragment","renderSlot","slot","fallback","_jsxs"],"mappings":"8IAMA,MAAMA,WAAaA,CAACC,EAAkBC,WACtBD,GAAY,iBAAmBA,GAAY,SAAWE,IAACC,KAAI,IAAKF,EAAKG,SAAGJ,IAAkB,KAGpGK,MAAAA,OAA0BA,EAAGC,SAAQC,UAASC,QAAOC,WAAUC,eAAcC,aAAYC,mBAC7FV,IAAAW,SAAA,CAAAT,SACGU,WAAW,CACVC,KAAMT,EACNL,MAAO,CAAES,eAAcC,aAAYC,iBACnCI,SACEC,KAAAJ,SAAA,CAAAT,SAAA,CACGU,WAAW,CACVC,KAAMR,EACNN,MAAOS,EACPM,SAAUjB,WAAWQ,EAASG,KAG/BI,WAAW,CACVC,KAAMP,EACNP,MAAOU,EACPK,SAAUjB,WAAWS,EAAOG,KAG7BG,WAAW,CACVC,KAAMN,EACNR,MAAOW,EACPI,SAAUjB,WAAWU,EAAUG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';const SIZES={xxl:{width:'100%',minWidth:'min-content',maxWidth:1228,borderRadius:20},xl:{width:'100%',minWidth:'min-content',maxWidth:960,borderRadius:20},l:{width:'100%',minWidth:'min-content',maxWidth:780,borderRadius:20},m:{width:'100%',minWidth:'min-content',maxWidth:560,borderRadius:20},s:{width:'100%',minWidth:'min-content',maxWidth:440,borderRadius:20},xs:{width:'100%',minWidth:'min-content',maxWidth:304,borderRadius:20}};const SIZES_FANCY={xxl:{...SIZES.xxl,borderRadius:0},xl:{...SIZES.xl,borderRadius:0},l:{...SIZES.l,borderRadius:0},m:{...SIZES.m,borderRadius:0},s:{...SIZES.s,borderRadius:0},xs:{...SIZES.xs,borderRadius:0}};exports.SIZES=SIZES,exports.SIZES_CAPTION={xxl:{fontSize:20},xl:{fontSize:18},l:{fontSize:18},m:{fontSize:14},s:{fontSize:14},xs:{fontSize:14}},exports.SIZES_CONTAINER={xxl:{paddingTop:44,paddingBottom:44},xl:{paddingTop:36,paddingBottom:36},l:{paddingTop:32,paddingBottom:32},m:{paddingTop:28,paddingBottom:28},s:{paddingTop:28,paddingBottom:28},xs:{paddingTop:20,paddingBottom:20}},exports.SIZES_CONTENT={xxl:{padding:'4px 44px',margin:'0px 4px'},xl:{padding:'4px 36px',margin:'0px 4px'},l:{padding:'4px 32px',margin:'0px 4px'},m:{padding:'4px 28px',margin:'0px 4px'},s:{padding:'4px 28px',margin:'0px 4px'},xs:{padding:'4px 20px',margin:'0px 4px'}},exports.SIZES_FANCY=SIZES_FANCY,exports.SIZES_FOOTER={xxl:{padding:'12px 48px 4px'},xl:{padding:'12px 40px 4px'},l:{padding:'12px 36px 4px'},m:{padding:'12px 32px 4px'},s:{padding:'12px 32px 4px'},xs:{padding:'12px 24px 4px'}},exports.SIZES_SUBTITLE={xxl:{fontSize:24},xl:{fontSize:20},l:{fontSize:20},m:{fontSize:16},s:{fontSize:16},xs:{fontSize:14}},exports.SIZES_TITLE={xxl:{fontSize:32},xl:{fontSize:28},l:{fontSize:24},m:{fontSize:20},s:{fontSize:18},xs:{fontSize:16}};
|
|
1
|
+
'use strict';const SIZES={xxl:{width:'100%',minWidth:'min-content',maxWidth:1228,borderRadius:20},xl:{width:'100%',minWidth:'min-content',maxWidth:960,borderRadius:20},l:{width:'100%',minWidth:'min-content',maxWidth:780,borderRadius:20},m:{width:'100%',minWidth:'min-content',maxWidth:560,borderRadius:20},s:{width:'100%',minWidth:'min-content',maxWidth:440,borderRadius:20},xs:{width:'100%',minWidth:'min-content',maxWidth:304,borderRadius:20}};const SIZES_FANCY={xxl:{...SIZES.xxl,borderRadius:0},xl:{...SIZES.xl,borderRadius:0},l:{...SIZES.l,borderRadius:0},m:{...SIZES.m,borderRadius:0},s:{...SIZES.s,borderRadius:0},xs:{...SIZES.xs,borderRadius:0}};exports.SIZES=SIZES,exports.SIZES_CAPTION={xxl:{fontSize:20},xl:{fontSize:18},l:{fontSize:18},m:{fontSize:14},s:{fontSize:14},xs:{fontSize:14}},exports.SIZES_CONTAINER={xxl:{paddingTop:44,paddingBottom:44},xl:{paddingTop:36,paddingBottom:36},l:{paddingTop:32,paddingBottom:32},m:{paddingTop:28,paddingBottom:28},s:{paddingTop:28,paddingBottom:28},xs:{paddingTop:20,paddingBottom:20}},exports.SIZES_CONTENT={xxl:{padding:'4px 44px',margin:'0px 4px'},xl:{padding:'4px 36px',margin:'0px 4px'},l:{padding:'4px 32px',margin:'0px 4px'},m:{padding:'4px 28px',margin:'0px 4px'},s:{padding:'4px 28px',margin:'0px 4px'},xs:{padding:'4px 20px',margin:'0px 4px'}},exports.SIZES_FANCY=SIZES_FANCY,exports.SIZES_FOOTER={xxl:{padding:'12px 48px 4px'},xl:{padding:'12px 40px 4px'},l:{padding:'12px 36px 4px'},m:{padding:'12px 32px 4px'},s:{padding:'12px 32px 4px'},xs:{padding:'12px 24px 4px'}},exports.SIZES_STICKY_HEADER={xxl:{padding:'0px 44px 5px',margin:'0px 4px'},xl:{padding:'0px 36px 5px',margin:'0px 4px'},l:{padding:'0px 32px 5px',margin:'0px 4px'},m:{padding:'0px 28px 5px',margin:'0px 4px'},s:{padding:'0px 28px 5px',margin:'0px 4px'},xs:{padding:'0px 20px 5px',margin:'0px 4px'}},exports.SIZES_SUBTITLE={xxl:{fontSize:24},xl:{fontSize:20},l:{fontSize:20},m:{fontSize:16},s:{fontSize:16},xs:{fontSize:14}},exports.SIZES_TITLE={xxl:{fontSize:32},xl:{fontSize:28},l:{fontSize:24},m:{fontSize:20},s:{fontSize:18},xs:{fontSize:16}};
|
|
2
2
|
//# sourceMappingURL=sizes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sizes.js","sources":["../../../../src/components/DialogComponent/sizes.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from './types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xxl: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 1228,\n borderRadius: 20,\n },\n xl: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 960,\n borderRadius: 20,\n },\n l: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 780,\n borderRadius: 20,\n },\n m: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 560,\n borderRadius: 20,\n },\n s: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 440,\n borderRadius: 20,\n },\n xs: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 304,\n borderRadius: 20,\n },\n}\n\nexport const SIZES_FANCY: Record<Size, CSSProperties> = {\n xxl: { ...SIZES.xxl, borderRadius: 0 },\n xl: { ...SIZES.xl, borderRadius: 0 },\n l: { ...SIZES.l, borderRadius: 0 },\n m: { ...SIZES.m, borderRadius: 0 },\n s: { ...SIZES.s, borderRadius: 0 },\n xs: { ...SIZES.xs, borderRadius: 0 },\n}\n\nexport const SIZES_CONTAINER: Record<Size, CSSProperties> = {\n xxl: {\n paddingTop: 44,\n paddingBottom: 44,\n },\n xl: {\n paddingTop: 36,\n paddingBottom: 36,\n },\n l: {\n paddingTop: 32,\n paddingBottom: 32,\n },\n m: {\n paddingTop: 28,\n paddingBottom: 28,\n },\n s: {\n paddingTop: 28,\n paddingBottom: 28,\n },\n xs: {\n paddingTop: 20,\n paddingBottom: 20,\n },\n}\n\nexport const SIZES_CONTENT: Record<Size, CSSProperties> = {\n xxl: {\n padding: '4px 44px',\n margin: '0px 4px',\n },\n xl: {\n padding: '4px 36px',\n margin: '0px 4px',\n },\n l: {\n padding: '4px 32px',\n margin: '0px 4px',\n },\n m: {\n padding: '4px 28px',\n margin: '0px 4px',\n },\n s: {\n padding: '4px 28px',\n margin: '0px 4px',\n },\n xs: {\n padding: '4px 20px',\n margin: '0px 4px',\n },\n}\n\nexport const SIZES_FOOTER: Record<Size, CSSProperties> = {\n xxl: { padding: '12px 48px 4px' },\n xl: { padding: '12px 40px 4px' },\n l: { padding: '12px 36px 4px' },\n m: { padding: '12px 32px 4px' },\n s: { padding: '12px 32px 4px' },\n xs: { padding: '12px 24px 4px' },\n}\n\nexport const SIZES_CAPTION: Record<Size, CSSProperties> = {\n xxl: { fontSize: 20 },\n xl: { fontSize: 18 },\n l: { fontSize: 18 },\n m: { fontSize: 14 },\n s: { fontSize: 14 },\n xs: { fontSize: 14 },\n}\n\nexport const SIZES_TITLE: Record<Size, CSSProperties> = {\n xxl: { fontSize: 32 },\n xl: { fontSize: 28 },\n l: { fontSize: 24 },\n m: { fontSize: 20 },\n s: { fontSize: 18 },\n xs: { fontSize: 16 },\n}\n\nexport const SIZES_SUBTITLE: Record<Size, CSSProperties> = {\n xxl: { fontSize: 24 },\n xl: { fontSize: 20 },\n l: { fontSize: 20 },\n m: { fontSize: 16 },\n s: { fontSize: 16 },\n xs: { fontSize: 14 },\n}\n"],"names":["SIZES","xxl","width","minWidth","maxWidth","borderRadius","xl","l","m","s","xs","SIZES_FANCY","fontSize","paddingTop","paddingBottom","padding","margin"],"mappings":"aAGO,MAAMA,MAAqC,CAChDC,IAAK,CACHC,MAAO,OACPC,SAAU,cACVC,SAAU,KACVC,aAAc,IAEhBC,GAAI,CACFJ,MAAO,OACPC,SAAU,cACVC,SAAU,IACVC,aAAc,IAEhBE,EAAG,CACDL,MAAO,OACPC,SAAU,cACVC,SAAU,IACVC,aAAc,IAEhBG,EAAG,CACDN,MAAO,OACPC,SAAU,cACVC,SAAU,IACVC,aAAc,IAEhBI,EAAG,CACDP,MAAO,OACPC,SAAU,cACVC,SAAU,IACVC,aAAc,IAEhBK,GAAI,CACFR,MAAO,OACPC,SAAU,cACVC,SAAU,IACVC,aAAc,KAIX,MAAMM,YAA2C,CACtDV,IAAK,IAAKD,MAAMC,IAAKI,aAAc,GACnCC,GAAI,IAAKN,MAAMM,GAAID,aAAc,GACjCE,EAAG,IAAKP,MAAMO,EAAGF,aAAc,GAC/BG,EAAG,IAAKR,MAAMQ,EAAGH,aAAc,GAC/BI,EAAG,IAAKT,MAAMS,EAAGJ,aAAc,GAC/BK,GAAI,IAAKV,MAAMU,GAAIL,aAAc,
|
|
1
|
+
{"version":3,"file":"sizes.js","sources":["../../../../src/components/DialogComponent/sizes.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from './types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xxl: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 1228,\n borderRadius: 20,\n },\n xl: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 960,\n borderRadius: 20,\n },\n l: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 780,\n borderRadius: 20,\n },\n m: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 560,\n borderRadius: 20,\n },\n s: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 440,\n borderRadius: 20,\n },\n xs: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 304,\n borderRadius: 20,\n },\n}\n\nexport const SIZES_FANCY: Record<Size, CSSProperties> = {\n xxl: { ...SIZES.xxl, borderRadius: 0 },\n xl: { ...SIZES.xl, borderRadius: 0 },\n l: { ...SIZES.l, borderRadius: 0 },\n m: { ...SIZES.m, borderRadius: 0 },\n s: { ...SIZES.s, borderRadius: 0 },\n xs: { ...SIZES.xs, borderRadius: 0 },\n}\n\nexport const SIZES_STICKY_HEADER: Record<Size, CSSProperties> = {\n xxl: {\n padding: '0px 44px 5px',\n margin: '0px 4px',\n },\n xl: {\n padding: '0px 36px 5px',\n margin: '0px 4px',\n },\n l: {\n padding: '0px 32px 5px',\n margin: '0px 4px',\n },\n m: {\n padding: '0px 28px 5px',\n margin: '0px 4px',\n },\n s: {\n padding: '0px 28px 5px',\n margin: '0px 4px',\n },\n xs: {\n padding: '0px 20px 5px',\n margin: '0px 4px',\n },\n}\n\nexport const SIZES_CONTAINER: Record<Size, CSSProperties> = {\n xxl: {\n paddingTop: 44,\n paddingBottom: 44,\n },\n xl: {\n paddingTop: 36,\n paddingBottom: 36,\n },\n l: {\n paddingTop: 32,\n paddingBottom: 32,\n },\n m: {\n paddingTop: 28,\n paddingBottom: 28,\n },\n s: {\n paddingTop: 28,\n paddingBottom: 28,\n },\n xs: {\n paddingTop: 20,\n paddingBottom: 20,\n },\n}\n\nexport const SIZES_CONTENT: Record<Size, CSSProperties> = {\n xxl: {\n padding: '4px 44px',\n margin: '0px 4px',\n },\n xl: {\n padding: '4px 36px',\n margin: '0px 4px',\n },\n l: {\n padding: '4px 32px',\n margin: '0px 4px',\n },\n m: {\n padding: '4px 28px',\n margin: '0px 4px',\n },\n s: {\n padding: '4px 28px',\n margin: '0px 4px',\n },\n xs: {\n padding: '4px 20px',\n margin: '0px 4px',\n },\n}\n\nexport const SIZES_FOOTER: Record<Size, CSSProperties> = {\n xxl: { padding: '12px 48px 4px' },\n xl: { padding: '12px 40px 4px' },\n l: { padding: '12px 36px 4px' },\n m: { padding: '12px 32px 4px' },\n s: { padding: '12px 32px 4px' },\n xs: { padding: '12px 24px 4px' },\n}\n\nexport const SIZES_CAPTION: Record<Size, CSSProperties> = {\n xxl: { fontSize: 20 },\n xl: { fontSize: 18 },\n l: { fontSize: 18 },\n m: { fontSize: 14 },\n s: { fontSize: 14 },\n xs: { fontSize: 14 },\n}\n\nexport const SIZES_TITLE: Record<Size, CSSProperties> = {\n xxl: { fontSize: 32 },\n xl: { fontSize: 28 },\n l: { fontSize: 24 },\n m: { fontSize: 20 },\n s: { fontSize: 18 },\n xs: { fontSize: 16 },\n}\n\nexport const SIZES_SUBTITLE: Record<Size, CSSProperties> = {\n xxl: { fontSize: 24 },\n xl: { fontSize: 20 },\n l: { fontSize: 20 },\n m: { fontSize: 16 },\n s: { fontSize: 16 },\n xs: { fontSize: 14 },\n}\n"],"names":["SIZES","xxl","width","minWidth","maxWidth","borderRadius","xl","l","m","s","xs","SIZES_FANCY","fontSize","paddingTop","paddingBottom","padding","margin"],"mappings":"aAGO,MAAMA,MAAqC,CAChDC,IAAK,CACHC,MAAO,OACPC,SAAU,cACVC,SAAU,KACVC,aAAc,IAEhBC,GAAI,CACFJ,MAAO,OACPC,SAAU,cACVC,SAAU,IACVC,aAAc,IAEhBE,EAAG,CACDL,MAAO,OACPC,SAAU,cACVC,SAAU,IACVC,aAAc,IAEhBG,EAAG,CACDN,MAAO,OACPC,SAAU,cACVC,SAAU,IACVC,aAAc,IAEhBI,EAAG,CACDP,MAAO,OACPC,SAAU,cACVC,SAAU,IACVC,aAAc,IAEhBK,GAAI,CACFR,MAAO,OACPC,SAAU,cACVC,SAAU,IACVC,aAAc,KAIX,MAAMM,YAA2C,CACtDV,IAAK,IAAKD,MAAMC,IAAKI,aAAc,GACnCC,GAAI,IAAKN,MAAMM,GAAID,aAAc,GACjCE,EAAG,IAAKP,MAAMO,EAAGF,aAAc,GAC/BG,EAAG,IAAKR,MAAMQ,EAAGH,aAAc,GAC/BI,EAAG,IAAKT,MAAMS,EAAGJ,aAAc,GAC/BK,GAAI,IAAKV,MAAMU,GAAIL,aAAc,8CA6FuB,CACxDJ,IAAK,CAAEW,SAAU,IACjBN,GAAI,CAAEM,SAAU,IAChBL,EAAG,CAAEK,SAAU,IACfJ,EAAG,CAAEI,SAAU,IACfH,EAAG,CAAEG,SAAU,IACfF,GAAI,CAAEE,SAAU,6BArE0C,CAC1DX,IAAK,CACHY,WAAY,GACZC,cAAe,IAEjBR,GAAI,CACFO,WAAY,GACZC,cAAe,IAEjBP,EAAG,CACDM,WAAY,GACZC,cAAe,IAEjBN,EAAG,CACDK,WAAY,GACZC,cAAe,IAEjBL,EAAG,CACDI,WAAY,GACZC,cAAe,IAEjBJ,GAAI,CACFG,WAAY,GACZC,cAAe,2BAIuC,CACxDb,IAAK,CACHc,QAAS,WACTC,OAAQ,WAEVV,GAAI,CACFS,QAAS,WACTC,OAAQ,WAEVT,EAAG,CACDQ,QAAS,WACTC,OAAQ,WAEVR,EAAG,CACDO,QAAS,WACTC,OAAQ,WAEVP,EAAG,CACDM,QAAS,WACTC,OAAQ,WAEVN,GAAI,CACFK,QAAS,WACTC,OAAQ,iEAI6C,CACvDf,IAAK,CAAEc,QAAS,iBAChBT,GAAI,CAAES,QAAS,iBACfR,EAAG,CAAEQ,QAAS,iBACdP,EAAG,CAAEO,QAAS,iBACdN,EAAG,CAAEM,QAAS,iBACdL,GAAI,CAAEK,QAAS,8CAvF+C,CAC9Dd,IAAK,CACHc,QAAS,eACTC,OAAQ,WAEVV,GAAI,CACFS,QAAS,eACTC,OAAQ,WAEVT,EAAG,CACDQ,QAAS,eACTC,OAAQ,WAEVR,EAAG,CACDO,QAAS,eACTC,OAAQ,WAEVP,EAAG,CACDM,QAAS,eACTC,OAAQ,WAEVN,GAAI,CACFK,QAAS,eACTC,OAAQ,mCAqF+C,CACzDf,IAAK,CAAEW,SAAU,IACjBN,GAAI,CAAEM,SAAU,IAChBL,EAAG,CAAEK,SAAU,IACfJ,EAAG,CAAEI,SAAU,IACfH,EAAG,CAAEG,SAAU,IACfF,GAAI,CAAEE,SAAU,yBAfsC,CACtDX,IAAK,CAAEW,SAAU,IACjBN,GAAI,CAAEM,SAAU,IAChBL,EAAG,CAAEK,SAAU,IACfJ,EAAG,CAAEI,SAAU,IACfH,EAAG,CAAEG,SAAU,IACfF,GAAI,CAAEE,SAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const SIZES={xxl:{width:'100%',minWidth:'min-content',maxWidth:1228,borderRadius:20},xl:{width:'100%',minWidth:'min-content',maxWidth:960,borderRadius:20},l:{width:'100%',minWidth:'min-content',maxWidth:780,borderRadius:20},m:{width:'100%',minWidth:'min-content',maxWidth:560,borderRadius:20},s:{width:'100%',minWidth:'min-content',maxWidth:440,borderRadius:20},xs:{width:'100%',minWidth:'min-content',maxWidth:304,borderRadius:20}};const SIZES_FANCY={xxl:{...SIZES.xxl,borderRadius:0},xl:{...SIZES.xl,borderRadius:0},l:{...SIZES.l,borderRadius:0},m:{...SIZES.m,borderRadius:0},s:{...SIZES.s,borderRadius:0},xs:{...SIZES.xs,borderRadius:0}};const SIZES_CONTAINER={xxl:{paddingTop:44,paddingBottom:44},xl:{paddingTop:36,paddingBottom:36},l:{paddingTop:32,paddingBottom:32},m:{paddingTop:28,paddingBottom:28},s:{paddingTop:28,paddingBottom:28},xs:{paddingTop:20,paddingBottom:20}};const SIZES_CONTENT={xxl:{padding:'4px 44px',margin:'0px 4px'},xl:{padding:'4px 36px',margin:'0px 4px'},l:{padding:'4px 32px',margin:'0px 4px'},m:{padding:'4px 28px',margin:'0px 4px'},s:{padding:'4px 28px',margin:'0px 4px'},xs:{padding:'4px 20px',margin:'0px 4px'}};const SIZES_FOOTER={xxl:{padding:'12px 48px 4px'},xl:{padding:'12px 40px 4px'},l:{padding:'12px 36px 4px'},m:{padding:'12px 32px 4px'},s:{padding:'12px 32px 4px'},xs:{padding:'12px 24px 4px'}};const SIZES_CAPTION={xxl:{fontSize:20},xl:{fontSize:18},l:{fontSize:18},m:{fontSize:14},s:{fontSize:14},xs:{fontSize:14}};const SIZES_TITLE={xxl:{fontSize:32},xl:{fontSize:28},l:{fontSize:24},m:{fontSize:20},s:{fontSize:18},xs:{fontSize:16}};const SIZES_SUBTITLE={xxl:{fontSize:24},xl:{fontSize:20},l:{fontSize:20},m:{fontSize:16},s:{fontSize:16},xs:{fontSize:14}};export{SIZES,SIZES_CAPTION,SIZES_CONTAINER,SIZES_CONTENT,SIZES_FANCY,SIZES_FOOTER,SIZES_SUBTITLE,SIZES_TITLE};
|
|
1
|
+
const SIZES={xxl:{width:'100%',minWidth:'min-content',maxWidth:1228,borderRadius:20},xl:{width:'100%',minWidth:'min-content',maxWidth:960,borderRadius:20},l:{width:'100%',minWidth:'min-content',maxWidth:780,borderRadius:20},m:{width:'100%',minWidth:'min-content',maxWidth:560,borderRadius:20},s:{width:'100%',minWidth:'min-content',maxWidth:440,borderRadius:20},xs:{width:'100%',minWidth:'min-content',maxWidth:304,borderRadius:20}};const SIZES_FANCY={xxl:{...SIZES.xxl,borderRadius:0},xl:{...SIZES.xl,borderRadius:0},l:{...SIZES.l,borderRadius:0},m:{...SIZES.m,borderRadius:0},s:{...SIZES.s,borderRadius:0},xs:{...SIZES.xs,borderRadius:0}};const SIZES_STICKY_HEADER={xxl:{padding:'0px 44px 5px',margin:'0px 4px'},xl:{padding:'0px 36px 5px',margin:'0px 4px'},l:{padding:'0px 32px 5px',margin:'0px 4px'},m:{padding:'0px 28px 5px',margin:'0px 4px'},s:{padding:'0px 28px 5px',margin:'0px 4px'},xs:{padding:'0px 20px 5px',margin:'0px 4px'}};const SIZES_CONTAINER={xxl:{paddingTop:44,paddingBottom:44},xl:{paddingTop:36,paddingBottom:36},l:{paddingTop:32,paddingBottom:32},m:{paddingTop:28,paddingBottom:28},s:{paddingTop:28,paddingBottom:28},xs:{paddingTop:20,paddingBottom:20}};const SIZES_CONTENT={xxl:{padding:'4px 44px',margin:'0px 4px'},xl:{padding:'4px 36px',margin:'0px 4px'},l:{padding:'4px 32px',margin:'0px 4px'},m:{padding:'4px 28px',margin:'0px 4px'},s:{padding:'4px 28px',margin:'0px 4px'},xs:{padding:'4px 20px',margin:'0px 4px'}};const SIZES_FOOTER={xxl:{padding:'12px 48px 4px'},xl:{padding:'12px 40px 4px'},l:{padding:'12px 36px 4px'},m:{padding:'12px 32px 4px'},s:{padding:'12px 32px 4px'},xs:{padding:'12px 24px 4px'}};const SIZES_CAPTION={xxl:{fontSize:20},xl:{fontSize:18},l:{fontSize:18},m:{fontSize:14},s:{fontSize:14},xs:{fontSize:14}};const SIZES_TITLE={xxl:{fontSize:32},xl:{fontSize:28},l:{fontSize:24},m:{fontSize:20},s:{fontSize:18},xs:{fontSize:16}};const SIZES_SUBTITLE={xxl:{fontSize:24},xl:{fontSize:20},l:{fontSize:20},m:{fontSize:16},s:{fontSize:16},xs:{fontSize:14}};export{SIZES,SIZES_CAPTION,SIZES_CONTAINER,SIZES_CONTENT,SIZES_FANCY,SIZES_FOOTER,SIZES_STICKY_HEADER,SIZES_SUBTITLE,SIZES_TITLE};
|
|
2
2
|
//# sourceMappingURL=sizes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sizes.mjs","sources":["../../../../src/components/DialogComponent/sizes.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from './types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xxl: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 1228,\n borderRadius: 20,\n },\n xl: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 960,\n borderRadius: 20,\n },\n l: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 780,\n borderRadius: 20,\n },\n m: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 560,\n borderRadius: 20,\n },\n s: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 440,\n borderRadius: 20,\n },\n xs: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 304,\n borderRadius: 20,\n },\n}\n\nexport const SIZES_FANCY: Record<Size, CSSProperties> = {\n xxl: { ...SIZES.xxl, borderRadius: 0 },\n xl: { ...SIZES.xl, borderRadius: 0 },\n l: { ...SIZES.l, borderRadius: 0 },\n m: { ...SIZES.m, borderRadius: 0 },\n s: { ...SIZES.s, borderRadius: 0 },\n xs: { ...SIZES.xs, borderRadius: 0 },\n}\n\nexport const SIZES_CONTAINER: Record<Size, CSSProperties> = {\n xxl: {\n paddingTop: 44,\n paddingBottom: 44,\n },\n xl: {\n paddingTop: 36,\n paddingBottom: 36,\n },\n l: {\n paddingTop: 32,\n paddingBottom: 32,\n },\n m: {\n paddingTop: 28,\n paddingBottom: 28,\n },\n s: {\n paddingTop: 28,\n paddingBottom: 28,\n },\n xs: {\n paddingTop: 20,\n paddingBottom: 20,\n },\n}\n\nexport const SIZES_CONTENT: Record<Size, CSSProperties> = {\n xxl: {\n padding: '4px 44px',\n margin: '0px 4px',\n },\n xl: {\n padding: '4px 36px',\n margin: '0px 4px',\n },\n l: {\n padding: '4px 32px',\n margin: '0px 4px',\n },\n m: {\n padding: '4px 28px',\n margin: '0px 4px',\n },\n s: {\n padding: '4px 28px',\n margin: '0px 4px',\n },\n xs: {\n padding: '4px 20px',\n margin: '0px 4px',\n },\n}\n\nexport const SIZES_FOOTER: Record<Size, CSSProperties> = {\n xxl: { padding: '12px 48px 4px' },\n xl: { padding: '12px 40px 4px' },\n l: { padding: '12px 36px 4px' },\n m: { padding: '12px 32px 4px' },\n s: { padding: '12px 32px 4px' },\n xs: { padding: '12px 24px 4px' },\n}\n\nexport const SIZES_CAPTION: Record<Size, CSSProperties> = {\n xxl: { fontSize: 20 },\n xl: { fontSize: 18 },\n l: { fontSize: 18 },\n m: { fontSize: 14 },\n s: { fontSize: 14 },\n xs: { fontSize: 14 },\n}\n\nexport const SIZES_TITLE: Record<Size, CSSProperties> = {\n xxl: { fontSize: 32 },\n xl: { fontSize: 28 },\n l: { fontSize: 24 },\n m: { fontSize: 20 },\n s: { fontSize: 18 },\n xs: { fontSize: 16 },\n}\n\nexport const SIZES_SUBTITLE: Record<Size, CSSProperties> = {\n xxl: { fontSize: 24 },\n xl: { fontSize: 20 },\n l: { fontSize: 20 },\n m: { fontSize: 16 },\n s: { fontSize: 16 },\n xs: { fontSize: 14 },\n}\n"],"names":["SIZES","xxl","width","minWidth","maxWidth","borderRadius","xl","l","m","s","xs","SIZES_FANCY","
|
|
1
|
+
{"version":3,"file":"sizes.mjs","sources":["../../../../src/components/DialogComponent/sizes.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from './types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xxl: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 1228,\n borderRadius: 20,\n },\n xl: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 960,\n borderRadius: 20,\n },\n l: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 780,\n borderRadius: 20,\n },\n m: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 560,\n borderRadius: 20,\n },\n s: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 440,\n borderRadius: 20,\n },\n xs: {\n width: '100%',\n minWidth: 'min-content',\n maxWidth: 304,\n borderRadius: 20,\n },\n}\n\nexport const SIZES_FANCY: Record<Size, CSSProperties> = {\n xxl: { ...SIZES.xxl, borderRadius: 0 },\n xl: { ...SIZES.xl, borderRadius: 0 },\n l: { ...SIZES.l, borderRadius: 0 },\n m: { ...SIZES.m, borderRadius: 0 },\n s: { ...SIZES.s, borderRadius: 0 },\n xs: { ...SIZES.xs, borderRadius: 0 },\n}\n\nexport const SIZES_STICKY_HEADER: Record<Size, CSSProperties> = {\n xxl: {\n padding: '0px 44px 5px',\n margin: '0px 4px',\n },\n xl: {\n padding: '0px 36px 5px',\n margin: '0px 4px',\n },\n l: {\n padding: '0px 32px 5px',\n margin: '0px 4px',\n },\n m: {\n padding: '0px 28px 5px',\n margin: '0px 4px',\n },\n s: {\n padding: '0px 28px 5px',\n margin: '0px 4px',\n },\n xs: {\n padding: '0px 20px 5px',\n margin: '0px 4px',\n },\n}\n\nexport const SIZES_CONTAINER: Record<Size, CSSProperties> = {\n xxl: {\n paddingTop: 44,\n paddingBottom: 44,\n },\n xl: {\n paddingTop: 36,\n paddingBottom: 36,\n },\n l: {\n paddingTop: 32,\n paddingBottom: 32,\n },\n m: {\n paddingTop: 28,\n paddingBottom: 28,\n },\n s: {\n paddingTop: 28,\n paddingBottom: 28,\n },\n xs: {\n paddingTop: 20,\n paddingBottom: 20,\n },\n}\n\nexport const SIZES_CONTENT: Record<Size, CSSProperties> = {\n xxl: {\n padding: '4px 44px',\n margin: '0px 4px',\n },\n xl: {\n padding: '4px 36px',\n margin: '0px 4px',\n },\n l: {\n padding: '4px 32px',\n margin: '0px 4px',\n },\n m: {\n padding: '4px 28px',\n margin: '0px 4px',\n },\n s: {\n padding: '4px 28px',\n margin: '0px 4px',\n },\n xs: {\n padding: '4px 20px',\n margin: '0px 4px',\n },\n}\n\nexport const SIZES_FOOTER: Record<Size, CSSProperties> = {\n xxl: { padding: '12px 48px 4px' },\n xl: { padding: '12px 40px 4px' },\n l: { padding: '12px 36px 4px' },\n m: { padding: '12px 32px 4px' },\n s: { padding: '12px 32px 4px' },\n xs: { padding: '12px 24px 4px' },\n}\n\nexport const SIZES_CAPTION: Record<Size, CSSProperties> = {\n xxl: { fontSize: 20 },\n xl: { fontSize: 18 },\n l: { fontSize: 18 },\n m: { fontSize: 14 },\n s: { fontSize: 14 },\n xs: { fontSize: 14 },\n}\n\nexport const SIZES_TITLE: Record<Size, CSSProperties> = {\n xxl: { fontSize: 32 },\n xl: { fontSize: 28 },\n l: { fontSize: 24 },\n m: { fontSize: 20 },\n s: { fontSize: 18 },\n xs: { fontSize: 16 },\n}\n\nexport const SIZES_SUBTITLE: Record<Size, CSSProperties> = {\n xxl: { fontSize: 24 },\n xl: { fontSize: 20 },\n l: { fontSize: 20 },\n m: { fontSize: 16 },\n s: { fontSize: 16 },\n xs: { fontSize: 14 },\n}\n"],"names":["SIZES","xxl","width","minWidth","maxWidth","borderRadius","xl","l","m","s","xs","SIZES_FANCY","SIZES_STICKY_HEADER","padding","margin","SIZES_CONTAINER","paddingTop","paddingBottom","SIZES_CONTENT","SIZES_FOOTER","SIZES_CAPTION","fontSize","SIZES_TITLE","SIZES_SUBTITLE"],"mappings":"AAGO,MAAMA,MAAqC,CAChDC,IAAK,CACHC,MAAO,OACPC,SAAU,cACVC,SAAU,KACVC,aAAc,IAEhBC,GAAI,CACFJ,MAAO,OACPC,SAAU,cACVC,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L,EAAG,CACDI,QAAS,WACTC,OAAQ,WAEVJ,GAAI,CACFG,QAAS,WACTC,OAAQ,YAIL,MAAMK,aAA4C,CACvDlB,IAAK,CAAEY,QAAS,iBAChBP,GAAI,CAAEO,QAAS,iBACfN,EAAG,CAAEM,QAAS,iBACdL,EAAG,CAAEK,QAAS,iBACdJ,EAAG,CAAEI,QAAS,iBACdH,GAAI,CAAEG,QAAS,kBAGV,MAAMO,cAA6C,CACxDnB,IAAK,CAAEoB,SAAU,IACjBf,GAAI,CAAEe,SAAU,IAChBd,EAAG,CAAEc,SAAU,IACfb,EAAG,CAAEa,SAAU,IACfZ,EAAG,CAAEY,SAAU,IACfX,GAAI,CAAEW,SAAU,KAGX,MAAMC,YAA2C,CACtDrB,IAAK,CAAEoB,SAAU,IACjBf,GAAI,CAAEe,SAAU,IAChBd,EAAG,CAAEc,SAAU,IACfb,EAAG,CAAEa,SAAU,IACfZ,EAAG,CAAEY,SAAU,IACfX,GAAI,CAAEW,SAAU,KAGX,MAAME,eAA8C,CACzDtB,IAAK,CAAEoB,SAAU,IACjBf,GAAI,CAAEe,SAAU,IAChBd,EAAG,CAAEc,SAAU,IACfb,EAAG,CAAEa,SAAU,IACfZ,EAAG,CAAEY,SAAU,IACfX,GAAI,CAAEW,SAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var styled=require('styled-components');var responsiveSize=require('../../mixins/responsive-size.js');var responsiveLayout=require('../../mixins/responsive-layout.js');var focus=require('../../mixins/focus.js');var style=require('../../shared/utils/style.js');var maskRectangle=require('./images/mask-rectangle.svg.js');var maskSlope=require('./images/mask-slope.svg.js');var Spacer=require('../Spacer/Spacer.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);const filterLayoutProps=o=>!['layout','layoutXXS','layoutXS','layoutS','layoutM','layoutL','layoutXL','layouts'].includes(o);const shouldForwardDialogComponentProp=style.createShouldForwardProp((o=>!['dragging','fancy','zIndex'].includes(o)),filterLayoutProps);const filterCommonProps=style.createShouldForwardProp((o=>!['scrollable'].includes(o)));const Fading=styled__default.default.div.withConfig({shouldForwardProp:o=>!['visible','after'].includes(o)}).withConfig({displayName:"DialogComponent__Fading",componentId:"ui__sc-1dlvioj-0"})(["box-sizing:border-box;position:relative;flex-shrink:0;width:100%;z-index:1;&::before,&::after{transition-property:opacity;transition-duration:150ms;transition-timing-function:ease-in;pointer-events:none;}",""],(o=>o.after?`\n &::after {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n bottom: 100%;\n right: 4px; \n left: 4px;\n margin-bottom: -1px;\n background-image: linear-gradient(0deg, currentcolor, transparent);\n opacity: ${o.visible?1:0};\n }\n `:`\n &::before {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n top: 100%;\n right: 4px;\n left: 4px;\n margin-top: -1px;\n background-image: linear-gradient(180deg, currentcolor, transparent);\n opacity: ${o.visible?1:0};\n }\n `));const FancyBackground=styled__default.default.div.withConfig({displayName:"DialogComponent__FancyBackground",componentId:"ui__sc-1dlvioj-1"})(["box-sizing:border-box;position:absolute;top:0;right:0;bottom:0;left:0;mask-image:url(","),url(",");mask-repeat:no-repeat,no-repeat;mask-size:100% 32px,cover;mask-position:0 56px,0 87px;border-radius:inherit;"],maskSlope.default,maskRectangle.default);const template_default=o=>`\n color: ${o.color};\n background-color: ${o.backgroundColor};\n box-shadow: 0 6px 20px 1px ${o.shadowColor};\n ${Fading} {\n color: ${o.backgroundColor};\n }\n `,template_fancy=o=>`\n color: ${o.color};\n ${FancyBackground} {\n background-color: ${o.backgroundColor};\n }\n ${Fading} {\n color: ${o.backgroundColor};\n }\n `;const Root=styled__default.default.div.withConfig({shouldForwardProp:shouldForwardDialogComponentProp}).withConfig({displayName:"DialogComponent__Root",componentId:"ui__sc-1dlvioj-2"})(["box-sizing:border-box;display:flex;position:relative;isolation:isolate;"," "," "," "," ",""],(o=>(o.fancy?template_fancy:template_default)({color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-onmain-primary'],shadowColor:o.theme.colors['bg-oncolor-hover'],...o.palette})),(o=>o.dragging&&`\n box-shadow: 0 0 0 2px ${o.theme.colors.white}, 0 0 0 4px ${o.theme.colors['border-focus']};\n `),(o=>typeof o.zIndex=='number'&&`z-index: ${o.zIndex};`),responsiveSize.responsiveSize,responsiveLayout.responsiveLayout);const Body=styled__default.default.div.withConfig({displayName:"DialogComponent__Body",componentId:"ui__sc-1dlvioj-3"})(["box-sizing:border-box;position:relative;display:flex;flex-direction:column;overflow:hidden;flex-grow:1;"]);const Container=styled__default.default.div.withConfig({shouldForwardProp:filterCommonProps}).withConfig({displayName:"DialogComponent__Container",componentId:"ui__sc-1dlvioj-
|
|
1
|
+
'use strict';var styled=require('styled-components');var responsiveSize=require('../../mixins/responsive-size.js');var responsiveLayout=require('../../mixins/responsive-layout.js');var focus=require('../../mixins/focus.js');var style=require('../../shared/utils/style.js');var maskRectangle=require('./images/mask-rectangle.svg.js');var maskSlope=require('./images/mask-slope.svg.js');var Spacer=require('../Spacer/Spacer.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);const filterLayoutProps=o=>!['layout','layoutXXS','layoutXS','layoutS','layoutM','layoutL','layoutXL','layouts'].includes(o);const shouldForwardDialogComponentProp=style.createShouldForwardProp((o=>!['dragging','fancy','zIndex'].includes(o)),filterLayoutProps);const filterCommonProps=style.createShouldForwardProp((o=>!['scrollable'].includes(o)));const Fading=styled__default.default.div.withConfig({shouldForwardProp:o=>!['visible','after'].includes(o)}).withConfig({displayName:"DialogComponent__Fading",componentId:"ui__sc-1dlvioj-0"})(["box-sizing:border-box;position:relative;flex-shrink:0;width:100%;z-index:1;&::before,&::after{transition-property:opacity;transition-duration:150ms;transition-timing-function:ease-in;pointer-events:none;}",""],(o=>o.after?`\n &::after {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n bottom: 100%;\n right: 4px; \n left: 4px;\n margin-bottom: -1px;\n background-image: linear-gradient(0deg, currentcolor, transparent);\n opacity: ${o.visible?1:0};\n }\n `:`\n &::before {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n top: 100%;\n right: 4px;\n left: 4px;\n margin-top: -1px;\n background-image: linear-gradient(180deg, currentcolor, transparent);\n opacity: ${o.visible?1:0};\n }\n `));const FancyBackground=styled__default.default.div.withConfig({displayName:"DialogComponent__FancyBackground",componentId:"ui__sc-1dlvioj-1"})(["box-sizing:border-box;position:absolute;top:0;right:0;bottom:0;left:0;mask-image:url(","),url(",");mask-repeat:no-repeat,no-repeat;mask-size:100% 32px,cover;mask-position:0 56px,0 87px;border-radius:inherit;"],maskSlope.default,maskRectangle.default);const template_default=o=>`\n color: ${o.color};\n background-color: ${o.backgroundColor};\n box-shadow: 0 6px 20px 1px ${o.shadowColor};\n ${Fading} {\n color: ${o.backgroundColor};\n }\n `,template_fancy=o=>`\n color: ${o.color};\n ${FancyBackground} {\n background-color: ${o.backgroundColor};\n }\n ${Fading} {\n color: ${o.backgroundColor};\n }\n `;const Root=styled__default.default.div.withConfig({shouldForwardProp:shouldForwardDialogComponentProp}).withConfig({displayName:"DialogComponent__Root",componentId:"ui__sc-1dlvioj-2"})(["box-sizing:border-box;display:flex;position:relative;isolation:isolate;"," "," "," "," ",""],(o=>(o.fancy?template_fancy:template_default)({color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-onmain-primary'],shadowColor:o.theme.colors['bg-oncolor-hover'],...o.palette})),(o=>o.dragging&&`\n box-shadow: 0 0 0 2px ${o.theme.colors.white}, 0 0 0 4px ${o.theme.colors['border-focus']};\n `),(o=>typeof o.zIndex=='number'&&`z-index: ${o.zIndex};`),responsiveSize.responsiveSize,responsiveLayout.responsiveLayout);const Body=styled__default.default.div.withConfig({displayName:"DialogComponent__Body",componentId:"ui__sc-1dlvioj-3"})(["box-sizing:border-box;position:relative;display:flex;flex-direction:column;overflow:hidden;flex-grow:1;"]);const StickyHeader=styled__default.default.div.withConfig({shouldForwardProp:filterCommonProps}).withConfig({displayName:"DialogComponent__StickyHeader",componentId:"ui__sc-1dlvioj-4"})(["",""],responsiveSize.responsiveSize);const Container=styled__default.default.div.withConfig({shouldForwardProp:filterCommonProps}).withConfig({displayName:"DialogComponent__Container",componentId:"ui__sc-1dlvioj-5"})(["box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;flex-grow:1;",""],responsiveSize.responsiveSize);const Content=styled__default.default.div.withConfig({shouldForwardProp:filterCommonProps}).withConfig({displayName:"DialogComponent__Content",componentId:"ui__sc-1dlvioj-6"})(["box-sizing:border-box;flex-grow:1;"," "," ",""],(o=>`\n overflow: ${o.scrollable?'auto':'hidden'};\n overscroll-behavior: ${o.scrollable?'contain':'auto'};\n `),focus.focus,responsiveSize.responsiveSize);const Footer=styled__default.default.div.withConfig({shouldForwardProp:filterCommonProps}).withConfig({displayName:"DialogComponent__Footer",componentId:"ui__sc-1dlvioj-7"})(["box-sizing:border-box;flex-shrink:0;",""],responsiveSize.responsiveSize);const DraggingHandle=styled__default.default.div.withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"DialogComponent__DraggingHandle",componentId:"ui__sc-1dlvioj-8"})(["box-sizing:border-box;position:absolute;top:0;left:0;width:100%;display:flex;justify-content:center;padding-top:10px;padding-bottom:10px;cursor:grab;touch-action:none;z-index:2;",""],responsiveLayout.responsiveLayout);const DraggingIconContainer=styled__default.default.div.withConfig({displayName:"DialogComponent__DraggingIconContainer",componentId:"ui__sc-1dlvioj-9"})(["box-sizing:border-box;display:flex;padding:3px 12px;border-radius:12px;& > *{height:0.25em;}"," ",""],(o=>`\n background-color: ${o.theme.colors['bg-onmain-tertiary']};\n `),focus.focus);const Media=styled__default.default.div.withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"DialogComponent__Media",componentId:"ui__sc-1dlvioj-10"})(["box-sizing:border-box;overflow:hidden;flex-shrink:0;",""],responsiveLayout.responsiveLayout);const Img=styled__default.default.div.withConfig({shouldForwardProp:o=>o!=='src'}).withConfig({displayName:"DialogComponent__Img",componentId:"ui__sc-1dlvioj-11"})(["box-sizing:border-box;",""],(o=>o.src&&`\n background-image: url(${o.src});\n background-repeat: no-repeat;\n background-position: 50%;\n background-size: cover;\n `));const LayoutSpacer=styled__default.default(Spacer.Spacer).withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"DialogComponent__LayoutSpacer",componentId:"ui__sc-1dlvioj-12"})(["",""],responsiveLayout.responsiveLayout);const ButtonPosition=styled__default.default.div.withConfig({displayName:"DialogComponent__ButtonPosition",componentId:"ui__sc-1dlvioj-13"})(["box-sizing:border-box;position:absolute;top:0;right:0;z-index:3;"]);const ProgressPosition=styled__default.default.div.withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"DialogComponent__ProgressPosition",componentId:"ui__sc-1dlvioj-14"})(["box-sizing:border-box;position:absolute;z-index:2;",""],responsiveLayout.responsiveLayout);exports.Body=Body,exports.ButtonPosition=ButtonPosition,exports.Container=Container,exports.Content=Content,exports.DraggingHandle=DraggingHandle,exports.DraggingIconContainer=DraggingIconContainer,exports.Fading=Fading,exports.FancyBackground=FancyBackground,exports.Footer=Footer,exports.Img=Img,exports.LayoutSpacer=LayoutSpacer,exports.Media=Media,exports.ProgressPosition=ProgressPosition,exports.Root=Root,exports.StickyHeader=StickyHeader;
|
|
2
2
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../src/components/DialogComponent/style.ts"],"sourcesContent":["import styled from 'styled-components'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveLayout } from 'mixins/responsive-layout'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { Spacer } from 'components/Spacer'\nimport type {\n ResponsiveSizeProps,\n ResponsiveSizeInterpolationProps,\n ResponsiveLayoutInterpolationProps,\n} from 'shared/interfaces'\nimport maskRectangle from './images/mask-rectangle.svg'\nimport maskSlope from './images/mask-slope.svg'\nimport type {\n StyledDialogComponentProps,\n DialogComponentPalette,\n StyledDialogContentProps,\n Size,\n Layout,\n} from './types'\n\nconst filterLayoutProps = (propKey: string) =>\n !['layout', 'layoutXXS', 'layoutXS', 'layoutS', 'layoutM', 'layoutL', 'layoutXL', 'layouts'].includes(propKey)\n\nconst shouldForwardDialogComponentProp = createShouldForwardProp(\n (propKey) => !['dragging', 'fancy', 'zIndex'].includes(propKey),\n filterLayoutProps\n)\n\nconst filterCommonProps = createShouldForwardProp((propKey: string) => !['scrollable'].includes(propKey))\n\nexport const Fading = styled.div.withConfig<{\n visible: boolean\n after?: boolean\n}>({\n shouldForwardProp: (propKey) => !['visible', 'after'].includes(propKey),\n})`\n box-sizing: border-box;\n position: relative;\n flex-shrink: 0;\n width: 100%;\n z-index: 1;\n\n &::before,\n &::after {\n transition-property: opacity;\n transition-duration: 150ms;\n transition-timing-function: ease-in;\n pointer-events: none;\n }\n\n ${(props) =>\n props.after\n ? `\n &::after {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n bottom: 100%;\n right: 4px; \n left: 4px;\n margin-bottom: -1px;\n background-image: linear-gradient(0deg, currentcolor, transparent);\n opacity: ${props.visible ? 1 : 0};\n }\n `\n : `\n &::before {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n top: 100%;\n right: 4px;\n left: 4px;\n margin-top: -1px;\n background-image: linear-gradient(180deg, currentcolor, transparent);\n opacity: ${props.visible ? 1 : 0};\n }\n `}\n`\n\nexport const FancyBackground = styled.div`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n mask-image: url(${maskSlope}), url(${maskRectangle});\n mask-repeat: no-repeat, no-repeat;\n mask-size:\n 100% 32px,\n cover;\n mask-position:\n 0 56px,\n 0 87px;\n border-radius: inherit;\n`\n\nconst template = {\n default: (palette: DialogComponentPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n box-shadow: 0 6px 20px 1px ${palette.shadowColor};\n ${Fading} {\n color: ${palette.backgroundColor};\n }\n `,\n fancy: (palette: DialogComponentPalette) => `\n color: ${palette.color};\n ${FancyBackground} {\n background-color: ${palette.backgroundColor};\n }\n ${Fading} {\n color: ${palette.backgroundColor};\n }\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledDialogComponentProps>({\n shouldForwardProp: shouldForwardDialogComponentProp,\n})`\n box-sizing: border-box;\n display: flex;\n position: relative;\n isolation: isolate;\n\n ${(props) =>\n (props.fancy ? template.fancy : template.default)({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-onmain-primary'],\n shadowColor: props.theme.colors['bg-oncolor-hover'],\n ...props.palette,\n })}\n\n ${(props) =>\n props.dragging &&\n `\n box-shadow: 0 0 0 2px ${props.theme.colors.white}, 0 0 0 4px ${props.theme.colors['border-focus']};\n `}\n \n ${(props) => typeof props.zIndex === 'number' && `z-index: ${props.zIndex};`}\n\n ${responsiveSize}\n ${responsiveLayout}\n`\n\nexport const Body = styled.div`\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n`\n\nexport const Container = styled.div.withConfig<ResponsiveSizeInterpolationProps<Size, Size, ResponsiveSizeProps<Size>>>(\n {\n shouldForwardProp: filterCommonProps,\n }\n)`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n\n ${responsiveSize}\n`\n\nexport const Content = styled.div.withConfig<StyledDialogContentProps>({\n shouldForwardProp: filterCommonProps,\n})`\n box-sizing: border-box;\n flex-grow: 1;\n\n ${(props) => `\n overflow: ${props.scrollable ? 'auto' : 'hidden'};\n overscroll-behavior: ${props.scrollable ? 'contain' : 'auto'};\n `}\n\n ${focus}\n ${responsiveSize}\n`\n\nexport const Footer = styled.div.withConfig<ResponsiveSizeInterpolationProps<Size, Size, ResponsiveSizeProps<Size>>>({\n shouldForwardProp: filterCommonProps,\n})`\n box-sizing: border-box;\n flex-shrink: 0;\n\n ${responsiveSize}\n`\n\nexport const DraggingHandle = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n padding-top: 10px;\n padding-bottom: 10px;\n cursor: grab;\n touch-action: none;\n z-index: 2;\n\n ${responsiveLayout}\n`\n\nexport const DraggingIconContainer = styled.div`\n box-sizing: border-box;\n display: flex;\n padding: 3px 12px;\n border-radius: 12px;\n\n & > * {\n height: 0.25em;\n }\n\n ${(props) => `\n background-color: ${props.theme.colors['bg-onmain-tertiary']};\n `}\n\n ${focus}\n`\n\nexport const Media = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n overflow: hidden;\n flex-shrink: 0;\n\n ${responsiveLayout}\n`\n\nexport const Img = styled.div.withConfig<{ src?: string }>({\n shouldForwardProp: (propKey) => propKey !== 'src',\n})`\n box-sizing: border-box;\n\n ${(props) =>\n props.src &&\n `\n background-image: url(${props.src});\n background-repeat: no-repeat;\n background-position: 50%;\n background-size: cover;\n `}\n`\n\nexport const LayoutSpacer = styled(Spacer).withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n ${responsiveLayout}\n`\n\nexport const ButtonPosition = styled.div`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 3;\n`\n\nexport const ProgressPosition = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n position: absolute;\n z-index: 2;\n\n ${responsiveLayout}\n`\n"],"names":["filterLayoutProps","propKey","includes","shouldForwardDialogComponentProp","createShouldForwardProp","filterCommonProps","Fading","styled","div","withConfig","shouldForwardProp","displayName","componentId","props","after","visible","FancyBackground","maskSlope","default","maskRectangle","template","palette","color","backgroundColor","shadowColor","Root","fancy","theme","colors","dragging","white","zIndex","responsiveSize","responsiveLayout","Body","Container","Content","scrollable","focus","Footer","DraggingHandle","DraggingIconContainer","Media","Img","src","LayoutSpacer","Spacer","ButtonPosition","ProgressPosition"],"mappings":"whBAqBA,MAAMA,kBAAqBC,IACxB,CAAC,SAAU,YAAa,WAAY,UAAW,UAAW,UAAW,WAAY,WAAWC,SAASD,GAExG,MAAME,iCAAmCC,MAAuBA,yBAC7DH,IAAa,CAAC,WAAY,QAAS,UAAUC,SAASD,IACvDD,mBAGF,MAAMK,kBAAoBD,MAAAA,yBAAyBH,IAAqB,CAAC,cAAcC,SAASD,KAEzF,MAAMK,OAASC,gBAAAA,QAAOC,IAAIC,WAG9B,CACDC,kBAAoBT,IAAa,CAAC,UAAW,SAASC,SAASD,KAC/DQ,WAAA,CAAAE,YAAA,0BAAAC,YAAA,oBALoBL,CAKpB,CAAA,+MAAA,KAeGM,GACDA,EAAMC,MACF,mWAWeD,EAAME,QAAU,EAAI,gCAGnC,+VAWeF,EAAME,QAAU,EAAI,kCAK9BC,gBAAkBT,gBAAAA,QAAOC,IAAGC,WAAA,CAAAE,YAAA,mCAAAC,YAAA,oBAAVL,CAOXU,CAAAA,wFAAAA,SAAAA,kHAAAA,UAASC,QAAUC,uBAWvC,MAAMC,iBACMC,GAAoC,gBACnCA,EAAQC,iCACGD,EAAQE,oDACCF,EAAQG,qBACnClB,0BACSe,EAAQE,8BANjBH,eASIC,GAAoC,gBACjCA,EAAQC,eACfN,8CACoBK,EAAQE,gCAE5BjB,0BACSe,EAAQE,8BAKhB,MAAME,KAAOlB,gBAAAA,QAAOC,IAAIC,WAAuC,CACpEC,kBAAmBP,mCACnBM,WAAA,CAAAE,YAAA,wBAAAC,YAAA,oBAFkBL,CAElB,CAAA,0EAAA,IAAA,IAAA,IAAA,IAAA,KAMGM,IACAA,EAAMa,MAAQN,eAAiBA,kBAAkB,CAChDE,MAAOT,EAAMc,MAAMC,OAAO,0BAC1BL,gBAAiBV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,MAAAA,OAGG,MAAMI,MAAQnC,gBAAAA,QAAOC,IAAIC,WAAuD,CACrFC,kBAAmBV,oBACnBS,WAAA,CAAAE,YAAA,yBAAAC,YAAA,oBAFmBL,CAEnB,CAAA,uDAAA,IAKE0B,iBAAAA,kBAGG,MAAMU,IAAMpC,gBAAAA,QAAOC,IAAIC,WAA6B,CACzDC,kBAAoBT,GAAYA,IAAY,QAC5CQ,WAAA,CAAAE,YAAA,uBAAAC,YAAA,qBAFiBL,CAEjB,CAAA,yBAAA,KAGGM,GACDA,EAAM+B,KACN,iCAC0B/B,EAAM+B,qHAO7B,MAAMC,aAAetC,gBAAMW,QAAC4B,eAAQrC,WAAuD,CAChGC,kBAAmBV,oBACnBS,WAAA,CAAAE,YAAA,gCAAAC,YAAA,qBAF0BL,CAE1B,CAAA,GAAA,IACE0B,iBAAAA,wBAGSc,eAAiBxC,gBAAAA,QAAOC,IAAGC,WAAA,CAAAE,YAAA,kCAAAC,YAAA,qBAAVL,CAM7B,CAAA,qEAEM,MAAMyC,iBAAmBzC,gBAAAA,QAAOC,IAAIC,WAAuD,CAChGC,kBAAmBV,oBACnBS,WAAA,CAAAE,YAAA,oCAAAC,YAAA,qBAF8BL,CAE9B,CAAA,qDAAA,IAKE0B,iBAAgBA"}
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../src/components/DialogComponent/style.ts"],"sourcesContent":["import styled from 'styled-components'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveLayout } from 'mixins/responsive-layout'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { Spacer } from 'components/Spacer'\nimport type {\n ResponsiveSizeProps,\n ResponsiveSizeInterpolationProps,\n ResponsiveLayoutInterpolationProps,\n} from 'shared/interfaces'\nimport maskRectangle from './images/mask-rectangle.svg'\nimport maskSlope from './images/mask-slope.svg'\nimport type {\n StyledDialogComponentProps,\n DialogComponentPalette,\n StyledDialogContentProps,\n Size,\n Layout,\n} from './types'\n\nconst filterLayoutProps = (propKey: string) =>\n !['layout', 'layoutXXS', 'layoutXS', 'layoutS', 'layoutM', 'layoutL', 'layoutXL', 'layouts'].includes(propKey)\n\nconst shouldForwardDialogComponentProp = createShouldForwardProp(\n (propKey) => !['dragging', 'fancy', 'zIndex'].includes(propKey),\n filterLayoutProps\n)\n\nconst filterCommonProps = createShouldForwardProp((propKey: string) => !['scrollable'].includes(propKey))\n\nexport const Fading = styled.div.withConfig<{\n visible: boolean\n after?: boolean\n}>({\n shouldForwardProp: (propKey) => !['visible', 'after'].includes(propKey),\n})`\n box-sizing: border-box;\n position: relative;\n flex-shrink: 0;\n width: 100%;\n z-index: 1;\n\n &::before,\n &::after {\n transition-property: opacity;\n transition-duration: 150ms;\n transition-timing-function: ease-in;\n pointer-events: none;\n }\n\n ${(props) =>\n props.after\n ? `\n &::after {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n bottom: 100%;\n right: 4px; \n left: 4px;\n margin-bottom: -1px;\n background-image: linear-gradient(0deg, currentcolor, transparent);\n opacity: ${props.visible ? 1 : 0};\n }\n `\n : `\n &::before {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n top: 100%;\n right: 4px;\n left: 4px;\n margin-top: -1px;\n background-image: linear-gradient(180deg, currentcolor, transparent);\n opacity: ${props.visible ? 1 : 0};\n }\n `}\n`\n\nexport const FancyBackground = styled.div`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n mask-image: url(${maskSlope}), url(${maskRectangle});\n mask-repeat: no-repeat, no-repeat;\n mask-size:\n 100% 32px,\n cover;\n mask-position:\n 0 56px,\n 0 87px;\n border-radius: inherit;\n`\n\nconst template = {\n default: (palette: DialogComponentPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n box-shadow: 0 6px 20px 1px ${palette.shadowColor};\n ${Fading} {\n color: ${palette.backgroundColor};\n }\n `,\n fancy: (palette: DialogComponentPalette) => `\n color: ${palette.color};\n ${FancyBackground} {\n background-color: ${palette.backgroundColor};\n }\n ${Fading} {\n color: ${palette.backgroundColor};\n }\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledDialogComponentProps>({\n shouldForwardProp: shouldForwardDialogComponentProp,\n})`\n box-sizing: border-box;\n display: flex;\n position: relative;\n isolation: isolate;\n\n ${(props) =>\n (props.fancy ? template.fancy : template.default)({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-onmain-primary'],\n shadowColor: props.theme.colors['bg-oncolor-hover'],\n ...props.palette,\n })}\n\n ${(props) =>\n props.dragging &&\n `\n box-shadow: 0 0 0 2px ${props.theme.colors.white}, 0 0 0 4px ${props.theme.colors['border-focus']};\n `}\n \n ${(props) => typeof props.zIndex === 'number' && `z-index: ${props.zIndex};`}\n\n ${responsiveSize}\n ${responsiveLayout}\n`\n\nexport const Body = styled.div`\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n`\n\nexport const StickyHeader = styled.div.withConfig<\n ResponsiveSizeInterpolationProps<Size, Size, ResponsiveSizeProps<Size>>\n>({\n shouldForwardProp: filterCommonProps,\n})`\n ${responsiveSize}\n`\n\nexport const Container = styled.div.withConfig<ResponsiveSizeInterpolationProps<Size, Size, ResponsiveSizeProps<Size>>>(\n {\n shouldForwardProp: filterCommonProps,\n }\n)`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n\n ${responsiveSize}\n`\n\nexport const Content = styled.div.withConfig<StyledDialogContentProps>({\n shouldForwardProp: filterCommonProps,\n})`\n box-sizing: border-box;\n flex-grow: 1;\n\n ${(props) => `\n overflow: ${props.scrollable ? 'auto' : 'hidden'};\n overscroll-behavior: ${props.scrollable ? 'contain' : 'auto'};\n `}\n\n ${focus}\n ${responsiveSize}\n`\n\nexport const Footer = styled.div.withConfig<ResponsiveSizeInterpolationProps<Size, Size, ResponsiveSizeProps<Size>>>({\n shouldForwardProp: filterCommonProps,\n})`\n box-sizing: border-box;\n flex-shrink: 0;\n\n ${responsiveSize}\n`\n\nexport const DraggingHandle = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n padding-top: 10px;\n padding-bottom: 10px;\n cursor: grab;\n touch-action: none;\n z-index: 2;\n\n ${responsiveLayout}\n`\n\nexport const DraggingIconContainer = styled.div`\n box-sizing: border-box;\n display: flex;\n padding: 3px 12px;\n border-radius: 12px;\n\n & > * {\n height: 0.25em;\n }\n\n ${(props) => `\n background-color: ${props.theme.colors['bg-onmain-tertiary']};\n `}\n\n ${focus}\n`\n\nexport const Media = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n overflow: hidden;\n flex-shrink: 0;\n\n ${responsiveLayout}\n`\n\nexport const Img = styled.div.withConfig<{ src?: string }>({\n shouldForwardProp: (propKey) => propKey !== 'src',\n})`\n box-sizing: border-box;\n\n ${(props) =>\n props.src &&\n `\n background-image: url(${props.src});\n background-repeat: no-repeat;\n background-position: 50%;\n background-size: cover;\n `}\n`\n\nexport const LayoutSpacer = styled(Spacer).withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n ${responsiveLayout}\n`\n\nexport const ButtonPosition = styled.div`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 3;\n`\n\nexport const ProgressPosition = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n position: absolute;\n z-index: 2;\n\n ${responsiveLayout}\n`\n"],"names":["filterLayoutProps","propKey","includes","shouldForwardDialogComponentProp","createShouldForwardProp","filterCommonProps","Fading","styled","div","withConfig","shouldForwardProp","displayName","componentId","props","after","visible","FancyBackground","maskSlope","default","maskRectangle","template","palette","color","backgroundColor","shadowColor","Root","fancy","theme","colors","dragging","white","zIndex","responsiveSize","responsiveLayout","Body","StickyHeader","Container","Content","scrollable","focus","Footer","DraggingHandle","DraggingIconContainer","Media","Img","src","LayoutSpacer","Spacer","ButtonPosition","ProgressPosition"],"mappings":"whBAqBA,MAAMA,kBAAqBC,IACxB,CAAC,SAAU,YAAa,WAAY,UAAW,UAAW,UAAW,WAAY,WAAWC,SAASD,GAExG,MAAME,iCAAmCC,MAAuBA,yBAC7DH,IAAa,CAAC,WAAY,QAAS,UAAUC,SAASD,IACvDD,mBAGF,MAAMK,kBAAoBD,MAAAA,yBAAyBH,IAAqB,CAAC,cAAcC,SAASD,KAEzF,MAAMK,OAASC,gBAAAA,QAAOC,IAAIC,WAG9B,CACDC,kBAAoBT,IAAa,CAAC,UAAW,SAASC,SAASD,KAC/DQ,WAAA,CAAAE,YAAA,0BAAAC,YAAA,oBALoBL,CAKpB,CAAA,+MAAA,KAeGM,GACDA,EAAMC,MACF,mWAWeD,EAAME,QAAU,EAAI,gCAGnC,+VAWeF,EAAME,QAAU,EAAI,kCAK9BC,gBAAkBT,gBAAAA,QAAOC,IAAGC,WAAA,CAAAE,YAAA,mCAAAC,YAAA,oBAAVL,CAOXU,CAAAA,wFAAAA,SAAAA,kHAAAA,UAASC,QAAUC,uBAWvC,MAAMC,iBACMC,GAAoC,gBACnCA,EAAQC,iCACGD,EAAQE,oDACCF,EAAQG,qBACnClB,0BACSe,EAAQE,8BANjBH,eASIC,GAAoC,gBACjCA,EAAQC,eACfN,8CACoBK,EAAQE,gCAE5BjB,0BACSe,EAAQE,8BAKhB,MAAME,KAAOlB,gBAAAA,QAAOC,IAAIC,WAAuC,CACpEC,kBAAmBP,mCACnBM,WAAA,CAAAE,YAAA,wBAAAC,YAAA,oBAFkBL,CAElB,CAAA,0EAAA,IAAA,IAAA,IAAA,IAAA,KAMGM,IACAA,EAAMa,MAAQN,eAAiBA,kBA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AA,oBAF4BL,CAE5B,CAAA,oLAAA,IAcE0B,iBAAAA,wBAGSS,sBAAwBnC,gBAAAA,QAAOC,IAAGC,WAAA,CAAAE,YAAA,yCAAAC,YAAA,oBAAVL,CAAU,CAAA,+FAAA,IAAA,KAU1CM,GAAU,6BACWA,EAAMc,MAAMC,OAAO,gCAGzCW,MAAAA,OAGG,MAAMI,MAAQpC,gBAAAA,QAAOC,IAAIC,WAAuD,CACrFC,kBAAmBV,oBACnBS,WAAA,CAAAE,YAAA,yBAAAC,YAAA,qBAFmBL,CAEnB,CAAA,uDAAA,IAKE0B,iBAAAA,kBAGG,MAAMW,IAAMrC,gBAAAA,QAAOC,IAAIC,WAA6B,CACzDC,kBAAoBT,GAAYA,IAAY,QAC5CQ,WAAA,CAAAE,YAAA,uBAAAC,YAAA,qBAFiBL,CAEjB,CAAA,yBAAA,KAGGM,GACDA,EAAMgC,KACN,iCAC0BhC,EAAMgC,qHAO7B,MAAMC,aAAevC,gBAAMW,QAAC6B,eAAQtC,WAAuD,CAChGC,kBAAmBV,oBACnBS,WAAA,CAAAE,YAAA,gCAAAC,YAAA,qBAF0BL,CAE1B,CAAA,GAAA,IACE0B,iBAAAA,wBAGSe,eAAiBzC,gBAAAA,QAAOC,IAAGC,WAAA,CAAAE,YAAA,kCAAAC,YAAA,qBAAVL,CAM7B,CAAA,qEAEM,MAAM0C,iBAAmB1C,gBAAAA,QAAOC,IAAIC,WAAuD,CAChGC,kBAAmBV,oBACnBS,WAAA,CAAAE,YAAA,oCAAAC,YAAA,qBAF8BL,CAE9B,CAAA,qDAAA,IAKE0B,iBAAgBA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import styled from'styled-components';import{responsiveSize}from'../../mixins/responsive-size.mjs';import{responsiveLayout}from'../../mixins/responsive-layout.mjs';import{focus}from'../../mixins/focus.mjs';import{createShouldForwardProp}from'../../shared/utils/style.mjs';import maskRectangle from'./images/mask-rectangle.svg.mjs';import maskSlope from'./images/mask-slope.svg.mjs';import{Spacer}from'../Spacer/Spacer.mjs';const filterLayoutProps=o=>!['layout','layoutXXS','layoutXS','layoutS','layoutM','layoutL','layoutXL','layouts'].includes(o);const shouldForwardDialogComponentProp=createShouldForwardProp((o=>!['dragging','fancy','zIndex'].includes(o)),filterLayoutProps);const filterCommonProps=createShouldForwardProp((o=>!['scrollable'].includes(o)));const Fading=styled.div.withConfig({shouldForwardProp:o=>!['visible','after'].includes(o)}).withConfig({displayName:"DialogComponent__Fading",componentId:"ui__sc-1dlvioj-0"})(["box-sizing:border-box;position:relative;flex-shrink:0;width:100%;z-index:1;&::before,&::after{transition-property:opacity;transition-duration:150ms;transition-timing-function:ease-in;pointer-events:none;}",""],(o=>o.after?`\n &::after {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n bottom: 100%;\n right: 4px; \n left: 4px;\n margin-bottom: -1px;\n background-image: linear-gradient(0deg, currentcolor, transparent);\n opacity: ${o.visible?1:0};\n }\n `:`\n &::before {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n top: 100%;\n right: 4px;\n left: 4px;\n margin-top: -1px;\n background-image: linear-gradient(180deg, currentcolor, transparent);\n opacity: ${o.visible?1:0};\n }\n `));const FancyBackground=styled.div.withConfig({displayName:"DialogComponent__FancyBackground",componentId:"ui__sc-1dlvioj-1"})(["box-sizing:border-box;position:absolute;top:0;right:0;bottom:0;left:0;mask-image:url(","),url(",");mask-repeat:no-repeat,no-repeat;mask-size:100% 32px,cover;mask-position:0 56px,0 87px;border-radius:inherit;"],maskSlope,maskRectangle);const template_default=o=>`\n color: ${o.color};\n background-color: ${o.backgroundColor};\n box-shadow: 0 6px 20px 1px ${o.shadowColor};\n ${Fading} {\n color: ${o.backgroundColor};\n }\n `,template_fancy=o=>`\n color: ${o.color};\n ${FancyBackground} {\n background-color: ${o.backgroundColor};\n }\n ${Fading} {\n color: ${o.backgroundColor};\n }\n `;const Root=styled.div.withConfig({shouldForwardProp:shouldForwardDialogComponentProp}).withConfig({displayName:"DialogComponent__Root",componentId:"ui__sc-1dlvioj-2"})(["box-sizing:border-box;display:flex;position:relative;isolation:isolate;"," "," "," "," ",""],(o=>(o.fancy?template_fancy:template_default)({color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-onmain-primary'],shadowColor:o.theme.colors['bg-oncolor-hover'],...o.palette})),(o=>o.dragging&&`\n box-shadow: 0 0 0 2px ${o.theme.colors.white}, 0 0 0 4px ${o.theme.colors['border-focus']};\n `),(o=>typeof o.zIndex=='number'&&`z-index: ${o.zIndex};`),responsiveSize,responsiveLayout);const Body=styled.div.withConfig({displayName:"DialogComponent__Body",componentId:"ui__sc-1dlvioj-3"})(["box-sizing:border-box;position:relative;display:flex;flex-direction:column;overflow:hidden;flex-grow:1;"]);const Container=styled.div.withConfig({shouldForwardProp:filterCommonProps}).withConfig({displayName:"DialogComponent__Container",componentId:"ui__sc-1dlvioj-
|
|
1
|
+
import styled from'styled-components';import{responsiveSize}from'../../mixins/responsive-size.mjs';import{responsiveLayout}from'../../mixins/responsive-layout.mjs';import{focus}from'../../mixins/focus.mjs';import{createShouldForwardProp}from'../../shared/utils/style.mjs';import maskRectangle from'./images/mask-rectangle.svg.mjs';import maskSlope from'./images/mask-slope.svg.mjs';import{Spacer}from'../Spacer/Spacer.mjs';const filterLayoutProps=o=>!['layout','layoutXXS','layoutXS','layoutS','layoutM','layoutL','layoutXL','layouts'].includes(o);const shouldForwardDialogComponentProp=createShouldForwardProp((o=>!['dragging','fancy','zIndex'].includes(o)),filterLayoutProps);const filterCommonProps=createShouldForwardProp((o=>!['scrollable'].includes(o)));const Fading=styled.div.withConfig({shouldForwardProp:o=>!['visible','after'].includes(o)}).withConfig({displayName:"DialogComponent__Fading",componentId:"ui__sc-1dlvioj-0"})(["box-sizing:border-box;position:relative;flex-shrink:0;width:100%;z-index:1;&::before,&::after{transition-property:opacity;transition-duration:150ms;transition-timing-function:ease-in;pointer-events:none;}",""],(o=>o.after?`\n &::after {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n bottom: 100%;\n right: 4px; \n left: 4px;\n margin-bottom: -1px;\n background-image: linear-gradient(0deg, currentcolor, transparent);\n opacity: ${o.visible?1:0};\n }\n `:`\n &::before {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n top: 100%;\n right: 4px;\n left: 4px;\n margin-top: -1px;\n background-image: linear-gradient(180deg, currentcolor, transparent);\n opacity: ${o.visible?1:0};\n }\n `));const FancyBackground=styled.div.withConfig({displayName:"DialogComponent__FancyBackground",componentId:"ui__sc-1dlvioj-1"})(["box-sizing:border-box;position:absolute;top:0;right:0;bottom:0;left:0;mask-image:url(","),url(",");mask-repeat:no-repeat,no-repeat;mask-size:100% 32px,cover;mask-position:0 56px,0 87px;border-radius:inherit;"],maskSlope,maskRectangle);const template_default=o=>`\n color: ${o.color};\n background-color: ${o.backgroundColor};\n box-shadow: 0 6px 20px 1px ${o.shadowColor};\n ${Fading} {\n color: ${o.backgroundColor};\n }\n `,template_fancy=o=>`\n color: ${o.color};\n ${FancyBackground} {\n background-color: ${o.backgroundColor};\n }\n ${Fading} {\n color: ${o.backgroundColor};\n }\n `;const Root=styled.div.withConfig({shouldForwardProp:shouldForwardDialogComponentProp}).withConfig({displayName:"DialogComponent__Root",componentId:"ui__sc-1dlvioj-2"})(["box-sizing:border-box;display:flex;position:relative;isolation:isolate;"," "," "," "," ",""],(o=>(o.fancy?template_fancy:template_default)({color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-onmain-primary'],shadowColor:o.theme.colors['bg-oncolor-hover'],...o.palette})),(o=>o.dragging&&`\n box-shadow: 0 0 0 2px ${o.theme.colors.white}, 0 0 0 4px ${o.theme.colors['border-focus']};\n `),(o=>typeof o.zIndex=='number'&&`z-index: ${o.zIndex};`),responsiveSize,responsiveLayout);const Body=styled.div.withConfig({displayName:"DialogComponent__Body",componentId:"ui__sc-1dlvioj-3"})(["box-sizing:border-box;position:relative;display:flex;flex-direction:column;overflow:hidden;flex-grow:1;"]);const StickyHeader=styled.div.withConfig({shouldForwardProp:filterCommonProps}).withConfig({displayName:"DialogComponent__StickyHeader",componentId:"ui__sc-1dlvioj-4"})(["",""],responsiveSize);const Container=styled.div.withConfig({shouldForwardProp:filterCommonProps}).withConfig({displayName:"DialogComponent__Container",componentId:"ui__sc-1dlvioj-5"})(["box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;flex-grow:1;",""],responsiveSize);const Content=styled.div.withConfig({shouldForwardProp:filterCommonProps}).withConfig({displayName:"DialogComponent__Content",componentId:"ui__sc-1dlvioj-6"})(["box-sizing:border-box;flex-grow:1;"," "," ",""],(o=>`\n overflow: ${o.scrollable?'auto':'hidden'};\n overscroll-behavior: ${o.scrollable?'contain':'auto'};\n `),focus,responsiveSize);const Footer=styled.div.withConfig({shouldForwardProp:filterCommonProps}).withConfig({displayName:"DialogComponent__Footer",componentId:"ui__sc-1dlvioj-7"})(["box-sizing:border-box;flex-shrink:0;",""],responsiveSize);const DraggingHandle=styled.div.withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"DialogComponent__DraggingHandle",componentId:"ui__sc-1dlvioj-8"})(["box-sizing:border-box;position:absolute;top:0;left:0;width:100%;display:flex;justify-content:center;padding-top:10px;padding-bottom:10px;cursor:grab;touch-action:none;z-index:2;",""],responsiveLayout);const DraggingIconContainer=styled.div.withConfig({displayName:"DialogComponent__DraggingIconContainer",componentId:"ui__sc-1dlvioj-9"})(["box-sizing:border-box;display:flex;padding:3px 12px;border-radius:12px;& > *{height:0.25em;}"," ",""],(o=>`\n background-color: ${o.theme.colors['bg-onmain-tertiary']};\n `),focus);const Media=styled.div.withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"DialogComponent__Media",componentId:"ui__sc-1dlvioj-10"})(["box-sizing:border-box;overflow:hidden;flex-shrink:0;",""],responsiveLayout);const Img=styled.div.withConfig({shouldForwardProp:o=>o!=='src'}).withConfig({displayName:"DialogComponent__Img",componentId:"ui__sc-1dlvioj-11"})(["box-sizing:border-box;",""],(o=>o.src&&`\n background-image: url(${o.src});\n background-repeat: no-repeat;\n background-position: 50%;\n background-size: cover;\n `));const LayoutSpacer=styled(Spacer).withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"DialogComponent__LayoutSpacer",componentId:"ui__sc-1dlvioj-12"})(["",""],responsiveLayout);const ButtonPosition=styled.div.withConfig({displayName:"DialogComponent__ButtonPosition",componentId:"ui__sc-1dlvioj-13"})(["box-sizing:border-box;position:absolute;top:0;right:0;z-index:3;"]);const ProgressPosition=styled.div.withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"DialogComponent__ProgressPosition",componentId:"ui__sc-1dlvioj-14"})(["box-sizing:border-box;position:absolute;z-index:2;",""],responsiveLayout);export{Body,ButtonPosition,Container,Content,DraggingHandle,DraggingIconContainer,Fading,FancyBackground,Footer,Img,LayoutSpacer,Media,ProgressPosition,Root,StickyHeader};
|
|
2
2
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","sources":["../../../../src/components/DialogComponent/style.ts"],"sourcesContent":["import styled from 'styled-components'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveLayout } from 'mixins/responsive-layout'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { Spacer } from 'components/Spacer'\nimport type {\n ResponsiveSizeProps,\n ResponsiveSizeInterpolationProps,\n ResponsiveLayoutInterpolationProps,\n} from 'shared/interfaces'\nimport maskRectangle from './images/mask-rectangle.svg'\nimport maskSlope from './images/mask-slope.svg'\nimport type {\n StyledDialogComponentProps,\n DialogComponentPalette,\n StyledDialogContentProps,\n Size,\n Layout,\n} from './types'\n\nconst filterLayoutProps = (propKey: string) =>\n !['layout', 'layoutXXS', 'layoutXS', 'layoutS', 'layoutM', 'layoutL', 'layoutXL', 'layouts'].includes(propKey)\n\nconst shouldForwardDialogComponentProp = createShouldForwardProp(\n (propKey) => !['dragging', 'fancy', 'zIndex'].includes(propKey),\n filterLayoutProps\n)\n\nconst filterCommonProps = createShouldForwardProp((propKey: string) => !['scrollable'].includes(propKey))\n\nexport const Fading = styled.div.withConfig<{\n visible: boolean\n after?: boolean\n}>({\n shouldForwardProp: (propKey) => !['visible', 'after'].includes(propKey),\n})`\n box-sizing: border-box;\n position: relative;\n flex-shrink: 0;\n width: 100%;\n z-index: 1;\n\n &::before,\n &::after {\n transition-property: opacity;\n transition-duration: 150ms;\n transition-timing-function: ease-in;\n pointer-events: none;\n }\n\n ${(props) =>\n props.after\n ? `\n &::after {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n bottom: 100%;\n right: 4px; \n left: 4px;\n margin-bottom: -1px;\n background-image: linear-gradient(0deg, currentcolor, transparent);\n opacity: ${props.visible ? 1 : 0};\n }\n `\n : `\n &::before {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n top: 100%;\n right: 4px;\n left: 4px;\n margin-top: -1px;\n background-image: linear-gradient(180deg, currentcolor, transparent);\n opacity: ${props.visible ? 1 : 0};\n }\n `}\n`\n\nexport const FancyBackground = styled.div`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n mask-image: url(${maskSlope}), url(${maskRectangle});\n mask-repeat: no-repeat, no-repeat;\n mask-size:\n 100% 32px,\n cover;\n mask-position:\n 0 56px,\n 0 87px;\n border-radius: inherit;\n`\n\nconst template = {\n default: (palette: DialogComponentPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n box-shadow: 0 6px 20px 1px ${palette.shadowColor};\n ${Fading} {\n color: ${palette.backgroundColor};\n }\n `,\n fancy: (palette: DialogComponentPalette) => `\n color: ${palette.color};\n ${FancyBackground} {\n background-color: ${palette.backgroundColor};\n }\n ${Fading} {\n color: ${palette.backgroundColor};\n }\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledDialogComponentProps>({\n shouldForwardProp: shouldForwardDialogComponentProp,\n})`\n box-sizing: border-box;\n display: flex;\n position: relative;\n isolation: isolate;\n\n ${(props) =>\n (props.fancy ? template.fancy : template.default)({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-onmain-primary'],\n shadowColor: props.theme.colors['bg-oncolor-hover'],\n ...props.palette,\n })}\n\n ${(props) =>\n props.dragging &&\n `\n box-shadow: 0 0 0 2px ${props.theme.colors.white}, 0 0 0 4px ${props.theme.colors['border-focus']};\n `}\n \n ${(props) => typeof props.zIndex === 'number' && `z-index: ${props.zIndex};`}\n\n ${responsiveSize}\n ${responsiveLayout}\n`\n\nexport const Body = styled.div`\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n`\n\nexport const Container = styled.div.withConfig<ResponsiveSizeInterpolationProps<Size, Size, ResponsiveSizeProps<Size>>>(\n {\n shouldForwardProp: filterCommonProps,\n }\n)`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n\n ${responsiveSize}\n`\n\nexport const Content = styled.div.withConfig<StyledDialogContentProps>({\n shouldForwardProp: filterCommonProps,\n})`\n box-sizing: border-box;\n flex-grow: 1;\n\n ${(props) => `\n overflow: ${props.scrollable ? 'auto' : 'hidden'};\n overscroll-behavior: ${props.scrollable ? 'contain' : 'auto'};\n `}\n\n ${focus}\n ${responsiveSize}\n`\n\nexport const Footer = styled.div.withConfig<ResponsiveSizeInterpolationProps<Size, Size, ResponsiveSizeProps<Size>>>({\n shouldForwardProp: filterCommonProps,\n})`\n box-sizing: border-box;\n flex-shrink: 0;\n\n ${responsiveSize}\n`\n\nexport const DraggingHandle = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n padding-top: 10px;\n padding-bottom: 10px;\n cursor: grab;\n touch-action: none;\n z-index: 2;\n\n ${responsiveLayout}\n`\n\nexport const DraggingIconContainer = styled.div`\n box-sizing: border-box;\n display: flex;\n padding: 3px 12px;\n border-radius: 12px;\n\n & > * {\n height: 0.25em;\n }\n\n ${(props) => `\n background-color: ${props.theme.colors['bg-onmain-tertiary']};\n `}\n\n ${focus}\n`\n\nexport const Media = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n overflow: hidden;\n flex-shrink: 0;\n\n ${responsiveLayout}\n`\n\nexport const Img = styled.div.withConfig<{ src?: string }>({\n shouldForwardProp: (propKey) => propKey !== 'src',\n})`\n box-sizing: border-box;\n\n ${(props) =>\n props.src &&\n `\n background-image: url(${props.src});\n background-repeat: no-repeat;\n background-position: 50%;\n background-size: cover;\n `}\n`\n\nexport const LayoutSpacer = styled(Spacer).withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n ${responsiveLayout}\n`\n\nexport const ButtonPosition = styled.div`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 3;\n`\n\nexport const ProgressPosition = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n position: absolute;\n z-index: 2;\n\n ${responsiveLayout}\n`\n"],"names":["filterLayoutProps","propKey","includes","shouldForwardDialogComponentProp","createShouldForwardProp","filterCommonProps","Fading","styled","div","withConfig","shouldForwardProp","displayName","componentId","props","after","visible","FancyBackground","maskSlope","maskRectangle","template","palette","color","backgroundColor","shadowColor","Root","fancy","theme","colors","dragging","white","zIndex","responsiveSize","responsiveLayout","Body","Container","Content","scrollable","focus","Footer","DraggingHandle","DraggingIconContainer","Media","Img","src","LayoutSpacer","Spacer","ButtonPosition","ProgressPosition"],"mappings":"uaAqBA,MAAMA,kBAAqBC,IACxB,CAAC,SAAU,YAAa,WAAY,UAAW,UAAW,UAAW,WAAY,WAAWC,SAASD,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kBAAmBV,oBACnBS,WAAA,CAAAE,YAAA,gCAAAC,YAAA,qBAF0BL,CAE1B,CAAA,GAAA,IACEyB,wBAGSc,eAAiBvC,OAAOC,IAAGC,WAAA,CAAAE,YAAA,kCAAAC,YAAA,qBAAVL,CAM7B,CAAA,qEAEM,MAAMwC,iBAAmBxC,OAAOC,IAAIC,WAAuD,CAChGC,kBAAmBV,oBACnBS,WAAA,CAAAE,YAAA,oCAAAC,YAAA,qBAF8BL,CAE9B,CAAA,qDAAA,IAKEyB"}
|
|
1
|
+
{"version":3,"file":"style.mjs","sources":["../../../../src/components/DialogComponent/style.ts"],"sourcesContent":["import styled from 'styled-components'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveLayout } from 'mixins/responsive-layout'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { Spacer } from 'components/Spacer'\nimport type {\n ResponsiveSizeProps,\n ResponsiveSizeInterpolationProps,\n ResponsiveLayoutInterpolationProps,\n} from 'shared/interfaces'\nimport maskRectangle from './images/mask-rectangle.svg'\nimport maskSlope from './images/mask-slope.svg'\nimport type {\n StyledDialogComponentProps,\n DialogComponentPalette,\n StyledDialogContentProps,\n Size,\n Layout,\n} from './types'\n\nconst filterLayoutProps = (propKey: string) =>\n !['layout', 'layoutXXS', 'layoutXS', 'layoutS', 'layoutM', 'layoutL', 'layoutXL', 'layouts'].includes(propKey)\n\nconst shouldForwardDialogComponentProp = createShouldForwardProp(\n (propKey) => !['dragging', 'fancy', 'zIndex'].includes(propKey),\n filterLayoutProps\n)\n\nconst filterCommonProps = createShouldForwardProp((propKey: string) => !['scrollable'].includes(propKey))\n\nexport const Fading = styled.div.withConfig<{\n visible: boolean\n after?: boolean\n}>({\n shouldForwardProp: (propKey) => !['visible', 'after'].includes(propKey),\n})`\n box-sizing: border-box;\n position: relative;\n flex-shrink: 0;\n width: 100%;\n z-index: 1;\n\n &::before,\n &::after {\n transition-property: opacity;\n transition-duration: 150ms;\n transition-timing-function: ease-in;\n pointer-events: none;\n }\n\n ${(props) =>\n props.after\n ? `\n &::after {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n bottom: 100%;\n right: 4px; \n left: 4px;\n margin-bottom: -1px;\n background-image: linear-gradient(0deg, currentcolor, transparent);\n opacity: ${props.visible ? 1 : 0};\n }\n `\n : `\n &::before {\n content: '';\n display: block;\n position: absolute;\n height: 35px;\n top: 100%;\n right: 4px;\n left: 4px;\n margin-top: -1px;\n background-image: linear-gradient(180deg, currentcolor, transparent);\n opacity: ${props.visible ? 1 : 0};\n }\n `}\n`\n\nexport const FancyBackground = styled.div`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n mask-image: url(${maskSlope}), url(${maskRectangle});\n mask-repeat: no-repeat, no-repeat;\n mask-size:\n 100% 32px,\n cover;\n mask-position:\n 0 56px,\n 0 87px;\n border-radius: inherit;\n`\n\nconst template = {\n default: (palette: DialogComponentPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n box-shadow: 0 6px 20px 1px ${palette.shadowColor};\n ${Fading} {\n color: ${palette.backgroundColor};\n }\n `,\n fancy: (palette: DialogComponentPalette) => `\n color: ${palette.color};\n ${FancyBackground} {\n background-color: ${palette.backgroundColor};\n }\n ${Fading} {\n color: ${palette.backgroundColor};\n }\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledDialogComponentProps>({\n shouldForwardProp: shouldForwardDialogComponentProp,\n})`\n box-sizing: border-box;\n display: flex;\n position: relative;\n isolation: isolate;\n\n ${(props) =>\n (props.fancy ? template.fancy : template.default)({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-onmain-primary'],\n shadowColor: props.theme.colors['bg-oncolor-hover'],\n ...props.palette,\n })}\n\n ${(props) =>\n props.dragging &&\n `\n box-shadow: 0 0 0 2px ${props.theme.colors.white}, 0 0 0 4px ${props.theme.colors['border-focus']};\n `}\n \n ${(props) => typeof props.zIndex === 'number' && `z-index: ${props.zIndex};`}\n\n ${responsiveSize}\n ${responsiveLayout}\n`\n\nexport const Body = styled.div`\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n`\n\nexport const StickyHeader = styled.div.withConfig<\n ResponsiveSizeInterpolationProps<Size, Size, ResponsiveSizeProps<Size>>\n>({\n shouldForwardProp: filterCommonProps,\n})`\n ${responsiveSize}\n`\n\nexport const Container = styled.div.withConfig<ResponsiveSizeInterpolationProps<Size, Size, ResponsiveSizeProps<Size>>>(\n {\n shouldForwardProp: filterCommonProps,\n }\n)`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n\n ${responsiveSize}\n`\n\nexport const Content = styled.div.withConfig<StyledDialogContentProps>({\n shouldForwardProp: filterCommonProps,\n})`\n box-sizing: border-box;\n flex-grow: 1;\n\n ${(props) => `\n overflow: ${props.scrollable ? 'auto' : 'hidden'};\n overscroll-behavior: ${props.scrollable ? 'contain' : 'auto'};\n `}\n\n ${focus}\n ${responsiveSize}\n`\n\nexport const Footer = styled.div.withConfig<ResponsiveSizeInterpolationProps<Size, Size, ResponsiveSizeProps<Size>>>({\n shouldForwardProp: filterCommonProps,\n})`\n box-sizing: border-box;\n flex-shrink: 0;\n\n ${responsiveSize}\n`\n\nexport const DraggingHandle = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n padding-top: 10px;\n padding-bottom: 10px;\n cursor: grab;\n touch-action: none;\n z-index: 2;\n\n ${responsiveLayout}\n`\n\nexport const DraggingIconContainer = styled.div`\n box-sizing: border-box;\n display: flex;\n padding: 3px 12px;\n border-radius: 12px;\n\n & > * {\n height: 0.25em;\n }\n\n ${(props) => `\n background-color: ${props.theme.colors['bg-onmain-tertiary']};\n `}\n\n ${focus}\n`\n\nexport const Media = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n overflow: hidden;\n flex-shrink: 0;\n\n ${responsiveLayout}\n`\n\nexport const Img = styled.div.withConfig<{ src?: string }>({\n shouldForwardProp: (propKey) => propKey !== 'src',\n})`\n box-sizing: border-box;\n\n ${(props) =>\n props.src &&\n `\n background-image: url(${props.src});\n background-repeat: no-repeat;\n background-position: 50%;\n background-size: cover;\n `}\n`\n\nexport const LayoutSpacer = styled(Spacer).withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n ${responsiveLayout}\n`\n\nexport const ButtonPosition = styled.div`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 3;\n`\n\nexport const ProgressPosition = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n position: absolute;\n z-index: 2;\n\n ${responsiveLayout}\n`\n"],"names":["filterLayoutProps","propKey","includes","shouldForwardDialogComponentProp","createShouldForwardProp","filterCommonProps","Fading","styled","div","withConfig","shouldForwardProp","displayName","componentId","props","after","visible","FancyBackground","maskSlope","maskRectangle","template","palette","color","backgroundColor","shadowColor","Root","fancy","theme","colors","dragging","white","zIndex","responsiveSize","responsiveLayout","Body","StickyHeader","Container","Content","scrollable","focus","Footer","DraggingHandle","DraggingIconContainer","Media","Img","src","LayoutSpacer","Spacer","ButtonPosition","ProgressPosition"],"mappings":"uaAqBA,MAAMA,kBAAqBC,IACxB,CAAC,SAAU,YAAa,WAAY,UAAW,UAAW,UAAW,WAAY,WAAWC,SAASD,GAExG,MAAME,iCAAmCC,yBACtCH,IAAa,CAAC,WAAY,QAAS,UAAUC,SAASD,IACvDD,mBAGF,MAAMK,kBAAoBD,yBAAyBH,IAAqB,CAAC,cAAcC,SAASD,KAEzF,MAAMK,OAASC,OAAOC,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AAE,YAAA,gCAAAC,YAAA,qBAF0BL,CAE1B,CAAA,GAAA,IACEyB,wBAGSe,eAAiBxC,OAAOC,IAAGC,WAAA,CAAAE,YAAA,kCAAAC,YAAA,qBAAVL,CAM7B,CAAA,qEAEM,MAAMyC,iBAAmBzC,OAAOC,IAAIC,WAAuD,CAChGC,kBAAmBV,oBACnBS,WAAA,CAAAE,YAAA,oCAAAC,YAAA,qBAF8BL,CAE9B,CAAA,qDAAA,IAKEyB"}
|
package/dts/index.d.ts
CHANGED
|
@@ -3756,6 +3756,16 @@ interface DialogComponentBaseProps extends ResponsiveSizeProps<Size$7>, Responsi
|
|
|
3756
3756
|
*
|
|
3757
3757
|
* @default undefined */
|
|
3758
3758
|
closeButton?: React.ReactNode | ((closeButtonProps: IconButtonProps) => React.ReactNode);
|
|
3759
|
+
/**
|
|
3760
|
+
* Кастомный хедер.
|
|
3761
|
+
*
|
|
3762
|
+
* @slot
|
|
3763
|
+
* @default undefined */
|
|
3764
|
+
header?: React.ReactNode | ((headerProps: {
|
|
3765
|
+
captionProps: TextProps;
|
|
3766
|
+
titleProps: TextProps;
|
|
3767
|
+
subtitleProps: TextProps;
|
|
3768
|
+
}) => React.ReactNode);
|
|
3759
3769
|
/**
|
|
3760
3770
|
* Текст над заголовком.
|
|
3761
3771
|
*
|
|
@@ -3889,6 +3899,12 @@ interface DialogComponentBaseProps extends ResponsiveSizeProps<Size$7>, Responsi
|
|
|
3889
3899
|
onGrab?: React.PointerEventHandler<HTMLElement>;
|
|
3890
3900
|
onNudge?: React.KeyboardEventHandler<HTMLElement>;
|
|
3891
3901
|
}) => React.ReactNode);
|
|
3902
|
+
/**
|
|
3903
|
+
* Определяет, должен ли хедер быть фиксированным при прокрутке контента.
|
|
3904
|
+
*
|
|
3905
|
+
* @general
|
|
3906
|
+
* @default false */
|
|
3907
|
+
stickyHeader?: boolean;
|
|
3892
3908
|
/**
|
|
3893
3909
|
* Колбек будет передан в onPointerDown элемента области захвата.
|
|
3894
3910
|
*
|
|
@@ -4027,6 +4043,16 @@ interface DialogBaseProps extends ResponsiveSizeProps<Size$6>, ResponsiveLayoutP
|
|
|
4027
4043
|
* @slot
|
|
4028
4044
|
* @default undefined */
|
|
4029
4045
|
closeButton?: React.ReactNode | ((closeButtonProps: IconButtonProps) => React.ReactNode);
|
|
4046
|
+
/**
|
|
4047
|
+
* Кастомный хедер.
|
|
4048
|
+
*
|
|
4049
|
+
* @slot
|
|
4050
|
+
* @default undefined */
|
|
4051
|
+
header?: React.ReactNode | ((headerProps: {
|
|
4052
|
+
captionProps: TextProps;
|
|
4053
|
+
titleProps: TextProps;
|
|
4054
|
+
subtitleProps: TextProps;
|
|
4055
|
+
}) => React.ReactNode);
|
|
4030
4056
|
/**
|
|
4031
4057
|
* Текст над заголовком диалога.
|
|
4032
4058
|
*
|
|
@@ -4182,6 +4208,12 @@ interface DialogBaseProps extends ResponsiveSizeProps<Size$6>, ResponsiveLayoutP
|
|
|
4182
4208
|
onGrab?: React.PointerEventHandler<HTMLElement>;
|
|
4183
4209
|
onNudge?: React.KeyboardEventHandler<HTMLElement>;
|
|
4184
4210
|
}) => React.ReactNode);
|
|
4211
|
+
/**
|
|
4212
|
+
* Определяет, должен ли хедер быть фиксированным при прокрутке контента.
|
|
4213
|
+
*
|
|
4214
|
+
* @general
|
|
4215
|
+
* @default false */
|
|
4216
|
+
stickyHeader?: boolean;
|
|
4185
4217
|
/**
|
|
4186
4218
|
* Размер.
|
|
4187
4219
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foxford/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.85.0-beta-d216815-20251015",
|
|
4
4
|
"description": "UI components and utilities",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/foxford/ui/issues"
|
|
@@ -68,6 +68,6 @@
|
|
|
68
68
|
"shared",
|
|
69
69
|
"theme"
|
|
70
70
|
],
|
|
71
|
-
"sha": "
|
|
71
|
+
"sha": "d216815",
|
|
72
72
|
"scripts": {}
|
|
73
73
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderSlot.js","sources":["../../../../src/shared/utils/renderSlot.ts"],"sourcesContent":["import { isValidElement } from 'react'\n\ntype Slot<Props> = React.ReactNode | ((props: Props) => React.ReactNode)\n\ntype RenderSlotParams<Props> = {\n slot: Slot<Props>\n props: Props\n fallback?: React.ReactNode\n}\n\nexport const renderSlot = <Props>({ slot, props, fallback }: RenderSlotParams<Props>) => {\n if (isValidElement(slot)) {\n return slot\n }\n\n if (typeof slot === 'function') {\n return slot(props)\n }\n\n return fallback || null\n}\n"],"names":["renderSlot","slot","props","fallback","isValidElement"],"mappings":"2DAU0BA,EAAUC,OAAMC,QAAOC,cAC3CC,MAAAA,eAAeH,GACVA,SAGEA,GAAS,WACXA,EAAKC,GAGPC,GAAY"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderSlot.mjs","sources":["../../../../src/shared/utils/renderSlot.ts"],"sourcesContent":["import { isValidElement } from 'react'\n\ntype Slot<Props> = React.ReactNode | ((props: Props) => React.ReactNode)\n\ntype RenderSlotParams<Props> = {\n slot: Slot<Props>\n props: Props\n fallback?: React.ReactNode\n}\n\nexport const renderSlot = <Props>({ slot, props, fallback }: RenderSlotParams<Props>) => {\n if (isValidElement(slot)) {\n return slot\n }\n\n if (typeof slot === 'function') {\n return slot(props)\n }\n\n return fallback || null\n}\n"],"names":["renderSlot","slot","props","fallback","isValidElement"],"mappings":"kCAUO,MAAMA,WAAaA,EAAUC,OAAMC,QAAOC,cAC3CC,eAAeH,GACVA,SAGEA,GAAS,WACXA,EAAKC,GAGPC,GAAY"}
|