@volter/world-console 2.0.13 → 2.0.15

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.
@@ -185,6 +185,10 @@ section > h2:first-child, section > h3:first-child { margin-top: 0; }
185
185
  /* ── the shared conventions: dialogs, confirmations, toasts, skeletons, menus, meters, tabs, the phone's drawer ── */
186
186
  dialog.dialog { padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--volter-shadow-dialog); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
187
187
  dialog.dialog.wide { width: min(720px, calc(100vw - 32px)); }
188
+ dialog.dialog.window { width: min(1040px, calc(100vw - 48px)); height: min(720px, calc(100vh - 48px)); overflow: hidden; }
189
+ dialog.dialog.window[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
190
+ dialog.dialog.window .dialog-head { padding: 14px 20px; border-bottom: 1px solid var(--line); }
191
+ dialog.dialog.window .dialog-body { padding: 0; min-height: 0; display: block; }
188
192
  dialog.dialog::backdrop { background: var(--volter-overlay-scrim); }
189
193
  dialog.dialog[open] { animation: dialog-in var(--volter-motion-fast, 140ms) ease-out; }
190
194
  @keyframes dialog-in { from { opacity: 0; transform: translateY(6px) scale(0.99); } to { opacity: 1; transform: none; } }
@@ -127,7 +127,7 @@ export function MenuDismiss(): null {
127
127
  // ── dialogs, confirmations and toasts: the conventions every page shares ─────────────────────────────────────────────
128
128
  /** A modal dialog: the browser's own (`<dialog>` shown modal), so focus stays in it, Esc closes it and the page behind is
129
129
  * inert; labelled by its title. A press on the backdrop closes it too. */
130
- export function Dialog({ open, onClose, title, children, footer, wide }: { open: boolean; onClose: () => void; title: React.ReactNode; children: React.ReactNode; footer?: React.ReactNode; wide?: boolean }): React.JSX.Element {
130
+ export function Dialog({ open, onClose, title, children, footer, wide }: { open: boolean; onClose: () => void; title: React.ReactNode; children: React.ReactNode; footer?: React.ReactNode; /** wider for a table; `window`: an app's settings window, its tabs beside its pane */ wide?: boolean | 'window' }): React.JSX.Element {
131
131
  const ref = useRef<HTMLDialogElement>(null); const id = useId();
132
132
  // opening moves focus to the dialog's first control (its Close); the first field of its body is where a person types
133
133
  useEffect(() => {
@@ -142,7 +142,7 @@ export function Dialog({ open, onClose, title, children, footer, wide }: { open:
142
142
  if (!open && d.open) d.close();
143
143
  }, [open]);
144
144
  return (
145
- <dialog ref={ref} className={wide ? 'dialog wide' : 'dialog'} aria-labelledby={id} onClose={onClose} onCancel={(e) => { e.preventDefault(); onClose(); }} onMouseDown={(e) => { if (e.target === ref.current) onClose(); }}>
145
+ <dialog ref={ref} className={wide === 'window' ? 'dialog window' : wide ? 'dialog wide' : 'dialog'} aria-labelledby={id} onClose={onClose} onCancel={(e) => { e.preventDefault(); onClose(); }} onMouseDown={(e) => { if (e.target === ref.current) onClose(); }}>
146
146
  {open ? <>
147
147
  <div className="dialog-head"><h2 id={id}>{title}</h2><button type="button" className="icon-button" aria-label="Close" onClick={onClose}>✕</button></div>
148
148
  <div className="dialog-body">{children}</div>