dirk-cfx-react 1.1.73 → 1.1.75
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 +299 -0
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +21 -1
- package/dist/components/index.d.ts +21 -1
- package/dist/components/index.js +301 -3
- package/dist/components/index.js.map +1 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +298 -0
- 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 +300 -3
- package/dist/index.js.map +1 -1
- package/dist/providers/index.cjs +6 -0
- package/dist/providers/index.cjs.map +1 -1
- package/dist/providers/index.js +6 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -1
|
@@ -1014,4 +1014,24 @@ interface TestBedProps {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
declare function TestBed({ items, storageKey, disablePersistence, title, placement, }: TestBedProps): react_jsx_runtime.JSX.Element | null;
|
|
1016
1016
|
|
|
1017
|
-
|
|
1017
|
+
type ThemeOverrideValue = {
|
|
1018
|
+
useOverride: boolean;
|
|
1019
|
+
primaryColor: string;
|
|
1020
|
+
primaryShade: number;
|
|
1021
|
+
customTheme: string[];
|
|
1022
|
+
};
|
|
1023
|
+
type ThemeOverrideSectionProps = {
|
|
1024
|
+
/**
|
|
1025
|
+
* Schema path the consumer stores its override block under. Defaults to
|
|
1026
|
+
* "theme" — matches the recommended schema key.
|
|
1027
|
+
*/
|
|
1028
|
+
schemaKey?: string;
|
|
1029
|
+
/**
|
|
1030
|
+
* Optional title for the AdminPageTitle. Defaults to the localized
|
|
1031
|
+
* "Theme" string with a fallback.
|
|
1032
|
+
*/
|
|
1033
|
+
title?: string;
|
|
1034
|
+
};
|
|
1035
|
+
declare function ThemeOverrideSection({ schemaKey, title, }: ThemeOverrideSectionProps): react_jsx_runtime.JSX.Element;
|
|
1036
|
+
|
|
1037
|
+
export { AdminPageTitle, type AdminPageTitleProps, 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 };
|
|
@@ -1014,4 +1014,24 @@ interface TestBedProps {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
declare function TestBed({ items, storageKey, disablePersistence, title, placement, }: TestBedProps): react_jsx_runtime.JSX.Element | null;
|
|
1016
1016
|
|
|
1017
|
-
|
|
1017
|
+
type ThemeOverrideValue = {
|
|
1018
|
+
useOverride: boolean;
|
|
1019
|
+
primaryColor: string;
|
|
1020
|
+
primaryShade: number;
|
|
1021
|
+
customTheme: string[];
|
|
1022
|
+
};
|
|
1023
|
+
type ThemeOverrideSectionProps = {
|
|
1024
|
+
/**
|
|
1025
|
+
* Schema path the consumer stores its override block under. Defaults to
|
|
1026
|
+
* "theme" — matches the recommended schema key.
|
|
1027
|
+
*/
|
|
1028
|
+
schemaKey?: string;
|
|
1029
|
+
/**
|
|
1030
|
+
* Optional title for the AdminPageTitle. Defaults to the localized
|
|
1031
|
+
* "Theme" string with a fallback.
|
|
1032
|
+
*/
|
|
1033
|
+
title?: string;
|
|
1034
|
+
};
|
|
1035
|
+
declare function ThemeOverrideSection({ schemaKey, title, }: ThemeOverrideSectionProps): react_jsx_runtime.JSX.Element;
|
|
1036
|
+
|
|
1037
|
+
export { AdminPageTitle, type AdminPageTitleProps, 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 };
|
package/dist/components/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Flex, Text, Image, TextInput, Select, Box, useMantineTheme, Tooltip, alpha, Progress, RingProgress, Portal, Button, NumberInput, MultiSelect, Loader, ActionIcon, Stack, Group, JsonInput } from '@mantine/core';
|
|
1
|
+
import { Flex, Text, Image, TextInput, Select, Box, useMantineTheme, Tooltip, alpha, Progress, RingProgress, Portal, Button, NumberInput, MultiSelect, Loader, ActionIcon, Stack, Switch, 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';
|
|
5
5
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
6
6
|
import { motion, AnimatePresence, useMotionValue } from 'framer-motion';
|
|
7
|
-
import { Info, X, AlertTriangle, Trash2, RefreshCw, ChevronDown, Check, Copy, MapPin, Crosshair, EyeOff, Eye, RotateCcw, FlaskConical, ChevronUp, ArrowLeft, Undo2, Redo2, Save, History, XCircle, Code2, Search, Filter, User } from 'lucide-react';
|
|
7
|
+
import { Info, X, AlertTriangle, Trash2, RefreshCw, ChevronDown, Check, Copy, MapPin, Crosshair, EyeOff, Eye, RotateCcw, FlaskConical, ChevronUp, Palette, ArrowLeft, Undo2, Redo2, Save, History, XCircle, Code2, Search, Filter, User } from 'lucide-react';
|
|
8
8
|
import clickSoundUrl from '../click_sound-PNCRRTM4.mp3';
|
|
9
9
|
import hoverSoundUrl from '../hover_sound-NBUA222C.mp3';
|
|
10
10
|
import { notifications } from '@mantine/notifications';
|
|
11
11
|
import { QueryClient, QueryClientProvider, useInfiniteQuery } from '@tanstack/react-query';
|
|
12
|
+
import { generateColors } from '@mantine/colors-generator';
|
|
12
13
|
|
|
13
14
|
// src/components/BlipSelect.tsx
|
|
14
15
|
var BLIP_ENTRIES = [
|
|
@@ -3706,6 +3707,13 @@ function useForm() {
|
|
|
3706
3707
|
}, [state.values, state.initialValues]);
|
|
3707
3708
|
return { ...state, changedFields, changedCount: changedFields.length };
|
|
3708
3709
|
}
|
|
3710
|
+
function useFormField(path) {
|
|
3711
|
+
const store = useContext(FormContext);
|
|
3712
|
+
if (!store) {
|
|
3713
|
+
throw new Error("useFormField must be used inside <FormProvider>");
|
|
3714
|
+
}
|
|
3715
|
+
return useStore(store, (s) => getNested(s.values, path));
|
|
3716
|
+
}
|
|
3709
3717
|
function useFormActions() {
|
|
3710
3718
|
const store = useContext(FormContext);
|
|
3711
3719
|
if (!store) {
|
|
@@ -4092,7 +4100,22 @@ function ConfigPanelInner({
|
|
|
4092
4100
|
if (result?.success) {
|
|
4093
4101
|
const { store } = getScriptConfigInstance();
|
|
4094
4102
|
form.reinitialize(cloneConfig(store.getState()));
|
|
4103
|
+
notifications.show({
|
|
4104
|
+
color: "green",
|
|
4105
|
+
title: locale("ConfigResetSuccessTitle"),
|
|
4106
|
+
message: locale("ConfigResetSuccessBody"),
|
|
4107
|
+
autoClose: 3e3
|
|
4108
|
+
});
|
|
4109
|
+
return;
|
|
4095
4110
|
}
|
|
4111
|
+
const err = result?._error || "Unknown";
|
|
4112
|
+
console.warn(`[ConfigPanel] config reset failed: ${err}`);
|
|
4113
|
+
notifications.show({
|
|
4114
|
+
color: "red",
|
|
4115
|
+
title: locale("ConfigResetFailedTitle"),
|
|
4116
|
+
message: locale("ConfigResetFailedBody", err),
|
|
4117
|
+
autoClose: 6e3
|
|
4118
|
+
});
|
|
4096
4119
|
},
|
|
4097
4120
|
onClose: () => setResetOpen(false),
|
|
4098
4121
|
zIndex: 300
|
|
@@ -5267,7 +5290,282 @@ function TestBed({
|
|
|
5267
5290
|
}
|
|
5268
5291
|
);
|
|
5269
5292
|
}
|
|
5293
|
+
var MANTINE_COLOR_OPTIONS = [
|
|
5294
|
+
"dirk",
|
|
5295
|
+
"red",
|
|
5296
|
+
"pink",
|
|
5297
|
+
"grape",
|
|
5298
|
+
"violet",
|
|
5299
|
+
"indigo",
|
|
5300
|
+
"blue",
|
|
5301
|
+
"cyan",
|
|
5302
|
+
"teal",
|
|
5303
|
+
"green",
|
|
5304
|
+
"lime",
|
|
5305
|
+
"yellow",
|
|
5306
|
+
"orange"
|
|
5307
|
+
].map((value) => ({ value, label: value }));
|
|
5308
|
+
var DEFAULT_PALETTE = [
|
|
5309
|
+
"#f0f4ff",
|
|
5310
|
+
"#d9e3ff",
|
|
5311
|
+
"#bfcfff",
|
|
5312
|
+
"#a6bbff",
|
|
5313
|
+
"#8ca7ff",
|
|
5314
|
+
"#7393ff",
|
|
5315
|
+
"#5a7fff",
|
|
5316
|
+
"#406bff",
|
|
5317
|
+
"#2547ff",
|
|
5318
|
+
"#0b33ff"
|
|
5319
|
+
];
|
|
5320
|
+
var DEFAULT_VALUE = {
|
|
5321
|
+
useOverride: false,
|
|
5322
|
+
primaryColor: "dirk",
|
|
5323
|
+
primaryShade: 5,
|
|
5324
|
+
customTheme: DEFAULT_PALETTE
|
|
5325
|
+
};
|
|
5326
|
+
function GroupLabel({ label }) {
|
|
5327
|
+
return /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "xs", mt: "xxs", children: [
|
|
5328
|
+
/* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", size: "xxs", tt: "uppercase", lts: "0.07em", c: "rgba(255,255,255,0.2)", children: label }),
|
|
5329
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, height: "0.05vh", background: "rgba(255,255,255,0.06)" } })
|
|
5330
|
+
] });
|
|
5331
|
+
}
|
|
5332
|
+
function ThemeOverrideSection({
|
|
5333
|
+
schemaKey = "theme",
|
|
5334
|
+
title
|
|
5335
|
+
}) {
|
|
5336
|
+
const mantineTheme = useMantineTheme();
|
|
5337
|
+
const color = mantineTheme.colors[mantineTheme.primaryColor][5];
|
|
5338
|
+
const raw = useFormField(schemaKey);
|
|
5339
|
+
const value = {
|
|
5340
|
+
useOverride: raw?.useOverride ?? DEFAULT_VALUE.useOverride,
|
|
5341
|
+
primaryColor: raw?.primaryColor ?? DEFAULT_VALUE.primaryColor,
|
|
5342
|
+
primaryShade: raw?.primaryShade ?? DEFAULT_VALUE.primaryShade,
|
|
5343
|
+
customTheme: Array.isArray(raw?.customTheme) && raw.customTheme.length === 10 ? raw.customTheme : DEFAULT_VALUE.customTheme
|
|
5344
|
+
};
|
|
5345
|
+
const { setValue } = useFormActions();
|
|
5346
|
+
const set = (key, val) => setValue(schemaKey, { ...value, [key]: val });
|
|
5347
|
+
const useCustom = value.primaryColor === "custom";
|
|
5348
|
+
const editable = value.useOverride;
|
|
5349
|
+
const setSwatch = (index, hex) => {
|
|
5350
|
+
const next = [...value.customTheme];
|
|
5351
|
+
next[index] = hex;
|
|
5352
|
+
set("customTheme", next);
|
|
5353
|
+
};
|
|
5354
|
+
const generateFromBase = (hex) => {
|
|
5355
|
+
try {
|
|
5356
|
+
const generated = generateColors(hex);
|
|
5357
|
+
set("customTheme", generated);
|
|
5358
|
+
} catch {
|
|
5359
|
+
}
|
|
5360
|
+
};
|
|
5361
|
+
const resetPalette = () => set("customTheme", DEFAULT_PALETTE);
|
|
5362
|
+
return /* @__PURE__ */ jsxs(
|
|
5363
|
+
Flex,
|
|
5364
|
+
{
|
|
5365
|
+
direction: "column",
|
|
5366
|
+
gap: "xs",
|
|
5367
|
+
p: "sm",
|
|
5368
|
+
style: { flex: 1, minHeight: 0, overflowY: "auto" },
|
|
5369
|
+
children: [
|
|
5370
|
+
/* @__PURE__ */ jsx(
|
|
5371
|
+
AdminPageTitle,
|
|
5372
|
+
{
|
|
5373
|
+
icon: Palette,
|
|
5374
|
+
title: title || locale("Theme") || "Theme",
|
|
5375
|
+
color
|
|
5376
|
+
}
|
|
5377
|
+
),
|
|
5378
|
+
/* @__PURE__ */ jsxs(
|
|
5379
|
+
Flex,
|
|
5380
|
+
{
|
|
5381
|
+
align: "center",
|
|
5382
|
+
justify: "space-between",
|
|
5383
|
+
p: "xs",
|
|
5384
|
+
style: {
|
|
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
|
+
]
|
|
5404
|
+
}
|
|
5405
|
+
),
|
|
5406
|
+
/* @__PURE__ */ jsxs(
|
|
5407
|
+
"div",
|
|
5408
|
+
{
|
|
5409
|
+
style: {
|
|
5410
|
+
opacity: editable ? 1 : 0.4,
|
|
5411
|
+
pointerEvents: editable ? "auto" : "none",
|
|
5412
|
+
transition: "opacity 0.15s"
|
|
5413
|
+
},
|
|
5414
|
+
children: [
|
|
5415
|
+
/* @__PURE__ */ jsx(GroupLabel, { label: locale("PrimaryColor") || "Primary Colour" }),
|
|
5416
|
+
/* @__PURE__ */ jsx(
|
|
5417
|
+
Switch,
|
|
5418
|
+
{
|
|
5419
|
+
label: locale("UseCustomPalette") || "Use custom palette",
|
|
5420
|
+
size: "md",
|
|
5421
|
+
checked: useCustom,
|
|
5422
|
+
onChange: (e) => set("primaryColor", e.currentTarget.checked ? "custom" : "dirk"),
|
|
5423
|
+
styles: {
|
|
5424
|
+
label: {
|
|
5425
|
+
fontFamily: "Akrobat Bold",
|
|
5426
|
+
fontSize: "0.65em",
|
|
5427
|
+
letterSpacing: "0.06em",
|
|
5428
|
+
textTransform: "uppercase",
|
|
5429
|
+
color: "rgba(255,255,255,0.35)"
|
|
5430
|
+
}
|
|
5431
|
+
}
|
|
5432
|
+
}
|
|
5433
|
+
),
|
|
5434
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "xs", mt: "xs", children: [
|
|
5435
|
+
!useCustom && /* @__PURE__ */ jsx(
|
|
5436
|
+
Select,
|
|
5437
|
+
{
|
|
5438
|
+
label: locale("MantinePalette") || "Mantine palette",
|
|
5439
|
+
size: "xs",
|
|
5440
|
+
style: { flex: 1 },
|
|
5441
|
+
value: value.primaryColor,
|
|
5442
|
+
data: MANTINE_COLOR_OPTIONS,
|
|
5443
|
+
allowDeselect: false,
|
|
5444
|
+
onChange: (v) => v && set("primaryColor", v)
|
|
5445
|
+
}
|
|
5446
|
+
),
|
|
5447
|
+
/* @__PURE__ */ jsx(
|
|
5448
|
+
NumberInput,
|
|
5449
|
+
{
|
|
5450
|
+
label: locale("Shade") || "Shade",
|
|
5451
|
+
size: "xs",
|
|
5452
|
+
style: { flex: 1 },
|
|
5453
|
+
min: 0,
|
|
5454
|
+
max: 9,
|
|
5455
|
+
value: value.primaryShade,
|
|
5456
|
+
onChange: (v) => set("primaryShade", Number(v))
|
|
5457
|
+
}
|
|
5458
|
+
)
|
|
5459
|
+
] }),
|
|
5460
|
+
useCustom && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5461
|
+
/* @__PURE__ */ jsxs(Flex, { align: "center", justify: "space-between", mt: "sm", children: [
|
|
5462
|
+
/* @__PURE__ */ jsx(
|
|
5463
|
+
Text,
|
|
5464
|
+
{
|
|
5465
|
+
ff: "Akrobat Bold",
|
|
5466
|
+
size: "xxs",
|
|
5467
|
+
tt: "uppercase",
|
|
5468
|
+
lts: "0.07em",
|
|
5469
|
+
c: "rgba(255,255,255,0.2)",
|
|
5470
|
+
children: locale("CustomPalette") || "Custom palette"
|
|
5471
|
+
}
|
|
5472
|
+
),
|
|
5473
|
+
/* @__PURE__ */ jsx(
|
|
5474
|
+
ActionIcon,
|
|
5475
|
+
{
|
|
5476
|
+
size: "sm",
|
|
5477
|
+
variant: "subtle",
|
|
5478
|
+
onClick: resetPalette,
|
|
5479
|
+
title: locale("ResetPalette") || "Reset palette",
|
|
5480
|
+
children: /* @__PURE__ */ jsx(RotateCcw, { size: "1.4vh" })
|
|
5481
|
+
}
|
|
5482
|
+
)
|
|
5483
|
+
] }),
|
|
5484
|
+
/* @__PURE__ */ jsx(
|
|
5485
|
+
ColorInput,
|
|
5486
|
+
{
|
|
5487
|
+
label: locale("BaseColor") || "Base colour",
|
|
5488
|
+
size: "xs",
|
|
5489
|
+
value: value.customTheme[value.primaryShade] ?? value.customTheme[5] ?? "#000000",
|
|
5490
|
+
onChange: generateFromBase,
|
|
5491
|
+
eyeDropperIcon: /* @__PURE__ */ jsx(Fragment, {})
|
|
5492
|
+
}
|
|
5493
|
+
),
|
|
5494
|
+
/* @__PURE__ */ jsx(Flex, { gap: "xxs", mt: "xxs", children: value.customTheme.map((swatch, i) => /* @__PURE__ */ jsx(
|
|
5495
|
+
SwatchTile,
|
|
5496
|
+
{
|
|
5497
|
+
index: i,
|
|
5498
|
+
value: swatch,
|
|
5499
|
+
isPrimary: i === value.primaryShade,
|
|
5500
|
+
onChange: (v) => setSwatch(i, v)
|
|
5501
|
+
},
|
|
5502
|
+
i
|
|
5503
|
+
)) })
|
|
5504
|
+
] })
|
|
5505
|
+
]
|
|
5506
|
+
}
|
|
5507
|
+
)
|
|
5508
|
+
]
|
|
5509
|
+
}
|
|
5510
|
+
);
|
|
5511
|
+
}
|
|
5512
|
+
function SwatchTile({
|
|
5513
|
+
index,
|
|
5514
|
+
value,
|
|
5515
|
+
isPrimary,
|
|
5516
|
+
onChange
|
|
5517
|
+
}) {
|
|
5518
|
+
const [opened, setOpened] = useState(false);
|
|
5519
|
+
return /* @__PURE__ */ jsxs(Popover, { opened, onChange: setOpened, position: "bottom", withArrow: true, zIndex: 1e4, children: [
|
|
5520
|
+
/* @__PURE__ */ jsx(Popover.Target, { children: /* @__PURE__ */ jsx(
|
|
5521
|
+
"button",
|
|
5522
|
+
{
|
|
5523
|
+
onClick: () => setOpened((o) => !o),
|
|
5524
|
+
title: `${index} \xB7 ${value}`,
|
|
5525
|
+
style: {
|
|
5526
|
+
flex: 1,
|
|
5527
|
+
aspectRatio: "1 / 1",
|
|
5528
|
+
background: value,
|
|
5529
|
+
border: isPrimary ? "0.2vh solid rgba(255,255,255,0.85)" : "0.1vh solid rgba(255,255,255,0.15)",
|
|
5530
|
+
borderRadius: "0.4vh",
|
|
5531
|
+
cursor: "pointer",
|
|
5532
|
+
padding: 0,
|
|
5533
|
+
display: "flex",
|
|
5534
|
+
alignItems: "flex-end",
|
|
5535
|
+
justifyContent: "flex-end",
|
|
5536
|
+
position: "relative"
|
|
5537
|
+
},
|
|
5538
|
+
children: /* @__PURE__ */ jsx(
|
|
5539
|
+
"span",
|
|
5540
|
+
{
|
|
5541
|
+
style: {
|
|
5542
|
+
fontFamily: "Akrobat Bold",
|
|
5543
|
+
fontSize: "0.9vh",
|
|
5544
|
+
lineHeight: 1,
|
|
5545
|
+
padding: "0.2vh 0.3vh",
|
|
5546
|
+
color: "rgba(0,0,0,0.55)",
|
|
5547
|
+
background: "rgba(255,255,255,0.55)",
|
|
5548
|
+
borderRadius: "0.25vh",
|
|
5549
|
+
margin: "0.2vh"
|
|
5550
|
+
},
|
|
5551
|
+
children: index
|
|
5552
|
+
}
|
|
5553
|
+
)
|
|
5554
|
+
}
|
|
5555
|
+
) }),
|
|
5556
|
+
/* @__PURE__ */ jsx(Popover.Dropdown, { p: "xs", children: /* @__PURE__ */ jsx(
|
|
5557
|
+
ColorInput,
|
|
5558
|
+
{
|
|
5559
|
+
size: "xs",
|
|
5560
|
+
value,
|
|
5561
|
+
onChange,
|
|
5562
|
+
format: "hex",
|
|
5563
|
+
eyeDropperIcon: /* @__PURE__ */ jsx(Fragment, {})
|
|
5564
|
+
}
|
|
5565
|
+
) })
|
|
5566
|
+
] });
|
|
5567
|
+
}
|
|
5270
5568
|
|
|
5271
|
-
export { AdminPageTitle, 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, Title, Vector4DeleteButton, Vector4Display, WorldPositionGotoButton, WorldPositionSetButton, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore };
|
|
5569
|
+
export { AdminPageTitle, 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 };
|
|
5272
5570
|
//# sourceMappingURL=index.js.map
|
|
5273
5571
|
//# sourceMappingURL=index.js.map
|