@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,6 +1,5 @@
1
- import { default as React } from 'react';
2
1
  import { FormikProps, FormikValues } from 'formik';
3
2
  import { Props } from '.';
4
3
  type FormProps<T extends FormikValues> = Props<T> & FormikProps<T>;
5
- export declare function Form<T extends FormikValues>({ recordId, title, subtitle, headerBottomAddons, initialValues, submitButtonText, customFooter, loading, updating, removing, customValidationFields, validate, save, remove, close, back, t, children, headerAddon, error, softError, ...formProps }: FormProps<T>): React.JSX.Element;
4
+ export declare function Form<T extends FormikValues>({ recordId, title, subtitle, headerBottomAddons, initialValues, submitButtonText, customFooter, loading, updating, removing, customValidationFields, validate, save, remove, close, back, t, children, headerAddon, error, softError, ...formProps }: FormProps<T>): import("react/jsx-runtime").JSX.Element;
6
5
  export {};
@@ -1,57 +1,52 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
- import A, { useContext as V, useState as D, useCallback as v, useEffect as H } from "react";
3
- import q from "@alphakits/icons/dist/TrashM";
4
- import { Button as C } from "../../../button/component.js";
1
+ import { jsxs as f, jsx as t } from "react/jsx-runtime";
2
+ import A from "@alphakits/icons/dist/TrashM";
3
+ import V, { useContext as D, useState as H, useCallback as v, useEffect as q } from "react";
4
+ import { Button as k } from "../../../button/component.js";
5
5
  import { Flex as G } from "../../../flex/component.js";
6
6
  import { FlexColumns as J } from "../../../flex-columns/component.js";
7
7
  import { IconButton as K } from "../../../icon-button/component.js";
8
8
  import { ModalContext as L } from "../../../modal/context.js";
9
9
  import { Sidepanel as N } from "../../../sidepanel/component.js";
10
- import { ToastPlate as k } from "../../../toast-plate/component.js";
10
+ import { ToastPlate as x } from "../../../toast-plate/component.js";
11
11
  function ie({
12
- recordId: x,
13
- title: y,
14
- subtitle: F,
15
- headerBottomAddons: f,
16
- initialValues: I,
17
- submitButtonText: T,
18
- customFooter: w,
19
- loading: r,
12
+ recordId: F,
13
+ title: I,
14
+ subtitle: T,
15
+ headerBottomAddons: u,
16
+ initialValues: w,
17
+ submitButtonText: y,
18
+ customFooter: M,
19
+ loading: i,
20
20
  updating: n,
21
21
  removing: s,
22
22
  customValidationFields: O,
23
23
  validate: Q,
24
24
  save: U,
25
- remove: u,
26
- close: M,
27
- back: R,
28
- t: i,
29
- children: S,
25
+ remove: a,
26
+ close: R,
27
+ back: S,
28
+ t: r,
29
+ children: B,
30
30
  headerAddon: b,
31
31
  error: W,
32
32
  softError: d,
33
- ...B
33
+ ...z
34
34
  }) {
35
- const { setModalDirty: a, currentModalId: z } = V(L), [e] = D(z), {
36
- submitCount: l,
37
- handleSubmit: P,
38
- isValid: m,
39
- ...o
40
- } = B, h = !!x && !!u, p = v(
35
+ const { setModalDirty: e, currentModalId: P } = D(L), [o] = H(P), { submitCount: l, handleSubmit: h, isValid: m, ...c } = z, p = !!F && !!a, C = v(
41
36
  () => {
42
- a(e, !1), P();
37
+ e(o, !1), h();
43
38
  },
44
39
  // eslint-disable-next-line react-hooks/exhaustive-deps
45
- [o.dirty, e]
40
+ [o, e, h]
46
41
  ), g = v(() => {
47
- a(e, !1), confirm(i("common:deleteConfirm")) && u?.();
48
- }, [o.dirty, e]);
49
- H(() => {
50
- r || a(e, o.dirty);
51
- }, [o.dirty, r, e]);
52
- const j = h || b ? /* @__PURE__ */ c(A.Fragment, { children: [
42
+ e(o, !1), confirm(r("common:deleteConfirm")) && a?.();
43
+ }, [o, r, e, a]);
44
+ q(() => {
45
+ i || e(o, c.dirty);
46
+ }, [c.dirty, i, o, e]);
47
+ const j = p || b ? /* @__PURE__ */ f(V.Fragment, { children: [
53
48
  b,
54
- h && /* @__PURE__ */ t(
49
+ p && /* @__PURE__ */ t(
55
50
  K,
56
51
  {
57
52
  dataTestId: "removeTariffBtn",
@@ -59,7 +54,7 @@ function ie({
59
54
  disabled: n,
60
55
  loading: s,
61
56
  onClick: g,
62
- icon: q
57
+ icon: A
63
58
  }
64
59
  )
65
60
  ] }) : null;
@@ -67,48 +62,48 @@ function ie({
67
62
  N,
68
63
  {
69
64
  headerRightAddons: j,
70
- title: y,
71
- subtitle: F,
72
- loading: n || s || r,
73
- headerBottomAddons: (f || !!d || !m && !!l) && /* @__PURE__ */ c(J, { columns: 1, gr: 8, children: [
74
- f,
75
- !!d && /* @__PURE__ */ t(k, { view: "negative", children: d }),
76
- !m && !!l && /* @__PURE__ */ t(k, { view: "negative", children: "Please correct errors before submitting form." })
65
+ title: I,
66
+ subtitle: T,
67
+ loading: n || s || i,
68
+ headerBottomAddons: (u || !!d || !m && !!l) && /* @__PURE__ */ f(J, { columns: 1, gr: 8, children: [
69
+ u,
70
+ !!d && /* @__PURE__ */ t(x, { view: "negative", children: d }),
71
+ !m && !!l && /* @__PURE__ */ t(x, { view: "negative", children: "Please correct errors before submitting form." })
77
72
  ] }),
78
- back: R,
79
- t: i,
80
- bottomAddons: w || /* @__PURE__ */ c(G, { gap: "md", children: [
73
+ back: S,
74
+ t: r,
75
+ bottomAddons: M || /* @__PURE__ */ f(G, { gap: "md", children: [
81
76
  /* @__PURE__ */ t(
82
- C,
77
+ k,
83
78
  {
84
79
  view: "primary",
85
80
  size: "s",
86
81
  block: !0,
87
- loading: r,
82
+ loading: i,
88
83
  disabled: n || s,
89
84
  dataTestId: "buttonSave",
90
- onClick: () => p(),
91
- children: i(T || "save")
85
+ onClick: () => C(),
86
+ children: r(y || "save")
92
87
  }
93
88
  ),
94
89
  /* @__PURE__ */ t(
95
- C,
90
+ k,
96
91
  {
97
92
  block: !0,
98
93
  view: "secondary",
99
94
  size: "s",
100
95
  dataTestId: "buttonCancel",
101
- onClick: M,
102
- children: i("cancel")
96
+ onClick: R,
97
+ children: r("cancel")
103
98
  }
104
99
  )
105
100
  ] }),
106
- children: S({
101
+ children: B({
107
102
  submitCount: l,
108
103
  isValid: m,
109
- handleSubmit: p,
110
- initialValues: I,
111
- ...o
104
+ handleSubmit: C,
105
+ initialValues: w,
106
+ ...c
112
107
  })
113
108
  }
114
109
  );
@@ -1,5 +1,5 @@
1
- import { default as React } from 'react';
2
1
  import { FormikErrors, FormikProps, FormikValues } from 'formik';
2
+ import { default as React } from 'react';
3
3
  import { TFunction } from '../../../modal';
4
4
  export type Props<T extends FormikValues> = {
5
5
  recordId?: number;
@@ -9,7 +9,7 @@ export type Props<T extends FormikValues> = {
9
9
  enableReinitialize?: boolean;
10
10
  headerBottomAddons?: React.ReactNode;
11
11
  initialValues: T;
12
- validate?: (values: T) => void | Record<string, unknown> | Promise<FormikErrors<T>>;
12
+ validate?: (values: T) => undefined | Record<string, unknown> | Promise<FormikErrors<T>>;
13
13
  customValidationFields?: Array<keyof T>;
14
14
  save: (values: any) => any;
15
15
  back?: () => void;
@@ -25,4 +25,4 @@ export type Props<T extends FormikValues> = {
25
25
  t: TFunction;
26
26
  headerAddon?: React.ReactNode;
27
27
  };
28
- export declare function RestForm<T extends FormikValues>({ enableReinitialize, ...props }: Props<T>): React.JSX.Element;
28
+ export declare function RestForm<T extends FormikValues>({ enableReinitialize, ...props }: Props<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,41 +1,30 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { Formik as v } from "formik";
3
3
  import { Form as V } from "./form.js";
4
- function g({ enableReinitialize: a = !0, ...t }) {
5
- const {
6
- loading: d,
7
- error: u,
8
- validate: l,
9
- customValidationFields: s,
10
- initialValues: c,
11
- save: m
12
- } = t;
4
+ function b({
5
+ enableReinitialize: a = !0,
6
+ ...e
7
+ }) {
8
+ const { loading: d, error: u, validate: l, customValidationFields: m, initialValues: s, save: f } = e;
13
9
  if (u) return /* @__PURE__ */ o("div", { children: "Error " });
14
- const f = (r) => (e) => r.reduce((i, n) => ((typeof e == "object" ? e : {})[n] || (i[n] = t.t("validationErrors:Required")), i), {});
10
+ const c = (r) => (t) => r.reduce(
11
+ (i, n) => ((typeof t == "object" ? t : {})[n] || (i[n] = e.t("validationErrors:Required")), i),
12
+ {}
13
+ );
15
14
  return /* @__PURE__ */ o(
16
15
  v,
17
16
  {
18
- validate: ((r, e) => {
17
+ validate: ((r, t) => {
19
18
  if (r) return r;
20
- if (e) return f(e);
21
- })(l, s),
22
- initialValues: c,
19
+ if (t) return c(t);
20
+ })(l, m),
21
+ initialValues: s,
23
22
  enableReinitialize: a,
24
- onSubmit: m,
25
- children: (r) => (process.env.REACT_APP_STAGE !== "prod" && console.debug({
26
- values: r.values,
27
- errors: r.errors
28
- }), /* @__PURE__ */ o(
29
- V,
30
- {
31
- loading: d,
32
- ...r,
33
- ...t
34
- }
35
- ))
23
+ onSubmit: f,
24
+ children: (r) => (process.env.REACT_APP_STAGE, /* @__PURE__ */ o(V, { loading: d, ...r, ...e }))
36
25
  }
37
26
  );
38
27
  }
39
28
  export {
40
- g as RestForm
29
+ b as RestForm
41
30
  };
@@ -1,9 +1,6 @@
1
- function c(t, u) {
2
- return Object.entries(u).reduce((n, [e, r]) => ({
3
- [e]: t[e] || r,
4
- ...n
5
- }), {});
1
+ function f(r, u) {
2
+ return Object.entries(u).reduce((e, [t, n]) => (e[t] = r[t] || n, e), {});
6
3
  }
7
4
  export {
8
- c as getDefaultValues
5
+ f as getDefaultValues
9
6
  };
@@ -1,7 +1,5 @@
1
1
  function t(e) {
2
- return Object.fromEntries(
3
- Object.entries(e).filter(([, r]) => r !== void 0)
4
- );
2
+ return Object.fromEntries(Object.entries(e).filter(([, r]) => r !== void 0));
5
3
  }
6
4
  export {
7
5
  t as removeUndefinedFromObject
@@ -1,6 +1,6 @@
1
1
  import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
- import k from "react";
3
2
  import e from "classnames";
3
+ import k from "react";
4
4
  import s from "./index.module.css.js";
5
5
  const M = k.forwardRef(
6
6
  ({
@@ -1,2 +1,2 @@
1
- export { Formik, Form, Field, FieldArray, FastField, ErrorMessage, useFormik, useFormikContext, useField, connect, withFormik, } from 'formik';
2
- export type { FormikProps, FormikValues, FormikErrors, FormikTouched, FieldProps, FieldArrayRenderProps, FormikConfig, } from 'formik';
1
+ export type { FieldArrayRenderProps, FieldProps, FormikConfig, FormikErrors, FormikProps, FormikTouched, FormikValues, } from 'formik';
2
+ export { connect, ErrorMessage, FastField, Field, FieldArray, Form, Formik, useField, useFormik, useFormikContext, withFormik, } from 'formik';
@@ -3,12 +3,7 @@ import a from "@alphakits/icons/dist/CloseS";
3
3
  import p from "@alphakits/icons/dist/SearchM";
4
4
  import { Button as l } from "../button/component.js";
5
5
  import o from "./index.module.css.js";
6
- const g = ({
7
- value: e,
8
- placeholder: r,
9
- onChange: n,
10
- onClear: m
11
- }) => /* @__PURE__ */ i("div", { className: o.input, children: [
6
+ const g = ({ value: e, placeholder: r, onChange: n, onClear: m }) => /* @__PURE__ */ i("div", { className: o.input, children: [
12
7
  /* @__PURE__ */ t(p, {}),
13
8
  /* @__PURE__ */ t(
14
9
  "input",
@@ -1,5 +1,5 @@
1
+ export * from './use-crud-form-requests';
2
+ export * from './use-get-one';
1
3
  export * from './useClickOutside';
2
4
  export * from './useFocus';
3
5
  export * from './usePrevious';
4
- export * from './use-crud-form-requests';
5
- export * from './use-get-one';
@@ -1,12 +1,12 @@
1
- import { useClickOutside as r } from "./useClickOutside/index.js";
2
- import { useFocus as u } from "./useFocus/index.js";
3
- import { usePrevious as m } from "./usePrevious/index.js";
4
- import { useCrudFormRequests as p } from "./use-crud-form-requests/index.js";
5
- import { useGetOne as i } from "./use-get-one/index.js";
1
+ import { useCrudFormRequests as r } from "./use-crud-form-requests/index.js";
2
+ import { useGetOne as u } from "./use-get-one/index.js";
3
+ import { useClickOutside as m } from "./useClickOutside/index.js";
4
+ import { useFocus as p } from "./useFocus/index.js";
5
+ import { usePrevious as i } from "./usePrevious/index.js";
6
6
  export {
7
- r as useClickOutside,
8
- p as useCrudFormRequests,
9
- u as useFocus,
10
- i as useGetOne,
11
- m as usePrevious
7
+ m as useClickOutside,
8
+ r as useCrudFormRequests,
9
+ p as useFocus,
10
+ u as useGetOne,
11
+ i as usePrevious
12
12
  };
@@ -1,24 +1,24 @@
1
- import { useState as t, useEffect as i } from "react";
2
- import { getServiceError as m } from "../../utils/get-service-error/index.js";
3
- const p = (e, c) => {
4
- const [a, o] = t(!!e), [l, u] = t({}), [f, s] = t(null), n = async () => {
5
- o(!0), s(null);
1
+ import { useState as o, useCallback as g, useEffect as m } from "react";
2
+ import { getServiceError as i } from "../../utils/get-service-error/index.js";
3
+ const p = (e, s) => {
4
+ const [n, a] = o(!!e), [l, u] = o({}), [f, c] = o(null), r = g(async () => {
5
+ a(!0), c(null);
6
6
  try {
7
- const { data: r } = await c(e);
8
- u(r);
9
- } catch (r) {
10
- s(m(r).message);
7
+ const { data: t } = await s(e);
8
+ u(t);
9
+ } catch (t) {
10
+ c(i(t).message);
11
11
  } finally {
12
- o(!1);
12
+ a(!1);
13
13
  }
14
- };
15
- return i(() => {
16
- e && n();
17
- }, []), {
14
+ }, [e, s]);
15
+ return m(() => {
16
+ e && r();
17
+ }, [r, e]), {
18
18
  record: l,
19
- loading: a,
19
+ loading: n,
20
20
  error: f,
21
- request: n
21
+ request: r
22
22
  };
23
23
  };
24
24
  export {
@@ -1,4 +1,4 @@
1
- import { default as React, ButtonHTMLAttributes } from 'react';
1
+ import { ButtonHTMLAttributes } from 'react';
2
2
  export type IconButtonProps = {
3
3
  icon: any;
4
4
  view?: 'secondary' | 'ghost';
@@ -7,11 +7,11 @@ export type IconButtonProps = {
7
7
  dataTestId?: string;
8
8
  loading?: boolean;
9
9
  } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'size'>;
10
- export declare const IconButton: React.ForwardRefExoticComponent<{
10
+ export declare const IconButton: import('react').ForwardRefExoticComponent<{
11
11
  icon: any;
12
12
  view?: "secondary" | "ghost" | undefined;
13
13
  size?: "s" | "m" | "l" | undefined;
14
14
  className?: string | undefined;
15
15
  dataTestId?: string | undefined;
16
16
  loading?: boolean | undefined;
17
- } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size"> & React.RefAttributes<HTMLButtonElement>>;
17
+ } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,16 +1,10 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as l } from "react";
3
2
  import t from "classnames";
3
+ import { forwardRef as l } from "react";
4
4
  import { Button as f } from "../button/component.js";
5
5
  import o from "./index.module.css.js";
6
6
  const b = l(
7
- ({
8
- className: i,
9
- icon: n,
10
- view: e = "ghost",
11
- size: m = "s",
12
- ...r
13
- }, a) => {
7
+ ({ className: i, icon: n, view: e = "ghost", size: m = "s", ...r }, a) => {
14
8
  const { disabled: c, loading: d } = r;
15
9
  return /* @__PURE__ */ s(
16
10
  f,
@@ -1,49 +1,71 @@
1
- import { jsxs as n, jsx as i } from "react/jsx-runtime";
1
+ import { jsxs as s, jsx as i } from "react/jsx-runtime";
2
2
  import o from "classnames";
3
3
  import { Skeleton as x } from "../skeleton/component.js";
4
4
  import { Typography as y } from "../typography/component.js";
5
- import { useImageRenderComponent as b } from "./use-image-render-component.js";
6
5
  import e from "./index.module.css.js";
6
+ import { useImageRenderComponent as b } from "./use-image-render-component.js";
7
7
  const k = ({
8
- className: m,
9
- src: t,
8
+ className: t,
9
+ src: m,
10
10
  alt: a,
11
11
  hint: c,
12
- addon: l,
12
+ addon: r,
13
13
  border: d,
14
- size: r = "m",
14
+ size: l = "m",
15
15
  color: p,
16
16
  children: h,
17
17
  loading: f,
18
- view: s = "default",
19
- text: N,
20
- icon: g,
21
- bgColor: u = "secondary"
18
+ view: n = "default",
19
+ text: u,
20
+ icon: N,
21
+ bgColor: g = "secondary"
22
22
  }) => {
23
23
  const v = b({
24
- size: r,
25
- src: t,
24
+ size: l,
25
+ src: m,
26
26
  color: p,
27
27
  alt: a,
28
- text: N,
29
- icon: g
28
+ text: u,
29
+ icon: N
30
30
  });
31
- return /* @__PURE__ */ n("div", { className: o(e.container, m, e[r]), children: [
32
- /* @__PURE__ */ i("div", { className: o(e.component, e[s], e[u], { [e.border]: d }), children: /* @__PURE__ */ n(x, { className: e[r], visible: f, children: [
33
- s === "ellipse" && /* @__PURE__ */ i("svg", { className: e.defs, children: /* @__PURE__ */ i("defs", { children: /* @__PURE__ */ i("clipPath", { id: "squircle", clipPathUnits: "objectBoundingBox", children: /* @__PURE__ */ i("path", { d: "M .5 0 C .1 0 0 .1 0 .5 0 .9 .1 1 .5 1 .9 1 1 .9 1 .5 1 .1 .9 0 .5 0 Z", fill: "#f00" }) }) }) }),
34
- v,
35
- h,
36
- !!c && /* @__PURE__ */ i("div", { className: e.hint, children: /* @__PURE__ */ i(
37
- y.Text,
38
- {
39
- className: e.hint_text,
40
- view: "caps",
41
- weight: "medium",
42
- children: c
43
- }
44
- ) })
45
- ] }) }),
46
- l && /* @__PURE__ */ i("div", { className: o(e[`addon-${l.color}`], e.addon, { [e.filled]: l.filled }), children: l.icon })
31
+ return /* @__PURE__ */ s("div", { className: o(e.container, t, e[l]), children: [
32
+ /* @__PURE__ */ i(
33
+ "div",
34
+ {
35
+ className: o(e.component, e[n], e[g], {
36
+ [e.border]: d
37
+ }),
38
+ children: /* @__PURE__ */ s(x, { className: e[l], visible: f, children: [
39
+ n === "ellipse" && /* @__PURE__ */ i("svg", { className: e.defs, "aria-hidden": "true", children: /* @__PURE__ */ i("defs", { children: /* @__PURE__ */ i("clipPath", { id: "squircle", clipPathUnits: "objectBoundingBox", children: /* @__PURE__ */ i(
40
+ "path",
41
+ {
42
+ d: "M .5 0 C .1 0 0 .1 0 .5 0 .9 .1 1 .5 1 .9 1 1 .9 1 .5 1 .1 .9 0 .5 0 Z",
43
+ fill: "#f00"
44
+ }
45
+ ) }) }) }),
46
+ v,
47
+ h,
48
+ !!c && /* @__PURE__ */ i("div", { className: e.hint, children: /* @__PURE__ */ i(
49
+ y.Text,
50
+ {
51
+ className: e.hint_text,
52
+ view: "caps",
53
+ weight: "medium",
54
+ children: c
55
+ }
56
+ ) })
57
+ ] })
58
+ }
59
+ ),
60
+ r && /* @__PURE__ */ i(
61
+ "div",
62
+ {
63
+ className: o(e[`addon-${r.color}`], e.addon, {
64
+ [e.filled]: r.filled
65
+ }),
66
+ children: r.icon
67
+ }
68
+ )
47
69
  ] });
48
70
  };
49
71
  export {
@@ -1,13 +1,7 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
2
  import a from "react";
3
3
  import { useImageRenderComponent as c } from "./use-image-render-component.js";
4
- const u = ({
5
- src: r,
6
- alt: o,
7
- size: m = "m",
8
- text: n,
9
- icon: t
10
- }) => {
4
+ const u = ({ src: r, alt: o, size: m = "m", text: n, icon: t }) => {
11
5
  const e = c({
12
6
  size: m,
13
7
  src: r,
@@ -8,4 +8,4 @@ export type UseImageRenderComponent = {
8
8
  icon?: React.ReactNode;
9
9
  color?: ImageProps['color'];
10
10
  };
11
- export declare const useImageRenderComponent: ({ src, size, color, alt, text, icon, }: UseImageRenderComponent) => string | number | bigint | true | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element;
11
+ export declare const useImageRenderComponent: ({ src, size, color, alt, text, icon, }: UseImageRenderComponent) => string | number | bigint | true | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,13 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import u, { useRef as g, useEffect as x } from "react";
3
- import w from "@alphakits/icons/dist/PhotoM";
4
- import h from "@alphakits/icons/dist/PhotoS";
5
- import S from "classnames";
2
+ import u from "@alphakits/icons/dist/PhotoM";
3
+ import g from "@alphakits/icons/dist/PhotoS";
4
+ import x from "classnames";
5
+ import w, { useRef as h, useEffect as S } from "react";
6
6
  import { Spinner as b } from "../spinner/component.js";
7
7
  import { Typography as f } from "../typography/component.js";
8
+ import n from "./index.module.css.js";
8
9
  import { textSizes as v } from "./types.js";
9
10
  import { getCharsFromText as T } from "./utils.js";
10
- import n from "./index.module.css.js";
11
11
  const y = {
12
12
  xs: "300x300",
13
13
  s: "300x300",
@@ -16,10 +16,7 @@ const y = {
16
16
  xl: "300x300",
17
17
  xxl: "640x640",
18
18
  auto: "640x640"
19
- }, C = ({
20
- src: t,
21
- size: e
22
- }) => {
19
+ }, C = ({ src: t, size: e }) => {
23
20
  if (t?.includes("escapenavigator-images.s3") && e) {
24
21
  const s = t.split("amazonaws.com/")[1];
25
22
  return `https://d2z3luly8bezbw.cloudfront.net/fit-in/${y[e]}/${s}`;
@@ -33,8 +30,8 @@ const y = {
33
30
  text: c,
34
31
  icon: l
35
32
  }) => {
36
- const [m, i] = u.useState("loading"), p = g(0), o = C({ src: t, size: e });
37
- return x(() => {
33
+ const [m, i] = w.useState("loading"), p = h(0), o = C({ src: t, size: e });
34
+ return S(() => {
38
35
  if (!o) {
39
36
  i("error");
40
37
  return;
@@ -48,10 +45,10 @@ const y = {
48
45
  a.src = o;
49
46
  }, 500) : i("error");
50
47
  };
51
- }, [o, e]), l || (m === "loading" ? /* @__PURE__ */ r(b, { className: n.spinner, size: "s", view: "dark" }) : m === "error" && c ? /* @__PURE__ */ r(
48
+ }, [o]), l || (m === "loading" ? /* @__PURE__ */ r(b, { className: n.spinner, size: "s", view: "dark" }) : m === "error" && c ? /* @__PURE__ */ r(
52
49
  f.Text,
53
50
  {
54
- className: S(n.textContent, n[v[e]]),
51
+ className: x(n.textContent, n[v[e]]),
55
52
  view: "caps",
56
53
  color: s,
57
54
  weight: "bold",
@@ -65,7 +62,7 @@ const y = {
65
62
  view: "caps",
66
63
  color: s,
67
64
  weight: "bold",
68
- children: e === "xs" ? /* @__PURE__ */ r(h, {}) : /* @__PURE__ */ r(w, {})
65
+ children: e === "xs" ? /* @__PURE__ */ r(g, {}) : /* @__PURE__ */ r(u, {})
69
66
  }
70
67
  ) : /* @__PURE__ */ r("img", { className: n.image, src: o, alt: d }));
71
68
  };