From 9073800133b0515085e395c8da7642b8f29820b0 Mon Sep 17 00:00:00 2001 From: Yayo Date: Thu, 17 Aug 2023 01:14:49 +0200 Subject: [PATCH 1/5] sorting storybook sidebar --- .storybook/preview.tsx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 00d3858d71..470b3da465 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -15,6 +15,7 @@ import { } from '../src'; import {AVAILABLE_THEMES, Movistar} from './themes'; import {addons} from '@storybook/addons'; +import {addParameters} from '@storybook/react'; import type {ColorScheme, ThemeConfig} from '../src'; @@ -122,3 +123,23 @@ export const parameters = { // Workaround for: https://github.com/storybookjs/storybook/issues/17098 docs: {source: {type: 'code'}}, }; + +addParameters({ + options: { + storySort: { + method: 'alphabetical', + order: [ + 'Welcome', + 'Components', + 'Layout', + 'Icons', + 'Patterns', + 'Utilities', + 'Hooks', + 'Mística Lab', + 'Community', + ], + locales: 'en-US', + }, + }, +}); From faea1662e2d0064215ed9824d5275801eee76761 Mon Sep 17 00:00:00 2001 From: Yayo Date: Thu, 17 Aug 2023 01:19:19 +0200 Subject: [PATCH 2/5] including options inside parameters object --- .storybook/preview.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 470b3da465..21d01f9c06 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -15,7 +15,6 @@ import { } from '../src'; import {AVAILABLE_THEMES, Movistar} from './themes'; import {addons} from '@storybook/addons'; -import {addParameters} from '@storybook/react'; import type {ColorScheme, ThemeConfig} from '../src'; @@ -119,12 +118,6 @@ export const decorators = [withLayoutDecorator, withMisticaThemeProvider]; export const parameters = { // https://storybook.js.org/docs/react/configure/story-layout layout: 'fullscreen', - - // Workaround for: https://github.com/storybookjs/storybook/issues/17098 - docs: {source: {type: 'code'}}, -}; - -addParameters({ options: { storySort: { method: 'alphabetical', @@ -142,4 +135,6 @@ addParameters({ locales: 'en-US', }, }, -}); + // Workaround for: https://github.com/storybookjs/storybook/issues/17098 + docs: {source: {type: 'code'}}, +}; From 2df3cbfc17b03356a53def7cbc1a57bc7f137c40 Mon Sep 17 00:00:00 2001 From: Yayo Date: Thu, 17 Aug 2023 01:23:02 +0200 Subject: [PATCH 3/5] storybook documentation link --- .storybook/preview.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 21d01f9c06..c11cc843bd 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -118,6 +118,8 @@ export const decorators = [withLayoutDecorator, withMisticaThemeProvider]; export const parameters = { // https://storybook.js.org/docs/react/configure/story-layout layout: 'fullscreen', + + // https://storybook.js.org/docs/7.2/react/writing-stories/naming-components-and-hierarchy#sorting-stories options: { storySort: { method: 'alphabetical', From f85c7992de3aedc0ee3dbc5d221b2194701296e4 Mon Sep 17 00:00:00 2001 From: Yayo Date: Thu, 17 Aug 2023 10:53:22 +0200 Subject: [PATCH 4/5] sort categories --- .storybook/preview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index c11cc843bd..71142e3b23 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -126,9 +126,9 @@ export const parameters = { order: [ 'Welcome', 'Components', + 'Patterns', 'Layout', 'Icons', - 'Patterns', 'Utilities', 'Hooks', 'Mística Lab', From 0a223454a7ed7d53831c3da25c7af082f0f945ed Mon Sep 17 00:00:00 2001 From: Yayo Date: Thu, 17 Aug 2023 11:05:44 +0200 Subject: [PATCH 5/5] Update preview.tsx --- .storybook/preview.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 71142e3b23..8a1fec8f69 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -134,7 +134,6 @@ export const parameters = { 'Mística Lab', 'Community', ], - locales: 'en-US', }, }, // Workaround for: https://github.com/storybookjs/storybook/issues/17098