buildgrid-ui 1.5.2 → 1.7.2

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,10 +1,8 @@
1
- import { type VariantProps } from 'class-variance-authority';
2
1
  import * as React from 'react';
3
- declare const buttonVariants: (props?: ({
4
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
- size?: "icon" | "default" | "sm" | "lg" | "xl" | null | undefined;
6
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
- export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
2
+ import { ButtonTheme, ButtonThemeVariants, buttonVariants } from './button.types';
3
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ButtonThemeVariants, Partial<{
4
+ theme: ButtonTheme;
5
+ }> {
8
6
  isLoading?: boolean;
9
7
  asChild?: boolean;
10
8
  }
@@ -0,0 +1,56 @@
1
+ import { DeepPartial } from '@/lib/types/ts-utilities';
2
+ export declare const buttonThemeDefaults: {
3
+ base: string;
4
+ variants: {
5
+ variant: {
6
+ default: string;
7
+ destructive: string;
8
+ outline: string;
9
+ secondary: string;
10
+ ghost: string;
11
+ link: string;
12
+ };
13
+ size: {
14
+ sm: string;
15
+ md: string;
16
+ lg: string;
17
+ xl: string;
18
+ icon: string;
19
+ };
20
+ };
21
+ defaultVariants: {
22
+ variant: "default";
23
+ size: "md";
24
+ };
25
+ };
26
+ export declare const buttonVariants: ((arg?: (({
27
+ class?: import("cva-extended").ClassValue;
28
+ className?: never;
29
+ } | {
30
+ class?: never;
31
+ className?: import("cva-extended").ClassValue;
32
+ }) & {
33
+ size?: "icon" | "sm" | "md" | "lg" | "xl" | undefined;
34
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | undefined;
35
+ }) | undefined) => string) & {
36
+ variants: {
37
+ size: readonly ("icon" | "sm" | "md" | "lg" | "xl")[];
38
+ variant: readonly ("link" | "default" | "destructive" | "outline" | "secondary" | "ghost")[];
39
+ };
40
+ };
41
+ export interface ButtonThemeVariants {
42
+ size?: (typeof buttonVariants)['variants']['size'][0];
43
+ variant?: (typeof buttonVariants)['variants']['variant'][0];
44
+ }
45
+ export interface ButtonTheme {
46
+ base: string;
47
+ variants: {
48
+ size: {
49
+ [key in (typeof buttonVariants)['variants']['size'][0]]: string;
50
+ };
51
+ variant: {
52
+ [key in (typeof buttonVariants)['variants']['variant'][0]]: string;
53
+ };
54
+ };
55
+ }
56
+ export type ButtonThemeProps = DeepPartial<ButtonTheme>;
@@ -1 +1,2 @@
1
1
  export * from './button';
2
+ export { type ButtonThemeProps, type ButtonThemeVariants } from './button.types';
@@ -0,0 +1,3 @@
1
+ export type DeepPartial<T> = {
2
+ [K in keyof T]?: T[K] extends object ? T[K] extends Function ? T[K] : DeepPartial<T[K]> : T[K];
3
+ };
@@ -1,4 +1,5 @@
1
1
  export * from './cn';
2
2
  export * from './date-formatters';
3
3
  export * from './formatters';
4
+ export * from './merge-objects';
4
5
  export * from './string';
@@ -0,0 +1,9 @@
1
+ type AnyObject = Record<string, any>;
2
+ /**
3
+ * Recursively merges two objects. The first object has priority to override properties.
4
+ * @param obj1 - The object with higher priority.
5
+ * @param obj2 - The object to merge into the first object.
6
+ * @returns The merged object.
7
+ */
8
+ export declare function mergeObjects<T extends AnyObject, U extends AnyObject>(obj1: T, obj2: U): T & U;
9
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buildgrid-ui",
3
- "version": "1.5.2",
3
+ "version": "1.7.2",
4
4
  "homepage": "http://adrianomaringolo.github.io/buildgrid-ui",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -60,6 +60,7 @@
60
60
  "class-variance-authority": "^0.7.1",
61
61
  "clsx": "^2.1.1",
62
62
  "compressorjs": "^1.2.1",
63
+ "cva-extended": "^2.0.0",
63
64
  "date-fns": "^4.1.0",
64
65
  "date-fns-tz": "^3.2.0",
65
66
  "lucide-react": "^0.469.0",