@askrjs/themes 0.0.25 → 0.0.27

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 (189) hide show
  1. package/dist/components/_internal/style.js +2 -1
  2. package/dist/components/_internal/style.js.map +1 -1
  3. package/dist/components/alert/alert.d.ts +5 -0
  4. package/dist/components/alert/alert.js +5 -0
  5. package/dist/components/alert/alert.js.map +1 -1
  6. package/dist/components/alert/alert.types.d.ts +3 -0
  7. package/dist/components/aside/aside.d.ts +1 -0
  8. package/dist/components/aside/aside.js +1 -0
  9. package/dist/components/aside/aside.js.map +1 -1
  10. package/dist/components/aside/aside.types.d.ts +1 -0
  11. package/dist/components/aspect-ratio/aspect-ratio.d.ts +5 -0
  12. package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -1
  13. package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +3 -0
  14. package/dist/components/badge/badge.d.ts +1 -0
  15. package/dist/components/badge/badge.js.map +1 -1
  16. package/dist/components/badge/badge.types.d.ts +4 -0
  17. package/dist/components/block/block.d.ts +6 -0
  18. package/dist/components/block/block.js.map +1 -1
  19. package/dist/components/block/block.types.d.ts +8 -0
  20. package/dist/components/brand/brand.d.ts +3 -0
  21. package/dist/components/brand/brand.js +3 -0
  22. package/dist/components/brand/brand.js.map +1 -1
  23. package/dist/components/brand/brand.types.d.ts +6 -0
  24. package/dist/components/button-group/button-group.d.ts +1 -0
  25. package/dist/components/button-group/button-group.js +1 -0
  26. package/dist/components/button-group/button-group.js.map +1 -1
  27. package/dist/components/button-group/button-group.types.d.ts +2 -0
  28. package/dist/components/card/card.d.ts +7 -0
  29. package/dist/components/card/card.js +7 -0
  30. package/dist/components/card/card.js.map +1 -1
  31. package/dist/components/card/card.types.d.ts +9 -0
  32. package/dist/components/catalog.d.ts +122 -0
  33. package/dist/components/catalog.js +118 -0
  34. package/dist/components/catalog.js.map +1 -1
  35. package/dist/components/close/close.d.ts +1 -0
  36. package/dist/components/close/close.js.map +1 -1
  37. package/dist/components/close/close.types.d.ts +2 -0
  38. package/dist/components/command-palette/command-palette.d.ts +14 -0
  39. package/dist/components/command-palette/command-palette.js +13 -0
  40. package/dist/components/command-palette/command-palette.js.map +1 -1
  41. package/dist/components/command-palette/command-palette.types.d.ts +6 -0
  42. package/dist/components/container/container.d.ts +1 -0
  43. package/dist/components/container/container.js +1 -0
  44. package/dist/components/container/container.js.map +1 -1
  45. package/dist/components/container/container.types.d.ts +1 -0
  46. package/dist/components/empty-state/empty-state.d.ts +1 -0
  47. package/dist/components/empty-state/empty-state.js +1 -0
  48. package/dist/components/empty-state/empty-state.js.map +1 -1
  49. package/dist/components/empty-state/empty-state.types.d.ts +2 -0
  50. package/dist/components/field/field.d.ts +3 -0
  51. package/dist/components/field/field.js +3 -0
  52. package/dist/components/field/field.js.map +1 -1
  53. package/dist/components/field/field.types.d.ts +3 -0
  54. package/dist/components/footer/footer.d.ts +7 -0
  55. package/dist/components/footer/footer.js +7 -0
  56. package/dist/components/footer/footer.js.map +1 -1
  57. package/dist/components/footer/footer.types.d.ts +7 -0
  58. package/dist/components/grid/grid.d.ts +1 -0
  59. package/dist/components/grid/grid.js +1 -0
  60. package/dist/components/grid/grid.js.map +1 -1
  61. package/dist/components/grid/grid.types.d.ts +4 -0
  62. package/dist/components/header/header.d.ts +1 -0
  63. package/dist/components/header/header.js +1 -0
  64. package/dist/components/header/header.js.map +1 -1
  65. package/dist/components/header/header.types.d.ts +1 -0
  66. package/dist/components/input-group/input-group.d.ts +2 -0
  67. package/dist/components/input-group/input-group.js +1 -0
  68. package/dist/components/input-group/input-group.js.map +1 -1
  69. package/dist/components/input-group/input-group.types.d.ts +4 -0
  70. package/dist/components/main/main.d.ts +1 -0
  71. package/dist/components/main/main.js +1 -0
  72. package/dist/components/main/main.js.map +1 -1
  73. package/dist/components/main/main.types.d.ts +1 -0
  74. package/dist/components/nav/nav.d.ts +6 -0
  75. package/dist/components/nav/nav.js +3 -0
  76. package/dist/components/nav/nav.js.map +1 -1
  77. package/dist/components/nav/nav.types.d.ts +14 -0
  78. package/dist/components/navbar/navbar.d.ts +8 -0
  79. package/dist/components/navbar/navbar.js +8 -0
  80. package/dist/components/navbar/navbar.js.map +1 -1
  81. package/dist/components/navbar/navbar.types.d.ts +5 -0
  82. package/dist/components/overlays/dropdown-content.d.ts +5 -0
  83. package/dist/components/overlays/dropdown-content.js.map +1 -1
  84. package/dist/components/page/page.d.ts +1 -0
  85. package/dist/components/page/page.js +1 -0
  86. package/dist/components/page/page.js.map +1 -1
  87. package/dist/components/page/page.types.d.ts +1 -0
  88. package/dist/components/page-header/page-header.d.ts +1 -0
  89. package/dist/components/page-header/page-header.js +1 -0
  90. package/dist/components/page-header/page-header.js.map +1 -1
  91. package/dist/components/page-header/page-header.types.d.ts +1 -0
  92. package/dist/components/section/section.d.ts +1 -0
  93. package/dist/components/section/section.js +1 -0
  94. package/dist/components/section/section.js.map +1 -1
  95. package/dist/components/section/section.types.d.ts +1 -0
  96. package/dist/components/separator/separator.d.ts +5 -0
  97. package/dist/components/separator/separator.js.map +1 -1
  98. package/dist/components/separator/separator.types.d.ts +4 -0
  99. package/dist/components/sidebar/sidebar.d.ts +16 -0
  100. package/dist/components/sidebar/sidebar.js +16 -0
  101. package/dist/components/sidebar/sidebar.js.map +1 -1
  102. package/dist/components/sidebar/sidebar.types.d.ts +8 -0
  103. package/dist/components/skeleton/skeleton.d.ts +1 -0
  104. package/dist/components/skeleton/skeleton.js.map +1 -1
  105. package/dist/components/skeleton/skeleton.types.d.ts +3 -0
  106. package/dist/components/spinner/spinner.d.ts +1 -0
  107. package/dist/components/spinner/spinner.js +1 -0
  108. package/dist/components/spinner/spinner.js.map +1 -1
  109. package/dist/components/spinner/spinner.types.d.ts +3 -0
  110. package/dist/components/stat/stat.d.ts +4 -0
  111. package/dist/components/stat/stat.js +4 -0
  112. package/dist/components/stat/stat.js.map +1 -1
  113. package/dist/components/stat/stat.types.d.ts +4 -0
  114. package/dist/components/text/text.d.ts +1 -0
  115. package/dist/components/text/text.js +1 -0
  116. package/dist/components/text/text.js.map +1 -1
  117. package/dist/components/text/text.types.d.ts +8 -0
  118. package/dist/components/theme/theme.d.ts +25 -0
  119. package/dist/components/theme/theme.js +17 -0
  120. package/dist/components/theme/theme.js.map +1 -1
  121. package/dist/components/toolbar/toolbar.d.ts +1 -0
  122. package/dist/components/toolbar/toolbar.js +1 -0
  123. package/dist/components/toolbar/toolbar.js.map +1 -1
  124. package/dist/components/toolbar/toolbar.types.d.ts +1 -0
  125. package/package.json +1 -1
  126. package/src/components/_internal/style.ts +8 -1
  127. package/src/components/alert/alert.tsx +5 -0
  128. package/src/components/alert/alert.types.ts +3 -0
  129. package/src/components/aside/aside.tsx +1 -0
  130. package/src/components/aside/aside.types.ts +1 -0
  131. package/src/components/aspect-ratio/aspect-ratio.tsx +5 -0
  132. package/src/components/aspect-ratio/aspect-ratio.types.ts +3 -0
  133. package/src/components/badge/badge.tsx +1 -0
  134. package/src/components/badge/badge.types.ts +4 -0
  135. package/src/components/block/block.tsx +6 -0
  136. package/src/components/block/block.types.ts +8 -0
  137. package/src/components/brand/brand.tsx +3 -0
  138. package/src/components/brand/brand.types.ts +6 -0
  139. package/src/components/button-group/button-group.tsx +1 -0
  140. package/src/components/button-group/button-group.types.ts +2 -0
  141. package/src/components/card/card.tsx +7 -0
  142. package/src/components/card/card.types.ts +9 -0
  143. package/src/components/catalog.tsx +122 -0
  144. package/src/components/close/close.tsx +1 -0
  145. package/src/components/close/close.types.ts +2 -0
  146. package/src/components/command-palette/command-palette.tsx +14 -0
  147. package/src/components/command-palette/command-palette.types.ts +6 -0
  148. package/src/components/container/container.tsx +1 -0
  149. package/src/components/container/container.types.ts +1 -0
  150. package/src/components/empty-state/empty-state.tsx +1 -0
  151. package/src/components/empty-state/empty-state.types.ts +2 -0
  152. package/src/components/field/field.tsx +3 -0
  153. package/src/components/field/field.types.ts +3 -0
  154. package/src/components/footer/footer.tsx +7 -0
  155. package/src/components/footer/footer.types.ts +7 -0
  156. package/src/components/grid/grid.tsx +1 -0
  157. package/src/components/grid/grid.types.ts +4 -0
  158. package/src/components/header/header.tsx +1 -0
  159. package/src/components/header/header.types.ts +1 -0
  160. package/src/components/input-group/input-group.tsx +2 -0
  161. package/src/components/input-group/input-group.types.ts +4 -0
  162. package/src/components/main/main.tsx +1 -0
  163. package/src/components/main/main.types.ts +1 -0
  164. package/src/components/nav/nav.tsx +6 -0
  165. package/src/components/nav/nav.types.ts +14 -0
  166. package/src/components/navbar/navbar.tsx +8 -0
  167. package/src/components/navbar/navbar.types.ts +5 -0
  168. package/src/components/overlays/dropdown-content.tsx +5 -0
  169. package/src/components/page/page.tsx +1 -0
  170. package/src/components/page/page.types.ts +1 -0
  171. package/src/components/page-header/page-header.tsx +1 -0
  172. package/src/components/page-header/page-header.types.ts +1 -0
  173. package/src/components/section/section.tsx +1 -0
  174. package/src/components/section/section.types.ts +1 -0
  175. package/src/components/separator/separator.tsx +5 -0
  176. package/src/components/separator/separator.types.ts +4 -0
  177. package/src/components/sidebar/sidebar.tsx +16 -0
  178. package/src/components/sidebar/sidebar.types.ts +8 -0
  179. package/src/components/skeleton/skeleton.tsx +1 -0
  180. package/src/components/skeleton/skeleton.types.ts +3 -0
  181. package/src/components/spinner/spinner.tsx +1 -0
  182. package/src/components/spinner/spinner.types.ts +3 -0
  183. package/src/components/stat/stat.tsx +4 -0
  184. package/src/components/stat/stat.types.ts +4 -0
  185. package/src/components/text/text.tsx +1 -0
  186. package/src/components/text/text.types.ts +8 -0
  187. package/src/components/theme/theme.tsx +25 -0
  188. package/src/components/toolbar/toolbar.tsx +1 -0
  189. package/src/components/toolbar/toolbar.types.ts +1 -0
@@ -39,6 +39,11 @@ function readCommandPaletteContext(): CommandPaletteContextValue {
39
39
  return context;
40
40
  }
41
41
 
42
+ /**
43
+ * Root dialog wrapper for a searchable command palette. Manages open state
44
+ * (controlled or uncontrolled), tracks the triggering element, and restores
45
+ * focus to it after the palette closes.
46
+ */
42
47
  export function CommandPalette(props: CommandPaletteProps): JSX.Element {
43
48
  const { children, defaultOpen = false, onOpenChange, open, ...rest } = props;
44
49
  const openState = controllableState({
@@ -96,6 +101,7 @@ export function CommandPalette(props: CommandPaletteProps): JSX.Element {
96
101
  );
97
102
  }
98
103
 
104
+ /** Trigger that opens the {@link CommandPalette}, registering itself so focus returns here on close. */
99
105
  export function CommandPaletteTrigger(props: CommandPaletteTriggerProps): JSX.Element;
100
106
  export function CommandPaletteTrigger(props: CommandPaletteTriggerAsChildProps): JSX.Element;
101
107
  export function CommandPaletteTrigger(
@@ -119,6 +125,12 @@ function preventDismiss(event: Event, shouldDismiss: boolean): void {
119
125
  }
120
126
  }
121
127
 
128
+ /**
129
+ * Dialog content for a {@link CommandPalette}: renders the overlay, an
130
+ * accessible (visually hidden) title/description, and a `Command` list,
131
+ * moving initial focus to `initialFocus` (defaults to the search input) once
132
+ * mounted, and optionally suppressing dismiss-on-escape/backdrop.
133
+ */
122
134
  export function CommandPaletteContent(props: CommandPaletteContentProps): JSX.Element {
123
135
  const palette = readCommandPaletteContext();
124
136
  const {
@@ -208,6 +220,7 @@ function composeBeforeNavigate(
208
220
  };
209
221
  }
210
222
 
223
+ /** A navigable result row that closes the palette on selection (unless `closeOnSelect` is `false`) and supports cancelling navigation via `onBeforeNavigate`. */
211
224
  export function CommandPaletteLink(props: CommandPaletteLinkProps): JSX.Element {
212
225
  const {
213
226
  children,
@@ -232,6 +245,7 @@ export function CommandPaletteLink(props: CommandPaletteLinkProps): JSX.Element
232
245
  );
233
246
  }
234
247
 
248
+ /** Renders the `<ul>` list wrapper for {@link CommandPalette} results. */
235
249
  export function CommandPaletteList(props: CommandPaletteListProps): JSX.Element {
236
250
  const { children, class: className, ...rest } = props;
237
251
  return (
@@ -9,10 +9,14 @@ import type {
9
9
  DialogTriggerProps,
10
10
  } from "@askrjs/ui";
11
11
 
12
+ /** Props for the {@link CommandPalette} component. */
12
13
  export type CommandPaletteProps = DialogProps;
14
+ /** Props for the {@link CommandPaletteTrigger} component. */
13
15
  export type CommandPaletteTriggerProps = DialogTriggerProps;
16
+ /** Props for {@link CommandPaletteTrigger} rendered with `asChild`. */
14
17
  export type CommandPaletteTriggerAsChildProps = DialogTriggerAsChildProps;
15
18
 
19
+ /** Props for the {@link CommandPaletteContent} component. */
16
20
  export type CommandPaletteContentProps = Omit<
17
21
  DialogContentProps,
18
22
  "children" | "title" | "onEscapeKeyDown" | "onInteractOutside" | "onPointerDownOutside"
@@ -29,11 +33,13 @@ export type CommandPaletteContentProps = Omit<
29
33
  onPointerDownOutside?: (event: PointerEvent) => void;
30
34
  };
31
35
 
36
+ /** Props for the {@link CommandPaletteLink} component. */
32
37
  export type CommandPaletteLinkProps = LinkProps & {
33
38
  closeOnSelect?: boolean;
34
39
  onBeforeNavigate?: () => void;
35
40
  };
36
41
 
42
+ /** Props for the {@link CommandPaletteList} component. */
37
43
  export type CommandPaletteListProps = Omit<JSX.IntrinsicElements["ul"], "children" | "ref"> & {
38
44
  children?: unknown;
39
45
  ref?: Ref<HTMLUListElement>;
@@ -2,6 +2,7 @@ import type { JSX } from "@askrjs/askr/jsx-runtime";
2
2
  import { Block } from "../block";
3
3
  import type { ContainerProps } from "./container.types";
4
4
 
5
+ /** Centers content in a max-width column with page gutters (defaults to the `"page"` {@link BlockSize}). */
5
6
  export function Container(props: ContainerProps): JSX.Element {
6
7
  const { children, size = "page", ...rest } = props;
7
8
 
@@ -1,5 +1,6 @@
1
1
  import type { BlockDivProps, BlockSize } from "../block";
2
2
 
3
+ /** Props for the {@link Container} component. */
3
4
  export type ContainerProps = Omit<BlockDivProps, "maxWidth"> & {
4
5
  size?: BlockSize;
5
6
  };
@@ -2,6 +2,7 @@ import type { JSX } from "@askrjs/askr/jsx-runtime";
2
2
  import { Block } from "../block";
3
3
  import type { EmptyStateProps } from "./empty-state.types";
4
4
 
5
+ /** Centered placeholder for empty lists/views: an icon, title (default `<h2>`), description, extra content, and an action row. */
5
6
  export function EmptyState(props: EmptyStateProps): JSX.Element {
6
7
  const { icon, title, titleAs: TitleTag = "h2", description, action, children, ...rest } = props;
7
8
 
@@ -1,7 +1,9 @@
1
1
  import type { BlockDivProps } from "../block";
2
2
 
3
+ /** Heading tag allowed for an empty state's title via `titleAs`. */
3
4
  export type EmptyStateHeadingTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
4
5
 
6
+ /** Props for the {@link EmptyState} component. */
5
7
  export type EmptyStateProps = BlockDivProps & {
6
8
  icon?: unknown;
7
9
  title?: unknown;
@@ -3,6 +3,7 @@ import { classes } from "../_internal/classes";
3
3
  import { mergeProps } from "../_internal/merge-props";
4
4
  import type { FieldErrorProps, FieldHintProps, FieldProps } from "./field.types";
5
5
 
6
+ /** Groups a form control with its hint/error text, marking `data-invalid` when `invalid` is set. */
6
7
  export function Field(props: FieldProps): JSX.Element {
7
8
  const { children, class: className, invalid = false, ref, ...rest } = props;
8
9
  const finalProps = mergeProps(rest, {
@@ -15,6 +16,7 @@ export function Field(props: FieldProps): JSX.Element {
15
16
  return <div {...finalProps}>{children}</div>;
16
17
  }
17
18
 
19
+ /** Renders supporting hint text for a {@link Field}. */
18
20
  export function FieldHint(props: FieldHintProps): JSX.Element {
19
21
  const { children, class: className, ref, ...rest } = props;
20
22
  const finalProps = mergeProps(rest, {
@@ -26,6 +28,7 @@ export function FieldHint(props: FieldHintProps): JSX.Element {
26
28
  return <p {...finalProps}>{children}</p>;
27
29
  }
28
30
 
31
+ /** Renders validation error text for a {@link Field}, exposed with `role="alert"`. */
29
32
  export function FieldError(props: FieldErrorProps): JSX.Element {
30
33
  const { children, class: className, ref, ...rest } = props;
31
34
  const finalProps = mergeProps(rest, {
@@ -4,17 +4,20 @@ import type { Ref } from "@askrjs/askr/foundations/utilities";
4
4
  type DivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref">;
5
5
  type ParagraphProps = Omit<JSX.IntrinsicElements["p"], "children" | "ref">;
6
6
 
7
+ /** Props for the {@link Field} component. */
7
8
  export type FieldProps = DivProps & {
8
9
  children?: unknown;
9
10
  invalid?: boolean;
10
11
  ref?: Ref<HTMLDivElement>;
11
12
  };
12
13
 
14
+ /** Props for the {@link FieldHint} component. */
13
15
  export type FieldHintProps = ParagraphProps & {
14
16
  children?: unknown;
15
17
  ref?: Ref<HTMLParagraphElement>;
16
18
  };
17
19
 
20
+ /** Props for the {@link FieldError} component. */
18
21
  export type FieldErrorProps = ParagraphProps & {
19
22
  children?: unknown;
20
23
  ref?: Ref<HTMLParagraphElement>;
@@ -12,6 +12,7 @@ import type {
12
12
  FooterTitleProps,
13
13
  } from "./footer.types";
14
14
 
15
+ /** Renders a `<footer>`-element {@link Block} with a muted background and top border. */
15
16
  export function Footer(props: FooterProps): JSX.Element {
16
17
  const { children, ...rest } = props;
17
18
 
@@ -22,6 +23,7 @@ export function Footer(props: FooterProps): JSX.Element {
22
23
  );
23
24
  }
24
25
 
26
+ /** Renders the main content wrapper of a {@link Footer}. */
25
27
  export function FooterContent(props: FooterContentProps): JSX.Element {
26
28
  const { children, class: className, ref, ...rest } = props;
27
29
  const finalProps = mergeProps(rest, {
@@ -33,6 +35,7 @@ export function FooterContent(props: FooterContentProps): JSX.Element {
33
35
  return <div {...finalProps}>{children}</div>;
34
36
  }
35
37
 
38
+ /** Renders a grouped section within a {@link Footer}. */
36
39
  export function FooterSection(props: FooterSectionProps): JSX.Element {
37
40
  const { children, class: className, ref, ...rest } = props;
38
41
  const finalProps = mergeProps(rest, {
@@ -44,6 +47,7 @@ export function FooterSection(props: FooterSectionProps): JSX.Element {
44
47
  return <div {...finalProps}>{children}</div>;
45
48
  }
46
49
 
50
+ /** Renders a section title (`<h2>`) within a {@link Footer}. */
47
51
  export function FooterTitle(props: FooterTitleProps): JSX.Element {
48
52
  const { children, class: className, ref, ...rest } = props;
49
53
  const finalProps = mergeProps(rest, {
@@ -55,6 +59,7 @@ export function FooterTitle(props: FooterTitleProps): JSX.Element {
55
59
  return <h2 {...finalProps}>{children}</h2>;
56
60
  }
57
61
 
62
+ /** Renders supporting description text within a {@link Footer}. */
58
63
  export function FooterDescription(props: FooterDescriptionProps): JSX.Element {
59
64
  const { children, class: className, ref, ...rest } = props;
60
65
  const finalProps = mergeProps(rest, {
@@ -66,6 +71,7 @@ export function FooterDescription(props: FooterDescriptionProps): JSX.Element {
66
71
  return <p {...finalProps}>{children}</p>;
67
72
  }
68
73
 
74
+ /** Renders a `<nav>` wrapper for a group of {@link FooterLink}s. */
69
75
  export function FooterLinks(props: FooterLinksProps): JSX.Element {
70
76
  const { children, class: className, ref, ...rest } = props;
71
77
  const finalProps = mergeProps(rest, {
@@ -77,6 +83,7 @@ export function FooterLinks(props: FooterLinksProps): JSX.Element {
77
83
  return <nav {...finalProps}>{children}</nav>;
78
84
  }
79
85
 
86
+ /** Renders a single link within a {@link Footer}. */
80
87
  export function FooterLink(props: FooterLinkProps): JSX.Element {
81
88
  const { children, class: className, ref, ...rest } = props;
82
89
  const finalProps = mergeProps(rest, {
@@ -2,6 +2,7 @@ import type { JSX } from "@askrjs/askr/jsx-runtime";
2
2
  import type { BlockElementProps } from "../block";
3
3
  import type { Ref } from "@askrjs/askr/foundations/utilities";
4
4
 
5
+ /** Props for the {@link Footer} component. */
5
6
  export type FooterProps = Omit<BlockElementProps<"footer">, "as">;
6
7
 
7
8
  type DivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref">;
@@ -10,31 +11,37 @@ type ParagraphProps = Omit<JSX.IntrinsicElements["p"], "children" | "ref">;
10
11
  type NavProps = Omit<JSX.IntrinsicElements["nav"], "children" | "ref">;
11
12
  type AnchorProps = Omit<JSX.IntrinsicElements["a"], "children" | "ref">;
12
13
 
14
+ /** Props for the {@link FooterContent} component. */
13
15
  export type FooterContentProps = DivProps & {
14
16
  children?: unknown;
15
17
  ref?: Ref<HTMLDivElement>;
16
18
  };
17
19
 
20
+ /** Props for the {@link FooterSection} component. */
18
21
  export type FooterSectionProps = DivProps & {
19
22
  children?: unknown;
20
23
  ref?: Ref<HTMLDivElement>;
21
24
  };
22
25
 
26
+ /** Props for the {@link FooterTitle} component. */
23
27
  export type FooterTitleProps = HeadingProps & {
24
28
  children?: unknown;
25
29
  ref?: Ref<HTMLHeadingElement>;
26
30
  };
27
31
 
32
+ /** Props for the {@link FooterDescription} component. */
28
33
  export type FooterDescriptionProps = ParagraphProps & {
29
34
  children?: unknown;
30
35
  ref?: Ref<HTMLParagraphElement>;
31
36
  };
32
37
 
38
+ /** Props for the {@link FooterLinks} component. */
33
39
  export type FooterLinksProps = NavProps & {
34
40
  children?: unknown;
35
41
  ref?: Ref<HTMLElement>;
36
42
  };
37
43
 
44
+ /** Props for the {@link FooterLink} component. */
38
45
  export type FooterLinkProps = AnchorProps & {
39
46
  children?: unknown;
40
47
  ref?: Ref<HTMLAnchorElement>;
@@ -27,6 +27,7 @@ function resolveAlign(value: GridAlign): string {
27
27
  return value;
28
28
  }
29
29
 
30
+ /** CSS grid layout primitive: turns `columns`/`gap`/`align` (each optionally responsive) into generated grid-template styles, rendering as `<div>` by default. */
30
31
  export function Grid<TElement extends GridElement = "div">(
31
32
  props: GridProps<TElement>,
32
33
  ): JSX.Element {
@@ -2,8 +2,11 @@ import type { JSX } from "@askrjs/askr/jsx-runtime";
2
2
  import type { Ref } from "@askrjs/askr/foundations/utilities";
3
3
  import type { BlockSpace, ResponsiveValue } from "../_internal/block-layout";
4
4
 
5
+ /** Element tags {@link Grid} can render as via its `as` prop. */
5
6
  export type GridElement = "div" | "section" | "ul";
7
+ /** Column definition for {@link Grid}: a track count or a raw `grid-template-columns` string. */
6
8
  export type GridColumns = number | string;
9
+ /** `align-items` value applied to a {@link Grid}. */
7
10
  export type GridAlign = "start" | "center" | "end" | "stretch";
8
11
 
9
12
  type GridIntrinsicProps<TElement extends GridElement> = Omit<
@@ -11,6 +14,7 @@ type GridIntrinsicProps<TElement extends GridElement> = Omit<
11
14
  "children" | "ref"
12
15
  >;
13
16
 
17
+ /** Props for the {@link Grid} component, specialized for a given {@link GridElement} `TElement`. */
14
18
  export type GridProps<TElement extends GridElement = "div"> = GridIntrinsicProps<TElement> & {
15
19
  as?: TElement;
16
20
  columns?: ResponsiveValue<GridColumns>;
@@ -2,6 +2,7 @@ import type { JSX } from "@askrjs/askr/jsx-runtime";
2
2
  import { Block } from "../block";
3
3
  import type { HeaderProps } from "./header.types";
4
4
 
5
+ /** Renders a `<header>`-element {@link Block} with a surface background and bottom border, optionally sticky-positioned via `position`/`sticky`. */
5
6
  export function Header(props: HeaderProps): JSX.Element {
6
7
  const { children, position, sticky = position === "sticky", ...rest } = props;
7
8
 
@@ -1,5 +1,6 @@
1
1
  import type { BlockElementProps } from "../block";
2
2
 
3
+ /** Props for the {@link Header} component. */
3
4
  export type HeaderProps = Omit<BlockElementProps<"header">, "as" | "sticky"> & {
4
5
  position?: "sticky" | "static";
5
6
  sticky?: boolean;
@@ -9,6 +9,7 @@ import type {
9
9
  InputGroupTextProps,
10
10
  } from "./input-group.types";
11
11
 
12
+ /** Groups related inputs/addons together, optionally visually attached, with a horizontal or vertical orientation and `role="group"` by default. */
12
13
  export function InputGroup(props: InputGroupProps): JSX.Element {
13
14
  const {
14
15
  attached = true,
@@ -39,6 +40,7 @@ export function InputGroup(props: InputGroupProps): JSX.Element {
39
40
  );
40
41
  }
41
42
 
43
+ /** Renders static text/label content within an {@link InputGroup}. */
42
44
  export function InputGroupText(props: InputGroupTextProps): JSX.Element;
43
45
  export function InputGroupText(props: InputGroupTextAsChildProps): JSX.Element;
44
46
  export function InputGroupText(
@@ -2,11 +2,13 @@ import type { JSX } from "@askrjs/askr/jsx-runtime";
2
2
  import type { JSXElement } from "@askrjs/askr/foundations";
3
3
  import type { Ref } from "@askrjs/askr/foundations/utilities";
4
4
 
5
+ /** Layout direction of an {@link InputGroup}. */
5
6
  export type InputGroupOrientation = "horizontal" | "vertical";
6
7
 
7
8
  type DivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref">;
8
9
  type SpanProps = Omit<JSX.IntrinsicElements["span"], "children" | "ref">;
9
10
 
11
+ /** Props for the {@link InputGroup} component. */
10
12
  export type InputGroupProps = DivProps & {
11
13
  children?: unknown;
12
14
  attached?: boolean;
@@ -14,12 +16,14 @@ export type InputGroupProps = DivProps & {
14
16
  ref?: Ref<HTMLDivElement>;
15
17
  };
16
18
 
19
+ /** Props for {@link InputGroupText} rendered as its default `<span>` element. */
17
20
  export type InputGroupTextProps = SpanProps & {
18
21
  asChild?: false;
19
22
  children?: unknown;
20
23
  ref?: Ref<HTMLSpanElement>;
21
24
  };
22
25
 
26
+ /** Props for {@link InputGroupText} rendered with `asChild`, merging its attributes onto a single child element. */
23
27
  export type InputGroupTextAsChildProps = SpanProps & {
24
28
  asChild: true;
25
29
  children: JSXElement;
@@ -2,6 +2,7 @@ import type { JSX } from "@askrjs/askr/jsx-runtime";
2
2
  import { Block } from "../block";
3
3
  import type { MainProps } from "./main.types";
4
4
 
5
+ /** Renders a `<main>`-element {@link Block} that grows to fill available space. */
5
6
  export function Main(props: MainProps): JSX.Element {
6
7
  const { children, ...rest } = props;
7
8
 
@@ -1,3 +1,4 @@
1
1
  import type { BlockElementProps } from "../block";
2
2
 
3
+ /** Props for the {@link Main} component. */
3
4
  export type MainProps = Omit<BlockElementProps<"main">, "as">;
@@ -159,26 +159,31 @@ function renderRoutedLink(
159
159
  );
160
160
  }
161
161
 
162
+ /** Renders a `<nav>` wrapper (or, with `asChild`, merges onto a child) for a set of {@link Tab} links. */
162
163
  export function Tabs(props: TabsProps): JSX.Element;
163
164
  export function Tabs(props: TabsAsChildProps): JSX.Element;
164
165
  export function Tabs(props: TabsProps | TabsAsChildProps): JSX.Element {
165
166
  return renderNavSet(props, "tabs");
166
167
  }
167
168
 
169
+ /** Renders a `<nav>` wrapper (or, with `asChild`, merges onto a child) for a set of {@link Pill} links. */
168
170
  export function Pills(props: PillsProps): JSX.Element;
169
171
  export function Pills(props: PillsAsChildProps): JSX.Element;
170
172
  export function Pills(props: PillsProps | PillsAsChildProps): JSX.Element {
171
173
  return renderNavSet(props, "pills");
172
174
  }
173
175
 
176
+ /** A router-aware link styled as a tab, auto-marked active by matching the current route (see {@link NavLinkProps.match}). */
174
177
  export function Tab(props: TabProps): JSX.Element {
175
178
  return renderRoutedLink(props, "tab", { className: "tab" });
176
179
  }
177
180
 
181
+ /** A router-aware link styled as a pill, auto-marked active by matching the current route, with an active background highlight. */
178
182
  export function Pill(props: PillProps): JSX.Element {
179
183
  return renderRoutedLink(props, "pill", { activeBackground: true, className: "pill" });
180
184
  }
181
185
 
186
+ /** A generic navigation item, rendered as an `<a>` (or, with `asChild`, merged onto a child), highlighted when `active`. */
182
187
  export function NavItem(props: NavItemProps): JSX.Element;
183
188
  export function NavItem(props: NavItemAsChildProps): JSX.Element;
184
189
  export function NavItem(props: NavItemProps | NavItemAsChildProps): JSX.Element {
@@ -230,6 +235,7 @@ export function NavItem(props: NavItemProps | NavItemAsChildProps): JSX.Element
230
235
  );
231
236
  }
232
237
 
238
+ /** A router-aware navigation link that highlights itself when its route matches the current location. */
233
239
  export function NavLink(props: NavLinkProps): JSX.Element {
234
240
  return renderRoutedLink(props, "nav-item", { activeBackground: true, inheritSlot: true });
235
241
  }
@@ -3,18 +3,22 @@ import type { JSXElement } from "@askrjs/askr/foundations";
3
3
  import type { Ref } from "@askrjs/askr/foundations/utilities";
4
4
  import type { LinkProps } from "@askrjs/askr/router";
5
5
 
6
+ /** Route-matching strategy for {@link NavLinkProps.match}: `"prefix"` matches sub-routes, `"exact"` requires an identical path. */
6
7
  export type NavLinkMatch = "prefix" | "exact";
7
8
 
9
+ /** Props shared by both {@link Tabs} call signatures. */
8
10
  export type TabsOwnProps = {
9
11
  children?: unknown;
10
12
  };
11
13
 
14
+ /** Props for {@link Tabs} rendered as its default `<nav>` element. */
12
15
  export type TabsProps = Omit<JSX.IntrinsicElements["nav"], "children" | "ref"> &
13
16
  TabsOwnProps & {
14
17
  asChild?: false;
15
18
  ref?: Ref<HTMLElement>;
16
19
  };
17
20
 
21
+ /** Props for {@link Tabs} rendered with `asChild`, merging onto a single child element. */
18
22
  export type TabsAsChildProps = Omit<JSX.IntrinsicElements["nav"], "children" | "ref"> &
19
23
  TabsOwnProps & {
20
24
  asChild: true;
@@ -22,16 +26,19 @@ export type TabsAsChildProps = Omit<JSX.IntrinsicElements["nav"], "children" | "
22
26
  ref?: Ref<unknown>;
23
27
  };
24
28
 
29
+ /** Props shared by both {@link Pills} call signatures. */
25
30
  export type PillsOwnProps = {
26
31
  children?: unknown;
27
32
  };
28
33
 
34
+ /** Props for {@link Pills} rendered as its default `<nav>` element. */
29
35
  export type PillsProps = Omit<JSX.IntrinsicElements["nav"], "children" | "ref"> &
30
36
  PillsOwnProps & {
31
37
  asChild?: false;
32
38
  ref?: Ref<HTMLElement>;
33
39
  };
34
40
 
41
+ /** Props for {@link Pills} rendered with `asChild`, merging onto a single child element. */
35
42
  export type PillsAsChildProps = Omit<JSX.IntrinsicElements["nav"], "children" | "ref"> &
36
43
  PillsOwnProps & {
37
44
  asChild: true;
@@ -39,17 +46,20 @@ export type PillsAsChildProps = Omit<JSX.IntrinsicElements["nav"], "children" |
39
46
  ref?: Ref<unknown>;
40
47
  };
41
48
 
49
+ /** Props shared by both {@link NavItem} call signatures. */
42
50
  export type NavItemOwnProps = {
43
51
  active?: boolean;
44
52
  children?: unknown;
45
53
  };
46
54
 
55
+ /** Props for {@link NavItem} rendered as its default `<a>` element. */
47
56
  export type NavItemProps = Omit<JSX.IntrinsicElements["a"], "children" | "ref"> &
48
57
  NavItemOwnProps & {
49
58
  asChild?: false;
50
59
  ref?: Ref<HTMLAnchorElement>;
51
60
  };
52
61
 
62
+ /** Props for {@link NavItem} rendered with `asChild`, merging onto a single child element. */
53
63
  export type NavItemAsChildProps = Omit<JSX.IntrinsicElements["a"], "children" | "ref"> &
54
64
  NavItemOwnProps & {
55
65
  asChild: true;
@@ -57,13 +67,17 @@ export type NavItemAsChildProps = Omit<JSX.IntrinsicElements["a"], "children" |
57
67
  ref?: Ref<unknown>;
58
68
  };
59
69
 
70
+ /** Props shared by {@link NavLink}, {@link Tab}, and {@link Pill}. */
60
71
  export type NavLinkOwnProps = NavItemOwnProps & {
61
72
  match?: NavLinkMatch;
62
73
  onPress?: (event: Event) => void;
63
74
  };
64
75
 
76
+ /** Props for the {@link NavLink} component. */
65
77
  export type NavLinkProps = LinkProps & NavLinkOwnProps;
66
78
 
79
+ /** Props for the {@link Tab} component. */
67
80
  export type TabProps = LinkProps & NavLinkOwnProps;
68
81
 
82
+ /** Props for the {@link Pill} component. */
69
83
  export type PillProps = LinkProps & NavLinkOwnProps;
@@ -41,6 +41,11 @@ function hasRenderableChildren(children: readonly unknown[]): boolean {
41
41
  });
42
42
  }
43
43
 
44
+ /**
45
+ * Horizontal navigation bar. Below `collapseAt`/`breakpoint`, non-brand
46
+ * children are grouped behind a collapsible toggle so brand content stays
47
+ * visible while the rest collapses on small screens.
48
+ */
44
49
  export function Navbar(props: NavbarProps): JSX.Element {
45
50
  const {
46
51
  breakpoint,
@@ -106,6 +111,7 @@ export function Navbar(props: NavbarProps): JSX.Element {
106
111
  );
107
112
  }
108
113
 
114
+ /** Renders the brand/logo slot of a {@link Navbar}; excluded from the collapsible section. */
109
115
  export function NavBrand(props: NavBrandProps): JSX.Element {
110
116
  const { children, ...rest } = props;
111
117
 
@@ -123,6 +129,7 @@ export function NavBrand(props: NavBrandProps): JSX.Element {
123
129
  );
124
130
  }
125
131
 
132
+ /** Groups related {@link Navbar} items under an optional label. */
126
133
  export function NavGroup(props: NavGroupProps): JSX.Element {
127
134
  const { align, children, label, title = label, ...rest } = props;
128
135
 
@@ -136,6 +143,7 @@ export function NavGroup(props: NavGroupProps): JSX.Element {
136
143
  );
137
144
  }
138
145
 
146
+ /** Renders a dropdown menu triggered from within a {@link Navbar}. */
139
147
  export function NavDropdown(props: NavDropdownProps): JSX.Element {
140
148
  const { align = "end", children, label, side = "bottom", sideOffset = 6, ...rest } = props;
141
149
 
@@ -1,8 +1,10 @@
1
1
  import type { BlockAsChildProps, BlockDivProps, BlockElementProps } from "../block";
2
2
  import type { DropdownContentOwnProps, DropdownProps } from "@askrjs/ui";
3
3
 
4
+ /** Breakpoint at which a {@link Navbar} collapses non-brand content behind a toggle. */
4
5
  export type NavbarCollapseBreakpoint = "sm" | "md" | "lg" | "xl";
5
6
 
7
+ /** Props for the {@link Navbar} component. */
6
8
  export type NavbarProps = Omit<BlockElementProps<"nav">, "as" | "direction" | "align"> & {
7
9
  breakpoint?: NavbarCollapseBreakpoint | false;
8
10
  collapseAt?: NavbarCollapseBreakpoint | false;
@@ -10,13 +12,16 @@ export type NavbarProps = Omit<BlockElementProps<"nav">, "as" | "direction" | "a
10
12
  collapseIcon?: unknown;
11
13
  };
12
14
 
15
+ /** Props for the {@link NavBrand} component. */
13
16
  export type NavBrandProps = BlockDivProps | BlockElementProps<"a"> | BlockAsChildProps;
14
17
 
18
+ /** Props for the {@link NavGroup} component. */
15
19
  export type NavGroupProps = Omit<BlockDivProps, "title"> & {
16
20
  label?: unknown;
17
21
  title?: unknown;
18
22
  };
19
23
 
24
+ /** Props for the {@link NavDropdown} component. */
20
25
  export type NavDropdownProps = Omit<DropdownProps, "children"> &
21
26
  Pick<DropdownContentOwnProps, "align" | "side" | "sideOffset"> & {
22
27
  label: unknown;
@@ -10,6 +10,11 @@ function DropdownContentBody(props: DropdownContentBodyProps): JSX.Element {
10
10
  return <>{props.render()}</>;
11
11
  }
12
12
 
13
+ /**
14
+ * Dropdown/context-menu content wrapper around `@askrjs/ui`'s `DropdownContent`.
15
+ * Non-`asChild` usage lazily evaluates `children` inside a body component so
16
+ * they're only rendered once the dropdown is actually open.
17
+ */
13
18
  export function DropdownContent(props: DropdownContentProps): JSX.Element | null;
14
19
  export function DropdownContent(props: DropdownContentAsChildProps): JSX.Element | null;
15
20
  export function DropdownContent(
@@ -3,6 +3,7 @@ import { Block } from "../block";
3
3
  import { Container } from "../container";
4
4
  import type { PageProps } from "./page.types";
5
5
 
6
+ /** Top-level page wrapper: a growing `<main>` containing a {@link Container} with vertical page padding and content spacing. */
6
7
  export function Page(props: PageProps): JSX.Element {
7
8
  const { children, ...rest } = props;
8
9
 
@@ -1,3 +1,4 @@
1
1
  import type { MainProps } from "../main";
2
2
 
3
+ /** Props for the {@link Page} component. */
3
4
  export type PageProps = MainProps;
@@ -2,6 +2,7 @@ import type { JSX } from "@askrjs/askr/jsx-runtime";
2
2
  import { Block } from "../block";
3
3
  import type { PageHeaderProps } from "./page-header.types";
4
4
 
5
+ /** Page-level header with a title, optional description, and an actions row that wraps to a new line on small screens. */
5
6
  export function PageHeader(props: PageHeaderProps): JSX.Element {
6
7
  const { title, description, actions, ...rest } = props;
7
8
 
@@ -1,5 +1,6 @@
1
1
  import type { BlockDivProps } from "../block";
2
2
 
3
+ /** Props for the {@link PageHeader} component. */
3
4
  export type PageHeaderProps = BlockDivProps & {
4
5
  title: unknown;
5
6
  description?: unknown;
@@ -2,6 +2,7 @@ import type { JSX } from "@askrjs/askr/jsx-runtime";
2
2
  import { Block } from "../block";
3
3
  import type { SectionProps } from "./section.types";
4
4
 
5
+ /** Renders a `<section>`-element {@link Block} with vertical spacing between children and page padding. */
5
6
  export function Section(props: SectionProps): JSX.Element {
6
7
  const { children, ...rest } = props;
7
8
 
@@ -1,3 +1,4 @@
1
1
  import type { BlockElementProps } from "../block";
2
2
 
3
+ /** Props for the {@link Section} component. */
3
4
  export type SectionProps = Omit<BlockElementProps<"section">, "as">;
@@ -4,6 +4,11 @@ import { mergeProps } from "../_internal/merge-props";
4
4
  import { intrinsicElement } from "../_internal/jsx";
5
5
  import type { SeparatorAsChildProps, SeparatorNativeProps } from "./separator.types";
6
6
 
7
+ /**
8
+ * Visual divider, defaulting to horizontal `role="separator"`; pass
9
+ * `decorative` to drop the semantic role, or `asChild` to merge onto a
10
+ * single child element.
11
+ */
7
12
  export function Separator(props: SeparatorNativeProps): JSX.Element;
8
13
  export function Separator(props: SeparatorAsChildProps): JSX.Element;
9
14
  export function Separator(props: SeparatorNativeProps | SeparatorAsChildProps) {