chordia-ui 3.1.3 → 3.1.4

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 (36) hide show
  1. package/dist/AutoSearch.cjs.js +2 -0
  2. package/dist/AutoSearch.cjs.js.map +1 -0
  3. package/dist/AutoSearch.es.js +190 -0
  4. package/dist/AutoSearch.es.js.map +1 -0
  5. package/dist/TextInput.cjs.js +2 -0
  6. package/dist/TextInput.cjs.js.map +1 -0
  7. package/dist/TextInput.es.js +53 -0
  8. package/dist/TextInput.es.js.map +1 -0
  9. package/dist/components/common.cjs.js +1 -1
  10. package/dist/components/common.es.js +16 -13
  11. package/dist/components/common.es.js.map +1 -1
  12. package/dist/components/models.cjs.js +1 -1
  13. package/dist/components/models.cjs.js.map +1 -1
  14. package/dist/components/models.es.js +9 -9
  15. package/dist/components/models.es.js.map +1 -1
  16. package/dist/components/primitives.cjs.js +1 -1
  17. package/dist/components/primitives.cjs.js.map +1 -1
  18. package/dist/components/primitives.es.js +411 -196
  19. package/dist/components/primitives.es.js.map +1 -1
  20. package/dist/index.cjs.js +1 -1
  21. package/dist/index.cjs2.js +2 -2
  22. package/dist/index.cjs2.js.map +1 -1
  23. package/dist/index.es.js +58 -54
  24. package/dist/index.es.js.map +1 -1
  25. package/dist/index.es2.js +1265 -1262
  26. package/dist/index.es2.js.map +1 -1
  27. package/dist/style.css +1 -1
  28. package/package.json +1 -1
  29. package/src/components/common/AutoSearch.jsx +249 -0
  30. package/src/components/common/index.js +1 -0
  31. package/src/components/index.js +2 -1
  32. package/src/components/login/LoginPage.jsx +95 -94
  33. package/src/components/models/OverlayPanel.jsx +1 -1
  34. package/src/components/primitives/MultiSelect.jsx +326 -0
  35. package/src/components/primitives/index.js +1 -0
  36. package/src/tokens/colors.css +1 -0
@@ -0,0 +1,2 @@
1
+ "use strict";const r=require("react/jsx-runtime"),o=require("react"),p=require("lucide-react"),q=require("./TextInput.cjs.js"),j=require("./SmallButton.cjs.js"),E=({options:m=[],value:c=null,onChange:l,placeholder:g="Search...",disabled:k=!1,showSuggestions:n=!0,styling:w,isAddNew:u=!1})=>{const[a,i]=o.useState(""),[f,s]=o.useState(!1),[d,x]=o.useState(null),b=o.useRef(null),y=o.useMemo(()=>{if(!n)return[];const e=a.toLowerCase();return m.filter(t=>{if(!t)return!1;const v=t.label||"",h=t.value||"";return(v.toLowerCase().includes(e)||h.toLowerCase().includes(e))&&(!d||t.value!==d.value)})},[a,m,n,d]),S=o.useMemo(()=>{if(!u)return!1;const e=a.toLowerCase();return m.some(t=>{if(!t)return!1;const v=t.label||"",h=t.value||"";return v.toLowerCase()===e||h.toLowerCase()===e})},[m,a,u]);o.useEffect(()=>{if(!f)return;const e=t=>{b.current&&!b.current.contains(t.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);const L=e=>{l==null||l(e),i(""),s(!1),x(null)},N=()=>{const e={label:a,value:a};x(e),l==null||l(e),s(!1),i("")},O=()=>{l==null||l(null),i(""),s(!1),x(null)},T=e=>{const t=e.target.value;n?(i(t),s(!0)):u?(i(t),s(t.length>=3)):l==null||l(t)},I=()=>{(n||u)&&s(!0)},R=f&&!c&&a.length>=3;return r.jsxs("div",{className:"relative w-full",ref:b,children:[r.jsxs("div",{className:w||"flex items-center gap-2 border rounded-md px-3 py-2 bg-white shadow-sm",children:[r.jsx(p.Search,{className:"w-4 h-4 text-gray-400"}),r.jsx("div",{className:"flex-1",children:n&&c?r.jsx("div",{className:"text-gray-800 truncate",title:c.label,style:{fontSize:"var(--text-sm)",fontWeight:"var(--font-medium)",letterSpacing:"var(--tracking-normal)",lineHeight:"var(--leading-normal)",textTransform:"none",textDecoration:"none",fontFamily:"var(--font-sans)"},children:c.label}):r.jsx(q.TextInput,{value:n||u?a:c||"",onChange:e=>T({target:{value:e}}),placeholder:g,disabled:k,style:{border:"none",boxShadow:"none",padding:0,backgroundColor:"transparent"},onFocus:I})}),(c||d)&&r.jsx(j.SmallButton,{type:"button",variant:"ghost",size:"sm",onClick:O,style:{padding:0,width:20,height:20,border:"none",backgroundColor:"transparent",color:"rgba(107,114,128,1)"},children:r.jsx(p.X,{className:"w-3 h-3"})})]}),R&&r.jsxs("div",{className:"absolute w-full rounded-md border border-gray-300 bg-white shadow-lg custom-thin-scrollbar-library",style:{maxHeight:240,overflowY:"auto",zIndex:30},children:[y.length>0&&r.jsx("ul",{className:"m-0 p-0 list-none",children:y.map(e=>r.jsx("li",{onClick:()=>L(e),onMouseEnter:t=>{t.currentTarget.style.backgroundColor="var(--hover-warm)"},onMouseLeave:t=>{t.currentTarget.style.backgroundColor="transparent"},className:"cursor-pointer px-4 py-2",title:e.label,children:r.jsx("span",{className:"truncate block w-full",style:{fontFamily:"var(--font-sans)",color:"var(--text-base)",fontSize:"var(--text-sm)",fontWeight:"var(--font-medium)",letterSpacing:"var(--tracking-normal)",lineHeight:"var(--leading-normal)",textTransform:"none",textDecoration:"none"},children:e.label})},e.value))}),u&&!S&&!d&&a.length>=3&&r.jsxs(j.SmallButton,{type:"button",variant:"secondary",onClick:N,style:{width:"100%",justifyContent:"space-between",padding:"8px 10px",border:"none",borderTop:"1px solid rgba(229, 231, 235, 1)",borderRadius:0,backgroundColor:"transparent",color:"rgba(107,114,128,1)"},children:[r.jsx("span",{children:`Add "${a}"`}),r.jsx(p.PlusCircle,{className:"w-5 h-5 text-green-500"})]})]})]})};exports.AutoSearch=E;
2
+ //# sourceMappingURL=AutoSearch.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoSearch.cjs.js","sources":["../src/components/common/AutoSearch.jsx"],"sourcesContent":["\"use client\";\n\nimport React, { useState, useMemo, useRef, useEffect } from \"react\";\nimport { X, Search, PlusCircle } from \"lucide-react\";\nimport TextInput from \"../primitives/TextInput\";\nimport SmallButton from \"../primitives/SmallButton\";\n\nconst AutoSearch = ({\n options = [],\n value = null,\n onChange,\n placeholder = \"Search...\",\n disabled = false,\n showSuggestions = true,\n styling,\n isAddNew = false,\n}) => {\n const [search, setSearch] = useState(\"\");\n const [isOpen, setIsOpen] = useState(false);\n const [addedOption, setAddedOption] = useState(null);\n\n const containerRef = useRef(null);\n\n const filteredOptions = useMemo(() => {\n if (!showSuggestions) return [];\n const lower = search.toLowerCase();\n\n return options.filter((opt) => {\n if (!opt) return false;\n const label = opt.label || \"\";\n const val = opt.value || \"\";\n return (\n (label.toLowerCase().includes(lower) ||\n val.toLowerCase().includes(lower)) &&\n (!addedOption || opt.value !== addedOption.value)\n );\n });\n }, [search, options, showSuggestions, addedOption]);\n\n const exactMatchExists = useMemo(() => {\n if (!isAddNew) return false;\n const lower = search.toLowerCase();\n return options.some((opt) => {\n if (!opt) return false;\n const label = opt.label || \"\";\n const val = opt.value || \"\";\n return label.toLowerCase() === lower || val.toLowerCase() === lower;\n });\n }, [options, search, isAddNew]);\n\n // Close dropdown on outside click\n useEffect(() => {\n if (!isOpen) return;\n const handleClickOutside = (event) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target)\n ) {\n setIsOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\n }, [isOpen]);\n\n const handleSelect = (opt) => {\n onChange?.(opt);\n setSearch(\"\");\n setIsOpen(false);\n setAddedOption(null);\n };\n\n const handleAddNew = () => {\n const newOpt = { label: search, value: search };\n setAddedOption(newOpt);\n onChange?.(newOpt);\n setIsOpen(false);\n setSearch(\"\");\n };\n\n const handleClear = () => {\n onChange?.(null);\n setSearch(\"\");\n setIsOpen(false);\n setAddedOption(null);\n };\n\n const handleInputChange = (e) => {\n const newValue = e.target.value;\n if (showSuggestions) {\n setSearch(newValue);\n setIsOpen(true);\n } else if (isAddNew) {\n setSearch(newValue);\n setIsOpen(newValue.length >= 3);\n } else {\n onChange?.(newValue);\n }\n };\n\n const handleInputFocus = () => {\n if (showSuggestions || isAddNew) {\n setIsOpen(true);\n }\n };\n\n const shouldShowDropdown =\n isOpen && !value && (showSuggestions ? search.length >= 3 : search.length >= 3);\n\n return (\n <div className=\"relative w-full\" ref={containerRef}>\n <div\n className={\n styling\n ? styling\n : \"flex items-center gap-2 border rounded-md px-3 py-2 bg-white shadow-sm\"\n }\n >\n <Search className=\"w-4 h-4 text-gray-400\" />\n <div className=\"flex-1\">\n {showSuggestions && value ? (\n <div\n className=\"text-gray-800 truncate\"\n title={value.label}\n style={{\n fontSize: 'var(--text-sm)',\n fontWeight: 'var(--font-medium)',\n letterSpacing: 'var(--tracking-normal)',\n lineHeight: 'var(--leading-normal)',\n textTransform: 'none',\n textDecoration: 'none',\n fontFamily: 'var(--font-sans)',\n }}\n >\n {value.label}\n </div>\n ) : (\n <TextInput\n value={showSuggestions || isAddNew ? search : value || \"\"}\n onChange={(val) =>\n handleInputChange({ target: { value: val } })\n }\n placeholder={placeholder}\n disabled={disabled}\n style={{\n border: \"none\",\n boxShadow: \"none\",\n padding: 0,\n backgroundColor: \"transparent\",\n }}\n onFocus={handleInputFocus}\n />\n )}\n </div>\n {(value || addedOption) && (\n <SmallButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleClear}\n style={{\n padding: 0,\n width: 20,\n height: 20,\n border: \"none\",\n backgroundColor: \"transparent\",\n color: \"rgba(107,114,128,1)\",\n }}\n >\n <X className=\"w-3 h-3\" />\n </SmallButton>\n )}\n </div>\n\n {shouldShowDropdown && (\n <div\n className=\"absolute w-full rounded-md border border-gray-300 bg-white shadow-lg custom-thin-scrollbar-library\"\n style={{\n maxHeight: 240,\n overflowY: \"auto\",\n zIndex: 30,\n }}\n >\n {filteredOptions.length > 0 && (\n <ul className=\"m-0 p-0 list-none\">\n {filteredOptions.map((opt) => (\n <li\n key={opt.value}\n onClick={() => handleSelect(opt)}\n onMouseEnter={(e) => {\n e.currentTarget.style.backgroundColor = \"var(--hover-warm)\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor = \"transparent\";\n }}\n className=\"cursor-pointer px-4 py-2\"\n title={opt.label}\n >\n <span\n className=\"truncate block w-full\"\n style={{\n fontFamily: \"var(--font-sans)\",\n color: \"var(--text-base)\",\n fontSize: \"var(--text-sm)\",\n fontWeight: \"var(--font-medium)\",\n letterSpacing: \"var(--tracking-normal)\",\n lineHeight: \"var(--leading-normal)\",\n textTransform: \"none\",\n textDecoration: \"none\",\n }}\n >\n {opt.label}\n </span>\n </li>\n ))}\n </ul>\n )}\n\n {isAddNew &&\n !exactMatchExists &&\n !addedOption &&\n search.length >= 3 && (\n <SmallButton\n type=\"button\"\n variant=\"secondary\"\n onClick={handleAddNew}\n style={{\n width: \"100%\",\n justifyContent: \"space-between\",\n padding: \"8px 10px\",\n border: \"none\",\n borderTop: \"1px solid rgba(229, 231, 235, 1)\",\n borderRadius: 0,\n backgroundColor: \"transparent\",\n color: \"rgba(107,114,128,1)\",\n }}\n >\n <span>{`Add \"${search}\"`}</span>\n <PlusCircle className=\"w-5 h-5 text-green-500\" />\n </SmallButton>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default AutoSearch;\n\n"],"names":["AutoSearch","options","value","onChange","placeholder","disabled","showSuggestions","styling","isAddNew","search","setSearch","useState","isOpen","setIsOpen","addedOption","setAddedOption","containerRef","useRef","filteredOptions","useMemo","lower","opt","label","val","exactMatchExists","useEffect","handleClickOutside","event","handleSelect","handleAddNew","newOpt","handleClear","handleInputChange","newValue","handleInputFocus","shouldShowDropdown","jsxs","jsx","Search","TextInput","SmallButton","X","e","PlusCircle"],"mappings":"iKAOMA,EAAa,CAAC,CAClB,QAAAC,EAAU,CAAC,EACX,MAAAC,EAAQ,KACR,SAAAC,EACA,YAAAC,EAAc,YACd,SAAAC,EAAW,GACX,gBAAAC,EAAkB,GAClB,QAAAC,EACA,SAAAC,EAAW,EACb,IAAM,CACJ,KAAM,CAACC,EAAQC,CAAS,EAAIC,WAAS,EAAE,EACjC,CAACC,EAAQC,CAAS,EAAIF,WAAS,EAAK,EACpC,CAACG,EAAaC,CAAc,EA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AA,UAAU,wBAAyB,CAAA,CAAA,CAAA,CACjD,CAAA,CAAA,CAEN,CAEJ,CAAA,CAAA,CAEJ"}
@@ -0,0 +1,190 @@
1
+ import { jsxs as m, jsx as a } from "react/jsx-runtime";
2
+ import { useState as x, useRef as M, useMemo as g, useEffect as j } from "react";
3
+ import { Search as D, X as H, PlusCircle as R } from "lucide-react";
4
+ import { T as W } from "./TextInput.es.js";
5
+ import { S as k } from "./SmallButton.es.js";
6
+ const Y = ({
7
+ options: u = [],
8
+ value: s = null,
9
+ onChange: r,
10
+ placeholder: L = "Search...",
11
+ disabled: S = !1,
12
+ showSuggestions: n = !0,
13
+ styling: w,
14
+ isAddNew: c = !1
15
+ }) => {
16
+ const [l, i] = x(""), [f, o] = x(!1), [d, b] = x(null), v = M(null), y = g(() => {
17
+ if (!n)
18
+ return [];
19
+ const e = l.toLowerCase();
20
+ return u.filter((t) => {
21
+ if (!t)
22
+ return !1;
23
+ const p = t.label || "", h = t.value || "";
24
+ return (p.toLowerCase().includes(e) || h.toLowerCase().includes(e)) && (!d || t.value !== d.value);
25
+ });
26
+ }, [l, u, n, d]), N = g(() => {
27
+ if (!c)
28
+ return !1;
29
+ const e = l.toLowerCase();
30
+ return u.some((t) => {
31
+ if (!t)
32
+ return !1;
33
+ const p = t.label || "", h = t.value || "";
34
+ return p.toLowerCase() === e || h.toLowerCase() === e;
35
+ });
36
+ }, [u, l, c]);
37
+ j(() => {
38
+ if (!f)
39
+ return;
40
+ const e = (t) => {
41
+ v.current && !v.current.contains(t.target) && o(!1);
42
+ };
43
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
44
+ }, [f]);
45
+ const O = (e) => {
46
+ r == null || r(e), i(""), o(!1), b(null);
47
+ }, T = () => {
48
+ const e = { label: l, value: l };
49
+ b(e), r == null || r(e), o(!1), i("");
50
+ }, E = () => {
51
+ r == null || r(null), i(""), o(!1), b(null);
52
+ }, I = (e) => {
53
+ const t = e.target.value;
54
+ n ? (i(t), o(!0)) : c ? (i(t), o(t.length >= 3)) : r == null || r(t);
55
+ }, z = () => {
56
+ (n || c) && o(!0);
57
+ }, F = f && !s && l.length >= 3;
58
+ return /* @__PURE__ */ m("div", { className: "relative w-full", ref: v, children: [
59
+ /* @__PURE__ */ m(
60
+ "div",
61
+ {
62
+ className: w || "flex items-center gap-2 border rounded-md px-3 py-2 bg-white shadow-sm",
63
+ children: [
64
+ /* @__PURE__ */ a(D, { className: "w-4 h-4 text-gray-400" }),
65
+ /* @__PURE__ */ a("div", { className: "flex-1", children: n && s ? /* @__PURE__ */ a(
66
+ "div",
67
+ {
68
+ className: "text-gray-800 truncate",
69
+ title: s.label,
70
+ style: {
71
+ fontSize: "var(--text-sm)",
72
+ fontWeight: "var(--font-medium)",
73
+ letterSpacing: "var(--tracking-normal)",
74
+ lineHeight: "var(--leading-normal)",
75
+ textTransform: "none",
76
+ textDecoration: "none",
77
+ fontFamily: "var(--font-sans)"
78
+ },
79
+ children: s.label
80
+ }
81
+ ) : /* @__PURE__ */ a(
82
+ W,
83
+ {
84
+ value: n || c ? l : s || "",
85
+ onChange: (e) => I({ target: { value: e } }),
86
+ placeholder: L,
87
+ disabled: S,
88
+ style: {
89
+ border: "none",
90
+ boxShadow: "none",
91
+ padding: 0,
92
+ backgroundColor: "transparent"
93
+ },
94
+ onFocus: z
95
+ }
96
+ ) }),
97
+ (s || d) && /* @__PURE__ */ a(
98
+ k,
99
+ {
100
+ type: "button",
101
+ variant: "ghost",
102
+ size: "sm",
103
+ onClick: E,
104
+ style: {
105
+ padding: 0,
106
+ width: 20,
107
+ height: 20,
108
+ border: "none",
109
+ backgroundColor: "transparent",
110
+ color: "rgba(107,114,128,1)"
111
+ },
112
+ children: /* @__PURE__ */ a(H, { className: "w-3 h-3" })
113
+ }
114
+ )
115
+ ]
116
+ }
117
+ ),
118
+ F && /* @__PURE__ */ m(
119
+ "div",
120
+ {
121
+ className: "absolute w-full rounded-md border border-gray-300 bg-white shadow-lg custom-thin-scrollbar-library",
122
+ style: {
123
+ maxHeight: 240,
124
+ overflowY: "auto",
125
+ zIndex: 30
126
+ },
127
+ children: [
128
+ y.length > 0 && /* @__PURE__ */ a("ul", { className: "m-0 p-0 list-none", children: y.map((e) => /* @__PURE__ */ a(
129
+ "li",
130
+ {
131
+ onClick: () => O(e),
132
+ onMouseEnter: (t) => {
133
+ t.currentTarget.style.backgroundColor = "var(--hover-warm)";
134
+ },
135
+ onMouseLeave: (t) => {
136
+ t.currentTarget.style.backgroundColor = "transparent";
137
+ },
138
+ className: "cursor-pointer px-4 py-2",
139
+ title: e.label,
140
+ children: /* @__PURE__ */ a(
141
+ "span",
142
+ {
143
+ className: "truncate block w-full",
144
+ style: {
145
+ fontFamily: "var(--font-sans)",
146
+ color: "var(--text-base)",
147
+ fontSize: "var(--text-sm)",
148
+ fontWeight: "var(--font-medium)",
149
+ letterSpacing: "var(--tracking-normal)",
150
+ lineHeight: "var(--leading-normal)",
151
+ textTransform: "none",
152
+ textDecoration: "none"
153
+ },
154
+ children: e.label
155
+ }
156
+ )
157
+ },
158
+ e.value
159
+ )) }),
160
+ c && !N && !d && l.length >= 3 && /* @__PURE__ */ m(
161
+ k,
162
+ {
163
+ type: "button",
164
+ variant: "secondary",
165
+ onClick: T,
166
+ style: {
167
+ width: "100%",
168
+ justifyContent: "space-between",
169
+ padding: "8px 10px",
170
+ border: "none",
171
+ borderTop: "1px solid rgba(229, 231, 235, 1)",
172
+ borderRadius: 0,
173
+ backgroundColor: "transparent",
174
+ color: "rgba(107,114,128,1)"
175
+ },
176
+ children: [
177
+ /* @__PURE__ */ a("span", { children: `Add "${l}"` }),
178
+ /* @__PURE__ */ a(R, { className: "w-5 h-5 text-green-500" })
179
+ ]
180
+ }
181
+ )
182
+ ]
183
+ }
184
+ )
185
+ ] });
186
+ };
187
+ export {
188
+ Y as A
189
+ };
190
+ //# sourceMappingURL=AutoSearch.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoSearch.es.js","sources":["../src/components/common/AutoSearch.jsx"],"sourcesContent":["\"use client\";\n\nimport React, { useState, useMemo, useRef, useEffect } from \"react\";\nimport { X, Search, PlusCircle } from \"lucide-react\";\nimport TextInput from \"../primitives/TextInput\";\nimport SmallButton from \"../primitives/SmallButton\";\n\nconst AutoSearch = ({\n options = [],\n value = null,\n onChange,\n placeholder = \"Search...\",\n disabled = false,\n showSuggestions = true,\n styling,\n isAddNew = false,\n}) => {\n const [search, setSearch] = useState(\"\");\n const [isOpen, setIsOpen] = useState(false);\n const [addedOption, setAddedOption] = useState(null);\n\n const containerRef = useRef(null);\n\n const filteredOptions = useMemo(() => {\n if (!showSuggestions) return [];\n const lower = search.toLowerCase();\n\n return options.filter((opt) => {\n if (!opt) return false;\n const label = opt.label || \"\";\n const val = opt.value || \"\";\n return (\n (label.toLowerCase().includes(lower) ||\n val.toLowerCase().includes(lower)) &&\n (!addedOption || opt.value !== addedOption.value)\n );\n });\n }, [search, options, showSuggestions, addedOption]);\n\n const exactMatchExists = useMemo(() => {\n if (!isAddNew) return false;\n const lower = search.toLowerCase();\n return options.some((opt) => {\n if (!opt) return false;\n const label = opt.label || \"\";\n const val = opt.value || \"\";\n return label.toLowerCase() === lower || val.toLowerCase() === lower;\n });\n }, [options, search, isAddNew]);\n\n // Close dropdown on outside click\n useEffect(() => {\n if (!isOpen) return;\n const handleClickOutside = (event) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target)\n ) {\n setIsOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\n }, [isOpen]);\n\n const handleSelect = (opt) => {\n onChange?.(opt);\n setSearch(\"\");\n setIsOpen(false);\n setAddedOption(null);\n };\n\n const handleAddNew = () => {\n const newOpt = { label: search, value: search };\n setAddedOption(newOpt);\n onChange?.(newOpt);\n setIsOpen(false);\n setSearch(\"\");\n };\n\n const handleClear = () => {\n onChange?.(null);\n setSearch(\"\");\n setIsOpen(false);\n setAddedOption(null);\n };\n\n const handleInputChange = (e) => {\n const newValue = e.target.value;\n if (showSuggestions) {\n setSearch(newValue);\n setIsOpen(true);\n } else if (isAddNew) {\n setSearch(newValue);\n setIsOpen(newValue.length >= 3);\n } else {\n onChange?.(newValue);\n }\n };\n\n const handleInputFocus = () => {\n if (showSuggestions || isAddNew) {\n setIsOpen(true);\n }\n };\n\n const shouldShowDropdown =\n isOpen && !value && (showSuggestions ? search.length >= 3 : search.length >= 3);\n\n return (\n <div className=\"relative w-full\" ref={containerRef}>\n <div\n className={\n styling\n ? styling\n : \"flex items-center gap-2 border rounded-md px-3 py-2 bg-white shadow-sm\"\n }\n >\n <Search className=\"w-4 h-4 text-gray-400\" />\n <div className=\"flex-1\">\n {showSuggestions && value ? (\n <div\n className=\"text-gray-800 truncate\"\n title={value.label}\n style={{\n fontSize: 'var(--text-sm)',\n fontWeight: 'var(--font-medium)',\n letterSpacing: 'var(--tracking-normal)',\n lineHeight: 'var(--leading-normal)',\n textTransform: 'none',\n textDecoration: 'none',\n fontFamily: 'var(--font-sans)',\n }}\n >\n {value.label}\n </div>\n ) : (\n <TextInput\n value={showSuggestions || isAddNew ? search : value || \"\"}\n onChange={(val) =>\n handleInputChange({ target: { value: val } })\n }\n placeholder={placeholder}\n disabled={disabled}\n style={{\n border: \"none\",\n boxShadow: \"none\",\n padding: 0,\n backgroundColor: \"transparent\",\n }}\n onFocus={handleInputFocus}\n />\n )}\n </div>\n {(value || addedOption) && (\n <SmallButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleClear}\n style={{\n padding: 0,\n width: 20,\n height: 20,\n border: \"none\",\n backgroundColor: \"transparent\",\n color: \"rgba(107,114,128,1)\",\n }}\n >\n <X className=\"w-3 h-3\" />\n </SmallButton>\n )}\n </div>\n\n {shouldShowDropdown && (\n <div\n className=\"absolute w-full rounded-md border border-gray-300 bg-white shadow-lg custom-thin-scrollbar-library\"\n style={{\n maxHeight: 240,\n overflowY: \"auto\",\n zIndex: 30,\n }}\n >\n {filteredOptions.length > 0 && (\n <ul className=\"m-0 p-0 list-none\">\n {filteredOptions.map((opt) => (\n <li\n key={opt.value}\n onClick={() => handleSelect(opt)}\n onMouseEnter={(e) => {\n e.currentTarget.style.backgroundColor = \"var(--hover-warm)\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor = \"transparent\";\n }}\n className=\"cursor-pointer px-4 py-2\"\n title={opt.label}\n >\n <span\n className=\"truncate block w-full\"\n style={{\n fontFamily: \"var(--font-sans)\",\n color: \"var(--text-base)\",\n fontSize: \"var(--text-sm)\",\n fontWeight: \"var(--font-medium)\",\n letterSpacing: \"var(--tracking-normal)\",\n lineHeight: \"var(--leading-normal)\",\n textTransform: \"none\",\n textDecoration: \"none\",\n }}\n >\n {opt.label}\n </span>\n </li>\n ))}\n </ul>\n )}\n\n {isAddNew &&\n !exactMatchExists &&\n !addedOption &&\n search.length >= 3 && (\n <SmallButton\n type=\"button\"\n variant=\"secondary\"\n onClick={handleAddNew}\n style={{\n width: \"100%\",\n justifyContent: \"space-between\",\n padding: \"8px 10px\",\n border: \"none\",\n borderTop: \"1px solid rgba(229, 231, 235, 1)\",\n borderRadius: 0,\n backgroundColor: \"transparent\",\n color: \"rgba(107,114,128,1)\",\n }}\n >\n <span>{`Add \"${search}\"`}</span>\n <PlusCircle className=\"w-5 h-5 text-green-500\" />\n </SmallButton>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default AutoSearch;\n\n"],"names":["AutoSearch","options","value","onChange","placeholder","disabled","showSuggestions","styling","isAddNew","search","setSearch","useState","isOpen","setIsOpen","addedOption","setAddedOption","containerRef","useRef","filteredOptions","useMemo","lower","opt","label","val","exactMatchExists","useEffect","handleClickOutside","event","handleSelect","handleAddNew","newOpt","handleClear","handleInputChange","newValue","handleInputFocus","shouldShowDropdown","jsxs","jsx","Search","TextInput","SmallButton","X","e","PlusCircle"],"mappings":";;;;;AAOA,MAAMA,IAAa,CAAC;AAAA,EAClB,SAAAC,IA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,QAAA;AAAA,MAAA;AAAA,IAEN;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const i=require("react/jsx-runtime");require("react");const d={width:"100%",padding:"var(--spacing-2)",fontSize:"var(--text-md)",border:"1px solid var(--border)",borderRadius:"var(--radius)",backgroundColor:"var(--paper)",color:"var(--text-base)",fontFamily:"var(--font-sans)",outline:"none",transition:"border-color 0.15s ease"};function c({value:o,onChange:e,placeholder:a,disabled:t=!1,mono:s=!1,autoFocus:n=!1,style:l,...u}){return i.jsx("input",{type:"text",value:o,onChange:r=>e==null?void 0:e(r.target.value),placeholder:a,disabled:t,autoFocus:n,style:{...d,...s?{fontFamily:"var(--font-mono)"}:{},...t?{opacity:.6,cursor:"not-allowed"}:{},...l},onFocus:r=>{r.currentTarget.style.borderColor="var(--border-hover)"},onBlur:r=>{r.currentTarget.style.borderColor="var(--border)"},...u})}exports.TextInput=c;
2
+ //# sourceMappingURL=TextInput.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextInput.cjs.js","sources":["../src/components/primitives/TextInput.jsx"],"sourcesContent":["\"use client\";\nimport React from 'react';\n\nconst baseStyle = {\n width: '100%',\n padding: 'var(--spacing-2)',\n fontSize: 'var(--text-md)',\n border: '1px solid var(--border)',\n borderRadius: 'var(--radius)',\n backgroundColor: 'var(--paper)',\n color: 'var(--text-base)',\n fontFamily: 'var(--font-sans)',\n outline: 'none',\n transition: 'border-color 0.15s ease',\n};\n\nexport default function TextInput({\n value,\n onChange,\n placeholder,\n disabled = false,\n mono = false,\n autoFocus = false,\n style,\n ...rest\n}) {\n return (\n <input\n type=\"text\"\n value={value}\n onChange={(e) => onChange?.(e.target.value)}\n placeholder={placeholder}\n disabled={disabled}\n autoFocus={autoFocus}\n style={{\n ...baseStyle,\n ...(mono ? { fontFamily: 'var(--font-mono)' } : {}),\n ...(disabled ? { opacity: 0.6, cursor: 'not-allowed' } : {}),\n ...style,\n }}\n onFocus={(e) => { e.currentTarget.style.borderColor = 'var(--border-hover)'; }}\n onBlur={(e) => { e.currentTarget.style.borderColor = 'var(--border)'; }}\n {...rest}\n />\n );\n}\n"],"names":["baseStyle","TextInput","value","onChange","placeholder","disabled","mono","autoFocus","style","rest","jsx","e"],"mappings":"mEAGA,MAAMA,EAAY,CAChB,MAAO,OACP,QAAS,mBACT,SAAU,iBACV,OAAQ,0BACR,aAAc,gBACd,gBAAiB,eACjB,MAAO,mBACP,WAAY,mBACZ,QAAS,OACT,WAAY,yBACd,EAEA,SAAwBC,EAAU,CAChC,MAAAC,EACA,SAAAC,EACA,YAAAC,EACA,SAAAC,EAAW,GACX,KAAAC,EAAO,GACP,UAAAC,EAAY,GACZ,MAAAC,EACA,GAAGC,CACL,EAAG,CAEC,OAAAC,EAAA,IAAC,QAAA,CACC,KAAK,OACL,MAAAR,EACA,SAAWS,GAAMR,GAAA,YAAAA,EAAWQ,EAAE,OAAO,OACrC,YAAAP,EACA,SAAAC,EACA,UAAAE,EACA,MAAO,CACL,GAAGP,EACH,GAAIM,EAAO,CAAE,WAAY,oBAAuB,CAAC,EACjD,GAAID,EAAW,CAAE,QAAS,GAAK,OAAQ,aAAA,EAAkB,CAAC,EAC1D,GAAGG,CACL,EACA,QAAUG,GAAM,CAAIA,EAAA,cAAc,MAAM,YAAc,qBAAuB,EAC7E,OAASA,GAAM,CAAIA,EAAA,cAAc,MAAM,YAAc,eAAiB,EACrE,GAAGF,CAAA,CAAA,CAGV"}
@@ -0,0 +1,53 @@
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import "react";
3
+ const u = {
4
+ width: "100%",
5
+ padding: "var(--spacing-2)",
6
+ fontSize: "var(--text-md)",
7
+ border: "1px solid var(--border)",
8
+ borderRadius: "var(--radius)",
9
+ backgroundColor: "var(--paper)",
10
+ color: "var(--text-base)",
11
+ fontFamily: "var(--font-sans)",
12
+ outline: "none",
13
+ transition: "border-color 0.15s ease"
14
+ };
15
+ function c({
16
+ value: e,
17
+ onChange: o,
18
+ placeholder: a,
19
+ disabled: t = !1,
20
+ mono: s = !1,
21
+ autoFocus: n = !1,
22
+ style: l,
23
+ ...i
24
+ }) {
25
+ return /* @__PURE__ */ d(
26
+ "input",
27
+ {
28
+ type: "text",
29
+ value: e,
30
+ onChange: (r) => o == null ? void 0 : o(r.target.value),
31
+ placeholder: a,
32
+ disabled: t,
33
+ autoFocus: n,
34
+ style: {
35
+ ...u,
36
+ ...s ? { fontFamily: "var(--font-mono)" } : {},
37
+ ...t ? { opacity: 0.6, cursor: "not-allowed" } : {},
38
+ ...l
39
+ },
40
+ onFocus: (r) => {
41
+ r.currentTarget.style.borderColor = "var(--border-hover)";
42
+ },
43
+ onBlur: (r) => {
44
+ r.currentTarget.style.borderColor = "var(--border)";
45
+ },
46
+ ...i
47
+ }
48
+ );
49
+ }
50
+ export {
51
+ c as T
52
+ };
53
+ //# sourceMappingURL=TextInput.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextInput.es.js","sources":["../src/components/primitives/TextInput.jsx"],"sourcesContent":["\"use client\";\nimport React from 'react';\n\nconst baseStyle = {\n width: '100%',\n padding: 'var(--spacing-2)',\n fontSize: 'var(--text-md)',\n border: '1px solid var(--border)',\n borderRadius: 'var(--radius)',\n backgroundColor: 'var(--paper)',\n color: 'var(--text-base)',\n fontFamily: 'var(--font-sans)',\n outline: 'none',\n transition: 'border-color 0.15s ease',\n};\n\nexport default function TextInput({\n value,\n onChange,\n placeholder,\n disabled = false,\n mono = false,\n autoFocus = false,\n style,\n ...rest\n}) {\n return (\n <input\n type=\"text\"\n value={value}\n onChange={(e) => onChange?.(e.target.value)}\n placeholder={placeholder}\n disabled={disabled}\n autoFocus={autoFocus}\n style={{\n ...baseStyle,\n ...(mono ? { fontFamily: 'var(--font-mono)' } : {}),\n ...(disabled ? { opacity: 0.6, cursor: 'not-allowed' } : {}),\n ...style,\n }}\n onFocus={(e) => { e.currentTarget.style.borderColor = 'var(--border-hover)'; }}\n onBlur={(e) => { e.currentTarget.style.borderColor = 'var(--border)'; }}\n {...rest}\n />\n );\n}\n"],"names":["baseStyle","TextInput","value","onChange","placeholder","disabled","mono","autoFocus","style","rest","jsx","e"],"mappings":";;AAGA,MAAMA,IAAY;AAAA,EAChB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,YAAY;AACd;AAEA,SAAwBC,EAAU;AAAA,EAChC,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,GAAGC;AACL,GAAG;AAEC,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAAR;AAAA,MACA,UAAU,CAACS,MAAMR,KAAA,gBAAAA,EAAWQ,EAAE,OAAO;AAAA,MACrC,aAAAP;AAAA,MACA,UAAAC;AAAA,MACA,WAAAE;AAAA,MACA,OAAO;AAAA,QACL,GAAGP;AAAA,QACH,GAAIM,IAAO,EAAE,YAAY,uBAAuB,CAAC;AAAA,QACjD,GAAID,IAAW,EAAE,SAAS,KAAK,QAAQ,cAAA,IAAkB,CAAC;AAAA,QAC1D,GAAGG;AAAA,MACL;AAAA,MACA,SAAS,CAACG,MAAM;AAAI,QAAAA,EAAA,cAAc,MAAM,cAAc;AAAA,MAAuB;AAAA,MAC7E,QAAQ,CAACA,MAAM;AAAI,QAAAA,EAAA,cAAc,MAAM,cAAc;AAAA,MAAiB;AAAA,MACrE,GAAGF;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../AgentLiftCard.cjs.js"),r=require("../SummarySection.cjs.js"),i=require("../CustomFilterChips.cjs.js");require("react/jsx-runtime");require("react");require("lucide-react");require("../SmallButton.cjs.js");require("react-dom");exports.AgentLiftCard=e.AgentLiftCard;exports.EvidenceItem=e.EvidenceItem;exports.ConditionCard=r.ConditionCard;exports.ModelScoreCard=r.ModelScoreCard;exports.ObservationCard=r.ObservationCard;exports.ScoreDriverCard=r.ScoreDriverCard;exports.ScoreDriverCardVariant=r.ScoreDriverCardVariant;exports.SignalCard=r.SignalCard;exports.SmallObservationCard=r.SmallObservationCard;exports.SummarySection=r.SummarySection;exports.CustomFilterChips=i.CustomFilterChips;exports.Pagination=i.Pagination;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../AgentLiftCard.cjs.js"),r=require("../SummarySection.cjs.js"),i=require("../CustomFilterChips.cjs.js"),a=require("../AutoSearch.cjs.js");require("react/jsx-runtime");require("react");require("lucide-react");require("../SmallButton.cjs.js");require("react-dom");require("../TextInput.cjs.js");exports.AgentLiftCard=e.AgentLiftCard;exports.EvidenceItem=e.EvidenceItem;exports.ConditionCard=r.ConditionCard;exports.ModelScoreCard=r.ModelScoreCard;exports.ObservationCard=r.ObservationCard;exports.ScoreDriverCard=r.ScoreDriverCard;exports.ScoreDriverCardVariant=r.ScoreDriverCardVariant;exports.SignalCard=r.SignalCard;exports.SmallObservationCard=r.SmallObservationCard;exports.SummarySection=r.SummarySection;exports.CustomFilterChips=i.CustomFilterChips;exports.Pagination=i.Pagination;exports.AutoSearch=a.AutoSearch;
2
2
  //# sourceMappingURL=common.cjs.js.map
@@ -1,23 +1,26 @@
1
- import { A as m, E as C } from "../AgentLiftCard.es.js";
2
- import { C as n, M as p, O as S, b as c, c as l, S as v, a as f, d as b } from "../SummarySection.es.js";
3
- import { C as x, P as O } from "../CustomFilterChips.es.js";
1
+ import { A as C, E as d } from "../AgentLiftCard.es.js";
2
+ import { C as p, M as S, O as c, b as f, c as l, S as v, a as x, d as A } from "../SummarySection.es.js";
3
+ import { C as g, P as u } from "../CustomFilterChips.es.js";
4
+ import { A as h } from "../AutoSearch.es.js";
4
5
  import "react/jsx-runtime";
5
6
  import "react";
6
7
  import "lucide-react";
7
8
  import "../SmallButton.es.js";
8
9
  import "react-dom";
10
+ import "../TextInput.es.js";
9
11
  export {
10
- m as AgentLiftCard,
11
- n as ConditionCard,
12
- x as CustomFilterChips,
13
- C as EvidenceItem,
14
- p as ModelScoreCard,
15
- S as ObservationCard,
16
- O as Pagination,
17
- c as ScoreDriverCard,
12
+ C as AgentLiftCard,
13
+ h as AutoSearch,
14
+ p as ConditionCard,
15
+ g as CustomFilterChips,
16
+ d as EvidenceItem,
17
+ S as ModelScoreCard,
18
+ c as ObservationCard,
19
+ u as Pagination,
20
+ f as ScoreDriverCard,
18
21
  l as ScoreDriverCardVariant,
19
22
  v as SignalCard,
20
- f as SmallObservationCard,
21
- b as SummarySection
23
+ x as SmallObservationCard,
24
+ A as SummarySection
22
25
  };
23
26
  //# sourceMappingURL=common.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"common.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");const u=require("lucide-react"),x=require("react-dom");function m({open:i,onClose:n,title:r="",children:s,maxWidth:d=700,showCloseButton:l=!0,footer:t=null,className:a="",bodyClassName:o=""}){if(!i||typeof document>"u")return null;const c=e.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black/30 p-4",style:{zIndex:1004},children:e.jsxs("div",{className:`bg-white rounded-xl shadow-xl relative w-full ${a}`,style:{maxWidth:d,maxHeight:"90vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("div",{style:{position:"relative",flexShrink:0,background:"#fff",borderBottom:"1px solid rgba(0,0,0,0.08)",padding:r||l?"1rem 1.5rem 1rem":0,borderRadius:"12px 12px 0 0"},children:[l&&e.jsx("button",{type:"button",className:"absolute top-3 right-3 text-gray-400 hover:text-black",onClick:n,children:e.jsx(u.X,{size:20})}),r&&e.jsx("div",{className:"pr-8",children:e.jsx("h2",{className:"font-bold text-lg",children:r})})]}),e.jsx("div",{className:`custom-thin-scrollbar-library ${o}`,style:{flex:1,minHeight:0,overflowY:"auto",padding:"1rem 1.5rem"},children:s}),t&&e.jsx("div",{style:{flexShrink:0,padding:"1rem 1.5rem",borderTop:"1px solid rgba(0,0,0,0.08)"},children:t})]})});return x.createPortal(c,document.body)}exports.OverlayPanel=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");const u=require("lucide-react"),x=require("react-dom");function m({open:i,onClose:n,title:r="",children:s,maxWidth:a=700,showCloseButton:l=!0,footer:t=null,className:d="",bodyClassName:o=""}){if(!i||typeof document>"u")return null;const c=e.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black/30 p-4",style:{zIndex:1004},children:e.jsxs("div",{className:`bg-white rounded-xl shadow-xl relative w-full ${d}`,style:{maxWidth:a,maxHeight:"90vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("div",{style:{position:"relative",flexShrink:0,background:"#fff",borderBottom:"1px solid rgba(0,0,0,0.08)",padding:r||l?"1rem 1.5rem 1rem":0,borderRadius:"12px 12px 0 0"},children:[l&&e.jsx("button",{type:"button",className:"absolute top-3 right-3 text-gray-400 hover:text-black",onClick:n,children:e.jsx(u.X,{size:20})}),r&&e.jsx("div",{className:"pr-8",children:e.jsx("h2",{className:"font-bold text-lg",style:{fontFamily:"var(--font-sans)"},children:r})})]}),e.jsx("div",{className:`custom-thin-scrollbar-library ${o}`,style:{flex:1,minHeight:0,overflowY:"auto",padding:"1rem 1.5rem"},children:s}),t&&e.jsx("div",{style:{flexShrink:0,padding:"1rem 1.5rem",borderTop:"1px solid rgba(0,0,0,0.08)"},children:t})]})});return x.createPortal(c,document.body)}exports.OverlayPanel=m;
2
2
  //# sourceMappingURL=models.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.cjs.js","sources":["../../src/components/models/OverlayPanel.jsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { X } from \"lucide-react\";\nimport { createPortal } from \"react-dom\";\n\n/**\n * OverlayPanel\n *\n * Generic overlay + panel shell that handles:\n * - Portal to document.body\n * - Backdrop\n * - Centered scrollable panel with max height\n *\n * Responsibility:\n * - Layout, scroll, close behaviors\n * - Does NOT own feature logic or data fetching\n */\nexport default function OverlayPanel({\n open,\n onClose,\n title = \"\",\n children,\n maxWidth = 700,\n showCloseButton = true,\n footer = null,\n className = \"\",\n bodyClassName = \"\",\n}) {\n if (!open) return null;\n if (typeof document === \"undefined\") return null;\n\n const content = (\n <div\n className=\"fixed inset-0 flex items-center justify-center bg-black/30 p-4\"\n style={{ zIndex: 1004 }}\n >\n <div\n className={`bg-white rounded-xl shadow-xl relative w-full ${className}`}\n style={{\n maxWidth,\n maxHeight: \"90vh\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n }}\n >\n {/* Header: fixed at top, no scroll */}\n <div\n style={{\n position: \"relative\",\n flexShrink: 0,\n background: \"#fff\",\n borderBottom: \"1px solid rgba(0,0,0,0.08)\",\n padding: title || showCloseButton ? \"1rem 1.5rem 1rem\" : 0,\n borderRadius: \"12px 12px 0 0\",\n }}\n >\n {showCloseButton && (\n <button\n type=\"button\"\n className=\"absolute top-3 right-3 text-gray-400 hover:text-black\"\n onClick={onClose}\n >\n <X size={20} />\n </button>\n )}\n {title && (\n <div className=\"pr-8\">\n <h2 className=\"font-bold text-lg\">{title}</h2>\n </div>\n )}\n </div>\n\n {/* Body: only this section scrolls */}\n <div\n className={`custom-thin-scrollbar-library ${bodyClassName}`}\n style={{\n flex: 1,\n minHeight: 0,\n overflowY: \"auto\",\n padding: \"1rem 1.5rem\",\n }}\n >\n {children}\n </div>\n\n {footer && (\n <div\n style={{\n flexShrink: 0,\n padding: \"1rem 1.5rem\",\n borderTop: \"1px solid rgba(0,0,0,0.08)\",\n }}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n\n return createPortal(content, document.body);\n}\n\n"],"names":["OverlayPanel","open","onClose","title","children","maxWidth","showCloseButton","footer","className","bodyClassName","content","jsx","jsxs","X","createPortal"],"mappings":"6LAkBA,SAAwBA,EAAa,CACnC,KAAAC,EACA,QAAAC,EACA,MAAAC,EAAQ,GACR,SAAAC,EACA,SAAAC,EAAW,IACX,gBAAAC,EAAkB,GAClB,OAAAC,EAAS,KACT,UAAAC,EAAY,GACZ,cAAAC,EAAgB,EAClB,EAAG,CAED,GADI,CAACR,GACD,OAAO,SAAa,IAAoB,OAAA,KAE5C,MAAMS,EACJC,EAAA,IAAC,MAAA,CACC,UAAU,iEACV,MAAO,CAAE,OAAQ,IAAK,EAEtB,SAAAC,EAAA,KAAC,MAAA,CACC,UAAW,iDAAiDJ,CAAS,GACrE,MAAO,CACL,SAAAH,EACA,UAAW,OACX,QAAS,OACT,cAAe,SACf,SAAU,QACZ,EAGA,SAAA,CAAAO,EAAA,KAAC,MAAA,CACC,MAAO,CACL,SAAU,WACV,WAAY,EACZ,WAAY,OACZ,aAAc,6BACd,QAAST,GAASG,EAAkB,mBAAqB,EACzD,aAAc,eAChB,EAEC,SAAA,CACCA,GAAAK,EAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAU,wDACV,QAAST,EAET,SAAAS,EAAAA,IAACE,EAAAA,EAAE,CAAA,KAAM,EAAI,CAAA,CAAA,CACf,EAEDV,GACEQ,EAAA,IAAA,MAAA,CAAI,UAAU,OACb,eAAC,KAAG,CAAA,UAAU,oBAAqB,SAAAR,CAAA,CAAM,CAC3C,CAAA,CAAA,CAAA,CAEJ,EAGAQ,EAAA,IAAC,MAAA,CACC,UAAW,iCAAiCF,CAAa,GACzD,MAAO,CACL,KAAM,EACN,UAAW,EACX,UAAW,OACX,QAAS,aACX,EAEC,SAAAL,CAAA,CACH,EAECG,GACCI,EAAA,IAAC,MAAA,CACC,MAAO,CACL,WAAY,EACZ,QAAS,cACT,UAAW,4BACb,EAEC,SAAAJ,CAAA,CACH,CAAA,CAAA,CAEJ,CAAA,CAAA,EAIG,OAAAO,eAAaJ,EAAS,SAAS,IAAI,CAC5C"}
1
+ {"version":3,"file":"models.cjs.js","sources":["../../src/components/models/OverlayPanel.jsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { X } from \"lucide-react\";\nimport { createPortal } from \"react-dom\";\n\n/**\n * OverlayPanel\n *\n * Generic overlay + panel shell that handles:\n * - Portal to document.body\n * - Backdrop\n * - Centered scrollable panel with max height\n *\n * Responsibility:\n * - Layout, scroll, close behaviors\n * - Does NOT own feature logic or data fetching\n */\nexport default function OverlayPanel({\n open,\n onClose,\n title = \"\",\n children,\n maxWidth = 700,\n showCloseButton = true,\n footer = null,\n className = \"\",\n bodyClassName = \"\",\n}) {\n if (!open) return null;\n if (typeof document === \"undefined\") return null;\n\n const content = (\n <div\n className=\"fixed inset-0 flex items-center justify-center bg-black/30 p-4\"\n style={{ zIndex: 1004 }}\n >\n <div\n className={`bg-white rounded-xl shadow-xl relative w-full ${className}`}\n style={{\n maxWidth,\n maxHeight: \"90vh\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n }}\n >\n {/* Header: fixed at top, no scroll */}\n <div\n style={{\n position: \"relative\",\n flexShrink: 0,\n background: \"#fff\",\n borderBottom: \"1px solid rgba(0,0,0,0.08)\",\n padding: title || showCloseButton ? \"1rem 1.5rem 1rem\" : 0,\n borderRadius: \"12px 12px 0 0\",\n }}\n >\n {showCloseButton && (\n <button\n type=\"button\"\n className=\"absolute top-3 right-3 text-gray-400 hover:text-black\"\n onClick={onClose}\n >\n <X size={20} />\n </button>\n )}\n {title && (\n <div className=\"pr-8\">\n <h2 className=\"font-bold text-lg\" style={{ fontFamily: 'var(--font-sans)' }}>{title}</h2>\n </div>\n )}\n </div>\n\n {/* Body: only this section scrolls */}\n <div\n className={`custom-thin-scrollbar-library ${bodyClassName}`}\n style={{\n flex: 1,\n minHeight: 0,\n overflowY: \"auto\",\n padding: \"1rem 1.5rem\",\n }}\n >\n {children}\n </div>\n\n {footer && (\n <div\n style={{\n flexShrink: 0,\n padding: \"1rem 1.5rem\",\n borderTop: \"1px solid rgba(0,0,0,0.08)\",\n }}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n\n return createPortal(content, document.body);\n}\n\n"],"names":["OverlayPanel","open","onClose","title","children","maxWidth","showCloseButton","footer","className","bodyClassName","content","jsx","jsxs","X","createPortal"],"mappings":"6LAkBA,SAAwBA,EAAa,CACnC,KAAAC,EACA,QAAAC,EACA,MAAAC,EAAQ,GACR,SAAAC,EACA,SAAAC,EAAW,IACX,gBAAAC,EAAkB,GAClB,OAAAC,EAAS,KACT,UAAAC,EAAY,GACZ,cAAAC,EAAgB,EAClB,EAAG,CAED,GADI,CAACR,GACD,OAAO,SAAa,IAAoB,OAAA,KAE5C,MAAMS,EACJC,EAAA,IAAC,MAAA,CACC,UAAU,iEACV,MAAO,CAAE,OAAQ,IAAK,EAEtB,SAAAC,EAAA,KAAC,MAAA,CACC,UAAW,iDAAiDJ,CAAS,GACrE,MAAO,CACL,SAAAH,EACA,UAAW,OACX,QAAS,OACT,cAAe,SACf,SAAU,QACZ,EAGA,SAAA,CAAAO,EAAA,KAAC,MAAA,CACC,MAAO,CACL,SAAU,WACV,WAAY,EACZ,WAAY,OACZ,aAAc,6BACd,QAAST,GAASG,EAAkB,mBAAqB,EACzD,aAAc,eAChB,EAEC,SAAA,CACCA,GAAAK,EAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAU,wDACV,QAAST,EAET,SAAAS,EAAAA,IAACE,EAAAA,EAAE,CAAA,KAAM,EAAI,CAAA,CAAA,CACf,EAEDV,GACCQ,EAAAA,IAAC,MAAI,CAAA,UAAU,OACb,SAACA,EAAA,IAAA,KAAA,CAAG,UAAU,oBAAoB,MAAO,CAAE,WAAY,kBAAmB,EAAI,UAAM,CAAA,EACtF,CAAA,CAAA,CAEJ,EAGAA,EAAA,IAAC,MAAA,CACC,UAAW,iCAAiCF,CAAa,GACzD,MAAO,CACL,KAAM,EACN,UAAW,EACX,UAAW,OACX,QAAS,aACX,EAEC,SAAAL,CAAA,CACH,EAECG,GACCI,EAAA,IAAC,MAAA,CACC,MAAO,CACL,WAAY,EACZ,QAAS,cACT,UAAW,4BACb,EAEC,SAAAJ,CAAA,CACH,CAAA,CAAA,CAEJ,CAAA,CAAA,EAIG,OAAAO,eAAaJ,EAAS,SAAS,IAAI,CAC5C"}
@@ -1,15 +1,15 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { X as f } from "lucide-react";
4
4
  import { createPortal as u } from "react-dom";
5
- function g({
5
+ function y({
6
6
  open: n,
7
7
  onClose: o,
8
8
  title: r = "",
9
9
  children: d,
10
10
  maxWidth: a = 700,
11
11
  showCloseButton: l = !0,
12
- footer: i = null,
12
+ footer: t = null,
13
13
  className: s = "",
14
14
  bodyClassName: c = ""
15
15
  }) {
@@ -20,7 +20,7 @@ function g({
20
20
  {
21
21
  className: "fixed inset-0 flex items-center justify-center bg-black/30 p-4",
22
22
  style: { zIndex: 1004 },
23
- children: /* @__PURE__ */ t(
23
+ children: /* @__PURE__ */ i(
24
24
  "div",
25
25
  {
26
26
  className: `bg-white rounded-xl shadow-xl relative w-full ${s}`,
@@ -32,7 +32,7 @@ function g({
32
32
  overflow: "hidden"
33
33
  },
34
34
  children: [
35
- /* @__PURE__ */ t(
35
+ /* @__PURE__ */ i(
36
36
  "div",
37
37
  {
38
38
  style: {
@@ -53,7 +53,7 @@ function g({
53
53
  children: /* @__PURE__ */ e(f, { size: 20 })
54
54
  }
55
55
  ),
56
- r && /* @__PURE__ */ e("div", { className: "pr-8", children: /* @__PURE__ */ e("h2", { className: "font-bold text-lg", children: r }) })
56
+ r && /* @__PURE__ */ e("div", { className: "pr-8", children: /* @__PURE__ */ e("h2", { className: "font-bold text-lg", style: { fontFamily: "var(--font-sans)" }, children: r }) })
57
57
  ]
58
58
  }
59
59
  ),
@@ -70,7 +70,7 @@ function g({
70
70
  children: d
71
71
  }
72
72
  ),
73
- i && /* @__PURE__ */ e(
73
+ t && /* @__PURE__ */ e(
74
74
  "div",
75
75
  {
76
76
  style: {
@@ -78,7 +78,7 @@ function g({
78
78
  padding: "1rem 1.5rem",
79
79
  borderTop: "1px solid rgba(0,0,0,0.08)"
80
80
  },
81
- children: i
81
+ children: t
82
82
  }
83
83
  )
84
84
  ]
@@ -89,6 +89,6 @@ function g({
89
89
  return u(m, document.body);
90
90
  }
91
91
  export {
92
- g as OverlayPanel
92
+ y as OverlayPanel
93
93
  };
94
94
  //# sourceMappingURL=models.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.es.js","sources":["../../src/components/models/OverlayPanel.jsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { X } from \"lucide-react\";\nimport { createPortal } from \"react-dom\";\n\n/**\n * OverlayPanel\n *\n * Generic overlay + panel shell that handles:\n * - Portal to document.body\n * - Backdrop\n * - Centered scrollable panel with max height\n *\n * Responsibility:\n * - Layout, scroll, close behaviors\n * - Does NOT own feature logic or data fetching\n */\nexport default function OverlayPanel({\n open,\n onClose,\n title = \"\",\n children,\n maxWidth = 700,\n showCloseButton = true,\n footer = null,\n className = \"\",\n bodyClassName = \"\",\n}) {\n if (!open) return null;\n if (typeof document === \"undefined\") return null;\n\n const content = (\n <div\n className=\"fixed inset-0 flex items-center justify-center bg-black/30 p-4\"\n style={{ zIndex: 1004 }}\n >\n <div\n className={`bg-white rounded-xl shadow-xl relative w-full ${className}`}\n style={{\n maxWidth,\n maxHeight: \"90vh\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n }}\n >\n {/* Header: fixed at top, no scroll */}\n <div\n style={{\n position: \"relative\",\n flexShrink: 0,\n background: \"#fff\",\n borderBottom: \"1px solid rgba(0,0,0,0.08)\",\n padding: title || showCloseButton ? \"1rem 1.5rem 1rem\" : 0,\n borderRadius: \"12px 12px 0 0\",\n }}\n >\n {showCloseButton && (\n <button\n type=\"button\"\n className=\"absolute top-3 right-3 text-gray-400 hover:text-black\"\n onClick={onClose}\n >\n <X size={20} />\n </button>\n )}\n {title && (\n <div className=\"pr-8\">\n <h2 className=\"font-bold text-lg\">{title}</h2>\n </div>\n )}\n </div>\n\n {/* Body: only this section scrolls */}\n <div\n className={`custom-thin-scrollbar-library ${bodyClassName}`}\n style={{\n flex: 1,\n minHeight: 0,\n overflowY: \"auto\",\n padding: \"1rem 1.5rem\",\n }}\n >\n {children}\n </div>\n\n {footer && (\n <div\n style={{\n flexShrink: 0,\n padding: \"1rem 1.5rem\",\n borderTop: \"1px solid rgba(0,0,0,0.08)\",\n }}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n\n return createPortal(content, document.body);\n}\n\n"],"names":["OverlayPanel","open","onClose","title","children","maxWidth","showCloseButton","footer","className","bodyClassName","content","jsx","jsxs","X","createPortal"],"mappings":";;;;AAkBA,SAAwBA,EAAa;AAAA,EACnC,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,iBAAAC,IAAkB;AAAA,EAClB,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,eAAAC,IAAgB;AAClB,GAAG;AAED,MADI,CAACR,KACD,OAAO,WAAa;AAAoB,WAAA;AAE5C,QAAMS,IACJ,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,QAAQ,KAAK;AAAA,MAEtB,UAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,iDAAiDJ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AI;AAC5C;"}
1
+ {"version":3,"file":"models.es.js","sources":["../../src/components/models/OverlayPanel.jsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { X } from \"lucide-react\";\nimport { createPortal } from \"react-dom\";\n\n/**\n * OverlayPanel\n *\n * Generic overlay + panel shell that handles:\n * - Portal to document.body\n * - Backdrop\n * - Centered scrollable panel with max height\n *\n * Responsibility:\n * - Layout, scroll, close behaviors\n * - Does NOT own feature logic or data fetching\n */\nexport default function OverlayPanel({\n open,\n onClose,\n title = \"\",\n children,\n maxWidth = 700,\n showCloseButton = true,\n footer = null,\n className = \"\",\n bodyClassName = \"\",\n}) {\n if (!open) return null;\n if (typeof document === \"undefined\") return null;\n\n const content = (\n <div\n className=\"fixed inset-0 flex items-center justify-center bg-black/30 p-4\"\n style={{ zIndex: 1004 }}\n >\n <div\n className={`bg-white rounded-xl shadow-xl relative w-full ${className}`}\n style={{\n maxWidth,\n maxHeight: \"90vh\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n }}\n >\n {/* Header: fixed at top, no scroll */}\n <div\n style={{\n position: \"relative\",\n flexShrink: 0,\n background: \"#fff\",\n borderBottom: \"1px solid rgba(0,0,0,0.08)\",\n padding: title || showCloseButton ? \"1rem 1.5rem 1rem\" : 0,\n borderRadius: \"12px 12px 0 0\",\n }}\n >\n {showCloseButton && (\n <button\n type=\"button\"\n className=\"absolute top-3 right-3 text-gray-400 hover:text-black\"\n onClick={onClose}\n >\n <X size={20} />\n </button>\n )}\n {title && (\n <div className=\"pr-8\">\n <h2 className=\"font-bold text-lg\" style={{ fontFamily: 'var(--font-sans)' }}>{title}</h2>\n </div>\n )}\n </div>\n\n {/* Body: only this section scrolls */}\n <div\n className={`custom-thin-scrollbar-library ${bodyClassName}`}\n style={{\n flex: 1,\n minHeight: 0,\n overflowY: \"auto\",\n padding: \"1rem 1.5rem\",\n }}\n >\n {children}\n </div>\n\n {footer && (\n <div\n style={{\n flexShrink: 0,\n padding: \"1rem 1.5rem\",\n borderTop: \"1px solid rgba(0,0,0,0.08)\",\n }}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n\n return createPortal(content, document.body);\n}\n\n"],"names":["OverlayPanel","open","onClose","title","children","maxWidth","showCloseButton","footer","className","bodyClassName","content","jsx","jsxs","X","createPortal"],"mappings":";;;;AAkBA,SAAwBA,EAAa;AAAA,EACnC,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,iBAAAC,IAAkB;AAAA,EAClB,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,eAAAC,IAAgB;AAClB,GAAG;AAED,MADI,CAACR,KACD,OAAO,WAAa;AAAoB,WAAA;AAE5C,QAAMS,IACJ,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,QAAQ,KAAK;AAAA,MAEtB,UAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,iDAAiDJ,CAAS;AAAA,UACrE,OAAO;AAAA,YACL,UAAAH;AAAA,YACA,WAAW;AAAA,YACX,SAAS;AAAA,YACT,eAAe;AAAA,YACf,UAAU;AAAA,UACZ;AAAA,UAGA,UAAA;AAAA,YAAA,gBAAAO;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,OAAO;AAAA,kBACL,UAAU;AAAA,kBACV,YAAY;AAAA,kBACZ,YAAY;AAAA,kBACZ,cAAc;AAAA,kBACd,SAAST,KAASG,IAAkB,qBAAqB;AAAA,kBACzD,cAAc;AAAA,gBAChB;AAAA,gBAEC,UAAA;AAAA,kBACCA,KAAA,gBAAAK;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,MAAK;AAAA,sBACL,WAAU;AAAA,sBACV,SAAST;AAAA,sBAET,UAAA,gBAAAS,EAACE,GAAE,EAAA,MAAM,GAAI,CAAA;AAAA,oBAAA;AAAA,kBACf;AAAA,kBAEDV,KACC,gBAAAQ,EAAC,OAAI,EAAA,WAAU,QACb,UAAC,gBAAAA,EAAA,MAAA,EAAG,WAAU,qBAAoB,OAAO,EAAE,YAAY,mBAAmB,GAAI,YAAM,CAAA,GACtF;AAAA,gBAAA;AAAA,cAAA;AAAA,YAEJ;AAAA,YAGA,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW,iCAAiCF,CAAa;AAAA,gBACzD,OAAO;AAAA,kBACL,MAAM;AAAA,kBACN,WAAW;AAAA,kBACX,WAAW;AAAA,kBACX,SAAS;AAAA,gBACX;AAAA,gBAEC,UAAAL;AAAA,cAAA;AAAA,YACH;AAAA,YAECG,KACC,gBAAAI;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,OAAO;AAAA,kBACL,YAAY;AAAA,kBACZ,SAAS;AAAA,kBACT,WAAW;AAAA,gBACb;AAAA,gBAEC,UAAAJ;AAAA,cAAA;AAAA,YACH;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAIG,SAAAO,EAAaJ,GAAS,SAAS,IAAI;AAC5C;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../SmallButton.cjs.js"),r=require("react/jsx-runtime"),x=require("react"),p=require("../SectionLabel.cjs.js"),v=require("lucide-react");require("react-dom");function g({colors:i=[]}){const t=i.reduce((o,e)=>(o[e.category]||(o[e.category]=[]),o[e.category].push(e),o),{});return r.jsx("div",{style:{fontFamily:"system-ui, -apple-system, sans-serif"},children:Object.entries(t).map(([o,e])=>r.jsxs("div",{style:{marginBottom:"24px"},children:[r.jsx("div",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",marginBottom:"12px",color:"rgba(30, 33, 37, 0.62)",fontWeight:650},children:o}),r.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"12px"},children:e.map((n,s)=>r.jsxs("div",{style:{border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"12px",overflow:"hidden",background:"rgba(255, 255, 255, 0.72)"},children:[r.jsx("div",{style:{height:"64px",background:n.hex,borderBottom:"1px solid rgba(52, 58, 64, 0.10)"}}),r.jsxs("div",{style:{padding:"10px 12px"},children:[r.jsx("div",{style:{fontSize:"13px",fontWeight:680,color:"rgba(30, 33, 37, 0.92)",marginBottom:"4px"},children:n.name}),r.jsx("div",{style:{fontSize:"11.5px",fontFamily:"ui-monospace, monospace",color:"rgba(30, 33, 37, 0.52)",marginBottom:"6px"},children:n.hex}),r.jsx("div",{style:{fontSize:"11.5px",color:"rgba(30, 33, 37, 0.62)",lineHeight:1.4},children:n.usage})]})]},s))})]},o))})}function m({children:i,color:t,icon:o,...e}){const s={...{fontSize:"var(--text-xs)",padding:"1px 5px",borderRadius:"var(--radius-sm)",display:"inline-flex",alignItems:"center"},color:t,backgroundColor:`color-mix(in srgb, ${t} 15%, transparent)`,...e.style};return r.jsxs("span",{style:s,...e,children:[o&&r.jsx("span",{style:{marginRight:"3px"},children:o}),i]})}function b({checked:i=!1,onChange:t,label:o,size:e="md",disabled:n=!1,style:s,...c}){const a=e==="sm"?12:16,l=e==="sm"?8:11;return r.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:e==="sm"?3:"var(--spacing-2)",fontSize:e==="sm"?"var(--text-xs)":"var(--text-sm)",color:n?"var(--text-faint)":"var(--text-base)",cursor:n?"not-allowed":"pointer",userSelect:"none",...s},onClick:u=>{u.preventDefault(),!n&&t&&t(!i)},...c,children:[r.jsx("span",{style:{width:a,height:a,borderRadius:e==="sm"?2:3,border:`1px solid ${i?"var(--text-ink)":"var(--border)"}`,background:i?"var(--text-ink)":"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",transition:"var(--transition-fast)",flexShrink:0,opacity:n?.5:1},children:i&&r.jsx(v.Check,{size:l,style:{color:"white"},strokeWidth:3})}),o]})}const f={width:"100%",padding:"var(--spacing-2)",fontSize:"var(--text-md)",border:"1px solid var(--border)",borderRadius:"var(--radius)",backgroundColor:"var(--paper)",color:"var(--text-base)",fontFamily:"var(--font-sans)",outline:"none",transition:"border-color 0.15s ease"};function y({value:i,onChange:t,placeholder:o,disabled:e=!1,mono:n=!1,autoFocus:s=!1,style:c,...a}){return r.jsx("input",{type:"text",value:i,onChange:l=>t==null?void 0:t(l.target.value),placeholder:o,disabled:e,autoFocus:s,style:{...f,...n?{fontFamily:"var(--font-mono)"}:{},...e?{opacity:.6,cursor:"not-allowed"}:{},...c},onFocus:l=>{l.currentTarget.style.borderColor="var(--border-hover)"},onBlur:l=>{l.currentTarget.style.borderColor="var(--border)"},...a})}const h={width:"100%",padding:"var(--spacing-2)",fontSize:"var(--text-md)",border:"1px solid var(--border)",borderRadius:"var(--radius)",backgroundColor:"var(--paper)",color:"var(--text-base)",fontFamily:"var(--font-sans)",outline:"none",transition:"border-color 0.15s ease"};function S({value:i,onChange:t,placeholder:o,disabled:e=!1,mono:n=!1,rows:s=4,resize:c=!0,style:a,...l}){return r.jsx("textarea",{value:i,onChange:u=>t==null?void 0:t(u.target.value),placeholder:o,disabled:e,rows:s,style:{...h,resize:c?"vertical":"none",minHeight:s*20,...n?{fontFamily:"var(--font-mono)"}:{},...e?{opacity:.6,cursor:"not-allowed"}:{},...a},onFocus:u=>{u.currentTarget.style.borderColor="var(--border-hover)"},onBlur:u=>{u.currentTarget.style.borderColor="var(--border)"},...l})}const j={width:"100%",padding:"var(--spacing-1) var(--spacing-2)",fontSize:"var(--text-md)",border:"1px solid var(--border)",borderRadius:"var(--radius)",backgroundColor:"var(--paper)",color:"var(--text-base)",fontFamily:"var(--font-sans)",cursor:"pointer",outline:"none",transition:"border-color 0.15s ease"};function T({value:i,onChange:t,options:o=[],disabled:e=!1,placeholder:n,style:s,...c}){return r.jsxs("select",{value:i,onChange:a=>t==null?void 0:t(a.target.value),disabled:e,style:{...j,...e?{opacity:.6,cursor:"not-allowed"}:{},...s},onFocus:a=>{a.currentTarget.style.borderColor="var(--border-hover)"},onBlur:a=>{a.currentTarget.style.borderColor="var(--border)"},...c,children:[n&&r.jsx("option",{value:"",children:n}),o.map(a=>r.jsx("option",{value:a.value,children:a.label},a.value))]})}function k({children:i,htmlFor:t,style:o}){return r.jsx("label",{htmlFor:t,style:{display:"block",fontSize:"var(--text-base)",color:"var(--text-muted)",marginBottom:"var(--spacing-1)",fontFamily:"var(--font-sans)",...o},children:i})}function C({children:i,onConfirm:t,prompt:o="Delete?",confirmLabel:e="Yes",cancelLabel:n="No",style:s}){const[c,a]=x.useState(!1);return c?r.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--spacing-1)",...s},children:[r.jsx("span",{style:{fontSize:"var(--text-sm)",color:"var(--text-muted)"},children:o}),r.jsx(d.SmallButton,{variant:"ghost",size:"sm",onClick:l=>{l.stopPropagation(),t==null||t(),a(!1)},style:{color:"var(--text-ink)",fontWeight:"var(--font-semibold)"},children:e}),r.jsx(d.SmallButton,{variant:"ghost",size:"sm",onClick:l=>{l.stopPropagation(),a(!1)},children:n})]}):r.jsx("span",{onClick:l=>{l.stopPropagation(),a(!0)},style:{cursor:"pointer",...s},children:i})}exports.Card=d.Card;exports.DetailCard=d.DetailCard;exports.DeviationIndicator=d.DeviationIndicator;exports.SmallButton=d.SmallButton;exports.Tag=d.Tag;exports.Tooltip=d.Tooltip;exports.TooltipContent=d.TooltipContent;exports.TooltipProvider=d.TooltipProvider;exports.TooltipTrigger=d.TooltipTrigger;exports.SectionLabel=p.SectionLabel;exports.Tabs=p.Tabs;exports.Badge=m;exports.Checkbox=b;exports.ColorPalette=g;exports.FormLabel=k;exports.InlineConfirm=C;exports.Select=T;exports.TextArea=S;exports.TextInput=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../SmallButton.cjs.js"),e=require("react/jsx-runtime"),x=require("react"),L=require("../SectionLabel.cjs.js"),q=require("lucide-react"),E=require("../TextInput.cjs.js");require("react-dom");function H({colors:i=[]}){const r=i.reduce((n,t)=>(n[t.category]||(n[t.category]=[]),n[t.category].push(t),n),{});return e.jsx("div",{style:{fontFamily:"system-ui, -apple-system, sans-serif"},children:Object.entries(r).map(([n,t])=>e.jsxs("div",{style:{marginBottom:"24px"},children:[e.jsx("div",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",marginBottom:"12px",color:"rgba(30, 33, 37, 0.62)",fontWeight:650},children:n}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"12px"},children:t.map((o,l)=>e.jsxs("div",{style:{border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"12px",overflow:"hidden",background:"rgba(255, 255, 255, 0.72)"},children:[e.jsx("div",{style:{height:"64px",background:o.hex,borderBottom:"1px solid rgba(52, 58, 64, 0.10)"}}),e.jsxs("div",{style:{padding:"10px 12px"},children:[e.jsx("div",{style:{fontSize:"13px",fontWeight:680,color:"rgba(30, 33, 37, 0.92)",marginBottom:"4px"},children:o.name}),e.jsx("div",{style:{fontSize:"11.5px",fontFamily:"ui-monospace, monospace",color:"rgba(30, 33, 37, 0.52)",marginBottom:"6px"},children:o.hex}),e.jsx("div",{style:{fontSize:"11.5px",color:"rgba(30, 33, 37, 0.62)",lineHeight:1.4},children:o.usage})]})]},l))})]},n))})}function W({children:i,color:r,icon:n,...t}){const l={...{fontSize:"var(--text-xs)",padding:"1px 5px",borderRadius:"var(--radius-sm)",display:"inline-flex",alignItems:"center"},color:r,backgroundColor:`color-mix(in srgb, ${r} 15%, transparent)`,...t.style};return e.jsxs("span",{style:l,...t,children:[n&&e.jsx("span",{style:{marginRight:"3px"},children:n}),i]})}function D({checked:i=!1,onChange:r,label:n,size:t="md",disabled:o=!1,style:l,...p}){const a=t==="sm"?12:16,d=t==="sm"?8:11;return e.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:t==="sm"?3:"var(--spacing-2)",fontSize:t==="sm"?"var(--text-xs)":"var(--text-sm)",color:o?"var(--text-faint)":"var(--text-base)",cursor:o?"not-allowed":"pointer",userSelect:"none",...l},onClick:c=>{c.preventDefault(),!o&&r&&r(!i)},...p,children:[e.jsx("span",{style:{width:a,height:a,borderRadius:t==="sm"?2:3,border:`1px solid ${i?"var(--text-ink)":"var(--border)"}`,background:i?"var(--text-ink)":"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",transition:"var(--transition-fast)",flexShrink:0,opacity:o?.5:1},children:i&&e.jsx(q.Check,{size:d,style:{color:"white"},strokeWidth:3})}),n]})}const $={width:"100%",padding:"var(--spacing-2)",fontSize:"var(--text-md)",border:"1px solid var(--border)",borderRadius:"var(--radius)",backgroundColor:"var(--paper)",color:"var(--text-base)",fontFamily:"var(--font-sans)",outline:"none",transition:"border-color 0.15s ease"};function A({value:i,onChange:r,placeholder:n,disabled:t=!1,mono:o=!1,rows:l=4,resize:p=!0,style:a,...d}){return e.jsx("textarea",{value:i,onChange:c=>r==null?void 0:r(c.target.value),placeholder:n,disabled:t,rows:l,style:{...$,resize:p?"vertical":"none",minHeight:l*20,...o?{fontFamily:"var(--font-mono)"}:{},...t?{opacity:.6,cursor:"not-allowed"}:{},...a},onFocus:c=>{c.currentTarget.style.borderColor="var(--border-hover)"},onBlur:c=>{c.currentTarget.style.borderColor="var(--border)"},...d})}const V={width:"100%",padding:"var(--spacing-1) var(--spacing-2)",fontSize:"var(--text-md)",border:"1px solid var(--border)",borderRadius:"var(--radius)",backgroundColor:"var(--paper)",color:"var(--text-base)",fontFamily:"var(--font-sans)",cursor:"pointer",outline:"none",transition:"border-color 0.15s ease"};function N({value:i,onChange:r,options:n=[],disabled:t=!1,placeholder:o,style:l,...p}){return e.jsxs("select",{value:i,onChange:a=>r==null?void 0:r(a.target.value),disabled:t,style:{...V,...t?{opacity:.6,cursor:"not-allowed"}:{},...l},onFocus:a=>{a.currentTarget.style.borderColor="var(--border-hover)"},onBlur:a=>{a.currentTarget.style.borderColor="var(--border)"},...p,children:[o&&e.jsx("option",{value:"",children:o}),n.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))]})}function Y({value:i=[],onChange:r,options:n=[],placeholder:t="Select options",disabled:o=!1,leftIcon:l=null,rightIcon:p=null,maxMenuHeight:a=240,draggable:d=!1}){const[c,R]=x.useState(!1),[M,B]=x.useState(null),[f,F]=x.useState(n),[I,h]=x.useState(null),b=x.useRef(null),S=x.useRef(null);x.useEffect(()=>{F(n)},[n]);const j=new Set((i||[]).map(String)),z=s=>{if(!r)return;const g=String(s),m=new Set(j);m.has(g)?m.delete(g):m.add(g),r(Array.from(m))};x.useEffect(()=>{if(!c)return;const s=g=>{b.current&&!b.current.contains(g.target)&&S.current&&!S.current.contains(g.target)&&R(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[c]);const y=j.size,O=y===0?t:`${y} selected`;return e.jsxs("div",{style:{position:"relative",width:"100%"},children:[e.jsxs("button",{type:"button",ref:b,disabled:o,onClick:()=>!o&&R(s=>!s),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"var(--spacing-1) var(--spacing-2)",borderRadius:"var(--radius)",...c?{borderBottomLeftRadius:0,borderBottomRightRadius:0}:{},border:"1px solid var(--border)",backgroundColor:o?"rgba(249, 250, 251, 1)":"var(--paper)",color:y===0?"var(--text-muted)":"var(--text-base)",cursor:o?"not-allowed":"pointer",fontFamily:"var(--font-sans)",fontSize:"var(--text-md)",outline:"none",transition:"border-color 0.15s ease, background-color 0.15s ease"},onMouseEnter:s=>{o||(s.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:s=>{o||(s.currentTarget.style.borderColor="var(--border)")},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0,flex:1},children:[l&&e.jsx("span",{style:{flexShrink:0,display:"inline-flex"},children:l}),e.jsx("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:O})]}),e.jsx("span",{style:{flexShrink:0,display:"inline-flex"},children:p||e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:c?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms ease",color:"var(--text-muted)"},children:e.jsx("path",{d:"M5.25 7.5L10 12.25L14.75 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),c&&e.jsx("div",{ref:S,style:{position:"absolute",zIndex:40,marginTop:0,width:"100%",maxHeight:a,overflowY:"auto",backgroundColor:"#FFFFFF",borderRadius:8,borderTopLeftRadius:0,borderTopRightRadius:0,border:"1px solid rgba(209, 213, 219, 1)",borderTop:"none",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)"},children:e.jsx("div",{style:{padding:"4px 0"},children:f&&f.length===0?e.jsx("div",{style:{padding:"8px 12px",fontSize:"var(--text-sm)",color:"var(--text-muted)",fontFamily:"var(--font-sans)"},children:"No options"}):f.map(s=>{const g=j.has(String(s.value)),m=I===String(s.value);return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 12px",cursor:"pointer",backgroundColor:M===String(s.value)?"var(--hover-warm)":"transparent",opacity:m?.6:1},onClick:()=>z(s.value),onMouseEnter:()=>B(String(s.value)),onMouseLeave:()=>B(null),draggable:d,onDragStart:v=>{d&&(h(String(s.value)),v.dataTransfer&&(v.dataTransfer.effectAllowed="move"))},onDragOver:v=>{d&&v.preventDefault()},onDrop:v=>{if(!d)return;v.preventDefault();const k=f.findIndex(C=>String(C.value)===I),w=f.findIndex(C=>String(C.value)===String(s.value));if(k===-1||w===-1||k===w){h(null);return}const T=[...f],[P]=T.splice(k,1);T.splice(w,0,P),F(T),h(null)},onDragEnd:()=>{d&&h(null)},children:[d&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:14,height:14,color:"var(--text-faint)",cursor:"grab"},onClick:v=>{v.stopPropagation()},children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4 7H16M4 10H16M4 13H16",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}),e.jsx(D,{size:"sm",checked:g,onChange:()=>z(s.value),style:{gap:0}}),e.jsx("span",{style:{fontSize:"var(--text-sm)",color:"var(--text-base)",fontFamily:"var(--font-sans)"},children:s.label})]},s.value)})})})]})}function G({children:i,htmlFor:r,style:n}){return e.jsx("label",{htmlFor:r,style:{display:"block",fontSize:"var(--text-base)",color:"var(--text-muted)",marginBottom:"var(--spacing-1)",fontFamily:"var(--font-sans)",...n},children:i})}function J({children:i,onConfirm:r,prompt:n="Delete?",confirmLabel:t="Yes",cancelLabel:o="No",style:l}){const[p,a]=x.useState(!1);return p?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--spacing-1)",...l},children:[e.jsx("span",{style:{fontSize:"var(--text-sm)",color:"var(--text-muted)"},children:n}),e.jsx(u.SmallButton,{variant:"ghost",size:"sm",onClick:d=>{d.stopPropagation(),r==null||r(),a(!1)},style:{color:"var(--text-ink)",fontWeight:"var(--font-semibold)"},children:t}),e.jsx(u.SmallButton,{variant:"ghost",size:"sm",onClick:d=>{d.stopPropagation(),a(!1)},children:o})]}):e.jsx("span",{onClick:d=>{d.stopPropagation(),a(!0)},style:{cursor:"pointer",...l},children:i})}exports.Card=u.Card;exports.DetailCard=u.DetailCard;exports.DeviationIndicator=u.DeviationIndicator;exports.SmallButton=u.SmallButton;exports.Tag=u.Tag;exports.Tooltip=u.Tooltip;exports.TooltipContent=u.TooltipContent;exports.TooltipProvider=u.TooltipProvider;exports.TooltipTrigger=u.TooltipTrigger;exports.SectionLabel=L.SectionLabel;exports.Tabs=L.Tabs;exports.TextInput=E.TextInput;exports.Badge=W;exports.Checkbox=D;exports.ColorPalette=H;exports.FormLabel=G;exports.InlineConfirm=J;exports.MultiSelect=Y;exports.Select=N;exports.TextArea=A;
2
2
  //# sourceMappingURL=primitives.cjs.js.map