@bouko/react 1.6.1 → 1.6.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.
@@ -1,3 +1,3 @@
1
- export { default as Heading } from "./layout/heading";
1
+ export { default as Heading, HeadingProps } from "./layout/heading";
2
2
  export { default as Separator } from "./layout/separator";
3
3
  export * from "./list";
@@ -6,7 +6,7 @@ export type HeadingProps = {
6
6
  icon?: ReactNode;
7
7
  title: ReactNode;
8
8
  align?: "left" | "center";
9
- subtitle: ReactNode;
9
+ subtitle?: ReactNode;
10
10
  reverse?: boolean;
11
11
  };
12
12
  export default function Heading({ styles, container, badge, icon, title, align, subtitle, reverse }: HeadingProps): import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import { RowBox, ColumnBox } from "../flex";
3
3
  import { cn } from "@bouko/style";
4
4
  import Badge from "../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 }), _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), children: subtitle })] })] }));
7
7
  }
8
8
  const base = {
9
9
  container: "gap-2 items-center",
@@ -1,24 +1,5 @@
1
- "use client";
2
1
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useState } from "react";
4
- import { useContainer, useResize } from "../../hooks";
5
- import { cn, tv } from "@bouko/style";
2
+ import { cn } from "@bouko/style";
6
3
  export default function Separator({ style }) {
7
- const { container, ref } = useContainer();
8
- const [flow, setFlow] = useState();
9
- useResize(container, () => {
10
- const css = getComputedStyle(container);
11
- setFlow(css.flexDirection);
12
- });
13
- return (_jsx("div", { className: cn(styles({ flow }), style), ref: ref }));
4
+ return _jsx("hr", { className: cn("w-full text-border-dark", style) });
14
5
  }
15
- ;
16
- const styles = tv({
17
- base: "bg-border-dark",
18
- variants: {
19
- flow: {
20
- row: "w-px min-w-px h-full",
21
- column: "w-full h-px min-h-px"
22
- }
23
- }
24
- });
@@ -11,6 +11,6 @@ function Marker() {
11
11
  return (_jsx("span", { className: "mr-3 text-accent", children: "\u2022" }));
12
12
  }
13
13
  const styles = {
14
- base: "flex flex-col gap-1 w-full text-primary-dark",
15
- title: "mb-1 text-base text-primary"
14
+ base: "flex flex-col gap-1 w-full",
15
+ title: "mb-1 text-base"
16
16
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/react",
4
- "version": "1.6.1",
4
+ "version": "1.6.3",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",