From 08144a8490889a878ede99be5f276abcbc141520 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 00:43:53 +0000 Subject: [PATCH 1/3] Bump ip from 1.1.8 to 1.1.9 Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9. - [Commits](https://github.com/indutny/node-ip/compare/v1.1.8...v1.1.9) --- updated-dependencies: - dependency-name: ip dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e52d7b40..88b50a6c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12046,9 +12046,9 @@ __metadata: linkType: hard "ip@npm:^1.1.5": - version: 1.1.8 - resolution: "ip@npm:1.1.8" - checksum: ab32a5ecfa678d4c158c1381c4c6744fce89a1d793e1b6635ba79d0753c069030b672d765887b6fff55670c711dfa47475895e5d6013efbbcf04687c51cb8db9 + version: 1.1.9 + resolution: "ip@npm:1.1.9" + checksum: 5af58bfe2110c9978acfd77a2ffcdf9d33a6ce1c72f49edbaf16958f7a8eb979b5163e43bb18938caf3aaa55cdacde4e470874c58ca3b4b112ea7a30461a0c27 languageName: node linkType: hard From ba2212d64bdab83798c41fe0a3b79a069f57d158 Mon Sep 17 00:00:00 2001 From: Narin Ratana Date: Wed, 21 Feb 2024 15:20:13 -0800 Subject: [PATCH 2/3] Fix dark mode for docs on storybook web --- packages/components/.storybook/web/preview.ts | 12 -------- .../components/.storybook/web/preview.tsx | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+), 12 deletions(-) delete mode 100644 packages/components/.storybook/web/preview.ts create mode 100644 packages/components/.storybook/web/preview.tsx diff --git a/packages/components/.storybook/web/preview.ts b/packages/components/.storybook/web/preview.ts deleted file mode 100644 index 3c8ab3ce..00000000 --- a/packages/components/.storybook/web/preview.ts +++ /dev/null @@ -1,12 +0,0 @@ -export const parameters = { - actions: { argTypesRegex: '^on[A-Z].*' }, - controls: { - matchers: { - color: /(background|color)$/i, - date: /Date$/, - }, - }, - darkMode: { - stylePreview: true, - }, -} diff --git a/packages/components/.storybook/web/preview.tsx b/packages/components/.storybook/web/preview.tsx new file mode 100644 index 00000000..73e6a0b7 --- /dev/null +++ b/packages/components/.storybook/web/preview.tsx @@ -0,0 +1,28 @@ +import React from 'react' +import { DocsContainer } from '@storybook/addon-docs' +import { addons } from '@storybook/preview-api' +import { themes } from '@storybook/theming' +import { useDarkMode } from 'storybook-dark-mode' + +const channel = addons.getChannel() + +export const parameters = { + actions: { argTypesRegex: '^on[A-Z].*' }, + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/, + }, + }, + darkMode: { + stylePreview: true, + }, + docs: { + container: (props) => { + const isDark = useDarkMode() + const currentProps = { ...props } + currentProps.theme = isDark ? themes.dark : themes.light + return React.createElement(DocsContainer, currentProps) + }, + }, +} From a9eec40f0f8276c208d1aba8e3c9f9060c1cf7a7 Mon Sep 17 00:00:00 2001 From: Narin Ratana Date: Wed, 21 Feb 2024 15:22:08 -0800 Subject: [PATCH 3/3] Remove unused import/var --- packages/components/.storybook/web/preview.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/components/.storybook/web/preview.tsx b/packages/components/.storybook/web/preview.tsx index 73e6a0b7..eaa6f79c 100644 --- a/packages/components/.storybook/web/preview.tsx +++ b/packages/components/.storybook/web/preview.tsx @@ -1,11 +1,8 @@ import React from 'react' import { DocsContainer } from '@storybook/addon-docs' -import { addons } from '@storybook/preview-api' import { themes } from '@storybook/theming' import { useDarkMode } from 'storybook-dark-mode' -const channel = addons.getChannel() - export const parameters = { actions: { argTypesRegex: '^on[A-Z].*' }, controls: {