@steroidsjs/bootstrap 3.0.0-beta.2 → 3.0.0-beta.20
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/content/Accordion/AccordionItemView.d.ts +2 -0
- package/content/Accordion/AccordionItemView.js +96 -0
- package/content/Accordion/AccordionItemView.scss +195 -0
- package/content/Accordion/AccordionView.d.ts +2 -0
- package/content/{Collapse/CollapseView.js → Accordion/AccordionView.js} +3 -3
- package/content/Accordion/AccordionView.scss +14 -0
- package/content/Alert/AlertView.d.ts +0 -1
- package/content/Alert/AlertView.js +12 -16
- package/content/Alert/AlertView.scss +46 -81
- package/content/Avatar/AvatarGroupView.d.ts +0 -1
- package/content/Avatar/AvatarView.d.ts +0 -1
- package/content/Avatar/AvatarView.js +4 -2
- package/content/Avatar/AvatarView.scss +139 -85
- package/content/Badge/BadgeView.d.ts +3 -0
- package/content/Badge/BadgeView.js +25 -0
- package/content/Badge/BadgeView.scss +107 -0
- package/content/Calendar/CalendarView.d.ts +0 -1
- package/content/Calendar/CaptionElement.d.ts +0 -1
- package/content/Calendar/CaptionElement.js +1 -1
- package/content/Card/CardView.d.ts +0 -1
- package/content/Detail/DetailView.d.ts +0 -1
- package/content/DropDown/DropDownView.d.ts +0 -1
- package/content/DropDown/DropDownView.js +6 -3
- package/content/DropDown/DropDownView.scss +196 -27
- package/{icon → content}/Icon/IconView.d.ts +1 -2
- package/crud/Crud/CrudView.d.ts +0 -1
- package/form/AutoCompleteField/AutoCompleteFieldView.d.ts +0 -1
- package/form/Button/ButtonView.d.ts +0 -1
- package/form/Button/ButtonView.js +8 -9
- package/form/Button/ButtonView.scss +116 -78
- package/form/CheckboxField/CheckboxFieldView.d.ts +0 -1
- package/form/CheckboxField/CheckboxFieldView.js +3 -3
- package/form/CheckboxField/CheckboxFieldView.scss +121 -36
- package/form/CheckboxListField/CheckboxListFieldView.d.ts +0 -1
- package/form/DateField/DateFieldView.d.ts +0 -1
- package/form/DateField/DateFieldView.js +1 -1
- package/form/DateRangeField/DateRangeFieldView.d.ts +0 -1
- package/form/DateRangeField/DateRangeFieldView.js +1 -1
- package/form/DateTimeField/DateTimeFieldView.d.ts +0 -1
- package/form/DateTimeField/DateTimeFieldView.js +1 -1
- package/form/DateTimeRangeField/DateTimeRangeFieldView.d.ts +0 -1
- package/form/DateTimeRangeField/DateTimeRangeFieldView.js +1 -1
- package/form/DropDownField/DropDownFieldView.d.ts +0 -1
- package/form/DropDownField/DropDownFieldView.js +1 -1
- package/form/FieldLayout/FieldLayoutView.d.ts +0 -1
- package/form/FieldList/FieldListView.d.ts +0 -1
- package/form/FieldSet/FieldSetView.d.ts +0 -1
- package/form/FileField/FileFieldItemView.d.ts +0 -1
- package/form/FileField/FileFieldItemView.js +1 -1
- package/form/FileField/FileFieldView.d.ts +0 -1
- package/form/FileField/FileFieldView.js +1 -1
- package/form/HtmlField/HtmlFieldView.d.ts +0 -1
- package/form/ImageField/ImageFieldModalView.d.ts +0 -1
- package/form/ImageField/ImageFieldView.d.ts +1 -2
- package/form/ImageField/ImageFieldView.js +9 -9
- package/form/InputField/InputFieldView.d.ts +0 -1
- package/form/NumberField/NumberFieldView.d.ts +0 -1
- package/form/PasswordField/PasswordFieldView.d.ts +0 -1
- package/form/PasswordField/PasswordFieldView.js +1 -1
- package/form/RadioListField/RadioListFieldView.d.ts +0 -1
- package/form/RateField/RateFieldView.d.ts +0 -1
- package/form/RateField/RateFieldView.js +1 -1
- package/form/ReCaptchaField/ReCaptchaFieldView.d.ts +0 -1
- package/form/SliderField/SliderFieldView.d.ts +0 -1
- package/form/SwitcherField/SwitcherFieldView.d.ts +0 -1
- package/form/TextField/TextFieldView.d.ts +0 -1
- package/form/TimeField/TimeFieldView.d.ts +0 -1
- package/form/TimeField/TimeFieldView.js +1 -1
- package/form/TimeField/TimePanelView.d.ts +0 -1
- package/{icon/fontawesome.js → icons/index.js} +17 -6
- package/icons/svgs/accordion-chevron.svg +4 -0
- package/icons/svgs/badge-close.svg +3 -0
- package/icons/svgs/close.svg +4 -0
- package/icons/svgs/default.svg +11 -0
- package/icons/svgs/error.svg +12 -0
- package/icons/svgs/info.svg +12 -0
- package/icons/svgs/loader.svg +3 -0
- package/icons/svgs/success.svg +4 -0
- package/icons/svgs/warning.svg +12 -0
- package/index.d.ts +14 -5
- package/index.js +16 -7
- package/index.scss +5 -3
- package/layout/Header/HeaderView.d.ts +0 -1
- package/layout/Header/HeaderView.js +1 -1
- package/layout/Loader/LoaderView.d.ts +0 -1
- package/layout/Notifications/NotificationsItemView.d.ts +0 -1
- package/layout/Notifications/NotificationsView.d.ts +0 -1
- package/layout/ProgressBar/CircleProgressBarView.d.ts +0 -1
- package/layout/ProgressBar/CircleProgressBarView.js +5 -2
- package/layout/ProgressBar/LineProgressBarView.d.ts +0 -1
- package/layout/Skeleton/SkeletonView.d.ts +0 -1
- package/layout/Tooltip/TooltipView.d.ts +0 -1
- package/list/CheckboxColumn/CheckboxColumnView.d.ts +0 -1
- package/list/ControlsColumnView/ControlsColumnView.d.ts +0 -1
- package/list/Empty/EmptyView.d.ts +0 -1
- package/list/Grid/GridView.js +4 -4
- package/list/List/ListItemView.d.ts +0 -1
- package/list/Pagination/PaginationButtonView.d.ts +0 -1
- package/list/Pagination/PaginationMoreView.d.ts +0 -1
- package/list/PaginationSize/PaginationSizeView.d.ts +0 -1
- package/list/Steps/StepItemView.d.ts +1 -2
- package/list/Steps/StepItemView.js +3 -3
- package/list/Steps/StepsView.d.ts +0 -1
- package/list/Steps/StepsView.js +1 -1
- package/modal/Modal/ModalView.d.ts +0 -1
- package/modal/TwoFactorModal/TwoFactorModalView.d.ts +0 -1
- package/nav/Breadcrubms/BreadcrumbsView.d.ts +0 -1
- package/nav/Controls/ControlsView.d.ts +0 -1
- package/nav/Nav/NavBarView.d.ts +0 -1
- package/nav/Nav/NavButtonView.d.ts +0 -1
- package/nav/Nav/NavIconView.d.ts +0 -1
- package/nav/Nav/NavLinkView.d.ts +0 -1
- package/nav/Nav/NavListView.d.ts +0 -1
- package/nav/Nav/NavTabsView.d.ts +0 -1
- package/nav/Tree/TreeView.d.ts +0 -1
- package/package.json +56 -52
- package/scss/mixins/button.scss +50 -24
- package/scss/mixins/index.scss +2 -1
- package/scss/mixins/typography.scss +26 -0
- package/scss/variables/common/colors.scss +154 -0
- package/scss/variables/common/media.scss +2 -0
- package/scss/variables/common/old-variables.scss +24 -0
- package/scss/variables/common/radiuses.scss +5 -0
- package/scss/variables/common/spacing.scss +12 -0
- package/scss/variables/common/typography.scss +107 -0
- package/scss/variables/components/calendar.scss +1 -1
- package/scss/variables/components/card.scss +1 -1
- package/scss/variables/components/icon.scss +1 -1
- package/scss/variables/components/input.scss +56 -1
- package/scss/variables/components/ratefield.scss +1 -1
- package/scss/variables/index.scss +6 -3
- package/typography/Text/TextView.d.ts +3 -0
- package/typography/Text/TextView.js +46 -0
- package/typography/Text/TextView.scss +15 -0
- package/typography/Title/TitleView.d.ts +3 -0
- package/typography/Title/TitleView.js +50 -0
- package/typography/Title/TitleView.scss +15 -0
- package/content/Collapse/CollapseItemView.d.ts +0 -3
- package/content/Collapse/CollapseItemView.js +0 -64
- package/content/Collapse/CollapseItemView.scss +0 -88
- package/content/Collapse/CollapseView.d.ts +0 -3
- package/content/Collapse/CollapseView.scss +0 -15
- package/icon/Icon/IconView.scss +0 -25
- package/icon/Icon/index.d.ts +0 -1
- package/icon/Icon/index.js +0 -16
- package/scss/variables/colors.scss +0 -74
- package/scss/variables/components/alert.scss +0 -9
- package/scss/variables/components/avatar.scss +0 -17
- /package/{icon → content}/Icon/IconView.js +0 -0
- /package/{icon/fontawesome.d.ts → icons/index.d.ts} +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
exports.__esModule = true;
|
|
29
|
+
var React = __importStar(require("react"));
|
|
30
|
+
var Icon_1 = __importDefault(require("@steroidsjs/core/ui/content/Icon"));
|
|
31
|
+
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
32
|
+
function AccordionItemView(props) {
|
|
33
|
+
var _a;
|
|
34
|
+
var bem = (0, hooks_1.useBem)('AccordionItemView');
|
|
35
|
+
React.useEffect(function () {
|
|
36
|
+
if (!props.toggleAccordion || !props.toggleCollapse || !props.activeKey) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (props.hasOneOpenItem) {
|
|
40
|
+
props.toggleAccordion(props.activeKey - 1);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
props.toggleCollapse(props.activeKey - 1);
|
|
44
|
+
}
|
|
45
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
|
+
}, [props.activeKey]);
|
|
47
|
+
var renderIcon = React.useCallback(function () {
|
|
48
|
+
if (!props.icon) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
var openIconClassName = bem.element('open-icon');
|
|
52
|
+
var closeIconClassName = bem.element('close-icon');
|
|
53
|
+
if (typeof props.icon === 'object') {
|
|
54
|
+
var icons = props.icon;
|
|
55
|
+
return (React.createElement(React.Fragment, null,
|
|
56
|
+
typeof icons.open === 'string'
|
|
57
|
+
? (React.createElement(Icon_1["default"], { name: icons.open, className: openIconClassName }))
|
|
58
|
+
: (React.createElement("span", { className: openIconClassName }, icons.open)),
|
|
59
|
+
typeof icons.close === 'string'
|
|
60
|
+
? (React.createElement(Icon_1["default"], { name: icons.close, className: closeIconClassName }))
|
|
61
|
+
: (React.createElement("span", { className: closeIconClassName }, icons.close))));
|
|
62
|
+
}
|
|
63
|
+
return typeof props.icon === 'string'
|
|
64
|
+
? React.createElement(Icon_1["default"], { name: props.icon })
|
|
65
|
+
: (React.createElement("span", { className: bem.element('custom-icon') }, props.icon));
|
|
66
|
+
}, [bem, props.icon]);
|
|
67
|
+
var handleHeaderClick = React.useCallback(function () {
|
|
68
|
+
if (props.disabled || !props.toggleAccordion || !props.toggleCollapse) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
var toggleAccordion = props.toggleAccordion, toggleCollapse = props.toggleCollapse, hasOneOpenItem = props.hasOneOpenItem, childIndex = props.childIndex;
|
|
72
|
+
if (hasOneOpenItem) {
|
|
73
|
+
toggleAccordion(childIndex);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
toggleCollapse(childIndex);
|
|
77
|
+
}
|
|
78
|
+
}, [props]);
|
|
79
|
+
return (React.createElement("div", { className: bem(bem.block((_a = {
|
|
80
|
+
disable: props.disabled
|
|
81
|
+
},
|
|
82
|
+
_a["position_".concat(props.position)] = !!props.position,
|
|
83
|
+
_a["theme_".concat(props.theme)] = !!props.theme,
|
|
84
|
+
_a.opened = !props.disabled && props.isShowMore,
|
|
85
|
+
_a)), props.className), style: props.style },
|
|
86
|
+
React.createElement("div", { className: bem.element('header-container'), onClick: handleHeaderClick },
|
|
87
|
+
React.createElement("div", { className: bem.element('title-container') },
|
|
88
|
+
React.createElement("p", null, props.title)),
|
|
89
|
+
props.showIcon && (React.createElement("div", { className: bem.element('icon-wrapper') }, props.icon
|
|
90
|
+
? renderIcon()
|
|
91
|
+
: (React.createElement(Icon_1["default"], { className: bem.element('icon', {
|
|
92
|
+
active: !props.disabled && props.isShowMore
|
|
93
|
+
}), name: "accordion-chevron" }))))),
|
|
94
|
+
React.createElement("div", { className: bem.element('content', { visible: !props.disabled && props.isShowMore }) }, props.children)));
|
|
95
|
+
}
|
|
96
|
+
exports["default"] = AccordionItemView;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--accordion-background-light: #f8f8f8;
|
|
3
|
+
--accordion-background-intermediate: #ffffff;
|
|
4
|
+
--accordion-background-dark: #312c3a;
|
|
5
|
+
--accordion-rect-background: #ffffff;
|
|
6
|
+
--accordion-chevron-color: #323232;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
html[data-theme="dark"] {
|
|
10
|
+
--accordion-background-light: #414141;
|
|
11
|
+
--accordion-background-intermediate: #5b5c6b;
|
|
12
|
+
--accordion-background-dark: #4e4f57;
|
|
13
|
+
--accordion-rect-background: #6f6b76;
|
|
14
|
+
--accordion-chevron-color: #ffffff;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
$accordionBackgroundMap: (
|
|
18
|
+
"light": var(--accordion-background-light),
|
|
19
|
+
"intermediate": var(--accordion-background-intermediate),
|
|
20
|
+
"dark": var(--accordion-background-dark),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
$accordion-rect-background: var(--accordion-rect-background);
|
|
24
|
+
$accordion-chevron-color: var(--accordion-chevron-color);
|
|
25
|
+
|
|
26
|
+
.AccordionItemView {
|
|
27
|
+
$root: &;
|
|
28
|
+
|
|
29
|
+
display: grid;
|
|
30
|
+
align-items: center;
|
|
31
|
+
|
|
32
|
+
background-color: #fff;
|
|
33
|
+
height: 56px;
|
|
34
|
+
width: 480px;
|
|
35
|
+
height: fit-content;
|
|
36
|
+
font-family: $font-family-nunito;
|
|
37
|
+
|
|
38
|
+
&_theme {
|
|
39
|
+
@each $theme, $backgroundColor in $accordionBackgroundMap {
|
|
40
|
+
&_#{$theme} {
|
|
41
|
+
#{$root}__header-container {
|
|
42
|
+
background-color: $backgroundColor;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
#{$root}__title-container {
|
|
46
|
+
color: $text-color;
|
|
47
|
+
|
|
48
|
+
@if ($theme == "dark" or $is-dark == "false") {
|
|
49
|
+
color: $white;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
#{$root}__icon {
|
|
54
|
+
svg {
|
|
55
|
+
@if ($theme == "light" or $theme == "intermediate") {
|
|
56
|
+
rect {
|
|
57
|
+
fill: $accordion-rect-background;
|
|
58
|
+
}
|
|
59
|
+
path {
|
|
60
|
+
stroke: $accordion-chevron-color;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&_position {
|
|
70
|
+
&_top {
|
|
71
|
+
#{$root}__header-container {
|
|
72
|
+
border-bottom: 1px solid rgba(#000, 0.1);
|
|
73
|
+
border-radius: $radius-large $radius-large 0 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&_middle {
|
|
78
|
+
#{$root}__header-container {
|
|
79
|
+
border-top: 1px solid rgba(#000, 0.1);
|
|
80
|
+
border-radius: 0px;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&_bottom {
|
|
85
|
+
#{$root}__content {
|
|
86
|
+
grid-row-start: 1;
|
|
87
|
+
grid-row-end: 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
#{$root}__header-container {
|
|
91
|
+
border-top: 1px solid rgba(#000, 0.1);
|
|
92
|
+
border-radius: 0 0 $radius-large $radius-large;
|
|
93
|
+
grid-row-start: 2;
|
|
94
|
+
grid-row-end: 2;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
#{$root}__icon {
|
|
98
|
+
transform: rotate(180deg);
|
|
99
|
+
&_active {
|
|
100
|
+
transform: rotate(0deg);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&_disable {
|
|
107
|
+
opacity: 0.4;
|
|
108
|
+
color: rgba(#212529, 0.7);
|
|
109
|
+
|
|
110
|
+
#{$root}__header-container {
|
|
111
|
+
background-color: #d7d7d7;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&_active {
|
|
116
|
+
margin-bottom: 16px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
p {
|
|
120
|
+
margin: 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&__icon {
|
|
124
|
+
box-shadow: 0px 1px 20px rgba(0, 0, 0, 0.1);
|
|
125
|
+
border-radius: $radius-small;
|
|
126
|
+
|
|
127
|
+
transform: rotate(0deg);
|
|
128
|
+
transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
129
|
+
|
|
130
|
+
&_active {
|
|
131
|
+
transform: rotate(180deg);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&__header-container {
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
cursor: pointer;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&__title-container {
|
|
142
|
+
width: 100%;
|
|
143
|
+
padding: 16px;
|
|
144
|
+
align-self: center;
|
|
145
|
+
font-size: $font-size-lg;
|
|
146
|
+
line-height: 24px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&__icon-wrapper {
|
|
150
|
+
width: 48px;
|
|
151
|
+
height: 48px;
|
|
152
|
+
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
justify-content: center;
|
|
156
|
+
|
|
157
|
+
&_not_visible {
|
|
158
|
+
width: 0;
|
|
159
|
+
opacity: 0;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&__content {
|
|
164
|
+
transition: all 200ms ease;
|
|
165
|
+
overflow: hidden;
|
|
166
|
+
max-height: 0;
|
|
167
|
+
padding: 0 16px;
|
|
168
|
+
color: #343a40;
|
|
169
|
+
|
|
170
|
+
&_visible {
|
|
171
|
+
max-height: 1024px;
|
|
172
|
+
padding: 18px 32px 18px 16px;
|
|
173
|
+
border: 1px solid rgba(#000, 0.1);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&__close-icon {
|
|
178
|
+
position: absolute;
|
|
179
|
+
opacity: 0;
|
|
180
|
+
pointer-events: none;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&_opened {
|
|
184
|
+
#{$root}__close-icon {
|
|
185
|
+
position: static;
|
|
186
|
+
opacity: 1;
|
|
187
|
+
pointer-events: all;
|
|
188
|
+
}
|
|
189
|
+
#{$root}__open-icon {
|
|
190
|
+
position: absolute;
|
|
191
|
+
opacity: 0;
|
|
192
|
+
pointer-events: none;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -25,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
exports.__esModule = true;
|
|
26
26
|
var React = __importStar(require("react"));
|
|
27
27
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
28
|
-
function
|
|
29
|
-
var bem = (0, hooks_1.useBem)('
|
|
28
|
+
function AccordionView(props) {
|
|
29
|
+
var bem = (0, hooks_1.useBem)('AccordionView');
|
|
30
30
|
return (React.createElement("div", { className: bem(bem.block(), props.className) }, props.children));
|
|
31
31
|
}
|
|
32
|
-
exports["default"] =
|
|
32
|
+
exports["default"] = AccordionView;
|
|
@@ -5,29 +5,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
8
|
-
var Icon_1 = __importDefault(require("@steroidsjs/core/ui/
|
|
8
|
+
var Icon_1 = __importDefault(require("@steroidsjs/core/ui/content/Icon"));
|
|
9
9
|
function Alert(props) {
|
|
10
10
|
var _a, _b;
|
|
11
11
|
var bem = (0, hooks_1.useBem)('AlertView');
|
|
12
12
|
return (props.isExist && (react_1["default"].createElement("div", { className: bem(bem.block((_a = {},
|
|
13
13
|
_a[props.type] = !!props.type,
|
|
14
|
-
_a['has-description'] = !!props.description,
|
|
15
14
|
_a['close-animation'] = !props.isVisible,
|
|
16
15
|
_a)), props.className), style: props.style },
|
|
17
|
-
|
|
18
|
-
_b[props.type] = !!props.type,
|
|
19
|
-
_b)) })),
|
|
20
|
-
typeof props.showIcon === 'string' && (react_1["default"].createElement(Icon_1["default"], { name: props.showIcon, className: bem.element('icon') })),
|
|
21
|
-
react_1["default"].createElement("div", { className: bem.element('content-wrapper') },
|
|
16
|
+
react_1["default"].createElement("div", { className: bem.element('wrapper') },
|
|
22
17
|
react_1["default"].createElement("div", { className: bem.element('content') },
|
|
23
|
-
props.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
props.showIcon && (react_1["default"].createElement(Icon_1["default"], { name: props.type, className: bem.element('icon', (_b = {},
|
|
19
|
+
_b[props.type] = !!props.type,
|
|
20
|
+
_b)) })),
|
|
21
|
+
react_1["default"].createElement("div", { className: bem.element('text-block') },
|
|
22
|
+
props.message && (react_1["default"].createElement("div", { className: bem.element('message') }, props.message)),
|
|
23
|
+
props.description && (react_1["default"].createElement("div", { className: bem.element('description') }, props.description))),
|
|
24
|
+
react_1["default"].createElement("div", null, props.showClose && (react_1["default"].createElement(Icon_1["default"], { className: bem.element('icon-close', {
|
|
25
|
+
large: !!props.description
|
|
26
|
+
}), name: 'close', onClick: props.onClose })))),
|
|
27
|
+
props.children || null))));
|
|
32
28
|
}
|
|
33
29
|
exports["default"] = Alert;
|
|
@@ -2,119 +2,84 @@
|
|
|
2
2
|
$root: &;
|
|
3
3
|
|
|
4
4
|
position: relative;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
align-items: center;
|
|
9
|
-
padding: $alert-padding-y $alert-padding-x;
|
|
10
|
-
|
|
11
|
-
border-radius: $alert-border-radius;
|
|
12
|
-
border: 1px solid transparent;
|
|
5
|
+
padding: 16px;
|
|
6
|
+
border-radius: $radius-large;
|
|
7
|
+
font-family: $font-family-nunito;
|
|
13
8
|
|
|
14
9
|
&_close-animation {
|
|
15
|
-
animation: hide_slide .4s ease-in;
|
|
10
|
+
animation: hide_slide 0.4s ease-in;
|
|
16
11
|
}
|
|
17
12
|
|
|
18
13
|
@keyframes hide_slide {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
14
|
+
0% {
|
|
15
|
+
transform: translateX(-10px);
|
|
16
|
+
}
|
|
17
|
+
40% {
|
|
18
|
+
transform: translateX(0%);
|
|
19
|
+
}
|
|
20
|
+
80% {
|
|
21
|
+
transform: translateX(-10%);
|
|
22
|
+
}
|
|
23
|
+
100% {
|
|
24
|
+
transform: translateX(100%);
|
|
25
|
+
}
|
|
31
26
|
}
|
|
32
27
|
|
|
33
|
-
&
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
&__icon.IconView {
|
|
29
|
+
height: 24px;
|
|
30
|
+
margin-right: 12px;
|
|
31
|
+
|
|
32
|
+
svg {
|
|
33
|
+
width: 24px;
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
36
|
|
|
41
|
-
&
|
|
42
|
-
|
|
43
|
-
border-color: $success;
|
|
44
|
-
|
|
45
|
-
#{$root}__icon.IconView {
|
|
46
|
-
fill: $success;
|
|
47
|
-
}
|
|
37
|
+
&__icon-close.IconView {
|
|
38
|
+
width: 10px;
|
|
48
39
|
}
|
|
49
|
-
&_info {
|
|
50
|
-
background: $back-info;
|
|
51
|
-
border-color: $info;
|
|
52
40
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
&__text-block {
|
|
42
|
+
display: grid;
|
|
43
|
+
row-gap: 12px;
|
|
44
|
+
max-width: 444px;
|
|
45
|
+
margin-right: auto;
|
|
56
46
|
}
|
|
57
|
-
&_warning {
|
|
58
|
-
background: $back-warning;
|
|
59
|
-
border-color: $warning;
|
|
60
47
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
48
|
+
&_success {
|
|
49
|
+
background: $success-light;
|
|
64
50
|
}
|
|
65
|
-
&_error {
|
|
66
|
-
background: $back-error;
|
|
67
|
-
border-color: $danger;
|
|
68
51
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
52
|
+
&_info {
|
|
53
|
+
background: $info-light;
|
|
72
54
|
}
|
|
73
55
|
|
|
74
|
-
&
|
|
75
|
-
|
|
76
|
-
height: $alert-icon-size;
|
|
77
|
-
margin-right: 12px;
|
|
56
|
+
&_warning {
|
|
57
|
+
background: $warning-light;
|
|
78
58
|
}
|
|
79
59
|
|
|
80
|
-
&
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
60
|
+
&_error {
|
|
61
|
+
background: $danger-light;
|
|
62
|
+
}
|
|
63
|
+
&_default {
|
|
64
|
+
background: $light-gray;
|
|
84
65
|
}
|
|
85
66
|
|
|
86
67
|
&__message {
|
|
87
|
-
|
|
88
|
-
font-size: $alert-message-font-size;
|
|
68
|
+
font-size: $font-size-lg;
|
|
89
69
|
}
|
|
90
70
|
|
|
91
|
-
&
|
|
71
|
+
&__wrapper {
|
|
92
72
|
display: flex;
|
|
93
73
|
justify-content: space-between;
|
|
94
74
|
}
|
|
95
75
|
|
|
96
76
|
&__content {
|
|
97
|
-
|
|
98
|
-
|
|
77
|
+
width: 100%;
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: row;
|
|
99
80
|
}
|
|
100
81
|
|
|
101
82
|
&__description {
|
|
102
|
-
font-size: $
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&__icon-close.IconView {
|
|
106
|
-
position: absolute;
|
|
107
|
-
right: 20px;
|
|
108
|
-
|
|
109
|
-
svg {
|
|
110
|
-
width: $alert-close-icon-size;
|
|
111
|
-
height: $alert-close-icon-size;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
fill: rgba($heading, .6);
|
|
115
|
-
transition: fill .1s ease-in;
|
|
116
|
-
&:hover {
|
|
117
|
-
fill: $heading;
|
|
118
|
-
}
|
|
83
|
+
font-size: $font-size-base;
|
|
119
84
|
}
|
|
120
85
|
}
|
|
@@ -31,11 +31,13 @@ function Avatar(props) {
|
|
|
31
31
|
size: props.size,
|
|
32
32
|
shape: props.shape,
|
|
33
33
|
'has-image': !!props.src && !props.isError,
|
|
34
|
-
'has-status': props.status
|
|
34
|
+
'has-status': props.status,
|
|
35
|
+
'has-border': props.hasBorder,
|
|
36
|
+
'has-custom-status': props.status && !!customSize.width
|
|
35
37
|
}), props.className) },
|
|
36
38
|
react_1["default"].createElement("span", { className: bem.element('body'), style: __assign(__assign({}, props.style), customSize) },
|
|
37
39
|
react_1["default"].createElement(react_1["default"].Fragment, null,
|
|
38
|
-
(props.src && renderImage()) || (react_1["default"].createElement("span",
|
|
40
|
+
(props.src && renderImage()) || (react_1["default"].createElement("span", { className: bem.element('formattedTitle') }, props.formattedTitle)),
|
|
39
41
|
props.children))));
|
|
40
42
|
}
|
|
41
43
|
exports["default"] = Avatar;
|