dirk-cfx-react 1.0.46 → 1.0.49
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.cjs +108 -37
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +281 -273
- package/dist/components/index.d.ts +281 -273
- package/dist/components/index.js +109 -39
- package/dist/components/index.js.map +1 -1
- package/dist/index.cjs +626 -510
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +629 -518
- package/dist/index.js.map +1 -1
- package/dist/utils/index.cjs +44 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +10 -1
- package/dist/utils/index.d.ts +10 -1
- package/dist/utils/index.js +38 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +2 -1
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
2
|
-
import { Flex, Text, Image, useMantineTheme, alpha } from '@mantine/core';
|
|
2
|
+
import { Flex, Text, Image, useMantineTheme, alpha, Progress } from '@mantine/core';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
import { motion, AnimatePresence, useMotionValue } from 'framer-motion';
|
|
5
|
+
import { createContext, useRef, useState, useEffect, useContext } from 'react';
|
|
6
|
+
import { create, useStore } from 'zustand';
|
|
7
|
+
import clickSoundUrl from '../click_sound-PNCRRTM4.mp3';
|
|
8
|
+
import hoverSoundUrl from '../hover_sound-NBUA222C.mp3';
|
|
3
9
|
import '@mantine/core/styles.css';
|
|
4
10
|
import '@mantine/notifications/styles.css';
|
|
5
11
|
import './styles/notify.css';
|
|
@@ -10,16 +16,8 @@ import { library } from '@fortawesome/fontawesome-svg-core';
|
|
|
10
16
|
import { fab } from '@fortawesome/free-brands-svg-icons';
|
|
11
17
|
import { far } from '@fortawesome/free-regular-svg-icons';
|
|
12
18
|
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
13
|
-
import { create, useStore } from 'zustand';
|
|
14
|
-
import { createContext, useRef, useState, useEffect, useContext } from 'react';
|
|
15
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
16
|
-
import { motion, AnimatePresence, useMotionValue } from 'framer-motion';
|
|
17
|
-
import clickSoundUrl from '../click_sound-PNCRRTM4.mp3';
|
|
18
|
-
import hoverSoundUrl from '../hover_sound-NBUA222C.mp3';
|
|
19
19
|
import { useClickOutside } from '@mantine/hooks';
|
|
20
20
|
|
|
21
|
-
// src/components/BorderedIcon.tsx
|
|
22
|
-
|
|
23
21
|
// src/utils/colorWithAlpha.ts
|
|
24
22
|
var colorNames = {
|
|
25
23
|
AliceBlue: { r: 240, g: 248, b: 255 },
|
|
@@ -187,28 +185,15 @@ function colorWithAlpha(color, alpha2) {
|
|
|
187
185
|
}
|
|
188
186
|
return color;
|
|
189
187
|
}
|
|
190
|
-
library.add(fas, far, fab);
|
|
191
|
-
var useSettings = create((set) => ({
|
|
192
|
-
game: "fivem",
|
|
193
|
-
primaryColor: "dirk",
|
|
194
|
-
primaryShade: 9,
|
|
195
|
-
itemImgPath: "https://assets.dirkcfx.com/items/",
|
|
196
|
-
customTheme: {}
|
|
197
|
-
}));
|
|
198
|
-
function useTornEdges() {
|
|
199
|
-
const game = useSettings((state) => state.game);
|
|
200
|
-
return game === "rdr3" ? "torn-edge-wrapper" : "";
|
|
201
|
-
}
|
|
202
188
|
function BorderedIcon(props) {
|
|
203
189
|
const theme = useMantineTheme();
|
|
204
|
-
const tornEdgeCSS = useTornEdges();
|
|
205
190
|
return /* @__PURE__ */ jsx(
|
|
206
|
-
|
|
191
|
+
FontAwesomeIcon,
|
|
207
192
|
{
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
align: "center",
|
|
193
|
+
icon: props.icon,
|
|
194
|
+
color: colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][theme.primaryShade], props.hovered ? 0.9 : 0.9),
|
|
211
195
|
style: {
|
|
196
|
+
// backgroundColor: colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][7 as number], (props.hoverable ? (props.hovered ? 0.3 : 0.2) : 0.2)),
|
|
212
197
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
213
198
|
padding: props.p || theme.spacing.xs,
|
|
214
199
|
transition: "all 0.2s ease-in-out",
|
|
@@ -216,19 +201,9 @@ function BorderedIcon(props) {
|
|
|
216
201
|
fontSize: props.fontSize ? props.fontSize : "2.5vh",
|
|
217
202
|
borderRadius: theme.radius.xs,
|
|
218
203
|
// border: `2px solid var(--mantine-primary-color-9)`,
|
|
219
|
-
|
|
204
|
+
outline: `0.2vh solid ${colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][9], 0.8)}`,
|
|
220
205
|
boxShadow: `inset 0 0 2vh ${colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][7], 0.5)}`
|
|
221
|
-
}
|
|
222
|
-
children: /* @__PURE__ */ jsx(
|
|
223
|
-
FontAwesomeIcon,
|
|
224
|
-
{
|
|
225
|
-
icon: props.icon,
|
|
226
|
-
color: colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][theme.primaryShade], props.hovered ? 0.9 : 0.9),
|
|
227
|
-
style: {
|
|
228
|
-
// backgroundColor: colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][7 as number], (props.hoverable ? (props.hovered ? 0.3 : 0.2) : 0.2)),
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
)
|
|
206
|
+
}
|
|
232
207
|
}
|
|
233
208
|
);
|
|
234
209
|
}
|
|
@@ -899,6 +874,14 @@ function SegmentedProgress(props) {
|
|
|
899
874
|
}
|
|
900
875
|
);
|
|
901
876
|
}
|
|
877
|
+
library.add(fas, far, fab);
|
|
878
|
+
var useSettings = create((set) => ({
|
|
879
|
+
game: "fivem",
|
|
880
|
+
primaryColor: "dirk",
|
|
881
|
+
primaryShade: 9,
|
|
882
|
+
itemImgPath: "https://assets.dirkcfx.com/items/",
|
|
883
|
+
customTheme: {}
|
|
884
|
+
}));
|
|
902
885
|
function Title(props) {
|
|
903
886
|
const game = useSettings((state) => state.game);
|
|
904
887
|
const theme = useMantineTheme();
|
|
@@ -977,6 +960,93 @@ function Title(props) {
|
|
|
977
960
|
}
|
|
978
961
|
);
|
|
979
962
|
}
|
|
963
|
+
function LevelBanner(props) {
|
|
964
|
+
return /* @__PURE__ */ jsxs(
|
|
965
|
+
MotionFlex,
|
|
966
|
+
{
|
|
967
|
+
w: "35vh",
|
|
968
|
+
pos: "absolute",
|
|
969
|
+
left: "50%",
|
|
970
|
+
align: "center",
|
|
971
|
+
gap: "xs",
|
|
972
|
+
style: {
|
|
973
|
+
borderRadius: useMantineTheme().radius.xxs
|
|
974
|
+
},
|
|
975
|
+
initial: { opacity: 0, y: -10, transform: "translateX(-50%)" },
|
|
976
|
+
animate: { opacity: 1, y: 0, transform: "translateX(-50%)" },
|
|
977
|
+
exit: { opacity: 0, y: -10, transform: "translateX(-50%)" },
|
|
978
|
+
transition: { duration: 0.3 },
|
|
979
|
+
direction: "column",
|
|
980
|
+
children: [
|
|
981
|
+
/* @__PURE__ */ jsxs(
|
|
982
|
+
Flex,
|
|
983
|
+
{
|
|
984
|
+
w: "100%",
|
|
985
|
+
justify: "space-between",
|
|
986
|
+
children: [
|
|
987
|
+
/* @__PURE__ */ jsxs(
|
|
988
|
+
Text,
|
|
989
|
+
{
|
|
990
|
+
size: "xxs",
|
|
991
|
+
c: "rgba(255, 255, 255, 0.9)",
|
|
992
|
+
style: {
|
|
993
|
+
fontFamily: "Akrobat Bold",
|
|
994
|
+
letterSpacing: "0.1em"
|
|
995
|
+
},
|
|
996
|
+
children: [
|
|
997
|
+
"LVL ",
|
|
998
|
+
props.level
|
|
999
|
+
]
|
|
1000
|
+
}
|
|
1001
|
+
),
|
|
1002
|
+
/* @__PURE__ */ jsxs(
|
|
1003
|
+
Text,
|
|
1004
|
+
{
|
|
1005
|
+
size: "xxs",
|
|
1006
|
+
c: "rgba(255, 255, 255, 0.7)",
|
|
1007
|
+
style: {
|
|
1008
|
+
fontFamily: "Akrobat Bold",
|
|
1009
|
+
letterSpacing: "0.1em"
|
|
1010
|
+
},
|
|
1011
|
+
children: [
|
|
1012
|
+
props.exp,
|
|
1013
|
+
"/",
|
|
1014
|
+
props.nextLevelXP,
|
|
1015
|
+
" XP"
|
|
1016
|
+
]
|
|
1017
|
+
}
|
|
1018
|
+
),
|
|
1019
|
+
/* @__PURE__ */ jsxs(
|
|
1020
|
+
Text,
|
|
1021
|
+
{
|
|
1022
|
+
size: "xxs",
|
|
1023
|
+
c: "rgba(255, 255, 255, 0.7)",
|
|
1024
|
+
style: {
|
|
1025
|
+
fontFamily: "Akrobat Bold",
|
|
1026
|
+
letterSpacing: "0.1em"
|
|
1027
|
+
},
|
|
1028
|
+
children: [
|
|
1029
|
+
"LVL ",
|
|
1030
|
+
props.level + 1
|
|
1031
|
+
]
|
|
1032
|
+
}
|
|
1033
|
+
)
|
|
1034
|
+
]
|
|
1035
|
+
}
|
|
1036
|
+
),
|
|
1037
|
+
/* @__PURE__ */ jsx(
|
|
1038
|
+
Progress,
|
|
1039
|
+
{
|
|
1040
|
+
color: props.color,
|
|
1041
|
+
w: "100%",
|
|
1042
|
+
size: "sm",
|
|
1043
|
+
value: props.progressToLevel
|
|
1044
|
+
}
|
|
1045
|
+
)
|
|
1046
|
+
]
|
|
1047
|
+
}
|
|
1048
|
+
);
|
|
1049
|
+
}
|
|
980
1050
|
var ModalContext = createContext(null);
|
|
981
1051
|
function useModal(selector) {
|
|
982
1052
|
const modal = useContext(ModalContext);
|
|
@@ -1127,6 +1197,6 @@ function Modal() {
|
|
|
1127
1197
|
) });
|
|
1128
1198
|
}
|
|
1129
1199
|
|
|
1130
|
-
export { BorderedIcon, Counter, FloatingParticles, InfoBox, InputContainer, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, SegmentedControl, SegmentedProgress, Title, useModal, useModalActions, useNavigation, useNavigationStore };
|
|
1200
|
+
export { BorderedIcon, Counter, FloatingParticles, InfoBox, InputContainer, LevelBanner, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, SegmentedControl, SegmentedProgress, Title, useModal, useModalActions, useNavigation, useNavigationStore };
|
|
1131
1201
|
//# sourceMappingURL=index.js.map
|
|
1132
1202
|
//# sourceMappingURL=index.js.map
|