myoperator-ui 0.0.130 → 0.0.132

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 +159 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -619,7 +619,7 @@ const mapColorClassName: { [key in Color]: string } = {
619
619
  primary: "text-semantic-text-primary",
620
620
  secondary: "text-semantic-text-secondary",
621
621
  muted: "text-semantic-text-muted",
622
- placeholder: "text-semantic-text-placeholder",
622
+ placeholder: "tw-text-semantic-text-placeholder",
623
623
  link: "text-semantic-text-link",
624
624
  inverted: "text-semantic-text-inverted",
625
625
  error: "text-semantic-error-primary",
@@ -2867,7 +2867,7 @@ const DialogContent = React.forwardRef<
2867
2867
  <DialogOverlay />
2868
2868
  <DialogPrimitive.Content
2869
2869
  ref={ref}
2870
- className={cn(dialogContentVariants({ size, className }))}
2870
+ className={cn(dialogContentVariants({ size }), className)}
2871
2871
  {...props}
2872
2872
  >
2873
2873
  {children}
@@ -3380,7 +3380,7 @@ const DeleteConfirmationModal = React.forwardRef<
3380
3380
  <DialogContent ref={ref} size="sm" className={cn(className)}>
3381
3381
  <DialogHeader>
3382
3382
  <DialogTitle>{title || defaultTitle}</DialogTitle>
3383
- <DialogDescription className={description ? undefined : "sr-only"}>
3383
+ <DialogDescription className={description ? undefined : "tw-sr-only"}>
3384
3384
  {description ||
3385
3385
  "Delete confirmation dialog - this action cannot be undone"}
3386
3386
  </DialogDescription>
@@ -3570,6 +3570,161 @@ const ConfirmationModal = React.forwardRef<
3570
3570
  ConfirmationModal.displayName = "ConfirmationModal";
3571
3571
 
3572
3572
  export { ConfirmationModal };
3573
+ `, prefix)
3574
+ }
3575
+ ]
3576
+ },
3577
+ "form-modal": {
3578
+ name: "form-modal",
3579
+ description: "A reusable modal component for forms with consistent layout",
3580
+ dependencies: [
3581
+ "clsx",
3582
+ "tailwind-merge"
3583
+ ],
3584
+ internalDependencies: [
3585
+ "dialog",
3586
+ "button"
3587
+ ],
3588
+ files: [
3589
+ {
3590
+ name: "form-modal.tsx",
3591
+ content: prefixTailwindClasses(`import * as React from "react";
3592
+
3593
+ import { cn } from "../../lib/utils";
3594
+ import {
3595
+ Dialog,
3596
+ DialogContent,
3597
+ DialogHeader,
3598
+ DialogFooter,
3599
+ DialogTitle,
3600
+ DialogDescription,
3601
+ } from "./dialog";
3602
+ import { Button } from "./button";
3603
+
3604
+ /**
3605
+ * Props for the FormModal component
3606
+ */
3607
+ export interface FormModalProps {
3608
+ /** Controls modal visibility (controlled mode) */
3609
+ open: boolean;
3610
+ /** Callback when open state changes */
3611
+ onOpenChange: (open: boolean) => void;
3612
+ /** Modal title */
3613
+ title: React.ReactNode;
3614
+ /** Optional modal description */
3615
+ description?: React.ReactNode;
3616
+ /** Form content (inputs, selects, etc.) */
3617
+ children: React.ReactNode;
3618
+ /** Called when user saves/submits the form */
3619
+ onSave?: () => void;
3620
+ /** Called when user cancels */
3621
+ onCancel?: () => void;
3622
+ /** Loading state for save button */
3623
+ loading?: boolean;
3624
+ /** Text for save button (default: "Save") */
3625
+ saveButtonText?: string;
3626
+ /** Text for cancel button (default: "Cancel") */
3627
+ cancelButtonText?: string;
3628
+ /** Disable the save button */
3629
+ disableSave?: boolean;
3630
+ /** Additional className for the dialog content */
3631
+ className?: string;
3632
+ /** Size of the dialog */
3633
+ size?: "sm" | "default" | "lg" | "xl" | "full";
3634
+ }
3635
+
3636
+ /**
3637
+ * A reusable modal component for forms with inputs, selects, and other form controls.
3638
+ * Provides consistent layout and spacing for form-based dialogs.
3639
+ *
3640
+ * @example
3641
+ * Basic usage with form fields
3642
+ *
3643
+ * \`\`\`tsx
3644
+ * const [isOpen, setIsOpen] = useState(false);
3645
+ * const [name, setName] = useState('');
3646
+ *
3647
+ * <FormModal
3648
+ * open={isOpen}
3649
+ * onOpenChange={setIsOpen}
3650
+ * title="Edit Profile"
3651
+ * description="Make changes to your profile here."
3652
+ * onSave={handleSave}
3653
+ * loading={loading}
3654
+ * >
3655
+ * <div className="grid gap-2">
3656
+ * <label htmlFor="name">Name</label>
3657
+ * <Input id="name" value={name} onChange={e => setName(e.target.value)} />
3658
+ * </div>
3659
+ * </FormModal>
3660
+ * \`\`\`
3661
+ */
3662
+ const FormModal = React.forwardRef<HTMLDivElement, FormModalProps>(
3663
+ (
3664
+ {
3665
+ open,
3666
+ onOpenChange,
3667
+ title,
3668
+ description,
3669
+ children,
3670
+ onSave,
3671
+ onCancel,
3672
+ loading = false,
3673
+ saveButtonText = "Save",
3674
+ cancelButtonText = "Cancel",
3675
+ disableSave = false,
3676
+ className,
3677
+ size = "sm",
3678
+ },
3679
+ ref
3680
+ ) => {
3681
+ const handleSave = () => {
3682
+ onSave?.();
3683
+ };
3684
+
3685
+ const handleCancel = () => {
3686
+ onCancel?.();
3687
+ onOpenChange?.(false);
3688
+ };
3689
+
3690
+ return (
3691
+ <Dialog open={open} onOpenChange={onOpenChange}>
3692
+ <DialogContent ref={ref} size={size} className={cn(className)}>
3693
+ <DialogHeader>
3694
+ <DialogTitle>{title}</DialogTitle>
3695
+ {description && (
3696
+ <DialogDescription>{description}</DialogDescription>
3697
+ )}
3698
+ </DialogHeader>
3699
+
3700
+ {/* Form content with consistent spacing */}
3701
+ <div className="grid gap-4 py-4">{children}</div>
3702
+
3703
+ <DialogFooter className="gap-2 sm:gap-0">
3704
+ <Button
3705
+ variant="outline"
3706
+ onClick={handleCancel}
3707
+ disabled={loading}
3708
+ >
3709
+ {cancelButtonText}
3710
+ </Button>
3711
+ <Button
3712
+ variant="default"
3713
+ onClick={handleSave}
3714
+ disabled={loading || disableSave}
3715
+ loading={loading}
3716
+ >
3717
+ {saveButtonText}
3718
+ </Button>
3719
+ </DialogFooter>
3720
+ </DialogContent>
3721
+ </Dialog>
3722
+ );
3723
+ }
3724
+ );
3725
+ FormModal.displayName = "FormModal";
3726
+
3727
+ export { FormModal };
3573
3728
  `, prefix)
3574
3729
  }
3575
3730
  ]
@@ -4292,7 +4447,7 @@ function useToast() {
4292
4447
  listeners.splice(index, 1);
4293
4448
  }
4294
4449
  };
4295
- }, [state]);
4450
+ }, []);
4296
4451
 
4297
4452
  return {
4298
4453
  ...state,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.130",
3
+ "version": "0.0.132",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",