myoperator-ui 0.0.201 → 0.0.202
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 +193 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9673,6 +9673,199 @@ export interface PaymentOptionCardProps {
|
|
|
9673
9673
|
content: prefixTailwindClasses(`export { PaymentOptionCard } from "./payment-option-card";
|
|
9674
9674
|
export { PaymentOptionCardModal } from "./payment-option-card-modal";
|
|
9675
9675
|
export type { PaymentOptionCardProps, PaymentOption } from "./types";
|
|
9676
|
+
`, prefix)
|
|
9677
|
+
}
|
|
9678
|
+
]
|
|
9679
|
+
},
|
|
9680
|
+
"plan-detail-modal": {
|
|
9681
|
+
name: "plan-detail-modal",
|
|
9682
|
+
description: "A read-only modal displaying plan feature breakdown with free allowances and per-unit rates",
|
|
9683
|
+
category: "custom",
|
|
9684
|
+
dependencies: [
|
|
9685
|
+
"clsx",
|
|
9686
|
+
"tailwind-merge",
|
|
9687
|
+
"lucide-react",
|
|
9688
|
+
"@radix-ui/react-dialog"
|
|
9689
|
+
],
|
|
9690
|
+
internalDependencies: [
|
|
9691
|
+
"dialog"
|
|
9692
|
+
],
|
|
9693
|
+
isMultiFile: true,
|
|
9694
|
+
directory: "plan-detail-modal",
|
|
9695
|
+
mainFile: "plan-detail-modal.tsx",
|
|
9696
|
+
files: [
|
|
9697
|
+
{
|
|
9698
|
+
name: "plan-detail-modal.tsx",
|
|
9699
|
+
content: prefixTailwindClasses(`import * as React from "react";
|
|
9700
|
+
import { X } from "lucide-react";
|
|
9701
|
+
import { cn } from "../../../lib/utils";
|
|
9702
|
+
import { Dialog, DialogContent, DialogDescription, DialogTitle } from "../dialog";
|
|
9703
|
+
import type { PlanDetailModalProps, PlanFeature } from "./types";
|
|
9704
|
+
|
|
9705
|
+
const DEFAULT_FEATURES: PlanFeature[] = [
|
|
9706
|
+
{ name: "WhatsApp Service", free: "0 Message(s)", rate: "\u20B9 0" },
|
|
9707
|
+
{ name: "Incoming (Missed)", free: "0 Minute(s)", rate: "\u20B9 0" },
|
|
9708
|
+
{ name: "WhatsApp Marketing", free: "0 Message(s)", rate: "\u20B9 0.86" },
|
|
9709
|
+
{ name: "Fix did(s)", free: "0 DID(s)", rate: "\u20B9 200.00" },
|
|
9710
|
+
{ name: "WhatsApp Utility", free: "0 Message(s)", rate: "\u20B9 0.13" },
|
|
9711
|
+
{ name: "User(s)", free: "3 User(s)", rate: "\u20B9 150.00" },
|
|
9712
|
+
{ name: "Pro license(s)", free: "3 License(s)", rate: "\u20B9 300.00" },
|
|
9713
|
+
{ name: "WhatsApp Authentication", free: "0 Unit(s)", rate: "\u20B9 0.13" },
|
|
9714
|
+
{ name: "Department(s)", free: "2 Department(s)", rate: "\u20B9 300.00" },
|
|
9715
|
+
{ name: "Channel(s)", free: "1 Pair(s)", rate: "\u20B9 300.00" },
|
|
9716
|
+
];
|
|
9717
|
+
|
|
9718
|
+
const PlanDetailModal = React.forwardRef<HTMLDivElement, PlanDetailModalProps>(
|
|
9719
|
+
(
|
|
9720
|
+
{
|
|
9721
|
+
open,
|
|
9722
|
+
onOpenChange,
|
|
9723
|
+
title = "Plan detail",
|
|
9724
|
+
features = DEFAULT_FEATURES,
|
|
9725
|
+
planPrice,
|
|
9726
|
+
onClose,
|
|
9727
|
+
className,
|
|
9728
|
+
...props
|
|
9729
|
+
},
|
|
9730
|
+
ref
|
|
9731
|
+
) => {
|
|
9732
|
+
const handleClose = () => {
|
|
9733
|
+
onClose?.();
|
|
9734
|
+
onOpenChange(false);
|
|
9735
|
+
};
|
|
9736
|
+
|
|
9737
|
+
return (
|
|
9738
|
+
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
9739
|
+
<DialogContent
|
|
9740
|
+
size="lg"
|
|
9741
|
+
hideCloseButton
|
|
9742
|
+
className="p-0 gap-0 overflow-hidden"
|
|
9743
|
+
>
|
|
9744
|
+
<div
|
|
9745
|
+
ref={ref}
|
|
9746
|
+
className={cn("flex flex-col", className)}
|
|
9747
|
+
{...props}
|
|
9748
|
+
>
|
|
9749
|
+
{/* Header */}
|
|
9750
|
+
<div className="flex items-center justify-between px-8 py-4 border-b border-semantic-border-layout">
|
|
9751
|
+
<DialogTitle className="text-lg font-semibold text-semantic-text-primary leading-none m-0">
|
|
9752
|
+
{title}
|
|
9753
|
+
</DialogTitle>
|
|
9754
|
+
<button
|
|
9755
|
+
type="button"
|
|
9756
|
+
onClick={handleClose}
|
|
9757
|
+
aria-label="Close"
|
|
9758
|
+
className="flex items-center justify-center size-6 rounded text-semantic-text-muted hover:text-semantic-text-primary hover:bg-semantic-bg-hover transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-semantic-border-focus"
|
|
9759
|
+
>
|
|
9760
|
+
<X className="size-3" aria-hidden="true" />
|
|
9761
|
+
</button>
|
|
9762
|
+
</div>
|
|
9763
|
+
|
|
9764
|
+
{/* Body */}
|
|
9765
|
+
<DialogDescription asChild>
|
|
9766
|
+
<div className="flex flex-col gap-2.5 px-8 py-5 overflow-y-auto max-h-[70vh]">
|
|
9767
|
+
<p className="m-0 text-base font-semibold text-semantic-text-primary leading-none">
|
|
9768
|
+
Features
|
|
9769
|
+
</p>
|
|
9770
|
+
<div className="w-full overflow-x-auto rounded border border-semantic-border-layout">
|
|
9771
|
+
<table className="w-full border-collapse text-sm">
|
|
9772
|
+
<thead>
|
|
9773
|
+
<tr className="bg-semantic-bg-ui">
|
|
9774
|
+
<th className="px-3 py-[11px] text-left font-semibold text-semantic-text-primary border-b border-semantic-border-layout w-[44%]">
|
|
9775
|
+
Feature
|
|
9776
|
+
</th>
|
|
9777
|
+
<th className="px-3 py-[11px] text-left font-semibold text-semantic-text-primary border-b border-semantic-border-layout w-[28%]">
|
|
9778
|
+
Free
|
|
9779
|
+
</th>
|
|
9780
|
+
<th className="px-3 py-[11px] text-left font-semibold text-semantic-text-primary border-b border-semantic-border-layout w-[28%]">
|
|
9781
|
+
Rate
|
|
9782
|
+
</th>
|
|
9783
|
+
</tr>
|
|
9784
|
+
</thead>
|
|
9785
|
+
<tbody>
|
|
9786
|
+
{features.map((feature, index) => (
|
|
9787
|
+
<tr
|
|
9788
|
+
key={feature.name}
|
|
9789
|
+
className={cn(
|
|
9790
|
+
index % 2 === 0
|
|
9791
|
+
? "bg-semantic-bg-primary"
|
|
9792
|
+
: "bg-semantic-bg-ui"
|
|
9793
|
+
)}
|
|
9794
|
+
>
|
|
9795
|
+
<td className="px-3 py-[11px] text-semantic-text-secondary border-b border-semantic-border-layout">
|
|
9796
|
+
<p className="m-0 leading-none">{feature.name}</p>
|
|
9797
|
+
</td>
|
|
9798
|
+
<td className="px-3 py-[11px] text-semantic-text-secondary border-b border-semantic-border-layout">
|
|
9799
|
+
<p className="m-0 leading-none">{feature.free}</p>
|
|
9800
|
+
</td>
|
|
9801
|
+
<td className="px-3 py-[11px] text-semantic-text-secondary border-b border-semantic-border-layout">
|
|
9802
|
+
<p className="m-0 leading-none">{feature.rate}</p>
|
|
9803
|
+
</td>
|
|
9804
|
+
</tr>
|
|
9805
|
+
))}
|
|
9806
|
+
</tbody>
|
|
9807
|
+
</table>
|
|
9808
|
+
</div>
|
|
9809
|
+
</div>
|
|
9810
|
+
</DialogDescription>
|
|
9811
|
+
|
|
9812
|
+
{/* Footer */}
|
|
9813
|
+
{planPrice && (
|
|
9814
|
+
<div className="flex items-center px-8 py-4 border-t border-semantic-border-layout">
|
|
9815
|
+
<p className="m-0 text-base text-semantic-text-primary">
|
|
9816
|
+
<span className="font-semibold">Plan price </span>
|
|
9817
|
+
<span className="font-normal">{planPrice}</span>
|
|
9818
|
+
</p>
|
|
9819
|
+
</div>
|
|
9820
|
+
)}
|
|
9821
|
+
</div>
|
|
9822
|
+
</DialogContent>
|
|
9823
|
+
</Dialog>
|
|
9824
|
+
);
|
|
9825
|
+
}
|
|
9826
|
+
);
|
|
9827
|
+
|
|
9828
|
+
PlanDetailModal.displayName = "PlanDetailModal";
|
|
9829
|
+
|
|
9830
|
+
export { PlanDetailModal };
|
|
9831
|
+
`, prefix)
|
|
9832
|
+
},
|
|
9833
|
+
{
|
|
9834
|
+
name: "types.ts",
|
|
9835
|
+
content: prefixTailwindClasses(`import * as React from "react";
|
|
9836
|
+
|
|
9837
|
+
/**
|
|
9838
|
+
* A single feature row in the plan detail table.
|
|
9839
|
+
*/
|
|
9840
|
+
export interface PlanFeature {
|
|
9841
|
+
/** Feature name (e.g., "WhatsApp Service") */
|
|
9842
|
+
name: string;
|
|
9843
|
+
/** Free allowance (e.g., "0 Message(s)") */
|
|
9844
|
+
free: string;
|
|
9845
|
+
/** Rate per unit (e.g., "\u20B9 0.86") */
|
|
9846
|
+
rate: string;
|
|
9847
|
+
}
|
|
9848
|
+
|
|
9849
|
+
export interface PlanDetailModalProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9850
|
+
/** Whether the modal is open */
|
|
9851
|
+
open: boolean;
|
|
9852
|
+
/** Called when modal open state changes */
|
|
9853
|
+
onOpenChange: (open: boolean) => void;
|
|
9854
|
+
/** Modal title */
|
|
9855
|
+
title?: string;
|
|
9856
|
+
/** List of features to display in the table */
|
|
9857
|
+
features?: PlanFeature[];
|
|
9858
|
+
/** Plan price label (e.g., "\u20B9 2,500.00/month") */
|
|
9859
|
+
planPrice?: string;
|
|
9860
|
+
/** Called when close button is clicked */
|
|
9861
|
+
onClose?: () => void;
|
|
9862
|
+
}
|
|
9863
|
+
`, prefix)
|
|
9864
|
+
},
|
|
9865
|
+
{
|
|
9866
|
+
name: "index.ts",
|
|
9867
|
+
content: prefixTailwindClasses(`export { PlanDetailModal } from "./plan-detail-modal";
|
|
9868
|
+
export type { PlanDetailModalProps, PlanFeature } from "./types";
|
|
9676
9869
|
`, prefix)
|
|
9677
9870
|
}
|
|
9678
9871
|
]
|