dirk-cfx-react 1.0.49 → 1.0.50

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.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { BorderedIcon, BorderedIconProps, ButtonProps, Counter, FloatingParticles, FloatingParticlesProps, InfoBox, InfoBoxProps, InputContainer, InputContainerProps, LevelBanner, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, NavigationStore, ParticleState, ProgressProps, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, Title, TitleProps, useModal, useModalActions, useNavigation, useNavigationStore } from './components/index.cjs';
1
+ export { BorderedIcon, BorderedIconProps, ButtonProps, Counter, FloatingParticles, FloatingParticlesProps, InfoBox, InfoBoxProps, InputContainer, InputContainerProps, LevelBanner, LevelPanel, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, NavigationStore, ParticleState, ProgressProps, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, Title, TitleProps, useModal, useModalActions, useNavigation, useNavigationStore } from './components/index.cjs';
2
2
  export { InitialFetch, InternalEvent, SkillSettings, UploadImageProps, colorWithAlpha, copyToClipboard, createSkill, fetchNui, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, locale, localeStore, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useProfanityStore } from './utils/index.cjs';
3
3
  export { FormProvider, FormState, TornEdgeSVGFilter, ValidationRules, createFormStore, useForm, useNuiEvent, useTornEdges } from './hooks/index.cjs';
4
4
  export { DirkProvider, DirkProviderProps, useSettings } from './providers/index.cjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { BorderedIcon, BorderedIconProps, ButtonProps, Counter, FloatingParticles, FloatingParticlesProps, InfoBox, InfoBoxProps, InputContainer, InputContainerProps, LevelBanner, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, NavigationStore, ParticleState, ProgressProps, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, Title, TitleProps, useModal, useModalActions, useNavigation, useNavigationStore } from './components/index.js';
1
+ export { BorderedIcon, BorderedIconProps, ButtonProps, Counter, FloatingParticles, FloatingParticlesProps, InfoBox, InfoBoxProps, InputContainer, InputContainerProps, LevelBanner, LevelPanel, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, NavigationStore, ParticleState, ProgressProps, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, Title, TitleProps, useModal, useModalActions, useNavigation, useNavigationStore } from './components/index.js';
2
2
  export { InitialFetch, InternalEvent, SkillSettings, UploadImageProps, colorWithAlpha, copyToClipboard, createSkill, fetchNui, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, locale, localeStore, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useProfanityStore } from './utils/index.js';
3
3
  export { FormProvider, FormState, TornEdgeSVGFilter, ValidationRules, createFormStore, useForm, useNuiEvent, useTornEdges } from './hooks/index.js';
4
4
  export { DirkProvider, DirkProviderProps, useSettings } from './providers/index.js';
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { createContext, useEffect, useRef, useState, useContext, useMemo } from
2
2
  import { create, useStore, createStore } from 'zustand';
3
3
  import axios from 'axios';
4
4
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
- import { Flex, Text, Image as Image$1, createTheme, useMantineTheme, alpha, Progress, MantineProvider, BackgroundImage } from '@mantine/core';
5
+ import { Flex, Text, Image as Image$1, createTheme, useMantineTheme, alpha, Progress, RingProgress, MantineProvider, BackgroundImage } from '@mantine/core';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
  import { motion, AnimatePresence, useMotionValue } from 'framer-motion';
8
8
  import clickSoundUrl from './click_sound-PNCRRTM4.mp3';
@@ -164,11 +164,11 @@ var colorNames = {
164
164
  Yellow: { r: 255, g: 255, b: 0 },
165
165
  YellowGreen: { r: 154, g: 205, b: 50 }
166
166
  };
167
- function colorWithAlpha(color, alpha2) {
167
+ function colorWithAlpha(color, alpha3) {
168
168
  const lowerCasedColor = color.toLowerCase();
169
169
  if (colorNames[lowerCasedColor]) {
170
170
  const rgb = colorNames[lowerCasedColor];
171
- return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha2})`;
171
+ return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha3})`;
172
172
  }
173
173
  if (/^#([A-Fa-f0-9]{6})$/.test(color)) {
174
174
  const hex = color.slice(1);
@@ -176,12 +176,12 @@ function colorWithAlpha(color, alpha2) {
176
176
  const r = bigint >> 16 & 255;
177
177
  const g = bigint >> 8 & 255;
178
178
  const b = bigint & 255;
179
- return `rgba(${r}, ${g}, ${b}, ${alpha2})`;
179
+ return `rgba(${r}, ${g}, ${b}, ${alpha3})`;
180
180
  }
181
181
  if (/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/.test(color)) {
182
182
  const result = color.match(/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/);
183
183
  if (result) {
184
- return `rgba(${result[1]}, ${result[2]}, ${result[3]}, ${alpha2})`;
184
+ return `rgba(${result[1]}, ${result[2]}, ${result[3]}, ${alpha3})`;
185
185
  }
186
186
  }
187
187
  return color;
@@ -719,10 +719,12 @@ function createSkill(defaultSettings) {
719
719
  const xpRequiredForLevel = nextLevelXP - currentLevelXP;
720
720
  const progressToLevel = xpRequiredForLevel > 0 ? xpInCurrentLevel / xpRequiredForLevel * 100 : 100;
721
721
  const xpToNextLevel = Math.max(0, nextLevelXP - xp);
722
+ const prevLevelXP = calculateXPForLevel(currentLevel - 1, settings);
722
723
  return {
723
724
  currentLevel,
724
725
  nextLevel,
725
726
  currentLevelXP,
727
+ prevLevelXP,
726
728
  nextLevelXP,
727
729
  progressToLevel: Math.min(100, Math.max(0, progressToLevel)),
728
730
  xpToNextLevel
@@ -1633,6 +1635,84 @@ function LevelBanner(props) {
1633
1635
  }
1634
1636
  );
1635
1637
  }
1638
+ function LevelPanel(props) {
1639
+ const theme2 = useMantineTheme();
1640
+ return /* @__PURE__ */ jsxs(
1641
+ Flex,
1642
+ {
1643
+ w: "fit-content",
1644
+ pr: "8vh",
1645
+ pl: "8vh",
1646
+ 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%)",
1647
+ style: {
1648
+ borderRadius: theme2.radius.xs,
1649
+ boxShadow: theme2.shadows.sm,
1650
+ outline: "0.2vh solid rgba(255,255,255,0.1)"
1651
+ },
1652
+ justify: "center",
1653
+ align: "center",
1654
+ direction: "column",
1655
+ p: "sm",
1656
+ children: [
1657
+ /* @__PURE__ */ jsx(
1658
+ RingProgress,
1659
+ {
1660
+ size: 190,
1661
+ roundCaps: true,
1662
+ thickness: 10,
1663
+ sections: [{ value: props.progressToLevel, color: alpha(props.color || theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.9) }],
1664
+ label: /* @__PURE__ */ jsx(
1665
+ Flex,
1666
+ {
1667
+ justify: "center",
1668
+ align: "center",
1669
+ direction: "column",
1670
+ children: /* @__PURE__ */ jsx(
1671
+ Text,
1672
+ {
1673
+ size: "6vh",
1674
+ c: alpha(props.color || theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.9),
1675
+ style: {
1676
+ fontFamily: "Akrobat Black",
1677
+ textShadow: `0 0 10px ${alpha(props.color || theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.7)}`
1678
+ },
1679
+ children: props.level
1680
+ }
1681
+ )
1682
+ }
1683
+ )
1684
+ }
1685
+ ),
1686
+ /* @__PURE__ */ jsx(
1687
+ Text,
1688
+ {
1689
+ size: "sm",
1690
+ style: {
1691
+ fontFamily: "Akrobat Black",
1692
+ letterSpacing: "0.05em",
1693
+ textTransform: "uppercase"
1694
+ },
1695
+ children: props.text || locale("Level")
1696
+ }
1697
+ ),
1698
+ /* @__PURE__ */ jsxs(
1699
+ Text,
1700
+ {
1701
+ size: "xs",
1702
+ c: "rgba(255,255,255,0.6)",
1703
+ children: [
1704
+ props.exp,
1705
+ "/",
1706
+ props.nextLevelXP,
1707
+ " ",
1708
+ locale("EXP")
1709
+ ]
1710
+ }
1711
+ )
1712
+ ]
1713
+ }
1714
+ );
1715
+ }
1636
1716
  var ModalContext = createContext(null);
1637
1717
  function useModal(selector) {
1638
1718
  const modal = useContext(ModalContext);
@@ -2249,6 +2329,6 @@ function TornEdgeSVGFilter() {
2249
2329
  );
2250
2330
  }
2251
2331
 
2252
- export { BorderedIcon, Counter, DirkProvider, FloatingParticles, FormProvider, InfoBox, InputContainer, LevelBanner, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, SegmentedControl, SegmentedProgress, Title, TornEdgeSVGFilter, colorWithAlpha, copyToClipboard, createFormStore, createSkill, fetchNui, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, locale, localeStore, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useForm, useModal, useModalActions, useNavigation, useNavigationStore, useNuiEvent, useProfanityStore, useSettings, useTornEdges };
2332
+ export { BorderedIcon, Counter, DirkProvider, FloatingParticles, FormProvider, InfoBox, InputContainer, LevelBanner, LevelPanel, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, SegmentedControl, SegmentedProgress, Title, TornEdgeSVGFilter, colorWithAlpha, copyToClipboard, createFormStore, createSkill, fetchNui, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, locale, localeStore, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useForm, useModal, useModalActions, useNavigation, useNavigationStore, useNuiEvent, useProfanityStore, useSettings, useTornEdges };
2253
2333
  //# sourceMappingURL=index.js.map
2254
2334
  //# sourceMappingURL=index.js.map