@popgrids/ui 0.0.19 → 0.0.20
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/button-link.cjs +93 -0
- package/dist/button-link.cjs.map +1 -0
- package/dist/button-link.d.cts +16 -0
- package/dist/button-link.d.ts +16 -0
- package/dist/button-link.js +91 -0
- package/dist/button-link.js.map +1 -0
- package/dist/index.cjs +80 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +80 -1
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/theme.css +4 -0
- package/package.json +11 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
4
|
+
var clsx = require('clsx');
|
|
5
|
+
var tailwindMerge = require('tailwind-merge');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
function cn(...inputs) {
|
|
9
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
10
|
+
}
|
|
11
|
+
var buttonLinkVariants = classVarianceAuthority.cva(
|
|
12
|
+
"inline-flex relative items-center gap-1.5 whitespace-nowrap font-medium transition-all rounded-xs -translate-y-px border-y border-x-4 border-transparent [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none no-underline cursor-pointer",
|
|
13
|
+
{
|
|
14
|
+
variants: {
|
|
15
|
+
hasLeading: {
|
|
16
|
+
false: null,
|
|
17
|
+
true: null
|
|
18
|
+
},
|
|
19
|
+
hasTrailing: {
|
|
20
|
+
false: null,
|
|
21
|
+
true: null
|
|
22
|
+
},
|
|
23
|
+
primary: {
|
|
24
|
+
false: null,
|
|
25
|
+
true: null
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
sm: "text-sm [&_svg:not([class*='size-'])]:size-4",
|
|
29
|
+
md: "text-sm [&_svg:not([class*='size-'])]:size-[18px]",
|
|
30
|
+
lg: "text-base [&_svg:not([class*='size-'])]:size-5"
|
|
31
|
+
},
|
|
32
|
+
theme: {
|
|
33
|
+
default: "",
|
|
34
|
+
white: "text-white hover:bg-white/16 focus-visible:bg-blue-dark-600 focus-visible:text-white",
|
|
35
|
+
black: "text-black hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-black focus-visible:text-white"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
primary: false,
|
|
40
|
+
size: "md",
|
|
41
|
+
theme: "default"
|
|
42
|
+
},
|
|
43
|
+
compoundVariants: [
|
|
44
|
+
{
|
|
45
|
+
theme: "default",
|
|
46
|
+
primary: false,
|
|
47
|
+
class: "text-grayscale-500 hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-white"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
theme: "default",
|
|
51
|
+
primary: true,
|
|
52
|
+
class: "text-foreground hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-white"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
function ButtonLink({
|
|
58
|
+
children,
|
|
59
|
+
className,
|
|
60
|
+
leading,
|
|
61
|
+
primary = false,
|
|
62
|
+
size = "md",
|
|
63
|
+
theme = "default",
|
|
64
|
+
trailing,
|
|
65
|
+
...props
|
|
66
|
+
}) {
|
|
67
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
68
|
+
"a",
|
|
69
|
+
{
|
|
70
|
+
"data-slot": "button-link",
|
|
71
|
+
className: cn(
|
|
72
|
+
buttonLinkVariants({
|
|
73
|
+
hasLeading: !!leading,
|
|
74
|
+
hasTrailing: !!trailing,
|
|
75
|
+
primary,
|
|
76
|
+
size,
|
|
77
|
+
theme
|
|
78
|
+
}),
|
|
79
|
+
className
|
|
80
|
+
),
|
|
81
|
+
...props,
|
|
82
|
+
children: [
|
|
83
|
+
leading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center text-inherit [&_svg]:size-inherit", children: leading }),
|
|
84
|
+
children != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate relative", children }),
|
|
85
|
+
trailing && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center text-inherit [&_svg]:size-inherit", children: trailing })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
exports.ButtonLink = ButtonLink;
|
|
92
|
+
//# sourceMappingURL=button-link.cjs.map
|
|
93
|
+
//# sourceMappingURL=button-link.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/button-link/button-link.tsx"],"names":["twMerge","clsx","cva","jsxs","jsx"],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACEA,IAAM,kBAAA,GAAqBC,0BAAA;AAAA,EACzB,yPAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,UAAA,EAAY;AAAA,QACV,KAAA,EAAO,IAAA;AAAA,QACP,IAAA,EAAM;AAAA,OACR;AAAA,MACA,WAAA,EAAa;AAAA,QACX,KAAA,EAAO,IAAA;AAAA,QACP,IAAA,EAAM;AAAA,OACR;AAAA,MACA,OAAA,EAAS;AAAA,QACP,KAAA,EAAO,IAAA;AAAA,QACP,IAAA,EAAM;AAAA,OACR;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,8CAAA;AAAA,QACJ,EAAA,EAAI,mDAAA;AAAA,QACJ,EAAA,EAAI;AAAA,OACN;AAAA,MACA,KAAA,EAAO;AAAA,QACL,OAAA,EAAS,EAAA;AAAA,QACT,KAAA,EAAO,sFAAA;AAAA,QACP,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS,KAAA;AAAA,MACT,IAAA,EAAM,IAAA;AAAA,MACN,KAAA,EAAO;AAAA,KACT;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB;AAAA,QACE,KAAA,EAAO,SAAA;AAAA,QACP,OAAA,EAAS,KAAA;AAAA,QACT,KAAA,EACE;AAAA,OACJ;AAAA,MACA;AAAA,QACE,KAAA,EAAO,SAAA;AAAA,QACP,OAAA,EAAS,IAAA;AAAA,QACT,KAAA,EACE;AAAA;AACJ;AACF;AAEJ,CAAA;AAEA,SAAS,UAAA,CAAW;AAAA,EAClB,QAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA,GAAU,KAAA;AAAA,EACV,IAAA,GAAO,IAAA;AAAA,EACP,KAAA,GAAQ,SAAA;AAAA,EACR,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAoB;AAClB,EAAA,uBACEC,eAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,kBAAA,CAAmB;AAAA,UACjB,UAAA,EAAY,CAAC,CAAC,OAAA;AAAA,UACd,WAAA,EAAa,CAAC,CAAC,QAAA;AAAA,UACf,OAAA;AAAA,UACA,IAAA;AAAA,UACA;AAAA,SACD,CAAA;AAAA,QACD;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,OAAA,oBACCC,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,oEAAA,EACZ,QAAA,EAAA,OAAA,EACH,CAAA;AAAA,QAED,YAAY,IAAA,oBACXA,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,6BAA6B,QAAA,EAAS,CAAA;AAAA,QAEvD,QAAA,oBACCA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,sEACZ,QAAA,EAAA,QAAA,EACH;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"button-link.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { cva } from \"class-variance-authority\";\n\nimport { cn } from \"../../lib/utils\";\nimport type { ButtonLinkProps } from \"./types\";\n\nconst buttonLinkVariants = cva(\n \"inline-flex relative items-center gap-1.5 whitespace-nowrap font-medium transition-all rounded-xs -translate-y-px border-y border-x-4 border-transparent [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none no-underline cursor-pointer\",\n {\n variants: {\n hasLeading: {\n false: null,\n true: null,\n },\n hasTrailing: {\n false: null,\n true: null,\n },\n primary: {\n false: null,\n true: null,\n },\n size: {\n sm: \"text-sm [&_svg:not([class*='size-'])]:size-4\",\n md: \"text-sm [&_svg:not([class*='size-'])]:size-[18px]\",\n lg: \"text-base [&_svg:not([class*='size-'])]:size-5\",\n },\n theme: {\n default: \"\",\n white: \"text-white hover:bg-white/16 focus-visible:bg-blue-dark-600 focus-visible:text-white\",\n black: \"text-black hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-black focus-visible:text-white\",\n },\n },\n defaultVariants: {\n primary: false,\n size: \"md\",\n theme: \"default\",\n },\n compoundVariants: [\n {\n theme: \"default\",\n primary: false,\n class:\n \"text-grayscale-500 hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-white\",\n },\n {\n theme: \"default\",\n primary: true,\n class:\n \"text-foreground hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-white\",\n },\n ],\n },\n);\n\nfunction ButtonLink({\n children,\n className,\n leading,\n primary = false,\n size = \"md\",\n theme = \"default\",\n trailing,\n ...props\n}: ButtonLinkProps) {\n return (\n <a\n data-slot=\"button-link\"\n className={cn(\n buttonLinkVariants({\n hasLeading: !!leading,\n hasTrailing: !!trailing,\n primary,\n size,\n theme,\n }),\n className,\n )}\n {...props}\n >\n {leading && (\n <div className=\"flex items-center justify-center text-inherit [&_svg]:size-inherit\">\n {leading}\n </div>\n )}\n {children != null && (\n <span className=\"min-w-0 truncate relative\">{children}</span>\n )}\n {trailing && (\n <div className=\"flex items-center justify-center text-inherit [&_svg]:size-inherit\">\n {trailing}\n </div>\n )}\n </a>\n );\n}\n\nexport { ButtonLink };\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
interface ButtonLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
leading?: React.ReactNode;
|
|
8
|
+
primary?: boolean;
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
theme?: "default" | "white" | "black";
|
|
11
|
+
trailing?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare function ButtonLink({ children, className, leading, primary, size, theme, trailing, ...props }: ButtonLinkProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { ButtonLink, type ButtonLinkProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
interface ButtonLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
leading?: React.ReactNode;
|
|
8
|
+
primary?: boolean;
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
theme?: "default" | "white" | "black";
|
|
11
|
+
trailing?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare function ButtonLink({ children, className, leading, primary, size, theme, trailing, ...props }: ButtonLinkProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { ButtonLink, type ButtonLinkProps };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return twMerge(clsx(inputs));
|
|
8
|
+
}
|
|
9
|
+
var buttonLinkVariants = cva(
|
|
10
|
+
"inline-flex relative items-center gap-1.5 whitespace-nowrap font-medium transition-all rounded-xs -translate-y-px border-y border-x-4 border-transparent [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none no-underline cursor-pointer",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
hasLeading: {
|
|
14
|
+
false: null,
|
|
15
|
+
true: null
|
|
16
|
+
},
|
|
17
|
+
hasTrailing: {
|
|
18
|
+
false: null,
|
|
19
|
+
true: null
|
|
20
|
+
},
|
|
21
|
+
primary: {
|
|
22
|
+
false: null,
|
|
23
|
+
true: null
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
sm: "text-sm [&_svg:not([class*='size-'])]:size-4",
|
|
27
|
+
md: "text-sm [&_svg:not([class*='size-'])]:size-[18px]",
|
|
28
|
+
lg: "text-base [&_svg:not([class*='size-'])]:size-5"
|
|
29
|
+
},
|
|
30
|
+
theme: {
|
|
31
|
+
default: "",
|
|
32
|
+
white: "text-white hover:bg-white/16 focus-visible:bg-blue-dark-600 focus-visible:text-white",
|
|
33
|
+
black: "text-black hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-black focus-visible:text-white"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
primary: false,
|
|
38
|
+
size: "md",
|
|
39
|
+
theme: "default"
|
|
40
|
+
},
|
|
41
|
+
compoundVariants: [
|
|
42
|
+
{
|
|
43
|
+
theme: "default",
|
|
44
|
+
primary: false,
|
|
45
|
+
class: "text-grayscale-500 hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-white"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
theme: "default",
|
|
49
|
+
primary: true,
|
|
50
|
+
class: "text-foreground hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-white"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
function ButtonLink({
|
|
56
|
+
children,
|
|
57
|
+
className,
|
|
58
|
+
leading,
|
|
59
|
+
primary = false,
|
|
60
|
+
size = "md",
|
|
61
|
+
theme = "default",
|
|
62
|
+
trailing,
|
|
63
|
+
...props
|
|
64
|
+
}) {
|
|
65
|
+
return /* @__PURE__ */ jsxs(
|
|
66
|
+
"a",
|
|
67
|
+
{
|
|
68
|
+
"data-slot": "button-link",
|
|
69
|
+
className: cn(
|
|
70
|
+
buttonLinkVariants({
|
|
71
|
+
hasLeading: !!leading,
|
|
72
|
+
hasTrailing: !!trailing,
|
|
73
|
+
primary,
|
|
74
|
+
size,
|
|
75
|
+
theme
|
|
76
|
+
}),
|
|
77
|
+
className
|
|
78
|
+
),
|
|
79
|
+
...props,
|
|
80
|
+
children: [
|
|
81
|
+
leading && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center text-inherit [&_svg]:size-inherit", children: leading }),
|
|
82
|
+
children != null && /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate relative", children }),
|
|
83
|
+
trailing && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center text-inherit [&_svg]:size-inherit", children: trailing })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { ButtonLink };
|
|
90
|
+
//# sourceMappingURL=button-link.js.map
|
|
91
|
+
//# sourceMappingURL=button-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/button-link/button-link.tsx"],"names":[],"mappings":";;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACEA,IAAM,kBAAA,GAAqB,GAAA;AAAA,EACzB,yPAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,UAAA,EAAY;AAAA,QACV,KAAA,EAAO,IAAA;AAAA,QACP,IAAA,EAAM;AAAA,OACR;AAAA,MACA,WAAA,EAAa;AAAA,QACX,KAAA,EAAO,IAAA;AAAA,QACP,IAAA,EAAM;AAAA,OACR;AAAA,MACA,OAAA,EAAS;AAAA,QACP,KAAA,EAAO,IAAA;AAAA,QACP,IAAA,EAAM;AAAA,OACR;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,8CAAA;AAAA,QACJ,EAAA,EAAI,mDAAA;AAAA,QACJ,EAAA,EAAI;AAAA,OACN;AAAA,MACA,KAAA,EAAO;AAAA,QACL,OAAA,EAAS,EAAA;AAAA,QACT,KAAA,EAAO,sFAAA;AAAA,QACP,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS,KAAA;AAAA,MACT,IAAA,EAAM,IAAA;AAAA,MACN,KAAA,EAAO;AAAA,KACT;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB;AAAA,QACE,KAAA,EAAO,SAAA;AAAA,QACP,OAAA,EAAS,KAAA;AAAA,QACT,KAAA,EACE;AAAA,OACJ;AAAA,MACA;AAAA,QACE,KAAA,EAAO,SAAA;AAAA,QACP,OAAA,EAAS,IAAA;AAAA,QACT,KAAA,EACE;AAAA;AACJ;AACF;AAEJ,CAAA;AAEA,SAAS,UAAA,CAAW;AAAA,EAClB,QAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA,GAAU,KAAA;AAAA,EACV,IAAA,GAAO,IAAA;AAAA,EACP,KAAA,GAAQ,SAAA;AAAA,EACR,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAoB;AAClB,EAAA,uBACE,IAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,kBAAA,CAAmB;AAAA,UACjB,UAAA,EAAY,CAAC,CAAC,OAAA;AAAA,UACd,WAAA,EAAa,CAAC,CAAC,QAAA;AAAA,UACf,OAAA;AAAA,UACA,IAAA;AAAA,UACA;AAAA,SACD,CAAA;AAAA,QACD;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,OAAA,oBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,oEAAA,EACZ,QAAA,EAAA,OAAA,EACH,CAAA;AAAA,QAED,YAAY,IAAA,oBACX,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,6BAA6B,QAAA,EAAS,CAAA;AAAA,QAEvD,QAAA,oBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,sEACZ,QAAA,EAAA,QAAA,EACH;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"button-link.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { cva } from \"class-variance-authority\";\n\nimport { cn } from \"../../lib/utils\";\nimport type { ButtonLinkProps } from \"./types\";\n\nconst buttonLinkVariants = cva(\n \"inline-flex relative items-center gap-1.5 whitespace-nowrap font-medium transition-all rounded-xs -translate-y-px border-y border-x-4 border-transparent [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none no-underline cursor-pointer\",\n {\n variants: {\n hasLeading: {\n false: null,\n true: null,\n },\n hasTrailing: {\n false: null,\n true: null,\n },\n primary: {\n false: null,\n true: null,\n },\n size: {\n sm: \"text-sm [&_svg:not([class*='size-'])]:size-4\",\n md: \"text-sm [&_svg:not([class*='size-'])]:size-[18px]\",\n lg: \"text-base [&_svg:not([class*='size-'])]:size-5\",\n },\n theme: {\n default: \"\",\n white: \"text-white hover:bg-white/16 focus-visible:bg-blue-dark-600 focus-visible:text-white\",\n black: \"text-black hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-black focus-visible:text-white\",\n },\n },\n defaultVariants: {\n primary: false,\n size: \"md\",\n theme: \"default\",\n },\n compoundVariants: [\n {\n theme: \"default\",\n primary: false,\n class:\n \"text-grayscale-500 hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-white\",\n },\n {\n theme: \"default\",\n primary: true,\n class:\n \"text-foreground hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-white\",\n },\n ],\n },\n);\n\nfunction ButtonLink({\n children,\n className,\n leading,\n primary = false,\n size = \"md\",\n theme = \"default\",\n trailing,\n ...props\n}: ButtonLinkProps) {\n return (\n <a\n data-slot=\"button-link\"\n className={cn(\n buttonLinkVariants({\n hasLeading: !!leading,\n hasTrailing: !!trailing,\n primary,\n size,\n theme,\n }),\n className,\n )}\n {...props}\n >\n {leading && (\n <div className=\"flex items-center justify-center text-inherit [&_svg]:size-inherit\">\n {leading}\n </div>\n )}\n {children != null && (\n <span className=\"min-w-0 truncate relative\">{children}</span>\n )}\n {trailing && (\n <div className=\"flex items-center justify-center text-inherit [&_svg]:size-inherit\">\n {trailing}\n </div>\n )}\n </a>\n );\n}\n\nexport { ButtonLink };\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -380,6 +380,85 @@ function Button({
|
|
|
380
380
|
}
|
|
381
381
|
);
|
|
382
382
|
}
|
|
383
|
+
var buttonLinkVariants = classVarianceAuthority.cva(
|
|
384
|
+
"inline-flex relative items-center gap-1.5 whitespace-nowrap font-medium transition-all rounded-xs -translate-y-px border-y border-x-4 border-transparent [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none no-underline cursor-pointer",
|
|
385
|
+
{
|
|
386
|
+
variants: {
|
|
387
|
+
hasLeading: {
|
|
388
|
+
false: null,
|
|
389
|
+
true: null
|
|
390
|
+
},
|
|
391
|
+
hasTrailing: {
|
|
392
|
+
false: null,
|
|
393
|
+
true: null
|
|
394
|
+
},
|
|
395
|
+
primary: {
|
|
396
|
+
false: null,
|
|
397
|
+
true: null
|
|
398
|
+
},
|
|
399
|
+
size: {
|
|
400
|
+
sm: "text-sm [&_svg:not([class*='size-'])]:size-4",
|
|
401
|
+
md: "text-sm [&_svg:not([class*='size-'])]:size-[18px]",
|
|
402
|
+
lg: "text-base [&_svg:not([class*='size-'])]:size-5"
|
|
403
|
+
},
|
|
404
|
+
theme: {
|
|
405
|
+
default: "",
|
|
406
|
+
white: "text-white hover:bg-white/16 focus-visible:bg-blue-dark-600 focus-visible:text-white",
|
|
407
|
+
black: "text-black hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-black focus-visible:text-white"
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
defaultVariants: {
|
|
411
|
+
primary: false,
|
|
412
|
+
size: "md",
|
|
413
|
+
theme: "default"
|
|
414
|
+
},
|
|
415
|
+
compoundVariants: [
|
|
416
|
+
{
|
|
417
|
+
theme: "default",
|
|
418
|
+
primary: false,
|
|
419
|
+
class: "text-grayscale-500 hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-white"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
theme: "default",
|
|
423
|
+
primary: true,
|
|
424
|
+
class: "text-foreground hover:bg-foreground/10 focus-visible:bg-blue-dark-600 focus-visible:text-white"
|
|
425
|
+
}
|
|
426
|
+
]
|
|
427
|
+
}
|
|
428
|
+
);
|
|
429
|
+
function ButtonLink({
|
|
430
|
+
children,
|
|
431
|
+
className,
|
|
432
|
+
leading,
|
|
433
|
+
primary = false,
|
|
434
|
+
size = "md",
|
|
435
|
+
theme = "default",
|
|
436
|
+
trailing,
|
|
437
|
+
...props
|
|
438
|
+
}) {
|
|
439
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
440
|
+
"a",
|
|
441
|
+
{
|
|
442
|
+
"data-slot": "button-link",
|
|
443
|
+
className: cn(
|
|
444
|
+
buttonLinkVariants({
|
|
445
|
+
hasLeading: !!leading,
|
|
446
|
+
hasTrailing: !!trailing,
|
|
447
|
+
primary,
|
|
448
|
+
size,
|
|
449
|
+
theme
|
|
450
|
+
}),
|
|
451
|
+
className
|
|
452
|
+
),
|
|
453
|
+
...props,
|
|
454
|
+
children: [
|
|
455
|
+
leading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center text-inherit [&_svg]:size-inherit", children: leading }),
|
|
456
|
+
children != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate relative", children }),
|
|
457
|
+
trailing && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center text-inherit [&_svg]:size-inherit", children: trailing })
|
|
458
|
+
]
|
|
459
|
+
}
|
|
460
|
+
);
|
|
461
|
+
}
|
|
383
462
|
function ContentBlock({ className, children, title, subhead, cta }) {
|
|
384
463
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex max-w-xl flex-col items-start gap-3 self-stretch", className), children: [
|
|
385
464
|
(title || subhead || cta) && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-10 items-start justify-between self-stretch", children: [
|
|
@@ -1235,6 +1314,7 @@ function Tag({
|
|
|
1235
1314
|
}
|
|
1236
1315
|
|
|
1237
1316
|
exports.Button = Button;
|
|
1317
|
+
exports.ButtonLink = ButtonLink;
|
|
1238
1318
|
exports.ContentBlock = ContentBlock;
|
|
1239
1319
|
exports.Dialog = DialogRoot;
|
|
1240
1320
|
exports.DialogBackdrop = DialogBackdrop;
|