@bouko/react 1.7.8 → 1.8.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.
@@ -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
  }
@@ -1,4 +1,5 @@
1
1
  export { default as Heading, HeadingProps } from "./layout/heading";
2
2
  export { default as Separator } from "./layout/separator";
3
+ export { default as Badge } from "./text/badge";
3
4
  export * from "./list";
4
5
  export * from "./form";
@@ -1,4 +1,5 @@
1
1
  export { default as Heading } from "./layout/heading";
2
2
  export { default as Separator } from "./layout/separator";
3
+ export { default as Badge } from "./text/badge";
3
4
  export * from "./list";
4
5
  export * from "./form";
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { RowBox, ColumnBox } from "../flex";
3
3
  import { cn } from "@bouko/style";
4
- import Badge from "../badge";
4
+ import Badge from "../text/badge";
5
5
  export default function Heading({ styles = {}, container, badge, icon, title, align = "left", subtitle, reverse }) {
6
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 })] })] }));
7
7
  }
@@ -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
+ };
@@ -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
+ }
package/dist/index.d.ts CHANGED
@@ -4,7 +4,6 @@ export { default as Select } from "./components/select";
4
4
  export { default as MultipleChoice } from "./components/multiple-choice";
5
5
  export { default as Attachment } from "./components/attachment";
6
6
  export { default as CheckBox } from "./components/checkbox";
7
- export { default as Badge } from "./components/badge";
8
7
  export { default as FadeCarousel } from "./components/fade-carousel";
9
8
  export * from "./components";
10
9
  export * from "./components/flex";
package/dist/index.js CHANGED
@@ -4,7 +4,6 @@ export { default as Select } from "./components/select";
4
4
  export { default as MultipleChoice } from "./components/multiple-choice";
5
5
  export { default as Attachment } from "./components/attachment";
6
6
  export { default as CheckBox } from "./components/checkbox";
7
- export { default as Badge } from "./components/badge";
8
7
  export { default as FadeCarousel } from "./components/fade-carousel";
9
8
  export * from "./components";
10
9
  export * from "./components/flex";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/react",
4
- "version": "1.7.8",
4
+ "version": "1.8.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",