@foxford/ui 2.15.1 → 2.16.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/components/Amount/Amount.js.map +1 -1
- package/components/ArrowBadge/ArrowBadge.js.map +1 -1
- package/components/ArrowBadge/style.js +1 -1
- package/components/ArrowBadge/style.js.map +1 -1
- package/components/Badge/Badge.js +1 -1
- package/components/Badge/Badge.js.map +1 -1
- package/components/Badge/constants.js +2 -0
- package/components/Badge/constants.js.map +1 -0
- package/components/Badge/style.js +1 -1
- package/components/Badge/style.js.map +1 -1
- package/components/Button/Button.js +1 -1
- package/components/Button/Button.js.map +1 -1
- package/components/Tab/Tab.js.map +1 -1
- package/components/Tab/style.js +1 -1
- package/components/Tab/style.js.map +1 -1
- package/components/Tag/Tag.js.map +1 -1
- package/components/Tag/style.js.map +1 -1
- package/components/Text/Text.js +1 -1
- package/components/Text/Text.js.map +1 -1
- package/components/Text/constants.js +1 -1
- package/components/Text/constants.js.map +1 -1
- package/components/Text/style.js +1 -1
- package/components/Text/style.js.map +1 -1
- package/components/Text.Ellipse/Text.Ellipse.js.map +1 -1
- package/dts/index.d.ts +151 -115
- package/index.cjs.js +1 -1
- package/index.cjs.js.map +1 -1
- package/mixins/size.js +1 -1
- package/mixins/size.js.map +1 -1
- package/package.json +1 -1
- package/shared/utils/style.js +1 -1
- package/shared/utils/style.js.map +1 -1
- package/theme/colors-dark.js +1 -1
- package/theme/colors-dark.js.map +1 -1
- package/theme/colors-light.js +1 -1
- package/theme/colors-light.js.map +1 -1
- package/theme/colors.js +1 -1
- package/theme/colors.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport {
|
|
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, SIZES_DEFAULT } from './constants'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Text'\n\n/**\n *\n * Component interface extends:\n * - [`ResponsiveSizeProps`](#/Interfaces)\n * - [`ResponsiveMarginProps`](#/Interfaces)\n * - [`BaseProps`](#/Interfaces)\n * - [`React.ComponentPropsWithRef<'div'>`](#/Interfaces)\n */\nconst Text: React.ForwardRefExoticComponent<TextProps> & { Heading: typeof TextHeading; Ellipse: typeof TextEllipse } =\n Object.assign(\n withMergedProps<TextProps, HTMLDivElement>(\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 ...restProps\n } = textProps\n\n const textClassName = useClassname(COMPONENT_NAME, className)\n\n if (children) {\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 {children}\n </Styled.Root>\n )\n }\n\n return (\n <Styled.Root\n {...restProps}\n size={size}\n weight={weight}\n lineHeight={lineHeight}\n fontStyle={fontStyle}\n className={textClassName}\n dangerouslySetInnerHTML={{ __html: content || '' }}\n ref={ref}\n />\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","restProps","_excluded","textClassName","useClassname","_jsx","Styled.Root","dangerouslySetInnerHTML","__html","displayName","sizes","_SIZES$props$appearan","SIZES","SIZES_DEFAULT","Heading","TextHeading","Ellipse","TextEllipse"],"mappings":"knBASMA,IAAAA,EAAiB,OAUvB,IAAMC,EACJC,OAAOC,OACLC,EACEC,GAAAA,CAAYC,EAAOC,KACjB,IAAMC,EAAYF,EAAMG,WAAkBC,EAAAA,EAAAA,GAAAA,EAAWJ,EAAMG,aAAgBH,GAAUA,EAErF,IAAMK,KACJA,EAAO,IADHC,OAEJA,EAAS,SAFLC,WAGJA,EAAa,IAHTC,UAIJA,EAAY,SAJRC,UAKJA,EALIC,QAMJA,EANIC,SAOJA,GAEET,EADCU,IACDV,EATJW,GAWA,IAAMC,EAAgBC,EA3BP,OA2BoCN,GAEnD,OAEIO,EAACC,SACKL,GADN,GAFAD,EAEA,CAEEN,KAAMA,EACNC,OAAQA,EACRC,WAAYA,EACZC,UAAWA,EACXC,UAAWK,EACXb,IAAKA,EAPPU,SASGA,GAML,CAEEN,KAAMA,EACNC,OAAQA,EACRC,WAAYA,EACZC,UAAWA,EACXC,UAAWK,EACXI,wBAAyB,CAAEC,OAAQT,GAAW,IAC9CT,IAAKA,QAIX,CACEmB,YA3De,OA4DfC,MAAQrB,IACoC,IAAAsB,EAA1C,MAAgC,iBAArBtB,EAAMG,oBACfmB,EAAOC,EAAMvB,EAAMG,2BAGdqB,KAIb,CACEC,QAASC,EACTC,QAASC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e={display:{lineHeight:1,weight:800,fontStyle:'normal'},heading:{lineHeight:1.1,weight:800,fontStyle:'normal'},subheading:{lineHeight:1.1,weight:700,fontStyle:'normal'},'subheading-compact':{lineHeight:1.3,weight:800,fontStyle:'normal'},body:{lineHeight:1.3,weight:400,fontStyle:'normal'},caption:{lineHeight:1.2,weight:400,fontStyle:'normal'}};var t={display:{xxxl:{fontSize:84},xxl:{fontSize:76},xl:{fontSize:68},l:{fontSize:60},m:{fontSize:52},s:{fontSize:44},xs:{fontSize:36},xxs:{fontSize:28},xxxs:{fontSize:20}},heading:{xxxl:{fontSize:64},xxl:{fontSize:56},xl:{fontSize:48},l:{fontSize:40},m:{fontSize:36},s:{fontSize:32},xs:{fontSize:28},xxs:{fontSize:24},xxxs:{fontSize:20}},subheading:{xxxl:{fontSize:52},xxl:{fontSize:46},xl:{fontSize:40},l:{fontSize:34},m:{fontSize:28},s:{fontSize:24},xs:{fontSize:20},xxs:{fontSize:16},xxxs:{fontSize:12}},'subheading-compact':{xxxl:{fontSize:36},xxl:{fontSize:32},xl:{fontSize:28},l:{fontSize:24},m:{fontSize:20},s:{fontSize:18},xs:{fontSize:16},xxs:{fontSize:14},xxxs:{fontSize:12}},body:{xxxl:{fontSize:32},xxl:{fontSize:28},xl:{fontSize:24},l:{fontSize:20},m:{fontSize:18},s:{fontSize:16},xs:{fontSize:14},xxs:{fontSize:12},xxxs:{fontSize:10}},caption:{xxxl:{fontSize:32},xxl:{fontSize:28},xl:{fontSize:24},l:{fontSize:20},m:{fontSize:18},s:{fontSize:16},xs:{fontSize:14},xxs:{fontSize:12},xxxs:{fontSize:10}}};var i={xxxl:{fontSize:24},xxl:{fontSize:22},xl:{fontSize:20},l:{fontSize:18},m:{fontSize:16},s:{fontSize:14},xs:{fontSize:12},xxs:{fontSize:10},xxxs:{fontSize:8}};export{e as APPEARANCE,t as SIZES,i as SIZES_DEFAULT};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/Text/constants.ts"],"sourcesContent":["import type { TypographyAppearance, TextProps } from '
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/components/Text/constants.ts"],"sourcesContent":["import type { Sizes } from 'shared/interfaces'\nimport type { TypographyAppearance, TextProps } from './types'\n\nexport const APPEARANCE: Record<TypographyAppearance, Partial<Omit<TextProps, 'size' | 'appearance'>>> = {\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<TypographyAppearance, Sizes> = {\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\nexport const SIZES_DEFAULT: Sizes = {\n xxxl: {\n fontSize: 24,\n },\n xxl: {\n fontSize: 22,\n },\n xl: {\n fontSize: 20,\n },\n l: {\n fontSize: 18,\n },\n m: {\n fontSize: 16,\n },\n s: {\n fontSize: 14,\n },\n xs: {\n fontSize: 12,\n },\n xxs: {\n fontSize: 10,\n },\n xxxs: {\n fontSize: 8,\n },\n}\n"],"names":["APPEARANCE","display","lineHeight","weight","fontStyle","heading","subheading","body","caption","SIZES","xxxl","fontSize","xxl","xl","l","m","s","xs","xxs","xxxs","SIZES_DEFAULT"],"mappings":"AAGO,IAAMA,EAA4F,CACvGC,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,IAAMK,EAA6C,CACxDR,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,MAKT,IAAMS,EAAuB,CAClCV,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
|
-
import n from'styled-components';import{display as
|
|
1
|
+
import n from'styled-components';import{display as o}from'../../mixins/display.js';import{color as t}from'../../mixins/color.js';import{responsiveSize as i}from'../../mixins/size.js';import{responsiveMargin as e}from'../../mixins/margin.js';import{createShouldForwardProp as r}from'../../shared/utils/style.js';var a={lighter:100,normal:400,bold:600,bolder:800};var l={l:1.5,m:1.3,s:1.15,xs:1};var s=r((n=>!['appearance','fontFamily','weight','fontStyle','transform','underlineLinks','textAlign','lineHeight','content','display','chars','quoted','showZeroMinorPart','separator'].includes(n)));var c=n.div.withConfig({shouldForwardProp:s}).attrs({dynamicSizeDeclaration:(n,o,t)=>({[o]:'string'==typeof n?n:"".concat(n).concat(t)})}).withConfig({componentId:"fox-ui__sc-s2fogy-0"})([""," "," "," "," ",""],(n=>{var o,t;return"\n margin: 0;\n ".concat(n.fontFamily?"font-family: ".concat(n.fontFamily,";"):'',"\n ").concat(n.transform?"text-transform: ".concat(n.transform,";"):'',"\n ").concat(n.weight?"font-weight: ".concat(null!==(o=a[n.weight])&&void 0!==o?o:n.weight,";"):'',"\n ").concat(n.fontStyle?"font-style: ".concat(n.fontStyle,";"):'',"\n ").concat(n.textAlign?"text-align: ".concat(n.textAlign,";"):'',"\n ").concat(n.lineHeight?"line-height: ".concat(null!==(t=l[n.lineHeight])&&void 0!==t?t:n.lineHeight,";"):'',"\n a {\n text-decoration: ").concat(n.underlineLinks?'underline':'none',";\n &:hover {\n text-decoration: none;\n }\n }\n ")}),i,e,(n=>n.display?o(n.display):null),(n=>t(n.color?n.color:n.theme.textColor)));export{c as Root};
|
|
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 {
|
|
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/size'\nimport { responsiveMargin } from 'mixins/margin'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { Color } from 'shared/interfaces'\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 ].includes(propKey)\n)\n\nexport const Root = styled.div\n .withConfig<StyledTextProps>({\n shouldForwardProp: shouldForwardTextProp,\n })\n .attrs(<Required<Pick<StyledTextProps, 'dynamicSizeDeclaration'>>>{\n dynamicSizeDeclaration: (size, cssProperty, cssUnit) => {\n return {\n [cssProperty]: typeof size === 'string' ? size : `${size}${cssUnit}`,\n }\n },\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 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","attrs","dynamicSizeDeclaration","size","cssProperty","cssUnit","concat","componentId","props","_WEIGHT_MAP$props$wei","_LINE_HEIGHT_MAP$prop","fontFamily","transform","weight","fontStyle","textAlign","lineHeight","underlineLinks","responsiveSize","responsiveMargin","display","color","theme","textColor"],"mappings":"uTASA,IAAMA,EAAa,CACjBC,QAAS,IACTC,OAAQ,IACRC,KAAM,IACNC,OAAQ,KAGV,IAAMC,EAAkB,CACtBC,EAAG,IACHC,EAAG,IACHC,EAAG,KACHC,GAAI,GAGN,IAAMC,EAAwBC,GAC3BC,IACE,CACC,aACA,aACA,SACA,YACA,YACA,iBACA,YACA,aACA,UACA,UACA,QACA,SACA,oBACA,aACAC,SAASD,KAGR,IAAME,EAAOC,EAAOC,IACxBC,WAA4B,CAC3BC,kBAAmBR,IAEpBS,MAAiE,CAChEC,uBAAwB,CAACC,EAAMC,EAAaC,KAAAA,CAExCD,CAACA,GAA8B,iBAATD,EAAoBA,EAA3B,GAAAG,OAAqCH,GAArCG,OAA4CD,OAPlDN,WAAA,CAAAQ,YAAA,uBAAGV,CAAH,CAAA,GAAA,IAAA,IAAA,IAAA,IAAA,KAWZW,IAAD,IAAAC,EAAAC,EAAA,MAAA,yBAAAJ,OAEEE,EAAMG,WAA6BH,gBAAAA,OAAAA,EAAMG,WAAzC,KAAyD,GAF3D,UAAAL,OAGEE,EAAMI,oCAA+BJ,EAAMI,UAAe,KAAA,GAC1DJ,UAAAA,OAAAA,EAAMK,OAAN,gBAAAP,OAAA,QAAAG,EAA+B3B,EAAW0B,EAAMK,eAAhD,IAAAJ,EAAAA,EAA2DD,EAAMK,YAAY,GAJ/E,UAAAP,OAKEE,EAAMM,UAA2BN,eAAAA,OAAAA,EAAMM,UAAvC,KAAsD,GALxD,UAAAR,OAMEE,EAAMO,UAA2BP,eAAAA,OAAAA,EAAMO,UAAvC,KAAsD,GACtDP,UAAAA,OAAAA,EAAMQ,WAAN,gBAAAV,OAAA,QAAAI,EAAmCvB,EAAgBqB,EAAMQ,mBAAAA,IAAzDN,EAAAA,EAAwEF,EAAMQ,WAAgB,KAAA,gDAE3ER,EAAMS,eAAiB,YAAc,OAT1D,4EAgBAC,EACAC,GAECX,GAAWA,EAAMY,QAAUA,EAAQZ,EAAMY,SAAW,OACpDZ,GAAyBa,EAAdb,EAAMa,MAAcb,EAAMa,MAAeb,EAAMc,MAAMC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.Ellipse.js","sources":["../../../../src/components/Text.Ellipse/Text.Ellipse.tsx"],"sourcesContent":["import { Component } from 'react'\nimport type { TextProps } from '
|
|
1
|
+
{"version":3,"file":"Text.Ellipse.js","sources":["../../../../src/components/Text.Ellipse/Text.Ellipse.tsx"],"sourcesContent":["import { Component } from 'react'\nimport type { TextProps } from 'components/Text'\nimport { Spacer } from '../Spacer/Spacer'\nimport { Anchor } from '../Anchor/Anchor'\nimport { Text } from '../Text'\nimport * as Styled from './style'\n\nexport interface TextEllipseProps extends Omit<TextProps, 'content'> {\n /** Toggle text for folded state */\n moreText?: string\n /** Toggle text for unfolded state */\n lessText?: string\n /** Classname */\n className?: string\n /** Html content */\n content: string | string[]\n /** Characters quantity for ellipsed text */\n chars?: number\n /** Wrap text in quotes */\n quoted?: boolean\n /** Flag to show toggler */\n showToggler?: boolean\n}\n\ninterface TextEllipseState {\n isUnFolded: boolean\n isEllipsed: boolean\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`ResponsiveNamedProperty<'size'>`](#/Миксины)\n */\nexport class TextEllipse extends Component<TextEllipseProps, TextEllipseState> {\n static displayName = 'Text.Ellipse'\n\n constructor(props: TextEllipseProps) {\n super(props)\n\n this.state = {\n isUnFolded: false,\n isEllipsed: false,\n }\n }\n\n componentDidUpdate({ content }: TextEllipseProps) {\n if (content !== this.props.content && this.state.isUnFolded) {\n this.toggle()\n }\n }\n\n getContent = (props: Omit<TextEllipseProps, 'className' | 'moreText' | 'lessText' | 'showToggler'>) => {\n const { content, chars = 0 } = this.props\n\n if (!content) return ''\n\n let { isEllipsed } = this.state\n let text: string | string[] = typeof content === 'string' ? '' : []\n\n if (!this.state.isUnFolded) {\n if (typeof text === 'string') {\n isEllipsed = chars !== 0 && content.length > chars\n\n text = isEllipsed && chars !== 0 ? `${content.slice(0, chars)}...` : content\n } else {\n let leftChars = chars\n\n for (let index = 0; index < content.length; index++) {\n if (leftChars - content[index].length > 0) {\n leftChars -= content[index].length\n\n text[index] = content[index]\n } else {\n isEllipsed = true\n text[index] = `${content[index].slice(0, leftChars)}...`\n\n break\n }\n }\n }\n } else {\n text = content\n }\n\n if (this.state.isEllipsed !== isEllipsed) setTimeout(() => this.setState({ isEllipsed }))\n\n return typeof text === 'string' ? (\n <Text {...props} content={this.getQuted(text)} />\n ) : (\n <Styled.Ul>\n {text.map((item, index) => (\n <Styled.Li key={index}>\n <Text {...props} display='inline' content={item} />\n </Styled.Li>\n ))}\n </Styled.Ul>\n )\n }\n\n getQuted = (content: string) => (this.props.quoted ? `«${content}»` : content)\n\n toggle = () => {\n this.setState({ isUnFolded: !this.state.isUnFolded })\n }\n\n render() {\n const {\n className = '',\n style,\n moreText = 'Читать полностью',\n lessText = 'Свернуть',\n showToggler = true,\n ...restProps\n } = this.props\n const { isUnFolded, isEllipsed } = this.state\n\n return (\n <div className={className} style={style}>\n {this.getContent(restProps)}\n {showToggler && isEllipsed && (\n <Spacer marginTop={16} marginBottom={1}>\n <Anchor pseudo onClick={this.toggle}>\n {isUnFolded ? lessText : moreText}\n </Anchor>\n </Spacer>\n )}\n </div>\n )\n }\n}\n"],"names":["TextEllipse","Component","constructor","props","super","this","getContent","content","chars","isEllipsed","state","text","isUnFolded","length","slice","leftChars","index","concat","setTimeout","setState","_jsx","Text","getQuted","Styled.Ul","children","map","item","Styled.Li","_objectSpread","display","quoted","toggle","componentDidUpdate","_ref","render","_this$props","className","style","moreText","lessText","showToggler","restProps","_objectWithoutProperties","_excluded","_jsxs","Spacer","marginTop","marginBottom","Anchor","pseudo","onClick","displayName"],"mappings":"+aAoCO,MAAMA,UAAoBC,EAG/BC,YAAYC,GACVC,MAAMD,GAD6BE,KAerCC,WAAcH,IACZ,IAAMI,QAAEA,EAAFC,MAAWA,EAAQ,GAAMH,KAAKF,MAEpC,IAAKI,EAAS,MAAO,GAErB,IAAIE,WAAEA,GAAeJ,KAAKK,MAC1B,IAAIC,EAA6C,iBAAZJ,EAAuB,GAAK,GAEjE,GAAKF,KAAKK,MAAME,WAsBdD,EAAOJ,OArBP,GAAoB,iBAATI,EAGTA,GAFAF,EAAuB,IAAVD,GAAeD,EAAQM,OAASL,IAEd,IAAVA,EAAiBD,GAAAA,OAAAA,EAAQO,MAAM,EAAGN,UAAcD,MAChE,CACL,IAAIQ,EAAYP,EAEhB,IAAK,IAAIQ,EAAQ,EAAGA,EAAQT,EAAQM,OAAQG,IAAS,CACnD,KAAID,EAAYR,EAAQS,GAAOH,OAAS,GAIjC,CACLJ,KACAE,EAAKK,GAAL,GAAAC,OAAiBV,EAAQS,GAAOF,MAAM,EAAGC,GAAzC,OAEA,MAPAA,GAAaR,EAAQS,GAAOH,OAE5BF,EAAKK,GAAST,EAAQS,IAe9B,OAFIX,KAAKK,MAAMD,aAAeA,GAAYS,YAAAA,IAAiBb,KAAKc,SAAS,CAAEV,WAAAA,MAEpD,iBAATE,EACZS,EAACC,SAASlB,GAAV,GAAA,CAAiBI,QAASF,KAAKiB,SAASX,MAExCS,EAACG,EAAD,CAAAC,SACGb,EAAKc,KAAAA,CAAKC,EAAMV,IACfI,EAACO,EAAD,CAAAH,SACEJ,EAACC,EAADO,EAAAA,EAAA,GAAUzB,GAAV,GAAA,CAAiB0B,QAAQ,SAAStB,QAASmB,MAD7BV,QAvDaX,KA+DrCiB,SAAYf,GAAqBF,KAAKF,MAAM2B,OAAX,IAAAb,OAAwBV,EAAxB,KAAqCA,EA/DjCF,KAiErC0B,OAAS,KACP1B,KAAKc,SAAS,CAAEP,YAAaP,KAAKK,MAAME,cA/DxCP,KAAKK,MAAQ,CACXE,YAAAA,EACAH,YAAAA,GAIJuB,mBAAkDC,GAAA,IAA/B1B,QAAEA,GAA6B0B,EAC5C1B,IAAYF,KAAKF,MAAMI,SAAWF,KAAKK,MAAME,YAC/CP,KAAK0B,SA0DTG,SACE,IAAAC,EAOI9B,KAAKF,OAPHiC,UACJA,EAAY,GADRC,MAEJA,EAFIC,SAGJA,EAAW,mBAHPC,SAIJA,EAAW,WAJPC,YAKJA,GAAc,GALhBL,EAMKM,EANLC,EAAAP,EAAAQ,GAQA,IAAM/B,WAAEA,EAAFH,WAAcA,GAAeJ,KAAKK,MAExC,OACEkC,EAAA,MAAA,CAAKR,UAAWA,EAAWC,MAAOA,EAAlCb,SACG,CAAAnB,KAAKC,WAAWmC,GAChBD,GAAe/B,GACdW,EAACyB,EAAD,CAAQC,UAAW,GAAIC,aAAc,EAArCvB,SACEJ,EAAC4B,EAAD,CAAQC,UAAOC,QAAS7C,KAAK0B,OAA7BP,SACGZ,EAAa2B,EAAWD,UAzF1BtC,EACJmD,YAAc"}
|
package/dts/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import { CSSProperties, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, PureComponent
|
|
3
|
+
import { Component, CSSProperties, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, PureComponent } from 'react';
|
|
4
4
|
import * as styled_components from 'styled-components';
|
|
5
5
|
import { DefaultTheme, FlattenSimpleInterpolation, CSSObject, Interpolation, ThemeProps, SimpleInterpolation, css } from 'styled-components';
|
|
6
6
|
import { Link } from 'react-router-dom';
|
|
@@ -63,11 +63,103 @@ declare const responsiveNamedProperty: <T extends PropsProperties>({ sizes, pred
|
|
|
63
63
|
*/
|
|
64
64
|
declare const responsiveProperty: (propName: string, cssProperty?: string | null, sizing?: null | string) => () => (props: any) => styled_components.FlattenInterpolation<styled_components.ThemeProps<styled_components.DefaultTheme>> | null;
|
|
65
65
|
|
|
66
|
+
declare type H = 'h1' | 'h2' | 'h3' | 'h4';
|
|
67
|
+
interface TextHeadingProps extends Omit<TextProps, 'content' | 'as'> {
|
|
68
|
+
/** Default set of size, lineHeight and weight props */
|
|
69
|
+
h?: H;
|
|
70
|
+
/** Children react node */
|
|
71
|
+
children?: React.ReactNode;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @visibleName Text.Heading
|
|
76
|
+
*/
|
|
77
|
+
declare const TextHeading: {
|
|
78
|
+
(props: TextHeadingProps): JSX.Element;
|
|
79
|
+
displayName: string;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
interface TextEllipseProps extends Omit<TextProps, 'content'> {
|
|
83
|
+
/** Toggle text for folded state */
|
|
84
|
+
moreText?: string;
|
|
85
|
+
/** Toggle text for unfolded state */
|
|
86
|
+
lessText?: string;
|
|
87
|
+
/** Classname */
|
|
88
|
+
className?: string;
|
|
89
|
+
/** Html content */
|
|
90
|
+
content: string | string[];
|
|
91
|
+
/** Characters quantity for ellipsed text */
|
|
92
|
+
chars?: number;
|
|
93
|
+
/** Wrap text in quotes */
|
|
94
|
+
quoted?: boolean;
|
|
95
|
+
/** Flag to show toggler */
|
|
96
|
+
showToggler?: boolean;
|
|
97
|
+
}
|
|
98
|
+
interface TextEllipseState {
|
|
99
|
+
isUnFolded: boolean;
|
|
100
|
+
isEllipsed: boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Расширен:
|
|
104
|
+
* - [`BaseProps`](#/Миксины)
|
|
105
|
+
* - [`Color`](#/Миксины)
|
|
106
|
+
* - [`Display`](#/Миксины)
|
|
107
|
+
* - [`ResponsiveNamedProperty<'size'>`](#/Миксины)
|
|
108
|
+
*/
|
|
109
|
+
declare class TextEllipse extends Component<TextEllipseProps, TextEllipseState> {
|
|
110
|
+
static displayName: string;
|
|
111
|
+
constructor(props: TextEllipseProps);
|
|
112
|
+
componentDidUpdate({ content }: TextEllipseProps): void;
|
|
113
|
+
getContent: (props: Omit<TextEllipseProps, 'className' | 'moreText' | 'lessText' | 'showToggler'>) => "" | JSX.Element;
|
|
114
|
+
getQuted: (content: string) => string;
|
|
115
|
+
toggle: () => void;
|
|
116
|
+
render(): JSX.Element;
|
|
117
|
+
}
|
|
118
|
+
|
|
66
119
|
declare type Display = 'block' | 'inline' | 'inline-block' | 'flex' | 'inline-flex' | 'table-cell' | 'inherit' | 'none';
|
|
67
120
|
interface DisplayProperty {
|
|
68
121
|
display?: Display;
|
|
69
122
|
}
|
|
70
123
|
|
|
124
|
+
declare type TypographyAppearance = 'display' | 'heading' | 'subheading' | 'subheading-compact' | 'body' | 'caption';
|
|
125
|
+
interface TextProps extends ResponsiveSizeProps, ResponsiveMarginProps, DisplayProperty, ColorProperty, BaseProps, Omit<React.ComponentPropsWithRef<'div'>, 'color'> {
|
|
126
|
+
/** Root node polymorphic type */
|
|
127
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span';
|
|
128
|
+
/** Predefined styles and sizes */
|
|
129
|
+
appearance?: TypographyAppearance;
|
|
130
|
+
/** Font family */
|
|
131
|
+
fontFamily?: string;
|
|
132
|
+
/** Font weight */
|
|
133
|
+
weight?: 'normal' | 'bold' | 'lighter' | 'bolder' | number | 'inherit';
|
|
134
|
+
/** Font style */
|
|
135
|
+
fontStyle?: 'normal' | 'italic';
|
|
136
|
+
/** Text transform */
|
|
137
|
+
transform?: 'capitalize' | 'uppercase' | 'lowercase';
|
|
138
|
+
/** Underline inner <a> */
|
|
139
|
+
underlineLinks?: boolean;
|
|
140
|
+
/** Text align */
|
|
141
|
+
textAlign?: 'left' | 'center' | 'right' | 'justify' | 'start' | 'end';
|
|
142
|
+
/** Line height */
|
|
143
|
+
lineHeight?: 'l' | 'm' | 's' | 'xs' | number;
|
|
144
|
+
/** React children */
|
|
145
|
+
children?: React.ReactNode;
|
|
146
|
+
/** @deprecated Use children */
|
|
147
|
+
content?: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* Component interface extends:
|
|
153
|
+
* - [`ResponsiveSizeProps`](#/Interfaces)
|
|
154
|
+
* - [`ResponsiveMarginProps`](#/Interfaces)
|
|
155
|
+
* - [`BaseProps`](#/Interfaces)
|
|
156
|
+
* - [`React.ComponentPropsWithRef<'div'>`](#/Interfaces)
|
|
157
|
+
*/
|
|
158
|
+
declare const Text: React.ForwardRefExoticComponent<TextProps> & {
|
|
159
|
+
Heading: typeof TextHeading;
|
|
160
|
+
Ellipse: typeof TextEllipse;
|
|
161
|
+
};
|
|
162
|
+
|
|
71
163
|
declare enum SizeInput {
|
|
72
164
|
l = 380,
|
|
73
165
|
m = 300,
|
|
@@ -333,7 +425,11 @@ declare enum BaseColorNames {
|
|
|
333
425
|
'alert-bg-error-500' = "alert-bg-error-500",
|
|
334
426
|
'alert-success' = "alert-success",
|
|
335
427
|
'alert-warning' = "alert-warning",
|
|
336
|
-
'alert-error' = "alert-error"
|
|
428
|
+
'alert-error' = "alert-error",
|
|
429
|
+
'product-bg-course' = "product-bg-course",
|
|
430
|
+
'product-bg-tutor' = "product-bg-tutor",
|
|
431
|
+
'product-bg-group' = "product-bg-group",
|
|
432
|
+
'product-bg-complect' = "product-bg-complect"
|
|
337
433
|
}
|
|
338
434
|
declare enum BrandColorNames {
|
|
339
435
|
'content-brand-primary' = "content-brand-primary",
|
|
@@ -542,6 +638,10 @@ declare const ColorNames: {
|
|
|
542
638
|
'alert-success': (typeof BaseColorNames)["alert-success"];
|
|
543
639
|
'alert-warning': (typeof BaseColorNames)["alert-warning"];
|
|
544
640
|
'alert-error': (typeof BaseColorNames)["alert-error"];
|
|
641
|
+
'product-bg-course': (typeof BaseColorNames)["product-bg-course"];
|
|
642
|
+
'product-bg-tutor': (typeof BaseColorNames)["product-bg-tutor"];
|
|
643
|
+
'product-bg-group': (typeof BaseColorNames)["product-bg-group"];
|
|
644
|
+
'product-bg-complect': (typeof BaseColorNames)["product-bg-complect"];
|
|
545
645
|
profession: UnitColorNames.profession;
|
|
546
646
|
professionDark: UnitColorNames.professionDark;
|
|
547
647
|
camps: UnitColorNames.camps;
|
|
@@ -863,13 +963,13 @@ declare type ThemeName = 'mother' | 'baby' | 'teen' | 'adult';
|
|
|
863
963
|
declare type Size = 'xxxl' | 'xxl' | 'xl' | 'l' | 'm' | 's' | 'xs' | 'xxs' | 'xxxs';
|
|
864
964
|
declare type Breakpoint = 'XXS' | 'XS' | 'S' | 'M' | 'L' | 'XL';
|
|
865
965
|
declare type CSSUnit = 'px' | 'rem' | 'em' | '%';
|
|
866
|
-
declare type
|
|
966
|
+
declare type CSSGlobalValue = 'initial' | 'inherit' | 'unset' | 'revert' | 'revert-layer';
|
|
967
|
+
declare type SizeValue = Size | CSSGlobalValue | number;
|
|
867
968
|
declare type Sizes = Record<Size, CSSProperties>;
|
|
868
969
|
declare type MarginProperty = 'margin' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft';
|
|
869
970
|
declare type ColorPaletteKey = 'color' | `color${string}` | `${string}Color` | `${string}Color${string}`;
|
|
870
|
-
declare type CSSColor = RGB | RGBA | HEX |
|
|
971
|
+
declare type CSSColor = RGB | RGBA | HEX | CSSGlobalValue | 'currentcolor' | 'transparent';
|
|
871
972
|
declare type Color = keyof typeof ColorNames | CSSColor;
|
|
872
|
-
declare type TypographyAppearance = 'display' | 'heading' | 'subheading' | 'subheading-compact' | 'body' | 'caption';
|
|
873
973
|
interface BaseProps {
|
|
874
974
|
preset?: ThemePreset;
|
|
875
975
|
className?: string;
|
|
@@ -920,7 +1020,7 @@ declare type ResponsiveSizeProps = {
|
|
|
920
1020
|
declare type ColorPaletteProps<T extends ColorPaletteKey = ColorPaletteKey> = {
|
|
921
1021
|
palette?: Partial<Record<T, Color>>;
|
|
922
1022
|
};
|
|
923
|
-
declare type DynamicSizeDeclaration = (size: number, cssProperty: keyof CSSProperties, cssUnit: CSSUnit) => CSSProperties;
|
|
1023
|
+
declare type DynamicSizeDeclaration = (size: number | CSSGlobalValue, cssProperty: keyof CSSProperties, cssUnit: CSSUnit) => CSSProperties;
|
|
924
1024
|
declare type CommonInterpolationProps<T extends ResponsiveSizeProps & ColorPaletteProps> = Omit<T, 'sizes' | 'size' | 'palette'> & {
|
|
925
1025
|
dynamicSizeDeclaration?: DynamicSizeDeclaration;
|
|
926
1026
|
sizeProperty?: keyof CSSProperties;
|
|
@@ -939,40 +1039,6 @@ declare type ColorSchemaProps = {
|
|
|
939
1039
|
tertiary?: boolean;
|
|
940
1040
|
quaternary?: boolean;
|
|
941
1041
|
};
|
|
942
|
-
interface TextProps extends DisplayProperty, ColorProperty, ResponsiveNamedProperty<'size'>, BaseProps {
|
|
943
|
-
/** Root node polymorphic type */
|
|
944
|
-
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span';
|
|
945
|
-
/** Root id attribute */
|
|
946
|
-
id?: string;
|
|
947
|
-
/** Use predefined props with low priority */
|
|
948
|
-
appearance?: TypographyAppearance;
|
|
949
|
-
/** Custom sizes set */
|
|
950
|
-
sizes?: Record<Size, number>;
|
|
951
|
-
/** Sizing units */
|
|
952
|
-
fontUnits?: string;
|
|
953
|
-
/** Font family */
|
|
954
|
-
fontFamily?: string;
|
|
955
|
-
/** Font weight */
|
|
956
|
-
weight?: 'normal' | 'bold' | 'lighter' | 'bolder' | number | 'inherit';
|
|
957
|
-
/** Font style */
|
|
958
|
-
fontStyle?: 'normal' | 'italic';
|
|
959
|
-
/** Text transform */
|
|
960
|
-
transform?: 'capitalize' | 'uppercase' | 'lowercase';
|
|
961
|
-
/** Root margin */
|
|
962
|
-
margin?: number | string;
|
|
963
|
-
/** Underlined text */
|
|
964
|
-
underlineLinks?: boolean;
|
|
965
|
-
/** Text align */
|
|
966
|
-
textAlign?: 'left' | 'center' | 'right' | 'justify' | 'start' | 'end';
|
|
967
|
-
/** Line height */
|
|
968
|
-
lineHeight?: 'l' | 'm' | 's' | 'xs' | number;
|
|
969
|
-
/** Title attribute */
|
|
970
|
-
title?: string;
|
|
971
|
-
/** Component's children */
|
|
972
|
-
children?: React.ReactNode;
|
|
973
|
-
/** @deprecated Use children */
|
|
974
|
-
content?: string;
|
|
975
|
-
}
|
|
976
1042
|
declare type TypographyProps = {
|
|
977
1043
|
textProps?: TextProps;
|
|
978
1044
|
};
|
|
@@ -1417,14 +1483,6 @@ declare const Textarea: {
|
|
|
1417
1483
|
displayName: string;
|
|
1418
1484
|
};
|
|
1419
1485
|
|
|
1420
|
-
declare type H = 'h1' | 'h2' | 'h3' | 'h4';
|
|
1421
|
-
interface TextHeadingProps extends Omit<TextProps, 'content' | 'as'> {
|
|
1422
|
-
/** Default set of size, lineHeight and weight props */
|
|
1423
|
-
h?: H;
|
|
1424
|
-
/** Children react node */
|
|
1425
|
-
children?: React.ReactNode;
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
1486
|
interface SwitcherProps extends BaseProps, ColorProperty<'color'>, ColorProperty<'inactiveColor'> {
|
|
1429
1487
|
/** Input id */
|
|
1430
1488
|
id?: string;
|
|
@@ -1532,6 +1590,48 @@ ColorPaletteProps<keyof TabPalette>, TypographyProps, Omit<React.ComponentPropsW
|
|
|
1532
1590
|
*/
|
|
1533
1591
|
declare const Tab: React.ForwardRefExoticComponent<TabProps>;
|
|
1534
1592
|
|
|
1593
|
+
declare type BadgePalette = {
|
|
1594
|
+
color: CSSColor;
|
|
1595
|
+
backgroundColor: CSSColor;
|
|
1596
|
+
};
|
|
1597
|
+
interface BadgeProps extends ResponsiveSizeProps, ResponsiveMarginProps, ColorSchemaProps, TypographyProps, BaseProps,
|
|
1598
|
+
/** @deprecated Use palette */
|
|
1599
|
+
ColorProperty,
|
|
1600
|
+
/** @deprecated Use children as function */
|
|
1601
|
+
DisplayProperty, ColorPaletteProps<keyof BadgePalette>, Omit<React.ComponentPropsWithRef<'div'>, 'color' | 'children'> {
|
|
1602
|
+
/** React children */
|
|
1603
|
+
children?: React.ReactNode | ((props: RenderProps<TypographyProps & {
|
|
1604
|
+
iconBaseProps: Partial<IconProps>;
|
|
1605
|
+
iconProps: BadgeProps['iconProps'];
|
|
1606
|
+
icon: BadgeProps['icon'];
|
|
1607
|
+
}>) => React.ReactNode);
|
|
1608
|
+
/** Appearance variant */
|
|
1609
|
+
round?: boolean;
|
|
1610
|
+
/** Root border radius */
|
|
1611
|
+
borderRadius?: string | number;
|
|
1612
|
+
/** Icons before and after content */
|
|
1613
|
+
icon?: JSX.Element | [Nullable<JSX.Element>, Nullable<JSX.Element>];
|
|
1614
|
+
/** Props for icon components */
|
|
1615
|
+
iconProps?: IconProps;
|
|
1616
|
+
/** Don't use margin-right: 8px; */
|
|
1617
|
+
resetDefaultMargin?: boolean;
|
|
1618
|
+
/** @deprecated Use children */
|
|
1619
|
+
content?: string | React.ReactNode;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
/**
|
|
1623
|
+
*
|
|
1624
|
+
* Component interface extends:
|
|
1625
|
+
* - [`ResponsiveSizeProps`](#/Interfaces)
|
|
1626
|
+
* - [`ResponsiveMarginProps`](#/Interfaces)
|
|
1627
|
+
* - [`ColorSchemaProps`](#/Interfaces)
|
|
1628
|
+
* - [`ColorPaletteProps<keyof BadgePalette>`](#/Interfaces)
|
|
1629
|
+
* - [`TypographyProps`](#/Interfaces)
|
|
1630
|
+
* - [`BaseProps`](#/Interfaces)
|
|
1631
|
+
* - [`React.ComponentPropsWithRef<'div'>`](#/Interfaces)
|
|
1632
|
+
*/
|
|
1633
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps>;
|
|
1634
|
+
|
|
1535
1635
|
interface Theme {
|
|
1536
1636
|
breakpoints: Readonly<{
|
|
1537
1637
|
xl: number;
|
|
@@ -1570,6 +1670,7 @@ interface Theme {
|
|
|
1570
1670
|
'Text.Heading'?: TextHeadingProps;
|
|
1571
1671
|
Switcher?: SwitcherProps;
|
|
1572
1672
|
Tab?: TabProps;
|
|
1673
|
+
Badge?: BadgeProps;
|
|
1573
1674
|
};
|
|
1574
1675
|
}
|
|
1575
1676
|
|
|
@@ -1795,7 +1896,7 @@ declare enum CurrencyCodes {
|
|
|
1795
1896
|
}
|
|
1796
1897
|
declare const CURRENCY_MAP: Readonly<Record<CurrencyCodes, string>>;
|
|
1797
1898
|
|
|
1798
|
-
interface AmountProps extends BaseProps, ColorProperty,
|
|
1899
|
+
interface AmountProps extends ResponsiveSizeProps, BaseProps, ColorProperty, DisplayProperty {
|
|
1799
1900
|
/**
|
|
1800
1901
|
* Value for amount
|
|
1801
1902
|
*/
|
|
@@ -1888,27 +1989,6 @@ declare class Avatar extends PureComponent<AvatarProps> {
|
|
|
1888
1989
|
render(): JSX.Element;
|
|
1889
1990
|
}
|
|
1890
1991
|
|
|
1891
|
-
interface BadgeProps extends BaseProps, ColorProperty, DisplayProperty {
|
|
1892
|
-
/**
|
|
1893
|
-
* Children react node
|
|
1894
|
-
*/
|
|
1895
|
-
children?: React.ReactNode;
|
|
1896
|
-
content?: string | React.ReactNode;
|
|
1897
|
-
textProps?: TextProps;
|
|
1898
|
-
/** Make badge round */
|
|
1899
|
-
round?: string;
|
|
1900
|
-
}
|
|
1901
|
-
/**
|
|
1902
|
-
* Расширен:
|
|
1903
|
-
* - [`BaseProps`](#/Миксины)
|
|
1904
|
-
* - [`Color`](#/Миксины)
|
|
1905
|
-
* - [`Display`](#/Миксины)
|
|
1906
|
-
*/
|
|
1907
|
-
declare function Badge({ children, content, className, textProps, round, display, ...restProps }: BadgeProps): JSX.Element;
|
|
1908
|
-
declare namespace Badge {
|
|
1909
|
-
var displayName: string;
|
|
1910
|
-
}
|
|
1911
|
-
|
|
1912
1992
|
interface ContainerProps extends BaseProps, DisplayProperty, ColorProperty {
|
|
1913
1993
|
/**
|
|
1914
1994
|
* Primary content
|
|
@@ -2578,50 +2658,6 @@ declare namespace Tabs {
|
|
|
2578
2658
|
var Tab: react.ForwardRefExoticComponent<TabProps>;
|
|
2579
2659
|
}
|
|
2580
2660
|
|
|
2581
|
-
interface TextEllipseProps extends Omit<TextProps, 'content'> {
|
|
2582
|
-
/** Toggle text for folded state */
|
|
2583
|
-
moreText?: string;
|
|
2584
|
-
/** Toggle text for unfolded state */
|
|
2585
|
-
lessText?: string;
|
|
2586
|
-
/** Classname */
|
|
2587
|
-
className?: string;
|
|
2588
|
-
/** Html content */
|
|
2589
|
-
content: string | string[];
|
|
2590
|
-
/** Characters quantity for ellipsed text */
|
|
2591
|
-
chars?: number;
|
|
2592
|
-
/** Wrap text in quotes */
|
|
2593
|
-
quoted?: boolean;
|
|
2594
|
-
/** Flag to show toggler */
|
|
2595
|
-
showToggler?: boolean;
|
|
2596
|
-
}
|
|
2597
|
-
interface TextEllipseState {
|
|
2598
|
-
isUnFolded: boolean;
|
|
2599
|
-
isEllipsed: boolean;
|
|
2600
|
-
}
|
|
2601
|
-
/**
|
|
2602
|
-
* Расширен:
|
|
2603
|
-
* - [`BaseProps`](#/Миксины)
|
|
2604
|
-
* - [`Color`](#/Миксины)
|
|
2605
|
-
* - [`Display`](#/Миксины)
|
|
2606
|
-
* - [`ResponsiveNamedProperty<'size'>`](#/Миксины)
|
|
2607
|
-
*/
|
|
2608
|
-
declare class TextEllipse extends Component<TextEllipseProps, TextEllipseState> {
|
|
2609
|
-
static displayName: string;
|
|
2610
|
-
constructor(props: TextEllipseProps);
|
|
2611
|
-
componentDidUpdate({ content }: TextEllipseProps): void;
|
|
2612
|
-
getContent: (props: Omit<TextEllipseProps, 'className' | 'moreText' | 'lessText' | 'showToggler'>) => "" | JSX.Element;
|
|
2613
|
-
getQuted: (content: string) => string;
|
|
2614
|
-
toggle: () => void;
|
|
2615
|
-
render(): JSX.Element;
|
|
2616
|
-
}
|
|
2617
|
-
|
|
2618
|
-
interface TextComponent extends ForwardRefExoticComponent<PropsWithoutRef<TextProps> & RefAttributes<HTMLElement>> {
|
|
2619
|
-
Heading: (props: TextHeadingProps) => JSX.Element;
|
|
2620
|
-
Ellipse: typeof TextEllipse;
|
|
2621
|
-
}
|
|
2622
|
-
|
|
2623
|
-
declare const Text: TextComponent;
|
|
2624
|
-
|
|
2625
2661
|
/**
|
|
2626
2662
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
2627
2663
|
|
|
@@ -3267,4 +3303,4 @@ declare namespace Select {
|
|
|
3267
3303
|
var displayName: string;
|
|
3268
3304
|
}
|
|
3269
3305
|
|
|
3270
|
-
export { ActionBtn, Alert, Amount, Anchor, Arrow, ArrowBadge, Avatar, Badge, BaseProps, Breakpoint, Button, COUNTRY_DATA, CSSColor, CSSUnit, CURRENCY_MAP, Checkbox, Color, ColorNames, ColorPaletteKey, ColorPaletteProps, ColorSchemaProps, CommonInterpolationProps, Container, ContextMenu, CurrencyCodes, DEFAULT_MASK, DynamicSizeDeclaration, FontWeight, HEX, INITIAL_MASK, Icon, Input, InputField, MarginProperty, Modal, Nullable, Paper, Progress, RGB, RGBA, Radio, RenderProps, ResponsiveMarginProps, ResponsiveSizeProps, withThemeScrollable as Scrollable, Section, Select, Separator, Size, SizeValue, Sizes, Spacer, Spinner, Switcher, Tab, Tabs, Tag, Text,
|
|
3306
|
+
export { ActionBtn, Alert, Amount, Anchor, Arrow, ArrowBadge, Avatar, Badge, BaseProps, Breakpoint, Button, COUNTRY_DATA, CSSColor, CSSGlobalValue, CSSUnit, CURRENCY_MAP, Checkbox, Color, ColorNames, ColorPaletteKey, ColorPaletteProps, ColorSchemaProps, CommonInterpolationProps, Container, ContextMenu, CurrencyCodes, DEFAULT_MASK, DynamicSizeDeclaration, FontWeight, HEX, INITIAL_MASK, Icon, Input, InputField, MarginProperty, Modal, Nullable, Paper, Progress, RGB, RGBA, Radio, RenderProps, ResponsiveMarginProps, ResponsiveSizeProps, withThemeScrollable as Scrollable, Section, Select, Separator, Size, SizeValue, Sizes, Spacer, Spinner, Switcher, Tab, Tabs, Tag, Text, Textarea, Theme, ThemeMode, ThemeName, ThemePreset, ThemeProvider, Tooltip, TypographyProps, adultDarkTheme, adultLightTheme, babyDarkTheme, babyLightTheme, baseInputStyle, buildMediaQuery, color, defaultIcons, desktopFirst, hexToRgbA, isHex, mobileFirst, motherDarkTheme, motherLightTheme, property, responsiveNamedProperty, responsiveProperty, screenL, screenM, screenMaxL, screenMaxM, screenMaxS, screenMaxXl, screenMaxXs, screenMaxXxs, screenMinL, screenMinM, screenMinS, screenMinXl, screenMinXs, screenRetina, screenS, screenXl, screenXs, teenDarkTheme, teenLightTheme, defaultTheme as theme, vAlign };
|