@foxford/ui 2.49.0 → 2.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/mask-rectangle.746e4cebdcf8b5e1.svg +1 -0
- package/assets/mask-slope.6719dfbc2bea78b2.svg +1 -0
- package/components/Dialog/Dialog.js +1 -1
- package/components/Dialog/Dialog.js.map +1 -1
- package/components/Dialog/Dialog.mjs +1 -1
- package/components/Dialog/Dialog.mjs.map +1 -1
- package/components/DialogComponent/DialogComponent.js +1 -1
- package/components/DialogComponent/DialogComponent.js.map +1 -1
- package/components/DialogComponent/DialogComponent.mjs +1 -1
- package/components/DialogComponent/DialogComponent.mjs.map +1 -1
- package/components/DialogComponent/DialogContainer.js +1 -1
- package/components/DialogComponent/DialogContainer.js.map +1 -1
- package/components/DialogComponent/DialogContainer.mjs +1 -1
- package/components/DialogComponent/DialogContainer.mjs.map +1 -1
- package/components/DialogComponent/constants.js +1 -1
- package/components/DialogComponent/constants.js.map +1 -1
- package/components/DialogComponent/constants.mjs +1 -1
- package/components/DialogComponent/constants.mjs.map +1 -1
- package/components/DialogComponent/images/mask-rectangle.svg.js +2 -0
- package/components/DialogComponent/images/mask-rectangle.svg.js.map +1 -0
- package/components/DialogComponent/images/mask-rectangle.svg.mjs +2 -0
- package/components/DialogComponent/images/mask-rectangle.svg.mjs.map +1 -0
- package/components/DialogComponent/images/mask-slope.svg.js +2 -0
- package/components/DialogComponent/images/mask-slope.svg.js.map +1 -0
- package/components/DialogComponent/images/mask-slope.svg.mjs +2 -0
- package/components/DialogComponent/images/mask-slope.svg.mjs.map +1 -0
- package/components/DialogComponent/style.js +1 -1
- package/components/DialogComponent/style.js.map +1 -1
- package/components/DialogComponent/style.mjs +1 -1
- package/components/DialogComponent/style.mjs.map +1 -1
- package/components/Skeleton/style.js +1 -1
- package/components/Skeleton/style.js.map +1 -1
- package/components/Skeleton/style.mjs +1 -1
- package/components/Skeleton/style.mjs.map +1 -1
- package/components/Visibility/style.js +1 -1
- package/components/Visibility/style.js.map +1 -1
- package/components/Visibility/style.mjs +1 -1
- package/components/Visibility/style.mjs.map +1 -1
- package/dts/index.d.ts +24 -2
- package/external/.pnpm/@foxford_icon-pack@0.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/CheckCircleFill/index.js +1 -1
- package/external/.pnpm/@foxford_icon-pack@0.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/CheckCircleFill/index.js.map +1 -1
- package/external/.pnpm/@foxford_icon-pack@0.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ChevronDown/index.js +1 -1
- package/external/.pnpm/@foxford_icon-pack@0.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ChevronDown/index.js.map +1 -1
- package/external/.pnpm/@foxford_icon-pack@0.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/Close/index.js +1 -1
- package/external/.pnpm/@foxford_icon-pack@0.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/CloseCirlceFill/index.js +1 -1
- package/external/.pnpm/@foxford_icon-pack@0.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/LoaderFill/index.js +1 -1
- package/external/.pnpm/@foxford_icon-pack@0.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/NotifFill/index.js +1 -1
- package/package.json +1 -1
- package/shared/utils/dom.js +1 -1
- package/shared/utils/dom.js.map +1 -1
- package/shared/utils/dom.mjs +1 -1
- package/shared/utils/dom.mjs.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 700 186" preserveAspectRatio="none" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill="currentcolor" d="M0 0h700v186H0z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 700 33" fill="none" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 0v33h700v-1z" fill="currentcolor"/></svg>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var ReactModal=require('react-modal');var ramda=require('ramda');var withMergedProps=require('../../hocs/withMergedProps.js');var withTranslation=require('../../hocs/withTranslation.js');var constants$1=require('./constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var DialogComponent=require('../DialogComponent/DialogComponent.js');var constants=require('../DialogComponent/constants.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ReactModal__default=_interopDefault(ReactModal);const TranslationDialogComponent=withTranslation.withTranslation(React.forwardRef(((e,o)=>{const{positions:a={},translated:n,...r}=e;const s=n?{}:ramda.mergeDeepLeft(a,constants$1.POSITIONS);return require$$0.jsx(style.PositionedDialogComponent,{...r,positions:s,ref:o})})));const Dialog=Object.assign(withMergedProps.withMergedProps((e=>{const{size:o="s",position:a="center",role:n="dialog",open:r,preventScrollAfterClose:s,closeTimeoutMS:t,portalClassName:l,className:i,bodyOpenClassName:c,htmlOpenClassName:u,overlayClassName:p,shouldCloseOnOverlayClick:C,shouldCloseOnEsc:d,shouldReturnFocusAfterClose:m,parentSelector:g,overlayRef:D,contentRef:f,palette:v,overlayBlur:M,onAfterOpen:h,onAfterClose:w,onRequestClose:
|
|
1
|
+
'use strict';var React=require('react');var ReactModal=require('react-modal');var ramda=require('ramda');var withMergedProps=require('../../hocs/withMergedProps.js');var withTranslation=require('../../hocs/withTranslation.js');var constants$1=require('./constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var DialogComponent=require('../DialogComponent/DialogComponent.js');var constants=require('../DialogComponent/constants.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ReactModal__default=_interopDefault(ReactModal);const TranslationDialogComponent=withTranslation.withTranslation(React.forwardRef(((e,o)=>{const{positions:a={},translated:n,...r}=e;const s=n?{}:ramda.mergeDeepLeft(a,constants$1.POSITIONS);return require$$0.jsx(style.PositionedDialogComponent,{...r,positions:s,ref:o})})));const Dialog=Object.assign(withMergedProps.withMergedProps((e=>{const{size:o="s",position:a="center",role:n="dialog",open:r,preventScrollAfterClose:s,closeTimeoutMS:t,portalClassName:l,className:i,bodyOpenClassName:c,htmlOpenClassName:u,overlayClassName:p,shouldCloseOnOverlayClick:C,shouldCloseOnEsc:d,shouldReturnFocusAfterClose:m,parentSelector:g,overlayRef:D,contentRef:f,palette:v,overlayBlur:y,overlayDisabled:M,onAfterOpen:h,onAfterClose:w,onRequestClose:N,...O}=e;return require$$0.jsx(ReactModal__default.default,{isOpen:r,ariaHideApp:!1,preventScroll:s,closeTimeoutMS:t,portalClassName:l,className:i,bodyOpenClassName:c,htmlOpenClassName:u,overlayClassName:p,shouldCloseOnOverlayClick:C,shouldCloseOnEsc:d,shouldReturnFocusAfterClose:m,parentSelector:g,overlayRef:D,contentRef:f,onAfterOpen:h,onAfterClose:w,onRequestClose:N,contentElement:e=>{const{ref:r,className:s,tabIndex:t,onKeyDown:l,onMouseDown:i,onMouseUp:c,onClick:u}=e;return require$$0.jsx(TranslationDialogComponent,{...O,ref:r,size:o,role:n,className:s,tabIndex:t,position:a,"aria-modal":!O.draggable&&!M,palette:{color:v.color,backgroundColor:v.backgroundColor,shadowColor:v.shadowColor},onKeyDown:e=>{O.onKeyDown&&O.onKeyDown(e),l&&l(e)},onMouseDown:e=>{O.onMouseDown&&O.onMouseDown(e),i&&i(e)},onMouseUp:e=>{O.onMouseUp&&O.onMouseUp(e),c&&c(e)},onClick:e=>{O.onClick&&O.onClick(e),u&&u(e)}})},overlayElement:(e,o)=>{const{ref:a,className:n,onClick:r,onMouseDown:s}=e;return O.draggable||M?o:require$$0.jsx(style.DialogOverlay,{ref:a,className:n,blur:y,palette:{backgroundColor:v.overlayBackgroundColor},onClick:r,onMouseDown:s,children:o})}})}),{sizes:e=>e.fancy?constants.SIZES_FANCY:constants.SIZES,displayName:"Dialog"}),{Component:DialogComponent.DialogComponent});exports.COMPONENT_NAME="Dialog",exports.Dialog=Dialog;
|
|
2
2
|
//# sourceMappingURL=Dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport ReactModal from 'react-modal'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { withTranslation } from 'hocs/withTranslation'\nimport { DialogComponent, SIZES } from 'components/DialogComponent'\nimport { POSITIONS } from './constants'\nimport * as Styled from './style'\nimport type { DialogProps, TranslationDialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'Dialog'\n\nconst TranslationDialogComponent = withTranslation<HTMLDivElement, TranslationDialogComponentProps>(\n forwardRef((props, ref) => {\n const { positions = {}, translated, ...restProps } = props\n\n const dialogPositions = translated ? {} : mergeDeepLeft(positions, POSITIONS)\n\n return <Styled.PositionedDialogComponent {...restProps} positions={dialogPositions} ref={ref} />\n })\n)\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента и пропсы \"react-modal\" [v3.16.1](https://reactcommunity.org/react-modal).\n *\n * Поддерживаются пропсы определения размеров и позиции в зависимости от ширины вьюпорта.\n *\n * Получить доступ к компоненту, не подключенному к \"react-modal\", можно через Dialog.Component.\n *\n * Полный интерфейс Dialog можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Dialog/types.ts), интерфейс Dialog.Component [тут](https://github.com/foxford/ui/blob/master/src/components/DialogComponent/types.ts).\n *\n */\nconst Dialog: React.ForwardRefExoticComponent<DialogProps> & { Component: typeof DialogComponent } = Object.assign(\n withMergedProps<DialogProps, HTMLDivElement>(\n (props) => {\n const {\n size = 's',\n position = 'center',\n role = 'dialog',\n open,\n preventScrollAfterClose,\n closeTimeoutMS,\n portalClassName,\n className,\n bodyOpenClassName,\n htmlOpenClassName,\n overlayClassName,\n shouldCloseOnOverlayClick,\n shouldCloseOnEsc,\n shouldReturnFocusAfterClose,\n parentSelector,\n overlayRef,\n contentRef,\n palette,\n overlayBlur,\n onAfterOpen,\n onAfterClose,\n onRequestClose,\n ...dialogProps\n } = props\n\n return (\n <ReactModal\n isOpen={open}\n ariaHideApp={false}\n preventScroll={preventScrollAfterClose}\n closeTimeoutMS={closeTimeoutMS}\n portalClassName={portalClassName}\n className={className}\n bodyOpenClassName={bodyOpenClassName}\n htmlOpenClassName={htmlOpenClassName}\n overlayClassName={overlayClassName}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n shouldCloseOnEsc={shouldCloseOnEsc}\n shouldReturnFocusAfterClose={shouldReturnFocusAfterClose}\n parentSelector={parentSelector}\n overlayRef={overlayRef}\n contentRef={contentRef}\n onAfterOpen={onAfterOpen}\n onAfterClose={onAfterClose}\n onRequestClose={onRequestClose}\n contentElement={(contentProps) => {\n const { ref, className, tabIndex, onKeyDown, onMouseDown, onMouseUp, onClick } = contentProps\n\n return (\n <TranslationDialogComponent\n {...dialogProps}\n ref={ref}\n size={size}\n role={role}\n className={className}\n tabIndex={tabIndex}\n position={position}\n aria-modal={!dialogProps.draggable}\n palette={{\n color: palette.color,\n backgroundColor: palette.backgroundColor,\n shadowColor: palette.shadowColor,\n }}\n onKeyDown={(evt) => {\n if (dialogProps.onKeyDown) dialogProps.onKeyDown(evt)\n if (onKeyDown) onKeyDown(evt)\n }}\n onMouseDown={(evt) => {\n if (dialogProps.onMouseDown) dialogProps.onMouseDown(evt)\n if (onMouseDown) onMouseDown(evt)\n }}\n onMouseUp={(evt) => {\n if (dialogProps.onMouseUp) dialogProps.onMouseUp(evt)\n if (onMouseUp) onMouseUp(evt)\n }}\n onClick={(evt) => {\n if (dialogProps.onClick) dialogProps.onClick(evt)\n if (onClick) onClick(evt)\n }}\n />\n )\n }}\n overlayElement={(overlayProps, contentElement) => {\n const { ref, className, onClick, onMouseDown } = overlayProps\n\n return dialogProps.draggable ? (\n contentElement\n ) : (\n <Styled.DialogOverlay\n ref={ref}\n className={className}\n blur={overlayBlur}\n palette={{\n backgroundColor: palette.overlayBackgroundColor,\n }}\n onClick={onClick}\n onMouseDown={onMouseDown}\n >\n {contentElement}\n </Styled.DialogOverlay>\n )\n }}\n />\n )\n },\n {\n sizes: SIZES,\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Component: DialogComponent,\n }\n)\n\nexport { Dialog }\n\nexport { COMPONENT_NAME }\n"],"names":["TranslationDialogComponent","withTranslation","forwardRef","props","ref","positions","translated","restProps","dialogPositions","mergeDeepLeft","POSITIONS","_jsx","Styled","Dialog","Object","assign","withMergedProps","size","position","role","open","preventScrollAfterClose","closeTimeoutMS","portalClassName","className","bodyOpenClassName","htmlOpenClassName","overlayClassName","shouldCloseOnOverlayClick","shouldCloseOnEsc","shouldReturnFocusAfterClose","parentSelector","overlayRef","contentRef","palette","overlayBlur","onAfterOpen","onAfterClose","onRequestClose","dialogProps","ReactModal","isOpen","ariaHideApp","preventScroll","contentElement","contentProps","tabIndex","onKeyDown","onMouseDown","onMouseUp","onClick","draggable","color","backgroundColor","shadowColor","evt","overlayElement","overlayProps","blur","overlayBackgroundColor","children","sizes","SIZES","displayName","Component","DialogComponent"],"mappings":"4kBAYA,MAAMA,2BAA6BC,gBAAAA,gBACjCC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,UAAEA,EAAY,CAAE,EAAAC,WAAEA,KAAeC,GAAcJ,EAErD,MAAMK,EAAkBF,EAAa,CAAA,EAAKG,MAAAA,cAAcJ,EAAWK,YAAAA,WAEnE,OAAOC,WAAAA,IAACC,MAAAA,0BAAgC,IAAKL,EAAWF,UAAWG,EAAiBJ,IAAKA,GAAO,KAe9FS,MAAAA,OAA+FC,OAAOC,OAC1GC,gBAAAA,iBACGb,IACC,MAAMc,KACJA,EAAO,IAAGC,SACVA,EAAW,SAAQC,KACnBA,EAAO,SAAQC,KACfA,EAAIC,wBACJA,EAAuBC,eACvBA,EAAcC,gBACdA,EAAeC,UACfA,EAASC,kBACTA,EAAiBC,kBACjBA,EAAiBC,iBACjBA,EAAgBC,0BAChBA,EAAyBC,iBACzBA,EAAgBC,4BAChBA,EAA2BC,eAC3BA,EAAcC,WACdA,EAAUC,WACVA,EAAUC,QACVA,EAAOC,YACPA,EAAWC,
|
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport ReactModal from 'react-modal'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { withTranslation } from 'hocs/withTranslation'\nimport { DialogComponent, SIZES, SIZES_FANCY } from 'components/DialogComponent'\nimport { POSITIONS } from './constants'\nimport * as Styled from './style'\nimport type { DialogProps, TranslationDialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'Dialog'\n\nconst TranslationDialogComponent = withTranslation<HTMLDivElement, TranslationDialogComponentProps>(\n forwardRef((props, ref) => {\n const { positions = {}, translated, ...restProps } = props\n\n const dialogPositions = translated ? {} : mergeDeepLeft(positions, POSITIONS)\n\n return <Styled.PositionedDialogComponent {...restProps} positions={dialogPositions} ref={ref} />\n })\n)\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента и пропсы \"react-modal\" [v3.16.1](https://reactcommunity.org/react-modal).\n *\n * Поддерживаются пропсы определения размеров и позиции в зависимости от ширины вьюпорта.\n *\n * Получить доступ к компоненту, не подключенному к \"react-modal\", можно через Dialog.Component.\n *\n * Полный интерфейс Dialog можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Dialog/types.ts), интерфейс Dialog.Component [тут](https://github.com/foxford/ui/blob/master/src/components/DialogComponent/types.ts).\n *\n */\nconst Dialog: React.ForwardRefExoticComponent<DialogProps> & { Component: typeof DialogComponent } = Object.assign(\n withMergedProps<DialogProps, HTMLDivElement>(\n (props) => {\n const {\n size = 's',\n position = 'center',\n role = 'dialog',\n open,\n preventScrollAfterClose,\n closeTimeoutMS,\n portalClassName,\n className,\n bodyOpenClassName,\n htmlOpenClassName,\n overlayClassName,\n shouldCloseOnOverlayClick,\n shouldCloseOnEsc,\n shouldReturnFocusAfterClose,\n parentSelector,\n overlayRef,\n contentRef,\n palette,\n overlayBlur,\n overlayDisabled,\n onAfterOpen,\n onAfterClose,\n onRequestClose,\n ...dialogProps\n } = props\n\n return (\n <ReactModal\n isOpen={open}\n ariaHideApp={false}\n preventScroll={preventScrollAfterClose}\n closeTimeoutMS={closeTimeoutMS}\n portalClassName={portalClassName}\n className={className}\n bodyOpenClassName={bodyOpenClassName}\n htmlOpenClassName={htmlOpenClassName}\n overlayClassName={overlayClassName}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n shouldCloseOnEsc={shouldCloseOnEsc}\n shouldReturnFocusAfterClose={shouldReturnFocusAfterClose}\n parentSelector={parentSelector}\n overlayRef={overlayRef}\n contentRef={contentRef}\n onAfterOpen={onAfterOpen}\n onAfterClose={onAfterClose}\n onRequestClose={onRequestClose}\n contentElement={(contentProps) => {\n const { ref, className, tabIndex, onKeyDown, onMouseDown, onMouseUp, onClick } = contentProps\n\n return (\n <TranslationDialogComponent\n {...dialogProps}\n ref={ref}\n size={size}\n role={role}\n className={className}\n tabIndex={tabIndex}\n position={position}\n aria-modal={!dialogProps.draggable && !overlayDisabled}\n palette={{\n color: palette.color,\n backgroundColor: palette.backgroundColor,\n shadowColor: palette.shadowColor,\n }}\n onKeyDown={(evt) => {\n if (dialogProps.onKeyDown) dialogProps.onKeyDown(evt)\n if (onKeyDown) onKeyDown(evt)\n }}\n onMouseDown={(evt) => {\n if (dialogProps.onMouseDown) dialogProps.onMouseDown(evt)\n if (onMouseDown) onMouseDown(evt)\n }}\n onMouseUp={(evt) => {\n if (dialogProps.onMouseUp) dialogProps.onMouseUp(evt)\n if (onMouseUp) onMouseUp(evt)\n }}\n onClick={(evt) => {\n if (dialogProps.onClick) dialogProps.onClick(evt)\n if (onClick) onClick(evt)\n }}\n />\n )\n }}\n overlayElement={(overlayProps, contentElement) => {\n const { ref, className, onClick, onMouseDown } = overlayProps\n\n return dialogProps.draggable || overlayDisabled ? (\n contentElement\n ) : (\n <Styled.DialogOverlay\n ref={ref}\n className={className}\n blur={overlayBlur}\n palette={{\n backgroundColor: palette.overlayBackgroundColor,\n }}\n onClick={onClick}\n onMouseDown={onMouseDown}\n >\n {contentElement}\n </Styled.DialogOverlay>\n )\n }}\n />\n )\n },\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Component: DialogComponent,\n }\n)\n\nexport { Dialog }\n\nexport { COMPONENT_NAME }\n"],"names":["TranslationDialogComponent","withTranslation","forwardRef","props","ref","positions","translated","restProps","dialogPositions","mergeDeepLeft","POSITIONS","_jsx","Styled","Dialog","Object","assign","withMergedProps","size","position","role","open","preventScrollAfterClose","closeTimeoutMS","portalClassName","className","bodyOpenClassName","htmlOpenClassName","overlayClassName","shouldCloseOnOverlayClick","shouldCloseOnEsc","shouldReturnFocusAfterClose","parentSelector","overlayRef","contentRef","palette","overlayBlur","overlayDisabled","onAfterOpen","onAfterClose","onRequestClose","dialogProps","ReactModal","isOpen","ariaHideApp","preventScroll","contentElement","contentProps","tabIndex","onKeyDown","onMouseDown","onMouseUp","onClick","draggable","color","backgroundColor","shadowColor","evt","overlayElement","overlayProps","blur","overlayBackgroundColor","children","sizes","fancy","SIZES_FANCY","SIZES","displayName","Component","DialogComponent"],"mappings":"4kBAYA,MAAMA,2BAA6BC,gBAAAA,gBACjCC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,UAAEA,EAAY,CAAE,EAAAC,WAAEA,KAAeC,GAAcJ,EAErD,MAAMK,EAAkBF,EAAa,CAAA,EAAKG,MAAAA,cAAcJ,EAAWK,YAAAA,WAEnE,OAAOC,WAAAA,IAACC,MAAAA,0BAAgC,IAAKL,EAAWF,UAA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,YAAcO,IACRhB,EAAYS,aAAaT,EAAYS,YAAYO,GACjDP,GAAaA,EAAYO,EAAI,EAEnCN,UAAYM,IACNhB,EAAYU,WAAWV,EAAYU,UAAUM,GAC7CN,GAAWA,EAAUM,EAAI,EAE/BL,QAAUK,IACJhB,EAAYW,SAASX,EAAYW,QAAQK,GACzCL,GAASA,EAAQK,EAAI,GAE3B,EAGNC,eAAgBA,CAACC,EAAcb,KAC7B,MAAMzC,IAAEA,EAAGoB,UAAEA,EAAS2B,QAAEA,EAAOF,YAAEA,GAAgBS,EAEjD,OAAOlB,EAAYY,WAAahB,EAC9BS,EAEAlC,WAAAA,IAACC,MAAAA,cAAoB,CACnBR,IAAKA,EACLoB,UAAWA,EACXmC,KAAMxB,EACND,QAAS,CACPoB,gBAAiBpB,EAAQ0B,wBAE3BT,QAASA,EACTF,YAAaA,EAAYY,SAExBhB,GAEJ,GAEH,GAGN,CACEiB,MAAQ3D,GAAWA,EAAM4D,MAAQC,UAAWA,YAAGC,UAAMA,MACrDC,YAvIiB,WA0IrB,CACEC,UAAWC,gBAAAA,yCA3IQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef}from'react';import ReactModal from'react-modal';import{mergeDeepLeft}from'ramda';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{withTranslation}from'../../hocs/withTranslation.mjs';import{POSITIONS}from'./constants.mjs';import{DialogOverlay,PositionedDialogComponent}from'./style.mjs';import{jsx}from'react/jsx-runtime';import{DialogComponent}from'../DialogComponent/DialogComponent.mjs';import{SIZES}from'../DialogComponent/constants.mjs';const COMPONENT_NAME='Dialog';const TranslationDialogComponent=withTranslation(forwardRef(((o,e)=>{const{positions:n={},translated:s,...l}=o;const
|
|
1
|
+
import{forwardRef}from'react';import ReactModal from'react-modal';import{mergeDeepLeft}from'ramda';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{withTranslation}from'../../hocs/withTranslation.mjs';import{POSITIONS}from'./constants.mjs';import{DialogOverlay,PositionedDialogComponent}from'./style.mjs';import{jsx}from'react/jsx-runtime';import{DialogComponent}from'../DialogComponent/DialogComponent.mjs';import{SIZES_FANCY,SIZES}from'../DialogComponent/constants.mjs';const COMPONENT_NAME='Dialog';const TranslationDialogComponent=withTranslation(forwardRef(((o,e)=>{const{positions:n={},translated:s,...l}=o;const a=s?{}:mergeDeepLeft(n,POSITIONS);return jsx(PositionedDialogComponent,{...l,positions:a,ref:e})})));const Dialog=Object.assign(withMergedProps((o=>{const{size:e="s",position:n="center",role:s="dialog",open:l,preventScrollAfterClose:a,closeTimeoutMS:r,portalClassName:t,className:i,bodyOpenClassName:m,htmlOpenClassName:c,overlayClassName:p,shouldCloseOnOverlayClick:C,shouldCloseOnEsc:d,shouldReturnFocusAfterClose:u,parentSelector:f,overlayRef:g,contentRef:D,palette:N,overlayBlur:O,overlayDisabled:y,onAfterOpen:M,onAfterClose:w,onRequestClose:h,...S}=o;return jsx(ReactModal,{isOpen:l,ariaHideApp:!1,preventScroll:a,closeTimeoutMS:r,portalClassName:t,className:i,bodyOpenClassName:m,htmlOpenClassName:c,overlayClassName:p,shouldCloseOnOverlayClick:C,shouldCloseOnEsc:d,shouldReturnFocusAfterClose:u,parentSelector:f,overlayRef:g,contentRef:D,onAfterOpen:M,onAfterClose:w,onRequestClose:h,contentElement:o=>{const{ref:l,className:a,tabIndex:r,onKeyDown:t,onMouseDown:i,onMouseUp:m,onClick:c}=o;return jsx(TranslationDialogComponent,{...S,ref:l,size:e,role:s,className:a,tabIndex:r,position:n,"aria-modal":!S.draggable&&!y,palette:{color:N.color,backgroundColor:N.backgroundColor,shadowColor:N.shadowColor},onKeyDown:o=>{S.onKeyDown&&S.onKeyDown(o),t&&t(o)},onMouseDown:o=>{S.onMouseDown&&S.onMouseDown(o),i&&i(o)},onMouseUp:o=>{S.onMouseUp&&S.onMouseUp(o),m&&m(o)},onClick:o=>{S.onClick&&S.onClick(o),c&&c(o)}})},overlayElement:(o,e)=>{const{ref:n,className:s,onClick:l,onMouseDown:a}=o;return S.draggable||y?e:jsx(DialogOverlay,{ref:n,className:s,blur:O,palette:{backgroundColor:N.overlayBackgroundColor},onClick:l,onMouseDown:a,children:e})}})}),{sizes:o=>o.fancy?SIZES_FANCY:SIZES,displayName:"Dialog"}),{Component:DialogComponent});export{COMPONENT_NAME,Dialog};
|
|
2
2
|
//# sourceMappingURL=Dialog.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.mjs","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport ReactModal from 'react-modal'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { withTranslation } from 'hocs/withTranslation'\nimport { DialogComponent, SIZES } from 'components/DialogComponent'\nimport { POSITIONS } from './constants'\nimport * as Styled from './style'\nimport type { DialogProps, TranslationDialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'Dialog'\n\nconst TranslationDialogComponent = withTranslation<HTMLDivElement, TranslationDialogComponentProps>(\n forwardRef((props, ref) => {\n const { positions = {}, translated, ...restProps } = props\n\n const dialogPositions = translated ? {} : mergeDeepLeft(positions, POSITIONS)\n\n return <Styled.PositionedDialogComponent {...restProps} positions={dialogPositions} ref={ref} />\n })\n)\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента и пропсы \"react-modal\" [v3.16.1](https://reactcommunity.org/react-modal).\n *\n * Поддерживаются пропсы определения размеров и позиции в зависимости от ширины вьюпорта.\n *\n * Получить доступ к компоненту, не подключенному к \"react-modal\", можно через Dialog.Component.\n *\n * Полный интерфейс Dialog можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Dialog/types.ts), интерфейс Dialog.Component [тут](https://github.com/foxford/ui/blob/master/src/components/DialogComponent/types.ts).\n *\n */\nconst Dialog: React.ForwardRefExoticComponent<DialogProps> & { Component: typeof DialogComponent } = Object.assign(\n withMergedProps<DialogProps, HTMLDivElement>(\n (props) => {\n const {\n size = 's',\n position = 'center',\n role = 'dialog',\n open,\n preventScrollAfterClose,\n closeTimeoutMS,\n portalClassName,\n className,\n bodyOpenClassName,\n htmlOpenClassName,\n overlayClassName,\n shouldCloseOnOverlayClick,\n shouldCloseOnEsc,\n shouldReturnFocusAfterClose,\n parentSelector,\n overlayRef,\n contentRef,\n palette,\n overlayBlur,\n onAfterOpen,\n onAfterClose,\n onRequestClose,\n ...dialogProps\n } = props\n\n return (\n <ReactModal\n isOpen={open}\n ariaHideApp={false}\n preventScroll={preventScrollAfterClose}\n closeTimeoutMS={closeTimeoutMS}\n portalClassName={portalClassName}\n className={className}\n bodyOpenClassName={bodyOpenClassName}\n htmlOpenClassName={htmlOpenClassName}\n overlayClassName={overlayClassName}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n shouldCloseOnEsc={shouldCloseOnEsc}\n shouldReturnFocusAfterClose={shouldReturnFocusAfterClose}\n parentSelector={parentSelector}\n overlayRef={overlayRef}\n contentRef={contentRef}\n onAfterOpen={onAfterOpen}\n onAfterClose={onAfterClose}\n onRequestClose={onRequestClose}\n contentElement={(contentProps) => {\n const { ref, className, tabIndex, onKeyDown, onMouseDown, onMouseUp, onClick } = contentProps\n\n return (\n <TranslationDialogComponent\n {...dialogProps}\n ref={ref}\n size={size}\n role={role}\n className={className}\n tabIndex={tabIndex}\n position={position}\n aria-modal={!dialogProps.draggable}\n palette={{\n color: palette.color,\n backgroundColor: palette.backgroundColor,\n shadowColor: palette.shadowColor,\n }}\n onKeyDown={(evt) => {\n if (dialogProps.onKeyDown) dialogProps.onKeyDown(evt)\n if (onKeyDown) onKeyDown(evt)\n }}\n onMouseDown={(evt) => {\n if (dialogProps.onMouseDown) dialogProps.onMouseDown(evt)\n if (onMouseDown) onMouseDown(evt)\n }}\n onMouseUp={(evt) => {\n if (dialogProps.onMouseUp) dialogProps.onMouseUp(evt)\n if (onMouseUp) onMouseUp(evt)\n }}\n onClick={(evt) => {\n if (dialogProps.onClick) dialogProps.onClick(evt)\n if (onClick) onClick(evt)\n }}\n />\n )\n }}\n overlayElement={(overlayProps, contentElement) => {\n const { ref, className, onClick, onMouseDown } = overlayProps\n\n return dialogProps.draggable ? (\n contentElement\n ) : (\n <Styled.DialogOverlay\n ref={ref}\n className={className}\n blur={overlayBlur}\n palette={{\n backgroundColor: palette.overlayBackgroundColor,\n }}\n onClick={onClick}\n onMouseDown={onMouseDown}\n >\n {contentElement}\n </Styled.DialogOverlay>\n )\n }}\n />\n )\n },\n {\n sizes: SIZES,\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Component: DialogComponent,\n }\n)\n\nexport { Dialog }\n\nexport { COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","TranslationDialogComponent","withTranslation","forwardRef","props","ref","positions","translated","restProps","dialogPositions","mergeDeepLeft","POSITIONS","_jsx","Styled","Dialog","Object","assign","withMergedProps","size","position","role","open","preventScrollAfterClose","closeTimeoutMS","portalClassName","className","bodyOpenClassName","htmlOpenClassName","overlayClassName","shouldCloseOnOverlayClick","shouldCloseOnEsc","shouldReturnFocusAfterClose","parentSelector","overlayRef","contentRef","palette","overlayBlur","onAfterOpen","onAfterClose","onRequestClose","dialogProps","ReactModal","isOpen","ariaHideApp","preventScroll","contentElement","contentProps","tabIndex","onKeyDown","onMouseDown","onMouseUp","onClick","draggable","color","backgroundColor","shadowColor","evt","overlayElement","overlayProps","blur","overlayBackgroundColor","children","sizes","SIZES","displayName","Component","DialogComponent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dialog.mjs","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport ReactModal from 'react-modal'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { withTranslation } from 'hocs/withTranslation'\nimport { DialogComponent, SIZES, SIZES_FANCY } from 'components/DialogComponent'\nimport { POSITIONS } from './constants'\nimport * as Styled from './style'\nimport type { DialogProps, TranslationDialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'Dialog'\n\nconst TranslationDialogComponent = withTranslation<HTMLDivElement, TranslationDialogComponentProps>(\n forwardRef((props, ref) => {\n const { positions = {}, translated, ...restProps } = props\n\n const dialogPositions = translated ? {} : mergeDeepLeft(positions, POSITIONS)\n\n return <Styled.PositionedDialogComponent {...restProps} positions={dialogPositions} ref={ref} />\n })\n)\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента и пропсы \"react-modal\" [v3.16.1](https://reactcommunity.org/react-modal).\n *\n * Поддерживаются пропсы определения размеров и позиции в зависимости от ширины вьюпорта.\n *\n * Получить доступ к компоненту, не подключенному к \"react-modal\", можно через Dialog.Component.\n *\n * Полный интерфейс Dialog можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Dialog/types.ts), интерфейс Dialog.Component [тут](https://github.com/foxford/ui/blob/master/src/components/DialogComponent/types.ts).\n *\n */\nconst Dialog: React.ForwardRefExoticComponent<DialogProps> & { Component: typeof DialogComponent } = Object.assign(\n withMergedProps<DialogProps, HTMLDivElement>(\n (props) => {\n const {\n size = 's',\n position = 'center',\n role = 'dialog',\n open,\n preventScrollAfterClose,\n closeTimeoutMS,\n portalClassName,\n className,\n bodyOpenClassName,\n htmlOpenClassName,\n overlayClassName,\n shouldCloseOnOverlayClick,\n shouldCloseOnEsc,\n shouldReturnFocusAfterClose,\n parentSelector,\n overlayRef,\n contentRef,\n palette,\n overlayBlur,\n overlayDisabled,\n onAfterOpen,\n onAfterClose,\n onRequestClose,\n ...dialogProps\n } = props\n\n return (\n <ReactModal\n isOpen={open}\n ariaHideApp={false}\n preventScroll={preventScrollAfterClose}\n closeTimeoutMS={closeTimeoutMS}\n portalClassName={portalClassName}\n className={className}\n bodyOpenClassName={bodyOpenClassName}\n htmlOpenClassName={htmlOpenClassName}\n overlayClassName={overlayClassName}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n shouldCloseOnEsc={shouldCloseOnEsc}\n shouldReturnFocusAfterClose={shouldReturnFocusAfterClose}\n parentSelector={parentSelector}\n overlayRef={overlayRef}\n contentRef={contentRef}\n onAfterOpen={onAfterOpen}\n onAfterClose={onAfterClose}\n onRequestClose={onRequestClose}\n contentElement={(contentProps) => {\n const { ref, className, tabIndex, onKeyDown, onMouseDown, onMouseUp, onClick } = contentProps\n\n return (\n <TranslationDialogComponent\n {...dialogProps}\n ref={ref}\n size={size}\n role={role}\n className={className}\n tabIndex={tabIndex}\n position={position}\n aria-modal={!dialogProps.draggable && !overlayDisabled}\n palette={{\n color: palette.color,\n backgroundColor: palette.backgroundColor,\n shadowColor: palette.shadowColor,\n }}\n onKeyDown={(evt) => {\n if (dialogProps.onKeyDown) dialogProps.onKeyDown(evt)\n if (onKeyDown) onKeyDown(evt)\n }}\n onMouseDown={(evt) => {\n if (dialogProps.onMouseDown) dialogProps.onMouseDown(evt)\n if (onMouseDown) onMouseDown(evt)\n }}\n onMouseUp={(evt) => {\n if (dialogProps.onMouseUp) dialogProps.onMouseUp(evt)\n if (onMouseUp) onMouseUp(evt)\n }}\n onClick={(evt) => {\n if (dialogProps.onClick) dialogProps.onClick(evt)\n if (onClick) onClick(evt)\n }}\n />\n )\n }}\n overlayElement={(overlayProps, contentElement) => {\n const { ref, className, onClick, onMouseDown } = overlayProps\n\n return dialogProps.draggable || overlayDisabled ? (\n contentElement\n ) : (\n <Styled.DialogOverlay\n ref={ref}\n className={className}\n blur={overlayBlur}\n palette={{\n backgroundColor: palette.overlayBackgroundColor,\n }}\n onClick={onClick}\n onMouseDown={onMouseDown}\n >\n {contentElement}\n </Styled.DialogOverlay>\n )\n }}\n />\n )\n },\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Component: DialogComponent,\n }\n)\n\nexport { Dialog }\n\nexport { COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","TranslationDialogComponent","withTranslation","forwardRef","props","ref","positions","translated","restProps","dialogPositions","mergeDeepLeft","POSITIONS","_jsx","Styled","Dialog","Object","assign","withMergedProps","size","position","role","open","preventScrollAfterClose","closeTimeoutMS","portalClassName","className","bodyOpenClassName","htmlOpenClassName","overlayClassName","shouldCloseOnOverlayClick","shouldCloseOnEsc","shouldReturnFocusAfterClose","parentSelector","overlayRef","contentRef","palette","overlayBlur","overlayDisabled","onAfterOpen","onAfterClose","onRequestClose","dialogProps","ReactModal","isOpen","ariaHideApp","preventScroll","contentElement","contentProps","tabIndex","onKeyDown","onMouseDown","onMouseUp","onClick","draggable","color","backgroundColor","shadowColor","evt","overlayElement","overlayProps","blur","overlayBackgroundColor","children","sizes","fancy","SIZES_FANCY","SIZES","displayName","Component","DialogComponent"],"mappings":"0eAUMA,MAAAA,eAAiB,SAEvB,MAAMC,2BAA6BC,gBACjCC,YAAW,CAACC,EAAOC,KACjB,MAAMC,UAAEA,EAAY,CAAE,EAAAC,WAAEA,KAAeC,GAAcJ,EAErD,MAAMK,EAAkBF,EAAa,CAAA,EAAKG,cAAcJ,EAAWK,WAEnE,OAAOC,IAACC,0BAAgC,IAAKL,EAAWF,UAAWG,EAAiBJ,IAAKA,GAAO,KAe9FS,MAAAA,OAA+FC,OAAOC,OAC1GC,iBACGb,IACC,MAAMc,KACJA,EAAO,IAAGC,SACVA,EAAW,SAAQC,KACnBA,EAAO,SAAQC,KACfA,EAAIC,wBACJA,EAAuBC,eACvBA,EAAcC,gBACdA,EAAeC,UACfA,EAASC,kBACTA,EAAiBC,kBACjBA,EAAiBC,iBACjBA,EAAgBC,0BAChBA,EAAyBC,iBACzBA,EAAgBC,4BAChBA,EAA2BC,eAC3BA,EAAcC,WACdA,EAAUC,WACVA,EAAUC,QACVA,EAAOC,YACPA,EAAWC,gBACXA,EAAeC,YACfA,EAAWC,aACXA,EAAYC,eACZA,KACGC,GACDrC,EAEJ,OACEQ,IAAC8B,WAAU,CACTC,OAAQtB,EACRuB,aAAa,EACbC,cAAevB,EACfC,eAAgBA,EAChBC,gBAAiBA,EACjB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D,MAAQC,YAAcC,MAC/CC,YAvIiB,WA0IrB,CACEC,UAAWC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var ResizeObserver=require('../../external/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.js');var withMergedProps=require('../../hocs/withMergedProps.js');var constants$1=require('../../shared/constants.js');var DialogContainer=require('./DialogContainer.js');var dragging=require('./images/dragging.svg.js');var style=require('./style.js');var utils=require('./utils.js');var constants=require('./constants.js');var require$$0=require('react/jsx-runtime');var Visibility=require('../Visibility/Visibility.js');var Icon=require('../Icon/Icon.js');var Skeleton=require('../Skeleton/Skeleton.js');var Text=require('../Text/Text.js');var Button=require('../Button/Button.js');const resizeHandlerSymbol=Symbol('resize-handler');const resizeObserver=new ResizeObserver.default((e=>{e.forEach((e=>{typeof e.target[resizeHandlerSymbol]=='function'&&e.target[resizeHandlerSymbol](e.target)}))}));const DialogComponent=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:i="s",iconButtonProps:t={},captionProps:s={},titleProps:n={},subtitleProps:o={},draggingIconProps:a={},imgSrc:l={},skeletonProps:c={},
|
|
1
|
+
'use strict';var React=require('react');var ResizeObserver=require('../../external/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.js');var withMergedProps=require('../../hocs/withMergedProps.js');var constants$1=require('../../shared/constants.js');var dom=require('../../shared/utils/dom.js');var DialogContainer=require('./DialogContainer.js');var dragging=require('./images/dragging.svg.js');var style=require('./style.js');var utils=require('./utils.js');var constants=require('./constants.js');var require$$0=require('react/jsx-runtime');var Visibility=require('../Visibility/Visibility.js');var Spacer=require('../Spacer/Spacer.js');var Icon=require('../Icon/Icon.js');var Skeleton=require('../Skeleton/Skeleton.js');var Text=require('../Text/Text.js');var Button=require('../Button/Button.js');const resizeHandlerSymbol=Symbol('resize-handler');const resizeObserver=new ResizeObserver.default((e=>{e.forEach((e=>{typeof e.target[resizeHandlerSymbol]=='function'&&e.target[resizeHandlerSymbol](e.target)}))}));const DialogComponent=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:i="s",iconButtonProps:t={},captionProps:s={},titleProps:n={},subtitleProps:o={},draggingIconProps:a={},imgSrc:l={},skeletonProps:c={},fancy:d,floats:u,children:$,caption:g,title:x,subtitle:y,controls:p,imgLandscapePositionRight:S,imgPortraitPositionBottom:q,className:j,backgroundClassName:h,scrollFadingDisabled:b,draggable:I,loading:m,sizeXXS:z,sizeXS:T,sizeS:v,sizeM:k,sizeL:P,sizeXL:B,onGrab:w,onNudge:C,...R}=e;const D={size:i,sizeXXS:z,sizeXS:T,sizeS:v,sizeM:k,sizeL:P,sizeXL:B};const E=utils.getCommonSizeProps(D);const f=d?j:dom.concatClassNames(j,h);const[M,L]=React.useState(null);const[V,_]=React.useState(null);const A=React.useRef(null);const N=React.useCallback((e=>{e.scrollHeight===e.clientHeight?(L(null),_(null)):(L(e.scrollTop<=0),_(Math.abs(e.scrollHeight-e.clientHeight-e.scrollTop)<=1))}),[]);return React.useLayoutEffect((()=>(!b&&A.current&&(A.current[resizeHandlerSymbol]=N,resizeObserver.observe(A.current)),()=>{A.current&&resizeObserver.unobserve(A.current)})),[N,b]),require$$0.jsxs(style.Root,{...R,...D,className:f,fancy:d,ref:r,children:[u&&u(E),d&&require$$0.jsx(style.FancyBackground,{className:h}),d&&t.onClick&&require$$0.jsx(style.PositionedIconButton,{secondary:!0,size:"xxl",icon:"close",inset:{top:0,right:0},...t}),(I||l.portrait&&!q||d)&&require$$0.jsxs(Visibility.Visibility,{...D,sizes:constants.VISIBILITY_PORTRAIT,children:[d&&require$$0.jsx(Spacer.Spacer,{top:96}),I&&require$$0.jsx(style.DraggingHandle,{onPointerDown:w,children:require$$0.jsx(style.DraggingIconContainer,{tabIndex:0,onKeyDown:C,children:require$$0.jsx(Icon.Icon,{icon:require$$0.jsx(dragging.default,{}),size:34,color:"content-onmain-tertiary",...a})})}),l.portrait&&!q&&require$$0.jsx(style.MediaPortraitContainer,{top:!d,children:require$$0.jsxs(style.MediaPortrait,{children:[require$$0.jsx(style.Placeholder,{orientation:"portrait",aspectRatio:"3:1"}),m?require$$0.jsx(style.MediaSkeleton,{width:"100%",height:"100%",borderRadius:0,...c}):require$$0.jsx(style.Media,{src:l.portrait})]})})]}),l.landscape&&!S&&require$$0.jsx(Visibility.Visibility,{...D,sizes:constants.VISIBILITY_LANDSCAPE_MEDIA,children:require$$0.jsxs(style.MediaLandscape,{children:[require$$0.jsx(style.Placeholder,{orientation:"landscape",aspectRatio:"5:7"}),m?require$$0.jsx(style.MediaSkeleton,{width:"100%",height:"100%",borderRadius:0,...c}):require$$0.jsx(style.Media,{src:l.landscape})]})}),!d&&t.onClick&&require$$0.jsx(style.PositionedIconButton,{size:"l",icon:"close",inset:{top:8,right:8},...t}),require$$0.jsxs(DialogContainer.DialogContainer,{...D,fancy:d,children:[I&&require$$0.jsx(Visibility.Visibility,{...D,sizes:constants.VISIBILITY_LANDSCAPE,children:require$$0.jsx(style.DraggingHandle,{onPointerDown:w,children:require$$0.jsx(style.DraggingIconContainer,{tabIndex:0,onKeyDown:C,children:require$$0.jsx(Icon.Icon,{icon:require$$0.jsx(dragging.default,{}),size:34,color:"content-onmain-tertiary",...a})})})}),require$$0.jsx(style.Fading,{visible:M===!1}),require$$0.jsx(style.ScrollableContent,{ref:A,tabIndex:0,onScroll:e=>{b||N(e.currentTarget)},onKeyDown:e=>{constants$1.keyboardKeys.ArrowUp.validate(e.key)?(e.preventDefault(),e.currentTarget.scrollBy(0,-13)):constants$1.keyboardKeys.ArrowDown.validate(e.key)&&(e.preventDefault(),e.currentTarget.scrollBy(0,13))},children:require$$0.jsxs(require$$0.Fragment,m?{children:[require$$0.jsx(Skeleton.Skeleton,{children:require$$0.jsx(Text.Text,{appearance:"heading",marginBottom:"1.5em",sizes:constants.SIZES_TITLE,...E,...n})}),require$$0.jsx(Skeleton.Skeleton,{width:"90%",children:require$$0.jsx(Text.Text,{appearance:"body",marginBottom:"0.4em",sizes:constants.SIZES_SUBTITLE,...E,...o})}),require$$0.jsx(Skeleton.Skeleton,{width:"70%",children:require$$0.jsx(Text.Text,{appearance:"body",marginBottom:"0.4em",sizes:constants.SIZES_SUBTITLE,...E,...o})}),require$$0.jsx(Skeleton.Skeleton,{width:"50%",children:require$$0.jsx(Text.Text,{appearance:"body",marginBottom:"0.8em",sizes:constants.SIZES_SUBTITLE,...E,...o})})]}:{children:[g&&require$$0.jsx(Text.Text,{appearance:"body",color:"content-onmain-tertiary",wordBreak:"break-word",marginBottom:"0.8em",sizes:constants.SIZES_CAPTION,...E,...s,children:g}),x&&require$$0.jsx(Text.Text,{as:"h2",appearance:"heading",color:"content-onmain-primary",wordBreak:"break-word",marginBottom:"0.5em",sizes:constants.SIZES_TITLE,...E,...n,children:x}),y&&require$$0.jsx(Text.Text,{as:"p",appearance:"body",color:"content-onmain-primary",wordBreak:"break-word",marginBottom:"0.8em",sizes:constants.SIZES_SUBTITLE,...E,...o,children:y}),$]})}),require$$0.jsx(style.Fading,{visible:V===!1,after:!0}),p&&require$$0.jsx(style.Controls,{children:m?require$$0.jsx(Skeleton.Skeleton,{borderRadius:48,...c,children:require$$0.jsx(Button.Button,{preset:"brand",...E})}):p(E)})]}),l.landscape&&S&&require$$0.jsx(Visibility.Visibility,{...D,sizes:constants.VISIBILITY_LANDSCAPE_MEDIA,children:require$$0.jsxs(style.MediaLandscape,{right:!0,children:[require$$0.jsx(style.Placeholder,{orientation:"landscape",aspectRatio:"5:7"}),m?require$$0.jsx(style.MediaSkeleton,{width:"100%",height:"100%",borderRadius:0,...c}):require$$0.jsx(style.Media,{src:l.landscape})]})}),l.portrait&&q&&require$$0.jsx(Visibility.Visibility,{...D,sizes:constants.VISIBILITY_PORTRAIT,children:require$$0.jsx(style.MediaPortraitContainer,{bottom:!0,children:require$$0.jsxs(style.MediaPortrait,{children:[require$$0.jsx(style.Placeholder,{orientation:"portrait",aspectRatio:"3:1"}),m?require$$0.jsx(style.MediaSkeleton,{width:"100%",height:"100%",borderRadius:0,...c}):require$$0.jsx(style.Media,{src:l.portrait})]})})})]})})),{sizes:e=>e.fancy?constants.SIZES_FANCY:constants.SIZES,displayName:'DialogComponent'});exports.SIZES=constants.SIZES,exports.SIZES_FANCY=constants.SIZES_FANCY,exports.DialogComponent=DialogComponent;
|
|
2
2
|
//# sourceMappingURL=DialogComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogComponent.js","sources":["../../../../src/components/DialogComponent/DialogComponent.tsx"],"sourcesContent":["import { forwardRef, useLayoutEffect, useRef, useState, useCallback } from 'react'\nimport ResizeObserver from 'resize-observer-polyfill'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { keyboardKeys } from 'shared/constants'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Visibility } from 'components/Visibility'\nimport { Skeleton } from 'components/Skeleton'\nimport { Button } from 'components/Button'\nimport type { Nullable } from 'shared/types'\nimport { DialogContainer } from './DialogContainer'\nimport Dragging from './images/dragging.svg?module'\nimport * as Styled from './style'\nimport { getCommonSizeProps } from './utils'\nimport {\n SIZES,\n SIZES_CAPTION,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n VISIBILITY_PORTRAIT,\n VISIBILITY_LANDSCAPE,\n VISIBILITY_LANDSCAPE_MEDIA,\n} from './constants'\nimport type { DialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'DialogComponent'\n\nconst resizeHandlerSymbol = Symbol('resize-handler')\n\nconst resizeObserver = new ResizeObserver((entries) => {\n entries.forEach((entry) => {\n if (typeof entry.target[resizeHandlerSymbol] === 'function') {\n entry.target[resizeHandlerSymbol](entry.target)\n }\n })\n})\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/DialogComponent/types.ts).\n */\nconst DialogComponent: React.ForwardRefExoticComponent<DialogComponentProps> = withMergedProps<\n DialogComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n iconButtonProps = {},\n captionProps = {},\n titleProps = {},\n subtitleProps = {},\n draggingIconProps = {},\n imgSrc = {},\n skeletonProps = {},\n children,\n caption,\n title,\n subtitle,\n controls,\n imgLandscapePositionRight,\n draggable,\n loading,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n onGrab,\n onNudge,\n ...restProps\n } = props\n\n const dialogSizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const sizeProps = getCommonSizeProps(dialogSizeProps)\n\n const [scrollTop, setScrollTop] = useState<Nullable<boolean>>(null)\n const [scrollBottom, setScrollBottom] = useState<Nullable<boolean>>(null)\n\n const scrollable = useRef<HTMLDivElement | null>(null)\n\n const handleScrollThresholds = useCallback((e: HTMLDivElement) => {\n if (e.scrollHeight === e.clientHeight) {\n setScrollTop(null)\n setScrollBottom(null)\n } else {\n setScrollTop(e.scrollTop <= 0)\n setScrollBottom(Math.abs(e.scrollHeight - e.clientHeight - e.scrollTop) <= 1)\n }\n }, [])\n\n useLayoutEffect(() => {\n if (scrollable.current) {\n scrollable.current[resizeHandlerSymbol] = handleScrollThresholds\n resizeObserver.observe(scrollable.current)\n }\n\n return () => {\n if (scrollable.current) {\n resizeObserver.unobserve(scrollable.current)\n }\n }\n }, [handleScrollThresholds])\n\n return (\n <Styled.Root {...restProps} {...dialogSizeProps} ref={ref}>\n {(draggable || imgSrc.portrait) && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_PORTRAIT}>\n {draggable && (\n <Styled.DraggingHandle onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' {...draggingIconProps} />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n )}\n {imgSrc.portrait && (\n <Styled.MediaPortrait>\n <Styled.Placeholder orientation='portrait' aspectRatio='3:1' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.portrait} />\n )}\n </Styled.MediaPortrait>\n )}\n </Visibility>\n )}\n {imgSrc.landscape && !imgLandscapePositionRight && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_LANDSCAPE_MEDIA}>\n <Styled.MediaLandscape>\n <Styled.Placeholder orientation='landscape' aspectRatio='5:7' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.landscape} />\n )}\n </Styled.MediaLandscape>\n </Visibility>\n )}\n {iconButtonProps.onClick && <Styled.PositionedIconButton size='l' icon='close' {...iconButtonProps} />}\n <DialogContainer {...dialogSizeProps}>\n {draggable && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_LANDSCAPE}>\n <Styled.DraggingHandle onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' {...draggingIconProps} />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n </Visibility>\n )}\n <Styled.Fading visible={scrollTop === false} />\n <Styled.ScrollableContent\n ref={scrollable}\n tabIndex={0}\n onScroll={(evt) => {\n handleScrollThresholds(evt.currentTarget)\n }}\n onKeyDown={(evt) => {\n if (keyboardKeys.ArrowUp.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, -13)\n } else if (keyboardKeys.ArrowDown.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, 13)\n }\n }}\n >\n {loading ? (\n <>\n <Skeleton>\n <Text appearance='heading' marginBottom='1.5em' sizes={SIZES_TITLE} {...sizeProps} {...titleProps} />\n </Skeleton>\n <Skeleton width='90%'>\n <Text\n appearance='body'\n marginBottom='0.4em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n />\n </Skeleton>\n <Skeleton width='70%'>\n <Text\n appearance='body'\n marginBottom='0.4em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n />\n </Skeleton>\n <Skeleton width='50%'>\n <Text\n appearance='body'\n marginBottom='0.8em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n />\n </Skeleton>\n </>\n ) : (\n <>\n {caption && (\n <Text\n appearance='body'\n color='content-onmain-tertiary'\n wordBreak='break-word'\n marginBottom='0.8em'\n sizes={SIZES_CAPTION}\n {...sizeProps}\n {...captionProps}\n >\n {caption}\n </Text>\n )}\n {title && (\n <Text\n as='h2'\n appearance='heading'\n color='content-onmain-primary'\n wordBreak='break-word'\n marginBottom='0.5em'\n sizes={SIZES_TITLE}\n {...sizeProps}\n {...titleProps}\n >\n {title}\n </Text>\n )}\n {subtitle && (\n <Text\n as='p'\n appearance='body'\n color='content-onmain-primary'\n wordBreak='break-word'\n marginBottom='0.8em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n >\n {subtitle}\n </Text>\n )}\n {children}\n </>\n )}\n </Styled.ScrollableContent>\n <Styled.Fading visible={scrollBottom === false} after />\n {controls && (\n <Styled.Controls>\n {loading ? (\n <Skeleton borderRadius={48} {...skeletonProps}>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : (\n controls(sizeProps)\n )}\n </Styled.Controls>\n )}\n </DialogContainer>\n {imgSrc.landscape && imgLandscapePositionRight && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_LANDSCAPE_MEDIA}>\n <Styled.MediaLandscape>\n <Styled.Placeholder orientation='landscape' aspectRatio='5:7' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.landscape} />\n )}\n </Styled.MediaLandscape>\n </Visibility>\n )}\n </Styled.Root>\n )\n }),\n {\n sizes: SIZES,\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogComponent }\n\nexport { SIZES }\n"],"names":["resizeHandlerSymbol","Symbol","resizeObserver","ResizeObserver","default","entries","forEach","entry","target","DialogComponent","withMergedProps","forwardRef","props","ref","size","iconButtonProps","captionProps","titleProps","subtitleProps","draggingIconProps","imgSrc","skeletonProps","children","caption","title","subtitle","controls","imgLandscapePositionRight","draggable","loading","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","onGrab","onNudge","restProps","dialogSizeProps","sizeProps","getCommonSizeProps","scrollTop","setScrollTop","useState","scrollBottom","setScrollBottom","scrollable","useRef","handleScrollThresholds","useCallback","e","scrollHeight","clientHeight","Math","abs","useLayoutEffect","current","observe","unobserve","_jsxs","Styled","portrait","jsxs","Visibility","sizes","VISIBILITY_PORTRAIT","_jsx","jsx","onPointerDown","tabIndex","onKeyDown","Icon","icon","Dragging","color","orientation","aspectRatio","width","height","borderRadius","src","landscape","VISIBILITY_LANDSCAPE_MEDIA","onClick","DialogContainer","VISIBILITY_LANDSCAPE","visible","onScroll","evt","currentTarget","keyboardKeys","ArrowUp","validate","key","preventDefault","scrollBy","ArrowDown","_Fragment","Skeleton","Text","appearance","marginBottom","SIZES_TITLE","SIZES_SUBTITLE","wordBreak","SIZES_CAPTION","as","after","Button","preset","SIZES","displayName"],"mappings":"0vBA2BA,MAAMA,oBAAsBC,OAAO,kBAEnC,MAAMC,eAAiB,IAAIC,eAAcC,SAAEC,IACzCA,EAAQC,SAASC,WACJA,EAAMC,OAAOR,sBAAyB,YAC/CO,EAAMC,OAAOR,qBAAqBO,EAAMC,OAC1C,GACA,IAaEC,MAAAA,gBAAyEC,gBAAAA,gBAI7EC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAA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AAM,yBACN8B,UAAU,aACVH,aAAa,QACbrC,MAAOsC,UAAYA,eACf/D,KACAvB,EAAUK,SAEbE,IAGJC,GACC0C,WAAAC,IAACgC,UAAI,CACHO,GAAG,IACHN,WAAW,OACX1B,MAAM,yBACN8B,UAAU,aACVH,aAAa,QACbrC,MAAOuC,UAAeA,kBAClBhE,KACAtB,EAAaI,SAEhBG,IAGJH,OAIP6C,WAAAC,IAACP,aAAa,CAAC0B,QAAS1C,KAAiB,EAAO+D,OAAK,IACpDlF,GACCyC,WAAAC,IAACP,eAAe,CAAAvC,SACbO,EACCsC,WAAAC,IAAC+B,kBAAQ,CAACnB,aAAc,MAAQ3D,EAAaC,SAC3C6C,WAAAC,IAACyC,cAAM,CAACC,OAAO,WAAYtE,MAG7Bd,EAASc,QAKhBpB,EAAO8D,WAAavD,GACnBwC,WAAAA,IAACH,WAAAA,WAAU,IAAKzB,EAAiB0B,MAAOkB,UAA2BA,2BAAA7D,SACjEsC,WAAAG,KAACF,qBAAqB,CAAAvC,SACpB6C,CAAAA,WAAAC,IAACP,kBAAkB,CAACe,YAAY,YAAYC,YAAY,QACvDhD,EACCsC,WAAAC,IAACP,oBAAoB,CAACiB,MAAM,OAAOC,OAAO,OAAOC,aAAc,KAAO3D,IAEtE8C,WAAAC,IAACP,YAAY,CAACoB,IAAK7D,EAAO8D,mBAKtB,IAGlB,CACEjB,MAAO8C,UAAKA,MACZC,YA5QmB"}
|
|
1
|
+
{"version":3,"file":"DialogComponent.js","sources":["../../../../src/components/DialogComponent/DialogComponent.tsx"],"sourcesContent":["import { forwardRef, useLayoutEffect, useRef, useState, useCallback } from 'react'\nimport ResizeObserver from 'resize-observer-polyfill'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { keyboardKeys } from 'shared/constants'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Visibility } from 'components/Visibility'\nimport { Skeleton } from 'components/Skeleton'\nimport { Button } from 'components/Button'\nimport { Spacer } from 'components/Spacer'\nimport { concatClassNames } from 'shared/utils/dom'\nimport type { Nullable } from 'shared/types'\nimport { DialogContainer } from './DialogContainer'\nimport Dragging from './images/dragging.svg?module'\nimport * as Styled from './style'\nimport { getCommonSizeProps } from './utils'\nimport {\n SIZES,\n SIZES_FANCY,\n SIZES_CAPTION,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n VISIBILITY_PORTRAIT,\n VISIBILITY_LANDSCAPE,\n VISIBILITY_LANDSCAPE_MEDIA,\n} from './constants'\nimport type { DialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'DialogComponent'\n\nconst resizeHandlerSymbol = Symbol('resize-handler')\n\nconst resizeObserver = new ResizeObserver((entries) => {\n entries.forEach((entry) => {\n if (typeof entry.target[resizeHandlerSymbol] === 'function') {\n entry.target[resizeHandlerSymbol](entry.target)\n }\n })\n})\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/DialogComponent/types.ts).\n */\nconst DialogComponent: React.ForwardRefExoticComponent<DialogComponentProps> = withMergedProps<\n DialogComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n iconButtonProps = {},\n captionProps = {},\n titleProps = {},\n subtitleProps = {},\n draggingIconProps = {},\n imgSrc = {},\n skeletonProps = {},\n fancy,\n floats,\n children,\n caption,\n title,\n subtitle,\n controls,\n imgLandscapePositionRight,\n imgPortraitPositionBottom,\n className,\n backgroundClassName,\n scrollFadingDisabled,\n draggable,\n loading,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n onGrab,\n onNudge,\n ...restProps\n } = props\n\n const dialogSizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const sizeProps = getCommonSizeProps(dialogSizeProps)\n\n const rootClassName = !fancy ? concatClassNames(className, backgroundClassName) : className\n\n const [scrollTop, setScrollTop] = useState<Nullable<boolean>>(null)\n const [scrollBottom, setScrollBottom] = useState<Nullable<boolean>>(null)\n\n const scrollable = useRef<HTMLDivElement | null>(null)\n\n const handleScrollThresholds = useCallback((e: HTMLDivElement) => {\n if (e.scrollHeight === e.clientHeight) {\n setScrollTop(null)\n setScrollBottom(null)\n } else {\n setScrollTop(e.scrollTop <= 0)\n setScrollBottom(Math.abs(e.scrollHeight - e.clientHeight - e.scrollTop) <= 1)\n }\n }, [])\n\n useLayoutEffect(() => {\n if (!scrollFadingDisabled && scrollable.current) {\n scrollable.current[resizeHandlerSymbol] = handleScrollThresholds\n resizeObserver.observe(scrollable.current)\n }\n\n return () => {\n if (scrollable.current) {\n resizeObserver.unobserve(scrollable.current)\n }\n }\n }, [handleScrollThresholds, scrollFadingDisabled])\n\n return (\n <Styled.Root {...restProps} {...dialogSizeProps} className={rootClassName} fancy={fancy} ref={ref}>\n {floats && floats(sizeProps)}\n {fancy && <Styled.FancyBackground className={backgroundClassName} />}\n {fancy && iconButtonProps.onClick && (\n <Styled.PositionedIconButton\n secondary\n size='xxl'\n icon='close'\n inset={{ top: 0, right: 0 }}\n {...iconButtonProps}\n />\n )}\n {(draggable || (imgSrc.portrait && !imgPortraitPositionBottom) || fancy) && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_PORTRAIT}>\n {fancy && <Spacer top={96} />}\n {draggable && (\n <Styled.DraggingHandle onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' {...draggingIconProps} />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n )}\n {imgSrc.portrait && !imgPortraitPositionBottom && (\n <Styled.MediaPortraitContainer top={!fancy}>\n <Styled.MediaPortrait>\n <Styled.Placeholder orientation='portrait' aspectRatio='3:1' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.portrait} />\n )}\n </Styled.MediaPortrait>\n </Styled.MediaPortraitContainer>\n )}\n </Visibility>\n )}\n {imgSrc.landscape && !imgLandscapePositionRight && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_LANDSCAPE_MEDIA}>\n <Styled.MediaLandscape>\n <Styled.Placeholder orientation='landscape' aspectRatio='5:7' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.landscape} />\n )}\n </Styled.MediaLandscape>\n </Visibility>\n )}\n {!fancy && iconButtonProps.onClick && (\n <Styled.PositionedIconButton size='l' icon='close' inset={{ top: 8, right: 8 }} {...iconButtonProps} />\n )}\n <DialogContainer {...dialogSizeProps} fancy={fancy}>\n {draggable && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_LANDSCAPE}>\n <Styled.DraggingHandle onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' {...draggingIconProps} />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n </Visibility>\n )}\n <Styled.Fading visible={scrollTop === false} />\n <Styled.ScrollableContent\n ref={scrollable}\n tabIndex={0}\n onScroll={(evt) => {\n if (!scrollFadingDisabled) {\n handleScrollThresholds(evt.currentTarget)\n }\n }}\n onKeyDown={(evt) => {\n if (keyboardKeys.ArrowUp.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, -13)\n } else if (keyboardKeys.ArrowDown.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, 13)\n }\n }}\n >\n {loading ? (\n <>\n <Skeleton>\n <Text appearance='heading' marginBottom='1.5em' sizes={SIZES_TITLE} {...sizeProps} {...titleProps} />\n </Skeleton>\n <Skeleton width='90%'>\n <Text\n appearance='body'\n marginBottom='0.4em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n />\n </Skeleton>\n <Skeleton width='70%'>\n <Text\n appearance='body'\n marginBottom='0.4em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n />\n </Skeleton>\n <Skeleton width='50%'>\n <Text\n appearance='body'\n marginBottom='0.8em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n />\n </Skeleton>\n </>\n ) : (\n <>\n {caption && (\n <Text\n appearance='body'\n color='content-onmain-tertiary'\n wordBreak='break-word'\n marginBottom='0.8em'\n sizes={SIZES_CAPTION}\n {...sizeProps}\n {...captionProps}\n >\n {caption}\n </Text>\n )}\n {title && (\n <Text\n as='h2'\n appearance='heading'\n color='content-onmain-primary'\n wordBreak='break-word'\n marginBottom='0.5em'\n sizes={SIZES_TITLE}\n {...sizeProps}\n {...titleProps}\n >\n {title}\n </Text>\n )}\n {subtitle && (\n <Text\n as='p'\n appearance='body'\n color='content-onmain-primary'\n wordBreak='break-word'\n marginBottom='0.8em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n >\n {subtitle}\n </Text>\n )}\n {children}\n </>\n )}\n </Styled.ScrollableContent>\n <Styled.Fading visible={scrollBottom === false} after />\n {controls && (\n <Styled.Controls>\n {loading ? (\n <Skeleton borderRadius={48} {...skeletonProps}>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : (\n controls(sizeProps)\n )}\n </Styled.Controls>\n )}\n </DialogContainer>\n {imgSrc.landscape && imgLandscapePositionRight && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_LANDSCAPE_MEDIA}>\n <Styled.MediaLandscape right>\n <Styled.Placeholder orientation='landscape' aspectRatio='5:7' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.landscape} />\n )}\n </Styled.MediaLandscape>\n </Visibility>\n )}\n {imgSrc.portrait && imgPortraitPositionBottom && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_PORTRAIT}>\n <Styled.MediaPortraitContainer bottom>\n <Styled.MediaPortrait>\n <Styled.Placeholder orientation='portrait' aspectRatio='3:1' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.portrait} />\n )}\n </Styled.MediaPortrait>\n </Styled.MediaPortraitContainer>\n </Visibility>\n )}\n </Styled.Root>\n )\n }),\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogComponent }\n\nexport { SIZES, SIZES_FANCY }\n"],"names":["resizeHandlerSymbol","Symbol","resizeObserver","ResizeObserver","default","entries","forEach","entry","target","DialogComponent","withMergedProps","forwardRef","props","ref","size","iconButtonProps","captionProps","titleProps","subtitleProps","draggingIconProps","imgSrc","skeletonProps","fancy","floats","children","caption","title","subtitle","controls","imgLandscapePositionRight","imgPortraitPositionBottom","className","backgroundClassName","scrollFadingDisabled","draggable","loading","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","onGrab","onNudge","restProps","dialogSizeProps","sizeProps","getCommonSizeProps","rootClassName","concatClassNames","scrollTop","setScrollTop","useState","scrollBottom","setScrollBottom","scrollable","useRef","handleScrollThresholds","useCallback","e","scrollHeight","clientHeight","Math","abs","useLayoutEffect","current","observe","unobserve","_jsxs","Styled","_jsx","jsx","onClick","secondary","icon","inset","top","right","portrait","jsxs","Visibility","sizes","VISIBILITY_PORTRAIT","Spacer","onPointerDown","tabIndex","onKeyDown","Icon","Dragging","color","orientation","aspectRatio","width","height","borderRadius","src","landscape","VISIBILITY_LANDSCAPE_MEDIA","DialogContainer","VISIBILITY_LANDSCAPE","visible","onScroll","evt","currentTarget","keyboardKeys","ArrowUp","validate","key","preventDefault","scrollBy","ArrowDown","_Fragment","Skeleton","Text","appearance","marginBottom","SIZES_TITLE","SIZES_SUBTITLE","wordBreak","SIZES_CAPTION","as","after","Button","preset","bottom","SIZES_FANCY","SIZES","displayName"],"mappings":"i1BA8BA,MAAMA,oBAAsBC,OAAO,kBAEnC,MAAMC,eAAiB,IAAIC,eAAcC,SAAEC,IACzCA,EAAQC,SAASC,WACJA,EAAMC,OAAOR,sBAAyB,YAC/CO,EAAMC,OAAOR,qBAAqBO,EAAMC,OAC1C,GACA,IAaEC,MAAAA,gBAAyEC,gBAAAA,gBAI7EC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,gBACVA,EAAkB,CAAE,EAAAC,aACpBA,EAAe,CAAE,EAAAC,WACjBA,EAAa,CAAE,EAAAC,cACfA,EAAgB,CAAE,EAAAC,kBAClBA,EAAoB,CAAE,EAAAC,OACtBA,EAAS,CAAE,EAAAC,cACXA,EAAgB,CAAE,EAAAC,MAClBA,EAAKC,OACLA,EAAMC,SACNA,EAAQC,QACRA,EAAOC,MACPA,EAAKC,SACLA,EAAQC,SACRA,EAAQC,0BACRA,EAAyBC,0BACzBA,EAAyBC,UACzBA,EAASC,oBACTA,EAAmBC,qBACnBA,EAAoBC,UACpBA,EAASC,QACTA,EAAOC,QACPA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,OACNA,EAAMC,QACNA,KACGC,GACDhC,EAEJ,MAAMiC,EAAkB,CACtB/B,OACAsB,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMK,EAAYC,yBAAmBF,GAErC,MAAMG,EAAiB1B,EAA2DS,EAAnDkB,IAAAA,iBAAiBlB,EAAWC,GAE3D,MAAOkB,EAAWC,GAAgBC,MAAQA,SAAoB,MAC9D,MAAOC,EAAcC,GAAmBF,MAAQA,SAAoB,MAEpE,MAAMG,EAAaC,aAA8B,MAEjD,MAAMC,EAAyBC,MAAWA,aAAEC,IACtCA,E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'../../external/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.mjs';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{keyboardKeys}from'../../shared/constants.mjs';import{DialogContainer}from'./DialogContainer.mjs';import SvgDragging from'./images/dragging.svg.mjs';import{Root,DraggingHandle,DraggingIconContainer,MediaPortrait,Placeholder,MediaSkeleton,Media,MediaLandscape,
|
|
1
|
+
import{forwardRef,useState,useRef,useCallback,useLayoutEffect}from'react';import ResizeObserver from'../../external/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.mjs';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{keyboardKeys}from'../../shared/constants.mjs';import{concatClassNames}from'../../shared/utils/dom.mjs';import{DialogContainer}from'./DialogContainer.mjs';import SvgDragging from'./images/dragging.svg.mjs';import{Root,FancyBackground,PositionedIconButton,DraggingHandle,DraggingIconContainer,MediaPortraitContainer,MediaPortrait,Placeholder,MediaSkeleton,Media,MediaLandscape,Fading,ScrollableContent,Controls}from'./style.mjs';import{getCommonSizeProps}from'./utils.mjs';import{SIZES_FANCY,SIZES,VISIBILITY_PORTRAIT,VISIBILITY_LANDSCAPE_MEDIA,VISIBILITY_LANDSCAPE,SIZES_TITLE,SIZES_SUBTITLE,SIZES_CAPTION}from'./constants.mjs';import{jsxs,jsx,Fragment}from'react/jsx-runtime';import{Visibility}from'../Visibility/Visibility.mjs';import{Spacer}from'../Spacer/Spacer.mjs';import{Icon}from'../Icon/Icon.mjs';import{Skeleton}from'../Skeleton/Skeleton.mjs';import{Text}from'../Text/Text.mjs';import{Button}from'../Button/Button.mjs';const resizeHandlerSymbol=Symbol('resize-handler');const resizeObserver=new ResizeObserver((e=>{e.forEach((e=>{typeof e.target[resizeHandlerSymbol]=='function'&&e.target[resizeHandlerSymbol](e.target)}))}));const DialogComponent=withMergedProps(forwardRef(((e,r)=>{const{size:o="s",iconButtonProps:i={},captionProps:t={},titleProps:s={},subtitleProps:n={},draggingIconProps:a={},imgSrc:l={},skeletonProps:c={},fancy:d,floats:m,children:g,caption:p,title:S,subtitle:I,controls:x,imgLandscapePositionRight:j,imgPortraitPositionBottom:h,className:b,backgroundClassName:u,scrollFadingDisabled:y,draggable:T,loading:z,sizeXXS:f,sizeXS:P,sizeS:B,sizeM:C,sizeL:E,sizeXL:k,onGrab:D,onNudge:L,...M}=e;const w={size:o,sizeXXS:f,sizeXS:P,sizeS:B,sizeM:C,sizeL:E,sizeXL:k};const R=getCommonSizeProps(w);const _=d?b:concatClassNames(b,u);const[A,v]=useState(null);const[N,V]=useState(null);const Z=useRef(null);const F=useCallback((e=>{e.scrollHeight===e.clientHeight?(v(null),V(null)):(v(e.scrollTop<=0),V(Math.abs(e.scrollHeight-e.clientHeight-e.scrollTop)<=1))}),[]);return useLayoutEffect((()=>(!y&&Z.current&&(Z.current[resizeHandlerSymbol]=F,resizeObserver.observe(Z.current)),()=>{Z.current&&resizeObserver.unobserve(Z.current)})),[F,y]),jsxs(Root,{...M,...w,className:_,fancy:d,ref:r,children:[m&&m(R),d&&jsx(FancyBackground,{className:u}),d&&i.onClick&&jsx(PositionedIconButton,{secondary:!0,size:"xxl",icon:"close",inset:{top:0,right:0},...i}),(T||l.portrait&&!h||d)&&jsxs(Visibility,{...w,sizes:VISIBILITY_PORTRAIT,children:[d&&jsx(Spacer,{top:96}),T&&jsx(DraggingHandle,{onPointerDown:D,children:jsx(DraggingIconContainer,{tabIndex:0,onKeyDown:L,children:jsx(Icon,{icon:jsx(SvgDragging,{}),size:34,color:"content-onmain-tertiary",...a})})}),l.portrait&&!h&&jsx(MediaPortraitContainer,{top:!d,children:jsxs(MediaPortrait,{children:[jsx(Placeholder,{orientation:"portrait",aspectRatio:"3:1"}),z?jsx(MediaSkeleton,{width:"100%",height:"100%",borderRadius:0,...c}):jsx(Media,{src:l.portrait})]})})]}),l.landscape&&!j&&jsx(Visibility,{...w,sizes:VISIBILITY_LANDSCAPE_MEDIA,children:jsxs(MediaLandscape,{children:[jsx(Placeholder,{orientation:"landscape",aspectRatio:"5:7"}),z?jsx(MediaSkeleton,{width:"100%",height:"100%",borderRadius:0,...c}):jsx(Media,{src:l.landscape})]})}),!d&&i.onClick&&jsx(PositionedIconButton,{size:"l",icon:"close",inset:{top:8,right:8},...i}),jsxs(DialogContainer,{...w,fancy:d,children:[T&&jsx(Visibility,{...w,sizes:VISIBILITY_LANDSCAPE,children:jsx(DraggingHandle,{onPointerDown:D,children:jsx(DraggingIconContainer,{tabIndex:0,onKeyDown:L,children:jsx(Icon,{icon:jsx(SvgDragging,{}),size:34,color:"content-onmain-tertiary",...a})})})}),jsx(Fading,{visible:A===!1}),jsx(ScrollableContent,{ref:Z,tabIndex:0,onScroll:e=>{y||F(e.currentTarget)},onKeyDown:e=>{keyboardKeys.ArrowUp.validate(e.key)?(e.preventDefault(),e.currentTarget.scrollBy(0,-13)):keyboardKeys.ArrowDown.validate(e.key)&&(e.preventDefault(),e.currentTarget.scrollBy(0,13))},children:jsxs(Fragment,z?{children:[jsx(Skeleton,{children:jsx(Text,{appearance:"heading",marginBottom:"1.5em",sizes:SIZES_TITLE,...R,...s})}),jsx(Skeleton,{width:"90%",children:jsx(Text,{appearance:"body",marginBottom:"0.4em",sizes:SIZES_SUBTITLE,...R,...n})}),jsx(Skeleton,{width:"70%",children:jsx(Text,{appearance:"body",marginBottom:"0.4em",sizes:SIZES_SUBTITLE,...R,...n})}),jsx(Skeleton,{width:"50%",children:jsx(Text,{appearance:"body",marginBottom:"0.8em",sizes:SIZES_SUBTITLE,...R,...n})})]}:{children:[p&&jsx(Text,{appearance:"body",color:"content-onmain-tertiary",wordBreak:"break-word",marginBottom:"0.8em",sizes:SIZES_CAPTION,...R,...t,children:p}),S&&jsx(Text,{as:"h2",appearance:"heading",color:"content-onmain-primary",wordBreak:"break-word",marginBottom:"0.5em",sizes:SIZES_TITLE,...R,...s,children:S}),I&&jsx(Text,{as:"p",appearance:"body",color:"content-onmain-primary",wordBreak:"break-word",marginBottom:"0.8em",sizes:SIZES_SUBTITLE,...R,...n,children:I}),g]})}),jsx(Fading,{visible:N===!1,after:!0}),x&&jsx(Controls,{children:z?jsx(Skeleton,{borderRadius:48,...c,children:jsx(Button,{preset:"brand",...R})}):x(R)})]}),l.landscape&&j&&jsx(Visibility,{...w,sizes:VISIBILITY_LANDSCAPE_MEDIA,children:jsxs(MediaLandscape,{right:!0,children:[jsx(Placeholder,{orientation:"landscape",aspectRatio:"5:7"}),z?jsx(MediaSkeleton,{width:"100%",height:"100%",borderRadius:0,...c}):jsx(Media,{src:l.landscape})]})}),l.portrait&&h&&jsx(Visibility,{...w,sizes:VISIBILITY_PORTRAIT,children:jsx(MediaPortraitContainer,{bottom:!0,children:jsxs(MediaPortrait,{children:[jsx(Placeholder,{orientation:"portrait",aspectRatio:"3:1"}),z?jsx(MediaSkeleton,{width:"100%",height:"100%",borderRadius:0,...c}):jsx(Media,{src:l.portrait})]})})})]})})),{sizes:e=>e.fancy?SIZES_FANCY:SIZES,displayName:'DialogComponent'});export{DialogComponent,SIZES,SIZES_FANCY};
|
|
2
2
|
//# sourceMappingURL=DialogComponent.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogComponent.mjs","sources":["../../../../src/components/DialogComponent/DialogComponent.tsx"],"sourcesContent":["import { forwardRef, useLayoutEffect, useRef, useState, useCallback } from 'react'\nimport ResizeObserver from 'resize-observer-polyfill'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { keyboardKeys } from 'shared/constants'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Visibility } from 'components/Visibility'\nimport { Skeleton } from 'components/Skeleton'\nimport { Button } from 'components/Button'\nimport type { Nullable } from 'shared/types'\nimport { DialogContainer } from './DialogContainer'\nimport Dragging from './images/dragging.svg?module'\nimport * as Styled from './style'\nimport { getCommonSizeProps } from './utils'\nimport {\n SIZES,\n SIZES_CAPTION,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n VISIBILITY_PORTRAIT,\n VISIBILITY_LANDSCAPE,\n VISIBILITY_LANDSCAPE_MEDIA,\n} from './constants'\nimport type { DialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'DialogComponent'\n\nconst resizeHandlerSymbol = Symbol('resize-handler')\n\nconst resizeObserver = new ResizeObserver((entries) => {\n entries.forEach((entry) => {\n if (typeof entry.target[resizeHandlerSymbol] === 'function') {\n entry.target[resizeHandlerSymbol](entry.target)\n }\n })\n})\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/DialogComponent/types.ts).\n */\nconst DialogComponent: React.ForwardRefExoticComponent<DialogComponentProps> = withMergedProps<\n DialogComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n iconButtonProps = {},\n captionProps = {},\n titleProps = {},\n subtitleProps = {},\n draggingIconProps = {},\n imgSrc = {},\n skeletonProps = {},\n children,\n caption,\n title,\n subtitle,\n controls,\n imgLandscapePositionRight,\n draggable,\n loading,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n onGrab,\n onNudge,\n ...restProps\n } = props\n\n const dialogSizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const sizeProps = getCommonSizeProps(dialogSizeProps)\n\n const [scrollTop, setScrollTop] = useState<Nullable<boolean>>(null)\n const [scrollBottom, setScrollBottom] = useState<Nullable<boolean>>(null)\n\n const scrollable = useRef<HTMLDivElement | null>(null)\n\n const handleScrollThresholds = useCallback((e: HTMLDivElement) => {\n if (e.scrollHeight === e.clientHeight) {\n setScrollTop(null)\n setScrollBottom(null)\n } else {\n setScrollTop(e.scrollTop <= 0)\n setScrollBottom(Math.abs(e.scrollHeight - e.clientHeight - e.scrollTop) <= 1)\n }\n }, [])\n\n useLayoutEffect(() => {\n if (scrollable.current) {\n scrollable.current[resizeHandlerSymbol] = handleScrollThresholds\n resizeObserver.observe(scrollable.current)\n }\n\n return () => {\n if (scrollable.current) {\n resizeObserver.unobserve(scrollable.current)\n }\n }\n }, [handleScrollThresholds])\n\n return (\n <Styled.Root {...restProps} {...dialogSizeProps} ref={ref}>\n {(draggable || imgSrc.portrait) && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_PORTRAIT}>\n {draggable && (\n <Styled.DraggingHandle onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' {...draggingIconProps} />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n )}\n {imgSrc.portrait && (\n <Styled.MediaPortrait>\n <Styled.Placeholder orientation='portrait' aspectRatio='3:1' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.portrait} />\n )}\n </Styled.MediaPortrait>\n )}\n </Visibility>\n )}\n {imgSrc.landscape && !imgLandscapePositionRight && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_LANDSCAPE_MEDIA}>\n <Styled.MediaLandscape>\n <Styled.Placeholder orientation='landscape' aspectRatio='5:7' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.landscape} />\n )}\n </Styled.MediaLandscape>\n </Visibility>\n )}\n {iconButtonProps.onClick && <Styled.PositionedIconButton size='l' icon='close' {...iconButtonProps} />}\n <DialogContainer {...dialogSizeProps}>\n {draggable && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_LANDSCAPE}>\n <Styled.DraggingHandle onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' {...draggingIconProps} />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n </Visibility>\n )}\n <Styled.Fading visible={scrollTop === false} />\n <Styled.ScrollableContent\n ref={scrollable}\n tabIndex={0}\n onScroll={(evt) => {\n handleScrollThresholds(evt.currentTarget)\n }}\n onKeyDown={(evt) => {\n if (keyboardKeys.ArrowUp.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, -13)\n } else if (keyboardKeys.ArrowDown.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, 13)\n }\n }}\n >\n {loading ? (\n <>\n <Skeleton>\n <Text appearance='heading' marginBottom='1.5em' sizes={SIZES_TITLE} {...sizeProps} {...titleProps} />\n </Skeleton>\n <Skeleton width='90%'>\n <Text\n appearance='body'\n marginBottom='0.4em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n />\n </Skeleton>\n <Skeleton width='70%'>\n <Text\n appearance='body'\n marginBottom='0.4em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n />\n </Skeleton>\n <Skeleton width='50%'>\n <Text\n appearance='body'\n marginBottom='0.8em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n />\n </Skeleton>\n </>\n ) : (\n <>\n {caption && (\n <Text\n appearance='body'\n color='content-onmain-tertiary'\n wordBreak='break-word'\n marginBottom='0.8em'\n sizes={SIZES_CAPTION}\n {...sizeProps}\n {...captionProps}\n >\n {caption}\n </Text>\n )}\n {title && (\n <Text\n as='h2'\n appearance='heading'\n color='content-onmain-primary'\n wordBreak='break-word'\n marginBottom='0.5em'\n sizes={SIZES_TITLE}\n {...sizeProps}\n {...titleProps}\n >\n {title}\n </Text>\n )}\n {subtitle && (\n <Text\n as='p'\n appearance='body'\n color='content-onmain-primary'\n wordBreak='break-word'\n marginBottom='0.8em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n >\n {subtitle}\n </Text>\n )}\n {children}\n </>\n )}\n </Styled.ScrollableContent>\n <Styled.Fading visible={scrollBottom === false} after />\n {controls && (\n <Styled.Controls>\n {loading ? (\n <Skeleton borderRadius={48} {...skeletonProps}>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : (\n controls(sizeProps)\n )}\n </Styled.Controls>\n )}\n </DialogContainer>\n {imgSrc.landscape && imgLandscapePositionRight && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_LANDSCAPE_MEDIA}>\n <Styled.MediaLandscape>\n <Styled.Placeholder orientation='landscape' aspectRatio='5:7' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.landscape} />\n )}\n </Styled.MediaLandscape>\n </Visibility>\n )}\n </Styled.Root>\n )\n }),\n {\n sizes: SIZES,\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogComponent }\n\nexport { SIZES }\n"],"names":["resizeHandlerSymbol","Symbol","resizeObserver","ResizeObserver","entries","forEach","entry","target","DialogComponent","withMergedProps","forwardRef","props","ref","size","iconButtonProps","captionProps","titleProps","subtitleProps","draggingIconProps","imgSrc","skeletonProps","children","caption","title","subtitle","controls","imgLandscapePositionRight","draggable","loading","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","onGrab","onNudge","restProps","dialogSizeProps","sizeProps","getCommonSizeProps","scrollTop","setScrollTop","useState","scrollBottom","setScrollBottom","scrollable","useRef","handleScrollThresholds","useCallback","e","scrollHeight","clientHeight","Math","abs","useLayoutEffect","current","observe","unobserve","_jsxs","Styled","portrait","Visibility","sizes","VISIBILITY_PORTRAIT","_jsx","onPointerDown","tabIndex","onKeyDown","Icon","icon","Dragging","color","orientation","aspectRatio","width","height","borderRadius","src","landscape","VISIBILITY_LANDSCAPE_MEDIA","onClick","DialogContainer","VISIBILITY_LANDSCAPE","visible","onScroll","evt","currentTarget","keyboardKeys","ArrowUp","validate","key","preventDefault","scrollBy","ArrowDown","_Fragment","Skeleton","Text","appearance","marginBottom","SIZES_TITLE","SIZES_SUBTITLE","wordBreak","SIZES_CAPTION","as","after","Button","preset","SIZES","displayName"],"mappings":"siCA2BA,MAAMA,oBAAsBC,OAAO,kBAEnC,MAAMC,eAAiB,IAAIC,gBAAgBC,IACzCA,EAAQC,SAASC,WACJA,EAAMC,OAAOP,sBAAyB,YAC/CM,EAAMC,OAAOP,qBAAqBM,EAAMC,OAC1C,GACA,IAaEC,MAAAA,gBAAyEC,gBAI7EC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,gBACVA,EAAkB,CAAE,EAAAC,aACpBA,EAAe,CAAE,EAAAC,WACjBA,EAAa,CAAE,EAAAC,cACfA,EAAgB,CAAE,EAAAC,kBAClBA,EAAoB,CAAE,EAAAC,OACtBA,EAAS,CAAE,EAAAC,cACXA,EAAgB,CAAE,EAAAC,SAClBA,EAAQC,QACRA,EAAOC,MACPA,EAAKC,SACLA,EAAQC,SACRA,EAAQC,0BACRA,EAAyBC,UACzBA,EAASC,QACTA,EAAOC,QACPA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,OACNA,EAAMC,QACNA,KACGC,GACD1B,EAEJ,MAAM2B,EAAkB,CACtBzB,OACAgB,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMK,EAAYC,mBAAmBF,GAErC,MAAOG,EAAWC,GAAgBC,SAA4B,MAC9D,MAAOC,EAAcC,GAAmBF,SAA4B,MAEpE,MAAMG,EAAaC,OAA8B,MAEjD,MAAMC,EAAyBC,aAAaC,IACtCA,EAAEC,eAAiBD,EAAEE,cACvBV,EAAa,MACbG,EAAgB,QAEhBH,EAAaQ,EAAET,WAAa,GAC5BI,EAAgBQ,KAAKC,IAAIJ,EAAEC,aAAeD,EAAEE,aAAeF,EAAET,YAAc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AM,yBACN8B,UAAU,aACVH,aAAa,QACbpC,MAAOqC,eACH7D,KACAvB,EAAUK,SAEbE,IAGJC,GACCyC,IAACgC,KAAI,CACHO,GAAG,IACHN,WAAW,OACX1B,MAAM,yBACN8B,UAAU,aACVH,aAAa,QACbpC,MAAOsC,kBACH9D,KACAtB,EAAaI,SAEhBG,IAGJH,OAIP4C,IAACL,OAAa,CAACwB,QAASxC,KAAiB,EAAO6D,OAAK,IACpDhF,GACCwC,IAACL,SAAe,CAAAvC,SACbO,EACCqC,IAAC+B,SAAQ,CAACnB,aAAc,MAAQzD,EAAaC,SAC3C4C,IAACyC,OAAM,CAACC,OAAO,WAAYpE,MAG7Bd,EAASc,QAKhBpB,EAAO4D,WAAarD,GACnBuC,IAACH,WAAU,IAAKxB,EAAiByB,MAAOiB,2BAA2B3D,SACjEsC,KAACC,eAAqB,CAAAvC,SACpB4C,CAAAA,IAACL,YAAkB,CAACa,YAAY,YAAYC,YAAY,QACvD9C,EACCqC,IAACL,cAAoB,CAACe,MAAM,OAAOC,OAAO,OAAOC,aAAc,KAAOzD,IAEtE6C,IAACL,MAAY,CAACkB,IAAK3D,EAAO4D,mBAKtB,IAGlB,CACEhB,MAAO6C,MACPC,YA5QmB"}
|
|
1
|
+
{"version":3,"file":"DialogComponent.mjs","sources":["../../../../src/components/DialogComponent/DialogComponent.tsx"],"sourcesContent":["import { forwardRef, useLayoutEffect, useRef, useState, useCallback } from 'react'\nimport ResizeObserver from 'resize-observer-polyfill'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { keyboardKeys } from 'shared/constants'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Visibility } from 'components/Visibility'\nimport { Skeleton } from 'components/Skeleton'\nimport { Button } from 'components/Button'\nimport { Spacer } from 'components/Spacer'\nimport { concatClassNames } from 'shared/utils/dom'\nimport type { Nullable } from 'shared/types'\nimport { DialogContainer } from './DialogContainer'\nimport Dragging from './images/dragging.svg?module'\nimport * as Styled from './style'\nimport { getCommonSizeProps } from './utils'\nimport {\n SIZES,\n SIZES_FANCY,\n SIZES_CAPTION,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n VISIBILITY_PORTRAIT,\n VISIBILITY_LANDSCAPE,\n VISIBILITY_LANDSCAPE_MEDIA,\n} from './constants'\nimport type { DialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'DialogComponent'\n\nconst resizeHandlerSymbol = Symbol('resize-handler')\n\nconst resizeObserver = new ResizeObserver((entries) => {\n entries.forEach((entry) => {\n if (typeof entry.target[resizeHandlerSymbol] === 'function') {\n entry.target[resizeHandlerSymbol](entry.target)\n }\n })\n})\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/DialogComponent/types.ts).\n */\nconst DialogComponent: React.ForwardRefExoticComponent<DialogComponentProps> = withMergedProps<\n DialogComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n iconButtonProps = {},\n captionProps = {},\n titleProps = {},\n subtitleProps = {},\n draggingIconProps = {},\n imgSrc = {},\n skeletonProps = {},\n fancy,\n floats,\n children,\n caption,\n title,\n subtitle,\n controls,\n imgLandscapePositionRight,\n imgPortraitPositionBottom,\n className,\n backgroundClassName,\n scrollFadingDisabled,\n draggable,\n loading,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n onGrab,\n onNudge,\n ...restProps\n } = props\n\n const dialogSizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const sizeProps = getCommonSizeProps(dialogSizeProps)\n\n const rootClassName = !fancy ? concatClassNames(className, backgroundClassName) : className\n\n const [scrollTop, setScrollTop] = useState<Nullable<boolean>>(null)\n const [scrollBottom, setScrollBottom] = useState<Nullable<boolean>>(null)\n\n const scrollable = useRef<HTMLDivElement | null>(null)\n\n const handleScrollThresholds = useCallback((e: HTMLDivElement) => {\n if (e.scrollHeight === e.clientHeight) {\n setScrollTop(null)\n setScrollBottom(null)\n } else {\n setScrollTop(e.scrollTop <= 0)\n setScrollBottom(Math.abs(e.scrollHeight - e.clientHeight - e.scrollTop) <= 1)\n }\n }, [])\n\n useLayoutEffect(() => {\n if (!scrollFadingDisabled && scrollable.current) {\n scrollable.current[resizeHandlerSymbol] = handleScrollThresholds\n resizeObserver.observe(scrollable.current)\n }\n\n return () => {\n if (scrollable.current) {\n resizeObserver.unobserve(scrollable.current)\n }\n }\n }, [handleScrollThresholds, scrollFadingDisabled])\n\n return (\n <Styled.Root {...restProps} {...dialogSizeProps} className={rootClassName} fancy={fancy} ref={ref}>\n {floats && floats(sizeProps)}\n {fancy && <Styled.FancyBackground className={backgroundClassName} />}\n {fancy && iconButtonProps.onClick && (\n <Styled.PositionedIconButton\n secondary\n size='xxl'\n icon='close'\n inset={{ top: 0, right: 0 }}\n {...iconButtonProps}\n />\n )}\n {(draggable || (imgSrc.portrait && !imgPortraitPositionBottom) || fancy) && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_PORTRAIT}>\n {fancy && <Spacer top={96} />}\n {draggable && (\n <Styled.DraggingHandle onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' {...draggingIconProps} />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n )}\n {imgSrc.portrait && !imgPortraitPositionBottom && (\n <Styled.MediaPortraitContainer top={!fancy}>\n <Styled.MediaPortrait>\n <Styled.Placeholder orientation='portrait' aspectRatio='3:1' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.portrait} />\n )}\n </Styled.MediaPortrait>\n </Styled.MediaPortraitContainer>\n )}\n </Visibility>\n )}\n {imgSrc.landscape && !imgLandscapePositionRight && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_LANDSCAPE_MEDIA}>\n <Styled.MediaLandscape>\n <Styled.Placeholder orientation='landscape' aspectRatio='5:7' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.landscape} />\n )}\n </Styled.MediaLandscape>\n </Visibility>\n )}\n {!fancy && iconButtonProps.onClick && (\n <Styled.PositionedIconButton size='l' icon='close' inset={{ top: 8, right: 8 }} {...iconButtonProps} />\n )}\n <DialogContainer {...dialogSizeProps} fancy={fancy}>\n {draggable && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_LANDSCAPE}>\n <Styled.DraggingHandle onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' {...draggingIconProps} />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n </Visibility>\n )}\n <Styled.Fading visible={scrollTop === false} />\n <Styled.ScrollableContent\n ref={scrollable}\n tabIndex={0}\n onScroll={(evt) => {\n if (!scrollFadingDisabled) {\n handleScrollThresholds(evt.currentTarget)\n }\n }}\n onKeyDown={(evt) => {\n if (keyboardKeys.ArrowUp.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, -13)\n } else if (keyboardKeys.ArrowDown.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, 13)\n }\n }}\n >\n {loading ? (\n <>\n <Skeleton>\n <Text appearance='heading' marginBottom='1.5em' sizes={SIZES_TITLE} {...sizeProps} {...titleProps} />\n </Skeleton>\n <Skeleton width='90%'>\n <Text\n appearance='body'\n marginBottom='0.4em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n />\n </Skeleton>\n <Skeleton width='70%'>\n <Text\n appearance='body'\n marginBottom='0.4em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n />\n </Skeleton>\n <Skeleton width='50%'>\n <Text\n appearance='body'\n marginBottom='0.8em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n />\n </Skeleton>\n </>\n ) : (\n <>\n {caption && (\n <Text\n appearance='body'\n color='content-onmain-tertiary'\n wordBreak='break-word'\n marginBottom='0.8em'\n sizes={SIZES_CAPTION}\n {...sizeProps}\n {...captionProps}\n >\n {caption}\n </Text>\n )}\n {title && (\n <Text\n as='h2'\n appearance='heading'\n color='content-onmain-primary'\n wordBreak='break-word'\n marginBottom='0.5em'\n sizes={SIZES_TITLE}\n {...sizeProps}\n {...titleProps}\n >\n {title}\n </Text>\n )}\n {subtitle && (\n <Text\n as='p'\n appearance='body'\n color='content-onmain-primary'\n wordBreak='break-word'\n marginBottom='0.8em'\n sizes={SIZES_SUBTITLE}\n {...sizeProps}\n {...subtitleProps}\n >\n {subtitle}\n </Text>\n )}\n {children}\n </>\n )}\n </Styled.ScrollableContent>\n <Styled.Fading visible={scrollBottom === false} after />\n {controls && (\n <Styled.Controls>\n {loading ? (\n <Skeleton borderRadius={48} {...skeletonProps}>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : (\n controls(sizeProps)\n )}\n </Styled.Controls>\n )}\n </DialogContainer>\n {imgSrc.landscape && imgLandscapePositionRight && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_LANDSCAPE_MEDIA}>\n <Styled.MediaLandscape right>\n <Styled.Placeholder orientation='landscape' aspectRatio='5:7' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.landscape} />\n )}\n </Styled.MediaLandscape>\n </Visibility>\n )}\n {imgSrc.portrait && imgPortraitPositionBottom && (\n <Visibility {...dialogSizeProps} sizes={VISIBILITY_PORTRAIT}>\n <Styled.MediaPortraitContainer bottom>\n <Styled.MediaPortrait>\n <Styled.Placeholder orientation='portrait' aspectRatio='3:1' />\n {loading ? (\n <Styled.MediaSkeleton width='100%' height='100%' borderRadius={0} {...skeletonProps} />\n ) : (\n <Styled.Media src={imgSrc.portrait} />\n )}\n </Styled.MediaPortrait>\n </Styled.MediaPortraitContainer>\n </Visibility>\n )}\n </Styled.Root>\n )\n }),\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogComponent }\n\nexport { SIZES, SIZES_FANCY }\n"],"names":["resizeHandlerSymbol","Symbol","resizeObserver","ResizeObserver","entries","forEach","entry","target","DialogComponent","withMergedProps","forwardRef","props","ref","size","iconButtonProps","captionProps","titleProps","subtitleProps","draggingIconProps","imgSrc","skeletonProps","fancy","floats","children","caption","title","subtitle","controls","imgLandscapePositionRight","imgPortraitPositionBottom","className","backgroundClassName","scrollFadingDisabled","draggable","loading","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","onGrab","onNudge","restProps","dialogSizeProps","sizeProps","getCommonSizeProps","rootClassName","concatClassNames","scrollTop","setScrollTop","useState","scrollBottom","setScrollBottom","scrollable","useRef","handleScrollThresholds","useCallback","e","scrollHeight","clientHeight","Math","abs","useLayoutEffect","current","observe","unobserve","_jsxs","Styled","_jsx","onClick","secondary","icon","inset","top","right","portrait","Visibility","sizes","VISIBILITY_PORTRAIT","Spacer","onPointerDown","tabIndex","onKeyDown","Icon","Dragging","color","orientation","aspectRatio","width","height","borderRadius","src","landscape","VISIBILITY_LANDSCAPE_MEDIA","DialogContainer","VISIBILITY_LANDSCAPE","visible","onScroll","evt","currentTarget","keyboardKeys","ArrowUp","validate","key","preventDefault","scrollBy","ArrowDown","_Fragment","Skeleton","Text","appearance","marginBottom","SIZES_TITLE","SIZES_SUBTITLE","wordBreak","SIZES_CAPTION","as","after","Button","preset","bottom","SIZES_FANCY","SIZES","displayName"],"mappings":"2rCA8BA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C,oBAAoBxD,SAC1D8C,IAACD,uBAA6B,CAACqD,QAAM,EAAAlG,SACnC4C,KAACC,cAAoB,CAAA7C,SACnB8C,CAAAA,IAACD,YAAkB,CAACmB,YAAY,WAAWC,YAAY,QACtDtD,EACCmC,IAACD,cAAoB,CAACqB,MAAM,OAAOC,OAAO,OAAOC,aAAc,KAAOvE,IAEtEiD,IAACD,MAAY,CAACwB,IAAKzE,EAAOyD,oBAMxB,IAGlB,CACEE,MAAQnE,GAAWA,EAAMU,MAAQqG,YAAcC,MAC/CC,YApTmB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var withMergedProps=require('../../hocs/withMergedProps.js');var style=require('./style.js');var constants=require('./constants.js');var require$$0=require('react/jsx-runtime');const DialogContainer=withMergedProps.withMergedProps((({size:e="s",...r})=>require$$0.jsx(style.Container,{...r,size:e})),{sizes:constants.SIZES_CONTAINER,displayName:'DialogContainer'});exports.DialogContainer=DialogContainer;
|
|
1
|
+
'use strict';var withMergedProps=require('../../hocs/withMergedProps.js');var style=require('./style.js');var constants=require('./constants.js');var require$$0=require('react/jsx-runtime');const DialogContainer=withMergedProps.withMergedProps((({size:e="s",...r})=>require$$0.jsx(style.Container,{...r,size:e})),{sizes:e=>e.fancy?constants.SIZES_CONTAINER_FANCY:constants.SIZES_CONTAINER,displayName:'DialogContainer'});exports.DialogContainer=DialogContainer;
|
|
2
2
|
//# sourceMappingURL=DialogContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogContainer.js","sources":["../../../../src/components/DialogComponent/DialogContainer.tsx"],"sourcesContent":["import { withMergedProps } from 'hocs/withMergedProps'\nimport * as Styled from './style'\nimport { SIZES_CONTAINER } from './constants'\nimport type { DialogContainerProps } from './types'\n\nconst COMPONENT_NAME = 'DialogContainer'\n\nconst DialogContainer: React.ForwardRefExoticComponent<DialogContainerProps> = withMergedProps<DialogContainerProps>(\n ({ size = 's', ...restProps }) => <Styled.Container {...restProps} size={size} />,\n {\n sizes: SIZES_CONTAINER,\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogContainer }\n"],"names":["DialogContainer","withMergedProps","size","restProps","_jsx","Styled","sizes","SIZES_CONTAINER","displayName"],"mappings":"8LAOA,MAAMA,gBAAyEC,gBAAeA,iBAC5F,EAAGC,OAAO,OAAQC,KAAgBC,WAAAA,IAACC,MAAAA,UAAgB,IAAKF,EAAWD,KAAMA,KACzE,CACEI,
|
|
1
|
+
{"version":3,"file":"DialogContainer.js","sources":["../../../../src/components/DialogComponent/DialogContainer.tsx"],"sourcesContent":["import { withMergedProps } from 'hocs/withMergedProps'\nimport * as Styled from './style'\nimport { SIZES_CONTAINER, SIZES_CONTAINER_FANCY } from './constants'\nimport type { DialogContainerProps } from './types'\n\nconst COMPONENT_NAME = 'DialogContainer'\n\nconst DialogContainer: React.ForwardRefExoticComponent<DialogContainerProps> = withMergedProps<DialogContainerProps>(\n ({ size = 's', ...restProps }) => <Styled.Container {...restProps} size={size} />,\n {\n sizes: (props) => (props.fancy ? SIZES_CONTAINER_FANCY : SIZES_CONTAINER),\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogContainer }\n"],"names":["DialogContainer","withMergedProps","size","restProps","_jsx","Styled","sizes","props","fancy","SIZES_CONTAINER_FANCY","SIZES_CONTAINER","displayName"],"mappings":"8LAOA,MAAMA,gBAAyEC,gBAAeA,iBAC5F,EAAGC,OAAO,OAAQC,KAAgBC,WAAAA,IAACC,MAAAA,UAAgB,IAAKF,EAAWD,KAAMA,KACzE,CACEI,MAAQC,GAAWA,EAAMC,MAAQC,UAAqBA,sBAAGC,UAAgBA,gBACzEC,YANmB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{Container}from'./style.mjs';import{SIZES_CONTAINER}from'./constants.mjs';import{jsx}from'react/jsx-runtime';const DialogContainer=withMergedProps((({size:o="s",...r})=>jsx(Container,{...r,size:o})),{sizes:SIZES_CONTAINER,displayName:'DialogContainer'});export{DialogContainer};
|
|
1
|
+
import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{Container}from'./style.mjs';import{SIZES_CONTAINER_FANCY,SIZES_CONTAINER}from'./constants.mjs';import{jsx}from'react/jsx-runtime';const DialogContainer=withMergedProps((({size:o="s",...r})=>jsx(Container,{...r,size:o})),{sizes:o=>o.fancy?SIZES_CONTAINER_FANCY:SIZES_CONTAINER,displayName:'DialogContainer'});export{DialogContainer};
|
|
2
2
|
//# sourceMappingURL=DialogContainer.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogContainer.mjs","sources":["../../../../src/components/DialogComponent/DialogContainer.tsx"],"sourcesContent":["import { withMergedProps } from 'hocs/withMergedProps'\nimport * as Styled from './style'\nimport { SIZES_CONTAINER } from './constants'\nimport type { DialogContainerProps } from './types'\n\nconst COMPONENT_NAME = 'DialogContainer'\n\nconst DialogContainer: React.ForwardRefExoticComponent<DialogContainerProps> = withMergedProps<DialogContainerProps>(\n ({ size = 's', ...restProps }) => <Styled.Container {...restProps} size={size} />,\n {\n sizes: SIZES_CONTAINER,\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogContainer }\n"],"names":["DialogContainer","withMergedProps","size","restProps","_jsx","Styled","sizes","SIZES_CONTAINER","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DialogContainer.mjs","sources":["../../../../src/components/DialogComponent/DialogContainer.tsx"],"sourcesContent":["import { withMergedProps } from 'hocs/withMergedProps'\nimport * as Styled from './style'\nimport { SIZES_CONTAINER, SIZES_CONTAINER_FANCY } from './constants'\nimport type { DialogContainerProps } from './types'\n\nconst COMPONENT_NAME = 'DialogContainer'\n\nconst DialogContainer: React.ForwardRefExoticComponent<DialogContainerProps> = withMergedProps<DialogContainerProps>(\n ({ size = 's', ...restProps }) => <Styled.Container {...restProps} size={size} />,\n {\n sizes: (props) => (props.fancy ? SIZES_CONTAINER_FANCY : SIZES_CONTAINER),\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogContainer }\n"],"names":["DialogContainer","withMergedProps","size","restProps","_jsx","Styled","sizes","props","fancy","SIZES_CONTAINER_FANCY","SIZES_CONTAINER","displayName"],"mappings":"qMAOA,MAAMA,gBAAyEC,iBAC7E,EAAGC,OAAO,OAAQC,KAAgBC,IAACC,UAAgB,IAAKF,EAAWD,KAAMA,KACzE,CACEI,MAAQC,GAAWA,EAAMC,MAAQC,sBAAwBC,gBACzDC,YANmB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';var ramda=require('ramda');const SIZES={xxl:{maxWidth:1228,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},'xxl-landscape':{maxWidth:1228,width:'100vw',minWidth:'min-content',fontSize:16,height:'65vh',minHeight:288,maxHeight:600,flexDirection:'row',borderRadius:20},xl:{maxWidth:960,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},'xl-landscape':{maxWidth:960,width:'100vw',minWidth:'min-content',fontSize:16,height:'65vh',minHeight:288,maxHeight:456,flexDirection:'row',borderRadius:20},l:{maxWidth:780,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},'l-landscape':{maxWidth:780,width:'100vw',minWidth:'min-content',fontSize:16,height:'65vh',minHeight:288,maxHeight:392,flexDirection:'row',borderRadius:20},m:{maxWidth:560,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},s:{maxWidth:440,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},xs:{maxWidth:304,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20}};const SIZES_FANCY={xxl:ramda.omit(['borderRadius'],SIZES.xxl),'xxl-landscape':ramda.omit(['borderRadius'],SIZES['xxl-landscape']),xl:ramda.omit(['borderRadius'],SIZES.xl),'xl-landscape':ramda.omit(['borderRadius'],SIZES['xl-landscape']),l:ramda.omit(['borderRadius'],SIZES.l),'l-landscape':ramda.omit(['borderRadius'],SIZES['l-landscape']),m:ramda.omit(['borderRadius'],SIZES.m),s:ramda.omit(['borderRadius'],SIZES.s),xs:ramda.omit(['borderRadius'],SIZES.xs)};const SIZES_CONTAINER={xxl:{padding:48},'xxl-landscape':{padding:48},xl:{padding:40},'xl-landscape':{padding:40},l:{padding:36},'l-landscape':{padding:36},m:{padding:32},s:{padding:32},xs:{padding:24}};const SIZES_CONTAINER_FANCY={xxl:SIZES_CONTAINER.xxl,'xxl-landscape':{...SIZES_CONTAINER['xxl-landscape'],paddingTop:96},xl:SIZES_CONTAINER.xl,'xl-landscape':{...SIZES_CONTAINER['xl-landscape'],paddingTop:96},l:SIZES_CONTAINER.l,'l-landscape':{...SIZES_CONTAINER['l-landscape'],paddingTop:96},m:SIZES_CONTAINER.m,s:SIZES_CONTAINER.s,xs:SIZES_CONTAINER.xs};exports.SIZES=SIZES,exports.SIZES_CAPTION={xxxl:{fontSize:20},xxl:{fontSize:20},xl:{fontSize:18},l:{fontSize:18},m:{fontSize:14},s:{fontSize:14},xs:{fontSize:14},xxs:{fontSize:14},xxxs:{fontSize:14}},exports.SIZES_CONTAINER=SIZES_CONTAINER,exports.SIZES_CONTAINER_FANCY=SIZES_CONTAINER_FANCY,exports.SIZES_FANCY=SIZES_FANCY,exports.SIZES_SUBTITLE={xxxl:{fontSize:24},xxl:{fontSize:24},xl:{fontSize:20},l:{fontSize:20},m:{fontSize:16},s:{fontSize:16},xs:{fontSize:14},xxs:{fontSize:14},xxxs:{fontSize:14}},exports.SIZES_TITLE={xxxl:{fontSize:32},xxl:{fontSize:32},xl:{fontSize:28},l:{fontSize:24},m:{fontSize:20},s:{fontSize:18},xs:{fontSize:16},xxs:{fontSize:16},xxxs:{fontSize:16}},exports.VISIBILITY_LANDSCAPE={xxl:{display:'none'},'xxl-landscape':{display:'block'},xl:{display:'none'},'xl-landscape':{display:'block'},l:{display:'none'},'l-landscape':{display:'block'},m:{display:'none'},s:{display:'none'},xs:{display:'none'}},exports.VISIBILITY_LANDSCAPE_MEDIA={xxl:{display:'none'},'xxl-landscape':{display:'block',height:'100%'},xl:{display:'none'},'xl-landscape':{display:'block',height:'100%'},l:{display:'none'},'l-landscape':{display:'block',height:'100%'},m:{display:'none'},s:{display:'none'},xs:{display:'none'}},exports.VISIBILITY_PORTRAIT={xxl:{display:'block'},'xxl-landscape':{display:'none'},xl:{display:'block'},'xl-landscape':{display:'none'},l:{display:'block'},'l-landscape':{display:'none'},m:{display:'block'},s:{display:'block'},xs:{display:'block'}};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/DialogComponent/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from 'shared/types'\nimport type { DialogComponentSize } from './types'\n\nexport const SIZES: Record<DialogComponentSize, CSSProperties> = {\n xxl: {\n maxWidth: 1228,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n maxHeight: '85vh',\n flexDirection: 'column',\n borderRadius: 20,\n },\n 'xxl-landscape': {\n maxWidth: 1228,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n height: '65vh',\n minHeight: 288,\n maxHeight: 600,\n flexDirection: 'row',\n borderRadius: 20,\n },\n xl: {\n maxWidth: 960,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n maxHeight: '85vh',\n flexDirection: 'column',\n borderRadius: 20,\n },\n 'xl-landscape': {\n maxWidth: 960,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n height: '65vh',\n minHeight: 288,\n maxHeight: 456,\n flexDirection: 'row',\n borderRadius: 20,\n },\n l: {\n maxWidth: 780,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n maxHeight: '85vh',\n flexDirection: 'column',\n borderRadius: 20,\n },\n 'l-landscape': {\n maxWidth: 780,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n height: '65vh',\n minHeight: 288,\n maxHeight: 392,\n flexDirection: 'row',\n borderRadius: 20,\n },\n m: {\n maxWidth: 560,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n maxHeight: '85vh',\n flexDirection: 'column',\n borderRadius: 20,\n },\n s: {\n maxWidth: 440,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n maxHeight: '85vh',\n flexDirection: 'column',\n borderRadius: 20,\n },\n xs: {\n maxWidth: 304,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n maxHeight: '85vh',\n flexDirection: 'column',\n borderRadius: 20,\n },\n}\n\nexport const SIZES_CONTAINER: Record<DialogComponentSize, CSSProperties> = {\n xxl: {\n padding: 48,\n },\n 'xxl-landscape': {\n padding: 48,\n },\n xl: {\n padding: 40,\n },\n 'xl-landscape': {\n padding: 40,\n },\n l: {\n padding: 36,\n },\n 'l-landscape': {\n padding: 36,\n },\n m: {\n padding: 32,\n },\n s: {\n padding: 32,\n },\n xs: {\n padding: 24,\n },\n}\n\nexport const SIZES_CAPTION: Record<Size, CSSProperties> = {\n xxxl: {\n fontSize: 20,\n },\n xxl: {\n fontSize: 20,\n },\n xl: {\n fontSize: 18,\n },\n l: {\n fontSize: 18,\n },\n m: {\n fontSize: 14,\n },\n s: {\n fontSize: 14,\n },\n xs: {\n fontSize: 14,\n },\n xxs: {\n fontSize: 14,\n },\n xxxs: {\n fontSize: 14,\n },\n}\n\nexport const SIZES_TITLE: Record<Size, CSSProperties> = {\n xxxl: {\n fontSize: 32,\n },\n xxl: {\n fontSize: 32,\n },\n xl: {\n fontSize: 28,\n },\n l: {\n fontSize: 24,\n },\n m: {\n fontSize: 20,\n },\n s: {\n fontSize: 18,\n },\n xs: {\n fontSize: 16,\n },\n xxs: {\n fontSize: 16,\n },\n xxxs: {\n fontSize: 16,\n },\n}\n\nexport const SIZES_SUBTITLE: Record<Size, CSSProperties> = {\n xxxl: {\n fontSize: 24,\n },\n xxl: {\n fontSize: 24,\n },\n xl: {\n fontSize: 20,\n },\n l: {\n fontSize: 20,\n },\n m: {\n fontSize: 16,\n },\n s: {\n fontSize: 16,\n },\n xs: {\n fontSize: 14,\n },\n xxs: {\n fontSize: 14,\n },\n xxxs: {\n fontSize: 14,\n },\n}\n\nexport const VISIBILITY_PORTRAIT: Record<DialogComponentSize, CSSProperties> = {\n xxl: {\n display: 'block',\n },\n 'xxl-landscape': {\n display: 'none',\n },\n xl: {\n display: 'block',\n },\n 'xl-landscape': {\n display: 'none',\n },\n l: {\n display: 'block',\n },\n 'l-landscape': {\n display: 'none',\n },\n m: {\n display: 'block',\n },\n s: {\n display: 'block',\n },\n xs: {\n display: 'block',\n },\n}\n\nexport const VISIBILITY_LANDSCAPE: Record<DialogComponentSize, CSSProperties> = {\n xxl: {\n display: 'none',\n },\n 'xxl-landscape': {\n display: 'block',\n },\n xl: {\n display: 'none',\n },\n 'xl-landscape': {\n display: 'block',\n },\n l: {\n display: 'none',\n },\n 'l-landscape': {\n display: 'block',\n },\n m: {\n display: 'none',\n },\n s: {\n display: 'none',\n },\n xs: {\n display: 'none',\n },\n}\n\nexport const VISIBILITY_LANDSCAPE_MEDIA: Record<DialogComponentSize, CSSProperties> = {\n xxl: {\n display: 'none',\n },\n 'xxl-landscape': {\n display: 'block',\n height: '100%',\n },\n xl: {\n display: 'none',\n },\n 'xl-landscape': {\n display: 'block',\n height: '100%',\n },\n l: {\n display: 'none',\n },\n 'l-landscape': {\n display: 'block',\n height: '100%',\n },\n m: {\n display: 'none',\n },\n s: {\n display: 'none',\n },\n xs: {\n display: 'none',\n },\n}\n"],"names":["xxl","maxWidth","width","minWidth","fontSize","maxHeight","flexDirection","borderRadius","height","minHeight","xl","l","m","s","xs","
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/components/DialogComponent/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { omit } from 'ramda'\nimport type { Size } from 'shared/types'\nimport type { DialogComponentSize } from './types'\n\nexport const SIZES: Record<DialogComponentSize, CSSProperties> = {\n xxl: {\n maxWidth: 1228,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n maxHeight: '85vh',\n flexDirection: 'column',\n borderRadius: 20,\n },\n 'xxl-landscape': {\n maxWidth: 1228,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n height: '65vh',\n minHeight: 288,\n maxHeight: 600,\n flexDirection: 'row',\n borderRadius: 20,\n },\n xl: {\n maxWidth: 960,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n maxHeight: '85vh',\n flexDirection: 'column',\n borderRadius: 20,\n },\n 'xl-landscape': {\n maxWidth: 960,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n height: '65vh',\n minHeight: 288,\n maxHeight: 456,\n flexDirection: 'row',\n borderRadius: 20,\n },\n l: {\n maxWidth: 780,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n maxHeight: '85vh',\n flexDirection: 'column',\n borderRadius: 20,\n },\n 'l-landscape': {\n maxWidth: 780,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n height: '65vh',\n minHeight: 288,\n maxHeight: 392,\n flexDirection: 'row',\n borderRadius: 20,\n },\n m: {\n maxWidth: 560,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n maxHeight: '85vh',\n flexDirection: 'column',\n borderRadius: 20,\n },\n s: {\n maxWidth: 440,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n maxHeight: '85vh',\n flexDirection: 'column',\n borderRadius: 20,\n },\n xs: {\n maxWidth: 304,\n width: '100vw',\n minWidth: 'min-content',\n fontSize: 16,\n maxHeight: '85vh',\n flexDirection: 'column',\n borderRadius: 20,\n },\n}\n\nexport const SIZES_FANCY: Record<DialogComponentSize, CSSProperties> = {\n xxl: omit(['borderRadius'], SIZES.xxl),\n 'xxl-landscape': omit(['borderRadius'], SIZES['xxl-landscape']),\n xl: omit(['borderRadius'], SIZES.xl),\n 'xl-landscape': omit(['borderRadius'], SIZES['xl-landscape']),\n l: omit(['borderRadius'], SIZES.l),\n 'l-landscape': omit(['borderRadius'], SIZES['l-landscape']),\n m: omit(['borderRadius'], SIZES.m),\n s: omit(['borderRadius'], SIZES.s),\n xs: omit(['borderRadius'], SIZES.xs),\n}\n\nexport const SIZES_CONTAINER: Record<DialogComponentSize, CSSProperties> = {\n xxl: {\n padding: 48,\n },\n 'xxl-landscape': {\n padding: 48,\n },\n xl: {\n padding: 40,\n },\n 'xl-landscape': {\n padding: 40,\n },\n l: {\n padding: 36,\n },\n 'l-landscape': {\n padding: 36,\n },\n m: {\n padding: 32,\n },\n s: {\n padding: 32,\n },\n xs: {\n padding: 24,\n },\n}\n\nexport const SIZES_CONTAINER_FANCY: Record<DialogComponentSize, CSSProperties> = {\n xxl: SIZES_CONTAINER.xxl,\n 'xxl-landscape': {\n ...SIZES_CONTAINER['xxl-landscape'],\n paddingTop: 96,\n },\n xl: SIZES_CONTAINER.xl,\n 'xl-landscape': {\n ...SIZES_CONTAINER['xl-landscape'],\n paddingTop: 96,\n },\n l: SIZES_CONTAINER.l,\n 'l-landscape': {\n ...SIZES_CONTAINER['l-landscape'],\n paddingTop: 96,\n },\n m: SIZES_CONTAINER.m,\n s: SIZES_CONTAINER.s,\n xs: SIZES_CONTAINER.xs,\n}\n\nexport const SIZES_CAPTION: Record<Size, CSSProperties> = {\n xxxl: {\n fontSize: 20,\n },\n xxl: {\n fontSize: 20,\n },\n xl: {\n fontSize: 18,\n },\n l: {\n fontSize: 18,\n },\n m: {\n fontSize: 14,\n },\n s: {\n fontSize: 14,\n },\n xs: {\n fontSize: 14,\n },\n xxs: {\n fontSize: 14,\n },\n xxxs: {\n fontSize: 14,\n },\n}\n\nexport const SIZES_TITLE: Record<Size, CSSProperties> = {\n xxxl: {\n fontSize: 32,\n },\n xxl: {\n fontSize: 32,\n },\n xl: {\n fontSize: 28,\n },\n l: {\n fontSize: 24,\n },\n m: {\n fontSize: 20,\n },\n s: {\n fontSize: 18,\n },\n xs: {\n fontSize: 16,\n },\n xxs: {\n fontSize: 16,\n },\n xxxs: {\n fontSize: 16,\n },\n}\n\nexport const SIZES_SUBTITLE: Record<Size, CSSProperties> = {\n xxxl: {\n fontSize: 24,\n },\n xxl: {\n fontSize: 24,\n },\n xl: {\n fontSize: 20,\n },\n l: {\n fontSize: 20,\n },\n m: {\n fontSize: 16,\n },\n s: {\n fontSize: 16,\n },\n xs: {\n fontSize: 14,\n },\n xxs: {\n fontSize: 14,\n },\n xxxs: {\n fontSize: 14,\n },\n}\n\nexport const VISIBILITY_PORTRAIT: Record<DialogComponentSize, CSSProperties> = {\n xxl: {\n display: 'block',\n },\n 'xxl-landscape': {\n display: 'none',\n },\n xl: {\n display: 'block',\n },\n 'xl-landscape': {\n display: 'none',\n },\n l: {\n display: 'block',\n },\n 'l-landscape': {\n display: 'none',\n },\n m: {\n display: 'block',\n },\n s: {\n display: 'block',\n },\n xs: {\n display: 'block',\n },\n}\n\nexport const VISIBILITY_LANDSCAPE: Record<DialogComponentSize, CSSProperties> = {\n xxl: {\n display: 'none',\n },\n 'xxl-landscape': {\n display: 'block',\n },\n xl: {\n display: 'none',\n },\n 'xl-landscape': {\n display: 'block',\n },\n l: {\n display: 'none',\n },\n 'l-landscape': {\n display: 'block',\n },\n m: {\n display: 'none',\n },\n s: {\n display: 'none',\n },\n xs: {\n display: 'none',\n },\n}\n\nexport const VISIBILITY_LANDSCAPE_MEDIA: Record<DialogComponentSize, CSSProperties> = {\n xxl: {\n display: 'none',\n },\n 'xxl-landscape': {\n display: 'block',\n height: '100%',\n },\n xl: {\n display: 'none',\n },\n 'xl-landscape': {\n display: 'block',\n height: '100%',\n },\n l: {\n display: 'none',\n },\n 'l-landscape': {\n display: 'block',\n height: '100%',\n },\n m: {\n display: 'none',\n },\n s: {\n display: 'none',\n },\n xs: {\n display: 'none',\n },\n}\n"],"names":["SIZES","xxl","maxWidth","width","minWidth","fontSize","maxHeight","flexDirection","borderRadius","height","minHeight","xl","l","m","s","xs","SIZES_FANCY","omit","SIZES_CONTAINER","padding","SIZES_CONTAINER_FANCY","paddingTop","xxxl","xxs","xxxs","display"],"mappings":"wCAKO,MAAMA,MAAoD,CAC/DC,IAAK,CACHC,SAAU,KACVC,MAAO,QACPC,SAAU,cACVC,SAAU,GACVC,UAAW,OACXC,cAAe,SACfC,aAAc,IAEhB,gBAAiB,CACfN,SAAU,KACVC,MAAO,QACPC,SAAU,cACVC,SAAU,GACVI,OAAQ,OACRC,UAAW,IACXJ,UAAW,IACXC,cAAe,MACfC,aAAc,IAEhBG,GAAI,CACFT,SAAU,IACVC,MAAO,QACPC,SAAU,cACVC,SAAU,GACVC,UAAW,OACXC,cAAe,SACfC,aAAc,IAEhB,eAAgB,CACdN,SAAU,IACVC,MAAO,QACPC,SAAU,cACVC,SAAU,GACVI,OAAQ,OACRC,UAAW,IACXJ,UAAW,IACXC,cAAe,MACfC,aAAc,IAEhBI,EAAG,CACDV,SAAU,IACVC,MAAO,QACPC,SAAU,cACVC,SAAU,GACVC,UAAW,OACXC,cAAe,SACfC,aAAc,IAEhB,cAAe,CACbN,SAAU,IACVC,MAAO,QACPC,SAAU,cACVC,SAAU,GACVI,OAAQ,OACRC,UAAW,IACXJ,UAAW,IACXC,cAAe,MACfC,aAAc,IAEhBK,EAAG,CACDX,SAAU,IACVC,MAAO,QACPC,SAAU,cACVC,SAAU,GACVC,UAAW,OACXC,cAAe,SACfC,aAAc,IAEhBM,EAAG,CACDZ,SAAU,IACVC,MAAO,QACPC,SAAU,cACVC,SAAU,GACVC,UAAW,OACXC,cAAe,SACfC,aAAc,IAEhBO,GAAI,CACFb,SAAU,IACVC,MAAO,QACPC,SAAU,cACVC,SAAU,GACVC,UAAW,OACXC,cAAe,SACfC,aAAc,KAIX,MAAMQ,YAA0D,CACrEf,IAAKgB,MA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EAAG,CACDW,QAAS,SAEXV,GAAI,CACFU,QAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const SIZES={xxl:{maxWidth:1228,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},'xxl-landscape':{maxWidth:1228,width:'100vw',minWidth:'min-content',fontSize:16,height:'65vh',minHeight:288,maxHeight:600,flexDirection:'row',borderRadius:20},xl:{maxWidth:960,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},'xl-landscape':{maxWidth:960,width:'100vw',minWidth:'min-content',fontSize:16,height:'65vh',minHeight:288,maxHeight:456,flexDirection:'row',borderRadius:20},l:{maxWidth:780,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},'l-landscape':{maxWidth:780,width:'100vw',minWidth:'min-content',fontSize:16,height:'65vh',minHeight:288,maxHeight:392,flexDirection:'row',borderRadius:20},m:{maxWidth:560,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},s:{maxWidth:440,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},xs:{maxWidth:304,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20}};const SIZES_CONTAINER={xxl:{padding:48},'xxl-landscape':{padding:48},xl:{padding:40},'xl-landscape':{padding:40},l:{padding:36},'l-landscape':{padding:36},m:{padding:32},s:{padding:32},xs:{padding:24}};const SIZES_CAPTION={xxxl:{fontSize:20},xxl:{fontSize:20},xl:{fontSize:18},l:{fontSize:18},m:{fontSize:14},s:{fontSize:14},xs:{fontSize:14},xxs:{fontSize:14},xxxs:{fontSize:14}};const SIZES_TITLE={xxxl:{fontSize:32},xxl:{fontSize:32},xl:{fontSize:28},l:{fontSize:24},m:{fontSize:20},s:{fontSize:18},xs:{fontSize:16},xxs:{fontSize:16},xxxs:{fontSize:16}};const SIZES_SUBTITLE={xxxl:{fontSize:24},xxl:{fontSize:24},xl:{fontSize:20},l:{fontSize:20},m:{fontSize:16},s:{fontSize:16},xs:{fontSize:14},xxs:{fontSize:14},xxxs:{fontSize:14}};const VISIBILITY_PORTRAIT={xxl:{display:'block'},'xxl-landscape':{display:'none'},xl:{display:'block'},'xl-landscape':{display:'none'},l:{display:'block'},'l-landscape':{display:'none'},m:{display:'block'},s:{display:'block'},xs:{display:'block'}};const VISIBILITY_LANDSCAPE={xxl:{display:'none'},'xxl-landscape':{display:'block'},xl:{display:'none'},'xl-landscape':{display:'block'},l:{display:'none'},'l-landscape':{display:'block'},m:{display:'none'},s:{display:'none'},xs:{display:'none'}};const VISIBILITY_LANDSCAPE_MEDIA={xxl:{display:'none'},'xxl-landscape':{display:'block',height:'100%'},xl:{display:'none'},'xl-landscape':{display:'block',height:'100%'},l:{display:'none'},'l-landscape':{display:'block',height:'100%'},m:{display:'none'},s:{display:'none'},xs:{display:'none'}};export{SIZES,SIZES_CAPTION,SIZES_CONTAINER,SIZES_SUBTITLE,SIZES_TITLE,VISIBILITY_LANDSCAPE,VISIBILITY_LANDSCAPE_MEDIA,VISIBILITY_PORTRAIT};
|
|
1
|
+
import{omit}from'ramda';const SIZES={xxl:{maxWidth:1228,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},'xxl-landscape':{maxWidth:1228,width:'100vw',minWidth:'min-content',fontSize:16,height:'65vh',minHeight:288,maxHeight:600,flexDirection:'row',borderRadius:20},xl:{maxWidth:960,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},'xl-landscape':{maxWidth:960,width:'100vw',minWidth:'min-content',fontSize:16,height:'65vh',minHeight:288,maxHeight:456,flexDirection:'row',borderRadius:20},l:{maxWidth:780,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},'l-landscape':{maxWidth:780,width:'100vw',minWidth:'min-content',fontSize:16,height:'65vh',minHeight:288,maxHeight:392,flexDirection:'row',borderRadius:20},m:{maxWidth:560,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},s:{maxWidth:440,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20},xs:{maxWidth:304,width:'100vw',minWidth:'min-content',fontSize:16,maxHeight:'85vh',flexDirection:'column',borderRadius:20}};const SIZES_FANCY={xxl:omit(['borderRadius'],SIZES.xxl),'xxl-landscape':omit(['borderRadius'],SIZES['xxl-landscape']),xl:omit(['borderRadius'],SIZES.xl),'xl-landscape':omit(['borderRadius'],SIZES['xl-landscape']),l:omit(['borderRadius'],SIZES.l),'l-landscape':omit(['borderRadius'],SIZES['l-landscape']),m:omit(['borderRadius'],SIZES.m),s:omit(['borderRadius'],SIZES.s),xs:omit(['borderRadius'],SIZES.xs)};const SIZES_CONTAINER={xxl:{padding:48},'xxl-landscape':{padding:48},xl:{padding:40},'xl-landscape':{padding:40},l:{padding:36},'l-landscape':{padding:36},m:{padding:32},s:{padding:32},xs:{padding:24}};const SIZES_CONTAINER_FANCY={xxl:SIZES_CONTAINER.xxl,'xxl-landscape':{...SIZES_CONTAINER['xxl-landscape'],paddingTop:96},xl:SIZES_CONTAINER.xl,'xl-landscape':{...SIZES_CONTAINER['xl-landscape'],paddingTop:96},l:SIZES_CONTAINER.l,'l-landscape':{...SIZES_CONTAINER['l-landscape'],paddingTop:96},m:SIZES_CONTAINER.m,s:SIZES_CONTAINER.s,xs:SIZES_CONTAINER.xs};const SIZES_CAPTION={xxxl:{fontSize:20},xxl:{fontSize:20},xl:{fontSize:18},l:{fontSize:18},m:{fontSize:14},s:{fontSize:14},xs:{fontSize:14},xxs:{fontSize:14},xxxs:{fontSize:14}};const SIZES_TITLE={xxxl:{fontSize:32},xxl:{fontSize:32},xl:{fontSize:28},l:{fontSize:24},m:{fontSize:20},s:{fontSize:18},xs:{fontSize:16},xxs:{fontSize:16},xxxs:{fontSize:16}};const SIZES_SUBTITLE={xxxl:{fontSize:24},xxl:{fontSize:24},xl:{fontSize:20},l:{fontSize:20},m:{fontSize:16},s:{fontSize:16},xs:{fontSize:14},xxs:{fontSize:14},xxxs:{fontSize:14}};const VISIBILITY_PORTRAIT={xxl:{display:'block'},'xxl-landscape':{display:'none'},xl:{display:'block'},'xl-landscape':{display:'none'},l:{display:'block'},'l-landscape':{display:'none'},m:{display:'block'},s:{display:'block'},xs:{display:'block'}};const VISIBILITY_LANDSCAPE={xxl:{display:'none'},'xxl-landscape':{display:'block'},xl:{display:'none'},'xl-landscape':{display:'block'},l:{display:'none'},'l-landscape':{display:'block'},m:{display:'none'},s:{display:'none'},xs:{display:'none'}};const VISIBILITY_LANDSCAPE_MEDIA={xxl:{display:'none'},'xxl-landscape':{display:'block',height:'100%'},xl:{display:'none'},'xl-landscape':{display:'block',height:'100%'},l:{display:'none'},'l-landscape':{display:'block',height:'100%'},m:{display:'none'},s:{display:'none'},xs:{display:'none'}};export{SIZES,SIZES_CAPTION,SIZES_CONTAINER,SIZES_CONTAINER_FANCY,SIZES_FANCY,SIZES_SUBTITLE,SIZES_TITLE,VISIBILITY_LANDSCAPE,VISIBILITY_LANDSCAPE_MEDIA,VISIBILITY_PORTRAIT};
|
|
2
2
|
//# sourceMappingURL=constants.mjs.map
|