@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
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ 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); }
9
+
10
+ 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); }
11
+
12
+ 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; }
13
+
14
+ var reportWebVitals = function reportWebVitals(onPerfEntry) {
15
+ if (onPerfEntry && onPerfEntry instanceof Function) {
16
+ Promise.resolve().then(function () {
17
+ return _interopRequireWildcard(require('web-vitals'));
18
+ }).then(function (_ref) {
19
+ var getCLS = _ref.getCLS,
20
+ getFID = _ref.getFID,
21
+ getFCP = _ref.getFCP,
22
+ getLCP = _ref.getLCP,
23
+ getTTFB = _ref.getTTFB;
24
+ getCLS(onPerfEntry);
25
+ getFID(onPerfEntry);
26
+ getFCP(onPerfEntry);
27
+ getLCP(onPerfEntry);
28
+ getTTFB(onPerfEntry);
29
+ });
30
+ }
31
+ };
32
+
33
+ var _default = reportWebVitals;
34
+ exports.default = _default;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ require("@testing-library/jest-dom");
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ var _addonStoryshots = _interopRequireDefault(require("@storybook/addon-storyshots"));
4
+
5
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
+
7
+ (0, _addonStoryshots.default)();
@@ -0,0 +1,58 @@
1
+ @import './reset.css';
2
+
3
+ :root {
4
+ --font-family: 'Lato';
5
+ --primary: #38398C;
6
+ /* --primary: #9C27B0; */
7
+ --secondary: #61ABB7;
8
+ }
9
+
10
+ html, body {
11
+ font-family: 'Lato';
12
+ height: 100%;
13
+ }
14
+
15
+ #root {
16
+ overflow: hidden;
17
+ padding: 0;
18
+ height: 100%;
19
+ margin: 0;
20
+ }
21
+
22
+ html {
23
+ font-family: var(--font-family);
24
+ height: 100%;
25
+ overflow: hidden !important;
26
+ }
27
+
28
+ body {
29
+ margin: 0;
30
+ padding: 0;
31
+ height: 100%;
32
+ font-family: var(--font-family);
33
+ }
34
+
35
+ .gapAvatar {
36
+ gap: 16px
37
+ }
38
+
39
+ .gapAvatarCompressed > div:not(:first-child){
40
+ margin-left: -16px
41
+ }
42
+
43
+
44
+ .gapAvatarCompressedsm > div:not(:first-child){
45
+ margin-left: -6px
46
+ }
47
+
48
+ .gapAvatarCompressedxs > div:not(:first-child){
49
+ margin-left: -8px
50
+ }
51
+
52
+ .gapAvatarCompressedsm > div:not(:first-child) > div {
53
+ border: 0.571429px solid white;
54
+ }
55
+
56
+ .gapAvatarCompressedxs > div:not(:first-child) > div {
57
+ border: 0.428571px solid white;
58
+ }
@@ -0,0 +1,43 @@
1
+ html, body, div, span, applet, object, iframe,
2
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
3
+ a, abbr, acronym, address, big, cite, code,
4
+ del, dfn, em, img, ins, kbd, q, s, samp,
5
+ small, strike, strong, sub, sup, tt, var,
6
+ b, u, i, center,
7
+ dl, dt, dd, ol, ul, li,
8
+ fieldset, form, label, legend,
9
+ table, caption, tbody, tfoot, thead, tr, th, td,
10
+ article, aside, canvas, details, embed,
11
+ figure, figcaption, footer, header, hgroup,
12
+ menu, nav, output, ruby, section, summary,
13
+ time, mark, audio, video {
14
+ margin: 0;
15
+ padding: 0;
16
+ border: 0;
17
+ font-size: 100%;
18
+ font: inherit;
19
+ vertical-align: baseline;
20
+ }
21
+ /* HTML5 display-role reset for older browsers */
22
+ article, aside, details, figcaption, figure,
23
+ footer, header, hgroup, menu, nav, section {
24
+ display: block;
25
+ }
26
+ body {
27
+ line-height: 1;
28
+ }
29
+ ol, ul {
30
+ list-style: none;
31
+ }
32
+ blockquote, q {
33
+ quotes: none;
34
+ }
35
+ blockquote:before, blockquote:after,
36
+ q:before, q:after {
37
+ content: '';
38
+ content: none;
39
+ }
40
+ table {
41
+ border-collapse: collapse;
42
+ border-spacing: 0;
43
+ }
@@ -0,0 +1,49 @@
1
+ import { createTheme } from '@mui/material/styles';
2
+
3
+ // const primary = '#38398C';
4
+ // const secondary = '#61ABB7';
5
+
6
+ const breakpoints = {
7
+ values: {
8
+ xs: 320,
9
+ sm: 768,
10
+ md: 1024,
11
+ lg: 1440,
12
+ xl: 1920,
13
+ },
14
+ };
15
+
16
+ export const theme = ({ colors }) => {
17
+ console.log(colors);
18
+ return createTheme({
19
+ breakpoints,
20
+ typography: {
21
+ fontFamily: 'Lato',
22
+ fontSize: 16,
23
+ body1: {
24
+ color: '#616161',
25
+ fontSize: '16px',
26
+ lineHeight: '24px',
27
+ },
28
+ },
29
+ spacing: [0, 4, 8, 16, 32, 64],
30
+ palette: {
31
+ primary: {
32
+ main: colors.primary || '000000',
33
+ },
34
+ secondary: {
35
+ main: colors.secondary || '000000',
36
+ },
37
+ },
38
+ components: {
39
+ MuiAvatar: {
40
+ styleOverrides: {
41
+ root: {
42
+ width: '56px',
43
+ height: '56px',
44
+ },
45
+ },
46
+ },
47
+ },
48
+ });
49
+ };
@@ -0,0 +1,51 @@
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 _ThemeProvider = _interopRequireDefault(require("../components/ThemeProvider/ThemeProvider"));
11
+
12
+ var _CouncilboxThemeContext = require("../components/ThemeProvider/CouncilboxThemeContext");
13
+
14
+ var _Button = _interopRequireDefault(require("../components/Button/Button"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ var Body = function Body() {
19
+ var cbxTheme = (0, _CouncilboxThemeContext.useCouncilboxTheme)();
20
+ console.log(cbxTheme);
21
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
22
+ color: "primary",
23
+ text: "texto",
24
+ onClick: function onClick() {
25
+ return cbxTheme.updateColors({
26
+ primary: '#440044'
27
+ });
28
+ }
29
+ }), /*#__PURE__*/_react.default.createElement(_Button.default, {
30
+ color: "secondary",
31
+ text: "texto",
32
+ onClick: function onClick() {
33
+ return cbxTheme.updateColors({
34
+ secondary: '#008800'
35
+ });
36
+ }
37
+ }));
38
+ };
39
+
40
+ var TestComponents = function TestComponents() {
41
+ return /*#__PURE__*/_react.default.createElement(_ThemeProvider.default, {
42
+ colors: {
43
+ primary: '#000088',
44
+ secondary: '#ff0000'
45
+ }
46
+ }, /*#__PURE__*/_react.default.createElement(Body, null));
47
+ };
48
+
49
+ TestComponents.displayName = "TestComponents";
50
+ var _default = TestComponents;
51
+ exports.default = _default;
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "@councilbox/councilbox-ui",
3
+ "version": "0.0.2",
4
+ "main": "dist/build-index.js",
5
+ "files": [
6
+ "dist",
7
+ "README.md"
8
+ ],
9
+ "author": "Aarón Fuentes González <aaronfuentes86@gmail.com>",
10
+ "dependencies": {
11
+ "@emotion/react": "^11.7.1",
12
+ "@emotion/styled": "^11.6.0",
13
+ "@mui/material": "^5.2.8",
14
+ "cross-env": "^7.0.3",
15
+ "prop-types": "^15.8.1",
16
+ "web-vitals": "^2.1.0"
17
+ },
18
+ "scripts": {
19
+ "start": "start-storybook -p 6006 -s public",
20
+ "build": "react-scripts build",
21
+ "start-react": "react-scripts start src/manualTest.js",
22
+ "test": "react-scripts test",
23
+ "eject": "react-scripts eject",
24
+ "storybook": "start-storybook -p 6006 -s public",
25
+ "build-storybook": "build-storybook -s public",
26
+ "lint": "eslint . --quiet --ext .js --ext .jsx",
27
+ "clean": "rimraf dist",
28
+ "compile": "yarn run clean && cross-env NODE_ENV=production babel src --out-dir dist --copy-files --ignore testing/*,__tests__,spec.js,test.js,stories.js,__snapshots__"
29
+ },
30
+ "babel": {
31
+ "presets": [
32
+ "@babel/preset-env",
33
+ "@babel/preset-react"
34
+ ],
35
+ "plugins": [
36
+ "add-react-displayname"
37
+ ]
38
+ },
39
+ "eslintConfig": {
40
+ "extends": [
41
+ "react-app",
42
+ "react-app/jest"
43
+ ],
44
+ "overrides": [
45
+ {
46
+ "files": [
47
+ "**/*.stories.*"
48
+ ],
49
+ "rules": {
50
+ "import/no-anonymous-default-export": "off"
51
+ }
52
+ }
53
+ ]
54
+ },
55
+ "peerDependencies": {
56
+ "react": "^16.0.0",
57
+ "react-dom": "^16.0.0"
58
+ },
59
+ "browserslist": {
60
+ "production": [
61
+ ">0.2%",
62
+ "not dead",
63
+ "not op_mini all"
64
+ ],
65
+ "development": [
66
+ "last 1 chrome version",
67
+ "last 1 firefox version",
68
+ "last 1 safari version"
69
+ ]
70
+ },
71
+ "devDependencies": {
72
+ "@babel/cli": "^7.16.8",
73
+ "@babel/eslint-parser": "^7.16.5",
74
+ "@babel/preset-env": "^7.16.8",
75
+ "@babel/preset-react": "^7.16.7",
76
+ "@councilbox/eslint-config-base": "^0.0.1",
77
+ "@storybook/addon-actions": "^6.4.13",
78
+ "@storybook/addon-essentials": "^6.4.13",
79
+ "@storybook/addon-links": "^6.4.13",
80
+ "@storybook/addons": "^6.4.13",
81
+ "@storybook/builder-webpack5": "^6.4.13",
82
+ "@storybook/manager-webpack5": "^6.4.13",
83
+ "@storybook/node-logger": "^6.4.13",
84
+ "@storybook/preset-create-react-app": "^4.0.0",
85
+ "@storybook/react": "^6.4.13",
86
+ "@storybook/addon-storyshots": "^6.4.13",
87
+ "@storybook/theming": "^6.4.13",
88
+ "@testing-library/jest-dom": "^5.14.1",
89
+ "@testing-library/react": "^12.0.0",
90
+ "@testing-library/user-event": "^13.2.1",
91
+ "eslint-plugin-cypress": "^2.12.1",
92
+ "eslint-plugin-import": "^2.25.4",
93
+ "eslint-plugin-react": "^7.28.0",
94
+ "react": "^17.0.1",
95
+ "react-dom": "^17.0.1",
96
+ "react-scripts": "5.0.0",
97
+ "react-test-renderer": "^17.0.2",
98
+ "storybook": "^6.4.13",
99
+ "webpack": "^5.66.0"
100
+ }
101
+ }