@companix/uikit 0.1.27 → 0.1.28

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.
Files changed (66) hide show
  1. package/dist/ImageBase/ImageBase.scss +50 -0
  2. package/dist/ImageBase/index.d.ts +8 -0
  3. package/dist/bundle.es.js +63 -61
  4. package/dist/bundle.es10.js +1 -1
  5. package/dist/bundle.es13.js +4 -4
  6. package/dist/bundle.es14.js +3 -3
  7. package/dist/bundle.es15.js +2 -2
  8. package/dist/bundle.es17.js +1 -1
  9. package/dist/bundle.es23.js +5 -5
  10. package/dist/bundle.es25.js +1 -1
  11. package/dist/bundle.es26.js +1 -1
  12. package/dist/bundle.es27.js +1 -1
  13. package/dist/bundle.es28.js +1 -1
  14. package/dist/bundle.es29.js +1 -1
  15. package/dist/bundle.es30.js +1 -1
  16. package/dist/bundle.es31.js +4 -4
  17. package/dist/bundle.es32.js +2 -2
  18. package/dist/bundle.es35.js +2 -2
  19. package/dist/bundle.es41.js +1 -1
  20. package/dist/bundle.es42.js +2 -2
  21. package/dist/bundle.es45.js +45 -33
  22. package/dist/bundle.es46.js +33 -20
  23. package/dist/bundle.es47.js +19 -47
  24. package/dist/bundle.es48.js +49 -11
  25. package/dist/bundle.es49.js +11 -13
  26. package/dist/bundle.es50.js +13 -13
  27. package/dist/bundle.es51.js +13 -30
  28. package/dist/bundle.es52.js +30 -11
  29. package/dist/bundle.es53.js +10 -25
  30. package/dist/bundle.es54.js +17 -29
  31. package/dist/bundle.es55.js +36 -48
  32. package/dist/bundle.es56.js +49 -55
  33. package/dist/bundle.es57.js +56 -8
  34. package/dist/bundle.es58.js +8 -26
  35. package/dist/bundle.es59.js +27 -5
  36. package/dist/bundle.es60.js +5 -66
  37. package/dist/bundle.es61.js +66 -23
  38. package/dist/bundle.es62.js +22 -23
  39. package/dist/bundle.es63.js +24 -90
  40. package/dist/bundle.es64.js +90 -18
  41. package/dist/bundle.es65.js +17 -93
  42. package/dist/bundle.es66.js +93 -73
  43. package/dist/bundle.es67.js +73 -23
  44. package/dist/bundle.es68.js +20 -35
  45. package/dist/bundle.es69.js +39 -24
  46. package/dist/bundle.es70.js +24 -79
  47. package/dist/bundle.es71.js +71 -85
  48. package/dist/bundle.es72.js +93 -10
  49. package/dist/bundle.es73.js +10 -6
  50. package/dist/bundle.es74.js +5 -69
  51. package/dist/bundle.es75.js +68 -10
  52. package/dist/bundle.es76.js +11 -42
  53. package/dist/bundle.es77.js +42 -32
  54. package/dist/bundle.es78.js +31 -64
  55. package/dist/bundle.es79.js +65 -40
  56. package/dist/bundle.es80.js +40 -14
  57. package/dist/bundle.es81.js +15 -32
  58. package/dist/bundle.es82.js +23 -61
  59. package/dist/bundle.es83.js +69 -13
  60. package/dist/bundle.es84.js +13 -74
  61. package/dist/bundle.es85.js +71 -45
  62. package/dist/bundle.es86.js +48 -13
  63. package/dist/bundle.es87.js +16 -0
  64. package/dist/index.d.ts +2 -0
  65. package/dist/index.scss +1 -0
  66. package/package.json +1 -1
@@ -1,96 +1,20 @@
1
- import { jsx as i, jsxs as y } from "react/jsx-runtime";
2
- import { useMemo as P, useEffect as C } from "react";
3
- import { Spinner as T } from "./bundle.es7.js";
4
- import { OptionItem as L } from "./bundle.es16.js";
5
- import { OptionsList as R } from "./bundle.es18.js";
6
- import { Icon as S } from "./bundle.es36.js";
7
- import { faPlus as b } from "@companix/icons-solid";
8
- const I = () => ({ isLoading: !1, options: [] }), N = (e) => {
9
- const { onOptionsLoaded: n, useOptions: s = I, options: o } = e, t = s();
10
- return C(() => {
11
- t.options.length > 0 && n?.(t.options);
12
- }, [t.options]), o ? { options: o, isLoading: !1 } : t;
13
- }, M = (e) => {
14
- const {
15
- isActive: n,
16
- emptyText: s,
17
- isLoading: o,
18
- scrollboxRef: t,
19
- optionsWrapperRef: d,
20
- addOption: p,
21
- onOpened: f,
22
- onSelect: O,
23
- minimalOptions: u,
24
- filterOptions: r,
25
- disableFiltering: l,
26
- close: c,
27
- ...m
28
- } = e, { emptyText: x, options: a, isLoading: g } = N(m), v = P(() => r && !l ? a.filter(r) : a, [a, r, l]);
29
- return g ?? o ? /* @__PURE__ */ i("div", { className: "select-popover-loading", children: /* @__PURE__ */ i(T, { size: 24 }) }) : /* @__PURE__ */ i(
30
- j,
31
- {
32
- options: v,
33
- isActive: n,
34
- emptyText: x ?? s,
35
- scrollboxRef: t,
36
- optionsWrapperRef: d,
37
- minimalOptions: u,
38
- addOption: p,
39
- onOpened: f,
40
- onSelect: O,
41
- close: c
42
- }
43
- );
44
- }, j = (e) => {
45
- const {
46
- isActive: n,
47
- onOpened: s,
48
- addOption: o,
49
- scrollboxRef: t,
50
- optionsWrapperRef: d,
51
- options: p,
52
- onSelect: f,
53
- minimalOptions: O,
54
- emptyText: u = "Ничего не найдено",
55
- close: r
56
- } = e;
57
- C(() => {
58
- s?.(p.findIndex(({ value: c }) => n(c)));
59
- }, []);
60
- const l = o ? /* @__PURE__ */ i(
61
- L,
62
- {
63
- className: "select-add-option",
64
- icon: /* @__PURE__ */ i(S, { icon: b }),
65
- title: o.text,
66
- onClick: o.onClick,
67
- onClickCapture: () => {
68
- o.closeOnClick && r();
69
- }
70
- }
71
- ) : void 0;
72
- return /* @__PURE__ */ y(R, { scrollboxRef: t, optionsWrapperRef: d, maxHeight: 300, children: [
73
- (o?.position === void 0 || o?.position === "first") && l,
74
- p.length === 0 && !o && /* @__PURE__ */ i("div", { className: "select-tags-noneresults", children: u }),
75
- p.map(({ title: c, value: m, className: x, icon: a, disabled: g, indicator: v, label: h }, k) => /* @__PURE__ */ i(
76
- L,
77
- {
78
- active: n(m),
79
- onClick: () => f?.(m),
80
- minimal: O,
81
- disabled: g,
82
- className: x,
83
- title: c,
84
- label: h,
85
- indicator: v,
86
- icon: a
87
- },
88
- `select-option-${k}`
89
- )),
90
- o?.position === "last" && l
91
- ] });
1
+ import { useRef as u, useCallback as T } from "react";
2
+ const g = () => {
3
+ const l = u(null), t = u(null);
4
+ return { scrollToElement: T(
5
+ (r, f) => {
6
+ const o = l.current, s = t.current;
7
+ if (!o || !s || r < 0 || r > s.children.length)
8
+ return;
9
+ const c = s.children[r];
10
+ if (!c)
11
+ return;
12
+ const n = o.offsetHeight, i = o.scrollTop, e = c.offsetTop, p = c.offsetHeight;
13
+ f === "center" ? o.scrollTop = e - n / 2 + p / 2 : f === "top" ? o.scrollTop = e : e + p > n + i ? o.scrollTop = e - n + p : e < i && (o.scrollTop = e);
14
+ },
15
+ [t, l]
16
+ ), scrollBoxRef: l, optionsWrapperRef: t };
92
17
  };
93
18
  export {
94
- M as OptionsPopover,
95
- j as SelectOptionsList
19
+ g as useScrollListController
96
20
  };
@@ -1,76 +1,96 @@
1
- import { clamp as m } from "@companix/utils-browser";
2
- import { formatTime as i } from "@companix/utils-js";
3
- const d = (n, r) => new Date(r, n, 0).getDate(), u = (n, r) => new Date(r, n - 1, 1).getDay(), g = (n) => n === 0 ? 6 : n - 1, D = (n) => new Array(n).fill(0), T = {
4
- add: (n, r) => n.includes(r) ? [...n] : [...n, r],
5
- remove: (n, r) => n.filter((t) => r !== t)
6
- }, p = (n) => ({
7
- day: n.getDate(),
8
- month: n.getMonth() + 1,
9
- year: n.getFullYear()
10
- }), A = ({ min: n, max: r }) => (t) => {
11
- if (n.year === t.year) {
12
- if (t.month !== 0 && t.month < n.month)
13
- return t.month = 0, t.day = 0, t;
14
- if (t.month === n.month && t.day < n.day && t.day !== 0)
15
- return t.day = 0, t;
16
- }
17
- if (r.year === t.year) {
18
- if (t.month !== 0 && t.month > r.month)
19
- return t.month = 0, t.day = 0, t;
20
- if (t.month === r.month && t.day > r.day && t.day !== 0)
21
- return t.day = 0, t;
22
- }
23
- }, M = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], w = [
24
- "Январь",
25
- "Февраль",
26
- "Март",
27
- "Апрель",
28
- "Май",
29
- "Июнь",
30
- "Июль",
31
- "Август",
32
- "Сентябрь",
33
- "Октябрь",
34
- "Ноябрь",
35
- "Декабрь"
36
- ], c = 9999, a = 100, F = (n, r) => {
37
- const t = [], o = m(n - r, a, c), e = m(n + r, a, c);
38
- for (let s = o; s <= e; s++)
39
- t.push({ title: String(s).padStart(4, "0"), value: s });
40
- return t;
41
- }, Y = (n) => {
42
- const r = [], t = new Intl.DateTimeFormat(n, {
43
- month: "long"
44
- });
45
- for (let o = 0; o < 12; o++)
46
- r.push({
47
- title: t.format(new Date(2023, o, 15)),
48
- value: o
49
- });
50
- return r;
51
- }, E = (n, r) => r.reduce((t, o) => t.replaceAll(o, ""), n.trim()), _ = ({ hours: n, minutes: r }, t = ":") => [i(n), i(r)].join(t), h = (n, r = ":") => {
52
- const [t, o] = [i(n.hours), i(n.minutes)], e = [t, o].join(r);
53
- return { title: e, value: e, hours: t, minutes: o };
54
- }, I = (n, r = ":") => {
55
- const t = { minutes: -n, hours: 0 };
56
- return Array.from({ length: 1440 / n }).map(() => (t.minutes += n, t.minutes === 60 && (t.minutes = 0, t.hours++), h(t, r)));
1
+ import { jsx as i, jsxs as y } from "react/jsx-runtime";
2
+ import { useMemo as P, useEffect as C } from "react";
3
+ import { Spinner as T } from "./bundle.es7.js";
4
+ import { OptionItem as L } from "./bundle.es16.js";
5
+ import { OptionsList as R } from "./bundle.es18.js";
6
+ import { Icon as S } from "./bundle.es36.js";
7
+ import { faPlus as b } from "@companix/icons-solid";
8
+ const I = () => ({ isLoading: !1, options: [] }), N = (e) => {
9
+ const { onOptionsLoaded: n, useOptions: s = I, options: o } = e, t = s();
10
+ return C(() => {
11
+ t.options.length > 0 && n?.(t.options);
12
+ }, [t.options]), o ? { options: o, isLoading: !1 } : t;
13
+ }, M = (e) => {
14
+ const {
15
+ isActive: n,
16
+ emptyText: s,
17
+ isLoading: o,
18
+ scrollboxRef: t,
19
+ optionsWrapperRef: d,
20
+ addOption: p,
21
+ onOpened: f,
22
+ onSelect: O,
23
+ minimalOptions: u,
24
+ filterOptions: r,
25
+ disableFiltering: l,
26
+ close: c,
27
+ ...m
28
+ } = e, { emptyText: x, options: a, isLoading: g } = N(m), v = P(() => r && !l ? a.filter(r) : a, [a, r, l]);
29
+ return g ?? o ? /* @__PURE__ */ i("div", { className: "select-popover-loading", children: /* @__PURE__ */ i(T, { size: 24 }) }) : /* @__PURE__ */ i(
30
+ j,
31
+ {
32
+ options: v,
33
+ isActive: n,
34
+ emptyText: x ?? s,
35
+ scrollboxRef: t,
36
+ optionsWrapperRef: d,
37
+ minimalOptions: u,
38
+ addOption: p,
39
+ onOpened: f,
40
+ onSelect: O,
41
+ close: c
42
+ }
43
+ );
44
+ }, j = (e) => {
45
+ const {
46
+ isActive: n,
47
+ onOpened: s,
48
+ addOption: o,
49
+ scrollboxRef: t,
50
+ optionsWrapperRef: d,
51
+ options: p,
52
+ onSelect: f,
53
+ minimalOptions: O,
54
+ emptyText: u = "Ничего не найдено",
55
+ close: r
56
+ } = e;
57
+ C(() => {
58
+ s?.(p.findIndex(({ value: c }) => n(c)));
59
+ }, []);
60
+ const l = o ? /* @__PURE__ */ i(
61
+ L,
62
+ {
63
+ className: "select-add-option",
64
+ icon: /* @__PURE__ */ i(S, { icon: b }),
65
+ title: o.text,
66
+ onClick: o.onClick,
67
+ onClickCapture: () => {
68
+ o.closeOnClick && r();
69
+ }
70
+ }
71
+ ) : void 0;
72
+ return /* @__PURE__ */ y(R, { scrollboxRef: t, optionsWrapperRef: d, maxHeight: 300, children: [
73
+ (o?.position === void 0 || o?.position === "first") && l,
74
+ p.length === 0 && !o && /* @__PURE__ */ i("div", { className: "select-tags-noneresults", children: u }),
75
+ p.map(({ title: c, value: m, className: x, icon: a, disabled: g, indicator: v, label: h }, k) => /* @__PURE__ */ i(
76
+ L,
77
+ {
78
+ active: n(m),
79
+ onClick: () => f?.(m),
80
+ minimal: O,
81
+ disabled: g,
82
+ className: x,
83
+ title: c,
84
+ label: h,
85
+ indicator: v,
86
+ icon: a
87
+ },
88
+ `select-option-${k}`
89
+ )),
90
+ o?.position === "last" && l
91
+ ] });
57
92
  };
58
93
  export {
59
- c as DEFAULT_MAX_YEAR,
60
- a as DEFAULT_MIN_YEAR,
61
- w as DefaultMonths,
62
- T as arrays,
63
- _ as convertTimeToOption,
64
- A as createDateValidation,
65
- D as createVoids,
66
- p as dateToFormat,
67
- g as getDayIndex,
68
- u as getFirstDay,
69
- d as getMonthMaxDay,
70
- Y as getMonths,
71
- h as getTimeValue,
72
- I as getTimesOptions,
73
- F as getYears,
74
- E as removeDigits,
75
- M as weeks
94
+ M as OptionsPopover,
95
+ j as SelectOptionsList
76
96
  };
@@ -1,26 +1,76 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { forwardRef as m, useCallback as i } from "react";
3
- import c from "react-input-mask";
4
- const I = m(
5
- ({ mask: r, maskChar: f = "_", onChange: n, onValueChange: o, ...a }, e) => {
6
- const p = i(
7
- (t) => {
8
- n?.(t), o?.(t.target.value, t.target);
9
- },
10
- [n, o]
11
- );
12
- return r ? /* @__PURE__ */ u(
13
- c,
14
- {
15
- inputRef: e,
16
- mask: r,
17
- maskChar: f,
18
- onChange: p,
19
- ...a
20
- }
21
- ) : /* @__PURE__ */ u("input", { ref: e, ...a, onChange: p });
1
+ import { clamp as m } from "@companix/utils-browser";
2
+ import { formatTime as i } from "@companix/utils-js";
3
+ const d = (n, r) => new Date(r, n, 0).getDate(), u = (n, r) => new Date(r, n - 1, 1).getDay(), g = (n) => n === 0 ? 6 : n - 1, D = (n) => new Array(n).fill(0), T = {
4
+ add: (n, r) => n.includes(r) ? [...n] : [...n, r],
5
+ remove: (n, r) => n.filter((t) => r !== t)
6
+ }, p = (n) => ({
7
+ day: n.getDate(),
8
+ month: n.getMonth() + 1,
9
+ year: n.getFullYear()
10
+ }), A = ({ min: n, max: r }) => (t) => {
11
+ if (n.year === t.year) {
12
+ if (t.month !== 0 && t.month < n.month)
13
+ return t.month = 0, t.day = 0, t;
14
+ if (t.month === n.month && t.day < n.day && t.day !== 0)
15
+ return t.day = 0, t;
22
16
  }
23
- );
17
+ if (r.year === t.year) {
18
+ if (t.month !== 0 && t.month > r.month)
19
+ return t.month = 0, t.day = 0, t;
20
+ if (t.month === r.month && t.day > r.day && t.day !== 0)
21
+ return t.day = 0, t;
22
+ }
23
+ }, M = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], w = [
24
+ "Январь",
25
+ "Февраль",
26
+ "Март",
27
+ "Апрель",
28
+ "Май",
29
+ "Июнь",
30
+ "Июль",
31
+ "Август",
32
+ "Сентябрь",
33
+ "Октябрь",
34
+ "Ноябрь",
35
+ "Декабрь"
36
+ ], c = 9999, a = 100, F = (n, r) => {
37
+ const t = [], o = m(n - r, a, c), e = m(n + r, a, c);
38
+ for (let s = o; s <= e; s++)
39
+ t.push({ title: String(s).padStart(4, "0"), value: s });
40
+ return t;
41
+ }, Y = (n) => {
42
+ const r = [], t = new Intl.DateTimeFormat(n, {
43
+ month: "long"
44
+ });
45
+ for (let o = 0; o < 12; o++)
46
+ r.push({
47
+ title: t.format(new Date(2023, o, 15)),
48
+ value: o
49
+ });
50
+ return r;
51
+ }, E = (n, r) => r.reduce((t, o) => t.replaceAll(o, ""), n.trim()), _ = ({ hours: n, minutes: r }, t = ":") => [i(n), i(r)].join(t), h = (n, r = ":") => {
52
+ const [t, o] = [i(n.hours), i(n.minutes)], e = [t, o].join(r);
53
+ return { title: e, value: e, hours: t, minutes: o };
54
+ }, I = (n, r = ":") => {
55
+ const t = { minutes: -n, hours: 0 };
56
+ return Array.from({ length: 1440 / n }).map(() => (t.minutes += n, t.minutes === 60 && (t.minutes = 0, t.hours++), h(t, r)));
57
+ };
24
58
  export {
25
- I as InputElement
59
+ c as DEFAULT_MAX_YEAR,
60
+ a as DEFAULT_MIN_YEAR,
61
+ w as DefaultMonths,
62
+ T as arrays,
63
+ _ as convertTimeToOption,
64
+ A as createDateValidation,
65
+ D as createVoids,
66
+ p as dateToFormat,
67
+ g as getDayIndex,
68
+ u as getFirstDay,
69
+ d as getMonthMaxDay,
70
+ Y as getMonths,
71
+ h as getTimeValue,
72
+ I as getTimesOptions,
73
+ F as getYears,
74
+ E as removeDigits,
75
+ M as weeks
26
76
  };
@@ -1,41 +1,26 @@
1
- import { jsxs as b, jsx as o } from "react/jsx-runtime";
2
- import h from "classnames";
3
- import { attr as e } from "@companix/utils-browser";
4
- import { forwardRef as x } from "react";
5
- import { useInputPadding as N } from "./bundle.es83.js";
6
- const v = x(
7
- ({
8
- required: s,
9
- disabled: t,
10
- size: i,
11
- fill: d,
12
- leftElement: r,
13
- rightElement: a,
14
- className: f,
15
- inputRef: m,
16
- children: n,
17
- ...p
18
- }, c) => {
19
- const { leftRef: l, rightRef: u } = N(m, [r, a]);
20
- return /* @__PURE__ */ b(
21
- "div",
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { forwardRef as m, useCallback as i } from "react";
3
+ import c from "react-input-mask";
4
+ const I = m(
5
+ ({ mask: r, maskChar: f = "_", onChange: n, onValueChange: o, ...a }, e) => {
6
+ const p = i(
7
+ (t) => {
8
+ n?.(t), o?.(t.target.value, t.target);
9
+ },
10
+ [n, o]
11
+ );
12
+ return r ? /* @__PURE__ */ u(
13
+ c,
22
14
  {
23
- ref: c,
24
- className: h("form", f),
25
- "data-size": i ?? "md",
26
- "data-fill": e(d),
27
- "data-required": e(s),
28
- "data-disabled": e(t),
29
- ...p,
30
- children: [
31
- r && /* @__PURE__ */ o("span", { ref: l, className: "form-input-base-left-element", children: r }),
32
- n,
33
- a && /* @__PURE__ */ o("span", { ref: u, className: "form-input-base-right-element", children: a })
34
- ]
15
+ inputRef: e,
16
+ mask: r,
17
+ maskChar: f,
18
+ onChange: p,
19
+ ...a
35
20
  }
36
- );
21
+ ) : /* @__PURE__ */ u("input", { ref: e, ...a, onChange: p });
37
22
  }
38
23
  );
39
24
  export {
40
- v as InputContainer
25
+ I as InputElement
41
26
  };
@@ -1,26 +1,41 @@
1
- import r from "react";
2
- const t = r.createContext({
3
- drawerRef: { current: null },
4
- overlayRef: { current: null },
5
- onPress: () => {
6
- },
7
- onRelease: () => {
8
- },
9
- onDrag: () => {
10
- },
11
- isOpen: !1,
12
- isDragging: !1,
13
- keyboardIsOpen: { current: !1 },
14
- closeDrawer: () => {
15
- },
16
- shouldAnimate: { current: !0 }
17
- }), o = () => {
18
- const e = r.useContext(t);
19
- if (!e)
20
- throw new Error("useDrawerContext must be used within a MobileDrawer.Root");
21
- return e;
22
- };
1
+ import { jsxs as b, jsx as o } from "react/jsx-runtime";
2
+ import h from "classnames";
3
+ import { attr as e } from "@companix/utils-browser";
4
+ import { forwardRef as x } from "react";
5
+ import { useInputPadding as N } from "./bundle.es84.js";
6
+ const v = x(
7
+ ({
8
+ required: s,
9
+ disabled: t,
10
+ size: i,
11
+ fill: d,
12
+ leftElement: r,
13
+ rightElement: a,
14
+ className: f,
15
+ inputRef: m,
16
+ children: n,
17
+ ...p
18
+ }, c) => {
19
+ const { leftRef: l, rightRef: u } = N(m, [r, a]);
20
+ return /* @__PURE__ */ b(
21
+ "div",
22
+ {
23
+ ref: c,
24
+ className: h("form", f),
25
+ "data-size": i ?? "md",
26
+ "data-fill": e(d),
27
+ "data-required": e(s),
28
+ "data-disabled": e(t),
29
+ ...p,
30
+ children: [
31
+ r && /* @__PURE__ */ o("span", { ref: l, className: "form-input-base-left-element", children: r }),
32
+ n,
33
+ a && /* @__PURE__ */ o("span", { ref: u, className: "form-input-base-right-element", children: a })
34
+ ]
35
+ }
36
+ );
37
+ }
38
+ );
23
39
  export {
24
- t as DrawerContext,
25
- o as useDrawerContext
40
+ v as InputContainer
26
41
  };
@@ -1,81 +1,26 @@
1
- const a = /* @__PURE__ */ new WeakMap();
2
- function d(t, n, e = !1) {
3
- if (!t || !(t instanceof HTMLElement)) return;
4
- const o = {};
5
- Object.entries(n).forEach(([i, s]) => {
6
- if (i.startsWith("--")) {
7
- t.style.setProperty(i, s);
8
- return;
9
- }
10
- o[i] = t.style[i], t.style[i] = s;
11
- }), !e && a.set(t, o);
12
- }
13
- function p(t, n) {
14
- if (!t || !(t instanceof HTMLElement)) return;
15
- const e = a.get(t);
16
- e && (t.style[n] = e[n]);
17
- }
18
- function w(t) {
19
- if (!t)
20
- return null;
21
- const n = window.getComputedStyle(t), e = (
22
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
23
- // @ts-ignore
24
- n.transform || n.webkitTransform || n.mozTransform
25
- );
26
- let o = e.match(/^matrix3d\((.+)\)$/);
27
- return o ? parseFloat(o[1].split(", ")[13]) : (o = e.match(/^matrix\((.+)\)$/), o ? parseFloat(o[1].split(", ")[5]) : null);
28
- }
29
- function h(t) {
30
- return 8 * (Math.log(t + 1) - 2);
31
- }
32
- const u = /* @__PURE__ */ new Set([
33
- "checkbox",
34
- "radio",
35
- "range",
36
- "color",
37
- "file",
38
- "image",
39
- "button",
40
- "submit",
41
- "reset"
42
- ]);
43
- function T(t) {
44
- return t instanceof HTMLInputElement && !u.has(t.type) || t instanceof HTMLTextAreaElement || t instanceof HTMLElement && t.isContentEditable;
45
- }
46
- function r(t) {
47
- return typeof window < "u" && window.navigator != null ? t.test(window.navigator.platform) : void 0;
48
- }
49
- function f() {
50
- return r(/^Mac/);
51
- }
52
- function c() {
53
- return r(/^iPhone/);
54
- }
55
- function l() {
56
- return r(/^iPad/) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
57
- f() && navigator.maxTouchPoints > 1;
58
- }
59
- function M() {
60
- return c() || l();
61
- }
62
- function g() {
63
- const t = navigator.userAgent;
64
- return typeof window < "u" && (/Firefox/.test(t) && /Mobile/.test(t) || /FxiOS/.test(t));
65
- }
66
- function m(t, n) {
67
- typeof t == "function" ? t(n) : t != null && (t.current = n);
68
- }
69
- function x(...t) {
70
- return (n) => t.forEach((e) => m(e, n));
71
- }
1
+ import r from "react";
2
+ const t = r.createContext({
3
+ drawerRef: { current: null },
4
+ overlayRef: { current: null },
5
+ onPress: () => {
6
+ },
7
+ onRelease: () => {
8
+ },
9
+ onDrag: () => {
10
+ },
11
+ isOpen: !1,
12
+ isDragging: !1,
13
+ keyboardIsOpen: { current: !1 },
14
+ closeDrawer: () => {
15
+ },
16
+ shouldAnimate: { current: !0 }
17
+ }), o = () => {
18
+ const e = r.useContext(t);
19
+ if (!e)
20
+ throw new Error("useDrawerContext must be used within a MobileDrawer.Root");
21
+ return e;
22
+ };
72
23
  export {
73
- x as composeRefs,
74
- h as dampenValue,
75
- w as getTranslate,
76
- M as isIOS,
77
- T as isInput,
78
- g as isMobileFirefox,
79
- p as reset,
80
- d as set
24
+ t as DrawerContext,
25
+ o as useDrawerContext
81
26
  };