Skip to content

Commit

Permalink
Merge pull request #251 from dartess/storybook-8
Browse files Browse the repository at this point in the history
Storybook 8
  • Loading branch information
hipstersmoothie committed Mar 15, 2024
2 parents 730d9c9 + 319fe28 commit d2f9880
Show file tree
Hide file tree
Showing 11 changed files with 2,116 additions and 2,155 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Use Node.js 16
- name: Use Node.js 18
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 18.x
- name: npm install, build, and lint
run: |
yarn
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- name: Prepare repository
run: git fetch --unshallow --tags

- name: Use Node.js 16.x
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 18.x

- name: Create Release
env:
Expand Down
32 changes: 10 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
"release": "auto shipit"
},
"dependencies": {
"@storybook/addons": "^7.0.0",
"@storybook/manager-api": "^7.0.0",
"@storybook/components": "^7.0.0",
"@storybook/core-events": "^7.0.0",
"@storybook/components": "^8.0.0",
"@storybook/core-events": "^8.0.0",
"@storybook/global": "^5.0.0",
"@storybook/theming": "^7.0.0",
"@storybook/icons": "^1.2.5",
"@storybook/manager-api": "^8.0.0",
"@storybook/theming": "^8.0.0",
"fast-deep-equal": "^3.1.3",
"memoizerific": "^1.11.3"
},
Expand All @@ -50,9 +50,9 @@
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@storybook/builder-vite": "7.0.0",
"@storybook/react": "7.0.0",
"@storybook/react-vite": "7.0.0",
"@storybook/builder-vite": "8.0.0",
"@storybook/react": "8.0.0",
"@storybook/react-vite": "8.0.0",
"@types/node": "^18.11.11",
"@types/react": "^18.0.26",
"@typescript-eslint/eslint-plugin": "5.45.1",
Expand All @@ -72,22 +72,10 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^3.0.2",
"storybook": "7.0.0",
"storybook": "8.0.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.3",
"vite": "^4.1.4"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
"vite": "^5.1.3"
},
"auto": {
"extends": "hipstersmoothie"
Expand Down
6 changes: 2 additions & 4 deletions src/Tool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import { global } from '@storybook/global';
import { themes, ThemeVars } from '@storybook/theming';
import { IconButton } from '@storybook/components';
import { MoonIcon, SunIcon } from '@storybook/icons';
import {
STORY_CHANGED,
SET_STORIES,
Expand All @@ -11,9 +12,6 @@ import { API, useParameter } from '@storybook/manager-api';
import equal from 'fast-deep-equal';
import { DARK_MODE_EVENT_NAME, UPDATE_DARK_MODE_EVENT_NAME } from './constants';

import { Sun } from './icons/Sun';
import { Moon } from './icons/Moon';

const { document, window } = global as { document: Document; window: Window };
const modes = ['light', 'dark'] as const;
type Mode = typeof modes[number];
Expand Down Expand Up @@ -260,7 +258,7 @@ export function DarkMode({ api }: DarkModeProps) {
}
onClick={handleIconClick}
>
{isDark ? <Sun /> : <Moon />}
{isDark ? <SunIcon aria-hidden="true" /> : <MoonIcon aria-hidden="true" />}
</IconButton>
);
}
Expand Down
19 changes: 0 additions & 19 deletions src/icons/Moon.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions src/icons/Sun.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { addons } from '@storybook/addons';
import { addons } from '@storybook/manager-api';
import { DARK_MODE_EVENT_NAME } from './constants';
import { store } from './Tool';

Expand Down
5 changes: 3 additions & 2 deletions src/preset/manager.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { addons, types } from '@storybook/addons';
import { addons } from '@storybook/manager-api';
import { Addon_TypesEnum } from '@storybook/types';
import { themes } from '@storybook/theming';
import * as React from 'react';

Expand All @@ -18,7 +19,7 @@ addons.setConfig({
addons.register('storybook/dark-mode', (api) => {
addons.add('storybook/dark-mode', {
title: 'dark mode',
type: types.TOOL,
type: Addon_TypesEnum.TOOL,
match: ({ viewMode }) => viewMode === 'story' || viewMode === 'docs',
render: () => <Tool api={api} />,
});
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["src/**/*", "typings/**/*"]
"include": ["src/**/*"]
}
1 change: 0 additions & 1 deletion typings/storybook-components.d.ts

This file was deleted.

Loading

0 comments on commit d2f9880

Please sign in to comment.