@bouko/react 1.9.2 → 1.9.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.
@@ -2,4 +2,4 @@ import type { ReactNode } from "react";
2
2
  export default function Badge({ style, children }: {
3
3
  style?: string;
4
4
  children: ReactNode;
5
- }): Promise<import("react/jsx-runtime").JSX.Element>;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export default async function Badge({ style, children }) {
2
+ export default function Badge({ style, children }) {
3
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
4
  }
@@ -3,7 +3,7 @@ import { RowBox, ColumnBox } from "../flex";
3
3
  import { cn } from "@bouko/style";
4
4
  import Badge from "../text/badge";
5
5
  export default function Heading({ styles = {}, container, badge, icon, title, align = "left", subtitle, reverse }) {
6
- return (_jsxs(RowBox, { style: cn(base.container, styles.container, container), children: [icon, _jsxs(ColumnBox, { style: cn(base.subcontainer, align === "center" && "items-center", reverse && "flex-col-reverse"), children: [badge && _jsx(Badge, { style: base.badge, children: badge }), _jsx("span", { className: cn(base.title, styles.title), children: title }), subtitle && _jsx("span", { className: cn(base.subtitle, styles.subtitle), children: subtitle })] })] }));
6
+ return (_jsxs(RowBox, { style: cn(base.container, styles.container, container), children: [icon, _jsxs(ColumnBox, { style: cn(base.subcontainer, align === "center" && "items-center", reverse && "flex-col-reverse"), children: [badge && _jsx(Badge, { style: base.badge, children: badge }), _jsx("span", { className: cn(base.title, styles.title), children: title }), subtitle && _jsx("span", { className: cn(base.subtitle, styles.subtitle, align === "center" && "text-center"), children: subtitle })] })] }));
7
7
  }
8
8
  const base = {
9
9
  container: "gap-2 items-center",
@@ -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
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/react",
4
- "version": "1.9.2",
4
+ "version": "1.9.3",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",