myoperator-ui 0.0.181 → 0.0.182-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 +200 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10599,6 +10599,206 @@ export interface PricingToggleProps
10599
10599
  name: "index.ts",
10600
10600
  content: prefixTailwindClasses(`export { PricingToggle } from "./pricing-toggle";
10601
10601
  export type { PricingToggleProps, PricingToggleTab } from "./types";
10602
+ `, prefix)
10603
+ }
10604
+ ]
10605
+ },
10606
+ "talk-to-us-modal": {
10607
+ name: "talk-to-us-modal",
10608
+ description: "A modal dialog with icon, heading, description, and two action buttons prompting users to contact support. Triggered by PowerUpCard's Talk to us button.",
10609
+ category: "custom",
10610
+ dependencies: [
10611
+ "clsx",
10612
+ "tailwind-merge",
10613
+ "@radix-ui/react-dialog"
10614
+ ],
10615
+ internalDependencies: [
10616
+ "button",
10617
+ "dialog"
10618
+ ],
10619
+ isMultiFile: true,
10620
+ directory: "talk-to-us-modal",
10621
+ mainFile: "talk-to-us-modal.tsx",
10622
+ files: [
10623
+ {
10624
+ name: "talk-to-us-modal.tsx",
10625
+ content: prefixTailwindClasses(`import * as React from "react";
10626
+ import { cn } from "../../../lib/utils";
10627
+ import { MyOperatorChatIcon } from "./icon";
10628
+ import { Button } from "../button";
10629
+ import {
10630
+ Dialog,
10631
+ DialogContent,
10632
+ DialogTitle,
10633
+ DialogDescription,
10634
+ } from "../dialog";
10635
+ import type { TalkToUsModalProps } from "./types";
10636
+
10637
+ /**
10638
+ * TalkToUsModal is a dialog that prompts users to contact support.
10639
+ * Features a centered icon, heading, description, and two action buttons
10640
+ * (cancel + primary CTA).
10641
+ *
10642
+ * Used on the pricing page when a power-up or plan requires sales contact.
10643
+ * Typically triggered by the PowerUpCard's "Talk to us" button.
10644
+ *
10645
+ * @example
10646
+ * \`\`\`tsx
10647
+ * const [open, setOpen] = useState(false);
10648
+ *
10649
+ * <PowerUpCard onCtaClick={() => setOpen(true)} ... />
10650
+ * <TalkToUsModal
10651
+ * open={open}
10652
+ * onOpenChange={setOpen}
10653
+ * onPrimaryAction={() => window.open("mailto:support@myoperator.com")}
10654
+ * />
10655
+ * \`\`\`
10656
+ */
10657
+ const TalkToUsModal: React.FC<TalkToUsModalProps> = ({
10658
+ open,
10659
+ onOpenChange,
10660
+ title = "Let's Talk!",
10661
+ description = "Please contact our team for more details. We're here to help you choose the right plan.",
10662
+ icon,
10663
+ primaryActionLabel = "Contact support",
10664
+ secondaryActionLabel = "Cancel",
10665
+ onPrimaryAction,
10666
+ onSecondaryAction,
10667
+ className,
10668
+ }) => {
10669
+ const handleSecondaryAction = () => {
10670
+ onSecondaryAction?.();
10671
+ onOpenChange?.(false);
10672
+ };
10673
+
10674
+ return (
10675
+ <Dialog open={open} onOpenChange={onOpenChange}>
10676
+ <DialogContent
10677
+ size="sm"
10678
+ hideCloseButton
10679
+ className={cn("p-0", className)}
10680
+ >
10681
+ <div className="flex flex-col items-center gap-6 px-[60px] py-10 text-center">
10682
+ {/* Icon + Text section */}
10683
+ <div className="flex flex-col items-center gap-[18px]">
10684
+ {icon ?? <MyOperatorChatIcon />}
10685
+ <div className="flex flex-col gap-1">
10686
+ <DialogTitle className="m-0 text-base font-semibold text-semantic-text-primary">
10687
+ {title}
10688
+ </DialogTitle>
10689
+ <DialogDescription className="m-0 text-sm tracking-[0.035px] text-semantic-text-muted">
10690
+ {description}
10691
+ </DialogDescription>
10692
+ </div>
10693
+ </div>
10694
+
10695
+ {/* Action buttons */}
10696
+ <div className="flex items-center gap-4">
10697
+ <Button variant="outline" onClick={handleSecondaryAction}>
10698
+ {secondaryActionLabel}
10699
+ </Button>
10700
+ <Button onClick={onPrimaryAction}>{primaryActionLabel}</Button>
10701
+ </div>
10702
+ </div>
10703
+ </DialogContent>
10704
+ </Dialog>
10705
+ );
10706
+ };
10707
+
10708
+ TalkToUsModal.displayName = "TalkToUsModal";
10709
+
10710
+ export { TalkToUsModal };
10711
+ `, prefix)
10712
+ },
10713
+ {
10714
+ name: "icon.tsx",
10715
+ content: prefixTailwindClasses(`import * as React from "react";
10716
+
10717
+ interface BrandIconProps extends React.SVGAttributes<SVGElement> {
10718
+ className?: string;
10719
+ }
10720
+
10721
+ /**
10722
+ * MyOperator branded chat icon \u2014 teal speech-bubble with white phone
10723
+ * on a light gray circle. Extracted from the Figma design system.
10724
+ *
10725
+ * Used in TalkToUsModal and available for any component that needs
10726
+ * the MyOperator contact/chat branding.
10727
+ */
10728
+ const MyOperatorChatIcon = React.forwardRef<SVGSVGElement, BrandIconProps>(
10729
+ ({ className, ...props }, ref) => (
10730
+ <svg
10731
+ ref={ref}
10732
+ className={className}
10733
+ width="61"
10734
+ height="61"
10735
+ viewBox="0 0 61 61"
10736
+ fill="none"
10737
+ xmlns="http://www.w3.org/2000/svg"
10738
+ aria-hidden="true"
10739
+ {...props}
10740
+ >
10741
+ <circle cx="30.6" cy="30.6" r="30.6" fill="#F3F5F6" />
10742
+ <g transform="translate(14.1, 13.6)">
10743
+ <path
10744
+ d="M32.9562 21.4404C31.5008 27.6441 26.7424 32.5167 20.7061 33.9765L28.3074 33.932C28.4772 33.9415 28.6454 33.94 28.8121 33.9288H28.8168C30.9282 33.7825 32.6846 32.0523 32.8821 29.8466V29.8355C32.9038 29.5906 32.9084 29.3393 32.8883 29.0833L32.9562 21.4404Z"
10745
+ fill="#DBDBDB"
10746
+ />
10747
+ <path
10748
+ d="M0.0664 29.1656C0.0571 29.3405 0.0587 29.5138 0.0695 29.6856V29.6904C0.2114 31.8659 1.8907 33.6756 4.0314 33.8791H4.0422C4.28 33.9014 4.5238 33.9062 4.7723 33.8855L16.2646 33.9936C16.3433 33.9936 16.4205 34 16.4992 34C16.5363 34 16.5718 33.9968 16.6088 33.9968L16.9129 34L16.9098 33.9889C25.8323 33.7646 33 26.2458 33 16.9984C33 7.751 25.6116 0 16.4992 0C7.3868 0 0 7.611 0 17L0.0664 29.1656Z"
10749
+ fill="#2BBBC9"
10750
+ />
10751
+ <path
10752
+ d="M23.7962 20.8195C23.398 20.6143 21.444 19.6236 21.0797 19.4868C20.7155 19.3501 20.45 19.2817 20.1846 19.692C19.9191 20.1023 19.1582 21.0246 18.9251 21.2982C18.6936 21.5717 18.4605 21.6051 18.0639 21.4015C17.6672 21.1964 16.3862 20.7638 14.8674 19.3676C13.6852 18.2814 12.8872 16.9408 12.6557 16.5305C12.4242 16.1202 12.631 15.8992 12.8301 15.694C13.0092 15.5096 13.2283 15.2154 13.4274 14.9768C13.6265 14.7383 13.6929 14.5665 13.8241 14.293C13.9568 14.0195 13.8905 13.781 13.7917 13.5758C13.6929 13.3707 12.898 11.3542 12.5662 10.5336C12.2436 9.7353 11.9149 9.8434 11.671 9.8307C11.4395 9.818 11.174 9.8164 10.9086 9.8164C10.6431 9.8164 10.2125 9.9182 9.8482 10.3285C9.484 10.7388 8.4561 11.7295 8.4561 13.746C8.4561 15.7624 9.8806 17.7105 10.0797 17.984C10.2788 18.2576 12.8826 22.3939 16.8708 24.1702C17.8185 24.5916 18.5593 24.8445 19.1366 25.0337C20.0889 25.3454 20.9563 25.3009 21.6415 25.1959C22.4055 25.0782 23.9937 24.2052 24.3256 23.2494C24.6574 22.2921 24.6574 21.4715 24.5571 21.3013C24.4583 21.1312 24.1928 21.0278 23.7946 20.8227"
10753
+ fill="white"
10754
+ />
10755
+ </g>
10756
+ </svg>
10757
+ )
10758
+ );
10759
+ MyOperatorChatIcon.displayName = "MyOperatorChatIcon";
10760
+
10761
+ export { MyOperatorChatIcon };
10762
+ export type { BrandIconProps };
10763
+ `, prefix)
10764
+ },
10765
+ {
10766
+ name: "types.ts",
10767
+ content: prefixTailwindClasses(`import * as React from "react";
10768
+
10769
+ /**
10770
+ * Props for the TalkToUsModal component.
10771
+ */
10772
+ export interface TalkToUsModalProps {
10773
+ /** Whether the modal is open */
10774
+ open?: boolean;
10775
+ /** Callback when open state changes */
10776
+ onOpenChange?: (open: boolean) => void;
10777
+ /** Heading text (default: "Let's Talk!") */
10778
+ title?: string;
10779
+ /** Description text below the heading */
10780
+ description?: string;
10781
+ /** Custom icon element. Defaults to a phone icon in a circular badge */
10782
+ icon?: React.ReactNode;
10783
+ /** Label for the primary action button (default: "Contact support") */
10784
+ primaryActionLabel?: string;
10785
+ /** Label for the secondary action button (default: "Cancel") */
10786
+ secondaryActionLabel?: string;
10787
+ /** Callback when primary action button is clicked */
10788
+ onPrimaryAction?: () => void;
10789
+ /** Callback when secondary action button is clicked (also closes the modal) */
10790
+ onSecondaryAction?: () => void;
10791
+ /** Additional className for the dialog content */
10792
+ className?: string;
10793
+ }
10794
+ `, prefix)
10795
+ },
10796
+ {
10797
+ name: "index.ts",
10798
+ content: prefixTailwindClasses(`export { TalkToUsModal } from "./talk-to-us-modal";
10799
+ export type { TalkToUsModalProps } from "./types";
10800
+ export { MyOperatorChatIcon } from "./icon";
10801
+ export type { BrandIconProps } from "./icon";
10602
10802
  `, prefix)
10603
10803
  }
10604
10804
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.181",
3
+ "version": "0.0.182-beta.0",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",