@unbxd-ui/unbxd-react-components 0.3.0 → 0.3.2-beta.1
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/Button/Button.js +4 -2
- package/components/Button/Button.stories.js +16 -3
- package/components/Button/buttonTheme.css +1 -1
- package/components/Form/Dropdown.js +77 -10
- package/components/Form/SearchableDropdown.js +22 -15
- package/components/Form/SelectedPills.js +126 -0
- package/components/Form/SummarySelection.js +46 -0
- package/components/Form/formCore.css +1 -1
- package/components/Form/stories/Dropdown.stories.js +160 -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/Link/Link.js +139 -0
- package/components/Link/Link.stories.js +489 -0
- package/components/Link/index.js +28 -0
- package/components/Link/linkCore.css +1 -0
- package/components/Link/linkTheme.css +1 -0
- package/components/PIDItemComponent/PIDItemComponent.js +72 -0
- package/components/PIDItemComponent/PIDItemComponent.stories.js +175 -0
- package/components/PIDItemComponent/PIDItemComponentCore.css +1 -0
- package/components/PIDItemComponent/index.js +9 -0
- package/components/UIDItemComponent/UIDItemComponent.js +138 -0
- package/components/UIDItemComponent/UIDItemComponent.stories.js +51 -0
- package/components/UIDItemComponent/UIDItemComponentCore.css +1 -0
- package/components/UIDItemComponent/index.js +9 -0
- package/components/core.css +2 -2
- package/components/core.scss +13 -10
- package/components/index.js +49 -10
- package/components/theme.css +2 -2
- package/components/theme.scss +3 -1
- package/core/index.js +7 -0
- package/core/lazyLoadImage.js +56 -0
- package/core/utils.js +6 -1
- package/index.js +48 -0
- package/package.json +5 -4
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.WithoutTitle = exports.WithDefaultImage = exports.WithArrayImage = exports.MultipleProducts = exports.LongTitle = exports.Default = exports.CustomKeyMapping = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _PIDItemComponent = _interopRequireDefault(require("./PIDItemComponent"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
+
var meta = {
|
|
17
|
+
title: 'Components/PIDItemComponent',
|
|
18
|
+
component: _PIDItemComponent["default"],
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: 'centered'
|
|
21
|
+
},
|
|
22
|
+
tags: ['autodocs'],
|
|
23
|
+
argTypes: {
|
|
24
|
+
props: {
|
|
25
|
+
description: 'Props object containing itemData and keysMap configuration'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var _default = exports["default"] = meta;
|
|
30
|
+
var Default = exports.Default = {
|
|
31
|
+
args: {
|
|
32
|
+
props: {
|
|
33
|
+
itemData: {
|
|
34
|
+
uniqueId: 'PROD-12345',
|
|
35
|
+
imageUrl: 'https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=300',
|
|
36
|
+
title: 'Premium Wireless Headphones with Noise Cancellation'
|
|
37
|
+
},
|
|
38
|
+
keysMap: {
|
|
39
|
+
uniqueIdMap: 'uniqueId',
|
|
40
|
+
imageUrlMap: 'imageUrl',
|
|
41
|
+
titleMap: 'title'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var WithArrayImage = exports.WithArrayImage = {
|
|
47
|
+
args: {
|
|
48
|
+
props: {
|
|
49
|
+
itemData: {
|
|
50
|
+
uniqueId: 'PROD-67890',
|
|
51
|
+
imageUrl: ['https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=300', 'https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=300'],
|
|
52
|
+
title: 'Smartwatch with Fitness Tracking'
|
|
53
|
+
},
|
|
54
|
+
keysMap: {
|
|
55
|
+
uniqueIdMap: 'uniqueId',
|
|
56
|
+
imageUrlMap: 'imageUrl',
|
|
57
|
+
titleMap: 'title'
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var WithDefaultImage = exports.WithDefaultImage = {
|
|
63
|
+
args: {
|
|
64
|
+
props: {
|
|
65
|
+
itemData: {
|
|
66
|
+
uniqueId: 'PROD-11111',
|
|
67
|
+
imageUrl: '',
|
|
68
|
+
title: 'Product Without Image'
|
|
69
|
+
},
|
|
70
|
+
keysMap: {
|
|
71
|
+
uniqueIdMap: 'uniqueId',
|
|
72
|
+
imageUrlMap: 'imageUrl',
|
|
73
|
+
titleMap: 'title'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
var WithoutTitle = exports.WithoutTitle = {
|
|
79
|
+
args: {
|
|
80
|
+
props: {
|
|
81
|
+
itemData: {
|
|
82
|
+
uniqueId: 'PROD-22222',
|
|
83
|
+
imageUrl: 'https://images.unsplash.com/photo-1526170375885-4d8ecf77b99f?w=300',
|
|
84
|
+
title: ''
|
|
85
|
+
},
|
|
86
|
+
keysMap: {
|
|
87
|
+
uniqueIdMap: 'uniqueId',
|
|
88
|
+
imageUrlMap: 'imageUrl',
|
|
89
|
+
titleMap: 'title'
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
var LongTitle = exports.LongTitle = {
|
|
95
|
+
args: {
|
|
96
|
+
props: {
|
|
97
|
+
itemData: {
|
|
98
|
+
uniqueId: 'PROD-99999',
|
|
99
|
+
imageUrl: 'https://images.unsplash.com/photo-1572635196237-14b3f281503f?w=300',
|
|
100
|
+
title: 'This is a very long product title that should be clipped or truncated to fit within the available space without breaking the layout'
|
|
101
|
+
},
|
|
102
|
+
keysMap: {
|
|
103
|
+
uniqueIdMap: 'uniqueId',
|
|
104
|
+
imageUrlMap: 'imageUrl',
|
|
105
|
+
titleMap: 'title'
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
var CustomKeyMapping = exports.CustomKeyMapping = {
|
|
111
|
+
args: {
|
|
112
|
+
props: {
|
|
113
|
+
itemData: {
|
|
114
|
+
product_id: 'CUSTOM-001',
|
|
115
|
+
product_image: 'https://images.unsplash.com/photo-1560343090-f0409e92791a?w=300',
|
|
116
|
+
product_name: 'Laptop with Custom Key Mapping'
|
|
117
|
+
},
|
|
118
|
+
keysMap: {
|
|
119
|
+
uniqueIdMap: 'product_id',
|
|
120
|
+
imageUrlMap: 'product_image',
|
|
121
|
+
titleMap: 'product_name'
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
var MultipleProducts = exports.MultipleProducts = {
|
|
127
|
+
render: function render() {
|
|
128
|
+
var products = [{
|
|
129
|
+
itemData: {
|
|
130
|
+
uniqueId: 'PROD-001',
|
|
131
|
+
imageUrl: 'https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=300',
|
|
132
|
+
title: 'Premium Wireless Headphones'
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
itemData: {
|
|
136
|
+
uniqueId: 'PROD-002',
|
|
137
|
+
imageUrl: 'https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=300',
|
|
138
|
+
title: 'Smart Watch'
|
|
139
|
+
}
|
|
140
|
+
}, {
|
|
141
|
+
itemData: {
|
|
142
|
+
uniqueId: 'PROD-003',
|
|
143
|
+
imageUrl: 'https://images.unsplash.com/photo-1572635196237-14b3f281503f?w=300',
|
|
144
|
+
title: 'Professional Camera'
|
|
145
|
+
}
|
|
146
|
+
}, {
|
|
147
|
+
itemData: {
|
|
148
|
+
uniqueId: 'PROD-004',
|
|
149
|
+
imageUrl: 'https://images.unsplash.com/photo-1560343090-f0409e92791a?w=300',
|
|
150
|
+
title: 'Gaming Laptop'
|
|
151
|
+
}
|
|
152
|
+
}];
|
|
153
|
+
var keysMap = {
|
|
154
|
+
uniqueIdMap: 'uniqueId',
|
|
155
|
+
imageUrlMap: 'imageUrl',
|
|
156
|
+
titleMap: 'title'
|
|
157
|
+
};
|
|
158
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
159
|
+
style: {
|
|
160
|
+
display: 'flex',
|
|
161
|
+
flexDirection: 'column',
|
|
162
|
+
width: '300px',
|
|
163
|
+
border: '1px solid #ddd',
|
|
164
|
+
borderRadius: '8px'
|
|
165
|
+
}
|
|
166
|
+
}, products.map(function (product, index) {
|
|
167
|
+
return /*#__PURE__*/_react["default"].createElement(_PIDItemComponent["default"], {
|
|
168
|
+
key: index,
|
|
169
|
+
props: _objectSpread(_objectSpread({}, product), {}, {
|
|
170
|
+
keysMap: keysMap
|
|
171
|
+
})
|
|
172
|
+
});
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.RCB-pid-dd-item{display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;padding-bottom:8px;padding-left:13px;padding-top:8px;width:100%}.RCB-pid-dd-item .RCB-pid-product-image{height:35px;margin-right:5px;-o-object-fit:contain;object-fit:contain;width:30px}.RCB-pid-dd-item .RCB-title{font-size:12px;font-weight:600;-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.RCB-pid-dd-item .RCB-pid-id{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:240px;text-transform:none;font-size:12px}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _PIDItemComponent = _interopRequireDefault(require("./PIDItemComponent"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
var _default = exports["default"] = _PIDItemComponent["default"];
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = UIDItemComponent;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
10
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
11
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
14
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
15
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16
|
+
// Assets are now served from public folder
|
|
17
|
+
var desktop = "/assets/desktop.svg";
|
|
18
|
+
var map = "/assets/map-pin.svg";
|
|
19
|
+
var p1 = "/assets/p1.svg";
|
|
20
|
+
var p2 = "/assets/p2.svg";
|
|
21
|
+
var p3 = "/assets/p3.svg";
|
|
22
|
+
var p4 = "/assets/p4.svg";
|
|
23
|
+
var p5 = "/assets/p5.svg";
|
|
24
|
+
function UIDItemComponent(props) {
|
|
25
|
+
// Desrructure props that are needed for client as well as server pagination types.
|
|
26
|
+
var _props$itemData = props.itemData,
|
|
27
|
+
itemData = _props$itemData === void 0 ? {} : _props$itemData,
|
|
28
|
+
_props$paginationType = props.paginationType,
|
|
29
|
+
clientPaginationType = _props$paginationType === void 0 ? "" : _props$paginationType,
|
|
30
|
+
_props$selectItem = props.selectItem,
|
|
31
|
+
clientSelectItem = _props$selectItem === void 0 ? function () {} : _props$selectItem,
|
|
32
|
+
_props$data = props.data,
|
|
33
|
+
data = _props$data === void 0 ? {} : _props$data,
|
|
34
|
+
_props$index = props.index,
|
|
35
|
+
index = _props$index === void 0 ? 0 : _props$index,
|
|
36
|
+
_props$style = props.style,
|
|
37
|
+
style = _props$style === void 0 ? {} : _props$style;
|
|
38
|
+
var _data$items = data.items,
|
|
39
|
+
items = _data$items === void 0 ? [] : _data$items,
|
|
40
|
+
_data$paginationType = data.paginationType,
|
|
41
|
+
serverPaginationType = _data$paginationType === void 0 ? "" : _data$paginationType,
|
|
42
|
+
_data$selectItem = data.selectItem,
|
|
43
|
+
serverSelectItem = _data$selectItem === void 0 ? function () {} : _data$selectItem;
|
|
44
|
+
|
|
45
|
+
// Determine the pagination type
|
|
46
|
+
var paginationType = clientPaginationType ? "CLIENT" : serverPaginationType;
|
|
47
|
+
|
|
48
|
+
// Update the item data and select item function based on the pagination type
|
|
49
|
+
var updatedItemData = paginationType !== 'SERVER' ? itemData : items[index] || {};
|
|
50
|
+
var updatedSelectItem = paginationType !== 'SERVER' ? clientSelectItem : serverSelectItem;
|
|
51
|
+
|
|
52
|
+
// Normalize the item data to fetch fields needed for the component to display.
|
|
53
|
+
var _updatedItemData$user = updatedItemData.user_id,
|
|
54
|
+
user_id = _updatedItemData$user === void 0 ? '' : _updatedItemData$user,
|
|
55
|
+
_updatedItemData$user2 = updatedItemData.user_behavior,
|
|
56
|
+
user_behavior = _updatedItemData$user2 === void 0 ? {} : _updatedItemData$user2,
|
|
57
|
+
_updatedItemData$enga = updatedItemData.engagement_metrics,
|
|
58
|
+
engagement_metrics = _updatedItemData$enga === void 0 ? {} : _updatedItemData$enga,
|
|
59
|
+
_updatedItemData$devi = updatedItemData.device_info,
|
|
60
|
+
device_info = _updatedItemData$devi === void 0 ? {} : _updatedItemData$devi,
|
|
61
|
+
_updatedItemData$loca = updatedItemData.location_info,
|
|
62
|
+
location_info = _updatedItemData$loca === void 0 ? {} : _updatedItemData$loca,
|
|
63
|
+
_updatedItemData$rank = updatedItemData.rank,
|
|
64
|
+
rank = _updatedItemData$rank === void 0 ? 0 : _updatedItemData$rank;
|
|
65
|
+
var _user_behavior$user_t = user_behavior.user_types,
|
|
66
|
+
user_types = _user_behavior$user_t === void 0 ? "" : _user_behavior$user_t,
|
|
67
|
+
_user_behavior$sessio = user_behavior.session_count,
|
|
68
|
+
session_count = _user_behavior$sessio === void 0 ? 0 : _user_behavior$sessio,
|
|
69
|
+
_user_behavior$total_ = user_behavior.total_events,
|
|
70
|
+
total_events = _user_behavior$total_ === void 0 ? 0 : _user_behavior$total_;
|
|
71
|
+
var _engagement_metrics$c = engagement_metrics.clicks,
|
|
72
|
+
clicks = _engagement_metrics$c === void 0 ? 0 : _engagement_metrics$c,
|
|
73
|
+
_engagement_metrics$o = engagement_metrics.orders,
|
|
74
|
+
orders = _engagement_metrics$o === void 0 ? 0 : _engagement_metrics$o,
|
|
75
|
+
_engagement_metrics$r = engagement_metrics.revenue,
|
|
76
|
+
revenue = _engagement_metrics$r === void 0 ? "0.0" : _engagement_metrics$r;
|
|
77
|
+
var _device_info$platform = device_info.platforms,
|
|
78
|
+
platforms = _device_info$platform === void 0 ? [] : _device_info$platform,
|
|
79
|
+
_device_info$devices = device_info.devices,
|
|
80
|
+
devices = _device_info$devices === void 0 ? [] : _device_info$devices;
|
|
81
|
+
var _location_info$region = location_info.regions,
|
|
82
|
+
regions = _location_info$region === void 0 ? [] : _location_info$region,
|
|
83
|
+
_location_info$countr = location_info.countries,
|
|
84
|
+
countries = _location_info$countr === void 0 ? [] : _location_info$countr,
|
|
85
|
+
_location_info$cities = location_info.cities,
|
|
86
|
+
cities = _location_info$cities === void 0 ? [] : _location_info$cities;
|
|
87
|
+
var locationMetadata = (0, _react.useMemo)(function () {
|
|
88
|
+
if (regions.length > 0) return regions[0];
|
|
89
|
+
if (countries.length > 0) return countries[0];
|
|
90
|
+
if (cities.length > 0) return cities[0];
|
|
91
|
+
return "";
|
|
92
|
+
}, [regions, countries, cities]);
|
|
93
|
+
var deviceMetadata = (0, _react.useMemo)(function () {
|
|
94
|
+
return [].concat(_toConsumableArray(platforms), _toConsumableArray(devices)).join(", ");
|
|
95
|
+
}, [platforms, devices]);
|
|
96
|
+
var getAvatarSrc = function getAvatarSrc(rank) {
|
|
97
|
+
var avatars = [p1, p2, p3, p4, p5];
|
|
98
|
+
var avatarIndex = rank % 5;
|
|
99
|
+
return avatars[avatarIndex];
|
|
100
|
+
};
|
|
101
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
102
|
+
className: "RCB-list-item",
|
|
103
|
+
style: style,
|
|
104
|
+
onClick: function onClick() {
|
|
105
|
+
return updatedSelectItem(updatedItemData);
|
|
106
|
+
}
|
|
107
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
108
|
+
className: "RCB-list-item-content RCB-user-id-dropdown-item"
|
|
109
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
110
|
+
className: "RCB-avatar-container"
|
|
111
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
112
|
+
className: "RCB-avatar-container-inner"
|
|
113
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
114
|
+
src: getAvatarSrc(rank),
|
|
115
|
+
alt: "user",
|
|
116
|
+
className: "RCB-avatar-img"
|
|
117
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
118
|
+
className: "RCB-user-details"
|
|
119
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
120
|
+
className: "RCB-user-id-title"
|
|
121
|
+
}, "User #", rank, ": ", user_id), /*#__PURE__*/_react["default"].createElement("div", {
|
|
122
|
+
className: "RCB-user-id-metadata"
|
|
123
|
+
}, locationMetadata && /*#__PURE__*/_react["default"].createElement("div", {
|
|
124
|
+
className: "RCB-user-id-metadata-item RCB-location-metadata-item"
|
|
125
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
126
|
+
src: map,
|
|
127
|
+
alt: "location",
|
|
128
|
+
className: "RCB-location-icon"
|
|
129
|
+
}), /*#__PURE__*/_react["default"].createElement("span", null, " ", locationMetadata)), locationMetadata && deviceMetadata && /*#__PURE__*/_react["default"].createElement("div", null, "|"), deviceMetadata && /*#__PURE__*/_react["default"].createElement("div", {
|
|
130
|
+
className: "RCB-user-id-metadata-item"
|
|
131
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
132
|
+
src: desktop,
|
|
133
|
+
alt: "device",
|
|
134
|
+
className: "RCB-device-icon"
|
|
135
|
+
}), /*#__PURE__*/_react["default"].createElement("span", null, deviceMetadata))))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
136
|
+
className: "RCB-user-id-description"
|
|
137
|
+
}, "This user is a ", /*#__PURE__*/_react["default"].createElement("b", null, user_types), " visitor with", " ", /*#__PURE__*/_react["default"].createElement("b", null, session_count), " sessions and ", /*#__PURE__*/_react["default"].createElement("b", null, total_events), " ", "events. They made ", /*#__PURE__*/_react["default"].createElement("b", null, clicks), " clicks, placed ", /*#__PURE__*/_react["default"].createElement("b", null, orders), " ", "order(s) worth ", /*#__PURE__*/_react["default"].createElement("b", null, "$", revenue), ".")))));
|
|
138
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.Default = void 0;
|
|
7
|
+
var _UIDItemComponent = _interopRequireDefault(require("./UIDItemComponent"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
var meta = {
|
|
10
|
+
title: 'Components/UIDItemComponent',
|
|
11
|
+
component: _UIDItemComponent["default"],
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: 'centered'
|
|
14
|
+
},
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
argTypes: {
|
|
17
|
+
props: {
|
|
18
|
+
description: 'Props object containing itemData and other configuration'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var _default = exports["default"] = meta;
|
|
23
|
+
var Default = exports.Default = {
|
|
24
|
+
args: {
|
|
25
|
+
props: {
|
|
26
|
+
itemData: {
|
|
27
|
+
user_id: 'user_12345',
|
|
28
|
+
user_behavior: {
|
|
29
|
+
user_types: 'returning',
|
|
30
|
+
session_count: 15,
|
|
31
|
+
total_events: 142
|
|
32
|
+
},
|
|
33
|
+
engagement_metrics: {
|
|
34
|
+
clicks: 48,
|
|
35
|
+
orders: 3,
|
|
36
|
+
revenue: '249.99'
|
|
37
|
+
},
|
|
38
|
+
device_info: {
|
|
39
|
+
platforms: ['Desktop'],
|
|
40
|
+
devices: ['Chrome']
|
|
41
|
+
},
|
|
42
|
+
location_info: {
|
|
43
|
+
regions: ['California'],
|
|
44
|
+
countries: ['USA'],
|
|
45
|
+
cities: ['San Francisco']
|
|
46
|
+
},
|
|
47
|
+
rank: 1
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.RCB-user-id-dropdown-item{display:flex;flex-direction:column;gap:20px}.RCB-user-id-dropdown-item .RCB-avatar-container{display:flex;flex-direction:column;gap:10px}.RCB-user-id-dropdown-item .RCB-avatar-container .RCB-avatar-container-inner{display:flex;gap:10px}.RCB-user-id-dropdown-item .RCB-avatar-container .RCB-avatar-img{width:55px;aspect-ratio:1}.RCB-user-id-dropdown-item .RCB-avatar-container .RCB-user-details{display:flex;flex-direction:column;gap:15px}.RCB-user-id-dropdown-item .RCB-avatar-container .RCB-user-id-title{font-size:16px;font-weight:600;color:#273251;line-height:21.82px}.RCB-user-id-dropdown-item .RCB-avatar-container .RCB-user-id-description{font-size:14px;font-weight:400;color:#3f5767;letter-spacing:0px;line-height:19px}.RCB-user-id-dropdown-item .RCB-user-id-metadata{display:flex;gap:20px;font-size:12px;font-weight:500;color:#687f8f}.RCB-user-id-dropdown-item .RCB-user-id-metadata .RCB-user-id-metadata-item{display:flex;gap:10px;align-items:center}.RCB-user-id-dropdown-item .RCB-location-icon{width:16px;height:16px}.RCB-user-id-dropdown-item .RCB-device-icon{width:16px;height:16px}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _UIDItemComponent = _interopRequireDefault(require("./UIDItemComponent"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
var _default = exports["default"] = _UIDItemComponent["default"];
|