myoperator-ui 0.0.74 → 0.0.76

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 +233 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2564,6 +2564,69 @@ export {
2564
2564
  DropdownMenuSubTrigger,
2565
2565
  DropdownMenuRadioGroup,
2566
2566
  }
2567
+ `, prefix)
2568
+ }
2569
+ ]
2570
+ },
2571
+ "tooltip": {
2572
+ name: "tooltip",
2573
+ description: "A popup that displays information related to an element when hovered or focused",
2574
+ dependencies: [
2575
+ "@radix-ui/react-tooltip",
2576
+ "clsx",
2577
+ "tailwind-merge"
2578
+ ],
2579
+ files: [
2580
+ {
2581
+ name: "tooltip.tsx",
2582
+ content: prefixTailwindClasses(`import * as React from "react"
2583
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip"
2584
+
2585
+ import { cn } from "../../lib/utils"
2586
+
2587
+ const TooltipProvider = TooltipPrimitive.Provider
2588
+
2589
+ const Tooltip = TooltipPrimitive.Root
2590
+
2591
+ const TooltipTrigger = TooltipPrimitive.Trigger
2592
+
2593
+ const TooltipContent = React.forwardRef<
2594
+ React.ElementRef<typeof TooltipPrimitive.Content>,
2595
+ React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
2596
+ >(({ className, sideOffset = 4, ...props }, ref) => (
2597
+ <TooltipPrimitive.Portal>
2598
+ <TooltipPrimitive.Content
2599
+ ref={ref}
2600
+ sideOffset={sideOffset}
2601
+ className={cn(
2602
+ "z-50 overflow-hidden rounded-md bg-[#343E55] px-3 py-1.5 text-xs text-white shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2603
+ className
2604
+ )}
2605
+ {...props}
2606
+ />
2607
+ </TooltipPrimitive.Portal>
2608
+ ))
2609
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName
2610
+
2611
+ const TooltipArrow = React.forwardRef<
2612
+ React.ElementRef<typeof TooltipPrimitive.Arrow>,
2613
+ React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>
2614
+ >(({ className, ...props }, ref) => (
2615
+ <TooltipPrimitive.Arrow
2616
+ ref={ref}
2617
+ className={cn("fill-[#343E55]", className)}
2618
+ {...props}
2619
+ />
2620
+ ))
2621
+ TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName
2622
+
2623
+ export {
2624
+ Tooltip,
2625
+ TooltipTrigger,
2626
+ TooltipContent,
2627
+ TooltipArrow,
2628
+ TooltipProvider,
2629
+ }
2567
2630
  `, prefix)
2568
2631
  }
2569
2632
  ]
@@ -3059,6 +3122,176 @@ export {
3059
3122
  accordionTriggerVariants,
3060
3123
  accordionContentVariants,
3061
3124
  }
3125
+ `, prefix)
3126
+ }
3127
+ ]
3128
+ },
3129
+ "page-header": {
3130
+ name: "page-header",
3131
+ description: "A page header component with icon, title, description, and action buttons",
3132
+ dependencies: [
3133
+ "class-variance-authority",
3134
+ "clsx",
3135
+ "tailwind-merge",
3136
+ "lucide-react"
3137
+ ],
3138
+ files: [
3139
+ {
3140
+ name: "page-header.tsx",
3141
+ content: prefixTailwindClasses(`import * as React from "react"
3142
+ import { cva, type VariantProps } from "class-variance-authority"
3143
+ import { ArrowLeft } from "lucide-react"
3144
+
3145
+ import { cn } from "../../lib/utils"
3146
+
3147
+ /**
3148
+ * PageHeader variants for layout styles.
3149
+ */
3150
+ const pageHeaderVariants = cva(
3151
+ "flex items-center w-full bg-white",
3152
+ {
3153
+ variants: {},
3154
+ defaultVariants: {},
3155
+ }
3156
+ )
3157
+
3158
+ /**
3159
+ * Page header component for displaying page titles with optional icons and actions.
3160
+ *
3161
+ * @example
3162
+ * \`\`\`tsx
3163
+ * // Simple header with icon
3164
+ * <PageHeader
3165
+ * icon={<WebhookIcon />}
3166
+ * title="Webhooks"
3167
+ * description="Manage your webhook integrations"
3168
+ * />
3169
+ *
3170
+ * // Header with actions
3171
+ * <PageHeader
3172
+ * icon={<WebhookIcon />}
3173
+ * title="Webhooks"
3174
+ * description="Manage your webhook integrations"
3175
+ * actions={<Button>Add Webhook</Button>}
3176
+ * />
3177
+ *
3178
+ * // Header with back button
3179
+ * <PageHeader
3180
+ * showBackButton
3181
+ * onBackClick={() => navigate(-1)}
3182
+ * title="Edit Webhook"
3183
+ * description="Modify webhook settings"
3184
+ * actions={<><Button variant="outline">Cancel</Button><Button>Save</Button></>}
3185
+ * />
3186
+ * \`\`\`
3187
+ */
3188
+ export interface PageHeaderProps
3189
+ extends React.HTMLAttributes<HTMLDivElement>,
3190
+ VariantProps<typeof pageHeaderVariants> {
3191
+ /** Page title (required) */
3192
+ title: string
3193
+ /** Optional description/subtitle displayed below the title */
3194
+ description?: string
3195
+ /** Icon displayed on the left side (hidden when showBackButton is true) */
3196
+ icon?: React.ReactNode
3197
+ /** Shows back arrow button instead of icon */
3198
+ showBackButton?: boolean
3199
+ /** Callback when back button is clicked */
3200
+ onBackClick?: () => void
3201
+ /** Optional info icon displayed next to the title (e.g., tooltip trigger) */
3202
+ infoIcon?: React.ReactNode
3203
+ /** Action buttons/elements rendered on the right side */
3204
+ actions?: React.ReactNode
3205
+ }
3206
+
3207
+ const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(
3208
+ ({
3209
+ className,
3210
+ variant,
3211
+ title,
3212
+ description,
3213
+ icon,
3214
+ showBackButton = false,
3215
+ onBackClick,
3216
+ infoIcon,
3217
+ actions,
3218
+ ...props
3219
+ }, ref) => {
3220
+ // Determine what to show on the left: back button, icon, or nothing
3221
+ const renderLeftElement = () => {
3222
+ if (showBackButton) {
3223
+ return (
3224
+ <button
3225
+ type="button"
3226
+ onClick={onBackClick}
3227
+ className="flex items-center justify-center w-10 h-10 rounded hover:bg-[#F3F4F6] transition-colors text-[#333333]"
3228
+ aria-label="Go back"
3229
+ >
3230
+ <ArrowLeft className="w-5 h-5" />
3231
+ </button>
3232
+ )
3233
+ }
3234
+ if (icon) {
3235
+ return (
3236
+ <div className="flex items-center justify-center w-10 h-10 [&_svg]:w-6 [&_svg]:h-6 text-[#6B7280]">
3237
+ {icon}
3238
+ </div>
3239
+ )
3240
+ }
3241
+ return null
3242
+ }
3243
+
3244
+ const leftElement = renderLeftElement()
3245
+
3246
+ return (
3247
+ <div
3248
+ ref={ref}
3249
+ className={cn(
3250
+ pageHeaderVariants({ variant }),
3251
+ "h-[76px] px-4",
3252
+ className
3253
+ )}
3254
+ {...props}
3255
+ >
3256
+ {/* Left Section: Icon or Back Button */}
3257
+ {leftElement && (
3258
+ <div className="flex-shrink-0 mr-4">
3259
+ {leftElement}
3260
+ </div>
3261
+ )}
3262
+
3263
+ {/* Content Section: Title + Description */}
3264
+ <div className="flex-1 min-w-0">
3265
+ <div className="flex items-center gap-2">
3266
+ <h1 className="text-base font-semibold text-[#333333] truncate">
3267
+ {title}
3268
+ </h1>
3269
+ {infoIcon && (
3270
+ <span className="flex-shrink-0 [&_svg]:w-4 [&_svg]:h-4 text-[#6B7280]">
3271
+ {infoIcon}
3272
+ </span>
3273
+ )}
3274
+ </div>
3275
+ {description && (
3276
+ <p className="text-sm text-[#333333] font-normal mt-1 truncate">
3277
+ {description}
3278
+ </p>
3279
+ )}
3280
+ </div>
3281
+
3282
+ {/* Actions Section */}
3283
+ {actions && (
3284
+ <div className="flex-shrink-0 flex items-center gap-2 ml-4">
3285
+ {actions}
3286
+ </div>
3287
+ )}
3288
+ </div>
3289
+ )
3290
+ }
3291
+ )
3292
+ PageHeader.displayName = "PageHeader"
3293
+
3294
+ export { PageHeader, pageHeaderVariants }
3062
3295
  `, prefix)
3063
3296
  }
3064
3297
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.74",
3
+ "version": "0.0.76",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",