Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #3

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js 16
uses: actions/setup-node@v1
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 18.x
- name: npm install, build, and lint
run: |
yarn
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Prepare repository
run: git fetch --unshallow --tags

- name: Use Node.js 16.x
uses: actions/setup-node@v1
- name: Use Node.js 18.x
uses: actions/setup-node@v4
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