diff --git a/src/lib/kit/components/Card/Card.tsx b/src/lib/kit/components/Card/Card.tsx index a4864156..92147185 100644 --- a/src/lib/kit/components/Card/Card.tsx +++ b/src/lib/kit/components/Card/Card.tsx @@ -6,6 +6,7 @@ import isString from 'lodash/isString'; import {COMMON_POPOVER_PLACEMENT, COMMON_TITLE_MAX_WIDTH} from '../../constants/common'; import {block} from '../../utils'; +import {HTMLContent} from '../HTMLContent'; import './Card.scss'; @@ -95,7 +96,7 @@ export const Card: React.FC = ({ placement: COMMON_POPOVER_PLACEMENT, }} > - {description} + ) : null} diff --git a/src/lib/kit/components/HTMLContent/HTMLContent.tsx b/src/lib/kit/components/HTMLContent/HTMLContent.tsx new file mode 100644 index 00000000..318c11e7 --- /dev/null +++ b/src/lib/kit/components/HTMLContent/HTMLContent.tsx @@ -0,0 +1,9 @@ +import React from 'react'; + +interface HTMLContentProps { + html: string; +} + +export const HTMLContent: React.FC = ({html}) => { + return
; +}; diff --git a/src/lib/kit/components/HTMLContent/index.ts b/src/lib/kit/components/HTMLContent/index.ts new file mode 100644 index 00000000..c5a8c407 --- /dev/null +++ b/src/lib/kit/components/HTMLContent/index.ts @@ -0,0 +1 @@ +export * from './HTMLContent'; diff --git a/src/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.tsx b/src/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.tsx index 37c79f8a..543dc4c5 100644 --- a/src/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.tsx +++ b/src/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.tsx @@ -25,6 +25,7 @@ import { import {useSearchContext} from '../../../../core/components/Form/hooks'; import {COMMON_POPOVER_PLACEMENT} from '../../../constants/common'; import {block} from '../../../utils'; +import {HTMLContent} from '../../HTMLContent'; import './TableArrayInput.scss'; @@ -115,7 +116,7 @@ export const TableArrayInput: ArrayInput = ({spec, name, arrayInput, input}) => placement: COMMON_POPOVER_PLACEMENT, }} > - {description} + ), diff --git a/src/lib/kit/components/Layouts/Column/Column.tsx b/src/lib/kit/components/Layouts/Column/Column.tsx index 43bd4816..62257ca1 100644 --- a/src/lib/kit/components/Layouts/Column/Column.tsx +++ b/src/lib/kit/components/Layouts/Column/Column.tsx @@ -8,6 +8,7 @@ import {isArrayItem, isArraySpec, isObjectSpec, withGenerateButton} from '../../ import {ErrorWrapper, GenerateRandomValueButton} from '../../../components'; import {COMMON_POPOVER_PLACEMENT} from '../../../constants/common'; import {block} from '../../../utils'; +import {HTMLContent} from '../../HTMLContent'; import './Column.scss'; @@ -40,7 +41,7 @@ const ColumnBase = ({ placement: COMMON_POPOVER_PLACEMENT, }} > - {spec.viewSpec.layoutDescription} + diff --git a/src/lib/kit/components/Layouts/Row/Row.tsx b/src/lib/kit/components/Layouts/Row/Row.tsx index e88434a4..4345fa0e 100644 --- a/src/lib/kit/components/Layouts/Row/Row.tsx +++ b/src/lib/kit/components/Layouts/Row/Row.tsx @@ -8,6 +8,7 @@ import {isArrayItem, isArraySpec, isObjectSpec, withGenerateButton} from '../../ import {ErrorWrapper, GenerateRandomValueButton} from '../../../components'; import {COMMON_POPOVER_PLACEMENT} from '../../../constants/common'; import {block} from '../../../utils'; +import {HTMLContent} from '../../HTMLContent'; import './Row.scss'; @@ -43,7 +44,7 @@ const RowBase = ({ placement: COMMON_POPOVER_PLACEMENT, }} > - {spec.viewSpec.layoutDescription} + diff --git a/src/lib/kit/components/Layouts/Section/Section.tsx b/src/lib/kit/components/Layouts/Section/Section.tsx index 19d93918..84b2e673 100644 --- a/src/lib/kit/components/Layouts/Section/Section.tsx +++ b/src/lib/kit/components/Layouts/Section/Section.tsx @@ -15,6 +15,7 @@ import type { } from '../../../../core'; import {isArrayItem, isArraySpec, isObjectSpec} from '../../../../core'; import {block} from '../../../utils'; +import {HTMLContent} from '../../HTMLContent'; import {RemoveButton} from '../../RemoveButton'; import './Section.scss'; @@ -122,7 +123,7 @@ const SectionBase = < placement: COMMON_POPOVER_PLACEMENT, }} > - {spec.viewSpec.layoutDescription} + ); diff --git a/src/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.tsx b/src/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.tsx index d7110104..22939599 100644 --- a/src/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.tsx +++ b/src/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.tsx @@ -6,6 +6,7 @@ import {Button, HelpMark, Icon, Popover, Text} from '@gravity-ui/uikit'; import {COMMON_POPOVER_PLACEMENT} from '../../constants/common'; import {block} from '../../utils'; +import {HTMLContent} from '../HTMLContent'; import './SimpleVerticalAccordeon.scss'; @@ -206,7 +207,7 @@ export class SimpleVerticalAccordeon extends React.Component< placement: COMMON_POPOVER_PLACEMENT, }} > - {note} + ) : null; diff --git a/src/lib/kit/components/TogglerCard/TogglerCard.tsx b/src/lib/kit/components/TogglerCard/TogglerCard.tsx index 12c95b02..cd7c7c46 100644 --- a/src/lib/kit/components/TogglerCard/TogglerCard.tsx +++ b/src/lib/kit/components/TogglerCard/TogglerCard.tsx @@ -4,6 +4,7 @@ import {Card, HelpMark, Text} from '@gravity-ui/uikit'; import {COMMON_POPOVER_PLACEMENT} from '../../constants/common'; import {block} from '../../utils'; +import {HTMLContent} from '../HTMLContent'; import './TogglerCard.scss'; @@ -45,7 +46,7 @@ export const TogglerCard: React.FC = ({ placement: COMMON_POPOVER_PLACEMENT, }} > - {description} + ) : null}
diff --git a/src/lib/kit/components/ViewLayouts/ViewColumn/ViewColumn.tsx b/src/lib/kit/components/ViewLayouts/ViewColumn/ViewColumn.tsx index 7235f0ff..e3348305 100644 --- a/src/lib/kit/components/ViewLayouts/ViewColumn/ViewColumn.tsx +++ b/src/lib/kit/components/ViewLayouts/ViewColumn/ViewColumn.tsx @@ -7,6 +7,7 @@ import {useDynamicFormsCtx} from '../../../../core'; import {CopyButton} from '../../../../kit'; import {COMMON_POPOVER_PLACEMENT} from '../../../constants/common'; import {block, isNotEmptyValue} from '../../../utils'; +import {HTMLContent} from '../../HTMLContent'; import './ViewColumn.scss'; @@ -36,7 +37,7 @@ export const ViewColumn = ({ placement: COMMON_POPOVER_PLACEMENT, }} > - {spec.viewSpec.layoutDescription} + ) : null} diff --git a/src/lib/kit/components/ViewLayouts/ViewRow/ViewRow.tsx b/src/lib/kit/components/ViewLayouts/ViewRow/ViewRow.tsx index 4d80d448..60e68206 100644 --- a/src/lib/kit/components/ViewLayouts/ViewRow/ViewRow.tsx +++ b/src/lib/kit/components/ViewLayouts/ViewRow/ViewRow.tsx @@ -7,6 +7,7 @@ import {useDynamicFormsCtx} from '../../../../core'; import {CopyButton} from '../../../../kit'; import {COMMON_POPOVER_PLACEMENT} from '../../../constants/common'; import {block, isNotEmptyValue} from '../../../utils'; +import {HTMLContent} from '../../HTMLContent'; import './ViewRow.scss'; @@ -36,7 +37,7 @@ export const ViewRow = ({ placement: COMMON_POPOVER_PLACEMENT, }} > - {spec.viewSpec.layoutDescription} + ) : null}
diff --git a/src/lib/kit/components/Views/TableArrayView/TableArrayView.tsx b/src/lib/kit/components/Views/TableArrayView/TableArrayView.tsx index 8e47f87c..610ea029 100644 --- a/src/lib/kit/components/Views/TableArrayView/TableArrayView.tsx +++ b/src/lib/kit/components/Views/TableArrayView/TableArrayView.tsx @@ -12,6 +12,7 @@ import { } from '../../../../core'; import {COMMON_POPOVER_PLACEMENT} from '../../../constants/common'; import {block} from '../../../utils'; +import {HTMLContent} from '../../HTMLContent'; import './TableArrayView.scss'; @@ -53,7 +54,7 @@ export const TableArrayView: ArrayView = ({value = [], spec, name}) => { placement: COMMON_POPOVER_PLACEMENT, }} > - {description} + )