mirror of
https://github.com/picocss/pico.git
synced 2025-04-24 18:26:14 -04:00
feat: add StorybookJS
This commit is contained in:
parent
1039a4788d
commit
cbc1260553
116 changed files with 3560 additions and 2 deletions
23
stories/interactive-elements/details.stories.ts
Normal file
23
stories/interactive-elements/details.stories.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { createHTMLElement } from "../HTMLElement";
|
||||
|
||||
export default {
|
||||
title: "InteractiveElements/Details",
|
||||
tags: ["autodocs"],
|
||||
args: {
|
||||
content: "Content",
|
||||
name: "details",
|
||||
open: false,
|
||||
},
|
||||
// Render the <html> element
|
||||
render: (args) => {
|
||||
return createHTMLElement("details", args);
|
||||
},
|
||||
};
|
||||
|
||||
export const Default = {};
|
||||
|
||||
export const Open = {
|
||||
args: {
|
||||
open: true,
|
||||
},
|
||||
};
|
31
stories/interactive-elements/details_and_summary.stories.ts
Normal file
31
stories/interactive-elements/details_and_summary.stories.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { createHTMLElement } from "../HTMLElement";
|
||||
|
||||
// Import the details and summary stories
|
||||
import Details from "./details.stories";
|
||||
import Summary from "./summary.stories";
|
||||
|
||||
export default {
|
||||
title: "InteractiveElements/DetailsAndSummary",
|
||||
tags: ["autodocs"],
|
||||
args: {
|
||||
...Details.args,
|
||||
...Summary.args,
|
||||
content: "Details and Summary content",
|
||||
summary: "Summary Label",
|
||||
},
|
||||
|
||||
render: (args) => {
|
||||
return createHTMLElement("details", {
|
||||
...args,
|
||||
content: [
|
||||
createHTMLElement("summary", {
|
||||
...args,
|
||||
content: args.summary,
|
||||
}),
|
||||
args.content,
|
||||
],
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export const Default = {};
|
16
stories/interactive-elements/dialog.stories.ts
Normal file
16
stories/interactive-elements/dialog.stories.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { createHTMLElement } from "../HTMLElement";
|
||||
|
||||
export default {
|
||||
title: "InteractiveElements/Dialog",
|
||||
tags: ["autodocs"],
|
||||
args: {
|
||||
content: "Content",
|
||||
open: false,
|
||||
},
|
||||
// Render the <html> element
|
||||
render: (args) => {
|
||||
return createHTMLElement("dialog", args);
|
||||
},
|
||||
};
|
||||
|
||||
export const Default = {};
|
15
stories/interactive-elements/summary.stories.ts
Normal file
15
stories/interactive-elements/summary.stories.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { createHTMLElement } from "../HTMLElement";
|
||||
|
||||
export default {
|
||||
title: "InteractiveElements/Summary",
|
||||
tags: ["autodocs"],
|
||||
args: {
|
||||
content: "Content",
|
||||
},
|
||||
// Render the <html> element
|
||||
render: (args) => {
|
||||
return createHTMLElement("summary", args);
|
||||
},
|
||||
};
|
||||
|
||||
export const Default = {};
|
Loading…
Add table
Add a link
Reference in a new issue