Skip to content

Commit

Permalink
docs(storybook): hide controls section if no arg table exists
Browse files Browse the repository at this point in the history
  • Loading branch information
larsrickert committed Jul 10, 2024
1 parent e501b0e commit 4fb0012
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/sit-onyx/.storybook/docs-template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Controls, Description, Meta, Primary, Stories, Title } from "@storybook

<Primary />

<section class="onyx-storybook-controls">
### Properties, Events and Slots

Below you can find all available properties, events and slots of the component.
Expand All @@ -20,6 +21,7 @@ Below you can find all available properties, events and slots of the component.
<Controls />

<div style={{ marginTop: "3rem" }}></div>
</section>

## Examples

Expand Down
5 changes: 5 additions & 0 deletions packages/sit-onyx/.storybook/docs-template.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@
display: none;
}
}

// hide controls section if the story does not have any args
.onyx-storybook-controls:not(:has(.docblock-argstable)) {
display: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import StorybookExampleSourceCode from "./StorybookExample.vue?raw";
*
* #### Step 2: Create the toast provider
*
* **If you are using the `createOnyx()` Vue plugin, you can skip this step since this will already be set up for you.**
* **If you are using the [createOnyx()](https://onyx.schwarz/development/#installation) Vue plugin, you can skip this step since this will already be set up for you.**
*
* The toast works with Vue's [provide/inject](https://vuejs.org/guide/components/provide-inject) API so you need to create a toast provider once.
* To do so, add the following code to your `main.ts` file to set up the toasts globally:
Expand Down

0 comments on commit 4fb0012

Please sign in to comment.