Skip to content

Commit

Permalink
docs and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Dec 10, 2024
1 parent 16c2541 commit 2398031
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 6 deletions.
3 changes: 2 additions & 1 deletion sites/docs/src/lib/content/api-reference/combobox.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from "./extended-types/shared/index.js";
import { ComboboxScrollAlignmentProp } from "./extended-types/combobox/index.js";
import { ItemsProp } from "./extended-types/select/index.js";
import { FloatingContentChildSnippetProps } from "./extended-types/floating/index.js";
import {
arrowProps,
childrenSnippet,
Expand Down Expand Up @@ -152,7 +153,7 @@ export const content = createApiSchema<ComboboxContentPropsWithoutHTML>({
...withChildProps({
elType: "HTMLDivElement",
childrenDef: OpenChildrenSnippetProps,
childDef: OpenChildSnippetProps,
childDef: FloatingContentChildSnippetProps,
}),
},
dataAttributes: [
Expand Down
3 changes: 2 additions & 1 deletion sites/docs/src/lib/content/api-reference/context-menu.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
withChildProps,
} from "./helpers.js";
import { menu } from "./menu.api.js";
import { FloatingContentChildSnippetProps } from "./extended-types/floating/index.js";
import * as C from "$lib/content/constants.js";
import { omit } from "$lib/utils/omit.js";

Expand Down Expand Up @@ -75,7 +76,7 @@ export const content = createApiSchema<ContextMenuContentPropsWithoutHTML>({
description:
"Whether or not the context menu should loop through items when reaching the end.",
}),
...withChildProps({ elType: "HTMLDivElement" }),
...withChildProps({ elType: "HTMLDivElement", childDef: FloatingContentChildSnippetProps }),
},
dataAttributes: menu.content.dataAttributes,
cssVars: [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```ts
type ChildSnippetProps = {
// Props for the positioning wrapper
// Do not style this element -
// styling should be applied to the content element
wrapperProps: Record<string, unknown>;

// Props for your content element
// Apply your custom styles here
props: Record<string, unknown>;

// Content visibility state
// Use this for conditional rendering with
// Svelte transitions
open: boolean;
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export { default as FloatingStickyProp } from "./sticky-prop.md";
export { default as FloatingStrategyProp } from "./strategy-prop.md";
export { default as FloatingUpdatePositionStrategyProp } from "./update-position-strategy-prop.md";
export { default as FloatingCustomAnchorProp } from "./custom-anchor-prop.md";
export { default as FloatingContentChildSnippetProps } from "./floating-content-child-snippet-props.md";
3 changes: 2 additions & 1 deletion sites/docs/src/lib/content/api-reference/menu.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import {
CheckboxRootOnCheckedChangeProp,
CheckboxRootOnIndeterminateChangeProp,
} from "./extended-types/checkbox/index.js";
import { FloatingContentChildSnippetProps } from "./extended-types/floating/index.js";
import type { APISchema, DataAttrSchema, PropObj } from "$lib/types/index.js";
import * as C from "$lib/content/constants.js";
import { enums } from "$lib/content/api-reference/helpers.js";
Expand Down Expand Up @@ -121,7 +122,7 @@ const contentProps = {
...withChildProps({
elType: "HTMLDivElement",
childrenDef: OpenChildrenSnippetProps,
childDef: OpenChildSnippetProps,
childDef: FloatingContentChildSnippetProps,
}),
} satisfies PropObj<DropdownMenuContentPropsWithoutHTML>;

Expand Down
3 changes: 2 additions & 1 deletion sites/docs/src/lib/content/api-reference/popover.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {
PopoverTriggerPropsWithoutHTML,
} from "bits-ui";
import { OnOpenChangeProp, OpenClosedProp } from "./extended-types/shared/index.js";
import { FloatingContentChildSnippetProps } from "./extended-types/floating/index.js";
import {
arrowProps,
childrenSnippet,
Expand Down Expand Up @@ -81,7 +82,7 @@ export const content = createApiSchema<PopoverContentPropsWithoutHTML>({
},
forceMount: forceMountProp,
dir: dirProp,
...withChildProps({ elType: "HTMLDivElement" }),
...withChildProps({ elType: "HTMLDivElement", childDef: FloatingContentChildSnippetProps }),
},
dataAttributes: [
openClosedDataAttr,
Expand Down
3 changes: 2 additions & 1 deletion sites/docs/src/lib/content/api-reference/select.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from "./extended-types/shared/index.js";
import { ComboboxScrollAlignmentProp } from "./extended-types/combobox/index.js";
import { ItemsProp } from "./extended-types/select/index.js";
import { FloatingContentChildSnippetProps } from "./extended-types/floating/index.js";
import {
arrowProps,
childrenSnippet,
Expand Down Expand Up @@ -151,7 +152,7 @@ export const content = createApiSchema<SelectContentPropsWithoutHTML>({
...withChildProps({
elType: "HTMLDivElement",
childrenDef: OpenChildrenSnippetProps,
childDef: OpenChildSnippetProps,
childDef: FloatingContentChildSnippetProps,
}),
},
dataAttributes: [
Expand Down
3 changes: 2 additions & 1 deletion sites/docs/src/lib/content/api-reference/tooltip.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
OpenChildSnippetProps,
OpenChildrenSnippetProps,
} from "./extended-types/shared/index.js";
import { FloatingContentChildSnippetProps } from "./extended-types/floating/index.js";
import {
arrowProps,
childrenSnippet,
Expand Down Expand Up @@ -143,7 +144,7 @@ export const content = createApiSchema<TooltipContentPropsWithoutHTML>({
...withChildProps({
elType: "HTMLDivElement",
childrenDef: OpenChildrenSnippetProps,
childDef: OpenChildSnippetProps,
childDef: FloatingContentChildSnippetProps,
}),
},
dataAttributes: [
Expand Down

0 comments on commit 2398031

Please sign in to comment.