@councilbox/councilbox-ui 0.0.2

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.
Files changed (64) hide show
  1. package/LICENSE.md +22 -0
  2. package/README.md +1 -0
  3. package/dist/Button/Button.js +36 -0
  4. package/dist/Button/Button.stories.js +71 -0
  5. package/dist/Button/button.css +30 -0
  6. package/dist/HOCs/withWindowSize.js +122 -0
  7. package/dist/Header/Header.js +68 -0
  8. package/dist/Header/Header.stories.js +31 -0
  9. package/dist/Header/header.css +26 -0
  10. package/dist/Introduction.stories.mdx +211 -0
  11. package/dist/__snapshots__/storybook.test.js.snap +104 -0
  12. package/dist/assets/code-brackets.svg +1 -0
  13. package/dist/assets/colors.svg +1 -0
  14. package/dist/assets/comments.svg +1 -0
  15. package/dist/assets/direction.svg +1 -0
  16. package/dist/assets/flow.svg +1 -0
  17. package/dist/assets/img/imgDefault.png +0 -0
  18. package/dist/assets/img/imgGirl.png +0 -0
  19. package/dist/assets/img/imgMan.png +0 -0
  20. package/dist/assets/plugin.svg +1 -0
  21. package/dist/assets/repo.svg +1 -0
  22. package/dist/assets/stackalt.svg +1 -0
  23. package/dist/build-index.js +87 -0
  24. package/dist/components/Avatar/Avatar.css +0 -0
  25. package/dist/components/Avatar/Avatar.js +158 -0
  26. package/dist/components/Avatar/Avatar.stories.js +107 -0
  27. package/dist/components/Avatar/DesignAvatar.js +66 -0
  28. package/dist/components/Avatar/DesignAvatarGroup.js +58 -0
  29. package/dist/components/Avatar/DesignAvatarText.js +71 -0
  30. package/dist/components/Button/Button.js +57 -0
  31. package/dist/components/Button/Button.stories.js +85 -0
  32. package/dist/components/Button/button.css +0 -0
  33. package/dist/components/ButtonGroup/ButtonGroup.css +0 -0
  34. package/dist/components/ButtonGroup/ButtonGroup.js +57 -0
  35. package/dist/components/ButtonGroup/ButtonGroup.stories.js +60 -0
  36. package/dist/components/Grid/DesignGrid.js +25 -0
  37. package/dist/components/Grid/Grid.css +0 -0
  38. package/dist/components/Grid/Grid.js +27 -0
  39. package/dist/components/Grid/Grid.stories.js +39 -0
  40. package/dist/components/Grid/GridItem.js +49 -0
  41. package/dist/components/Header/Header.js +69 -0
  42. package/dist/components/Header/Header.stories.js +32 -0
  43. package/dist/components/Header/header.css +26 -0
  44. package/dist/components/InputPassword/InputPassword.css +0 -0
  45. package/dist/components/InputPassword/InputPassword.js +57 -0
  46. package/dist/components/InputPassword/InputPassword.stories.js +60 -0
  47. package/dist/components/InputText/InputText.css +0 -0
  48. package/dist/components/InputText/InputText.js +57 -0
  49. package/dist/components/InputText/InputText.stories.js +60 -0
  50. package/dist/components/Introduction.stories.mdx +211 -0
  51. package/dist/components/ThemeProvider/CouncilboxThemeContext.js +22 -0
  52. package/dist/components/ThemeProvider/ThemeProvider.js +78 -0
  53. package/dist/components/Typography/Typography.css +0 -0
  54. package/dist/components/Typography/Typography.js +109 -0
  55. package/dist/components/Typography/Typography.stories.js +60 -0
  56. package/dist/index.js +23 -0
  57. package/dist/reportWebVitals.js +34 -0
  58. package/dist/setupTests.js +3 -0
  59. package/dist/storybook.test.js +7 -0
  60. package/dist/styles/main.css +58 -0
  61. package/dist/styles/reset.css +43 -0
  62. package/dist/styles/stylesheet.ts +49 -0
  63. package/dist/testing/TestComponents.js +51 -0
  64. package/package.json +101 -0
package/LICENSE.md ADDED
@@ -0,0 +1,22 @@
1
+
2
+ The MIT License (MIT)
3
+
4
+ Copyright (c) 2022 Councilbox
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ councilbox-ui
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ var Button = function Button(_ref) {
15
+ var label = _ref.label,
16
+ backgroundColor = _ref.backgroundColor,
17
+ onClick = _ref.onClick;
18
+ return /*#__PURE__*/_react.default.createElement("button", {
19
+ onClick: onClick,
20
+ style: backgroundColor && {
21
+ backgroundColor: backgroundColor
22
+ }
23
+ }, label);
24
+ };
25
+
26
+ Button.propTypes = {
27
+ backgroundColor: _propTypes.default.string,
28
+ label: _propTypes.default.string.isRequired,
29
+ onClick: _propTypes.default.func
30
+ };
31
+ Button.defaultProps = {
32
+ backgroundColor: null,
33
+ onClick: undefined
34
+ };
35
+ var _default = Button;
36
+ exports.default = _default;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.Default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _Button = _interopRequireDefault(require("./Button"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ var _default = {
15
+ title: 'Example/Button',
16
+ component: _Button.default,
17
+ argTypes: {
18
+ backgroundColor: {
19
+ control: 'color'
20
+ }
21
+ }
22
+ };
23
+ exports.default = _default;
24
+
25
+ var Template = function Template(args) {
26
+ return /*#__PURE__*/_react.default.createElement(_Button.default, args);
27
+ };
28
+
29
+ var Default = Template.bind({});
30
+ exports.Default = Default;
31
+ Default.args = {
32
+ label: 'My Button'
33
+ };
34
+ /*
35
+
36
+ export default {
37
+ title: 'Example/Button',
38
+ component: Button,
39
+ // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
40
+ argTypes: {
41
+ backgroundColor: { control: 'color' },
42
+ },
43
+ };
44
+
45
+ // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
46
+ const Template = (args) => <Button {...args} />;
47
+
48
+ export const Primary = Template.bind({});
49
+ // More on args: https://storybook.js.org/docs/react/writing-stories/args
50
+ Primary.args = {
51
+ primary: true,
52
+ label: 'Button',
53
+ };
54
+
55
+ export const Secondary = Template.bind({});
56
+ Secondary.args = {
57
+ label: 'Button',
58
+ };
59
+
60
+ export const Large = Template.bind({});
61
+ Large.args = {
62
+ size: 'large',
63
+ label: 'Button',
64
+ };
65
+
66
+ export const Small = Template.bind({});
67
+ Small.args = {
68
+ size: 'small',
69
+ label: 'Button',
70
+ };
71
+ */
@@ -0,0 +1,30 @@
1
+ .storybook-button {
2
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
3
+ font-weight: 700;
4
+ border: 0;
5
+ border-radius: 3em;
6
+ cursor: pointer;
7
+ display: inline-block;
8
+ line-height: 1;
9
+ }
10
+ .storybook-button--primary {
11
+ color: white;
12
+ background-color: #1ea7fd;
13
+ }
14
+ .storybook-button--secondary {
15
+ color: #333;
16
+ background-color: transparent;
17
+ box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
18
+ }
19
+ .storybook-button--small {
20
+ font-size: 12px;
21
+ padding: 10px 16px;
22
+ }
23
+ .storybook-button--medium {
24
+ font-size: 14px;
25
+ padding: 11px 20px;
26
+ }
27
+ .storybook-button--large {
28
+ font-size: 16px;
29
+ padding: 12px 24px;
30
+ }
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+
16
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+
18
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
+
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
+
22
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
+
24
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
+
26
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
27
+
28
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
+
30
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
31
+
32
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
+
34
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
35
+
36
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
37
+
38
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
39
+
40
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
41
+
42
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
43
+
44
+ var withWindowSize = function withWindowSize(WrappedComponent) {
45
+ return /*#__PURE__*/function (_Component) {
46
+ _inherits(WithWindowSize, _Component);
47
+
48
+ var _super = _createSuper(WithWindowSize);
49
+
50
+ function WithWindowSize() {
51
+ var _this;
52
+
53
+ _classCallCheck(this, WithWindowSize);
54
+
55
+ _this = _super.call(this);
56
+ _this.state = {
57
+ size: 'md',
58
+ innerHeight: window.innerHeight,
59
+ innerWidth: window.innerWidth
60
+ };
61
+ return _this;
62
+ }
63
+
64
+ _createClass(WithWindowSize, [{
65
+ key: "updateSize",
66
+ value: function updateSize() {
67
+ var state = _objectSpread({}, this.state);
68
+
69
+ state.innerWidth = window.innerWidth;
70
+
71
+ if (window.innerWidth <= 767) {
72
+ state.size = 'xs';
73
+ } else if (window.innerWidth <= 1023) {
74
+ state.size = 'sm';
75
+ } else if (window.innerWidth <= 1439) {
76
+ state.size = 'md';
77
+ } else if (window.innerWidth <= 1919) {
78
+ state.size = 'lg';
79
+ } else {
80
+ state.size = 'xl';
81
+ }
82
+
83
+ if (window.innerWidth < window.innerHeight) {
84
+ state.orientation = 'portrait';
85
+ } else if (window.innerWidth > window.innerHeight) {
86
+ state.orientation = 'landscape';
87
+ }
88
+
89
+ if (state.size !== this.state.size) {
90
+ this.setState(_objectSpread({}, state));
91
+ }
92
+ }
93
+ }, {
94
+ key: "componentDidMount",
95
+ value: function componentDidMount() {
96
+ this.updateSize();
97
+ window.addEventListener('resize', this.updateSize);
98
+ }
99
+ }, {
100
+ key: "componentWillUnmount",
101
+ value: function componentWillUnmount() {
102
+ window.removeEventListener('resize', this.updateSize);
103
+ }
104
+ }, {
105
+ key: "render",
106
+ value: function render() {
107
+ return /*#__PURE__*/_react.default.createElement(WrappedComponent, _extends({
108
+ updateSize: this.updateSize,
109
+ orientation: this.state.orientation,
110
+ innherHeight: this.state.innerHeight,
111
+ innerWidth: this.state.innerWidth,
112
+ windowSize: this.state.size
113
+ }, this.props));
114
+ }
115
+ }]);
116
+
117
+ return WithWindowSize;
118
+ }(_react.Component);
119
+ };
120
+
121
+ var _default = withWindowSize;
122
+ exports.default = _default;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _ = require("..");
13
+
14
+ require("./header.css");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ var Header = function Header(_ref) {
19
+ var user = _ref.user,
20
+ onLogin = _ref.onLogin,
21
+ onLogout = _ref.onLogout,
22
+ onCreateAccount = _ref.onCreateAccount;
23
+ return /*#__PURE__*/_react.default.createElement("header", null, /*#__PURE__*/_react.default.createElement("div", {
24
+ className: "wrapper"
25
+ }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("svg", {
26
+ width: "32",
27
+ height: "32",
28
+ viewBox: "0 0 32 32",
29
+ xmlns: "http://www.w3.org/2000/svg"
30
+ }, /*#__PURE__*/_react.default.createElement("g", {
31
+ fill: "none",
32
+ fillRule: "evenodd"
33
+ }, /*#__PURE__*/_react.default.createElement("path", {
34
+ d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z",
35
+ fill: "#FFF"
36
+ }), /*#__PURE__*/_react.default.createElement("path", {
37
+ d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z",
38
+ fill: "#555AB9"
39
+ }), /*#__PURE__*/_react.default.createElement("path", {
40
+ d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z",
41
+ fill: "#91BAF8"
42
+ }))), /*#__PURE__*/_react.default.createElement("h1", null, "Acme")), /*#__PURE__*/_react.default.createElement("div", null, user ? /*#__PURE__*/_react.default.createElement(_.Button, {
43
+ size: "small",
44
+ onClick: onLogout,
45
+ label: "Log out"
46
+ }) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_.Button, {
47
+ size: "small",
48
+ onClick: onLogin,
49
+ label: "Log in"
50
+ }), /*#__PURE__*/_react.default.createElement(_.Button, {
51
+ primary: true,
52
+ size: "small",
53
+ onClick: onCreateAccount,
54
+ label: "Sign up"
55
+ })))));
56
+ };
57
+
58
+ Header.propTypes = {
59
+ user: _propTypes.default.shape({}),
60
+ onLogin: _propTypes.default.func.isRequired,
61
+ onLogout: _propTypes.default.func.isRequired,
62
+ onCreateAccount: _propTypes.default.func.isRequired
63
+ };
64
+ Header.defaultProps = {
65
+ user: null
66
+ };
67
+ var _default = Header;
68
+ exports.default = _default;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.LoggedOut = exports.LoggedIn = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _Header = _interopRequireDefault(require("./Header"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ var _default = {
15
+ title: 'Example/Header',
16
+ component: _Header.default
17
+ };
18
+ exports.default = _default;
19
+
20
+ var Template = function Template(args) {
21
+ return /*#__PURE__*/_react.default.createElement(_Header.default, args);
22
+ };
23
+
24
+ var LoggedIn = Template.bind({});
25
+ exports.LoggedIn = LoggedIn;
26
+ LoggedIn.args = {
27
+ user: {}
28
+ };
29
+ var LoggedOut = Template.bind({});
30
+ exports.LoggedOut = LoggedOut;
31
+ LoggedOut.args = {};
@@ -0,0 +1,26 @@
1
+ .wrapper {
2
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
3
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
4
+ padding: 15px 20px;
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: space-between;
8
+ }
9
+
10
+ svg {
11
+ display: inline-block;
12
+ vertical-align: top;
13
+ }
14
+
15
+ h1 {
16
+ font-weight: 900;
17
+ font-size: 20px;
18
+ line-height: 1;
19
+ margin: 6px 0 6px 10px;
20
+ display: inline-block;
21
+ vertical-align: top;
22
+ }
23
+
24
+ button + button {
25
+ margin-left: 10px;
26
+ }
@@ -0,0 +1,211 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+ import Code from '../assets/code-brackets.svg';
3
+ import Colors from '../assets/colors.svg';
4
+ import Comments from '../assets/comments.svg';
5
+ import Direction from '../assets/direction.svg';
6
+ import Flow from '../assets/flow.svg';
7
+ import Plugin from '../assets/plugin.svg';
8
+ import Repo from '../assets/repo.svg';
9
+ import StackAlt from '../assets/stackalt.svg';
10
+
11
+ <Meta title="Example/Introduction" />
12
+
13
+ <style>{`
14
+ .subheading {
15
+ --mediumdark: '#999999';
16
+ font-weight: 900;
17
+ font-size: 13px;
18
+ color: #999;
19
+ letter-spacing: 6px;
20
+ line-height: 24px;
21
+ text-transform: uppercase;
22
+ margin-bottom: 12px;
23
+ margin-top: 40px;
24
+ }
25
+
26
+ .link-list {
27
+ display: grid;
28
+ grid-template-columns: 1fr;
29
+ grid-template-rows: 1fr 1fr;
30
+ row-gap: 10px;
31
+ }
32
+
33
+ @media (min-width: 620px) {
34
+ .link-list {
35
+ row-gap: 20px;
36
+ column-gap: 20px;
37
+ grid-template-columns: 1fr 1fr;
38
+ }
39
+ }
40
+
41
+ @media all and (-ms-high-contrast:none) {
42
+ .link-list {
43
+ display: -ms-grid;
44
+ -ms-grid-columns: 1fr 1fr;
45
+ -ms-grid-rows: 1fr 1fr;
46
+ }
47
+ }
48
+
49
+ .link-item {
50
+ display: block;
51
+ padding: 20px 30px 20px 15px;
52
+ border: 1px solid #00000010;
53
+ border-radius: 5px;
54
+ transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
55
+ color: #333333;
56
+ display: flex;
57
+ align-items: flex-start;
58
+ }
59
+
60
+ .link-item:hover {
61
+ border-color: #1EA7FD50;
62
+ transform: translate3d(0, -3px, 0);
63
+ box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
64
+ }
65
+
66
+ .link-item:active {
67
+ border-color: #1EA7FD;
68
+ transform: translate3d(0, 0, 0);
69
+ }
70
+
71
+ .link-item strong {
72
+ font-weight: 700;
73
+ display: block;
74
+ margin-bottom: 2px;
75
+ }
76
+
77
+ .link-item img {
78
+ height: 40px;
79
+ width: 40px;
80
+ margin-right: 15px;
81
+ flex: none;
82
+ }
83
+
84
+ .link-item span {
85
+ font-size: 14px;
86
+ line-height: 20px;
87
+ }
88
+
89
+ .tip {
90
+ display: inline-block;
91
+ border-radius: 1em;
92
+ font-size: 11px;
93
+ line-height: 12px;
94
+ font-weight: 700;
95
+ background: #E7FDD8;
96
+ color: #66BF3C;
97
+ padding: 4px 12px;
98
+ margin-right: 10px;
99
+ vertical-align: top;
100
+ }
101
+
102
+ .tip-wrapper {
103
+ font-size: 13px;
104
+ line-height: 20px;
105
+ margin-top: 40px;
106
+ margin-bottom: 40px;
107
+ }
108
+
109
+ .tip-wrapper code {
110
+ font-size: 12px;
111
+ display: inline-block;
112
+ }
113
+
114
+
115
+ `}</style>
116
+
117
+ # Welcome to Storybook
118
+
119
+ Storybook helps you build UI components in isolation from your app's business logic, data, and context.
120
+ That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
121
+
122
+ Browse example stories now by navigating to them in the sidebar.
123
+ View their code in the `src/stories` directory to learn how they work.
124
+ We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
125
+
126
+ <div className="subheading">Configure</div>
127
+
128
+ <div className="link-list">
129
+ <a
130
+ className="link-item"
131
+ href="https://storybook.js.org/docs/react/addons/addon-types"
132
+ target="_blank"
133
+ >
134
+ <img src={Plugin} alt="plugin" />
135
+ <span>
136
+ <strong>Presets for popular tools</strong>
137
+ Easy setup for TypeScript, SCSS and more.
138
+ </span>
139
+ </a>
140
+ <a
141
+ className="link-item"
142
+ href="https://storybook.js.org/docs/react/configure/webpack"
143
+ target="_blank"
144
+ >
145
+ <img src={StackAlt} alt="Build" />
146
+ <span>
147
+ <strong>Build configuration</strong>
148
+ How to customize webpack and Babel
149
+ </span>
150
+ </a>
151
+ <a
152
+ className="link-item"
153
+ href="https://storybook.js.org/docs/react/configure/styling-and-css"
154
+ target="_blank"
155
+ >
156
+ <img src={Colors} alt="colors" />
157
+ <span>
158
+ <strong>Styling</strong>
159
+ How to load and configure CSS libraries
160
+ </span>
161
+ </a>
162
+ <a
163
+ className="link-item"
164
+ href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
165
+ target="_blank"
166
+ >
167
+ <img src={Flow} alt="flow" />
168
+ <span>
169
+ <strong>Data</strong>
170
+ Providers and mocking for data libraries
171
+ </span>
172
+ </a>
173
+ </div>
174
+
175
+ <div className="subheading">Learn</div>
176
+
177
+ <div className="link-list">
178
+ <a className="link-item" href="https://storybook.js.org/docs" target="_blank">
179
+ <img src={Repo} alt="repo" />
180
+ <span>
181
+ <strong>Storybook documentation</strong>
182
+ Configure, customize, and extend
183
+ </span>
184
+ </a>
185
+ <a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
186
+ <img src={Direction} alt="direction" />
187
+ <span>
188
+ <strong>In-depth guides</strong>
189
+ Best practices from leading teams
190
+ </span>
191
+ </a>
192
+ <a className="link-item" href="https://github.com/storybookjs/storybook" target="_blank">
193
+ <img src={Code} alt="code" />
194
+ <span>
195
+ <strong>GitHub project</strong>
196
+ View the source and add issues
197
+ </span>
198
+ </a>
199
+ <a className="link-item" href="https://discord.gg/storybook" target="_blank">
200
+ <img src={Comments} alt="comments" />
201
+ <span>
202
+ <strong>Discord chat</strong>
203
+ Chat with maintainers and the community
204
+ </span>
205
+ </a>
206
+ </div>
207
+
208
+ <div className="tip-wrapper">
209
+ <span className="tip">Tip</span>Edit the Markdown in{' '}
210
+ <code>src/stories/Introduction.stories.mdx</code>
211
+ </div>