@jcsoftdev/ui 0.2.2 → 0.2.3

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
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.3 (2026-10-13)
4
+
5
+ ### Fixes
6
+
7
+ - **Checkbox looks like a checkbox.** The box is square (`rounded-xs`, the 4px small-radius token, 3px in the compact theme) instead of a circle, and the checked and indeterminate fill is the accent (as in Switch and the selected RadioGroup row) instead of the success green. Round plus green read as a radio button in multi-select lists. Sizes, 44px touch hit area, focus ring, disabled state and the `box`/`indicator`/`icon` parts are unchanged; The indeterminate state draws a dash instead of a check mark, and a disabled checkbox is dimmed (`opacity-50`, `cursor-not-allowed`) like the other form controls. RadioGroup stays round.
8
+
3
9
  ## 0.2.2 (2026-10-13)
4
10
 
5
11
  ### Fixes
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useRef } from "react";
4
- import { Check } from "../../icons/index.js";
4
+ import { Check, Minus } from "../../icons/index.js";
5
5
  import { cn } from "../../utils/cn.js";
6
6
  import { composeHandlers, useComposedRefs } from "../../utils/compose.js";
7
7
  import { BubbleInput, useFormBubble, useFormReset } from "../../utils/form-bubble.js";
@@ -51,7 +51,7 @@ function Checkbox({
51
51
  ...props,
52
52
  ref: composedRef,
53
53
  className: cn(
54
- "group inline-flex size-10 shrink-0 items-center justify-center in-data-[density=touch]:size-11",
54
+ "group inline-flex size-10 shrink-0 items-center justify-center in-data-[density=touch]:size-11 disabled:cursor-not-allowed disabled:opacity-50",
55
55
  classNames?.root,
56
56
  className
57
57
  ),
@@ -66,7 +66,7 @@ function Checkbox({
66
66
  "span",
67
67
  {
68
68
  className: cn(
69
- "grid size-4.5 place-items-center rounded-pill border-[1.5px] border-line-strong group-data-[state=checked]:border-success group-data-[state=checked]:bg-success group-data-[state=indeterminate]:border-success group-data-[state=indeterminate]:bg-success",
69
+ "grid size-4.5 place-items-center rounded-xs border-[1.5px] border-line-strong group-data-[state=checked]:border-accent group-data-[state=checked]:bg-accent group-data-[state=indeterminate]:border-accent group-data-[state=indeterminate]:bg-accent",
70
70
  classNames?.box
71
71
  ),
72
72
  children: checked === false ? null : /* @__PURE__ */ jsx(
@@ -76,7 +76,13 @@ function Checkbox({
76
76
  "data-disabled": disabledAttr,
77
77
  style: { pointerEvents: "none" },
78
78
  className: classNames?.indicator,
79
- children: /* @__PURE__ */ jsx(
79
+ children: checked === "indeterminate" ? /* @__PURE__ */ jsx(
80
+ Minus,
81
+ {
82
+ "aria-hidden": "true",
83
+ className: cn("size-2.75 stroke-[3] text-on-accent", classNames?.icon)
84
+ }
85
+ ) : /* @__PURE__ */ jsx(
80
86
  Check,
81
87
  {
82
88
  "aria-hidden": "true",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcsoftdev/ui",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Token-driven React component library: React 19, Tailwind v4.",
5
5
  "author": "jcsoftdev",
6
6
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { type ComponentProps, useRef } from "react";
4
- import { Check } from "../../icons/index.js";
4
+ import { Check, Minus } from "../../icons/index.js";
5
5
  import type { ClassNames } from "../../utils/class-names.js";
6
6
  import { cn } from "../../utils/cn.js";
7
7
  import { composeHandlers, useComposedRefs } from "../../utils/compose.js";
@@ -76,7 +76,7 @@ export function Checkbox({
76
76
  {...props}
77
77
  ref={composedRef}
78
78
  className={cn(
79
- "group inline-flex size-10 shrink-0 items-center justify-center in-data-[density=touch]:size-11",
79
+ "group inline-flex size-10 shrink-0 items-center justify-center in-data-[density=touch]:size-11 disabled:cursor-not-allowed disabled:opacity-50",
80
80
  classNames?.root,
81
81
  className,
82
82
  )}
@@ -91,7 +91,7 @@ export function Checkbox({
91
91
  >
92
92
  <span
93
93
  className={cn(
94
- "grid size-4.5 place-items-center rounded-pill border-[1.5px] border-line-strong group-data-[state=checked]:border-success group-data-[state=checked]:bg-success group-data-[state=indeterminate]:border-success group-data-[state=indeterminate]:bg-success",
94
+ "grid size-4.5 place-items-center rounded-xs border-[1.5px] border-line-strong group-data-[state=checked]:border-accent group-data-[state=checked]:bg-accent group-data-[state=indeterminate]:border-accent group-data-[state=indeterminate]:bg-accent",
95
95
  classNames?.box,
96
96
  )}
97
97
  >
@@ -102,10 +102,17 @@ export function Checkbox({
102
102
  style={{ pointerEvents: "none" }}
103
103
  className={classNames?.indicator}
104
104
  >
105
- <Check
106
- aria-hidden="true"
107
- className={cn("size-2.75 stroke-[3] text-on-accent", classNames?.icon)}
108
- />
105
+ {checked === "indeterminate" ? (
106
+ <Minus
107
+ aria-hidden="true"
108
+ className={cn("size-2.75 stroke-[3] text-on-accent", classNames?.icon)}
109
+ />
110
+ ) : (
111
+ <Check
112
+ aria-hidden="true"
113
+ className={cn("size-2.75 stroke-[3] text-on-accent", classNames?.icon)}
114
+ />
115
+ )}
109
116
  </span>
110
117
  )}
111
118
  </span>