@fungi.computer/caps 0.9.0 → 0.10.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.
@@ -20,6 +20,8 @@ export type SetupNoticeProps = Omit<HTMLAttributes<HTMLElement>, "title" | "chil
20
20
  secondary?: SetupNoticeAction;
21
21
  /** What still works meanwhile, such as "Uploads work now". */
22
22
  available?: ReactNode;
23
+ /** The panel's own glyph (an App icon, say) in place of the warning bead; ignored by `banner` and `inline`. */
24
+ visual?: Exclude<ReactNode, string>;
23
25
  /** Names what is awaited while pending, after "Waiting for". */
24
26
  waitingFor?: string;
25
27
  /** `panel` replaces an empty state; `banner` and `inline` sit above or in content. */
@@ -29,4 +31,4 @@ export type SetupNoticeProps = Omit<HTMLAttributes<HTMLElement>, "title" | "chil
29
31
  * Missing setup, named with its fix. Render it only while the setup fact is
30
32
  * missing; when the fact turns ready the host unmounts it (and may toast).
31
33
  */
32
- export declare function SetupNotice({ available, cause, className, fix, need, secondary, variant, waitingFor, ...props }: SetupNoticeProps): import("react/jsx-runtime").JSX.Element;
34
+ export declare function SetupNotice({ available, cause, className, fix, need, secondary, variant, visual, waitingFor, ...props }: SetupNoticeProps): import("react/jsx-runtime").JSX.Element;
@@ -8,7 +8,7 @@ import { EmptyState } from "./empty-state.js";
8
8
  * Missing setup, named with its fix. Render it only while the setup fact is
9
9
  * missing; when the fact turns ready the host unmounts it (and may toast).
10
10
  */
11
- export function SetupNotice({ available, cause, className, fix, need, secondary, variant, waitingFor = "setup", ...props }) {
11
+ export function SetupNotice({ available, cause, className, fix, need, secondary, variant, visual, waitingFor = "setup", ...props }) {
12
12
  const pending = fix.pending === true;
13
13
  const label = pending ? `Waiting for ${waitingFor}…` : fix.label;
14
14
  const detail = available ? (_jsxs(_Fragment, { children: [cause, " ", _jsx("span", { className: "caps-setup-notice-available", children: available })] })) : (cause);
@@ -17,7 +17,7 @@ export function SetupNotice({ available, cause, className, fix, need, secondary,
17
17
  label,
18
18
  onSelect: fix.onSelect,
19
19
  pending,
20
- }, title: need, variant: "panel", visual: _jsx(Status, { className: "caps-setup-notice-dot", glyph: "dot", tone: "warning" }) }));
20
+ }, title: need, variant: "panel", visual: visual ?? (_jsx(Status, { className: "caps-setup-notice-dot", glyph: "dot", tone: "warning" })) }));
21
21
  }
22
22
  return (_jsx("div", { className: "caps-setup-notice-frame", children: _jsx(Alert, { ...props, action: _jsxs("span", { className: "caps-setup-notice-actions", children: [secondary ? (_jsx(Button, { size: "sm", variant: "ghost", onClick: secondary.onSelect, children: secondary.label })) : null, _jsx(Button, { loading: pending, size: "sm", variant: "outline", onClick: fix.onSelect, children: label })] }), className: cn("caps-setup-notice", className), "data-variant": variant, description: detail, role: "status", title: _jsxs("span", { className: "caps-setup-notice-title", children: [_jsx(Status, { glyph: "dot", tone: "warning" }), need] }), tone: "warning" }) }));
23
23
  }
@@ -50,15 +50,16 @@ Props accepted by SetupNotice.
50
50
 
51
51
  #### Type Declaration
52
52
 
53
- | Name | Type | Description |
54
- | ------------- | ----------------------------------------- | ------------------------------------------------------------------------------- |
55
- | `need` | `ReactNode` | The title, such as "Connect a model to start chatting". |
56
- | `cause` | `ReactNode` | One sentence naming the real cause. |
57
- | `fix` | [`SetupNoticeFix`](#setupnoticefix) | The one primary fix; never a dead CTA. |
58
- | `secondary?` | [`SetupNoticeAction`](#setupnoticeaction) | - |
59
- | `available?` | `ReactNode` | What still works meanwhile, such as "Uploads work now". |
60
- | `waitingFor?` | `string` | Names what is awaited while pending, after "Waiting for". |
61
- | `variant` | `"panel"` \| `"inline"` \| `"banner"` | `panel` replaces an empty state; `banner` and `inline` sit above or in content. |
53
+ | Name | Type | Description |
54
+ | ------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------- |
55
+ | `need` | `ReactNode` | The title, such as "Connect a model to start chatting". |
56
+ | `cause` | `ReactNode` | One sentence naming the real cause. |
57
+ | `fix` | [`SetupNoticeFix`](#setupnoticefix) | The one primary fix; never a dead CTA. |
58
+ | `secondary?` | [`SetupNoticeAction`](#setupnoticeaction) | - |
59
+ | `available?` | `ReactNode` | What still works meanwhile, such as "Uploads work now". |
60
+ | `visual?` | `Exclude`\<`ReactNode`, `string`\> | The panel's own glyph (an App icon, say) in place of the warning bead; ignored by `banner` and `inline`. |
61
+ | `waitingFor?` | `string` | Names what is awaited while pending, after "Waiting for". |
62
+ | `variant` | `"panel"` \| `"inline"` \| `"banner"` | `panel` replaces an empty state; `banner` and `inline` sit above or in content. |
62
63
 
63
64
  ## Functions
64
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/caps",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "description": "Product-neutral React primitives and blocks for Fungi interfaces",
6
6
  "type": "module",