@companix/uikit 0.0.17 → 0.0.18

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.
@@ -20,5 +20,5 @@ type SelectProps<T> = Omit<SelectFormProps, 'value' | 'onChange' | 'closeButton'
20
20
  scrollTo: (index: number) => void;
21
21
  }>;
22
22
  };
23
- export declare const Select: <T extends string | number>(props: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
23
+ export declare const Select: <T>(props: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
24
24
  export {};
package/dist/bundle.es.js CHANGED
@@ -2,63 +2,64 @@ import { Button as e } from "./bundle.es2.js";
2
2
  import { Spinner as p } from "./bundle.es3.js";
3
3
  import { Scrollable as x } from "./bundle.es4.js";
4
4
  import { ImitateScroll as a } from "./bundle.es5.js";
5
- import { Popover as i } from "./bundle.es6.js";
6
- import { Tooltip as c } from "./bundle.es7.js";
5
+ import { Popover as l } from "./bundle.es6.js";
6
+ import { Tooltip as u } from "./bundle.es7.js";
7
7
  import { Select as S } from "./bundle.es8.js";
8
8
  import { Input as T } from "./bundle.es9.js";
9
9
  import { OptionItem as D } from "./bundle.es10.js";
10
10
  import { NumberInput as b } from "./bundle.es11.js";
11
- import { OptionsList as d } from "./bundle.es12.js";
11
+ import { OptionsList as A } from "./bundle.es12.js";
12
12
  import { ButtonGroup as w } from "./bundle.es13.js";
13
- import { Checkbox as L } from "./bundle.es14.js";
14
- import { Switch as P } from "./bundle.es15.js";
15
- import { Radio as v } from "./bundle.es16.js";
13
+ import { Checkbox as G } from "./bundle.es14.js";
14
+ import { Switch as O } from "./bundle.es15.js";
15
+ import { Radio as h, RadioGroup as v } from "./bundle.es16.js";
16
16
  import { Drawer as F } from "./bundle.es17.js";
17
17
  import { Dialog as y } from "./bundle.es18.js";
18
- import { AlertDialog as R } from "./bundle.es19.js";
19
- import { LoadButton as q } from "./bundle.es20.js";
20
- import { Tabs as E } from "./bundle.es21.js";
21
- import { Countdown as J } from "./bundle.es22.js";
22
- import { TextArea as M } from "./bundle.es23.js";
23
- import { SelectTags as U } from "./bundle.es24.js";
24
- import { DatePicker as W } from "./bundle.es25.js";
25
- import { DateInput as Y } from "./bundle.es26.js";
26
- import { FileOverlay as _ } from "./bundle.es27.js";
27
- import { FormGroup as oo } from "./bundle.es28.js";
28
- import { TimePicker as eo } from "./bundle.es29.js";
29
- import { useLocalStorage as po } from "./bundle.es30.js";
30
- import { createAlertAgent as xo } from "./bundle.es31.js";
31
- import { createToaster as ao } from "./bundle.es32.js";
18
+ import { AlertDialog as j } from "./bundle.es19.js";
19
+ import { LoadButton as z } from "./bundle.es20.js";
20
+ import { Tabs as H } from "./bundle.es21.js";
21
+ import { Countdown as K } from "./bundle.es22.js";
22
+ import { TextArea as Q } from "./bundle.es23.js";
23
+ import { SelectTags as V } from "./bundle.es24.js";
24
+ import { DatePicker as X } from "./bundle.es25.js";
25
+ import { DateInput as Z } from "./bundle.es26.js";
26
+ import { FileOverlay as $ } from "./bundle.es27.js";
27
+ import { FormGroup as ro } from "./bundle.es28.js";
28
+ import { TimePicker as to } from "./bundle.es29.js";
29
+ import { useLocalStorage as mo } from "./bundle.es30.js";
30
+ import { createAlertAgent as fo } from "./bundle.es31.js";
31
+ import { createToaster as io } from "./bundle.es32.js";
32
32
  export {
33
- R as AlertDialog,
33
+ j as AlertDialog,
34
34
  e as Button,
35
35
  w as ButtonGroup,
36
- L as Checkbox,
37
- J as Countdown,
38
- Y as DateInput,
39
- W as DatePicker,
36
+ G as Checkbox,
37
+ K as Countdown,
38
+ Z as DateInput,
39
+ X as DatePicker,
40
40
  y as Dialog,
41
41
  F as Drawer,
42
- _ as FileOverlay,
43
- oo as FormGroup,
42
+ $ as FileOverlay,
43
+ ro as FormGroup,
44
44
  a as ImitateScroll,
45
45
  T as Input,
46
- q as LoadButton,
46
+ z as LoadButton,
47
47
  b as NumberInput,
48
48
  D as OptionItem,
49
- d as OptionsList,
50
- i as Popover,
51
- v as Radio,
49
+ A as OptionsList,
50
+ l as Popover,
51
+ h as Radio,
52
+ v as RadioGroup,
52
53
  x as Scrollable,
53
54
  S as Select,
54
- U as SelectTags,
55
+ V as SelectTags,
55
56
  p as Spinner,
56
- P as Switch,
57
- E as Tabs,
58
- M as TextArea,
59
- eo as TimePicker,
60
- c as Tooltip,
61
- xo as createAlertAgent,
62
- ao as createToaster,
63
- po as useLocalStorage
57
+ O as Switch,
58
+ H as Tabs,
59
+ Q as TextArea,
60
+ to as TimePicker,
61
+ u as Tooltip,
62
+ fo as createAlertAgent,
63
+ io as createToaster,
64
+ mo as useLocalStorage
64
65
  };
@@ -1,23 +1,47 @@
1
- import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
- import { useId as c } from "react";
3
- import * as d from "@radix-ui/react-radio-group";
4
- import { attr as i } from "@companix/utils-browser";
5
- const h = ({ value: t, label: e, size: m = "md", disabled: a, required: s }) => {
6
- const o = c();
7
- return /* @__PURE__ */ l(
1
+ import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
+ import { useId as p } from "react";
3
+ import * as l from "@radix-ui/react-radio-group";
4
+ import { attr as s } from "@companix/utils-browser";
5
+ const q = (t) => {
6
+ const { options: m, value: a, onChange: r, disabled: d, required: e, size: n } = t;
7
+ return /* @__PURE__ */ o(
8
+ l.Root,
9
+ {
10
+ className: "radio-group",
11
+ disabled: d,
12
+ "data-required": s(e && !a),
13
+ "data-v": a,
14
+ value: a,
15
+ onValueChange: (i) => r(i),
16
+ children: m.map((i, c) => /* @__PURE__ */ o(
17
+ h,
18
+ {
19
+ ...i,
20
+ size: n,
21
+ disabled: d,
22
+ required: e && !a
23
+ },
24
+ `radio-${i.value}-${c}`
25
+ ))
26
+ }
27
+ );
28
+ }, h = ({ value: t, label: m, size: a = "md", disabled: r, required: d }) => {
29
+ const e = p();
30
+ return /* @__PURE__ */ u(
8
31
  "span",
9
32
  {
10
33
  className: "radio",
11
- "data-disabled": i(a),
12
- "data-size": m,
13
- "data-required": i(s),
34
+ "data-disabled": s(r),
35
+ "data-size": a,
36
+ "data-required": s(d),
14
37
  children: [
15
- /* @__PURE__ */ r(d.Item, { className: "radio-box", value: t, disabled: a, id: o, children: /* @__PURE__ */ r(d.Indicator, { className: "radio-mark" }) }),
16
- /* @__PURE__ */ r("label", { className: "radio-label", htmlFor: o, "data-disabled": i(a), children: e })
38
+ /* @__PURE__ */ o(l.Item, { className: "radio-box", value: t, disabled: r, id: e, children: /* @__PURE__ */ o(l.Indicator, { className: "radio-mark" }) }),
39
+ /* @__PURE__ */ o("label", { className: "radio-label", htmlFor: e, "data-disabled": s(r), children: m })
17
40
  ]
18
41
  }
19
42
  );
20
43
  };
21
44
  export {
22
- h as Radio
45
+ h as Radio,
46
+ q as RadioGroup
23
47
  };
@@ -2,7 +2,7 @@ import { jsxs as b, jsx as o } from "react/jsx-runtime";
2
2
  import h from "classnames";
3
3
  import { attr as e } from "@companix/utils-browser";
4
4
  import { forwardRef as x } from "react";
5
- import { useInputPadding as N } from "./bundle.es50.js";
5
+ import { useInputPadding as N } from "./bundle.es52.js";
6
6
  const v = x(
7
7
  ({
8
8
  required: s,
@@ -1,7 +1,7 @@
1
1
  import { jsxs as D, jsx as t } from "react/jsx-runtime";
2
2
  import { dateToFormat as $, weeks as g, createVoids as p, getDayIndex as b, getFirstDay as u, getMonthMaxDay as k } from "./bundle.es45.js";
3
- import { CalendarHeader as F } from "./bundle.es52.js";
4
- import { useCalendar as j } from "./bundle.es53.js";
3
+ import { CalendarHeader as F } from "./bundle.es50.js";
4
+ import { useCalendar as j } from "./bundle.es51.js";
5
5
  import { attr as m } from "@companix/utils-browser";
6
6
  import { isSameDate as f } from "./bundle.es44.js";
7
7
  import { useLayoutEffect as I } from "react";
@@ -2,7 +2,7 @@ import { jsxs as T, jsx as $ } from "react/jsx-runtime";
2
2
  import { forwardRef as b, useState as I, useMemo as P, useImperativeHandle as R, useCallback as j, createElement as k } from "react";
3
3
  import * as c from "@radix-ui/react-toast";
4
4
  import { varToStyle as w } from "@companix/utils-browser";
5
- import { Toast as C } from "./bundle.es51.js";
5
+ import { Toast as C } from "./bundle.es53.js";
6
6
  var g = /* @__PURE__ */ ((e) => (e["top-center"] = "up", e["top-left"] = "left", e["top-right"] = "right", e["bottom-center"] = "down", e["bottom-left"] = "left", e["bottom-right"] = "right", e))(g || {});
7
7
  const M = b((e, h) => {
8
8
  const { side: f = "top", align: i = "center", gap: m = 14, duration: u, swipeThreshold: v, closeIcon: x } = e, [l, p] = I([]), o = P(() => ({}), []);
@@ -1,16 +1,77 @@
1
- import { useRef as l, useCallback as p } from "react";
2
- import { useEffectWithLayout as d } from "./bundle.es54.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 };
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.es8.js";
4
+ import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es45.js";
5
+ import { Icon as C } from "./bundle.es39.js";
6
+ import { faChevronLeft as E, faChevronRight as T } from "@fortawesome/free-solid-svg-icons";
7
+ import { setMonth as _, setYear as F } from "./bundle.es44.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
+ ] });
13
74
  };
14
75
  export {
15
- g as useInputPadding
76
+ y as CalendarHeader
16
77
  };
@@ -1,45 +1,51 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import * as t from "@radix-ui/react-toast";
3
- import { attr as C } from "@companix/utils-browser";
4
- import { useState as h, useRef as v, useEffect as N, useLayoutEffect as x } from "react";
5
- import { RemoveListener as R } from "./bundle.es40.js";
6
- const E = (i) => {
7
- const [c, l] = h(!1), o = v(null), {
8
- appearance: d = "neutral",
9
- icon: r,
10
- title: a,
11
- description: s,
12
- duration: m,
13
- closeIcon: u,
14
- onRemoving: p,
15
- onRemoved: f,
16
- onInitialized: L
17
- } = i;
18
- return N(() => {
19
- l(!0);
20
- }, []), x(() => {
21
- o.current && L(o.current);
22
- }, []), /* @__PURE__ */ n(
23
- t.Root,
24
- {
25
- ref: o,
26
- "data-expanded": !0,
27
- "data-appearance": d,
28
- "data-mounted": C(c),
29
- className: "toaster",
30
- duration: m,
31
- children: [
32
- /* @__PURE__ */ e(R, { callback: f }),
33
- r && /* @__PURE__ */ e("div", { className: "toaster-icon", children: r }),
34
- /* @__PURE__ */ n("div", { className: "toaster-content", children: [
35
- a && /* @__PURE__ */ e(t.Title, { className: "toaster-title", children: a }),
36
- s && /* @__PURE__ */ e(t.Description, { className: "toaster-description", children: s })
37
- ] }),
38
- /* @__PURE__ */ e(t.Close, { className: "toaster-close", onClick: p, children: u ?? /* @__PURE__ */ e("svg", { viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2.96967 2.96967C3.26256 2.67678 3.73744 2.67678 4.03033 2.96967L8 6.939L11.9697 2.96967C12.2626 2.67678 12.7374 2.67678 13.0303 2.96967C13.3232 3.26256 13.3232 3.73744 13.0303 4.03033L9.061 8L13.0303 11.9697C13.2966 12.2359 13.3208 12.6526 13.1029 12.9462L13.0303 13.0303C12.7374 13.3232 12.2626 13.3232 11.9697 13.0303L8 9.061L4.03033 13.0303C3.73744 13.3232 3.26256 13.3232 2.96967 13.0303C2.67678 12.7374 2.67678 12.2626 2.96967 11.9697L6.939 8L2.96967 4.03033C2.7034 3.76406 2.6792 3.3474 2.89705 3.05379L2.96967 2.96967Z" }) }) })
39
- ]
40
- }
1
+ import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es44.js";
2
+ import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es45.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]
41
38
  );
39
+ return {
40
+ viewDate: e,
41
+ setViewDate: u,
42
+ setPrevMonth: _,
43
+ setNextMonth: C,
44
+ isDayDisabled: D,
45
+ isMonthDisabled: k,
46
+ isYearDisabled: v
47
+ };
42
48
  };
43
49
  export {
44
- E as Toast
50
+ X as useCalendar
45
51
  };
@@ -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.es8.js";
4
- import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es45.js";
5
- import { Icon as C } from "./bundle.es39.js";
6
- import { faChevronLeft as E, faChevronRight as T } from "@fortawesome/free-solid-svg-icons";
7
- import { setMonth as _, setYear as F } from "./bundle.es44.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.es54.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,45 @@
1
- import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es44.js";
2
- import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es45.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]
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import * as t from "@radix-ui/react-toast";
3
+ import { attr as C } from "@companix/utils-browser";
4
+ import { useState as h, useRef as v, useEffect as N, useLayoutEffect as x } from "react";
5
+ import { RemoveListener as R } from "./bundle.es40.js";
6
+ const E = (i) => {
7
+ const [c, l] = h(!1), o = v(null), {
8
+ appearance: d = "neutral",
9
+ icon: r,
10
+ title: a,
11
+ description: s,
12
+ duration: m,
13
+ closeIcon: u,
14
+ onRemoving: p,
15
+ onRemoved: f,
16
+ onInitialized: L
17
+ } = i;
18
+ return N(() => {
19
+ l(!0);
20
+ }, []), x(() => {
21
+ o.current && L(o.current);
22
+ }, []), /* @__PURE__ */ n(
23
+ t.Root,
24
+ {
25
+ ref: o,
26
+ "data-expanded": !0,
27
+ "data-appearance": d,
28
+ "data-mounted": C(c),
29
+ className: "toaster",
30
+ duration: m,
31
+ children: [
32
+ /* @__PURE__ */ e(R, { callback: f }),
33
+ r && /* @__PURE__ */ e("div", { className: "toaster-icon", children: r }),
34
+ /* @__PURE__ */ n("div", { className: "toaster-content", children: [
35
+ a && /* @__PURE__ */ e(t.Title, { className: "toaster-title", children: a }),
36
+ s && /* @__PURE__ */ e(t.Description, { className: "toaster-description", children: s })
37
+ ] }),
38
+ /* @__PURE__ */ e(t.Close, { className: "toaster-close", onClick: p, children: u ?? /* @__PURE__ */ e("svg", { viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2.96967 2.96967C3.26256 2.67678 3.73744 2.67678 4.03033 2.96967L8 6.939L11.9697 2.96967C12.2626 2.67678 12.7374 2.67678 13.0303 2.96967C13.3232 3.26256 13.3232 3.73744 13.0303 4.03033L9.061 8L13.0303 11.9697C13.2966 12.2359 13.3208 12.6526 13.1029 12.9462L13.0303 13.0303C12.7374 13.3232 12.2626 13.3232 11.9697 13.0303L8 9.061L4.03033 13.0303C3.73744 13.3232 3.26256 13.3232 2.96967 13.0303C2.67678 12.7374 2.67678 12.2626 2.96967 11.9697L6.939 8L2.96967 4.03033C2.7034 3.76406 2.6792 3.3474 2.89705 3.05379L2.96967 2.96967Z" }) }) })
39
+ ]
40
+ }
38
41
  );
39
- return {
40
- viewDate: e,
41
- setViewDate: u,
42
- setPrevMonth: _,
43
- setNextMonth: C,
44
- isDayDisabled: D,
45
- isMonthDisabled: k,
46
- isYearDisabled: v
47
- };
48
42
  };
49
43
  export {
50
- X as useCalendar
44
+ E as Toast
51
45
  };
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ export { OptionsList } from './OptionItem/OptionsList';
12
12
  export { ButtonGroup } from './ButtonGroup';
13
13
  export { Checkbox } from './Checkbox';
14
14
  export { Switch } from './Switch';
15
- export { Radio } from './Radio';
15
+ export { Radio, RadioGroup } from './Radio';
16
16
  export { Drawer } from './Drawer';
17
17
  export { Dialog } from './Dialog';
18
18
  export { AlertDialog } from './DialogAlert/Alert';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companix/uikit",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "module": "./dist/bundle.es.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",