myoperator-ui 0.0.97 → 0.0.99
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 +206 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3153,6 +3153,11 @@ export {
|
|
|
3153
3153
|
"clsx",
|
|
3154
3154
|
"tailwind-merge"
|
|
3155
3155
|
],
|
|
3156
|
+
internalDependencies: [
|
|
3157
|
+
"dialog",
|
|
3158
|
+
"button",
|
|
3159
|
+
"input"
|
|
3160
|
+
],
|
|
3156
3161
|
files: [
|
|
3157
3162
|
{
|
|
3158
3163
|
name: "delete-confirmation-modal.tsx",
|
|
@@ -3334,6 +3339,10 @@ export { DeleteConfirmationModal };
|
|
|
3334
3339
|
"clsx",
|
|
3335
3340
|
"tailwind-merge"
|
|
3336
3341
|
],
|
|
3342
|
+
internalDependencies: [
|
|
3343
|
+
"dialog",
|
|
3344
|
+
"button"
|
|
3345
|
+
],
|
|
3337
3346
|
files: [
|
|
3338
3347
|
{
|
|
3339
3348
|
name: "confirmation-modal.tsx",
|
|
@@ -3833,6 +3842,203 @@ const AlertDescription = React.forwardRef<
|
|
|
3833
3842
|
AlertDescription.displayName = "AlertDescription";
|
|
3834
3843
|
|
|
3835
3844
|
export { Alert, AlertTitle, AlertDescription, alertVariants };
|
|
3845
|
+
`, prefix)
|
|
3846
|
+
}
|
|
3847
|
+
]
|
|
3848
|
+
},
|
|
3849
|
+
"toast": {
|
|
3850
|
+
name: "toast",
|
|
3851
|
+
description: "A toast notification component for displaying brief messages at screen corners, with auto-dismiss and stacking support",
|
|
3852
|
+
dependencies: [
|
|
3853
|
+
"sonner",
|
|
3854
|
+
"clsx",
|
|
3855
|
+
"tailwind-merge"
|
|
3856
|
+
],
|
|
3857
|
+
files: [
|
|
3858
|
+
{
|
|
3859
|
+
name: "toast.tsx",
|
|
3860
|
+
content: prefixTailwindClasses(`import { Toaster as SonnerToaster, toast } from "sonner";
|
|
3861
|
+
|
|
3862
|
+
import { cn } from "../../lib/utils";
|
|
3863
|
+
|
|
3864
|
+
/**
|
|
3865
|
+
* Position options for the toast container.
|
|
3866
|
+
*/
|
|
3867
|
+
export type ToastPosition =
|
|
3868
|
+
| "top-left"
|
|
3869
|
+
| "top-center"
|
|
3870
|
+
| "top-right"
|
|
3871
|
+
| "bottom-left"
|
|
3872
|
+
| "bottom-center"
|
|
3873
|
+
| "bottom-right";
|
|
3874
|
+
|
|
3875
|
+
/**
|
|
3876
|
+
* Props for the Toaster component.
|
|
3877
|
+
*/
|
|
3878
|
+
export interface ToasterProps {
|
|
3879
|
+
/** Position of the toast container (default: "bottom-right") */
|
|
3880
|
+
position?: ToastPosition;
|
|
3881
|
+
/** Whether to show the close button on toasts (default: true) */
|
|
3882
|
+
closeButton?: boolean;
|
|
3883
|
+
/** Duration in milliseconds before toast auto-dismisses (default: 4000) */
|
|
3884
|
+
duration?: number;
|
|
3885
|
+
/** Gap between toasts in pixels (default: 8) */
|
|
3886
|
+
gap?: number;
|
|
3887
|
+
/** Offset from the edge of the screen in pixels (default: 16) */
|
|
3888
|
+
offset?: number | string;
|
|
3889
|
+
/** Whether to expand toasts on hover (default: true) */
|
|
3890
|
+
expand?: boolean;
|
|
3891
|
+
/** Whether toasts are visually stacked (default: true) */
|
|
3892
|
+
visibleToasts?: number;
|
|
3893
|
+
/** Custom class name for the toaster container */
|
|
3894
|
+
className?: string;
|
|
3895
|
+
/** Rich colors mode - uses more vibrant background colors */
|
|
3896
|
+
richColors?: boolean;
|
|
3897
|
+
}
|
|
3898
|
+
|
|
3899
|
+
/**
|
|
3900
|
+
* Toast container component that renders toast notifications.
|
|
3901
|
+
* Place this component once at the root of your app (e.g., in App.tsx or layout).
|
|
3902
|
+
*
|
|
3903
|
+
* @example
|
|
3904
|
+
* \`\`\`tsx
|
|
3905
|
+
* // In your App.tsx or layout
|
|
3906
|
+
* import { Toaster } from "@/components/ui/toast"
|
|
3907
|
+
*
|
|
3908
|
+
* function App() {
|
|
3909
|
+
* return (
|
|
3910
|
+
* <>
|
|
3911
|
+
* <YourApp />
|
|
3912
|
+
* <Toaster />
|
|
3913
|
+
* </>
|
|
3914
|
+
* )
|
|
3915
|
+
* }
|
|
3916
|
+
* \`\`\`
|
|
3917
|
+
*/
|
|
3918
|
+
function Toaster({
|
|
3919
|
+
position = "bottom-right",
|
|
3920
|
+
closeButton = true,
|
|
3921
|
+
duration = 4000,
|
|
3922
|
+
gap = 8,
|
|
3923
|
+
offset = 16,
|
|
3924
|
+
expand = true,
|
|
3925
|
+
visibleToasts = 3,
|
|
3926
|
+
className,
|
|
3927
|
+
richColors = true,
|
|
3928
|
+
...props
|
|
3929
|
+
}: ToasterProps) {
|
|
3930
|
+
return (
|
|
3931
|
+
<SonnerToaster
|
|
3932
|
+
position={position}
|
|
3933
|
+
closeButton={closeButton}
|
|
3934
|
+
duration={duration}
|
|
3935
|
+
gap={gap}
|
|
3936
|
+
offset={offset}
|
|
3937
|
+
expand={expand}
|
|
3938
|
+
visibleToasts={visibleToasts}
|
|
3939
|
+
richColors={richColors}
|
|
3940
|
+
className={cn("toaster group", className)}
|
|
3941
|
+
toastOptions={{
|
|
3942
|
+
classNames: {
|
|
3943
|
+
toast: cn(
|
|
3944
|
+
"group toast",
|
|
3945
|
+
"group-[.toaster]:bg-white group-[.toaster]:text-[#181D27]",
|
|
3946
|
+
"group-[.toaster]:border group-[.toaster]:border-[#E9EAEB]",
|
|
3947
|
+
"group-[.toaster]:shadow-lg group-[.toaster]:rounded-lg",
|
|
3948
|
+
"group-[.toaster]:p-4"
|
|
3949
|
+
),
|
|
3950
|
+
title: "group-[.toast]:font-semibold group-[.toast]:text-[#181D27]",
|
|
3951
|
+
description: "group-[.toast]:text-sm group-[.toast]:text-[#717680]",
|
|
3952
|
+
actionButton: cn(
|
|
3953
|
+
"group-[.toast]:bg-[#4275D6] group-[.toast]:text-white",
|
|
3954
|
+
"group-[.toast]:rounded group-[.toast]:px-3 group-[.toast]:py-1.5",
|
|
3955
|
+
"group-[.toast]:text-sm group-[.toast]:font-medium"
|
|
3956
|
+
),
|
|
3957
|
+
cancelButton: cn(
|
|
3958
|
+
"group-[.toast]:bg-[#F5F5F5] group-[.toast]:text-[#181D27]",
|
|
3959
|
+
"group-[.toast]:rounded group-[.toast]:px-3 group-[.toast]:py-1.5",
|
|
3960
|
+
"group-[.toast]:text-sm group-[.toast]:font-medium"
|
|
3961
|
+
),
|
|
3962
|
+
closeButton: cn(
|
|
3963
|
+
"group-[.toast]:text-[#717680]",
|
|
3964
|
+
"group-[.toast]:hover:text-[#181D27]",
|
|
3965
|
+
"group-[.toast]:border-[#E9EAEB]",
|
|
3966
|
+
"group-[.toast]:bg-white"
|
|
3967
|
+
),
|
|
3968
|
+
// Variant-specific styles (when richColors is true)
|
|
3969
|
+
success: cn(
|
|
3970
|
+
"group-[.toaster]:bg-[#ECFDF3] group-[.toaster]:border-[#17B26A]/20",
|
|
3971
|
+
"group-[.toaster]:text-[#067647]",
|
|
3972
|
+
"[&_[data-icon]]:text-[#17B26A]"
|
|
3973
|
+
),
|
|
3974
|
+
error: cn(
|
|
3975
|
+
"group-[.toaster]:bg-[#FEF3F2] group-[.toaster]:border-[#F04438]/20",
|
|
3976
|
+
"group-[.toaster]:text-[#B42318]",
|
|
3977
|
+
"[&_[data-icon]]:text-[#F04438]"
|
|
3978
|
+
),
|
|
3979
|
+
warning: cn(
|
|
3980
|
+
"group-[.toaster]:bg-[#FFFAEB] group-[.toaster]:border-[#F79009]/20",
|
|
3981
|
+
"group-[.toaster]:text-[#B54708]",
|
|
3982
|
+
"[&_[data-icon]]:text-[#F79009]"
|
|
3983
|
+
),
|
|
3984
|
+
info: cn(
|
|
3985
|
+
"group-[.toaster]:bg-[#EBF5FF] group-[.toaster]:border-[#4275D6]/20",
|
|
3986
|
+
"group-[.toaster]:text-[#1849A9]",
|
|
3987
|
+
"[&_[data-icon]]:text-[#4275D6]"
|
|
3988
|
+
),
|
|
3989
|
+
},
|
|
3990
|
+
}}
|
|
3991
|
+
{...props}
|
|
3992
|
+
/>
|
|
3993
|
+
);
|
|
3994
|
+
}
|
|
3995
|
+
|
|
3996
|
+
// Re-export toast function with our custom types
|
|
3997
|
+
export { Toaster, toast };
|
|
3998
|
+
|
|
3999
|
+
/**
|
|
4000
|
+
* Convenience functions for common toast types.
|
|
4001
|
+
*
|
|
4002
|
+
* @example
|
|
4003
|
+
* \`\`\`tsx
|
|
4004
|
+
* import { toast } from "@/components/ui/toast"
|
|
4005
|
+
*
|
|
4006
|
+
* // Simple message
|
|
4007
|
+
* toast("Event has been created")
|
|
4008
|
+
*
|
|
4009
|
+
* // With description
|
|
4010
|
+
* toast.success("Success!", {
|
|
4011
|
+
* description: "Your changes have been saved."
|
|
4012
|
+
* })
|
|
4013
|
+
*
|
|
4014
|
+
* // Error toast
|
|
4015
|
+
* toast.error("Error", {
|
|
4016
|
+
* description: "Something went wrong. Please try again."
|
|
4017
|
+
* })
|
|
4018
|
+
*
|
|
4019
|
+
* // With action button
|
|
4020
|
+
* toast("Event created", {
|
|
4021
|
+
* action: {
|
|
4022
|
+
* label: "Undo",
|
|
4023
|
+
* onClick: () => console.log("Undo clicked")
|
|
4024
|
+
* }
|
|
4025
|
+
* })
|
|
4026
|
+
*
|
|
4027
|
+
* // Promise toast (shows loading, then success/error)
|
|
4028
|
+
* toast.promise(saveData(), {
|
|
4029
|
+
* loading: "Saving...",
|
|
4030
|
+
* success: "Saved successfully!",
|
|
4031
|
+
* error: "Failed to save"
|
|
4032
|
+
* })
|
|
4033
|
+
*
|
|
4034
|
+
* // Dismiss a specific toast
|
|
4035
|
+
* const toastId = toast("Message")
|
|
4036
|
+
* toast.dismiss(toastId)
|
|
4037
|
+
*
|
|
4038
|
+
* // Dismiss all toasts
|
|
4039
|
+
* toast.dismiss()
|
|
4040
|
+
* \`\`\`
|
|
4041
|
+
*/
|
|
3836
4042
|
`, prefix)
|
|
3837
4043
|
}
|
|
3838
4044
|
]
|