@askrjs/themes 0.0.24 → 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.
- package/dist/components/_internal/style.js +2 -1
- package/dist/components/_internal/style.js.map +1 -1
- package/dist/components/alert/alert.d.ts +5 -0
- package/dist/components/alert/alert.js +5 -0
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert/alert.types.d.ts +3 -0
- package/dist/components/aside/aside.d.ts +1 -0
- package/dist/components/aside/aside.js +1 -0
- package/dist/components/aside/aside.js.map +1 -1
- package/dist/components/aside/aside.types.d.ts +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +5 -0
- package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +3 -0
- package/dist/components/badge/badge.d.ts +1 -0
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/badge/badge.types.d.ts +4 -0
- package/dist/components/block/block.d.ts +6 -0
- package/dist/components/block/block.js.map +1 -1
- package/dist/components/block/block.types.d.ts +8 -0
- package/dist/components/brand/brand.d.ts +3 -0
- package/dist/components/brand/brand.js +3 -0
- package/dist/components/brand/brand.js.map +1 -1
- package/dist/components/brand/brand.types.d.ts +6 -0
- package/dist/components/button-group/button-group.d.ts +1 -0
- package/dist/components/button-group/button-group.js +1 -0
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/button-group/button-group.types.d.ts +2 -0
- package/dist/components/card/card.d.ts +7 -0
- package/dist/components/card/card.js +7 -0
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/card/card.types.d.ts +9 -0
- package/dist/components/catalog.d.ts +122 -0
- package/dist/components/catalog.js +118 -0
- package/dist/components/catalog.js.map +1 -1
- package/dist/components/close/close.d.ts +1 -0
- package/dist/components/close/close.js.map +1 -1
- package/dist/components/close/close.types.d.ts +2 -0
- package/dist/components/command-palette/command-palette.d.ts +14 -0
- package/dist/components/command-palette/command-palette.js +13 -0
- package/dist/components/command-palette/command-palette.js.map +1 -1
- package/dist/components/command-palette/command-palette.types.d.ts +6 -0
- package/dist/components/container/container.d.ts +1 -0
- package/dist/components/container/container.js +1 -0
- package/dist/components/container/container.js.map +1 -1
- package/dist/components/container/container.types.d.ts +1 -0
- package/dist/components/empty-state/empty-state.d.ts +1 -0
- package/dist/components/empty-state/empty-state.js +1 -0
- package/dist/components/empty-state/empty-state.js.map +1 -1
- package/dist/components/empty-state/empty-state.types.d.ts +2 -0
- package/dist/components/field/field.d.ts +3 -0
- package/dist/components/field/field.js +3 -0
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/field/field.types.d.ts +3 -0
- package/dist/components/footer/footer.d.ts +7 -0
- package/dist/components/footer/footer.js +7 -0
- package/dist/components/footer/footer.js.map +1 -1
- package/dist/components/footer/footer.types.d.ts +7 -0
- package/dist/components/grid/grid.d.ts +1 -0
- package/dist/components/grid/grid.js +1 -0
- package/dist/components/grid/grid.js.map +1 -1
- package/dist/components/grid/grid.types.d.ts +4 -0
- package/dist/components/header/header.d.ts +1 -0
- package/dist/components/header/header.js +1 -0
- package/dist/components/header/header.js.map +1 -1
- package/dist/components/header/header.types.d.ts +1 -0
- package/dist/components/input-group/input-group.d.ts +2 -0
- package/dist/components/input-group/input-group.js +1 -0
- package/dist/components/input-group/input-group.js.map +1 -1
- package/dist/components/input-group/input-group.types.d.ts +4 -0
- package/dist/components/main/main.d.ts +1 -0
- package/dist/components/main/main.js +1 -0
- package/dist/components/main/main.js.map +1 -1
- package/dist/components/main/main.types.d.ts +1 -0
- package/dist/components/nav/nav.d.ts +6 -0
- package/dist/components/nav/nav.js +11 -12
- package/dist/components/nav/nav.js.map +1 -1
- package/dist/components/nav/nav.types.d.ts +14 -0
- package/dist/components/navbar/navbar.d.ts +8 -0
- package/dist/components/navbar/navbar.js +8 -0
- package/dist/components/navbar/navbar.js.map +1 -1
- package/dist/components/navbar/navbar.types.d.ts +5 -0
- package/dist/components/overlays/dropdown-content.d.ts +5 -0
- package/dist/components/overlays/dropdown-content.js.map +1 -1
- package/dist/components/page/page.d.ts +1 -0
- package/dist/components/page/page.js +1 -0
- package/dist/components/page/page.js.map +1 -1
- package/dist/components/page/page.types.d.ts +1 -0
- package/dist/components/page-header/page-header.d.ts +1 -0
- package/dist/components/page-header/page-header.js +1 -0
- package/dist/components/page-header/page-header.js.map +1 -1
- package/dist/components/page-header/page-header.types.d.ts +1 -0
- package/dist/components/section/section.d.ts +1 -0
- package/dist/components/section/section.js +1 -0
- package/dist/components/section/section.js.map +1 -1
- package/dist/components/section/section.types.d.ts +1 -0
- package/dist/components/separator/separator.d.ts +5 -0
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/separator/separator.types.d.ts +4 -0
- package/dist/components/sidebar/sidebar.d.ts +16 -0
- package/dist/components/sidebar/sidebar.js +16 -0
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/sidebar/sidebar.types.d.ts +8 -0
- package/dist/components/skeleton/skeleton.d.ts +1 -0
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/skeleton/skeleton.types.d.ts +3 -0
- package/dist/components/spinner/spinner.d.ts +1 -0
- package/dist/components/spinner/spinner.js +1 -0
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/spinner/spinner.types.d.ts +3 -0
- package/dist/components/stat/stat.d.ts +4 -0
- package/dist/components/stat/stat.js +4 -0
- package/dist/components/stat/stat.js.map +1 -1
- package/dist/components/stat/stat.types.d.ts +4 -0
- package/dist/components/text/text.d.ts +1 -0
- package/dist/components/text/text.js +1 -0
- package/dist/components/text/text.js.map +1 -1
- package/dist/components/text/text.types.d.ts +8 -0
- package/dist/components/theme/theme.d.ts +25 -0
- package/dist/components/theme/theme.js +17 -0
- package/dist/components/theme/theme.js.map +1 -1
- package/dist/components/toolbar/toolbar.d.ts +1 -0
- package/dist/components/toolbar/toolbar.js +1 -0
- package/dist/components/toolbar/toolbar.js.map +1 -1
- package/dist/components/toolbar/toolbar.types.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/_internal/style.ts +8 -1
- package/src/components/alert/alert.tsx +5 -0
- package/src/components/alert/alert.types.ts +3 -0
- package/src/components/aside/aside.tsx +1 -0
- package/src/components/aside/aside.types.ts +1 -0
- package/src/components/aspect-ratio/aspect-ratio.tsx +5 -0
- package/src/components/aspect-ratio/aspect-ratio.types.ts +3 -0
- package/src/components/badge/badge.tsx +1 -0
- package/src/components/badge/badge.types.ts +4 -0
- package/src/components/block/block.tsx +6 -0
- package/src/components/block/block.types.ts +8 -0
- package/src/components/brand/brand.tsx +3 -0
- package/src/components/brand/brand.types.ts +6 -0
- package/src/components/button-group/button-group.tsx +1 -0
- package/src/components/button-group/button-group.types.ts +2 -0
- package/src/components/card/card.tsx +7 -0
- package/src/components/card/card.types.ts +9 -0
- package/src/components/catalog.tsx +122 -0
- package/src/components/close/close.tsx +1 -0
- package/src/components/close/close.types.ts +2 -0
- package/src/components/command-palette/command-palette.tsx +14 -0
- package/src/components/command-palette/command-palette.types.ts +6 -0
- package/src/components/container/container.tsx +1 -0
- package/src/components/container/container.types.ts +1 -0
- package/src/components/empty-state/empty-state.tsx +1 -0
- package/src/components/empty-state/empty-state.types.ts +2 -0
- package/src/components/field/field.tsx +3 -0
- package/src/components/field/field.types.ts +3 -0
- package/src/components/footer/footer.tsx +7 -0
- package/src/components/footer/footer.types.ts +7 -0
- package/src/components/grid/grid.tsx +1 -0
- package/src/components/grid/grid.types.ts +4 -0
- package/src/components/header/header.tsx +1 -0
- package/src/components/header/header.types.ts +1 -0
- package/src/components/input-group/input-group.tsx +2 -0
- package/src/components/input-group/input-group.types.ts +4 -0
- package/src/components/main/main.tsx +1 -0
- package/src/components/main/main.types.ts +1 -0
- package/src/components/nav/nav.tsx +10 -36
- package/src/components/nav/nav.types.ts +14 -0
- package/src/components/navbar/navbar.tsx +8 -0
- package/src/components/navbar/navbar.types.ts +5 -0
- package/src/components/overlays/dropdown-content.tsx +5 -0
- package/src/components/page/page.tsx +1 -0
- package/src/components/page/page.types.ts +1 -0
- package/src/components/page-header/page-header.tsx +1 -0
- package/src/components/page-header/page-header.types.ts +1 -0
- package/src/components/section/section.tsx +1 -0
- package/src/components/section/section.types.ts +1 -0
- package/src/components/separator/separator.tsx +5 -0
- package/src/components/separator/separator.types.ts +4 -0
- package/src/components/sidebar/sidebar.tsx +16 -0
- package/src/components/sidebar/sidebar.types.ts +8 -0
- package/src/components/skeleton/skeleton.tsx +1 -0
- package/src/components/skeleton/skeleton.types.ts +3 -0
- package/src/components/spinner/spinner.tsx +1 -0
- package/src/components/spinner/spinner.types.ts +3 -0
- package/src/components/stat/stat.tsx +4 -0
- package/src/components/stat/stat.types.ts +4 -0
- package/src/components/text/text.tsx +1 -0
- package/src/components/text/text.types.ts +8 -0
- package/src/components/theme/theme.tsx +25 -0
- package/src/components/toolbar/toolbar.tsx +1 -0
- 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
|
|
|
@@ -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
|
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
import type { JSX } from "@askrjs/askr/jsx-runtime";
|
|
2
2
|
import { Slot } from "@askrjs/askr/foundations";
|
|
3
|
-
import { currentRoute, Link
|
|
3
|
+
import { currentRoute, Link } from "@askrjs/askr/router";
|
|
4
4
|
import { Block } from "../block";
|
|
5
5
|
import { classes } from "../_internal/classes";
|
|
6
6
|
import { mergeProps } from "../_internal/merge-props";
|
|
@@ -56,25 +56,6 @@ function isActiveNavLink(
|
|
|
56
56
|
return currentPathname === targetPathname || currentPathname.startsWith(`${targetPathname}/`);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
function shouldHandleClientNavigation(
|
|
60
|
-
event: MouseEvent,
|
|
61
|
-
target: string | undefined,
|
|
62
|
-
targetPathname: string | null,
|
|
63
|
-
): boolean {
|
|
64
|
-
if (targetPathname === null || target) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
!event.defaultPrevented &&
|
|
70
|
-
(event.button ?? 0) === 0 &&
|
|
71
|
-
!event.altKey &&
|
|
72
|
-
!event.ctrlKey &&
|
|
73
|
-
!event.metaKey &&
|
|
74
|
-
!event.shiftKey
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
59
|
function renderNavSet(
|
|
79
60
|
props: TabsProps | TabsAsChildProps | PillsProps | PillsAsChildProps,
|
|
80
61
|
slot: "tabs" | "pills",
|
|
@@ -145,27 +126,14 @@ function renderRoutedLink(
|
|
|
145
126
|
: {
|
|
146
127
|
"data-active": undefined,
|
|
147
128
|
};
|
|
148
|
-
const rendersRouterLink =
|
|
149
|
-
targetPathname !== null &&
|
|
150
|
-
!target &&
|
|
151
|
-
!hasDownload &&
|
|
152
|
-
typeof onClick !== "function" &&
|
|
153
|
-
typeof onPress !== "function";
|
|
129
|
+
const rendersRouterLink = targetPathname !== null && !target && !hasDownload;
|
|
154
130
|
const childProps: NavLinkProps = to
|
|
155
|
-
? ({ ...childRest, to, target } as NavLinkProps)
|
|
156
|
-
: ({ ...childRest, href, target } as NavLinkProps);
|
|
131
|
+
? ({ ...childRest, to, target, onPress, onClick } as NavLinkProps)
|
|
132
|
+
: ({ ...childRest, href, target, onPress, onClick } as NavLinkProps);
|
|
157
133
|
const handleClick = (event: MouseEvent) => {
|
|
158
134
|
onPress?.(event);
|
|
159
135
|
if (event.defaultPrevented) return;
|
|
160
136
|
onClick?.(event);
|
|
161
|
-
if (hasDownload) return;
|
|
162
|
-
|
|
163
|
-
if (!shouldHandleClientNavigation(event, target, targetPathname)) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
event.preventDefault();
|
|
168
|
-
navigate(href);
|
|
169
137
|
};
|
|
170
138
|
|
|
171
139
|
return (
|
|
@@ -191,26 +159,31 @@ function renderRoutedLink(
|
|
|
191
159
|
);
|
|
192
160
|
}
|
|
193
161
|
|
|
162
|
+
/** Renders a `<nav>` wrapper (or, with `asChild`, merges onto a child) for a set of {@link Tab} links. */
|
|
194
163
|
export function Tabs(props: TabsProps): JSX.Element;
|
|
195
164
|
export function Tabs(props: TabsAsChildProps): JSX.Element;
|
|
196
165
|
export function Tabs(props: TabsProps | TabsAsChildProps): JSX.Element {
|
|
197
166
|
return renderNavSet(props, "tabs");
|
|
198
167
|
}
|
|
199
168
|
|
|
169
|
+
/** Renders a `<nav>` wrapper (or, with `asChild`, merges onto a child) for a set of {@link Pill} links. */
|
|
200
170
|
export function Pills(props: PillsProps): JSX.Element;
|
|
201
171
|
export function Pills(props: PillsAsChildProps): JSX.Element;
|
|
202
172
|
export function Pills(props: PillsProps | PillsAsChildProps): JSX.Element {
|
|
203
173
|
return renderNavSet(props, "pills");
|
|
204
174
|
}
|
|
205
175
|
|
|
176
|
+
/** A router-aware link styled as a tab, auto-marked active by matching the current route (see {@link NavLinkProps.match}). */
|
|
206
177
|
export function Tab(props: TabProps): JSX.Element {
|
|
207
178
|
return renderRoutedLink(props, "tab", { className: "tab" });
|
|
208
179
|
}
|
|
209
180
|
|
|
181
|
+
/** A router-aware link styled as a pill, auto-marked active by matching the current route, with an active background highlight. */
|
|
210
182
|
export function Pill(props: PillProps): JSX.Element {
|
|
211
183
|
return renderRoutedLink(props, "pill", { activeBackground: true, className: "pill" });
|
|
212
184
|
}
|
|
213
185
|
|
|
186
|
+
/** A generic navigation item, rendered as an `<a>` (or, with `asChild`, merged onto a child), highlighted when `active`. */
|
|
214
187
|
export function NavItem(props: NavItemProps): JSX.Element;
|
|
215
188
|
export function NavItem(props: NavItemAsChildProps): JSX.Element;
|
|
216
189
|
export function NavItem(props: NavItemProps | NavItemAsChildProps): JSX.Element {
|
|
@@ -262,6 +235,7 @@ export function NavItem(props: NavItemProps | NavItemAsChildProps): JSX.Element
|
|
|
262
235
|
);
|
|
263
236
|
}
|
|
264
237
|
|
|
238
|
+
/** A router-aware navigation link that highlights itself when its route matches the current location. */
|
|
265
239
|
export function NavLink(props: NavLinkProps): JSX.Element {
|
|
266
240
|
return renderRoutedLink(props, "nav-item", { activeBackground: true, inheritSlot: true });
|
|
267
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
|
|
|
@@ -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
|
|