@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.
- package/LICENSE.txt +51 -51
- package/README.md +139 -139
- package/dist/{chunk-4TN6YJDF.mjs → chunk-CYXJGOQH.mjs} +903 -205
- package/dist/{chunk-J5V6OVZO.mjs → chunk-GXKQCXIB.mjs} +344 -174
- package/dist/{chunk-VEP3DOCQ.mjs → chunk-IW654Z3M.mjs} +13 -16
- package/dist/{chunk-GZIV2XAD.mjs → chunk-MLP5EDWP.mjs} +166 -177
- package/dist/form-builder/index.d.mts +1 -1
- package/dist/form-builder/index.d.ts +1 -1
- package/dist/form-builder/index.js +480 -290
- package/dist/form-builder/index.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1967 -893
- package/dist/index.mjs +326 -121
- package/dist/response-viewer/index.d.mts +1 -1
- package/dist/response-viewer/index.d.ts +1 -1
- package/dist/response-viewer/index.js +165 -177
- package/dist/response-viewer/index.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/templates/index.js +13 -16
- package/dist/templates/index.mjs +1 -1
- package/dist/theme-editor/index.d.mts +11 -5
- package/dist/theme-editor/index.d.ts +11 -5
- package/dist/theme-editor/index.js +903 -205
- package/dist/theme-editor/index.mjs +1 -1
- package/package.json +18 -7
- package/theme-editor/styles.css +468 -466
|
@@ -309,18 +309,23 @@ var PREVIEW_SCHEMA = {
|
|
|
309
309
|
id: "theme-preview",
|
|
310
310
|
version: "1.0.0",
|
|
311
311
|
title: "Theme Preview",
|
|
312
|
-
description: "See how your theme looks
|
|
312
|
+
description: "See how your theme looks across every field type.",
|
|
313
|
+
settings: {
|
|
314
|
+
displayMode: "classic",
|
|
315
|
+
showProgress: false
|
|
316
|
+
},
|
|
313
317
|
sections: [
|
|
314
318
|
{
|
|
315
|
-
id: "
|
|
316
|
-
title: "
|
|
319
|
+
id: "s-text",
|
|
320
|
+
title: "Text Inputs",
|
|
317
321
|
questions: [
|
|
318
322
|
{
|
|
319
323
|
id: "name",
|
|
320
324
|
type: "short_text",
|
|
321
325
|
label: "Full Name",
|
|
322
326
|
required: true,
|
|
323
|
-
placeholder: "Jane Doe"
|
|
327
|
+
placeholder: "Jane Doe",
|
|
328
|
+
helpText: "Enter your full legal name."
|
|
324
329
|
},
|
|
325
330
|
{
|
|
326
331
|
id: "email",
|
|
@@ -329,6 +334,31 @@ var PREVIEW_SCHEMA = {
|
|
|
329
334
|
required: true,
|
|
330
335
|
placeholder: "jane@example.com"
|
|
331
336
|
},
|
|
337
|
+
{
|
|
338
|
+
id: "phone",
|
|
339
|
+
type: "phone",
|
|
340
|
+
label: "Phone Number",
|
|
341
|
+
placeholder: "(555) 123-4567"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: "website",
|
|
345
|
+
type: "url",
|
|
346
|
+
label: "Website",
|
|
347
|
+
placeholder: "https://example.com"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
id: "bio",
|
|
351
|
+
type: "long_text",
|
|
352
|
+
label: "Bio / Notes",
|
|
353
|
+
placeholder: "Tell us about yourself...",
|
|
354
|
+
helpText: "Markdown is supported."
|
|
355
|
+
}
|
|
356
|
+
]
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
id: "s-selection",
|
|
360
|
+
title: "Selection Fields",
|
|
361
|
+
questions: [
|
|
332
362
|
{
|
|
333
363
|
id: "department",
|
|
334
364
|
type: "dropdown",
|
|
@@ -336,20 +366,184 @@ var PREVIEW_SCHEMA = {
|
|
|
336
366
|
options: [
|
|
337
367
|
{ label: "Engineering", value: "engineering" },
|
|
338
368
|
{ label: "Design", value: "design" },
|
|
339
|
-
{ label: "Marketing", value: "marketing" }
|
|
369
|
+
{ label: "Marketing", value: "marketing" },
|
|
370
|
+
{ label: "Sales", value: "sales" }
|
|
340
371
|
]
|
|
341
372
|
},
|
|
373
|
+
{
|
|
374
|
+
id: "role",
|
|
375
|
+
type: "single_select",
|
|
376
|
+
label: "Role",
|
|
377
|
+
helpText: "Select one option.",
|
|
378
|
+
options: [
|
|
379
|
+
{ label: "Individual Contributor", value: "ic" },
|
|
380
|
+
{ label: "Team Lead", value: "lead" },
|
|
381
|
+
{ label: "Manager", value: "manager" },
|
|
382
|
+
{ label: "Director", value: "director" }
|
|
383
|
+
],
|
|
384
|
+
config: { type: "single_select", layout: "vertical" }
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
id: "skills",
|
|
388
|
+
type: "multi_select",
|
|
389
|
+
label: "Skills",
|
|
390
|
+
helpText: "Select all that apply.",
|
|
391
|
+
options: [
|
|
392
|
+
{ label: "JavaScript", value: "js" },
|
|
393
|
+
{ label: "TypeScript", value: "ts" },
|
|
394
|
+
{ label: "Python", value: "py" },
|
|
395
|
+
{ label: "Rust", value: "rust" },
|
|
396
|
+
{ label: "Go", value: "go" }
|
|
397
|
+
],
|
|
398
|
+
config: { type: "multi_select", layout: "vertical" }
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
id: "newsletter",
|
|
402
|
+
type: "boolean",
|
|
403
|
+
label: "Subscribe to newsletter?",
|
|
404
|
+
config: { type: "boolean", style: "toggle" }
|
|
405
|
+
}
|
|
406
|
+
]
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
id: "s-numeric",
|
|
410
|
+
title: "Numeric & Rating",
|
|
411
|
+
questions: [
|
|
412
|
+
{
|
|
413
|
+
id: "age",
|
|
414
|
+
type: "number",
|
|
415
|
+
label: "Age",
|
|
416
|
+
placeholder: "25",
|
|
417
|
+
config: { type: "number", min: 0, max: 150 }
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
id: "satisfaction",
|
|
421
|
+
type: "slider",
|
|
422
|
+
label: "Satisfaction Level",
|
|
423
|
+
config: { type: "slider", min: 0, max: 100, step: 5 }
|
|
424
|
+
},
|
|
342
425
|
{
|
|
343
426
|
id: "rating",
|
|
344
427
|
type: "rating",
|
|
345
|
-
label: "
|
|
428
|
+
label: "Overall Rating",
|
|
346
429
|
config: { type: "rating", max: 5 }
|
|
347
430
|
},
|
|
348
431
|
{
|
|
349
|
-
id: "
|
|
350
|
-
type: "
|
|
351
|
-
label: "
|
|
352
|
-
|
|
432
|
+
id: "nps",
|
|
433
|
+
type: "nps",
|
|
434
|
+
label: "How likely are you to recommend us?"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
id: "opinion",
|
|
438
|
+
type: "opinion_scale",
|
|
439
|
+
label: "How do you feel about the onboarding?",
|
|
440
|
+
config: {
|
|
441
|
+
type: "opinion_scale",
|
|
442
|
+
min: 1,
|
|
443
|
+
max: 5,
|
|
444
|
+
minLabel: "Very Poor",
|
|
445
|
+
maxLabel: "Excellent"
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
]
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
id: "s-datetime",
|
|
452
|
+
title: "Date & Time",
|
|
453
|
+
questions: [
|
|
454
|
+
{
|
|
455
|
+
id: "dob",
|
|
456
|
+
type: "date",
|
|
457
|
+
label: "Date of Birth",
|
|
458
|
+
config: { type: "date", disableFuture: true }
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
id: "preferred_time",
|
|
462
|
+
type: "time",
|
|
463
|
+
label: "Preferred Time",
|
|
464
|
+
config: { type: "time", format: "12h" }
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
id: "travel_dates",
|
|
468
|
+
type: "date_range",
|
|
469
|
+
label: "Travel Dates"
|
|
470
|
+
}
|
|
471
|
+
]
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
id: "s-media",
|
|
475
|
+
title: "Media & Files",
|
|
476
|
+
questions: [
|
|
477
|
+
{
|
|
478
|
+
id: "resume",
|
|
479
|
+
type: "file_upload",
|
|
480
|
+
label: "Upload Resume",
|
|
481
|
+
helpText: "PDF or DOCX, max 10 MB.",
|
|
482
|
+
config: { type: "file_upload", maxFiles: 1, maxSizeMb: 10, accept: [".pdf", ".docx"] }
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
id: "signature",
|
|
486
|
+
type: "signature",
|
|
487
|
+
label: "Signature",
|
|
488
|
+
helpText: "Draw your signature below."
|
|
489
|
+
}
|
|
490
|
+
]
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
id: "s-advanced",
|
|
494
|
+
title: "Advanced Fields",
|
|
495
|
+
questions: [
|
|
496
|
+
{
|
|
497
|
+
id: "experience",
|
|
498
|
+
type: "likert",
|
|
499
|
+
label: "Rate the following aspects:",
|
|
500
|
+
config: {
|
|
501
|
+
type: "likert",
|
|
502
|
+
labels: ["Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"]
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
id: "country",
|
|
507
|
+
type: "country_select",
|
|
508
|
+
label: "Country",
|
|
509
|
+
config: { type: "country_select", showFlags: true }
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
id: "consent",
|
|
513
|
+
type: "consent",
|
|
514
|
+
label: "Terms & Conditions",
|
|
515
|
+
config: {
|
|
516
|
+
type: "consent",
|
|
517
|
+
text: "I agree to the Terms of Service and Privacy Policy.",
|
|
518
|
+
checkboxLabel: "I agree"
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
]
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
id: "s-content",
|
|
525
|
+
title: "Content & Visual",
|
|
526
|
+
questions: [
|
|
527
|
+
{
|
|
528
|
+
id: "info",
|
|
529
|
+
type: "info_block",
|
|
530
|
+
label: "This is an informational message block. It can be used to display important notices."
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
id: "warning_info",
|
|
534
|
+
type: "info_block",
|
|
535
|
+
label: "Please double-check all information before submitting."
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
id: "divider",
|
|
539
|
+
type: "divider",
|
|
540
|
+
label: ""
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
id: "section_head",
|
|
544
|
+
type: "section_header",
|
|
545
|
+
label: "Section Header Example",
|
|
546
|
+
config: { type: "section_header", level: "h3", showDivider: true }
|
|
353
547
|
}
|
|
354
548
|
]
|
|
355
549
|
}
|
|
@@ -708,148 +902,458 @@ function PaletteGenerator({ theme, onApply, onClose }) {
|
|
|
708
902
|
}
|
|
709
903
|
|
|
710
904
|
// src/theme-editor/presets.ts
|
|
711
|
-
var
|
|
905
|
+
var cleanLight = {
|
|
712
906
|
colors: {
|
|
713
|
-
primary: "#
|
|
907
|
+
primary: "#2563EB",
|
|
714
908
|
primaryForeground: "#FFFFFF",
|
|
715
|
-
secondary: "#
|
|
716
|
-
secondaryForeground: "#
|
|
717
|
-
error: "#
|
|
909
|
+
secondary: "#DBEAFE",
|
|
910
|
+
secondaryForeground: "#1E3A5F",
|
|
911
|
+
error: "#DC2626",
|
|
718
912
|
errorForeground: "#FFFFFF",
|
|
719
|
-
warning: "#
|
|
720
|
-
success: "#
|
|
913
|
+
warning: "#D97706",
|
|
914
|
+
success: "#16A34A",
|
|
721
915
|
surface: "#FFFFFF",
|
|
722
|
-
background: "#
|
|
723
|
-
text: "#
|
|
724
|
-
textMuted: "#
|
|
725
|
-
textDisabled: "#
|
|
726
|
-
border: "#
|
|
727
|
-
borderFocus: "#
|
|
916
|
+
background: "#F8FAFC",
|
|
917
|
+
text: "#0F172A",
|
|
918
|
+
textMuted: "#64748B",
|
|
919
|
+
textDisabled: "#CBD5E1",
|
|
920
|
+
border: "#E2E8F0",
|
|
921
|
+
borderFocus: "#2563EB",
|
|
728
922
|
inputBackground: "#FFFFFF"
|
|
729
923
|
},
|
|
730
924
|
typography: {
|
|
731
925
|
fontFamily: "Inter, system-ui, sans-serif",
|
|
732
926
|
scale: "comfortable",
|
|
733
|
-
questionSize: "1.
|
|
927
|
+
questionSize: "1.0625rem",
|
|
734
928
|
labelSize: "0.875rem",
|
|
735
929
|
helpTextSize: "0.8125rem",
|
|
736
930
|
bodySize: "0.9375rem"
|
|
737
931
|
},
|
|
738
|
-
shape: { radius: "
|
|
932
|
+
shape: { radius: "sm", inputRadius: "6px", buttonRadius: "6px", cardRadius: "8px" },
|
|
739
933
|
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
740
|
-
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "
|
|
934
|
+
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
|
|
741
935
|
};
|
|
742
|
-
var
|
|
936
|
+
var cleanDark = {
|
|
743
937
|
colors: {
|
|
744
|
-
primary: "#
|
|
745
|
-
primaryForeground: "#
|
|
746
|
-
secondary: "#
|
|
747
|
-
secondaryForeground: "#
|
|
748
|
-
error: "#
|
|
749
|
-
errorForeground: "#
|
|
750
|
-
warning: "#
|
|
751
|
-
success: "#
|
|
752
|
-
surface: "#
|
|
753
|
-
background: "#
|
|
754
|
-
text: "#
|
|
755
|
-
textMuted: "#
|
|
756
|
-
textDisabled: "#
|
|
757
|
-
border: "#
|
|
758
|
-
borderFocus: "#
|
|
759
|
-
inputBackground: "#
|
|
938
|
+
primary: "#60A5FA",
|
|
939
|
+
primaryForeground: "#0C1929",
|
|
940
|
+
secondary: "#1E3A5F",
|
|
941
|
+
secondaryForeground: "#DBEAFE",
|
|
942
|
+
error: "#F87171",
|
|
943
|
+
errorForeground: "#1C1917",
|
|
944
|
+
warning: "#FBBF24",
|
|
945
|
+
success: "#4ADE80",
|
|
946
|
+
surface: "#1E293B",
|
|
947
|
+
background: "#0F172A",
|
|
948
|
+
text: "#F1F5F9",
|
|
949
|
+
textMuted: "#94A3B8",
|
|
950
|
+
textDisabled: "#334155",
|
|
951
|
+
border: "#334155",
|
|
952
|
+
borderFocus: "#60A5FA",
|
|
953
|
+
inputBackground: "#1E293B"
|
|
760
954
|
},
|
|
761
955
|
typography: {
|
|
762
956
|
fontFamily: "Inter, system-ui, sans-serif",
|
|
763
957
|
scale: "comfortable",
|
|
764
|
-
questionSize: "1.
|
|
958
|
+
questionSize: "1.0625rem",
|
|
765
959
|
labelSize: "0.875rem",
|
|
766
960
|
helpTextSize: "0.8125rem",
|
|
767
961
|
bodySize: "0.9375rem"
|
|
768
962
|
},
|
|
769
|
-
shape: { radius: "
|
|
963
|
+
shape: { radius: "sm", inputRadius: "6px", buttonRadius: "6px", cardRadius: "8px" },
|
|
964
|
+
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
965
|
+
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
|
|
966
|
+
};
|
|
967
|
+
var stripeLight = {
|
|
968
|
+
colors: {
|
|
969
|
+
primary: "#635BFF",
|
|
970
|
+
primaryForeground: "#FFFFFF",
|
|
971
|
+
secondary: "#E8E6FF",
|
|
972
|
+
secondaryForeground: "#32297D",
|
|
973
|
+
error: "#DF1B41",
|
|
974
|
+
errorForeground: "#FFFFFF",
|
|
975
|
+
warning: "#D97706",
|
|
976
|
+
success: "#30B130",
|
|
977
|
+
surface: "#FFFFFF",
|
|
978
|
+
background: "#F6F9FC",
|
|
979
|
+
text: "#1A1F36",
|
|
980
|
+
textMuted: "#697386",
|
|
981
|
+
textDisabled: "#C1C9D2",
|
|
982
|
+
border: "#E3E8EE",
|
|
983
|
+
borderFocus: "#635BFF",
|
|
984
|
+
inputBackground: "#FFFFFF"
|
|
985
|
+
},
|
|
986
|
+
typography: {
|
|
987
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
|
|
988
|
+
scale: "comfortable",
|
|
989
|
+
questionSize: "1rem",
|
|
990
|
+
labelSize: "0.875rem",
|
|
991
|
+
helpTextSize: "0.8125rem",
|
|
992
|
+
bodySize: "0.9375rem"
|
|
993
|
+
},
|
|
994
|
+
shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
|
|
770
995
|
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
771
996
|
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
|
|
772
997
|
};
|
|
773
|
-
var
|
|
998
|
+
var stripeDark = {
|
|
774
999
|
colors: {
|
|
775
|
-
primary: "#
|
|
776
|
-
primaryForeground: "#
|
|
777
|
-
secondary: "#
|
|
778
|
-
secondaryForeground: "#
|
|
779
|
-
error: "#
|
|
780
|
-
errorForeground: "#
|
|
781
|
-
warning: "#
|
|
782
|
-
success: "#
|
|
783
|
-
surface: "#
|
|
1000
|
+
primary: "#7A73FF",
|
|
1001
|
+
primaryForeground: "#FFFFFF",
|
|
1002
|
+
secondary: "#2D2A5E",
|
|
1003
|
+
secondaryForeground: "#CBC8FF",
|
|
1004
|
+
error: "#F93A5E",
|
|
1005
|
+
errorForeground: "#FFFFFF",
|
|
1006
|
+
warning: "#FBBF24",
|
|
1007
|
+
success: "#4ADE80",
|
|
1008
|
+
surface: "#1C2033",
|
|
1009
|
+
background: "#0A0E1A",
|
|
1010
|
+
text: "#E3E5EA",
|
|
1011
|
+
textMuted: "#8992A7",
|
|
1012
|
+
textDisabled: "#3C4257",
|
|
1013
|
+
border: "#2C3046",
|
|
1014
|
+
borderFocus: "#7A73FF",
|
|
1015
|
+
inputBackground: "#1C2033"
|
|
1016
|
+
},
|
|
1017
|
+
typography: {
|
|
1018
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
|
|
1019
|
+
scale: "comfortable",
|
|
1020
|
+
questionSize: "1rem",
|
|
1021
|
+
labelSize: "0.875rem",
|
|
1022
|
+
helpTextSize: "0.8125rem",
|
|
1023
|
+
bodySize: "0.9375rem"
|
|
1024
|
+
},
|
|
1025
|
+
shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
|
|
1026
|
+
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
1027
|
+
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
|
|
1028
|
+
};
|
|
1029
|
+
var githubLight = {
|
|
1030
|
+
colors: {
|
|
1031
|
+
primary: "#1F6FEB",
|
|
1032
|
+
primaryForeground: "#FFFFFF",
|
|
1033
|
+
secondary: "#DDF4FF",
|
|
1034
|
+
secondaryForeground: "#0550AE",
|
|
1035
|
+
error: "#CF222E",
|
|
1036
|
+
errorForeground: "#FFFFFF",
|
|
1037
|
+
warning: "#9A6700",
|
|
1038
|
+
success: "#1A7F37",
|
|
1039
|
+
surface: "#FFFFFF",
|
|
1040
|
+
background: "#F6F8FA",
|
|
1041
|
+
text: "#1F2328",
|
|
1042
|
+
textMuted: "#656D76",
|
|
1043
|
+
textDisabled: "#B1BAC4",
|
|
1044
|
+
border: "#D0D7DE",
|
|
1045
|
+
borderFocus: "#1F6FEB",
|
|
1046
|
+
inputBackground: "#FFFFFF"
|
|
1047
|
+
},
|
|
1048
|
+
typography: {
|
|
1049
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif",
|
|
1050
|
+
scale: "comfortable",
|
|
1051
|
+
questionSize: "1rem",
|
|
1052
|
+
labelSize: "0.875rem",
|
|
1053
|
+
helpTextSize: "0.75rem",
|
|
1054
|
+
bodySize: "0.875rem"
|
|
1055
|
+
},
|
|
1056
|
+
shape: { radius: "md", inputRadius: "6px", buttonRadius: "6px", cardRadius: "6px" },
|
|
1057
|
+
spacing: { base: 16, sectionGap: 28, fieldGap: 20, inputPaddingX: 12, inputPaddingY: 8 },
|
|
1058
|
+
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
|
|
1059
|
+
};
|
|
1060
|
+
var githubDark = {
|
|
1061
|
+
colors: {
|
|
1062
|
+
primary: "#58A6FF",
|
|
1063
|
+
primaryForeground: "#0D1117",
|
|
1064
|
+
secondary: "#172B4D",
|
|
1065
|
+
secondaryForeground: "#A5D6FF",
|
|
1066
|
+
error: "#F85149",
|
|
1067
|
+
errorForeground: "#0D1117",
|
|
1068
|
+
warning: "#E3B341",
|
|
1069
|
+
success: "#3FB950",
|
|
1070
|
+
surface: "#161B22",
|
|
1071
|
+
background: "#0D1117",
|
|
1072
|
+
text: "#E6EDF3",
|
|
1073
|
+
textMuted: "#8B949E",
|
|
1074
|
+
textDisabled: "#3D444D",
|
|
1075
|
+
border: "#30363D",
|
|
1076
|
+
borderFocus: "#58A6FF",
|
|
1077
|
+
inputBackground: "#161B22"
|
|
1078
|
+
},
|
|
1079
|
+
typography: {
|
|
1080
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif",
|
|
1081
|
+
scale: "comfortable",
|
|
1082
|
+
questionSize: "1rem",
|
|
1083
|
+
labelSize: "0.875rem",
|
|
1084
|
+
helpTextSize: "0.75rem",
|
|
1085
|
+
bodySize: "0.875rem"
|
|
1086
|
+
},
|
|
1087
|
+
shape: { radius: "md", inputRadius: "6px", buttonRadius: "6px", cardRadius: "6px" },
|
|
1088
|
+
spacing: { base: 16, sectionGap: 28, fieldGap: 20, inputPaddingX: 12, inputPaddingY: 8 },
|
|
1089
|
+
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
|
|
1090
|
+
};
|
|
1091
|
+
var vercelLight = {
|
|
1092
|
+
colors: {
|
|
1093
|
+
primary: "#000000",
|
|
1094
|
+
primaryForeground: "#FFFFFF",
|
|
1095
|
+
secondary: "#F5F5F5",
|
|
1096
|
+
secondaryForeground: "#171717",
|
|
1097
|
+
error: "#E5484D",
|
|
1098
|
+
errorForeground: "#FFFFFF",
|
|
1099
|
+
warning: "#F5A623",
|
|
1100
|
+
success: "#45A557",
|
|
1101
|
+
surface: "#FFFFFF",
|
|
784
1102
|
background: "#FAFAFA",
|
|
785
|
-
text: "#
|
|
786
|
-
textMuted: "#
|
|
787
|
-
textDisabled: "#
|
|
788
|
-
border: "#
|
|
789
|
-
borderFocus: "#
|
|
790
|
-
inputBackground: "#
|
|
1103
|
+
text: "#171717",
|
|
1104
|
+
textMuted: "#666666",
|
|
1105
|
+
textDisabled: "#C7C7C7",
|
|
1106
|
+
border: "#EAEAEA",
|
|
1107
|
+
borderFocus: "#000000",
|
|
1108
|
+
inputBackground: "#FFFFFF"
|
|
791
1109
|
},
|
|
792
1110
|
typography: {
|
|
793
|
-
fontFamily: "'
|
|
1111
|
+
fontFamily: "'Geist', Inter, -apple-system, sans-serif",
|
|
794
1112
|
scale: "comfortable",
|
|
795
|
-
questionSize: "
|
|
1113
|
+
questionSize: "1rem",
|
|
796
1114
|
labelSize: "0.875rem",
|
|
797
1115
|
helpTextSize: "0.8125rem",
|
|
798
|
-
bodySize: "
|
|
1116
|
+
bodySize: "0.875rem"
|
|
799
1117
|
},
|
|
800
|
-
shape: { radius: "
|
|
801
|
-
spacing: { base: 16, sectionGap:
|
|
802
|
-
layout: { maxWidth: "
|
|
1118
|
+
shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
|
|
1119
|
+
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
1120
|
+
layout: { maxWidth: "600px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
|
|
1121
|
+
};
|
|
1122
|
+
var vercelDark = {
|
|
1123
|
+
colors: {
|
|
1124
|
+
primary: "#FFFFFF",
|
|
1125
|
+
primaryForeground: "#000000",
|
|
1126
|
+
secondary: "#1A1A1A",
|
|
1127
|
+
secondaryForeground: "#EDEDED",
|
|
1128
|
+
error: "#E5484D",
|
|
1129
|
+
errorForeground: "#FFFFFF",
|
|
1130
|
+
warning: "#F5A623",
|
|
1131
|
+
success: "#45A557",
|
|
1132
|
+
surface: "#111111",
|
|
1133
|
+
background: "#000000",
|
|
1134
|
+
text: "#EDEDED",
|
|
1135
|
+
textMuted: "#888888",
|
|
1136
|
+
textDisabled: "#444444",
|
|
1137
|
+
border: "#333333",
|
|
1138
|
+
borderFocus: "#FFFFFF",
|
|
1139
|
+
inputBackground: "#111111"
|
|
1140
|
+
},
|
|
1141
|
+
typography: {
|
|
1142
|
+
fontFamily: "'Geist', Inter, -apple-system, sans-serif",
|
|
1143
|
+
scale: "comfortable",
|
|
1144
|
+
questionSize: "1rem",
|
|
1145
|
+
labelSize: "0.875rem",
|
|
1146
|
+
helpTextSize: "0.8125rem",
|
|
1147
|
+
bodySize: "0.875rem"
|
|
1148
|
+
},
|
|
1149
|
+
shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
|
|
1150
|
+
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
1151
|
+
layout: { maxWidth: "600px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
|
|
1152
|
+
};
|
|
1153
|
+
var shopifyLight = {
|
|
1154
|
+
colors: {
|
|
1155
|
+
primary: "#008060",
|
|
1156
|
+
primaryForeground: "#FFFFFF",
|
|
1157
|
+
secondary: "#E3F1DF",
|
|
1158
|
+
secondaryForeground: "#1A4D2E",
|
|
1159
|
+
error: "#D72C0D",
|
|
1160
|
+
errorForeground: "#FFFFFF",
|
|
1161
|
+
warning: "#B98900",
|
|
1162
|
+
success: "#008060",
|
|
1163
|
+
surface: "#FFFFFF",
|
|
1164
|
+
background: "#F6F6F7",
|
|
1165
|
+
text: "#202223",
|
|
1166
|
+
textMuted: "#6D7175",
|
|
1167
|
+
textDisabled: "#BABEC3",
|
|
1168
|
+
border: "#C9CCCF",
|
|
1169
|
+
borderFocus: "#008060",
|
|
1170
|
+
inputBackground: "#FFFFFF"
|
|
1171
|
+
},
|
|
1172
|
+
typography: {
|
|
1173
|
+
fontFamily: "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
1174
|
+
scale: "comfortable",
|
|
1175
|
+
questionSize: "1rem",
|
|
1176
|
+
labelSize: "0.875rem",
|
|
1177
|
+
helpTextSize: "0.8125rem",
|
|
1178
|
+
bodySize: "0.9375rem"
|
|
1179
|
+
},
|
|
1180
|
+
shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
|
|
1181
|
+
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
1182
|
+
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
|
|
1183
|
+
};
|
|
1184
|
+
var shopifyDark = {
|
|
1185
|
+
colors: {
|
|
1186
|
+
primary: "#36D399",
|
|
1187
|
+
primaryForeground: "#0D2818",
|
|
1188
|
+
secondary: "#1A3A2A",
|
|
1189
|
+
secondaryForeground: "#B5E4CA",
|
|
1190
|
+
error: "#FE6B6B",
|
|
1191
|
+
errorForeground: "#1C1110",
|
|
1192
|
+
warning: "#FFD60A",
|
|
1193
|
+
success: "#36D399",
|
|
1194
|
+
surface: "#1A1C1E",
|
|
1195
|
+
background: "#111213",
|
|
1196
|
+
text: "#E3E5E7",
|
|
1197
|
+
textMuted: "#8C9196",
|
|
1198
|
+
textDisabled: "#44474A",
|
|
1199
|
+
border: "#333638",
|
|
1200
|
+
borderFocus: "#36D399",
|
|
1201
|
+
inputBackground: "#1A1C1E"
|
|
1202
|
+
},
|
|
1203
|
+
typography: {
|
|
1204
|
+
fontFamily: "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
1205
|
+
scale: "comfortable",
|
|
1206
|
+
questionSize: "1rem",
|
|
1207
|
+
labelSize: "0.875rem",
|
|
1208
|
+
helpTextSize: "0.8125rem",
|
|
1209
|
+
bodySize: "0.9375rem"
|
|
1210
|
+
},
|
|
1211
|
+
shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
|
|
1212
|
+
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
1213
|
+
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
|
|
1214
|
+
};
|
|
1215
|
+
var slackLight = {
|
|
1216
|
+
colors: {
|
|
1217
|
+
primary: "#611F69",
|
|
1218
|
+
primaryForeground: "#FFFFFF",
|
|
1219
|
+
secondary: "#F3E8F5",
|
|
1220
|
+
secondaryForeground: "#4A154B",
|
|
1221
|
+
error: "#E01E5A",
|
|
1222
|
+
errorForeground: "#FFFFFF",
|
|
1223
|
+
warning: "#ECB22E",
|
|
1224
|
+
success: "#2EB67D",
|
|
1225
|
+
surface: "#FFFFFF",
|
|
1226
|
+
background: "#F8F8F8",
|
|
1227
|
+
text: "#1D1C1D",
|
|
1228
|
+
textMuted: "#616061",
|
|
1229
|
+
textDisabled: "#B9B9B9",
|
|
1230
|
+
border: "#DDDDDD",
|
|
1231
|
+
borderFocus: "#611F69",
|
|
1232
|
+
inputBackground: "#FFFFFF"
|
|
1233
|
+
},
|
|
1234
|
+
typography: {
|
|
1235
|
+
fontFamily: "'Lato', 'Helvetica Neue', Helvetica, sans-serif",
|
|
1236
|
+
scale: "comfortable",
|
|
1237
|
+
questionSize: "1.0625rem",
|
|
1238
|
+
labelSize: "0.875rem",
|
|
1239
|
+
helpTextSize: "0.8125rem",
|
|
1240
|
+
bodySize: "0.9375rem"
|
|
1241
|
+
},
|
|
1242
|
+
shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "10px" },
|
|
1243
|
+
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
1244
|
+
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
|
|
1245
|
+
};
|
|
1246
|
+
var slackDark = {
|
|
1247
|
+
colors: {
|
|
1248
|
+
primary: "#D4A8DB",
|
|
1249
|
+
primaryForeground: "#1A0A1E",
|
|
1250
|
+
secondary: "#2C1332",
|
|
1251
|
+
secondaryForeground: "#E2C6E9",
|
|
1252
|
+
error: "#F5638B",
|
|
1253
|
+
errorForeground: "#1C0E14",
|
|
1254
|
+
warning: "#F0CA4D",
|
|
1255
|
+
success: "#4FCEA2",
|
|
1256
|
+
surface: "#1A1D21",
|
|
1257
|
+
background: "#0F1114",
|
|
1258
|
+
text: "#D1D2D3",
|
|
1259
|
+
textMuted: "#9B9C9E",
|
|
1260
|
+
textDisabled: "#4D4D4F",
|
|
1261
|
+
border: "#383A3E",
|
|
1262
|
+
borderFocus: "#D4A8DB",
|
|
1263
|
+
inputBackground: "#1A1D21"
|
|
1264
|
+
},
|
|
1265
|
+
typography: {
|
|
1266
|
+
fontFamily: "'Lato', 'Helvetica Neue', Helvetica, sans-serif",
|
|
1267
|
+
scale: "comfortable",
|
|
1268
|
+
questionSize: "1.0625rem",
|
|
1269
|
+
labelSize: "0.875rem",
|
|
1270
|
+
helpTextSize: "0.8125rem",
|
|
1271
|
+
bodySize: "0.9375rem"
|
|
1272
|
+
},
|
|
1273
|
+
shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "10px" },
|
|
1274
|
+
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
1275
|
+
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
|
|
1276
|
+
};
|
|
1277
|
+
var tailwindLight = {
|
|
1278
|
+
colors: {
|
|
1279
|
+
primary: "#4F46E5",
|
|
1280
|
+
primaryForeground: "#FFFFFF",
|
|
1281
|
+
secondary: "#EEF2FF",
|
|
1282
|
+
secondaryForeground: "#3730A3",
|
|
1283
|
+
error: "#DC2626",
|
|
1284
|
+
errorForeground: "#FFFFFF",
|
|
1285
|
+
warning: "#D97706",
|
|
1286
|
+
success: "#059669",
|
|
1287
|
+
surface: "#FFFFFF",
|
|
1288
|
+
background: "#F9FAFB",
|
|
1289
|
+
text: "#111827",
|
|
1290
|
+
textMuted: "#6B7280",
|
|
1291
|
+
textDisabled: "#D1D5DB",
|
|
1292
|
+
border: "#E5E7EB",
|
|
1293
|
+
borderFocus: "#4F46E5",
|
|
1294
|
+
inputBackground: "#FFFFFF"
|
|
1295
|
+
},
|
|
1296
|
+
typography: {
|
|
1297
|
+
fontFamily: "Inter, system-ui, sans-serif",
|
|
1298
|
+
scale: "comfortable",
|
|
1299
|
+
questionSize: "1rem",
|
|
1300
|
+
labelSize: "0.875rem",
|
|
1301
|
+
helpTextSize: "0.8125rem",
|
|
1302
|
+
bodySize: "0.875rem"
|
|
1303
|
+
},
|
|
1304
|
+
shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
|
|
1305
|
+
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 14, inputPaddingY: 10 },
|
|
1306
|
+
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
|
|
803
1307
|
};
|
|
804
|
-
var
|
|
1308
|
+
var tailwindDark = {
|
|
805
1309
|
colors: {
|
|
806
1310
|
primary: "#818CF8",
|
|
807
1311
|
primaryForeground: "#1E1B4B",
|
|
808
|
-
secondary: "#
|
|
809
|
-
secondaryForeground: "#
|
|
810
|
-
error: "#
|
|
811
|
-
errorForeground: "#
|
|
1312
|
+
secondary: "#1E1B4B",
|
|
1313
|
+
secondaryForeground: "#C7D2FE",
|
|
1314
|
+
error: "#F87171",
|
|
1315
|
+
errorForeground: "#1C1917",
|
|
812
1316
|
warning: "#FBBF24",
|
|
813
|
-
success: "#
|
|
814
|
-
surface: "#
|
|
815
|
-
background: "#
|
|
816
|
-
text: "#
|
|
817
|
-
textMuted: "#
|
|
818
|
-
textDisabled: "#
|
|
819
|
-
border: "#
|
|
1317
|
+
success: "#34D399",
|
|
1318
|
+
surface: "#1F2937",
|
|
1319
|
+
background: "#111827",
|
|
1320
|
+
text: "#F9FAFB",
|
|
1321
|
+
textMuted: "#9CA3AF",
|
|
1322
|
+
textDisabled: "#374151",
|
|
1323
|
+
border: "#374151",
|
|
820
1324
|
borderFocus: "#818CF8",
|
|
821
|
-
inputBackground: "#
|
|
1325
|
+
inputBackground: "#1F2937"
|
|
822
1326
|
},
|
|
823
1327
|
typography: {
|
|
824
|
-
fontFamily: "
|
|
1328
|
+
fontFamily: "Inter, system-ui, sans-serif",
|
|
825
1329
|
scale: "comfortable",
|
|
826
|
-
questionSize: "
|
|
1330
|
+
questionSize: "1rem",
|
|
827
1331
|
labelSize: "0.875rem",
|
|
828
1332
|
helpTextSize: "0.8125rem",
|
|
829
|
-
bodySize: "
|
|
1333
|
+
bodySize: "0.875rem"
|
|
830
1334
|
},
|
|
831
|
-
shape: { radius: "
|
|
832
|
-
spacing: { base: 16, sectionGap:
|
|
833
|
-
layout: { maxWidth: "
|
|
1335
|
+
shape: { radius: "md", inputRadius: "8px", buttonRadius: "8px", cardRadius: "12px" },
|
|
1336
|
+
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 14, inputPaddingY: 10 },
|
|
1337
|
+
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
|
|
834
1338
|
};
|
|
835
|
-
var
|
|
1339
|
+
var clinicalLight = {
|
|
836
1340
|
colors: {
|
|
837
|
-
primary: "#
|
|
838
|
-
primaryForeground: "#
|
|
839
|
-
secondary: "#
|
|
840
|
-
secondaryForeground: "#
|
|
841
|
-
error: "#
|
|
842
|
-
errorForeground: "#
|
|
843
|
-
warning: "#
|
|
844
|
-
success: "#
|
|
845
|
-
surface: "#
|
|
1341
|
+
primary: "#0369A1",
|
|
1342
|
+
primaryForeground: "#FFFFFF",
|
|
1343
|
+
secondary: "#E0F2FE",
|
|
1344
|
+
secondaryForeground: "#0C4A6E",
|
|
1345
|
+
error: "#B91C1C",
|
|
1346
|
+
errorForeground: "#FFFFFF",
|
|
1347
|
+
warning: "#B45309",
|
|
1348
|
+
success: "#15803D",
|
|
1349
|
+
surface: "#FFFFFF",
|
|
846
1350
|
background: "#F0F9FF",
|
|
847
1351
|
text: "#0C4A6E",
|
|
848
|
-
textMuted: "#
|
|
849
|
-
textDisabled: "#
|
|
1352
|
+
textMuted: "#4B6B82",
|
|
1353
|
+
textDisabled: "#BAD6E9",
|
|
850
1354
|
border: "#BAE6FD",
|
|
851
|
-
borderFocus: "#
|
|
852
|
-
inputBackground: "#
|
|
1355
|
+
borderFocus: "#0369A1",
|
|
1356
|
+
inputBackground: "#FFFFFF"
|
|
853
1357
|
},
|
|
854
1358
|
typography: {
|
|
855
1359
|
fontFamily: "'Source Sans 3', 'Segoe UI', system-ui, sans-serif",
|
|
@@ -863,22 +1367,22 @@ var clinicalPreset = {
|
|
|
863
1367
|
spacing: { base: 16, sectionGap: 28, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
864
1368
|
layout: { maxWidth: "680px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
|
|
865
1369
|
};
|
|
866
|
-
var
|
|
1370
|
+
var clinicalDark = {
|
|
867
1371
|
colors: {
|
|
868
1372
|
primary: "#38BDF8",
|
|
869
1373
|
primaryForeground: "#0C1929",
|
|
870
|
-
secondary: "#
|
|
871
|
-
secondaryForeground: "#
|
|
872
|
-
error: "#
|
|
873
|
-
errorForeground: "#
|
|
874
|
-
warning: "#
|
|
875
|
-
success: "#
|
|
1374
|
+
secondary: "#0C3554",
|
|
1375
|
+
secondaryForeground: "#BAE6FD",
|
|
1376
|
+
error: "#FCA5A5",
|
|
1377
|
+
errorForeground: "#1C1110",
|
|
1378
|
+
warning: "#FCD34D",
|
|
1379
|
+
success: "#6EE7B7",
|
|
876
1380
|
surface: "#0F2438",
|
|
877
|
-
background: "#
|
|
1381
|
+
background: "#0B1929",
|
|
878
1382
|
text: "#E0F2FE",
|
|
879
|
-
textMuted: "#
|
|
1383
|
+
textMuted: "#7DC4E8",
|
|
880
1384
|
textDisabled: "#1E3A5F",
|
|
881
|
-
border: "#
|
|
1385
|
+
border: "#1C3A5A",
|
|
882
1386
|
borderFocus: "#38BDF8",
|
|
883
1387
|
inputBackground: "#0F2438"
|
|
884
1388
|
},
|
|
@@ -894,86 +1398,210 @@ var clinicalDarkPreset = {
|
|
|
894
1398
|
spacing: { base: 16, sectionGap: 28, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
895
1399
|
layout: { maxWidth: "680px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
|
|
896
1400
|
};
|
|
897
|
-
var
|
|
1401
|
+
var notionLight = {
|
|
898
1402
|
colors: {
|
|
899
|
-
primary: "#
|
|
900
|
-
primaryForeground: "#
|
|
901
|
-
secondary: "#
|
|
902
|
-
secondaryForeground: "#
|
|
903
|
-
error: "#
|
|
904
|
-
errorForeground: "#
|
|
905
|
-
warning: "#
|
|
906
|
-
success: "#
|
|
907
|
-
surface: "#
|
|
908
|
-
background: "#
|
|
909
|
-
text: "#
|
|
1403
|
+
primary: "#2383E2",
|
|
1404
|
+
primaryForeground: "#FFFFFF",
|
|
1405
|
+
secondary: "#EBF5FB",
|
|
1406
|
+
secondaryForeground: "#1B4F7B",
|
|
1407
|
+
error: "#EB5757",
|
|
1408
|
+
errorForeground: "#FFFFFF",
|
|
1409
|
+
warning: "#CB912F",
|
|
1410
|
+
success: "#0F7B6C",
|
|
1411
|
+
surface: "#FFFFFF",
|
|
1412
|
+
background: "#FFFFFF",
|
|
1413
|
+
text: "#37352F",
|
|
1414
|
+
textMuted: "#787774",
|
|
1415
|
+
textDisabled: "#C3C2BF",
|
|
1416
|
+
border: "#E3E2E0",
|
|
1417
|
+
borderFocus: "#2383E2",
|
|
1418
|
+
inputBackground: "#F7F6F3"
|
|
1419
|
+
},
|
|
1420
|
+
typography: {
|
|
1421
|
+
fontFamily: "'Lyon Text', Georgia, 'Times New Roman', serif",
|
|
1422
|
+
scale: "comfortable",
|
|
1423
|
+
questionSize: "1.0625rem",
|
|
1424
|
+
labelSize: "0.875rem",
|
|
1425
|
+
helpTextSize: "0.8125rem",
|
|
1426
|
+
bodySize: "1rem"
|
|
1427
|
+
},
|
|
1428
|
+
shape: { radius: "sm", inputRadius: "4px", buttonRadius: "4px", cardRadius: "4px" },
|
|
1429
|
+
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
1430
|
+
layout: { maxWidth: "680px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
|
|
1431
|
+
};
|
|
1432
|
+
var notionDark = {
|
|
1433
|
+
colors: {
|
|
1434
|
+
primary: "#529CCA",
|
|
1435
|
+
primaryForeground: "#FFFFFF",
|
|
1436
|
+
secondary: "#143046",
|
|
1437
|
+
secondaryForeground: "#9ECBEB",
|
|
1438
|
+
error: "#FF6B6B",
|
|
1439
|
+
errorForeground: "#1C1210",
|
|
1440
|
+
warning: "#E0AD50",
|
|
1441
|
+
success: "#4DAB9A",
|
|
1442
|
+
surface: "#2F3437",
|
|
1443
|
+
background: "#191919",
|
|
1444
|
+
text: "#E6E3DD",
|
|
1445
|
+
textMuted: "#9B9A97",
|
|
1446
|
+
textDisabled: "#4F4F4F",
|
|
1447
|
+
border: "#434343",
|
|
1448
|
+
borderFocus: "#529CCA",
|
|
1449
|
+
inputBackground: "#2F3437"
|
|
1450
|
+
},
|
|
1451
|
+
typography: {
|
|
1452
|
+
fontFamily: "'Lyon Text', Georgia, 'Times New Roman', serif",
|
|
1453
|
+
scale: "comfortable",
|
|
1454
|
+
questionSize: "1.0625rem",
|
|
1455
|
+
labelSize: "0.875rem",
|
|
1456
|
+
helpTextSize: "0.8125rem",
|
|
1457
|
+
bodySize: "1rem"
|
|
1458
|
+
},
|
|
1459
|
+
shape: { radius: "sm", inputRadius: "4px", buttonRadius: "4px", cardRadius: "4px" },
|
|
1460
|
+
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
1461
|
+
layout: { maxWidth: "680px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
|
|
1462
|
+
};
|
|
1463
|
+
var sunsetLight = {
|
|
1464
|
+
colors: {
|
|
1465
|
+
primary: "#C2410C",
|
|
1466
|
+
primaryForeground: "#FFFFFF",
|
|
1467
|
+
secondary: "#FFF7ED",
|
|
1468
|
+
secondaryForeground: "#7C2D12",
|
|
1469
|
+
error: "#B91C1C",
|
|
1470
|
+
errorForeground: "#FFFFFF",
|
|
1471
|
+
warning: "#A16207",
|
|
1472
|
+
success: "#15803D",
|
|
1473
|
+
surface: "#FFFFFF",
|
|
1474
|
+
background: "#FFFBF5",
|
|
1475
|
+
text: "#292524",
|
|
910
1476
|
textMuted: "#78716C",
|
|
911
1477
|
textDisabled: "#D6D3D1",
|
|
912
|
-
border: "#
|
|
913
|
-
borderFocus: "#
|
|
914
|
-
inputBackground: "#
|
|
1478
|
+
border: "#E7E5E4",
|
|
1479
|
+
borderFocus: "#C2410C",
|
|
1480
|
+
inputBackground: "#FFFFFF"
|
|
915
1481
|
},
|
|
916
1482
|
typography: {
|
|
917
|
-
fontFamily: "'
|
|
918
|
-
scale: "
|
|
919
|
-
questionSize: "1.
|
|
920
|
-
labelSize: "0.
|
|
921
|
-
helpTextSize: "0.
|
|
922
|
-
bodySize: "
|
|
1483
|
+
fontFamily: "'DM Sans', Inter, system-ui, sans-serif",
|
|
1484
|
+
scale: "comfortable",
|
|
1485
|
+
questionSize: "1.125rem",
|
|
1486
|
+
labelSize: "0.875rem",
|
|
1487
|
+
helpTextSize: "0.8125rem",
|
|
1488
|
+
bodySize: "0.9375rem"
|
|
923
1489
|
},
|
|
924
|
-
shape: { radius: "
|
|
925
|
-
spacing: { base:
|
|
926
|
-
layout: { maxWidth: "
|
|
1490
|
+
shape: { radius: "lg", inputRadius: "10px", buttonRadius: "10px", cardRadius: "14px" },
|
|
1491
|
+
spacing: { base: 16, sectionGap: 36, fieldGap: 26, inputPaddingX: 14, inputPaddingY: 11 },
|
|
1492
|
+
layout: { maxWidth: "640px", alignment: "center", progressPosition: "top", sectionLayout: "card" }
|
|
927
1493
|
};
|
|
928
|
-
var
|
|
1494
|
+
var sunsetDark = {
|
|
929
1495
|
colors: {
|
|
930
|
-
primary: "#
|
|
931
|
-
primaryForeground: "#
|
|
932
|
-
secondary: "#
|
|
933
|
-
secondaryForeground: "#
|
|
1496
|
+
primary: "#FB923C",
|
|
1497
|
+
primaryForeground: "#1C1210",
|
|
1498
|
+
secondary: "#3D1F0E",
|
|
1499
|
+
secondaryForeground: "#FED7AA",
|
|
934
1500
|
error: "#FCA5A5",
|
|
935
|
-
errorForeground: "#
|
|
1501
|
+
errorForeground: "#1C1210",
|
|
936
1502
|
warning: "#FCD34D",
|
|
937
1503
|
success: "#6EE7B7",
|
|
938
|
-
surface: "#
|
|
939
|
-
background: "#
|
|
940
|
-
text: "#
|
|
941
|
-
textMuted: "#
|
|
942
|
-
textDisabled: "#
|
|
943
|
-
border: "#
|
|
944
|
-
borderFocus: "#
|
|
945
|
-
inputBackground: "#
|
|
1504
|
+
surface: "#292019",
|
|
1505
|
+
background: "#1C1510",
|
|
1506
|
+
text: "#F5F0EB",
|
|
1507
|
+
textMuted: "#B0A89E",
|
|
1508
|
+
textDisabled: "#4A413A",
|
|
1509
|
+
border: "#3D352D",
|
|
1510
|
+
borderFocus: "#FB923C",
|
|
1511
|
+
inputBackground: "#292019"
|
|
946
1512
|
},
|
|
947
1513
|
typography: {
|
|
948
|
-
fontFamily: "'
|
|
1514
|
+
fontFamily: "'DM Sans', Inter, system-ui, sans-serif",
|
|
1515
|
+
scale: "comfortable",
|
|
1516
|
+
questionSize: "1.125rem",
|
|
1517
|
+
labelSize: "0.875rem",
|
|
1518
|
+
helpTextSize: "0.8125rem",
|
|
1519
|
+
bodySize: "0.9375rem"
|
|
1520
|
+
},
|
|
1521
|
+
shape: { radius: "lg", inputRadius: "10px", buttonRadius: "10px", cardRadius: "14px" },
|
|
1522
|
+
spacing: { base: 16, sectionGap: 36, fieldGap: 26, inputPaddingX: 14, inputPaddingY: 11 },
|
|
1523
|
+
layout: { maxWidth: "640px", alignment: "center", progressPosition: "top", sectionLayout: "card" }
|
|
1524
|
+
};
|
|
1525
|
+
var roseLight = {
|
|
1526
|
+
colors: {
|
|
1527
|
+
primary: "#BE185D",
|
|
1528
|
+
primaryForeground: "#FFFFFF",
|
|
1529
|
+
secondary: "#FFF1F2",
|
|
1530
|
+
secondaryForeground: "#881337",
|
|
1531
|
+
error: "#DC2626",
|
|
1532
|
+
errorForeground: "#FFFFFF",
|
|
1533
|
+
warning: "#D97706",
|
|
1534
|
+
success: "#059669",
|
|
1535
|
+
surface: "#FFFFFF",
|
|
1536
|
+
background: "#FFFBFB",
|
|
1537
|
+
text: "#1C1917",
|
|
1538
|
+
textMuted: "#737373",
|
|
1539
|
+
textDisabled: "#D4D4D4",
|
|
1540
|
+
border: "#FECDD3",
|
|
1541
|
+
borderFocus: "#BE185D",
|
|
1542
|
+
inputBackground: "#FFFFFF"
|
|
1543
|
+
},
|
|
1544
|
+
typography: {
|
|
1545
|
+
fontFamily: "'Plus Jakarta Sans', Inter, system-ui, sans-serif",
|
|
949
1546
|
scale: "spacious",
|
|
950
|
-
questionSize: "1.
|
|
951
|
-
labelSize: "0.
|
|
952
|
-
helpTextSize: "0.
|
|
953
|
-
bodySize: "
|
|
1547
|
+
questionSize: "1.1875rem",
|
|
1548
|
+
labelSize: "0.875rem",
|
|
1549
|
+
helpTextSize: "0.8125rem",
|
|
1550
|
+
bodySize: "0.9375rem"
|
|
954
1551
|
},
|
|
955
|
-
shape: { radius: "
|
|
956
|
-
spacing: { base: 18, sectionGap: 36, fieldGap: 28, inputPaddingX:
|
|
957
|
-
layout: { maxWidth: "
|
|
1552
|
+
shape: { radius: "lg", inputRadius: "12px", buttonRadius: "12px", cardRadius: "16px" },
|
|
1553
|
+
spacing: { base: 18, sectionGap: 36, fieldGap: 28, inputPaddingX: 16, inputPaddingY: 12 },
|
|
1554
|
+
layout: { maxWidth: "640px", alignment: "center", progressPosition: "top", sectionLayout: "card" }
|
|
958
1555
|
};
|
|
959
|
-
var
|
|
1556
|
+
var roseDark = {
|
|
960
1557
|
colors: {
|
|
961
|
-
primary: "#
|
|
962
|
-
primaryForeground: "#
|
|
963
|
-
secondary: "#
|
|
964
|
-
secondaryForeground: "#
|
|
1558
|
+
primary: "#FB7185",
|
|
1559
|
+
primaryForeground: "#1C0A12",
|
|
1560
|
+
secondary: "#3B0A22",
|
|
1561
|
+
secondaryForeground: "#FECDD3",
|
|
1562
|
+
error: "#F87171",
|
|
1563
|
+
errorForeground: "#1C1210",
|
|
1564
|
+
warning: "#FBBF24",
|
|
1565
|
+
success: "#34D399",
|
|
1566
|
+
surface: "#1F1318",
|
|
1567
|
+
background: "#150D11",
|
|
1568
|
+
text: "#FAF0F2",
|
|
1569
|
+
textMuted: "#C9A4AE",
|
|
1570
|
+
textDisabled: "#4A3039",
|
|
1571
|
+
border: "#3D2030",
|
|
1572
|
+
borderFocus: "#FB7185",
|
|
1573
|
+
inputBackground: "#1F1318"
|
|
1574
|
+
},
|
|
1575
|
+
typography: {
|
|
1576
|
+
fontFamily: "'Plus Jakarta Sans', Inter, system-ui, sans-serif",
|
|
1577
|
+
scale: "spacious",
|
|
1578
|
+
questionSize: "1.1875rem",
|
|
1579
|
+
labelSize: "0.875rem",
|
|
1580
|
+
helpTextSize: "0.8125rem",
|
|
1581
|
+
bodySize: "0.9375rem"
|
|
1582
|
+
},
|
|
1583
|
+
shape: { radius: "lg", inputRadius: "12px", buttonRadius: "12px", cardRadius: "16px" },
|
|
1584
|
+
spacing: { base: 18, sectionGap: 36, fieldGap: 28, inputPaddingX: 16, inputPaddingY: 12 },
|
|
1585
|
+
layout: { maxWidth: "640px", alignment: "center", progressPosition: "top", sectionLayout: "card" }
|
|
1586
|
+
};
|
|
1587
|
+
var highContrastLight = {
|
|
1588
|
+
colors: {
|
|
1589
|
+
primary: "#0000CC",
|
|
1590
|
+
primaryForeground: "#FFFFFF",
|
|
1591
|
+
secondary: "#E6E6FF",
|
|
1592
|
+
secondaryForeground: "#000066",
|
|
965
1593
|
error: "#B91C1C",
|
|
966
|
-
errorForeground: "#
|
|
967
|
-
warning: "#
|
|
1594
|
+
errorForeground: "#FFFFFF",
|
|
1595
|
+
warning: "#854D0E",
|
|
968
1596
|
success: "#166534",
|
|
969
|
-
surface: "#
|
|
970
|
-
background: "#
|
|
1597
|
+
surface: "#FFFFFF",
|
|
1598
|
+
background: "#FFFFFF",
|
|
971
1599
|
text: "#000000",
|
|
972
|
-
textMuted: "#
|
|
973
|
-
textDisabled: "#
|
|
1600
|
+
textMuted: "#333333",
|
|
1601
|
+
textDisabled: "#888888",
|
|
974
1602
|
border: "#000000",
|
|
975
|
-
borderFocus: "#
|
|
976
|
-
inputBackground: "#
|
|
1603
|
+
borderFocus: "#0000CC",
|
|
1604
|
+
inputBackground: "#FFFFFF"
|
|
977
1605
|
},
|
|
978
1606
|
typography: {
|
|
979
1607
|
fontFamily: "Arial, Helvetica, sans-serif",
|
|
@@ -987,24 +1615,24 @@ var highContrastPreset = {
|
|
|
987
1615
|
spacing: { base: 20, sectionGap: 40, fieldGap: 32, inputPaddingX: 14, inputPaddingY: 12 },
|
|
988
1616
|
layout: { maxWidth: "720px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
|
|
989
1617
|
};
|
|
990
|
-
var
|
|
1618
|
+
var highContrastDark = {
|
|
991
1619
|
colors: {
|
|
992
|
-
primary: "#
|
|
1620
|
+
primary: "#6CB4FF",
|
|
993
1621
|
primaryForeground: "#000000",
|
|
994
|
-
secondary: "#
|
|
995
|
-
secondaryForeground: "#
|
|
996
|
-
error: "#
|
|
1622
|
+
secondary: "#002255",
|
|
1623
|
+
secondaryForeground: "#99CCFF",
|
|
1624
|
+
error: "#FF8A8A",
|
|
997
1625
|
errorForeground: "#000000",
|
|
998
|
-
warning: "#
|
|
999
|
-
success: "#
|
|
1000
|
-
surface: "#
|
|
1626
|
+
warning: "#FFD54F",
|
|
1627
|
+
success: "#69F0AE",
|
|
1628
|
+
surface: "#0A0A0A",
|
|
1001
1629
|
background: "#000000",
|
|
1002
1630
|
text: "#FFFFFF",
|
|
1003
|
-
textMuted: "#
|
|
1004
|
-
textDisabled: "#
|
|
1631
|
+
textMuted: "#CCCCCC",
|
|
1632
|
+
textDisabled: "#666666",
|
|
1005
1633
|
border: "#FFFFFF",
|
|
1006
|
-
borderFocus: "#
|
|
1007
|
-
inputBackground: "#
|
|
1634
|
+
borderFocus: "#6CB4FF",
|
|
1635
|
+
inputBackground: "#0A0A0A"
|
|
1008
1636
|
},
|
|
1009
1637
|
typography: {
|
|
1010
1638
|
fontFamily: "Arial, Helvetica, sans-serif",
|
|
@@ -1019,11 +1647,18 @@ var highContrastDarkPreset = {
|
|
|
1019
1647
|
layout: { maxWidth: "720px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
|
|
1020
1648
|
};
|
|
1021
1649
|
var PRESET_FAMILIES = {
|
|
1022
|
-
clean: { light:
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1650
|
+
clean: { light: cleanLight, dark: cleanDark, label: "Clean" },
|
|
1651
|
+
stripe: { light: stripeLight, dark: stripeDark, label: "Stripe" },
|
|
1652
|
+
github: { light: githubLight, dark: githubDark, label: "GitHub" },
|
|
1653
|
+
vercel: { light: vercelLight, dark: vercelDark, label: "Vercel" },
|
|
1654
|
+
shopify: { light: shopifyLight, dark: shopifyDark, label: "Shopify" },
|
|
1655
|
+
slack: { light: slackLight, dark: slackDark, label: "Slack" },
|
|
1656
|
+
tailwind: { light: tailwindLight, dark: tailwindDark, label: "Tailwind" },
|
|
1657
|
+
clinical: { light: clinicalLight, dark: clinicalDark, label: "Clinical" },
|
|
1658
|
+
notion: { light: notionLight, dark: notionDark, label: "Notion" },
|
|
1659
|
+
sunset: { light: sunsetLight, dark: sunsetDark, label: "Sunset" },
|
|
1660
|
+
rose: { light: roseLight, dark: roseDark, label: "Rose" },
|
|
1661
|
+
"high-contrast": { light: highContrastLight, dark: highContrastDark, label: "High contrast" }
|
|
1027
1662
|
};
|
|
1028
1663
|
var COMPARISON_PRESETS = Object.fromEntries(
|
|
1029
1664
|
Object.entries(PRESET_FAMILIES).map(([key, family]) => [
|
|
@@ -1201,13 +1836,31 @@ function ThemeEditorThemeProvider({ theme, children }) {
|
|
|
1201
1836
|
}
|
|
1202
1837
|
function isDarkTheme(theme) {
|
|
1203
1838
|
const bg = theme.colors?.background ?? "#FFFFFF";
|
|
1204
|
-
|
|
1839
|
+
let hex = bg.replace("#", "");
|
|
1840
|
+
if (hex.length === 3) {
|
|
1841
|
+
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
|
1842
|
+
}
|
|
1205
1843
|
if (hex.length < 6) return false;
|
|
1206
1844
|
const r = parseInt(hex.slice(0, 2), 16);
|
|
1207
1845
|
const g = parseInt(hex.slice(2, 4), 16);
|
|
1208
1846
|
const b = parseInt(hex.slice(4, 6), 16);
|
|
1209
1847
|
return 0.299 * r + 0.587 * g + 0.114 * b < 128;
|
|
1210
1848
|
}
|
|
1849
|
+
function detectPresetFamily(theme) {
|
|
1850
|
+
const c = theme.colors;
|
|
1851
|
+
if (!c) return null;
|
|
1852
|
+
for (const [key, family] of Object.entries(PRESET_FAMILIES)) {
|
|
1853
|
+
for (const variant of ["light", "dark"]) {
|
|
1854
|
+
const preset = family[variant];
|
|
1855
|
+
const pc = preset.colors;
|
|
1856
|
+
if (!pc) continue;
|
|
1857
|
+
if (c.primary?.toLowerCase() === pc.primary?.toLowerCase() && c.background?.toLowerCase() === pc.background?.toLowerCase() && c.surface?.toLowerCase() === pc.surface?.toLowerCase()) {
|
|
1858
|
+
return key;
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
return null;
|
|
1863
|
+
}
|
|
1211
1864
|
var SECTIONS = [
|
|
1212
1865
|
{
|
|
1213
1866
|
id: "colors",
|
|
@@ -1328,6 +1981,7 @@ var SECTIONS = [
|
|
|
1328
1981
|
];
|
|
1329
1982
|
function ThemeEditorInner({
|
|
1330
1983
|
initialTheme,
|
|
1984
|
+
initialPreset,
|
|
1331
1985
|
onChange,
|
|
1332
1986
|
onSave,
|
|
1333
1987
|
theme: chromeTheme,
|
|
@@ -1339,39 +1993,82 @@ function ThemeEditorInner({
|
|
|
1339
1993
|
}) {
|
|
1340
1994
|
const resolvedInitial = react.useMemo(
|
|
1341
1995
|
() => initialTheme ?? resolveThemeFromDOM(),
|
|
1342
|
-
|
|
1343
|
-
[]
|
|
1996
|
+
[initialTheme]
|
|
1344
1997
|
);
|
|
1345
1998
|
const [theme, setTheme] = react.useState(resolvedInitial);
|
|
1346
1999
|
const [activeSection, setActiveSection] = react.useState("colors");
|
|
1347
|
-
const
|
|
2000
|
+
const resolvedPresetInit = initialPreset ?? detectPresetFamily(resolvedInitial) ?? "custom";
|
|
2001
|
+
const [presetKey, setPresetKey] = react.useState(resolvedPresetInit);
|
|
2002
|
+
const presetKeyRef = react.useRef(presetKey);
|
|
2003
|
+
presetKeyRef.current = presetKey;
|
|
1348
2004
|
const [showPalette, setShowPalette] = react.useState(false);
|
|
1349
2005
|
const [showComparison, setShowComparison] = react.useState(false);
|
|
1350
2006
|
const themeRef = react.useRef(theme);
|
|
1351
2007
|
themeRef.current = theme;
|
|
1352
|
-
const
|
|
2008
|
+
const prevInitialRef = react.useRef(initialTheme);
|
|
2009
|
+
const prevPresetRef = react.useRef(initialPreset);
|
|
2010
|
+
react.useEffect(() => {
|
|
2011
|
+
if (!initialTheme) return;
|
|
2012
|
+
const themeChanged = JSON.stringify(initialTheme) !== JSON.stringify(prevInitialRef.current);
|
|
2013
|
+
const presetChanged = initialPreset !== prevPresetRef.current;
|
|
2014
|
+
if (!themeChanged && !presetChanged) return;
|
|
2015
|
+
prevInitialRef.current = initialTheme;
|
|
2016
|
+
prevPresetRef.current = initialPreset;
|
|
2017
|
+
setTheme(initialTheme);
|
|
2018
|
+
const resolvedPreset = initialPreset ?? detectPresetFamily(initialTheme) ?? "custom";
|
|
2019
|
+
setPresetKey(resolvedPreset);
|
|
2020
|
+
}, [initialTheme, initialPreset]);
|
|
2021
|
+
const mountReadyRef = react.useRef(false);
|
|
1353
2022
|
react.useEffect(() => {
|
|
1354
|
-
if (hasInitialTheme.current) return;
|
|
1355
2023
|
if (typeof window === "undefined") return;
|
|
2024
|
+
const initialAttr = document.documentElement.getAttribute("data-theme");
|
|
2025
|
+
const lastAttrRef = { current: initialAttr };
|
|
2026
|
+
const readyTimer = setTimeout(() => {
|
|
2027
|
+
mountReadyRef.current = true;
|
|
2028
|
+
}, 500);
|
|
1356
2029
|
const observer = new MutationObserver(() => {
|
|
2030
|
+
if (!mountReadyRef.current) return;
|
|
2031
|
+
const currentAttr = document.documentElement.getAttribute("data-theme");
|
|
2032
|
+
if (currentAttr === lastAttrRef.current) return;
|
|
2033
|
+
lastAttrRef.current = currentAttr;
|
|
1357
2034
|
requestAnimationFrame(() => {
|
|
1358
|
-
const
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
2035
|
+
const variant = currentAttr === "dark" ? "dark" : "light";
|
|
2036
|
+
let key = presetKeyRef.current;
|
|
2037
|
+
if (key === "custom") {
|
|
2038
|
+
const detected = detectPresetFamily(themeRef.current);
|
|
2039
|
+
if (detected) {
|
|
2040
|
+
key = detected;
|
|
2041
|
+
setPresetKey(detected);
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
if (key !== "custom") {
|
|
2045
|
+
const family = PRESET_FAMILIES[key];
|
|
2046
|
+
if (family) {
|
|
2047
|
+
const preset = family[variant];
|
|
2048
|
+
setTheme(preset);
|
|
2049
|
+
onChange?.(preset, key);
|
|
2050
|
+
}
|
|
2051
|
+
} else {
|
|
2052
|
+
const resolved = resolveThemeFromDOM();
|
|
2053
|
+
setTheme(resolved);
|
|
2054
|
+
onChange?.(resolved, "custom");
|
|
2055
|
+
}
|
|
1362
2056
|
});
|
|
1363
2057
|
});
|
|
1364
2058
|
observer.observe(document.documentElement, {
|
|
1365
2059
|
attributes: true,
|
|
1366
2060
|
attributeFilter: ["data-theme", "class"]
|
|
1367
2061
|
});
|
|
1368
|
-
return () =>
|
|
2062
|
+
return () => {
|
|
2063
|
+
clearTimeout(readyTimer);
|
|
2064
|
+
observer.disconnect();
|
|
2065
|
+
};
|
|
1369
2066
|
}, [onChange]);
|
|
1370
2067
|
react.useEffect(() => {
|
|
1371
2068
|
function handleKeyDown(e) {
|
|
1372
2069
|
if ((e.metaKey || e.ctrlKey) && e.key === "s") {
|
|
1373
2070
|
e.preventDefault();
|
|
1374
|
-
onSave?.(themeRef.current);
|
|
2071
|
+
onSave?.(themeRef.current, presetKeyRef.current);
|
|
1375
2072
|
}
|
|
1376
2073
|
}
|
|
1377
2074
|
window.addEventListener("keydown", handleKeyDown);
|
|
@@ -1384,7 +2081,7 @@ function ThemeEditorInner({
|
|
|
1384
2081
|
...prev,
|
|
1385
2082
|
[section]: { ...prev[section], [key]: value }
|
|
1386
2083
|
};
|
|
1387
|
-
onChange?.(next);
|
|
2084
|
+
onChange?.(next, "custom");
|
|
1388
2085
|
return next;
|
|
1389
2086
|
});
|
|
1390
2087
|
setPresetKey("custom");
|
|
@@ -1395,11 +2092,12 @@ function ThemeEditorInner({
|
|
|
1395
2092
|
(key) => {
|
|
1396
2093
|
const family = PRESET_FAMILIES[key];
|
|
1397
2094
|
if (family) {
|
|
1398
|
-
const
|
|
2095
|
+
const htmlTheme = typeof document !== "undefined" ? document.documentElement.getAttribute("data-theme") : null;
|
|
2096
|
+
const variant = htmlTheme === "dark" ? "dark" : htmlTheme === "light" ? "light" : isDarkTheme(theme) ? "dark" : "light";
|
|
1399
2097
|
const preset = family[variant];
|
|
1400
2098
|
setTheme(preset);
|
|
1401
2099
|
setPresetKey(key);
|
|
1402
|
-
onChange?.(preset);
|
|
2100
|
+
onChange?.(preset, key);
|
|
1403
2101
|
}
|
|
1404
2102
|
},
|
|
1405
2103
|
[onChange, theme]
|
|
@@ -1426,7 +2124,7 @@ function ThemeEditorInner({
|
|
|
1426
2124
|
const parsed = JSON.parse(reader.result);
|
|
1427
2125
|
setTheme(parsed);
|
|
1428
2126
|
setPresetKey("custom");
|
|
1429
|
-
onChange?.(parsed);
|
|
2127
|
+
onChange?.(parsed, "custom");
|
|
1430
2128
|
} catch {
|
|
1431
2129
|
}
|
|
1432
2130
|
};
|
|
@@ -1441,7 +2139,7 @@ function ThemeEditorInner({
|
|
|
1441
2139
|
importCssFile(theme, (merged) => {
|
|
1442
2140
|
setTheme(merged);
|
|
1443
2141
|
setPresetKey("custom");
|
|
1444
|
-
onChange?.(merged);
|
|
2142
|
+
onChange?.(merged, "custom");
|
|
1445
2143
|
});
|
|
1446
2144
|
}, [theme, onChange]);
|
|
1447
2145
|
const currentSection = react.useMemo(
|
|
@@ -1502,7 +2200,7 @@ function ThemeEditorInner({
|
|
|
1502
2200
|
children: "Compare"
|
|
1503
2201
|
}
|
|
1504
2202
|
),
|
|
1505
|
-
onSave && /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => onSave(theme), className: "fcte-btn fcte-btn--primary", children: "Save" })
|
|
2203
|
+
onSave && /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => onSave(theme, presetKey), className: "fcte-btn fcte-btn--primary", children: "Save" })
|
|
1506
2204
|
] })
|
|
1507
2205
|
] }),
|
|
1508
2206
|
showPalette && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1512,7 +2210,7 @@ function ThemeEditorInner({
|
|
|
1512
2210
|
onApply: (newTheme) => {
|
|
1513
2211
|
setTheme(newTheme);
|
|
1514
2212
|
setPresetKey("custom");
|
|
1515
|
-
onChange?.(newTheme);
|
|
2213
|
+
onChange?.(newTheme, "custom");
|
|
1516
2214
|
setShowPalette(false);
|
|
1517
2215
|
},
|
|
1518
2216
|
onClose: () => setShowPalette(false)
|