@nous-research/ui 0.14.0 → 0.14.2
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/README.md +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/ui/build.css +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/dist/ui/globals.css +5 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -13,6 +13,22 @@ import the global styles in your app's root css file:
|
|
|
13
13
|
@import '@nous-research/ui/styles/globals.css';
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
+
`globals.css` includes the design-system tokens, utilities, component styles,
|
|
17
|
+
and default `--font-*` variable values, but does not register font files.
|
|
18
|
+
Import the optional font stylesheet first if your app wants CSS-managed
|
|
19
|
+
`@font-face` declarations:
|
|
20
|
+
|
|
21
|
+
```css
|
|
22
|
+
@import 'tailwindcss';
|
|
23
|
+
@import '@nous-research/ui/styles/fonts.css';
|
|
24
|
+
@import '@nous-research/ui/styles/globals.css';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Next.js apps should prefer `next/font/local` with the exported
|
|
28
|
+
`@nous-research/ui/fonts/*` files and map them to the same `--font-*`
|
|
29
|
+
variables. Apps can also provide their own `--font-*` variables while keeping
|
|
30
|
+
the design-system utilities from `globals.css`.
|
|
31
|
+
|
|
16
32
|
## usage
|
|
17
33
|
|
|
18
34
|
everything exports from the top level export:
|
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";
|
package/dist/ui/build.css
CHANGED
|
@@ -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/dist/ui/globals.css
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
@source ".";
|
|
2
|
-
@import './fonts.css';
|
|
3
2
|
@import './components/fit-text/fit-text.css' layer(components);
|
|
4
3
|
@import './components/grid/grid.css' layer(components);
|
|
5
4
|
@import './components/modal/modal.css' layer(components);
|
|
@@ -145,6 +144,11 @@
|
|
|
145
144
|
--foreground: color-mix(in srgb, #fff 100%, transparent);
|
|
146
145
|
--foreground-base: #fff;
|
|
147
146
|
--foreground-alpha: 1;
|
|
147
|
+
--font-sans: 'Collapse', sans-serif;
|
|
148
|
+
--font-mono: 'Courier Prime', monospace;
|
|
149
|
+
--font-rules-compressed: 'Rules Compressed', sans-serif;
|
|
150
|
+
--font-rules-expanded: 'Rules Expanded', sans-serif;
|
|
151
|
+
--font-mondwest: 'Mondwest', sans-serif;
|
|
148
152
|
--vsq: calc(0.5vw + 0.5vh);
|
|
149
153
|
}
|
|
150
154
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nous-research/ui",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"./fonts/*": "./dist/fonts/*",
|
|
37
37
|
"./assets/*": "./dist/assets/*",
|
|
38
|
+
"./styles/fonts.css": "./dist/ui/fonts.css",
|
|
38
39
|
"./styles/globals.css": "./dist/ui/globals.css"
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
52
|
"@nanostores/react": "^1.1.0",
|
|
53
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
52
54
|
"class-variance-authority": "^0.7.1",
|
|
53
55
|
"clsx": "^2.1.1",
|
|
54
56
|
"nanostores": "^1.3.0",
|