@fungi.computer/caps 0.5.0 → 0.6.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
@@ -127,6 +127,13 @@ Caps owns interaction and chooses the semantic destination. A null destination
127
127
  waits for the shell root to mount, including during server rendering. Base UI
128
128
  menu, Combobox and dialog portals still accept explicit container overrides.
129
129
 
130
+ `DialogContent` and the composed `DialogPopup` accept `size="fill"` for a
131
+ full-window frame. It fills the portal's fixed-position containing block (the
132
+ viewport by default), without centring or a maximum width, and retains Caps
133
+ padding, radius and material. Omit `size` or use `size="default"` for the
134
+ existing width-limited frame; `DialogContent` centres it. Focus targets and
135
+ Escape ownership are unchanged.
136
+
130
137
  In body mode, isolate the App root so page controls cannot paint over portaled
131
138
  dialogs. Agar's `mountApp` does this. Dialogs and menus rank by portal order;
132
139
  tooltips and toasts use their Stipe layers.
@@ -18,10 +18,15 @@ export declare const DialogTrigger: import("react").ForwardRefExoticComponent<Om
18
18
  export declare const DialogPortal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
19
19
  /** The styled backdrop for a composed Dialog. */
20
20
  export declare const DialogBackdrop: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
21
+ /** Props accepted by DialogPopup. */
22
+ export type DialogPopupProps = BaseDialog.Popup.Props & {
23
+ /** Fill the portal's positioning context instead of using the default width. */
24
+ size?: "default" | "fill";
25
+ };
21
26
  /** The styled popup with Base UI composition and caller-controlled focus targets. */
22
- export declare const DialogPopup: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPopupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
27
+ export declare const DialogPopup: import("react").ForwardRefExoticComponent<Omit<DialogPopupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
23
28
  /** Props accepted by DialogContent. */
24
- export type DialogContentProps = BaseDialog.Popup.Props & Pick<BaseDialog.Portal.Props, "container" | "keepMounted">;
29
+ export type DialogContentProps = DialogPopupProps & Pick<BaseDialog.Portal.Props, "container" | "keepMounted">;
25
30
  /**
26
31
  * The default portal, backdrop and popup composition for a Dialog.
27
32
  * Keeps child state across closes. Like Base UI, only full modal mode has a backdrop.
@@ -39,17 +39,20 @@ export const DialogBackdrop = forwardRef(function DialogBackdrop({ className, ..
39
39
  return (_jsx(BaseDialog.Backdrop, { ...props, ref: ref, className: (state) => cn("caps-dialog-backdrop fixed inset-0 bg-black/40", resolveClassName(className, state)) }));
40
40
  });
41
41
  /** The styled popup with Base UI composition and caller-controlled focus targets. */
42
- export const DialogPopup = forwardRef(function DialogPopup({ className, finalFocus, ...props }, ref) {
42
+ export const DialogPopup = forwardRef(function DialogPopup({ className, finalFocus, size = "default", ...props }, ref) {
43
43
  const dialog = useDialogContext();
44
- return (_jsx(BaseDialog.Popup, { ...props, className: (state) => cn("caps-dialog-popup max-h-screen w-11/12 max-w-(--container-lg) overflow-y-auto overscroll-contain rounded-box bg-base-100 p-lg text-base-content shadow-xl", resolveClassName(className, state)), finalFocus: dialog.interactionOwner === "host" ? false : (finalFocus ?? true), ref: ref }));
44
+ return (_jsx(BaseDialog.Popup, { ...props, "data-size": size, className: (state) => cn("caps-dialog-popup overflow-y-auto overscroll-contain rounded-box bg-base-100 p-lg text-base-content shadow-xl", size === "fill"
45
+ ? "fixed inset-0 h-full w-full max-w-none"
46
+ : "max-h-screen w-11/12 max-w-(--container-lg)", resolveClassName(className, state)), finalFocus: dialog.interactionOwner === "host" ? false : (finalFocus ?? true), ref: ref }));
45
47
  });
46
48
  /**
47
49
  * The default portal, backdrop and popup composition for a Dialog.
48
50
  * Keeps child state across closes. Like Base UI, only full modal mode has a backdrop.
49
51
  */
50
- export const DialogContent = forwardRef(function DialogContent({ container, keepMounted = true, className, ...props }, ref) {
52
+ export const DialogContent = forwardRef(function DialogContent({ container, keepMounted = true, className, size = "default", ...props }, ref) {
51
53
  const { modal } = useDialogContext();
52
- return (_jsxs(DialogPortal, { container: container, keepMounted: keepMounted, children: [modal === true ? _jsx(DialogBackdrop, {}) : null, _jsx(DialogPopup, { ...props, className: (state) => cn("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", resolveClassName(className, state)), ref: ref })] }));
54
+ return (_jsxs(DialogPortal, { container: container, keepMounted: keepMounted, children: [modal === true ? _jsx(DialogBackdrop, {}) : null, _jsx(DialogPopup, { ...props, size: size, className: (state) => cn(size === "default" &&
55
+ "fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", resolveClassName(className, state)), ref: ref })] }));
53
56
  });
54
57
  /** A footer layout for caller-provided Dialog actions. */
55
58
  export function DialogFooter({ className, ...props }) {
@@ -62,10 +62,26 @@ Props accepted by Dialog.
62
62
 
63
63
  ---
64
64
 
65
+ ### DialogPopupProps
66
+
67
+ ```ts
68
+ type DialogPopupProps = BaseDialog.Popup.Props & object;
69
+ ```
70
+
71
+ Props accepted by DialogPopup.
72
+
73
+ #### Type Declaration
74
+
75
+ | Name | Type | Description |
76
+ | ------- | ----------------------- | ------------------------------------------------------------------------- |
77
+ | `size?` | `"default"` \| `"fill"` | Fill the portal's positioning context instead of using the default width. |
78
+
79
+ ---
80
+
65
81
  ### DialogContentProps
66
82
 
67
83
  ```ts
68
- type DialogContentProps = BaseDialog.Popup.Props &
84
+ type DialogContentProps = DialogPopupProps &
69
85
  Pick<BaseDialog.Portal.Props, "container" | "keepMounted">;
70
86
  ```
71
87
 
@@ -79,6 +79,7 @@ Props accepted by FieldSet.
79
79
  | Name | Type | Description |
80
80
  | -------------- | ----------- | ----------------------------------------------------------------- |
81
81
  | `legend` | `ReactNode` | - |
82
+ | `legendTitle?` | `string` | Full legend on hover when a columns form clips it to one line. |
82
83
  | `description?` | `ReactNode` | - |
83
84
  | `layout?` | `"columns"` | Opt-in label/control grid when used without a Form parent. |
84
85
  | `error?` | `ReactNode` | The group's announced error, such as "Choose at least one right". |
@@ -103,6 +104,7 @@ Props accepted by Field.
103
104
  | `error?` | `ReactNode` | - |
104
105
  | `icon?` | `ReactNode` | A decorative marker, such as a Sigil or App icon, before the label. It is hidden from assistive tech; the label stays the control's name. |
105
106
  | `label?` | `ReactNode` | - |
107
+ | `labelTitle?` | `string` | Full label on hover when a columns form clips it to one line. |
106
108
  | `orientation?` | `"horizontal"` \| `"inline"` \| `"vertical"` | `vertical` stacks label, control and error; `horizontal` puts the control opposite its copy (settings rows); `inline` puts a checkbox or switch before its copy. |
107
109
  | `optional?` | `boolean` | Marks an optional field in a mostly required form. |
108
110
  | `readout?` | `boolean` | The child is a read-only readout, such as a Status, not a control: the label names the row and nothing is wired to the child. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/caps",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "description": "Product-neutral React primitives and blocks for Fungi interfaces",
6
6
  "type": "module",
@@ -493,7 +493,7 @@
493
493
  "typescript": "5.9.3",
494
494
  "vite": "8.2.2",
495
495
  "vitest": "4.1.11",
496
- "@fungi.computer/sigils": "0.2.0",
496
+ "@fungi.computer/sigils": "0.2.1",
497
497
  "postcss-value-parser": "4.2.0",
498
498
  "@tanstack/react-form": "1.33.2",
499
499
  "effect": "4.0.2",
@@ -588,7 +588,7 @@
588
588
  "format:check": "node ../../tooling/repository/scripts/format-package-check.mjs",
589
589
  "lint:anti-slop": "node ../../tooling/repository/scripts/lint-package-anti-slop.mjs",
590
590
  "build:workbench": "node scripts/workbench-build.mjs --prepared",
591
- "test:nightly": "node --import tsx ../../tooling/repository/scripts/workbench-proofs.mjs --output ../../.botanical/caps-workbench --origin-env CAPS_WORKBENCH_URL test/screen-theme.browser.mjs test/scroll-area.browser.mjs test/display-density.browser.mjs test/resize-handle.browser.mjs && node test/scroll-gutter.browser.mjs",
591
+ "test:nightly": "node --import tsx ../../tooling/repository/scripts/workbench-proofs.mjs --output ../../.botanical/caps-workbench --origin-env CAPS_WORKBENCH_URL test/screen-theme.browser.mjs test/scroll-area.browser.mjs test/display-density.browser.mjs test/resize-handle.browser.mjs test/dialog-fill.browser.mjs && node test/scroll-gutter.browser.mjs",
592
592
  "test:code-input": "node --import tsx ../../tooling/repository/scripts/workbench-proofs.mjs --output ../../.botanical/caps-code-input --origin-env CAPS_WORKBENCH_URL test/code-input.browser.mjs",
593
593
  "test:icon-choice": "node --import tsx ../../tooling/repository/scripts/workbench-proofs.mjs --output ../../.botanical/caps-icon-choice --origin-env CAPS_WORKBENCH_URL test/icon-choice.browser.mjs",
594
594
  "test:choice-label-alignment": "node --import tsx ../../tooling/repository/scripts/workbench-proofs.mjs --output ../../.botanical/caps-choice-alignment --origin-env CAPS_WORKBENCH_URL test/choice-label-alignment.browser.mjs",