@alexandregme/zljs 1.4.0 → 1.5.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.
- package/dist/index.d.ts +2 -1
- package/dist/index.js +23 -21
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ interface ButtonProps {
|
|
|
37
37
|
variant?: ButtonVariant;
|
|
38
38
|
color?: ButtonColor;
|
|
39
39
|
size?: Size;
|
|
40
|
+
fullWidth?: boolean;
|
|
40
41
|
icon?: IconName;
|
|
41
42
|
iconPosition?: "left" | "right";
|
|
42
43
|
disabled?: boolean;
|
|
@@ -44,7 +45,7 @@ interface ButtonProps {
|
|
|
44
45
|
onClick?: () => void;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
declare const Button: ({ children, type, variant: variantProp, color, size, icon, iconPosition, disabled, "aria-label": ariaLabel, onClick, }: ButtonProps) => react.JSX.Element;
|
|
48
|
+
declare const Button: ({ children, type, variant: variantProp, color, size, fullWidth, icon, iconPosition, disabled, "aria-label": ariaLabel, onClick, }: ButtonProps) => react.JSX.Element;
|
|
48
49
|
|
|
49
50
|
interface DataGridCellParams<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
50
51
|
value?: any;
|
package/dist/index.js
CHANGED
|
@@ -47,33 +47,38 @@ var Icon = ({
|
|
|
47
47
|
// core/button/button.styles.ts
|
|
48
48
|
import { tv } from "tailwind-variants";
|
|
49
49
|
var button = tv({
|
|
50
|
-
|
|
50
|
+
// outline-current covers the colors with no outline class (ghost, none): without it, browsers keep their default focus color.
|
|
51
|
+
base: "cursor-pointer font-medium focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center",
|
|
51
52
|
variants: {
|
|
52
53
|
variant: {
|
|
53
|
-
default: "px-4 py-2 text-white text-sm gap-2 rounded-md
|
|
54
|
-
icon: "p-1 bg-transparent text-gray-500 hover:text-gray-700 hover:bg-gray-100
|
|
55
|
-
|
|
54
|
+
default: "px-4 py-2 text-white text-sm gap-2 rounded-md",
|
|
55
|
+
icon: "p-1 bg-transparent text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-md",
|
|
56
|
+
// The invisible ::after grows the touch target to 44px without changing the layout.
|
|
57
|
+
link: "relative text-xs hover:underline rounded-sm after:absolute after:top-1/2 after:left-1/2 after:h-11 after:w-full after:min-w-11 after:-translate-x-1/2 after:-translate-y-1/2"
|
|
56
58
|
},
|
|
57
59
|
color: {
|
|
58
|
-
primary: "bg-blue-600 hover:bg-blue-700 focus:
|
|
59
|
-
success: "bg-green-
|
|
60
|
-
danger: "bg-red-600 hover:bg-red-700 focus:
|
|
61
|
-
warning: "bg-yellow-500 hover:bg-yellow-600 focus:
|
|
62
|
-
info: "bg-cyan-
|
|
63
|
-
ghost: "bg-transparent text-
|
|
60
|
+
primary: "bg-blue-600 hover:bg-blue-700 focus-visible:outline-blue-600",
|
|
61
|
+
success: "bg-green-700 hover:bg-green-800 focus-visible:outline-green-700",
|
|
62
|
+
danger: "bg-red-600 hover:bg-red-700 focus-visible:outline-red-600",
|
|
63
|
+
warning: "bg-yellow-500 hover:bg-yellow-600 focus-visible:outline-yellow-700 text-gray-900",
|
|
64
|
+
info: "bg-cyan-700 hover:bg-cyan-800 focus-visible:outline-cyan-700",
|
|
65
|
+
ghost: "bg-transparent text-current hover:text-current hover:bg-neutral-500/20",
|
|
64
66
|
none: ""
|
|
65
67
|
},
|
|
66
68
|
size: {
|
|
67
69
|
sm: "",
|
|
68
70
|
md: "",
|
|
69
71
|
lg: ""
|
|
72
|
+
},
|
|
73
|
+
fullWidth: {
|
|
74
|
+
true: "w-full"
|
|
70
75
|
}
|
|
71
76
|
},
|
|
72
77
|
compoundVariants: [
|
|
73
78
|
{
|
|
74
79
|
variant: "default",
|
|
75
80
|
color: "none",
|
|
76
|
-
class: "bg-gray-100 text-gray-900 hover:bg-gray-200
|
|
81
|
+
class: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
|
77
82
|
},
|
|
78
83
|
{
|
|
79
84
|
variant: "default",
|
|
@@ -103,7 +108,7 @@ var button = tv({
|
|
|
103
108
|
{
|
|
104
109
|
variant: "link",
|
|
105
110
|
color: "success",
|
|
106
|
-
class: "text-green-
|
|
111
|
+
class: "text-green-700 hover:text-green-900"
|
|
107
112
|
},
|
|
108
113
|
{
|
|
109
114
|
variant: "link",
|
|
@@ -113,22 +118,17 @@ var button = tv({
|
|
|
113
118
|
{
|
|
114
119
|
variant: "link",
|
|
115
120
|
color: "warning",
|
|
116
|
-
class: "text-yellow-
|
|
121
|
+
class: "text-yellow-700 hover:text-yellow-900"
|
|
117
122
|
},
|
|
118
123
|
{
|
|
119
124
|
variant: "link",
|
|
120
125
|
color: "info",
|
|
121
|
-
class: "text-cyan-
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
variant: "link",
|
|
125
|
-
color: "ghost",
|
|
126
|
-
class: "text-neutral-400 hover:text-neutral-600"
|
|
126
|
+
class: "text-cyan-700 hover:text-cyan-900"
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
variant: "link",
|
|
130
130
|
color: "none",
|
|
131
|
-
class: "text-slate-
|
|
131
|
+
class: "text-slate-600 hover:text-slate-800"
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
134
|
variant: "link",
|
|
@@ -150,6 +150,7 @@ var Button = ({
|
|
|
150
150
|
variant: variantProp,
|
|
151
151
|
color = "primary",
|
|
152
152
|
size = "md",
|
|
153
|
+
fullWidth = false,
|
|
153
154
|
icon,
|
|
154
155
|
iconPosition = "left",
|
|
155
156
|
disabled = false,
|
|
@@ -184,7 +185,8 @@ var Button = ({
|
|
|
184
185
|
className: button({
|
|
185
186
|
variant,
|
|
186
187
|
color: variant === "icon" && color !== "ghost" ? "none" : color,
|
|
187
|
-
size
|
|
188
|
+
size,
|
|
189
|
+
fullWidth
|
|
188
190
|
}),
|
|
189
191
|
children: renderContent()
|
|
190
192
|
}
|