@ssa-ui-kit/widgets 2.32.0-canary-d213a33-20251219 → 2.32.0-canary-f90c17a-20251231

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/dist/index.js DELETED
@@ -1,2837 +0,0 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else if(typeof exports === 'object')
7
- exports["SSAWidgets"] = factory();
8
- else
9
- root["SSAWidgets"] = factory();
10
- })(self, () => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ // The require scope
14
- /******/ var __webpack_require__ = {};
15
- /******/
16
- /************************************************************************/
17
- /******/ /* webpack/runtime/compat get default export */
18
- /******/ (() => {
19
- /******/ // getDefaultExport function for compatibility with non-harmony modules
20
- /******/ __webpack_require__.n = (module) => {
21
- /******/ var getter = module && module.__esModule ?
22
- /******/ () => (module['default']) :
23
- /******/ () => (module);
24
- /******/ __webpack_require__.d(getter, { a: getter });
25
- /******/ return getter;
26
- /******/ };
27
- /******/ })();
28
- /******/
29
- /******/ /* webpack/runtime/define property getters */
30
- /******/ (() => {
31
- /******/ // define getter functions for harmony exports
32
- /******/ __webpack_require__.d = (exports, definition) => {
33
- /******/ for(var key in definition) {
34
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
35
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
36
- /******/ }
37
- /******/ }
38
- /******/ };
39
- /******/ })();
40
- /******/
41
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
42
- /******/ (() => {
43
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
44
- /******/ })();
45
- /******/
46
- /******/ /* webpack/runtime/make namespace object */
47
- /******/ (() => {
48
- /******/ // define __esModule on exports
49
- /******/ __webpack_require__.r = (exports) => {
50
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
51
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
52
- /******/ }
53
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
54
- /******/ };
55
- /******/ })();
56
- /******/
57
- /************************************************************************/
58
- var __webpack_exports__ = {};
59
- // ESM COMPAT FLAG
60
- __webpack_require__.r(__webpack_exports__);
61
-
62
- // EXPORTS
63
- __webpack_require__.d(__webpack_exports__, {
64
- AccountBalance: () => (/* reexport */ AccountBalance),
65
- AccountKeys: () => (/* reexport */ AccountKeys),
66
- Activity: () => (/* reexport */ Activity),
67
- BalancePieChart: () => (/* reexport */ BalancePieChart),
68
- BalancePieChartTitle: () => (/* reexport */ BalancePieChartTitle),
69
- Bmi: () => (/* reexport */ Bmi),
70
- Calories: () => (/* reexport */ Calories),
71
- ExchangeAccount: () => (/* reexport */ ExchangeAccount),
72
- HeartRate: () => (/* reexport */ HeartRate),
73
- ListGoals: () => (/* reexport */ ListGoals),
74
- MarginInfo: () => (/* reexport */ MarginInfo),
75
- MealNutrients: () => (/* reexport */ MealNutrients),
76
- MealPlanner: () => (/* reexport */ MealPlanner),
77
- StepsCounter: () => (/* reexport */ StepsCounter),
78
- TradingInfoCard: () => (/* reexport */ TradingInfoCard_TradingInfoCard),
79
- TradingScoreboard: () => (/* reexport */ TradingScoreboard_TradingScoreboard),
80
- UpcomingWorkouts: () => (/* reexport */ UpcomingWorkouts),
81
- UserCard: () => (/* reexport */ UserCard_UserCard),
82
- WaterConsume: () => (/* reexport */ WaterConsume),
83
- useAccountKeys: () => (/* reexport */ useAccountKeys)
84
- });
85
-
86
- ;// external "@emotion/react"
87
- const react_namespaceObject = require("@emotion/react");
88
- ;// external "react"
89
- const external_react_namespaceObject = require("react");
90
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
91
- ;// external "@ssa-ui-kit/core"
92
- const core_namespaceObject = require("@ssa-ui-kit/core");
93
- ;// ./src/components/Activity/styles.ts
94
-
95
- const contentWrapper = theme => /*#__PURE__*/(0,react_namespaceObject.css)("justify-content:center;gap:20px;flex-direction:row;max-width:380px;", theme.mediaQueries.md, "{gap:30px;}" + ( true ? "" : 0), true ? "" : 0);
96
- ;// external "@ssa-ui-kit/utils"
97
- const utils_namespaceObject = require("@ssa-ui-kit/utils");
98
- ;// external "@emotion/react/jsx-runtime"
99
- const jsx_runtime_namespaceObject = require("@emotion/react/jsx-runtime");
100
- ;// ./src/components/Activity/ActivityItem.tsx
101
- function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
102
-
103
-
104
-
105
-
106
- const {
107
- printDayOfTheWeek
108
- } = utils_namespaceObject.dateFormatters;
109
- const container = true ? {
110
- name: "109oaxu",
111
- styles: "display:flex;align-items:center;flex-direction:column;justify-content:center;height:162px;gap:10px;font-size:11px"
112
- } : 0;
113
- const ActivityItem = ({
114
- currentValue,
115
- date
116
- }) => {
117
- return (0,jsx_runtime_namespaceObject.jsxs)("div", {
118
- css: container,
119
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ProgressVertical, {
120
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ProgressBar, {
121
- percentage: currentValue,
122
- color: "yellow"
123
- })
124
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
125
- variant: "subtitle",
126
- children: printDayOfTheWeek(new Date(date).getDay())
127
- })]
128
- });
129
- };
130
- /* harmony default export */ const Activity_ActivityItem = (ActivityItem);
131
- ;// ./src/components/Activity/Activity.tsx
132
- function Activity_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
- var _ref = true ? {
142
- name: "11yrylr",
143
- styles: "width:100%;flex-direction:column"
144
- } : 0;
145
- var _ref2 = true ? {
146
- name: "1uqairc",
147
- styles: "border-radius:20px;padding-inline:24px;padding-block:24px"
148
- } : 0;
149
- const Activity = ({
150
- data
151
- }) => {
152
- const [selected, setSelected] = (0,external_react_namespaceObject.useState)('');
153
- const [options, setOptions] = (0,external_react_namespaceObject.useState)([]);
154
- (0,external_react_namespaceObject.useEffect)(() => {
155
- if (data == null || typeof data !== 'object') {
156
- return;
157
- }
158
- setOptions(Object.keys(data).map((item, index) => ({
159
- id: index,
160
- value: `${item.charAt(0).toUpperCase()}${item.slice(1)}`
161
- })));
162
- }, [data]);
163
- (0,external_react_namespaceObject.useEffect)(() => {
164
- if (options?.length > 0 && !selected) {
165
- handleChange(options[0]);
166
- }
167
- }, [options]);
168
- const handleChange = e => {
169
- const value = e.value.toString().toLowerCase();
170
- setSelected(value);
171
- };
172
- return (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Card, {
173
- css: _ref2,
174
- children: [(0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.CardHeader, {
175
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
176
- variant: "h3",
177
- weight: "bold",
178
- children: "Activity"
179
- }), options?.length > 0 && (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Dropdown, {
180
- selectedItem: options[0],
181
- onChange: handleChange,
182
- children: options.map((item, index) => (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.DropdownOption, {
183
- value: item.value
184
- }, index))
185
- })]
186
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardContent, {
187
- css: _ref,
188
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Wrapper, {
189
- css: contentWrapper,
190
- children: Array.isArray(data[selected]) && data[selected].map((item, index) => (0,jsx_runtime_namespaceObject.jsx)(Activity_ActivityItem, {
191
- ...item
192
- }, index))
193
- })
194
- })]
195
- });
196
- };
197
- ;// ./src/components/Calories/innerContent.tsx
198
- function innerContent_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
199
-
200
-
201
-
202
- var innerContent_ref = true ? {
203
- name: "8or0zb",
204
- styles: "gap:5px"
205
- } : 0;
206
- const InnerContent = ({
207
- currentValue,
208
- max
209
- }) => {
210
- const theme = (0,react_namespaceObject.useTheme)();
211
- return (0,jsx_runtime_namespaceObject.jsxs)("div", {
212
- style: {
213
- display: 'grid',
214
- textAlign: 'center'
215
- },
216
- children: [(0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Wrapper, {
217
- alignItems: "baseline",
218
- direction: "row",
219
- css: innerContent_ref,
220
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
221
- variant: "h5",
222
- weight: "bold",
223
- color: theme.colors.greyDarker,
224
- children: currentValue
225
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
226
- variant: "subtitle",
227
- weight: "bold",
228
- color: theme.colors.greyDarker,
229
- children: "kcal"
230
- })]
231
- }), (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Typography, {
232
- variant: "subtitle",
233
- color: theme.colors.greyDarker60,
234
- children: [currentValue / max * 100, "% done"]
235
- })]
236
- });
237
- };
238
- ;// ./src/components/Calories/Calories.tsx
239
- function Calories_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
240
-
241
-
242
-
243
-
244
- /**
245
- *
246
- * UI Component that shows how many calories the user has burned
247
- */
248
-
249
- var Calories_ref = true ? {
250
- name: "1paxtit",
251
- styles: "box-shadow:0 10px 40px rgba(42, 48, 57, 0.08);border-radius:20px"
252
- } : 0;
253
- const Calories = ({
254
- max,
255
- currentValue
256
- }) => {
257
- const theme = (0,react_namespaceObject.useTheme)();
258
- return (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Card, {
259
- css: Calories_ref,
260
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardHeader, {
261
- icon: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ResponsiveImage, {
262
- css: /*#__PURE__*/(0,react_namespaceObject.css)({
263
- filter: `drop-shadow(0px 5px 5px ${theme.colors.grey})`
264
- }, true ? "" : 0, true ? "" : 0),
265
- srcSet: "https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fcalories%2Fcalories_64.png?alt=media&token=6a57e3f5-0e15-4dcf-8871-f1bf94d887af 64w, https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fcalories%2Fcalories_48.png?alt=media&token=861ad7c8-1bcb-4f2d-a581-4b73b4821251 48w",
266
- sizes: "(min-width: 1440px) 64px, 48px",
267
- src: "https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fcalories%2Fcalories_48.png?alt=media&token=861ad7c8-1bcb-4f2d-a581-4b73b4821251",
268
- alt: "Calories burn"
269
- }),
270
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
271
- variant: "h6",
272
- weight: "bold",
273
- children: "Calories"
274
- })
275
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardContent, {
276
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ProgressCircle, {
277
- max: max,
278
- currentValue: currentValue,
279
- color: "pink",
280
- infoContent: (0,jsx_runtime_namespaceObject.jsx)(InnerContent, {
281
- max: max,
282
- currentValue: currentValue
283
- }),
284
- size: 120
285
- })
286
- })]
287
- });
288
- };
289
- ;// external "@nivo/core"
290
- const external_nivo_core_namespaceObject = require("@nivo/core");
291
- ;// external "@nivo/line"
292
- const line_namespaceObject = require("@nivo/line");
293
- ;// ./src/components/HeartRate/utils.tsx
294
- const getTime = (date, options) => date.toLocaleTimeString('en-US', options || {
295
- hour: '2-digit',
296
- minute: '2-digit'
297
- });
298
- ;// ./src/components/HeartRate/HeartRateLineChart.tsx
299
-
300
-
301
-
302
-
303
- const ResponsiveLine = (0,core_namespaceObject.wrapNivoResponsiveComponent)(line_namespaceObject.ResponsiveLine, 'ResponsiveLine');
304
-
305
- // ScaleSpec is not exported from @nivo/line
306
-
307
- const defaults = {
308
- margin: {
309
- top: 0,
310
- right: 0,
311
- bottom: 0,
312
- left: 0
313
- },
314
- xScale: {
315
- type: 'point'
316
- },
317
- yScale: {
318
- type: 'linear',
319
- min: 'auto',
320
- max: 'auto',
321
- stacked: true,
322
- reverse: false
323
- },
324
- pointBorderColor: {
325
- from: 'serieColor'
326
- },
327
- legends: [],
328
- xFormat: yVal => getTime(new Date(String(yVal))),
329
- yFormat: xVal => `${xVal} bpm`,
330
- tooltip: args => (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.SimpleChartTooltip, {
331
- ...args
332
- })
333
- };
334
- const HeartRateLineChart = ({
335
- data,
336
- ...props
337
- }) => {
338
- return (0,jsx_runtime_namespaceObject.jsx)(ResponsiveLine, {
339
- data: data,
340
- curve: "linear",
341
- axisTop: null,
342
- axisRight: null,
343
- axisBottom: null,
344
- axisLeft: null,
345
- enableGridX: false,
346
- enableGridY: false,
347
- lineWidth: 1,
348
- enablePoints: false,
349
- pointSize: 3,
350
- pointColor: "black",
351
- pointBorderWidth: 2,
352
- pointLabelYOffset: -12,
353
- enableArea: true,
354
- areaOpacity: 0.1,
355
- enableCrosshair: false,
356
- crosshairType: "top-left",
357
- useMesh: true,
358
- animate: false,
359
- ...defaults,
360
- ...props
361
- });
362
- };
363
- ;// external "@emotion/styled/base"
364
- const base_namespaceObject = require("@emotion/styled/base");
365
- var base_default = /*#__PURE__*/__webpack_require__.n(base_namespaceObject);
366
- ;// ./src/components/HeartRate/BPM.tsx
367
-
368
- function BPM_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
369
-
370
-
371
-
372
- const BPMBase = /*#__PURE__*/base_default()("div", true ? {
373
- target: "ek7c6rl0"
374
- } : 0)( true ? {
375
- name: "1v1gu0d",
376
- styles: "text-align:center;margin-top:23px"
377
- } : 0);
378
- const BPMValueStyles = true ? {
379
- name: "1ttuluy",
380
- styles: "font-weight:700;font-size:1.728rem;line-height:2rem;@media (max-width: 900px){font-size:1.2rem;line-height:1.639;}"
381
- } : 0;
382
- const getBPMLabelStyles = theme => /*#__PURE__*/(0,react_namespaceObject.css)("color:", theme.colors.greyDarker60, ";font-weight:600;font-size:1rem;line-height:1.5rem;margin-left:4px;@media (max-width: 900px){font-size:0.833rem;line-height:1.375;}" + ( true ? "" : 0), true ? "" : 0);
383
- const BPM = ({
384
- value
385
- }) => {
386
- const theme = (0,react_namespaceObject.useTheme)();
387
- return (0,jsx_runtime_namespaceObject.jsxs)(BPMBase, {
388
- children: [(0,jsx_runtime_namespaceObject.jsx)("span", {
389
- css: BPMValueStyles,
390
- children: value
391
- }), (0,jsx_runtime_namespaceObject.jsx)("span", {
392
- css: getBPMLabelStyles(theme),
393
- children: "BPM"
394
- })]
395
- });
396
- };
397
- ;// ./src/components/HeartRate/HeartRate.tsx
398
-
399
- function HeartRate_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
400
-
401
-
402
-
403
-
404
-
405
-
406
-
407
-
408
-
409
- const gradientId = 'HeartRateGradient';
410
- const chartFill = [{
411
- match: '*',
412
- id: gradientId
413
- }];
414
-
415
- /**
416
- *
417
- * UI Component that shows the heart rate of the user
418
- */
419
- var HeartRate_ref = true ? {
420
- name: "1srykpd",
421
- styles: "height:65px;width:calc(100% + 40px);margin-inline:-20px"
422
- } : 0;
423
- var HeartRate_ref2 = true ? {
424
- name: "1paxtit",
425
- styles: "box-shadow:0 10px 40px rgba(42, 48, 57, 0.08);border-radius:20px"
426
- } : 0;
427
- var _ref3 = true ? {
428
- name: "1d3w5wq",
429
- styles: "width:100%"
430
- } : 0;
431
- const HeartRate = ({
432
- data,
433
- caption = 'Heart Rate',
434
- color
435
- }) => {
436
- const [bpmValue, setBpmValue] = (0,external_react_namespaceObject.useState)(data?.data?.[0]?.y);
437
- const [onBpmValueChange, cancelTimer] = (0,external_react_namespaceObject.useMemo)(() => (0,utils_namespaceObject.throttle)(point => {
438
- if ((0,line_namespaceObject.isPoint)(point)) {
439
- setBpmValue(point?.data?.y);
440
- }
441
- }, 100), []);
442
- const theme = (0,react_namespaceObject.useTheme)();
443
- const chartColor = color || theme.colors.purpleDark;
444
- (0,external_react_namespaceObject.useEffect)(() => () => cancelTimer(), []);
445
- (0,external_react_namespaceObject.useEffect)(() => {
446
- setBpmValue(data?.data?.[0]?.y);
447
- }, [data]);
448
- const gradientDefs = (0,external_react_namespaceObject.useMemo)(() => [(0,external_nivo_core_namespaceObject.linearGradientDef)(gradientId, [{
449
- offset: 100,
450
- color: chartColor
451
- }, {
452
- offset: 0,
453
- color: chartColor
454
- }])], [chartColor]);
455
- const chartProps = (0,external_react_namespaceObject.useMemo)(() => ({
456
- data: [data],
457
- colors: chartColor
458
- }), [data, chartColor]);
459
- return (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Card, {
460
- css: HeartRate_ref2,
461
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardHeader, {
462
- icon: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ResponsiveImage, {
463
- css: /*#__PURE__*/(0,react_namespaceObject.css)({
464
- filter: `drop-shadow(0px 5px 5px ${theme.colors.grey})`
465
- }, true ? "" : 0, true ? "" : 0),
466
- srcSet: "https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fheart%2Fheart_64.png?alt=media&token=aca1639b-62f5-44ed-a0d1-3cea8e4797e2 64w, https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fheart%2Fheart_48.png?alt=media&token=7ef68a25-5362-48b9-b359-c46b48d1db54 48w",
467
- sizes: "(min-width: 1440px) 64px, 48px",
468
- src: "https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fheart%2Fheart_48.png?alt=media&token=7ef68a25-5362-48b9-b359-c46b48d1db54",
469
- alt: "Heart"
470
- }),
471
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
472
- variant: "h5",
473
- weight: "bold",
474
- children: caption
475
- })
476
- }), (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.CardContent, {
477
- direction: "column",
478
- css: _ref3,
479
- children: [(0,jsx_runtime_namespaceObject.jsx)("div", {
480
- css: HeartRate_ref,
481
- children: (0,jsx_runtime_namespaceObject.jsx)(HeartRateLineChart, {
482
- ...chartProps,
483
- fill: chartFill,
484
- defs: gradientDefs,
485
- onMouseMove: onBpmValueChange
486
- })
487
- }), bpmValue != null ? (0,jsx_runtime_namespaceObject.jsx)(BPM, {
488
- value: bpmValue
489
- }) : null]
490
- })]
491
- });
492
- };
493
- ;// ./src/components/HeartRate/index.ts
494
-
495
-
496
- ;// ./src/components/MealNutrients/chartDefaultConfig.tsx
497
-
498
-
499
-
500
- const {
501
- formatDayOfWeek
502
- } = utils_namespaceObject.dateFormatters;
503
- const CustomPointLayer = ({
504
- currentPoint,
505
- pointSize,
506
- pointBorderWidth,
507
- ...props
508
- }) => {
509
- if (!currentPoint) {
510
- return;
511
- }
512
- const point = currentPoint;
513
- return (0,jsx_runtime_namespaceObject.jsx)("g", {
514
- children: (0,jsx_runtime_namespaceObject.jsx)(external_nivo_core_namespaceObject.DotsItem, {
515
- x: point.x,
516
- y: point.y,
517
- color: point.color,
518
- borderColor: point.borderColor,
519
- datum: point.data,
520
- size: pointSize || 0,
521
- borderWidth: pointBorderWidth || 0,
522
- ...props
523
- }, point.id)
524
- });
525
- };
526
- const tickValues = [0, 20, 40, 60, 80, 100];
527
- const chartDefaultConfig_defaults = {
528
- margin: {
529
- top: 28,
530
- right: 50,
531
- bottom: 50,
532
- left: 5
533
- },
534
- xScale: {
535
- type: 'time',
536
- format: '%L',
537
- precision: 'day'
538
- },
539
- yScale: {
540
- type: 'linear',
541
- min: 'auto',
542
- max: 'auto',
543
- stacked: false,
544
- reverse: false
545
- },
546
- axisRight: {
547
- tickSize: 0,
548
- tickPadding: 10,
549
- tickRotation: 0,
550
- tickValues,
551
- format: tick => `${tick}%`,
552
- legend: '',
553
- legendOffset: 0
554
- },
555
- axisBottom: {
556
- tickSize: 0,
557
- tickPadding: 30,
558
- tickRotation: 0,
559
- legend: '',
560
- tickValues: 'every day',
561
- format: formatDayOfWeek
562
- },
563
- pointColor: {
564
- from: 'color',
565
- modifiers: []
566
- },
567
- pointBorderColor: {
568
- from: 'color',
569
- modifiers: []
570
- },
571
- legends: [],
572
- gridYValues: tickValues,
573
- layers: ['grid', 'markers', 'axes', 'areas', 'crosshair', 'lines', CustomPointLayer, 'slices', 'mesh', 'legends']
574
- };
575
- ;// ./src/components/MealNutrients/MealNutrientsTooltip.tsx
576
-
577
-
578
- const capitalize = str => `${str[0].toUpperCase()}${str.substring(1)}`;
579
- const MealNutrientsTooltip = ({
580
- colorName,
581
- point
582
- }) => {
583
- const caption = capitalize(String(point.seriesId));
584
- const {
585
- data: {
586
- y,
587
- comp,
588
- unit
589
- }
590
- } = point;
591
- const iconName = comp && `arrow-${comp > 0 ? 'up' : 'down'}` || undefined;
592
- return (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ProgressChartTooltip, {
593
- caption: caption,
594
- value: y,
595
- valueFormatted: `${comp}${unit}`,
596
- iconName: iconName,
597
- barProps: {
598
- color: colorName
599
- }
600
- });
601
- };
602
- ;// ./src/components/MealNutrients/MealNutrientsLineChart.tsx
603
-
604
-
605
-
606
-
607
-
608
-
609
-
610
- const MealNutrientsLineChart_ResponsiveLine = (0,core_namespaceObject.wrapNivoResponsiveComponent)(line_namespaceObject.ResponsiveLine, 'ResponsiveLine');
611
- const colorPalette = ['pink', 'purple', 'turquoise', 'yellow', 'green', 'blue'];
612
- const MealNutrientsLineChart = ({
613
- data,
614
- ...props
615
- }) => {
616
- const theme = (0,react_namespaceObject.useTheme)();
617
- const defaultColorMapping = (0,external_react_namespaceObject.useMemo)(() => colorPalette.reduce((res, colorName) => {
618
- const colorValue = theme.colors[`${colorName}Lighter`];
619
- res[colorValue] = colorName;
620
- return res;
621
- }, {}), [theme.colors]);
622
- const defaultSettings = (0,external_react_namespaceObject.useMemo)(() => Object.assign(chartDefaultConfig_defaults, {
623
- colors: colorPalette.map(color => theme.colors[`${color}Lighter`]),
624
- tooltip: ({
625
- point
626
- }) => {
627
- const color = defaultColorMapping[point.color];
628
- return (0,jsx_runtime_namespaceObject.jsx)(MealNutrientsTooltip, {
629
- point: point,
630
- colorName: color
631
- });
632
- },
633
- theme: {
634
- axis: {
635
- ticks: {
636
- text: {
637
- fontSize: '0.833rem',
638
- fontWeight: 500,
639
- fill: theme.colors.greyDarker
640
- }
641
- }
642
- },
643
- grid: {
644
- line: {
645
- stroke: theme.colors.greyLighter,
646
- strokeWidth: 1,
647
- strokeDasharray: '8 8'
648
- }
649
- },
650
- text: {
651
- fontFamily: "'Manrope', sans-serif"
652
- }
653
- }
654
- }), [theme.colors, defaultColorMapping]);
655
- return (0,jsx_runtime_namespaceObject.jsx)(MealNutrientsLineChart_ResponsiveLine, {
656
- data: data,
657
- curve: "catmullRom",
658
- axisTop: null,
659
- axisLeft: null,
660
- enableGridX: false,
661
- enableGridY: true,
662
- lineWidth: 1,
663
- enablePoints: true,
664
- pointSize: 8,
665
- pointBorderWidth: 0,
666
- pointLabelYOffset: -12,
667
- enableArea: false,
668
- areaOpacity: 0.1,
669
- enableCrosshair: false,
670
- useMesh: true,
671
- animate: false,
672
- ...defaultSettings,
673
- ...props
674
- });
675
- };
676
- ;// ./src/components/MealNutrients/useChartConfig.ts
677
-
678
-
679
- const {
680
- formatTime,
681
- formatDayOfWeek: useChartConfig_formatDayOfWeek,
682
- formatDate
683
- } = utils_namespaceObject.dateFormatters;
684
- const MAX_ITEMS_ON_SMALL_SCREENS = 7;
685
- const MIN_WIDTH = 600;
686
- const THROTTLE_DELAY_MS = 50;
687
- const useChartConfig = (elRef, data, precision = 'day') => {
688
- const [width, setWidth] = (0,external_react_namespaceObject.useState)(0);
689
- const throttledRef = (0,external_react_namespaceObject.useRef)((0,utils_namespaceObject.throttle)(entries => {
690
- setWidth(entries[0].contentRect.width);
691
- }, THROTTLE_DELAY_MS));
692
- const observerRef = (0,external_react_namespaceObject.useRef)(new ResizeObserver(throttledRef?.current?.[0]));
693
- (0,external_react_namespaceObject.useEffect)(() => {
694
- const currentRef = elRef.current;
695
- if (observerRef.current && currentRef) {
696
- observerRef.current.observe(currentRef);
697
- }
698
- return () => {
699
- if (observerRef.current && currentRef) {
700
- observerRef.current.unobserve(currentRef);
701
- }
702
- };
703
- }, [elRef, observerRef]);
704
- (0,external_react_namespaceObject.useEffect)(() => {
705
- return () => {
706
- if (throttledRef.current) {
707
- const [, cancel] = throttledRef.current;
708
- cancel();
709
- }
710
- };
711
- }, [throttledRef]);
712
- return (0,external_react_namespaceObject.useMemo)(() => ({
713
- xScale: {
714
- type: 'time',
715
- format: '%L',
716
- precision: precision === 'week' ? 'day' : precision
717
- },
718
- axisBottom: {
719
- tickSize: 0,
720
- tickPadding: 30,
721
- legend: '',
722
- tickValues: width < MIN_WIDTH ? MAX_ITEMS_ON_SMALL_SCREENS : undefined,
723
- tickRotation: width < MIN_WIDTH ? 30 : 0,
724
- format: precision === 'hour' ? formatTime : precision === 'week' ? useChartConfig_formatDayOfWeek : formatDate
725
- }
726
- }), [data, width, precision]);
727
- };
728
- /* harmony default export */ const MealNutrients_useChartConfig = (useChartConfig);
729
- ;// ./src/components/MealNutrients/MealNutrients.tsx
730
- function MealNutrients_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
731
-
732
-
733
-
734
-
735
-
736
- var MealNutrients_ref = true ? {
737
- name: "as11ew",
738
- styles: "line-height:normal"
739
- } : 0;
740
- var MealNutrients_ref2 = true ? {
741
- name: "1d3w5wq",
742
- styles: "width:100%"
743
- } : 0;
744
- var MealNutrients_ref3 = true ? {
745
- name: "1otqacd",
746
- styles: "height:227px;svg{overflow:visible;}"
747
- } : 0;
748
- /**
749
- *
750
- * UI Component that shows the nutrients consumed by the user
751
- */
752
- const MealNutrients = ({
753
- caption = 'Meal Nutrients',
754
- options,
755
- data,
756
- onOptionChange
757
- }) => {
758
- const [selectedOption, setSelectedOption] = (0,external_react_namespaceObject.useState)();
759
- const containerRef = (0,external_react_namespaceObject.useRef)(null);
760
- const chartConfig = MealNutrients_useChartConfig(containerRef, data, selectedOption?.precision);
761
- (0,external_react_namespaceObject.useEffect)(() => {
762
- if (options?.length > 0 && selectedOption == null) {
763
- handleChange(options[0]);
764
- }
765
- }, [options]);
766
- const handleChange = e => {
767
- const item = options.filter(item => item.value === e.value)[0];
768
- setSelectedOption(item);
769
- if (onOptionChange) {
770
- onOptionChange(item);
771
- }
772
- };
773
- return (0,jsx_runtime_namespaceObject.jsxs)("div", {
774
- ref: containerRef,
775
- children: [(0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.CardHeader, {
776
- transparent: true,
777
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
778
- variant: "h4",
779
- weight: "bold",
780
- css: MealNutrients_ref,
781
- children: caption
782
- }), options?.length > 0 && (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Dropdown, {
783
- selectedItem: options[0],
784
- onChange: handleChange,
785
- children: options.map(item => (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.DropdownOption, {
786
- value: item.value,
787
- label: item.label
788
- }, item.value))
789
- })]
790
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Card, {
791
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardContent, {
792
- direction: "column",
793
- css: MealNutrients_ref2,
794
- children: (0,jsx_runtime_namespaceObject.jsx)("div", {
795
- css: MealNutrients_ref3,
796
- children: data?.length > 0 && (0,jsx_runtime_namespaceObject.jsx)(MealNutrientsLineChart, {
797
- data: data,
798
- ...chartConfig
799
- })
800
- })
801
- })
802
- })]
803
- });
804
- };
805
- ;// ./src/components/MealNutrients/index.tsx
806
-
807
-
808
- ;// ./src/components/UpcomingWorkouts/style.ts
809
- function style_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
810
-
811
- var style_ref = true ? {
812
- name: "1g7ta9s",
813
- styles: "display:flex;justify-content:space-between;align-items:center;width:100%;padding-left:15px"
814
- } : 0;
815
- const style_contentWrapper = () => style_ref;
816
- ;// ./src/components/UpcomingWorkouts/UpcomingWorkoutCard.tsx
817
- function UpcomingWorkoutCard_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
818
-
819
-
820
-
821
-
822
- /**
823
- *
824
- * UI Component that use CardList to render a list of upcoming workouts
825
- */
826
-
827
- var UpcomingWorkoutCard_ref = true ? {
828
- name: "10ava9y",
829
- styles: "width:calc(100% - 42px)"
830
- } : 0;
831
- const UpcomingWorkoutCard = ({
832
- image,
833
- title,
834
- workoutTime,
835
- renderDetails,
836
- onClick
837
- }) => {
838
- const theme = (0,react_namespaceObject.useTheme)();
839
- return (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Card, {
840
- noShadow: true,
841
- children: (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Wrapper, {
842
- direction: "row",
843
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Avatar, {
844
- size: 42,
845
- image: image
846
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardContent, {
847
- css: UpcomingWorkoutCard_ref,
848
- children: (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Wrapper, {
849
- direction: "column",
850
- children: [(0,jsx_runtime_namespaceObject.jsxs)("div", {
851
- css: style_contentWrapper,
852
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
853
- variant: "h6",
854
- children: title
855
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Button, {
856
- endIcon: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Icon, {
857
- name: "more"
858
- }),
859
- variant: "tertiary",
860
- size: "small",
861
- onClick: onClick
862
- })]
863
- }), (0,jsx_runtime_namespaceObject.jsxs)("div", {
864
- css: style_contentWrapper,
865
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
866
- variant: "subtitle",
867
- color: theme.colors.greyDarker60,
868
- as: "p",
869
- children: renderDetails()
870
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
871
- variant: "subtitle",
872
- as: "p",
873
- children: workoutTime
874
- })]
875
- })]
876
- })
877
- })]
878
- })
879
- });
880
- };
881
- ;// ./src/components/UpcomingWorkouts/UpcomingWorkouts.tsx
882
-
883
-
884
-
885
-
886
- const UpcomingWorkouts = ({
887
- workouts
888
- }) => (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardList, {
889
- title: "Upcoming Workout",
890
- items: workouts,
891
- renderItem: workout => (0,jsx_runtime_namespaceObject.jsx)(UpcomingWorkoutCard, {
892
- image: workout.image,
893
- title: workout.title,
894
- workoutTime: workout.workoutTime,
895
- onClick: workout.handleClick,
896
- renderDetails: () => (0,jsx_runtime_namespaceObject.jsxs)(external_react_namespaceObject.Fragment, {
897
- children: [(0,jsx_runtime_namespaceObject.jsx)("strong", {
898
- children: workout.details.exercises
899
- }), " Exercises |", ' ', (0,jsx_runtime_namespaceObject.jsx)("strong", {
900
- children: workout.details.minutes
901
- }), " mins"]
902
- })
903
- })
904
- });
905
- ;// ./src/components/WaterConsume/WaterConsume.tsx
906
- function WaterConsume_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
907
-
908
-
909
-
910
- var WaterConsume_ref2 = true ? {
911
- name: "7mn33w",
912
- styles: "flex:1 1 auto;margin-left:11.5px"
913
- } : 0;
914
- const CustomConnector = ({
915
- active,
916
- completed
917
- }) => {
918
- const theme = (0,react_namespaceObject.useTheme)();
919
- return (0,jsx_runtime_namespaceObject.jsx)("div", {
920
- css: WaterConsume_ref2,
921
- children: (0,jsx_runtime_namespaceObject.jsx)("span", {
922
- css: /*#__PURE__*/(0,react_namespaceObject.css)("display:block;border-color:", active || completed ? theme.colors.blueLightLighter : theme.colors.greyDarker60, ";border-left-style:dashed;border-left-width:1px;min-height:20px;" + ( true ? "" : 0), true ? "" : 0)
923
- })
924
- });
925
- };
926
- const CustomStep = props => {
927
- const {
928
- active,
929
- completed
930
- } = props;
931
- const theme = (0,react_namespaceObject.useTheme)();
932
- return (0,jsx_runtime_namespaceObject.jsx)("div", {
933
- css: /*#__PURE__*/(0,react_namespaceObject.css)("width:6px;height:6px;background-color:", active || completed ? theme.colors.blueLightLighter : theme.colors.greyDarker60, ";border-radius:50%;" + ( true ? "" : 0), true ? "" : 0)
934
- });
935
- };
936
-
937
- /**
938
- *
939
- * UI Component shows the water consumption objective of the user
940
- * @param steps - the order goes from top to bottom, from left to right
941
- */
942
- var WaterConsume_ref = true ? {
943
- name: "1paxtit",
944
- styles: "box-shadow:0 10px 40px rgba(42, 48, 57, 0.08);border-radius:20px"
945
- } : 0;
946
- var WaterConsume_ref3 = true ? {
947
- name: "1n5h93v",
948
- styles: "width:100%;justify-content:center;align-items:stretch"
949
- } : 0;
950
- const WaterConsume = ({
951
- minValue = 0,
952
- maxValue = 100,
953
- currentValue,
954
- active,
955
- steps,
956
- unit = '%'
957
- }) => {
958
- const theme = (0,react_namespaceObject.useTheme)();
959
- const currentPercentage = Math.round(currentValue * 100 / maxValue);
960
- return (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Card, {
961
- css: WaterConsume_ref,
962
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardHeader, {
963
- icon: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ResponsiveImage, {
964
- css: /*#__PURE__*/(0,react_namespaceObject.css)({
965
- filter: `drop-shadow(0px 5px 5px ${theme.colors.grey})`
966
- }, true ? "" : 0, true ? "" : 0),
967
- srcSet: "https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fwater%2Fwater_64.png?alt=media&token=2abf9f9c-2159-4235-856c-f054783a007d 64w, https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fwater%2Fwater_48.png?alt=media&token=abc1e619-940a-4fc0-9f83-ef0a998464f2 48w",
968
- sizes: "(min-width: 1440px) 64px, 48px",
969
- src: "https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fwater%2Fwater_48.png?alt=media&token=abc1e619-940a-4fc0-9f83-ef0a998464f2",
970
- alt: "Water"
971
- }),
972
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
973
- variant: "h6",
974
- weight: "bold",
975
- children: "Water"
976
- })
977
- }), (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.CardContent, {
978
- css: WaterConsume_ref3,
979
- children: [(0,jsx_runtime_namespaceObject.jsx)("div", {
980
- style: {
981
- fontSize: 14,
982
- marginRight: '15px'
983
- },
984
- children: (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.ProgressVertical, {
985
- children: [(0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.ProgressLegend, {
986
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ProgressLegendItem, {
987
- position: "end",
988
- percentage: 100,
989
- children: (0,jsx_runtime_namespaceObject.jsx)("span", {
990
- style: {
991
- textAlign: 'right',
992
- display: 'block',
993
- paddingRight: 6
994
- },
995
- children: `${maxValue}${unit}`
996
- })
997
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ProgressLegendItem, {
998
- position: "current",
999
- percentage: currentPercentage,
1000
- children: (0,jsx_runtime_namespaceObject.jsx)("span", {
1001
- style: {
1002
- textAlign: 'right',
1003
- display: 'block',
1004
- paddingRight: 6
1005
- },
1006
- children: `${currentValue}${unit}`
1007
- })
1008
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ProgressLegendItem, {
1009
- position: "start",
1010
- percentage: 0,
1011
- children: (0,jsx_runtime_namespaceObject.jsx)("span", {
1012
- style: {
1013
- textAlign: 'right',
1014
- display: 'block',
1015
- paddingRight: 6
1016
- },
1017
- children: `${minValue}${unit}`
1018
- })
1019
- })]
1020
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ProgressBar, {
1021
- percentage: currentPercentage,
1022
- color: "blueLight"
1023
- })]
1024
- })
1025
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Stepper, {
1026
- color: theme.colors.blueLight,
1027
- activeStep: active,
1028
- orientation: 'vertical',
1029
- inverted: true,
1030
- sx: {
1031
- rowGap: 0
1032
- },
1033
- children: steps.map((step, index) => {
1034
- return (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Step, {
1035
- Connector: CustomConnector,
1036
- children: (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.StepLabel, {
1037
- StepIcon: CustomStep,
1038
- children: [(0,jsx_runtime_namespaceObject.jsx)("span", {
1039
- style: {
1040
- textAlign: 'left',
1041
- display: 'block',
1042
- fontSize: 9
1043
- },
1044
- children: step.caption
1045
- }), (0,jsx_runtime_namespaceObject.jsx)("span", {
1046
- style: {
1047
- textAlign: 'left',
1048
- display: 'block',
1049
- fontSize: 9,
1050
- fontWeight: 700
1051
- },
1052
- children: step.title
1053
- })]
1054
- })
1055
- }, index);
1056
- })
1057
- })]
1058
- })]
1059
- });
1060
- };
1061
- ;// ./src/components/Bmi/BmiHeatbar.tsx
1062
-
1063
- function BmiHeatbar_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1064
- const BmiHeatbar = /*#__PURE__*/base_default()("div", true ? {
1065
- target: "e1n6hn4h0"
1066
- } : 0)( true ? {
1067
- name: "1oaiz4z",
1068
- styles: "width:100%;height:14px;background:linear-gradient(\n 90deg,\n #8b60f4 0%,\n #658fdf 16.67%,\n #69cdd0 35.42%,\n #88e4c3 51.04%,\n #edba5d 68.23%,\n #ed8f66 84.38%,\n #f28689 100%\n );border-radius:21px"
1069
- } : 0);
1070
- ;// ./src/components/Bmi/BmiPointer.tsx
1071
-
1072
- const BmiPointer = /*#__PURE__*/base_default()("div", true ? {
1073
- target: "etdmc4t0"
1074
- } : 0)("position:absolute;left:", ({
1075
- percentage
1076
- }) => percentage, "%;top:0;width:14px;height:14px;background:#2b2d31;box-shadow:-4px 4px 10px rgba(42, 48, 57, 0.2);border-radius:19px;" + ( true ? "" : 0));
1077
- ;// ./src/components/Bmi/BmiInfo.tsx
1078
-
1079
- const BmiInfo = /*#__PURE__*/base_default()("div", true ? {
1080
- target: "e1968qvg0"
1081
- } : 0)("display:flex;padding:8px 16px;background:", ({
1082
- theme
1083
- }) => theme.colors.greyLighter, ";border-radius:12px;align-items:center;" + ( true ? "" : 0));
1084
- ;// ./src/components/Bmi/BmiLabel.tsx
1085
-
1086
- function BmiLabel_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1087
-
1088
- const BmiLabel = /*#__PURE__*/base_default()(core_namespaceObject.Typography, true ? {
1089
- target: "ejsfewa0"
1090
- } : 0)( true ? {
1091
- name: "h16vwx",
1092
- styles: "position:absolute;left:65%"
1093
- } : 0);
1094
- ;// ./src/components/Bmi/BmiLabels.tsx
1095
- function BmiLabels_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1096
-
1097
-
1098
-
1099
- var BmiLabels_ref = true ? {
1100
- name: "13f8x48",
1101
- styles: "left:80%"
1102
- } : 0;
1103
- var BmiLabels_ref2 = true ? {
1104
- name: "322hte",
1105
- styles: "left:60%"
1106
- } : 0;
1107
- var BmiLabels_ref3 = true ? {
1108
- name: "1s4icj2",
1109
- styles: "left:20%"
1110
- } : 0;
1111
- var _ref4 = true ? {
1112
- name: "1i0rnv0",
1113
- styles: "position:relative;margin-top:5px"
1114
- } : 0;
1115
- const BmiLabels = () => (0,jsx_runtime_namespaceObject.jsxs)("div", {
1116
- css: _ref4,
1117
- children: [(0,jsx_runtime_namespaceObject.jsx)(BmiLabel, {
1118
- variant: 'subtitle',
1119
- css: BmiLabels_ref3,
1120
- children: "18.5"
1121
- }), (0,jsx_runtime_namespaceObject.jsx)(BmiLabel, {
1122
- variant: 'subtitle',
1123
- css: BmiLabels_ref2,
1124
- children: "25"
1125
- }), (0,jsx_runtime_namespaceObject.jsx)(BmiLabel, {
1126
- variant: 'subtitle',
1127
- css: BmiLabels_ref,
1128
- children: "30"
1129
- })]
1130
- });
1131
- ;// ./src/components/Bmi/styles.ts
1132
- function styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1133
-
1134
- const TitleWrapper = theme => /*#__PURE__*/(0,react_namespaceObject.css)("display:flex;h6{line-height:1.625rem;margin-left:10px;color:", theme.colors.greyDarker60, ";}" + ( true ? "" : 0), true ? "" : 0);
1135
- const ContentWrapper = true ? {
1136
- name: "1fgsgvi",
1137
- styles: "position:relative;width:100%;padding-top:20px"
1138
- } : 0;
1139
- ;// ./src/components/Bmi/Bmi.tsx
1140
- function Bmi_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1141
-
1142
-
1143
-
1144
-
1145
-
1146
-
1147
-
1148
-
1149
-
1150
- var Bmi_ref = true ? {
1151
- name: "1d3w5wq",
1152
- styles: "width:100%"
1153
- } : 0;
1154
- var Bmi_ref2 = true ? {
1155
- name: "zccqi5",
1156
- styles: "box-shadow:0 10px 40px rgba(29, 22, 23, 0.07);border-radius:16px;padding-bottom:40px"
1157
- } : 0;
1158
- /**
1159
- *
1160
- * UI Component that calculates the Body Mass Index of the user
1161
- */
1162
- const Bmi = ({
1163
- height = 175,
1164
- weight = 66
1165
- }) => {
1166
- const [info, setInfo] = (0,external_react_namespaceObject.useState)('');
1167
- const [pointer, setPointer] = (0,external_react_namespaceObject.useState)(0);
1168
- const bmi = Number((weight / (height * height) * 10000).toFixed(1));
1169
- const setInfos = {
1170
- underWeight: () => {
1171
- setInfo('Under Weight');
1172
- setPointer(10);
1173
- },
1174
- healthy: () => {
1175
- setInfo('Healthy');
1176
- setPointer(40);
1177
- },
1178
- overweight: () => {
1179
- setInfo('Overweight');
1180
- setPointer(70);
1181
- },
1182
- obese: () => {
1183
- setInfo('Obese');
1184
- setPointer(90);
1185
- }
1186
- };
1187
- (0,external_react_namespaceObject.useEffect)(() => {
1188
- if (bmi < 18.5) {
1189
- setInfos.underWeight();
1190
- } else if (bmi > 18.5 && bmi <= 24.9) {
1191
- setInfos.healthy();
1192
- } else if (bmi > 24.9 && bmi < 30) {
1193
- setInfos.overweight();
1194
- } else {
1195
- setInfos.obese();
1196
- }
1197
- }, [bmi]);
1198
- return (0,jsx_runtime_namespaceObject.jsxs)(external_react_namespaceObject.Fragment, {
1199
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardHeader, {
1200
- transparent: true,
1201
- children: (0,jsx_runtime_namespaceObject.jsxs)("div", {
1202
- css: TitleWrapper,
1203
- children: [(0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Typography, {
1204
- variant: "h5",
1205
- weight: "bold",
1206
- children: ["BMI", ' ']
1207
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1208
- variant: "h6",
1209
- children: "Body Mass Index"
1210
- })]
1211
- })
1212
- }), (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Card, {
1213
- css: Bmi_ref2,
1214
- children: [(0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.CardHeader, {
1215
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1216
- variant: "h2",
1217
- weight: "medium",
1218
- children: bmi
1219
- }), (0,jsx_runtime_namespaceObject.jsx)(BmiInfo, {
1220
- children: (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Typography, {
1221
- variant: "subtitle",
1222
- weight: "lighter",
1223
- children: ["You're ", info]
1224
- })
1225
- })]
1226
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardContent, {
1227
- css: Bmi_ref,
1228
- children: (0,jsx_runtime_namespaceObject.jsxs)("div", {
1229
- css: ContentWrapper,
1230
- children: [(0,jsx_runtime_namespaceObject.jsx)(BmiPointer, {
1231
- "data-testid": "bmi-pointer",
1232
- percentage: pointer
1233
- }), (0,jsx_runtime_namespaceObject.jsx)(BmiHeatbar, {}), (0,jsx_runtime_namespaceObject.jsx)(BmiLabels, {})]
1234
- })
1235
- })]
1236
- })]
1237
- });
1238
- };
1239
- ;// ./src/components/ListGoals/styles.tsx
1240
-
1241
- const content = theme => /*#__PURE__*/(0,react_namespaceObject.css)("h6{line-height:23px;}p{color:", theme.colors.greyDarker60, ";line-height:23px;}" + ( true ? "" : 0), true ? "" : 0);
1242
- ;// ./src/components/ListGoals/ListGoalsCard.tsx
1243
- function ListGoalsCard_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1244
-
1245
-
1246
-
1247
-
1248
- var ListGoalsCard_ref = true ? {
1249
- name: "ui9771",
1250
- styles: "width:calc(100% - 42px);padding-left:15px"
1251
- } : 0;
1252
- var ListGoalsCard_ref2 = true ? {
1253
- name: "1ch9yvl",
1254
- styles: "border-radius:0"
1255
- } : 0;
1256
- const ListGoalsCard = ({
1257
- image,
1258
- title,
1259
- details,
1260
- progressProps
1261
- }) => {
1262
- const {
1263
- size = 50,
1264
- max = 100,
1265
- currentValue = 0,
1266
- infoContent,
1267
- color = 'blue'
1268
- } = progressProps;
1269
- return (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Card, {
1270
- noShadow: true,
1271
- children: (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Wrapper, {
1272
- direction: "row",
1273
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Avatar, {
1274
- size: 42,
1275
- image: image,
1276
- css: ListGoalsCard_ref2
1277
- }), (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.CardContent, {
1278
- css: ListGoalsCard_ref,
1279
- children: [(0,jsx_runtime_namespaceObject.jsxs)("div", {
1280
- css: content,
1281
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1282
- variant: "h6",
1283
- children: title
1284
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1285
- variant: "subtitle",
1286
- as: "p",
1287
- children: details
1288
- })]
1289
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ProgressCircle, {
1290
- size: size,
1291
- max: max,
1292
- currentValue: currentValue,
1293
- infoContent: infoContent || (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Typography, {
1294
- variant: "body1",
1295
- children: [currentValue, "%"]
1296
- }),
1297
- color: color
1298
- })]
1299
- })]
1300
- })
1301
- });
1302
- };
1303
- ;// ./src/components/ListGoals/ListGoals.tsx
1304
-
1305
-
1306
-
1307
- /**
1308
- *
1309
- * UI Component that uses CardList to render a list of goals
1310
- */
1311
- const ListGoals = ({
1312
- goals
1313
- }) => {
1314
- return (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardList, {
1315
- title: "Goals",
1316
- items: goals,
1317
- renderItem: goal => (0,jsx_runtime_namespaceObject.jsx)(ListGoalsCard, {
1318
- image: goal.image,
1319
- title: goal.title,
1320
- details: goal.details,
1321
- progressProps: {
1322
- currentValue: goal.completion,
1323
- color: goal.color
1324
- }
1325
- })
1326
- });
1327
- };
1328
- ;// ./src/components/MealPlanner/MealPlannerBadge.tsx
1329
-
1330
- function MealPlannerBadge_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1331
-
1332
- const Marker = /*#__PURE__*/base_default()(core_namespaceObject.Badge, true ? {
1333
- target: "e12bwihj0"
1334
- } : 0)( true ? {
1335
- name: "1c9h7mo",
1336
- styles: "display:inline-block;padding:0;margin-right:5px;width:4px;height:4px"
1337
- } : 0);
1338
- /* harmony default export */ const MealPlannerBadge = (Marker);
1339
- ;// ./src/components/MealPlanner/MealPlannerLegends.tsx
1340
-
1341
- function MealPlannerLegends_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1342
- const MealPlannerLegends = {
1343
- List: /*#__PURE__*/base_default()("ul", true ? {
1344
- target: "e1yfjgtr1"
1345
- } : 0)( true ? {
1346
- name: "wmff3h",
1347
- styles: "display:flex;justify-content:space-between;list-style:none;width:100%;height:20px;padding:0;margin:0;margin-bottom:8px"
1348
- } : 0),
1349
- Item: /*#__PURE__*/base_default()("li", true ? {
1350
- target: "e1yfjgtr0"
1351
- } : 0)( true ? {
1352
- name: "s5xdrg",
1353
- styles: "display:flex;align-items:center"
1354
- } : 0)
1355
- };
1356
- /* harmony default export */ const MealPlanner_MealPlannerLegends = (MealPlannerLegends);
1357
- ;// ./src/components/MealPlanner/MealPlannerBars.tsx
1358
-
1359
- function MealPlannerBars_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1360
- const MealPlannerBars = /*#__PURE__*/base_default()("ul", true ? {
1361
- target: "e1obar840"
1362
- } : 0)( true ? {
1363
- name: "1bn6kyv",
1364
- styles: "display:flex;list-style:none;width:100%;height:20px;padding:0;margin:0;&>li:nth-of-type(2n):not(:last-child){margin:0 5px;}"
1365
- } : 0);
1366
- /* harmony default export */ const MealPlanner_MealPlannerBars = (MealPlannerBars);
1367
- ;// ./src/components/MealPlanner/MealPlannerCard.tsx
1368
- function MealPlannerCard_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1369
-
1370
-
1371
-
1372
-
1373
-
1374
-
1375
- const markerColor = {
1376
- carbs: 'yellow',
1377
- protein: 'green',
1378
- fat: 'blue'
1379
- };
1380
- var MealPlannerCard_ref = true ? {
1381
- name: "azty0s",
1382
- styles: "width:calc(100% - 64px);padding-left:15px"
1383
- } : 0;
1384
- var MealPlannerCard_ref2 = true ? {
1385
- name: "14aax6i",
1386
- styles: "margin-top:5.6px"
1387
- } : 0;
1388
- const MealPlannerCard = ({
1389
- name,
1390
- image,
1391
- carbs,
1392
- protein,
1393
- fat
1394
- }) => {
1395
- const listItems = {
1396
- carbs,
1397
- protein,
1398
- fat
1399
- };
1400
- return (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Wrapper, {
1401
- css: MealPlannerCard_ref2,
1402
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Avatar, {
1403
- size: 64,
1404
- image: image
1405
- }), (0,jsx_runtime_namespaceObject.jsxs)("div", {
1406
- css: MealPlannerCard_ref,
1407
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1408
- variant: "h6",
1409
- weight: "medium",
1410
- children: name
1411
- }), (0,jsx_runtime_namespaceObject.jsx)(MealPlanner_MealPlannerLegends.List, {
1412
- children: Object.keys(listItems).map(item => (0,jsx_runtime_namespaceObject.jsxs)(MealPlanner_MealPlannerLegends.Item, {
1413
- children: [(0,jsx_runtime_namespaceObject.jsx)(MealPlannerBadge, {
1414
- color: markerColor[item]
1415
- }), (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Typography, {
1416
- variant: "body1",
1417
- children: [listItems[item], "% ", item]
1418
- })]
1419
- }, item))
1420
- }), (0,jsx_runtime_namespaceObject.jsx)(MealPlanner_MealPlannerBars, {
1421
- children: Object.keys(listItems).map(item => (0,jsx_runtime_namespaceObject.jsx)("li", {
1422
- css: /*#__PURE__*/(0,react_namespaceObject.css)("width:", listItems[item], "%;" + ( true ? "" : 0), true ? "" : 0),
1423
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ProgressBar, {
1424
- percentage: 100,
1425
- color: markerColor[item]
1426
- })
1427
- }, item))
1428
- })]
1429
- })]
1430
- });
1431
- };
1432
- ;// ./src/components/MealPlanner/MealPlanner.tsx
1433
-
1434
- function MealPlanner_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1435
-
1436
-
1437
-
1438
-
1439
-
1440
- const CustomOption = /*#__PURE__*/base_default()(core_namespaceObject.DropdownOption, true ? {
1441
- target: "e1mo13t60"
1442
- } : 0)( true ? {
1443
- name: "dzdmk4",
1444
- styles: "text-align:left;line-height:18px;font-size:11px"
1445
- } : 0);
1446
- var MealPlanner_ref = true ? {
1447
- name: "17y49kf",
1448
- styles: "flex-direction:column;width:100%"
1449
- } : 0;
1450
- var MealPlanner_ref2 = true ? {
1451
- name: "as11ew",
1452
- styles: "line-height:normal"
1453
- } : 0;
1454
- const MealPlanner = ({
1455
- data
1456
- }) => {
1457
- const [selectedOption, setSelectedOption] = (0,external_react_namespaceObject.useState)(null);
1458
- const [options, setOptions] = (0,external_react_namespaceObject.useState)([]);
1459
- const handleChange = e => {
1460
- const value = e.value.toString().toLowerCase();
1461
- setSelectedOption(value);
1462
- };
1463
- (0,external_react_namespaceObject.useEffect)(() => {
1464
- if (data == null || typeof data !== 'object') {
1465
- return;
1466
- }
1467
- setOptions(Object.keys(data).map((item, index) => ({
1468
- id: index,
1469
- value: `${item.charAt(0).toUpperCase()}${item.slice(1)}`,
1470
- label: `${item.charAt(0).toUpperCase()}${item.slice(1)} | ${data[item].time}`,
1471
- extraVal: data[item].time
1472
- })));
1473
- }, [data]);
1474
- (0,external_react_namespaceObject.useEffect)(() => {
1475
- if (options?.length > 0 && selectedOption == null) {
1476
- handleChange(options[0]);
1477
- }
1478
- }, [options]);
1479
- return (0,jsx_runtime_namespaceObject.jsxs)("div", {
1480
- children: [(0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.CardHeader, {
1481
- transparent: true,
1482
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1483
- variant: "h4",
1484
- weight: "bold",
1485
- css: MealPlanner_ref2,
1486
- children: "Meal Planner"
1487
- }), options?.length > 0 && (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Dropdown, {
1488
- selectedItem: options[0],
1489
- onChange: handleChange,
1490
- children: options.map((item, index) => (0,jsx_runtime_namespaceObject.jsxs)(CustomOption, {
1491
- value: item.value,
1492
- label: item.label.toString(),
1493
- children: [(0,jsx_runtime_namespaceObject.jsx)("span", {
1494
- style: {
1495
- fontSize: 13,
1496
- fontWeight: 500
1497
- },
1498
- children: item.value
1499
- }), "\xA0|\xA0", (0,jsx_runtime_namespaceObject.jsx)("span", {
1500
- style: {
1501
- fontSize: 11,
1502
- fontWeight: 500
1503
- },
1504
- children: item.extraVal
1505
- })]
1506
- }, index))
1507
- })]
1508
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Card, {
1509
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardContent, {
1510
- css: MealPlanner_ref,
1511
- children: selectedOption && data[selectedOption].data.map(({
1512
- id,
1513
- ...props
1514
- }) => (0,jsx_runtime_namespaceObject.jsx)(MealPlannerCard, {
1515
- ...props
1516
- }, id))
1517
- })
1518
- })]
1519
- });
1520
- };
1521
- ;// ./src/components/StepsCounter/StepsCounter.tsx
1522
- function StepsCounter_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1523
-
1524
-
1525
-
1526
- var StepsCounter_ref = true ? {
1527
- name: "1rcnabe",
1528
- styles: "width:100%;margin:10px 0"
1529
- } : 0;
1530
- var StepsCounter_ref2 = true ? {
1531
- name: "192owum",
1532
- styles: "font-size:33px;font-weight:bold"
1533
- } : 0;
1534
- var StepsCounter_ref3 = true ? {
1535
- name: "1paxtit",
1536
- styles: "box-shadow:0 10px 40px rgba(42, 48, 57, 0.08);border-radius:20px"
1537
- } : 0;
1538
- /**
1539
- *
1540
- * UI Component with a Card that shows the steps count of the user
1541
- */
1542
- const StepsCounter = ({
1543
- max,
1544
- currentValue
1545
- }) => {
1546
- const theme = (0,react_namespaceObject.useTheme)();
1547
- const percentage = Math.round(currentValue / max * 100);
1548
- return (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Card, {
1549
- css: StepsCounter_ref3,
1550
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardHeader, {
1551
- icon: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ResponsiveImage, {
1552
- css: /*#__PURE__*/(0,react_namespaceObject.css)({
1553
- filter: `drop-shadow(0 5px 5px ${theme.colors.grey})`
1554
- }, true ? "" : 0, true ? "" : 0),
1555
- srcSet: "https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fsteps%2Fsteps_64.png?alt=media&token=22d59e48-da19-448a-98e3-25f396108243 64w, https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fsteps%2Fsteps_48.png?alt=media&token=7c66d777-ddad-416a-9f07-a89dd3167ca7 48w",
1556
- sizes: "(min-width: 1440px) 64px, 48px",
1557
- src: "https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fsteps%2Fsteps_48.png?alt=media&token=7c66d777-ddad-416a-9f07-a89dd3167ca7",
1558
- alt: "Steps"
1559
- }),
1560
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1561
- variant: "h6",
1562
- weight: "bold",
1563
- children: "Steps"
1564
- })
1565
- }), (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.CardContent, {
1566
- style: {
1567
- flexWrap: 'wrap'
1568
- },
1569
- children: [(0,jsx_runtime_namespaceObject.jsxs)("div", {
1570
- children: [(0,jsx_runtime_namespaceObject.jsx)("span", {
1571
- css: StepsCounter_ref2,
1572
- children: currentValue
1573
- }), (0,jsx_runtime_namespaceObject.jsx)("span", {
1574
- children: "Steps"
1575
- })]
1576
- }), (0,jsx_runtime_namespaceObject.jsx)("div", {
1577
- css: StepsCounter_ref,
1578
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.ProgressBar, {
1579
- percentage: percentage,
1580
- color: "green"
1581
- })
1582
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1583
- variant: "body1",
1584
- css: /*#__PURE__*/(0,react_namespaceObject.css)("color:", theme.colors.greyDarker60, ";" + ( true ? "" : 0), true ? "" : 0),
1585
- children: !Number.isNaN(percentage) && `${percentage}% of your goals`
1586
- })]
1587
- })]
1588
- });
1589
- };
1590
- ;// ./src/components/UserCard/UserCardItem.tsx
1591
- function UserCardItem_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1592
-
1593
-
1594
-
1595
- const cardShadow = theme => /*#__PURE__*/(0,react_namespaceObject.css)("display:flex;width:92px;height:68px;align-items:center;flex-flow:column;justify-content:center;background:", theme.colors.white, ";border-radius:16px;box-shadow:0 10px 40px rgba(42, 48, 57, 0.08);" + ( true ? "" : 0), true ? "" : 0);
1596
- var UserCardItem_ref = true ? {
1597
- name: "1sw7psn",
1598
- styles: "align-items:baseline;justify-content:center"
1599
- } : 0;
1600
- const UserCardItem = ({
1601
- value,
1602
- unit,
1603
- caption
1604
- }) => (0,jsx_runtime_namespaceObject.jsxs)("div", {
1605
- css: cardShadow,
1606
- children: [(0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Wrapper, {
1607
- css: UserCardItem_ref,
1608
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1609
- variant: "h4",
1610
- weight: "bold",
1611
- children: value
1612
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1613
- variant: "subtitle",
1614
- children: unit
1615
- })]
1616
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1617
- variant: "subtitle",
1618
- children: caption
1619
- })]
1620
- });
1621
- /* harmony default export */ const UserCard_UserCardItem = (UserCardItem);
1622
- ;// ./src/components/UserCard/UserCardBMI.tsx
1623
- function UserCardBMI_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1624
-
1625
-
1626
-
1627
- const listCards = true ? {
1628
- name: "d346af",
1629
- styles: "display:flex;justify-content:space-between;list-style:none;padding:0;li{max-width:92px;}"
1630
- } : 0;
1631
- const UserCardBMI = ({
1632
- weight,
1633
- height,
1634
- age
1635
- }) => (0,jsx_runtime_namespaceObject.jsxs)("ul", {
1636
- css: listCards,
1637
- children: [(0,jsx_runtime_namespaceObject.jsx)("li", {
1638
- children: (0,jsx_runtime_namespaceObject.jsx)(UserCard_UserCardItem, {
1639
- value: weight || '',
1640
- unit: "kg",
1641
- caption: "Weight"
1642
- })
1643
- }), (0,jsx_runtime_namespaceObject.jsx)("li", {
1644
- children: (0,jsx_runtime_namespaceObject.jsx)(UserCard_UserCardItem, {
1645
- value: height || '',
1646
- unit: "cm",
1647
- caption: "Height"
1648
- })
1649
- }), (0,jsx_runtime_namespaceObject.jsx)("li", {
1650
- children: (0,jsx_runtime_namespaceObject.jsx)(UserCard_UserCardItem, {
1651
- value: age || '',
1652
- unit: "yrs",
1653
- caption: "Age"
1654
- })
1655
- })]
1656
- });
1657
- /* harmony default export */ const UserCard_UserCardBMI = (UserCardBMI);
1658
- ;// ./src/components/UserCard/UserCardCredentials.tsx
1659
- function UserCardCredentials_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1660
-
1661
-
1662
-
1663
- const UserCardCredentials_container = theme => /*#__PURE__*/(0,react_namespaceObject.css)("display:flex;align-items:center;button{display:none;}", theme.mediaQueries.lg, "{justify-content:space-between;button{display:block;}}" + ( true ? "" : 0), true ? "" : 0);
1664
- var UserCardCredentials_ref = true ? {
1665
- name: "3u6yym",
1666
- styles: "padding-inline:15px"
1667
- } : 0;
1668
- var UserCardCredentials_ref2 = true ? {
1669
- name: "s5xdrg",
1670
- styles: "display:flex;align-items:center"
1671
- } : 0;
1672
- const UserCardCredentials = ({
1673
- name,
1674
- email
1675
- }) => (0,jsx_runtime_namespaceObject.jsxs)("div", {
1676
- css: UserCardCredentials_container,
1677
- children: [(0,jsx_runtime_namespaceObject.jsxs)("div", {
1678
- css: UserCardCredentials_ref2,
1679
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Avatar, {
1680
- size: 42,
1681
- image: 'https://firebasestorage.googleapis.com/v0/b/admin-themes.appspot.com/o/img%2Fface%2Fface_46.png?alt=media&token=aaa3a75c-4779-4887-b011-352f8dd6c214'
1682
- }), (0,jsx_runtime_namespaceObject.jsxs)("div", {
1683
- css: UserCardCredentials_ref,
1684
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1685
- variant: "subtitle",
1686
- children: name
1687
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1688
- variant: "body1",
1689
- children: email
1690
- })]
1691
- })]
1692
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Button, {
1693
- variant: "tertiary",
1694
- size: "large",
1695
- endIcon: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Icon, {
1696
- name: "notification"
1697
- })
1698
- })]
1699
- });
1700
- /* harmony default export */ const UserCard_UserCardCredentials = (UserCardCredentials);
1701
- ;// ./src/components/UserCard/UserCard.tsx
1702
- function UserCard_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1703
-
1704
-
1705
-
1706
-
1707
-
1708
-
1709
- const UserCard_container = theme => /*#__PURE__*/(0,react_namespaceObject.css)("display:grid;grid-template-columns:50px auto;align-items:center;", theme.mediaQueries.lg, "{grid-template-columns:auto;}" + ( true ? "" : 0), true ? "" : 0);
1710
- var UserCard_ref = true ? {
1711
- name: "e0dnmk",
1712
- styles: "cursor:pointer"
1713
- } : 0;
1714
- const UserCard = ({
1715
- user
1716
- }) => (0,jsx_runtime_namespaceObject.jsxs)(external_react_namespaceObject.Fragment, {
1717
- children: [(0,jsx_runtime_namespaceObject.jsxs)("div", {
1718
- css: UserCard_container,
1719
- children: [(0,jsx_runtime_namespaceObject.jsx)("div", {
1720
- css: theme => /*#__PURE__*/(0,react_namespaceObject.css)(theme.mediaQueries.lg, "{display:none;}" + ( true ? "" : 0), true ? "" : 0),
1721
- children: (0,jsx_runtime_namespaceObject.jsx)("label", {
1722
- htmlFor: "aside",
1723
- css: UserCard_ref,
1724
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Icon, {
1725
- name: "carrot-left",
1726
- size: 16
1727
- })
1728
- })
1729
- }), (0,jsx_runtime_namespaceObject.jsx)(UserCard_UserCardCredentials, {
1730
- name: user?.name,
1731
- email: user?.email
1732
- })]
1733
- }), (0,jsx_runtime_namespaceObject.jsx)(UserCard_UserCardBMI, {
1734
- weight: user?.weight,
1735
- height: user?.height,
1736
- age: user?.age
1737
- })]
1738
- });
1739
- /* harmony default export */ const UserCard_UserCard = (UserCard);
1740
- ;// ./src/components/TradingInfoCard/TradingInfoCardContent.tsx
1741
- function TradingInfoCardContent_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1742
-
1743
-
1744
-
1745
- var TradingInfoCardContent_ref = true ? {
1746
- name: "1ytt2st",
1747
- styles: "justify-content:flex-start;align-items:baseline;gap:2px"
1748
- } : 0;
1749
- var TradingInfoCardContent_ref2 = true ? {
1750
- name: "xutw8p",
1751
- styles: "display:flex;align-self:center;margin-left:3px"
1752
- } : 0;
1753
- const TradingInfoCardContent = ({
1754
- value,
1755
- unit,
1756
- icon
1757
- }) => {
1758
- const theme = (0,react_namespaceObject.useTheme)();
1759
- return (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.CardContent, {
1760
- css: TradingInfoCardContent_ref,
1761
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1762
- variant: "h5",
1763
- weight: "bold",
1764
- color: theme.colors.greyDarker,
1765
- children: value
1766
- }), unit ? (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1767
- "data-testid": "unit",
1768
- variant: "h6",
1769
- weight: "lighter",
1770
- children: unit
1771
- }) : null, icon ? (0,jsx_runtime_namespaceObject.jsx)("div", {
1772
- css: TradingInfoCardContent_ref2,
1773
- children: icon
1774
- }) : null]
1775
- });
1776
- };
1777
- /* harmony default export */ const TradingInfoCard_TradingInfoCardContent = (TradingInfoCardContent);
1778
- ;// ./src/components/TradingInfoCard/TradingInfoCardTooltip.tsx
1779
- function TradingInfoCardTooltip_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1780
-
1781
-
1782
-
1783
- var TradingInfoCardTooltip_ref = true ? {
1784
- name: "rnnx2x",
1785
- styles: "font-size:12px"
1786
- } : 0;
1787
- const TradingInfoCardTooltip = ({
1788
- trigger,
1789
- children
1790
- }) => {
1791
- const theme = (0,react_namespaceObject.useTheme)();
1792
- return (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Tooltip, {
1793
- offsetOptions: 0,
1794
- enableHover: true,
1795
- enableClick: false,
1796
- arrowProps: {
1797
- width: 18,
1798
- height: 3,
1799
- fill: theme.colors.greyGraphite
1800
- },
1801
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.TooltipTrigger, {
1802
- children: (0,jsx_runtime_namespaceObject.jsx)("div", {
1803
- "data-testid": "tooltip-trigger",
1804
- children: trigger
1805
- })
1806
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.TooltipContent, {
1807
- css: /*#__PURE__*/(0,react_namespaceObject.css)("padding:4px 5px;border-radius:2px;background:", theme.colors.greyGraphite, ";svg{margin-bottom:-1px;}" + ( true ? "" : 0), true ? "" : 0),
1808
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1809
- css: TradingInfoCardTooltip_ref,
1810
- color: theme.colors.white,
1811
- children: children
1812
- })
1813
- })]
1814
- });
1815
- };
1816
- /* harmony default export */ const TradingInfoCard_TradingInfoCardTooltip = (TradingInfoCardTooltip);
1817
- ;// external "react-router-dom"
1818
- const external_react_router_dom_namespaceObject = require("react-router-dom");
1819
- ;// ./src/components/TradingInfoCard/TradingInfoCardWrapper.tsx
1820
-
1821
-
1822
-
1823
-
1824
-
1825
- const InfoCardWrapper = /*#__PURE__*/base_default()("div", true ? {
1826
- target: "e1szz7490"
1827
- } : 0)("position:relative;display:flex;flex-direction:column;align-items:flex-start;width:max-content;min-width:100%;background:", ({
1828
- theme
1829
- }) => theme.colors.greyLighter, ";padding:4px 10px;border-radius:6px;text-decoration:none;cursor:", ({
1830
- onClick
1831
- }) => onClick ? 'pointer' : 'default', ";white-space:nowrap;box-shadow:none;user-select:", ({
1832
- onClick
1833
- }) => onClick ? 'none' : 'auto', ";&::before{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;box-shadow:0 10px 40px 0 ", ({
1834
- theme
1835
- }) => theme.colors.greyShadow, ";content:'';}&:active{background:", ({
1836
- theme
1837
- }) => theme.colors.white, ";&::before{border-radius:6px;box-shadow:0 10px 40px 0 ", ({
1838
- theme
1839
- }) => theme.colors.greyShadow24, ";}}" + ( true ? "" : 0));
1840
- const TradingInfoCardWrapper = ({
1841
- onClick,
1842
- link,
1843
- children
1844
- }) => {
1845
- return (0,jsx_runtime_namespaceObject.jsx)((external_react_default()).Fragment, {
1846
- children: link ? (0,jsx_runtime_namespaceObject.jsx)(InfoCardWrapper, {
1847
- as: external_react_router_dom_namespaceObject.Link,
1848
- to: link,
1849
- children: children
1850
- }) : (0,jsx_runtime_namespaceObject.jsx)(InfoCardWrapper, {
1851
- as: core_namespaceObject.CardBase,
1852
- role: onClick ? 'button' : 'region',
1853
- tabIndex: onClick ? 0 : -1,
1854
- onClick: onClick,
1855
- children: children
1856
- })
1857
- });
1858
- };
1859
- /* harmony default export */ const TradingInfoCard_TradingInfoCardWrapper = (TradingInfoCardWrapper);
1860
- ;// ./src/components/TradingInfoCard/TradingInfoCard.tsx
1861
- function TradingInfoCard_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1862
-
1863
-
1864
-
1865
-
1866
-
1867
- var TradingInfoCard_ref = true ? {
1868
- name: "rnnx2x",
1869
- styles: "font-size:12px"
1870
- } : 0;
1871
- const TradingInfoCardView = ({
1872
- value,
1873
- unit,
1874
- title,
1875
- icon,
1876
- link,
1877
- onClick
1878
- }) => {
1879
- const number = Number(value);
1880
- const currentValue = Number.isNaN(number) ? value : number.toFixed(1).includes('.0') ? Math.floor(number) : number.toFixed(1);
1881
- return (0,jsx_runtime_namespaceObject.jsxs)(TradingInfoCard_TradingInfoCardWrapper, {
1882
- onClick: onClick,
1883
- link: link,
1884
- children: [(0,jsx_runtime_namespaceObject.jsx)(TradingInfoCard_TradingInfoCardContent, {
1885
- value: currentValue,
1886
- unit: unit,
1887
- icon: icon
1888
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardContent, {
1889
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
1890
- css: TradingInfoCard_ref,
1891
- children: title
1892
- })
1893
- })]
1894
- });
1895
- };
1896
- const TradingInfoCard = props => {
1897
- const {
1898
- value,
1899
- unit
1900
- } = props;
1901
- const number = Number(value);
1902
- const isInteger = Number.isInteger(number);
1903
- if (isInteger || Number.isNaN(number)) {
1904
- return (0,jsx_runtime_namespaceObject.jsx)(TradingInfoCardView, {
1905
- ...props
1906
- });
1907
- } else {
1908
- return (0,jsx_runtime_namespaceObject.jsxs)(TradingInfoCard_TradingInfoCardTooltip, {
1909
- trigger: (0,jsx_runtime_namespaceObject.jsx)(TradingInfoCardView, {
1910
- ...props
1911
- }),
1912
- children: [value, " ", unit]
1913
- });
1914
- }
1915
- };
1916
- /* harmony default export */ const TradingInfoCard_TradingInfoCard = (TradingInfoCard);
1917
- ;// ./src/components/TradingInfoCard/index.ts
1918
-
1919
-
1920
-
1921
- ;// ./src/components/TradingScoreboard/TradingScoreboardBase.tsx
1922
-
1923
- const TradingScoreboardBase = /*#__PURE__*/base_default()("div", true ? {
1924
- target: "e1xdy4lf0"
1925
- } : 0)("display:grid;gap:5px;grid-auto-flow:column;overflow:auto;", ({
1926
- theme
1927
- }) => theme.mediaQueries.md, "{grid-template-columns:", ({
1928
- itemsPerRow
1929
- }) => itemsPerRow && `repeat(${itemsPerRow}, 1fr)`, ";grid-auto-flow:inherit;overflow:inherit;}" + ( true ? "" : 0));
1930
- /* harmony default export */ const TradingScoreboard_TradingScoreboardBase = (TradingScoreboardBase);
1931
- ;// ./src/components/TradingScoreboard/TradingScoreboard.tsx
1932
-
1933
-
1934
-
1935
- const TradingScoreboard = ({
1936
- items,
1937
- onClick,
1938
- renderCard,
1939
- ...props
1940
- }) => {
1941
- return (0,jsx_runtime_namespaceObject.jsx)("div", {
1942
- children: (0,jsx_runtime_namespaceObject.jsx)(TradingScoreboard_TradingScoreboardBase, {
1943
- ...props,
1944
- children: items.map((item, index) => {
1945
- return (0,jsx_runtime_namespaceObject.jsx)("div", {
1946
- children: typeof renderCard === 'function' ? renderCard(item, onClick) : (0,jsx_runtime_namespaceObject.jsx)(TradingInfoCard_TradingInfoCard, {
1947
- value: item.value,
1948
- unit: item.unit,
1949
- title: item.title,
1950
- icon: item.icon,
1951
- link: item.link,
1952
- onClick: () => {
1953
- if (typeof onClick === 'function') {
1954
- onClick(item);
1955
- }
1956
- }
1957
- })
1958
- }, index);
1959
- })
1960
- })
1961
- });
1962
- };
1963
- /* harmony default export */ const TradingScoreboard_TradingScoreboard = (TradingScoreboard);
1964
- ;// ./src/components/TradingScoreboard/index.ts
1965
-
1966
-
1967
- ;// external "@emotion/css"
1968
- const css_namespaceObject = require("@emotion/css");
1969
- ;// ./src/components/AccountBalance/AccountBalanceContext.tsx
1970
-
1971
-
1972
- const AccountBalanceContext = /*#__PURE__*/(0,external_react_namespaceObject.createContext)({
1973
- activeHighlight: false,
1974
- fullscreenModeFeature: false,
1975
- total: 0,
1976
- currency: ''
1977
- });
1978
- const AccountBalanceProvider = ({
1979
- children,
1980
- ...rest
1981
- }) => (0,jsx_runtime_namespaceObject.jsx)(AccountBalanceContext.Provider, {
1982
- value: {
1983
- ...rest
1984
- },
1985
- children: children
1986
- });
1987
- const useAccountBalanceContext = () => {
1988
- return (0,external_react_namespaceObject.useContext)(AccountBalanceContext);
1989
- };
1990
- ;// ./src/components/AccountBalance/BalancePieChartTitle.tsx
1991
- function BalancePieChartTitle_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
1992
-
1993
-
1994
-
1995
-
1996
- var BalancePieChartTitle_ref = true ? {
1997
- name: "11zwg70",
1998
- styles: "font-size:18px;margin-left:10px"
1999
- } : 0;
2000
- var BalancePieChartTitle_ref2 = true ? {
2001
- name: "16sblm7",
2002
- styles: "font-size:12px;padding:0 14px;line-height:1"
2003
- } : 0;
2004
- var BalancePieChartTitle_ref3 = true ? {
2005
- name: "g0i0lq",
2006
- styles: "font-size:24px!important;font-weight:500"
2007
- } : 0;
2008
- var BalancePieChartTitle_ref4 = true ? {
2009
- name: "kra4qs",
2010
- styles: "padding:3px 0"
2011
- } : 0;
2012
- const BalancePieChartTitle = () => {
2013
- const theme = (0,react_namespaceObject.useTheme)();
2014
- const {
2015
- isFullscreenMode
2016
- } = (0,core_namespaceObject.useFullscreenMode)();
2017
- const {
2018
- tooltip,
2019
- total,
2020
- currency
2021
- } = useAccountBalanceContext();
2022
- return (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Tooltip, {
2023
- enableHover: true,
2024
- enableClick: true,
2025
- ...tooltip?.config,
2026
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.TooltipTrigger, {
2027
- className: tooltip?.classNames?.trigger,
2028
- children: (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Typography, {
2029
- variant: "body2",
2030
- weight: "bold",
2031
- color: theme.colors.greyDarker,
2032
- css: isFullscreenMode ? BalancePieChartTitle_ref3 : BalancePieChartTitle_ref2,
2033
- children: [total, (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
2034
- variant: "body2",
2035
- weight: "regular",
2036
- as: "span",
2037
- color: theme.colors.greyDarker80,
2038
- css: isFullscreenMode ? BalancePieChartTitle_ref : /*#__PURE__*/(0,react_namespaceObject.css)("display:block;font-size:12px;", theme.mediaQueries.md, "{font-size:13px;}", theme.mediaQueries.lg, "{font-size:14px;}line-height:25px;" + ( true ? "" : 0), true ? "" : 0),
2039
- children: currency
2040
- })]
2041
- })
2042
- }), tooltip?.content && (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.TooltipContent, {
2043
- css: BalancePieChartTitle_ref4,
2044
- className: tooltip?.classNames?.content,
2045
- children: tooltip.content
2046
- })]
2047
- });
2048
- };
2049
- ;// ./src/components/AccountBalance/BalancePieChart.tsx
2050
- function BalancePieChart_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2051
-
2052
-
2053
-
2054
-
2055
-
2056
-
2057
- var BalancePieChart_ref = true ? {
2058
- name: "1f1533z",
2059
- styles: "width:10px;height:10px;margin-right:5px"
2060
- } : 0;
2061
- const BalancePieChart = (0,react_namespaceObject.withTheme)(({
2062
- data,
2063
- theme,
2064
- chartColorPalette,
2065
- legendColorPalette,
2066
- pieChartProps = {},
2067
- activeHighlight = false,
2068
- onFullscreenModeChange
2069
- }) => {
2070
- const {
2071
- variant = 'valueList',
2072
- fullscreenModeFeature,
2073
- currency
2074
- } = useAccountBalanceContext();
2075
- const [isFullscreenMode, setFullscreenMode] = (0,external_react_namespaceObject.useState)(false);
2076
- const {
2077
- legendColorNames,
2078
- pieChartColors
2079
- } = core_namespaceObject.pieChartPalettes.getBalancePalette(theme);
2080
- const featuresList = new Set();
2081
- const filteredIndexes = [];
2082
- const chartData = data?.filter((item, index) => {
2083
- const isSaved = item.value !== 0;
2084
- if (!isSaved) {
2085
- filteredIndexes.push(index);
2086
- }
2087
- return isSaved;
2088
- });
2089
- const chartColors = (chartColorPalette || pieChartColors).filter((item, index) => !filteredIndexes.includes(index));
2090
- if (chartColors.length < chartData.length) {
2091
- for (let i = 0; i < chartData.length - chartColors.length; i++) {
2092
- chartColors.push(core_namespaceObject.mainTheme.colors.purpleLighter);
2093
- }
2094
- }
2095
- if (Object.keys(pieChartProps.cardProps || {}).length) {
2096
- featuresList.add('header');
2097
- }
2098
- if (fullscreenModeFeature) {
2099
- featuresList.add('header');
2100
- featuresList.add('fullscreenMode');
2101
- }
2102
- const handleFullscreenModeChange = pieChartFullscreenMode => {
2103
- setFullscreenMode(pieChartFullscreenMode);
2104
- onFullscreenModeChange?.(pieChartFullscreenMode);
2105
- };
2106
- return (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.PieChart, {
2107
- data: chartData,
2108
- features: Array.from(featuresList),
2109
- colors: chartColors,
2110
- onFullscreenModeChange: handleFullscreenModeChange,
2111
- animate: false,
2112
- title: (0,jsx_runtime_namespaceObject.jsx)(BalancePieChartTitle, {}),
2113
- css: !isFullscreenMode && /*#__PURE__*/(0,react_namespaceObject.css)("div:nth-of-type(1){width:100px;height:100px;}", theme.mediaQueries.lg, "{div:nth-of-type(1){width:120px;height:120px;}}" + ( true ? "" : 0), true ? "" : 0),
2114
- width: '100%',
2115
- ...pieChartProps,
2116
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.PieChartLegend, {
2117
- data: data,
2118
- colors: legendColorPalette || legendColorNames,
2119
- variant: variant,
2120
- currency: currency,
2121
- activeHighlight: activeHighlight,
2122
- markerStyles: BalancePieChart_ref,
2123
- labelListStyles: /*#__PURE__*/(0,react_namespaceObject.css)("gap:0;li{height:22.5px;}h6{font-weight:700;line-height:22.5px;font-size:", !isFullscreenMode && '12px', ";", theme.mediaQueries.md, "{font-size:", !isFullscreenMode && '13px', ";}", theme.mediaQueries.lg, "{font-size:", !isFullscreenMode && '14px', ";}}" + ( true ? "" : 0), true ? "" : 0),
2124
- valueListStyles: /*#__PURE__*/(0,react_namespaceObject.css)("gap:0;li{height:22.5px;}h6{line-height:22.5px;color:", theme.colors.greyDarker80, ";font-size:", isFullscreenMode ? '12px' : '11px', ";", theme.mediaQueries.lg, "{font-size:12px;}}" + ( true ? "" : 0), true ? "" : 0),
2125
- renderValue: ({
2126
- id,
2127
- legendValue
2128
- }) => id === 'Other' ? legendValue + ' ' + currency : legendValue + ' ' + id
2129
- })
2130
- });
2131
- });
2132
- ;// ./src/components/AccountBalance/AccountBalance.tsx
2133
-
2134
-
2135
-
2136
-
2137
-
2138
-
2139
-
2140
- const AccountBalance = ({
2141
- title = 'Balance',
2142
- className,
2143
- onClick,
2144
- link,
2145
- variant = 'valueList',
2146
- fullscreenModeFeature = false,
2147
- activeHighlight = true,
2148
- widgetMaxWidth = '280px',
2149
- tooltip = {},
2150
- total,
2151
- currency,
2152
- ...props
2153
- }) => {
2154
- const theme = (0,react_namespaceObject.useTheme)();
2155
- const [isFullscreenMode, setIsFullscreenMode] = (0,external_react_namespaceObject.useState)(false);
2156
- return (0,jsx_runtime_namespaceObject.jsx)(AccountBalanceProvider, {
2157
- activeHighlight: activeHighlight,
2158
- fullscreenModeFeature: fullscreenModeFeature,
2159
- tooltip: tooltip,
2160
- variant: variant,
2161
- total: total,
2162
- title: title,
2163
- currency: currency,
2164
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.WithLink, {
2165
- link: link,
2166
- onClick: onClick,
2167
- children: (0,jsx_runtime_namespaceObject.jsx)(BalancePieChart, {
2168
- theme: theme,
2169
- onFullscreenModeChange: setIsFullscreenMode,
2170
- pieChartProps: {
2171
- width: '100%',
2172
- cardProps: {
2173
- title,
2174
- className: [/*#__PURE__*/(0,css_namespaceObject.css)("&>div:last-of-type{max-width:", isFullscreenMode ? '100%' : widgetMaxWidth, ";}& .pie-chart-wrapper>div:last-of-type{pointer-events:", tooltip?.content ? 'auto' : 'none', ";}" + ( true ? "" : 0), true ? "" : 0), className].join(' '),
2175
- headerClassName: /*#__PURE__*/(0,css_namespaceObject.css)([{
2176
- fontSize: 11
2177
- }], true ? "" : 0, true ? "" : 0),
2178
- contentClassName: /*#__PURE__*/(0,css_namespaceObject.css)([{
2179
- [theme.mediaQueries.md]: {
2180
- alignItems: 'center !important'
2181
- }
2182
- }], true ? "" : 0, true ? "" : 0)
2183
- }
2184
- },
2185
- ...props
2186
- })
2187
- })
2188
- });
2189
- };
2190
- ;// ./src/components/AccountBalance/index.ts
2191
-
2192
-
2193
-
2194
-
2195
- ;// ./src/components/ExchangeAccount/styles.ts
2196
- function ExchangeAccount_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2197
-
2198
- const CardBase = ({
2199
- disabled
2200
- }) => theme => /*#__PURE__*/(0,react_namespaceObject.css)("padding:0;border-radius:20px;box-shadow:0px 10px 40px 0px ", theme.colors.greyShadow, ";transition:0.3s;&:hover{", !disabled && `box-shadow: 0px 10px 40px 0px ${theme.colors.greyShadowHover};`, ";}" + ( true ? "" : 0), true ? "" : 0);
2201
- const CardHeader = theme => /*#__PURE__*/(0,react_namespaceObject.css)("display:flex;justify-content:start;width:100%;padding:10px;border-radius:20px 20px 0 0;background:", theme.colors.greyLighter, ";margin-bottom:0;", theme.mediaQueries.md, "{h6{font-size:16px;line-height:24px;}}", theme.mediaQueries.xs, "{padding:6px 10px;}" + ( true ? "" : 0), true ? "" : 0);
2202
- const RemoveButton = theme => /*#__PURE__*/(0,react_namespaceObject.css)("height:auto;padding:0;background:none;box-shadow:none;margin-left:auto;&:hover,&:focus{background:none;box-shadow:none;}&:hover{svg path{fill:", theme.colors.greyDarker, ";}}" + ( true ? "" : 0), true ? "" : 0);
2203
- const Platform = true ? {
2204
- name: "75whpw",
2205
- styles: "display:flex;align-items:center;gap:9px;margin-right:13px"
2206
- } : 0;
2207
- const Status = theme => /*#__PURE__*/(0,react_namespaceObject.css)("width:100%;text-align:center;padding:4px;&.active{color:", theme.colors.greenDark, ";background:", theme.colors.greenMint, ";}&.not-available{color:", theme.colors.red, ";background:", theme.colors.redLighter40, ";}", theme.mediaQueries.md, "{font-size:14px;line-height:17px;}" + ( true ? "" : 0), true ? "" : 0);
2208
- const CardContent = theme => /*#__PURE__*/(0,react_namespaceObject.css)("width:100%;padding:10px 20px;&>div{flex-direction:row;}ul:last-child{li{justify-content:flex-end;text-align:right;}}", theme.mediaQueries.sm, "{&>div{justify-content:space-around;}}", theme.mediaQueries.md, "{justify-content:space-around;&>div{flex-direction:column;}}", theme.mediaQueries.lg, "{&>div{flex-direction:row;}}" + ( true ? "" : 0), true ? "" : 0);
2209
- ;// external "@ssa-ui-kit/hooks"
2210
- const hooks_namespaceObject = require("@ssa-ui-kit/hooks");
2211
- ;// ./src/components/ExchangeAccount/components/ExchangeAccountProvider.tsx
2212
-
2213
- const [ExchangeAccountProvider, useExchangeAccountContext] = (0,hooks_namespaceObject.createSafeContext)('useExchangeAccount must be used within a ExchangeAccountProvider');
2214
- ;// ./src/components/ExchangeAccount/components/ExchangeAccountHeader.tsx
2215
-
2216
-
2217
-
2218
-
2219
-
2220
- const ExchangeAccountHeader = ({
2221
- children
2222
- }) => {
2223
- const theme = (0,react_namespaceObject.useTheme)();
2224
- const {
2225
- disabled,
2226
- onDelete
2227
- } = useExchangeAccountContext();
2228
- const handleClickDelete = event => {
2229
- event.preventDefault();
2230
- event.stopPropagation();
2231
- onDelete?.();
2232
- };
2233
- return (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.CardHeader, {
2234
- css: CardHeader,
2235
- children: [children, !disabled && onDelete && (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Button, {
2236
- css: RemoveButton,
2237
- onClick: e => handleClickDelete(e),
2238
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Icon, {
2239
- name: "bin",
2240
- color: theme.colors.greyDropdownFocused,
2241
- size: 20
2242
- })
2243
- })]
2244
- });
2245
- };
2246
- ;// ./src/components/ExchangeAccount/components/ExchangeAccountStatus.tsx
2247
-
2248
-
2249
-
2250
-
2251
- const ExchangeAccountStatus = ({
2252
- isActive,
2253
- children
2254
- }) => {
2255
- const {
2256
- status
2257
- } = useExchangeAccountContext();
2258
- const _isActive = isActive ?? status === 'Active';
2259
- let _children = typeof children === 'function' ? children(status) : children;
2260
- const statusStr = _isActive ? 'Active' : 'Not available';
2261
- _children = _children ?? statusStr;
2262
- if (!_children) {
2263
- return;
2264
- }
2265
- return (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
2266
- css: Status,
2267
- className: _isActive ? 'active' : 'not-available',
2268
- variant: "body1",
2269
- weight: "regular",
2270
- children: _children
2271
- });
2272
- };
2273
- ;// ./src/components/ExchangeAccount/components/ExchangeAccountContent.tsx
2274
-
2275
-
2276
-
2277
-
2278
-
2279
-
2280
-
2281
-
2282
- const ExchangeAccountContent = ({
2283
- pieChartProps,
2284
- ...cardProps
2285
- }) => {
2286
- const theme = (0,react_namespaceObject.useTheme)();
2287
- const {
2288
- data,
2289
- pieChartProps: contextPieChartProps,
2290
- title
2291
- } = useExchangeAccountContext();
2292
- return (0,jsx_runtime_namespaceObject.jsx)(AccountBalanceProvider, {
2293
- activeHighlight: pieChartProps?.activeHighlight,
2294
- fullscreenModeFeature: false,
2295
- tooltip: data.tooltip,
2296
- variant: data.variant,
2297
- total: data.total,
2298
- title: title,
2299
- currency: data.currency,
2300
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardContent, {
2301
- css: CardContent,
2302
- direction: "column",
2303
- ...cardProps,
2304
- children: (0,jsx_runtime_namespaceObject.jsx)(BalancePieChart, {
2305
- theme: theme,
2306
- pieChartProps: {
2307
- className: /*#__PURE__*/(0,css_namespaceObject.css)(theme.mediaQueries.md, "{flex-direction:row;}", theme.mediaQueries.lg, "{flex-direction:column;}" + ( true ? "" : 0), true ? "" : 0),
2308
- ...contextPieChartProps,
2309
- ...pieChartProps
2310
- },
2311
- ...data
2312
- })
2313
- })
2314
- });
2315
- };
2316
- ;// ./src/components/ExchangeAccount/components/ExchangeAccountPlatform.tsx
2317
-
2318
-
2319
-
2320
-
2321
-
2322
- const ExchangeAccountPlatform = ({
2323
- children,
2324
- ...props
2325
- }) => {
2326
- const theme = (0,react_namespaceObject.useTheme)();
2327
- const {
2328
- platform
2329
- } = useExchangeAccountContext();
2330
- return (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
2331
- variant: "subtitle",
2332
- weight: "bold",
2333
- color: theme.colors.greyDarker,
2334
- css: Platform,
2335
- ...props,
2336
- children: children ?? platform
2337
- });
2338
- };
2339
- ;// ./src/components/ExchangeAccount/components/ExchangeAccountTitle.tsx
2340
-
2341
-
2342
-
2343
-
2344
- const ExchangeAccountTitle = ({
2345
- children,
2346
- ...props
2347
- }) => {
2348
- const theme = (0,react_namespaceObject.useTheme)();
2349
- const {
2350
- title
2351
- } = useExchangeAccountContext();
2352
- return (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
2353
- color: theme.colors.greyDropdownFocused,
2354
- variant: "subtitle",
2355
- weight: "regular",
2356
- ...props,
2357
- children: children ?? title
2358
- });
2359
- };
2360
- ;// ./src/components/ExchangeAccount/ExchangeAccount.tsx
2361
-
2362
-
2363
-
2364
-
2365
-
2366
- const ExchangeAccount = ({
2367
- platform,
2368
- title,
2369
- status,
2370
- link,
2371
- data,
2372
- children,
2373
- pieChartProps,
2374
- disabled = false,
2375
- onClick,
2376
- onDelete
2377
- }) => {
2378
- const seen = {
2379
- header: false,
2380
- status: false,
2381
- content: false
2382
- };
2383
- const childrenArray = external_react_default().Children.toArray(children).filter(Boolean);
2384
- childrenArray.forEach(children => {
2385
- if (/*#__PURE__*/(0,external_react_namespaceObject.isValidElement)(children)) {
2386
- const type = children.type;
2387
- if (type === ExchangeAccountHeader) {
2388
- seen.header = true;
2389
- } else if (type === ExchangeAccountStatus) {
2390
- seen.status = true;
2391
- } else if (type === ExchangeAccountContent) {
2392
- seen.content = true;
2393
- }
2394
- }
2395
- });
2396
- if (!seen.header) {
2397
- childrenArray.unshift((0,jsx_runtime_namespaceObject.jsxs)(ExchangeAccountHeader, {
2398
- children: [(0,jsx_runtime_namespaceObject.jsx)(ExchangeAccountPlatform, {
2399
- children: platform
2400
- }), (0,jsx_runtime_namespaceObject.jsx)(ExchangeAccountTitle, {
2401
- children: title
2402
- })]
2403
- }, "header"));
2404
- }
2405
- if (!seen.content) {
2406
- childrenArray.push((0,jsx_runtime_namespaceObject.jsx)(ExchangeAccountContent, {}, "content"));
2407
- }
2408
- if (!seen.status) {
2409
- const headerIndex = childrenArray.findIndex(child => /*#__PURE__*/(0,external_react_namespaceObject.isValidElement)(child) && child.type === ExchangeAccountHeader);
2410
- childrenArray.splice(headerIndex + 1, 0, (0,jsx_runtime_namespaceObject.jsx)(ExchangeAccountStatus, {}, "status"));
2411
- }
2412
- const _onClick = !disabled ? onClick : undefined;
2413
- return (0,jsx_runtime_namespaceObject.jsx)(ExchangeAccountProvider, {
2414
- value: {
2415
- data,
2416
- platform,
2417
- title,
2418
- status,
2419
- disabled,
2420
- pieChartProps,
2421
- onDelete,
2422
- onClick
2423
- },
2424
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.WithLink, {
2425
- link: !disabled ? link : undefined,
2426
- onClick: _onClick,
2427
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardBase, {
2428
- noShadow: true,
2429
- css: CardBase({
2430
- disabled
2431
- }),
2432
- "data-testid": "card",
2433
- onClick: link ? undefined : _onClick,
2434
- children: childrenArray
2435
- })
2436
- })
2437
- });
2438
- };
2439
- ExchangeAccount.Header = ExchangeAccountHeader;
2440
- ExchangeAccount.Platform = ExchangeAccountPlatform;
2441
- ExchangeAccount.Title = ExchangeAccountTitle;
2442
- ExchangeAccount.Status = ExchangeAccountStatus;
2443
- ExchangeAccount.Content = ExchangeAccountContent;
2444
- ;// ./src/components/ExchangeAccount/index.ts
2445
-
2446
-
2447
- ;// ./src/components/AccountKeys/styles.ts
2448
- function AccountKeys_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2449
-
2450
- const Card = theme => /*#__PURE__*/(0,react_namespaceObject.css)("box-shadow:0 10px 40px 0 ", theme.colors.greyShadow, ";padding:0;border-radius:20px;&.disabled{pointer-events:none;}" + ( true ? "" : 0), true ? "" : 0);
2451
- const styles_CardHeader = theme => /*#__PURE__*/(0,react_namespaceObject.css)("align-items:center;background:", theme.colors.greyLighter, ";padding:10px;border-radius:20px 20px 0 0;margin-bottom:0;", theme.mediaQueries.md, "{padding:15px 10px 15px 30px;}" + ( true ? "" : 0), true ? "" : 0);
2452
- const DeleteButton = theme => /*#__PURE__*/(0,react_namespaceObject.css)("height:auto;background:none;box-shadow:none;&:hover,&:focus{background:none;box-shadow:none;}&:hover{svg path{fill:", theme.colors.greyDarker, ";}}", theme.mediaQueries.md, "{padding:12px;}" + ( true ? "" : 0), true ? "" : 0);
2453
- const styles_CardContent = theme => /*#__PURE__*/(0,react_namespaceObject.css)("width:100%;padding:10px;", theme.mediaQueries.md, "{padding:13px 30px 20px;}" + ( true ? "" : 0), true ? "" : 0);
2454
- const KeyItem = true ? {
2455
- name: "gnnc8a",
2456
- styles: "display:flex;flex-direction:column;gap:5px;&:not(:last-child){margin-bottom:20px;}"
2457
- } : 0;
2458
- const VisibleButton = true ? {
2459
- name: "15bna7",
2460
- styles: "height:auto;padding:0;background:none;box-shadow:none;&:hover,&:focus{background:none;box-shadow:none;}"
2461
- } : 0;
2462
- const SecretKey = true ? {
2463
- name: "1u3vkts",
2464
- styles: "display:flex;align-items:center;gap:7px"
2465
- } : 0;
2466
- const LetterWrap = true ? {
2467
- name: "26bywx",
2468
- styles: "overflow-wrap:anywhere"
2469
- } : 0;
2470
- ;// ./src/components/AccountKeys/components/AccountKeysProvider.tsx
2471
-
2472
- const [AccountKeysProvider, useAccountKeysContext] = (0,hooks_namespaceObject.createSafeContext)('useExchangeAccount must be used within a AccountKeysProvider');
2473
- ;// ./src/components/AccountKeys/components/AccountKeysHeader.tsx
2474
-
2475
-
2476
-
2477
-
2478
-
2479
- const AccountKeysHeader = ({
2480
- children
2481
- }) => {
2482
- const theme = (0,react_namespaceObject.useTheme)();
2483
- const ctx = useAccountKeysContext();
2484
- const {
2485
- title,
2486
- onDelete
2487
- } = ctx.store;
2488
- return (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardHeader, {
2489
- css: styles_CardHeader,
2490
- children: children || (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
2491
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
2492
- variant: "h5",
2493
- weight: "bold",
2494
- children: title
2495
- }), onDelete && (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Button, {
2496
- css: DeleteButton,
2497
- onClick: onDelete,
2498
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Icon, {
2499
- name: "bin",
2500
- size: 15,
2501
- color: theme.colors.greyDropdownFocused
2502
- })
2503
- })]
2504
- })
2505
- });
2506
- };
2507
- ;// ./src/components/AccountKeys/components/AccountKeysContent.tsx
2508
-
2509
-
2510
-
2511
-
2512
-
2513
- const AccountKeysContent = ({
2514
- children
2515
- }) => {
2516
- const theme = (0,react_namespaceObject.useTheme)();
2517
- const ctx = useAccountKeysContext();
2518
- const {
2519
- apiKey,
2520
- secretKey,
2521
- visible,
2522
- placeholder,
2523
- toggleVisible
2524
- } = ctx.store;
2525
- return (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.CardContent, {
2526
- css: styles_CardContent,
2527
- direction: "column",
2528
- children: children || (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
2529
- children: [(0,jsx_runtime_namespaceObject.jsxs)("div", {
2530
- css: KeyItem,
2531
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
2532
- variant: "h6",
2533
- color: theme.colors.greyDropdownFocused,
2534
- children: "API Key"
2535
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
2536
- variant: "h5",
2537
- weight: "bold",
2538
- css: LetterWrap,
2539
- children: apiKey
2540
- })]
2541
- }), (0,jsx_runtime_namespaceObject.jsxs)("div", {
2542
- css: KeyItem,
2543
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Typography, {
2544
- variant: "h6",
2545
- color: theme.colors.greyDropdownFocused,
2546
- children: "Secret Key"
2547
- }), (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.Typography, {
2548
- variant: "h5",
2549
- weight: "bold",
2550
- css: SecretKey,
2551
- children: [(0,jsx_runtime_namespaceObject.jsx)("span", {
2552
- css: LetterWrap,
2553
- children: visible ? secretKey || placeholder : placeholder
2554
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Button, {
2555
- css: VisibleButton,
2556
- onClick: toggleVisible,
2557
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Icon, {
2558
- name: visible ? 'visible' : 'invisible',
2559
- size: 20,
2560
- color: theme.colors.greyDropdownFocused
2561
- })
2562
- })]
2563
- })]
2564
- })]
2565
- })
2566
- });
2567
- };
2568
- ;// ./src/components/AccountKeys/useAccountKeys.tsx
2569
-
2570
-
2571
- const useAccountKeys = ({
2572
- title,
2573
- apiKey,
2574
- secretKey,
2575
- placeholder: controlledPlaceholder,
2576
- isDisabled,
2577
- visible,
2578
- defaultVisible,
2579
- onDelete,
2580
- onVisibilityChange
2581
- }) => {
2582
- const [_visible, _setVisible] = (0,hooks_namespaceObject.useUncontrolled)({
2583
- value: visible,
2584
- defaultValue: defaultVisible,
2585
- finalValue: false
2586
- });
2587
- const _placeholder = controlledPlaceholder || (0,jsx_runtime_namespaceObject.jsx)("span", {
2588
- children: "******"
2589
- });
2590
- const setVisible = value => {
2591
- _setVisible(value);
2592
- onVisibilityChange?.(value);
2593
- };
2594
- const toggleVisible = () => {
2595
- setVisible(!_visible);
2596
- };
2597
- return {
2598
- title,
2599
- apiKey,
2600
- secretKey,
2601
- placeholder: _placeholder,
2602
- visible: _visible,
2603
- isDisabled,
2604
- onDelete,
2605
- setVisible,
2606
- toggleVisible
2607
- };
2608
- };
2609
- ;// ./src/components/AccountKeys/AccountKeys.tsx
2610
-
2611
-
2612
-
2613
-
2614
-
2615
- const AccountKeys = ({
2616
- children,
2617
- store: controlledStore,
2618
- ...accountKeysProps
2619
- }) => {
2620
- const uncontrolledStore = useAccountKeys(accountKeysProps);
2621
- const store = controlledStore || uncontrolledStore;
2622
- return (0,jsx_runtime_namespaceObject.jsx)(AccountKeysProvider, {
2623
- value: {
2624
- store
2625
- },
2626
- children: (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Card, {
2627
- noShadow: true,
2628
- css: Card,
2629
- className: store.isDisabled ? 'disabled' : '',
2630
- children: children || (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
2631
- children: [(0,jsx_runtime_namespaceObject.jsx)(AccountKeysHeader, {}), (0,jsx_runtime_namespaceObject.jsx)(AccountKeysContent, {})]
2632
- })
2633
- })
2634
- });
2635
- };
2636
- AccountKeys.Header = AccountKeysHeader;
2637
- AccountKeys.Content = AccountKeysContent;
2638
- ;// ./src/components/AccountKeys/index.ts
2639
-
2640
-
2641
- ;// ./src/components/MarginInfo/styles.ts
2642
-
2643
- function MarginInfo_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2644
-
2645
-
2646
- const Table = /*#__PURE__*/base_default()("div", true ? {
2647
- target: "e1od563q9"
2648
- } : 0)( true ? {
2649
- name: "r9yc2m",
2650
- styles: "display:flex;flex-direction:column;width:100%;margin-bottom:5px"
2651
- } : 0);
2652
- const TableBody = /*#__PURE__*/base_default()("div", true ? {
2653
- target: "e1od563q8"
2654
- } : 0)( true ? {
2655
- name: "1xc5zxn",
2656
- styles: "display:flex;flex-direction:column;gap:6px"
2657
- } : 0);
2658
- const TableHeader = /*#__PURE__*/base_default()("div", true ? {
2659
- target: "e1od563q7"
2660
- } : 0)( true ? {
2661
- name: "261bi6",
2662
- styles: "display:flex;flex-direction:row;align-items:center;margin-bottom:5px"
2663
- } : 0);
2664
- const HeaderRow = /*#__PURE__*/base_default()("div", true ? {
2665
- target: "e1od563q6"
2666
- } : 0)( true ? {
2667
- name: "2pwczj",
2668
- styles: "display:flex;flex-direction:row;flex:1;padding:0 7px;justify-content:flex-start"
2669
- } : 0);
2670
- const Cell = /*#__PURE__*/base_default()("div", true ? {
2671
- target: "e1od563q5"
2672
- } : 0)("flex:1;padding-right:5px;overflow:hidden;color:", ({
2673
- theme
2674
- }) => theme.colors.greyDarker, ";font-size:13px;font-weight:400;text-align:left;white-space:nowrap;text-overflow:ellipsis;" + ( true ? "" : 0));
2675
- const RowCells = /*#__PURE__*/base_default()("div", true ? {
2676
- target: "e1od563q4"
2677
- } : 0)( true ? {
2678
- name: "inps1j",
2679
- styles: "display:flex;flex-direction:row;flex:2;flex-basis:0;min-width:0;justify-content:flex-start"
2680
- } : 0);
2681
- const HeaderCell = /*#__PURE__*/base_default()(RowCells, true ? {
2682
- target: "e1od563q3"
2683
- } : 0)( true ? {
2684
- name: "ofgjbn",
2685
- styles: "font-size:14px;font-weight:600"
2686
- } : 0);
2687
- const RowLabel = /*#__PURE__*/base_default()("div", true ? {
2688
- target: "e1od563q2"
2689
- } : 0)("flex:1;flex-basis:0;min-width:0;color:", ({
2690
- theme
2691
- }) => theme.colors.greyDarker, ";font-size:13px;font-weight:600;" + ( true ? "" : 0));
2692
- const TableRow = /*#__PURE__*/base_default()("div", true ? {
2693
- target: "e1od563q1"
2694
- } : 0)("display:flex;flex-direction:row;align-items:center;padding:5px 7px;background:", ({
2695
- theme
2696
- }) => theme.colors.greyLighter, ";border-radius:8px;" + ( true ? "" : 0));
2697
- const ButtonsWrapper = /*#__PURE__*/base_default()(core_namespaceObject.Wrapper, true ? {
2698
- target: "e1od563q0"
2699
- } : 0)( true ? {
2700
- name: "7mjxrk",
2701
- styles: "display:flex;flex-direction:row;width:100%;gap:5px;margin-top:auto"
2702
- } : 0);
2703
- const baseButtonStyles = theme => /*#__PURE__*/(0,react_namespaceObject.css)("display:flex;flex:1;justify-content:center;height:34px;border:none;border-radius:8px;color:", theme.colors.white, ";font-size:14px;font-weight:500;cursor:pointer;&:disabled{background:", theme.colors.grey, ";cursor:not-allowed;}&>span,&>*{color:inherit;}" + ( true ? "" : 0), true ? "" : 0);
2704
- const BorrowButton = theme => /*#__PURE__*/(0,react_namespaceObject.css)(baseButtonStyles(theme), ";background:linear-gradient(\n 247deg,\n ", theme.colors.blueLighter, " 14.71%,\n ", theme.colors.blue, " 85.29%\n );&:hover{background:linear-gradient(\n 247deg,\n ", theme.colors.blueButtonHoverGradientFrom, " 14.71%,\n ", theme.colors.blueButtonHoverGradientTo, " 85.29%\n );box-shadow:0 4px 12px ", theme.colors.blueLighter40, ";}&:active{background:", theme.colors.blueButtonActive, ";}" + ( true ? "" : 0), true ? "" : 0);
2705
- const RepayButton = theme => /*#__PURE__*/(0,react_namespaceObject.css)(baseButtonStyles(theme), ";background:linear-gradient(\n 99.26deg,\n ", theme.colors.green, " -7.01%,\n ", theme.colors.greenLighter, " 92.87%\n );&:hover{background:linear-gradient(\n 99.26deg,\n ", theme.colors.greenDark, " -7.01%,\n ", theme.colors.green, " 92.87%\n );box-shadow:0 4px 12px ", theme.colors.green40, ";}&:active{background:", theme.colors.greenDark, ";}" + ( true ? "" : 0), true ? "" : 0);
2706
- ;// ./src/components/MarginInfo/MarginInfoTableRow.tsx
2707
-
2708
-
2709
- const MarginInfoTableRow = ({
2710
- label,
2711
- baseValue,
2712
- quoteValue
2713
- }) => (0,jsx_runtime_namespaceObject.jsxs)(TableRow, {
2714
- children: [(0,jsx_runtime_namespaceObject.jsx)(RowLabel, {
2715
- children: label
2716
- }), (0,jsx_runtime_namespaceObject.jsxs)(RowCells, {
2717
- children: [(0,jsx_runtime_namespaceObject.jsx)(Cell, {
2718
- children: baseValue
2719
- }), (0,jsx_runtime_namespaceObject.jsx)(Cell, {
2720
- children: quoteValue
2721
- })]
2722
- })]
2723
- });
2724
- ;// ./src/components/MarginInfo/MarginInfo.tsx
2725
-
2726
-
2727
-
2728
-
2729
- const MarginInfo = ({
2730
- title = 'Margin Info',
2731
- base,
2732
- quote,
2733
- baseBorrowed,
2734
- baseInterestRate,
2735
- baseTotalInterest,
2736
- quoteBorrowed,
2737
- quoteInterestRate,
2738
- quoteTotalInterest,
2739
- borrowedLabel = 'Borrowed',
2740
- interestRateLabel = 'Interest Rate',
2741
- totalInterestLabel = 'Total Interest',
2742
- showInterestRate = true,
2743
- disableBorrow = false,
2744
- disableRepay = false,
2745
- onBorrow,
2746
- onRepay,
2747
- className,
2748
- wrapperClassName,
2749
- headerClassName,
2750
- contentClassName
2751
- }) => {
2752
- return (0,jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.WidgetCard, {
2753
- title: title,
2754
- className: className,
2755
- wrapperClassName: wrapperClassName,
2756
- headerClassName: headerClassName,
2757
- contentClassName: contentClassName,
2758
- children: [(0,jsx_runtime_namespaceObject.jsxs)(Table, {
2759
- children: [(0,jsx_runtime_namespaceObject.jsx)(TableHeader, {
2760
- children: (0,jsx_runtime_namespaceObject.jsxs)(HeaderRow, {
2761
- children: [(0,jsx_runtime_namespaceObject.jsx)(RowLabel, {}), (0,jsx_runtime_namespaceObject.jsxs)(RowCells, {
2762
- children: [(0,jsx_runtime_namespaceObject.jsx)(HeaderCell, {
2763
- children: base
2764
- }), (0,jsx_runtime_namespaceObject.jsx)(HeaderCell, {
2765
- children: quote
2766
- })]
2767
- })]
2768
- })
2769
- }), (0,jsx_runtime_namespaceObject.jsxs)(TableBody, {
2770
- children: [(0,jsx_runtime_namespaceObject.jsx)(MarginInfoTableRow, {
2771
- label: borrowedLabel,
2772
- baseValue: baseBorrowed,
2773
- quoteValue: quoteBorrowed
2774
- }), showInterestRate && (0,jsx_runtime_namespaceObject.jsx)(MarginInfoTableRow, {
2775
- label: interestRateLabel,
2776
- baseValue: baseInterestRate,
2777
- quoteValue: quoteInterestRate
2778
- }), (0,jsx_runtime_namespaceObject.jsx)(MarginInfoTableRow, {
2779
- label: totalInterestLabel,
2780
- baseValue: baseTotalInterest,
2781
- quoteValue: quoteTotalInterest
2782
- })]
2783
- })]
2784
- }), (0,jsx_runtime_namespaceObject.jsxs)(ButtonsWrapper, {
2785
- children: [(0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Button, {
2786
- variant: "custom",
2787
- css: BorrowButton,
2788
- onClick: onBorrow,
2789
- isDisabled: disableBorrow || !onBorrow,
2790
- text: "Borrow"
2791
- }), (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.Button, {
2792
- variant: "custom",
2793
- css: RepayButton,
2794
- onClick: onRepay,
2795
- isDisabled: disableRepay || !onRepay,
2796
- text: "Repay"
2797
- })]
2798
- })]
2799
- });
2800
- };
2801
- ;// ./src/components/MarginInfo/index.ts
2802
-
2803
-
2804
- ;// ./src/index.ts
2805
-
2806
-
2807
-
2808
-
2809
-
2810
-
2811
-
2812
-
2813
-
2814
-
2815
-
2816
-
2817
-
2818
-
2819
-
2820
-
2821
-
2822
-
2823
-
2824
-
2825
-
2826
-
2827
-
2828
-
2829
-
2830
-
2831
-
2832
-
2833
- /******/ return __webpack_exports__;
2834
- /******/ })()
2835
- ;
2836
- });
2837
- //# sourceMappingURL=index.js.map