dirk-cfx-react 1.0.36 → 1.0.37

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.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { BorderedIcon, BorderedIconProps, ButtonProps, Counter, FloatingParticles, FloatingParticlesProps, InfoBox, InfoBoxProps, InputContainer, InputContainerProps, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, NavigationStore, ParticleState, ProgressProps, Segment, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, Title, TitleProps, useNavigation, useNavigationStore } from './components/index.js';
1
+ export { BorderedIcon, BorderedIconProps, ButtonProps, Counter, FloatingParticles, FloatingParticlesProps, InfoBox, InfoBoxProps, InputContainer, InputContainerProps, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, NavigationStore, ParticleState, ProgressProps, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, Title, TitleProps, useNavigation, useNavigationStore } from './components/index.js';
2
2
  export { InitialFetch, InternalEvent, SkillSettings, colorWithAlpha, copyToClipboard, createSkill, fetchNui, initialFetches, internalEvent, isEnvBrowser, isProfanity, locale, localeStore, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, useAutoFetcher, useProfanityStore } from './utils/index.js';
3
3
  export { TornEdgeSVGFilter, useNuiEvent, useTornEdges } from './hooks/index.js';
4
4
  export { DirkProvider, DirkProviderProps, useSettings } from './providers/index.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
2
- import { createTheme, Flex, Text, Image, MantineProvider, BackgroundImage, useMantineTheme } from '@mantine/core';
2
+ import { createTheme, Flex, Text, Image, MantineProvider, BackgroundImage, useMantineTheme, alpha } from '@mantine/core';
3
3
  import { createContext, useRef, useEffect, useMemo, useState, useContext } from 'react';
4
4
  import '@mantine/core/styles.css';
5
5
  import '@mantine/notifications/styles.css';
@@ -163,11 +163,11 @@ var colorNames = {
163
163
  Yellow: { r: 255, g: 255, b: 0 },
164
164
  YellowGreen: { r: 154, g: 205, b: 50 }
165
165
  };
166
- function colorWithAlpha(color, alpha) {
166
+ function colorWithAlpha(color, alpha2) {
167
167
  const lowerCasedColor = color.toLowerCase();
168
168
  if (colorNames[lowerCasedColor]) {
169
169
  const rgb = colorNames[lowerCasedColor];
170
- return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha})`;
170
+ return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha2})`;
171
171
  }
172
172
  if (/^#([A-Fa-f0-9]{6})$/.test(color)) {
173
173
  const hex = color.slice(1);
@@ -175,12 +175,12 @@ function colorWithAlpha(color, alpha) {
175
175
  const r = bigint >> 16 & 255;
176
176
  const g = bigint >> 8 & 255;
177
177
  const b = bigint & 255;
178
- return `rgba(${r}, ${g}, ${b}, ${alpha})`;
178
+ return `rgba(${r}, ${g}, ${b}, ${alpha2})`;
179
179
  }
180
180
  if (/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/.test(color)) {
181
181
  const result = color.match(/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/);
182
182
  if (result) {
183
- return `rgba(${result[1]}, ${result[2]}, ${result[3]}, ${alpha})`;
183
+ return `rgba(${result[1]}, ${result[2]}, ${result[3]}, ${alpha2})`;
184
184
  }
185
185
  }
186
186
  return color;
@@ -1414,7 +1414,7 @@ function SegmentedControl(props) {
1414
1414
  bg: "rgba(33, 33, 33, 0.6)",
1415
1415
  w: props.w || "fit-content",
1416
1416
  style: {
1417
- borderRadius: theme2.radius.xs,
1417
+ borderRadius: props.enableRadius !== false ? theme2.radius.xs : 0,
1418
1418
  overflow: "hidden"
1419
1419
  },
1420
1420
  ...props,
@@ -1438,6 +1438,7 @@ function SegmentedControl(props) {
1438
1438
  icon: item.icon,
1439
1439
  rightSection: item.rightSection,
1440
1440
  fz: props.fz,
1441
+ color: props.color,
1441
1442
  selected: !props.multi ? props.value === item.value : Array.isArray(props.value) && props.value.includes(item.value),
1442
1443
  onClick: () => {
1443
1444
  if (props.multi) {
@@ -1466,7 +1467,7 @@ function Segment(props) {
1466
1467
  direction: "column",
1467
1468
  align: "center",
1468
1469
  h: "100%",
1469
- bg: props.selected ? colorWithAlpha(theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.2) : "transparent",
1470
+ bg: props.selected ? props.color ? alpha(props.color, 0.2) : colorWithAlpha(theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.2) : "transparent",
1470
1471
  pos: "relative",
1471
1472
  style: {
1472
1473
  // position: "relative",
@@ -1488,10 +1489,10 @@ function Segment(props) {
1488
1489
  {
1489
1490
  icon: props.icon,
1490
1491
  initial: {
1491
- color: props.selected ? theme2.colors[theme2.primaryColor][5] : "inherit"
1492
+ color: props.selected ? props.color || theme2.colors[theme2.primaryColor][5] : "inherit"
1492
1493
  },
1493
1494
  animate: {
1494
- color: props.selected ? theme2.colors[theme2.primaryColor][5] : "inherit"
1495
+ color: props.selected ? props.color || theme2.colors[theme2.primaryColor][5] : "inherit"
1495
1496
  },
1496
1497
  exit: {
1497
1498
  color: "inherit"
@@ -1507,10 +1508,10 @@ function Segment(props) {
1507
1508
  {
1508
1509
  size: props.fz || "xs",
1509
1510
  initial: {
1510
- color: props.selected ? theme2.colors[theme2.primaryColor][5] : "inherit"
1511
+ color: props.selected ? props.color || theme2.colors[theme2.primaryColor][5] : "inherit"
1511
1512
  },
1512
1513
  animate: {
1513
- color: props.selected ? theme2.colors[theme2.primaryColor][5] : "inherit"
1514
+ color: props.selected ? props.color || theme2.colors[theme2.primaryColor][5] : "inherit"
1514
1515
  },
1515
1516
  exit: {
1516
1517
  color: "inherit"
@@ -1546,7 +1547,7 @@ function Segment(props) {
1546
1547
  left: 0,
1547
1548
  right: 0,
1548
1549
  height: "0.2vh",
1549
- backgroundColor: theme2.colors[theme2.primaryColor][5],
1550
+ backgroundColor: props.color || theme2.colors[theme2.primaryColor][5],
1550
1551
  transformOrigin: "center"
1551
1552
  }
1552
1553
  }
@@ -1749,6 +1750,6 @@ function Title(props) {
1749
1750
  );
1750
1751
  }
1751
1752
 
1752
- export { BorderedIcon, Counter, DirkProvider, FloatingParticles, InfoBox, InputContainer, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, Segment, SegmentedControl, SegmentedProgress, Title, TornEdgeSVGFilter, colorWithAlpha, copyToClipboard, createSkill, fetchNui, initialFetches, internalEvent, isEnvBrowser, isProfanity, locale, localeStore, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, useAutoFetcher, useNavigation, useNavigationStore, useNuiEvent, useProfanityStore, useSettings, useTornEdges };
1753
+ export { BorderedIcon, Counter, DirkProvider, FloatingParticles, InfoBox, InputContainer, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, SegmentedControl, SegmentedProgress, Title, TornEdgeSVGFilter, colorWithAlpha, copyToClipboard, createSkill, fetchNui, initialFetches, internalEvent, isEnvBrowser, isProfanity, locale, localeStore, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, useAutoFetcher, useNavigation, useNavigationStore, useNuiEvent, useProfanityStore, useSettings, useTornEdges };
1753
1754
  //# sourceMappingURL=index.js.map
1754
1755
  //# sourceMappingURL=index.js.map