@gravity-ui/page-constructor 7.7.1 → 7.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/build/cjs/components/Button/Button.css +2 -7
  2. package/build/cjs/components/Button/Button.js +19 -2
  3. package/build/cjs/components/Button/Button.js.map +1 -1
  4. package/build/cjs/components/ContentList/ContentList.js +2 -2
  5. package/build/cjs/components/ContentList/ContentList.js.map +1 -1
  6. package/build/cjs/components/ContentList/ContentListItemIcon.d.ts +4 -3
  7. package/build/cjs/components/ContentList/ContentListItemIcon.js +7 -8
  8. package/build/cjs/components/ContentList/ContentListItemIcon.js.map +1 -1
  9. package/build/cjs/components/Icon/Icon.css +10 -0
  10. package/build/cjs/components/Icon/Icon.d.ts +9 -0
  11. package/build/cjs/components/Icon/Icon.js +24 -0
  12. package/build/cjs/components/Icon/Icon.js.map +1 -0
  13. package/build/cjs/components/IconWrapper/IconWrapper.css +3 -2
  14. package/build/cjs/components/IconWrapper/IconWrapper.js +6 -6
  15. package/build/cjs/components/IconWrapper/IconWrapper.js.map +1 -1
  16. package/build/cjs/models/constructor-items/blocks.d.ts +3 -2
  17. package/build/cjs/models/constructor-items/blocks.js.map +1 -1
  18. package/build/cjs/models/constructor-items/common.d.ts +10 -2
  19. package/build/cjs/models/constructor-items/common.js.map +1 -1
  20. package/build/cjs/models/constructor-items/sub-blocks.d.ts +7 -1
  21. package/build/cjs/models/constructor-items/sub-blocks.js.map +1 -1
  22. package/build/cjs/schema/constants.d.ts +21 -0
  23. package/build/cjs/schema/validators/common.d.ts +21 -0
  24. package/build/cjs/schema/validators/common.js +22 -0
  25. package/build/cjs/schema/validators/common.js.map +1 -1
  26. package/build/cjs/sub-blocks/BasicCard/BasicCard.js +5 -2
  27. package/build/cjs/sub-blocks/BasicCard/BasicCard.js.map +1 -1
  28. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +21 -0
  29. package/build/cjs/sub-blocks/BasicCard/schema.js +1 -0
  30. package/build/cjs/sub-blocks/BasicCard/schema.js.map +1 -1
  31. package/build/cjs/sub-blocks/Content/schema.d.ts +31 -0
  32. package/build/cjs/sub-blocks/Content/schema.js +1 -0
  33. package/build/cjs/sub-blocks/Content/schema.js.map +1 -1
  34. package/build/cjs/text-transform/config.js +0 -9
  35. package/build/cjs/text-transform/config.js.map +1 -1
  36. package/build/esm/components/Button/Button.css +2 -7
  37. package/build/esm/components/Button/Button.js +19 -2
  38. package/build/esm/components/Button/Button.js.map +1 -1
  39. package/build/esm/components/ContentList/ContentList.js +2 -2
  40. package/build/esm/components/ContentList/ContentList.js.map +1 -1
  41. package/build/esm/components/ContentList/ContentListItemIcon.d.ts +4 -3
  42. package/build/esm/components/ContentList/ContentListItemIcon.js +7 -8
  43. package/build/esm/components/ContentList/ContentListItemIcon.js.map +1 -1
  44. package/build/esm/components/Icon/Icon.css +10 -0
  45. package/build/esm/components/Icon/Icon.d.ts +10 -0
  46. package/build/esm/components/Icon/Icon.js +22 -0
  47. package/build/esm/components/Icon/Icon.js.map +1 -0
  48. package/build/esm/components/IconWrapper/IconWrapper.css +3 -2
  49. package/build/esm/components/IconWrapper/IconWrapper.js +6 -6
  50. package/build/esm/components/IconWrapper/IconWrapper.js.map +1 -1
  51. package/build/esm/models/constructor-items/blocks.d.ts +3 -2
  52. package/build/esm/models/constructor-items/blocks.js.map +1 -1
  53. package/build/esm/models/constructor-items/common.d.ts +10 -2
  54. package/build/esm/models/constructor-items/common.js.map +1 -1
  55. package/build/esm/models/constructor-items/sub-blocks.d.ts +7 -1
  56. package/build/esm/models/constructor-items/sub-blocks.js.map +1 -1
  57. package/build/esm/schema/constants.d.ts +21 -0
  58. package/build/esm/schema/validators/common.d.ts +21 -0
  59. package/build/esm/schema/validators/common.js +21 -0
  60. package/build/esm/schema/validators/common.js.map +1 -1
  61. package/build/esm/sub-blocks/BasicCard/BasicCard.js +5 -2
  62. package/build/esm/sub-blocks/BasicCard/BasicCard.js.map +1 -1
  63. package/build/esm/sub-blocks/BasicCard/schema.d.ts +21 -0
  64. package/build/esm/sub-blocks/BasicCard/schema.js +2 -1
  65. package/build/esm/sub-blocks/BasicCard/schema.js.map +1 -1
  66. package/build/esm/sub-blocks/Content/schema.d.ts +31 -0
  67. package/build/esm/sub-blocks/Content/schema.js +2 -1
  68. package/build/esm/sub-blocks/Content/schema.js.map +1 -1
  69. package/build/esm/text-transform/config.js +0 -9
  70. package/build/esm/text-transform/config.js.map +1 -1
  71. package/package.json +1 -1
  72. package/schema/index.js +1 -1
  73. package/server/models/constructor-items/blocks.d.ts +3 -2
  74. package/server/models/constructor-items/common.d.ts +10 -2
  75. package/server/models/constructor-items/sub-blocks.d.ts +7 -1
  76. package/server/text-transform/config.js +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"../../../../src","sources":["components/Button/Button.tsx"],"names":[],"mappings":"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","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 id?: 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"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":"../../../../src","sources":["components/Button/Button.tsx"],"names":[],"mappings":"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","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\nconst DEFAULT_IMG_SIZE = 16;\n\nexport interface ButtonProps extends Omit<ButtonParams, 'url'>, QAProps {\n className?: string;\n id?: 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 ? {\n url: img.url,\n iconData: img.iconData,\n iconSize: img.iconSize,\n className: img.className,\n position: img.position || defaultImgPosition,\n alt: img.alt,\n }\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;\n\n if (img && buttonImg.iconData) {\n const iconSize = buttonImg.iconSize;\n const iconClassName = buttonImg.className ? b('icon', buttonImg.className) : b('icon');\n icon = (\n <Icon\n className={iconClassName}\n data={buttonImg.iconData}\n size={iconSize}\n qa={ICON_QA}\n />\n );\n } else if (img && buttonImg.url) {\n image = (\n <img\n className={b('image')}\n width={buttonImg.iconSize || DEFAULT_IMG_SIZE}\n height={buttonImg.iconSize || DEFAULT_IMG_SIZE}\n src={buttonImg.url}\n alt={buttonImg.alt || i18n('image-alt')}\n />\n );\n }\n\n // Special handling for github theme (for backwards compatibility)\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"]}
@@ -19,8 +19,8 @@ function getHeadingLevel(size) {
19
19
  const ContentList = ({ list, size = 'l', qa, theme }) => {
20
20
  const qaAttributes = getQaAttrubutes(qa, ['image', 'title', 'text']);
21
21
  return (_jsx("div", { className: b({ size, theme }), "data-qa": qa, children: list?.map((item) => {
22
- const { icon, title, text } = item;
23
- return (_jsxs("div", { className: b('item', { 'without-title': !title }), children: [_jsx(ItemIcon, { icon: icon, className: b('icon'), qa: qaAttributes.image }), _jsxs("div", { children: [title &&
22
+ const { icon, title, text, gravityIcon } = item;
23
+ return (_jsxs("div", { className: b('item', { 'without-title': !title }), children: [_jsx(ItemIcon, { icon: icon, className: b('icon'), qa: qaAttributes.image, gravityIcon: gravityIcon }), _jsxs("div", { children: [title &&
24
24
  React.createElement(getHeadingLevel(size), { className: b('title'), 'data-qa': qaAttributes.title }, _jsx(YFMWrapper, { content: title, modifiers: { constructor: true } })), text && (_jsx(YFMWrapper, { contentClassName: b('text', { 'without-title': !title }), content: text, modifiers: { constructor: true }, qa: qaAttributes.text }))] })] }, uuidv4()));
25
25
  }) }));
26
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ContentList.js","sourceRoot":"../../../../src","sources":["components/ContentList/ContentList.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAIlC,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,EAAC,eAAe,EAAC,8BAA2B;AACnD,OAAO,UAAU,oCAAiC;AAElD,OAAO,QAAQ,iCAA8B;AAE7C,OAAO,mBAAmB,CAAC;AAE3B,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAEhC,SAAS,eAAe,CAAC,IAAiB;IACtC,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG;YACJ,OAAO,IAAI,CAAC;QAChB,KAAK,GAAG,CAAC;QACT;YACI,OAAO,IAAI,CAAC;IACpB,CAAC;AACL,CAAC;AAED,MAAM,WAAW,GAAG,CAAC,EAAC,IAAI,EAAE,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,KAAK,EAA6B,EAAE,EAAE;IAC9E,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAErE,OAAO,CACH,cAAK,SAAS,EAAE,CAAC,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC,aAAW,EAAE,YACxC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAChB,MAAM,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC;YACjC,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,eAAe,EAAE,CAAC,KAAK,EAAC,CAAC,aAChD,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,KAAK,GAAI,EACtE,0BACK,KAAK;gCACF,KAAK,CAAC,aAAa,CACf,eAAe,CAAC,IAAI,CAAC,EACrB,EAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,KAAK,EAAC,EACtD,KAAC,UAAU,IAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,GAAI,CACjE,EACJ,IAAI,IAAI,CACL,KAAC,UAAU,IACP,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,eAAe,EAAE,CAAC,KAAK,EAAC,CAAC,EACtD,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,EAC9B,EAAE,EAAE,YAAY,CAAC,IAAI,GACvB,CACL,IACC,KAjBiD,MAAM,EAAE,CAkB7D,CACT,CAAC;QACN,CAAC,CAAC,GACA,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {v4 as uuidv4} from 'uuid';\n\nimport {ContentListProps, ContentSize} from '../../models';\nimport {QAProps} from '../../models/common';\nimport {block} from '../../utils';\nimport {getQaAttrubutes} from '../../utils/blocks';\nimport YFMWrapper from '../YFMWrapper/YFMWrapper';\n\nimport ItemIcon from './ContentListItemIcon';\n\nimport './ContentList.scss';\n\nconst b = block('content-list');\n\nfunction getHeadingLevel(size: ContentSize) {\n switch (size) {\n case 's':\n return 'h4';\n case 'l':\n default:\n return 'h3';\n }\n}\n\nconst ContentList = ({list, size = 'l', qa, theme}: ContentListProps & QAProps) => {\n const qaAttributes = getQaAttrubutes(qa, ['image', 'title', 'text']);\n\n return (\n <div className={b({size, theme})} data-qa={qa}>\n {list?.map((item) => {\n const {icon, title, text} = item;\n return (\n <div className={b('item', {'without-title': !title})} key={uuidv4()}>\n <ItemIcon icon={icon} className={b('icon')} qa={qaAttributes.image} />\n <div>\n {title &&\n React.createElement(\n getHeadingLevel(size),\n {className: b('title'), 'data-qa': qaAttributes.title},\n <YFMWrapper content={title} modifiers={{constructor: true}} />,\n )}\n {text && (\n <YFMWrapper\n contentClassName={b('text', {'without-title': !title})}\n content={text}\n modifiers={{constructor: true}}\n qa={qaAttributes.text}\n />\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default ContentList;\n"]}
1
+ {"version":3,"file":"ContentList.js","sourceRoot":"../../../../src","sources":["components/ContentList/ContentList.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAIlC,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,EAAC,eAAe,EAAC,8BAA2B;AACnD,OAAO,UAAU,oCAAiC;AAElD,OAAO,QAAQ,iCAA8B;AAE7C,OAAO,mBAAmB,CAAC;AAE3B,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAEhC,SAAS,eAAe,CAAC,IAAiB;IACtC,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG;YACJ,OAAO,IAAI,CAAC;QAChB,KAAK,GAAG,CAAC;QACT;YACI,OAAO,IAAI,CAAC;IACpB,CAAC;AACL,CAAC;AAED,MAAM,WAAW,GAAG,CAAC,EAAC,IAAI,EAAE,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,KAAK,EAA6B,EAAE,EAAE;IAC9E,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAErE,OAAO,CACH,cAAK,SAAS,EAAE,CAAC,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC,aAAW,EAAE,YACxC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAChB,MAAM,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAC,GAAG,IAAI,CAAC;YAC9C,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,eAAe,EAAE,CAAC,KAAK,EAAC,CAAC,aAChD,KAAC,QAAQ,IACL,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EACpB,EAAE,EAAE,YAAY,CAAC,KAAK,EACtB,WAAW,EAAE,WAAW,GAC1B,EACF,0BACK,KAAK;gCACF,KAAK,CAAC,aAAa,CACf,eAAe,CAAC,IAAI,CAAC,EACrB,EAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,KAAK,EAAC,EACtD,KAAC,UAAU,IAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,GAAI,CACjE,EACJ,IAAI,IAAI,CACL,KAAC,UAAU,IACP,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,eAAe,EAAE,CAAC,KAAK,EAAC,CAAC,EACtD,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,EAC9B,EAAE,EAAE,YAAY,CAAC,IAAI,GACvB,CACL,IACC,KAtBiD,MAAM,EAAE,CAuB7D,CACT,CAAC;QACN,CAAC,CAAC,GACA,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {v4 as uuidv4} from 'uuid';\n\nimport {ContentListProps, ContentSize} from '../../models';\nimport {QAProps} from '../../models/common';\nimport {block} from '../../utils';\nimport {getQaAttrubutes} from '../../utils/blocks';\nimport YFMWrapper from '../YFMWrapper/YFMWrapper';\n\nimport ItemIcon from './ContentListItemIcon';\n\nimport './ContentList.scss';\n\nconst b = block('content-list');\n\nfunction getHeadingLevel(size: ContentSize) {\n switch (size) {\n case 's':\n return 'h4';\n case 'l':\n default:\n return 'h3';\n }\n}\n\nconst ContentList = ({list, size = 'l', qa, theme}: ContentListProps & QAProps) => {\n const qaAttributes = getQaAttrubutes(qa, ['image', 'title', 'text']);\n\n return (\n <div className={b({size, theme})} data-qa={qa}>\n {list?.map((item) => {\n const {icon, title, text, gravityIcon} = item;\n return (\n <div className={b('item', {'without-title': !title})} key={uuidv4()}>\n <ItemIcon\n icon={icon}\n className={b('icon')}\n qa={qaAttributes.image}\n gravityIcon={gravityIcon}\n />\n <div>\n {title &&\n React.createElement(\n getHeadingLevel(size),\n {className: b('title'), 'data-qa': qaAttributes.title},\n <YFMWrapper content={title} modifiers={{constructor: true}} />,\n )}\n {text && (\n <YFMWrapper\n contentClassName={b('text', {'without-title': !title})}\n content={text}\n modifiers={{constructor: true}}\n qa={qaAttributes.text}\n />\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default ContentList;\n"]}
@@ -1,7 +1,8 @@
1
- import { ClassNameProps, ImageProps, QAProps, SVGIcon } from "../../models/index.js";
1
+ import { ClassNameProps, GravityIconProps, ImageProps, QAProps, SVGIcon } from "../../models/index.js";
2
2
  import { ThemeSupporting } from "../../utils/index.js";
3
3
  interface ListItemProps extends QAProps, ClassNameProps {
4
- icon: ThemeSupporting<ImageProps | SVGIcon>;
4
+ icon?: ThemeSupporting<ImageProps | SVGIcon>;
5
+ gravityIcon?: ThemeSupporting<GravityIconProps>;
5
6
  }
6
- declare const ContentListItemIcon: ({ icon, className, qa }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
7
+ declare const ContentListItemIcon: ({ icon, className, qa, gravityIcon }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export default ContentListItemIcon;
@@ -1,20 +1,19 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useTheme } from "../../context/theme/index.js";
3
3
  import { getThemedValue } from "../../utils/index.js";
4
- import Image from "../Image/Image.js";
5
- import { getMediaImage } from "../Media/Image/utils.js";
4
+ import Icon from "../Icon/Icon.js";
6
5
  function isIconSvg(icon) {
7
6
  return typeof icon === 'function';
8
7
  }
9
- const ContentListItemIcon = ({ icon, className, qa }) => {
8
+ const ContentListItemIcon = ({ icon, className, qa, gravityIcon }) => {
10
9
  const theme = useTheme();
11
10
  const iconThemed = getThemedValue(icon, theme);
12
- if (isIconSvg(iconThemed)) {
13
- const Icon = iconThemed;
14
- return (_jsx("div", { children: _jsx(Icon, { className: className }) }));
11
+ const gravityIconThemed = getThemedValue(gravityIcon, theme);
12
+ if (iconThemed && isIconSvg(iconThemed)) {
13
+ const IconComponent = iconThemed;
14
+ return (_jsx("div", { children: _jsx(IconComponent, { className: className }) }));
15
15
  }
16
- const iconData = getMediaImage(iconThemed);
17
- return _jsx(Image, { ...iconData, className: className, qa: qa });
16
+ return _jsx(Icon, { icon: iconThemed, gravityIcon: gravityIconThemed, className: className, qa: qa });
18
17
  };
19
18
  export default ContentListItemIcon;
20
19
  //# sourceMappingURL=ContentListItemIcon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentListItemIcon.js","sourceRoot":"../../../../src","sources":["components/ContentList/ContentListItemIcon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAE7C,OAAO,EAAkB,cAAc,EAAC,6BAAoB;AAC5D,OAAO,KAAK,0BAAuB;AACnC,OAAO,EAAC,aAAa,EAAC,gCAA6B;AAMnD,SAAS,SAAS,CAAC,IAA0B;IACzC,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC;AACtC,CAAC;AAED,MAAM,mBAAmB,GAAG,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAgB,EAAE,EAAE;IACjE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAE/C,IAAI,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,GAAG,UAAU,CAAC;QACxB,OAAO,CACH,wBACI,KAAC,IAAI,IAAC,SAAS,EAAE,SAAS,GAAI,GAC5B,CACT,CAAC;IACN,CAAC;IACD,MAAM,QAAQ,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IAC3C,OAAO,KAAC,KAAK,OAAK,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,GAAI,CAAC;AACjE,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import {useTheme} from '../../context/theme';\nimport {ClassNameProps, ImageProps, QAProps, SVGIcon} from '../../models';\nimport {ThemeSupporting, getThemedValue} from '../../utils';\nimport Image from '../Image/Image';\nimport {getMediaImage} from '../Media/Image/utils';\n\ninterface ListItemProps extends QAProps, ClassNameProps {\n icon: ThemeSupporting<ImageProps | SVGIcon>;\n}\n\nfunction isIconSvg(icon: ImageProps | SVGIcon): icon is SVGIcon {\n return typeof icon === 'function';\n}\n\nconst ContentListItemIcon = ({icon, className, qa}: ListItemProps) => {\n const theme = useTheme();\n const iconThemed = getThemedValue(icon, theme);\n\n if (isIconSvg(iconThemed)) {\n const Icon = iconThemed;\n return (\n <div>\n <Icon className={className} />\n </div>\n );\n }\n const iconData = getMediaImage(iconThemed);\n return <Image {...iconData} className={className} qa={qa} />;\n};\n\nexport default ContentListItemIcon;\n"]}
1
+ {"version":3,"file":"ContentListItemIcon.js","sourceRoot":"../../../../src","sources":["components/ContentList/ContentListItemIcon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAE7C,OAAO,EAAkB,cAAc,EAAC,6BAAoB;AAC5D,OAAO,IAAI,wBAAqB;AAOhC,SAAS,SAAS,CAAC,IAA0B;IACzC,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC;AACtC,CAAC;AAED,MAAM,mBAAmB,GAAG,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAgB,EAAE,EAAE;IAC9E,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/C,MAAM,iBAAiB,GAAG,cAAc,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAE7D,IAAI,UAAU,IAAI,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,aAAa,GAAG,UAAU,CAAC;QACjC,OAAO,CACH,wBACI,KAAC,aAAa,IAAC,SAAS,EAAE,SAAS,GAAI,GACrC,CACT,CAAC;IACN,CAAC;IAED,OAAO,KAAC,IAAI,IAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,GAAI,CAAC;AACpG,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import {useTheme} from '../../context/theme';\nimport {ClassNameProps, GravityIconProps, ImageProps, QAProps, SVGIcon} from '../../models';\nimport {ThemeSupporting, getThemedValue} from '../../utils';\nimport Icon from '../Icon/Icon';\n\ninterface ListItemProps extends QAProps, ClassNameProps {\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nfunction isIconSvg(icon: ImageProps | SVGIcon): icon is SVGIcon {\n return typeof icon === 'function';\n}\n\nconst ContentListItemIcon = ({icon, className, qa, gravityIcon}: ListItemProps) => {\n const theme = useTheme();\n const iconThemed = getThemedValue(icon, theme);\n const gravityIconThemed = getThemedValue(gravityIcon, theme);\n\n if (iconThemed && isIconSvg(iconThemed)) {\n const IconComponent = iconThemed;\n return (\n <div>\n <IconComponent className={className} />\n </div>\n );\n }\n\n return <Icon icon={iconThemed} gravityIcon={gravityIconThemed} className={className} qa={qa} />;\n};\n\nexport default ContentListItemIcon;\n"]}
@@ -0,0 +1,10 @@
1
+ /* use this for style redefinitions to awoid problems with
2
+ unpredictable css rules order in build */
3
+ .pc-icon_color_brand {
4
+ /* stylelint-disable-next-line declaration-no-important */
5
+ color: var(--g-color-base-brand) !important;
6
+ }
7
+ .pc-icon_color_brand * {
8
+ /* stylelint-disable-next-line declaration-no-important */
9
+ color: var(--g-color-base-brand) !important;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { GravityIconProps, ImageProps, QAProps } from "../../models/index.js";
2
+ import { ImageProps as ImageComponentProps } from "../Image/Image.js";
3
+ import './Icon.css';
4
+ type Props = {
5
+ gravityIcon?: GravityIconProps;
6
+ icon?: ImageProps;
7
+ className?: string;
8
+ } & Pick<ImageComponentProps, 'containerClassName'> & QAProps;
9
+ declare const Icon: ({ icon, className, gravityIcon, containerClassName, qa }: Props) => import("react/jsx-runtime").JSX.Element | null;
10
+ export default Icon;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as icons from '@gravity-ui/icons';
3
+ import { Icon as UiKitIcon } from '@gravity-ui/uikit';
4
+ import { block } from "../../utils/index.js";
5
+ import Image from "../Image/Image.js";
6
+ import { getMediaImage } from "../Media/Image/utils.js";
7
+ import './Icon.css';
8
+ const b = block('icon');
9
+ const Icon = ({ icon, className, gravityIcon, containerClassName, qa }) => {
10
+ if (gravityIcon) {
11
+ const data = (typeof gravityIcon === 'string' ? gravityIcon : gravityIcon.name);
12
+ const color = typeof gravityIcon === 'string' ? 'brand' : gravityIcon.color;
13
+ return (_jsx("div", { className: b({ color }), children: _jsx(UiKitIcon, { data: icons[data], className: className, qa: qa }) }));
14
+ }
15
+ if (icon) {
16
+ const image = getMediaImage(icon);
17
+ return (_jsx(Image, { ...image, containerClassName: containerClassName, className: className, qa: qa }));
18
+ }
19
+ return null;
20
+ };
21
+ export default Icon;
22
+ //# sourceMappingURL=Icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.js","sourceRoot":"../../../../src","sources":["components/Icon/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,IAAI,IAAI,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,KAA0C,0BAAuB;AACxE,OAAO,EAAC,aAAa,EAAC,gCAA6B;AAEnD,OAAO,YAAY,CAAC;AAEpB,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AASxB,MAAM,IAAI,GAAG,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,EAAE,EAAQ,EAAE,EAAE;IAC3E,IAAI,WAAW,EAAE,CAAC;QACd,MAAM,IAAI,GAAG,CACT,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAC7C,CAAC;QACxB,MAAM,KAAK,GAAG,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC;QAE5E,OAAO,CACH,cAAK,SAAS,EAAE,CAAC,CAAC,EAAC,KAAK,EAAC,CAAC,YACtB,KAAC,SAAS,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,GAAI,GAC5D,CACT,CAAC;IACN,CAAC;IAED,IAAI,IAAI,EAAE,CAAC;QACP,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QAElC,OAAO,CACH,KAAC,KAAK,OACE,KAAK,EACT,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,EAAE,GACR,CACL,CAAC;IACN,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import * as icons from '@gravity-ui/icons';\nimport {Icon as UiKitIcon} from '@gravity-ui/uikit';\n\nimport {GravityIconProps, ImageProps, QAProps} from '../../models';\nimport {block} from '../../utils';\nimport Image, {ImageProps as ImageComponentProps} from '../Image/Image';\nimport {getMediaImage} from '../Media/Image/utils';\n\nimport './Icon.scss';\n\nconst b = block('icon');\n\ntype Props = {\n gravityIcon?: GravityIconProps;\n icon?: ImageProps;\n className?: string;\n} & Pick<ImageComponentProps, 'containerClassName'> &\n QAProps;\n\nconst Icon = ({icon, className, gravityIcon, containerClassName, qa}: Props) => {\n if (gravityIcon) {\n const data = (\n typeof gravityIcon === 'string' ? gravityIcon : gravityIcon.name\n ) as keyof typeof icons;\n const color = typeof gravityIcon === 'string' ? 'brand' : gravityIcon.color;\n\n return (\n <div className={b({color})}>\n <UiKitIcon data={icons[data]} className={className} qa={qa} />\n </div>\n );\n }\n\n if (icon) {\n const image = getMediaImage(icon);\n\n return (\n <Image\n {...image}\n containerClassName={containerClassName}\n className={className}\n qa={qa}\n />\n );\n }\n return null;\n};\n\nexport default Icon;\n"]}
@@ -14,6 +14,7 @@ unpredictable css rules order in build */
14
14
  max-width: 100%;
15
15
  margin-bottom: 12px;
16
16
  height: 32px;
17
+ width: 32px;
17
18
  object-fit: contain;
18
19
  display: block;
19
20
  }
@@ -29,8 +30,8 @@ unpredictable css rules order in build */
29
30
  margin-top: 4px;
30
31
  }
31
32
  .pc-icon-wrapper__icon_icon-position_left.pc-icon-wrapper__icon_size_l {
32
- height: 30px;
33
- width: 30px;
33
+ height: 32px;
34
+ width: 32px;
34
35
  margin-bottom: 4px;
35
36
  margin-top: 4px;
36
37
  }
@@ -1,18 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { block } from "../../utils/index.js";
4
- import Image from "../Image/Image.js";
5
- import { getMediaImage } from "../Media/Image/utils.js";
4
+ import Icon from "../Icon/Icon.js";
6
5
  import './IconWrapper.css';
7
6
  const b = block('icon-wrapper');
8
7
  const IconWrapper = (props) => {
9
- const { icon, children, className, size } = props;
10
- if (!icon) {
8
+ const { icon, children, className, size, gravityIcon } = props;
9
+ if (!icon && !gravityIcon) {
11
10
  return _jsx(React.Fragment, { children: children });
12
11
  }
13
- const iconProps = getMediaImage(icon.value);
14
12
  const iconPosition = icon?.position;
15
- return (_jsxs("div", { className: b({ ['icon-position']: iconPosition }, className), children: [iconProps && (_jsx(Image, { ...iconProps, containerClassName: b('icon-container'), className: b('icon', { ['icon-position']: iconPosition, size }) })), _jsx("div", { className: b('content', { ['icon-position']: iconPosition }), children: children })] }));
13
+ const gravityIconPosition = gravityIcon?.position;
14
+ const position = gravityIconPosition || iconPosition;
15
+ return (_jsxs("div", { className: b({ ['icon-position']: position }, className), children: [_jsx(Icon, { icon: icon?.value, gravityIcon: gravityIcon?.value, containerClassName: b('icon-container'), className: b('icon', { ['icon-position']: position, size }) }), _jsx("div", { className: b('content', { ['icon-position']: position }), children: children })] }));
16
16
  };
17
17
  export default IconWrapper;
18
18
  //# sourceMappingURL=IconWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconWrapper.js","sourceRoot":"../../../../src","sources":["components/IconWrapper/IconWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,KAAK,0BAAuB;AACnC,OAAO,EAAC,aAAa,EAAC,gCAA6B;AAEnD,OAAO,mBAAmB,CAAC;AAE3B,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAEhC,MAAM,WAAW,GAAG,CAAC,KAAiE,EAAE,EAAE;IACtF,MAAM,EAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;IAChD,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,KAAC,KAAK,CAAC,QAAQ,cAAE,QAAQ,GAAkB,CAAC;IACvD,CAAC;IAED,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,IAAI,EAAE,QAAQ,CAAC;IAEpC,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,CAAC,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAC,EAAE,SAAS,CAAC,aAC1D,SAAS,IAAI,CACV,KAAC,KAAK,OACE,SAAS,EACb,kBAAkB,EAAE,CAAC,CAAC,gBAAgB,CAAC,EACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC,GAC/D,CACL,EACD,cAAK,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EAAC,CAAC,eAAe,CAAC,EAAE,YAAY,EAAC,CAAC,YAAG,QAAQ,GAAO,IAC/E,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type {ClassNameProps, IconWrapperProps} from '../../models';\nimport {block} from '../../utils';\nimport Image from '../Image/Image';\nimport {getMediaImage} from '../Media/Image/utils';\n\nimport './IconWrapper.scss';\n\nconst b = block('icon-wrapper');\n\nconst IconWrapper = (props: React.PropsWithChildren<IconWrapperProps> & ClassNameProps) => {\n const {icon, children, className, size} = props;\n if (!icon) {\n return <React.Fragment>{children}</React.Fragment>;\n }\n\n const iconProps = getMediaImage(icon.value);\n const iconPosition = icon?.position;\n\n return (\n <div className={b({['icon-position']: iconPosition}, className)}>\n {iconProps && (\n <Image\n {...iconProps}\n containerClassName={b('icon-container')}\n className={b('icon', {['icon-position']: iconPosition, size})}\n />\n )}\n <div className={b('content', {['icon-position']: iconPosition})}>{children}</div>\n </div>\n );\n};\n\nexport default IconWrapper;\n"]}
1
+ {"version":3,"file":"IconWrapper.js","sourceRoot":"../../../../src","sources":["components/IconWrapper/IconWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,IAAI,wBAAqB;AAEhC,OAAO,mBAAmB,CAAC;AAC3B,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAEhC,MAAM,WAAW,GAAG,CAAC,KAAiE,EAAE,EAAE;IACtF,MAAM,EAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAC,GAAG,KAAK,CAAC;IAC7D,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;QACxB,OAAO,KAAC,KAAK,CAAC,QAAQ,cAAE,QAAQ,GAAkB,CAAC;IACvD,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,EAAE,QAAQ,CAAC;IAEpC,MAAM,mBAAmB,GAAG,WAAW,EAAE,QAAQ,CAAC;IAElD,MAAM,QAAQ,GAAG,mBAAmB,IAAI,YAAY,CAAC;IAErD,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,CAAC,EAAC,CAAC,eAAe,CAAC,EAAE,QAAQ,EAAC,EAAE,SAAS,CAAC,aACvD,KAAC,IAAI,IACD,IAAI,EAAE,IAAI,EAAE,KAAK,EACjB,WAAW,EAAE,WAAW,EAAE,KAAK,EAC/B,kBAAkB,EAAE,CAAC,CAAC,gBAAgB,CAAC,EACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,CAAC,eAAe,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,GAC3D,EACF,cAAK,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EAAC,CAAC,eAAe,CAAC,EAAE,QAAQ,EAAC,CAAC,YAAG,QAAQ,GAAO,IAC3E,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type {ClassNameProps, IconWrapperProps} from '../../models';\nimport {block} from '../../utils';\nimport Icon from '../Icon/Icon';\n\nimport './IconWrapper.scss';\nconst b = block('icon-wrapper');\n\nconst IconWrapper = (props: React.PropsWithChildren<IconWrapperProps> & ClassNameProps) => {\n const {icon, children, className, size, gravityIcon} = props;\n if (!icon && !gravityIcon) {\n return <React.Fragment>{children}</React.Fragment>;\n }\n\n const iconPosition = icon?.position;\n\n const gravityIconPosition = gravityIcon?.position;\n\n const position = gravityIconPosition || iconPosition;\n\n return (\n <div className={b({['icon-position']: position}, className)}>\n <Icon\n icon={icon?.value}\n gravityIcon={gravityIcon?.value}\n containerClassName={b('icon-container')}\n className={b('icon', {['icon-position']: position, size})}\n />\n <div className={b('content', {['icon-position']: position})}>{children}</div>\n </div>\n );\n};\n\nexport default IconWrapper;\n"]}
@@ -3,7 +3,7 @@ import { ButtonSize } from '@gravity-ui/uikit';
3
3
  import { GridColumnSize, GridColumnSizesType, IndentValue } from "../../grid/types.js";
4
4
  import { ThemeSupporting } from "../../utils/index.js";
5
5
  import { AnalyticsEventsBase } from "../common.js";
6
- import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, CardBorder, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, ImageProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, MediaView, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, WithBorder, YandexFormProps } from "./common.js";
6
+ import { AnchorProps, Animatable, BackgroundImageProps, ButtonProps, CardBorder, ContentSize, ContentTextSize, ContentTheme, FileLinkProps, GravityIconProps, HeaderBreadCrumbsProps, HeaderImageSize, HeaderOffset, HeaderWidth, ImageDeviceProps, ImageProps, Justify, LegendTableMarkerType, LinkProps, MapProps, MediaDirection, MediaProps, MediaView, TextSize, TextTheme, ThemedImage, ThemedMediaProps, ThemedMediaVideoProps, TitleItemBaseProps, TitleItemProps, WithBorder, YandexFormProps } from "./common.js";
7
7
  import { BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels } from "./sub-blocks.js";
8
8
  export declare enum BlockType {
9
9
  PromoFeaturesBlock = "promo-features-block",
@@ -315,7 +315,8 @@ export type SVGIcon = (props: React.SVGProps<SVGSVGElement>) => React.ReactNode;
315
315
  export interface ContentItemProps {
316
316
  title?: string;
317
317
  text?: string;
318
- icon: ThemeSupporting<ImageProps | SVGIcon>;
318
+ icon?: ThemeSupporting<ImageProps | SVGIcon>;
319
+ gravityIcon?: ThemeSupporting<GravityIconProps>;
319
320
  }
320
321
  export interface ContentListProps {
321
322
  list: ContentItemProps[];
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":"AA2CA,MAAM,CAAN,IAAY,SAuBX;AAvBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,kBAAkB;IAClB,gDAAmC,CAAA;IACnC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,sDAAyC,CAAA;IACzC,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;AAC5B,CAAC,EAvBW,SAAS,KAAT,SAAS,QAuBpB;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;IAC1B,gDAAkC,CAAA;AACtC,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAkUD,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B;AAOD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,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 /** @deprecated */\n SliderOldBlock = 'slider-old-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n FoldableListBlock = 'foldable-list-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}\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 FullscreenCard = 'fullscreen-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderOldProps 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 | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\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 | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderOldProps, '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 additionalInfo?: 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 centered?: boolean;\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 FoldableListItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface FoldableListProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: FoldableListItem[];\n}\n\nexport interface FoldableListBlockItemProps extends FoldableListItem {\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 = (props: React.SVGProps<SVGSVGElement>) => React.ReactNode;\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 SliderOldBlockModel = {\n type: BlockType.SliderOldBlock;\n} & SliderOldProps;\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 FoldableListBlockModel = {\n type: BlockType.FoldableListBlock;\n} & FoldableListProps;\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\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\ntype BlockModels =\n | SliderOldBlockModel\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | FoldableListBlockModel\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\nexport type Block = BlockModels & BlockBaseProps;\n"]}
1
+ {"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":"AA4CA,MAAM,CAAN,IAAY,SAuBX;AAvBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,kBAAkB;IAClB,gDAAmC,CAAA;IACnC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,sDAAyC,CAAA;IACzC,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;AAC5B,CAAC,EAvBW,SAAS,KAAT,SAAS,QAuBpB;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;IAC1B,gDAAkC,CAAA;AACtC,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAmUD,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B;AAOD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,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 GravityIconProps,\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 /** @deprecated */\n SliderOldBlock = 'slider-old-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n FoldableListBlock = 'foldable-list-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}\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 FullscreenCard = 'fullscreen-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderOldProps 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 | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\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 | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderOldProps, '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 additionalInfo?: 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 centered?: boolean;\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 FoldableListItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface FoldableListProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: FoldableListItem[];\n}\n\nexport interface FoldableListBlockItemProps extends FoldableListItem {\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 = (props: React.SVGProps<SVGSVGElement>) => React.ReactNode;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\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 SliderOldBlockModel = {\n type: BlockType.SliderOldBlock;\n} & SliderOldProps;\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 FoldableListBlockModel = {\n type: BlockType.FoldableListBlock;\n} & FoldableListProps;\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\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\ntype BlockModels =\n | SliderOldBlockModel\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | FoldableListBlockModel\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\nexport type Block = BlockModels & BlockBaseProps;\n"]}
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- import { ButtonView, ButtonProps as UikitButtonProps } from '@gravity-ui/uikit';
2
+ import * as icons from '@gravity-ui/icons';
3
+ import { ButtonView, IconData, ButtonProps as UikitButtonProps } from '@gravity-ui/uikit';
3
4
  import { ThemeSupporting } from "../../utils/index.js";
4
5
  import { AnalyticsEventsBase, AnalyticsEventsProp, ClassNameProps, QAProps } from "../common.js";
5
6
  export declare enum AuthorType {
@@ -64,6 +65,10 @@ export type ContentTheme = 'default' | 'dark' | 'light';
64
65
  export type FileLinkType = 'vertical' | 'horizontal';
65
66
  export type ImageCardMargins = 's' | 'm';
66
67
  export type LayoutItemContentMargin = 'm' | 'l';
68
+ export type GravityIconProps = string | {
69
+ name: keyof typeof icons;
70
+ color: 'brand' | 'text-color';
71
+ };
67
72
  export interface Themable {
68
73
  theme?: TextTheme;
69
74
  }
@@ -173,9 +178,12 @@ export interface ButtonProps extends AnalyticsEventsBase, Pick<UikitButtonProps,
173
178
  }
174
179
  export type ButtonImagePosition = 'left' | 'right';
175
180
  export interface ButtonImageProps {
176
- url: string;
181
+ url?: string;
177
182
  position?: ButtonImagePosition;
178
183
  alt?: string;
184
+ iconData?: IconData;
185
+ iconSize?: number;
186
+ className?: string;
179
187
  }
180
188
  export interface CustomControlsOptions {
181
189
  type?: CustomControlsType;
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"../../../../src","sources":["models/constructor-items/common.ts"],"names":[],"mappings":"AAOA,QAAQ;AACR,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACjB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,+CAA2B,CAAA;IAC3B,yCAAqB,CAAA;AACzB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAED,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,8BAAW,CAAA;AACf,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;AACjB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,iCAAa,CAAA;IACb,iCAAa,CAAA;AACjB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,yDAAmC,CAAA;IACnC,oEAA8C,CAAA;AAClD,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,+BAIX;AAJD,WAAY,+BAA+B;IACvC,gDAAa,CAAA;IACb,kDAAe,CAAA;IACf,oDAAiB,CAAA;AACrB,CAAC,EAJW,+BAA+B,KAA/B,+BAA+B,QAI1C;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;AACrB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAC9B,6CAAmB,CAAA;IACnB,2CAAiB,CAAA;AACrB,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC;AAED,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,gCAAmB,CAAA;IACnB,6CAAgC,CAAA;AACpC,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAsED,SAAS;AAET,MAAM,CAAN,IAAY,MAIX;AAJD,WAAY,MAAM;IACd,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,2BAAiB,CAAA;AACrB,CAAC,EAJW,MAAM,KAAN,MAAM,QAIjB","sourcesContent":["import * as React from 'react';\n\nimport {ButtonView, ButtonProps as UikitButtonProps} from '@gravity-ui/uikit';\n\nimport {ThemeSupporting} from '../../utils';\nimport {AnalyticsEventsBase, AnalyticsEventsProp, ClassNameProps, QAProps} from '../common';\n\n// enums\nexport enum AuthorType {\n Column = 'column',\n Line = 'line',\n}\n\nexport enum PriceDetailsType {\n MARKED_LIST = 'marked-list',\n SETTINGS = 'settings',\n}\n\nexport enum PriceLabelColor {\n BLUE = 'blue',\n GREEN = 'green',\n YELLOW = 'yellow',\n PURPLE = 'purple',\n RED = 'red',\n}\n\nexport enum PlayButtonType {\n Default = 'default',\n Text = 'text',\n}\n\nexport enum PlayButtonThemes {\n Blue = 'blue',\n Grey = 'grey',\n}\n\nexport enum CustomControlsType {\n WithMuteButton = 'with-mute-button',\n WithPlayPauseButton = 'with-play-pause-button',\n}\n\nexport enum CustomControlsButtonPositioning {\n Left = 'left',\n Right = 'right',\n Center = 'center',\n}\n\nexport enum MediaVideoType {\n Default = 'default',\n Player = 'player',\n}\n\nexport enum MediaVideoControlsType {\n Default = 'default',\n Custom = 'custom',\n}\n\nexport enum QuoteType {\n Chevron = 'chevron', // « »\n EnglishDouble = 'english-double', // “ ”\n}\n\n// types\nexport type TextTheme = 'light' | 'dark';\nexport type TextSize = 'xs' | 's' | 'sm' | 'm' | 'l';\nexport type DividerSize = '0' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';\nexport type HeaderWidth = 's' | 'm' | 'l';\nexport type HeaderImageSize = 's' | 'm';\nexport type HeaderOffset = 'default' | 'large';\nexport type Justify = 'start' | 'center' | 'end';\nexport type ColumnsCount = 1 | 2 | 3 | 4;\nexport type LegendTableMarkerType = 'disk' | 'tick';\nexport type LinkTheme = 'file-link' | 'normal' | 'back' | 'underline';\nexport type MediaDirection = 'media-content' | 'content-media';\nexport type PriceDescriptionColor = 'cornflower' | 'black';\nexport type ContentSize = 's' | 'm' | 'l';\nexport type ContentTextSize = 's' | 'm' | 'l';\nexport type ContentTheme = 'default' | 'dark' | 'light';\nexport type FileLinkType = 'vertical' | 'horizontal';\nexport type ImageCardMargins = 's' | 'm';\nexport type LayoutItemContentMargin = 'm' | 'l';\n\n// modifiers\nexport interface Themable {\n theme?: TextTheme;\n}\n\nexport interface Justifyable {\n justify?: Justify;\n}\n\nexport interface Stylable {\n className?: string;\n}\n\nexport interface Animatable {\n animated?: boolean;\n}\n\nexport interface Tabbable {\n tabIndex?: number;\n}\n\nexport interface Roleable {\n role?: React.AriaRole;\n}\n\nexport interface AriaProps {\n ariaProps?: React.AriaAttributes;\n}\n\n//common props\nexport interface Background {\n image?: string;\n color?: string;\n}\n\nexport interface AnchorProps {\n text: string;\n url: string;\n}\n\n/**\n * @deprecated Component VideoBlock will be deleted, which uses this logic\n */\ninterface LoopProps {\n start: number;\n end?: number;\n}\n\n// images\n\nexport enum Device {\n Desktop = 'desktop',\n Mobile = 'mobile',\n Tablet = 'tablet',\n}\n\nexport interface ImageInfoProps\n extends Pick<\n React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>,\n 'aria-describedby' | 'loading'\n >,\n ImageDevicesVisibleProps {\n alt?: string;\n fetchPriority?: 'high' | 'low' | 'auto';\n disableCompress?: boolean;\n}\n\nexport interface ImageObjectProps extends ImageInfoProps {\n src: string;\n}\n\nexport interface ImageDeviceProps extends ImageInfoProps {\n [Device.Desktop]: string;\n [Device.Mobile]: string;\n [Device.Tablet]?: string;\n}\n\nexport interface ImageDevicesVisibleProps {\n hide?: boolean | Partial<Record<Device, boolean>>;\n}\n\nexport type ImageProps = string | ImageObjectProps | ImageDeviceProps;\nexport type ThemedImage = ThemeSupporting<ImageProps>;\n\nexport interface BackgroundImageProps\n extends React.HTMLProps<HTMLDivElement>,\n Partial<ImageDeviceProps>,\n Partial<ImageObjectProps>,\n QAProps,\n ImageDevicesVisibleProps {\n style?: React.CSSProperties;\n imageClassName?: string;\n}\n\n//components props\nexport interface MediaVideoProps extends AnalyticsEventsBase {\n src: string[];\n type?: MediaVideoType;\n loop?: LoopProps | boolean;\n muted?: boolean;\n autoplay?: boolean;\n elapsedTime?: number;\n playButton?: PlayButtonProps;\n controls?: MediaVideoControlsType;\n customControlsOptions?: CustomControlsOptions;\n ariaLabel?: string;\n contain?: boolean;\n}\n\n// links\nexport interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {\n url: string;\n urlTitle?: string;\n text?: string;\n textSize?: TextSize;\n theme?: LinkTheme;\n colorTheme?: TextTheme;\n arrow?: boolean;\n target?: string;\n extraProps?: React.HTMLProps<HTMLAnchorElement>;\n}\n\nexport interface FileLinkProps extends ClassNameProps, Tabbable {\n href: string;\n text: React.ReactNode;\n type?: FileLinkType;\n textSize?: TextSize;\n theme?: ContentTheme;\n urlTitle?: string;\n onClick?: () => void;\n extraProps?: React.HTMLProps<HTMLAnchorElement>;\n}\n\n// buttons\nexport type ButtonTheme =\n | ButtonView\n | 'github'\n | 'app-store'\n | 'google-play'\n | 'scale'\n | 'monochrome';\n\nexport interface ButtonProps\n extends AnalyticsEventsBase,\n Pick<UikitButtonProps, 'size' | 'width' | 'extraProps'> {\n text: string;\n url: string;\n urlTitle?: string;\n primary?: boolean;\n theme?: ButtonTheme;\n img?: ButtonImageProps | string;\n target?: string;\n}\n\nexport type ButtonImagePosition = 'left' | 'right';\n\nexport interface ButtonImageProps {\n url: string;\n position?: ButtonImagePosition;\n alt?: string;\n}\n\nexport interface CustomControlsOptions {\n type?: CustomControlsType;\n muteButtonShown?: boolean;\n positioning?: CustomControlsButtonPositioning;\n}\n\nexport interface PlayButtonProps extends ClassNameProps {\n type?: PlayButtonType;\n theme?: PlayButtonThemes;\n text?: string;\n}\n\nexport type ThemedMediaVideoProps = ThemeSupporting<MediaVideoProps>;\n\nexport interface MediaComponentVideoProps extends AnalyticsEventsBase {\n video: MediaVideoProps;\n height?: number;\n ratio?: number | 'auto';\n previewImg?: string;\n}\n\nexport interface MediaComponentVideoIframeProps {\n videoIframe: string;\n}\n\nexport interface MediaComponentYoutubeProps {\n youtube: string;\n previewImg?: string;\n fullscreen?: boolean;\n}\n\nexport interface MediaComponentImageProps {\n image: ImageProps | ImageProps[] | ImageDeviceProps;\n video?: MediaVideoProps;\n parallax?: boolean;\n height?: number;\n disableImageSliderForArrayInput?: boolean;\n}\n\nexport interface MediaComponentDataLensProps {\n dataLens: DataLensProps;\n}\n\nexport interface MediaComponentIframeProps {\n iframe: IframeProps;\n margins?: boolean;\n}\n\nexport interface MediaProps\n extends Animatable,\n Partial<MediaComponentDataLensProps>,\n Partial<MediaComponentYoutubeProps>,\n Partial<MediaComponentVideoIframeProps>,\n Partial<MediaComponentImageProps>,\n Partial<MediaComponentIframeProps>,\n Partial<MediaComponentVideoProps> {\n color?: string;\n videoMicrodata?: {\n name?: string;\n description?: string;\n duration?: string;\n uploadDate?: string;\n contentUrl?: string;\n thumbnailUrl?: string;\n };\n}\n\nexport interface BackgroundMediaProps extends MediaProps, Animatable, QAProps {\n fullWidthMedia?: boolean;\n className?: string;\n mediaClassName?: string;\n}\n\nexport type Coordinate = number[];\n\nexport interface MapBaseProps {\n zoom?: number;\n className?: string;\n}\n\nexport interface GMapProps extends MapBaseProps {\n address: string;\n}\n\nexport interface YMapProps extends MapBaseProps {\n markers: YMapMarker[];\n id: string;\n}\n\nexport interface YMapMarker {\n address?: string;\n coordinate?: Coordinate;\n label?: YMapMarkerLabel;\n}\n\nexport interface YMapMarkerLabel {\n iconCaption?: string;\n iconContent?: string;\n iconColor?: string;\n preset?: string;\n}\n\nexport type MapProps = GMapProps | YMapProps;\n\nexport type ThemedMediaProps = ThemeSupporting<MediaProps>;\n\nexport interface DataLensObjectProps {\n id: string;\n theme: 'dark' | 'light';\n}\n\nexport interface IframeProps {\n src: string;\n width?: number;\n height?: number;\n title?: string;\n name?: string;\n}\n\nexport type DataLensProps = string | DataLensObjectProps;\n\nexport interface AuthorItem {\n firstName: string;\n secondName: string;\n description?: string;\n avatar?: ThemeSupporting<ImageProps> | JSX.Element;\n}\n\nexport interface HeaderBreadCrumbsProps extends ClassNameProps {\n items: {\n url: string;\n text: React.ReactNode;\n }[];\n theme?: TextTheme;\n analyticsEvents?: AnalyticsEventsProp;\n}\n\nexport interface TitleItemProps extends Justifyable, TitleItemBaseProps {\n navTitle?: string;\n anchor?: string;\n}\n\nexport interface TitleItemBaseProps {\n text: string;\n textSize?: TextSize;\n url?: string;\n urlTitle?: string;\n custom?: string | React.ReactNode;\n onClick?: () => void;\n}\n\nexport type MediaView = 'fit' | 'full';\n\n// card\nexport type MediaBorder = 'shadow' | 'line' | 'none';\nexport type CardBorder = MediaBorder;\nexport type ControlPosition = 'content' | 'footer';\n\nexport interface CardBaseProps {\n border?: CardBorder;\n}\n\nexport type CardLayoutProps = {\n controlPosition?: ControlPosition;\n};\n\n//price\nexport interface PriceDescriptionProps {\n title: string;\n detailedTitle?: string;\n description: string;\n label?: {\n color: PriceLabelColor;\n text?: string;\n size?: TextSize;\n };\n}\n\nexport interface PriceDetailsSettingsProps {\n title: string;\n description: string;\n}\n\nexport interface PriceDetailsListProps {\n text: string;\n}\n\nexport interface PriceDetailsProps {\n items?: PriceDetailsSettingsProps[] | PriceDetailsListProps[];\n}\n\nexport interface PriceItemProps\n extends PriceDetailsProps,\n PriceDescriptionProps,\n AnalyticsEventsBase {}\n\nexport interface PriceFoldableDetailsProps {\n title: string;\n size?: TextSize;\n titleColor?: PriceDescriptionColor;\n}\n\n/** @deprecated */\nexport interface PriceDetailedProps extends CardBaseProps {\n items: PriceItemProps[];\n description?: {\n titleSize?: TextSize;\n descriptionSize?: TextSize;\n titleColor?: PriceDescriptionColor;\n };\n details?: {\n titleSize?: TextSize;\n descriptionSize?: TextSize;\n };\n priceType?: PriceDetailsType;\n numberGroupItems?: 3 | 4 | 5;\n isCombined?: boolean;\n useMixedView?: boolean;\n foldable?: PriceFoldableDetailsProps;\n labelsDefaultText?: Record<PriceLabelColor, string>;\n}\n\nexport interface AuthorProps extends QAProps {\n author: AuthorItem;\n className?: string;\n authorContainerClassName?: string;\n type?: AuthorType;\n theme?: ContentTheme;\n}\n\nexport interface TitleProps {\n title?: TitleItemProps | string;\n subtitle?: string;\n}\n\nexport interface YandexFormProps extends AnalyticsEventsBase {\n id: number | string;\n containerId?: string;\n theme?: string;\n className?: string;\n headerHeight?: number;\n customFormOrigin?: string;\n customFormSection?: string;\n params?: {[key: string]: string};\n\n onSubmit?: () => void;\n onLoad?: () => void;\n}\n\nexport interface WithBorder {\n border?: MediaBorder;\n /**\n * @deprecated use custom class for media-component\n */\n disableShadow?: boolean;\n}\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"../../../../src","sources":["models/constructor-items/common.ts"],"names":[],"mappings":"AAQA,QAAQ;AACR,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACjB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,+CAA2B,CAAA;IAC3B,yCAAqB,CAAA;AACzB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAED,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,8BAAW,CAAA;AACf,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;AACjB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,iCAAa,CAAA;IACb,iCAAa,CAAA;AACjB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,yDAAmC,CAAA;IACnC,oEAA8C,CAAA;AAClD,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,+BAIX;AAJD,WAAY,+BAA+B;IACvC,gDAAa,CAAA;IACb,kDAAe,CAAA;IACf,oDAAiB,CAAA;AACrB,CAAC,EAJW,+BAA+B,KAA/B,+BAA+B,QAI1C;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;AACrB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAC9B,6CAAmB,CAAA;IACnB,2CAAiB,CAAA;AACrB,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC;AAED,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,gCAAmB,CAAA;IACnB,6CAAgC,CAAA;AACpC,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAuED,SAAS;AAET,MAAM,CAAN,IAAY,MAIX;AAJD,WAAY,MAAM;IACd,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,2BAAiB,CAAA;AACrB,CAAC,EAJW,MAAM,KAAN,MAAM,QAIjB","sourcesContent":["import * as React from 'react';\n\nimport * as icons from '@gravity-ui/icons';\nimport {ButtonView, IconData, ButtonProps as UikitButtonProps} from '@gravity-ui/uikit';\n\nimport {ThemeSupporting} from '../../utils';\nimport {AnalyticsEventsBase, AnalyticsEventsProp, ClassNameProps, QAProps} from '../common';\n\n// enums\nexport enum AuthorType {\n Column = 'column',\n Line = 'line',\n}\n\nexport enum PriceDetailsType {\n MARKED_LIST = 'marked-list',\n SETTINGS = 'settings',\n}\n\nexport enum PriceLabelColor {\n BLUE = 'blue',\n GREEN = 'green',\n YELLOW = 'yellow',\n PURPLE = 'purple',\n RED = 'red',\n}\n\nexport enum PlayButtonType {\n Default = 'default',\n Text = 'text',\n}\n\nexport enum PlayButtonThemes {\n Blue = 'blue',\n Grey = 'grey',\n}\n\nexport enum CustomControlsType {\n WithMuteButton = 'with-mute-button',\n WithPlayPauseButton = 'with-play-pause-button',\n}\n\nexport enum CustomControlsButtonPositioning {\n Left = 'left',\n Right = 'right',\n Center = 'center',\n}\n\nexport enum MediaVideoType {\n Default = 'default',\n Player = 'player',\n}\n\nexport enum MediaVideoControlsType {\n Default = 'default',\n Custom = 'custom',\n}\n\nexport enum QuoteType {\n Chevron = 'chevron', // « »\n EnglishDouble = 'english-double', // “ ”\n}\n\n// types\nexport type TextTheme = 'light' | 'dark';\nexport type TextSize = 'xs' | 's' | 'sm' | 'm' | 'l';\nexport type DividerSize = '0' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';\nexport type HeaderWidth = 's' | 'm' | 'l';\nexport type HeaderImageSize = 's' | 'm';\nexport type HeaderOffset = 'default' | 'large';\nexport type Justify = 'start' | 'center' | 'end';\nexport type ColumnsCount = 1 | 2 | 3 | 4;\nexport type LegendTableMarkerType = 'disk' | 'tick';\nexport type LinkTheme = 'file-link' | 'normal' | 'back' | 'underline';\nexport type MediaDirection = 'media-content' | 'content-media';\nexport type PriceDescriptionColor = 'cornflower' | 'black';\nexport type ContentSize = 's' | 'm' | 'l';\nexport type ContentTextSize = 's' | 'm' | 'l';\nexport type ContentTheme = 'default' | 'dark' | 'light';\nexport type FileLinkType = 'vertical' | 'horizontal';\nexport type ImageCardMargins = 's' | 'm';\nexport type LayoutItemContentMargin = 'm' | 'l';\nexport type GravityIconProps = string | {name: keyof typeof icons; color: 'brand' | 'text-color'};\n\n// modifiers\nexport interface Themable {\n theme?: TextTheme;\n}\n\nexport interface Justifyable {\n justify?: Justify;\n}\n\nexport interface Stylable {\n className?: string;\n}\n\nexport interface Animatable {\n animated?: boolean;\n}\n\nexport interface Tabbable {\n tabIndex?: number;\n}\n\nexport interface Roleable {\n role?: React.AriaRole;\n}\n\nexport interface AriaProps {\n ariaProps?: React.AriaAttributes;\n}\n\n//common props\nexport interface Background {\n image?: string;\n color?: string;\n}\n\nexport interface AnchorProps {\n text: string;\n url: string;\n}\n\n/**\n * @deprecated Component VideoBlock will be deleted, which uses this logic\n */\ninterface LoopProps {\n start: number;\n end?: number;\n}\n\n// images\n\nexport enum Device {\n Desktop = 'desktop',\n Mobile = 'mobile',\n Tablet = 'tablet',\n}\n\nexport interface ImageInfoProps\n extends Pick<\n React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>,\n 'aria-describedby' | 'loading'\n >,\n ImageDevicesVisibleProps {\n alt?: string;\n fetchPriority?: 'high' | 'low' | 'auto';\n disableCompress?: boolean;\n}\n\nexport interface ImageObjectProps extends ImageInfoProps {\n src: string;\n}\n\nexport interface ImageDeviceProps extends ImageInfoProps {\n [Device.Desktop]: string;\n [Device.Mobile]: string;\n [Device.Tablet]?: string;\n}\n\nexport interface ImageDevicesVisibleProps {\n hide?: boolean | Partial<Record<Device, boolean>>;\n}\n\nexport type ImageProps = string | ImageObjectProps | ImageDeviceProps;\nexport type ThemedImage = ThemeSupporting<ImageProps>;\n\nexport interface BackgroundImageProps\n extends React.HTMLProps<HTMLDivElement>,\n Partial<ImageDeviceProps>,\n Partial<ImageObjectProps>,\n QAProps,\n ImageDevicesVisibleProps {\n style?: React.CSSProperties;\n imageClassName?: string;\n}\n\n//components props\nexport interface MediaVideoProps extends AnalyticsEventsBase {\n src: string[];\n type?: MediaVideoType;\n loop?: LoopProps | boolean;\n muted?: boolean;\n autoplay?: boolean;\n elapsedTime?: number;\n playButton?: PlayButtonProps;\n controls?: MediaVideoControlsType;\n customControlsOptions?: CustomControlsOptions;\n ariaLabel?: string;\n contain?: boolean;\n}\n\n// links\nexport interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {\n url: string;\n urlTitle?: string;\n text?: string;\n textSize?: TextSize;\n theme?: LinkTheme;\n colorTheme?: TextTheme;\n arrow?: boolean;\n target?: string;\n extraProps?: React.HTMLProps<HTMLAnchorElement>;\n}\n\nexport interface FileLinkProps extends ClassNameProps, Tabbable {\n href: string;\n text: React.ReactNode;\n type?: FileLinkType;\n textSize?: TextSize;\n theme?: ContentTheme;\n urlTitle?: string;\n onClick?: () => void;\n extraProps?: React.HTMLProps<HTMLAnchorElement>;\n}\n\n// buttons\nexport type ButtonTheme =\n | ButtonView\n | 'github'\n | 'app-store'\n | 'google-play'\n | 'scale'\n | 'monochrome';\n\nexport interface ButtonProps\n extends AnalyticsEventsBase,\n Pick<UikitButtonProps, 'size' | 'width' | 'extraProps'> {\n text: string;\n url: string;\n urlTitle?: string;\n primary?: boolean;\n theme?: ButtonTheme;\n img?: ButtonImageProps | string;\n target?: string;\n}\n\nexport type ButtonImagePosition = 'left' | 'right';\n\nexport interface ButtonImageProps {\n url?: string;\n position?: ButtonImagePosition;\n alt?: string;\n iconData?: IconData;\n iconSize?: number;\n className?: string;\n}\n\nexport interface CustomControlsOptions {\n type?: CustomControlsType;\n muteButtonShown?: boolean;\n positioning?: CustomControlsButtonPositioning;\n}\n\nexport interface PlayButtonProps extends ClassNameProps {\n type?: PlayButtonType;\n theme?: PlayButtonThemes;\n text?: string;\n}\n\nexport type ThemedMediaVideoProps = ThemeSupporting<MediaVideoProps>;\n\nexport interface MediaComponentVideoProps extends AnalyticsEventsBase {\n video: MediaVideoProps;\n height?: number;\n ratio?: number | 'auto';\n previewImg?: string;\n}\n\nexport interface MediaComponentVideoIframeProps {\n videoIframe: string;\n}\n\nexport interface MediaComponentYoutubeProps {\n youtube: string;\n previewImg?: string;\n fullscreen?: boolean;\n}\n\nexport interface MediaComponentImageProps {\n image: ImageProps | ImageProps[] | ImageDeviceProps;\n video?: MediaVideoProps;\n parallax?: boolean;\n height?: number;\n disableImageSliderForArrayInput?: boolean;\n}\n\nexport interface MediaComponentDataLensProps {\n dataLens: DataLensProps;\n}\n\nexport interface MediaComponentIframeProps {\n iframe: IframeProps;\n margins?: boolean;\n}\n\nexport interface MediaProps\n extends Animatable,\n Partial<MediaComponentDataLensProps>,\n Partial<MediaComponentYoutubeProps>,\n Partial<MediaComponentVideoIframeProps>,\n Partial<MediaComponentImageProps>,\n Partial<MediaComponentIframeProps>,\n Partial<MediaComponentVideoProps> {\n color?: string;\n videoMicrodata?: {\n name?: string;\n description?: string;\n duration?: string;\n uploadDate?: string;\n contentUrl?: string;\n thumbnailUrl?: string;\n };\n}\n\nexport interface BackgroundMediaProps extends MediaProps, Animatable, QAProps {\n fullWidthMedia?: boolean;\n className?: string;\n mediaClassName?: string;\n}\n\nexport type Coordinate = number[];\n\nexport interface MapBaseProps {\n zoom?: number;\n className?: string;\n}\n\nexport interface GMapProps extends MapBaseProps {\n address: string;\n}\n\nexport interface YMapProps extends MapBaseProps {\n markers: YMapMarker[];\n id: string;\n}\n\nexport interface YMapMarker {\n address?: string;\n coordinate?: Coordinate;\n label?: YMapMarkerLabel;\n}\n\nexport interface YMapMarkerLabel {\n iconCaption?: string;\n iconContent?: string;\n iconColor?: string;\n preset?: string;\n}\n\nexport type MapProps = GMapProps | YMapProps;\n\nexport type ThemedMediaProps = ThemeSupporting<MediaProps>;\n\nexport interface DataLensObjectProps {\n id: string;\n theme: 'dark' | 'light';\n}\n\nexport interface IframeProps {\n src: string;\n width?: number;\n height?: number;\n title?: string;\n name?: string;\n}\n\nexport type DataLensProps = string | DataLensObjectProps;\n\nexport interface AuthorItem {\n firstName: string;\n secondName: string;\n description?: string;\n avatar?: ThemeSupporting<ImageProps> | JSX.Element;\n}\n\nexport interface HeaderBreadCrumbsProps extends ClassNameProps {\n items: {\n url: string;\n text: React.ReactNode;\n }[];\n theme?: TextTheme;\n analyticsEvents?: AnalyticsEventsProp;\n}\n\nexport interface TitleItemProps extends Justifyable, TitleItemBaseProps {\n navTitle?: string;\n anchor?: string;\n}\n\nexport interface TitleItemBaseProps {\n text: string;\n textSize?: TextSize;\n url?: string;\n urlTitle?: string;\n custom?: string | React.ReactNode;\n onClick?: () => void;\n}\n\nexport type MediaView = 'fit' | 'full';\n\n// card\nexport type MediaBorder = 'shadow' | 'line' | 'none';\nexport type CardBorder = MediaBorder;\nexport type ControlPosition = 'content' | 'footer';\n\nexport interface CardBaseProps {\n border?: CardBorder;\n}\n\nexport type CardLayoutProps = {\n controlPosition?: ControlPosition;\n};\n\n//price\nexport interface PriceDescriptionProps {\n title: string;\n detailedTitle?: string;\n description: string;\n label?: {\n color: PriceLabelColor;\n text?: string;\n size?: TextSize;\n };\n}\n\nexport interface PriceDetailsSettingsProps {\n title: string;\n description: string;\n}\n\nexport interface PriceDetailsListProps {\n text: string;\n}\n\nexport interface PriceDetailsProps {\n items?: PriceDetailsSettingsProps[] | PriceDetailsListProps[];\n}\n\nexport interface PriceItemProps\n extends PriceDetailsProps,\n PriceDescriptionProps,\n AnalyticsEventsBase {}\n\nexport interface PriceFoldableDetailsProps {\n title: string;\n size?: TextSize;\n titleColor?: PriceDescriptionColor;\n}\n\n/** @deprecated */\nexport interface PriceDetailedProps extends CardBaseProps {\n items: PriceItemProps[];\n description?: {\n titleSize?: TextSize;\n descriptionSize?: TextSize;\n titleColor?: PriceDescriptionColor;\n };\n details?: {\n titleSize?: TextSize;\n descriptionSize?: TextSize;\n };\n priceType?: PriceDetailsType;\n numberGroupItems?: 3 | 4 | 5;\n isCombined?: boolean;\n useMixedView?: boolean;\n foldable?: PriceFoldableDetailsProps;\n labelsDefaultText?: Record<PriceLabelColor, string>;\n}\n\nexport interface AuthorProps extends QAProps {\n author: AuthorItem;\n className?: string;\n authorContainerClassName?: string;\n type?: AuthorType;\n theme?: ContentTheme;\n}\n\nexport interface TitleProps {\n title?: TitleItemProps | string;\n subtitle?: string;\n}\n\nexport interface YandexFormProps extends AnalyticsEventsBase {\n id: number | string;\n containerId?: string;\n theme?: string;\n className?: string;\n headerHeight?: number;\n customFormOrigin?: string;\n customFormSection?: string;\n params?: {[key: string]: string};\n\n onSubmit?: () => void;\n onLoad?: () => void;\n}\n\nexport interface WithBorder {\n border?: MediaBorder;\n /**\n * @deprecated use custom class for media-component\n */\n disableShadow?: boolean;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { ClassNameProps, QuoteType } from "../index.js";
1
+ import { ClassNameProps, GravityIconProps, QuoteType } from "../index.js";
2
2
  import { ThemeSupporting } from "../../utils/index.js";
3
3
  import { HubspotEventData, HubspotEventHandlers, HubspotFormDefaultValues } from "../../utils/hubspot.js";
4
4
  import { AnalyticsEventsBase } from "../common.js";
@@ -33,8 +33,13 @@ export interface PositionedIcon {
33
33
  value: ImageProps;
34
34
  position?: IconPosition;
35
35
  }
36
+ export interface PositionedGravityIcon {
37
+ value: GravityIconProps;
38
+ position?: IconPosition;
39
+ }
36
40
  export interface IconWrapperProps {
37
41
  icon?: PositionedIcon;
42
+ gravityIcon?: PositionedGravityIcon;
38
43
  size?: 's' | 'm' | 'l';
39
44
  }
40
45
  export declare enum ImageCardDirection {
@@ -109,6 +114,7 @@ export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, Card
109
114
  url: string;
110
115
  urlTitle?: string;
111
116
  icon?: ThemeSupporting<ImageProps>;
117
+ gravityIcon?: ThemeSupporting<GravityIconProps>;
112
118
  target?: string;
113
119
  iconPosition?: IconPosition;
114
120
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sub-blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/sub-blocks.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAN,IAAY,YAoBX;AApBD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf;;OAEG;IACH,gDAAgC,CAAA;IAChC,wCAAwB,CAAA;IACxB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,kDAAkC,CAAA;IAClC,wCAAwB,CAAA;IACxB,mCAAmB,CAAA;IACnB,4CAA4B,CAAA;IAC5B;;OAEG;IACH,6BAAa,CAAA;IACb,wCAAwB,CAAA;IACxB,wCAAwB,CAAA;AAC5B,CAAC,EApBW,YAAY,KAAZ,YAAY,QAoBvB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,6BAAa,CAAA;AACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAYD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import {ClassNameProps, QuoteType} from '../../models';\nimport {ThemeSupporting} from '../../utils';\nimport {\n HubspotEventData,\n HubspotEventHandlers,\n HubspotFormDefaultValues,\n} from '../../utils/hubspot';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {ContentBlockProps} from './blocks';\nimport {\n AuthorItem,\n ButtonProps,\n CardBaseProps,\n CardLayoutProps,\n ContentTheme,\n DividerSize,\n ImageCardMargins,\n ImageObjectProps,\n ImageProps,\n LayoutItemContentMargin,\n LinkProps,\n MediaProps,\n MediaView,\n PriceDetailedProps,\n TextTheme,\n Themable,\n ThemedImage,\n} from './common';\n\nexport enum SubBlockType {\n Divider = 'divider',\n Quote = 'quote',\n /**\n * @deprecated Will be removed\n */\n PriceDetailed = 'price-detailed',\n MediaCard = 'media-card',\n BannerCard = 'banner-card',\n LayoutItem = 'layout-item',\n BackgroundCard = 'background-card',\n BasicCard = 'basic-card',\n Content = 'content',\n HubspotForm = 'hubspot-form',\n /**\n * @deprecated Will be removed, use BasicCard instead\n */\n Card = 'card',\n PriceCard = 'price-card',\n ImageCard = 'image-card',\n}\n\nexport enum IconPosition {\n Top = 'top',\n Left = 'left',\n}\n\nexport interface PositionedIcon {\n value: ImageProps;\n position?: IconPosition;\n}\n\nexport interface IconWrapperProps {\n icon?: PositionedIcon;\n size?: 's' | 'm' | 'l';\n}\n\nexport enum ImageCardDirection {\n Direct = 'direct',\n Reverse = 'reverse',\n}\n\nexport const SubBlockTypes = Object.values(SubBlockType);\n\nexport interface DividerProps {\n size?: DividerSize;\n border?: boolean;\n}\n\nexport interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsBase {\n className?: string;\n theme?: ContentTheme;\n isMobile?: boolean;\n region?: string;\n portalId: string;\n formId: string;\n formInstanceId?: string;\n formClassName?: string;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeLoad?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onLoad?: (arg: HubspotEventData) => void;\n hubspotEvents?: string[];\n createDOMElement?: boolean;\n defaultValues?: HubspotFormDefaultValues;\n}\n\n//cards\nexport interface QuoteProps extends Themable, CardBaseProps {\n text?: string;\n // for backward compatibility, yfmText will become property 'text' in major\n yfmText?: string;\n image: ThemedImage;\n logo: ThemeSupporting<ImageProps>;\n color?: string;\n /**\n * @deprecated use property button instead\n */\n url?: string;\n /**\n * @deprecated use property button instead\n */\n urlTitle?: string;\n author?: AuthorItem;\n /**\n * @deprecated use property button instead\n */\n buttonText?: string;\n theme?: TextTheme;\n quoteType?: QuoteType;\n button?: ButtonProps;\n}\n\nexport interface BackgroundCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'centered' | 'controlPosition'> {\n url?: string;\n urlTitle?: string;\n background?: ThemeSupporting<ImageObjectProps>;\n paddingBottom?: 's' | 'm' | 'l' | 'xl';\n backgroundColor?: string;\n}\n\nexport interface BasicCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'theme' | 'controlPosition'> {\n url: string;\n urlTitle?: string;\n icon?: ThemeSupporting<ImageProps>;\n target?: string;\n iconPosition?: IconPosition;\n}\n\nexport interface BannerCardProps {\n title: string;\n subtitle?: string;\n className?: string;\n image?: ThemeSupporting<string>;\n disableCompress?: boolean;\n color?: ThemeSupporting<string>;\n theme?: TextTheme;\n button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;\n mediaView?: MediaView;\n}\n\nexport interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {}\n\nexport interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, 'theme'> {\n title: string;\n price: string;\n pricePeriod?: string;\n priceDetails?: string;\n description?: string;\n buttons?: ButtonProps[];\n links?: LinkProps[];\n backgroundColor?: string;\n list?: string[];\n}\n\nexport interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {\n content: Omit<ContentBlockProps, 'colSizes' | 'centered'>;\n contentMargin?: LayoutItemContentMargin;\n media?: ThemeSupporting<MediaProps>;\n metaInfo?: string[];\n border?: boolean;\n fullscreen?: boolean;\n icon?: ThemeSupporting<PositionedIcon>;\n}\n\nexport interface ImageCardProps\n extends CardBaseProps,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n image: ThemeSupporting<ImageProps>;\n enableImageBorderRadius?: boolean;\n margins?: ImageCardMargins;\n direction?: ImageCardDirection;\n backgroundColor?: string;\n url?: string;\n urlTitle?: string;\n target?: string;\n}\n\n// sub-block models\nexport type DividerModel = {\n type: SubBlockType.Divider;\n} & DividerProps;\n\nexport type QuoteModel = {\n type: SubBlockType.Quote;\n} & QuoteProps;\n\nexport type LayoutItemModel = {\n type: SubBlockType.LayoutItem;\n} & LayoutItemProps;\n\nexport type BackgroundCardModel = {\n type: SubBlockType.BackgroundCard;\n} & BackgroundCardProps;\n\n/** @deprecated */\nexport type PriceDetailedModel = {\n type: SubBlockType.PriceDetailed;\n} & PriceDetailedProps;\n\nexport type MediaCardModel = {\n type: SubBlockType.MediaCard;\n} & MediaCardProps;\n\nexport type HubspotFormModel = {\n type: SubBlockType.HubspotForm;\n} & HubspotFormProps;\n\nexport type BannerCardModel = {\n type: SubBlockType.BannerCard;\n} & BannerCardProps;\n\nexport type BasicCardModel = {\n type: SubBlockType.BasicCard;\n} & BasicCardProps;\n\nexport type PriceCardModel = {\n type: SubBlockType.PriceCard;\n} & PriceCardProps;\n\nexport type ImageCardModel = {\n type: SubBlockType.ImageCard;\n} & ImageCardProps;\n\nexport type SubBlockModels =\n | DividerModel\n | QuoteModel\n | PriceDetailedModel\n | MediaCardModel\n | BackgroundCardModel\n | HubspotFormModel\n | BannerCardModel\n | BasicCardModel\n | PriceCardModel\n | LayoutItemModel\n | ImageCardModel;\n\nexport type SubBlock = SubBlockModels;\n"]}
1
+ {"version":3,"file":"sub-blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/sub-blocks.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAN,IAAY,YAoBX;AApBD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf;;OAEG;IACH,gDAAgC,CAAA;IAChC,wCAAwB,CAAA;IACxB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,kDAAkC,CAAA;IAClC,wCAAwB,CAAA;IACxB,mCAAmB,CAAA;IACnB,4CAA4B,CAAA;IAC5B;;OAEG;IACH,6BAAa,CAAA;IACb,wCAAwB,CAAA;IACxB,wCAAwB,CAAA;AAC5B,CAAC,EApBW,YAAY,KAAZ,YAAY,QAoBvB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,6BAAa,CAAA;AACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAkBD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import {ClassNameProps, GravityIconProps, QuoteType} from '../../models';\nimport {ThemeSupporting} from '../../utils';\nimport {\n HubspotEventData,\n HubspotEventHandlers,\n HubspotFormDefaultValues,\n} from '../../utils/hubspot';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {ContentBlockProps} from './blocks';\nimport {\n AuthorItem,\n ButtonProps,\n CardBaseProps,\n CardLayoutProps,\n ContentTheme,\n DividerSize,\n ImageCardMargins,\n ImageObjectProps,\n ImageProps,\n LayoutItemContentMargin,\n LinkProps,\n MediaProps,\n MediaView,\n PriceDetailedProps,\n TextTheme,\n Themable,\n ThemedImage,\n} from './common';\n\nexport enum SubBlockType {\n Divider = 'divider',\n Quote = 'quote',\n /**\n * @deprecated Will be removed\n */\n PriceDetailed = 'price-detailed',\n MediaCard = 'media-card',\n BannerCard = 'banner-card',\n LayoutItem = 'layout-item',\n BackgroundCard = 'background-card',\n BasicCard = 'basic-card',\n Content = 'content',\n HubspotForm = 'hubspot-form',\n /**\n * @deprecated Will be removed, use BasicCard instead\n */\n Card = 'card',\n PriceCard = 'price-card',\n ImageCard = 'image-card',\n}\n\nexport enum IconPosition {\n Top = 'top',\n Left = 'left',\n}\n\nexport interface PositionedIcon {\n value: ImageProps;\n position?: IconPosition;\n}\n\nexport interface PositionedGravityIcon {\n value: GravityIconProps;\n position?: IconPosition;\n}\n\nexport interface IconWrapperProps {\n icon?: PositionedIcon;\n gravityIcon?: PositionedGravityIcon;\n size?: 's' | 'm' | 'l';\n}\n\nexport enum ImageCardDirection {\n Direct = 'direct',\n Reverse = 'reverse',\n}\n\nexport const SubBlockTypes = Object.values(SubBlockType);\n\nexport interface DividerProps {\n size?: DividerSize;\n border?: boolean;\n}\n\nexport interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsBase {\n className?: string;\n theme?: ContentTheme;\n isMobile?: boolean;\n region?: string;\n portalId: string;\n formId: string;\n formInstanceId?: string;\n formClassName?: string;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeLoad?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onLoad?: (arg: HubspotEventData) => void;\n hubspotEvents?: string[];\n createDOMElement?: boolean;\n defaultValues?: HubspotFormDefaultValues;\n}\n\n//cards\nexport interface QuoteProps extends Themable, CardBaseProps {\n text?: string;\n // for backward compatibility, yfmText will become property 'text' in major\n yfmText?: string;\n image: ThemedImage;\n logo: ThemeSupporting<ImageProps>;\n color?: string;\n /**\n * @deprecated use property button instead\n */\n url?: string;\n /**\n * @deprecated use property button instead\n */\n urlTitle?: string;\n author?: AuthorItem;\n /**\n * @deprecated use property button instead\n */\n buttonText?: string;\n theme?: TextTheme;\n quoteType?: QuoteType;\n button?: ButtonProps;\n}\n\nexport interface BackgroundCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'centered' | 'controlPosition'> {\n url?: string;\n urlTitle?: string;\n background?: ThemeSupporting<ImageObjectProps>;\n paddingBottom?: 's' | 'm' | 'l' | 'xl';\n backgroundColor?: string;\n}\n\nexport interface BasicCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'theme' | 'controlPosition'> {\n url: string;\n urlTitle?: string;\n icon?: ThemeSupporting<ImageProps>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n target?: string;\n iconPosition?: IconPosition;\n}\n\nexport interface BannerCardProps {\n title: string;\n subtitle?: string;\n className?: string;\n image?: ThemeSupporting<string>;\n disableCompress?: boolean;\n color?: ThemeSupporting<string>;\n theme?: TextTheme;\n button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;\n mediaView?: MediaView;\n}\n\nexport interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {}\n\nexport interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, 'theme'> {\n title: string;\n price: string;\n pricePeriod?: string;\n priceDetails?: string;\n description?: string;\n buttons?: ButtonProps[];\n links?: LinkProps[];\n backgroundColor?: string;\n list?: string[];\n}\n\nexport interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {\n content: Omit<ContentBlockProps, 'colSizes' | 'centered'>;\n contentMargin?: LayoutItemContentMargin;\n media?: ThemeSupporting<MediaProps>;\n metaInfo?: string[];\n border?: boolean;\n fullscreen?: boolean;\n icon?: ThemeSupporting<PositionedIcon>;\n}\n\nexport interface ImageCardProps\n extends CardBaseProps,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n image: ThemeSupporting<ImageProps>;\n enableImageBorderRadius?: boolean;\n margins?: ImageCardMargins;\n direction?: ImageCardDirection;\n backgroundColor?: string;\n url?: string;\n urlTitle?: string;\n target?: string;\n}\n\n// sub-block models\nexport type DividerModel = {\n type: SubBlockType.Divider;\n} & DividerProps;\n\nexport type QuoteModel = {\n type: SubBlockType.Quote;\n} & QuoteProps;\n\nexport type LayoutItemModel = {\n type: SubBlockType.LayoutItem;\n} & LayoutItemProps;\n\nexport type BackgroundCardModel = {\n type: SubBlockType.BackgroundCard;\n} & BackgroundCardProps;\n\n/** @deprecated */\nexport type PriceDetailedModel = {\n type: SubBlockType.PriceDetailed;\n} & PriceDetailedProps;\n\nexport type MediaCardModel = {\n type: SubBlockType.MediaCard;\n} & MediaCardProps;\n\nexport type HubspotFormModel = {\n type: SubBlockType.HubspotForm;\n} & HubspotFormProps;\n\nexport type BannerCardModel = {\n type: SubBlockType.BannerCard;\n} & BannerCardProps;\n\nexport type BasicCardModel = {\n type: SubBlockType.BasicCard;\n} & BasicCardProps;\n\nexport type PriceCardModel = {\n type: SubBlockType.PriceCard;\n} & PriceCardProps;\n\nexport type ImageCardModel = {\n type: SubBlockType.ImageCard;\n} & ImageCardProps;\n\nexport type SubBlockModels =\n | DividerModel\n | QuoteModel\n | PriceDetailedModel\n | MediaCardModel\n | BackgroundCardModel\n | HubspotFormModel\n | BannerCardModel\n | BasicCardModel\n | PriceCardModel\n | LayoutItemModel\n | ImageCardModel;\n\nexport type SubBlock = SubBlockModels;\n"]}
@@ -507,6 +507,27 @@ export declare const cardSchemas: {
507
507
  pattern?: undefined;
508
508
  })[];
509
509
  };
510
+ gravityIcon: {
511
+ oneOf: ({
512
+ type: string;
513
+ additionalProperties?: undefined;
514
+ required?: undefined;
515
+ properties?: undefined;
516
+ } | {
517
+ type: string;
518
+ additionalProperties: boolean;
519
+ required: string[];
520
+ properties: {
521
+ name: {
522
+ type: string;
523
+ };
524
+ color: {
525
+ type: string;
526
+ enum: string[];
527
+ };
528
+ };
529
+ })[];
530
+ };
510
531
  target: {
511
532
  type: string;
512
533
  enum: string[];
@@ -1436,3 +1436,24 @@ export declare const BlockHeaderProps: {
1436
1436
  inputType: string;
1437
1437
  };
1438
1438
  };
1439
+ export declare const GravityIconProps: {
1440
+ oneOf: ({
1441
+ type: string;
1442
+ additionalProperties?: undefined;
1443
+ required?: undefined;
1444
+ properties?: undefined;
1445
+ } | {
1446
+ type: string;
1447
+ additionalProperties: boolean;
1448
+ required: string[];
1449
+ properties: {
1450
+ name: {
1451
+ type: string;
1452
+ };
1453
+ color: {
1454
+ type: string;
1455
+ enum: string[];
1456
+ };
1457
+ };
1458
+ })[];
1459
+ };