@mdbase-dev/ui 0.1.0-beta.155 → 0.1.0-beta.157
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 +1 -1
- package/css/collections.css +5 -100
- package/css/controls.css +35 -36
- package/css/feedback.css +6 -6
- package/css/motion.css +50 -26
- package/css/palette.css +32 -55
- package/css/toast.css +11 -6
- package/css/tokens.css +14 -25
- package/dist/AppSwitcher.js +18 -30
- package/dist/CommandPalette.d.ts +9 -2
- package/dist/CommandPalette.js +203 -167
- package/dist/ConfirmDialog.d.ts +18 -0
- package/dist/ConfirmDialog.js +74 -0
- package/dist/Dialog.d.ts +8 -8
- package/dist/Dialog.js +90 -25
- package/dist/Feedback.js +24 -56
- package/dist/FeedbackMarkup.d.ts +2 -1
- package/dist/FeedbackMarkup.js +9 -2
- package/dist/Menu.d.ts +28 -0
- package/dist/Menu.js +64 -0
- package/dist/Select.js +6 -2
- package/dist/SelectList.js +2 -1
- package/dist/Toaster.d.ts +18 -1
- package/dist/Toaster.js +132 -50
- package/dist/brand.js +5 -3
- package/dist/collections/CollectionSwitcher.d.ts +2 -3
- package/dist/collections/CollectionSwitcher.js +14 -173
- package/dist/collections/copy.js +4 -4
- package/dist/collections/dialogs.d.ts +9 -4
- package/dist/collections/dialogs.js +84 -87
- package/dist/collections/parts.d.ts +0 -9
- package/dist/collections/parts.js +5 -77
- package/dist/locales/de/messages.json +1 -1
- package/dist/locales/en/messages.json +1 -1
- package/dist/locales/es/messages.json +1 -1
- package/dist/locales/fr/messages.json +1 -1
- package/dist/locales/it/messages.json +1 -1
- package/dist/locales/ja/messages.json +1 -1
- package/dist/locales/ko/messages.json +1 -1
- package/dist/locales/pt/messages.json +1 -1
- package/dist/locales/ru/messages.json +1 -1
- package/dist/locales/zh/messages.json +1 -1
- package/dist/overlay.d.ts +4 -0
- package/dist/overlay.js +23 -0
- package/dist/popover.d.ts +6 -1
- package/dist/popover.js +22 -16
- 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
|
-
|
|
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
|
|
package/css/collections.css
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
@import "./tokens.css";
|
|
1
2
|
@import "./brand.css";
|
|
2
|
-
@import "./
|
|
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:
|
|
251
|
-
outline-offset:
|
|
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
|
-
|
|
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:
|
|
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:
|
|
225
|
+
outline: var(--focus-ring);
|
|
224
226
|
outline-offset: -1px;
|
|
225
227
|
}
|
|
226
228
|
|
|
@@ -260,7 +262,7 @@ textarea.mdbase-field {
|
|
|
260
262
|
border-radius: var(--control-radius);
|
|
261
263
|
outline: 0;
|
|
262
264
|
color: var(--color-text-soft);
|
|
263
|
-
background: var(--color-surface);
|
|
265
|
+
background: var(--color-surface-overlay);
|
|
264
266
|
font-size: var(--control-font-size);
|
|
265
267
|
overscroll-behavior: contain;
|
|
266
268
|
}
|
|
@@ -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:
|
|
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:
|
|
537
|
-
outline-offset:
|
|
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:
|
|
639
|
-
outline-offset:
|
|
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. */
|
|
@@ -699,22 +715,14 @@ textarea.mdbase-field {
|
|
|
699
715
|
border: 1px solid var(--color-border-strong);
|
|
700
716
|
border-radius: var(--control-radius);
|
|
701
717
|
color: var(--color-text);
|
|
702
|
-
background: var(--color-surface);
|
|
703
|
-
box-shadow:
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
.mdbase-dialog[open] {
|
|
707
|
-
animation: mdbase-dialog-in var(--motion-base) var(--ease-out);
|
|
718
|
+
background: var(--color-surface-overlay);
|
|
719
|
+
box-shadow: var(--elevation-high);
|
|
708
720
|
}
|
|
709
721
|
|
|
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:
|
|
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:
|
|
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) {
|
|
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
|
+
--ease-exit: cubic-bezier(0.4, 0, 1, 1);
|
|
6
|
+
--motion-fast: 120ms;
|
|
7
|
+
--motion-quick: 150ms;
|
|
8
|
+
--motion-base: 180ms;
|
|
9
|
+
--motion-slow: 200ms;
|
|
10
|
+
--motion-spin: 700ms;
|
|
11
|
+
--motion-pulse: 1.1s;
|
|
12
|
+
--motion-settle: 2.4s;
|
|
13
|
+
--motion-enter: 160ms;
|
|
14
|
+
--motion-exit: 120ms;
|
|
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); transition-timing-function: var(--ease-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
|
+
transition-timing-function: var(--ease-exit);
|
|
31
|
+
}
|
|
32
|
+
@starting-style {
|
|
33
|
+
.mdbase-overlay[data-open="true"] { opacity: 0; transform: scale(.98); }
|
|
34
|
+
.mdbase-overlay[data-open="true"]::backdrop { opacity: 0; }
|
|
35
|
+
}
|
|
36
|
+
@media (prefers-reduced-motion: reduce) {
|
|
37
|
+
:root {
|
|
38
|
+
--motion-enter: 0ms;
|
|
39
|
+
--motion-exit: 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,13 @@
|
|
|
1
|
-
/*
|
|
2
|
-
.mdbase-command-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
+
--accent-soft: var(--color-accent-soft);
|
|
4
|
+
width: min(var(--palette-width), calc(100vw - 16px));
|
|
5
|
+
margin: var(--palette-top) auto auto;
|
|
6
|
+
max-height: calc(100dvh - var(--palette-top) - 16px);
|
|
36
7
|
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
8
|
}
|
|
9
|
+
.mdbase-command-palette > .mdbase-dialog-body { padding: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: inherit; }
|
|
10
|
+
.mdbase-command-palette .mdbase-dialog-header { display: none; }
|
|
42
11
|
|
|
43
12
|
.mdbase-command-search {
|
|
44
13
|
height: 52px;
|
|
@@ -72,13 +41,17 @@
|
|
|
72
41
|
}
|
|
73
42
|
|
|
74
43
|
.mdbase-command-results {
|
|
75
|
-
|
|
44
|
+
max-height: 380px;
|
|
76
45
|
overflow: auto;
|
|
77
46
|
padding: 4px 6px 8px;
|
|
78
47
|
scroll-padding: 28px 0 8px;
|
|
79
48
|
}
|
|
80
49
|
|
|
81
50
|
.mdbase-command-group {
|
|
51
|
+
position: sticky;
|
|
52
|
+
top: -4px;
|
|
53
|
+
z-index: 1;
|
|
54
|
+
background: var(--color-surface-overlay);
|
|
82
55
|
padding: 10px 10px 4px;
|
|
83
56
|
color: var(--color-text-muted);
|
|
84
57
|
font-size: var(--font-size-caption);
|
|
@@ -108,7 +81,9 @@
|
|
|
108
81
|
background: var(--color-selected);
|
|
109
82
|
}
|
|
110
83
|
|
|
111
|
-
.mdbase-command-results button
|
|
84
|
+
.mdbase-command-results > button:active { background: var(--color-border-strong); }
|
|
85
|
+
|
|
86
|
+
.mdbase-command-results .mdbase-command-copy {
|
|
112
87
|
min-width: 0;
|
|
113
88
|
display: flex;
|
|
114
89
|
align-items: baseline;
|
|
@@ -123,11 +98,17 @@
|
|
|
123
98
|
}
|
|
124
99
|
|
|
125
100
|
.mdbase-command-results strong {
|
|
126
|
-
flex: 0
|
|
101
|
+
flex: 0 0 auto;
|
|
102
|
+
max-width: 100%;
|
|
127
103
|
font-size: var(--font-size-ui);
|
|
128
104
|
font-weight: var(--font-weight-medium);
|
|
129
105
|
}
|
|
130
106
|
|
|
107
|
+
.mdbase-command-results mark {
|
|
108
|
+
color: inherit;
|
|
109
|
+
background: var(--accent-soft);
|
|
110
|
+
}
|
|
111
|
+
|
|
131
112
|
.mdbase-command-results small {
|
|
132
113
|
flex: 1 1 auto;
|
|
133
114
|
color: var(--color-text-muted);
|
|
@@ -171,15 +152,7 @@
|
|
|
171
152
|
}
|
|
172
153
|
|
|
173
154
|
@media (max-width: 680px) {
|
|
174
|
-
.mdbase-command-
|
|
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 {
|
|
155
|
+
.mdbase-command-results .mdbase-command-copy {
|
|
183
156
|
display: grid;
|
|
184
157
|
gap: 1px;
|
|
185
158
|
}
|
|
@@ -189,8 +162,12 @@
|
|
|
189
162
|
}
|
|
190
163
|
}
|
|
191
164
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
165
|
+
.mdbase-command-results > button:has(.mdbase-command-icon) { grid-template-columns: 18px minmax(0, 1fr) auto auto; }
|
|
166
|
+
.mdbase-command-icon { display: flex; color: var(--color-text-muted); }
|
|
167
|
+
.mdbase-command-icon svg { width: 18px; height: 18px; }
|
|
168
|
+
|
|
169
|
+
@media (pointer: coarse) {
|
|
170
|
+
.mdbase-command-results kbd,
|
|
171
|
+
.mdbase-command-footer,
|
|
172
|
+
.mdbase-command-alternate { display: none; }
|
|
196
173
|
}
|
package/css/toast.css
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
.mdbase-toaster { position: fixed; bottom:
|
|
2
|
-
.mdbase-toast { display:
|
|
3
|
-
.mdbase-toast
|
|
4
|
-
@
|
|
5
|
-
|
|
6
|
-
|
|
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-overlay); 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 { bottom: max(16px, env(safe-area-inset-bottom)); 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,7 +6,9 @@
|
|
|
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);
|
|
11
|
+
--color-surface-overlay: oklch(100% 0 0);
|
|
10
12
|
--color-surface-subtle: oklch(97% 0.001 286);
|
|
11
13
|
--color-text: oklch(21% 0.006 286);
|
|
12
14
|
--color-text-soft: oklch(37% 0.012 286);
|
|
@@ -49,10 +51,14 @@
|
|
|
49
51
|
/* Six steps: captions, UI chrome, section titles, prose, headings, document titles. */
|
|
50
52
|
--font-size-caption: 12px;
|
|
51
53
|
--font-size-ui: 13px;
|
|
52
|
-
--font-size-section:
|
|
53
|
-
--font-size-prose:
|
|
54
|
-
--font-size-heading:
|
|
55
|
-
--font-size-title:
|
|
54
|
+
--font-size-section: 13px;
|
|
55
|
+
--font-size-prose: 15px;
|
|
56
|
+
--font-size-heading: 20px;
|
|
57
|
+
--font-size-title: 26px;
|
|
58
|
+
--focus-ring: 2px solid var(--color-accent);
|
|
59
|
+
--focus-offset: 3px;
|
|
60
|
+
--palette-width: 600px;
|
|
61
|
+
--palette-top: min(14dvh, 120px);
|
|
56
62
|
--font-weight-regular: 400;
|
|
57
63
|
--font-weight-medium: 500;
|
|
58
64
|
--font-weight-semibold: 600;
|
|
@@ -71,33 +77,14 @@
|
|
|
71
77
|
--space-8: 32px;
|
|
72
78
|
--space-12: 48px;
|
|
73
79
|
--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
80
|
}
|
|
96
81
|
|
|
97
82
|
:root[data-theme="dark"] {
|
|
98
83
|
color-scheme: dark;
|
|
99
84
|
--color-canvas: oklch(18.7% 0.002 286);
|
|
85
|
+
--color-sidebar: oklch(16% 0.002 286);
|
|
100
86
|
--color-surface: oklch(18.7% 0.002 286);
|
|
87
|
+
--color-surface-overlay: oklch(21.4% 0.003 286);
|
|
101
88
|
--color-surface-subtle: oklch(23.6% 0.004 286);
|
|
102
89
|
--color-text: oklch(94.7% 0.003 286);
|
|
103
90
|
--color-text-soft: oklch(82% 0.007 286);
|
|
@@ -140,7 +127,9 @@
|
|
|
140
127
|
:root:not([data-theme]) {
|
|
141
128
|
color-scheme: dark;
|
|
142
129
|
--color-canvas: oklch(18.7% 0.002 286);
|
|
130
|
+
--color-sidebar: oklch(16% 0.002 286);
|
|
143
131
|
--color-surface: oklch(18.7% 0.002 286);
|
|
132
|
+
--color-surface-overlay: oklch(21.4% 0.003 286);
|
|
144
133
|
--color-surface-subtle: oklch(23.6% 0.004 286);
|
|
145
134
|
--color-text: oklch(94.7% 0.003 286);
|
|
146
135
|
--color-text-soft: oklch(82% 0.007 286);
|