@ramme-io/ui 4.0.1 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +159 -7
- package/dist/blocks/ai/Actions.js +2 -2
- package/dist/blocks/ai/PromptInput.js +6 -6
- package/dist/component-registry.js +389 -359
- package/dist/components/ai/AIChatThread/AIChatThread.js +81 -73
- package/dist/components/ai/ArchitectureReferenceCard/ArchitectureReferenceCard.d.ts +28 -0
- package/dist/components/ai/ArchitectureReferenceCard/ArchitectureReferenceCard.js +70 -0
- package/dist/components/ai/ArchitectureReferenceCard/index.d.ts +2 -0
- package/dist/components/ai/CounterpartyGraphCard/CounterpartyGraphCard.d.ts +30 -0
- package/dist/components/ai/CounterpartyGraphCard/CounterpartyGraphCard.js +82 -0
- package/dist/components/ai/CounterpartyGraphCard/index.d.ts +2 -0
- package/dist/components/ai/DivergenceMetricsCard/DivergenceMetricsCard.d.ts +29 -0
- package/dist/components/ai/DivergenceMetricsCard/DivergenceMetricsCard.js +69 -0
- package/dist/components/ai/DivergenceMetricsCard/index.d.ts +2 -0
- package/dist/components/ai/KeyInjectionOverlay.d.ts +10 -0
- package/dist/components/ai/KeyInjectionOverlay.js +11 -11
- package/dist/components/ai/NewsSummaryCard/NewsSummaryCard.js +17 -17
- package/dist/components/ai/StockChart/StockChart.js +4 -4
- package/dist/components/auth/AuthLayout.js +4 -4
- package/dist/components/auth/LoginPage.d.ts +22 -0
- package/dist/components/auth/LoginPage.js +50 -42
- package/dist/components/data-display/CodeBlock.d.ts +33 -7
- package/dist/components/data-display/CodeBlock.js +134 -41
- package/dist/components/data-display/Table.js +8 -8
- package/dist/components/feedback/EmptyState.js +9 -9
- package/dist/components/feedback/ToastProvider.js +4 -4
- package/dist/components/forms/Checkbox.js +5 -5
- package/dist/components/forms/ComboBox.js +2 -2
- package/dist/components/forms/DatePicker.js +37 -32
- package/dist/components/forms/FileUpload.js +39 -37
- package/dist/components/forms/Input.js +19 -18
- package/dist/components/forms/MultiSelect.js +9 -8
- package/dist/components/forms/Radio.js +6 -6
- package/dist/components/forms/SegmentedControl.d.ts +1 -1
- package/dist/components/forms/SegmentedControl.js +28 -11
- package/dist/components/forms/Select.js +9 -8
- package/dist/components/forms/Textarea.d.ts +13 -11
- package/dist/components/forms/Textarea.js +36 -16
- package/dist/components/forms/ToggleSwitch.js +9 -9
- package/dist/components/layout/AboutRamme.d.ts +8 -0
- package/dist/components/layout/Accordion.js +25 -32
- package/dist/components/layout/AppShell.js +7 -7
- package/dist/components/layout/Card.js +38 -21
- package/dist/components/layout/DetailDrawer.js +37 -38
- package/dist/components/layout/Drawer.js +50 -51
- package/dist/components/layout/List.js +9 -9
- package/dist/components/layout/Modal.js +5 -5
- package/dist/components/layout/PageHeader.js +7 -7
- package/dist/components/layout/SectionHeader.js +4 -4
- package/dist/components/layout/SettingsContainer.d.ts +12 -0
- package/dist/components/layout/SettingsContainer.js +30 -18
- package/dist/components/layout/Sheet.d.ts +58 -0
- package/dist/components/layout/Sheet.js +144 -0
- package/dist/components/layout/Sidebar.js +1 -1
- package/dist/components/layout/UserNav.d.ts +13 -0
- package/dist/components/layout/UserNav.js +17 -17
- package/dist/components/molecular/ConnectorOverlay.d.ts +12 -0
- package/dist/components/navigation/Breadcrumbs.js +8 -8
- package/dist/components/navigation/Menu.js +6 -6
- package/dist/components/navigation/MobileNav.d.ts +44 -1
- package/dist/components/navigation/MobileNav.js +97 -71
- package/dist/components/navigation/Pagination.js +46 -41
- package/dist/components/navigation/Stepper.js +17 -17
- package/dist/components/navigation/Tabs.js +18 -11
- package/dist/components/theme/ThemeLab.d.ts +7 -1
- package/dist/components/theme/ThemeLab.js +175 -154
- package/dist/components/ui/icon-loader.d.ts +1 -1
- package/dist/contexts/ThemeContext.js +111 -82
- package/dist/data/mockData.d.ts +0 -3
- package/dist/index.css +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.js +222 -197
- package/dist/lib/hooks/useBodyScrollLock.d.ts +27 -0
- package/dist/lib/hooks/useBodyScrollLock.js +18 -0
- package/dist/lib/hooks/useSheetGesture.d.ts +81 -0
- package/dist/lib/hooks/useSheetGesture.js +70 -0
- package/dist/lib/theme/themeUtils.d.ts +21 -0
- package/dist/lib/theme/themeUtils.js +31 -17
- package/dist/setupTests.d.ts +1 -0
- package/dist/wizardManifest.js +364 -19
- package/package.json +10 -4
- package/src/wizardManifest.ts +364 -19
- package/tailwind.preset.js +98 -10
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import { EmptyState as d } from "../feedback/EmptyState.js";
|
|
3
|
-
const b = ({ headers:
|
|
4
|
-
i && /* @__PURE__ */ e("caption", { className: "p-4 text-lg font-semibold text-
|
|
5
|
-
/* @__PURE__ */ e("thead", { className: "bg-card-alt", children: /* @__PURE__ */ e("tr", { children:
|
|
6
|
-
/* @__PURE__ */ e("tbody", { className: "divide-y divide-border", children: a.length > 0 ? a.map((t,
|
|
7
|
-
const
|
|
8
|
-
return /* @__PURE__ */ e("td", { className: "p-4 text-sm text-
|
|
9
|
-
}) },
|
|
3
|
+
const b = ({ headers: l, data: a, caption: i, className: n }) => /* @__PURE__ */ e("div", { className: `overflow-x-auto rounded-lg border border-border ${n || ""}`, children: /* @__PURE__ */ c("table", { className: "w-full text-left", children: [
|
|
4
|
+
i && /* @__PURE__ */ e("caption", { className: "p-4 text-lg font-semibold text-foreground bg-card-alt", children: i }),
|
|
5
|
+
/* @__PURE__ */ e("thead", { className: "bg-card-alt", children: /* @__PURE__ */ e("tr", { children: l.map((t) => /* @__PURE__ */ e("th", { scope: "col", className: "p-4 text-sm font-semibold text-foreground whitespace-nowrap", children: t.label }, t.key)) }) }),
|
|
6
|
+
/* @__PURE__ */ e("tbody", { className: "divide-y divide-border", children: a.length > 0 ? a.map((t, s) => /* @__PURE__ */ e("tr", { className: "hover:bg-primary/5 transition-colors", children: l.map((r) => {
|
|
7
|
+
const o = t[r.key];
|
|
8
|
+
return /* @__PURE__ */ e("td", { className: "p-4 text-sm text-muted-foreground whitespace-nowrap", children: r.render ? r.render(o, t) : String(o) }, r.key);
|
|
9
|
+
}) }, s)) : /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: l.length, children: /* @__PURE__ */ e("div", { className: "p-8 flex justify-center items-center", children: /* @__PURE__ */ e(
|
|
10
10
|
d,
|
|
11
11
|
{
|
|
12
12
|
title: "No Data Available",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Card as
|
|
3
|
-
import { Icon as
|
|
4
|
-
const
|
|
5
|
-
t && /* @__PURE__ */ e("div", { className: "text-
|
|
6
|
-
/* @__PURE__ */ e("h3", { className: "text-2xl font-semibold text-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Card as o } from "../layout/Card.js";
|
|
3
|
+
import { Icon as a } from "../ui/Icon.js";
|
|
4
|
+
const i = ({ icon: t, title: s, description: r, actionButton: m, className: d }) => /* @__PURE__ */ l(o, { className: `p-8 text-center flex flex-col items-center justify-center space-y-4 ${d || ""}`, children: [
|
|
5
|
+
t && /* @__PURE__ */ e("div", { className: "text-muted-foreground/50 mb-4", children: /* @__PURE__ */ e(a, { name: t, size: 64, strokeWidth: 1.5 }) }),
|
|
6
|
+
/* @__PURE__ */ e("h3", { className: "text-2xl font-semibold text-foreground", children: s }),
|
|
7
|
+
r && /* @__PURE__ */ e("p", { className: "text-muted-foreground max-w-md", children: r }),
|
|
8
|
+
m && /* @__PURE__ */ e("div", { className: "mt-4", children: m })
|
|
9
9
|
] });
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
i as EmptyState
|
|
12
12
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as f, jsx as
|
|
1
|
+
import { jsxs as f, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import p, { useState as T, useCallback as d, createContext as v, useContext as g } from "react";
|
|
3
3
|
import { createPortal as h } from "react-dom";
|
|
4
4
|
import { Toast as w } from "./Toast.js";
|
|
@@ -8,17 +8,17 @@ const c = v(void 0), S = () => {
|
|
|
8
8
|
throw new Error("useToast must be used within a ToastProvider");
|
|
9
9
|
return o;
|
|
10
10
|
}, j = ({ children: o }) => {
|
|
11
|
-
const [m, i] = T([]),
|
|
11
|
+
const [m, i] = T([]), a = d((t, s = "info", r = 3e3) => {
|
|
12
12
|
const l = Date.now().toString() + Math.random().toString(36).substring(2, 9);
|
|
13
13
|
i((x) => [...x, { id: l, message: t, type: s, duration: r }]);
|
|
14
14
|
}, []), e = d((t) => {
|
|
15
15
|
i((s) => s.filter((r) => r.id !== t));
|
|
16
|
-
}, []), u = p.useMemo(() => ({ addToast:
|
|
16
|
+
}, []), u = p.useMemo(() => ({ addToast: a, dismissToast: e }), [a, e]);
|
|
17
17
|
return /* @__PURE__ */ f(c.Provider, { value: u, children: [
|
|
18
18
|
o,
|
|
19
19
|
h(
|
|
20
20
|
// This container holds all the toasts and positions them on the screen
|
|
21
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ n("div", { className: "fixed bottom-4 right-4 z-toast w-80 max-w-full space-y-2", children: m.map((t) => /* @__PURE__ */ n(
|
|
22
22
|
w,
|
|
23
23
|
{
|
|
24
24
|
id: t.id,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as a } from "react";
|
|
3
|
-
const u = ({ label: e, id:
|
|
4
|
-
const [t] = a(() =>
|
|
3
|
+
const u = ({ label: e, id: s, className: o, ...c }) => {
|
|
4
|
+
const [t] = a(() => s || `checkbox-${Math.random().toString(36).substr(2, 9)}`);
|
|
5
5
|
return /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
6
|
-
/* @__PURE__ */
|
|
6
|
+
/* @__PURE__ */ r(
|
|
7
7
|
"input",
|
|
8
8
|
{
|
|
9
9
|
id: t,
|
|
@@ -12,7 +12,7 @@ const u = ({ label: e, id: r, className: o, ...c }) => {
|
|
|
12
12
|
...c
|
|
13
13
|
}
|
|
14
14
|
),
|
|
15
|
-
e && /* @__PURE__ */
|
|
15
|
+
e && /* @__PURE__ */ r("label", { htmlFor: t, className: "ml-2 text-sm text-foreground cursor-pointer", children: e })
|
|
16
16
|
] });
|
|
17
17
|
};
|
|
18
18
|
export {
|
|
@@ -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
|
-
|
|
76
|
+
_ as ComboBox
|
|
77
77
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
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
|
|
5
|
+
import { Icon as u } from "../ui/Icon.js";
|
|
5
6
|
import "react-datepicker/dist/react-datepicker.css";
|
|
6
|
-
const
|
|
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
|
-
`,
|
|
32
|
+
`, y = ({
|
|
32
33
|
label: o,
|
|
33
|
-
selected:
|
|
34
|
-
onChange:
|
|
35
|
-
className:
|
|
34
|
+
selected: l,
|
|
35
|
+
onChange: n,
|
|
36
|
+
className: p,
|
|
36
37
|
error: t,
|
|
37
38
|
helperText: a,
|
|
38
|
-
...
|
|
39
|
-
}) =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */ r(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
5
|
-
import { cn as
|
|
6
|
-
const
|
|
7
|
-
onFileUpload:
|
|
8
|
-
multiple:
|
|
9
|
-
acceptedFileTypes:
|
|
10
|
-
label:
|
|
11
|
-
className:
|
|
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 [
|
|
15
|
-
e.preventDefault(), e.stopPropagation(), e.type === "dragenter" || e.type === "dragover" ?
|
|
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) =>
|
|
18
|
-
},
|
|
19
|
-
e.preventDefault(), e.stopPropagation(),
|
|
20
|
-
}, [
|
|
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
|
-
}, [
|
|
23
|
-
u((a) => a.filter((
|
|
24
|
-
};
|
|
25
|
-
return /* @__PURE__ */ t("div", { className:
|
|
26
|
-
|
|
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:
|
|
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
|
-
|
|
32
|
+
D ? "border-primary bg-primary/5" : "border-border bg-card hover:bg-muted/50",
|
|
33
33
|
"min-h-[150px]"
|
|
34
34
|
),
|
|
35
|
-
onDragEnter:
|
|
36
|
-
onDragLeave:
|
|
37
|
-
onDragOver:
|
|
38
|
-
onDrop:
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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(
|
|
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
|
-
|
|
62
|
-
|
|
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(
|
|
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: (
|
|
85
|
-
|
|
86
|
+
onClick: (x) => {
|
|
87
|
+
x.stopPropagation(), k(a);
|
|
86
88
|
},
|
|
87
|
-
children: /* @__PURE__ */ r(
|
|
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
|
-
|
|
97
|
+
$ as FileUpload
|
|
96
98
|
};
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Icon as
|
|
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
|
|
5
|
+
const h = c.forwardRef(
|
|
6
6
|
({
|
|
7
7
|
label: r,
|
|
8
8
|
icon: t,
|
|
9
9
|
helperText: i,
|
|
10
|
-
error:
|
|
10
|
+
error: d = !1,
|
|
11
11
|
required: s = !1,
|
|
12
|
-
showOptionalLabel:
|
|
13
|
-
className:
|
|
14
|
-
containerClassName:
|
|
12
|
+
showOptionalLabel: m = !1,
|
|
13
|
+
className: f,
|
|
14
|
+
containerClassName: u,
|
|
15
15
|
...l
|
|
16
|
-
},
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */ n("div", { className: o("w-full",
|
|
19
|
-
r && /* @__PURE__ */ n("label", { htmlFor:
|
|
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 &&
|
|
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(
|
|
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:
|
|
30
|
-
|
|
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",
|
|
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
|
-
|
|
41
|
+
h.displayName = "Input";
|
|
41
42
|
export {
|
|
42
|
-
|
|
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:
|
|
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:
|
|
18
|
-
helperText:
|
|
17
|
+
error: l,
|
|
18
|
+
helperText: n
|
|
19
19
|
}) => {
|
|
20
|
-
const
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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 {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsxs as a, jsx as
|
|
2
|
-
const m = ({ label:
|
|
3
|
-
const
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
const m = ({ label: e, id: s, className: o, ...i }) => {
|
|
3
|
+
const r = s || `radio-${Math.random().toString(36).substr(2, 9)}`;
|
|
4
4
|
return /* @__PURE__ */ a("div", { className: "flex items-center", children: [
|
|
5
|
-
/* @__PURE__ */
|
|
5
|
+
/* @__PURE__ */ t(
|
|
6
6
|
"input",
|
|
7
7
|
{
|
|
8
|
-
id:
|
|
8
|
+
id: r,
|
|
9
9
|
type: "radio",
|
|
10
10
|
className: `form-radio h-4 w-4 transition-colors duration-200 ease-in-out cursor-pointer text-primary border-border bg-card focus:ring-primary disabled:opacity-50 disabled:cursor-not-allowed ${o || ""}`,
|
|
11
11
|
...i
|
|
12
12
|
}
|
|
13
13
|
),
|
|
14
|
-
|
|
14
|
+
e && /* @__PURE__ */ t("label", { htmlFor: r, className: "ml-2 text-sm text-foreground cursor-pointer", children: e })
|
|
15
15
|
] });
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
@@ -19,7 +19,7 @@ export interface SegmentedControlProps {
|
|
|
19
19
|
/**
|
|
20
20
|
* @wizard
|
|
21
21
|
* @name SegmentedControl
|
|
22
|
-
* @description A theme-aware linear toggle component. Ideal for switching between discrete modes (e.g., "Map / List").
|
|
22
|
+
* @description A theme-aware linear toggle component. Ideal for switching between discrete modes (e.g., "Map / List"). Every size clears the 24px WCAG 2.5.8 (AA) target-size minimum — xs 24px, sm ~25px, md ~36px. None reaches the 44px 2.5.5 (AAA) figure, so for a primary control on a touch screen prefer md or give the control its own 44px row; xs and sm are density sizes for pointer-driven toolbars.
|
|
23
23
|
* @tags input, toggle, switch, radio, control
|
|
24
24
|
* @category form
|
|
25
25
|
* @id segmented-control
|
|
@@ -1,29 +1,46 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cn as d } from "../../utils/cn.js";
|
|
3
3
|
const m = ({
|
|
4
4
|
options: n,
|
|
5
|
-
value:
|
|
5
|
+
value: i,
|
|
6
6
|
onChange: l,
|
|
7
7
|
size: r = "md",
|
|
8
|
-
className:
|
|
9
|
-
}) => /* @__PURE__ */
|
|
8
|
+
className: o
|
|
9
|
+
}) => /* @__PURE__ */ t("div", { className: d(
|
|
10
10
|
// Container: Use 'muted' background for the track (works in all themes)
|
|
11
11
|
"inline-flex bg-muted border border-border",
|
|
12
12
|
r === "xs" ? "rounded-md p-0.5" : "rounded-lg p-1",
|
|
13
|
-
|
|
13
|
+
o
|
|
14
14
|
), children: n.map((e) => {
|
|
15
|
-
const
|
|
16
|
-
return /* @__PURE__ */
|
|
15
|
+
const s = e.value === i;
|
|
16
|
+
return /* @__PURE__ */ t(
|
|
17
17
|
"button",
|
|
18
18
|
{
|
|
19
19
|
onClick: () => !e.disabled && l(e.value),
|
|
20
20
|
disabled: e.disabled,
|
|
21
|
-
className:
|
|
21
|
+
className: d(
|
|
22
22
|
"relative rounded-md font-medium transition-all duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",
|
|
23
23
|
// Size Variants
|
|
24
|
-
|
|
24
|
+
//
|
|
25
|
+
// `xs` carries a stated 24px floor rather than a padding value
|
|
26
|
+
// tuned to reach one. WCAG 2.5.8 Target Size (Minimum, level AA)
|
|
27
|
+
// is 24x24; this variant measured 19px, so it was the only size
|
|
28
|
+
// in the set that failed. min-h-6 cannot drift when the fluid
|
|
29
|
+
// scale interpolates or when a theme changes the base font size,
|
|
30
|
+
// where padding arithmetic silently can.
|
|
31
|
+
//
|
|
32
|
+
// It also drops `text-[10px]`: an arbitrary type size is banned
|
|
33
|
+
// outright by AGENTS.md, and being outside the scale made this
|
|
34
|
+
// the one size that ignored both the viewport and
|
|
35
|
+
// useTheme().setFontSize — it measured 19px at 360px and 19px at
|
|
36
|
+
// 1280px while every other size moved.
|
|
37
|
+
//
|
|
38
|
+
// inline-flex is scoped to `xs` on purpose. Applying it to all
|
|
39
|
+
// three would re-resolve the line box for `sm` and `md`, and
|
|
40
|
+
// those two already clear AA and must not move.
|
|
41
|
+
r === "xs" ? "inline-flex items-center justify-center min-h-6 text-2xs px-2 py-0.5" : r === "sm" ? "text-xs px-3 py-1" : "text-sm px-4 py-1.5",
|
|
25
42
|
// State Styles (Theme Aware)
|
|
26
|
-
|
|
43
|
+
s ? "bg-card text-foreground shadow-sm ring-1 ring-black/5 dark:ring-white/10" : "text-muted-foreground hover:text-foreground hover:bg-background/50",
|
|
27
44
|
e.disabled && "opacity-50 cursor-not-allowed"
|
|
28
45
|
),
|
|
29
46
|
type: "button",
|
|
@@ -7,21 +7,21 @@ const S = (a) => /* @__PURE__ */ e(I.DropdownIndicator, { ...a, children: /* @__
|
|
|
7
7
|
options: a,
|
|
8
8
|
value: l,
|
|
9
9
|
onChange: i,
|
|
10
|
-
label:
|
|
10
|
+
label: p,
|
|
11
11
|
placeholder: m = "Select...",
|
|
12
12
|
isDisabled: s = !1,
|
|
13
13
|
isLoading: u = !1,
|
|
14
14
|
isClearable: b = !0,
|
|
15
15
|
isSearchable: g = !0,
|
|
16
16
|
className: v,
|
|
17
|
-
error:
|
|
18
|
-
helperText:
|
|
17
|
+
error: t,
|
|
18
|
+
helperText: d
|
|
19
19
|
}) => {
|
|
20
|
-
const
|
|
20
|
+
const c = h(), x = {
|
|
21
21
|
control: (r, o) => ({
|
|
22
22
|
...r,
|
|
23
23
|
backgroundColor: "rgb(var(--app-card-bg-color))",
|
|
24
|
-
borderColor:
|
|
24
|
+
borderColor: t ? "rgb(var(--app-danger-color))" : o.isFocused ? "rgb(var(--app-primary-color))" : "rgb(var(--app-border-color))",
|
|
25
25
|
color: "rgb(var(--app-text-color))",
|
|
26
26
|
borderRadius: "var(--app-border-radius-md)",
|
|
27
27
|
boxShadow: o.isFocused ? "0 0 0 1px rgb(var(--app-primary-color))" : "none",
|
|
@@ -65,11 +65,12 @@ const S = (a) => /* @__PURE__ */ e(I.DropdownIndicator, { ...a, children: /* @__
|
|
|
65
65
|
})
|
|
66
66
|
};
|
|
67
67
|
return /* @__PURE__ */ f("div", { className: n("w-full", v), children: [
|
|
68
|
-
|
|
68
|
+
p && /* @__PURE__ */ e("label", { htmlFor: c, className: "block text-sm font-medium text-foreground mb-1.5", children: p }),
|
|
69
69
|
/* @__PURE__ */ e(
|
|
70
70
|
y,
|
|
71
71
|
{
|
|
72
|
-
instanceId:
|
|
72
|
+
instanceId: c,
|
|
73
|
+
inputId: c,
|
|
73
74
|
styles: x,
|
|
74
75
|
components: { DropdownIndicator: S },
|
|
75
76
|
options: a,
|
|
@@ -84,7 +85,7 @@ const S = (a) => /* @__PURE__ */ e(I.DropdownIndicator, { ...a, children: /* @__
|
|
|
84
85
|
menuPosition: "fixed"
|
|
85
86
|
}
|
|
86
87
|
),
|
|
87
|
-
|
|
88
|
+
d && /* @__PURE__ */ e("p", { className: n("mt-1.5 text-xs", t ? "text-destructive" : "text-muted-foreground"), children: d })
|
|
88
89
|
] });
|
|
89
90
|
};
|
|
90
91
|
export {
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
2
|
+
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
3
|
label?: string;
|
|
4
|
+
helperText?: string;
|
|
5
|
+
error?: boolean;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
showOptionalLabel?: boolean;
|
|
4
8
|
containerClassName?: string;
|
|
5
9
|
}
|
|
6
10
|
/**
|
|
7
11
|
* @wizard
|
|
8
12
|
* @name Textarea
|
|
9
|
-
* @description A theme-aware
|
|
10
|
-
* @tags form, input, ui
|
|
11
|
-
* @props
|
|
12
|
-
* - name: label
|
|
13
|
-
* type: string
|
|
14
|
-
* description: An optional label to display above the textarea.
|
|
15
|
-
* - name: containerClassName
|
|
16
|
-
* type: string
|
|
17
|
-
* description: Optional additional CSS classes for the container div.
|
|
13
|
+
* @description A theme-aware multi-line text input with label, helper text, and validation state support. Strategic purpose: the multi-line sibling of Input, styled identically so the two are indistinguishable when stacked in one form. Forwards all standard HTML textarea attributes via spread.
|
|
14
|
+
* @tags form, input, ui, text, multiline
|
|
18
15
|
* @category form
|
|
19
16
|
* @id textarea
|
|
17
|
+
* @param {string} label - Optional label displayed above the textarea.
|
|
18
|
+
* @param {string} helperText - Supporting text rendered below the textarea. Appears in destructive color when error is true.
|
|
19
|
+
* @param {boolean} error - If true, applies destructive border styling to indicate a validation error. Defaults to false.
|
|
20
|
+
* @param {boolean} required - If true, appends a required (*) indicator next to the label. Defaults to false.
|
|
21
|
+
* @param {boolean} showOptionalLabel - If true, appends an (optional) label when the field is not required. Defaults to false.
|
|
22
|
+
* @param {string} containerClassName - Additional CSS classes applied to the outer container div.
|
|
20
23
|
*/
|
|
21
24
|
export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
22
|
-
export {};
|