sander-ui 0.1.4 → 0.1.6

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 (79) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.js +53 -51
  3. package/dist/index10.js +2 -2
  4. package/dist/index11.js +1 -1
  5. package/dist/index12.js +44 -43
  6. package/dist/index13.js +2 -2
  7. package/dist/index14.js +41 -21
  8. package/dist/index15.js +22 -19
  9. package/dist/index16.js +20 -75
  10. package/dist/index17.js +72 -58
  11. package/dist/index18.js +56 -35
  12. package/dist/index19.js +40 -31
  13. package/dist/index20.js +30 -25
  14. package/dist/index21.js +26 -18
  15. package/dist/index22.js +15 -36
  16. package/dist/index23.js +39 -46
  17. package/dist/index24.js +39 -124
  18. package/dist/index25.js +132 -18
  19. package/dist/index26.js +18 -23
  20. package/dist/index27.js +23 -55
  21. package/dist/index28.js +55 -19
  22. package/dist/index29.js +19 -46
  23. package/dist/index3.js +2 -2
  24. package/dist/index30.js +46 -5
  25. package/dist/index31.js +5 -17
  26. package/dist/index32.js +17 -8
  27. package/dist/index33.js +27 -4
  28. package/dist/index34.js +26 -27
  29. package/dist/index35.js +24 -23
  30. package/dist/index36.js +22 -18
  31. package/dist/index37.js +8 -23
  32. package/dist/index38.js +14 -8
  33. package/dist/index39.js +8 -14
  34. package/dist/index4.js +7 -7
  35. package/dist/index40.js +7 -8
  36. package/dist/index41.js +7 -7
  37. package/dist/index42.js +15 -7
  38. package/dist/index43.js +4 -26
  39. package/dist/index44.js +4 -13
  40. package/dist/index45.js +10 -39
  41. package/dist/index46.js +20 -22
  42. package/dist/index47.js +40 -25
  43. package/dist/index48.js +4 -13
  44. package/dist/index49.js +18 -20
  45. package/dist/index5.js +3 -3
  46. package/dist/index50.js +12 -14
  47. package/dist/index51.js +17 -4
  48. package/dist/index52.js +16 -16
  49. package/dist/index53.js +11 -26
  50. package/dist/index54.js +25 -14
  51. package/dist/index55.js +16 -12
  52. package/dist/index56.js +30 -41
  53. package/dist/index57.js +15 -4
  54. package/dist/index58.js +12 -16
  55. package/dist/index59.js +20 -16
  56. package/dist/index6.js +3 -3
  57. package/dist/index60.js +25 -22
  58. package/dist/index61.js +22 -20
  59. package/dist/index62.js +16 -16
  60. package/dist/index63.js +8 -13
  61. package/dist/index64.js +39 -30
  62. package/dist/index65.js +23 -35
  63. package/dist/index66.js +13 -2
  64. package/dist/index67.js +13 -4
  65. package/dist/index68.js +35 -21
  66. package/dist/index69.js +2 -2
  67. package/dist/index7.js +4 -4
  68. package/dist/index70.js +4 -2
  69. package/dist/index71.js +20 -5
  70. package/dist/index72.js +2 -34
  71. package/dist/index73.js +2 -12
  72. package/dist/index74.js +5 -6
  73. package/dist/index75.js +33 -4
  74. package/dist/index76.js +14 -0
  75. package/dist/index77.js +9 -0
  76. package/dist/index78.js +7 -0
  77. package/dist/index8.js +12 -12
  78. package/dist/index9.js +2 -2
  79. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,78 +1,80 @@
1
1
  /* empty css */
2
2
  import { Accordion as t, AccordionItem as a } from "./index3.js";
3
3
  import { Alert as m } from "./index4.js";
4
- import { Avatar as d, AvatarGroup as f } from "./index5.js";
4
+ import { Avatar as f, AvatarGroup as d } from "./index5.js";
5
5
  import { Badge as l } from "./index6.js";
6
6
  import { Breadcrumbs as T } from "./index7.js";
7
7
  import { Button as b } from "./index8.js";
8
- import { Card as D, CardBody as c, CardFooter as B, CardHeader as s } from "./index9.js";
8
+ import { Card as B, CardBody as C, CardFooter as D, CardHeader as u } from "./index9.js";
9
9
  import { Checkbox as g } from "./index10.js";
10
10
  import { ConfirmModal as H } from "./index11.js";
11
- import { Drawer as S, DrawerBody as y, DrawerFooter as k, DrawerHeader as F } from "./index12.js";
11
+ import { Drawer as S, DrawerBody as y, DrawerFooter as I, DrawerHeader as k } from "./index12.js";
12
12
  import { Dropdown as P, DropdownContent as h, DropdownItem as v, DropdownSeparator as G, DropdownTrigger as R } from "./index13.js";
13
- import { Input as j } from "./index14.js";
14
- import { LinkButton as z } from "./index15.js";
15
- import { Modal as J, ModalBody as K, ModalFooter as N, ModalHeader as O } from "./index16.js";
16
- import { Pagination as U } from "./index17.js";
17
- import { Progress as W } from "./index18.js";
18
- import { RadioGroup as Y } from "./index19.js";
19
- import { Select as _ } from "./index20.js";
20
- import { Skeleton as oo } from "./index21.js";
21
- import { Spinner as eo } from "./index22.js";
22
- import { Switch as ao } from "./index23.js";
23
- import { TabPanel as mo, Tabs as xo } from "./index24.js";
24
- import { Table as no, TableBody as lo, TableCell as io, TableHead as To, TableHeader as wo, TableRow as bo } from "./index25.js";
25
- import { Textarea as Do } from "./index26.js";
26
- import { Toast as Bo } from "./index27.js";
27
- import { ToastContainer as uo } from "./index28.js";
28
- import { Tooltip as Ao } from "./index29.js";
13
+ import { IconButton as j } from "./index14.js";
14
+ import { Input as z } from "./index15.js";
15
+ import { LinkButton as J } from "./index16.js";
16
+ import { Modal as N, ModalBody as O, ModalFooter as Q, ModalHeader as U } from "./index17.js";
17
+ import { Pagination as W } from "./index18.js";
18
+ import { Progress as Y } from "./index19.js";
19
+ import { RadioGroup as _ } from "./index20.js";
20
+ import { Select as oo } from "./index21.js";
21
+ import { Skeleton as eo } from "./index22.js";
22
+ import { Spinner as ao } from "./index23.js";
23
+ import { Switch as mo } from "./index24.js";
24
+ import { TabPanel as fo, Tabs as no } from "./index25.js";
25
+ import { Table as io, TableBody as To, TableCell as wo, TableHead as bo, TableHeader as co, TableRow as Bo } from "./index26.js";
26
+ import { Textarea as Do } from "./index27.js";
27
+ import { Toast as so } from "./index28.js";
28
+ import { ToastContainer as Ao } from "./index29.js";
29
+ import { Tooltip as Mo } from "./index30.js";
29
30
  export {
30
31
  t as Accordion,
31
32
  a as AccordionItem,
32
33
  m as Alert,
33
- d as Avatar,
34
- f as AvatarGroup,
34
+ f as Avatar,
35
+ d as AvatarGroup,
35
36
  l as Badge,
36
37
  T as Breadcrumbs,
37
38
  b as Button,
38
- D as Card,
39
- c as CardBody,
40
- B as CardFooter,
41
- s as CardHeader,
39
+ B as Card,
40
+ C as CardBody,
41
+ D as CardFooter,
42
+ u as CardHeader,
42
43
  g as Checkbox,
43
44
  H as ConfirmModal,
44
45
  S as Drawer,
45
46
  y as DrawerBody,
46
- k as DrawerFooter,
47
- F as DrawerHeader,
47
+ I as DrawerFooter,
48
+ k as DrawerHeader,
48
49
  P as Dropdown,
49
50
  h as DropdownContent,
50
51
  v as DropdownItem,
51
52
  G as DropdownSeparator,
52
53
  R as DropdownTrigger,
53
- j as Input,
54
- z as LinkButton,
55
- J as Modal,
56
- K as ModalBody,
57
- N as ModalFooter,
58
- O as ModalHeader,
59
- U as Pagination,
60
- W as Progress,
61
- Y as RadioGroup,
62
- _ as Select,
63
- oo as Skeleton,
64
- eo as Spinner,
65
- ao as Switch,
66
- mo as TabPanel,
67
- no as Table,
68
- lo as TableBody,
69
- io as TableCell,
70
- To as TableHead,
71
- wo as TableHeader,
72
- bo as TableRow,
73
- xo as Tabs,
54
+ j as IconButton,
55
+ z as Input,
56
+ J as LinkButton,
57
+ N as Modal,
58
+ O as ModalBody,
59
+ Q as ModalFooter,
60
+ U as ModalHeader,
61
+ W as Pagination,
62
+ Y as Progress,
63
+ _ as RadioGroup,
64
+ oo as Select,
65
+ eo as Skeleton,
66
+ ao as Spinner,
67
+ mo as Switch,
68
+ fo as TabPanel,
69
+ io as Table,
70
+ To as TableBody,
71
+ wo as TableCell,
72
+ bo as TableHead,
73
+ co as TableHeader,
74
+ Bo as TableRow,
75
+ no as Tabs,
74
76
  Do as Textarea,
75
- Bo as Toast,
76
- uo as ToastContainer,
77
- Ao as Tooltip
77
+ so as Toast,
78
+ Ao as ToastContainer,
79
+ Mo as Tooltip
78
80
  };
package/dist/index10.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
- import p from "./index30.js";
2
+ import p from "./index31.js";
3
3
  import { forwardRef as x, useRef as v, useEffect as N } from "react";
4
- import e from "./index62.js";
4
+ import e from "./index55.js";
5
5
  const y = x(
6
6
  ({ label: l, description: t, error: c, indeterminate: a, id: o, className: h, ...u }, i) => {
7
7
  const n = v(null);
package/dist/index11.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
- import { Modal as s, ModalHeader as f, ModalBody as u, ModalFooter as M } from "./index16.js";
2
+ import { Modal as s, ModalHeader as f, ModalBody as u, ModalFooter as M } from "./index17.js";
3
3
  import { Button as d } from "./index8.js";
4
4
  const b = ({
5
5
  open: i,
package/dist/index12.js CHANGED
@@ -1,79 +1,80 @@
1
1
  import { jsx as l, jsxs as b } from "react/jsx-runtime";
2
- import n from "./index30.js";
2
+ import c from "./index31.js";
3
3
  import { useRef as v, useState as d, useEffect as g } from "react";
4
4
  import { createPortal as w } from "react-dom";
5
- import r from "./index45.js";
6
- import D from "./index42.js";
7
- const B = ({
8
- open: s,
5
+ import { useScrollLock as D } from "./index53.js";
6
+ import r from "./index64.js";
7
+ import y from "./index41.js";
8
+ const R = ({
9
+ open: o,
9
10
  onClose: t,
10
- children: o,
11
- side: c = "right",
12
- size: h = "md",
13
- className: p,
11
+ children: s,
12
+ side: f = "right",
13
+ size: p = "md",
14
+ className: h,
14
15
  ...N
15
16
  }) => {
16
- const a = v(null), [f, m] = d(!1), [i, u] = d(!1);
17
- return g(() => {
18
- s ? (m(!0), u(!1)) : m((e) => (e && u(!0), e));
19
- }, [s]), g(() => {
20
- const e = a.current;
21
- f && !i && e && !e.open && e.showModal();
22
- }, [f, i]), f ? w(
17
+ const i = v(null), [n, m] = d(!1), [a, u] = d(!1);
18
+ return D(n && !a), g(() => {
19
+ o ? (m(!0), u(!1)) : m((e) => (e && u(!0), e));
20
+ }, [o]), g(() => {
21
+ const e = i.current;
22
+ n && !a && e && !e.open && (e.showModal(), e.focus());
23
+ }, [n, a]), n ? w(
23
24
  /* @__PURE__ */ l(
24
25
  "dialog",
25
26
  {
26
- ref: a,
27
- className: n(
27
+ ref: i,
28
+ className: c(
28
29
  r.dialog,
29
- r[c],
30
- r[`size-${h}`],
31
- i && r.closing,
32
- p
30
+ r[f],
31
+ r[`size-${p}`],
32
+ a && r.closing,
33
+ h
33
34
  ),
34
35
  onAnimationEnd: () => {
35
- i && (a.current?.close(), m(!1), u(!1));
36
+ a && (i.current?.close(), m(!1), u(!1));
36
37
  },
37
38
  onCancel: (e) => {
38
39
  e.preventDefault(), t();
39
40
  },
40
41
  onClick: (e) => {
41
- e.target === a.current && t();
42
+ e.target === i.current && t();
42
43
  },
43
44
  ...N,
44
- children: /* @__PURE__ */ l("div", { className: r.content, children: o })
45
+ children: /* @__PURE__ */ l("div", { className: r.content, children: s })
45
46
  }
46
47
  ),
47
48
  document.body
48
49
  ) : null;
49
- }, E = ({
50
- children: s,
50
+ }, S = ({
51
+ children: o,
51
52
  onClose: t,
52
- className: o,
53
- ...c
54
- }) => /* @__PURE__ */ b("div", { className: n(r.header, o), ...c, children: [
55
- /* @__PURE__ */ l("h2", { className: r.title, children: s }),
53
+ className: s,
54
+ ...f
55
+ }) => /* @__PURE__ */ b("div", { className: c(r.header, s), ...f, children: [
56
+ /* @__PURE__ */ l("h2", { className: r.title, children: o }),
56
57
  t && /* @__PURE__ */ l(
57
58
  "button",
58
59
  {
59
60
  onClick: t,
60
61
  "aria-label": "Close",
61
62
  className: r.closeButton,
62
- children: /* @__PURE__ */ l(D, { size: 20 })
63
+ children: /* @__PURE__ */ l(y, { size: 20 })
63
64
  }
64
65
  )
65
- ] }), R = ({
66
- children: s,
66
+ ] }), A = ({
67
+ children: o,
67
68
  className: t,
68
- ...o
69
- }) => /* @__PURE__ */ l("div", { className: n(r.body, t), ...o, children: s }), A = ({
70
- children: s,
69
+ ...s
70
+ }) => /* @__PURE__ */ l("div", { className: c(r.body, t), ...s, children: o }), F = ({
71
+ children: o,
71
72
  className: t,
72
- ...o
73
- }) => /* @__PURE__ */ l("div", { className: n(r.footer, t), ...o, children: s });
73
+ ...s
74
+ }) => /* @__PURE__ */ l("div", { className: c(r.footer, t), ...s, children: o });
74
75
  export {
75
- B as Drawer,
76
- R as DrawerBody,
77
- A as DrawerFooter,
78
- E as DrawerHeader
76
+ R as Drawer,
77
+ A as DrawerBody,
78
+ F as DrawerFooter,
79
+ S as DrawerHeader
79
80
  };
package/dist/index13.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx as w } from "react/jsx-runtime";
2
- import b from "./index30.js";
2
+ import b from "./index31.js";
3
3
  import { useState as h, useRef as v, useId as R, useEffect as k, cloneElement as E, createContext as I, useContext as y } from "react";
4
- import m from "./index36.js";
4
+ import m from "./index49.js";
5
5
  const C = I(null);
6
6
  function x() {
7
7
  const t = y(C);
package/dist/index14.js CHANGED
@@ -1,25 +1,45 @@
1
- import { jsxs as m, jsx as i } from "react/jsx-runtime";
2
- import p from "./index30.js";
3
- import { forwardRef as n } from "react";
4
- import a from "./index44.js";
5
- const c = n(
6
- ({ label: s, error: r, id: e, className: t, ...l }, o) => /* @__PURE__ */ m("div", { className: a.wrapper, children: [
7
- s && /* @__PURE__ */ i("label", { htmlFor: e, className: a.label, children: s }),
8
- /* @__PURE__ */ i(
9
- "input",
10
- {
11
- id: e,
12
- ref: o,
13
- "aria-invalid": r ? !0 : void 0,
14
- "aria-describedby": r ? `${e}-error` : void 0,
15
- className: p(a.input, r && a.inputError, t),
16
- ...l
17
- }
1
+ import { jsxs as l, jsx as n } from "react/jsx-runtime";
2
+ import r from "./index31.js";
3
+ import t from "./index35.js";
4
+ import s from "./index45.js";
5
+ import { Spinner as b } from "./index23.js";
6
+ const N = ({
7
+ icon: e,
8
+ variant: m = "ghost",
9
+ size: i = "md",
10
+ type: c = "button",
11
+ loading: o,
12
+ disabled: p,
13
+ className: u,
14
+ ...a
15
+ }) => /* @__PURE__ */ l(
16
+ "button",
17
+ {
18
+ type: c,
19
+ disabled: o || p,
20
+ "aria-busy": o || void 0,
21
+ className: r(
22
+ t.button,
23
+ t[m],
24
+ s.iconButton,
25
+ s[i],
26
+ u
18
27
  ),
19
- r && /* @__PURE__ */ i("p", { id: `${e}-error`, role: "alert", className: a.error, children: r })
20
- ] })
28
+ ...a,
29
+ children: [
30
+ o ? /* @__PURE__ */ n(b, { className: t.spinner }) : null,
31
+ /* @__PURE__ */ n(
32
+ "span",
33
+ {
34
+ className: r(t.content, {
35
+ [t.hidden]: o
36
+ }),
37
+ children: e
38
+ }
39
+ )
40
+ ]
41
+ }
21
42
  );
22
- c.displayName = "Input";
23
43
  export {
24
- c as Input
44
+ N as IconButton
25
45
  };
package/dist/index15.js CHANGED
@@ -1,22 +1,25 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import a from "./index30.js";
3
- import r from "./index47.js";
4
- const u = ({
5
- variant: t = "primary",
6
- size: o = "md",
7
- children: m,
8
- className: n,
9
- href: s,
10
- ...i
11
- }) => /* @__PURE__ */ p(
12
- "a",
13
- {
14
- href: s,
15
- className: a(r.button, r[t], r[o], n),
16
- ...i,
17
- children: m
18
- }
1
+ import { jsxs as m, jsx as i } from "react/jsx-runtime";
2
+ import p from "./index31.js";
3
+ import { forwardRef as n } from "react";
4
+ import a from "./index58.js";
5
+ const c = n(
6
+ ({ label: s, error: r, id: e, className: t, ...l }, o) => /* @__PURE__ */ m("div", { className: a.wrapper, children: [
7
+ s && /* @__PURE__ */ i("label", { htmlFor: e, className: a.label, children: s }),
8
+ /* @__PURE__ */ i(
9
+ "input",
10
+ {
11
+ id: e,
12
+ ref: o,
13
+ "aria-invalid": r ? !0 : void 0,
14
+ "aria-describedby": r ? `${e}-error` : void 0,
15
+ className: p(a.input, r && a.inputError, t),
16
+ ...l
17
+ }
18
+ ),
19
+ r && /* @__PURE__ */ i("p", { id: `${e}-error`, role: "alert", className: a.error, children: r })
20
+ ] })
19
21
  );
22
+ c.displayName = "Input";
20
23
  export {
21
- u as LinkButton
24
+ c as Input
22
25
  };
package/dist/index16.js CHANGED
@@ -1,77 +1,22 @@
1
- import { jsx as l, jsxs as b } from "react/jsx-runtime";
2
- import i from "./index30.js";
3
- import { useRef as h, useState as u, useEffect as g } from "react";
4
- import { createPortal as v } from "react-dom";
5
- import o from "./index43.js";
6
- import M from "./index42.js";
7
- const B = ({
8
- open: s,
9
- onClose: t,
10
- children: r,
11
- size: c = "sm",
12
- className: p,
13
- ...N
14
- }) => {
15
- const a = h(null), [f, d] = u(!1), [n, m] = u(!1);
16
- return g(() => {
17
- s ? (d(!0), m(!1)) : d((e) => (e && m(!0), e));
18
- }, [s]), g(() => {
19
- const e = a.current;
20
- f && !n && e && !e.open && e.showModal();
21
- }, [f, n]), f ? v(
22
- /* @__PURE__ */ l(
23
- "dialog",
24
- {
25
- ref: a,
26
- className: i(
27
- o.dialog,
28
- o[`size-${c}`],
29
- n && o.closing,
30
- p
31
- ),
32
- onAnimationEnd: () => {
33
- n && (a.current?.close(), d(!1), m(!1));
34
- },
35
- onCancel: (e) => {
36
- e.preventDefault(), t();
37
- },
38
- onClick: (e) => {
39
- e.target === a.current && t();
40
- },
41
- ...N,
42
- children: /* @__PURE__ */ l("div", { className: o.content, children: r })
43
- }
44
- ),
45
- document.body
46
- ) : null;
47
- }, E = ({
48
- children: s,
49
- onClose: t,
50
- className: r,
51
- ...c
52
- }) => /* @__PURE__ */ b("div", { className: i(o.header, r), ...c, children: [
53
- /* @__PURE__ */ l("h2", { className: o.title, children: s }),
54
- t && /* @__PURE__ */ l(
55
- "button",
56
- {
57
- onClick: t,
58
- "aria-label": "Close",
59
- className: o.closeButton,
60
- children: /* @__PURE__ */ l(M, { size: 20 })
61
- }
62
- )
63
- ] }), R = ({
64
- children: s,
65
- className: t,
66
- ...r
67
- }) => /* @__PURE__ */ l("div", { className: i(o.body, t), ...r, children: s }), w = ({
68
- children: s,
69
- className: t,
70
- ...r
71
- }) => /* @__PURE__ */ l("div", { className: i(o.footer, t), ...r, children: s });
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import a from "./index31.js";
3
+ import t from "./index35.js";
4
+ const f = ({
5
+ variant: o = "primary",
6
+ size: r = "md",
7
+ children: m,
8
+ className: n,
9
+ href: i,
10
+ ...p
11
+ }) => /* @__PURE__ */ s(
12
+ "a",
13
+ {
14
+ href: i,
15
+ className: a(t.button, t[o], t[r], n),
16
+ ...p,
17
+ children: m
18
+ }
19
+ );
72
20
  export {
73
- B as Modal,
74
- R as ModalBody,
75
- w as ModalFooter,
76
- E as ModalHeader
21
+ f as LinkButton
77
22
  };
package/dist/index17.js CHANGED
@@ -1,64 +1,78 @@
1
- import { jsxs as f, jsx as e } from "react/jsx-runtime";
2
- import u from "./index30.js";
3
- import n from "./index50.js";
4
- import h from "./index51.js";
5
- import d from "./index33.js";
6
- function b(i, r, a) {
7
- const s = [], c = Math.max(2, i - a), t = Math.min(r - 1, i + a);
8
- s.push(1), c > 2 && s.push("ellipsis");
9
- for (let o = c; o <= t; o++)
10
- s.push(o);
11
- return t < r - 1 && s.push("ellipsis"), r > 1 && s.push(r), s;
12
- }
13
- const j = ({
14
- page: i,
15
- totalPages: r,
16
- onChange: a,
17
- siblings: s = 1,
18
- className: c,
19
- ...t
1
+ import { jsx as l, jsxs as b } from "react/jsx-runtime";
2
+ import c from "./index31.js";
3
+ import { useRef as h, useState as u, useEffect as p } from "react";
4
+ import { createPortal as v } from "react-dom";
5
+ import { useScrollLock as M } from "./index53.js";
6
+ import t from "./index54.js";
7
+ import y from "./index41.js";
8
+ const R = ({
9
+ open: s,
10
+ onClose: o,
11
+ children: r,
12
+ size: f = "sm",
13
+ className: g,
14
+ ...N
20
15
  }) => {
21
- if (r <= 1) return null;
22
- const o = b(i, r, s);
23
- return /* @__PURE__ */ f("nav", { "aria-label": "Pagination", className: u(n.pagination, c), ...t, children: [
24
- /* @__PURE__ */ e(
25
- "button",
16
+ const i = h(null), [n, m] = u(!1), [a, d] = u(!1);
17
+ return M(n && !a), p(() => {
18
+ s ? (m(!0), d(!1)) : m((e) => (e && d(!0), e));
19
+ }, [s]), p(() => {
20
+ const e = i.current;
21
+ n && !a && e && !e.open && (e.showModal(), e.focus());
22
+ }, [n, a]), n ? v(
23
+ /* @__PURE__ */ l(
24
+ "dialog",
26
25
  {
27
- "aria-label": "Previous page",
28
- disabled: i <= 1,
29
- onClick: () => a(i - 1),
30
- className: n.arrow,
31
- children: /* @__PURE__ */ e(h, { className: n.icon })
32
- }
33
- ),
34
- o.map((l, m) => {
35
- if (l === "ellipsis")
36
- return /* @__PURE__ */ e("span", { className: n.ellipsis, children: "..." }, `ellipsis-${m}`);
37
- const p = l === i;
38
- return /* @__PURE__ */ e(
39
- "button",
40
- {
41
- "aria-label": `Page ${l}`,
42
- "aria-current": p ? "page" : void 0,
43
- onClick: () => a(l),
44
- className: u(n.page, p && n.active),
45
- children: l
26
+ ref: i,
27
+ className: c(
28
+ t.dialog,
29
+ t[`size-${f}`],
30
+ a && t.closing,
31
+ g
32
+ ),
33
+ onAnimationEnd: () => {
34
+ a && (i.current?.close(), m(!1), d(!1));
46
35
  },
47
- l
48
- );
49
- }),
50
- /* @__PURE__ */ e(
51
- "button",
52
- {
53
- "aria-label": "Next page",
54
- disabled: i >= r,
55
- onClick: () => a(i + 1),
56
- className: n.arrow,
57
- children: /* @__PURE__ */ e(d, { className: n.icon })
36
+ onCancel: (e) => {
37
+ e.preventDefault(), o();
38
+ },
39
+ onClick: (e) => {
40
+ e.target === i.current && o();
41
+ },
42
+ ...N,
43
+ children: /* @__PURE__ */ l("div", { className: t.content, children: r })
58
44
  }
59
- )
60
- ] });
61
- };
45
+ ),
46
+ document.body
47
+ ) : null;
48
+ }, S = ({
49
+ children: s,
50
+ onClose: o,
51
+ className: r,
52
+ ...f
53
+ }) => /* @__PURE__ */ b("div", { className: c(t.header, r), ...f, children: [
54
+ /* @__PURE__ */ l("h2", { className: t.title, children: s }),
55
+ o && /* @__PURE__ */ l(
56
+ "button",
57
+ {
58
+ onClick: o,
59
+ "aria-label": "Close",
60
+ className: t.closeButton,
61
+ children: /* @__PURE__ */ l(y, { size: 20 })
62
+ }
63
+ )
64
+ ] }), w = ({
65
+ children: s,
66
+ className: o,
67
+ ...r
68
+ }) => /* @__PURE__ */ l("div", { className: c(t.body, o), ...r, children: s }), A = ({
69
+ children: s,
70
+ className: o,
71
+ ...r
72
+ }) => /* @__PURE__ */ l("div", { className: c(t.footer, o), ...r, children: s });
62
73
  export {
63
- j as Pagination
74
+ R as Modal,
75
+ w as ModalBody,
76
+ A as ModalFooter,
77
+ S as ModalHeader
64
78
  };