@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.
- package/LICENSE.md +22 -0
- package/README.md +1 -0
- package/dist/Button/Button.js +36 -0
- package/dist/Button/Button.stories.js +71 -0
- package/dist/Button/button.css +30 -0
- package/dist/HOCs/withWindowSize.js +122 -0
- package/dist/Header/Header.js +68 -0
- package/dist/Header/Header.stories.js +31 -0
- package/dist/Header/header.css +26 -0
- package/dist/Introduction.stories.mdx +211 -0
- package/dist/__snapshots__/storybook.test.js.snap +104 -0
- package/dist/assets/code-brackets.svg +1 -0
- package/dist/assets/colors.svg +1 -0
- package/dist/assets/comments.svg +1 -0
- package/dist/assets/direction.svg +1 -0
- package/dist/assets/flow.svg +1 -0
- package/dist/assets/img/imgDefault.png +0 -0
- package/dist/assets/img/imgGirl.png +0 -0
- package/dist/assets/img/imgMan.png +0 -0
- package/dist/assets/plugin.svg +1 -0
- package/dist/assets/repo.svg +1 -0
- package/dist/assets/stackalt.svg +1 -0
- package/dist/build-index.js +87 -0
- package/dist/components/Avatar/Avatar.css +0 -0
- package/dist/components/Avatar/Avatar.js +158 -0
- package/dist/components/Avatar/Avatar.stories.js +107 -0
- package/dist/components/Avatar/DesignAvatar.js +66 -0
- package/dist/components/Avatar/DesignAvatarGroup.js +58 -0
- package/dist/components/Avatar/DesignAvatarText.js +71 -0
- package/dist/components/Button/Button.js +57 -0
- package/dist/components/Button/Button.stories.js +85 -0
- package/dist/components/Button/button.css +0 -0
- package/dist/components/ButtonGroup/ButtonGroup.css +0 -0
- package/dist/components/ButtonGroup/ButtonGroup.js +57 -0
- package/dist/components/ButtonGroup/ButtonGroup.stories.js +60 -0
- package/dist/components/Grid/DesignGrid.js +25 -0
- package/dist/components/Grid/Grid.css +0 -0
- package/dist/components/Grid/Grid.js +27 -0
- package/dist/components/Grid/Grid.stories.js +39 -0
- package/dist/components/Grid/GridItem.js +49 -0
- package/dist/components/Header/Header.js +69 -0
- package/dist/components/Header/Header.stories.js +32 -0
- package/dist/components/Header/header.css +26 -0
- package/dist/components/InputPassword/InputPassword.css +0 -0
- package/dist/components/InputPassword/InputPassword.js +57 -0
- package/dist/components/InputPassword/InputPassword.stories.js +60 -0
- package/dist/components/InputText/InputText.css +0 -0
- package/dist/components/InputText/InputText.js +57 -0
- package/dist/components/InputText/InputText.stories.js +60 -0
- package/dist/components/Introduction.stories.mdx +211 -0
- package/dist/components/ThemeProvider/CouncilboxThemeContext.js +22 -0
- package/dist/components/ThemeProvider/ThemeProvider.js +78 -0
- package/dist/components/Typography/Typography.css +0 -0
- package/dist/components/Typography/Typography.js +109 -0
- package/dist/components/Typography/Typography.stories.js +60 -0
- package/dist/index.js +23 -0
- package/dist/reportWebVitals.js +34 -0
- package/dist/setupTests.js +3 -0
- package/dist/storybook.test.js +7 -0
- package/dist/styles/main.css +58 -0
- package/dist/styles/reset.css +43 -0
- package/dist/styles/stylesheet.ts +49 -0
- package/dist/testing/TestComponents.js +51 -0
- package/package.json +101 -0
|
@@ -0,0 +1,60 @@
|
|
|
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 _InputPassword = _interopRequireDefault(require("./InputPassword"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
var _default = {
|
|
15
|
+
title: 'Example/Input Password',
|
|
16
|
+
component: _InputPassword.default,
|
|
17
|
+
argTypes: {
|
|
18
|
+
backgroundColor: {
|
|
19
|
+
control: 'color'
|
|
20
|
+
},
|
|
21
|
+
color: {
|
|
22
|
+
options: ['primary', 'secondary'],
|
|
23
|
+
control: {
|
|
24
|
+
type: 'radio'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
loading: {
|
|
28
|
+
options: [true, false],
|
|
29
|
+
control: {
|
|
30
|
+
type: 'radio'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
options: [true, false],
|
|
35
|
+
control: {
|
|
36
|
+
type: 'radio'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
variant: {
|
|
40
|
+
options: ['contained', 'outlined', 'text'],
|
|
41
|
+
control: {
|
|
42
|
+
type: 'radio'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.default = _default;
|
|
48
|
+
|
|
49
|
+
var Template = function Template(args) {
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_InputPassword.default, args);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
Template.displayName = "Template";
|
|
54
|
+
var Default = Template.bind({});
|
|
55
|
+
exports.Default = Default;
|
|
56
|
+
Default.args = {
|
|
57
|
+
text: 'Label',
|
|
58
|
+
color: 'primary',
|
|
59
|
+
variant: 'contained'
|
|
60
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,57 @@
|
|
|
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 _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
13
|
+
|
|
14
|
+
require("../../styles/main.css");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
var InputText = function InputText(_ref) {
|
|
19
|
+
var text = _ref.text,
|
|
20
|
+
onClick = _ref.onClick,
|
|
21
|
+
disabled = _ref.disabled,
|
|
22
|
+
loading = _ref.loading,
|
|
23
|
+
color = _ref.color,
|
|
24
|
+
variant = _ref.variant;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
26
|
+
variant: variant,
|
|
27
|
+
className: "councilbox-button",
|
|
28
|
+
disabled: loading || disabled,
|
|
29
|
+
color: color // style={{
|
|
30
|
+
// backgroundColor: `var(--${color})`
|
|
31
|
+
// }}
|
|
32
|
+
,
|
|
33
|
+
onClick: onClick
|
|
34
|
+
}, text);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
InputText.displayName = "InputText";
|
|
38
|
+
InputText.propTypes = {
|
|
39
|
+
backgroundColor: _propTypes.default.string,
|
|
40
|
+
color: _propTypes.default.string,
|
|
41
|
+
text: _propTypes.default.string.isRequired,
|
|
42
|
+
onClick: _propTypes.default.func,
|
|
43
|
+
disabled: _propTypes.default.bool,
|
|
44
|
+
loading: _propTypes.default.bool,
|
|
45
|
+
variant: _propTypes.default.string
|
|
46
|
+
};
|
|
47
|
+
InputText.defaultProps = {
|
|
48
|
+
backgroundColor: null,
|
|
49
|
+
text: null,
|
|
50
|
+
onClick: undefined,
|
|
51
|
+
color: 'primary',
|
|
52
|
+
disabled: false,
|
|
53
|
+
loading: false,
|
|
54
|
+
variant: 'contained'
|
|
55
|
+
};
|
|
56
|
+
var _default = InputText;
|
|
57
|
+
exports.default = _default;
|
|
@@ -0,0 +1,60 @@
|
|
|
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 _InputText = _interopRequireDefault(require("./InputText"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
var _default = {
|
|
15
|
+
title: 'Example/Input Text',
|
|
16
|
+
component: _InputText.default,
|
|
17
|
+
argTypes: {
|
|
18
|
+
backgroundColor: {
|
|
19
|
+
control: 'color'
|
|
20
|
+
},
|
|
21
|
+
color: {
|
|
22
|
+
options: ['primary', 'secondary'],
|
|
23
|
+
control: {
|
|
24
|
+
type: 'radio'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
loading: {
|
|
28
|
+
options: [true, false],
|
|
29
|
+
control: {
|
|
30
|
+
type: 'radio'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
options: [true, false],
|
|
35
|
+
control: {
|
|
36
|
+
type: 'radio'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
variant: {
|
|
40
|
+
options: ['contained', 'outlined', 'text'],
|
|
41
|
+
control: {
|
|
42
|
+
type: 'radio'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.default = _default;
|
|
48
|
+
|
|
49
|
+
var Template = function Template(args) {
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_InputText.default, args);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
Template.displayName = "Template";
|
|
54
|
+
var Default = Template.bind({});
|
|
55
|
+
exports.Default = Default;
|
|
56
|
+
Default.args = {
|
|
57
|
+
text: 'Label',
|
|
58
|
+
color: 'primary',
|
|
59
|
+
variant: 'contained'
|
|
60
|
+
};
|
|
@@ -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>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useCouncilboxTheme = exports.CouncilTheme = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var CouncilTheme = /*#__PURE__*/_react.default.createContext({});
|
|
13
|
+
|
|
14
|
+
exports.CouncilTheme = CouncilTheme;
|
|
15
|
+
|
|
16
|
+
var useCouncilboxTheme = function useCouncilboxTheme() {
|
|
17
|
+
var councilboxTheme = _react.default.useContext(CouncilTheme);
|
|
18
|
+
|
|
19
|
+
return councilboxTheme;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.useCouncilboxTheme = useCouncilboxTheme;
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
var _styles = require("@mui/material/styles");
|
|
13
|
+
|
|
14
|
+
require("../../styles/main.css");
|
|
15
|
+
|
|
16
|
+
var _stylesheet = require("../../styles/stylesheet.ts");
|
|
17
|
+
|
|
18
|
+
var _CouncilboxThemeContext = require("./CouncilboxThemeContext");
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
+
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
|
|
36
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
37
|
+
|
|
38
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
+
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
42
|
+
var defaultTheme = {
|
|
43
|
+
colors: {
|
|
44
|
+
primary: '#00A6FF',
|
|
45
|
+
secondary: '#FFA500'
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var _default = function _default(_ref) {
|
|
50
|
+
var children = _ref.children,
|
|
51
|
+
colors = _ref.colors;
|
|
52
|
+
|
|
53
|
+
var _React$useState = React.useState(_objectSpread(_objectSpread({}, defaultTheme), {}, {
|
|
54
|
+
colors: _objectSpread(_objectSpread({}, defaultTheme.colors), colors)
|
|
55
|
+
})),
|
|
56
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
57
|
+
state = _React$useState2[0],
|
|
58
|
+
setState = _React$useState2[1];
|
|
59
|
+
|
|
60
|
+
var updateColors = function updateColors(newColors) {
|
|
61
|
+
setState(_objectSpread(_objectSpread({}, state), {}, {
|
|
62
|
+
colors: _objectSpread(_objectSpread({}, state.colors), newColors)
|
|
63
|
+
}));
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return /*#__PURE__*/React.createElement(_CouncilboxThemeContext.CouncilTheme.Provider, {
|
|
67
|
+
value: {
|
|
68
|
+
theme: state,
|
|
69
|
+
updateColors: updateColors
|
|
70
|
+
}
|
|
71
|
+
}, /*#__PURE__*/React.createElement(_styles.ThemeProvider, {
|
|
72
|
+
theme: (0, _stylesheet.theme)({
|
|
73
|
+
colors: state.colors
|
|
74
|
+
})
|
|
75
|
+
}, children));
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
exports.default = _default;
|
|
File without changes
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
require("../../styles/main.css");
|
|
13
|
+
|
|
14
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
+
var nameVariant = {
|
|
25
|
+
'4XL': 'h2',
|
|
26
|
+
'3XL': 'h3',
|
|
27
|
+
'2XL': 'h4',
|
|
28
|
+
XL: 'h5',
|
|
29
|
+
L: 'h6',
|
|
30
|
+
M: 'body1',
|
|
31
|
+
S: 'body2',
|
|
32
|
+
XS: 'subtitle1',
|
|
33
|
+
'2XS': 'subtitle2'
|
|
34
|
+
};
|
|
35
|
+
var stylesVariants = {
|
|
36
|
+
'4XL': {
|
|
37
|
+
fontSize: '40px',
|
|
38
|
+
lineHeight: '56px'
|
|
39
|
+
},
|
|
40
|
+
'3XL': {
|
|
41
|
+
fontSize: '32px',
|
|
42
|
+
lineHeight: '48px'
|
|
43
|
+
},
|
|
44
|
+
'2XL': {
|
|
45
|
+
fontSize: '28px',
|
|
46
|
+
lineHeight: '40px'
|
|
47
|
+
},
|
|
48
|
+
XL: {
|
|
49
|
+
fontSize: '24px',
|
|
50
|
+
lineHeight: '32px'
|
|
51
|
+
},
|
|
52
|
+
L: {
|
|
53
|
+
fontSize: '20px',
|
|
54
|
+
lineHeight: '28px'
|
|
55
|
+
},
|
|
56
|
+
M: {
|
|
57
|
+
fontSize: '16px',
|
|
58
|
+
lineHeight: '24px'
|
|
59
|
+
},
|
|
60
|
+
S: {
|
|
61
|
+
fontSize: '14px',
|
|
62
|
+
lineHeight: '20px'
|
|
63
|
+
},
|
|
64
|
+
XS: {
|
|
65
|
+
fontSize: '12px',
|
|
66
|
+
lineHeight: '16px'
|
|
67
|
+
},
|
|
68
|
+
'2XS': {
|
|
69
|
+
fontSize: '10px',
|
|
70
|
+
lineHeight: '12px'
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
var Typography = function Typography(_ref) {
|
|
75
|
+
var children = _ref.children,
|
|
76
|
+
styles = _ref.styles,
|
|
77
|
+
variant = _ref.variant,
|
|
78
|
+
fontWeight = _ref.fontWeight,
|
|
79
|
+
textAlign = _ref.textAlign,
|
|
80
|
+
color = _ref.color;
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
82
|
+
sx: _objectSpread(_objectSpread({}, stylesVariants[variant]), {}, {
|
|
83
|
+
color: color,
|
|
84
|
+
fontWeight: fontWeight,
|
|
85
|
+
textAlign: textAlign
|
|
86
|
+
}, styles),
|
|
87
|
+
variant: nameVariant[variant]
|
|
88
|
+
}, children);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
Typography.displayName = "Typography";
|
|
92
|
+
Typography.propTypes = {
|
|
93
|
+
variant: _propTypes.default.string,
|
|
94
|
+
color: _propTypes.default.string,
|
|
95
|
+
styles: _propTypes.default.object,
|
|
96
|
+
children: _propTypes.default.string,
|
|
97
|
+
fontWeight: _propTypes.default.string,
|
|
98
|
+
textAlign: _propTypes.default.string
|
|
99
|
+
};
|
|
100
|
+
Typography.defaultProps = {
|
|
101
|
+
variant: 'M',
|
|
102
|
+
color: '#616161',
|
|
103
|
+
styles: {},
|
|
104
|
+
children: 'texto',
|
|
105
|
+
fontWeight: '400',
|
|
106
|
+
textAlign: ''
|
|
107
|
+
};
|
|
108
|
+
var _default = Typography;
|
|
109
|
+
exports.default = _default;
|
|
@@ -0,0 +1,60 @@
|
|
|
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 _Typography = _interopRequireDefault(require("./Typography"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
var _default = {
|
|
15
|
+
title: 'Example/Typography',
|
|
16
|
+
component: _Typography.default,
|
|
17
|
+
argTypes: {
|
|
18
|
+
variant: {
|
|
19
|
+
options: ['4XL', '3XL', '2XL', 'XL', 'L', 'M', 'S', 'XS', '2XS'],
|
|
20
|
+
control: {
|
|
21
|
+
type: 'radio'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
fontWeight: {
|
|
25
|
+
options: Object.keys({
|
|
26
|
+
300: 'light',
|
|
27
|
+
400: 'regular',
|
|
28
|
+
700: 'bold'
|
|
29
|
+
}),
|
|
30
|
+
mapping: {
|
|
31
|
+
300: 'light',
|
|
32
|
+
400: 'regular',
|
|
33
|
+
700: 'bold'
|
|
34
|
+
},
|
|
35
|
+
control: {
|
|
36
|
+
type: 'radio',
|
|
37
|
+
labels: {
|
|
38
|
+
300: 'Light',
|
|
39
|
+
400: 'Regular',
|
|
40
|
+
700: 'Bold'
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.default = _default;
|
|
47
|
+
|
|
48
|
+
var Template = function Template(args) {
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement(_Typography.default, args);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
Template.displayName = "Template";
|
|
53
|
+
var Default = Template.bind({});
|
|
54
|
+
exports.Default = Default;
|
|
55
|
+
Default.args = {
|
|
56
|
+
variant: 'M',
|
|
57
|
+
fontWeight: '400',
|
|
58
|
+
styles: {},
|
|
59
|
+
children: 'texto'
|
|
60
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Button", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _Button.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "Header", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _Header.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _Button = _interopRequireDefault(require("./Button/Button"));
|
|
20
|
+
|
|
21
|
+
var _Header = _interopRequireDefault(require("./Header/Header"));
|
|
22
|
+
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|