Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Actions tab in Storybook #1154

Merged
merged 6 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
jattasNI marked this conversation as resolved.
Show resolved Hide resolved
"type": "none",
"comment": "Fix Actions tab in Storybook",
"packageName": "@ni/nimble-components",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Meta, StoryObj } from '@storybook/html';
import { html, when } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { BannerSeverity } from '../types';
import { bannerGapSize } from '../../theme-provider/design-tokens';
Expand Down Expand Up @@ -42,6 +43,7 @@ should be spaced apart using the \`${bannerGapSize.cssCustomProperty}\` design t
const metadata: Meta<BannerArgs> = {
title: 'Banner',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Meta, StoryObj } from '@storybook/html';
import { html, when } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { ButtonAppearance, ButtonAppearanceVariant } from '../types';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import {
Expand Down Expand Up @@ -32,6 +33,7 @@ If you want a button that triggers navigation to a URL, use the \`nimble-anchor-
const metadata: Meta<ButtonArgs> = {
title: 'Button',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Meta, StoryObj } from '@storybook/html';
import { html } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { bodyFont } from '../../theme-provider/design-tokens';
import { cardButtonTag } from '..';
Expand All @@ -18,6 +19,7 @@ Note: The styling for the "Color" theme is not complete.`;
const metadata: Meta<CardButtonArgs> = {
title: 'Card Button',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { checkboxTag } from '..';
Expand All @@ -13,6 +14,7 @@ interface CheckboxArgs {
const metadata: Meta<CheckboxArgs> = {
title: 'Checkbox',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Meta, StoryObj } from '@storybook/html';
import { ComboboxAutocomplete } from '@microsoft/fast-foundation';
import { html, repeat } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { listOptionTag } from '../../list-option';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import {
Expand Down Expand Up @@ -29,6 +30,7 @@ interface OptionArgs {
const metadata: Meta<ComboboxArgs> = {
title: 'Combobox',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html, ref } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { DrawerWidthOptions, ExampleContentType } from './types';
import {
Expand Down Expand Up @@ -115,6 +116,7 @@ ${overrideWarning('Drawer Width', widthDescriptionOverride)}
const metadata: Meta<DrawerArgs> = {
title: 'Drawer',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html, when } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { ButtonAppearance, MenuButtonPosition } from '../types';
Expand Down Expand Up @@ -30,6 +31,7 @@ This icon will be hidden when \`contentHidden\` is set to \`true\`
const metadata: Meta<MenuButtonArgs> = {
title: 'Menu Button',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
4 changes: 3 additions & 1 deletion packages/nimble-components/src/menu/tests/menu.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Meta, StoryObj } from '@storybook/html';
import { html, repeat, when } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { menuTag } from '..';
import { iconArrowLeftFromLineTag } from '../../icons/arrow-left-from-line';
Expand Down Expand Up @@ -40,6 +41,7 @@ and will format them and any Nimble icons added as children of \`<nimble-menu-it
const metadata: Meta<MenuArgs> = {
title: 'Menu',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { NumberFieldAppearance } from '../types';
Expand All @@ -19,6 +20,7 @@ interface NumberFieldArgs {
const metadata: Meta<NumberFieldArgs> = {
title: 'Number Field',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { html } from '@microsoft/fast-element';
import { Orientation } from '@microsoft/fast-web-utilities';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { radioGroupTag } from '..';
Expand All @@ -16,6 +17,7 @@ interface RadioGroupArgs {
const metadata: Meta<RadioGroupArgs> = {
title: 'Radio Group',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Meta, StoryObj } from '@storybook/html';
import { html, repeat } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { DropdownAppearance } from '../../patterns/dropdown/types';
import { selectTag } from '..';
Expand All @@ -23,6 +24,7 @@ interface OptionArgs {
const metadata: Meta<SelectArgs> = {
title: 'Select',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html, when } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { switchTag } from '..';
Expand All @@ -21,6 +22,7 @@ pressed or not pressed and can optionally allow for a partially pressed state.`;
const metadata: Meta<SwitchArgs> = {
title: 'Switch',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
2 changes: 2 additions & 0 deletions packages/nimble-components/src/table/tests/table.stories.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html, ref } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import {
createUserSelectedThemeStory,
Expand Down Expand Up @@ -108,6 +109,7 @@ The object's type is \`TableValidityState\`, and it contains the following boole
const metadata: Meta<TableArgs> = {
title: 'Table',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
2 changes: 2 additions & 0 deletions packages/nimble-components/src/tabs/tests/tabs.stories.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html, when } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { tabsTag } from '..';
Expand Down Expand Up @@ -26,6 +27,7 @@ If you want a sequence of tabs that navigate to different URLs, use the Anchor T
const metadata: Meta<TabsArgs> = {
title: 'Tabs',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { TextAreaAppearance, TextAreaResize } from '../types';
Expand All @@ -22,6 +23,7 @@ interface TextAreaArgs {
const metadata: Meta<TextAreaArgs> = {
title: 'Text Area',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html, when } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { TextFieldAppearance, TextFieldType } from '../types';
Expand Down Expand Up @@ -33,6 +34,7 @@ consuming application must implement that functionality.
const metadata: Meta<TextFieldArgs> = {
title: 'Text Field',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html, when } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { ButtonAppearance } from '../types';
Expand Down Expand Up @@ -30,6 +31,7 @@ screen reader would say something like "Mute toggle button pressed".`;
const metadata: Meta<ToggleButtonArgs> = {
title: 'Toggle Button',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { html, ref } from '@microsoft/fast-element';
import type { Meta, StoryObj } from '@storybook/html';
import type { AutoUpdateMode } from '@microsoft/fast-foundation';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import {
borderColor,
Expand Down Expand Up @@ -92,6 +93,7 @@ const complexContent = html<TooltipArgs>`
const metadata: Meta<TooltipArgs> = {
title: 'Tooltip',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Meta, StoryObj } from '@storybook/html';
import { html, repeat, when } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../utilities/tests/storybook';
import { TreeViewSelectionMode } from '../types';
import { treeViewTag } from '..';
Expand Down Expand Up @@ -37,6 +38,7 @@ Note: Changing the selection mode does not affect which items can be selected pr
const metadata: Meta<TreeArgs> = {
title: 'Tree View',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// This file is a workaround to allow Nimble to import types that Storybook doesn't export correctly
jattasNI marked this conversation as resolved.
Show resolved Hide resolved
// https://github.com/storybookjs/storybook/issues/21887#issuecomment-1495427769
declare module '@storybook/addon-actions/decorator';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html } from '@microsoft/fast-element';
import { withActions } from '@storybook/addon-actions/decorator';
import type { Meta, StoryObj } from '@storybook/html';
import {
createUserSelectedThemeStory,
Expand Down Expand Up @@ -85,6 +86,7 @@ const getHighLightedValueSets = (
const metadata: Meta<WaferMapArgs> = {
title: 'WaferMap',
tags: ['autodocs'],
decorators: [withActions],
parameters: {
docs: {
description: {
Expand Down