@rpg-engine/long-bow 0.8.229 → 0.8.231

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.
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export interface IRadioSelectCardProps {
3
+ label: string;
4
+ description?: string;
5
+ badge?: string;
6
+ icon?: React.ReactNode;
7
+ active?: boolean;
8
+ onClick: () => void;
9
+ 'data-testid'?: string;
10
+ }
11
+ /**
12
+ * Dark RPG-themed radio-style card.
13
+ * Matches the aesthetic of MarketplaceSettingsPanel OptionCard.
14
+ * Uses !important overrides to survive RPGUI global CSS.
15
+ */
16
+ export declare const RadioSelectCard: React.FC<IRadioSelectCardProps>;
package/dist/index.d.ts CHANGED
@@ -63,6 +63,7 @@ export * from './components/QuantitySelector/QuantitySelectorModal';
63
63
  export * from './components/Quests/QuestInfo/QuestInfo';
64
64
  export * from './components/Quests/QuestList';
65
65
  export * from './components/RadioButton';
66
+ export * from './components/RadioSelectCard/RadioSelectCard';
66
67
  export * from './components/RangeSlider';
67
68
  export * from './components/RPGUI/RPGUIContainer';
68
69
  export * from './components/RPGUI/RPGUIRoot';
@@ -3738,26 +3738,35 @@ var ItemTooltip = function ItemTooltip(_ref) {
3738
3738
  atlasJSON = _ref.atlasJSON,
3739
3739
  equipmentSet = _ref.equipmentSet;
3740
3740
  var ref = React.useRef(null);
3741
+ var rafId = React.useRef(null);
3741
3742
  React.useEffect(function () {
3742
3743
  var current = ref.current;
3743
3744
  if (current) {
3744
3745
  var handleMouseMove = function handleMouseMove(event) {
3746
+ if (rafId.current !== null) return;
3745
3747
  var clientX = event.clientX,
3746
3748
  clientY = event.clientY;
3747
- // Adjust the position of the tooltip based on the mouse position
3748
- var rect = current.getBoundingClientRect();
3749
- var tooltipWidth = rect.width;
3750
- var tooltipHeight = rect.height;
3751
- var isOffScreenRight = clientX + tooltipWidth + offset > window.innerWidth;
3752
- var isOffScreenBottom = clientY + tooltipHeight + offset > window.innerHeight;
3753
- var x = isOffScreenRight ? clientX - tooltipWidth - offset : clientX + offset;
3754
- var y = isOffScreenBottom ? clientY - tooltipHeight - offset : clientY + offset;
3755
- current.style.transform = "translate(" + x + "px, " + y + "px)";
3756
- current.style.opacity = '1';
3749
+ rafId.current = requestAnimationFrame(function () {
3750
+ rafId.current = null;
3751
+ // Adjust the position of the tooltip based on the mouse position
3752
+ var rect = current.getBoundingClientRect();
3753
+ var tooltipWidth = rect.width;
3754
+ var tooltipHeight = rect.height;
3755
+ var isOffScreenRight = clientX + tooltipWidth + offset > window.innerWidth;
3756
+ var isOffScreenBottom = clientY + tooltipHeight + offset > window.innerHeight;
3757
+ var x = isOffScreenRight ? clientX - tooltipWidth - offset : clientX + offset;
3758
+ var y = isOffScreenBottom ? clientY - tooltipHeight - offset : clientY + offset;
3759
+ current.style.transform = "translate(" + x + "px, " + y + "px)";
3760
+ current.style.opacity = '1';
3761
+ });
3757
3762
  };
3758
3763
  window.addEventListener('mousemove', handleMouseMove);
3759
3764
  return function () {
3760
3765
  window.removeEventListener('mousemove', handleMouseMove);
3766
+ if (rafId.current !== null) {
3767
+ cancelAnimationFrame(rafId.current);
3768
+ rafId.current = null;
3769
+ }
3761
3770
  };
3762
3771
  }
3763
3772
  return;
@@ -5363,6 +5372,7 @@ var SimpleTooltip = function SimpleTooltip(_ref) {
5363
5372
  var tooltipRef = React.useRef(null);
5364
5373
  var triggerRef = React.useRef(null);
5365
5374
  var timeoutRef = React.useRef();
5375
+ var rafId = React.useRef(null);
5366
5376
  var calculatePosition = function calculatePosition() {
5367
5377
  if (!triggerRef.current || !tooltipRef.current) return;
5368
5378
  var triggerRect = triggerRef.current.getBoundingClientRect();
@@ -5414,15 +5424,21 @@ var SimpleTooltip = function SimpleTooltip(_ref) {
5414
5424
  };
5415
5425
  React.useEffect(function () {
5416
5426
  var handleMouseMove = function handleMouseMove(event) {
5417
- if (visible && tooltipRef.current && triggerRef.current) {
5418
- var tooltipRect = tooltipRef.current.getBoundingClientRect();
5419
- var triggerRect = triggerRef.current.getBoundingClientRect();
5420
- var isOutsideTooltip = event.clientX < tooltipRect.left || event.clientX > tooltipRect.right || event.clientY < tooltipRect.top || event.clientY > tooltipRect.bottom;
5421
- var isOutsideTrigger = event.clientX < triggerRect.left || event.clientX > triggerRect.right || event.clientY < triggerRect.top || event.clientY > triggerRect.bottom;
5422
- if (isOutsideTooltip && isOutsideTrigger) {
5423
- hideTooltip();
5427
+ if (rafId.current !== null) return;
5428
+ var clientX = event.clientX,
5429
+ clientY = event.clientY;
5430
+ rafId.current = requestAnimationFrame(function () {
5431
+ rafId.current = null;
5432
+ if (visible && tooltipRef.current && triggerRef.current) {
5433
+ var tooltipRect = tooltipRef.current.getBoundingClientRect();
5434
+ var triggerRect = triggerRef.current.getBoundingClientRect();
5435
+ var isOutsideTooltip = clientX < tooltipRect.left || clientX > tooltipRect.right || clientY < tooltipRect.top || clientY > tooltipRect.bottom;
5436
+ var isOutsideTrigger = clientX < triggerRect.left || clientX > triggerRect.right || clientY < triggerRect.top || clientY > triggerRect.bottom;
5437
+ if (isOutsideTooltip && isOutsideTrigger) {
5438
+ hideTooltip();
5439
+ }
5424
5440
  }
5425
- }
5441
+ });
5426
5442
  };
5427
5443
  var handleScroll = function handleScroll() {
5428
5444
  if (visible) {
@@ -5441,6 +5457,10 @@ var SimpleTooltip = function SimpleTooltip(_ref) {
5441
5457
  document.removeEventListener('mousemove', handleMouseMove);
5442
5458
  window.removeEventListener('scroll', handleScroll);
5443
5459
  window.removeEventListener('resize', handleResize);
5460
+ if (rafId.current !== null) {
5461
+ cancelAnimationFrame(rafId.current);
5462
+ rafId.current = null;
5463
+ }
5444
5464
  clearTimeout(timeoutRef.current);
5445
5465
  };
5446
5466
  }, [visible]);
@@ -15845,6 +15865,84 @@ var InputRadio = function InputRadio(_ref) {
15845
15865
  }));
15846
15866
  };
15847
15867
 
15868
+ /**
15869
+ * Dark RPG-themed radio-style card.
15870
+ * Matches the aesthetic of MarketplaceSettingsPanel OptionCard.
15871
+ * Uses !important overrides to survive RPGUI global CSS.
15872
+ */
15873
+ var RadioSelectCard = function RadioSelectCard(_ref) {
15874
+ var label = _ref.label,
15875
+ description = _ref.description,
15876
+ badge = _ref.badge,
15877
+ icon = _ref.icon,
15878
+ _ref$active = _ref.active,
15879
+ active = _ref$active === void 0 ? false : _ref$active,
15880
+ onClick = _ref.onClick,
15881
+ testId = _ref['data-testid'];
15882
+ return React__default.createElement(Card, {
15883
+ "$active": active,
15884
+ onClick: onClick,
15885
+ "data-testid": testId,
15886
+ type: "button"
15887
+ }, icon && React__default.createElement(IconWrap, null, icon), React__default.createElement(Body, null, React__default.createElement(Label$7, {
15888
+ "$active": active
15889
+ }, label), description && React__default.createElement(Description$5, null, description)), badge && React__default.createElement(Badge, {
15890
+ "$active": active
15891
+ }, badge));
15892
+ };
15893
+ // ─── Styled Components ────────────────────────────────────────────────────────
15894
+ var Card = /*#__PURE__*/styled__default.button.withConfig({
15895
+ displayName: "RadioSelectCard__Card",
15896
+ componentId: "sc-12jrcz1-0"
15897
+ })(["display:flex !important;flex-direction:row !important;align-items:center !important;gap:0.6rem !important;width:100% !important;padding:0.75rem 0.9rem !important;background:", " !important;border:2px solid ", " !important;border-radius:6px !important;cursor:pointer !important;text-align:left !important;transition:border-color 0.15s ease,background 0.15s ease,box-shadow 0.15s ease !important;font-family:inherit !important;box-sizing:border-box !important;&:hover{border-color:", " !important;background:", " !important;box-shadow:", " !important;}&:active{background:rgba(0,0,0,0.5) !important;}"], function (_ref2) {
15898
+ var $active = _ref2.$active;
15899
+ return $active ? 'rgba(245, 158, 11, 0.12)' : 'rgba(0, 0, 0, 0.25)';
15900
+ }, function (_ref3) {
15901
+ var $active = _ref3.$active;
15902
+ return $active ? '#f59e0b' : 'rgba(255, 255, 255, 0.08)';
15903
+ }, function (_ref4) {
15904
+ var $active = _ref4.$active;
15905
+ return $active ? '#f59e0b' : 'rgba(255, 255, 255, 0.3)';
15906
+ }, function (_ref5) {
15907
+ var $active = _ref5.$active;
15908
+ return $active ? 'rgba(245, 158, 11, 0.18)' : 'rgba(255, 255, 255, 0.04)';
15909
+ }, function (_ref6) {
15910
+ var $active = _ref6.$active;
15911
+ return $active ? '0 0 14px rgba(245, 158, 11, 0.3)' : '0 0 8px rgba(255, 255, 255, 0.05)';
15912
+ });
15913
+ var IconWrap = /*#__PURE__*/styled__default.span.withConfig({
15914
+ displayName: "RadioSelectCard__IconWrap",
15915
+ componentId: "sc-12jrcz1-1"
15916
+ })(["font-size:1.4rem !important;line-height:1 !important;flex-shrink:0 !important;"]);
15917
+ var Body = /*#__PURE__*/styled__default.div.withConfig({
15918
+ displayName: "RadioSelectCard__Body",
15919
+ componentId: "sc-12jrcz1-2"
15920
+ })(["flex:1 !important;min-width:0 !important;display:flex !important;flex-direction:column !important;gap:0.2rem !important;"]);
15921
+ var Label$7 = /*#__PURE__*/styled__default.span.withConfig({
15922
+ displayName: "RadioSelectCard__Label",
15923
+ componentId: "sc-12jrcz1-3"
15924
+ })(["font-size:0.72rem !important;font-weight:bold !important;color:", " !important;text-transform:uppercase !important;letter-spacing:0.8px !important;line-height:1.2 !important;"], function (_ref7) {
15925
+ var $active = _ref7.$active;
15926
+ return $active ? '#f59e0b' : 'rgba(255, 255, 255, 0.9)';
15927
+ });
15928
+ var Description$5 = /*#__PURE__*/styled__default.span.withConfig({
15929
+ displayName: "RadioSelectCard__Description",
15930
+ componentId: "sc-12jrcz1-4"
15931
+ })(["font-size:0.62rem !important;color:rgba(255,255,255,0.45) !important;line-height:1.4 !important;"]);
15932
+ var Badge = /*#__PURE__*/styled__default.span.withConfig({
15933
+ displayName: "RadioSelectCard__Badge",
15934
+ componentId: "sc-12jrcz1-5"
15935
+ })(["flex-shrink:0 !important;padding:0.15rem 0.45rem !important;background:", " !important;border:1px solid ", " !important;border-radius:20px !important;font-size:0.55rem !important;font-weight:bold !important;letter-spacing:0.5px !important;text-transform:uppercase !important;color:", " !important;white-space:nowrap !important;"], function (_ref8) {
15936
+ var $active = _ref8.$active;
15937
+ return $active ? 'rgba(245, 158, 11, 0.2)' : 'rgba(255, 255, 255, 0.06)';
15938
+ }, function (_ref9) {
15939
+ var $active = _ref9.$active;
15940
+ return $active ? 'rgba(245, 158, 11, 0.5)' : 'rgba(255, 255, 255, 0.12)';
15941
+ }, function (_ref10) {
15942
+ var $active = _ref10.$active;
15943
+ return $active ? '#f59e0b' : 'rgba(255, 255, 255, 0.45)';
15944
+ });
15945
+
15848
15946
  /**
15849
15947
  * A selectable row with an amber radio circle indicator.
15850
15948
  * Used for single-select option lists throughout the Marketplace UI.
@@ -16364,7 +16462,7 @@ var SkillInfoModal = function SkillInfoModal(_ref) {
16364
16462
  "$color": info.color
16365
16463
  }, info.name), React__default.createElement(CloseButton$g, {
16366
16464
  onPointerDown: onClose
16367
- }, React__default.createElement(fa.FaTimes, null))), React__default.createElement(Section$4, null, React__default.createElement(Label$7, null, "What it does"), React__default.createElement(Text$1, null, info.description)), React__default.createElement(Section$4, null, React__default.createElement(Label$7, null, "How to train"), React__default.createElement(Text$1, null, info.howToTrain)), info.notes && React__default.createElement(Section$4, null, React__default.createElement(Label$7, null, "Notes"), React__default.createElement(Text$1, null, info.notes)))));
16465
+ }, React__default.createElement(fa.FaTimes, null))), React__default.createElement(Section$4, null, React__default.createElement(Label$8, null, "What it does"), React__default.createElement(Text$1, null, info.description)), React__default.createElement(Section$4, null, React__default.createElement(Label$8, null, "How to train"), React__default.createElement(Text$1, null, info.howToTrain)), info.notes && React__default.createElement(Section$4, null, React__default.createElement(Label$8, null, "Notes"), React__default.createElement(Text$1, null, info.notes)))));
16368
16466
  };
16369
16467
  var Overlay$9 = /*#__PURE__*/styled__default.div.withConfig({
16370
16468
  displayName: "SkillInfoModal__Overlay",
@@ -16397,7 +16495,7 @@ var Section$4 = /*#__PURE__*/styled__default.div.withConfig({
16397
16495
  displayName: "SkillInfoModal__Section",
16398
16496
  componentId: "sc-pqkzdj-6"
16399
16497
  })(["display:flex;flex-direction:column;gap:6px;"]);
16400
- var Label$7 = /*#__PURE__*/styled__default.span.withConfig({
16498
+ var Label$8 = /*#__PURE__*/styled__default.span.withConfig({
16401
16499
  displayName: "SkillInfoModal__Label",
16402
16500
  componentId: "sc-pqkzdj-7"
16403
16501
  })(["font-size:0.5rem;font-weight:bold;text-transform:uppercase;letter-spacing:0.05em;color:rgba(255,255,255,0.45);"]);
@@ -16734,7 +16832,7 @@ var SpellInfo$1 = function SpellInfo(_ref) {
16734
16832
  className: "label"
16735
16833
  }, "Required Item:"), React__default.createElement("div", {
16736
16834
  className: "value"
16737
- }, requiredItem))), React__default.createElement(Description$5, null, description));
16835
+ }, requiredItem))), React__default.createElement(Description$6, null, description));
16738
16836
  };
16739
16837
  var Container$G = /*#__PURE__*/styled__default.div.withConfig({
16740
16838
  displayName: "SpellInfo__Container",
@@ -16748,7 +16846,7 @@ var Type$1 = /*#__PURE__*/styled__default.div.withConfig({
16748
16846
  displayName: "SpellInfo__Type",
16749
16847
  componentId: "sc-4hbw3q-2"
16750
16848
  })(["font-size:", ";margin-top:0.2rem;color:", ";"], uiFonts.size.small, uiColors.lightGray);
16751
- var Description$5 = /*#__PURE__*/styled__default.div.withConfig({
16849
+ var Description$6 = /*#__PURE__*/styled__default.div.withConfig({
16752
16850
  displayName: "SpellInfo__Description",
16753
16851
  componentId: "sc-4hbw3q-3"
16754
16852
  })(["margin-top:1.5rem;font-size:", ";color:", ";font-style:italic;"], uiFonts.size.small, uiColors.lightGray);
@@ -16981,7 +17079,7 @@ var Spell = function Spell(_ref) {
16981
17079
  centered: true
16982
17080
  })), React__default.createElement(Info, null, React__default.createElement(Title$k, null, React__default.createElement("span", null, name), React__default.createElement("span", {
16983
17081
  className: "spell"
16984
- }, "(", magicWords, ")")), React__default.createElement(Description$6, null, description)), React__default.createElement(Divider$2, null), React__default.createElement(Cost, null, React__default.createElement("span", null, "Mana cost:"), React__default.createElement("span", {
17082
+ }, "(", magicWords, ")")), React__default.createElement(Description$7, null, description)), React__default.createElement(Divider$2, null), React__default.createElement(Cost, null, React__default.createElement("span", null, "Mana cost:"), React__default.createElement("span", {
16985
17083
  className: "mana"
16986
17084
  }, manaCost))));
16987
17085
  };
@@ -17004,7 +17102,7 @@ var Title$k = /*#__PURE__*/styled__default.p.withConfig({
17004
17102
  displayName: "Spell__Title",
17005
17103
  componentId: "sc-j96fa2-3"
17006
17104
  })(["display:flex;flex-wrap:wrap;align-items:center;margin-bottom:5px;margin:0;span{font-size:", " !important;font-weight:bold !important;color:", " !important;margin-right:0.5rem;}.spell{font-size:", " !important;font-weight:normal !important;color:", " !important;}"], uiFonts.size.medium, uiColors.yellow, uiFonts.size.small, uiColors.lightGray);
17007
- var Description$6 = /*#__PURE__*/styled__default.div.withConfig({
17105
+ var Description$7 = /*#__PURE__*/styled__default.div.withConfig({
17008
17106
  displayName: "Spell__Description",
17009
17107
  componentId: "sc-j96fa2-4"
17010
17108
  })(["font-size:", " !important;line-height:1.1 !important;"], uiFonts.size.small);
@@ -39792,7 +39890,7 @@ var StoreRedeemSection = function StoreRedeemSection(_ref) {
39792
39890
  onClick: handleReset
39793
39891
  }))));
39794
39892
  }
39795
- return React__default.createElement(Container$O, null, React__default.createElement(Title$p, null, "Redeem a Voucher Code"), React__default.createElement(Description$7, null, "Enter your voucher code below to receive Definya Coins."), React__default.createElement(InputRow, null, React__default.createElement(CodeInput, {
39893
+ return React__default.createElement(Container$O, null, React__default.createElement(Title$p, null, "Redeem a Voucher Code"), React__default.createElement(Description$8, null, "Enter your voucher code below to receive Definya Coins."), React__default.createElement(InputRow, null, React__default.createElement(CodeInput, {
39796
39894
  type: "text",
39797
39895
  value: code,
39798
39896
  onChange: function onChange(e) {
@@ -39823,7 +39921,7 @@ var Title$p = /*#__PURE__*/styled__default.h3.withConfig({
39823
39921
  displayName: "StoreRedeemSection__Title",
39824
39922
  componentId: "sc-1pzosml-1"
39825
39923
  })(["font-family:'Press Start 2P',cursive;font-size:0.85rem;color:", ";margin:0;text-align:center;"], uiColors.white);
39826
- var Description$7 = /*#__PURE__*/styled__default.p.withConfig({
39924
+ var Description$8 = /*#__PURE__*/styled__default.p.withConfig({
39827
39925
  displayName: "StoreRedeemSection__Description",
39828
39926
  componentId: "sc-1pzosml-2"
39829
39927
  })(["font-family:'Press Start 2P',cursive;font-size:0.55rem;color:", ";margin:0;text-align:center;line-height:1.6;"], uiColors.lightGray);
@@ -39889,7 +39987,7 @@ var StoreItemDetails = function StoreItemDetails(_ref) {
39889
39987
  alt: item.name
39890
39988
  })), React__default.createElement(ItemInfo$3, null, React__default.createElement(ItemName$9, null, item.name), React__default.createElement(ItemPrice$2, null, currencySymbol, 'priceUSD' in item ? item.priceUSD : (_item$regionalPrice = item.regionalPrice) != null ? _item$regionalPrice : item.price, item.dcPrice ? React__default.createElement(React__default.Fragment, null, ' ', "\xB7 ", React__default.createElement(MMORPGNumber, {
39891
39989
  value: item.dcPrice
39892
- }), " DC") : ''), React__default.createElement(Description$8, null, item.description))), React__default.createElement(Actions$1, null, React__default.createElement(CTAButton, {
39990
+ }), " DC") : ''), React__default.createElement(Description$9, null, item.description))), React__default.createElement(Actions$1, null, React__default.createElement(CTAButton, {
39893
39991
  icon: React__default.createElement(ShoppingCart.ShoppingCart, null),
39894
39992
  label: "Add to Cart",
39895
39993
  onClick: function onClick() {
@@ -39934,7 +40032,7 @@ var ItemPrice$2 = /*#__PURE__*/styled__default.div.withConfig({
39934
40032
  displayName: "StoreItemDetails__ItemPrice",
39935
40033
  componentId: "sc-k3ho5z-8"
39936
40034
  })(["font-family:'Press Start 2P',cursive;font-size:1rem;color:#fef08a;"]);
39937
- var Description$8 = /*#__PURE__*/styled__default.p.withConfig({
40035
+ var Description$9 = /*#__PURE__*/styled__default.p.withConfig({
39938
40036
  displayName: "StoreItemDetails__Description",
39939
40037
  componentId: "sc-k3ho5z-9"
39940
40038
  })(["margin:0;font-family:'Press Start 2P',cursive;font-size:0.875rem;line-height:1.6;color:#ffffff;"]);
@@ -40944,6 +41042,7 @@ exports.RadioCircle = RadioCircle$2;
40944
41042
  exports.RadioOption = RadioOption$1;
40945
41043
  exports.RadioOptionLabel = RadioOptionLabel;
40946
41044
  exports.RadioOptionSub = RadioOptionSub;
41045
+ exports.RadioSelectCard = RadioSelectCard;
40947
41046
  exports.RangeSlider = RangeSlider;
40948
41047
  exports.SelectArrow = SelectArrow;
40949
41048
  exports.Shortcuts = Shortcuts;