@vueless/storybook-dark-mode 10.0.4-beta.1 → 10.0.5-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manager.js +5 -2
- package/package.json +1 -1
- package/src/Tool.tsx +6 -3
package/dist/manager.js
CHANGED
|
@@ -2,7 +2,7 @@ import { addons, useParameter } from 'storybook/manager-api';
|
|
|
2
2
|
import { Addon_TypesEnum } from 'storybook/internal/types';
|
|
3
3
|
import { themes } from 'storybook/theming';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { Button } from 'storybook/internal/components';
|
|
6
6
|
import { SunIcon, MoonIcon } from '@storybook/icons';
|
|
7
7
|
import { STORY_CHANGED, SET_STORIES, DOCS_RENDERED } from 'storybook/internal/core-events';
|
|
8
8
|
import { global } from '@storybook/global';
|
|
@@ -169,10 +169,13 @@ function DarkMode({ api }) {
|
|
|
169
169
|
}
|
|
170
170
|
}, [defaultMode, updateMode, userHasExplicitlySetTheTheme]);
|
|
171
171
|
return /* @__PURE__ */ React.createElement(
|
|
172
|
-
|
|
172
|
+
Button,
|
|
173
173
|
{
|
|
174
174
|
key: "dark-mode",
|
|
175
|
+
variant: "ghost",
|
|
176
|
+
padding: "small",
|
|
175
177
|
title: isDark ? "Change theme to light mode" : "Change theme to dark mode",
|
|
178
|
+
"aria-label": isDark ? "Change theme to light mode" : "Change theme to dark mode",
|
|
176
179
|
onClick: handleIconClick
|
|
177
180
|
},
|
|
178
181
|
isDark ? /* @__PURE__ */ React.createElement(SunIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ React.createElement(MoonIcon, { "aria-hidden": "true" })
|
package/package.json
CHANGED
package/src/Tool.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Button } from "storybook/internal/components";
|
|
3
3
|
import { MoonIcon, SunIcon } from "@storybook/icons";
|
|
4
4
|
import { API, useParameter } from "storybook/manager-api";
|
|
5
5
|
import { SET_STORIES, DOCS_RENDERED, STORY_CHANGED } from "storybook/internal/core-events";
|
|
@@ -132,13 +132,16 @@ export function DarkMode({ api }: DarkModeProps) {
|
|
|
132
132
|
}, [defaultMode, updateMode, userHasExplicitlySetTheTheme]);
|
|
133
133
|
|
|
134
134
|
return (
|
|
135
|
-
<
|
|
135
|
+
<Button
|
|
136
136
|
key="dark-mode"
|
|
137
|
+
variant="ghost"
|
|
138
|
+
padding="small"
|
|
137
139
|
title={isDark ? "Change theme to light mode" : "Change theme to dark mode"}
|
|
140
|
+
aria-label={isDark ? "Change theme to light mode" : "Change theme to dark mode"}
|
|
138
141
|
onClick={handleIconClick}
|
|
139
142
|
>
|
|
140
143
|
{isDark ? <SunIcon aria-hidden="true" /> : <MoonIcon aria-hidden="true" />}
|
|
141
|
-
</
|
|
144
|
+
</Button>
|
|
142
145
|
);
|
|
143
146
|
}
|
|
144
147
|
|