@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,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { PopoverProps } from '../popover';
|
|
3
2
|
import { ToastPlateProps } from '../toast-plate';
|
|
4
3
|
export type ToastProps = ToastPlateProps & Pick<PopoverProps, 'position' | 'offset' | 'open' | 'getPortalContainer' | 'preventFlip' | 'transition'> & {
|
|
@@ -7,21 +6,21 @@ export type ToastProps = ToastPlateProps & Pick<PopoverProps, 'position' | 'offs
|
|
|
7
6
|
onClose: () => void;
|
|
8
7
|
bottomOffset?: number;
|
|
9
8
|
};
|
|
10
|
-
export declare const Toast:
|
|
9
|
+
export declare const Toast: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
11
10
|
className?: string | undefined;
|
|
12
11
|
contentClassName?: string | undefined;
|
|
13
|
-
children?:
|
|
14
|
-
title?:
|
|
12
|
+
children?: import('react').ReactNode;
|
|
13
|
+
title?: import('react').ReactNode;
|
|
15
14
|
view: "attention" | "positive" | "negative" | "default" | "black" | "neutral";
|
|
16
|
-
leftAddons?:
|
|
17
|
-
bottomAddons?:
|
|
15
|
+
leftAddons?: import('react').ReactNode;
|
|
16
|
+
bottomAddons?: import('react').ReactNode;
|
|
18
17
|
dataTestId?: string | undefined;
|
|
19
18
|
hasCloser?: boolean | undefined;
|
|
20
19
|
block?: boolean | undefined;
|
|
21
|
-
onClose?: ((event?:
|
|
20
|
+
onClose?: ((event?: import('react').MouseEvent<HTMLButtonElement, MouseEvent> | undefined) => void) | undefined;
|
|
22
21
|
} & Pick<PopoverProps, "open" | "getPortalContainer" | "transition" | "offset" | "position" | "preventFlip"> & {
|
|
23
22
|
anchorElement?: HTMLElement | undefined;
|
|
24
23
|
autoCloseDelay?: number | undefined;
|
|
25
24
|
onClose: () => void;
|
|
26
25
|
bottomOffset?: number | undefined;
|
|
27
|
-
} &
|
|
26
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
package/dist/toast/component.js
CHANGED
|
@@ -1,99 +1,101 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useClickOutside as
|
|
7
|
-
import { usePrevious as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { Portal as
|
|
10
|
-
import { ToastPlate as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
13
|
-
enter:
|
|
14
|
-
enterActive:
|
|
15
|
-
exit:
|
|
16
|
-
exitActive:
|
|
17
|
-
},
|
|
2
|
+
import I from "classnames";
|
|
3
|
+
import { forwardRef as $, useRef as l, useCallback as i, useEffect as g } from "react";
|
|
4
|
+
import P from "react-merge-refs";
|
|
5
|
+
import { CSSTransition as q } from "react-transition-group";
|
|
6
|
+
import { useClickOutside as y } from "../hooks/useClickOutside/index.js";
|
|
7
|
+
import { usePrevious as z } from "../hooks/usePrevious/index.js";
|
|
8
|
+
import { Popover as B } from "../popover/component.js";
|
|
9
|
+
import { Portal as F } from "../portal/component.js";
|
|
10
|
+
import { ToastPlate as _ } from "../toast-plate/component.js";
|
|
11
|
+
import e from "./index.module.css.js";
|
|
12
|
+
const G = {
|
|
13
|
+
enter: e.enter,
|
|
14
|
+
enterActive: e.enterActive,
|
|
15
|
+
exit: e.exit,
|
|
16
|
+
exitActive: e.exitActive
|
|
17
|
+
}, tt = $(
|
|
18
18
|
({
|
|
19
|
-
anchorElement:
|
|
20
|
-
position:
|
|
21
|
-
offset:
|
|
22
|
-
open:
|
|
23
|
-
autoCloseDelay:
|
|
24
|
-
className:
|
|
25
|
-
bottomOffset:
|
|
26
|
-
style:
|
|
27
|
-
block:
|
|
19
|
+
anchorElement: d,
|
|
20
|
+
position: E,
|
|
21
|
+
offset: b,
|
|
22
|
+
open: r,
|
|
23
|
+
autoCloseDelay: T = 3e3,
|
|
24
|
+
className: x,
|
|
25
|
+
bottomOffset: v,
|
|
26
|
+
style: S = {},
|
|
27
|
+
block: A,
|
|
28
28
|
onMouseEnter: n,
|
|
29
29
|
onMouseLeave: f,
|
|
30
30
|
onTouchStart: u,
|
|
31
31
|
onClose: o,
|
|
32
|
-
getPortalContainer:
|
|
33
|
-
...
|
|
34
|
-
},
|
|
35
|
-
const
|
|
36
|
-
clearTimeout(p.current), p.current = window.setTimeout(o,
|
|
37
|
-
}, [
|
|
32
|
+
getPortalContainer: R,
|
|
33
|
+
...h
|
|
34
|
+
}, N) => {
|
|
35
|
+
const a = l(null), O = l(null), p = l(0), k = z(r), c = i(() => {
|
|
36
|
+
clearTimeout(p.current), p.current = window.setTimeout(o, T);
|
|
37
|
+
}, [T, o]), t = i(() => {
|
|
38
38
|
clearTimeout(p.current);
|
|
39
|
-
}, []),
|
|
39
|
+
}, []), j = i(
|
|
40
40
|
(m) => {
|
|
41
41
|
t(), n && n(m);
|
|
42
42
|
},
|
|
43
43
|
[n, t]
|
|
44
|
-
),
|
|
44
|
+
), C = i(
|
|
45
45
|
(m) => {
|
|
46
46
|
c(), f && f(m);
|
|
47
47
|
},
|
|
48
48
|
[f, c]
|
|
49
|
-
),
|
|
49
|
+
), L = i(
|
|
50
50
|
(m) => {
|
|
51
51
|
t(), u && u(m);
|
|
52
52
|
},
|
|
53
53
|
[u, t]
|
|
54
|
-
),
|
|
54
|
+
), M = i(() => {
|
|
55
55
|
o(), t();
|
|
56
56
|
}, [o, t]);
|
|
57
|
-
|
|
57
|
+
y(a, M), g(() => (r !== k && r && c(), () => {
|
|
58
58
|
t();
|
|
59
|
-
}), [
|
|
60
|
-
const
|
|
61
|
-
block:
|
|
59
|
+
}), [r, k, c, t]);
|
|
60
|
+
const w = {
|
|
61
|
+
block: A,
|
|
62
62
|
onClose: o,
|
|
63
|
-
onMouseEnter:
|
|
64
|
-
onMouseLeave:
|
|
65
|
-
onTouchStart:
|
|
66
|
-
ref:
|
|
63
|
+
onMouseEnter: j,
|
|
64
|
+
onMouseLeave: C,
|
|
65
|
+
onTouchStart: L,
|
|
66
|
+
ref: P([N, a])
|
|
67
67
|
};
|
|
68
|
-
return
|
|
69
|
-
|
|
68
|
+
return d ? /* @__PURE__ */ s(
|
|
69
|
+
B,
|
|
70
70
|
{
|
|
71
|
-
open:
|
|
72
|
-
anchorElement:
|
|
73
|
-
position:
|
|
74
|
-
offset:
|
|
75
|
-
popperClassName:
|
|
71
|
+
open: r,
|
|
72
|
+
anchorElement: d,
|
|
73
|
+
position: E,
|
|
74
|
+
offset: b,
|
|
75
|
+
popperClassName: I(e.popover, { [e.block]: A }),
|
|
76
76
|
transition: { timeout: 150 },
|
|
77
|
-
getPortalContainer:
|
|
78
|
-
children: /* @__PURE__ */ s(
|
|
77
|
+
getPortalContainer: R,
|
|
78
|
+
children: /* @__PURE__ */ s(_, { ...h, style: S, className: x, ...w })
|
|
79
79
|
}
|
|
80
|
-
) : /* @__PURE__ */ s(
|
|
81
|
-
|
|
80
|
+
) : /* @__PURE__ */ s(F, { getPortalContainer: R, children: /* @__PURE__ */ s(
|
|
81
|
+
q,
|
|
82
82
|
{
|
|
83
83
|
unmountOnExit: !0,
|
|
84
|
-
in:
|
|
84
|
+
in: r,
|
|
85
85
|
timeout: 150,
|
|
86
|
-
classNames:
|
|
86
|
+
classNames: G,
|
|
87
|
+
nodeRef: O,
|
|
87
88
|
children: /* @__PURE__ */ s(
|
|
88
|
-
|
|
89
|
+
_,
|
|
89
90
|
{
|
|
90
|
-
...
|
|
91
|
-
className:
|
|
91
|
+
...h,
|
|
92
|
+
className: I(e.fixed, e.toastPlate, x),
|
|
92
93
|
style: {
|
|
93
|
-
...
|
|
94
|
-
bottom:
|
|
94
|
+
...S,
|
|
95
|
+
bottom: v && `${v}px`
|
|
95
96
|
},
|
|
96
|
-
...
|
|
97
|
+
...w,
|
|
98
|
+
ref: P([N, a, O])
|
|
97
99
|
}
|
|
98
100
|
)
|
|
99
101
|
}
|
|
@@ -101,5 +103,5 @@ const F = {
|
|
|
101
103
|
}
|
|
102
104
|
);
|
|
103
105
|
export {
|
|
104
|
-
|
|
106
|
+
tt as Toast
|
|
105
107
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import g from "
|
|
2
|
+
import C from "classnames";
|
|
3
|
+
import { createRoot as g } from "react-dom/client";
|
|
4
4
|
import { ToastPlate as y } from "../toast-plate/component.js";
|
|
5
|
-
import { useTimer as w } from "./use-timer.js";
|
|
6
5
|
import o from "./index.module.css.js";
|
|
6
|
+
import { createTimer as w } from "./use-timer.js";
|
|
7
7
|
let e;
|
|
8
8
|
typeof window < "u" && (e = document.createElement("div"), e.setAttribute("id", "toast_manager"), document.body.appendChild(e));
|
|
9
9
|
const z = ({
|
|
10
|
-
className:
|
|
10
|
+
className: m,
|
|
11
11
|
children: E,
|
|
12
12
|
offset: n = 108,
|
|
13
13
|
hasCloser: l = !0,
|
|
@@ -21,18 +21,18 @@ const z = ({
|
|
|
21
21
|
...f
|
|
22
22
|
}) => {
|
|
23
23
|
if (typeof window > "u") return null;
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
return
|
|
24
|
+
const r = window.innerWidth > 600, h = () => {
|
|
25
|
+
const a = "position: fixed; z-index: 999999999;";
|
|
26
|
+
return r ? `${a} ${p}: ${n}px; right: 30px` : `${a} top: ${n}px; right: 30px; left: 30px`;
|
|
27
27
|
};
|
|
28
28
|
e.setAttribute("style", h());
|
|
29
29
|
const t = document.createElement("div");
|
|
30
30
|
t.classList.remove(o.isClosing), t.setAttribute("id", `toast_wrap-${Math.random()}`), t.setAttribute("style", "margin-bottom: 18px"), e.appendChild(t);
|
|
31
|
-
const i =
|
|
31
|
+
const i = g(t), s = () => {
|
|
32
32
|
t.classList.add(o.isClosing), setTimeout(() => {
|
|
33
33
|
i.unmount(), e?.removeChild(t);
|
|
34
34
|
}, 300);
|
|
35
|
-
}, { pause: v, resume: x } = w(
|
|
35
|
+
}, { pause: v, resume: x } = w(s, c);
|
|
36
36
|
return t.addEventListener("mouseenter", () => {
|
|
37
37
|
v();
|
|
38
38
|
}), t.addEventListener("mouseleave", () => {
|
|
@@ -42,12 +42,12 @@ const z = ({
|
|
|
42
42
|
y,
|
|
43
43
|
{
|
|
44
44
|
hasCloser: l,
|
|
45
|
-
className:
|
|
45
|
+
className: C(
|
|
46
46
|
{
|
|
47
47
|
[o.isVisible]: !0,
|
|
48
|
-
[o.mobile]: !
|
|
48
|
+
[o.mobile]: !r
|
|
49
49
|
},
|
|
50
|
-
|
|
50
|
+
m
|
|
51
51
|
),
|
|
52
52
|
contentClassName: o.toastContent,
|
|
53
53
|
style: {
|
|
@@ -56,7 +56,7 @@ const z = ({
|
|
|
56
56
|
...u
|
|
57
57
|
},
|
|
58
58
|
role: "alert",
|
|
59
|
-
onClose:
|
|
59
|
+
onClose: s,
|
|
60
60
|
...f,
|
|
61
61
|
children: d
|
|
62
62
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const
|
|
1
|
+
const u = (s, e) => {
|
|
2
2
|
let t, i = !1;
|
|
3
|
-
const a =
|
|
3
|
+
const a = Date.now(), m = ((r, n) => Date.now() - r)(a), c = () => {
|
|
4
4
|
clearTimeout(t);
|
|
5
|
-
},
|
|
5
|
+
}, o = () => {
|
|
6
6
|
clearTimeout(t), i = m >= e;
|
|
7
7
|
};
|
|
8
8
|
return t = setTimeout(s, e), {
|
|
9
9
|
cancel: c,
|
|
10
|
-
pause:
|
|
10
|
+
pause: o,
|
|
11
11
|
resume: () => {
|
|
12
12
|
t = i ? -1 : setTimeout(s, e - m);
|
|
13
13
|
},
|
|
@@ -15,5 +15,5 @@ const n = (s, e) => {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
|
-
|
|
18
|
+
u as createTimer
|
|
19
19
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
export type ToastPlateProps = HTMLAttributes<HTMLDivElement> & {
|
|
3
3
|
className?: string;
|
|
4
4
|
contentClassName?: string;
|
|
@@ -12,7 +12,7 @@ export type ToastPlateProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
12
12
|
block?: boolean;
|
|
13
13
|
onClose?: (event?: MouseEvent<HTMLButtonElement>) => void;
|
|
14
14
|
};
|
|
15
|
-
export declare const ToastPlate:
|
|
15
|
+
export declare const ToastPlate: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
16
16
|
className?: string | undefined;
|
|
17
17
|
contentClassName?: string | undefined;
|
|
18
18
|
children?: ReactNode;
|
|
@@ -24,4 +24,4 @@ export declare const ToastPlate: React.ForwardRefExoticComponent<React.HTMLAttri
|
|
|
24
24
|
hasCloser?: boolean | undefined;
|
|
25
25
|
block?: boolean | undefined;
|
|
26
26
|
onClose?: ((event?: MouseEvent<HTMLButtonElement>) => void) | undefined;
|
|
27
|
-
} &
|
|
27
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as M, useCallback as g } from "react";
|
|
3
2
|
import f from "@alphakits/icons/dist/AlertCircleM";
|
|
4
|
-
import
|
|
3
|
+
import M from "@alphakits/icons/dist/CheckmarkCircleM";
|
|
5
4
|
import p from "@alphakits/icons/dist/ClockCircleM";
|
|
6
|
-
import
|
|
5
|
+
import g from "@alphakits/icons/dist/CloseS";
|
|
7
6
|
import o from "classnames";
|
|
7
|
+
import { forwardRef as j, useCallback as A } from "react";
|
|
8
8
|
import { Button as B } from "../button/component.js";
|
|
9
9
|
import r from "./index.module.css.js";
|
|
10
|
-
const E =
|
|
10
|
+
const E = j(
|
|
11
11
|
({
|
|
12
12
|
dataTestId: h,
|
|
13
13
|
className: k,
|
|
@@ -25,11 +25,11 @@ const E = M(
|
|
|
25
25
|
const l = {
|
|
26
26
|
negative: /* @__PURE__ */ e(f, {}),
|
|
27
27
|
attention: /* @__PURE__ */ e(f, {}),
|
|
28
|
-
positive: /* @__PURE__ */ e(
|
|
28
|
+
positive: /* @__PURE__ */ e(M, {}),
|
|
29
29
|
default: /* @__PURE__ */ e(p, {}),
|
|
30
30
|
neutral: /* @__PURE__ */ e(p, {}),
|
|
31
31
|
black: null
|
|
32
|
-
}, b =
|
|
32
|
+
}, b = A(
|
|
33
33
|
(x) => {
|
|
34
34
|
a && a(x);
|
|
35
35
|
},
|
|
@@ -65,7 +65,7 @@ const E = M(
|
|
|
65
65
|
view: "ghost",
|
|
66
66
|
onClick: b,
|
|
67
67
|
"aria-label": "закрыть",
|
|
68
|
-
leftAddons: /* @__PURE__ */ e(
|
|
68
|
+
leftAddons: /* @__PURE__ */ e(g, {})
|
|
69
69
|
}
|
|
70
70
|
)
|
|
71
71
|
] })
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsxs as X, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import f
|
|
3
|
-
import m from "
|
|
2
|
+
import f from "classnames";
|
|
3
|
+
import m, { useState as C, useRef as Y, useCallback as d, useEffect as Z, cloneElement as _ } from "react";
|
|
4
4
|
import { Popover as $ } from "../popover/component.js";
|
|
5
|
+
import T from "./index.module.css.js";
|
|
5
6
|
import { NodeResolver as D } from "./node-resolver.js";
|
|
6
|
-
import d from "./index.module.css.js";
|
|
7
7
|
const ce = ({
|
|
8
8
|
children: t,
|
|
9
9
|
content: O,
|
|
10
|
-
trigger:
|
|
11
|
-
onCloseDelay:
|
|
10
|
+
trigger: v = "hover",
|
|
11
|
+
onCloseDelay: g = 300,
|
|
12
12
|
onOpenDelay: b = 300,
|
|
13
13
|
dataTestId: E,
|
|
14
|
-
onClose:
|
|
15
|
-
onOpen:
|
|
16
|
-
open:
|
|
14
|
+
onClose: c,
|
|
15
|
+
onOpen: h,
|
|
16
|
+
open: u,
|
|
17
17
|
getPortalContainer: N,
|
|
18
18
|
offset: P = [0, 10],
|
|
19
19
|
position: S,
|
|
@@ -22,47 +22,47 @@ const ce = ({
|
|
|
22
22
|
popoverClassName: j,
|
|
23
23
|
updatePopover: L
|
|
24
24
|
}) => {
|
|
25
|
-
const [n,
|
|
26
|
-
n || (
|
|
27
|
-
}, s =
|
|
28
|
-
n && (
|
|
29
|
-
}, [
|
|
30
|
-
n ? s() :
|
|
31
|
-
},
|
|
25
|
+
const [n, k] = C(!!u), [w, A] = C(null), a = m.useRef(null), R = m.useRef(null), o = Y(0), i = () => {
|
|
26
|
+
n || (k(!0), h && h());
|
|
27
|
+
}, s = d(() => {
|
|
28
|
+
n && (k(!1), c && c());
|
|
29
|
+
}, [c, n]), B = () => {
|
|
30
|
+
n ? s() : i();
|
|
31
|
+
}, p = d((e) => !(a.current?.contains(e) || R.current?.contains(e)), []);
|
|
32
32
|
Z(() => {
|
|
33
33
|
const e = (r) => {
|
|
34
34
|
const W = r.target;
|
|
35
|
-
|
|
35
|
+
p(W) && s();
|
|
36
36
|
};
|
|
37
37
|
return document.body.addEventListener("click", e), () => {
|
|
38
38
|
document.body.removeEventListener("click", e), clearTimeout(o.current);
|
|
39
39
|
};
|
|
40
|
-
}, [s]);
|
|
40
|
+
}, [s, p]);
|
|
41
41
|
const F = (e) => {
|
|
42
42
|
t.props.onClick && t.props.onClick(e), B();
|
|
43
43
|
}, H = (e) => {
|
|
44
44
|
t.props.onMouseOver && t.props.onMouseOver(e), clearTimeout(o.current), o.current = window.setTimeout(() => {
|
|
45
|
-
|
|
45
|
+
i();
|
|
46
46
|
}, b);
|
|
47
47
|
}, V = (e) => {
|
|
48
48
|
t.props.onMouseOut && t.props.onMouseOut(e), clearTimeout(o.current), o.current = window.setTimeout(() => {
|
|
49
49
|
s();
|
|
50
|
-
},
|
|
50
|
+
}, g);
|
|
51
51
|
}, q = (e) => {
|
|
52
52
|
t.props.onTouchStart && t.props.onTouchStart(e);
|
|
53
53
|
const r = e.target;
|
|
54
|
-
clearTimeout(o.current),
|
|
54
|
+
clearTimeout(o.current), p(r) ? o.current = window.setTimeout(() => {
|
|
55
55
|
s();
|
|
56
|
-
},
|
|
57
|
-
}, z = { onClick: F },
|
|
56
|
+
}, g) : i();
|
|
57
|
+
}, z = { onClick: F }, M = {
|
|
58
58
|
onMouseOver: H,
|
|
59
59
|
onMouseOut: V,
|
|
60
60
|
onTouchStart: q
|
|
61
61
|
}, G = (e) => {
|
|
62
62
|
const r = {
|
|
63
|
-
className:
|
|
63
|
+
className: f(T.target, e.className)
|
|
64
64
|
};
|
|
65
|
-
switch (
|
|
65
|
+
switch (v) {
|
|
66
66
|
case "click":
|
|
67
67
|
return {
|
|
68
68
|
...r,
|
|
@@ -71,22 +71,22 @@ const ce = ({
|
|
|
71
71
|
case "hover":
|
|
72
72
|
return {
|
|
73
73
|
...r,
|
|
74
|
-
...
|
|
74
|
+
...M
|
|
75
75
|
};
|
|
76
76
|
default:
|
|
77
77
|
return {};
|
|
78
78
|
}
|
|
79
79
|
}, I = () => {
|
|
80
80
|
const e = {
|
|
81
|
-
ref:
|
|
81
|
+
ref: R,
|
|
82
82
|
"data-test-id": E,
|
|
83
|
-
className:
|
|
83
|
+
className: f(T.component, x)
|
|
84
84
|
};
|
|
85
|
-
switch (
|
|
85
|
+
switch (v) {
|
|
86
86
|
case "hover":
|
|
87
87
|
return {
|
|
88
88
|
...e,
|
|
89
|
-
...
|
|
89
|
+
...M
|
|
90
90
|
};
|
|
91
91
|
default:
|
|
92
92
|
return e;
|
|
@@ -97,19 +97,19 @@ const ce = ({
|
|
|
97
97
|
}, K = () => {
|
|
98
98
|
const e = I();
|
|
99
99
|
return /* @__PURE__ */ l("div", { ...e, children: O });
|
|
100
|
-
}, Q =
|
|
101
|
-
|
|
100
|
+
}, Q = u === void 0 ? n : u, U = d((e) => {
|
|
101
|
+
a.current = e, A(a.current);
|
|
102
102
|
}, []);
|
|
103
|
-
return /* @__PURE__ */ X(
|
|
103
|
+
return /* @__PURE__ */ X(m.Fragment, { children: [
|
|
104
104
|
/* @__PURE__ */ l(D, { innerRef: U, children: J() }),
|
|
105
|
-
|
|
105
|
+
w && /* @__PURE__ */ l(
|
|
106
106
|
$,
|
|
107
107
|
{
|
|
108
|
-
anchorElement:
|
|
108
|
+
anchorElement: w,
|
|
109
109
|
open: Q,
|
|
110
110
|
getPortalContainer: N,
|
|
111
111
|
arrowClassName: y,
|
|
112
|
-
popperClassName:
|
|
112
|
+
popperClassName: f(T.popper, j),
|
|
113
113
|
offset: P,
|
|
114
114
|
withArrow: !0,
|
|
115
115
|
position: S,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as s, useEffect as l } from "react";
|
|
3
|
+
const f = ({ innerRef: e, children: n }) => {
|
|
4
|
+
const t = s(null);
|
|
5
5
|
return l(() => {
|
|
6
|
-
const r =
|
|
6
|
+
const r = t.current?.firstElementChild;
|
|
7
7
|
return e(r instanceof HTMLElement ? r : null), () => e(null);
|
|
8
|
-
}, [e
|
|
8
|
+
}, [e]), /* @__PURE__ */ o("span", { ref: t, style: { display: "contents" }, children: n });
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
f as NodeResolver
|
|
12
12
|
};
|
package/dist/typings/api.d.ts
CHANGED
|
@@ -9,10 +9,8 @@ export type ApiDeclaration<T> = {
|
|
|
9
9
|
export type Api<T> = {
|
|
10
10
|
[P in keyof T]: MakeServiceFromServiceDeclaration<ExtendServiceParams<T[P]>>;
|
|
11
11
|
};
|
|
12
|
-
export type MakeServiceFromServiceDeclaration<T> =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
type ExtractApiMethodResponseDataType<T> = T extends ApiMethodDeclaration<infer P, infer D> ? D : any;
|
|
16
|
-
type ExtractApiMethodParamsType<T> = T extends ApiMethodDeclaration<infer P, infer D> ? P : any;
|
|
12
|
+
export type MakeServiceFromServiceDeclaration<T> = (params: ExtractApiMethodParamsType<T>) => AxiosPromise<ExtractApiMethodResponseDataType<T>>;
|
|
13
|
+
type ExtractApiMethodResponseDataType<T> = T extends ApiMethodDeclaration<infer _P, infer D> ? D : any;
|
|
14
|
+
type ExtractApiMethodParamsType<T> = T extends ApiMethodDeclaration<infer P, infer _D> ? P : any;
|
|
17
15
|
export type ExtendServiceParams<T> = ApiMethodDeclaration<ExtractApiMethodParamsType<T>, ExtractApiMethodResponseDataType<T>>;
|
|
18
16
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const colors: readonly ["tertiary", "disabled", "accent", "primary", "attention", "positive", "secondary", "tertiary-inverted", "primary-inverted", "secondary-inverted", "link", "negative"];
|
|
2
|
-
export type Color = typeof colors[number];
|
|
2
|
+
export type Color = (typeof colors)[number];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { Color } from '../colors';
|
|
3
3
|
export type TitleProps = {
|
|
4
4
|
tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
|
|
@@ -10,12 +10,12 @@ export type TitleProps = {
|
|
|
10
10
|
through?: boolean;
|
|
11
11
|
className?: string;
|
|
12
12
|
dataTestId?: string;
|
|
13
|
-
children
|
|
13
|
+
children?: ReactNode;
|
|
14
14
|
};
|
|
15
15
|
type Styles = {
|
|
16
16
|
styles: {
|
|
17
17
|
[key: string]: string;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
export declare const Title: ({ tag: Component, view, weight, defaultMargins, color, className, dataTestId, uppercase, through, children, styles, }: TitleProps & Styles) =>
|
|
20
|
+
export declare const Title: ({ tag: Component, view, weight, defaultMargins, color, className, dataTestId, uppercase, through, children, styles, }: TitleProps & Styles) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import r from "./
|
|
2
|
+
import m from "./common.module.css.js";
|
|
3
|
+
import { Title as r } from "./component.js";
|
|
4
4
|
import s from "./index.module.css.js";
|
|
5
5
|
const f = (o) => (
|
|
6
6
|
/**
|
|
7
7
|
* Если поменять Object.assign на деструктуризацию, то упадут тесты.
|
|
8
8
|
* Видимо, это особенность работы jest и css-modules.
|
|
9
9
|
*/
|
|
10
|
-
/* @__PURE__ */ t(
|
|
10
|
+
/* @__PURE__ */ t(r, { ...o, styles: { ...m, ...s } })
|
|
11
11
|
);
|
|
12
12
|
export {
|
|
13
13
|
f as Title
|
package/dist/utils/date/index.js
CHANGED
|
@@ -49,7 +49,15 @@ function b(t, e) {
|
|
|
49
49
|
}
|
|
50
50
|
function f(t, e) {
|
|
51
51
|
const n = t.getDate(), r = t.getFullYear(), a = t.getMonth() + e, o = Math.min(n, b(r, a));
|
|
52
|
-
return new Date(
|
|
52
|
+
return new Date(
|
|
53
|
+
r,
|
|
54
|
+
a,
|
|
55
|
+
o,
|
|
56
|
+
t.getHours(),
|
|
57
|
+
t.getMinutes(),
|
|
58
|
+
t.getSeconds(),
|
|
59
|
+
t.getMilliseconds()
|
|
60
|
+
);
|
|
53
61
|
}
|
|
54
62
|
function B(t, e) {
|
|
55
63
|
return f(t, -e);
|
|
@@ -139,7 +147,9 @@ function tt(t) {
|
|
|
139
147
|
);
|
|
140
148
|
}
|
|
141
149
|
function y(t, e, n) {
|
|
142
|
-
return new Intl.DateTimeFormat(e, { day: "numeric", month: n }).formatToParts(
|
|
150
|
+
return new Intl.DateTimeFormat(e, { day: "numeric", month: n }).formatToParts(
|
|
151
|
+
t
|
|
152
|
+
).find((o) => o.type === "month")?.value ?? new Intl.DateTimeFormat(e, { month: n }).format(t);
|
|
143
153
|
}
|
|
144
154
|
function h(t, e, n) {
|
|
145
155
|
return new Intl.DateTimeFormat(e, { month: n }).format(t);
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from './date';
|
|
2
2
|
export * from './debounce';
|
|
3
|
-
export * from './safe-stringify';
|
|
4
3
|
export * from './format-amount/util';
|
|
4
|
+
export * from './format-date';
|
|
5
|
+
export * from './safe-stringify';
|
|
5
6
|
export * from './show-toast';
|
|
6
7
|
export * from './split-amount/util';
|
|
7
|
-
export * from './format-date';
|
|
8
8
|
export * from './string';
|