@steroidsjs/bootstrap 3.0.0-beta.65 → 3.0.0-beta.67

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.
@@ -108,7 +108,7 @@ $alert-themes: map-merge(
108
108
  }
109
109
 
110
110
  &__wrapper {
111
- width: 508px;
111
+ max-width: 508px;
112
112
  display: flex;
113
113
  flex-flow: column;
114
114
  justify-content: space-between;
@@ -114,6 +114,16 @@ $btn-letter-spacing: 0.1em;
114
114
  &__link {
115
115
  display: inline-flex;
116
116
  align-items: center;
117
+
118
+ #{$root}__text {
119
+ color: $link-color;
120
+ }
121
+
122
+ &:hover {
123
+ #{$root}__text {
124
+ color: $link-color-hover;
125
+ }
126
+ }
117
127
  }
118
128
 
119
129
  &__icon {
@@ -22,11 +22,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  exports.__esModule = true;
26
29
  var React = __importStar(require("react"));
27
30
  var react_1 = require("react");
28
31
  var react_transition_group_1 = require("react-transition-group");
29
32
  var hooks_1 = require("@steroidsjs/core/hooks");
33
+ var AlertView_1 = __importDefault(require("../../content/Alert/AlertView"));
30
34
  function NotificationsItemView(props) {
31
35
  var _a, _b;
32
36
  var _c = (0, react_1.useState)(false), isShow = _c[0], setIsShow = _c[1];
@@ -34,15 +38,12 @@ function NotificationsItemView(props) {
34
38
  setIsShow(!props.isClosing);
35
39
  }, [props.isClosing]);
36
40
  var bem = (0, hooks_1.useBem)('NotificationsItemView');
37
- return (React.createElement(react_transition_group_1.CSSTransition, { "in": isShow, timeout: 1000, classNames: bem(bem.block((_a = {},
41
+ return (React.createElement(react_transition_group_1.CSSTransition, { "in": isShow, timeout: 1000, classNames: bem.block((_a = {},
38
42
  _a[props.position] = true,
39
- _a))), unmountOnExit: true },
40
- React.createElement("div", { className: bem(bem.block((_b = {},
41
- _b[props.level] = true,
43
+ _a)), unmountOnExit: true },
44
+ React.createElement("div", { className: bem.block((_b = {},
42
45
  _b[props.position] = true,
43
- _b)), 'alert', 'alert-' + props.level) },
44
- React.createElement("div", { className: bem.element('body') },
45
- React.createElement("div", { className: bem.element('message') }, props.message),
46
- React.createElement("button", { className: bem.element('close'), onClick: props.onClose })))));
46
+ _b)) },
47
+ React.createElement(AlertView_1["default"], { onClose: props.onClose, message: props.message, type: props.level, showClose: true, isExist: true, isVisible: true, showIcon: true }))));
47
48
  }
48
49
  exports["default"] = NotificationsItemView;
@@ -1,51 +1,13 @@
1
1
  .NotificationsItemView {
2
+
2
3
  overflow: hidden;
3
4
  max-height: 120px;
4
5
  padding: 0;
5
6
 
6
7
  border-width: 0;
7
- box-shadow: 1px 0px 6px rgba(0, 0, 0, 0.1);
8
8
 
9
9
  transition: opacity .6s, transform .4s,
10
10
  max-height .6s .4s, margin .6s .6s;
11
-
12
- &__body{
13
- width: 100%;
14
- height: 100%;
15
-
16
- padding: 0.75rem 1.8rem 0.75rem 1.25rem;
17
- border: 1px solid transparent;
18
- border-color: inherit;
19
- }
20
-
21
- &__close{
22
- cursor: pointer;
23
- position: absolute;
24
- top: 0;
25
- right: 0;
26
- width: 25px;
27
- height: 25px;
28
-
29
- display: flex;
30
- justify-content: center;
31
- align-items: center;
32
-
33
- .IconView{
34
- svg{
35
- width: 10px;
36
- }
37
- }
38
-
39
- svg{
40
- opacity: 0.4;
41
- transition: opacity .1s ease-in;
42
- }
43
- &:hover svg{
44
- opacity: 1;
45
- }
46
- }
47
-
48
-
49
11
  // Styles for React-Transition-Groups
50
12
  ////////////////////////////////////////
51
13
 
@@ -1,6 +1,9 @@
1
1
  .NotificationsView {
2
2
  z-index: 9999;
3
3
  position: fixed;
4
+ display: flex;
5
+ flex-direction: column;
6
+ row-gap: 10px;
4
7
  width: 400px;
5
8
 
6
9
  margin: 0;
@@ -42,9 +42,14 @@ var Button_1 = __importDefault(require("@steroidsjs/core/ui/form/Button"));
42
42
  var hooks_1 = require("@steroidsjs/core/hooks");
43
43
  function NavBarView(props) {
44
44
  var bem = (0, hooks_1.useBem)('NavBarView');
45
- return (React.createElement("div", { className: bem('navbar-expand-lg navbar-nav', props.dark && 'navbar-dark bg-dark', bem.block(), props.className) },
46
- React.createElement("div", { className: 'navbar-nav px-3' }, props.items.map(function (item, index) { return (React.createElement("li", { key: item.id || index, className: bem('nav-item text-nowrap', item.isActive && 'active') },
47
- React.createElement(Button_1["default"], __assign({ link: true, className: bem('nav-link', item.isActive && 'active'), onClick: function () { return props.onClick(item, index); } }, item)))); })),
48
- props.children));
45
+ return (React.createElement("div", { className: bem(bem.block({
46
+ size: props.size
47
+ }), props.className) },
48
+ React.createElement("ul", { className: bem.element('list') }, props.items.map(function (item, index) { return (React.createElement("li", { key: item.id || index, className: bem(bem.element('list-item', {
49
+ active: item.isActive,
50
+ disabled: item.disabled
51
+ }), props.navClassName) },
52
+ React.createElement(Button_1["default"], __assign({ size: props.size, link: !item.isActive, onClick: function () { return props.onClick(item, index); } }, item)))); })),
53
+ React.createElement("div", { className: bem.element('content') }, props.children)));
49
54
  }
50
55
  exports["default"] = NavBarView;
@@ -1,2 +1,33 @@
1
1
  .NavBarView {
2
- }
2
+ $root: &;
3
+
4
+ color: $text-color;
5
+
6
+ &__list {
7
+ display: flex;
8
+ flex-flow: column nowrap;
9
+ row-gap: 8px;
10
+
11
+ &-item {
12
+ .ButtonView__text {
13
+ color: $element-placeholder-color;
14
+ }
15
+
16
+
17
+ &_active {
18
+ .ButtonView__text {
19
+ color: $white;
20
+ }
21
+ }
22
+
23
+ &_disabled {
24
+ cursor: not-allowed;
25
+ .ButtonView {
26
+ pointer-events: none;
27
+ }
28
+ }
29
+ }
30
+ }
31
+
32
+ @include navs-sizes($root);
33
+ }
@@ -42,8 +42,14 @@ var Button_1 = __importDefault(require("@steroidsjs/core/ui/form/Button"));
42
42
  var hooks_1 = require("@steroidsjs/core/hooks");
43
43
  function NavButtonView(props) {
44
44
  var bem = (0, hooks_1.useBem)('NavButtonView');
45
- return (React.createElement("div", { className: bem(bem.block(), props.className) },
46
- React.createElement("div", { className: bem(props.children && 'mb-3', bem.element('nav')) }, props.items.map(function (item, index) { return (React.createElement(Button_1["default"], __assign({ key: item.id || index, color: 'secondary', outline: !item.isActive, disabled: props.disabled, onClick: function () { return props.onClick(item, index); }, className: bem.element('nav-item') }, item))); })),
45
+ return (React.createElement("div", { className: bem(bem.block({
46
+ size: props.size
47
+ }), props.className) },
48
+ React.createElement("ul", { className: bem.element('list') }, props.items.map(function (item, index) { return (React.createElement("li", { key: item.id || index, className: bem(bem.element('list-item', {
49
+ active: item.isActive,
50
+ disabled: item.disabled
51
+ }), props.navClassName) },
52
+ React.createElement(Button_1["default"], __assign({ size: props.size, color: 'secondary', outline: !item.isActive, disabled: item.disabled, onClick: function () { return props.onClick(item, index); } }, item)))); })),
47
53
  React.createElement("div", { className: bem.element('content') }, props.children)));
48
54
  }
49
55
  exports["default"] = NavButtonView;
@@ -1,7 +1,8 @@
1
1
  .NavButtonView {
2
- &__nav-item {
3
- &:not(:last-child) {
4
- margin-right: 5px;
2
+
3
+ &__list {
4
+ display: flex;
5
+ flex-flow: column nowrap;
6
+ row-gap: 8px;
5
7
  }
6
- }
7
- }
8
+ }
@@ -40,10 +40,15 @@ exports.__esModule = true;
40
40
  var React = __importStar(require("react"));
41
41
  var Button_1 = __importDefault(require("@steroidsjs/core/ui/form/Button"));
42
42
  var hooks_1 = require("@steroidsjs/core/hooks");
43
+ var DEFAULT_ICON = 'add';
43
44
  function NavIconView(props) {
44
45
  var bem = (0, hooks_1.useBem)('NavIconView');
45
46
  return (React.createElement("div", { className: bem(bem.block(), props.className) },
46
- props.items.map(function (item, index) { return (React.createElement(Button_1["default"], __assign({ icon: props.icon ? props.icon : 'add', key: item.id || index, link: true, onClick: function () { return props.onClick(item, index); } }, item, { label: null, hint: item.hint || item.label || null }))); }),
47
- props.children));
47
+ React.createElement("ul", { className: bem.element('list') }, props.items.map(function (item, index) { return (React.createElement("li", { key: item.id || index, className: bem(bem.element('list-item', {
48
+ active: item.isActive,
49
+ disabled: item.disabled
50
+ }), props.navClassName) },
51
+ React.createElement(Button_1["default"], __assign({ icon: props.icon ? props.icon : DEFAULT_ICON, link: true, onClick: function () { return props.onClick(item, index); } }, item, { label: null, hint: item.hint || item.label || null })))); })),
52
+ React.createElement("div", { className: bem.element('content') }, props.children)));
48
53
  }
49
54
  exports["default"] = NavIconView;
@@ -1,9 +1,8 @@
1
1
  .NavIconView {
2
- > a {
3
- margin-right: 5px;
4
-
5
- &:last-child {
6
- margin-right: 0;
2
+ &__list {
3
+ display: flex;
4
+ flex-flow: row nowrap;
5
+ align-items: center;
6
+ column-gap: 24px;
7
7
  }
8
- }
9
- }
8
+ }
@@ -42,8 +42,14 @@ var Button_1 = __importDefault(require("@steroidsjs/core/ui/form/Button"));
42
42
  var hooks_1 = require("@steroidsjs/core/hooks");
43
43
  function NavLinkView(props) {
44
44
  var bem = (0, hooks_1.useBem)('NavLinkView');
45
- return (React.createElement("div", { className: bem(bem.block(), props.className) },
46
- React.createElement("div", { className: bem.element('nav mb-3') }, props.items.map(function (item, index) { return (React.createElement(Button_1["default"], __assign({ key: item.id || index, link: true, onClick: function () { return props.onClick(item, index); }, className: bem.element('nav-item') }, item))); })),
45
+ return (React.createElement("div", { className: bem(bem.block({
46
+ size: props.size
47
+ }), props.className) },
48
+ React.createElement("ul", { className: bem.element('list') }, props.items.map(function (item, index) { return (React.createElement("li", { key: item.id || index, className: bem(bem.element('list-item', {
49
+ active: item.isActive,
50
+ disabled: item.disabled
51
+ }), props.navClassName) },
52
+ React.createElement(Button_1["default"], __assign({ link: true, onClick: function () { return props.onClick(item, index); } }, item)))); })),
47
53
  React.createElement("div", { className: bem.element('content') }, props.children)));
48
54
  }
49
55
  exports["default"] = NavLinkView;
@@ -1,7 +1,16 @@
1
1
  .NavLinkView {
2
- &__nav-item {
3
- &:not(:last-child) {
4
- margin-right: 10px;
2
+ &__list {
3
+ display: flex;
4
+ flex-flow: row nowrap;
5
+ column-gap: 24px;
6
+
7
+ &-item {
8
+ &_disabled {
9
+ cursor: not-allowed;
10
+ .ButtonView {
11
+ pointer-events: none;
12
+ }
13
+ }
14
+ }
5
15
  }
6
- }
7
- }
16
+ }
@@ -42,16 +42,20 @@ var Link_1 = __importDefault(require("@steroidsjs/core/ui/nav/Link"));
42
42
  var hooks_1 = require("@steroidsjs/core/hooks");
43
43
  function NavListView(props) {
44
44
  var bem = (0, hooks_1.useBem)('NavListView');
45
- var renderItems = function (items) {
45
+ var renderItems = function (items, parentItemProps) {
46
+ if (parentItemProps === void 0) { parentItemProps = null; }
46
47
  if (!items || items.length === 0) {
47
48
  return null;
48
49
  }
49
- return items.map(function (item, index) { return (React.createElement("li", { key: index, className: bem('nav-item', bem.element('item'), props.navClassName) },
50
- React.createElement(Link_1["default"], __assign({ onClick: function () { return props.onClick(item, index); } }, item, { key: item.id || index, className: bem(item.isActive && 'active', bem.element('item-link'), item.className) })),
51
- item.items && item.items.length > 0 && (React.createElement("ul", { className: bem('nav flex-column', bem.element('sub-list')) }, renderItems(item.items))))); });
50
+ return items.map(function (item, index) { return (React.createElement("li", { key: item.id || index, className: bem(bem.element('list-item', {
51
+ active: item.isActive,
52
+ disabled: item.disabled
53
+ }), props.navClassName) },
54
+ React.createElement(Link_1["default"], __assign({ onClick: function () { return props.onClick(item, index); } }, item, { disabled: (parentItemProps === null || parentItemProps === void 0 ? void 0 : parentItemProps.disabled) || item.disabled })),
55
+ item.items && item.items.length > 0 && (React.createElement("ul", { className: bem.element('sub-list') }, renderItems(item.items, item))))); });
52
56
  };
53
- return (React.createElement("ul", { className: bem('nav flex-column', bem.block(), props.className) },
54
- renderItems(props.items),
55
- props.children));
57
+ return (React.createElement("div", { className: bem(bem.block(), props.className) },
58
+ React.createElement("ul", { className: bem.element('list') }, renderItems(props.items)),
59
+ React.createElement("div", { className: bem.element('content') }, props.children)));
56
60
  }
57
61
  exports["default"] = NavListView;
@@ -1,12 +1,13 @@
1
1
  .NavListView {
2
- &__item {
2
+
3
+ &__list{
4
+ display: flex;
5
+ flex-flow: column nowrap;
6
+ }
3
7
 
4
- }
5
- &__item-link {
6
- padding: 5px 10px;
7
- display: inline-block;
8
- }
9
- &__sub-list {
10
- margin-left: 15px;
11
- }
12
- }
8
+ &__sub-list {
9
+ display: flex;
10
+ flex-flow: column;
11
+ padding: 5px;
12
+ }
13
+ }
@@ -42,9 +42,14 @@ var Button_1 = __importDefault(require("@steroidsjs/core/ui/form/Button"));
42
42
  var hooks_1 = require("@steroidsjs/core/hooks");
43
43
  function NavTabsView(props) {
44
44
  var bem = (0, hooks_1.useBem)('NavTabsView');
45
- return (React.createElement("div", { className: bem(bem.block(), props.className) },
46
- React.createElement("div", { className: bem('nav nav-tabs', !props.children && 'mb-3') }, props.items.map(function (item, index) { return (React.createElement("li", { key: item.id || index, className: 'nav-item' },
47
- React.createElement(Button_1["default"], __assign({ link: true, onClick: function () { return props.onClick(item, index); } }, item, { className: bem('nav-link', item.isActive && 'active', item.className) })))); })),
48
- props.children));
45
+ return (React.createElement("div", { className: bem(bem.block({
46
+ size: props.size
47
+ }), props.className) },
48
+ React.createElement("ul", { className: bem.element('list') }, props.items.map(function (item, index) { return (React.createElement("li", { key: item.id || index, className: bem(bem.element('list-item', {
49
+ active: item.isActive,
50
+ disabled: item.disabled
51
+ }), props.navClassName) },
52
+ React.createElement(Button_1["default"], __assign({ size: props.size, link: !item.isActive, onClick: function () { return props.onClick(item, index); } }, item)))); })),
53
+ React.createElement("div", { className: bem.element('content') }, props.children)));
49
54
  }
50
55
  exports["default"] = NavTabsView;
@@ -1,2 +1,48 @@
1
1
  .NavTabsView {
2
- }
2
+ $root: &;
3
+
4
+ color: $text-color;
5
+
6
+ &__list {
7
+ display: inline-flex;
8
+ flex-flow: row nowrap;
9
+ align-items: center;
10
+
11
+ border-bottom: 1px solid $element-border-color;
12
+
13
+ &-item {
14
+ .ButtonView__text {
15
+ color: $element-placeholder-color;
16
+ }
17
+
18
+ &_active {
19
+ .ButtonView__text {
20
+ color: $white;
21
+ }
22
+
23
+ .ButtonView {
24
+ &_size {
25
+ &_sm {
26
+ border-radius: $radius-small $radius-small 0 0;
27
+ }
28
+ &_md {
29
+ border-radius: $radius-large $radius-large 0 0;
30
+ }
31
+ &_lg {
32
+ border-radius: $radius-large $radius-large 0 0;
33
+ }
34
+ }
35
+ }
36
+ }
37
+
38
+ &_disabled {
39
+ cursor: not-allowed;
40
+ .ButtonView {
41
+ pointer-events: none;
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ @include navs-sizes($root);
48
+ }
@@ -1,65 +1,69 @@
1
1
  .TreeView {
2
- list-style: none;
3
- margin: 0;
4
- padding: 0;
5
-
6
- &__item {
2
+ list-style: none;
3
+ margin: 0;
7
4
  padding: 0;
8
- cursor: pointer;
9
5
 
10
- > .ButtonView {
11
- margin: 2px 0;
6
+ &__item {
7
+ padding: 0;
8
+ cursor: pointer;
9
+
10
+ > .ButtonView {
11
+ margin: 2px 0;
12
+ }
12
13
  }
13
- }
14
14
 
15
- &__item-label {
16
- position: relative;
17
- padding: 5px 10px;
18
- display: flex;
19
- flex-direction: row;
20
- justify-content: flex-start;
21
- background-color: $background-color;
15
+ &__item-label {
16
+ position: relative;
17
+ padding: 5px 10px;
18
+ display: flex;
19
+ flex-direction: row;
20
+ justify-content: flex-start;
21
+ background-color: $background-color;
22
22
 
23
- .ButtonView__link {
24
- color: $text-color;
25
- }
23
+ .ButtonView__link {
24
+ .ButtonView__text {
25
+ color: $text-color;
26
+ }
27
+ }
26
28
 
27
- // &:hover {
28
- // color: $list-group-action-hover-color;
29
- // background-color: $list-group-hover-bg;
30
- // }
29
+ // &:hover {
30
+ // color: $list-group-action-hover-color;
31
+ // background-color: $list-group-hover-bg;
32
+ // }
31
33
 
32
- &, &:hover {
33
- text-decoration: none !important;
34
+ &,
35
+ &:hover {
36
+ text-decoration: none !important;
37
+ }
34
38
  }
35
- }
36
- &__item_selected &__item-label {
37
- background-color: $secondary;
38
- &, &::before {
39
- color: $text-color;
39
+ &__item_selected &__item-label {
40
+ background-color: $secondary;
41
+ &,
42
+ &::before {
43
+ color: $text-color;
44
+ }
45
+ }
46
+ &__item-label::before {
47
+ display: inline-block;
48
+ content: "";
49
+ transform: rotate(0);
50
+ width: 21px;
51
+ height: 20px;
52
+ font-size: 12px;
53
+ font-weight: bold;
54
+ margin-left: 10px;
55
+ color: $text-color;
56
+ position: relative;
57
+ top: 1px;
58
+ left: 3px;
59
+ }
60
+ &__item_has-items &__item-label::before {
61
+ content: ">";
40
62
  }
41
- }
42
- &__item-label::before {
43
- display: inline-block;
44
- content: '';
45
- transform: rotate(0);
46
- width: 21px;
47
- height: 20px;
48
- font-size: 12px;
49
- font-weight: bold;
50
- margin-left: 10px;
51
- color: $text-color;
52
- position: relative;
53
- top: 1px;
54
- left: 3px;
55
- }
56
- &__item_has-items &__item-label::before {
57
- content: '>';
58
- }
59
63
 
60
- &__item_opened &__item-label::before {
61
- top: 7px;
62
- left: -4px;
63
- transform: rotate(90deg);
64
- }
64
+ &__item_opened &__item-label::before {
65
+ top: 7px;
66
+ left: -4px;
67
+ transform: rotate(90deg);
68
+ }
65
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/bootstrap",
3
- "version": "3.0.0-beta.65",
3
+ "version": "3.0.0-beta.67",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
@@ -2,4 +2,5 @@
2
2
  @import "typography";
3
3
  @import "scroll";
4
4
  @import "customMixins";
5
- @import "date";
5
+ @import "date";
6
+ @import "navs";
@@ -0,0 +1,39 @@
1
+ @mixin navs-sizes($root) {
2
+ &_size {
3
+ &_lg {
4
+ .ButtonView__link {
5
+ padding: 16px;
6
+ }
7
+
8
+ #{$root}__list-item_active {
9
+ .ButtonView {
10
+ padding: 16px;
11
+ }
12
+ }
13
+ }
14
+
15
+ &_md {
16
+ .ButtonView__link {
17
+ padding: 12px;
18
+ }
19
+
20
+ #{$root}__list-item_active {
21
+ .ButtonView {
22
+ padding: 12px;
23
+ }
24
+ }
25
+ }
26
+
27
+ &_sm {
28
+ .ButtonView__link {
29
+ padding: 8px;
30
+ }
31
+
32
+ #{$root}__list-item_active {
33
+ .ButtonView {
34
+ padding: 8px;
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }