@dss-kit/ui-kit 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { createColumnHelper } from '@tanstack/react-table';
2
2
  import { TableProps } from './Table.types';
3
3
  declare const Table: {
4
- <TData>({ ref, data, columns, showBorders, enableSorting, enablePagination, enableRowSelection, enableMultiRowSelection, enableColumnPinning, columnPinning: controlledColumnPinning, onColumnPinningChange, sorting: controlledSorting, onSortingChange, columnFilters: controlledColumnFilters, onColumnFiltersChange, columnVisibility: controlledColumnVisibility, onColumnVisibilityChange, pagination: controlledPagination, onPaginationChange, rowSelection: controlledRowSelection, onRowSelectionChange, totalCount, loading, emptyLabels, loadingLabels, className, containerClassName, theadClassName, tbodyClassName, emptyStateClassName, emptyStateTitleClassName, emptyStateDescriptionClassName, paginationClassName, tableOptions, onRowClick, getRowId, headCellComponent: HeadCellComponent, bodyCellComponent: BodyCellComponent, headRowComponent: HeadRowComponent, bodyRowComponent: BodyRowComponent, onReset, paginationVariant, paginationLabels, renderPageSizeSelectorDropdownItem, renderPageSizeSelectorInputItem, }: TableProps<TData>): import("react/jsx-runtime").JSX.Element;
4
+ <TData>({ ref, data, columns, showBorders, enableSorting, enablePagination, enableRowSelection, enableMultiRowSelection, enableColumnPinning, columnPinning: controlledColumnPinning, onColumnPinningChange, sorting: controlledSorting, onSortingChange, manualSorting, columnFilters: controlledColumnFilters, onColumnFiltersChange, columnVisibility: controlledColumnVisibility, onColumnVisibilityChange, pagination: controlledPagination, onPaginationChange, rowSelection: controlledRowSelection, onRowSelectionChange, totalCount, loading, loadingRowCount, emptyLabels, className, containerClassName, theadClassName, tbodyClassName, emptyStateClassName, emptyStateTitleClassName, emptyStateDescriptionClassName, paginationClassName, tableOptions, onRowClick, getRowId, headCellComponent: HeadCellComponent, bodyCellComponent: BodyCellComponent, headRowComponent: HeadRowComponent, bodyRowComponent: BodyRowComponent, onReset, paginationVariant, paginationLabels, renderPageSizeSelectorDropdownItem, renderPageSizeSelectorInputItem, }: TableProps<TData>): import("react/jsx-runtime").JSX.Element;
5
5
  displayName: string;
6
6
  HeadCellContent: import('react').ForwardRefExoticComponent<Omit<import('../Box').BoxProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
7
7
  BodyCellContent: import('react').ForwardRefExoticComponent<Omit<import('../Box').BoxProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,229 +1,248 @@
1
- import { jsx as o, jsxs as T } from "react/jsx-runtime";
2
- import { cx as r, css as M } from "@emotion/css";
3
- import { useReactTable as Re, getPaginationRowModel as xe, getSortedRowModel as Pe, getCoreRowModel as Te, flexRender as H, createColumnHelper as He } from "@tanstack/react-table";
4
- import { useImperativeHandle as Ne } from "react";
5
- import ve from "../../../assets/svg/table/loading.svg.js";
6
- import Me from "../../../assets/svg/table/search.svg.js";
7
- import { styles as ze } from "./styles.js";
8
- import { useControllableState as t } from "./Table.hooks.js";
9
- import { getColumnPinningStyles as N } from "./Table.utils.js";
10
- import { TablePlaceholder as v } from "./TablePlaceholder/TablePlaceholder.js";
11
- import { TableWrapper as Be } from "./TableWrapper/TableWrapper.js";
12
- import { TableHeadRow as Ie } from "./TableHeadRow/TableHeadRow.js";
13
- import { TablePagination as Ve } from "./TablePagination/TablePagination.js";
14
- import { TableHeadCell as ke } from "./TableHeadCell/TableHeadCell.js";
15
- import { TableBodyCell as Fe } from "./TableBodyCell/TableBodyCell.js";
16
- import { TableBodyRow as We } from "./TableBodyRow/TableBodyRow.js";
17
- import { TableHeadCellContent as je } from "./TableHeadCellContent/TableHeadCellContent.js";
18
- import { TableBodyCellContent as Le } from "./TableBodyCellContent/TableBodyCellContent.js";
19
- import { TableHeadCellContentSortable as De } from "./TableHeadCellContentSortable/TableHeadCellContentSortable.js";
20
- import { theme as qe } from "../../../utils/theme/index.js";
21
- import { Box as Ae } from "../Box/Box.js";
22
- const { spacing: f, color: l } = qe, Ee = M({
1
+ import { jsx as o, jsxs as P } from "react/jsx-runtime";
2
+ import { cx as p, css as b } from "@emotion/css";
3
+ import { useReactTable as He, getPaginationRowModel as ve, getSortedRowModel as Ne, getCoreRowModel as Me, flexRender as H, createColumnHelper as ke } from "@tanstack/react-table";
4
+ import { useImperativeHandle as Ie } from "react";
5
+ import ze from "../../../assets/svg/table/search.svg.js";
6
+ import { styles as Ve } from "./styles.js";
7
+ import { useControllableState as m } from "./Table.hooks.js";
8
+ import { getColumnPinningStyles as f } from "./Table.utils.js";
9
+ import { TablePlaceholder as Le } from "./TablePlaceholder/TablePlaceholder.js";
10
+ import { TableWrapper as Ee } from "./TableWrapper/TableWrapper.js";
11
+ import { TableHeadRow as Fe } from "./TableHeadRow/TableHeadRow.js";
12
+ import { TablePagination as We } from "./TablePagination/TablePagination.js";
13
+ import { TableHeadCell as je } from "./TableHeadCell/TableHeadCell.js";
14
+ import { TableBodyCell as Be } from "./TableBodyCell/TableBodyCell.js";
15
+ import { TableBodyRow as De } from "./TableBodyRow/TableBodyRow.js";
16
+ import { TableBodyCellContent as M } from "./TableBodyCellContent/TableBodyCellContent.js";
17
+ import { Skeleton as _e } from "../../shared/Skeleton/Skeleton.js";
18
+ import { TableHeadCellContent as Ae } from "./TableHeadCellContent/TableHeadCellContent.js";
19
+ import { TableHeadCellContentSortable as Ke } from "./TableHeadCellContentSortable/TableHeadCellContentSortable.js";
20
+ import { theme as Oe } from "../../../utils/theme/index.js";
21
+ import { Box as $e } from "../Box/Box.js";
22
+ const { spacing: v, color: n } = Oe, qe = b({
23
23
  width: "100%",
24
24
  maxWidth: "100%",
25
25
  minWidth: "max-content",
26
26
  borderCollapse: "collapse",
27
27
  borderSpacing: 0,
28
- backgroundColor: l.fill.bgPrimary
29
- }), Ge = M({
30
- backgroundColor: l.fill.bgSecondary,
31
- color: l.text.tertiary
32
- }), m = ({
33
- ref: z,
34
- data: g,
35
- columns: B,
36
- showBorders: d = !0,
37
- enableSorting: I = !1,
38
- enablePagination: b = !1,
28
+ backgroundColor: n.fill.bgPrimary
29
+ }), Ge = b({
30
+ backgroundColor: n.fill.bgSecondary,
31
+ color: n.text.tertiary
32
+ }), Je = b({
33
+ pointerEvents: "none",
34
+ userSelect: "none"
35
+ }), N = ["70%", "55%", "80%", "60%"], c = ({
36
+ ref: k,
37
+ data: h,
38
+ columns: I,
39
+ showBorders: g = !0,
40
+ enableSorting: z = !1,
41
+ enablePagination: S = !1,
39
42
  enableRowSelection: V = !1,
40
- enableMultiRowSelection: k = !1,
41
- enableColumnPinning: p = !1,
42
- columnPinning: F,
43
- onColumnPinningChange: W,
44
- sorting: j,
45
- onSortingChange: L,
43
+ enableMultiRowSelection: L = !1,
44
+ enableColumnPinning: d = !1,
45
+ columnPinning: E,
46
+ onColumnPinningChange: F,
47
+ sorting: W,
48
+ onSortingChange: j,
49
+ manualSorting: B,
46
50
  columnFilters: D,
47
- onColumnFiltersChange: q,
51
+ onColumnFiltersChange: _,
48
52
  columnVisibility: A,
49
- onColumnVisibilityChange: E,
50
- pagination: G,
51
- onPaginationChange: J,
52
- rowSelection: K,
53
- onRowSelectionChange: O,
53
+ onColumnVisibilityChange: K,
54
+ pagination: O,
55
+ onPaginationChange: $,
56
+ rowSelection: q,
57
+ onRowSelectionChange: G,
54
58
  totalCount: s,
55
- loading: u = !1,
59
+ loading: i = !1,
60
+ loadingRowCount: J = 10,
56
61
  emptyLabels: Q = {
57
62
  title: "Nothing found",
58
- description: "No results found for “result”",
63
+ description: "Try adjusting your search or filters",
59
64
  action: "Reset"
60
65
  },
61
- loadingLabels: U = {
62
- title: "Loading...",
63
- description: "Please wait or reset your promt",
64
- action: "Reset"
65
- },
66
- className: X,
67
- containerClassName: C,
68
- theadClassName: Y,
69
- tbodyClassName: Z,
70
- emptyStateClassName: S,
71
- emptyStateTitleClassName: y,
72
- emptyStateDescriptionClassName: w,
73
- paginationClassName: _,
74
- tableOptions: $ = {},
75
- onRowClick: R,
76
- getRowId: ee,
77
- headCellComponent: oe = ke,
78
- bodyCellComponent: le = Fe,
79
- headRowComponent: ne = Ie,
80
- bodyRowComponent: te = We,
81
- onReset: x,
82
- paginationVariant: ie,
83
- paginationLabels: ae,
84
- renderPageSizeSelectorDropdownItem: re,
85
- renderPageSizeSelectorInputItem: me
66
+ className: U,
67
+ containerClassName: u,
68
+ theadClassName: X,
69
+ tbodyClassName: Y,
70
+ emptyStateClassName: Z,
71
+ emptyStateTitleClassName: ee,
72
+ emptyStateDescriptionClassName: oe,
73
+ paginationClassName: te,
74
+ tableOptions: le = {},
75
+ onRowClick: y,
76
+ getRowId: ne,
77
+ headCellComponent: ie = je,
78
+ bodyCellComponent: w = Be,
79
+ headRowComponent: ae = Fe,
80
+ bodyRowComponent: x = De,
81
+ onReset: re,
82
+ paginationVariant: me,
83
+ paginationLabels: se,
84
+ renderPageSizeSelectorDropdownItem: ce,
85
+ renderPageSizeSelectorInputItem: ge
86
86
  }) => {
87
- const [se, ce] = t(
87
+ const [de, pe] = m(
88
+ W,
88
89
  j,
89
- L,
90
90
  []
91
- ), [ge, de] = t(
91
+ ), [he, Ce] = m(
92
92
  D,
93
- q,
93
+ _,
94
94
  []
95
- ), [pe, Ce] = t(
95
+ ), [fe, be] = m(
96
96
  A,
97
- E,
97
+ K,
98
98
  {}
99
- ), [n, h] = t(
100
- G,
101
- J,
99
+ ), [a, C] = m(
100
+ O,
101
+ $,
102
102
  { pageIndex: 0, pageSize: 10 }
103
- ), [he, fe] = t(K, O, {}), [be, ue] = t(
103
+ ), [Se, ue] = m(q, G, {}), [ye, we] = m(
104
+ E,
104
105
  F,
105
- W,
106
106
  { left: [], right: [] }
107
- ), i = Re({
108
- data: g,
109
- columns: B,
107
+ ), R = B ?? !!s, l = He({
108
+ data: h,
109
+ columns: I,
110
110
  state: {
111
- sorting: se,
112
- columnFilters: ge,
113
- columnVisibility: pe,
114
- pagination: n,
115
- rowSelection: he,
116
- columnPinning: be
111
+ sorting: de,
112
+ columnFilters: he,
113
+ columnVisibility: fe,
114
+ pagination: a,
115
+ rowSelection: Se,
116
+ columnPinning: ye
117
117
  },
118
- onSortingChange: ce,
119
- onColumnFiltersChange: de,
120
- onColumnVisibilityChange: Ce,
121
- onPaginationChange: h,
122
- onRowSelectionChange: fe,
123
- onColumnPinningChange: ue,
124
- getCoreRowModel: Te(),
125
- getSortedRowModel: I ? Pe() : void 0,
126
- getPaginationRowModel: b ? xe() : void 0,
118
+ onSortingChange: pe,
119
+ onColumnFiltersChange: Ce,
120
+ onColumnVisibilityChange: be,
121
+ onPaginationChange: C,
122
+ onRowSelectionChange: ue,
123
+ onColumnPinningChange: we,
124
+ getCoreRowModel: Me(),
125
+ getSortedRowModel: z && !R ? Ne() : void 0,
126
+ getPaginationRowModel: S ? ve() : void 0,
127
127
  enableRowSelection: V,
128
- enableMultiRowSelection: k,
129
- enableColumnPinning: p,
130
- getRowId: ee,
128
+ enableMultiRowSelection: L,
129
+ enableColumnPinning: d,
130
+ getRowId: ne,
131
+ manualSorting: R,
131
132
  manualPagination: !!s,
132
- pageCount: s ? Math.ceil(s / n.pageSize) : void 0,
133
- ...$
133
+ pageCount: s ? Math.ceil(s / a.pageSize) : void 0,
134
+ ...le
134
135
  });
135
- Ne(z, () => i);
136
- const { rows: P } = i.getRowModel(), Se = (e, a) => {
137
- R && R(e.original, a);
138
- }, ye = (e) => /* @__PURE__ */ o(
139
- oe,
136
+ Ie(k, () => l);
137
+ const { rows: T } = l.getRowModel(), xe = (e, t) => {
138
+ y && y(e.original, t);
139
+ }, Re = (e) => /* @__PURE__ */ o(
140
+ ie,
140
141
  {
141
142
  style: {
142
143
  width: e.getSize(),
143
- ...p && N(i, e.column, l.fill.bgSecondary)
144
+ ...d && f(l, e.column, n.fill.bgSecondary)
144
145
  },
145
- onClick: e.column.getToggleSortingHandler(),
146
+ onClick: i ? void 0 : e.column.getToggleSortingHandler(),
146
147
  children: e.isPlaceholder ? null : H(e.column.columnDef.header, e.getContext())
147
148
  },
148
149
  e.id
149
- ), we = (e, a) => /* @__PURE__ */ o(
150
- te,
150
+ ), Te = (e, t) => /* @__PURE__ */ o(
151
+ x,
151
152
  {
152
- showBorders: d,
153
+ showBorders: g,
153
154
  isSelected: e.getIsSelected(),
154
- onClick: () => Se(e, a),
155
- children: e.getVisibleCells().map((c) => /* @__PURE__ */ o(
156
- le,
155
+ onClick: () => xe(e, t),
156
+ children: e.getVisibleCells().map((r) => /* @__PURE__ */ o(
157
+ w,
157
158
  {
158
- style: p ? N(i, c.column, l.fill.bgPrimary) : void 0,
159
- children: H(c.column.columnDef.cell, c.getContext())
159
+ style: d ? f(l, r.column, n.fill.bgPrimary) : void 0,
160
+ children: H(r.column.columnDef.cell, r.getContext())
160
161
  },
161
- c.id
162
+ r.id
162
163
  ))
163
164
  },
164
165
  e.id
165
- );
166
- return u ? /* @__PURE__ */ o(
167
- v,
166
+ ), Pe = (e) => /* @__PURE__ */ o(
167
+ x,
168
168
  {
169
- icon: /* @__PURE__ */ o(
170
- ve,
169
+ showBorders: g,
170
+ children: l.getVisibleLeafColumns().map((t, r) => /* @__PURE__ */ o(
171
+ w,
171
172
  {
172
- width: 32,
173
- height: 32,
174
- style: { color: l.icon.tertiary, marginBottom: f.sm }
175
- }
176
- ),
177
- labels: U,
178
- onReset: x,
179
- className: r(C, S),
180
- titleClassName: y,
181
- descriptionClassName: w
182
- }
183
- ) : P.length ? /* @__PURE__ */ T(Ae, { w: "full", gap: f.xl, className: r(C), children: [
184
- /* @__PURE__ */ o(Be, { data: g, showBorders: d, children: /* @__PURE__ */ T("table", { className: r(Ee, ze.table, X), children: [
185
- /* @__PURE__ */ o("thead", { className: r(Ge, Y), children: i.getHeaderGroups().map((e) => /* @__PURE__ */ o(ne, { showBorders: d, children: e.headers.map(ye) }, e.id)) }),
186
- /* @__PURE__ */ o("tbody", { className: Z, children: P.map((e, a) => we(e, a)) })
187
- ] }) }),
188
- b && !u && /* @__PURE__ */ o(
189
- Ve,
190
- {
191
- pageIndex: n.pageIndex,
192
- pageSize: n.pageSize,
193
- totalCount: s || g.length,
194
- variant: ie,
195
- labels: ae,
196
- renderPageSizeSelectorDropdownItem: re,
197
- renderPageSizeSelectorInputItem: me,
198
- onPageChange: (e) => h({ ...n, pageIndex: e }),
199
- onPageSizeChange: (e) => h({ ...n, pageSize: e, pageIndex: 0 }),
200
- className: _
201
- }
202
- )
203
- ] }) : /* @__PURE__ */ o(
204
- v,
173
+ style: d ? f(l, t, n.fill.bgPrimary) : void 0,
174
+ children: /* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(
175
+ _e,
176
+ {
177
+ variant: "text",
178
+ height: 16,
179
+ width: N[r % N.length]
180
+ }
181
+ ) })
182
+ },
183
+ t.id
184
+ ))
185
+ },
186
+ `skeleton-row-${e}`
187
+ );
188
+ return !i && !T.length ? /* @__PURE__ */ o(
189
+ Le,
205
190
  {
206
191
  icon: /* @__PURE__ */ o(
207
- Me,
192
+ ze,
208
193
  {
209
194
  width: 24,
210
195
  height: 24,
211
- style: { color: l.icon.tertiary, marginBottom: f.sm }
196
+ style: { color: n.icon.tertiary, marginBottom: v.sm }
212
197
  }
213
198
  ),
214
199
  labels: Q,
215
- onReset: x,
216
- className: r(C, S),
217
- titleClassName: y,
218
- descriptionClassName: w
200
+ onReset: re,
201
+ className: p(u, Z),
202
+ titleClassName: ee,
203
+ descriptionClassName: oe
219
204
  }
220
- );
205
+ ) : /* @__PURE__ */ P($e, { w: "full", gap: v.xl, className: p(u), children: [
206
+ /* @__PURE__ */ o(Ee, { data: h, showBorders: g, children: /* @__PURE__ */ P("table", { className: p(qe, Ve.table, U), children: [
207
+ /* @__PURE__ */ o(
208
+ "thead",
209
+ {
210
+ className: p(
211
+ Ge,
212
+ { [Je]: i },
213
+ X
214
+ ),
215
+ "aria-busy": i,
216
+ children: l.getHeaderGroups().map((e) => /* @__PURE__ */ o(ae, { showBorders: g, children: e.headers.map(Re) }, e.id))
217
+ }
218
+ ),
219
+ /* @__PURE__ */ o("tbody", { className: Y, children: i ? Array.from(
220
+ { length: J },
221
+ (e, t) => Pe(t)
222
+ ) : T.map((e, t) => Te(e, t)) })
223
+ ] }) }),
224
+ S && !i && /* @__PURE__ */ o(
225
+ We,
226
+ {
227
+ pageIndex: a.pageIndex,
228
+ pageSize: a.pageSize,
229
+ totalCount: s || h.length,
230
+ variant: me,
231
+ labels: se,
232
+ renderPageSizeSelectorDropdownItem: ce,
233
+ renderPageSizeSelectorInputItem: ge,
234
+ onPageChange: (e) => C({ ...a, pageIndex: e }),
235
+ onPageSizeChange: (e) => C({ ...a, pageSize: e, pageIndex: 0 }),
236
+ className: te
237
+ }
238
+ )
239
+ ] });
221
240
  };
222
- m.displayName = "Table";
223
- m.HeadCellContent = je;
224
- m.BodyCellContent = Le;
225
- m.HeadCellContentSortable = De;
226
- m.createColumnHelper = He;
241
+ c.displayName = "Table";
242
+ c.HeadCellContent = Ae;
243
+ c.BodyCellContent = M;
244
+ c.HeadCellContentSortable = Ke;
245
+ c.createColumnHelper = ke;
227
246
  export {
228
- m as Table
247
+ c as Table
229
248
  };
@@ -32,6 +32,17 @@ export interface TableProps<TData> {
32
32
  sorting?: SortingState;
33
33
  /** Callback при изменении сортировки */
34
34
  onSortingChange?: (sorting: SortingState) => void;
35
+ /**
36
+ * Серверная (manual) сортировка. Когда `true`, таблица не сортирует данные
37
+ * на клиенте — она лишь сообщает о смене состояния через `onSortingChange`,
38
+ * а отсортированные данные должен вернуть бэкенд. Используйте вместе с
39
+ * контролируемым `sorting`, чтобы отображать активную колонку и направление.
40
+ *
41
+ * По умолчанию включается автоматически, когда задан `totalCount`
42
+ * (признак серверной пагинации).
43
+ * @default Boolean(totalCount)
44
+ */
45
+ manualSorting?: boolean;
35
46
  /** Состояние фильтров (контролируемое) */
36
47
  columnFilters?: ColumnFiltersState;
37
48
  /** Callback при изменении фильтров */
@@ -71,20 +82,18 @@ export interface TableProps<TData> {
71
82
  /** Загружается ли таблица */
72
83
  /** @default false */
73
84
  loading?: boolean;
85
+ /**
86
+ * Количество строк-скелетонов, отображаемых во время загрузки (`loading`).
87
+ * @default 10
88
+ */
89
+ loadingRowCount?: number;
74
90
  /** Сообщение при отсутствии данных */
75
- /** @default { title: "Nothing found", description: "No results found for “result”", action: "Reset" } */
91
+ /** @default { title: "Nothing found", description: "Try adjusting your search or filters", action: "Reset" } */
76
92
  emptyLabels?: {
77
93
  title: string;
78
94
  description: string;
79
95
  action: string | React.ReactNode;
80
96
  };
81
- /** Сообщение при загрузке данных */
82
- /** @default { title: "Loading...", description: "Please wait or reset your promt", action: "Reset" } */
83
- loadingLabels?: {
84
- title: string;
85
- description: string;
86
- action: string | React.ReactNode;
87
- };
88
97
  /** Кастомный класс для таблицы */
89
98
  className?: string;
90
99
  /** Кастомный класс для контейнера таблицы */
@@ -1,10 +1,10 @@
1
- import { jsxs as d, jsx as i } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
2
  import { Button as l } from "../../../controls/Button/Button.js";
3
3
  import { Box as s } from "../../Box/Box.js";
4
4
  import { theme as p } from "../../../../utils/theme/index.js";
5
- import { Text as e } from "../../Text/Text.js";
6
- const { spacing: o, cornerRadius: h } = p, f = ({
7
- icon: r,
5
+ import { Text as r } from "../../Text/Text.js";
6
+ const { spacing: e, cornerRadius: h } = p, f = ({
7
+ icon: i,
8
8
  labels: t,
9
9
  onReset: n,
10
10
  className: c,
@@ -15,34 +15,36 @@ const { spacing: o, cornerRadius: h } = p, f = ({
15
15
  {
16
16
  w: "full",
17
17
  borderRadius: h.md,
18
- py: o["5xl"],
19
- px: o["10xl"],
18
+ py: e["5xl"],
19
+ px: e["10xl"],
20
20
  alignItems: "center",
21
21
  className: c,
22
22
  children: [
23
- r,
24
- /* @__PURE__ */ i(
25
- e,
23
+ i,
24
+ /* @__PURE__ */ o(
25
+ r,
26
26
  {
27
- mb: o.xs,
27
+ mb: e.xs,
28
28
  variant: "title-3",
29
29
  fontWeight: "semibold",
30
30
  className: m,
31
+ center: !0,
31
32
  children: t.title
32
33
  }
33
34
  ),
34
- /* @__PURE__ */ i(
35
- e,
35
+ /* @__PURE__ */ o(
36
+ r,
36
37
  {
37
- mb: o.md,
38
+ mb: e.md,
38
39
  colorName: "tertiary",
39
40
  variant: "body-1",
40
41
  fontWeight: "medium",
41
42
  className: a,
43
+ center: !0,
42
44
  children: t.description
43
45
  }
44
46
  ),
45
- typeof t.action == "string" ? /* @__PURE__ */ i(
47
+ typeof t.action == "string" ? /* @__PURE__ */ o(
46
48
  l,
47
49
  {
48
50
  width: "auto",
@@ -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 { MARKDOWN_TOOLBAR_DEFAULT_ACTIONS as K } from "./MarkdownTextEditor.const.js";
12
- import { MarkdownTextEditorLocaleProvider as q } from "./MarkdownTextEditor.locale.js";
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(() => z(), []), L = 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 || K
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(q, { locale: M, children: /* @__PURE__ */ o(D, { initialConfig: I, children: /* @__PURE__ */ o(G.Provider, { value: L, children: /* @__PURE__ */ c(J.Provider, { value: F, children: [
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
  {
@@ -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 { EDITOR_TRANSFORMERS as u } from "../../controls/MarkdownTextEditor/transformers/index.js";
10
- import { markdownTextStyle as x } from "./MarkdownText.styles.js";
11
- import { Text as w } from "../../builders/Text/Text.js";
12
- import { EditorStateContext as E } from "../../controls/MarkdownTextEditor/contexts/EditorStateContext/EditorStateContext.js";
13
- import { getEditorConfig as k } from "../../controls/MarkdownTextEditor/configs/editor.config.js";
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(E.Provider, { value: a, children: /* @__PURE__ */ o(
30
+ return r ? /* @__PURE__ */ o(k.Provider, { value: a, children: /* @__PURE__ */ o(
31
31
  d,
32
32
  {
33
33
  initialConfig: {
34
- ...k(),
34
+ ...u(),
35
35
  editable: !1,
36
36
  namespace: "ui-kit-markdown-text-viewer",
37
37
  editorState: () => {
38
- l(r, u);
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(x, i),
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
- w,
59
+ E,
60
60
  {
61
61
  variant: "body-2",
62
62
  colorName: "tertiary",