dirk-cfx-react 1.1.79 → 1.1.80
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 +50 -29
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +10 -1
- package/dist/components/index.d.ts +10 -1
- package/dist/components/index.js +51 -31
- package/dist/components/index.js.map +1 -1
- package/dist/index.cjs +50 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +51 -31
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -971,6 +971,15 @@ type AdminPageTitleProps = {
|
|
|
971
971
|
};
|
|
972
972
|
declare function AdminPageTitle(props: AdminPageTitleProps): react_jsx_runtime.JSX.Element;
|
|
973
973
|
|
|
974
|
+
type SwitchPanelProps = {
|
|
975
|
+
label: ReactNode;
|
|
976
|
+
description?: ReactNode;
|
|
977
|
+
checked: boolean;
|
|
978
|
+
onChange: (v: boolean) => void;
|
|
979
|
+
disabled?: boolean;
|
|
980
|
+
};
|
|
981
|
+
declare function SwitchPanel({ label, description, checked, onChange, disabled }: SwitchPanelProps): react_jsx_runtime.JSX.Element;
|
|
982
|
+
|
|
974
983
|
type MissingItem = {
|
|
975
984
|
name: string;
|
|
976
985
|
label?: string;
|
|
@@ -1041,4 +1050,4 @@ type AnimPostFxSelectProps = Omit<SelectProps, "data" | "value" | "onChange"> &
|
|
|
1041
1050
|
};
|
|
1042
1051
|
declare function AnimPostFxSelect({ value, onChange, label, size, searchable, clearable, ...rest }: AnimPostFxSelectProps): react_jsx_runtime.JSX.Element;
|
|
1043
1052
|
|
|
1044
|
-
export { AdminPageTitle, type AdminPageTitleProps, AnimPostFxSelect, type AnimPostFxSelectProps, AsyncSaveButton, BlipColorSelect, type BlipColorSelectProps, BlipDisplaySelect, type BlipDisplaySelectProps, BlipIconSelect, type BlipIconSelectProps, BorderedIcon, type BorderedIconProps, type ButtonProps, ConfigPanel, type ConfigPanelProps, ConfirmModal, type ConfirmModalProps, ControlMultiSelect, type ControlMultiSelectProps, ControlSelect, type ControlSelectProps, Counter, type FiveMControls, FiveMKeyBindInput, FloatingParticles, type FloatingParticlesProps, GroupName, type GroupNameProps, GroupRank, type GroupRankProps, GroupSelect, type GroupSelectProps, type GroupType, type GroupValue, InfoBox, type InfoBoxProps, InputContainer, type InputContainerProps, LevelBanner, LevelPanel, MissingItemsBanner, Modal, ModalContext, type ModalProps, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, type NavItem, NavigationContext, NavigationProvider, type NavigationStore, type ParticleState, PositionPicker, type PositionPickerProps, type ProgressProps, type Prompt, type PromptButton, PromptModal, type SegmentProps, SegmentedControl, type SegmentedControlProps, SegmentedProgress, SelectItem, type SelectItemProps, type StoreModalProps, TestBed, type TestBedItem, type TestBedPlacement, type TestBedProps, ThemeOverrideSection, type ThemeOverrideSectionProps, type ThemeOverrideValue, Title, type TitleProps, type TitleSize, Vector4DeleteButton, Vector4Display, type Vector4Value, WorldPositionGotoButton, WorldPositionSetButton, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore };
|
|
1053
|
+
export { AdminPageTitle, type AdminPageTitleProps, AnimPostFxSelect, type AnimPostFxSelectProps, AsyncSaveButton, BlipColorSelect, type BlipColorSelectProps, BlipDisplaySelect, type BlipDisplaySelectProps, BlipIconSelect, type BlipIconSelectProps, BorderedIcon, type BorderedIconProps, type ButtonProps, ConfigPanel, type ConfigPanelProps, ConfirmModal, type ConfirmModalProps, ControlMultiSelect, type ControlMultiSelectProps, ControlSelect, type ControlSelectProps, Counter, type FiveMControls, FiveMKeyBindInput, FloatingParticles, type FloatingParticlesProps, GroupName, type GroupNameProps, GroupRank, type GroupRankProps, GroupSelect, type GroupSelectProps, type GroupType, type GroupValue, InfoBox, type InfoBoxProps, InputContainer, type InputContainerProps, LevelBanner, LevelPanel, MissingItemsBanner, Modal, ModalContext, type ModalProps, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, type NavItem, NavigationContext, NavigationProvider, type NavigationStore, type ParticleState, PositionPicker, type PositionPickerProps, type ProgressProps, type Prompt, type PromptButton, PromptModal, type SegmentProps, SegmentedControl, type SegmentedControlProps, SegmentedProgress, SelectItem, type SelectItemProps, type StoreModalProps, SwitchPanel, type SwitchPanelProps, TestBed, type TestBedItem, type TestBedPlacement, type TestBedProps, ThemeOverrideSection, type ThemeOverrideSectionProps, type ThemeOverrideValue, Title, type TitleProps, type TitleSize, Vector4DeleteButton, Vector4Display, type Vector4Value, WorldPositionGotoButton, WorldPositionSetButton, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore };
|
|
@@ -971,6 +971,15 @@ type AdminPageTitleProps = {
|
|
|
971
971
|
};
|
|
972
972
|
declare function AdminPageTitle(props: AdminPageTitleProps): react_jsx_runtime.JSX.Element;
|
|
973
973
|
|
|
974
|
+
type SwitchPanelProps = {
|
|
975
|
+
label: ReactNode;
|
|
976
|
+
description?: ReactNode;
|
|
977
|
+
checked: boolean;
|
|
978
|
+
onChange: (v: boolean) => void;
|
|
979
|
+
disabled?: boolean;
|
|
980
|
+
};
|
|
981
|
+
declare function SwitchPanel({ label, description, checked, onChange, disabled }: SwitchPanelProps): react_jsx_runtime.JSX.Element;
|
|
982
|
+
|
|
974
983
|
type MissingItem = {
|
|
975
984
|
name: string;
|
|
976
985
|
label?: string;
|
|
@@ -1041,4 +1050,4 @@ type AnimPostFxSelectProps = Omit<SelectProps, "data" | "value" | "onChange"> &
|
|
|
1041
1050
|
};
|
|
1042
1051
|
declare function AnimPostFxSelect({ value, onChange, label, size, searchable, clearable, ...rest }: AnimPostFxSelectProps): react_jsx_runtime.JSX.Element;
|
|
1043
1052
|
|
|
1044
|
-
export { AdminPageTitle, type AdminPageTitleProps, AnimPostFxSelect, type AnimPostFxSelectProps, AsyncSaveButton, BlipColorSelect, type BlipColorSelectProps, BlipDisplaySelect, type BlipDisplaySelectProps, BlipIconSelect, type BlipIconSelectProps, BorderedIcon, type BorderedIconProps, type ButtonProps, ConfigPanel, type ConfigPanelProps, ConfirmModal, type ConfirmModalProps, ControlMultiSelect, type ControlMultiSelectProps, ControlSelect, type ControlSelectProps, Counter, type FiveMControls, FiveMKeyBindInput, FloatingParticles, type FloatingParticlesProps, GroupName, type GroupNameProps, GroupRank, type GroupRankProps, GroupSelect, type GroupSelectProps, type GroupType, type GroupValue, InfoBox, type InfoBoxProps, InputContainer, type InputContainerProps, LevelBanner, LevelPanel, MissingItemsBanner, Modal, ModalContext, type ModalProps, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, type NavItem, NavigationContext, NavigationProvider, type NavigationStore, type ParticleState, PositionPicker, type PositionPickerProps, type ProgressProps, type Prompt, type PromptButton, PromptModal, type SegmentProps, SegmentedControl, type SegmentedControlProps, SegmentedProgress, SelectItem, type SelectItemProps, type StoreModalProps, TestBed, type TestBedItem, type TestBedPlacement, type TestBedProps, ThemeOverrideSection, type ThemeOverrideSectionProps, type ThemeOverrideValue, Title, type TitleProps, type TitleSize, Vector4DeleteButton, Vector4Display, type Vector4Value, WorldPositionGotoButton, WorldPositionSetButton, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore };
|
|
1053
|
+
export { AdminPageTitle, type AdminPageTitleProps, AnimPostFxSelect, type AnimPostFxSelectProps, AsyncSaveButton, BlipColorSelect, type BlipColorSelectProps, BlipDisplaySelect, type BlipDisplaySelectProps, BlipIconSelect, type BlipIconSelectProps, BorderedIcon, type BorderedIconProps, type ButtonProps, ConfigPanel, type ConfigPanelProps, ConfirmModal, type ConfirmModalProps, ControlMultiSelect, type ControlMultiSelectProps, ControlSelect, type ControlSelectProps, Counter, type FiveMControls, FiveMKeyBindInput, FloatingParticles, type FloatingParticlesProps, GroupName, type GroupNameProps, GroupRank, type GroupRankProps, GroupSelect, type GroupSelectProps, type GroupType, type GroupValue, InfoBox, type InfoBoxProps, InputContainer, type InputContainerProps, LevelBanner, LevelPanel, MissingItemsBanner, Modal, ModalContext, type ModalProps, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, type NavItem, NavigationContext, NavigationProvider, type NavigationStore, type ParticleState, PositionPicker, type PositionPickerProps, type ProgressProps, type Prompt, type PromptButton, PromptModal, type SegmentProps, SegmentedControl, type SegmentedControlProps, SegmentedProgress, SelectItem, type SelectItemProps, type StoreModalProps, SwitchPanel, type SwitchPanelProps, TestBed, type TestBedItem, type TestBedPlacement, type TestBedProps, ThemeOverrideSection, type ThemeOverrideSectionProps, type ThemeOverrideValue, Title, type TitleProps, type TitleSize, Vector4DeleteButton, Vector4Display, type Vector4Value, WorldPositionGotoButton, WorldPositionSetButton, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore };
|
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Flex, Text, Image, TextInput, Select, Box, useMantineTheme, Tooltip, alpha, Progress, RingProgress, Portal, Button, NumberInput, MultiSelect, Loader, ActionIcon, Stack,
|
|
1
|
+
import { Flex, Text, Image, TextInput, Select, Box, useMantineTheme, Tooltip, alpha, Progress, RingProgress, Portal, Button, NumberInput, MultiSelect, Loader, Switch, ActionIcon, Stack, ColorInput, Popover, Group, JsonInput } from '@mantine/core';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { createContext, useContext, useRef, useState, useEffect, useCallback, useMemo } from 'react';
|
|
4
4
|
import { create, useStore, createStore } from 'zustand';
|
|
@@ -1230,11 +1230,11 @@ var colorNames = {
|
|
|
1230
1230
|
Yellow: { r: 255, g: 255, b: 0 },
|
|
1231
1231
|
YellowGreen: { r: 154, g: 205, b: 50 }
|
|
1232
1232
|
};
|
|
1233
|
-
function colorWithAlpha(color,
|
|
1233
|
+
function colorWithAlpha(color, alpha11) {
|
|
1234
1234
|
const lowerCasedColor = color.toLowerCase();
|
|
1235
1235
|
if (colorNames[lowerCasedColor]) {
|
|
1236
1236
|
const rgb = colorNames[lowerCasedColor];
|
|
1237
|
-
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${
|
|
1237
|
+
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha11})`;
|
|
1238
1238
|
}
|
|
1239
1239
|
if (/^#([A-Fa-f0-9]{6})$/.test(color)) {
|
|
1240
1240
|
const hex = color.slice(1);
|
|
@@ -1242,12 +1242,12 @@ function colorWithAlpha(color, alpha10) {
|
|
|
1242
1242
|
const r = bigint >> 16 & 255;
|
|
1243
1243
|
const g = bigint >> 8 & 255;
|
|
1244
1244
|
const b = bigint & 255;
|
|
1245
|
-
return `rgba(${r}, ${g}, ${b}, ${
|
|
1245
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha11})`;
|
|
1246
1246
|
}
|
|
1247
1247
|
if (/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/.test(color)) {
|
|
1248
1248
|
const result = color.match(/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/);
|
|
1249
1249
|
if (result) {
|
|
1250
|
-
return `rgba(${result[1]}, ${result[2]}, ${result[3]}, ${
|
|
1250
|
+
return `rgba(${result[1]}, ${result[2]}, ${result[3]}, ${alpha11})`;
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
1253
|
return color;
|
|
@@ -5125,6 +5125,45 @@ function AdminPageTitle(props) {
|
|
|
5125
5125
|
/* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", tt: "uppercase", lts: "0.1em", size: "sm", c: "rgba(255,255,255,0.6)", children: locale(props.title) })
|
|
5126
5126
|
] });
|
|
5127
5127
|
}
|
|
5128
|
+
function SwitchPanel({ label, description, checked, onChange, disabled }) {
|
|
5129
|
+
const theme = useMantineTheme();
|
|
5130
|
+
const pc = theme.colors[theme.primaryColor];
|
|
5131
|
+
return /* @__PURE__ */ jsxs(
|
|
5132
|
+
Flex,
|
|
5133
|
+
{
|
|
5134
|
+
justify: "space-between",
|
|
5135
|
+
align: "center",
|
|
5136
|
+
p: "xs",
|
|
5137
|
+
style: {
|
|
5138
|
+
background: alpha(theme.colors.dark[5], 0.35),
|
|
5139
|
+
border: "0.1vh solid rgba(255,255,255,0.05)",
|
|
5140
|
+
borderRadius: theme.radius.xs,
|
|
5141
|
+
opacity: disabled ? 0.5 : 1
|
|
5142
|
+
},
|
|
5143
|
+
children: [
|
|
5144
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "xxs", style: { flex: 1, minWidth: 0 }, children: [
|
|
5145
|
+
typeof label === "string" ? /* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", size: "xs", c: "rgba(255,255,255,0.85)", children: label }) : label,
|
|
5146
|
+
description && (typeof description === "string" ? /* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", size: "xxs", c: "rgba(255,255,255,0.45)", children: description }) : description)
|
|
5147
|
+
] }),
|
|
5148
|
+
/* @__PURE__ */ jsx(
|
|
5149
|
+
Switch,
|
|
5150
|
+
{
|
|
5151
|
+
checked,
|
|
5152
|
+
disabled,
|
|
5153
|
+
onChange: (e) => onChange(e.currentTarget.checked),
|
|
5154
|
+
size: "md",
|
|
5155
|
+
styles: {
|
|
5156
|
+
track: {
|
|
5157
|
+
background: checked ? alpha(pc[6], 0.4) : "rgba(255,255,255,0.08)",
|
|
5158
|
+
borderColor: checked ? alpha(pc[6], 0.6) : "rgba(255,255,255,0.1)"
|
|
5159
|
+
}
|
|
5160
|
+
}
|
|
5161
|
+
}
|
|
5162
|
+
)
|
|
5163
|
+
]
|
|
5164
|
+
}
|
|
5165
|
+
);
|
|
5166
|
+
}
|
|
5128
5167
|
var placementStyle = (placement) => {
|
|
5129
5168
|
switch (placement) {
|
|
5130
5169
|
case "top-center":
|
|
@@ -5375,32 +5414,13 @@ function ThemeOverrideSection({
|
|
|
5375
5414
|
color
|
|
5376
5415
|
}
|
|
5377
5416
|
),
|
|
5378
|
-
/* @__PURE__ */
|
|
5379
|
-
|
|
5417
|
+
/* @__PURE__ */ jsx(
|
|
5418
|
+
SwitchPanel,
|
|
5380
5419
|
{
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
background: `rgba(255,255,255,${editable ? 0.04 : 0.02})`,
|
|
5386
|
-
border: `0.1vh solid ${editable ? color : "rgba(255,255,255,0.08)"}`,
|
|
5387
|
-
borderRadius: mantineTheme.radius.xs,
|
|
5388
|
-
transition: "background 0.15s, border-color 0.15s"
|
|
5389
|
-
},
|
|
5390
|
-
children: [
|
|
5391
|
-
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "xxs", style: { flex: 1, minWidth: 0 }, children: [
|
|
5392
|
-
/* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", size: "xs", c: "rgba(255,255,255,0.9)", children: locale("OverrideGlobalTheme") || "Override global theme" }),
|
|
5393
|
-
/* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", size: "xxs", c: "rgba(255,255,255,0.4)", children: locale("OverrideGlobalThemeDesc") || "When on, this resource uses its own primary colour and palette instead of dirk_lib's. Turn off to fall back to the global theme \u2014 your custom palette is kept." })
|
|
5394
|
-
] }),
|
|
5395
|
-
/* @__PURE__ */ jsx(
|
|
5396
|
-
Switch,
|
|
5397
|
-
{
|
|
5398
|
-
size: "md",
|
|
5399
|
-
checked: value.useOverride,
|
|
5400
|
-
onChange: (e) => set("useOverride", e.currentTarget.checked)
|
|
5401
|
-
}
|
|
5402
|
-
)
|
|
5403
|
-
]
|
|
5420
|
+
label: locale("OverrideGlobalTheme") || "Override global theme",
|
|
5421
|
+
description: locale("OverrideGlobalThemeDesc") || "When on, this resource uses its own primary colour and palette instead of dirk_lib's. Turn off to fall back to the global theme \u2014 your custom palette is kept.",
|
|
5422
|
+
checked: value.useOverride,
|
|
5423
|
+
onChange: (v) => set("useOverride", v)
|
|
5404
5424
|
}
|
|
5405
5425
|
),
|
|
5406
5426
|
/* @__PURE__ */ jsxs(
|
|
@@ -5807,6 +5827,6 @@ function AnimPostFxSelect({
|
|
|
5807
5827
|
);
|
|
5808
5828
|
}
|
|
5809
5829
|
|
|
5810
|
-
export { AdminPageTitle, AnimPostFxSelect, AsyncSaveButton, BlipColorSelect, BlipDisplaySelect, BlipIconSelect, BorderedIcon, ConfigPanel, ConfirmModal, ControlMultiSelect, ControlSelect, Counter, FiveMKeyBindInput, FloatingParticles, GroupName, GroupRank, GroupSelect, InfoBox, InputContainer, LevelBanner, LevelPanel, MissingItemsBanner, Modal, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, PositionPicker, PromptModal, SegmentedControl, SegmentedProgress, SelectItem, TestBed, ThemeOverrideSection, Title, Vector4DeleteButton, Vector4Display, WorldPositionGotoButton, WorldPositionSetButton, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore };
|
|
5830
|
+
export { AdminPageTitle, AnimPostFxSelect, AsyncSaveButton, BlipColorSelect, BlipDisplaySelect, BlipIconSelect, BorderedIcon, ConfigPanel, ConfirmModal, ControlMultiSelect, ControlSelect, Counter, FiveMKeyBindInput, FloatingParticles, GroupName, GroupRank, GroupSelect, InfoBox, InputContainer, LevelBanner, LevelPanel, MissingItemsBanner, Modal, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, PositionPicker, PromptModal, SegmentedControl, SegmentedProgress, SelectItem, SwitchPanel, TestBed, ThemeOverrideSection, Title, Vector4DeleteButton, Vector4Display, WorldPositionGotoButton, WorldPositionSetButton, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore };
|
|
5811
5831
|
//# sourceMappingURL=index.js.map
|
|
5812
5832
|
//# sourceMappingURL=index.js.map
|