@dss-kit/ui-kit 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/builders/Table/Table.js +58 -57
- package/dist/components/builders/Table/TableBodyRow/TableBodyRow.d.ts +0 -5
- package/dist/components/builders/Table/TableBodyRow/TableBodyRow.js +15 -11
- package/dist/components/builders/Table/TableWrapper/TableWrapper.js +38 -39
- package/dist/components/controls/Button/Button.js +66 -63
- package/dist/components/controls/Button/types.d.ts +2 -1
- package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.js +6 -6
- package/dist/components/controls/RadioGroup/Radio.d.ts +10 -1
- package/dist/components/controls/RadioGroup/Radio.js +68 -63
- package/dist/components/shared/Badge/Badge.d.ts +1 -1
- package/dist/components/shared/Badge/Badge.js +51 -42
- package/dist/components/shared/MarkdownText/MarkdownText.js +10 -10
- package/dist/ui-kit.cjs +8 -8
- package/package.json +1 -1
- package/dist/components/builders/Table/styles.d.ts +0 -3
- package/dist/components/builders/Table/styles.js +0 -11
|
@@ -8,10 +8,10 @@ import { MarkdownShortcutPlugin as U } from "@lexical/react/LexicalMarkdownShort
|
|
|
8
8
|
import { OnChangePlugin as W } from "@lexical/react/LexicalOnChangePlugin";
|
|
9
9
|
import { TablePlugin as H } from "@lexical/react/LexicalTablePlugin";
|
|
10
10
|
import { useState as u, useMemo as a, useCallback as p } from "react";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { getEditorConfig as K } from "./configs/editor.config.js";
|
|
12
|
+
import { MARKDOWN_TOOLBAR_DEFAULT_ACTIONS as q } from "./MarkdownTextEditor.const.js";
|
|
13
|
+
import { MarkdownTextEditorLocaleProvider as z } from "./MarkdownTextEditor.locale.js";
|
|
13
14
|
import { EDITOR_TRANSFORMERS as g } from "./transformers/index.js";
|
|
14
|
-
import { getEditorConfig as z } from "./configs/editor.config.js";
|
|
15
15
|
import { EditorStateContext as G } from "./contexts/EditorStateContext/EditorStateContext.js";
|
|
16
16
|
import { ToolbarContext as J } from "./contexts/ToolbarContext/ToolbarContext.js";
|
|
17
17
|
import { EditorToolbar as Q } from "./components/EditorToolbar/EditorToolbar.js";
|
|
@@ -40,7 +40,7 @@ function No({
|
|
|
40
40
|
fieldClassName: R,
|
|
41
41
|
previewClassName: v
|
|
42
42
|
}) {
|
|
43
|
-
const [d, A] = u(""), [i, N] = u(!1), { availableActions: s, onImagesUpload: O } = P || {}, I = a(() =>
|
|
43
|
+
const [d, A] = u(""), [i, N] = u(!1), { availableActions: s, onImagesUpload: O } = P || {}, I = a(() => K(), []), L = a(
|
|
44
44
|
() => ({
|
|
45
45
|
isEditable: !m,
|
|
46
46
|
isPreviewMode: i,
|
|
@@ -49,7 +49,7 @@ function No({
|
|
|
49
49
|
}),
|
|
50
50
|
[m, i, d]
|
|
51
51
|
), F = a(() => ({
|
|
52
|
-
availableActions: s ||
|
|
52
|
+
availableActions: s || q
|
|
53
53
|
}), [s]), f = p(
|
|
54
54
|
(t) => {
|
|
55
55
|
A(t), r.onMarkdownChange && r.onMarkdownChange(t);
|
|
@@ -64,7 +64,7 @@ function No({
|
|
|
64
64
|
},
|
|
65
65
|
[f, r]
|
|
66
66
|
);
|
|
67
|
-
return /* @__PURE__ */ o(
|
|
67
|
+
return /* @__PURE__ */ o(z, { locale: M, children: /* @__PURE__ */ o(D, { initialConfig: I, children: /* @__PURE__ */ o(G.Provider, { value: L, children: /* @__PURE__ */ c(J.Provider, { value: F, children: [
|
|
68
68
|
/* @__PURE__ */ c(
|
|
69
69
|
h,
|
|
70
70
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Size } from '../../../types';
|
|
2
|
+
import { AccentType, NeutralType, Size } from '../../../types';
|
|
3
3
|
/**
|
|
4
4
|
* Radio — доступная реализация визуального радио-переключателя.
|
|
5
5
|
*
|
|
@@ -44,6 +44,15 @@ export type RadioProps = {
|
|
|
44
44
|
* @default "left"
|
|
45
45
|
*/
|
|
46
46
|
side?: "left" | "right";
|
|
47
|
+
/**
|
|
48
|
+
* Цветовая схема радиокнопки в выбранном (checked) состоянии.
|
|
49
|
+
* - `accent` — заливка индикатора акцентным цветом (стандартное поведение).
|
|
50
|
+
* - `neutral` — индикатор остаётся незалитым: видимая нейтральная рамка
|
|
51
|
+
* (`border/neutral-primary`) и точка нейтрального цвета (`icon/secondary`)
|
|
52
|
+
* вместо заливки. Не влияет на состояние ошибки — `error` всегда приоритетнее.
|
|
53
|
+
* @default "accent"
|
|
54
|
+
*/
|
|
55
|
+
color?: AccentType | NeutralType;
|
|
47
56
|
/**
|
|
48
57
|
* Делает конкретное Radio доступной только для чтения.
|
|
49
58
|
* - Изменение выбранного значения запрещено.
|
|
@@ -1,113 +1,118 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useRadioGroupContext as
|
|
5
|
-
import { styles as
|
|
6
|
-
import { useControlled as
|
|
7
|
-
import { theme as
|
|
8
|
-
import { Box as
|
|
9
|
-
import { Text as
|
|
10
|
-
const { color:
|
|
1
|
+
import { jsxs as x, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { cx as J } from "@emotion/css";
|
|
3
|
+
import { forwardRef as K } from "react";
|
|
4
|
+
import { useRadioGroupContext as Q } from "./context.js";
|
|
5
|
+
import { styles as n } from "./styles.js";
|
|
6
|
+
import { useControlled as X } from "../../../utils/hooks/useControlled.js";
|
|
7
|
+
import { theme as Y } from "../../../utils/theme/index.js";
|
|
8
|
+
import { Box as u } from "../../builders/Box/Box.js";
|
|
9
|
+
import { Text as R } from "../../builders/Text/Text.js";
|
|
10
|
+
const { color: r, cornerRadius: N } = Y, m = {
|
|
11
11
|
sm: {
|
|
12
12
|
inner: 12,
|
|
13
|
+
// neutral: точка вдвое меньше, чем у accent (см. md — подтверждено в Figma)
|
|
14
|
+
neutralInner: 6,
|
|
13
15
|
outer: 20
|
|
14
16
|
},
|
|
15
17
|
md: {
|
|
16
18
|
inner: 16,
|
|
19
|
+
// neutral: 8px точка в 24px внешнем круге — Figma node 8677:5697, состояние Selected
|
|
20
|
+
neutralInner: 8,
|
|
17
21
|
outer: 24
|
|
18
22
|
}
|
|
19
|
-
},
|
|
23
|
+
}, Z = K(
|
|
20
24
|
({
|
|
21
|
-
value:
|
|
25
|
+
value: s,
|
|
22
26
|
children: v,
|
|
23
|
-
checked:
|
|
27
|
+
checked: d,
|
|
24
28
|
defaultChecked: C,
|
|
25
|
-
onChange:
|
|
26
|
-
disabled:
|
|
27
|
-
className:
|
|
28
|
-
description:
|
|
29
|
-
size:
|
|
30
|
-
side:
|
|
31
|
-
readOnly:
|
|
29
|
+
onChange: k,
|
|
30
|
+
disabled: B,
|
|
31
|
+
className: I,
|
|
32
|
+
description: f,
|
|
33
|
+
size: S,
|
|
34
|
+
side: w,
|
|
35
|
+
readOnly: z,
|
|
32
36
|
error: O,
|
|
37
|
+
color: P = "accent",
|
|
33
38
|
outerCircleClassName: T,
|
|
34
39
|
innerCircleClassName: V,
|
|
35
40
|
labelContainerClassName: j,
|
|
36
41
|
labelClassName: G,
|
|
37
|
-
descriptionClassName:
|
|
38
|
-
},
|
|
39
|
-
const
|
|
40
|
-
|
|
42
|
+
descriptionClassName: W
|
|
43
|
+
}, A) => {
|
|
44
|
+
const o = Q(), b = !!o, y = d !== void 0, [D, L] = X(
|
|
45
|
+
d,
|
|
41
46
|
C
|
|
42
|
-
), e =
|
|
43
|
-
|
|
44
|
-
},
|
|
47
|
+
), e = b ? o.value === s : y ? d : D, c = o?.disabled || B, a = S ?? o?.size ?? "md", M = w ?? o?.side ?? "left", p = z ?? o?.readOnly ?? !1, i = O ?? o?.error ?? !1, t = P === "neutral", h = m[a].outer, g = t ? m[a].neutralInner : m[a].inner, U = () => {
|
|
48
|
+
c || p || (b ? o.setValue?.(s) : (y || L(!e), k?.(!e)));
|
|
49
|
+
}, q = i ? e ? r.fill.negativeTint : r.fill.bgSecondary : e ? t ? r.fill.neutralPrimary : r.fill.accentTint : r.fill.bgSecondary, E = e ? i ? r.fill.negativePrimary : t ? r.icon.secondary : r.fill.accentPrimary : void 0, F = i ? r.border.negativeSecondary : e && t ? r.border.neutralPrimary : r.border.neutralAlphaLow, H = e && (!t || i) ? 0 : 1;
|
|
45
50
|
return (
|
|
46
51
|
// biome-ignore lint/a11y/useSemanticElements: <нарочное допущение тк с button проще работать чем с input>
|
|
47
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ x(
|
|
48
53
|
"button",
|
|
49
54
|
{
|
|
50
|
-
ref:
|
|
55
|
+
ref: A,
|
|
51
56
|
role: "radio",
|
|
52
57
|
type: "button",
|
|
53
|
-
"data-value":
|
|
58
|
+
"data-value": s,
|
|
54
59
|
"aria-checked": e,
|
|
55
|
-
"aria-disabled":
|
|
60
|
+
"aria-disabled": c || void 0,
|
|
56
61
|
tabIndex: e ? 0 : -1,
|
|
57
|
-
className:
|
|
58
|
-
|
|
59
|
-
e &&
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
className: J([
|
|
63
|
+
n.radio,
|
|
64
|
+
e && n.checked,
|
|
65
|
+
c && n.disabled,
|
|
66
|
+
M === "right" && n.sideRight,
|
|
67
|
+
p && n.readOnly,
|
|
68
|
+
I
|
|
64
69
|
]),
|
|
65
|
-
onClick:
|
|
70
|
+
onClick: U,
|
|
66
71
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
|
|
72
|
+
/* @__PURE__ */ l(
|
|
73
|
+
u,
|
|
69
74
|
{
|
|
70
|
-
w:
|
|
71
|
-
h
|
|
72
|
-
backgroundColor:
|
|
73
|
-
borderWidth:
|
|
74
|
-
borderColor:
|
|
75
|
+
w: h,
|
|
76
|
+
h,
|
|
77
|
+
backgroundColor: q,
|
|
78
|
+
borderWidth: H,
|
|
79
|
+
borderColor: F,
|
|
75
80
|
borderStyle: "solid",
|
|
76
81
|
center: !0,
|
|
77
|
-
borderRadius:
|
|
82
|
+
borderRadius: N.fullRound,
|
|
78
83
|
className: T,
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
-
|
|
84
|
+
children: /* @__PURE__ */ l(
|
|
85
|
+
u,
|
|
81
86
|
{
|
|
82
|
-
w:
|
|
83
|
-
h:
|
|
84
|
-
backgroundColor:
|
|
85
|
-
borderRadius:
|
|
87
|
+
w: g,
|
|
88
|
+
h: g,
|
|
89
|
+
backgroundColor: E,
|
|
90
|
+
borderRadius: N.fullRound,
|
|
86
91
|
"aria-hidden": !0,
|
|
87
92
|
className: V
|
|
88
93
|
}
|
|
89
94
|
)
|
|
90
95
|
}
|
|
91
96
|
),
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
97
|
+
/* @__PURE__ */ x(u, { alignItems: "flex-start", className: j, children: [
|
|
98
|
+
/* @__PURE__ */ l(
|
|
99
|
+
R,
|
|
95
100
|
{
|
|
96
|
-
variant:
|
|
101
|
+
variant: a === "sm" ? "body-2" : "body-1",
|
|
97
102
|
tag: "span",
|
|
98
103
|
left: !0,
|
|
99
104
|
className: G,
|
|
100
105
|
children: v
|
|
101
106
|
}
|
|
102
107
|
),
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
f && /* @__PURE__ */ l(
|
|
109
|
+
R,
|
|
105
110
|
{
|
|
106
111
|
tag: "span",
|
|
107
112
|
variant: "body-2",
|
|
108
113
|
colorName: "secondary",
|
|
109
|
-
className:
|
|
110
|
-
children:
|
|
114
|
+
className: W,
|
|
115
|
+
children: f
|
|
111
116
|
}
|
|
112
117
|
)
|
|
113
118
|
] })
|
|
@@ -117,7 +122,7 @@ const { color: o, cornerRadius: x } = K, R = {
|
|
|
117
122
|
);
|
|
118
123
|
}
|
|
119
124
|
);
|
|
120
|
-
|
|
125
|
+
Z.displayName = "Radio";
|
|
121
126
|
export {
|
|
122
|
-
|
|
127
|
+
Z as Radio
|
|
123
128
|
};
|
|
@@ -2,7 +2,7 @@ import { FC, MouseEvent, ReactNode } from 'react';
|
|
|
2
2
|
import { AccentType, NegativeType, NeutralType, PositiveType, Size, TransferType, WarningType } from '../../../types/tokens.types';
|
|
3
3
|
export type BadgeVariant = "filled" | "outline" | "clear";
|
|
4
4
|
export type BadgeColor = NeutralType | AccentType | WarningType | PositiveType | NegativeType | TransferType;
|
|
5
|
-
export type BadgeSize = Extract<Size, "sm" | "md" | "lg">;
|
|
5
|
+
export type BadgeSize = Extract<Size, "xs" | "sm" | "md" | "lg">;
|
|
6
6
|
export type BadgeTextAlign = "left" | "center" | "right";
|
|
7
7
|
export interface BadgeProps {
|
|
8
8
|
/** Содержимое лейбла бейджа. Текст всегда центрируется по вертикали внутри бейджа. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as k, jsx as
|
|
2
|
-
import { cx as y, css as
|
|
1
|
+
import { jsxs as k, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cx as y, css as x } from "@emotion/css";
|
|
3
3
|
import B from "../../../assets/svg/shared/close-outline.svg.js";
|
|
4
4
|
import { Box as L } from "../../builders/Box/Box.js";
|
|
5
5
|
import { theme as $ } from "../../../utils/theme/index.js";
|
|
6
6
|
import { Ripple as j } from "../../builders/Ripple/Ripple.js";
|
|
7
7
|
import { Text as h } from "../../builders/Text/Text.js";
|
|
8
|
-
const { color: e, cornerRadius:
|
|
8
|
+
const { color: e, cornerRadius: l, spacing: a } = $, b = {
|
|
9
9
|
neutral: {
|
|
10
10
|
border: e.border.neutralAlphaLow,
|
|
11
11
|
bg: e.status.neutralTint,
|
|
@@ -42,32 +42,42 @@ const { color: e, cornerRadius: g, spacing: l } = $, b = {
|
|
|
42
42
|
color: "var(--text-transfer)",
|
|
43
43
|
colorName: "transfer"
|
|
44
44
|
}
|
|
45
|
-
},
|
|
45
|
+
}, p = {
|
|
46
|
+
xs: {
|
|
47
|
+
h: 18,
|
|
48
|
+
text: "caption-2",
|
|
49
|
+
corner: l.xs,
|
|
50
|
+
p: `3px ${a.xs}`,
|
|
51
|
+
gap: "2px"
|
|
52
|
+
},
|
|
46
53
|
sm: {
|
|
47
54
|
h: 24,
|
|
48
55
|
text: "caption-1",
|
|
49
|
-
corner:
|
|
50
|
-
p: `6px ${
|
|
56
|
+
corner: l.xs,
|
|
57
|
+
p: `6px ${a.sm}`,
|
|
58
|
+
gap: a.sm
|
|
51
59
|
},
|
|
52
60
|
md: {
|
|
53
61
|
h: 32,
|
|
54
62
|
text: "body-2",
|
|
55
|
-
corner:
|
|
56
|
-
p: `6px ${
|
|
63
|
+
corner: l.sm,
|
|
64
|
+
p: `6px ${a.md}`,
|
|
65
|
+
gap: a.sm
|
|
57
66
|
},
|
|
58
67
|
lg: {
|
|
59
68
|
h: 40,
|
|
60
69
|
text: "body-2",
|
|
61
|
-
corner:
|
|
62
|
-
p: `6px ${
|
|
70
|
+
corner: l.md,
|
|
71
|
+
p: `6px ${a.lg}`,
|
|
72
|
+
gap: a.sm
|
|
63
73
|
}
|
|
64
|
-
}, R = (d,
|
|
65
|
-
const t = b[
|
|
66
|
-
let r = t.bg,
|
|
67
|
-
const
|
|
74
|
+
}, R = (d, s, o, m) => {
|
|
75
|
+
const t = b[s];
|
|
76
|
+
let r = t.bg, c = "none";
|
|
77
|
+
const i = t.color;
|
|
68
78
|
switch (d) {
|
|
69
79
|
case "outline":
|
|
70
|
-
r = "transparent",
|
|
80
|
+
r = "transparent", c = `1px solid ${t.border}`;
|
|
71
81
|
break;
|
|
72
82
|
case "clear":
|
|
73
83
|
r = "transparent";
|
|
@@ -76,64 +86,63 @@ const { color: e, cornerRadius: g, spacing: l } = $, b = {
|
|
|
76
86
|
r = t.bg;
|
|
77
87
|
break;
|
|
78
88
|
}
|
|
79
|
-
return
|
|
80
|
-
cursor: o ? "not-allowed" :
|
|
89
|
+
return x({
|
|
90
|
+
cursor: o ? "not-allowed" : m ? "pointer" : "default",
|
|
81
91
|
opacity: o ? 0.5 : 1,
|
|
82
92
|
userSelect: "none",
|
|
83
93
|
position: "relative",
|
|
84
94
|
transition: "background-color 0.2s, opacity 0.2s",
|
|
85
95
|
backgroundColor: r,
|
|
86
|
-
color:
|
|
87
|
-
border:
|
|
96
|
+
color: i,
|
|
97
|
+
border: c
|
|
88
98
|
});
|
|
89
|
-
}, I =
|
|
99
|
+
}, I = x({
|
|
90
100
|
display: "inline-flex",
|
|
91
101
|
cursor: "pointer",
|
|
92
102
|
opacity: 0.6,
|
|
93
103
|
"&:hover": { opacity: 1 }
|
|
94
|
-
}), w =
|
|
104
|
+
}), w = x({
|
|
95
105
|
display: "inline-flex",
|
|
96
106
|
alignItems: "center",
|
|
97
107
|
color: "inherit"
|
|
98
108
|
}), O = ({
|
|
99
109
|
label: d,
|
|
100
|
-
color:
|
|
110
|
+
color: s = "neutral",
|
|
101
111
|
size: o = "md",
|
|
102
|
-
variant:
|
|
112
|
+
variant: m = "filled",
|
|
103
113
|
width: t,
|
|
104
114
|
textAlign: r = "center",
|
|
105
|
-
leftElement:
|
|
106
|
-
rightElement:
|
|
107
|
-
disabled:
|
|
108
|
-
onClick:
|
|
115
|
+
leftElement: c,
|
|
116
|
+
rightElement: i,
|
|
117
|
+
disabled: u,
|
|
118
|
+
onClick: g,
|
|
109
119
|
onDelete: f,
|
|
110
120
|
className: N,
|
|
111
121
|
labelClassName: C,
|
|
112
122
|
deleteButtonClassName: S
|
|
113
123
|
}) => {
|
|
114
|
-
const T = R(
|
|
124
|
+
const T = R(m, s, u, g);
|
|
115
125
|
return /* @__PURE__ */ k(
|
|
116
126
|
L,
|
|
117
127
|
{
|
|
118
128
|
row: !0,
|
|
119
129
|
alignItems: "center",
|
|
120
130
|
justifyContent: "center",
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
h: i[o].h,
|
|
131
|
+
p: p[o].p,
|
|
132
|
+
h: p[o].h,
|
|
124
133
|
w: t,
|
|
125
134
|
overflow: "hidden",
|
|
126
|
-
borderRadius:
|
|
127
|
-
onClick:
|
|
135
|
+
borderRadius: p[o].corner,
|
|
136
|
+
onClick: g,
|
|
128
137
|
className: y(T, N),
|
|
129
138
|
children: [
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
/* @__PURE__ */
|
|
139
|
+
g && /* @__PURE__ */ n(j, {}),
|
|
140
|
+
c && /* @__PURE__ */ n("span", { className: w, children: c }),
|
|
141
|
+
/* @__PURE__ */ n(
|
|
133
142
|
h,
|
|
134
143
|
{
|
|
135
|
-
variant:
|
|
136
|
-
colorName: b[
|
|
144
|
+
variant: p[o].text,
|
|
145
|
+
colorName: b[s].colorName,
|
|
137
146
|
textOverflow: "ellipsis",
|
|
138
147
|
left: r === "left",
|
|
139
148
|
center: r === "center",
|
|
@@ -143,16 +152,16 @@ const { color: e, cornerRadius: g, spacing: l } = $, b = {
|
|
|
143
152
|
children: d
|
|
144
153
|
}
|
|
145
154
|
),
|
|
146
|
-
|
|
147
|
-
f && !
|
|
155
|
+
i && /* @__PURE__ */ n("span", { className: w, children: i }),
|
|
156
|
+
f && !u && /* @__PURE__ */ n(
|
|
148
157
|
h,
|
|
149
158
|
{
|
|
150
159
|
className: y(I, S),
|
|
151
|
-
colorName: b[
|
|
160
|
+
colorName: b[s].colorName,
|
|
152
161
|
onClick: (v) => {
|
|
153
162
|
v.stopPropagation(), f(v);
|
|
154
163
|
},
|
|
155
|
-
children: /* @__PURE__ */
|
|
164
|
+
children: /* @__PURE__ */ n(B, {})
|
|
156
165
|
}
|
|
157
166
|
)
|
|
158
167
|
]
|
|
@@ -6,11 +6,11 @@ import { ContentEditable as f } from "@lexical/react/LexicalContentEditable";
|
|
|
6
6
|
import { LexicalErrorBoundary as c } from "@lexical/react/LexicalErrorBoundary";
|
|
7
7
|
import { RichTextPlugin as p } from "@lexical/react/LexicalRichTextPlugin";
|
|
8
8
|
import { useMemo as s } from "react";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
9
|
+
import { getEditorConfig as u } from "../../controls/MarkdownTextEditor/configs/editor.config.js";
|
|
10
|
+
import { EDITOR_TRANSFORMERS as x } from "../../controls/MarkdownTextEditor/transformers/index.js";
|
|
11
|
+
import { markdownTextStyle as w } from "./MarkdownText.styles.js";
|
|
12
|
+
import { Text as E } from "../../builders/Text/Text.js";
|
|
13
|
+
import { EditorStateContext as k } from "../../controls/MarkdownTextEditor/contexts/EditorStateContext/EditorStateContext.js";
|
|
14
14
|
function F({
|
|
15
15
|
markdown: t,
|
|
16
16
|
className: i,
|
|
@@ -27,15 +27,15 @@ function F({
|
|
|
27
27
|
}),
|
|
28
28
|
[r]
|
|
29
29
|
);
|
|
30
|
-
return r ? /* @__PURE__ */ o(
|
|
30
|
+
return r ? /* @__PURE__ */ o(k.Provider, { value: a, children: /* @__PURE__ */ o(
|
|
31
31
|
d,
|
|
32
32
|
{
|
|
33
33
|
initialConfig: {
|
|
34
|
-
...
|
|
34
|
+
...u(),
|
|
35
35
|
editable: !1,
|
|
36
36
|
namespace: "ui-kit-markdown-text-viewer",
|
|
37
37
|
editorState: () => {
|
|
38
|
-
l(r,
|
|
38
|
+
l(r, x);
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
children: /* @__PURE__ */ o(
|
|
@@ -44,7 +44,7 @@ function F({
|
|
|
44
44
|
contentEditable: /* @__PURE__ */ o(
|
|
45
45
|
f,
|
|
46
46
|
{
|
|
47
|
-
className: m(
|
|
47
|
+
className: m(w, i),
|
|
48
48
|
"aria-placeholder": "markdown text",
|
|
49
49
|
placeholder: () => null
|
|
50
50
|
}
|
|
@@ -56,7 +56,7 @@ function F({
|
|
|
56
56
|
},
|
|
57
57
|
r
|
|
58
58
|
) }) : typeof e == "string" ? /* @__PURE__ */ o(
|
|
59
|
-
|
|
59
|
+
E,
|
|
60
60
|
{
|
|
61
61
|
variant: "body-2",
|
|
62
62
|
colorName: "tertiary",
|