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
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var reactFontawesome = require('@fortawesome/react-fontawesome');
|
|
4
4
|
var core = require('@mantine/core');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var framerMotion = require('framer-motion');
|
|
7
|
+
var react = require('react');
|
|
8
|
+
var zustand = require('zustand');
|
|
9
|
+
var clickSoundUrl = require('../click_sound-PNCRRTM4.mp3');
|
|
10
|
+
var hoverSoundUrl = require('../hover_sound-NBUA222C.mp3');
|
|
5
11
|
require('@mantine/core/styles.css');
|
|
6
12
|
require('@mantine/notifications/styles.css');
|
|
7
13
|
require('./styles/notify.css');
|
|
@@ -12,12 +18,6 @@ var fontawesomeSvgCore = require('@fortawesome/fontawesome-svg-core');
|
|
|
12
18
|
var freeBrandsSvgIcons = require('@fortawesome/free-brands-svg-icons');
|
|
13
19
|
var freeRegularSvgIcons = require('@fortawesome/free-regular-svg-icons');
|
|
14
20
|
var freeSolidSvgIcons = require('@fortawesome/free-solid-svg-icons');
|
|
15
|
-
var zustand = require('zustand');
|
|
16
|
-
var react = require('react');
|
|
17
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
18
|
-
var framerMotion = require('framer-motion');
|
|
19
|
-
var clickSoundUrl = require('../click_sound-PNCRRTM4.mp3');
|
|
20
|
-
var hoverSoundUrl = require('../hover_sound-NBUA222C.mp3');
|
|
21
21
|
var hooks = require('@mantine/hooks');
|
|
22
22
|
|
|
23
23
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -25,8 +25,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
25
25
|
var clickSoundUrl__default = /*#__PURE__*/_interopDefault(clickSoundUrl);
|
|
26
26
|
var hoverSoundUrl__default = /*#__PURE__*/_interopDefault(hoverSoundUrl);
|
|
27
27
|
|
|
28
|
-
// src/components/BorderedIcon.tsx
|
|
29
|
-
|
|
30
28
|
// src/utils/colorWithAlpha.ts
|
|
31
29
|
var colorNames = {
|
|
32
30
|
AliceBlue: { r: 240, g: 248, b: 255 },
|
|
@@ -194,28 +192,15 @@ function colorWithAlpha(color, alpha2) {
|
|
|
194
192
|
}
|
|
195
193
|
return color;
|
|
196
194
|
}
|
|
197
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.fas, freeRegularSvgIcons.far, freeBrandsSvgIcons.fab);
|
|
198
|
-
var useSettings = zustand.create((set) => ({
|
|
199
|
-
game: "fivem",
|
|
200
|
-
primaryColor: "dirk",
|
|
201
|
-
primaryShade: 9,
|
|
202
|
-
itemImgPath: "https://assets.dirkcfx.com/items/",
|
|
203
|
-
customTheme: {}
|
|
204
|
-
}));
|
|
205
|
-
function useTornEdges() {
|
|
206
|
-
const game = useSettings((state) => state.game);
|
|
207
|
-
return game === "rdr3" ? "torn-edge-wrapper" : "";
|
|
208
|
-
}
|
|
209
195
|
function BorderedIcon(props) {
|
|
210
196
|
const theme = core.useMantineTheme();
|
|
211
|
-
const tornEdgeCSS = useTornEdges();
|
|
212
197
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
213
|
-
|
|
198
|
+
reactFontawesome.FontAwesomeIcon,
|
|
214
199
|
{
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
align: "center",
|
|
200
|
+
icon: props.icon,
|
|
201
|
+
color: colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][theme.primaryShade], props.hovered ? 0.9 : 0.9),
|
|
218
202
|
style: {
|
|
203
|
+
// backgroundColor: colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][7 as number], (props.hoverable ? (props.hovered ? 0.3 : 0.2) : 0.2)),
|
|
219
204
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
220
205
|
padding: props.p || theme.spacing.xs,
|
|
221
206
|
transition: "all 0.2s ease-in-out",
|
|
@@ -223,19 +208,9 @@ function BorderedIcon(props) {
|
|
|
223
208
|
fontSize: props.fontSize ? props.fontSize : "2.5vh",
|
|
224
209
|
borderRadius: theme.radius.xs,
|
|
225
210
|
// border: `2px solid var(--mantine-primary-color-9)`,
|
|
226
|
-
|
|
211
|
+
outline: `0.2vh solid ${colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][9], 0.8)}`,
|
|
227
212
|
boxShadow: `inset 0 0 2vh ${colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][7], 0.5)}`
|
|
228
|
-
}
|
|
229
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
230
|
-
reactFontawesome.FontAwesomeIcon,
|
|
231
|
-
{
|
|
232
|
-
icon: props.icon,
|
|
233
|
-
color: colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][theme.primaryShade], props.hovered ? 0.9 : 0.9),
|
|
234
|
-
style: {
|
|
235
|
-
// backgroundColor: colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][7 as number], (props.hoverable ? (props.hovered ? 0.3 : 0.2) : 0.2)),
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
)
|
|
213
|
+
}
|
|
239
214
|
}
|
|
240
215
|
);
|
|
241
216
|
}
|
|
@@ -906,6 +881,14 @@ function SegmentedProgress(props) {
|
|
|
906
881
|
}
|
|
907
882
|
);
|
|
908
883
|
}
|
|
884
|
+
fontawesomeSvgCore.library.add(freeSolidSvgIcons.fas, freeRegularSvgIcons.far, freeBrandsSvgIcons.fab);
|
|
885
|
+
var useSettings = zustand.create((set) => ({
|
|
886
|
+
game: "fivem",
|
|
887
|
+
primaryColor: "dirk",
|
|
888
|
+
primaryShade: 9,
|
|
889
|
+
itemImgPath: "https://assets.dirkcfx.com/items/",
|
|
890
|
+
customTheme: {}
|
|
891
|
+
}));
|
|
909
892
|
function Title(props) {
|
|
910
893
|
const game = useSettings((state) => state.game);
|
|
911
894
|
const theme = core.useMantineTheme();
|
|
@@ -984,6 +967,93 @@ function Title(props) {
|
|
|
984
967
|
}
|
|
985
968
|
);
|
|
986
969
|
}
|
|
970
|
+
function LevelBanner(props) {
|
|
971
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
972
|
+
MotionFlex,
|
|
973
|
+
{
|
|
974
|
+
w: "35vh",
|
|
975
|
+
pos: "absolute",
|
|
976
|
+
left: "50%",
|
|
977
|
+
align: "center",
|
|
978
|
+
gap: "xs",
|
|
979
|
+
style: {
|
|
980
|
+
borderRadius: core.useMantineTheme().radius.xxs
|
|
981
|
+
},
|
|
982
|
+
initial: { opacity: 0, y: -10, transform: "translateX(-50%)" },
|
|
983
|
+
animate: { opacity: 1, y: 0, transform: "translateX(-50%)" },
|
|
984
|
+
exit: { opacity: 0, y: -10, transform: "translateX(-50%)" },
|
|
985
|
+
transition: { duration: 0.3 },
|
|
986
|
+
direction: "column",
|
|
987
|
+
children: [
|
|
988
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
989
|
+
core.Flex,
|
|
990
|
+
{
|
|
991
|
+
w: "100%",
|
|
992
|
+
justify: "space-between",
|
|
993
|
+
children: [
|
|
994
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
995
|
+
core.Text,
|
|
996
|
+
{
|
|
997
|
+
size: "xxs",
|
|
998
|
+
c: "rgba(255, 255, 255, 0.9)",
|
|
999
|
+
style: {
|
|
1000
|
+
fontFamily: "Akrobat Bold",
|
|
1001
|
+
letterSpacing: "0.1em"
|
|
1002
|
+
},
|
|
1003
|
+
children: [
|
|
1004
|
+
"LVL ",
|
|
1005
|
+
props.level
|
|
1006
|
+
]
|
|
1007
|
+
}
|
|
1008
|
+
),
|
|
1009
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1010
|
+
core.Text,
|
|
1011
|
+
{
|
|
1012
|
+
size: "xxs",
|
|
1013
|
+
c: "rgba(255, 255, 255, 0.7)",
|
|
1014
|
+
style: {
|
|
1015
|
+
fontFamily: "Akrobat Bold",
|
|
1016
|
+
letterSpacing: "0.1em"
|
|
1017
|
+
},
|
|
1018
|
+
children: [
|
|
1019
|
+
props.exp,
|
|
1020
|
+
"/",
|
|
1021
|
+
props.nextLevelXP,
|
|
1022
|
+
" XP"
|
|
1023
|
+
]
|
|
1024
|
+
}
|
|
1025
|
+
),
|
|
1026
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1027
|
+
core.Text,
|
|
1028
|
+
{
|
|
1029
|
+
size: "xxs",
|
|
1030
|
+
c: "rgba(255, 255, 255, 0.7)",
|
|
1031
|
+
style: {
|
|
1032
|
+
fontFamily: "Akrobat Bold",
|
|
1033
|
+
letterSpacing: "0.1em"
|
|
1034
|
+
},
|
|
1035
|
+
children: [
|
|
1036
|
+
"LVL ",
|
|
1037
|
+
props.level + 1
|
|
1038
|
+
]
|
|
1039
|
+
}
|
|
1040
|
+
)
|
|
1041
|
+
]
|
|
1042
|
+
}
|
|
1043
|
+
),
|
|
1044
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1045
|
+
core.Progress,
|
|
1046
|
+
{
|
|
1047
|
+
color: props.color,
|
|
1048
|
+
w: "100%",
|
|
1049
|
+
size: "sm",
|
|
1050
|
+
value: props.progressToLevel
|
|
1051
|
+
}
|
|
1052
|
+
)
|
|
1053
|
+
]
|
|
1054
|
+
}
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
987
1057
|
var ModalContext = react.createContext(null);
|
|
988
1058
|
function useModal(selector) {
|
|
989
1059
|
const modal = react.useContext(ModalContext);
|
|
@@ -1139,6 +1209,7 @@ exports.Counter = Counter;
|
|
|
1139
1209
|
exports.FloatingParticles = FloatingParticles;
|
|
1140
1210
|
exports.InfoBox = InfoBox;
|
|
1141
1211
|
exports.InputContainer = InputContainer;
|
|
1212
|
+
exports.LevelBanner = LevelBanner;
|
|
1142
1213
|
exports.ModalContext = ModalContext;
|
|
1143
1214
|
exports.ModalProvider = ModalProvider;
|
|
1144
1215
|
exports.MotionFlex = MotionFlex;
|