From 5362b19cc15122c209406eb39538d6a27be2c8f4 Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Fri, 21 May 2021 11:29:00 +0200 Subject: [PATCH] Update code snippets to use argTypes[key].options instead of the deprecated control.options --- .../component-story-custom-args-icons.ts.mdx | 5 +---- .../common/badge-story-custom-argtypes.js.mdx | 19 ++++++++----------- .../badge-story-custom-argtypes.mdx.mdx | 19 ++++++++----------- .../button-story-controls-radio-group.js.mdx | 8 +++----- .../button-story-controls-radio-group.mdx.mdx | 8 +++----- ...fully-customize-controls.native-format.mdx | 6 ++---- ...component-story-custom-args-icons.2.js.mdx | 7 ++----- ...component-story-custom-args-icons.3.js.mdx | 5 +---- 8 files changed, 28 insertions(+), 49 deletions(-) diff --git a/docs/snippets/angular/component-story-custom-args-icons.ts.mdx b/docs/snippets/angular/component-story-custom-args-icons.ts.mdx index a6b204750b9..e9a754c9d48 100644 --- a/docs/snippets/angular/component-story-custom-args-icons.ts.mdx +++ b/docs/snippets/angular/component-story-custom-args-icons.ts.mdx @@ -15,10 +15,7 @@ export default { component: Icon, argTypes: { icon: { - control: { - type: 'select', - options: Object.keys(iconMap), - }, + options: Object.keys(iconMap), }, }, } as Meta; diff --git a/docs/snippets/common/badge-story-custom-argtypes.js.mdx b/docs/snippets/common/badge-story-custom-argtypes.js.mdx index 614f4ca42be..4dd612f905e 100644 --- a/docs/snippets/common/badge-story-custom-argtypes.js.mdx +++ b/docs/snippets/common/badge-story-custom-argtypes.js.mdx @@ -8,16 +8,13 @@ export default { status: { name: 'Badge Status', description: 'Available options available to the Badge', - control: { - type: 'select', - options: [ - 'positive', - 'negative', - 'warning', - 'error', - 'neutral' - ], - }, + options: [ + 'positive', + 'negative', + 'warning', + 'error', + 'neutral' + ], table: { defaultValue: { summary: 'positive' @@ -43,4 +40,4 @@ export default { } } }; -``` \ No newline at end of file +``` diff --git a/docs/snippets/common/badge-story-custom-argtypes.mdx.mdx b/docs/snippets/common/badge-story-custom-argtypes.mdx.mdx index 15e9b5dc18d..4d5168e1f5e 100644 --- a/docs/snippets/common/badge-story-custom-argtypes.mdx.mdx +++ b/docs/snippets/common/badge-story-custom-argtypes.mdx.mdx @@ -11,16 +11,13 @@ import { Badge } from './Badge'; status: { name: 'Badge Status', description: 'Available options available to the Badge', - control: { - type: 'select', - options: [ - 'positive', - 'negative', - 'warning', - 'error', - 'neutral' - ], - }, + options: [ + 'positive', + 'negative', + 'warning', + 'error', + 'neutral' + ], table: { defaultValue: { summary: 'positive' @@ -54,4 +51,4 @@ Let's define a story for our `Badge` component -``` \ No newline at end of file +``` diff --git a/docs/snippets/common/button-story-controls-radio-group.js.mdx b/docs/snippets/common/button-story-controls-radio-group.js.mdx index a6314dbc9c0..fa59e415b90 100644 --- a/docs/snippets/common/button-story-controls-radio-group.js.mdx +++ b/docs/snippets/common/button-story-controls-radio-group.js.mdx @@ -6,11 +6,9 @@ export default { component: Button, argTypes: { variant: { - control: { - type: 'radio', - options: ['primary', 'secondary'] - } + options: ['primary', 'secondary'], + control: { type: 'radio' } } } }; -``` \ No newline at end of file +``` diff --git a/docs/snippets/common/button-story-controls-radio-group.mdx.mdx b/docs/snippets/common/button-story-controls-radio-group.mdx.mdx index 7eec0c86082..0acba38bb6e 100644 --- a/docs/snippets/common/button-story-controls-radio-group.mdx.mdx +++ b/docs/snippets/common/button-story-controls-radio-group.mdx.mdx @@ -6,11 +6,9 @@ component={Button} argTypes={{ variant: { - control: { - type: 'radio', - options: ['primary', 'secondary'] - } + options: ['primary', 'secondary'], + control: { type: 'radio' } } }} /> -``` \ No newline at end of file +``` diff --git a/docs/snippets/svelte/table-story-fully-customize-controls.native-format.mdx b/docs/snippets/svelte/table-story-fully-customize-controls.native-format.mdx index 154215fa6bb..0d8898c9f82 100644 --- a/docs/snippets/svelte/table-story-fully-customize-controls.native-format.mdx +++ b/docs/snippets/svelte/table-story-fully-customize-controls.native-format.mdx @@ -12,9 +12,7 @@ component={Table} argTypes={{ size: { - control: { - type: 'select', - options: ['small', 'medium', 'large'] }, + options: ['small', 'medium', 'large'], }, }} /> @@ -44,4 +42,4 @@ size: 'large', }} /> -``` \ No newline at end of file +``` diff --git a/docs/snippets/vue/component-story-custom-args-icons.2.js.mdx b/docs/snippets/vue/component-story-custom-args-icons.2.js.mdx index 0414fdb518a..59af2057e05 100644 --- a/docs/snippets/vue/component-story-custom-args-icons.2.js.mdx +++ b/docs/snippets/vue/component-story-custom-args-icons.2.js.mdx @@ -14,10 +14,7 @@ export default { //👇 Creates specific argTypes with options argTypes: { icon: { - control: { - type: 'select', - options: Object.keys(iconMap), - }, + options: Object.keys(iconMap), }, }, }; @@ -39,4 +36,4 @@ const Template = (args, { argTypes }) => { template: '', }; }; -``` \ No newline at end of file +``` diff --git a/docs/snippets/vue/component-story-custom-args-icons.3.js.mdx b/docs/snippets/vue/component-story-custom-args-icons.3.js.mdx index 39cf8d7717f..8da0ef8d9bb 100644 --- a/docs/snippets/vue/component-story-custom-args-icons.3.js.mdx +++ b/docs/snippets/vue/component-story-custom-args-icons.3.js.mdx @@ -14,10 +14,7 @@ export default { //👇 Creates specific argTypes with options argTypes: { icon: { - control: { - type: 'select', - options: Object.keys(iconMap), - }, + options: Object.keys(iconMap), }, }, };