Skip to content

Commit

Permalink
chore(documentation): move codeOrSourceMdx and bombArgs to utils folder
Browse files Browse the repository at this point in the history
  • Loading branch information
imagoiq committed Nov 13, 2023
1 parent c72e25a commit 7d8229a
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Args, StoryObj } from '@storybook/web-components';
import { html } from 'lit';
import { spreadArgs } from '../../../utils';
import { bombArgs } from '../../utilities/bombArgs';
import { bombArgs } from '../../../utils';
import alertMeta from './standard-html/alert.stories';
import { getAlertClasses } from './standard-html/getAlertClasses';

Expand All @@ -17,7 +17,7 @@ export const Alert: Story = {
<div class="d-flex gap-3 flex-wrap">
${['bg-white', 'bg-dark'].map(
bg => html`
<div class=${bg + ' d-flex flex-column gap-3 flex-wrap p-3'}>
<div class="${bg + ' d-flex flex-column gap-3 flex-wrap p-3'}">
${bombArgs({
type: alertMeta?.argTypes?.type?.options,
icon: ['no-icon', undefined, '1001'],
Expand Down Expand Up @@ -116,7 +116,7 @@ export const PostAlert: Story = {
args => html`
<post-alert
${spreadArgs(args)}
dismiss-label=${args.dismissible ? 'Dismiss' : undefined}
dismiss-label="${args.dismissible ? 'Dismiss' : undefined}"
></post-alert>
`,
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta from './badge.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta from './blockquote.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta from './button-group.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta, { Default, AccentColors, ContextualColors } from './button.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta, { Default, CustomContent, CardGroup } from './card.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta, { Inline } from './checkbox.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';
import { choiceCardMeta, choiceCardDefault } from './choice-card';
import { StoryObj } from '@storybook/web-components';
import { html } from 'lit';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { html } from 'lit';
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

import meta, { Default } from './collapsible.stories';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta, { Default } from './heading.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta, { renderInline } from './radio.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta from './range.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta from './switch.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta from './table.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta from './tabs.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta from './toast.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
import meta, { Default } from './topic-teaser.stories';
import { html } from 'lit';
import { bombArgs } from '../../../utils/bombArgs';
import { bombArgs } from '../../../utils';

export default {
...meta,
Expand All @@ -18,7 +18,7 @@ export const TopicTeaser: Story = {
<div>
${['white', 'dark'].map(
bg => html`
<div class=${'row bg-' + bg}>
<div class="${'row bg-' + bg}">
${bombArgs({
subtitle: [short, long],
title: [short, long],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Markdown, Meta } from '@storybook/blocks';
import changelog from '../../../../../styles/CHANGELOG.md?raw';
import { CodeOrSourceMdx } from '../../utilities/markdown/CodeOrSourceMdx';
import { CodeOrSourceMdx } from '../../../utils/CodeOrSourceMdx';

<Meta
title="Misc/Changelog"
Expand Down
19 changes: 0 additions & 19 deletions packages/documentation/src/stories/utilities/bombArgs.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Source: https://github.com/storybookjs/storybook/blob/next/code/ui/blocks/src/blocks/mdx.tsx#L34
import { Source } from '@storybook/blocks';
import { Code } from '@storybook/components';
import { SourceDarkMode } from '../../../../.storybook/preview';
import { SourceDarkMode } from '../../.storybook/preview';

// @ts-ignore
export const CodeOrSourceMdx = ({ className, children, ...rest }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/documentation/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './bomb-args';
export * from './component-properties';
export * from './get-attributes';
export * from './map-classes';
Expand Down

0 comments on commit 7d8229a

Please sign in to comment.