Skip to content

Commit

Permalink
slot prop api section table
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Nov 30, 2023
1 parent a7ede80 commit 16bf31c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
24 changes: 13 additions & 11 deletions src/components/api-ref/props-table.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,19 @@
<p class="text-sm leading-[1.3rem]">
{@html parseMarkdown(description)}
</p>
<div class="mt-2">
<Code class="h-auto bg-background px-0"
>Default:
{#if defaultVal}
{` ${defaultVal}`}
{:else}
<span aria-hidden> &nbsp;—— </span>
<span class="sr-only"> undefined </span>
{/if}
</Code>
</div>
{#if !slot}
<div class="mt-2">
<Code class="h-auto bg-background px-0">
Default:
{#if defaultVal}
{` ${defaultVal}`}
{:else}
<span aria-hidden> &nbsp;—— </span>
<span class="sr-only"> undefined </span>
{/if}
</Code>
</div>
{/if}
</Table.Cell>
</Table.Row>
{/each}
Expand Down
3 changes: 3 additions & 0 deletions src/components/api-section.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
{#if schema.props}
<PropsTable props={schema.props} />
{/if}
{#if schema.slotProps}
<PropsTable slot props={schema.slotProps} />
{/if}
{#if schema.dataAttributes && schema.dataAttributes.length}
<DataAttrsTable dataAttrs={schema.dataAttributes} />
{/if}
Expand Down
4 changes: 2 additions & 2 deletions src/content/api-reference/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const builderSlotProp: PropSchema = {
definition: "{ [k: string]: any; action: Action<any, any, any>}"
},
description:
"The builder attributes and actions to apply to the element if using the `asChild` prop with [delegation[(/docs/delegation)."
"The builder attributes and actions to apply to the element if using the `asChild` prop with [delegation](/docs/delegation)."
};

export const attrsSlotProp: PropSchema = {
Expand All @@ -23,7 +23,7 @@ export const attrsSlotProp: PropSchema = {
definition: "Record<string, string>"
},
description:
"Additional attributes to apply to the element if using the `asChild` prop with [delegation[(/docs/delegation)."
"Additional attributes to apply to the element if using the `asChild` prop with [delegation](/docs/delegation)."
};

export const builderAndAttrsSlotProps: Record<string, PropSchema> = {
Expand Down
3 changes: 2 additions & 1 deletion src/content/api-reference/radio-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export const root: APISchema<RadioGroup.Props> = {
{
name: "orientation",
value: enums("vertical", "horizontal"),
description: "The orientation of the radio group."
description: "The orientation of the radio group.",
isEnum: true
},
{
name: "radio-group-root",
Expand Down

0 comments on commit 16bf31c

Please sign in to comment.