myoperator-ui 0.0.160 → 0.0.162

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.
Files changed (2) hide show
  1. package/dist/index.js +27 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2900,7 +2900,7 @@ const TableHeader = React.forwardRef<
2900
2900
  >(({ className, ...props }, ref) => (
2901
2901
  <thead
2902
2902
  ref={ref}
2903
- className={cn("bg-[var(--color-neutral-50)] [&_tr]:border-b", className)}
2903
+ className={cn("bg-[var(--color-neutral-100)] [&_tr]:border-b", className)}
2904
2904
  {...props}
2905
2905
  />
2906
2906
  ));
@@ -2925,7 +2925,7 @@ const TableFooter = React.forwardRef<
2925
2925
  <tfoot
2926
2926
  ref={ref}
2927
2927
  className={cn(
2928
- "border-t bg-[var(--color-neutral-50)] font-medium [&>tr]:last:border-b-0",
2928
+ "border-t bg-[var(--color-neutral-100)] font-medium [&>tr]:last:border-b-0",
2929
2929
  className
2930
2930
  )}
2931
2931
  {...props}
@@ -2973,7 +2973,7 @@ const TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(
2973
2973
  ref={ref}
2974
2974
  className={cn(
2975
2975
  "h-12 px-4 text-left align-middle font-medium text-semantic-text-muted text-sm [&:has([role=checkbox])]:pr-0",
2976
- sticky && "sticky left-0 bg-[var(--color-neutral-50)] z-10",
2976
+ sticky && "sticky left-0 bg-[var(--color-neutral-100)] z-10",
2977
2977
  sortDirection && "cursor-pointer select-none",
2978
2978
  className
2979
2979
  )}
@@ -8498,6 +8498,8 @@ export const WalletTopup = React.forwardRef<HTMLDivElement, WalletTopupProps>(
8498
8498
  voucherLinkText = "Have an offline code or voucher?",
8499
8499
  voucherIcon = <Ticket className="size-4" />,
8500
8500
  onVoucherClick,
8501
+ showVoucherInput: controlledShowVoucherInput,
8502
+ onShowVoucherInputChange,
8501
8503
  voucherCode: controlledVoucherCode,
8502
8504
  onVoucherCodeChange,
8503
8505
  voucherCodePlaceholder = "XXXX-XXXX-XXXX",
@@ -8530,8 +8532,15 @@ export const WalletTopup = React.forwardRef<HTMLDivElement, WalletTopupProps>(
8530
8532
  ? controlledCustomAmount
8531
8533
  : internalCustom;
8532
8534
 
8535
+ // Voucher input visibility (controlled/uncontrolled)
8536
+ const isVoucherInputControlled = controlledShowVoucherInput !== undefined;
8537
+ const [internalShowVoucherInput, setInternalShowVoucherInput] =
8538
+ React.useState(false);
8539
+ const showVoucherInput = isVoucherInputControlled
8540
+ ? controlledShowVoucherInput
8541
+ : internalShowVoucherInput;
8542
+
8533
8543
  // Voucher code input state
8534
- const [showVoucherInput, setShowVoucherInput] = React.useState(false);
8535
8544
  const isVoucherCodeControlled = controlledVoucherCode !== undefined;
8536
8545
  const [internalVoucherCode, setInternalVoucherCode] = React.useState("");
8537
8546
  const voucherCodeValue = isVoucherCodeControlled
@@ -8539,12 +8548,18 @@ export const WalletTopup = React.forwardRef<HTMLDivElement, WalletTopupProps>(
8539
8548
  : internalVoucherCode;
8540
8549
 
8541
8550
  const handleVoucherLinkClick = () => {
8542
- setShowVoucherInput(true);
8551
+ if (!isVoucherInputControlled) {
8552
+ setInternalShowVoucherInput(true);
8553
+ }
8554
+ onShowVoucherInputChange?.(true);
8543
8555
  onVoucherClick?.();
8544
8556
  };
8545
8557
 
8546
8558
  const handleVoucherCancel = () => {
8547
- setShowVoucherInput(false);
8559
+ if (!isVoucherInputControlled) {
8560
+ setInternalShowVoucherInput(false);
8561
+ }
8562
+ onShowVoucherInputChange?.(false);
8548
8563
  if (!isVoucherCodeControlled) {
8549
8564
  setInternalVoucherCode("");
8550
8565
  }
@@ -8827,6 +8842,12 @@ export interface WalletTopupProps {
8827
8842
  /** Callback when voucher link is clicked (also toggles inline code input) */
8828
8843
  onVoucherClick?: () => void;
8829
8844
 
8845
+ // Voucher input visibility
8846
+ /** Whether the voucher input is visible (controlled). When provided, the component won't toggle visibility internally. */
8847
+ showVoucherInput?: boolean;
8848
+ /** Callback when voucher input visibility changes (from link click or cancel) */
8849
+ onShowVoucherInputChange?: (show: boolean) => void;
8850
+
8830
8851
  // Voucher code input
8831
8852
  /** Voucher code value (controlled) */
8832
8853
  voucherCode?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.160",
3
+ "version": "0.0.162",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",