@companix/uikit 0.0.75 → 0.0.77

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 (50) hide show
  1. package/dist/Scrollable/Scrollable.scss +15 -0
  2. package/dist/__helpers/createScope.d.ts +13 -0
  3. package/dist/bundle.es.js +2 -0
  4. package/dist/bundle.es12.js +4 -4
  5. package/dist/bundle.es13.js +3 -3
  6. package/dist/bundle.es14.js +2 -2
  7. package/dist/bundle.es16.js +1 -1
  8. package/dist/bundle.es2.js +1 -1
  9. package/dist/bundle.es21.js +1 -1
  10. package/dist/bundle.es22.js +1 -1
  11. package/dist/bundle.es23.js +1 -1
  12. package/dist/bundle.es24.js +1 -1
  13. package/dist/bundle.es25.js +1 -1
  14. package/dist/bundle.es27.js +1 -1
  15. package/dist/bundle.es28.js +4 -4
  16. package/dist/bundle.es29.js +2 -2
  17. package/dist/bundle.es32.js +2 -2
  18. package/dist/bundle.es36.js +1 -1
  19. package/dist/bundle.es40.js +1 -1
  20. package/dist/bundle.es41.js +1 -1
  21. package/dist/bundle.es42.js +1 -1
  22. package/dist/bundle.es45.js +19 -24
  23. package/dist/bundle.es46.js +25 -23
  24. package/dist/bundle.es47.js +22 -23
  25. package/dist/bundle.es48.js +24 -88
  26. package/dist/bundle.es49.js +88 -18
  27. package/dist/bundle.es50.js +17 -92
  28. package/dist/bundle.es51.js +92 -73
  29. package/dist/bundle.es52.js +73 -23
  30. package/dist/bundle.es53.js +20 -35
  31. package/dist/bundle.es54.js +39 -5
  32. package/dist/bundle.es55.js +5 -14
  33. package/dist/bundle.es56.js +13 -13
  34. package/dist/bundle.es57.js +13 -69
  35. package/dist/bundle.es58.js +68 -66
  36. package/dist/bundle.es59.js +67 -10
  37. package/dist/bundle.es60.js +10 -42
  38. package/dist/bundle.es61.js +42 -14
  39. package/dist/bundle.es62.js +15 -32
  40. package/dist/bundle.es63.js +23 -61
  41. package/dist/bundle.es64.js +69 -13
  42. package/dist/bundle.es65.js +13 -74
  43. package/dist/bundle.es66.js +71 -45
  44. package/dist/bundle.es67.js +48 -13
  45. package/dist/bundle.es68.js +16 -0
  46. package/dist/bundle.es7.js +58 -58
  47. package/dist/bundle.es8.js +1 -1
  48. package/dist/bundle.es9.js +1 -1
  49. package/dist/index.d.ts +1 -0
  50. package/package.json +1 -1
@@ -1,77 +1,16 @@
1
- import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
- import { useCallback as u, useMemo as h } from "react";
3
- import { Select as p } from "./bundle.es12.js";
4
- import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es51.js";
5
- import { Icon as C } from "./bundle.es33.js";
6
- import { faChevronLeft as E, faChevronRight as T } from "@companix/icons-solid";
7
- import { setMonth as _, setYear as F } from "./bundle.es58.js";
8
- const y = ({
9
- viewDate: n,
10
- onChange: c,
11
- isMonthDisabled: a,
12
- isYearDisabled: m,
13
- onNextMonth: N,
14
- onPrevMonth: v
15
- }) => {
16
- const e = n.getFullYear(), r = n.getMonth(), s = "ru", M = u(
17
- (t) => {
18
- c(_(n, t));
19
- },
20
- [c, n]
21
- ), x = u(
22
- (t) => {
23
- c(F(n, t));
24
- },
25
- [c, n]
26
- ), A = h(() => k(s).map((t) => ({
27
- ...t,
28
- className: "capitalize",
29
- disabled: a && a(t.value)
30
- })), [s, a]), Y = h(() => z(e, 100).map((t) => ({
31
- ...t,
32
- disabled: m && m(t.value)
33
- })), [e, m]);
34
- let l = r === 11 && e === f;
35
- a && !l && (l = a(
36
- r === 11 ? 0 : r + 1,
37
- r === 11 ? Math.min(e + 1, f) : e
38
- ));
39
- let i = r === 0 && e === g;
40
- return a && !i && (i = a(
41
- r === 0 ? 11 : r - 1,
42
- r === 0 ? Math.max(e - 1, g) : e
43
- )), /* @__PURE__ */ d("div", { className: "calendar-header", children: [
44
- !i && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: v, children: /* @__PURE__ */ o(C, { icon: E }) }),
45
- /* @__PURE__ */ d("div", { className: "calendar-pickers", children: [
46
- /* @__PURE__ */ o(
47
- p,
48
- {
49
- fill: !0,
50
- options: Y,
51
- size: "sm",
52
- value: e,
53
- minimalOptions: !0,
54
- matchTarget: "min-width",
55
- onChange: (t) => x(t)
56
- }
57
- ),
58
- /* @__PURE__ */ o(
59
- p,
60
- {
61
- fill: !0,
62
- options: A,
63
- size: "sm",
64
- className: "capitalize",
65
- value: r,
66
- minimalOptions: !0,
67
- matchTarget: "min-width",
68
- onChange: (t) => M(t)
69
- }
70
- )
71
- ] }),
72
- !l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: N, children: /* @__PURE__ */ o(C, { icon: T }) })
73
- ] });
1
+ import { useRef as l, useCallback as p } from "react";
2
+ import { useEffectWithLayout as d } from "./bundle.es68.js";
3
+ const g = (r, f) => {
4
+ const c = l(null), i = l(null), o = { Right: c, Left: i }, u = p((t) => {
5
+ if (r.current) {
6
+ const n = r.current.style, e = o[t];
7
+ e.current && e.current.clientWidth ? n[`padding${t}`] !== `${e.current.clientWidth}px` && (n[`padding${t}`] = `${e.current.clientWidth}px`) : n[`padding${t}`] && (n[`padding${t}`] = "");
8
+ }
9
+ }, []);
10
+ return d(() => {
11
+ u("Left"), u("Right");
12
+ }, f), { rightRef: c, leftRef: i };
74
13
  };
75
14
  export {
76
- y as CalendarHeader
15
+ g as useInputPadding
77
16
  };
@@ -1,51 +1,77 @@
1
- import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es58.js";
2
- import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es51.js";
3
- import { useState as U, useCallback as M } from "react";
4
- const X = ({
5
- value: p,
6
- disablePast: r,
7
- disableFuture: c,
8
- shouldDisableDate: E,
9
- minDateTime: l,
10
- maxDateTime: s
1
+ import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
+ import { useCallback as u, useMemo as h } from "react";
3
+ import { Select as p } from "./bundle.es12.js";
4
+ import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es52.js";
5
+ import { Icon as C } from "./bundle.es33.js";
6
+ import { faChevronLeft as E, faChevronRight as T } from "@companix/icons-solid";
7
+ import { setMonth as _, setYear as F } from "./bundle.es59.js";
8
+ const y = ({
9
+ viewDate: n,
10
+ onChange: c,
11
+ isMonthDisabled: a,
12
+ isYearDisabled: m,
13
+ onNextMonth: N,
14
+ onPrevMonth: v
11
15
  }) => {
12
- const [e, u] = U(p || /* @__PURE__ */ new Date()), _ = M(() => {
13
- u(L(e));
14
- }, [e]), C = M(() => {
15
- u(N(e, 1));
16
- }, [e]), D = R({
17
- disableFuture: c,
18
- disablePast: r,
19
- shouldDisableDate: E,
20
- minDateTime: l,
21
- maxDateTime: s
22
- }), k = M(
23
- (o, t) => {
24
- const n = /* @__PURE__ */ new Date();
25
- t = t || e.getFullYear();
26
- const h = l ? l.getMonth() : 0, Y = s ? s.getMonth() : 11, F = l?.getFullYear() || w, f = s?.getFullYear() || A;
27
- let g = t >= F && t <= f ? t === F && h > o || t === f && o > Y : !0;
28
- return c && (g = g || (t === n.getFullYear() ? o > n.getMonth() : t > n.getFullYear())), r && (g = g || (t === n.getFullYear() ? o < n.getMonth() : t < n.getFullYear())), g;
16
+ const e = n.getFullYear(), r = n.getMonth(), s = "ru", M = u(
17
+ (t) => {
18
+ c(_(n, t));
29
19
  },
30
- [c, r, e, l, s]
31
- ), v = M(
32
- (o) => {
33
- const t = /* @__PURE__ */ new Date(), n = l?.getFullYear() || w, h = s?.getFullYear() || A;
34
- let Y = n > o || o > h;
35
- return c && (Y = Y || o > t.getFullYear()), r && (Y = Y || o < t.getFullYear()), Y;
20
+ [c, n]
21
+ ), x = u(
22
+ (t) => {
23
+ c(F(n, t));
36
24
  },
37
- [c, r, l, s]
38
- );
39
- return {
40
- viewDate: e,
41
- setViewDate: u,
42
- setPrevMonth: _,
43
- setNextMonth: C,
44
- isDayDisabled: D,
45
- isMonthDisabled: k,
46
- isYearDisabled: v
47
- };
25
+ [c, n]
26
+ ), A = h(() => k(s).map((t) => ({
27
+ ...t,
28
+ className: "capitalize",
29
+ disabled: a && a(t.value)
30
+ })), [s, a]), Y = h(() => z(e, 100).map((t) => ({
31
+ ...t,
32
+ disabled: m && m(t.value)
33
+ })), [e, m]);
34
+ let l = r === 11 && e === f;
35
+ a && !l && (l = a(
36
+ r === 11 ? 0 : r + 1,
37
+ r === 11 ? Math.min(e + 1, f) : e
38
+ ));
39
+ let i = r === 0 && e === g;
40
+ return a && !i && (i = a(
41
+ r === 0 ? 11 : r - 1,
42
+ r === 0 ? Math.max(e - 1, g) : e
43
+ )), /* @__PURE__ */ d("div", { className: "calendar-header", children: [
44
+ !i && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: v, children: /* @__PURE__ */ o(C, { icon: E }) }),
45
+ /* @__PURE__ */ d("div", { className: "calendar-pickers", children: [
46
+ /* @__PURE__ */ o(
47
+ p,
48
+ {
49
+ fill: !0,
50
+ options: Y,
51
+ size: "sm",
52
+ value: e,
53
+ minimalOptions: !0,
54
+ matchTarget: "min-width",
55
+ onChange: (t) => x(t)
56
+ }
57
+ ),
58
+ /* @__PURE__ */ o(
59
+ p,
60
+ {
61
+ fill: !0,
62
+ options: A,
63
+ size: "sm",
64
+ className: "capitalize",
65
+ value: r,
66
+ minimalOptions: !0,
67
+ matchTarget: "min-width",
68
+ onChange: (t) => M(t)
69
+ }
70
+ )
71
+ ] }),
72
+ !l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: N, children: /* @__PURE__ */ o(C, { icon: T }) })
73
+ ] });
48
74
  };
49
75
  export {
50
- X as useCalendar
76
+ y as CalendarHeader
51
77
  };
@@ -1,16 +1,51 @@
1
- import { useRef as f, useLayoutEffect as u, useEffect as s } from "react";
2
- const o = (t, r) => {
3
- const e = f(!1);
4
- u(() => {
5
- e.current = !0, t();
6
- }, []), s(() => {
7
- if (e.current) {
8
- e.current = !1;
9
- return;
10
- }
11
- t();
12
- }, r);
1
+ import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es59.js";
2
+ import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es52.js";
3
+ import { useState as U, useCallback as M } from "react";
4
+ const X = ({
5
+ value: p,
6
+ disablePast: r,
7
+ disableFuture: c,
8
+ shouldDisableDate: E,
9
+ minDateTime: l,
10
+ maxDateTime: s
11
+ }) => {
12
+ const [e, u] = U(p || /* @__PURE__ */ new Date()), _ = M(() => {
13
+ u(L(e));
14
+ }, [e]), C = M(() => {
15
+ u(N(e, 1));
16
+ }, [e]), D = R({
17
+ disableFuture: c,
18
+ disablePast: r,
19
+ shouldDisableDate: E,
20
+ minDateTime: l,
21
+ maxDateTime: s
22
+ }), k = M(
23
+ (o, t) => {
24
+ const n = /* @__PURE__ */ new Date();
25
+ t = t || e.getFullYear();
26
+ const h = l ? l.getMonth() : 0, Y = s ? s.getMonth() : 11, F = l?.getFullYear() || w, f = s?.getFullYear() || A;
27
+ let g = t >= F && t <= f ? t === F && h > o || t === f && o > Y : !0;
28
+ return c && (g = g || (t === n.getFullYear() ? o > n.getMonth() : t > n.getFullYear())), r && (g = g || (t === n.getFullYear() ? o < n.getMonth() : t < n.getFullYear())), g;
29
+ },
30
+ [c, r, e, l, s]
31
+ ), v = M(
32
+ (o) => {
33
+ const t = /* @__PURE__ */ new Date(), n = l?.getFullYear() || w, h = s?.getFullYear() || A;
34
+ let Y = n > o || o > h;
35
+ return c && (Y = Y || o > t.getFullYear()), r && (Y = Y || o < t.getFullYear()), Y;
36
+ },
37
+ [c, r, l, s]
38
+ );
39
+ return {
40
+ viewDate: e,
41
+ setViewDate: u,
42
+ setPrevMonth: _,
43
+ setNextMonth: C,
44
+ isDayDisabled: D,
45
+ isMonthDisabled: k,
46
+ isYearDisabled: v
47
+ };
13
48
  };
14
49
  export {
15
- o as useEffectWithLayout
50
+ X as useCalendar
16
51
  };
@@ -0,0 +1,16 @@
1
+ import { useRef as f, useLayoutEffect as u, useEffect as s } from "react";
2
+ const o = (t, r) => {
3
+ const e = f(!1);
4
+ u(() => {
5
+ e.current = !0, t();
6
+ }, []), s(() => {
7
+ if (e.current) {
8
+ e.current = !1;
9
+ return;
10
+ }
11
+ t();
12
+ }, r);
13
+ };
14
+ export {
15
+ o as useEffectWithLayout
16
+ };
@@ -1,88 +1,88 @@
1
- import { jsx as S } from "react/jsx-runtime";
2
- import I from "classnames";
3
- import { forwardRef as B } from "react";
4
- import { customCSS as r, px as i } from "@companix/utils-browser";
5
- const $ = B((t, c) => {
1
+ import { jsx as I } from "react/jsx-runtime";
2
+ import B from "classnames";
3
+ import { forwardRef as L } from "react";
4
+ import { customCSS as i, px as r, attr as c } from "@companix/utils-browser";
5
+ const C = L((o, m) => {
6
6
  let {
7
- interactionKind: m = "static",
8
- thumbPos: s = "center",
9
- thumbPadding: l = 4,
10
- heightAuto: g,
11
- scrollX: h,
12
- className: u,
7
+ interactionKind: s = "static",
8
+ thumbPos: g = "center",
9
+ thumbPadding: d = 4,
10
+ heightAuto: h,
11
+ scrollX: u,
12
+ className: p,
13
13
  scrollY: n,
14
- preventOnMouse: f,
15
- onWheel: p,
16
- maxHeight: d,
17
- onScroll: b,
18
- thumbColor: w,
19
- children: x
20
- } = t;
21
- const v = (() => {
22
- if (t.implementation === "edge") {
23
- l = 0;
24
- const { padding: o, scrollbarWidth: e } = t;
14
+ preventOnMouse: b,
15
+ onWheel: f,
16
+ maxHeight: l,
17
+ onScroll: w,
18
+ thumbColor: x,
19
+ children: v
20
+ } = o;
21
+ const S = (() => {
22
+ if (o.implementation === "edge") {
23
+ d = 0;
24
+ const { padding: t, scrollbarWidth: e } = o;
25
25
  return {
26
- ...r({ "--scrollbar-width": i(e) }),
27
- padding: `0px ${o - e}px 0px ${o}px`
26
+ ...i({ "--scrollbar-width": r(e) }),
27
+ padding: `0px ${t - e}px 0px ${t}px`
28
28
  };
29
29
  }
30
- if (t.implementation === "outer") {
31
- const { shadowPadding: o = 0, noneCorrect: e, scrollbarWidth: a } = t;
30
+ if (o.implementation === "outer") {
31
+ const { shadowPadding: t = 0, noneCorrect: e, scrollbarWidth: a } = o;
32
32
  return window.IS_MOBILE ? {
33
- padding: o,
34
- margin: -o
33
+ padding: t,
34
+ margin: -t
35
35
  } : {
36
- ...r({ "--scrollbar-width": i(a) }),
37
- padding: o,
38
- margin: -o,
39
- marginRight: e ? void 0 : `calc(-${a}px - ${o}px)`,
36
+ ...i({ "--scrollbar-width": r(a) }),
37
+ padding: t,
38
+ margin: -t,
39
+ marginRight: e ? void 0 : `calc(-${a}px - ${t}px)`,
40
40
  marginBottom: 0
41
41
  };
42
42
  }
43
- if (t.implementation === "inner") {
44
- const { padding: o } = t;
43
+ if (o.implementation === "inner") {
44
+ const { padding: t } = o;
45
45
  return window.IS_MOBILE ? {
46
- [n ? "paddingLeft" : "paddingTop"]: o,
47
- [n ? "paddingRight" : "paddingBottom"]: o
46
+ [n ? "paddingLeft" : "paddingTop"]: t,
47
+ [n ? "paddingRight" : "paddingBottom"]: t
48
48
  } : {
49
- [n ? "paddingLeft" : "paddingTop"]: o,
50
- ...r({ "--scrollbar-width": i(o) })
49
+ [n ? "paddingLeft" : "paddingTop"]: t,
50
+ ...i({ "--scrollbar-width": r(t) })
51
51
  };
52
52
  }
53
53
  return {};
54
54
  })();
55
- return /* @__PURE__ */ S(
55
+ return /* @__PURE__ */ I(
56
56
  "div",
57
57
  {
58
- ref: c,
59
- onWheel: p,
60
- onScroll: b,
61
- onMouseDown: (o) => {
62
- f && o.preventDefault();
58
+ ref: m,
59
+ onWheel: f,
60
+ onScroll: w,
61
+ onMouseDown: (t) => {
62
+ b && t.preventDefault();
63
63
  },
64
64
  style: {
65
- ...v,
66
- ...t.style,
67
- maxHeight: d ? i(d) : void 0,
68
- ...r({ "--thumb-padding": i(l) }),
69
- ...r({ "--thumb-color": w ?? "#c1c2c8bd" })
65
+ ...S,
66
+ ...o.style,
67
+ maxHeight: l ? r(l) : void 0,
68
+ ...i({ "--thumb-padding": r(d) }),
69
+ ...i({ "--thumb-color": x ?? "#c1c2c8bd" })
70
70
  },
71
- className: I(
71
+ "data-scroll-x": c(u),
72
+ "data-scroll-y": c(n),
73
+ className: B(
72
74
  !window.IS_MOBILE && "scrollable",
73
- u,
74
- g ? "" : "h-full",
75
+ p,
76
+ h ? "" : "h-full",
75
77
  {
76
- "overflow-y-scroll": n,
77
- "overflow-x-scroll": h,
78
- "scrollable-hover-interaction": m === "hover",
79
- "scrollable-border-position": s === "border"
78
+ "scrollable-hover-interaction": s === "hover",
79
+ "scrollable-border-position": g === "border"
80
80
  }
81
81
  ),
82
- children: x
82
+ children: v
83
83
  }
84
84
  );
85
85
  });
86
86
  export {
87
- $ as Scrollable
87
+ C as Scrollable
88
88
  };
@@ -59,7 +59,7 @@ const C = ({
59
59
  /* @__PURE__ */ c(
60
60
  "div",
61
61
  {
62
- className: L("hidden-scroll h-full overflow-y-scroll", g),
62
+ className: L("hidden-scroll", g),
63
63
  onScroll: M,
64
64
  ref: t,
65
65
  children: b
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
- import { makeTabId as c, useTabSlider as i } from "./bundle.es46.js";
2
+ import { makeTabId as c, useTabSlider as i } from "./bundle.es47.js";
3
3
  import { attr as o } from "@companix/utils-browser";
4
4
  import { useRef as u, useId as f } from "react";
5
5
  const h = ({ value: s, onChange: t, options: a }) => {
package/dist/index.d.ts CHANGED
@@ -77,5 +77,6 @@ export type { CalendarProps } from './Calendar/Calendar';
77
77
  export type { OptionsSource, UseOptionsResponse } from './Select/OptionsPopover';
78
78
  export { createDialogsRegistry, DialogShell } from './__helpers/createDialogRegistry';
79
79
  export { createPopoversRegistry } from './__helpers/createPopoversRegistry';
80
+ export { createScope } from './__helpers/createScope';
80
81
  export type { PopupProps } from './__helpers/createDialogRegistry';
81
82
  export type { PopoverContentProps } from './__helpers/createPopoversRegistry';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companix/uikit",
3
- "version": "0.0.75",
3
+ "version": "0.0.77",
4
4
  "main": "./dist/bundle.es.js",
5
5
  "module": "./dist/bundle.es.js",
6
6
  "types": "./dist/index.d.ts",