@ramme-io/ui 4.1.0 → 4.2.0

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 (44) hide show
  1. package/README.md +4 -3
  2. package/dist/component-registry.js +55 -52
  3. package/dist/components/ai/AIChatThread/AIChatThread.js +3 -3
  4. package/dist/components/ai/NewsSummaryCard/NewsSummaryCard.js +17 -17
  5. package/dist/components/ai/StockChart/StockChart.js +35 -35
  6. package/dist/components/auth/LoginPage.d.ts +22 -0
  7. package/dist/components/auth/LoginPage.js +50 -42
  8. package/dist/components/data-display/StatusBadge.d.ts +4 -3
  9. package/dist/components/data-display/StatusBadge.js +18 -18
  10. package/dist/components/feedback/Alert.js +19 -19
  11. package/dist/components/forms/ComboBox.js +2 -2
  12. package/dist/components/forms/DatePicker.js +37 -32
  13. package/dist/components/forms/FileUpload.js +39 -37
  14. package/dist/components/forms/Input.js +19 -18
  15. package/dist/components/forms/MultiSelect.js +9 -8
  16. package/dist/components/forms/SegmentedControl.js +10 -10
  17. package/dist/components/forms/Select.js +9 -8
  18. package/dist/components/forms/Textarea.d.ts +13 -11
  19. package/dist/components/forms/Textarea.js +36 -16
  20. package/dist/components/layout/Accordion.js +25 -32
  21. package/dist/components/layout/Card.js +38 -21
  22. package/dist/components/layout/DetailDrawer.d.ts +9 -1
  23. package/dist/components/layout/DetailDrawer.js +60 -51
  24. package/dist/components/layout/Drawer.js +47 -39
  25. package/dist/components/layout/Modal.js +28 -23
  26. package/dist/components/layout/SettingsContainer.js +23 -13
  27. package/dist/components/layout/Sheet.d.ts +58 -0
  28. package/dist/components/layout/Sheet.js +146 -0
  29. package/dist/components/navigation/MobileNav.d.ts +44 -1
  30. package/dist/components/navigation/MobileNav.js +96 -70
  31. package/dist/components/navigation/Tabs.js +19 -12
  32. package/dist/components/ui/icon-loader.d.ts +1 -1
  33. package/dist/index.css +1 -1
  34. package/dist/index.d.ts +3 -0
  35. package/dist/index.js +218 -209
  36. package/dist/lib/hooks/useDialogFocus.d.ts +1 -0
  37. package/dist/lib/hooks/useDialogFocus.js +46 -0
  38. package/dist/lib/hooks/useSheetGesture.d.ts +81 -0
  39. package/dist/lib/hooks/useSheetGesture.js +70 -0
  40. package/dist/setupTests.d.ts +1 -0
  41. package/dist/wizardManifest.js +139 -14
  42. package/package.json +9 -2
  43. package/src/wizardManifest.ts +139 -14
  44. package/tailwind.preset.js +8 -0
@@ -1,98 +1,106 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { useState as u } from "react";
3
- import { Link as p } from "react-router-dom";
4
- import { Button as g } from "../ui/Button.js";
5
- import { Input as h } from "../forms/Input.js";
6
- import { Alert as b } from "../feedback/Alert.js";
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import { useState as h } from "react";
3
+ import { Link as x } from "react-router-dom";
4
+ import { Button as v } from "../ui/Button.js";
5
+ import { Input as f } from "../forms/Input.js";
6
+ import { Alert as y } from "../feedback/Alert.js";
7
7
  import { Icon as s } from "../ui/Icon.js";
8
- const S = ({ onLogin: f, error: l, loading: i, quickProfiles: r }) => {
9
- const [n, o] = u(""), [c, d] = u(""), x = (a) => {
10
- a.preventDefault(), f(n, c);
11
- }, m = "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 mb-2 block text-foreground/90";
12
- return /* @__PURE__ */ t("div", { className: "w-full max-w-[400px] space-y-6 animate-in fade-in zoom-in-95 duration-300", children: [
13
- /* @__PURE__ */ t("div", { className: "flex flex-col items-center space-y-2 text-center mb-8", children: [
8
+ const A = ({
9
+ onLogin: g,
10
+ error: l,
11
+ loading: i,
12
+ quickProfiles: r,
13
+ signupHref: n = "/auth/signup",
14
+ signupLabel: b = "Create one",
15
+ forgotHref: o = "#"
16
+ }) => {
17
+ const [c, d] = h(""), [m, u] = h(""), N = (t) => {
18
+ t.preventDefault(), g(c, m);
19
+ }, p = "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 mb-2 block text-foreground/90";
20
+ return /* @__PURE__ */ a("div", { className: "w-full max-w-[400px] space-y-6 animate-in fade-in zoom-in-95 duration-300", children: [
21
+ /* @__PURE__ */ a("div", { className: "flex flex-col items-center space-y-2 text-center mb-8", children: [
14
22
  /* @__PURE__ */ e("div", { className: "h-10 w-10 bg-primary/10 rounded-xl flex items-center justify-center mb-2 border border-primary/20", children: /* @__PURE__ */ e(s, { name: "hexagon", className: "text-primary fill-primary/20", size: 24, strokeWidth: 2.5 }) }),
15
23
  /* @__PURE__ */ e("h1", { className: "text-2xl font-bold tracking-tight", children: "Welcome back" }),
16
24
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Enter your credentials to access your workspace" })
17
25
  ] }),
18
- /* @__PURE__ */ t("div", { className: "bg-card text-card-foreground border shadow-sm rounded-xl overflow-hidden", children: [
19
- /* @__PURE__ */ e("div", { className: "p-6 pt-6", children: /* @__PURE__ */ t("form", { onSubmit: x, className: "space-y-4", children: [
20
- l && /* @__PURE__ */ e(b, { variant: "danger", title: "Authentication Error", className: "mb-4", children: l }),
21
- /* @__PURE__ */ t("div", { className: "space-y-1", children: [
22
- /* @__PURE__ */ e("label", { htmlFor: "email", className: m, children: "Email" }),
23
- /* @__PURE__ */ t("div", { className: "relative group", children: [
26
+ /* @__PURE__ */ a("div", { className: "bg-card text-card-foreground border shadow-sm rounded-xl overflow-hidden", children: [
27
+ /* @__PURE__ */ e("div", { className: "p-6 pt-6", children: /* @__PURE__ */ a("form", { onSubmit: N, className: "space-y-4", children: [
28
+ l && /* @__PURE__ */ e(y, { variant: "danger", title: "Authentication Error", className: "mb-4", children: l }),
29
+ /* @__PURE__ */ a("div", { className: "space-y-1", children: [
30
+ /* @__PURE__ */ e("label", { htmlFor: "email", className: p, children: "Email" }),
31
+ /* @__PURE__ */ a("div", { className: "relative group", children: [
24
32
  /* @__PURE__ */ e(s, { name: "mail", className: "absolute left-3 top-2.5 h-4 w-4 text-muted-foreground group-focus-within:text-primary transition-colors" }),
25
33
  /* @__PURE__ */ e(
26
- h,
34
+ f,
27
35
  {
28
36
  id: "email",
29
37
  type: "email",
30
38
  placeholder: "name@example.com",
31
39
  className: "pl-9 h-10 bg-background/50",
32
- value: n,
33
- onChange: (a) => o(a.target.value),
40
+ value: c,
41
+ onChange: (t) => d(t.target.value),
34
42
  required: !0
35
43
  }
36
44
  )
37
45
  ] })
38
46
  ] }),
39
- /* @__PURE__ */ t("div", { className: "space-y-1", children: [
40
- /* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
41
- /* @__PURE__ */ e("label", { htmlFor: "password", className: m, children: "Password" }),
42
- /* @__PURE__ */ e(p, { to: "#", className: "text-xs text-primary hover:underline font-medium", children: "Forgot?" })
47
+ /* @__PURE__ */ a("div", { className: "space-y-1", children: [
48
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
49
+ /* @__PURE__ */ e("label", { htmlFor: "password", className: p, children: "Password" }),
50
+ o !== null && /* @__PURE__ */ e(x, { to: o, className: "text-xs text-primary hover:underline font-medium", children: "Forgot?" })
43
51
  ] }),
44
- /* @__PURE__ */ t("div", { className: "relative group", children: [
52
+ /* @__PURE__ */ a("div", { className: "relative group", children: [
45
53
  /* @__PURE__ */ e(s, { name: "lock", className: "absolute left-3 top-2.5 h-4 w-4 text-muted-foreground group-focus-within:text-primary transition-colors" }),
46
54
  /* @__PURE__ */ e(
47
- h,
55
+ f,
48
56
  {
49
57
  id: "password",
50
58
  type: "password",
51
59
  className: "pl-9 h-10 bg-background/50",
52
- value: c,
53
- onChange: (a) => d(a.target.value),
60
+ value: m,
61
+ onChange: (t) => u(t.target.value),
54
62
  required: !0
55
63
  }
56
64
  )
57
65
  ] })
58
66
  ] }),
59
- /* @__PURE__ */ e(g, { type: "submit", className: "w-full mt-2", size: "lg", disabled: i, children: i ? "Authenticating..." : "Sign In" })
67
+ /* @__PURE__ */ e(v, { type: "submit", className: "w-full mt-2", size: "lg", disabled: i, children: i ? "Authenticating..." : "Sign In" })
60
68
  ] }) }),
61
- r && r.length > 0 && /* @__PURE__ */ t("div", { className: "px-6 pb-6 space-y-3", children: [
62
- /* @__PURE__ */ t("div", { className: "relative mb-4", children: [
69
+ r && r.length > 0 && /* @__PURE__ */ a("div", { className: "px-6 pb-6 space-y-3", children: [
70
+ /* @__PURE__ */ a("div", { className: "relative mb-4", children: [
63
71
  /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ e("span", { className: "w-full border-t border-border/50" }) }),
64
72
  /* @__PURE__ */ e("div", { className: "relative flex justify-center text-xs uppercase", children: /* @__PURE__ */ e("span", { className: "bg-card px-2 text-muted-foreground", children: "Quick Select Profiles" }) })
65
73
  ] }),
66
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: r.map((a) => /* @__PURE__ */ t(
74
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: r.map((t) => /* @__PURE__ */ a(
67
75
  "button",
68
76
  {
69
77
  type: "button",
70
78
  onClick: () => {
71
- o(a.email), d("demo");
79
+ d(t.email), u("demo");
72
80
  },
73
81
  className: "flex flex-col items-start p-3 text-left border rounded-lg hover:border-primary hover:bg-primary/5 transition-all w-full focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-1 focus:ring-offset-card",
74
82
  children: [
75
- /* @__PURE__ */ e("span", { className: "font-medium text-sm text-foreground", children: a.name }),
76
- /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: a.role })
83
+ /* @__PURE__ */ e("span", { className: "font-medium text-sm text-foreground", children: t.name }),
84
+ /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: t.role })
77
85
  ]
78
86
  },
79
- a.email
87
+ t.email
80
88
  )) })
81
89
  ] }),
82
- /* @__PURE__ */ t("div", { className: "p-6 pt-0 text-center", children: [
83
- /* @__PURE__ */ t("div", { className: "relative mb-4", children: [
90
+ n !== null && /* @__PURE__ */ a("div", { className: "p-6 pt-0 text-center", children: [
91
+ /* @__PURE__ */ a("div", { className: "relative mb-4", children: [
84
92
  /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ e("span", { className: "w-full border-t" }) }),
85
93
  /* @__PURE__ */ e("div", { className: "relative flex justify-center text-xs uppercase", children: /* @__PURE__ */ e("span", { className: "bg-card px-2 text-muted-foreground", children: "Or continue with" }) })
86
94
  ] }),
87
- /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: [
95
+ /* @__PURE__ */ a("p", { className: "text-sm text-muted-foreground", children: [
88
96
  "Don't have an account?",
89
97
  " ",
90
- /* @__PURE__ */ e(p, { to: "/auth/signup", className: "font-semibold text-primary hover:underline transition-all", children: "Create one" })
98
+ /* @__PURE__ */ e(x, { to: n, className: "font-semibold text-primary hover:underline transition-all", children: b })
91
99
  ] })
92
100
  ] })
93
101
  ] })
94
102
  ] });
95
103
  };
96
104
  export {
97
- S as LoginPage
105
+ A as LoginPage
98
106
  };
@@ -4,8 +4,9 @@ export interface StatusBadgeProps {
4
4
  /** One of the 5 built-in presets. Omit and use `color` + `label` for a
5
5
  * status this preset set doesn't cover (e.g. a domain-specific state). */
6
6
  status?: StatusType;
7
- /** Tailwind background class for the dot, e.g. 'bg-emerald-500'. Overrides
8
- * the `status` preset's color when both are given. */
7
+ /** Background class for the dot, e.g. 'bg-success' or 'bg-chart-2'. Overrides
8
+ * the `status` preset's colour when both are given. Use a semantic token: a
9
+ * numeric shade is fixed across all five themes. */
9
10
  color?: string;
10
11
  /**
11
12
  * Optional custom label. If not provided, uses the default status name.
@@ -27,7 +28,7 @@ export interface StatusBadgeProps {
27
28
  * description: One of the 5 built-in presets. Determines the color of the dot. Omit and use `color`+`label` for a status outside this set.
28
29
  * - name: color
29
30
  * type: string
30
- * description: Tailwind background class for the dot (e.g. 'bg-emerald-500'). Overrides the `status` preset's color when both are given.
31
+ * description: Background class for the dot (e.g. 'bg-success'). Use a semantic token — a numeric shade does not adapt to the active theme. Overrides the `status` preset's colour when both are given.
31
32
  * - name: label
32
33
  * type: string
33
34
  * description: Custom text to display next to the dot. If omitted, displays the status name (e.g., "Online").
@@ -1,28 +1,28 @@
1
- import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
- import { cn as t } from "../../utils/cn.js";
3
- const d = {
4
- online: { color: "bg-green-500", label: "Online" },
5
- offline: { color: "bg-gray-400", label: "Offline" },
6
- error: { color: "bg-red-500", label: "Error" },
7
- warning: { color: "bg-yellow-500", label: "Warning" },
8
- active: { color: "bg-blue-500", label: "Active" }
1
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
+ import { cn as i } from "../../utils/cn.js";
3
+ const g = {
4
+ online: { color: "bg-success", label: "Online" },
5
+ offline: { color: "bg-muted-foreground", label: "Offline" },
6
+ error: { color: "bg-destructive", label: "Error" },
7
+ warning: { color: "bg-warning", label: "Warning" },
8
+ active: { color: "bg-info", label: "Active" }
9
9
  }, m = ({
10
- status: e,
11
- color: a,
12
- label: n,
13
- className: i,
14
- showDot: c = !0
10
+ status: n,
11
+ color: t,
12
+ label: r,
13
+ className: c,
14
+ showDot: a = !0
15
15
  }) => {
16
- const l = e ? d[e] : void 0, s = a ?? (l == null ? void 0 : l.color) ?? "bg-muted-foreground", o = n === null ? null : n ?? (l == null ? void 0 : l.label) ?? null;
17
- return /* @__PURE__ */ g("div", { className: t("inline-flex items-center gap-2", i), children: [
18
- c && /* @__PURE__ */ r(
16
+ const o = n ? g[n] : void 0, s = t ?? (o == null ? void 0 : o.color) ?? "bg-muted-foreground", l = r === null ? null : r ?? (o == null ? void 0 : o.label) ?? null;
17
+ return /* @__PURE__ */ d("div", { className: i("inline-flex items-center gap-2", c), children: [
18
+ a && /* @__PURE__ */ e(
19
19
  "span",
20
20
  {
21
- className: t("h-2.5 w-2.5 rounded-full ring-2 ring-white dark:ring-slate-900", s),
21
+ className: i("h-2.5 w-2.5 rounded-full ring-2 ring-card", s),
22
22
  "aria-hidden": "true"
23
23
  }
24
24
  ),
25
- o && /* @__PURE__ */ r("span", { className: "text-sm font-medium text-slate-700 dark:text-slate-300", children: o })
25
+ l && /* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: l })
26
26
  ] });
27
27
  };
28
28
  export {
@@ -1,37 +1,37 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { Icon as c } from "../ui/Icon.js";
3
- const i = {
1
+ import { jsxs as c, jsx as s } from "react/jsx-runtime";
2
+ import { Icon as o } from "../ui/Icon.js";
3
+ const a = {
4
4
  info: {
5
5
  icon: "info",
6
- classes: "bg-primary/10 border-primary/50 text-primary"
6
+ classes: "bg-info/10 border-info/50 text-info-strong"
7
7
  },
8
8
  success: {
9
9
  icon: "check-circle",
10
- classes: "bg-green-500/10 border-green-500/50 text-green-700 dark:text-green-400"
10
+ classes: "bg-success/10 border-success/50 text-success-strong"
11
11
  },
12
12
  warning: {
13
13
  icon: "alert-triangle",
14
- classes: "bg-yellow-500/10 border-yellow-500/50 text-yellow-700 dark:text-yellow-400"
14
+ classes: "bg-warning/10 border-warning/50 text-warning-strong"
15
15
  },
16
16
  danger: {
17
17
  icon: "x-circle",
18
- classes: "bg-red-500/10 border-red-500/50 text-red-700 dark:text-red-500"
18
+ classes: "bg-destructive/10 border-destructive/50 text-destructive-strong"
19
19
  }
20
- }, m = ({
21
- title: o,
22
- children: r,
23
- variant: t = "info",
24
- className: a
20
+ }, g = ({
21
+ title: n,
22
+ children: e,
23
+ variant: i = "info",
24
+ className: t
25
25
  }) => {
26
- const s = i[t];
27
- return /* @__PURE__ */ l("div", { className: `flex items-start gap-4 p-4 border-l-4 rounded-r-lg ${s.classes} ${a || ""}`, role: "alert", children: [
28
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(c, { name: s.icon, size: 20 }) }),
29
- /* @__PURE__ */ l("div", { className: "flex-grow", children: [
30
- /* @__PURE__ */ e("h4", { className: "font-semibold", children: o }),
31
- r && /* @__PURE__ */ e("div", { className: "text-sm mt-1", children: r })
26
+ const r = a[i];
27
+ return /* @__PURE__ */ c("div", { className: `flex items-start gap-4 p-4 border-l-4 rounded-r-lg ${r.classes} ${t || ""}`, role: "alert", children: [
28
+ /* @__PURE__ */ s("div", { className: "flex-shrink-0", children: /* @__PURE__ */ s(o, { name: r.icon, size: 20 }) }),
29
+ /* @__PURE__ */ c("div", { className: "flex-grow", children: [
30
+ /* @__PURE__ */ s("h4", { className: "font-semibold", children: n }),
31
+ e && /* @__PURE__ */ s("div", { className: "text-sm mt-1", children: e })
32
32
  ] })
33
33
  ] });
34
34
  };
35
35
  export {
36
- m as Alert
36
+ g as Alert
37
37
  };
@@ -2,7 +2,7 @@ import { jsxs as D, jsx as i } from "react/jsx-runtime";
2
2
  import { useState as l, useRef as g, useEffect as f, useCallback as K } from "react";
3
3
  import { Input as q } from "./Input.js";
4
4
  import { cn as p } from "../../utils/cn.js";
5
- const $ = ({
5
+ const _ = ({
6
6
  options: t,
7
7
  label: v,
8
8
  value: a,
@@ -73,5 +73,5 @@ const $ = ({
73
73
  ] });
74
74
  };
75
75
  export {
76
- $ as ComboBox
76
+ _ as ComboBox
77
77
  };
@@ -1,9 +1,10 @@
1
- import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
- import n from "react-datepicker";
1
+ import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
+ import s from "react";
3
+ import b from "react-datepicker";
3
4
  import { cn as e } from "../../utils/cn.js";
4
- import { Icon as s } from "../ui/Icon.js";
5
+ import { Icon as u } from "../ui/Icon.js";
5
6
  import "react-datepicker/dist/react-datepicker.css";
6
- const m = `
7
+ const f = `
7
8
  .react-datepicker {
8
9
  font-family: inherit !important;
9
10
  background-color: rgb(var(--app-card-bg-color)) !important;
@@ -28,36 +29,40 @@ const m = `
28
29
  .react-datepicker__navigation-icon::before {
29
30
  border-color: rgb(var(--app-text-color)) !important;
30
31
  }
31
- `, x = ({
32
+ `, y = ({
32
33
  label: o,
33
- selected: i,
34
- onChange: d,
35
- className: l,
34
+ selected: l,
35
+ onChange: n,
36
+ className: p,
36
37
  error: t,
37
38
  helperText: a,
38
- ...p
39
- }) => /* @__PURE__ */ c("div", { className: e("w-full flex flex-col", l), children: [
40
- /* @__PURE__ */ r("style", { children: m }),
41
- o && /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-foreground mb-1.5", children: o }),
42
- /* @__PURE__ */ c("div", { className: "relative", children: [
43
- /* @__PURE__ */ r(
44
- n,
45
- {
46
- selected: i,
47
- onChange: d,
48
- className: e(
49
- "flex h-10 w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
50
- t ? "border-destructive" : "border-input"
51
- ),
52
- wrapperClassName: "w-full",
53
- showPopperArrow: !1,
54
- ...p
55
- }
56
- ),
57
- /* @__PURE__ */ r("div", { className: "absolute right-3 top-2.5 pointer-events-none text-muted-foreground", children: /* @__PURE__ */ r(s, { name: "calendar", className: "h-4 w-4" }) })
58
- ] }),
59
- a && /* @__PURE__ */ r("p", { className: e("mt-1.5 text-xs", t ? "text-destructive" : "text-muted-foreground"), children: a })
60
- ] });
39
+ ...c
40
+ }) => {
41
+ const m = s.useId(), i = c.id || m;
42
+ return /* @__PURE__ */ d("div", { className: e("w-full flex flex-col", p), children: [
43
+ /* @__PURE__ */ r("style", { children: f }),
44
+ o && /* @__PURE__ */ r("label", { htmlFor: i, className: "block text-sm font-medium text-foreground mb-1.5", children: o }),
45
+ /* @__PURE__ */ d("div", { className: "relative", children: [
46
+ /* @__PURE__ */ r(
47
+ b,
48
+ {
49
+ id: i,
50
+ selected: l,
51
+ onChange: n,
52
+ className: e(
53
+ "flex h-10 w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
54
+ t ? "border-destructive" : "border-input"
55
+ ),
56
+ wrapperClassName: "w-full",
57
+ showPopperArrow: !1,
58
+ ...c
59
+ }
60
+ ),
61
+ /* @__PURE__ */ r("div", { className: "absolute right-3 top-2.5 pointer-events-none text-muted-foreground", children: /* @__PURE__ */ r(u, { name: "calendar", className: "h-4 w-4" }) })
62
+ ] }),
63
+ a && /* @__PURE__ */ r("p", { className: e("mt-1.5 text-xs", t ? "text-destructive" : "text-muted-foreground"), children: a })
64
+ ] });
65
+ };
61
66
  export {
62
- x as DatePicker
67
+ y as DatePicker
63
68
  };
@@ -1,41 +1,41 @@
1
1
  import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
- import { useState as x, useRef as A, useCallback as l } from "react";
2
+ import F, { useState as v, useRef as I, useCallback as i } from "react";
3
3
  import { Button as j } from "../ui/Button.js";
4
- import { Icon as i } from "../ui/Icon.js";
5
- import { cn as v } from "../../utils/cn.js";
6
- const S = ({
7
- onFileUpload: b,
8
- multiple: n = !1,
9
- acceptedFileTypes: o,
10
- label: c,
11
- className: N,
4
+ import { Icon as c } from "../ui/Icon.js";
5
+ import { cn as b } from "../../utils/cn.js";
6
+ const $ = ({
7
+ onFileUpload: N,
8
+ multiple: o = !1,
9
+ acceptedFileTypes: n,
10
+ label: s,
11
+ className: y,
12
12
  helperText: m
13
13
  }) => {
14
- const [y, s] = x(!1), [f, u] = x([]), p = A(null), d = l((e) => {
15
- e.preventDefault(), e.stopPropagation(), e.type === "dragenter" || e.type === "dragover" ? s(!0) : e.type === "dragleave" && s(!1);
14
+ const [D, d] = v(!1), [f, u] = v([]), p = I(null), l = i((e) => {
15
+ e.preventDefault(), e.stopPropagation(), e.type === "dragenter" || e.type === "dragover" ? d(!0) : e.type === "dragleave" && d(!1);
16
16
  }, []), g = (e) => {
17
- u((a) => n ? [...a, ...e] : [e[0]]), b(e);
18
- }, D = l((e) => {
19
- e.preventDefault(), e.stopPropagation(), s(!1), e.dataTransfer.files && e.dataTransfer.files.length > 0 && g(Array.from(e.dataTransfer.files));
20
- }, [n]), w = l((e) => {
17
+ u((a) => o ? [...a, ...e] : [e[0]]), N(e);
18
+ }, w = i((e) => {
19
+ e.preventDefault(), e.stopPropagation(), d(!1), e.dataTransfer.files && e.dataTransfer.files.length > 0 && g(Array.from(e.dataTransfer.files));
20
+ }, [o]), C = i((e) => {
21
21
  e.preventDefault(), e.target.files && e.target.files.length > 0 && g(Array.from(e.target.files));
22
- }, [n]), k = (e) => {
23
- u((a) => a.filter((h, C) => C !== e));
24
- };
25
- return /* @__PURE__ */ t("div", { className: v("w-full", N), children: [
26
- c && /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-foreground mb-1.5", children: c }),
22
+ }, [o]), k = (e) => {
23
+ u((a) => a.filter((x, A) => A !== e));
24
+ }, h = F.useId();
25
+ return /* @__PURE__ */ t("div", { className: b("w-full", y), children: [
26
+ s && /* @__PURE__ */ r("label", { htmlFor: h, className: "block text-sm font-medium text-foreground mb-1.5", children: s }),
27
27
  /* @__PURE__ */ t(
28
28
  "div",
29
29
  {
30
- className: v(
30
+ className: b(
31
31
  "relative flex flex-col items-center justify-center p-6 border-2 border-dashed rounded-lg transition-colors duration-200 ease-in-out cursor-pointer",
32
- y ? "border-primary bg-primary/5" : "border-border bg-card hover:bg-muted/50",
32
+ D ? "border-primary bg-primary/5" : "border-border bg-card hover:bg-muted/50",
33
33
  "min-h-[150px]"
34
34
  ),
35
- onDragEnter: d,
36
- onDragLeave: d,
37
- onDragOver: d,
38
- onDrop: D,
35
+ onDragEnter: l,
36
+ onDragLeave: l,
37
+ onDragOver: l,
38
+ onDrop: w,
39
39
  onClick: () => {
40
40
  var e;
41
41
  return (e = p.current) == null ? void 0 : e.click();
@@ -45,28 +45,30 @@ const S = ({
45
45
  "input",
46
46
  {
47
47
  ref: p,
48
+ id: h,
48
49
  type: "file",
49
50
  className: "hidden",
50
- multiple: n,
51
- accept: o,
52
- onChange: w
51
+ "aria-label": s || "Choose files to upload",
52
+ multiple: o,
53
+ accept: n,
54
+ onChange: C
53
55
  }
54
56
  ),
55
- /* @__PURE__ */ r("div", { className: "bg-muted p-3 rounded-full mb-3", children: /* @__PURE__ */ r(i, { name: "upload-cloud", className: "h-6 w-6 text-muted-foreground" }) }),
57
+ /* @__PURE__ */ r("div", { className: "bg-muted p-3 rounded-full mb-3", children: /* @__PURE__ */ r(c, { name: "upload-cloud", className: "h-6 w-6 text-muted-foreground" }) }),
56
58
  /* @__PURE__ */ t("p", { className: "text-sm font-medium text-foreground text-center", children: [
57
59
  /* @__PURE__ */ r("span", { className: "text-primary font-semibold hover:underline", children: "Click to upload" }),
58
60
  " or drag and drop"
59
61
  ] }),
60
62
  /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground mt-1", children: [
61
- o ? o.replace(/,/g, ", ") : "Any file type",
62
- n ? "" : " (Single file)"
63
+ n ? n.replace(/,/g, ", ") : "Any file type",
64
+ o ? "" : " (Single file)"
63
65
  ] })
64
66
  ]
65
67
  }
66
68
  ),
67
69
  f.length > 0 && /* @__PURE__ */ r("div", { className: "mt-4 space-y-2", children: f.map((e, a) => /* @__PURE__ */ t("div", { className: "flex items-center justify-between p-2 rounded-md border border-border bg-card", children: [
68
70
  /* @__PURE__ */ t("div", { className: "flex items-center gap-3 overflow-hidden", children: [
69
- /* @__PURE__ */ r("div", { className: "bg-primary/10 p-2 rounded text-primary", children: /* @__PURE__ */ r(i, { name: "file", className: "h-4 w-4" }) }),
71
+ /* @__PURE__ */ r("div", { className: "bg-primary/10 p-2 rounded text-primary", children: /* @__PURE__ */ r(c, { name: "file", className: "h-4 w-4" }) }),
70
72
  /* @__PURE__ */ t("div", { className: "min-w-0", children: [
71
73
  /* @__PURE__ */ r("p", { className: "text-sm font-medium text-foreground truncate", children: e.name }),
72
74
  /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: [
@@ -81,10 +83,10 @@ const S = ({
81
83
  variant: "ghost",
82
84
  size: "icon",
83
85
  className: "h-8 w-8 text-muted-foreground hover:text-destructive",
84
- onClick: (h) => {
85
- h.stopPropagation(), k(a);
86
+ onClick: (x) => {
87
+ x.stopPropagation(), k(a);
86
88
  },
87
- children: /* @__PURE__ */ r(i, { name: "x", className: "h-4 w-4" })
89
+ children: /* @__PURE__ */ r(c, { name: "x", className: "h-4 w-4" })
88
90
  }
89
91
  )
90
92
  ] }, `${e.name}-${a}`)) }),
@@ -92,5 +94,5 @@ const S = ({
92
94
  ] });
93
95
  };
94
96
  export {
95
- S as FileUpload
97
+ $ as FileUpload
96
98
  };
@@ -1,43 +1,44 @@
1
1
  import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import b from "react";
3
- import { Icon as g } from "../ui/Icon.js";
2
+ import c from "react";
3
+ import { Icon as N } from "../ui/Icon.js";
4
4
  import { cn as o } from "../../utils/cn.js";
5
- const v = b.forwardRef(
5
+ const h = c.forwardRef(
6
6
  ({
7
7
  label: r,
8
8
  icon: t,
9
9
  helperText: i,
10
- error: a = !1,
10
+ error: d = !1,
11
11
  required: s = !1,
12
- showOptionalLabel: d = !1,
13
- className: m,
14
- containerClassName: c,
12
+ showOptionalLabel: m = !1,
13
+ className: f,
14
+ containerClassName: u,
15
15
  ...l
16
- }, f) => {
17
- const u = "flex h-10 w-full rounded-md border bg-background py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", p = a ? "border-destructive" : "border-input", x = t ? "pl-10 pr-3" : "px-3";
18
- return /* @__PURE__ */ n("div", { className: o("w-full", c), children: [
19
- r && /* @__PURE__ */ n("label", { htmlFor: l.id || l.name, className: "block text-sm font-medium text-foreground mb-1", children: [
16
+ }, p) => {
17
+ const b = c.useId(), a = l.id || l.name || b, x = "flex h-10 w-full rounded-md border bg-background py-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", g = d ? "border-destructive" : "border-input", v = t ? "pl-10 pr-3" : "px-3";
18
+ return /* @__PURE__ */ n("div", { className: o("w-full", u), children: [
19
+ r && /* @__PURE__ */ n("label", { htmlFor: a, className: "block text-sm font-medium text-foreground mb-1", children: [
20
20
  r,
21
21
  s && /* @__PURE__ */ e("span", { className: "text-destructive ml-1", children: "*" }),
22
- !s && d && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground ml-1", children: "(optional)" })
22
+ !s && m && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground ml-1", children: "(optional)" })
23
23
  ] }),
24
24
  /* @__PURE__ */ n("div", { className: "relative w-full", children: [
25
- t && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ e(g, { name: t, className: "text-muted-foreground", size: 16 }) }),
25
+ t && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ e(N, { name: t, className: "text-muted-foreground", size: 16 }) }),
26
26
  /* @__PURE__ */ e(
27
27
  "input",
28
28
  {
29
- ref: f,
30
- className: o(u, p, x, m),
29
+ ref: p,
30
+ id: a,
31
+ className: o(x, g, v, f),
31
32
  required: s,
32
33
  ...l
33
34
  }
34
35
  )
35
36
  ] }),
36
- i && /* @__PURE__ */ e("p", { className: o("mt-1.5 text-xs", a ? "text-destructive" : "text-muted-foreground"), children: i })
37
+ i && /* @__PURE__ */ e("p", { className: o("mt-1.5 text-xs", d ? "text-destructive" : "text-muted-foreground"), children: i })
37
38
  ] });
38
39
  }
39
40
  );
40
- v.displayName = "Input";
41
+ h.displayName = "Input";
41
42
  export {
42
- v as Input
43
+ h as Input
43
44
  };
@@ -7,24 +7,24 @@ const R = (a) => /* @__PURE__ */ e(d.DropdownIndicator, { ...a, children: /* @__
7
7
  options: a,
8
8
  value: u,
9
9
  onChange: m,
10
- label: t,
10
+ label: c,
11
11
  placeholder: s = "Select...",
12
12
  isClearable: b = !0,
13
13
  isDisabled: g = !1,
14
14
  isLoading: v = !1,
15
15
  isSearchable: x = !0,
16
16
  className: f,
17
- error: c,
18
- helperText: l
17
+ error: l,
18
+ helperText: n
19
19
  }) => {
20
- const n = S(), h = (r, o) => {
20
+ const t = S(), h = (r, o) => {
21
21
  const C = r ? Array.from(r) : null;
22
22
  m(C);
23
23
  }, y = {
24
24
  control: (r, o) => ({
25
25
  ...r,
26
26
  backgroundColor: "rgb(var(--app-card-bg-color))",
27
- borderColor: c ? "rgb(var(--app-danger-color))" : o.isFocused ? "rgb(var(--app-primary-color))" : "rgb(var(--app-border-color))",
27
+ borderColor: l ? "rgb(var(--app-danger-color))" : o.isFocused ? "rgb(var(--app-primary-color))" : "rgb(var(--app-border-color))",
28
28
  color: "rgb(var(--app-text-color))",
29
29
  borderRadius: "var(--app-border-radius-md)",
30
30
  boxShadow: o.isFocused ? "0 0 0 1px rgb(var(--app-primary-color))" : "none",
@@ -83,11 +83,12 @@ const R = (a) => /* @__PURE__ */ e(d.DropdownIndicator, { ...a, children: /* @__
83
83
  })
84
84
  };
85
85
  return /* @__PURE__ */ I("div", { className: p("w-full", f), children: [
86
- t && /* @__PURE__ */ e("label", { htmlFor: n, className: "block text-sm font-medium text-foreground mb-1.5", children: t }),
86
+ c && /* @__PURE__ */ e("label", { htmlFor: t, className: "block text-sm font-medium text-foreground mb-1.5", children: c }),
87
87
  /* @__PURE__ */ e(
88
88
  k,
89
89
  {
90
- instanceId: n,
90
+ instanceId: t,
91
+ inputId: t,
91
92
  styles: y,
92
93
  components: { DropdownIndicator: R, MultiValueRemove: w },
93
94
  options: a,
@@ -103,7 +104,7 @@ const R = (a) => /* @__PURE__ */ e(d.DropdownIndicator, { ...a, children: /* @__
103
104
  menuPosition: "fixed"
104
105
  }
105
106
  ),
106
- l && /* @__PURE__ */ e("p", { className: p("mt-1.5 text-xs", c ? "text-destructive" : "text-muted-foreground"), children: l })
107
+ n && /* @__PURE__ */ e("p", { className: p("mt-1.5 text-xs", l ? "text-destructive" : "text-muted-foreground"), children: n })
107
108
  ] });
108
109
  };
109
110
  export {