Skip to content

Commit

Permalink
update storybook formats
Browse files Browse the repository at this point in the history
  • Loading branch information
chaance committed Jul 14, 2021
1 parent 3010a37 commit df8e7d7
Show file tree
Hide file tree
Showing 173 changed files with 494 additions and 313 deletions.
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const alias = packages.reduce((memo, pkg) => {
}, {});

module.exports = {
stories: ["../packages/**/*/*.example.@(js|ts|tsx)"],
stories: ["../packages/**/*/*.story.@(js|ts|tsx)"],
addons: [
"@storybook/addon-actions/register",
"@storybook/addon-docs/register",
Expand Down
3 changes: 1 addition & 2 deletions packages/accordion/examples/animated.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,4 @@ const AnimatedPanel = React.forwardRef(({ children }, forwardedRef) => {
});

Example.storyName = name;
export const Animated = Example;
export default { title: "Accordion" };
export { Example };
3 changes: 1 addition & 2 deletions packages/accordion/examples/basic.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ function Example() {
}

Example.storyName = name;
export const Basic = Example;
export default { title: "Accordion" };
export { Example };

////////////////////////////////////////////////////////////////////////////////

Expand Down
3 changes: 1 addition & 2 deletions packages/accordion/examples/collapsible.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@ function Example() {
}

Example.storyName = name;
export const Collapsible = Example;
export default { title: "Accordion" };
export { Example };
3 changes: 1 addition & 2 deletions packages/accordion/examples/controlled.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,4 @@ function Example() {
}

Example.storyName = name;
export const Controlled = Example;
export default { title: "Accordion" };
export { Example };
15 changes: 15 additions & 0 deletions packages/accordion/examples/index.story.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export { Example as Animated } from "./animated.example.js";
export { Example as Basic } from "./basic.example.js";
export { Example as Collapsible } from "./collapsible.example.js";
export { Example as Controlled } from "./controlled.example.js";
export { Example as MultipleCollapsible } from "./multiple-collapsible.example.js";
export { Example as Multiple } from "./multiple.example.js";
export { Example as ReadOnly } from "./read-only.example.js";
export { Example as StyledTS } from "./styled.example.tsx";
export { Example as WithArbitraryElements } from "./with-arbitrary-elements.example.js";
export { Example as WithArrows } from "./with-arrows.example.js";
export { Example as WithUseaccordioncontextHookTS } from "./with-useaccordioncontext-hook.example.tsx";

export default {
title: "Accordion",
};
3 changes: 1 addition & 2 deletions packages/accordion/examples/multiple-collapsible.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@ function Example() {
}

Example.storyName = name;
export const MultipleCollapsible = Example;
export default { title: "Accordion" };
export { Example };
3 changes: 1 addition & 2 deletions packages/accordion/examples/multiple.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@ function Example() {
}

Example.storyName = name;
export const Multiple = Example;
export default { title: "Accordion" };
export { Example };
3 changes: 1 addition & 2 deletions packages/accordion/examples/read-only.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,4 @@ function Example() {
}

Example.storyName = name;
export const ReadOnly = Example;
export default { title: "Accordion" };
export { Example };
3 changes: 1 addition & 2 deletions packages/accordion/examples/styled.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ function Example() {
}

Example.storyName = name;
export const Styled = Example;
export default { title: "Accordion" };
export { Example };

////////////////////////////////////////////////////////////////////////////////

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ function Example() {
}

Example.storyName = name;
export const ArbitraryElems = Example;
export default { title: "Accordion" };
export { Example };

function ExampleAccordionBody({ children }) {
return <AccordionPanel style={{ padding: 16 }}>{children}</AccordionPanel>;
Expand Down
3 changes: 1 addition & 2 deletions packages/accordion/examples/with-arrows.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ function Example() {
}

Example.storyName = name;
export const WithArrows = Example;
export default { title: "Accordion" };
export { Example };

function ArrowButton({ children, active, ...props }) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ function Example() {
}

Example.storyName = name;
export const WithContextHooks = Example;
export default { title: "Accordion" };
export { Example };

////////////////////////////////////////////////////////////////////////////////
3 changes: 1 addition & 2 deletions packages/alert-dialog/examples/basic-ts.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ function Example() {
}

Example.storyName = name;
export const BasicTS = Example;
export default { title: "AlertDialog" };
export { Example };
3 changes: 1 addition & 2 deletions packages/alert-dialog/examples/basic.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ function Example() {
}

Example.storyName = name;
export const Basic = Example;
export default { title: "AlertDialog" };
export { Example };
6 changes: 6 additions & 0 deletions packages/alert-dialog/examples/index.story.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export { Example as BasicTsTS } from "./basic-ts.example.tsx";
export { Example as Basic } from "./basic.example.js";

export default {
title: "AlertDialog",
};
3 changes: 1 addition & 2 deletions packages/alert/examples/basic-ts.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ function Example() {
}

Example.storyName = name;
export const BasicTS = Example;
export default { title: "Alert" };
export { Example };

////////////////////////////////////////////////////////////////////////////////

Expand Down
3 changes: 1 addition & 2 deletions packages/alert/examples/basic.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ function Example() {
}

Example.storyName = name;
export const Basic = Example;
export default { title: "Alert" };
export { Example };

////////////////////////////////////////////////////////////////////////////////

Expand Down
6 changes: 6 additions & 0 deletions packages/alert/examples/index.story.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export { Example as BasicTsTS } from "./basic-ts.example.tsx";
export { Example as Basic } from "./basic.example.js";

export default {
title: "Alert",
};
3 changes: 1 addition & 2 deletions packages/checkbox/examples/basic-mixed.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ function Example() {
}

Example.storyName = name;
export const BasicMixed = Example;
export default { title: "Checkbox" };
export { Example };
3 changes: 1 addition & 2 deletions packages/checkbox/examples/checklist.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,4 @@ function Example() {
}

Example.storyName = name;
export const Checklist = Example;
export default { title: "Checkbox" };
export { Example };
5 changes: 2 additions & 3 deletions packages/checkbox/examples/custom-composed.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function MyCheckbox(props) {
);
}

export function Example() {
function Example() {
return (
<div>
<label>
Expand All @@ -64,5 +64,4 @@ export function Example() {
}

Example.storyName = name;
export const CustomComposed = Example;
export default { title: "Checkbox" };
export { Example };
3 changes: 1 addition & 2 deletions packages/checkbox/examples/custom-group.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ function Example() {
}

Example.storyName = name;
export const CustomGroup = Example;
export default { title: "Checkbox" };
export { Example };

////////////////////////////////////////////////////////////////////////////////

Expand Down
3 changes: 1 addition & 2 deletions packages/checkbox/examples/custom-pseudo.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ function Example() {
}

Example.storyName = name;
export const CustomPseudo = Example;
export default { title: "Checkbox" };
export { Example };
3 changes: 1 addition & 2 deletions packages/checkbox/examples/disabled.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ function Example() {
}

Example.storyName = name;
export const MixedDisabled = Example;
export default { title: "Checkbox" };
export { Example };
3 changes: 1 addition & 2 deletions packages/checkbox/examples/hook.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ function Example() {
}

Example.storyName = name;
export const MixedHook = Example;
export default { title: "Checkbox" };
export { Example };
11 changes: 11 additions & 0 deletions packages/checkbox/examples/index.story.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export { Example as BasicMixed } from "./basic-mixed.example.js";
export { Example as Checklist } from "./checklist.example.js";
export { Example as CustomComposed } from "./custom-composed.example.js";
export { Example as CustomGroup } from "./custom-group.example.js";
export { Example as CustomPseudo } from "./custom-pseudo.example.js";
export { Example as Disabled } from "./disabled.example.js";
export { Example as HookTS } from "./hook.example.tsx";

export default {
title: "Checkbox",
};
3 changes: 1 addition & 2 deletions packages/combobox/examples/basic-ts.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ function Example() {
}

Example.storyName = name;
export const BasicTS = Example;
export default { title: "Combobox" };
export { Example };

////////////////////////////////////////////////////////////////////////////////

Expand Down
3 changes: 1 addition & 2 deletions packages/combobox/examples/basic.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ function Example() {
}

Example.storyName = name;
export const Basic = Example;
export default { title: "Combobox" };
export { Example };

////////////////////////////////////////////////////////////////////////////////

Expand Down
3 changes: 1 addition & 2 deletions packages/combobox/examples/controlled-ts.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ function Example() {
}

Example.storyName = name;
export const ControlledTS = Example;
export default { title: "Combobox" };
export { Example };

////////////////////////////////////////////////////////////////////////////////
3 changes: 1 addition & 2 deletions packages/combobox/examples/controlled.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,4 @@ function Example() {
}

Example.storyName = name;
export const Controlled = Example;
export default { title: "Combobox" };
export { Example };
15 changes: 15 additions & 0 deletions packages/combobox/examples/index.story.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export { Example as BasicTsTS } from "./basic-ts.example.tsx";
export { Example as Basic } from "./basic.example.js";
export { Example as ControlledTsTS } from "./controlled-ts.example.tsx";
export { Example as Controlled } from "./controlled.example.js";
export { Example as LotsOfElements } from "./lots-of-elements.example.js";
export { Example as NoPopover } from "./no-popover.example.js";
export { Example as OpenOnFocus } from "./open-on-focus.example.js";
export { Example as TokenInput } from "./token-input.example.js";
export { Example as WithButton } from "./with-button.example.js";
export { Example as WithCustomSelectDataTS } from "./with-custom-select-data.example.tsx";
export { Example as WithUsecomboboxcontextHookTS } from "./with-usecomboboxcontext-hook.example.tsx";

export default {
title: "Combobox",
};
3 changes: 1 addition & 2 deletions packages/combobox/examples/lots-of-elements.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@ function Example() {
}

Example.storyName = name;
export const LotsOfElems = Example;
export default { title: "Combobox" };
export { Example };
3 changes: 1 addition & 2 deletions packages/combobox/examples/no-popover.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,4 @@ function Example() {
}

Example.storyName = name;
export const NoPopover = Example;
export default { title: "Combobox" };
export { Example };
3 changes: 1 addition & 2 deletions packages/combobox/examples/open-on-focus.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ function Example() {
}

Example.storyName = name;
export const OpenOnFocus = Example;
export default { title: "Combobox" };
export { Example };

////////////////////////////////////////////////////////////////////////////////

Expand Down
3 changes: 1 addition & 2 deletions packages/combobox/examples/token-input.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ function Example() {
}

Example.storyName = name;
export const TokenInput = Example;
export default { title: "Combobox" };
export { Example };

////////////////////////////////////////////////////////////////////////////////

Expand Down
3 changes: 1 addition & 2 deletions packages/combobox/examples/with-button.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ function Example() {
}

Example.storyName = name;
export const WithButton = Example;
export default { title: "Combobox" };
export { Example };
10 changes: 3 additions & 7 deletions packages/combobox/examples/with-custom-select-data.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,15 @@ function Example() {
}

Example.storyName = name;
export const WithCustomOnSelectData = Example;
export default { title: "Combobox" };
export { Example };

////////////////////////////////////////////////////////////////////////////////

const ComboboxContext = React.createContext<ComboboxContextValue>({} as any);

function Combobox({ onSelect: onSelectProp, ...props }: ComboboxProps) {
const {
addOptionData,
getOptionData,
removeOptionData,
} = useOptionDataFactory();
const { addOptionData, getOptionData, removeOptionData } =
useOptionDataFactory();

const onSelectRef = React.useRef(onSelectProp);
React.useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ function Example() {
}

Example.storyName = name;
export const WithHook = Example;
export default { title: "Combobox" };
export { Example };

////////////////////////////////////////////////////////////////////////////////

Expand Down
7 changes: 7 additions & 0 deletions packages/component-component/examples/index.story.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export { Example as Lifecycles } from "./lifecycles.example.js";
export { Example as State } from "./state.example.js";
export { Example as TodoList } from "./todo-list.example.js";

export default {
title: "ComponentComponent",
};
3 changes: 1 addition & 2 deletions packages/component-component/examples/lifecycles.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,4 @@ function Example() {
}

Example.storyName = name;
export const Lifecycles = Example;
export default { title: "ComponentComponent" };
export { Example };
3 changes: 1 addition & 2 deletions packages/component-component/examples/state.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ function Example() {
}

Example.storyName = name;
export const Basic = Example;
export default { title: "ComponentComponent" };
export { Example };
3 changes: 1 addition & 2 deletions packages/component-component/examples/todo-list.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,4 @@ function Example() {
}

Example.storyName = name;
export const TodoList = Example;
export default { title: "ComponentComponent" };
export { Example };
3 changes: 1 addition & 2 deletions packages/dialog/examples/animated.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@ function Example() {
}

Example.storyName = name;
export const Animated = Example;
export default { title: "Dialog" };
export { Example };
Loading

0 comments on commit df8e7d7

Please sign in to comment.