@gravity-ui/page-constructor 6.0.0-beta.1 → 6.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/build/cjs/blocks/Header/Header.js +1 -1
  2. package/build/cjs/blocks/Header/Header.js.map +1 -1
  3. package/build/cjs/components/BackLink/BackLink.js +5 -2
  4. package/build/cjs/components/BackLink/BackLink.js.map +1 -1
  5. package/build/cjs/components/BrandFooter/BrandFooter.css +21 -17
  6. package/build/cjs/components/BrandFooter/BrandFooter.js +1 -1
  7. package/build/cjs/components/BrandFooter/BrandFooter.js.map +1 -1
  8. package/build/cjs/components/Button/Button.js +2 -3
  9. package/build/cjs/components/Button/Button.js.map +1 -1
  10. package/build/cjs/models/constructor-items/blocks.d.ts +1 -1
  11. package/build/cjs/models/constructor-items/blocks.js.map +1 -1
  12. package/build/cjs/navigation/hooks/useActiveNavItem.d.ts +2 -2
  13. package/build/cjs/navigation/utils.d.ts +1 -1
  14. package/build/esm/blocks/Header/Header.js +1 -1
  15. package/build/esm/blocks/Header/Header.js.map +1 -1
  16. package/build/esm/components/BackLink/BackLink.js +5 -2
  17. package/build/esm/components/BackLink/BackLink.js.map +1 -1
  18. package/build/esm/components/BrandFooter/BrandFooter.css +21 -17
  19. package/build/esm/components/BrandFooter/BrandFooter.js +1 -1
  20. package/build/esm/components/BrandFooter/BrandFooter.js.map +1 -1
  21. package/build/esm/components/Button/Button.js +3 -4
  22. package/build/esm/components/Button/Button.js.map +1 -1
  23. package/build/esm/models/constructor-items/blocks.d.ts +1 -1
  24. package/build/esm/models/constructor-items/blocks.js.map +1 -1
  25. package/build/esm/navigation/hooks/useActiveNavItem.d.ts +2 -2
  26. package/build/esm/navigation/utils.d.ts +1 -1
  27. package/package.json +11 -6
  28. package/server/models/constructor-items/blocks.d.ts +1 -1
  29. package/widget/index.js +1 -1
@@ -47,7 +47,7 @@ const HeaderBlock = (props) => {
47
47
  offset,
48
48
  theme: textTheme,
49
49
  'vertical-offset': curVerticalOffset,
50
- }), children: (0, jsx_runtime_1.jsxs)(grid_1.Col, { sizes: titleSizes, className: b('content-inner'), children: [overtitle && ((0, jsx_runtime_1.jsx)("div", { className: b('overtitle'), children: (0, jsx_runtime_1.jsx)(components_1.HTML, { children: overtitle }) })), (0, jsx_runtime_1.jsxs)("h1", { className: b('title'), id: titleId, children: [status, renderTitle ? renderTitle(title) : (0, jsx_runtime_1.jsx)(components_1.HTML, { children: title })] }), description && ((0, jsx_runtime_1.jsx)("div", { className: b('description', { theme: textTheme }), children: (0, jsx_runtime_1.jsx)(YFMWrapper_1.default, { content: description, modifiers: {
50
+ }), children: (0, jsx_runtime_1.jsxs)(grid_1.Col, { sizes: titleSizes, className: b('content-inner'), children: [overtitle && ((0, jsx_runtime_1.jsx)("div", { className: b('overtitle'), children: typeof overtitle === 'string' ? ((0, jsx_runtime_1.jsx)(components_1.HTML, { children: overtitle })) : (overtitle) })), (0, jsx_runtime_1.jsxs)("h1", { className: b('title'), id: titleId, children: [status, renderTitle ? renderTitle(title) : (0, jsx_runtime_1.jsx)(components_1.HTML, { children: title })] }), description && ((0, jsx_runtime_1.jsx)("div", { className: b('description', { theme: textTheme }), children: (0, jsx_runtime_1.jsx)(YFMWrapper_1.default, { content: description, modifiers: {
51
51
  constructor: true,
52
52
  constructorTheme: textTheme,
53
53
  } }) })), buttons && ((0, jsx_runtime_1.jsx)("div", { className: b('buttons'), "data-qa": "header-buttons", children: buttons.map((button, index) => ((0, jsx_runtime_1.jsx)(components_1.RouterLink, { href: button.url, children: (0, jsx_runtime_1.jsx)(components_1.Button, Object.assign({ className: b('button'), size: "xl", extraProps: Object.assign({ 'aria-describedby': titleId }, button.extraProps) }, button), index) }, index))) })), children] }) }) }), hasRightSideImage && ((0, jsx_runtime_1.jsx)(components_1.Media, { className: b('media', { [curImageSize]: true }), videoClassName: b('video'), imageClassName: b('image'), video: videoThemed, image: imageThemed }))] }) })] })] }));
@@ -1 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,OAAO,EAAE,EAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAC,CAAC,EAC7C,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,WAAW,GACpB,CACL,IACC,GACJ,IACH,IACF,CACZ,CAAC;AACN,CAAC,CAAC;AA/HW,QAAA,WAAW,eA+HtB;AAEF,kBAAe,mBAAW,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\nimport * as React from 'react';\n\nimport {Button, HTML, Media, RouterLink} from '../../components';\nimport HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs/HeaderBreadcrumbs';\nimport {getMediaImage} from '../../components/Media/Image/utils';\nimport YFMWrapper from '../../components/YFMWrapper/YFMWrapper';\nimport {MobileContext} from '../../context/mobileContext';\nimport {useTheme} from '../../context/theme';\nimport {Col, Grid, Row} from '../../grid';\nimport {ClassNameProps, HeaderBlockBackground, HeaderBlockProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\n\nimport {getImageSize, getTitleSizes, titleWithImageSizes} from './utils';\nimport './Header.scss';\n\nconst b = block('header-block');\n\ntype HeaderBlockFullProps = HeaderBlockProps & ClassNameProps;\n\ninterface BackgroundProps {\n background: HeaderBlockBackground;\n isMobile: boolean;\n}\n\nconst Background = ({background, isMobile}: BackgroundProps) => {\n const {url, image, fullWidthMedia, video, color} = background;\n const imageObject = url ? getMediaImage(url) : image;\n const renderMedia = !isMobile || (typeof image === 'object' && 'mobile' in image);\n\n return (\n <div\n className={b('background', {media: true, 'full-width-media': fullWidthMedia})}\n style={{backgroundColor: color}}\n >\n {renderMedia && (\n <Media\n {...background}\n className={b('background-media')}\n imageClassName={b('image')}\n videoClassName={b('video')}\n isBackground={true}\n parallax={false}\n video={isMobile ? undefined : video}\n image={imageObject}\n />\n )}\n </div>\n );\n};\n\ninterface FullWidthBackgroundProps {\n background: HeaderBlockBackground;\n}\n\nconst FullWidthBackground = ({background}: FullWidthBackgroundProps) => (\n <div\n className={b('background', {['full-width']: true})}\n style={{backgroundColor: background?.color}}\n />\n);\n\nexport const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>) => {\n const {\n title,\n overtitle,\n description,\n buttons,\n image,\n video,\n width = 'm',\n imageSize,\n offset = 'default',\n background,\n theme: textTheme = 'light',\n verticalOffset = 'm',\n className,\n breadcrumbs,\n status,\n renderTitle,\n children,\n mediaView = 'full',\n } = props;\n const isMobile = React.useContext(MobileContext);\n const theme = useTheme();\n const hasRightSideImage = Boolean(image || video);\n const curImageSize = imageSize || getImageSize(width);\n const titleSizes = hasRightSideImage ? titleWithImageSizes(curImageSize) : getTitleSizes(width);\n let curVerticalOffset = verticalOffset;\n\n if (hasRightSideImage && !verticalOffset) {\n curVerticalOffset = 'm';\n }\n\n const backgroundThemed = background && getThemedValue(background, theme);\n const imageThemed = image && getThemedValue(image, theme);\n const videoThemed = video && getThemedValue(video, theme);\n const fullWidth = backgroundThemed?.fullWidth || backgroundThemed?.fullWidthMedia;\n const titleId = useUniqId();\n\n return (\n <header\n className={b(\n {\n ['has-media']: hasRightSideImage,\n ['full-width']: fullWidth,\n ['media-view']: mediaView,\n ['controls-view']: textTheme,\n },\n className,\n )}\n >\n {backgroundThemed && fullWidth && <FullWidthBackground background={backgroundThemed} />}\n {backgroundThemed && <Background background={backgroundThemed} isMobile={isMobile} />}\n <Grid containerClass={b('container-fluid')}>\n {breadcrumbs && (\n <Row className={b('breadcrumbs')}>\n <Col>\n <HeaderBreadcrumbs {...breadcrumbs} theme={textTheme} />\n </Col>\n </Row>\n )}\n <Row>\n <Col reset className={b('content-wrapper')}>\n <Row>\n <Col\n className={b('content', {\n offset,\n theme: textTheme,\n 'vertical-offset': curVerticalOffset,\n })}\n >\n <Col sizes={titleSizes} className={b('content-inner')}>\n {overtitle && (\n <div className={b('overtitle')}>\n <HTML>{overtitle}</HTML>\n </div>\n )}\n <h1 className={b('title')} id={titleId}>\n {status}\n {renderTitle ? renderTitle(title) : <HTML>{title}</HTML>}\n </h1>\n {description && (\n <div className={b('description', {theme: textTheme})}>\n <YFMWrapper\n content={description}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n </div>\n )}\n {buttons && (\n <div className={b('buttons')} data-qa=\"header-buttons\">\n {buttons.map((button, index) => (\n <RouterLink href={button.url} key={index}>\n <Button\n key={index}\n className={b('button')}\n size=\"xl\"\n extraProps={{\n 'aria-describedby': titleId,\n ...button.extraProps,\n }}\n {...button}\n />\n </RouterLink>\n ))}\n </div>\n )}\n {children}\n </Col>\n </Col>\n </Row>\n {hasRightSideImage && (\n <Media\n className={b('media', {[curImageSize]: true})}\n videoClassName={b('video')}\n imageClassName={b('image')}\n video={videoThemed}\n image={imageThemed}\n />\n )}\n </Col>\n </Row>\n </Grid>\n </header>\n );\n};\n\nexport default HeaderBlock;\n"]}
1
+ {"version":3,"file":"Header.js","sourceRoot":"../../../../src","sources":["blocks/Header/Header.tsx"],"names":[],"mappings":";;;;;AAAA,6CAA4C;AAC5C,qDAA+B;AAE/B,0DAAiE;AACjE,wHAAqF;AACrF,iEAAiE;AACjE,mGAAgE;AAChE,wEAA0D;AAC1D,wDAA6C;AAC7C,8CAA0C;AAE1C,gDAAkD;AAElD,sCAAyE;AAGzE,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAShC,MAAM,UAAU,GAAG,CAAC,EAAC,UAAU,EAAE,QAAQ,EAAkB,EAAE,EAAE;IAC3D,MAAM,EAAC,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAC,GAAG,UAAU,CAAC;IAC9D,MAAM,WAAW,GAAG,GAAG,CAAC,CAAC,CAAC,IAAA,qBAAa,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACrD,MAAM,WAAW,GAAG,CAAC,QAAQ,IAAI,CAAC,OAAO,KAAK,KAA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,uBAAC,oBAAU,IACP,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE;4DACP,WAAW,EAAE,IAAI;4DACjB,gBAAgB,EAAE,SAAS;yDAC9B,GACH,GACA,CACT,EACA,OAAO,IAAI,CACR,gCAAK,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,aAAU,gBAAgB,YACjD,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5B,uBAAC,uBAAU,IAAC,IAAI,EAAE,MAAM,CAAC,GAAG,YACxB,uBAAC,mBAAM,kBAEH,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,EACtB,IAAI,EAAC,IAAI,EACT,UAAU,kBACN,kBAAkB,EAAE,OAAO,IACxB,MAAM,CAAC,UAAU,KAEpB,MAAM,GAPL,KAAK,CAQZ,IAV6B,KAAK,CAW3B,CAChB,CAAC,GACA,CACT,EACA,QAAQ,IACP,GACJ,GACJ,EACL,iBAAiB,IAAI,CAClB,uBAAC,kBAAK,IACF,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAC,CAAC,EAC7C,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,WAAW,GACpB,CACL,IACC,GACJ,IACH,IACF,CACZ,CAAC;AACN,CAAC,CAAC;AAnIW,QAAA,WAAW,eAmItB;AAEF,kBAAe,mBAAW,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\nimport * as React from 'react';\n\nimport {Button, HTML, Media, RouterLink} from '../../components';\nimport HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs/HeaderBreadcrumbs';\nimport {getMediaImage} from '../../components/Media/Image/utils';\nimport YFMWrapper from '../../components/YFMWrapper/YFMWrapper';\nimport {MobileContext} from '../../context/mobileContext';\nimport {useTheme} from '../../context/theme';\nimport {Col, Grid, Row} from '../../grid';\nimport {ClassNameProps, HeaderBlockBackground, HeaderBlockProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\n\nimport {getImageSize, getTitleSizes, titleWithImageSizes} from './utils';\nimport './Header.scss';\n\nconst b = block('header-block');\n\ntype HeaderBlockFullProps = HeaderBlockProps & ClassNameProps;\n\ninterface BackgroundProps {\n background: HeaderBlockBackground;\n isMobile: boolean;\n}\n\nconst Background = ({background, isMobile}: BackgroundProps) => {\n const {url, image, fullWidthMedia, video, color} = background;\n const imageObject = url ? getMediaImage(url) : image;\n const renderMedia = !isMobile || (typeof image === 'object' && 'mobile' in image);\n\n return (\n <div\n className={b('background', {media: true, 'full-width-media': fullWidthMedia})}\n style={{backgroundColor: color}}\n >\n {renderMedia && (\n <Media\n {...background}\n className={b('background-media')}\n imageClassName={b('image')}\n videoClassName={b('video')}\n isBackground={true}\n parallax={false}\n video={isMobile ? undefined : video}\n image={imageObject}\n />\n )}\n </div>\n );\n};\n\ninterface FullWidthBackgroundProps {\n background: HeaderBlockBackground;\n}\n\nconst FullWidthBackground = ({background}: FullWidthBackgroundProps) => (\n <div\n className={b('background', {['full-width']: true})}\n style={{backgroundColor: background?.color}}\n />\n);\n\nexport const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>) => {\n const {\n title,\n overtitle,\n description,\n buttons,\n image,\n video,\n width = 'm',\n imageSize,\n offset = 'default',\n background,\n theme: textTheme = 'light',\n verticalOffset = 'm',\n className,\n breadcrumbs,\n status,\n renderTitle,\n children,\n mediaView = 'full',\n } = props;\n const isMobile = React.useContext(MobileContext);\n const theme = useTheme();\n const hasRightSideImage = Boolean(image || video);\n const curImageSize = imageSize || getImageSize(width);\n const titleSizes = hasRightSideImage ? titleWithImageSizes(curImageSize) : getTitleSizes(width);\n let curVerticalOffset = verticalOffset;\n\n if (hasRightSideImage && !verticalOffset) {\n curVerticalOffset = 'm';\n }\n\n const backgroundThemed = background && getThemedValue(background, theme);\n const imageThemed = image && getThemedValue(image, theme);\n const videoThemed = video && getThemedValue(video, theme);\n const fullWidth = backgroundThemed?.fullWidth || backgroundThemed?.fullWidthMedia;\n const titleId = useUniqId();\n\n return (\n <header\n className={b(\n {\n ['has-media']: hasRightSideImage,\n ['full-width']: fullWidth,\n ['media-view']: mediaView,\n ['controls-view']: textTheme,\n },\n className,\n )}\n >\n {backgroundThemed && fullWidth && <FullWidthBackground background={backgroundThemed} />}\n {backgroundThemed && <Background background={backgroundThemed} isMobile={isMobile} />}\n <Grid containerClass={b('container-fluid')}>\n {breadcrumbs && (\n <Row className={b('breadcrumbs')}>\n <Col>\n <HeaderBreadcrumbs {...breadcrumbs} theme={textTheme} />\n </Col>\n </Row>\n )}\n <Row>\n <Col reset className={b('content-wrapper')}>\n <Row>\n <Col\n className={b('content', {\n offset,\n theme: textTheme,\n 'vertical-offset': curVerticalOffset,\n })}\n >\n <Col sizes={titleSizes} className={b('content-inner')}>\n {overtitle && (\n <div className={b('overtitle')}>\n {typeof overtitle === 'string' ? (\n <HTML>{overtitle}</HTML>\n ) : (\n overtitle\n )}\n </div>\n )}\n <h1 className={b('title')} id={titleId}>\n {status}\n {renderTitle ? renderTitle(title) : <HTML>{title}</HTML>}\n </h1>\n {description && (\n <div className={b('description', {theme: textTheme})}>\n <YFMWrapper\n content={description}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n </div>\n )}\n {buttons && (\n <div className={b('buttons')} data-qa=\"header-buttons\">\n {buttons.map((button, index) => (\n <RouterLink href={button.url} key={index}>\n <Button\n key={index}\n className={b('button')}\n size=\"xl\"\n extraProps={{\n 'aria-describedby': titleId,\n ...button.extraProps,\n }}\n {...button}\n />\n </RouterLink>\n ))}\n </div>\n )}\n {children}\n </Col>\n </Col>\n </Row>\n {hasRightSideImage && (\n <Media\n className={b('media', {[curImageSize]: true})}\n videoClassName={b('video')}\n imageClassName={b('image')}\n video={videoThemed}\n image={imageThemed}\n />\n )}\n </Col>\n </Row>\n </Grid>\n </header>\n );\n};\n\nexport default HeaderBlock;\n"]}
@@ -28,7 +28,10 @@ function BackLink(props) {
28
28
  history.push({ pathname: url });
29
29
  }
30
30
  }, [handleAnalytics, history, onClick, url]);
31
- const buttonComponent = url && !shouldHandleBackAction ? 'a' : 'button';
32
- return ((0, jsx_runtime_1.jsxs)(uikit_1.Button, { className: className, view: theme === 'special' ? 'flat-contrast' : 'flat-secondary', size: size, href: shouldHandleBackAction ? undefined : url, onClick: shouldHandleBackAction ? backActionHandler : undefined, tabIndex: tabIndex, extraProps: extraProps, component: buttonComponent, children: [(0, jsx_runtime_1.jsx)(uikit_1.Icon, { data: icons_1.ArrowLeft, size: 20 }), (0, jsx_runtime_1.jsx)("span", { children: title })] }));
31
+ const buttonProps = {
32
+ href: shouldHandleBackAction ? undefined : url,
33
+ extraProps,
34
+ };
35
+ return ((0, jsx_runtime_1.jsxs)(uikit_1.Button, Object.assign({ className: className, view: theme === 'special' ? 'flat-contrast' : 'flat-secondary', size: size, onClick: shouldHandleBackAction ? backActionHandler : undefined, tabIndex: tabIndex }, buttonProps, { children: [(0, jsx_runtime_1.jsx)(uikit_1.Icon, { data: icons_1.ArrowLeft, size: 20 }), (0, jsx_runtime_1.jsx)("span", { children: title })] })));
33
36
  }
34
37
  //# sourceMappingURL=BackLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackLink.js","sourceRoot":"../../../../src","sources":["components/BackLink/BackLink.tsx"],"names":[],"mappings":";;AAsBA,2BAkDC;;;AAxED,qDAA+B;AAE/B,6CAA4C;AAC5C,6CAA2D;AAE3D,4EAA8D;AAC9D,gDAAyC;AACzC,kDAAyD;AAezD,SAAwB,QAAQ,CAAC,KAAoB;IACjD,MAAM,EAAC,OAAO,EAAC,GAAG,KAAK,CAAC,UAAU,CAAC,iCAAe,CAAC,CAAC;IACpD,MAAM,EACF,GAAG,EACH,KAAK,EACL,KAAK,GAAG,SAAS,EACjB,IAAI,GAAG,GAAG,EACV,SAAS,EACT,s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AI,EACnC,2CAAO,KAAK,GAAQ,IACf,CACZ,CAAC;AACN,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {ArrowLeft} from '@gravity-ui/icons';\nimport {Button, ButtonSize, Icon} from '@gravity-ui/uikit';\n\nimport {LocationContext} from '../../context/locationContext';\nimport {useAnalytics} from '../../hooks';\nimport {DefaultEventNames, Tabbable} from '../../models';\n\nexport type Theme = 'default' | 'special';\n\nexport interface BackLinkProps<T = HTMLElement> extends Tabbable {\n url: string;\n title: React.ReactNode;\n theme?: Theme;\n size?: ButtonSize;\n className?: string;\n shouldHandleBackAction?: boolean;\n onClick?: () => void;\n extraProps?: React.HTMLProps<T>;\n}\n\nexport default function BackLink(props: BackLinkProps) {\n const {history} = React.useContext(LocationContext);\n const {\n url,\n title,\n theme = 'default',\n size = 'l',\n className,\n shouldHandleBackAction = false,\n onClick,\n tabIndex,\n extraProps,\n } = props;\n const handleAnalytics = useAnalytics(DefaultEventNames.ShareButton, url);\n\n const backActionHandler = React.useCallback(async () => {\n handleAnalytics();\n\n if (!history) {\n return;\n }\n\n if (onClick) {\n onClick();\n }\n\n if (history.length > 1) {\n history.goBack();\n } else {\n history.push({pathname: url});\n }\n }, [handleAnalytics, history, onClick, url]);\n\n const buttonComponent = url && !shouldHandleBackAction ? 'a' : 'button';\n\n return (\n <Button\n className={className}\n view={theme === 'special' ? 'flat-contrast' : 'flat-secondary'}\n size={size}\n href={shouldHandleBackAction ? undefined : url}\n onClick={shouldHandleBackAction ? backActionHandler : undefined}\n tabIndex={tabIndex}\n extraProps={extraProps}\n component={buttonComponent}\n >\n <Icon data={ArrowLeft} size={20} />\n <span>{title}</span>\n </Button>\n );\n}\n"]}
1
+ {"version":3,"file":"BackLink.js","sourceRoot":"../../../../src","sources":["components/BackLink/BackLink.tsx"],"names":[],"mappings":";;AAsBA,2BAmDC;;;AAzED,qDAA+B;AAE/B,6CAA4C;AAC5C,6CAA4F;AAE5F,4EAA8D;AAC9D,gDAAyC;AACzC,kDAA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AC,SAAS,EAC/D,QAAQ,EAAE,QAAQ,IACd,WAAW,eAEf,uBAAC,YAAI,IAAC,IAAI,EAAE,iBAAS,EAAE,IAAI,EAAE,EAAE,GAAI,EACnC,2CAAO,KAAK,GAAQ,KACf,CACZ,CAAC;AACN,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {ArrowLeft} from '@gravity-ui/icons';\nimport {Button, ButtonSize, Icon, ButtonProps as UIKitButtonProps} from '@gravity-ui/uikit';\n\nimport {LocationContext} from '../../context/locationContext';\nimport {useAnalytics} from '../../hooks';\nimport {DefaultEventNames, Tabbable} from '../../models';\n\nexport type Theme = 'default' | 'special';\n\nexport interface BackLinkProps<T = HTMLElement> extends Tabbable {\n url: string;\n title: React.ReactNode;\n theme?: Theme;\n size?: ButtonSize;\n className?: string;\n shouldHandleBackAction?: boolean;\n onClick?: () => void;\n extraProps?: React.HTMLProps<T>;\n}\n\nexport default function BackLink(props: BackLinkProps) {\n const {history} = React.useContext(LocationContext);\n const {\n url,\n title,\n theme = 'default',\n size = 'l',\n className,\n shouldHandleBackAction = false,\n onClick,\n tabIndex,\n extraProps,\n } = props;\n const handleAnalytics = useAnalytics(DefaultEventNames.ShareButton, url);\n\n const backActionHandler = React.useCallback(async () => {\n handleAnalytics();\n\n if (!history) {\n return;\n }\n\n if (onClick) {\n onClick();\n }\n\n if (history.length > 1) {\n history.goBack();\n } else {\n history.push({pathname: url});\n }\n }, [handleAnalytics, history, onClick, url]);\n\n const buttonProps = {\n href: shouldHandleBackAction ? undefined : url,\n extraProps,\n } as UIKitButtonProps;\n\n return (\n <Button\n className={className}\n view={theme === 'special' ? 'flat-contrast' : 'flat-secondary'}\n size={size}\n onClick={shouldHandleBackAction ? backActionHandler : undefined}\n tabIndex={tabIndex}\n {...buttonProps}\n >\n <Icon data={ArrowLeft} size={20} />\n <span>{title}</span>\n </Button>\n );\n}\n"]}
@@ -12,8 +12,9 @@ unpredictable css rules order in build */
12
12
  width: 100%;
13
13
  height: 72px;
14
14
  margin-top: var(--header-height);
15
- color: var(--g-color-text-secondary);
16
- border-top: 1px solid var(--g-color-line-generic);
15
+ box-sizing: content-box;
16
+ border-top: 1px solid;
17
+ border-bottom: 1px solid transparent;
17
18
  transition: color 0.5s ease-out, border-color 0.5s ease-out;
18
19
  }
19
20
  .pc-brand-footer::after {
@@ -22,32 +23,38 @@ unpredictable css rules order in build */
22
23
  right: 0;
23
24
  left: 0;
24
25
  height: 1px;
26
+ background: linear-gradient(270deg, rgb(228, 106, 68) 0%, rgb(242, 159, 85) 46.62%, rgb(255, 212, 102) 100%);
25
27
  opacity: 0;
26
28
  transition: opacity 0.5s ease-out;
27
29
  content: "";
28
30
  }
29
- .pc-brand-footer:hover {
31
+ .pc-brand-footer_theme_light {
32
+ color: var(--g-color-text-secondary);
33
+ border-top-color: var(--g-color-private-black-200);
34
+ }
35
+ .pc-brand-footer_theme_light:hover {
30
36
  color: var(--g-color-text-primary);
31
- border-color: transparent;
37
+ border-top-color: transparent;
32
38
  }
33
- .pc-brand-footer:hover::after {
39
+ .pc-brand-footer_theme_light:hover::after {
34
40
  opacity: 1;
35
41
  }
36
- .pc-brand-footer_theme_light::after {
37
- background: linear-gradient(270deg, rgb(228, 106, 68) 0%, rgb(242, 159, 85) 46.62%, rgb(255, 212, 102) 100%);
42
+ .pc-brand-footer_theme_dark {
43
+ color: var(--g-color-private-white-700);
44
+ border-top-color: var(--g-color-private-white-100);
45
+ }
46
+ .pc-brand-footer_theme_dark:hover {
47
+ color: var(--g-color-private-white-1000-solid);
48
+ border-top-color: transparent;
38
49
  }
39
- .pc-brand-footer_theme_dark::after {
40
- background: linear-gradient(270deg, rgba(228, 106, 68, 0.6) 0%, rgba(242, 159, 85, 0.6) 46.62%, rgba(255, 212, 102, 0.6) 100%);
50
+ .pc-brand-footer_theme_dark:hover::after {
51
+ opacity: 0.6;
41
52
  }
42
53
  .pc-brand-footer__content {
43
54
  display: flex;
44
55
  align-items: center;
45
56
  justify-content: center;
46
57
  gap: 8px;
47
- padding-top: 1px;
48
- }
49
- .pc-brand-footer__text {
50
- align-self: flex-end;
51
58
  }
52
59
  .pc-brand-footer__brand-icon {
53
60
  display: flex;
@@ -78,9 +85,7 @@ unpredictable css rules order in build */
78
85
  font-size: var(--g-text-body-1-font-size);
79
86
  line-height: var(--g-text-body-1-line-height);
80
87
  height: 52px;
81
- }
82
- .pc-brand-footer__content {
83
- padding: 0;
88
+ border-bottom-width: 0;
84
89
  }
85
90
  .pc-brand-footer__brand-icon {
86
91
  width: 20px;
@@ -89,6 +94,5 @@ unpredictable css rules order in build */
89
94
  .pc-brand-footer__brand-name {
90
95
  width: 72px;
91
96
  height: 16px;
92
- margin-top: 0;
93
97
  }
94
98
  }
@@ -12,7 +12,7 @@ const i18n_1 = require("./i18n/index.js");
12
12
  const b = (0, utils_1.block)('brand-footer');
13
13
  const BrandFooter = ({ className }) => {
14
14
  const theme = (0, theme_1.useTheme)();
15
- return ((0, jsx_runtime_1.jsx)(uikit_1.Link, { className: b({ theme }, className), href: "https://gravity-ui.com", children: (0, jsx_runtime_1.jsxs)("div", { className: b('content'), children: [(0, jsx_runtime_1.jsx)("span", { className: b('text'), children: (0, i18n_1.i18n)('created-on') }), (0, jsx_runtime_1.jsx)("div", { className: b('brand-icon'), children: theme === models_1.Theme.Light ? (0, jsx_runtime_1.jsx)(BrandIconLight_1.BrandIconLight, {}) : (0, jsx_runtime_1.jsx)(BrandIconDark_1.BrandIconDark, {}) }), (0, jsx_runtime_1.jsx)("div", { className: b('brand-name'), children: (0, jsx_runtime_1.jsx)(BrandName_1.BrandName, {}) })] }) }));
15
+ return ((0, jsx_runtime_1.jsx)(uikit_1.Link, { className: b({ theme }, className), href: "https://gravity-ui.com", children: (0, jsx_runtime_1.jsxs)("div", { className: b('content'), children: [(0, jsx_runtime_1.jsx)("span", { children: (0, i18n_1.i18n)('created-on') }), (0, jsx_runtime_1.jsx)("div", { className: b('brand-icon'), children: theme === models_1.Theme.Light ? (0, jsx_runtime_1.jsx)(BrandIconLight_1.BrandIconLight, {}) : (0, jsx_runtime_1.jsx)(BrandIconDark_1.BrandIconDark, {}) }), (0, jsx_runtime_1.jsx)("div", { className: b('brand-name'), children: (0, jsx_runtime_1.jsx)(BrandName_1.BrandName, {}) })] }) }));
16
16
  };
17
17
  exports.default = BrandFooter;
18
18
  //# sourceMappingURL=BrandFooter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrandFooter.js","sourceRoot":"../../../../src","sources":["components/BrandFooter/BrandFooter.tsx"],"names":[],"mappings":";;;AAAA,6CAAuC;AAEvC,wDAA6C;AAC7C,gEAAwD;AACxD,kEAA0D;AAC1D,wDAAgD;AAEhD,kDAAmC;AACnC,gDAAkC;AAElC,0CAA4B;AAI5B,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAEhC,MAAM,WAAW,GAAG,CAAC,EAAC,SAAS,EAAiB,EAAE,EAAE;IAChD,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IAEzB,OAAO,CACH,uBAAC,YAAI,IAAC,SAAS,EAAE,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,SAAS,CAAC,EAAE,IAAI,EAAC,wBAAwB,YACjE,iCAAK,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,aACxB,iCAAM,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YAAG,IAAA,WAAI,EAAC,YAAY,CAAC,GAAQ,EACvD,gCAAK,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,YAC1B,KAAK,KAAK,cAAK,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAC,+BAAc,KAAG,CAAC,CAAC,CAAC,uBAAC,6BAAa,KAAG,GAC7D,EACN,gCAAK,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,YAC3B,uBAAC,qBAAS,KAAG,GACX,IACJ,GACH,CACV,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import {Link} from '@gravity-ui/uikit';\n\nimport {useTheme} from '../../context/theme';\nimport {BrandIconDark} from '../../icons/BrandIconDark';\nimport {BrandIconLight} from '../../icons/BrandIconLight';\nimport {BrandName} from '../../icons/BrandName';\nimport type {ClassNameProps} from '../../models';\nimport {Theme} from '../../models';\nimport {block} from '../../utils';\n\nimport {i18n} from './i18n';\n\nimport './BrandFooter.scss';\n\nconst b = block('brand-footer');\n\nconst BrandFooter = ({className}: ClassNameProps) => {\n const theme = useTheme();\n\n return (\n <Link className={b({theme}, className)} href=\"https://gravity-ui.com\">\n <div className={b('content')}>\n <span className={b('text')}>{i18n('created-on')}</span>\n <div className={b('brand-icon')}>\n {theme === Theme.Light ? <BrandIconLight /> : <BrandIconDark />}\n </div>\n <div className={b('brand-name')}>\n <BrandName />\n </div>\n </div>\n </Link>\n );\n};\n\nexport default BrandFooter;\n"]}
1
+ {"version":3,"file":"BrandFooter.js","sourceRoot":"../../../../src","sources":["components/BrandFooter/BrandFooter.tsx"],"names":[],"mappings":";;;AAAA,6CAAuC;AAEvC,wDAA6C;AAC7C,gEAAwD;AACxD,kEAA0D;AAC1D,wDAAgD;AAEhD,kDAAmC;AACnC,gDAAkC;AAElC,0CAA4B;AAI5B,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAEhC,MAAM,WAAW,GAAG,CAAC,EAAC,SAAS,EAAiB,EAAE,EAAE;IAChD,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IAEzB,OAAO,CACH,uBAAC,YAAI,IAAC,SAAS,EAAE,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,SAAS,CAAC,EAAE,IAAI,EAAC,wBAAwB,YACjE,iCAAK,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,aACxB,2CAAO,IAAA,WAAI,EAAC,YAAY,CAAC,GAAQ,EACjC,gCAAK,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,YAC1B,KAAK,KAAK,cAAK,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAC,+BAAc,KAAG,CAAC,CAAC,CAAC,uBAAC,6BAAa,KAAG,GAC7D,EACN,gCAAK,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,YAC3B,uBAAC,qBAAS,KAAG,GACX,IACJ,GACH,CACV,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import {Link} from '@gravity-ui/uikit';\n\nimport {useTheme} from '../../context/theme';\nimport {BrandIconDark} from '../../icons/BrandIconDark';\nimport {BrandIconLight} from '../../icons/BrandIconLight';\nimport {BrandName} from '../../icons/BrandName';\nimport type {ClassNameProps} from '../../models';\nimport {Theme} from '../../models';\nimport {block} from '../../utils';\n\nimport {i18n} from './i18n';\n\nimport './BrandFooter.scss';\n\nconst b = block('brand-footer');\n\nconst BrandFooter = ({className}: ClassNameProps) => {\n const theme = useTheme();\n\n return (\n <Link className={b({theme}, className)} href=\"https://gravity-ui.com\">\n <div className={b('content')}>\n <span>{i18n('created-on')}</span>\n <div className={b('brand-icon')}>\n {theme === Theme.Light ? <BrandIconLight /> : <BrandIconDark />}\n </div>\n <div className={b('brand-name')}>\n <BrandName />\n </div>\n </div>\n </Link>\n );\n};\n\nexport default BrandFooter;\n"]}
@@ -32,7 +32,7 @@ const Button = (props) => {
32
32
  const buttonClass = img
33
33
  ? b(Object.assign({ position: buttonImg.position }, buttonModifiers), className)
34
34
  : b(Object.assign({}, buttonModifiers), className);
35
- const buttonProps = Object.assign(Object.assign({}, rest), { onClick });
35
+ const buttonProps = Object.assign(Object.assign({}, rest), { href: url ? (0, utils_1.setUrlTld)(url, tld) : undefined, onClick });
36
36
  if (theme === 'app-store' || theme === 'google-play') {
37
37
  const platform = theme === 'app-store' ? uikit_1.Platform.IOS : uikit_1.Platform.ANDROID;
38
38
  return (0, jsx_runtime_1.jsx)(components_1.StoreBadge, { className: buttonClass, platform: platform, href: url });
@@ -44,8 +44,7 @@ const Button = (props) => {
44
44
  image = undefined;
45
45
  }
46
46
  const buttonTheme = theme === 'scale' ? 'accent' : theme;
47
- const buttonComponent = url ? 'a' : 'button';
48
- return ((0, jsx_runtime_1.jsxs)(uikit_1.Button, Object.assign({ className: buttonClass, view: (0, utils_2.toCommonView)(buttonTheme), size: (0, utils_2.toCommonSize)(size), href: url ? (0, utils_1.setUrlTld)(url, tld) : undefined, title: urlTitle, width: width, component: buttonComponent }, buttonProps, { children: [icon && buttonImg.position === 'left' ? icon : null, (0, jsx_runtime_1.jsxs)("span", { className: b('content'), children: [image && buttonImg.position === 'left' ? image : null, (0, jsx_runtime_1.jsx)("span", { className: b('text'), children: text }), image && buttonImg.position === 'right' ? image : null] }), icon && buttonImg.position === 'right' ? icon : null] })));
47
+ return ((0, jsx_runtime_1.jsxs)(uikit_1.Button, Object.assign({ className: buttonClass, view: (0, utils_2.toCommonView)(buttonTheme), size: (0, utils_2.toCommonSize)(size), title: urlTitle, width: width }, buttonProps, { children: [icon && buttonImg.position === 'left' ? icon : null, (0, jsx_runtime_1.jsxs)("span", { className: b('content'), children: [image && buttonImg.position === 'left' ? image : null, (0, jsx_runtime_1.jsx)("span", { className: b('text'), children: text }), image && buttonImg.position === 'right' ? image : null] }), icon && buttonImg.position === 'right' ? icon : null] })));
49
48
  };
50
49
  exports.default = Button;
51
50
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"../../../../src","sources":["components/Button/Button.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,uDAAkD;AAClD,6CAAyE;AAEzE,gFAAwE;AACxE,gDAAyC;AACzC,gDAAmC;AACnC,kDAAqF;AACrF,gDAA6C;AAE7C,0CAA4B;AAC5B,sCAA2F;AAU3F,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAEhC,sCAAsC;AACtC,MAAM,MAAM,GAAG,CAAC,KAAkB,EAAE,EAAE;IAClC,MAAM,EAAC,GAAG,EAAC,GAAG,KAAK,CAAC,UAAU,CAA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,EAC3C,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,eAAe,IACtB,WAAW,eAEd,IAAI,IAAI,SAAS,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EACpD,kCAAM,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,aACxB,KAAK,IAAI,SAAS,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EACtD,iCAAM,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YAAG,IAAI,GAAQ,EACxC,KAAK,IAAI,SAAS,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IACpD,EACN,IAAI,IAAI,SAAS,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAC1C,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,MAAM,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {StoreBadge} from '@gravity-ui/components';\nimport {Button as CommonButton, Icon, Platform} from '@gravity-ui/uikit';\n\nimport {LocaleContext} from '../../context/localeContext/localeContext';\nimport {useAnalytics} from '../../hooks';\nimport {Github} from '../../icons';\nimport {ButtonProps as ButtonParams, DefaultEventNames, QAProps} from '../../models';\nimport {block, setUrlTld} from '../../utils';\n\nimport {i18n} from './i18n';\nimport {ICON_QA, OldButtonSize, OldButtonTheme, toCommonSize, toCommonView} from './utils';\n\nimport './Button.scss';\n\nexport interface ButtonProps extends Omit<ButtonParams, 'url'>, QAProps {\n className?: string;\n url?: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n}\n\nconst b = block('button-block');\n\n// eslint-disable-next-line complexity\nconst Button = (props: ButtonProps) => {\n const {tld} = React.useContext(LocaleContext);\n const {\n className,\n analyticsEvents,\n size = 'l',\n theme = 'normal',\n url,\n urlTitle,\n img,\n onClick: onClickOrigin,\n text,\n width,\n ...rest\n } = props;\n const defaultImgPosition = 'left';\n const handleAnalytics = useAnalytics(DefaultEventNames.Button, url);\n const onClick = React.useCallback(\n (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n handleAnalytics(analyticsEvents);\n\n if (onClickOrigin) {\n onClickOrigin(e);\n }\n },\n [handleAnalytics, analyticsEvents, onClickOrigin],\n );\n\n const buttonModifiers = {size, theme, width};\n\n const buttonImg =\n img instanceof Object\n ? {url: img.url, position: img.position || defaultImgPosition, alt: img.alt}\n : {url: img, position: defaultImgPosition};\n\n const buttonClass = img\n ? b({position: buttonImg.position, ...buttonModifiers}, className)\n : b({...buttonModifiers}, className);\n\n const buttonProps = {\n ...rest,\n onClick,\n };\n\n if (theme === 'app-store' || theme === 'google-play') {\n const platform = theme === 'app-store' ? Platform.IOS : Platform.ANDROID;\n\n return <StoreBadge className={buttonClass} platform={platform} href={url as string} />;\n }\n\n let icon;\n let image = img && (\n <img className={b('image')} src={buttonImg.url} alt={buttonImg.alt || i18n('image-alt')} />\n );\n\n if (theme === 'github') {\n icon = <Icon className={b('icon')} data={Github} size={24} qa={ICON_QA} />;\n image = undefined;\n }\n\n const buttonTheme = theme === 'scale' ? 'accent' : theme;\n\n const buttonComponent = url ? 'a' : 'button';\n\n return (\n <CommonButton\n className={buttonClass}\n view={toCommonView(buttonTheme as OldButtonTheme)}\n size={toCommonSize(size as OldButtonSize)}\n href={url ? setUrlTld(url, tld) : undefined}\n title={urlTitle}\n width={width}\n component={buttonComponent}\n {...buttonProps}\n >\n {icon && buttonImg.position === 'left' ? icon : null}\n <span className={b('content')}>\n {image && buttonImg.position === 'left' ? image : null}\n <span className={b('text')}>{text}</span>\n {image && buttonImg.position === 'right' ? image : null}\n </span>\n {icon && buttonImg.position === 'right' ? icon : null}\n </CommonButton>\n );\n};\n\nexport default Button;\n"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":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AC3E,KAAK,GAAG,SAAS,CAAC;IACtB,CAAC;IAED,MAAM,WAAW,GAAG,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;IAEzD,OAAO,CACH,wBAAC,cAAY,kBACT,SAAS,EAAE,WAAW,EACtB,IAAI,EAAE,IAAA,oBAAY,EAAC,WAA6B,CAAC,EACjD,IAAI,EAAE,IAAA,oBAAY,EAAC,IAAqB,CAAC,EACzC,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,KAAK,IACP,WAAgC,eAEpC,IAAI,IAAI,SAAS,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EACpD,kCAAM,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,aACxB,KAAK,IAAI,SAAS,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EACtD,iCAAM,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YAAG,IAAI,GAAQ,EACxC,KAAK,IAAI,SAAS,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IACpD,EACN,IAAI,IAAI,SAAS,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAC1C,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,MAAM,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {StoreBadge} from '@gravity-ui/components';\nimport {\n Button as CommonButton,\n Icon,\n Platform,\n ButtonProps as UIKitButtonProps,\n} from '@gravity-ui/uikit';\n\nimport {LocaleContext} from '../../context/localeContext/localeContext';\nimport {useAnalytics} from '../../hooks';\nimport {Github} from '../../icons';\nimport {ButtonProps as ButtonParams, DefaultEventNames, QAProps} from '../../models';\nimport {block, setUrlTld} from '../../utils';\n\nimport {i18n} from './i18n';\nimport {ICON_QA, OldButtonSize, OldButtonTheme, toCommonSize, toCommonView} from './utils';\n\nimport './Button.scss';\n\nexport interface ButtonProps extends Omit<ButtonParams, 'url'>, QAProps {\n className?: string;\n url?: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n}\n\nconst b = block('button-block');\n\n// eslint-disable-next-line complexity\nconst Button = (props: ButtonProps) => {\n const {tld} = React.useContext(LocaleContext);\n const {\n className,\n analyticsEvents,\n size = 'l',\n theme = 'normal',\n url,\n urlTitle,\n img,\n onClick: onClickOrigin,\n text,\n width,\n ...rest\n } = props;\n const defaultImgPosition = 'left';\n const handleAnalytics = useAnalytics(DefaultEventNames.Button, url);\n const onClick = React.useCallback(\n (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n handleAnalytics(analyticsEvents);\n\n if (onClickOrigin) {\n onClickOrigin(e);\n }\n },\n [handleAnalytics, analyticsEvents, onClickOrigin],\n );\n\n const buttonModifiers = {size, theme, width};\n\n const buttonImg =\n img instanceof Object\n ? {url: img.url, position: img.position || defaultImgPosition, alt: img.alt}\n : {url: img, position: defaultImgPosition};\n\n const buttonClass = img\n ? b({position: buttonImg.position, ...buttonModifiers}, className)\n : b({...buttonModifiers}, className);\n\n const buttonProps = {\n ...rest,\n href: url ? setUrlTld(url, tld) : undefined,\n onClick,\n };\n\n if (theme === 'app-store' || theme === 'google-play') {\n const platform = theme === 'app-store' ? Platform.IOS : Platform.ANDROID;\n\n return <StoreBadge className={buttonClass} platform={platform} href={url as string} />;\n }\n\n let icon;\n let image = img && (\n <img className={b('image')} src={buttonImg.url} alt={buttonImg.alt || i18n('image-alt')} />\n );\n\n if (theme === 'github') {\n icon = <Icon className={b('icon')} data={Github} size={24} qa={ICON_QA} />;\n image = undefined;\n }\n\n const buttonTheme = theme === 'scale' ? 'accent' : theme;\n\n return (\n <CommonButton\n className={buttonClass}\n view={toCommonView(buttonTheme as OldButtonTheme)}\n size={toCommonSize(size as OldButtonSize)}\n title={urlTitle}\n width={width}\n {...(buttonProps as UIKitButtonProps)}\n >\n {icon && buttonImg.position === 'left' ? icon : null}\n <span className={b('content')}>\n {image && buttonImg.position === 'left' ? image : null}\n <span className={b('text')}>{text}</span>\n {image && buttonImg.position === 'right' ? image : null}\n </span>\n {icon && buttonImg.position === 'right' ? icon : null}\n </CommonButton>\n );\n};\n\nexport default Button;\n"]}
@@ -109,7 +109,7 @@ export interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, P
109
109
  export type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;
110
110
  export interface HeaderBlockProps {
111
111
  title: string;
112
- overtitle?: string;
112
+ overtitle?: string | JSX.Element;
113
113
  description?: string;
114
114
  buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];
115
115
  width?: HeaderWidth;
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":";;;AA2CA,IAAY,SAsBX;AAtBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,uCAA0B,CAAA;IAC1B,kDAAqC,CAAA;IACrC,wDAA2C,CAAA;IAC3C,uCAA0B,CAAA;IAC1B,mCAAsB,CAAA;IACtB,yCAA4B,CAAA;IAC5B,qCAAwB,CAAA;IACxB,WAAW;IACX,gDAAmC,CAAA;AACvC,CAAC,EAtBW,SAAS,yBAAT,SAAS,QAsBpB;AAEY,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACtC,QAAA,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,qCAArB,qBAAqB,QAKhC;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;AAC9B,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AA8SD,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAOD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n // unstable\n SliderNewBlock = 'slider-new-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderNewProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string;\n description?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n mediaView?: MediaView;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {\n title: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'title' | 'theme' | 'centered'> {\n title: string;\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: MapProps;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n description?: string;\n tags: FilterTag[];\n items: FilterItem[];\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url: string;\n text: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: ContentBlockProps;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = React.FC<React.SVGProps<SVGSVGElement>>;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon: ThemeSupporting<ImageProps | SVGIcon>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: ButtonProps[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<BackgroundImageProps>;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\n// unstable block models\nexport type SliderNewBlockModel = {\n type: BlockType.SliderNewBlock;\n} & SliderNewProps;\n\ntype BlockModels =\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel;\n\ntype UnstableBlockModels = SliderNewBlockModel;\n\nexport type Block = (BlockModels | UnstableBlockModels) & BlockBaseProps;\n"]}
1
+ {"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":";;;AA2CA,IAAY,SAsBX;AAtBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,uCAA0B,CAAA;IAC1B,kDAAqC,CAAA;IACrC,wDAA2C,CAAA;IAC3C,uCAA0B,CAAA;IAC1B,mCAAsB,CAAA;IACtB,yCAA4B,CAAA;IAC5B,qCAAwB,CAAA;IACxB,WAAW;IACX,gDAAmC,CAAA;AACvC,CAAC,EAtBW,SAAS,yBAAT,SAAS,QAsBpB;AAEY,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACtC,QAAA,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,qCAArB,qBAAqB,QAKhC;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;AAC9B,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AA8SD,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAOD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n // unstable\n SliderNewBlock = 'slider-new-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderNewProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string | JSX.Element;\n description?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n mediaView?: MediaView;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {\n title: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'title' | 'theme' | 'centered'> {\n title: string;\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: MapProps;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n description?: string;\n tags: FilterTag[];\n items: FilterItem[];\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url: string;\n text: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: ContentBlockProps;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = React.FC<React.SVGProps<SVGSVGElement>>;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon: ThemeSupporting<ImageProps | SVGIcon>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: ButtonProps[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<BackgroundImageProps>;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\n// unstable block models\nexport type SliderNewBlockModel = {\n type: BlockType.SliderNewBlock;\n} & SliderNewProps;\n\ntype BlockModels =\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel;\n\ntype UnstableBlockModels = SliderNewBlockModel;\n\nexport type Block = (BlockModels | UnstableBlockModels) & BlockBaseProps;\n"]}
@@ -23,7 +23,7 @@ declare const useActiveNavItem: (iconSize: number, leftItems: NavigationItemMode
23
23
  analyticsEvents?: import("../../models/index.js").AnalyticsEventsProp;
24
24
  size?: import("@gravity-ui/uikit").ButtonSize | undefined;
25
25
  width?: import("@gravity-ui/uikit").ButtonWidth | undefined;
26
- extraProps?: React.ButtonHTMLAttributes<HTMLButtonElement> | Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> | React.AnchorHTMLAttributes<HTMLAnchorElement> | undefined;
26
+ extraProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | React.ButtonHTMLAttributes<HTMLButtonElement> | undefined;
27
27
  } | {
28
28
  type: import("../../models/index.js").NavigationItemType.Dropdown;
29
29
  items: import("../../models/index.js").NavigationLinkItem[];
@@ -55,7 +55,7 @@ declare const useActiveNavItem: (iconSize: number, leftItems: NavigationItemMode
55
55
  analyticsEvents?: import("../../models/index.js").AnalyticsEventsProp;
56
56
  size?: import("@gravity-ui/uikit").ButtonSize | undefined;
57
57
  width?: import("@gravity-ui/uikit").ButtonWidth | undefined;
58
- extraProps?: React.ButtonHTMLAttributes<HTMLButtonElement> | Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> | React.AnchorHTMLAttributes<HTMLAnchorElement> | undefined;
58
+ extraProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | React.ButtonHTMLAttributes<HTMLButtonElement> | undefined;
59
59
  } | {
60
60
  type: import("../../models/index.js").NavigationItemType.Dropdown;
61
61
  items: import("../../models/index.js").NavigationLinkItem[];
@@ -29,7 +29,7 @@ export declare function getNavigationItemWithIconSize(iconSize?: number): (item:
29
29
  analyticsEvents?: import("../models/index.js").AnalyticsEventsProp;
30
30
  size?: import("@gravity-ui/uikit").ButtonSize | undefined;
31
31
  width?: import("@gravity-ui/uikit").ButtonWidth | undefined;
32
- extraProps?: React.ButtonHTMLAttributes<HTMLButtonElement> | Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> | React.AnchorHTMLAttributes<HTMLAnchorElement> | undefined;
32
+ extraProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | React.ButtonHTMLAttributes<HTMLButtonElement> | undefined;
33
33
  } | {
34
34
  type: NavigationItemType.Dropdown;
35
35
  items: NavigationLinkItem[];
@@ -44,7 +44,7 @@ export const HeaderBlock = (props) => {
44
44
  offset,
45
45
  theme: textTheme,
46
46
  'vertical-offset': curVerticalOffset,
47
- }), children: _jsxs(Col, { sizes: titleSizes, className: b('content-inner'), children: [overtitle && (_jsx("div", { className: b('overtitle'), children: _jsx(HTML, { children: overtitle }) })), _jsxs("h1", { className: b('title'), id: titleId, children: [status, renderTitle ? renderTitle(title) : _jsx(HTML, { children: title })] }), description && (_jsx("div", { className: b('description', { theme: textTheme }), children: _jsx(YFMWrapper, { content: description, modifiers: {
47
+ }), children: _jsxs(Col, { sizes: titleSizes, className: b('content-inner'), children: [overtitle && (_jsx("div", { className: b('overtitle'), children: typeof overtitle === 'string' ? (_jsx(HTML, { children: overtitle })) : (overtitle) })), _jsxs("h1", { className: b('title'), id: titleId, children: [status, renderTitle ? renderTitle(title) : _jsx(HTML, { children: title })] }), description && (_jsx("div", { className: b('description', { theme: textTheme }), children: _jsx(YFMWrapper, { content: description, modifiers: {
48
48
  constructor: true,
49
49
  constructorTheme: textTheme,
50
50
  } }) })), buttons && (_jsx("div", { className: b('buttons'), "data-qa": "header-buttons", children: buttons.map((button, index) => (_jsx(RouterLink, { href: button.url, children: _jsx(Button, Object.assign({ className: b('button'), size: "xl", extraProps: Object.assign({ 'aria-describedby': titleId }, button.extraProps) }, button), index) }, index))) })), children] }) }) }), hasRightSideImage && (_jsx(Media, { className: b('media', { [curImageSize]: true }), videoClassName: b('video'), imageClassName: b('image'), video: videoThemed, image: imageThemed }))] }) })] })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"Header.js","sourceRoot":"../../../../src","sources":["blocks/Header/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAC,kCAAyB;AACjE,OAAO,iBAAiB,gEAA6D;AACrF,OAAO,EAAC,aAAa,EAAC,8CAA2C;AACjE,OAAO,UAAU,kDAA+C;AAChE,OAAO,EAAC,aAAa,EAAC,6CAAoC;AAC1D,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAC7C,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAC,4BAAmB;AAE1C,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,6BAAoB;AAElD,OAAO,EAAC,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAC,mBAAgB;AACzE,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAShC,MAAM,UAAU,GAAG,CAAC,EAAC,UAAU,EAAE,QAAQ,EAAkB,EAAE,EAAE;IAC3D,MAAM,EAAC,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAC,GAAG,UAAU,CAAC;IAC9D,MAAM,WAAW,GAAG,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACrD,MAAM,WAAW,GAAG,CAAC,QA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ACA,OAAO,IAAI,CACR,cAAK,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,aAAU,gBAAgB,YACjD,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5B,KAAC,UAAU,IAAC,IAAI,EAAE,MAAM,CAAC,GAAG,YACxB,KAAC,MAAM,kBAEH,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,EACtB,IAAI,EAAC,IAAI,EACT,UAAU,kBACN,kBAAkB,EAAE,OAAO,IACxB,MAAM,CAAC,UAAU,KAEpB,MAAM,GAPL,KAAK,CAQZ,IAV6B,KAAK,CAW3B,CAChB,CAAC,GACA,CACT,EACA,QAAQ,IACP,GACJ,GACJ,EACL,iBAAiB,IAAI,CAClB,KAAC,KAAK,IACF,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAC,CAAC,EAC7C,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,WAAW,GACpB,CACL,IACC,GACJ,IACH,IACF,CACZ,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\nimport * as React from 'react';\n\nimport {Button, HTML, Media, RouterLink} from '../../components';\nimport HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs/HeaderBreadcrumbs';\nimport {getMediaImage} from '../../components/Media/Image/utils';\nimport YFMWrapper from '../../components/YFMWrapper/YFMWrapper';\nimport {MobileContext} from '../../context/mobileContext';\nimport {useTheme} from '../../context/theme';\nimport {Col, Grid, Row} from '../../grid';\nimport {ClassNameProps, HeaderBlockBackground, HeaderBlockProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\n\nimport {getImageSize, getTitleSizes, titleWithImageSizes} from './utils';\nimport './Header.scss';\n\nconst b = block('header-block');\n\ntype HeaderBlockFullProps = HeaderBlockProps & ClassNameProps;\n\ninterface BackgroundProps {\n background: HeaderBlockBackground;\n isMobile: boolean;\n}\n\nconst Background = ({background, isMobile}: BackgroundProps) => {\n const {url, image, fullWidthMedia, video, color} = background;\n const imageObject = url ? getMediaImage(url) : image;\n const renderMedia = !isMobile || (typeof image === 'object' && 'mobile' in image);\n\n return (\n <div\n className={b('background', {media: true, 'full-width-media': fullWidthMedia})}\n style={{backgroundColor: color}}\n >\n {renderMedia && (\n <Media\n {...background}\n className={b('background-media')}\n imageClassName={b('image')}\n videoClassName={b('video')}\n isBackground={true}\n parallax={false}\n video={isMobile ? undefined : video}\n image={imageObject}\n />\n )}\n </div>\n );\n};\n\ninterface FullWidthBackgroundProps {\n background: HeaderBlockBackground;\n}\n\nconst FullWidthBackground = ({background}: FullWidthBackgroundProps) => (\n <div\n className={b('background', {['full-width']: true})}\n style={{backgroundColor: background?.color}}\n />\n);\n\nexport const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>) => {\n const {\n title,\n overtitle,\n description,\n buttons,\n image,\n video,\n width = 'm',\n imageSize,\n offset = 'default',\n background,\n theme: textTheme = 'light',\n verticalOffset = 'm',\n className,\n breadcrumbs,\n status,\n renderTitle,\n children,\n mediaView = 'full',\n } = props;\n const isMobile = React.useContext(MobileContext);\n const theme = useTheme();\n const hasRightSideImage = Boolean(image || video);\n const curImageSize = imageSize || getImageSize(width);\n const titleSizes = hasRightSideImage ? titleWithImageSizes(curImageSize) : getTitleSizes(width);\n let curVerticalOffset = verticalOffset;\n\n if (hasRightSideImage && !verticalOffset) {\n curVerticalOffset = 'm';\n }\n\n const backgroundThemed = background && getThemedValue(background, theme);\n const imageThemed = image && getThemedValue(image, theme);\n const videoThemed = video && getThemedValue(video, theme);\n const fullWidth = backgroundThemed?.fullWidth || backgroundThemed?.fullWidthMedia;\n const titleId = useUniqId();\n\n return (\n <header\n className={b(\n {\n ['has-media']: hasRightSideImage,\n ['full-width']: fullWidth,\n ['media-view']: mediaView,\n ['controls-view']: textTheme,\n },\n className,\n )}\n >\n {backgroundThemed && fullWidth && <FullWidthBackground background={backgroundThemed} />}\n {backgroundThemed && <Background background={backgroundThemed} isMobile={isMobile} />}\n <Grid containerClass={b('container-fluid')}>\n {breadcrumbs && (\n <Row className={b('breadcrumbs')}>\n <Col>\n <HeaderBreadcrumbs {...breadcrumbs} theme={textTheme} />\n </Col>\n </Row>\n )}\n <Row>\n <Col reset className={b('content-wrapper')}>\n <Row>\n <Col\n className={b('content', {\n offset,\n theme: textTheme,\n 'vertical-offset': curVerticalOffset,\n })}\n >\n <Col sizes={titleSizes} className={b('content-inner')}>\n {overtitle && (\n <div className={b('overtitle')}>\n <HTML>{overtitle}</HTML>\n </div>\n )}\n <h1 className={b('title')} id={titleId}>\n {status}\n {renderTitle ? renderTitle(title) : <HTML>{title}</HTML>}\n </h1>\n {description && (\n <div className={b('description', {theme: textTheme})}>\n <YFMWrapper\n content={description}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n </div>\n )}\n {buttons && (\n <div className={b('buttons')} data-qa=\"header-buttons\">\n {buttons.map((button, index) => (\n <RouterLink href={button.url} key={index}>\n <Button\n key={index}\n className={b('button')}\n size=\"xl\"\n extraProps={{\n 'aria-describedby': titleId,\n ...button.extraProps,\n }}\n {...button}\n />\n </RouterLink>\n ))}\n </div>\n )}\n {children}\n </Col>\n </Col>\n </Row>\n {hasRightSideImage && (\n <Media\n className={b('media', {[curImageSize]: true})}\n videoClassName={b('video')}\n imageClassName={b('image')}\n video={videoThemed}\n image={imageThemed}\n />\n )}\n </Col>\n </Row>\n </Grid>\n </header>\n );\n};\n\nexport default HeaderBlock;\n"]}
1
+ {"version":3,"file":"Header.js","sourceRoot":"../../../../src","sources":["blocks/Header/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,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AE,OAAO,IACxB,MAAM,CAAC,UAAU,KAEpB,MAAM,GAPL,KAAK,CAQZ,IAV6B,KAAK,CAW3B,CAChB,CAAC,GACA,CACT,EACA,QAAQ,IACP,GACJ,GACJ,EACL,iBAAiB,IAAI,CAClB,KAAC,KAAK,IACF,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAC,CAAC,EAC7C,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,WAAW,GACpB,CACL,IACC,GACJ,IACH,IACF,CACZ,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\nimport * as React from 'react';\n\nimport {Button, HTML, Media, RouterLink} from '../../components';\nimport HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs/HeaderBreadcrumbs';\nimport {getMediaImage} from '../../components/Media/Image/utils';\nimport YFMWrapper from '../../components/YFMWrapper/YFMWrapper';\nimport {MobileContext} from '../../context/mobileContext';\nimport {useTheme} from '../../context/theme';\nimport {Col, Grid, Row} from '../../grid';\nimport {ClassNameProps, HeaderBlockBackground, HeaderBlockProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\n\nimport {getImageSize, getTitleSizes, titleWithImageSizes} from './utils';\nimport './Header.scss';\n\nconst b = block('header-block');\n\ntype HeaderBlockFullProps = HeaderBlockProps & ClassNameProps;\n\ninterface BackgroundProps {\n background: HeaderBlockBackground;\n isMobile: boolean;\n}\n\nconst Background = ({background, isMobile}: BackgroundProps) => {\n const {url, image, fullWidthMedia, video, color} = background;\n const imageObject = url ? getMediaImage(url) : image;\n const renderMedia = !isMobile || (typeof image === 'object' && 'mobile' in image);\n\n return (\n <div\n className={b('background', {media: true, 'full-width-media': fullWidthMedia})}\n style={{backgroundColor: color}}\n >\n {renderMedia && (\n <Media\n {...background}\n className={b('background-media')}\n imageClassName={b('image')}\n videoClassName={b('video')}\n isBackground={true}\n parallax={false}\n video={isMobile ? undefined : video}\n image={imageObject}\n />\n )}\n </div>\n );\n};\n\ninterface FullWidthBackgroundProps {\n background: HeaderBlockBackground;\n}\n\nconst FullWidthBackground = ({background}: FullWidthBackgroundProps) => (\n <div\n className={b('background', {['full-width']: true})}\n style={{backgroundColor: background?.color}}\n />\n);\n\nexport const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>) => {\n const {\n title,\n overtitle,\n description,\n buttons,\n image,\n video,\n width = 'm',\n imageSize,\n offset = 'default',\n background,\n theme: textTheme = 'light',\n verticalOffset = 'm',\n className,\n breadcrumbs,\n status,\n renderTitle,\n children,\n mediaView = 'full',\n } = props;\n const isMobile = React.useContext(MobileContext);\n const theme = useTheme();\n const hasRightSideImage = Boolean(image || video);\n const curImageSize = imageSize || getImageSize(width);\n const titleSizes = hasRightSideImage ? titleWithImageSizes(curImageSize) : getTitleSizes(width);\n let curVerticalOffset = verticalOffset;\n\n if (hasRightSideImage && !verticalOffset) {\n curVerticalOffset = 'm';\n }\n\n const backgroundThemed = background && getThemedValue(background, theme);\n const imageThemed = image && getThemedValue(image, theme);\n const videoThemed = video && getThemedValue(video, theme);\n const fullWidth = backgroundThemed?.fullWidth || backgroundThemed?.fullWidthMedia;\n const titleId = useUniqId();\n\n return (\n <header\n className={b(\n {\n ['has-media']: hasRightSideImage,\n ['full-width']: fullWidth,\n ['media-view']: mediaView,\n ['controls-view']: textTheme,\n },\n className,\n )}\n >\n {backgroundThemed && fullWidth && <FullWidthBackground background={backgroundThemed} />}\n {backgroundThemed && <Background background={backgroundThemed} isMobile={isMobile} />}\n <Grid containerClass={b('container-fluid')}>\n {breadcrumbs && (\n <Row className={b('breadcrumbs')}>\n <Col>\n <HeaderBreadcrumbs {...breadcrumbs} theme={textTheme} />\n </Col>\n </Row>\n )}\n <Row>\n <Col reset className={b('content-wrapper')}>\n <Row>\n <Col\n className={b('content', {\n offset,\n theme: textTheme,\n 'vertical-offset': curVerticalOffset,\n })}\n >\n <Col sizes={titleSizes} className={b('content-inner')}>\n {overtitle && (\n <div className={b('overtitle')}>\n {typeof overtitle === 'string' ? (\n <HTML>{overtitle}</HTML>\n ) : (\n overtitle\n )}\n </div>\n )}\n <h1 className={b('title')} id={titleId}>\n {status}\n {renderTitle ? renderTitle(title) : <HTML>{title}</HTML>}\n </h1>\n {description && (\n <div className={b('description', {theme: textTheme})}>\n <YFMWrapper\n content={description}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n </div>\n )}\n {buttons && (\n <div className={b('buttons')} data-qa=\"header-buttons\">\n {buttons.map((button, index) => (\n <RouterLink href={button.url} key={index}>\n <Button\n key={index}\n className={b('button')}\n size=\"xl\"\n extraProps={{\n 'aria-describedby': titleId,\n ...button.extraProps,\n }}\n {...button}\n />\n </RouterLink>\n ))}\n </div>\n )}\n {children}\n </Col>\n </Col>\n </Row>\n {hasRightSideImage && (\n <Media\n className={b('media', {[curImageSize]: true})}\n videoClassName={b('video')}\n imageClassName={b('image')}\n video={videoThemed}\n image={imageThemed}\n />\n )}\n </Col>\n </Row>\n </Grid>\n </header>\n );\n};\n\nexport default HeaderBlock;\n"]}
@@ -24,7 +24,10 @@ export default function BackLink(props) {
24
24
  history.push({ pathname: url });
25
25
  }
26
26
  }, [handleAnalytics, history, onClick, url]);
27
- const buttonComponent = url && !shouldHandleBackAction ? 'a' : 'button';
28
- return (_jsxs(Button, { className: className, view: theme === 'special' ? 'flat-contrast' : 'flat-secondary', size: size, href: shouldHandleBackAction ? undefined : url, onClick: shouldHandleBackAction ? backActionHandler : undefined, tabIndex: tabIndex, extraProps: extraProps, component: buttonComponent, children: [_jsx(Icon, { data: ArrowLeft, size: 20 }), _jsx("span", { children: title })] }));
27
+ const buttonProps = {
28
+ href: shouldHandleBackAction ? undefined : url,
29
+ extraProps,
30
+ };
31
+ return (_jsxs(Button, Object.assign({ className: className, view: theme === 'special' ? 'flat-contrast' : 'flat-secondary', size: size, onClick: shouldHandleBackAction ? backActionHandler : undefined, tabIndex: tabIndex }, buttonProps, { children: [_jsx(Icon, { data: ArrowLeft, size: 20 }), _jsx("span", { children: title })] })));
29
32
  }
30
33
  //# sourceMappingURL=BackLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackLink.js","sourceRoot":"../../../../src","sources":["components/BackLink/BackLink.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAC,MAAM,EAAc,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAC,eAAe,EAAC,+CAAsC;AAC9D,OAAO,EAAC,YAAY,EAAC,6BAAoB;AACzC,OAAO,EAAC,iBAAiB,EAAW,8BAAqB;AAezD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAoB;IACjD,MAAM,EAAC,OAAO,EAAC,GAAG,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IACpD,MAAM,EACF,GAAG,EACH,KAAK,EACL,KAAK,GAAG,SAAS,EACjB,IAAI,GAAG,GAAG,EACV,SAAS,EACT,sBAAsB,GAAG,KAAK,EAC9B,OAAO,EACP,QAAQ,EACR,UAAU,GACb,GAAG,KAAK,CAAC;IACV,MAAM,eAAe,GAAG,YAAY,CAAC,iBAAiB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAEzE,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE;QACnD,eAAe,EAAE,CAAC;QAElB,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,OAAO;QACX,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;QACd,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,OAAO,CAAC,MAAM,EAAE,CAAC;QACrB,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,IAAI,CAAC,EAAC,QAAQ,EAAE,GAAG,EAAC,CAAC,CAAC;QAClC,CAAC;IACL,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IAE7C,MAAM,eAAe,GAAG,GAAG,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC;IAExE,OAAO,CACH,MAAC,MAAM,IACH,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,EAC9D,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,EAC9C,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,EAC/D,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,eAAe,aAE1B,KAAC,IAAI,IAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,GAAI,EACnC,yBAAO,KAAK,GAAQ,IACf,CACZ,CAAC;AACN,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {ArrowLeft} from '@gravity-ui/icons';\nimport {Button, ButtonSize, Icon} from '@gravity-ui/uikit';\n\nimport {LocationContext} from '../../context/locationContext';\nimport {useAnalytics} from '../../hooks';\nimport {DefaultEventNames, Tabbable} from '../../models';\n\nexport type Theme = 'default' | 'special';\n\nexport interface BackLinkProps<T = HTMLElement> extends Tabbable {\n url: string;\n title: React.ReactNode;\n theme?: Theme;\n size?: ButtonSize;\n className?: string;\n shouldHandleBackAction?: boolean;\n onClick?: () => void;\n extraProps?: React.HTMLProps<T>;\n}\n\nexport default function BackLink(props: BackLinkProps) {\n const {history} = React.useContext(LocationContext);\n const {\n url,\n title,\n theme = 'default',\n size = 'l',\n className,\n shouldHandleBackAction = false,\n onClick,\n tabIndex,\n extraProps,\n } = props;\n const handleAnalytics = useAnalytics(DefaultEventNames.ShareButton, url);\n\n const backActionHandler = React.useCallback(async () => {\n handleAnalytics();\n\n if (!history) {\n return;\n }\n\n if (onClick) {\n onClick();\n }\n\n if (history.length > 1) {\n history.goBack();\n } else {\n history.push({pathname: url});\n }\n }, [handleAnalytics, history, onClick, url]);\n\n const buttonComponent = url && !shouldHandleBackAction ? 'a' : 'button';\n\n return (\n <Button\n className={className}\n view={theme === 'special' ? 'flat-contrast' : 'flat-secondary'}\n size={size}\n href={shouldHandleBackAction ? undefined : url}\n onClick={shouldHandleBackAction ? backActionHandler : undefined}\n tabIndex={tabIndex}\n extraProps={extraProps}\n component={buttonComponent}\n >\n <Icon data={ArrowLeft} size={20} />\n <span>{title}</span>\n </Button>\n );\n}\n"]}
1
+ {"version":3,"file":"BackLink.js","sourceRoot":"../../../../src","sources":["components/BackLink/BackLink.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAC,MAAM,EAAc,IAAI,EAAkC,MAAM,mBAAmB,CAAC;AAE5F,OAAO,EAAC,eAAe,EAAC,+CAAsC;AAC9D,OAAO,EAAC,YAAY,EAAC,6BAAoB;AACzC,OAAO,EAAC,iBAAiB,EAAW,8BAAqB;AAezD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAoB;IACjD,MAAM,EAAC,OAAO,EAAC,GAAG,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IACpD,MAAM,EACF,GAAG,EACH,KAAK,EACL,KAAK,GAAG,SAAS,EACjB,IAAI,GAAG,GAAG,EACV,SAAS,EACT,sBAAsB,GAAG,KAAK,EAC9B,OAAO,EACP,QAAQ,EACR,UAAU,GACb,GAAG,KAAK,CAAC;IACV,MAAM,eAAe,GAAG,YAAY,CAAC,iBAAiB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAEzE,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE;QACnD,eAAe,EAAE,CAAC;QAElB,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,OAAO;QACX,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;QACd,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,OAAO,CAAC,MAAM,EAAE,CAAC;QACrB,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,IAAI,CAAC,EAAC,QAAQ,EAAE,GAAG,EAAC,CAAC,CAAC;QAClC,CAAC;IACL,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IAE7C,MAAM,WAAW,GAAG;QAChB,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG;QAC9C,UAAU;KACO,CAAC;IAEtB,OAAO,CACH,MAAC,MAAM,kBACH,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,EAC9D,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,EAC/D,QAAQ,EAAE,QAAQ,IACd,WAAW,eAEf,KAAC,IAAI,IAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,GAAI,EACnC,yBAAO,KAAK,GAAQ,KACf,CACZ,CAAC;AACN,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {ArrowLeft} from '@gravity-ui/icons';\nimport {Button, ButtonSize, Icon, ButtonProps as UIKitButtonProps} from '@gravity-ui/uikit';\n\nimport {LocationContext} from '../../context/locationContext';\nimport {useAnalytics} from '../../hooks';\nimport {DefaultEventNames, Tabbable} from '../../models';\n\nexport type Theme = 'default' | 'special';\n\nexport interface BackLinkProps<T = HTMLElement> extends Tabbable {\n url: string;\n title: React.ReactNode;\n theme?: Theme;\n size?: ButtonSize;\n className?: string;\n shouldHandleBackAction?: boolean;\n onClick?: () => void;\n extraProps?: React.HTMLProps<T>;\n}\n\nexport default function BackLink(props: BackLinkProps) {\n const {history} = React.useContext(LocationContext);\n const {\n url,\n title,\n theme = 'default',\n size = 'l',\n className,\n shouldHandleBackAction = false,\n onClick,\n tabIndex,\n extraProps,\n } = props;\n const handleAnalytics = useAnalytics(DefaultEventNames.ShareButton, url);\n\n const backActionHandler = React.useCallback(async () => {\n handleAnalytics();\n\n if (!history) {\n return;\n }\n\n if (onClick) {\n onClick();\n }\n\n if (history.length > 1) {\n history.goBack();\n } else {\n history.push({pathname: url});\n }\n }, [handleAnalytics, history, onClick, url]);\n\n const buttonProps = {\n href: shouldHandleBackAction ? undefined : url,\n extraProps,\n } as UIKitButtonProps;\n\n return (\n <Button\n className={className}\n view={theme === 'special' ? 'flat-contrast' : 'flat-secondary'}\n size={size}\n onClick={shouldHandleBackAction ? backActionHandler : undefined}\n tabIndex={tabIndex}\n {...buttonProps}\n >\n <Icon data={ArrowLeft} size={20} />\n <span>{title}</span>\n </Button>\n );\n}\n"]}
@@ -12,8 +12,9 @@ unpredictable css rules order in build */
12
12
  width: 100%;
13
13
  height: 72px;
14
14
  margin-top: var(--header-height);
15
- color: var(--g-color-text-secondary);
16
- border-top: 1px solid var(--g-color-line-generic);
15
+ box-sizing: content-box;
16
+ border-top: 1px solid;
17
+ border-bottom: 1px solid transparent;
17
18
  transition: color 0.5s ease-out, border-color 0.5s ease-out;
18
19
  }
19
20
  .pc-brand-footer::after {
@@ -22,32 +23,38 @@ unpredictable css rules order in build */
22
23
  right: 0;
23
24
  left: 0;
24
25
  height: 1px;
26
+ background: linear-gradient(270deg, rgb(228, 106, 68) 0%, rgb(242, 159, 85) 46.62%, rgb(255, 212, 102) 100%);
25
27
  opacity: 0;
26
28
  transition: opacity 0.5s ease-out;
27
29
  content: "";
28
30
  }
29
- .pc-brand-footer:hover {
31
+ .pc-brand-footer_theme_light {
32
+ color: var(--g-color-text-secondary);
33
+ border-top-color: var(--g-color-private-black-200);
34
+ }
35
+ .pc-brand-footer_theme_light:hover {
30
36
  color: var(--g-color-text-primary);
31
- border-color: transparent;
37
+ border-top-color: transparent;
32
38
  }
33
- .pc-brand-footer:hover::after {
39
+ .pc-brand-footer_theme_light:hover::after {
34
40
  opacity: 1;
35
41
  }
36
- .pc-brand-footer_theme_light::after {
37
- background: linear-gradient(270deg, rgb(228, 106, 68) 0%, rgb(242, 159, 85) 46.62%, rgb(255, 212, 102) 100%);
42
+ .pc-brand-footer_theme_dark {
43
+ color: var(--g-color-private-white-700);
44
+ border-top-color: var(--g-color-private-white-100);
45
+ }
46
+ .pc-brand-footer_theme_dark:hover {
47
+ color: var(--g-color-private-white-1000-solid);
48
+ border-top-color: transparent;
38
49
  }
39
- .pc-brand-footer_theme_dark::after {
40
- background: linear-gradient(270deg, rgba(228, 106, 68, 0.6) 0%, rgba(242, 159, 85, 0.6) 46.62%, rgba(255, 212, 102, 0.6) 100%);
50
+ .pc-brand-footer_theme_dark:hover::after {
51
+ opacity: 0.6;
41
52
  }
42
53
  .pc-brand-footer__content {
43
54
  display: flex;
44
55
  align-items: center;
45
56
  justify-content: center;
46
57
  gap: 8px;
47
- padding-top: 1px;
48
- }
49
- .pc-brand-footer__text {
50
- align-self: flex-end;
51
58
  }
52
59
  .pc-brand-footer__brand-icon {
53
60
  display: flex;
@@ -78,9 +85,7 @@ unpredictable css rules order in build */
78
85
  font-size: var(--g-text-body-1-font-size);
79
86
  line-height: var(--g-text-body-1-line-height);
80
87
  height: 52px;
81
- }
82
- .pc-brand-footer__content {
83
- padding: 0;
88
+ border-bottom-width: 0;
84
89
  }
85
90
  .pc-brand-footer__brand-icon {
86
91
  width: 20px;
@@ -89,6 +94,5 @@ unpredictable css rules order in build */
89
94
  .pc-brand-footer__brand-name {
90
95
  width: 72px;
91
96
  height: 16px;
92
- margin-top: 0;
93
97
  }
94
98
  }
@@ -11,7 +11,7 @@ import './BrandFooter.css';
11
11
  const b = block('brand-footer');
12
12
  const BrandFooter = ({ className }) => {
13
13
  const theme = useTheme();
14
- return (_jsx(Link, { className: b({ theme }, className), href: "https://gravity-ui.com", children: _jsxs("div", { className: b('content'), children: [_jsx("span", { className: b('text'), children: i18n('created-on') }), _jsx("div", { className: b('brand-icon'), children: theme === Theme.Light ? _jsx(BrandIconLight, {}) : _jsx(BrandIconDark, {}) }), _jsx("div", { className: b('brand-name'), children: _jsx(BrandName, {}) })] }) }));
14
+ return (_jsx(Link, { className: b({ theme }, className), href: "https://gravity-ui.com", children: _jsxs("div", { className: b('content'), children: [_jsx("span", { children: i18n('created-on') }), _jsx("div", { className: b('brand-icon'), children: theme === Theme.Light ? _jsx(BrandIconLight, {}) : _jsx(BrandIconDark, {}) }), _jsx("div", { className: b('brand-name'), children: _jsx(BrandName, {}) })] }) }));
15
15
  };
16
16
  export default BrandFooter;
17
17
  //# sourceMappingURL=BrandFooter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrandFooter.js","sourceRoot":"../../../../src","sources":["components/BrandFooter/BrandFooter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAC7C,OAAO,EAAC,aAAa,EAAC,qCAAkC;AACxD,OAAO,EAAC,cAAc,EAAC,sCAAmC;AAC1D,OAAO,EAAC,SAAS,EAAC,iCAA8B;AAEhD,OAAO,EAAC,KAAK,EAAC,8BAAqB;AACnC,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAElC,OAAO,EAAC,IAAI,EAAC,wBAAe;AAE5B,OAAO,mBAAmB,CAAC;AAE3B,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAEhC,MAAM,WAAW,GAAG,CAAC,EAAC,SAAS,EAAiB,EAAE,EAAE;IAChD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,OAAO,CACH,KAAC,IAAI,IAAC,SAAS,EAAE,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,SAAS,CAAC,EAAE,IAAI,EAAC,wBAAwB,YACjE,eAAK,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,aACxB,eAAM,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YAAG,IAAI,CAAC,YAAY,CAAC,GAAQ,EACvD,cAAK,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,YAC1B,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAC,cAAc,KAAG,CAAC,CAAC,CAAC,KAAC,aAAa,KAAG,GAC7D,EACN,cAAK,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,YAC3B,KAAC,SAAS,KAAG,GACX,IACJ,GACH,CACV,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {Link} from '@gravity-ui/uikit';\n\nimport {useTheme} from '../../context/theme';\nimport {BrandIconDark} from '../../icons/BrandIconDark';\nimport {BrandIconLight} from '../../icons/BrandIconLight';\nimport {BrandName} from '../../icons/BrandName';\nimport type {ClassNameProps} from '../../models';\nimport {Theme} from '../../models';\nimport {block} from '../../utils';\n\nimport {i18n} from './i18n';\n\nimport './BrandFooter.scss';\n\nconst b = block('brand-footer');\n\nconst BrandFooter = ({className}: ClassNameProps) => {\n const theme = useTheme();\n\n return (\n <Link className={b({theme}, className)} href=\"https://gravity-ui.com\">\n <div className={b('content')}>\n <span className={b('text')}>{i18n('created-on')}</span>\n <div className={b('brand-icon')}>\n {theme === Theme.Light ? <BrandIconLight /> : <BrandIconDark />}\n </div>\n <div className={b('brand-name')}>\n <BrandName />\n </div>\n </div>\n </Link>\n );\n};\n\nexport default BrandFooter;\n"]}
1
+ {"version":3,"file":"BrandFooter.js","sourceRoot":"../../../../src","sources":["components/BrandFooter/BrandFooter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAC7C,OAAO,EAAC,aAAa,EAAC,qCAAkC;AACxD,OAAO,EAAC,cAAc,EAAC,sCAAmC;AAC1D,OAAO,EAAC,SAAS,EAAC,iCAA8B;AAEhD,OAAO,EAAC,KAAK,EAAC,8BAAqB;AACnC,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAElC,OAAO,EAAC,IAAI,EAAC,wBAAe;AAE5B,OAAO,mBAAmB,CAAC;AAE3B,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAEhC,MAAM,WAAW,GAAG,CAAC,EAAC,SAAS,EAAiB,EAAE,EAAE;IAChD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,OAAO,CACH,KAAC,IAAI,IAAC,SAAS,EAAE,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,SAAS,CAAC,EAAE,IAAI,EAAC,wBAAwB,YACjE,eAAK,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,aACxB,yBAAO,IAAI,CAAC,YAAY,CAAC,GAAQ,EACjC,cAAK,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,YAC1B,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAC,cAAc,KAAG,CAAC,CAAC,CAAC,KAAC,aAAa,KAAG,GAC7D,EACN,cAAK,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,YAC3B,KAAC,SAAS,KAAG,GACX,IACJ,GACH,CACV,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {Link} from '@gravity-ui/uikit';\n\nimport {useTheme} from '../../context/theme';\nimport {BrandIconDark} from '../../icons/BrandIconDark';\nimport {BrandIconLight} from '../../icons/BrandIconLight';\nimport {BrandName} from '../../icons/BrandName';\nimport type {ClassNameProps} from '../../models';\nimport {Theme} from '../../models';\nimport {block} from '../../utils';\n\nimport {i18n} from './i18n';\n\nimport './BrandFooter.scss';\n\nconst b = block('brand-footer');\n\nconst BrandFooter = ({className}: ClassNameProps) => {\n const theme = useTheme();\n\n return (\n <Link className={b({theme}, className)} href=\"https://gravity-ui.com\">\n <div className={b('content')}>\n <span>{i18n('created-on')}</span>\n <div className={b('brand-icon')}>\n {theme === Theme.Light ? <BrandIconLight /> : <BrandIconDark />}\n </div>\n <div className={b('brand-name')}>\n <BrandName />\n </div>\n </div>\n </Link>\n );\n};\n\nexport default BrandFooter;\n"]}
@@ -2,7 +2,7 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as React from 'react';
4
4
  import { StoreBadge } from '@gravity-ui/components';
5
- import { Button as CommonButton, Icon, Platform } from '@gravity-ui/uikit';
5
+ import { Button as CommonButton, Icon, Platform, } from '@gravity-ui/uikit';
6
6
  import { LocaleContext } from "../../context/localeContext/localeContext.js";
7
7
  import { useAnalytics } from "../../hooks/index.js";
8
8
  import { Github } from "../../icons/index.js";
@@ -31,7 +31,7 @@ const Button = (props) => {
31
31
  const buttonClass = img
32
32
  ? b(Object.assign({ position: buttonImg.position }, buttonModifiers), className)
33
33
  : b(Object.assign({}, buttonModifiers), className);
34
- const buttonProps = Object.assign(Object.assign({}, rest), { onClick });
34
+ const buttonProps = Object.assign(Object.assign({}, rest), { href: url ? setUrlTld(url, tld) : undefined, onClick });
35
35
  if (theme === 'app-store' || theme === 'google-play') {
36
36
  const platform = theme === 'app-store' ? Platform.IOS : Platform.ANDROID;
37
37
  return _jsx(StoreBadge, { className: buttonClass, platform: platform, href: url });
@@ -43,8 +43,7 @@ const Button = (props) => {
43
43
  image = undefined;
44
44
  }
45
45
  const buttonTheme = theme === 'scale' ? 'accent' : theme;
46
- const buttonComponent = url ? 'a' : 'button';
47
- return (_jsxs(CommonButton, Object.assign({ className: buttonClass, view: toCommonView(buttonTheme), size: toCommonSize(size), href: url ? setUrlTld(url, tld) : undefined, title: urlTitle, width: width, component: buttonComponent }, buttonProps, { children: [icon && buttonImg.position === 'left' ? icon : null, _jsxs("span", { className: b('content'), children: [image && buttonImg.position === 'left' ? image : null, _jsx("span", { className: b('text'), children: text }), image && buttonImg.position === 'right' ? image : null] }), icon && buttonImg.position === 'right' ? icon : null] })));
46
+ return (_jsxs(CommonButton, Object.assign({ className: buttonClass, view: toCommonView(buttonTheme), size: toCommonSize(size), title: urlTitle, width: width }, buttonProps, { children: [icon && buttonImg.position === 'left' ? icon : null, _jsxs("span", { className: b('content'), children: [image && buttonImg.position === 'left' ? image : null, _jsx("span", { className: b('text'), children: text }), image && buttonImg.position === 'right' ? image : null] }), icon && buttonImg.position === 'right' ? icon : null] })));
48
47
  };
49
48
  export default Button;
50
49
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"../../../../src","sources":["components/Button/Button.tsx"],"names":[],"mappings":";;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAC,MAAM,IAAI,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAAC,aAAa,EAAC,qDAAkD;AACxE,OAAO,EAAC,YAAY,EAAC,6BAAoB;AACzC,OAAO,EAAC,MAAM,EAAC,6BAAoB;AACnC,OAAO,EAA8B,iBAAiB,EAAU,8BAAqB;AACrF,OAAO,EAAC,KAAK,EAAE,SAAS,EAAC,6BAAoB;AAE7C,OAAO,EAAC,IAAI,EAAC,wBAAe;AAC5B,OAAO,EAAC,OAAO,EAAiC,YAAY,EAAE,YAAY,EAAC,mBAAgB;AA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A6B,CAAC,EACjD,IAAI,EAAE,YAAY,CAAC,IAAqB,CAAC,EACzC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAC3C,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,eAAe,IACtB,WAAW,eAEd,IAAI,IAAI,SAAS,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EACpD,gBAAM,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,aACxB,KAAK,IAAI,SAAS,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EACtD,eAAM,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YAAG,IAAI,GAAQ,EACxC,KAAK,IAAI,SAAS,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IACpD,EACN,IAAI,IAAI,SAAS,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAC1C,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {StoreBadge} from '@gravity-ui/components';\nimport {Button as CommonButton, Icon, Platform} from '@gravity-ui/uikit';\n\nimport {LocaleContext} from '../../context/localeContext/localeContext';\nimport {useAnalytics} from '../../hooks';\nimport {Github} from '../../icons';\nimport {ButtonProps as ButtonParams, DefaultEventNames, QAProps} from '../../models';\nimport {block, setUrlTld} from '../../utils';\n\nimport {i18n} from './i18n';\nimport {ICON_QA, OldButtonSize, OldButtonTheme, toCommonSize, toCommonView} from './utils';\n\nimport './Button.scss';\n\nexport interface ButtonProps extends Omit<ButtonParams, 'url'>, QAProps {\n className?: string;\n url?: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n}\n\nconst b = block('button-block');\n\n// eslint-disable-next-line complexity\nconst Button = (props: ButtonProps) => {\n const {tld} = React.useContext(LocaleContext);\n const {\n className,\n analyticsEvents,\n size = 'l',\n theme = 'normal',\n url,\n urlTitle,\n img,\n onClick: onClickOrigin,\n text,\n width,\n ...rest\n } = props;\n const defaultImgPosition = 'left';\n const handleAnalytics = useAnalytics(DefaultEventNames.Button, url);\n const onClick = React.useCallback(\n (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n handleAnalytics(analyticsEvents);\n\n if (onClickOrigin) {\n onClickOrigin(e);\n }\n },\n [handleAnalytics, analyticsEvents, onClickOrigin],\n );\n\n const buttonModifiers = {size, theme, width};\n\n const buttonImg =\n img instanceof Object\n ? {url: img.url, position: img.position || defaultImgPosition, alt: img.alt}\n : {url: img, position: defaultImgPosition};\n\n const buttonClass = img\n ? b({position: buttonImg.position, ...buttonModifiers}, className)\n : b({...buttonModifiers}, className);\n\n const buttonProps = {\n ...rest,\n onClick,\n };\n\n if (theme === 'app-store' || theme === 'google-play') {\n const platform = theme === 'app-store' ? Platform.IOS : Platform.ANDROID;\n\n return <StoreBadge className={buttonClass} platform={platform} href={url as string} />;\n }\n\n let icon;\n let image = img && (\n <img className={b('image')} src={buttonImg.url} alt={buttonImg.alt || i18n('image-alt')} />\n );\n\n if (theme === 'github') {\n icon = <Icon className={b('icon')} data={Github} size={24} qa={ICON_QA} />;\n image = undefined;\n }\n\n const buttonTheme = theme === 'scale' ? 'accent' : theme;\n\n const buttonComponent = url ? 'a' : 'button';\n\n return (\n <CommonButton\n className={buttonClass}\n view={toCommonView(buttonTheme as OldButtonTheme)}\n size={toCommonSize(size as OldButtonSize)}\n href={url ? setUrlTld(url, tld) : undefined}\n title={urlTitle}\n width={width}\n component={buttonComponent}\n {...buttonProps}\n >\n {icon && buttonImg.position === 'left' ? icon : null}\n <span className={b('content')}>\n {image && buttonImg.position === 'left' ? image : null}\n <span className={b('text')}>{text}</span>\n {image && buttonImg.position === 'right' ? image : null}\n </span>\n {icon && buttonImg.position === 'right' ? icon : null}\n </CommonButton>\n );\n};\n\nexport default Button;\n"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":"../../../../src","sources":["components/Button/Button.tsx"],"names":[],"mappings":";;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,EACH,MAAM,IAAI,YAAY,EACtB,IAAI,EACJ,QAAQ,GAEX,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAC,aAAa,EAAC,qDAAkD;AACxE,OAAO,EAAC,YAAY,EAAC,6BAAoB;AACzC,OAAO,EAAC,MAAM,EAAC,6BAAoB;AACnC,OAAO,EAA8B,iBAAiB,EAAU,8BAAqB;AACrF,OAAO,EAAC,KAAK,EAAE,SAAS,EAAC,6BAAoB;AAE7C,OAAO,EAAC,IAAI,EAAC,wBAAe;AAC5B,OAAO,EAAC,OAAO,EAAiC,YAAY,EAAE,YAAY,EAAC,mBAAgB;AAE3F,OAAO,cAAc,CAAC;AAQtB,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAEhC,sCAAsC;AACtC,MAAM,MAAM,GAAG,CAAC,KAAkB,EAAE,EAAE;IAClC,MAAM,EAAC,GAAG,EAAC,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAC9C,MAAM,EACF,SAAS,EACT,eAAe,EACf,IAAI,GAAG,GAAG,EACV,KAAK,GAAG,QAAQ,EAChB,GAAG,EACH,QAAQ,EACR,GAAG,EACH,OAAO,EAAE,aAAa,EACtB,IAAI,EACJ,KAAK,KAEL,KAAK,EADF,IAAI,UACP,KAAK,EAZH,uGAYL,CAAQ,CAAC;IACV,MAAM,kBAAkB,GAAG,MAAM,CAAC;IAClC,MAAM,eAAe,GAAG,YAAY,CAAC,iBAAiB,CAAC,MAAM,E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,IACpD,EACN,IAAI,IAAI,SAAS,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAC1C,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {StoreBadge} from '@gravity-ui/components';\nimport {\n Button as CommonButton,\n Icon,\n Platform,\n ButtonProps as UIKitButtonProps,\n} from '@gravity-ui/uikit';\n\nimport {LocaleContext} from '../../context/localeContext/localeContext';\nimport {useAnalytics} from '../../hooks';\nimport {Github} from '../../icons';\nimport {ButtonProps as ButtonParams, DefaultEventNames, QAProps} from '../../models';\nimport {block, setUrlTld} from '../../utils';\n\nimport {i18n} from './i18n';\nimport {ICON_QA, OldButtonSize, OldButtonTheme, toCommonSize, toCommonView} from './utils';\n\nimport './Button.scss';\n\nexport interface ButtonProps extends Omit<ButtonParams, 'url'>, QAProps {\n className?: string;\n url?: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n}\n\nconst b = block('button-block');\n\n// eslint-disable-next-line complexity\nconst Button = (props: ButtonProps) => {\n const {tld} = React.useContext(LocaleContext);\n const {\n className,\n analyticsEvents,\n size = 'l',\n theme = 'normal',\n url,\n urlTitle,\n img,\n onClick: onClickOrigin,\n text,\n width,\n ...rest\n } = props;\n const defaultImgPosition = 'left';\n const handleAnalytics = useAnalytics(DefaultEventNames.Button, url);\n const onClick = React.useCallback(\n (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n handleAnalytics(analyticsEvents);\n\n if (onClickOrigin) {\n onClickOrigin(e);\n }\n },\n [handleAnalytics, analyticsEvents, onClickOrigin],\n );\n\n const buttonModifiers = {size, theme, width};\n\n const buttonImg =\n img instanceof Object\n ? {url: img.url, position: img.position || defaultImgPosition, alt: img.alt}\n : {url: img, position: defaultImgPosition};\n\n const buttonClass = img\n ? b({position: buttonImg.position, ...buttonModifiers}, className)\n : b({...buttonModifiers}, className);\n\n const buttonProps = {\n ...rest,\n href: url ? setUrlTld(url, tld) : undefined,\n onClick,\n };\n\n if (theme === 'app-store' || theme === 'google-play') {\n const platform = theme === 'app-store' ? Platform.IOS : Platform.ANDROID;\n\n return <StoreBadge className={buttonClass} platform={platform} href={url as string} />;\n }\n\n let icon;\n let image = img && (\n <img className={b('image')} src={buttonImg.url} alt={buttonImg.alt || i18n('image-alt')} />\n );\n\n if (theme === 'github') {\n icon = <Icon className={b('icon')} data={Github} size={24} qa={ICON_QA} />;\n image = undefined;\n }\n\n const buttonTheme = theme === 'scale' ? 'accent' : theme;\n\n return (\n <CommonButton\n className={buttonClass}\n view={toCommonView(buttonTheme as OldButtonTheme)}\n size={toCommonSize(size as OldButtonSize)}\n title={urlTitle}\n width={width}\n {...(buttonProps as UIKitButtonProps)}\n >\n {icon && buttonImg.position === 'left' ? icon : null}\n <span className={b('content')}>\n {image && buttonImg.position === 'left' ? image : null}\n <span className={b('text')}>{text}</span>\n {image && buttonImg.position === 'right' ? image : null}\n </span>\n {icon && buttonImg.position === 'right' ? icon : null}\n </CommonButton>\n );\n};\n\nexport default Button;\n"]}
@@ -109,7 +109,7 @@ export interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, P
109
109
  export type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;
110
110
  export interface HeaderBlockProps {
111
111
  title: string;
112
- overtitle?: string;
112
+ overtitle?: string | JSX.Element;
113
113
  description?: string;
114
114
  buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];
115
115
  width?: HeaderWidth;
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":"AA2CA,MAAM,CAAN,IAAY,SAsBX;AAtBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IACl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,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n // unstable\n SliderNewBlock = 'slider-new-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderNewProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string;\n description?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n mediaView?: MediaView;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {\n title: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'title' | 'theme' | 'centered'> {\n title: string;\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: MapProps;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n description?: string;\n tags: FilterTag[];\n items: FilterItem[];\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url: string;\n text: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: ContentBlockProps;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = React.FC<React.SVGProps<SVGSVGElement>>;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon: ThemeSupporting<ImageProps | SVGIcon>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: ButtonProps[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<BackgroundImageProps>;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\n// unstable block models\nexport type SliderNewBlockModel = {\n type: BlockType.SliderNewBlock;\n} & SliderNewProps;\n\ntype BlockModels =\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel;\n\ntype UnstableBlockModels = SliderNewBlockModel;\n\nexport type Block = (BlockModels | UnstableBlockModels) & BlockBaseProps;\n"]}
1
+ {"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":"AA2CA,MAAM,CAAN,IAAY,SAsBX;AAtBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;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C5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n // unstable\n SliderNewBlock = 'slider-new-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderNewProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string | JSX.Element;\n description?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n mediaView?: MediaView;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {\n title: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'title' | 'theme' | 'centered'> {\n title: string;\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: MapProps;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n description?: string;\n tags: FilterTag[];\n items: FilterItem[];\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url: string;\n text: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: ContentBlockProps;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = React.FC<React.SVGProps<SVGSVGElement>>;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon: ThemeSupporting<ImageProps | SVGIcon>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: ButtonProps[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<BackgroundImageProps>;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\n// unstable block models\nexport type SliderNewBlockModel = {\n type: BlockType.SliderNewBlock;\n} & SliderNewProps;\n\ntype BlockModels =\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel;\n\ntype UnstableBlockModels = SliderNewBlockModel;\n\nexport type Block = (BlockModels | UnstableBlockModels) & BlockBaseProps;\n"]}
@@ -23,7 +23,7 @@ declare const useActiveNavItem: (iconSize: number, leftItems: NavigationItemMode
23
23
  analyticsEvents?: import("../../index.js").AnalyticsEventsProp;
24
24
  size?: import("@gravity-ui/uikit").ButtonSize | undefined;
25
25
  width?: import("@gravity-ui/uikit").ButtonWidth | undefined;
26
- extraProps?: React.ButtonHTMLAttributes<HTMLButtonElement> | Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> | React.AnchorHTMLAttributes<HTMLAnchorElement> | undefined;
26
+ extraProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | React.ButtonHTMLAttributes<HTMLButtonElement> | undefined;
27
27
  } | {
28
28
  type: import("../../index.js").NavigationItemType.Dropdown;
29
29
  items: import("../../index.js").NavigationLinkItem[];
@@ -55,7 +55,7 @@ declare const useActiveNavItem: (iconSize: number, leftItems: NavigationItemMode
55
55
  analyticsEvents?: import("../../index.js").AnalyticsEventsProp;
56
56
  size?: import("@gravity-ui/uikit").ButtonSize | undefined;
57
57
  width?: import("@gravity-ui/uikit").ButtonWidth | undefined;
58
- extraProps?: React.ButtonHTMLAttributes<HTMLButtonElement> | Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> | React.AnchorHTMLAttributes<HTMLAnchorElement> | undefined;
58
+ extraProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | React.ButtonHTMLAttributes<HTMLButtonElement> | undefined;
59
59
  } | {
60
60
  type: import("../../index.js").NavigationItemType.Dropdown;
61
61
  items: import("../../index.js").NavigationLinkItem[];
@@ -29,7 +29,7 @@ export declare function getNavigationItemWithIconSize(iconSize?: number): (item:
29
29
  analyticsEvents?: import("../index.js").AnalyticsEventsProp;
30
30
  size?: import("@gravity-ui/uikit").ButtonSize | undefined;
31
31
  width?: import("@gravity-ui/uikit").ButtonWidth | undefined;
32
- extraProps?: React.ButtonHTMLAttributes<HTMLButtonElement> | Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> | React.AnchorHTMLAttributes<HTMLAnchorElement> | undefined;
32
+ extraProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | React.ButtonHTMLAttributes<HTMLButtonElement> | undefined;
33
33
  } | {
34
34
  type: NavigationItemType.Dropdown;
35
35
  items: NavigationLinkItem[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "6.0.0-beta.1",
3
+ "version": "6.0.0-beta.3",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -10,9 +10,14 @@
10
10
  },
11
11
  "exports": {
12
12
  ".": {
13
- "types": "./build/esm/index.d.ts",
14
- "require": "./build/cjs/index.js",
15
- "import": "./build/esm/index.js"
13
+ "import": {
14
+ "types": "./build/esm/index.d.ts",
15
+ "default": "./build/esm/index.js"
16
+ },
17
+ "require": {
18
+ "types": "./build/cjs/index.d.ts",
19
+ "default": "./build/cjs/index.js"
20
+ }
16
21
  },
17
22
  "./editor": {
18
23
  "types": "./build/esm/editor/index.d.ts",
@@ -30,7 +35,7 @@
30
35
  },
31
36
  "main": "./build/cjs/index.js",
32
37
  "module": "./build/esm/index.js",
33
- "types": "./build/esm/index.d.ts",
38
+ "types": "./build/cjs/index.d.ts",
34
39
  "typesVersions": {
35
40
  "*": {
36
41
  "index.d.ts": [
@@ -140,7 +145,7 @@
140
145
  "@gravity-ui/prettier-config": "^1.1.0",
141
146
  "@gravity-ui/stylelint-config": "^4.0.1",
142
147
  "@gravity-ui/tsconfig": "^1.0.0",
143
- "@gravity-ui/uikit": "^7.0.0-beta.5",
148
+ "@gravity-ui/uikit": "^7.0.0-beta.6",
144
149
  "@playwright/experimental-ct-react": "^1.45.3",
145
150
  "@playwright/test": "^1.45.3",
146
151
  "@storybook/addon-actions": "8.0.5",
@@ -109,7 +109,7 @@ export interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, P
109
109
  export type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;
110
110
  export interface HeaderBlockProps {
111
111
  title: string;
112
- overtitle?: string;
112
+ overtitle?: string | JSX.Element;
113
113
  description?: string;
114
114
  buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];
115
115
  width?: HeaderWidth;
package/widget/index.js CHANGED
@@ -1 +1 @@
1
- export default "(self.webpackChunk_gravity_ui_page_constructor=self.webpackChunk_gravity_ui_page_constructor||[]).push([[3852],{33852:function(_,t,e){_.exports=function(_){\"use strict\";function t(_){return _&&\"object\"==typeof _&&\"default\"in _?_:{default:_}}var e=t(_),Y={name:\"zh-cn\",weekdays:\"星期日_星期一_星期二_星期三_星期四_星期五_星期六\".split(\"_\"),weekdaysShort:\"周日_周一_周二_周三_周四_周五_周六\".split(\"_\"),weekdaysMin:\"日_一_二_三_四_五_六\".split(\"_\"),months:\"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月\".split(\"_\"),monthsShort:\"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月\".split(\"_\"),ordinal:function(_,t){return\"W\"===t?_+\"周\":_+\"日\"},weekStart:1,yearStart:4,formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"YYYY/MM/DD\",LL:\"YYYY年M月D日\",LLL:\"YYYY年M月D日Ah点mm分\",LLLL:\"YYYY年M月D日ddddAh点mm分\",l:\"YYYY/M/D\",ll:\"YYYY年M月D日\",lll:\"YYYY年M月D日 HH:mm\",llll:\"YYYY年M月D日dddd HH:mm\"},relativeTime:{future:\"%s内\",past:\"%s前\",s:\"几秒\",m:\"1 分钟\",mm:\"%d 分钟\",h:\"1 小时\",hh:\"%d 小时\",d:\"1 天\",dd:\"%d 天\",M:\"1 个月\",MM:\"%d 个月\",y:\"1 年\",yy:\"%d 年\"},meridiem:function(_,t){var e=100*_+t;return e<600?\"凌晨\":e<900?\"早上\":e<1100?\"上午\":e<1300?\"中午\":e<1800?\"下午\":\"晚上\"}};return e.default.locale(Y,null,!0),Y}(e(27484))}}]);";
1
+ export default "(self.webpackChunk_gravity_ui_page_constructor=self.webpackChunk_gravity_ui_page_constructor||[]).push([[2009],{32009:function(_,t,e){_.exports=function(_){\"use strict\";function t(_){return _&&\"object\"==typeof _&&\"default\"in _?_:{default:_}}var e=t(_),Y={name:\"zh\",weekdays:\"星期日_星期一_星期二_星期三_星期四_星期五_星期六\".split(\"_\"),weekdaysShort:\"周日_周一_周二_周三_周四_周五_周六\".split(\"_\"),weekdaysMin:\"日_一_二_三_四_五_六\".split(\"_\"),months:\"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月\".split(\"_\"),monthsShort:\"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月\".split(\"_\"),ordinal:function(_,t){return\"W\"===t?_+\"周\":_+\"日\"},weekStart:1,yearStart:4,formats:{LT:\"HH:mm\",LTS:\"HH:mm:ss\",L:\"YYYY/MM/DD\",LL:\"YYYY年M月D日\",LLL:\"YYYY年M月D日Ah点mm分\",LLLL:\"YYYY年M月D日ddddAh点mm分\",l:\"YYYY/M/D\",ll:\"YYYY年M月D日\",lll:\"YYYY年M月D日 HH:mm\",llll:\"YYYY年M月D日dddd HH:mm\"},relativeTime:{future:\"%s后\",past:\"%s前\",s:\"几秒\",m:\"1 分钟\",mm:\"%d 分钟\",h:\"1 小时\",hh:\"%d 小时\",d:\"1 天\",dd:\"%d 天\",M:\"1 个月\",MM:\"%d 个月\",y:\"1 年\",yy:\"%d 年\"},meridiem:function(_,t){var e=100*_+t;return e<600?\"凌晨\":e<900?\"早上\":e<1100?\"上午\":e<1300?\"中午\":e<1800?\"下午\":\"晚上\"}};return e.default.locale(Y,null,!0),Y}(e(27484))}}]);";