@squaredr/fieldcraft-pro 1.7.0 → 1.8.0

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.
@@ -8,18 +8,23 @@ var PREVIEW_SCHEMA = {
8
8
  id: "theme-preview",
9
9
  version: "1.0.0",
10
10
  title: "Theme Preview",
11
- description: "See how your theme looks on a real form.",
11
+ description: "See how your theme looks across every field type.",
12
+ settings: {
13
+ displayMode: "classic",
14
+ showProgress: false
15
+ },
12
16
  sections: [
13
17
  {
14
- id: "s1",
15
- title: "Contact Information",
18
+ id: "s-text",
19
+ title: "Text Inputs",
16
20
  questions: [
17
21
  {
18
22
  id: "name",
19
23
  type: "short_text",
20
24
  label: "Full Name",
21
25
  required: true,
22
- placeholder: "Jane Doe"
26
+ placeholder: "Jane Doe",
27
+ helpText: "Enter your full legal name."
23
28
  },
24
29
  {
25
30
  id: "email",
@@ -28,6 +33,31 @@ var PREVIEW_SCHEMA = {
28
33
  required: true,
29
34
  placeholder: "jane@example.com"
30
35
  },
36
+ {
37
+ id: "phone",
38
+ type: "phone",
39
+ label: "Phone Number",
40
+ placeholder: "(555) 123-4567"
41
+ },
42
+ {
43
+ id: "website",
44
+ type: "url",
45
+ label: "Website",
46
+ placeholder: "https://example.com"
47
+ },
48
+ {
49
+ id: "bio",
50
+ type: "long_text",
51
+ label: "Bio / Notes",
52
+ placeholder: "Tell us about yourself...",
53
+ helpText: "Markdown is supported."
54
+ }
55
+ ]
56
+ },
57
+ {
58
+ id: "s-selection",
59
+ title: "Selection Fields",
60
+ questions: [
31
61
  {
32
62
  id: "department",
33
63
  type: "dropdown",
@@ -35,20 +65,184 @@ var PREVIEW_SCHEMA = {
35
65
  options: [
36
66
  { label: "Engineering", value: "engineering" },
37
67
  { label: "Design", value: "design" },
38
- { label: "Marketing", value: "marketing" }
68
+ { label: "Marketing", value: "marketing" },
69
+ { label: "Sales", value: "sales" }
39
70
  ]
40
71
  },
72
+ {
73
+ id: "role",
74
+ type: "single_select",
75
+ label: "Role",
76
+ helpText: "Select one option.",
77
+ options: [
78
+ { label: "Individual Contributor", value: "ic" },
79
+ { label: "Team Lead", value: "lead" },
80
+ { label: "Manager", value: "manager" },
81
+ { label: "Director", value: "director" }
82
+ ],
83
+ config: { type: "single_select", layout: "vertical" }
84
+ },
85
+ {
86
+ id: "skills",
87
+ type: "multi_select",
88
+ label: "Skills",
89
+ helpText: "Select all that apply.",
90
+ options: [
91
+ { label: "JavaScript", value: "js" },
92
+ { label: "TypeScript", value: "ts" },
93
+ { label: "Python", value: "py" },
94
+ { label: "Rust", value: "rust" },
95
+ { label: "Go", value: "go" }
96
+ ],
97
+ config: { type: "multi_select", layout: "vertical" }
98
+ },
99
+ {
100
+ id: "newsletter",
101
+ type: "boolean",
102
+ label: "Subscribe to newsletter?",
103
+ config: { type: "boolean", style: "toggle" }
104
+ }
105
+ ]
106
+ },
107
+ {
108
+ id: "s-numeric",
109
+ title: "Numeric & Rating",
110
+ questions: [
111
+ {
112
+ id: "age",
113
+ type: "number",
114
+ label: "Age",
115
+ placeholder: "25",
116
+ config: { type: "number", min: 0, max: 150 }
117
+ },
118
+ {
119
+ id: "satisfaction",
120
+ type: "slider",
121
+ label: "Satisfaction Level",
122
+ config: { type: "slider", min: 0, max: 100, step: 5 }
123
+ },
41
124
  {
42
125
  id: "rating",
43
126
  type: "rating",
44
- label: "How would you rate this experience?",
127
+ label: "Overall Rating",
45
128
  config: { type: "rating", max: 5 }
46
129
  },
47
130
  {
48
- id: "notes",
49
- type: "long_text",
50
- label: "Additional Notes",
51
- placeholder: "Any other feedback..."
131
+ id: "nps",
132
+ type: "nps",
133
+ label: "How likely are you to recommend us?"
134
+ },
135
+ {
136
+ id: "opinion",
137
+ type: "opinion_scale",
138
+ label: "How do you feel about the onboarding?",
139
+ config: {
140
+ type: "opinion_scale",
141
+ min: 1,
142
+ max: 5,
143
+ minLabel: "Very Poor",
144
+ maxLabel: "Excellent"
145
+ }
146
+ }
147
+ ]
148
+ },
149
+ {
150
+ id: "s-datetime",
151
+ title: "Date & Time",
152
+ questions: [
153
+ {
154
+ id: "dob",
155
+ type: "date",
156
+ label: "Date of Birth",
157
+ config: { type: "date", disableFuture: true }
158
+ },
159
+ {
160
+ id: "preferred_time",
161
+ type: "time",
162
+ label: "Preferred Time",
163
+ config: { type: "time", format: "12h" }
164
+ },
165
+ {
166
+ id: "travel_dates",
167
+ type: "date_range",
168
+ label: "Travel Dates"
169
+ }
170
+ ]
171
+ },
172
+ {
173
+ id: "s-media",
174
+ title: "Media & Files",
175
+ questions: [
176
+ {
177
+ id: "resume",
178
+ type: "file_upload",
179
+ label: "Upload Resume",
180
+ helpText: "PDF or DOCX, max 10 MB.",
181
+ config: { type: "file_upload", maxFiles: 1, maxSizeMb: 10, accept: [".pdf", ".docx"] }
182
+ },
183
+ {
184
+ id: "signature",
185
+ type: "signature",
186
+ label: "Signature",
187
+ helpText: "Draw your signature below."
188
+ }
189
+ ]
190
+ },
191
+ {
192
+ id: "s-advanced",
193
+ title: "Advanced Fields",
194
+ questions: [
195
+ {
196
+ id: "experience",
197
+ type: "likert",
198
+ label: "Rate the following aspects:",
199
+ config: {
200
+ type: "likert",
201
+ labels: ["Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"]
202
+ }
203
+ },
204
+ {
205
+ id: "country",
206
+ type: "country_select",
207
+ label: "Country",
208
+ config: { type: "country_select", showFlags: true }
209
+ },
210
+ {
211
+ id: "consent",
212
+ type: "consent",
213
+ label: "Terms & Conditions",
214
+ config: {
215
+ type: "consent",
216
+ text: "I agree to the Terms of Service and Privacy Policy.",
217
+ checkboxLabel: "I agree"
218
+ }
219
+ }
220
+ ]
221
+ },
222
+ {
223
+ id: "s-content",
224
+ title: "Content & Visual",
225
+ questions: [
226
+ {
227
+ id: "info",
228
+ type: "info_block",
229
+ label: "This is an informational message block. It can be used to display important notices."
230
+ },
231
+ {
232
+ id: "warning_info",
233
+ type: "info_block",
234
+ label: "Please double-check all information before submitting."
235
+ },
236
+ {
237
+ id: "divider",
238
+ type: "divider",
239
+ label: ""
240
+ },
241
+ {
242
+ id: "section_head",
243
+ type: "section_header",
244
+ label: "Section Header Example",
245
+ config: { type: "section_header", level: "h3", showDivider: true }
52
246
  }
53
247
  ]
54
248
  }
@@ -407,148 +601,458 @@ function PaletteGenerator({ theme, onApply, onClose }) {
407
601
  }
408
602
 
409
603
  // src/theme-editor/presets.ts
410
- var cleanPreset = {
604
+ var cleanLight = {
411
605
  colors: {
412
- primary: "#1F6B6E",
606
+ primary: "#2563EB",
413
607
  primaryForeground: "#FFFFFF",
414
- secondary: "#B9D1CF",
415
- secondaryForeground: "#12222A",
416
- error: "#B04A3C",
608
+ secondary: "#DBEAFE",
609
+ secondaryForeground: "#1E3A5F",
610
+ error: "#DC2626",
417
611
  errorForeground: "#FFFFFF",
418
- warning: "#C98A2E",
419
- success: "#2E7D5B",
612
+ warning: "#D97706",
613
+ success: "#16A34A",
420
614
  surface: "#FFFFFF",
421
- background: "#F4F7F8",
422
- text: "#12222A",
423
- textMuted: "#6A7B85",
424
- textDisabled: "#B9D1CF",
425
- border: "#DCE4E8",
426
- borderFocus: "#1F6B6E",
615
+ background: "#F8FAFC",
616
+ text: "#0F172A",
617
+ textMuted: "#64748B",
618
+ textDisabled: "#CBD5E1",
619
+ border: "#E2E8F0",
620
+ borderFocus: "#2563EB",
427
621
  inputBackground: "#FFFFFF"
428
622
  },
429
623
  typography: {
430
624
  fontFamily: "Inter, system-ui, sans-serif",
431
625
  scale: "comfortable",
432
- questionSize: "1.125rem",
626
+ questionSize: "1.0625rem",
433
627
  labelSize: "0.875rem",
434
628
  helpTextSize: "0.8125rem",
435
629
  bodySize: "0.9375rem"
436
630
  },
437
- shape: { radius: "none", inputRadius: "0px", buttonRadius: "0px", cardRadius: "0px" },
631
+ shape: { radius: "sm", inputRadius: "6px", buttonRadius: "6px", cardRadius: "8px" },
438
632
  spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
439
- layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
633
+ layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
440
634
  };
441
- var cleanDarkPreset = {
635
+ var cleanDark = {
442
636
  colors: {
443
- primary: "#63BDB4",
444
- primaryForeground: "#0F1A1F",
445
- secondary: "#2F4F4C",
446
- secondaryForeground: "#E8EFF1",
447
- error: "#E08072",
448
- errorForeground: "#0F1A1F",
449
- warning: "#E0A94F",
450
- success: "#5DB89A",
451
- surface: "#16242A",
452
- background: "#0F1A1F",
453
- text: "#E8EFF1",
454
- textMuted: "#8CA1A9",
455
- textDisabled: "#3D5259",
456
- border: "#2A3B42",
457
- borderFocus: "#63BDB4",
458
- inputBackground: "#16242A"
637
+ primary: "#60A5FA",
638
+ primaryForeground: "#0C1929",
639
+ secondary: "#1E3A5F",
640
+ secondaryForeground: "#DBEAFE",
641
+ error: "#F87171",
642
+ errorForeground: "#1C1917",
643
+ warning: "#FBBF24",
644
+ success: "#4ADE80",
645
+ surface: "#1E293B",
646
+ background: "#0F172A",
647
+ text: "#F1F5F9",
648
+ textMuted: "#94A3B8",
649
+ textDisabled: "#334155",
650
+ border: "#334155",
651
+ borderFocus: "#60A5FA",
652
+ inputBackground: "#1E293B"
459
653
  },
460
654
  typography: {
461
655
  fontFamily: "Inter, system-ui, sans-serif",
462
656
  scale: "comfortable",
463
- questionSize: "1.125rem",
657
+ questionSize: "1.0625rem",
464
658
  labelSize: "0.875rem",
465
659
  helpTextSize: "0.8125rem",
466
660
  bodySize: "0.9375rem"
467
661
  },
468
- shape: { radius: "none", inputRadius: "0px", buttonRadius: "0px", cardRadius: "0px" },
662
+ shape: { radius: "sm", inputRadius: "6px", buttonRadius: "6px", cardRadius: "8px" },
663
+ spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
664
+ layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
665
+ };
666
+ var stripeLight = {
667
+ colors: {
668
+ primary: "#635BFF",
669
+ primaryForeground: "#FFFFFF",
670
+ secondary: "#E8E6FF",
671
+ secondaryForeground: "#32297D",
672
+ error: "#DF1B41",
673
+ errorForeground: "#FFFFFF",
674
+ warning: "#D97706",
675
+ success: "#30B130",
676
+ surface: "#FFFFFF",
677
+ background: "#F6F9FC",
678
+ text: "#1A1F36",
679
+ textMuted: "#697386",
680
+ textDisabled: "#C1C9D2",
681
+ border: "#E3E8EE",
682
+ borderFocus: "#635BFF",
683
+ inputBackground: "#FFFFFF"
684
+ },
685
+ typography: {
686
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
687
+ scale: "comfortable",
688
+ questionSize: "1rem",
689
+ labelSize: "0.875rem",
690
+ helpTextSize: "0.8125rem",
691
+ bodySize: "0.9375rem"
692
+ },
693
+ shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
469
694
  spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
470
695
  layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
471
696
  };
472
- var modernPreset = {
697
+ var stripeDark = {
473
698
  colors: {
474
- primary: "#6366F1",
475
- primaryForeground: "#ffffff",
476
- secondary: "#8B5CF6",
477
- secondaryForeground: "#ffffff",
478
- error: "#F43F5E",
479
- errorForeground: "#ffffff",
480
- warning: "#F59E0B",
481
- success: "#22C55E",
482
- surface: "#ffffff",
699
+ primary: "#7A73FF",
700
+ primaryForeground: "#FFFFFF",
701
+ secondary: "#2D2A5E",
702
+ secondaryForeground: "#CBC8FF",
703
+ error: "#F93A5E",
704
+ errorForeground: "#FFFFFF",
705
+ warning: "#FBBF24",
706
+ success: "#4ADE80",
707
+ surface: "#1C2033",
708
+ background: "#0A0E1A",
709
+ text: "#E3E5EA",
710
+ textMuted: "#8992A7",
711
+ textDisabled: "#3C4257",
712
+ border: "#2C3046",
713
+ borderFocus: "#7A73FF",
714
+ inputBackground: "#1C2033"
715
+ },
716
+ typography: {
717
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
718
+ scale: "comfortable",
719
+ questionSize: "1rem",
720
+ labelSize: "0.875rem",
721
+ helpTextSize: "0.8125rem",
722
+ bodySize: "0.9375rem"
723
+ },
724
+ shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
725
+ spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
726
+ layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
727
+ };
728
+ var githubLight = {
729
+ colors: {
730
+ primary: "#1F6FEB",
731
+ primaryForeground: "#FFFFFF",
732
+ secondary: "#DDF4FF",
733
+ secondaryForeground: "#0550AE",
734
+ error: "#CF222E",
735
+ errorForeground: "#FFFFFF",
736
+ warning: "#9A6700",
737
+ success: "#1A7F37",
738
+ surface: "#FFFFFF",
739
+ background: "#F6F8FA",
740
+ text: "#1F2328",
741
+ textMuted: "#656D76",
742
+ textDisabled: "#B1BAC4",
743
+ border: "#D0D7DE",
744
+ borderFocus: "#1F6FEB",
745
+ inputBackground: "#FFFFFF"
746
+ },
747
+ typography: {
748
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif",
749
+ scale: "comfortable",
750
+ questionSize: "1rem",
751
+ labelSize: "0.875rem",
752
+ helpTextSize: "0.75rem",
753
+ bodySize: "0.875rem"
754
+ },
755
+ shape: { radius: "md", inputRadius: "6px", buttonRadius: "6px", cardRadius: "6px" },
756
+ spacing: { base: 16, sectionGap: 28, fieldGap: 20, inputPaddingX: 12, inputPaddingY: 8 },
757
+ layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
758
+ };
759
+ var githubDark = {
760
+ colors: {
761
+ primary: "#58A6FF",
762
+ primaryForeground: "#0D1117",
763
+ secondary: "#172B4D",
764
+ secondaryForeground: "#A5D6FF",
765
+ error: "#F85149",
766
+ errorForeground: "#0D1117",
767
+ warning: "#E3B341",
768
+ success: "#3FB950",
769
+ surface: "#161B22",
770
+ background: "#0D1117",
771
+ text: "#E6EDF3",
772
+ textMuted: "#8B949E",
773
+ textDisabled: "#3D444D",
774
+ border: "#30363D",
775
+ borderFocus: "#58A6FF",
776
+ inputBackground: "#161B22"
777
+ },
778
+ typography: {
779
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif",
780
+ scale: "comfortable",
781
+ questionSize: "1rem",
782
+ labelSize: "0.875rem",
783
+ helpTextSize: "0.75rem",
784
+ bodySize: "0.875rem"
785
+ },
786
+ shape: { radius: "md", inputRadius: "6px", buttonRadius: "6px", cardRadius: "6px" },
787
+ spacing: { base: 16, sectionGap: 28, fieldGap: 20, inputPaddingX: 12, inputPaddingY: 8 },
788
+ layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
789
+ };
790
+ var vercelLight = {
791
+ colors: {
792
+ primary: "#000000",
793
+ primaryForeground: "#FFFFFF",
794
+ secondary: "#F5F5F5",
795
+ secondaryForeground: "#171717",
796
+ error: "#E5484D",
797
+ errorForeground: "#FFFFFF",
798
+ warning: "#F5A623",
799
+ success: "#45A557",
800
+ surface: "#FFFFFF",
483
801
  background: "#FAFAFA",
484
- text: "#18181B",
485
- textMuted: "#71717A",
486
- textDisabled: "#D4D4D8",
487
- border: "#E4E4E7",
488
- borderFocus: "#6366F1",
489
- inputBackground: "#FAFAFA"
802
+ text: "#171717",
803
+ textMuted: "#666666",
804
+ textDisabled: "#C7C7C7",
805
+ border: "#EAEAEA",
806
+ borderFocus: "#000000",
807
+ inputBackground: "#FFFFFF"
490
808
  },
491
809
  typography: {
492
- fontFamily: "'Plus Jakarta Sans', Inter, system-ui, sans-serif",
810
+ fontFamily: "'Geist', Inter, -apple-system, sans-serif",
493
811
  scale: "comfortable",
494
- questionSize: "1.25rem",
812
+ questionSize: "1rem",
495
813
  labelSize: "0.875rem",
496
814
  helpTextSize: "0.8125rem",
497
- bodySize: "1rem"
815
+ bodySize: "0.875rem"
498
816
  },
499
- shape: { radius: "lg", inputRadius: "12px", buttonRadius: "12px", cardRadius: "16px" },
500
- spacing: { base: 16, sectionGap: 40, fieldGap: 28, inputPaddingX: 16, inputPaddingY: 12 },
501
- layout: { maxWidth: "680px", alignment: "center", progressPosition: "top", sectionLayout: "card" }
817
+ shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
818
+ spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
819
+ layout: { maxWidth: "600px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
820
+ };
821
+ var vercelDark = {
822
+ colors: {
823
+ primary: "#FFFFFF",
824
+ primaryForeground: "#000000",
825
+ secondary: "#1A1A1A",
826
+ secondaryForeground: "#EDEDED",
827
+ error: "#E5484D",
828
+ errorForeground: "#FFFFFF",
829
+ warning: "#F5A623",
830
+ success: "#45A557",
831
+ surface: "#111111",
832
+ background: "#000000",
833
+ text: "#EDEDED",
834
+ textMuted: "#888888",
835
+ textDisabled: "#444444",
836
+ border: "#333333",
837
+ borderFocus: "#FFFFFF",
838
+ inputBackground: "#111111"
839
+ },
840
+ typography: {
841
+ fontFamily: "'Geist', Inter, -apple-system, sans-serif",
842
+ scale: "comfortable",
843
+ questionSize: "1rem",
844
+ labelSize: "0.875rem",
845
+ helpTextSize: "0.8125rem",
846
+ bodySize: "0.875rem"
847
+ },
848
+ shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
849
+ spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
850
+ layout: { maxWidth: "600px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
851
+ };
852
+ var shopifyLight = {
853
+ colors: {
854
+ primary: "#008060",
855
+ primaryForeground: "#FFFFFF",
856
+ secondary: "#E3F1DF",
857
+ secondaryForeground: "#1A4D2E",
858
+ error: "#D72C0D",
859
+ errorForeground: "#FFFFFF",
860
+ warning: "#B98900",
861
+ success: "#008060",
862
+ surface: "#FFFFFF",
863
+ background: "#F6F6F7",
864
+ text: "#202223",
865
+ textMuted: "#6D7175",
866
+ textDisabled: "#BABEC3",
867
+ border: "#C9CCCF",
868
+ borderFocus: "#008060",
869
+ inputBackground: "#FFFFFF"
870
+ },
871
+ typography: {
872
+ fontFamily: "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
873
+ scale: "comfortable",
874
+ questionSize: "1rem",
875
+ labelSize: "0.875rem",
876
+ helpTextSize: "0.8125rem",
877
+ bodySize: "0.9375rem"
878
+ },
879
+ shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
880
+ spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
881
+ layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
882
+ };
883
+ var shopifyDark = {
884
+ colors: {
885
+ primary: "#36D399",
886
+ primaryForeground: "#0D2818",
887
+ secondary: "#1A3A2A",
888
+ secondaryForeground: "#B5E4CA",
889
+ error: "#FE6B6B",
890
+ errorForeground: "#1C1110",
891
+ warning: "#FFD60A",
892
+ success: "#36D399",
893
+ surface: "#1A1C1E",
894
+ background: "#111213",
895
+ text: "#E3E5E7",
896
+ textMuted: "#8C9196",
897
+ textDisabled: "#44474A",
898
+ border: "#333638",
899
+ borderFocus: "#36D399",
900
+ inputBackground: "#1A1C1E"
901
+ },
902
+ typography: {
903
+ fontFamily: "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
904
+ scale: "comfortable",
905
+ questionSize: "1rem",
906
+ labelSize: "0.875rem",
907
+ helpTextSize: "0.8125rem",
908
+ bodySize: "0.9375rem"
909
+ },
910
+ shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
911
+ spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
912
+ layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
913
+ };
914
+ var slackLight = {
915
+ colors: {
916
+ primary: "#611F69",
917
+ primaryForeground: "#FFFFFF",
918
+ secondary: "#F3E8F5",
919
+ secondaryForeground: "#4A154B",
920
+ error: "#E01E5A",
921
+ errorForeground: "#FFFFFF",
922
+ warning: "#ECB22E",
923
+ success: "#2EB67D",
924
+ surface: "#FFFFFF",
925
+ background: "#F8F8F8",
926
+ text: "#1D1C1D",
927
+ textMuted: "#616061",
928
+ textDisabled: "#B9B9B9",
929
+ border: "#DDDDDD",
930
+ borderFocus: "#611F69",
931
+ inputBackground: "#FFFFFF"
932
+ },
933
+ typography: {
934
+ fontFamily: "'Lato', 'Helvetica Neue', Helvetica, sans-serif",
935
+ scale: "comfortable",
936
+ questionSize: "1.0625rem",
937
+ labelSize: "0.875rem",
938
+ helpTextSize: "0.8125rem",
939
+ bodySize: "0.9375rem"
940
+ },
941
+ shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "10px" },
942
+ spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
943
+ layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
944
+ };
945
+ var slackDark = {
946
+ colors: {
947
+ primary: "#D4A8DB",
948
+ primaryForeground: "#1A0A1E",
949
+ secondary: "#2C1332",
950
+ secondaryForeground: "#E2C6E9",
951
+ error: "#F5638B",
952
+ errorForeground: "#1C0E14",
953
+ warning: "#F0CA4D",
954
+ success: "#4FCEA2",
955
+ surface: "#1A1D21",
956
+ background: "#0F1114",
957
+ text: "#D1D2D3",
958
+ textMuted: "#9B9C9E",
959
+ textDisabled: "#4D4D4F",
960
+ border: "#383A3E",
961
+ borderFocus: "#D4A8DB",
962
+ inputBackground: "#1A1D21"
963
+ },
964
+ typography: {
965
+ fontFamily: "'Lato', 'Helvetica Neue', Helvetica, sans-serif",
966
+ scale: "comfortable",
967
+ questionSize: "1.0625rem",
968
+ labelSize: "0.875rem",
969
+ helpTextSize: "0.8125rem",
970
+ bodySize: "0.9375rem"
971
+ },
972
+ shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "10px" },
973
+ spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
974
+ layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
975
+ };
976
+ var tailwindLight = {
977
+ colors: {
978
+ primary: "#4F46E5",
979
+ primaryForeground: "#FFFFFF",
980
+ secondary: "#EEF2FF",
981
+ secondaryForeground: "#3730A3",
982
+ error: "#DC2626",
983
+ errorForeground: "#FFFFFF",
984
+ warning: "#D97706",
985
+ success: "#059669",
986
+ surface: "#FFFFFF",
987
+ background: "#F9FAFB",
988
+ text: "#111827",
989
+ textMuted: "#6B7280",
990
+ textDisabled: "#D1D5DB",
991
+ border: "#E5E7EB",
992
+ borderFocus: "#4F46E5",
993
+ inputBackground: "#FFFFFF"
994
+ },
995
+ typography: {
996
+ fontFamily: "Inter, system-ui, sans-serif",
997
+ scale: "comfortable",
998
+ questionSize: "1rem",
999
+ labelSize: "0.875rem",
1000
+ helpTextSize: "0.8125rem",
1001
+ bodySize: "0.875rem"
1002
+ },
1003
+ shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
1004
+ spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 14, inputPaddingY: 10 },
1005
+ layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
502
1006
  };
503
- var modernDarkPreset = {
1007
+ var tailwindDark = {
504
1008
  colors: {
505
1009
  primary: "#818CF8",
506
1010
  primaryForeground: "#1E1B4B",
507
- secondary: "#A78BFA",
508
- secondaryForeground: "#1E1B4B",
509
- error: "#FB7185",
510
- errorForeground: "#1E1B4B",
1011
+ secondary: "#1E1B4B",
1012
+ secondaryForeground: "#C7D2FE",
1013
+ error: "#F87171",
1014
+ errorForeground: "#1C1917",
511
1015
  warning: "#FBBF24",
512
- success: "#4ADE80",
513
- surface: "#1E1B4B",
514
- background: "#13111C",
515
- text: "#E8E6F0",
516
- textMuted: "#A1A1AA",
517
- textDisabled: "#3F3F46",
518
- border: "#2E2B4A",
1016
+ success: "#34D399",
1017
+ surface: "#1F2937",
1018
+ background: "#111827",
1019
+ text: "#F9FAFB",
1020
+ textMuted: "#9CA3AF",
1021
+ textDisabled: "#374151",
1022
+ border: "#374151",
519
1023
  borderFocus: "#818CF8",
520
- inputBackground: "#1E1B4B"
1024
+ inputBackground: "#1F2937"
521
1025
  },
522
1026
  typography: {
523
- fontFamily: "'Plus Jakarta Sans', Inter, system-ui, sans-serif",
1027
+ fontFamily: "Inter, system-ui, sans-serif",
524
1028
  scale: "comfortable",
525
- questionSize: "1.25rem",
1029
+ questionSize: "1rem",
526
1030
  labelSize: "0.875rem",
527
1031
  helpTextSize: "0.8125rem",
528
- bodySize: "1rem"
1032
+ bodySize: "0.875rem"
529
1033
  },
530
- shape: { radius: "lg", inputRadius: "12px", buttonRadius: "12px", cardRadius: "16px" },
531
- spacing: { base: 16, sectionGap: 40, fieldGap: 28, inputPaddingX: 16, inputPaddingY: 12 },
532
- layout: { maxWidth: "680px", alignment: "center", progressPosition: "top", sectionLayout: "card" }
1034
+ shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
1035
+ spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 14, inputPaddingY: 10 },
1036
+ layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
533
1037
  };
534
- var clinicalPreset = {
1038
+ var clinicalLight = {
535
1039
  colors: {
536
- primary: "#0284C7",
537
- primaryForeground: "#ffffff",
538
- secondary: "#0891B2",
539
- secondaryForeground: "#ffffff",
540
- error: "#DC2626",
541
- errorForeground: "#ffffff",
542
- warning: "#D97706",
543
- success: "#16A34A",
544
- surface: "#ffffff",
1040
+ primary: "#0369A1",
1041
+ primaryForeground: "#FFFFFF",
1042
+ secondary: "#E0F2FE",
1043
+ secondaryForeground: "#0C4A6E",
1044
+ error: "#B91C1C",
1045
+ errorForeground: "#FFFFFF",
1046
+ warning: "#B45309",
1047
+ success: "#15803D",
1048
+ surface: "#FFFFFF",
545
1049
  background: "#F0F9FF",
546
1050
  text: "#0C4A6E",
547
- textMuted: "#64748B",
548
- textDisabled: "#CBD5E1",
1051
+ textMuted: "#4B6B82",
1052
+ textDisabled: "#BAD6E9",
549
1053
  border: "#BAE6FD",
550
- borderFocus: "#0284C7",
551
- inputBackground: "#ffffff"
1054
+ borderFocus: "#0369A1",
1055
+ inputBackground: "#FFFFFF"
552
1056
  },
553
1057
  typography: {
554
1058
  fontFamily: "'Source Sans 3', 'Segoe UI', system-ui, sans-serif",
@@ -562,22 +1066,22 @@ var clinicalPreset = {
562
1066
  spacing: { base: 16, sectionGap: 28, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
563
1067
  layout: { maxWidth: "680px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
564
1068
  };
565
- var clinicalDarkPreset = {
1069
+ var clinicalDark = {
566
1070
  colors: {
567
1071
  primary: "#38BDF8",
568
1072
  primaryForeground: "#0C1929",
569
- secondary: "#22D3EE",
570
- secondaryForeground: "#0C1929",
571
- error: "#F87171",
572
- errorForeground: "#0C1929",
573
- warning: "#FBBF24",
574
- success: "#34D399",
1073
+ secondary: "#0C3554",
1074
+ secondaryForeground: "#BAE6FD",
1075
+ error: "#FCA5A5",
1076
+ errorForeground: "#1C1110",
1077
+ warning: "#FCD34D",
1078
+ success: "#6EE7B7",
575
1079
  surface: "#0F2438",
576
- background: "#0C1929",
1080
+ background: "#0B1929",
577
1081
  text: "#E0F2FE",
578
- textMuted: "#7DD3FC",
1082
+ textMuted: "#7DC4E8",
579
1083
  textDisabled: "#1E3A5F",
580
- border: "#1E3A5F",
1084
+ border: "#1C3A5A",
581
1085
  borderFocus: "#38BDF8",
582
1086
  inputBackground: "#0F2438"
583
1087
  },
@@ -593,86 +1097,210 @@ var clinicalDarkPreset = {
593
1097
  spacing: { base: 16, sectionGap: 28, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
594
1098
  layout: { maxWidth: "680px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
595
1099
  };
596
- var playfulPreset = {
1100
+ var notionLight = {
597
1101
  colors: {
598
- primary: "#EC4899",
599
- primaryForeground: "#ffffff",
600
- secondary: "#8B5CF6",
601
- secondaryForeground: "#ffffff",
602
- error: "#EF4444",
603
- errorForeground: "#ffffff",
604
- warning: "#F59E0B",
605
- success: "#10B981",
606
- surface: "#ffffff",
607
- background: "#FFF7ED",
608
- text: "#1C1917",
1102
+ primary: "#2383E2",
1103
+ primaryForeground: "#FFFFFF",
1104
+ secondary: "#EBF5FB",
1105
+ secondaryForeground: "#1B4F7B",
1106
+ error: "#EB5757",
1107
+ errorForeground: "#FFFFFF",
1108
+ warning: "#CB912F",
1109
+ success: "#0F7B6C",
1110
+ surface: "#FFFFFF",
1111
+ background: "#FFFFFF",
1112
+ text: "#37352F",
1113
+ textMuted: "#787774",
1114
+ textDisabled: "#C3C2BF",
1115
+ border: "#E3E2E0",
1116
+ borderFocus: "#2383E2",
1117
+ inputBackground: "#F7F6F3"
1118
+ },
1119
+ typography: {
1120
+ fontFamily: "'Lyon Text', Georgia, 'Times New Roman', serif",
1121
+ scale: "comfortable",
1122
+ questionSize: "1.0625rem",
1123
+ labelSize: "0.875rem",
1124
+ helpTextSize: "0.8125rem",
1125
+ bodySize: "1rem"
1126
+ },
1127
+ shape: { radius: "sm", inputRadius: "4px", buttonRadius: "4px", cardRadius: "4px" },
1128
+ spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
1129
+ layout: { maxWidth: "680px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
1130
+ };
1131
+ var notionDark = {
1132
+ colors: {
1133
+ primary: "#529CCA",
1134
+ primaryForeground: "#FFFFFF",
1135
+ secondary: "#143046",
1136
+ secondaryForeground: "#9ECBEB",
1137
+ error: "#FF6B6B",
1138
+ errorForeground: "#1C1210",
1139
+ warning: "#E0AD50",
1140
+ success: "#4DAB9A",
1141
+ surface: "#2F3437",
1142
+ background: "#191919",
1143
+ text: "#E6E3DD",
1144
+ textMuted: "#9B9A97",
1145
+ textDisabled: "#4F4F4F",
1146
+ border: "#434343",
1147
+ borderFocus: "#529CCA",
1148
+ inputBackground: "#2F3437"
1149
+ },
1150
+ typography: {
1151
+ fontFamily: "'Lyon Text', Georgia, 'Times New Roman', serif",
1152
+ scale: "comfortable",
1153
+ questionSize: "1.0625rem",
1154
+ labelSize: "0.875rem",
1155
+ helpTextSize: "0.8125rem",
1156
+ bodySize: "1rem"
1157
+ },
1158
+ shape: { radius: "sm", inputRadius: "4px", buttonRadius: "4px", cardRadius: "4px" },
1159
+ spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
1160
+ layout: { maxWidth: "680px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
1161
+ };
1162
+ var sunsetLight = {
1163
+ colors: {
1164
+ primary: "#C2410C",
1165
+ primaryForeground: "#FFFFFF",
1166
+ secondary: "#FFF7ED",
1167
+ secondaryForeground: "#7C2D12",
1168
+ error: "#B91C1C",
1169
+ errorForeground: "#FFFFFF",
1170
+ warning: "#A16207",
1171
+ success: "#15803D",
1172
+ surface: "#FFFFFF",
1173
+ background: "#FFFBF5",
1174
+ text: "#292524",
609
1175
  textMuted: "#78716C",
610
1176
  textDisabled: "#D6D3D1",
611
- border: "#FDE68A",
612
- borderFocus: "#EC4899",
613
- inputBackground: "#FFFBEB"
1177
+ border: "#E7E5E4",
1178
+ borderFocus: "#C2410C",
1179
+ inputBackground: "#FFFFFF"
614
1180
  },
615
1181
  typography: {
616
- fontFamily: "'Nunito', 'Comic Neue', system-ui, sans-serif",
617
- scale: "spacious",
618
- questionSize: "1.25rem",
619
- labelSize: "0.9375rem",
620
- helpTextSize: "0.875rem",
621
- bodySize: "1rem"
1182
+ fontFamily: "'DM Sans', Inter, system-ui, sans-serif",
1183
+ scale: "comfortable",
1184
+ questionSize: "1.125rem",
1185
+ labelSize: "0.875rem",
1186
+ helpTextSize: "0.8125rem",
1187
+ bodySize: "0.9375rem"
622
1188
  },
623
- shape: { radius: "full", inputRadius: "9999px", buttonRadius: "9999px", cardRadius: "20px" },
624
- spacing: { base: 18, sectionGap: 36, fieldGap: 28, inputPaddingX: 18, inputPaddingY: 12 },
625
- layout: { maxWidth: "600px", alignment: "center", progressPosition: "top", sectionLayout: "card" }
1189
+ shape: { radius: "lg", inputRadius: "10px", buttonRadius: "10px", cardRadius: "14px" },
1190
+ spacing: { base: 16, sectionGap: 36, fieldGap: 26, inputPaddingX: 14, inputPaddingY: 11 },
1191
+ layout: { maxWidth: "640px", alignment: "center", progressPosition: "top", sectionLayout: "card" }
626
1192
  };
627
- var playfulDarkPreset = {
1193
+ var sunsetDark = {
628
1194
  colors: {
629
- primary: "#F472B6",
630
- primaryForeground: "#1A0A14",
631
- secondary: "#A78BFA",
632
- secondaryForeground: "#1A0A14",
1195
+ primary: "#FB923C",
1196
+ primaryForeground: "#1C1210",
1197
+ secondary: "#3D1F0E",
1198
+ secondaryForeground: "#FED7AA",
633
1199
  error: "#FCA5A5",
634
- errorForeground: "#1A0A14",
1200
+ errorForeground: "#1C1210",
635
1201
  warning: "#FCD34D",
636
1202
  success: "#6EE7B7",
637
- surface: "#2D1F2B",
638
- background: "#1A0F19",
639
- text: "#FDF2F8",
640
- textMuted: "#D4A9C4",
641
- textDisabled: "#4A3248",
642
- border: "#5C3D56",
643
- borderFocus: "#F472B6",
644
- inputBackground: "#2D1F2B"
1203
+ surface: "#292019",
1204
+ background: "#1C1510",
1205
+ text: "#F5F0EB",
1206
+ textMuted: "#B0A89E",
1207
+ textDisabled: "#4A413A",
1208
+ border: "#3D352D",
1209
+ borderFocus: "#FB923C",
1210
+ inputBackground: "#292019"
645
1211
  },
646
1212
  typography: {
647
- fontFamily: "'Nunito', 'Comic Neue', system-ui, sans-serif",
1213
+ fontFamily: "'DM Sans', Inter, system-ui, sans-serif",
1214
+ scale: "comfortable",
1215
+ questionSize: "1.125rem",
1216
+ labelSize: "0.875rem",
1217
+ helpTextSize: "0.8125rem",
1218
+ bodySize: "0.9375rem"
1219
+ },
1220
+ shape: { radius: "lg", inputRadius: "10px", buttonRadius: "10px", cardRadius: "14px" },
1221
+ spacing: { base: 16, sectionGap: 36, fieldGap: 26, inputPaddingX: 14, inputPaddingY: 11 },
1222
+ layout: { maxWidth: "640px", alignment: "center", progressPosition: "top", sectionLayout: "card" }
1223
+ };
1224
+ var roseLight = {
1225
+ colors: {
1226
+ primary: "#BE185D",
1227
+ primaryForeground: "#FFFFFF",
1228
+ secondary: "#FFF1F2",
1229
+ secondaryForeground: "#881337",
1230
+ error: "#DC2626",
1231
+ errorForeground: "#FFFFFF",
1232
+ warning: "#D97706",
1233
+ success: "#059669",
1234
+ surface: "#FFFFFF",
1235
+ background: "#FFFBFB",
1236
+ text: "#1C1917",
1237
+ textMuted: "#737373",
1238
+ textDisabled: "#D4D4D4",
1239
+ border: "#FECDD3",
1240
+ borderFocus: "#BE185D",
1241
+ inputBackground: "#FFFFFF"
1242
+ },
1243
+ typography: {
1244
+ fontFamily: "'Plus Jakarta Sans', Inter, system-ui, sans-serif",
648
1245
  scale: "spacious",
649
- questionSize: "1.25rem",
650
- labelSize: "0.9375rem",
651
- helpTextSize: "0.875rem",
652
- bodySize: "1rem"
1246
+ questionSize: "1.1875rem",
1247
+ labelSize: "0.875rem",
1248
+ helpTextSize: "0.8125rem",
1249
+ bodySize: "0.9375rem"
653
1250
  },
654
- shape: { radius: "full", inputRadius: "9999px", buttonRadius: "9999px", cardRadius: "20px" },
655
- spacing: { base: 18, sectionGap: 36, fieldGap: 28, inputPaddingX: 18, inputPaddingY: 12 },
656
- layout: { maxWidth: "600px", alignment: "center", progressPosition: "top", sectionLayout: "card" }
1251
+ shape: { radius: "lg", inputRadius: "12px", buttonRadius: "12px", cardRadius: "16px" },
1252
+ spacing: { base: 18, sectionGap: 36, fieldGap: 28, inputPaddingX: 16, inputPaddingY: 12 },
1253
+ layout: { maxWidth: "640px", alignment: "center", progressPosition: "top", sectionLayout: "card" }
657
1254
  };
658
- var highContrastPreset = {
1255
+ var roseDark = {
659
1256
  colors: {
660
- primary: "#0000EE",
661
- primaryForeground: "#ffffff",
662
- secondary: "#6B21A8",
663
- secondaryForeground: "#ffffff",
1257
+ primary: "#FB7185",
1258
+ primaryForeground: "#1C0A12",
1259
+ secondary: "#3B0A22",
1260
+ secondaryForeground: "#FECDD3",
1261
+ error: "#F87171",
1262
+ errorForeground: "#1C1210",
1263
+ warning: "#FBBF24",
1264
+ success: "#34D399",
1265
+ surface: "#1F1318",
1266
+ background: "#150D11",
1267
+ text: "#FAF0F2",
1268
+ textMuted: "#C9A4AE",
1269
+ textDisabled: "#4A3039",
1270
+ border: "#3D2030",
1271
+ borderFocus: "#FB7185",
1272
+ inputBackground: "#1F1318"
1273
+ },
1274
+ typography: {
1275
+ fontFamily: "'Plus Jakarta Sans', Inter, system-ui, sans-serif",
1276
+ scale: "spacious",
1277
+ questionSize: "1.1875rem",
1278
+ labelSize: "0.875rem",
1279
+ helpTextSize: "0.8125rem",
1280
+ bodySize: "0.9375rem"
1281
+ },
1282
+ shape: { radius: "lg", inputRadius: "12px", buttonRadius: "12px", cardRadius: "16px" },
1283
+ spacing: { base: 18, sectionGap: 36, fieldGap: 28, inputPaddingX: 16, inputPaddingY: 12 },
1284
+ layout: { maxWidth: "640px", alignment: "center", progressPosition: "top", sectionLayout: "card" }
1285
+ };
1286
+ var highContrastLight = {
1287
+ colors: {
1288
+ primary: "#0000CC",
1289
+ primaryForeground: "#FFFFFF",
1290
+ secondary: "#E6E6FF",
1291
+ secondaryForeground: "#000066",
664
1292
  error: "#B91C1C",
665
- errorForeground: "#ffffff",
666
- warning: "#92400E",
1293
+ errorForeground: "#FFFFFF",
1294
+ warning: "#854D0E",
667
1295
  success: "#166534",
668
- surface: "#ffffff",
669
- background: "#ffffff",
1296
+ surface: "#FFFFFF",
1297
+ background: "#FFFFFF",
670
1298
  text: "#000000",
671
- textMuted: "#374151",
672
- textDisabled: "#9CA3AF",
1299
+ textMuted: "#333333",
1300
+ textDisabled: "#888888",
673
1301
  border: "#000000",
674
- borderFocus: "#0000EE",
675
- inputBackground: "#ffffff"
1302
+ borderFocus: "#0000CC",
1303
+ inputBackground: "#FFFFFF"
676
1304
  },
677
1305
  typography: {
678
1306
  fontFamily: "Arial, Helvetica, sans-serif",
@@ -686,24 +1314,24 @@ var highContrastPreset = {
686
1314
  spacing: { base: 20, sectionGap: 40, fieldGap: 32, inputPaddingX: 14, inputPaddingY: 12 },
687
1315
  layout: { maxWidth: "720px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
688
1316
  };
689
- var highContrastDarkPreset = {
1317
+ var highContrastDark = {
690
1318
  colors: {
691
- primary: "#93C5FD",
1319
+ primary: "#6CB4FF",
692
1320
  primaryForeground: "#000000",
693
- secondary: "#C084FC",
694
- secondaryForeground: "#000000",
695
- error: "#FCA5A5",
1321
+ secondary: "#002255",
1322
+ secondaryForeground: "#99CCFF",
1323
+ error: "#FF8A8A",
696
1324
  errorForeground: "#000000",
697
- warning: "#FCD34D",
698
- success: "#86EFAC",
699
- surface: "#000000",
1325
+ warning: "#FFD54F",
1326
+ success: "#69F0AE",
1327
+ surface: "#0A0A0A",
700
1328
  background: "#000000",
701
1329
  text: "#FFFFFF",
702
- textMuted: "#D1D5DB",
703
- textDisabled: "#6B7280",
1330
+ textMuted: "#CCCCCC",
1331
+ textDisabled: "#666666",
704
1332
  border: "#FFFFFF",
705
- borderFocus: "#93C5FD",
706
- inputBackground: "#000000"
1333
+ borderFocus: "#6CB4FF",
1334
+ inputBackground: "#0A0A0A"
707
1335
  },
708
1336
  typography: {
709
1337
  fontFamily: "Arial, Helvetica, sans-serif",
@@ -718,11 +1346,18 @@ var highContrastDarkPreset = {
718
1346
  layout: { maxWidth: "720px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
719
1347
  };
720
1348
  var PRESET_FAMILIES = {
721
- clean: { light: cleanPreset, dark: cleanDarkPreset, label: "Clean" },
722
- modern: { light: modernPreset, dark: modernDarkPreset, label: "Modern" },
723
- clinical: { light: clinicalPreset, dark: clinicalDarkPreset, label: "Clinical" },
724
- playful: { light: playfulPreset, dark: playfulDarkPreset, label: "Playful" },
725
- "high-contrast": { light: highContrastPreset, dark: highContrastDarkPreset, label: "High contrast" }
1349
+ clean: { light: cleanLight, dark: cleanDark, label: "Clean" },
1350
+ stripe: { light: stripeLight, dark: stripeDark, label: "Stripe" },
1351
+ github: { light: githubLight, dark: githubDark, label: "GitHub" },
1352
+ vercel: { light: vercelLight, dark: vercelDark, label: "Vercel" },
1353
+ shopify: { light: shopifyLight, dark: shopifyDark, label: "Shopify" },
1354
+ slack: { light: slackLight, dark: slackDark, label: "Slack" },
1355
+ tailwind: { light: tailwindLight, dark: tailwindDark, label: "Tailwind" },
1356
+ clinical: { light: clinicalLight, dark: clinicalDark, label: "Clinical" },
1357
+ notion: { light: notionLight, dark: notionDark, label: "Notion" },
1358
+ sunset: { light: sunsetLight, dark: sunsetDark, label: "Sunset" },
1359
+ rose: { light: roseLight, dark: roseDark, label: "Rose" },
1360
+ "high-contrast": { light: highContrastLight, dark: highContrastDark, label: "High contrast" }
726
1361
  };
727
1362
  var COMPARISON_PRESETS = Object.fromEntries(
728
1363
  Object.entries(PRESET_FAMILIES).map(([key, family]) => [
@@ -900,13 +1535,31 @@ function ThemeEditorThemeProvider({ theme, children }) {
900
1535
  }
901
1536
  function isDarkTheme(theme) {
902
1537
  const bg = theme.colors?.background ?? "#FFFFFF";
903
- const hex = bg.replace("#", "");
1538
+ let hex = bg.replace("#", "");
1539
+ if (hex.length === 3) {
1540
+ hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
1541
+ }
904
1542
  if (hex.length < 6) return false;
905
1543
  const r = parseInt(hex.slice(0, 2), 16);
906
1544
  const g = parseInt(hex.slice(2, 4), 16);
907
1545
  const b = parseInt(hex.slice(4, 6), 16);
908
1546
  return 0.299 * r + 0.587 * g + 0.114 * b < 128;
909
1547
  }
1548
+ function detectPresetFamily(theme) {
1549
+ const c = theme.colors;
1550
+ if (!c) return null;
1551
+ for (const [key, family] of Object.entries(PRESET_FAMILIES)) {
1552
+ for (const variant of ["light", "dark"]) {
1553
+ const preset = family[variant];
1554
+ const pc = preset.colors;
1555
+ if (!pc) continue;
1556
+ if (c.primary?.toLowerCase() === pc.primary?.toLowerCase() && c.background?.toLowerCase() === pc.background?.toLowerCase() && c.surface?.toLowerCase() === pc.surface?.toLowerCase()) {
1557
+ return key;
1558
+ }
1559
+ }
1560
+ }
1561
+ return null;
1562
+ }
910
1563
  var SECTIONS = [
911
1564
  {
912
1565
  id: "colors",
@@ -1027,6 +1680,7 @@ var SECTIONS = [
1027
1680
  ];
1028
1681
  function ThemeEditorInner({
1029
1682
  initialTheme,
1683
+ initialPreset,
1030
1684
  onChange,
1031
1685
  onSave,
1032
1686
  theme: chromeTheme,
@@ -1038,39 +1692,82 @@ function ThemeEditorInner({
1038
1692
  }) {
1039
1693
  const resolvedInitial = useMemo(
1040
1694
  () => initialTheme ?? resolveThemeFromDOM(),
1041
- // eslint-disable-next-line react-hooks/exhaustive-deps
1042
- []
1695
+ [initialTheme]
1043
1696
  );
1044
1697
  const [theme, setTheme] = useState(resolvedInitial);
1045
1698
  const [activeSection, setActiveSection] = useState("colors");
1046
- const [presetKey, setPresetKey] = useState("custom");
1699
+ const resolvedPresetInit = initialPreset ?? detectPresetFamily(resolvedInitial) ?? "custom";
1700
+ const [presetKey, setPresetKey] = useState(resolvedPresetInit);
1701
+ const presetKeyRef = useRef(presetKey);
1702
+ presetKeyRef.current = presetKey;
1047
1703
  const [showPalette, setShowPalette] = useState(false);
1048
1704
  const [showComparison, setShowComparison] = useState(false);
1049
1705
  const themeRef = useRef(theme);
1050
1706
  themeRef.current = theme;
1051
- const hasInitialTheme = useRef(initialTheme != null);
1707
+ const prevInitialRef = useRef(initialTheme);
1708
+ const prevPresetRef = useRef(initialPreset);
1709
+ useEffect(() => {
1710
+ if (!initialTheme) return;
1711
+ const themeChanged = JSON.stringify(initialTheme) !== JSON.stringify(prevInitialRef.current);
1712
+ const presetChanged = initialPreset !== prevPresetRef.current;
1713
+ if (!themeChanged && !presetChanged) return;
1714
+ prevInitialRef.current = initialTheme;
1715
+ prevPresetRef.current = initialPreset;
1716
+ setTheme(initialTheme);
1717
+ const resolvedPreset = initialPreset ?? detectPresetFamily(initialTheme) ?? "custom";
1718
+ setPresetKey(resolvedPreset);
1719
+ }, [initialTheme, initialPreset]);
1720
+ const mountReadyRef = useRef(false);
1052
1721
  useEffect(() => {
1053
- if (hasInitialTheme.current) return;
1054
1722
  if (typeof window === "undefined") return;
1723
+ const initialAttr = document.documentElement.getAttribute("data-theme");
1724
+ const lastAttrRef = { current: initialAttr };
1725
+ const readyTimer = setTimeout(() => {
1726
+ mountReadyRef.current = true;
1727
+ }, 500);
1055
1728
  const observer = new MutationObserver(() => {
1729
+ if (!mountReadyRef.current) return;
1730
+ const currentAttr = document.documentElement.getAttribute("data-theme");
1731
+ if (currentAttr === lastAttrRef.current) return;
1732
+ lastAttrRef.current = currentAttr;
1056
1733
  requestAnimationFrame(() => {
1057
- const resolved = resolveThemeFromDOM();
1058
- setTheme(resolved);
1059
- setPresetKey("custom");
1060
- onChange?.(resolved);
1734
+ const variant = currentAttr === "dark" ? "dark" : "light";
1735
+ let key = presetKeyRef.current;
1736
+ if (key === "custom") {
1737
+ const detected = detectPresetFamily(themeRef.current);
1738
+ if (detected) {
1739
+ key = detected;
1740
+ setPresetKey(detected);
1741
+ }
1742
+ }
1743
+ if (key !== "custom") {
1744
+ const family = PRESET_FAMILIES[key];
1745
+ if (family) {
1746
+ const preset = family[variant];
1747
+ setTheme(preset);
1748
+ onChange?.(preset, key);
1749
+ }
1750
+ } else {
1751
+ const resolved = resolveThemeFromDOM();
1752
+ setTheme(resolved);
1753
+ onChange?.(resolved, "custom");
1754
+ }
1061
1755
  });
1062
1756
  });
1063
1757
  observer.observe(document.documentElement, {
1064
1758
  attributes: true,
1065
1759
  attributeFilter: ["data-theme", "class"]
1066
1760
  });
1067
- return () => observer.disconnect();
1761
+ return () => {
1762
+ clearTimeout(readyTimer);
1763
+ observer.disconnect();
1764
+ };
1068
1765
  }, [onChange]);
1069
1766
  useEffect(() => {
1070
1767
  function handleKeyDown(e) {
1071
1768
  if ((e.metaKey || e.ctrlKey) && e.key === "s") {
1072
1769
  e.preventDefault();
1073
- onSave?.(themeRef.current);
1770
+ onSave?.(themeRef.current, presetKeyRef.current);
1074
1771
  }
1075
1772
  }
1076
1773
  window.addEventListener("keydown", handleKeyDown);
@@ -1083,7 +1780,7 @@ function ThemeEditorInner({
1083
1780
  ...prev,
1084
1781
  [section]: { ...prev[section], [key]: value }
1085
1782
  };
1086
- onChange?.(next);
1783
+ onChange?.(next, "custom");
1087
1784
  return next;
1088
1785
  });
1089
1786
  setPresetKey("custom");
@@ -1094,11 +1791,12 @@ function ThemeEditorInner({
1094
1791
  (key) => {
1095
1792
  const family = PRESET_FAMILIES[key];
1096
1793
  if (family) {
1097
- const variant = isDarkTheme(theme) ? "dark" : "light";
1794
+ const htmlTheme = typeof document !== "undefined" ? document.documentElement.getAttribute("data-theme") : null;
1795
+ const variant = htmlTheme === "dark" ? "dark" : htmlTheme === "light" ? "light" : isDarkTheme(theme) ? "dark" : "light";
1098
1796
  const preset = family[variant];
1099
1797
  setTheme(preset);
1100
1798
  setPresetKey(key);
1101
- onChange?.(preset);
1799
+ onChange?.(preset, key);
1102
1800
  }
1103
1801
  },
1104
1802
  [onChange, theme]
@@ -1125,7 +1823,7 @@ function ThemeEditorInner({
1125
1823
  const parsed = JSON.parse(reader.result);
1126
1824
  setTheme(parsed);
1127
1825
  setPresetKey("custom");
1128
- onChange?.(parsed);
1826
+ onChange?.(parsed, "custom");
1129
1827
  } catch {
1130
1828
  }
1131
1829
  };
@@ -1140,7 +1838,7 @@ function ThemeEditorInner({
1140
1838
  importCssFile(theme, (merged) => {
1141
1839
  setTheme(merged);
1142
1840
  setPresetKey("custom");
1143
- onChange?.(merged);
1841
+ onChange?.(merged, "custom");
1144
1842
  });
1145
1843
  }, [theme, onChange]);
1146
1844
  const currentSection = useMemo(
@@ -1201,7 +1899,7 @@ function ThemeEditorInner({
1201
1899
  children: "Compare"
1202
1900
  }
1203
1901
  ),
1204
- onSave && /* @__PURE__ */ jsx("button", { onClick: () => onSave(theme), className: "fcte-btn fcte-btn--primary", children: "Save" })
1902
+ onSave && /* @__PURE__ */ jsx("button", { onClick: () => onSave(theme, presetKey), className: "fcte-btn fcte-btn--primary", children: "Save" })
1205
1903
  ] })
1206
1904
  ] }),
1207
1905
  showPalette && /* @__PURE__ */ jsx(
@@ -1211,7 +1909,7 @@ function ThemeEditorInner({
1211
1909
  onApply: (newTheme) => {
1212
1910
  setTheme(newTheme);
1213
1911
  setPresetKey("custom");
1214
- onChange?.(newTheme);
1912
+ onChange?.(newTheme, "custom");
1215
1913
  setShowPalette(false);
1216
1914
  },
1217
1915
  onClose: () => setShowPalette(false)