Skip to content

Commit 916fe95

Browse files
authored
docs: ensure *.Portal subcomponents are documented (#1397)
1 parent 588c0a9 commit 916fe95

File tree

11 files changed

+65
-8
lines changed

11 files changed

+65
-8
lines changed

.changeset/stale-toys-promise.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"bits-ui": patch
3+
---
4+
5+
chore(Popover): export `PopoverPortalPropsWithoutHTML` from Popover types

docs/src/lib/content/api-reference/combobox.api.ts

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type {
66
ComboboxGroupPropsWithoutHTML,
77
ComboboxInputPropsWithoutHTML,
88
ComboboxItemPropsWithoutHTML,
9+
ComboboxPortalPropsWithoutHTML,
910
ComboboxRootPropsWithoutHTML,
1011
ComboboxTriggerPropsWithoutHTML,
1112
} from "bits-ui";
@@ -41,6 +42,7 @@ import {
4142
floatingProps,
4243
focusScopeProps,
4344
forceMountProp,
45+
portalProps,
4446
preventOverflowTextSelectionProp,
4547
preventScrollProp,
4648
withChildProps,
@@ -357,11 +359,19 @@ export const arrow = createApiSchema<ComboboxArrowPropsWithoutHTML>({
357359
],
358360
});
359361

362+
export const portal = createApiSchema<ComboboxPortalPropsWithoutHTML>({
363+
title: "Portal",
364+
description:
365+
"When used, will render the combobox content into the body or custom `to` element when open",
366+
props: portalProps,
367+
});
368+
360369
export const combobox = [
361370
root,
362371
trigger,
363372
content,
364373
contentStatic,
374+
portal,
365375
item,
366376
input,
367377
group,

docs/src/lib/content/api-reference/date-picker.api.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
createPropSchema,
3333
withChildProps,
3434
} from "./helpers.js";
35-
import { content, trigger } from "./popover.api.js";
35+
import { content, portal, trigger } from "./popover.api.js";
3636
import { OnOpenChangeProp } from "./extended-types/shared/index.js";
3737
import * as C from "$lib/content/constants.js";
3838

@@ -158,6 +158,7 @@ export const datePicker = [
158158
segment,
159159
trigger,
160160
content,
161+
portal,
161162
calendar,
162163
header,
163164
prevButton,

docs/src/lib/content/api-reference/date-range-picker.api.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
createEnumProp,
1212
withChildProps,
1313
} from "./helpers.js";
14-
import { content, trigger } from "./popover.api.js";
14+
import { content, portal, trigger } from "./popover.api.js";
1515
import {
1616
root as calendarRoot,
1717
cell,
@@ -155,6 +155,7 @@ export const dateRangePicker = [
155155
segment,
156156
trigger,
157157
content,
158+
portal,
158159
calendar,
159160
header,
160161
prevButton,

docs/src/lib/content/api-reference/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export const portalProps = {
240240
to: createUnionProp({
241241
definition: PortalToProp,
242242
options: ["string", "HTMLElement", "null", "undefined"],
243-
description: `Where to render the content when it is open. Defaults to the body. Can be disabled by passing \`null\``,
243+
description: `Where to render the content when it is open. Defaults to the body. Can be disabled by passing \`null\`.`,
244244
default: "body",
245245
}),
246246
disabled: createBooleanProp({

docs/src/lib/content/api-reference/link-preview.api.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {
22
LinkPreviewArrowPropsWithoutHTML,
33
LinkPreviewContentPropsWithoutHTML,
44
LinkPreviewContentStaticPropsWithoutHTML,
5+
LinkPreviewPortalPropsWithoutHTML,
56
LinkPreviewRootPropsWithoutHTML,
67
LinkPreviewTriggerPropsWithoutHTML,
78
} from "bits-ui";
@@ -22,6 +23,7 @@ import {
2223
floatingProps,
2324
focusScopeProps,
2425
forceMountProp,
26+
portalProps,
2527
withChildProps,
2628
} from "$lib/content/api-reference/helpers.js";
2729
import * as C from "$lib/content/constants.js";
@@ -159,4 +161,11 @@ export const arrow = createApiSchema<LinkPreviewArrowPropsWithoutHTML>({
159161
],
160162
});
161163

162-
export const linkPreview = [root, trigger, content, contentStatic, arrow];
164+
const portal = createApiSchema<LinkPreviewPortalPropsWithoutHTML>({
165+
title: "Portal",
166+
description:
167+
"When used, will render the link preview content into the body or custom `to` element when open",
168+
props: portalProps,
169+
});
170+
171+
export const linkPreview = [root, trigger, content, contentStatic, arrow, portal];

docs/src/lib/content/api-reference/popover.api.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {
33
PopoverClosePropsWithoutHTML,
44
PopoverContentPropsWithoutHTML,
55
PopoverContentStaticPropsWithoutHTML,
6+
PopoverPortalPropsWithoutHTML,
67
PopoverRootPropsWithoutHTML,
78
PopoverTriggerPropsWithoutHTML,
89
} from "bits-ui";
@@ -23,6 +24,7 @@ import {
2324
floatingProps,
2425
focusScopeProps,
2526
forceMountProp,
27+
portalProps,
2628
preventOverflowTextSelectionProp,
2729
preventScrollProp,
2830
withChildProps,
@@ -170,4 +172,11 @@ export const arrow = createApiSchema<PopoverArrowPropsWithoutHTML>({
170172
],
171173
});
172174

173-
export const popover = [root, trigger, content, contentStatic, close, arrow];
175+
export const portal = createApiSchema<PopoverPortalPropsWithoutHTML>({
176+
title: "Portal",
177+
description:
178+
"When used, will render the popover content into the body or custom `to` element when open",
179+
props: portalProps,
180+
});
181+
182+
export const popover = [root, trigger, content, contentStatic, close, arrow, portal];

docs/src/lib/content/api-reference/select.api.ts

+10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
floatingProps,
1818
focusScopeProps,
1919
forceMountProp,
20+
portalProps,
2021
preventOverflowTextSelectionProp,
2122
preventScrollProp,
2223
withChildProps,
@@ -29,6 +30,7 @@ import type {
2930
SelectGroupHeadingPropsWithoutHTML,
3031
SelectGroupPropsWithoutHTML,
3132
SelectItemPropsWithoutHTML,
33+
SelectPortalPropsWithoutHTML,
3234
SelectRootPropsWithoutHTML,
3335
SelectScrollDownButtonPropsWithoutHTML,
3436
SelectScrollUpButtonPropsWithoutHTML,
@@ -371,11 +373,19 @@ export const arrow = createApiSchema<SelectArrowPropsWithoutHTML>({
371373
],
372374
});
373375

376+
export const portal = createApiSchema<SelectPortalPropsWithoutHTML>({
377+
title: "Portal",
378+
description:
379+
"When used, will render the select content into the body or custom `to` element when open",
380+
props: portalProps,
381+
});
382+
374383
export const select = [
375384
root,
376385
trigger,
377386
content,
378387
contentStatic,
388+
portal,
379389
item,
380390
viewport,
381391
scrollUpButton,

docs/src/lib/content/api-reference/tooltip.api.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {
22
TooltipArrowPropsWithoutHTML,
33
TooltipContentPropsWithoutHTML,
44
TooltipContentStaticPropsWithoutHTML,
5+
TooltipPortalPropsWithoutHTML,
56
TooltipProviderPropsWithoutHTML,
67
TooltipRootPropsWithoutHTML,
78
TooltipTriggerPropsWithoutHTML,
@@ -27,6 +28,7 @@ import {
2728
escapeLayerProps,
2829
floatingProps,
2930
forceMountProp,
31+
portalProps,
3032
withChildProps,
3133
} from "$lib/content/api-reference/helpers.js";
3234
import * as C from "$lib/content/constants.js";
@@ -221,4 +223,11 @@ export const arrow = createApiSchema<TooltipArrowPropsWithoutHTML>({
221223
],
222224
});
223225

224-
export const tooltip = [provider, root, trigger, content, contentStatic, arrow];
226+
const portal = createApiSchema<TooltipPortalPropsWithoutHTML>({
227+
title: "Portal",
228+
description:
229+
"When used, will render the tooltip content into the body or custom `to` element when open",
230+
props: portalProps,
231+
});
232+
233+
export const tooltip = [provider, root, trigger, content, contentStatic, arrow, portal];

packages/bits-ui/src/lib/bits/popover/exports.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ export type {
1313
PopoverContentStaticProps as ContentStaticProps,
1414
PopoverTriggerProps as TriggerProps,
1515
PopoverCloseProps as CloseProps,
16+
PopoverPortalProps as PortalProps,
1617
} from "./types.js";
17-
18-
export type { PortalProps } from "$lib/bits/utilities/portal/types.js";

packages/bits-ui/src/lib/bits/popover/types.ts

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type {
1212
BitsPrimitiveDivAttributes,
1313
} from "$lib/shared/attributes.js";
1414
import type { FloatingContentSnippetProps, StaticContentSnippetProps } from "$lib/shared/types.js";
15+
import type { PortalProps } from "$lib/types.js";
1516

1617
export type PopoverRootPropsWithoutHTML = WithChildren<{
1718
/**
@@ -56,3 +57,6 @@ export type PopoverCloseProps = PopoverClosePropsWithoutHTML &
5657
export type PopoverArrowPropsWithoutHTML = ArrowPropsWithoutHTML;
5758

5859
export type PopoverArrowProps = ArrowProps;
60+
61+
export type PopoverPortalPropsWithoutHTML = PortalProps;
62+
export type PopoverPortalProps = PortalProps;

0 commit comments

Comments
 (0)