diff --git a/website/.storybook/main.js b/website/.storybook/main.js
index c96c218255..be35ad4ed5 100644
--- a/website/.storybook/main.js
+++ b/website/.storybook/main.js
@@ -1,12 +1,13 @@
module.exports = {
- "stories": [
- "../src/**/*.stories.mdx",
- "../src/**/*.stories.@(js|jsx|ts|tsx)"
- ],
- "addons": [
- "@storybook/addon-links",
- "@storybook/addon-essentials",
- "@storybook/addon-interactions"
- ],
- "framework": "@storybook/react"
-}
\ No newline at end of file
+ stories: [
+ '../src/**/*.stories.mdx',
+ '../src/**/*.stories.@(js|jsx|ts|tsx)',
+ ],
+ addons: [
+ '@storybook/addon-links',
+ '@storybook/addon-essentials',
+ '@storybook/addon-interactions',
+ 'storybook-addon-root-attribute/register',
+ ],
+ framework: '@storybook/react',
+};
diff --git a/website/.storybook/preview.js b/website/.storybook/preview.js
index 798e1cd558..0b3cb69da3 100644
--- a/website/.storybook/preview.js
+++ b/website/.storybook/preview.js
@@ -1,4 +1,5 @@
import '../src/css/custom.css';
+import { withRootAttribute } from 'storybook-addon-root-attribute';
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
@@ -8,4 +9,24 @@ export const parameters = {
date: /Date$/,
},
},
+ layout: 'fullscreen',
+
+ // add docusaurus theming to storybook iframes
+ rootAttribute: {
+ root: 'html',
+ attribute: 'data-theme',
+ defaultState: {
+ name: 'Light',
+ value: 'light',
+ },
+ states: [
+ {
+ name: 'Dark',
+ value: 'dark',
+ },
+ ],
+ tooltip: true,
+ },
};
+
+export const decorators = [withRootAttribute];
diff --git a/website/package.json b/website/package.json
index b984119878..a3dbb40a88 100644
--- a/website/package.json
+++ b/website/package.json
@@ -58,6 +58,7 @@
"@storybook/addon-links": "^6.4.19",
"@storybook/react": "^6.4.19",
"@storybook/testing-library": "^0.0.9",
- "babel-loader": "^8.2.3"
+ "babel-loader": "^8.2.3",
+ "storybook-addon-root-attribute": "^1.0.2"
}
}
diff --git a/website/src/components/UserFeedback/UserFeedback.jsx b/website/src/components/UserFeedback/UserFeedback.jsx
new file mode 100644
index 0000000000..a2958e1376
--- /dev/null
+++ b/website/src/components/UserFeedback/UserFeedback.jsx
@@ -0,0 +1,8 @@
+import React from 'react';
+import './styles.module.css';
+
+const Component = ({ text }) => (
+ {text}
+);
+
+export default Component;
diff --git a/website/src/components/UserFeedback/UserFeedback.stories.jsx b/website/src/components/UserFeedback/UserFeedback.stories.jsx
new file mode 100644
index 0000000000..8b8b1aa96b
--- /dev/null
+++ b/website/src/components/UserFeedback/UserFeedback.stories.jsx
@@ -0,0 +1,16 @@
+import React from 'react';
+import Component from './UserFeedback';
+
+export default {
+ title: 'User feedback component',
+ component: Component,
+};
+
+const Template = (args) => ;
+
+export const A = Template.bind({});
+A.args = {
+ x: true,
+ y: 45,
+ text: 'blah blah blah',
+};
diff --git a/website/src/components/UserFeedback/styles.module.css b/website/src/components/UserFeedback/styles.module.css
new file mode 100644
index 0000000000..3e402ed69c
--- /dev/null
+++ b/website/src/components/UserFeedback/styles.module.css
@@ -0,0 +1,3 @@
+.user-feedback {
+ background: goldenrod;
+}