@alphakits/ui 2.3.0 → 2.4.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 (217) hide show
  1. package/dist/__internal/utils/index.d.ts +1 -1
  2. package/dist/__internal/utils/index.js +4 -4
  3. package/dist/amount-input/component.js +41 -41
  4. package/dist/avatar/component.js +2 -18
  5. package/dist/badge/component.d.ts +1 -1
  6. package/dist/base-card/component.js +1 -7
  7. package/dist/bottom-sheet/component.d.ts +1 -1
  8. package/dist/bottom-sheet/component.js +9 -13
  9. package/dist/box/component.d.ts +2 -2
  10. package/dist/box/component.js +4 -4
  11. package/dist/button/component.js +9 -9
  12. package/dist/button-arrow/component.js +6 -1
  13. package/dist/calendar/component.d.ts +1 -2
  14. package/dist/calendar/component.js +77 -74
  15. package/dist/calendar/components/days-table/component.js +46 -43
  16. package/dist/calendar/components/header/{/321/201omponent.js → component.js} +3 -12
  17. package/dist/calendar/components/header/index.d.ts +1 -1
  18. package/dist/calendar/components/header/index.js +1 -1
  19. package/dist/calendar/components/months-table/{/321/201omponent.js → component.js} +7 -7
  20. package/dist/calendar/components/months-table/index.d.ts +1 -1
  21. package/dist/calendar/components/months-table/index.js +1 -1
  22. package/dist/calendar/components/select-button/{/321/201omponent.d.ts → component.d.ts} +3 -3
  23. package/dist/calendar/components/select-button/{/321/201omponent.js → component.js} +5 -11
  24. package/dist/calendar/components/select-button/index.d.ts +1 -1
  25. package/dist/calendar/components/select-button/index.js +1 -1
  26. package/dist/calendar/components/years-table/{/321/201omponent.js → component.js} +14 -14
  27. package/dist/calendar/components/years-table/index.d.ts +1 -1
  28. package/dist/calendar/components/years-table/index.js +1 -1
  29. package/dist/calendar/index.d.ts +2 -2
  30. package/dist/calendar/index.js +4 -4
  31. package/dist/calendar/use-calendar.js +51 -47
  32. package/dist/calendar/utils.js +7 -9
  33. package/dist/calendar-input/component.js +22 -22
  34. package/dist/card/component.js +2 -18
  35. package/dist/cell/base/component.js +31 -31
  36. package/dist/cell/pure/component.js +2 -2
  37. package/dist/checkbox/component.js +11 -11
  38. package/dist/checkbox-group/component.js +23 -24
  39. package/dist/checkbox-lists/component.d.ts +1 -2
  40. package/dist/checkbox-lists/component.js +59 -61
  41. package/dist/collapsable-row/addons.d.ts +3 -4
  42. package/dist/collapsable-row/addons.js +6 -9
  43. package/dist/collapsable-row/component.d.ts +1 -1
  44. package/dist/collapsable-row/component.js +7 -7
  45. package/dist/collapse/component.js +45 -54
  46. package/dist/copy-button/component.d.ts +1 -2
  47. package/dist/copy-button/component.js +1 -5
  48. package/dist/date/component.js +1 -1
  49. package/dist/date-switcher/component.d.ts +1 -2
  50. package/dist/date-switcher/component.js +8 -8
  51. package/dist/decorated-item/component.js +10 -20
  52. package/dist/dot/component.js +1 -4
  53. package/dist/empty-page/component.js +1 -9
  54. package/dist/filter-tag/component.d.ts +1 -1
  55. package/dist/flex/component.d.ts +2 -2
  56. package/dist/footer/component.js +57 -53
  57. package/dist/form/component.d.ts +1 -2
  58. package/dist/form/component.js +2 -12
  59. package/dist/form/templates/base-form/index.d.ts +3 -3
  60. package/dist/form/templates/base-form/index.js +26 -26
  61. package/dist/form/templates/filters-form/index.d.ts +1 -1
  62. package/dist/form/templates/filters-form/index.js +20 -23
  63. package/dist/form/templates/rest-form/form.d.ts +1 -2
  64. package/dist/form/templates/rest-form/form.js +51 -56
  65. package/dist/form/templates/rest-form/index.d.ts +3 -3
  66. package/dist/form/templates/rest-form/index.js +16 -27
  67. package/dist/form/utils/get-default-values.js +3 -6
  68. package/dist/form/utils/remove-undefined-from-object.js +1 -3
  69. package/dist/form-control/component.js +1 -1
  70. package/dist/formik/index.d.ts +2 -2
  71. package/dist/header-search/component.js +1 -6
  72. package/dist/hooks/index.d.ts +2 -2
  73. package/dist/hooks/index.js +10 -10
  74. package/dist/hooks/use-get-one/index.js +16 -16
  75. package/dist/icon-button/component.d.ts +3 -3
  76. package/dist/icon-button/component.js +2 -8
  77. package/dist/image/component.js +52 -30
  78. package/dist/image/image-base.js +1 -7
  79. package/dist/image/use-image-render-component.d.ts +1 -1
  80. package/dist/image/use-image-render-component.js +11 -14
  81. package/dist/image-gallery/component.js +40 -45
  82. package/dist/image-uploader/component.js +56 -53
  83. package/dist/index.js +41 -41
  84. package/dist/info-block-wrapper/component.d.ts +1 -1
  85. package/dist/input/component.js +1 -1
  86. package/dist/input-autocomplete/autocomplete-field/index.d.ts +1 -2
  87. package/dist/input-autocomplete/autocomplete-field/index.js +6 -6
  88. package/dist/input-autocomplete/component.d.ts +26 -26
  89. package/dist/input-ghost/component.d.ts +1 -1
  90. package/dist/link/component.d.ts +2 -2
  91. package/dist/link/component.js +1 -1
  92. package/dist/loader/component.js +6 -5
  93. package/dist/masked-input/component.js +7 -16
  94. package/dist/menu/component.js +12 -17
  95. package/dist/menu/components/content-header/index.js +1 -9
  96. package/dist/menu/components/menu-avatar/index.js +1 -6
  97. package/dist/menu/components/menu-button/index.js +1 -10
  98. package/dist/menu/components/menu-buttons-list/index.d.ts +1 -1
  99. package/dist/menu/components/menu-buttons-list/index.js +1 -7
  100. package/dist/menu/hooks/use-menu.js +12 -12
  101. package/dist/message/component.js +33 -14
  102. package/dist/modal/components/modals/modal.d.ts +1 -2
  103. package/dist/modal/components/modals/modal.js +30 -33
  104. package/dist/modal/context.js +12 -9
  105. package/dist/modal/hooks/use-modal.d.ts +1 -1
  106. package/dist/mq/component.js +1 -6
  107. package/dist/notification/component.js +14 -12
  108. package/dist/page-container/component.js +1 -6
  109. package/dist/page-loading/component.d.ts +1 -2
  110. package/dist/page-with-controls/component.js +4 -7
  111. package/dist/picker-button/common/labeled-button/index.js +18 -12
  112. package/dist/picker-button/component.js +5 -5
  113. package/dist/picker-button/field/{Component.d.ts → component.d.ts} +1 -2
  114. package/dist/picker-button/field/index.d.ts +1 -1
  115. package/dist/picker-button/field/index.js +1 -1
  116. package/dist/picker-button/index.d.ts +1 -1
  117. package/dist/picker-button/index.js +4 -4
  118. package/dist/popover/component.d.ts +2 -2
  119. package/dist/popover/component.js +69 -63
  120. package/dist/radio/component.js +7 -7
  121. package/dist/radio-groups/component.d.ts +1 -2
  122. package/dist/radio-groups/component.js +9 -7
  123. package/dist/select/component.d.ts +8 -9
  124. package/dist/select/component.js +1 -9
  125. package/dist/select/components/arrow/component.d.ts +1 -2
  126. package/dist/select/components/base-select/component.js +97 -90
  127. package/dist/select/components/checkmark/component.d.ts +1 -2
  128. package/dist/select/components/field/component.d.ts +1 -2
  129. package/dist/select/components/field/component.js +8 -5
  130. package/dist/select/components/native-select/component.js +4 -11
  131. package/dist/select/components/optgroup/component.d.ts +1 -2
  132. package/dist/select/components/optgroup/component.js +4 -4
  133. package/dist/select/components/option/component.js +1 -1
  134. package/dist/select/components/options-list/component.d.ts +1 -2
  135. package/dist/select/components/options-list/component.js +25 -23
  136. package/dist/select/components/select-search/index.d.ts +1 -1
  137. package/dist/select/components/select-search/index.js +28 -26
  138. package/dist/select/components/virtual-options-list/component.d.ts +1 -2
  139. package/dist/select/components/virtual-options-list/component.js +52 -45
  140. package/dist/select/index.js +4 -4
  141. package/dist/select/presets/index.d.ts +1 -1
  142. package/dist/select/presets/index.js +4 -4
  143. package/dist/select/presets/use-lazy-loading/index.d.ts +3 -4
  144. package/dist/select/presets/use-lazy-loading/index.js +45 -43
  145. package/dist/select/presets/use-select-with-loading/hook.d.ts +1 -2
  146. package/dist/select/presets/use-select-with-loading/hook.js +8 -1
  147. package/dist/select/utils.js +32 -32
  148. package/dist/sidepanel/component.js +21 -15
  149. package/dist/sidepanel-header/component.js +17 -16
  150. package/dist/skeleton/component.js +4 -4
  151. package/dist/space/component.d.ts +2 -2
  152. package/dist/space/component.js +42 -45
  153. package/dist/space/{Item.d.ts → item.d.ts} +2 -2
  154. package/dist/spinner/component.js +6 -5
  155. package/dist/stack/index.d.ts +1 -1
  156. package/dist/stack/index.js +5 -5
  157. package/dist/stepped-progress-bar/components/step-bar.js +3 -3
  158. package/dist/stepped-progress-bar/index.d.ts +2 -2
  159. package/dist/stepped-progress-bar/index.js +37 -22
  160. package/dist/sticker/component.js +1 -17
  161. package/dist/suffix-input/component.js +13 -13
  162. package/dist/switch/component.js +7 -7
  163. package/dist/table/components/cells/index.d.ts +1 -2
  164. package/dist/table/components/empty-list/index.d.ts +1 -2
  165. package/dist/table/components/error/index.d.ts +2 -3
  166. package/dist/table/components/error/index.js +1 -1
  167. package/dist/table/components/loading/index.d.ts +1 -1
  168. package/dist/table/components/loading/index.js +18 -12
  169. package/dist/table/components/pagination/index.js +56 -53
  170. package/dist/table/components/table-header/index.js +59 -56
  171. package/dist/table/hooks/use-table-data.js +63 -60
  172. package/dist/table/table.d.ts +1 -1
  173. package/dist/table/table.js +73 -73
  174. package/dist/table/types.d.ts +3 -3
  175. package/dist/table/utils/get-query-from-url.js +1 -8
  176. package/dist/table/utils/get-tags.d.ts +1 -1
  177. package/dist/table/utils/get-tags.js +9 -12
  178. package/dist/table/utils/index.d.ts +1 -1
  179. package/dist/table/utils/index.js +4 -4
  180. package/dist/table/utils/parse-query-params.js +5 -1
  181. package/dist/table/utils/prepare-rows.d.ts +1 -2
  182. package/dist/table/utils/prepare-rows.js +4 -3
  183. package/dist/table/utils/query-adapter.d.ts +1 -1
  184. package/dist/table/utils/query-adapter.js +5 -5
  185. package/dist/table/utils/remove-query-param.js +3 -1
  186. package/dist/table/utils/reset-query-param.js +16 -9
  187. package/dist/table-status/component.js +5 -1
  188. package/dist/textarea/component.js +36 -28
  189. package/dist/theme-provider/component.js +33 -29
  190. package/dist/toast/component.d.ts +7 -8
  191. package/dist/toast/component.js +65 -63
  192. package/dist/toast-notifier/component.js +13 -13
  193. package/dist/toast-notifier/use-timer.d.ts +1 -1
  194. package/dist/toast-notifier/use-timer.js +5 -5
  195. package/dist/toast-plate/component.d.ts +3 -3
  196. package/dist/toast-plate/component.js +7 -7
  197. package/dist/tooltip/component.js +35 -35
  198. package/dist/tooltip/node-resolver.js +7 -7
  199. package/dist/typings/api.d.ts +3 -5
  200. package/dist/typography/colors.d.ts +1 -1
  201. package/dist/typography/title/component.d.ts +3 -3
  202. package/dist/typography/title/index.d.ts +1 -1
  203. package/dist/typography/title/index.js +3 -3
  204. package/dist/utils/date/index.js +12 -2
  205. package/dist/utils/index.d.ts +2 -2
  206. package/dist/utils/index.js +14 -14
  207. package/dist/utils/split-amount/util.js +4 -4
  208. package/dist/with-suffix/component.d.ts +13 -13
  209. package/dist/with-suffix/component.js +8 -8
  210. package/package.json +9 -34
  211. /package/dist/__internal/utils/{getDataTestId.d.ts → get-data-test-id.d.ts} +0 -0
  212. /package/dist/__internal/utils/{getDataTestId.js → get-data-test-id.js} +0 -0
  213. /package/dist/calendar/components/header/{/321/201omponent.d.ts" → component.d.ts} +0 -0
  214. /package/dist/calendar/components/months-table/{/321/201omponent.d.ts" → component.d.ts} +0 -0
  215. /package/dist/calendar/components/years-table/{/321/201omponent.d.ts" → component.d.ts} +0 -0
  216. /package/dist/picker-button/field/{Component.js → component.js} +0 -0
  217. /package/dist/space/{Item.js → item.js} +0 -0
@@ -1,133 +1,133 @@
1
1
  import { jsxs as f, jsx as r } from "react/jsx-runtime";
2
- import X, { useMemo as E, useCallback as Y } from "react";
3
2
  import P from "classnames";
4
- import { Cells as Z } from "./components/cells/index.js";
5
- import { EmptyList as $ } from "./components/empty-list/index.js";
6
- import { Error as A } from "./components/error/index.js";
7
- import { Loading as aa } from "./components/loading/index.js";
8
- import { Pagination as ta } from "./components/pagination/index.js";
9
- import { TableHeader as ra } from "./components/table-header/index.js";
10
- import { useTableData as oa } from "./hooks/use-table-data.js";
11
- import { getTags as ea } from "./utils/get-tags.js";
12
- import { prepareRows as sa } from "./utils/prepare-rows.js";
3
+ import { useMemo as j, useCallback as U } from "react";
4
+ import { Cells as W } from "./components/cells/index.js";
5
+ import { EmptyList as X } from "./components/empty-list/index.js";
6
+ import { TableError as Y } from "./components/error/index.js";
7
+ import { Loading as Z } from "./components/loading/index.js";
8
+ import { Pagination as $ } from "./components/pagination/index.js";
9
+ import { TableHeader as A } from "./components/table-header/index.js";
10
+ import { useTableData as aa } from "./hooks/use-table-data.js";
13
11
  import o from "./index.module.css.js";
14
- function ya({
15
- columns: m,
16
- searchPlaceholder: N = "Поиск по таблице",
17
- records: j,
18
- hideSearch: h,
19
- rightHeaderAddons: b,
12
+ import { getTags as ta } from "./utils/get-tags.js";
13
+ import { prepareRows as ra } from "./utils/prepare-rows.js";
14
+ function ha({
15
+ columns: l,
16
+ searchPlaceholder: E = "Поиск по таблице",
17
+ records: H,
18
+ hideSearch: b,
19
+ rightHeaderAddons: h,
20
20
  leftHeaderAddons: g,
21
- filtersButtonLabel: H,
22
- createButtonLabel: R,
23
- loading: S,
24
- height: _ = "fill",
21
+ filtersButtonLabel: S,
22
+ createButtonLabel: _,
23
+ loading: w,
24
+ height: B = "fill",
25
25
  view: e = "default",
26
- tagsBuilder: w,
26
+ tagsBuilder: F,
27
27
  promise: u,
28
- onRowClick: y,
29
- onCreateClick: c,
30
- onFiltersClick: l,
31
- refetch: B,
28
+ onRowClick: T,
29
+ onCreateClick: n,
30
+ onFiltersClick: m,
31
+ refetch: C,
32
32
  language: i,
33
- fromPath: F = !0
33
+ fromPath: M = !0
34
34
  }) {
35
35
  const {
36
- loading: M,
37
- error: C,
38
- data: T,
36
+ loading: R,
37
+ error: x,
38
+ data: y,
39
39
  total: V,
40
40
  params: t,
41
41
  pagesCount: q,
42
- updateData: n,
42
+ updateData: c,
43
43
  addParam: z,
44
44
  removeParam: G,
45
- resetParams: k
46
- } = oa({
45
+ resetParams: L
46
+ } = aa({
47
47
  promise: u,
48
- records: j,
49
- fromPath: F
50
- }), x = E(
51
- () => [...T || []].sort(
48
+ records: H,
49
+ fromPath: M
50
+ }), k = j(
51
+ () => [...y || []].sort(
52
52
  (a, s) => (a.sortPosition || 0) - (s.sortPosition || 0)
53
53
  ),
54
- [T]
55
- ), I = (a) => y?.(a, n), J = c ? () => c(n) : void 0, K = Y(
54
+ [y]
55
+ ), I = (a) => T?.(a, c), J = n ? () => n(c) : void 0, K = U(
56
56
  (a) => {
57
- k(a);
57
+ L(a);
58
58
  },
59
- [k]
60
- ), L = () => l ? l({
59
+ [L]
60
+ ), v = () => m ? m({
61
61
  submitCallback: (a) => K(a),
62
62
  initialValues: t
63
63
  }) : null, d = (a) => {
64
64
  z(a);
65
65
  }, O = (a, s) => {
66
66
  G(a, s);
67
- }, Q = ea({
67
+ }, Q = ta({
68
68
  params: t?.where || {},
69
69
  onDelete: O,
70
- tagsBuilder: w,
71
- onClick: L
72
- }), v = E(
73
- () => sa({
74
- columns: m,
70
+ tagsBuilder: F,
71
+ onClick: v
72
+ }), D = j(
73
+ () => ra({
74
+ columns: l,
75
75
  view: e,
76
- data: x,
77
- refetch: B || n
76
+ data: k,
77
+ refetch: C || c
78
78
  }),
79
79
  // eslint-disable-next-line react-hooks/exhaustive-deps
80
- [x, m, e]
81
- ), p = M || S, D = !!u;
82
- return /* @__PURE__ */ f("div", { className: P(o.table_wrapper, o[_], o[e]), children: [
83
- (!h || b || g || c || l) && /* @__PURE__ */ r(
84
- ra,
80
+ [k, l, e, c, C]
81
+ ), p = R || w, N = !!u;
82
+ return /* @__PURE__ */ f("div", { className: P(o.table_wrapper, o[B], o[e]), children: [
83
+ (!b || h || g || n || m) && /* @__PURE__ */ r(
84
+ A,
85
85
  {
86
86
  language: i,
87
- hideSearch: h,
88
- rightHeaderAddons: b,
87
+ hideSearch: b,
88
+ rightHeaderAddons: h,
89
89
  leftHeaderAddons: g,
90
90
  searchText: t?.searchText || "",
91
91
  addParam: d,
92
- searchPlaceholder: N,
93
- filtersButtonLabel: H,
92
+ searchPlaceholder: E,
93
+ filtersButtonLabel: S,
94
94
  tags: Q,
95
95
  onCreateClick: J,
96
- createButtonLabel: R,
97
- onFiltersClick: L,
98
- showFiltersButton: !!l,
96
+ createButtonLabel: _,
97
+ onFiltersClick: v,
98
+ showFiltersButton: !!m,
99
99
  compact: e === "compact"
100
100
  }
101
101
  ),
102
- /* @__PURE__ */ r("div", { className: P(o.table, { [o.no_footer]: !D }), children: /* @__PURE__ */ f("table", { cellSpacing: "0", cellPadding: "0", children: [
102
+ /* @__PURE__ */ r("div", { className: P(o.table, { [o.no_footer]: !N }), children: /* @__PURE__ */ f("table", { cellSpacing: "0", cellPadding: "0", children: [
103
103
  /* @__PURE__ */ r(
104
- Z,
104
+ W,
105
105
  {
106
106
  sort: t?.sort,
107
107
  order: t?.order,
108
108
  addParam: d,
109
- columns: m,
109
+ columns: l,
110
110
  compact: e === "compact"
111
111
  }
112
112
  ),
113
113
  /* @__PURE__ */ f("tbody", { children: [
114
- C && /* @__PURE__ */ r(A, { language: i }),
115
- !v.length && !p && !C && /* @__PURE__ */ r($, { language: i }),
116
- p && /* @__PURE__ */ r(aa, { columnsLength: m.length }),
117
- v.map(({ row: a, cells: s }) => /* @__PURE__ */ r(
114
+ x && /* @__PURE__ */ r(Y, { language: i }),
115
+ !D.length && !p && !x && /* @__PURE__ */ r(X, { language: i }),
116
+ p && /* @__PURE__ */ r(Z, { columnsLength: l.length }),
117
+ D.map(({ row: a, cells: s }) => /* @__PURE__ */ r(
118
118
  "tr",
119
119
  {
120
120
  onClick: () => I(a),
121
- className: P({ [o.clickable]: !!y }),
121
+ className: P({ [o.clickable]: !!T }),
122
122
  style: { visibility: p ? "collapse" : "visible" },
123
- children: s.map((U, W) => X.cloneElement(U, { key: W }))
123
+ children: s
124
124
  },
125
125
  String(a.id)
126
126
  ))
127
127
  ] })
128
128
  ] }) }),
129
- D && /* @__PURE__ */ r(
130
- ta,
129
+ N && /* @__PURE__ */ r(
130
+ $,
131
131
  {
132
132
  language: i,
133
133
  currentPage: t ? +t.page : 1,
@@ -140,5 +140,5 @@ function ya({
140
140
  ] });
141
141
  }
142
142
  export {
143
- ya as Table
143
+ ha as Table
144
144
  };
@@ -1,9 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
- export type TableComponentValue<T, D> = ((data: {
2
+ export type TableComponentValue<T, D> = (data: {
3
3
  row: T;
4
4
  refetch: () => void;
5
- }) => D);
6
- export type TableValue<T, D> = (keyof T) | TableComponentValue<T, D>;
5
+ }) => D;
6
+ export type TableValue<T, D> = keyof T | TableComponentValue<T, D>;
7
7
  type Accessor<T> = {
8
8
  accessor?: never;
9
9
  sort?: never;
@@ -1,13 +1,6 @@
1
1
  import { parseQueryParams as a } from "./parse-query-params.js";
2
2
  function n() {
3
- const {
4
- limit: i,
5
- page: s,
6
- searchText: t,
7
- sort: o,
8
- order: e,
9
- ...m
10
- } = a(), r = {
3
+ const { limit: i, page: s, searchText: t, sort: o, order: e, ...m } = a(), r = {
11
4
  where: m,
12
5
  limit: Number(i) || 10,
13
6
  page: Number(s) || 1
@@ -6,5 +6,5 @@ type Props = {
6
6
  tagsBuilder?: (props: FiltersMapper) => ReactElement | null;
7
7
  onClick: () => void;
8
8
  };
9
- export declare function getTags({ params, onClick, onDelete, tagsBuilder, }: Props): ReactElement<unknown, string | import('react').JSXElementConstructor<any>>[];
9
+ export declare function getTags({ params, onClick, onDelete, tagsBuilder }: Props): ReactElement<unknown, string | import('react').JSXElementConstructor<any>>[];
10
10
  export {};
@@ -1,15 +1,12 @@
1
- function i({
2
- params: e,
3
- onClick: r,
4
- onDelete: c,
5
- tagsBuilder: n
6
- }) {
7
- return n ? (e ? Object.entries(e).map(([t, f]) => n({
8
- paramName: t,
9
- paramValue: f,
10
- onDelete: c,
11
- onClick: r
12
- })) : []).filter((t) => t !== null) : [];
1
+ function i({ params: e, onClick: r, onDelete: c, tagsBuilder: n }) {
2
+ return n ? (e ? Object.entries(e).map(
3
+ ([t, f]) => n({
4
+ paramName: t,
5
+ paramValue: f,
6
+ onDelete: c,
7
+ onClick: r
8
+ })
9
+ ) : []).filter((t) => t !== null) : [];
13
10
  }
14
11
  export {
15
12
  i as getTags
@@ -4,5 +4,5 @@ export * from './get-tags';
4
4
  export * from './parse-query-params';
5
5
  export * from './remove-query-param';
6
6
  export * from './reset-query-param';
7
- export * from './set-query-to-url';
8
7
  export * from './serialize-data';
8
+ export * from './set-query-to-url';
@@ -4,8 +4,8 @@ import { getTags as p } from "./get-tags.js";
4
4
  import { parseQueryParams as x } from "./parse-query-params.js";
5
5
  import { removeQueryParam as u } from "./remove-query-param.js";
6
6
  import { resetQueryParam as Q } from "./reset-query-param.js";
7
- import { setQueryToUrl as g } from "./set-query-to-url.js";
8
- import { serializeData as d } from "./serialize-data.js";
7
+ import { serializeData as g } from "./serialize-data.js";
8
+ import { setQueryToUrl as d } from "./set-query-to-url.js";
9
9
  export {
10
10
  o as addQueryParam,
11
11
  m as getQueryFromUrl,
@@ -13,6 +13,6 @@ export {
13
13
  x as parseQueryParams,
14
14
  u as removeQueryParam,
15
15
  Q as resetQueryParam,
16
- d as serializeData,
17
- g as setQueryToUrl
16
+ g as serializeData,
17
+ d as setQueryToUrl
18
18
  };
@@ -1,6 +1,10 @@
1
1
  import { parse as r } from "query-string";
2
2
  function e() {
3
- return r(window.location.search, { arrayFormat: "comma", parseBooleans: !0, parseNumbers: !0 });
3
+ return r(window.location.search, {
4
+ arrayFormat: "comma",
5
+ parseBooleans: !0,
6
+ parseNumbers: !0
7
+ });
4
8
  }
5
9
  export {
6
10
  e as parseQueryParams
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { TableProps } from '../table';
3
2
  type Props<T extends object> = {
4
3
  columns: TableProps<T>['columns'];
@@ -8,6 +7,6 @@ type Props<T extends object> = {
8
7
  };
9
8
  export declare function prepareRows<T extends object>({ columns, view, data, refetch, }: Props<T>): {
10
9
  row: T;
11
- cells: React.JSX.Element[];
10
+ cells: import("react/jsx-runtime").JSX.Element[];
12
11
  }[];
13
12
  export {};
@@ -8,7 +8,7 @@ function p(t, i, r) {
8
8
  function c(t, i, r) {
9
9
  return t ? typeof t == "string" ? i[t] : typeof t == "function" ? t({ row: i, refetch: r }) : null : null;
10
10
  }
11
- function w({
11
+ function v({
12
12
  columns: t,
13
13
  view: i = "default",
14
14
  data: r,
@@ -61,11 +61,12 @@ function w({
61
61
  compact: l,
62
62
  subtitle: l ? void 0 : e.row?.subtitle && c(e.row?.subtitle, n, s),
63
63
  addon: m
64
- }
64
+ },
65
+ String(e.accessor)
65
66
  );
66
67
  })
67
68
  }));
68
69
  }
69
70
  export {
70
- w as prepareRows
71
+ v as prepareRows
71
72
  };
@@ -1 +1 @@
1
- export declare function queryAdapter(params: any, adapter: 'dev' | 'prod'): {};
1
+ export declare function queryAdapter(params: any, adapter: 'dev' | 'prod'): Record<string, unknown>;
@@ -14,11 +14,11 @@ const p = {
14
14
  searchText: "searchText"
15
15
  }
16
16
  };
17
- function s(e, t) {
18
- return Object.entries(e).reduce((a, [r, o]) => ({
19
- [p[t][r] || r]: o,
20
- ...a
21
- }), {});
17
+ function s(t, o) {
18
+ return Object.entries(t).reduce((e, [r, a]) => {
19
+ const i = p[o][r] || r;
20
+ return e[i] = a, e;
21
+ }, {});
22
22
  }
23
23
  export {
24
24
  s as queryAdapter
@@ -3,7 +3,9 @@ import { parseQueryParams as i } from "./parse-query-params.js";
3
3
  import { setQueryToUrl as f } from "./set-query-to-url.js";
4
4
  function c(o, e) {
5
5
  const r = i();
6
- Array.isArray(r[o]) && e ? r[o] = r[o].filter((t) => t !== e) : delete r[o], f(s(r, { arrayFormat: "comma" }));
6
+ Array.isArray(r[o]) && e ? r[o] = r[o].filter(
7
+ (t) => t !== e
8
+ ) : delete r[o], f(s(r, { arrayFormat: "comma" }));
7
9
  }
8
10
  export {
9
11
  c as removeQueryParam
@@ -2,15 +2,22 @@ import { stringify as s } from "query-string";
2
2
  import { parseQueryParams as i } from "./parse-query-params.js";
3
3
  import { setQueryToUrl as c } from "./set-query-to-url.js";
4
4
  function y(r) {
5
- const e = Object.fromEntries(Object.entries(r).filter((a) => a[1] !== "")), { searchText: t, order: o, sort: m } = i();
6
- c(s({
7
- limit: 10,
8
- page: 1,
9
- searchText: t,
10
- order: o,
11
- sort: m,
12
- ...e
13
- }, { arrayFormat: "comma" }));
5
+ const e = Object.fromEntries(
6
+ Object.entries(r).filter((a) => a[1] !== "")
7
+ ), { searchText: t, order: o, sort: m } = i();
8
+ c(
9
+ s(
10
+ {
11
+ limit: 10,
12
+ page: 1,
13
+ searchText: t,
14
+ order: o,
15
+ sort: m,
16
+ ...e
17
+ },
18
+ { arrayFormat: "comma" }
19
+ )
20
+ );
14
21
  }
15
22
  export {
16
23
  y as resetQueryParam
@@ -6,7 +6,11 @@ import p from "@alphakits/icons/dist/ClockCircleM";
6
6
  import l from "classnames";
7
7
  import { Typography as f } from "../typography/component.js";
8
8
  import e from "./index.module.css.js";
9
- const u = ({ text: i, view: o = "secondary", className: c }) => {
9
+ const u = ({
10
+ text: i,
11
+ view: o = "secondary",
12
+ className: c
13
+ }) => {
10
14
  const m = {
11
15
  negative: /* @__PURE__ */ r(t, {}),
12
16
  positive: /* @__PURE__ */ r(n, {}),
@@ -1,15 +1,15 @@
1
1
  import { jsxs as z, jsx as m } from "react/jsx-runtime";
2
- import H, { useRef as ee, useState as C, useEffect as te, useCallback as d } from "react";
2
+ import d from "classnames";
3
+ import H, { useRef as ee, useState as C, useEffect as te, useCallback as p } from "react";
3
4
  import re from "react-merge-refs";
4
5
  import se from "react-textarea-autosize";
5
- import p from "classnames";
6
6
  import { FormControl as ae } from "../form-control/component.js";
7
7
  import { useFocus as oe } from "../hooks/useFocus/index.js";
8
8
  import t from "./index.module.css.js";
9
9
  const pe = H.forwardRef(
10
10
  ({
11
11
  autoComplete: F = "on",
12
- autosize: a = !0,
12
+ autosize: s = !0,
13
13
  size: x = "s",
14
14
  block: S = !1,
15
15
  bottomAddons: $,
@@ -22,45 +22,45 @@ const pe = H.forwardRef(
22
22
  textareaClassName: w,
23
23
  label: R,
24
24
  leftAddons: B,
25
- onFocus: c,
25
+ onFocus: f,
26
26
  required: E,
27
- onBlur: f,
27
+ onBlur: c,
28
28
  onChange: n,
29
29
  onHeightChange: M,
30
30
  rightAddons: P,
31
31
  maxRows: q,
32
32
  minRows: D,
33
- maxHeight: o,
33
+ maxHeight: a,
34
34
  resize: G = "none",
35
- value: l,
35
+ value: o,
36
36
  defaultValue: I,
37
37
  maxLength: i = 500,
38
38
  counter: J,
39
- rows: K = a ? 1 : 3,
39
+ rows: K = s ? 1 : 3,
40
40
  ...O
41
41
  }, Q) => {
42
- const s = l === void 0, r = ee(null), [T, V] = C(!1), [u, U] = C(I || ""), [W] = oe(r, "keyboard"), b = !!(s ? u : l);
42
+ const r = o === void 0, l = ee(null), [T, V] = C(!1), [u, U] = C(I || ""), [W] = oe(l, "keyboard"), b = !!(r ? u : o);
43
43
  te(() => {
44
- a && o && r.current && r.current.style && (r.current.style.maxHeight = `${o}px`);
45
- }, [r, a, o]);
46
- const X = d(
44
+ s && a && l.current?.style && (l.current.style.maxHeight = `${a}px`);
45
+ }, [s, a]);
46
+ const X = p(
47
47
  (e) => {
48
- V(!0), c && c(e);
48
+ V(!0), f && f(e);
49
49
  },
50
- [c]
51
- ), Y = d(
50
+ [f]
51
+ ), Y = p(
52
52
  (e) => {
53
- V(!1), f && f(e);
53
+ V(!1), c && c(e);
54
54
  },
55
- [f]
56
- ), Z = d(
55
+ [c]
56
+ ), Z = p(
57
57
  (e) => {
58
- n && n(e, { value: e.target.value }), s && U(e.target.value);
58
+ n && n(e, { value: e.target.value }), r && U(e.target.value);
59
59
  },
60
- [n, s]
60
+ [n, r]
61
61
  ), _ = {
62
62
  ...O,
63
- className: p(
63
+ className: d(
64
64
  t.textarea,
65
65
  t[x],
66
66
  {
@@ -75,16 +75,16 @@ const pe = H.forwardRef(
75
75
  onBlur: Y,
76
76
  onFocus: X,
77
77
  onChange: Z,
78
- value: s ? u : l,
78
+ value: r ? u : o,
79
79
  rows: K,
80
- ref: re([Q, r]),
80
+ ref: re([Q, l]),
81
81
  "data-test-id": k
82
- }, L = () => `${s ? u.length : l?.length} / ${i || "-"}`, { ref: h, ...N } = _;
82
+ }, L = () => `${r ? u.length : o?.length} / ${i || "-"}`, { ref: h, ...N } = _;
83
83
  return /* @__PURE__ */ z(
84
84
  ae,
85
85
  {
86
- className: p(j),
87
- fieldClassName: p(g, {
86
+ className: d(j),
87
+ fieldClassName: d(g, {
88
88
  [t.focusVisible]: W
89
89
  }),
90
90
  size: x,
@@ -100,7 +100,7 @@ const pe = H.forwardRef(
100
100
  rightAddons: P,
101
101
  bottomAddons: $,
102
102
  children: [
103
- a ? /* @__PURE__ */ m(
103
+ s ? /* @__PURE__ */ m(
104
104
  se,
105
105
  {
106
106
  ...N,
@@ -110,7 +110,15 @@ const pe = H.forwardRef(
110
110
  onHeightChange: M,
111
111
  ref: h
112
112
  }
113
- ) : /* @__PURE__ */ m("textarea", { maxLength: i, ...N, ref: h, style: { maxHeight: o } }),
113
+ ) : /* @__PURE__ */ m(
114
+ "textarea",
115
+ {
116
+ maxLength: i,
117
+ ...N,
118
+ ref: h,
119
+ style: { maxHeight: a }
120
+ }
121
+ ),
114
122
  J && /* @__PURE__ */ m("span", { className: t.counter, children: L() })
115
123
  ]
116
124
  }
@@ -1,41 +1,45 @@
1
1
  import { jsx as g } from "react/jsx-runtime";
2
- import { createContext as x, useState as y, useEffect as C, useContext as _ } from "react";
3
- var k = /* @__PURE__ */ ((t) => (t.DARK = "dark", t.LIGHT = "light", t))(k || {});
4
- const i = x({
2
+ import { createContext as k, useState as x, useCallback as u, useEffect as y, useContext as _ } from "react";
3
+ var b = /* @__PURE__ */ ((t) => (t.DARK = "dark", t.LIGHT = "light", t))(b || {});
4
+ const f = k({
5
5
  setTheme: () => {
6
6
  },
7
7
  currentTheme: void 0
8
- }), l = "theme", u = "theme-styles", v = "data-theme", I = ({ children: t, themes: c, selectedTheme: r }) => {
9
- const [E, f] = y(), s = (e) => {
10
- document?.documentElement.setAttribute(v, e), localStorage.setItem(l, e), f(e);
11
- }, A = (e) => {
12
- let o = document.getElementById(u), n = "";
13
- o || (o = document.createElement("style"), o.id = u, document.head.appendChild(o)), Object.keys(e).forEach((m) => {
14
- n += `html[data-theme='${m}'] {`;
15
- const a = e[m];
16
- Object.keys(a).forEach((h) => {
17
- const d = a[h];
18
- Object.keys(d).forEach((T) => {
19
- n += `--color-${h}-${T}: ${d[T]};
8
+ }), i = "theme", E = "theme-styles", v = "data-theme", S = ({
9
+ children: t,
10
+ themes: c,
11
+ selectedTheme: r
12
+ }) => {
13
+ const [A, C] = x(), n = u((e) => {
14
+ document?.documentElement.setAttribute(v, e), localStorage.setItem(i, e), C(e);
15
+ }, []), m = u((e) => {
16
+ let o = document.getElementById(E), s = "";
17
+ o || (o = document.createElement("style"), o.id = E, document.head.appendChild(o)), Object.keys(e).forEach((a) => {
18
+ s += `html[data-theme='${a}'] {`;
19
+ const h = e[a];
20
+ Object.keys(h).forEach((T) => {
21
+ const l = h[T];
22
+ Object.keys(l).forEach((d) => {
23
+ s += `--color-${T}-${d}: ${l[d]};
20
24
  `;
21
25
  });
22
- }), n += `}
23
- `, o.textContent = n;
26
+ }), s += `}
27
+ `, o.textContent = s;
24
28
  });
25
- };
26
- return C(() => {
27
- const e = localStorage?.getItem(l), o = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
28
- s(r || e || o), A(c);
29
- }, [c, r]), /* @__PURE__ */ g(i.Provider, { value: { setTheme: s, currentTheme: E }, children: t });
30
- }, O = () => {
31
- const { setTheme: t, currentTheme: c } = _(i);
29
+ }, []);
30
+ return y(() => {
31
+ const e = localStorage?.getItem(i), o = window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
32
+ n(r || e || o), m(c);
33
+ }, [c, r, n, m]), /* @__PURE__ */ g(f.Provider, { value: { setTheme: n, currentTheme: A }, children: t });
34
+ }, j = () => {
35
+ const { setTheme: t, currentTheme: c } = _(f);
32
36
  return { setTheme: t, currentTheme: c };
33
37
  };
34
38
  export {
35
- l as LOACAL_STORAGE_THEME_KEY,
36
- u as STYLE_TAG_ID,
37
- k as THEME,
39
+ i as LOACAL_STORAGE_THEME_KEY,
40
+ E as STYLE_TAG_ID,
41
+ b as THEME,
38
42
  v as THEME_DATA_ATTR,
39
- I as ThemeProvider,
40
- O as useTheme
43
+ S as ThemeProvider,
44
+ j as useTheme
41
45
  };