myoperator-ui 0.0.202 → 0.0.204-beta.0

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 +201 -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>
@@ -12527,6 +12560,173 @@ export interface WalletTopupProps {
12527
12560
  name: "index.ts",
12528
12561
  content: prefixTailwindClasses(`export { WalletTopup } from "./wallet-topup";
12529
12562
  export type { WalletTopupProps, AmountOption } from "./types";
12563
+ `, prefix)
12564
+ }
12565
+ ]
12566
+ },
12567
+ "service-pricing-panel": {
12568
+ name: "service-pricing-panel",
12569
+ description: "A pricing panel card displaying managed service pricing with billing cycle badge, price, description, details toggle, and CTA button",
12570
+ category: "custom",
12571
+ dependencies: [
12572
+ "clsx",
12573
+ "tailwind-merge"
12574
+ ],
12575
+ internalDependencies: [
12576
+ "button",
12577
+ "badge"
12578
+ ],
12579
+ isMultiFile: true,
12580
+ directory: "service-pricing-panel",
12581
+ mainFile: "service-pricing-panel.tsx",
12582
+ files: [
12583
+ {
12584
+ name: "service-pricing-panel.tsx",
12585
+ content: prefixTailwindClasses(`import * as React from "react";
12586
+ import { cn } from "../../../lib/utils";
12587
+ import { Button } from "../button";
12588
+ import { Badge } from "../badge";
12589
+ import type { ServicePricingPanelProps } from "./types";
12590
+
12591
+ const ServicePricingPanel = React.forwardRef<
12592
+ HTMLDivElement,
12593
+ ServicePricingPanelProps
12594
+ >(
12595
+ (
12596
+ {
12597
+ className,
12598
+ title = "Managed Prices",
12599
+ billingCycle,
12600
+ startsAtLabel = "Starts at",
12601
+ price,
12602
+ period = "/month",
12603
+ description,
12604
+ hideDetailsLabel = "Don't Show details",
12605
+ showDetailsLabel = "Show details",
12606
+ ctaText = "Talk to us",
12607
+ defaultShowDetails = true,
12608
+ onCtaClick,
12609
+ onToggleDetails,
12610
+ ...props
12611
+ },
12612
+ ref
12613
+ ) => {
12614
+ const [detailsVisible, setDetailsVisible] =
12615
+ React.useState(defaultShowDetails);
12616
+
12617
+ const handleToggle = () => {
12618
+ const next = !detailsVisible;
12619
+ setDetailsVisible(next);
12620
+ onToggleDetails?.(next);
12621
+ };
12622
+
12623
+ return (
12624
+ <div
12625
+ ref={ref}
12626
+ className={cn(
12627
+ "bg-semantic-bg-primary border border-semantic-border-layout rounded-2xl p-5 flex flex-col gap-2.5 w-full",
12628
+ className
12629
+ )}
12630
+ {...props}
12631
+ >
12632
+ {/* Header row: title + billing cycle badge */}
12633
+ <div className="flex items-center justify-between h-6">
12634
+ <p className="m-0 text-base font-semibold text-semantic-text-primary whitespace-nowrap">
12635
+ {title}
12636
+ </p>
12637
+ {billingCycle && (
12638
+ <Badge
12639
+ variant="default"
12640
+ size="sm"
12641
+ className="bg-semantic-info-surface text-semantic-info-primary rounded-full px-2 py-1"
12642
+ >
12643
+ {billingCycle}
12644
+ </Badge>
12645
+ )}
12646
+ </div>
12647
+
12648
+ {/* Price + description section */}
12649
+ <div className="flex flex-col gap-2.5">
12650
+ <div className="flex flex-col gap-0.5">
12651
+ <p className="m-0 text-xs text-semantic-text-muted tracking-wide whitespace-nowrap">{startsAtLabel}</p>
12652
+ <div className="flex items-end gap-1">
12653
+ <p className="m-0 text-[28px] font-semibold leading-9 text-semantic-text-primary whitespace-nowrap">
12654
+ {price}
12655
+ </p>
12656
+ <p className="m-0 text-sm text-semantic-text-muted pb-0.5">
12657
+ {period}
12658
+ </p>
12659
+ </div>
12660
+ </div>
12661
+ {description && (
12662
+ <p className="m-0 text-sm text-semantic-text-secondary">
12663
+ {description}
12664
+ </p>
12665
+ )}
12666
+ </div>
12667
+
12668
+ {/* Toggle link + CTA button */}
12669
+ <div className="flex flex-col gap-3">
12670
+ <button
12671
+ type="button"
12672
+ onClick={handleToggle}
12673
+ className="m-0 text-sm font-semibold text-semantic-text-link text-left bg-transparent border-0 p-0 cursor-pointer w-fit"
12674
+ >
12675
+ {detailsVisible ? hideDetailsLabel : showDetailsLabel}
12676
+ </button>
12677
+ <Button variant="outline" className="w-full" onClick={onCtaClick}>
12678
+ {ctaText}
12679
+ </Button>
12680
+ </div>
12681
+ </div>
12682
+ );
12683
+ }
12684
+ );
12685
+ ServicePricingPanel.displayName = "ServicePricingPanel";
12686
+
12687
+ export { ServicePricingPanel };
12688
+ `, prefix)
12689
+ },
12690
+ {
12691
+ name: "types.ts",
12692
+ content: prefixTailwindClasses(`import * as React from "react";
12693
+
12694
+ /**
12695
+ * Props for the ServicePricingPanel component.
12696
+ */
12697
+ export interface ServicePricingPanelProps
12698
+ extends React.HTMLAttributes<HTMLDivElement> {
12699
+ /** Panel title displayed in the header (e.g., "Managed Prices") */
12700
+ title?: string;
12701
+ /** Billing cycle label displayed as a badge (e.g., "Quarterly", "Monthly") */
12702
+ billingCycle?: string;
12703
+ /** Label above the price (default: "Starts at") */
12704
+ startsAtLabel?: string;
12705
+ /** Formatted price string (e.g., "\u20B950,000") */
12706
+ price: string;
12707
+ /** Billing period suffix (default: "/month") */
12708
+ period?: string;
12709
+ /** Supporting description text shown below the price */
12710
+ description?: string;
12711
+ /** Label for the toggle link when details are visible (default: "Don't Show details") */
12712
+ hideDetailsLabel?: string;
12713
+ /** Label for the toggle link when details are hidden (default: "Show details") */
12714
+ showDetailsLabel?: string;
12715
+ /** CTA button text (default: "Talk to us") */
12716
+ ctaText?: string;
12717
+ /** Whether details are shown by default (default: true) */
12718
+ defaultShowDetails?: boolean;
12719
+ /** Callback when the CTA button is clicked */
12720
+ onCtaClick?: () => void;
12721
+ /** Callback when the toggle link is clicked, receives the new visibility state */
12722
+ onToggleDetails?: (detailsVisible: boolean) => void;
12723
+ }
12724
+ `, prefix)
12725
+ },
12726
+ {
12727
+ name: "index.ts",
12728
+ content: prefixTailwindClasses(`export { ServicePricingPanel } from "./service-pricing-panel";
12729
+ export type { ServicePricingPanelProps } from "./types";
12530
12730
  `, prefix)
12531
12731
  }
12532
12732
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.202",
3
+ "version": "0.0.204-beta.0",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",