@squaredr/fieldcraft-pro 1.6.4 → 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-VECQKSWS.mjs → chunk-4MMKB2EW.mjs} +60 -86
- package/dist/{chunk-CFVT2R42.mjs → chunk-CYXJGOQH.mjs} +904 -206
- package/dist/{chunk-ANBMT5AW.mjs → chunk-GXKQCXIB.mjs} +470 -228
- package/dist/chunk-IW654Z3M.mjs +1108 -0
- package/dist/{chunk-5LKGCZAW.mjs → chunk-MLP5EDWP.mjs} +167 -178
- package/dist/form-builder/index.d.mts +176 -6
- package/dist/form-builder/index.d.ts +176 -6
- package/dist/form-builder/index.js +604 -365
- package/dist/form-builder/index.mjs +2 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +3221 -984
- package/dist/index.mjs +332 -125
- package/dist/response-viewer/index.d.mts +1 -1
- package/dist/response-viewer/index.d.ts +1 -1
- package/dist/response-viewer/index.js +169 -204
- package/dist/response-viewer/index.mjs +2 -2
- package/dist/styles.css +1 -1
- package/dist/templates/index.d.mts +43 -0
- package/dist/templates/index.d.ts +43 -0
- package/dist/templates/index.js +1116 -0
- package/dist/templates/index.mjs +1 -0
- package/dist/theme-editor/index.d.mts +11 -5
- package/dist/theme-editor/index.d.ts +11 -5
- package/dist/theme-editor/index.js +907 -232
- package/dist/theme-editor/index.mjs +2 -2
- package/dist/types-bFHsZT1n.d.mts +217 -0
- package/dist/types-bFHsZT1n.d.ts +217 -0
- package/package.json +23 -11
- package/theme-editor/styles.css +468 -466
- package/dist/index-D19524df.d.mts +0 -387
- package/dist/index-D19524df.d.ts +0 -387
|
@@ -5,27 +5,6 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
5
5
|
var fieldcraftReact = require('@squaredr/fieldcraft-react');
|
|
6
6
|
|
|
7
7
|
// ../license/dist/index.mjs
|
|
8
|
-
var PRO_FEATURES = [
|
|
9
|
-
"SchemaEditor",
|
|
10
|
-
"ResponseViewer",
|
|
11
|
-
"ThemeEditor",
|
|
12
|
-
"FormBuilder",
|
|
13
|
-
"ApiManager",
|
|
14
|
-
"Analytics"
|
|
15
|
-
];
|
|
16
|
-
var ALL_FEATURES = [
|
|
17
|
-
...PRO_FEATURES,
|
|
18
|
-
"Telehealth"
|
|
19
|
-
];
|
|
20
|
-
var TIER_FEATURES = {
|
|
21
|
-
starter: ["SchemaEditor", "ResponseViewer"],
|
|
22
|
-
pro: PRO_FEATURES,
|
|
23
|
-
business: ALL_FEATURES,
|
|
24
|
-
enterprise: ALL_FEATURES
|
|
25
|
-
};
|
|
26
|
-
function tierHasFeature(tier, featureName) {
|
|
27
|
-
return TIER_FEATURES[tier]?.includes(featureName) ?? false;
|
|
28
|
-
}
|
|
29
8
|
var DEV_HOSTNAMES = /* @__PURE__ */ new Set([
|
|
30
9
|
"localhost",
|
|
31
10
|
"127.0.0.1",
|
|
@@ -97,7 +76,8 @@ function isProductionEnvironment() {
|
|
|
97
76
|
}
|
|
98
77
|
return false;
|
|
99
78
|
}
|
|
100
|
-
|
|
79
|
+
typeof process !== "undefined" && process.env?.NEXT_PUBLIC_FCPRO_PING_URL || "https://fieldcraft.dev/api/license/ping";
|
|
80
|
+
var defaultContext = { status: "validating" };
|
|
101
81
|
var LicenseCtx = react.createContext(defaultContext);
|
|
102
82
|
function useLicense() {
|
|
103
83
|
return react.useContext(LicenseCtx);
|
|
@@ -297,7 +277,7 @@ function UnlicensedOverlay({ featureName, reason, children }) {
|
|
|
297
277
|
}
|
|
298
278
|
function requireLicense(Component, featureName) {
|
|
299
279
|
function LicenseGated(props) {
|
|
300
|
-
const { status
|
|
280
|
+
const { status } = useLicense();
|
|
301
281
|
const isProduction = isProductionEnvironment();
|
|
302
282
|
if (!isProduction) {
|
|
303
283
|
return /* @__PURE__ */ jsxRuntime.jsx(Component, { ...props });
|
|
@@ -305,8 +285,7 @@ function requireLicense(Component, featureName) {
|
|
|
305
285
|
if (status === "validating") {
|
|
306
286
|
return null;
|
|
307
287
|
}
|
|
308
|
-
|
|
309
|
-
if (isLicensed) {
|
|
288
|
+
if (status === "valid") {
|
|
310
289
|
return /* @__PURE__ */ jsxRuntime.jsx(Component, { ...props });
|
|
311
290
|
}
|
|
312
291
|
let reason = "A valid license is required for production use.";
|
|
@@ -318,8 +297,6 @@ function requireLicense(Component, featureName) {
|
|
|
318
297
|
reason = "This license key has been revoked. Please contact support or purchase a new license.";
|
|
319
298
|
} else if (status === "domain_mismatch") {
|
|
320
299
|
reason = "This license key is registered to a different domain. Each key can only be used on one production domain. Please purchase a new license for this domain.";
|
|
321
|
-
} else if (!tier || !tierHasFeature(tier, featureName)) {
|
|
322
|
-
reason = "Your license does not include this feature. Please upgrade your plan.";
|
|
323
300
|
}
|
|
324
301
|
return /* @__PURE__ */ jsxRuntime.jsx(UnlicensedOverlay, { featureName, reason, children: /* @__PURE__ */ jsxRuntime.jsx(Component, { ...props }) });
|
|
325
302
|
}
|
|
@@ -332,18 +309,23 @@ var PREVIEW_SCHEMA = {
|
|
|
332
309
|
id: "theme-preview",
|
|
333
310
|
version: "1.0.0",
|
|
334
311
|
title: "Theme Preview",
|
|
335
|
-
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
|
+
},
|
|
336
317
|
sections: [
|
|
337
318
|
{
|
|
338
|
-
id: "
|
|
339
|
-
title: "
|
|
319
|
+
id: "s-text",
|
|
320
|
+
title: "Text Inputs",
|
|
340
321
|
questions: [
|
|
341
322
|
{
|
|
342
323
|
id: "name",
|
|
343
324
|
type: "short_text",
|
|
344
325
|
label: "Full Name",
|
|
345
326
|
required: true,
|
|
346
|
-
placeholder: "Jane Doe"
|
|
327
|
+
placeholder: "Jane Doe",
|
|
328
|
+
helpText: "Enter your full legal name."
|
|
347
329
|
},
|
|
348
330
|
{
|
|
349
331
|
id: "email",
|
|
@@ -352,6 +334,31 @@ var PREVIEW_SCHEMA = {
|
|
|
352
334
|
required: true,
|
|
353
335
|
placeholder: "jane@example.com"
|
|
354
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: [
|
|
355
362
|
{
|
|
356
363
|
id: "department",
|
|
357
364
|
type: "dropdown",
|
|
@@ -359,20 +366,184 @@ var PREVIEW_SCHEMA = {
|
|
|
359
366
|
options: [
|
|
360
367
|
{ label: "Engineering", value: "engineering" },
|
|
361
368
|
{ label: "Design", value: "design" },
|
|
362
|
-
{ label: "Marketing", value: "marketing" }
|
|
369
|
+
{ label: "Marketing", value: "marketing" },
|
|
370
|
+
{ label: "Sales", value: "sales" }
|
|
363
371
|
]
|
|
364
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
|
+
},
|
|
365
425
|
{
|
|
366
426
|
id: "rating",
|
|
367
427
|
type: "rating",
|
|
368
|
-
label: "
|
|
428
|
+
label: "Overall Rating",
|
|
369
429
|
config: { type: "rating", max: 5 }
|
|
370
430
|
},
|
|
371
431
|
{
|
|
372
|
-
id: "
|
|
373
|
-
type: "
|
|
374
|
-
label: "
|
|
375
|
-
|
|
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 }
|
|
376
547
|
}
|
|
377
548
|
]
|
|
378
549
|
}
|
|
@@ -731,148 +902,458 @@ function PaletteGenerator({ theme, onApply, onClose }) {
|
|
|
731
902
|
}
|
|
732
903
|
|
|
733
904
|
// src/theme-editor/presets.ts
|
|
734
|
-
var
|
|
905
|
+
var cleanLight = {
|
|
735
906
|
colors: {
|
|
736
|
-
primary: "#
|
|
907
|
+
primary: "#2563EB",
|
|
737
908
|
primaryForeground: "#FFFFFF",
|
|
738
|
-
secondary: "#
|
|
739
|
-
secondaryForeground: "#
|
|
740
|
-
error: "#
|
|
909
|
+
secondary: "#DBEAFE",
|
|
910
|
+
secondaryForeground: "#1E3A5F",
|
|
911
|
+
error: "#DC2626",
|
|
741
912
|
errorForeground: "#FFFFFF",
|
|
742
|
-
warning: "#
|
|
743
|
-
success: "#
|
|
913
|
+
warning: "#D97706",
|
|
914
|
+
success: "#16A34A",
|
|
744
915
|
surface: "#FFFFFF",
|
|
745
|
-
background: "#
|
|
746
|
-
text: "#
|
|
747
|
-
textMuted: "#
|
|
748
|
-
textDisabled: "#
|
|
749
|
-
border: "#
|
|
750
|
-
borderFocus: "#
|
|
916
|
+
background: "#F8FAFC",
|
|
917
|
+
text: "#0F172A",
|
|
918
|
+
textMuted: "#64748B",
|
|
919
|
+
textDisabled: "#CBD5E1",
|
|
920
|
+
border: "#E2E8F0",
|
|
921
|
+
borderFocus: "#2563EB",
|
|
751
922
|
inputBackground: "#FFFFFF"
|
|
752
923
|
},
|
|
753
924
|
typography: {
|
|
754
925
|
fontFamily: "Inter, system-ui, sans-serif",
|
|
755
926
|
scale: "comfortable",
|
|
756
|
-
questionSize: "1.
|
|
927
|
+
questionSize: "1.0625rem",
|
|
757
928
|
labelSize: "0.875rem",
|
|
758
929
|
helpTextSize: "0.8125rem",
|
|
759
930
|
bodySize: "0.9375rem"
|
|
760
931
|
},
|
|
761
|
-
shape: { radius: "
|
|
932
|
+
shape: { radius: "sm", inputRadius: "6px", buttonRadius: "6px", cardRadius: "8px" },
|
|
762
933
|
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
763
|
-
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "
|
|
934
|
+
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "flat" }
|
|
764
935
|
};
|
|
765
|
-
var
|
|
936
|
+
var cleanDark = {
|
|
766
937
|
colors: {
|
|
767
|
-
primary: "#
|
|
768
|
-
primaryForeground: "#
|
|
769
|
-
secondary: "#
|
|
770
|
-
secondaryForeground: "#
|
|
771
|
-
error: "#
|
|
772
|
-
errorForeground: "#
|
|
773
|
-
warning: "#
|
|
774
|
-
success: "#
|
|
775
|
-
surface: "#
|
|
776
|
-
background: "#
|
|
777
|
-
text: "#
|
|
778
|
-
textMuted: "#
|
|
779
|
-
textDisabled: "#
|
|
780
|
-
border: "#
|
|
781
|
-
borderFocus: "#
|
|
782
|
-
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"
|
|
783
954
|
},
|
|
784
955
|
typography: {
|
|
785
956
|
fontFamily: "Inter, system-ui, sans-serif",
|
|
786
957
|
scale: "comfortable",
|
|
787
|
-
questionSize: "1.
|
|
958
|
+
questionSize: "1.0625rem",
|
|
788
959
|
labelSize: "0.875rem",
|
|
789
960
|
helpTextSize: "0.8125rem",
|
|
790
961
|
bodySize: "0.9375rem"
|
|
791
962
|
},
|
|
792
|
-
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" },
|
|
793
995
|
spacing: { base: 16, sectionGap: 32, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
794
996
|
layout: { maxWidth: "640px", alignment: "left", progressPosition: "top", sectionLayout: "card" }
|
|
795
997
|
};
|
|
796
|
-
var
|
|
998
|
+
var stripeDark = {
|
|
797
999
|
colors: {
|
|
798
|
-
primary: "#
|
|
799
|
-
primaryForeground: "#
|
|
800
|
-
secondary: "#
|
|
801
|
-
secondaryForeground: "#
|
|
802
|
-
error: "#
|
|
803
|
-
errorForeground: "#
|
|
804
|
-
warning: "#
|
|
805
|
-
success: "#
|
|
806
|
-
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",
|
|
807
1102
|
background: "#FAFAFA",
|
|
808
|
-
text: "#
|
|
809
|
-
textMuted: "#
|
|
810
|
-
textDisabled: "#
|
|
811
|
-
border: "#
|
|
812
|
-
borderFocus: "#
|
|
813
|
-
inputBackground: "#
|
|
1103
|
+
text: "#171717",
|
|
1104
|
+
textMuted: "#666666",
|
|
1105
|
+
textDisabled: "#C7C7C7",
|
|
1106
|
+
border: "#EAEAEA",
|
|
1107
|
+
borderFocus: "#000000",
|
|
1108
|
+
inputBackground: "#FFFFFF"
|
|
814
1109
|
},
|
|
815
1110
|
typography: {
|
|
816
|
-
fontFamily: "'
|
|
1111
|
+
fontFamily: "'Geist', Inter, -apple-system, sans-serif",
|
|
817
1112
|
scale: "comfortable",
|
|
818
|
-
questionSize: "
|
|
1113
|
+
questionSize: "1rem",
|
|
819
1114
|
labelSize: "0.875rem",
|
|
820
1115
|
helpTextSize: "0.8125rem",
|
|
821
|
-
bodySize: "
|
|
1116
|
+
bodySize: "0.875rem"
|
|
822
1117
|
},
|
|
823
|
-
shape: { radius: "
|
|
824
|
-
spacing: { base: 16, sectionGap:
|
|
825
|
-
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" }
|
|
826
1245
|
};
|
|
827
|
-
var
|
|
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" }
|
|
1307
|
+
};
|
|
1308
|
+
var tailwindDark = {
|
|
828
1309
|
colors: {
|
|
829
1310
|
primary: "#818CF8",
|
|
830
1311
|
primaryForeground: "#1E1B4B",
|
|
831
|
-
secondary: "#
|
|
832
|
-
secondaryForeground: "#
|
|
833
|
-
error: "#
|
|
834
|
-
errorForeground: "#
|
|
1312
|
+
secondary: "#1E1B4B",
|
|
1313
|
+
secondaryForeground: "#C7D2FE",
|
|
1314
|
+
error: "#F87171",
|
|
1315
|
+
errorForeground: "#1C1917",
|
|
835
1316
|
warning: "#FBBF24",
|
|
836
|
-
success: "#
|
|
837
|
-
surface: "#
|
|
838
|
-
background: "#
|
|
839
|
-
text: "#
|
|
840
|
-
textMuted: "#
|
|
841
|
-
textDisabled: "#
|
|
842
|
-
border: "#
|
|
1317
|
+
success: "#34D399",
|
|
1318
|
+
surface: "#1F2937",
|
|
1319
|
+
background: "#111827",
|
|
1320
|
+
text: "#F9FAFB",
|
|
1321
|
+
textMuted: "#9CA3AF",
|
|
1322
|
+
textDisabled: "#374151",
|
|
1323
|
+
border: "#374151",
|
|
843
1324
|
borderFocus: "#818CF8",
|
|
844
|
-
inputBackground: "#
|
|
1325
|
+
inputBackground: "#1F2937"
|
|
845
1326
|
},
|
|
846
1327
|
typography: {
|
|
847
|
-
fontFamily: "
|
|
1328
|
+
fontFamily: "Inter, system-ui, sans-serif",
|
|
848
1329
|
scale: "comfortable",
|
|
849
|
-
questionSize: "
|
|
1330
|
+
questionSize: "1rem",
|
|
850
1331
|
labelSize: "0.875rem",
|
|
851
1332
|
helpTextSize: "0.8125rem",
|
|
852
|
-
bodySize: "
|
|
1333
|
+
bodySize: "0.875rem"
|
|
853
1334
|
},
|
|
854
|
-
shape: { radius: "
|
|
855
|
-
spacing: { base: 16, sectionGap:
|
|
856
|
-
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" }
|
|
857
1338
|
};
|
|
858
|
-
var
|
|
1339
|
+
var clinicalLight = {
|
|
859
1340
|
colors: {
|
|
860
|
-
primary: "#
|
|
861
|
-
primaryForeground: "#
|
|
862
|
-
secondary: "#
|
|
863
|
-
secondaryForeground: "#
|
|
864
|
-
error: "#
|
|
865
|
-
errorForeground: "#
|
|
866
|
-
warning: "#
|
|
867
|
-
success: "#
|
|
868
|
-
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",
|
|
869
1350
|
background: "#F0F9FF",
|
|
870
1351
|
text: "#0C4A6E",
|
|
871
|
-
textMuted: "#
|
|
872
|
-
textDisabled: "#
|
|
1352
|
+
textMuted: "#4B6B82",
|
|
1353
|
+
textDisabled: "#BAD6E9",
|
|
873
1354
|
border: "#BAE6FD",
|
|
874
|
-
borderFocus: "#
|
|
875
|
-
inputBackground: "#
|
|
1355
|
+
borderFocus: "#0369A1",
|
|
1356
|
+
inputBackground: "#FFFFFF"
|
|
876
1357
|
},
|
|
877
1358
|
typography: {
|
|
878
1359
|
fontFamily: "'Source Sans 3', 'Segoe UI', system-ui, sans-serif",
|
|
@@ -886,22 +1367,22 @@ var clinicalPreset = {
|
|
|
886
1367
|
spacing: { base: 16, sectionGap: 28, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
887
1368
|
layout: { maxWidth: "680px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
|
|
888
1369
|
};
|
|
889
|
-
var
|
|
1370
|
+
var clinicalDark = {
|
|
890
1371
|
colors: {
|
|
891
1372
|
primary: "#38BDF8",
|
|
892
1373
|
primaryForeground: "#0C1929",
|
|
893
|
-
secondary: "#
|
|
894
|
-
secondaryForeground: "#
|
|
895
|
-
error: "#
|
|
896
|
-
errorForeground: "#
|
|
897
|
-
warning: "#
|
|
898
|
-
success: "#
|
|
1374
|
+
secondary: "#0C3554",
|
|
1375
|
+
secondaryForeground: "#BAE6FD",
|
|
1376
|
+
error: "#FCA5A5",
|
|
1377
|
+
errorForeground: "#1C1110",
|
|
1378
|
+
warning: "#FCD34D",
|
|
1379
|
+
success: "#6EE7B7",
|
|
899
1380
|
surface: "#0F2438",
|
|
900
|
-
background: "#
|
|
1381
|
+
background: "#0B1929",
|
|
901
1382
|
text: "#E0F2FE",
|
|
902
|
-
textMuted: "#
|
|
1383
|
+
textMuted: "#7DC4E8",
|
|
903
1384
|
textDisabled: "#1E3A5F",
|
|
904
|
-
border: "#
|
|
1385
|
+
border: "#1C3A5A",
|
|
905
1386
|
borderFocus: "#38BDF8",
|
|
906
1387
|
inputBackground: "#0F2438"
|
|
907
1388
|
},
|
|
@@ -917,86 +1398,210 @@ var clinicalDarkPreset = {
|
|
|
917
1398
|
spacing: { base: 16, sectionGap: 28, fieldGap: 24, inputPaddingX: 12, inputPaddingY: 10 },
|
|
918
1399
|
layout: { maxWidth: "680px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
|
|
919
1400
|
};
|
|
920
|
-
var
|
|
1401
|
+
var notionLight = {
|
|
921
1402
|
colors: {
|
|
922
|
-
primary: "#
|
|
923
|
-
primaryForeground: "#
|
|
924
|
-
secondary: "#
|
|
925
|
-
secondaryForeground: "#
|
|
926
|
-
error: "#
|
|
927
|
-
errorForeground: "#
|
|
928
|
-
warning: "#
|
|
929
|
-
success: "#
|
|
930
|
-
surface: "#
|
|
931
|
-
background: "#
|
|
932
|
-
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",
|
|
933
1476
|
textMuted: "#78716C",
|
|
934
1477
|
textDisabled: "#D6D3D1",
|
|
935
|
-
border: "#
|
|
936
|
-
borderFocus: "#
|
|
937
|
-
inputBackground: "#
|
|
1478
|
+
border: "#E7E5E4",
|
|
1479
|
+
borderFocus: "#C2410C",
|
|
1480
|
+
inputBackground: "#FFFFFF"
|
|
938
1481
|
},
|
|
939
1482
|
typography: {
|
|
940
|
-
fontFamily: "'
|
|
941
|
-
scale: "
|
|
942
|
-
questionSize: "1.
|
|
943
|
-
labelSize: "0.
|
|
944
|
-
helpTextSize: "0.
|
|
945
|
-
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"
|
|
946
1489
|
},
|
|
947
|
-
shape: { radius: "
|
|
948
|
-
spacing: { base:
|
|
949
|
-
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" }
|
|
950
1493
|
};
|
|
951
|
-
var
|
|
1494
|
+
var sunsetDark = {
|
|
952
1495
|
colors: {
|
|
953
|
-
primary: "#
|
|
954
|
-
primaryForeground: "#
|
|
955
|
-
secondary: "#
|
|
956
|
-
secondaryForeground: "#
|
|
1496
|
+
primary: "#FB923C",
|
|
1497
|
+
primaryForeground: "#1C1210",
|
|
1498
|
+
secondary: "#3D1F0E",
|
|
1499
|
+
secondaryForeground: "#FED7AA",
|
|
957
1500
|
error: "#FCA5A5",
|
|
958
|
-
errorForeground: "#
|
|
1501
|
+
errorForeground: "#1C1210",
|
|
959
1502
|
warning: "#FCD34D",
|
|
960
1503
|
success: "#6EE7B7",
|
|
961
|
-
surface: "#
|
|
962
|
-
background: "#
|
|
963
|
-
text: "#
|
|
964
|
-
textMuted: "#
|
|
965
|
-
textDisabled: "#
|
|
966
|
-
border: "#
|
|
967
|
-
borderFocus: "#
|
|
968
|
-
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"
|
|
1512
|
+
},
|
|
1513
|
+
typography: {
|
|
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"
|
|
969
1543
|
},
|
|
970
1544
|
typography: {
|
|
971
|
-
fontFamily: "'
|
|
1545
|
+
fontFamily: "'Plus Jakarta Sans', Inter, system-ui, sans-serif",
|
|
972
1546
|
scale: "spacious",
|
|
973
|
-
questionSize: "1.
|
|
974
|
-
labelSize: "0.
|
|
975
|
-
helpTextSize: "0.
|
|
976
|
-
bodySize: "
|
|
1547
|
+
questionSize: "1.1875rem",
|
|
1548
|
+
labelSize: "0.875rem",
|
|
1549
|
+
helpTextSize: "0.8125rem",
|
|
1550
|
+
bodySize: "0.9375rem"
|
|
977
1551
|
},
|
|
978
|
-
shape: { radius: "
|
|
979
|
-
spacing: { base: 18, sectionGap: 36, fieldGap: 28, inputPaddingX:
|
|
980
|
-
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" }
|
|
981
1555
|
};
|
|
982
|
-
var
|
|
1556
|
+
var roseDark = {
|
|
983
1557
|
colors: {
|
|
984
|
-
primary: "#
|
|
985
|
-
primaryForeground: "#
|
|
986
|
-
secondary: "#
|
|
987
|
-
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",
|
|
988
1593
|
error: "#B91C1C",
|
|
989
|
-
errorForeground: "#
|
|
990
|
-
warning: "#
|
|
1594
|
+
errorForeground: "#FFFFFF",
|
|
1595
|
+
warning: "#854D0E",
|
|
991
1596
|
success: "#166534",
|
|
992
|
-
surface: "#
|
|
993
|
-
background: "#
|
|
1597
|
+
surface: "#FFFFFF",
|
|
1598
|
+
background: "#FFFFFF",
|
|
994
1599
|
text: "#000000",
|
|
995
|
-
textMuted: "#
|
|
996
|
-
textDisabled: "#
|
|
1600
|
+
textMuted: "#333333",
|
|
1601
|
+
textDisabled: "#888888",
|
|
997
1602
|
border: "#000000",
|
|
998
|
-
borderFocus: "#
|
|
999
|
-
inputBackground: "#
|
|
1603
|
+
borderFocus: "#0000CC",
|
|
1604
|
+
inputBackground: "#FFFFFF"
|
|
1000
1605
|
},
|
|
1001
1606
|
typography: {
|
|
1002
1607
|
fontFamily: "Arial, Helvetica, sans-serif",
|
|
@@ -1010,24 +1615,24 @@ var highContrastPreset = {
|
|
|
1010
1615
|
spacing: { base: 20, sectionGap: 40, fieldGap: 32, inputPaddingX: 14, inputPaddingY: 12 },
|
|
1011
1616
|
layout: { maxWidth: "720px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
|
|
1012
1617
|
};
|
|
1013
|
-
var
|
|
1618
|
+
var highContrastDark = {
|
|
1014
1619
|
colors: {
|
|
1015
|
-
primary: "#
|
|
1620
|
+
primary: "#6CB4FF",
|
|
1016
1621
|
primaryForeground: "#000000",
|
|
1017
|
-
secondary: "#
|
|
1018
|
-
secondaryForeground: "#
|
|
1019
|
-
error: "#
|
|
1622
|
+
secondary: "#002255",
|
|
1623
|
+
secondaryForeground: "#99CCFF",
|
|
1624
|
+
error: "#FF8A8A",
|
|
1020
1625
|
errorForeground: "#000000",
|
|
1021
|
-
warning: "#
|
|
1022
|
-
success: "#
|
|
1023
|
-
surface: "#
|
|
1626
|
+
warning: "#FFD54F",
|
|
1627
|
+
success: "#69F0AE",
|
|
1628
|
+
surface: "#0A0A0A",
|
|
1024
1629
|
background: "#000000",
|
|
1025
1630
|
text: "#FFFFFF",
|
|
1026
|
-
textMuted: "#
|
|
1027
|
-
textDisabled: "#
|
|
1631
|
+
textMuted: "#CCCCCC",
|
|
1632
|
+
textDisabled: "#666666",
|
|
1028
1633
|
border: "#FFFFFF",
|
|
1029
|
-
borderFocus: "#
|
|
1030
|
-
inputBackground: "#
|
|
1634
|
+
borderFocus: "#6CB4FF",
|
|
1635
|
+
inputBackground: "#0A0A0A"
|
|
1031
1636
|
},
|
|
1032
1637
|
typography: {
|
|
1033
1638
|
fontFamily: "Arial, Helvetica, sans-serif",
|
|
@@ -1042,11 +1647,18 @@ var highContrastDarkPreset = {
|
|
|
1042
1647
|
layout: { maxWidth: "720px", alignment: "left", progressPosition: "top", sectionLayout: "bordered" }
|
|
1043
1648
|
};
|
|
1044
1649
|
var PRESET_FAMILIES = {
|
|
1045
|
-
clean: { light:
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
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" }
|
|
1050
1662
|
};
|
|
1051
1663
|
var COMPARISON_PRESETS = Object.fromEntries(
|
|
1052
1664
|
Object.entries(PRESET_FAMILIES).map(([key, family]) => [
|
|
@@ -1224,13 +1836,31 @@ function ThemeEditorThemeProvider({ theme, children }) {
|
|
|
1224
1836
|
}
|
|
1225
1837
|
function isDarkTheme(theme) {
|
|
1226
1838
|
const bg = theme.colors?.background ?? "#FFFFFF";
|
|
1227
|
-
|
|
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
|
+
}
|
|
1228
1843
|
if (hex.length < 6) return false;
|
|
1229
1844
|
const r = parseInt(hex.slice(0, 2), 16);
|
|
1230
1845
|
const g = parseInt(hex.slice(2, 4), 16);
|
|
1231
1846
|
const b = parseInt(hex.slice(4, 6), 16);
|
|
1232
1847
|
return 0.299 * r + 0.587 * g + 0.114 * b < 128;
|
|
1233
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
|
+
}
|
|
1234
1864
|
var SECTIONS = [
|
|
1235
1865
|
{
|
|
1236
1866
|
id: "colors",
|
|
@@ -1351,6 +1981,7 @@ var SECTIONS = [
|
|
|
1351
1981
|
];
|
|
1352
1982
|
function ThemeEditorInner({
|
|
1353
1983
|
initialTheme,
|
|
1984
|
+
initialPreset,
|
|
1354
1985
|
onChange,
|
|
1355
1986
|
onSave,
|
|
1356
1987
|
theme: chromeTheme,
|
|
@@ -1362,39 +1993,82 @@ function ThemeEditorInner({
|
|
|
1362
1993
|
}) {
|
|
1363
1994
|
const resolvedInitial = react.useMemo(
|
|
1364
1995
|
() => initialTheme ?? resolveThemeFromDOM(),
|
|
1365
|
-
|
|
1366
|
-
[]
|
|
1996
|
+
[initialTheme]
|
|
1367
1997
|
);
|
|
1368
1998
|
const [theme, setTheme] = react.useState(resolvedInitial);
|
|
1369
1999
|
const [activeSection, setActiveSection] = react.useState("colors");
|
|
1370
|
-
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;
|
|
1371
2004
|
const [showPalette, setShowPalette] = react.useState(false);
|
|
1372
2005
|
const [showComparison, setShowComparison] = react.useState(false);
|
|
1373
2006
|
const themeRef = react.useRef(theme);
|
|
1374
2007
|
themeRef.current = theme;
|
|
1375
|
-
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);
|
|
1376
2022
|
react.useEffect(() => {
|
|
1377
|
-
if (hasInitialTheme.current) return;
|
|
1378
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);
|
|
1379
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;
|
|
1380
2034
|
requestAnimationFrame(() => {
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
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
|
+
}
|
|
1385
2056
|
});
|
|
1386
2057
|
});
|
|
1387
2058
|
observer.observe(document.documentElement, {
|
|
1388
2059
|
attributes: true,
|
|
1389
2060
|
attributeFilter: ["data-theme", "class"]
|
|
1390
2061
|
});
|
|
1391
|
-
return () =>
|
|
2062
|
+
return () => {
|
|
2063
|
+
clearTimeout(readyTimer);
|
|
2064
|
+
observer.disconnect();
|
|
2065
|
+
};
|
|
1392
2066
|
}, [onChange]);
|
|
1393
2067
|
react.useEffect(() => {
|
|
1394
2068
|
function handleKeyDown(e) {
|
|
1395
2069
|
if ((e.metaKey || e.ctrlKey) && e.key === "s") {
|
|
1396
2070
|
e.preventDefault();
|
|
1397
|
-
onSave?.(themeRef.current);
|
|
2071
|
+
onSave?.(themeRef.current, presetKeyRef.current);
|
|
1398
2072
|
}
|
|
1399
2073
|
}
|
|
1400
2074
|
window.addEventListener("keydown", handleKeyDown);
|
|
@@ -1407,7 +2081,7 @@ function ThemeEditorInner({
|
|
|
1407
2081
|
...prev,
|
|
1408
2082
|
[section]: { ...prev[section], [key]: value }
|
|
1409
2083
|
};
|
|
1410
|
-
onChange?.(next);
|
|
2084
|
+
onChange?.(next, "custom");
|
|
1411
2085
|
return next;
|
|
1412
2086
|
});
|
|
1413
2087
|
setPresetKey("custom");
|
|
@@ -1418,11 +2092,12 @@ function ThemeEditorInner({
|
|
|
1418
2092
|
(key) => {
|
|
1419
2093
|
const family = PRESET_FAMILIES[key];
|
|
1420
2094
|
if (family) {
|
|
1421
|
-
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";
|
|
1422
2097
|
const preset = family[variant];
|
|
1423
2098
|
setTheme(preset);
|
|
1424
2099
|
setPresetKey(key);
|
|
1425
|
-
onChange?.(preset);
|
|
2100
|
+
onChange?.(preset, key);
|
|
1426
2101
|
}
|
|
1427
2102
|
},
|
|
1428
2103
|
[onChange, theme]
|
|
@@ -1449,7 +2124,7 @@ function ThemeEditorInner({
|
|
|
1449
2124
|
const parsed = JSON.parse(reader.result);
|
|
1450
2125
|
setTheme(parsed);
|
|
1451
2126
|
setPresetKey("custom");
|
|
1452
|
-
onChange?.(parsed);
|
|
2127
|
+
onChange?.(parsed, "custom");
|
|
1453
2128
|
} catch {
|
|
1454
2129
|
}
|
|
1455
2130
|
};
|
|
@@ -1464,7 +2139,7 @@ function ThemeEditorInner({
|
|
|
1464
2139
|
importCssFile(theme, (merged) => {
|
|
1465
2140
|
setTheme(merged);
|
|
1466
2141
|
setPresetKey("custom");
|
|
1467
|
-
onChange?.(merged);
|
|
2142
|
+
onChange?.(merged, "custom");
|
|
1468
2143
|
});
|
|
1469
2144
|
}, [theme, onChange]);
|
|
1470
2145
|
const currentSection = react.useMemo(
|
|
@@ -1525,7 +2200,7 @@ function ThemeEditorInner({
|
|
|
1525
2200
|
children: "Compare"
|
|
1526
2201
|
}
|
|
1527
2202
|
),
|
|
1528
|
-
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" })
|
|
1529
2204
|
] })
|
|
1530
2205
|
] }),
|
|
1531
2206
|
showPalette && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1535,7 +2210,7 @@ function ThemeEditorInner({
|
|
|
1535
2210
|
onApply: (newTheme) => {
|
|
1536
2211
|
setTheme(newTheme);
|
|
1537
2212
|
setPresetKey("custom");
|
|
1538
|
-
onChange?.(newTheme);
|
|
2213
|
+
onChange?.(newTheme, "custom");
|
|
1539
2214
|
setShowPalette(false);
|
|
1540
2215
|
},
|
|
1541
2216
|
onClose: () => setShowPalette(false)
|