dirk-cfx-react 1.0.43 → 1.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ import { create, createStore, useStore } from 'zustand';
5
5
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
6
6
  import '@mantine/core/styles.css';
7
7
  import '@mantine/notifications/styles.css';
8
+ import './styles/notify.css';
8
9
  import './styles/fonts.css';
9
10
  import './styles/scrollBar.css';
10
11
  import './styles/tornEdge.css';
@@ -318,9 +319,9 @@ function createFormStore(initialValues, validationRules, onSubmit) {
318
319
  });
319
320
  const rule = flatRules[path];
320
321
  if (rule) {
321
- const error = rule(value, newValues);
322
- if (error)
323
- set((state) => ({ errors: setNested(state.errors, path, error) }));
322
+ const error2 = rule(value, newValues);
323
+ if (error2)
324
+ set((state) => ({ errors: setNested(state.errors, path, error2) }));
324
325
  else set((state) => ({ errors: deleteNested(state.errors, path) }));
325
326
  }
326
327
  },
@@ -331,9 +332,9 @@ function createFormStore(initialValues, validationRules, onSubmit) {
331
332
  const rule = flatRules[path];
332
333
  if (!rule) return true;
333
334
  const value = getNested(state.values, path);
334
- const error = rule(value, state.values);
335
- if (error) {
336
- set((state2) => ({ errors: setNested(state2.errors, path, error) }));
335
+ const error2 = rule(value, state.values);
336
+ if (error2) {
337
+ set((state2) => ({ errors: setNested(state2.errors, path, error2) }));
337
338
  return false;
338
339
  } else {
339
340
  set((state2) => ({ errors: deleteNested(state2.errors, path) }));
@@ -347,10 +348,10 @@ function createFormStore(initialValues, validationRules, onSubmit) {
347
348
  for (const path in flatRules) {
348
349
  const rule = flatRules[path];
349
350
  const value = getNested(state.values, path);
350
- const error = rule(value, state.values);
351
- if (error) {
351
+ const error2 = rule(value, state.values);
352
+ if (error2) {
352
353
  isValid = false;
353
- newErrors = setNested(newErrors, path, error);
354
+ newErrors = setNested(newErrors, path, error2);
354
355
  }
355
356
  }
356
357
  set({ errors: newErrors });
@@ -952,10 +953,20 @@ function createSkill(defaultSettings) {
952
953
  useSkill
953
954
  };
954
955
  }
956
+ var label = {
957
+ fontSize: "var(--mantine-font-size-xs)",
958
+ fontFamily: "Akrobat Bold",
959
+ letterSpacing: "0.05em",
960
+ textTransform: "uppercase"
961
+ };
962
+ var error = {
963
+ fontSize: "var(--mantine-font-size-xs)",
964
+ fontFamily: "Akrobat Regular"
965
+ };
955
966
  var theme = createTheme({
956
967
  primaryColor: "dirk",
957
968
  primaryShade: 9,
958
- defaultRadius: "xxs",
969
+ defaultRadius: "xs",
959
970
  fontFamily: "Akrobat Regular, sans-serif",
960
971
  radius: {
961
972
  xxs: "0.2vh",
@@ -975,6 +986,14 @@ var theme = createTheme({
975
986
  xl: "3.3vh",
976
987
  xxl: "3.8vh"
977
988
  },
989
+ lineHeights: {
990
+ xxs: "1.4vh",
991
+ xs: "1.8vh",
992
+ sm: "2.2vh",
993
+ md: "2.8vh",
994
+ lg: "3.3vh",
995
+ xl: "3.8vh"
996
+ },
978
997
  spacing: {
979
998
  xxs: "0.5vh",
980
999
  xs: "0.75vh",
@@ -987,51 +1006,75 @@ var theme = createTheme({
987
1006
  components: {
988
1007
  Progress: {
989
1008
  styles: {
1009
+ label: {
1010
+ fontFamily: "Akrobat Bold",
1011
+ letterSpacing: "0.05em",
1012
+ textTransform: "uppercase"
1013
+ },
990
1014
  root: {
991
1015
  backgroundColor: "rgba(77, 77, 77, 0.4)"
992
1016
  }
993
1017
  }
994
1018
  },
1019
+ Textarea: {
1020
+ styles: {
1021
+ label,
1022
+ error
1023
+ }
1024
+ },
1025
+ Button: {
1026
+ styles: {
1027
+ root: {
1028
+ fontSize: "var(--mantine-font-size-xs)"
1029
+ }
1030
+ }
1031
+ },
995
1032
  Select: {
996
1033
  styles: {
997
- dropdown: {
998
- borderRadius: "var(--mantine-radius-xxs)"
999
- },
1000
1034
  input: {
1001
1035
  padding: "var(--mantine-spacing-sm)"
1002
- },
1003
- item: {
1004
- borderRadius: "var(--mantine-radius-xxs)"
1005
- },
1006
- wrapper: {
1007
- borderRadius: "var(--mantine-radius-xxs)"
1008
- },
1009
- option: {
1010
- borderRadius: "var(--mantine-radius-xxs)"
1011
1036
  }
1012
1037
  }
1013
1038
  },
1014
- MultiSelect: {
1039
+ Pill: {
1040
+ styles: (theme2) => ({
1041
+ root: {
1042
+ display: "inline-flex",
1043
+ alignItems: "center",
1044
+ justifyContent: "space-between",
1045
+ backgroundColor: "rgba(76, 76, 76, 0.3)",
1046
+ height: "fit-content",
1047
+ textTransform: "uppercase",
1048
+ letterSpacing: "0.05em",
1049
+ fontFamily: "Akrobat Bold",
1050
+ fontSize: theme2.fontSizes.xs,
1051
+ borderRadius: theme2.defaultRadius,
1052
+ padding: `${theme2.spacing.xs} ${theme2.spacing.sm}`
1053
+ }
1054
+ })
1055
+ },
1056
+ Input: {
1015
1057
  styles: {
1016
- dropdown: {
1017
- borderRadius: "var(--mantine-radius-xxs)"
1018
- },
1019
- pill: {
1020
- borderRadius: "var(--mantine-radius-xxs)"
1021
- },
1022
- item: {
1023
- borderRadius: "var(--mantine-radius-xxs)"
1024
- },
1025
- wrapper: {
1026
- borderRadius: "var(--mantine-radius-xxs)"
1027
- },
1028
- option: {
1029
- borderRadius: "var(--mantine-radius-xxs)"
1058
+ label,
1059
+ error,
1060
+ input: {
1061
+ padding: "var(--mantine-spacing-sm)",
1062
+ backgroundColor: "rgba(76, 76, 76, 0.3)"
1063
+ }
1064
+ }
1065
+ },
1066
+ ColorInput: {
1067
+ styles: {
1068
+ label,
1069
+ input: {
1070
+ padding: "var(--mantine-spacing-sm)"
1030
1071
  }
1031
1072
  }
1032
1073
  },
1033
1074
  TextInput: {
1034
1075
  styles: {
1076
+ label,
1077
+ wrapper: {},
1035
1078
  section: {
1036
1079
  marginRight: "0.2vh"
1037
1080
  },
@@ -1039,21 +1082,20 @@ var theme = createTheme({
1039
1082
  padding: "var(--mantine-spacing-sm)"
1040
1083
  }
1041
1084
  }
1085
+ },
1086
+ NumberInput: {
1087
+ styles: {
1088
+ label,
1089
+ input: {
1090
+ padding: "var(--mantine-spacing-sm)"
1091
+ },
1092
+ section: {
1093
+ pointerEvents: "all"
1094
+ }
1095
+ }
1042
1096
  }
1043
1097
  },
1044
1098
  colors: {
1045
- dark: [
1046
- "#ffffff",
1047
- "#e2e2e2",
1048
- "#c6c6c6",
1049
- "#aaaaaa",
1050
- "#8d8d8d",
1051
- "#717171",
1052
- "#555555",
1053
- "#393939",
1054
- "#1c1c1c",
1055
- "#000000"
1056
- ],
1057
1099
  dirk: [
1058
1100
  "#ffffff",
1059
1101
  "#f3fce9",
@@ -1098,6 +1140,9 @@ function DirkProvider(props) {
1098
1140
  console.log(`Game set to ${game}, applied corresponding font family.: ${document.body.style.fontFamily}`);
1099
1141
  });
1100
1142
  }, [game]);
1143
+ useEffect(() => {
1144
+ fetchNui("NUI_READY");
1145
+ }, []);
1101
1146
  useAutoFetcher();
1102
1147
  return /* @__PURE__ */ jsx(MantineProvider, { theme: mergedTheme, defaultColorScheme: "dark", children: /* @__PURE__ */ jsx(Wrapper, { children: props.children }) });
1103
1148
  }
@@ -1493,13 +1538,14 @@ function InputContainer(props) {
1493
1538
  direction: "column",
1494
1539
  h: props.h,
1495
1540
  gap: props.title ? "xs" : 0,
1496
- bg: props.bg || "rgba(69, 69, 69, 0.42)",
1497
- p: "sm",
1541
+ bg: props.bg || "linear-gradient(180deg, rgba(30, 30, 30, 0.82) 0%, rgba(30, 30, 30, 0.3) 50%, rgba(30, 30, 30, 0.6) 100%)",
1542
+ p: props.p || "sm",
1498
1543
  style: {
1499
1544
  borderRadius: theme2.radius.xs,
1500
1545
  boxShadow: theme2.shadows.sm,
1501
1546
  overflow: "hidden",
1502
- outline: props.error ? `1px solid rgba(255, 100, 100, 0.8)` : "none"
1547
+ outline: props.error ? `1px solid rgba(255, 100, 100, 0.8)` : "0.2vh solid rgba(255,255,255,0.1)",
1548
+ ...props.style
1503
1549
  },
1504
1550
  variants: props.variants,
1505
1551
  children: [
@@ -1509,11 +1555,12 @@ function InputContainer(props) {
1509
1555
  align: "center",
1510
1556
  gap: "xs",
1511
1557
  children: [
1512
- /* @__PURE__ */ jsxs(
1558
+ (props.title || props.description) && /* @__PURE__ */ jsxs(
1513
1559
  Flex,
1514
1560
  {
1515
1561
  direction: "column",
1516
1562
  gap: "xxs",
1563
+ p: props.p == "0" ? "sm" : 0,
1517
1564
  children: [
1518
1565
  props.title && /* @__PURE__ */ jsx(
1519
1566
  Text,