@brosco/ui 0.0.104 → 0.0.107
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.ts +107 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,113 @@
|
|
|
1
|
+
import { ButtonProps as ButtonProps_2 } from '@base-ui/react/button';
|
|
1
2
|
import { JSX } from 'react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
import { SVGProps } from 'react';
|
|
5
|
+
import { TVReturnType } from 'tailwind-variants';
|
|
6
|
+
import { TVReturnTypeLike } from 'tailwind-variants';
|
|
7
|
+
import { VariantProps } from 'tailwind-variants';
|
|
3
8
|
|
|
4
|
-
export declare const Button: () => JSX.Element;
|
|
9
|
+
export declare const Button: ({ children, className, render, icon, iconAtEnd, isPending, variant, color, rounded, size, isIconOnly, fullWidth, ...props }: ButtonProps) => JSX.Element;
|
|
10
|
+
|
|
11
|
+
export declare type ButtonProps = ButtonProps_2 & VariantProps<typeof linkVariants> & {
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
iconAtEnd?: ReactNode;
|
|
14
|
+
isPending?: boolean;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare const linkVariants: TVReturnType<{
|
|
18
|
+
variant: {
|
|
19
|
+
solid: "button--solid";
|
|
20
|
+
bordered: "button--bordered";
|
|
21
|
+
light: "button--light";
|
|
22
|
+
};
|
|
23
|
+
color: {
|
|
24
|
+
primary: "button--primary";
|
|
25
|
+
secondary: "button--secondary";
|
|
26
|
+
success: "button--success";
|
|
27
|
+
danger: "button--danger";
|
|
28
|
+
};
|
|
29
|
+
rounded: {
|
|
30
|
+
full: "rounded-full";
|
|
31
|
+
lg: "rounded-lg";
|
|
32
|
+
md: "rounded-md";
|
|
33
|
+
sm: "rounded-sm";
|
|
34
|
+
none: "rounded-none";
|
|
35
|
+
};
|
|
36
|
+
size: {
|
|
37
|
+
sm: "button--sm";
|
|
38
|
+
md: "button--md";
|
|
39
|
+
lg: "button--lg";
|
|
40
|
+
};
|
|
41
|
+
isIconOnly: {
|
|
42
|
+
true: "button--icon-only";
|
|
43
|
+
false: "px-4";
|
|
44
|
+
};
|
|
45
|
+
fullWidth: {
|
|
46
|
+
true: "w-full";
|
|
47
|
+
};
|
|
48
|
+
}, undefined, "button", {
|
|
49
|
+
variant: {
|
|
50
|
+
solid: "button--solid";
|
|
51
|
+
bordered: "button--bordered";
|
|
52
|
+
light: "button--light";
|
|
53
|
+
};
|
|
54
|
+
color: {
|
|
55
|
+
primary: "button--primary";
|
|
56
|
+
secondary: "button--secondary";
|
|
57
|
+
success: "button--success";
|
|
58
|
+
danger: "button--danger";
|
|
59
|
+
};
|
|
60
|
+
rounded: {
|
|
61
|
+
full: "rounded-full";
|
|
62
|
+
lg: "rounded-lg";
|
|
63
|
+
md: "rounded-md";
|
|
64
|
+
sm: "rounded-sm";
|
|
65
|
+
none: "rounded-none";
|
|
66
|
+
};
|
|
67
|
+
size: {
|
|
68
|
+
sm: "button--sm";
|
|
69
|
+
md: "button--md";
|
|
70
|
+
lg: "button--lg";
|
|
71
|
+
};
|
|
72
|
+
isIconOnly: {
|
|
73
|
+
true: "button--icon-only";
|
|
74
|
+
false: "px-4";
|
|
75
|
+
};
|
|
76
|
+
fullWidth: {
|
|
77
|
+
true: "w-full";
|
|
78
|
+
};
|
|
79
|
+
}, undefined, TVReturnTypeLike<{
|
|
80
|
+
variant: {
|
|
81
|
+
solid: "button--solid";
|
|
82
|
+
bordered: "button--bordered";
|
|
83
|
+
light: "button--light";
|
|
84
|
+
};
|
|
85
|
+
color: {
|
|
86
|
+
primary: "button--primary";
|
|
87
|
+
secondary: "button--secondary";
|
|
88
|
+
success: "button--success";
|
|
89
|
+
danger: "button--danger";
|
|
90
|
+
};
|
|
91
|
+
rounded: {
|
|
92
|
+
full: "rounded-full";
|
|
93
|
+
lg: "rounded-lg";
|
|
94
|
+
md: "rounded-md";
|
|
95
|
+
sm: "rounded-sm";
|
|
96
|
+
none: "rounded-none";
|
|
97
|
+
};
|
|
98
|
+
size: {
|
|
99
|
+
sm: "button--sm";
|
|
100
|
+
md: "button--md";
|
|
101
|
+
lg: "button--lg";
|
|
102
|
+
};
|
|
103
|
+
isIconOnly: {
|
|
104
|
+
true: "button--icon-only";
|
|
105
|
+
false: "px-4";
|
|
106
|
+
};
|
|
107
|
+
fullWidth: {
|
|
108
|
+
true: "w-full";
|
|
109
|
+
};
|
|
110
|
+
}, undefined>>;
|
|
5
111
|
|
|
6
112
|
export declare const Spinner: ({ className, size, ...props }: SpinnerProps) => JSX.Element;
|
|
7
113
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as e}from"cn";import{jsx as t}from"react/jsx-runtime";var
|
|
1
|
+
import{cn as e}from"cn";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{Button as r}from"@base-ui/react";import{isValidElement as i}from"react";import{tv as a}from"tailwind-variants";var o=({className:n,size:r=24,...i})=>/* @__PURE__ */ t(`svg`,{className:e(`spinner`,n),fill:`currentColor`,height:r,stroke:`currentColor`,strokeWidth:`0`,version:`1.1`,viewBox:`0 0 16 16`,width:r,xmlns:`http://www.w3.org/2000/svg`,...i,children:/* @__PURE__ */ t(`path`,{d:`M16 8c-0.020-1.045-0.247-2.086-0.665-3.038-0.417-0.953-1.023-1.817-1.766-2.53s-1.624-1.278-2.578-1.651c-0.953-0.374-1.978-0.552-2.991-0.531-1.013 0.020-2.021 0.24-2.943 0.646-0.923 0.405-1.758 0.992-2.449 1.712s-1.237 1.574-1.597 2.497c-0.361 0.923-0.533 1.914-0.512 2.895 0.020 0.981 0.234 1.955 0.627 2.847 0.392 0.892 0.961 1.7 1.658 2.368s1.523 1.195 2.416 1.543c0.892 0.348 1.851 0.514 2.799 0.493 0.949-0.020 1.89-0.227 2.751-0.608 0.862-0.379 1.642-0.929 2.287-1.604s1.154-1.472 1.488-2.335c0.204-0.523 0.342-1.069 0.415-1.622 0.019 0.001 0.039 0.002 0.059 0.002 0.552 0 1-0.448 1-1 0-0.028-0.001-0.056-0.004-0.083h0.004zM14.411 10.655c-0.367 0.831-0.898 1.584-1.55 2.206s-1.422 1.112-2.254 1.434c-0.832 0.323-1.723 0.476-2.608 0.454-0.884-0.020-1.759-0.215-2.56-0.57-0.801-0.354-1.526-0.867-2.125-1.495s-1.071-1.371-1.38-2.173c-0.31-0.801-0.457-1.66-0.435-2.512s0.208-1.694 0.551-2.464c0.342-0.77 0.836-1.468 1.441-2.044s1.321-1.029 2.092-1.326c0.771-0.298 1.596-0.438 2.416-0.416s1.629 0.202 2.368 0.532c0.74 0.329 1.41 0.805 1.963 1.387s0.988 1.27 1.272 2.011c0.285 0.74 0.418 1.532 0.397 2.32h0.004c-0.002 0.027-0.004 0.055-0.004 0.083 0 0.516 0.39 0.94 0.892 0.994-0.097 0.544-0.258 1.075-0.481 1.578z`})}),s=a({base:`button`,variants:{variant:{solid:`button--solid`,bordered:`button--bordered`,light:`button--light`},color:{primary:`button--primary`,secondary:`button--secondary`,success:`button--success`,danger:`button--danger`},rounded:{full:`rounded-full`,lg:`rounded-lg`,md:`rounded-md`,sm:`rounded-sm`,none:`rounded-none`},size:{sm:`button--sm`,md:`button--md`,lg:`button--lg`},isIconOnly:{true:`button--icon-only`,false:`px-4`},fullWidth:{true:`w-full`}},defaultVariants:{variant:`light`,color:`primary`,rounded:`lg`,size:`md`}}),c=a({extend:s,defaultVariants:{variant:`solid`}}),l=({children:a,className:l,render:u,icon:d,iconAtEnd:f,isPending:p,variant:m,color:h,rounded:g,size:_,isIconOnly:v,fullWidth:y,...b})=>{let x={variant:m,color:h,rounded:g,size:_,isIconOnly:v,fullWidth:y},S=i(u)&&typeof u.props==`object`&&`href`in u.props;return/* @__PURE__ */ n(r,{className:e(S?s(x):c(x),l),"data-disabled":p||void 0,nativeButton:!S,render:u,...b,children:[p&&!S?/* @__PURE__ */ t(o,{}):d,!v&&/* @__PURE__ */ t(`span`,{children:a}),f]})};export{l as Button,o as Spinner};
|
package/dist/styles.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
-
@layer theme{:root{--background:var(--color-white);--foreground:var(--color-zinc-900);--muted:var(--color-zinc-600);--primary:var(--color-blue-500);--secondary:var(--foreground);--success:var(--color-green-600);--danger:var(--color-red-500)}}@layer components{.spinner{animation:var(--animate-spin,spin 1s linear infinite)}:disabled{opacity:.5}[data-disabled],[aria-disabled=true]{pointer-events:none}}@layer utilities;@keyframes spin{to{transform:rotate(360deg)}}
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-border-style:solid}}}@layer theme{:root{--background:var(--color-white);--foreground:var(--color-zinc-900);--muted:var(--color-zinc-600);--primary:var(--color-blue-500);--secondary:var(--foreground);--success:var(--color-green-600);--danger:var(--color-red-500)}}@layer base;@layer components{.spinner{animation:var(--animate-spin,spin 1s linear infinite)}.button{--color:transparent;--bg:transparent;--bg-hover:var(--bg);--bg-active:var(--bg-hover);--fg:currentColor}.button--primary{--color:var(--primary)}.button--secondary{--color:var(--secondary)}.button--success{--color:var(--success)}.button--danger{--color:var(--danger)}.button--solid{--bg:var(--color);--bg-hover:var(--bg)}@supports (color:color-mix(in lab, red, red)){.button--solid{--bg-hover:color-mix(in oklab, var(--bg) 90%, var(--foreground) 10%)}}.button--solid{--bg-active:var(--bg)}@supports (color:color-mix(in lab, red, red)){.button--solid{--bg-active:color-mix(in oklab, var(--bg) 80%, var(--foreground) 20%)}}.button--solid{--fg:var(--color-white)}.button--solid.button--secondary{--bg:var(--color)}@supports (color:color-mix(in lab, red, red)){.button--solid.button--secondary{--bg:color-mix(in oklab, var(--color) 5%, transparent)}}.button--solid.button--secondary{--bg-hover:var(--bg)}@supports (color:color-mix(in lab, red, red)){.button--solid.button--secondary{--bg-hover:color-mix(in oklab, var(--bg) 95%, var(--foreground) 5%)}}.button--solid.button--secondary{--bg-active:var(--bg)}@supports (color:color-mix(in lab, red, red)){.button--solid.button--secondary{--bg-active:color-mix(in oklab, var(--bg) 90%, var(--foreground) 10%)}}.button--solid.button--secondary{--fg:var(--color)}.button--bordered,.button--light{--fg:var(--color);--bg-hover:var(--fg)}@supports (color:color-mix(in lab, red, red)){.button--bordered,.button--light{--bg-hover:color-mix(in oklab, var(--fg) 5%, transparent)}}.button{justify-content:center;align-items:center;gap:calc(var(--spacing,.25rem) * 2);background-color:var(--bg);--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500);white-space:nowrap;color:var(--fg);transition-property:background-color,scale;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));-webkit-user-select:none;user-select:none;display:inline-flex}.button:focus-visible{--tw-outline-style:none;outline-style:none}.button:enabled{cursor:pointer}.button:hover{background-color:var(--bg-hover)}.button:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--bg-active)}.button--sm{height:calc(var(--spacing,.25rem) * 9);font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.button--md{height:calc(var(--spacing,.25rem) * 10);font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.button--lg{height:calc(var(--spacing,.25rem) * 11);font-size:var(--text-base,1rem);line-height:var(--tw-leading,var(--text-base--line-height,calc(1.5 / 1)))}.button--icon-only{flex-shrink:0}.button--icon-only.button--sm{width:calc(var(--spacing,.25rem) * 9)}.button--icon-only.button--md{width:calc(var(--spacing,.25rem) * 10)}.button--icon-only.button--lg{width:calc(var(--spacing,.25rem) * 11)}.button--solid:focus-visible{--tw-ring-color:var(--color);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.button--bordered{border-style:var(--tw-border-style);border-width:2px;border-color:var(--fg)}.button--bordered:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.button--light:focus-visible:after{top:var(--spacing,.25rem);right:calc(var(--spacing,.25rem) * 3);left:calc(var(--spacing,.25rem) * 3);height:calc(var(--spacing,.25rem) * .5);content:"";background-color:currentColor;position:absolute}.button--light{text-underline-offset:6px;text-decoration-line:underline;position:relative}.button--light:hover{text-decoration-line:none}:disabled{pointer-events:none;opacity:.5;-webkit-user-select:none;user-select:none}[data-disabled],[aria-disabled=true]{pointer-events:none;-webkit-user-select:none;user-select:none}}@layer utilities;@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@keyframes spin{to{transform:rotate(360deg)}}
|
|
3
3
|
@theme inline {
|
|
4
4
|
--color-background: var(--background);
|
|
5
5
|
--color-foreground: var(--foreground);
|