@alphakits/ui 2.5.15 → 2.5.16
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/image-uploader/component.js +205 -127
- package/dist/image-uploader/index.css +1 -1
- package/dist/image-uploader/index.module.css.js +26 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +135 -133
- package/dist/input/component.js +42 -40
- package/dist/input-ghost/component.js +5 -4
- package/dist/settings-info-block/component.d.ts +16 -0
- package/dist/settings-info-block/component.js +78 -0
- package/dist/settings-info-block/index.css +1 -0
- package/dist/settings-info-block/index.d.ts +1 -0
- package/dist/settings-info-block/index.js +4 -0
- package/dist/settings-info-block/index.module.css.js +35 -0
- package/dist/textarea/component.js +1 -1
- package/package.json +1 -1
|
@@ -1,149 +1,227 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { SuperListHeader as
|
|
14
|
-
import { Typography as
|
|
15
|
-
import { getServiceError as
|
|
16
|
-
import { showError as
|
|
17
|
-
import
|
|
18
|
-
const
|
|
1
|
+
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import or from "@alphakits/icons/dist/EyeS";
|
|
3
|
+
import tr from "@alphakits/icons/dist/HeartS";
|
|
4
|
+
import O from "@alphakits/icons/dist/PlusS";
|
|
5
|
+
import ar from "@alphakits/icons/dist/TrashS";
|
|
6
|
+
import A from "classnames";
|
|
7
|
+
import { forwardRef as nr, useState as m, useRef as P } from "react";
|
|
8
|
+
import { Button as sr } from "../button/component.js";
|
|
9
|
+
import { FlexColumns as ir } from "../flex-columns/component.js";
|
|
10
|
+
import { IconButton as y } from "../icon-button/component.js";
|
|
11
|
+
import { Image as cr } from "../image/component.js";
|
|
12
|
+
import { ImageGallery as lr } from "../image-gallery/component.js";
|
|
13
|
+
import { SuperListHeader as dr } from "../super-list-header/component.js";
|
|
14
|
+
import { Typography as L } from "../typography/component.js";
|
|
15
|
+
import { getServiceError as fr } from "../utils/get-service-error/index.js";
|
|
16
|
+
import { showError as pr } from "../utils/show-toast/index.js";
|
|
17
|
+
import a from "./index.module.css.js";
|
|
18
|
+
const w = "application/x-image-uploader-index", mr = (t, g, p) => {
|
|
19
|
+
if (g === p) return t;
|
|
20
|
+
const c = [...t], [N] = c.splice(g, 1);
|
|
21
|
+
return c.splice(p, 0, N), c;
|
|
22
|
+
}, br = nr(
|
|
19
23
|
({
|
|
20
|
-
value:
|
|
21
|
-
title:
|
|
22
|
-
subtitle:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
return
|
|
24
|
+
value: t = [],
|
|
25
|
+
title: g,
|
|
26
|
+
subtitle: p,
|
|
27
|
+
onUpdate: c,
|
|
28
|
+
uploadRequest: N,
|
|
29
|
+
setMain: S,
|
|
30
|
+
type: B,
|
|
31
|
+
main: k,
|
|
32
|
+
multiple: s,
|
|
33
|
+
error: v,
|
|
34
|
+
className: H,
|
|
35
|
+
children: z
|
|
36
|
+
}, M) => {
|
|
37
|
+
const [j, I] = m(!1), [G, K] = m(), [R, x] = m(!1), [W, h] = m(!1), [_, C] = m(null), u = P(null), d = P(0), D = () => u.current?.click(), E = async (r) => {
|
|
38
|
+
const e = Array.from(r).filter(
|
|
39
|
+
(l) => l.type.startsWith("image/") || /\.heic$/i.test(l.name)
|
|
40
|
+
);
|
|
41
|
+
if (!e.length) return;
|
|
42
|
+
const n = e.map((l) => {
|
|
43
|
+
const i = new FormData();
|
|
44
|
+
return i.append("file", l), i.append("type", B), N({ data: i });
|
|
41
45
|
});
|
|
42
|
-
|
|
46
|
+
x(!0);
|
|
43
47
|
try {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
} catch (
|
|
47
|
-
const { message:
|
|
48
|
-
|
|
48
|
+
const i = (await Promise.all(n)).map(({ data: er }) => er.url);
|
|
49
|
+
c(s ? [...t, ...i] : i.slice(0, 1));
|
|
50
|
+
} catch (l) {
|
|
51
|
+
const { message: i } = fr(l);
|
|
52
|
+
pr(i);
|
|
49
53
|
} finally {
|
|
50
|
-
|
|
54
|
+
u.current && (u.current.value = ""), x(!1);
|
|
51
55
|
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
}, b = async ({ target: { files: r } }) => {
|
|
57
|
+
r && await E(r);
|
|
58
|
+
}, $ = (r, e) => {
|
|
59
|
+
c(r.filter((n) => n !== e));
|
|
60
|
+
}, q = (r, e) => {
|
|
61
|
+
c(mr(t, r, e));
|
|
62
|
+
}, J = (r) => {
|
|
63
|
+
r.preventDefault(), d.current += 1, h(!0);
|
|
64
|
+
}, Q = (r) => {
|
|
65
|
+
r.preventDefault(), d.current -= 1, d.current <= 0 && (d.current = 0, h(!1));
|
|
66
|
+
}, F = (r) => {
|
|
67
|
+
r.preventDefault(), r.dataTransfer.dropEffect = r.dataTransfer.types.includes(w) ? "move" : "copy";
|
|
68
|
+
}, V = async (r) => {
|
|
69
|
+
r.preventDefault(), r.stopPropagation(), d.current = 0, h(!1), !r.dataTransfer.getData(w) && r.dataTransfer.files?.length && await E(r.dataTransfer.files);
|
|
70
|
+
}, X = (r, e) => {
|
|
71
|
+
!s || t.length < 2 || (r.dataTransfer.setData(w, String(e)), r.dataTransfer.effectAllowed = "move", C(e));
|
|
72
|
+
}, Y = () => {
|
|
73
|
+
C(null);
|
|
74
|
+
}, Z = (r, e) => {
|
|
75
|
+
if (r.preventDefault(), r.stopPropagation(), d.current = 0, h(!1), r.dataTransfer.files?.length) {
|
|
76
|
+
E(r.dataTransfer.files);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const n = Number(r.dataTransfer.getData(w));
|
|
80
|
+
Number.isNaN(n) || n === e || (q(n, e), C(null));
|
|
81
|
+
}, T = s || !t.length, U = !t.length, rr = !T;
|
|
82
|
+
return /* @__PURE__ */ f("div", { className: H, children: [
|
|
83
|
+
/* @__PURE__ */ o(
|
|
55
84
|
"input",
|
|
56
85
|
{
|
|
57
86
|
type: "file",
|
|
58
87
|
style: { height: 0, position: "absolute" },
|
|
59
|
-
ref:
|
|
60
|
-
onChange:
|
|
61
|
-
multiple:
|
|
88
|
+
ref: M,
|
|
89
|
+
onChange: b,
|
|
90
|
+
multiple: s,
|
|
62
91
|
accept: "image/*, .heic"
|
|
63
92
|
}
|
|
64
93
|
),
|
|
65
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ o(
|
|
66
95
|
"input",
|
|
67
96
|
{
|
|
68
97
|
type: "file",
|
|
69
98
|
style: { height: 0, position: "absolute" },
|
|
70
|
-
ref:
|
|
71
|
-
onChange:
|
|
72
|
-
multiple:
|
|
99
|
+
ref: u,
|
|
100
|
+
onChange: b,
|
|
101
|
+
multiple: s,
|
|
73
102
|
accept: "image/*, .heic"
|
|
74
103
|
}
|
|
75
104
|
),
|
|
76
|
-
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
105
|
+
z ? /* @__PURE__ */ o(sr, { view: "ghost", onClick: D, children: z({ value: t, loading: R }) }) : /* @__PURE__ */ f(ir, { columns: 1, gr: 12, gc: 0, children: [
|
|
106
|
+
/* @__PURE__ */ f("div", { className: a.header, children: [
|
|
107
|
+
/* @__PURE__ */ o(
|
|
108
|
+
dr,
|
|
109
|
+
{
|
|
110
|
+
text: g,
|
|
111
|
+
rightAddons: rr ? /* @__PURE__ */ o(
|
|
112
|
+
y,
|
|
113
|
+
{
|
|
114
|
+
onClick: D,
|
|
115
|
+
icon: O,
|
|
116
|
+
loading: R
|
|
117
|
+
}
|
|
118
|
+
) : void 0
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
p && /* @__PURE__ */ o(
|
|
122
|
+
L.Text,
|
|
123
|
+
{
|
|
124
|
+
view: "primary-small",
|
|
125
|
+
color: "secondary",
|
|
126
|
+
weight: "medium",
|
|
127
|
+
children: p
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
v && /* @__PURE__ */ o(L.Text, { view: "caps", color: "negative", weight: "medium", children: v })
|
|
131
|
+
] }),
|
|
132
|
+
(!!t.length || T) && /* @__PURE__ */ f("div", { className: a.grid, children: [
|
|
133
|
+
t.map((r, e) => /* @__PURE__ */ o(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
className: A(a.card, {
|
|
137
|
+
[a.cardDragging]: _ === e
|
|
138
|
+
}),
|
|
139
|
+
draggable: s && t.length > 1,
|
|
140
|
+
onDragStart: (n) => X(n, e),
|
|
141
|
+
onDragEnd: Y,
|
|
142
|
+
onDragOver: F,
|
|
143
|
+
onDrop: (n) => Z(n, e),
|
|
144
|
+
children: /* @__PURE__ */ f(
|
|
145
|
+
cr,
|
|
146
|
+
{
|
|
147
|
+
className: a.thumbnail,
|
|
148
|
+
src: r,
|
|
149
|
+
size: "xl",
|
|
150
|
+
view: "default",
|
|
151
|
+
children: [
|
|
152
|
+
s && k === r && /* @__PURE__ */ o("div", { className: a.mainBadge, children: "MAIN" }),
|
|
153
|
+
/* @__PURE__ */ f(
|
|
154
|
+
"div",
|
|
155
|
+
{
|
|
156
|
+
className: a.controls,
|
|
157
|
+
onMouseDown: (n) => n.stopPropagation(),
|
|
158
|
+
children: [
|
|
159
|
+
s && !!S && k !== r && /* @__PURE__ */ o(
|
|
160
|
+
y,
|
|
161
|
+
{
|
|
162
|
+
onClick: () => S(r),
|
|
163
|
+
icon: tr,
|
|
164
|
+
size: "s",
|
|
165
|
+
className: a.action
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ o(
|
|
169
|
+
y,
|
|
170
|
+
{
|
|
171
|
+
onClick: () => {
|
|
172
|
+
K(e), I(!0);
|
|
173
|
+
},
|
|
174
|
+
icon: or,
|
|
175
|
+
size: "s",
|
|
176
|
+
className: a.action
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
/* @__PURE__ */ o(
|
|
180
|
+
y,
|
|
181
|
+
{
|
|
182
|
+
onClick: () => $(t, r),
|
|
183
|
+
icon: ar,
|
|
184
|
+
size: "s",
|
|
185
|
+
className: a.action
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
},
|
|
195
|
+
r
|
|
196
|
+
)),
|
|
197
|
+
T && /* @__PURE__ */ o(
|
|
198
|
+
"div",
|
|
199
|
+
{
|
|
200
|
+
role: "button",
|
|
201
|
+
tabIndex: 0,
|
|
202
|
+
className: A(a.dropzone, {
|
|
203
|
+
[a.dropzoneActive]: W,
|
|
204
|
+
[a.dropzoneEmpty]: U
|
|
205
|
+
}),
|
|
206
|
+
onClick: D,
|
|
207
|
+
onKeyDown: (r) => {
|
|
208
|
+
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), D());
|
|
209
|
+
},
|
|
210
|
+
onDragEnter: J,
|
|
211
|
+
onDragLeave: Q,
|
|
212
|
+
onDragOver: F,
|
|
213
|
+
onDrop: V,
|
|
214
|
+
children: /* @__PURE__ */ o(O, { className: a.dropzoneIcon })
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
] }),
|
|
218
|
+
/* @__PURE__ */ o(
|
|
219
|
+
lr,
|
|
142
220
|
{
|
|
143
|
-
photos:
|
|
144
|
-
initialSlide:
|
|
145
|
-
open:
|
|
146
|
-
onClose: () =>
|
|
221
|
+
photos: t.map((r) => ({ src: r })),
|
|
222
|
+
initialSlide: G || 0,
|
|
223
|
+
open: j,
|
|
224
|
+
onClose: () => I(!1)
|
|
147
225
|
}
|
|
148
226
|
)
|
|
149
227
|
] })
|
|
@@ -151,5 +229,5 @@ const de = D(
|
|
|
151
229
|
}
|
|
152
230
|
);
|
|
153
231
|
export {
|
|
154
|
-
|
|
232
|
+
br as ImageUploader
|
|
155
233
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.header_r6rI{display:flex;flex-direction:column;gap:4px}.header_r6rI>:first-child{min-height:0;min-height:initial;padding:0}.grid_xbZY{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,136px));grid-gap:12px;gap:12px}.card_Hah9,.dropzone_RCg5{width:100%;max-width:136px;height:80px;box-sizing:border-box}.card_Hah9{position:relative;cursor:grab;border-radius:var(--radius-s, 8px);overflow:hidden}.card_Hah9:active{cursor:grabbing}.cardDragging_0e1s{opacity:.45}.card_Hah9 .thumbnail_jtZG{width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;max-width:none;border-radius:inherit!important;overflow:hidden}.card_Hah9 .thumbnail_jtZG>div{border-radius:inherit!important}.card_Hah9 .thumbnail_jtZG img{border-radius:inherit}.card_Hah9:hover .controls_XUF4{opacity:1}.controls_XUF4{position:absolute;top:0;right:0;left:0;display:flex;align-items:center;justify-content:flex-end;gap:3px;padding:4px 5px;background:linear-gradient(to bottom,rgba(15,20,25,.42),transparent);opacity:0;transition:opacity .15s ease;z-index:3}.action_q3U6{align-items:center!important;background:#fffffff0!important;border-radius:4px!important;box-shadow:0 1px 3px #00000047;color:#1c1c1e!important;display:inline-flex!important;flex-shrink:0;height:20px!important;justify-content:center!important;min-height:20px!important;min-width:20px!important;padding:0!important;width:20px!important}.action_q3U6:hover{background:#fff!important}.action_q3U6 span{height:12px!important;width:12px!important}.action_q3U6 svg,.action_q3U6 svg *{color:#1c1c1e!important;fill:currentColor!important;height:12px!important;width:12px!important}.mainBadge_kZlV{position:absolute;top:6px;left:6px;background:var(--color-bg-positive);border-radius:var(--radius-s, 8px);color:var(--color-text-primary-inverted);font-size:9px;font-weight:700;letter-spacing:.04em;line-height:1;padding:4px 6px;text-transform:uppercase;z-index:4}.dropzone_RCg5{align-items:center;background:var(--color-bg-secondary);border:1.5px dashed color-mix(in srgb,var(--color-graphic-secondary) 35%,transparent);border-radius:var(--radius-s, 8px);cursor:pointer;display:flex;justify-content:center;padding:0;transition:background .15s ease,border-color .15s ease}.dropzone_RCg5:hover{background:var(--color-bg-thirdly);border-color:color-mix(in srgb,var(--color-graphic-accent) 55%,transparent)}.dropzoneActive_z97l{background:color-mix(in srgb,var(--color-bg-accent) 8%,var(--color-bg-secondary));border-color:var(--color-graphic-accent)}.dropzoneEmpty_9tHX{max-width:136px}.dropzoneIcon_m3ug{color:var(--color-graphic-secondary)}.dropzoneActive_z97l .dropzoneIcon_m3ug{color:var(--color-graphic-accent)}
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
import * as __css from './index.css';
|
|
2
2
|
export const __cssModule = __css;
|
|
3
|
-
const o = "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const o = "header_r6rI", n = "grid_xbZY", r = "card_Hah9", t = "dropzone_RCg5", c = "cardDragging_0e1s", d = "thumbnail_jtZG", e = "controls_XUF4", a = "action_q3U6", s = "mainBadge_kZlV", i = "dropzoneActive_z97l", g = "dropzoneEmpty_9tHX", p = "dropzoneIcon_m3ug", z = {
|
|
4
|
+
header: o,
|
|
5
|
+
grid: n,
|
|
6
|
+
card: r,
|
|
7
|
+
dropzone: t,
|
|
8
|
+
cardDragging: c,
|
|
9
|
+
thumbnail: d,
|
|
10
|
+
controls: e,
|
|
11
|
+
action: a,
|
|
12
|
+
mainBadge: s,
|
|
13
|
+
dropzoneActive: i,
|
|
14
|
+
dropzoneEmpty: g,
|
|
15
|
+
dropzoneIcon: p
|
|
8
16
|
};
|
|
9
17
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
a as action,
|
|
19
|
+
r as card,
|
|
20
|
+
c as cardDragging,
|
|
21
|
+
e as controls,
|
|
22
|
+
z as default,
|
|
23
|
+
t as dropzone,
|
|
24
|
+
i as dropzoneActive,
|
|
25
|
+
g as dropzoneEmpty,
|
|
26
|
+
p as dropzoneIcon,
|
|
27
|
+
n as grid,
|
|
28
|
+
o as header,
|
|
29
|
+
s as mainBadge,
|
|
30
|
+
d as thumbnail
|
|
15
31
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export * from './radio-groups';
|
|
|
69
69
|
export * from './section-wrapper';
|
|
70
70
|
export * from './select';
|
|
71
71
|
export * from './settings-hint';
|
|
72
|
+
export * from './settings-info-block';
|
|
72
73
|
export * from './sidepanel';
|
|
73
74
|
export * from './sidepanel-header';
|
|
74
75
|
export * from './skeleton';
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { ButtonArrow as C } from "./button-arrow/component.js";
|
|
|
11
11
|
import { Calendar as g } from "./calendar/component.js";
|
|
12
12
|
import { useCalendar as E } from "./calendar/use-calendar.js";
|
|
13
13
|
import { usePeriod as P } from "./calendar/use-period.js";
|
|
14
|
-
import { DAYS_IN_WEEK as F, MONTHS_IN_YEAR as R, SUNDAY_INDEX as
|
|
14
|
+
import { DAYS_IN_WEEK as F, MONTHS_IN_YEAR as R, SUNDAY_INDEX as B, dateInLimits as y, limitDate as L, monthName as b, russianWeekDay as w } from "./calendar/utils.js";
|
|
15
15
|
import { CalendarInput as N } from "./calendar-input/component.js";
|
|
16
16
|
import { DATE_FORMAT as H, DATE_MASK as v, IS_BROWSER as G, NATIVE_DATE_FORMAT as U, SUPPORTS_INPUT_TYPE_DATE as q, isCompleteDateInput as z, isInputDateSupported as K, parseDateString as V } from "./calendar-input/utils.js";
|
|
17
17
|
import { Card as J } from "./card/component.js";
|
|
@@ -31,7 +31,7 @@ import { Dot as go } from "./dot/component.js";
|
|
|
31
31
|
import { EmptyPage as Eo } from "./empty-page/component.js";
|
|
32
32
|
import { FilterTag as Po } from "./filter-tag/component.js";
|
|
33
33
|
import { Flex as Fo } from "./flex/component.js";
|
|
34
|
-
import { FlexColumns as
|
|
34
|
+
import { FlexColumns as Bo } from "./flex-columns/component.js";
|
|
35
35
|
import { Footer as Lo } from "./footer/component.js";
|
|
36
36
|
import { FiltersForm as wo } from "./form/templates/filters-form/index.js";
|
|
37
37
|
import { FormControl as No } from "./form-control/component.js";
|
|
@@ -52,7 +52,7 @@ import { InfoBlockHeader as gr } from "./info-block-header/component.js";
|
|
|
52
52
|
import { InfoBlockItem as Er } from "./info-block-item/component.js";
|
|
53
53
|
import { InfoBlockWrapper as Pr } from "./info-block-wrapper/component.js";
|
|
54
54
|
import { Input as Fr } from "./input/component.js";
|
|
55
|
-
import { InputAutocomplete as
|
|
55
|
+
import { InputAutocomplete as Br } from "./input-autocomplete/component.js";
|
|
56
56
|
import { InputGhost as Lr } from "./input-ghost/component.js";
|
|
57
57
|
import { Link as wr } from "./link/component.js";
|
|
58
58
|
import { ListAllert as Nr } from "./list-allert/component.js";
|
|
@@ -78,7 +78,7 @@ import { Radio as ge } from "./radio/component.js";
|
|
|
78
78
|
import { RadioGroup as Ee } from "./radio-group/component.js";
|
|
79
79
|
import { RadioGroups as Pe } from "./radio-groups/component.js";
|
|
80
80
|
import { SectionWrapper as Fe } from "./section-wrapper/component.js";
|
|
81
|
-
import { Select as
|
|
81
|
+
import { Select as Be } from "./select/component.js";
|
|
82
82
|
import { Arrow as Le } from "./select/components/arrow/component.js";
|
|
83
83
|
import { BaseSelect as we } from "./select/components/base-select/component.js";
|
|
84
84
|
import { SelectField as Ne } from "./select/components/field/component.js";
|
|
@@ -90,45 +90,46 @@ import { useLazyLoading as je } from "./select/presets/use-lazy-loading/index.js
|
|
|
90
90
|
import { useSelectWithLoading as Xe } from "./select/presets/use-select-with-loading/hook.js";
|
|
91
91
|
import { convertToOptions as Ze, isGroup as $e, isOptionShape as ot, joinOptions as rt, lastIndexOf as et, processOptions as tt, useVisibleOptions as pt } from "./select/utils.js";
|
|
92
92
|
import { SettingsHint as ft } from "./settings-hint/component.js";
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
111
|
-
import {
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
import {
|
|
116
|
-
import {
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
121
|
-
import {
|
|
122
|
-
import {
|
|
123
|
-
import {
|
|
124
|
-
import {
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
import {
|
|
128
|
-
import {
|
|
129
|
-
import {
|
|
93
|
+
import { SettingsInfoBlock as xt } from "./settings-info-block/component.js";
|
|
94
|
+
import { Sidepanel as it } from "./sidepanel/component.js";
|
|
95
|
+
import { SidepanelHeader as ut } from "./sidepanel-header/component.js";
|
|
96
|
+
import { Skeleton as dt } from "./skeleton/component.js";
|
|
97
|
+
import { Space as ct } from "./space/component.js";
|
|
98
|
+
import { Spinner as Ot } from "./spinner/component.js";
|
|
99
|
+
import { Stack as It } from "./stack/component.js";
|
|
100
|
+
import { StackingContext as Ct, stackingOrder as Dt } from "./stack/context.js";
|
|
101
|
+
import { Status as kt } from "./status/component.js";
|
|
102
|
+
import { SteppedProgressBar as Mt, useSteps as Pt } from "./stepped-progress-bar/index.js";
|
|
103
|
+
import { Sticker as Ft } from "./sticker/component.js";
|
|
104
|
+
import { SuffixInput as Bt } from "./suffix-input/component.js";
|
|
105
|
+
import { SuperListHeader as Lt } from "./super-list-header/component.js";
|
|
106
|
+
import { SuperListItem as wt } from "./super-list-item/component.js";
|
|
107
|
+
import { Switch as Nt } from "./switch/component.js";
|
|
108
|
+
import { Table as Ht } from "./table/component.js";
|
|
109
|
+
import { TableCell as Gt } from "./table/components/cell/component.js";
|
|
110
|
+
import { TableStatus as qt } from "./table-status/component.js";
|
|
111
|
+
import { Tag as Kt } from "./tag/component.js";
|
|
112
|
+
import { TagsList as jt } from "./tags-list/component.js";
|
|
113
|
+
import { Textarea as Xt } from "./textarea/component.js";
|
|
114
|
+
import { LOACAL_STORAGE_THEME_KEY as Zt, STYLE_TAG_ID as $t, THEME as op, THEME_DATA_ATTR as rp, ThemeProvider as ep, useTheme as tp } from "./theme-provider/component.js";
|
|
115
|
+
import { defaultThemes as mp } from "./theme-provider/default-themes.js";
|
|
116
|
+
import { Toast as ap } from "./toast/component.js";
|
|
117
|
+
import { ToastNotifier as sp } from "./toast-notifier/component.js";
|
|
118
|
+
import { ToastPlate as np } from "./toast-plate/component.js";
|
|
119
|
+
import { Tooltip as lp } from "./tooltip/component.js";
|
|
120
|
+
import { Typography as Sp } from "./typography/component.js";
|
|
121
|
+
import { add as Tp, addDays as Op, addMonths as hp, addYears as Ip, eachDayOfInterval as Ap, eachMonthOfInterval as Cp, eachYearOfInterval as Dp, endOfDay as gp, endOfISOWeek as kp, endOfWeek as Ep, endOfYear as Mp, format as Pp, isAfter as _p, isBefore as Fp, isEqual as Rp, isLastDayOfMonth as Bp, isSameDay as yp, isSameMonth as Lp, isSameYear as bp, isThisMonth as wp, isThisYear as Wp, isToday as Np, isWithinInterval as Yp, lastDayOfMonth as Hp, max as vp, min as Gp, parse as Up, parseISO as qp, startOfDay as zp, startOfISOWeek as Kp, startOfMonth as Vp, startOfWeek as jp, startOfYear as Jp, subDays as Xp, subMonths as Qp, subWeeks as Zp, subYears as $p, weekDaysShort as om } from "./utils/date/index.js";
|
|
122
|
+
import { debounce as em } from "./utils/debounce.js";
|
|
123
|
+
import { AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR as pm, THINSP as mm, formatAmount as fm, isCurrencyFirst as am } from "./utils/format-amount/util.js";
|
|
124
|
+
import { formatDate as sm, locales as im } from "./utils/format-date/index.js";
|
|
125
|
+
import { safeStringify as um } from "./utils/safe-stringify.js";
|
|
126
|
+
import { showCompactSuccess as dm, showError as Sm, showSuccess as cm } from "./utils/show-toast/index.js";
|
|
127
|
+
import { splitAmount as Om } from "./utils/split-amount/util.js";
|
|
128
|
+
import { capitalize as Im } from "./utils/string.js";
|
|
129
|
+
import { WelcomeContainer as Cm } from "./welcome-layout/component.js";
|
|
130
|
+
import { withSuffix as gm } from "./with-suffix/component.js";
|
|
130
131
|
export {
|
|
131
|
-
|
|
132
|
+
pm as AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR,
|
|
132
133
|
e as Amount,
|
|
133
134
|
p as AmountInput,
|
|
134
135
|
Le as Arrow,
|
|
@@ -168,7 +169,7 @@ export {
|
|
|
168
169
|
Po as FilterTag,
|
|
169
170
|
wo as FiltersForm,
|
|
170
171
|
Fo as Flex,
|
|
171
|
-
|
|
172
|
+
Bo as FlexColumns,
|
|
172
173
|
Lo as Footer,
|
|
173
174
|
qo as Form,
|
|
174
175
|
No as FormControl,
|
|
@@ -185,9 +186,9 @@ export {
|
|
|
185
186
|
Er as InfoBlockItem,
|
|
186
187
|
Pr as InfoBlockWrapper,
|
|
187
188
|
Fr as Input,
|
|
188
|
-
|
|
189
|
+
Br as InputAutocomplete,
|
|
189
190
|
Lr as InputGhost,
|
|
190
|
-
|
|
191
|
+
Zt as LOACAL_STORAGE_THEME_KEY,
|
|
191
192
|
ue as LabeledButton,
|
|
192
193
|
wr as Link,
|
|
193
194
|
Nr as ListAllert,
|
|
@@ -219,111 +220,112 @@ export {
|
|
|
219
220
|
Pe as RadioGroups,
|
|
220
221
|
T as Radiuses,
|
|
221
222
|
or as Row,
|
|
222
|
-
|
|
223
|
-
|
|
223
|
+
$t as STYLE_TAG_ID,
|
|
224
|
+
B as SUNDAY_INDEX,
|
|
224
225
|
q as SUPPORTS_INPUT_TYPE_DATE,
|
|
225
226
|
Fe as SectionWrapper,
|
|
226
|
-
|
|
227
|
+
Be as Select,
|
|
227
228
|
Ne as SelectField,
|
|
228
229
|
ft as SettingsHint,
|
|
229
|
-
xt as
|
|
230
|
-
it as
|
|
231
|
-
ut as
|
|
232
|
-
dt as
|
|
230
|
+
xt as SettingsInfoBlock,
|
|
231
|
+
it as Sidepanel,
|
|
232
|
+
ut as SidepanelHeader,
|
|
233
|
+
dt as Skeleton,
|
|
234
|
+
ct as Space,
|
|
233
235
|
O as Spaces,
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
236
|
+
Ot as Spinner,
|
|
237
|
+
It as Stack,
|
|
238
|
+
Ct as StackingContext,
|
|
239
|
+
kt as Status,
|
|
240
|
+
Mt as SteppedProgressBar,
|
|
241
|
+
Ft as Sticker,
|
|
242
|
+
Bt as SuffixInput,
|
|
243
|
+
Lt as SuperListHeader,
|
|
244
|
+
wt as SuperListItem,
|
|
245
|
+
Nt as Switch,
|
|
246
|
+
op as THEME,
|
|
247
|
+
rp as THEME_DATA_ATTR,
|
|
248
|
+
mm as THINSP,
|
|
249
|
+
Ht as Table,
|
|
250
|
+
Gt as TableCell,
|
|
251
|
+
qt as TableStatus,
|
|
252
|
+
Kt as Tag,
|
|
253
|
+
jt as TagsList,
|
|
254
|
+
Xt as Textarea,
|
|
255
|
+
ep as ThemeProvider,
|
|
256
|
+
ap as Toast,
|
|
257
|
+
sp as ToastNotifier,
|
|
258
|
+
np as ToastPlate,
|
|
259
|
+
lp as Tooltip,
|
|
260
|
+
Sp as Typography,
|
|
259
261
|
Ke as VirtualOptionsList,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
262
|
+
Cm as WelcomeContainer,
|
|
263
|
+
Tp as add,
|
|
264
|
+
Op as addDays,
|
|
265
|
+
hp as addMonths,
|
|
266
|
+
Ip as addYears,
|
|
267
|
+
Im as capitalize,
|
|
266
268
|
Ko as connect,
|
|
267
269
|
Ze as convertToOptions,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
270
|
+
y as dateInLimits,
|
|
271
|
+
em as debounce,
|
|
272
|
+
mp as defaultThemes,
|
|
273
|
+
Ap as eachDayOfInterval,
|
|
274
|
+
Cp as eachMonthOfInterval,
|
|
275
|
+
Dp as eachYearOfInterval,
|
|
276
|
+
gp as endOfDay,
|
|
277
|
+
kp as endOfISOWeek,
|
|
278
|
+
Ep as endOfWeek,
|
|
279
|
+
Mp as endOfYear,
|
|
280
|
+
Pp as format,
|
|
281
|
+
fm as formatAmount,
|
|
282
|
+
sm as formatDate,
|
|
283
|
+
_p as isAfter,
|
|
284
|
+
Fp as isBefore,
|
|
283
285
|
z as isCompleteDateInput,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
+
am as isCurrencyFirst,
|
|
287
|
+
Rp as isEqual,
|
|
286
288
|
$e as isGroup,
|
|
287
289
|
K as isInputDateSupported,
|
|
288
|
-
|
|
290
|
+
Bp as isLastDayOfMonth,
|
|
289
291
|
ot as isOptionShape,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
292
|
+
yp as isSameDay,
|
|
293
|
+
Lp as isSameMonth,
|
|
294
|
+
bp as isSameYear,
|
|
295
|
+
wp as isThisMonth,
|
|
296
|
+
Wp as isThisYear,
|
|
297
|
+
Np as isToday,
|
|
298
|
+
Yp as isWithinInterval,
|
|
297
299
|
rt as joinOptions,
|
|
298
|
-
|
|
300
|
+
Hp as lastDayOfMonth,
|
|
299
301
|
et as lastIndexOf,
|
|
300
302
|
L as limitDate,
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
303
|
+
im as locales,
|
|
304
|
+
vp as max,
|
|
305
|
+
Gp as min,
|
|
304
306
|
b as monthName,
|
|
305
|
-
|
|
307
|
+
Up as parse,
|
|
306
308
|
V as parseDateString,
|
|
307
|
-
|
|
309
|
+
qp as parseISO,
|
|
308
310
|
tt as processOptions,
|
|
309
311
|
w as russianWeekDay,
|
|
310
|
-
|
|
312
|
+
um as safeStringify,
|
|
311
313
|
io as showAlert,
|
|
312
|
-
|
|
314
|
+
dm as showCompactSuccess,
|
|
313
315
|
no as showConfirm,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
316
|
+
Sm as showError,
|
|
317
|
+
cm as showSuccess,
|
|
318
|
+
Om as splitAmount,
|
|
319
|
+
Dt as stackingOrder,
|
|
320
|
+
zp as startOfDay,
|
|
321
|
+
Kp as startOfISOWeek,
|
|
322
|
+
Vp as startOfMonth,
|
|
323
|
+
jp as startOfWeek,
|
|
324
|
+
Jp as startOfYear,
|
|
325
|
+
Xp as subDays,
|
|
326
|
+
Qp as subMonths,
|
|
327
|
+
Zp as subWeeks,
|
|
328
|
+
$p as subYears,
|
|
327
329
|
Or as textSizes,
|
|
328
330
|
E as useCalendar,
|
|
329
331
|
xr as useClickOutside,
|
|
@@ -338,10 +340,10 @@ export {
|
|
|
338
340
|
P as usePeriod,
|
|
339
341
|
ur as usePrevious,
|
|
340
342
|
Xe as useSelectWithLoading,
|
|
341
|
-
|
|
342
|
-
|
|
343
|
+
Pt as useSteps,
|
|
344
|
+
tp as useTheme,
|
|
343
345
|
pt as useVisibleOptions,
|
|
344
|
-
|
|
346
|
+
om as weekDaysShort,
|
|
345
347
|
Xo as withFormik,
|
|
346
|
-
|
|
348
|
+
gm as withSuffix
|
|
347
349
|
};
|
package/dist/input/component.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as Be } from "react/jsx-runtime";
|
|
2
2
|
import I from "classnames";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
3
|
+
import $e from "@alphakits/icons/dist/CancelM";
|
|
4
|
+
import ke from "@alphakits/icons/dist/AlertCircleM";
|
|
5
|
+
import ye from "@alphakits/icons/dist/CheckmarkCircleM";
|
|
6
|
+
import Fe from "@alphakits/icons/dist/EyeM";
|
|
7
|
+
import xe, { useRef as je, useId as He, useState as k, useMemo as Pe, useCallback as u, Fragment as Te } from "react";
|
|
8
|
+
import Ae from "react-merge-refs";
|
|
9
9
|
import { Button as E } from "../button/component.js";
|
|
10
|
-
import { FormControl as
|
|
11
|
-
import { useFocus as
|
|
10
|
+
import { FormControl as Ce } from "../form-control/component.js";
|
|
11
|
+
import { useFocus as Se } from "../hooks/useFocus/index.js";
|
|
12
12
|
import s from "./index.module.css.js";
|
|
13
|
-
import { getDefaultInputMode as
|
|
14
|
-
const
|
|
13
|
+
import { getDefaultInputMode as De } from "./utils/get-default-input-mode.js";
|
|
14
|
+
const _e = xe.forwardRef(
|
|
15
15
|
({
|
|
16
16
|
size: q = "m",
|
|
17
17
|
type: b = "text",
|
|
@@ -51,27 +51,28 @@ const Ze = Fe.forwardRef(
|
|
|
51
51
|
inputMode: ie,
|
|
52
52
|
enterKeyHint: re,
|
|
53
53
|
id: ne,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
autoComplete: ce = "off",
|
|
55
|
+
...le
|
|
56
|
+
}, de) => {
|
|
57
|
+
const l = H === void 0, n = je(null), ue = He(), [fe] = Se(n, "keyboard"), [h, P] = k(!1), [me, T] = k(se || ""), [p, pe] = k(!1), d = ne ?? ue, A = m ? `${d}-label` : void 0, w = i || f ? `${d}-hint` : void 0, M = t && typeof t == "string" ? `${d}-error` : void 0, N = l ? me : H ?? "", B = !!N, C = typeof t == "string" ? t : "", ve = Pe(
|
|
57
58
|
() => [C ? M : null, i || f ? w : null].filter(Boolean).join(" ") || void 0,
|
|
58
59
|
[C, M, i, f, w]
|
|
59
|
-
), $ = f ? `${N.length}/${x}` : "",
|
|
60
|
+
), $ = f ? `${N.length}/${x}` : "", Ie = i && $ ? `${i} · ${$}` : $ || i, S = b === "password", D = S && ae && !a && !c, be = S && p ? "text" : b, ge = ie ?? De(b), v = K && B && !a && !c, Re = u(
|
|
60
61
|
(e) => {
|
|
61
62
|
c || P(!0), g && g(e);
|
|
62
63
|
},
|
|
63
64
|
[g, c]
|
|
64
|
-
),
|
|
65
|
+
), Ve = u(
|
|
65
66
|
(e) => {
|
|
66
67
|
P(!1), R && R(e);
|
|
67
68
|
},
|
|
68
69
|
[R]
|
|
69
|
-
),
|
|
70
|
+
), he = u(
|
|
70
71
|
(e) => {
|
|
71
72
|
r && r(e, { value: e.target.value }), l && T(e.target.value);
|
|
72
73
|
},
|
|
73
74
|
[r, l]
|
|
74
|
-
),
|
|
75
|
+
), we = u(
|
|
75
76
|
(e) => {
|
|
76
77
|
v && (l && T(""), r && r(
|
|
77
78
|
{
|
|
@@ -83,9 +84,9 @@ const Ze = Fe.forwardRef(
|
|
|
83
84
|
), V && V(e), n.current?.focus());
|
|
84
85
|
},
|
|
85
86
|
[v, r, V, l]
|
|
86
|
-
),
|
|
87
|
-
|
|
88
|
-
}, []),
|
|
87
|
+
), Me = u(() => {
|
|
88
|
+
pe((e) => !e), n.current?.focus();
|
|
89
|
+
}, []), Ne = () => (v || j || y || t || D) && /* @__PURE__ */ Be(Te, { children: [
|
|
89
90
|
v && /* @__PURE__ */ o(
|
|
90
91
|
E,
|
|
91
92
|
{
|
|
@@ -94,8 +95,8 @@ const Ze = Fe.forwardRef(
|
|
|
94
95
|
disabled: a,
|
|
95
96
|
"aria-label": "Очистить",
|
|
96
97
|
className: s.clearButton,
|
|
97
|
-
onClick:
|
|
98
|
-
children: /* @__PURE__ */ o(
|
|
98
|
+
onClick: we,
|
|
99
|
+
children: /* @__PURE__ */ o($e, { className: s.clearIcon, "aria-hidden": "true" })
|
|
99
100
|
}
|
|
100
101
|
),
|
|
101
102
|
D && /* @__PURE__ */ o(
|
|
@@ -107,9 +108,9 @@ const Ze = Fe.forwardRef(
|
|
|
107
108
|
"aria-label": p ? "Скрыть пароль" : "Показать пароль",
|
|
108
109
|
"aria-pressed": p,
|
|
109
110
|
className: s.passwordRevealButton,
|
|
110
|
-
onClick:
|
|
111
|
+
onClick: Me,
|
|
111
112
|
children: /* @__PURE__ */ o(
|
|
112
|
-
|
|
113
|
+
Fe,
|
|
113
114
|
{
|
|
114
115
|
className: I(s.passwordRevealIcon, {
|
|
115
116
|
[s.passwordRevealIconHidden]: p
|
|
@@ -119,17 +120,17 @@ const Ze = Fe.forwardRef(
|
|
|
119
120
|
)
|
|
120
121
|
}
|
|
121
122
|
),
|
|
122
|
-
t && /* @__PURE__ */ o(
|
|
123
|
-
y && !t && /* @__PURE__ */ o(
|
|
123
|
+
t && /* @__PURE__ */ o(ke, { className: s.errorIcon, "aria-hidden": "true" }),
|
|
124
|
+
y && !t && /* @__PURE__ */ o(ye, { className: s.successIcon, "aria-hidden": "true" }),
|
|
124
125
|
j
|
|
125
126
|
] });
|
|
126
127
|
return /* @__PURE__ */ o(
|
|
127
|
-
|
|
128
|
+
Ce,
|
|
128
129
|
{
|
|
129
130
|
ref: oe,
|
|
130
131
|
className: I(L, h && Y, B && Z),
|
|
131
132
|
fieldClassName: I(Q, {
|
|
132
|
-
[s.focusVisible]:
|
|
133
|
+
[s.focusVisible]: fe
|
|
133
134
|
}),
|
|
134
135
|
labelClassName: W,
|
|
135
136
|
addonsClassName: X,
|
|
@@ -141,13 +142,13 @@ const Ze = Fe.forwardRef(
|
|
|
141
142
|
focused: h,
|
|
142
143
|
error: t,
|
|
143
144
|
label: m,
|
|
144
|
-
hint:
|
|
145
|
+
hint: Ie,
|
|
145
146
|
inputId: d,
|
|
146
147
|
labelId: A,
|
|
147
148
|
hintId: w,
|
|
148
149
|
errorId: M,
|
|
149
150
|
leftAddons: _,
|
|
150
|
-
rightAddons:
|
|
151
|
+
rightAddons: Ne(),
|
|
151
152
|
bottomAddons: G,
|
|
152
153
|
onClick: O,
|
|
153
154
|
onMouseDown: ee,
|
|
@@ -155,7 +156,8 @@ const Ze = Fe.forwardRef(
|
|
|
155
156
|
children: /* @__PURE__ */ o(
|
|
156
157
|
"input",
|
|
157
158
|
{
|
|
158
|
-
...
|
|
159
|
+
...le,
|
|
160
|
+
autoComplete: ce,
|
|
159
161
|
id: d,
|
|
160
162
|
className: I(
|
|
161
163
|
s.input,
|
|
@@ -165,21 +167,21 @@ const Ze = Fe.forwardRef(
|
|
|
165
167
|
U
|
|
166
168
|
),
|
|
167
169
|
disabled: a,
|
|
168
|
-
onBlur:
|
|
169
|
-
onFocus:
|
|
170
|
-
onChange:
|
|
170
|
+
onBlur: Ve,
|
|
171
|
+
onFocus: Re,
|
|
172
|
+
onChange: he,
|
|
171
173
|
maxLength: x,
|
|
172
|
-
ref:
|
|
173
|
-
type:
|
|
174
|
+
ref: Ae([de, n]),
|
|
175
|
+
type: be,
|
|
174
176
|
value: N,
|
|
175
177
|
readOnly: c,
|
|
176
|
-
inputMode:
|
|
178
|
+
inputMode: ge,
|
|
177
179
|
enterKeyHint: re,
|
|
178
180
|
"data-test-id": J,
|
|
179
181
|
"data-error": !!t,
|
|
180
182
|
"aria-invalid": t ? !0 : void 0,
|
|
181
183
|
"aria-required": F || void 0,
|
|
182
|
-
"aria-describedby":
|
|
184
|
+
"aria-describedby": ve,
|
|
183
185
|
"aria-labelledby": m ? A : void 0
|
|
184
186
|
}
|
|
185
187
|
)
|
|
@@ -188,5 +190,5 @@ const Ze = Fe.forwardRef(
|
|
|
188
190
|
}
|
|
189
191
|
);
|
|
190
192
|
export {
|
|
191
|
-
|
|
193
|
+
_e as Input
|
|
192
194
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import l from "@alphakits/icons/dist/SearchM";
|
|
3
|
+
import c from "classnames";
|
|
4
4
|
import t from "./index.module.css.js";
|
|
5
5
|
const x = ({
|
|
6
6
|
value: e,
|
|
@@ -9,11 +9,12 @@ const x = ({
|
|
|
9
9
|
leftAddons: m,
|
|
10
10
|
block: n,
|
|
11
11
|
size: p = "m"
|
|
12
|
-
}) => /* @__PURE__ */ i("div", { className:
|
|
13
|
-
/* @__PURE__ */ o("span", { className: t.leftAddons, children: m || /* @__PURE__ */ o(
|
|
12
|
+
}) => /* @__PURE__ */ i("div", { className: c(t.input, t[p], { [t.block]: n }), children: [
|
|
13
|
+
/* @__PURE__ */ o("span", { className: t.leftAddons, children: m || /* @__PURE__ */ o(l, {}) }),
|
|
14
14
|
/* @__PURE__ */ o(
|
|
15
15
|
"input",
|
|
16
16
|
{
|
|
17
|
+
autoComplete: "off",
|
|
17
18
|
value: e,
|
|
18
19
|
onChange: (a) => {
|
|
19
20
|
r(a.target.value);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type SettingsInfoBlockView = 'accent' | 'positive' | 'attention' | 'neutral';
|
|
3
|
+
export type SettingsInfoBlockProps = {
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string | React.ReactNode;
|
|
6
|
+
text?: string;
|
|
7
|
+
view?: SettingsInfoBlockView;
|
|
8
|
+
icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
9
|
+
actionLabel?: string;
|
|
10
|
+
onAction?: () => void;
|
|
11
|
+
actionHref?: string;
|
|
12
|
+
action?: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
dataTestId?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const SettingsInfoBlock: React.FC<SettingsInfoBlockProps>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import f from "@alphakits/icons/dist/InfoMarkS";
|
|
3
|
+
import g from "classnames";
|
|
4
|
+
import { Typography as p } from "../typography/component.js";
|
|
5
|
+
import i from "./index.module.css.js";
|
|
6
|
+
const y = ({
|
|
7
|
+
title: e,
|
|
8
|
+
description: n,
|
|
9
|
+
text: o
|
|
10
|
+
}) => {
|
|
11
|
+
const r = typeof o == "string" ? o.split(`
|
|
12
|
+
`).filter(Boolean) : [];
|
|
13
|
+
return {
|
|
14
|
+
title: e ?? r[0],
|
|
15
|
+
description: n ?? (r.length > 1 ? r.slice(1).join(`
|
|
16
|
+
`) : void 0)
|
|
17
|
+
};
|
|
18
|
+
}, k = ({ label: e, href: n, onClick: o }) => n ? /* @__PURE__ */ t("a", { href: n, className: i.actionLink, children: e }) : /* @__PURE__ */ t("button", { type: "button", className: i.actionLink, onClick: o, children: e }), T = ({
|
|
19
|
+
title: e,
|
|
20
|
+
description: n,
|
|
21
|
+
text: o,
|
|
22
|
+
view: r = "accent",
|
|
23
|
+
icon: h = f,
|
|
24
|
+
actionLabel: l,
|
|
25
|
+
onAction: a,
|
|
26
|
+
actionHref: d,
|
|
27
|
+
action: m,
|
|
28
|
+
className: v,
|
|
29
|
+
dataTestId: u
|
|
30
|
+
}) => {
|
|
31
|
+
const s = y({ title: e, description: n, text: o }), N = !!s.description;
|
|
32
|
+
return /* @__PURE__ */ c(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: g(
|
|
36
|
+
i.component,
|
|
37
|
+
i[r],
|
|
38
|
+
{ [i.withDescription]: N },
|
|
39
|
+
v
|
|
40
|
+
),
|
|
41
|
+
"data-test-id": u,
|
|
42
|
+
role: "note",
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ t("div", { className: i.iconWrap, "aria-hidden": "true", children: /* @__PURE__ */ t(h, { className: i.icon }) }),
|
|
45
|
+
/* @__PURE__ */ c("div", { className: i.body, children: [
|
|
46
|
+
/* @__PURE__ */ c("div", { className: i.text, children: [
|
|
47
|
+
s.title && /* @__PURE__ */ t(
|
|
48
|
+
p.Text,
|
|
49
|
+
{
|
|
50
|
+
tag: "div",
|
|
51
|
+
view: "title",
|
|
52
|
+
weight: "bold",
|
|
53
|
+
color: "primary",
|
|
54
|
+
className: i.title,
|
|
55
|
+
children: s.title
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
s.description ? /* @__PURE__ */ t(
|
|
59
|
+
p.Text,
|
|
60
|
+
{
|
|
61
|
+
tag: "div",
|
|
62
|
+
view: "primary-small",
|
|
63
|
+
color: "secondary",
|
|
64
|
+
weight: "regular",
|
|
65
|
+
className: i.description,
|
|
66
|
+
children: s.description
|
|
67
|
+
}
|
|
68
|
+
) : null
|
|
69
|
+
] }),
|
|
70
|
+
m ? /* @__PURE__ */ t("div", { className: i.actionSlot, children: m }) : l && (d || a) ? /* @__PURE__ */ t(k, { label: l, href: d, onClick: a }) : null
|
|
71
|
+
] })
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
T as SettingsInfoBlock
|
|
78
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.component_o8T0{--info-glow: color-mix(in srgb, var(--color-graphic-accent) 12%, transparent);--info-glow-secondary: color-mix(in srgb, var(--color-graphic-accent) 5%, transparent);--info-border: color-mix(in srgb, var(--color-graphic-accent) 16%, transparent);--info-surface-top: color-mix(in srgb, var(--color-bg-accent) 8%, var(--color-bg-primary));--info-surface-bottom: color-mix(in srgb, var(--color-bg-secondary) 97%, var(--color-bg-accent) 3%);--info-icon-top: color-mix(in srgb, var(--color-graphic-accent) 12%, var(--color-bg-primary));--info-icon-bottom: color-mix(in srgb, var(--color-graphic-accent) 5%, var(--color-bg-secondary));--info-icon-border: color-mix(in srgb, var(--color-graphic-accent) 18%, transparent);--info-icon-color: var(--color-graphic-accent);--info-action-color: var(--color-text-accent);--info-shine: color-mix(in srgb, var(--color-bg-primary) 16%, transparent);position:relative;display:flex;align-items:flex-start;gap:14px;width:100%;padding:16px;box-sizing:border-box;border-radius:var(--radius-m, 12px);overflow:hidden;isolation:isolate;border:1px solid var(--info-border);background:radial-gradient(140% 130% at 0% 0%,var(--info-glow) 0%,transparent 62%),radial-gradient(100% 100% at 100% 100%,var(--info-glow-secondary) 0%,transparent 58%),linear-gradient(160deg,var(--info-surface-top) 0%,var(--info-surface-bottom) 100%)}.component_o8T0:after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(118deg,transparent 42%,var(--info-shine) 50%,transparent 58%);opacity:.22;z-index:0}.accent_xPRy{--info-glow: color-mix(in srgb, var(--color-graphic-accent) 13%, transparent);--info-glow-secondary: color-mix(in srgb, var(--color-graphic-accent) 6%, transparent);--info-border: color-mix(in srgb, var(--color-graphic-accent) 17%, transparent);--info-surface-top: color-mix(in srgb, var(--color-bg-accent) 9%, var(--color-bg-primary));--info-surface-bottom: color-mix(in srgb, var(--color-bg-secondary) 96%, var(--color-bg-accent) 4%);--info-icon-top: color-mix(in srgb, var(--color-graphic-accent) 13%, var(--color-bg-primary));--info-icon-bottom: color-mix(in srgb, var(--color-graphic-accent) 6%, var(--color-bg-secondary));--info-icon-border: color-mix(in srgb, var(--color-graphic-accent) 19%, transparent);--info-icon-color: var(--color-graphic-accent);--info-action-color: var(--color-text-accent)}.positive_oXy6{--info-glow: color-mix(in srgb, var(--color-graphic-positive) 12%, transparent);--info-glow-secondary: color-mix(in srgb, var(--color-graphic-positive) 5%, transparent);--info-border: color-mix(in srgb, var(--color-graphic-positive) 16%, transparent);--info-surface-top: color-mix(in srgb, var(--color-bg-positive) 8%, var(--color-bg-primary));--info-surface-bottom: color-mix(in srgb, var(--color-bg-secondary) 97%, var(--color-bg-positive) 3%);--info-icon-top: color-mix(in srgb, var(--color-graphic-positive) 12%, var(--color-bg-primary));--info-icon-bottom: color-mix(in srgb, var(--color-graphic-positive) 5%, var(--color-bg-secondary));--info-icon-border: color-mix(in srgb, var(--color-graphic-positive) 18%, transparent);--info-icon-color: var(--color-graphic-positive);--info-action-color: var(--color-graphic-positive)}.attention_YEcR{--info-glow: color-mix(in srgb, var(--color-graphic-attention) 14%, transparent);--info-glow-secondary: color-mix(in srgb, var(--color-graphic-attention) 6%, transparent);--info-border: color-mix(in srgb, var(--color-graphic-attention) 18%, transparent);--info-surface-top: color-mix(in srgb, var(--color-bg-attention) 9%, var(--color-bg-primary));--info-surface-bottom: color-mix(in srgb, var(--color-bg-secondary) 96%, var(--color-bg-attention) 4%);--info-icon-top: color-mix(in srgb, var(--color-graphic-attention) 13%, var(--color-bg-primary));--info-icon-bottom: color-mix(in srgb, var(--color-graphic-attention) 6%, var(--color-bg-secondary));--info-icon-border: color-mix(in srgb, var(--color-graphic-attention) 20%, transparent);--info-icon-color: var(--color-graphic-attention);--info-action-color: var(--color-graphic-attention)}.neutral_kGcO{--info-glow: color-mix(in srgb, var(--color-graphic-secondary) 8%, transparent);--info-glow-secondary: color-mix(in srgb, var(--color-graphic-secondary) 4%, transparent);--info-border: color-mix(in srgb, var(--color-graphic-secondary) 14%, transparent);--info-surface-top: color-mix(in srgb, var(--color-bg-thirdly) 55%, var(--color-bg-primary));--info-surface-bottom: var(--color-bg-secondary);--info-icon-top: color-mix(in srgb, var(--color-graphic-secondary) 8%, var(--color-bg-primary));--info-icon-bottom: var(--color-bg-thirdly);--info-icon-border: color-mix(in srgb, var(--color-graphic-secondary) 16%, transparent);--info-icon-color: var(--color-graphic-secondary);--info-action-color: var(--color-text-accent)}.iconWrap_hNjZ{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;flex-shrink:0;margin-top:1px;border-radius:var(--radius-s, 8px);color:var(--info-icon-color);background:linear-gradient(160deg,var(--info-icon-top) 0%,var(--info-icon-bottom) 100%);border:1px solid var(--info-icon-border);box-shadow:inset 0 1px color-mix(in srgb,var(--color-bg-primary) 14%,transparent)}.icon_OelS{width:16px;height:16px}.body_wJ5l{position:relative;z-index:1;display:flex;flex:1;flex-direction:column;align-items:flex-start;gap:8px;min-width:0}.withDescription_qBJy .body_wJ5l{gap:10px}.text_vw-f{display:flex;flex-direction:column;gap:4px;min-width:0}.title_vsWo,.description_1kEU{margin:0}.actionLink_FKEf{-webkit-appearance:none;appearance:none;margin:0;padding:0;border:none;background:transparent;font:inherit;font-size:13px;font-weight:600;line-height:1.35;color:var(--info-action-color);cursor:pointer;text-decoration:none;transition:opacity .15s ease}.actionLink_FKEf:hover{opacity:.78;text-decoration:underline;text-underline-offset:2px}.actionLink_FKEf:focus-visible{outline:2px solid color-mix(in srgb,var(--info-icon-color) 45%,transparent);outline-offset:2px;border-radius:4px}.actionSlot_UNOt{display:flex;align-items:center}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as __css from './index.css';
|
|
2
|
+
export const __cssModule = __css;
|
|
3
|
+
const t = "component_o8T0", o = "accent_xPRy", n = "positive_oXy6", c = "attention_YEcR", i = "neutral_kGcO", e = "iconWrap_hNjZ", s = "icon_OelS", a = "body_wJ5l", p = "withDescription_qBJy", _ = "text_vw-f", l = "title_vsWo", r = "description_1kEU", d = "actionLink_FKEf", y = "actionSlot_UNOt", k = {
|
|
4
|
+
component: t,
|
|
5
|
+
accent: o,
|
|
6
|
+
positive: n,
|
|
7
|
+
attention: c,
|
|
8
|
+
neutral: i,
|
|
9
|
+
iconWrap: e,
|
|
10
|
+
icon: s,
|
|
11
|
+
body: a,
|
|
12
|
+
withDescription: p,
|
|
13
|
+
text: _,
|
|
14
|
+
title: l,
|
|
15
|
+
description: r,
|
|
16
|
+
actionLink: d,
|
|
17
|
+
actionSlot: y
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
o as accent,
|
|
21
|
+
d as actionLink,
|
|
22
|
+
y as actionSlot,
|
|
23
|
+
c as attention,
|
|
24
|
+
a as body,
|
|
25
|
+
t as component,
|
|
26
|
+
k as default,
|
|
27
|
+
r as description,
|
|
28
|
+
s as icon,
|
|
29
|
+
e as iconWrap,
|
|
30
|
+
i as neutral,
|
|
31
|
+
n as positive,
|
|
32
|
+
_ as text,
|
|
33
|
+
l as title,
|
|
34
|
+
p as withDescription
|
|
35
|
+
};
|