@foxford/ui 2.45.0 → 2.46.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/_virtual/ResizeObserver.js +2 -0
- package/_virtual/ResizeObserver.js.map +1 -0
- package/_virtual/ResizeObserver.mjs +2 -0
- package/_virtual/ResizeObserver.mjs.map +1 -0
- package/components/ListItem/ListItem.js +1 -1
- package/components/ListItem/ListItem.js.map +1 -1
- package/components/ListItem/ListItem.mjs +1 -1
- package/components/ListItem/ListItem.mjs.map +1 -1
- package/components/ListItem/style.js +1 -1
- package/components/ListItem/style.js.map +1 -1
- package/components/ListItem/style.mjs +1 -1
- package/components/ListItem/style.mjs.map +1 -1
- package/components/Text/Ellipsis.js +2 -0
- package/components/Text/Ellipsis.js.map +1 -0
- package/components/Text/Ellipsis.mjs +2 -0
- package/components/Text/Ellipsis.mjs.map +1 -0
- package/components/Text/Text.js +1 -1
- package/components/Text/Text.js.map +1 -1
- package/components/Text/Text.mjs +1 -1
- package/components/Text/Text.mjs.map +1 -1
- package/components/Text/constants.js.map +1 -1
- package/components/Text/constants.mjs.map +1 -1
- package/components/Text/style.js +1 -1
- package/components/Text/style.js.map +1 -1
- package/components/Text/style.mjs +1 -1
- package/components/Text/style.mjs.map +1 -1
- package/dts/index.d.ts +68 -25
- package/external/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.js +2 -0
- package/external/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.js.map +1 -0
- package/external/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.mjs +2 -0
- package/external/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.mjs.map +1 -0
- package/package.json +1 -1
package/components/Text/Text.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var useClassname=require('../../hooks/useClassname.js');var constants=require('./constants.js');var defaultConstants=require('./default-constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Text_Heading=require('../Text.Heading/Text.Heading.js');var Text_Ellipse=require('../Text.Ellipse/Text.Ellipse.js');const Text=Object.assign(withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{const t=e.appearance?{...constants.APPEARANCE[e.appearance],...e}:e;const{size:a="m",weight:r="normal",lineHeight:n="m",fontStyle:i="normal",className:l,content:o,children:c,...
|
|
1
|
+
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var useClassname=require('../../hooks/useClassname.js');var Ellipsis=require('./Ellipsis.js');var constants=require('./constants.js');var defaultConstants=require('./default-constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Text_Heading=require('../Text.Heading/Text.Heading.js');var Text_Ellipse=require('../Text.Ellipse/Text.Ellipse.js');const Text=Object.assign(withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{const t=e.appearance?{...constants.APPEARANCE[e.appearance],...e}:e;const{size:a="m",weight:r="normal",lineHeight:n="m",fontStyle:i="normal",className:l,content:o,children:p,ellipsis:c,expandButtonProps:u,onExpandedChange:d,...x}=t;const E=typeof c=='object'&&c!==null?c:{};const T=useClassname.useClassname("Text",l);return require$$0.jsx(style.Root,{...x,size:a,weight:r,lineHeight:n,fontStyle:i,className:T,ref:s,children:c?require$$0.jsx(Ellipsis.Ellipsis,{...E,expandButtonProps:u,onExpandedChange:d,children:p||o}):p||o})})),{displayName:"Text",sizes:e=>typeof e.appearance=='string'?constants.SIZES[e.appearance]??defaultConstants.SIZES_DEFAULT:defaultConstants.SIZES_DEFAULT}),{Heading:Text_Heading.TextHeading,Ellipse:Text_Ellipse.TextEllipse});exports.COMPONENT_NAME="Text",exports.Text=Text;
|
|
2
2
|
//# sourceMappingURL=Text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { TextHeading } from 'components/Text.Heading'\nimport { TextEllipse } from 'components/Text.Ellipse'\nimport type { TextProps } from './types'\nimport { APPEARANCE, SIZES } from './constants'\nimport { SIZES_DEFAULT } from './default-constants'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Text'\n\n/**\n *\n *
|
|
1
|
+
{"version":3,"file":"Text.js","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { TextHeading } from 'components/Text.Heading'\nimport { TextEllipse } from 'components/Text.Ellipse'\nimport { Ellipsis } from './Ellipsis'\nimport type { TextProps } from './types'\nimport { APPEARANCE, SIZES } from './constants'\nimport { SIZES_DEFAULT } from './default-constants'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Text'\n\n/**\n *\n * Компонент поддерживает все нативные атрибуты рутового элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Text/types.ts).\n */\nconst Text: React.ForwardRefExoticComponent<TextProps> & { Heading: typeof TextHeading; Ellipse: typeof TextEllipse } =\n Object.assign(\n withMergedProps<TextProps, HTMLElement>(\n forwardRef((props, ref) => {\n const textProps = props.appearance ? { ...APPEARANCE[props.appearance], ...props } : props\n\n const {\n size = 'm',\n weight = 'normal',\n lineHeight = 'm',\n fontStyle = 'normal',\n className,\n content,\n children,\n ellipsis,\n expandButtonProps,\n onExpandedChange,\n ...restProps\n } = textProps\n\n const ellipsisProps = typeof ellipsis === 'object' && ellipsis !== null ? ellipsis : {}\n\n const textClassName = useClassname(COMPONENT_NAME, className)\n\n return (\n <Styled.Root\n {...restProps}\n size={size}\n weight={weight}\n lineHeight={lineHeight}\n fontStyle={fontStyle}\n className={textClassName}\n ref={ref}\n >\n {ellipsis ? (\n <Ellipsis {...ellipsisProps} expandButtonProps={expandButtonProps} onExpandedChange={onExpandedChange}>\n {children || content}\n </Ellipsis>\n ) : (\n children || content\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (typeof props.appearance === 'string') {\n return SIZES[props.appearance] ?? SIZES_DEFAULT\n }\n\n return SIZES_DEFAULT\n },\n }\n ),\n {\n Heading: TextHeading,\n Ellipse: TextEllipse,\n }\n )\n\nexport { Text, COMPONENT_NAME }\n"],"names":["Text","Object","assign","withMergedProps","forwardRef","props","ref","textProps","appearance","APPEARANCE","size","weight","lineHeight","fontStyle","className","content","children","ellipsis","expandButtonProps","onExpandedChange","restProps","ellipsisProps","textClassName","useClassname","_jsx","Styled","jsx","Ellipsis","displayName","sizes","SIZES","SIZES_DEFAULT","Heading","TextHeading","Ellipse","TextEllipse"],"mappings":"seAuBA,MAAMA,KACJC,OAAOC,OACLC,gBAAAA,gBACEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,EAAYF,EAAMG,WAAa,IAAKC,UAAUA,WAACJ,EAAMG,eAAgBH,GAAUA,EAErF,MAAMK,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,WACjBA,EAAa,IAAGC,UAChBA,EAAY,SAAQC,UACpBA,EAASC,QACTA,EAAOC,SACPA,EAAQC,SACRA,EAAQC,kBACRA,EAAiBC,iBACjBA,KACGC,GACDb,EAEJ,MAAMc,SAAuBJ,GAAa,UAAYA,IAAa,KAAOA,EAAW,GAErF,MAAMK,EAAgBC,aAAAA,aAlCP,OAkCoCT,GAEnD,OACEU,WAAAA,IAACC,MAAAA,KAAW,IACNL,EACJV,KAAMA,EACNC,OAAQA,EACRC,WAAYA,EACZC,UAAWA,EACXC,UAAWQ,EACXhB,IAAKA,EAAIU,SAERC,EACCO,WAAAE,IAACC,kBAAQ,IAAKN,EAAeH,kBAAmBA,EAAmBC,iBAAkBA,EAAiBH,SACnGA,GAAYD,IAGfC,GAAYD,GAEF,IAGlB,CACEa,YAzDe,OA0DfC,MAAQxB,UACKA,EAAMG,YAAe,SACvBsB,gBAAMzB,EAAMG,aAAeuB,iBAAAA,cAG7BA,iCAIb,CACEC,QAASC,aAAWA,YACpBC,QAASC,aAAAA,qCArEQ"}
|
package/components/Text/Text.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{useClassname}from'../../hooks/useClassname.mjs';import{SIZES,APPEARANCE}from'./constants.mjs';import{SIZES_DEFAULT}from'./default-constants.mjs';import{Root}from'./style.mjs';import{jsx}from'react/jsx-runtime';import{TextHeading}from'../Text.Heading/Text.Heading.mjs';import{TextEllipse}from'../Text.Ellipse/Text.Ellipse.mjs';const COMPONENT_NAME='Text';const Text=Object.assign(withMergedProps(forwardRef(((e,
|
|
1
|
+
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{useClassname}from'../../hooks/useClassname.mjs';import{Ellipsis}from'./Ellipsis.mjs';import{SIZES,APPEARANCE}from'./constants.mjs';import{SIZES_DEFAULT}from'./default-constants.mjs';import{Root}from'./style.mjs';import{jsx}from'react/jsx-runtime';import{TextHeading}from'../Text.Heading/Text.Heading.mjs';import{TextEllipse}from'../Text.Ellipse/Text.Ellipse.mjs';const COMPONENT_NAME='Text';const Text=Object.assign(withMergedProps(forwardRef(((e,s)=>{const t=e.appearance?{...APPEARANCE[e.appearance],...e}:e;const{size:o="m",weight:r="normal",lineHeight:n="m",fontStyle:i="normal",className:a,content:p,children:m,ellipsis:l,expandButtonProps:E,onExpandedChange:c,...x}=t;const d=typeof l=='object'&&l!==null?l:{};const f=useClassname("Text",a);return jsx(Root,{...x,size:o,weight:r,lineHeight:n,fontStyle:i,className:f,ref:s,children:l?jsx(Ellipsis,{...d,expandButtonProps:E,onExpandedChange:c,children:m||p}):m||p})})),{displayName:"Text",sizes:e=>typeof e.appearance=='string'?SIZES[e.appearance]??SIZES_DEFAULT:SIZES_DEFAULT}),{Heading:TextHeading,Ellipse:TextEllipse});export{COMPONENT_NAME,Text};
|
|
2
2
|
//# sourceMappingURL=Text.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.mjs","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { TextHeading } from 'components/Text.Heading'\nimport { TextEllipse } from 'components/Text.Ellipse'\nimport type { TextProps } from './types'\nimport { APPEARANCE, SIZES } from './constants'\nimport { SIZES_DEFAULT } from './default-constants'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Text'\n\n/**\n *\n *
|
|
1
|
+
{"version":3,"file":"Text.mjs","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { TextHeading } from 'components/Text.Heading'\nimport { TextEllipse } from 'components/Text.Ellipse'\nimport { Ellipsis } from './Ellipsis'\nimport type { TextProps } from './types'\nimport { APPEARANCE, SIZES } from './constants'\nimport { SIZES_DEFAULT } from './default-constants'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Text'\n\n/**\n *\n * Компонент поддерживает все нативные атрибуты рутового элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Text/types.ts).\n */\nconst Text: React.ForwardRefExoticComponent<TextProps> & { Heading: typeof TextHeading; Ellipse: typeof TextEllipse } =\n Object.assign(\n withMergedProps<TextProps, HTMLElement>(\n forwardRef((props, ref) => {\n const textProps = props.appearance ? { ...APPEARANCE[props.appearance], ...props } : props\n\n const {\n size = 'm',\n weight = 'normal',\n lineHeight = 'm',\n fontStyle = 'normal',\n className,\n content,\n children,\n ellipsis,\n expandButtonProps,\n onExpandedChange,\n ...restProps\n } = textProps\n\n const ellipsisProps = typeof ellipsis === 'object' && ellipsis !== null ? ellipsis : {}\n\n const textClassName = useClassname(COMPONENT_NAME, className)\n\n return (\n <Styled.Root\n {...restProps}\n size={size}\n weight={weight}\n lineHeight={lineHeight}\n fontStyle={fontStyle}\n className={textClassName}\n ref={ref}\n >\n {ellipsis ? (\n <Ellipsis {...ellipsisProps} expandButtonProps={expandButtonProps} onExpandedChange={onExpandedChange}>\n {children || content}\n </Ellipsis>\n ) : (\n children || content\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (typeof props.appearance === 'string') {\n return SIZES[props.appearance] ?? SIZES_DEFAULT\n }\n\n return SIZES_DEFAULT\n },\n }\n ),\n {\n Heading: TextHeading,\n Ellipse: TextEllipse,\n }\n )\n\nexport { Text, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","Text","Object","assign","withMergedProps","forwardRef","props","ref","textProps","appearance","APPEARANCE","size","weight","lineHeight","fontStyle","className","content","children","ellipsis","expandButtonProps","onExpandedChange","restProps","ellipsisProps","textClassName","useClassname","_jsx","Styled","Ellipsis","displayName","sizes","SIZES","SIZES_DEFAULT","Heading","TextHeading","Ellipse","TextEllipse"],"mappings":"4cAWMA,MAAAA,eAAiB,OAYvB,MAAMC,KACJC,OAAOC,OACLC,gBACEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,EAAYF,EAAMG,WAAa,IAAKC,WAAWJ,EAAMG,eAAgBH,GAAUA,EAErF,MAAMK,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,WACjBA,EAAa,IAAGC,UAChBA,EAAY,SAAQC,UACpBA,EAASC,QACTA,EAAOC,SACPA,EAAQC,SACRA,EAAQC,kBACRA,EAAiBC,iBACjBA,KACGC,GACDb,EAEJ,MAAMc,SAAuBJ,GAAa,UAAYA,IAAa,KAAOA,EAAW,GAErF,MAAMK,EAAgBC,aAlCP,OAkCoCT,GAEnD,OACEU,IAACC,KAAW,IACNL,EACJV,KAAMA,EACNC,OAAQA,EACRC,WAAYA,EACZC,UAAWA,EACXC,UAAWQ,EACXhB,IAAKA,EAAIU,SAERC,EACCO,IAACE,SAAQ,IAAKL,EAAeH,kBAAmBA,EAAmBC,iBAAkBA,EAAiBH,SACnGA,GAAYD,IAGfC,GAAYD,GAEF,IAGlB,CACEY,YAzDe,OA0DfC,MAAQvB,UACKA,EAAMG,YAAe,SACvBqB,MAAMxB,EAAMG,aAAesB,cAG7BA,gBAIb,CACEC,QAASC,YACTC,QAASC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/Text/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from 'shared/types'\nimport type {
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/components/Text/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from 'shared/types'\nimport type { TextProps } from './types'\n\nexport const APPEARANCE: Record<\n NonNullable<TextProps['appearance']>,\n Partial<Omit<TextProps, 'size' | 'appearance'>>\n> = {\n display: {\n lineHeight: 1,\n weight: 800,\n fontStyle: 'normal',\n },\n heading: {\n lineHeight: 1.1,\n weight: 800,\n fontStyle: 'normal',\n },\n subheading: {\n lineHeight: 1.1,\n weight: 700,\n fontStyle: 'normal',\n },\n 'subheading-compact': {\n lineHeight: 1.3,\n weight: 800,\n fontStyle: 'normal',\n },\n body: {\n lineHeight: 1.3,\n weight: 400,\n fontStyle: 'normal',\n },\n caption: {\n lineHeight: 1.2,\n weight: 400,\n fontStyle: 'normal',\n },\n}\n\nexport const SIZES: Record<NonNullable<TextProps['appearance']>, Record<Size, CSSProperties>> = {\n display: {\n xxxl: {\n fontSize: 84,\n },\n xxl: {\n fontSize: 76,\n },\n xl: {\n fontSize: 68,\n },\n l: {\n fontSize: 60,\n },\n m: {\n fontSize: 52,\n },\n s: {\n fontSize: 44,\n },\n xs: {\n fontSize: 36,\n },\n xxs: {\n fontSize: 28,\n },\n xxxs: {\n fontSize: 20,\n },\n },\n heading: {\n xxxl: {\n fontSize: 64,\n },\n xxl: {\n fontSize: 56,\n },\n xl: {\n fontSize: 48,\n },\n l: {\n fontSize: 40,\n },\n m: {\n fontSize: 36,\n },\n s: {\n fontSize: 32,\n },\n xs: {\n fontSize: 28,\n },\n xxs: {\n fontSize: 24,\n },\n xxxs: {\n fontSize: 20,\n },\n },\n subheading: {\n xxxl: {\n fontSize: 52,\n },\n xxl: {\n fontSize: 46,\n },\n xl: {\n fontSize: 40,\n },\n l: {\n fontSize: 34,\n },\n m: {\n fontSize: 28,\n },\n s: {\n fontSize: 24,\n },\n xs: {\n fontSize: 20,\n },\n xxs: {\n fontSize: 16,\n },\n xxxs: {\n fontSize: 12,\n },\n },\n 'subheading-compact': {\n xxxl: {\n fontSize: 36,\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: 14,\n },\n xxxs: {\n fontSize: 12,\n },\n },\n body: {\n xxxl: {\n fontSize: 32,\n },\n xxl: {\n fontSize: 28,\n },\n xl: {\n fontSize: 24,\n },\n l: {\n fontSize: 20,\n },\n m: {\n fontSize: 18,\n },\n s: {\n fontSize: 16,\n },\n xs: {\n fontSize: 14,\n },\n xxs: {\n fontSize: 12,\n },\n xxxs: {\n fontSize: 10,\n },\n },\n caption: {\n xxxl: {\n fontSize: 32,\n },\n xxl: {\n fontSize: 28,\n },\n xl: {\n fontSize: 24,\n },\n l: {\n fontSize: 20,\n },\n m: {\n fontSize: 18,\n },\n s: {\n fontSize: 16,\n },\n xs: {\n fontSize: 14,\n },\n xxs: {\n fontSize: 12,\n },\n xxxs: {\n fontSize: 10,\n },\n },\n}\n"],"names":["display","lineHeight","weight","fontStyle","heading","subheading","body","caption","xxxl","fontSize","xxl","xl","l","m","s","xs","xxs","xxxs"],"mappings":"gCAOI,CACFA,QAAS,CACPC,WAAY,EACZC,OAAQ,IACRC,UAAW,UAEbC,QAAS,CACPH,WAAY,IACZC,OAAQ,IACRC,UAAW,UAEbE,WAAY,CACVJ,WAAY,IACZC,OAAQ,IACRC,UAAW,UAEb,qBAAsB,CACpBF,WAAY,IACZC,OAAQ,IACRC,UAAW,UAEbG,KAAM,CACJL,WAAY,IACZC,OAAQ,IACRC,UAAW,UAEbI,QAAS,CACPN,WAAY,IACZC,OAAQ,IACRC,UAAW,yBAIiF,CAC9FH,QAAS,CACPQ,KAAM,CACJC,SAAU,IAEZC,IAAK,CACHD,SAAU,IAEZE,GAAI,CACFF,SAAU,IAEZG,EAAG,CACDH,SAAU,IAEZI,EAAG,CACDJ,SAAU,IAEZK,EAAG,CACDL,SAAU,IAEZM,GAAI,CACFN,SAAU,IAEZO,IAAK,CACHP,SAAU,IAEZQ,KAAM,CACJR,SAAU,KAGdL,QAAS,CACPI,KAAM,CACJC,SAAU,IAEZC,IAAK,CACHD,SAAU,IAEZE,GAAI,CACFF,SAAU,IAEZG,EAAG,CACDH,SAAU,IAEZI,EAAG,CACDJ,SAAU,IAEZK,EAAG,CACDL,SAAU,IAEZM,GAAI,CACFN,SAAU,IAEZO,IAAK,CACHP,SAAU,IAEZQ,KAAM,CACJR,SAAU,KAGdJ,WAAY,CACVG,KAAM,CACJC,SAAU,IAEZC,IAAK,CACHD,SAAU,IAEZE,GAAI,CACFF,SAAU,IAEZG,EAAG,CACDH,SAAU,IAEZI,EAAG,CACDJ,SAAU,IAEZK,EAAG,CACDL,SAAU,IAEZM,GAAI,CACFN,SAAU,IAEZO,IAAK,CACHP,SAAU,IAEZQ,KAAM,CACJR,SAAU,KAGd,qBAAsB,CACpBD,KAAM,CACJC,SAAU,IAEZC,IAAK,CACHD,SAAU,IAEZE,GAAI,CACFF,SAAU,IAEZG,EAAG,CACDH,SAAU,IAEZI,EAAG,CACDJ,SAAU,IAEZK,EAAG,CACDL,SAAU,IAEZM,GAAI,CACFN,SAAU,IAEZO,IAAK,CACHP,SAAU,IAEZQ,KAAM,CACJR,SAAU,KAGdH,KAAM,CACJE,KAAM,CACJC,SAAU,IAEZC,IAAK,CACHD,SAAU,IAEZE,GAAI,CACFF,SAAU,IAEZG,EAAG,CACDH,SAAU,IAEZI,EAAG,CACDJ,SAAU,IAEZK,EAAG,CACDL,SAAU,IAEZM,GAAI,CACFN,SAAU,IAEZO,IAAK,CACHP,SAAU,IAEZQ,KAAM,CACJR,SAAU,KAGdF,QAAS,CACPC,KAAM,CACJC,SAAU,IAEZC,IAAK,CACHD,SAAU,IAEZE,GAAI,CACFF,SAAU,IAEZG,EAAG,CACDH,SAAU,IAEZI,EAAG,CACDJ,SAAU,IAEZK,EAAG,CACDL,SAAU,IAEZM,GAAI,CACFN,SAAU,IAEZO,IAAK,CACHP,SAAU,IAEZQ,KAAM,CACJR,SAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/Text/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from 'shared/types'\nimport type {
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/Text/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from 'shared/types'\nimport type { TextProps } from './types'\n\nexport const APPEARANCE: Record<\n NonNullable<TextProps['appearance']>,\n Partial<Omit<TextProps, 'size' | 'appearance'>>\n> = {\n display: {\n lineHeight: 1,\n weight: 800,\n fontStyle: 'normal',\n },\n heading: {\n lineHeight: 1.1,\n weight: 800,\n fontStyle: 'normal',\n },\n subheading: {\n lineHeight: 1.1,\n weight: 700,\n fontStyle: 'normal',\n },\n 'subheading-compact': {\n lineHeight: 1.3,\n weight: 800,\n fontStyle: 'normal',\n },\n body: {\n lineHeight: 1.3,\n weight: 400,\n fontStyle: 'normal',\n },\n caption: {\n lineHeight: 1.2,\n weight: 400,\n fontStyle: 'normal',\n },\n}\n\nexport const SIZES: Record<NonNullable<TextProps['appearance']>, Record<Size, CSSProperties>> = {\n display: {\n xxxl: {\n fontSize: 84,\n },\n xxl: {\n fontSize: 76,\n },\n xl: {\n fontSize: 68,\n },\n l: {\n fontSize: 60,\n },\n m: {\n fontSize: 52,\n },\n s: {\n fontSize: 44,\n },\n xs: {\n fontSize: 36,\n },\n xxs: {\n fontSize: 28,\n },\n xxxs: {\n fontSize: 20,\n },\n },\n heading: {\n xxxl: {\n fontSize: 64,\n },\n xxl: {\n fontSize: 56,\n },\n xl: {\n fontSize: 48,\n },\n l: {\n fontSize: 40,\n },\n m: {\n fontSize: 36,\n },\n s: {\n fontSize: 32,\n },\n xs: {\n fontSize: 28,\n },\n xxs: {\n fontSize: 24,\n },\n xxxs: {\n fontSize: 20,\n },\n },\n subheading: {\n xxxl: {\n fontSize: 52,\n },\n xxl: {\n fontSize: 46,\n },\n xl: {\n fontSize: 40,\n },\n l: {\n fontSize: 34,\n },\n m: {\n fontSize: 28,\n },\n s: {\n fontSize: 24,\n },\n xs: {\n fontSize: 20,\n },\n xxs: {\n fontSize: 16,\n },\n xxxs: {\n fontSize: 12,\n },\n },\n 'subheading-compact': {\n xxxl: {\n fontSize: 36,\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: 14,\n },\n xxxs: {\n fontSize: 12,\n },\n },\n body: {\n xxxl: {\n fontSize: 32,\n },\n xxl: {\n fontSize: 28,\n },\n xl: {\n fontSize: 24,\n },\n l: {\n fontSize: 20,\n },\n m: {\n fontSize: 18,\n },\n s: {\n fontSize: 16,\n },\n xs: {\n fontSize: 14,\n },\n xxs: {\n fontSize: 12,\n },\n xxxs: {\n fontSize: 10,\n },\n },\n caption: {\n xxxl: {\n fontSize: 32,\n },\n xxl: {\n fontSize: 28,\n },\n xl: {\n fontSize: 24,\n },\n l: {\n fontSize: 20,\n },\n m: {\n fontSize: 18,\n },\n s: {\n fontSize: 16,\n },\n xs: {\n fontSize: 14,\n },\n xxs: {\n fontSize: 12,\n },\n xxxs: {\n fontSize: 10,\n },\n },\n}\n"],"names":["APPEARANCE","display","lineHeight","weight","fontStyle","heading","subheading","body","caption","SIZES","xxxl","fontSize","xxl","xl","l","m","s","xs","xxs","xxxs"],"mappings":"AAIO,MAAMA,WAGT,CACFC,QAAS,CACPC,WAAY,EACZC,OAAQ,IACRC,UAAW,UAEbC,QAAS,CACPH,WAAY,IACZC,OAAQ,IACRC,UAAW,UAEbE,WAAY,CACVJ,WAAY,IACZC,OAAQ,IACRC,UAAW,UAEb,qBAAsB,CACpBF,WAAY,IACZC,OAAQ,IACRC,UAAW,UAEbG,KAAM,CACJL,WAAY,IACZC,OAAQ,IACRC,UAAW,UAEbI,QAAS,CACPN,WAAY,IACZC,OAAQ,IACRC,UAAW,WAIR,MAAMK,MAAmF,CAC9FR,QAAS,CACPS,KAAM,CACJC,SAAU,IAEZC,IAAK,CACHD,SAAU,IAEZE,GAAI,CACFF,SAAU,IAEZG,EAAG,CACDH,SAAU,IAEZI,EAAG,CACDJ,SAAU,IAEZK,EAAG,CACDL,SAAU,IAEZM,GAAI,CACFN,SAAU,IAEZO,IAAK,CACHP,SAAU,IAEZQ,KAAM,CACJR,SAAU,KAGdN,QAAS,CACPK,KAAM,CACJC,SAAU,IAEZC,IAAK,CACHD,SAAU,IAEZE,GAAI,CACFF,SAAU,IAEZG,EAAG,CACDH,SAAU,IAEZI,EAAG,CACDJ,SAAU,IAEZK,EAAG,CACDL,SAAU,IAEZM,GAAI,CACFN,SAAU,IAEZO,IAAK,CACHP,SAAU,IAEZQ,KAAM,CACJR,SAAU,KAGdL,WAAY,CACVI,KAAM,CACJC,SAAU,IAEZC,IAAK,CACHD,SAAU,IAEZE,GAAI,CACFF,SAAU,IAEZG,EAAG,CACDH,SAAU,IAEZI,EAAG,CACDJ,SAAU,IAEZK,EAAG,CACDL,SAAU,IAEZM,GAAI,CACFN,SAAU,IAEZO,IAAK,CACHP,SAAU,IAEZQ,KAAM,CACJR,SAAU,KAGd,qBAAsB,CACpBD,KAAM,CACJC,SAAU,IAEZC,IAAK,CACHD,SAAU,IAEZE,GAAI,CACFF,SAAU,IAEZG,EAAG,CACDH,SAAU,IAEZI,EAAG,CACDJ,SAAU,IAEZK,EAAG,CACDL,SAAU,IAEZM,GAAI,CACFN,SAAU,IAEZO,IAAK,CACHP,SAAU,IAEZQ,KAAM,CACJR,SAAU,KAGdJ,KAAM,CACJG,KAAM,CACJC,SAAU,IAEZC,IAAK,CACHD,SAAU,IAEZE,GAAI,CACFF,SAAU,IAEZG,EAAG,CACDH,SAAU,IAEZI,EAAG,CACDJ,SAAU,IAEZK,EAAG,CACDL,SAAU,IAEZM,GAAI,CACFN,SAAU,IAEZO,IAAK,CACHP,SAAU,IAEZQ,KAAM,CACJR,SAAU,KAGdH,QAAS,CACPE,KAAM,CACJC,SAAU,IAEZC,IAAK,CACHD,SAAU,IAEZE,GAAI,CACFF,SAAU,IAEZG,EAAG,CACDH,SAAU,IAEZI,EAAG,CACDJ,SAAU,IAEZK,EAAG,CACDL,SAAU,IAEZM,GAAI,CACFN,SAAU,IAEZO,IAAK,CACHP,SAAU,IAEZQ,KAAM,CACJR,SAAU"}
|
package/components/Text/style.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var styled=require('styled-components');var display=require('../../mixins/display.js');var color=require('../../mixins/color.js');var responsiveSize=require('../../mixins/responsive-size.js');var responsiveMargin=require('../../mixins/responsive-margin.js');var style=require('../../shared/utils/style.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var styled__default=_interopDefault(styled);const WEIGHT_MAP={lighter:100,normal:400,bold:600,bolder:800};const LINE_HEIGHT_MAP={l:1.5,m:1.3,s:1.15,xs:1};const shouldForwardTextProp=style.createShouldForwardProp((e=>!['appearance','fontFamily','weight','fontStyle','transform','underlineLinks','textAlign','lineHeight','content','display','chars','quoted','showZeroMinorPart','separator','underline','whiteSpace','wordBreak'].includes(e)));const Root=styled__default.default.div.withConfig({shouldForwardProp:shouldForwardTextProp}).withConfig({displayName:"Text__Root",componentId:"ui__sc-s2fogy-0"})([""," "," "," "," ",""],(e=>`\n margin: 0;\n ${e.fontFamily?`font-family: ${e.fontFamily};`:''}\n ${e.transform?`text-transform: ${e.transform};`:''}\n ${e.weight?`font-weight: ${WEIGHT_MAP[e.weight]??e.weight};`:''}\n ${e.fontStyle?`font-style: ${e.fontStyle};`:''}\n ${e.textAlign?`text-align: ${e.textAlign};`:''}\n ${e.lineHeight?`line-height: ${LINE_HEIGHT_MAP[e.lineHeight]??e.lineHeight};`:''}\n ${e.underline?`border-bottom: 1px ${typeof e.underline=='string'?e.underline:'solid'};`:''}\n ${e.whiteSpace?`white-space: ${e.whiteSpace};`:''}\n ${e.wordBreak?`word-break: ${e.wordBreak};`:''}\n a {\n text-decoration: ${e.underlineLinks?'underline':'none'};\n &:hover {\n text-decoration: none;\n }\n }\n `),responsiveSize.responsiveSize,responsiveMargin.responsiveMargin,(e=>e.display?display.display(e.display):null),(e=>color.color(e.color?e.color:e.theme.textColor)));exports.Root=Root;
|
|
1
|
+
'use strict';var styled=require('styled-components');var tinycolor=require('../../external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.js');var display=require('../../mixins/display.js');var color=require('../../mixins/color.js');var responsiveSize=require('../../mixins/responsive-size.js');var responsiveMargin=require('../../mixins/responsive-margin.js');var focus=require('../../mixins/focus.js');var style=require('../../shared/utils/style.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var styled__default=_interopDefault(styled);const WEIGHT_MAP={lighter:100,normal:400,bold:600,bolder:800};const LINE_HEIGHT_MAP={l:1.5,m:1.3,s:1.15,xs:1};const shouldForwardTextProp=style.createShouldForwardProp((e=>!['appearance','fontFamily','weight','fontStyle','transform','underlineLinks','textAlign','lineHeight','content','display','chars','quoted','showZeroMinorPart','separator','underline','whiteSpace','wordBreak'].includes(e)));const template=e=>`\n color: ${e.color};\n background-color: ${e.backgroundColor};\n &:hover {\n color: ${e.colorHover};\n }\n &:active {\n color: ${e.color};\n }\n &:disabled {\n color: ${e.colorDisabled};\n }\n`;const COLOR_SCHEMA={primary:styled.css(["",""],(e=>template({color:e.theme.colors['content-link'],colorHover:tinycolor.default(e.theme.colors['content-link']).lighten(10).toString(),colorDisabled:e.theme.colors['content-disabled'],backgroundColor:e.theme.colors.transparent,...e.palette}))),contrast:styled.css(["",""],(e=>template({color:e.theme.colors['content-oncolor-primary'],colorHover:tinycolor.default(e.theme.colors['content-oncolor-primary']).darken(10).toString(),colorDisabled:e.theme.colors['content-oncolor-disabled'],backgroundColor:e.theme.colors.transparent,...e.palette})))};const Root=styled__default.default.div.withConfig({shouldForwardProp:shouldForwardTextProp}).withConfig({displayName:"Text__Root",componentId:"ui__sc-s2fogy-0"})([""," "," "," "," ",""],(e=>`\n margin: 0;\n padding: 0;\n ${e.fontFamily?`font-family: ${e.fontFamily};`:''}\n ${e.transform?`text-transform: ${e.transform};`:''}\n ${e.weight?`font-weight: ${WEIGHT_MAP[e.weight]??e.weight};`:''}\n ${e.fontStyle?`font-style: ${e.fontStyle};`:''}\n ${e.textAlign?`text-align: ${e.textAlign};`:''}\n ${e.lineHeight?`line-height: ${LINE_HEIGHT_MAP[e.lineHeight]??e.lineHeight};`:''}\n ${e.underline?`border-bottom: 1px ${typeof e.underline=='string'?e.underline:'solid'};`:''}\n ${e.whiteSpace?`white-space: ${e.whiteSpace};`:''}\n ${e.wordBreak?`word-break: ${e.wordBreak};`:''}\n a {\n text-decoration: ${e.underlineLinks?'underline':'none'};\n &:hover {\n text-decoration: none;\n }\n }\n `),responsiveSize.responsiveSize,responsiveMargin.responsiveMargin,(e=>e.display?display.display(e.display):null),(e=>color.color(e.color?e.color:e.theme.textColor)));const TextEllipsis=styled__default.default.span.withConfig({shouldForwardProp:e=>!['lines','expanded'].includes(e)}).withConfig({displayName:"Text__TextEllipsis",componentId:"ui__sc-s2fogy-1"})(["box-sizing:border-box;display:block;position:relative;",""],(e=>!e.expanded&&`\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${e.lines};\n overflow: hidden;\n text-overflow: ellipsis;\n `));const LineHeight=styled__default.default.span.withConfig({displayName:"Text__LineHeight",componentId:"ui__sc-s2fogy-2"})(["box-sizing:border-box;position:absolute;visibility:hidden;"]);const ExpandButton=styled__default.default.button.withConfig({shouldForwardProp:e=>!['contrast','palette'].includes(e)}).withConfig({displayName:"Text__ExpandButton",componentId:"ui__sc-s2fogy-3"})(["box-sizing:border-box;appearance:none;padding:0;border:0;font-size:inherit;font-family:inherit;font-weight:inherit;font-style:inherit;margin-top:0.2em;border-bottom:1px dashed;cursor:pointer;&:disabled{cursor:not-allowed;}"," ",""],(e=>e.contrast?COLOR_SCHEMA.contrast:COLOR_SCHEMA.primary),focus.focus);exports.ExpandButton=ExpandButton,exports.LineHeight=LineHeight,exports.Root=Root,exports.TextEllipsis=TextEllipsis;
|
|
2
2
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../src/components/Text/style.ts"],"sourcesContent":["import styled from 'styled-components'\nimport { display } from 'mixins/display'\nimport { color } from 'mixins/color'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { Color } from 'shared/types'\nimport type { StyledTextProps } from './types'\n\nconst WEIGHT_MAP = {\n lighter: 100,\n normal: 400,\n bold: 600,\n bolder: 800,\n}\n\nconst LINE_HEIGHT_MAP = {\n l: 1.5,\n m: 1.3,\n s: 1.15,\n xs: 1,\n}\n\nconst shouldForwardTextProp = createShouldForwardProp(\n (propKey) =>\n ![\n 'appearance',\n 'fontFamily',\n 'weight',\n 'fontStyle',\n 'transform',\n 'underlineLinks',\n 'textAlign',\n 'lineHeight',\n 'content',\n 'display',\n 'chars',\n 'quoted',\n 'showZeroMinorPart',\n 'separator',\n 'underline',\n 'whiteSpace',\n 'wordBreak',\n ].includes(propKey)\n)\n\nexport const Root = styled.div.withConfig<StyledTextProps>({\n shouldForwardProp: shouldForwardTextProp,\n})`\n ${(props) => `\n margin: 0;\n ${props.fontFamily ? `font-family: ${props.fontFamily};` : ''}\n ${props.transform ? `text-transform: ${props.transform};` : ''}\n ${props.weight ? `font-weight: ${WEIGHT_MAP[props.weight] ?? props.weight};` : ''}\n ${props.fontStyle ? `font-style: ${props.fontStyle};` : ''}\n ${props.textAlign ? `text-align: ${props.textAlign};` : ''}\n ${props.lineHeight ? `line-height: ${LINE_HEIGHT_MAP[props.lineHeight] ?? props.lineHeight};` : ''}\n ${props.underline ? `border-bottom: 1px ${typeof props.underline === 'string' ? props.underline : 'solid'};` : ''}\n ${props.whiteSpace ? `white-space: ${props.whiteSpace};` : ''}\n ${props.wordBreak ? `word-break: ${props.wordBreak};` : ''}\n a {\n text-decoration: ${props.underlineLinks ? 'underline' : 'none'};\n &:hover {\n text-decoration: none;\n }\n }\n `}\n\n ${responsiveSize}\n ${responsiveMargin}\n\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => (props.color ? color(props.color) : color(props.theme.textColor as Color))}\n`\n"],"names":["WEIGHT_MAP","lighter","normal","bold","bolder","LINE_HEIGHT_MAP","l","m","s","xs","shouldForwardTextProp","createShouldForwardProp","propKey","includes","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../src/components/Text/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport { display } from 'mixins/display'\nimport { color } from 'mixins/color'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { Color, CSSColor } from 'shared/types'\nimport type { StyledTextProps, ExpandButtonPalette, StyledTextEllipsisProps, StyledExpandButtonProps } from './types'\n\nconst WEIGHT_MAP = {\n lighter: 100,\n normal: 400,\n bold: 600,\n bolder: 800,\n}\n\nconst LINE_HEIGHT_MAP = {\n l: 1.5,\n m: 1.3,\n s: 1.15,\n xs: 1,\n}\n\nconst shouldForwardTextProp = createShouldForwardProp(\n (propKey) =>\n ![\n 'appearance',\n 'fontFamily',\n 'weight',\n 'fontStyle',\n 'transform',\n 'underlineLinks',\n 'textAlign',\n 'lineHeight',\n 'content',\n 'display',\n 'chars',\n 'quoted',\n 'showZeroMinorPart',\n 'separator',\n 'underline',\n 'whiteSpace',\n 'wordBreak',\n ].includes(propKey)\n)\n\nconst template = (palette: ExpandButtonPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n &:hover {\n color: ${palette.colorHover};\n }\n &:active {\n color: ${palette.color};\n }\n &:disabled {\n color: ${palette.colorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n primary: css<StyledExpandButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-link'],\n colorHover: tinycolor(props.theme.colors['content-link']).lighten(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColor: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n contrast: css<StyledExpandButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-primary'],\n colorHover: tinycolor(props.theme.colors['content-oncolor-primary']).darken(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColor: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledTextProps>({\n shouldForwardProp: shouldForwardTextProp,\n})`\n ${(props) => `\n margin: 0;\n padding: 0;\n ${props.fontFamily ? `font-family: ${props.fontFamily};` : ''}\n ${props.transform ? `text-transform: ${props.transform};` : ''}\n ${props.weight ? `font-weight: ${WEIGHT_MAP[props.weight] ?? props.weight};` : ''}\n ${props.fontStyle ? `font-style: ${props.fontStyle};` : ''}\n ${props.textAlign ? `text-align: ${props.textAlign};` : ''}\n ${props.lineHeight ? `line-height: ${LINE_HEIGHT_MAP[props.lineHeight] ?? props.lineHeight};` : ''}\n ${props.underline ? `border-bottom: 1px ${typeof props.underline === 'string' ? props.underline : 'solid'};` : ''}\n ${props.whiteSpace ? `white-space: ${props.whiteSpace};` : ''}\n ${props.wordBreak ? `word-break: ${props.wordBreak};` : ''}\n a {\n text-decoration: ${props.underlineLinks ? 'underline' : 'none'};\n &:hover {\n text-decoration: none;\n }\n }\n `}\n\n ${responsiveSize}\n ${responsiveMargin}\n\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => (props.color ? color(props.color) : color(props.theme.textColor as Color))}\n`\n\nexport const TextEllipsis = styled.span.withConfig<StyledTextEllipsisProps>({\n shouldForwardProp: (propKey) => !['lines', 'expanded'].includes(propKey),\n})`\n box-sizing: border-box;\n display: block;\n position: relative;\n\n ${(props) =>\n !props.expanded &&\n `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${props.lines};\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n`\n\nexport const LineHeight = styled.span`\n box-sizing: border-box;\n position: absolute;\n visibility: hidden;\n`\n\nexport const ExpandButton = styled.button.withConfig<StyledExpandButtonProps>({\n shouldForwardProp: (propKey) => !['contrast', 'palette'].includes(propKey),\n})`\n box-sizing: border-box;\n appearance: none;\n padding: 0;\n border: 0;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n font-style: inherit;\n margin-top: 0.2em;\n border-bottom: 1px dashed;\n cursor: pointer;\n &:disabled {\n cursor: not-allowed;\n }\n\n ${(props) => (props.contrast ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.primary)}\n\n ${focus}\n`\n"],"names":["WEIGHT_MAP","lighter","normal","bold","bolder","LINE_HEIGHT_MAP","l","m","s","xs","shouldForwardTextProp","createShouldForwardProp","propKey","includes","template","palette","color","backgroundColor","colorHover","colorDisabled","COLOR_SCHEMA","primary","css","props","theme","colors","tinycolor","default","lighten","toString","transparent","contrast","darken","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","fontFamily","transform","weight","fontStyle","textAlign","lineHeight","underline","whiteSpace","wordBreak","underlineLinks","responsiveSize","responsiveMargin","display","textColor","TextEllipsis","span","expanded","lines","LineHeight","ExpandButton","button","focus"],"mappings":"4jBAWA,MAAMA,WAAa,CACjBC,QAAS,IACTC,OAAQ,IACRC,KAAM,IACNC,OAAQ,KAGV,MAAMC,gBAAkB,CACtBC,EAAG,IACHC,EAAG,IACHC,EAAG,KACHC,GAAI,GAGN,MAAMC,sBAAwBC,MAAuBA,yBAClDC,IACE,CACC,aACA,aACA,SACA,YACA,YACA,iBACA,YACA,aACA,UACA,UACA,QACA,SACA,oBACA,YACA,YACA,aACA,aACAC,SAASD,KAGf,MAAME,SAAYC,GAAiC,cACxCA,EAAQC,+BACGD,EAAQE,6CAEjBF,EAAQG,8CAGRH,EAAQC,2CAGRD,EAAQI,wBAIrB,MAAMC,aAAe,CACnBC,QAASC,OAAGA,IAAA,CAAA,GAAA,KACPC,GACDT,SAAS,CACPE,MAAOO,EAAMC,MAAMC,OAAO,gBAC1BP,WAAYQ,UAASC,QAACJ,EAAMC,MAAMC,OAAO,iBAAiBG,QAAQ,IAAIC,WACtEV,cAAeI,EAAMC,MAAMC,OAAO,oBAClCR,gBAAiBM,EAAMC,MAAMC,OAAOK,eACjCP,EAAMR,YAGfgB,SAAUT,OAAGA,IAAA,CAAA,GAAA,KACRC,GACDT,SAAS,CACPE,MAAOO,EAAMC,MAAMC,OAAO,2BA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ACAA,EAAMiC,UACP,iGAGwBjC,EAAMkC,gFAMrBC,WAAaxB,gBAAAA,QAAOqB,KAAInB,WAAA,CAAAE,YAAA,mBAAAC,YAAA,mBAAXL,CAIzB,CAAA,+DAEM,MAAMyB,aAAezB,gBAAAA,QAAO0B,OAAOxB,WAAoC,CAC5EC,kBAAoBzB,IAAa,CAAC,WAAY,WAAWC,SAASD,KAClEwB,WAAA,CAAAE,YAAA,qBAAAC,YAAA,mBAF0BL,CAE1B,CAAA,iOAAA,IAAA,KAgBGX,GAAWA,EAAMQ,SAAWX,aAAaW,SAAWX,aAAaC,SAElEwC,MAAKA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import styled
|
|
1
|
+
import styled,{css}from'styled-components';import tinycolor from'../../external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.mjs';import{display}from'../../mixins/display.mjs';import{color}from'../../mixins/color.mjs';import{responsiveSize}from'../../mixins/responsive-size.mjs';import{responsiveMargin}from'../../mixins/responsive-margin.mjs';import{focus}from'../../mixins/focus.mjs';import{createShouldForwardProp}from'../../shared/utils/style.mjs';const WEIGHT_MAP={lighter:100,normal:400,bold:600,bolder:800};const LINE_HEIGHT_MAP={l:1.5,m:1.3,s:1.15,xs:1};const shouldForwardTextProp=createShouldForwardProp((o=>!['appearance','fontFamily','weight','fontStyle','transform','underlineLinks','textAlign','lineHeight','content','display','chars','quoted','showZeroMinorPart','separator','underline','whiteSpace','wordBreak'].includes(o)));const template=o=>`\n color: ${o.color};\n background-color: ${o.backgroundColor};\n &:hover {\n color: ${o.colorHover};\n }\n &:active {\n color: ${o.color};\n }\n &:disabled {\n color: ${o.colorDisabled};\n }\n`;const COLOR_SCHEMA={primary:css(["",""],(o=>template({color:o.theme.colors['content-link'],colorHover:tinycolor(o.theme.colors['content-link']).lighten(10).toString(),colorDisabled:o.theme.colors['content-disabled'],backgroundColor:o.theme.colors.transparent,...o.palette}))),contrast:css(["",""],(o=>template({color:o.theme.colors['content-oncolor-primary'],colorHover:tinycolor(o.theme.colors['content-oncolor-primary']).darken(10).toString(),colorDisabled:o.theme.colors['content-oncolor-disabled'],backgroundColor:o.theme.colors.transparent,...o.palette})))};const Root=styled.div.withConfig({shouldForwardProp:shouldForwardTextProp}).withConfig({displayName:"Text__Root",componentId:"ui__sc-s2fogy-0"})([""," "," "," "," ",""],(o=>`\n margin: 0;\n padding: 0;\n ${o.fontFamily?`font-family: ${o.fontFamily};`:''}\n ${o.transform?`text-transform: ${o.transform};`:''}\n ${o.weight?`font-weight: ${WEIGHT_MAP[o.weight]??o.weight};`:''}\n ${o.fontStyle?`font-style: ${o.fontStyle};`:''}\n ${o.textAlign?`text-align: ${o.textAlign};`:''}\n ${o.lineHeight?`line-height: ${LINE_HEIGHT_MAP[o.lineHeight]??o.lineHeight};`:''}\n ${o.underline?`border-bottom: 1px ${typeof o.underline=='string'?o.underline:'solid'};`:''}\n ${o.whiteSpace?`white-space: ${o.whiteSpace};`:''}\n ${o.wordBreak?`word-break: ${o.wordBreak};`:''}\n a {\n text-decoration: ${o.underlineLinks?'underline':'none'};\n &:hover {\n text-decoration: none;\n }\n }\n `),responsiveSize,responsiveMargin,(o=>o.display?display(o.display):null),(o=>color(o.color?o.color:o.theme.textColor)));const TextEllipsis=styled.span.withConfig({shouldForwardProp:o=>!['lines','expanded'].includes(o)}).withConfig({displayName:"Text__TextEllipsis",componentId:"ui__sc-s2fogy-1"})(["box-sizing:border-box;display:block;position:relative;",""],(o=>!o.expanded&&`\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${o.lines};\n overflow: hidden;\n text-overflow: ellipsis;\n `));const LineHeight=styled.span.withConfig({displayName:"Text__LineHeight",componentId:"ui__sc-s2fogy-2"})(["box-sizing:border-box;position:absolute;visibility:hidden;"]);const ExpandButton=styled.button.withConfig({shouldForwardProp:o=>!['contrast','palette'].includes(o)}).withConfig({displayName:"Text__ExpandButton",componentId:"ui__sc-s2fogy-3"})(["box-sizing:border-box;appearance:none;padding:0;border:0;font-size:inherit;font-family:inherit;font-weight:inherit;font-style:inherit;margin-top:0.2em;border-bottom:1px dashed;cursor:pointer;&:disabled{cursor:not-allowed;}"," ",""],(o=>o.contrast?COLOR_SCHEMA.contrast:COLOR_SCHEMA.primary),focus);export{ExpandButton,LineHeight,Root,TextEllipsis};
|
|
2
2
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","sources":["../../../../src/components/Text/style.ts"],"sourcesContent":["import styled from 'styled-components'\nimport { display } from 'mixins/display'\nimport { color } from 'mixins/color'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { Color } from 'shared/types'\nimport type { StyledTextProps } from './types'\n\nconst WEIGHT_MAP = {\n lighter: 100,\n normal: 400,\n bold: 600,\n bolder: 800,\n}\n\nconst LINE_HEIGHT_MAP = {\n l: 1.5,\n m: 1.3,\n s: 1.15,\n xs: 1,\n}\n\nconst shouldForwardTextProp = createShouldForwardProp(\n (propKey) =>\n ![\n 'appearance',\n 'fontFamily',\n 'weight',\n 'fontStyle',\n 'transform',\n 'underlineLinks',\n 'textAlign',\n 'lineHeight',\n 'content',\n 'display',\n 'chars',\n 'quoted',\n 'showZeroMinorPart',\n 'separator',\n 'underline',\n 'whiteSpace',\n 'wordBreak',\n ].includes(propKey)\n)\n\nexport const Root = styled.div.withConfig<StyledTextProps>({\n shouldForwardProp: shouldForwardTextProp,\n})`\n ${(props) => `\n margin: 0;\n ${props.fontFamily ? `font-family: ${props.fontFamily};` : ''}\n ${props.transform ? `text-transform: ${props.transform};` : ''}\n ${props.weight ? `font-weight: ${WEIGHT_MAP[props.weight] ?? props.weight};` : ''}\n ${props.fontStyle ? `font-style: ${props.fontStyle};` : ''}\n ${props.textAlign ? `text-align: ${props.textAlign};` : ''}\n ${props.lineHeight ? `line-height: ${LINE_HEIGHT_MAP[props.lineHeight] ?? props.lineHeight};` : ''}\n ${props.underline ? `border-bottom: 1px ${typeof props.underline === 'string' ? props.underline : 'solid'};` : ''}\n ${props.whiteSpace ? `white-space: ${props.whiteSpace};` : ''}\n ${props.wordBreak ? `word-break: ${props.wordBreak};` : ''}\n a {\n text-decoration: ${props.underlineLinks ? 'underline' : 'none'};\n &:hover {\n text-decoration: none;\n }\n }\n `}\n\n ${responsiveSize}\n ${responsiveMargin}\n\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => (props.color ? color(props.color) : color(props.theme.textColor as Color))}\n`\n"],"names":["WEIGHT_MAP","lighter","normal","bold","bolder","LINE_HEIGHT_MAP","l","m","s","xs","shouldForwardTextProp","createShouldForwardProp","propKey","includes","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","
|
|
1
|
+
{"version":3,"file":"style.mjs","sources":["../../../../src/components/Text/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport { display } from 'mixins/display'\nimport { color } from 'mixins/color'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { Color, CSSColor } from 'shared/types'\nimport type { StyledTextProps, ExpandButtonPalette, StyledTextEllipsisProps, StyledExpandButtonProps } from './types'\n\nconst WEIGHT_MAP = {\n lighter: 100,\n normal: 400,\n bold: 600,\n bolder: 800,\n}\n\nconst LINE_HEIGHT_MAP = {\n l: 1.5,\n m: 1.3,\n s: 1.15,\n xs: 1,\n}\n\nconst shouldForwardTextProp = createShouldForwardProp(\n (propKey) =>\n ![\n 'appearance',\n 'fontFamily',\n 'weight',\n 'fontStyle',\n 'transform',\n 'underlineLinks',\n 'textAlign',\n 'lineHeight',\n 'content',\n 'display',\n 'chars',\n 'quoted',\n 'showZeroMinorPart',\n 'separator',\n 'underline',\n 'whiteSpace',\n 'wordBreak',\n ].includes(propKey)\n)\n\nconst template = (palette: ExpandButtonPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n &:hover {\n color: ${palette.colorHover};\n }\n &:active {\n color: ${palette.color};\n }\n &:disabled {\n color: ${palette.colorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n primary: css<StyledExpandButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-link'],\n colorHover: tinycolor(props.theme.colors['content-link']).lighten(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n backgroundColor: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n contrast: css<StyledExpandButtonProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-primary'],\n colorHover: tinycolor(props.theme.colors['content-oncolor-primary']).darken(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n backgroundColor: props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledTextProps>({\n shouldForwardProp: shouldForwardTextProp,\n})`\n ${(props) => `\n margin: 0;\n padding: 0;\n ${props.fontFamily ? `font-family: ${props.fontFamily};` : ''}\n ${props.transform ? `text-transform: ${props.transform};` : ''}\n ${props.weight ? `font-weight: ${WEIGHT_MAP[props.weight] ?? props.weight};` : ''}\n ${props.fontStyle ? `font-style: ${props.fontStyle};` : ''}\n ${props.textAlign ? `text-align: ${props.textAlign};` : ''}\n ${props.lineHeight ? `line-height: ${LINE_HEIGHT_MAP[props.lineHeight] ?? props.lineHeight};` : ''}\n ${props.underline ? `border-bottom: 1px ${typeof props.underline === 'string' ? props.underline : 'solid'};` : ''}\n ${props.whiteSpace ? `white-space: ${props.whiteSpace};` : ''}\n ${props.wordBreak ? `word-break: ${props.wordBreak};` : ''}\n a {\n text-decoration: ${props.underlineLinks ? 'underline' : 'none'};\n &:hover {\n text-decoration: none;\n }\n }\n `}\n\n ${responsiveSize}\n ${responsiveMargin}\n\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => (props.color ? color(props.color) : color(props.theme.textColor as Color))}\n`\n\nexport const TextEllipsis = styled.span.withConfig<StyledTextEllipsisProps>({\n shouldForwardProp: (propKey) => !['lines', 'expanded'].includes(propKey),\n})`\n box-sizing: border-box;\n display: block;\n position: relative;\n\n ${(props) =>\n !props.expanded &&\n `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${props.lines};\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n`\n\nexport const LineHeight = styled.span`\n box-sizing: border-box;\n position: absolute;\n visibility: hidden;\n`\n\nexport const ExpandButton = styled.button.withConfig<StyledExpandButtonProps>({\n shouldForwardProp: (propKey) => !['contrast', 'palette'].includes(propKey),\n})`\n box-sizing: border-box;\n appearance: none;\n padding: 0;\n border: 0;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n font-style: inherit;\n margin-top: 0.2em;\n border-bottom: 1px dashed;\n cursor: pointer;\n &:disabled {\n cursor: not-allowed;\n }\n\n ${(props) => (props.contrast ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.primary)}\n\n ${focus}\n`\n"],"names":["WEIGHT_MAP","lighter","normal","bold","bolder","LINE_HEIGHT_MAP","l","m","s","xs","shouldForwardTextProp","createShouldForwardProp","propKey","includes","template","palette","color","backgroundColor","colorHover","colorDisabled","COLOR_SCHEMA","primary","css","props","theme","colors","tinycolor","lighten","toString","transparent","contrast","darken","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","fontFamily","transform","weight","fontStyle","textAlign","lineHeight","underline","whiteSpace","wordBreak","underlineLinks","responsiveSize","responsiveMargin","display","textColor","TextEllipsis","span","expanded","lines","LineHeight","ExpandButton","button","focus"],"mappings":"gdAWA,MAAMA,WAAa,CACjBC,QAAS,IACTC,OAAQ,IACRC,KAAM,IACNC,OAAQ,KAGV,MAAMC,gBAAkB,CACtBC,EAAG,IACHC,EAAG,IACHC,EAAG,KACHC,GAAI,GAGN,MAAMC,sBAAwBC,yBAC3BC,I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AY,6BAA6BtB,EAAMsB,WAAc,SAAWtB,EAAMsB,UAAY,WAAa,WAC7GtB,EAAMuB,WAAa,gBAAgBvB,EAAMuB,cAAgB,WACzDvB,EAAMwB,UAAY,eAAexB,EAAMwB,aAAe,uCAEnCxB,EAAMyB,eAAiB,YAAc,gFAO1DC,eACAC,kBAEC3B,GAAWA,EAAM4B,QAAUA,QAAQ5B,EAAM4B,SAAW,OACpD5B,GAAyBP,MAAdO,EAAMP,MAAcO,EAAMP,MAAeO,EAAMC,MAAM4B,aAG9D,MAAMC,aAAepB,OAAOqB,KAAKnB,WAAoC,CAC1EC,kBAAoBxB,IAAa,CAAC,QAAS,YAAYC,SAASD,KAChEuB,WAAA,CAAAE,YAAA,qBAAAC,YAAA,mBAF0BL,CAE1B,CAAA,yDAAA,KAKGV,IACAA,EAAMgC,UACP,iGAGwBhC,EAAMiC,gFAMrBC,WAAaxB,OAAOqB,KAAInB,WAAA,CAAAE,YAAA,mBAAAC,YAAA,mBAAXL,CAIzB,CAAA,+DAEM,MAAMyB,aAAezB,OAAO0B,OAAOxB,WAAoC,CAC5EC,kBAAoBxB,IAAa,CAAC,WAAY,WAAWC,SAASD,KAClEuB,WAAA,CAAAE,YAAA,qBAAAC,YAAA,mBAF0BL,CAE1B,CAAA,iOAAA,IAAA,KAgBGV,GAAWA,EAAMO,SAAWV,aAAaU,SAAWV,aAAaC,SAElEuC"}
|
package/dts/index.d.ts
CHANGED
|
@@ -1058,32 +1058,75 @@ interface DisplayProperty {
|
|
|
1058
1058
|
display?: Display;
|
|
1059
1059
|
}
|
|
1060
1060
|
|
|
1061
|
-
declare type
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1061
|
+
declare type ExpandButtonPalette = {
|
|
1062
|
+
color: CSSColor;
|
|
1063
|
+
colorHover: CSSColor;
|
|
1064
|
+
colorDisabled: CSSColor;
|
|
1065
|
+
backgroundColor: CSSColor;
|
|
1066
|
+
};
|
|
1067
|
+
interface ExpandButtonProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
1068
|
+
/** Адаптировать цветовую схему для контрастного фона */
|
|
1069
|
+
contrast?: boolean;
|
|
1070
|
+
/** Текст если часть контента свернута (дефолт `Развернуть`) */
|
|
1071
|
+
captionCollapsed: React.ReactNode;
|
|
1072
|
+
/** Текст если контент полностью развернут (дефолт `Свернуть`) */
|
|
1073
|
+
captionExpanded: React.ReactNode;
|
|
1074
|
+
/** Кастомные цвета */
|
|
1075
|
+
palette?: Partial<Record<keyof ExpandButtonPalette, Color>>;
|
|
1076
|
+
}
|
|
1077
|
+
interface TextProps extends ResponsiveSizeProps<Size, SizeValue>, ResponsiveMarginProps,
|
|
1078
|
+
/** @deprecated */
|
|
1079
|
+
DisplayProperty, ColorProperty, Omit<React.HTMLAttributes<HTMLElement>, 'color'>, Omit<React.BlockquoteHTMLAttributes<HTMLElement>, 'color'>, Omit<React.LabelHTMLAttributes<HTMLElement>, 'color'> {
|
|
1080
|
+
/** Применение присета стилей и размеров */
|
|
1081
|
+
appearance?: 'display' | 'heading' | 'subheading' | 'subheading-compact' | 'body' | 'caption';
|
|
1082
|
+
/** Тип рутового элемента (дефолт `div`) */
|
|
1083
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'blockquote' | 'q' | 'figcaption' | 'cite' | 'caption' | 'label' | 'legend' | 'summary' | 'span' | 'div';
|
|
1084
|
+
/** Основной контент */
|
|
1085
|
+
children?: React.ReactNode;
|
|
1086
|
+
/** Сокращение части контента */
|
|
1087
|
+
ellipsis?: boolean | {
|
|
1088
|
+
/** Число строк в свернутом состоянии (дефолт `1`) */
|
|
1089
|
+
lines?: number;
|
|
1090
|
+
/**
|
|
1091
|
+
* Текущее состояние контента: свернут или развернут.
|
|
1092
|
+
* Использование включает контролируемый режим
|
|
1093
|
+
*/
|
|
1094
|
+
expanded?: boolean;
|
|
1095
|
+
/** Рендер контрола для тогла сокращенной части контента */
|
|
1096
|
+
expandable?: boolean;
|
|
1097
|
+
/** В начальном состоянии контент развернут */
|
|
1098
|
+
defaultExpanded?: boolean;
|
|
1099
|
+
};
|
|
1100
|
+
/**
|
|
1101
|
+
* Пропсы контрола для тогла сокращенной части контента.
|
|
1102
|
+
* Используется если передано `ellipsis.expandable=true`
|
|
1103
|
+
*/
|
|
1104
|
+
expandButtonProps?: ExpandButtonProps;
|
|
1105
|
+
/** Значение для `font-family` */
|
|
1068
1106
|
fontFamily?: string;
|
|
1069
|
-
/**
|
|
1107
|
+
/** Значение для `font-style` */
|
|
1108
|
+
fontStyle?: 'normal' | 'italic';
|
|
1109
|
+
/** Значение для `line-height` */
|
|
1110
|
+
lineHeight?: 'l' | 'm' | 's' | 'xs' | number;
|
|
1111
|
+
/**
|
|
1112
|
+
* Колбек, который будет вызван при изменении состояния сокращенной части контента.
|
|
1113
|
+
* Используется в комбинации с пропом `ellipsis`
|
|
1114
|
+
*/
|
|
1115
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
1116
|
+
/** Значение для `text-align` */
|
|
1117
|
+
textAlign?: 'left' | 'center' | 'right' | 'justify' | 'start' | 'end';
|
|
1118
|
+
/** Значение для `text-transform` */
|
|
1119
|
+
transform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
|
|
1120
|
+
/** Значение для `font-weight` */
|
|
1070
1121
|
weight?: CSSFontWeight;
|
|
1071
|
-
/**
|
|
1122
|
+
/** Значение для `white-space` */
|
|
1072
1123
|
whiteSpace?: string;
|
|
1073
|
-
/**
|
|
1124
|
+
/** Значение для `word-break` */
|
|
1074
1125
|
wordBreak?: string;
|
|
1075
|
-
/**
|
|
1076
|
-
|
|
1077
|
-
/**
|
|
1078
|
-
transform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
|
|
1079
|
-
/** Underline content */
|
|
1126
|
+
/** @ignore */
|
|
1127
|
+
ref?: ((instance: HTMLElement | null) => void) | React.RefObject<HTMLElement> | null | undefined;
|
|
1128
|
+
/** @ignore */
|
|
1080
1129
|
underline?: CSSBorderStyle | boolean;
|
|
1081
|
-
/** Text align */
|
|
1082
|
-
textAlign?: 'left' | 'center' | 'right' | 'justify' | 'start' | 'end';
|
|
1083
|
-
/** Line height */
|
|
1084
|
-
lineHeight?: 'l' | 'm' | 's' | 'xs' | number;
|
|
1085
|
-
/** React children */
|
|
1086
|
-
children?: React.ReactNode;
|
|
1087
1130
|
/** @ignore @deprecated Use Anchor interface */
|
|
1088
1131
|
underlineLinks?: boolean;
|
|
1089
1132
|
/** @ignore @deprecated Use children */
|
|
@@ -1092,13 +1135,13 @@ interface TextProps extends ResponsiveSizeProps<Size, SizeValue>, ResponsiveMarg
|
|
|
1092
1135
|
|
|
1093
1136
|
/**
|
|
1094
1137
|
*
|
|
1095
|
-
*
|
|
1138
|
+
* Компонент поддерживает все нативные атрибуты рутового элемента.
|
|
1096
1139
|
*
|
|
1097
|
-
*
|
|
1140
|
+
* Можно передать "ref", который будет ассоциирован с рутовым элементом.
|
|
1098
1141
|
*
|
|
1099
|
-
*
|
|
1142
|
+
* Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.
|
|
1100
1143
|
*
|
|
1101
|
-
*
|
|
1144
|
+
* Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Text/types.ts).
|
|
1102
1145
|
*/
|
|
1103
1146
|
declare const Text$1: React.ForwardRefExoticComponent<TextProps> & {
|
|
1104
1147
|
Heading: typeof TextHeading;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var _commonjsHelpers=require('../../../../../../_virtual/_commonjsHelpers.js');var ResizeObserver$1=require('../../../../../../_virtual/ResizeObserver.js');ResizeObserver$1.__module.exports=function(){var e=function(){if(typeof Map!='undefined')return Map;function getIndex(e,t){var r=-1;return e.some(((e,n)=>e[0]===t&&(r=n,!0))),r}return function(){function class_1(){this.__entries__=[]}return Object.defineProperty(class_1.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),class_1.prototype.get=function(e){var t=getIndex(this.__entries__,e);var r=this.__entries__[t];return r&&r[1]},class_1.prototype.set=function(e,t){var r=getIndex(this.__entries__,e);~r?this.__entries__[r][1]=t:this.__entries__.push([e,t])},class_1.prototype.delete=function(e){var t=this.__entries__;var r=getIndex(t,e);~r&&t.splice(r,1)},class_1.prototype.has=function(e){return!!~getIndex(this.__entries__,e)},class_1.prototype.clear=function(){this.__entries__.splice(0)},class_1.prototype.forEach=function(e,t){t===void 0&&(t=null);for(var r=0,n=this.__entries__;r<n.length;r++){var i=n[r];e.call(t,i[1],i[0])}},class_1}()}();var t=typeof window!='undefined'&&typeof document!='undefined'&&window.document===document;var r=_commonjsHelpers.commonjsGlobal!==void 0&&_commonjsHelpers.commonjsGlobal.Math===Math?_commonjsHelpers.commonjsGlobal:typeof self!='undefined'&&self.Math===Math?self:typeof window!='undefined'&&window.Math===Math?window:Function("","return this")();var n=typeof requestAnimationFrame=='function'?requestAnimationFrame.bind(r):e=>setTimeout((()=>e(Date.now())),1e3/60);var i=['top','right','bottom','left','width','height','size','weight'];var o=typeof MutationObserver!='undefined';var s=function(){function ResizeObserverController(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=((e,t)=>{var r=!1,i=!1,o=0;function resolvePending(){r&&(r=!1,e()),i&&proxy()}function timeoutCallback(){n(resolvePending)}function proxy(){var e=Date.now();if(r){if(e-o<2)return;i=!0}else r=!0,i=!1,setTimeout(timeoutCallback,t);o=e}return proxy})(this.refresh.bind(this),20)}return ResizeObserverController.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},ResizeObserverController.prototype.removeObserver=function(e){var t=this.observers_;var r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},ResizeObserverController.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},ResizeObserverController.prototype.updateObservers_=function(){var e=this.observers_.filter((e=>(e.gatherActive(),e.hasActive())));return e.forEach((e=>e.broadcastActive())),e.length>0},ResizeObserverController.prototype.connect_=function(){t&&!this.connected_&&(document.addEventListener('transitionend',this.onTransitionEnd_),window.addEventListener('resize',this.refresh),o?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener('DOMSubtreeModified',this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},ResizeObserverController.prototype.disconnect_=function(){t&&this.connected_&&(document.removeEventListener('transitionend',this.onTransitionEnd_),window.removeEventListener('resize',this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener('DOMSubtreeModified',this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},ResizeObserverController.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=t===void 0?'':t;i.some((e=>!!~r.indexOf(e)))&&this.refresh()},ResizeObserverController.getInstance=function(){return this.instance_||(this.instance_=new ResizeObserverController),this.instance_},ResizeObserverController.instance_=null,ResizeObserverController}();var defineConfigurable=(e,t)=>{for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e};var getWindowOf=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||r;var a=createRectInit(0,0,0,0);function toFloat(e){return parseFloat(e)||0}function getBordersSize(e){var t=[];for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce(((t,r)=>t+toFloat(e['border-'+r+'-width'])),0)}var c=typeof SVGGraphicsElement!='undefined'?e=>e instanceof getWindowOf(e).SVGGraphicsElement:e=>e instanceof getWindowOf(e).SVGElement&&typeof e.getBBox=='function';function getContentRect(e){return t?c(e)?(e=>{var t=e.getBBox();return createRectInit(0,0,t.width,t.height)})(e):function(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return a;var n=getWindowOf(e).getComputedStyle(e);var i=(e=>{var t={};for(var r=0,n=['top','right','bottom','left'];r<n.length;r++){var i=n[r];t[i]=toFloat(e['padding-'+i])}return t})(n);var o=i.left+i.right;var s=i.top+i.bottom;var c=toFloat(n.width),h=toFloat(n.height);if(n.boxSizing==='border-box'&&(Math.round(c+o)!==t&&(c-=getBordersSize(n,'left','right')+o),Math.round(h+s)!==r&&(h-=getBordersSize(n,'top','bottom')+s)),!(e=>e===getWindowOf(e).document.documentElement)(e)){var v=Math.round(c+o)-t;var u=Math.round(h+s)-r;Math.abs(v)!==1&&(c-=v),Math.abs(u)!==1&&(h-=u)}return createRectInit(i.left,i.top,c,h)}(e):a}function createRectInit(e,t,r,n){return{x:e,y:t,width:r,height:n}}var h=function(){function ResizeObservation(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=e}return ResizeObservation.prototype.isActive=function(){var e=getContentRect(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},ResizeObservation.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},ResizeObservation}();var ResizeObserverEntry=function(e,t){var r=(i=(n=t).x,o=n.y,s=n.width,a=n.height,c=typeof DOMRectReadOnly!='undefined'?DOMRectReadOnly:Object,h=Object.create(c.prototype),defineConfigurable(h,{x:i,y:o,width:s,height:a,top:o,right:i+s,bottom:a+o,left:i}),h);var n,i,o,s,a,c,h;defineConfigurable(this,{target:e,contentRect:r})};var v=function(){function ResizeObserverSPI(t,r,n){if(this.activeObservations_=[],this.observations_=new e,typeof t!='function')throw new TypeError('The callback provided as parameter 1 is not a function.');this.callback_=t,this.controller_=r,this.callbackCtx_=n}return ResizeObserverSPI.prototype.observe=function(e){if(!arguments.length)throw new TypeError('1 argument required, but only 0 present.');if(typeof Element!='undefined'&&Element instanceof Object){if(!(e instanceof getWindowOf(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new h(e)),this.controller_.addObserver(this),this.controller_.refresh())}},ResizeObserverSPI.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError('1 argument required, but only 0 present.');if(typeof Element!='undefined'&&Element instanceof Object){if(!(e instanceof getWindowOf(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},ResizeObserverSPI.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},ResizeObserverSPI.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((t=>{t.isActive()&&e.activeObservations_.push(t)}))},ResizeObserverSPI.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_;var t=this.activeObservations_.map((e=>new ResizeObserverEntry(e.target,e.broadcastRect())));this.callback_.call(e,t,e),this.clearActive()}},ResizeObserverSPI.prototype.clearActive=function(){this.activeObservations_.splice(0)},ResizeObserverSPI.prototype.hasActive=function(){return this.activeObservations_.length>0},ResizeObserverSPI}();var u=typeof WeakMap!='undefined'?new WeakMap:new e;var l=function ResizeObserver(e){if(!(this instanceof ResizeObserver))throw new TypeError('Cannot call a class as a function.');if(!arguments.length)throw new TypeError('1 argument required, but only 0 present.');var t=s.getInstance();var r=new v(e,t,this);u.set(this,r)};return['observe','unobserve','disconnect'].forEach((function(e){l.prototype[e]=function(){var t;return(t=u.get(this))[e].apply(t,arguments)}})),r.ResizeObserver!==void 0?r.ResizeObserver:l}(),exports.default=_commonjsHelpers.getDefaultExportFromCjs(ResizeObserver$1.__module.exports);
|
|
2
|
+
//# sourceMappingURL=ResizeObserver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResizeObserver.js","sources":["../../../../../../../../node_modules/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.js"],"sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.ResizeObserver = factory());\n}(this, (function () { 'use strict';\n\n /**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\r\n /* eslint-disable require-jsdoc, valid-jsdoc */\r\n var MapShim = (function () {\r\n if (typeof Map !== 'undefined') {\r\n return Map;\r\n }\r\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array<Array>} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\r\n function getIndex(arr, key) {\r\n var result = -1;\r\n arr.some(function (entry, index) {\r\n if (entry[0] === key) {\r\n result = index;\r\n return true;\r\n }\r\n return false;\r\n });\r\n return result;\r\n }\r\n return /** @class */ (function () {\r\n function class_1() {\r\n this.__entries__ = [];\r\n }\r\n Object.defineProperty(class_1.prototype, \"size\", {\r\n /**\r\n * @returns {boolean}\r\n */\r\n get: function () {\r\n return this.__entries__.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\r\n class_1.prototype.get = function (key) {\r\n var index = getIndex(this.__entries__, key);\r\n var entry = this.__entries__[index];\r\n return entry && entry[1];\r\n };\r\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\r\n class_1.prototype.set = function (key, value) {\r\n var index = getIndex(this.__entries__, key);\r\n if (~index) {\r\n this.__entries__[index][1] = value;\r\n }\r\n else {\r\n this.__entries__.push([key, value]);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.delete = function (key) {\r\n var entries = this.__entries__;\r\n var index = getIndex(entries, key);\r\n if (~index) {\r\n entries.splice(index, 1);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.has = function (key) {\r\n return !!~getIndex(this.__entries__, key);\r\n };\r\n /**\r\n * @returns {void}\r\n */\r\n class_1.prototype.clear = function () {\r\n this.__entries__.splice(0);\r\n };\r\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\r\n class_1.prototype.forEach = function (callback, ctx) {\r\n if (ctx === void 0) { ctx = null; }\r\n for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n callback.call(ctx, entry[1], entry[0]);\r\n }\r\n };\r\n return class_1;\r\n }());\r\n })();\n\n /**\r\n * Detects whether window and document objects are available in current environment.\r\n */\r\n var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\n\n // Returns global object of a current environment.\r\n var global$1 = (function () {\r\n if (typeof global !== 'undefined' && global.Math === Math) {\r\n return global;\r\n }\r\n if (typeof self !== 'undefined' && self.Math === Math) {\r\n return self;\r\n }\r\n if (typeof window !== 'undefined' && window.Math === Math) {\r\n return window;\r\n }\r\n // eslint-disable-next-line no-new-func\r\n return Function('return this')();\r\n })();\n\n /**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\r\n var requestAnimationFrame$1 = (function () {\r\n if (typeof requestAnimationFrame === 'function') {\r\n // It's required to use a bounded function because IE sometimes throws\r\n // an \"Invalid calling object\" error if rAF is invoked without the global\r\n // object on the left hand side.\r\n return requestAnimationFrame.bind(global$1);\r\n }\r\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\r\n })();\n\n // Defines minimum timeout before adding a trailing call.\r\n var trailingTimeout = 2;\r\n /**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\r\n function throttle (callback, delay) {\r\n var leadingCall = false, trailingCall = false, lastCallTime = 0;\r\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\r\n function resolvePending() {\r\n if (leadingCall) {\r\n leadingCall = false;\r\n callback();\r\n }\r\n if (trailingCall) {\r\n proxy();\r\n }\r\n }\r\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\r\n function timeoutCallback() {\r\n requestAnimationFrame$1(resolvePending);\r\n }\r\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\r\n function proxy() {\r\n var timeStamp = Date.now();\r\n if (leadingCall) {\r\n // Reject immediately following calls.\r\n if (timeStamp - lastCallTime < trailingTimeout) {\r\n return;\r\n }\r\n // Schedule new call to be in invoked when the pending one is resolved.\r\n // This is important for \"transitions\" which never actually start\r\n // immediately so there is a chance that we might miss one if change\r\n // happens amids the pending invocation.\r\n trailingCall = true;\r\n }\r\n else {\r\n leadingCall = true;\r\n trailingCall = false;\r\n setTimeout(timeoutCallback, delay);\r\n }\r\n lastCallTime = timeStamp;\r\n }\r\n return proxy;\r\n }\n\n // Minimum delay before invoking the update of observers.\r\n var REFRESH_DELAY = 20;\r\n // A list of substrings of CSS properties used to find transition events that\r\n // might affect dimensions of observed elements.\r\n var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\r\n // Check if MutationObserver is available.\r\n var mutationObserverSupported = typeof MutationObserver !== 'undefined';\r\n /**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\r\n var ResizeObserverController = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserverController.\r\n *\r\n * @private\r\n */\r\n function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }\r\n /**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.addObserver = function (observer) {\r\n if (!~this.observers_.indexOf(observer)) {\r\n this.observers_.push(observer);\r\n }\r\n // Add listeners if they haven't been added yet.\r\n if (!this.connected_) {\r\n this.connect_();\r\n }\r\n };\r\n /**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.removeObserver = function (observer) {\r\n var observers = this.observers_;\r\n var index = observers.indexOf(observer);\r\n // Remove observer if it's present in registry.\r\n if (~index) {\r\n observers.splice(index, 1);\r\n }\r\n // Remove listeners if controller has no connected observers.\r\n if (!observers.length && this.connected_) {\r\n this.disconnect_();\r\n }\r\n };\r\n /**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.refresh = function () {\r\n var changesDetected = this.updateObservers_();\r\n // Continue running updates if changes have been detected as there might\r\n // be future ones caused by CSS transitions.\r\n if (changesDetected) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\r\n ResizeObserverController.prototype.updateObservers_ = function () {\r\n // Collect observers that have active observations.\r\n var activeObservers = this.observers_.filter(function (observer) {\r\n return observer.gatherActive(), observer.hasActive();\r\n });\r\n // Deliver notifications in a separate cycle in order to avoid any\r\n // collisions between observers, e.g. when multiple instances of\r\n // ResizeObserver are tracking the same element and the callback of one\r\n // of them changes content dimensions of the observed target. Sometimes\r\n // this may result in notifications being blocked for the rest of observers.\r\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\r\n return activeObservers.length > 0;\r\n };\r\n /**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.connect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already added.\r\n if (!isBrowser || this.connected_) {\r\n return;\r\n }\r\n // Subscription to the \"Transitionend\" event is used as a workaround for\r\n // delayed transitions. This way it's possible to capture at least the\r\n // final state of an element.\r\n document.addEventListener('transitionend', this.onTransitionEnd_);\r\n window.addEventListener('resize', this.refresh);\r\n if (mutationObserverSupported) {\r\n this.mutationsObserver_ = new MutationObserver(this.refresh);\r\n this.mutationsObserver_.observe(document, {\r\n attributes: true,\r\n childList: true,\r\n characterData: true,\r\n subtree: true\r\n });\r\n }\r\n else {\r\n document.addEventListener('DOMSubtreeModified', this.refresh);\r\n this.mutationEventsAdded_ = true;\r\n }\r\n this.connected_ = true;\r\n };\r\n /**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.disconnect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already removed.\r\n if (!isBrowser || !this.connected_) {\r\n return;\r\n }\r\n document.removeEventListener('transitionend', this.onTransitionEnd_);\r\n window.removeEventListener('resize', this.refresh);\r\n if (this.mutationsObserver_) {\r\n this.mutationsObserver_.disconnect();\r\n }\r\n if (this.mutationEventsAdded_) {\r\n document.removeEventListener('DOMSubtreeModified', this.refresh);\r\n }\r\n this.mutationsObserver_ = null;\r\n this.mutationEventsAdded_ = false;\r\n this.connected_ = false;\r\n };\r\n /**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {\r\n var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;\r\n // Detect whether transition may affect dimensions of an element.\r\n var isReflowProperty = transitionKeys.some(function (key) {\r\n return !!~propertyName.indexOf(key);\r\n });\r\n if (isReflowProperty) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\r\n ResizeObserverController.getInstance = function () {\r\n if (!this.instance_) {\r\n this.instance_ = new ResizeObserverController();\r\n }\r\n return this.instance_;\r\n };\r\n /**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\r\n ResizeObserverController.instance_ = null;\r\n return ResizeObserverController;\r\n }());\n\n /**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\r\n var defineConfigurable = (function (target, props) {\r\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n Object.defineProperty(target, key, {\r\n value: props[key],\r\n enumerable: false,\r\n writable: false,\r\n configurable: true\r\n });\r\n }\r\n return target;\r\n });\n\n /**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\r\n var getWindowOf = (function (target) {\r\n // Assume that the element is an instance of Node, which means that it\r\n // has the \"ownerDocument\" property from which we can retrieve a\r\n // corresponding global object.\r\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\r\n // Return the local global object if it's not possible extract one from\r\n // provided element.\r\n return ownerGlobal || global$1;\r\n });\n\n // Placeholder of an empty content rectangle.\r\n var emptyRect = createRectInit(0, 0, 0, 0);\r\n /**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\r\n function toFloat(value) {\r\n return parseFloat(value) || 0;\r\n }\r\n /**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\r\n function getBordersSize(styles) {\r\n var positions = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n positions[_i - 1] = arguments[_i];\r\n }\r\n return positions.reduce(function (size, position) {\r\n var value = styles['border-' + position + '-width'];\r\n return size + toFloat(value);\r\n }, 0);\r\n }\r\n /**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\r\n function getPaddings(styles) {\r\n var positions = ['top', 'right', 'bottom', 'left'];\r\n var paddings = {};\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n var value = styles['padding-' + position];\r\n paddings[position] = toFloat(value);\r\n }\r\n return paddings;\r\n }\r\n /**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\n function getSVGContentRect(target) {\r\n var bbox = target.getBBox();\r\n return createRectInit(0, 0, bbox.width, bbox.height);\r\n }\r\n /**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\r\n function getHTMLElementContentRect(target) {\r\n // Client width & height properties can't be\r\n // used exclusively as they provide rounded values.\r\n var clientWidth = target.clientWidth, clientHeight = target.clientHeight;\r\n // By this condition we can catch all non-replaced inline, hidden and\r\n // detached elements. Though elements with width & height properties less\r\n // than 0.5 will be discarded as well.\r\n //\r\n // Without it we would need to implement separate methods for each of\r\n // those cases and it's not possible to perform a precise and performance\r\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\r\n // gives wrong results for elements with width & height less than 0.5.\r\n if (!clientWidth && !clientHeight) {\r\n return emptyRect;\r\n }\r\n var styles = getWindowOf(target).getComputedStyle(target);\r\n var paddings = getPaddings(styles);\r\n var horizPad = paddings.left + paddings.right;\r\n var vertPad = paddings.top + paddings.bottom;\r\n // Computed styles of width & height are being used because they are the\r\n // only dimensions available to JS that contain non-rounded values. It could\r\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\r\n // affected by CSS transformations let alone paddings, borders and scroll bars.\r\n var width = toFloat(styles.width), height = toFloat(styles.height);\r\n // Width & height include paddings and borders when the 'border-box' box\r\n // model is applied (except for IE).\r\n if (styles.boxSizing === 'border-box') {\r\n // Following conditions are required to handle Internet Explorer which\r\n // doesn't include paddings and borders to computed CSS dimensions.\r\n //\r\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\r\n // properties then it's either IE, and thus we don't need to subtract\r\n // anything, or an element merely doesn't have paddings/borders styles.\r\n if (Math.round(width + horizPad) !== clientWidth) {\r\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\r\n }\r\n if (Math.round(height + vertPad) !== clientHeight) {\r\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\r\n }\r\n }\r\n // Following steps can't be applied to the document's root element as its\r\n // client[Width/Height] properties represent viewport area of the window.\r\n // Besides, it's as well not necessary as the <html> itself neither has\r\n // rendered scroll bars nor it can be clipped.\r\n if (!isDocumentElement(target)) {\r\n // In some browsers (only in Firefox, actually) CSS width & height\r\n // include scroll bars size which can be removed at this step as scroll\r\n // bars are the only difference between rounded dimensions + paddings\r\n // and \"client\" properties, though that is not always true in Chrome.\r\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\r\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\r\n // Chrome has a rather weird rounding of \"client\" properties.\r\n // E.g. for an element with content width of 314.2px it sometimes gives\r\n // the client width of 315px and for the width of 314.7px it may give\r\n // 314px. And it doesn't happen all the time. So just ignore this delta\r\n // as a non-relevant.\r\n if (Math.abs(vertScrollbar) !== 1) {\r\n width -= vertScrollbar;\r\n }\r\n if (Math.abs(horizScrollbar) !== 1) {\r\n height -= horizScrollbar;\r\n }\r\n }\r\n return createRectInit(paddings.left, paddings.top, width, height);\r\n }\r\n /**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\n var isSVGGraphicsElement = (function () {\r\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\r\n // interface.\r\n if (typeof SVGGraphicsElement !== 'undefined') {\r\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\r\n }\r\n // If it's so, then check that element is at least an instance of the\r\n // SVGElement and that it has the \"getBBox\" method.\r\n // eslint-disable-next-line no-extra-parens\r\n return function (target) { return (target instanceof getWindowOf(target).SVGElement &&\r\n typeof target.getBBox === 'function'); };\r\n })();\r\n /**\r\n * Checks whether provided element is a document element (<html>).\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\n function isDocumentElement(target) {\r\n return target === getWindowOf(target).document.documentElement;\r\n }\r\n /**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\n function getContentRect(target) {\r\n if (!isBrowser) {\r\n return emptyRect;\r\n }\r\n if (isSVGGraphicsElement(target)) {\r\n return getSVGContentRect(target);\r\n }\r\n return getHTMLElementContentRect(target);\r\n }\r\n /**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\r\n function createReadOnlyRect(_a) {\r\n var x = _a.x, y = _a.y, width = _a.width, height = _a.height;\r\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\r\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\r\n var rect = Object.create(Constr.prototype);\r\n // Rectangle's properties are not writable and non-enumerable.\r\n defineConfigurable(rect, {\r\n x: x, y: y, width: width, height: height,\r\n top: y,\r\n right: x + width,\r\n bottom: height + y,\r\n left: x\r\n });\r\n return rect;\r\n }\r\n /**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\r\n function createRectInit(x, y, width, height) {\r\n return { x: x, y: y, width: width, height: height };\r\n }\n\n /**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\r\n var ResizeObservation = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObservation.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n */\r\n function ResizeObservation(target) {\r\n /**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastWidth = 0;\r\n /**\r\n * Broadcasted height of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastHeight = 0;\r\n /**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\r\n this.contentRect_ = createRectInit(0, 0, 0, 0);\r\n this.target = target;\r\n }\r\n /**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObservation.prototype.isActive = function () {\r\n var rect = getContentRect(this.target);\r\n this.contentRect_ = rect;\r\n return (rect.width !== this.broadcastWidth ||\r\n rect.height !== this.broadcastHeight);\r\n };\r\n /**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\r\n ResizeObservation.prototype.broadcastRect = function () {\r\n var rect = this.contentRect_;\r\n this.broadcastWidth = rect.width;\r\n this.broadcastHeight = rect.height;\r\n return rect;\r\n };\r\n return ResizeObservation;\r\n }());\n\n var ResizeObserverEntry = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObserverEntry.\r\n *\r\n * @param {Element} target - Element that is being observed.\r\n * @param {DOMRectInit} rectInit - Data of the element's content rectangle.\r\n */\r\n function ResizeObserverEntry(target, rectInit) {\r\n var contentRect = createReadOnlyRect(rectInit);\r\n // According to the specification following properties are not writable\r\n // and are also not enumerable in the native implementation.\r\n //\r\n // Property accessors are not being used as they'd require to define a\r\n // private WeakMap storage which may cause memory leaks in browsers that\r\n // don't support this type of collections.\r\n defineConfigurable(this, { target: target, contentRect: contentRect });\r\n }\r\n return ResizeObserverEntry;\r\n }());\n\n var ResizeObserverSPI = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback function that is invoked\r\n * when one of the observed elements changes it's content dimensions.\r\n * @param {ResizeObserverController} controller - Controller instance which\r\n * is responsible for the updates of observer.\r\n * @param {ResizeObserver} callbackCtx - Reference to the public\r\n * ResizeObserver instance which will be passed to callback function.\r\n */\r\n function ResizeObserverSPI(callback, controller, callbackCtx) {\r\n /**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array<ResizeObservation>}\r\n */\r\n this.activeObservations_ = [];\r\n /**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map<Element, ResizeObservation>}\r\n */\r\n this.observations_ = new MapShim();\r\n if (typeof callback !== 'function') {\r\n throw new TypeError('The callback provided as parameter 1 is not a function.');\r\n }\r\n this.callback_ = callback;\r\n this.controller_ = controller;\r\n this.callbackCtx_ = callbackCtx;\r\n }\r\n /**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.observe = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is already being observed.\r\n if (observations.has(target)) {\r\n return;\r\n }\r\n observations.set(target, new ResizeObservation(target));\r\n this.controller_.addObserver(this);\r\n // Force the update of observations.\r\n this.controller_.refresh();\r\n };\r\n /**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.unobserve = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is not being observed.\r\n if (!observations.has(target)) {\r\n return;\r\n }\r\n observations.delete(target);\r\n if (!observations.size) {\r\n this.controller_.removeObserver(this);\r\n }\r\n };\r\n /**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.disconnect = function () {\r\n this.clearActive();\r\n this.observations_.clear();\r\n this.controller_.removeObserver(this);\r\n };\r\n /**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.gatherActive = function () {\r\n var _this = this;\r\n this.clearActive();\r\n this.observations_.forEach(function (observation) {\r\n if (observation.isActive()) {\r\n _this.activeObservations_.push(observation);\r\n }\r\n });\r\n };\r\n /**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.broadcastActive = function () {\r\n // Do nothing if observer doesn't have active observations.\r\n if (!this.hasActive()) {\r\n return;\r\n }\r\n var ctx = this.callbackCtx_;\r\n // Create ResizeObserverEntry instance for every active observation.\r\n var entries = this.activeObservations_.map(function (observation) {\r\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\r\n });\r\n this.callback_.call(ctx, entries, ctx);\r\n this.clearActive();\r\n };\r\n /**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.clearActive = function () {\r\n this.activeObservations_.splice(0);\r\n };\r\n /**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObserverSPI.prototype.hasActive = function () {\r\n return this.activeObservations_.length > 0;\r\n };\r\n return ResizeObserverSPI;\r\n }());\n\n // Registry of internal observers. If WeakMap is not available use current shim\r\n // for the Map collection as it has all required methods and because WeakMap\r\n // can't be fully polyfilled anyway.\r\n var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\r\n /**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\r\n var ResizeObserver = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback that is invoked when\r\n * dimensions of the observed elements change.\r\n */\r\n function ResizeObserver(callback) {\r\n if (!(this instanceof ResizeObserver)) {\r\n throw new TypeError('Cannot call a class as a function.');\r\n }\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n var controller = ResizeObserverController.getInstance();\r\n var observer = new ResizeObserverSPI(callback, controller, this);\r\n observers.set(this, observer);\r\n }\r\n return ResizeObserver;\r\n }());\r\n // Expose public methods of ResizeObserver.\r\n [\r\n 'observe',\r\n 'unobserve',\r\n 'disconnect'\r\n ].forEach(function (method) {\r\n ResizeObserver.prototype[method] = function () {\r\n var _a;\r\n return (_a = observers.get(this))[method].apply(_a, arguments);\r\n };\r\n });\n\n var index = (function () {\r\n // Export existing implementation if available.\r\n if (typeof global$1.ResizeObserver !== 'undefined') {\r\n return global$1.ResizeObserver;\r\n }\r\n return ResizeObserver;\r\n })();\n\n return index;\n\n})));\n"],"names":["exports","MapShim","Map","getIndex","arr","key","result","some","entry","index","class_1","this","__entries__","Object","defineProperty","prototype","get","length","enumerable","configurable","set","value","push","delete","entries","splice","has","clear","forEach","callback","ctx","_i","_a","call","isBrowser","window","document","global$1","global","Math","self","Function","requestAnimationFrame$1","requestAnimationFrame","bind","setTimeout","Date","now","transitionKeys","mutationObserverSupported","MutationObserver","ResizeObserverController","connected_","mutationEventsAdded_","mutationsObserver_","observers_","onTransitionEnd_","refresh","delay","leadingCall","trailingCall","lastCallTime","resolvePending","proxy","timeoutCallback","timeStamp","throttle","addObserver","observer","indexOf","connect_","removeObserver","observers","disconnect_","updateObservers_","activeObservers","filter","gatherActive","hasActive","broadcastActive","addEventListener","observe","attributes","childList","characterData","subtree","removeEventListener","disconnect","_b","propertyName","getInstance","instance_","defineConfigurable","target","props","keys","writable","getWindowOf","ownerDocument","defaultView","emptyRect","createRectInit","toFloat","parseFloat","getBordersSize","styles","positions","arguments","reduce","size","position","isSVGGraphicsElement","SVGGraphicsElement","SVGElement","getBBox","getContentRect","bbox","width","height","getSVGContentRect","clientWidth","clientHeight","getComputedStyle","paddings","positions_1","getPaddings","horizPad","left","right","vertPad","top","bottom","boxSizing","round","documentElement","isDocumentElement","vertScrollbar","horizScrollbar","abs","getHTMLElementContentRect","x","y","ResizeObservation","broadcastWidth","broadcastHeight","contentRect_","isActive","rect","broadcastRect","ResizeObserverEntry","rectInit","contentRect","Constr","DOMRectReadOnly","create","ResizeObserverSPI","controller","callbackCtx","activeObservations_","observations_","TypeError","callback_","controller_","callbackCtx_","Element","observations","unobserve","clearActive","_this","observation","map","WeakMap","ResizeObserver","method","apply","factory"],"mappings":"0PACoFA,QAG3E,WASL,IAAIC,EAAU,WACV,UAAWC,KAAQ,YACf,OAAOA,IASX,SAASC,SAASC,EAAKC,GACnB,IAAIC,GAAU,EAQd,OAPAF,EAAIG,MAAK,CAAUC,EAAOC,IAClBD,EAAM,KAAOH,IACbC,EAASG,GACF,KAIRH,CACV,CACD,OAAsB,WAClB,SAASI,UACLC,KAAKC,YAAc,EACtB,CAsED,OArEAC,OAAOC,eAAeJ,QAAQK,UAAW,OAAQ,CAI7CC,IAAK,WACD,OAAOL,KAAKC,YAAYK,MAC3B,EACDC,YAAY,EACZC,cAAc,IAMlBT,QAAQK,UAAUC,IAAM,SAAUX,GAC9B,IAAII,EAAQN,SAASQ,KAAKC,YAAaP,GACvC,IAAIG,EAAQG,KAAKC,YAAYH,GAC7B,OAAOD,GAASA,EAAM,EACtC,EAMYE,QAAQK,UAAUK,IAAM,SAAUf,EAAKgB,GACnC,IAAIZ,EAAQN,SAASQ,KAAKC,YAAaP,IAClCI,EACDE,KAAKC,YAAYH,GAAO,GAAKY,EAG7BV,KAAKC,YAAYU,KAAK,CAACjB,EAAKgB,GAEhD,EAKYX,QAAQK,UAAUQ,OAAS,SAAUlB,GACjC,IAAImB,EAAUb,KAAKC,YACnB,IAAIH,EAAQN,SAASqB,EAASnB,IACzBI,GACDe,EAAQC,OAAOhB,EAAO,EAE1C,EAKYC,QAAQK,UAAUW,IAAM,SAAUrB,GAC9B,SAAUF,SAASQ,KAAKC,YAAaP,EACrD,EAIYK,QAAQK,UAAUY,MAAQ,WACtBhB,KAAKC,YAAYa,OAAO,EACxC,EAMYf,QAAQK,UAAUa,QAAU,SAAUC,EAAUC,GACxCA,SAAQ,IAAUA,EAAM,MAC5B,IAAK,IAAIC,EAAK,EAAGC,EAAKrB,KAAKC,YAAamB,EAAKC,EAAGf,OAAQc,IAAM,CAC1D,IAAIvB,EAAQwB,EAA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1,2 @@
|
|
|
1
|
+
import{commonjsGlobal,getDefaultExportFromCjs}from'../../../../../../_virtual/_commonjsHelpers.mjs';import{__module as ResizeObserver$1}from'../../../../../../_virtual/ResizeObserver.mjs';ResizeObserver$1.exports=function(){var e=function(){if(typeof Map!='undefined')return Map;function getIndex(e,t){var r=-1;return e.some(((e,n)=>e[0]===t&&(r=n,!0))),r}return function(){function class_1(){this.__entries__=[]}return Object.defineProperty(class_1.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),class_1.prototype.get=function(e){var t=getIndex(this.__entries__,e);var r=this.__entries__[t];return r&&r[1]},class_1.prototype.set=function(e,t){var r=getIndex(this.__entries__,e);~r?this.__entries__[r][1]=t:this.__entries__.push([e,t])},class_1.prototype.delete=function(e){var t=this.__entries__;var r=getIndex(t,e);~r&&t.splice(r,1)},class_1.prototype.has=function(e){return!!~getIndex(this.__entries__,e)},class_1.prototype.clear=function(){this.__entries__.splice(0)},class_1.prototype.forEach=function(e,t){t===void 0&&(t=null);for(var r=0,n=this.__entries__;r<n.length;r++){var i=n[r];e.call(t,i[1],i[0])}},class_1}()}();var t=typeof window!='undefined'&&typeof document!='undefined'&&window.document===document;var r=commonjsGlobal!==void 0&&commonjsGlobal.Math===Math?commonjsGlobal:typeof self!='undefined'&&self.Math===Math?self:typeof window!='undefined'&&window.Math===Math?window:Function("","return this")();var n=typeof requestAnimationFrame=='function'?requestAnimationFrame.bind(r):e=>setTimeout((()=>e(Date.now())),1e3/60);var i=['top','right','bottom','left','width','height','size','weight'];var o=typeof MutationObserver!='undefined';var s=function(){function ResizeObserverController(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=((e,t)=>{var r=!1,i=!1,o=0;function resolvePending(){r&&(r=!1,e()),i&&proxy()}function timeoutCallback(){n(resolvePending)}function proxy(){var e=Date.now();if(r){if(e-o<2)return;i=!0}else r=!0,i=!1,setTimeout(timeoutCallback,t);o=e}return proxy})(this.refresh.bind(this),20)}return ResizeObserverController.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},ResizeObserverController.prototype.removeObserver=function(e){var t=this.observers_;var r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},ResizeObserverController.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},ResizeObserverController.prototype.updateObservers_=function(){var e=this.observers_.filter((e=>(e.gatherActive(),e.hasActive())));return e.forEach((e=>e.broadcastActive())),e.length>0},ResizeObserverController.prototype.connect_=function(){t&&!this.connected_&&(document.addEventListener('transitionend',this.onTransitionEnd_),window.addEventListener('resize',this.refresh),o?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener('DOMSubtreeModified',this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},ResizeObserverController.prototype.disconnect_=function(){t&&this.connected_&&(document.removeEventListener('transitionend',this.onTransitionEnd_),window.removeEventListener('resize',this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener('DOMSubtreeModified',this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},ResizeObserverController.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=t===void 0?'':t;i.some((e=>!!~r.indexOf(e)))&&this.refresh()},ResizeObserverController.getInstance=function(){return this.instance_||(this.instance_=new ResizeObserverController),this.instance_},ResizeObserverController.instance_=null,ResizeObserverController}();var defineConfigurable=(e,t)=>{for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e};var getWindowOf=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||r;var a=createRectInit(0,0,0,0);function toFloat(e){return parseFloat(e)||0}function getBordersSize(e){var t=[];for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce(((t,r)=>t+toFloat(e['border-'+r+'-width'])),0)}var c=typeof SVGGraphicsElement!='undefined'?e=>e instanceof getWindowOf(e).SVGGraphicsElement:e=>e instanceof getWindowOf(e).SVGElement&&typeof e.getBBox=='function';function getContentRect(e){return t?c(e)?(e=>{var t=e.getBBox();return createRectInit(0,0,t.width,t.height)})(e):function(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return a;var n=getWindowOf(e).getComputedStyle(e);var i=(e=>{var t={};for(var r=0,n=['top','right','bottom','left'];r<n.length;r++){var i=n[r];t[i]=toFloat(e['padding-'+i])}return t})(n);var o=i.left+i.right;var s=i.top+i.bottom;var c=toFloat(n.width),h=toFloat(n.height);if(n.boxSizing==='border-box'&&(Math.round(c+o)!==t&&(c-=getBordersSize(n,'left','right')+o),Math.round(h+s)!==r&&(h-=getBordersSize(n,'top','bottom')+s)),!(e=>e===getWindowOf(e).document.documentElement)(e)){var v=Math.round(c+o)-t;var u=Math.round(h+s)-r;Math.abs(v)!==1&&(c-=v),Math.abs(u)!==1&&(h-=u)}return createRectInit(i.left,i.top,c,h)}(e):a}function createRectInit(e,t,r,n){return{x:e,y:t,width:r,height:n}}var h=function(){function ResizeObservation(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=e}return ResizeObservation.prototype.isActive=function(){var e=getContentRect(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},ResizeObservation.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},ResizeObservation}();var ResizeObserverEntry=function(e,t){var r=(i=(n=t).x,o=n.y,s=n.width,a=n.height,c=typeof DOMRectReadOnly!='undefined'?DOMRectReadOnly:Object,h=Object.create(c.prototype),defineConfigurable(h,{x:i,y:o,width:s,height:a,top:o,right:i+s,bottom:a+o,left:i}),h);var n,i,o,s,a,c,h;defineConfigurable(this,{target:e,contentRect:r})};var v=function(){function ResizeObserverSPI(t,r,n){if(this.activeObservations_=[],this.observations_=new e,typeof t!='function')throw new TypeError('The callback provided as parameter 1 is not a function.');this.callback_=t,this.controller_=r,this.callbackCtx_=n}return ResizeObserverSPI.prototype.observe=function(e){if(!arguments.length)throw new TypeError('1 argument required, but only 0 present.');if(typeof Element!='undefined'&&Element instanceof Object){if(!(e instanceof getWindowOf(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new h(e)),this.controller_.addObserver(this),this.controller_.refresh())}},ResizeObserverSPI.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError('1 argument required, but only 0 present.');if(typeof Element!='undefined'&&Element instanceof Object){if(!(e instanceof getWindowOf(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},ResizeObserverSPI.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},ResizeObserverSPI.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((t=>{t.isActive()&&e.activeObservations_.push(t)}))},ResizeObserverSPI.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_;var t=this.activeObservations_.map((e=>new ResizeObserverEntry(e.target,e.broadcastRect())));this.callback_.call(e,t,e),this.clearActive()}},ResizeObserverSPI.prototype.clearActive=function(){this.activeObservations_.splice(0)},ResizeObserverSPI.prototype.hasActive=function(){return this.activeObservations_.length>0},ResizeObserverSPI}();var u=typeof WeakMap!='undefined'?new WeakMap:new e;var l=function ResizeObserver(e){if(!(this instanceof ResizeObserver))throw new TypeError('Cannot call a class as a function.');if(!arguments.length)throw new TypeError('1 argument required, but only 0 present.');var t=s.getInstance();var r=new v(e,t,this);u.set(this,r)};return['observe','unobserve','disconnect'].forEach((function(e){l.prototype[e]=function(){var t;return(t=u.get(this))[e].apply(t,arguments)}})),r.ResizeObserver!==void 0?r.ResizeObserver:l}();var ResizeObserver=getDefaultExportFromCjs(ResizeObserver$1.exports);export{ResizeObserver as default};
|
|
2
|
+
//# sourceMappingURL=ResizeObserver.mjs.map
|