canvas-ui-sdk 0.3.17 → 0.3.18

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 CHANGED
@@ -4,7 +4,7 @@ import { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
  import * as React14 from 'react';
7
- import React14__default, { createContext, useState, useContext, useEffect, useRef, Children, useMemo, useCallback } from 'react';
7
+ import React14__default, { createContext, useState, useContext, useEffect, useRef, Children, useMemo, useCallback, useLayoutEffect } from 'react';
8
8
  import { Slot } from '@radix-ui/react-slot';
9
9
  import { cva } from 'class-variance-authority';
10
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';
@@ -461,7 +461,7 @@ var Checkbox = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__
461
461
  ref,
462
462
  className: cn(
463
463
  "peer size-4 shrink-0 rounded-[var(--radius-xs)] border border-[var(--canvas-border-input)]",
464
- "bg-[var(--canvas-background)] transition-colors",
464
+ "bg-[var(--canvas-background)] transition-colors cursor-pointer",
465
465
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--canvas-border-input-focus)]",
466
466
  "disabled:cursor-not-allowed disabled:bg-[var(--canvas-input-disabled-bg)] disabled:border-[var(--canvas-input-disabled-border)]",
467
467
  "data-[state=checked]:bg-[var(--canvas-primary)] data-[state=checked]:border-[var(--canvas-primary)]",
@@ -613,7 +613,7 @@ function DialogContent({
613
613
  DialogPrimitive.Close,
614
614
  {
615
615
  "data-slot": "dialog-close",
616
- className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
616
+ className: "cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
617
617
  children: [
618
618
  /* @__PURE__ */ jsx(XIcon, {}),
619
619
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
@@ -731,7 +731,7 @@ function DropdownMenuItem({
731
731
  "data-inset": inset,
732
732
  "data-variant": variant,
733
733
  className: cn(
734
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
734
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-accent-foreground relative flex cursor-pointer items-center gap-1.5 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
735
735
  className
736
736
  ),
737
737
  ...props
@@ -749,7 +749,7 @@ function DropdownMenuCheckboxItem({
749
749
  {
750
750
  "data-slot": "dropdown-menu-checkbox-item",
751
751
  className: cn(
752
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
752
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
753
753
  className
754
754
  ),
755
755
  checked,
@@ -782,7 +782,7 @@ function DropdownMenuRadioItem({
782
782
  {
783
783
  "data-slot": "dropdown-menu-radio-item",
784
784
  className: cn(
785
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
785
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
786
786
  className
787
787
  ),
788
788
  ...props,
@@ -857,7 +857,7 @@ function DropdownMenuSubTrigger({
857
857
  "data-slot": "dropdown-menu-sub-trigger",
858
858
  "data-inset": inset,
859
859
  className: cn(
860
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
860
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
861
861
  className
862
862
  ),
863
863
  ...props,
@@ -1067,7 +1067,7 @@ var FileUploader = React14.forwardRef(
1067
1067
  onClick: () => handleDelete(file.id),
1068
1068
  disabled,
1069
1069
  className: cn(
1070
- "shrink-0 text-[var(--canvas-text-muted)] hover:text-[var(--canvas-destructive)] transition-colors",
1070
+ "cursor-pointer shrink-0 text-[var(--canvas-text-muted)] hover:text-[var(--canvas-destructive)] transition-colors",
1071
1071
  disabled && "opacity-60 cursor-not-allowed"
1072
1072
  ),
1073
1073
  children: /* @__PURE__ */ jsx(Trash2, { style: { width: "16px", height: "16px" } })
@@ -1238,7 +1238,7 @@ var ImageUploader = React14.forwardRef(
1238
1238
  "div",
1239
1239
  {
1240
1240
  className: cn(
1241
- "flex flex-col shrink-0 rounded-[var(--radius-xs)] border overflow-hidden",
1241
+ "cursor-pointer flex flex-col shrink-0 rounded-[var(--radius-xs)] border overflow-hidden",
1242
1242
  isSelected ? "border-[var(--canvas-primary)]" : "border-[var(--canvas-border)]"
1243
1243
  ),
1244
1244
  onClick: () => onSelectImage?.(image.id),
@@ -1284,7 +1284,7 @@ var ImageUploader = React14.forwardRef(
1284
1284
  },
1285
1285
  disabled: disabled || isFirst,
1286
1286
  className: cn(
1287
- "flex items-center justify-center rounded-full transition-colors",
1287
+ "cursor-pointer flex items-center justify-center rounded-full transition-colors",
1288
1288
  isFirst || disabled ? "bg-[var(--canvas-surface)] border border-[var(--canvas-border)] text-[var(--canvas-text-muted)]" : "bg-[var(--canvas-text)] text-[var(--canvas-primary-foreground)]"
1289
1289
  ),
1290
1290
  style: { width: "24px", height: "24px" },
@@ -1301,7 +1301,7 @@ var ImageUploader = React14.forwardRef(
1301
1301
  },
1302
1302
  disabled: disabled || isLast,
1303
1303
  className: cn(
1304
- "flex items-center justify-center rounded-full transition-colors",
1304
+ "cursor-pointer flex items-center justify-center rounded-full transition-colors",
1305
1305
  isLast || disabled ? "bg-[var(--canvas-surface)] border border-[var(--canvas-border)] text-[var(--canvas-text-muted)]" : "bg-[var(--canvas-text)] text-[var(--canvas-primary-foreground)]"
1306
1306
  ),
1307
1307
  style: { width: "24px", height: "24px" },
@@ -1317,7 +1317,7 @@ var ImageUploader = React14.forwardRef(
1317
1317
  handleDelete(image.id);
1318
1318
  },
1319
1319
  disabled,
1320
- className: "flex items-center justify-center rounded-full bg-[var(--canvas-text)] text-[var(--canvas-primary-foreground)] transition-colors",
1320
+ className: "cursor-pointer flex items-center justify-center rounded-full bg-[var(--canvas-text)] text-[var(--canvas-primary-foreground)] transition-colors",
1321
1321
  style: { width: "24px", height: "24px" },
1322
1322
  children: /* @__PURE__ */ jsx(Trash2, { style: { width: "16px", height: "16px" } })
1323
1323
  }
@@ -1449,7 +1449,7 @@ var MultiselectCheckboxField = React14.forwardRef(
1449
1449
  onClick: () => handleToggle(option.id),
1450
1450
  disabled,
1451
1451
  className: cn(
1452
- "flex items-center gap-2 bg-[var(--canvas-background)] border overflow-hidden transition-colors",
1452
+ "cursor-pointer flex items-center gap-2 bg-[var(--canvas-background)] border overflow-hidden transition-colors",
1453
1453
  "focus:outline-none focus:ring-2 focus:ring-[var(--canvas-border-input-focus)]",
1454
1454
  isSelected ? "border-[var(--canvas-primary)]" : "border-[var(--canvas-border-input)]",
1455
1455
  disabled && "cursor-not-allowed bg-[var(--canvas-input-disabled-bg)] border-[var(--canvas-input-disabled-border)] opacity-60"
@@ -1652,7 +1652,7 @@ function RadioGroupItem({
1652
1652
  {
1653
1653
  "data-slot": "radio-group-item",
1654
1654
  className: cn(
1655
- "aspect-square size-4 shrink-0 rounded-full border border-[var(--canvas-border-input)] bg-[var(--canvas-background)] transition-colors",
1655
+ "cursor-pointer aspect-square size-4 shrink-0 rounded-full border border-[var(--canvas-border-input)] bg-[var(--canvas-background)] transition-colors",
1656
1656
  "outline-none focus-visible:ring-2 focus-visible:ring-[var(--canvas-border-input-focus)]",
1657
1657
  "aria-invalid:border-[var(--canvas-border-input-invalid)] aria-invalid:ring-[var(--canvas-border-input-invalid)]/20",
1658
1658
  "disabled:cursor-not-allowed disabled:bg-[var(--canvas-input-disabled-bg)] disabled:border-[var(--canvas-input-disabled-border)]",
@@ -1871,7 +1871,7 @@ var Searchbox = React14.forwardRef(
1871
1871
  Searchbox.displayName = "Searchbox";
1872
1872
  var selectTriggerVariants = cva(
1873
1873
  // Base styles using CSS variables
1874
- "flex w-full items-center justify-between gap-2 bg-[var(--canvas-background)] border border-[var(--canvas-border-input)] text-[var(--canvas-text)] whitespace-nowrap transition-colors outline-none focus:border-[var(--canvas-border-input-focus)] focus:ring-2 focus:ring-[var(--canvas-border-input-focus)] disabled:cursor-not-allowed disabled:bg-[var(--canvas-input-disabled-bg)] disabled:border-[var(--canvas-input-disabled-border)] disabled:text-[var(--canvas-input-disabled-text)] aria-invalid:border-[var(--canvas-border-input-invalid)] data-[placeholder]:text-[var(--canvas-text-placeholder)] [&_svg:not([class*='text-'])]:text-[var(--canvas-text-muted)] [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 font-[family-name:var(--typo-global-font)]",
1874
+ "cursor-pointer flex w-full items-center justify-between gap-2 bg-[var(--canvas-background)] border border-[var(--canvas-border-input)] text-[var(--canvas-text)] whitespace-nowrap transition-colors outline-none focus:border-[var(--canvas-border-input-focus)] focus:ring-2 focus:ring-[var(--canvas-border-input-focus)] disabled:cursor-not-allowed disabled:bg-[var(--canvas-input-disabled-bg)] disabled:border-[var(--canvas-input-disabled-border)] disabled:text-[var(--canvas-input-disabled-text)] aria-invalid:border-[var(--canvas-border-input-invalid)] data-[placeholder]:text-[var(--canvas-text-placeholder)] [&_svg:not([class*='text-'])]:text-[var(--canvas-text-muted)] [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 font-[family-name:var(--typo-global-font)]",
1875
1875
  {
1876
1876
  variants: {
1877
1877
  inputSize: {
@@ -1979,7 +1979,7 @@ function SelectItem({
1979
1979
  {
1980
1980
  "data-slot": "select-item",
1981
1981
  className: cn(
1982
- "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 font-[family-name:var(--typo-global-font)]",
1982
+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 font-[family-name:var(--typo-global-font)]",
1983
1983
  className
1984
1984
  ),
1985
1985
  ...props,
@@ -2198,7 +2198,7 @@ function SheetContent({
2198
2198
  ...props,
2199
2199
  children: [
2200
2200
  children,
2201
- /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
2201
+ /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
2202
2202
  /* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
2203
2203
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
2204
2204
  ] })
@@ -2988,7 +2988,7 @@ var Slider = React14.forwardRef(({
2988
2988
  SliderPrimitive.Thumb,
2989
2989
  {
2990
2990
  className: cn(
2991
- "block rounded-full border-2 border-[var(--canvas-background)] bg-[var(--canvas-primary)]",
2991
+ "cursor-grab active:cursor-grabbing block rounded-full border-2 border-[var(--canvas-background)] bg-[var(--canvas-primary)]",
2992
2992
  "shadow-[0px_1px_2px_0px_rgba(0,0,0,0.08)]",
2993
2993
  "ring-offset-background transition-colors",
2994
2994
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--canvas-border-input-focus)]",
@@ -3023,7 +3023,7 @@ function Switch({
3023
3023
  {
3024
3024
  "data-slot": "switch",
3025
3025
  className: cn(
3026
- "peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 border-transparent transition-colors",
3026
+ "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
3027
3027
  "data-[state=checked]:bg-[var(--canvas-primary)] data-[state=unchecked]:bg-[var(--canvas-border)]",
3028
3028
  "outline-none focus-visible:ring-2 focus-visible:ring-[var(--canvas-border-input-focus)]",
3029
3029
  "disabled:cursor-not-allowed disabled:data-[state=checked]:bg-[var(--canvas-input-disabled-text)] disabled:data-[state=unchecked]:bg-[var(--canvas-input-disabled-border)]",
@@ -5947,7 +5947,7 @@ function FilterPopover({
5947
5947
  "button",
5948
5948
  {
5949
5949
  className: cn(
5950
- "flex items-center justify-between gap-2 bg-[var(--canvas-background)] border text-[var(--canvas-text)] whitespace-nowrap transition-colors outline-none focus:border-[var(--canvas-border-input-focus)] focus:ring-2 focus:ring-[var(--canvas-border-input-focus)] focus:ring-offset-2 data-[state=open]:border-[var(--canvas-border-input-focus)]",
5950
+ "cursor-pointer flex items-center justify-between gap-2 bg-[var(--canvas-background)] border text-[var(--canvas-text)] whitespace-nowrap transition-colors outline-none focus:border-[var(--canvas-border-input-focus)] focus:ring-2 focus:ring-[var(--canvas-border-input-focus)] focus:ring-offset-2 data-[state=open]:border-[var(--canvas-border-input-focus)]",
5951
5951
  className
5952
5952
  ),
5953
5953
  style: {
@@ -8809,7 +8809,7 @@ function MenufocusTemplate({
8809
8809
  "button",
8810
8810
  {
8811
8811
  className: cn(
8812
- "flex items-center justify-center rounded-full hover:bg-[var(--canvas-surface)] transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--canvas-primary)] focus:ring-offset-2",
8812
+ "cursor-pointer flex items-center justify-center rounded-full hover:bg-[var(--canvas-surface)] transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--canvas-primary)] focus:ring-offset-2",
8813
8813
  buttonSize,
8814
8814
  className
8815
8815
  ),
@@ -8936,6 +8936,7 @@ function StandardDataTable({
8936
8936
  /* @__PURE__ */ jsx("tbody", { children: data.map((row) => /* @__PURE__ */ jsxs(
8937
8937
  "tr",
8938
8938
  {
8939
+ className: "hover:bg-[var(--canvas-surface)] transition-colors",
8939
8940
  style: { borderBottom: "1px solid var(--canvas-border)" },
8940
8941
  children: [
8941
8942
  /* @__PURE__ */ jsx(
@@ -9210,6 +9211,7 @@ function FixedColumnDataTable({
9210
9211
  /* @__PURE__ */ jsx("tbody", { children: data.map((row) => /* @__PURE__ */ jsxs(
9211
9212
  "tr",
9212
9213
  {
9214
+ className: "hover:bg-[var(--canvas-surface)] transition-colors",
9213
9215
  style: { borderBottom: "1px solid var(--canvas-border)" },
9214
9216
  children: [
9215
9217
  /* @__PURE__ */ jsx(TableCell2, { isFixed: true, className: "pr-8", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
@@ -9430,7 +9432,7 @@ function NestedTable({ children, onChildAction }) {
9430
9432
  children.map((child, index) => /* @__PURE__ */ jsxs(
9431
9433
  "div",
9432
9434
  {
9433
- className: "grid items-center",
9435
+ className: "grid items-center hover:bg-[var(--canvas-surface)] transition-colors rounded-sm",
9434
9436
  style: {
9435
9437
  borderBottom: index < children.length - 1 ? "1px solid var(--canvas-border)" : "none",
9436
9438
  padding: "var(--spacing-md) 0",
@@ -9450,7 +9452,7 @@ function NestedTable({ children, onChildAction }) {
9450
9452
  "button",
9451
9453
  {
9452
9454
  onClick: () => onChildAction?.("view", child),
9453
- className: "flex items-center justify-center size-8 rounded-full hover:bg-[var(--canvas-surface)] transition-colors",
9455
+ className: "cursor-pointer flex items-center justify-center size-8 rounded-full hover:bg-[var(--canvas-surface)] transition-colors",
9454
9456
  "aria-label": `View ${child.name}`,
9455
9457
  children: /* @__PURE__ */ jsx(Eye, { size: 20, style: { color: "var(--canvas-text-muted)" } })
9456
9458
  }
@@ -9530,7 +9532,7 @@ function NestedDataTable({
9530
9532
  /* @__PURE__ */ jsxs(
9531
9533
  "div",
9532
9534
  {
9533
- className: "grid items-center",
9535
+ className: "grid items-center hover:bg-[var(--canvas-surface)] transition-colors rounded-sm",
9534
9536
  style: {
9535
9537
  padding: "var(--spacing-md) 0",
9536
9538
  minHeight: "64px",
@@ -10573,7 +10575,7 @@ function CommentInput2({
10573
10575
  "button",
10574
10576
  {
10575
10577
  type: "button",
10576
- className: "absolute right-3 top-1/2 -translate-y-1/2",
10578
+ className: "cursor-pointer absolute right-3 top-1/2 -translate-y-1/2",
10577
10579
  style: { color: "var(--canvas-text-placeholder)" },
10578
10580
  children: /* @__PURE__ */ jsx(Paperclip, { className: "w-5 h-5" })
10579
10581
  }
@@ -10605,7 +10607,7 @@ function CommentActions2({
10605
10607
  {
10606
10608
  type: "button",
10607
10609
  onClick: onReply,
10608
- className: "flex items-center",
10610
+ className: "cursor-pointer flex items-center",
10609
10611
  style: {
10610
10612
  gap: "var(--spacing-sm)",
10611
10613
  fontFamily: "var(--typo-body-s-font, var(--typo-global-font))",
@@ -10622,7 +10624,7 @@ function CommentActions2({
10622
10624
  {
10623
10625
  type: "button",
10624
10626
  onClick: onLike,
10625
- className: "flex items-center",
10627
+ className: "cursor-pointer flex items-center",
10626
10628
  style: {
10627
10629
  gap: "var(--spacing-sm)",
10628
10630
  fontFamily: "var(--typo-body-s-font, var(--typo-global-font))",
@@ -10805,6 +10807,7 @@ function CommentItem({
10805
10807
  "button",
10806
10808
  {
10807
10809
  type: "button",
10810
+ className: "cursor-pointer",
10808
10811
  onClick: () => setShowReplies(!showReplies),
10809
10812
  style: {
10810
10813
  fontFamily: "var(--typo-body-xs-font, var(--typo-global-font))",
@@ -13905,7 +13908,7 @@ function ControlButton({ icon, onClick, isActive = true, label }) {
13905
13908
  onClick,
13906
13909
  "aria-label": label,
13907
13910
  className: cn(
13908
- "w-10 h-10 rounded-full flex items-center justify-center",
13911
+ "cursor-pointer w-10 h-10 rounded-full flex items-center justify-center",
13909
13912
  "shadow-sm transition-colors",
13910
13913
  isActive ? "bg-[var(--canvas-sidebar-light-text)] text-[var(--canvas-primary-foreground)] hover:opacity-80" : "bg-[var(--canvas-destructive)] text-[var(--canvas-primary-foreground)] hover:opacity-80"
13911
13914
  ),
@@ -14088,7 +14091,7 @@ function VideoPlaylistCard({
14088
14091
  "button",
14089
14092
  {
14090
14093
  type: "button",
14091
- className: "flex items-center gap-2 p-4 border-b border-[var(--canvas-border)] text-left w-full",
14094
+ className: "cursor-pointer flex items-center gap-2 p-4 border-b border-[var(--canvas-border)] text-left w-full",
14092
14095
  onClick: () => setIsCollapsed(!isCollapsed),
14093
14096
  children: [
14094
14097
  /* @__PURE__ */ jsx("div", { className: "w-4 h-4 shrink-0 flex items-center justify-center", children: isCollapsed ? /* @__PURE__ */ jsx(Plus, { className: "w-4 h-4 text-[var(--canvas-text)]" }) : /* @__PURE__ */ jsx(Minus, { className: "w-4 h-4 text-[var(--canvas-text)]" }) }),
@@ -23307,7 +23310,17 @@ var brandColorVars = [
23307
23310
  "--canvas-sidebar-dark-active-bg",
23308
23311
  "--canvas-sidebar-dark-text",
23309
23312
  "--canvas-sidebar-dark-border",
23310
- "--canvas-border-input-focus"
23313
+ "--canvas-border-input-focus",
23314
+ // Button colors that track primary
23315
+ "--btn-primary-bg",
23316
+ "--btn-primary-border",
23317
+ "--btn-primary-bg-hover",
23318
+ "--btn-primary-border-hover",
23319
+ "--btn-primary-outline-text",
23320
+ "--btn-primary-outline-border",
23321
+ "--btn-primary-outline-text-hover",
23322
+ "--btn-primary-outline-border-hover",
23323
+ "--btn-primary-neutral-bg-hover"
23311
23324
  ];
23312
23325
  function isEqual(a, b) {
23313
23326
  if (a === b) return true;
@@ -23640,11 +23653,17 @@ function useThemeState(options) {
23640
23653
  setOverrides((prev) => {
23641
23654
  const effectivePrimaryColor = newValues["--canvas-primary"] || prev["--canvas-primary"] || defaultColors["--canvas-primary"];
23642
23655
  varsToUpdate.forEach((varName) => {
23643
- if (varName === "--canvas-sidebar-light-active-text" || varName === "--canvas-border-input-focus") {
23656
+ if (varName === "--canvas-sidebar-light-active-text" || varName === "--canvas-border-input-focus" || varName === "--btn-primary-bg" || varName === "--btn-primary-border" || varName === "--btn-primary-outline-text" || varName === "--btn-primary-outline-border" || varName === "--btn-primary-outline-text-hover" || varName === "--btn-primary-outline-border-hover" || varName === "--btn-primary-neutral-bg-hover") {
23644
23657
  newValues[varName] = effectivePrimaryColor;
23645
23658
  (document.body ?? document.documentElement).style.setProperty(varName, effectivePrimaryColor);
23646
23659
  return;
23647
23660
  }
23661
+ if (varName === "--btn-primary-bg-hover" || varName === "--btn-primary-border-hover") {
23662
+ const primaryDarkColor = newValues["--canvas-primary-dark"] || prev["--canvas-primary-dark"] || defaultColors["--canvas-primary-dark"];
23663
+ newValues[varName] = primaryDarkColor;
23664
+ (document.body ?? document.documentElement).style.setProperty(varName, primaryDarkColor);
23665
+ return;
23666
+ }
23648
23667
  if (varName === "--canvas-primary") return;
23649
23668
  const defaultColor = defaultColors[varName];
23650
23669
  if (!defaultColor || !defaultColor.startsWith("#")) return;
@@ -23693,6 +23712,9 @@ function useThemeState(options) {
23693
23712
  const isDirty = useMemo(() => {
23694
23713
  return !isEqual(overrides, savedOverrides) || !isEqual(branding, savedBranding) || !isEqual(images, savedImages) || !isEqual(customButtonStyles, savedCustomButtonStyles);
23695
23714
  }, [overrides, savedOverrides, branding, savedBranding, images, savedImages, customButtonStyles, savedCustomButtonStyles]);
23715
+ const hasCustomizations = useMemo(() => {
23716
+ return Object.keys(savedOverrides).length > 0 || !isEqual(savedBranding, defaultBranding) || !isEqual(savedImages, defaultImages) || !isEqual(savedCustomButtonStyles, defaultCustomButtonStyles);
23717
+ }, [savedOverrides, savedBranding, savedImages, savedCustomButtonStyles]);
23696
23718
  const unsavedChangesCount = useMemo(() => {
23697
23719
  let count = 0;
23698
23720
  const allKeys = /* @__PURE__ */ new Set([...Object.keys(overrides), ...Object.keys(savedOverrides)]);
@@ -23732,7 +23754,8 @@ function useThemeState(options) {
23732
23754
  setBrandHue,
23733
23755
  setBrandVibrancy,
23734
23756
  setSyncRelatedColors,
23735
- applyBrandHueVibrancy
23757
+ applyBrandHueVibrancy,
23758
+ hasCustomizations
23736
23759
  };
23737
23760
  }
23738
23761
  function HslColorPicker({ value, onChange }) {
@@ -24251,7 +24274,6 @@ function ColorsPanel({ theme }) {
24251
24274
  {
24252
24275
  style: {
24253
24276
  padding: "12px",
24254
- background: "#f9fafb",
24255
24277
  borderRadius: "8px",
24256
24278
  border: "1px solid #e5e7eb"
24257
24279
  },
@@ -24537,7 +24559,6 @@ function ImagesPanel({ theme, onImageUpload }) {
24537
24559
  gap: "12px",
24538
24560
  marginBottom: "16px",
24539
24561
  padding: "16px",
24540
- background: "#f9fafb",
24541
24562
  borderRadius: "8px",
24542
24563
  border: "1px solid #e5e7eb"
24543
24564
  },
@@ -24690,7 +24711,10 @@ function ImagesPanel({ theme, onImageUpload }) {
24690
24711
  style: {
24691
24712
  display: "grid",
24692
24713
  gridTemplateColumns: "repeat(8, 1fr)",
24693
- gap: "4px"
24714
+ gap: "4px",
24715
+ border: "1px solid #e5e7eb",
24716
+ borderRadius: "8px",
24717
+ padding: "6px"
24694
24718
  },
24695
24719
  children: logoIcons.map((icon) => {
24696
24720
  const isSelected = theme.branding.iconName === icon.name;
@@ -24816,7 +24840,6 @@ function ImageUploadRow({
24816
24840
  alignItems: "center",
24817
24841
  gap: "10px",
24818
24842
  padding: "8px 10px",
24819
- background: "#f9fafb",
24820
24843
  borderRadius: "6px",
24821
24844
  border: "1px solid #e5e7eb"
24822
24845
  },
@@ -24982,7 +25005,7 @@ function TypographyPanel({ theme }) {
24982
25005
  }, []);
24983
25006
  const globalFont = theme.variables["--typo-global-font"] || "Inter";
24984
25007
  return /* @__PURE__ */ jsxs("div", { "data-theme-drawer-panel": true, className: "p-4", children: [
24985
- /* @__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: [
25008
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-3 rounded-lg border border-[var(--canvas-border)] mb-5", children: [
24986
25009
  /* @__PURE__ */ jsxs("div", { children: [
24987
25010
  /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold text-[var(--canvas-text)]", children: "Global Font" }),
24988
25011
  /* @__PURE__ */ jsx("div", { className: "text-[11px] text-[var(--canvas-text-muted)] mt-0.5", children: "Default font for all text styles" })
@@ -26043,12 +26066,9 @@ var drawerStyles = {
26043
26066
  },
26044
26067
  tabBar: {
26045
26068
  display: "flex",
26046
- background: "#f2f2f2",
26047
- padding: "3px",
26048
- gap: "2px",
26069
+ gap: "8px",
26049
26070
  flexShrink: 0,
26050
26071
  overflowX: "auto",
26051
- borderRadius: "8px",
26052
26072
  margin: "0 16px 8px"
26053
26073
  },
26054
26074
  tab: (active) => ({
@@ -26056,7 +26076,7 @@ var drawerStyles = {
26056
26076
  fontSize: "12px",
26057
26077
  fontWeight: 500,
26058
26078
  color: active ? "#ffffff" : "#6b7280",
26059
- background: active ? "#171717" : "transparent",
26079
+ background: active ? "#171717" : "#f3f4f6",
26060
26080
  border: "none",
26061
26081
  borderRadius: "6px",
26062
26082
  cursor: "pointer",
@@ -26112,7 +26132,10 @@ function ThemeDrawer({
26112
26132
  storageKey,
26113
26133
  title = "Design Variables",
26114
26134
  width = 464,
26115
- readOnly = false
26135
+ readOnly = false,
26136
+ docked = false,
26137
+ stickyTopOffset = 0,
26138
+ children
26116
26139
  }) {
26117
26140
  if (devOnly && process.env.NODE_ENV === "production") {
26118
26141
  return null;
@@ -26158,6 +26181,8 @@ function ThemeDrawer({
26158
26181
  },
26159
26182
  []
26160
26183
  );
26184
+ const contentRef = useRef(null);
26185
+ const prevOverrideKeysRef = useRef(/* @__PURE__ */ new Set());
26161
26186
  const theme = useThemeState({
26162
26187
  storageKey,
26163
26188
  initialOverrides,
@@ -26207,73 +26232,380 @@ function ThemeDrawer({
26207
26232
  setResetConfirmOpen(false);
26208
26233
  }, [theme, setPreviewBranding, setPreviewImages]);
26209
26234
  const activePanels = enabledPanels ? panelConfig.filter((p) => enabledPanels.includes(p.id)) : panelConfig;
26210
- const showFooter = !readOnly && (theme.isDirty || resetConfirmOpen);
26211
- return /* @__PURE__ */ jsxs(Fragment, { children: [
26212
- !open && /* @__PURE__ */ jsxs(
26235
+ const showFooter = !readOnly && (theme.isDirty || resetConfirmOpen || theme.hasCustomizations);
26236
+ useEffect(() => {
26237
+ if (!docked || !open) return;
26238
+ const handleEscape = (e) => {
26239
+ if (e.key === "Escape") {
26240
+ handleOpenChange(false);
26241
+ }
26242
+ };
26243
+ document.addEventListener("keydown", handleEscape);
26244
+ return () => document.removeEventListener("keydown", handleEscape);
26245
+ }, [docked, open, handleOpenChange]);
26246
+ useLayoutEffect(() => {
26247
+ const el = contentRef.current;
26248
+ if (!el) return;
26249
+ const currentKeys = new Set(Object.keys(theme.overrides));
26250
+ prevOverrideKeysRef.current.forEach((key) => {
26251
+ if (!currentKeys.has(key)) {
26252
+ el.style.removeProperty(key);
26253
+ }
26254
+ });
26255
+ Object.entries(theme.overrides).forEach(([name, value]) => {
26256
+ el.style.setProperty(name, value);
26257
+ });
26258
+ prevOverrideKeysRef.current = currentKeys;
26259
+ }, [theme.overrides]);
26260
+ const scrollHeight = docked ? `calc(100vh - ${stickyTopOffset}px - ${showFooter ? 200 : 150}px)` : `calc(100vh - ${showFooter ? 200 : 150}px)`;
26261
+ const tabBar = /* @__PURE__ */ jsx("div", { style: drawerStyles.tabBar, children: activePanels.map((panel) => {
26262
+ const isActive = activeTab === panel.id;
26263
+ return /* @__PURE__ */ jsx(
26264
+ "button",
26265
+ {
26266
+ onClick: () => setActiveTab(panel.id),
26267
+ style: drawerStyles.tab(isActive),
26268
+ onMouseEnter: (e) => {
26269
+ if (!isActive) {
26270
+ e.currentTarget.style.background = "#e5e7eb";
26271
+ }
26272
+ },
26273
+ onMouseLeave: (e) => {
26274
+ if (!isActive) {
26275
+ e.currentTarget.style.background = "#f3f4f6";
26276
+ }
26277
+ },
26278
+ children: panel.label
26279
+ },
26280
+ panel.id
26281
+ );
26282
+ }) });
26283
+ const panelContent = /* @__PURE__ */ jsx(
26284
+ ScrollArea,
26285
+ {
26286
+ className: "flex-1 overflow-hidden",
26287
+ style: { height: scrollHeight },
26288
+ children: /* @__PURE__ */ jsxs("div", { style: drawerStyles.container, children: [
26289
+ activeTab === "colors" && /* @__PURE__ */ jsx(ColorsPanel, { theme }),
26290
+ activeTab === "images" && /* @__PURE__ */ jsx(ImagesPanel, { theme, onImageUpload }),
26291
+ activeTab === "typography" && /* @__PURE__ */ jsx(TypographyPanel, { theme }),
26292
+ activeTab === "buttons" && /* @__PURE__ */ jsx(ButtonsPanel, { theme }),
26293
+ activeTab === "inputs" && /* @__PURE__ */ jsx(InputsPanel, { theme }),
26294
+ activeTab === "export" && /* @__PURE__ */ jsx(ExportPanel, { theme })
26295
+ ] })
26296
+ }
26297
+ );
26298
+ const footerContent = showFooter ? /* @__PURE__ */ jsx("div", { style: drawerStyles.footer, children: resetConfirmOpen ? /* @__PURE__ */ jsxs(
26299
+ "div",
26300
+ {
26301
+ style: {
26302
+ display: "flex",
26303
+ flexDirection: "column",
26304
+ gap: "8px",
26305
+ width: "100%"
26306
+ },
26307
+ children: [
26308
+ /* @__PURE__ */ jsx(
26309
+ "span",
26310
+ {
26311
+ style: {
26312
+ fontSize: "13px",
26313
+ color: "#374151",
26314
+ textAlign: "center"
26315
+ },
26316
+ children: "Reset all settings to defaults?"
26317
+ }
26318
+ ),
26319
+ /* @__PURE__ */ jsxs(
26320
+ "div",
26321
+ {
26322
+ style: {
26323
+ display: "flex",
26324
+ gap: "8px",
26325
+ justifyContent: "center"
26326
+ },
26327
+ children: [
26328
+ /* @__PURE__ */ jsx(
26329
+ "button",
26330
+ {
26331
+ onClick: () => setResetConfirmOpen(false),
26332
+ style: {
26333
+ fontSize: "13px",
26334
+ fontWeight: 500,
26335
+ color: "#374151",
26336
+ background: "#ffffff",
26337
+ border: "1px solid #e5e7eb",
26338
+ cursor: "pointer",
26339
+ padding: "6px 16px",
26340
+ borderRadius: "6px"
26341
+ },
26342
+ children: "Cancel"
26343
+ }
26344
+ ),
26345
+ /* @__PURE__ */ jsx(
26346
+ "button",
26347
+ {
26348
+ onClick: handleReset,
26349
+ style: {
26350
+ fontSize: "13px",
26351
+ fontWeight: 500,
26352
+ color: "#ffffff",
26353
+ background: "#dc2626",
26354
+ border: "1px solid #dc2626",
26355
+ cursor: "pointer",
26356
+ padding: "6px 16px",
26357
+ borderRadius: "6px"
26358
+ },
26359
+ children: "Reset All"
26360
+ }
26361
+ )
26362
+ ]
26363
+ }
26364
+ )
26365
+ ]
26366
+ }
26367
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
26368
+ theme.isDirty && /* @__PURE__ */ jsxs(
26213
26369
  "div",
26214
26370
  {
26215
26371
  style: {
26216
- position: "fixed",
26217
- bottom: `${dragPos.y}px`,
26218
- ...isRight ? { right: `${dragPos.x}px` } : { left: `${dragPos.x}px` },
26219
- zIndex: 9999,
26220
26372
  display: "flex",
26221
- alignItems: "center",
26222
- gap: "0"
26373
+ gap: "8px",
26374
+ width: "100%"
26223
26375
  },
26224
26376
  children: [
26225
26377
  /* @__PURE__ */ jsx(
26226
- "div",
26378
+ "button",
26227
26379
  {
26228
- onPointerDown: handleDragPointerDown,
26229
- onPointerMove: handleDragPointerMove,
26230
- onPointerUp: handleDragPointerUp,
26380
+ onClick: handleDiscard,
26231
26381
  style: {
26232
- cursor: "grab",
26233
- padding: "4px 2px",
26234
- display: "flex",
26235
- alignItems: "center",
26236
- opacity: 0.25,
26237
- touchAction: "none"
26382
+ flex: 1,
26383
+ fontSize: "13px",
26384
+ fontWeight: 500,
26385
+ color: "#374151",
26386
+ background: "#ffffff",
26387
+ border: "1px solid #e5e7eb",
26388
+ cursor: "pointer",
26389
+ padding: "8px 16px",
26390
+ borderRadius: "6px"
26238
26391
  },
26239
- children: /* @__PURE__ */ jsx(GripVertical, { size: 12, color: "#9ca3af" })
26392
+ children: "Discard"
26240
26393
  }
26241
26394
  ),
26242
26395
  /* @__PURE__ */ jsx(
26243
26396
  "button",
26244
26397
  {
26245
- onClick: () => setOpen(true),
26398
+ onClick: handleSave,
26246
26399
  style: {
26247
- width: "36px",
26248
- height: "36px",
26249
- borderRadius: "10px",
26250
- background: "#ffffff",
26251
- color: "#6b7280",
26252
- border: "1px solid #e5e7eb",
26400
+ flex: 1,
26401
+ fontSize: "13px",
26402
+ fontWeight: 600,
26403
+ color: "#ffffff",
26404
+ background: "#1f2937",
26405
+ border: "1px solid #1f2937",
26253
26406
  cursor: "pointer",
26254
- display: "flex",
26255
- alignItems: "center",
26256
- justifyContent: "center",
26257
- boxShadow: "0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06)",
26258
- transition: "transform 150ms, box-shadow 150ms, border-color 150ms"
26259
- },
26260
- onMouseEnter: (e) => {
26261
- e.currentTarget.style.transform = "scale(1.06)";
26262
- e.currentTarget.style.boxShadow = "0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06)";
26263
- e.currentTarget.style.borderColor = "#d1d5db";
26407
+ padding: "8px 16px",
26408
+ borderRadius: "6px"
26264
26409
  },
26265
- onMouseLeave: (e) => {
26266
- e.currentTarget.style.transform = "scale(1)";
26267
- e.currentTarget.style.boxShadow = "0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06)";
26268
- e.currentTarget.style.borderColor = "#e5e7eb";
26269
- },
26270
- "aria-label": "Open theme editor",
26271
- children: /* @__PURE__ */ jsx(PaletteIcon6, {})
26410
+ children: "Save"
26272
26411
  }
26273
26412
  )
26274
26413
  ]
26275
26414
  }
26276
26415
  ),
26416
+ /* @__PURE__ */ jsx(
26417
+ "button",
26418
+ {
26419
+ onClick: () => setResetConfirmOpen(true),
26420
+ style: {
26421
+ fontSize: "12px",
26422
+ fontWeight: 400,
26423
+ color: "#9ca3af",
26424
+ background: "none",
26425
+ border: "none",
26426
+ cursor: "pointer",
26427
+ padding: "2px 0",
26428
+ textAlign: "center",
26429
+ textDecoration: "underline",
26430
+ textUnderlineOffset: "2px"
26431
+ },
26432
+ children: "Reset all to defaults"
26433
+ }
26434
+ )
26435
+ ] }) }) : null;
26436
+ const headerBlock = /* @__PURE__ */ jsxs("div", { style: { padding: "16px 0 0" }, children: [
26437
+ /* @__PURE__ */ jsx(
26438
+ "div",
26439
+ {
26440
+ style: {
26441
+ fontSize: "16px",
26442
+ fontWeight: 700,
26443
+ color: "#1f2937",
26444
+ fontFamily: drawerStyles.container.fontFamily
26445
+ },
26446
+ children: title
26447
+ }
26448
+ ),
26449
+ /* @__PURE__ */ jsx(
26450
+ "div",
26451
+ {
26452
+ style: {
26453
+ fontSize: "13px",
26454
+ color: "#6b7280",
26455
+ marginTop: "2px",
26456
+ marginBottom: "12px",
26457
+ fontFamily: drawerStyles.container.fontFamily
26458
+ },
26459
+ children: theme.unsavedChangesCount > 0 ? `${theme.unsavedChangesCount} unsaved change${theme.unsavedChangesCount !== 1 ? "s" : ""}` : "Customize your design system"
26460
+ }
26461
+ )
26462
+ ] });
26463
+ const triggerButton = !open && /* @__PURE__ */ jsxs(
26464
+ "div",
26465
+ {
26466
+ style: {
26467
+ position: "fixed",
26468
+ bottom: `${dragPos.y}px`,
26469
+ ...isRight ? { right: `${dragPos.x}px` } : { left: `${dragPos.x}px` },
26470
+ zIndex: 9999,
26471
+ display: "flex",
26472
+ alignItems: "center",
26473
+ gap: "0"
26474
+ },
26475
+ children: [
26476
+ /* @__PURE__ */ jsx(
26477
+ "div",
26478
+ {
26479
+ onPointerDown: handleDragPointerDown,
26480
+ onPointerMove: handleDragPointerMove,
26481
+ onPointerUp: handleDragPointerUp,
26482
+ style: {
26483
+ cursor: "grab",
26484
+ padding: "4px 2px",
26485
+ display: "flex",
26486
+ alignItems: "center",
26487
+ opacity: 0.25,
26488
+ touchAction: "none"
26489
+ },
26490
+ children: /* @__PURE__ */ jsx(GripVertical, { size: 12, color: "#9ca3af" })
26491
+ }
26492
+ ),
26493
+ /* @__PURE__ */ jsx(
26494
+ "button",
26495
+ {
26496
+ onClick: () => setOpen(true),
26497
+ style: {
26498
+ width: "36px",
26499
+ height: "36px",
26500
+ borderRadius: "10px",
26501
+ background: "#ffffff",
26502
+ color: "#6b7280",
26503
+ border: "1px solid #e5e7eb",
26504
+ cursor: "pointer",
26505
+ display: "flex",
26506
+ alignItems: "center",
26507
+ justifyContent: "center",
26508
+ boxShadow: "0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06)",
26509
+ transition: "transform 150ms, box-shadow 150ms, border-color 150ms"
26510
+ },
26511
+ onMouseEnter: (e) => {
26512
+ e.currentTarget.style.transform = "scale(1.06)";
26513
+ e.currentTarget.style.boxShadow = "0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06)";
26514
+ e.currentTarget.style.borderColor = "#d1d5db";
26515
+ },
26516
+ onMouseLeave: (e) => {
26517
+ e.currentTarget.style.transform = "scale(1)";
26518
+ e.currentTarget.style.boxShadow = "0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06)";
26519
+ e.currentTarget.style.borderColor = "#e5e7eb";
26520
+ },
26521
+ "aria-label": "Open theme editor",
26522
+ children: /* @__PURE__ */ jsx(PaletteIcon6, {})
26523
+ }
26524
+ )
26525
+ ]
26526
+ }
26527
+ );
26528
+ const dockedAside = /* @__PURE__ */ jsx(
26529
+ "aside",
26530
+ {
26531
+ "data-theme-drawer": true,
26532
+ style: {
26533
+ width: open ? `${width}px` : "0px",
26534
+ transition: "width 300ms cubic-bezier(0.4, 0, 0.2, 1)",
26535
+ overflow: "hidden",
26536
+ flexShrink: 0
26537
+ },
26538
+ children: /* @__PURE__ */ jsxs(
26539
+ "div",
26540
+ {
26541
+ style: {
26542
+ width: `${width}px`,
26543
+ height: `calc(100vh - ${stickyTopOffset}px)`,
26544
+ position: "sticky",
26545
+ top: `${stickyTopOffset}px`,
26546
+ display: "flex",
26547
+ flexDirection: "column",
26548
+ borderLeft: "1px solid #e5e7eb",
26549
+ background: "#ffffff",
26550
+ ...drawerStyles.container
26551
+ },
26552
+ children: [
26553
+ /* @__PURE__ */ jsx(
26554
+ "button",
26555
+ {
26556
+ onClick: () => handleOpenChange(false),
26557
+ style: {
26558
+ position: "absolute",
26559
+ top: 16,
26560
+ right: 16,
26561
+ width: 24,
26562
+ height: 24,
26563
+ display: "flex",
26564
+ alignItems: "center",
26565
+ justifyContent: "center",
26566
+ background: "transparent",
26567
+ border: "none",
26568
+ cursor: "pointer",
26569
+ opacity: 0.5,
26570
+ transition: "opacity 150ms",
26571
+ zIndex: 10
26572
+ },
26573
+ onMouseEnter: (e) => {
26574
+ e.currentTarget.style.opacity = "1";
26575
+ },
26576
+ onMouseLeave: (e) => {
26577
+ e.currentTarget.style.opacity = "0.5";
26578
+ },
26579
+ "aria-label": "Close theme editor",
26580
+ children: /* @__PURE__ */ jsx(XIcon, { size: 16, color: "#6b7280" })
26581
+ }
26582
+ ),
26583
+ /* @__PURE__ */ jsx("div", { style: { padding: "16px 16px 12px", background: "#ffffff" }, children: headerBlock }),
26584
+ tabBar,
26585
+ panelContent,
26586
+ footerContent
26587
+ ]
26588
+ }
26589
+ )
26590
+ }
26591
+ );
26592
+ if (docked && children) {
26593
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
26594
+ triggerButton,
26595
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", minHeight: "100vh" }, children: [
26596
+ /* @__PURE__ */ jsx("div", { ref: contentRef, style: { flex: 1, minWidth: 0, overflow: "auto", transform: "translateZ(0)" }, children }),
26597
+ dockedAside
26598
+ ] })
26599
+ ] });
26600
+ }
26601
+ if (docked) {
26602
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
26603
+ triggerButton,
26604
+ dockedAside
26605
+ ] });
26606
+ }
26607
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
26608
+ triggerButton,
26277
26609
  /* @__PURE__ */ jsx(Sheet, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs(
26278
26610
  SheetContent,
26279
26611
  {
@@ -26286,7 +26618,7 @@ function ThemeDrawer({
26286
26618
  maxWidth: `${width}px`
26287
26619
  },
26288
26620
  children: [
26289
- /* @__PURE__ */ jsx(
26621
+ /* @__PURE__ */ jsxs(
26290
26622
  SheetHeader,
26291
26623
  {
26292
26624
  className: "!p-0",
@@ -26294,197 +26626,16 @@ function ThemeDrawer({
26294
26626
  padding: "16px 16px 12px",
26295
26627
  background: "#ffffff"
26296
26628
  },
26297
- children: /* @__PURE__ */ jsxs("div", { style: { padding: "16px 16px 0" }, children: [
26298
- /* @__PURE__ */ jsx(
26299
- SheetTitle,
26300
- {
26301
- style: {
26302
- fontSize: "16px",
26303
- fontWeight: 700,
26304
- color: "#1f2937",
26305
- fontFamily: drawerStyles.container.fontFamily
26306
- },
26307
- children: title
26308
- }
26309
- ),
26310
- /* @__PURE__ */ jsx(
26311
- SheetDescription,
26312
- {
26313
- style: {
26314
- fontSize: "13px",
26315
- color: "#6b7280",
26316
- marginTop: "2px",
26317
- marginBottom: "12px",
26318
- fontFamily: drawerStyles.container.fontFamily
26319
- },
26320
- children: theme.unsavedChangesCount > 0 ? `${theme.unsavedChangesCount} unsaved change${theme.unsavedChangesCount !== 1 ? "s" : ""}` : "Customize your design system"
26321
- }
26322
- )
26323
- ] })
26324
- }
26325
- ),
26326
- /* @__PURE__ */ jsx("div", { style: drawerStyles.tabBar, children: activePanels.map((panel) => /* @__PURE__ */ jsx(
26327
- "button",
26328
- {
26329
- onClick: () => setActiveTab(panel.id),
26330
- style: drawerStyles.tab(activeTab === panel.id),
26331
- children: panel.label
26332
- },
26333
- panel.id
26334
- )) }),
26335
- /* @__PURE__ */ jsx(
26336
- ScrollArea,
26337
- {
26338
- className: "flex-1 overflow-hidden",
26339
- style: { height: `calc(100vh - ${showFooter ? 200 : 150}px)` },
26340
- children: /* @__PURE__ */ jsxs("div", { style: drawerStyles.container, children: [
26341
- activeTab === "colors" && /* @__PURE__ */ jsx(ColorsPanel, { theme }),
26342
- activeTab === "images" && /* @__PURE__ */ jsx(ImagesPanel, { theme, onImageUpload }),
26343
- activeTab === "typography" && /* @__PURE__ */ jsx(TypographyPanel, { theme }),
26344
- activeTab === "buttons" && /* @__PURE__ */ jsx(ButtonsPanel, { theme }),
26345
- activeTab === "inputs" && /* @__PURE__ */ jsx(InputsPanel, { theme }),
26346
- activeTab === "export" && /* @__PURE__ */ jsx(ExportPanel, { theme })
26347
- ] })
26348
- }
26349
- ),
26350
- showFooter && /* @__PURE__ */ jsx("div", { style: drawerStyles.footer, children: resetConfirmOpen ? /* @__PURE__ */ jsxs(
26351
- "div",
26352
- {
26353
- style: {
26354
- display: "flex",
26355
- flexDirection: "column",
26356
- gap: "8px",
26357
- width: "100%"
26358
- },
26359
26629
  children: [
26360
- /* @__PURE__ */ jsx(
26361
- "span",
26362
- {
26363
- style: {
26364
- fontSize: "13px",
26365
- color: "#374151",
26366
- textAlign: "center"
26367
- },
26368
- children: "Reset all settings to defaults?"
26369
- }
26370
- ),
26371
- /* @__PURE__ */ jsxs(
26372
- "div",
26373
- {
26374
- style: {
26375
- display: "flex",
26376
- gap: "8px",
26377
- justifyContent: "center"
26378
- },
26379
- children: [
26380
- /* @__PURE__ */ jsx(
26381
- "button",
26382
- {
26383
- onClick: () => setResetConfirmOpen(false),
26384
- style: {
26385
- fontSize: "13px",
26386
- fontWeight: 500,
26387
- color: "#374151",
26388
- background: "#ffffff",
26389
- border: "1px solid #e5e7eb",
26390
- cursor: "pointer",
26391
- padding: "6px 16px",
26392
- borderRadius: "6px"
26393
- },
26394
- children: "Cancel"
26395
- }
26396
- ),
26397
- /* @__PURE__ */ jsx(
26398
- "button",
26399
- {
26400
- onClick: handleReset,
26401
- style: {
26402
- fontSize: "13px",
26403
- fontWeight: 500,
26404
- color: "#ffffff",
26405
- background: "#dc2626",
26406
- border: "1px solid #dc2626",
26407
- cursor: "pointer",
26408
- padding: "6px 16px",
26409
- borderRadius: "6px"
26410
- },
26411
- children: "Reset All"
26412
- }
26413
- )
26414
- ]
26415
- }
26416
- )
26630
+ /* @__PURE__ */ jsx(SheetTitle, { className: "sr-only", children: title }),
26631
+ /* @__PURE__ */ jsx(SheetDescription, { className: "sr-only", children: "Customize your design system" }),
26632
+ headerBlock
26417
26633
  ]
26418
26634
  }
26419
- ) : /* @__PURE__ */ jsxs(Fragment, { children: [
26420
- /* @__PURE__ */ jsxs(
26421
- "div",
26422
- {
26423
- style: {
26424
- display: "flex",
26425
- gap: "8px",
26426
- width: "100%"
26427
- },
26428
- children: [
26429
- /* @__PURE__ */ jsx(
26430
- "button",
26431
- {
26432
- onClick: handleDiscard,
26433
- style: {
26434
- flex: 1,
26435
- fontSize: "13px",
26436
- fontWeight: 500,
26437
- color: "#374151",
26438
- background: "#ffffff",
26439
- border: "1px solid #e5e7eb",
26440
- cursor: "pointer",
26441
- padding: "8px 16px",
26442
- borderRadius: "6px"
26443
- },
26444
- children: "Discard"
26445
- }
26446
- ),
26447
- /* @__PURE__ */ jsx(
26448
- "button",
26449
- {
26450
- onClick: handleSave,
26451
- style: {
26452
- flex: 1,
26453
- fontSize: "13px",
26454
- fontWeight: 600,
26455
- color: "#ffffff",
26456
- background: "#1f2937",
26457
- border: "1px solid #1f2937",
26458
- cursor: "pointer",
26459
- padding: "8px 16px",
26460
- borderRadius: "6px"
26461
- },
26462
- children: "Save"
26463
- }
26464
- )
26465
- ]
26466
- }
26467
- ),
26468
- /* @__PURE__ */ jsx(
26469
- "button",
26470
- {
26471
- onClick: () => setResetConfirmOpen(true),
26472
- style: {
26473
- fontSize: "12px",
26474
- fontWeight: 400,
26475
- color: "#9ca3af",
26476
- background: "none",
26477
- border: "none",
26478
- cursor: "pointer",
26479
- padding: "2px 0",
26480
- textAlign: "center",
26481
- textDecoration: "underline",
26482
- textUnderlineOffset: "2px"
26483
- },
26484
- children: "Reset all to defaults"
26485
- }
26486
- )
26487
- ] }) })
26635
+ ),
26636
+ tabBar,
26637
+ panelContent,
26638
+ footerContent
26488
26639
  ]
26489
26640
  }
26490
26641
  ) })