@coinloger/dev-ui 0.1.1 → 0.1.3

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 (39) hide show
  1. package/dist/cjs/components/Badge/Badge.cjs +1 -1
  2. package/dist/cjs/components/Button/Button.cjs +1 -1
  3. package/dist/cjs/components/Card/Card.cjs +1 -1
  4. package/dist/cjs/components/Checkbox/Checkbox.cjs +1 -1
  5. package/dist/cjs/components/Container/Container.cjs +1 -1
  6. package/dist/cjs/components/Flex/Flex.cjs +1 -1
  7. package/dist/cjs/components/Flex/FlexItem.cjs +1 -1
  8. package/dist/cjs/components/Input/Input.cjs +1 -1
  9. package/dist/cjs/components/Modal/Modal.cjs +1 -1
  10. package/dist/cjs/components/Radio/Radio.cjs +1 -1
  11. package/dist/cjs/components/Select/Select.cjs +1 -1
  12. package/dist/cjs/components/Switch/Switch.cjs +1 -1
  13. package/dist/cjs/components/Table/Table.cjs +1 -1
  14. package/dist/cjs/components/Tabs/Tabs.cjs +1 -1
  15. package/dist/cjs/components/Typography/Heading.cjs +1 -1
  16. package/dist/cjs/components/Typography/Text.cjs +1 -1
  17. package/dist/cjs/theme.cjs +1 -1
  18. package/dist/esm/components/Badge/Badge.js +14 -22
  19. package/dist/esm/components/Button/Button.js +12 -24
  20. package/dist/esm/components/Card/Card.js +10 -18
  21. package/dist/esm/components/Checkbox/Checkbox.js +17 -33
  22. package/dist/esm/components/Container/Container.js +11 -18
  23. package/dist/esm/components/Flex/Flex.js +26 -44
  24. package/dist/esm/components/Flex/FlexItem.js +24 -38
  25. package/dist/esm/components/Input/Input.js +16 -46
  26. package/dist/esm/components/Modal/Modal.d.ts +0 -35
  27. package/dist/esm/components/Modal/Modal.js +60 -83
  28. package/dist/esm/components/Radio/Radio.js +16 -32
  29. package/dist/esm/components/Select/Select.d.ts +1 -17
  30. package/dist/esm/components/Select/Select.js +62 -79
  31. package/dist/esm/components/Switch/Switch.js +18 -34
  32. package/dist/esm/components/Table/Table.js +13 -22
  33. package/dist/esm/components/Tabs/Tabs.d.ts +0 -25
  34. package/dist/esm/components/Tabs/Tabs.js +45 -70
  35. package/dist/esm/components/Typography/Heading.js +15 -25
  36. package/dist/esm/components/Typography/Text.js +19 -32
  37. package/dist/esm/theme.d.ts +0 -5
  38. package/dist/esm/theme.js +11 -16
  39. package/package.json +15 -5
@@ -1,61 +1,31 @@
1
- import { jsxs as g, jsx as n } from "react/jsx-runtime";
2
- import { forwardRef as c, useId as b } from "react";
1
+ import { jsxs as c, jsx as i } from "react/jsx-runtime";
2
+ import { forwardRef as d, useId as f } from "react";
3
3
  import { clsx as r } from "clsx";
4
- import * as e from "prop-types";
5
4
  /* empty css */
6
- const u = c(
7
- ({ className: p, label: t, error: i, helperText: o, fullWidth: l, size: a = "md", id: m, ...d }, f) => {
8
- const s = m || b();
9
- return /* @__PURE__ */ g("div", { className: r("ui-input-wrapper", l && "ui-input-wrapper-full"), children: [
10
- t && /* @__PURE__ */ n("label", { htmlFor: s, className: "ui-label", children: t }),
11
- /* @__PURE__ */ n(
5
+ const h = d(
6
+ ({ className: s, label: p, error: t, helperText: u, fullWidth: n, size: a = "md", id: l, ...m }, o) => {
7
+ const e = l || f();
8
+ return /* @__PURE__ */ c("div", { className: r("ui-input-wrapper", n && "ui-input-wrapper-full"), children: [
9
+ p && /* @__PURE__ */ i("label", { htmlFor: e, className: "ui-label", children: p }),
10
+ /* @__PURE__ */ i(
12
11
  "input",
13
12
  {
14
- ref: f,
15
- id: s,
13
+ ref: o,
14
+ id: e,
16
15
  className: r(
17
16
  "ui-input",
18
17
  `ui-input-${a}`,
19
- i && "ui-input-error",
20
- p
18
+ t && "ui-input-error",
19
+ s
21
20
  ),
22
- ...d
21
+ ...m
23
22
  }
24
23
  ),
25
- o && /* @__PURE__ */ n("span", { className: r("ui-helper-text", i && "ui-helper-text-error"), children: o })
24
+ u && /* @__PURE__ */ i("span", { className: r("ui-helper-text", t && "ui-helper-text-error"), children: u })
26
25
  ] });
27
26
  }
28
27
  );
29
- u.displayName = "Input";
30
- u.propTypes = {
31
- label: e.node,
32
- error: e.bool,
33
- helperText: e.string,
34
- fullWidth: e.bool,
35
- size: e.oneOf(["sm", "md", "lg", "xl"]),
36
- value: e.oneOfType([e.string, e.number]),
37
- defaultValue: e.oneOfType([e.string, e.number]),
38
- onChange: e.func,
39
- onBlur: e.func,
40
- onFocus: e.func,
41
- name: e.string,
42
- id: e.string,
43
- placeholder: e.string,
44
- type: e.string,
45
- disabled: e.bool,
46
- readOnly: e.bool,
47
- required: e.bool,
48
- autoComplete: e.string,
49
- autoFocus: e.bool,
50
- min: e.oneOfType([e.string, e.number]),
51
- max: e.oneOfType([e.string, e.number]),
52
- step: e.oneOfType([e.string, e.number]),
53
- minLength: e.number,
54
- maxLength: e.number,
55
- pattern: e.string,
56
- inputMode: e.string,
57
- className: e.string
58
- };
28
+ h.displayName = "Input";
59
29
  export {
60
- u as Input
30
+ h as Input
61
31
  };
@@ -1,16 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
- import * as PropTypes from 'prop-types';
4
3
  export declare const ModalHeader: {
5
4
  ({ children, className }: {
6
5
  children: ReactNode;
7
6
  className?: string;
8
7
  }): import("react/jsx-runtime").JSX.Element;
9
8
  displayName: string;
10
- propTypes: {
11
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
12
- className: PropTypes.Requireable<string>;
13
- };
14
9
  };
15
10
  export declare const ModalBody: {
16
11
  ({ children, className }: {
@@ -18,10 +13,6 @@ export declare const ModalBody: {
18
13
  className?: string;
19
14
  }): import("react/jsx-runtime").JSX.Element;
20
15
  displayName: string;
21
- propTypes: {
22
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
23
- className: PropTypes.Requireable<string>;
24
- };
25
16
  };
26
17
  export declare const ModalFooter: {
27
18
  ({ children, className }: {
@@ -29,10 +20,6 @@ export declare const ModalFooter: {
29
20
  className?: string;
30
21
  }): import("react/jsx-runtime").JSX.Element;
31
22
  displayName: string;
32
- propTypes: {
33
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
34
- className: PropTypes.Requireable<string>;
35
- };
36
23
  };
37
24
  /**
38
25
  * Modal component properties.
@@ -76,16 +63,6 @@ export interface ModalProps {
76
63
  export declare const Modal: {
77
64
  ({ isOpen, onClose, title, children, footer, size, className, closeOnBackdropClick, }: ModalProps): import('react').ReactPortal | null;
78
65
  displayName: string;
79
- propTypes: {
80
- isOpen: PropTypes.Validator<boolean>;
81
- onClose: PropTypes.Validator<(...args: any[]) => any>;
82
- title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
83
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
84
- footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
85
- size: PropTypes.Requireable<string>;
86
- className: PropTypes.Requireable<string>;
87
- closeOnBackdropClick: PropTypes.Requireable<boolean>;
88
- };
89
66
  } & {
90
67
  Header: {
91
68
  ({ children, className }: {
@@ -93,10 +70,6 @@ export declare const Modal: {
93
70
  className?: string;
94
71
  }): import("react/jsx-runtime").JSX.Element;
95
72
  displayName: string;
96
- propTypes: {
97
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
98
- className: PropTypes.Requireable<string>;
99
- };
100
73
  };
101
74
  Body: {
102
75
  ({ children, className }: {
@@ -104,10 +77,6 @@ export declare const Modal: {
104
77
  className?: string;
105
78
  }): import("react/jsx-runtime").JSX.Element;
106
79
  displayName: string;
107
- propTypes: {
108
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
109
- className: PropTypes.Requireable<string>;
110
- };
111
80
  };
112
81
  Footer: {
113
82
  ({ children, className }: {
@@ -115,9 +84,5 @@ export declare const Modal: {
115
84
  className?: string;
116
85
  }): import("react/jsx-runtime").JSX.Element;
117
86
  displayName: string;
118
- propTypes: {
119
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
120
- className: PropTypes.Requireable<string>;
121
- };
122
87
  };
123
88
  };
@@ -1,123 +1,100 @@
1
- import { jsx as r, jsxs as c, Fragment as C } from "react/jsx-runtime";
2
- import { createContext as E, useRef as B, useState as R, useEffect as h, useContext as T } from "react";
3
- import { createPortal as j } from "react-dom";
4
- import { clsx as l } from "clsx";
5
- import * as o from "prop-types";
1
+ import { jsx as e, jsxs as r, Fragment as g } from "react/jsx-runtime";
2
+ import { createContext as E, useRef as C, useState as B, useEffect as f, useContext as j } from "react";
3
+ import { createPortal as F } from "react-dom";
4
+ import { clsx as d } from "clsx";
6
5
  /* empty css */
7
- const v = E(void 0), F = () => {
8
- const e = T(v);
9
- if (!e)
6
+ const h = E(void 0), L = () => {
7
+ const o = j(h);
8
+ if (!o)
10
9
  throw new Error("Modal compound components must be used within a Modal");
11
- return e;
12
- }, a = ({ children: e, className: d }) => {
13
- const { onClose: n } = F();
14
- return /* @__PURE__ */ c("div", { className: l("ui-modal-header", d), children: [
15
- /* @__PURE__ */ r("h3", { className: "ui-modal-title", children: e }),
16
- /* @__PURE__ */ r(
10
+ return o;
11
+ }, n = ({ children: o, className: t }) => {
12
+ const { onClose: a } = L();
13
+ return /* @__PURE__ */ r("div", { className: d("ui-modal-header", t), children: [
14
+ /* @__PURE__ */ e("h3", { className: "ui-modal-title", children: o }),
15
+ /* @__PURE__ */ e(
17
16
  "button",
18
17
  {
19
18
  className: "ui-modal-close",
20
- onClick: n,
19
+ onClick: a,
21
20
  "aria-label": "Close modal",
22
- children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
23
- /* @__PURE__ */ r("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
24
- /* @__PURE__ */ r("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
21
+ children: /* @__PURE__ */ r("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
22
+ /* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
23
+ /* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
25
24
  ] })
26
25
  }
27
26
  )
28
27
  ] });
29
- }, i = ({ children: e, className: d }) => /* @__PURE__ */ r("div", { className: l("ui-modal-body", d), children: e }), s = ({ children: e, className: d }) => /* @__PURE__ */ r("div", { className: l("ui-modal-footer", d), children: e }), m = ({
30
- isOpen: e,
31
- onClose: d,
32
- title: n,
33
- children: u,
34
- footer: y,
28
+ }, i = ({ children: o, className: t }) => /* @__PURE__ */ e("div", { className: d("ui-modal-body", t), children: o }), s = ({ children: o, className: t }) => /* @__PURE__ */ e("div", { className: d("ui-modal-footer", t), children: o }), v = ({
29
+ isOpen: o,
30
+ onClose: t,
31
+ title: a,
32
+ children: c,
33
+ footer: m,
35
34
  size: x = "md",
36
- className: N,
37
- closeOnBackdropClick: g = !0
35
+ className: M,
36
+ closeOnBackdropClick: k = !0
38
37
  }) => {
39
- const p = B(null), [k, f] = R(e);
40
- h(() => {
41
- e && f(!0);
42
- }, [e]);
43
- const M = () => {
44
- e || f(!1);
38
+ const u = C(null), [N, y] = B(o);
39
+ f(() => {
40
+ o && y(!0);
41
+ }, [o]);
42
+ const b = () => {
43
+ o || y(!1);
45
44
  };
46
- if (h(() => {
47
- const t = (w) => {
48
- w.key === "Escape" && d();
45
+ if (f(() => {
46
+ const l = (w) => {
47
+ w.key === "Escape" && t();
49
48
  };
50
- return e && (document.addEventListener("keydown", t), document.body.style.overflow = "hidden"), () => {
51
- document.removeEventListener("keydown", t), document.body.style.overflow = "";
49
+ return o && (document.addEventListener("keydown", l), document.body.style.overflow = "hidden"), () => {
50
+ document.removeEventListener("keydown", l), document.body.style.overflow = "";
52
51
  };
53
- }, [e, d]), !k) return null;
54
- const b = (t) => {
55
- g && t.target === p.current && d();
52
+ }, [o, t]), !N) return null;
53
+ const p = (l) => {
54
+ k && l.target === u.current && t();
56
55
  };
57
- return j(
58
- /* @__PURE__ */ r(v.Provider, { value: { onClose: d }, children: /* @__PURE__ */ r(
56
+ return F(
57
+ /* @__PURE__ */ e(h.Provider, { value: { onClose: t }, children: /* @__PURE__ */ e(
59
58
  "div",
60
59
  {
61
- className: l("ui-modal-overlay", !e && "ui-modal-closing"),
62
- ref: p,
63
- onClick: b,
64
- onAnimationEnd: M,
65
- children: /* @__PURE__ */ r(
60
+ className: d("ui-modal-overlay", !o && "ui-modal-closing"),
61
+ ref: u,
62
+ onClick: p,
63
+ onAnimationEnd: b,
64
+ children: /* @__PURE__ */ e(
66
65
  "div",
67
66
  {
68
- className: l(
67
+ className: d(
69
68
  "ui-modal",
70
69
  `ui-modal-${x}`,
71
- !e && "ui-modal-closing",
72
- N
70
+ !o && "ui-modal-closing",
71
+ M
73
72
  ),
74
73
  role: "dialog",
75
74
  "aria-modal": "true",
76
- children: n ? /* @__PURE__ */ c(C, { children: [
77
- /* @__PURE__ */ r(a, { children: n }),
78
- /* @__PURE__ */ r(i, { children: u }),
79
- y && /* @__PURE__ */ r(s, { children: y })
80
- ] }) : u
75
+ children: a ? /* @__PURE__ */ r(g, { children: [
76
+ /* @__PURE__ */ e(n, { children: a }),
77
+ /* @__PURE__ */ e(i, { children: c }),
78
+ m && /* @__PURE__ */ e(s, { children: m })
79
+ ] }) : c
81
80
  }
82
81
  )
83
82
  }
84
83
  ) }),
85
84
  document.body
86
85
  );
87
- }, V = Object.assign(m, {
88
- Header: a,
86
+ }, I = Object.assign(v, {
87
+ Header: n,
89
88
  Body: i,
90
89
  Footer: s
91
90
  });
92
- m.displayName = "Modal";
93
- a.displayName = "ModalHeader";
91
+ v.displayName = "Modal";
92
+ n.displayName = "ModalHeader";
94
93
  i.displayName = "ModalBody";
95
94
  s.displayName = "ModalFooter";
96
- m.propTypes = {
97
- isOpen: o.bool.isRequired,
98
- onClose: o.func.isRequired,
99
- title: o.node,
100
- children: o.node,
101
- footer: o.node,
102
- size: o.oneOf(["sm", "md", "lg", "xl"]),
103
- className: o.string,
104
- closeOnBackdropClick: o.bool
105
- };
106
- a.propTypes = {
107
- children: o.node,
108
- className: o.string
109
- };
110
- i.propTypes = {
111
- children: o.node,
112
- className: o.string
113
- };
114
- s.propTypes = {
115
- children: o.node,
116
- className: o.string
117
- };
118
95
  export {
119
- V as Modal,
96
+ I as Modal,
120
97
  i as ModalBody,
121
98
  s as ModalFooter,
122
- a as ModalHeader
99
+ n as ModalHeader
123
100
  };
@@ -1,52 +1,36 @@
1
- import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as t } from "react";
3
- import { clsx as c } from "clsx";
4
- import * as r from "prop-types";
1
+ import { jsxs as t, jsx as i } from "react/jsx-runtime";
2
+ import { forwardRef as p } from "react";
3
+ import { clsx as l } from "clsx";
5
4
  /* empty css */
6
- const e = t(
7
- ({ className: s, label: a, error: u, disabled: i, size: d = "md", variant: n = "primary", ...l }, m) => /* @__PURE__ */ p(
5
+ const u = p(
6
+ ({ className: o, label: a, error: c, disabled: r, size: s = "md", variant: d = "primary", ...e }, m) => /* @__PURE__ */ t(
8
7
  "label",
9
8
  {
10
- className: c(
9
+ className: l(
11
10
  "ui-radio-label",
11
+ `ui-radio-${s}`,
12
12
  `ui-radio-${d}`,
13
- `ui-radio-${n}`,
14
- i && "ui-radio-disabled",
15
- s
13
+ r && "ui-radio-disabled",
14
+ o
16
15
  ),
17
16
  children: [
18
- /* @__PURE__ */ o(
17
+ /* @__PURE__ */ i(
19
18
  "input",
20
19
  {
21
20
  type: "radio",
22
21
  className: "ui-radio-input",
23
- disabled: i,
22
+ disabled: r,
24
23
  ref: m,
25
- ...l
24
+ ...e
26
25
  }
27
26
  ),
28
- /* @__PURE__ */ o("span", { className: "ui-radio-custom", children: /* @__PURE__ */ o("span", { className: "ui-radio-dot" }) }),
29
- a && /* @__PURE__ */ o("span", { className: "ui-radio-text", children: a })
27
+ /* @__PURE__ */ i("span", { className: "ui-radio-custom", children: /* @__PURE__ */ i("span", { className: "ui-radio-dot" }) }),
28
+ a && /* @__PURE__ */ i("span", { className: "ui-radio-text", children: a })
30
29
  ]
31
30
  }
32
31
  )
33
32
  );
34
- e.displayName = "Radio";
35
- e.propTypes = {
36
- label: r.node,
37
- error: r.bool,
38
- size: r.oneOf(["sm", "md", "lg", "xl"]),
39
- variant: r.oneOf(["primary", "success", "warning", "danger"]),
40
- checked: r.bool,
41
- defaultChecked: r.bool,
42
- onChange: r.func,
43
- name: r.string,
44
- value: r.oneOfType([r.string, r.number]),
45
- disabled: r.bool,
46
- required: r.bool,
47
- id: r.string,
48
- className: r.string
49
- };
33
+ u.displayName = "Radio";
50
34
  export {
51
- e as Radio
35
+ u as Radio
52
36
  };
@@ -1,4 +1,4 @@
1
- import * as PropTypes from 'prop-types';
1
+
2
2
  export interface SelectOption {
3
3
  value: string | number;
4
4
  label: string;
@@ -57,20 +57,4 @@ export interface SelectProps {
57
57
  export declare const Select: {
58
58
  ({ options, value, onChange, placeholder, label, error, helperText, disabled, fullWidth, size, className, }: SelectProps): import("react/jsx-runtime").JSX.Element;
59
59
  displayName: string;
60
- propTypes: {
61
- options: PropTypes.Validator<(PropTypes.InferProps<{
62
- value: PropTypes.Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
63
- label: PropTypes.Validator<string>;
64
- }> | null | undefined)[]>;
65
- value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
66
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
67
- placeholder: PropTypes.Requireable<string>;
68
- label: PropTypes.Requireable<string>;
69
- error: PropTypes.Requireable<boolean>;
70
- helperText: PropTypes.Requireable<string>;
71
- disabled: PropTypes.Requireable<boolean>;
72
- fullWidth: PropTypes.Requireable<boolean>;
73
- size: PropTypes.Requireable<string>;
74
- className: PropTypes.Requireable<string>;
75
- };
76
60
  };
@@ -1,129 +1,112 @@
1
- import { jsxs as c, jsx as i } from "react/jsx-runtime";
2
- import { useState as y, useRef as S, useEffect as N } from "react";
3
- import { clsx as l } from "clsx";
4
- import * as e from "prop-types";
1
+ import { jsxs as r, jsx as s } from "react/jsx-runtime";
2
+ import { useState as N, useRef as C, useEffect as g } from "react";
3
+ import { clsx as n } from "clsx";
5
4
  /* empty css */
6
- const x = ({
7
- options: a,
8
- value: u,
9
- onChange: f,
10
- placeholder: k = "Select an option",
11
- label: h,
12
- error: b,
13
- helperText: g,
14
- disabled: d,
15
- fullWidth: v,
16
- size: L = "md",
17
- className: O
5
+ const O = ({
6
+ options: c,
7
+ value: a,
8
+ onChange: p,
9
+ placeholder: x = "Select an option",
10
+ label: f,
11
+ error: h,
12
+ helperText: v,
13
+ disabled: u,
14
+ fullWidth: w,
15
+ size: k = "md",
16
+ className: y
18
17
  }) => {
19
- const [s, p] = y(!1), [E, w] = y("bottom"), n = S(null), m = a.find((t) => t.value === u), r = () => {
20
- if (n.current) {
21
- const t = n.current.getBoundingClientRect(), o = window.innerHeight - t.bottom, C = t.top;
22
- o < 250 && C > o ? w("top") : w("bottom");
18
+ const [t, d] = N(!1), [L, b] = N("bottom"), i = C(null), m = c.find((e) => e.value === a), l = () => {
19
+ if (i.current) {
20
+ const e = i.current.getBoundingClientRect(), o = window.innerHeight - e.bottom, B = e.top;
21
+ o < 250 && B > o ? b("top") : b("bottom");
23
22
  }
24
- }, R = () => {
25
- d || (s || r(), p(!s));
26
- }, T = (t) => {
27
- f && f(t), p(!1);
23
+ }, E = () => {
24
+ u || (t || l(), d(!t));
25
+ }, S = (e) => {
26
+ p && p(e), d(!1);
28
27
  };
29
- return N(() => (s && (window.addEventListener("resize", r), window.addEventListener("scroll", r, { capture: !0 })), () => {
30
- window.removeEventListener("resize", r), window.removeEventListener("scroll", r, { capture: !0 });
31
- }), [s]), N(() => {
32
- const t = (o) => {
33
- n.current && !n.current.contains(o.target) && p(!1);
28
+ return g(() => (t && (window.addEventListener("resize", l), window.addEventListener("scroll", l, { capture: !0 })), () => {
29
+ window.removeEventListener("resize", l), window.removeEventListener("scroll", l, { capture: !0 });
30
+ }), [t]), g(() => {
31
+ const e = (o) => {
32
+ i.current && !i.current.contains(o.target) && d(!1);
34
33
  };
35
- return s && document.addEventListener("mousedown", t), () => {
36
- document.removeEventListener("mousedown", t);
34
+ return t && document.addEventListener("mousedown", e), () => {
35
+ document.removeEventListener("mousedown", e);
37
36
  };
38
- }, [s]), /* @__PURE__ */ c(
37
+ }, [t]), /* @__PURE__ */ r(
39
38
  "div",
40
39
  {
41
- className: l("ui-select-wrapper", v && "ui-w-full", O),
42
- ref: n,
43
- style: { width: v ? "100%" : "auto" },
40
+ className: n("ui-select-wrapper", w && "ui-w-full", y),
41
+ ref: i,
42
+ style: { width: w ? "100%" : "auto" },
44
43
  children: [
45
- h && /* @__PURE__ */ i("label", { className: "ui-label", style: { marginBottom: "0.375rem", display: "block" }, children: h }),
46
- /* @__PURE__ */ c("div", { className: "ui-select-input-container", children: [
47
- /* @__PURE__ */ c(
44
+ f && /* @__PURE__ */ s("label", { className: "ui-label", style: { marginBottom: "0.375rem", display: "block" }, children: f }),
45
+ /* @__PURE__ */ r("div", { className: "ui-select-input-container", children: [
46
+ /* @__PURE__ */ r(
48
47
  "button",
49
48
  {
50
49
  type: "button",
51
- className: l(
50
+ className: n(
52
51
  "ui-select-trigger",
53
- `ui-select-${L}`,
54
- b && "ui-select-error",
55
- d && "ui-select-disabled",
56
- s && "ui-select-open"
52
+ `ui-select-${k}`,
53
+ h && "ui-select-error",
54
+ u && "ui-select-disabled",
55
+ t && "ui-select-open"
57
56
  ),
58
- onClick: R,
59
- disabled: d,
57
+ onClick: E,
58
+ disabled: u,
60
59
  "aria-haspopup": "listbox",
61
- "aria-expanded": s,
60
+ "aria-expanded": t,
62
61
  children: [
63
- /* @__PURE__ */ i("span", { className: l(!m && "ui-select-placeholder"), children: m ? m.label : k }),
64
- /* @__PURE__ */ i(
62
+ /* @__PURE__ */ s("span", { className: n(!m && "ui-select-placeholder"), children: m ? m.label : x }),
63
+ /* @__PURE__ */ s(
65
64
  "svg",
66
65
  {
67
66
  className: "ui-select-icon",
68
67
  fill: "none",
69
68
  stroke: "currentColor",
70
69
  viewBox: "0 0 24 24",
71
- children: /* @__PURE__ */ i("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
70
+ children: /* @__PURE__ */ s("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
72
71
  }
73
72
  )
74
73
  ]
75
74
  }
76
75
  ),
77
- s && /* @__PURE__ */ c(
76
+ t && /* @__PURE__ */ r(
78
77
  "ul",
79
78
  {
80
- className: l(
79
+ className: n(
81
80
  "ui-select-menu",
82
- E === "top" && "ui-select-menu-top"
81
+ L === "top" && "ui-select-menu-top"
83
82
  ),
84
83
  role: "listbox",
85
84
  children: [
86
- a.map((t) => /* @__PURE__ */ i(
85
+ c.map((e) => /* @__PURE__ */ s(
87
86
  "li",
88
87
  {
89
- className: l(
88
+ className: n(
90
89
  "ui-select-option",
91
- t.value === u && "ui-select-selected"
90
+ e.value === a && "ui-select-selected"
92
91
  ),
93
- onClick: () => T(t.value),
92
+ onClick: () => S(e.value),
94
93
  role: "option",
95
- "aria-selected": t.value === u,
96
- children: t.label
94
+ "aria-selected": e.value === a,
95
+ children: e.label
97
96
  },
98
- t.value
97
+ e.value
99
98
  )),
100
- a.length === 0 && /* @__PURE__ */ i("li", { className: "ui-select-option", style: { color: "var(--ui-text-muted)", cursor: "default" }, children: "No options" })
99
+ c.length === 0 && /* @__PURE__ */ s("li", { className: "ui-select-option", style: { color: "var(--ui-text-muted)", cursor: "default" }, children: "No options" })
101
100
  ]
102
101
  }
103
102
  )
104
103
  ] }),
105
- g && /* @__PURE__ */ i("span", { className: l("ui-helper-text", b && "ui-helper-text-error"), style: { marginTop: "0.375rem", display: "block" }, children: g })
104
+ v && /* @__PURE__ */ s("span", { className: n("ui-helper-text", h && "ui-helper-text-error"), style: { marginTop: "0.375rem", display: "block" }, children: v })
106
105
  ]
107
106
  }
108
107
  );
109
108
  };
110
- x.displayName = "Select";
111
- x.propTypes = {
112
- options: e.arrayOf(e.shape({
113
- value: e.oneOfType([e.string, e.number]).isRequired,
114
- label: e.string.isRequired
115
- })).isRequired,
116
- value: e.oneOfType([e.string, e.number]),
117
- onChange: e.func,
118
- placeholder: e.string,
119
- label: e.string,
120
- error: e.bool,
121
- helperText: e.string,
122
- disabled: e.bool,
123
- fullWidth: e.bool,
124
- size: e.oneOf(["sm", "md", "lg", "xl"]),
125
- className: e.string
126
- };
109
+ O.displayName = "Select";
127
110
  export {
128
- x as Select
111
+ O as Select
129
112
  };