@councilbox/councilbox-ui 0.6.0 → 0.6.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.
@@ -29,9 +29,17 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
29
29
 
30
30
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
31
 
32
+ var getSize = function getSize(innerWidth) {
33
+ if (innerWidth < 600) return 'xs';
34
+ if (innerWidth < 960) return 'sm';
35
+ if (innerWidth < 1280) return 'md';
36
+ if (innerWidth < 1920) return 'lg';
37
+ return 'xl';
38
+ };
39
+
32
40
  var useWindowSize = function useWindowSize() {
33
41
  var _React$useState = _react.default.useState({
34
- size: 'md',
42
+ size: getSize(window.innerWidth),
35
43
  innerWidth: window.innerWidth,
36
44
  innerHeight: window.innerHeight,
37
45
  breakpoints: _stylesheet.defaultBreakpoints
@@ -44,20 +52,9 @@ var useWindowSize = function useWindowSize() {
44
52
  function handleResize() {
45
53
  var state = _objectSpread({}, windowSize);
46
54
 
55
+ state.size = getSize(window.innerWidth);
47
56
  state.innerWidth = window.innerWidth;
48
57
 
49
- if (window.innerWidth < _stylesheet.defaultBreakpoints.sm) {
50
- state.size = 'xs';
51
- } else if (window.innerWidth < _stylesheet.defaultBreakpoints.md) {
52
- state.size = 'sm';
53
- } else if (window.innerWidth < _stylesheet.defaultBreakpoints.lg) {
54
- state.size = 'md';
55
- } else if (window.innerWidth < _stylesheet.defaultBreakpoints.xl) {
56
- state.size = 'lg';
57
- } else {
58
- state.size = 'xl';
59
- }
60
-
61
58
  if (window.innerWidth < window.innerHeight) {
62
59
  state.orientation = 'portrait';
63
60
  } else if (window.innerWidth > window.innerHeight) {
@@ -1,59 +1,59 @@
1
- import { Meta } from '@storybook/addon-docs';
2
-
3
- <Meta title="ui-councilbox" />
4
-
5
- <style>{`
6
- #docs-root{
7
- overflow-x: auto;
8
- height: 100%;
9
- }
10
- a.noStyles{
11
- color: black;
12
- }
13
- a.noStyles:hover{
14
- border-bottom: 1px solid black;
15
- }
16
- `}</style>
17
-
18
-
19
- # Librería de componentes ui-councilbox v0.5.4
20
-
21
- <h2>Componentes:</h2>
22
- <div><a class='noStyles' href='/story/components-accordion--default'>Accordion</a></div>
23
- <div><a class='noStyles' href='/story/components-alert--default'>Alert</a></div>
24
- <div><a class='noStyles' href='/story/components-avatar--default'>Avatar</a></div>
25
- <div><a class='noStyles' href='/story/components-buttonbasic--default'>ButtonBasic</a></div>
26
- <div><a class='noStyles' href='/story/components-checkbox--default'>Checkbox</a></div>
27
- <div><a class='noStyles' href='/story/components-drawerpanel--design-drawer-panel-template'>DrawerPanel</a></div>
28
- <div><a class='noStyles' href='/story/components-dragdrop--default'>DragDrop</a></div>
29
- <div><a class='noStyles' href='/story/components-dropdown--design-drop-down-template'>DropDown</a></div>
30
- <div><a class='noStyles' href='/story/components-enhancedtable--design-template-enhanced-table'>EnhanceTable</a></div>
31
- <div><a class='noStyles' href='/story/components-fabbutton'>FabButton</a></div>
32
- <div><a class='noStyles' href='/story/components-grid--design-grids'>Grid</a></div>
33
- <div><a class='noStyles' href='/story/components-header--header-all-buttons'>Header</a></div>
34
- <div><a class='noStyles' href='/story/components-iconbutton--design-icon-button-template'>IconButton</a></div>
35
- <div><a class='noStyles' href='/story/components-iconbuttonsquare--design-icon-button-square-template'>IconButtonSquare</a></div>
36
- <div><a class='noStyles' href='/story/components-input-autocomplete--default'>InputAutocomplete</a></div>
37
- <div><a class='noStyles' href='/story/components-input-password--default'>InputPassword</a></div>
38
- <div><a class='noStyles' href='/story/components-inputtext--default'>InputText</a></div>
39
- <div><a class='noStyles' href='/story/components-inputtextarea--design-input-text-area-template'>InputTextArea</a></div>
40
- <div><a class='noStyles' href='/story/components-loadingsection--default'>LoadingSection</a></div>
41
- <div><a class='noStyles' href='/story/components-menuitem--default'>MenuItem</a></div>
42
- <div><a class='noStyles' href='/story/components-menulateralleft--design-menu-lateral-left-template'>MenuLateralLeft</a></div>
43
- <div><a class='noStyles' href='/story/components-menulateralright--design-menu-lateral-right-template'>MenuLateralRight</a></div>
44
- <div><a class='noStyles' href='/story/components-modal--default'>Modal</a></div>
45
- <div><a class='noStyles' href='/story/components-paginationfooter--design-template-pagination-footer'>PaginationFooter</a></div>
46
- <div><a class='noStyles' href='/story/components-radio--default'>Radio</a></div>
47
- <div><a class='noStyles' href='/story/components-scrollbar--design-scrollbar-template'>Scrollbar</a></div>
48
- <div><a class='noStyles' href='/story/components-selectinput--default'>SelectInput</a></div>
49
- <div><a class='noStyles' href='/story/components-spacing--default'>Spacing</a></div>
50
- <div><a class='noStyles' href='/story/components-stars--design-stars-template'>Stars</a></div>
51
- <div><a class='noStyles' href='/story/components-stepper--design-stepper-template'>Stepper</a></div>
52
- <div><a class='noStyles' href='/story/components-table--design-template-table'>Table</a></div>
53
- <div><a class='noStyles' href='/story/components-tabs--design-tabs-template'>Tabs</a></div>
54
- <div><a class='noStyles' href='/story/components-tag--design-tag-template'>Tag</a></div>
55
- <div><a class='noStyles' href='/story/components-toggle--default'>Toggle</a></div>
56
- <div><a class='noStyles' href='/story/components-typography--default'>Typography</a></div>
57
-
58
- <h2>Fuentes:</h2>
59
- <div><a class='noStyles' href='/story/fonts-iconfont--default'>Iconfont</a></div>
1
+ import { Meta } from '@storybook/addon-docs';
2
+
3
+ <Meta title="ui-councilbox" />
4
+
5
+ <style>{`
6
+ #docs-root{
7
+ overflow-x: auto;
8
+ height: 100%;
9
+ }
10
+ a.noStyles{
11
+ color: black;
12
+ }
13
+ a.noStyles:hover{
14
+ border-bottom: 1px solid black;
15
+ }
16
+ `}</style>
17
+
18
+
19
+ # Librería de componentes ui-councilbox v0.6.2
20
+
21
+ <h2>Componentes:</h2>
22
+ <div><a class='noStyles' href='/story/components-accordion--default'>Accordion</a></div>
23
+ <div><a class='noStyles' href='/story/components-alert--default'>Alert</a></div>
24
+ <div><a class='noStyles' href='/story/components-avatar--default'>Avatar</a></div>
25
+ <div><a class='noStyles' href='/story/components-buttonbasic--default'>ButtonBasic</a></div>
26
+ <div><a class='noStyles' href='/story/components-checkbox--default'>Checkbox</a></div>
27
+ <div><a class='noStyles' href='/story/components-drawerpanel--design-drawer-panel-template'>DrawerPanel</a></div>
28
+ <div><a class='noStyles' href='/story/components-dragdrop--default'>DragDrop</a></div>
29
+ <div><a class='noStyles' href='/story/components-dropdown--design-drop-down-template'>DropDown</a></div>
30
+ <div><a class='noStyles' href='/story/components-enhancedtable--design-template-enhanced-table'>EnhanceTable</a></div>
31
+ <div><a class='noStyles' href='/story/components-fabbutton'>FabButton</a></div>
32
+ <div><a class='noStyles' href='/story/components-grid--design-grids'>Grid</a></div>
33
+ <div><a class='noStyles' href='/story/components-header--header-all-buttons'>Header</a></div>
34
+ <div><a class='noStyles' href='/story/components-iconbutton--design-icon-button-template'>IconButton</a></div>
35
+ <div><a class='noStyles' href='/story/components-iconbuttonsquare--design-icon-button-square-template'>IconButtonSquare</a></div>
36
+ <div><a class='noStyles' href='/story/components-input-autocomplete--default'>InputAutocomplete</a></div>
37
+ <div><a class='noStyles' href='/story/components-input-password--default'>InputPassword</a></div>
38
+ <div><a class='noStyles' href='/story/components-inputtext--default'>InputText</a></div>
39
+ <div><a class='noStyles' href='/story/components-inputtextarea--design-input-text-area-template'>InputTextArea</a></div>
40
+ <div><a class='noStyles' href='/story/components-loadingsection--default'>LoadingSection</a></div>
41
+ <div><a class='noStyles' href='/story/components-menuitem--default'>MenuItem</a></div>
42
+ <div><a class='noStyles' href='/story/components-menulateralleft--design-menu-lateral-left-template'>MenuLateralLeft</a></div>
43
+ <div><a class='noStyles' href='/story/components-menulateralright--design-menu-lateral-right-template'>MenuLateralRight</a></div>
44
+ <div><a class='noStyles' href='/story/components-modal--default'>Modal</a></div>
45
+ <div><a class='noStyles' href='/story/components-paginationfooter--design-template-pagination-footer'>PaginationFooter</a></div>
46
+ <div><a class='noStyles' href='/story/components-radio--default'>Radio</a></div>
47
+ <div><a class='noStyles' href='/story/components-scrollbar--design-scrollbar-template'>Scrollbar</a></div>
48
+ <div><a class='noStyles' href='/story/components-selectinput--default'>SelectInput</a></div>
49
+ <div><a class='noStyles' href='/story/components-spacing--default'>Spacing</a></div>
50
+ <div><a class='noStyles' href='/story/components-stars--design-stars-template'>Stars</a></div>
51
+ <div><a class='noStyles' href='/story/components-stepper--design-stepper-template'>Stepper</a></div>
52
+ <div><a class='noStyles' href='/story/components-table--design-template-table'>Table</a></div>
53
+ <div><a class='noStyles' href='/story/components-tabs--design-tabs-template'>Tabs</a></div>
54
+ <div><a class='noStyles' href='/story/components-tag--design-tag-template'>Tag</a></div>
55
+ <div><a class='noStyles' href='/story/components-toggle--default'>Toggle</a></div>
56
+ <div><a class='noStyles' href='/story/components-typography--default'>Typography</a></div>
57
+
58
+ <h2>Fuentes:</h2>
59
+ <div><a class='noStyles' href='/story/fonts-iconfont--default'>Iconfont</a></div>
@@ -25,7 +25,16 @@ a.noStyles:hover{
25
25
  <div>Fix zIndex label InputText y SelectInput</div>
26
26
  </div>
27
27
 
28
- <h2>v0.5.4</h2>
28
+ <h2>v0.6.2</h2>
29
+ <div>Add prop noCollapseUpperSection en MenuLateralRight</div>
30
+ <div>Fix useWindowSize</div>
31
+ <div>Fix Stepper quitado onClick de la flecha</div>
32
+
33
+ <h2>v0.6.1</h2>
34
+ <div>Fix estilos Stepper</div>
35
+ <div>Add prop freeNavigation Stepper</div>
36
+
37
+ <h2>v0.6.0</h2>
29
38
  <div>Fix zIndex label InputText y SelectInput</div>
30
39
  <div>Añadido padding y cambios para que se ajuste mejor al diseño Stepper </div>
31
40
  <div>Añadido tooltip Stepper </div>
@@ -38,7 +38,8 @@ var MenuLateralRight = function MenuLateralRight(_ref) {
38
38
  upperSection = _ref.upperSection,
39
39
  underSection = _ref.underSection,
40
40
  mobile = _ref.mobile,
41
- buttonVideo = _ref.buttonVideo;
41
+ buttonVideo = _ref.buttonVideo,
42
+ noCollapseUpperSection = _ref.noCollapseUpperSection;
42
43
 
43
44
  var _useWindowSize = (0, _useWindowSize2.default)(),
44
45
  innerWidth = _useWindowSize.innerWidth,
@@ -80,7 +81,19 @@ var MenuLateralRight = function MenuLateralRight(_ref) {
80
81
  width: 'var(--spacing64)',
81
82
  height: 'var(--spacing64)'
82
83
  } : {})
83
- }), /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
84
+ }), noCollapseUpperSection ? upperSection === null || upperSection === void 0 ? void 0 : upperSection.map(function (item, index) {
85
+ return /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
86
+ key: "upper-square-section-".concat(index),
87
+ icon: item.icon,
88
+ active: buttonVideo.active ? false : item.active,
89
+ onClick: item.action,
90
+ badge: item.badge,
91
+ styles: _objectSpread({}, resize() ? {
92
+ width: 'var(--spacing64)',
93
+ height: 'var(--spacing64)'
94
+ } : {})
95
+ });
96
+ }) : /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
84
97
  icon: iconSelectDropDown().icon,
85
98
  active: buttonVideo.active ? false : iconSelectDropDown().active,
86
99
  onClick: iconSelectDropDown().action,
@@ -89,7 +102,7 @@ var MenuLateralRight = function MenuLateralRight(_ref) {
89
102
  width: 'var(--spacing64)',
90
103
  height: 'var(--spacing64)'
91
104
  } : {})
92
- }), /*#__PURE__*/_react.default.createElement(_DropDown.default, {
105
+ }), !noCollapseUpperSection && /*#__PURE__*/_react.default.createElement(_DropDown.default, {
93
106
  color: "transparent",
94
107
  Component: function Component() {
95
108
  return /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
@@ -29,7 +29,7 @@ var DesignStepper = function DesignStepper() {
29
29
  state = _React$useState2[0],
30
30
  setState = _React$useState2[1];
31
31
 
32
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Stepper.default, {
32
+ return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Stepper.default, {
33
33
  onClick: setState,
34
34
  items: [{
35
35
  text: 'Detalles',
@@ -57,8 +57,38 @@ var DesignStepper = function DesignStepper() {
57
57
  icon: 'ri-file-text-line'
58
58
  }],
59
59
  active: state
60
- }));
60
+ })), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Stepper.default, {
61
+ onClick: setState,
62
+ freeNavigation: false,
63
+ items: [{
64
+ text: 'Detalles',
65
+ name: 'Detalles',
66
+ icon: 'ri-file-list-2-line'
67
+ }, {
68
+ text: 'Participantes',
69
+ name: 'Participantes',
70
+ icon: 'ri-user-3-line'
71
+ }, {
72
+ text: 'Consentimientos',
73
+ name: 'Consentimientos',
74
+ icon: 'ri-clipboard-line'
75
+ }, {
76
+ text: 'Documentacion',
77
+ name: 'Documentacion',
78
+ icon: 'ri-folder-3-line'
79
+ }, {
80
+ text: 'Configuracion',
81
+ name: 'Configuracion',
82
+ icon: 'ri-settings-4-line'
83
+ }, {
84
+ text: 'Revisar',
85
+ name: 'Revisar',
86
+ icon: 'ri-file-text-line'
87
+ }],
88
+ active: state
89
+ })));
61
90
  };
62
91
 
92
+ DesignStepper.displayName = "DesignStepper";
63
93
  var _default = DesignStepper;
64
94
  exports.default = _default;
@@ -19,7 +19,6 @@
19
19
  align-items: center;
20
20
  transition: .3s;
21
21
  width: calc( 100% - 2rem );
22
- justify-content: center;
23
22
  }
24
23
 
25
24
  .cbx-stepper-item-contentText:last-child {
@@ -30,9 +29,10 @@
30
29
  padding-left: 0;
31
30
  padding-right: 0;
32
31
  padding: 0.5rem 0rem 0.5rem 0rem;
32
+ justify-content: center;
33
33
  }
34
34
 
35
- .cbx-stepper-item-contentText:hover {
35
+ .cbx-stepper-item-contentText-hover:hover {
36
36
  background: var(--gray1);
37
37
  border-radius: 0.25rem;
38
38
  }
@@ -46,8 +46,8 @@
46
46
  transition: .3s
47
47
  }
48
48
 
49
- .cbx-stepper-item-contentText:hover i,
50
- .cbx-stepper-item-contentText:hover p {
49
+ .cbx-stepper-item-contentText-hover:hover i,
50
+ .cbx-stepper-item-contentText-hover:hover p {
51
51
  color: var(--primary)
52
52
  }
53
53
 
@@ -73,5 +73,6 @@
73
73
 
74
74
  .cbx-stepper-item-arrow-content {
75
75
  width: 100%;
76
- text-align: center
76
+ text-align: center;
77
+ cursor: default;
77
78
  }
@@ -19,7 +19,7 @@ var _Typography = _interopRequireDefault(require("../Typography/Typography"));
19
19
 
20
20
  var _useWindowSize2 = _interopRequireDefault(require("../../HOCs/useWindowSize"));
21
21
 
22
- var _excluded = ["items", "active", "onClick"];
22
+ var _excluded = ["items", "active", "onClick", "freeNavigation"];
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
25
 
@@ -33,6 +33,8 @@ var Stepper = function Stepper(_ref) {
33
33
  var items = _ref.items,
34
34
  active = _ref.active,
35
35
  _onClick = _ref.onClick,
36
+ _ref$freeNavigation = _ref.freeNavigation,
37
+ freeNavigation = _ref$freeNavigation === void 0 ? true : _ref$freeNavigation,
36
38
  props = _objectWithoutProperties(_ref, _excluded);
37
39
 
38
40
  var _useWindowSize = (0, _useWindowSize2.default)(),
@@ -43,18 +45,19 @@ var Stepper = function Stepper(_ref) {
43
45
  }, props), items.map(function (item, index) {
44
46
  return /*#__PURE__*/_react.default.createElement("div", {
45
47
  onClick: function onClick() {
46
- return _onClick(item.name);
48
+ return freeNavigation && _onClick(item.name);
47
49
  },
48
50
  key: index,
49
51
  className: "cbx-stepper-item",
50
52
  style: {
51
53
  flex: items.length - 1 !== index && '1 1',
52
- maxWidth: "".concat('100' / (items.length - 1), "%")
54
+ maxWidth: "".concat('100' / (items.length - 1), "%"),
55
+ cursor: freeNavigation ? 'pointer' : 'inherit'
53
56
  }
54
57
  }, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
55
58
  title: item.name || ''
56
59
  }, /*#__PURE__*/_react.default.createElement("div", {
57
- className: "".concat(innerWidth < 427 ? 'cbx-stepper-item-contentText cbx-stepper-item-contentText-mobile' : 'cbx-stepper-item-contentText'),
60
+ className: "".concat(innerWidth < 427 ? "cbx-stepper-item-contentText ".concat(freeNavigation && 'cbx-stepper-item-contentText-hover', " cbx-stepper-item-contentText-mobile") : "cbx-stepper-item-contentText ".concat(freeNavigation && 'cbx-stepper-item-contentText-hover')),
58
61
  style: {
59
62
  color: active === item.name || items.slice(index + 1).some(function (i) {
60
63
  return i.name === active;
@@ -69,7 +72,11 @@ var Stepper = function Stepper(_ref) {
69
72
  return i.name === active;
70
73
  }) ? 'var(--primary)' : 'var(--gray4)'
71
74
  }, item.text)))), items.length - 1 !== index && /*#__PURE__*/_react.default.createElement("div", {
72
- className: "cbx-stepper-item-arrow-content"
75
+ className: "cbx-stepper-item-arrow-content",
76
+ onClick: function onClick(e) {
77
+ e.stopPropagation();
78
+ e.preventDefault();
79
+ }
73
80
  }, /*#__PURE__*/_react.default.createElement("i", {
74
81
  className: "cbx-stepper-item-arrow-icon ri-arrow-drop-right-line"
75
82
  })));
@@ -78,12 +85,12 @@ var Stepper = function Stepper(_ref) {
78
85
 
79
86
  Stepper.displayName = "Stepper";
80
87
  Stepper.propTypes = {
81
- items: _propTypes.default.node,
88
+ items: _propTypes.default.array,
82
89
  active: _propTypes.default.node,
83
90
  onClick: _propTypes.default.func
84
91
  };
85
92
  Stepper.defaultProps = {
86
- items: {},
93
+ items: [],
87
94
  active: undefined,
88
95
  onClick: undefined
89
96
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@councilbox/councilbox-ui",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "main": "dist/build-index.js",
5
5
  "files": [
6
6
  "dist",