@alexandregme/zljs 1.13.0 → 1.14.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/CHANGELOG.md CHANGED
@@ -8,6 +8,28 @@ A change that needs action in an app has a **Migration** note. When updating, re
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [1.14.0] - 2026-11-02
12
+
13
+ ### Changed
14
+
15
+ - The box of a `Checkbox` with `variant="card"` is centered on the height of its content, instead of sitting at the top. With several lines, it is no longer beside the first one
16
+
17
+ ### Fixed
18
+
19
+ - A checked `Checkbox` uses the theme's `primary` color. It had `text-blue-600`, which does nothing on a native checkbox, so it kept the browser's own color, and an app's theme only reached the border of a `card`
20
+
21
+ #### Migration
22
+
23
+ Every `Checkbox` with `variant="card"` looks different, so check those screens. Code only needs a change if it forces the alignment from outside, or if a test asserts `items-start` on the card. To find them, run the commands below from the app's root. The first also finds other components named `Checkbox` and any `variant`, and the last also finds `items-start` set by the app, and those stay as they are:
24
+
25
+ ```sh
26
+ grep -rnE -A6 "<Checkbox([[:space:]/>]|$)" . --include='*.tsx' --exclude-dir=node_modules --exclude-dir=.next | grep -E "variant="
27
+ grep -rnE "\[&_label\]:items-" . --include='*.ts' --include='*.tsx' --exclude-dir=node_modules --exclude-dir=.next
28
+ grep -rnE "items-start" . --include='*.test.*' --exclude-dir=node_modules --exclude-dir=.next
29
+ ```
30
+
31
+ Remove a wrapper that only sets `[&_label]:items-center`, and the test that asserts it. In tests, replace `items-start` with `items-center`.
32
+
11
33
  ## [1.13.0] - 2026-11-02
12
34
 
13
35
  ### Added
@@ -162,7 +184,8 @@ Replace the shade with the class of the `color` being tested, for example `/(^|\
162
184
 
163
185
  The message of `Error` is `text-zl-danger`. `none` and `ghost` didn't change.
164
186
 
165
- [Unreleased]: https://github.com/alexandregme/zljs/compare/v1.13.0...HEAD
187
+ [Unreleased]: https://github.com/alexandregme/zljs/compare/v1.14.0...HEAD
188
+ [1.14.0]: https://github.com/alexandregme/zljs/compare/v1.13.0...v1.14.0
166
189
  [1.13.0]: https://github.com/alexandregme/zljs/compare/v1.12.0...v1.13.0
167
190
  [1.12.0]: https://github.com/alexandregme/zljs/compare/v1.11.0...v1.12.0
168
191
  [1.11.0]: https://github.com/alexandregme/zljs/compare/v1.10.0...v1.11.0
@@ -23,7 +23,7 @@ var FormProvider = ({
23
23
  import { useFormContext } from "react-hook-form";
24
24
 
25
25
  // core/forms/input/input.tsx
26
- import { forwardRef, useId } from "react";
26
+ import { useId } from "react";
27
27
 
28
28
  // core/forms/error/error.styles.ts
29
29
  import { tv } from "tailwind-variants";
@@ -54,51 +54,50 @@ var input = tv2({
54
54
 
55
55
  // core/forms/input/input.tsx
56
56
  import { jsx as jsx3, jsxs } from "react/jsx-runtime";
57
- var Input = forwardRef(
58
- ({
59
- label: labelText,
60
- "aria-label": ariaLabel,
61
- name,
62
- type = "text",
63
- placeholder,
64
- autoComplete,
65
- value,
66
- error: error2,
67
- disabled,
68
- required,
69
- onChange,
70
- onBlur,
71
- onKeyDown
72
- }, ref) => {
73
- const id = useId();
74
- const errorId = `${id}-error`;
75
- return /* @__PURE__ */ jsxs("div", { className: wrapper(), children: [
76
- labelText && /* @__PURE__ */ jsx3("label", { htmlFor: id, className: label(), children: labelText }),
77
- /* @__PURE__ */ jsx3(
78
- "input",
79
- {
80
- ref,
81
- id,
82
- name,
83
- type,
84
- placeholder,
85
- autoComplete,
86
- value,
87
- disabled,
88
- required,
89
- onChange,
90
- onBlur,
91
- onKeyDown,
92
- "aria-label": ariaLabel,
93
- "aria-invalid": error2 ? true : void 0,
94
- "aria-describedby": error2 ? errorId : void 0,
95
- className: input()
96
- }
97
- ),
98
- error2 && /* @__PURE__ */ jsx3(Error, { id: errorId, message: error2 })
99
- ] });
100
- }
101
- );
57
+ var Input = ({
58
+ label: labelText,
59
+ "aria-label": ariaLabel,
60
+ name,
61
+ type = "text",
62
+ placeholder,
63
+ autoComplete,
64
+ value,
65
+ error: error2,
66
+ disabled,
67
+ required,
68
+ onChange,
69
+ onBlur,
70
+ onKeyDown,
71
+ ref
72
+ }) => {
73
+ const id = useId();
74
+ const errorId = `${id}-error`;
75
+ return /* @__PURE__ */ jsxs("div", { className: wrapper(), children: [
76
+ labelText && /* @__PURE__ */ jsx3("label", { htmlFor: id, className: label(), children: labelText }),
77
+ /* @__PURE__ */ jsx3(
78
+ "input",
79
+ {
80
+ ref,
81
+ id,
82
+ name,
83
+ type,
84
+ placeholder,
85
+ autoComplete,
86
+ value,
87
+ disabled,
88
+ required,
89
+ onChange,
90
+ onBlur,
91
+ onKeyDown,
92
+ "aria-label": ariaLabel,
93
+ "aria-invalid": error2 ? true : void 0,
94
+ "aria-describedby": error2 ? errorId : void 0,
95
+ className: input()
96
+ }
97
+ ),
98
+ error2 && /* @__PURE__ */ jsx3(Error, { id: errorId, message: error2 })
99
+ ] });
100
+ };
102
101
 
103
102
  // core/rhf/form-input/form-input.tsx
104
103
  import { jsx as jsx4 } from "react/jsx-runtime";
package/dist/index.d.ts CHANGED
@@ -117,9 +117,10 @@ type InputProps = InputName & {
117
117
  onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
118
118
  onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
119
119
  onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
120
+ ref?: Ref<HTMLInputElement>;
120
121
  };
121
122
 
122
- declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
123
+ declare const Input: ({ label: labelText, "aria-label": ariaLabel, name, type, placeholder, autoComplete, value, error, disabled, required, onChange, onBlur, onKeyDown, ref, }: InputProps) => react.JSX.Element;
123
124
 
124
125
  type RadioName = {
125
126
  label: string;
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  FormInput,
5
5
  FormProvider,
6
6
  Input
7
- } from "./chunk-2RTPRD3E.js";
7
+ } from "./chunk-VW4GICIJ.js";
8
8
 
9
9
  // core/icon/icon.tsx
10
10
  import * as LucideIcons from "lucide-react";
@@ -224,7 +224,7 @@ var innerWrapper = tv2({
224
224
  variants: {
225
225
  variant: {
226
226
  default: "w-fit items-center gap-2",
227
- card: "items-start gap-3 rounded-lg border border-gray-500 p-3 has-checked:border-zl-primary has-checked:ring-1 has-checked:ring-zl-primary has-disabled:bg-gray-100"
227
+ card: "items-center gap-3 rounded-lg border border-gray-500 p-3 has-checked:border-zl-primary has-checked:ring-1 has-checked:ring-zl-primary has-disabled:bg-gray-100"
228
228
  }
229
229
  },
230
230
  defaultVariants: {
@@ -232,7 +232,7 @@ var innerWrapper = tv2({
232
232
  }
233
233
  });
234
234
  var checkbox = tv2({
235
- base: "shrink-0 text-blue-600 border-gray-300 rounded focus:ring-2 focus:ring-blue-500 disabled:cursor-not-allowed",
235
+ base: "shrink-0 accent-zl-primary border-gray-300 rounded focus:ring-2 focus:ring-blue-500 disabled:cursor-not-allowed",
236
236
  variants: {
237
237
  size: {
238
238
  sm: "w-3.5 h-3.5",
package/dist/rhf/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  FormInput,
4
4
  FormProvider
5
- } from "../chunk-2RTPRD3E.js";
5
+ } from "../chunk-VW4GICIJ.js";
6
6
  export {
7
7
  FormInput,
8
8
  FormProvider
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexandregme/zljs",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
4
4
  "description": "Opinionated, accessible React component library for enterprise apps (Next.js, Tailwind CSS v4).",
5
5
  "keywords": [
6
6
  "react",