@gustavo-valsechi/client 1.3.28 → 1.3.30
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/components/index.d.ts +3 -10
- package/dist/components/index.js +13 -3070
- package/dist/components/index.mjs +11 -3082
- package/dist/components/styles.d.ts +2 -0
- package/dist/components/styles.js +54 -0
- package/dist/components/styles.mjs +19 -0
- package/dist/components/types/avatar/index.d.ts +2 -0
- package/dist/components/types/avatar/index.js +63 -0
- package/dist/components/types/avatar/index.mjs +29 -0
- package/dist/components/types/avatar/styles.d.ts +1 -0
- package/dist/components/types/avatar/styles.js +93 -0
- package/dist/components/types/avatar/styles.mjs +59 -0
- package/dist/components/types/badge/index.d.ts +2 -0
- package/dist/components/types/badge/index.js +54 -0
- package/dist/components/types/badge/index.mjs +20 -0
- package/dist/components/types/badge/styles.d.ts +1 -0
- package/dist/components/types/badge/styles.js +71 -0
- package/dist/components/types/badge/styles.mjs +37 -0
- package/dist/components/types/block/index.d.ts +2 -0
- package/dist/components/types/block/index.js +44 -0
- package/dist/components/types/block/index.mjs +20 -0
- package/dist/components/types/block/styles.d.ts +2 -0
- package/dist/components/types/block/styles.js +65 -0
- package/dist/components/types/block/styles.mjs +30 -0
- package/dist/components/types/chart/index.d.ts +2 -0
- package/dist/components/types/chart/index.js +80 -0
- package/dist/components/types/chart/index.mjs +46 -0
- package/dist/components/types/chart/styles.d.ts +1 -0
- package/dist/components/types/chart/styles.js +42 -0
- package/dist/components/types/chart/styles.mjs +8 -0
- package/dist/components/types/credit-card/assets/index.d.ts +4 -0
- package/dist/components/types/credit-card/assets/index.js +41 -0
- package/dist/components/types/credit-card/assets/index.mjs +21 -0
- package/dist/components/types/credit-card/card/index.d.ts +2 -0
- package/dist/components/types/credit-card/card/index.js +67 -0
- package/dist/components/types/credit-card/card/index.mjs +37 -0
- package/dist/components/types/credit-card/card/styles.d.ts +1 -0
- package/dist/components/types/credit-card/card/styles.js +170 -0
- package/dist/components/types/credit-card/card/styles.mjs +136 -0
- package/dist/components/types/credit-card/functions/index.d.ts +2 -0
- package/dist/components/types/credit-card/functions/index.js +52 -0
- package/dist/components/types/credit-card/functions/index.mjs +22 -0
- package/dist/components/types/credit-card/functions/styles.d.ts +1 -0
- package/dist/components/types/credit-card/functions/styles.js +75 -0
- package/dist/components/types/credit-card/functions/styles.mjs +41 -0
- package/dist/components/types/credit-card/index.d.ts +2 -0
- package/dist/components/types/credit-card/index.js +70 -0
- package/dist/components/types/credit-card/index.mjs +36 -0
- package/dist/components/types/credit-card/styles.d.ts +1 -0
- package/dist/components/types/credit-card/styles.js +72 -0
- package/dist/components/types/credit-card/styles.mjs +38 -0
- package/dist/components/types/credit-card/tools/index.d.ts +6 -0
- package/dist/components/types/credit-card/tools/index.js +58 -0
- package/dist/components/types/credit-card/tools/index.mjs +23 -0
- package/dist/components/types/form/index.d.ts +3 -0
- package/dist/components/types/form/index.js +111 -0
- package/dist/components/types/form/index.mjs +75 -0
- package/dist/components/types/form/styles.d.ts +1 -0
- package/dist/components/types/form/styles.js +53 -0
- package/dist/components/types/form/styles.mjs +19 -0
- package/dist/components/types/form/types/button/index.d.ts +2 -0
- package/dist/components/types/form/types/button/index.js +58 -0
- package/dist/components/types/form/types/button/index.mjs +24 -0
- package/dist/components/types/form/types/button/loading/index.d.ts +1 -0
- package/dist/components/types/form/types/button/loading/index.js +38 -0
- package/dist/components/types/form/types/button/loading/index.mjs +14 -0
- package/dist/components/types/form/types/button/loading/styles.d.ts +1 -0
- package/dist/components/types/form/types/button/loading/styles.js +126 -0
- package/dist/components/types/form/types/button/loading/styles.mjs +92 -0
- package/dist/components/types/form/types/button/styles.d.ts +1 -0
- package/dist/components/types/form/types/button/styles.js +79 -0
- package/dist/components/types/form/types/button/styles.mjs +45 -0
- package/dist/components/types/form/types/datetime/index.d.ts +2 -0
- package/dist/components/types/form/types/datetime/index.js +72 -0
- package/dist/components/types/form/types/datetime/index.mjs +38 -0
- package/dist/components/types/form/types/datetime/styles.d.ts +1 -0
- package/dist/components/types/form/types/datetime/styles.js +78 -0
- package/dist/components/types/form/types/datetime/styles.mjs +44 -0
- package/dist/components/types/form/types/file/index.d.ts +2 -0
- package/dist/components/types/form/types/file/index.js +71 -0
- package/dist/components/types/form/types/file/index.mjs +47 -0
- package/dist/components/types/form/types/file/styles.d.ts +1 -0
- package/dist/components/types/form/types/file/styles.js +65 -0
- package/dist/components/types/form/types/file/styles.mjs +31 -0
- package/dist/components/types/form/types/index.d.ts +7 -0
- package/dist/components/types/form/types/index.js +35 -0
- package/dist/components/types/form/types/index.mjs +8 -0
- package/dist/components/types/form/types/input/index.d.ts +2 -0
- package/dist/components/types/form/types/input/index.js +84 -0
- package/dist/components/types/form/types/input/index.mjs +50 -0
- package/dist/components/types/form/types/input/styles.d.ts +1 -0
- package/dist/components/types/form/types/input/styles.js +84 -0
- package/dist/components/types/form/types/input/styles.mjs +50 -0
- package/dist/components/types/form/types/label/index.d.ts +2 -0
- package/dist/components/types/form/types/label/index.js +34 -0
- package/dist/components/types/form/types/label/index.mjs +10 -0
- package/dist/components/types/form/types/label/styles.d.ts +1 -0
- package/dist/components/types/form/types/label/styles.js +45 -0
- package/dist/components/types/form/types/label/styles.mjs +11 -0
- package/dist/components/types/form/types/select/index.d.ts +2 -0
- package/dist/components/types/form/types/select/index.js +90 -0
- package/dist/components/types/form/types/select/index.mjs +56 -0
- package/dist/components/types/form/types/select/styles.d.ts +1 -0
- package/dist/components/types/form/types/select/styles.js +90 -0
- package/dist/components/types/form/types/select/styles.mjs +56 -0
- package/dist/components/types/form/types/textarea/index.d.ts +2 -0
- package/dist/components/types/form/types/textarea/index.js +72 -0
- package/dist/components/types/form/types/textarea/index.mjs +38 -0
- package/dist/components/types/form/types/textarea/styles.d.ts +1 -0
- package/dist/components/types/form/types/textarea/styles.js +77 -0
- package/dist/components/types/form/types/textarea/styles.mjs +43 -0
- package/dist/components/types/index.d.ts +11 -0
- package/dist/components/types/index.js +43 -0
- package/dist/components/types/index.mjs +12 -0
- package/dist/components/types/loading/app/index.d.ts +2 -0
- package/dist/components/types/loading/app/index.js +35 -0
- package/dist/components/types/loading/app/index.mjs +11 -0
- package/dist/components/types/loading/app/styles.d.ts +1 -0
- package/dist/components/types/loading/app/styles.js +125 -0
- package/dist/components/types/loading/app/styles.mjs +91 -0
- package/dist/components/types/loading/bar/index.d.ts +2 -0
- package/dist/components/types/loading/bar/index.js +34 -0
- package/dist/components/types/loading/bar/index.mjs +10 -0
- package/dist/components/types/loading/bar/styles.d.ts +1 -0
- package/dist/components/types/loading/bar/styles.js +59 -0
- package/dist/components/types/loading/bar/styles.mjs +25 -0
- package/dist/components/types/loading/index.d.ts +2 -0
- package/dist/components/types/loading/index.js +25 -0
- package/dist/components/types/loading/index.mjs +3 -0
- package/dist/components/types/logo/index.d.ts +2 -0
- package/dist/components/types/logo/index.js +37 -0
- package/dist/components/types/logo/index.mjs +13 -0
- package/dist/components/types/logo/styles.d.ts +1 -0
- package/dist/components/types/logo/styles.js +57 -0
- package/dist/components/types/logo/styles.mjs +23 -0
- package/dist/components/types/lottie/animations/index.d.ts +293 -0
- package/dist/components/types/lottie/animations/index.js +36 -0
- package/dist/components/types/lottie/animations/index.mjs +6 -0
- package/dist/components/types/lottie/index.d.ts +2 -0
- package/dist/components/types/lottie/index.js +72 -0
- package/dist/components/types/lottie/index.mjs +38 -0
- package/dist/components/types/lottie/styles.d.ts +1 -0
- package/dist/components/types/lottie/styles.js +60 -0
- package/dist/components/types/lottie/styles.mjs +26 -0
- package/dist/components/types/modal/index.d.ts +2 -0
- package/dist/components/types/modal/index.js +66 -0
- package/dist/components/types/modal/index.mjs +32 -0
- package/dist/components/types/modal/styles.d.ts +1 -0
- package/dist/components/types/modal/styles.js +167 -0
- package/dist/components/types/modal/styles.mjs +133 -0
- package/dist/components/types/table/index.d.ts +3 -0
- package/dist/components/types/table/index.js +171 -0
- package/dist/components/types/table/index.mjs +135 -0
- package/dist/components/types/table/modal/actions.d.ts +10 -0
- package/dist/components/types/table/modal/actions.js +30 -0
- package/dist/components/types/table/modal/actions.mjs +10 -0
- package/dist/components/types/table/modal/index.d.ts +2 -0
- package/dist/components/types/table/modal/index.js +91 -0
- package/dist/components/types/table/modal/index.mjs +61 -0
- package/dist/components/types/table/modal/styles.d.ts +1 -0
- package/dist/components/types/table/modal/styles.js +90 -0
- package/dist/components/types/table/modal/styles.mjs +56 -0
- package/dist/components/types/table/paginate/index.d.ts +2 -0
- package/dist/components/types/table/paginate/index.js +92 -0
- package/dist/components/types/table/paginate/index.mjs +58 -0
- package/dist/components/types/table/paginate/styles.d.ts +1 -0
- package/dist/components/types/table/paginate/styles.js +74 -0
- package/dist/components/types/table/paginate/styles.mjs +40 -0
- package/dist/components/types/table/styles.d.ts +5 -0
- package/dist/components/types/table/styles.js +300 -0
- package/dist/components/types/table/styles.mjs +266 -0
- package/dist/contexts/icon/assets/brands/index.d.ts +2 -0
- package/dist/contexts/icon/assets/brands/index.js +31 -0
- package/dist/contexts/icon/assets/brands/index.mjs +11 -0
- package/dist/contexts/icon/assets/index.d.ts +6 -0
- package/dist/contexts/icon/assets/index.js +42 -0
- package/dist/contexts/icon/assets/index.mjs +12 -0
- package/dist/contexts/icon/assets/regular/index.d.ts +2 -0
- package/dist/contexts/icon/assets/regular/index.js +31 -0
- package/dist/contexts/icon/assets/regular/index.mjs +11 -0
- package/dist/contexts/icon/assets/solid/index.d.ts +2 -0
- package/dist/contexts/icon/assets/solid/index.js +31 -0
- package/dist/contexts/icon/assets/solid/index.mjs +11 -0
- package/dist/contexts/icon/index.d.ts +4 -0
- package/dist/contexts/icon/index.js +107 -0
- package/dist/contexts/icon/index.mjs +72 -0
- package/dist/contexts/icon/styles.d.ts +1 -0
- package/dist/contexts/icon/styles.js +42 -0
- package/dist/contexts/icon/styles.mjs +8 -0
- package/dist/contexts/index.d.ts +4 -20
- package/dist/contexts/index.js +9 -504
- package/dist/contexts/index.mjs +4 -486
- package/dist/contexts/modal/index.d.ts +4 -0
- package/dist/contexts/modal/index.js +92 -0
- package/dist/contexts/modal/index.mjs +57 -0
- package/dist/contexts/modal/styles.d.ts +1 -0
- package/dist/contexts/modal/styles.js +42 -0
- package/dist/contexts/modal/styles.mjs +8 -0
- package/dist/contexts/theme/content.d.ts +3 -0
- package/dist/contexts/theme/content.js +104 -0
- package/dist/contexts/theme/content.mjs +79 -0
- package/dist/contexts/theme/index.d.ts +4 -0
- package/dist/contexts/theme/index.js +68 -0
- package/dist/contexts/theme/index.mjs +43 -0
- package/dist/contexts/theme/styles.d.ts +1 -0
- package/dist/contexts/theme/styles.js +116 -0
- package/dist/contexts/theme/styles.mjs +82 -0
- package/dist/contexts/tooltip/index.d.ts +6 -0
- package/dist/contexts/tooltip/index.js +107 -0
- package/dist/contexts/tooltip/index.mjs +72 -0
- package/dist/contexts/tooltip/styles.d.ts +1 -0
- package/dist/contexts/tooltip/styles.js +78 -0
- package/dist/contexts/tooltip/styles.mjs +44 -0
- package/dist/index.d.ts +4 -17
- package/dist/index.js +8 -3325
- package/dist/index.mjs +4 -3312
- package/dist/interfaces/components/avatar/index.d.ts +6 -0
- package/dist/interfaces/components/avatar/index.js +17 -0
- package/dist/interfaces/components/avatar/index.mjs +1 -0
- package/dist/interfaces/components/badge/index.d.ts +3 -0
- package/dist/interfaces/components/badge/index.js +17 -0
- package/dist/interfaces/components/badge/index.mjs +1 -0
- package/dist/interfaces/components/block/index.d.ts +16 -0
- package/dist/interfaces/components/block/index.js +17 -0
- package/dist/interfaces/components/block/index.mjs +1 -0
- package/dist/interfaces/components/chart/index.d.ts +9 -0
- package/dist/interfaces/components/chart/index.js +17 -0
- package/dist/interfaces/components/chart/index.mjs +1 -0
- package/dist/interfaces/components/credit-card/index.d.ts +16 -0
- package/dist/interfaces/components/credit-card/index.js +17 -0
- package/dist/interfaces/components/credit-card/index.mjs +1 -0
- package/dist/interfaces/components/form/button/index.d.ts +7 -0
- package/dist/interfaces/components/form/button/index.js +17 -0
- package/dist/interfaces/components/form/button/index.mjs +1 -0
- package/dist/interfaces/components/form/datetime/index.d.ts +15 -0
- package/dist/interfaces/components/form/datetime/index.js +17 -0
- package/dist/interfaces/components/form/datetime/index.mjs +1 -0
- package/dist/interfaces/components/form/file/index.d.ts +14 -0
- package/dist/interfaces/components/form/file/index.js +17 -0
- package/dist/interfaces/components/form/file/index.mjs +1 -0
- package/dist/interfaces/components/form/index.d.ts +16 -0
- package/dist/interfaces/components/form/index.js +35 -0
- package/dist/interfaces/components/form/index.mjs +8 -0
- package/dist/interfaces/components/form/input/index.d.ts +17 -0
- package/dist/interfaces/components/form/input/index.js +17 -0
- package/dist/interfaces/components/form/input/index.mjs +1 -0
- package/dist/interfaces/components/form/label/index.d.ts +5 -0
- package/dist/interfaces/components/form/label/index.js +17 -0
- package/dist/interfaces/components/form/label/index.mjs +1 -0
- package/dist/interfaces/components/form/select/index.d.ts +14 -0
- package/dist/interfaces/components/form/select/index.js +17 -0
- package/dist/interfaces/components/form/select/index.mjs +1 -0
- package/dist/interfaces/components/form/textarea/index.d.ts +16 -0
- package/dist/interfaces/components/form/textarea/index.js +17 -0
- package/dist/interfaces/components/form/textarea/index.mjs +1 -0
- package/dist/interfaces/components/index.d.ts +26 -0
- package/dist/interfaces/components/index.js +43 -0
- package/dist/interfaces/components/index.mjs +12 -0
- package/dist/interfaces/components/loading/app/index.d.ts +3 -0
- package/dist/interfaces/components/loading/app/index.js +17 -0
- package/dist/interfaces/components/loading/app/index.mjs +1 -0
- package/dist/interfaces/components/loading/bar/index.d.ts +7 -0
- package/dist/interfaces/components/loading/bar/index.js +17 -0
- package/dist/interfaces/components/loading/bar/index.mjs +1 -0
- package/dist/interfaces/components/loading/index.d.ts +2 -0
- package/dist/interfaces/components/loading/index.js +25 -0
- package/dist/interfaces/components/loading/index.mjs +3 -0
- package/dist/interfaces/components/logo/index.d.ts +6 -0
- package/dist/interfaces/components/logo/index.js +17 -0
- package/dist/interfaces/components/logo/index.mjs +1 -0
- package/dist/interfaces/components/lottie/index.d.ts +12 -0
- package/dist/interfaces/components/lottie/index.js +17 -0
- package/dist/interfaces/components/lottie/index.mjs +1 -0
- package/dist/interfaces/components/modal/index.d.ts +16 -0
- package/dist/interfaces/components/modal/index.js +17 -0
- package/dist/interfaces/components/modal/index.mjs +1 -0
- package/dist/interfaces/components/table/index.d.ts +46 -0
- package/dist/interfaces/components/table/index.js +23 -0
- package/dist/interfaces/components/table/index.mjs +2 -0
- package/dist/interfaces/components/table/paginate/index.d.ts +7 -0
- package/dist/interfaces/components/table/paginate/index.js +17 -0
- package/dist/interfaces/components/table/paginate/index.mjs +1 -0
- package/dist/interfaces/contexts/icon/index.d.ts +3 -0
- package/dist/interfaces/contexts/icon/index.js +17 -0
- package/dist/interfaces/contexts/icon/index.mjs +1 -0
- package/dist/interfaces/contexts/index.d.ts +8 -0
- package/dist/interfaces/contexts/index.js +29 -0
- package/dist/interfaces/contexts/index.mjs +5 -0
- package/dist/interfaces/contexts/modal/index.d.ts +16 -0
- package/dist/interfaces/contexts/modal/index.js +18 -0
- package/dist/interfaces/contexts/modal/index.mjs +2 -0
- package/dist/interfaces/contexts/theme/index.d.ts +42 -0
- package/dist/interfaces/contexts/theme/index.js +17 -0
- package/dist/interfaces/contexts/theme/index.mjs +1 -0
- package/dist/interfaces/contexts/tooltip/index.d.ts +3 -0
- package/dist/interfaces/contexts/tooltip/index.js +17 -0
- package/dist/interfaces/contexts/tooltip/index.mjs +1 -0
- package/dist/interfaces/index.d.ts +2 -12
- package/dist/interfaces/index.js +8 -2
- package/dist/interfaces/index.mjs +2 -0
- package/dist/styled.d.ts +6 -0
- package/dist/tsup.config.d.ts +2 -0
- package/package.json +5 -5
- package/dist/components/index.d.mts +0 -10
- package/dist/contexts/index.d.mts +0 -20
- package/dist/index-BhaGW0O1.d.ts +0 -601
- package/dist/index-BxA8LyyD.d.mts +0 -68
- package/dist/index-DDi0w5pw.d.mts +0 -601
- package/dist/index-DT7VKE7H.d.ts +0 -68
- package/dist/index-Da-DtPS-.d.mts +0 -29
- package/dist/index-Da-DtPS-.d.ts +0 -29
- package/dist/index.d.mts +0 -17
- package/dist/interfaces/index.d.mts +0 -12
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var content_exports = {};
|
|
21
|
+
__export(content_exports, {
|
|
22
|
+
CommonTheme: () => CommonTheme,
|
|
23
|
+
Themes: () => Themes
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(content_exports);
|
|
26
|
+
const CommonTheme = {
|
|
27
|
+
secondary: "#5869da",
|
|
28
|
+
tertiary: "#629dfd33",
|
|
29
|
+
positive: "#65c965",
|
|
30
|
+
negative: "#FF334E",
|
|
31
|
+
mobileMaxWidth: "650px",
|
|
32
|
+
mobileMinWidth: "315px"
|
|
33
|
+
};
|
|
34
|
+
const Themes = {
|
|
35
|
+
light: {
|
|
36
|
+
primary: "#ffffff",
|
|
37
|
+
reverse: "#353535",
|
|
38
|
+
tooltip: "#f2f2f2",
|
|
39
|
+
t8: "#000000cc",
|
|
40
|
+
t7: "#000000b3",
|
|
41
|
+
t6: "#00000099",
|
|
42
|
+
t5: "#00000080",
|
|
43
|
+
t4: "#00000066",
|
|
44
|
+
t3: "#0000004d",
|
|
45
|
+
t2: "#00000033",
|
|
46
|
+
t1: "#0000001a",
|
|
47
|
+
t08: "#00000014",
|
|
48
|
+
t05: "#0000000d",
|
|
49
|
+
t03: "#00000007",
|
|
50
|
+
t02: "#00000005",
|
|
51
|
+
t01: "#00000002",
|
|
52
|
+
lgrad: `linear-gradient(
|
|
53
|
+
to right,
|
|
54
|
+
#dadef7 0%,
|
|
55
|
+
#dee2f8 5%,
|
|
56
|
+
#e2e5f9 10%,
|
|
57
|
+
#e6e9fa 20%,
|
|
58
|
+
#eaedfb 30%,
|
|
59
|
+
#eff0fb 60%,
|
|
60
|
+
#f3f4fc 80%,
|
|
61
|
+
#f7f8fd 90%,
|
|
62
|
+
#fbfbfe 100%
|
|
63
|
+
)`,
|
|
64
|
+
maingrad: "linear-gradient(330deg, #b9c0ff7a 0%, #ffffff 100%)",
|
|
65
|
+
...CommonTheme
|
|
66
|
+
},
|
|
67
|
+
dark: {
|
|
68
|
+
primary: "#333333",
|
|
69
|
+
reverse: "#b45252",
|
|
70
|
+
tooltip: "#3d3d3d",
|
|
71
|
+
t8: "#ffffffcc",
|
|
72
|
+
t7: "#ffffffb3",
|
|
73
|
+
t6: "#ffffff99",
|
|
74
|
+
t5: "#ffffff80",
|
|
75
|
+
t4: "#ffffff66",
|
|
76
|
+
t3: "#ffffff4d",
|
|
77
|
+
t2: "#ffffff33",
|
|
78
|
+
t1: "#ffffff1a",
|
|
79
|
+
t08: "#ffffff14",
|
|
80
|
+
t05: "#ffffff0d",
|
|
81
|
+
t03: "#ffffff07",
|
|
82
|
+
t02: "#ffffff05",
|
|
83
|
+
t01: "#ffffff02",
|
|
84
|
+
lgrad: `linear-gradient(
|
|
85
|
+
to right,
|
|
86
|
+
#3d485c 0%,
|
|
87
|
+
#3c4657 5%,
|
|
88
|
+
#3b4353 10%,
|
|
89
|
+
#3a414e 20%,
|
|
90
|
+
#393f4a 30%,
|
|
91
|
+
#373c45 60%,
|
|
92
|
+
#363a41 80%,
|
|
93
|
+
#35383c 90%,
|
|
94
|
+
#343538 100%
|
|
95
|
+
)`,
|
|
96
|
+
maingrad: "linear-gradient(330deg, #1d1e27 0%, #333333 100%)",
|
|
97
|
+
...CommonTheme
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
101
|
+
0 && (module.exports = {
|
|
102
|
+
CommonTheme,
|
|
103
|
+
Themes
|
|
104
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const CommonTheme = {
|
|
3
|
+
secondary: "#5869da",
|
|
4
|
+
tertiary: "#629dfd33",
|
|
5
|
+
positive: "#65c965",
|
|
6
|
+
negative: "#FF334E",
|
|
7
|
+
mobileMaxWidth: "650px",
|
|
8
|
+
mobileMinWidth: "315px"
|
|
9
|
+
};
|
|
10
|
+
const Themes = {
|
|
11
|
+
light: {
|
|
12
|
+
primary: "#ffffff",
|
|
13
|
+
reverse: "#353535",
|
|
14
|
+
tooltip: "#f2f2f2",
|
|
15
|
+
t8: "#000000cc",
|
|
16
|
+
t7: "#000000b3",
|
|
17
|
+
t6: "#00000099",
|
|
18
|
+
t5: "#00000080",
|
|
19
|
+
t4: "#00000066",
|
|
20
|
+
t3: "#0000004d",
|
|
21
|
+
t2: "#00000033",
|
|
22
|
+
t1: "#0000001a",
|
|
23
|
+
t08: "#00000014",
|
|
24
|
+
t05: "#0000000d",
|
|
25
|
+
t03: "#00000007",
|
|
26
|
+
t02: "#00000005",
|
|
27
|
+
t01: "#00000002",
|
|
28
|
+
lgrad: `linear-gradient(
|
|
29
|
+
to right,
|
|
30
|
+
#dadef7 0%,
|
|
31
|
+
#dee2f8 5%,
|
|
32
|
+
#e2e5f9 10%,
|
|
33
|
+
#e6e9fa 20%,
|
|
34
|
+
#eaedfb 30%,
|
|
35
|
+
#eff0fb 60%,
|
|
36
|
+
#f3f4fc 80%,
|
|
37
|
+
#f7f8fd 90%,
|
|
38
|
+
#fbfbfe 100%
|
|
39
|
+
)`,
|
|
40
|
+
maingrad: "linear-gradient(330deg, #b9c0ff7a 0%, #ffffff 100%)",
|
|
41
|
+
...CommonTheme
|
|
42
|
+
},
|
|
43
|
+
dark: {
|
|
44
|
+
primary: "#333333",
|
|
45
|
+
reverse: "#b45252",
|
|
46
|
+
tooltip: "#3d3d3d",
|
|
47
|
+
t8: "#ffffffcc",
|
|
48
|
+
t7: "#ffffffb3",
|
|
49
|
+
t6: "#ffffff99",
|
|
50
|
+
t5: "#ffffff80",
|
|
51
|
+
t4: "#ffffff66",
|
|
52
|
+
t3: "#ffffff4d",
|
|
53
|
+
t2: "#ffffff33",
|
|
54
|
+
t1: "#ffffff1a",
|
|
55
|
+
t08: "#ffffff14",
|
|
56
|
+
t05: "#ffffff0d",
|
|
57
|
+
t03: "#ffffff07",
|
|
58
|
+
t02: "#ffffff05",
|
|
59
|
+
t01: "#ffffff02",
|
|
60
|
+
lgrad: `linear-gradient(
|
|
61
|
+
to right,
|
|
62
|
+
#3d485c 0%,
|
|
63
|
+
#3c4657 5%,
|
|
64
|
+
#3b4353 10%,
|
|
65
|
+
#3a414e 20%,
|
|
66
|
+
#393f4a 30%,
|
|
67
|
+
#373c45 60%,
|
|
68
|
+
#363a41 80%,
|
|
69
|
+
#35383c 90%,
|
|
70
|
+
#343538 100%
|
|
71
|
+
)`,
|
|
72
|
+
maingrad: "linear-gradient(330deg, #1d1e27 0%, #333333 100%)",
|
|
73
|
+
...CommonTheme
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
CommonTheme,
|
|
78
|
+
Themes
|
|
79
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IThemeProvider, IThemeContext } from "@interfaces";
|
|
2
|
+
declare const ThemeProviderContainer: (props: IThemeProvider) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const useTheme: () => IThemeContext;
|
|
4
|
+
export { ThemeProviderContainer as ThemeProvider, useTheme };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var theme_exports = {};
|
|
22
|
+
__export(theme_exports, {
|
|
23
|
+
ThemeProvider: () => ThemeProviderContainer,
|
|
24
|
+
useTheme: () => useTheme
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(theme_exports);
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
var import_styled_components = require("styled-components");
|
|
30
|
+
var import_styles = require("./styles");
|
|
31
|
+
var import_content = require("./content");
|
|
32
|
+
const ThemeContext = (0, import_react.createContext)({});
|
|
33
|
+
const ThemeProviderContainer = (props) => {
|
|
34
|
+
const [theme, setTheme] = (0, import_react.useState)("light");
|
|
35
|
+
const [defaultTheme] = (0, import_react.useState)("light");
|
|
36
|
+
const SwitcherComponent = () => {
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
38
|
+
import_styles.Switcher,
|
|
39
|
+
{
|
|
40
|
+
onClick: () => setTheme(theme === "light" ? "dark" : "light"),
|
|
41
|
+
"data-theme": theme || defaultTheme,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-moon" }),
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "switcher", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}) }),
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-sun" })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
ThemeContext.Provider,
|
|
52
|
+
{
|
|
53
|
+
value: {
|
|
54
|
+
theme: props.theme || defaultTheme,
|
|
55
|
+
setTheme,
|
|
56
|
+
content: import_content.Themes[props.theme || defaultTheme],
|
|
57
|
+
Switcher: SwitcherComponent
|
|
58
|
+
},
|
|
59
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled_components.ThemeProvider, { theme: import_content.Themes[props.theme || defaultTheme], children: props.children })
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
const useTheme = () => (0, import_react.useContext)(ThemeContext);
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
ThemeProvider,
|
|
67
|
+
useTheme
|
|
68
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { createContext, useContext, useState } from "react";
|
|
5
|
+
import { ThemeProvider } from "styled-components";
|
|
6
|
+
import { Switcher } from "./styles";
|
|
7
|
+
import { Themes } from "./content";
|
|
8
|
+
const ThemeContext = createContext({});
|
|
9
|
+
const ThemeProviderContainer = (props) => {
|
|
10
|
+
const [theme, setTheme] = useState("light");
|
|
11
|
+
const [defaultTheme] = useState("light");
|
|
12
|
+
const SwitcherComponent = () => {
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
|
+
Switcher,
|
|
15
|
+
{
|
|
16
|
+
onClick: () => setTheme(theme === "light" ? "dark" : "light"),
|
|
17
|
+
"data-theme": theme || defaultTheme,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx("i", { "aria-hidden": true, className: "fa-solid fa-moon" }),
|
|
20
|
+
/* @__PURE__ */ jsx("div", { className: "switcher", children: /* @__PURE__ */ jsx("div", {}) }),
|
|
21
|
+
/* @__PURE__ */ jsx("i", { "aria-hidden": true, className: "fa-solid fa-sun" })
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
ThemeContext.Provider,
|
|
28
|
+
{
|
|
29
|
+
value: {
|
|
30
|
+
theme: props.theme || defaultTheme,
|
|
31
|
+
setTheme,
|
|
32
|
+
content: Themes[props.theme || defaultTheme],
|
|
33
|
+
Switcher: SwitcherComponent
|
|
34
|
+
},
|
|
35
|
+
children: /* @__PURE__ */ jsx(ThemeProvider, { theme: Themes[props.theme || defaultTheme], children: props.children })
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
const useTheme = () => useContext(ThemeContext);
|
|
40
|
+
export {
|
|
41
|
+
ThemeProviderContainer as ThemeProvider,
|
|
42
|
+
useTheme
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Switcher: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var styles_exports = {};
|
|
31
|
+
__export(styles_exports, {
|
|
32
|
+
Switcher: () => Switcher
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(styles_exports);
|
|
35
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
+
const Switcher = import_styled_components.default.div`
|
|
37
|
+
width: 3rem;
|
|
38
|
+
height: 1.5rem;
|
|
39
|
+
border-radius: 1rem;
|
|
40
|
+
border: 2px solid ${({ theme }) => theme.t05};
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
position: relative;
|
|
46
|
+
|
|
47
|
+
i {
|
|
48
|
+
color: ${({ theme }) => theme.t6};
|
|
49
|
+
position: absolute;
|
|
50
|
+
transform: translateY(-50%);
|
|
51
|
+
font-size: .9rem;
|
|
52
|
+
z-index: 0;
|
|
53
|
+
transition: ease .8s;
|
|
54
|
+
|
|
55
|
+
&:first-child {
|
|
56
|
+
left: .2rem;
|
|
57
|
+
top: 50%;
|
|
58
|
+
opacity: ${(props) => props["data-theme"] === "light" ? 0 : 1};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:last-child {
|
|
62
|
+
right: .2rem;
|
|
63
|
+
top: 50%;
|
|
64
|
+
opacity: ${(props) => props["data-theme"] === "light" ? 1 : 0};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.switcher {
|
|
69
|
+
width: 1rem;
|
|
70
|
+
height: 1rem;
|
|
71
|
+
border-radius: 1rem;
|
|
72
|
+
position: relative;
|
|
73
|
+
transition: ease .3s;
|
|
74
|
+
transform: ${(props) => props["data-theme"] === "light" ? "transform: translateX(.2rem)" : "translateX(1.6rem)"};
|
|
75
|
+
z-index: 1;
|
|
76
|
+
|
|
77
|
+
div {
|
|
78
|
+
width: 100%;
|
|
79
|
+
height: 100%;
|
|
80
|
+
background: ${({ theme }) => theme.primary};
|
|
81
|
+
border-radius: 1rem;
|
|
82
|
+
position: relative;
|
|
83
|
+
z-index: 2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:after {
|
|
87
|
+
content: "";
|
|
88
|
+
position: absolute;
|
|
89
|
+
width: 100%;
|
|
90
|
+
height: 100%;
|
|
91
|
+
border-radius: 1rem;
|
|
92
|
+
transform: scale(1.8);
|
|
93
|
+
background: ${({ theme }) => theme.t05};
|
|
94
|
+
top: 0;
|
|
95
|
+
left: 0;
|
|
96
|
+
z-index: 1;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&:before {
|
|
100
|
+
content: "";
|
|
101
|
+
position: absolute;
|
|
102
|
+
width: 100%;
|
|
103
|
+
height: 100%;
|
|
104
|
+
border-radius: 1rem;
|
|
105
|
+
transform: scale(3);
|
|
106
|
+
background: ${({ theme }) => theme.t05};
|
|
107
|
+
top: 0;
|
|
108
|
+
left: 0;
|
|
109
|
+
z-index: 0;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
114
|
+
0 && (module.exports = {
|
|
115
|
+
Switcher
|
|
116
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
const Switcher = styled.div`
|
|
4
|
+
width: 3rem;
|
|
5
|
+
height: 1.5rem;
|
|
6
|
+
border-radius: 1rem;
|
|
7
|
+
border: 2px solid ${({ theme }) => theme.t05};
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
position: relative;
|
|
13
|
+
|
|
14
|
+
i {
|
|
15
|
+
color: ${({ theme }) => theme.t6};
|
|
16
|
+
position: absolute;
|
|
17
|
+
transform: translateY(-50%);
|
|
18
|
+
font-size: .9rem;
|
|
19
|
+
z-index: 0;
|
|
20
|
+
transition: ease .8s;
|
|
21
|
+
|
|
22
|
+
&:first-child {
|
|
23
|
+
left: .2rem;
|
|
24
|
+
top: 50%;
|
|
25
|
+
opacity: ${(props) => props["data-theme"] === "light" ? 0 : 1};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:last-child {
|
|
29
|
+
right: .2rem;
|
|
30
|
+
top: 50%;
|
|
31
|
+
opacity: ${(props) => props["data-theme"] === "light" ? 1 : 0};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.switcher {
|
|
36
|
+
width: 1rem;
|
|
37
|
+
height: 1rem;
|
|
38
|
+
border-radius: 1rem;
|
|
39
|
+
position: relative;
|
|
40
|
+
transition: ease .3s;
|
|
41
|
+
transform: ${(props) => props["data-theme"] === "light" ? "transform: translateX(.2rem)" : "translateX(1.6rem)"};
|
|
42
|
+
z-index: 1;
|
|
43
|
+
|
|
44
|
+
div {
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
background: ${({ theme }) => theme.primary};
|
|
48
|
+
border-radius: 1rem;
|
|
49
|
+
position: relative;
|
|
50
|
+
z-index: 2;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:after {
|
|
54
|
+
content: "";
|
|
55
|
+
position: absolute;
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: 100%;
|
|
58
|
+
border-radius: 1rem;
|
|
59
|
+
transform: scale(1.8);
|
|
60
|
+
background: ${({ theme }) => theme.t05};
|
|
61
|
+
top: 0;
|
|
62
|
+
left: 0;
|
|
63
|
+
z-index: 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:before {
|
|
67
|
+
content: "";
|
|
68
|
+
position: absolute;
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 100%;
|
|
71
|
+
border-radius: 1rem;
|
|
72
|
+
transform: scale(3);
|
|
73
|
+
background: ${({ theme }) => theme.t05};
|
|
74
|
+
top: 0;
|
|
75
|
+
left: 0;
|
|
76
|
+
z-index: 0;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
export {
|
|
81
|
+
Switcher
|
|
82
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const TooltipProviderContainer: ({ children }: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const useTooltip: () => any;
|
|
6
|
+
export { TooltipProviderContainer as TooltipProvider, useTooltip };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
var tooltip_exports = {};
|
|
32
|
+
__export(tooltip_exports, {
|
|
33
|
+
TooltipProvider: () => TooltipProviderContainer,
|
|
34
|
+
useTooltip: () => useTooltip
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(tooltip_exports);
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
+
var import_react = require("react");
|
|
39
|
+
var import_styles = require("./styles");
|
|
40
|
+
var import_lodash = __toESM(require("lodash"));
|
|
41
|
+
const TooltipContext = (0, import_react.createContext)({});
|
|
42
|
+
const TooltipProviderContainer = ({ children }) => {
|
|
43
|
+
const [tooltips, setTooltips] = (0, import_react.useState)([]);
|
|
44
|
+
const getContent = (target) => {
|
|
45
|
+
var _a;
|
|
46
|
+
const rect = target.getBoundingClientRect();
|
|
47
|
+
return {
|
|
48
|
+
top: rect.top + window.scrollY - (target.offsetHeight + 8),
|
|
49
|
+
left: rect.left + window.scrollX + target.offsetWidth / 2,
|
|
50
|
+
content: ((_a = target.dataset) == null ? void 0 : _a.tooltip) || ""
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
(0, import_react.useEffect)(() => {
|
|
54
|
+
const processElement = (element) => {
|
|
55
|
+
element.addEventListener("mouseenter", (event) => {
|
|
56
|
+
const target = event == null ? void 0 : event.target;
|
|
57
|
+
if (!target) return;
|
|
58
|
+
setTooltips(import_lodash.default.concat(tooltips, [getContent(target)]));
|
|
59
|
+
});
|
|
60
|
+
element.addEventListener("mouseleave", (event) => {
|
|
61
|
+
const target = event == null ? void 0 : event.target;
|
|
62
|
+
if (!target) return;
|
|
63
|
+
setTooltips(import_lodash.default.filter(tooltips, (data) => JSON.stringify(data) === JSON.stringify(getContent(target))));
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
document.querySelectorAll("[data-tooltip]").forEach((el) => processElement(el));
|
|
67
|
+
const observer = new MutationObserver((mutations) => {
|
|
68
|
+
mutations.forEach((mutation) => {
|
|
69
|
+
mutation.addedNodes.forEach((node) => {
|
|
70
|
+
if (node.nodeType === 1) {
|
|
71
|
+
const el = node;
|
|
72
|
+
if (el.getAttribute("data-tooltip")) processElement(el);
|
|
73
|
+
el.querySelectorAll("[data-tooltip]").forEach((child) => processElement(child));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
observer.observe(document.body, {
|
|
79
|
+
childList: true,
|
|
80
|
+
subtree: true
|
|
81
|
+
});
|
|
82
|
+
return () => observer.disconnect();
|
|
83
|
+
}, []);
|
|
84
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TooltipContext.Provider, { value: {}, children: [
|
|
85
|
+
import_lodash.default.map(
|
|
86
|
+
tooltips,
|
|
87
|
+
(data, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
88
|
+
import_styles.Tooltip,
|
|
89
|
+
{
|
|
90
|
+
style: {
|
|
91
|
+
top: data.top,
|
|
92
|
+
left: data.left
|
|
93
|
+
},
|
|
94
|
+
children: data.content
|
|
95
|
+
},
|
|
96
|
+
index
|
|
97
|
+
)
|
|
98
|
+
),
|
|
99
|
+
children
|
|
100
|
+
] });
|
|
101
|
+
};
|
|
102
|
+
const useTooltip = () => (0, import_react.useContext)(TooltipContext);
|
|
103
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
+
0 && (module.exports = {
|
|
105
|
+
TooltipProvider,
|
|
106
|
+
useTooltip
|
|
107
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { createContext, useContext, useEffect, useState } from "react";
|
|
5
|
+
import { Tooltip } from "./styles";
|
|
6
|
+
import _ from "lodash";
|
|
7
|
+
const TooltipContext = createContext({});
|
|
8
|
+
const TooltipProviderContainer = ({ children }) => {
|
|
9
|
+
const [tooltips, setTooltips] = useState([]);
|
|
10
|
+
const getContent = (target) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const rect = target.getBoundingClientRect();
|
|
13
|
+
return {
|
|
14
|
+
top: rect.top + window.scrollY - (target.offsetHeight + 8),
|
|
15
|
+
left: rect.left + window.scrollX + target.offsetWidth / 2,
|
|
16
|
+
content: ((_a = target.dataset) == null ? void 0 : _a.tooltip) || ""
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const processElement = (element) => {
|
|
21
|
+
element.addEventListener("mouseenter", (event) => {
|
|
22
|
+
const target = event == null ? void 0 : event.target;
|
|
23
|
+
if (!target) return;
|
|
24
|
+
setTooltips(_.concat(tooltips, [getContent(target)]));
|
|
25
|
+
});
|
|
26
|
+
element.addEventListener("mouseleave", (event) => {
|
|
27
|
+
const target = event == null ? void 0 : event.target;
|
|
28
|
+
if (!target) return;
|
|
29
|
+
setTooltips(_.filter(tooltips, (data) => JSON.stringify(data) === JSON.stringify(getContent(target))));
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
document.querySelectorAll("[data-tooltip]").forEach((el) => processElement(el));
|
|
33
|
+
const observer = new MutationObserver((mutations) => {
|
|
34
|
+
mutations.forEach((mutation) => {
|
|
35
|
+
mutation.addedNodes.forEach((node) => {
|
|
36
|
+
if (node.nodeType === 1) {
|
|
37
|
+
const el = node;
|
|
38
|
+
if (el.getAttribute("data-tooltip")) processElement(el);
|
|
39
|
+
el.querySelectorAll("[data-tooltip]").forEach((child) => processElement(child));
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
observer.observe(document.body, {
|
|
45
|
+
childList: true,
|
|
46
|
+
subtree: true
|
|
47
|
+
});
|
|
48
|
+
return () => observer.disconnect();
|
|
49
|
+
}, []);
|
|
50
|
+
return /* @__PURE__ */ jsxs(TooltipContext.Provider, { value: {}, children: [
|
|
51
|
+
_.map(
|
|
52
|
+
tooltips,
|
|
53
|
+
(data, index) => /* @__PURE__ */ jsx(
|
|
54
|
+
Tooltip,
|
|
55
|
+
{
|
|
56
|
+
style: {
|
|
57
|
+
top: data.top,
|
|
58
|
+
left: data.left
|
|
59
|
+
},
|
|
60
|
+
children: data.content
|
|
61
|
+
},
|
|
62
|
+
index
|
|
63
|
+
)
|
|
64
|
+
),
|
|
65
|
+
children
|
|
66
|
+
] });
|
|
67
|
+
};
|
|
68
|
+
const useTooltip = () => useContext(TooltipContext);
|
|
69
|
+
export {
|
|
70
|
+
TooltipProviderContainer as TooltipProvider,
|
|
71
|
+
useTooltip
|
|
72
|
+
};
|