@pycolors/ui 1.3.0 → 1.4.0

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.
@@ -1,7 +1,7 @@
1
- import * as React from 'react';
2
- import { type VariantProps } from 'class-variance-authority';
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "default" | "destructive" | "outline" | "secondary" | "muted" | "success" | "warning" | null | undefined;
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | "muted" | "success" | "warning" | "info" | null | undefined;
5
5
  size?: "sm" | "lg" | "md" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
@@ -11,8 +11,8 @@ export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, Varia
11
11
  */
12
12
  asChild?: boolean;
13
13
  }
14
- export type BadgeVariant = NonNullable<BadgeProps['variant']>;
15
- export type BadgeSize = NonNullable<BadgeProps['size']>;
14
+ export type BadgeVariant = NonNullable<BadgeProps["variant"]>;
15
+ export type BadgeSize = NonNullable<BadgeProps["size"]>;
16
16
  declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
17
17
  export { Badge, badgeVariants };
18
18
  //# sourceMappingURL=badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,aAAa;;;8EA+BlB,CAAC;AAIF,MAAM,WAAW,UACf,SACE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EACrC,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;AAC9D,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;AAExD,QAAA,MAAM,KAAK,oFAaV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,aAAa;;;8EA4BlB,CAAC;AAIF,MAAM,WAAW,UACf,SACE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EACrC,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;AAC9D,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;AAExD,QAAA,MAAM,KAAK,oFAaV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
@@ -1,35 +1,36 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import { Slot } from '@radix-ui/react-slot';
4
- import { cva } from 'class-variance-authority';
5
- import { cn } from '../../lib/utils.js';
6
- const badgeVariants = cva('inline-flex items-center gap-1 rounded-full border px-2.5 py-0.5 text-xs font-medium ' +
7
- 'transition-colors ring-offset-background focus-visible:outline-none focus-visible:ring-2 ' +
8
- 'focus-visible:ring-ring focus-visible:ring-offset-2', {
2
+ import * as React from "react";
3
+ import { Slot } from "@radix-ui/react-slot";
4
+ import { cva } from "class-variance-authority";
5
+ import { cn } from "../../lib/utils.js";
6
+ const badgeVariants = cva("inline-flex items-center gap-1 rounded-full border px-2.5 py-0.5 text-xs font-medium " +
7
+ "transition-colors ring-offset-background focus-visible:outline-none focus-visible:ring-2 " +
8
+ "focus-visible:ring-ring focus-visible:ring-offset-2", {
9
9
  variants: {
10
10
  variant: {
11
- default: 'border-transparent bg-primary text-primary-foreground',
12
- secondary: 'border-transparent bg-secondary text-secondary-foreground',
13
- muted: 'border-transparent bg-muted text-muted-foreground',
14
- outline: 'border-border bg-background text-foreground',
15
- success: 'border-transparent bg-success text-success-foreground',
16
- warning: 'border-transparent bg-warning text-warning-foreground',
17
- destructive: 'border-transparent bg-destructive text-destructive-foreground',
11
+ default: "border-transparent bg-primary text-primary-foreground",
12
+ secondary: "border-transparent bg-secondary text-secondary-foreground",
13
+ muted: "border-transparent bg-muted text-muted-foreground",
14
+ outline: "border-border bg-background text-foreground",
15
+ success: "border-transparent bg-success text-success-foreground",
16
+ warning: "border-transparent bg-warning text-warning-foreground",
17
+ destructive: "border-transparent bg-destructive text-destructive-foreground",
18
+ info: "border-transparent bg-card text-card-foreground",
18
19
  },
19
20
  size: {
20
- sm: 'h-5 text-[11px]',
21
- md: 'h-6',
22
- lg: 'h-7 text-sm',
21
+ sm: "h-5 text-[11px]",
22
+ md: "h-6",
23
+ lg: "h-7 text-sm",
23
24
  },
24
25
  },
25
26
  defaultVariants: {
26
- variant: 'default',
27
- size: 'md',
27
+ variant: "default",
28
+ size: "md",
28
29
  },
29
30
  });
30
31
  const Badge = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
31
- const Comp = asChild ? Slot : 'span';
32
+ const Comp = asChild ? Slot : "span";
32
33
  return (_jsx(Comp, { ref: ref, "data-slot": "badge", className: cn(badgeVariants({ variant, size }), className), ...props }));
33
34
  });
34
- Badge.displayName = 'Badge';
35
+ Badge.displayName = "Badge";
35
36
  export { Badge, badgeVariants };
@@ -1,8 +1,8 @@
1
- import * as React from 'react';
2
- import * as ToastPrimitive from '@radix-ui/react-toast';
3
- import { type VariantProps } from 'class-variance-authority';
1
+ import * as React from "react";
2
+ import * as ToastPrimitive from "@radix-ui/react-toast";
3
+ import { type VariantProps } from "class-variance-authority";
4
4
  declare const toastVariants: (props?: ({
5
- variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
5
+ variant?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export declare const ToastProvider: React.FC<ToastPrimitive.ToastProviderProps>;
8
8
  export declare const ToastViewport: React.ForwardRefExoticComponent<ToastPrimitive.ToastViewportProps & React.RefAttributes<HTMLOListElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/components/ui/toast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,aAAa;;8EAkBlB,CAAC;AAEF,eAAO,MAAM,aAAa,6CAA0B,CAAC;AACrD,eAAO,MAAM,aAAa,4GAA0B,CAAC;AAErD,MAAM,WAAW,UACf,SACE,KAAK,CAAC,wBAAwB,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,EAC1D,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAgBzC,eAAO,MAAM,KAAK,kFAchB,CAAC;AAGH,eAAO,MAAM,UAAU,uGAAuB,CAAC;AAC/C,eAAO,MAAM,gBAAgB,6GAA6B,CAAC;AAC3D,eAAO,MAAM,UAAU,0GAAuB,CAAC"}
1
+ {"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/components/ui/toast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,aAAa;;8EAiBlB,CAAC;AAEF,eAAO,MAAM,aAAa,6CAA0B,CAAC;AACrD,eAAO,MAAM,aAAa,4GAA0B,CAAC;AAErD,MAAM,WAAW,UACf,SACE,KAAK,CAAC,wBAAwB,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,EAC1D,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAiBzC,eAAO,MAAM,KAAK,kFAchB,CAAC;AAGH,eAAO,MAAM,UAAU,uGAAuB,CAAC;AAC/C,eAAO,MAAM,gBAAgB,6GAA6B,CAAC;AAC3D,eAAO,MAAM,UAAU,0GAAuB,CAAC"}
@@ -1,20 +1,21 @@
1
- 'use client';
1
+ "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as React from 'react';
4
- import * as ToastPrimitive from '@radix-ui/react-toast';
5
- import { cva } from 'class-variance-authority';
6
- import { cn } from '../../lib/utils.js';
7
- const toastVariants = cva('pointer-events-auto relative flex w-full items-center justify-between gap-4 rounded-md border px-4 py-3 text-sm shadow-lg', {
3
+ import * as React from "react";
4
+ import * as ToastPrimitive from "@radix-ui/react-toast";
5
+ import { cva } from "class-variance-authority";
6
+ import { cn } from "../../lib/utils.js";
7
+ const toastVariants = cva("pointer-events-auto relative flex w-full items-center justify-between gap-4 rounded-md border px-4 py-3 text-sm shadow-lg", {
8
8
  variants: {
9
9
  variant: {
10
- default: 'bg-background text-foreground border-border',
11
- success: 'bg-background text-foreground border-success/40 text-success',
12
- warning: 'bg-background text-foreground border-warning/40 text-warning',
13
- destructive: 'bg-background text-foreground border-destructive/40 text-destructive',
10
+ default: "bg-background text-foreground border-border",
11
+ success: "bg-background text-foreground border-success/40 text-success",
12
+ warning: "bg-background text-foreground border-warning/40 text-warning",
13
+ destructive: "bg-background text-foreground border-destructive/40 text-destructive",
14
+ info: "bg-background text-foreground border-border",
14
15
  },
15
16
  },
16
17
  defaultVariants: {
17
- variant: 'default',
18
+ variant: "default",
18
19
  },
19
20
  });
20
21
  export const ToastProvider = ToastPrimitive.Provider;
@@ -24,16 +25,17 @@ export const ToastViewport = ToastPrimitive.Viewport;
24
25
  // should interrupt; routine confirmations should announce politely. An
25
26
  // explicit `type` prop from the consumer always wins over this default.
26
27
  const toastTypeByVariant = {
27
- default: 'background',
28
- success: 'background',
29
- warning: 'foreground',
30
- destructive: 'foreground',
28
+ default: "background",
29
+ success: "background",
30
+ warning: "foreground",
31
+ destructive: "foreground",
32
+ info: "background",
31
33
  };
32
34
  export const Toast = React.forwardRef(({ className, variant, type, ...props }, ref) => {
33
- const resolvedVariant = variant ?? 'default';
35
+ const resolvedVariant = variant ?? "default";
34
36
  return (_jsx(ToastPrimitive.Root, { ref: ref, type: type ?? toastTypeByVariant[resolvedVariant], className: cn(toastVariants({ variant }), className), ...props }));
35
37
  });
36
- Toast.displayName = 'Toast';
38
+ Toast.displayName = "Toast";
37
39
  export const ToastTitle = ToastPrimitive.Title;
38
40
  export const ToastDescription = ToastPrimitive.Description;
39
41
  export const ToastClose = ToastPrimitive.Close;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pycolors/ui",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Production-ready UI primitives for modern SaaS apps (Radix + Tailwind-friendly).",
5
5
  "keywords": [
6
6
  "pycolors",