@nice2dev/ui-printing 1.1.5 → 1.1.7

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.
@@ -21,39 +21,91 @@
21
21
  border: none;
22
22
  cursor: pointer;
23
23
  font-weight: 500;
24
- transition: background 0.15s, opacity 0.15s;
24
+ transition:
25
+ background 0.15s,
26
+ opacity 0.15s;
25
27
  white-space: nowrap;
26
28
  }
27
- .triggerDisabled { opacity: 0.5; cursor: not-allowed; }
29
+ .triggerDisabled {
30
+ opacity: 0.5;
31
+ cursor: not-allowed;
32
+ }
28
33
 
29
34
  /* Variants */
30
- .variant-primary { background: var(--nice-primary-hover, #2563eb); color: var(--nice-bg, #FFF); }
31
- .variant-primary:not(.triggerDisabled):hover { background: var(--nice-primary-dark, #1d4ed8); }
32
- .variant-secondary { background: var(--nice-bg-secondary, #f8fafc); color: var(--nice-text, #1e293b); border: 1px solid var(--nice-border, #e2e8f0); }
33
- .variant-secondary:not(.triggerDisabled):hover { background: var(--nice-border, #e2e8f0); }
34
- .variant-ghost { background: transparent; color: var(--nice-primary-hover, #2563eb); }
35
- .variant-ghost:not(.triggerDisabled):hover { background: var(--nice-primary-bg, #eff6ff); }
35
+ .variant-primary {
36
+ background: var(--nice-primary-hover, #2563eb);
37
+ color: var(--nice-bg, #fff);
38
+ }
39
+ .variant-primary:not(.triggerDisabled):hover {
40
+ background: var(--nice-primary-dark, #1d4ed8);
41
+ }
42
+ .variant-secondary {
43
+ background: var(--nice-bg-secondary, #f8fafc);
44
+ color: var(--nice-text, #1e293b);
45
+ border: 1px solid var(--nice-border, #e2e8f0);
46
+ }
47
+ .variant-secondary:not(.triggerDisabled):hover {
48
+ background: var(--nice-border, #e2e8f0);
49
+ }
50
+ .variant-ghost {
51
+ background: transparent;
52
+ color: var(--nice-primary-hover, #2563eb);
53
+ }
54
+ .variant-ghost:not(.triggerDisabled):hover {
55
+ background: var(--nice-primary-bg, #eff6ff);
56
+ }
36
57
 
37
58
  /* Sizes */
38
- .size-sm { padding: var(--nice-space-1-25, 5px) var(--nice-space-2-5, 10px); font-size: 12px; border-radius: var(--nice-radius-md, 6px) 0 0 var(--nice-radius-md, 6px); }
39
- .size-md { padding: var(--nice-space-2, 8px) var(--nice-space-3-5, 14px); font-size: 14px; border-radius: var(--nice-radius-lg, 8px) 0 0 var(--nice-radius-lg, 8px); }
40
- .size-lg { padding: var(--nice-space-2-5, 10px) 18px; font-size: 15px; border-radius: var(--nice-radius-lg, 10px) 0 0 var(--nice-radius-lg, 10px); }
59
+ .size-sm {
60
+ padding: var(--nice-space-1-25, 5px) var(--nice-space-2-5, 10px);
61
+ font-size: 12px;
62
+ border-radius: var(--nice-radius-md, 6px) 0 0 var(--nice-radius-md, 6px);
63
+ }
64
+ .size-md {
65
+ padding: var(--nice-space-2, 8px) var(--nice-space-3-5, 14px);
66
+ font-size: 14px;
67
+ border-radius: var(--nice-radius-lg, 8px) 0 0 var(--nice-radius-lg, 8px);
68
+ }
69
+ .size-lg {
70
+ padding: var(--nice-space-2-5, 10px) 18px;
71
+ font-size: 15px;
72
+ border-radius: var(--nice-radius-lg, 10px) 0 0 var(--nice-radius-lg, 10px);
73
+ }
41
74
 
42
75
  /* Main action part */
43
- .mainAction { flex: 1; border-right: 1px solid var(--nice-overlay-light-20, rgba(255, 255, 255, 0.2)); }
44
- .variant-secondary .mainAction { border-right-color: var(--nice-border, #e2e8f0); }
45
- .variant-ghost .mainAction { border-right-color: var(--nice-primary-bg, #dbeafe); }
76
+ .mainAction {
77
+ flex: 1;
78
+ border-right: 1px solid var(--nice-overlay-light-20, rgba(255, 255, 255, 0.2));
79
+ }
80
+ .variant-secondary .mainAction {
81
+ border-right-color: var(--nice-border, #e2e8f0);
82
+ }
83
+ .variant-ghost .mainAction {
84
+ border-right-color: var(--nice-primary-bg, #dbeafe);
85
+ }
46
86
 
47
87
  /* Dropdown toggle */
48
88
  .dropdownToggle {
49
89
  padding: 0 var(--nice-space-2, 8px) !important;
50
90
  }
51
- .size-sm.dropdownToggle { border-radius: 0 var(--nice-radius-md, 6px) var(--nice-radius-md, 6px) 0; }
52
- .size-md.dropdownToggle { border-radius: 0 var(--nice-radius-lg, 8px) var(--nice-radius-lg, 8px) 0; }
53
- .size-lg.dropdownToggle { border-radius: 0 var(--nice-radius-lg, 10px) var(--nice-radius-lg, 10px) 0; }
91
+ .size-sm.dropdownToggle {
92
+ border-radius: 0 var(--nice-radius-md, 6px) var(--nice-radius-md, 6px) 0;
93
+ }
94
+ .size-md.dropdownToggle {
95
+ border-radius: 0 var(--nice-radius-lg, 8px) var(--nice-radius-lg, 8px) 0;
96
+ }
97
+ .size-lg.dropdownToggle {
98
+ border-radius: 0 var(--nice-radius-lg, 10px) var(--nice-radius-lg, 10px) 0;
99
+ }
54
100
 
55
- .chevron { display: inline-block; transition: transform 0.2s; font-size: 12px; }
56
- .chevronUp { transform: scaleY(-1); }
101
+ .chevron {
102
+ display: inline-block;
103
+ transition: transform 0.2s;
104
+ font-size: 12px;
105
+ }
106
+ .chevronUp {
107
+ transform: scaleY(-1);
108
+ }
57
109
 
58
110
  /* Dropdown panel */
59
111
  .dropdown {
@@ -61,16 +113,22 @@
61
113
  top: calc(100% + 6px);
62
114
  right: 0;
63
115
  min-width: 220px;
64
- background: var(--nice-bg, #FFF);
116
+ background: var(--nice-bg, #fff);
65
117
  border: 1px solid var(--nice-border, #e2e8f0);
66
118
  border-radius: var(--nice-radius-lg, 10px);
67
119
  box-shadow: 0 8px 32px var(--nice-overlay-12, rgba(0, 0, 0, 0.12));
68
120
  z-index: 1000;
69
121
  overflow: hidden;
70
122
  }
71
- .dark .dropdown { background: var(--nice-text, #1e293b); border-color: var(--nice-text, #334155); box-shadow: 0 8px 32px var(--nice-overlay-50, rgba(0, 0, 0, 0.5)); }
123
+ .dark .dropdown {
124
+ background: var(--nice-text, #1e293b);
125
+ border-color: var(--nice-text, #334155);
126
+ box-shadow: 0 8px 32px var(--nice-overlay-50, rgba(0, 0, 0, 0.5));
127
+ }
72
128
 
73
- .section { padding: var(--nice-space-3, 12px) var(--nice-space-3-5, 14px); }
129
+ .section {
130
+ padding: var(--nice-space-3, 12px) var(--nice-space-3-5, 14px);
131
+ }
74
132
  .sectionLabel {
75
133
  display: block;
76
134
  font-size: 11px;
@@ -81,8 +139,13 @@
81
139
  margin-bottom: var(--nice-space-2, 8px);
82
140
  }
83
141
 
84
- .divider { height: 1px; background: var(--nice-bg-secondary, #f1f5f9); }
85
- .dark .divider { background: var(--nice-text, #334155); }
142
+ .divider {
143
+ height: 1px;
144
+ background: var(--nice-bg-secondary, #f1f5f9);
145
+ }
146
+ .dark .divider {
147
+ background: var(--nice-text, #334155);
148
+ }
86
149
 
87
150
  /* Copies row */
88
151
  .copiesRow {
@@ -91,8 +154,11 @@
91
154
  gap: var(--nice-space-2-5, 10px);
92
155
  }
93
156
  .copiesBtn {
94
- width: 30px; height: 30px;
95
- display: flex; align-items: center; justify-content: center;
157
+ width: 30px;
158
+ height: 30px;
159
+ display: flex;
160
+ align-items: center;
161
+ justify-content: center;
96
162
  background: var(--nice-bg-secondary, #f8fafc);
97
163
  border: 1px solid var(--nice-border, #e2e8f0);
98
164
  border-radius: var(--nice-radius-md, 6px);
@@ -100,8 +166,13 @@
100
166
  font-size: 16px;
101
167
  color: var(--nice-text-secondary, #475569);
102
168
  }
103
- .copiesBtn:disabled { opacity: 0.4; cursor: default; }
104
- .copiesBtn:not(:disabled):hover { background: var(--nice-border, #e2e8f0); }
169
+ .copiesBtn:disabled {
170
+ opacity: 0.4;
171
+ cursor: default;
172
+ }
173
+ .copiesBtn:not(:disabled):hover {
174
+ background: var(--nice-border, #e2e8f0);
175
+ }
105
176
  .copiesValue {
106
177
  flex: 1;
107
178
  text-align: center;
@@ -109,7 +180,9 @@
109
180
  font-weight: 600;
110
181
  color: var(--nice-text, #1e293b);
111
182
  }
112
- .dark .copiesValue { color: var(--nice-bg-secondary, #f1f5f9); }
183
+ .dark .copiesValue {
184
+ color: var(--nice-bg-secondary, #f1f5f9);
185
+ }
113
186
 
114
187
  /* Printer select */
115
188
  .printerSelect {
@@ -122,8 +195,15 @@
122
195
  color: var(--nice-text, #1e293b);
123
196
  cursor: pointer;
124
197
  }
125
- .dark .printerSelect { background: var(--nice-text, #0f172a); border-color: var(--nice-text, #334155); color: var(--nice-bg-secondary, #f1f5f9); }
126
- .printerSelect:focus { outline: none; border-color: var(--nice-primary-hover, #2563eb); }
198
+ .dark .printerSelect {
199
+ background: var(--nice-text, #0f172a);
200
+ border-color: var(--nice-text, #334155);
201
+ color: var(--nice-bg-secondary, #f1f5f9);
202
+ }
203
+ .printerSelect:focus {
204
+ outline: none;
205
+ border-color: var(--nice-primary-hover, #2563eb);
206
+ }
127
207
 
128
208
  .printerStatus {
129
209
  display: flex;
@@ -132,19 +212,33 @@
132
212
  margin-top: var(--nice-space-1-5, 6px);
133
213
  font-size: 12px;
134
214
  }
135
- .printerDot { width: 7px; height: 7px; border-radius: var(--nice-radius-full, 50%); }
136
- .dot-ready { background: var(--nice-success-dark, #16a34a); }
137
- .dot-busy { background: var(--nice-warning, #f59e0b); }
138
- .dot-offline { background: var(--nice-text-muted, #94a3b8); }
139
- .dot-error { background: var(--nice-danger-dark, #dc2626); }
140
- .printerStatusLabel { color: var(--nice-text-secondary, #64748b); }
215
+ .printerDot {
216
+ width: 7px;
217
+ height: 7px;
218
+ border-radius: var(--nice-radius-full, 50%);
219
+ }
220
+ .dot-ready {
221
+ background: var(--nice-success-dark, #16a34a);
222
+ }
223
+ .dot-busy {
224
+ background: var(--nice-warning, #f59e0b);
225
+ }
226
+ .dot-offline {
227
+ background: var(--nice-text-muted, #94a3b8);
228
+ }
229
+ .dot-error {
230
+ background: var(--nice-danger-dark, #dc2626);
231
+ }
232
+ .printerStatusLabel {
233
+ color: var(--nice-text-secondary, #64748b);
234
+ }
141
235
 
142
236
  /* Submit button */
143
237
  .submitBtn {
144
238
  width: 100%;
145
239
  padding: 9px var(--nice-space-3-5, 14px);
146
240
  background: var(--nice-primary-hover, #2563eb);
147
- color: var(--nice-bg, #FFF);
241
+ color: var(--nice-bg, #fff);
148
242
  border: none;
149
243
  border-radius: var(--nice-radius-lg, 8px);
150
244
  cursor: pointer;
@@ -152,16 +246,26 @@
152
246
  font-weight: 600;
153
247
  text-align: center;
154
248
  }
155
- .submitBtn:hover:not(:disabled) { background: var(--nice-primary-dark, #1d4ed8); }
156
- .submitBtn:disabled { opacity: 0.5; cursor: not-allowed; }
249
+ .submitBtn:hover:not(:disabled) {
250
+ background: var(--nice-primary-dark, #1d4ed8);
251
+ }
252
+ .submitBtn:disabled {
253
+ opacity: 0.5;
254
+ cursor: not-allowed;
255
+ }
157
256
 
158
257
  /* Spinner */
159
258
  .spinner {
160
259
  display: inline-block;
161
- width: 14px; height: 14px;
260
+ width: 14px;
261
+ height: 14px;
162
262
  border: 2px solid var(--nice-overlay-light-30, rgba(255, 255, 255, 0.3));
163
- border-top-color: var(--nice-bg, #FFF);
263
+ border-top-color: var(--nice-bg, #fff);
164
264
  border-radius: var(--nice-radius-full, 50%);
165
265
  animation: spin 0.7s linear infinite;
166
266
  }
167
- @keyframes spin { to { transform: rotate(360deg); } }
267
+ @keyframes spin {
268
+ to {
269
+ transform: rotate(360deg);
270
+ }
271
+ }
@@ -89,7 +89,7 @@ const RenderedField: React.FC<RenderedFieldProps> = ({ field, data, zoom }) => {
89
89
  fontSize: (field.style.fontSize ?? 10) * zoom,
90
90
  fontWeight: field.style.fontWeight ?? 'normal',
91
91
  fontStyle: field.style.fontStyle ?? 'normal',
92
- color: field.style.color ?? 'var(--text-primary, #0f172a)',
92
+ color: field.style.color ?? 'var(--nice-text-primary, #0f172a)',
93
93
  textAlign: field.style.textAlign ?? 'left',
94
94
  backgroundColor: field.style.backgroundColor,
95
95
  transform: field.style.rotation ? `rotate(${field.style.rotation}deg)` : undefined,
@@ -127,8 +127,8 @@ const RenderedField: React.FC<RenderedFieldProps> = ({ field, data, zoom }) => {
127
127
  <div
128
128
  style={{
129
129
  ...baseStyle,
130
- background: 'var(--bg-secondary, #f8fafc)',
131
- border: '1px dashed var(--border-color, #e2e8f0)',
130
+ background: 'var(--nice-bg-secondary, #f8fafc)',
131
+ border: '1px dashed var(--nice-border-color, #e2e8f0)',
132
132
  alignItems: 'center',
133
133
  justifyContent: 'center',
134
134
  fontSize: 10 * zoom,
@@ -143,11 +143,11 @@ const RenderedField: React.FC<RenderedFieldProps> = ({ field, data, zoom }) => {
143
143
  <div
144
144
  style={{
145
145
  ...baseStyle,
146
- borderBottom: '1px solid var(--text-primary, #0f172a)',
146
+ borderBottom: '1px solid var(--nice-text-primary, #0f172a)',
147
147
  alignItems: 'flex-end',
148
148
  }}
149
149
  >
150
- <span style={{ fontSize: 8 * zoom, color: 'var(--text-muted, #94a3b8)' }}>
150
+ <span style={{ fontSize: 8 * zoom, color: 'var(--nice-text-muted, #94a3b8)' }}>
151
151
  {field.label}
152
152
  </span>
153
153
  </div>
@@ -158,7 +158,7 @@ const RenderedField: React.FC<RenderedFieldProps> = ({ field, data, zoom }) => {
158
158
  <div
159
159
  style={{
160
160
  ...baseStyle,
161
- borderBottom: `${field.style.borderWidth ?? 1}px ${field.style.borderStyle ?? 'solid'} ${field.style.borderColor ?? 'var(--text-primary, #0f172a)'}`,
161
+ borderBottom: `${field.style.borderWidth ?? 1}px ${field.style.borderStyle ?? 'solid'} ${field.style.borderColor ?? 'var(--nice-text-primary, #0f172a)'}`,
162
162
  }}
163
163
  />
164
164
  );
@@ -382,7 +382,7 @@ export const NicePrintPreview: React.FC<NicePrintPreviewProps> = ({
382
382
  style={{
383
383
  position: 'fixed',
384
384
  inset: 0,
385
- background: 'color-mix(in srgb, var(--text-primary, #000) 50%, transparent)',
385
+ background: 'color-mix(in srgb, var(--nice-text-primary, #000) 50%, transparent)',
386
386
  display: 'flex',
387
387
  alignItems: 'center',
388
388
  justifyContent: 'center',
@@ -400,9 +400,10 @@ export const NicePrintPreview: React.FC<NicePrintPreviewProps> = ({
400
400
  role="dialog"
401
401
  aria-modal="true"
402
402
  style={{
403
- background: 'var(--bg-elevated, var(--bg-primary, #ffffff))',
403
+ background: 'var(--nice-bg-elevated, var(--nice-bg-primary, #ffffff))',
404
404
  borderRadius: 12,
405
- boxShadow: '0 20px 60px color-mix(in srgb, var(--text-primary, #000) 30%, transparent)',
405
+ boxShadow:
406
+ '0 20px 60px color-mix(in srgb, var(--nice-text-primary, #000) 30%, transparent)',
406
407
  maxWidth: '90vw',
407
408
  maxHeight: '90vh',
408
409
  overflow: 'auto',
@@ -7,7 +7,10 @@
7
7
  font-size: 14px;
8
8
  color: var(--nice-text, #1e293b);
9
9
  }
10
- .dark { background: var(--nice-text, #1e293b); color: var(--nice-bg-secondary, #f1f5f9); }
10
+ .dark {
11
+ background: var(--nice-text, #1e293b);
12
+ color: var(--nice-bg-secondary, #f1f5f9);
13
+ }
11
14
 
12
15
  /* Header bar */
13
16
  .headerBar {
@@ -15,13 +18,20 @@
15
18
  align-items: center;
16
19
  gap: var(--nice-space-3, 12px);
17
20
  padding: var(--nice-space-2, 8px) var(--nice-space-4, 16px);
18
- background: var(--nice-bg, #FFF);
21
+ background: var(--nice-bg, #fff);
19
22
  border-bottom: 1px solid var(--nice-border, #e2e8f0);
20
23
  flex-shrink: 0;
21
24
  }
22
- .dark .headerBar { background: var(--nice-text, #0f172a); border-color: var(--nice-text, #334155); }
25
+ .dark .headerBar {
26
+ background: var(--nice-text, #0f172a);
27
+ border-color: var(--nice-text, #334155);
28
+ }
23
29
 
24
- .entityNav { display: flex; align-items: center; gap: var(--nice-space-1-5, 6px); }
30
+ .entityNav {
31
+ display: flex;
32
+ align-items: center;
33
+ gap: var(--nice-space-1-5, 6px);
34
+ }
25
35
  .navBtn {
26
36
  padding: var(--nice-space-1, 4px) var(--nice-space-2, 8px);
27
37
  background: var(--nice-bg-secondary, #f8fafc);
@@ -32,9 +42,19 @@
32
42
  line-height: 1;
33
43
  color: var(--nice-text-secondary, #475569);
34
44
  }
35
- .navBtn:disabled { opacity: 0.4; cursor: default; }
36
- .navBtn:not(:disabled):hover { background: var(--nice-border, #e2e8f0); }
37
- .navLabel { color: var(--nice-text-secondary, #64748b); font-size: 13px; min-width: 48px; text-align: center; }
45
+ .navBtn:disabled {
46
+ opacity: 0.4;
47
+ cursor: default;
48
+ }
49
+ .navBtn:not(:disabled):hover {
50
+ background: var(--nice-border, #e2e8f0);
51
+ }
52
+ .navLabel {
53
+ color: var(--nice-text-secondary, #64748b);
54
+ font-size: 13px;
55
+ min-width: 48px;
56
+ text-align: center;
57
+ }
38
58
 
39
59
  .sampleBadge {
40
60
  padding: var(--nice-space-0-75, 3px) var(--nice-space-2-5, 10px);
@@ -45,10 +65,18 @@
45
65
  color: var(--nice-warning-dark, #854d0e);
46
66
  }
47
67
 
48
- .zoomBar { display: flex; align-items: center; gap: var(--nice-space-1-5, 6px); margin-left: auto; }
68
+ .zoomBar {
69
+ display: flex;
70
+ align-items: center;
71
+ gap: var(--nice-space-1-5, 6px);
72
+ margin-left: auto;
73
+ }
49
74
  .zoomBtn {
50
- width: 28px; height: 28px;
51
- display: flex; align-items: center; justify-content: center;
75
+ width: 28px;
76
+ height: 28px;
77
+ display: flex;
78
+ align-items: center;
79
+ justify-content: center;
52
80
  background: var(--nice-bg-secondary, #f8fafc);
53
81
  border: 1px solid var(--nice-border, #e2e8f0);
54
82
  border-radius: var(--nice-radius-sm, 4px);
@@ -56,20 +84,29 @@
56
84
  font-size: 15px;
57
85
  color: var(--nice-text-secondary, #475569);
58
86
  }
59
- .zoomBtn:hover { background: var(--nice-border, #e2e8f0); }
60
- .zoomLabel { font-size: 13px; min-width: 42px; text-align: center; color: var(--nice-text-secondary, #64748b); }
87
+ .zoomBtn:hover {
88
+ background: var(--nice-border, #e2e8f0);
89
+ }
90
+ .zoomLabel {
91
+ font-size: 13px;
92
+ min-width: 42px;
93
+ text-align: center;
94
+ color: var(--nice-text-secondary, #64748b);
95
+ }
61
96
 
62
97
  .printBtn {
63
98
  padding: var(--nice-space-1-5, 6px) var(--nice-space-4, 16px);
64
99
  background: var(--nice-primary-hover, #2563eb);
65
- color: var(--nice-bg, #FFF);
100
+ color: var(--nice-bg, #fff);
66
101
  border: none;
67
102
  border-radius: var(--nice-radius-md, 6px);
68
103
  cursor: pointer;
69
104
  font-size: 13px;
70
105
  font-weight: 500;
71
106
  }
72
- .printBtn:hover { background: var(--nice-primary-dark, #1d4ed8); }
107
+ .printBtn:hover {
108
+ background: var(--nice-primary-dark, #1d4ed8);
109
+ }
73
110
 
74
111
  /* Canvas area */
75
112
  .canvas {
@@ -84,13 +121,15 @@
84
121
  /* Page paper */
85
122
  .page {
86
123
  position: relative;
87
- background: var(--nice-bg, #FFF);
124
+ background: var(--nice-bg, #fff);
88
125
  box-shadow: 0 4px 32px var(--nice-overlay-20, rgba(0, 0, 0, 0.18));
89
126
  border-radius: var(--nice-radius-sm, 2px);
90
127
  overflow: hidden;
91
128
  flex-shrink: 0;
92
129
  }
93
- .dark .page { box-shadow: 0 4px 32px var(--nice-overlay-60, rgba(0, 0, 0, 0.6)); }
130
+ .dark .page {
131
+ box-shadow: 0 4px 32px var(--nice-overlay-60, rgba(0, 0, 0, 0.6));
132
+ }
94
133
 
95
134
  /* Watermark */
96
135
  .watermark {
@@ -113,10 +152,13 @@
113
152
  align-items: center;
114
153
  gap: var(--nice-space-4, 16px);
115
154
  padding: var(--nice-space-1-5, 6px) var(--nice-space-4, 16px);
116
- background: var(--nice-bg, #FFF);
155
+ background: var(--nice-bg, #fff);
117
156
  border-top: 1px solid var(--nice-border, #e2e8f0);
118
157
  font-size: 12px;
119
158
  color: var(--nice-text-muted, #94a3b8);
120
159
  flex-shrink: 0;
121
160
  }
122
- .dark .footerBar { background: var(--nice-text, #0f172a); border-color: var(--nice-text, #334155); }
161
+ .dark .footerBar {
162
+ background: var(--nice-text, #0f172a);
163
+ border-color: var(--nice-text, #334155);
164
+ }