sander-ui 0.1.5 → 0.1.7

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 (80) 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 +4 -4
  6. package/dist/index13.js +98 -100
  7. package/dist/index14.js +41 -21
  8. package/dist/index15.js +22 -19
  9. package/dist/index16.js +20 -76
  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 +260 -19
  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 +26 -10
  27. package/dist/index33.js +25 -39
  28. package/dist/index34.js +17 -7
  29. package/dist/index35.js +8 -26
  30. package/dist/index36.js +4 -17
  31. package/dist/index37.js +16 -22
  32. package/dist/index38.js +22 -20
  33. package/dist/index39.js +8 -13
  34. package/dist/index4.js +7 -7
  35. package/dist/index40.js +14 -23
  36. package/dist/index41.js +7 -7
  37. package/dist/index42.js +6 -13
  38. package/dist/index43.js +7 -8
  39. package/dist/index44.js +26 -7
  40. package/dist/index45.js +15 -11
  41. package/dist/index46.js +20 -16
  42. package/dist/index47.js +13 -8
  43. package/dist/index48.js +23 -4
  44. package/dist/index49.js +11 -27
  45. package/dist/index5.js +3 -3
  46. package/dist/index50.js +25 -16
  47. package/dist/index51.js +12 -20
  48. package/dist/index52.js +16 -12
  49. package/dist/index53.js +26 -30
  50. package/dist/index55.js +10 -16
  51. package/dist/index56.js +42 -14
  52. package/dist/index57.js +3 -3
  53. package/dist/index58.js +4 -15
  54. package/dist/index59.js +14 -18
  55. package/dist/index6.js +3 -3
  56. package/dist/index60.js +4 -13
  57. package/dist/index61.js +12 -25
  58. package/dist/index62.js +20 -41
  59. package/dist/index63.js +42 -4
  60. package/dist/index64.js +4 -27
  61. package/dist/index65.js +14 -25
  62. package/dist/index66.js +40 -35
  63. package/dist/index67.js +15 -2
  64. package/dist/index68.js +31 -4
  65. package/dist/index69.js +16 -20
  66. package/dist/index7.js +4 -4
  67. package/dist/index70.js +35 -2
  68. package/dist/index71.js +2 -2
  69. package/dist/index72.js +4 -6
  70. package/dist/index73.js +21 -34
  71. package/dist/index74.js +2 -12
  72. package/dist/index75.js +2 -7
  73. package/dist/index76.js +6 -5
  74. package/dist/index77.js +36 -0
  75. package/dist/index78.js +14 -0
  76. package/dist/index79.js +9 -0
  77. package/dist/index8.js +12 -12
  78. package/dist/index80.js +7 -0
  79. package/dist/index9.js +2 -2
  80. 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 "./index50.js";
4
+ import e from "./index52.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,10 +1,10 @@
1
1
  import { jsx as l, jsxs as b } from "react/jsx-runtime";
2
- import c 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 { useScrollLock as D } from "./index32.js";
6
- import r from "./index33.js";
7
- import y from "./index34.js";
5
+ import { useScrollLock as D } from "./index49.js";
6
+ import r from "./index66.js";
7
+ import y from "./index43.js";
8
8
  const R = ({
9
9
  open: o,
10
10
  onClose: t,
package/dist/index13.js CHANGED
@@ -1,172 +1,170 @@
1
- import { jsx as w } from "react/jsx-runtime";
2
- import b from "./index30.js";
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 "./index59.js";
5
- const C = I(null);
6
- function x() {
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import g from "./index31.js";
3
+ import { useState as x, useRef as v, useId as E, useEffect as k, cloneElement as I, createContext as R, useContext as y } from "react";
4
+ import D from "./index67.js";
5
+ const C = R(null);
6
+ function b() {
7
7
  const t = y(C);
8
8
  if (!t)
9
9
  throw new Error("Dropdown components must be used within <Dropdown>");
10
10
  return t;
11
11
  }
12
- const L = ({ children: t }) => {
13
- const [i, r] = h(!1), [c, a] = h(!1), u = v(null), f = v(null), g = v([]), e = v(0), l = v(null), n = R(), D = (s) => {
14
- l.current = s, r(!0), a(!1);
15
- }, o = (s = !0) => {
16
- a(!0), s && u.current?.focus();
17
- }, d = v(o);
18
- return d.current = o, k(() => {
19
- if (!i || c) return;
20
- function s(p) {
21
- f.current && !f.current.contains(p.target) && d.current(!1);
12
+ const P = ({ children: t }) => {
13
+ const [o, e] = x(!1), [l, a] = x(!1), c = v(null), f = v(null), n = v([]), w = v(0), r = v(null), u = E(), i = (s) => {
14
+ r.current = s, e(!0), a(!1);
15
+ }, d = (s = !0) => {
16
+ a(!0), s && c.current?.focus();
17
+ }, m = v(d);
18
+ return m.current = d, k(() => {
19
+ if (!o || l) return;
20
+ function s(h) {
21
+ f.current && !f.current.contains(h.target) && m.current(!1);
22
22
  }
23
23
  return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
24
- }, [i, c]), /* @__PURE__ */ w(
24
+ }, [o, l]), /* @__PURE__ */ p(
25
25
  C.Provider,
26
26
  {
27
27
  value: {
28
- visible: i,
29
- closing: c,
30
- menuId: n,
31
- triggerRef: u,
32
- openMenu: D,
33
- closeMenu: o,
34
- setVisible: r,
28
+ visible: o,
29
+ closing: l,
30
+ menuId: u,
31
+ triggerRef: c,
32
+ openMenu: i,
33
+ closeMenu: d,
34
+ setVisible: e,
35
35
  setClosing: a,
36
- itemRefs: g,
37
- itemCount: e,
38
- pendingFocusIndex: l
36
+ itemRefs: n,
37
+ itemCount: w,
38
+ pendingFocusIndex: r
39
39
  },
40
- children: /* @__PURE__ */ w("div", { ref: f, className: m.wrapper, children: t })
40
+ children: /* @__PURE__ */ p("div", { ref: f, className: D.wrapper, children: t })
41
41
  }
42
42
  );
43
- }, P = ({
43
+ }, B = ({
44
44
  asChild: t,
45
- children: i
45
+ children: o
46
46
  }) => {
47
- const { visible: r, menuId: c, triggerRef: a, openMenu: u, closeMenu: f } = x(), l = {
48
- ref: (n) => {
49
- a.current = n;
47
+ const { visible: e, menuId: l, triggerRef: a, openMenu: c, closeMenu: f } = b(), r = {
48
+ ref: (u) => {
49
+ a.current = u;
50
50
  },
51
51
  "aria-haspopup": "menu",
52
- "aria-expanded": r,
53
- "aria-controls": r ? c : void 0,
54
- onClick: () => r ? f() : u(0),
55
- onKeyDown: (n) => {
56
- switch (n.key) {
52
+ "aria-expanded": e,
53
+ "aria-controls": e ? l : void 0,
54
+ onClick: () => e ? f() : c(0),
55
+ onKeyDown: (u) => {
56
+ switch (u.key) {
57
57
  case "ArrowDown":
58
58
  case "Enter":
59
59
  case " ":
60
- n.preventDefault(), u(0);
60
+ u.preventDefault(), c(0);
61
61
  break;
62
62
  case "ArrowUp":
63
- n.preventDefault(), u(-1);
63
+ u.preventDefault(), c(-1);
64
64
  break;
65
65
  }
66
66
  }
67
67
  };
68
- return t ? E(i, l) : /* @__PURE__ */ w("button", { ...l, className: m.trigger, children: i });
69
- }, B = ({
70
- align: t = "right",
71
- children: i
68
+ return t ? I(o, r) : /* @__PURE__ */ p("button", { ...r, className: D.trigger, children: o });
69
+ }, F = ({
70
+ children: t
72
71
  }) => {
73
72
  const {
74
- visible: r,
75
- closing: c,
76
- menuId: a,
77
- closeMenu: u,
78
- setVisible: f,
79
- setClosing: g,
80
- itemRefs: e,
81
- itemCount: l,
82
- pendingFocusIndex: n
83
- } = x();
84
- l.current = 0, e.current = [], k(() => {
85
- if (!r || c || n.current === null) return;
86
- const o = n.current;
87
- n.current = null;
88
- const d = e.current.filter(Boolean), s = o < 0 ? d.length + o : o;
89
- d[s]?.focus();
90
- }, [r, c, e, n]);
91
- const D = (o) => {
92
- const d = e.current.findIndex(
93
- (p) => p === document.activeElement
94
- ), s = e.current.filter(Boolean).length;
95
- switch (o.key) {
73
+ visible: o,
74
+ closing: e,
75
+ menuId: l,
76
+ closeMenu: a,
77
+ setVisible: c,
78
+ setClosing: f,
79
+ itemRefs: n,
80
+ itemCount: w,
81
+ pendingFocusIndex: r
82
+ } = b();
83
+ w.current = 0, n.current = [], k(() => {
84
+ if (!o || e || r.current === null) return;
85
+ const i = r.current;
86
+ r.current = null;
87
+ const d = n.current.filter(Boolean), m = i < 0 ? d.length + i : i;
88
+ d[m]?.focus();
89
+ }, [o, e, n, r]);
90
+ const u = (i) => {
91
+ const d = n.current.findIndex(
92
+ (s) => s === document.activeElement
93
+ ), m = n.current.filter(Boolean).length;
94
+ switch (i.key) {
96
95
  case "ArrowDown": {
97
- o.preventDefault();
98
- const p = (d + 1) % s;
99
- e.current[p]?.focus();
96
+ i.preventDefault();
97
+ const s = (d + 1) % m;
98
+ n.current[s]?.focus();
100
99
  break;
101
100
  }
102
101
  case "ArrowUp": {
103
- o.preventDefault();
104
- const p = (d - 1 + s) % s;
105
- e.current[p]?.focus();
102
+ i.preventDefault();
103
+ const s = (d - 1 + m) % m;
104
+ n.current[s]?.focus();
106
105
  break;
107
106
  }
108
107
  case "Home":
109
- o.preventDefault(), e.current[0]?.focus();
108
+ i.preventDefault(), n.current[0]?.focus();
110
109
  break;
111
110
  case "End":
112
- o.preventDefault(), e.current[s - 1]?.focus();
111
+ i.preventDefault(), n.current[m - 1]?.focus();
113
112
  break;
114
113
  case "Escape":
115
114
  case "Tab":
116
- u();
115
+ a();
117
116
  break;
118
117
  }
119
118
  };
120
- return r ? /* @__PURE__ */ w(
119
+ return o ? /* @__PURE__ */ p(
121
120
  "div",
122
121
  {
123
- id: a,
122
+ id: l,
124
123
  role: "menu",
125
- onKeyDown: D,
124
+ onKeyDown: u,
126
125
  onAnimationEnd: () => {
127
- c && (f(!1), g(!1));
126
+ e && (c(!1), f(!1));
128
127
  },
129
- className: b(
130
- m.menu,
131
- t === "right" ? m.alignRight : m.alignLeft,
132
- c && m.closing
128
+ className: g(
129
+ D.menu,
130
+ e && D.closing
133
131
  ),
134
- children: i
132
+ children: t
135
133
  }
136
134
  ) : null;
137
- }, F = ({
135
+ }, L = ({
138
136
  children: t,
139
- onClick: i,
140
- href: r,
141
- className: c,
137
+ onClick: o,
138
+ href: e,
139
+ className: l,
142
140
  ...a
143
141
  }) => {
144
- const { closeMenu: u, itemRefs: f, itemCount: g } = x(), e = g.current++, l = {
145
- ref: (n) => {
146
- f.current[e] = n;
142
+ const { closeMenu: c, itemRefs: f, itemCount: n } = b(), w = n.current++, r = {
143
+ ref: (u) => {
144
+ f.current[w] = u;
147
145
  },
148
146
  role: "menuitem",
149
147
  tabIndex: -1,
150
- className: b(m.item, c)
148
+ className: g(D.item, l)
151
149
  };
152
- return r ? /* @__PURE__ */ w("a", { ...l, ...a, href: r, onClick: () => u(!1), children: t }) : /* @__PURE__ */ w(
150
+ return e ? /* @__PURE__ */ p("a", { ...r, ...a, href: e, onClick: () => c(!1), children: t }) : /* @__PURE__ */ p(
153
151
  "button",
154
152
  {
155
- ...l,
153
+ ...r,
156
154
  ...a,
157
155
  onClick: () => {
158
- u(!1), i?.();
156
+ c(!1), o?.();
159
157
  },
160
158
  children: t
161
159
  }
162
160
  );
163
161
  }, S = ({
164
162
  className: t
165
- }) => /* @__PURE__ */ w("div", { role: "separator", className: b(m.divider, t) });
163
+ }) => /* @__PURE__ */ p("div", { role: "separator", className: g(D.divider, t) });
166
164
  export {
167
- L as Dropdown,
168
- B as DropdownContent,
169
- F as DropdownItem,
165
+ P as Dropdown,
166
+ F as DropdownContent,
167
+ L as DropdownItem,
170
168
  S as DropdownSeparator,
171
- P as DropdownTrigger
169
+ B as DropdownTrigger
172
170
  };
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 "./index39.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 "./index53.js";
4
+ import s from "./index55.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 "./index49.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 "./index61.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,78 +1,22 @@
1
- import { jsx as l, jsxs as b } from "react/jsx-runtime";
2
- import c from "./index30.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 "./index32.js";
6
- import t from "./index61.js";
7
- import y from "./index34.js";
8
- const R = ({
9
- open: s,
10
- onClose: o,
11
- children: r,
12
- size: f = "sm",
13
- className: g,
14
- ...N
15
- }) => {
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",
25
- {
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));
35
- },
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 })
44
- }
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 });
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import a from "./index31.js";
3
+ import t from "./index53.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
+ );
73
20
  export {
74
- R as Modal,
75
- w as ModalBody,
76
- A as ModalFooter,
77
- S as ModalHeader
21
+ f as LinkButton
78
22
  };