@propellerads/header 6.0.3 → 7.0.0
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.d.ts +94 -27
- package/dist/index.js +349 -6
- package/dist/index.js.map +1 -0
- package/package.json +23 -17
- package/dist/HeaderBalance/index.d.ts +0 -12
- package/dist/HeaderBalance/style.d.ts +0 -10
- package/dist/HeaderDivider/index.d.ts +0 -3
- package/dist/HeaderDivider/style.d.ts +0 -2
- package/dist/HeaderDropdown/index.d.ts +0 -7
- package/dist/HeaderDropdown/style.d.ts +0 -2
- package/dist/HeaderDropdownList/index.d.ts +0 -6
- package/dist/HeaderDropdownList/style.d.ts +0 -2
- package/dist/HeaderItem/index.d.ts +0 -12
- package/dist/HeaderItem/style.d.ts +0 -8
- package/dist/HeaderTime/index.d.ts +0 -7
- package/dist/HeaderTime/style.d.ts +0 -1
- package/dist/header.cjs.development.js +0 -360
- package/dist/header.cjs.development.js.map +0 -1
- package/dist/header.cjs.production.min.js +0 -2
- package/dist/header.cjs.production.min.js.map +0 -1
- package/dist/header.esm.js +0 -352
- package/dist/header.esm.js.map +0 -1
- package/dist/hooks/useClickOutside.d.ts +0 -2
- package/dist/style.d.ts +0 -8
- package/dist/themes/context.d.ts +0 -9
- package/dist/themes/variables.d.ts +0 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,94 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { CSSObject } from 'styled-components';
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
|
|
5
|
+
type HeaderItemProps = {
|
|
6
|
+
id?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
component?: ReactNode;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
isRightDropdown?: boolean;
|
|
12
|
+
title?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const HeaderItem: FC<HeaderItemProps>;
|
|
15
|
+
|
|
16
|
+
type DayEarned = {
|
|
17
|
+
date: string;
|
|
18
|
+
value: number;
|
|
19
|
+
percentage: number;
|
|
20
|
+
};
|
|
21
|
+
type HeaderBalanceProps = {
|
|
22
|
+
balance: number;
|
|
23
|
+
dailyEarned?: DayEarned[];
|
|
24
|
+
};
|
|
25
|
+
declare const HeaderBalance: FC<HeaderBalanceProps>;
|
|
26
|
+
|
|
27
|
+
type HeaderTimeProps = {
|
|
28
|
+
tooltipContent?: (ESTDate: dayjs.Dayjs) => string;
|
|
29
|
+
};
|
|
30
|
+
declare const HeaderTime: FC<HeaderTimeProps>;
|
|
31
|
+
|
|
32
|
+
declare const HeaderDivider: FC;
|
|
33
|
+
|
|
34
|
+
type HeaderDropdownProps = {
|
|
35
|
+
id?: string;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
};
|
|
38
|
+
declare const HeaderDropdown: FC<HeaderDropdownProps>;
|
|
39
|
+
|
|
40
|
+
type HeaderDropdownListProps = {
|
|
41
|
+
items?: ReactNode[];
|
|
42
|
+
};
|
|
43
|
+
declare const HeaderDropdownList: FC<HeaderDropdownListProps>;
|
|
44
|
+
|
|
45
|
+
type HeaderTheme = {
|
|
46
|
+
name: string;
|
|
47
|
+
header: {
|
|
48
|
+
backgroundColor: string;
|
|
49
|
+
color: string;
|
|
50
|
+
colorHover: string;
|
|
51
|
+
boxShadow: string;
|
|
52
|
+
dividerColor: string;
|
|
53
|
+
menuItemColor: string;
|
|
54
|
+
menuItemColorHover: string;
|
|
55
|
+
menuItemBackgroundColor: string;
|
|
56
|
+
menuItemBackgroundColorHover: string;
|
|
57
|
+
};
|
|
58
|
+
balance: {
|
|
59
|
+
borderColor: string;
|
|
60
|
+
textColor: string;
|
|
61
|
+
dailyEarnedColor: string;
|
|
62
|
+
chartColor: string;
|
|
63
|
+
chartBackgroundColor: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
declare const ThemeName: {
|
|
68
|
+
readonly Dark: "dark";
|
|
69
|
+
readonly Light: "light";
|
|
70
|
+
readonly Transparent: "transparent";
|
|
71
|
+
};
|
|
72
|
+
type ThemeName = (typeof ThemeName)[keyof typeof ThemeName];
|
|
73
|
+
declare const themes: Record<ThemeName, HeaderTheme>;
|
|
74
|
+
|
|
75
|
+
type HeaderProps = {
|
|
76
|
+
logo: ReactNode;
|
|
77
|
+
customHeaderStyle?: CSSObject;
|
|
78
|
+
sidebarButton?: ReactNode;
|
|
79
|
+
children: ReactNode;
|
|
80
|
+
theme?: HeaderTheme;
|
|
81
|
+
id?: string;
|
|
82
|
+
};
|
|
83
|
+
type HeaderCompound = FC<HeaderProps> & {
|
|
84
|
+
Item: typeof HeaderItem;
|
|
85
|
+
Balance: typeof HeaderBalance;
|
|
86
|
+
Time: typeof HeaderTime;
|
|
87
|
+
Divider: typeof HeaderDivider;
|
|
88
|
+
Dropdown: typeof HeaderDropdown;
|
|
89
|
+
DropdownList: typeof HeaderDropdownList;
|
|
90
|
+
};
|
|
91
|
+
declare const Header: HeaderCompound;
|
|
92
|
+
|
|
93
|
+
export { Header as default, themes };
|
|
94
|
+
export type { HeaderProps };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,351 @@
|
|
|
1
|
+
import { jsxs as c, jsx as t, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as $, useRef as L, useState as y } from "react";
|
|
3
|
+
import r, { ThemeContext as R } from "styled-components";
|
|
4
|
+
import { fontNormal as H, spacing as l, smallDevices as x, fontSmall as j, borderRadius as w, black as s, white as d, actionColor as p, gray80 as g, gray95 as v, gray70 as m, gray50 as f } from "@propellerads/stylevariables";
|
|
5
|
+
import k from "@propellerads/currency";
|
|
6
|
+
import { hideTooltip as M, showTooltip as O, Position as P } from "@propellerads/smart-tooltip";
|
|
7
|
+
import I from "dayjs";
|
|
8
|
+
import V from "dayjs/plugin/utc";
|
|
9
|
+
const F = (e, o) => {
|
|
10
|
+
$(() => {
|
|
11
|
+
const n = (a) => {
|
|
12
|
+
const i = e.current;
|
|
13
|
+
!i || i.contains(a.target) || o(a);
|
|
14
|
+
};
|
|
15
|
+
return document.addEventListener("mousedown", n), document.addEventListener("touchstart", n), () => {
|
|
16
|
+
document.removeEventListener("mousedown", n), document.removeEventListener("touchstart", n);
|
|
17
|
+
};
|
|
18
|
+
}, [e, o]);
|
|
19
|
+
}, N = r.div`
|
|
20
|
+
position: relative;
|
|
21
|
+
display: flex;
|
|
22
|
+
height: 100%;
|
|
23
|
+
align-items: center;
|
|
24
|
+
`, q = r.button`
|
|
25
|
+
background: transparent;
|
|
26
|
+
border: 0;
|
|
27
|
+
margin: 0;
|
|
28
|
+
outline: none;
|
|
29
|
+
font-size: ${H}px;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
padding: 0 ${l * 4}px;
|
|
33
|
+
height: 100%;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
color: ${(e) => e.theme.header.menuItemColor};
|
|
1
36
|
|
|
2
|
-
|
|
37
|
+
&:hover {
|
|
38
|
+
color: ${(e) => e.theme.header.menuItemColorHover};
|
|
3
39
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
40
|
+
& > svg {
|
|
41
|
+
fill: ${(e) => e.theme.header.menuItemColorHover};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`, A = r.div`
|
|
45
|
+
margin-left: ${l}px;
|
|
46
|
+
`, G = r.div`
|
|
47
|
+
z-index: 99;
|
|
48
|
+
padding: ${l}px;
|
|
49
|
+
position: fixed;
|
|
50
|
+
left: 0 !important;
|
|
51
|
+
top: 56px;
|
|
52
|
+
right: 0 !important;
|
|
53
|
+
|
|
54
|
+
${(e) => e.$isRightDropdown && `
|
|
55
|
+
left: ${e.$isRightDropdown ? "initial" : 0};
|
|
56
|
+
right: ${e.$isRightDropdown ? 0 : "initial"};
|
|
57
|
+
`};
|
|
58
|
+
|
|
59
|
+
@media (min-width: ${x}px) {
|
|
60
|
+
width: initial;
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 100%;
|
|
63
|
+
left: initial !important;
|
|
64
|
+
}
|
|
65
|
+
`, J = ({ id: e, children: o, isRightDropdown: n = !1, icon: a, title: i, onClick: h, component: B }) => {
|
|
66
|
+
const C = L(null), [D, u] = y(!1), E = i && /* @__PURE__ */ t(A, { children: i });
|
|
67
|
+
return F(C, () => u(!1)), /* @__PURE__ */ c(N, { id: e, ref: C, children: [
|
|
68
|
+
/* @__PURE__ */ c(
|
|
69
|
+
q,
|
|
70
|
+
{
|
|
71
|
+
onClick: () => {
|
|
72
|
+
if (h) {
|
|
73
|
+
h();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
u((T) => !T);
|
|
77
|
+
},
|
|
78
|
+
children: [
|
|
79
|
+
a,
|
|
80
|
+
E,
|
|
81
|
+
B
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
o && D && /* @__PURE__ */ t(G, { $isRightDropdown: n, onClick: () => u(!1), children: o })
|
|
86
|
+
] });
|
|
87
|
+
}, K = r.div`
|
|
88
|
+
display: inline-flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
padding: ${l * 2}px 0;
|
|
91
|
+
z-index: 1;
|
|
92
|
+
color: ${(e) => e.theme.balance.textColor};
|
|
93
|
+
background-color: ${(e) => e.theme.header.backgroundColor};
|
|
94
|
+
`, Q = r.div`
|
|
95
|
+
margin: 0 ${l * 2}px;
|
|
96
|
+
line-height: 1.14;
|
|
97
|
+
letter-spacing: 0.3px;
|
|
98
|
+
font-size: ${H}px;
|
|
99
|
+
display: flex;
|
|
100
|
+
font-weight: bold;
|
|
101
|
+
color: ${(e) => e.theme.balance.textColor};
|
|
102
|
+
`, U = r.div`
|
|
103
|
+
margin-right: 8px;
|
|
104
|
+
position: relative;
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: stretch;
|
|
107
|
+
width: 49px;
|
|
108
|
+
flex: 0 0 49px;
|
|
109
|
+
height: 16px;
|
|
110
|
+
cursor: default;
|
|
111
|
+
|
|
112
|
+
@media (max-width: ${x}px) {
|
|
113
|
+
display: none;
|
|
114
|
+
}
|
|
115
|
+
`, S = r.span`
|
|
116
|
+
opacity: 0;
|
|
117
|
+
position: absolute;
|
|
118
|
+
top: calc(-100% - 2px);
|
|
119
|
+
left: 0;
|
|
120
|
+
display: block;
|
|
121
|
+
padding: 0 3px;
|
|
122
|
+
font-size: ${j}px;
|
|
123
|
+
line-height: 16px;
|
|
124
|
+
border-radius: ${w}px;
|
|
125
|
+
white-space: nowrap;
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
color: ${(e) => e.theme.balance.chartColor};
|
|
128
|
+
background-color: ${(e) => e.theme.balance.chartBackgroundColor};
|
|
129
|
+
`, W = r.div`
|
|
130
|
+
position: relative;
|
|
131
|
+
flex: 0 0 7px;
|
|
132
|
+
border: solid transparent;
|
|
133
|
+
border-width: 0 1px;
|
|
134
|
+
opacity: 0.3;
|
|
135
|
+
|
|
136
|
+
&:hover {
|
|
137
|
+
opacity: 1;
|
|
138
|
+
${S} {
|
|
139
|
+
opacity: 1;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
`, X = r.div`
|
|
143
|
+
position: absolute;
|
|
144
|
+
left: 0;
|
|
145
|
+
bottom: 0;
|
|
146
|
+
right: 0;
|
|
147
|
+
height: ${(e) => e.$percentage > 1 ? `${e.$percentage}%` : "1px"};
|
|
148
|
+
background-color: ${(e) => e.theme.balance.dailyEarnedColor};
|
|
149
|
+
`, Y = ({ day: e }) => {
|
|
150
|
+
const { date: o, value: n, percentage: a } = e;
|
|
151
|
+
return /* @__PURE__ */ c(W, { children: [
|
|
152
|
+
/* @__PURE__ */ t(X, { $percentage: a }),
|
|
153
|
+
/* @__PURE__ */ c(S, { children: [
|
|
154
|
+
o,
|
|
155
|
+
" - ",
|
|
156
|
+
/* @__PURE__ */ t(k, { value: n })
|
|
157
|
+
] })
|
|
158
|
+
] });
|
|
159
|
+
}, Z = ({ balance: e, dailyEarned: o = [] }) => {
|
|
160
|
+
const n = !!o.length;
|
|
161
|
+
return /* @__PURE__ */ c(K, { children: [
|
|
162
|
+
/* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(k, { value: e, decimalPosition: 2 }) }),
|
|
163
|
+
n && /* @__PURE__ */ t(U, { children: o.map((a, i) => /* @__PURE__ */ t(Y, { day: a }, i)) })
|
|
164
|
+
] });
|
|
165
|
+
}, _ = r.div`
|
|
166
|
+
display: flex;
|
|
167
|
+
padding: 0 ${l * 4}px;
|
|
168
|
+
cursor: default;
|
|
169
|
+
color: ${(e) => e.theme.header.menuItemColor};
|
|
170
|
+
`;
|
|
171
|
+
I.extend(V);
|
|
172
|
+
const b = () => I.utc().subtract(5, "hour"), ee = ({
|
|
173
|
+
tooltipContent: e = (o) => `System time: ${o.format("HH:mm DD.MM")} (EST)`
|
|
174
|
+
}) => {
|
|
175
|
+
const [o, n] = y(b());
|
|
176
|
+
return $(() => {
|
|
177
|
+
const a = setInterval(() => {
|
|
178
|
+
n(b());
|
|
179
|
+
}, 1e3);
|
|
180
|
+
return () => clearInterval(a);
|
|
181
|
+
}, []), /* @__PURE__ */ t(
|
|
182
|
+
_,
|
|
183
|
+
{
|
|
184
|
+
onMouseEnter: (a) => {
|
|
185
|
+
O(a.currentTarget, e(o), P.Bottom);
|
|
186
|
+
},
|
|
187
|
+
onMouseLeave: M,
|
|
188
|
+
children: `${o.format("HH:mm")} EST`
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}, oe = r.div`
|
|
192
|
+
width: 1px;
|
|
193
|
+
height: 20px;
|
|
194
|
+
background-color: ${(e) => e.theme.header.dividerColor};
|
|
195
|
+
`, te = () => /* @__PURE__ */ t(oe, {}), re = r.div`
|
|
196
|
+
border-radius: ${w}px;
|
|
197
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
198
|
+
padding: ${l * 2}px 0;
|
|
199
|
+
width: 100%;
|
|
200
|
+
background-color: ${(e) => e.theme.header.menuItemBackgroundColor};
|
|
201
|
+
|
|
202
|
+
@media (min-width: ${x}px) {
|
|
203
|
+
width: auto;
|
|
204
|
+
min-width: 150px;
|
|
205
|
+
}
|
|
206
|
+
`, ne = ({ id: e, children: o }) => /* @__PURE__ */ t(re, { id: e, children: o }), ae = r.div`
|
|
207
|
+
height: 48px;
|
|
208
|
+
padding: 0 16px;
|
|
209
|
+
position: relative;
|
|
210
|
+
display: flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
cursor: pointer;
|
|
213
|
+
text-align: left;
|
|
214
|
+
background-color: ${(e) => e.theme.header.menuItemBackgroundColor};
|
|
215
|
+
color: ${(e) => e.theme.header.menuItemColor};
|
|
216
|
+
|
|
217
|
+
&:hover {
|
|
218
|
+
background-color: ${(e) => e.theme.header.menuItemBackgroundColorHover};
|
|
219
|
+
color: ${(e) => e.theme.header.menuItemColorHover};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
& > * {
|
|
223
|
+
border: 0;
|
|
224
|
+
margin: 0;
|
|
225
|
+
color: inherit !important;
|
|
226
|
+
position: absolute;
|
|
227
|
+
left: 0;
|
|
228
|
+
top: 0;
|
|
229
|
+
right: 0;
|
|
230
|
+
bottom: 0;
|
|
231
|
+
width: 100%;
|
|
232
|
+
display: flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
padding: 0 ${l * 4}px;
|
|
235
|
+
outline: none;
|
|
236
|
+
font-size: inherit;
|
|
237
|
+
background: transparent;
|
|
238
|
+
transition: color 200ms ease-out;
|
|
239
|
+
text-decoration: none;
|
|
240
|
+
}
|
|
241
|
+
`, ie = ({ item: e }) => /* @__PURE__ */ t(ae, { children: e }), de = ({ items: e = [] }) => /* @__PURE__ */ t(z, { children: e.map((o, n) => /* @__PURE__ */ t(ie, { item: o }, n)) }), le = r.div`
|
|
242
|
+
display: flex;
|
|
243
|
+
height: 56px;
|
|
244
|
+
align-items: center;
|
|
245
|
+
justify-content: space-between;
|
|
246
|
+
position: fixed;
|
|
247
|
+
top: 0;
|
|
248
|
+
left: 0;
|
|
249
|
+
right: 0;
|
|
250
|
+
z-index: 2001;
|
|
251
|
+
background-color: ${(e) => e.theme.header.backgroundColor};
|
|
252
|
+
box-shadow: ${(e) => e.theme.header.boxShadow};
|
|
253
|
+
|
|
254
|
+
${(e) => e.$customHeaderStyle}
|
|
255
|
+
`, ce = r.div`
|
|
256
|
+
display: flex;
|
|
257
|
+
align-items: center;
|
|
258
|
+
`, se = r.div`
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
height: 100%;
|
|
262
|
+
`, me = {
|
|
263
|
+
dark: {
|
|
264
|
+
name: "dark",
|
|
265
|
+
header: {
|
|
266
|
+
backgroundColor: "hsl(228, 16.9%, 17.5%)",
|
|
267
|
+
color: m,
|
|
268
|
+
colorHover: d,
|
|
269
|
+
boxShadow: "0 2px 8px 0 hsla(0, 0%, 0%, 0.1)",
|
|
270
|
+
dividerColor: f,
|
|
271
|
+
menuItemColor: m,
|
|
272
|
+
menuItemColorHover: d,
|
|
273
|
+
menuItemBackgroundColor: "hsl(228, 16.9%, 17.5%)",
|
|
274
|
+
menuItemBackgroundColorHover: "hsla(0, 0%, 0%, 0.3)"
|
|
275
|
+
},
|
|
276
|
+
balance: {
|
|
277
|
+
borderColor: g,
|
|
278
|
+
textColor: d,
|
|
279
|
+
dailyEarnedColor: d,
|
|
280
|
+
chartColor: s,
|
|
281
|
+
chartBackgroundColor: d
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
light: {
|
|
285
|
+
name: "light",
|
|
286
|
+
header: {
|
|
287
|
+
backgroundColor: d,
|
|
288
|
+
color: m,
|
|
289
|
+
colorHover: s,
|
|
290
|
+
boxShadow: "0 2px 8px 0 hsla(0, 0%, 0%, 0.1)",
|
|
291
|
+
dividerColor: v,
|
|
292
|
+
menuItemColor: m,
|
|
293
|
+
menuItemColorHover: s,
|
|
294
|
+
menuItemBackgroundColor: d,
|
|
295
|
+
menuItemBackgroundColorHover: v
|
|
296
|
+
},
|
|
297
|
+
balance: {
|
|
298
|
+
borderColor: g,
|
|
299
|
+
textColor: p,
|
|
300
|
+
dailyEarnedColor: p,
|
|
301
|
+
chartColor: d,
|
|
302
|
+
chartBackgroundColor: s
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
transparent: {
|
|
306
|
+
name: "transparent",
|
|
307
|
+
header: {
|
|
308
|
+
backgroundColor: "none",
|
|
309
|
+
color: m,
|
|
310
|
+
colorHover: s,
|
|
311
|
+
dividerColor: f,
|
|
312
|
+
menuItemColor: m,
|
|
313
|
+
menuItemColorHover: d,
|
|
314
|
+
menuItemBackgroundColor: "hsl(228, 16.9%, 17.5%)",
|
|
315
|
+
menuItemBackgroundColorHover: "hsla(0, 0%, 0%, 0.3)",
|
|
316
|
+
boxShadow: "none"
|
|
317
|
+
},
|
|
318
|
+
balance: {
|
|
319
|
+
borderColor: g,
|
|
320
|
+
textColor: p,
|
|
321
|
+
dailyEarnedColor: p,
|
|
322
|
+
chartColor: d,
|
|
323
|
+
chartBackgroundColor: s
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}, he = ({ theme: e = me.light, children: o }) => /* @__PURE__ */ t(R.Provider, { value: e, children: o }), pe = ({
|
|
327
|
+
logo: e,
|
|
328
|
+
customHeaderStyle: o = {},
|
|
329
|
+
sidebarButton: n,
|
|
330
|
+
children: a,
|
|
331
|
+
theme: i,
|
|
332
|
+
id: h = "header-container"
|
|
333
|
+
}) => /* @__PURE__ */ t(he, { ...i ? { theme: i } : {}, children: /* @__PURE__ */ c(le, { id: h, $customHeaderStyle: o, children: [
|
|
334
|
+
/* @__PURE__ */ c(ce, { children: [
|
|
335
|
+
n,
|
|
336
|
+
e
|
|
337
|
+
] }),
|
|
338
|
+
/* @__PURE__ */ t(se, { children: a })
|
|
339
|
+
] }) }), ye = Object.assign(pe, {
|
|
340
|
+
Item: J,
|
|
341
|
+
Balance: Z,
|
|
342
|
+
Time: ee,
|
|
343
|
+
Divider: te,
|
|
344
|
+
Dropdown: ne,
|
|
345
|
+
DropdownList: de
|
|
346
|
+
});
|
|
347
|
+
export {
|
|
348
|
+
ye as default,
|
|
349
|
+
me as themes
|
|
350
|
+
};
|
|
351
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/hooks/useClickOutside.ts","../src/HeaderItem/style.tsx","../src/HeaderItem/index.tsx","../src/HeaderBalance/style.tsx","../src/HeaderBalance/index.tsx","../src/HeaderTime/style.tsx","../src/HeaderTime/index.tsx","../src/HeaderDivider/style.tsx","../src/HeaderDivider/index.tsx","../src/HeaderDropdown/style.tsx","../src/HeaderDropdown/index.tsx","../src/HeaderDropdownList/style.tsx","../src/HeaderDropdownList/index.tsx","../src/style.tsx","../src/themes/variables.ts","../src/themes/context.tsx","../src/index.tsx"],"sourcesContent":["import type {RefObject} from 'react';\nimport {useEffect} from 'react';\n\nexport const useOnClickOutside = <T extends HTMLElement>(\n ref: RefObject<T | null>,\n handler: (event: MouseEvent | TouchEvent) => void,\n): void => {\n useEffect(() => {\n const listener = (event: MouseEvent | TouchEvent) => {\n const el = ref.current;\n if (!el || el.contains(event.target as Node)) {\n return;\n }\n handler(event);\n };\n\n document.addEventListener('mousedown', listener);\n document.addEventListener('touchstart', listener);\n\n return () => {\n document.removeEventListener('mousedown', listener);\n document.removeEventListener('touchstart', listener);\n };\n }, [ref, handler]);\n};\n","import styled from 'styled-components';\nimport {spacing, smallDevices, fontNormal} from '@propellerads/stylevariables';\n\nconst StyledHeaderItem = styled.div`\n position: relative;\n display: flex;\n height: 100%;\n align-items: center;\n`;\n\nconst StyledHeaderItemButton = styled.button`\n background: transparent;\n border: 0;\n margin: 0;\n outline: none;\n font-size: ${fontNormal}px;\n display: flex;\n align-items: center;\n padding: 0 ${spacing * 4}px;\n height: 100%;\n cursor: pointer;\n color: ${(props) => props.theme.header.menuItemColor};\n\n &:hover {\n color: ${(props) => props.theme.header.menuItemColorHover};\n\n & > svg {\n fill: ${(props) => props.theme.header.menuItemColorHover};\n }\n }\n`;\n\nconst StyledHeaderItemTitle = styled.div`\n margin-left: ${spacing}px;\n`;\n\ntype StyledHeaderItemDropdownProps = {\n $isRightDropdown: boolean;\n};\n\nconst StyledHeaderItemDropdown = styled.div<StyledHeaderItemDropdownProps>`\n z-index: 99;\n padding: ${spacing}px;\n position: fixed;\n left: 0 !important;\n top: 56px;\n right: 0 !important;\n\n ${(props) =>\n props.$isRightDropdown &&\n `\n left: ${props.$isRightDropdown ? 'initial' : 0};\n right: ${props.$isRightDropdown ? 0 : 'initial'};\n `};\n\n @media (min-width: ${smallDevices}px) {\n width: initial;\n position: absolute;\n top: 100%;\n left: initial !important;\n }\n`;\n\nexport {StyledHeaderItem, StyledHeaderItemTitle, StyledHeaderItemDropdown, StyledHeaderItemButton};\n","import type {FC, ReactNode} from 'react';\nimport {useRef, useState} from 'react';\nimport {useOnClickOutside} from '../hooks/useClickOutside';\nimport {StyledHeaderItem, StyledHeaderItemButton, StyledHeaderItemDropdown, StyledHeaderItemTitle} from './style';\n\ntype HeaderItemProps = {\n id?: string;\n children?: ReactNode;\n onClick?: () => void;\n component?: ReactNode;\n icon?: ReactNode;\n isRightDropdown?: boolean;\n title?: string;\n};\n\nconst HeaderItem: FC<HeaderItemProps> = ({id, children, isRightDropdown = false, icon, title, onClick, component}) => {\n const ref = useRef<HTMLDivElement | null>(null);\n const [isShowDropdown, setDropdown] = useState(false);\n\n const titleComponent = title && <StyledHeaderItemTitle>{title}</StyledHeaderItemTitle>;\n\n useOnClickOutside(ref, () => setDropdown(false));\n\n return (\n <StyledHeaderItem id={id} ref={ref}>\n <StyledHeaderItemButton\n onClick={() => {\n if (onClick) {\n onClick();\n return;\n }\n\n setDropdown((previousState) => !previousState);\n }}\n >\n {icon}\n {titleComponent}\n {component}\n </StyledHeaderItemButton>\n {children && isShowDropdown && (\n <StyledHeaderItemDropdown $isRightDropdown={isRightDropdown} onClick={() => setDropdown(false)}>\n {children}\n </StyledHeaderItemDropdown>\n )}\n </StyledHeaderItem>\n );\n};\n\nexport default HeaderItem;\n","import styled from 'styled-components';\nimport {spacing, smallDevices, borderRadius, fontNormal, fontSmall} from '@propellerads/stylevariables';\n\nconst StyledHeaderBalance = styled.div`\n display: inline-flex;\n align-items: center;\n padding: ${spacing * 2}px 0;\n z-index: 1;\n color: ${(props) => props.theme.balance.textColor};\n background-color: ${(props) => props.theme.header.backgroundColor};\n`;\n\nconst StyledHeaderBalanceValue = styled.div`\n margin: 0 ${spacing * 2}px;\n line-height: 1.14;\n letter-spacing: 0.3px;\n font-size: ${fontNormal}px;\n display: flex;\n font-weight: bold;\n color: ${(props) => props.theme.balance.textColor};\n`;\nconst StyledHeaderBalanceDailyEarned = styled.div`\n margin-right: 8px;\n position: relative;\n display: flex;\n align-items: stretch;\n width: 49px;\n flex: 0 0 49px;\n height: 16px;\n cursor: default;\n\n @media (max-width: ${smallDevices}px) {\n display: none;\n }\n`;\n\nconst StyledHeaderBalanceChartDay = styled.span`\n opacity: 0;\n position: absolute;\n top: calc(-100% - 2px);\n left: 0;\n display: block;\n padding: 0 3px;\n font-size: ${fontSmall}px;\n line-height: 16px;\n border-radius: ${borderRadius}px;\n white-space: nowrap;\n pointer-events: none;\n color: ${(props) => props.theme.balance.chartColor};\n background-color: ${(props) => props.theme.balance.chartBackgroundColor};\n`;\n\nconst StyledHeaderBalanceChart = styled.div`\n position: relative;\n flex: 0 0 7px;\n border: solid transparent;\n border-width: 0 1px;\n opacity: 0.3;\n\n &:hover {\n opacity: 1;\n ${StyledHeaderBalanceChartDay} {\n opacity: 1;\n }\n }\n`;\n\ntype StyledHeaderBalanceChartValueProps = {\n $percentage: number;\n};\n\nconst StyledHeaderBalanceChartValue = styled.div<StyledHeaderBalanceChartValueProps>`\n position: absolute;\n left: 0;\n bottom: 0;\n right: 0;\n height: ${(props) => (props.$percentage > 1 ? `${props.$percentage}%` : '1px')};\n background-color: ${(props) => props.theme.balance.dailyEarnedColor};\n`;\n\nexport {\n StyledHeaderBalance,\n StyledHeaderBalanceValue,\n StyledHeaderBalanceDailyEarned,\n StyledHeaderBalanceChart,\n StyledHeaderBalanceChartValue,\n StyledHeaderBalanceChartDay,\n};\n","import Currency from '@propellerads/currency';\nimport type {FC} from 'react';\nimport {\n StyledHeaderBalance,\n StyledHeaderBalanceChart,\n StyledHeaderBalanceChartDay,\n StyledHeaderBalanceChartValue,\n StyledHeaderBalanceDailyEarned,\n StyledHeaderBalanceValue,\n} from './style';\n\ntype DayEarned = {\n date: string;\n value: number;\n percentage: number;\n};\n\ntype HeaderBalanceChartProps = {\n day: DayEarned;\n};\n\nconst HeaderBalanceChart: FC<HeaderBalanceChartProps> = ({day}) => {\n const {date, value, percentage} = day;\n\n return (\n <StyledHeaderBalanceChart>\n <StyledHeaderBalanceChartValue $percentage={percentage} />\n <StyledHeaderBalanceChartDay>\n {date} - <Currency value={value} />\n </StyledHeaderBalanceChartDay>\n </StyledHeaderBalanceChart>\n );\n};\n\ntype HeaderBalanceProps = {\n balance: number;\n dailyEarned?: DayEarned[];\n};\n\nconst HeaderBalance: FC<HeaderBalanceProps> = ({balance, dailyEarned = []}) => {\n const dailyEarnedExist = Boolean(dailyEarned.length);\n\n return (\n <StyledHeaderBalance>\n <StyledHeaderBalanceValue>\n <Currency value={balance} decimalPosition={2} />\n </StyledHeaderBalanceValue>\n\n {dailyEarnedExist && (\n <StyledHeaderBalanceDailyEarned>\n {dailyEarned.map((day, idx) => (\n <HeaderBalanceChart key={idx} day={day} />\n ))}\n </StyledHeaderBalanceDailyEarned>\n )}\n </StyledHeaderBalance>\n );\n};\n\nexport default HeaderBalance;\n","import styled from 'styled-components';\nimport {spacing} from '@propellerads/stylevariables';\n\nexport const StyledHeaderTime = styled.div`\n display: flex;\n padding: 0 ${spacing * 4}px;\n cursor: default;\n color: ${(props) => props.theme.header.menuItemColor};\n`;\n","import {hideTooltip, showTooltip, Position} from '@propellerads/smart-tooltip';\nimport dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\nimport type {FC} from 'react';\nimport {useEffect, useState} from 'react';\nimport {StyledHeaderTime} from './style';\n\ndayjs.extend(utc);\n\nconst getTime = () => {\n return dayjs.utc().subtract(5, 'hour');\n};\n\ntype HeaderTimeProps = {\n tooltipContent?: (ESTDate: dayjs.Dayjs) => string;\n};\n\nconst HeaderTime: FC<HeaderTimeProps> = ({\n tooltipContent = (ESTDate) => `System time: ${ESTDate.format('HH:mm DD.MM')} (EST)`,\n}) => {\n const [time, setTime] = useState(getTime());\n\n useEffect(() => {\n const timer = setInterval(() => {\n setTime(getTime());\n }, 1000);\n\n return () => clearInterval(timer);\n }, []);\n\n return (\n <StyledHeaderTime\n onMouseEnter={(e) => {\n showTooltip(e.currentTarget, tooltipContent(time), Position.Bottom);\n }}\n onMouseLeave={hideTooltip}\n >\n {`${time.format('HH:mm')} EST`}\n </StyledHeaderTime>\n );\n};\n\nexport default HeaderTime;\n","import styled from 'styled-components';\n\nconst StyledHeaderDivider = styled.div`\n width: 1px;\n height: 20px;\n background-color: ${(props) => props.theme.header.dividerColor};\n`;\n\nexport {StyledHeaderDivider};\n","import type {FC} from 'react';\nimport {StyledHeaderDivider} from './style';\n\nconst HeaderDivider: FC = () => <StyledHeaderDivider />;\n\nexport default HeaderDivider;\n","import styled from 'styled-components';\nimport {spacing, smallDevices, borderRadius} from '@propellerads/stylevariables';\n\nconst StyledHeaderDropdown = styled.div`\n border-radius: ${borderRadius}px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);\n padding: ${spacing * 2}px 0;\n width: 100%;\n background-color: ${(props) => props.theme.header.menuItemBackgroundColor};\n\n @media (min-width: ${smallDevices}px) {\n width: auto;\n min-width: 150px;\n }\n`;\n\nexport {StyledHeaderDropdown};\n","import type {FC, ReactNode} from 'react';\nimport {StyledHeaderDropdown} from './style';\n\ntype HeaderDropdownProps = {\n id?: string;\n children: ReactNode;\n};\n\nconst HeaderDropdown: FC<HeaderDropdownProps> = ({id, children}) => (\n <StyledHeaderDropdown id={id}>{children}</StyledHeaderDropdown>\n);\n\nexport default HeaderDropdown;\n","import styled from 'styled-components';\nimport {spacing} from '@propellerads/stylevariables';\n\nconst StyledHeaderDropdownItem = styled.div`\n height: 48px;\n padding: 0 16px;\n position: relative;\n display: flex;\n align-items: center;\n cursor: pointer;\n text-align: left;\n background-color: ${(props) => props.theme.header.menuItemBackgroundColor};\n color: ${(props) => props.theme.header.menuItemColor};\n\n &:hover {\n background-color: ${(props) => props.theme.header.menuItemBackgroundColorHover};\n color: ${(props) => props.theme.header.menuItemColorHover};\n }\n\n & > * {\n border: 0;\n margin: 0;\n color: inherit !important;\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n display: flex;\n align-items: center;\n padding: 0 ${spacing * 4}px;\n outline: none;\n font-size: inherit;\n background: transparent;\n transition: color 200ms ease-out;\n text-decoration: none;\n }\n`;\n\nexport {StyledHeaderDropdownItem};\n","import type {FC, ReactNode} from 'react';\nimport {StyledHeaderDropdownItem} from './style';\n\ntype HeaderDropdownItemProps = {\n item: ReactNode;\n};\n\nconst HeaderDropdownItem: FC<HeaderDropdownItemProps> = ({item}) => (\n <StyledHeaderDropdownItem>{item}</StyledHeaderDropdownItem>\n);\n\ntype HeaderDropdownListProps = {\n items?: ReactNode[];\n};\n\nconst HeaderDropdownList: FC<HeaderDropdownListProps> = ({items = []}) => (\n <>\n {items.map((item, idx) => (\n <HeaderDropdownItem key={idx} item={item} />\n ))}\n </>\n);\n\nexport default HeaderDropdownList;\n","import type {CSSObject} from 'styled-components';\nimport styled from 'styled-components';\n\ntype StyledHeaderProps = {\n $customHeaderStyle: CSSObject;\n};\n\nconst StyledHeader = styled.div<StyledHeaderProps>`\n display: flex;\n height: 56px;\n align-items: center;\n justify-content: space-between;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 2001;\n background-color: ${(props) => props.theme.header.backgroundColor};\n box-shadow: ${(props) => props.theme.header.boxShadow};\n\n ${(props) => props.$customHeaderStyle}\n`;\n\nconst StyledHeaderBrand = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst StyledHeaderOptions = styled.div`\n display: flex;\n align-items: center;\n height: 100%;\n`;\n\nexport {StyledHeader, StyledHeaderBrand, StyledHeaderOptions};\n","import {actionColor, black, gray50, gray70, gray80, gray95, white} from '@propellerads/stylevariables';\nimport type {HeaderTheme} from './types';\n\nexport const ThemeName = {\n Dark: 'dark',\n Light: 'light',\n Transparent: 'transparent',\n} as const;\nexport type ThemeName = (typeof ThemeName)[keyof typeof ThemeName];\n\nconst themes: Record<ThemeName, HeaderTheme> = {\n dark: {\n name: 'dark',\n header: {\n backgroundColor: 'hsl(228, 16.9%, 17.5%)',\n color: gray70,\n colorHover: white,\n boxShadow: '0 2px 8px 0 hsla(0, 0%, 0%, 0.1)',\n dividerColor: gray50,\n menuItemColor: gray70,\n menuItemColorHover: white,\n menuItemBackgroundColor: 'hsl(228, 16.9%, 17.5%)',\n menuItemBackgroundColorHover: 'hsla(0, 0%, 0%, 0.3)',\n },\n balance: {\n borderColor: gray80,\n textColor: white,\n dailyEarnedColor: white,\n chartColor: black,\n chartBackgroundColor: white,\n },\n },\n light: {\n name: 'light',\n header: {\n backgroundColor: white,\n color: gray70,\n colorHover: black,\n boxShadow: '0 2px 8px 0 hsla(0, 0%, 0%, 0.1)',\n dividerColor: gray95,\n menuItemColor: gray70,\n menuItemColorHover: black,\n menuItemBackgroundColor: white,\n menuItemBackgroundColorHover: gray95,\n },\n balance: {\n borderColor: gray80,\n textColor: actionColor,\n dailyEarnedColor: actionColor,\n chartColor: white,\n chartBackgroundColor: black,\n },\n },\n transparent: {\n name: 'transparent',\n header: {\n backgroundColor: 'none',\n color: gray70,\n colorHover: black,\n dividerColor: gray50,\n menuItemColor: gray70,\n menuItemColorHover: white,\n menuItemBackgroundColor: 'hsl(228, 16.9%, 17.5%)',\n menuItemBackgroundColorHover: 'hsla(0, 0%, 0%, 0.3)',\n boxShadow: 'none',\n },\n balance: {\n borderColor: gray80,\n textColor: actionColor,\n dailyEarnedColor: actionColor,\n chartColor: white,\n chartBackgroundColor: black,\n },\n },\n};\n\nexport default themes;\n","import type {FC, ReactNode} from 'react';\nimport {useContext} from 'react';\nimport {ThemeContext} from 'styled-components';\nimport type {HeaderTheme} from './types';\nimport themes from './variables';\n\ntype ThemeContextProps = {\n theme?: HeaderTheme;\n children: ReactNode;\n};\n\nexport const ThemeContextProvider: FC<ThemeContextProps> = ({theme = themes.light, children}) => (\n <ThemeContext.Provider value={theme}>{children}</ThemeContext.Provider>\n);\n\nexport const useThemeContext = () => useContext(ThemeContext);\n","import type {FC, ReactNode} from 'react';\nimport type {CSSObject} from 'styled-components';\nimport HeaderItem from './HeaderItem';\nimport HeaderBalance from './HeaderBalance';\nimport HeaderTime from './HeaderTime';\nimport HeaderDivider from './HeaderDivider';\nimport HeaderDropdown from './HeaderDropdown';\nimport HeaderDropdownList from './HeaderDropdownList';\nimport {StyledHeader, StyledHeaderOptions, StyledHeaderBrand} from './style';\nimport {ThemeContextProvider} from './themes/context';\nimport themes from './themes/variables';\nimport type {HeaderTheme} from './themes/types';\n\ntype HeaderProps = {\n logo: ReactNode;\n customHeaderStyle?: CSSObject;\n sidebarButton?: ReactNode;\n children: ReactNode;\n theme?: HeaderTheme;\n id?: string;\n};\n\ntype HeaderCompound = FC<HeaderProps> & {\n Item: typeof HeaderItem;\n Balance: typeof HeaderBalance;\n Time: typeof HeaderTime;\n Divider: typeof HeaderDivider;\n Dropdown: typeof HeaderDropdown;\n DropdownList: typeof HeaderDropdownList;\n};\n\nconst HeaderRoot: FC<HeaderProps> = ({\n logo,\n customHeaderStyle = {},\n sidebarButton,\n children,\n theme,\n id = 'header-container',\n}) => (\n <ThemeContextProvider {...(theme ? {theme} : {})}>\n <StyledHeader id={id} $customHeaderStyle={customHeaderStyle}>\n <StyledHeaderBrand>\n {sidebarButton}\n {logo}\n </StyledHeaderBrand>\n\n <StyledHeaderOptions>{children}</StyledHeaderOptions>\n </StyledHeader>\n </ThemeContextProvider>\n);\n\nconst Header: HeaderCompound = Object.assign(HeaderRoot, {\n Item: HeaderItem,\n Balance: HeaderBalance,\n Time: HeaderTime,\n Divider: HeaderDivider,\n Dropdown: HeaderDropdown,\n DropdownList: HeaderDropdownList,\n});\n\nexport default Header;\nexport type {HeaderProps};\nexport {themes};\n"],"names":["useOnClickOutside","ref","handler","useEffect","listener","event","el","StyledHeaderItem","styled","StyledHeaderItemButton","fontNormal","spacing","props","StyledHeaderItemTitle","StyledHeaderItemDropdown","smallDevices","HeaderItem","id","children","isRightDropdown","icon","title","onClick","component","useRef","isShowDropdown","setDropdown","useState","titleComponent","jsx","jsxs","previousState","StyledHeaderBalance","StyledHeaderBalanceValue","StyledHeaderBalanceDailyEarned","StyledHeaderBalanceChartDay","fontSmall","borderRadius","StyledHeaderBalanceChart","StyledHeaderBalanceChartValue","HeaderBalanceChart","day","date","value","percentage","Currency","HeaderBalance","balance","dailyEarned","dailyEarnedExist","idx","StyledHeaderTime","dayjs","utc","getTime","HeaderTime","tooltipContent","ESTDate","time","setTime","timer","e","showTooltip","Position","hideTooltip","StyledHeaderDivider","HeaderDivider","StyledHeaderDropdown","HeaderDropdown","StyledHeaderDropdownItem","HeaderDropdownItem","item","HeaderDropdownList","items","Fragment","StyledHeader","StyledHeaderBrand","StyledHeaderOptions","themes","gray70","white","gray50","gray80","black","gray95","actionColor","ThemeContextProvider","theme","ThemeContext","HeaderRoot","logo","customHeaderStyle","sidebarButton","Header"],"mappings":";;;;;;;;AAGO,MAAMA,IAAoB,CAC/BC,GACAC,MACS;AACT,EAAAC,EAAU,MAAM;AACd,UAAMC,IAAW,CAACC,MAAmC;AACnD,YAAMC,IAAKL,EAAI;AACf,MAAI,CAACK,KAAMA,EAAG,SAASD,EAAM,MAAc,KAG3CH,EAAQG,CAAK;AAAA,IACf;AAEA,oBAAS,iBAAiB,aAAaD,CAAQ,GAC/C,SAAS,iBAAiB,cAAcA,CAAQ,GAEzC,MAAM;AACX,eAAS,oBAAoB,aAAaA,CAAQ,GAClD,SAAS,oBAAoB,cAAcA,CAAQ;AAAA,IACrD;AAAA,EACF,GAAG,CAACH,GAAKC,CAAO,CAAC;AACnB,GCrBMK,IAAmBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAO1BC,IAAyBD,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,eAKvBE,CAAU;AAAA;AAAA;AAAA,eAGVC,IAAU,CAAC;AAAA;AAAA;AAAA,WAGf,CAACC,MAAUA,EAAM,MAAM,OAAO,aAAa;AAAA;AAAA;AAAA,aAGzC,CAACA,MAAUA,EAAM,MAAM,OAAO,kBAAkB;AAAA;AAAA;AAAA,cAG/C,CAACA,MAAUA,EAAM,MAAM,OAAO,kBAAkB;AAAA;AAAA;AAAA,GAKxDC,IAAwBL,EAAO;AAAA,iBACpBG,CAAO;AAAA,GAOlBG,IAA2BN,EAAO;AAAA;AAAA,aAE3BG,CAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMhB,CAACC,MACDA,EAAM,oBACN;AAAA,gBACYA,EAAM,mBAAmB,YAAY,CAAC;AAAA,iBACrCA,EAAM,mBAAmB,IAAI,SAAS;AAAA,KAClD;AAAA;AAAA,uBAEkBG,CAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GCxC7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,GCmB3CuE,KAA8B,CAAC;AAAA,EACnC,MAAAC;AAAA,EACA,mBAAAC,IAAoB,CAAA;AAAA,EACpB,eAAAC;AAAA,EACA,UAAA1E;AAAA,EACA,OAAAqE;AAAA,EACA,IAAAtE,IAAK;AACP,MACE,gBAAAY,EAACyD,IAAA,EAAsB,GAAIC,IAAQ,EAAC,OAAAA,EAAA,IAAS,CAAA,GAC3C,UAAA,gBAAAzD,EAAC6C,IAAA,EAAa,IAAA1D,GAAQ,oBAAoB0E,GACxC,UAAA;AAAA,EAAA,gBAAA7D,EAAC8C,IAAA,EACE,UAAA;AAAA,IAAAgB;AAAA,IACAF;AAAA,EAAA,GACH;AAAA,EAEA,gBAAA7D,EAACgD,MAAqB,UAAA3D,EAAA,CAAS;AAAA,EAAA,CACjC,EAAA,CACF,GAGI2E,KAAyB,OAAO,OAAOJ,IAAY;AAAA,EACvD,MAAMzE;AAAA,EACN,SAAS8B;AAAA,EACT,MAAMS;AAAA,EACN,SAASW;AAAA,EACT,UAAUE;AAAA,EACV,cAAcI;AAChB,CAAC;"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@propellerads/header",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
"version": "7.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
7
12
|
"files": [
|
|
8
13
|
"dist"
|
|
9
14
|
],
|
|
@@ -14,25 +19,26 @@
|
|
|
14
19
|
"url": "https://github.com/propellerads/ui-components/issues"
|
|
15
20
|
},
|
|
16
21
|
"scripts": {
|
|
17
|
-
"
|
|
18
|
-
"build": "tsdx build"
|
|
22
|
+
"build": "tsc && vite build && rollup -c rollup.dts.config.mjs"
|
|
19
23
|
},
|
|
20
24
|
"homepage": "https://github.com/propellerads/ui-components#readme",
|
|
21
25
|
"private": false,
|
|
22
26
|
"dependencies": {
|
|
23
27
|
"@propellerads/currency": "^5.0.1",
|
|
24
|
-
"@propellerads/smart-tooltip": "^
|
|
25
|
-
"@propellerads/stylevariables": "^2.0.
|
|
26
|
-
"dayjs": "1.
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"tsdx": "0.14.1",
|
|
30
|
-
"tslib": "2.8.1",
|
|
31
|
-
"typescript": "4.9.5",
|
|
32
|
-
"@types/styled-components": "5.1.34"
|
|
28
|
+
"@propellerads/smart-tooltip": "^6.0.0",
|
|
29
|
+
"@propellerads/stylevariables": "^2.0.2",
|
|
30
|
+
"dayjs": "^1.11.20"
|
|
33
31
|
},
|
|
34
32
|
"peerDependencies": {
|
|
35
|
-
"react": "
|
|
36
|
-
"styled-components": "5.1.1"
|
|
33
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
34
|
+
"styled-components": "^5.1.1 || ^6.0.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/react": "^19.2.14",
|
|
38
|
+
"@vitejs/plugin-react": "^5.1.4",
|
|
39
|
+
"rollup": "^4.58.0",
|
|
40
|
+
"rollup-plugin-dts": "^6.3.0",
|
|
41
|
+
"typescript": "^5.9.3",
|
|
42
|
+
"vite": "^7.3.1"
|
|
37
43
|
}
|
|
38
44
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
interface IDayEarned {
|
|
3
|
-
date: string;
|
|
4
|
-
value: number;
|
|
5
|
-
percentage: number;
|
|
6
|
-
}
|
|
7
|
-
interface IHeaderBalanceProps {
|
|
8
|
-
balance: number;
|
|
9
|
-
dailyEarned?: IDayEarned[];
|
|
10
|
-
}
|
|
11
|
-
declare const HeaderBalance: FC<IHeaderBalanceProps>;
|
|
12
|
-
export default HeaderBalance;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
declare const StyledHeaderBalance: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
declare const StyledHeaderBalanceValue: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
declare const StyledHeaderBalanceDailyEarned: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
declare const StyledHeaderBalanceChartDay: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
5
|
-
declare const StyledHeaderBalanceChart: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
-
interface IStyledHeaderBalanceChartValueProps {
|
|
7
|
-
percentage: number;
|
|
8
|
-
}
|
|
9
|
-
declare const StyledHeaderBalanceChartValue: import("styled-components").StyledComponent<"div", any, IStyledHeaderBalanceChartValueProps, never>;
|
|
10
|
-
export { StyledHeaderBalance, StyledHeaderBalanceValue, StyledHeaderBalanceDailyEarned, StyledHeaderBalanceChart, StyledHeaderBalanceChartValue, StyledHeaderBalanceChartDay, };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
interface IHeaderItemProps {
|
|
3
|
-
id?: string;
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
onClick?: () => void;
|
|
6
|
-
component?: React.ReactNode;
|
|
7
|
-
icon?: React.ReactNode;
|
|
8
|
-
isRightDropdown?: boolean;
|
|
9
|
-
title?: string;
|
|
10
|
-
}
|
|
11
|
-
declare const HeaderItem: FC<IHeaderItemProps>;
|
|
12
|
-
export default HeaderItem;
|