-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3598e8b
commit ee794d5
Showing
30 changed files
with
612 additions
and
482 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
|
||
// require syntax is used to enable overwriting objects from the original module | ||
const reactNavi = require('react-navi'); | ||
const reactNavi = require("react-navi"); | ||
|
||
const originalUseCurrentRoute = reactNavi.useCurrentRoute; | ||
const originalUseNavigation = reactNavi.useNavigation; | ||
|
||
function reactNaviDecorator(story, { parameters }) { | ||
delete reactNavi["useCurrentRoute"]; | ||
reactNavi.useCurrentRoute = parameters?.reactNavi?.useCurrentRoute ?? originalUseCurrentRoute; | ||
reactNavi.useCurrentRoute = | ||
parameters?.reactNavi?.useCurrentRoute ?? originalUseCurrentRoute; | ||
|
||
delete reactNavi["useNavigation"]; | ||
reactNavi.useNavigation = parameters?.reactNavi?.useNavigation ?? originalUseNavigation; | ||
reactNavi.useNavigation = | ||
parameters?.reactNavi?.useNavigation ?? originalUseNavigation; | ||
|
||
return story(); | ||
return story(); | ||
} | ||
|
||
reactNavi['reactNaviDecorator'] = reactNaviDecorator; | ||
reactNavi["reactNaviDecorator"] = reactNaviDecorator; | ||
|
||
module.exports = reactNavi; | ||
module.exports = reactNavi; |
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 |
---|---|---|
@@ -1,35 +1,45 @@ | ||
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin"); | ||
module.exports = { | ||
stories: ["../src/**/*.stories.@(js|jsx|ts|tsx)"], | ||
addons: ["@storybook/addon-links", "@storybook/addon-essentials", "@storybook/preset-create-react-app", "@storybook/addon-a11y"], | ||
webpackFinal: async config => { | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/preset-create-react-app", | ||
"@storybook/addon-a11y", | ||
], | ||
webpackFinal: async (config) => { | ||
config.resolve.plugins ||= []; | ||
config.resolve.plugins.push(new TsconfigPathsPlugin()); | ||
config.resolve.alias["react-navi"] = require.resolve("./__mocks__/react-navi.js"); | ||
config.resolve.alias["react-navi"] = require.resolve( | ||
"./__mocks__/react-navi.js", | ||
); | ||
return config; | ||
}, | ||
babel: async options => ({ | ||
babel: async (options) => ({ | ||
...options, | ||
plugins: [...options.plugins, "@babel/plugin-proposal-logical-assignment-operators"], | ||
plugins: [ | ||
...options.plugins, | ||
"@babel/plugin-proposal-logical-assignment-operators", | ||
], | ||
presets: [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"chrome": 100 | ||
} | ||
} | ||
targets: { | ||
chrome: 100, | ||
}, | ||
}, | ||
], | ||
"@babel/preset-typescript", | ||
"@babel/preset-react" | ||
] | ||
"@babel/preset-react", | ||
], | ||
}), | ||
staticDirs: ["../public"], | ||
framework: { | ||
name: "@storybook/react-webpack5", | ||
options: {} | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: true | ||
} | ||
}; | ||
autodocs: true, | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { addons } from '@storybook/addons' | ||
import theme from './theme' | ||
import { addons } from "@storybook/addons"; | ||
import theme from "./theme"; | ||
|
||
addons.setConfig({ | ||
theme, | ||
}) | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
import { create } from '@storybook/theming/create' | ||
import { create } from "@storybook/theming/create"; | ||
|
||
export default create({ | ||
base: 'light', | ||
base: "light", | ||
|
||
colorPrimary: '#0ECE83', | ||
colorSecondary: 'rgba(0,0,0,0.4)', | ||
colorPrimary: "#0ECE83", | ||
colorSecondary: "rgba(0,0,0,0.4)", | ||
|
||
// UI | ||
appBg: 'white', | ||
appContentBg: '#efefef', | ||
appBorderColor: 'black', | ||
appBg: "white", | ||
appContentBg: "#efefef", | ||
appBorderColor: "black", | ||
appBorderRadius: 0, | ||
|
||
// Typography | ||
fontBase: "'Inter', Arial", | ||
|
||
// Text colors | ||
textColor: 'black', | ||
textInverseColor: 'rgba(255,255,255,0.9)', | ||
textColor: "black", | ||
textInverseColor: "rgba(255,255,255,0.9)", | ||
|
||
// Toolbar default and active colors | ||
barTextColor: 'silver', | ||
barSelectedColor: 'black', | ||
barBg: 'white', | ||
barTextColor: "silver", | ||
barSelectedColor: "black", | ||
barBg: "white", | ||
|
||
// Form colors | ||
inputBg: 'white', | ||
inputBorder: 'silver', | ||
inputTextColor: 'black', | ||
inputBg: "white", | ||
inputBorder: "silver", | ||
inputTextColor: "black", | ||
inputBorderRadius: 4, | ||
|
||
brandTitle: 'Open Systems Lab', | ||
brandUrl: 'https://opensystemslab.io', | ||
}) | ||
brandTitle: "Open Systems Lab", | ||
brandUrl: "https://opensystemslab.io", | ||
}); |
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 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 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 |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
"applicationId": "4469ee56-9275-47f3-b29d-e0df0991099a" | ||
} | ||
] | ||
} | ||
} |
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
Oops, something went wrong.