@alexandregme/zljs 1.4.0 → 1.6.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 CHANGED
@@ -9,7 +9,7 @@ import 'react-hook-form';
9
9
  /**
10
10
  * Semantic colors for action-oriented components (Button, Heading, etc.)
11
11
  */
12
- type SemanticColor = "primary" | "success" | "danger" | "warning" | "info" | "none";
12
+ type SemanticColor = "primary" | "success" | "danger" | "warning" | "info" | "muted" | "none";
13
13
  /**
14
14
  * Literal colors for data visualization components (StatsCard, etc.)
15
15
  */
@@ -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,39 @@ var Icon = ({
47
47
  // core/button/button.styles.ts
48
48
  import { tv } from "tailwind-variants";
49
49
  var button = tv({
50
- base: "cursor-pointer font-medium focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center",
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 focus:ring-2 focus:ring-offset-2",
54
- icon: "p-1 bg-transparent text-gray-500 hover:text-gray-700 hover:bg-gray-100 focus:ring-gray-500 rounded-md focus:ring-2 focus:ring-offset-2",
55
- link: "text-xs hover:underline"
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:ring-blue-500",
59
- success: "bg-green-600 hover:bg-green-700 focus:ring-green-500",
60
- danger: "bg-red-600 hover:bg-red-700 focus:ring-red-500",
61
- warning: "bg-yellow-500 hover:bg-yellow-600 focus:ring-yellow-500 text-gray-900",
62
- info: "bg-cyan-500 hover:bg-cyan-600 focus:ring-cyan-500",
63
- ghost: "bg-transparent text-neutral-400 hover:text-white hover:bg-neutral-800 focus:ring-neutral-600",
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
+ muted: "bg-gray-500 hover:bg-gray-600 focus-visible:outline-gray-500",
66
+ ghost: "bg-transparent text-current hover:text-current hover:bg-neutral-500/20",
64
67
  none: ""
65
68
  },
66
69
  size: {
67
70
  sm: "",
68
71
  md: "",
69
72
  lg: ""
73
+ },
74
+ fullWidth: {
75
+ true: "w-full"
70
76
  }
71
77
  },
72
78
  compoundVariants: [
73
79
  {
74
80
  variant: "default",
75
81
  color: "none",
76
- class: "bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500"
82
+ class: "bg-gray-100 text-gray-900 hover:bg-gray-200"
77
83
  },
78
84
  {
79
85
  variant: "default",
@@ -103,7 +109,7 @@ var button = tv({
103
109
  {
104
110
  variant: "link",
105
111
  color: "success",
106
- class: "text-green-600 hover:text-green-800"
112
+ class: "text-green-700 hover:text-green-900"
107
113
  },
108
114
  {
109
115
  variant: "link",
@@ -113,22 +119,22 @@ var button = tv({
113
119
  {
114
120
  variant: "link",
115
121
  color: "warning",
116
- class: "text-yellow-600 hover:text-yellow-800"
122
+ class: "text-yellow-700 hover:text-yellow-900"
117
123
  },
118
124
  {
119
125
  variant: "link",
120
126
  color: "info",
121
- class: "text-cyan-600 hover:text-cyan-800"
127
+ class: "text-cyan-700 hover:text-cyan-900"
122
128
  },
123
129
  {
124
130
  variant: "link",
125
- color: "ghost",
126
- class: "text-neutral-400 hover:text-neutral-600"
131
+ color: "muted",
132
+ class: "text-gray-500 hover:text-gray-700"
127
133
  },
128
134
  {
129
135
  variant: "link",
130
136
  color: "none",
131
- class: "text-slate-500 hover:text-slate-700"
137
+ class: "text-slate-600 hover:text-slate-800"
132
138
  },
133
139
  {
134
140
  variant: "link",
@@ -150,6 +156,7 @@ var Button = ({
150
156
  variant: variantProp,
151
157
  color = "primary",
152
158
  size = "md",
159
+ fullWidth = false,
153
160
  icon,
154
161
  iconPosition = "left",
155
162
  disabled = false,
@@ -184,7 +191,8 @@ var Button = ({
184
191
  className: button({
185
192
  variant,
186
193
  color: variant === "icon" && color !== "ghost" ? "none" : color,
187
- size
194
+ size,
195
+ fullWidth
188
196
  }),
189
197
  children: renderContent()
190
198
  }
@@ -657,6 +665,7 @@ var text = tv8({
657
665
  danger: "text-red-600",
658
666
  warning: "text-yellow-700",
659
667
  info: "text-sky-700",
668
+ muted: "text-gray-500",
660
669
  none: ""
661
670
  }
662
671
  },
@@ -829,6 +838,7 @@ var heading = tv11({
829
838
  danger: "text-red-600",
830
839
  warning: "text-yellow-700",
831
840
  info: "text-sky-700",
841
+ muted: "text-gray-500",
832
842
  none: ""
833
843
  }
834
844
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexandregme/zljs",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "Opinionated, accessible React component library for enterprise apps (Next.js, Tailwind CSS v4).",
5
5
  "keywords": [
6
6
  "react",