shelving 1.219.1 → 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.
Files changed (113) hide show
  1. package/package.json +1 -1
  2. package/ui/app/App.d.ts +3 -3
  3. package/ui/app/App.tsx +3 -4
  4. package/ui/block/Address.d.ts +3 -3
  5. package/ui/block/Address.tsx +3 -4
  6. package/ui/block/Block.d.ts +3 -3
  7. package/ui/block/Block.tsx +3 -4
  8. package/ui/block/Blockquote.d.ts +3 -3
  9. package/ui/block/Blockquote.tsx +3 -4
  10. package/ui/block/Card.d.ts +1 -2
  11. package/ui/block/Card.tsx +1 -3
  12. package/ui/block/Definitions.d.ts +3 -5
  13. package/ui/block/Definitions.tsx +3 -5
  14. package/ui/block/Figure.d.ts +2 -2
  15. package/ui/block/Figure.tsx +2 -2
  16. package/ui/block/Flex.d.ts +3 -3
  17. package/ui/block/Flex.tsx +3 -4
  18. package/ui/block/Heading.d.ts +3 -4
  19. package/ui/block/Heading.tsx +3 -4
  20. package/ui/block/Paragraph.d.ts +3 -3
  21. package/ui/block/Paragraph.tsx +3 -3
  22. package/ui/block/Preformatted.d.ts +3 -3
  23. package/ui/block/Preformatted.tsx +3 -3
  24. package/ui/block/Prose.d.ts +3 -3
  25. package/ui/block/Prose.tsx +3 -4
  26. package/ui/block/Section.d.ts +3 -3
  27. package/ui/block/Section.tsx +3 -3
  28. package/ui/block/Table.d.ts +2 -3
  29. package/ui/block/Table.tsx +2 -4
  30. package/ui/block/Video.d.ts +5 -7
  31. package/ui/block/Video.tsx +5 -8
  32. package/ui/dialog/Dialog.d.ts +4 -5
  33. package/ui/dialog/Dialog.tsx +4 -6
  34. package/ui/dialog/Dialogs.d.ts +2 -2
  35. package/ui/dialog/Dialogs.tsx +2 -3
  36. package/ui/dialog/Modal.d.ts +4 -4
  37. package/ui/dialog/Modal.tsx +3 -4
  38. package/ui/form/CheckboxInput.d.ts +3 -3
  39. package/ui/form/CheckboxInput.tsx +3 -4
  40. package/ui/form/Clickable.d.ts +2 -3
  41. package/ui/form/Clickable.tsx +2 -3
  42. package/ui/form/Field.d.ts +2 -2
  43. package/ui/form/Field.tsx +2 -2
  44. package/ui/form/Form.d.ts +2 -7
  45. package/ui/form/Form.tsx +2 -7
  46. package/ui/form/FormFooter.d.ts +2 -2
  47. package/ui/form/FormFooter.tsx +2 -2
  48. package/ui/form/Input.d.ts +3 -4
  49. package/ui/form/Input.tsx +3 -2
  50. package/ui/form/OutputInput.d.ts +3 -3
  51. package/ui/form/OutputInput.tsx +3 -4
  52. package/ui/form/RadioInput.d.ts +3 -3
  53. package/ui/form/RadioInput.tsx +3 -4
  54. package/ui/form/SchemaInput.d.ts +3 -3
  55. package/ui/form/SchemaInput.tsx +3 -4
  56. package/ui/form/SubmitButton.d.ts +3 -3
  57. package/ui/form/SubmitButton.tsx +3 -4
  58. package/ui/inline/Code.d.ts +6 -9
  59. package/ui/inline/Code.tsx +6 -13
  60. package/ui/inline/Deleted.d.ts +3 -3
  61. package/ui/inline/Deleted.tsx +3 -4
  62. package/ui/inline/Emphasis.d.ts +3 -3
  63. package/ui/inline/Emphasis.tsx +3 -4
  64. package/ui/inline/Inserted.d.ts +3 -3
  65. package/ui/inline/Inserted.tsx +3 -4
  66. package/ui/inline/Mark.d.ts +3 -3
  67. package/ui/inline/Mark.tsx +3 -4
  68. package/ui/inline/Small.d.ts +3 -3
  69. package/ui/inline/Small.tsx +3 -4
  70. package/ui/inline/Strong.d.ts +3 -3
  71. package/ui/inline/Strong.tsx +3 -4
  72. package/ui/inline/Subscript.d.ts +3 -3
  73. package/ui/inline/Subscript.tsx +3 -4
  74. package/ui/inline/Superscript.d.ts +3 -3
  75. package/ui/inline/Superscript.tsx +3 -4
  76. package/ui/inline/When.d.ts +3 -3
  77. package/ui/inline/When.tsx +3 -3
  78. package/ui/layout/CenteredLayout.d.ts +3 -3
  79. package/ui/layout/CenteredLayout.tsx +3 -3
  80. package/ui/layout/SidebarLayout.d.ts +2 -3
  81. package/ui/layout/SidebarLayout.tsx +2 -3
  82. package/ui/menu/Menu.d.ts +2 -2
  83. package/ui/menu/Menu.tsx +2 -3
  84. package/ui/misc/Catcher.d.ts +5 -8
  85. package/ui/misc/Catcher.js +0 -1
  86. package/ui/misc/Catcher.tsx +5 -11
  87. package/ui/misc/Mapper.d.ts +3 -3
  88. package/ui/misc/Mapper.tsx +2 -2
  89. package/ui/misc/MetaContext.d.ts +2 -3
  90. package/ui/misc/MetaContext.tsx +3 -4
  91. package/ui/misc/Tag.d.ts +1 -2
  92. package/ui/misc/Tag.tsx +2 -4
  93. package/ui/notice/Message.d.ts +0 -2
  94. package/ui/notice/Message.tsx +0 -2
  95. package/ui/notice/Notice.d.ts +3 -4
  96. package/ui/notice/Notice.tsx +3 -4
  97. package/ui/page/HTML.d.ts +3 -3
  98. package/ui/page/HTML.tsx +3 -4
  99. package/ui/page/Page.d.ts +3 -3
  100. package/ui/page/Page.tsx +3 -4
  101. package/ui/router/Navigation.d.ts +4 -5
  102. package/ui/router/Navigation.tsx +4 -7
  103. package/ui/transition/Transition.d.ts +3 -3
  104. package/ui/transition/Transition.tsx +3 -3
  105. package/ui/tree/TreeApp.d.ts +3 -4
  106. package/ui/tree/TreeApp.tsx +3 -4
  107. package/ui/util/README.md +13 -0
  108. package/ui/util/index.d.ts +1 -0
  109. package/ui/util/index.js +1 -0
  110. package/ui/util/index.ts +1 -0
  111. package/ui/util/props.d.ts +9 -0
  112. package/ui/util/props.js +1 -0
  113. package/ui/util/props.ts +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shelving",
3
- "version": "1.219.1",
3
+ "version": "1.220.0",
4
4
  "author": "Dave Houlbrooke <dave@shax.com>",
5
5
  "repository": {
6
6
  "type": "git",
package/ui/app/App.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { type ReactElement, type ReactNode } from "react";
1
+ import { type ReactElement } from "react";
2
2
  import type { PossibleMeta } from "../util/index.js";
3
- export interface AppProps extends PossibleMeta {
4
- children: ReactNode;
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, type ReactNode, useEffect } from "react";
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
 
@@ -1,8 +1,8 @@
1
- import type { ReactElement, ReactNode } from "react";
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
- export interface AddressProps {
5
- children: ReactNode;
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>;
@@ -1,13 +1,12 @@
1
- import type { ReactElement, ReactNode } from "react";
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>;
@@ -1,8 +1,8 @@
1
- import type { ReactElement, ReactNode } from "react";
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;
@@ -1,13 +1,12 @@
1
- import type { ReactElement, ReactNode } from "react";
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 {
@@ -1,5 +1,5 @@
1
- import type { ReactElement, ReactNode } from "react";
2
- export interface BlockquoteProps {
3
- children?: ReactNode;
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;
@@ -1,9 +1,8 @@
1
- import type { ReactElement, ReactNode } from "react";
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>;
@@ -1,9 +1,8 @@
1
- import type { ReactElement, ReactNode } from "react";
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, ReactNode } from "react";
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
- export interface DefinitionsProps {
3
- children?: ReactNode;
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.
@@ -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
  /**
@@ -1,6 +1,6 @@
1
1
  import type { ReactElement, ReactNode } from "react";
2
- export interface FigureProps {
3
- children?: ReactNode;
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;
@@ -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
 
@@ -1,4 +1,5 @@
1
- import type { ReactElement, ReactNode } from "react";
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, ReactNode } from "react";
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 {
@@ -1,13 +1,12 @@
1
- import type { ReactElement, ReactNode } from "react";
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>`.
@@ -1,16 +1,15 @@
1
- import type { ReactElement, ReactNode } from "react";
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
  /**
@@ -1,7 +1,7 @@
1
- import type { ReactElement, ReactNode } from "react";
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. */
@@ -1,9 +1,9 @@
1
- import type { ReactElement, ReactNode } from "react";
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, ReactNode } from "react";
2
- export interface PreformattedProps {
3
- children?: ReactNode;
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, ReactNode } from "react";
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
  }
@@ -1,6 +1,6 @@
1
- import type { ReactElement, ReactNode } from "react";
2
- export interface ProseProps {
3
- children?: ReactNode;
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;
@@ -1,4 +1,4 @@
1
- import type { ReactElement, ReactNode } from "react";
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 {
@@ -1,6 +1,6 @@
1
- import type { ReactElement, ReactNode } from "react";
2
- export interface SectionProps {
3
- children?: ReactNode;
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). */
@@ -1,9 +1,9 @@
1
- import type { ReactElement, ReactNode } from "react";
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). */
@@ -1,5 +1,4 @@
1
- import type { ReactNode } from "react";
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;
@@ -1,9 +1,7 @@
1
- import type { ReactNode } from "react";
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 (
@@ -1,17 +1,15 @@
1
- import { type MouseEvent, type ReactElement, type ReactNode } from "react";
2
- export interface VideoProps {
3
- children?: ReactNode;
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;
@@ -1,11 +1,10 @@
1
1
  import { ArrowsPointingInIcon, ArrowsPointingOutIcon } from "@heroicons/react/24/solid";
2
- import { type MouseEvent, type ReactElement, type ReactNode, useEffect, useRef, useState } from "react";
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;
@@ -1,13 +1,12 @@
1
- import { type ReactElement, type ReactNode } from "react";
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
- export interface DialogProps {
5
- children?: ReactNode;
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;
@@ -1,12 +1,12 @@
1
1
  import { XMarkIcon } from "@heroicons/react/24/solid";
2
- import { type MouseEvent, memo, type ReactElement, type ReactNode, Suspense, useEffect, useRef } from "react";
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 {
@@ -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;
@@ -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;
@@ -1,5 +1,5 @@
1
- import type { ReactElement, ReactNode } from "react";
2
- export type ModalProps = {
3
- children?: ReactNode | undefined;
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;
@@ -1,9 +1,8 @@
1
- import type { ReactElement, ReactNode } from "react";
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 type ModalProps = {
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, ReactNode } from "react";
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, ReactNode } from "react";
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({