@carbon/storybook-addon-theme 2.0.3 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Panel.js +19 -10
- package/dist/Panel.js.map +1 -1
- package/dist/components/PanelContent.js +20 -11
- package/dist/components/PanelContent.js.map +1 -1
- package/dist/constants.js +16 -5
- package/dist/constants.js.map +1 -1
- package/dist/decorators/withCarbonTheme.js +14 -6
- package/dist/decorators/withCarbonTheme.js.map +1 -1
- package/dist/manager.js +9 -6
- package/dist/manager.js.map +1 -1
- package/dist/preset.js +8 -2
- package/dist/preset.js.map +1 -1
- package/package.json +13 -13
package/dist/Panel.js
CHANGED
@@ -1,24 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Panel = void 0;
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
8
|
+
var _managerApi = require("@storybook/manager-api");
|
9
|
+
var _components = require("@storybook/components");
|
10
|
+
var _constants = require("./constants");
|
11
|
+
var _PanelContent = require("./components/PanelContent");
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1
13
|
/**
|
2
14
|
* Copyright IBM Corp. 2023, 2023
|
3
15
|
*
|
4
16
|
* This source code is licensed under the Apache-2.0 license found in the
|
5
17
|
* LICENSE file in the root directory of this source tree.
|
6
18
|
*/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
export const Panel = props => {
|
13
|
-
const [globals, updateGlobals] = useGlobals();
|
14
|
-
const globalCarbonTheme = globals[PARAM_KEY];
|
15
|
-
return /*#__PURE__*/React.createElement(AddonPanel, props, /*#__PURE__*/React.createElement(PanelContent, {
|
19
|
+
|
20
|
+
const Panel = props => {
|
21
|
+
const [globals, updateGlobals] = (0, _managerApi.useGlobals)();
|
22
|
+
const globalCarbonTheme = globals[_constants.PARAM_KEY];
|
23
|
+
return /*#__PURE__*/_react.default.createElement(_components.AddonPanel, props, /*#__PURE__*/_react.default.createElement(_PanelContent.PanelContent, {
|
16
24
|
theme: globalCarbonTheme,
|
17
25
|
onChange: value => {
|
18
26
|
updateGlobals({
|
19
|
-
[PARAM_KEY]: value
|
27
|
+
[_constants.PARAM_KEY]: value
|
20
28
|
});
|
21
29
|
}
|
22
30
|
}));
|
23
31
|
};
|
32
|
+
exports.Panel = Panel;
|
24
33
|
//# sourceMappingURL=Panel.js.map
|
package/dist/Panel.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Panel.js","names":["
|
1
|
+
{"version":3,"file":"Panel.js","names":["_react","_interopRequireDefault","require","_managerApi","_components","_constants","_PanelContent","obj","__esModule","default","Panel","props","globals","updateGlobals","useGlobals","globalCarbonTheme","PARAM_KEY","createElement","AddonPanel","PanelContent","theme","onChange","value","exports"],"sources":["../src/Panel.js"],"sourcesContent":["/**\n * Copyright IBM Corp. 2023, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from 'react';\nimport { useGlobals } from '@storybook/manager-api';\n\nimport { AddonPanel } from '@storybook/components';\nimport { PARAM_KEY } from './constants';\nimport { PanelContent } from './components/PanelContent';\n\nexport const Panel = (props) => {\n const [globals, updateGlobals] = useGlobals();\n const globalCarbonTheme = globals[PARAM_KEY];\n\n return (\n <AddonPanel {...props}>\n <PanelContent\n theme={globalCarbonTheme}\n onChange={(value) => {\n updateGlobals({ [PARAM_KEY]: value });\n }}\n />\n </AddonPanel>\n );\n};\n"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAAyD,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAXzD;AACA;AACA;AACA;AACA;AACA;;AAQO,MAAMG,KAAK,GAAIC,KAAK,IAAK;EAC9B,MAAM,CAACC,OAAO,EAAEC,aAAa,CAAC,GAAG,IAAAC,sBAAU,EAAC,CAAC;EAC7C,MAAMC,iBAAiB,GAAGH,OAAO,CAACI,oBAAS,CAAC;EAE5C,oBACEhB,MAAA,CAAAS,OAAA,CAAAQ,aAAA,CAACb,WAAA,CAAAc,UAAU,EAAKP,KAAK,eACnBX,MAAA,CAAAS,OAAA,CAAAQ,aAAA,CAACX,aAAA,CAAAa,YAAY;IACXC,KAAK,EAAEL,iBAAkB;IACzBM,QAAQ,EAAGC,KAAK,IAAK;MACnBT,aAAa,CAAC;QAAE,CAACG,oBAAS,GAAGM;MAAM,CAAC,CAAC;IACvC;EAAE,CACH,CACS,CAAC;AAEjB,CAAC;AAACC,OAAA,CAAAb,KAAA,GAAAA,KAAA"}
|
@@ -1,34 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.PanelContent = void 0;
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
8
|
+
var _components = require("@storybook/components");
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
10
|
+
var _constants = require("../constants");
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1
12
|
/**
|
2
13
|
* Copyright IBM Corp. 2023, 2023
|
3
14
|
*
|
4
15
|
* This source code is licensed under the Apache-2.0 license found in the
|
5
16
|
* LICENSE file in the root directory of this source tree.
|
6
17
|
*/
|
7
|
-
|
8
|
-
|
9
|
-
import PropTypes from 'prop-types';
|
10
|
-
import { CARBON_THEMES } from '../constants';
|
11
|
-
export const PanelContent = ({
|
18
|
+
|
19
|
+
const PanelContent = ({
|
12
20
|
theme,
|
13
21
|
onChange
|
14
22
|
}) => {
|
15
|
-
const themes = Object.values(CARBON_THEMES);
|
16
|
-
return /*#__PURE__*/
|
23
|
+
const themes = Object.values(_constants.CARBON_THEMES);
|
24
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_components.Form, null, /*#__PURE__*/_react.default.createElement(_components.Form.Field, {
|
17
25
|
label: "Select Carbon theme:"
|
18
|
-
}, /*#__PURE__*/
|
26
|
+
}, /*#__PURE__*/_react.default.createElement(_components.Form.Select, {
|
19
27
|
name: "carbon-theme",
|
20
28
|
value: theme,
|
21
29
|
onChange: ev => {
|
22
30
|
onChange && onChange(ev.target.value);
|
23
31
|
},
|
24
32
|
size: "flex"
|
25
|
-
}, themes.map(option => /*#__PURE__*/
|
33
|
+
}, themes.map(option => /*#__PURE__*/_react.default.createElement("option", {
|
26
34
|
key: option,
|
27
35
|
value: option
|
28
36
|
}, option))))));
|
29
37
|
};
|
38
|
+
exports.PanelContent = PanelContent;
|
30
39
|
PanelContent.propTypes = {
|
31
|
-
onChange:
|
32
|
-
theme:
|
40
|
+
onChange: _propTypes.default.func,
|
41
|
+
theme: _propTypes.default.string
|
33
42
|
};
|
34
43
|
//# sourceMappingURL=PanelContent.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PanelContent.js","names":["
|
1
|
+
{"version":3,"file":"PanelContent.js","names":["_react","_interopRequireDefault","require","_components","_propTypes","_constants","obj","__esModule","default","PanelContent","theme","onChange","themes","Object","values","CARBON_THEMES","createElement","Form","Field","label","Select","name","value","ev","target","size","map","option","key","exports","propTypes","PropTypes","func","string"],"sources":["../../src/components/PanelContent.js"],"sourcesContent":["/**\n * Copyright IBM Corp. 2023, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from 'react';\nimport { Form } from '@storybook/components';\nimport PropTypes from 'prop-types';\nimport { CARBON_THEMES } from '../constants';\n\nexport const PanelContent = ({ theme, onChange }) => {\n const themes = Object.values(CARBON_THEMES);\n\n return (\n <div>\n <Form>\n <Form.Field label=\"Select Carbon theme:\">\n <Form.Select\n name=\"carbon-theme\"\n value={theme}\n onChange={(ev) => {\n onChange && onChange(ev.target.value);\n }}\n size=\"flex\"\n >\n {themes.map((option) => (\n <option key={option} value={option}>\n {option}\n </option>\n ))}\n </Form.Select>\n </Form.Field>\n </Form>\n </div>\n );\n};\n\nPanelContent.propTypes = {\n onChange: PropTypes.func,\n theme: PropTypes.string,\n};\n"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAA6C,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAT7C;AACA;AACA;AACA;AACA;AACA;;AAMO,MAAMG,YAAY,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAS,CAAC,KAAK;EACnD,MAAMC,MAAM,GAAGC,MAAM,CAACC,MAAM,CAACC,wBAAa,CAAC;EAE3C,oBACEf,MAAA,CAAAQ,OAAA,CAAAQ,aAAA,2BACEhB,MAAA,CAAAQ,OAAA,CAAAQ,aAAA,CAACb,WAAA,CAAAc,IAAI,qBACHjB,MAAA,CAAAQ,OAAA,CAAAQ,aAAA,CAACb,WAAA,CAAAc,IAAI,CAACC,KAAK;IAACC,KAAK,EAAC;EAAsB,gBACtCnB,MAAA,CAAAQ,OAAA,CAAAQ,aAAA,CAACb,WAAA,CAAAc,IAAI,CAACG,MAAM;IACVC,IAAI,EAAC,cAAc;IACnBC,KAAK,EAAEZ,KAAM;IACbC,QAAQ,EAAGY,EAAE,IAAK;MAChBZ,QAAQ,IAAIA,QAAQ,CAACY,EAAE,CAACC,MAAM,CAACF,KAAK,CAAC;IACvC,CAAE;IACFG,IAAI,EAAC;EAAM,GAEVb,MAAM,CAACc,GAAG,CAAEC,MAAM,iBACjB3B,MAAA,CAAAQ,OAAA,CAAAQ,aAAA;IAAQY,GAAG,EAAED,MAAO;IAACL,KAAK,EAAEK;EAAO,GAChCA,MACK,CACT,CACU,CACH,CACR,CACH,CAAC;AAEV,CAAC;AAACE,OAAA,CAAApB,YAAA,GAAAA,YAAA;AAEFA,YAAY,CAACqB,SAAS,GAAG;EACvBnB,QAAQ,EAAEoB,kBAAS,CAACC,IAAI;EACxBtB,KAAK,EAAEqB,kBAAS,CAACE;AACnB,CAAC"}
|
package/dist/constants.js
CHANGED
@@ -1,17 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.TOOL_ID = exports.PARAM_KEY = exports.PANEL_ID = exports.CARBON_THEMES = exports.ADDON_ID = void 0;
|
1
7
|
/**
|
2
8
|
* Copyright IBM Corp. 2023, 2023
|
3
9
|
*
|
4
10
|
* This source code is licensed under the Apache-2.0 license found in the
|
5
11
|
* LICENSE file in the root directory of this source tree.
|
6
12
|
*/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
13
|
+
const ADDON_ID = '@carbon/theme';
|
14
|
+
exports.ADDON_ID = ADDON_ID;
|
15
|
+
const PANEL_ID = `${ADDON_ID}/panel`;
|
16
|
+
exports.PANEL_ID = PANEL_ID;
|
17
|
+
const TOOL_ID = `${ADDON_ID}/tool`;
|
18
|
+
exports.TOOL_ID = TOOL_ID;
|
19
|
+
const PARAM_KEY = 'carbonTheme';
|
20
|
+
exports.PARAM_KEY = PARAM_KEY;
|
21
|
+
const CARBON_THEMES = {
|
12
22
|
white: 'white',
|
13
23
|
g10: 'g10',
|
14
24
|
g90: 'g90',
|
15
25
|
g100: 'g100'
|
16
26
|
};
|
27
|
+
exports.CARBON_THEMES = CARBON_THEMES;
|
17
28
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","names":["ADDON_ID","PANEL_ID","TOOL_ID","PARAM_KEY","CARBON_THEMES","white","g10","g90","g100"],"sources":["../src/constants.js"],"sourcesContent":["/**\n * Copyright IBM Corp. 2023, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nexport const ADDON_ID = '@carbon/theme';\nexport const PANEL_ID = `${ADDON_ID}/panel`;\nexport const TOOL_ID = `${ADDON_ID}/tool`;\nexport const PARAM_KEY = 'carbonTheme';\nexport const CARBON_THEMES = {\n white: 'white',\n g10: 'g10',\n g90: 'g90',\n g100: 'g100',\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;
|
1
|
+
{"version":3,"file":"constants.js","names":["ADDON_ID","exports","PANEL_ID","TOOL_ID","PARAM_KEY","CARBON_THEMES","white","g10","g90","g100"],"sources":["../src/constants.js"],"sourcesContent":["/**\n * Copyright IBM Corp. 2023, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nexport const ADDON_ID = '@carbon/theme';\nexport const PANEL_ID = `${ADDON_ID}/panel`;\nexport const TOOL_ID = `${ADDON_ID}/tool`;\nexport const PARAM_KEY = 'carbonTheme';\nexport const CARBON_THEMES = {\n white: 'white',\n g10: 'g10',\n g90: 'g90',\n g100: 'g100',\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,GAAG,eAAe;AAACC,OAAA,CAAAD,QAAA,GAAAA,QAAA;AACjC,MAAME,QAAQ,GAAI,GAAEF,QAAS,QAAO;AAACC,OAAA,CAAAC,QAAA,GAAAA,QAAA;AACrC,MAAMC,OAAO,GAAI,GAAEH,QAAS,OAAM;AAACC,OAAA,CAAAE,OAAA,GAAAA,OAAA;AACnC,MAAMC,SAAS,GAAG,aAAa;AAACH,OAAA,CAAAG,SAAA,GAAAA,SAAA;AAChC,MAAMC,aAAa,GAAG;EAC3BC,KAAK,EAAE,OAAO;EACdC,GAAG,EAAE,KAAK;EACVC,GAAG,EAAE,KAAK;EACVC,IAAI,EAAE;AACR,CAAC;AAACR,OAAA,CAAAI,aAAA,GAAAA,aAAA"}
|
@@ -1,21 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.withCarbonTheme = void 0;
|
7
|
+
var _previewApi = require("@storybook/preview-api");
|
8
|
+
var _constants = require("../constants");
|
1
9
|
/**
|
2
10
|
* Copyright IBM Corp. 2023, 2023
|
3
11
|
*
|
4
12
|
* This source code is licensed under the Apache-2.0 license found in the
|
5
13
|
* LICENSE file in the root directory of this source tree.
|
6
14
|
*/
|
7
|
-
|
8
|
-
|
9
|
-
export const withCarbonTheme = (StoryFn, context) => {
|
15
|
+
|
16
|
+
const withCarbonTheme = (StoryFn, context) => {
|
10
17
|
const {
|
11
18
|
globals,
|
12
19
|
parameters
|
13
20
|
} = context;
|
14
|
-
const globalCarbonTheme = globals[PARAM_KEY];
|
15
|
-
const storyCarbonTheme = parameters[PARAM_KEY];
|
21
|
+
const globalCarbonTheme = globals[_constants.PARAM_KEY];
|
22
|
+
const storyCarbonTheme = parameters[_constants.PARAM_KEY];
|
16
23
|
|
17
24
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
18
|
-
useEffect(() => {
|
25
|
+
(0, _previewApi.useEffect)(() => {
|
19
26
|
const selector = context.viewMode === 'docs' ? `.sbdocs-preview .docs-story` : '.sb-show-main';
|
20
27
|
const rootElements = document.querySelectorAll(selector);
|
21
28
|
rootElements.forEach(rootElement => {
|
@@ -24,4 +31,5 @@ export const withCarbonTheme = (StoryFn, context) => {
|
|
24
31
|
}, [context.id, context.viewMode, globalCarbonTheme, storyCarbonTheme]);
|
25
32
|
return StoryFn();
|
26
33
|
};
|
34
|
+
exports.withCarbonTheme = withCarbonTheme;
|
27
35
|
//# sourceMappingURL=withCarbonTheme.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"withCarbonTheme.js","names":["
|
1
|
+
{"version":3,"file":"withCarbonTheme.js","names":["_previewApi","require","_constants","withCarbonTheme","StoryFn","context","globals","parameters","globalCarbonTheme","PARAM_KEY","storyCarbonTheme","useEffect","selector","viewMode","rootElements","document","querySelectorAll","forEach","rootElement","setAttribute","id","exports"],"sources":["../../src/decorators/withCarbonTheme.js"],"sourcesContent":["/**\n * Copyright IBM Corp. 2023, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { useEffect } from '@storybook/preview-api';\nimport { PARAM_KEY } from '../constants';\n\nexport const withCarbonTheme = (StoryFn, context) => {\n const { globals, parameters } = context;\n\n const globalCarbonTheme = globals[PARAM_KEY];\n const storyCarbonTheme = parameters[PARAM_KEY];\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n const selector =\n context.viewMode === 'docs'\n ? `.sbdocs-preview .docs-story`\n : '.sb-show-main';\n\n const rootElements = document.querySelectorAll(selector);\n rootElements.forEach((rootElement) => {\n rootElement.setAttribute(\n 'storybook-carbon-theme',\n globalCarbonTheme ?? storyCarbonTheme\n );\n });\n }, [context.id, context.viewMode, globalCarbonTheme, storyCarbonTheme]);\n\n return StoryFn();\n};\n"],"mappings":";;;;;;AAMA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAPA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAME,eAAe,GAAGA,CAACC,OAAO,EAAEC,OAAO,KAAK;EACnD,MAAM;IAAEC,OAAO;IAAEC;EAAW,CAAC,GAAGF,OAAO;EAEvC,MAAMG,iBAAiB,GAAGF,OAAO,CAACG,oBAAS,CAAC;EAC5C,MAAMC,gBAAgB,GAAGH,UAAU,CAACE,oBAAS,CAAC;;EAE9C;EACA,IAAAE,qBAAS,EAAC,MAAM;IACd,MAAMC,QAAQ,GACZP,OAAO,CAACQ,QAAQ,KAAK,MAAM,GACtB,6BAA4B,GAC7B,eAAe;IAErB,MAAMC,YAAY,GAAGC,QAAQ,CAACC,gBAAgB,CAACJ,QAAQ,CAAC;IACxDE,YAAY,CAACG,OAAO,CAAEC,WAAW,IAAK;MACpCA,WAAW,CAACC,YAAY,CACtB,wBAAwB,EACxBX,iBAAiB,IAAIE,gBACvB,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,EAAE,CAACL,OAAO,CAACe,EAAE,EAAEf,OAAO,CAACQ,QAAQ,EAAEL,iBAAiB,EAAEE,gBAAgB,CAAC,CAAC;EAEvE,OAAON,OAAO,CAAC,CAAC;AAClB,CAAC;AAACiB,OAAA,CAAAlB,eAAA,GAAAA,eAAA"}
|
package/dist/manager.js
CHANGED
@@ -1,18 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _managerApi = require("@storybook/manager-api");
|
4
|
+
var _Panel = require("./Panel");
|
1
5
|
/**
|
2
6
|
* Copyright IBM Corp. 2023, 2023
|
3
7
|
*
|
4
8
|
* This source code is licensed under the Apache-2.0 license found in the
|
5
9
|
* LICENSE file in the root directory of this source tree.
|
6
10
|
*/
|
7
|
-
|
8
|
-
import { Panel } from './Panel';
|
11
|
+
|
9
12
|
const ADDON_ID = 'carbonTheme';
|
10
13
|
const PANEL_ID = `${ADDON_ID}/panel`;
|
11
|
-
addons.register(ADDON_ID, () => {
|
12
|
-
addons.add(PANEL_ID, {
|
13
|
-
type: types.PANEL,
|
14
|
+
_managerApi.addons.register(ADDON_ID, () => {
|
15
|
+
_managerApi.addons.add(PANEL_ID, {
|
16
|
+
type: _managerApi.types.PANEL,
|
14
17
|
title: 'Carbon Theme',
|
15
|
-
render: Panel
|
18
|
+
render: _Panel.Panel
|
16
19
|
});
|
17
20
|
});
|
18
21
|
//# sourceMappingURL=manager.js.map
|
package/dist/manager.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"manager.js","names":["
|
1
|
+
{"version":3,"file":"manager.js","names":["_managerApi","require","_Panel","ADDON_ID","PANEL_ID","addons","register","add","type","types","PANEL","title","render","Panel"],"sources":["../src/manager.js"],"sourcesContent":["/**\n * Copyright IBM Corp. 2023, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { addons, types } from '@storybook/manager-api';\n\nimport { Panel } from './Panel';\n\nconst ADDON_ID = 'carbonTheme';\nconst PANEL_ID = `${ADDON_ID}/panel`;\n\naddons.register(ADDON_ID, () => {\n addons.add(PANEL_ID, {\n type: types.PANEL,\n title: 'Carbon Theme',\n render: Panel,\n });\n});\n"],"mappings":";;AAMA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;AACA;AACA;AACA;;AAKA,MAAME,QAAQ,GAAG,aAAa;AAC9B,MAAMC,QAAQ,GAAI,GAAED,QAAS,QAAO;AAEpCE,kBAAM,CAACC,QAAQ,CAACH,QAAQ,EAAE,MAAM;EAC9BE,kBAAM,CAACE,GAAG,CAACH,QAAQ,EAAE;IACnBI,IAAI,EAAEC,iBAAK,CAACC,KAAK;IACjBC,KAAK,EAAE,cAAc;IACrBC,MAAM,EAAEC;EACV,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/preset.js
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
1
7
|
/**
|
2
8
|
* Copyright IBM Corp. 2023, 2023
|
3
9
|
*
|
@@ -7,8 +13,8 @@
|
|
7
13
|
function managerEntries(entry = []) {
|
8
14
|
return [...entry, require.resolve('./manager')]; //👈 Addon implementation
|
9
15
|
}
|
10
|
-
|
11
|
-
export default {
|
16
|
+
var _default = {
|
12
17
|
managerEntries
|
13
18
|
};
|
19
|
+
exports.default = _default;
|
14
20
|
//# sourceMappingURL=preset.js.map
|
package/dist/preset.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"preset.js","names":["managerEntries","entry","require","resolve"],"sources":["../src/preset.js"],"sourcesContent":["/**\n * Copyright IBM Corp. 2023, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nfunction managerEntries(entry = []) {\n return [...entry, require.resolve('./manager')]; //👈 Addon implementation\n}\n\nexport default { managerEntries };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,cAAcA,CAACC,KAAK,GAAG,EAAE,EAAE;EAClC,OAAO,CAAC,GAAGA,KAAK,EAAEC,OAAO,CAACC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACnD
|
1
|
+
{"version":3,"file":"preset.js","names":["managerEntries","entry","require","resolve","_default","exports","default"],"sources":["../src/preset.js"],"sourcesContent":["/**\n * Copyright IBM Corp. 2023, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nfunction managerEntries(entry = []) {\n return [...entry, require.resolve('./manager')]; //👈 Addon implementation\n}\n\nexport default { managerEntries };\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,cAAcA,CAACC,KAAK,GAAG,EAAE,EAAE;EAClC,OAAO,CAAC,GAAGA,KAAK,EAAEC,OAAO,CAACC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACnD;AAAC,IAAAC,QAAA,GAEc;EAAEJ;AAAe,CAAC;AAAAK,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/storybook-addon-theme",
|
3
3
|
"description": "Carbon theme switcher for Storybook",
|
4
|
-
"version": "2.0.
|
4
|
+
"version": "2.0.5",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "dist/react.js",
|
7
7
|
"repository": {
|
@@ -42,23 +42,23 @@
|
|
42
42
|
"vue": "*"
|
43
43
|
},
|
44
44
|
"dependencies": {
|
45
|
-
"@storybook/addons": "^7.
|
46
|
-
"@storybook/api": "^7.
|
47
|
-
"@storybook/client-api": "^7.
|
48
|
-
"@storybook/client-logger": "^7.
|
49
|
-
"@storybook/components": "^7.
|
50
|
-
"@storybook/core-events": "^7.
|
51
|
-
"@storybook/theming": "^7.
|
52
|
-
"core-js": "^3.
|
45
|
+
"@storybook/addons": "^7.2.3",
|
46
|
+
"@storybook/api": "^7.2.3",
|
47
|
+
"@storybook/client-api": "^7.2.3",
|
48
|
+
"@storybook/client-logger": "^7.2.3",
|
49
|
+
"@storybook/components": "^7.2.3",
|
50
|
+
"@storybook/core-events": "^7.2.3",
|
51
|
+
"@storybook/theming": "^7.2.3",
|
52
|
+
"core-js": "^3.32.0",
|
53
53
|
"global": "^4.4.0"
|
54
54
|
},
|
55
55
|
"devDependencies": {
|
56
|
-
"@babel/cli": "^7.22.
|
57
|
-
"@babel/core": "^7.22.
|
56
|
+
"@babel/cli": "^7.22.10",
|
57
|
+
"@babel/core": "^7.22.10",
|
58
58
|
"@babel/preset-react": "^7.22.5",
|
59
|
-
"npm-check-updates": "^16.
|
59
|
+
"npm-check-updates": "^16.11.1",
|
60
60
|
"npm-run-all": "^4.1.5",
|
61
61
|
"rimraf": "^5.0.1"
|
62
62
|
},
|
63
|
-
"gitHead": "
|
63
|
+
"gitHead": "3379b9af8e581eb50ec510e8a81248b4ec6d439d"
|
64
64
|
}
|