@foxford/ui 2.65.0-beta-6fe26ef-20250220 → 2.66.0-beta-74581c2-20250226
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/ProgressLineContainer.js +2 -0
- package/components/DialogComponent/ProgressLineContainer.js.map +1 -0
- package/components/DialogComponent/ProgressLineContainer.mjs +2 -0
- package/components/DialogComponent/ProgressLineContainer.mjs.map +1 -0
- package/components/DialogComponent/constants.js +1 -1
- package/components/DialogComponent/constants.js.map +1 -1
- package/components/DialogComponent/constants.mjs +1 -1
- package/components/DialogComponent/constants.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/components/Popover/Popover.js +1 -1
- package/components/Popover/Popover.js.map +1 -1
- package/components/Popover/Popover.mjs +1 -1
- package/components/Popover/Popover.mjs.map +1 -1
- package/components/PopoverComponent/PopoverComponent.js +1 -1
- package/components/PopoverComponent/PopoverComponent.js.map +1 -1
- package/components/PopoverComponent/PopoverComponent.mjs +1 -1
- package/components/PopoverComponent/PopoverComponent.mjs.map +1 -1
- package/components/PopoverComponent/constants.js +1 -1
- package/components/PopoverComponent/constants.js.map +1 -1
- package/components/PopoverComponent/constants.mjs +1 -1
- package/components/PopoverComponent/constants.mjs.map +1 -1
- package/components/PopoverComponent/style.js +1 -1
- package/components/PopoverComponent/style.js.map +1 -1
- package/components/PopoverComponent/style.mjs +1 -1
- package/components/PopoverComponent/style.mjs.map +1 -1
- package/components/Tooltip/Tooltip.js.map +1 -1
- package/components/Tooltip/Tooltip.mjs.map +1 -1
- package/components/TooltipComponent/TooltipComponent.js +1 -1
- package/components/TooltipComponent/TooltipComponent.js.map +1 -1
- package/components/TooltipComponent/TooltipComponent.mjs +1 -1
- package/components/TooltipComponent/TooltipComponent.mjs.map +1 -1
- package/components/TooltipComponent/constants.js +1 -1
- package/components/TooltipComponent/constants.js.map +1 -1
- package/components/TooltipComponent/constants.mjs +1 -1
- package/components/TooltipComponent/constants.mjs.map +1 -1
- package/components/TooltipComponent/style.js +1 -1
- package/components/TooltipComponent/style.js.map +1 -1
- package/components/TooltipComponent/style.mjs +1 -1
- package/components/TooltipComponent/style.mjs.map +1 -1
- package/dts/index.d.ts +592 -292
- package/package.json +1 -1
|
@@ -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 { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { IconButton } from 'components/IconButton'\nimport { Skeleton } from 'components/Skeleton'\nimport maskRectangle from './images/mask-rectangle.svg'\nimport maskSlope from './images/mask-slope.svg'\nimport type {\n StyledDialogComponentProps,\n DialogComponentPalette,\n StyledDialogContainerProps,\n StyledDialogFadingProps,\n StyledPlaceholderProps,\n StyledDialogMediaProps,\n StyledMediaContainerProps,\n StyledPositionedIconButtonProps,\n} from './types'\n\nconst shouldForwardDialogComponentProp = createShouldForwardProp(\n (propKey) => !['dragging', 'fancy', 'zIndex'].includes(propKey)\n)\n\nconst shouldForwardDialogContainerProp = createShouldForwardProp((propKey) => !['fancy'].includes(propKey))\n\nexport const Fading = styled.div.withConfig<StyledDialogFadingProps>({\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 width: 100%;\n bottom: 100%;\n left: 0;\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 width: 100%;\n top: 100%;\n left: 0;\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: 100% 32px, cover;\n mask-position: 0 56px, 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 position: relative;\n display: flex;\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`\n\nexport const Container = styled.div.withConfig<StyledDialogContainerProps>({\n shouldForwardProp: shouldForwardDialogContainerProp,\n})`\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n\n ${responsiveSize}\n`\n\nexport const ScrollableContent = styled.div`\n box-sizing: border-box;\n position: relative;\n overflow: auto;\n overscroll-behavior: contain;\n padding-top: 1px;\n padding-bottom: 1px;\n min-height: 85px;\n flex-grow: 1;\n\n ${focus}\n`\n\nexport const Controls = styled.div`\n box-sizing: border-box;\n position: relative;\n flex-shrink: 0;\n padding-top: 12px;\n`\n\nexport const DraggingHandle = styled.div`\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\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 PositionedIconButton = styled(IconButton).withConfig<StyledPositionedIconButtonProps>({\n shouldForwardProp: (propKey) => propKey !== 'inset',\n})`\n position: absolute;\n z-index: 3;\n ${(props) => props.inset}\n`\n\nexport const Placeholder = styled.svg\n .withConfig<StyledPlaceholderProps>({\n shouldForwardProp: (propKey) => !['aspectRatio', 'orientation'].includes(propKey),\n })\n .attrs<StyledPlaceholderProps>((props) => ({\n xmlns: 'http://www.w3.org/2000/svg',\n viewBox: props.aspectRatio === '3:1' ? '0 0 3 1' : '0 0 5 7',\n width: props.orientation === 'portrait' ? '100%' : undefined,\n height: props.orientation === 'landscape' ? '100%' : undefined,\n }))`\n display: block;\n`\n\nexport const MediaPortrait = styled.div`\n box-sizing: border-box;\n position: relative;\n margin: -1px -1px 0;\n`\n\nexport const MediaLandscape = styled.div.withConfig<StyledMediaContainerProps>({\n shouldForwardProp: (propKey) => propKey !== 'right',\n})`\n box-sizing: border-box;\n position: relative;\n height: 100%;\n overflow: hidden;\n\n ${(props) =>\n props.right\n ? `\n border-top-right-radius: inherit;\n border-bottom-right-radius: inherit;`\n : `\n border-top-left-radius: inherit;\n border-bottom-left-radius: inherit;`}\n`\n\nexport const MediaSkeleton = styled(Skeleton)`\n position: absolute;\n top: 0;\n left: 0;\n`\n\nexport const Media = styled.div.withConfig<StyledDialogMediaProps>({\n shouldForwardProp: (propKey) => propKey !== 'src',\n})`\n ${(props) => `\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n background-image: url(${props.src});\n background-size: contain;\n background-repeat: no-repeat;\n background-position: 50%;\n `}\n`\n\nexport const MediaPortraitContainer = styled.div.withConfig<StyledMediaContainerProps>({\n shouldForwardProp: (propKey) => !['top', 'bottom'].includes(propKey),\n})`\n box-sizing: border-box;\n overflow: hidden;\n\n ${(props) =>\n props.top &&\n `\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n `}\n\n ${(props) =>\n props.bottom &&\n `\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n `}\n`\n"],"names":["shouldForwardDialogComponentProp","createShouldForwardProp","propKey","includes","shouldForwardDialogContainerProp","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","Container","ScrollableContent","focus","Controls","DraggingHandle","DraggingIconContainer","PositionedIconButton","IconButton","inset","Placeholder","svg","attrs","xmlns","viewBox","aspectRatio","width","orientation","undefined","height","MediaPortrait","MediaLandscape","right","MediaSkeleton","Skeleton","Media","src","MediaPortraitContainer","top","bottom"],"mappings":"khBAmBA,MAAMA,iCAAmCC,MAAuBA,yBAC7DC,IAAa,CAAC,WAAY,QAAS,UAAUC,SAASD,KAGzD,MAAME,iCAAmCH,MAAAA,yBAAyBC,IAAa,CAAC,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,qBAF4BL,CAE5B,CAAA,uEAAA,KAMGM,GACDA,EAAMyC,MACF,4FAGA,4FAKD,MAAMC,cAAgBhD,gBAAMW,QAACsC,mBAAS/C,WAAA,CAAAE,YAAA,iCAAAC,YAAA,qBAAhBL,CAI5B,CAAA,oCAEM,MAAMkD,MAAQlD,gBAAAA,QAAOC,IAAIC,WAAmC,CACjEC,kBAAoBP,GAAYA,IAAY,QAC5CM,WAAA,CAAAE,YAAA,yBAAAC,YAAA,qBAFmBL,CAEnB,CAAA,GAAA,KACGM,GAAU,mKAOeA,EAAM6C,uHAO7B,MAAMC,uBAAyBpD,gBAAAA,QAAOC,IAAIC,WAAsC,CACrFC,kBAAoBP,IAAa,CAAC,MAAO,UAAUC,SAASD,KAC5DM,WAAA,CAAAE,YAAA,0CAAAC,YAAA,qBAFoCL,CAEpC,CAAA,yCAAA,IAAA,KAIGM,GACDA,EAAM+C,KACN,4FAKC/C,GACDA,EAAMgD,QACN"}
|
|
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 { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { IconButton } from 'components/IconButton'\nimport { Skeleton } from 'components/Skeleton'\nimport { ProgressLine } from 'components/ProgressLine'\nimport maskRectangle from './images/mask-rectangle.svg'\nimport maskSlope from './images/mask-slope.svg'\nimport type {\n StyledDialogComponentProps,\n DialogComponentPalette,\n StyledDialogContainerProps,\n StyledDialogFadingProps,\n StyledPlaceholderProps,\n StyledDialogMediaProps,\n StyledMediaContainerProps,\n StyledPositionedIconButtonProps,\n StyledPositionedProgressLineProps,\n StyledProgressLineContainerProps,\n} from './types'\n\nconst shouldForwardDialogComponentProp = createShouldForwardProp(\n (propKey) => !['dragging', 'fancy', 'zIndex'].includes(propKey)\n)\n\nconst shouldForwardDialogContainerProp = createShouldForwardProp((propKey) => !['fancy'].includes(propKey))\n\nconst shouldForwardProgressLineContainerProp = createShouldForwardProp((propKey) => !['inset'].includes(propKey))\n\nexport const Fading = styled.div.withConfig<StyledDialogFadingProps>({\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 width: 100%;\n bottom: 100%;\n left: 0;\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 width: 100%;\n top: 100%;\n left: 0;\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: 100% 32px, cover;\n mask-position: 0 56px, 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 position: relative;\n display: flex;\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`\n\nexport const Container = styled.div.withConfig<StyledDialogContainerProps>({\n shouldForwardProp: shouldForwardDialogContainerProp,\n})`\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n\n ${responsiveSize}\n`\n\nexport const ScrollableContent = styled.div`\n box-sizing: border-box;\n position: relative;\n overflow: auto;\n overscroll-behavior: contain;\n padding: 4px;\n min-height: 85px;\n flex-grow: 1;\n\n ${focus}\n`\n\nexport const Controls = styled.div`\n box-sizing: border-box;\n position: relative;\n flex-shrink: 0;\n padding: 12px 4px 4px;\n`\n\nexport const DraggingHandle = styled.div`\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\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 PositionedIconButton = styled(IconButton).withConfig<StyledPositionedIconButtonProps>({\n shouldForwardProp: (propKey) => propKey !== 'inset',\n})`\n position: absolute;\n z-index: 3;\n ${(props) => props.inset}\n`\n\nexport const PositionedProgressLine = styled(ProgressLine).withConfig<StyledPositionedProgressLineProps>({\n shouldForwardProp: (propKey) => propKey !== 'inset',\n})`\n position: absolute;\n ${(props) => props.inset}\n`\n\nexport const ProgressLineContainer = styled.div.withConfig<StyledProgressLineContainerProps>({\n shouldForwardProp: shouldForwardProgressLineContainerProp,\n})`\n position: absolute;\n ${(props) => props.inset}\n\n ${responsiveSize}\n`\n\nexport const Placeholder = styled.svg\n .withConfig<StyledPlaceholderProps>({\n shouldForwardProp: (propKey) => !['aspectRatio', 'orientation'].includes(propKey),\n })\n .attrs<StyledPlaceholderProps>((props) => ({\n xmlns: 'http://www.w3.org/2000/svg',\n viewBox: {\n '1:1': '0 0 1 1',\n '3:1': '0 0 3 1',\n '4:5': '0 0 4 5',\n '5:2': '0 0 5 2',\n '5:7': '0 0 5 7',\n }[props.aspectRatio],\n width: props.orientation === 'portrait' ? '100%' : undefined,\n height: props.orientation === 'landscape' ? '100%' : undefined,\n }))`\n display: block;\n`\n\nexport const MediaPortrait = styled.div`\n box-sizing: border-box;\n position: relative;\n margin: -1px -1px 0;\n`\n\nexport const MediaLandscape = styled.div.withConfig<StyledMediaContainerProps>({\n shouldForwardProp: (propKey) => propKey !== 'right',\n})`\n box-sizing: border-box;\n position: relative;\n height: 100%;\n overflow: hidden;\n\n ${(props) =>\n props.right\n ? `\n border-top-right-radius: inherit;\n border-bottom-right-radius: inherit;`\n : `\n border-top-left-radius: inherit;\n border-bottom-left-radius: inherit;`}\n`\n\nexport const MediaSkeleton = styled(Skeleton)`\n position: absolute;\n top: 0;\n left: 0;\n`\n\nexport const Media = styled.div.withConfig<StyledDialogMediaProps>({\n shouldForwardProp: (propKey) => propKey !== 'src',\n})`\n ${(props) => `\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n background-image: url(${props.src});\n background-size: contain;\n background-repeat: no-repeat;\n background-position: 50%;\n `}\n`\n\nexport const MediaPortraitContainer = styled.div.withConfig<StyledMediaContainerProps>({\n shouldForwardProp: (propKey) => !['top', 'bottom'].includes(propKey),\n})`\n box-sizing: border-box;\n overflow: hidden;\n\n ${(props) =>\n props.top &&\n `\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n `}\n\n ${(props) =>\n props.bottom &&\n `\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n `}\n`\n"],"names":["shouldForwardDialogComponentProp","createShouldForwardProp","propKey","includes","shouldForwardDialogContainerProp","shouldForwardProgressLineContainerProp","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","Container","ScrollableContent","focus","Controls","DraggingHandle","DraggingIconContainer","PositionedIconButton","IconButton","inset","PositionedProgressLine","ProgressLine","ProgressLineContainer","Placeholder","svg","attrs","xmlns","viewBox","aspectRatio","width","orientation","undefined","height","MediaPortrait","MediaLandscape","right","MediaSkeleton","Skeleton","Media","src","MediaPortraitContainer","top","bottom"],"mappings":"8kBAsBA,MAAMA,iCAAmCC,MAAuBA,yBAC7DC,IAAa,CAAC,WAAY,QAAS,UAAUC,SAASD,KAGzD,MAAME,iCAAmCH,MAAAA,yBAAyBC,IAAa,CAAC,SAASC,SAASD,KAElG,MAAMG,uCAAyCJ,MAAAA,yBAAyBC,IAAa,CAAC,SAASC,SAASD,KAEjG,MAAMI,OAASC,gBAAAA,QAAOC,IAAIC,WAAoC,CACnEC,kBAAoBR,IAAa,CAAC,UAAW,SAASC,SAASD,KAC/DO,WAAA,CAAAE,YAAA,0BAAAC,YAAA,oBAFoBL,CAEpB,CAAA,+MAAA,KAeGM,GACDA,EAAMC,MACF,iWAWeD,EAAME,QAAU,EAAI,gCAGnC,8VAWeF,EAAME,QAAU,EAAI,kCAK9BC,gBAAkBT,gBAAAA,QAAOC,IAAGC,WAAA,CAAAE,YAAA,mCAAAC,YAAA,oBAAVL,CAOXU,CAAAA,wFAAAA,SAAAA,kHAAAA,UAASC,QAAUC,uBAOvC,MAAMC,iBACMC,GAAoC,gBACnCA,EAAQC,iCACGD,EAAQE,oDACCF,EAAQG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,cAAgBnD,gBAAMW,QAACyC,mBAASlD,WAAA,CAAAE,YAAA,iCAAAC,YAAA,qBAAhBL,CAI5B,CAAA,oCAEM,MAAMqD,MAAQrD,gBAAAA,QAAOC,IAAIC,WAAmC,CACjEC,kBAAoBR,GAAYA,IAAY,QAC5CO,WAAA,CAAAE,YAAA,yBAAAC,YAAA,qBAFmBL,CAEnB,CAAA,GAAA,KACGM,GAAU,mKAOeA,EAAMgD,uHAO7B,MAAMC,uBAAyBvD,gBAAAA,QAAOC,IAAIC,WAAsC,CACrFC,kBAAoBR,IAAa,CAAC,MAAO,UAAUC,SAASD,KAC5DO,WAAA,CAAAE,YAAA,0CAAAC,YAAA,qBAFoCL,CAEpC,CAAA,yCAAA,IAAA,KAIGM,GACDA,EAAMkD,KACN,4FAKClD,GACDA,EAAMmD,QACN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import styled from'styled-components';import{responsiveSize}from'../../mixins/responsive-size.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{IconButton}from'../IconButton/IconButton.mjs';import{Skeleton}from'../Skeleton/Skeleton.mjs';const shouldForwardDialogComponentProp=createShouldForwardProp((o=>!['dragging','fancy','zIndex'].includes(o)));const shouldForwardDialogContainerProp=createShouldForwardProp((o=>!['fancy'].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 width: 100%;\n bottom: 100%;\n left: 0;\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 width: 100%;\n top: 100%;\n left: 0;\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;position:relative;display:flex;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);const Container=styled.div.withConfig({shouldForwardProp:shouldForwardDialogContainerProp}).withConfig({displayName:"DialogComponent__Container",componentId:"ui__sc-1dlvioj-3"})(["box-sizing:border-box;position:relative;display:flex;flex-direction:column;overflow:hidden;flex-grow:1;",""],responsiveSize);const ScrollableContent=styled.div.withConfig({displayName:"DialogComponent__ScrollableContent",componentId:"ui__sc-1dlvioj-4"})(["box-sizing:border-box;position:relative;overflow:auto;overscroll-behavior:contain;padding
|
|
1
|
+
import styled from'styled-components';import{responsiveSize}from'../../mixins/responsive-size.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{IconButton}from'../IconButton/IconButton.mjs';import{ProgressLine}from'../ProgressLine/ProgressLine.mjs';import{Skeleton}from'../Skeleton/Skeleton.mjs';const shouldForwardDialogComponentProp=createShouldForwardProp((o=>!['dragging','fancy','zIndex'].includes(o)));const shouldForwardDialogContainerProp=createShouldForwardProp((o=>!['fancy'].includes(o)));const shouldForwardProgressLineContainerProp=createShouldForwardProp((o=>!['inset'].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 width: 100%;\n bottom: 100%;\n left: 0;\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 width: 100%;\n top: 100%;\n left: 0;\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;position:relative;display:flex;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);const Container=styled.div.withConfig({shouldForwardProp:shouldForwardDialogContainerProp}).withConfig({displayName:"DialogComponent__Container",componentId:"ui__sc-1dlvioj-3"})(["box-sizing:border-box;position:relative;display:flex;flex-direction:column;overflow:hidden;flex-grow:1;",""],responsiveSize);const ScrollableContent=styled.div.withConfig({displayName:"DialogComponent__ScrollableContent",componentId:"ui__sc-1dlvioj-4"})(["box-sizing:border-box;position:relative;overflow:auto;overscroll-behavior:contain;padding:4px;min-height:85px;flex-grow:1;",""],focus);const Controls=styled.div.withConfig({displayName:"DialogComponent__Controls",componentId:"ui__sc-1dlvioj-5"})(["box-sizing:border-box;position:relative;flex-shrink:0;padding:12px 4px 4px;"]);const DraggingHandle=styled.div.withConfig({displayName:"DialogComponent__DraggingHandle",componentId:"ui__sc-1dlvioj-6"})(["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;"]);const DraggingIconContainer=styled.div.withConfig({displayName:"DialogComponent__DraggingIconContainer",componentId:"ui__sc-1dlvioj-7"})(["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 PositionedIconButton=styled(IconButton).withConfig({shouldForwardProp:o=>o!=='inset'}).withConfig({displayName:"DialogComponent__PositionedIconButton",componentId:"ui__sc-1dlvioj-8"})(["position:absolute;z-index:3;",""],(o=>o.inset));const PositionedProgressLine=styled(ProgressLine).withConfig({shouldForwardProp:o=>o!=='inset'}).withConfig({displayName:"DialogComponent__PositionedProgressLine",componentId:"ui__sc-1dlvioj-9"})(["position:absolute;",""],(o=>o.inset));const ProgressLineContainer=styled.div.withConfig({shouldForwardProp:shouldForwardProgressLineContainerProp}).withConfig({displayName:"DialogComponent__ProgressLineContainer",componentId:"ui__sc-1dlvioj-10"})(["position:absolute;"," ",""],(o=>o.inset),responsiveSize);const Placeholder=styled.svg.withConfig({shouldForwardProp:o=>!['aspectRatio','orientation'].includes(o)}).attrs((o=>({xmlns:'http://www.w3.org/2000/svg',viewBox:{'1:1':'0 0 1 1','3:1':'0 0 3 1','4:5':'0 0 4 5','5:2':'0 0 5 2','5:7':'0 0 5 7'}[o.aspectRatio],width:o.orientation==='portrait'?'100%':void 0,height:o.orientation==='landscape'?'100%':void 0}))).withConfig({displayName:"DialogComponent__Placeholder",componentId:"ui__sc-1dlvioj-11"})(["display:block;"]);const MediaPortrait=styled.div.withConfig({displayName:"DialogComponent__MediaPortrait",componentId:"ui__sc-1dlvioj-12"})(["box-sizing:border-box;position:relative;margin:-1px -1px 0;"]);const MediaLandscape=styled.div.withConfig({shouldForwardProp:o=>o!=='right'}).withConfig({displayName:"DialogComponent__MediaLandscape",componentId:"ui__sc-1dlvioj-13"})(["box-sizing:border-box;position:relative;height:100%;overflow:hidden;",""],(o=>o.right?"\n border-top-right-radius: inherit;\n border-bottom-right-radius: inherit;":"\n border-top-left-radius: inherit;\n border-bottom-left-radius: inherit;"));const MediaSkeleton=styled(Skeleton).withConfig({displayName:"DialogComponent__MediaSkeleton",componentId:"ui__sc-1dlvioj-14"})(["position:absolute;top:0;left:0;"]);const Media=styled.div.withConfig({shouldForwardProp:o=>o!=='src'}).withConfig({displayName:"DialogComponent__Media",componentId:"ui__sc-1dlvioj-15"})(["",""],(o=>`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n background-image: url(${o.src});\n background-size: contain;\n background-repeat: no-repeat;\n background-position: 50%;\n `));const MediaPortraitContainer=styled.div.withConfig({shouldForwardProp:o=>!['top','bottom'].includes(o)}).withConfig({displayName:"DialogComponent__MediaPortraitContainer",componentId:"ui__sc-1dlvioj-16"})(["box-sizing:border-box;overflow:hidden;"," ",""],(o=>o.top&&"\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n "),(o=>o.bottom&&"\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n "));export{Container,Controls,DraggingHandle,DraggingIconContainer,Fading,FancyBackground,Media,MediaLandscape,MediaPortrait,MediaPortraitContainer,MediaSkeleton,Placeholder,PositionedIconButton,PositionedProgressLine,ProgressLineContainer,Root,ScrollableContent};
|
|
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 { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { IconButton } from 'components/IconButton'\nimport { Skeleton } from 'components/Skeleton'\nimport maskRectangle from './images/mask-rectangle.svg'\nimport maskSlope from './images/mask-slope.svg'\nimport type {\n StyledDialogComponentProps,\n DialogComponentPalette,\n StyledDialogContainerProps,\n StyledDialogFadingProps,\n StyledPlaceholderProps,\n StyledDialogMediaProps,\n StyledMediaContainerProps,\n StyledPositionedIconButtonProps,\n} from './types'\n\nconst shouldForwardDialogComponentProp = createShouldForwardProp(\n (propKey) => !['dragging', 'fancy', 'zIndex'].includes(propKey)\n)\n\nconst shouldForwardDialogContainerProp = createShouldForwardProp((propKey) => !['fancy'].includes(propKey))\n\nexport const Fading = styled.div.withConfig<StyledDialogFadingProps>({\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 width: 100%;\n bottom: 100%;\n left: 0;\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 width: 100%;\n top: 100%;\n left: 0;\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: 100% 32px, cover;\n mask-position: 0 56px, 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 position: relative;\n display: flex;\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`\n\nexport const Container = styled.div.withConfig<StyledDialogContainerProps>({\n shouldForwardProp: shouldForwardDialogContainerProp,\n})`\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n\n ${responsiveSize}\n`\n\nexport const ScrollableContent = styled.div`\n box-sizing: border-box;\n position: relative;\n overflow: auto;\n overscroll-behavior: contain;\n padding-top: 1px;\n padding-bottom: 1px;\n min-height: 85px;\n flex-grow: 1;\n\n ${focus}\n`\n\nexport const Controls = styled.div`\n box-sizing: border-box;\n position: relative;\n flex-shrink: 0;\n padding-top: 12px;\n`\n\nexport const DraggingHandle = styled.div`\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\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 PositionedIconButton = styled(IconButton).withConfig<StyledPositionedIconButtonProps>({\n shouldForwardProp: (propKey) => propKey !== 'inset',\n})`\n position: absolute;\n z-index: 3;\n ${(props) => props.inset}\n`\n\nexport const Placeholder = styled.svg\n .withConfig<StyledPlaceholderProps>({\n shouldForwardProp: (propKey) => !['aspectRatio', 'orientation'].includes(propKey),\n })\n .attrs<StyledPlaceholderProps>((props) => ({\n xmlns: 'http://www.w3.org/2000/svg',\n viewBox: props.aspectRatio === '3:1' ? '0 0 3 1' : '0 0 5 7',\n width: props.orientation === 'portrait' ? '100%' : undefined,\n height: props.orientation === 'landscape' ? '100%' : undefined,\n }))`\n display: block;\n`\n\nexport const MediaPortrait = styled.div`\n box-sizing: border-box;\n position: relative;\n margin: -1px -1px 0;\n`\n\nexport const MediaLandscape = styled.div.withConfig<StyledMediaContainerProps>({\n shouldForwardProp: (propKey) => propKey !== 'right',\n})`\n box-sizing: border-box;\n position: relative;\n height: 100%;\n overflow: hidden;\n\n ${(props) =>\n props.right\n ? `\n border-top-right-radius: inherit;\n border-bottom-right-radius: inherit;`\n : `\n border-top-left-radius: inherit;\n border-bottom-left-radius: inherit;`}\n`\n\nexport const MediaSkeleton = styled(Skeleton)`\n position: absolute;\n top: 0;\n left: 0;\n`\n\nexport const Media = styled.div.withConfig<StyledDialogMediaProps>({\n shouldForwardProp: (propKey) => propKey !== 'src',\n})`\n ${(props) => `\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n background-image: url(${props.src});\n background-size: contain;\n background-repeat: no-repeat;\n background-position: 50%;\n `}\n`\n\nexport const MediaPortraitContainer = styled.div.withConfig<StyledMediaContainerProps>({\n shouldForwardProp: (propKey) => !['top', 'bottom'].includes(propKey),\n})`\n box-sizing: border-box;\n overflow: hidden;\n\n ${(props) =>\n props.top &&\n `\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n `}\n\n ${(props) =>\n props.bottom &&\n `\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n `}\n`\n"],"names":["shouldForwardDialogComponentProp","createShouldForwardProp","propKey","includes","shouldForwardDialogContainerProp","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","Container","ScrollableContent","focus","Controls","DraggingHandle","DraggingIconContainer","PositionedIconButton","IconButton","inset","Placeholder","svg","attrs","xmlns","viewBox","aspectRatio","width","orientation","undefined","height","MediaPortrait","MediaLandscape","right","MediaSkeleton","Skeleton","Media","src","MediaPortraitContainer","top","bottom"],"mappings":"iaAmBA,MAAMA,iCAAmCC,yBACtCC,IAAa,CAAC,WAAY,QAAS,UAAUC,SAASD,KAGzD,MAAME,iCAAmCH,yBAAyBC,IAAa,CAAC,SAASC,SAASD,KAE3F,MAAMG,OAASC,OAAOC,IAAIC,WAAoC,CACnEC,kBAAoBP,IAAa,CAAC,UAAW,SAASC,SAASD,KAC/DM,WAAA,CAAAE,YAAA,0BAAAC,YAAA,oBAFoBL,CAEpB,CAAA,+MAAA,KAeGM,GACDA,EAAMC,MACF,iWAWeD,EAAME,QAAU,EAAI,gCAGnC,8VAWeF,EAAME,QAAU,EAAI,kCAK9BC,gBAAkBT,OAAOC,IAAGC,WAAA,CAAAE,YAAA,mCAAAC,YAAA,oBAAVL,CAOXU,CAAAA,wFAAAA,SAAAA,kHAAAA,UAAmBC,eAOvC,MAAMC,iBACMC,GAAoC,gBACnCA,EAAQC,iCACGD,EAAQE,oDACCF,EAAQG,qBACnCjB,0BACSc,EAAQE,8BANjBH,eASIC,GAAoC,gBACjCA,EAAQC,eACfL,8CACoBI,EAAQE,gCAE5BhB,0BACSc,EAAQE,8BAKhB,MAAME,KAAOjB,OAAOC,IAAIC,WAAuC,CACpEC,kBAAmBT,mCACnBQ,WAAA,CAAAE,YAAA,wBAAAC,YAAA,oBAFkBL,CAElB,CAAA,0EAAA,IAAA,IAAA,IAAA,KAMGM,IACAA,EAAMY,MAAQN,eAAiBA,kBAAkB,CAChDE,MAAOR,EAAMa,MAAMC,OAAO,0BAC1BL,gBAAiBT,EAAMa,MAAMC,OAAO,qBACpCJ,Y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AA,+BAAAC,YAAA,oBATsBL,CAW1B,CAAA,yBAEY4C,cAAgB5C,OAAOC,IAAGC,WAAA,CAAAE,YAAA,iCAAAC,YAAA,qBAAVL,CAI5B,CAAA,gEAEM,MAAM6C,eAAiB7C,OAAOC,IAAIC,WAAsC,CAC7EC,kBAAoBP,GAAYA,IAAY,UAC5CM,WAAA,CAAAE,YAAA,kCAAAC,YAAA,qBAF4BL,CAE5B,CAAA,uEAAA,KAMGM,GACDA,EAAMwC,MACF,4FAGA,4FAKD,MAAMC,cAAgB/C,OAAOgD,UAAS9C,WAAA,CAAAE,YAAA,iCAAAC,YAAA,qBAAhBL,CAI5B,CAAA,oCAEM,MAAMiD,MAAQjD,OAAOC,IAAIC,WAAmC,CACjEC,kBAAoBP,GAAYA,IAAY,QAC5CM,WAAA,CAAAE,YAAA,yBAAAC,YAAA,qBAFmBL,CAEnB,CAAA,GAAA,KACGM,GAAU,mKAOeA,EAAM4C,uHAO7B,MAAMC,uBAAyBnD,OAAOC,IAAIC,WAAsC,CACrFC,kBAAoBP,IAAa,CAAC,MAAO,UAAUC,SAASD,KAC5DM,WAAA,CAAAE,YAAA,0CAAAC,YAAA,qBAFoCL,CAEpC,CAAA,yCAAA,IAAA,KAIGM,GACDA,EAAM8C,KACN,4FAKC9C,GACDA,EAAM+C,QACN"}
|
|
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 { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { IconButton } from 'components/IconButton'\nimport { Skeleton } from 'components/Skeleton'\nimport { ProgressLine } from 'components/ProgressLine'\nimport maskRectangle from './images/mask-rectangle.svg'\nimport maskSlope from './images/mask-slope.svg'\nimport type {\n StyledDialogComponentProps,\n DialogComponentPalette,\n StyledDialogContainerProps,\n StyledDialogFadingProps,\n StyledPlaceholderProps,\n StyledDialogMediaProps,\n StyledMediaContainerProps,\n StyledPositionedIconButtonProps,\n StyledPositionedProgressLineProps,\n StyledProgressLineContainerProps,\n} from './types'\n\nconst shouldForwardDialogComponentProp = createShouldForwardProp(\n (propKey) => !['dragging', 'fancy', 'zIndex'].includes(propKey)\n)\n\nconst shouldForwardDialogContainerProp = createShouldForwardProp((propKey) => !['fancy'].includes(propKey))\n\nconst shouldForwardProgressLineContainerProp = createShouldForwardProp((propKey) => !['inset'].includes(propKey))\n\nexport const Fading = styled.div.withConfig<StyledDialogFadingProps>({\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 width: 100%;\n bottom: 100%;\n left: 0;\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 width: 100%;\n top: 100%;\n left: 0;\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: 100% 32px, cover;\n mask-position: 0 56px, 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 position: relative;\n display: flex;\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`\n\nexport const Container = styled.div.withConfig<StyledDialogContainerProps>({\n shouldForwardProp: shouldForwardDialogContainerProp,\n})`\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex-grow: 1;\n\n ${responsiveSize}\n`\n\nexport const ScrollableContent = styled.div`\n box-sizing: border-box;\n position: relative;\n overflow: auto;\n overscroll-behavior: contain;\n padding: 4px;\n min-height: 85px;\n flex-grow: 1;\n\n ${focus}\n`\n\nexport const Controls = styled.div`\n box-sizing: border-box;\n position: relative;\n flex-shrink: 0;\n padding: 12px 4px 4px;\n`\n\nexport const DraggingHandle = styled.div`\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\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 PositionedIconButton = styled(IconButton).withConfig<StyledPositionedIconButtonProps>({\n shouldForwardProp: (propKey) => propKey !== 'inset',\n})`\n position: absolute;\n z-index: 3;\n ${(props) => props.inset}\n`\n\nexport const PositionedProgressLine = styled(ProgressLine).withConfig<StyledPositionedProgressLineProps>({\n shouldForwardProp: (propKey) => propKey !== 'inset',\n})`\n position: absolute;\n ${(props) => props.inset}\n`\n\nexport const ProgressLineContainer = styled.div.withConfig<StyledProgressLineContainerProps>({\n shouldForwardProp: shouldForwardProgressLineContainerProp,\n})`\n position: absolute;\n ${(props) => props.inset}\n\n ${responsiveSize}\n`\n\nexport const Placeholder = styled.svg\n .withConfig<StyledPlaceholderProps>({\n shouldForwardProp: (propKey) => !['aspectRatio', 'orientation'].includes(propKey),\n })\n .attrs<StyledPlaceholderProps>((props) => ({\n xmlns: 'http://www.w3.org/2000/svg',\n viewBox: {\n '1:1': '0 0 1 1',\n '3:1': '0 0 3 1',\n '4:5': '0 0 4 5',\n '5:2': '0 0 5 2',\n '5:7': '0 0 5 7',\n }[props.aspectRatio],\n width: props.orientation === 'portrait' ? '100%' : undefined,\n height: props.orientation === 'landscape' ? '100%' : undefined,\n }))`\n display: block;\n`\n\nexport const MediaPortrait = styled.div`\n box-sizing: border-box;\n position: relative;\n margin: -1px -1px 0;\n`\n\nexport const MediaLandscape = styled.div.withConfig<StyledMediaContainerProps>({\n shouldForwardProp: (propKey) => propKey !== 'right',\n})`\n box-sizing: border-box;\n position: relative;\n height: 100%;\n overflow: hidden;\n\n ${(props) =>\n props.right\n ? `\n border-top-right-radius: inherit;\n border-bottom-right-radius: inherit;`\n : `\n border-top-left-radius: inherit;\n border-bottom-left-radius: inherit;`}\n`\n\nexport const MediaSkeleton = styled(Skeleton)`\n position: absolute;\n top: 0;\n left: 0;\n`\n\nexport const Media = styled.div.withConfig<StyledDialogMediaProps>({\n shouldForwardProp: (propKey) => propKey !== 'src',\n})`\n ${(props) => `\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n background-image: url(${props.src});\n background-size: contain;\n background-repeat: no-repeat;\n background-position: 50%;\n `}\n`\n\nexport const MediaPortraitContainer = styled.div.withConfig<StyledMediaContainerProps>({\n shouldForwardProp: (propKey) => !['top', 'bottom'].includes(propKey),\n})`\n box-sizing: border-box;\n overflow: hidden;\n\n ${(props) =>\n props.top &&\n `\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n `}\n\n ${(props) =>\n props.bottom &&\n `\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n `}\n`\n"],"names":["shouldForwardDialogComponentProp","createShouldForwardProp","propKey","includes","shouldForwardDialogContainerProp","shouldForwardProgressLineContainerProp","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","Container","ScrollableContent","focus","Controls","DraggingHandle","DraggingIconContainer","PositionedIconButton","IconButton","inset","PositionedProgressLine","ProgressLine","ProgressLineContainer","Placeholder","svg","attrs","xmlns","viewBox","aspectRatio","width","orientation","undefined","height","MediaPortrait","MediaLandscape","right","MediaSkeleton","Skeleton","Media","src","MediaPortraitContainer","top","bottom"],"mappings":"4dAsBA,MAAMA,iCAAmCC,yBACtCC,IAAa,CAAC,WAAY,QAAS,UAAUC,SAASD,KAGzD,MAAME,iCAAmCH,yBAAyBC,IAAa,CAAC,SAASC,SAASD,KAElG,MAAMG,uCAAyCJ,yBAAyBC,IAAa,CAAC,SAASC,SAASD,KAEjG,MAAMI,OAASC,OAAOC,IAAIC,WAAoC,CACnEC,kBAAoBR,IAAa,CAAC,UAAW,SAASC,SAASD,KAC/DO,WAAA,CAAAE,YAAA,0BAAAC,YAAA,oBAFoBL,CAEpB,CAAA,+MAAA,KAeGM,GACDA,EAAMC,MACF,iWAWeD,EAAME,QAAU,EAAI,gCAGnC,8VAWeF,EAAME,QAAU,EAAI,kCAK9BC,gBAAkBT,O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KAMGM,GACDA,EAAM2C,MACF,4FAGA,4FAKD,MAAMC,cAAgBlD,OAAOmD,UAASjD,WAAA,CAAAE,YAAA,iCAAAC,YAAA,qBAAhBL,CAI5B,CAAA,oCAEM,MAAMoD,MAAQpD,OAAOC,IAAIC,WAAmC,CACjEC,kBAAoBR,GAAYA,IAAY,QAC5CO,WAAA,CAAAE,YAAA,yBAAAC,YAAA,qBAFmBL,CAEnB,CAAA,GAAA,KACGM,GAAU,mKAOeA,EAAM+C,uHAO7B,MAAMC,uBAAyBtD,OAAOC,IAAIC,WAAsC,CACrFC,kBAAoBR,IAAa,CAAC,MAAO,UAAUC,SAASD,KAC5DO,WAAA,CAAAE,YAAA,0CAAAC,YAAA,qBAFoCL,CAEpC,CAAA,yCAAA,IAAA,KAIGM,GACDA,EAAMiD,KACN,4FAKCjD,GACDA,EAAMkD,QACN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var ramda=require('ramda');var withMergedProps=require('../../hocs/withMergedProps.js');var jsxRuntime=require('react/jsx-runtime');var PopoverComponent=require('../PopoverComponent/PopoverComponent.js');var constants=require('../PopoverComponent/constants.js');var Tooltip=require('../Tooltip/Tooltip.js');const Popover=Object.assign(withMergedProps.withMergedProps(React.forwardRef(((o
|
|
1
|
+
'use strict';var React=require('react');var ramda=require('ramda');var withMergedProps=require('../../hocs/withMergedProps.js');var jsxRuntime=require('react/jsx-runtime');var PopoverComponent=require('../PopoverComponent/PopoverComponent.js');var constants=require('../PopoverComponent/constants.js');var Tooltip=require('../Tooltip/Tooltip.js');const Popover=Object.assign(withMergedProps.withMergedProps(React.forwardRef(((e,o)=>{const{size:t="s",styles:s={},sizeXXS:r,sizeXS:n,sizeS:i,sizeM:p,sizeL:a,sizeXL:c,sizes:P,sizeUnits:l,palette:m,showCloseButton:v,closeButtonProps:z,orientation:d,loading:u,badge:C,caption:g,captionProps:j,title:S,titleProps:h,content:w,contentProps:x,controlsDirection:M,media:X,footer:q,controls:f,...L}=e;return jsxRuntime.jsx(Tooltip.Tooltip,{...L,preset:"brand",ref:o,styles:ramda.mergeDeepLeft(s,{arrow:{spread:20,length:12}}),component:jsxRuntime.jsx(PopoverComponent.PopoverComponent,{size:t,sizeXXS:r,sizeXS:n,sizeS:i,sizeM:p,sizeL:a,sizeXL:c,sizes:P,sizeUnits:l,palette:m,showCloseButton:v,closeButtonProps:z,orientation:d,loading:u,badge:C,caption:g,captionProps:j,title:S,titleProps:h,content:w,contentProps:x,controlsDirection:M,media:X,footer:q,controls:f})})})),{displayName:"Popover",sizes:e=>e.orientation==='landscape'?constants.SIZES_LANDSCAPE:constants.SIZES}),{Component:PopoverComponent.PopoverComponent});exports.COMPONENT_NAME="Popover",exports.Popover=Popover;
|
|
2
2
|
//# sourceMappingURL=Popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent, SIZES_LANDSCAPE, SIZES } from 'components/PopoverComponent'\nimport type { PopoverProps } from './types'\n\nconst COMPONENT_NAME = 'Popover'\n\n/**\n *\n *
|
|
1
|
+
{"version":3,"file":"Popover.js","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent, SIZES_LANDSCAPE, SIZES } from 'components/PopoverComponent'\nimport type { PopoverProps } from './types'\n\nconst COMPONENT_NAME = 'Popover'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров в зависимости от ширины вьюпорта.\n *\n * Компонент основан на [\"react-floater\"](https://www.npmjs.com/package/react-floater).\n *\n * Получить доступ к компоненту, не подключенному к библиотеке, можно через `Popover.Component`.\n *\n * Полный интерфейс `Popover` можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Popover/types.ts), интерфейс `Popover.Component` [тут](https://github.com/foxford/ui/blob/master/src/components/PopoverComponent/types.ts).\n *\n */\nconst Popover: React.ForwardRefExoticComponent<PopoverProps> & { Component: typeof PopoverComponent } = Object.assign(\n withMergedProps<PopoverProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n styles = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n palette,\n showCloseButton,\n closeButtonProps,\n orientation,\n loading,\n badge,\n caption,\n captionProps,\n title,\n titleProps,\n content,\n contentProps,\n controlsDirection,\n media,\n footer,\n controls,\n ...restProps\n } = props\n\n return (\n <Tooltip\n {...restProps}\n preset='brand'\n ref={ref}\n styles={mergeDeepLeft(styles, {\n arrow: {\n spread: 20,\n length: 12,\n },\n })}\n component={\n <PopoverComponent\n size={size}\n sizeXXS={sizeXXS}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n sizes={sizes}\n sizeUnits={sizeUnits}\n palette={palette}\n showCloseButton={showCloseButton}\n closeButtonProps={closeButtonProps}\n orientation={orientation}\n loading={loading}\n badge={badge}\n caption={caption}\n captionProps={captionProps}\n title={title}\n titleProps={titleProps}\n content={content}\n contentProps={contentProps}\n controlsDirection={controlsDirection}\n media={media}\n footer={footer}\n controls={controls}\n />\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n return props.orientation === 'landscape' ? SIZES_LANDSCAPE : SIZES\n },\n }\n ),\n {\n Component: PopoverComponent,\n }\n)\n\nexport { Popover }\n\nexport { COMPONENT_NAME }\n"],"names":["Popover","Object","assign","withMergedProps","forwardRef","props","ref","size","styles","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","palette","showCloseButton","closeButtonProps","orientation","loading","badge","caption","captionProps","title","titleProps","content","contentProps","controlsDirection","media","footer","controls","restProps","_jsx","Tooltip","preset","mergeDeepLeft","arrow","spread","length","component","jsx","PopoverComponent","displayName","SIZES_LANDSCAPE","SIZES","Component"],"mappings":"2VAwBA,MAAMA,QAAkGC,OAAOC,OAC7GC,gBAAAA,gBACEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,CAAE,EAAAC,QACXA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,QACTA,EAAOC,gBACPA,EAAeC,iBACfA,EAAgBC,YAChBA,EAAWC,QACXA,EAAOC,MACPA,EAAKC,QACLA,EAAOC,aACPA,EAAYC,MACZA,EAAKC,WACLA,EAAUC,QACVA,EAAOC,aACPA,EAAYC,kBACZA,EAAiBC,MACjBA,EAAKC,OACLA,EAAMC,SACNA,KACGC,GACD5B,EAEJ,OACE6B,WAAAA,IAACC,QAAAA,QAAO,IACFF,EACJG,OAAO,QACP9B,IAAKA,EACLE,OAAQ6B,MAAaA,cAAC7B,EAAQ,CAC5B8B,MAAO,CACLC,OAAQ,GACRC,OAAQ,MAGZC,UACEP,WAAAQ,IAACC,kCAAgB,CACfpC,KAAMA,EACNE,QAASA,EACTC,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,EACRC,MAAOA,EACPC,UAAWA,EACXC,QAASA,EACTC,gBAAiBA,EACjBC,iBAAkBA,EAClBC,YAAaA,EACbC,QAASA,EACTC,MAAOA,EACPC,QAASA,EACTC,aAAcA,EACdC,MAAOA,EACPC,WAAYA,EACZC,QAASA,EACTC,aAAcA,EACdC,kBAAmBA,EACnBC,MAAOA,EACPC,OAAQA,EACRC,SAAUA,KAGd,IAGN,CACEY,YA9FiB,UA+FjB7B,MAAQV,GACCA,EAAMe,cAAgB,YAAcyB,UAAAA,gBAAkBC,UAAAA,QAInE,CACEC,UAAWJ,iBAAAA,0CArGQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef}from'react';import{mergeDeepLeft}from'ramda';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{jsx}from'react/jsx-runtime';import{PopoverComponent}from'../PopoverComponent/PopoverComponent.mjs';import{SIZES_LANDSCAPE,SIZES}from'../PopoverComponent/constants.mjs';import{Tooltip}from'../Tooltip/Tooltip.mjs';const COMPONENT_NAME='Popover';const Popover=Object.assign(withMergedProps(forwardRef(((o,e)=>{const{size:t="s",styles:
|
|
1
|
+
import{forwardRef}from'react';import{mergeDeepLeft}from'ramda';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{jsx}from'react/jsx-runtime';import{PopoverComponent}from'../PopoverComponent/PopoverComponent.mjs';import{SIZES_LANDSCAPE,SIZES}from'../PopoverComponent/constants.mjs';import{Tooltip}from'../Tooltip/Tooltip.mjs';const COMPONENT_NAME='Popover';const Popover=Object.assign(withMergedProps(forwardRef(((o,e)=>{const{size:t="s",styles:s={},sizeXXS:r,sizeXS:i,sizeS:n,sizeM:p,sizeL:m,sizeXL:a,sizes:c,sizeUnits:l,palette:P,showCloseButton:z,closeButtonProps:d,orientation:f,loading:S,badge:C,caption:g,captionProps:v,title:E,titleProps:j,content:M,contentProps:N,controlsDirection:w,media:L,footer:X,controls:h,...u}=o;return jsx(Tooltip,{...u,preset:"brand",ref:e,styles:mergeDeepLeft(s,{arrow:{spread:20,length:12}}),component:jsx(PopoverComponent,{size:t,sizeXXS:r,sizeXS:i,sizeS:n,sizeM:p,sizeL:m,sizeXL:a,sizes:c,sizeUnits:l,palette:P,showCloseButton:z,closeButtonProps:d,orientation:f,loading:S,badge:C,caption:g,captionProps:v,title:E,titleProps:j,content:M,contentProps:N,controlsDirection:w,media:L,footer:X,controls:h})})})),{displayName:"Popover",sizes:o=>o.orientation==='landscape'?SIZES_LANDSCAPE:SIZES}),{Component:PopoverComponent});export{COMPONENT_NAME,Popover};
|
|
2
2
|
//# sourceMappingURL=Popover.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.mjs","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent, SIZES_LANDSCAPE, SIZES } from 'components/PopoverComponent'\nimport type { PopoverProps } from './types'\n\nconst COMPONENT_NAME = 'Popover'\n\n/**\n *\n *
|
|
1
|
+
{"version":3,"file":"Popover.mjs","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent, SIZES_LANDSCAPE, SIZES } from 'components/PopoverComponent'\nimport type { PopoverProps } from './types'\n\nconst COMPONENT_NAME = 'Popover'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров в зависимости от ширины вьюпорта.\n *\n * Компонент основан на [\"react-floater\"](https://www.npmjs.com/package/react-floater).\n *\n * Получить доступ к компоненту, не подключенному к библиотеке, можно через `Popover.Component`.\n *\n * Полный интерфейс `Popover` можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Popover/types.ts), интерфейс `Popover.Component` [тут](https://github.com/foxford/ui/blob/master/src/components/PopoverComponent/types.ts).\n *\n */\nconst Popover: React.ForwardRefExoticComponent<PopoverProps> & { Component: typeof PopoverComponent } = Object.assign(\n withMergedProps<PopoverProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n styles = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n palette,\n showCloseButton,\n closeButtonProps,\n orientation,\n loading,\n badge,\n caption,\n captionProps,\n title,\n titleProps,\n content,\n contentProps,\n controlsDirection,\n media,\n footer,\n controls,\n ...restProps\n } = props\n\n return (\n <Tooltip\n {...restProps}\n preset='brand'\n ref={ref}\n styles={mergeDeepLeft(styles, {\n arrow: {\n spread: 20,\n length: 12,\n },\n })}\n component={\n <PopoverComponent\n size={size}\n sizeXXS={sizeXXS}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n sizes={sizes}\n sizeUnits={sizeUnits}\n palette={palette}\n showCloseButton={showCloseButton}\n closeButtonProps={closeButtonProps}\n orientation={orientation}\n loading={loading}\n badge={badge}\n caption={caption}\n captionProps={captionProps}\n title={title}\n titleProps={titleProps}\n content={content}\n contentProps={contentProps}\n controlsDirection={controlsDirection}\n media={media}\n footer={footer}\n controls={controls}\n />\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n return props.orientation === 'landscape' ? SIZES_LANDSCAPE : SIZES\n },\n }\n ),\n {\n Component: PopoverComponent,\n }\n)\n\nexport { Popover }\n\nexport { COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","Popover","Object","assign","withMergedProps","forwardRef","props","ref","size","styles","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","palette","showCloseButton","closeButtonProps","orientation","loading","badge","caption","captionProps","title","titleProps","content","contentProps","controlsDirection","media","footer","controls","restProps","_jsx","Tooltip","preset","mergeDeepLeft","arrow","spread","length","component","PopoverComponent","displayName","SIZES_LANDSCAPE","SIZES","Component"],"mappings":"sVAOMA,MAAAA,eAAiB,UAiBvB,MAAMC,QAAkGC,OAAOC,OAC7GC,gBACEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,CAAE,EAAAC,QACXA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,QACTA,EAAOC,gBACPA,EAAeC,iBACfA,EAAgBC,YAChBA,EAAWC,QACXA,EAAOC,MACPA,EAAKC,QACLA,EAAOC,aACPA,EAAYC,MACZA,EAAKC,WACLA,EAAUC,QACVA,EAAOC,aACPA,EAAYC,kBACZA,EAAiBC,MACjBA,EAAKC,OACLA,EAAMC,SACNA,KACGC,GACD5B,EAEJ,OACE6B,IAACC,QAAO,IACFF,EACJG,OAAO,QACP9B,IAAKA,EACLE,OAAQ6B,cAAc7B,EAAQ,CAC5B8B,MAAO,CACLC,OAAQ,GACRC,OAAQ,MAGZC,UACEP,IAACQ,iBAAgB,CACfnC,KAAMA,EACNE,QAASA,EACTC,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,EACRC,MAAOA,EACPC,UAAWA,EACXC,QAASA,EACTC,gBAAiBA,EACjBC,iBAAkBA,EAClBC,YAAaA,EACbC,QAASA,EACTC,MAAOA,EACPC,QAASA,EACTC,aAAcA,EACdC,MAAOA,EACPC,WAAYA,EACZC,QAASA,EACTC,aAAcA,EACdC,kBAAmBA,EACnBC,MAAOA,EACPC,OAAQA,EACRC,SAAUA,KAGd,IAGN,CACEW,YA9FiB,UA+FjB5B,MAAQV,GACCA,EAAMe,cAAgB,YAAcwB,gBAAkBC,QAInE,CACEC,UAAWJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var constants=require('./constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var
|
|
1
|
+
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var constants=require('./constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Skeleton=require('../Skeleton/Skeleton.js');var Badge=require('../Badge/Badge.js');var Text=require('../Text/Text.js');var Button=require('../Button/Button.js');const PopoverComponent=withMergedProps.withMergedProps(React.forwardRef(((e,t)=>{const{size:s="s",orientation:n="portrait",controlsDirection:i="row",badge:o={},captionProps:r={},titleProps:a={},contentProps:x={},closeButtonProps:c={},media:l={},controls:j={},sizeXXS:u,sizeXS:d,sizeS:m,sizeM:p,sizeL:R,sizeXL:S,loading:h,caption:g,title:y,content:P,closeFn:T,palette:B,footer:k,showCloseButton:b,...z}=e;const E={size:s,sizeXXS:u,sizeXS:d,sizeS:m,sizeM:p,sizeL:R,sizeXL:S};const{badgeProps:C={}}=o;const{imgProps:v={},videoProps:I={}}=l;const{text:M,buttonProps:w={}}=j.secondary??{};const{text:N,buttonProps:L={}}=j.primary??{};return jsxRuntime.jsxs(style.Root,{...z,...E,palette:B,controlsDirection:i,ref:t,children:[b&&jsxRuntime.jsx(style.CloseButton,{size:"l",icon:"close",...c,onClick:e=>{typeof T=='function'&&T(),typeof c.onClick=='function'&&c.onClick(e)}}),n==='landscape'&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[h&&jsxRuntime.jsx(style.MediaLandscape,{children:jsxRuntime.jsx(style.Media,{aspectRatio:"1:1",children:jsxRuntime.jsx(Skeleton.Skeleton,{})})}),!h&&(v.src||I.src)&&jsxRuntime.jsx(style.MediaLandscape,{children:jsxRuntime.jsx(style.Media,{aspectRatio:"1:1",children:v.src?jsxRuntime.jsx("img",{alt:"",...v}):jsxRuntime.jsx(style.Video,{controls:!0,controlsList:"nofullscreen",disablePictureInPicture:!0,...I})})})]}),jsxRuntime.jsxs(style.Container,{children:[jsxRuntime.jsxs(style.Content,{children:[(o.text||g||h||b)&&jsxRuntime.jsx(style.Header,{children:h?jsxRuntime.jsx(Skeleton.Skeleton,{width:"20%",children:jsxRuntime.jsx(Badge.Badge,{...E,resetDefaultMargin:!0,...C})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o.text&&jsxRuntime.jsx(Badge.Badge,{...E,borderRadius:8,marginRight:12,resetDefaultMargin:!0,...C,children:o.text}),g&&jsxRuntime.jsx(Text.Text,{as:"span",appearance:"caption",color:"content-onmain-tertiary",weight:700,sizes:constants.SIZES_CAPTION,...E,...r,children:g})]})}),n==='portrait'&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[h&&jsxRuntime.jsx(style.Media,{aspectRatio:"16:9",children:jsxRuntime.jsx(Skeleton.Skeleton,{})}),!h&&(v.src||I.src)&&jsxRuntime.jsx(style.Media,{aspectRatio:"16:9",children:v.src?jsxRuntime.jsx("img",{alt:"",...v}):jsxRuntime.jsx(style.Video,{controls:!0,controlsList:"nofullscreen",disablePictureInPicture:!0,...I})})]}),(y||P||h)&&jsxRuntime.jsx("div",{children:jsxRuntime.jsxs(jsxRuntime.Fragment,h?{children:[jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:4,children:jsxRuntime.jsx(Text.Text,{appearance:"subheading",marginBottom:"0.4em",sizes:constants.SIZES_TITLE,...E,...a})}),jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:4,width:"70%",children:jsxRuntime.jsx(Text.Text,{appearance:"body",marginBottom:"0.4em",sizes:constants.SIZES_CONTENT,...E,...x})}),jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:4,width:"50%",children:jsxRuntime.jsx(Text.Text,{appearance:"body",sizes:constants.SIZES_CONTENT,...E,...x})})]}:{children:[y&&jsxRuntime.jsx(Text.Text,{as:"h2",appearance:"subheading",color:"inherit",marginBottom:P?'0.4em':void 0,sizes:constants.SIZES_TITLE,...E,...a,children:y}),P&&jsxRuntime.jsx(Text.Text,{as:"p",appearance:"body",color:"inherit",sizes:constants.SIZES_CONTENT,...E,...x,children:P})]})})]}),k&&jsxRuntime.jsx(style.Footer,{children:h?jsxRuntime.jsx(Skeleton.Skeleton,{width:"100%",children:jsxRuntime.jsx(Button.Button,{preset:"brand",...E})}):k(E)}),!k&&(M||N)&&jsxRuntime.jsx(style.Controls,{children:h?jsxRuntime.jsx(Skeleton.Skeleton,{width:"100%",children:jsxRuntime.jsx(Button.Button,{preset:"brand",...E})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[M&&jsxRuntime.jsx(Button.Button,{preset:"brand",black:!0,outline:!0,type:"button",marginRight:i==='row'?6:void 0,marginBottom:i==='column'?6:void 0,...E,...w,children:M}),N&&jsxRuntime.jsx(Button.Button,{preset:"brand",black:!0,type:"button",...E,...L,children:N})]})})]})]})})),{displayName:"PopoverComponent",sizes:e=>e.orientation==='landscape'?constants.SIZES_LANDSCAPE:constants.SIZES});exports.SIZES=constants.SIZES,exports.SIZES_LANDSCAPE=constants.SIZES_LANDSCAPE,exports.COMPONENT_NAME="PopoverComponent",exports.PopoverComponent=PopoverComponent;
|
|
2
2
|
//# sourceMappingURL=PopoverComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverComponent.js","sources":["../../../../src/components/PopoverComponent/PopoverComponent.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Badge } from 'components/Badge'\nimport { Text } from 'components/Text'\nimport { Button } from 'components/Button'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport { SIZES, SIZES_LANDSCAPE } from './constants'\nimport * as Styled from './style'\nimport type { PopoverComponentProps } from './types'\n\nconst COMPONENT_NAME = 'PopoverComponent'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [PopoverComponentProps](https://github.com/foxford/ui/blob/master/src/components/PopoverComponent/types.ts)\n *\n */\nconst PopoverComponent: React.ForwardRefExoticComponent<PopoverComponentProps> = withMergedProps<\n PopoverComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n orientation = 'portrait',\n controlsDirection = 'row',\n badge = {},\n captionProps = {},\n titleProps = {},\n contentProps = {},\n closeButtonProps = {},\n media = {},\n controls = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n loading,\n caption,\n title,\n content,\n closeFn,\n palette,\n showCloseButton,\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 { badgeProps = {} } = badge\n\n const { imgProps = {}, videoProps = {} } = media\n\n const { text: secondaryButtonText, buttonProps: secondaryButtonProps = {} } = controls.secondary ?? {}\n\n const { text: primaryButtonText, buttonProps: primaryButtonProps = {} } = controls.primary ?? {}\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n palette={palette}\n orientation={orientation}\n controlsDirection={controlsDirection}\n ref={ref}\n >\n {showCloseButton && (\n <Styled.CloseButton\n {...closeButtonProps}\n onClick={(evt) => {\n if (typeof closeFn === 'function') closeFn()\n if (typeof closeButtonProps.onClick === 'function') closeButtonProps.onClick(evt)\n }}\n palette={palette}\n type='button'\n >\n <Icon as='span' name='close' size={24} />\n </Styled.CloseButton>\n )}\n {orientation === 'landscape' && (\n <>\n {loading && (\n <Styled.MediaLandscape>\n <Styled.Media aspectRatio='1:1'>\n <Skeleton />\n </Styled.Media>\n </Styled.MediaLandscape>\n )}\n {!loading && (imgProps.src || videoProps.src) && (\n <Styled.MediaLandscape>\n <Styled.Media aspectRatio='1:1'>\n {imgProps.src ? (\n <img alt='' {...imgProps} />\n ) : (\n <Styled.Video controls controlsList='nofullscreen' disablePictureInPicture {...videoProps} />\n )}\n </Styled.Media>\n </Styled.MediaLandscape>\n )}\n </>\n )}\n <Styled.Container>\n <Styled.Content>\n {(badge.text || caption || loading || showCloseButton) && (\n <Styled.Header>\n {loading ? (\n <Skeleton width='20%'>\n <Badge {...sizeProps} resetDefaultMargin {...badgeProps} />\n </Skeleton>\n ) : (\n <>\n {badge.text && (\n <Badge {...sizeProps} borderRadius={8} marginRight={12} resetDefaultMargin {...badgeProps}>\n {badge.text}\n </Badge>\n )}\n {caption && (\n <Text\n as='span'\n appearance='caption'\n size={0.9}\n sizeUnits='em'\n color='content-onmain-tertiary'\n weight={700}\n {...captionProps}\n >\n {caption}\n </Text>\n )}\n </>\n )}\n </Styled.Header>\n )}\n {orientation === 'portrait' && (\n <>\n {loading && (\n <Styled.Media aspectRatio='16:9'>\n <Skeleton />\n </Styled.Media>\n )}\n {!loading && (imgProps.src || videoProps.src) && (\n <Styled.Media aspectRatio='16:9'>\n {imgProps.src ? (\n <img alt='' {...imgProps} />\n ) : (\n <Styled.Video controls controlsList='nofullscreen' disablePictureInPicture {...videoProps} />\n )}\n </Styled.Media>\n )}\n </>\n )}\n {(title || content || loading) && (\n <div>\n {loading ? (\n <>\n <Skeleton borderRadius={4} marginBottom='0.6em'>\n <Text appearance='subheading' size={1.4} sizeUnits='em' {...titleProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='70%' marginBottom='0.4em'>\n <Text appearance='body' size='inherit' {...contentProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='50%'>\n <Text appearance='body' size='inherit' {...contentProps} />\n </Skeleton>\n </>\n ) : (\n <>\n {title && (\n <Text\n as='h2'\n appearance='subheading'\n size={1.4}\n color='inherit'\n marginBottom={content ? '0.4em' : undefined}\n sizeUnits='em'\n {...titleProps}\n >\n {title}\n </Text>\n )}\n {content && (\n <Text as='p' appearance='body' size='inherit' color='inherit' {...contentProps}>\n {content}\n </Text>\n )}\n </>\n )}\n </div>\n )}\n </Styled.Content>\n {(secondaryButtonText || primaryButtonText || loading) && (\n <Styled.Footer>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : (\n <>\n {secondaryButtonText && (\n <Button\n preset='brand'\n black\n outline\n type='button'\n marginRight={controlsDirection === 'row' ? 6 : undefined}\n marginBottom={controlsDirection === 'column' ? 6 : undefined}\n {...sizeProps}\n {...secondaryButtonProps}\n >\n {secondaryButtonText}\n </Button>\n )}\n {primaryButtonText && (\n <Button preset='brand' black type='button' {...sizeProps} {...primaryButtonProps}>\n {primaryButtonText}\n </Button>\n )}\n </>\n )}\n </Styled.Footer>\n )}\n </Styled.Container>\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n return props.orientation === 'landscape' ? SIZES_LANDSCAPE : SIZES\n },\n }\n)\n\nexport { PopoverComponent }\n\nexport { COMPONENT_NAME, SIZES_LANDSCAPE, SIZES }\n"],"names":["PopoverComponent","withMergedProps","forwardRef","props","ref","size","orientation","controlsDirection","badge","captionProps","titleProps","contentProps","closeButtonProps","media","controls","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","loading","caption","title","content","closeFn","palette","showCloseButton","restProps","sizeProps","badgeProps","imgProps","videoProps","text","secondaryButtonText","buttonProps","secondaryButtonProps","secondary","primaryButtonText","primaryButtonProps","primary","_jsxs","Styled","children","_jsx","jsx","onClick","evt","type","Icon","as","name","_Fragment","aspectRatio","Skeleton","src","alt","controlsList","disablePictureInPicture","jsxs","width","Badge","resetDefaultMargin","borderRadius","marginRight","Text","appearance","sizeUnits","color","weight","marginBottom","undefined","Button","preset","black","outline","displayName","sizes","SIZES_LANDSCAPE","SIZES"],"mappings":"kaAwBMA,MAAAA,iBAA2EC,gBAAAA,gBAI/EC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,YACVA,EAAc,WAAUC,kBACxBA,EAAoB,MAAKC,MACzBA,EAAQ,CAAE,EAAAC,aACVA,EAAe,CAAE,EAAAC,WACjBA,EAAa,CAAE,EAAAC,aACfA,EAAe,CAAE,EAAAC,iBACjBA,EAAmB,CAAE,EAAAC,MACrBA,EAAQ,CAAE,EAAAC,SACVA,EAAW,CAAE,EAAAC,QACbA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,QACNA,EAAOC,QACPA,EAAOC,MACP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aAAa,QAAO3B,SACzDC,WAAAC,IAACoB,UAAI,CAACC,WAAW,OAAO7D,KAAK,aAAcM,MAE7CiC,WAAAC,IAACS,kBAAQ,CAACS,aAAc,EAAGH,MAAM,MAAKjB,SACpCC,WAAAC,IAACoB,UAAI,CAACC,WAAW,OAAO7D,KAAK,aAAcM,QAI/C,CAAAgC,SACGpB,CAAAA,GACCqB,WAAAC,IAACoB,UAAI,CACHf,GAAG,KACHgB,WAAW,aACX7D,KAAM,IACN+D,MAAM,UACNE,aAAc9C,EAAU,aAAU+C,EAClCJ,UAAU,QACNzD,EAAUiC,SAEbpB,IAGJC,GACCoB,WAAAC,IAACoB,UAAI,CAACf,GAAG,IAAIgB,WAAW,OAAO7D,KAAK,UAAU+D,MAAM,aAAczD,EAAYgC,SAC3EnB,aAQbU,GAAuBI,GAAqBjB,IAC5CuB,WAAAA,IAACF,MAAAA,OAAa,CAAAC,SACXtB,EACCuB,WAAAC,IAACS,kBAAQ,CAACM,MAAM,OAAMjB,SACpBC,WAAAC,IAAC2B,cAAM,CAACC,OAAO,WAAY5C,MAG7BY,WAAAkB,KAAAP,oBAAA,CAAAT,SACGT,CAAAA,GACCU,WAAAC,IAAC2B,cAAM,CACLC,OAAO,QACPC,OAAK,EACLC,SAAO,EACP3B,KAAK,SACLgB,YAAazD,IAAsB,MAAQ,OAAIgE,EAC/CD,aAAc/D,IAAsB,SAAW,OAAIgE,KAC/C1C,KACAO,EAAoBO,SAEvBT,IAGJI,GACCM,WAAAC,IAAC2B,cAAM,CAACC,OAAO,QAAQC,OAAK,EAAC1B,KAAK,YAAanB,KAAeU,EAAkBI,SAC7EL,cAQH,IAGlB,CACEsC,YAxOmB,mBAyOnBC,MAAQ1E,GACCA,EAAMG,cAAgB,YAAcwE,UAAAA,gBAAkBC,UAAAA,+GA1O5C"}
|
|
1
|
+
{"version":3,"file":"PopoverComponent.js","sources":["../../../../src/components/PopoverComponent/PopoverComponent.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Badge } from 'components/Badge'\nimport { Text } from 'components/Text'\nimport { Button } from 'components/Button'\nimport { Skeleton } from 'components/Skeleton'\nimport { SIZES, SIZES_LANDSCAPE, SIZES_CAPTION, SIZES_TITLE, SIZES_CONTENT } from './constants'\nimport * as Styled from './style'\nimport type { PopoverComponentProps } from './types'\n\nconst COMPONENT_NAME = 'PopoverComponent'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс `PopoverComponent` можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/PopoverComponent/types.ts).\n */\nconst PopoverComponent: React.ForwardRefExoticComponent<PopoverComponentProps> = withMergedProps<\n PopoverComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n orientation = 'portrait',\n controlsDirection = 'row',\n badge = {},\n captionProps = {},\n titleProps = {},\n contentProps = {},\n closeButtonProps = {},\n media = {},\n controls = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n loading,\n caption,\n title,\n content,\n closeFn,\n palette,\n footer,\n showCloseButton,\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 { badgeProps = {} } = badge\n\n const { imgProps = {}, videoProps = {} } = media\n\n const { text: secondaryButtonText, buttonProps: secondaryButtonProps = {} } = controls.secondary ?? {}\n\n const { text: primaryButtonText, buttonProps: primaryButtonProps = {} } = controls.primary ?? {}\n\n return (\n <Styled.Root {...restProps} {...sizeProps} palette={palette} controlsDirection={controlsDirection} ref={ref}>\n {showCloseButton && (\n <Styled.CloseButton\n size='l'\n icon='close'\n {...closeButtonProps}\n onClick={(evt) => {\n if (typeof closeFn === 'function') closeFn()\n if (typeof closeButtonProps.onClick === 'function') closeButtonProps.onClick(evt)\n }}\n />\n )}\n {orientation === 'landscape' && (\n <>\n {loading && (\n <Styled.MediaLandscape>\n <Styled.Media aspectRatio='1:1'>\n <Skeleton />\n </Styled.Media>\n </Styled.MediaLandscape>\n )}\n {!loading && (imgProps.src || videoProps.src) && (\n <Styled.MediaLandscape>\n <Styled.Media aspectRatio='1:1'>\n {imgProps.src ? (\n <img alt='' {...imgProps} />\n ) : (\n <Styled.Video controls controlsList='nofullscreen' disablePictureInPicture {...videoProps} />\n )}\n </Styled.Media>\n </Styled.MediaLandscape>\n )}\n </>\n )}\n <Styled.Container>\n <Styled.Content>\n {(badge.text || caption || loading || showCloseButton) && (\n <Styled.Header>\n {loading ? (\n <Skeleton width='20%'>\n <Badge {...sizeProps} resetDefaultMargin {...badgeProps} />\n </Skeleton>\n ) : (\n <>\n {badge.text && (\n <Badge {...sizeProps} borderRadius={8} marginRight={12} resetDefaultMargin {...badgeProps}>\n {badge.text}\n </Badge>\n )}\n {caption && (\n <Text\n as='span'\n appearance='caption'\n color='content-onmain-tertiary'\n weight={700}\n sizes={SIZES_CAPTION}\n {...sizeProps}\n {...captionProps}\n >\n {caption}\n </Text>\n )}\n </>\n )}\n </Styled.Header>\n )}\n {orientation === 'portrait' && (\n <>\n {loading && (\n <Styled.Media aspectRatio='16:9'>\n <Skeleton />\n </Styled.Media>\n )}\n {!loading && (imgProps.src || videoProps.src) && (\n <Styled.Media aspectRatio='16:9'>\n {imgProps.src ? (\n <img alt='' {...imgProps} />\n ) : (\n <Styled.Video controls controlsList='nofullscreen' disablePictureInPicture {...videoProps} />\n )}\n </Styled.Media>\n )}\n </>\n )}\n {(title || content || loading) && (\n <div>\n {loading ? (\n <>\n <Skeleton borderRadius={4}>\n <Text\n appearance='subheading'\n marginBottom='0.4em'\n sizes={SIZES_TITLE}\n {...sizeProps}\n {...titleProps}\n />\n </Skeleton>\n <Skeleton borderRadius={4} width='70%'>\n <Text\n appearance='body'\n marginBottom='0.4em'\n sizes={SIZES_CONTENT}\n {...sizeProps}\n {...contentProps}\n />\n </Skeleton>\n <Skeleton borderRadius={4} width='50%'>\n <Text appearance='body' sizes={SIZES_CONTENT} {...sizeProps} {...contentProps} />\n </Skeleton>\n </>\n ) : (\n <>\n {title && (\n <Text\n as='h2'\n appearance='subheading'\n color='inherit'\n marginBottom={content ? '0.4em' : undefined}\n sizes={SIZES_TITLE}\n {...sizeProps}\n {...titleProps}\n >\n {title}\n </Text>\n )}\n {content && (\n <Text\n as='p'\n appearance='body'\n color='inherit'\n sizes={SIZES_CONTENT}\n {...sizeProps}\n {...contentProps}\n >\n {content}\n </Text>\n )}\n </>\n )}\n </div>\n )}\n </Styled.Content>\n {footer && (\n <Styled.Footer>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : (\n footer(sizeProps)\n )}\n </Styled.Footer>\n )}\n {!footer && (secondaryButtonText || primaryButtonText) && (\n <Styled.Controls>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : (\n <>\n {secondaryButtonText && (\n <Button\n preset='brand'\n black\n outline\n type='button'\n marginRight={controlsDirection === 'row' ? 6 : undefined}\n marginBottom={controlsDirection === 'column' ? 6 : undefined}\n {...sizeProps}\n {...secondaryButtonProps}\n >\n {secondaryButtonText}\n </Button>\n )}\n {primaryButtonText && (\n <Button preset='brand' black type='button' {...sizeProps} {...primaryButtonProps}>\n {primaryButtonText}\n </Button>\n )}\n </>\n )}\n </Styled.Controls>\n )}\n </Styled.Container>\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n return props.orientation === 'landscape' ? SIZES_LANDSCAPE : SIZES\n },\n }\n)\n\nexport { PopoverComponent }\n\nexport { COMPONENT_NAME, SIZES_LANDSCAPE, SIZES }\n"],"names":["PopoverComponent","withMergedProps","forwardRef","props","ref","size","orientation","controlsDirection","badge","captionProps","titleProps","contentProps","closeButtonProps","media","controls","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","loading","caption","title","content","closeFn","palette","footer","showCloseButton","restProps","sizeProps","badgeProps","imgProps","videoProps","text","secondaryButtonText","buttonProps","secondaryButtonProps","secondary","primaryButtonText","primaryButtonProps","primary","_jsxs","Styled","children","_jsx","jsx","icon","onClick","evt","_Fragment","aspectRatio","Skeleton","src","alt","controlsList","disablePictureInPicture","jsxs","width","Badge","resetDefaultMargin","borderRadius","marginRight","Text","as","appearance","color","weight","sizes","SIZES_CAPTION","marginBottom","SIZES_TITLE","SIZES_CONTENT","undefined","Button","preset","black","outline","type","displayName","SIZES_LANDSCAPE","SIZES"],"mappings":"8XAsBMA,MAAAA,iBAA2EC,gBAAAA,gBAI/EC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,YACVA,EAAc,WAAUC,kBACxBA,EAAoB,MAAKC,MACzBA,EAAQ,CAAE,EAAAC,aACVA,EAAe,CAAE,EAAAC,WACjBA,EAAa,CAAE,EAAAC,aACfA,EAAe,CAAE,EAAAC,iBACjBA,EAAmB,CAAE,EAAAC,MACrBA,EAAQ,CAAE,EAAAC,SACVA,EAAW,CAAE,EAAAC,QACbA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,QACNA,EAAOC,QACPA,EAAOC,MACPA,EAAKC,QACLA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,OACPA,EAAMC,gBACNA,KACGC,GACD1B,EAEJ,MAAM2B,EAAY,CAChBzB,OACAU,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMW,WAAEA,EAAa,CAAC,GAAMvB,EAE5B,MAAMwB,SAAEA,EAAW,CAAE,EAAAC,WAAEA,EAAa,CAAC,GAAMpB,EAE3C,MAAQqB,KAAMC,EAAqBC,YAAaC,EAAuB,CAAC,GAAMvB,EAASwB,WAAa,GAEpG,MAAQJ,KAAMK,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AI,CACHC,GAAG,IACHC,WAAW,OACXC,MAAM,UACNE,MAAOI,UAAcA,iBACjB1C,KACAnB,EAAYiC,SAEfpB,YAQdG,GACCkB,WAAAC,IAACH,aAAa,CAAAC,SACXvB,EACCwB,WAAAC,IAACM,kBAAQ,CAACM,MAAM,OAAMd,SACpBC,WAAAC,IAAC4B,cAAM,CAACC,OAAO,WAAY7C,MAG7BH,EAAOG,MAIXH,IAAWQ,GAAuBI,IAClCM,WAAAC,IAACH,eAAe,CAAAC,SACbvB,EACCwB,WAAAC,IAACM,kBAAQ,CAACM,MAAM,OAAMd,SACpBC,WAAAC,IAAC4B,cAAM,CAACC,OAAO,WAAY7C,MAG7BY,WAAAe,KAAAP,oBAAA,CAAAN,SACGT,CAAAA,GACCU,WAAAC,IAAC4B,cAAM,CACLC,OAAO,QACPC,OAAK,EACLC,SAAO,EACPC,KAAK,SACLhB,YAAavD,IAAsB,MAAQ,OAAIkE,EAC/CH,aAAc/D,IAAsB,SAAW,OAAIkE,KAC/C3C,KACAO,EAAoBO,SAEvBT,IAGJI,GACCM,WAAAC,IAAC4B,cAAM,CAACC,OAAO,QAAQC,OAAK,EAACE,KAAK,YAAahD,KAAeU,EAAkBI,SAC7EL,cAQH,IAGlB,CACEwC,YA7PmB,mBA8PnBX,MAAQjE,GACCA,EAAMG,cAAgB,YAAc0E,UAAAA,gBAAkBC,UAAAA,+GA/P5C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{SIZES_LANDSCAPE,SIZES}from'./constants.mjs';import{Root,CloseButton,MediaLandscape,Media,Video,Container,Content,Header,Footer}from'./style.mjs';import{jsxs,jsx,Fragment}from'react/jsx-runtime';import{
|
|
1
|
+
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{SIZES_LANDSCAPE,SIZES,SIZES_CAPTION,SIZES_TITLE,SIZES_CONTENT}from'./constants.mjs';import{Root,CloseButton,MediaLandscape,Media,Video,Container,Content,Header,Footer,Controls}from'./style.mjs';import{jsxs,jsx,Fragment}from'react/jsx-runtime';import{Skeleton}from'../Skeleton/Skeleton.mjs';import{Badge}from'../Badge/Badge.mjs';import{Text}from'../Text/Text.mjs';import{Button}from'../Button/Button.mjs';const COMPONENT_NAME='PopoverComponent';const PopoverComponent=withMergedProps(forwardRef(((e,t)=>{const{size:o="s",orientation:s="portrait",controlsDirection:r="row",badge:n={},captionProps:i={},titleProps:a={},contentProps:c={},closeButtonProps:d={},media:l={},controls:p={},sizeXXS:x,sizeXS:m,sizeS:j,sizeM:S,sizeL:h,sizeXL:u,loading:g,caption:E,title:C,content:P,closeFn:T,palette:b,footer:f,showCloseButton:z,...I}=e;const B={size:o,sizeXXS:x,sizeXS:m,sizeS:j,sizeM:S,sizeL:h,sizeXL:u};const{badgeProps:N={}}=n;const{imgProps:M={},videoProps:k={}}=l;const{text:L,buttonProps:Z={}}=p.secondary??{};const{text:w,buttonProps:R={}}=p.primary??{};return jsxs(Root,{...I,...B,palette:b,controlsDirection:r,ref:t,children:[z&&jsx(CloseButton,{size:"l",icon:"close",...d,onClick:e=>{typeof T=='function'&&T(),typeof d.onClick=='function'&&d.onClick(e)}}),s==='landscape'&&jsxs(Fragment,{children:[g&&jsx(MediaLandscape,{children:jsx(Media,{aspectRatio:"1:1",children:jsx(Skeleton,{})})}),!g&&(M.src||k.src)&&jsx(MediaLandscape,{children:jsx(Media,{aspectRatio:"1:1",children:M.src?jsx("img",{alt:"",...M}):jsx(Video,{controls:!0,controlsList:"nofullscreen",disablePictureInPicture:!0,...k})})})]}),jsxs(Container,{children:[jsxs(Content,{children:[(n.text||E||g||z)&&jsx(Header,{children:g?jsx(Skeleton,{width:"20%",children:jsx(Badge,{...B,resetDefaultMargin:!0,...N})}):jsxs(Fragment,{children:[n.text&&jsx(Badge,{...B,borderRadius:8,marginRight:12,resetDefaultMargin:!0,...N,children:n.text}),E&&jsx(Text,{as:"span",appearance:"caption",color:"content-onmain-tertiary",weight:700,sizes:SIZES_CAPTION,...B,...i,children:E})]})}),s==='portrait'&&jsxs(Fragment,{children:[g&&jsx(Media,{aspectRatio:"16:9",children:jsx(Skeleton,{})}),!g&&(M.src||k.src)&&jsx(Media,{aspectRatio:"16:9",children:M.src?jsx("img",{alt:"",...M}):jsx(Video,{controls:!0,controlsList:"nofullscreen",disablePictureInPicture:!0,...k})})]}),(C||P||g)&&jsx("div",{children:jsxs(Fragment,g?{children:[jsx(Skeleton,{borderRadius:4,children:jsx(Text,{appearance:"subheading",marginBottom:"0.4em",sizes:SIZES_TITLE,...B,...a})}),jsx(Skeleton,{borderRadius:4,width:"70%",children:jsx(Text,{appearance:"body",marginBottom:"0.4em",sizes:SIZES_CONTENT,...B,...c})}),jsx(Skeleton,{borderRadius:4,width:"50%",children:jsx(Text,{appearance:"body",sizes:SIZES_CONTENT,...B,...c})})]}:{children:[C&&jsx(Text,{as:"h2",appearance:"subheading",color:"inherit",marginBottom:P?'0.4em':void 0,sizes:SIZES_TITLE,...B,...a,children:C}),P&&jsx(Text,{as:"p",appearance:"body",color:"inherit",sizes:SIZES_CONTENT,...B,...c,children:P})]})})]}),f&&jsx(Footer,{children:g?jsx(Skeleton,{width:"100%",children:jsx(Button,{preset:"brand",...B})}):f(B)}),!f&&(L||w)&&jsx(Controls,{children:g?jsx(Skeleton,{width:"100%",children:jsx(Button,{preset:"brand",...B})}):jsxs(Fragment,{children:[L&&jsx(Button,{preset:"brand",black:!0,outline:!0,type:"button",marginRight:r==='row'?6:void 0,marginBottom:r==='column'?6:void 0,...B,...Z,children:L}),w&&jsx(Button,{preset:"brand",black:!0,type:"button",...B,...R,children:w})]})})]})]})})),{displayName:"PopoverComponent",sizes:e=>e.orientation==='landscape'?SIZES_LANDSCAPE:SIZES});export{COMPONENT_NAME,PopoverComponent,SIZES,SIZES_LANDSCAPE};
|
|
2
2
|
//# sourceMappingURL=PopoverComponent.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverComponent.mjs","sources":["../../../../src/components/PopoverComponent/PopoverComponent.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Badge } from 'components/Badge'\nimport { Text } from 'components/Text'\nimport { Button } from 'components/Button'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport { SIZES, SIZES_LANDSCAPE } from './constants'\nimport * as Styled from './style'\nimport type { PopoverComponentProps } from './types'\n\nconst COMPONENT_NAME = 'PopoverComponent'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [PopoverComponentProps](https://github.com/foxford/ui/blob/master/src/components/PopoverComponent/types.ts)\n *\n */\nconst PopoverComponent: React.ForwardRefExoticComponent<PopoverComponentProps> = withMergedProps<\n PopoverComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n orientation = 'portrait',\n controlsDirection = 'row',\n badge = {},\n captionProps = {},\n titleProps = {},\n contentProps = {},\n closeButtonProps = {},\n media = {},\n controls = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n loading,\n caption,\n title,\n content,\n closeFn,\n palette,\n showCloseButton,\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 { badgeProps = {} } = badge\n\n const { imgProps = {}, videoProps = {} } = media\n\n const { text: secondaryButtonText, buttonProps: secondaryButtonProps = {} } = controls.secondary ?? {}\n\n const { text: primaryButtonText, buttonProps: primaryButtonProps = {} } = controls.primary ?? {}\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n palette={palette}\n orientation={orientation}\n controlsDirection={controlsDirection}\n ref={ref}\n >\n {showCloseButton && (\n <Styled.CloseButton\n {...closeButtonProps}\n onClick={(evt) => {\n if (typeof closeFn === 'function') closeFn()\n if (typeof closeButtonProps.onClick === 'function') closeButtonProps.onClick(evt)\n }}\n palette={palette}\n type='button'\n >\n <Icon as='span' name='close' size={24} />\n </Styled.CloseButton>\n )}\n {orientation === 'landscape' && (\n <>\n {loading && (\n <Styled.MediaLandscape>\n <Styled.Media aspectRatio='1:1'>\n <Skeleton />\n </Styled.Media>\n </Styled.MediaLandscape>\n )}\n {!loading && (imgProps.src || videoProps.src) && (\n <Styled.MediaLandscape>\n <Styled.Media aspectRatio='1:1'>\n {imgProps.src ? (\n <img alt='' {...imgProps} />\n ) : (\n <Styled.Video controls controlsList='nofullscreen' disablePictureInPicture {...videoProps} />\n )}\n </Styled.Media>\n </Styled.MediaLandscape>\n )}\n </>\n )}\n <Styled.Container>\n <Styled.Content>\n {(badge.text || caption || loading || showCloseButton) && (\n <Styled.Header>\n {loading ? (\n <Skeleton width='20%'>\n <Badge {...sizeProps} resetDefaultMargin {...badgeProps} />\n </Skeleton>\n ) : (\n <>\n {badge.text && (\n <Badge {...sizeProps} borderRadius={8} marginRight={12} resetDefaultMargin {...badgeProps}>\n {badge.text}\n </Badge>\n )}\n {caption && (\n <Text\n as='span'\n appearance='caption'\n size={0.9}\n sizeUnits='em'\n color='content-onmain-tertiary'\n weight={700}\n {...captionProps}\n >\n {caption}\n </Text>\n )}\n </>\n )}\n </Styled.Header>\n )}\n {orientation === 'portrait' && (\n <>\n {loading && (\n <Styled.Media aspectRatio='16:9'>\n <Skeleton />\n </Styled.Media>\n )}\n {!loading && (imgProps.src || videoProps.src) && (\n <Styled.Media aspectRatio='16:9'>\n {imgProps.src ? (\n <img alt='' {...imgProps} />\n ) : (\n <Styled.Video controls controlsList='nofullscreen' disablePictureInPicture {...videoProps} />\n )}\n </Styled.Media>\n )}\n </>\n )}\n {(title || content || loading) && (\n <div>\n {loading ? (\n <>\n <Skeleton borderRadius={4} marginBottom='0.6em'>\n <Text appearance='subheading' size={1.4} sizeUnits='em' {...titleProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='70%' marginBottom='0.4em'>\n <Text appearance='body' size='inherit' {...contentProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='50%'>\n <Text appearance='body' size='inherit' {...contentProps} />\n </Skeleton>\n </>\n ) : (\n <>\n {title && (\n <Text\n as='h2'\n appearance='subheading'\n size={1.4}\n color='inherit'\n marginBottom={content ? '0.4em' : undefined}\n sizeUnits='em'\n {...titleProps}\n >\n {title}\n </Text>\n )}\n {content && (\n <Text as='p' appearance='body' size='inherit' color='inherit' {...contentProps}>\n {content}\n </Text>\n )}\n </>\n )}\n </div>\n )}\n </Styled.Content>\n {(secondaryButtonText || primaryButtonText || loading) && (\n <Styled.Footer>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : (\n <>\n {secondaryButtonText && (\n <Button\n preset='brand'\n black\n outline\n type='button'\n marginRight={controlsDirection === 'row' ? 6 : undefined}\n marginBottom={controlsDirection === 'column' ? 6 : undefined}\n {...sizeProps}\n {...secondaryButtonProps}\n >\n {secondaryButtonText}\n </Button>\n )}\n {primaryButtonText && (\n <Button preset='brand' black type='button' {...sizeProps} {...primaryButtonProps}>\n {primaryButtonText}\n </Button>\n )}\n </>\n )}\n </Styled.Footer>\n )}\n </Styled.Container>\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n return props.orientation === 'landscape' ? SIZES_LANDSCAPE : SIZES\n },\n }\n)\n\nexport { PopoverComponent }\n\nexport { COMPONENT_NAME, SIZES_LANDSCAPE, SIZES }\n"],"names":["COMPONENT_NAME","PopoverComponent","withMergedProps","forwardRef","props","ref","size","orientation","controlsDirection","badge","captionProps","titleProps","contentProps","closeButtonProps","media","controls","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","loading","caption","title","content","closeFn","palette","showCloseButton","restProps","sizeProps","badgeProps","imgProps","videoProps","text","secondaryButtonText","buttonProps","secondaryButtonProps","secondary","primaryButtonText","primaryButtonProps","primary","_jsxs","Styled","children","_jsx","onClick","evt","type","Icon","as","name","_Fragment","aspectRatio","Skeleton","src","alt","controlsList","disablePictureInPicture","width","Badge","resetDefaultMargin","borderRadius","marginRight","Text","appearance","sizeUnits","color","weight","marginBottom","undefined","Button","preset","black","outline","displayName","sizes","SIZES_LANDSCAPE","SIZES"],"mappings":"ueAWMA,MAAAA,eAAiB,mBAajBC,MAAAA,iBAA2EC,gBAI/EC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,YACVA,EAAc,WAAUC,kBACxBA,EAAoB,MAAKC,MACzBA,EAAQ,CAAE,EAAAC,aACVA,EAAe,CAAE,EAAAC,WACjBA,EAAa,CAAE,EAAAC,aACfA,EAAe,CAAE,EAAAC,iBACjBA,EAAmB,CAAE,EAAAC,MACrBA,EAAQ,CAAE,EAAAC,SACVA,EAAW,CAAE,EAAAC,QACbA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,QACNA,EAAOC,QACPA,EAAOC,MACPA,EAAKC,QACLA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,gBACPA,KACGC,GACDzB,EAEJ,MAAM0B,EAAY,CAChBxB,OACAU,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMU,WAAEA,EAAa,CAAC,GAAMtB,EAE5B,MAAMuB,SAAEA,EAAW,CAAE,EAAAC,WAAEA,EAAa,CAAC,GAAMnB,EAE3C,MAAQoB,KAAMC,EAAqBC,YAAaC,EAAuB,CAAC,GAAMtB,EAASuB,WAAa,GAEpG,MAAQJ,KAAMK,EAAmBH,YAAaI,EAAqB,CAAC,GAAMzB,EAAS0B,SAAW,GAE9F,OACEC,KAACC,KAAW,IACNd,KACAC,EACJH,QAASA,EACTpB,YAAaA,EACbC,kBAAmBA,EACnBH,IAAKA,EAAIuC,UAERhB,GACCiB,IAACF,YAAkB,IACb9B,EACJiC,QAAUC,WACGrB,GAAY,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,OAAM,CAACC,OAAO,QAAQC,OAAK,EAACzB,KAAK,YAAalB,KAAeU,EAAkBI,SAC7EL,cAQH,IAGlB,CACEoC,YAxOmB,mBAyOnBC,MAAQxE,GACCA,EAAMG,cAAgB,YAAcsE,gBAAkBC"}
|
|
1
|
+
{"version":3,"file":"PopoverComponent.mjs","sources":["../../../../src/components/PopoverComponent/PopoverComponent.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Badge } from 'components/Badge'\nimport { Text } from 'components/Text'\nimport { Button } from 'components/Button'\nimport { Skeleton } from 'components/Skeleton'\nimport { SIZES, SIZES_LANDSCAPE, SIZES_CAPTION, SIZES_TITLE, SIZES_CONTENT } from './constants'\nimport * as Styled from './style'\nimport type { PopoverComponentProps } from './types'\n\nconst COMPONENT_NAME = 'PopoverComponent'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс `PopoverComponent` можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/PopoverComponent/types.ts).\n */\nconst PopoverComponent: React.ForwardRefExoticComponent<PopoverComponentProps> = withMergedProps<\n PopoverComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n orientation = 'portrait',\n controlsDirection = 'row',\n badge = {},\n captionProps = {},\n titleProps = {},\n contentProps = {},\n closeButtonProps = {},\n media = {},\n controls = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n loading,\n caption,\n title,\n content,\n closeFn,\n palette,\n footer,\n showCloseButton,\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 { badgeProps = {} } = badge\n\n const { imgProps = {}, videoProps = {} } = media\n\n const { text: secondaryButtonText, buttonProps: secondaryButtonProps = {} } = controls.secondary ?? {}\n\n const { text: primaryButtonText, buttonProps: primaryButtonProps = {} } = controls.primary ?? {}\n\n return (\n <Styled.Root {...restProps} {...sizeProps} palette={palette} controlsDirection={controlsDirection} ref={ref}>\n {showCloseButton && (\n <Styled.CloseButton\n size='l'\n icon='close'\n {...closeButtonProps}\n onClick={(evt) => {\n if (typeof closeFn === 'function') closeFn()\n if (typeof closeButtonProps.onClick === 'function') closeButtonProps.onClick(evt)\n }}\n />\n )}\n {orientation === 'landscape' && (\n <>\n {loading && (\n <Styled.MediaLandscape>\n <Styled.Media aspectRatio='1:1'>\n <Skeleton />\n </Styled.Media>\n </Styled.MediaLandscape>\n )}\n {!loading && (imgProps.src || videoProps.src) && (\n <Styled.MediaLandscape>\n <Styled.Media aspectRatio='1:1'>\n {imgProps.src ? (\n <img alt='' {...imgProps} />\n ) : (\n <Styled.Video controls controlsList='nofullscreen' disablePictureInPicture {...videoProps} />\n )}\n </Styled.Media>\n </Styled.MediaLandscape>\n )}\n </>\n )}\n <Styled.Container>\n <Styled.Content>\n {(badge.text || caption || loading || showCloseButton) && (\n <Styled.Header>\n {loading ? (\n <Skeleton width='20%'>\n <Badge {...sizeProps} resetDefaultMargin {...badgeProps} />\n </Skeleton>\n ) : (\n <>\n {badge.text && (\n <Badge {...sizeProps} borderRadius={8} marginRight={12} resetDefaultMargin {...badgeProps}>\n {badge.text}\n </Badge>\n )}\n {caption && (\n <Text\n as='span'\n appearance='caption'\n color='content-onmain-tertiary'\n weight={700}\n sizes={SIZES_CAPTION}\n {...sizeProps}\n {...captionProps}\n >\n {caption}\n </Text>\n )}\n </>\n )}\n </Styled.Header>\n )}\n {orientation === 'portrait' && (\n <>\n {loading && (\n <Styled.Media aspectRatio='16:9'>\n <Skeleton />\n </Styled.Media>\n )}\n {!loading && (imgProps.src || videoProps.src) && (\n <Styled.Media aspectRatio='16:9'>\n {imgProps.src ? (\n <img alt='' {...imgProps} />\n ) : (\n <Styled.Video controls controlsList='nofullscreen' disablePictureInPicture {...videoProps} />\n )}\n </Styled.Media>\n )}\n </>\n )}\n {(title || content || loading) && (\n <div>\n {loading ? (\n <>\n <Skeleton borderRadius={4}>\n <Text\n appearance='subheading'\n marginBottom='0.4em'\n sizes={SIZES_TITLE}\n {...sizeProps}\n {...titleProps}\n />\n </Skeleton>\n <Skeleton borderRadius={4} width='70%'>\n <Text\n appearance='body'\n marginBottom='0.4em'\n sizes={SIZES_CONTENT}\n {...sizeProps}\n {...contentProps}\n />\n </Skeleton>\n <Skeleton borderRadius={4} width='50%'>\n <Text appearance='body' sizes={SIZES_CONTENT} {...sizeProps} {...contentProps} />\n </Skeleton>\n </>\n ) : (\n <>\n {title && (\n <Text\n as='h2'\n appearance='subheading'\n color='inherit'\n marginBottom={content ? '0.4em' : undefined}\n sizes={SIZES_TITLE}\n {...sizeProps}\n {...titleProps}\n >\n {title}\n </Text>\n )}\n {content && (\n <Text\n as='p'\n appearance='body'\n color='inherit'\n sizes={SIZES_CONTENT}\n {...sizeProps}\n {...contentProps}\n >\n {content}\n </Text>\n )}\n </>\n )}\n </div>\n )}\n </Styled.Content>\n {footer && (\n <Styled.Footer>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : (\n footer(sizeProps)\n )}\n </Styled.Footer>\n )}\n {!footer && (secondaryButtonText || primaryButtonText) && (\n <Styled.Controls>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : (\n <>\n {secondaryButtonText && (\n <Button\n preset='brand'\n black\n outline\n type='button'\n marginRight={controlsDirection === 'row' ? 6 : undefined}\n marginBottom={controlsDirection === 'column' ? 6 : undefined}\n {...sizeProps}\n {...secondaryButtonProps}\n >\n {secondaryButtonText}\n </Button>\n )}\n {primaryButtonText && (\n <Button preset='brand' black type='button' {...sizeProps} {...primaryButtonProps}>\n {primaryButtonText}\n </Button>\n )}\n </>\n )}\n </Styled.Controls>\n )}\n </Styled.Container>\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n return props.orientation === 'landscape' ? SIZES_LANDSCAPE : SIZES\n },\n }\n)\n\nexport { PopoverComponent }\n\nexport { COMPONENT_NAME, SIZES_LANDSCAPE, SIZES }\n"],"names":["COMPONENT_NAME","PopoverComponent","withMergedProps","forwardRef","props","ref","size","orientation","controlsDirection","badge","captionProps","titleProps","contentProps","closeButtonProps","media","controls","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","loading","caption","title","content","closeFn","palette","footer","showCloseButton","restProps","sizeProps","badgeProps","imgProps","videoProps","text","secondaryButtonText","buttonProps","secondaryButtonProps","secondary","primaryButtonText","primaryButtonProps","primary","_jsxs","Styled","children","_jsx","icon","onClick","evt","_Fragment","aspectRatio","Skeleton","src","alt","controlsList","disablePictureInPicture","width","Badge","resetDefaultMargin","borderRadius","marginRight","Text","as","appearance","color","weight","sizes","SIZES_CAPTION","marginBottom","SIZES_TITLE","SIZES_CONTENT","undefined","Button","preset","black","outline","type","displayName","SIZES_LANDSCAPE","SIZES"],"mappings":"qfAUMA,MAAAA,eAAiB,mBAYjBC,MAAAA,iBAA2EC,gBAI/EC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,YACVA,EAAc,WAAUC,kBACxBA,EAAoB,MAAKC,MACzBA,EAAQ,CAAE,EAAAC,aACVA,EAAe,CAAE,EAAAC,WACjBA,EAAa,CAAE,EAAAC,aACfA,EAAe,CAAE,EAAAC,iBACjBA,EAAmB,CAAE,EAAAC,MACrBA,EAAQ,CAAE,EAAAC,SACVA,EAAW,CAAE,EAAAC,QACbA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,QACNA,EAAOC,QACPA,EAAOC,MACPA,EAAKC,QACLA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,OACPA,EAAMC,gBACNA,KAC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iBACHxC,KACAnB,EAAYiC,SAEfpB,YAQdG,GACCkB,IAACF,OAAa,CAAAC,SACXvB,EACCwB,IAACM,SAAQ,CAACK,MAAM,OAAMZ,SACpBC,IAAC2B,OAAM,CAACC,OAAO,WAAY3C,MAG7BH,EAAOG,MAIXH,IAAWQ,GAAuBI,IAClCM,IAACF,SAAe,CAAAC,SACbvB,EACCwB,IAACM,SAAQ,CAACK,MAAM,OAAMZ,SACpBC,IAAC2B,OAAM,CAACC,OAAO,WAAY3C,MAG7BY,KAAAO,SAAA,CAAAL,SACGT,CAAAA,GACCU,IAAC2B,OAAM,CACLC,OAAO,QACPC,OAAK,EACLC,SAAO,EACPC,KAAK,SACLhB,YAAarD,IAAsB,MAAQ,OAAIgE,EAC/CH,aAAc7D,IAAsB,SAAW,OAAIgE,KAC/CzC,KACAO,EAAoBO,SAEvBT,IAGJI,GACCM,IAAC2B,OAAM,CAACC,OAAO,QAAQC,OAAK,EAACE,KAAK,YAAa9C,KAAeU,EAAkBI,SAC7EL,cAQH,IAGlB,CACEsC,YA7PmB,mBA8PnBX,MAAQ/D,GACCA,EAAMG,cAAgB,YAAcwE,gBAAkBC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';exports.SIZES={
|
|
1
|
+
'use strict';exports.SIZES={xl:{width:600,padding:32,borderRadius:16},l:{width:560,padding:32,borderRadius:16},m:{width:356,padding:20,borderRadius:16},s:{width:280,padding:20,borderRadius:16},xs:{width:260,padding:18,borderRadius:16}},exports.SIZES_CAPTION={xl:{fontSize:20},l:{fontSize:18},m:{fontSize:16},s:{fontSize:14},xs:{fontSize:12}},exports.SIZES_CONTENT={xl:{fontSize:22},l:{fontSize:20},m:{fontSize:16},s:{fontSize:14},xs:{fontSize:12}},exports.SIZES_LANDSCAPE={xl:{width:900,padding:32,borderRadius:16},l:{width:792,padding:32,borderRadius:16},m:{width:600,padding:20,borderRadius:16},s:{width:520,padding:20,borderRadius:16},xs:{width:375,padding:18,borderRadius:16}},exports.SIZES_TITLE={xl:{fontSize:30},l:{fontSize:28},m:{fontSize:18},s:{fontSize:16},xs:{fontSize:14}};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/PopoverComponent/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type {
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/components/PopoverComponent/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { PopoverComponentSize } from './types'\n\nexport const SIZES: Record<PopoverComponentSize, CSSProperties> = {\n xl: {\n width: 600,\n padding: 32,\n borderRadius: 16,\n },\n l: {\n width: 560,\n padding: 32,\n borderRadius: 16,\n },\n m: {\n width: 356,\n padding: 20,\n borderRadius: 16,\n },\n s: {\n width: 280,\n padding: 20,\n borderRadius: 16,\n },\n xs: {\n width: 260,\n padding: 18,\n borderRadius: 16,\n },\n}\n\nexport const SIZES_LANDSCAPE: Record<PopoverComponentSize, CSSProperties> = {\n xl: {\n width: 900,\n padding: 32,\n borderRadius: 16,\n },\n l: {\n width: 792,\n padding: 32,\n borderRadius: 16,\n },\n m: {\n width: 600,\n padding: 20,\n borderRadius: 16,\n },\n s: {\n width: 520,\n padding: 20,\n borderRadius: 16,\n },\n xs: {\n width: 375,\n padding: 18,\n borderRadius: 16,\n },\n}\n\nexport const SIZES_CAPTION: Record<PopoverComponentSize, CSSProperties> = {\n xl: { fontSize: 20 },\n l: { fontSize: 18 },\n m: { fontSize: 16 },\n s: { fontSize: 14 },\n xs: { fontSize: 12 },\n}\n\nexport const SIZES_TITLE: Record<PopoverComponentSize, CSSProperties> = {\n xl: { fontSize: 30 },\n l: { fontSize: 28 },\n m: { fontSize: 18 },\n s: { fontSize: 16 },\n xs: { fontSize: 14 },\n}\n\nexport const SIZES_CONTENT: Record<PopoverComponentSize, CSSProperties> = {\n xl: { fontSize: 22 },\n l: { fontSize: 20 },\n m: { fontSize: 16 },\n s: { fontSize: 14 },\n xs: { fontSize: 12 },\n}\n"],"names":["xl","width","padding","borderRadius","l","m","s","xs","fontSize"],"mappings":"2BAGkE,CAChEA,GAAI,CACFC,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBC,EAAG,CACDH,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBE,EAAG,CACDJ,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBG,EAAG,CACDL,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBI,GAAI,CACFN,MAAO,IACPC,QAAS,GACTC,aAAc,2BAgCwD,CACxEH,GAAI,CAAEQ,SAAU,IAChBJ,EAAG,CAAEI,SAAU,IACfH,EAAG,CAAEG,SAAU,IACfF,EAAG,CAAEE,SAAU,IACfD,GAAI,CAAEC,SAAU,2BAWwD,CACxER,GAAI,CAAEQ,SAAU,IAChBJ,EAAG,CAAEI,SAAU,IACfH,EAAG,CAAEG,SAAU,IACfF,EAAG,CAAEE,SAAU,IACfD,GAAI,CAAEC,SAAU,6BAjD0D,CAC1ER,GAAI,CACFC,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBC,EAAG,CACDH,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBE,EAAG,CACDJ,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBG,EAAG,CACDL,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBI,GAAI,CACFN,MAAO,IACPC,QAAS,GACTC,aAAc,yBAYsD,CACtEH,GAAI,CAAEQ,SAAU,IAChBJ,EAAG,CAAEI,SAAU,IACfH,EAAG,CAAEG,SAAU,IACfF,EAAG,CAAEE,SAAU,IACfD,GAAI,CAAEC,SAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const SIZES={
|
|
1
|
+
const SIZES={xl:{width:600,padding:32,borderRadius:16},l:{width:560,padding:32,borderRadius:16},m:{width:356,padding:20,borderRadius:16},s:{width:280,padding:20,borderRadius:16},xs:{width:260,padding:18,borderRadius:16}};const SIZES_LANDSCAPE={xl:{width:900,padding:32,borderRadius:16},l:{width:792,padding:32,borderRadius:16},m:{width:600,padding:20,borderRadius:16},s:{width:520,padding:20,borderRadius:16},xs:{width:375,padding:18,borderRadius:16}};const SIZES_CAPTION={xl:{fontSize:20},l:{fontSize:18},m:{fontSize:16},s:{fontSize:14},xs:{fontSize:12}};const SIZES_TITLE={xl:{fontSize:30},l:{fontSize:28},m:{fontSize:18},s:{fontSize:16},xs:{fontSize:14}};const SIZES_CONTENT={xl:{fontSize:22},l:{fontSize:20},m:{fontSize:16},s:{fontSize:14},xs:{fontSize:12}};export{SIZES,SIZES_CAPTION,SIZES_CONTENT,SIZES_LANDSCAPE,SIZES_TITLE};
|
|
2
2
|
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/PopoverComponent/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type {
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/PopoverComponent/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { PopoverComponentSize } from './types'\n\nexport const SIZES: Record<PopoverComponentSize, CSSProperties> = {\n xl: {\n width: 600,\n padding: 32,\n borderRadius: 16,\n },\n l: {\n width: 560,\n padding: 32,\n borderRadius: 16,\n },\n m: {\n width: 356,\n padding: 20,\n borderRadius: 16,\n },\n s: {\n width: 280,\n padding: 20,\n borderRadius: 16,\n },\n xs: {\n width: 260,\n padding: 18,\n borderRadius: 16,\n },\n}\n\nexport const SIZES_LANDSCAPE: Record<PopoverComponentSize, CSSProperties> = {\n xl: {\n width: 900,\n padding: 32,\n borderRadius: 16,\n },\n l: {\n width: 792,\n padding: 32,\n borderRadius: 16,\n },\n m: {\n width: 600,\n padding: 20,\n borderRadius: 16,\n },\n s: {\n width: 520,\n padding: 20,\n borderRadius: 16,\n },\n xs: {\n width: 375,\n padding: 18,\n borderRadius: 16,\n },\n}\n\nexport const SIZES_CAPTION: Record<PopoverComponentSize, CSSProperties> = {\n xl: { fontSize: 20 },\n l: { fontSize: 18 },\n m: { fontSize: 16 },\n s: { fontSize: 14 },\n xs: { fontSize: 12 },\n}\n\nexport const SIZES_TITLE: Record<PopoverComponentSize, CSSProperties> = {\n xl: { fontSize: 30 },\n l: { fontSize: 28 },\n m: { fontSize: 18 },\n s: { fontSize: 16 },\n xs: { fontSize: 14 },\n}\n\nexport const SIZES_CONTENT: Record<PopoverComponentSize, CSSProperties> = {\n xl: { fontSize: 22 },\n l: { fontSize: 20 },\n m: { fontSize: 16 },\n s: { fontSize: 14 },\n xs: { fontSize: 12 },\n}\n"],"names":["SIZES","xl","width","padding","borderRadius","l","m","s","xs","SIZES_LANDSCAPE","SIZES_CAPTION","fontSize","SIZES_TITLE","SIZES_CONTENT"],"mappings":"AAGO,MAAMA,MAAqD,CAChEC,GAAI,CACFC,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBC,EAAG,CACDH,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBE,EAAG,CACDJ,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBG,EAAG,CACDL,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBI,GAAI,CACFN,MAAO,IACPC,QAAS,GACTC,aAAc,KAIX,MAAMK,gBAA+D,CAC1ER,GAAI,CACFC,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBC,EAAG,CACDH,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBE,EAAG,CACDJ,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBG,EAAG,CACDL,MAAO,IACPC,QAAS,GACTC,aAAc,IAEhBI,GAAI,CACFN,MAAO,IACPC,QAAS,GACTC,aAAc,KAIX,MAAMM,cAA6D,CACxET,GAAI,CAAEU,SAAU,IAChBN,EAAG,CAAEM,SAAU,IACfL,EAAG,CAAEK,SAAU,IACfJ,EAAG,CAAEI,SAAU,IACfH,GAAI,CAAEG,SAAU,KAGX,MAAMC,YAA2D,CACtEX,GAAI,CAAEU,SAAU,IAChBN,EAAG,CAAEM,SAAU,IACfL,EAAG,CAAEK,SAAU,IACfJ,EAAG,CAAEI,SAAU,IACfH,GAAI,CAAEG,SAAU,KAGX,MAAME,cAA6D,CACxEZ,GAAI,CAAEU,SAAU,IAChBN,EAAG,CAAEM,SAAU,IACfL,EAAG,CAAEK,SAAU,IACfJ,EAAG,CAAEI,SAAU,IACfH,GAAI,CAAEG,SAAU"}
|