@luxfi/ui 7.4.12 → 7.4.13

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.js CHANGED
@@ -1636,7 +1636,6 @@ var Avatar = React32.forwardRef(
1636
1636
  Avatar$1,
1637
1637
  {
1638
1638
  ref,
1639
- unstyled: true,
1640
1639
  position: "relative",
1641
1640
  display: "inline-flex",
1642
1641
  flexShrink: 0,
@@ -3743,22 +3742,30 @@ var InputGroup = React32.forwardRef(
3743
3742
  const { className: startClassName, ...startRest } = startElementProps ?? {};
3744
3743
  const { className: endClassName, ...endRest } = endElementProps ?? {};
3745
3744
  return /* @__PURE__ */ jsxs(
3746
- "div",
3745
+ XStack,
3747
3746
  {
3748
3747
  ref: combinedRef,
3749
- className: cn("relative flex w-full items-center", className),
3748
+ position: "relative",
3749
+ width: "100%",
3750
+ alignItems: "center",
3751
+ className,
3750
3752
  ...rest,
3751
3753
  children: [
3752
3754
  startElement && /* @__PURE__ */ jsx(
3753
- "div",
3755
+ XStack,
3754
3756
  {
3755
3757
  ref: startElementRef,
3756
- className: cn(
3757
- "pointer-events-none absolute inset-y-0 left-0 z-[1] flex items-center text-[var(--chakra-colors-input-element)]",
3758
- startClassName
3759
- ),
3758
+ position: "absolute",
3759
+ top: 0,
3760
+ bottom: 0,
3761
+ left: 0,
3762
+ zIndex: 1,
3763
+ alignItems: "center",
3764
+ pointerEvents: "none",
3765
+ style: { color: "var(--color-icon-secondary)" },
3766
+ className: startClassName,
3760
3767
  ...startRest,
3761
- children: startElement
3768
+ children: ink(startElement)
3762
3769
  }
3763
3770
  ),
3764
3771
  React32.Children.map(children, (child) => {
@@ -3777,15 +3784,20 @@ var InputGroup = React32.forwardRef(
3777
3784
  });
3778
3785
  }),
3779
3786
  endElement && /* @__PURE__ */ jsx(
3780
- "div",
3787
+ XStack,
3781
3788
  {
3782
3789
  ref: endElementRef,
3783
- className: cn(
3784
- "pointer-events-none absolute inset-y-0 right-0 z-[1] flex items-center text-[var(--chakra-colors-input-element)]",
3785
- endClassName
3786
- ),
3790
+ position: "absolute",
3791
+ top: 0,
3792
+ bottom: 0,
3793
+ right: 0,
3794
+ zIndex: 1,
3795
+ alignItems: "center",
3796
+ pointerEvents: "none",
3797
+ style: { color: "var(--color-icon-secondary)" },
3798
+ className: endClassName,
3787
3799
  ...endRest,
3788
- children: endElement
3800
+ children: ink(endElement)
3789
3801
  }
3790
3802
  )
3791
3803
  ]
@@ -3794,20 +3806,26 @@ var InputGroup = React32.forwardRef(
3794
3806
  }
3795
3807
  );
3796
3808
  InputGroup.displayName = "InputGroup";
3797
- var INPUT_BASE = [
3798
- "w-10 h-10",
3799
- "text-center text-sm font-medium",
3800
- "border-2 rounded-md",
3801
- "outline-none appearance-none",
3802
- "bg-[var(--color-input-bg)] text-[var(--color-input-fg)]",
3803
- "border-[var(--color-input-border)]",
3804
- "placeholder:text-[var(--color-input-placeholder)]",
3805
- "hover:border-[var(--color-input-border-hover)]",
3806
- "focus:border-[var(--color-input-border-focus)] focus:shadow-md",
3807
- "disabled:opacity-40"
3808
- ].join(" ");
3809
- var INPUT_FILLED = "border-[var(--color-input-border)]";
3810
- var INPUT_INVALID = "border-[var(--color-border-error)] hover:border-[var(--color-border-error)]";
3809
+ var BOX = {
3810
+ width: 40,
3811
+ height: 40,
3812
+ textAlign: "center",
3813
+ fontSize: 14,
3814
+ fontWeight: 500,
3815
+ borderRadius: 6,
3816
+ borderWidth: 2,
3817
+ borderStyle: "solid",
3818
+ outlineWidth: 0,
3819
+ backgroundColor: "var(--color-input-bg)",
3820
+ color: "var(--color-input-fg)",
3821
+ borderColor: "var(--color-input-border)",
3822
+ hoverStyle: { borderColor: "var(--color-input-border-hover)" },
3823
+ focusStyle: {
3824
+ borderColor: "var(--color-input-border-focus)",
3825
+ boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"
3826
+ },
3827
+ disabledStyle: { opacity: 0.4 }
3828
+ };
3811
3829
  var PinInput = React32.forwardRef(
3812
3830
  function PinInput2(props, ref) {
3813
3831
  const {
@@ -3899,8 +3917,8 @@ var PinInput = React32.forwardRef(
3899
3917
  const onKeyDownAtIndex = React32.useCallback((index) => (e) => {
3900
3918
  handleKeyDown(index, e);
3901
3919
  }, [handleKeyDown]);
3902
- const bgStyle = bgColor ? { backgroundColor: `var(--color-${bgColor.replace(/\./g, "-")})` } : void 0;
3903
- return /* @__PURE__ */ jsxs("div", { ref: rootRef, className: cn("inline-flex items-center", attached ? "gap-0" : "gap-2", className), children: [
3920
+ const boxBackground = bgColor ? `var(--color-${bgColor.replace(/\./g, "-")})` : BOX.backgroundColor;
3921
+ return /* @__PURE__ */ jsxs(XStack, { ref: rootRef, alignItems: "center", gap: attached ? 0 : 8, className, children: [
3904
3922
  /* @__PURE__ */ jsx(
3905
3923
  "input",
3906
3924
  {
@@ -3912,9 +3930,10 @@ var PinInput = React32.forwardRef(
3912
3930
  }
3913
3931
  ),
3914
3932
  Array.from({ length: count }).map((_, index) => /* @__PURE__ */ jsx(
3915
- "input",
3933
+ Input$1,
3916
3934
  {
3917
3935
  ref: setInputRef(index),
3936
+ unstyled: true,
3918
3937
  type: "text",
3919
3938
  inputMode: "numeric",
3920
3939
  autoComplete: otp ? "one-time-code" : "off",
@@ -3923,14 +3942,12 @@ var PinInput = React32.forwardRef(
3923
3942
  placeholder,
3924
3943
  disabled,
3925
3944
  "aria-invalid": invalid || void 0,
3945
+ "data-invalid": invalid || void 0,
3926
3946
  value: values[index] || "",
3927
- className: cn(
3928
- INPUT_BASE,
3929
- values[index] && INPUT_FILLED,
3930
- invalid && INPUT_INVALID,
3931
- attached && index > 0 && "-ml-0.5"
3932
- ),
3933
- style: bgStyle,
3947
+ className: "lux-control",
3948
+ ...BOX,
3949
+ backgroundColor: boxBackground,
3950
+ marginLeft: attached && index > 0 ? -2 : void 0,
3934
3951
  onInput: onInputAtIndex(index),
3935
3952
  onKeyDown: onKeyDownAtIndex(index),
3936
3953
  onPaste: handlePaste,
@@ -4258,11 +4275,11 @@ var Progress = React32.forwardRef(
4258
4275
  }
4259
4276
  );
4260
4277
  var SIZE_MAP = {
4261
- xs: { size: 24, thickness: 4, textClass: "text-[10px]" },
4262
- sm: { size: 32, thickness: 5, textClass: "text-[10px]" },
4263
- md: { size: 40, thickness: 6, textClass: "text-xs" },
4264
- lg: { size: 48, thickness: 7, textClass: "text-sm" },
4265
- xl: { size: 64, thickness: 8, textClass: "text-sm" }
4278
+ xs: { size: 24, thickness: 4, fontSize: 10 },
4279
+ sm: { size: 32, thickness: 5, fontSize: 10 },
4280
+ md: { size: 40, thickness: 6, fontSize: 12 },
4281
+ lg: { size: 48, thickness: 7, fontSize: 14 },
4282
+ xl: { size: 64, thickness: 8, fontSize: 14 }
4266
4283
  };
4267
4284
  var Ctx = React32.createContext({
4268
4285
  value: 0,
@@ -4283,16 +4300,18 @@ var ProgressCircleRoot = React32.forwardRef(function ProgressCircleRoot2(props,
4283
4300
  [value, size, colorPalette]
4284
4301
  );
4285
4302
  return /* @__PURE__ */ jsx(Ctx.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
4286
- "div",
4303
+ View,
4287
4304
  {
4288
4305
  ref,
4289
4306
  role: "progressbar",
4290
4307
  "aria-valuenow": value ?? void 0,
4291
4308
  "aria-valuemin": 0,
4292
4309
  "aria-valuemax": 100,
4293
- className: cn("relative inline-flex text-sm", className),
4310
+ position: "relative",
4311
+ style: { display: "inline-flex", fontSize: 14 },
4312
+ className,
4294
4313
  ...rest,
4295
- children
4314
+ children: ink(children)
4296
4315
  }
4297
4316
  ) });
4298
4317
  });
@@ -4311,10 +4330,7 @@ var ProgressCircleRing = React32.forwardRef(function ProgressCircleRing2(props,
4311
4330
  width: size,
4312
4331
  height: size,
4313
4332
  viewBox: `0 0 ${size} ${size}`,
4314
- className: cn(
4315
- value === null && "animate-spin",
4316
- className
4317
- ),
4333
+ className: value === null ? cn("lux-spin", className) : className,
4318
4334
  ...rest,
4319
4335
  children: [
4320
4336
  /* @__PURE__ */ jsx(
@@ -4326,7 +4342,7 @@ var ProgressCircleRing = React32.forwardRef(function ProgressCircleRing2(props,
4326
4342
  fill: "transparent",
4327
4343
  strokeWidth: thickness,
4328
4344
  stroke: trackColor ?? "currentColor",
4329
- className: !trackColor ? "opacity-20" : void 0
4345
+ opacity: !trackColor ? 0.2 : void 0
4330
4346
  }
4331
4347
  ),
4332
4348
  /* @__PURE__ */ jsx(
@@ -4356,20 +4372,30 @@ var ProgressCircleRing = React32.forwardRef(function ProgressCircleRing2(props,
4356
4372
  var ProgressCircleValueText = React32.forwardRef(function ProgressCircleValueText2(props, ref) {
4357
4373
  const { className, children, ...rest } = props;
4358
4374
  const { value, size: sizeKey } = React32.useContext(Ctx);
4359
- const { textClass } = SIZE_MAP[sizeKey];
4375
+ const { fontSize } = SIZE_MAP[sizeKey];
4360
4376
  return /* @__PURE__ */ jsx(
4361
- "div",
4377
+ View,
4362
4378
  {
4363
4379
  ref,
4364
4380
  "aria-live": "polite",
4365
- className: cn(
4366
- "absolute inset-0 flex items-center justify-center",
4367
- "font-medium tracking-tight tabular-nums leading-none",
4368
- textClass,
4369
- className
4370
- ),
4381
+ position: "absolute",
4382
+ top: 0,
4383
+ left: 0,
4384
+ right: 0,
4385
+ bottom: 0,
4386
+ display: "flex",
4387
+ alignItems: "center",
4388
+ justifyContent: "center",
4389
+ style: {
4390
+ fontWeight: 500,
4391
+ fontSize,
4392
+ lineHeight: `${fontSize}px`,
4393
+ letterSpacing: fontSize * -0.025,
4394
+ fontVariantNumeric: "tabular-nums"
4395
+ },
4396
+ className,
4371
4397
  ...rest,
4372
- children: children ?? `${Math.round(value ?? 0)}%`
4398
+ children: ink(children ?? `${Math.round(value ?? 0)}%`)
4373
4399
  }
4374
4400
  );
4375
4401
  });
@@ -4411,7 +4437,6 @@ var RadioGroupBase = React32.forwardRef(
4411
4437
  RadioGroup,
4412
4438
  {
4413
4439
  ref,
4414
- unstyled: true,
4415
4440
  name,
4416
4441
  required,
4417
4442
  disabled: disabled || readOnly,
@@ -4489,8 +4514,8 @@ var RadioBase = React32.forwardRef(
4489
4514
  }
4490
4515
  );
4491
4516
  var Radio2 = RadioBase;
4492
- var StarFilledIcon = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) });
4493
- var StarOutlineIcon = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z", strokeWidth: "1.5" }) });
4517
+ var StarFilledIcon = () => /* @__PURE__ */ jsx("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) });
4518
+ var StarOutlineIcon = () => /* @__PURE__ */ jsx("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z", strokeWidth: "1.5" }) });
4494
4519
  var Rating = React32.forwardRef(
4495
4520
  function Rating2(props, ref) {
4496
4521
  const { count = 5, label: labelProp, defaultValue = 0, onValueChange, readOnly, className, ...rest } = props;
@@ -4510,28 +4535,30 @@ var Rating = React32.forwardRef(
4510
4535
  const handleMouseLeave = React32.useCallback(() => {
4511
4536
  setHoveredIndex(-1);
4512
4537
  }, []);
4513
- return /* @__PURE__ */ jsxs("div", { ref, className: cn("inline-flex items-center gap-1", className), ...rest, children: [
4514
- /* @__PURE__ */ jsx("div", { className: "inline-flex items-center", onMouseLeave: handleMouseLeave, children: Array.from({ length: count }).map((_, index) => {
4538
+ return /* @__PURE__ */ jsxs(XStack, { ref, display: "inline-flex", alignItems: "center", gap: 4, className, ...rest, children: [
4539
+ /* @__PURE__ */ jsx(XStack, { display: "inline-flex", alignItems: "center", onMouseLeave: handleMouseLeave, children: Array.from({ length: count }).map((_, index) => {
4515
4540
  const filled = index < highlightedIndex;
4516
4541
  const starIndex = index + 1;
4517
4542
  return /* @__PURE__ */ jsx(
4518
- "button",
4543
+ View,
4519
4544
  {
4520
- type: "button",
4545
+ render: /* @__PURE__ */ jsx("button", { type: "button" }),
4521
4546
  tabIndex: readOnly ? -1 : 0,
4522
4547
  "aria-label": `Rate ${starIndex} of ${count}`,
4523
- className: cn(
4524
- "inline-flex items-center justify-center w-5 h-5 text-current",
4525
- readOnly ? "cursor-default" : "cursor-pointer"
4526
- ),
4548
+ display: "inline-flex",
4549
+ alignItems: "center",
4550
+ justifyContent: "center",
4551
+ width: 20,
4552
+ height: 20,
4553
+ cursor: readOnly ? "default" : "pointer",
4527
4554
  onClick: handleClick(starIndex),
4528
4555
  onMouseEnter: handleMouseEnter(index),
4529
- children: filled ? /* @__PURE__ */ jsx(StarFilledIcon, { className: "w-5 h-5" }) : /* @__PURE__ */ jsx(StarOutlineIcon, { className: "w-5 h-5" })
4556
+ children: filled ? /* @__PURE__ */ jsx(StarFilledIcon, {}) : /* @__PURE__ */ jsx(StarOutlineIcon, {})
4530
4557
  },
4531
4558
  index
4532
4559
  );
4533
4560
  }) }),
4534
- label && /* @__PURE__ */ jsx("span", { className: "text-sm", children: label })
4561
+ label && /* @__PURE__ */ jsx(Text, { fontSize: 14, children: label })
4535
4562
  ] });
4536
4563
  }
4537
4564
  );
@@ -5014,7 +5041,6 @@ var Slider = React32.forwardRef(
5014
5041
  Slider$1,
5015
5042
  {
5016
5043
  ref,
5017
- unstyled: true,
5018
5044
  position: "relative",
5019
5045
  flexDirection: "row",
5020
5046
  width: "100%",
@@ -5764,21 +5790,24 @@ var Tag = React32.forwardRef(
5764
5790
  ":",
5765
5791
  nbsp
5766
5792
  ] }) : null;
5767
- const labelSpan = /* @__PURE__ */ jsxs(
5768
- Text,
5769
- {
5770
- overflow: "hidden",
5771
- textOverflow: "ellipsis",
5772
- whiteSpace: "nowrap",
5773
- fontWeight: "500",
5774
- fontSize: TAG_SIZE_FONT[resolvedSize],
5775
- color,
5776
- hoverStyle: textHoverColor ? { color: textHoverColor } : void 0,
5777
- children: [
5778
- labelElement,
5779
- children
5780
- ]
5781
- }
5793
+ const labelSpan = (
5794
+ // `ellipsis` is Text's own built-in single-line-truncation variant —
5795
+ // the same rule Tailwind's `line-clamp-1`/`text-ellipsis` drew, through
5796
+ // the component's variants rather than three separate style props.
5797
+ /* @__PURE__ */ jsxs(
5798
+ Text,
5799
+ {
5800
+ ellipsis: true,
5801
+ fontWeight: "500",
5802
+ fontSize: TAG_SIZE_FONT[resolvedSize],
5803
+ color,
5804
+ hoverStyle: textHoverColor ? { color: textHoverColor } : void 0,
5805
+ children: [
5806
+ labelElement,
5807
+ children
5808
+ ]
5809
+ }
5810
+ )
5782
5811
  );
5783
5812
  const contentElement = truncated ? /* @__PURE__ */ jsx(TruncatedTextTooltip2, { label: children, children: labelSpan }) : labelSpan;
5784
5813
  return /* @__PURE__ */ jsx(Skeleton, { loading, asChild: true, children: /* @__PURE__ */ jsxs(
@@ -6364,84 +6393,145 @@ var STRATEGY_PRESETS = [
6364
6393
  ]
6365
6394
  }
6366
6395
  ];
6396
+ var MONO = "monospace";
6397
+ var CONTROL_BOX = {
6398
+ backgroundColor: "var(--color-input-bg)",
6399
+ borderWidth: 1,
6400
+ borderColor: "var(--color-input-border)",
6401
+ outlineWidth: 0,
6402
+ focusStyle: { borderColor: "var(--color-input-border-focus)" }
6403
+ };
6404
+ var CONTROL_INK = { color: "var(--color-input-fg)" };
6367
6405
  function LegRow({ leg, index, strikes, expirations, removable, onChange, onRemove }) {
6368
6406
  const update2 = (patch) => {
6369
6407
  onChange(index, { ...leg, ...patch });
6370
6408
  };
6371
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 rounded-md bg-zinc-800/50 px-2 py-1.5", children: [
6372
- /* @__PURE__ */ jsx("span", { className: "text-[10px] font-mono text-zinc-500 w-4 shrink-0", children: index + 1 }),
6373
- /* @__PURE__ */ jsx(
6374
- "button",
6375
- {
6376
- type: "button",
6377
- className: cn(
6378
- "px-2 py-0.5 rounded text-xs font-semibold transition-colors",
6379
- leg.action === "buy" ? "bg-emerald-900/60 text-emerald-400" : "bg-red-900/60 text-red-400"
6409
+ return /* @__PURE__ */ jsxs(
6410
+ XStack,
6411
+ {
6412
+ alignItems: "center",
6413
+ gap: 8,
6414
+ borderRadius: 6,
6415
+ backgroundColor: "var(--color-tag-subtle-bg)",
6416
+ paddingHorizontal: 8,
6417
+ paddingVertical: 6,
6418
+ children: [
6419
+ /* @__PURE__ */ jsx(Text, { fontSize: 10, style: { fontFamily: MONO }, flexShrink: 0, width: 16, color: "var(--color-text-secondary)", children: index + 1 }),
6420
+ /* @__PURE__ */ jsx(
6421
+ XStack,
6422
+ {
6423
+ unstyled: true,
6424
+ render: /* @__PURE__ */ jsx("button", { type: "button" }),
6425
+ onClick: () => update2({ action: leg.action === "buy" ? "sell" : "buy" }),
6426
+ paddingHorizontal: 8,
6427
+ paddingVertical: 2,
6428
+ borderRadius: 4,
6429
+ borderWidth: 0,
6430
+ cursor: "pointer",
6431
+ transition: "quick",
6432
+ backgroundColor: leg.action === "buy" ? "color-mix(in srgb, var(--color-status-good) 20%, transparent)" : "color-mix(in srgb, var(--color-status-bad) 20%, transparent)",
6433
+ children: /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", color: leg.action === "buy" ? "var(--color-status-good)" : "var(--color-status-bad)", children: leg.action === "buy" ? "BUY" : "SELL" })
6434
+ }
6380
6435
  ),
6381
- onClick: () => update2({ action: leg.action === "buy" ? "sell" : "buy" }),
6382
- children: leg.action === "buy" ? "BUY" : "SELL"
6383
- }
6384
- ),
6385
- /* @__PURE__ */ jsx(
6386
- "button",
6387
- {
6388
- type: "button",
6389
- className: cn(
6390
- "px-2 py-0.5 rounded text-xs font-medium transition-colors",
6391
- // Call vs put is a rank difference, not a hue difference.
6392
- leg.type === "call" ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
6436
+ /* @__PURE__ */ jsx(
6437
+ XStack,
6438
+ {
6439
+ unstyled: true,
6440
+ render: /* @__PURE__ */ jsx("button", { type: "button" }),
6441
+ onClick: () => update2({ type: leg.type === "call" ? "put" : "call" }),
6442
+ paddingHorizontal: 8,
6443
+ paddingVertical: 2,
6444
+ borderRadius: 4,
6445
+ borderWidth: 0,
6446
+ cursor: "pointer",
6447
+ transition: "quick",
6448
+ backgroundColor: leg.type === "call" ? "var(--secondary)" : "var(--muted)",
6449
+ children: /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "500", color: leg.type === "call" ? "var(--foreground)" : "var(--muted-foreground)", children: leg.type === "call" ? "CALL" : "PUT" })
6450
+ }
6393
6451
  ),
6394
- onClick: () => update2({ type: leg.type === "call" ? "put" : "call" }),
6395
- children: leg.type === "call" ? "CALL" : "PUT"
6396
- }
6397
- ),
6398
- /* @__PURE__ */ jsx(
6399
- "select",
6400
- {
6401
- value: leg.strike,
6402
- onChange: (e) => update2({ strike: Number(e.target.value) }),
6403
- className: "bg-zinc-900 border border-zinc-700 rounded px-1.5 py-0.5 text-xs font-mono text-zinc-200 outline-none focus:border-zinc-500 min-w-[72px]",
6404
- children: strikes.map((s) => /* @__PURE__ */ jsx("option", { value: s, children: s.toFixed(2) }, s))
6405
- }
6406
- ),
6407
- /* @__PURE__ */ jsx(
6408
- "select",
6409
- {
6410
- value: leg.expiration,
6411
- onChange: (e) => update2({ expiration: e.target.value }),
6412
- className: "bg-zinc-900 border border-zinc-700 rounded px-1.5 py-0.5 text-xs text-zinc-200 outline-none focus:border-zinc-500 min-w-[80px]",
6413
- children: expirations.map((exp) => /* @__PURE__ */ jsx("option", { value: exp, children: exp }, exp))
6414
- }
6415
- ),
6416
- /* @__PURE__ */ jsx(
6417
- "input",
6418
- {
6419
- type: "number",
6420
- min: 1,
6421
- max: 999,
6422
- value: leg.quantity,
6423
- onChange: (e) => update2({ quantity: Math.max(1, parseInt(e.target.value, 10) || 1) }),
6424
- className: "bg-zinc-900 border border-zinc-700 rounded px-1.5 py-0.5 text-xs font-mono text-zinc-200 outline-none focus:border-zinc-500 w-[48px] text-center"
6425
- }
6426
- ),
6427
- leg.premium !== void 0 && /* @__PURE__ */ jsxs("span", { className: cn(
6428
- "font-mono tabular-nums text-xs ml-auto",
6429
- leg.premium >= 0 ? "text-emerald-400" : "text-red-400"
6430
- ), children: [
6431
- leg.premium >= 0 ? "+" : "",
6432
- leg.premium.toFixed(2)
6433
- ] }),
6434
- removable && /* @__PURE__ */ jsx(
6435
- "button",
6436
- {
6437
- type: "button",
6438
- onClick: () => onRemove(index),
6439
- className: "ml-auto p-0.5 text-zinc-500 hover:text-red-400 transition-colors",
6440
- "aria-label": "Remove leg",
6441
- children: /* @__PURE__ */ jsx("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M18 6L6 18M6 6l12 12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
6442
- }
6443
- )
6444
- ] });
6452
+ /* @__PURE__ */ jsx(
6453
+ View,
6454
+ {
6455
+ unstyled: true,
6456
+ render: /* @__PURE__ */ jsx("select", { value: leg.strike, onChange: (e) => update2({ strike: Number(e.target.value) }) }),
6457
+ ...CONTROL_BOX,
6458
+ borderRadius: 4,
6459
+ paddingHorizontal: 6,
6460
+ paddingVertical: 2,
6461
+ minWidth: 72,
6462
+ style: { ...CONTROL_INK, fontFamily: MONO, fontSize: 12 },
6463
+ children: strikes.map((s) => /* @__PURE__ */ jsx("option", { value: s, children: s.toFixed(2) }, s))
6464
+ }
6465
+ ),
6466
+ /* @__PURE__ */ jsx(
6467
+ View,
6468
+ {
6469
+ unstyled: true,
6470
+ render: /* @__PURE__ */ jsx("select", { value: leg.expiration, onChange: (e) => update2({ expiration: e.target.value }) }),
6471
+ ...CONTROL_BOX,
6472
+ borderRadius: 4,
6473
+ paddingHorizontal: 6,
6474
+ paddingVertical: 2,
6475
+ minWidth: 80,
6476
+ style: { ...CONTROL_INK, fontSize: 12 },
6477
+ children: expirations.map((exp) => /* @__PURE__ */ jsx("option", { value: exp, children: exp }, exp))
6478
+ }
6479
+ ),
6480
+ /* @__PURE__ */ jsx(
6481
+ View,
6482
+ {
6483
+ unstyled: true,
6484
+ render: /* @__PURE__ */ jsx(
6485
+ "input",
6486
+ {
6487
+ type: "number",
6488
+ min: 1,
6489
+ max: 999,
6490
+ value: leg.quantity,
6491
+ onChange: (e) => update2({ quantity: Math.max(1, parseInt(e.target.value, 10) || 1) })
6492
+ }
6493
+ ),
6494
+ ...CONTROL_BOX,
6495
+ borderRadius: 4,
6496
+ paddingHorizontal: 6,
6497
+ paddingVertical: 2,
6498
+ width: 48,
6499
+ style: { ...CONTROL_INK, fontFamily: MONO, fontSize: 12, textAlign: "center" }
6500
+ }
6501
+ ),
6502
+ leg.premium !== void 0 && /* @__PURE__ */ jsxs(
6503
+ Text,
6504
+ {
6505
+ fontSize: 12,
6506
+ style: { fontFamily: MONO },
6507
+ fontVariant: ["tabular-nums"],
6508
+ marginLeft: "auto",
6509
+ color: leg.premium >= 0 ? "var(--color-status-good)" : "var(--color-status-bad)",
6510
+ children: [
6511
+ leg.premium >= 0 ? "+" : "",
6512
+ leg.premium.toFixed(2)
6513
+ ]
6514
+ }
6515
+ ),
6516
+ removable && /* @__PURE__ */ jsx(
6517
+ XStack,
6518
+ {
6519
+ unstyled: true,
6520
+ render: /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Remove leg" }),
6521
+ onClick: () => onRemove(index),
6522
+ marginLeft: "auto",
6523
+ padding: 2,
6524
+ borderWidth: 0,
6525
+ cursor: "pointer",
6526
+ transition: "quick",
6527
+ style: { color: "var(--color-text-secondary)" },
6528
+ hoverStyle: { opacity: 0.7 },
6529
+ children: /* @__PURE__ */ jsx("svg", { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M18 6L6 18M6 6l12 12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
6530
+ }
6531
+ )
6532
+ ]
6533
+ }
6534
+ );
6445
6535
  }
6446
6536
  var StrategyBuilder = React32.forwardRef(
6447
6537
  function StrategyBuilder2(props, ref) {
@@ -6511,37 +6601,46 @@ var StrategyBuilder = React32.forwardRef(
6511
6601
  });
6512
6602
  }, [onSubmit, strategyType, legs, netPremium]);
6513
6603
  const currentPreset = STRATEGY_PRESETS.find((p) => p.value === strategyType);
6604
+ const netColor = netPremium > 0 ? "var(--color-status-good)" : netPremium < 0 ? "var(--color-status-bad)" : "var(--color-text-secondary)";
6514
6605
  return /* @__PURE__ */ jsxs(
6515
- "div",
6606
+ YStack,
6516
6607
  {
6517
6608
  ref,
6518
- className: cn(
6519
- "flex flex-col gap-3 rounded-lg border border-zinc-800 bg-zinc-900/50 p-3",
6520
- className
6521
- ),
6609
+ gap: 12,
6610
+ borderRadius: 8,
6611
+ borderWidth: 1,
6612
+ borderColor: "var(--color-border-divider)",
6613
+ backgroundColor: "var(--card)",
6614
+ padding: 12,
6615
+ className,
6522
6616
  ...rest,
6523
6617
  children: [
6524
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
6525
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
6526
- /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold uppercase tracking-wider text-zinc-500", children: "Strategy" }),
6527
- /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-zinc-200", children: underlying })
6618
+ /* @__PURE__ */ jsxs(XStack, { alignItems: "center", justifyContent: "space-between", gap: 12, children: [
6619
+ /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 8, children: [
6620
+ /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", textTransform: "uppercase", letterSpacing: 0.6, color: "var(--color-text-secondary)", children: "Strategy" }),
6621
+ /* @__PURE__ */ jsx(Text, { fontSize: 14, fontWeight: "500", color: "var(--color-text-primary)", children: underlying })
6528
6622
  ] }),
6529
- /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-zinc-500", children: [
6623
+ /* @__PURE__ */ jsxs(Text, { fontSize: 10, color: "var(--color-text-secondary)", children: [
6530
6624
  "Spot: ",
6531
- /* @__PURE__ */ jsx("span", { className: "font-mono tabular-nums text-zinc-300", children: spotPrice.toFixed(2) })
6625
+ /* @__PURE__ */ jsx(Text, { style: { fontFamily: MONO }, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: spotPrice.toFixed(2) })
6532
6626
  ] })
6533
6627
  ] }),
6534
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(
6535
- "select",
6628
+ /* @__PURE__ */ jsx(XStack, { alignItems: "center", gap: 8, children: /* @__PURE__ */ jsx(
6629
+ View,
6536
6630
  {
6537
- value: strategyType,
6538
- onChange: handleStrategyChange,
6539
- className: "flex-1 bg-zinc-900 border border-zinc-700 rounded-md px-2.5 py-1.5 text-sm text-zinc-200 outline-none focus:border-zinc-500",
6631
+ unstyled: true,
6632
+ render: /* @__PURE__ */ jsx("select", { value: strategyType, onChange: handleStrategyChange }),
6633
+ flex: 1,
6634
+ ...CONTROL_BOX,
6635
+ borderRadius: 6,
6636
+ paddingHorizontal: 10,
6637
+ paddingVertical: 6,
6638
+ style: { ...CONTROL_INK, fontSize: 14 },
6540
6639
  children: STRATEGY_PRESETS.map((preset) => /* @__PURE__ */ jsx("option", { value: preset.value, children: preset.label }, preset.value))
6541
6640
  }
6542
6641
  ) }),
6543
- currentPreset && /* @__PURE__ */ jsx("p", { className: "text-[11px] text-zinc-500 -mt-1", children: currentPreset.description }),
6544
- /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1.5", children: legs.map((leg, i) => /* @__PURE__ */ jsx(
6642
+ currentPreset && /* @__PURE__ */ jsx(Text, { fontSize: 11, marginTop: -4, color: "var(--color-text-secondary)", children: currentPreset.description }),
6643
+ /* @__PURE__ */ jsx(YStack, { gap: 6, children: legs.map((leg, i) => /* @__PURE__ */ jsx(
6545
6644
  LegRow,
6546
6645
  {
6547
6646
  leg,
@@ -6555,40 +6654,53 @@ var StrategyBuilder = React32.forwardRef(
6555
6654
  i
6556
6655
  )) }),
6557
6656
  strategyType === "custom" && legs.length < 4 && /* @__PURE__ */ jsxs(
6558
- "button",
6657
+ XStack,
6559
6658
  {
6560
- type: "button",
6659
+ unstyled: true,
6660
+ render: /* @__PURE__ */ jsx("button", { type: "button" }),
6561
6661
  onClick: handleAddLeg,
6562
- className: "flex items-center justify-center gap-1 rounded-md border border-dashed border-zinc-700 py-1 text-xs text-zinc-500 hover:text-zinc-300 hover:border-zinc-500 transition-colors",
6662
+ alignItems: "center",
6663
+ justifyContent: "center",
6664
+ gap: 4,
6665
+ borderRadius: 6,
6666
+ borderWidth: 1,
6667
+ paddingVertical: 4,
6668
+ cursor: "pointer",
6669
+ transition: "quick",
6670
+ borderColor: "var(--color-border-divider)",
6671
+ hoverStyle: { borderColor: "var(--color-hover)" },
6672
+ style: { color: "var(--color-text-secondary)", borderStyle: "dashed" },
6563
6673
  children: [
6564
- /* @__PURE__ */ jsx("svg", { className: "h-3 w-3", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }),
6565
- "Add Leg"
6674
+ /* @__PURE__ */ jsx("svg", { width: 12, height: 12, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }),
6675
+ /* @__PURE__ */ jsx(Text, { fontSize: 12, color: "var(--color-text-secondary)", children: "Add Leg" })
6566
6676
  ]
6567
6677
  }
6568
6678
  ),
6569
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pt-1 border-t border-zinc-800", children: [
6570
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
6571
- /* @__PURE__ */ jsx("span", { className: "text-xs text-zinc-500", children: "Net:" }),
6572
- /* @__PURE__ */ jsxs("span", { className: cn(
6573
- "font-mono tabular-nums text-sm font-semibold",
6574
- netPremium > 0 ? "text-emerald-400" : netPremium < 0 ? "text-red-400" : "text-zinc-400"
6575
- ), children: [
6679
+ /* @__PURE__ */ jsxs(XStack, { alignItems: "center", justifyContent: "space-between", paddingTop: 4, borderTopWidth: 1, borderColor: "var(--color-border-divider)", children: [
6680
+ /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 8, children: [
6681
+ /* @__PURE__ */ jsx(Text, { fontSize: 12, color: "var(--color-text-secondary)", children: "Net:" }),
6682
+ /* @__PURE__ */ jsxs(Text, { fontSize: 14, fontWeight: "600", style: { fontFamily: MONO }, fontVariant: ["tabular-nums"], color: netColor, children: [
6576
6683
  netPremium > 0 ? "Credit " : netPremium < 0 ? "Debit " : "",
6577
6684
  netPremium !== 0 ? `$${Math.abs(netPremium).toFixed(2)}` : "-"
6578
6685
  ] })
6579
6686
  ] }),
6580
6687
  /* @__PURE__ */ jsx(
6581
- "button",
6688
+ XStack,
6582
6689
  {
6583
- type: "button",
6690
+ unstyled: true,
6691
+ render: /* @__PURE__ */ jsx("button", { type: "button" }),
6584
6692
  onClick: handleSubmit,
6585
6693
  disabled: legs.length === 0,
6586
- className: cn(
6587
- "px-4 py-1.5 rounded-md text-xs font-semibold transition-colors",
6588
- "bg-blue-600 text-white hover:bg-blue-500",
6589
- "disabled:opacity-40 disabled:cursor-not-allowed"
6590
- ),
6591
- children: "Review Order"
6694
+ paddingHorizontal: 16,
6695
+ paddingVertical: 6,
6696
+ borderRadius: 6,
6697
+ borderWidth: 0,
6698
+ cursor: "pointer",
6699
+ transition: "quick",
6700
+ backgroundColor: "var(--color-button-solid-bg)",
6701
+ hoverStyle: { backgroundColor: "var(--color-hover)" },
6702
+ disabledStyle: { opacity: 0.4, cursor: "not-allowed" },
6703
+ children: /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", color: "var(--color-button-solid-text)", children: "Review Order" })
6592
6704
  }
6593
6705
  )
6594
6706
  ] })
@@ -7027,7 +7139,7 @@ function formatDate(date) {
7027
7139
  const d = new Date(date);
7028
7140
  return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
7029
7141
  }
7030
- var MONO = { fontFamily: "monospace" };
7142
+ var MONO2 = { fontFamily: "monospace" };
7031
7143
  var OptionPositionCard = React32.forwardRef(
7032
7144
  function OptionPositionCard2(props, ref) {
7033
7145
  const {
@@ -7067,7 +7179,7 @@ var OptionPositionCard = React32.forwardRef(
7067
7179
  backgroundColor: isCall ? "var(--secondary)" : "var(--muted)",
7068
7180
  children: [
7069
7181
  /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.underlying }),
7070
- /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", style: MONO, fontVariant: ["tabular-nums"], color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.strike }),
7182
+ /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", style: MONO2, fontVariant: ["tabular-nums"], color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.strike }),
7071
7183
  /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "600", textTransform: "uppercase", color: isCall ? "var(--foreground)" : "var(--muted-foreground)", children: position.type === "call" ? "C" : "P" }),
7072
7184
  /* @__PURE__ */ jsx(Text, { fontSize: 12, fontWeight: "400", color: "var(--color-text-secondary)", children: formatDate(position.expiration) })
7073
7185
  ]
@@ -7078,7 +7190,7 @@ var OptionPositionCard = React32.forwardRef(
7078
7190
  {
7079
7191
  fontSize: 12,
7080
7192
  fontWeight: "600",
7081
- style: MONO,
7193
+ style: MONO2,
7082
7194
  fontVariant: ["tabular-nums"],
7083
7195
  color: isLong ? "var(--color-status-good)" : "var(--color-status-bad)",
7084
7196
  children: [
@@ -7091,14 +7203,14 @@ var OptionPositionCard = React32.forwardRef(
7091
7203
  /* @__PURE__ */ jsxs(XStack, { gap: 12, children: [
7092
7204
  /* @__PURE__ */ jsxs(YStack, { flex: 1, gap: 2, children: [
7093
7205
  /* @__PURE__ */ jsx(Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "Avg Cost" }),
7094
- /* @__PURE__ */ jsxs(Text, { fontSize: 12, style: MONO, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: [
7206
+ /* @__PURE__ */ jsxs(Text, { fontSize: 12, style: MONO2, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: [
7095
7207
  "$",
7096
7208
  position.avgCost.toFixed(2)
7097
7209
  ] })
7098
7210
  ] }),
7099
7211
  /* @__PURE__ */ jsxs(YStack, { flex: 1, gap: 2, children: [
7100
7212
  /* @__PURE__ */ jsx(Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "Value" }),
7101
- /* @__PURE__ */ jsxs(Text, { fontSize: 12, style: MONO, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: [
7213
+ /* @__PURE__ */ jsxs(Text, { fontSize: 12, style: MONO2, fontVariant: ["tabular-nums"], color: "var(--color-text-primary)", children: [
7102
7214
  "$",
7103
7215
  position.currentValue.toFixed(2)
7104
7216
  ] })
@@ -7106,11 +7218,11 @@ var OptionPositionCard = React32.forwardRef(
7106
7218
  /* @__PURE__ */ jsxs(YStack, { flex: 1, gap: 2, alignItems: "flex-end", children: [
7107
7219
  /* @__PURE__ */ jsx(Text, { fontSize: 10, textTransform: "uppercase", letterSpacing: 0.5, color: "var(--color-text-secondary)", children: "P/L" }),
7108
7220
  /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 4, children: [
7109
- /* @__PURE__ */ jsxs(Text, { fontSize: 12, fontWeight: "600", style: MONO, fontVariant: ["tabular-nums"], color: pnlColor, children: [
7221
+ /* @__PURE__ */ jsxs(Text, { fontSize: 12, fontWeight: "600", style: MONO2, fontVariant: ["tabular-nums"], color: pnlColor, children: [
7110
7222
  isProfitable ? "+" : "",
7111
7223
  position.pnl.toFixed(2)
7112
7224
  ] }),
7113
- /* @__PURE__ */ jsxs(Text, { fontSize: 10, style: MONO, fontVariant: ["tabular-nums"], color: pnlColor, opacity: 0.7, children: [
7225
+ /* @__PURE__ */ jsxs(Text, { fontSize: 10, style: MONO2, fontVariant: ["tabular-nums"], color: pnlColor, opacity: 0.7, children: [
7114
7226
  "(",
7115
7227
  isProfitable ? "+" : "",
7116
7228
  position.pnlPercent.toFixed(1),
@@ -7159,7 +7271,7 @@ function ActionButton({ onClick, children }) {
7159
7271
  function GreekPill({ label, value, color }) {
7160
7272
  return /* @__PURE__ */ jsxs(XStack, { alignItems: "center", gap: 4, children: [
7161
7273
  /* @__PURE__ */ jsx(Text, { fontSize: 10, fontWeight: "600", color, children: label }),
7162
- /* @__PURE__ */ jsx(Text, { fontSize: 11, style: MONO, fontVariant: ["tabular-nums"], color: value < 0 ? "var(--color-status-bad)" : "var(--color-text-secondary)", children: value.toFixed(4) })
7274
+ /* @__PURE__ */ jsx(Text, { fontSize: 11, style: MONO2, fontVariant: ["tabular-nums"], color: value < 0 ? "var(--color-status-bad)" : "var(--color-text-secondary)", children: value.toFixed(4) })
7163
7275
  ] });
7164
7276
  }
7165
7277
  function formatExpDate(date) {