myoperator-ui 0.0.201 → 0.0.203

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 +227 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9114,6 +9114,8 @@ export interface PaymentSummaryProps {
9114
9114
  subtotal?: { label: string; value: string };
9115
9115
  /** Light-blue bordered breakdown card shown below the subtotal */
9116
9116
  breakdownCard?: PaymentSummaryBreakdownCard;
9117
+ /** Credit limit row shown at the bottom, separated by a top border */
9118
+ creditLimit?: { value: string; tooltip?: string };
9117
9119
  }
9118
9120
 
9119
9121
  const valueColorMap: Record<string, string> = {
@@ -9243,7 +9245,7 @@ const BreakdownCardRow = ({ item }: { item: BreakdownCardItem }) => (
9243
9245
  * \`\`\`
9244
9246
  */
9245
9247
  export const PaymentSummary = React.forwardRef<HTMLDivElement, PaymentSummaryProps>(
9246
- ({ items = [], summaryItems, className, title, headerInfo, subtotal, breakdownCard }, ref) => {
9248
+ ({ items = [], summaryItems, className, title, headerInfo, subtotal, breakdownCard, creditLimit }, ref) => {
9247
9249
  const hasItemsBorder =
9248
9250
  items.length > 0 &&
9249
9251
  (!!subtotal || !!breakdownCard || (summaryItems && summaryItems.length > 0));
@@ -9344,6 +9346,37 @@ export const PaymentSummary = React.forwardRef<HTMLDivElement, PaymentSummaryPro
9344
9346
  ))}
9345
9347
  </div>
9346
9348
  )}
9349
+
9350
+ {/* Credit limit row */}
9351
+ {creditLimit && (
9352
+ <div className="flex items-center justify-between border-t border-semantic-border-layout pt-3">
9353
+ <div className="flex items-center gap-1.5">
9354
+ <span className="text-sm text-semantic-text-primary tracking-[0.035px]">
9355
+ Credit limit
9356
+ </span>
9357
+ {creditLimit.tooltip && (
9358
+ <Tooltip>
9359
+ <TooltipTrigger asChild>
9360
+ <button
9361
+ type="button"
9362
+ className="inline-flex items-center justify-center rounded-full w-5 h-5 text-semantic-text-muted hover:text-semantic-text-primary hover:bg-semantic-bg-ui transition-colors"
9363
+ aria-label="Info about Credit limit"
9364
+ >
9365
+ <Info className="h-3.5 w-3.5" />
9366
+ </button>
9367
+ </TooltipTrigger>
9368
+ <TooltipContent>
9369
+ <TooltipArrow />
9370
+ {creditLimit.tooltip}
9371
+ </TooltipContent>
9372
+ </Tooltip>
9373
+ )}
9374
+ </div>
9375
+ <span className="text-sm text-semantic-text-primary tracking-[0.035px]">
9376
+ {creditLimit.value}
9377
+ </span>
9378
+ </div>
9379
+ )}
9347
9380
  </div>
9348
9381
  </div>
9349
9382
  </TooltipProvider>
@@ -9673,6 +9706,199 @@ export interface PaymentOptionCardProps {
9673
9706
  content: prefixTailwindClasses(`export { PaymentOptionCard } from "./payment-option-card";
9674
9707
  export { PaymentOptionCardModal } from "./payment-option-card-modal";
9675
9708
  export type { PaymentOptionCardProps, PaymentOption } from "./types";
9709
+ `, prefix)
9710
+ }
9711
+ ]
9712
+ },
9713
+ "plan-detail-modal": {
9714
+ name: "plan-detail-modal",
9715
+ description: "A read-only modal displaying plan feature breakdown with free allowances and per-unit rates",
9716
+ category: "custom",
9717
+ dependencies: [
9718
+ "clsx",
9719
+ "tailwind-merge",
9720
+ "lucide-react",
9721
+ "@radix-ui/react-dialog"
9722
+ ],
9723
+ internalDependencies: [
9724
+ "dialog"
9725
+ ],
9726
+ isMultiFile: true,
9727
+ directory: "plan-detail-modal",
9728
+ mainFile: "plan-detail-modal.tsx",
9729
+ files: [
9730
+ {
9731
+ name: "plan-detail-modal.tsx",
9732
+ content: prefixTailwindClasses(`import * as React from "react";
9733
+ import { X } from "lucide-react";
9734
+ import { cn } from "../../../lib/utils";
9735
+ import { Dialog, DialogContent, DialogDescription, DialogTitle } from "../dialog";
9736
+ import type { PlanDetailModalProps, PlanFeature } from "./types";
9737
+
9738
+ const DEFAULT_FEATURES: PlanFeature[] = [
9739
+ { name: "WhatsApp Service", free: "0 Message(s)", rate: "\u20B9 0" },
9740
+ { name: "Incoming (Missed)", free: "0 Minute(s)", rate: "\u20B9 0" },
9741
+ { name: "WhatsApp Marketing", free: "0 Message(s)", rate: "\u20B9 0.86" },
9742
+ { name: "Fix did(s)", free: "0 DID(s)", rate: "\u20B9 200.00" },
9743
+ { name: "WhatsApp Utility", free: "0 Message(s)", rate: "\u20B9 0.13" },
9744
+ { name: "User(s)", free: "3 User(s)", rate: "\u20B9 150.00" },
9745
+ { name: "Pro license(s)", free: "3 License(s)", rate: "\u20B9 300.00" },
9746
+ { name: "WhatsApp Authentication", free: "0 Unit(s)", rate: "\u20B9 0.13" },
9747
+ { name: "Department(s)", free: "2 Department(s)", rate: "\u20B9 300.00" },
9748
+ { name: "Channel(s)", free: "1 Pair(s)", rate: "\u20B9 300.00" },
9749
+ ];
9750
+
9751
+ const PlanDetailModal = React.forwardRef<HTMLDivElement, PlanDetailModalProps>(
9752
+ (
9753
+ {
9754
+ open,
9755
+ onOpenChange,
9756
+ title = "Plan detail",
9757
+ features = DEFAULT_FEATURES,
9758
+ planPrice,
9759
+ onClose,
9760
+ className,
9761
+ ...props
9762
+ },
9763
+ ref
9764
+ ) => {
9765
+ const handleClose = () => {
9766
+ onClose?.();
9767
+ onOpenChange(false);
9768
+ };
9769
+
9770
+ return (
9771
+ <Dialog open={open} onOpenChange={onOpenChange}>
9772
+ <DialogContent
9773
+ size="lg"
9774
+ hideCloseButton
9775
+ className="p-0 gap-0 overflow-hidden"
9776
+ >
9777
+ <div
9778
+ ref={ref}
9779
+ className={cn("flex flex-col", className)}
9780
+ {...props}
9781
+ >
9782
+ {/* Header */}
9783
+ <div className="flex items-center justify-between px-8 py-4 border-b border-semantic-border-layout">
9784
+ <DialogTitle className="text-lg font-semibold text-semantic-text-primary leading-none m-0">
9785
+ {title}
9786
+ </DialogTitle>
9787
+ <button
9788
+ type="button"
9789
+ onClick={handleClose}
9790
+ aria-label="Close"
9791
+ 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"
9792
+ >
9793
+ <X className="size-3" aria-hidden="true" />
9794
+ </button>
9795
+ </div>
9796
+
9797
+ {/* Body */}
9798
+ <DialogDescription asChild>
9799
+ <div className="flex flex-col gap-2.5 px-8 py-5 overflow-y-auto max-h-[70vh]">
9800
+ <p className="m-0 text-base font-semibold text-semantic-text-primary leading-none">
9801
+ Features
9802
+ </p>
9803
+ <div className="w-full overflow-x-auto rounded border border-semantic-border-layout">
9804
+ <table className="w-full border-collapse text-sm">
9805
+ <thead>
9806
+ <tr className="bg-semantic-bg-ui">
9807
+ <th className="px-3 py-[11px] text-left font-semibold text-semantic-text-primary border-b border-semantic-border-layout w-[44%]">
9808
+ Feature
9809
+ </th>
9810
+ <th className="px-3 py-[11px] text-left font-semibold text-semantic-text-primary border-b border-semantic-border-layout w-[28%]">
9811
+ Free
9812
+ </th>
9813
+ <th className="px-3 py-[11px] text-left font-semibold text-semantic-text-primary border-b border-semantic-border-layout w-[28%]">
9814
+ Rate
9815
+ </th>
9816
+ </tr>
9817
+ </thead>
9818
+ <tbody>
9819
+ {features.map((feature, index) => (
9820
+ <tr
9821
+ key={feature.name}
9822
+ className={cn(
9823
+ index % 2 === 0
9824
+ ? "bg-semantic-bg-primary"
9825
+ : "bg-semantic-bg-ui"
9826
+ )}
9827
+ >
9828
+ <td className="px-3 py-[11px] text-semantic-text-secondary border-b border-semantic-border-layout">
9829
+ <p className="m-0 leading-none">{feature.name}</p>
9830
+ </td>
9831
+ <td className="px-3 py-[11px] text-semantic-text-secondary border-b border-semantic-border-layout">
9832
+ <p className="m-0 leading-none">{feature.free}</p>
9833
+ </td>
9834
+ <td className="px-3 py-[11px] text-semantic-text-secondary border-b border-semantic-border-layout">
9835
+ <p className="m-0 leading-none">{feature.rate}</p>
9836
+ </td>
9837
+ </tr>
9838
+ ))}
9839
+ </tbody>
9840
+ </table>
9841
+ </div>
9842
+ </div>
9843
+ </DialogDescription>
9844
+
9845
+ {/* Footer */}
9846
+ {planPrice && (
9847
+ <div className="flex items-center px-8 py-4 border-t border-semantic-border-layout">
9848
+ <p className="m-0 text-base text-semantic-text-primary">
9849
+ <span className="font-semibold">Plan price </span>
9850
+ <span className="font-normal">{planPrice}</span>
9851
+ </p>
9852
+ </div>
9853
+ )}
9854
+ </div>
9855
+ </DialogContent>
9856
+ </Dialog>
9857
+ );
9858
+ }
9859
+ );
9860
+
9861
+ PlanDetailModal.displayName = "PlanDetailModal";
9862
+
9863
+ export { PlanDetailModal };
9864
+ `, prefix)
9865
+ },
9866
+ {
9867
+ name: "types.ts",
9868
+ content: prefixTailwindClasses(`import * as React from "react";
9869
+
9870
+ /**
9871
+ * A single feature row in the plan detail table.
9872
+ */
9873
+ export interface PlanFeature {
9874
+ /** Feature name (e.g., "WhatsApp Service") */
9875
+ name: string;
9876
+ /** Free allowance (e.g., "0 Message(s)") */
9877
+ free: string;
9878
+ /** Rate per unit (e.g., "\u20B9 0.86") */
9879
+ rate: string;
9880
+ }
9881
+
9882
+ export interface PlanDetailModalProps extends React.HTMLAttributes<HTMLDivElement> {
9883
+ /** Whether the modal is open */
9884
+ open: boolean;
9885
+ /** Called when modal open state changes */
9886
+ onOpenChange: (open: boolean) => void;
9887
+ /** Modal title */
9888
+ title?: string;
9889
+ /** List of features to display in the table */
9890
+ features?: PlanFeature[];
9891
+ /** Plan price label (e.g., "\u20B9 2,500.00/month") */
9892
+ planPrice?: string;
9893
+ /** Called when close button is clicked */
9894
+ onClose?: () => void;
9895
+ }
9896
+ `, prefix)
9897
+ },
9898
+ {
9899
+ name: "index.ts",
9900
+ content: prefixTailwindClasses(`export { PlanDetailModal } from "./plan-detail-modal";
9901
+ export type { PlanDetailModalProps, PlanFeature } from "./types";
9676
9902
  `, prefix)
9677
9903
  }
9678
9904
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.201",
3
+ "version": "0.0.203",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",