@bouko/react 2.0.2 → 2.0.4

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.
@@ -0,0 +1,5 @@
1
+ import type { ReactNode } from "react";
2
+ export default function Badge({ style, children }: {
3
+ style?: string;
4
+ children: ReactNode;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export default function Badge({ style, children }) {
3
+ return (_jsx("span", { className: "w-min px-3 py-1 bg-accent/20 border border-accent-dark rounded-full text-xs text-accent-dark font-semibold", children: children }));
4
+ }
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from "react";
2
+ type Props = Position & {
3
+ style?: string;
4
+ children: ReactNode;
5
+ };
6
+ type Position = {
7
+ center?: boolean;
8
+ centerX?: boolean;
9
+ centerY?: boolean;
10
+ };
11
+ export declare function ColumnBox({ style, center, centerX, centerY, children }: Props): import("react/jsx-runtime").JSX.Element;
12
+ export declare function RowBox({ style, children }: {
13
+ style?: string;
14
+ children: ReactNode;
15
+ }): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "@bouko/style";
3
+ export function ColumnBox({ style, center, centerX, centerY, children }) {
4
+ return (_jsx("div", { className: cn("flex flex-col", center && "items-center justify-center", centerX && "items-center", centerY && "justify-center", style), children: children }));
5
+ }
6
+ export function RowBox({ style, children }) {
7
+ return (_jsx("div", { className: cn("flex", style), children: children }));
8
+ }
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ placeholder?: string;
3
+ action: (query: string) => void;
4
+ };
5
+ export default function SearchBar({ placeholder, action }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { RowBox } from "../flex";
5
+ import { Button } from "../button";
6
+ export default function SearchBar({ placeholder, action }) {
7
+ const [query, search] = useState("");
8
+ return (_jsxs(RowBox, { style: styles.container, children: [_jsxs("div", { className: "relative grow", children: [_jsx("input", { className: "w-full outline-none lowercase text-lg placeholder-slate-500 tracking-wide", placeholder: placeholder, value: query, onChange: (e) => search(e.target.value), onKeyUp: (e) => e.key === "Enter" ? action(query) : null }), _jsx("div", { className: "absolute top-0 right-0 w-12 h-full bg-gradient-to-l from-slate-950" })] }), _jsx(Button, { size: "sm", style: "gap-[0.4rem] font-extrabold py-1 px-3 font-mono", onClick: () => action(query), children: "GO" })] }));
9
+ }
10
+ const styles = {
11
+ container: "items-center gap-6 w-xl pl-5 pr-4 py-3 bg-slate-950 border border-border rounded-md"
12
+ };
@@ -1,4 +1,5 @@
1
- import { ReactNode } from "react";
1
+ import { ReactNode, ReactElement } from "react";
2
+ export type Renderable = ReactElement | string | null;
2
3
  export type Component = {
3
4
  style?: string;
4
5
  children?: ReactNode;
@@ -0,0 +1,7 @@
1
+ type Props = {
2
+ variable: string;
3
+ color: string;
4
+ original: string;
5
+ };
6
+ export default function useColor({ variable, color, original }: Props): void;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { useEffect } from "react";
3
+ export default function useColor({ variable, color, original }) {
4
+ useEffect(() => {
5
+ document.documentElement.style.setProperty(`--${variable}`, color);
6
+ return () => document.documentElement.style.setProperty(`--${variable}`, original);
7
+ }, []);
8
+ }
package/package.json CHANGED
@@ -1,33 +1,54 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/react",
4
- "version": "2.0.2",
4
+
5
+ "version": "2.0.4",
6
+
5
7
  "main": "./dist/index.js",
8
+
6
9
  "types": "./dist/index.d.ts",
10
+
7
11
  "license": "MIT",
12
+
8
13
  "files": [
14
+
9
15
  "dist"
16
+
10
17
  ],
18
+
11
19
  "publishConfig": {
20
+
12
21
  "access": "public"
22
+
13
23
  },
24
+
14
25
  "author": "",
26
+
15
27
  "description": "",
28
+
16
29
  "engines": {},
17
30
 
18
31
  "scripts": {
32
+
19
33
  "build": "tsc"
34
+
20
35
  },
21
36
 
22
37
  "dependencies": {
23
- "@bouko/style": "^0.1.3",
38
+
39
+ "@bouko/style": "^0.1.5",
40
+
24
41
  "clsx": "^2.1.1",
42
+
25
43
  "framer-motion": "^12.23.6",
44
+
26
45
  "tailwind-merge": "^3.3.0",
46
+
27
47
  "tailwind-variants": "^1.0.0",
48
+
28
49
  "zod": "^4.0.13"
29
- },
30
50
 
31
- "devDependencies": {}
51
+ }
52
+
53
+ }
32
54
 
33
- }