@adriansteffan/reactive 0.1.25 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mod.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ComponentType } from 'react';
2
+ import { Context } from 'react';
2
3
  import { CSSProperties } from 'react';
3
4
  import { default as default_2 } from 'react';
4
5
  import { ForwardRefExoticComponent } from 'react';
@@ -156,6 +157,7 @@ export declare function ExitFullscreen({ next, delayMs, }: {
156
157
 
157
158
  export declare interface ExperimentConfig {
158
159
  showProgressBar: boolean;
160
+ theme?: Theme;
159
161
  }
160
162
 
161
163
  export declare function ExperimentProvider({ children, disableSettings, disableHybridSimulation }: {
@@ -489,6 +491,56 @@ declare type StoreUpdateFunction = (data?: TrialResult[], store?: Store_2) => Re
489
491
 
490
492
  export declare function subsetExperimentByParam(experiment: any[]): any[];
491
493
 
494
+ export declare function t(theme: Theme): {
495
+ readonly containerBg: "";
496
+ readonly text: "text-black";
497
+ readonly prose: "prose-slate";
498
+ readonly proseLink: "prose-a:text-blue-600";
499
+ readonly buttonBg: "bg-white";
500
+ readonly buttonText: "text-black";
501
+ readonly buttonBorder: "border-black";
502
+ readonly buttonShadow: "shadow-[2px_2px_0px_rgba(0,0,0,1)]";
503
+ readonly buttonDisabledBg: "bg-gray-200";
504
+ readonly buttonDisabledText: "text-gray-400";
505
+ readonly buttonDisabledBorder: "border-gray-400";
506
+ readonly buttonDisabledShadow: "shadow-[2px_2px_0px_rgba(156,163,175,1)]";
507
+ readonly error: "text-red-500";
508
+ readonly focusRing: "focus:ring-blue-500";
509
+ readonly inputBg: "";
510
+ readonly inputBorder: "border-black";
511
+ readonly inputText: "";
512
+ readonly progressBg: "bg-gray-200";
513
+ readonly progressStripe1: "#E5E7EB";
514
+ readonly progressStripe2: "#D1D5DB";
515
+ readonly dotActive: "#000";
516
+ readonly dotInactive: "rgba(0,0,0,0.2)";
517
+ readonly toastTheme: "light";
518
+ } | {
519
+ readonly containerBg: "bg-[#1a1a2e]";
520
+ readonly text: "text-[#f5f5f5]";
521
+ readonly prose: "prose-invert";
522
+ readonly proseLink: "prose-a:text-blue-400";
523
+ readonly buttonBg: "bg-white";
524
+ readonly buttonText: "text-black";
525
+ readonly buttonBorder: "border-black";
526
+ readonly buttonShadow: "shadow-[2px_2px_0px_rgba(0,0,0,1)]";
527
+ readonly buttonDisabledBg: "bg-gray-700";
528
+ readonly buttonDisabledText: "text-gray-500";
529
+ readonly buttonDisabledBorder: "border-gray-600";
530
+ readonly buttonDisabledShadow: "shadow-[2px_2px_0px_rgba(75,85,99,1)]";
531
+ readonly error: "text-red-400";
532
+ readonly focusRing: "focus:ring-blue-400";
533
+ readonly inputBg: "bg-gray-700";
534
+ readonly inputBorder: "border-gray-500";
535
+ readonly inputText: "text-[#f5f5f5]";
536
+ readonly progressBg: "bg-gray-700";
537
+ readonly progressStripe1: "#374151";
538
+ readonly progressStripe2: "#4B5563";
539
+ readonly dotActive: "#fff";
540
+ readonly dotInactive: "rgba(255,255,255,0.3)";
541
+ readonly toastTheme: "dark";
542
+ };
543
+
492
544
  declare function Text_2({ content, buttonText, className, containerClass, next, animate, allowedKeys, }: {
493
545
  content: default_2.ReactNode;
494
546
  buttonText?: string;
@@ -500,6 +552,63 @@ declare function Text_2({ content, buttonText, className, containerClass, next,
500
552
  } & BaseComponentProps): JSX_2.Element;
501
553
  export { Text_2 as Text }
502
554
 
555
+ export declare const THEME: {
556
+ readonly light: {
557
+ readonly containerBg: "";
558
+ readonly text: "text-black";
559
+ readonly prose: "prose-slate";
560
+ readonly proseLink: "prose-a:text-blue-600";
561
+ readonly buttonBg: "bg-white";
562
+ readonly buttonText: "text-black";
563
+ readonly buttonBorder: "border-black";
564
+ readonly buttonShadow: "shadow-[2px_2px_0px_rgba(0,0,0,1)]";
565
+ readonly buttonDisabledBg: "bg-gray-200";
566
+ readonly buttonDisabledText: "text-gray-400";
567
+ readonly buttonDisabledBorder: "border-gray-400";
568
+ readonly buttonDisabledShadow: "shadow-[2px_2px_0px_rgba(156,163,175,1)]";
569
+ readonly error: "text-red-500";
570
+ readonly focusRing: "focus:ring-blue-500";
571
+ readonly inputBg: "";
572
+ readonly inputBorder: "border-black";
573
+ readonly inputText: "";
574
+ readonly progressBg: "bg-gray-200";
575
+ readonly progressStripe1: "#E5E7EB";
576
+ readonly progressStripe2: "#D1D5DB";
577
+ readonly dotActive: "#000";
578
+ readonly dotInactive: "rgba(0,0,0,0.2)";
579
+ readonly toastTheme: "light";
580
+ };
581
+ readonly dark: {
582
+ readonly containerBg: "bg-[#1a1a2e]";
583
+ readonly text: "text-[#f5f5f5]";
584
+ readonly prose: "prose-invert";
585
+ readonly proseLink: "prose-a:text-blue-400";
586
+ readonly buttonBg: "bg-white";
587
+ readonly buttonText: "text-black";
588
+ readonly buttonBorder: "border-black";
589
+ readonly buttonShadow: "shadow-[2px_2px_0px_rgba(0,0,0,1)]";
590
+ readonly buttonDisabledBg: "bg-gray-700";
591
+ readonly buttonDisabledText: "text-gray-500";
592
+ readonly buttonDisabledBorder: "border-gray-600";
593
+ readonly buttonDisabledShadow: "shadow-[2px_2px_0px_rgba(75,85,99,1)]";
594
+ readonly error: "text-red-400";
595
+ readonly focusRing: "focus:ring-blue-400";
596
+ readonly inputBg: "bg-gray-700";
597
+ readonly inputBorder: "border-gray-500";
598
+ readonly inputText: "text-[#f5f5f5]";
599
+ readonly progressBg: "bg-gray-700";
600
+ readonly progressStripe1: "#374151";
601
+ readonly progressStripe2: "#4B5563";
602
+ readonly dotActive: "#fff";
603
+ readonly dotInactive: "rgba(255,255,255,0.3)";
604
+ readonly toastTheme: "dark";
605
+ };
606
+ };
607
+
608
+ export declare type Theme = 'light' | 'dark';
609
+
610
+ export declare const ThemeContext: Context<Theme>;
611
+
503
612
  declare type TimelineItem = ControlFlowItem | any;
504
613
 
505
614
  export declare interface TrialData {
@@ -568,6 +677,8 @@ export declare function Upload({ data, next, store, sessionID, generateFiles, se
568
677
  errorContent?: default_2.ReactNode;
569
678
  }): JSX_2.Element;
570
679
 
680
+ export declare const useTheme: () => Theme;
681
+
571
682
  /**
572
683
  * Hook for interactive slide components.
573
684
  * Call with `{ locked: true }` to start with the next button disabled.
@@ -1,10 +1,10 @@
1
- import { H as e, C as t, a as i, c as r, d as n, e as o, f as l, Y as m, z as u, M as c, P as p, g as P, h as g, Q as d, R as C, i as D, j as T, F as x, T as h, k, l as E, U as F, X as S, m as f, n as v, o as B, p as R, q as b, r as y, s as I, t as M, u as U, v as w, w as K, x as q, y as A, A as Q, B as Z, D as j, G as z, I as G, J as H, K as J, L, N, O, S as V, V as X, Z as Y, _, $, a0 as W, a1 as aa, a2 as sa, a3 as ea, a4 as ta, a5 as ia, a6 as ra, a7 as na, a8 as oa, a9 as la, aa as ma, ab as ua } from "./mod-pa8Hci6M.js";
1
+ import { H as e, C as t, a as i, c as n, d as r, e as o, f as l, Y as m, z as u, M as c, P as p, g as P, h as g, Q as T, R as d, i as C, j as h, F as x, T as D, k as E, l as f, m as k, n as F, U as S, X as v, o as B, p as M, q as R, r as b, s as y, t as I, u as U, v as w, w as K, x as q, y as A, A as H, B as Q, D as Z, G as j, I as z, J as G, K as J, L, N, O, S as V, V as X, Z as Y, _, $, a0 as W, a1 as aa, a2 as sa, a3 as ea, a4 as ta, a5 as ia, a6 as na, a7 as ra, a8 as oa, a9 as la, aa as ma, ab as ua, ac as ca, ad as pa, ae as Pa, af as ga } from "./mod-DExpgO5y.js";
2
2
  export {
3
3
  e as Bounce,
4
4
  t as CanvasBlock,
5
5
  i as CheckDevice,
6
- r as EnterFullscreen,
7
- n as ExitFullscreen,
6
+ n as EnterFullscreen,
7
+ r as ExitFullscreen,
8
8
  o as ExperimentProvider,
9
9
  l as ExperimentRunner,
10
10
  m as Flip,
@@ -13,54 +13,58 @@ export {
13
13
  p as Param,
14
14
  P as PlainInput,
15
15
  g as ProlificEnding,
16
- d as Quest,
17
- C as RDKCanvas,
18
- D as RandomDotKinematogram,
19
- T as RequestFilePermission,
16
+ T as Quest,
17
+ d as RDKCanvas,
18
+ C as RandomDotKinematogram,
19
+ h as RequestFilePermission,
20
20
  x as Slide,
21
- h as Text,
21
+ D as THEME,
22
+ E as Text,
23
+ f as ThemeContext,
22
24
  k as ToastContainer,
23
- E as Tutorial,
24
- F as Upload,
25
- S as Zoom,
26
- f as arrayFlattener,
27
- v as canvasCountdown,
28
- B as chunk,
29
- R as collapseToast,
30
- b as cssTransition,
31
- y as getBackendUrl,
32
- I as getInitialParticipant,
33
- M as getParam,
34
- U as getPlatform,
35
- w as getSimulation,
36
- K as halton,
37
- q as isDesktop,
38
- A as isFullscreen,
39
- Q as mapDDMChoice,
40
- Z as noopSimulate,
41
- j as normal,
42
- z as now,
43
- G as orchestrateSimulation,
44
- H as pipe,
45
- J as poisson,
46
- L as registerArrayExtensions,
47
- N as registerComponentParams,
48
- O as registerExperimentParams,
49
- V as registerFlattener,
50
- X as registerSimulation,
51
- Y as resolveSimulation,
52
- _ as sample,
53
- $ as sampleParticipants,
54
- W as seedDistributions,
55
- aa as setBackendUrl,
56
- sa as shuffle,
57
- ea as simulateDDMTrial,
58
- ta as simulateParticipant,
59
- ia as sobol,
60
- ra as subsetExperimentByParam,
61
- na as toast,
62
- oa as uniform,
63
- la as useToast,
64
- ma as useToastContainer,
65
- ua as useTutorialSlide
25
+ F as Tutorial,
26
+ S as Upload,
27
+ v as Zoom,
28
+ B as arrayFlattener,
29
+ M as canvasCountdown,
30
+ R as chunk,
31
+ b as collapseToast,
32
+ y as cssTransition,
33
+ I as getBackendUrl,
34
+ U as getInitialParticipant,
35
+ w as getParam,
36
+ K as getPlatform,
37
+ q as getSimulation,
38
+ A as halton,
39
+ H as isDesktop,
40
+ Q as isFullscreen,
41
+ Z as mapDDMChoice,
42
+ j as noopSimulate,
43
+ z as normal,
44
+ G as now,
45
+ J as orchestrateSimulation,
46
+ L as pipe,
47
+ N as poisson,
48
+ O as registerArrayExtensions,
49
+ V as registerComponentParams,
50
+ X as registerExperimentParams,
51
+ Y as registerFlattener,
52
+ _ as registerSimulation,
53
+ $ as resolveSimulation,
54
+ W as sample,
55
+ aa as sampleParticipants,
56
+ sa as seedDistributions,
57
+ ea as setBackendUrl,
58
+ ta as shuffle,
59
+ ia as simulateDDMTrial,
60
+ na as simulateParticipant,
61
+ ra as sobol,
62
+ oa as subsetExperimentByParam,
63
+ la as t,
64
+ ma as toast,
65
+ ua as uniform,
66
+ ca as useTheme,
67
+ pa as useToast,
68
+ Pa as useToastContainer,
69
+ ga as useTutorialSlide
66
70
  };