@classic-homes/theme-react 0.1.53 → 0.1.54

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.d.mts CHANGED
@@ -4,7 +4,6 @@ import { VariantProps } from 'class-variance-authority';
4
4
  import * as LabelPrimitive from '@radix-ui/react-label';
5
5
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
6
6
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
7
- import * as react_jsx_runtime from 'react/jsx-runtime';
8
7
  import * as DialogPrimitive from '@radix-ui/react-dialog';
9
8
  import { PanelMode, PanelEdge, DataPanelAction, PanelConstraints, Position, Size } from '@classic-homes/data-panel-core';
10
9
  export { DataPanelAction, DataPanelState, PanelConstraints, PanelEdge, PanelMode, Position, Size } from '@classic-homes/data-panel-core';
@@ -12,7 +11,7 @@ import { ClassValue } from 'clsx';
12
11
 
13
12
  declare const buttonVariants: (props?: ({
14
13
  variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined;
15
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
14
+ size?: "default" | "sm" | "md" | "lg" | "icon" | null | undefined;
16
15
  } & class_variance_authority_types.ClassProp) | undefined) => string;
17
16
  /** Base button props without size */
18
17
  interface BaseButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, Omit<VariantProps<typeof buttonVariants>, 'size'> {
@@ -28,7 +27,7 @@ interface IconButtonProps extends BaseButtonProps {
28
27
  }
29
28
  /** Regular buttons with visible text content */
30
29
  interface NonIconButtonProps extends BaseButtonProps {
31
- size?: 'default' | 'sm' | 'lg';
30
+ size?: 'default' | 'sm' | 'md' | 'lg';
32
31
  }
33
32
  /**
34
33
  * Button component props.
@@ -88,11 +87,14 @@ declare const PasswordInput: React$1.ForwardRefExoticComponent<PasswordInputProp
88
87
  declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
89
88
 
90
89
  declare const badgeVariants: (props?: ({
91
- variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
90
+ variant?: "default" | "secondary" | "destructive" | "outline" | "success" | "warning" | "info" | null | undefined;
91
+ size?: "default" | "sm" | "dot" | null | undefined;
92
92
  } & class_variance_authority_types.ClassProp) | undefined) => string;
93
- interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
93
+ interface BadgeProps extends React$1.HTMLAttributes<HTMLElement>, VariantProps<typeof badgeVariants> {
94
94
  /** When true, adds role="status" and aria-live="polite" for dynamic content announcements */
95
95
  live?: boolean;
96
+ /** When true, renders the badge as an interactive button */
97
+ clickable?: boolean;
96
98
  /**
97
99
  * Screen reader-only label providing context for the badge content.
98
100
  * Useful for count badges (e.g., "unread messages" for a badge showing "5").
@@ -100,7 +102,7 @@ interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProp
100
102
  */
101
103
  label?: string;
102
104
  }
103
- declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefAttributes<HTMLDivElement>>;
105
+ declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefAttributes<HTMLElement>>;
104
106
 
105
107
  interface SeparatorProps extends React$1.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> {
106
108
  }
@@ -160,14 +162,26 @@ declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
160
162
  declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
161
163
  declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
162
164
  declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
165
+ declare const dialogSizeClasses: {
166
+ readonly sm: "max-w-sm";
167
+ readonly md: "max-w-lg";
168
+ readonly lg: "max-w-xl";
169
+ readonly xl: "max-w-2xl";
170
+ readonly '2xl': "max-w-3xl";
171
+ readonly full: "max-w-[calc(100vw-2rem)]";
172
+ };
173
+ type DialogSize = keyof typeof dialogSizeClasses;
163
174
  declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>>;
164
- declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
175
+ declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & DialogPrimitive.DialogContentProps & {
176
+ /** Dialog size - controls max-width (default: 'md') */
177
+ size?: DialogSize;
178
+ } & React$1.RefAttributes<HTMLDivElement>>;
165
179
  declare const DialogHeader: {
166
- ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
180
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
167
181
  displayName: string;
168
182
  };
169
183
  declare const DialogFooter: {
170
- ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
184
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
171
185
  displayName: string;
172
186
  };
173
187
  declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>>;
@@ -344,7 +358,7 @@ interface SkeletonProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantP
344
358
  declare const Skeleton: React$1.ForwardRefExoticComponent<SkeletonProps & React$1.RefAttributes<HTMLDivElement>>;
345
359
 
346
360
  declare const spinnerVariants: (props?: ({
347
- size?: "sm" | "lg" | "md" | "xl" | null | undefined;
361
+ size?: "sm" | "md" | "lg" | "xl" | null | undefined;
348
362
  } & class_variance_authority_types.ClassProp) | undefined) => string;
349
363
  interface SpinnerProps extends React$1.SVGAttributes<SVGSVGElement>, VariantProps<typeof spinnerVariants> {
350
364
  /** Accessible label for the spinner */
@@ -365,7 +379,7 @@ interface LoadingLogoProps extends React$1.HTMLAttributes<HTMLDivElement> {
365
379
  declare const LoadingLogo: React$1.ForwardRefExoticComponent<LoadingLogoProps & React$1.RefAttributes<HTMLDivElement>>;
366
380
 
367
381
  declare const progressBarVariants: (props?: ({
368
- size?: "sm" | "lg" | "md" | null | undefined;
382
+ size?: "sm" | "md" | "lg" | null | undefined;
369
383
  } & class_variance_authority_types.ClassProp) | undefined) => string;
370
384
  declare const progressFillVariants: (props?: ({
371
385
  variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
package/dist/index.d.ts CHANGED
@@ -4,7 +4,6 @@ import { VariantProps } from 'class-variance-authority';
4
4
  import * as LabelPrimitive from '@radix-ui/react-label';
5
5
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
6
6
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
7
- import * as react_jsx_runtime from 'react/jsx-runtime';
8
7
  import * as DialogPrimitive from '@radix-ui/react-dialog';
9
8
  import { PanelMode, PanelEdge, DataPanelAction, PanelConstraints, Position, Size } from '@classic-homes/data-panel-core';
10
9
  export { DataPanelAction, DataPanelState, PanelConstraints, PanelEdge, PanelMode, Position, Size } from '@classic-homes/data-panel-core';
@@ -12,7 +11,7 @@ import { ClassValue } from 'clsx';
12
11
 
13
12
  declare const buttonVariants: (props?: ({
14
13
  variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined;
15
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
14
+ size?: "default" | "sm" | "md" | "lg" | "icon" | null | undefined;
16
15
  } & class_variance_authority_types.ClassProp) | undefined) => string;
17
16
  /** Base button props without size */
18
17
  interface BaseButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, Omit<VariantProps<typeof buttonVariants>, 'size'> {
@@ -28,7 +27,7 @@ interface IconButtonProps extends BaseButtonProps {
28
27
  }
29
28
  /** Regular buttons with visible text content */
30
29
  interface NonIconButtonProps extends BaseButtonProps {
31
- size?: 'default' | 'sm' | 'lg';
30
+ size?: 'default' | 'sm' | 'md' | 'lg';
32
31
  }
33
32
  /**
34
33
  * Button component props.
@@ -88,11 +87,14 @@ declare const PasswordInput: React$1.ForwardRefExoticComponent<PasswordInputProp
88
87
  declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
89
88
 
90
89
  declare const badgeVariants: (props?: ({
91
- variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
90
+ variant?: "default" | "secondary" | "destructive" | "outline" | "success" | "warning" | "info" | null | undefined;
91
+ size?: "default" | "sm" | "dot" | null | undefined;
92
92
  } & class_variance_authority_types.ClassProp) | undefined) => string;
93
- interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
93
+ interface BadgeProps extends React$1.HTMLAttributes<HTMLElement>, VariantProps<typeof badgeVariants> {
94
94
  /** When true, adds role="status" and aria-live="polite" for dynamic content announcements */
95
95
  live?: boolean;
96
+ /** When true, renders the badge as an interactive button */
97
+ clickable?: boolean;
96
98
  /**
97
99
  * Screen reader-only label providing context for the badge content.
98
100
  * Useful for count badges (e.g., "unread messages" for a badge showing "5").
@@ -100,7 +102,7 @@ interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProp
100
102
  */
101
103
  label?: string;
102
104
  }
103
- declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefAttributes<HTMLDivElement>>;
105
+ declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefAttributes<HTMLElement>>;
104
106
 
105
107
  interface SeparatorProps extends React$1.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> {
106
108
  }
@@ -160,14 +162,26 @@ declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
160
162
  declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
161
163
  declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
162
164
  declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
165
+ declare const dialogSizeClasses: {
166
+ readonly sm: "max-w-sm";
167
+ readonly md: "max-w-lg";
168
+ readonly lg: "max-w-xl";
169
+ readonly xl: "max-w-2xl";
170
+ readonly '2xl': "max-w-3xl";
171
+ readonly full: "max-w-[calc(100vw-2rem)]";
172
+ };
173
+ type DialogSize = keyof typeof dialogSizeClasses;
163
174
  declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>>;
164
- declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
175
+ declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & DialogPrimitive.DialogContentProps & {
176
+ /** Dialog size - controls max-width (default: 'md') */
177
+ size?: DialogSize;
178
+ } & React$1.RefAttributes<HTMLDivElement>>;
165
179
  declare const DialogHeader: {
166
- ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
180
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
167
181
  displayName: string;
168
182
  };
169
183
  declare const DialogFooter: {
170
- ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
184
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
171
185
  displayName: string;
172
186
  };
173
187
  declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>>;
@@ -344,7 +358,7 @@ interface SkeletonProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantP
344
358
  declare const Skeleton: React$1.ForwardRefExoticComponent<SkeletonProps & React$1.RefAttributes<HTMLDivElement>>;
345
359
 
346
360
  declare const spinnerVariants: (props?: ({
347
- size?: "sm" | "lg" | "md" | "xl" | null | undefined;
361
+ size?: "sm" | "md" | "lg" | "xl" | null | undefined;
348
362
  } & class_variance_authority_types.ClassProp) | undefined) => string;
349
363
  interface SpinnerProps extends React$1.SVGAttributes<SVGSVGElement>, VariantProps<typeof spinnerVariants> {
350
364
  /** Accessible label for the spinner */
@@ -365,7 +379,7 @@ interface LoadingLogoProps extends React$1.HTMLAttributes<HTMLDivElement> {
365
379
  declare const LoadingLogo: React$1.ForwardRefExoticComponent<LoadingLogoProps & React$1.RefAttributes<HTMLDivElement>>;
366
380
 
367
381
  declare const progressBarVariants: (props?: ({
368
- size?: "sm" | "lg" | "md" | null | undefined;
382
+ size?: "sm" | "md" | "lg" | null | undefined;
369
383
  } & class_variance_authority_types.ClassProp) | undefined) => string;
370
384
  declare const progressFillVariants: (props?: ({
371
385
  variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
package/dist/index.js CHANGED
@@ -109,20 +109,21 @@ function cn(...inputs) {
109
109
  var import_jsx_runtime = require("react/jsx-runtime");
110
110
  var buttonVariants = (0, import_class_variance_authority.cva)(
111
111
  // Base styles - using semantic color system
112
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
112
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
113
113
  {
114
114
  variants: {
115
115
  variant: {
116
116
  default: "bg-primary text-primary-foreground shadow hover:bg-primary-hover",
117
117
  secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary-hover",
118
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive-hover",
119
- outline: "border border-input bg-background shadow-sm hover:bg-accent-hover hover:text-accent-foreground",
120
- ghost: "hover:bg-accent-hover hover:text-accent-foreground",
118
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive-hover focus-visible:ring-destructive",
119
+ outline: "border-2 border-primary text-primary bg-transparent hover:bg-primary hover:text-primary-foreground",
120
+ ghost: "hover:bg-muted-hover hover:text-foreground",
121
121
  link: "text-primary underline-offset-4 hover:underline"
122
122
  },
123
123
  size: {
124
124
  default: "h-10 px-4 py-2",
125
- sm: "h-9 rounded-md px-3 text-xs",
125
+ sm: "h-9 rounded-md px-3 text-sm",
126
+ md: "h-10 px-4 py-2",
126
127
  lg: "h-11 rounded-md px-8",
127
128
  icon: "h-10 w-10"
128
129
  }
@@ -392,23 +393,32 @@ var React7 = __toESM(require("react"));
392
393
  var import_class_variance_authority3 = require("class-variance-authority");
393
394
  var import_jsx_runtime6 = require("react/jsx-runtime");
394
395
  var badgeVariants = (0, import_class_variance_authority3.cva)(
395
- "inline-flex items-center rounded-full border border-border px-2.5 py-0.5 text-xs font-semibold transition-colors",
396
+ "inline-flex items-center justify-center rounded-md border font-medium w-fit whitespace-nowrap shrink-0 gap-1",
396
397
  {
397
398
  variants: {
398
399
  variant: {
399
- default: "border-transparent bg-primary text-primary-foreground hover:bg-primary-hover",
400
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary-hover",
401
- destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive-hover",
402
- outline: "text-foreground"
400
+ default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
401
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
402
+ destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
403
+ outline: "text-foreground hover:bg-accent hover:text-accent-foreground",
404
+ success: "border-transparent bg-success text-success-foreground hover:bg-success/80",
405
+ warning: "border-transparent bg-warning text-warning-foreground hover:bg-warning/80",
406
+ info: "border-transparent bg-info text-info-foreground hover:bg-info/80"
407
+ },
408
+ size: {
409
+ default: "px-2 py-0.5 text-xs",
410
+ sm: "px-1.5 py-0.5 text-xs",
411
+ dot: "h-5 w-5 p-0 text-xs"
403
412
  }
404
413
  },
405
414
  defaultVariants: {
406
- variant: "default"
415
+ variant: "default",
416
+ size: "default"
407
417
  }
408
418
  }
409
419
  );
410
420
  var Badge = React7.forwardRef(
411
- ({ className, variant, live, label, children, ...props }, ref) => {
421
+ ({ className, variant, size, live, clickable, label, children, onClick, ...props }, ref) => {
412
422
  if (process.env.NODE_ENV !== "production") {
413
423
  if (live && !label) {
414
424
  console.warn(
@@ -416,21 +426,38 @@ var Badge = React7.forwardRef(
416
426
  );
417
427
  }
418
428
  }
419
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
420
- "div",
421
- {
422
- ref,
423
- role: live ? "status" : void 0,
424
- "aria-live": live ? "polite" : void 0,
425
- "aria-atomic": live ? "true" : void 0,
426
- className: cn(badgeVariants({ variant }), className),
427
- ...props,
428
- children: [
429
- children,
430
- label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: label })
431
- ]
432
- }
429
+ const isInteractive = clickable || !!onClick;
430
+ const classes = cn(
431
+ badgeVariants({ variant, size }),
432
+ isInteractive && "cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
433
+ className
433
434
  );
435
+ const sharedProps = {
436
+ role: live ? "status" : void 0,
437
+ "aria-live": live ? "polite" : void 0,
438
+ "aria-atomic": live ? "true" : void 0,
439
+ className: classes,
440
+ ...props
441
+ };
442
+ if (isInteractive) {
443
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
444
+ "button",
445
+ {
446
+ ref,
447
+ type: "button",
448
+ onClick,
449
+ ...sharedProps,
450
+ children: [
451
+ children,
452
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: label })
453
+ ]
454
+ }
455
+ );
456
+ }
457
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { ref, ...sharedProps, children: [
458
+ children,
459
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: label })
460
+ ] });
434
461
  }
435
462
  );
436
463
  Badge.displayName = "Badge";
@@ -577,26 +604,35 @@ var Dialog = DialogPrimitive.Root;
577
604
  var DialogTrigger = DialogPrimitive.Trigger;
578
605
  var DialogPortal = DialogPrimitive.Portal;
579
606
  var DialogClose = DialogPrimitive.Close;
607
+ var dialogSizeClasses = {
608
+ sm: "max-w-sm",
609
+ md: "max-w-lg",
610
+ lg: "max-w-xl",
611
+ xl: "max-w-2xl",
612
+ "2xl": "max-w-3xl",
613
+ full: "max-w-[calc(100vw-2rem)]"
614
+ };
580
615
  var DialogOverlay = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
581
616
  PrimitiveOverlay,
582
617
  {
583
618
  ref,
584
619
  className: cn(
585
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
620
+ "fixed inset-0 z-50 bg-foreground/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
586
621
  className
587
622
  ),
588
623
  ...props
589
624
  }
590
625
  ));
591
626
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
592
- var DialogContent = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DialogPortal, { children: [
627
+ var DialogContent = React11.forwardRef(({ className, children, size = "md", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DialogPortal, { children: [
593
628
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DialogOverlay, {}),
594
629
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
595
630
  PrimitiveContent,
596
631
  {
597
632
  ref,
598
633
  className: cn(
599
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
634
+ "fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
635
+ dialogSizeClasses[size],
600
636
  className
601
637
  ),
602
638
  ...props,
@@ -929,7 +965,7 @@ var DataPanelHeader = React13.forwardRef(
929
965
  "button",
930
966
  {
931
967
  type: "button",
932
- className: "flex h-8 w-8 items-center justify-center rounded-md bg-transparent text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
968
+ className: "flex h-8 w-8 items-center justify-center rounded-md bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
933
969
  onClick: () => onExpandedChange?.(!isExpanded),
934
970
  "aria-label": isExpanded ? "Collapse panel" : "Expand panel",
935
971
  "aria-expanded": isExpanded,
@@ -941,7 +977,7 @@ var DataPanelHeader = React13.forwardRef(
941
977
  "button",
942
978
  {
943
979
  type: "button",
944
- className: "flex h-8 w-8 items-center justify-center rounded-md bg-transparent text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
980
+ className: "flex h-8 w-8 items-center justify-center rounded-md bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
945
981
  "aria-label": "Panel options",
946
982
  children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MoreVerticalIcon, {})
947
983
  }
@@ -957,7 +993,7 @@ var DataPanelHeader = React13.forwardRef(
957
993
  ["left", "right", "top", "bottom"].map((e) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
958
994
  DropdownItem,
959
995
  {
960
- className: "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
996
+ className: "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none bg-popover focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
961
997
  onSelect: () => {
962
998
  onModeChange?.("pinned");
963
999
  onEdgeChange?.(e);
@@ -973,7 +1009,7 @@ var DataPanelHeader = React13.forwardRef(
973
1009
  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
974
1010
  DropdownItem,
975
1011
  {
976
- className: "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground",
1012
+ className: "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none bg-popover focus:bg-accent focus:text-accent-foreground",
977
1013
  onSelect: () => onModeChange?.("detached"),
978
1014
  children: [
979
1015
  "Detach",
@@ -989,7 +1025,7 @@ var DataPanelHeader = React13.forwardRef(
989
1025
  "button",
990
1026
  {
991
1027
  type: "button",
992
- className: "flex h-8 w-8 items-center justify-center rounded-md bg-transparent text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1028
+ className: "flex h-8 w-8 items-center justify-center rounded-md bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
993
1029
  onClick: onClose,
994
1030
  "aria-label": "Close panel",
995
1031
  children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CloseIcon, {})
@@ -1074,7 +1110,7 @@ var DataPanelTab = React13.forwardRef(
1074
1110
  ref,
1075
1111
  type: "button",
1076
1112
  className: cn(
1077
- "fixed z-40 flex items-center justify-center gap-2 border border-border bg-background px-3 py-2 text-sm font-medium shadow-md transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1113
+ "fixed z-40 flex items-center justify-center gap-2 border border-border bg-background px-3 py-2 text-sm font-medium shadow-md hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1078
1114
  positionClasses,
1079
1115
  isVertical && "[writing-mode:vertical-rl]",
1080
1116
  className
@@ -1230,7 +1266,7 @@ function ResizeHandles({
1230
1266
  role: "slider",
1231
1267
  tabIndex: 0,
1232
1268
  "aria-orientation": isVertical ? "vertical" : "horizontal",
1233
- "aria-label": `Resize panel from ${handle.replace("-", " ")} ${isCorner ? "corner" : "edge"}`,
1269
+ "aria-label": `Resize panel from ${handle.replace("-", "")} ${isCorner ? "corner" : "edge"}`,
1234
1270
  "aria-valuenow": getAriaValueNow(handle),
1235
1271
  "aria-valuemin": min2,
1236
1272
  "aria-valuemax": max2,
package/dist/index.mjs CHANGED
@@ -14,20 +14,21 @@ function cn(...inputs) {
14
14
  import { jsx } from "react/jsx-runtime";
15
15
  var buttonVariants = cva(
16
16
  // Base styles - using semantic color system
17
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
17
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
18
18
  {
19
19
  variants: {
20
20
  variant: {
21
21
  default: "bg-primary text-primary-foreground shadow hover:bg-primary-hover",
22
22
  secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary-hover",
23
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive-hover",
24
- outline: "border border-input bg-background shadow-sm hover:bg-accent-hover hover:text-accent-foreground",
25
- ghost: "hover:bg-accent-hover hover:text-accent-foreground",
23
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive-hover focus-visible:ring-destructive",
24
+ outline: "border-2 border-primary text-primary bg-transparent hover:bg-primary hover:text-primary-foreground",
25
+ ghost: "hover:bg-muted-hover hover:text-foreground",
26
26
  link: "text-primary underline-offset-4 hover:underline"
27
27
  },
28
28
  size: {
29
29
  default: "h-10 px-4 py-2",
30
- sm: "h-9 rounded-md px-3 text-xs",
30
+ sm: "h-9 rounded-md px-3 text-sm",
31
+ md: "h-10 px-4 py-2",
31
32
  lg: "h-11 rounded-md px-8",
32
33
  icon: "h-10 w-10"
33
34
  }
@@ -297,23 +298,32 @@ import * as React7 from "react";
297
298
  import { cva as cva3 } from "class-variance-authority";
298
299
  import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
299
300
  var badgeVariants = cva3(
300
- "inline-flex items-center rounded-full border border-border px-2.5 py-0.5 text-xs font-semibold transition-colors",
301
+ "inline-flex items-center justify-center rounded-md border font-medium w-fit whitespace-nowrap shrink-0 gap-1",
301
302
  {
302
303
  variants: {
303
304
  variant: {
304
- default: "border-transparent bg-primary text-primary-foreground hover:bg-primary-hover",
305
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary-hover",
306
- destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive-hover",
307
- outline: "text-foreground"
305
+ default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
306
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
307
+ destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
308
+ outline: "text-foreground hover:bg-accent hover:text-accent-foreground",
309
+ success: "border-transparent bg-success text-success-foreground hover:bg-success/80",
310
+ warning: "border-transparent bg-warning text-warning-foreground hover:bg-warning/80",
311
+ info: "border-transparent bg-info text-info-foreground hover:bg-info/80"
312
+ },
313
+ size: {
314
+ default: "px-2 py-0.5 text-xs",
315
+ sm: "px-1.5 py-0.5 text-xs",
316
+ dot: "h-5 w-5 p-0 text-xs"
308
317
  }
309
318
  },
310
319
  defaultVariants: {
311
- variant: "default"
320
+ variant: "default",
321
+ size: "default"
312
322
  }
313
323
  }
314
324
  );
315
325
  var Badge = React7.forwardRef(
316
- ({ className, variant, live, label, children, ...props }, ref) => {
326
+ ({ className, variant, size, live, clickable, label, children, onClick, ...props }, ref) => {
317
327
  if (process.env.NODE_ENV !== "production") {
318
328
  if (live && !label) {
319
329
  console.warn(
@@ -321,21 +331,38 @@ var Badge = React7.forwardRef(
321
331
  );
322
332
  }
323
333
  }
324
- return /* @__PURE__ */ jsxs2(
325
- "div",
326
- {
327
- ref,
328
- role: live ? "status" : void 0,
329
- "aria-live": live ? "polite" : void 0,
330
- "aria-atomic": live ? "true" : void 0,
331
- className: cn(badgeVariants({ variant }), className),
332
- ...props,
333
- children: [
334
- children,
335
- label && /* @__PURE__ */ jsx6("span", { className: "sr-only", children: label })
336
- ]
337
- }
334
+ const isInteractive = clickable || !!onClick;
335
+ const classes = cn(
336
+ badgeVariants({ variant, size }),
337
+ isInteractive && "cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
338
+ className
338
339
  );
340
+ const sharedProps = {
341
+ role: live ? "status" : void 0,
342
+ "aria-live": live ? "polite" : void 0,
343
+ "aria-atomic": live ? "true" : void 0,
344
+ className: classes,
345
+ ...props
346
+ };
347
+ if (isInteractive) {
348
+ return /* @__PURE__ */ jsxs2(
349
+ "button",
350
+ {
351
+ ref,
352
+ type: "button",
353
+ onClick,
354
+ ...sharedProps,
355
+ children: [
356
+ children,
357
+ label && /* @__PURE__ */ jsx6("span", { className: "sr-only", children: label })
358
+ ]
359
+ }
360
+ );
361
+ }
362
+ return /* @__PURE__ */ jsxs2("span", { ref, ...sharedProps, children: [
363
+ children,
364
+ label && /* @__PURE__ */ jsx6("span", { className: "sr-only", children: label })
365
+ ] });
339
366
  }
340
367
  );
341
368
  Badge.displayName = "Badge";
@@ -482,26 +509,35 @@ var Dialog = DialogPrimitive.Root;
482
509
  var DialogTrigger = DialogPrimitive.Trigger;
483
510
  var DialogPortal = DialogPrimitive.Portal;
484
511
  var DialogClose = DialogPrimitive.Close;
512
+ var dialogSizeClasses = {
513
+ sm: "max-w-sm",
514
+ md: "max-w-lg",
515
+ lg: "max-w-xl",
516
+ xl: "max-w-2xl",
517
+ "2xl": "max-w-3xl",
518
+ full: "max-w-[calc(100vw-2rem)]"
519
+ };
485
520
  var DialogOverlay = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
486
521
  PrimitiveOverlay,
487
522
  {
488
523
  ref,
489
524
  className: cn(
490
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
525
+ "fixed inset-0 z-50 bg-foreground/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
491
526
  className
492
527
  ),
493
528
  ...props
494
529
  }
495
530
  ));
496
531
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
497
- var DialogContent = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs3(DialogPortal, { children: [
532
+ var DialogContent = React11.forwardRef(({ className, children, size = "md", ...props }, ref) => /* @__PURE__ */ jsxs3(DialogPortal, { children: [
498
533
  /* @__PURE__ */ jsx10(DialogOverlay, {}),
499
534
  /* @__PURE__ */ jsx10(
500
535
  PrimitiveContent,
501
536
  {
502
537
  ref,
503
538
  className: cn(
504
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
539
+ "fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
540
+ dialogSizeClasses[size],
505
541
  className
506
542
  ),
507
543
  ...props,
@@ -857,7 +893,7 @@ var DataPanelHeader = React13.forwardRef(
857
893
  "button",
858
894
  {
859
895
  type: "button",
860
- className: "flex h-8 w-8 items-center justify-center rounded-md bg-transparent text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
896
+ className: "flex h-8 w-8 items-center justify-center rounded-md bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
861
897
  onClick: () => onExpandedChange?.(!isExpanded),
862
898
  "aria-label": isExpanded ? "Collapse panel" : "Expand panel",
863
899
  "aria-expanded": isExpanded,
@@ -869,7 +905,7 @@ var DataPanelHeader = React13.forwardRef(
869
905
  "button",
870
906
  {
871
907
  type: "button",
872
- className: "flex h-8 w-8 items-center justify-center rounded-md bg-transparent text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
908
+ className: "flex h-8 w-8 items-center justify-center rounded-md bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
873
909
  "aria-label": "Panel options",
874
910
  children: /* @__PURE__ */ jsx12(MoreVerticalIcon, {})
875
911
  }
@@ -885,7 +921,7 @@ var DataPanelHeader = React13.forwardRef(
885
921
  ["left", "right", "top", "bottom"].map((e) => /* @__PURE__ */ jsxs5(
886
922
  DropdownItem,
887
923
  {
888
- className: "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
924
+ className: "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none bg-popover focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
889
925
  onSelect: () => {
890
926
  onModeChange?.("pinned");
891
927
  onEdgeChange?.(e);
@@ -901,7 +937,7 @@ var DataPanelHeader = React13.forwardRef(
901
937
  /* @__PURE__ */ jsxs5(
902
938
  DropdownItem,
903
939
  {
904
- className: "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground",
940
+ className: "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none bg-popover focus:bg-accent focus:text-accent-foreground",
905
941
  onSelect: () => onModeChange?.("detached"),
906
942
  children: [
907
943
  "Detach",
@@ -917,7 +953,7 @@ var DataPanelHeader = React13.forwardRef(
917
953
  "button",
918
954
  {
919
955
  type: "button",
920
- className: "flex h-8 w-8 items-center justify-center rounded-md bg-transparent text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
956
+ className: "flex h-8 w-8 items-center justify-center rounded-md bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
921
957
  onClick: onClose,
922
958
  "aria-label": "Close panel",
923
959
  children: /* @__PURE__ */ jsx12(CloseIcon, {})
@@ -1002,7 +1038,7 @@ var DataPanelTab = React13.forwardRef(
1002
1038
  ref,
1003
1039
  type: "button",
1004
1040
  className: cn(
1005
- "fixed z-40 flex items-center justify-center gap-2 border border-border bg-background px-3 py-2 text-sm font-medium shadow-md transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1041
+ "fixed z-40 flex items-center justify-center gap-2 border border-border bg-background px-3 py-2 text-sm font-medium shadow-md hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1006
1042
  positionClasses,
1007
1043
  isVertical && "[writing-mode:vertical-rl]",
1008
1044
  className
@@ -1158,7 +1194,7 @@ function ResizeHandles({
1158
1194
  role: "slider",
1159
1195
  tabIndex: 0,
1160
1196
  "aria-orientation": isVertical ? "vertical" : "horizontal",
1161
- "aria-label": `Resize panel from ${handle.replace("-", " ")} ${isCorner ? "corner" : "edge"}`,
1197
+ "aria-label": `Resize panel from ${handle.replace("-", "")} ${isCorner ? "corner" : "edge"}`,
1162
1198
  "aria-valuenow": getAriaValueNow(handle),
1163
1199
  "aria-valuemin": min2,
1164
1200
  "aria-valuemax": max2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/theme-react",
3
- "version": "0.1.53",
3
+ "version": "0.1.54",
4
4
  "description": "React components for the Classic theme system",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -20,7 +20,7 @@
20
20
  "scripts": {
21
21
  "build": "tsup src/index.ts --format esm,cjs --dts --external react --external react-dom",
22
22
  "dev": "tsup src/index.ts --format esm,cjs --dts --external react --external react-dom --watch",
23
- "clean": "rm -rf dist",
23
+ "clean": "node ../../scripts/rm.mjs dist",
24
24
  "typecheck": "tsc --noEmit",
25
25
  "test": "vitest run",
26
26
  "test:watch": "vitest",
@@ -68,7 +68,7 @@
68
68
  "@testing-library/user-event": "^14.5.0",
69
69
  "@types/react": "^18.2.0",
70
70
  "@types/react-dom": "^18.2.0",
71
- "@vitejs/plugin-react": "^4.3.0",
71
+ "@vitejs/plugin-react": "^6.0.0",
72
72
  "jsdom": "^26.0.0",
73
73
  "react": "^18.2.0",
74
74
  "react-dom": "^18.2.0",