@bouko/react 1.7.8 → 1.7.9

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.7.9",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",
@@ -1,6 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="1em" height="1em">
2
- <path
3
- d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-111 111-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L369 209z"
4
- fill="currentColor"
5
- />
6
- </svg>
@@ -1,6 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="1em" height="1em">
2
- <path
3
- d="M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z"
4
- fill="currentColor"
5
- />
6
- </svg>
@@ -1,6 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="1em" height="1em">
2
- <path
3
- d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"
4
- fill="currentColor"
5
- />
6
- </svg>