@unbxd-ui/unbxd-react-components 0.3.1 → 0.3.2-beta.10
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/assets/desktop.svg +6 -0
- package/assets/map-pin.svg +6 -0
- package/assets/p1.svg +20 -0
- package/assets/p2.svg +22 -0
- package/assets/p3.svg +19 -0
- package/assets/p4.svg +22 -0
- package/assets/p5.svg +23 -0
- package/components/Accordian/accordianCore.scss +8 -0
- package/components/Accordian/accordianTheme.scss +6 -0
- package/components/Button/button.css +1 -0
- package/components/Button/buttonTheme.scss +94 -0
- package/components/Form/Dropdown.js +77 -10
- package/components/Form/Input.js +11 -3
- package/components/Form/SearchableDropdown.js +22 -15
- package/components/Form/SelectedPills.js +128 -0
- package/components/Form/SummarySelection.js +46 -0
- package/components/Form/Textarea.js +13 -3
- package/components/Form/form.css +1 -0
- package/components/Form/formCore.css +1 -1
- package/components/Form/formCore.scss +713 -0
- package/components/Form/formTheme.scss +33 -0
- package/components/Form/stories/Dropdown.stories.js +242 -2
- package/components/Form/stories/SearchableDropdown.stories.js +173 -3
- package/components/Form/stories/ServerPaginatedDropdown.stories.js +166 -94
- package/components/Form/summarySelection.css +1 -0
- package/components/Form/summarySelection.scss +106 -0
- package/components/Form/variables.scss +116 -0
- package/components/InlineModal/inlineModal.css +1 -0
- package/components/InlineModal/inlineModalCore.scss +40 -0
- package/components/InlineModal/inlineModalTheme.scss +16 -0
- package/components/Link/linkCore.css +1 -1
- package/components/Link/linkCore.scss +66 -0
- package/components/Link/linkTheme.scss +79 -0
- package/components/List/list.css +1 -0
- package/components/List/listCore.scss +6 -0
- package/components/List/listTheme.scss +0 -0
- package/components/MetricCard/MetricCard.css +1 -0
- package/components/MetricCard/MetricCard.js +65 -0
- package/components/MetricCard/MetricCard.scss +118 -0
- package/components/MetricCard/MetriicCard.stories.js +131 -0
- package/components/MetricCard/index.js +9 -0
- package/components/Modal/modal.css +1 -0
- package/components/Modal/modalCore.scss +58 -0
- package/components/Modal/modalTheme.scss +0 -0
- package/components/NoDataPlaceholder/noDataPlaceholderCore.scss +33 -0
- package/components/NotificationComponent/notificationComponent.css +1 -0
- package/components/NotificationComponent/notificationTheme.scss +38 -0
- package/components/PIDItemComponent/PIDItemComponent.js +82 -0
- package/components/PIDItemComponent/PIDItemComponent.stories.js +175 -0
- package/components/PIDItemComponent/PIDItemComponentCore.css +1 -0
- package/components/PIDItemComponent/PIDItemComponentCore.scss +36 -0
- package/components/PIDItemComponent/index.js +9 -0
- package/components/PageLoader/pageLoaderCore.scss +34 -0
- package/components/ProgressBar/ProgressBar.scss +0 -0
- package/components/ProgressBar/progressBar.css +0 -0
- package/components/ProgressBar/progressBarCore.scss +22 -0
- package/components/ProgressBar/progressBarTheme.scss +0 -0
- package/components/Table/tableCore.scss +547 -0
- package/components/Table/tableTheme.scss +34 -0
- package/components/TabsComponent/tabs.css +1 -0
- package/components/TabsComponent/tabsCore.scss +59 -0
- package/components/TabsComponent/tabsTheme.scss +0 -0
- package/components/ToastNotification/toastNotificationCore.scss +273 -0
- package/components/Tooltip/tooltipCore.scss +207 -0
- package/components/Tooltip/tooltipTheme.scss +20 -0
- package/components/UIDItemComponent/UIDItemComponent.js +148 -0
- package/components/UIDItemComponent/UIDItemComponent.stories.js +51 -0
- package/components/UIDItemComponent/UIDItemComponentCore.css +1 -0
- package/components/UIDItemComponent/UIDItemComponentCore.scss +57 -0
- package/components/UIDItemComponent/index.js +9 -0
- package/components/common/common.scss +14 -0
- package/components/core.css +3 -2
- package/components/core.scss +13 -10
- package/components/index.js +32 -11
- package/components/theme.css +3 -2
- package/components/theme.scss +2 -1
- package/core/icon.js +17 -0
- package/core/index.js +14 -0
- package/core/lazyLoadImage.js +56 -0
- package/core/selection.json +1 -0
- package/core/utils.js +6 -1
- package/index.js +60 -0
- package/package.json +9 -4
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Theme styles for Link component - visual appearance and branding
|
|
3
|
+
**/
|
|
4
|
+
|
|
5
|
+
.RCB-link {
|
|
6
|
+
// Primary appearance (default link styling)
|
|
7
|
+
&-primary {
|
|
8
|
+
color: #3e71f2;
|
|
9
|
+
|
|
10
|
+
&:hover {
|
|
11
|
+
color: #3865d9;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&:active {
|
|
15
|
+
color: #3e71f2;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&:visited {
|
|
19
|
+
color: #6f42c1;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Secondary appearance
|
|
24
|
+
&-secondary {
|
|
25
|
+
color: #6c757d;
|
|
26
|
+
text-decoration: none;
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
color: #495057;
|
|
30
|
+
text-decoration: underline;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:active {
|
|
34
|
+
color: #343a40;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Danger appearance
|
|
39
|
+
&-danger {
|
|
40
|
+
color: #dc3545;
|
|
41
|
+
text-decoration: none;
|
|
42
|
+
|
|
43
|
+
&:hover {
|
|
44
|
+
color: #c82333;
|
|
45
|
+
text-decoration: underline;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:active {
|
|
49
|
+
color: #bd2130;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Success appearance
|
|
54
|
+
&-success {
|
|
55
|
+
color: #28a745;
|
|
56
|
+
text-decoration: none;
|
|
57
|
+
|
|
58
|
+
&:hover {
|
|
59
|
+
color: #218838;
|
|
60
|
+
text-decoration: underline;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:active {
|
|
64
|
+
color: #1e7e34;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// External link styling
|
|
69
|
+
&-external {
|
|
70
|
+
.RCB-link-external-icon {
|
|
71
|
+
color: currentColor;
|
|
72
|
+
opacity: 0.7;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:hover .RCB-link-external-icon {
|
|
76
|
+
opacity: 1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.RCB-list{margin:0;padding:0}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.RCB-metric-card-wrapper{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:16px;margin-bottom:32px}@media (min-width: 768px){.RCB-metric-card-wrapper{grid-template-columns:repeat(3, minmax(0, 1fr));gap:16px}}@media (min-width: 1024px){.RCB-metric-card-wrapper{grid-template-columns:repeat(6, minmax(0, 1fr));gap:20px}}.RCB-metric-card-wrapper .RCB-metric-card-item{border-radius:12px;padding:16px;position:relative;overflow:hidden;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;background:#fff;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid #e1e7ef;animation:slide-up 0.5s ease-out}.RCB-metric-card-wrapper .RCB-metric-card-item:hover{box-shadow:0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -2px rgba(0,0,0,0.05)}.RCB-metric-card-wrapper .RCB-metric-card-item .RCB-metric-data{position:relative;z-index:10}.RCB-metric-card-wrapper .RCB-metric-card-item .RCB-metric-data .RCB-metric-title{display:flex;align-items:center;gap:0.75rem;margin-bottom:0.75rem}.RCB-metric-card-wrapper .RCB-metric-card-item .RCB-metric-data .RCB-metric-title .RCB-metric-title-icon{background-color:#06b6d4;padding:0.5rem;border-radius:0.75rem;border:1px solid #e1e7ef;height:34px}.RCB-metric-card-wrapper .RCB-metric-card-item .RCB-metric-data .RCB-metric-title .RCB-metric-title-text{font-size:0.875rem;line-height:1.25rem;color:#65758b}.RCB-metric-card-wrapper .RCB-metric-card-item .RCB-metric-data .RCB-metric-value{display:flex;align-items:center;gap:0.5rem}.RCB-metric-card-wrapper .RCB-metric-card-item .RCB-metric-data .RCB-metric-value .RCB-metric-value-text{font-size:1.125rem;line-height:1.75rem;font-weight:700;color:#0f1729;letter-spacing:-0.025em}.RCB-metric-card-wrapper .RCB-metric-card-item .RCB-metric-data .RCB-metric-value .RCB-metric-compare-text{display:flex;align-items:center;gap:0.25rem;padding:0.125rem 0.5rem;border-radius:9999px;font-size:0.75rem;line-height:1rem;font-weight:500}.RCB-metric-card-wrapper .RCB-metric-card-item .RCB-metric-data .RCB-metric-value .RCB-metric-compare-text.positive{background-color:#dcfce7;color:#15803d}.RCB-metric-card-wrapper .RCB-metric-card-item .RCB-metric-data .RCB-metric-value .RCB-metric-compare-text.negative{background-color:#fee2e2;color:#b91c1c}.RCB-metric-card-wrapper .RCB-metric-card-item .RCB-bottom-right-circle{position:absolute;right:-1rem;bottom:-1rem;width:5rem;height:5rem;border-radius:50%;opacity:0.1;background-color:var(--decorative-color, #06b6d4)}@keyframes slide-up{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = MetricCard;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _icon = _interopRequireDefault(require("../../core/icon"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function MetricCard(props) {
|
|
11
|
+
var _props$metricConfigs = props.metricConfigs,
|
|
12
|
+
metricConfigs = _props$metricConfigs === void 0 ? [] : _props$metricConfigs;
|
|
13
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
14
|
+
className: "RCB-metric-card-wrapper"
|
|
15
|
+
}, metricConfigs.map(function () {
|
|
16
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
17
|
+
_ref$id = _ref.id,
|
|
18
|
+
id = _ref$id === void 0 ? '' : _ref$id,
|
|
19
|
+
_ref$name = _ref.name,
|
|
20
|
+
name = _ref$name === void 0 ? '' : _ref$name,
|
|
21
|
+
_ref$value = _ref.value,
|
|
22
|
+
value = _ref$value === void 0 ? '' : _ref$value,
|
|
23
|
+
_ref$icon = _ref.icon,
|
|
24
|
+
icon = _ref$icon === void 0 ? '' : _ref$icon,
|
|
25
|
+
_ref$iconBgColor = _ref.iconBgColor,
|
|
26
|
+
iconBgColor = _ref$iconBgColor === void 0 ? '#ccc' : _ref$iconBgColor,
|
|
27
|
+
_ref$hasDiff = _ref.hasDiff,
|
|
28
|
+
hasDiff = _ref$hasDiff === void 0 ? false : _ref$hasDiff,
|
|
29
|
+
_ref$comparePercentag = _ref.comparePercentage,
|
|
30
|
+
comparePercentage = _ref$comparePercentag === void 0 ? 0 : _ref$comparePercentag;
|
|
31
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
32
|
+
className: "RCB-metric-card-item",
|
|
33
|
+
key: id
|
|
34
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
35
|
+
className: "RCB-metric-data"
|
|
36
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
37
|
+
className: "RCB-metric-title"
|
|
38
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
39
|
+
className: "RCB-metric-title-icon",
|
|
40
|
+
style: {
|
|
41
|
+
backgroundColor: iconBgColor
|
|
42
|
+
}
|
|
43
|
+
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
44
|
+
icon: icon,
|
|
45
|
+
size: "16px",
|
|
46
|
+
color: "white"
|
|
47
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
48
|
+
className: "RCB-metric-title-text"
|
|
49
|
+
}, " ", name, " ")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
50
|
+
className: "RCB-metric-value"
|
|
51
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
52
|
+
className: "RCB-metric-value-text"
|
|
53
|
+
}, value), hasDiff ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
54
|
+
className: "RCB-metric-compare-text ".concat(comparePercentage < 0 ? 'negative' : 'positive')
|
|
55
|
+
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
56
|
+
icon: comparePercentage < 0 ? 'arrow-down' : 'arrow-up',
|
|
57
|
+
size: "12px"
|
|
58
|
+
}), Math.abs(comparePercentage) + '%') : null)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
59
|
+
className: "RCB-bottom-right-circle",
|
|
60
|
+
style: {
|
|
61
|
+
backgroundColor: iconBgColor
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
.RCB-metric-card-wrapper {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
4
|
+
gap: 16px;
|
|
5
|
+
margin-bottom: 32px;
|
|
6
|
+
|
|
7
|
+
@media (min-width: 768px) {
|
|
8
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
9
|
+
gap: 16px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (min-width: 1024px) {
|
|
13
|
+
grid-template-columns: repeat(6, minmax(0, 1fr));
|
|
14
|
+
gap: 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.RCB-metric-card-item {
|
|
18
|
+
border-radius: 12px;
|
|
19
|
+
padding: 16px;
|
|
20
|
+
position: relative;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
transition-property: all;
|
|
23
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
24
|
+
transition-duration: 150ms;
|
|
25
|
+
background: hsl(0, 0%, 100%);
|
|
26
|
+
backdrop-filter: blur(10px);
|
|
27
|
+
-webkit-backdrop-filter: blur(10px);
|
|
28
|
+
border: 1px solid hsl(214, 32%, 91%);
|
|
29
|
+
animation: slide-up 0.5s ease-out;
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
32
|
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
|
|
33
|
+
0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.RCB-metric-data {
|
|
37
|
+
position: relative;
|
|
38
|
+
z-index: 10;
|
|
39
|
+
|
|
40
|
+
.RCB-metric-title {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 0.75rem;
|
|
44
|
+
margin-bottom: 0.75rem;
|
|
45
|
+
|
|
46
|
+
.RCB-metric-title-icon {
|
|
47
|
+
background-color: rgb(6, 182, 212);
|
|
48
|
+
padding: 0.5rem;
|
|
49
|
+
border-radius: 0.75rem;
|
|
50
|
+
border: 1px solid #e1e7ef;
|
|
51
|
+
height: 34px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.RCB-metric-title-text {
|
|
55
|
+
font-size: 0.875rem;
|
|
56
|
+
line-height: 1.25rem;
|
|
57
|
+
color: hsl(215, 16%, 47%);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.RCB-metric-value {
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 0.5rem;
|
|
65
|
+
.RCB-metric-value-text {
|
|
66
|
+
font-size: 1.125rem;
|
|
67
|
+
line-height: 1.75rem;
|
|
68
|
+
font-weight: 700;
|
|
69
|
+
color: #0f1729;
|
|
70
|
+
letter-spacing: -0.025em;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.RCB-metric-compare-text {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
gap: 0.25rem;
|
|
77
|
+
padding: 0.125rem 0.5rem;
|
|
78
|
+
border-radius: 9999px;
|
|
79
|
+
font-size: 0.75rem;
|
|
80
|
+
line-height: 1rem;
|
|
81
|
+
font-weight: 500;
|
|
82
|
+
|
|
83
|
+
&.positive {
|
|
84
|
+
background-color: #dcfce7;
|
|
85
|
+
color: #15803d;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&.negative {
|
|
89
|
+
background-color: #fee2e2;
|
|
90
|
+
color: #b91c1c;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.RCB-bottom-right-circle {
|
|
97
|
+
position: absolute;
|
|
98
|
+
right: -1rem;
|
|
99
|
+
bottom: -1rem;
|
|
100
|
+
width: 5rem;
|
|
101
|
+
height: 5rem;
|
|
102
|
+
border-radius: 50%;
|
|
103
|
+
opacity: 0.1;
|
|
104
|
+
background-color: var(--decorative-color, rgb(6, 182, 212));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@keyframes slide-up {
|
|
109
|
+
from {
|
|
110
|
+
opacity: 0;
|
|
111
|
+
transform: translateY(20px);
|
|
112
|
+
}
|
|
113
|
+
to {
|
|
114
|
+
opacity: 1;
|
|
115
|
+
transform: translateY(0);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.WithDifferencePercentage = exports.Default = void 0;
|
|
7
|
+
var _MetricCard = _interopRequireDefault(require("./MetricCard"));
|
|
8
|
+
require("./MetricCard.css");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
var meta = {
|
|
11
|
+
title: 'Components/MetricCard',
|
|
12
|
+
component: _MetricCard["default"],
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: 'padded',
|
|
15
|
+
docs: {
|
|
16
|
+
description: {
|
|
17
|
+
component: 'MetricCard displays key metrics in a grid layout.'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
tags: ['autodocs'],
|
|
22
|
+
argTypes: {
|
|
23
|
+
metricConfigs: {
|
|
24
|
+
description: 'Array of metric configuration objects with id, name, value, icon and iconBgColor properties',
|
|
25
|
+
control: 'object'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var _default = exports["default"] = meta; // Sample metric data
|
|
30
|
+
var sampleMetrics = [{
|
|
31
|
+
id: 1,
|
|
32
|
+
name: 'Impressions',
|
|
33
|
+
value: '20,588,028',
|
|
34
|
+
icon: 'preview',
|
|
35
|
+
iconBgColor: 'rgb(6, 182, 212)'
|
|
36
|
+
}, {
|
|
37
|
+
id: 2,
|
|
38
|
+
name: 'Clicks',
|
|
39
|
+
value: '2,060,018',
|
|
40
|
+
icon: 'click-rate',
|
|
41
|
+
iconBgColor: 'rgb(59, 130, 246)'
|
|
42
|
+
}, {
|
|
43
|
+
id: 3,
|
|
44
|
+
name: 'Add to Carts',
|
|
45
|
+
value: '609,718',
|
|
46
|
+
icon: 'cart-rate',
|
|
47
|
+
iconBgColor: 'rgb(245, 158, 11)'
|
|
48
|
+
}, {
|
|
49
|
+
id: 4,
|
|
50
|
+
name: 'Orders',
|
|
51
|
+
value: '258,799',
|
|
52
|
+
icon: 'package',
|
|
53
|
+
iconBgColor: 'rgb(34, 197, 94)'
|
|
54
|
+
}, {
|
|
55
|
+
id: 5,
|
|
56
|
+
name: 'Conversion Rate',
|
|
57
|
+
value: '1.26%',
|
|
58
|
+
icon: 'trending-up',
|
|
59
|
+
iconBgColor: 'rgb(207, 4, 173)'
|
|
60
|
+
}, {
|
|
61
|
+
id: 6,
|
|
62
|
+
name: 'Revenue',
|
|
63
|
+
value: '$15,644,741',
|
|
64
|
+
icon: 'revenue',
|
|
65
|
+
iconBgColor: 'rgb(16, 185, 129)'
|
|
66
|
+
}];
|
|
67
|
+
|
|
68
|
+
// Sample metric data with difference percentages
|
|
69
|
+
var metricsWithDiff = [{
|
|
70
|
+
id: 1,
|
|
71
|
+
name: 'Impressions',
|
|
72
|
+
value: '20,588,028',
|
|
73
|
+
icon: 'preview',
|
|
74
|
+
iconBgColor: 'rgb(6, 182, 212)',
|
|
75
|
+
hasDiff: true,
|
|
76
|
+
comparePercentage: 15.4
|
|
77
|
+
}, {
|
|
78
|
+
id: 2,
|
|
79
|
+
name: 'Clicks',
|
|
80
|
+
value: '2,060,018',
|
|
81
|
+
icon: 'click-rate',
|
|
82
|
+
iconBgColor: 'rgb(59, 130, 246)',
|
|
83
|
+
hasDiff: true,
|
|
84
|
+
comparePercentage: -8.2
|
|
85
|
+
}, {
|
|
86
|
+
id: 3,
|
|
87
|
+
name: 'Add to Carts',
|
|
88
|
+
value: '609,718',
|
|
89
|
+
icon: 'cart-rate',
|
|
90
|
+
iconBgColor: 'rgb(245, 158, 11)',
|
|
91
|
+
hasDiff: true,
|
|
92
|
+
comparePercentage: 22.7
|
|
93
|
+
}, {
|
|
94
|
+
id: 4,
|
|
95
|
+
name: 'Orders',
|
|
96
|
+
value: '258,799',
|
|
97
|
+
icon: 'package',
|
|
98
|
+
iconBgColor: 'rgb(34, 197, 94)',
|
|
99
|
+
hasDiff: true,
|
|
100
|
+
comparePercentage: -5.3
|
|
101
|
+
}, {
|
|
102
|
+
id: 5,
|
|
103
|
+
name: 'Conversion Rate',
|
|
104
|
+
value: '1.26%',
|
|
105
|
+
icon: 'trending-up',
|
|
106
|
+
iconBgColor: 'rgb(207, 4, 173)',
|
|
107
|
+
hasDiff: true,
|
|
108
|
+
comparePercentage: 3.8
|
|
109
|
+
}, {
|
|
110
|
+
id: 6,
|
|
111
|
+
name: 'Revenue',
|
|
112
|
+
value: '$15,644,741',
|
|
113
|
+
icon: 'revenue',
|
|
114
|
+
iconBgColor: 'rgb(16, 185, 129)',
|
|
115
|
+
hasDiff: true,
|
|
116
|
+
comparePercentage: -12.1
|
|
117
|
+
}];
|
|
118
|
+
|
|
119
|
+
// Default Story
|
|
120
|
+
var Default = exports.Default = {
|
|
121
|
+
args: {
|
|
122
|
+
metricConfigs: sampleMetrics
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// Story with difference percentages
|
|
127
|
+
var WithDifferencePercentage = exports.WithDifferencePercentage = {
|
|
128
|
+
args: {
|
|
129
|
+
metricConfigs: metricsWithDiff
|
|
130
|
+
}
|
|
131
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _MetricCard = _interopRequireDefault(require("./MetricCard"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
var _default = exports["default"] = _MetricCard["default"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.RCB-modal{position:absolute;top:0;width:100%;height:100%;background:rgba(0,0,0,0.8);display:flex;justify-content:center;align-items:center}.RCB-modal-body{background:#FFF;padding:20px}.RCB-modal-header{display:flex;margin-bottom:10px}.RCB-modal-title{flex:1}.RCB-modal-close{cursor:pointer}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.RCB {
|
|
2
|
+
&-modal {
|
|
3
|
+
position: fixed;
|
|
4
|
+
top: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
background: rgba(0, 0, 0, 0.6);
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
z-index: 2;
|
|
12
|
+
|
|
13
|
+
.modal-footer {
|
|
14
|
+
padding: 24px 24px;
|
|
15
|
+
margin: 20px -24px 0px;
|
|
16
|
+
border-radius: 0 0 8px 8px;
|
|
17
|
+
text-align: right;
|
|
18
|
+
|
|
19
|
+
.RCB-btn {
|
|
20
|
+
margin-right: 14px;
|
|
21
|
+
|
|
22
|
+
&:last-child {
|
|
23
|
+
margin-right: 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-modal-body {
|
|
30
|
+
background: #FFF;
|
|
31
|
+
border-radius: 8px;
|
|
32
|
+
padding: 0px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&-modal-header {
|
|
36
|
+
display: flex;
|
|
37
|
+
margin-bottom: 0px;
|
|
38
|
+
padding: 24px 24px 10px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-modal-title {
|
|
42
|
+
flex: 1;
|
|
43
|
+
font-size: 18px;
|
|
44
|
+
font-weight: 700;
|
|
45
|
+
line-height: normal;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&-modal-close {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
&:before {
|
|
51
|
+
content: "X";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&-modal-content {
|
|
56
|
+
padding: 24px 24px 0px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.RCB-no-data-placeholder {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
padding: 40px 20px;
|
|
7
|
+
text-align: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.RCB-no-data-image {
|
|
11
|
+
margin-bottom: 16px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.RCB-no-data-image img {
|
|
15
|
+
max-width: 120px;
|
|
16
|
+
max-height: 120px;
|
|
17
|
+
object-fit: contain;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.RCB-no-data-title {
|
|
21
|
+
font-size: 18px;
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
color: #333;
|
|
24
|
+
margin-bottom: 8px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.RCB-no-data-description {
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
color: #666;
|
|
30
|
+
line-height: 1.5;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.RCB-notif{padding:10px}.RCB-notif-success{color:#129274;border:1px solid #2cb292;background-color:#b7d2cb}.RCB-notif-error{color:#d25b5b;border:solid 1px #e75190;background-color:#fff9fc}.RCB-notif-warning{color:#445870;border:solid 1px #f09c0a;background-color:#fffaf2}.RCB-notif-info{color:#509DB9;border:solid 1px #509DB9;background-color:#DFF6FF}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.RCB {
|
|
2
|
+
&-notif {
|
|
3
|
+
padding: 10px;
|
|
4
|
+
border-radius: 3px;
|
|
5
|
+
|
|
6
|
+
&-success {
|
|
7
|
+
color: #6DB886;
|
|
8
|
+
border: solid 1px #6DB886;
|
|
9
|
+
background-color: #DEF9E7;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&-error {
|
|
13
|
+
color: #CA4646;
|
|
14
|
+
border: solid 1px #CA4646;
|
|
15
|
+
background-color: #FFE4E4;
|
|
16
|
+
;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&-warning {
|
|
20
|
+
color: #D5A555;
|
|
21
|
+
border: solid 1px #D5A555;
|
|
22
|
+
background-color: #FFF8EC;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&-info {
|
|
26
|
+
color: #3E71F2;
|
|
27
|
+
border: solid 1px #3E71F2;
|
|
28
|
+
background-color: #E7EDFF;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.notif-wrapper{
|
|
34
|
+
flex: 1;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = PIDItemComponent;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _lazyLoadImage = _interopRequireDefault(require("../../core/lazyLoadImage"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function PIDItemComponent(props) {
|
|
11
|
+
var DEFAULT_IMAGE = "https://libraries.unbxdapi.com/sdk-assets/defaultImage.svg";
|
|
12
|
+
|
|
13
|
+
// Desrructure props that are needed for client as well as server pagination types.
|
|
14
|
+
var _props$itemData = props.itemData,
|
|
15
|
+
itemData = _props$itemData === void 0 ? {} : _props$itemData,
|
|
16
|
+
_props$paginationType = props.paginationType,
|
|
17
|
+
clientPaginationType = _props$paginationType === void 0 ? "" : _props$paginationType,
|
|
18
|
+
_props$selectItem = props.selectItem,
|
|
19
|
+
clientSelectItem = _props$selectItem === void 0 ? function () {} : _props$selectItem,
|
|
20
|
+
_props$keysMap = props.keysMap,
|
|
21
|
+
clientKeysMap = _props$keysMap === void 0 ? {} : _props$keysMap,
|
|
22
|
+
_props$selectedItems = props.selectedItems,
|
|
23
|
+
clientSelectedItems = _props$selectedItems === void 0 ? [] : _props$selectedItems,
|
|
24
|
+
_props$data = props.data,
|
|
25
|
+
data = _props$data === void 0 ? {} : _props$data,
|
|
26
|
+
_props$index = props.index,
|
|
27
|
+
index = _props$index === void 0 ? 0 : _props$index,
|
|
28
|
+
_props$style = props.style,
|
|
29
|
+
style = _props$style === void 0 ? {} : _props$style;
|
|
30
|
+
var _data$items = data.items,
|
|
31
|
+
items = _data$items === void 0 ? [] : _data$items,
|
|
32
|
+
_data$paginationType = data.paginationType,
|
|
33
|
+
serverPaginationType = _data$paginationType === void 0 ? "" : _data$paginationType,
|
|
34
|
+
_data$selectItem = data.selectItem,
|
|
35
|
+
serverSelectItem = _data$selectItem === void 0 ? function () {} : _data$selectItem,
|
|
36
|
+
_data$keysMap = data.keysMap,
|
|
37
|
+
serverKeysMap = _data$keysMap === void 0 ? {} : _data$keysMap,
|
|
38
|
+
_data$selectedItems = data.selectedItems,
|
|
39
|
+
serverSelectedItems = _data$selectedItems === void 0 ? [] : _data$selectedItems;
|
|
40
|
+
|
|
41
|
+
// Determine the pagination type
|
|
42
|
+
var paginationType = clientPaginationType ? "CLIENT" : serverPaginationType;
|
|
43
|
+
|
|
44
|
+
// Update the item data and select item function based on the pagination type
|
|
45
|
+
var updatedItemData = paginationType !== 'SERVER' ? itemData : items[index] || {};
|
|
46
|
+
var updatedSelectItem = paginationType !== 'SERVER' ? clientSelectItem : serverSelectItem;
|
|
47
|
+
var updatedKeysMap = paginationType !== 'SERVER' ? clientKeysMap : serverKeysMap || {};
|
|
48
|
+
var updatedSelectedItems = paginationType !== 'SERVER' ? clientSelectedItems : serverSelectedItems || [];
|
|
49
|
+
|
|
50
|
+
// Destructue the items value with its respective keys map provided in the props
|
|
51
|
+
var _updatedKeysMap$uniqu = updatedKeysMap.uniqueIdMap,
|
|
52
|
+
uniqueIdMap = _updatedKeysMap$uniqu === void 0 ? "uniqueId" : _updatedKeysMap$uniqu,
|
|
53
|
+
_updatedKeysMap$image = updatedKeysMap.imageUrlMap,
|
|
54
|
+
imageUrlMap = _updatedKeysMap$image === void 0 ? "imageUrl" : _updatedKeysMap$image,
|
|
55
|
+
_updatedKeysMap$title = updatedKeysMap.titleMap,
|
|
56
|
+
titleMap = _updatedKeysMap$title === void 0 ? "title" : _updatedKeysMap$title;
|
|
57
|
+
var title = updatedItemData[titleMap];
|
|
58
|
+
var imageUrl = Array.isArray(updatedItemData[imageUrlMap]) ? updatedItemData[imageUrlMap][0] : updatedItemData[imageUrlMap] ? updatedItemData[imageUrlMap] : DEFAULT_IMAGE;
|
|
59
|
+
var uniqueId = updatedItemData[uniqueIdMap];
|
|
60
|
+
|
|
61
|
+
// Check if the item is selected
|
|
62
|
+
var isItemSelected = updatedSelectedItems.find(function (item) {
|
|
63
|
+
return item[uniqueIdMap] === uniqueId;
|
|
64
|
+
});
|
|
65
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
66
|
+
className: "RCB-list-item RCB-pid-dd-item ".concat(isItemSelected ? "selected" : ""),
|
|
67
|
+
style: style,
|
|
68
|
+
onClick: function onClick() {
|
|
69
|
+
return updatedSelectItem(updatedItemData);
|
|
70
|
+
}
|
|
71
|
+
}, /*#__PURE__*/_react["default"].createElement(_lazyLoadImage["default"], {
|
|
72
|
+
id: uniqueId,
|
|
73
|
+
key: uniqueId,
|
|
74
|
+
className: "RCB-pid-product-image",
|
|
75
|
+
src: imageUrl
|
|
76
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, title && /*#__PURE__*/_react["default"].createElement("span", {
|
|
77
|
+
className: "RCB-title",
|
|
78
|
+
title: title
|
|
79
|
+
}, title), /*#__PURE__*/_react["default"].createElement("span", {
|
|
80
|
+
className: "RCB-pid-id show small-text text-transform-none clip-content"
|
|
81
|
+
}, " ID: ", uniqueId, " ")));
|
|
82
|
+
}
|