@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.
- package/dist/__internal/utils/index.d.ts +1 -1
- package/dist/__internal/utils/index.js +4 -4
- package/dist/amount-input/component.js +41 -41
- package/dist/avatar/component.js +2 -18
- package/dist/badge/component.d.ts +1 -1
- package/dist/base-card/component.js +1 -7
- package/dist/bottom-sheet/component.d.ts +1 -1
- package/dist/bottom-sheet/component.js +9 -13
- package/dist/box/component.d.ts +2 -2
- package/dist/box/component.js +4 -4
- package/dist/button/component.js +9 -9
- package/dist/button-arrow/component.js +6 -1
- package/dist/calendar/component.d.ts +1 -2
- package/dist/calendar/component.js +77 -74
- package/dist/calendar/components/days-table/component.js +46 -43
- package/dist/calendar/components/header/{/321/201omponent.js → component.js} +3 -12
- package/dist/calendar/components/header/index.d.ts +1 -1
- package/dist/calendar/components/header/index.js +1 -1
- package/dist/calendar/components/months-table/{/321/201omponent.js → component.js} +7 -7
- package/dist/calendar/components/months-table/index.d.ts +1 -1
- package/dist/calendar/components/months-table/index.js +1 -1
- package/dist/calendar/components/select-button/{/321/201omponent.d.ts → component.d.ts} +3 -3
- package/dist/calendar/components/select-button/{/321/201omponent.js → component.js} +5 -11
- package/dist/calendar/components/select-button/index.d.ts +1 -1
- package/dist/calendar/components/select-button/index.js +1 -1
- package/dist/calendar/components/years-table/{/321/201omponent.js → component.js} +14 -14
- package/dist/calendar/components/years-table/index.d.ts +1 -1
- package/dist/calendar/components/years-table/index.js +1 -1
- package/dist/calendar/index.d.ts +2 -2
- package/dist/calendar/index.js +4 -4
- package/dist/calendar/use-calendar.js +51 -47
- package/dist/calendar/utils.js +7 -9
- package/dist/calendar-input/component.js +22 -22
- package/dist/card/component.js +2 -18
- package/dist/cell/base/component.js +31 -31
- package/dist/cell/pure/component.js +2 -2
- package/dist/checkbox/component.js +11 -11
- package/dist/checkbox-group/component.js +23 -24
- package/dist/checkbox-lists/component.d.ts +1 -2
- package/dist/checkbox-lists/component.js +59 -61
- package/dist/collapsable-row/addons.d.ts +3 -4
- package/dist/collapsable-row/addons.js +6 -9
- package/dist/collapsable-row/component.d.ts +1 -1
- package/dist/collapsable-row/component.js +7 -7
- package/dist/collapse/component.js +45 -54
- package/dist/copy-button/component.d.ts +1 -2
- package/dist/copy-button/component.js +1 -5
- package/dist/date/component.js +1 -1
- package/dist/date-switcher/component.d.ts +1 -2
- package/dist/date-switcher/component.js +8 -8
- package/dist/decorated-item/component.js +10 -20
- package/dist/dot/component.js +1 -4
- package/dist/empty-page/component.js +1 -9
- package/dist/filter-tag/component.d.ts +1 -1
- package/dist/flex/component.d.ts +2 -2
- package/dist/footer/component.js +57 -53
- package/dist/form/component.d.ts +1 -2
- package/dist/form/component.js +2 -12
- package/dist/form/templates/base-form/index.d.ts +3 -3
- package/dist/form/templates/base-form/index.js +26 -26
- package/dist/form/templates/filters-form/index.d.ts +1 -1
- package/dist/form/templates/filters-form/index.js +20 -23
- package/dist/form/templates/rest-form/form.d.ts +1 -2
- package/dist/form/templates/rest-form/form.js +51 -56
- package/dist/form/templates/rest-form/index.d.ts +3 -3
- package/dist/form/templates/rest-form/index.js +16 -27
- package/dist/form/utils/get-default-values.js +3 -6
- package/dist/form/utils/remove-undefined-from-object.js +1 -3
- package/dist/form-control/component.js +1 -1
- package/dist/formik/index.d.ts +2 -2
- package/dist/header-search/component.js +1 -6
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +10 -10
- package/dist/hooks/use-get-one/index.js +16 -16
- package/dist/icon-button/component.d.ts +3 -3
- package/dist/icon-button/component.js +2 -8
- package/dist/image/component.js +52 -30
- package/dist/image/image-base.js +1 -7
- package/dist/image/use-image-render-component.d.ts +1 -1
- package/dist/image/use-image-render-component.js +11 -14
- package/dist/image-gallery/component.js +40 -45
- package/dist/image-uploader/component.js +56 -53
- package/dist/index.js +41 -41
- package/dist/info-block-wrapper/component.d.ts +1 -1
- package/dist/input/component.js +1 -1
- package/dist/input-autocomplete/autocomplete-field/index.d.ts +1 -2
- package/dist/input-autocomplete/autocomplete-field/index.js +6 -6
- package/dist/input-autocomplete/component.d.ts +26 -26
- package/dist/input-ghost/component.d.ts +1 -1
- package/dist/link/component.d.ts +2 -2
- package/dist/link/component.js +1 -1
- package/dist/loader/component.js +6 -5
- package/dist/masked-input/component.js +7 -16
- package/dist/menu/component.js +12 -17
- package/dist/menu/components/content-header/index.js +1 -9
- package/dist/menu/components/menu-avatar/index.js +1 -6
- package/dist/menu/components/menu-button/index.js +1 -10
- package/dist/menu/components/menu-buttons-list/index.d.ts +1 -1
- package/dist/menu/components/menu-buttons-list/index.js +1 -7
- package/dist/menu/hooks/use-menu.js +12 -12
- package/dist/message/component.js +33 -14
- package/dist/modal/components/modals/modal.d.ts +1 -2
- package/dist/modal/components/modals/modal.js +30 -33
- package/dist/modal/context.js +12 -9
- package/dist/modal/hooks/use-modal.d.ts +1 -1
- package/dist/mq/component.js +1 -6
- package/dist/notification/component.js +14 -12
- package/dist/page-container/component.js +1 -6
- package/dist/page-loading/component.d.ts +1 -2
- package/dist/page-with-controls/component.js +4 -7
- package/dist/picker-button/common/labeled-button/index.js +18 -12
- package/dist/picker-button/component.js +5 -5
- package/dist/picker-button/field/{Component.d.ts → component.d.ts} +1 -2
- package/dist/picker-button/field/index.d.ts +1 -1
- package/dist/picker-button/field/index.js +1 -1
- package/dist/picker-button/index.d.ts +1 -1
- package/dist/picker-button/index.js +4 -4
- package/dist/popover/component.d.ts +2 -2
- package/dist/popover/component.js +69 -63
- package/dist/radio/component.js +7 -7
- package/dist/radio-groups/component.d.ts +1 -2
- package/dist/radio-groups/component.js +9 -7
- package/dist/select/component.d.ts +8 -9
- package/dist/select/component.js +1 -9
- package/dist/select/components/arrow/component.d.ts +1 -2
- package/dist/select/components/base-select/component.js +97 -90
- package/dist/select/components/checkmark/component.d.ts +1 -2
- package/dist/select/components/field/component.d.ts +1 -2
- package/dist/select/components/field/component.js +8 -5
- package/dist/select/components/native-select/component.js +4 -11
- package/dist/select/components/optgroup/component.d.ts +1 -2
- package/dist/select/components/optgroup/component.js +4 -4
- package/dist/select/components/option/component.js +1 -1
- package/dist/select/components/options-list/component.d.ts +1 -2
- package/dist/select/components/options-list/component.js +25 -23
- package/dist/select/components/select-search/index.d.ts +1 -1
- package/dist/select/components/select-search/index.js +28 -26
- package/dist/select/components/virtual-options-list/component.d.ts +1 -2
- package/dist/select/components/virtual-options-list/component.js +52 -45
- package/dist/select/index.js +4 -4
- package/dist/select/presets/index.d.ts +1 -1
- package/dist/select/presets/index.js +4 -4
- package/dist/select/presets/use-lazy-loading/index.d.ts +3 -4
- package/dist/select/presets/use-lazy-loading/index.js +45 -43
- package/dist/select/presets/use-select-with-loading/hook.d.ts +1 -2
- package/dist/select/presets/use-select-with-loading/hook.js +8 -1
- package/dist/select/utils.js +32 -32
- package/dist/sidepanel/component.js +21 -15
- package/dist/sidepanel-header/component.js +17 -16
- package/dist/skeleton/component.js +4 -4
- package/dist/space/component.d.ts +2 -2
- package/dist/space/component.js +42 -45
- package/dist/space/{Item.d.ts → item.d.ts} +2 -2
- package/dist/spinner/component.js +6 -5
- package/dist/stack/index.d.ts +1 -1
- package/dist/stack/index.js +5 -5
- package/dist/stepped-progress-bar/components/step-bar.js +3 -3
- package/dist/stepped-progress-bar/index.d.ts +2 -2
- package/dist/stepped-progress-bar/index.js +37 -22
- package/dist/sticker/component.js +1 -17
- package/dist/suffix-input/component.js +13 -13
- package/dist/switch/component.js +7 -7
- package/dist/table/components/cells/index.d.ts +1 -2
- package/dist/table/components/empty-list/index.d.ts +1 -2
- package/dist/table/components/error/index.d.ts +2 -3
- package/dist/table/components/error/index.js +1 -1
- package/dist/table/components/loading/index.d.ts +1 -1
- package/dist/table/components/loading/index.js +18 -12
- package/dist/table/components/pagination/index.js +56 -53
- package/dist/table/components/table-header/index.js +59 -56
- package/dist/table/hooks/use-table-data.js +63 -60
- package/dist/table/table.d.ts +1 -1
- package/dist/table/table.js +73 -73
- package/dist/table/types.d.ts +3 -3
- package/dist/table/utils/get-query-from-url.js +1 -8
- package/dist/table/utils/get-tags.d.ts +1 -1
- package/dist/table/utils/get-tags.js +9 -12
- package/dist/table/utils/index.d.ts +1 -1
- package/dist/table/utils/index.js +4 -4
- package/dist/table/utils/parse-query-params.js +5 -1
- package/dist/table/utils/prepare-rows.d.ts +1 -2
- package/dist/table/utils/prepare-rows.js +4 -3
- package/dist/table/utils/query-adapter.d.ts +1 -1
- package/dist/table/utils/query-adapter.js +5 -5
- package/dist/table/utils/remove-query-param.js +3 -1
- package/dist/table/utils/reset-query-param.js +16 -9
- package/dist/table-status/component.js +5 -1
- package/dist/textarea/component.js +36 -28
- package/dist/theme-provider/component.js +33 -29
- package/dist/toast/component.d.ts +7 -8
- package/dist/toast/component.js +65 -63
- package/dist/toast-notifier/component.js +13 -13
- package/dist/toast-notifier/use-timer.d.ts +1 -1
- package/dist/toast-notifier/use-timer.js +5 -5
- package/dist/toast-plate/component.d.ts +3 -3
- package/dist/toast-plate/component.js +7 -7
- package/dist/tooltip/component.js +35 -35
- package/dist/tooltip/node-resolver.js +7 -7
- package/dist/typings/api.d.ts +3 -5
- package/dist/typography/colors.d.ts +1 -1
- package/dist/typography/title/component.d.ts +3 -3
- package/dist/typography/title/index.d.ts +1 -1
- package/dist/typography/title/index.js +3 -3
- package/dist/utils/date/index.js +12 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +14 -14
- package/dist/utils/split-amount/util.js +4 -4
- package/dist/with-suffix/component.d.ts +13 -13
- package/dist/with-suffix/component.js +8 -8
- package/package.json +9 -34
- /package/dist/__internal/utils/{getDataTestId.d.ts → get-data-test-id.d.ts} +0 -0
- /package/dist/__internal/utils/{getDataTestId.js → get-data-test-id.js} +0 -0
- /package/dist/calendar/components/header/{/321/201omponent.d.ts" → component.d.ts} +0 -0
- /package/dist/calendar/components/months-table/{/321/201omponent.d.ts" → component.d.ts} +0 -0
- /package/dist/calendar/components/years-table/{/321/201omponent.d.ts" → component.d.ts} +0 -0
- /package/dist/picker-button/field/{Component.js → component.js} +0 -0
- /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>):
|
|
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
|
|
2
|
-
import A
|
|
3
|
-
import q from "
|
|
4
|
-
import { Button as
|
|
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
|
|
10
|
+
import { ToastPlate as x } from "../../../toast-plate/component.js";
|
|
11
11
|
function ie({
|
|
12
|
-
recordId:
|
|
13
|
-
title:
|
|
14
|
-
subtitle:
|
|
15
|
-
headerBottomAddons:
|
|
16
|
-
initialValues:
|
|
17
|
-
submitButtonText:
|
|
18
|
-
customFooter:
|
|
19
|
-
loading:
|
|
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:
|
|
26
|
-
close:
|
|
27
|
-
back:
|
|
28
|
-
t:
|
|
29
|
-
children:
|
|
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
|
-
...
|
|
33
|
+
...z
|
|
34
34
|
}) {
|
|
35
|
-
const { setModalDirty:
|
|
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
|
-
|
|
37
|
+
e(o, !1), h();
|
|
43
38
|
},
|
|
44
39
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
|
-
[o
|
|
40
|
+
[o, e, h]
|
|
46
41
|
), g = v(() => {
|
|
47
|
-
|
|
48
|
-
}, [o
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
const j =
|
|
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
|
-
|
|
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:
|
|
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:
|
|
71
|
-
subtitle:
|
|
72
|
-
loading: n || s ||
|
|
73
|
-
headerBottomAddons: (
|
|
74
|
-
|
|
75
|
-
!!d && /* @__PURE__ */ t(
|
|
76
|
-
!m && !!l && /* @__PURE__ */ t(
|
|
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:
|
|
79
|
-
t:
|
|
80
|
-
bottomAddons:
|
|
73
|
+
back: S,
|
|
74
|
+
t: r,
|
|
75
|
+
bottomAddons: M || /* @__PURE__ */ f(G, { gap: "md", children: [
|
|
81
76
|
/* @__PURE__ */ t(
|
|
82
|
-
|
|
77
|
+
k,
|
|
83
78
|
{
|
|
84
79
|
view: "primary",
|
|
85
80
|
size: "s",
|
|
86
81
|
block: !0,
|
|
87
|
-
loading:
|
|
82
|
+
loading: i,
|
|
88
83
|
disabled: n || s,
|
|
89
84
|
dataTestId: "buttonSave",
|
|
90
|
-
onClick: () =>
|
|
91
|
-
children:
|
|
85
|
+
onClick: () => C(),
|
|
86
|
+
children: r(y || "save")
|
|
92
87
|
}
|
|
93
88
|
),
|
|
94
89
|
/* @__PURE__ */ t(
|
|
95
|
-
|
|
90
|
+
k,
|
|
96
91
|
{
|
|
97
92
|
block: !0,
|
|
98
93
|
view: "secondary",
|
|
99
94
|
size: "s",
|
|
100
95
|
dataTestId: "buttonCancel",
|
|
101
|
-
onClick:
|
|
102
|
-
children:
|
|
96
|
+
onClick: R,
|
|
97
|
+
children: r("cancel")
|
|
103
98
|
}
|
|
104
99
|
)
|
|
105
100
|
] }),
|
|
106
|
-
children:
|
|
101
|
+
children: B({
|
|
107
102
|
submitCount: l,
|
|
108
103
|
isValid: m,
|
|
109
|
-
handleSubmit:
|
|
110
|
-
initialValues:
|
|
111
|
-
...
|
|
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) =>
|
|
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>):
|
|
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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
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,
|
|
17
|
+
validate: ((r, t) => {
|
|
19
18
|
if (r) return r;
|
|
20
|
-
if (
|
|
21
|
-
})(l,
|
|
22
|
-
initialValues:
|
|
19
|
+
if (t) return c(t);
|
|
20
|
+
})(l, m),
|
|
21
|
+
initialValues: s,
|
|
23
22
|
enableReinitialize: a,
|
|
24
|
-
onSubmit:
|
|
25
|
-
children: (r) => (process.env.REACT_APP_STAGE
|
|
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
|
-
|
|
29
|
+
b as RestForm
|
|
41
30
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
function
|
|
2
|
-
return Object.entries(u).reduce((
|
|
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
|
-
|
|
5
|
+
f as getDefaultValues
|
|
9
6
|
};
|
package/dist/formik/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
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",
|
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
2
|
-
import { getServiceError as
|
|
3
|
-
const p = (e,
|
|
4
|
-
const [
|
|
5
|
-
|
|
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:
|
|
8
|
-
u(
|
|
9
|
-
} catch (
|
|
10
|
-
|
|
7
|
+
const { data: t } = await s(e);
|
|
8
|
+
u(t);
|
|
9
|
+
} catch (t) {
|
|
10
|
+
c(i(t).message);
|
|
11
11
|
} finally {
|
|
12
|
-
|
|
12
|
+
a(!1);
|
|
13
13
|
}
|
|
14
|
-
};
|
|
15
|
-
return
|
|
16
|
-
e &&
|
|
17
|
-
}, []), {
|
|
14
|
+
}, [e, s]);
|
|
15
|
+
return m(() => {
|
|
16
|
+
e && r();
|
|
17
|
+
}, [r, e]), {
|
|
18
18
|
record: l,
|
|
19
|
-
loading:
|
|
19
|
+
loading: n,
|
|
20
20
|
error: f,
|
|
21
|
-
request:
|
|
21
|
+
request: r
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
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<
|
|
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,
|
package/dist/image/component.js
CHANGED
|
@@ -1,49 +1,71 @@
|
|
|
1
|
-
import { jsxs as
|
|
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:
|
|
9
|
-
src:
|
|
8
|
+
className: t,
|
|
9
|
+
src: m,
|
|
10
10
|
alt: a,
|
|
11
11
|
hint: c,
|
|
12
|
-
addon:
|
|
12
|
+
addon: r,
|
|
13
13
|
border: d,
|
|
14
|
-
size:
|
|
14
|
+
size: l = "m",
|
|
15
15
|
color: p,
|
|
16
16
|
children: h,
|
|
17
17
|
loading: f,
|
|
18
|
-
view:
|
|
19
|
-
text:
|
|
20
|
-
icon:
|
|
21
|
-
bgColor:
|
|
18
|
+
view: n = "default",
|
|
19
|
+
text: u,
|
|
20
|
+
icon: N,
|
|
21
|
+
bgColor: g = "secondary"
|
|
22
22
|
}) => {
|
|
23
23
|
const v = b({
|
|
24
|
-
size:
|
|
25
|
-
src:
|
|
24
|
+
size: l,
|
|
25
|
+
src: m,
|
|
26
26
|
color: p,
|
|
27
27
|
alt: a,
|
|
28
|
-
text:
|
|
29
|
-
icon:
|
|
28
|
+
text: u,
|
|
29
|
+
icon: N
|
|
30
30
|
});
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */ i(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{
|
|
39
|
-
className: e.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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 {
|
package/dist/image/image-base.js
CHANGED
|
@@ -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> |
|
|
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
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import S from "
|
|
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] =
|
|
37
|
-
return
|
|
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
|
|
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:
|
|
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(
|
|
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
|
};
|