@papyrus-sdk/ui-react 0.2.7 → 0.2.8

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/README.md CHANGED
@@ -47,6 +47,21 @@ Use `@papyrus-sdk/core` + engines and build your own UI.
47
47
 
48
48
  Note: `@papyrus-sdk/ui-react` expects `@papyrus-sdk/core` and `@papyrus-sdk/types` as peer dependencies.
49
49
 
50
+ ## Theme variables
51
+
52
+ You can override UI colors using CSS variables applied to elements with the
53
+ `papyrus-theme` class (they also respond to `data-papyrus-theme="light|dark"`).
54
+
55
+ ```ts
56
+ const root = document.documentElement;
57
+ root.style.setProperty('--papyrus-surface', '#1b2b3a');
58
+ root.style.setProperty('--papyrus-surface-2', '#223243');
59
+ root.style.setProperty('--papyrus-border', '#2f4256');
60
+ root.style.setProperty('--papyrus-text', '#e6edf3');
61
+ root.style.setProperty('--papyrus-text-muted', '#9fb0c2');
62
+ root.style.setProperty('--papyrus-canvas', '#0f172a');
63
+ ```
64
+
50
65
  ## Topbar customization
51
66
 
52
67
  `Topbar` accepts optional flags to show/hide controls.
package/base.css CHANGED
@@ -1,57 +1,90 @@
1
+ .papyrus-theme {
2
+ --papyrus-bg: #f3f4f6;
3
+ --papyrus-surface: #ffffff;
4
+ --papyrus-surface-2: #f9fafb;
5
+ --papyrus-border: #e5e7eb;
6
+ --papyrus-border-strong: #d1d5db;
7
+ --papyrus-text: #111827;
8
+ --papyrus-text-muted: #6b7280;
9
+ --papyrus-icon: #6b7280;
10
+ --papyrus-focus: #93c5fd;
11
+ --papyrus-canvas: #f3f4f6;
12
+ --papyrus-hover: #e5e7eb;
13
+ --papyrus-popover: #ffffff;
14
+ --papyrus-shadow: rgba(15, 23, 42, 0.08);
15
+ color: var(--papyrus-text);
16
+ font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
17
+ }
18
+
19
+ .papyrus-theme[data-papyrus-theme="dark"] {
20
+ --papyrus-bg: #0f1115;
21
+ --papyrus-surface: #1a1a1a;
22
+ --papyrus-surface-2: #222222;
23
+ --papyrus-border: #333333;
24
+ --papyrus-border-strong: #444444;
25
+ --papyrus-text: #f3f4f6;
26
+ --papyrus-text-muted: #9ca3af;
27
+ --papyrus-icon: #9ca3af;
28
+ --papyrus-focus: #2563eb;
29
+ --papyrus-canvas: #121212;
30
+ --papyrus-hover: rgba(255, 255, 255, 0.08);
31
+ --papyrus-popover: #1f1f1f;
32
+ --papyrus-shadow: rgba(0, 0, 0, 0.4);
33
+ }
34
+
35
+ .papyrus-topbar,
36
+ .papyrus-sidebar-left,
37
+ .papyrus-sidebar-right {
38
+ background: var(--papyrus-surface) !important;
39
+ border-color: var(--papyrus-border) !important;
40
+ color: var(--papyrus-text) !important;
41
+ box-sizing: border-box;
42
+ font-size: 13px;
43
+ line-height: 1.4;
44
+ }
45
+
1
46
  .papyrus-topbar {
2
47
  align-items: center;
3
- background: #ffffff;
4
- border-bottom: 1px solid #e5e7eb;
5
- box-sizing: border-box;
6
- color: #111827;
7
48
  display: flex;
8
49
  height: 56px;
9
50
  justify-content: space-between;
10
51
  padding: 0 16px;
11
- font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
12
52
  font-size: 14px;
13
- line-height: 1.4;
14
- }
15
-
16
- .papyrus-sidebar-left {
17
- background: #ffffff;
18
- border-right: 1px solid #e5e7eb;
19
- box-sizing: border-box;
20
- display: flex;
21
- flex-direction: column;
22
- height: 100%;
23
- width: 288px;
24
- font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
25
- font-size: 13px;
26
- line-height: 1.4;
27
53
  }
28
54
 
55
+ .papyrus-sidebar-left,
29
56
  .papyrus-sidebar-right {
30
- background: #ffffff;
31
- border-left: 1px solid #e5e7eb;
32
- box-sizing: border-box;
33
57
  display: flex;
34
58
  flex-direction: column;
35
59
  height: 100%;
36
- width: 320px;
37
- font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
38
- font-size: 13px;
39
- line-height: 1.4;
40
60
  }
41
61
 
42
62
  .papyrus-viewer {
43
- background: #f3f4f6;
63
+ background: var(--papyrus-canvas) !important;
44
64
  box-sizing: border-box;
45
65
  flex: 1 1 auto;
46
66
  overflow: auto;
47
- font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
67
+ color: var(--papyrus-text);
68
+ }
69
+
70
+ .papyrus-control,
71
+ .papyrus-input,
72
+ .papyrus-popover {
73
+ background: var(--papyrus-surface-2) !important;
74
+ border-color: var(--papyrus-border) !important;
75
+ color: var(--papyrus-text) !important;
76
+ }
77
+
78
+ .papyrus-popover {
79
+ background: var(--papyrus-popover) !important;
80
+ box-shadow: 0 20px 40px var(--papyrus-shadow);
48
81
  }
49
82
 
50
83
  .papyrus-topbar button,
51
84
  .papyrus-sidebar-left button,
52
85
  .papyrus-sidebar-right button {
53
- background: #f3f4f6;
54
- border: 1px solid #e5e7eb;
86
+ background: var(--papyrus-surface-2);
87
+ border: 1px solid var(--papyrus-border);
55
88
  border-radius: 8px;
56
89
  color: inherit;
57
90
  cursor: pointer;
@@ -66,11 +99,11 @@
66
99
  .papyrus-topbar select,
67
100
  .papyrus-sidebar-left select,
68
101
  .papyrus-sidebar-right select {
69
- background: #ffffff;
70
- border: 1px solid #e5e7eb;
102
+ background: var(--papyrus-surface);
103
+ border: 1px solid var(--papyrus-border);
71
104
  border-radius: 6px;
72
105
  box-sizing: border-box;
73
- color: #111827;
106
+ color: var(--papyrus-text);
74
107
  font: inherit;
75
108
  padding: 6px 8px;
76
109
  }
@@ -78,8 +111,8 @@
78
111
  .papyrus-topbar button:hover,
79
112
  .papyrus-sidebar-left button:hover,
80
113
  .papyrus-sidebar-right button:hover {
81
- background: #e5e7eb;
82
- border-color: #d1d5db;
114
+ background: var(--papyrus-hover);
115
+ border-color: var(--papyrus-border-strong);
83
116
  }
84
117
 
85
118
  .papyrus-topbar svg,
@@ -94,7 +127,7 @@
94
127
  .papyrus-topbar select:focus,
95
128
  .papyrus-sidebar-left select:focus,
96
129
  .papyrus-sidebar-right select:focus {
97
- outline: 2px solid #93c5fd;
130
+ outline: 2px solid var(--papyrus-focus);
98
131
  outline-offset: 1px;
99
132
  }
100
133
 
@@ -108,6 +141,3 @@
108
141
  display: flex;
109
142
  justify-content: center;
110
143
  }
111
- .papyrus-viewer .page-container {
112
- margin-bottom: 24px;
113
- }