@mdbase-dev/ui 0.1.0-beta.155 → 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 (45) hide show
  1. package/README.md +1 -1
  2. package/css/collections.css +5 -100
  3. package/css/controls.css +32 -33
  4. package/css/feedback.css +6 -6
  5. package/css/motion.css +50 -26
  6. package/css/palette.css +22 -54
  7. package/css/toast.css +10 -5
  8. package/css/tokens.css +11 -25
  9. package/dist/AppSwitcher.js +18 -30
  10. package/dist/CommandPalette.d.ts +5 -2
  11. package/dist/CommandPalette.js +157 -152
  12. package/dist/ConfirmDialog.d.ts +14 -0
  13. package/dist/ConfirmDialog.js +65 -0
  14. package/dist/Dialog.d.ts +5 -7
  15. package/dist/Dialog.js +46 -24
  16. package/dist/Feedback.js +24 -56
  17. package/dist/FeedbackMarkup.d.ts +2 -1
  18. package/dist/FeedbackMarkup.js +8 -2
  19. package/dist/Menu.d.ts +10 -0
  20. package/dist/Menu.js +33 -0
  21. package/dist/Select.js +6 -2
  22. package/dist/SelectList.js +2 -1
  23. package/dist/Toaster.js +72 -44
  24. package/dist/brand.js +5 -3
  25. package/dist/collections/CollectionSwitcher.d.ts +2 -3
  26. package/dist/collections/CollectionSwitcher.js +14 -173
  27. package/dist/collections/dialogs.d.ts +9 -4
  28. package/dist/collections/dialogs.js +83 -87
  29. package/dist/collections/parts.d.ts +0 -9
  30. package/dist/collections/parts.js +5 -77
  31. package/dist/locales/de/messages.json +1 -1
  32. package/dist/locales/en/messages.json +1 -1
  33. package/dist/locales/es/messages.json +1 -1
  34. package/dist/locales/fr/messages.json +1 -1
  35. package/dist/locales/it/messages.json +1 -1
  36. package/dist/locales/ja/messages.json +1 -1
  37. package/dist/locales/ko/messages.json +1 -1
  38. package/dist/locales/pt/messages.json +1 -1
  39. package/dist/locales/ru/messages.json +1 -1
  40. package/dist/locales/zh/messages.json +1 -1
  41. package/dist/overlay.d.ts +4 -0
  42. package/dist/overlay.js +23 -0
  43. package/dist/popover.d.ts +2 -1
  44. package/dist/popover.js +6 -13
  45. package/package.json +14 -2
package/README.md CHANGED
@@ -81,7 +81,7 @@ Re-render with the current locale's callback to update the presentation.
81
81
  ## Collections
82
82
 
83
83
  Import `@mdbase-dev/ui/collections` and `@mdbase-dev/ui/collections.css`.
84
- `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.
85
85
  Every component takes the SDK front door from `createMdbase` (an optional peer
86
86
  dependency) and `app: { name, mark? }`.
87
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,
@@ -91,7 +93,7 @@ textarea.mdbase-field {
91
93
 
92
94
  .mdbase-field:focus-visible,
93
95
  .mdbase-select:focus-visible {
94
- outline: 2px solid var(--color-accent);
96
+ outline: var(--focus-ring);
95
97
  outline-offset: 1px;
96
98
  }
97
99
 
@@ -220,7 +222,7 @@ textarea.mdbase-field {
220
222
  }
221
223
 
222
224
  .mdbase-select-list:focus-visible .mdbase-select-option.is-active {
223
- outline: 1px solid var(--color-accent);
225
+ outline: var(--focus-ring);
224
226
  outline-offset: -1px;
225
227
  }
226
228
 
@@ -301,8 +303,7 @@ textarea.mdbase-field {
301
303
 
302
304
  /* One focus mark inside the row, instead of an outline around it. */
303
305
  .mdbase-menu .mdbase-menu-item:focus-visible {
304
- outline: 0;
305
- outline: 1px solid var(--color-accent);
306
+ outline: var(--focus-ring);
306
307
  outline-offset: -1px;
307
308
  }
308
309
 
@@ -316,6 +317,19 @@ textarea.mdbase-field {
316
317
  background: var(--color-selected);
317
318
  }
318
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
+
319
333
  .mdbase-menu-copy {
320
334
  min-width: 0;
321
335
  flex: 1 1 auto;
@@ -439,7 +453,9 @@ textarea.mdbase-field {
439
453
 
440
454
  .mdbase-button:active:not(:disabled) {
441
455
  transform: scale(0.97);
456
+ transition-duration: 0s;
442
457
  }
458
+ @media (prefers-reduced-motion: reduce) { .mdbase-button:active:not(:disabled) { transform: none; } }
443
459
 
444
460
  .mdbase-button.is-primary {
445
461
  border-color: var(--color-accent);
@@ -533,8 +549,8 @@ textarea.mdbase-field {
533
549
 
534
550
  .mdbase-button:focus-visible,
535
551
  .mdbase-icon-button:focus-visible {
536
- outline: 2px solid var(--color-accent);
537
- outline-offset: 2px;
552
+ outline: var(--focus-ring);
553
+ outline-offset: var(--focus-offset);
538
554
  }
539
555
 
540
556
  /* Switch: native button semantics (role="switch", aria-checked), one track and thumb. */
@@ -635,8 +651,8 @@ textarea.mdbase-field {
635
651
 
636
652
  .mdbase-checkbox:focus-visible,
637
653
  .mdbase-switch:focus-visible {
638
- outline: 2px solid var(--color-accent);
639
- outline-offset: 2px;
654
+ outline: var(--focus-ring);
655
+ outline-offset: var(--focus-offset);
640
656
  }
641
657
 
642
658
  /* Checkbox row: the label is the 44px target; the box keeps its size. */
@@ -703,18 +719,10 @@ textarea.mdbase-field {
703
719
  box-shadow: none;
704
720
  }
705
721
 
706
- .mdbase-dialog[open] {
707
- animation: mdbase-dialog-in var(--motion-base) var(--ease-out);
708
- }
709
-
710
722
  .mdbase-dialog::backdrop {
711
723
  background: var(--color-scrim);
712
724
  }
713
725
 
714
- @keyframes mdbase-dialog-in {
715
- from { opacity: 0; transform: translateY(6px); }
716
- }
717
-
718
726
  .mdbase-dialog-body {
719
727
  display: grid;
720
728
  gap: 1rem;
@@ -737,15 +745,6 @@ textarea.mdbase-field {
737
745
  text-transform: none;
738
746
  }
739
747
 
740
- /* Popovers arrive quickly and settle into place. Apps mark their own with .mdbase-popover. */
741
- :is(.mdbase-select-list, .mdbase-menu, .mdbase-popover):popover-open {
742
- animation: mdbase-popover-in var(--motion-quick) var(--ease-out);
743
- }
744
-
745
- @keyframes mdbase-popover-in {
746
- from { transform: translateY(-3px); }
747
- }
748
-
749
748
  /* Save notices: small, quiet, and gone once there is nothing to act on. */
750
749
  .mdbase-save-notice {
751
750
  display: inline-flex;
@@ -801,14 +800,6 @@ textarea.mdbase-field {
801
800
  }
802
801
 
803
802
  @media (prefers-reduced-motion: reduce) {
804
- :is(.mdbase-select-list, .mdbase-menu, .mdbase-popover):popover-open {
805
- animation: none;
806
- }
807
-
808
- .mdbase-dialog[open] {
809
- animation: none;
810
- }
811
-
812
803
  /* Without the fade, a confirmation still shows for the same time, then goes. */
813
804
  .mdbase-settle {
814
805
  animation-timing-function: steps(1, end);
@@ -834,3 +825,11 @@ textarea.mdbase-field {
834
825
  .mdbase-collection-mode h3 { font-size: var(--font-size-section); font-weight: var(--font-weight-medium); }
835
826
  .mdbase-collection-mode > div:last-child { display: flex; flex-wrap: wrap; gap: var(--space-2); }
836
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/toast.css CHANGED
@@ -1,6 +1,11 @@
1
- .mdbase-toaster { position: fixed; bottom: 24px; left: 24px; z-index: 1000; max-width: min(440px, calc(100vw - 48px)); }
2
- .mdbase-toast { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); box-shadow: var(--elevation-high); animation: mdbase-toast-in var(--motion-base) var(--ease-out); }
3
- .mdbase-toast span { flex: 1; }
4
- @keyframes mdbase-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
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; }
5
10
  @media (max-width: 640px) { .mdbase-toaster { top: max(16px, env(safe-area-inset-top)); bottom: auto; left: 16px; right: 16px; max-width: none; } }
6
- @media (prefers-reduced-motion: reduce) { .mdbase-toast { animation: 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);