dirk-cfx-react 1.1.66 → 1.1.68

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.
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { SelectProps, FlexProps } from '@mantine/core';
2
+ import { SelectProps, FlexProps, MultiSelectProps } from '@mantine/core';
3
3
  import * as React$1 from 'react';
4
4
  import React__default, { ReactNode, ComponentType } from 'react';
5
5
  import * as framer_motion from 'framer-motion';
@@ -914,6 +914,17 @@ declare const FiveMKeyBindInput: typeof Root & {
914
914
  Key: typeof Key;
915
915
  };
916
916
 
917
+ type ControlSelectProps = Omit<SelectProps, "data" | "value" | "onChange"> & {
918
+ value: number | null | undefined;
919
+ onChange: (id: number | null) => void;
920
+ };
921
+ declare function ControlSelect({ value, onChange, label, size, searchable, ...rest }: ControlSelectProps): react_jsx_runtime.JSX.Element;
922
+ type ControlMultiSelectProps = Omit<MultiSelectProps, "data" | "value" | "onChange"> & {
923
+ value: number[];
924
+ onChange: (ids: number[]) => void;
925
+ };
926
+ declare function ControlMultiSelect({ value, onChange, label, size, searchable, ...rest }: ControlMultiSelectProps): react_jsx_runtime.JSX.Element;
927
+
917
928
  declare function AsyncSaveButton({ onSave, color, label, style, }: {
918
929
  onSave: () => Promise<any>;
919
930
  color: string;
@@ -945,4 +956,4 @@ interface TestBedProps {
945
956
  }
946
957
  declare function TestBed({ items, storageKey, disablePersistence, title, }: TestBedProps): react_jsx_runtime.JSX.Element | null;
947
958
 
948
- 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, 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, 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 TestBedProps, Title, type TitleProps, type Vector4Value, useModal, useModalActions, useNavigation, useNavigationStore };
959
+ 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, 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 TestBedProps, Title, type TitleProps, type Vector4Value, useModal, useModalActions, useNavigation, useNavigationStore };
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { SelectProps, FlexProps } from '@mantine/core';
2
+ import { SelectProps, FlexProps, MultiSelectProps } from '@mantine/core';
3
3
  import * as React$1 from 'react';
4
4
  import React__default, { ReactNode, ComponentType } from 'react';
5
5
  import * as framer_motion from 'framer-motion';
@@ -914,6 +914,17 @@ declare const FiveMKeyBindInput: typeof Root & {
914
914
  Key: typeof Key;
915
915
  };
916
916
 
917
+ type ControlSelectProps = Omit<SelectProps, "data" | "value" | "onChange"> & {
918
+ value: number | null | undefined;
919
+ onChange: (id: number | null) => void;
920
+ };
921
+ declare function ControlSelect({ value, onChange, label, size, searchable, ...rest }: ControlSelectProps): react_jsx_runtime.JSX.Element;
922
+ type ControlMultiSelectProps = Omit<MultiSelectProps, "data" | "value" | "onChange"> & {
923
+ value: number[];
924
+ onChange: (ids: number[]) => void;
925
+ };
926
+ declare function ControlMultiSelect({ value, onChange, label, size, searchable, ...rest }: ControlMultiSelectProps): react_jsx_runtime.JSX.Element;
927
+
917
928
  declare function AsyncSaveButton({ onSave, color, label, style, }: {
918
929
  onSave: () => Promise<any>;
919
930
  color: string;
@@ -945,4 +956,4 @@ interface TestBedProps {
945
956
  }
946
957
  declare function TestBed({ items, storageKey, disablePersistence, title, }: TestBedProps): react_jsx_runtime.JSX.Element | null;
947
958
 
948
- 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, 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, 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 TestBedProps, Title, type TitleProps, type Vector4Value, useModal, useModalActions, useNavigation, useNavigationStore };
959
+ 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, 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 TestBedProps, Title, type TitleProps, type Vector4Value, useModal, useModalActions, useNavigation, useNavigationStore };
@@ -1,4 +1,4 @@
1
- import { Flex, Text, Image, TextInput, Select, Box, useMantineTheme, Tooltip, alpha, Progress, RingProgress, Portal, Button, NumberInput, 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, Group, JsonInput } from '@mantine/core';
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { createContext, useContext, useRef, useState, useEffect, useMemo } from 'react';
4
4
  import { create, useStore, createStore } from 'zustand';
@@ -1647,6 +1647,119 @@ var INPUT_MAPPER_KEYS_BY_PRIMARY = {
1647
1647
  TOUCHPAD_ABSOLUTE_AXIS: [],
1648
1648
  TOUCHPAD_CENTERED_AXIS: []
1649
1649
  };
1650
+
1651
+ // src/utils/gtaControls.ts
1652
+ var GTA_CONTROLS = [
1653
+ // ── Camera ─────────────────────────────────────────────────────────────────
1654
+ { id: 0, symbol: "INPUT_NEXT_CAMERA", label: "Switch Camera", defaultKey: "V", group: "Camera" },
1655
+ { id: 1, symbol: "INPUT_LOOK_LR", label: "Look Left/Right", defaultKey: "Mouse X", group: "Camera" },
1656
+ { id: 2, symbol: "INPUT_LOOK_UD", label: "Look Up/Down", defaultKey: "Mouse Y", group: "Camera" },
1657
+ { id: 3, symbol: "INPUT_LOOK_UP_ONLY", label: "Look Up Only", group: "Camera" },
1658
+ { id: 4, symbol: "INPUT_LOOK_DOWN_ONLY", label: "Look Down Only", group: "Camera" },
1659
+ { id: 5, symbol: "INPUT_LOOK_LEFT_ONLY", label: "Look Left Only", group: "Camera" },
1660
+ { id: 6, symbol: "INPUT_LOOK_RIGHT_ONLY", label: "Look Right Only", group: "Camera" },
1661
+ { id: 8, symbol: "INPUT_CINEMATIC_SLOWMO", label: "Cinematic Slowmo", defaultKey: "Insert", group: "Camera" },
1662
+ { id: 26, symbol: "INPUT_LOOK_BEHIND", label: "Look Behind", defaultKey: "C", group: "Camera" },
1663
+ { id: 27, symbol: "INPUT_PHONE", label: "Phone", defaultKey: "Up Arrow", group: "Phone" },
1664
+ // ── Movement ───────────────────────────────────────────────────────────────
1665
+ { id: 21, symbol: "INPUT_SPRINT", label: "Sprint", defaultKey: "Left Shift", group: "Movement" },
1666
+ { id: 22, symbol: "INPUT_JUMP", label: "Jump", defaultKey: "Space", group: "Movement" },
1667
+ { id: 23, symbol: "INPUT_ENTER", label: "Enter Vehicle", defaultKey: "F", group: "Movement" },
1668
+ { id: 30, symbol: "INPUT_MOVE_LR", label: "Move Left/Right", group: "Movement" },
1669
+ { id: 31, symbol: "INPUT_MOVE_UD", label: "Move Up/Down", group: "Movement" },
1670
+ { id: 32, symbol: "INPUT_MOVE_UP_ONLY", label: "Move Forward (W)", group: "Movement" },
1671
+ { id: 33, symbol: "INPUT_MOVE_DOWN_ONLY", label: "Move Back (S)", group: "Movement" },
1672
+ { id: 34, symbol: "INPUT_MOVE_LEFT_ONLY", label: "Move Left (A)", group: "Movement" },
1673
+ { id: 35, symbol: "INPUT_MOVE_RIGHT_ONLY", label: "Move Right (D)", group: "Movement" },
1674
+ { id: 36, symbol: "INPUT_DUCK", label: "Duck / Stealth", defaultKey: "Left Ctrl", group: "Movement" },
1675
+ { id: 37, symbol: "INPUT_SELECT_WEAPON", label: "Weapon Wheel", defaultKey: "Tab", group: "Combat" },
1676
+ { id: 38, symbol: "INPUT_PICKUP", label: "Pickup / Interact", defaultKey: "E", group: "Movement" },
1677
+ // ── Combat ─────────────────────────────────────────────────────────────────
1678
+ { id: 24, symbol: "INPUT_ATTACK", label: "Attack / Fire", defaultKey: "Mouse 1", group: "Combat" },
1679
+ { id: 25, symbol: "INPUT_AIM", label: "Aim", defaultKey: "Mouse 2", group: "Combat" },
1680
+ { id: 45, symbol: "INPUT_RELOAD", label: "Reload", defaultKey: "R", group: "Combat" },
1681
+ { id: 47, symbol: "INPUT_DETONATE", label: "Detonate", defaultKey: "G", group: "Combat" },
1682
+ { id: 257, symbol: "INPUT_ATTACK2", label: "Attack 2", group: "Combat" },
1683
+ { id: 140, symbol: "INPUT_MELEE_ATTACK_LIGHT", label: "Melee Light", defaultKey: "R", group: "Combat" },
1684
+ { id: 141, symbol: "INPUT_MELEE_ATTACK_HEAVY", label: "Melee Heavy", defaultKey: "Q", group: "Combat" },
1685
+ { id: 142, symbol: "INPUT_MELEE_ATTACK_ALTERNATE", label: "Melee Alternate", defaultKey: "Mouse 1", group: "Combat" },
1686
+ { id: 263, symbol: "INPUT_MELEE_ATTACK1", label: "Melee Attack 1", group: "Combat" },
1687
+ { id: 264, symbol: "INPUT_MELEE_ATTACK2", label: "Melee Attack 2", group: "Combat" },
1688
+ // ── Cover ──────────────────────────────────────────────────────────────────
1689
+ { id: 44, symbol: "INPUT_COVER", label: "Cover", defaultKey: "Q", group: "Cover" },
1690
+ // ── Vehicle (general) ──────────────────────────────────────────────────────
1691
+ { id: 59, symbol: "INPUT_VEH_MOVE_LR", label: "Vehicle Steering", group: "Vehicle" },
1692
+ { id: 63, symbol: "INPUT_VEH_MOVE_LEFT_ONLY", label: "Vehicle Steer Left", group: "Vehicle" },
1693
+ { id: 64, symbol: "INPUT_VEH_MOVE_RIGHT_ONLY", label: "Vehicle Steer Right", group: "Vehicle" },
1694
+ { id: 71, symbol: "INPUT_VEH_ACCELERATE", label: "Vehicle Accelerate", defaultKey: "W", group: "Vehicle" },
1695
+ { id: 72, symbol: "INPUT_VEH_BRAKE", label: "Vehicle Brake", defaultKey: "S", group: "Vehicle" },
1696
+ { id: 73, symbol: "INPUT_VEH_DUCK", label: "Vehicle Duck", defaultKey: "X", group: "Vehicle" },
1697
+ { id: 74, symbol: "INPUT_VEH_HEADLIGHT", label: "Headlights", defaultKey: "H", group: "Vehicle" },
1698
+ { id: 75, symbol: "INPUT_VEH_EXIT", label: "Exit Vehicle", defaultKey: "F", group: "Vehicle" },
1699
+ { id: 76, symbol: "INPUT_VEH_HANDBRAKE", label: "Handbrake", defaultKey: "Space", group: "Vehicle" },
1700
+ { id: 80, symbol: "INPUT_VEH_CIN_CAM", label: "Cinematic Cam", defaultKey: "R", group: "Vehicle" },
1701
+ { id: 81, symbol: "INPUT_VEH_NEXT_RADIO", label: "Radio Next", group: "Vehicle" },
1702
+ { id: 82, symbol: "INPUT_VEH_PREV_RADIO", label: "Radio Prev", group: "Vehicle" },
1703
+ { id: 83, symbol: "INPUT_VEH_NEXT_RADIO_TRACK", label: "Radio Next Track", group: "Vehicle" },
1704
+ { id: 84, symbol: "INPUT_VEH_PREV_RADIO_TRACK", label: "Radio Prev Track", group: "Vehicle" },
1705
+ { id: 85, symbol: "INPUT_VEH_RADIO_WHEEL", label: "Radio Wheel", defaultKey: "Q", group: "Vehicle" },
1706
+ { id: 86, symbol: "INPUT_VEH_HORN", label: "Horn", defaultKey: "E", group: "Vehicle" },
1707
+ { id: 90, symbol: "INPUT_VEH_AIM", label: "Vehicle Aim", group: "Vehicle" },
1708
+ { id: 91, symbol: "INPUT_VEH_ATTACK", label: "Vehicle Attack", group: "Vehicle" },
1709
+ { id: 92, symbol: "INPUT_VEH_ATTACK2", label: "Vehicle Attack 2", group: "Vehicle" },
1710
+ { id: 99, symbol: "INPUT_VEH_SELECT_NEXT_WEAPON", label: "Veh Next Weapon", group: "Vehicle" },
1711
+ { id: 100, symbol: "INPUT_VEH_SELECT_PREV_WEAPON", label: "Veh Prev Weapon", group: "Vehicle" },
1712
+ // ── Vehicle (Plane/Heli) ───────────────────────────────────────────────────
1713
+ { id: 152, symbol: "INPUT_VEH_FLY_THROTTLE_UP", label: "Plane Throttle Up", defaultKey: "W", group: "Vehicle (Plane/Heli)" },
1714
+ { id: 153, symbol: "INPUT_VEH_FLY_THROTTLE_DOWN", label: "Plane Throttle Down", defaultKey: "S", group: "Vehicle (Plane/Heli)" },
1715
+ { id: 154, symbol: "INPUT_VEH_FLY_YAW_LEFT", label: "Plane Yaw Left", defaultKey: "A", group: "Vehicle (Plane/Heli)" },
1716
+ { id: 155, symbol: "INPUT_VEH_FLY_YAW_RIGHT", label: "Plane Yaw Right", defaultKey: "D", group: "Vehicle (Plane/Heli)" },
1717
+ { id: 158, symbol: "INPUT_VEH_FLY_ATTACK", label: "Plane Attack", defaultKey: "Mouse 1", group: "Vehicle (Plane/Heli)" },
1718
+ // ── Vehicle (Boat / Bike) ──────────────────────────────────────────────────
1719
+ { id: 198, symbol: "INPUT_VEH_BICYCLE_PEDAL", label: "Bike Pedal", group: "Vehicle (Boat/Bike)" },
1720
+ // ── Phone ──────────────────────────────────────────────────────────────────
1721
+ { id: 137, symbol: "INPUT_FRONTEND_SOCIAL_CLUB_SECONDARY", label: "Toggle Phone (alt)", group: "Phone" },
1722
+ // ── Frontend / UI ──────────────────────────────────────────────────────────
1723
+ { id: 199, symbol: "INPUT_FRONTEND_PAUSE", label: "Pause Menu", defaultKey: "P", group: "Frontend / UI" },
1724
+ { id: 200, symbol: "INPUT_FRONTEND_PAUSE_ALTERNATE", label: "Pause Menu (alt)", defaultKey: "Esc", group: "Frontend / UI" },
1725
+ { id: 201, symbol: "INPUT_FRONTEND_ACCEPT", label: "Accept", defaultKey: "Enter", group: "Frontend / UI" },
1726
+ { id: 202, symbol: "INPUT_FRONTEND_CANCEL", label: "Cancel", defaultKey: "Esc", group: "Frontend / UI" },
1727
+ { id: 244, symbol: "INPUT_INTERACTION_MENU", label: "Interaction Menu", defaultKey: "M", group: "Frontend / UI" },
1728
+ // ── Multiplayer ────────────────────────────────────────────────────────────
1729
+ { id: 245, symbol: "INPUT_MP_TEXT_CHAT_ALL", label: "Chat (All)", defaultKey: "T", group: "Multiplayer" },
1730
+ { id: 246, symbol: "INPUT_MP_TEXT_CHAT_TEAM", label: "Chat (Team)", defaultKey: "Y", group: "Multiplayer" },
1731
+ { id: 247, symbol: "INPUT_MP_TEXT_CHAT_FRIENDS", label: "Chat (Friends)", group: "Multiplayer" },
1732
+ { id: 248, symbol: "INPUT_MP_TEXT_CHAT_CREW", label: "Chat (Crew)", group: "Multiplayer" },
1733
+ { id: 249, symbol: "INPUT_PUSH_TO_TALK", label: "Push To Talk", defaultKey: "N", group: "Multiplayer" },
1734
+ // ── Misc ───────────────────────────────────────────────────────────────────
1735
+ { id: 51, symbol: "INPUT_CONTEXT", label: "Context (E)", defaultKey: "E", group: "Misc" },
1736
+ { id: 52, symbol: "INPUT_CONTEXT_SECONDARY", label: "Context Secondary", defaultKey: "Q", group: "Misc" },
1737
+ { id: 73, symbol: "INPUT_CHARACTER_WHEEL", label: "Character Wheel", defaultKey: "Left Alt", group: "Misc" },
1738
+ { id: 105, symbol: "INPUT_HUD_SPECIAL", label: "Special Ability", defaultKey: "Caps Lock", group: "Misc" },
1739
+ { id: 121, symbol: "INPUT_MULTIPLAYER_INFO", label: "Player List", defaultKey: "Z", group: "Misc" },
1740
+ { id: 170, symbol: "INPUT_SAVE_REPLAY_CLIP", label: "Save Replay Clip", defaultKey: "F1", group: "Misc" },
1741
+ { id: 288, symbol: "INPUT_REPLAY_START_STOP_RECORDING", label: "Replay Record", defaultKey: "F1", group: "Misc" },
1742
+ { id: 289, symbol: "INPUT_REPLAY_START_STOP_RECORDING_SECONDARY", label: "Replay Record (alt)", group: "Misc" }
1743
+ ];
1744
+ var BY_ID = new Map(GTA_CONTROLS.map((c) => [c.id, c]));
1745
+ function formatGtaControl(id) {
1746
+ const c = BY_ID.get(id);
1747
+ if (!c) return `Control ${id}`;
1748
+ return c.defaultKey ? `${c.label} (${id} \xB7 ${c.defaultKey})` : `${c.label} (${id})`;
1749
+ }
1750
+ var GTA_CONTROL_GROUP_ORDER = [
1751
+ "Camera",
1752
+ "Movement",
1753
+ "Combat",
1754
+ "Cover",
1755
+ "Vehicle",
1756
+ "Vehicle (Plane/Heli)",
1757
+ "Vehicle (Boat/Bike)",
1758
+ "Phone",
1759
+ "Frontend / UI",
1760
+ "Multiplayer",
1761
+ "Misc"
1762
+ ];
1650
1763
  function BorderedIcon(props) {
1651
1764
  const theme = useMantineTheme();
1652
1765
  return /* @__PURE__ */ jsx(
@@ -4025,6 +4138,7 @@ function SelectItem(props) {
4025
4138
  data: formattedItems,
4026
4139
  allowDeselect: false,
4027
4140
  searchable: true,
4141
+ comboboxProps: { withinPortal: true, zIndex: 2e3 },
4028
4142
  leftSectionWidth: "4vh",
4029
4143
  leftSection: props.value ? /* @__PURE__ */ jsx(
4030
4144
  Image,
@@ -4430,6 +4544,83 @@ var FiveMKeyBindInput = Object.assign(Root, {
4430
4544
  Category,
4431
4545
  Key
4432
4546
  });
4547
+ function buildGroupedData(extraIds = []) {
4548
+ const groups = /* @__PURE__ */ new Map();
4549
+ for (const c of GTA_CONTROLS) {
4550
+ if (!groups.has(c.group)) groups.set(c.group, []);
4551
+ groups.get(c.group).push(c);
4552
+ }
4553
+ const data = GTA_CONTROL_GROUP_ORDER.flatMap((g) => {
4554
+ const items = groups.get(g);
4555
+ if (!items || items.length === 0) return [];
4556
+ return [
4557
+ {
4558
+ group: g,
4559
+ items: items.map((c) => ({
4560
+ value: String(c.id),
4561
+ label: formatGtaControl(c.id)
4562
+ }))
4563
+ }
4564
+ ];
4565
+ });
4566
+ const knownIds = new Set(GTA_CONTROLS.map((c) => c.id));
4567
+ const customs = extraIds.filter((id) => !knownIds.has(id));
4568
+ if (customs.length > 0) {
4569
+ data.push({
4570
+ group: "Custom",
4571
+ items: customs.map((id) => ({ value: String(id), label: `Control ${id}` }))
4572
+ });
4573
+ }
4574
+ return data;
4575
+ }
4576
+ function ControlSelect({
4577
+ value,
4578
+ onChange,
4579
+ label = "Control",
4580
+ size = "xs",
4581
+ searchable = true,
4582
+ ...rest
4583
+ }) {
4584
+ const data = buildGroupedData(value != null ? [value] : []);
4585
+ return /* @__PURE__ */ jsx(
4586
+ Select,
4587
+ {
4588
+ label,
4589
+ size,
4590
+ searchable,
4591
+ maxDropdownHeight: 320,
4592
+ nothingFoundMessage: "No matching controls",
4593
+ ...rest,
4594
+ data,
4595
+ value: value != null ? String(value) : null,
4596
+ onChange: (v) => onChange(v == null ? null : Number(v))
4597
+ }
4598
+ );
4599
+ }
4600
+ function ControlMultiSelect({
4601
+ value,
4602
+ onChange,
4603
+ label = "Controls",
4604
+ size = "xs",
4605
+ searchable = true,
4606
+ ...rest
4607
+ }) {
4608
+ const data = buildGroupedData(value);
4609
+ return /* @__PURE__ */ jsx(
4610
+ MultiSelect,
4611
+ {
4612
+ label,
4613
+ size,
4614
+ searchable,
4615
+ maxDropdownHeight: 320,
4616
+ nothingFoundMessage: "No matching controls",
4617
+ ...rest,
4618
+ data,
4619
+ value: value.map(String),
4620
+ onChange: (vals) => onChange(vals.map((v) => Number(v)).filter((n) => Number.isFinite(n)))
4621
+ }
4622
+ );
4623
+ }
4433
4624
  function AsyncSaveButton({
4434
4625
  onSave,
4435
4626
  color,
@@ -4639,6 +4830,6 @@ function TestBed({
4639
4830
  );
4640
4831
  }
4641
4832
 
4642
- export { AdminPageTitle, AsyncSaveButton, BlipColorSelect, BlipDisplaySelect, BlipIconSelect, BorderedIcon, ConfigPanel, ConfirmModal, Counter, FiveMKeyBindInput, FloatingParticles, GroupName, GroupRank, GroupSelect, InfoBox, InputContainer, LevelBanner, LevelPanel, Modal, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, PositionPicker, PromptModal, SegmentedControl, SegmentedProgress, SelectItem, TestBed, Title, useModal, useModalActions, useNavigation, useNavigationStore };
4833
+ export { AdminPageTitle, AsyncSaveButton, BlipColorSelect, BlipDisplaySelect, BlipIconSelect, BorderedIcon, ConfigPanel, ConfirmModal, ControlMultiSelect, ControlSelect, Counter, FiveMKeyBindInput, FloatingParticles, GroupName, GroupRank, GroupSelect, InfoBox, InputContainer, LevelBanner, LevelPanel, Modal, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, PositionPicker, PromptModal, SegmentedControl, SegmentedProgress, SelectItem, TestBed, Title, useModal, useModalActions, useNavigation, useNavigationStore };
4643
4834
  //# sourceMappingURL=index.js.map
4644
4835
  //# sourceMappingURL=index.js.map