canvas-ui-sdk 0.3.11 → 0.3.13
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/dist/index.js +612 -1002
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Slot } from '@radix-ui/react-slot';
|
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
import * as React13 from 'react';
|
|
9
9
|
import React13__default, { createContext, useState, useContext, useEffect, useRef, Children, useMemo, useCallback } from 'react';
|
|
10
|
-
import { Check, Calendar as Calendar$1, Upload, FileText, Trash2, ChevronLeft, ChevronRight, X, Search, Layout, Settings, User, LogIn, List, MessageSquare, CreditCard, Video, Play, Table, LayoutGrid, Layers, SlidersHorizontal, Type, Users, Image, Star, Award, Hash, MapPin, Megaphone, Newspaper, Building, Square, CheckSquare, ToggleLeft, CircleDot, Tags, Key, Bell, Home, PieChart, ShoppingBag, Mail, Phone, MessageCircle, ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, XIcon, CheckIcon, CircleIcon, ChevronUpIcon, PanelLeftIcon, Info, ShoppingCart, LogOut, Menu, ChevronDown, Filter, Wand2, Paperclip, MoreHorizontal, PenSquare, Briefcase as Briefcase$1, MoreVertical, Minus, Plus, Instagram, Linkedin, Twitter, Facebook, Globe as Globe$1, DollarSign, BookOpen, Eye, CheckCircle, Zap, Camera as Camera$1, VideoOff, Mic, MicOff, Cast, Pencil, GripHorizontal, ChevronUp, Sparkles, Copy, ArrowRight, GitBranch, FileBox, ExternalLink, Target as Target$1, AlertCircle, Quote, ArrowUp, Heart as Heart$1, Link2, FolderPlus, ThumbsUp, ChevronsRight, ChevronsLeft, RefreshCw, Send, Bookmark } from 'lucide-react';
|
|
10
|
+
import { Check, Calendar as Calendar$1, Upload, FileText, Trash2, ChevronLeft, ChevronRight, X, Search, Layout, Settings, User, LogIn, List, MessageSquare, CreditCard, Video, Play, Table, LayoutGrid, Layers, SlidersHorizontal, Type, Users, Image, Star, Award, Hash, MapPin, Megaphone, Newspaper, Building, Square, CheckSquare, ToggleLeft, CircleDot, Tags, Key, Bell, Home, PieChart, ShoppingBag, Mail, Phone, MessageCircle, ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, XIcon, CheckIcon, CircleIcon, ChevronUpIcon, PanelLeftIcon, Info, ShoppingCart, LogOut, Menu, ChevronDown, Filter, Wand2, Paperclip, MoreHorizontal, PenSquare, Briefcase as Briefcase$1, MoreVertical, Minus, Plus, Instagram, Linkedin, Twitter, Facebook, Globe as Globe$1, DollarSign, BookOpen, Eye, CheckCircle, Zap, Camera as Camera$1, VideoOff, Mic, MicOff, Cast, Pencil, GripHorizontal, ChevronUp, Sparkles, Copy, ArrowRight, GitBranch, FileBox, ExternalLink, Target as Target$1, AlertCircle, Quote, GripVertical, ArrowUp, Heart as Heart$1, Link2, FolderPlus, ThumbsUp, ChevronsRight, ChevronsLeft, RefreshCw, Send, Bookmark } from 'lucide-react';
|
|
11
11
|
import { getDefaultClassNames, DayPicker } from 'react-day-picker';
|
|
12
12
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
13
13
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
@@ -25166,19 +25166,45 @@ function VariableColorRow({
|
|
|
25166
25166
|
padding: "8px 0"
|
|
25167
25167
|
},
|
|
25168
25168
|
children: [
|
|
25169
|
-
/* @__PURE__ */
|
|
25170
|
-
|
|
25171
|
-
|
|
25172
|
-
|
|
25173
|
-
|
|
25174
|
-
|
|
25175
|
-
|
|
25176
|
-
|
|
25177
|
-
|
|
25178
|
-
|
|
25169
|
+
/* @__PURE__ */ jsxs(Popover, { children: [
|
|
25170
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
25171
|
+
"button",
|
|
25172
|
+
{
|
|
25173
|
+
style: {
|
|
25174
|
+
width: "24px",
|
|
25175
|
+
height: "24px",
|
|
25176
|
+
borderRadius: "4px",
|
|
25177
|
+
border: "1px solid #e5e7eb",
|
|
25178
|
+
flexShrink: 0,
|
|
25179
|
+
backgroundColor: resolvedColor,
|
|
25180
|
+
cursor: "pointer",
|
|
25181
|
+
transition: "transform 150ms"
|
|
25182
|
+
},
|
|
25183
|
+
onMouseEnter: (e) => {
|
|
25184
|
+
e.currentTarget.style.transform = "scale(1.05)";
|
|
25185
|
+
},
|
|
25186
|
+
onMouseLeave: (e) => {
|
|
25187
|
+
e.currentTarget.style.transform = "scale(1)";
|
|
25188
|
+
},
|
|
25189
|
+
"aria-label": `Edit ${label} color`
|
|
25179
25190
|
}
|
|
25180
|
-
}
|
|
25181
|
-
|
|
25191
|
+
) }),
|
|
25192
|
+
/* @__PURE__ */ jsx(
|
|
25193
|
+
PopoverContent,
|
|
25194
|
+
{
|
|
25195
|
+
className: "w-auto p-0",
|
|
25196
|
+
align: "start",
|
|
25197
|
+
onPointerDownOutside: (e) => e.preventDefault(),
|
|
25198
|
+
children: /* @__PURE__ */ jsx(
|
|
25199
|
+
HslColorPicker,
|
|
25200
|
+
{
|
|
25201
|
+
value: isVariable ? resolvedColor : value,
|
|
25202
|
+
onChange: (hex) => onChange(hex)
|
|
25203
|
+
}
|
|
25204
|
+
)
|
|
25205
|
+
}
|
|
25206
|
+
)
|
|
25207
|
+
] }),
|
|
25182
25208
|
/* @__PURE__ */ jsx(
|
|
25183
25209
|
"span",
|
|
25184
25210
|
{
|
|
@@ -25192,93 +25218,110 @@ function VariableColorRow({
|
|
|
25192
25218
|
}
|
|
25193
25219
|
),
|
|
25194
25220
|
/* @__PURE__ */ jsxs(
|
|
25195
|
-
|
|
25221
|
+
Select,
|
|
25196
25222
|
{
|
|
25197
25223
|
value: selectValue,
|
|
25198
|
-
|
|
25199
|
-
if (
|
|
25224
|
+
onValueChange: (v) => {
|
|
25225
|
+
if (v === "__custom__") {
|
|
25200
25226
|
onChange("#000000");
|
|
25201
25227
|
} else {
|
|
25202
|
-
onChange(
|
|
25228
|
+
onChange(v);
|
|
25203
25229
|
}
|
|
25204
25230
|
},
|
|
25231
|
+
children: [
|
|
25232
|
+
/* @__PURE__ */ jsx(
|
|
25233
|
+
SelectTrigger,
|
|
25234
|
+
{
|
|
25235
|
+
inputSize: "sm",
|
|
25236
|
+
className: "max-w-[140px] bg-white",
|
|
25237
|
+
style: { flexShrink: 0 },
|
|
25238
|
+
children: /* @__PURE__ */ jsx(SelectValue, { children: selectedOption ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
25239
|
+
/* @__PURE__ */ jsx(
|
|
25240
|
+
"span",
|
|
25241
|
+
{
|
|
25242
|
+
className: "w-2.5 h-2.5 rounded-sm border shrink-0",
|
|
25243
|
+
style: {
|
|
25244
|
+
backgroundColor: resolvedColor,
|
|
25245
|
+
borderColor: "#e5e7eb"
|
|
25246
|
+
}
|
|
25247
|
+
}
|
|
25248
|
+
),
|
|
25249
|
+
selectedOption.label
|
|
25250
|
+
] }) : "Custom" })
|
|
25251
|
+
}
|
|
25252
|
+
),
|
|
25253
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
25254
|
+
variableOptions.map((opt) => /* @__PURE__ */ jsx(SelectItem, { value: opt.value, className: "text-xs", children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
25255
|
+
/* @__PURE__ */ jsx(
|
|
25256
|
+
"span",
|
|
25257
|
+
{
|
|
25258
|
+
className: "w-3 h-3 rounded-sm border shrink-0",
|
|
25259
|
+
style: {
|
|
25260
|
+
backgroundColor: resolveBrandingColor(opt.value),
|
|
25261
|
+
borderColor: "#e5e7eb"
|
|
25262
|
+
}
|
|
25263
|
+
}
|
|
25264
|
+
),
|
|
25265
|
+
opt.label
|
|
25266
|
+
] }) }, opt.value)),
|
|
25267
|
+
/* @__PURE__ */ jsx(SelectItem, { value: "__custom__", className: "text-xs", children: "Custom" })
|
|
25268
|
+
] })
|
|
25269
|
+
]
|
|
25270
|
+
}
|
|
25271
|
+
),
|
|
25272
|
+
!isVariable && /* @__PURE__ */ jsx(
|
|
25273
|
+
"input",
|
|
25274
|
+
{
|
|
25275
|
+
type: "text",
|
|
25276
|
+
value,
|
|
25277
|
+
onChange: (e) => {
|
|
25278
|
+
let hex = e.target.value;
|
|
25279
|
+
if (hex && !hex.startsWith("#")) hex = "#" + hex;
|
|
25280
|
+
if (/^#[0-9A-Fa-f]{0,6}$/.test(hex)) onChange(hex);
|
|
25281
|
+
},
|
|
25205
25282
|
style: {
|
|
25206
|
-
|
|
25283
|
+
width: "72px",
|
|
25207
25284
|
fontSize: "11px",
|
|
25208
|
-
|
|
25285
|
+
fontFamily: "monospace",
|
|
25286
|
+
padding: "4px 6px",
|
|
25209
25287
|
border: "1px solid #e5e7eb",
|
|
25210
25288
|
borderRadius: "4px",
|
|
25211
25289
|
color: "#374151",
|
|
25212
25290
|
background: "#ffffff",
|
|
25213
|
-
|
|
25214
|
-
|
|
25215
|
-
maxWidth: "120px"
|
|
25291
|
+
textTransform: "uppercase",
|
|
25292
|
+
textAlign: "center"
|
|
25216
25293
|
},
|
|
25217
|
-
|
|
25218
|
-
variableOptions.map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, children: opt.label }, opt.value)),
|
|
25219
|
-
/* @__PURE__ */ jsx("option", { value: "__custom__", children: "Custom" })
|
|
25220
|
-
]
|
|
25294
|
+
placeholder: "#000000"
|
|
25221
25295
|
}
|
|
25222
|
-
)
|
|
25223
|
-
!isVariable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25224
|
-
/* @__PURE__ */ jsxs(Popover, { children: [
|
|
25225
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
25226
|
-
"button",
|
|
25227
|
-
{
|
|
25228
|
-
style: {
|
|
25229
|
-
width: "24px",
|
|
25230
|
-
height: "24px",
|
|
25231
|
-
borderRadius: "4px",
|
|
25232
|
-
border: "1px solid #e5e7eb",
|
|
25233
|
-
cursor: "pointer",
|
|
25234
|
-
flexShrink: 0,
|
|
25235
|
-
backgroundColor: value
|
|
25236
|
-
},
|
|
25237
|
-
"aria-label": `Edit ${label} color`
|
|
25238
|
-
}
|
|
25239
|
-
) }),
|
|
25240
|
-
/* @__PURE__ */ jsx(
|
|
25241
|
-
PopoverContent,
|
|
25242
|
-
{
|
|
25243
|
-
className: "w-auto p-0",
|
|
25244
|
-
align: "start",
|
|
25245
|
-
onPointerDownOutside: (e) => e.preventDefault(),
|
|
25246
|
-
children: /* @__PURE__ */ jsx(HslColorPicker, { value, onChange })
|
|
25247
|
-
}
|
|
25248
|
-
)
|
|
25249
|
-
] }),
|
|
25250
|
-
/* @__PURE__ */ jsx(
|
|
25251
|
-
"input",
|
|
25252
|
-
{
|
|
25253
|
-
type: "text",
|
|
25254
|
-
value,
|
|
25255
|
-
onChange: (e) => {
|
|
25256
|
-
let hex = e.target.value;
|
|
25257
|
-
if (hex && !hex.startsWith("#")) hex = "#" + hex;
|
|
25258
|
-
if (/^#[0-9A-Fa-f]{0,6}$/.test(hex)) onChange(hex);
|
|
25259
|
-
},
|
|
25260
|
-
style: {
|
|
25261
|
-
width: "72px",
|
|
25262
|
-
fontSize: "11px",
|
|
25263
|
-
fontFamily: "monospace",
|
|
25264
|
-
padding: "4px 6px",
|
|
25265
|
-
border: "1px solid #e5e7eb",
|
|
25266
|
-
borderRadius: "4px",
|
|
25267
|
-
color: "#374151",
|
|
25268
|
-
background: "#ffffff",
|
|
25269
|
-
textTransform: "uppercase",
|
|
25270
|
-
textAlign: "center"
|
|
25271
|
-
},
|
|
25272
|
-
placeholder: "#000000"
|
|
25273
|
-
}
|
|
25274
|
-
)
|
|
25275
|
-
] })
|
|
25296
|
+
)
|
|
25276
25297
|
]
|
|
25277
25298
|
}
|
|
25278
25299
|
);
|
|
25279
25300
|
}
|
|
25280
25301
|
function ColorsPanel({ theme }) {
|
|
25302
|
+
const resolvedPrimary = resolveBrandingColor("var(--canvas-primary)");
|
|
25281
25303
|
return /* @__PURE__ */ jsxs("div", { "data-theme-drawer-panel": true, className: "flex flex-col gap-6 p-4", children: [
|
|
25304
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
25305
|
+
[data-theme-drawer-panel] input[type=range]::-webkit-slider-thumb {
|
|
25306
|
+
-webkit-appearance: none;
|
|
25307
|
+
width: 16px;
|
|
25308
|
+
height: 16px;
|
|
25309
|
+
border-radius: 50%;
|
|
25310
|
+
background: ${resolvedPrimary};
|
|
25311
|
+
border: 2px solid #ffffff;
|
|
25312
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
|
25313
|
+
cursor: pointer;
|
|
25314
|
+
}
|
|
25315
|
+
[data-theme-drawer-panel] input[type=range]::-moz-range-thumb {
|
|
25316
|
+
width: 12px;
|
|
25317
|
+
height: 12px;
|
|
25318
|
+
border-radius: 50%;
|
|
25319
|
+
background: ${resolvedPrimary};
|
|
25320
|
+
border: 2px solid #ffffff;
|
|
25321
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
|
25322
|
+
cursor: pointer;
|
|
25323
|
+
}
|
|
25324
|
+
` }),
|
|
25282
25325
|
/* @__PURE__ */ jsxs(
|
|
25283
25326
|
"div",
|
|
25284
25327
|
{
|
|
@@ -25314,9 +25357,7 @@ function ColorsPanel({ theme }) {
|
|
|
25314
25357
|
const hsl = hexToHsl2(hex);
|
|
25315
25358
|
theme.setBrandHue(hsl.h);
|
|
25316
25359
|
theme.setBrandVibrancy(1);
|
|
25317
|
-
|
|
25318
|
-
theme.applyBrandHueVibrancy(hsl.h, 1, true);
|
|
25319
|
-
}
|
|
25360
|
+
theme.applyBrandHueVibrancy(hsl.h, 1, true);
|
|
25320
25361
|
}
|
|
25321
25362
|
}
|
|
25322
25363
|
}
|
|
@@ -25356,9 +25397,7 @@ function ColorsPanel({ theme }) {
|
|
|
25356
25397
|
onChange: (e) => {
|
|
25357
25398
|
const newHue = parseInt(e.target.value);
|
|
25358
25399
|
theme.setBrandHue(newHue);
|
|
25359
|
-
|
|
25360
|
-
theme.applyBrandHueVibrancy(newHue, theme.brandVibrancy);
|
|
25361
|
-
}
|
|
25400
|
+
theme.applyBrandHueVibrancy(newHue, theme.brandVibrancy);
|
|
25362
25401
|
},
|
|
25363
25402
|
style: {
|
|
25364
25403
|
width: "100%",
|
|
@@ -25372,7 +25411,7 @@ function ColorsPanel({ theme }) {
|
|
|
25372
25411
|
}
|
|
25373
25412
|
)
|
|
25374
25413
|
] }),
|
|
25375
|
-
/* @__PURE__ */ jsxs("div", {
|
|
25414
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
25376
25415
|
/* @__PURE__ */ jsxs(
|
|
25377
25416
|
"div",
|
|
25378
25417
|
{
|
|
@@ -25407,9 +25446,7 @@ function ColorsPanel({ theme }) {
|
|
|
25407
25446
|
onChange: (e) => {
|
|
25408
25447
|
const newVibrancy = parseInt(e.target.value) / 100;
|
|
25409
25448
|
theme.setBrandVibrancy(newVibrancy);
|
|
25410
|
-
|
|
25411
|
-
theme.applyBrandHueVibrancy(theme.brandHue, newVibrancy, true);
|
|
25412
|
-
}
|
|
25449
|
+
theme.applyBrandHueVibrancy(theme.brandHue, newVibrancy, true);
|
|
25413
25450
|
},
|
|
25414
25451
|
style: {
|
|
25415
25452
|
width: "100%",
|
|
@@ -25422,32 +25459,7 @@ function ColorsPanel({ theme }) {
|
|
|
25422
25459
|
}
|
|
25423
25460
|
}
|
|
25424
25461
|
)
|
|
25425
|
-
] })
|
|
25426
|
-
/* @__PURE__ */ jsxs(
|
|
25427
|
-
"label",
|
|
25428
|
-
{
|
|
25429
|
-
style: {
|
|
25430
|
-
display: "flex",
|
|
25431
|
-
alignItems: "center",
|
|
25432
|
-
gap: "8px",
|
|
25433
|
-
cursor: "pointer",
|
|
25434
|
-
fontSize: "13px",
|
|
25435
|
-
color: "#374151"
|
|
25436
|
-
},
|
|
25437
|
-
children: [
|
|
25438
|
-
/* @__PURE__ */ jsx(
|
|
25439
|
-
"input",
|
|
25440
|
-
{
|
|
25441
|
-
type: "checkbox",
|
|
25442
|
-
checked: theme.syncRelatedColors,
|
|
25443
|
-
onChange: (e) => theme.setSyncRelatedColors(e.target.checked),
|
|
25444
|
-
style: { width: "16px", height: "16px", cursor: "pointer" }
|
|
25445
|
-
}
|
|
25446
|
-
),
|
|
25447
|
-
"Apply to related colors"
|
|
25448
|
-
]
|
|
25449
|
-
}
|
|
25450
|
-
)
|
|
25462
|
+
] })
|
|
25451
25463
|
]
|
|
25452
25464
|
}
|
|
25453
25465
|
),
|
|
@@ -25572,6 +25584,7 @@ function ImagesPanel({ theme, onImageUpload }) {
|
|
|
25572
25584
|
const currentShape = iconShapes6.find((s) => s.id === theme.branding.iconShape) ?? iconShapes6[0];
|
|
25573
25585
|
const resolvedBgColor = resolveBrandingColor(theme.branding.bgColor);
|
|
25574
25586
|
const resolvedIconColor = resolveBrandingColor(theme.branding.iconColor);
|
|
25587
|
+
const resolvedPrimary = resolveBrandingColor("var(--canvas-primary)");
|
|
25575
25588
|
const SelectedIcon = logoIcons.find((i) => i.name === theme.branding.iconName)?.icon ?? Buildings;
|
|
25576
25589
|
return /* @__PURE__ */ jsxs("div", { "data-theme-drawer-panel": true, style: { display: "flex", flexDirection: "column", gap: "24px", padding: "16px" }, children: [
|
|
25577
25590
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -25750,8 +25763,8 @@ function ImagesPanel({ theme, onImageUpload }) {
|
|
|
25750
25763
|
alignItems: "center",
|
|
25751
25764
|
justifyContent: "center",
|
|
25752
25765
|
borderRadius: "6px",
|
|
25753
|
-
border: isSelected ?
|
|
25754
|
-
background: isSelected ?
|
|
25766
|
+
border: isSelected ? `2px solid ${resolvedPrimary}` : "1px solid transparent",
|
|
25767
|
+
background: isSelected ? resolvedPrimary : "transparent",
|
|
25755
25768
|
cursor: "pointer",
|
|
25756
25769
|
padding: 0,
|
|
25757
25770
|
transition: "background 100ms, border-color 100ms"
|
|
@@ -25923,20 +25936,22 @@ function ImageUploadRow({
|
|
|
25923
25936
|
style: {
|
|
25924
25937
|
fontSize: "12px",
|
|
25925
25938
|
fontWeight: 500,
|
|
25926
|
-
color: "#
|
|
25927
|
-
background: "#
|
|
25928
|
-
border: "1px solid #
|
|
25939
|
+
color: "#374151",
|
|
25940
|
+
background: "#f9fafb",
|
|
25941
|
+
border: "1px solid #e5e7eb",
|
|
25929
25942
|
borderRadius: "4px",
|
|
25930
25943
|
padding: "4px 10px",
|
|
25931
25944
|
cursor: "pointer",
|
|
25932
25945
|
flexShrink: 0,
|
|
25933
|
-
transition: "background 100ms"
|
|
25946
|
+
transition: "background 100ms, border-color 100ms"
|
|
25934
25947
|
},
|
|
25935
25948
|
onMouseEnter: (e) => {
|
|
25936
|
-
e.currentTarget.style.background = "#
|
|
25949
|
+
e.currentTarget.style.background = "#f3f4f6";
|
|
25950
|
+
e.currentTarget.style.borderColor = "#d1d5db";
|
|
25937
25951
|
},
|
|
25938
25952
|
onMouseLeave: (e) => {
|
|
25939
|
-
e.currentTarget.style.background = "#
|
|
25953
|
+
e.currentTarget.style.background = "#f9fafb";
|
|
25954
|
+
e.currentTarget.style.borderColor = "#e5e7eb";
|
|
25940
25955
|
},
|
|
25941
25956
|
children: "Upload"
|
|
25942
25957
|
}
|
|
@@ -25980,11 +25995,20 @@ function ImageUploadRow({
|
|
|
25980
25995
|
);
|
|
25981
25996
|
}
|
|
25982
25997
|
var typographyColorOptions = [
|
|
25998
|
+
// Text colors
|
|
25983
25999
|
{ value: "var(--canvas-text)", label: "Text" },
|
|
25984
26000
|
{ value: "var(--canvas-text-muted)", label: "Text Muted" },
|
|
25985
26001
|
{ value: "var(--canvas-text-placeholder)", label: "Placeholder" },
|
|
26002
|
+
// Brand colors
|
|
25986
26003
|
{ value: "var(--canvas-primary)", label: "Primary" },
|
|
25987
|
-
{ value: "var(--canvas-
|
|
26004
|
+
{ value: "var(--canvas-primary-dark)", label: "Primary Dark" },
|
|
26005
|
+
{ value: "var(--canvas-primary-foreground)", label: "Primary Text" },
|
|
26006
|
+
{ value: "var(--canvas-destructive)", label: "Destructive" },
|
|
26007
|
+
// Sidebar colors
|
|
26008
|
+
{ value: "var(--canvas-sidebar-light-text)", label: "Sidebar Light Text" },
|
|
26009
|
+
{ value: "var(--canvas-sidebar-light-active-text)", label: "Sidebar Light Active Text" },
|
|
26010
|
+
{ value: "var(--canvas-sidebar-dark-text)", label: "Sidebar Dark Text" },
|
|
26011
|
+
{ value: "var(--canvas-sidebar-dark-active-text)", label: "Sidebar Dark Active Text" }
|
|
25988
26012
|
];
|
|
25989
26013
|
var generalPurposeStyles = [
|
|
25990
26014
|
{ prefix: "h1", label: "H1", description: "Hero headlines" },
|
|
@@ -26000,119 +26024,53 @@ var generalPurposeStyles = [
|
|
|
26000
26024
|
{ prefix: "body-xs", label: "Body XS", description: "Fine print, labels" }
|
|
26001
26025
|
];
|
|
26002
26026
|
var componentStyles = [
|
|
26003
|
-
{ prefix: "menu-label", label: "Menu Label" },
|
|
26004
|
-
{ prefix: "sidebar-label", label: "Sidebar Label" },
|
|
26005
|
-
{ prefix: "sidebar-tab", label: "Sidebar Tab" },
|
|
26006
|
-
{ prefix: "sidebar-subtab", label: "Sidebar Subtab" },
|
|
26007
|
-
{ prefix: "header", label: "Header" },
|
|
26008
|
-
{ prefix: "input-label", label: "Input Label" },
|
|
26009
|
-
{ prefix: "button", label: "Button" }
|
|
26027
|
+
{ prefix: "menu-label", label: "Menu Label", description: "Expandable menu items" },
|
|
26028
|
+
{ prefix: "sidebar-label", label: "Sidebar Label", description: "Section titles" },
|
|
26029
|
+
{ prefix: "sidebar-tab", label: "Sidebar Tab", description: "Navigation items" },
|
|
26030
|
+
{ prefix: "sidebar-subtab", label: "Sidebar Subtab", description: "Nested navigation" },
|
|
26031
|
+
{ prefix: "header", label: "Header", description: "Header navigation text" },
|
|
26032
|
+
{ prefix: "input-label", label: "Input Label", description: "Form field labels" },
|
|
26033
|
+
{ prefix: "button", label: "Button", description: "All button labels" }
|
|
26010
26034
|
];
|
|
26011
26035
|
function TypographyPanel({ theme }) {
|
|
26012
26036
|
useEffect(() => {
|
|
26013
26037
|
preloadAllFonts();
|
|
26014
26038
|
}, []);
|
|
26015
26039
|
const globalFont = theme.variables["--typo-global-font"] || "Inter";
|
|
26016
|
-
return /* @__PURE__ */ jsxs("div", { "data-theme-drawer-panel": true,
|
|
26017
|
-
/* @__PURE__ */ jsxs(
|
|
26018
|
-
"div",
|
|
26019
|
-
|
|
26020
|
-
|
|
26021
|
-
|
|
26022
|
-
|
|
26023
|
-
|
|
26024
|
-
padding: "12px",
|
|
26025
|
-
background: "#f9fafb",
|
|
26026
|
-
borderRadius: "8px",
|
|
26027
|
-
border: "1px solid #e5e7eb",
|
|
26028
|
-
marginBottom: "20px"
|
|
26029
|
-
},
|
|
26030
|
-
children: [
|
|
26031
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
26032
|
-
/* @__PURE__ */ jsx(
|
|
26033
|
-
"div",
|
|
26034
|
-
{
|
|
26035
|
-
style: {
|
|
26036
|
-
fontSize: "13px",
|
|
26037
|
-
fontWeight: 600,
|
|
26038
|
-
color: "#374151"
|
|
26039
|
-
},
|
|
26040
|
-
children: "Global Font"
|
|
26041
|
-
}
|
|
26042
|
-
),
|
|
26043
|
-
/* @__PURE__ */ jsx(
|
|
26044
|
-
"div",
|
|
26045
|
-
{
|
|
26046
|
-
style: {
|
|
26047
|
-
fontSize: "11px",
|
|
26048
|
-
color: "#6b7280",
|
|
26049
|
-
marginTop: "2px"
|
|
26050
|
-
},
|
|
26051
|
-
children: "Default font for all text styles"
|
|
26052
|
-
}
|
|
26053
|
-
)
|
|
26054
|
-
] }),
|
|
26055
|
-
/* @__PURE__ */ jsx(
|
|
26056
|
-
"select",
|
|
26057
|
-
{
|
|
26058
|
-
value: globalFont,
|
|
26059
|
-
onChange: (e) => {
|
|
26060
|
-
const v = e.target.value;
|
|
26061
|
-
loadGoogleFont(v);
|
|
26062
|
-
theme.setVariable("--typo-global-font", v);
|
|
26063
|
-
},
|
|
26064
|
-
style: {
|
|
26065
|
-
height: "32px",
|
|
26066
|
-
fontSize: "12px",
|
|
26067
|
-
padding: "0 8px",
|
|
26068
|
-
border: "1px solid #e5e7eb",
|
|
26069
|
-
borderRadius: "6px",
|
|
26070
|
-
color: "#374151",
|
|
26071
|
-
background: "#ffffff",
|
|
26072
|
-
cursor: "pointer",
|
|
26073
|
-
maxWidth: "180px"
|
|
26074
|
-
},
|
|
26075
|
-
children: fontOptions.map((f) => /* @__PURE__ */ jsx(
|
|
26076
|
-
"option",
|
|
26077
|
-
{
|
|
26078
|
-
value: f.value,
|
|
26079
|
-
style: { fontFamily: f.value },
|
|
26080
|
-
children: f.label
|
|
26081
|
-
},
|
|
26082
|
-
f.value
|
|
26083
|
-
))
|
|
26084
|
-
}
|
|
26085
|
-
)
|
|
26086
|
-
]
|
|
26087
|
-
}
|
|
26088
|
-
),
|
|
26089
|
-
/* @__PURE__ */ jsxs("div", { style: { marginBottom: "20px" }, children: [
|
|
26090
|
-
/* @__PURE__ */ jsx(
|
|
26091
|
-
"h3",
|
|
26092
|
-
{
|
|
26093
|
-
style: {
|
|
26094
|
-
fontSize: "11px",
|
|
26095
|
-
fontWeight: 600,
|
|
26096
|
-
color: "#6b7280",
|
|
26097
|
-
textTransform: "uppercase",
|
|
26098
|
-
letterSpacing: "0.05em",
|
|
26099
|
-
marginBottom: "4px"
|
|
26100
|
-
},
|
|
26101
|
-
children: "General Purpose"
|
|
26102
|
-
}
|
|
26103
|
-
),
|
|
26104
|
-
/* @__PURE__ */ jsx(
|
|
26105
|
-
"p",
|
|
26040
|
+
return /* @__PURE__ */ jsxs("div", { "data-theme-drawer-panel": true, className: "p-4", children: [
|
|
26041
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-3 bg-[var(--canvas-surface)] rounded-lg border border-[var(--canvas-border)] mb-5", children: [
|
|
26042
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
26043
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm font-semibold text-[var(--canvas-text)]", children: "Global Font" }),
|
|
26044
|
+
/* @__PURE__ */ jsx("div", { className: "text-[11px] text-[var(--canvas-text-muted)] mt-0.5", children: "Default font for all text styles" })
|
|
26045
|
+
] }),
|
|
26046
|
+
/* @__PURE__ */ jsxs(
|
|
26047
|
+
Select,
|
|
26106
26048
|
{
|
|
26107
|
-
|
|
26108
|
-
|
|
26109
|
-
|
|
26110
|
-
|
|
26049
|
+
value: globalFont,
|
|
26050
|
+
onValueChange: (v) => {
|
|
26051
|
+
loadGoogleFont(v);
|
|
26052
|
+
theme.setVariable("--typo-global-font", v);
|
|
26111
26053
|
},
|
|
26112
|
-
children:
|
|
26054
|
+
children: [
|
|
26055
|
+
/* @__PURE__ */ jsx(SelectTrigger, { inputSize: "sm", className: "w-44 bg-white", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
26056
|
+
/* @__PURE__ */ jsx(SelectContent, { children: fontOptions.map((f) => /* @__PURE__ */ jsx(
|
|
26057
|
+
SelectItem,
|
|
26058
|
+
{
|
|
26059
|
+
value: f.value,
|
|
26060
|
+
className: "text-xs",
|
|
26061
|
+
style: { fontFamily: f.value },
|
|
26062
|
+
children: f.label
|
|
26063
|
+
},
|
|
26064
|
+
f.value
|
|
26065
|
+
)) })
|
|
26066
|
+
]
|
|
26113
26067
|
}
|
|
26114
|
-
)
|
|
26115
|
-
|
|
26068
|
+
)
|
|
26069
|
+
] }),
|
|
26070
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-5", children: [
|
|
26071
|
+
/* @__PURE__ */ jsx("h3", { className: "text-[11px] font-semibold text-[var(--canvas-text-muted)] uppercase tracking-wide mb-1", children: "General Purpose" }),
|
|
26072
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-[var(--canvas-text-muted)] mb-3", children: "Headings and body text used across the application." }),
|
|
26073
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col", children: generalPurposeStyles.map((s) => /* @__PURE__ */ jsx(
|
|
26116
26074
|
TypographyRow,
|
|
26117
26075
|
{
|
|
26118
26076
|
config: s,
|
|
@@ -26124,32 +26082,9 @@ function TypographyPanel({ theme }) {
|
|
|
26124
26082
|
)) })
|
|
26125
26083
|
] }),
|
|
26126
26084
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
26127
|
-
/* @__PURE__ */ jsx(
|
|
26128
|
-
|
|
26129
|
-
|
|
26130
|
-
style: {
|
|
26131
|
-
fontSize: "11px",
|
|
26132
|
-
fontWeight: 600,
|
|
26133
|
-
color: "#6b7280",
|
|
26134
|
-
textTransform: "uppercase",
|
|
26135
|
-
letterSpacing: "0.05em",
|
|
26136
|
-
marginBottom: "4px"
|
|
26137
|
-
},
|
|
26138
|
-
children: "Component-Specific"
|
|
26139
|
-
}
|
|
26140
|
-
),
|
|
26141
|
-
/* @__PURE__ */ jsx(
|
|
26142
|
-
"p",
|
|
26143
|
-
{
|
|
26144
|
-
style: {
|
|
26145
|
-
fontSize: "11px",
|
|
26146
|
-
color: "#6b7280",
|
|
26147
|
-
marginBottom: "12px"
|
|
26148
|
-
},
|
|
26149
|
-
children: "Typography styles scoped to specific UI components."
|
|
26150
|
-
}
|
|
26151
|
-
),
|
|
26152
|
-
/* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: componentStyles.map((s) => /* @__PURE__ */ jsx(
|
|
26085
|
+
/* @__PURE__ */ jsx("h3", { className: "text-[11px] font-semibold text-[var(--canvas-text-muted)] uppercase tracking-wide mb-1", children: "Component-Specific" }),
|
|
26086
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-[var(--canvas-text-muted)] mb-3", children: "Typography styles scoped to specific UI components." }),
|
|
26087
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col", children: componentStyles.map((s) => /* @__PURE__ */ jsx(
|
|
26153
26088
|
TypographyRow,
|
|
26154
26089
|
{
|
|
26155
26090
|
config: s,
|
|
@@ -26171,334 +26106,166 @@ function TypographyRow({
|
|
|
26171
26106
|
const [expanded, setExpanded] = useState(false);
|
|
26172
26107
|
const { prefix, label, description } = config;
|
|
26173
26108
|
const varKey = (suffix) => `--typo-${prefix}-${suffix}`;
|
|
26174
|
-
|
|
26175
|
-
|
|
26176
|
-
|
|
26177
|
-
|
|
26178
|
-
|
|
26179
|
-
|
|
26180
|
-
|
|
26181
|
-
|
|
26182
|
-
|
|
26183
|
-
|
|
26184
|
-
|
|
26185
|
-
|
|
26186
|
-
|
|
26187
|
-
|
|
26188
|
-
|
|
26189
|
-
|
|
26190
|
-
|
|
26191
|
-
|
|
26192
|
-
|
|
26193
|
-
|
|
26194
|
-
|
|
26195
|
-
|
|
26196
|
-
|
|
26197
|
-
|
|
26198
|
-
|
|
26199
|
-
|
|
26200
|
-
|
|
26201
|
-
|
|
26202
|
-
|
|
26203
|
-
|
|
26204
|
-
|
|
26205
|
-
|
|
26206
|
-
|
|
26207
|
-
|
|
26208
|
-
|
|
26209
|
-
|
|
26210
|
-
|
|
26211
|
-
|
|
26212
|
-
|
|
26213
|
-
|
|
26214
|
-
|
|
26215
|
-
|
|
26216
|
-
|
|
26109
|
+
const font = theme.variables[varKey("font")] ?? "";
|
|
26110
|
+
const weight = theme.variables[varKey("weight")] ?? defaultTypography[varKey("weight")] ?? "";
|
|
26111
|
+
const spacing = theme.variables[varKey("spacing")] ?? defaultTypography[varKey("spacing")] ?? "";
|
|
26112
|
+
const color = theme.variables[varKey("color")] ?? defaultTypography[varKey("color")] ?? "var(--canvas-text)";
|
|
26113
|
+
const effectiveFont = font || globalFont;
|
|
26114
|
+
const resolvedColor = resolveBrandingColor(color);
|
|
26115
|
+
return /* @__PURE__ */ jsxs("div", { className: "py-3 border-b border-[var(--canvas-border)] last:border-b-0", children: [
|
|
26116
|
+
/* @__PURE__ */ jsxs(
|
|
26117
|
+
"button",
|
|
26118
|
+
{
|
|
26119
|
+
type: "button",
|
|
26120
|
+
onClick: () => setExpanded(!expanded),
|
|
26121
|
+
className: "w-full flex items-center justify-between gap-3 text-left cursor-pointer",
|
|
26122
|
+
children: [
|
|
26123
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
26124
|
+
/* @__PURE__ */ jsx(
|
|
26125
|
+
"span",
|
|
26126
|
+
{
|
|
26127
|
+
className: "block truncate",
|
|
26128
|
+
style: {
|
|
26129
|
+
fontFamily: effectiveFont,
|
|
26130
|
+
fontWeight: weight || void 0,
|
|
26131
|
+
letterSpacing: spacing || void 0,
|
|
26132
|
+
color: resolvedColor,
|
|
26133
|
+
fontSize: "14px"
|
|
26134
|
+
},
|
|
26135
|
+
children: label
|
|
26136
|
+
}
|
|
26137
|
+
),
|
|
26138
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--canvas-text-muted)] mt-0.5", children: description })
|
|
26139
|
+
] }),
|
|
26140
|
+
/* @__PURE__ */ jsx(
|
|
26141
|
+
ChevronDown,
|
|
26142
|
+
{
|
|
26143
|
+
className: cn(
|
|
26144
|
+
"size-4 text-[var(--canvas-text-muted)] shrink-0 transition-transform duration-200",
|
|
26145
|
+
expanded && "rotate-180"
|
|
26146
|
+
)
|
|
26147
|
+
}
|
|
26148
|
+
)
|
|
26149
|
+
]
|
|
26150
|
+
}
|
|
26151
|
+
),
|
|
26152
|
+
/* @__PURE__ */ jsxs(
|
|
26153
|
+
"div",
|
|
26154
|
+
{
|
|
26155
|
+
className: cn(
|
|
26156
|
+
"overflow-hidden transition-all duration-200 ease-out",
|
|
26157
|
+
expanded ? "mt-3 max-h-[500px] opacity-100" : "max-h-0 opacity-0"
|
|
26158
|
+
),
|
|
26159
|
+
children: [
|
|
26160
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [
|
|
26161
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
26162
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-[var(--canvas-text-muted)]", children: "Font Family" }),
|
|
26163
|
+
/* @__PURE__ */ jsxs(
|
|
26164
|
+
Select,
|
|
26217
26165
|
{
|
|
26218
|
-
|
|
26219
|
-
|
|
26220
|
-
|
|
26221
|
-
|
|
26222
|
-
|
|
26166
|
+
value: font || "__global__",
|
|
26167
|
+
onValueChange: (v) => {
|
|
26168
|
+
if (v === "__global__") {
|
|
26169
|
+
theme.setVariable(varKey("font"), "");
|
|
26170
|
+
} else {
|
|
26171
|
+
loadGoogleFont(v);
|
|
26172
|
+
theme.setVariable(varKey("font"), v);
|
|
26173
|
+
}
|
|
26223
26174
|
},
|
|
26224
|
-
children:
|
|
26175
|
+
children: [
|
|
26176
|
+
/* @__PURE__ */ jsx(SelectTrigger, { inputSize: "sm", className: "bg-white", children: /* @__PURE__ */ jsx(SelectValue, { children: font ? font : `Use Global (${globalFont})` }) }),
|
|
26177
|
+
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
26178
|
+
/* @__PURE__ */ jsxs(SelectItem, { value: "__global__", className: "text-xs", children: [
|
|
26179
|
+
"Use Global (",
|
|
26180
|
+
globalFont,
|
|
26181
|
+
")"
|
|
26182
|
+
] }),
|
|
26183
|
+
fontOptions.map((f) => /* @__PURE__ */ jsx(
|
|
26184
|
+
SelectItem,
|
|
26185
|
+
{
|
|
26186
|
+
value: f.value,
|
|
26187
|
+
className: "text-xs",
|
|
26188
|
+
style: { fontFamily: f.value },
|
|
26189
|
+
children: f.label
|
|
26190
|
+
},
|
|
26191
|
+
f.value
|
|
26192
|
+
))
|
|
26193
|
+
] })
|
|
26194
|
+
]
|
|
26225
26195
|
}
|
|
26226
26196
|
)
|
|
26227
|
-
]
|
|
26228
|
-
|
|
26229
|
-
|
|
26230
|
-
|
|
26231
|
-
|
|
26232
|
-
|
|
26233
|
-
|
|
26234
|
-
|
|
26235
|
-
|
|
26236
|
-
|
|
26237
|
-
|
|
26238
|
-
|
|
26239
|
-
|
|
26240
|
-
|
|
26241
|
-
|
|
26242
|
-
|
|
26243
|
-
|
|
26244
|
-
|
|
26245
|
-
|
|
26246
|
-
|
|
26247
|
-
|
|
26248
|
-
|
|
26249
|
-
|
|
26250
|
-
|
|
26251
|
-
|
|
26252
|
-
|
|
26253
|
-
|
|
26254
|
-
|
|
26255
|
-
|
|
26256
|
-
|
|
26257
|
-
|
|
26258
|
-
|
|
26259
|
-
|
|
26260
|
-
|
|
26261
|
-
|
|
26262
|
-
|
|
26263
|
-
|
|
26264
|
-
|
|
26265
|
-
|
|
26266
|
-
|
|
26267
|
-
|
|
26268
|
-
|
|
26269
|
-
|
|
26270
|
-
|
|
26271
|
-
|
|
26272
|
-
|
|
26273
|
-
|
|
26274
|
-
|
|
26275
|
-
|
|
26276
|
-
|
|
26277
|
-
|
|
26278
|
-
|
|
26279
|
-
|
|
26280
|
-
|
|
26281
|
-
|
|
26282
|
-
|
|
26283
|
-
|
|
26284
|
-
|
|
26285
|
-
|
|
26286
|
-
|
|
26287
|
-
|
|
26288
|
-
|
|
26289
|
-
|
|
26290
|
-
|
|
26291
|
-
|
|
26292
|
-
|
|
26293
|
-
|
|
26294
|
-
|
|
26295
|
-
|
|
26296
|
-
|
|
26297
|
-
|
|
26298
|
-
|
|
26299
|
-
"label",
|
|
26300
|
-
{
|
|
26301
|
-
style: {
|
|
26302
|
-
display: "block",
|
|
26303
|
-
fontSize: "11px",
|
|
26304
|
-
color: "#6b7280",
|
|
26305
|
-
marginBottom: "4px"
|
|
26306
|
-
},
|
|
26307
|
-
children: "Size"
|
|
26308
|
-
}
|
|
26309
|
-
),
|
|
26310
|
-
/* @__PURE__ */ jsx(
|
|
26311
|
-
"input",
|
|
26312
|
-
{
|
|
26313
|
-
type: "text",
|
|
26314
|
-
value: theme.variables[varKey("size")] ?? "",
|
|
26315
|
-
onChange: (e) => theme.setVariable(varKey("size"), e.target.value),
|
|
26316
|
-
placeholder: "e.g. 16px",
|
|
26317
|
-
style: {
|
|
26318
|
-
width: "100%",
|
|
26319
|
-
height: "30px",
|
|
26320
|
-
fontSize: "12px",
|
|
26321
|
-
fontFamily: "monospace",
|
|
26322
|
-
padding: "0 8px",
|
|
26323
|
-
border: "1px solid #e5e7eb",
|
|
26324
|
-
borderRadius: "4px",
|
|
26325
|
-
color: "#374151",
|
|
26326
|
-
background: "#ffffff",
|
|
26327
|
-
boxSizing: "border-box"
|
|
26328
|
-
}
|
|
26329
|
-
}
|
|
26330
|
-
)
|
|
26331
|
-
] })
|
|
26332
|
-
]
|
|
26333
|
-
}
|
|
26334
|
-
),
|
|
26335
|
-
/* @__PURE__ */ jsxs(
|
|
26336
|
-
"div",
|
|
26337
|
-
{
|
|
26338
|
-
style: {
|
|
26339
|
-
display: "grid",
|
|
26340
|
-
gridTemplateColumns: "1fr 1fr",
|
|
26341
|
-
gap: "8px",
|
|
26342
|
-
marginBottom: "8px"
|
|
26343
|
-
},
|
|
26344
|
-
children: [
|
|
26345
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
26346
|
-
/* @__PURE__ */ jsx(
|
|
26347
|
-
"label",
|
|
26348
|
-
{
|
|
26349
|
-
style: {
|
|
26350
|
-
display: "block",
|
|
26351
|
-
fontSize: "11px",
|
|
26352
|
-
color: "#6b7280",
|
|
26353
|
-
marginBottom: "4px"
|
|
26354
|
-
},
|
|
26355
|
-
children: "Mobile Size"
|
|
26356
|
-
}
|
|
26357
|
-
),
|
|
26358
|
-
/* @__PURE__ */ jsx(
|
|
26359
|
-
"input",
|
|
26360
|
-
{
|
|
26361
|
-
type: "text",
|
|
26362
|
-
value: theme.variables[varKey("size-mobile")] ?? "",
|
|
26363
|
-
onChange: (e) => theme.setVariable(varKey("size-mobile"), e.target.value),
|
|
26364
|
-
placeholder: "e.g. 14px",
|
|
26365
|
-
style: {
|
|
26366
|
-
width: "100%",
|
|
26367
|
-
height: "30px",
|
|
26368
|
-
fontSize: "12px",
|
|
26369
|
-
fontFamily: "monospace",
|
|
26370
|
-
padding: "0 8px",
|
|
26371
|
-
border: "1px solid #e5e7eb",
|
|
26372
|
-
borderRadius: "4px",
|
|
26373
|
-
color: "#374151",
|
|
26374
|
-
background: "#ffffff",
|
|
26375
|
-
boxSizing: "border-box"
|
|
26376
|
-
}
|
|
26377
|
-
}
|
|
26378
|
-
)
|
|
26379
|
-
] }),
|
|
26380
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
26381
|
-
/* @__PURE__ */ jsx(
|
|
26382
|
-
"label",
|
|
26383
|
-
{
|
|
26384
|
-
style: {
|
|
26385
|
-
display: "block",
|
|
26386
|
-
fontSize: "11px",
|
|
26387
|
-
color: "#6b7280",
|
|
26388
|
-
marginBottom: "4px"
|
|
26389
|
-
},
|
|
26390
|
-
children: "Weight"
|
|
26391
|
-
}
|
|
26392
|
-
),
|
|
26393
|
-
/* @__PURE__ */ jsxs(
|
|
26394
|
-
"select",
|
|
26395
|
-
{
|
|
26396
|
-
value: theme.variables[varKey("weight")] ?? "",
|
|
26397
|
-
onChange: (e) => theme.setVariable(varKey("weight"), e.target.value),
|
|
26398
|
-
style: {
|
|
26399
|
-
width: "100%",
|
|
26400
|
-
height: "30px",
|
|
26401
|
-
fontSize: "12px",
|
|
26402
|
-
padding: "0 6px",
|
|
26403
|
-
border: "1px solid #e5e7eb",
|
|
26404
|
-
borderRadius: "4px",
|
|
26405
|
-
color: "#374151",
|
|
26406
|
-
background: "#ffffff",
|
|
26407
|
-
cursor: "pointer"
|
|
26408
|
-
},
|
|
26409
|
-
children: [
|
|
26410
|
-
/* @__PURE__ */ jsx("option", { value: "", children: "Default" }),
|
|
26411
|
-
fontWeightOptions.map((w) => /* @__PURE__ */ jsx("option", { value: w.value, children: w.label }, w.value))
|
|
26412
|
-
]
|
|
26413
|
-
}
|
|
26414
|
-
)
|
|
26415
|
-
] })
|
|
26416
|
-
]
|
|
26417
|
-
}
|
|
26418
|
-
),
|
|
26419
|
-
/* @__PURE__ */ jsxs(
|
|
26420
|
-
"div",
|
|
26421
|
-
{
|
|
26422
|
-
style: {
|
|
26423
|
-
display: "grid",
|
|
26424
|
-
gridTemplateColumns: "1fr 1fr",
|
|
26425
|
-
gap: "8px",
|
|
26426
|
-
marginBottom: "8px"
|
|
26427
|
-
},
|
|
26428
|
-
children: [
|
|
26429
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
26430
|
-
/* @__PURE__ */ jsx(
|
|
26431
|
-
"label",
|
|
26432
|
-
{
|
|
26433
|
-
style: {
|
|
26434
|
-
display: "block",
|
|
26435
|
-
fontSize: "11px",
|
|
26436
|
-
color: "#6b7280",
|
|
26437
|
-
marginBottom: "4px"
|
|
26438
|
-
},
|
|
26439
|
-
children: "Letter Spacing"
|
|
26440
|
-
}
|
|
26441
|
-
),
|
|
26442
|
-
/* @__PURE__ */ jsx(
|
|
26443
|
-
"input",
|
|
26444
|
-
{
|
|
26445
|
-
type: "text",
|
|
26446
|
-
value: theme.variables[varKey("spacing")] ?? "",
|
|
26447
|
-
onChange: (e) => theme.setVariable(varKey("spacing"), e.target.value),
|
|
26448
|
-
placeholder: "e.g. -0.02em",
|
|
26449
|
-
style: {
|
|
26450
|
-
width: "100%",
|
|
26451
|
-
height: "30px",
|
|
26452
|
-
fontSize: "12px",
|
|
26453
|
-
fontFamily: "monospace",
|
|
26454
|
-
padding: "0 8px",
|
|
26455
|
-
border: "1px solid #e5e7eb",
|
|
26456
|
-
borderRadius: "4px",
|
|
26457
|
-
color: "#374151",
|
|
26458
|
-
background: "#ffffff",
|
|
26459
|
-
boxSizing: "border-box"
|
|
26460
|
-
}
|
|
26461
|
-
}
|
|
26462
|
-
)
|
|
26463
|
-
] }),
|
|
26464
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
26465
|
-
/* @__PURE__ */ jsx(
|
|
26466
|
-
"label",
|
|
26467
|
-
{
|
|
26468
|
-
style: {
|
|
26469
|
-
display: "block",
|
|
26470
|
-
fontSize: "11px",
|
|
26471
|
-
color: "#6b7280",
|
|
26472
|
-
marginBottom: "4px"
|
|
26473
|
-
},
|
|
26474
|
-
children: "Line Height"
|
|
26475
|
-
}
|
|
26476
|
-
),
|
|
26477
|
-
/* @__PURE__ */ jsx(
|
|
26478
|
-
"input",
|
|
26479
|
-
{
|
|
26480
|
-
type: "text",
|
|
26481
|
-
value: theme.variables[varKey("line-height")] ?? "",
|
|
26482
|
-
onChange: (e) => theme.setVariable(varKey("line-height"), e.target.value),
|
|
26483
|
-
placeholder: "e.g. 1.5",
|
|
26484
|
-
style: {
|
|
26485
|
-
width: "100%",
|
|
26486
|
-
height: "30px",
|
|
26487
|
-
fontSize: "12px",
|
|
26488
|
-
fontFamily: "monospace",
|
|
26489
|
-
padding: "0 8px",
|
|
26490
|
-
border: "1px solid #e5e7eb",
|
|
26491
|
-
borderRadius: "4px",
|
|
26492
|
-
color: "#374151",
|
|
26493
|
-
background: "#ffffff",
|
|
26494
|
-
boxSizing: "border-box"
|
|
26495
|
-
}
|
|
26496
|
-
}
|
|
26497
|
-
)
|
|
26498
|
-
] })
|
|
26499
|
-
]
|
|
26500
|
-
}
|
|
26501
|
-
),
|
|
26197
|
+
] }),
|
|
26198
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
26199
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-[var(--canvas-text-muted)]", children: "Size" }),
|
|
26200
|
+
/* @__PURE__ */ jsx(
|
|
26201
|
+
TextInput,
|
|
26202
|
+
{
|
|
26203
|
+
inputSize: "sm",
|
|
26204
|
+
value: theme.variables[varKey("size")] ?? "",
|
|
26205
|
+
onChange: (e) => theme.setVariable(varKey("size"), e.target.value),
|
|
26206
|
+
className: "w-full font-mono",
|
|
26207
|
+
placeholder: "e.g. 16px"
|
|
26208
|
+
}
|
|
26209
|
+
)
|
|
26210
|
+
] })
|
|
26211
|
+
] }),
|
|
26212
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [
|
|
26213
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
26214
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-[var(--canvas-text-muted)]", children: "Mobile Size" }),
|
|
26215
|
+
/* @__PURE__ */ jsx(
|
|
26216
|
+
TextInput,
|
|
26217
|
+
{
|
|
26218
|
+
inputSize: "sm",
|
|
26219
|
+
value: theme.variables[varKey("size-mobile")] ?? "",
|
|
26220
|
+
onChange: (e) => theme.setVariable(varKey("size-mobile"), e.target.value),
|
|
26221
|
+
className: "w-full font-mono",
|
|
26222
|
+
placeholder: "e.g. 14px"
|
|
26223
|
+
}
|
|
26224
|
+
)
|
|
26225
|
+
] }),
|
|
26226
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
26227
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-[var(--canvas-text-muted)]", children: "Weight" }),
|
|
26228
|
+
/* @__PURE__ */ jsxs(
|
|
26229
|
+
Select,
|
|
26230
|
+
{
|
|
26231
|
+
value: theme.variables[varKey("weight")] ?? "",
|
|
26232
|
+
onValueChange: (v) => theme.setVariable(varKey("weight"), v),
|
|
26233
|
+
children: [
|
|
26234
|
+
/* @__PURE__ */ jsx(SelectTrigger, { inputSize: "sm", className: "bg-white", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Default" }) }),
|
|
26235
|
+
/* @__PURE__ */ jsx(SelectContent, { children: fontWeightOptions.map((w) => /* @__PURE__ */ jsx(SelectItem, { value: w.value, className: "text-xs", children: w.label }, w.value)) })
|
|
26236
|
+
]
|
|
26237
|
+
}
|
|
26238
|
+
)
|
|
26239
|
+
] })
|
|
26240
|
+
] }),
|
|
26241
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [
|
|
26242
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
26243
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-[var(--canvas-text-muted)]", children: "Letter Spacing" }),
|
|
26244
|
+
/* @__PURE__ */ jsx(
|
|
26245
|
+
TextInput,
|
|
26246
|
+
{
|
|
26247
|
+
inputSize: "sm",
|
|
26248
|
+
value: theme.variables[varKey("spacing")] ?? "",
|
|
26249
|
+
onChange: (e) => theme.setVariable(varKey("spacing"), e.target.value),
|
|
26250
|
+
className: "w-full font-mono",
|
|
26251
|
+
placeholder: "e.g. -0.02em"
|
|
26252
|
+
}
|
|
26253
|
+
)
|
|
26254
|
+
] }),
|
|
26255
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
26256
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-[var(--canvas-text-muted)]", children: "Line Height" }),
|
|
26257
|
+
/* @__PURE__ */ jsx(
|
|
26258
|
+
TextInput,
|
|
26259
|
+
{
|
|
26260
|
+
inputSize: "sm",
|
|
26261
|
+
value: theme.variables[varKey("line-height")] ?? "",
|
|
26262
|
+
onChange: (e) => theme.setVariable(varKey("line-height"), e.target.value),
|
|
26263
|
+
className: "w-full font-mono",
|
|
26264
|
+
placeholder: "e.g. 1.5"
|
|
26265
|
+
}
|
|
26266
|
+
)
|
|
26267
|
+
] })
|
|
26268
|
+
] }),
|
|
26502
26269
|
/* @__PURE__ */ jsx(
|
|
26503
26270
|
ColorInputRow,
|
|
26504
26271
|
{
|
|
@@ -26517,47 +26284,21 @@ function TypographyRow({
|
|
|
26517
26284
|
variableOptions: typographyColorOptions
|
|
26518
26285
|
}
|
|
26519
26286
|
),
|
|
26520
|
-
/* @__PURE__ */ jsx(
|
|
26521
|
-
"
|
|
26287
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-end mt-2", children: /* @__PURE__ */ jsxs(
|
|
26288
|
+
"button",
|
|
26522
26289
|
{
|
|
26523
|
-
|
|
26524
|
-
|
|
26525
|
-
|
|
26526
|
-
|
|
26527
|
-
|
|
26528
|
-
|
|
26529
|
-
"button",
|
|
26530
|
-
{
|
|
26531
|
-
onClick: () => theme.resetCategory("--typo-" + prefix),
|
|
26532
|
-
style: {
|
|
26533
|
-
fontSize: "11px",
|
|
26534
|
-
color: "#6b7280",
|
|
26535
|
-
background: "none",
|
|
26536
|
-
border: "none",
|
|
26537
|
-
cursor: "pointer",
|
|
26538
|
-
padding: "4px 8px",
|
|
26539
|
-
borderRadius: "4px"
|
|
26540
|
-
},
|
|
26541
|
-
onMouseEnter: (e) => {
|
|
26542
|
-
e.currentTarget.style.color = "#374151";
|
|
26543
|
-
e.currentTarget.style.background = "#f3f4f6";
|
|
26544
|
-
},
|
|
26545
|
-
onMouseLeave: (e) => {
|
|
26546
|
-
e.currentTarget.style.color = "#6b7280";
|
|
26547
|
-
e.currentTarget.style.background = "none";
|
|
26548
|
-
},
|
|
26549
|
-
children: [
|
|
26550
|
-
"Reset ",
|
|
26551
|
-
label
|
|
26552
|
-
]
|
|
26553
|
-
}
|
|
26554
|
-
)
|
|
26290
|
+
onClick: () => theme.resetCategory("--typo-" + prefix),
|
|
26291
|
+
className: "text-[11px] text-[var(--canvas-text-muted)] hover:text-[var(--canvas-text)] bg-transparent border-none cursor-pointer px-2 py-1 rounded hover:bg-[var(--canvas-surface)]",
|
|
26292
|
+
children: [
|
|
26293
|
+
"Reset ",
|
|
26294
|
+
label
|
|
26295
|
+
]
|
|
26555
26296
|
}
|
|
26556
|
-
)
|
|
26557
|
-
]
|
|
26558
|
-
|
|
26559
|
-
|
|
26560
|
-
);
|
|
26297
|
+
) })
|
|
26298
|
+
]
|
|
26299
|
+
}
|
|
26300
|
+
)
|
|
26301
|
+
] });
|
|
26561
26302
|
}
|
|
26562
26303
|
var buttonSizeConfigs = [
|
|
26563
26304
|
{ id: "mini", label: "Mini", description: "28px height, 12px font", prefix: "--btn-mini" },
|
|
@@ -26616,29 +26357,8 @@ function ButtonsPanel({ theme }) {
|
|
|
26616
26357
|
buttonSizeConfigs.map((size) => /* @__PURE__ */ jsx(SizeGroup, { size, theme }, size.id))
|
|
26617
26358
|
] }),
|
|
26618
26359
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
26619
|
-
/* @__PURE__ */
|
|
26620
|
-
|
|
26621
|
-
/* @__PURE__ */ jsx(
|
|
26622
|
-
"button",
|
|
26623
|
-
{
|
|
26624
|
-
onClick: theme.addCustomButtonStyle,
|
|
26625
|
-
className: "text-[11px] font-medium text-[var(--canvas-primary)] bg-transparent border border-[var(--canvas-border)] cursor-pointer px-2.5 py-1 rounded flex items-center gap-1 hover:bg-[var(--canvas-surface)]",
|
|
26626
|
-
children: "+ Add Style"
|
|
26627
|
-
}
|
|
26628
|
-
)
|
|
26629
|
-
] }),
|
|
26630
|
-
defaultButtonColorStyles.map((style) => /* @__PURE__ */ jsx(ButtonColorGroup, { style, theme }, style.id)),
|
|
26631
|
-
theme.customButtonStyles.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-4 pt-4 border-t border-[var(--canvas-border)]", children: [
|
|
26632
|
-
/* @__PURE__ */ jsx("h4", { className: "text-[11px] font-semibold text-[var(--canvas-text-muted)] mb-3", children: "Custom Styles" }),
|
|
26633
|
-
theme.customButtonStyles.map((style) => /* @__PURE__ */ jsx(
|
|
26634
|
-
CustomButtonColorGroup,
|
|
26635
|
-
{
|
|
26636
|
-
style,
|
|
26637
|
-
theme
|
|
26638
|
-
},
|
|
26639
|
-
style.id
|
|
26640
|
-
))
|
|
26641
|
-
] })
|
|
26360
|
+
/* @__PURE__ */ jsx("h3", { className: "text-[11px] font-semibold text-[var(--canvas-text-muted)] uppercase tracking-wide mb-3", children: "Color Styles" }),
|
|
26361
|
+
defaultButtonColorStyles.map((style) => /* @__PURE__ */ jsx(ButtonColorGroup, { style, theme }, style.id))
|
|
26642
26362
|
] })
|
|
26643
26363
|
] });
|
|
26644
26364
|
}
|
|
@@ -26822,173 +26542,27 @@ function ButtonColorGroup({
|
|
|
26822
26542
|
backgroundColor: resolvedBg === "transparent" ? "white" : resolvedBg,
|
|
26823
26543
|
color: resolvedText,
|
|
26824
26544
|
borderColor: resolvedBorder === "transparent" ? void 0 : resolvedBorder
|
|
26825
|
-
},
|
|
26826
|
-
children: "Aa"
|
|
26827
|
-
}
|
|
26828
|
-
),
|
|
26829
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
26830
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-[var(--canvas-text)]", children: style.label }),
|
|
26831
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--canvas-text-muted)]", children: style.description })
|
|
26832
|
-
] })
|
|
26833
|
-
] }),
|
|
26834
|
-
/* @__PURE__ */ jsx(
|
|
26835
|
-
ChevronDown,
|
|
26836
|
-
{
|
|
26837
|
-
className: cn(
|
|
26838
|
-
"size-4 text-[var(--canvas-text-muted)] shrink-0 transition-transform duration-200",
|
|
26839
|
-
expanded && "rotate-180"
|
|
26840
|
-
)
|
|
26841
|
-
}
|
|
26842
|
-
)
|
|
26843
|
-
]
|
|
26844
|
-
}
|
|
26845
|
-
),
|
|
26846
|
-
/* @__PURE__ */ jsxs(
|
|
26847
|
-
"div",
|
|
26848
|
-
{
|
|
26849
|
-
className: cn(
|
|
26850
|
-
"overflow-hidden transition-all duration-200 ease-out",
|
|
26851
|
-
expanded ? "mt-3 max-h-[400px] opacity-100" : "max-h-0 opacity-0"
|
|
26852
|
-
),
|
|
26853
|
-
children: [
|
|
26854
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
|
|
26855
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-[var(--canvas-text-muted)] mb-2", children: "Normal" }),
|
|
26856
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-0", children: [
|
|
26857
|
-
/* @__PURE__ */ jsx(
|
|
26858
|
-
ColorInputRow,
|
|
26859
|
-
{
|
|
26860
|
-
label: "Background",
|
|
26861
|
-
value: bg,
|
|
26862
|
-
onChange: (val) => theme.setVariable(`${prefix}-bg`, val),
|
|
26863
|
-
variableOptions: buttonColorVariableOptions
|
|
26864
|
-
}
|
|
26865
|
-
),
|
|
26866
|
-
/* @__PURE__ */ jsx(
|
|
26867
|
-
ColorInputRow,
|
|
26868
|
-
{
|
|
26869
|
-
label: "Text",
|
|
26870
|
-
value: text,
|
|
26871
|
-
onChange: (val) => theme.setVariable(`${prefix}-text`, val),
|
|
26872
|
-
variableOptions: buttonColorVariableOptions
|
|
26873
|
-
}
|
|
26874
|
-
),
|
|
26875
|
-
/* @__PURE__ */ jsx(
|
|
26876
|
-
ColorInputRow,
|
|
26877
|
-
{
|
|
26878
|
-
label: "Border",
|
|
26879
|
-
value: border,
|
|
26880
|
-
onChange: (val) => theme.setVariable(`${prefix}-border`, val),
|
|
26881
|
-
variableOptions: buttonColorVariableOptions
|
|
26882
|
-
}
|
|
26883
|
-
)
|
|
26884
|
-
] })
|
|
26885
|
-
] }),
|
|
26886
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
26887
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-[var(--canvas-text-muted)] mb-2", children: "Hover" }),
|
|
26888
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-0", children: [
|
|
26889
|
-
/* @__PURE__ */ jsx(
|
|
26890
|
-
ColorInputRow,
|
|
26891
|
-
{
|
|
26892
|
-
label: "Background",
|
|
26893
|
-
value: theme.variables[`${prefix}-bg-hover`] ?? "",
|
|
26894
|
-
onChange: (val) => theme.setVariable(`${prefix}-bg-hover`, val),
|
|
26895
|
-
variableOptions: buttonColorVariableOptions
|
|
26896
|
-
}
|
|
26897
|
-
),
|
|
26898
|
-
/* @__PURE__ */ jsx(
|
|
26899
|
-
ColorInputRow,
|
|
26900
|
-
{
|
|
26901
|
-
label: "Text",
|
|
26902
|
-
value: theme.variables[`${prefix}-text-hover`] ?? "",
|
|
26903
|
-
onChange: (val) => theme.setVariable(`${prefix}-text-hover`, val),
|
|
26904
|
-
variableOptions: buttonColorVariableOptions
|
|
26905
|
-
}
|
|
26906
|
-
),
|
|
26907
|
-
/* @__PURE__ */ jsx(
|
|
26908
|
-
ColorInputRow,
|
|
26909
|
-
{
|
|
26910
|
-
label: "Border",
|
|
26911
|
-
value: theme.variables[`${prefix}-border-hover`] ?? "",
|
|
26912
|
-
onChange: (val) => theme.setVariable(`${prefix}-border-hover`, val),
|
|
26913
|
-
variableOptions: buttonColorVariableOptions
|
|
26914
|
-
}
|
|
26915
|
-
)
|
|
26916
|
-
] })
|
|
26917
|
-
] })
|
|
26918
|
-
]
|
|
26919
|
-
}
|
|
26920
|
-
)
|
|
26921
|
-
] });
|
|
26922
|
-
}
|
|
26923
|
-
function CustomButtonColorGroup({
|
|
26924
|
-
style,
|
|
26925
|
-
theme
|
|
26926
|
-
}) {
|
|
26927
|
-
const [expanded, setExpanded] = React13__default.useState(false);
|
|
26928
|
-
const [editing, setEditing] = React13__default.useState(false);
|
|
26929
|
-
const resolvedBg = resolveBrandingColor(style.bg);
|
|
26930
|
-
const resolvedText = resolveBrandingColor(style.text);
|
|
26931
|
-
const resolvedBorder = resolveBrandingColor(style.border);
|
|
26932
|
-
return /* @__PURE__ */ jsxs("div", { className: "py-3 border-b border-[var(--canvas-border)] last:border-b-0", children: [
|
|
26933
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
26934
|
-
editing ? /* @__PURE__ */ jsx(
|
|
26935
|
-
"input",
|
|
26936
|
-
{
|
|
26937
|
-
type: "text",
|
|
26938
|
-
value: style.label,
|
|
26939
|
-
onChange: (e) => theme.updateCustomButtonStyle(style.id, { label: e.target.value }),
|
|
26940
|
-
onBlur: () => setEditing(false),
|
|
26941
|
-
onKeyDown: (e) => e.key === "Enter" && setEditing(false),
|
|
26942
|
-
autoFocus: true,
|
|
26943
|
-
className: "text-sm font-semibold text-[var(--canvas-text)] border border-[var(--canvas-border)] rounded px-1.5 py-0.5 bg-white flex-1"
|
|
26944
|
-
}
|
|
26945
|
-
) : /* @__PURE__ */ jsxs(
|
|
26946
|
-
"button",
|
|
26947
|
-
{
|
|
26948
|
-
onClick: () => setExpanded(!expanded),
|
|
26949
|
-
className: "flex items-center gap-3 flex-1 min-w-0 text-left cursor-pointer",
|
|
26950
|
-
onDoubleClick: (e) => {
|
|
26951
|
-
e.stopPropagation();
|
|
26952
|
-
setEditing(true);
|
|
26953
|
-
},
|
|
26954
|
-
children: [
|
|
26955
|
-
/* @__PURE__ */ jsx(
|
|
26956
|
-
"div",
|
|
26957
|
-
{
|
|
26958
|
-
className: "w-8 h-6 rounded border shrink-0 flex items-center justify-center text-xs",
|
|
26959
|
-
style: {
|
|
26960
|
-
backgroundColor: resolvedBg === "transparent" ? "white" : resolvedBg,
|
|
26961
|
-
color: resolvedText,
|
|
26962
|
-
borderColor: resolvedBorder === "transparent" ? void 0 : resolvedBorder
|
|
26963
|
-
},
|
|
26964
|
-
children: "Aa"
|
|
26965
|
-
}
|
|
26966
|
-
),
|
|
26967
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-[var(--canvas-text)]", children: style.label })
|
|
26968
|
-
]
|
|
26969
|
-
}
|
|
26970
|
-
),
|
|
26971
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
26972
|
-
/* @__PURE__ */ jsx(
|
|
26973
|
-
"button",
|
|
26974
|
-
{
|
|
26975
|
-
onClick: () => theme.deleteCustomButtonStyle(style.id),
|
|
26976
|
-
className: "text-[11px] text-[var(--canvas-destructive)] bg-transparent border-none cursor-pointer px-1.5 py-0.5",
|
|
26977
|
-
children: "Delete"
|
|
26978
|
-
}
|
|
26979
|
-
),
|
|
26980
|
-
/* @__PURE__ */ jsx(
|
|
26981
|
-
ChevronDown,
|
|
26982
|
-
{
|
|
26983
|
-
onClick: () => setExpanded(!expanded),
|
|
26984
|
-
className: cn(
|
|
26985
|
-
"size-4 text-[var(--canvas-text-muted)] shrink-0 transition-transform duration-200 cursor-pointer",
|
|
26986
|
-
expanded && "rotate-180"
|
|
26987
|
-
)
|
|
26988
|
-
}
|
|
26989
|
-
)
|
|
26990
|
-
] })
|
|
26991
|
-
] }),
|
|
26545
|
+
},
|
|
26546
|
+
children: "Aa"
|
|
26547
|
+
}
|
|
26548
|
+
),
|
|
26549
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
26550
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-[var(--canvas-text)]", children: style.label }),
|
|
26551
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--canvas-text-muted)]", children: style.description })
|
|
26552
|
+
] })
|
|
26553
|
+
] }),
|
|
26554
|
+
/* @__PURE__ */ jsx(
|
|
26555
|
+
ChevronDown,
|
|
26556
|
+
{
|
|
26557
|
+
className: cn(
|
|
26558
|
+
"size-4 text-[var(--canvas-text-muted)] shrink-0 transition-transform duration-200",
|
|
26559
|
+
expanded && "rotate-180"
|
|
26560
|
+
)
|
|
26561
|
+
}
|
|
26562
|
+
)
|
|
26563
|
+
]
|
|
26564
|
+
}
|
|
26565
|
+
),
|
|
26992
26566
|
/* @__PURE__ */ jsxs(
|
|
26993
26567
|
"div",
|
|
26994
26568
|
{
|
|
@@ -27004,8 +26578,8 @@ function CustomButtonColorGroup({
|
|
|
27004
26578
|
ColorInputRow,
|
|
27005
26579
|
{
|
|
27006
26580
|
label: "Background",
|
|
27007
|
-
value:
|
|
27008
|
-
onChange: (val) => theme.
|
|
26581
|
+
value: bg,
|
|
26582
|
+
onChange: (val) => theme.setVariable(`${prefix}-bg`, val),
|
|
27009
26583
|
variableOptions: buttonColorVariableOptions
|
|
27010
26584
|
}
|
|
27011
26585
|
),
|
|
@@ -27013,8 +26587,8 @@ function CustomButtonColorGroup({
|
|
|
27013
26587
|
ColorInputRow,
|
|
27014
26588
|
{
|
|
27015
26589
|
label: "Text",
|
|
27016
|
-
value:
|
|
27017
|
-
onChange: (val) => theme.
|
|
26590
|
+
value: text,
|
|
26591
|
+
onChange: (val) => theme.setVariable(`${prefix}-text`, val),
|
|
27018
26592
|
variableOptions: buttonColorVariableOptions
|
|
27019
26593
|
}
|
|
27020
26594
|
),
|
|
@@ -27022,8 +26596,8 @@ function CustomButtonColorGroup({
|
|
|
27022
26596
|
ColorInputRow,
|
|
27023
26597
|
{
|
|
27024
26598
|
label: "Border",
|
|
27025
|
-
value:
|
|
27026
|
-
onChange: (val) => theme.
|
|
26599
|
+
value: border,
|
|
26600
|
+
onChange: (val) => theme.setVariable(`${prefix}-border`, val),
|
|
27027
26601
|
variableOptions: buttonColorVariableOptions
|
|
27028
26602
|
}
|
|
27029
26603
|
)
|
|
@@ -27036,8 +26610,8 @@ function CustomButtonColorGroup({
|
|
|
27036
26610
|
ColorInputRow,
|
|
27037
26611
|
{
|
|
27038
26612
|
label: "Background",
|
|
27039
|
-
value:
|
|
27040
|
-
onChange: (val) => theme.
|
|
26613
|
+
value: theme.variables[`${prefix}-bg-hover`] ?? "",
|
|
26614
|
+
onChange: (val) => theme.setVariable(`${prefix}-bg-hover`, val),
|
|
27041
26615
|
variableOptions: buttonColorVariableOptions
|
|
27042
26616
|
}
|
|
27043
26617
|
),
|
|
@@ -27045,8 +26619,8 @@ function CustomButtonColorGroup({
|
|
|
27045
26619
|
ColorInputRow,
|
|
27046
26620
|
{
|
|
27047
26621
|
label: "Text",
|
|
27048
|
-
value:
|
|
27049
|
-
onChange: (val) => theme.
|
|
26622
|
+
value: theme.variables[`${prefix}-text-hover`] ?? "",
|
|
26623
|
+
onChange: (val) => theme.setVariable(`${prefix}-text-hover`, val),
|
|
27050
26624
|
variableOptions: buttonColorVariableOptions
|
|
27051
26625
|
}
|
|
27052
26626
|
),
|
|
@@ -27054,8 +26628,8 @@ function CustomButtonColorGroup({
|
|
|
27054
26628
|
ColorInputRow,
|
|
27055
26629
|
{
|
|
27056
26630
|
label: "Border",
|
|
27057
|
-
value:
|
|
27058
|
-
onChange: (val) => theme.
|
|
26631
|
+
value: theme.variables[`${prefix}-border-hover`] ?? "",
|
|
26632
|
+
onChange: (val) => theme.setVariable(`${prefix}-border-hover`, val),
|
|
27059
26633
|
variableOptions: buttonColorVariableOptions
|
|
27060
26634
|
}
|
|
27061
26635
|
)
|
|
@@ -27067,46 +26641,20 @@ function CustomButtonColorGroup({
|
|
|
27067
26641
|
] });
|
|
27068
26642
|
}
|
|
27069
26643
|
var inputSizeConfigs = [
|
|
27070
|
-
{ id: "small", label: "Small", prefix: "--input-small" },
|
|
27071
|
-
{ id: "standard", label: "Standard", prefix: "--input-standard" },
|
|
27072
|
-
{ id: "large", label: "Large", prefix: "--input-large" },
|
|
27073
|
-
{ id: "expandable", label: "Expandable", prefix: "--input-expandable" }
|
|
27074
|
-
];
|
|
27075
|
-
var inputFields = [
|
|
27076
|
-
{ suffix: "-height", label: "Height" },
|
|
27077
|
-
{ suffix: "-font-size", label: "Font Size" },
|
|
27078
|
-
{ suffix: "-px", label: "Padding X" },
|
|
27079
|
-
{ suffix: "-radius", label: "Radius" }
|
|
26644
|
+
{ id: "small", label: "Small", description: "Compact inputs (30px)", prefix: "--input-small" },
|
|
26645
|
+
{ id: "standard", label: "Standard", description: "Default inputs (40px)", prefix: "--input-standard" },
|
|
26646
|
+
{ id: "large", label: "Large", description: "Hero inputs (64px)", prefix: "--input-large" },
|
|
26647
|
+
{ id: "expandable", label: "Expandable", description: "TextArea, uploaders (80px)", prefix: "--input-expandable" }
|
|
27080
26648
|
];
|
|
27081
26649
|
function InputsPanel({ theme }) {
|
|
27082
26650
|
return /* @__PURE__ */ jsxs("div", { "data-theme-drawer-panel": true, className: "flex flex-col gap-5 p-4", children: [
|
|
27083
26651
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
27084
|
-
/* @__PURE__ */ jsx(
|
|
27085
|
-
"h3",
|
|
27086
|
-
{
|
|
27087
|
-
style: {
|
|
27088
|
-
fontSize: "13px",
|
|
27089
|
-
fontWeight: 600,
|
|
27090
|
-
color: "#374151",
|
|
27091
|
-
textTransform: "uppercase",
|
|
27092
|
-
letterSpacing: "0.05em"
|
|
27093
|
-
},
|
|
27094
|
-
children: "Input Sizes"
|
|
27095
|
-
}
|
|
27096
|
-
),
|
|
26652
|
+
/* @__PURE__ */ jsx("h3", { className: "text-[11px] font-semibold text-[var(--canvas-text-muted)] uppercase tracking-wide", children: "Input Sizes" }),
|
|
27097
26653
|
/* @__PURE__ */ jsx(
|
|
27098
26654
|
"button",
|
|
27099
26655
|
{
|
|
27100
26656
|
onClick: () => theme.resetCategory("--input-"),
|
|
27101
|
-
|
|
27102
|
-
fontSize: "11px",
|
|
27103
|
-
color: "#6b7280",
|
|
27104
|
-
background: "none",
|
|
27105
|
-
border: "none",
|
|
27106
|
-
cursor: "pointer",
|
|
27107
|
-
padding: "2px 6px",
|
|
27108
|
-
borderRadius: "4px"
|
|
27109
|
-
},
|
|
26657
|
+
className: "text-[11px] text-[var(--canvas-text-muted)] hover:text-[var(--canvas-text)] bg-transparent border-none cursor-pointer px-1.5 py-0.5 rounded hover:bg-[var(--canvas-surface)]",
|
|
27110
26658
|
children: "Reset All"
|
|
27111
26659
|
}
|
|
27112
26660
|
)
|
|
@@ -27119,121 +26667,114 @@ function InputSizeGroup({
|
|
|
27119
26667
|
theme
|
|
27120
26668
|
}) {
|
|
27121
26669
|
const [expanded, setExpanded] = React13__default.useState(false);
|
|
27122
|
-
const
|
|
27123
|
-
|
|
27124
|
-
|
|
27125
|
-
|
|
27126
|
-
|
|
27127
|
-
|
|
27128
|
-
|
|
27129
|
-
|
|
27130
|
-
|
|
27131
|
-
|
|
27132
|
-
|
|
27133
|
-
|
|
27134
|
-
|
|
27135
|
-
|
|
27136
|
-
|
|
27137
|
-
|
|
27138
|
-
|
|
27139
|
-
|
|
27140
|
-
overflow: "hidden"
|
|
27141
|
-
},
|
|
27142
|
-
children: [
|
|
27143
|
-
/* @__PURE__ */ jsxs(
|
|
27144
|
-
"button",
|
|
27145
|
-
{
|
|
27146
|
-
onClick: () => setExpanded(!expanded),
|
|
27147
|
-
style: {
|
|
27148
|
-
display: "flex",
|
|
27149
|
-
alignItems: "center",
|
|
27150
|
-
justifyContent: "space-between",
|
|
27151
|
-
width: "100%",
|
|
27152
|
-
padding: "10px 12px",
|
|
27153
|
-
background: "#f9fafb",
|
|
27154
|
-
border: "none",
|
|
27155
|
-
cursor: "pointer",
|
|
27156
|
-
fontSize: "13px",
|
|
27157
|
-
fontWeight: 600,
|
|
27158
|
-
color: "#374151"
|
|
27159
|
-
},
|
|
27160
|
-
children: [
|
|
27161
|
-
/* @__PURE__ */ jsx("span", { children: size.label }),
|
|
27162
|
-
/* @__PURE__ */ jsx(
|
|
27163
|
-
"span",
|
|
27164
|
-
{
|
|
27165
|
-
style: {
|
|
27166
|
-
fontSize: "11px",
|
|
27167
|
-
color: "#9ca3af",
|
|
27168
|
-
transform: expanded ? "rotate(180deg)" : "rotate(0deg)",
|
|
27169
|
-
transition: "transform 150ms"
|
|
27170
|
-
},
|
|
27171
|
-
children: "\u25BC"
|
|
27172
|
-
}
|
|
27173
|
-
)
|
|
27174
|
-
]
|
|
27175
|
-
}
|
|
27176
|
-
),
|
|
27177
|
-
expanded && /* @__PURE__ */ jsxs("div", { style: { padding: "10px 12px" }, className: "flex flex-col gap-2", children: [
|
|
27178
|
-
/* @__PURE__ */ jsx("div", { style: { marginBottom: "8px" }, children: /* @__PURE__ */ jsx(
|
|
27179
|
-
"input",
|
|
26670
|
+
const heightVar = `${size.prefix}-height`;
|
|
26671
|
+
const fontSizeVar = `${size.prefix}-font-size`;
|
|
26672
|
+
const pxVar = `${size.prefix}-px`;
|
|
26673
|
+
const radiusVar = `${size.prefix}-radius`;
|
|
26674
|
+
const height = theme.variables[heightVar] || defaultInputSizes[heightVar];
|
|
26675
|
+
const fontSize = theme.variables[fontSizeVar] || defaultInputSizes[fontSizeVar];
|
|
26676
|
+
const px = theme.variables[pxVar] || defaultInputSizes[pxVar];
|
|
26677
|
+
const radius = theme.variables[radiusVar] || defaultInputSizes[radiusVar];
|
|
26678
|
+
return /* @__PURE__ */ jsxs("div", { className: "py-3 border-b border-[var(--canvas-border)] last:border-b-0", children: [
|
|
26679
|
+
/* @__PURE__ */ jsxs(
|
|
26680
|
+
"button",
|
|
26681
|
+
{
|
|
26682
|
+
type: "button",
|
|
26683
|
+
onClick: () => setExpanded(!expanded),
|
|
26684
|
+
className: "w-full flex items-center justify-between gap-3 text-left cursor-pointer",
|
|
26685
|
+
children: [
|
|
26686
|
+
/* @__PURE__ */ jsx(
|
|
26687
|
+
"div",
|
|
27180
26688
|
{
|
|
27181
|
-
|
|
27182
|
-
|
|
27183
|
-
|
|
27184
|
-
|
|
26689
|
+
className: "shrink-0 flex items-center border border-[var(--canvas-border-input)] bg-white",
|
|
26690
|
+
style: {
|
|
26691
|
+
width: "160px",
|
|
26692
|
+
height,
|
|
26693
|
+
fontSize,
|
|
26694
|
+
paddingLeft: px,
|
|
26695
|
+
paddingRight: px,
|
|
26696
|
+
borderRadius: radius
|
|
26697
|
+
},
|
|
26698
|
+
children: /* @__PURE__ */ jsx("span", { className: "text-[var(--canvas-text-placeholder)]", children: size.label })
|
|
27185
26699
|
}
|
|
27186
|
-
)
|
|
27187
|
-
|
|
27188
|
-
|
|
27189
|
-
|
|
27190
|
-
|
|
26700
|
+
),
|
|
26701
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--canvas-text-muted)]", children: size.description }) }),
|
|
26702
|
+
/* @__PURE__ */ jsx(
|
|
26703
|
+
ChevronDown,
|
|
26704
|
+
{
|
|
26705
|
+
className: cn(
|
|
26706
|
+
"size-4 text-[var(--canvas-text-muted)] shrink-0 transition-transform duration-200",
|
|
26707
|
+
expanded && "rotate-180"
|
|
26708
|
+
)
|
|
26709
|
+
}
|
|
26710
|
+
)
|
|
26711
|
+
]
|
|
26712
|
+
}
|
|
26713
|
+
),
|
|
26714
|
+
/* @__PURE__ */ jsxs(
|
|
26715
|
+
"div",
|
|
26716
|
+
{
|
|
26717
|
+
className: cn(
|
|
26718
|
+
"grid grid-cols-2 gap-3 overflow-hidden transition-all duration-200 ease-out",
|
|
26719
|
+
expanded ? "mt-3 max-h-[200px] opacity-100" : "max-h-0 opacity-0"
|
|
26720
|
+
),
|
|
26721
|
+
children: [
|
|
26722
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
26723
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-[var(--canvas-text-muted)]", children: "Height" }),
|
|
26724
|
+
/* @__PURE__ */ jsx(
|
|
26725
|
+
TextInput,
|
|
27191
26726
|
{
|
|
27192
|
-
|
|
27193
|
-
|
|
27194
|
-
|
|
27195
|
-
|
|
27196
|
-
|
|
27197
|
-
|
|
27198
|
-
|
|
27199
|
-
|
|
27200
|
-
|
|
27201
|
-
|
|
27202
|
-
|
|
27203
|
-
|
|
27204
|
-
|
|
27205
|
-
|
|
27206
|
-
|
|
27207
|
-
|
|
27208
|
-
|
|
27209
|
-
|
|
27210
|
-
|
|
27211
|
-
|
|
27212
|
-
|
|
27213
|
-
|
|
27214
|
-
|
|
27215
|
-
|
|
27216
|
-
|
|
27217
|
-
|
|
27218
|
-
|
|
27219
|
-
|
|
27220
|
-
|
|
27221
|
-
|
|
27222
|
-
|
|
27223
|
-
|
|
27224
|
-
|
|
27225
|
-
|
|
27226
|
-
|
|
27227
|
-
|
|
27228
|
-
|
|
27229
|
-
|
|
27230
|
-
|
|
27231
|
-
|
|
27232
|
-
|
|
27233
|
-
|
|
27234
|
-
|
|
27235
|
-
|
|
27236
|
-
|
|
26727
|
+
inputSize: "sm",
|
|
26728
|
+
value: height,
|
|
26729
|
+
onChange: (e) => theme.setVariable(heightVar, e.target.value),
|
|
26730
|
+
className: "w-full font-mono",
|
|
26731
|
+
placeholder: "40px"
|
|
26732
|
+
}
|
|
26733
|
+
)
|
|
26734
|
+
] }),
|
|
26735
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
26736
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-[var(--canvas-text-muted)]", children: "Font Size" }),
|
|
26737
|
+
/* @__PURE__ */ jsx(
|
|
26738
|
+
TextInput,
|
|
26739
|
+
{
|
|
26740
|
+
inputSize: "sm",
|
|
26741
|
+
value: fontSize,
|
|
26742
|
+
onChange: (e) => theme.setVariable(fontSizeVar, e.target.value),
|
|
26743
|
+
className: "w-full font-mono",
|
|
26744
|
+
placeholder: "14px"
|
|
26745
|
+
}
|
|
26746
|
+
)
|
|
26747
|
+
] }),
|
|
26748
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
26749
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-[var(--canvas-text-muted)]", children: "Padding X" }),
|
|
26750
|
+
/* @__PURE__ */ jsx(
|
|
26751
|
+
TextInput,
|
|
26752
|
+
{
|
|
26753
|
+
inputSize: "sm",
|
|
26754
|
+
value: px,
|
|
26755
|
+
onChange: (e) => theme.setVariable(pxVar, e.target.value),
|
|
26756
|
+
className: "w-full font-mono",
|
|
26757
|
+
placeholder: "14px"
|
|
26758
|
+
}
|
|
26759
|
+
)
|
|
26760
|
+
] }),
|
|
26761
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
26762
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-[var(--canvas-text-muted)]", children: "Border Radius" }),
|
|
26763
|
+
/* @__PURE__ */ jsx(
|
|
26764
|
+
TextInput,
|
|
26765
|
+
{
|
|
26766
|
+
inputSize: "sm",
|
|
26767
|
+
value: radius,
|
|
26768
|
+
onChange: (e) => theme.setVariable(radiusVar, e.target.value),
|
|
26769
|
+
className: "w-full font-mono",
|
|
26770
|
+
placeholder: "8px"
|
|
26771
|
+
}
|
|
26772
|
+
)
|
|
26773
|
+
] })
|
|
26774
|
+
]
|
|
26775
|
+
}
|
|
26776
|
+
)
|
|
26777
|
+
] });
|
|
27237
26778
|
}
|
|
27238
26779
|
|
|
27239
26780
|
// src/components/theme-drawer/utils/generate-bake-prompt.ts
|
|
@@ -27556,29 +27097,11 @@ var drawerStyles = {
|
|
|
27556
27097
|
fontSize: "14px",
|
|
27557
27098
|
lineHeight: "1.5"
|
|
27558
27099
|
},
|
|
27559
|
-
trigger: (position) => ({
|
|
27560
|
-
position: "fixed",
|
|
27561
|
-
bottom: "20px",
|
|
27562
|
-
...position === "bottom-right" ? { right: "20px" } : { left: "20px" },
|
|
27563
|
-
zIndex: 9999,
|
|
27564
|
-
width: "48px",
|
|
27565
|
-
height: "48px",
|
|
27566
|
-
borderRadius: "12px",
|
|
27567
|
-
background: "#1f2937",
|
|
27568
|
-
color: "#ffffff",
|
|
27569
|
-
border: "none",
|
|
27570
|
-
cursor: "pointer",
|
|
27571
|
-
display: "flex",
|
|
27572
|
-
alignItems: "center",
|
|
27573
|
-
justifyContent: "center",
|
|
27574
|
-
boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
|
|
27575
|
-
transition: "transform 150ms, box-shadow 150ms"
|
|
27576
|
-
}),
|
|
27577
27100
|
tabBar: {
|
|
27578
27101
|
display: "flex",
|
|
27579
27102
|
borderBottom: "1px solid #e5e7eb",
|
|
27580
|
-
background: "#
|
|
27581
|
-
padding: "0",
|
|
27103
|
+
background: "#ffffff",
|
|
27104
|
+
padding: "0 8px",
|
|
27582
27105
|
gap: "0",
|
|
27583
27106
|
flexShrink: 0,
|
|
27584
27107
|
overflowX: "auto"
|
|
@@ -27587,11 +27110,11 @@ var drawerStyles = {
|
|
|
27587
27110
|
flex: 1,
|
|
27588
27111
|
padding: "10px 4px",
|
|
27589
27112
|
fontSize: "12px",
|
|
27590
|
-
fontWeight: active ?
|
|
27591
|
-
color: active ? "#
|
|
27113
|
+
fontWeight: active ? 500 : 400,
|
|
27114
|
+
color: active ? "#111827" : "#9ca3af",
|
|
27592
27115
|
background: "none",
|
|
27593
27116
|
border: "none",
|
|
27594
|
-
borderBottom: active ? "2px solid #
|
|
27117
|
+
borderBottom: active ? "2px solid #111827" : "2px solid transparent",
|
|
27595
27118
|
cursor: "pointer",
|
|
27596
27119
|
transition: "color 150ms, border-color 150ms",
|
|
27597
27120
|
textAlign: "center",
|
|
@@ -27611,8 +27134,8 @@ function PaletteIcon6() {
|
|
|
27611
27134
|
return /* @__PURE__ */ jsxs(
|
|
27612
27135
|
"svg",
|
|
27613
27136
|
{
|
|
27614
|
-
width: "
|
|
27615
|
-
height: "
|
|
27137
|
+
width: "16",
|
|
27138
|
+
height: "16",
|
|
27616
27139
|
viewBox: "0 0 24 24",
|
|
27617
27140
|
fill: "none",
|
|
27618
27141
|
stroke: "currentColor",
|
|
@@ -27653,6 +27176,44 @@ function ThemeDrawer({
|
|
|
27653
27176
|
const [open, setOpen] = useState(defaultOpen);
|
|
27654
27177
|
const [activeTab, setActiveTab] = useState("colors");
|
|
27655
27178
|
const [resetConfirmOpen, setResetConfirmOpen] = useState(false);
|
|
27179
|
+
const isRight = triggerPosition === "bottom-right";
|
|
27180
|
+
const [dragPos, setDragPos] = useState({ x: 20, y: 20 });
|
|
27181
|
+
const isDraggingRef = useRef(false);
|
|
27182
|
+
const dragStart = useRef({ pointerX: 0, pointerY: 0, startX: 0, startY: 0 });
|
|
27183
|
+
const handleDragPointerDown = useCallback(
|
|
27184
|
+
(e) => {
|
|
27185
|
+
e.preventDefault();
|
|
27186
|
+
e.stopPropagation();
|
|
27187
|
+
isDraggingRef.current = true;
|
|
27188
|
+
dragStart.current = {
|
|
27189
|
+
pointerX: e.clientX,
|
|
27190
|
+
pointerY: e.clientY,
|
|
27191
|
+
startX: dragPos.x,
|
|
27192
|
+
startY: dragPos.y
|
|
27193
|
+
};
|
|
27194
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
27195
|
+
},
|
|
27196
|
+
[dragPos]
|
|
27197
|
+
);
|
|
27198
|
+
const handleDragPointerMove = useCallback(
|
|
27199
|
+
(e) => {
|
|
27200
|
+
if (!isDraggingRef.current) return;
|
|
27201
|
+
const dx = e.clientX - dragStart.current.pointerX;
|
|
27202
|
+
const dy = e.clientY - dragStart.current.pointerY;
|
|
27203
|
+
setDragPos({
|
|
27204
|
+
x: Math.max(4, isRight ? dragStart.current.startX - dx : dragStart.current.startX + dx),
|
|
27205
|
+
y: Math.max(4, dragStart.current.startY - dy)
|
|
27206
|
+
});
|
|
27207
|
+
},
|
|
27208
|
+
[isRight]
|
|
27209
|
+
);
|
|
27210
|
+
const handleDragPointerUp = useCallback(
|
|
27211
|
+
(e) => {
|
|
27212
|
+
isDraggingRef.current = false;
|
|
27213
|
+
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
27214
|
+
},
|
|
27215
|
+
[]
|
|
27216
|
+
);
|
|
27656
27217
|
const theme = useThemeState({
|
|
27657
27218
|
storageKey,
|
|
27658
27219
|
initialOverrides,
|
|
@@ -27704,21 +27265,69 @@ function ThemeDrawer({
|
|
|
27704
27265
|
const activePanels = enabledPanels ? panelConfig.filter((p) => enabledPanels.includes(p.id)) : panelConfig;
|
|
27705
27266
|
const showFooter = theme.isDirty || resetConfirmOpen;
|
|
27706
27267
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27707
|
-
!open && /* @__PURE__ */
|
|
27708
|
-
"
|
|
27268
|
+
!open && /* @__PURE__ */ jsxs(
|
|
27269
|
+
"div",
|
|
27709
27270
|
{
|
|
27710
|
-
|
|
27711
|
-
|
|
27712
|
-
|
|
27713
|
-
|
|
27714
|
-
|
|
27715
|
-
|
|
27716
|
-
|
|
27717
|
-
|
|
27718
|
-
e.currentTarget.style.boxShadow = "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)";
|
|
27271
|
+
style: {
|
|
27272
|
+
position: "fixed",
|
|
27273
|
+
bottom: `${dragPos.y}px`,
|
|
27274
|
+
...isRight ? { right: `${dragPos.x}px` } : { left: `${dragPos.x}px` },
|
|
27275
|
+
zIndex: 9999,
|
|
27276
|
+
display: "flex",
|
|
27277
|
+
alignItems: "center",
|
|
27278
|
+
gap: "0"
|
|
27719
27279
|
},
|
|
27720
|
-
|
|
27721
|
-
|
|
27280
|
+
children: [
|
|
27281
|
+
/* @__PURE__ */ jsx(
|
|
27282
|
+
"div",
|
|
27283
|
+
{
|
|
27284
|
+
onPointerDown: handleDragPointerDown,
|
|
27285
|
+
onPointerMove: handleDragPointerMove,
|
|
27286
|
+
onPointerUp: handleDragPointerUp,
|
|
27287
|
+
style: {
|
|
27288
|
+
cursor: "grab",
|
|
27289
|
+
padding: "4px 2px",
|
|
27290
|
+
display: "flex",
|
|
27291
|
+
alignItems: "center",
|
|
27292
|
+
opacity: 0.25,
|
|
27293
|
+
touchAction: "none"
|
|
27294
|
+
},
|
|
27295
|
+
children: /* @__PURE__ */ jsx(GripVertical, { size: 12, color: "#9ca3af" })
|
|
27296
|
+
}
|
|
27297
|
+
),
|
|
27298
|
+
/* @__PURE__ */ jsx(
|
|
27299
|
+
"button",
|
|
27300
|
+
{
|
|
27301
|
+
onClick: () => setOpen(true),
|
|
27302
|
+
style: {
|
|
27303
|
+
width: "36px",
|
|
27304
|
+
height: "36px",
|
|
27305
|
+
borderRadius: "10px",
|
|
27306
|
+
background: "#ffffff",
|
|
27307
|
+
color: "#6b7280",
|
|
27308
|
+
border: "1px solid #e5e7eb",
|
|
27309
|
+
cursor: "pointer",
|
|
27310
|
+
display: "flex",
|
|
27311
|
+
alignItems: "center",
|
|
27312
|
+
justifyContent: "center",
|
|
27313
|
+
boxShadow: "0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06)",
|
|
27314
|
+
transition: "transform 150ms, box-shadow 150ms, border-color 150ms"
|
|
27315
|
+
},
|
|
27316
|
+
onMouseEnter: (e) => {
|
|
27317
|
+
e.currentTarget.style.transform = "scale(1.06)";
|
|
27318
|
+
e.currentTarget.style.boxShadow = "0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06)";
|
|
27319
|
+
e.currentTarget.style.borderColor = "#d1d5db";
|
|
27320
|
+
},
|
|
27321
|
+
onMouseLeave: (e) => {
|
|
27322
|
+
e.currentTarget.style.transform = "scale(1)";
|
|
27323
|
+
e.currentTarget.style.boxShadow = "0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06)";
|
|
27324
|
+
e.currentTarget.style.borderColor = "#e5e7eb";
|
|
27325
|
+
},
|
|
27326
|
+
"aria-label": "Open theme editor",
|
|
27327
|
+
children: /* @__PURE__ */ jsx(PaletteIcon6, {})
|
|
27328
|
+
}
|
|
27329
|
+
)
|
|
27330
|
+
]
|
|
27722
27331
|
}
|
|
27723
27332
|
),
|
|
27724
27333
|
/* @__PURE__ */ jsx(Sheet, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs(
|
|
@@ -27762,6 +27371,7 @@ function ThemeDrawer({
|
|
|
27762
27371
|
fontSize: "13px",
|
|
27763
27372
|
color: "#6b7280",
|
|
27764
27373
|
marginTop: "2px",
|
|
27374
|
+
marginBottom: "4px",
|
|
27765
27375
|
fontFamily: drawerStyles.container.fontFamily
|
|
27766
27376
|
},
|
|
27767
27377
|
children: theme.unsavedChangesCount > 0 ? `${theme.unsavedChangesCount} unsaved change${theme.unsavedChangesCount !== 1 ? "s" : ""}` : "Customize your design system"
|