@companix/uikit 0.0.11 → 0.0.12

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/bundle.es.js CHANGED
@@ -13,8 +13,8 @@ import { ButtonGroup as B } from "./bundle.es13.js";
13
13
  import { Checkbox as O } from "./bundle.es14.js";
14
14
  import { Switch as k } from "./bundle.es15.js";
15
15
  import { Radio as C } from "./bundle.es16.js";
16
- import { Drawer as y } from "./bundle.es17.js";
17
- import { Dialog as G } from "./bundle.es18.js";
16
+ import { Drawer as G } from "./bundle.es17.js";
17
+ import { Dialog as y } from "./bundle.es18.js";
18
18
  import { AlertDialog as R } from "./bundle.es19.js";
19
19
  import { LoadButton as q } from "./bundle.es20.js";
20
20
  import { Tabs as E } from "./bundle.es21.js";
@@ -23,9 +23,10 @@ import { TextArea as M } from "./bundle.es23.js";
23
23
  import { SelectTags as U } from "./bundle.es24.js";
24
24
  import { DatePicker as W } from "./bundle.es25.js";
25
25
  import { FileOverlay as Y } from "./bundle.es26.js";
26
- import { useLocalStorage as _ } from "./bundle.es27.js";
27
- import { createAlertAgent as oo } from "./bundle.es28.js";
28
- import { createToaster as eo } from "./bundle.es29.js";
26
+ import { FormGroup as _ } from "./bundle.es27.js";
27
+ import { useLocalStorage as oo } from "./bundle.es28.js";
28
+ import { createAlertAgent as eo } from "./bundle.es29.js";
29
+ import { createToaster as po } from "./bundle.es30.js";
29
30
  export {
30
31
  R as AlertDialog,
31
32
  e as Button,
@@ -33,9 +34,10 @@ export {
33
34
  O as Checkbox,
34
35
  J as Countdown,
35
36
  W as DatePicker,
36
- G as Dialog,
37
- y as Drawer,
37
+ y as Dialog,
38
+ G as Drawer,
38
39
  Y as FileOverlay,
40
+ _ as FormGroup,
39
41
  a as ImitateScroll,
40
42
  g as Input,
41
43
  q as LoadButton,
@@ -52,7 +54,7 @@ export {
52
54
  E as Tabs,
53
55
  M as TextArea,
54
56
  c as Tooltip,
55
- oo as createAlertAgent,
56
- eo as createToaster,
57
- _ as useLocalStorage
57
+ eo as createAlertAgent,
58
+ po as createToaster,
59
+ oo as useLocalStorage
58
60
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
2
  import N from "classnames";
3
- import { Icon as v } from "./bundle.es34.js";
3
+ import { Icon as v } from "./bundle.es35.js";
4
4
  import { attr as t } from "@companix/utils-browser";
5
5
  import { forwardRef as k } from "react";
6
6
  import { faCheck as x } from "@fortawesome/free-solid-svg-icons";
@@ -1,6 +1,6 @@
1
1
  import { jsxs as x, jsx as o } from "react/jsx-runtime";
2
2
  import * as t from "@radix-ui/react-checkbox";
3
- import { Icon as h } from "./bundle.es34.js";
3
+ import { Icon as h } from "./bundle.es35.js";
4
4
  import { faCheck as l } from "@fortawesome/free-solid-svg-icons";
5
5
  import { useId as n } from "react";
6
6
  import { attr as c } from "@companix/utils-browser";
@@ -1,7 +1,7 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
2
  import * as r from "@radix-ui/react-alert-dialog";
3
3
  import { Button as c } from "./bundle.es2.js";
4
- import { RemoveListener as N } from "./bundle.es35.js";
4
+ import { RemoveListener as N } from "./bundle.es36.js";
5
5
  import { VisuallyHidden as u } from "@radix-ui/react-visually-hidden";
6
6
  const C = ({
7
7
  open: d,
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { Button as m } from "./bundle.es2.js";
3
- import { useLoading as p } from "./bundle.es36.js";
3
+ import { useLoading as p } from "./bundle.es37.js";
4
4
  const g = ({ onClick: o, appearance: r = "primary", ...i }) => {
5
5
  const { isLoading: n, isError: t, handleClick: a } = p({ onClick: o });
6
6
  return /* @__PURE__ */ e(
@@ -1,5 +1,5 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
- import { useResizeTextarea as p } from "./bundle.es37.js";
2
+ import { useResizeTextarea as p } from "./bundle.es38.js";
3
3
  import { attr as e, callMultiple as x } from "@companix/utils-browser";
4
4
  import { useEffect as u } from "react";
5
5
  const R = ({
@@ -1,10 +1,10 @@
1
1
  import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
- import { useFroozeClosing as F } from "./bundle.es30.js";
2
+ import { useFroozeClosing as F } from "./bundle.es31.js";
3
3
  import { Popover as I } from "./bundle.es6.js";
4
4
  import { OptionItem as L } from "./bundle.es10.js";
5
5
  import { OptionsList as M } from "./bundle.es12.js";
6
6
  import { useState as j, useRef as d, useMemo as h } from "react";
7
- import { Icon as g } from "./bundle.es34.js";
7
+ import { Icon as g } from "./bundle.es35.js";
8
8
  import { faClose as V, faChevronDown as B } from "@fortawesome/free-solid-svg-icons";
9
9
  import { attr as H, getActiveElementByAnotherElement as Q, contains as q } from "@companix/utils-browser";
10
10
  const ee = (v) => {
@@ -2,10 +2,10 @@ import { jsx as l, jsxs as O, Fragment as R } from "react/jsx-runtime";
2
2
  import { Popover as z } from "./bundle.es6.js";
3
3
  import { Input as Y } from "./bundle.es9.js";
4
4
  import { faClose as E, faChevronDown as S } from "@fortawesome/free-solid-svg-icons";
5
- import { Icon as k } from "./bundle.es34.js";
5
+ import { Icon as k } from "./bundle.es35.js";
6
6
  import { useState as _, useRef as q } from "react";
7
- import { Calendar as G } from "./bundle.es38.js";
8
- import { useDayDisableCheker as H } from "./bundle.es39.js";
7
+ import { Calendar as G } from "./bundle.es39.js";
8
+ import { useDayDisableCheker as H } from "./bundle.es40.js";
9
9
  import { formatTime as y, getNum as d } from "@companix/utils-js";
10
10
  const h = (t, i = "-") => {
11
11
  if (t) {
@@ -1,13 +1,14 @@
1
- import { useState as s, useEffect as c } from "react";
2
- const l = (e, a) => {
3
- const [t, o] = s(() => {
4
- const r = localStorage.getItem(e);
5
- return r ? JSON.parse(r) : a;
6
- });
7
- return c(() => {
8
- localStorage.setItem(e, JSON.stringify(t));
9
- }, [t]), [t, o];
1
+ import { jsxs as p, jsx as a } from "react/jsx-runtime";
2
+ import t from "classnames";
3
+ import { attr as n } from "@companix/utils-browser";
4
+ const u = (o) => {
5
+ const { fill: e, className: l, label: c, children: i, caption: r, apperance: m = "neutral" } = o;
6
+ return /* @__PURE__ */ p("div", { className: t("form-group", l), "data-fill": n(e), children: [
7
+ /* @__PURE__ */ a("div", { className: "form-group-label", children: c }),
8
+ i,
9
+ r && /* @__PURE__ */ a("div", { className: "form-group-caption", "data-appearance": m, children: r })
10
+ ] });
10
11
  };
11
12
  export {
12
- l as useLocalStorage
13
+ u as FormGroup
13
14
  };
@@ -1,27 +1,13 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { hash as m } from "@companix/utils-js";
3
- import { useRef as n, useMemo as s } from "react";
4
- import { Viewport as u } from "./bundle.es40.js";
5
- const h = (t = {}) => {
6
- const e = {
7
- emit: (r) => {
8
- console.error("uninitialized", r);
9
- }
10
- };
11
- return {
12
- show: (r) => {
13
- e.emit({ ...r, id: m() });
14
- },
15
- Viewport: () => {
16
- const r = n(null);
17
- return s(() => {
18
- e.emit = (o) => {
19
- r.current && r.current.showAlert(o);
20
- };
21
- }, []), /* @__PURE__ */ i(u, { ref: r, ...t });
22
- }
23
- };
1
+ import { useState as s, useEffect as c } from "react";
2
+ const l = (e, a) => {
3
+ const [t, o] = s(() => {
4
+ const r = localStorage.getItem(e);
5
+ return r ? JSON.parse(r) : a;
6
+ });
7
+ return c(() => {
8
+ localStorage.setItem(e, JSON.stringify(t));
9
+ }, [t]), [t, o];
24
10
  };
25
11
  export {
26
- h as createAlertAgent
12
+ l as useLocalStorage
27
13
  };
@@ -1,38 +1,27 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { hash as d } from "@companix/utils-js";
3
- import { Viewport as s } from "./bundle.es41.js";
4
- import { useRef as c, useMemo as l } from "react";
5
- const f = (i = {}) => {
6
- const t = {
7
- emit: (e) => {
8
- console.error("uninitialized", e);
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { hash as m } from "@companix/utils-js";
3
+ import { useRef as n, useMemo as s } from "react";
4
+ import { Viewport as u } from "./bundle.es41.js";
5
+ const h = (t = {}) => {
6
+ const e = {
7
+ emit: (r) => {
8
+ console.error("uninitialized", r);
9
9
  }
10
10
  };
11
11
  return {
12
- send: (e) => {
13
- t.emit({ ...e, id: d() });
12
+ show: (r) => {
13
+ e.emit({ ...r, id: m() });
14
14
  },
15
- Viewport: (e = {}) => {
16
- const n = c(null);
17
- return l(() => {
18
- t.emit = (r) => {
19
- n.current && n.current.addToast(r);
15
+ Viewport: () => {
16
+ const r = n(null);
17
+ return s(() => {
18
+ e.emit = (o) => {
19
+ r.current && r.current.showAlert(o);
20
20
  };
21
- }, []), /* @__PURE__ */ a(
22
- s,
23
- {
24
- ref: n,
25
- align: e.align ?? i.align,
26
- closeIcon: e.closeIcon ?? i.closeIcon,
27
- duration: e.duration ?? i.duration,
28
- gap: e.gap ?? i.gap,
29
- side: e.side ?? i.side,
30
- swipeThreshold: e.swipeThreshold ?? i.swipeThreshold
31
- }
32
- );
21
+ }, []), /* @__PURE__ */ i(u, { ref: r, ...t });
33
22
  }
34
23
  };
35
24
  };
36
25
  export {
37
- f as createToaster
26
+ h as createAlertAgent
38
27
  };
@@ -1,26 +1,38 @@
1
- import { useRef as s, useCallback as c } from "react";
2
- const p = () => {
3
- const t = s(null), r = s({ cb: null }), i = c(() => {
4
- if (t.current && t.current.parentElement) {
5
- const e = t.current.parentElement, u = e.style.getPropertyValue("--radix-popper-anchor-width"), n = e.style.getPropertyValue("transform"), o = new MutationObserver(() => {
6
- e.style.transform !== n && e.style.setProperty("transform", n);
7
- });
8
- o.observe(e, {
9
- attributes: !0,
10
- attributeFilter: ["style"]
11
- }), r.current.cb = () => {
12
- o.disconnect();
13
- }, t.current.style.setProperty("--radix-popover-trigger-width", u);
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { hash as d } from "@companix/utils-js";
3
+ import { Viewport as s } from "./bundle.es42.js";
4
+ import { useRef as c, useMemo as l } from "react";
5
+ const f = (i = {}) => {
6
+ const t = {
7
+ emit: (e) => {
8
+ console.error("uninitialized", e);
14
9
  }
15
- }, []), l = c(() => {
16
- r.current.cb && (r.current.cb(), r.current.cb = null);
17
- }, []);
10
+ };
18
11
  return {
19
- popoverRef: t,
20
- handleAnimationEnd: l,
21
- froozePopoverPosition: i
12
+ send: (e) => {
13
+ t.emit({ ...e, id: d() });
14
+ },
15
+ Viewport: (e = {}) => {
16
+ const n = c(null);
17
+ return l(() => {
18
+ t.emit = (r) => {
19
+ n.current && n.current.addToast(r);
20
+ };
21
+ }, []), /* @__PURE__ */ a(
22
+ s,
23
+ {
24
+ ref: n,
25
+ align: e.align ?? i.align,
26
+ closeIcon: e.closeIcon ?? i.closeIcon,
27
+ duration: e.duration ?? i.duration,
28
+ gap: e.gap ?? i.gap,
29
+ side: e.side ?? i.side,
30
+ swipeThreshold: e.swipeThreshold ?? i.swipeThreshold
31
+ }
32
+ );
33
+ }
22
34
  };
23
35
  };
24
36
  export {
25
- p as useFroozeClosing
37
+ f as createToaster
26
38
  };
@@ -1,83 +1,26 @@
1
- import { jsxs as n, jsx as c } from "react/jsx-runtime";
2
- import b from "classnames";
3
- import { attr as r } from "@companix/utils-browser";
4
- import { forwardRef as g, useRef as w, useCallback as y } from "react";
5
- import { Icon as a } from "./bundle.es34.js";
6
- import { faClose as D, faChevronDown as R } from "@fortawesome/free-solid-svg-icons";
7
- import { VisuallyHidden as T } from "@radix-ui/react-visually-hidden";
8
- const V = g(
9
- ({
10
- required: u,
11
- size: d,
12
- fill: m,
13
- leftElement: l,
14
- className: p,
15
- value: o,
16
- clearButton: f,
17
- placeholder: C,
18
- clearButtonIcon: h,
19
- disabled: s,
20
- onClear: I,
21
- ...i
22
- }, N) => {
23
- const e = w(null), k = y(
24
- (t) => {
25
- if (!e.current || !document)
26
- return;
27
- t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
28
- },
29
- [e]
30
- ), x = (t) => {
31
- document && document.activeElement === e.current && t.preventDefault();
32
- }, v = (t) => {
33
- s || k(t);
34
- }, F = (t) => {
35
- x(t);
36
- }, z = (t) => {
37
- e.current && e.current.focus(), I?.(t);
38
- };
39
- return /* @__PURE__ */ n(
40
- "div",
41
- {
42
- ref: N,
43
- className: b("form select", p),
44
- "data-size": d ?? "md",
45
- "data-fill": r(m),
46
- "data-required": r(u),
47
- "data-disabled": r(s),
48
- onMouseDown: F,
49
- ...i,
50
- onClick: v,
51
- children: [
52
- /* @__PURE__ */ n("div", { className: "select-layout form-input", children: [
53
- l && /* @__PURE__ */ c("div", { className: "select-element", children: l }),
54
- /* @__PURE__ */ c("div", { className: "select-content", children: /* @__PURE__ */ n("div", { className: "select-content-text", "aria-disabled": s, children: [
55
- !o && /* @__PURE__ */ c("span", { className: "select-placeholder", children: C }),
56
- o
57
- ] }) }),
58
- /* @__PURE__ */ n("div", { className: "select-element", children: [
59
- f && o && /* @__PURE__ */ c("button", { className: "select-close-button", onClick: z, children: h ?? /* @__PURE__ */ c(a, { className: "select-close-icon", icon: D, size: "xxxs" }) }),
60
- /* @__PURE__ */ c(a, { className: "expand-icon select-expand", icon: R, size: "xxxs" })
61
- ] })
62
- ] }),
63
- /* @__PURE__ */ c(T, { asChild: !0, children: /* @__PURE__ */ c(
64
- "input",
65
- {
66
- ref: e,
67
- autoComplete: "off",
68
- autoCapitalize: "none",
69
- autoCorrect: "off",
70
- spellCheck: "false",
71
- "aria-autocomplete": "none",
72
- onClick: i.onClick,
73
- readOnly: !0
74
- }
75
- ) })
76
- ]
77
- }
78
- );
79
- }
80
- );
1
+ import { useRef as s, useCallback as c } from "react";
2
+ const p = () => {
3
+ const t = s(null), r = s({ cb: null }), i = c(() => {
4
+ if (t.current && t.current.parentElement) {
5
+ const e = t.current.parentElement, u = e.style.getPropertyValue("--radix-popper-anchor-width"), n = e.style.getPropertyValue("transform"), o = new MutationObserver(() => {
6
+ e.style.transform !== n && e.style.setProperty("transform", n);
7
+ });
8
+ o.observe(e, {
9
+ attributes: !0,
10
+ attributeFilter: ["style"]
11
+ }), r.current.cb = () => {
12
+ o.disconnect();
13
+ }, t.current.style.setProperty("--radix-popover-trigger-width", u);
14
+ }
15
+ }, []), l = c(() => {
16
+ r.current.cb && (r.current.cb(), r.current.cb = null);
17
+ }, []);
18
+ return {
19
+ popoverRef: t,
20
+ handleAnimationEnd: l,
21
+ froozePopoverPosition: i
22
+ };
23
+ };
81
24
  export {
82
- V as SelectInput
25
+ p as useFroozeClosing
83
26
  };
@@ -1,20 +1,83 @@
1
- import { useRef as i, useCallback as T } from "react";
2
- const a = () => {
3
- const t = i(null), l = i(null);
4
- return { scrollToElement: T(
5
- (r, u = !1) => {
6
- const o = t.current, s = l.current;
7
- if (!o || !s || r < 0 || r > s.children.length)
8
- return;
9
- const n = s.children[r];
10
- if (!n)
11
- return;
12
- const c = o.offsetHeight, f = o.scrollTop, e = n.offsetTop, p = n.offsetHeight;
13
- u ? o.scrollTop = e - c / 2 + p / 2 : e + p > c + f ? o.scrollTop = e - c + p : e < f && (o.scrollTop = e);
14
- },
15
- [l, t]
16
- ), scrollBoxRef: t, optionsWrapperRef: l };
17
- };
1
+ import { jsxs as n, jsx as c } from "react/jsx-runtime";
2
+ import b from "classnames";
3
+ import { attr as r } from "@companix/utils-browser";
4
+ import { forwardRef as g, useRef as w, useCallback as y } from "react";
5
+ import { Icon as a } from "./bundle.es35.js";
6
+ import { faClose as D, faChevronDown as R } from "@fortawesome/free-solid-svg-icons";
7
+ import { VisuallyHidden as T } from "@radix-ui/react-visually-hidden";
8
+ const V = g(
9
+ ({
10
+ required: u,
11
+ size: d,
12
+ fill: m,
13
+ leftElement: l,
14
+ className: p,
15
+ value: o,
16
+ clearButton: f,
17
+ placeholder: C,
18
+ clearButtonIcon: h,
19
+ disabled: s,
20
+ onClear: I,
21
+ ...i
22
+ }, N) => {
23
+ const e = w(null), k = y(
24
+ (t) => {
25
+ if (!e.current || !document)
26
+ return;
27
+ t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
28
+ },
29
+ [e]
30
+ ), x = (t) => {
31
+ document && document.activeElement === e.current && t.preventDefault();
32
+ }, v = (t) => {
33
+ s || k(t);
34
+ }, F = (t) => {
35
+ x(t);
36
+ }, z = (t) => {
37
+ e.current && e.current.focus(), I?.(t);
38
+ };
39
+ return /* @__PURE__ */ n(
40
+ "div",
41
+ {
42
+ ref: N,
43
+ className: b("form select", p),
44
+ "data-size": d ?? "md",
45
+ "data-fill": r(m),
46
+ "data-required": r(u),
47
+ "data-disabled": r(s),
48
+ onMouseDown: F,
49
+ ...i,
50
+ onClick: v,
51
+ children: [
52
+ /* @__PURE__ */ n("div", { className: "select-layout form-input", children: [
53
+ l && /* @__PURE__ */ c("div", { className: "select-element", children: l }),
54
+ /* @__PURE__ */ c("div", { className: "select-content", children: /* @__PURE__ */ n("div", { className: "select-content-text", "aria-disabled": s, children: [
55
+ !o && /* @__PURE__ */ c("span", { className: "select-placeholder", children: C }),
56
+ o
57
+ ] }) }),
58
+ /* @__PURE__ */ n("div", { className: "select-element", children: [
59
+ f && o && /* @__PURE__ */ c("button", { className: "select-close-button", onClick: z, children: h ?? /* @__PURE__ */ c(a, { className: "select-close-icon", icon: D, size: "xxxs" }) }),
60
+ /* @__PURE__ */ c(a, { className: "expand-icon select-expand", icon: R, size: "xxxs" })
61
+ ] })
62
+ ] }),
63
+ /* @__PURE__ */ c(T, { asChild: !0, children: /* @__PURE__ */ c(
64
+ "input",
65
+ {
66
+ ref: e,
67
+ autoComplete: "off",
68
+ autoCapitalize: "none",
69
+ autoCorrect: "off",
70
+ spellCheck: "false",
71
+ "aria-autocomplete": "none",
72
+ onClick: i.onClick,
73
+ readOnly: !0
74
+ }
75
+ ) })
76
+ ]
77
+ }
78
+ );
79
+ }
80
+ );
18
81
  export {
19
- a as useScrollListController
82
+ V as SelectInput
20
83
  };
@@ -1,16 +1,20 @@
1
- import { useRef as u, useLayoutEffect as f, useEffect as s } from "react";
2
- const o = (t, r) => {
3
- const e = u(!1);
4
- f(() => {
5
- e.current = !0, t();
6
- }, []), s(() => {
7
- if (e.current) {
8
- e.current = !1;
9
- return;
10
- }
11
- t();
12
- }, r);
1
+ import { useRef as i, useCallback as T } from "react";
2
+ const a = () => {
3
+ const t = i(null), l = i(null);
4
+ return { scrollToElement: T(
5
+ (r, u = !1) => {
6
+ const o = t.current, s = l.current;
7
+ if (!o || !s || r < 0 || r > s.children.length)
8
+ return;
9
+ const n = s.children[r];
10
+ if (!n)
11
+ return;
12
+ const c = o.offsetHeight, f = o.scrollTop, e = n.offsetTop, p = n.offsetHeight;
13
+ u ? o.scrollTop = e - c / 2 + p / 2 : e + p > c + f ? o.scrollTop = e - c + p : e < f && (o.scrollTop = e);
14
+ },
15
+ [l, t]
16
+ ), scrollBoxRef: t, optionsWrapperRef: l };
13
17
  };
14
18
  export {
15
- o as useLayoutAndUpdate
19
+ a as useScrollListController
16
20
  };
@@ -1,24 +1,16 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import f from "classnames";
3
- import { forwardRef as l } from "react";
4
- const g = l(
5
- ({ icon: r, className: t, size: i = "m", ...e }, a) => {
6
- const [n, c, , , m] = r.icon;
7
- return /* @__PURE__ */ o(
8
- "svg",
9
- {
10
- ref: a,
11
- "data-prefix": r.prefix,
12
- "data-icon": r.iconName,
13
- viewBox: `0 0 ${n} ${c}`,
14
- className: f(`icon icon-size-${i}`, t),
15
- ...e,
16
- role: "img",
17
- children: /* @__PURE__ */ o(s, { paths: m })
18
- }
19
- );
20
- }
21
- ), s = ({ paths: r }) => Array.isArray(r) ? /* @__PURE__ */ o("g", { children: r.map((t, i) => /* @__PURE__ */ o("path", { fill: "currentColor", d: t }, `-d-${i}`)) }) : /* @__PURE__ */ o("path", { fill: "currentColor", d: r });
1
+ import { useRef as u, useLayoutEffect as f, useEffect as s } from "react";
2
+ const o = (t, r) => {
3
+ const e = u(!1);
4
+ f(() => {
5
+ e.current = !0, t();
6
+ }, []), s(() => {
7
+ if (e.current) {
8
+ e.current = !1;
9
+ return;
10
+ }
11
+ t();
12
+ }, r);
13
+ };
22
14
  export {
23
- g as Icon
15
+ o as useLayoutAndUpdate
24
16
  };
@@ -1,7 +1,24 @@
1
- import { useEffect as r } from "react";
2
- const n = ({ callback: e }) => (r(() => () => {
3
- e?.();
4
- }, []), null);
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import f from "classnames";
3
+ import { forwardRef as l } from "react";
4
+ const g = l(
5
+ ({ icon: r, className: t, size: i = "m", ...e }, a) => {
6
+ const [n, c, , , m] = r.icon;
7
+ return /* @__PURE__ */ o(
8
+ "svg",
9
+ {
10
+ ref: a,
11
+ "data-prefix": r.prefix,
12
+ "data-icon": r.iconName,
13
+ viewBox: `0 0 ${n} ${c}`,
14
+ className: f(`icon icon-size-${i}`, t),
15
+ ...e,
16
+ role: "img",
17
+ children: /* @__PURE__ */ o(s, { paths: m })
18
+ }
19
+ );
20
+ }
21
+ ), s = ({ paths: r }) => Array.isArray(r) ? /* @__PURE__ */ o("g", { children: r.map((t, i) => /* @__PURE__ */ o("path", { fill: "currentColor", d: t }, `-d-${i}`)) }) : /* @__PURE__ */ o("path", { fill: "currentColor", d: r });
5
22
  export {
6
- n as RemoveListener
23
+ g as Icon
7
24
  };
@@ -1,23 +1,7 @@
1
- import { useState as a } from "react";
2
- const l = ({ onClick: i }) => {
3
- const [e, s] = a({ isLoading: !1, isError: !1 });
4
- return {
5
- ...e,
6
- handleClick: (o) => {
7
- e.isLoading || i(() => s({ isLoading: !0, isError: !1 }), o).then(() => {
8
- s({
9
- isLoading: !1,
10
- isError: !1
11
- });
12
- }).catch((r) => {
13
- console.log(r), s({
14
- isLoading: !1,
15
- isError: !0
16
- });
17
- });
18
- }
19
- };
20
- };
1
+ import { useEffect as r } from "react";
2
+ const n = ({ callback: e }) => (r(() => () => {
3
+ e?.();
4
+ }, []), null);
21
5
  export {
22
- l as useLoading
6
+ n as RemoveListener
23
7
  };