@inkbar/theme 0.7.0 → 0.9.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/theme.css +66 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkbar/theme",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Default stylesheet for Inkbar. Zero specificity, so your CSS wins.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://inkbar.dev",
package/theme.css CHANGED
@@ -17,7 +17,8 @@
17
17
  [data-ink-thread-popover],
18
18
  [data-ink-popover],
19
19
  [data-ink-select-content],
20
- [data-ink-signature-dialog]
20
+ [data-ink-signature-dialog],
21
+ [data-ink-form-alert]
21
22
  ) {
22
23
  --ink-highlight: #f2c230;
23
24
  --ink-underline: #2b5a9e;
@@ -44,6 +45,10 @@
44
45
  --ink-radius: var(--radius, 0.5rem);
45
46
  --ink-page-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
46
47
  --ink-text-selection: color-mix(in srgb, AccentColor, transparent 50%);
48
+ /* Form fields sit on the white page, in light and dark alike. */
49
+ --ink-form-field-bg: rgb(43 90 158 / 0.12);
50
+ --ink-form-field-focus: #2b5a9e;
51
+ --ink-form-field-invalid: #c0392b;
47
52
 
48
53
  color: var(--ink-fg);
49
54
  }
@@ -54,7 +59,8 @@
54
59
  [data-ink-thread-popover]:not(.light *),
55
60
  [data-ink-popover]:not(.light *),
56
61
  [data-ink-select-content]:not(.light *),
57
- [data-ink-signature-dialog]:not(.light *)
62
+ [data-ink-signature-dialog]:not(.light *),
63
+ [data-ink-form-alert]:not(.light *)
58
64
  ) {
59
65
  --ink-bg: var(--muted, #0f1217);
60
66
  --ink-fg: var(--foreground, #e6e9ef);
@@ -65,6 +71,9 @@
65
71
  --ink-accent-fg: var(--primary-foreground, #151820);
66
72
  --ink-ring: var(--ring, #7aa5e6);
67
73
  --ink-page-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
74
+ --ink-form-field-bg: rgb(43 90 158 / 0.16);
75
+ --ink-form-field-focus: #3d73c4;
76
+ --ink-form-field-invalid: #c0392b;
68
77
  }
69
78
  }
70
79
 
@@ -75,7 +84,8 @@
75
84
  .dark [data-ink-thread-popover]:not(.dark .light *),
76
85
  .dark [data-ink-popover]:not(.dark .light *),
77
86
  .dark [data-ink-select-content]:not(.dark .light *),
78
- .dark [data-ink-signature-dialog]:not(.dark .light *)
87
+ .dark [data-ink-signature-dialog]:not(.dark .light *),
88
+ .dark [data-ink-form-alert]:not(.dark .light *)
79
89
  ) {
80
90
  --ink-bg: var(--muted, #0f1217);
81
91
  --ink-fg: var(--foreground, #e6e9ef);
@@ -86,6 +96,9 @@
86
96
  --ink-accent-fg: var(--primary-foreground, #151820);
87
97
  --ink-ring: var(--ring, #7aa5e6);
88
98
  --ink-page-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
99
+ --ink-form-field-bg: rgb(43 90 158 / 0.16);
100
+ --ink-form-field-focus: #3d73c4;
101
+ --ink-form-field-invalid: #c0392b;
89
102
  }
90
103
 
91
104
  /* Layout: root and viewport fill their parent; the scroll area takes the space left over. */
@@ -354,6 +367,49 @@
354
367
  pointer-events: auto;
355
368
  }
356
369
 
370
+ /* Form fields: over the text layer, under the annotations (after the overlay in the page, at
371
+ the same level), so a press on an annotation's shape is the annotation's. A field is
372
+ tinted, except while it is read-only or signed or highlighting is off. It is ringed while
373
+ focused and marked when a value was refused. */
374
+ :where(.ink-form-layer) {
375
+ z-index: 1;
376
+ }
377
+
378
+ :where(.ink-form-control) {
379
+ outline: none;
380
+ box-shadow: inset 0 0 0 100vmax var(--ink-form-field-bg);
381
+ }
382
+
383
+ :where(
384
+ [data-ink-form-highlight='off'] .ink-form-control,
385
+ .ink-form-widget[data-ink-readonly] .ink-form-control
386
+ ) {
387
+ box-shadow: none;
388
+ }
389
+
390
+ /* An empty signature field's "Sign"; a signed one shows its signature, drawn above it. */
391
+ :where(.ink-form-sign) {
392
+ color: var(--ink-form-field-focus);
393
+ font-family: system-ui, sans-serif;
394
+ font-weight: 600;
395
+ cursor: pointer;
396
+ }
397
+
398
+ :where(.ink-form-sign[data-ink-signed]) {
399
+ box-shadow: none;
400
+ cursor: default;
401
+ }
402
+
403
+ :where(.ink-form-widget[data-ink-focused] .ink-form-control) {
404
+ outline: 2px solid var(--ink-form-field-focus);
405
+ outline-offset: 0;
406
+ }
407
+
408
+ :where(.ink-form-widget[data-ink-invalid] .ink-form-control) {
409
+ outline: 2px solid var(--ink-form-field-invalid);
410
+ outline-offset: 0;
411
+ }
412
+
357
413
  :where(.ink-annotation) {
358
414
  border-radius: 2px;
359
415
  outline: 1px solid transparent;
@@ -1302,6 +1358,13 @@
1302
1358
  outline: none;
1303
1359
  }
1304
1360
 
1361
+ /* A form script's message: non-modal, so no overlay dims the page behind it. */
1362
+ :where(.ink-form-alert-message) {
1363
+ margin: 0;
1364
+ white-space: pre-wrap;
1365
+ overflow-wrap: anywhere;
1366
+ }
1367
+
1305
1368
  :where(.ink-dialog-title) {
1306
1369
  margin: 0 0 0.75rem;
1307
1370
  font-size: 1rem;