@nous-research/ui 0.14.1 → 0.15.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 +1 -0
- package/dist/index.js +1 -0
- package/dist/ui/components/checkbox.d.ts +2 -0
- package/dist/ui/components/checkbox.js +26 -0
- package/dist/ui/components/icons/check.d.ts +2 -0
- package/dist/ui/components/icons/check.js +12 -0
- package/dist/ui/components/icons/index.d.ts +1 -0
- package/dist/ui/components/icons/index.js +1 -0
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { BlendMode, useBlendMode, withBlendMode } from './ui/components/blend-mo
|
|
|
6
6
|
export type { BlendModeProps } from './ui/components/blend-mode';
|
|
7
7
|
export { Blink } from './ui/components/blink';
|
|
8
8
|
export { Button } from './ui/components/button';
|
|
9
|
+
export { Checkbox } from './ui/components/checkbox';
|
|
9
10
|
export { CommandBlock, CopyButton } from './ui/components/command-block';
|
|
10
11
|
export { Cursor } from './ui/components/cursor';
|
|
11
12
|
export { DropdownMenu } from './ui/components/dropdown-menu';
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { NousGirlBadge } from "./ui/components/badges/nous-girl.js";
|
|
|
5
5
|
export { BlendMode, useBlendMode, withBlendMode } from "./ui/components/blend-mode.js";
|
|
6
6
|
export { Blink } from "./ui/components/blink.js";
|
|
7
7
|
export { Button } from "./ui/components/button.js";
|
|
8
|
+
export { Checkbox } from "./ui/components/checkbox.js";
|
|
8
9
|
export { CommandBlock, CopyButton } from "./ui/components/command-block.js";
|
|
9
10
|
export { Cursor } from "./ui/components/cursor.js";
|
|
10
11
|
export { DropdownMenu } from "./ui/components/dropdown-menu.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
2
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { cn } from "../../utils/index.js";
|
|
6
|
+
import { CheckIcon } from "./icons/check.js";
|
|
7
|
+
export const Checkbox = forwardRef(function Checkbox2({ className, ...props }, ref) {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
CheckboxPrimitive.Root,
|
|
10
|
+
{
|
|
11
|
+
className: cn(
|
|
12
|
+
"peer flex h-4 w-4 shrink-0 cursor-pointer items-center justify-center border transition-colors outline-none",
|
|
13
|
+
"focus-visible:ring-1 focus-visible:ring-midground/30",
|
|
14
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
15
|
+
"data-[state=unchecked]:border-midground/20 data-[state=unchecked]:bg-background",
|
|
16
|
+
"data-[state=unchecked]:hover:border-midground/30",
|
|
17
|
+
"data-[state=checked]:border-midground/30 data-[state=checked]:bg-midground/15",
|
|
18
|
+
"data-[state=indeterminate]:border-midground/30 data-[state=indeterminate]:bg-midground/15",
|
|
19
|
+
className
|
|
20
|
+
),
|
|
21
|
+
ref,
|
|
22
|
+
...props,
|
|
23
|
+
children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ jsx(CheckIcon, { className: "h-3 w-3 text-midground" }) })
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
export function CheckIcon(props) {
|
|
3
|
+
return /* @__PURE__ */ jsx("svg", { fill: "none", viewBox: "0 0 12 12", ...props, children: /* @__PURE__ */ jsx(
|
|
4
|
+
"path",
|
|
5
|
+
{
|
|
6
|
+
clipRule: "evenodd",
|
|
7
|
+
d: "M10.28 2.22a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 0 1-1.06 0L1.72 6.28a.75.75 0 1 1 1.06-1.06L4.5 6.94l4.72-4.72a.75.75 0 0 1 1.06 0Z",
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
fillRule: "evenodd"
|
|
10
|
+
}
|
|
11
|
+
) });
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nous-research/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@nanostores/react": "^1.1.0",
|
|
53
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
53
54
|
"class-variance-authority": "^0.7.1",
|
|
54
55
|
"clsx": "^2.1.1",
|
|
55
56
|
"nanostores": "^1.3.0",
|