@iloveagents/foundry-web-primitives 0.20.0 → 0.21.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/checkbox.js +6 -3
- package/package.json +1 -1
package/dist/checkbox.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
4
|
-
import { Check } from "lucide-react";
|
|
4
|
+
import { Check, Minus } from "lucide-react";
|
|
5
5
|
import { cn } from "./utils.js";
|
|
6
|
-
const Checkbox = React.forwardRef(({ className, ...props }, ref) => (_jsx(CheckboxPrimitive.Root, { ref: ref, className: cn("peer size-4 shrink-0 rounded border border-border bg-background shadow-sm outline-none transition", "focus-visible:ring-2 focus-visible:ring-primary/15 disabled:cursor-not-allowed disabled:opacity-50", "data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
6
|
+
const Checkbox = React.forwardRef(({ className, ...props }, ref) => (_jsx(CheckboxPrimitive.Root, { ref: ref, className: cn("peer size-4 shrink-0 rounded border border-border bg-background shadow-sm outline-none transition", "focus-visible:ring-2 focus-visible:ring-primary/15 disabled:cursor-not-allowed disabled:opacity-50", "data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
7
|
+
// "Some of these" is a state of its own. Left unstyled it drew a tick
|
|
8
|
+
// on a white box — the one shape that reads as "not selected".
|
|
9
|
+
"data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground", className), ...props, children: _jsxs(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current", "data-[state=indeterminate]:[&_[data-glyph=check]]:hidden", "data-[state=indeterminate]:[&_[data-glyph=minus]]:block"), children: [_jsx(Check, { "data-glyph": "check", className: "size-3.5" }), _jsx(Minus, { "data-glyph": "minus", className: "hidden size-3.5" })] }) })));
|
|
7
10
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
8
11
|
export { Checkbox };
|
package/package.json
CHANGED