@tollerud/ui 1.0.6 → 1.0.8
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.cjs +17 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +17 -11
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -22,10 +22,17 @@ declare const sizes: {
|
|
|
22
22
|
readonly md: "px-4 py-2 text-base";
|
|
23
23
|
readonly lg: "px-6 py-3 text-lg";
|
|
24
24
|
};
|
|
25
|
-
interface
|
|
25
|
+
interface ButtonVariantProps {
|
|
26
26
|
variant?: keyof typeof variants;
|
|
27
27
|
size?: keyof typeof sizes;
|
|
28
28
|
}
|
|
29
|
+
declare function buttonVariants({ variant, size, className }?: ButtonVariantProps & {
|
|
30
|
+
className?: string;
|
|
31
|
+
}): string;
|
|
32
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, ButtonVariantProps {
|
|
33
|
+
/** Render as the single child element (e.g. a `<Link>`) instead of a `<button>`, merging props and styles onto it. */
|
|
34
|
+
asChild?: boolean;
|
|
35
|
+
}
|
|
29
36
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
30
37
|
|
|
31
38
|
declare const toneStyles: {
|
|
@@ -700,4 +707,4 @@ interface BentoDashboardProps {
|
|
|
700
707
|
}
|
|
701
708
|
declare function BentoDashboard({ title, hosts, metrics, services, incidents, className, }: BentoDashboardProps): react.JSX.Element;
|
|
702
709
|
|
|
703
|
-
export { ActionDiff, type ActionDiffProps, type ActionItem, ActionRow, type ActionRowProps, Alert, AlertInbox, type AlertInboxProps, type AlertProps, ApprovalCard, type ApprovalCardProps, BackupStatusPanel, type BackupStatusPanelProps, Badge, type BadgeProps, BentoDashboard, type BentoDashboardProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockProps, type Column, type CommandGroup, CommandMenu, type CommandMenuProps, Container, type ContainerProps, DataTable, type DataTableProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DockerStackCard, type DockerStackCardProps, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyIcon, EmptyTitle, Footer, type FooterLabels, type FooterProps, GlowCard, type GlowCardProps, HostCard, type HostCardProps, IncidentCard, type IncidentCardProps, type IncidentSeverity, Input, type InputProps, Kbd, type KbdProps, LogViewer, type LogViewerProps, NoirGlowBackground, type NoirGlowBackgroundProps, Progress, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RollbackPlan, type RollbackPlanProps, Select, type SelectProps, ServiceHealthCard, type ServiceHealthCardProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, Skeleton, StatCard, type StatCardProps, type Status, StatusDot, type StatusDotProps, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Timeline, type TimelineItemData, type TimelineProps, Toaster, type TollerudToasterProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, cn };
|
|
710
|
+
export { ActionDiff, type ActionDiffProps, type ActionItem, ActionRow, type ActionRowProps, Alert, AlertInbox, type AlertInboxProps, type AlertProps, ApprovalCard, type ApprovalCardProps, BackupStatusPanel, type BackupStatusPanelProps, Badge, type BadgeProps, BentoDashboard, type BentoDashboardProps, Button, type ButtonProps, type ButtonVariantProps, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockProps, type Column, type CommandGroup, CommandMenu, type CommandMenuProps, Container, type ContainerProps, DataTable, type DataTableProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DockerStackCard, type DockerStackCardProps, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyIcon, EmptyTitle, Footer, type FooterLabels, type FooterProps, GlowCard, type GlowCardProps, HostCard, type HostCardProps, IncidentCard, type IncidentCardProps, type IncidentSeverity, Input, type InputProps, Kbd, type KbdProps, LogViewer, type LogViewerProps, NoirGlowBackground, type NoirGlowBackgroundProps, Progress, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RollbackPlan, type RollbackPlanProps, Select, type SelectProps, ServiceHealthCard, type ServiceHealthCardProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, Skeleton, StatCard, type StatCardProps, type Status, StatusDot, type StatusDotProps, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Timeline, type TimelineItemData, type TimelineProps, Toaster, type TollerudToasterProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, cn };
|
package/dist/index.d.ts
CHANGED
|
@@ -22,10 +22,17 @@ declare const sizes: {
|
|
|
22
22
|
readonly md: "px-4 py-2 text-base";
|
|
23
23
|
readonly lg: "px-6 py-3 text-lg";
|
|
24
24
|
};
|
|
25
|
-
interface
|
|
25
|
+
interface ButtonVariantProps {
|
|
26
26
|
variant?: keyof typeof variants;
|
|
27
27
|
size?: keyof typeof sizes;
|
|
28
28
|
}
|
|
29
|
+
declare function buttonVariants({ variant, size, className }?: ButtonVariantProps & {
|
|
30
|
+
className?: string;
|
|
31
|
+
}): string;
|
|
32
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, ButtonVariantProps {
|
|
33
|
+
/** Render as the single child element (e.g. a `<Link>`) instead of a `<button>`, merging props and styles onto it. */
|
|
34
|
+
asChild?: boolean;
|
|
35
|
+
}
|
|
29
36
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
30
37
|
|
|
31
38
|
declare const toneStyles: {
|
|
@@ -700,4 +707,4 @@ interface BentoDashboardProps {
|
|
|
700
707
|
}
|
|
701
708
|
declare function BentoDashboard({ title, hosts, metrics, services, incidents, className, }: BentoDashboardProps): react.JSX.Element;
|
|
702
709
|
|
|
703
|
-
export { ActionDiff, type ActionDiffProps, type ActionItem, ActionRow, type ActionRowProps, Alert, AlertInbox, type AlertInboxProps, type AlertProps, ApprovalCard, type ApprovalCardProps, BackupStatusPanel, type BackupStatusPanelProps, Badge, type BadgeProps, BentoDashboard, type BentoDashboardProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockProps, type Column, type CommandGroup, CommandMenu, type CommandMenuProps, Container, type ContainerProps, DataTable, type DataTableProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DockerStackCard, type DockerStackCardProps, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyIcon, EmptyTitle, Footer, type FooterLabels, type FooterProps, GlowCard, type GlowCardProps, HostCard, type HostCardProps, IncidentCard, type IncidentCardProps, type IncidentSeverity, Input, type InputProps, Kbd, type KbdProps, LogViewer, type LogViewerProps, NoirGlowBackground, type NoirGlowBackgroundProps, Progress, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RollbackPlan, type RollbackPlanProps, Select, type SelectProps, ServiceHealthCard, type ServiceHealthCardProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, Skeleton, StatCard, type StatCardProps, type Status, StatusDot, type StatusDotProps, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Timeline, type TimelineItemData, type TimelineProps, Toaster, type TollerudToasterProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, cn };
|
|
710
|
+
export { ActionDiff, type ActionDiffProps, type ActionItem, ActionRow, type ActionRowProps, Alert, AlertInbox, type AlertInboxProps, type AlertProps, ApprovalCard, type ApprovalCardProps, BackupStatusPanel, type BackupStatusPanelProps, Badge, type BadgeProps, BentoDashboard, type BentoDashboardProps, Button, type ButtonProps, type ButtonVariantProps, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockProps, type Column, type CommandGroup, CommandMenu, type CommandMenuProps, Container, type ContainerProps, DataTable, type DataTableProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DockerStackCard, type DockerStackCardProps, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyIcon, EmptyTitle, Footer, type FooterLabels, type FooterProps, GlowCard, type GlowCardProps, HostCard, type HostCardProps, IncidentCard, type IncidentCardProps, type IncidentSeverity, Input, type InputProps, Kbd, type KbdProps, LogViewer, type LogViewerProps, NoirGlowBackground, type NoirGlowBackgroundProps, Progress, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RollbackPlan, type RollbackPlanProps, Select, type SelectProps, ServiceHealthCard, type ServiceHealthCardProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, Skeleton, StatCard, type StatCardProps, type Status, StatusDot, type StatusDotProps, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Timeline, type TimelineItemData, type TimelineProps, Toaster, type TollerudToasterProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, cn };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { clsx } from 'clsx';
|
|
2
3
|
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
import * as React2 from 'react';
|
|
4
5
|
import { forwardRef, useState, useCallback, lazy, useRef, useEffect, useMemo, useId, Suspense } from 'react';
|
|
6
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
5
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
8
|
import { motion } from 'framer-motion';
|
|
7
9
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
@@ -28,20 +30,24 @@ var sizes = {
|
|
|
28
30
|
md: "px-4 py-2 text-base",
|
|
29
31
|
lg: "px-6 py-3 text-lg"
|
|
30
32
|
};
|
|
33
|
+
function buttonVariants({ variant = "secondary", size = "md", className } = {}) {
|
|
34
|
+
return cn(
|
|
35
|
+
"inline-flex items-center justify-center gap-2 font-semibold rounded transition-all duration-[150ms] focus-visible:outline-2 focus-visible:outline-tollerud-yellow focus-visible:outline-offset-2",
|
|
36
|
+
"border cursor-pointer",
|
|
37
|
+
"disabled:opacity-50 disabled:pointer-events-none",
|
|
38
|
+
variants[variant],
|
|
39
|
+
sizes[size],
|
|
40
|
+
className
|
|
41
|
+
);
|
|
42
|
+
}
|
|
31
43
|
var Button = forwardRef(
|
|
32
|
-
({ className, variant = "secondary", size = "md", ...props }, ref) => {
|
|
44
|
+
({ className, variant = "secondary", size = "md", asChild = false, ...props }, ref) => {
|
|
45
|
+
const Comp = asChild ? Slot : "button";
|
|
33
46
|
return /* @__PURE__ */ jsx(
|
|
34
|
-
|
|
47
|
+
Comp,
|
|
35
48
|
{
|
|
36
49
|
ref,
|
|
37
|
-
className:
|
|
38
|
-
"inline-flex items-center justify-center gap-2 font-semibold rounded transition-all duration-[150ms] focus-visible:outline-2 focus-visible:outline-tollerud-yellow focus-visible:outline-offset-2",
|
|
39
|
-
"border cursor-pointer",
|
|
40
|
-
"disabled:opacity-50 disabled:pointer-events-none",
|
|
41
|
-
variants[variant],
|
|
42
|
-
sizes[size],
|
|
43
|
-
className
|
|
44
|
-
),
|
|
50
|
+
className: buttonVariants({ variant, size, className }),
|
|
45
51
|
...props
|
|
46
52
|
}
|
|
47
53
|
);
|
|
@@ -2645,6 +2651,6 @@ function MetricBadge({ label, value }) {
|
|
|
2645
2651
|
] });
|
|
2646
2652
|
}
|
|
2647
2653
|
|
|
2648
|
-
export { ActionDiff, ActionRow, Alert, AlertInbox, ApprovalCard, BackupStatusPanel, Badge, BentoDashboard, Button, Card, Checkbox, CodeBlock, CommandMenu, Container, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DockerStackCard, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyIcon, EmptyTitle, Footer, GlowCard, HostCard, IncidentCard, Input, Kbd, LogViewer, NoirGlowBackground, Progress, Radio, RadioGroup, RollbackPlan, Select, ServiceHealthCard, Sheet, SheetClose, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, Skeleton, StatCard, StatusDot, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Timeline, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, cn };
|
|
2654
|
+
export { ActionDiff, ActionRow, Alert, AlertInbox, ApprovalCard, BackupStatusPanel, Badge, BentoDashboard, Button, Card, Checkbox, CodeBlock, CommandMenu, Container, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DockerStackCard, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyIcon, EmptyTitle, Footer, GlowCard, HostCard, IncidentCard, Input, Kbd, LogViewer, NoirGlowBackground, Progress, Radio, RadioGroup, RollbackPlan, Select, ServiceHealthCard, Sheet, SheetClose, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, Skeleton, StatCard, StatusDot, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Timeline, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, cn };
|
|
2649
2655
|
//# sourceMappingURL=index.js.map
|
|
2650
2656
|
//# sourceMappingURL=index.js.map
|