@foxford/ui 2.70.0 → 2.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/components/AspectRatio/AspectRatio.js +2 -0
  2. package/components/AspectRatio/AspectRatio.js.map +1 -0
  3. package/components/AspectRatio/AspectRatio.mjs +2 -0
  4. package/components/AspectRatio/AspectRatio.mjs.map +1 -0
  5. package/components/AspectRatio/style.js +2 -0
  6. package/components/AspectRatio/style.js.map +1 -0
  7. package/components/AspectRatio/style.mjs +2 -0
  8. package/components/AspectRatio/style.mjs.map +1 -0
  9. package/components/AspectRatio/utils.js +2 -0
  10. package/components/AspectRatio/utils.js.map +1 -0
  11. package/components/AspectRatio/utils.mjs +2 -0
  12. package/components/AspectRatio/utils.mjs.map +1 -0
  13. package/components/Popover/Popover.js +1 -1
  14. package/components/Popover/Popover.js.map +1 -1
  15. package/components/Popover/Popover.mjs +1 -1
  16. package/components/Popover/Popover.mjs.map +1 -1
  17. package/components/Popover/sizes.js +2 -0
  18. package/components/Popover/sizes.js.map +1 -0
  19. package/components/Popover/sizes.mjs +2 -0
  20. package/components/Popover/sizes.mjs.map +1 -0
  21. package/components/PopoverComponent/PopoverComponent.js +1 -1
  22. package/components/PopoverComponent/PopoverComponent.js.map +1 -1
  23. package/components/PopoverComponent/PopoverComponent.mjs +1 -1
  24. package/components/PopoverComponent/PopoverComponent.mjs.map +1 -1
  25. package/components/PopoverComponent/layouts.js +2 -0
  26. package/components/PopoverComponent/layouts.js.map +1 -0
  27. package/components/PopoverComponent/layouts.mjs +2 -0
  28. package/components/PopoverComponent/layouts.mjs.map +1 -0
  29. package/components/PopoverComponent/sizes.js +2 -0
  30. package/components/PopoverComponent/sizes.js.map +1 -0
  31. package/components/PopoverComponent/sizes.mjs +2 -0
  32. package/components/PopoverComponent/sizes.mjs.map +1 -0
  33. package/components/PopoverComponent/style.js +1 -1
  34. package/components/PopoverComponent/style.js.map +1 -1
  35. package/components/PopoverComponent/style.mjs +1 -1
  36. package/components/PopoverComponent/style.mjs.map +1 -1
  37. package/dts/index.d.ts +416 -236
  38. package/index.js +1 -1
  39. package/index.mjs +1 -1
  40. package/mixins/responsive-layout.js +2 -0
  41. package/mixins/responsive-layout.js.map +1 -0
  42. package/mixins/responsive-layout.mjs +2 -0
  43. package/mixins/responsive-layout.mjs.map +1 -0
  44. package/package.json +1 -1
  45. package/components/PopoverComponent/constants.js +0 -2
  46. package/components/PopoverComponent/constants.js.map +0 -1
  47. package/components/PopoverComponent/constants.mjs +0 -2
  48. package/components/PopoverComponent/constants.mjs.map +0 -1
@@ -0,0 +1,2 @@
1
+ 'use strict';var React=require('react');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');exports.AspectRatio=React.forwardRef(((e,r)=>{const{ratio:t="1:1",children:s,...i}=e;return jsxRuntime.jsxs(style.Root,{...i,ref:r,children:[jsxRuntime.jsx(style.Placeholder,{ratio:t}),s]})}));
2
+ //# sourceMappingURL=AspectRatio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AspectRatio.js","sources":["../../../../src/components/AspectRatio/AspectRatio.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport type { AspectRatioProps } from './types'\nimport * as Styled from './style'\n\n/**\n *\n * Компонент для создания плейсхолдеров с определенным соотношением сторон.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<div\\> элемента.\n */\nconst AspectRatio: React.ForwardRefExoticComponent<AspectRatioProps> = forwardRef<HTMLDivElement, AspectRatioProps>(\n (props, ref) => {\n const { ratio = '1:1', children, ...restProps } = props\n\n return (\n <Styled.Root {...restProps} ref={ref}>\n <Styled.Placeholder ratio={ratio} />\n {children}\n </Styled.Root>\n )\n }\n)\n\nexport { AspectRatio }\n"],"names":["forwardRef","props","ref","ratio","children","restProps","_jsxs","Styled","_jsx","jsx"],"mappings":"wIAUuEA,MAAUA,YAC/E,CAACC,EAAOC,KACN,MAAMC,MAAEA,EAAQ,MAAKC,SAAEA,KAAaC,GAAcJ,EAElD,OACEK,WAAAA,KAACC,MAAAA,KAAW,IAAKF,EAAWH,IAAKA,EAAIE,SACnCI,CAAAA,WAAAC,IAACF,kBAAkB,CAACJ,MAAOA,IAC1BC,IACW"}
@@ -0,0 +1,2 @@
1
+ import{forwardRef}from'react';import{Root,Placeholder}from'./style.mjs';import{jsxs,jsx}from'react/jsx-runtime';const AspectRatio=forwardRef(((r,o)=>{const{ratio:t="1:1",children:e,...s}=r;return jsxs(Root,{...s,ref:o,children:[jsx(Placeholder,{ratio:t}),e]})}));export{AspectRatio};
2
+ //# sourceMappingURL=AspectRatio.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AspectRatio.mjs","sources":["../../../../src/components/AspectRatio/AspectRatio.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport type { AspectRatioProps } from './types'\nimport * as Styled from './style'\n\n/**\n *\n * Компонент для создания плейсхолдеров с определенным соотношением сторон.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<div\\> элемента.\n */\nconst AspectRatio: React.ForwardRefExoticComponent<AspectRatioProps> = forwardRef<HTMLDivElement, AspectRatioProps>(\n (props, ref) => {\n const { ratio = '1:1', children, ...restProps } = props\n\n return (\n <Styled.Root {...restProps} ref={ref}>\n <Styled.Placeholder ratio={ratio} />\n {children}\n </Styled.Root>\n )\n }\n)\n\nexport { AspectRatio }\n"],"names":["AspectRatio","forwardRef","props","ref","ratio","children","restProps","_jsxs","Styled","_jsx"],"mappings":"gHAUMA,MAAAA,YAAiEC,YACrE,CAACC,EAAOC,KACN,MAAMC,MAAEA,EAAQ,MAAKC,SAAEA,KAAaC,GAAcJ,EAElD,OACEK,KAACC,KAAW,IAAKF,EAAWH,IAAKA,EAAIE,SACnCI,CAAAA,IAACD,YAAkB,CAACJ,MAAOA,IAC1BC,IACW"}
@@ -0,0 +1,2 @@
1
+ 'use strict';var styled=require('styled-components');var utils=require('./utils.js');function _interopDefault(t){return t&&t.__esModule?t:{default:t}}var styled__default=_interopDefault(styled);const Placeholder=styled__default.default.svg.withConfig({shouldForwardProp:t=>!['ratio'].includes(t)}).attrs((t=>({xmlns:'http://www.w3.org/2000/svg',viewBox:utils.getViewBoxFromAspectRatio(t.ratio)}))).withConfig({displayName:"AspectRatio__Placeholder",componentId:"ui__sc-1w8jdyj-0"})(["box-sizing:border-box;display:block;"]);const Root=styled__default.default.div.withConfig({shouldForwardProp:t=>!['width','height'].includes(t)}).withConfig({displayName:"AspectRatio__Root",componentId:"ui__sc-1w8jdyj-1"})(["box-sizing:border-box;position:relative;"," & > :not(","){position:absolute !important;top:0 !important;left:0 !important;width:100% !important;height:100% !important;box-sizing:border-box !important;}"],(t=>`\n width: ${typeof t.width=='number'?`${t.width}px`:typeof t.width=='string'?t.width:'min-content'};\n height: ${typeof t.height=='number'?`${t.height}px`:typeof t.height=='string'?t.height:'min-content'};\n\n & > ${Placeholder} {\n width: ${typeof t.width=='number'||typeof t.width=='string'?'100%':'auto'};\n height: ${typeof t.height=='number'||typeof t.height=='string'?'100%':'auto'}\n }\n `),Placeholder);exports.Placeholder=Placeholder,exports.Root=Root;
2
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/AspectRatio/style.ts"],"sourcesContent":["import styled from 'styled-components'\nimport { getViewBoxFromAspectRatio } from './utils'\nimport type { AspectRatioProps, StyledPlaceholderProps } from './types'\n\nexport const Placeholder = styled.svg\n .withConfig<StyledPlaceholderProps>({\n shouldForwardProp: (propKey) => !['ratio'].includes(propKey),\n })\n .attrs<StyledPlaceholderProps>((props) => ({\n xmlns: 'http://www.w3.org/2000/svg',\n viewBox: getViewBoxFromAspectRatio(props.ratio),\n }))`\n box-sizing: border-box;\n display: block;\n`\n\nexport const Root = styled.div.withConfig<Omit<AspectRatioProps, 'ratio'>>({\n shouldForwardProp: (propKey) => !['width', 'height'].includes(propKey),\n})`\n box-sizing: border-box;\n position: relative;\n\n ${(props) => `\n width: ${\n typeof props.width === 'number'\n ? `${props.width}px`\n : typeof props.width === 'string'\n ? props.width\n : 'min-content'\n };\n height: ${\n typeof props.height === 'number'\n ? `${props.height}px`\n : typeof props.height === 'string'\n ? props.height\n : 'min-content'\n };\n\n & > ${Placeholder} {\n width: ${typeof props.width === 'number' || typeof props.width === 'string' ? '100%' : 'auto'};\n height: ${typeof props.height === 'number' || typeof props.height === 'string' ? '100%' : 'auto'}\n }\n `}\n\n & > :not(${Placeholder}) {\n position: absolute !important;\n top: 0 !important;\n left: 0 !important;\n width: 100% !important;\n height: 100% !important;\n box-sizing: border-box !important;\n }\n`\n"],"names":["Placeholder","styled","svg","withConfig","shouldForwardProp","propKey","includes","attrs","props","xmlns","viewBox","getViewBoxFromAspectRatio","ratio","displayName","componentId","Root","div","width","height"],"mappings":"kMAIO,MAAMA,YAAcC,gBAAAA,QAAOC,IAC/BC,WAAmC,CAClCC,kBAAoBC,IAAa,CAAC,SAASC,SAASD,KAErDE,OAA+BC,IAAW,CACzCC,MAAO,6BACPC,QAASC,MAAAA,0BAA0BH,EAAMI,WACxCT,WAAA,CAAAU,YAAA,2BAAAC,YAAA,oBAPsBb,CAU1B,CAAA,yCAEM,MAAMc,KAAOd,gBAAAA,QAAOe,IAAIb,WAA4C,CACzEC,kBAAoBC,IAAa,CAAC,QAAS,UAAUC,SAASD,KAC9DF,WAAA,CAAAU,YAAA,oBAAAC,YAAA,oBAFkBb,CAElB,CAAA,2CAAA,aAAA,sJAIGO,GAAU,uBAEFA,EAAMS,OAAU,SACnB,GAAGT,EAAMS,iBACFT,EAAMS,OAAU,SACvBT,EAAMS,MACN,sCAGGT,EAAMU,QAAW,SACpB,GAAGV,EAAMU,kBACFV,EAAMU,QAAW,SACxBV,EAAMU,OACN,6BAGAlB,sCACYQ,EAAMS,OAAU,iBAAmBT,EAAMS,OAAU,SAAW,OAAS,iCACtET,EAAMU,QAAW,iBAAmBV,EAAMU,QAAW,SAAW,OAAS,qBAInFlB"}
@@ -0,0 +1,2 @@
1
+ import styled from'styled-components';import{getViewBoxFromAspectRatio}from'./utils.mjs';const Placeholder=styled.svg.withConfig({shouldForwardProp:t=>!['ratio'].includes(t)}).attrs((t=>({xmlns:'http://www.w3.org/2000/svg',viewBox:getViewBoxFromAspectRatio(t.ratio)}))).withConfig({displayName:"AspectRatio__Placeholder",componentId:"ui__sc-1w8jdyj-0"})(["box-sizing:border-box;display:block;"]);const Root=styled.div.withConfig({shouldForwardProp:t=>!['width','height'].includes(t)}).withConfig({displayName:"AspectRatio__Root",componentId:"ui__sc-1w8jdyj-1"})(["box-sizing:border-box;position:relative;"," & > :not(","){position:absolute !important;top:0 !important;left:0 !important;width:100% !important;height:100% !important;box-sizing:border-box !important;}"],(t=>`\n width: ${typeof t.width=='number'?`${t.width}px`:typeof t.width=='string'?t.width:'min-content'};\n height: ${typeof t.height=='number'?`${t.height}px`:typeof t.height=='string'?t.height:'min-content'};\n\n & > ${Placeholder} {\n width: ${typeof t.width=='number'||typeof t.width=='string'?'100%':'auto'};\n height: ${typeof t.height=='number'||typeof t.height=='string'?'100%':'auto'}\n }\n `),Placeholder);export{Placeholder,Root};
2
+ //# sourceMappingURL=style.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.mjs","sources":["../../../../src/components/AspectRatio/style.ts"],"sourcesContent":["import styled from 'styled-components'\nimport { getViewBoxFromAspectRatio } from './utils'\nimport type { AspectRatioProps, StyledPlaceholderProps } from './types'\n\nexport const Placeholder = styled.svg\n .withConfig<StyledPlaceholderProps>({\n shouldForwardProp: (propKey) => !['ratio'].includes(propKey),\n })\n .attrs<StyledPlaceholderProps>((props) => ({\n xmlns: 'http://www.w3.org/2000/svg',\n viewBox: getViewBoxFromAspectRatio(props.ratio),\n }))`\n box-sizing: border-box;\n display: block;\n`\n\nexport const Root = styled.div.withConfig<Omit<AspectRatioProps, 'ratio'>>({\n shouldForwardProp: (propKey) => !['width', 'height'].includes(propKey),\n})`\n box-sizing: border-box;\n position: relative;\n\n ${(props) => `\n width: ${\n typeof props.width === 'number'\n ? `${props.width}px`\n : typeof props.width === 'string'\n ? props.width\n : 'min-content'\n };\n height: ${\n typeof props.height === 'number'\n ? `${props.height}px`\n : typeof props.height === 'string'\n ? props.height\n : 'min-content'\n };\n\n & > ${Placeholder} {\n width: ${typeof props.width === 'number' || typeof props.width === 'string' ? '100%' : 'auto'};\n height: ${typeof props.height === 'number' || typeof props.height === 'string' ? '100%' : 'auto'}\n }\n `}\n\n & > :not(${Placeholder}) {\n position: absolute !important;\n top: 0 !important;\n left: 0 !important;\n width: 100% !important;\n height: 100% !important;\n box-sizing: border-box !important;\n }\n`\n"],"names":["Placeholder","styled","svg","withConfig","shouldForwardProp","propKey","includes","attrs","props","xmlns","viewBox","getViewBoxFromAspectRatio","ratio","displayName","componentId","Root","div","width","height"],"mappings":"yFAIO,MAAMA,YAAcC,OAAOC,IAC/BC,WAAmC,CAClCC,kBAAoBC,IAAa,CAAC,SAASC,SAASD,KAErDE,OAA+BC,IAAW,CACzCC,MAAO,6BACPC,QAASC,0BAA0BH,EAAMI,WACxCT,WAAA,CAAAU,YAAA,2BAAAC,YAAA,oBAPsBb,CAU1B,CAAA,yCAEM,MAAMc,KAAOd,OAAOe,IAAIb,WAA4C,CACzEC,kBAAoBC,IAAa,CAAC,QAAS,UAAUC,SAASD,KAC9DF,WAAA,CAAAU,YAAA,oBAAAC,YAAA,oBAFkBb,CAElB,CAAA,2CAAA,aAAA,sJAIGO,GAAU,uBAEFA,EAAMS,OAAU,SACnB,GAAGT,EAAMS,iBACFT,EAAMS,OAAU,SACvBT,EAAMS,MACN,sCAGGT,EAAMU,QAAW,SACpB,GAAGV,EAAMU,kBACFV,EAAMU,QAAW,SACxBV,EAAMU,OACN,6BAGAlB,sCACYQ,EAAMS,OAAU,iBAAmBT,EAAMS,OAAU,SAAW,OAAS,iCACtET,EAAMU,QAAW,iBAAmBV,EAAMU,QAAW,SAAW,OAAS,qBAInFlB"}
@@ -0,0 +1,2 @@
1
+ 'use strict';const aspectRatioRegExp=/^\d+:\d+$/;exports.getViewBoxFromAspectRatio=t=>aspectRatioRegExp.test(t)?`0 0 ${t.replace(':',' ')}`:'0 0 1 1';
2
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../../../../src/components/AspectRatio/utils.ts"],"sourcesContent":["const aspectRatioRegExp = /^\\d+:\\d+$/\n\nexport const getViewBoxFromAspectRatio = (ratio: `${number}:${number}`) =>\n aspectRatioRegExp.test(ratio) ? `0 0 ${ratio.replace(':', ' ')}` : '0 0 1 1'\n"],"names":["aspectRatioRegExp","ratio","test","replace"],"mappings":"aAAA,MAAMA,kBAAoB,8CAEgBC,GACxCD,kBAAkBE,KAAKD,GAAS,OAAOA,EAAME,QAAQ,IAAK,OAAS"}
@@ -0,0 +1,2 @@
1
+ const aspectRatioRegExp=/^\d+:\d+$/;const getViewBoxFromAspectRatio=t=>aspectRatioRegExp.test(t)?`0 0 ${t.replace(':',' ')}`:'0 0 1 1';export{getViewBoxFromAspectRatio};
2
+ //# sourceMappingURL=utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.mjs","sources":["../../../../src/components/AspectRatio/utils.ts"],"sourcesContent":["const aspectRatioRegExp = /^\\d+:\\d+$/\n\nexport const getViewBoxFromAspectRatio = (ratio: `${number}:${number}`) =>\n aspectRatioRegExp.test(ratio) ? `0 0 ${ratio.replace(':', ' ')}` : '0 0 1 1'\n"],"names":["aspectRatioRegExp","getViewBoxFromAspectRatio","ratio","test","replace"],"mappings":"AAAA,MAAMA,kBAAoB,YAEnB,MAAMC,0BAA6BC,GACxCF,kBAAkBG,KAAKD,GAAS,OAAOA,EAAME,QAAQ,IAAK,OAAS"}
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var misc=require('../../shared/utils/misc.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:l,sizeUnits:P,palette:m,showCloseButton:v,closeButtonProps:z,orientation:u,loading:d,badge:C,caption:j,captionProps:g,title:S,titleProps:h,content:w,contentProps:x,controlsDirection:M,media:X,footer:q,controls:R,...T}=e;return jsxRuntime.jsx(Tooltip.Tooltip,{...T,preset:"brand",ref:o,styles:misc.deepmerge({arrow:{spread:20,length:12}},s),component:jsxRuntime.jsx(PopoverComponent.PopoverComponent,{size:t,sizeXXS:r,sizeXS:n,sizeS:i,sizeM:p,sizeL:a,sizeXL:c,sizes:l,sizeUnits:P,palette:m,showCloseButton:v,closeButtonProps:z,orientation:u,loading:d,badge:C,caption:j,captionProps:g,title:S,titleProps:h,content:w,contentProps:x,controlsDirection:M,media:X,footer:q,controls:R})})})),{displayName:"Popover",sizes:e=>e.orientation==='landscape'?constants.SIZES_LANDSCAPE:constants.SIZES}),{Component:PopoverComponent.PopoverComponent});exports.COMPONENT_NAME="Popover",exports.Popover=Popover;
1
+ 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var misc=require('../../shared/utils/misc.js');var sizes=require('./sizes.js');var jsxRuntime=require('react/jsx-runtime');var PopoverComponent=require('../PopoverComponent/PopoverComponent.js');var Tooltip=require('../Tooltip/Tooltip.js');const Popover=Object.assign(withMergedProps.withMergedProps(React.forwardRef(((e,o)=>{const{size:t="s",styles:r={},palette:i={},sizeXXS:s,sizeXS:a,sizeS:n,sizeM:l,sizeL:p,sizeXL:u,sizes:c,sizeUnits:m,layout:z,layoutXXS:d,layoutXS:g,layoutS:y,layoutM:v,layoutL:S,layoutXL:X,imgSrcVertical:P,imgSrcHorizontal:j,loading:h,badge:C,caption:b,header:L,title:M,content:q,body:x,media:w,footer:R,root:f,closeButton:T,position:k,trigger:B,...H}=e;return jsxRuntime.jsx(Tooltip.Tooltip,{...H,preset:"brand",ref:o,placement:k,styles:misc.deepmerge({arrow:{spread:20,length:12}},r),palette:{backgroundColor:i.backgroundColor},component:jsxRuntime.jsx(PopoverComponent.PopoverComponent,{size:t,sizeXXS:s,sizeXS:a,sizeS:n,sizeM:l,sizeL:p,sizeXL:u,sizes:c,sizeUnits:m,layout:z,layoutXXS:d,layoutXS:g,layoutS:y,layoutM:v,layoutL:S,layoutXL:X,imgSrcVertical:P,imgSrcHorizontal:j,palette:i,loading:h,badge:C,caption:b,header:L,title:M,content:q,body:x,media:w,footer:R,root:f,closeButton:T}),children:B})})),{displayName:'Popover',sizes:sizes.SIZES}),{Component:PopoverComponent.PopoverComponent});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 { withMergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent, SIZES_LANDSCAPE, SIZES } from 'components/PopoverComponent'\nimport { deepmerge } from 'shared/utils/misc'\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={deepmerge({ arrow: { spread: 20, length: 12 } }, styles)}\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","deepmerge","arrow","spread","length","component","jsx","PopoverComponent","displayName","SIZES_LANDSCAPE","SIZES","Component"],"mappings":"+WAwBA,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,KAAAA,UAAU,CAAEC,MAAO,CAAEC,OAAQ,GAAIC,OAAQ,KAAQhC,GACzDiC,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,YAzFiB,UA0FjB7B,MAAQV,GACCA,EAAMe,cAAgB,YAAcyB,UAAAA,gBAAkBC,UAAAA,QAInE,CACEC,UAAWJ,iBAAAA,0CAhGQ"}
1
+ {"version":3,"file":"Popover.js","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent } from 'components/PopoverComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { SIZES } from './sizes'\nimport type { PopoverProps } from './types'\n\nconst COMPONENT_NAME = 'Popover'\n\n/**\n *\n * Компонент для отображения контента поверх основного интерфейса.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<div\\> элемента.\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 palette = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n imgSrcVertical,\n imgSrcHorizontal,\n loading,\n badge,\n caption,\n header,\n title,\n content,\n body,\n media,\n footer,\n root,\n closeButton,\n position,\n trigger,\n ...restProps\n } = props\n\n return (\n <Tooltip\n {...restProps}\n preset='brand'\n ref={ref}\n placement={position}\n styles={deepmerge({ arrow: { spread: 20, length: 12 } }, styles)}\n palette={{\n backgroundColor: palette.backgroundColor,\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 layout={layout}\n layoutXXS={layoutXXS}\n layoutXS={layoutXS}\n layoutS={layoutS}\n layoutM={layoutM}\n layoutL={layoutL}\n layoutXL={layoutXL}\n imgSrcVertical={imgSrcVertical}\n imgSrcHorizontal={imgSrcHorizontal}\n palette={palette}\n loading={loading}\n badge={badge}\n caption={caption}\n header={header}\n title={title}\n content={content}\n body={body}\n media={media}\n footer={footer}\n root={root}\n closeButton={closeButton}\n />\n }\n >\n {trigger}\n </Tooltip>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: PopoverComponent,\n }\n)\n\nexport { Popover }\n"],"names":["Popover","Object","assign","withMergedProps","forwardRef","props","ref","size","styles","palette","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","layout","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","imgSrcVertical","imgSrcHorizontal","loading","badge","caption","header","title","content","body","media","footer","root","closeButton","position","trigger","restProps","_jsx","Tooltip","preset","placement","deepmerge","arrow","spread","length","backgroundColor","component","jsx","PopoverComponent","children","displayName","SIZES","Component"],"mappings":"qVAgBA,MAAMA,QAAkGC,OAAOC,OAC7GC,gBAAAA,gBACEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,CAAE,EAAAC,QACXA,EAAU,CAAE,EAAAC,QACZA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,eACRA,EAAcC,iBACdA,EAAgBC,QAChBA,EAAOC,MACPA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,QACLA,EAAOC,KACPA,EAAIC,MACJA,EAAKC,OACLA,EAAMC,KACNA,EAAIC,YACJA,EAAWC,SACXA,EAAQC,QACRA,KACGC,GACDnC,EAEJ,OACEoC,WAAAA,IAACC,QAAAA,QAAO,IACFF,EACJG,OAAO,QACPrC,IAAKA,EACLsC,UAAWN,EACX9B,OAAQqC,KAAAA,UAAU,CAAEC,MAAO,CAAEC,OAAQ,GAAIC,OAAQ,KAAQxC,GACzDC,QAAS,CACPwC,gBAAiBxC,EAAQwC,iBAE3BC,UACET,WAAAU,IAACC,kCAAgB,CACf7C,KAAMA,EACNG,QAASA,EACTC,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,EACRC,MAAOA,EACPC,UAAWA,EACXC,OAAQA,EACRC,UAAWA,EACXC,SAAUA,EACVC,QAASA,EACTC,QAASA,EACTC,QAASA,EACTC,SAAUA,EACVC,eAAgBA,EAChBC,iBAAkBA,EAClBjB,QAASA,EACTkB,QAASA,EACTC,MAAOA,EACPC,QAASA,EACTC,OAAQA,EACRC,MAAOA,EACPC,QAASA,EACTC,KAAMA,EACNC,MAAOA,EACPC,OAAQA,EACRC,KAAMA,EACNC,YAAaA,IAEhBgB,SAEAd,GACO,IAGd,CACEe,YAlGiB,UAmGjBtC,MAAOuC,MAAAA,QAGX,CACEC,UAAWJ,iBAAAA"}
@@ -1,2 +1,2 @@
1
- import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{deepmerge}from'../../shared/utils/misc.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:S,loading:f,badge:C,caption:g,captionProps:j,title:v,titleProps:E,content:M,contentProps:N,controlsDirection:h,media:w,footer:X,controls:u,...A}=o;return jsx(Tooltip,{...A,preset:"brand",ref:e,styles:deepmerge({arrow:{spread:20,length:12}},s),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:S,loading:f,badge:C,caption:g,captionProps:j,title:v,titleProps:E,content:M,contentProps:N,controlsDirection:h,media:w,footer:X,controls:u})})})),{displayName:"Popover",sizes:o=>o.orientation==='landscape'?SIZES_LANDSCAPE:SIZES}),{Component:PopoverComponent});export{COMPONENT_NAME,Popover};
1
+ import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{deepmerge}from'../../shared/utils/misc.mjs';import{SIZES}from'./sizes.mjs';import{jsx}from'react/jsx-runtime';import{PopoverComponent}from'../PopoverComponent/PopoverComponent.mjs';import{Tooltip}from'../Tooltip/Tooltip.mjs';const Popover=Object.assign(withMergedProps(forwardRef(((o,e)=>{const{size:t="s",styles:r={},palette:i={},sizeXXS:s,sizeXS:a,sizeS:p,sizeM:l,sizeL:n,sizeXL:m,sizes:c,sizeUnits:d,layout:z,layoutXXS:u,layoutXS:S,layoutS:g,layoutM:y,layoutL:X,layoutXL:f,imgSrcVertical:P,imgSrcHorizontal:j,loading:h,badge:b,caption:v,header:C,title:L,content:M,body:w,media:x,footer:T,root:k,closeButton:B,position:E,trigger:H,...I}=o;return jsx(Tooltip,{...I,preset:"brand",ref:e,placement:E,styles:deepmerge({arrow:{spread:20,length:12}},r),palette:{backgroundColor:i.backgroundColor},component:jsx(PopoverComponent,{size:t,sizeXXS:s,sizeXS:a,sizeS:p,sizeM:l,sizeL:n,sizeXL:m,sizes:c,sizeUnits:d,layout:z,layoutXXS:u,layoutXS:S,layoutS:g,layoutM:y,layoutL:X,layoutXL:f,imgSrcVertical:P,imgSrcHorizontal:j,palette:i,loading:h,badge:b,caption:v,header:C,title:L,content:M,body:w,media:x,footer:T,root:k,closeButton:B}),children:H})})),{displayName:'Popover',sizes:SIZES}),{Component:PopoverComponent});export{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 { withMergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent, SIZES_LANDSCAPE, SIZES } from 'components/PopoverComponent'\nimport { deepmerge } from 'shared/utils/misc'\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={deepmerge({ arrow: { spread: 20, length: 12 } }, styles)}\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","deepmerge","arrow","spread","length","component","PopoverComponent","displayName","SIZES_LANDSCAPE","SIZES","Component"],"mappings":"wWAOMA,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,UAAU,CAAEC,MAAO,CAAEC,OAAQ,GAAIC,OAAQ,KAAQhC,GACzDiC,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,YAzFiB,UA0FjB5B,MAAQV,GACCA,EAAMe,cAAgB,YAAcwB,gBAAkBC,QAInE,CACEC,UAAWJ"}
1
+ {"version":3,"file":"Popover.mjs","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent } from 'components/PopoverComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { SIZES } from './sizes'\nimport type { PopoverProps } from './types'\n\nconst COMPONENT_NAME = 'Popover'\n\n/**\n *\n * Компонент для отображения контента поверх основного интерфейса.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<div\\> элемента.\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 palette = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n imgSrcVertical,\n imgSrcHorizontal,\n loading,\n badge,\n caption,\n header,\n title,\n content,\n body,\n media,\n footer,\n root,\n closeButton,\n position,\n trigger,\n ...restProps\n } = props\n\n return (\n <Tooltip\n {...restProps}\n preset='brand'\n ref={ref}\n placement={position}\n styles={deepmerge({ arrow: { spread: 20, length: 12 } }, styles)}\n palette={{\n backgroundColor: palette.backgroundColor,\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 layout={layout}\n layoutXXS={layoutXXS}\n layoutXS={layoutXS}\n layoutS={layoutS}\n layoutM={layoutM}\n layoutL={layoutL}\n layoutXL={layoutXL}\n imgSrcVertical={imgSrcVertical}\n imgSrcHorizontal={imgSrcHorizontal}\n palette={palette}\n loading={loading}\n badge={badge}\n caption={caption}\n header={header}\n title={title}\n content={content}\n body={body}\n media={media}\n footer={footer}\n root={root}\n closeButton={closeButton}\n />\n }\n >\n {trigger}\n </Tooltip>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: PopoverComponent,\n }\n)\n\nexport { Popover }\n"],"names":["Popover","Object","assign","withMergedProps","forwardRef","props","ref","size","styles","palette","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","layout","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","imgSrcVertical","imgSrcHorizontal","loading","badge","caption","header","title","content","body","media","footer","root","closeButton","position","trigger","restProps","_jsx","Tooltip","preset","placement","deepmerge","arrow","spread","length","backgroundColor","component","PopoverComponent","children","displayName","SIZES","Component"],"mappings":"kUAgBA,MAAMA,QAAkGC,OAAOC,OAC7GC,gBACEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,CAAE,EAAAC,QACXA,EAAU,CAAE,EAAAC,QACZA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,eACRA,EAAcC,iBACdA,EAAgBC,QAChBA,EAAOC,MACPA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,QACLA,EAAOC,KACPA,EAAIC,MACJA,EAAKC,OACLA,EAAMC,KACNA,EAAIC,YACJA,EAAWC,SACXA,EAAQC,QACRA,KACGC,GACDnC,EAEJ,OACEoC,IAACC,QAAO,IACFF,EACJG,OAAO,QACPrC,IAAKA,EACLsC,UAAWN,EACX9B,OAAQqC,UAAU,CAAEC,MAAO,CAAEC,OAAQ,GAAIC,OAAQ,KAAQxC,GACzDC,QAAS,CACPwC,gBAAiBxC,EAAQwC,iBAE3BC,UACET,IAACU,iBAAgB,CACf5C,KAAMA,EACNG,QAASA,EACTC,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,EACRC,MAAOA,EACPC,UAAWA,EACXC,OAAQA,EACRC,UAAWA,EACXC,SAAUA,EACVC,QAASA,EACTC,QAASA,EACTC,QAASA,EACTC,SAAUA,EACVC,eAAgBA,EAChBC,iBAAkBA,EAClBjB,QAASA,EACTkB,QAASA,EACTC,MAAOA,EACPC,QAASA,EACTC,OAAQA,EACRC,MAAOA,EACPC,QAASA,EACTC,KAAMA,EACNC,MAAOA,EACPC,OAAQA,EACRC,KAAMA,EACNC,YAAaA,IAEhBe,SAEAb,GACO,IAGd,CACEc,YAlGiB,UAmGjBrC,MAAOsC,QAGX,CACEC,UAAWJ"}
@@ -0,0 +1,2 @@
1
+ 'use strict';var sizes=require('../PopoverComponent/sizes.js');const SIZES={xl:{...sizes.SIZES.xl,width:'100vw'},l:{...sizes.SIZES.l,width:'100vw'},m:{...sizes.SIZES.m,width:'100vw'},s:{...sizes.SIZES.s,width:'100vw'},xs:{...sizes.SIZES.xs,width:'100vw'}};exports.SIZES=SIZES;
2
+ //# sourceMappingURL=sizes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sizes.js","sources":["../../../../src/components/Popover/sizes.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES as SIZES_POPOVER_COMPONENT } from 'components/PopoverComponent'\nimport type { Size } from './types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xl: { ...SIZES_POPOVER_COMPONENT.xl, width: '100vw' },\n l: { ...SIZES_POPOVER_COMPONENT.l, width: '100vw' },\n m: { ...SIZES_POPOVER_COMPONENT.m, width: '100vw' },\n s: { ...SIZES_POPOVER_COMPONENT.s, width: '100vw' },\n xs: { ...SIZES_POPOVER_COMPONENT.xs, width: '100vw' },\n}\n"],"names":["SIZES","xl","SIZES_POPOVER_COMPONENT","width","l","m","s","xs"],"mappings":"+DAIO,MAAMA,MAAqC,CAChDC,GAAI,IAAKC,MAAuBF,MAACC,GAAIE,MAAO,SAC5CC,EAAG,IAAKF,MAAuBF,MAACI,EAAGD,MAAO,SAC1CE,EAAG,IAAKH,MAAuBF,MAACK,EAAGF,MAAO,SAC1CG,EAAG,IAAKJ,MAAuBF,MAACM,EAAGH,MAAO,SAC1CI,GAAI,IAAKL,MAAuBF,MAACO,GAAIJ,MAAO"}
@@ -0,0 +1,2 @@
1
+ import{SIZES as SIZES$1}from'../PopoverComponent/sizes.mjs';const SIZES={xl:{...SIZES$1.xl,width:'100vw'},l:{...SIZES$1.l,width:'100vw'},m:{...SIZES$1.m,width:'100vw'},s:{...SIZES$1.s,width:'100vw'},xs:{...SIZES$1.xs,width:'100vw'}};export{SIZES};
2
+ //# sourceMappingURL=sizes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sizes.mjs","sources":["../../../../src/components/Popover/sizes.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES as SIZES_POPOVER_COMPONENT } from 'components/PopoverComponent'\nimport type { Size } from './types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xl: { ...SIZES_POPOVER_COMPONENT.xl, width: '100vw' },\n l: { ...SIZES_POPOVER_COMPONENT.l, width: '100vw' },\n m: { ...SIZES_POPOVER_COMPONENT.m, width: '100vw' },\n s: { ...SIZES_POPOVER_COMPONENT.s, width: '100vw' },\n xs: { ...SIZES_POPOVER_COMPONENT.xs, width: '100vw' },\n}\n"],"names":["SIZES","xl","SIZES_POPOVER_COMPONENT","width","l","m","s","xs"],"mappings":"4DAIO,MAAMA,MAAqC,CAChDC,GAAI,IAAKC,QAAwBD,GAAIE,MAAO,SAC5CC,EAAG,IAAKF,QAAwBE,EAAGD,MAAO,SAC1CE,EAAG,IAAKH,QAAwBG,EAAGF,MAAO,SAC1CG,EAAG,IAAKJ,QAAwBI,EAAGH,MAAO,SAC1CI,GAAI,IAAKL,QAAwBK,GAAIJ,MAAO"}
@@ -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 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;
1
+ 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var sizes=require('./sizes.js');var layouts=require('./layouts.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var AspectRatio=require('../AspectRatio/AspectRatio.js');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",layout:i="vertical",sizeXXS:n,sizeXS:o,sizeS:r,sizeM:a,sizeL:l,sizeXL:u,layoutXXS:c,layoutXS:d,layoutS:x,layoutM:j,layoutL:m,layoutXL:R,root:p,badge:y,caption:S,header:h,title:g,content:z,body:T,closeButton:E,media:f,footer:B,imgSrcVertical:k,imgSrcHorizontal:I,loading:b,palette:w,closeFn:v,...A}=e;const L={size:s,sizeXXS:n,sizeXS:o,sizeS:r,sizeM:a,sizeL:l,sizeXL:u};const X={layout:i,layoutXXS:c,layoutXS:d,layoutS:x,layoutM:j,layoutL:m,layoutXL:R};const P={borderRadius:8,marginRight:12,resetDefaultMargin:!0,sizes:sizes.SIZES_HEADER_BADGE};const V={as:'span',appearance:'caption',color:'content-onmain-tertiary',weight:700,wordBreak:'break-word',sizes:sizes.SIZES_CAPTION};const C={as:'h2',appearance:'subheading',color:'inherit',marginBottom:z?'0.4em':void 0,wordBreak:'break-word',sizes:sizes.SIZES_TITLE};const q={as:'p',appearance:'body',color:'inherit',wordBreak:'break-word',sizes:sizes.SIZES_CONTENT};const _={icon:'close',square:!0,marginTop:10,marginRight:10,sizes:sizes.SIZES_CLOSE_BUTTON,onClick:()=>{typeof v=='function'&&v()}};return jsxRuntime.jsx(style.Root,{...A,...L,...X,layouts:layouts.LAYOUTS,palette:w,ref:t,children:React.isValidElement(p)?p:typeof p=='function'?p({badgeProps:P,captionProps:V,titleProps:C,contentProps:q,closeButtonProps:_}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[(b||f||I)&&jsxRuntime.jsx(style.Media,{...X,layouts:layouts.VISIBILITY_HORIZONTAL,children:b?jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"1:1",width:"100%",children:jsxRuntime.jsx(Skeleton.Skeleton,{})}):React.isValidElement(f)?f:jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"1:1",width:"100%",children:jsxRuntime.jsx(style.Img,{src:I})})}),jsxRuntime.jsxs(style.Container,{children:[jsxRuntime.jsxs(style.Content,{children:[b?jsxRuntime.jsx(style.Header,{children:jsxRuntime.jsx(Skeleton.Skeleton,{width:"20%",children:jsxRuntime.jsx(Badge.Badge,{...L,...P})})}):React.isValidElement(h)?h:y||S?jsxRuntime.jsxs(style.Header,{children:[React.isValidElement(y)?y:typeof y=='function'?y({...L,...P}):typeof y=='string'||typeof y=='number'?jsxRuntime.jsx(Badge.Badge,{...L,...P,children:y}):null,React.isValidElement(S)?S:typeof S=='function'?S({...L,...V}):typeof S=='string'||typeof S=='number'?jsxRuntime.jsx(Text.Text,{...L,...V,children:S}):null]}):null,(b||f||k)&&jsxRuntime.jsx(style.Media,{...X,layouts:layouts.VISIBILITY_VERTICAL,children:b?jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"16:9",width:"100%",children:jsxRuntime.jsx(Skeleton.Skeleton,{})}):React.isValidElement(f)?f:jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"16:9",width:"100%",children:jsxRuntime.jsx(style.Img,{src:k})})}),b?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:4,children:jsxRuntime.jsx(Text.Text,{appearance:"subheading",marginBottom:"0.4em",sizes:sizes.SIZES_TITLE,...L})}),jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:4,width:"70%",children:jsxRuntime.jsx(Text.Text,{appearance:"body",marginBottom:"0.4em",sizes:sizes.SIZES_CONTENT,...L})}),jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:4,width:"50%",children:jsxRuntime.jsx(Text.Text,{appearance:"body",sizes:sizes.SIZES_CONTENT,...L})})]}):React.isValidElement(T)?T:g||z?jsxRuntime.jsxs("div",{children:[React.isValidElement(g)?g:typeof g=='function'?g({...L,...C}):typeof g=='string'||typeof g=='number'?jsxRuntime.jsx(Text.Text,{...L,...C,children:g}):null,React.isValidElement(z)?z:typeof z=='function'?z({...L,...q}):typeof z=='string'||typeof z=='number'?jsxRuntime.jsx(Text.Text,{...L,...q,children:z}):null]}):null]}),B&&jsxRuntime.jsx(style.Footer,{children:b?jsxRuntime.jsx(Skeleton.Skeleton,{width:"100%",children:jsxRuntime.jsx(Button.Button,{preset:"brand",...L})}):React.isValidElement(B)?B:null})]}),E&&jsxRuntime.jsx(style.ButtonPosition,{children:React.isValidElement(E)?E:typeof E=='function'?E({...L,..._}):null})]})})})),{displayName:'PopoverComponent',sizes:sizes.SIZES});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 { 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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AAgB,YAAc0E,UAAAA,gBAAkBC,UAAAA,+GA/P5C"}
1
+ {"version":3,"file":"PopoverComponent.js","sources":["../../../../src/components/PopoverComponent/PopoverComponent.tsx"],"sourcesContent":["import { forwardRef, isValidElement } 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 { AspectRatio } from 'components/AspectRatio'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { BadgeProps } from 'components/Badge'\nimport type { TextProps } from 'components/Text'\nimport { SIZES, SIZES_CLOSE_BUTTON, SIZES_HEADER_BADGE, SIZES_CAPTION, SIZES_TITLE, SIZES_CONTENT } from './sizes'\nimport { LAYOUTS, VISIBILITY_HORIZONTAL, VISIBILITY_VERTICAL } from './layouts'\nimport * as Styled from './style'\nimport type { PopoverComponentProps } from './types'\n\nconst COMPONENT_NAME = 'PopoverComponent'\n\nconst PopoverComponent: React.ForwardRefExoticComponent<PopoverComponentProps> = withMergedProps<\n PopoverComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n layout = 'vertical',\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n root,\n badge,\n caption,\n header,\n title,\n content,\n body,\n closeButton,\n media,\n footer,\n imgSrcVertical,\n imgSrcHorizontal,\n loading,\n palette,\n closeFn,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const badgeBaseProps: BadgeProps = {\n borderRadius: 8,\n marginRight: 12,\n resetDefaultMargin: true,\n sizes: SIZES_HEADER_BADGE,\n }\n\n const captionBaseProps: TextProps = {\n as: 'span',\n appearance: 'caption',\n color: 'content-onmain-tertiary',\n weight: 700,\n wordBreak: 'break-word',\n sizes: SIZES_CAPTION,\n }\n\n const titleBaseProps: TextProps = {\n as: 'h2',\n appearance: 'subheading',\n color: 'inherit',\n marginBottom: content ? '0.4em' : undefined,\n wordBreak: 'break-word',\n sizes: SIZES_TITLE,\n }\n\n const contentBaseProps: TextProps = {\n as: 'p',\n appearance: 'body',\n color: 'inherit',\n wordBreak: 'break-word',\n sizes: SIZES_CONTENT,\n }\n\n const closeButtonBaseProps: IconButtonProps = {\n icon: 'close',\n square: true,\n marginTop: 10,\n marginRight: 10,\n sizes: SIZES_CLOSE_BUTTON,\n onClick: () => {\n if (typeof closeFn === 'function') closeFn()\n },\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} {...layoutProps} layouts={LAYOUTS} palette={palette} ref={ref}>\n {isValidElement(root) ? (\n root\n ) : typeof root === 'function' ? (\n root({\n badgeProps: badgeBaseProps,\n captionProps: captionBaseProps,\n titleProps: titleBaseProps,\n contentProps: contentBaseProps,\n closeButtonProps: closeButtonBaseProps,\n })\n ) : (\n <>\n {(loading || media || imgSrcHorizontal) && (\n <Styled.Media {...layoutProps} layouts={VISIBILITY_HORIZONTAL}>\n {loading ? (\n <AspectRatio ratio='1:1' width='100%'>\n <Skeleton />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='1:1' width='100%'>\n <Styled.Img src={imgSrcHorizontal} />\n </AspectRatio>\n )}\n </Styled.Media>\n )}\n <Styled.Container>\n <Styled.Content>\n {loading ? (\n <Styled.Header>\n <Skeleton width='20%'>\n <Badge {...sizeProps} {...badgeBaseProps} />\n </Skeleton>\n </Styled.Header>\n ) : isValidElement(header) ? (\n header\n ) : badge || caption ? (\n <Styled.Header>\n {isValidElement(badge) ? (\n badge\n ) : typeof badge === 'function' ? (\n badge({\n ...sizeProps,\n ...badgeBaseProps,\n })\n ) : typeof badge === 'string' || typeof badge === 'number' ? (\n <Badge {...sizeProps} {...badgeBaseProps}>\n {badge}\n </Badge>\n ) : null}\n {isValidElement(caption) ? (\n caption\n ) : typeof caption === 'function' ? (\n caption({\n ...sizeProps,\n ...captionBaseProps,\n })\n ) : typeof caption === 'string' || typeof caption === 'number' ? (\n <Text {...sizeProps} {...captionBaseProps}>\n {caption}\n </Text>\n ) : null}\n </Styled.Header>\n ) : null}\n {(loading || media || imgSrcVertical) && (\n <Styled.Media {...layoutProps} layouts={VISIBILITY_VERTICAL}>\n {loading ? (\n <AspectRatio ratio='16:9' width='100%'>\n <Skeleton />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='16:9' width='100%'>\n <Styled.Img src={imgSrcVertical} />\n </AspectRatio>\n )}\n </Styled.Media>\n )}\n {loading ? (\n <div>\n <Skeleton borderRadius={4}>\n <Text appearance='subheading' marginBottom='0.4em' sizes={SIZES_TITLE} {...sizeProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='70%'>\n <Text appearance='body' marginBottom='0.4em' sizes={SIZES_CONTENT} {...sizeProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='50%'>\n <Text appearance='body' sizes={SIZES_CONTENT} {...sizeProps} />\n </Skeleton>\n </div>\n ) : isValidElement(body) ? (\n body\n ) : title || content ? (\n <div>\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title({\n ...sizeProps,\n ...titleBaseProps,\n })\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...sizeProps} {...titleBaseProps}>\n {title}\n </Text>\n ) : null}\n {isValidElement(content) ? (\n content\n ) : typeof content === 'function' ? (\n content({\n ...sizeProps,\n ...contentBaseProps,\n })\n ) : typeof content === 'string' || typeof content === 'number' ? (\n <Text {...sizeProps} {...contentBaseProps}>\n {content}\n </Text>\n ) : null}\n </div>\n ) : null}\n </Styled.Content>\n {footer && (\n <Styled.Footer>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : isValidElement(footer) ? (\n footer\n ) : null}\n </Styled.Footer>\n )}\n </Styled.Container>\n {closeButton && (\n <Styled.ButtonPosition>\n {isValidElement(closeButton)\n ? closeButton\n : typeof closeButton === 'function'\n ? closeButton({\n ...sizeProps,\n ...closeButtonBaseProps,\n })\n : null}\n </Styled.ButtonPosition>\n )}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { PopoverComponent }\n"],"names":["PopoverComponent","withMergedProps","forwardRef","props","ref","size","layout","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","root","badge","caption","header","title","content","body","closeButton","media","footer","imgSrcVertical","imgSrcHorizontal","loading","palette","closeFn","restProps","sizeProps","layoutProps","badgeBaseProps","borderRadius","marginRight","resetDefaultMargin","sizes","SIZES_HEADER_BADGE","captionBaseProps","as","appearance","color","weight","wordBreak","SIZES_CAPTION","titleBaseProps","marginBottom","undefined","SIZES_TITLE","contentBaseProps","SIZES_CONTENT","closeButtonBaseProps","icon","square","marginTop","SIZES_CLOSE_BUTTON","onClick","_jsx","Styled","layouts","LAYOUTS","children","isValidElement","badgeProps","captionProps","titleProps","contentProps","closeButtonProps","_jsxs","jsxs","_Fragment","jsx","VISIBILITY_HORIZONTAL","AspectRatio","ratio","width","Skeleton","src","Badge","Text","VISIBILITY_VERTICAL","Button","preset","displayName","SIZES"],"mappings":"mdAiBMA,MAAAA,iBAA2EC,gBAAAA,gBAI/EC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,WAAUC,QACnBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,KACR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BAoQnB/C,MAAOgD,MAAAA"}
@@ -1,2 +1,2 @@
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};
1
+ import{forwardRef,isValidElement}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{SIZES,SIZES_TITLE,SIZES_CONTENT,SIZES_HEADER_BADGE,SIZES_CAPTION,SIZES_CLOSE_BUTTON}from'./sizes.mjs';import{LAYOUTS,VISIBILITY_HORIZONTAL,VISIBILITY_VERTICAL}from'./layouts.mjs';import{Root,Media,Img,Container,Content,Header,Footer,ButtonPosition}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{AspectRatio}from'../AspectRatio/AspectRatio.mjs';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 PopoverComponent=withMergedProps(forwardRef(((e,t)=>{const{size:o="s",layout:i="vertical",sizeXXS:s,sizeXS:n,sizeS:r,sizeM:a,sizeL:l,sizeXL:d,layoutXXS:c,layoutXS:m,layoutS:p,layoutM:S,layoutL:u,layoutXL:x,root:h,badge:j,caption:E,header:I,title:f,content:y,body:T,closeButton:g,media:B,footer:z,imgSrcVertical:L,imgSrcHorizontal:R,loading:_,palette:b,closeFn:w,...A}=e;const V={size:o,sizeXXS:s,sizeXS:n,sizeS:r,sizeM:a,sizeL:l,sizeXL:d};const C={layout:i,layoutXXS:c,layoutXS:m,layoutS:p,layoutM:S,layoutL:u,layoutXL:x};const k={borderRadius:8,marginRight:12,resetDefaultMargin:!0,sizes:SIZES_HEADER_BADGE};const Z={as:'span',appearance:'caption',color:'content-onmain-tertiary',weight:700,wordBreak:'break-word',sizes:SIZES_CAPTION};const O={as:'h2',appearance:'subheading',color:'inherit',marginBottom:y?'0.4em':void 0,wordBreak:'break-word',sizes:SIZES_TITLE};const X={as:'p',appearance:'body',color:'inherit',wordBreak:'break-word',sizes:SIZES_CONTENT};const N={icon:'close',square:!0,marginTop:10,marginRight:10,sizes:SIZES_CLOSE_BUTTON,onClick:()=>{typeof w=='function'&&w()}};return jsx(Root,{...A,...V,...C,layouts:LAYOUTS,palette:b,ref:t,children:isValidElement(h)?h:typeof h=='function'?h({badgeProps:k,captionProps:Z,titleProps:O,contentProps:X,closeButtonProps:N}):jsxs(Fragment,{children:[(_||B||R)&&jsx(Media,{...C,layouts:VISIBILITY_HORIZONTAL,children:_?jsx(AspectRatio,{ratio:"1:1",width:"100%",children:jsx(Skeleton,{})}):isValidElement(B)?B:jsx(AspectRatio,{ratio:"1:1",width:"100%",children:jsx(Img,{src:R})})}),jsxs(Container,{children:[jsxs(Content,{children:[_?jsx(Header,{children:jsx(Skeleton,{width:"20%",children:jsx(Badge,{...V,...k})})}):isValidElement(I)?I:j||E?jsxs(Header,{children:[isValidElement(j)?j:typeof j=='function'?j({...V,...k}):typeof j=='string'||typeof j=='number'?jsx(Badge,{...V,...k,children:j}):null,isValidElement(E)?E:typeof E=='function'?E({...V,...Z}):typeof E=='string'||typeof E=='number'?jsx(Text,{...V,...Z,children:E}):null]}):null,(_||B||L)&&jsx(Media,{...C,layouts:VISIBILITY_VERTICAL,children:_?jsx(AspectRatio,{ratio:"16:9",width:"100%",children:jsx(Skeleton,{})}):isValidElement(B)?B:jsx(AspectRatio,{ratio:"16:9",width:"100%",children:jsx(Img,{src:L})})}),_?jsxs("div",{children:[jsx(Skeleton,{borderRadius:4,children:jsx(Text,{appearance:"subheading",marginBottom:"0.4em",sizes:SIZES_TITLE,...V})}),jsx(Skeleton,{borderRadius:4,width:"70%",children:jsx(Text,{appearance:"body",marginBottom:"0.4em",sizes:SIZES_CONTENT,...V})}),jsx(Skeleton,{borderRadius:4,width:"50%",children:jsx(Text,{appearance:"body",sizes:SIZES_CONTENT,...V})})]}):isValidElement(T)?T:f||y?jsxs("div",{children:[isValidElement(f)?f:typeof f=='function'?f({...V,...O}):typeof f=='string'||typeof f=='number'?jsx(Text,{...V,...O,children:f}):null,isValidElement(y)?y:typeof y=='function'?y({...V,...X}):typeof y=='string'||typeof y=='number'?jsx(Text,{...V,...X,children:y}):null]}):null]}),z&&jsx(Footer,{children:_?jsx(Skeleton,{width:"100%",children:jsx(Button,{preset:"brand",...V})}):isValidElement(z)?z:null})]}),g&&jsx(ButtonPosition,{children:isValidElement(g)?g:typeof g=='function'?g({...V,...N}):null})]})})})),{displayName:'PopoverComponent',sizes:SIZES});export{PopoverComponent};
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 { 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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,WAAW,aACXC,MAAM,UACNI,aAAc5C,EAAU,aAAU+C,EAClCL,MAAOG,eACHvC,KACApB,EAAUkC,SAEbrB,IAGJC,GACCqB,IAACgB,KAAI,CACHC,GAAG,IACHC,WAAW,OACXC,MAAM,UACNE,MAAOI,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
+ {"version":3,"file":"PopoverComponent.mjs","sources":["../../../../src/components/PopoverComponent/PopoverComponent.tsx"],"sourcesContent":["import { forwardRef, isValidElement } 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 { AspectRatio } from 'components/AspectRatio'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { BadgeProps } from 'components/Badge'\nimport type { TextProps } from 'components/Text'\nimport { SIZES, SIZES_CLOSE_BUTTON, SIZES_HEADER_BADGE, SIZES_CAPTION, SIZES_TITLE, SIZES_CONTENT } from './sizes'\nimport { LAYOUTS, VISIBILITY_HORIZONTAL, VISIBILITY_VERTICAL } from './layouts'\nimport * as Styled from './style'\nimport type { PopoverComponentProps } from './types'\n\nconst COMPONENT_NAME = 'PopoverComponent'\n\nconst PopoverComponent: React.ForwardRefExoticComponent<PopoverComponentProps> = withMergedProps<\n PopoverComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n layout = 'vertical',\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n root,\n badge,\n caption,\n header,\n title,\n content,\n body,\n closeButton,\n media,\n footer,\n imgSrcVertical,\n imgSrcHorizontal,\n loading,\n palette,\n closeFn,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const badgeBaseProps: BadgeProps = {\n borderRadius: 8,\n marginRight: 12,\n resetDefaultMargin: true,\n sizes: SIZES_HEADER_BADGE,\n }\n\n const captionBaseProps: TextProps = {\n as: 'span',\n appearance: 'caption',\n color: 'content-onmain-tertiary',\n weight: 700,\n wordBreak: 'break-word',\n sizes: SIZES_CAPTION,\n }\n\n const titleBaseProps: TextProps = {\n as: 'h2',\n appearance: 'subheading',\n color: 'inherit',\n marginBottom: content ? '0.4em' : undefined,\n wordBreak: 'break-word',\n sizes: SIZES_TITLE,\n }\n\n const contentBaseProps: TextProps = {\n as: 'p',\n appearance: 'body',\n color: 'inherit',\n wordBreak: 'break-word',\n sizes: SIZES_CONTENT,\n }\n\n const closeButtonBaseProps: IconButtonProps = {\n icon: 'close',\n square: true,\n marginTop: 10,\n marginRight: 10,\n sizes: SIZES_CLOSE_BUTTON,\n onClick: () => {\n if (typeof closeFn === 'function') closeFn()\n },\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} {...layoutProps} layouts={LAYOUTS} palette={palette} ref={ref}>\n {isValidElement(root) ? (\n root\n ) : typeof root === 'function' ? (\n root({\n badgeProps: badgeBaseProps,\n captionProps: captionBaseProps,\n titleProps: titleBaseProps,\n contentProps: contentBaseProps,\n closeButtonProps: closeButtonBaseProps,\n })\n ) : (\n <>\n {(loading || media || imgSrcHorizontal) && (\n <Styled.Media {...layoutProps} layouts={VISIBILITY_HORIZONTAL}>\n {loading ? (\n <AspectRatio ratio='1:1' width='100%'>\n <Skeleton />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='1:1' width='100%'>\n <Styled.Img src={imgSrcHorizontal} />\n </AspectRatio>\n )}\n </Styled.Media>\n )}\n <Styled.Container>\n <Styled.Content>\n {loading ? (\n <Styled.Header>\n <Skeleton width='20%'>\n <Badge {...sizeProps} {...badgeBaseProps} />\n </Skeleton>\n </Styled.Header>\n ) : isValidElement(header) ? (\n header\n ) : badge || caption ? (\n <Styled.Header>\n {isValidElement(badge) ? (\n badge\n ) : typeof badge === 'function' ? (\n badge({\n ...sizeProps,\n ...badgeBaseProps,\n })\n ) : typeof badge === 'string' || typeof badge === 'number' ? (\n <Badge {...sizeProps} {...badgeBaseProps}>\n {badge}\n </Badge>\n ) : null}\n {isValidElement(caption) ? (\n caption\n ) : typeof caption === 'function' ? (\n caption({\n ...sizeProps,\n ...captionBaseProps,\n })\n ) : typeof caption === 'string' || typeof caption === 'number' ? (\n <Text {...sizeProps} {...captionBaseProps}>\n {caption}\n </Text>\n ) : null}\n </Styled.Header>\n ) : null}\n {(loading || media || imgSrcVertical) && (\n <Styled.Media {...layoutProps} layouts={VISIBILITY_VERTICAL}>\n {loading ? (\n <AspectRatio ratio='16:9' width='100%'>\n <Skeleton />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='16:9' width='100%'>\n <Styled.Img src={imgSrcVertical} />\n </AspectRatio>\n )}\n </Styled.Media>\n )}\n {loading ? (\n <div>\n <Skeleton borderRadius={4}>\n <Text appearance='subheading' marginBottom='0.4em' sizes={SIZES_TITLE} {...sizeProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='70%'>\n <Text appearance='body' marginBottom='0.4em' sizes={SIZES_CONTENT} {...sizeProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='50%'>\n <Text appearance='body' sizes={SIZES_CONTENT} {...sizeProps} />\n </Skeleton>\n </div>\n ) : isValidElement(body) ? (\n body\n ) : title || content ? (\n <div>\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title({\n ...sizeProps,\n ...titleBaseProps,\n })\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...sizeProps} {...titleBaseProps}>\n {title}\n </Text>\n ) : null}\n {isValidElement(content) ? (\n content\n ) : typeof content === 'function' ? (\n content({\n ...sizeProps,\n ...contentBaseProps,\n })\n ) : typeof content === 'string' || typeof content === 'number' ? (\n <Text {...sizeProps} {...contentBaseProps}>\n {content}\n </Text>\n ) : null}\n </div>\n ) : null}\n </Styled.Content>\n {footer && (\n <Styled.Footer>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : isValidElement(footer) ? (\n footer\n ) : null}\n </Styled.Footer>\n )}\n </Styled.Container>\n {closeButton && (\n <Styled.ButtonPosition>\n {isValidElement(closeButton)\n ? closeButton\n : typeof closeButton === 'function'\n ? closeButton({\n ...sizeProps,\n ...closeButtonBaseProps,\n })\n : null}\n </Styled.ButtonPosition>\n )}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { PopoverComponent }\n"],"names":["PopoverComponent","withMergedProps","forwardRef","props","ref","size","layout","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","root","badge","caption","header","title","content","body","closeButton","media","footer","imgSrcVertical","imgSrcHorizontal","loading","palette","closeFn","restProps","sizeProps","layoutProps","badgeBaseProps","borderRadius","marginRight","resetDefaultMargin","sizes","SIZES_HEADER_BADGE","captionBaseProps","as","appearance","color","weight","wordBreak","SIZES_CAPTION","titleBaseProps","marginBottom","undefined","SIZES_TITLE","contentBaseProps","SIZES_CONTENT","closeButtonBaseProps","icon","square","marginTop","SIZES_CLOSE_BUTTON","onClick","_jsx","Styled","layouts","LAYOUTS","children","isValidElement","badgeProps","captionProps","titleProps","contentProps","closeButtonProps","_jsxs","_Fragment","VISIBILITY_HORIZONTAL","AspectRatio","ratio","width","Skeleton","src","Badge","Text","VISIBILITY_VERTICAL","Button","preset","displayName","SIZES"],"mappings":"ooBAiBMA,MAAAA,iBAA2EC,gBAI/EC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,WAAUC,QACnBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,KACRA,EAAIC,MACJA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,QACLA,EAAOC,KACPA,EAAIC,YACJA,EAAWC,MACXA,EAAKC,OACLA,EAAMC,eACNA,EAAcC,iBACdA,EAAgBC,QAChBA,EAAOC,QACPA,EAAOC,QACPA,KACGC,GACD/B,EAEJ,MAAMgC,EAAY,CAChB9B,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMwB,EAAc,CAClB9B,SACAO,YACAC,WACAC,UACAC,UACAC,UACAC,YAGF,MAAMmB,EAA6B,CACjCC,aAAc,EACdC,YAAa,GACbC,oBAAoB,EACpBC,MAAOC,oBAG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,WAEI9B,GAAY,iBAAmBA,GAAY,SACpDsC,IAACoB,KAAI,IAAK/C,KAAemB,EAAgBY,SACtC1C,IAED,QAEJ,QAELI,GACCkC,IAACC,OAAa,CAAAG,SACXnC,EACC+B,IAACiB,SAAQ,CAACD,MAAM,OAAMZ,SACpBJ,IAACsB,OAAM,CAACC,OAAO,WAAYlD,MAE3BgC,eAAevC,GACjBA,EACE,UAITF,GACCoC,IAACC,eAAqB,CAAAG,SACnBC,eAAezC,GACZA,SACOA,GAAgB,WACvBA,EAAY,IACPS,KACAqB,IAEL,WAKA,IAGlB,CACE8B,YAnQmB,mBAoQnB7C,MAAO8C"}
@@ -0,0 +1,2 @@
1
+ 'use strict';exports.LAYOUTS={vertical:{display:'grid',gridTemplateColumns:'1fr'},horizontal:{display:'grid',gridTemplateColumns:'repeat(auto-fit, minmax(40%, 1fr))'}},exports.VISIBILITY_HORIZONTAL={vertical:{display:'none'},horizontal:{display:'block'}},exports.VISIBILITY_VERTICAL={vertical:{display:'block'},horizontal:{display:'none'}};
2
+ //# sourceMappingURL=layouts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layouts.js","sources":["../../../../src/components/PopoverComponent/layouts.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Layout } from './types'\n\nexport const LAYOUTS: Record<Layout, CSSProperties> = {\n vertical: {\n display: 'grid',\n gridTemplateColumns: '1fr',\n },\n horizontal: {\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fit, minmax(40%, 1fr))',\n },\n}\n\nexport const VISIBILITY_HORIZONTAL: Record<Layout, CSSProperties> = {\n vertical: { display: 'none' },\n horizontal: { display: 'block' },\n}\n\nexport const VISIBILITY_VERTICAL: Record<Layout, CSSProperties> = {\n vertical: { display: 'block' },\n horizontal: { display: 'none' },\n}\n"],"names":["vertical","display","gridTemplateColumns","horizontal"],"mappings":"6BAGsD,CACpDA,SAAU,CACRC,QAAS,OACTC,oBAAqB,OAEvBC,WAAY,CACVF,QAAS,OACTC,oBAAqB,qEAI2C,CAClEF,SAAU,CAAEC,QAAS,QACrBE,WAAY,CAAEF,QAAS,sCAGyC,CAChED,SAAU,CAAEC,QAAS,SACrBE,WAAY,CAAEF,QAAS"}
@@ -0,0 +1,2 @@
1
+ const LAYOUTS={vertical:{display:'grid',gridTemplateColumns:'1fr'},horizontal:{display:'grid',gridTemplateColumns:'repeat(auto-fit, minmax(40%, 1fr))'}};const VISIBILITY_HORIZONTAL={vertical:{display:'none'},horizontal:{display:'block'}};const VISIBILITY_VERTICAL={vertical:{display:'block'},horizontal:{display:'none'}};export{LAYOUTS,VISIBILITY_HORIZONTAL,VISIBILITY_VERTICAL};
2
+ //# sourceMappingURL=layouts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layouts.mjs","sources":["../../../../src/components/PopoverComponent/layouts.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Layout } from './types'\n\nexport const LAYOUTS: Record<Layout, CSSProperties> = {\n vertical: {\n display: 'grid',\n gridTemplateColumns: '1fr',\n },\n horizontal: {\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fit, minmax(40%, 1fr))',\n },\n}\n\nexport const VISIBILITY_HORIZONTAL: Record<Layout, CSSProperties> = {\n vertical: { display: 'none' },\n horizontal: { display: 'block' },\n}\n\nexport const VISIBILITY_VERTICAL: Record<Layout, CSSProperties> = {\n vertical: { display: 'block' },\n horizontal: { display: 'none' },\n}\n"],"names":["LAYOUTS","vertical","display","gridTemplateColumns","horizontal","VISIBILITY_HORIZONTAL","VISIBILITY_VERTICAL"],"mappings":"AAGO,MAAMA,QAAyC,CACpDC,SAAU,CACRC,QAAS,OACTC,oBAAqB,OAEvBC,WAAY,CACVF,QAAS,OACTC,oBAAqB,uCAIlB,MAAME,sBAAuD,CAClEJ,SAAU,CAAEC,QAAS,QACrBE,WAAY,CAAEF,QAAS,UAGlB,MAAMI,oBAAqD,CAChEL,SAAU,CAAEC,QAAS,SACrBE,WAAY,CAAEF,QAAS"}
@@ -0,0 +1,2 @@
1
+ 'use strict';var constants=require('../IconButton/constants.js');var constants$1=require('../Badge/constants.js');const SIZES_CLOSE_BUTTON={xl:{...constants.SIZES_SQUARE.xxl},l:{...constants.SIZES_SQUARE.xl},m:{...constants.SIZES_SQUARE.xl},s:{...constants.SIZES_SQUARE.l},xs:{...constants.SIZES_SQUARE.l}};const SIZES_HEADER_BADGE={xl:{...constants$1.SIZES.l},l:{...constants$1.SIZES.l},m:{...constants$1.SIZES.m},s:{...constants$1.SIZES.m},xs:{...constants$1.SIZES.m}};exports.SIZES={xl:{display:'grid',gridTemplateColumns:'1fr',maxWidth:560,minWidth:'min-content',minHeight:60,gap:32,padding:32,borderRadius:16},l:{display:'grid',gridTemplateColumns:'1fr',maxWidth:456,minWidth:'min-content',minHeight:60,gap:24,padding:24,borderRadius:16},m:{display:'grid',gridTemplateColumns:'1fr',maxWidth:352,minWidth:'min-content',minHeight:60,gap:24,padding:24,borderRadius:16},s:{display:'grid',gridTemplateColumns:'1fr',maxWidth:288,minWidth:'min-content',minHeight:60,gap:20,padding:20,borderRadius:14},xs:{display:'grid',gridTemplateColumns:'1fr',maxWidth:224,minWidth:'min-content',minHeight:60,gap:20,padding:20,borderRadius:14}},exports.SIZES_CAPTION={xl:{fontSize:16},l:{fontSize:16},m:{fontSize:14},s:{fontSize:14},xs:{fontSize:14}},exports.SIZES_CLOSE_BUTTON=SIZES_CLOSE_BUTTON,exports.SIZES_CONTENT={xl:{fontSize:20},l:{fontSize:18},m:{fontSize:16},s:{fontSize:16},xs:{fontSize:14}},exports.SIZES_HEADER_BADGE=SIZES_HEADER_BADGE,exports.SIZES_TITLE={xl:{fontSize:28},l:{fontSize:24},m:{fontSize:20},s:{fontSize:18},xs:{fontSize:16}};
2
+ //# sourceMappingURL=sizes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sizes.js","sources":["../../../../src/components/PopoverComponent/sizes.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES_SQUARE as SIZES_ICON_BUTTON } from 'components/IconButton'\nimport { SIZES as SIZES_BADGE } from 'components/Badge'\nimport type { Size } from './types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xl: {\n display: 'grid',\n gridTemplateColumns: '1fr',\n maxWidth: 560,\n minWidth: 'min-content',\n minHeight: 60,\n gap: 32,\n padding: 32,\n borderRadius: 16,\n },\n l: {\n display: 'grid',\n gridTemplateColumns: '1fr',\n maxWidth: 456,\n minWidth: 'min-content',\n minHeight: 60,\n gap: 24,\n padding: 24,\n borderRadius: 16,\n },\n m: {\n display: 'grid',\n gridTemplateColumns: '1fr',\n maxWidth: 352,\n minWidth: 'min-content',\n minHeight: 60,\n gap: 24,\n padding: 24,\n borderRadius: 16,\n },\n s: {\n display: 'grid',\n gridTemplateColumns: '1fr',\n maxWidth: 288,\n minWidth: 'min-content',\n minHeight: 60,\n gap: 20,\n padding: 20,\n borderRadius: 14,\n },\n xs: {\n display: 'grid',\n gridTemplateColumns: '1fr',\n maxWidth: 224,\n minWidth: 'min-content',\n minHeight: 60,\n gap: 20,\n padding: 20,\n borderRadius: 14,\n },\n}\n\nexport const SIZES_CLOSE_BUTTON: Record<Size, CSSProperties> = {\n xl: { ...SIZES_ICON_BUTTON.xxl },\n l: { ...SIZES_ICON_BUTTON.xl },\n m: { ...SIZES_ICON_BUTTON.xl },\n s: { ...SIZES_ICON_BUTTON.l },\n xs: { ...SIZES_ICON_BUTTON.l },\n}\n\nexport const SIZES_HEADER_BADGE: Record<Size, CSSProperties> = {\n xl: { ...SIZES_BADGE.l },\n l: { ...SIZES_BADGE.l },\n m: { ...SIZES_BADGE.m },\n s: { ...SIZES_BADGE.m },\n xs: { ...SIZES_BADGE.m },\n}\n\nexport const SIZES_CAPTION: Record<Size, CSSProperties> = {\n xl: { fontSize: 16 },\n l: { fontSize: 16 },\n m: { fontSize: 14 },\n s: { fontSize: 14 },\n xs: { fontSize: 14 },\n}\n\nexport const SIZES_TITLE: Record<Size, CSSProperties> = {\n xl: { fontSize: 28 },\n l: { fontSize: 24 },\n m: { fontSize: 20 },\n s: { fontSize: 18 },\n xs: { fontSize: 16 },\n}\n\nexport const SIZES_CONTENT: Record<Size, CSSProperties> = {\n xl: { fontSize: 20 },\n l: { fontSize: 18 },\n m: { fontSize: 16 },\n s: { fontSize: 16 },\n xs: { fontSize: 14 },\n}\n"],"names":["SIZES_CLOSE_BUTTON","xl","SIZES_ICON_BUTTON","SIZES_SQUARE","xxl","l","m","s","xs","SIZES_HEADER_BADGE","SIZES_BADGE","SIZES","display","gridTemplateColumns","maxWidth","minWidth","minHeight","gap","padding","borderRadius","fontSize"],"mappings":"kHA0DO,MAAMA,mBAAkD,CAC7DC,GAAI,IAAKC,UAAiBC,aAACC,KAC3BC,EAAG,IAAKH,UAAiBC,aAACF,IAC1BK,EAAG,IAAKJ,UAAiBC,aAACF,IAC1BM,EAAG,IAAKL,UAAiBC,aAACE,GAC1BG,GAAI,IAAKN,UAAiBC,aAACE,IAGtB,MAAMI,mBAAkD,CAC7DR,GAAI,IAAKS,YAAWC,MAACN,GACrBA,EAAG,IAAKK,YAAWC,MAACN,GACpBC,EAAG,IAAKI,YAAWC,MAACL,GACpBC,EAAG,IAAKG,YAAWC,MAACL,GACpBE,GAAI,IAAKE,YAAWC,MAACL,kBAlE2B,CAChDL,GAAI,CACFW,QAAS,OACTC,oBAAqB,MACrBC,SAAU,IACVC,SAAU,cACVC,UAAW,GACXC,IAAK,GACLC,QAAS,GACTC,aAAc,IAEhBd,EAAG,CACDO,QAAS,OACTC,oBAAqB,MACrBC,SAAU,IACVC,SAAU,cACVC,UAAW,GACXC,IAAK,GACLC,QAAS,GACTC,aAAc,IAEhBb,EAAG,CACDM,QAAS,OACTC,oBAAqB,MACrBC,SAAU,IACVC,SAAU,cACVC,UAAW,GACXC,IAAK,GACLC,QAAS,GACTC,aAAc,IAEhBZ,EAAG,CACDK,QAAS,OACTC,oBAAqB,MACrBC,SAAU,IACVC,SAAU,cACVC,UAAW,GACXC,IAAK,GACLC,QAAS,GACTC,aAAc,IAEhBX,GAAI,CACFI,QAAS,OACTC,oBAAqB,MACrBC,SAAU,IACVC,SAAU,cACVC,UAAW,GACXC,IAAK,GACLC,QAAS,GACTC,aAAc,2BAoBwC,CACxDlB,GAAI,CAAEmB,SAAU,IAChBf,EAAG,CAAEe,SAAU,IACfd,EAAG,CAAEc,SAAU,IACfb,EAAG,CAAEa,SAAU,IACfZ,GAAI,CAAEY,SAAU,yEAWwC,CACxDnB,GAAI,CAAEmB,SAAU,IAChBf,EAAG,CAAEe,SAAU,IACfd,EAAG,CAAEc,SAAU,IACfb,EAAG,CAAEa,SAAU,IACfZ,GAAI,CAAEY,SAAU,uEAbsC,CACtDnB,GAAI,CAAEmB,SAAU,IAChBf,EAAG,CAAEe,SAAU,IACfd,EAAG,CAAEc,SAAU,IACfb,EAAG,CAAEa,SAAU,IACfZ,GAAI,CAAEY,SAAU"}
@@ -0,0 +1,2 @@
1
+ import{SIZES_SQUARE}from'../IconButton/constants.mjs';import{SIZES as SIZES$1}from'../Badge/constants.mjs';const SIZES={xl:{display:'grid',gridTemplateColumns:'1fr',maxWidth:560,minWidth:'min-content',minHeight:60,gap:32,padding:32,borderRadius:16},l:{display:'grid',gridTemplateColumns:'1fr',maxWidth:456,minWidth:'min-content',minHeight:60,gap:24,padding:24,borderRadius:16},m:{display:'grid',gridTemplateColumns:'1fr',maxWidth:352,minWidth:'min-content',minHeight:60,gap:24,padding:24,borderRadius:16},s:{display:'grid',gridTemplateColumns:'1fr',maxWidth:288,minWidth:'min-content',minHeight:60,gap:20,padding:20,borderRadius:14},xs:{display:'grid',gridTemplateColumns:'1fr',maxWidth:224,minWidth:'min-content',minHeight:60,gap:20,padding:20,borderRadius:14}};const SIZES_CLOSE_BUTTON={xl:{...SIZES_SQUARE.xxl},l:{...SIZES_SQUARE.xl},m:{...SIZES_SQUARE.xl},s:{...SIZES_SQUARE.l},xs:{...SIZES_SQUARE.l}};const SIZES_HEADER_BADGE={xl:{...SIZES$1.l},l:{...SIZES$1.l},m:{...SIZES$1.m},s:{...SIZES$1.m},xs:{...SIZES$1.m}};const SIZES_CAPTION={xl:{fontSize:16},l:{fontSize:16},m:{fontSize:14},s:{fontSize:14},xs:{fontSize:14}};const SIZES_TITLE={xl:{fontSize:28},l:{fontSize:24},m:{fontSize:20},s:{fontSize:18},xs:{fontSize:16}};const SIZES_CONTENT={xl:{fontSize:20},l:{fontSize:18},m:{fontSize:16},s:{fontSize:16},xs:{fontSize:14}};export{SIZES,SIZES_CAPTION,SIZES_CLOSE_BUTTON,SIZES_CONTENT,SIZES_HEADER_BADGE,SIZES_TITLE};
2
+ //# sourceMappingURL=sizes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sizes.mjs","sources":["../../../../src/components/PopoverComponent/sizes.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES_SQUARE as SIZES_ICON_BUTTON } from 'components/IconButton'\nimport { SIZES as SIZES_BADGE } from 'components/Badge'\nimport type { Size } from './types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xl: {\n display: 'grid',\n gridTemplateColumns: '1fr',\n maxWidth: 560,\n minWidth: 'min-content',\n minHeight: 60,\n gap: 32,\n padding: 32,\n borderRadius: 16,\n },\n l: {\n display: 'grid',\n gridTemplateColumns: '1fr',\n maxWidth: 456,\n minWidth: 'min-content',\n minHeight: 60,\n gap: 24,\n padding: 24,\n borderRadius: 16,\n },\n m: {\n display: 'grid',\n gridTemplateColumns: '1fr',\n maxWidth: 352,\n minWidth: 'min-content',\n minHeight: 60,\n gap: 24,\n padding: 24,\n borderRadius: 16,\n },\n s: {\n display: 'grid',\n gridTemplateColumns: '1fr',\n maxWidth: 288,\n minWidth: 'min-content',\n minHeight: 60,\n gap: 20,\n padding: 20,\n borderRadius: 14,\n },\n xs: {\n display: 'grid',\n gridTemplateColumns: '1fr',\n maxWidth: 224,\n minWidth: 'min-content',\n minHeight: 60,\n gap: 20,\n padding: 20,\n borderRadius: 14,\n },\n}\n\nexport const SIZES_CLOSE_BUTTON: Record<Size, CSSProperties> = {\n xl: { ...SIZES_ICON_BUTTON.xxl },\n l: { ...SIZES_ICON_BUTTON.xl },\n m: { ...SIZES_ICON_BUTTON.xl },\n s: { ...SIZES_ICON_BUTTON.l },\n xs: { ...SIZES_ICON_BUTTON.l },\n}\n\nexport const SIZES_HEADER_BADGE: Record<Size, CSSProperties> = {\n xl: { ...SIZES_BADGE.l },\n l: { ...SIZES_BADGE.l },\n m: { ...SIZES_BADGE.m },\n s: { ...SIZES_BADGE.m },\n xs: { ...SIZES_BADGE.m },\n}\n\nexport const SIZES_CAPTION: Record<Size, CSSProperties> = {\n xl: { fontSize: 16 },\n l: { fontSize: 16 },\n m: { fontSize: 14 },\n s: { fontSize: 14 },\n xs: { fontSize: 14 },\n}\n\nexport const SIZES_TITLE: Record<Size, CSSProperties> = {\n xl: { fontSize: 28 },\n l: { fontSize: 24 },\n m: { fontSize: 20 },\n s: { fontSize: 18 },\n xs: { fontSize: 16 },\n}\n\nexport const SIZES_CONTENT: Record<Size, CSSProperties> = {\n xl: { fontSize: 20 },\n l: { fontSize: 18 },\n m: { fontSize: 16 },\n s: { fontSize: 16 },\n xs: { fontSize: 14 },\n}\n"],"names":["SIZES","xl","display","gridTemplateColumns","maxWidth","minWidth","minHeight","gap","padding","borderRadius","l","m","s","xs","SIZES_CLOSE_BUTTON","SIZES_ICON_BUTTON","xxl","SIZES_HEADER_BADGE","SIZES_BADGE","SIZES_CAPTION","fontSize","SIZES_TITLE","SIZES_CONTENT"],"mappings":"2GAKO,MAAMA,MAAqC,CAChDC,GAAI,CACFC,QAAS,OACTC,oBAAqB,MACrBC,SAAU,IACVC,SAAU,cACVC,UAAW,GACXC,IAAK,GACLC,QAAS,GACTC,aAAc,IAEhBC,EAAG,CACDR,QAAS,OACTC,oBAAqB,MACrBC,SAAU,IACVC,SAAU,cACVC,UAAW,GACXC,IAAK,GACLC,QAAS,GACTC,aAAc,IAEhBE,EAAG,CACDT,QAAS,OACTC,oBAAqB,MACrBC,SAAU,IACVC,SAAU,cACVC,UAAW,GACXC,IAAK,GACLC,QAAS,GACTC,aAAc,IAEhBG,EAAG,CACDV,QAAS,OACTC,oBAAqB,MACrBC,SAAU,IACVC,SAAU,cACVC,UAAW,GACXC,IAAK,GACLC,QAAS,GACTC,aAAc,IAEhBI,GAAI,CACFX,QAAS,OACTC,oBAAqB,MACrBC,SAAU,IACVC,SAAU,cACVC,UAAW,GACXC,IAAK,GACLC,QAAS,GACTC,aAAc,KAIX,MAAMK,mBAAkD,CAC7Db,GAAI,IAAKc,aAAkBC,KAC3BN,EAAG,IAAKK,aAAkBd,IAC1BU,EAAG,IAAKI,aAAkBd,IAC1BW,EAAG,IAAKG,aAAkBL,GAC1BG,GAAI,IAAKE,aAAkBL,IAGtB,MAAMO,mBAAkD,CAC7DhB,GAAI,IAAKiB,QAAYR,GACrBA,EAAG,IAAKQ,QAAYR,GACpBC,EAAG,IAAKO,QAAYP,GACpBC,EAAG,IAAKM,QAAYP,GACpBE,GAAI,IAAKK,QAAYP,IAGhB,MAAMQ,cAA6C,CACxDlB,GAAI,CAAEmB,SAAU,IAChBV,EAAG,CAAEU,SAAU,IACfT,EAAG,CAAES,SAAU,IACfR,EAAG,CAAEQ,SAAU,IACfP,GAAI,CAAEO,SAAU,KAGX,MAAMC,YAA2C,CACtDpB,GAAI,CAAEmB,SAAU,IAChBV,EAAG,CAAEU,SAAU,IACfT,EAAG,CAAES,SAAU,IACfR,EAAG,CAAEQ,SAAU,IACfP,GAAI,CAAEO,SAAU,KAGX,MAAME,cAA6C,CACxDrB,GAAI,CAAEmB,SAAU,IAChBV,EAAG,CAAEU,SAAU,IACfT,EAAG,CAAES,SAAU,IACfR,EAAG,CAAEQ,SAAU,IACfP,GAAI,CAAEO,SAAU"}
@@ -1,2 +1,2 @@
1
- 'use strict';var styled=require('styled-components');var responsiveSize=require('../../mixins/responsive-size.js');var focus=require('../../mixins/focus.js');var style=require('../../shared/utils/style.js');var IconButton=require('../IconButton/IconButton.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);const shouldForwardPopoverComponentProp=style.createShouldForwardProp((o=>!['orientation','controlsDirection','black','contrast','elevated'].includes(o)));const MediaLandscape=styled__default.default.div.withConfig({displayName:"PopoverComponent__MediaLandscape",componentId:"ui__sc-hvg57g-0"})(["box-sizing:border-box;flex-shrink:0;width:45%;margin-right:18px;"]);const Media=styled__default.default.div.withConfig({shouldForwardProp:o=>o!=='aspectRatio'}).withConfig({displayName:"PopoverComponent__Media",componentId:"ui__sc-hvg57g-1"})(["",""],(o=>`\n box-sizing: border-box;\n position: relative;\n height: 0;\n padding-bottom: ${o.aspectRatio==='16:9'?'56.25%':'100%'};\n border-radius: 8px;\n\n & > * {\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n }\n\n & img,\n & video {\n border-radius: inherit;\n object-fit: contain;\n height: 100%;\n width: 100%;\n } \n `));const Controls=styled__default.default.div.withConfig({displayName:"PopoverComponent__Controls",componentId:"ui__sc-hvg57g-2"})(["display:flex;flex-wrap:wrap;margin-top:18px;"]);const Root=styled__default.default.div.withConfig({shouldForwardProp:shouldForwardPopoverComponentProp}).withConfig({displayName:"PopoverComponent__Root",componentId:"ui__sc-hvg57g-3"})(["box-sizing:border-box;display:inline-flex;isolation:isolate;position:relative;"," "," ",""],(o=>`\n & ${Controls} {\n flex-direction: ${o.controlsDirection};\n }\n `),(o=>{return`\n color: ${(e={color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-onmain-primary'],shadowColor:o.elevated?o.theme.colors['bg-oncolor-hover']:o.theme.colors.transparent,mediaPlaceholderColor:o.theme.colors['bg-oncolor-hover'],...o.palette}).color};\n background-color: ${e.backgroundColor};\n filter: drop-shadow(0 6px 10px ${e.shadowColor});\n\n & ${Media} img,\n & ${Media} video {\n background-color: ${e.mediaPlaceholderColor};\n }\n`;var e}),responsiveSize.responsiveSize);const Container=styled__default.default.div.withConfig({displayName:"PopoverComponent__Container",componentId:"ui__sc-hvg57g-4"})(["box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;flex-grow:1;"]);const Header=styled__default.default.div.withConfig({displayName:"PopoverComponent__Header",componentId:"ui__sc-hvg57g-5"})(["box-sizing:border-box;display:flex;align-items:center;margin-right:20px;"]);const Content=styled__default.default.div.withConfig({displayName:"PopoverComponent__Content",componentId:"ui__sc-hvg57g-6"})(["box-sizing:border-box;word-break:break-word;& > *:not(:last-child){margin-bottom:18px;}"]);const Video=styled__default.default.video.withConfig({displayName:"PopoverComponent__Video",componentId:"ui__sc-hvg57g-7"})(["",""],focus.focus);const CloseButton=styled__default.default(IconButton.IconButton).withConfig({displayName:"PopoverComponent__CloseButton",componentId:"ui__sc-hvg57g-8"})(["position:absolute;top:10px;right:10px;"]);const Footer=styled__default.default.div.withConfig({displayName:"PopoverComponent__Footer",componentId:"ui__sc-hvg57g-9"})(["box-sizing:border-box;position:relative;margin-top:18px;"]);exports.CloseButton=CloseButton,exports.Container=Container,exports.Content=Content,exports.Controls=Controls,exports.Footer=Footer,exports.Header=Header,exports.Media=Media,exports.MediaLandscape=MediaLandscape,exports.Root=Root,exports.Video=Video;
1
+ 'use strict';var styled=require('styled-components');var responsiveSize=require('../../mixins/responsive-size.js');var responsiveLayout=require('../../mixins/responsive-layout.js');var style=require('../../shared/utils/style.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);const filterLayoutProps=o=>!['layout','layoutXXS','layoutXS','layoutS','layoutM','layoutL','layoutXL','layouts'].includes(o);const shouldForwardPopoverComponentProp=style.createShouldForwardProp((o=>!['black','contrast','elevated'].includes(o)),filterLayoutProps);const Root=styled__default.default.div.withConfig({shouldForwardProp:shouldForwardPopoverComponentProp}).withConfig({displayName:"PopoverComponent__Root",componentId:"ui__sc-hvg57g-0"})(["box-sizing:border-box;position:relative;"," "," ",""],(o=>{return`\n color: ${(e={color:o.theme.colors['content-onmain-primary'],backgroundColor:o.theme.colors['bg-onmain-primary'],shadowColor:o.elevated?o.theme.colors['bg-oncolor-hover']:o.theme.colors.transparent,...o.palette}).color};\n background-color: ${e.backgroundColor};\n filter: drop-shadow(0 6px 10px ${e.shadowColor});\n`;var e}),responsiveSize.responsiveSize,responsiveLayout.responsiveLayout);const ButtonPosition=styled__default.default.div.withConfig({displayName:"PopoverComponent__ButtonPosition",componentId:"ui__sc-hvg57g-1"})(["box-sizing:border-box;position:absolute;top:0;right:0;"]);const Header=styled__default.default.div.withConfig({displayName:"PopoverComponent__Header",componentId:"ui__sc-hvg57g-2"})(["box-sizing:border-box;display:flex;align-items:center;padding-right:20px;"]);const Container=styled__default.default.div.withConfig({displayName:"PopoverComponent__Container",componentId:"ui__sc-hvg57g-3"})(["box-sizing:border-box;display:flex;flex-direction:column;gap:inherit;"]);const Content=styled__default.default.div.withConfig({displayName:"PopoverComponent__Content",componentId:"ui__sc-hvg57g-4"})(["box-sizing:border-box;display:grid;grid-template-columns:100%;align-content:start;gap:inherit;"]);const Footer=styled__default.default.div.withConfig({displayName:"PopoverComponent__Footer",componentId:"ui__sc-hvg57g-5"})(["box-sizing:border-box;display:flex;align-items:end;flex-grow:1;margin-top:12px;"]);const Media=styled__default.default.div.withConfig({shouldForwardProp:filterLayoutProps}).withConfig({displayName:"PopoverComponent__Media",componentId:"ui__sc-hvg57g-6"})(["box-sizing:border-box;",""],responsiveLayout.responsiveLayout);const Img=styled__default.default.div.withConfig({shouldForwardProp:o=>o!=='src'}).withConfig({displayName:"PopoverComponent__Img",componentId:"ui__sc-hvg57g-7"})(["box-sizing:border-box;border-radius:8px;",""],(o=>o.src&&`\n background-image: url(${o.src});\n background-repeat: no-repeat;\n background-position: 50%;\n background-size: cover;\n `));exports.ButtonPosition=ButtonPosition,exports.Container=Container,exports.Content=Content,exports.Footer=Footer,exports.Header=Header,exports.Img=Img,exports.Media=Media,exports.Root=Root;
2
2
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sources":["../../../../src/components/PopoverComponent/style.ts"],"sourcesContent":["import styled from 'styled-components'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { focus } from 'mixins/focus'\nimport { IconButton } from 'components/IconButton'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { PopoverComponentPalette, StyledPopoverComponentProps, StyledPopoverComponentMediaProps } from './types'\n\nconst shouldForwardPopoverComponentProp = createShouldForwardProp(\n (propKey) => !['orientation', 'controlsDirection', 'black', 'contrast', 'elevated'].includes(propKey)\n)\n\nexport const MediaLandscape = styled.div`\n box-sizing: border-box;\n flex-shrink: 0;\n width: 45%;\n margin-right: 18px;\n`\n\nexport const Media = styled.div.withConfig<StyledPopoverComponentMediaProps>({\n shouldForwardProp: (propKey) => propKey !== 'aspectRatio',\n})`\n ${(props) => `\n box-sizing: border-box;\n position: relative;\n height: 0;\n padding-bottom: ${props.aspectRatio === '16:9' ? '56.25%' : '100%'};\n border-radius: 8px;\n\n & > * {\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n }\n\n & img,\n & video {\n border-radius: inherit;\n object-fit: contain;\n height: 100%;\n width: 100%;\n } \n `}\n`\n\nexport const Controls = styled.div`\n display: flex;\n flex-wrap: wrap;\n margin-top: 18px;\n`\n\nconst template = (\n palette: Pick<PopoverComponentPalette, 'color' | 'backgroundColor' | 'shadowColor' | 'mediaPlaceholderColor'>\n) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n filter: drop-shadow(0 6px 10px ${palette.shadowColor});\n\n & ${Media} img,\n & ${Media} video {\n background-color: ${palette.mediaPlaceholderColor};\n }\n`\n\nexport const Root = styled.div.withConfig<StyledPopoverComponentProps>({\n shouldForwardProp: shouldForwardPopoverComponentProp,\n})`\n box-sizing: border-box;\n display: inline-flex;\n isolation: isolate;\n position: relative;\n\n ${(props) => `\n & ${Controls} {\n flex-direction: ${props.controlsDirection};\n }\n `}\n\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-onmain-primary'],\n shadowColor: props.elevated ? props.theme.colors['bg-oncolor-hover'] : props.theme.colors.transparent,\n mediaPlaceholderColor: props.theme.colors['bg-oncolor-hover'],\n ...props.palette,\n })}\n\n ${responsiveSize}\n`\n\nexport const Container = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n flex-grow: 1;\n`\n\nexport const Header = styled.div`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n margin-right: 20px;\n`\n\nexport const Content = styled.div`\n box-sizing: border-box;\n word-break: break-word;\n\n & > *:not(:last-child) {\n margin-bottom: 18px;\n }\n`\n\nexport const Video = styled.video`\n ${focus}\n`\n\nexport const CloseButton = styled(IconButton)`\n position: absolute;\n top: 10px;\n right: 10px;\n`\n\nexport const Footer = styled.div`\n box-sizing: border-box;\n position: relative;\n margin-top: 18px;\n`\n"],"names":["shouldForwardPopoverComponentProp","createShouldForwardProp","propKey","includes","MediaLandscape","styled","div","withConfig","displayName","componentId","Media","shouldForwardProp","props","aspectRatio","Controls","Root","controlsDirection","template","palette","color","theme","colors","backgroundColor","shadowColor","elevated","transparent","mediaPlaceholderColor","responsiveSize","Container","Header","Content","Video","video","focus","CloseButton","default","IconButton","Footer"],"mappings":"kXAOA,MAAMA,kCAAoCC,MAAAA,yBACvCC,IAAa,CAAC,cAAe,oBAAqB,QAAS,WAAY,YAAYC,SAASD,WAGlFE,eAAiBC,gBAAAA,QAAOC,IAAGC,WAAA,CAAAC,YAAA,mCAAAC,YAAA,mBAAVJ,CAK7B,CAAA,qEAEM,MAAMK,MAAQL,gBAAAA,QAAOC,IAAIC,WAA6C,CAC3EI,kBAAoBT,GAAYA,IAAY,gBAC5CK,WAAA,CAAAC,YAAA,0BAAAC,YAAA,mBAFmBJ,CAEnB,CAAA,GAAA,KACGO,GAAU,+FAIOA,EAAMC,cAAgB,OAAS,SAA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AA,mBAAVJ,CAIrB,CAAA"}
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/PopoverComponent/style.ts"],"sourcesContent":["import styled from 'styled-components'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveLayout } from 'mixins/responsive-layout'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { ResponsiveLayoutInterpolationProps } from 'shared/interfaces'\nimport type { PopoverComponentPalette, StyledPopoverComponentProps, StyledPopoverImgProps, Layout } from './types'\n\nconst filterLayoutProps = (propKey: string) =>\n !['layout', 'layoutXXS', 'layoutXS', 'layoutS', 'layoutM', 'layoutL', 'layoutXL', 'layouts'].includes(propKey)\n\nconst shouldForwardPopoverComponentProp = createShouldForwardProp(\n (propKey) => !['black', 'contrast', 'elevated'].includes(propKey),\n filterLayoutProps\n)\n\nconst template = (palette: Pick<PopoverComponentPalette, 'color' | 'backgroundColor' | 'shadowColor'>) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n filter: drop-shadow(0 6px 10px ${palette.shadowColor});\n`\n\nexport const Root = styled.div.withConfig<StyledPopoverComponentProps>({\n shouldForwardProp: shouldForwardPopoverComponentProp,\n})`\n box-sizing: border-box;\n position: relative;\n\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-onmain-primary'],\n shadowColor: props.elevated ? props.theme.colors['bg-oncolor-hover'] : props.theme.colors.transparent,\n ...props.palette,\n })}\n\n ${responsiveSize}\n ${responsiveLayout}\n`\n\nexport const ButtonPosition = styled.div`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n right: 0;\n`\n\nexport const Header = styled.div`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding-right: 20px;\n`\n\nexport const Container = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: inherit;\n`\n\nexport const Content = styled.div`\n box-sizing: border-box;\n display: grid;\n grid-template-columns: 100%;\n align-content: start;\n gap: inherit;\n`\n\nexport const Footer = styled.div`\n box-sizing: border-box;\n display: flex;\n align-items: end;\n flex-grow: 1;\n margin-top: 12px;\n`\n\nexport const Media = styled.div.withConfig<ResponsiveLayoutInterpolationProps<Layout>>({\n shouldForwardProp: filterLayoutProps,\n})`\n box-sizing: border-box;\n\n ${responsiveLayout}\n`\n\nexport const Img = styled.div.withConfig<StyledPopoverImgProps>({\n shouldForwardProp: (propKey) => propKey !== 'src',\n})`\n box-sizing: border-box;\n border-radius: 8px;\n ${(props) =>\n props.src &&\n `\n background-image: url(${props.src});\n background-repeat: no-repeat;\n background-position: 50%;\n background-size: cover;\n `}\n`\n"],"names":["filterLayoutProps","propKey","includes","shouldForwardPopoverComponentProp","createShouldForwardProp","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","props","template","palette","color","theme","colors","backgroundColor","shadowColor","elevated","transparent","responsiveSize","responsiveLayout","ButtonPosition","Header","Container","Content","Footer","Media","Img","src"],"mappings":"mVAOA,MAAMA,kBAAqBC,IACxB,CAAC,SAAU,YAAa,WAAY,UAAW,UAAW,UAAW,WAAY,WAAWC,SAASD,GAExG,MAAME,kCAAoCC,MAAuBA,yBAC9DH,IAAa,CAAC,QAAS,WAAY,YAAYC,SAASD,IACzDD,mBASK,MAAMK,KAAOC,gBAAAA,QAAOC,IAAIC,WAAwC,CACrEC,kBAAmBN,oCACnBK,WAAA,CAAAE,YAAA,yBAAAC,YAAA,mBAFkBL,CAMfM,CAAAA,2CAAAA,IAAAA,IAAAA,KAAAA,IACDC,MAbsG,eAAxFC,EAaL,CACPC,MAAOH,EAAMI,MAAMC,OAAO,0BAC1BC,gBAAiBN,EAAMI,MAAMC,OAAO,qBACpCE,YAAaP,EAAMQ,SAAWR,EAAMI,MAAMC,OAAO,oBAAsBL,EAAMI,MAAMC,OAAOI,eACvFT,EAAME,UAhBIC,+BACGD,EAAQI,sDACKJ,EAAQK,kBAHzBL,KAkBZ,GAEFQ,eAAcA,eACdC,yCAGSC,eAAiBlB,gBAAAA,QAAOC,IAAGC,WAA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