@mdbase-dev/ui 0.1.0-beta.154 → 0.1.0-beta.156

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 (47) hide show
  1. package/README.md +9 -1
  2. package/css/collections.css +5 -100
  3. package/css/controls.css +65 -34
  4. package/css/feedback.css +6 -6
  5. package/css/motion.css +50 -26
  6. package/css/palette.css +22 -54
  7. package/css/screens.css +19 -0
  8. package/css/toast.css +11 -0
  9. package/css/tokens.css +11 -25
  10. package/dist/AppSwitcher.js +18 -30
  11. package/dist/CommandPalette.d.ts +5 -2
  12. package/dist/CommandPalette.js +157 -152
  13. package/dist/ConfirmDialog.d.ts +14 -0
  14. package/dist/ConfirmDialog.js +65 -0
  15. package/dist/Dialog.d.ts +5 -7
  16. package/dist/Dialog.js +46 -24
  17. package/dist/Feedback.js +24 -56
  18. package/dist/FeedbackMarkup.d.ts +2 -1
  19. package/dist/FeedbackMarkup.js +8 -2
  20. package/dist/Menu.d.ts +10 -0
  21. package/dist/Menu.js +33 -0
  22. package/dist/Select.js +6 -2
  23. package/dist/SelectList.js +2 -1
  24. package/dist/Toaster.d.ts +2 -0
  25. package/dist/Toaster.js +116 -0
  26. package/dist/brand.js +5 -3
  27. package/dist/collections/CollectionSwitcher.d.ts +2 -3
  28. package/dist/collections/CollectionSwitcher.js +14 -173
  29. package/dist/collections/dialogs.d.ts +9 -4
  30. package/dist/collections/dialogs.js +83 -87
  31. package/dist/collections/parts.d.ts +0 -9
  32. package/dist/collections/parts.js +5 -77
  33. package/dist/locales/de/messages.json +1 -1
  34. package/dist/locales/en/messages.json +1 -1
  35. package/dist/locales/es/messages.json +1 -1
  36. package/dist/locales/fr/messages.json +1 -1
  37. package/dist/locales/it/messages.json +1 -1
  38. package/dist/locales/ja/messages.json +1 -1
  39. package/dist/locales/ko/messages.json +1 -1
  40. package/dist/locales/pt/messages.json +1 -1
  41. package/dist/locales/ru/messages.json +1 -1
  42. package/dist/locales/zh/messages.json +1 -1
  43. package/dist/overlay.d.ts +4 -0
  44. package/dist/overlay.js +23 -0
  45. package/dist/popover.d.ts +2 -1
  46. package/dist/popover.js +6 -13
  47. package/package.json +19 -2
package/README.md CHANGED
@@ -36,6 +36,14 @@ applyThemePreference(loadThemePreference());
36
36
  collection in another app. Lab and local builds pass their own URLs to
37
37
  `withAppUrls`.
38
38
 
39
+ ## Toasts
40
+
41
+ Mount one `Toaster` from `@mdbase-dev/ui/toast` inside the app's locale provider
42
+ and import `@mdbase-dev/ui/toast.css`. Call `toast(message, undo?)` with localized
43
+ copy and, when applicable, a real inverse mutation. The toast stays for five
44
+ seconds (eight with Undo), pauses on hover or focus, and queues up to three
45
+ more messages. Unmounting the owner clears the queue.
46
+
39
47
  ## Languages
40
48
 
41
49
  The `/i18n` entry exports `uiCatalogues: CatalogueSource` with synchronous
@@ -73,7 +81,7 @@ Re-render with the current locale's callback to update the presentation.
73
81
  ## Collections
74
82
 
75
83
  Import `@mdbase-dev/ui/collections` and `@mdbase-dev/ui/collections.css`.
76
- `tokens.css` is optional: without it every value falls back to a built-in one.
84
+ The stylesheet includes the shared tokens, controls and dialog styles; no separate imports are needed.
77
85
  Every component takes the SDK front door from `createMdbase` (an optional peer
78
86
  dependency) and `app: { name, mark? }`.
79
87
 
@@ -1,5 +1,6 @@
1
+ @import "./tokens.css";
1
2
  @import "./brand.css";
2
- @import "./motion.css";
3
+ @import "./controls.css";
3
4
  @import "./screens.css";
4
5
 
5
6
  /*
@@ -247,8 +248,8 @@
247
248
  .mdbase-collections-trigger:focus-visible,
248
249
  .mdbase-collections-menu-item:focus-visible,
249
250
  .mdbase-collections-field:focus-visible {
250
- outline: 2px solid var(--_accent);
251
- outline-offset: 2px;
251
+ outline: var(--focus-ring);
252
+ outline-offset: var(--focus-offset);
252
253
  }
253
254
 
254
255
  /* A problem and its fix in one block, with the fix inside. */
@@ -735,22 +736,6 @@
735
736
  }
736
737
  }
737
738
 
738
- .mdbase-collections-popover {
739
- position: fixed;
740
- inset: auto;
741
- z-index: 80;
742
- margin: 0;
743
- padding: 6px;
744
- overflow: auto;
745
- border: 1px solid var(--_border);
746
- border-radius: var(--_radius-lg);
747
- outline: 0;
748
- color: var(--_text);
749
- background: var(--_surface);
750
- box-shadow: var(--_elevation-high);
751
- overscroll-behavior: contain;
752
- }
753
-
754
739
  .mdbase-collections-switcher-content {
755
740
  display: grid;
756
741
  gap: 6px;
@@ -874,75 +859,7 @@
874
859
  color: var(--_text-soft);
875
860
  }
876
861
 
877
- /* Narrow screens: the switcher is a bottom sheet. */
878
- .mdbase-collections-sheet {
879
- width: 100%;
880
- max-width: 100%;
881
- max-height: 85dvh;
882
- margin: auto 0 0;
883
- padding: 0;
884
- border: 0;
885
- border-radius: var(--_radius-lg) var(--_radius-lg) 0 0;
886
- color: var(--_text);
887
- background: var(--_surface);
888
- }
889
-
890
- .mdbase-collections-sheet::backdrop {
891
- background: var(--_scrim);
892
- }
893
-
894
- .mdbase-collections-sheet-body {
895
- display: grid;
896
- gap: 6px;
897
- padding: 8px 12px max(12px, env(safe-area-inset-bottom));
898
- }
899
-
900
- .mdbase-collections-sheet-header {
901
- display: flex;
902
- align-items: center;
903
- justify-content: space-between;
904
- padding: 0 0 0 8px;
905
- }
906
-
907
- .mdbase-collections-sheet-title {
908
- font-weight: var(--_weight-semibold);
909
- }
910
-
911
- /* Confirmations. */
912
- .mdbase-collections-dialog {
913
- width: min(100% - 32px, 440px);
914
- padding: 20px;
915
- border: 1px solid var(--_border);
916
- border-radius: var(--_radius-lg);
917
- color: var(--_text);
918
- background: var(--_surface);
919
- box-shadow: var(--_elevation-high);
920
- }
921
-
922
- .mdbase-collections-dialog::backdrop {
923
- background: var(--_scrim);
924
- }
925
-
926
- .mdbase-collections-dialog-title {
927
- margin: 0 0 8px;
928
- font-size: var(--_font-size-section);
929
- overflow-wrap: anywhere;
930
- }
931
-
932
- .mdbase-collections-dialog-body {
933
- display: grid;
934
- gap: 10px;
935
- color: var(--_text-soft);
936
- }
937
-
938
- .mdbase-collections-dialog-body p {
939
- margin: 0;
940
- }
941
-
942
- .mdbase-collections-dialog-body form {
943
- display: grid;
944
- gap: 6px;
945
- }
862
+ .mdbase-collections-switcher-dialog { width: min(360px, calc(100vw - 16px)); }
946
863
 
947
864
  .mdbase-collections-field-label {
948
865
  color: var(--_text);
@@ -952,22 +869,10 @@
952
869
  color: var(--_danger);
953
870
  }
954
871
 
955
- .mdbase-collections-dialog-actions {
956
- display: flex;
957
- flex-wrap: wrap;
958
- justify-content: flex-end;
959
- gap: 8px;
960
- margin-top: 18px;
961
- }
962
-
963
872
  @media (max-width: 479.98px) {
964
873
  .mdbase-collections-gate .mdbase-collections-actions > .mdbase-collections-button:not(.is-quiet) {
965
874
  flex: 1 1 100%;
966
875
  }
967
-
968
- .mdbase-collections-dialog-actions > .mdbase-collections-button {
969
- flex: 1 1 auto;
970
- }
971
876
  }
972
877
 
973
878
  .mdbase-collections-save-warning {
package/css/controls.css CHANGED
@@ -1,3 +1,5 @@
1
+ @import "./motion.css";
2
+
1
3
  /*
2
4
  * Shared controls. Text fields stay native and take Editor's field treatment;
3
5
  * Select, menus and the app switcher are the components from ./select,
@@ -24,6 +26,35 @@
24
26
  white-space: nowrap;
25
27
  }
26
28
 
29
+ .mdbase-message {
30
+ margin: 1.2rem 0 0;
31
+ padding: 0.7rem 0;
32
+ border-bottom: 1px solid var(--color-border-strong);
33
+ color: var(--color-text-soft);
34
+ font-size: var(--font-size-ui);
35
+ }
36
+
37
+ .mdbase-message.is-error {
38
+ border-color: color-mix(in oklch, var(--color-danger) 35%, var(--color-border));
39
+ color: var(--color-danger);
40
+ }
41
+
42
+ .mdbase-message.is-success {
43
+ border-color: var(--color-success);
44
+ color: var(--color-success);
45
+ }
46
+
47
+ .mdbase-message.is-boxed {
48
+ padding: var(--space-3) 14px;
49
+ border: 1px solid var(--color-border-strong);
50
+ border-radius: var(--radius-sm);
51
+ }
52
+
53
+ .mdbase-message.is-boxed.is-error {
54
+ border-color: var(--color-danger);
55
+ background: var(--color-danger-soft);
56
+ }
57
+
27
58
  /* Fields: native text inputs and textareas. */
28
59
  .mdbase-field,
29
60
  .mdbase-select {
@@ -62,7 +93,7 @@ textarea.mdbase-field {
62
93
 
63
94
  .mdbase-field:focus-visible,
64
95
  .mdbase-select:focus-visible {
65
- outline: 2px solid var(--color-accent);
96
+ outline: var(--focus-ring);
66
97
  outline-offset: 1px;
67
98
  }
68
99
 
@@ -191,7 +222,7 @@ textarea.mdbase-field {
191
222
  }
192
223
 
193
224
  .mdbase-select-list:focus-visible .mdbase-select-option.is-active {
194
- outline: 1px solid var(--color-accent);
225
+ outline: var(--focus-ring);
195
226
  outline-offset: -1px;
196
227
  }
197
228
 
@@ -272,8 +303,7 @@ textarea.mdbase-field {
272
303
 
273
304
  /* One focus mark inside the row, instead of an outline around it. */
274
305
  .mdbase-menu .mdbase-menu-item:focus-visible {
275
- outline: 0;
276
- outline: 1px solid var(--color-accent);
306
+ outline: var(--focus-ring);
277
307
  outline-offset: -1px;
278
308
  }
279
309
 
@@ -287,6 +317,19 @@ textarea.mdbase-field {
287
317
  background: var(--color-selected);
288
318
  }
289
319
 
320
+ .mdbase-menu-item.is-danger,
321
+ .mdbase-menu-item.is-danger:hover:not(:disabled, [aria-disabled="true"]),
322
+ .mdbase-menu .mdbase-menu-item.is-danger:focus-visible { color: var(--color-danger); }
323
+
324
+ .mdbase-disclosure > summary { display: flex; align-items: center; gap: var(--space-2); list-style: none; cursor: pointer; }
325
+ .mdbase-disclosure > summary::-webkit-details-marker { display: none; }
326
+ .mdbase-disclosure > summary::after { content: ""; flex: none; width: 6px; height: 6px; margin-left: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; rotate: -45deg; transition: rotate var(--motion-quick) var(--ease-standard); }
327
+ .mdbase-disclosure[open] > summary::after { rotate: 45deg; }
328
+ .mdbase-disclosure { interpolate-size: allow-keywords; }
329
+ .mdbase-disclosure::details-content { height: 0; overflow: hidden; transition: height var(--motion-enter) var(--ease-out), content-visibility var(--motion-enter) allow-discrete; }
330
+ .mdbase-disclosure[open]::details-content { height: auto; }
331
+ @media (prefers-reduced-motion: reduce) { .mdbase-disclosure > summary::after { transition: none; } }
332
+
290
333
  .mdbase-menu-copy {
291
334
  min-width: 0;
292
335
  flex: 1 1 auto;
@@ -410,7 +453,9 @@ textarea.mdbase-field {
410
453
 
411
454
  .mdbase-button:active:not(:disabled) {
412
455
  transform: scale(0.97);
456
+ transition-duration: 0s;
413
457
  }
458
+ @media (prefers-reduced-motion: reduce) { .mdbase-button:active:not(:disabled) { transform: none; } }
414
459
 
415
460
  .mdbase-button.is-primary {
416
461
  border-color: var(--color-accent);
@@ -437,10 +482,13 @@ textarea.mdbase-field {
437
482
  }
438
483
 
439
484
  .mdbase-button.is-danger {
440
- border-color: var(--color-danger);
441
485
  color: var(--color-danger);
442
486
  }
443
487
 
488
+ .mdbase-button.is-danger:not(.is-tertiary) {
489
+ border-color: var(--color-danger);
490
+ }
491
+
444
492
  .mdbase-button.is-danger:hover:not(:disabled) {
445
493
  background: var(--color-danger-soft);
446
494
  }
@@ -501,8 +549,8 @@ textarea.mdbase-field {
501
549
 
502
550
  .mdbase-button:focus-visible,
503
551
  .mdbase-icon-button:focus-visible {
504
- outline: 2px solid var(--color-accent);
505
- outline-offset: 2px;
552
+ outline: var(--focus-ring);
553
+ outline-offset: var(--focus-offset);
506
554
  }
507
555
 
508
556
  /* Switch: native button semantics (role="switch", aria-checked), one track and thumb. */
@@ -603,8 +651,8 @@ textarea.mdbase-field {
603
651
 
604
652
  .mdbase-checkbox:focus-visible,
605
653
  .mdbase-switch:focus-visible {
606
- outline: 2px solid var(--color-accent);
607
- outline-offset: 2px;
654
+ outline: var(--focus-ring);
655
+ outline-offset: var(--focus-offset);
608
656
  }
609
657
 
610
658
  /* Checkbox row: the label is the 44px target; the box keeps its size. */
@@ -671,18 +719,10 @@ textarea.mdbase-field {
671
719
  box-shadow: none;
672
720
  }
673
721
 
674
- .mdbase-dialog[open] {
675
- animation: mdbase-dialog-in var(--motion-base) var(--ease-out);
676
- }
677
-
678
722
  .mdbase-dialog::backdrop {
679
723
  background: var(--color-scrim);
680
724
  }
681
725
 
682
- @keyframes mdbase-dialog-in {
683
- from { opacity: 0; transform: translateY(6px); }
684
- }
685
-
686
726
  .mdbase-dialog-body {
687
727
  display: grid;
688
728
  gap: 1rem;
@@ -705,15 +745,6 @@ textarea.mdbase-field {
705
745
  text-transform: none;
706
746
  }
707
747
 
708
- /* Popovers arrive quickly and settle into place. Apps mark their own with .mdbase-popover. */
709
- :is(.mdbase-select-list, .mdbase-menu, .mdbase-popover):popover-open {
710
- animation: mdbase-popover-in var(--motion-quick) var(--ease-out);
711
- }
712
-
713
- @keyframes mdbase-popover-in {
714
- from { transform: translateY(-3px); }
715
- }
716
-
717
748
  /* Save notices: small, quiet, and gone once there is nothing to act on. */
718
749
  .mdbase-save-notice {
719
750
  display: inline-flex;
@@ -769,14 +800,6 @@ textarea.mdbase-field {
769
800
  }
770
801
 
771
802
  @media (prefers-reduced-motion: reduce) {
772
- :is(.mdbase-select-list, .mdbase-menu, .mdbase-popover):popover-open {
773
- animation: none;
774
- }
775
-
776
- .mdbase-dialog[open] {
777
- animation: none;
778
- }
779
-
780
803
  /* Without the fade, a confirmation still shows for the same time, then goes. */
781
804
  .mdbase-settle {
782
805
  animation-timing-function: steps(1, end);
@@ -802,3 +825,11 @@ textarea.mdbase-field {
802
825
  .mdbase-collection-mode h3 { font-size: var(--font-size-section); font-weight: var(--font-weight-medium); }
803
826
  .mdbase-collection-mode > div:last-child { display: flex; flex-wrap: wrap; gap: var(--space-2); }
804
827
  .mdbase-collection-mode code { overflow-wrap: anywhere; }
828
+
829
+ :focus-visible {
830
+ outline: var(--focus-ring);
831
+ outline-offset: var(--focus-offset);
832
+ }
833
+ [role="radio"][aria-checked="true"]:focus-visible { outline: var(--focus-ring); }
834
+ .mdbase-dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-6); }
835
+ .mdbase-confirm-dialog { width: min(440px, calc(100vw - 32px)); }
package/css/feedback.css CHANGED
@@ -11,13 +11,10 @@
11
11
  .mdbase-feedback-dialog::backdrop { background: var(--color-scrim); }
12
12
  .mdbase-feedback-dialog *, .mdbase-feedback-markup * { box-sizing: border-box; }
13
13
  .mdbase-feedback-dialog :is(button,input,textarea), .mdbase-feedback-markup button { font: inherit; }
14
- .mdbase-feedback-dialog :focus-visible, .mdbase-feedback-markup :focus-visible, .mdbase-feedback-trigger:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
14
+ .mdbase-feedback-dialog :focus-visible, .mdbase-feedback-markup :focus-visible, .mdbase-feedback-trigger:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
15
15
  .mdbase-feedback-dialog button, .mdbase-feedback-markup .mdbase-feedback-actions button, .mdbase-feedback-tools button { border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); padding: 7px 11px; background: var(--color-canvas); color: var(--color-text); cursor: pointer; }
16
16
  .mdbase-feedback-dialog button:hover, .mdbase-feedback-markup button:hover { background: var(--color-selected); }
17
17
  .mdbase-feedback-dialog button:disabled, .mdbase-feedback-markup button:disabled { opacity: .5; cursor: default; }
18
- .mdbase-feedback-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 27px; border-bottom: 1px solid var(--color-border); flex-shrink: 0; }
19
- .mdbase-feedback-header h2 { font-size: var(--font-size-heading); line-height: 1.25; letter-spacing: -.5px; margin: 0; color: var(--color-text); }
20
- .mdbase-feedback-header button { border: 0; width: 34px; height: 34px; padding: 0; font-size: var(--font-size-heading); color: var(--color-text-muted); }
21
18
  .mdbase-feedback-dialog form { display: flex; flex-direction: column; flex: 1; overflow: hidden; margin: 0; }
22
19
  .mdbase-feedback-body { flex: 1; overflow-y: auto; padding: 23px 27px; }
23
20
  .mdbase-feedback-topics { display: grid; gap: 6px; border: 0; padding: 0; margin: 0 0 23px; }
@@ -38,7 +35,7 @@
38
35
  .mdbase-feedback-screenshot-actions label { display: flex; align-items: center; gap: 7px; }
39
36
  .mdbase-feedback-upload { position: relative; color: var(--color-accent); cursor: pointer; padding: 6px 0; }
40
37
  .mdbase-feedback-upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
41
- .mdbase-feedback-upload:focus-within { outline: 2px solid var(--color-accent); outline-offset: 3px; }
38
+ .mdbase-feedback-upload:focus-within { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
42
39
  .mdbase-feedback-check { display: flex; gap: 8px; align-items: center; font-size: var(--font-size-caption); }
43
40
  .mdbase-feedback-details > .mdbase-feedback-check { margin: 14px 0 8px; }
44
41
  .mdbase-feedback-help { font-size: var(--font-size-caption); line-height: 1.6; color: var(--color-text-muted); margin: 9px 0; }
@@ -59,4 +56,7 @@
59
56
  .mdbase-feedback-canvas { background: var(--color-surface-subtle); border: 1px solid var(--color-border); padding: 12px; overflow: auto; display: flex; justify-content: center; align-items: center; min-height: 0; }
60
57
  .mdbase-feedback-canvas canvas { display: block; max-width: 100%; max-height: calc(100dvh - 345px); width: auto; height: auto; background: white; touch-action: none; cursor: crosshair; }
61
58
  .mdbase-feedback-markup .mdbase-feedback-actions { padding: 15px 0 0; }
62
- @media (max-width: 600px) { .mdbase-feedback-header { padding: 23px; } .mdbase-feedback-body { padding: 20px 23px; } .mdbase-feedback-actions { padding: 16px 23px; } .mdbase-feedback-tools { gap: 4px; } .mdbase-feedback-tools button { font-size: var(--font-size-caption); padding: 6px 8px; } }
59
+ @media (max-width: 600px) { .mdbase-feedback-body { padding: 20px 23px; } .mdbase-feedback-actions { padding: 16px 23px; } .mdbase-feedback-tools { gap: 4px; } .mdbase-feedback-tools button { font-size: var(--font-size-caption); padding: 6px 8px; } }
60
+
61
+ .mdbase-feedback-dialog.is-capturing { --motion-exit: 0ms; }
62
+ .mdbase-feedback-dialog > .mdbase-dialog-body { padding: 16px; gap: 16px; }
package/css/motion.css CHANGED
@@ -1,3 +1,53 @@
1
+ :root {
2
+ /* Transitions share durations and easing; settled confirmations hold then fade. */
3
+ --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
4
+ --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
5
+ --motion-fast: 120ms;
6
+ --motion-quick: 150ms;
7
+ --motion-base: 180ms;
8
+ --motion-slow: 200ms;
9
+ --motion-spin: 700ms;
10
+ --motion-pulse: 1.1s;
11
+ --motion-settle: 2.4s;
12
+ --motion-enter: 160ms;
13
+ --motion-exit: 120ms;
14
+ --motion-grant: 300ms;
15
+ --motion-confirm: 1s;
16
+ }
17
+
18
+ .mdbase-overlay {
19
+ opacity: 1;
20
+ transform: scale(1);
21
+ transition: opacity var(--motion-enter) var(--ease-out), transform var(--motion-enter) var(--ease-out);
22
+ }
23
+ .mdbase-overlay::backdrop { opacity: 1; transition: opacity var(--motion-enter) var(--ease-out); }
24
+ .mdbase-overlay[data-open="false"]::backdrop { opacity: 0; transition-duration: var(--motion-exit); }
25
+ .mdbase-overlay[data-open="false"] {
26
+ opacity: 0;
27
+ transform: scale(.98);
28
+ pointer-events: none;
29
+ transition-duration: var(--motion-exit);
30
+ }
31
+ @starting-style {
32
+ .mdbase-overlay[data-open="true"] { opacity: 0; transform: scale(.98); }
33
+ .mdbase-overlay[data-open="true"]::backdrop { opacity: 0; }
34
+ }
35
+ @media (prefers-reduced-motion: reduce) {
36
+ :root {
37
+ --motion-enter: 0ms;
38
+ --motion-exit: 0ms;
39
+ --motion-grant: 0ms;
40
+ --motion-confirm: 0ms;
41
+ --motion-fast: 0ms;
42
+ --motion-quick: 0ms;
43
+ --motion-base: 0ms;
44
+ --motion-slow: 0ms;
45
+ --motion-spin: 0ms;
46
+ --motion-pulse: 0ms;
47
+ }
48
+ .mdbase-overlay, .mdbase-overlay::backdrop { transition: none; transform: none; }
49
+ }
50
+
1
51
  /*
2
52
  * Animations for the Frontmatter mark. Base mark styling lives in brand.css.
3
53
  * Colours go through --mark-ink and --mark-accent so the platform mark and the
@@ -250,32 +300,6 @@
250
300
  to { opacity: 1; }
251
301
  }
252
302
 
253
- /* Error: the fields shake once and the highlight turns to danger before recovering. */
254
- .mdbase-signal-error .mdbase-mark-row {
255
- animation: mdbase-shake 520ms cubic-bezier(0.36, 0.07, 0.19, 0.97) 1 both;
256
- }
257
-
258
- .mdbase-signal-error .mdbase-mark-row-bottom {
259
- animation-delay: 40ms;
260
- }
261
-
262
- .mdbase-signal-error .mdbase-mark-accent {
263
- animation: mdbase-danger 1.4s ease 1 both;
264
- }
265
-
266
- @keyframes mdbase-shake {
267
- 15% { transform: translateX(-4px); }
268
- 35% { transform: translateX(4px); }
269
- 55% { transform: translateX(-2.5px); }
270
- 75% { transform: translateX(1.5px); }
271
- to { transform: none; }
272
- }
273
-
274
- @keyframes mdbase-danger {
275
- 0%, 60% { fill: var(--color-danger); }
276
- to { fill: var(--mark-accent); }
277
- }
278
-
279
303
  /* ---------- Hover ---------- */
280
304
 
281
305
  /* Wave: one ripple runs through the resting mark in reading order. */
package/css/palette.css CHANGED
@@ -1,44 +1,12 @@
1
- /* The command palette (./command-palette). Reader's layout in Editor's quiet frame. */
2
- .mdbase-command-backdrop {
3
- position: fixed;
4
- inset: 0;
5
- z-index: 100;
6
- width: 100%;
7
- max-width: none;
8
- height: 100%;
9
- max-height: none;
10
- display: grid;
11
- justify-items: center;
12
- align-items: start;
13
- margin: 0;
14
- padding: min(14vh, 120px) 16px 16px;
15
- border: 0;
16
- background: color-mix(in oklch, var(--color-scrim) 40%, transparent);
17
- }
18
-
19
- .mdbase-command-dismiss {
20
- position: absolute;
21
- inset: 0;
22
- width: 100%;
23
- height: 100%;
24
- border: 0;
25
- background: transparent;
26
- cursor: default;
27
- }
28
-
29
- .mdbase-command-palette {
30
- position: relative;
31
- z-index: 1;
32
- width: min(600px, 100%);
33
- max-height: calc(100dvh - min(28vh, 240px) - 32px);
34
- display: grid;
35
- grid-template-rows: auto minmax(0, 1fr) auto;
1
+ /* Shared by the portal palette and Editor quick open after its npm repin. */
2
+ .mdbase-dialog.mdbase-command-palette {
3
+ width: min(var(--palette-width), calc(100vw - 16px));
4
+ margin: var(--palette-top) auto auto;
5
+ max-height: calc(100dvh - var(--palette-top) - 16px);
36
6
  overflow: hidden;
37
- border: 1px solid var(--color-border-strong);
38
- border-radius: var(--control-radius);
39
- background: var(--color-surface);
40
- animation: mdbase-popover-in var(--motion-base) var(--ease-out);
41
7
  }
8
+ .mdbase-command-palette > .mdbase-dialog-body { padding: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: inherit; }
9
+ .mdbase-command-palette .mdbase-dialog-header { display: none; }
42
10
 
43
11
  .mdbase-command-search {
44
12
  height: 52px;
@@ -76,6 +44,7 @@
76
44
  overflow: auto;
77
45
  padding: 4px 6px 8px;
78
46
  scroll-padding: 28px 0 8px;
47
+ transition: height var(--motion-enter) var(--ease-out);
79
48
  }
80
49
 
81
50
  .mdbase-command-group {
@@ -108,7 +77,9 @@
108
77
  background: var(--color-selected);
109
78
  }
110
79
 
111
- .mdbase-command-results button > span:first-child {
80
+ .mdbase-command-results > button:active { background: var(--color-border-strong); }
81
+
82
+ .mdbase-command-results .mdbase-command-copy {
112
83
  min-width: 0;
113
84
  display: flex;
114
85
  align-items: baseline;
@@ -123,7 +94,8 @@
123
94
  }
124
95
 
125
96
  .mdbase-command-results strong {
126
- flex: 0 1 auto;
97
+ flex: 0 0 auto;
98
+ max-width: 100%;
127
99
  font-size: var(--font-size-ui);
128
100
  font-weight: var(--font-weight-medium);
129
101
  }
@@ -171,15 +143,7 @@
171
143
  }
172
144
 
173
145
  @media (max-width: 680px) {
174
- .mdbase-command-backdrop {
175
- padding: 56px 8px 8px;
176
- }
177
-
178
- .mdbase-command-palette {
179
- max-height: calc(100dvh - 64px);
180
- }
181
-
182
- .mdbase-command-results button > span:first-child {
146
+ .mdbase-command-results .mdbase-command-copy {
183
147
  display: grid;
184
148
  gap: 1px;
185
149
  }
@@ -189,8 +153,12 @@
189
153
  }
190
154
  }
191
155
 
192
- @media (prefers-reduced-motion: reduce) {
193
- .mdbase-command-palette {
194
- animation: none;
195
- }
156
+ .mdbase-command-results > button:has(.mdbase-command-icon) { grid-template-columns: 18px minmax(0, 1fr) auto auto; }
157
+ .mdbase-command-icon { display: flex; color: var(--color-text-muted); }
158
+ .mdbase-command-icon svg { width: 18px; height: 18px; }
159
+
160
+ @media (pointer: coarse) {
161
+ .mdbase-command-results kbd,
162
+ .mdbase-command-footer,
163
+ .mdbase-command-alternate { display: none; }
196
164
  }
package/css/screens.css CHANGED
@@ -1,3 +1,22 @@
1
+ .mdbase-page {
2
+ display: grid;
3
+ align-content: center;
4
+ justify-items: center;
5
+ min-height: 100vh;
6
+ padding: 3rem 2rem;
7
+ background: var(--color-canvas);
8
+ }
9
+
10
+ .mdbase-page-panel {
11
+ width: min(32rem, 100%);
12
+ padding: 0;
13
+ background: var(--color-canvas);
14
+ }
15
+
16
+ @media (max-width: 760px) {
17
+ .mdbase-page { padding: 2rem 1.25rem; }
18
+ }
19
+
1
20
  /* Opening a collection: the wordmark, scanning, over one quiet line. */
2
21
  .mdbase-opening {
3
22
  width: 100%;
package/css/toast.css ADDED
@@ -0,0 +1,11 @@
1
+ .mdbase-toaster { position: fixed; bottom: 20px; right: 20px; z-index: 1000; max-width: min(460px, calc(100vw - 40px)); }
2
+ .mdbase-toast-slot { display: grid; grid-template-rows: 1fr; opacity: 1; transform: translateY(0); transition: grid-template-rows var(--motion-enter) var(--ease-out), opacity var(--motion-enter) var(--ease-out), transform var(--motion-enter) var(--ease-out); }
3
+ .mdbase-toast-slot[data-open="false"] { grid-template-rows: 0fr; opacity: 0; transform: translateY(8px); pointer-events: none; transition-duration: var(--motion-exit); }
4
+ @starting-style { .mdbase-toast-slot[data-open="true"] { grid-template-rows: 0fr; opacity: 0; transform: translateY(8px); } }
5
+ .mdbase-toast-clip { min-height: 0; overflow: hidden; }
6
+ .mdbase-toast { display: flex; align-items: center; gap: 9px; padding: 8px 8px 8px 13px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text-soft); box-shadow: var(--elevation-high); font-size: var(--font-size-ui); }
7
+ .mdbase-toast-clip > .mdbase-toast { margin-top: 8px; }
8
+ .mdbase-toast span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
9
+ .mdbase-toast button { flex: none; font-size: inherit; }
10
+ @media (max-width: 640px) { .mdbase-toaster { top: max(16px, env(safe-area-inset-top)); bottom: auto; left: 16px; right: 16px; max-width: none; } }
11
+ @media (prefers-reduced-motion: reduce) { .mdbase-toast-slot { transition: none; transform: none; } }
package/css/tokens.css CHANGED
@@ -6,6 +6,7 @@
6
6
  :root {
7
7
  color-scheme: light;
8
8
  --color-canvas: oklch(100% 0 0);
9
+ --color-sidebar: oklch(98% 0.002 286);
9
10
  --color-surface: oklch(100% 0 0);
10
11
  --color-surface-subtle: oklch(97% 0.001 286);
11
12
  --color-text: oklch(21% 0.006 286);
@@ -49,10 +50,14 @@
49
50
  /* Six steps: captions, UI chrome, section titles, prose, headings, document titles. */
50
51
  --font-size-caption: 12px;
51
52
  --font-size-ui: 13px;
52
- --font-size-section: 15px;
53
- --font-size-prose: 17px;
54
- --font-size-heading: 24px;
55
- --font-size-title: 34px;
53
+ --font-size-section: 13px;
54
+ --font-size-prose: 15px;
55
+ --font-size-heading: 20px;
56
+ --font-size-title: 26px;
57
+ --focus-ring: 2px solid var(--color-accent);
58
+ --focus-offset: 3px;
59
+ --palette-width: 600px;
60
+ --palette-top: min(14dvh, 120px);
56
61
  --font-weight-regular: 400;
57
62
  --font-weight-medium: 500;
58
63
  --font-weight-semibold: 600;
@@ -71,32 +76,12 @@
71
76
  --space-8: 32px;
72
77
  --space-12: 48px;
73
78
  --space-16: 64px;
74
- /* Transitions share durations and easing; settled confirmations hold then fade. */
75
- --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
76
- --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
77
- --motion-fast: 120ms;
78
- --motion-quick: 150ms;
79
- --motion-base: 180ms;
80
- --motion-slow: 240ms;
81
- --motion-spin: 700ms;
82
- --motion-pulse: 1.1s;
83
- --motion-settle: 2.4s;
84
- }
85
-
86
- @media (prefers-reduced-motion: reduce) {
87
- :root {
88
- --motion-fast: 0ms;
89
- --motion-quick: 0ms;
90
- --motion-base: 0ms;
91
- --motion-slow: 0ms;
92
- --motion-spin: 0ms;
93
- --motion-pulse: 0ms;
94
- }
95
79
  }
96
80
 
97
81
  :root[data-theme="dark"] {
98
82
  color-scheme: dark;
99
83
  --color-canvas: oklch(18.7% 0.002 286);
84
+ --color-sidebar: oklch(16% 0.002 286);
100
85
  --color-surface: oklch(18.7% 0.002 286);
101
86
  --color-surface-subtle: oklch(23.6% 0.004 286);
102
87
  --color-text: oklch(94.7% 0.003 286);
@@ -140,6 +125,7 @@
140
125
  :root:not([data-theme]) {
141
126
  color-scheme: dark;
142
127
  --color-canvas: oklch(18.7% 0.002 286);
128
+ --color-sidebar: oklch(16% 0.002 286);
143
129
  --color-surface: oklch(18.7% 0.002 286);
144
130
  --color-surface-subtle: oklch(23.6% 0.004 286);
145
131
  --color-text: oklch(94.7% 0.003 286);