@mdbase-dev/ui 0.1.40 → 0.1.41

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
@@ -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.1.40",
3
+ "version": "0.1.41",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -258,6 +258,6 @@
258
258
  "typecheck": "node scripts/compile-catalogues.mjs && tsc -p tsconfig.json --noEmit"
259
259
  },
260
260
  "mdbaseRelease": {
261
- "commit": "6597d7342d2187562c82d05af6a609643f9c383a"
261
+ "commit": "74869d0822543c9a4d4621d9c3ee40d6a79b6fd6"
262
262
  }
263
263
  }