@alphakits/ui 2.4.8 → 2.5.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.
@@ -1,82 +1,79 @@
1
- import { jsxs as z, jsx as c } from "react/jsx-runtime";
2
- import u from "classnames";
3
- import { useRef as p, useState as I, useMemo as N, useEffect as E } from "react";
4
- import { getDataTestId as j } from "../../__internal/utils/get-data-test-id.js";
5
- import { useFocus as k } from "../../hooks/useFocus/index.js";
6
- import { Typography as v } from "../../typography/component.js";
7
- import { Pure as S } from "../pure/component.js";
1
+ import { jsxs as y, jsx as n } from "react/jsx-runtime";
2
+ import c from "classnames";
3
+ import { useRef as E, useCallback as T } from "react";
4
+ import { getDataTestId as N } from "../../__internal/utils/get-data-test-id.js";
5
+ import { useFocus as _ } from "../../hooks/useFocus/index.js";
6
+ import { Typography as f } from "../../typography/component.js";
7
+ import { Pure as A } from "../pure/component.js";
8
8
  import r from "./index.module.css.js";
9
- const P = ({
10
- className: w,
11
- dataTestId: y,
12
- title: e,
13
- subtitle: m,
14
- size: h = "m",
15
- addon: b,
16
- compactAddon: g,
17
- singleLineTitle: s,
18
- showTitleTooltipOnOverflow: i
9
+ const p = (t, i) => T(
10
+ (o) => {
11
+ if (!i || !t) return;
12
+ const e = o.currentTarget, s = e.firstElementChild ?? e;
13
+ s.scrollWidth > s.clientWidth + 1 ? e.getAttribute("title") !== t && e.setAttribute("title", t) : e.hasAttribute("title") && e.removeAttribute("title");
14
+ },
15
+ [t, i]
16
+ ), u = (t) => typeof t == "string" || typeof t == "number" ? String(t) : void 0, R = ({
17
+ className: t,
18
+ dataTestId: i,
19
+ title: o,
20
+ subtitle: e,
21
+ size: s = "m",
22
+ addon: a,
23
+ compactAddon: h,
24
+ singleLineTitle: l,
25
+ showTitleTooltipOnOverflow: g
19
26
  }) => {
20
- const d = p(null), a = p(null), [x] = k(d, "keyboard"), [R, f] = I(!1), n = N(
21
- () => typeof e == "string" || typeof e == "number" ? String(e) : void 0,
22
- [e]
23
- );
24
- return E(() => {
25
- if (!s || !i || !n) {
26
- f(!1);
27
- return;
28
- }
29
- const t = a.current;
30
- if (!t) return;
31
- const o = () => {
32
- f(t.scrollWidth > t.clientWidth);
33
- };
34
- if (o(), typeof ResizeObserver < "u") {
35
- const l = new ResizeObserver(o);
36
- return l.observe(t), () => l.disconnect();
37
- }
38
- return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
39
- }, [s, i, n]), /* @__PURE__ */ z(
40
- S,
27
+ const m = E(null), [w] = _(m, "keyboard"), d = !!l && !!g, b = p(u(o), d), v = p(u(e), d);
28
+ return /* @__PURE__ */ y(
29
+ A,
41
30
  {
42
- slot: b,
43
- compact: g,
44
- className: u(r.component, { [r.focused]: x }, w),
45
- dataTestId: j("cell-action", y, !0),
31
+ slot: a,
32
+ compact: h,
33
+ className: c(r.component, { [r.focused]: w }, t),
34
+ dataTestId: N("cell-action", i, !0),
46
35
  tabIndex: 0,
47
- size: h,
48
- ref: d,
36
+ size: s,
37
+ ref: m,
49
38
  children: [
50
- e && /* @__PURE__ */ c(
39
+ o && /* @__PURE__ */ n(
51
40
  "div",
52
41
  {
53
- ref: a,
54
- className: u(r.title_wrap, {
55
- [r.single_line]: s
42
+ className: c(r.title_wrap, {
43
+ [r.single_line]: l
56
44
  }),
57
- title: R && i ? n : void 0,
58
- children: /* @__PURE__ */ c(
59
- v.Text,
45
+ onMouseEnter: b,
46
+ children: /* @__PURE__ */ n(
47
+ f.Text,
60
48
  {
61
49
  view: "title",
62
50
  color: "primary",
63
51
  weight: "medium",
64
52
  tag: "div",
65
53
  className: r.title,
66
- children: e
54
+ children: o
67
55
  }
68
56
  )
69
57
  }
70
58
  ),
71
- m && /* @__PURE__ */ c(
72
- v.Text,
59
+ e && /* @__PURE__ */ n(
60
+ "div",
73
61
  {
74
- weight: "medium",
75
- view: "caps",
76
- tag: "div",
77
- className: r.subtitle,
78
- color: "secondary",
79
- children: m
62
+ className: c(r.subtitle_wrap, {
63
+ [r.subtitle_single_line]: l
64
+ }),
65
+ onMouseEnter: v,
66
+ children: /* @__PURE__ */ n(
67
+ f.Text,
68
+ {
69
+ weight: "medium",
70
+ view: "caps",
71
+ tag: "div",
72
+ className: r.subtitle,
73
+ color: "secondary",
74
+ children: e
75
+ }
76
+ )
80
77
  }
81
78
  )
82
79
  ]
@@ -84,5 +81,5 @@ const P = ({
84
81
  );
85
82
  };
86
83
  export {
87
- P as Base
84
+ R as Base
88
85
  };
@@ -1 +1 @@
1
- .component_BNjZ{outline:none}.component_BNjZ .superEllipse_FONr{--super-ellipse-success-icon-color: var(--color-graphic-thirdly)}.component_BNjZ .iconMixColors_Zfj6{color:var(--color-graphic-primary)}.iconMixColors_Zfj6,.superEllipse_FONr{--super-ellipse-transition: fill .15s ease-in-out;--super-ellipse-icon-transition: color .15s ease-in-out;transition:transform .15s ease-in-out}.title_wrap_10zd{display:flex;align-items:center}.title_wrap_10zd+.subtitle_OOoZ{margin-top:var(--gap-2xs)}.title_wrap_10zd{min-width:0}.title_VeYl{display:flex;align-items:center}.single_line_4wfi .title_VeYl{display:block;min-width:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.focused_ootM{outline:2px solid var(--focus-color);outline-offset:2px}
1
+ .component_BNjZ{outline:none}.component_BNjZ .superEllipse_FONr{--super-ellipse-success-icon-color: var(--color-graphic-thirdly)}.component_BNjZ .iconMixColors_Zfj6{color:var(--color-graphic-primary)}.iconMixColors_Zfj6,.superEllipse_FONr{--super-ellipse-transition: fill .15s ease-in-out;--super-ellipse-icon-transition: color .15s ease-in-out;transition:transform .15s ease-in-out}.title_wrap_10zd{display:flex;align-items:center}.title_wrap_10zd+.subtitle_OOoZ{margin-top:var(--gap-2xs)}.title_wrap_10zd{min-width:0}.title_VeYl{display:flex;align-items:center}.single_line_4wfi .title_VeYl{display:block;min-width:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.subtitle_wrap_xH8m{display:block;min-width:0}.subtitle_single_line_6DGn .subtitle_OOoZ{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.focused_ootM{outline:2px solid var(--focus-color);outline-offset:2px}
@@ -1,19 +1,23 @@
1
1
  import * as __css from './index.css';
2
2
  export const __cssModule = __css;
3
- const t = "component_BNjZ", e = "title_wrap_10zd", o = "subtitle_OOoZ", n = "title_VeYl", s = "single_line_4wfi", l = "focused_ootM", i = {
3
+ const t = "component_BNjZ", e = "title_wrap_10zd", l = "subtitle_OOoZ", s = "title_VeYl", i = "single_line_4wfi", n = "subtitle_wrap_xH8m", _ = "subtitle_single_line_6DGn", o = "focused_ootM", c = {
4
4
  component: t,
5
5
  title_wrap: e,
6
- subtitle: o,
7
- title: n,
8
- single_line: s,
9
- focused: l
6
+ subtitle: l,
7
+ title: s,
8
+ single_line: i,
9
+ subtitle_wrap: n,
10
+ subtitle_single_line: _,
11
+ focused: o
10
12
  };
11
13
  export {
12
14
  t as component,
13
- i as default,
14
- l as focused,
15
- s as single_line,
16
- o as subtitle,
17
- n as title,
15
+ c as default,
16
+ o as focused,
17
+ i as single_line,
18
+ l as subtitle,
19
+ _ as subtitle_single_line,
20
+ n as subtitle_wrap,
21
+ s as title,
18
22
  e as title_wrap
19
23
  };
@@ -1 +1 @@
1
- .container_WE0K{position:fixed;inset:0;display:flex;align-items:center;justify-content:center}.content_p1kc{background:var(--color-bg-primary);box-shadow:0 0 10px #0003}@media print{.content_p1kc{width:100%!important}}.button_js2W{position:absolute!important;top:36px;right:32px;z-index:999}.button_js2W.doubleModal_1ZTt{right:384px}.inner_Zsdb{height:100%;box-sizing:border-box;overflow:auto}.right_e065{position:fixed;top:0;right:0;bottom:0;transition:width .2s,opacity .2s,right .2s;transition-delay:width .1s;transition-timing-function:ease-in}.bg_8ZfP{transition:opacity .2s;background:#00000080;position:fixed;display:block;border:0;inset:0}@media screen and (max-width:823px){.right_e065,.center_nguy{max-width:100%!important;inset:0!important}.content_p1kc{width:100%!important;height:100%!important;max-height:100%!important;box-shadow:none!important;margin:0!important;border-radius:0!important}.button_js2W{top:24px!important;right:16px!important}}
1
+ .container_WE0K{position:fixed;inset:0;display:flex;align-items:center;justify-content:center}.content_p1kc{background:var(--color-bg-primary);box-shadow:0 0 10px #0003}@media print{.content_p1kc{width:100%!important}}.button_js2W{position:absolute!important;top:34px;right:32px;z-index:999}.button_js2W.doubleModal_1ZTt{right:384px}.inner_Zsdb{height:100%;box-sizing:border-box;overflow:auto}.right_e065{position:fixed;top:0;right:0;bottom:0;transition:width .2s,opacity .2s,right .2s;transition-delay:width .1s;transition-timing-function:ease-in}.bg_8ZfP{transition:opacity .2s;background:#00000080;position:fixed;display:block;border:0;inset:0}@media screen and (max-width:823px){.right_e065,.center_nguy{max-width:100%!important;inset:0!important}.content_p1kc{width:100%!important;height:100%!important;max-height:100%!important;box-shadow:none!important;margin:0!important;border-radius:0!important}.button_js2W{top:24px!important;right:16px!important}}
@@ -1,71 +1,74 @@
1
- import { jsx as s, jsxs as f } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
2
  import R from "@alphakits/icons/dist/ClockCircleM";
3
- import N from "classnames";
4
- import { forwardRef as g, useRef as j, useCallback as w } from "react";
5
- import G from "react-merge-refs";
6
- import { Button as L } from "../../../button/component.js";
7
- import { useVisibleOptions as M, isGroup as O } from "../../utils.js";
8
- import { Optgroup as V } from "../optgroup/component.js";
9
- import t from "./index.module.css.js";
10
- const W = () => {
11
- let e = 0;
12
- return () => e++;
13
- }, K = g(
3
+ import v from "@alphakits/icons/dist/PlusS";
4
+ import L from "classnames";
5
+ import { forwardRef as g, useRef as j, useCallback as G } from "react";
6
+ import w from "react-merge-refs";
7
+ import { useVisibleOptions as y, isGroup as I } from "../../utils.js";
8
+ import { Optgroup as M } from "../optgroup/component.js";
9
+ import r from "./index.module.css.js";
10
+ const O = () => {
11
+ let l = 0;
12
+ return () => l++;
13
+ }, J = g(
14
14
  ({
15
- size: e = "s",
16
- className: d,
17
- Option: m,
18
- options: l = [],
19
- actionButton: i,
20
- Optgroup: c = V,
21
- dataTestId: p,
22
- emptyPlaceholder: o,
23
- visibleOptions: u = 5,
15
+ size: l = "s",
16
+ className: u,
17
+ Option: o,
18
+ options: s = [],
19
+ actionButton: n,
20
+ Optgroup: m = M,
21
+ dataTestId: d,
22
+ emptyPlaceholder: i,
23
+ visibleOptions: p = 5,
24
24
  onScroll: b,
25
25
  toggleMenu: h,
26
- open: x
27
- }, C) => {
28
- const a = j(null), n = W(), v = w(
29
- (r) => /* @__PURE__ */ s(c, { label: r.label, size: e, children: r.options.map((k) => m({ option: k, index: n() })) }, r.label),
26
+ open: C
27
+ }, x) => {
28
+ const f = j(null), a = O(), N = G(
29
+ (e) => /* @__PURE__ */ t(m, { label: e.label, size: l, children: e.options.map((k) => o({ option: k, index: a() })) }, e.label),
30
30
  // eslint-disable-next-line react-hooks/exhaustive-deps
31
- [m, n, e, c]
31
+ [o, a, l, m]
32
32
  );
33
- return M({
34
- visibleOptions: u,
35
- listRef: a,
36
- open: x,
37
- invalidate: l
38
- }), l.length === 0 && !o && !i ? null : /* @__PURE__ */ f(
33
+ return y({
34
+ visibleOptions: p,
35
+ listRef: f,
36
+ open: C,
37
+ invalidate: s
38
+ }), s.length === 0 && !i && !n ? null : /* @__PURE__ */ c(
39
39
  "div",
40
40
  {
41
- className: N(t.optionsList, t[e], d),
42
- "data-test-id": p,
43
- ref: G([a, C]),
41
+ className: L(r.optionsList, r[l], u),
42
+ "data-test-id": d,
43
+ ref: w([f, x]),
44
44
  onScroll: b,
45
45
  children: [
46
- l.map(
47
- (r) => O(r) ? v(r) : m({ option: r, index: n() })
46
+ s.map(
47
+ (e) => I(e) ? N(e) : o({ option: e, index: a() })
48
48
  ),
49
- o && l.length === 0 && /* @__PURE__ */ f("div", { className: t.emptyPlaceholder, children: [
50
- /* @__PURE__ */ s(R, {}),
51
- o
49
+ i && s.length === 0 && /* @__PURE__ */ c("div", { className: r.emptyPlaceholder, children: [
50
+ /* @__PURE__ */ t(R, {}),
51
+ i
52
52
  ] }),
53
- !!i && /* @__PURE__ */ s("div", { className: t.actionButtonWrapper, children: /* @__PURE__ */ s(
54
- L,
53
+ !!n && /* @__PURE__ */ c(
54
+ "button",
55
55
  {
56
- view: "outlined",
57
- size: "xs",
56
+ type: "button",
57
+ className: r.actionButton,
58
58
  onClick: () => {
59
- i?.onClick(), h();
59
+ n?.onClick(), h();
60
60
  },
61
- children: i.label
61
+ children: [
62
+ /* @__PURE__ */ t("span", { className: r.actionButtonIcon, children: /* @__PURE__ */ t(v, {}) }),
63
+ /* @__PURE__ */ t("span", { className: r.actionButtonLabel, children: n.label })
64
+ ]
62
65
  }
63
- ) })
66
+ )
64
67
  ]
65
68
  }
66
69
  );
67
70
  }
68
71
  );
69
72
  export {
70
- K as OptionsList
73
+ J as OptionsList
71
74
  };
@@ -1 +1 @@
1
- :root{--select-error-color: var(--color-text-negative);--select-arrow-background: url(https://alfabank.st/icons/icon_chevron-for-select-down_m_black.svg);--select-arrow-hover-opacity: .7;--select-options-list-border-radius: 0 0 4px 4px;--select-options-list-box-shadow: var(--shadow-xs);--select-options-list-offset: 0;--select-options-list-top-padding: 0;--select-options-list-bottom-padding: 0;--select-options-list-empty-placeholder-color: var(--color-text-secondary);--select-option-divider-display: none;--select-option-divider-background: var(--color-border-primary);--select-option-left-padding: var(--gap-s);--select-option-right-padding: var(--gap-s);--select-option-l-left-padding: var(--gap-m);--select-option-l-right-padding: var(--gap-m);--select-option-background: var(--color-bg-primary);--select-option-selected-background: var(--color-bg-primary);--select-option-hover-background: var(--color-bg-secondary);--select-option-active-background: var(--color-bg-tertiary);--select-option-disabled-background: var(--color-bg-primary);--select-option-color: var(--color-text-primary);--select-option-selected-color: var(--color-text-primary);--select-option-hover-color: var(--color-text-primary);--select-option-active-color: var(--color-text-primary);--select-option-disabled-color: var(--color-text-secondary);--select-checkmark-margin: 0 var(--gap-xs) 0 0;--select-checkmark-size: 4px;--select-checkmark-order: 0;--select-checkmark-unselected-opacity: 0;--select-checkmark-background: var(--color-graphic-primary);--select-checkmark-border-radius: var(--border-radius-circle);--select-optgroup-color: var(--color-text-secondary);--select-optgroup-background: var(--color-bg-primary);--select-optgroup-left-padding: var(--gap-s);--select-optgroup-right-padding: var(--gap-s);--select-optgroup-l-left-padding: var(--gap-m);--select-optgroup-l-right-padding: var(--gap-m)}:root{--text-primary-color: var(--color-text-primary);--text-secondary-color: var(--color-text-secondary);--text-tertiary-color: var(--color-text-tertiary);--border-radius: 4px;--focus-color: var(--color-border-link);--font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, sans-serif;--disabled-cursor: not-allowed;--arrow-transform: rotate(180deg)}.optionsList_fDQ-{overflow:auto;width:100%;outline:none;box-sizing:border-box}.emptyPlaceholder_kjeP{padding:var(--gap-m) var(--gap-xl);color:var(--select-option-color);display:flex;align-items:center;font-family:var(--font-family)}.emptyPlaceholder_kjeP svg{color:var(--color-graphic-thirdly);margin-right:12px}.l_rGpg .emptyPlaceholder_kjeP,.xl_T-5w .emptyPlaceholder_kjeP{padding:var(--gap-xl) var(--gap-xl)}.actionButtonWrapper_WBIo{padding-bottom:var(--gap-s);padding-left:var(--gap-xl);padding-right:var(--select-option-right-padding)}
1
+ :root{--select-error-color: var(--color-text-negative);--select-arrow-background: url(https://alfabank.st/icons/icon_chevron-for-select-down_m_black.svg);--select-arrow-hover-opacity: .7;--select-options-list-border-radius: 0 0 4px 4px;--select-options-list-box-shadow: var(--shadow-xs);--select-options-list-offset: 0;--select-options-list-top-padding: 0;--select-options-list-bottom-padding: 0;--select-options-list-empty-placeholder-color: var(--color-text-secondary);--select-option-divider-display: none;--select-option-divider-background: var(--color-border-primary);--select-option-left-padding: var(--gap-s);--select-option-right-padding: var(--gap-s);--select-option-l-left-padding: var(--gap-m);--select-option-l-right-padding: var(--gap-m);--select-option-background: var(--color-bg-primary);--select-option-selected-background: var(--color-bg-primary);--select-option-hover-background: var(--color-bg-secondary);--select-option-active-background: var(--color-bg-tertiary);--select-option-disabled-background: var(--color-bg-primary);--select-option-color: var(--color-text-primary);--select-option-selected-color: var(--color-text-primary);--select-option-hover-color: var(--color-text-primary);--select-option-active-color: var(--color-text-primary);--select-option-disabled-color: var(--color-text-secondary);--select-checkmark-margin: 0 var(--gap-xs) 0 0;--select-checkmark-size: 4px;--select-checkmark-order: 0;--select-checkmark-unselected-opacity: 0;--select-checkmark-background: var(--color-graphic-primary);--select-checkmark-border-radius: var(--border-radius-circle);--select-optgroup-color: var(--color-text-secondary);--select-optgroup-background: var(--color-bg-primary);--select-optgroup-left-padding: var(--gap-s);--select-optgroup-right-padding: var(--gap-s);--select-optgroup-l-left-padding: var(--gap-m);--select-optgroup-l-right-padding: var(--gap-m)}:root{--text-primary-color: var(--color-text-primary);--text-secondary-color: var(--color-text-secondary);--text-tertiary-color: var(--color-text-tertiary);--border-radius: 4px;--focus-color: var(--color-border-link);--font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, sans-serif;--disabled-cursor: not-allowed;--arrow-transform: rotate(180deg)}.optionsList_fDQ-{overflow:auto;width:100%;outline:none;box-sizing:border-box}.emptyPlaceholder_kjeP{padding:var(--gap-m) var(--gap-xl);color:var(--select-option-color);display:flex;align-items:center;font-family:var(--font-family)}.emptyPlaceholder_kjeP svg{color:var(--color-graphic-thirdly);margin-right:12px}.l_rGpg .emptyPlaceholder_kjeP,.xl_T-5w .emptyPlaceholder_kjeP{padding:var(--gap-xl) var(--gap-xl)}.actionButton_5oxy{font-size:16px!important;line-height:20px;font-weight:400;display:flex;align-items:center;gap:var(--gap-s);width:100%;min-height:var(--size-s-height);padding:var(--gap-s) var(--select-option-left-padding);margin:0;background:var(--select-option-background);color:var(--color-text-main);border:0;border-top:1px solid var(--color-border-secondary);box-sizing:border-box;text-align:left;cursor:pointer;font-family:var(--font-family);transition:background-color .2s ease}.actionButton_5oxy:hover{background:var(--select-option-hover-background)}.actionButton_5oxy:active{background:var(--select-option-active-background)}.actionButton_5oxy:focus-visible{outline:2px solid var(--color-border-accent);outline-offset:-2px}.actionButtonIcon_r3FS{display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--color-graphic-main)}.actionButtonLabel_-jAV{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -1,17 +1,21 @@
1
1
  import * as __css from './index.css';
2
2
  export const __cssModule = __css;
3
- const t = "optionsList_fDQ-", o = "emptyPlaceholder_kjeP", e = "l_rGpg", n = "xl_T-5w", s = "actionButtonWrapper_WBIo", l = {
3
+ const t = "optionsList_fDQ-", o = "emptyPlaceholder_kjeP", n = "l_rGpg", c = "xl_T-5w", a = "actionButton_5oxy", l = "actionButtonIcon_r3FS", s = "actionButtonLabel_-jAV", e = {
4
4
  optionsList: t,
5
5
  emptyPlaceholder: o,
6
- l: e,
7
- xl: n,
8
- actionButtonWrapper: s
6
+ l: n,
7
+ xl: c,
8
+ actionButton: a,
9
+ actionButtonIcon: l,
10
+ actionButtonLabel: s
9
11
  };
10
12
  export {
11
- s as actionButtonWrapper,
12
- l as default,
13
+ a as actionButton,
14
+ l as actionButtonIcon,
15
+ s as actionButtonLabel,
16
+ e as default,
13
17
  o as emptyPlaceholder,
14
- e as l,
18
+ n as l,
15
19
  t as optionsList,
16
- n as xl
20
+ c as xl
17
21
  };
@@ -1,67 +1,68 @@
1
1
  import { jsxs as k, jsx as s } from "react/jsx-runtime";
2
2
  import v from "@alphakits/icons/dist/SearchS";
3
- import a, { useEffect as P, useState as C, useRef as b, useCallback as p, useMemo as j } from "react";
3
+ import f, { useState as C, useRef as P, useCallback as p, useMemo as b } from "react";
4
4
  import "../../../toast-notifier/component.js";
5
- import { useClickOutside as E } from "../../../hooks/useClickOutside/index.js";
6
- import { safeStringify as I } from "../../../utils/safe-stringify.js";
7
- import { Input as z } from "../../../input/component.js";
8
- import { BaseSelect as A } from "../base-select/component.js";
9
- import { OptionsList as B } from "../options-list/component.js";
10
- import F from "./index.module.css.js";
11
- const M = a.forwardRef(
12
- ({ inputProps: t, ...o }, n) => {
13
- const i = a.useRef(null), c = a.useRef(null);
14
- return P(() => {
15
- i.current?.focus();
16
- }, []), /* @__PURE__ */ k("div", { ref: n, children: [
5
+ import { useClickOutside as j } from "../../../hooks/useClickOutside/index.js";
6
+ import { safeStringify as F } from "../../../utils/safe-stringify.js";
7
+ import { Input as I } from "../../../input/component.js";
8
+ import { BaseSelect as M } from "../base-select/component.js";
9
+ import { OptionsList as z } from "../options-list/component.js";
10
+ import A from "./index.module.css.js";
11
+ const B = f.forwardRef(
12
+ ({ inputProps: e, ...o }, n) => {
13
+ const i = f.useRef(null), c = f.useRef(null);
14
+ return /* @__PURE__ */ k("div", { ref: n, children: [
17
15
  /* @__PURE__ */ s("div", { style: { padding: "5px 20px" }, children: /* @__PURE__ */ s(
18
- z,
16
+ I,
19
17
  {
20
18
  size: "s",
21
19
  leftAddons: /* @__PURE__ */ s(v, {}),
22
- ...t,
23
- fieldClassName: F.innerInput,
20
+ inputMode: "search",
21
+ enterKeyHint: "search",
22
+ autoFocus: !0,
23
+ ...e,
24
+ fieldClassName: A.innerInput,
24
25
  block: !0,
25
26
  ref: i
26
27
  }
27
28
  ) }),
28
- /* @__PURE__ */ s(B, { ...o, ref: c })
29
+ /* @__PURE__ */ s(z, { ...o, ref: c })
29
30
  ] });
30
31
  }
31
- ), V = ({
32
- options: t,
32
+ ), U = ({
33
+ options: e,
33
34
  searchType: o = "text",
34
35
  onChange: n,
35
36
  selected: i = "",
36
37
  ...c
37
38
  }) => {
38
- const [L, f] = C(t), [m, d] = C(""), h = b(null), S = p(
39
+ const [L, a] = C(e), [m, d] = C(""), h = P(null), S = p(
39
40
  (x, { value: l }) => {
40
41
  d(l);
41
42
  try {
42
- if (!l) return f(t);
43
- const y = String(l).toLowerCase(), g = t.reduce(
43
+ if (!l) return a(e);
44
+ const y = String(l).toLowerCase(), g = e.reduce(
44
45
  (u, r) => u.concat(r.options ? r.options : [r]),
45
46
  []
46
47
  ).filter(
47
- ({ key: u, value: r, content: w }) => I({ key: u, value: r, content: w }).toLowerCase().includes(y)
48
+ ({ key: u, value: r, content: w }) => F({ key: u, value: r, content: w }).toLowerCase().includes(y)
48
49
  );
49
- return f(g);
50
+ return a(g);
50
51
  } catch {
51
52
  return [];
52
53
  }
53
54
  },
54
- [t]
55
- ), e = p(() => {
56
- d(""), f(t);
57
- }, [t]), O = p(
55
+ [e]
56
+ ), t = p(() => {
57
+ d(""), a(e);
58
+ }, [e]), O = p(
58
59
  (x) => {
59
- n?.(x), e();
60
+ n?.(x), t();
60
61
  },
61
- [n, e]
62
+ [n, t]
62
63
  );
63
- E(h, e);
64
- const R = j(
64
+ j(h, t);
65
+ const R = b(
65
66
  () => ({
66
67
  ref: h,
67
68
  inputProps: {
@@ -69,27 +70,27 @@ const M = a.forwardRef(
69
70
  value: m,
70
71
  type: o,
71
72
  clear: !0,
72
- onClear: e
73
+ onClear: t
73
74
  }
74
75
  }),
75
- [S, m, o, e]
76
+ [S, m, o, t]
76
77
  );
77
78
  return /* @__PURE__ */ s(
78
- A,
79
+ M,
79
80
  {
80
81
  ...c,
81
82
  selected: i,
82
83
  onChange: O,
83
84
  showEmptyOptionsList: !0,
84
- OptionsList: M,
85
+ OptionsList: B,
85
86
  filteredOptions: L,
86
- options: t,
87
+ options: e,
87
88
  optionsListProps: R
88
89
  }
89
90
  );
90
91
  };
91
92
  export {
92
- M as CustomOptionsList,
93
- V as SelectSearch,
94
- I as safeStringify
93
+ B as CustomOptionsList,
94
+ U as SelectSearch,
95
+ F as safeStringify
95
96
  };
@@ -1 +1 @@
1
- .wrapper_QxqD{padding:28px 32px 12px;background-color:var(--color-bg-primary);box-sizing:border-box}.heading_XGDy{display:flex;justify-content:space-between;min-height:48px}.title_jwxc,.bottomAddons_3yzd{padding-bottom:8px;padding-top:8px}.rightAddons_aZFa{margin-right:48px;height:48px;display:flex;align-items:center}.noCloser_O7u0{margin-right:0!important}@media(max-width:823px){.wrapper_QxqD{padding:16px 16px 12px!important}}
1
+ .wrapper_QxqD{padding:28px 32px 12px;background-color:var(--color-bg-primary);box-sizing:border-box}.heading_XGDy{display:flex;justify-content:space-between;min-height:48px}.title_jwxc,.bottomAddons_3yzd{padding-bottom:8px;padding-top:8px}.rightAddons_aZFa{margin-right:54px;height:48px;display:flex;align-items:center}.noCloser_O7u0{margin-right:0!important}@media(max-width:823px){.wrapper_QxqD{padding:16px 16px 12px!important}}
@@ -1,59 +1,59 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as i } from "react/jsx-runtime";
2
2
  import s from "classnames";
3
- import { Cell as T } from "../../../cell/component.js";
3
+ import { Cell as p } from "../../../cell/component.js";
4
4
  import e from "./index.module.css.js";
5
- const w = ({
6
- dataTestID: c,
7
- className: n,
5
+ const u = ({
6
+ dataTestID: d,
7
+ className: a,
8
8
  children: l,
9
9
  title: o,
10
- subtitle: a,
10
+ subtitle: n,
11
11
  tableProps: h,
12
- cellProps: d,
12
+ cellProps: c,
13
13
  addon: f,
14
- align: i,
15
- compact: t,
14
+ align: t,
15
+ compact: r,
16
16
  width: v,
17
17
  tag: m = "td"
18
- }) => /* @__PURE__ */ r(
18
+ }) => /* @__PURE__ */ i(
19
19
  m,
20
20
  {
21
- "data-test-id": c,
22
- className: s(e.cell, n, {
21
+ "data-test-id": d,
22
+ className: s(e.cell, a, {
23
23
  [e.is_div]: m === "div",
24
- [e.compact_cell]: t
24
+ [e.compact_cell]: r
25
25
  }),
26
26
  style: { width: v },
27
27
  ...h,
28
- children: l ? /* @__PURE__ */ r(
28
+ children: l ? /* @__PURE__ */ i(
29
29
  "div",
30
30
  {
31
31
  className: s(e.children, {
32
- [e.center]: i === "center",
33
- [e.right]: i === "right"
32
+ [e.center]: t === "center",
33
+ [e.right]: t === "right"
34
34
  }),
35
35
  children: l
36
36
  }
37
- ) : /* @__PURE__ */ r(
38
- T.Base,
37
+ ) : /* @__PURE__ */ i(
38
+ p.Base,
39
39
  {
40
40
  title: o === void 0 ? "-" : o,
41
- subtitle: a,
42
- size: d?.size || (t ? "s" : "m"),
43
- compactAddon: t,
44
- singleLineTitle: t,
45
- showTitleTooltipOnOverflow: t,
41
+ subtitle: n,
42
+ size: c?.size || (r ? "s" : "m"),
43
+ compactAddon: r,
44
+ singleLineTitle: !0,
45
+ showTitleTooltipOnOverflow: !0,
46
46
  className: s({
47
- [e.center]: i === "center",
48
- [e.right]: i === "right",
49
- [e.compact_content]: t
47
+ [e.center]: t === "center",
48
+ [e.right]: t === "right",
49
+ [e.compact_content]: r
50
50
  }),
51
51
  addon: f,
52
- ...d
52
+ ...c
53
53
  }
54
54
  )
55
55
  }
56
56
  );
57
57
  export {
58
- w as TableCell
58
+ u as TableCell
59
59
  };
@@ -1 +1 @@
1
- table tr:last-child .cell_SVZP{border-bottom:0!important}.cell_SVZP{padding:8px 16px;border-bottom:1px solid var(--color-border-secondary);position:relative;min-height:56px;box-sizing:border-box;vertical-align:middle}.compact_cell_zSJH{min-height:44px;padding:8px 12px}.right_30pJ{justify-content:flex-end}.children_X057{width:100%;display:flex;align-items:center}.compact_content_bjnq{gap:0 6px!important;min-height:40px!important}.is_div_XHlH{display:flex;align-items:center}.cell_SVZP.is_div_XHlH{padding-top:12px;padding-bottom:12px}.compact_cell_zSJH.is_div_XHlH{min-height:44px}
1
+ table tr:last-child .cell_SVZP{border-bottom:0!important}.cell_SVZP{padding:8px 16px;border-bottom:1px solid var(--color-border-secondary);position:relative;min-height:56px;box-sizing:border-box;vertical-align:middle;overflow:hidden}.compact_cell_zSJH{min-height:44px;padding:8px 12px}.right_30pJ{justify-content:flex-end}.children_X057{width:100%;display:flex;align-items:center}.compact_content_bjnq{gap:0 6px!important;min-height:40px!important}.is_div_XHlH{display:flex;align-items:center}.cell_SVZP.is_div_XHlH{padding-top:12px;padding-bottom:12px}.compact_cell_zSJH.is_div_XHlH{min-height:44px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alphakits/ui",
3
- "version": "2.4.8",
3
+ "version": "2.5.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],