@mediaradar/design-components 0.24.0 → 0.25.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/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/check-tailwind-coverage.mjs +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -2444,7 +2444,7 @@ interface PageHeaderProps {
|
|
|
2444
2444
|
*/
|
|
2445
2445
|
declare function PageHeader({ title, description, actions, back, className }: PageHeaderProps): react.JSX.Element;
|
|
2446
2446
|
|
|
2447
|
-
type ModalSize = "sm" | "md" | "lg";
|
|
2447
|
+
type ModalSize = "sm" | "md" | "lg" | "xl";
|
|
2448
2448
|
interface ModalProps {
|
|
2449
2449
|
/** Whether the dialog is showing. */
|
|
2450
2450
|
open: boolean;
|
|
@@ -2454,7 +2454,7 @@ interface ModalProps {
|
|
|
2454
2454
|
title: ReactNode;
|
|
2455
2455
|
/** One line under the title, when the title alone doesn't say enough. */
|
|
2456
2456
|
description?: ReactNode;
|
|
2457
|
-
/** sm 440 for a confirm, md 640 for a form, lg 880 for a table or a list. */
|
|
2457
|
+
/** sm 440 for a confirm, md 640 for a form, lg 880 for a table or a list, xl 1200 for a full workspace. */
|
|
2458
2458
|
size?: ModalSize;
|
|
2459
2459
|
/** The buttons along the bottom, right-aligned -- primary last. */
|
|
2460
2460
|
footer?: ReactNode;
|
|
@@ -2464,12 +2464,14 @@ interface ModalProps {
|
|
|
2464
2464
|
/**
|
|
2465
2465
|
* @pattern Modal
|
|
2466
2466
|
* @description A dialog over a dimmed page: title, optional one-line
|
|
2467
|
-
* description, content, and a footer of buttons.
|
|
2468
|
-
* confirm, md 640 for a form, lg 880 for a table or a list
|
|
2469
|
-
* scrim, which flips with dark mode.
|
|
2467
|
+
* description, content, and a footer of buttons. Four widths -- sm 440 for a
|
|
2468
|
+
* confirm, md 640 for a form, lg 880 for a table or a list, xl 1200 for a
|
|
2469
|
+
* full workspace -- over the warm scrim, which flips with dark mode.
|
|
2470
2470
|
* @variant sm - 440px. A confirm: one question, two buttons.
|
|
2471
2471
|
* @variant md - 640px. Default. A form.
|
|
2472
2472
|
* @variant lg - 880px. A table, a long list, a preview.
|
|
2473
|
+
* @variant xl - 1200px. A full workspace: a column picker, a detail view with
|
|
2474
|
+
* its own tabs or panes, a grid.
|
|
2473
2475
|
* @tokens bg-scrim, z-modal, rounded-card, border-border-default, bg-surface,
|
|
2474
2476
|
* shadow-overlay, text-base, font-semibold, text-text-primary, text-sm,
|
|
2475
2477
|
* text-text-secondary, text-text-tertiary, hover:bg-subtle,
|
|
@@ -2485,12 +2487,12 @@ interface ModalProps {
|
|
|
2485
2487
|
* `description`. The close button is labelled "Close".
|
|
2486
2488
|
* @use for a task the user has to finish or cancel before going back to the
|
|
2487
2489
|
* page: confirm a delete, name a list, pick export options.
|
|
2488
|
-
* @use `sm` for confirms, `md` for forms, `lg` for tables
|
|
2489
|
-
* never a custom width.
|
|
2490
|
+
* @use `sm` for confirms, `md` for forms, `lg` for tables, `xl` only for a
|
|
2491
|
+
* full workspace -- pick by content, never a custom width.
|
|
2490
2492
|
* @use one primary Button, last in `footer`, with a secondary "Cancel" before it.
|
|
2491
2493
|
* @avoid a modal for a message that needs no answer -- use Toast.
|
|
2492
2494
|
* @avoid a modal opened from another modal.
|
|
2493
|
-
* @avoid a `className` width override; if none of the
|
|
2495
|
+
* @avoid a `className` width override; if none of the four fit, raise it as
|
|
2494
2496
|
* a design question.
|
|
2495
2497
|
* @usage
|
|
2496
2498
|
* ```tsx
|
package/dist/index.d.ts
CHANGED
|
@@ -2444,7 +2444,7 @@ interface PageHeaderProps {
|
|
|
2444
2444
|
*/
|
|
2445
2445
|
declare function PageHeader({ title, description, actions, back, className }: PageHeaderProps): react.JSX.Element;
|
|
2446
2446
|
|
|
2447
|
-
type ModalSize = "sm" | "md" | "lg";
|
|
2447
|
+
type ModalSize = "sm" | "md" | "lg" | "xl";
|
|
2448
2448
|
interface ModalProps {
|
|
2449
2449
|
/** Whether the dialog is showing. */
|
|
2450
2450
|
open: boolean;
|
|
@@ -2454,7 +2454,7 @@ interface ModalProps {
|
|
|
2454
2454
|
title: ReactNode;
|
|
2455
2455
|
/** One line under the title, when the title alone doesn't say enough. */
|
|
2456
2456
|
description?: ReactNode;
|
|
2457
|
-
/** sm 440 for a confirm, md 640 for a form, lg 880 for a table or a list. */
|
|
2457
|
+
/** sm 440 for a confirm, md 640 for a form, lg 880 for a table or a list, xl 1200 for a full workspace. */
|
|
2458
2458
|
size?: ModalSize;
|
|
2459
2459
|
/** The buttons along the bottom, right-aligned -- primary last. */
|
|
2460
2460
|
footer?: ReactNode;
|
|
@@ -2464,12 +2464,14 @@ interface ModalProps {
|
|
|
2464
2464
|
/**
|
|
2465
2465
|
* @pattern Modal
|
|
2466
2466
|
* @description A dialog over a dimmed page: title, optional one-line
|
|
2467
|
-
* description, content, and a footer of buttons.
|
|
2468
|
-
* confirm, md 640 for a form, lg 880 for a table or a list
|
|
2469
|
-
* scrim, which flips with dark mode.
|
|
2467
|
+
* description, content, and a footer of buttons. Four widths -- sm 440 for a
|
|
2468
|
+
* confirm, md 640 for a form, lg 880 for a table or a list, xl 1200 for a
|
|
2469
|
+
* full workspace -- over the warm scrim, which flips with dark mode.
|
|
2470
2470
|
* @variant sm - 440px. A confirm: one question, two buttons.
|
|
2471
2471
|
* @variant md - 640px. Default. A form.
|
|
2472
2472
|
* @variant lg - 880px. A table, a long list, a preview.
|
|
2473
|
+
* @variant xl - 1200px. A full workspace: a column picker, a detail view with
|
|
2474
|
+
* its own tabs or panes, a grid.
|
|
2473
2475
|
* @tokens bg-scrim, z-modal, rounded-card, border-border-default, bg-surface,
|
|
2474
2476
|
* shadow-overlay, text-base, font-semibold, text-text-primary, text-sm,
|
|
2475
2477
|
* text-text-secondary, text-text-tertiary, hover:bg-subtle,
|
|
@@ -2485,12 +2487,12 @@ interface ModalProps {
|
|
|
2485
2487
|
* `description`. The close button is labelled "Close".
|
|
2486
2488
|
* @use for a task the user has to finish or cancel before going back to the
|
|
2487
2489
|
* page: confirm a delete, name a list, pick export options.
|
|
2488
|
-
* @use `sm` for confirms, `md` for forms, `lg` for tables
|
|
2489
|
-
* never a custom width.
|
|
2490
|
+
* @use `sm` for confirms, `md` for forms, `lg` for tables, `xl` only for a
|
|
2491
|
+
* full workspace -- pick by content, never a custom width.
|
|
2490
2492
|
* @use one primary Button, last in `footer`, with a secondary "Cancel" before it.
|
|
2491
2493
|
* @avoid a modal for a message that needs no answer -- use Toast.
|
|
2492
2494
|
* @avoid a modal opened from another modal.
|
|
2493
|
-
* @avoid a `className` width override; if none of the
|
|
2495
|
+
* @avoid a `className` width override; if none of the four fit, raise it as
|
|
2494
2496
|
* a design question.
|
|
2495
2497
|
* @usage
|
|
2496
2498
|
* ```tsx
|
package/dist/index.js
CHANGED
|
@@ -4063,7 +4063,10 @@ import { jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
|
4063
4063
|
var WIDTH = {
|
|
4064
4064
|
sm: "max-w-110",
|
|
4065
4065
|
md: "max-w-160",
|
|
4066
|
-
lg: "max-w-220"
|
|
4066
|
+
lg: "max-w-220",
|
|
4067
|
+
// A whole workspace in a dialog: a column picker, a detail view with its
|
|
4068
|
+
// own tabs, a grid of events. 880 squeezed their tables into scrolling.
|
|
4069
|
+
xl: "max-w-300"
|
|
4067
4070
|
};
|
|
4068
4071
|
var FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
4069
4072
|
function Modal({ open, onClose, title, description, size = "md", footer, children, className }) {
|