myoperator-ui 0.0.162 → 0.0.163
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 +112 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8206,7 +8206,7 @@ export type {
|
|
|
8206
8206
|
},
|
|
8207
8207
|
"payment-option-card": {
|
|
8208
8208
|
name: "payment-option-card",
|
|
8209
|
-
description: "A selectable payment method list with icons, titles, and descriptions",
|
|
8209
|
+
description: "A selectable payment method list with icons, titles, and descriptions. Includes a modal variant for overlay usage.",
|
|
8210
8210
|
category: "custom",
|
|
8211
8211
|
dependencies: [
|
|
8212
8212
|
"clsx",
|
|
@@ -8214,7 +8214,8 @@ export type {
|
|
|
8214
8214
|
"lucide-react"
|
|
8215
8215
|
],
|
|
8216
8216
|
internalDependencies: [
|
|
8217
|
-
"button"
|
|
8217
|
+
"button",
|
|
8218
|
+
"dialog"
|
|
8218
8219
|
],
|
|
8219
8220
|
isMultiFile: true,
|
|
8220
8221
|
directory: "payment-option-card",
|
|
@@ -8359,6 +8360,96 @@ export const PaymentOptionCard = React.forwardRef<
|
|
|
8359
8360
|
);
|
|
8360
8361
|
|
|
8361
8362
|
PaymentOptionCard.displayName = "PaymentOptionCard";
|
|
8363
|
+
`, prefix)
|
|
8364
|
+
},
|
|
8365
|
+
{
|
|
8366
|
+
name: "payment-option-card-modal.tsx",
|
|
8367
|
+
content: prefixTailwindClasses(`import * as React from "react";
|
|
8368
|
+
import {
|
|
8369
|
+
Dialog,
|
|
8370
|
+
DialogContent,
|
|
8371
|
+
DialogTitle,
|
|
8372
|
+
} from "../dialog";
|
|
8373
|
+
import { PaymentOptionCard } from "./payment-option-card";
|
|
8374
|
+
import type { PaymentOptionCardModalProps } from "./types";
|
|
8375
|
+
|
|
8376
|
+
/**
|
|
8377
|
+
* PaymentOptionCardModal wraps the PaymentOptionCard in a centered Dialog overlay.
|
|
8378
|
+
* Use this when you want to show payment method selection as a modal popup rather
|
|
8379
|
+
* than an inline card.
|
|
8380
|
+
*
|
|
8381
|
+
* @example
|
|
8382
|
+
* \`\`\`tsx
|
|
8383
|
+
* const [open, setOpen] = useState(false);
|
|
8384
|
+
*
|
|
8385
|
+
* <PaymentOptionCardModal
|
|
8386
|
+
* open={open}
|
|
8387
|
+
* onOpenChange={setOpen}
|
|
8388
|
+
* options={paymentOptions}
|
|
8389
|
+
* onOptionSelect={(id) => console.log(id)}
|
|
8390
|
+
* onCtaClick={() => { handlePayment(); setOpen(false); }}
|
|
8391
|
+
* />
|
|
8392
|
+
* \`\`\`
|
|
8393
|
+
*/
|
|
8394
|
+
export const PaymentOptionCardModal = React.forwardRef<
|
|
8395
|
+
HTMLDivElement,
|
|
8396
|
+
PaymentOptionCardModalProps
|
|
8397
|
+
>(
|
|
8398
|
+
(
|
|
8399
|
+
{
|
|
8400
|
+
open,
|
|
8401
|
+
onOpenChange,
|
|
8402
|
+
title,
|
|
8403
|
+
subtitle,
|
|
8404
|
+
options,
|
|
8405
|
+
selectedOptionId,
|
|
8406
|
+
defaultSelectedOptionId,
|
|
8407
|
+
onOptionSelect,
|
|
8408
|
+
ctaText,
|
|
8409
|
+
onCtaClick,
|
|
8410
|
+
loading,
|
|
8411
|
+
disabled,
|
|
8412
|
+
className,
|
|
8413
|
+
},
|
|
8414
|
+
ref
|
|
8415
|
+
) => {
|
|
8416
|
+
const handleClose = () => {
|
|
8417
|
+
onOpenChange(false);
|
|
8418
|
+
};
|
|
8419
|
+
|
|
8420
|
+
return (
|
|
8421
|
+
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
8422
|
+
<DialogContent
|
|
8423
|
+
ref={ref}
|
|
8424
|
+
size="sm"
|
|
8425
|
+
hideCloseButton
|
|
8426
|
+
className="p-0 border-0 bg-transparent shadow-none"
|
|
8427
|
+
>
|
|
8428
|
+
{/* Visually hidden title for accessibility */}
|
|
8429
|
+
<DialogTitle className="sr-only">
|
|
8430
|
+
{title || "Select payment method"}
|
|
8431
|
+
</DialogTitle>
|
|
8432
|
+
<PaymentOptionCard
|
|
8433
|
+
title={title}
|
|
8434
|
+
subtitle={subtitle}
|
|
8435
|
+
options={options}
|
|
8436
|
+
selectedOptionId={selectedOptionId}
|
|
8437
|
+
defaultSelectedOptionId={defaultSelectedOptionId}
|
|
8438
|
+
onOptionSelect={onOptionSelect}
|
|
8439
|
+
ctaText={ctaText}
|
|
8440
|
+
onCtaClick={onCtaClick}
|
|
8441
|
+
onClose={handleClose}
|
|
8442
|
+
loading={loading}
|
|
8443
|
+
disabled={disabled}
|
|
8444
|
+
className={className}
|
|
8445
|
+
/>
|
|
8446
|
+
</DialogContent>
|
|
8447
|
+
</Dialog>
|
|
8448
|
+
);
|
|
8449
|
+
}
|
|
8450
|
+
);
|
|
8451
|
+
|
|
8452
|
+
PaymentOptionCardModal.displayName = "PaymentOptionCardModal";
|
|
8362
8453
|
`, prefix)
|
|
8363
8454
|
},
|
|
8364
8455
|
{
|
|
@@ -8408,12 +8499,30 @@ export interface PaymentOptionCardProps {
|
|
|
8408
8499
|
/** Additional className for the root element */
|
|
8409
8500
|
className?: string;
|
|
8410
8501
|
}
|
|
8502
|
+
|
|
8503
|
+
/**
|
|
8504
|
+
* Props for the PaymentOptionCardModal component.
|
|
8505
|
+
* Extends the card props with Dialog open/close control, omitting \`onClose\`
|
|
8506
|
+
* which is handled internally by the modal.
|
|
8507
|
+
*/
|
|
8508
|
+
export interface PaymentOptionCardModalProps
|
|
8509
|
+
extends Omit<PaymentOptionCardProps, "onClose"> {
|
|
8510
|
+
/** Whether the modal is open */
|
|
8511
|
+
open: boolean;
|
|
8512
|
+
/** Callback when modal should open or close */
|
|
8513
|
+
onOpenChange: (open: boolean) => void;
|
|
8514
|
+
}
|
|
8411
8515
|
`, prefix)
|
|
8412
8516
|
},
|
|
8413
8517
|
{
|
|
8414
8518
|
name: "index.ts",
|
|
8415
8519
|
content: prefixTailwindClasses(`export { PaymentOptionCard } from "./payment-option-card";
|
|
8416
|
-
export
|
|
8520
|
+
export { PaymentOptionCardModal } from "./payment-option-card-modal";
|
|
8521
|
+
export type {
|
|
8522
|
+
PaymentOptionCardProps,
|
|
8523
|
+
PaymentOptionCardModalProps,
|
|
8524
|
+
PaymentOption,
|
|
8525
|
+
} from "./types";
|
|
8417
8526
|
`, prefix)
|
|
8418
8527
|
}
|
|
8419
8528
|
]
|