@mdbase-dev/ui 0.1.40 → 0.2.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.
package/README.md
CHANGED
|
@@ -333,6 +333,10 @@ import "@mdbase-dev/ui/collections.css";
|
|
|
333
333
|
switcher: a popover, and a bottom sheet below 640px. `icon` puts the app's
|
|
334
334
|
icon before the name, or `icon="mark"` the open collection's initials. In
|
|
335
335
|
the `icon` variant it replaces the folder glyph.
|
|
336
|
+
- `signedOutExtra` is shown under Sign in in the switcher while no account is
|
|
337
|
+
signed in. An app that opens straight into work before connecting never
|
|
338
|
+
shows the gate's signed-out screen, so it puts the signed-out content from
|
|
339
|
+
`extraActions` here as well.
|
|
336
340
|
- Pass `open` and `onOpenChange` to control the switcher; `onOpenChange` is
|
|
337
341
|
called for every open and close it makes itself, controlled or not.
|
|
338
342
|
`variant="none"` renders no trigger, for an app that opens the switcher from
|
package/css/controls.css
CHANGED
|
@@ -1206,6 +1206,27 @@ textarea.mdbase-field {
|
|
|
1206
1206
|
width: min(440px, calc(100vw - 32px));
|
|
1207
1207
|
}
|
|
1208
1208
|
|
|
1209
|
+
/* The dialog sits in the top layer, so it sets its own text size rather than inheriting the page's. */
|
|
1210
|
+
.mdbase-confirm-dialog .mdbase-dialog-body {
|
|
1211
|
+
font-size: var(--font-size-ui);
|
|
1212
|
+
line-height: 1.5;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
.mdbase-confirm-dialog .mdbase-dialog-body p {
|
|
1216
|
+
margin: 0;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
/* A field the confirmation asks for: its label sits just above it. */
|
|
1220
|
+
.mdbase-confirm-dialog .mdbase-dialog-body > label {
|
|
1221
|
+
display: grid;
|
|
1222
|
+
gap: 6px;
|
|
1223
|
+
font-weight: var(--font-weight-medium);
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
.mdbase-confirm-dialog .mdbase-dialog-actions {
|
|
1227
|
+
margin-top: var(--space-2);
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1209
1230
|
/* Save notices: small, quiet, and gone once there is nothing to act on. */
|
|
1210
1231
|
.mdbase-save-notice {
|
|
1211
1232
|
display: inline-flex;
|
|
@@ -3,6 +3,11 @@ import { type RowDialog } from "./parts.js";
|
|
|
3
3
|
import { type CollectionUi, type CollectionUiOptions } from "./use-collection-ui.js";
|
|
4
4
|
export type CollectionSwitcherProps = CollectionUiOptions & {
|
|
5
5
|
readonly className?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Shown under Sign in while no account is signed in, such as an app's
|
|
8
|
+
* advanced way to open a collection without one.
|
|
9
|
+
*/
|
|
10
|
+
readonly signedOutExtra?: ReactNode;
|
|
6
11
|
/**
|
|
7
12
|
* Leading content in the trigger: the app's icon, or "mark" for the open
|
|
8
13
|
* collection's initials. In the "icon" variant it replaces the folder glyph.
|
|
@@ -40,11 +45,12 @@ export type CollectionSwitcherProps = CollectionUiOptions & {
|
|
|
40
45
|
* trigger, so an app can open it from its own control and pass that control's
|
|
41
46
|
* element (or the menu button that held it) as `anchorRef`.
|
|
42
47
|
*/
|
|
43
|
-
export declare function CollectionSwitcher({ variant, className, icon, open: openProp, onOpenChange, anchorRef, ...options }: CollectionSwitcherProps): JSX.Element;
|
|
48
|
+
export declare function CollectionSwitcher({ variant, className, icon, open: openProp, onOpenChange, anchorRef, signedOutExtra, ...options }: CollectionSwitcherProps): JSX.Element;
|
|
44
49
|
/** The switcher's list and actions, also shown inline by `CollectionPanel`. */
|
|
45
|
-
export declare function SwitcherContent({ ui, onDone, onDialog }: {
|
|
50
|
+
export declare function SwitcherContent({ ui, onDone, onDialog, signedOutExtra }: {
|
|
46
51
|
readonly ui: CollectionUi;
|
|
47
52
|
readonly onDone: () => void;
|
|
48
53
|
/** Open a row's dialog (remove from list, delete), for an SDK collection or an app section item. */
|
|
49
54
|
readonly onDialog: (dialog: NonNullable<RowDialog>) => void;
|
|
55
|
+
readonly signedOutExtra?: ReactNode;
|
|
50
56
|
}): JSX.Element;
|
|
@@ -22,6 +22,7 @@ export function CollectionSwitcher({
|
|
|
22
22
|
open: openProp,
|
|
23
23
|
onOpenChange,
|
|
24
24
|
anchorRef,
|
|
25
|
+
signedOutExtra,
|
|
25
26
|
...options
|
|
26
27
|
}) {
|
|
27
28
|
const ui = useCollectionUi(options);
|
|
@@ -61,7 +62,8 @@ export function CollectionSwitcher({
|
|
|
61
62
|
const content = _jsx(SwitcherContent, {
|
|
62
63
|
ui: ui,
|
|
63
64
|
onDone: () => close(false),
|
|
64
|
-
onDialog: toDialog
|
|
65
|
+
onDialog: toDialog,
|
|
66
|
+
signedOutExtra: signedOutExtra
|
|
65
67
|
});
|
|
66
68
|
return _jsxs("span", {
|
|
67
69
|
className: ["mdbase-collections", "mdbase-collections-switcher", className].filter(Boolean).join(" "),
|
|
@@ -120,7 +122,8 @@ export function CollectionSwitcher({
|
|
|
120
122
|
export function SwitcherContent({
|
|
121
123
|
ui,
|
|
122
124
|
onDone,
|
|
123
|
-
onDialog
|
|
125
|
+
onDialog,
|
|
126
|
+
signedOutExtra
|
|
124
127
|
}) {
|
|
125
128
|
const {
|
|
126
129
|
view,
|
|
@@ -154,7 +157,7 @@ export function SwitcherContent({
|
|
|
154
157
|
},
|
|
155
158
|
children: copy.signIn
|
|
156
159
|
})
|
|
157
|
-
})]
|
|
160
|
+
}), signedOutExtra]
|
|
158
161
|
});
|
|
159
162
|
const appSections = sections.map(section => _jsx(SwitcherSection, {
|
|
160
163
|
ui: ui,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdbase-dev/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
"@lingui/format-po": "6.9.0",
|
|
209
209
|
"@lingui/react": "6.9.0",
|
|
210
210
|
"@lingui/vite-plugin": "6.9.0",
|
|
211
|
-
"@mdbase-dev/sdk": "0.1.
|
|
211
|
+
"@mdbase-dev/sdk": "file:../../apps/editor/vendor/sdk-74869d08-production-0.1.41.tgz",
|
|
212
212
|
"@rolldown/plugin-babel": "^0.2.4",
|
|
213
213
|
"@types/jsdom": "^30.0.0",
|
|
214
214
|
"@types/node": "^24.0.0",
|
|
@@ -258,6 +258,6 @@
|
|
|
258
258
|
"typecheck": "node scripts/compile-catalogues.mjs && tsc -p tsconfig.json --noEmit"
|
|
259
259
|
},
|
|
260
260
|
"mdbaseRelease": {
|
|
261
|
-
"commit": "
|
|
261
|
+
"commit": "3dbe26d1b84bc9853d784959b5e5e6bd72639852"
|
|
262
262
|
}
|
|
263
263
|
}
|