shelving 1.219.0 → 1.220.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/package.json +1 -1
- package/ui/app/App.d.ts +3 -3
- package/ui/app/App.tsx +3 -4
- package/ui/block/Address.d.ts +3 -3
- package/ui/block/Address.tsx +3 -4
- package/ui/block/Block.d.ts +3 -3
- package/ui/block/Block.tsx +3 -4
- package/ui/block/Blockquote.d.ts +3 -3
- package/ui/block/Blockquote.tsx +3 -4
- package/ui/block/Card.d.ts +1 -2
- package/ui/block/Card.tsx +1 -3
- package/ui/block/Definitions.d.ts +3 -5
- package/ui/block/Definitions.tsx +3 -5
- package/ui/block/Figure.d.ts +2 -2
- package/ui/block/Figure.tsx +2 -2
- package/ui/block/Flex.d.ts +3 -3
- package/ui/block/Flex.tsx +3 -4
- package/ui/block/Heading.d.ts +3 -4
- package/ui/block/Heading.tsx +3 -4
- package/ui/block/Paragraph.d.ts +3 -3
- package/ui/block/Paragraph.tsx +3 -3
- package/ui/block/Preformatted.d.ts +3 -3
- package/ui/block/Preformatted.tsx +3 -3
- package/ui/block/Prose.d.ts +3 -3
- package/ui/block/Prose.tsx +3 -4
- package/ui/block/Section.d.ts +3 -3
- package/ui/block/Section.tsx +3 -3
- package/ui/block/Table.d.ts +2 -3
- package/ui/block/Table.tsx +2 -4
- package/ui/block/Video.d.ts +5 -7
- package/ui/block/Video.tsx +5 -8
- package/ui/dialog/Dialog.d.ts +4 -5
- package/ui/dialog/Dialog.tsx +4 -6
- package/ui/dialog/Dialogs.d.ts +2 -2
- package/ui/dialog/Dialogs.tsx +2 -3
- package/ui/dialog/Modal.d.ts +4 -4
- package/ui/dialog/Modal.tsx +3 -4
- package/ui/form/CheckboxInput.d.ts +3 -3
- package/ui/form/CheckboxInput.tsx +3 -4
- package/ui/form/Clickable.d.ts +2 -3
- package/ui/form/Clickable.tsx +2 -3
- package/ui/form/Field.d.ts +2 -2
- package/ui/form/Field.tsx +2 -2
- package/ui/form/Form.d.ts +2 -7
- package/ui/form/Form.tsx +2 -7
- package/ui/form/FormFooter.d.ts +2 -2
- package/ui/form/FormFooter.tsx +2 -2
- package/ui/form/Input.d.ts +3 -4
- package/ui/form/Input.tsx +3 -2
- package/ui/form/OutputInput.d.ts +3 -3
- package/ui/form/OutputInput.tsx +3 -4
- package/ui/form/RadioInput.d.ts +3 -3
- package/ui/form/RadioInput.tsx +3 -4
- package/ui/form/SchemaInput.d.ts +3 -3
- package/ui/form/SchemaInput.tsx +3 -4
- package/ui/form/SubmitButton.d.ts +3 -3
- package/ui/form/SubmitButton.tsx +3 -4
- package/ui/inline/Code.d.ts +6 -9
- package/ui/inline/Code.tsx +6 -13
- package/ui/inline/Deleted.d.ts +3 -3
- package/ui/inline/Deleted.tsx +3 -4
- package/ui/inline/Emphasis.d.ts +3 -3
- package/ui/inline/Emphasis.tsx +3 -4
- package/ui/inline/Inserted.d.ts +3 -3
- package/ui/inline/Inserted.tsx +3 -4
- package/ui/inline/Mark.d.ts +3 -3
- package/ui/inline/Mark.tsx +3 -4
- package/ui/inline/Small.d.ts +3 -3
- package/ui/inline/Small.tsx +3 -4
- package/ui/inline/Strong.d.ts +3 -3
- package/ui/inline/Strong.tsx +3 -4
- package/ui/inline/Subscript.d.ts +3 -3
- package/ui/inline/Subscript.tsx +3 -4
- package/ui/inline/Superscript.d.ts +3 -3
- package/ui/inline/Superscript.tsx +3 -4
- package/ui/inline/When.d.ts +3 -3
- package/ui/inline/When.tsx +3 -3
- package/ui/layout/CenteredLayout.d.ts +3 -3
- package/ui/layout/CenteredLayout.tsx +3 -3
- package/ui/layout/SidebarLayout.d.ts +2 -3
- package/ui/layout/SidebarLayout.tsx +2 -3
- package/ui/menu/Menu.d.ts +2 -2
- package/ui/menu/Menu.tsx +2 -3
- package/ui/misc/Catcher.d.ts +5 -8
- package/ui/misc/Catcher.js +0 -1
- package/ui/misc/Catcher.tsx +5 -11
- package/ui/misc/Mapper.d.ts +3 -3
- package/ui/misc/Mapper.tsx +2 -2
- package/ui/misc/MetaContext.d.ts +2 -3
- package/ui/misc/MetaContext.tsx +3 -4
- package/ui/misc/Tag.d.ts +1 -2
- package/ui/misc/Tag.tsx +2 -4
- package/ui/notice/Message.d.ts +0 -2
- package/ui/notice/Message.tsx +0 -2
- package/ui/notice/Notice.d.ts +3 -4
- package/ui/notice/Notice.tsx +3 -4
- package/ui/page/HTML.d.ts +3 -3
- package/ui/page/HTML.tsx +3 -4
- package/ui/page/Page.d.ts +3 -3
- package/ui/page/Page.tsx +3 -4
- package/ui/router/Navigation.d.ts +4 -5
- package/ui/router/Navigation.tsx +4 -7
- package/ui/transition/Transition.d.ts +3 -3
- package/ui/transition/Transition.tsx +3 -3
- package/ui/tree/TreeApp.d.ts +3 -4
- package/ui/tree/TreeApp.tsx +3 -4
- package/ui/util/README.md +13 -0
- package/ui/util/index.d.ts +1 -0
- package/ui/util/index.js +1 -0
- package/ui/util/index.ts +1 -0
- package/ui/util/props.d.ts +9 -0
- package/ui/util/props.js +1 -0
- package/ui/util/props.ts +11 -0
- package/util/equal.js +1 -1
- package/util/number.js +1 -1
package/package.json
CHANGED
package/ui/app/App.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ReactElement
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
2
|
import type { PossibleMeta } from "../util/index.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import type { ChildProps } from "../util/props.js";
|
|
4
|
+
export interface AppProps extends PossibleMeta, ChildProps {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Root component for an application.
|
package/ui/app/App.tsx
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { type ReactElement,
|
|
1
|
+
import { type ReactElement, useEffect } from "react";
|
|
2
2
|
import { MetaContext, requireMeta } from "../misc/MetaContext.js";
|
|
3
3
|
import type { PossibleMeta } from "../util/index.js";
|
|
4
|
+
import type { ChildProps } from "../util/props.js";
|
|
4
5
|
import APP_CSS from "./App.module.css";
|
|
5
6
|
|
|
6
|
-
export interface AppProps extends PossibleMeta {
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
}
|
|
7
|
+
export interface AppProps extends PossibleMeta, ChildProps {}
|
|
9
8
|
|
|
10
9
|
const APP_CLASS = APP_CSS.app;
|
|
11
10
|
|
package/ui/block/Address.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
2
|
import { type AddressData } from "../../schema/AddressSchema.js";
|
|
3
3
|
import type { Nullish } from "../../util/null.js";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import type { ChildProps } from "../util/props.js";
|
|
5
|
+
export interface AddressProps extends ChildProps {
|
|
6
6
|
}
|
|
7
7
|
export interface PhysicalAddressProps {
|
|
8
8
|
name?: Nullish<string>;
|
package/ui/block/Address.tsx
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
2
|
import { type AddressData, formatAddress } from "../../schema/AddressSchema.js";
|
|
3
3
|
import type { Nullish } from "../../util/null.js";
|
|
4
4
|
import { Small } from "../inline/Small.js";
|
|
5
5
|
import { Strong } from "../inline/Strong.js";
|
|
6
|
+
import type { ChildProps } from "../util/props.js";
|
|
6
7
|
import styles from "./Address.module.css";
|
|
7
8
|
|
|
8
|
-
export interface AddressProps {
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
}
|
|
9
|
+
export interface AddressProps extends ChildProps {}
|
|
11
10
|
|
|
12
11
|
export interface PhysicalAddressProps {
|
|
13
12
|
name?: Nullish<string>;
|
package/ui/block/Block.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
2
3
|
export declare const BLOCK_CLASS: string | undefined;
|
|
3
4
|
/** Variants for elements. */
|
|
4
|
-
export interface BlockProps {
|
|
5
|
-
children?: ReactNode;
|
|
5
|
+
export interface BlockProps extends OptionalChildProps {
|
|
6
6
|
}
|
|
7
7
|
/** A single `<div>` element with element spacing. */
|
|
8
8
|
export declare function Block({ children }: BlockProps): ReactElement;
|
package/ui/block/Block.tsx
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
2
|
import { getModuleClass } from "../util/css.js";
|
|
3
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
4
|
import BLOCK_CSS from "./Block.module.css";
|
|
4
5
|
|
|
5
6
|
export const BLOCK_CLASS = getModuleClass(BLOCK_CSS, "block");
|
|
6
7
|
|
|
7
8
|
/** Variants for elements. */
|
|
8
|
-
export interface BlockProps {
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
}
|
|
9
|
+
export interface BlockProps extends OptionalChildProps {}
|
|
11
10
|
|
|
12
11
|
/** A single `<div>` element with element spacing. */
|
|
13
12
|
export function Block({ children }: BlockProps): ReactElement {
|
package/ui/block/Blockquote.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReactElement
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
|
+
export interface BlockquoteProps extends OptionalChildProps {
|
|
4
4
|
}
|
|
5
5
|
export declare function Blockquote({ children }: BlockquoteProps): ReactElement;
|
package/ui/block/Blockquote.tsx
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
2
3
|
import styles from "./Blockquote.module.css";
|
|
3
4
|
|
|
4
|
-
export interface BlockquoteProps {
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
}
|
|
5
|
+
export interface BlockquoteProps extends OptionalChildProps {}
|
|
7
6
|
|
|
8
7
|
export function Blockquote({ children }: BlockquoteProps): ReactElement {
|
|
9
8
|
return <blockquote className={styles.blockquote}>{children}</blockquote>;
|
package/ui/block/Card.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
2
|
import { type ClickableProps } from "../form/Clickable.js";
|
|
3
3
|
import { type ColorVariants } from "../misc/Color.js";
|
|
4
4
|
import { type Status } from "../misc/Status.js";
|
|
5
5
|
export interface CardProps extends ClickableProps, ColorVariants {
|
|
6
|
-
children?: ReactNode;
|
|
7
6
|
/** Constrain the card to narrow width (defaults to full-width). */
|
|
8
7
|
narrow?: boolean | undefined;
|
|
9
8
|
/** Constrain the card to wide width (defaults to full-width). */
|
package/ui/block/Card.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
2
|
import { Clickable, type ClickableProps } from "../form/Clickable.js";
|
|
3
3
|
import { type ColorVariants, getColorClass } from "../misc/Color.js";
|
|
4
4
|
import { getStatusClass, type Status } from "../misc/Status.js";
|
|
@@ -6,8 +6,6 @@ import { getClass, getModuleClass } from "../util/css.js";
|
|
|
6
6
|
import CARD_CSS from "./Card.module.css";
|
|
7
7
|
|
|
8
8
|
export interface CardProps extends ClickableProps, ColorVariants {
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
|
|
11
9
|
/** Constrain the card to narrow width (defaults to full-width). */
|
|
12
10
|
narrow?: boolean | undefined;
|
|
13
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
|
+
export interface DefinitionsProps extends OptionalChildProps {
|
|
4
4
|
/** Lay out each term/value pair side-by-side instead of stacked (collapses to stacked at narrow widths). */
|
|
5
5
|
row?: boolean | undefined;
|
|
6
6
|
}
|
|
@@ -16,11 +16,9 @@ export interface DefinitionsProps {
|
|
|
16
16
|
* </Definitions>
|
|
17
17
|
*/
|
|
18
18
|
export declare function Definitions({ children, ...variants }: DefinitionsProps): ReactElement;
|
|
19
|
-
export interface DefinitionProps {
|
|
19
|
+
export interface DefinitionProps extends OptionalChildProps {
|
|
20
20
|
/** The term — what's being defined. Rendered as `<dt>`. */
|
|
21
21
|
term: ReactNode;
|
|
22
|
-
/** The value — the definition. Rendered as `<dd>`. */
|
|
23
|
-
children?: ReactNode;
|
|
24
22
|
}
|
|
25
23
|
/**
|
|
26
24
|
* A single term/value pair within a `<Definitions>` list.
|
package/ui/block/Definitions.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { getModuleClass } from "../util/css.js";
|
|
3
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
4
|
import styles from "./Definitions.module.css";
|
|
4
5
|
|
|
5
|
-
export interface DefinitionsProps {
|
|
6
|
-
children?: ReactNode;
|
|
6
|
+
export interface DefinitionsProps extends OptionalChildProps {
|
|
7
7
|
/** Lay out each term/value pair side-by-side instead of stacked (collapses to stacked at narrow widths). */
|
|
8
8
|
row?: boolean | undefined;
|
|
9
9
|
}
|
|
@@ -23,11 +23,9 @@ export function Definitions({ children, ...variants }: DefinitionsProps): ReactE
|
|
|
23
23
|
return <dl className={getModuleClass(styles, "definitions", variants)}>{children}</dl>;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export interface DefinitionProps {
|
|
26
|
+
export interface DefinitionProps extends OptionalChildProps {
|
|
27
27
|
/** The term — what's being defined. Rendered as `<dt>`. */
|
|
28
28
|
term: ReactNode;
|
|
29
|
-
/** The value — the definition. Rendered as `<dd>`. */
|
|
30
|
-
children?: ReactNode;
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
/**
|
package/ui/block/Figure.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
|
+
export interface FigureProps extends OptionalChildProps {
|
|
4
4
|
caption?: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare function Figure({ children, caption }: FigureProps): ReactElement;
|
package/ui/block/Figure.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
2
3
|
import styles from "./Figure.module.css";
|
|
3
4
|
|
|
4
|
-
export interface FigureProps {
|
|
5
|
-
children?: ReactNode;
|
|
5
|
+
export interface FigureProps extends OptionalChildProps {
|
|
6
6
|
caption?: ReactNode;
|
|
7
7
|
}
|
|
8
8
|
|
package/ui/block/Flex.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
2
3
|
import FLEX_CSS from "./Flex.module.css";
|
|
3
4
|
/** Variants for flex areas. */
|
|
4
5
|
export interface FlexVariants {
|
|
@@ -19,8 +20,7 @@ export interface FlexVariants {
|
|
|
19
20
|
/** Reverse the order of the elements. */
|
|
20
21
|
reverse?: boolean | undefined;
|
|
21
22
|
}
|
|
22
|
-
export interface FlexProps extends FlexVariants {
|
|
23
|
-
children?: ReactNode | undefined;
|
|
23
|
+
export interface FlexProps extends FlexVariants, OptionalChildProps {
|
|
24
24
|
}
|
|
25
25
|
/** Block with flex children. */
|
|
26
26
|
export declare function Flex({ children, ...variants }: FlexProps): ReactElement;
|
package/ui/block/Flex.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
2
|
import { getClass, getModuleClass } from "../util/css.js";
|
|
3
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
4
|
import { BLOCK_CLASS } from "./Block.js";
|
|
4
5
|
import FLEX_CSS from "./Flex.module.css";
|
|
5
6
|
|
|
@@ -23,9 +24,7 @@ export interface FlexVariants {
|
|
|
23
24
|
reverse?: boolean | undefined;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
export interface FlexProps extends FlexVariants {
|
|
27
|
-
children?: ReactNode | undefined;
|
|
28
|
-
}
|
|
27
|
+
export interface FlexProps extends FlexVariants, OptionalChildProps {}
|
|
29
28
|
|
|
30
29
|
/** Block with flex children. */
|
|
31
30
|
export function Flex({ children, ...variants }: FlexProps): ReactElement {
|
package/ui/block/Heading.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { ChildProps } from "../util/props.js";
|
|
2
3
|
/** Props shared by `Title`, `Heading`, and `Subheading`. */
|
|
3
|
-
export interface HeadingProps {
|
|
4
|
+
export interface HeadingProps extends ChildProps {
|
|
4
5
|
/**
|
|
5
6
|
* Heading level (`1`–`6`) — sets the rendered `<h1>`–`<h6>` tag.
|
|
6
7
|
* Avoid overriding this in practice: pick the component that matches the level — `Title` (`<h1>`), `Heading` (`<h2>`), or `Subheading` (`<h3>`) — so the visual size and the document outline stay in step.
|
|
7
8
|
*/
|
|
8
9
|
level?: "1" | "2" | "3" | "4" | "5" | "6" | 1 | 2 | 3 | 4 | 5 | 6;
|
|
9
|
-
/** Heading content. */
|
|
10
|
-
children: ReactNode;
|
|
11
10
|
}
|
|
12
11
|
/**
|
|
13
12
|
* Section heading — renders an `<h2>`.
|
package/ui/block/Heading.tsx
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
2
|
import { getModuleClass } from "../util/css.js";
|
|
3
|
+
import type { ChildProps } from "../util/props.js";
|
|
3
4
|
import styles from "./Heading.module.css";
|
|
4
5
|
|
|
5
6
|
/** Props shared by `Title`, `Heading`, and `Subheading`. */
|
|
6
|
-
export interface HeadingProps {
|
|
7
|
+
export interface HeadingProps extends ChildProps {
|
|
7
8
|
/**
|
|
8
9
|
* Heading level (`1`–`6`) — sets the rendered `<h1>`–`<h6>` tag.
|
|
9
10
|
* Avoid overriding this in practice: pick the component that matches the level — `Title` (`<h1>`), `Heading` (`<h2>`), or `Subheading` (`<h3>`) — so the visual size and the document outline stay in step.
|
|
10
11
|
*/
|
|
11
12
|
level?: "1" | "2" | "3" | "4" | "5" | "6" | 1 | 2 | 3 | 4 | 5 | 6;
|
|
12
|
-
/** Heading content. */
|
|
13
|
-
children: ReactNode;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
/**
|
package/ui/block/Paragraph.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
2
3
|
import PARAGRAPH_CSS from "./Paragraph.module.css";
|
|
3
|
-
export interface ParagraphProps {
|
|
4
|
-
children?: ReactNode;
|
|
4
|
+
export interface ParagraphProps extends OptionalChildProps {
|
|
5
5
|
/** Align the paragraph to the right. */
|
|
6
6
|
right?: boolean | undefined;
|
|
7
7
|
/** Align the paragraph to the center. */
|
package/ui/block/Paragraph.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
2
|
import { getModuleClass } from "../util/css.js";
|
|
3
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
4
|
import PARAGRAPH_CSS from "./Paragraph.module.css";
|
|
4
5
|
|
|
5
|
-
export interface ParagraphProps {
|
|
6
|
-
children?: ReactNode;
|
|
6
|
+
export interface ParagraphProps extends OptionalChildProps {
|
|
7
7
|
/** Align the paragraph to the right. */
|
|
8
8
|
right?: boolean | undefined;
|
|
9
9
|
/** Align the paragraph to the center. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReactElement
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
|
+
export interface PreformattedProps extends OptionalChildProps {
|
|
4
4
|
/** Disable line wrapping — long lines overflow horizontally instead of wrapping. */
|
|
5
5
|
nowrap?: boolean | undefined;
|
|
6
6
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
2
|
import { getModuleClass } from "../util/css.js";
|
|
3
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
4
|
import styles from "./Preformatted.module.css";
|
|
4
5
|
|
|
5
|
-
export interface PreformattedProps {
|
|
6
|
-
children?: ReactNode;
|
|
6
|
+
export interface PreformattedProps extends OptionalChildProps {
|
|
7
7
|
/** Disable line wrapping — long lines overflow horizontally instead of wrapping. */
|
|
8
8
|
nowrap?: boolean | undefined;
|
|
9
9
|
}
|
package/ui/block/Prose.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReactElement
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
|
+
export interface ProseProps extends OptionalChildProps {
|
|
4
4
|
}
|
|
5
5
|
/** A section of longform text containing lots of `<p>` or `<ul>` style elements. */
|
|
6
6
|
export declare function Prose({ children }: ProseProps): ReactElement;
|
package/ui/block/Prose.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
2
|
import codeStyles from "../inline/Code.module.css";
|
|
3
3
|
import deletedStyles from "../inline/Deleted.module.css";
|
|
4
4
|
import emphasisStyles from "../inline/Emphasis.module.css";
|
|
@@ -10,6 +10,7 @@ import strongStyles from "../inline/Strong.module.css";
|
|
|
10
10
|
import subscriptStyles from "../inline/Subscript.module.css";
|
|
11
11
|
import superscriptStyles from "../inline/Superscript.module.css";
|
|
12
12
|
import { getClass } from "../util/css.js";
|
|
13
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
13
14
|
import addressStyles from "./Address.module.css";
|
|
14
15
|
import blockquoteStyles from "./Blockquote.module.css";
|
|
15
16
|
import definitionsStyles from "./Definitions.module.css";
|
|
@@ -48,9 +49,7 @@ const PROSE_STYLES = getClass(
|
|
|
48
49
|
dividerStyles.prose,
|
|
49
50
|
);
|
|
50
51
|
|
|
51
|
-
export interface ProseProps {
|
|
52
|
-
children?: ReactNode;
|
|
53
|
-
}
|
|
52
|
+
export interface ProseProps extends OptionalChildProps {}
|
|
54
53
|
|
|
55
54
|
/** A section of longform text containing lots of `<p>` or `<ul>` style elements. */
|
|
56
55
|
export function Prose({ children }: ProseProps): ReactElement {
|
package/ui/block/Section.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReactElement
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
|
+
export interface SectionProps extends OptionalChildProps {
|
|
4
4
|
/** Constrain the section to narrow width (defaults to full-width). */
|
|
5
5
|
narrow?: boolean;
|
|
6
6
|
/** Constrain the section to wide width (defaults to full-width). */
|
package/ui/block/Section.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
2
|
import { getModuleClass } from "../util/css.js";
|
|
3
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
4
|
import styles from "./Section.module.css";
|
|
4
5
|
|
|
5
|
-
export interface SectionProps {
|
|
6
|
-
children?: ReactNode;
|
|
6
|
+
export interface SectionProps extends OptionalChildProps {
|
|
7
7
|
/** Constrain the section to narrow width (defaults to full-width). */
|
|
8
8
|
narrow?: boolean;
|
|
9
9
|
/** Constrain the section to wide width (defaults to full-width). */
|
package/ui/block/Table.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export interface TableProps {
|
|
3
|
-
children: ReactNode;
|
|
1
|
+
import type { ChildProps } from "../util/props.js";
|
|
2
|
+
export interface TableProps extends ChildProps {
|
|
4
3
|
}
|
|
5
4
|
export declare function Table({ children }: TableProps): import("react/jsx-runtime").JSX.Element;
|
package/ui/block/Table.tsx
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChildProps } from "../util/props.js";
|
|
2
2
|
import styles from "./Table.module.css";
|
|
3
3
|
|
|
4
|
-
export interface TableProps {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
4
|
+
export interface TableProps extends ChildProps {}
|
|
7
5
|
|
|
8
6
|
export function Table({ children }: TableProps) {
|
|
9
7
|
return (
|
package/ui/block/Video.d.ts
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { type MouseEvent, type ReactElement
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type MouseEvent, type ReactElement } from "react";
|
|
2
|
+
import type { ChildProps, OptionalChildProps } from "../util/props.js";
|
|
3
|
+
export interface VideoProps extends OptionalChildProps {
|
|
4
4
|
/** Constrain the video to narrow width (defaults to full-width). */
|
|
5
5
|
narrow?: boolean;
|
|
6
6
|
/** Constrain the video to wide width (defaults to full-width). */
|
|
7
7
|
wide?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export interface VideoButtonsProps {
|
|
10
|
-
children: ReactNode;
|
|
9
|
+
export interface VideoButtonsProps extends ChildProps {
|
|
11
10
|
left?: boolean;
|
|
12
11
|
}
|
|
13
|
-
export interface VideoButtonProps {
|
|
14
|
-
children: ReactNode;
|
|
12
|
+
export interface VideoButtonProps extends ChildProps {
|
|
15
13
|
title?: string | undefined;
|
|
16
14
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
17
15
|
danger?: boolean;
|
package/ui/block/Video.tsx
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ArrowsPointingInIcon, ArrowsPointingOutIcon } from "@heroicons/react/24/solid";
|
|
2
|
-
import { type MouseEvent, type ReactElement,
|
|
2
|
+
import { type MouseEvent, type ReactElement, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { getModuleClass } from "../util/css.js";
|
|
4
|
+
import type { ChildProps, OptionalChildProps } from "../util/props.js";
|
|
4
5
|
import styles from "./Video.module.css";
|
|
5
6
|
|
|
6
|
-
export interface VideoProps {
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
|
|
7
|
+
export interface VideoProps extends OptionalChildProps {
|
|
9
8
|
/** Constrain the video to narrow width (defaults to full-width). */
|
|
10
9
|
narrow?: boolean;
|
|
11
10
|
|
|
@@ -13,13 +12,11 @@ export interface VideoProps {
|
|
|
13
12
|
wide?: boolean;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
export interface VideoButtonsProps {
|
|
17
|
-
children: ReactNode;
|
|
15
|
+
export interface VideoButtonsProps extends ChildProps {
|
|
18
16
|
left?: boolean;
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
export interface VideoButtonProps {
|
|
22
|
-
children: ReactNode;
|
|
19
|
+
export interface VideoButtonProps extends ChildProps {
|
|
23
20
|
title?: string | undefined;
|
|
24
21
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
25
22
|
danger?: boolean;
|
package/ui/dialog/Dialog.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { type ReactElement
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
2
|
import type { Callback } from "../../util/function.js";
|
|
3
3
|
import type { ButtonVariants } from "../form/Button.js";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
5
|
+
export interface DialogProps extends OptionalChildProps {
|
|
6
6
|
onClose?: Callback;
|
|
7
7
|
}
|
|
8
8
|
export declare const Dialog: import("react").MemoExoticComponent<({ children, onClose, ...props }: DialogProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
|
-
export interface DialogCloseButtonProps extends ButtonVariants {
|
|
10
|
-
children?: ReactNode | undefined;
|
|
9
|
+
export interface DialogCloseButtonProps extends ButtonVariants, OptionalChildProps {
|
|
11
10
|
}
|
|
12
11
|
/** Button that closes its wrapping dialog with an X icon. */
|
|
13
12
|
export declare function DialogCloseButton({ children, ...variants }: DialogCloseButtonProps): ReactElement;
|
package/ui/dialog/Dialog.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { XMarkIcon } from "@heroicons/react/24/solid";
|
|
2
|
-
import { type MouseEvent, memo, type ReactElement,
|
|
2
|
+
import { type MouseEvent, memo, type ReactElement, Suspense, useEffect, useRef } from "react";
|
|
3
3
|
import type { Callback } from "../../util/function.js";
|
|
4
4
|
import type { ButtonVariants } from "../form/Button.js";
|
|
5
5
|
import { getModuleClass } from "../util/css.js";
|
|
6
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
6
7
|
import styles from "./Dialog.module.css";
|
|
7
8
|
|
|
8
|
-
export interface DialogProps {
|
|
9
|
-
children?: ReactNode;
|
|
9
|
+
export interface DialogProps extends OptionalChildProps {
|
|
10
10
|
onClose?: Callback;
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -39,9 +39,7 @@ function _closeOnBackdropClick({ currentTarget, target }: MouseEvent<HTMLDialogE
|
|
|
39
39
|
if (target instanceof Element && target.closest("a:any-link, nav button:enabled")) currentTarget.close();
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export interface DialogCloseButtonProps extends ButtonVariants {
|
|
43
|
-
children?: ReactNode | undefined;
|
|
44
|
-
}
|
|
42
|
+
export interface DialogCloseButtonProps extends ButtonVariants, OptionalChildProps {}
|
|
45
43
|
|
|
46
44
|
/** Button that closes its wrapping dialog with an X icon. */
|
|
47
45
|
export function DialogCloseButton({ children = <XMarkIcon />, ...variants }: DialogCloseButtonProps): ReactElement {
|
package/ui/dialog/Dialogs.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import { ArrayStore } from "../../store/ArrayStore.js";
|
|
3
|
+
import type { ChildProps } from "../util/props.js";
|
|
3
4
|
/** Store a list of dialogs. */
|
|
4
5
|
export declare class DialogsStore extends ArrayStore<ReactElement> {
|
|
5
6
|
/** Show a new dialog. */
|
|
@@ -10,8 +11,7 @@ export declare class DialogsStore extends ArrayStore<ReactElement> {
|
|
|
10
11
|
/** Return the current dialogs context. */
|
|
11
12
|
export declare function requireDialogs(): DialogsStore;
|
|
12
13
|
declare const _componentProps: unique symbol;
|
|
13
|
-
export interface DialogsContextProps {
|
|
14
|
-
children: ReactNode;
|
|
14
|
+
export interface DialogsContextProps extends ChildProps {
|
|
15
15
|
}
|
|
16
16
|
export interface DialogsProps {
|
|
17
17
|
readonly [_componentProps]?: never;
|
package/ui/dialog/Dialogs.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { useInstance } from "../../react/useInstance.js";
|
|
|
3
3
|
import { useStore } from "../../react/useStore.js";
|
|
4
4
|
import { ArrayStore } from "../../store/ArrayStore.js";
|
|
5
5
|
import { getRandomKey } from "../../util/random.js";
|
|
6
|
+
import type { ChildProps } from "../util/props.js";
|
|
6
7
|
import { Dialog } from "./Dialog.js";
|
|
7
8
|
|
|
8
9
|
/** How long before a hidden dialogs are removed from the DOM (allow time for animates to complete). */
|
|
@@ -44,9 +45,7 @@ export function requireDialogs(): DialogsStore {
|
|
|
44
45
|
|
|
45
46
|
declare const _componentProps: unique symbol;
|
|
46
47
|
|
|
47
|
-
export interface DialogsContextProps {
|
|
48
|
-
children: ReactNode;
|
|
49
|
-
}
|
|
48
|
+
export interface DialogsContextProps extends ChildProps {}
|
|
50
49
|
|
|
51
50
|
export interface DialogsProps {
|
|
52
51
|
readonly [_componentProps]?: never;
|
package/ui/dialog/Modal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReactElement
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
|
+
export interface ModalProps extends OptionalChildProps {
|
|
4
|
+
}
|
|
5
5
|
export declare function Modal({ children }: ModalProps): ReactElement;
|
package/ui/dialog/Modal.tsx
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
2
3
|
import styles from "./Modal.module.css";
|
|
3
4
|
|
|
4
|
-
export
|
|
5
|
-
children?: ReactNode | undefined;
|
|
6
|
-
};
|
|
5
|
+
export interface ModalProps extends OptionalChildProps {}
|
|
7
6
|
|
|
8
7
|
export function Modal({ children }: ModalProps): ReactElement {
|
|
9
8
|
return <aside className={styles.modal}>{children}</aside>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
2
3
|
import { type ValueInputProps } from "./Input.js";
|
|
3
|
-
export interface CheckboxProps extends ValueInputProps<boolean
|
|
4
|
-
children?: ReactNode | undefined;
|
|
4
|
+
export interface CheckboxProps extends ValueInputProps<boolean>, OptionalChildProps {
|
|
5
5
|
}
|
|
6
6
|
/** Checkbox element. */
|
|
7
7
|
export declare function CheckboxInput({ name, title, placeholder, required, disabled, message, value, onValue, children, }: CheckboxProps): ReactElement;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { ReactElement
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
2
|
import { notNullish } from "../../util/null.js";
|
|
3
|
+
import type { OptionalChildProps } from "../util/props.js";
|
|
3
4
|
import { CHECKBOX_CLASS, FLEX_LABEL_INPUT_CLASS, type ValueInputProps } from "./Input.js";
|
|
4
5
|
|
|
5
|
-
export interface CheckboxProps extends ValueInputProps<boolean
|
|
6
|
-
children?: ReactNode | undefined;
|
|
7
|
-
}
|
|
6
|
+
export interface CheckboxProps extends ValueInputProps<boolean>, OptionalChildProps {}
|
|
8
7
|
|
|
9
8
|
/** Checkbox element. */
|
|
10
9
|
export function CheckboxInput({
|