From fa2364c043980cc8f135a24849afeb6ec67f8af3 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Tue, 2 Jan 2024 17:44:13 -0300 Subject: [PATCH] Addon Controls: Remove unused hideNoControlsWarning type --- MIGRATION.md | 20 +++++++++++++++++- code/addons/controls/src/ControlsPanel.tsx | 3 --- docs/essentials/controls.md | 20 ------------------ ...utton-story-hide-nocontrols-warning.ts.mdx | 20 ------------------ ...utton-story-hide-nocontrols-warning.js.mdx | 15 ------------- ...n-story-hide-nocontrols-warning.ts-4-9.mdx | 21 ------------------- ...utton-story-hide-nocontrols-warning.ts.mdx | 21 ------------------- ...utton-story-hide-nocontrols-warning.js.mdx | 13 ------------ ...utton-story-hide-nocontrols-warning.ts.mdx | 18 ---------------- 9 files changed, 19 insertions(+), 132 deletions(-) delete mode 100644 docs/snippets/angular/button-story-hide-nocontrols-warning.ts.mdx delete mode 100644 docs/snippets/common/button-story-hide-nocontrols-warning.js.mdx delete mode 100644 docs/snippets/common/button-story-hide-nocontrols-warning.ts-4-9.mdx delete mode 100644 docs/snippets/common/button-story-hide-nocontrols-warning.ts.mdx delete mode 100644 docs/snippets/web-components/button-story-hide-nocontrols-warning.js.mdx delete mode 100644 docs/snippets/web-components/button-story-hide-nocontrols-warning.ts.mdx diff --git a/MIGRATION.md b/MIGRATION.md index 8d6310ddce12..9ab4cbc39f48 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,7 +1,7 @@

Migration

- [From version 7.x to 8.0.0](#from-version-7x-to-800) - - [Framework specific vite plugins have to be explicitly added](#framework-specific-vite-plugins-have-to-be-explicitly-added) + - [Framework-specific Vite plugins have to be explicitly added](#framework-specific-vite-plugins-have-to-be-explicitly-added) - [Implicit actions can not be used during rendering (for example in the play function)](#implicit-actions-can-not-be-used-during-rendering-for-example-in-the-play-function) - [Core changes](#core-changes) - [Dropping support for Node.js 16](#dropping-support-for-nodejs-16) @@ -24,6 +24,7 @@ - [Require Svelte 4 and up](#require-svelte-4-and-up) - [Deprecations which are now removed](#deprecations-which-are-now-removed) - [--use-npm flag in storybook CLI](#--use-npm-flag-in-storybook-cli) + - [hideNoControlsWarning parameter from addon controls](#hidenocontrolswarning-parameter-from-addon-controls) - [From version 7.5.0 to 7.6.0](#from-version-750-to-760) - [CommonJS with Vite is deprecated](#commonjs-with-vite-is-deprecated) - [Using implicit actions during rendering is deprecated](#using-implicit-actions-during-rendering-is-deprecated) @@ -35,6 +36,7 @@ - [`storyIndexers` is replaced with `experimental_indexers`](#storyindexers-is-replaced-with-experimental_indexers) - [From version 7.0.0 to 7.2.0](#from-version-700-to-720) - [Addon API is more type-strict](#addon-api-is-more-type-strict) + - [Addon-controls hideNoControlsWarning parameter is deprecated](#addon-controls-hidenocontrolswarning-parameter-is-deprecated) - [From version 6.5.x to 7.0.0](#from-version-65x-to-700) - [7.0 breaking changes](#70-breaking-changes) - [Dropped support for Node 15 and below](#dropped-support-for-node-15-and-below) @@ -531,6 +533,10 @@ Starting in 8.0, Storybook requires Svelte 4 and up. The `--use-npm` is now removed. Use `--package-manager=npm` instead. [More info here](#cli-option---use-npm-deprecated). +#### hideNoControlsWarning parameter from addon controls + +The `hideNoControlsWarning` parameter is now removed. [More info here](#addon-controls-hidenocontrolswarning-parameter-is-deprecated). + ## From version 7.5.0 to 7.6.0 #### CommonJS with Vite is deprecated @@ -711,6 +717,18 @@ The API: `addons.addPanel()` is now deprecated, and will be removed in 8.0.0. Pl The `render` method can now be a `React.FunctionComponent` (without the `children` prop). Storybook will now render it, rather than calling it as a function. +#### Addon-controls hideNoControlsWarning parameter is deprecated + +The `hideNoControlsWarning` parameter is now unused and deprecated, given that the UI of the Controls addon changed in a way that does not display that message anymore. + +```ts +export const Primary = { + parameters: { + controls: { hideNoControlsWarning: true }, // this parameter is now unnecessary + }, +}; +``` + ## From version 6.5.x to 7.0.0 A number of these changes can be made automatically by the Storybook CLI. To take advantage of these "automigrations", run `npx storybook@latest upgrade --prerelease` or `pnpx dlx storybook@latest upgrade --prerelease`. diff --git a/code/addons/controls/src/ControlsPanel.tsx b/code/addons/controls/src/ControlsPanel.tsx index fc7c2085abd4..09d3bc45e44e 100644 --- a/code/addons/controls/src/ControlsPanel.tsx +++ b/code/addons/controls/src/ControlsPanel.tsx @@ -16,9 +16,6 @@ interface ControlsParameters { sort?: SortType; expanded?: boolean; presetColors?: PresetColor[]; - - /** @deprecated No longer used, will be removed in Storybook 8.0 */ - hideNoControlsWarning?: boolean; } export const ControlsPanel: FC = () => { diff --git a/docs/essentials/controls.md b/docs/essentials/controls.md index 5d86420c4ab0..f575d34947d9 100644 --- a/docs/essentials/controls.md +++ b/docs/essentials/controls.md @@ -409,26 +409,6 @@ Consider the following snippet to force required args first: -#### Hide NoControls warning - -If you don't plan to handle the control args inside your story, you can remove the warning with: - - - - - - - ### Disable controls for specific properties Aside from the features already documented here, Controls can also be disabled for individual properties. diff --git a/docs/snippets/angular/button-story-hide-nocontrols-warning.ts.mdx b/docs/snippets/angular/button-story-hide-nocontrols-warning.ts.mdx deleted file mode 100644 index 9462922bc188..000000000000 --- a/docs/snippets/angular/button-story-hide-nocontrols-warning.ts.mdx +++ /dev/null @@ -1,20 +0,0 @@ -```ts -// Button.stories.ts - -import type { Meta, StoryObj } from '@storybook/angular'; - -import { Button } from './button.component'; - -const meta: Meta