-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storybook-config): add Carbon Theme & Type Panel (#7569)
* feat(storybook-config): add custom panel * storybook config custom preset with create-react-app package * storybook config custom presets - need to transpile * storybook-config-custom-presets: added babel cli & babel core * stuck on panel rendering with custom properties variable * stuck on panel rendering with custom properties variable * testing file path * panel is showing up - just not fully functioning * feat(storybook-config): add theme and type addon panels * chore: remove theme addon files * feat(storybook-config): add theme and type addon panels - added copyright headers * feat(storybook-config): ran yarn dedupe * feat(storybook-config): make custom panel conditionally appear * chore(storybook-config): remove merge messages Co-authored-by: Andrea N. Cardona <[email protected]>
- Loading branch information
1 parent
7cb28b4
commit 0bdea69
Showing
54 changed files
with
324 additions
and
209 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+4.1 KB
...rame-npm-7.10.4-ab1ee3c93e-05245d3b22.zip → ...ame-npm-7.12.11-1a9a1b277f-033d3fb3bf.zip
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+33.2 KB
...ator-npm-7.12.5-e9ae5c4dd3-7706cb3d29.zip → ...tor-npm-7.12.11-76629b27f8-eb76477ff8.zip
Binary file not shown.
Binary file renamed
BIN
+4.01 KB
...name-npm-7.10.4-153d80f559-41ab8f48bb.zip → ...ame-npm-7.12.11-53931a5dc0-f41ccc145c.zip
Binary file not shown.
Binary file renamed
BIN
+2.95 KB
...rity-npm-7.10.4-29a99c32bb-4f0ddd4340.zip → ...ity-npm-7.12.10-cb02cbb9f3-5c645ed43c.zip
Binary file not shown.
Binary file removed
BIN
-4.94 KB
...n/cache/@babel-helper-member-expression-to-functions-npm-7.10.4-f37252d84b-512a2008f6.zip
Binary file not shown.
Binary file added
BIN
+13.8 KB
...n/cache/@babel-helper-member-expression-to-functions-npm-7.12.7-174834b465-313e78a217.zip
Binary file not shown.
Binary file renamed
BIN
+6.67 KB
...orts-npm-7.10.4-f55d85af2c-84d03b58e7.zip → ...orts-npm-7.12.5-76d7bcabe9-7f63b03496.zip
Binary file not shown.
Binary file removed
BIN
-11.3 KB
.yarn/cache/@babel-helper-module-transforms-npm-7.10.5-39c6d857ed-02a2b60705.zip
Binary file not shown.
Binary file added
BIN
+12 KB
.yarn/cache/@babel-helper-module-transforms-npm-7.12.1-c42d2455d3-902ed2b8e9.zip
Binary file not shown.
Binary file removed
BIN
-3.12 KB
.yarn/cache/@babel-helper-optimise-call-expression-npm-7.10.4-135301e242-70dd5a6daf.zip
Binary file not shown.
Binary file added
BIN
+3.1 KB
.yarn/cache/@babel-helper-optimise-call-expression-npm-7.12.10-1735a7949f-e96f37e943.zip
Binary file not shown.
Binary file removed
BIN
-4.33 KB
.yarn/cache/@babel-helper-replace-supers-npm-7.10.4-8bf69fb844-2d7e0627cd.zip
Binary file not shown.
Binary file added
BIN
+4.33 KB
.yarn/cache/@babel-helper-replace-supers-npm-7.12.11-db1c1661de-0696dcff97.zip
Binary file not shown.
Binary file removed
BIN
-3.48 KB
.yarn/cache/@babel-helper-simple-access-npm-7.10.4-0a4bf355e6-a7ce52a229.zip
Binary file not shown.
Binary file added
BIN
+3.43 KB
.yarn/cache/@babel-helper-simple-access-npm-7.12.1-18caff947e-ca44e3f694.zip
Binary file not shown.
Binary file removed
BIN
-3.39 KB
.yarn/cache/@babel-helper-split-export-declaration-npm-7.11.0-d39c69702f-ddfc44d0cf.zip
Binary file not shown.
Binary file added
BIN
+3.38 KB
.yarn/cache/@babel-helper-split-export-declaration-npm-7.12.11-c2789c09f5-c2c8525116.zip
Binary file not shown.
Binary file renamed
BIN
+8.97 KB
...fier-npm-7.10.4-0689d787fa-25098ef842.zip → ...ier-npm-7.12.11-e33455648e-18de432203.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+10.4 KB
...late-npm-7.10.4-521586243b-23a5c4f7ab.zip → ...late-npm-7.12.7-ea87424ec4-6e0a050be7.zip
Binary file not shown.
Binary file renamed
BIN
+48.3 KB
...erse-npm-7.12.9-2eb67583a9-6797d3f42d.zip → ...rse-npm-7.12.12-624e94788e-d3af59ec9d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+31.2 KB
.yarn/cache/@nicolo-ribaudo-chokidar-2-npm-2.1.8-no-fsevents-a21a333eb4-0efeea3b7d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Copyright IBM Corp. 2021, 2021 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
module.exports = { | ||
presets: ['@babel/preset-env', '@babel/preset-react'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
config/storybook-preset-carbon/carbon-theme-addon/src/preset.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Copyright IBM Corp. 2021, 2021 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = { | ||
managerEntries(entry = []) { | ||
return [...entry, require.resolve('./register')]; | ||
}, | ||
}; |
36 changes: 36 additions & 0 deletions
36
config/storybook-preset-carbon/carbon-theme-addon/src/register.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright IBM Corp. 2021, 2021 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { addons } from '@storybook/addons'; | ||
import { CarbonThemePanel, CarbonTypePanel } from './components/Panel'; | ||
import { | ||
CARBON_THEMES_ADDON_ID, | ||
CARBON_THEME_PANEL_ID, | ||
CARBON_TYPE_ADDON_ID, | ||
CARBON_TYPE_PANEL_ID, | ||
} from './shared'; | ||
|
||
// Disabling because storybook addons doesn't provide proptypes or display names for these panels | ||
/* eslint-disable react/display-name, react/prop-types */ | ||
addons.register(CARBON_THEMES_ADDON_ID, (api) => { | ||
addons.addPanel(CARBON_THEME_PANEL_ID, { | ||
title: 'Carbon Theme', | ||
render: ({ active, key }) => ( | ||
<CarbonThemePanel api={api} key={key} active={active} /> | ||
), | ||
}); | ||
}); | ||
|
||
addons.register(CARBON_TYPE_ADDON_ID, (api) => { | ||
addons.addPanel(CARBON_TYPE_PANEL_ID, { | ||
title: 'Carbon Type', | ||
render: ({ active, key }) => ( | ||
<CarbonTypePanel api={api} key={key} active={active} /> | ||
), | ||
}); | ||
}); |
13 changes: 13 additions & 0 deletions
13
config/storybook-preset-carbon/carbon-theme-addon/src/shared.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Copyright IBM Corp. 2021, 2021 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
export const CARBON_THEMES_ADDON_ID = 'carbon-theme'; | ||
export const CARBON_CURRENT_THEME = `${CARBON_THEMES_ADDON_ID}/current`; | ||
export const CARBON_THEME_PANEL_ID = `${CARBON_THEMES_ADDON_ID}/panel`; | ||
export const CARBON_TYPE_ADDON_ID = 'carbon-type'; | ||
export const CARBON_TYPE_TOKEN = `${CARBON_TYPE_ADDON_ID}/type`; | ||
export const CARBON_TYPE_PANEL_ID = `${CARBON_TYPE_ADDON_ID}/panel`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.