@alexandregme/zljs 1.3.1 → 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 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;
@@ -191,9 +192,10 @@ interface TextProps {
191
192
  children: string | number;
192
193
  as?: "p" | "span";
193
194
  variant?: TextVariant;
195
+ color?: SemanticColor;
194
196
  }
195
197
 
196
- declare const Text: ({ children, as: Tag, variant, }: TextProps) => react.JSX.Element;
198
+ declare const Text: ({ children, as: Tag, variant, color, }: TextProps) => react.JSX.Element;
197
199
 
198
200
  interface SidebarItem {
199
201
  icon: IconName;
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
- 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
+ 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 focus:ring-gray-500"
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-600 hover:text-green-800"
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-600 hover:text-yellow-800"
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-600 hover:text-cyan-800"
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-500 hover:text-slate-700"
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
  }
@@ -650,6 +652,14 @@ var text = tv8({
650
652
  body: "text-base",
651
653
  caption: "text-sm",
652
654
  display: "text-3xl font-bold"
655
+ },
656
+ color: {
657
+ primary: "text-blue-600",
658
+ success: "text-green-700",
659
+ danger: "text-red-600",
660
+ warning: "text-yellow-700",
661
+ info: "text-sky-700",
662
+ none: ""
653
663
  }
654
664
  },
655
665
  defaultVariants: {
@@ -662,9 +672,10 @@ import { jsx as jsx12 } from "react/jsx-runtime";
662
672
  var Text = ({
663
673
  children,
664
674
  as: Tag2 = "p",
665
- variant = "body"
675
+ variant = "body",
676
+ color
666
677
  }) => {
667
- return /* @__PURE__ */ jsx12(Tag2, { "data-testid": "text", className: text({ variant }), children });
678
+ return /* @__PURE__ */ jsx12(Tag2, { "data-testid": "text", className: text({ variant, color }), children });
668
679
  };
669
680
 
670
681
  // core/stats-card/stats-card.styles.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexandregme/zljs",
3
- "version": "1.3.1",
3
+ "version": "1.5.0",
4
4
  "description": "Opinionated, accessible React component library for enterprise apps (Next.js, Tailwind CSS v4).",
5
5
  "keywords": [
6
6
  "react",