@cloudparse/up-backoffice-sdk 0.2.0 → 0.3.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 +11 -0
- package/claude-plugin/sdk-version.json +1 -1
- package/claude-plugin/skills/up-backoffice-plugin-builder/references/rules-and-pitfalls.md +7 -0
- package/claude-plugin/skills/up-backoffice-plugin-builder/references/sdk-api.md +7 -0
- package/dist/index.js +61 -61
- package/dist/index.js.map +1 -1
- package/dist/theme.css +45 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,6 +47,17 @@ export default definePlugin({
|
|
|
47
47
|
|
|
48
48
|
`vite build` produces `dist/plugin.js`, the artifact to publish to the Up backend. See `AGENTS.md` for the full flow.
|
|
49
49
|
|
|
50
|
+
## Theme (since 0.3.0)
|
|
51
|
+
|
|
52
|
+
**Breaking visual change in 0.3.0: the SDK goes from dark to light.** The default values of these tokens changed: `primary`, `background`, `foreground`, `card`, `muted`, `muted-foreground`, `accent`, `success`, `warning`, `error`, and the radius scale `radius-lg`, `radius-md` and `radius-sm` (0.75, 0.5 and 0.25 rem became 1.5, 0.875 and 0.625 rem). The API is unchanged.
|
|
53
|
+
|
|
54
|
+
The SDK is light, like the Studio. `theme.css` carries the palette of the Studio (`up/frontend` `globals.css`): `background`, `card`, `primary`, `line`, `input-line`, `row-line`, `soft`, `row-hover`, the soft status colors, the radius scale and the `shadow-card` and `shadow-lift` shadows. The components use these tokens only, no `white/…` or `black/…` opacity classes: a host or a plugin restyles the SDK by redefining the tokens. Fonts: Figtree for UI copy (`font-sans`) and Bricolage Grotesque for display headings (`font-display`). The SDK ships no font file: the host sends the two stacks to the plugin frame. Only the code and response panes of the GraphQL playground and the image overlays stay dark, with the named tokens `night` and `night-foreground`.
|
|
55
|
+
|
|
56
|
+
**Migration from 0.2.x and 0.1.x:**
|
|
57
|
+
1. Remove any local dark-to-light workaround, above all a `--color-white` inversion and the rules that put white back (`.bg-primary.text-white`...). With 0.3.0 they break the plugin.
|
|
58
|
+
2. Replace `bg-white/5`, `bg-white/10`, `border-white/5`, `border-white/10`, `text-white`, `bg-black/…` and `prose-invert` in your own components by tokens: `bg-soft`, `border-line`, `border-input-line`, `text-foreground`, `text-primary-foreground` (on a colored button), `bg-night` and `text-night-foreground` (a dark code pane).
|
|
59
|
+
3. Rebuild and look at the plugin in the Studio.
|
|
60
|
+
|
|
50
61
|
## UI kit
|
|
51
62
|
|
|
52
63
|
Admin pages are built from the SDK components: `PageHeader`, `SectionHeader`, `Card`, `StatTile`, `Table*`, `IconButton`/`RowActions`, `Modal`/`ModalActions`, `ConfirmModal`, `DangerZone` + `useDangerZoneDelete`, `ImageUpload`, `Switch`/`SettingRow`, `Input`, `Textarea`, `Select`, `SearchInput`, `Tabs`, `LoadMoreButton`, `LoadingState`, `Banner`, `Badge`, `EmptyState`, `GraphQLPlayground`... Full list with props: `claude-plugin/skills/up-backoffice-plugin-builder/references/sdk-api.md`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "version": "0.
|
|
1
|
+
{ "version": "0.3.1" }
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Rules and pitfalls
|
|
2
2
|
|
|
3
|
+
## Theme tokens (0.3.0 and later: the SDK is light, like the Studio)
|
|
4
|
+
|
|
5
|
+
- Surfaces and text: `bg-background`, `bg-card`, `bg-soft`, `text-foreground`, `text-body`, `text-muted-foreground`, `text-primary-foreground` (text on a colored button).
|
|
6
|
+
- Lines: `border-line` (cards, tables), `border-input-line` (inputs), `divide-row-line` (table rows). Hover: `bg-row-hover`, `hover:bg-line`.
|
|
7
|
+
- Shadows: `shadow-card`, `shadow-lift`. Dark pane inside the light UI (code, responses): `bg-night`, `text-night-foreground`.
|
|
8
|
+
- Never write `white/…` or `black/…` opacity classes, `text-white`, `bg-white` or `prose-invert` in a plugin: they assume a dark page and are invisible or wrong on the light theme. Do not redefine `--color-white`.
|
|
9
|
+
|
|
3
10
|
## Rules
|
|
4
11
|
|
|
5
12
|
1. **One ES module.** `vite build` with `backofficePlugin()` outputs `dist/plugin.js`. No code splitting and no dynamic `import()` in plugin code: a lazy chunk cannot be resolved from the blob URL the host imports.
|
|
@@ -4,6 +4,13 @@ Icons: every `icon` prop takes any `ComponentType<{ className?: string }>` (luci
|
|
|
4
4
|
|
|
5
5
|
Import everything a plugin uses from `@cloudparse/up-backoffice-sdk`. `/host` is for the backoffice only, `/vite` for the build config only. The typings in `node_modules/@cloudparse/up-backoffice-sdk/dist/index.d.ts` are the source of truth.
|
|
6
6
|
|
|
7
|
+
## Theme tokens (0.3.0 and later: the SDK is light, like the Studio)
|
|
8
|
+
|
|
9
|
+
- Surfaces and text: `bg-background`, `bg-card`, `bg-soft`, `text-foreground`, `text-body`, `text-muted-foreground`, `text-primary-foreground` (text on a colored button).
|
|
10
|
+
- Lines: `border-line` (cards, tables), `border-input-line` (inputs), `divide-row-line` (table rows). Hover: `bg-row-hover`, `hover:bg-line`.
|
|
11
|
+
- Shadows: `shadow-card`, `shadow-lift`. Dark pane inside the light UI (code, responses): `bg-night`, `text-night-foreground`.
|
|
12
|
+
- Never write `white/…` or `black/…` opacity classes, `text-white`, `bg-white` or `prose-invert` in a plugin: they assume a dark page and are invisible or wrong on the light theme. Do not redefine `--color-white`.
|
|
13
|
+
|
|
7
14
|
## Plugin contract
|
|
8
15
|
|
|
9
16
|
| Export | Signature / shape |
|
package/dist/index.js
CHANGED
|
@@ -201,7 +201,7 @@ var Button = forwardRef(
|
|
|
201
201
|
...props
|
|
202
202
|
}, ref) => {
|
|
203
203
|
const variants = {
|
|
204
|
-
danger: "bg-error text-
|
|
204
|
+
danger: "bg-error text-primary-foreground hover:bg-error/90",
|
|
205
205
|
ghost: "bg-transparent hover:bg-muted/10 text-foreground",
|
|
206
206
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
207
207
|
secondary: "bg-card text-card-foreground hover:bg-card/80 border border-muted/20"
|
|
@@ -349,7 +349,7 @@ function ConfirmModal({
|
|
|
349
349
|
"aria-describedby": descriptionId,
|
|
350
350
|
"aria-labelledby": titleId,
|
|
351
351
|
"aria-modal": "true",
|
|
352
|
-
className: "bg-card border border-
|
|
352
|
+
className: "bg-card border border-line w-full max-w-md rounded-3xl shadow-lift overflow-hidden animate-in zoom-in-95 duration-300 p-8 space-y-6",
|
|
353
353
|
ref: modalRef,
|
|
354
354
|
role: "alertdialog",
|
|
355
355
|
tabIndex: -1,
|
|
@@ -559,7 +559,7 @@ function definePlugin(definition) {
|
|
|
559
559
|
const Page = page.component;
|
|
560
560
|
return /* @__PURE__ */ jsx4(PluginHostContext.Provider, { value: host, children: /* @__PURE__ */ jsx4(Page, {}) });
|
|
561
561
|
},
|
|
562
|
-
sdkVersion: "0.
|
|
562
|
+
sdkVersion: "0.3.1"
|
|
563
563
|
};
|
|
564
564
|
}
|
|
565
565
|
|
|
@@ -665,7 +665,7 @@ function Card({
|
|
|
665
665
|
"div",
|
|
666
666
|
{
|
|
667
667
|
className: cn(
|
|
668
|
-
"rounded-3xl border border-
|
|
668
|
+
"rounded-3xl border border-line shadow-card",
|
|
669
669
|
variant === "glass" ? "bg-card/50 backdrop-blur-sm" : "bg-card",
|
|
670
670
|
PADDINGS[padding],
|
|
671
671
|
interactive && "hover:border-primary/20 transition-all duration-300",
|
|
@@ -692,7 +692,7 @@ function CopyableUuid({ uuid }) {
|
|
|
692
692
|
/* @__PURE__ */ jsx9(
|
|
693
693
|
"button",
|
|
694
694
|
{
|
|
695
|
-
className: `p-1 rounded-md transition-all flex items-center justify-center shrink-0 ${copied ? "bg-success/20 text-success" : "text-muted-foreground hover:text-primary hover:bg-
|
|
695
|
+
className: `p-1 rounded-md transition-all flex items-center justify-center shrink-0 ${copied ? "bg-success/20 text-success" : "text-muted-foreground hover:text-primary hover:bg-soft"}`,
|
|
696
696
|
onClick: handleCopy,
|
|
697
697
|
title: "Copy UUID",
|
|
698
698
|
type: "button",
|
|
@@ -737,7 +737,7 @@ var Input = forwardRef2(
|
|
|
737
737
|
"input",
|
|
738
738
|
{
|
|
739
739
|
className: cn(
|
|
740
|
-
"flex h-10 w-full rounded-md border border-
|
|
740
|
+
"flex h-10 w-full rounded-md border border-input-line bg-card 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/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",
|
|
741
741
|
Icon && "pl-9",
|
|
742
742
|
error && "border-error focus-visible:ring-error",
|
|
743
743
|
className
|
|
@@ -917,9 +917,9 @@ function GraphQLPlayground({
|
|
|
917
917
|
setError(null);
|
|
918
918
|
setLatency(null);
|
|
919
919
|
};
|
|
920
|
-
return /* @__PURE__ */ jsxs9("section", { className: "bg-card
|
|
920
|
+
return /* @__PURE__ */ jsxs9("section", { className: "bg-card border border-line rounded-3xl p-8 shadow-card relative overflow-hidden space-y-8", children: [
|
|
921
921
|
/* @__PURE__ */ jsx14("div", { className: "absolute top-0 right-0 w-80 h-80 bg-primary/5 rounded-full blur-3xl -mr-20 -mt-20 pointer-events-none" }),
|
|
922
|
-
/* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-center justify-between gap-4 border-b border-
|
|
922
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-center justify-between gap-4 border-b border-line pb-6", children: [
|
|
923
923
|
/* @__PURE__ */ jsxs9("div", { className: "space-y-1", children: [
|
|
924
924
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
|
|
925
925
|
/* @__PURE__ */ jsx14("span", { className: "p-2 bg-primary/10 rounded-xl text-primary shrink-0", children: /* @__PURE__ */ jsx14(Terminal, { className: "w-5 h-5" }) }),
|
|
@@ -960,7 +960,7 @@ function GraphQLPlayground({
|
|
|
960
960
|
/* @__PURE__ */ jsx14("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: presets.map((preset) => /* @__PURE__ */ jsxs9(
|
|
961
961
|
"button",
|
|
962
962
|
{
|
|
963
|
-
className: "bg-card/50 hover:bg-card border border-
|
|
963
|
+
className: "bg-card/50 hover:bg-card border border-line hover:border-primary/30 p-4 rounded-2xl text-left transition-all group relative overflow-hidden",
|
|
964
964
|
onClick: () => handleApplyPreset(preset),
|
|
965
965
|
type: "button",
|
|
966
966
|
children: [
|
|
@@ -995,7 +995,7 @@ function GraphQLPlayground({
|
|
|
995
995
|
/* @__PURE__ */ jsx14(
|
|
996
996
|
"textarea",
|
|
997
997
|
{
|
|
998
|
-
className: "w-full flex-1 min-h-64 bg-
|
|
998
|
+
className: "w-full flex-1 min-h-64 bg-night border border-line focus:border-primary/50 rounded-2xl p-4 font-mono text-xs text-emerald-400 placeholder-night-foreground/30 select-all outline-none resize-y shadow-inner leading-relaxed",
|
|
999
999
|
onChange: (e) => setQuery(e.target.value),
|
|
1000
1000
|
placeholder: "# Write your GraphQL query here...",
|
|
1001
1001
|
spellCheck: "false",
|
|
@@ -1007,7 +1007,7 @@ function GraphQLPlayground({
|
|
|
1007
1007
|
/* @__PURE__ */ jsx14(
|
|
1008
1008
|
"textarea",
|
|
1009
1009
|
{
|
|
1010
|
-
className: "w-full h-24 bg-
|
|
1010
|
+
className: "w-full h-24 bg-night border border-line focus:border-primary/50 rounded-2xl p-4 font-mono text-xs text-cyan-400 placeholder-night-foreground/30 select-all outline-none resize-none shadow-inner leading-relaxed",
|
|
1011
1011
|
onChange: (e) => setVariables(e.target.value),
|
|
1012
1012
|
placeholder: "{}",
|
|
1013
1013
|
spellCheck: "false",
|
|
@@ -1019,7 +1019,7 @@ function GraphQLPlayground({
|
|
|
1019
1019
|
/* @__PURE__ */ jsx14(
|
|
1020
1020
|
Button,
|
|
1021
1021
|
{
|
|
1022
|
-
className: "w-full h-12 rounded-xl shadow-
|
|
1022
|
+
className: "w-full h-12 rounded-xl shadow-card hover:scale-101 active:scale-99 transition-transform duration-200",
|
|
1023
1023
|
isLoading: loading,
|
|
1024
1024
|
onClick: handleRunQuery,
|
|
1025
1025
|
children: loading ? "Executing Query..." : /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
@@ -1040,9 +1040,9 @@ function GraphQLPlayground({
|
|
|
1040
1040
|
"ms"
|
|
1041
1041
|
] })
|
|
1042
1042
|
] }),
|
|
1043
|
-
/* @__PURE__ */ jsxs9("div", { className: "flex-1 bg-
|
|
1043
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-1 bg-night border border-line rounded-2xl p-4 min-h-88 relative overflow-hidden flex flex-col", children: [
|
|
1044
1044
|
error && /* @__PURE__ */ jsx14("div", { className: "absolute top-4 left-4 right-4 z-10", children: /* @__PURE__ */ jsx14(Banner, { message: error, variant: "error" }) }),
|
|
1045
|
-
/* @__PURE__ */ jsx14("div", { className: "flex-1 overflow-auto max-h-112 font-mono text-xs text-
|
|
1045
|
+
/* @__PURE__ */ jsx14("div", { className: "flex-1 overflow-auto max-h-112 font-mono text-xs text-night-foreground leading-relaxed pr-2", children: response ? /* @__PURE__ */ jsx14("pre", { children: JSON.stringify(response, null, 2) }) : /* @__PURE__ */ jsxs9("div", { className: "h-full flex flex-col items-center justify-center text-center text-muted-foreground/30 italic text-xs font-semibold py-20", children: [
|
|
1046
1046
|
/* @__PURE__ */ jsx14(Terminal, { className: "w-12 h-12 mb-3 opacity-20" }),
|
|
1047
1047
|
"Ready to listen. Run a query!"
|
|
1048
1048
|
] }) }),
|
|
@@ -1143,7 +1143,7 @@ function RemoteImage({
|
|
|
1143
1143
|
"div",
|
|
1144
1144
|
{
|
|
1145
1145
|
className: cn(
|
|
1146
|
-
"flex flex-col items-center justify-center bg-
|
|
1146
|
+
"flex flex-col items-center justify-center bg-soft gap-2 text-muted-foreground",
|
|
1147
1147
|
className
|
|
1148
1148
|
),
|
|
1149
1149
|
children: [
|
|
@@ -1209,12 +1209,12 @@ function ImageUpload({
|
|
|
1209
1209
|
onFile(file);
|
|
1210
1210
|
};
|
|
1211
1211
|
const frame = cn(
|
|
1212
|
-
"relative w-full rounded-3xl overflow-hidden bg-
|
|
1212
|
+
"relative w-full rounded-3xl overflow-hidden bg-soft",
|
|
1213
1213
|
ASPECTS[aspect]
|
|
1214
1214
|
);
|
|
1215
1215
|
return /* @__PURE__ */ jsxs11("div", { className: cn("space-y-3", className), children: [
|
|
1216
1216
|
label && /* @__PURE__ */ jsx17(FieldLabel, { htmlFor: inputId, children: label }),
|
|
1217
|
-
readOnly ? /* @__PURE__ */ jsxs11("div", { className: cn(frame, "border border-
|
|
1217
|
+
readOnly ? /* @__PURE__ */ jsxs11("div", { className: cn(frame, "border border-line"), children: [
|
|
1218
1218
|
previewUrl && /* @__PURE__ */ jsx17(
|
|
1219
1219
|
RemoteImage,
|
|
1220
1220
|
{
|
|
@@ -1223,13 +1223,13 @@ function ImageUpload({
|
|
|
1223
1223
|
src: previewUrl
|
|
1224
1224
|
}
|
|
1225
1225
|
),
|
|
1226
|
-
readOnlyHint && /* @__PURE__ */ jsx17("div", { className: "absolute inset-0 bg-
|
|
1226
|
+
readOnlyHint && /* @__PURE__ */ jsx17("div", { className: "absolute inset-0 bg-night/50 flex items-center justify-center", children: /* @__PURE__ */ jsx17("p", { className: "text-night-foreground text-xs font-black uppercase tracking-widest", children: readOnlyHint }) })
|
|
1227
1227
|
] }) : /* @__PURE__ */ jsxs11(
|
|
1228
1228
|
"button",
|
|
1229
1229
|
{
|
|
1230
1230
|
className: cn(
|
|
1231
1231
|
frame,
|
|
1232
|
-
"border-2 border-dashed border-
|
|
1232
|
+
"border-2 border-dashed border-input-line cursor-pointer group hover:border-primary/50 hover:bg-soft transition-all"
|
|
1233
1233
|
),
|
|
1234
1234
|
disabled: uploading,
|
|
1235
1235
|
onClick: () => inputRef.current?.click(),
|
|
@@ -1244,13 +1244,13 @@ function ImageUpload({
|
|
|
1244
1244
|
src: previewUrl
|
|
1245
1245
|
}
|
|
1246
1246
|
),
|
|
1247
|
-
/* @__PURE__ */ jsx17("div", { className: "absolute inset-0 bg-
|
|
1247
|
+
/* @__PURE__ */ jsx17("div", { className: "absolute inset-0 bg-night/60 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center backdrop-blur-sm", children: compact ? /* @__PURE__ */ jsx17(
|
|
1248
1248
|
Upload,
|
|
1249
1249
|
{
|
|
1250
1250
|
"aria-label": "Change image",
|
|
1251
|
-
className: "w-5 h-5 text-
|
|
1251
|
+
className: "w-5 h-5 text-primary-foreground"
|
|
1252
1252
|
}
|
|
1253
|
-
) : /* @__PURE__ */ jsxs11("p", { className: "text-
|
|
1253
|
+
) : /* @__PURE__ */ jsxs11("p", { className: "text-primary-foreground text-xs font-black uppercase tracking-widest flex items-center gap-2 bg-primary px-4 py-2 rounded-full", children: [
|
|
1254
1254
|
/* @__PURE__ */ jsx17(Upload, { className: "w-4 h-4" }),
|
|
1255
1255
|
" Change image"
|
|
1256
1256
|
] }) })
|
|
@@ -1259,7 +1259,7 @@ function ImageUpload({
|
|
|
1259
1259
|
"div",
|
|
1260
1260
|
{
|
|
1261
1261
|
className: cn(
|
|
1262
|
-
"bg-
|
|
1262
|
+
"bg-soft rounded-2xl group-hover:scale-110 transition-transform",
|
|
1263
1263
|
compact ? "p-2" : "p-4"
|
|
1264
1264
|
),
|
|
1265
1265
|
children: /* @__PURE__ */ jsx17(ImageIcon2, { className: compact ? "w-5 h-5" : "w-8 h-8" })
|
|
@@ -1276,7 +1276,7 @@ function ImageUpload({
|
|
|
1276
1276
|
}
|
|
1277
1277
|
)
|
|
1278
1278
|
] }),
|
|
1279
|
-
uploading && /* @__PURE__ */ jsx17("div", { className: "absolute inset-0 bg-
|
|
1279
|
+
uploading && /* @__PURE__ */ jsx17("div", { className: "absolute inset-0 bg-night/40 flex items-center justify-center backdrop-blur-sm", children: /* @__PURE__ */ jsx17(Loader23, { className: "w-8 h-8 animate-spin text-night-foreground" }) })
|
|
1280
1280
|
]
|
|
1281
1281
|
}
|
|
1282
1282
|
),
|
|
@@ -1346,7 +1346,7 @@ function LoadMoreButton({
|
|
|
1346
1346
|
return /* @__PURE__ */ jsx19("div", { className: "flex justify-center pt-4", children: /* @__PURE__ */ jsx19(
|
|
1347
1347
|
Button,
|
|
1348
1348
|
{
|
|
1349
|
-
className: "h-12 px-10 rounded-2xl bg-
|
|
1349
|
+
className: "h-12 px-10 rounded-2xl bg-soft border-line hover:bg-line",
|
|
1350
1350
|
isLoading: loading,
|
|
1351
1351
|
onClick,
|
|
1352
1352
|
type: "button",
|
|
@@ -1406,19 +1406,19 @@ function parseMarkdown(md) {
|
|
|
1406
1406
|
let html = md.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
1407
1407
|
html = html.replace(/```([\s\S]*?)```/g, (_, code) => {
|
|
1408
1408
|
const cleanCode = code.replace(/^[a-zA-Z0-9_-]+\n/, "");
|
|
1409
|
-
return `<pre class="bg-
|
|
1409
|
+
return `<pre class="bg-soft p-4 rounded-xl font-mono text-xs my-3 overflow-x-auto border border-line text-body"><code>${cleanCode.trim()}</code></pre>`;
|
|
1410
1410
|
});
|
|
1411
1411
|
html = html.replace(
|
|
1412
1412
|
/`([^`]+)`/g,
|
|
1413
|
-
'<code class="bg-
|
|
1413
|
+
'<code class="bg-soft px-1.5 py-0.5 rounded font-mono text-xs text-primary">$1</code>'
|
|
1414
1414
|
);
|
|
1415
1415
|
html = html.replace(
|
|
1416
1416
|
/^### (.*$)/gim,
|
|
1417
|
-
'<h3 class="text-sm font-display font-bold mt-4 mb-2 text-
|
|
1417
|
+
'<h3 class="text-sm font-display font-bold mt-4 mb-2 text-foreground">$1</h3>'
|
|
1418
1418
|
);
|
|
1419
1419
|
html = html.replace(
|
|
1420
1420
|
/^## (.*$)/gim,
|
|
1421
|
-
'<h2 class="text-base font-display font-extrabold mt-5 mb-2 text-
|
|
1421
|
+
'<h2 class="text-base font-display font-extrabold mt-5 mb-2 text-foreground border-b border-line pb-1">$1</h2>'
|
|
1422
1422
|
);
|
|
1423
1423
|
html = html.replace(
|
|
1424
1424
|
/^# (.*$)/gim,
|
|
@@ -1426,7 +1426,7 @@ function parseMarkdown(md) {
|
|
|
1426
1426
|
);
|
|
1427
1427
|
html = html.replace(
|
|
1428
1428
|
/\*\*([^*]+)\*\*/g,
|
|
1429
|
-
'<strong class="font-bold text-
|
|
1429
|
+
'<strong class="font-bold text-foreground">$1</strong>'
|
|
1430
1430
|
);
|
|
1431
1431
|
html = html.replace(/\*([^*]+)\*/g, '<em class="italic">$1</em>');
|
|
1432
1432
|
const sanitizeUrl = (urlStr) => {
|
|
@@ -1543,11 +1543,11 @@ function MarkdownEditor({
|
|
|
1543
1543
|
] }),
|
|
1544
1544
|
description && /* @__PURE__ */ jsx20("p", { className: "text-xs text-muted-foreground/60 font-medium leading-tight", children: description })
|
|
1545
1545
|
] }),
|
|
1546
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex bg-
|
|
1546
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex bg-soft border border-line rounded-xl p-0.5", children: [
|
|
1547
1547
|
/* @__PURE__ */ jsxs13(
|
|
1548
1548
|
"button",
|
|
1549
1549
|
{
|
|
1550
|
-
className: `flex items-center gap-1.5 px-3 py-1 text-xs font-black uppercase tracking-wider rounded-lg transition-all ${activeTab === "edit" ? "bg-primary text-
|
|
1550
|
+
className: `flex items-center gap-1.5 px-3 py-1 text-xs font-black uppercase tracking-wider rounded-lg transition-all ${activeTab === "edit" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:text-foreground"}`,
|
|
1551
1551
|
onClick: () => setActiveTab("edit"),
|
|
1552
1552
|
type: "button",
|
|
1553
1553
|
children: [
|
|
@@ -1559,7 +1559,7 @@ function MarkdownEditor({
|
|
|
1559
1559
|
/* @__PURE__ */ jsxs13(
|
|
1560
1560
|
"button",
|
|
1561
1561
|
{
|
|
1562
|
-
className: `flex items-center gap-1.5 px-3 py-1 text-xs font-black uppercase tracking-wider rounded-lg transition-all ${activeTab === "preview" ? "bg-primary text-
|
|
1562
|
+
className: `flex items-center gap-1.5 px-3 py-1 text-xs font-black uppercase tracking-wider rounded-lg transition-all ${activeTab === "preview" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:text-foreground"}`,
|
|
1563
1563
|
onClick: () => setActiveTab("preview"),
|
|
1564
1564
|
type: "button",
|
|
1565
1565
|
children: [
|
|
@@ -1571,11 +1571,11 @@ function MarkdownEditor({
|
|
|
1571
1571
|
] })
|
|
1572
1572
|
] }),
|
|
1573
1573
|
activeTab === "edit" ? /* @__PURE__ */ jsxs13("div", { className: "space-y-1.5 animate-in fade-in duration-200", children: [
|
|
1574
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1 bg-
|
|
1574
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1 bg-soft border border-input-line rounded-xl p-1.5", children: [
|
|
1575
1575
|
/* @__PURE__ */ jsx20(
|
|
1576
1576
|
"button",
|
|
1577
1577
|
{
|
|
1578
|
-
className: "p-1.5 hover:bg-
|
|
1578
|
+
className: "p-1.5 hover:bg-soft rounded-lg text-muted-foreground hover:text-foreground transition-colors",
|
|
1579
1579
|
onClick: () => handleInsertMarkdown("bold"),
|
|
1580
1580
|
title: "Bold",
|
|
1581
1581
|
type: "button",
|
|
@@ -1585,7 +1585,7 @@ function MarkdownEditor({
|
|
|
1585
1585
|
/* @__PURE__ */ jsx20(
|
|
1586
1586
|
"button",
|
|
1587
1587
|
{
|
|
1588
|
-
className: "p-1.5 hover:bg-
|
|
1588
|
+
className: "p-1.5 hover:bg-soft rounded-lg text-muted-foreground hover:text-foreground transition-colors",
|
|
1589
1589
|
onClick: () => handleInsertMarkdown("italic"),
|
|
1590
1590
|
title: "Italic",
|
|
1591
1591
|
type: "button",
|
|
@@ -1595,7 +1595,7 @@ function MarkdownEditor({
|
|
|
1595
1595
|
/* @__PURE__ */ jsx20(
|
|
1596
1596
|
"button",
|
|
1597
1597
|
{
|
|
1598
|
-
className: "p-1.5 hover:bg-
|
|
1598
|
+
className: "p-1.5 hover:bg-soft rounded-lg text-muted-foreground hover:text-foreground transition-colors",
|
|
1599
1599
|
onClick: () => handleInsertMarkdown("header"),
|
|
1600
1600
|
title: "Heading",
|
|
1601
1601
|
type: "button",
|
|
@@ -1605,7 +1605,7 @@ function MarkdownEditor({
|
|
|
1605
1605
|
/* @__PURE__ */ jsx20(
|
|
1606
1606
|
"button",
|
|
1607
1607
|
{
|
|
1608
|
-
className: "p-1.5 hover:bg-
|
|
1608
|
+
className: "p-1.5 hover:bg-soft rounded-lg text-muted-foreground hover:text-foreground transition-colors",
|
|
1609
1609
|
onClick: () => handleInsertMarkdown("code"),
|
|
1610
1610
|
title: "Code Block",
|
|
1611
1611
|
type: "button",
|
|
@@ -1615,7 +1615,7 @@ function MarkdownEditor({
|
|
|
1615
1615
|
/* @__PURE__ */ jsx20(
|
|
1616
1616
|
"button",
|
|
1617
1617
|
{
|
|
1618
|
-
className: "p-1.5 hover:bg-
|
|
1618
|
+
className: "p-1.5 hover:bg-soft rounded-lg text-muted-foreground hover:text-foreground transition-colors",
|
|
1619
1619
|
onClick: () => handleInsertMarkdown("list"),
|
|
1620
1620
|
title: "Bullet List",
|
|
1621
1621
|
type: "button",
|
|
@@ -1626,7 +1626,7 @@ function MarkdownEditor({
|
|
|
1626
1626
|
/* @__PURE__ */ jsx20(
|
|
1627
1627
|
"textarea",
|
|
1628
1628
|
{
|
|
1629
|
-
className: `w-full bg-
|
|
1629
|
+
className: `w-full bg-soft border border-input-line rounded-2xl p-4 text-sm focus:outline-none focus:border-primary/50 transition-all ${minHeight} resize-none font-mono placeholder:font-sans`,
|
|
1630
1630
|
onChange: (e) => onChange(e.target.value),
|
|
1631
1631
|
placeholder,
|
|
1632
1632
|
ref: textareaRef,
|
|
@@ -1637,7 +1637,7 @@ function MarkdownEditor({
|
|
|
1637
1637
|
] }) : /* @__PURE__ */ jsx20(
|
|
1638
1638
|
"div",
|
|
1639
1639
|
{
|
|
1640
|
-
className: `w-full bg-
|
|
1640
|
+
className: `w-full bg-background border border-line rounded-2xl p-4 text-sm ${minHeight} overflow-y-auto ${maxHeight} animate-in fade-in duration-200`,
|
|
1641
1641
|
children: value.trim() ? /* @__PURE__ */ jsx20(
|
|
1642
1642
|
"div",
|
|
1643
1643
|
{
|
|
@@ -1705,7 +1705,7 @@ function Modal({
|
|
|
1705
1705
|
"aria-labelledby": titleId,
|
|
1706
1706
|
"aria-modal": "true",
|
|
1707
1707
|
className: cn(
|
|
1708
|
-
"relative bg-card border border-
|
|
1708
|
+
"relative bg-card border border-line w-full rounded-3xl shadow-lift overflow-hidden",
|
|
1709
1709
|
SIZES2[size],
|
|
1710
1710
|
className
|
|
1711
1711
|
),
|
|
@@ -1713,7 +1713,7 @@ function Modal({
|
|
|
1713
1713
|
role: "dialog",
|
|
1714
1714
|
tabIndex: -1,
|
|
1715
1715
|
children: [
|
|
1716
|
-
/* @__PURE__ */ jsxs14("div", { className: "p-8 border-b border-
|
|
1716
|
+
/* @__PURE__ */ jsxs14("div", { className: "p-8 border-b border-line flex items-center justify-between gap-4 bg-soft", children: [
|
|
1717
1717
|
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
1718
1718
|
Icon && /* @__PURE__ */ jsx21("div", { className: "p-3 rounded-2xl bg-primary/10 text-primary shrink-0", children: /* @__PURE__ */ jsx21(Icon, { className: "w-6 h-6" }) }),
|
|
1719
1719
|
/* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
|
|
@@ -1739,7 +1739,7 @@ function Modal({
|
|
|
1739
1739
|
"button",
|
|
1740
1740
|
{
|
|
1741
1741
|
"aria-label": "Close",
|
|
1742
|
-
className: "p-3 hover:bg-
|
|
1742
|
+
className: "p-3 hover:bg-soft rounded-full transition-all text-muted-foreground hover:text-foreground shrink-0 disabled:opacity-50",
|
|
1743
1743
|
disabled: !dismissible,
|
|
1744
1744
|
onClick: onClose,
|
|
1745
1745
|
type: "button",
|
|
@@ -1810,7 +1810,7 @@ function PageHeader({
|
|
|
1810
1810
|
{
|
|
1811
1811
|
className: cn(
|
|
1812
1812
|
"flex flex-col md:flex-row md:items-center justify-between gap-4",
|
|
1813
|
-
bordered && "border-b border-
|
|
1813
|
+
bordered && "border-b border-line pb-6",
|
|
1814
1814
|
className
|
|
1815
1815
|
),
|
|
1816
1816
|
children: [
|
|
@@ -1900,7 +1900,7 @@ var SearchInput = forwardRef4(
|
|
|
1900
1900
|
"input",
|
|
1901
1901
|
{
|
|
1902
1902
|
"aria-label": ariaLabel ?? placeholder,
|
|
1903
|
-
className: "w-full bg-
|
|
1903
|
+
className: "w-full bg-soft border border-line rounded-2xl py-3 pl-11 pr-11 text-sm font-medium focus:outline-none focus:border-primary/50 transition-all",
|
|
1904
1904
|
onChange: (event) => onChange(event.target.value),
|
|
1905
1905
|
placeholder,
|
|
1906
1906
|
ref,
|
|
@@ -2085,7 +2085,7 @@ function Select({
|
|
|
2085
2085
|
/* @__PURE__ */ jsxs19(
|
|
2086
2086
|
"div",
|
|
2087
2087
|
{
|
|
2088
|
-
className: "fixed z-100 flex max-h-80 flex-col overflow-hidden rounded-2xl border border-
|
|
2088
|
+
className: "fixed z-100 flex max-h-80 flex-col overflow-hidden rounded-2xl border border-input-line bg-card shadow-xl shadow-ink/10",
|
|
2089
2089
|
"data-modal-portal-content": "",
|
|
2090
2090
|
ref: menuRef,
|
|
2091
2091
|
style: {
|
|
@@ -2094,7 +2094,7 @@ function Select({
|
|
|
2094
2094
|
width: menuRect.width
|
|
2095
2095
|
},
|
|
2096
2096
|
children: [
|
|
2097
|
-
/* @__PURE__ */ jsx26("div", { className: "shrink-0 border-b border-
|
|
2097
|
+
/* @__PURE__ */ jsx26("div", { className: "shrink-0 border-b border-input-line p-2", children: /* @__PURE__ */ jsxs19("div", { className: "relative", children: [
|
|
2098
2098
|
/* @__PURE__ */ jsx26(Search2, { className: "pointer-events-none absolute left-3 top-1/2 w-4 h-4 -translate-y-1/2 text-muted-foreground/60" }),
|
|
2099
2099
|
/* @__PURE__ */ jsx26(
|
|
2100
2100
|
Input,
|
|
@@ -2116,7 +2116,7 @@ function Select({
|
|
|
2116
2116
|
"aria-selected": option.value === value,
|
|
2117
2117
|
className: cn(
|
|
2118
2118
|
"w-full flex items-center px-4 py-2.5 text-sm text-left transition-colors",
|
|
2119
|
-
option.value === value ? "bg-primary/15 text-foreground font-bold" : "text-foreground/90 hover:bg-
|
|
2119
|
+
option.value === value ? "bg-primary/15 text-foreground font-bold" : "text-foreground/90 hover:bg-soft",
|
|
2120
2120
|
option.disabled && "opacity-50 pointer-events-none"
|
|
2121
2121
|
),
|
|
2122
2122
|
disabled: option.disabled,
|
|
@@ -2168,8 +2168,8 @@ function StatTile({
|
|
|
2168
2168
|
] })
|
|
2169
2169
|
] });
|
|
2170
2170
|
const classes = cn(
|
|
2171
|
-
"flex items-center gap-4 bg-card border border-
|
|
2172
|
-
active && "border-primary/30 bg-
|
|
2171
|
+
"flex items-center gap-4 bg-card border border-line p-6 rounded-3xl shadow-card hover:border-primary/20 transition-all group",
|
|
2172
|
+
active && "border-primary/30 bg-soft",
|
|
2173
2173
|
onClick && "cursor-pointer w-full",
|
|
2174
2174
|
className
|
|
2175
2175
|
);
|
|
@@ -2207,7 +2207,7 @@ function Switch({
|
|
|
2207
2207
|
"aria-label": label,
|
|
2208
2208
|
className: cn(
|
|
2209
2209
|
"relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:cursor-not-allowed disabled:opacity-50",
|
|
2210
|
-
checked ? TONES[tone] : "bg-
|
|
2210
|
+
checked ? TONES[tone] : "bg-muted"
|
|
2211
2211
|
),
|
|
2212
2212
|
disabled,
|
|
2213
2213
|
id,
|
|
@@ -2218,7 +2218,7 @@ function Switch({
|
|
|
2218
2218
|
"span",
|
|
2219
2219
|
{
|
|
2220
2220
|
className: cn(
|
|
2221
|
-
"pointer-events-none inline-block h-5 w-5 transform rounded-full bg-
|
|
2221
|
+
"pointer-events-none inline-block h-5 w-5 transform rounded-full bg-card shadow transition duration-200 ease-in-out",
|
|
2222
2222
|
checked ? "translate-x-5" : "translate-x-0"
|
|
2223
2223
|
)
|
|
2224
2224
|
}
|
|
@@ -2236,7 +2236,7 @@ function SettingRow({
|
|
|
2236
2236
|
"div",
|
|
2237
2237
|
{
|
|
2238
2238
|
className: cn(
|
|
2239
|
-
"flex items-center justify-between gap-4 p-4 bg-
|
|
2239
|
+
"flex items-center justify-between gap-4 p-4 bg-soft border border-input-line rounded-2xl",
|
|
2240
2240
|
className
|
|
2241
2241
|
),
|
|
2242
2242
|
children: [
|
|
@@ -2265,7 +2265,7 @@ function TableContainer({
|
|
|
2265
2265
|
"div",
|
|
2266
2266
|
{
|
|
2267
2267
|
className: cn(
|
|
2268
|
-
"bg-card border border-
|
|
2268
|
+
"bg-card border border-line rounded-3xl overflow-x-auto shadow-card",
|
|
2269
2269
|
className
|
|
2270
2270
|
),
|
|
2271
2271
|
...props
|
|
@@ -2291,7 +2291,7 @@ function TableHead({
|
|
|
2291
2291
|
return /* @__PURE__ */ jsx29(
|
|
2292
2292
|
"thead",
|
|
2293
2293
|
{
|
|
2294
|
-
className: cn("bg-
|
|
2294
|
+
className: cn("bg-soft border-b border-line", className),
|
|
2295
2295
|
...props
|
|
2296
2296
|
}
|
|
2297
2297
|
);
|
|
@@ -2300,7 +2300,7 @@ function TableBody({
|
|
|
2300
2300
|
className,
|
|
2301
2301
|
...props
|
|
2302
2302
|
}) {
|
|
2303
|
-
return /* @__PURE__ */ jsx29("tbody", { className: cn("divide-y divide-
|
|
2303
|
+
return /* @__PURE__ */ jsx29("tbody", { className: cn("divide-y divide-row-line", className), ...props });
|
|
2304
2304
|
}
|
|
2305
2305
|
function TableHeaderCell({
|
|
2306
2306
|
align = "left",
|
|
@@ -2326,7 +2326,7 @@ function TableRow({
|
|
|
2326
2326
|
return /* @__PURE__ */ jsx29(
|
|
2327
2327
|
"tr",
|
|
2328
2328
|
{
|
|
2329
|
-
className: cn("hover:bg-
|
|
2329
|
+
className: cn("hover:bg-row-hover transition-colors group", className),
|
|
2330
2330
|
...props
|
|
2331
2331
|
}
|
|
2332
2332
|
);
|
|
@@ -2398,7 +2398,7 @@ function Tabs({
|
|
|
2398
2398
|
"aria-label": label,
|
|
2399
2399
|
className: cn(
|
|
2400
2400
|
"flex flex-wrap gap-2",
|
|
2401
|
-
variant === "underline" && "border-b border-
|
|
2401
|
+
variant === "underline" && "border-b border-line gap-6",
|
|
2402
2402
|
className
|
|
2403
2403
|
),
|
|
2404
2404
|
role: "tablist",
|
|
@@ -2417,7 +2417,7 @@ function Tabs({
|
|
|
2417
2417
|
active ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
2418
2418
|
) : cn(
|
|
2419
2419
|
"px-4 py-2 rounded-xl",
|
|
2420
|
-
active ? "bg-primary/10 text-primary" : "bg-
|
|
2420
|
+
active ? "bg-primary/10 text-primary" : "bg-soft text-muted-foreground hover:text-foreground"
|
|
2421
2421
|
)
|
|
2422
2422
|
),
|
|
2423
2423
|
id: panelIdPrefix ? `${panelIdPrefix}-tab-${item.value}` : void 0,
|
|
@@ -2459,7 +2459,7 @@ var Textarea = forwardRef5(
|
|
|
2459
2459
|
"textarea",
|
|
2460
2460
|
{
|
|
2461
2461
|
className: cn(
|
|
2462
|
-
"w-full min-h-28 bg-
|
|
2462
|
+
"w-full min-h-28 bg-soft border border-input-line rounded-2xl p-4 text-sm font-medium focus:outline-none focus:border-primary/50 transition-all resize-y",
|
|
2463
2463
|
error && "border-error",
|
|
2464
2464
|
className
|
|
2465
2465
|
),
|