@alphakits/ui 2.4.4 → 2.4.6

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/index.js CHANGED
@@ -3,15 +3,15 @@ import { AmountInput as p } from "./amount-input/component.js";
3
3
  import { Avatar as f } from "./avatar/component.js";
4
4
  import { BackButton as x } from "./back-button/component.js";
5
5
  import { Badge as i } from "./badge/component.js";
6
- import { BaseCard as l } from "./base-card/component.js";
6
+ import { BaseCard as u } from "./base-card/component.js";
7
7
  import { BottomSheet as d } from "./bottom-sheet/component.js";
8
- import { Box as T, Radiuses as c, Spaces as O } from "./box/component.js";
8
+ import { Box as c, Radiuses as T, Spaces as O } from "./box/component.js";
9
9
  import { Button as I } from "./button/component.js";
10
10
  import { ButtonArrow as C } from "./button-arrow/component.js";
11
11
  import { Calendar as k } from "./calendar/component.js";
12
12
  import { useCalendar as M } 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 B, dateInLimits as L, limitDate as y, monthName as b, russianWeekDay as W } from "./calendar/utils.js";
14
+ import { DAYS_IN_WEEK as F, MONTHS_IN_YEAR as R, SUNDAY_INDEX as B, dateInLimits as L, limitDate as y, 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 v, DATE_MASK as G, IS_BROWSER as H, 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";
@@ -22,8 +22,8 @@ import { CheckboxGroups as to } from "./checkbox-lists/component.js";
22
22
  import { CollapsableRow as mo } from "./collapsable-row/component.js";
23
23
  import { Collapse as ao } from "./collapse/component.js";
24
24
  import { ConfirmPopup as so, showAlert as io, showConfirm as no } from "./confirm-popup/component.js";
25
- import { CopyButton as uo } from "./copy-button/component.js";
26
- import { FormattedDate as To } from "./date/component.js";
25
+ import { CopyButton as lo } from "./copy-button/component.js";
26
+ import { FormattedDate as co } from "./date/component.js";
27
27
  import { DateSwitcher as Oo } from "./date-switcher/component.js";
28
28
  import { DecoratedItem as Io } from "./decorated-item/component.js";
29
29
  import { Divider as Co } from "./divider/component.js";
@@ -33,7 +33,7 @@ import { FilterTag as Po } from "./filter-tag/component.js";
33
33
  import { Flex as Fo } from "./flex/component.js";
34
34
  import { FlexColumns as Bo } from "./flex-columns/component.js";
35
35
  import { Footer as yo } from "./footer/component.js";
36
- import { FiltersForm as Wo } from "./form/templates/filters-form/index.js";
36
+ import { FiltersForm as wo } from "./form/templates/filters-form/index.js";
37
37
  import { FormControl as No } from "./form-control/component.js";
38
38
  import { ErrorMessage as vo, FastField as Go, Field as Ho, FieldArray as Uo, Form as qo, Formik as zo, connect as Ko, useField as Vo, useFormik as jo, useFormikContext as Jo, withFormik as Xo } from "formik";
39
39
  import { Col as Zo, Grid as $o, Row as or } from "./grid/component.js";
@@ -42,9 +42,9 @@ import { useCrudFormRequests as pr } from "./hooks/use-crud-form-requests/index.
42
42
  import { useGetOne as fr } from "./hooks/use-get-one/index.js";
43
43
  import { useClickOutside as xr } from "./hooks/useClickOutside/index.js";
44
44
  import { useFocus as ir } from "./hooks/useFocus/index.js";
45
- import { usePrevious as lr } from "./hooks/usePrevious/index.js";
45
+ import { usePrevious as ur } from "./hooks/usePrevious/index.js";
46
46
  import { IconButton as dr } from "./icon-button/component.js";
47
- import { Image as Tr } from "./image/component.js";
47
+ import { Image as cr } from "./image/component.js";
48
48
  import { textSizes as Or } from "./image/types.js";
49
49
  import { ImageGallery as Ir } from "./image-gallery/component.js";
50
50
  import { ImageUploader as Cr } from "./image-uploader/component.js";
@@ -54,7 +54,7 @@ import { InfoBlockWrapper as Pr } from "./info-block-wrapper/component.js";
54
54
  import { Input as Fr } from "./input/component.js";
55
55
  import { InputAutocomplete as Br } from "./input-autocomplete/component.js";
56
56
  import { InputGhost as yr } from "./input-ghost/component.js";
57
- import { Link as Wr } from "./link/component.js";
57
+ import { Link as wr } from "./link/component.js";
58
58
  import { ListAllert as Nr } from "./list-allert/component.js";
59
59
  import { Loader as vr } from "./loader/component.js";
60
60
  import { MaskedInput as Hr, PLACEHOLDER_CHAR as Ur } from "./masked-input/component.js";
@@ -68,9 +68,9 @@ import { Padding as pe } from "./padding/component.js";
68
68
  import { PageContainer as fe } from "./page-container/component.js";
69
69
  import { PageLoading as xe } from "./page-loading/component.js";
70
70
  import { PageWithControls as ie } from "./page-with-controls/component.js";
71
- import { LabeledButton as le } from "./picker-button/common/labeled-button/index.js";
71
+ import { LabeledButton as ue } from "./picker-button/common/labeled-button/index.js";
72
72
  import { PickerButton as de } from "./picker-button/component.js";
73
- import { Popover as Te } from "./popover/component.js";
73
+ import { Popover as ce } from "./popover/component.js";
74
74
  import { Portal as Oe } from "./portal/component.js";
75
75
  import { ProgressBar as Ie } from "./progress-bar/component.js";
76
76
  import { ProgressIndex as Ce } from "./progress-index/component.js";
@@ -80,7 +80,7 @@ import { RadioGroups as Pe } from "./radio-groups/component.js";
80
80
  import { SectionWrapper as Fe } from "./section-wrapper/component.js";
81
81
  import { Select as Be } from "./select/component.js";
82
82
  import { Arrow as ye } from "./select/components/arrow/component.js";
83
- import { BaseSelect as We } from "./select/components/base-select/component.js";
83
+ import { BaseSelect as we } from "./select/components/base-select/component.js";
84
84
  import { SelectField as Ne } from "./select/components/field/component.js";
85
85
  import { Optgroup as ve } from "./select/components/optgroup/component.js";
86
86
  import { Option as He } from "./select/components/option/component.js";
@@ -92,9 +92,9 @@ import { convertToOptions as Ze, isGroup as $e, isOptionShape as ot, joinOptions
92
92
  import { Sidepanel as ft } from "./sidepanel/component.js";
93
93
  import { SidepanelHeader as xt } from "./sidepanel-header/component.js";
94
94
  import { Skeleton as it } from "./skeleton/component.js";
95
- import { Space as lt } from "./space/component.js";
95
+ import { Space as ut } from "./space/component.js";
96
96
  import { Spinner as dt } from "./spinner/component.js";
97
- import { Stack as Tt } from "./stack/component.js";
97
+ import { Stack as ct } from "./stack/component.js";
98
98
  import { StackingContext as Ot, stackingOrder as ht } from "./stack/context.js";
99
99
  import { Status as At } from "./status/component.js";
100
100
  import { SteppedProgressBar as Dt, useSteps as kt } from "./stepped-progress-bar/index.js";
@@ -103,7 +103,7 @@ import { SuffixInput as Pt } from "./suffix-input/component.js";
103
103
  import { SuperListHeader as Ft } from "./super-list-header/component.js";
104
104
  import { SuperListItem as Bt } from "./super-list-item/component.js";
105
105
  import { Switch as yt } from "./switch/component.js";
106
- import { Table as Wt } from "./table/component.js";
106
+ import { Table as wt } from "./table/component.js";
107
107
  import { TableCell as Nt } from "./table/components/cell/component.js";
108
108
  import { TableStatus as vt } from "./table-status/component.js";
109
109
  import { Tag as Ht } from "./tag/component.js";
@@ -116,16 +116,16 @@ import { ToastNotifier as mp } from "./toast-notifier/component.js";
116
116
  import { ToastPlate as ap } from "./toast-plate/component.js";
117
117
  import { Tooltip as sp } from "./tooltip/component.js";
118
118
  import { Typography as np } from "./typography/component.js";
119
- import { add as up, addDays as dp, addMonths as Sp, addYears as Tp, eachDayOfInterval as cp, eachMonthOfInterval as Op, eachYearOfInterval as hp, endOfDay as Ip, endOfISOWeek as Ap, endOfWeek as Cp, endOfYear as Dp, format as kp, isAfter as Ep, isBefore as Mp, isEqual as gp, isLastDayOfMonth as Pp, isSameDay as _p, isSameMonth as Fp, isSameYear as Rp, isThisMonth as Bp, isThisYear as Lp, isToday as yp, isWithinInterval as bp, lastDayOfMonth as Wp, max as wp, min as Np, parse as Yp, parseISO as vp, startOfDay as Gp, startOfISOWeek as Hp, startOfMonth as Up, startOfWeek as qp, startOfYear as zp, subDays as Kp, subMonths as Vp, subWeeks as jp, subYears as Jp, weekDaysShort as Xp } from "./utils/date/index.js";
119
+ import { add as lp, addDays as dp, addMonths as Sp, addYears as cp, eachDayOfInterval as Tp, eachMonthOfInterval as Op, eachYearOfInterval as hp, endOfDay as Ip, endOfISOWeek as Ap, endOfWeek as Cp, endOfYear as Dp, format as kp, isAfter as Ep, isBefore as Mp, isEqual as gp, isLastDayOfMonth as Pp, isSameDay as _p, isSameMonth as Fp, isSameYear as Rp, isThisMonth as Bp, isThisYear as Lp, isToday as yp, isWithinInterval as bp, lastDayOfMonth as wp, max as Wp, min as Np, parse as Yp, parseISO as vp, startOfDay as Gp, startOfISOWeek as Hp, startOfMonth as Up, startOfWeek as qp, startOfYear as zp, subDays as Kp, subMonths as Vp, subWeeks as jp, subYears as Jp, weekDaysShort as Xp } from "./utils/date/index.js";
120
120
  import { debounce as Zp } from "./utils/debounce.js";
121
121
  import { AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR as om, THINSP as rm, formatAmount as em } from "./utils/format-amount/util.js";
122
122
  import { formatDate as pm, locales as mm } from "./utils/format-date/index.js";
123
123
  import { safeStringify as am } from "./utils/safe-stringify.js";
124
- import { showError as sm, showSuccess as im } from "./utils/show-toast/index.js";
124
+ import { showCompactSuccess as sm, showError as im, showSuccess as nm } from "./utils/show-toast/index.js";
125
125
  import { splitAmount as lm } from "./utils/split-amount/util.js";
126
- import { capitalize as dm } from "./utils/string.js";
126
+ import { capitalize as Sm } from "./utils/string.js";
127
127
  import { WelcomeContainer as Tm } from "./welcome-layout/component.js";
128
- import { withSuffix as Om } from "./with-suffix/component.js";
128
+ import { withSuffix as hm } from "./with-suffix/component.js";
129
129
  export {
130
130
  om as AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR,
131
131
  e as Amount,
@@ -134,10 +134,10 @@ export {
134
134
  f as Avatar,
135
135
  x as BackButton,
136
136
  i as Badge,
137
- l as BaseCard,
138
- We as BaseSelect,
137
+ u as BaseCard,
138
+ we as BaseSelect,
139
139
  d as BottomSheet,
140
- T as Box,
140
+ c as Box,
141
141
  I as Button,
142
142
  C as ButtonArrow,
143
143
  k as Calendar,
@@ -151,7 +151,7 @@ export {
151
151
  mo as CollapsableRow,
152
152
  ao as Collapse,
153
153
  so as ConfirmPopup,
154
- uo as CopyButton,
154
+ lo as CopyButton,
155
155
  v as DATE_FORMAT,
156
156
  G as DATE_MASK,
157
157
  F as DAYS_IN_WEEK,
@@ -165,19 +165,19 @@ export {
165
165
  Ho as Field,
166
166
  Uo as FieldArray,
167
167
  Po as FilterTag,
168
- Wo as FiltersForm,
168
+ wo as FiltersForm,
169
169
  Fo as Flex,
170
170
  Bo as FlexColumns,
171
171
  yo as Footer,
172
172
  qo as Form,
173
173
  No as FormControl,
174
- To as FormattedDate,
174
+ co as FormattedDate,
175
175
  zo as Formik,
176
176
  $o as Grid,
177
177
  er as HeaderSearch,
178
178
  H as IS_BROWSER,
179
179
  dr as IconButton,
180
- Tr as Image,
180
+ cr as Image,
181
181
  Ir as ImageGallery,
182
182
  Cr as ImageUploader,
183
183
  kr as InfoBlockHeader,
@@ -187,8 +187,8 @@ export {
187
187
  Br as InputAutocomplete,
188
188
  yr as InputGhost,
189
189
  jt as LOACAL_STORAGE_THEME_KEY,
190
- le as LabeledButton,
191
- Wr as Link,
190
+ ue as LabeledButton,
191
+ wr as Link,
192
192
  Nr as ListAllert,
193
193
  vr as Loader,
194
194
  R as MONTHS_IN_YEAR,
@@ -209,14 +209,14 @@ export {
209
209
  xe as PageLoading,
210
210
  ie as PageWithControls,
211
211
  de as PickerButton,
212
- Te as Popover,
212
+ ce as Popover,
213
213
  Oe as Portal,
214
214
  Ie as ProgressBar,
215
215
  Ce as ProgressIndex,
216
216
  ke as Radio,
217
217
  Me as RadioGroup,
218
218
  Pe as RadioGroups,
219
- c as Radiuses,
219
+ T as Radiuses,
220
220
  or as Row,
221
221
  Jt as STYLE_TAG_ID,
222
222
  B as SUNDAY_INDEX,
@@ -227,10 +227,10 @@ export {
227
227
  ft as Sidepanel,
228
228
  xt as SidepanelHeader,
229
229
  it as Skeleton,
230
- lt as Space,
230
+ ut as Space,
231
231
  O as Spaces,
232
232
  dt as Spinner,
233
- Tt as Stack,
233
+ ct as Stack,
234
234
  Ot as StackingContext,
235
235
  At as Status,
236
236
  Dt as SteppedProgressBar,
@@ -242,7 +242,7 @@ export {
242
242
  Xt as THEME,
243
243
  Qt as THEME_DATA_ATTR,
244
244
  rm as THINSP,
245
- Wt as Table,
245
+ wt as Table,
246
246
  Nt as TableCell,
247
247
  vt as TableStatus,
248
248
  Ht as Tag,
@@ -256,17 +256,17 @@ export {
256
256
  np as Typography,
257
257
  Ke as VirtualOptionsList,
258
258
  Tm as WelcomeContainer,
259
- up as add,
259
+ lp as add,
260
260
  dp as addDays,
261
261
  Sp as addMonths,
262
- Tp as addYears,
263
- dm as capitalize,
262
+ cp as addYears,
263
+ Sm as capitalize,
264
264
  Ko as connect,
265
265
  Ze as convertToOptions,
266
266
  L as dateInLimits,
267
267
  Zp as debounce,
268
268
  rp as defaultThemes,
269
- cp as eachDayOfInterval,
269
+ Tp as eachDayOfInterval,
270
270
  Op as eachMonthOfInterval,
271
271
  hp as eachYearOfInterval,
272
272
  Ip as endOfDay,
@@ -292,23 +292,24 @@ export {
292
292
  yp as isToday,
293
293
  bp as isWithinInterval,
294
294
  rt as joinOptions,
295
- Wp as lastDayOfMonth,
295
+ wp as lastDayOfMonth,
296
296
  et as lastIndexOf,
297
297
  y as limitDate,
298
298
  mm as locales,
299
- wp as max,
299
+ Wp as max,
300
300
  Np as min,
301
301
  b as monthName,
302
302
  Yp as parse,
303
303
  V as parseDateString,
304
304
  vp as parseISO,
305
305
  tt as processOptions,
306
- W as russianWeekDay,
306
+ w as russianWeekDay,
307
307
  am as safeStringify,
308
308
  io as showAlert,
309
+ sm as showCompactSuccess,
309
310
  no as showConfirm,
310
- sm as showError,
311
- im as showSuccess,
311
+ im as showError,
312
+ nm as showSuccess,
312
313
  lm as splitAmount,
313
314
  ht as stackingOrder,
314
315
  Gp as startOfDay,
@@ -332,12 +333,12 @@ export {
332
333
  je as useLazyLoading,
333
334
  oe as useMatchMedia,
334
335
  P as usePeriod,
335
- lr as usePrevious,
336
+ ur as usePrevious,
336
337
  Xe as useSelectWithLoading,
337
338
  kt as useSteps,
338
339
  $t as useTheme,
339
340
  pt as useVisibleOptions,
340
341
  Xp as weekDaysShort,
341
342
  Xo as withFormik,
342
- Om as withSuffix
343
+ hm as withSuffix
343
344
  };
@@ -1,24 +1,24 @@
1
1
  import { jsxs as w, jsx as i } from "react/jsx-runtime";
2
2
  import b from "classnames";
3
3
  import { useState as v, useLayoutEffect as x, useCallback as k, useEffect as E } from "react";
4
- import { ButtonArrow as g } from "../../../button-arrow/component.js";
5
- import { showConfirm as F } from "../../../confirm-popup/component.js";
4
+ import { ButtonArrow as d } from "../../../button-arrow/component.js";
5
+ import { showConfirm as g } from "../../../confirm-popup/component.js";
6
6
  import s from "./index.module.css.js";
7
- const y = {
7
+ const C = {
8
8
  s: 488,
9
9
  m: 888,
10
10
  full: "96%"
11
- }, h = 102, N = (e) => e === "full" ? `calc(-96vw - ${h}px)` : -y[e] - h, R = ({ modal: e, t: r, index: a, dirtyModals: m, closeModal: l, currentModalId: c }) => {
12
- const f = N(e.props.size), [C, p] = v(f);
11
+ }, h = 102, F = (e) => e === "full" ? `calc(-96vw - ${h}px)` : -C[e] - h, R = ({ modal: e, t: r, index: a, dirtyModals: m, closeModal: l, currentModalId: c }) => {
12
+ const f = F(e.props.size), [y, p] = v(f);
13
13
  x(() => {
14
14
  const o = requestAnimationFrame(() => p(0));
15
15
  return () => cancelAnimationFrame(o);
16
16
  }, [e.id]);
17
17
  const u = k(
18
- (o) => m[o] ? F({
18
+ (o) => m[o] ? g({
19
19
  title: r("common:exitConfirm"),
20
- confirmText: r("common:yes"),
21
- cancelText: r("common:no"),
20
+ confirmText: r("common:Да"),
21
+ cancelText: r("common:Нет"),
22
22
  confirmView: "negative"
23
23
  }) : Promise.resolve(!0),
24
24
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -53,13 +53,20 @@ const y = {
53
53
  className: b(s.right, s.content),
54
54
  style: {
55
55
  zIndex: 9999999 + a,
56
- width: y[e.props.size],
57
- right: C
56
+ width: C[e.props.size],
57
+ right: y
58
58
  },
59
59
  children: /* @__PURE__ */ w("div", { className: s.inner, children: [
60
- /* @__PURE__ */ i(e.modal, { ...e.props, close: () => t() }),
60
+ /* @__PURE__ */ i(
61
+ e.modal,
62
+ {
63
+ ...e.props,
64
+ modalId: e.id,
65
+ close: () => t()
66
+ }
67
+ ),
61
68
  e.props.showCloser !== !1 && /* @__PURE__ */ i(
62
- g,
69
+ d,
63
70
  {
64
71
  className: s.button,
65
72
  size: "s",
@@ -2,42 +2,42 @@ import d, { useRef as S, useCallback as s, useEffect as b } from "react";
2
2
  import { v4 as h } from "uuid";
3
3
  import { deletePropertyById as v } from "../utils/delete-property-by-id.js";
4
4
  const x = (n) => {
5
- const [r, l] = d.useState([]), [M, f] = d.useState(""), [p, a] = d.useState({}), c = S(n);
6
- c.current = n;
5
+ const [r, l] = d.useState([]), [f, a] = d.useState(""), [p, c] = d.useState({}), u = S(n);
6
+ u.current = n;
7
7
  const i = s((t) => {
8
- a((e) => v(e, t)), l((e) => e.filter((o) => o.id !== t));
9
- }, []), u = s((t) => {
10
- l((e) => [...e, t]);
8
+ c((e) => v(e, t)), l((e) => e.filter((o) => o.id !== t));
9
+ }, []), M = s((t) => {
10
+ l((e) => [...e, t]), a(t.id);
11
11
  }, []), m = s((t, e) => {
12
- t && a((o) => o[t] === e ? o : {
12
+ t && c((o) => o[t] === e ? o : {
13
13
  ...o,
14
14
  [t]: e
15
15
  });
16
16
  }, []);
17
17
  return b(() => {
18
18
  const t = [...r].pop()?.id;
19
- f(t || ""), document.body.style.overflow = r.length ? "hidden" : "unset";
19
+ a(t || ""), document.body.style.overflow = r.length ? "hidden" : "unset";
20
20
  }, [r]), {
21
21
  openModal: s(
22
22
  (t, e = "s", o = !0) => (y, I) => {
23
23
  const R = h();
24
- u({
24
+ M({
25
25
  id: R,
26
26
  modal: t,
27
27
  props: {
28
28
  size: e,
29
29
  showCloser: o,
30
30
  closeCallback: I,
31
- t: c.current,
31
+ t: u.current,
32
32
  ...y
33
33
  }
34
34
  });
35
35
  },
36
- [u]
36
+ [M]
37
37
  ),
38
38
  modals: r,
39
39
  setModalDirty: m,
40
- currentModalId: M,
40
+ currentModalId: f,
41
41
  dirtyModals: p,
42
42
  closeModal: i
43
43
  };
@@ -2,6 +2,7 @@
2
2
  type ModalProps = {
3
3
  closeCallback: () => void;
4
4
  close: () => void;
5
+ modalId?: string;
5
6
  size: ModalSize;
6
7
  showCloser?: boolean;
7
8
  t: TFunction;
@@ -12,7 +13,7 @@ export type TFunction = (field: string, options?: {
12
13
  [optionName: string]: any;
13
14
  }) => string;
14
15
  export type ModalSize = 's' | 'm' | 'full';
15
- export type OwnModalProps<T> = Omit<T, 'close' | 't'>;
16
+ export type OwnModalProps<T> = Omit<T, 'close' | 't' | 'modalId'>;
16
17
  export type ModalObject = {
17
18
  modal: React.FC<ModalProps>;
18
19
  id: string;