@bouko/react 1.9.4 → 1.9.5

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.
@@ -21,6 +21,5 @@ export type HeadingProps = {
21
21
  subtitle?: ReactNode;
22
22
  reverse?: boolean;
23
23
  };
24
- export declare const rn: (...elements: ReactNode[]) => import("react/jsx-runtime").JSX.Element;
25
24
  export default function Heading({ styles, options, container, badge, icon, title, subtitle, reverse }: HeadingProps): import("react/jsx-runtime").JSX.Element;
26
25
  export {};
@@ -1,9 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Fragment } from "react";
3
2
  import { RowBox, ColumnBox } from "../flex";
4
3
  import Badge from "../text/badge";
5
4
  import { cn, tv } from "@bouko/style";
6
- export const rn = (...elements) => (_jsx(Fragment, { children: elements.map((x, i) => (_jsx(Fragment, { children: x }, i))) }));
7
5
  export default function Heading({ styles = {}, options = {}, container, badge, icon, title, subtitle, reverse }) {
8
6
  const custom = test(options);
9
7
  return (_jsxs(RowBox, { style: cn(base.container, styles.container, container), children: [icon, _jsxs(ColumnBox, { style: cn(custom.subcontainer(), reverse && "flex-col-reverse"), children: [badge && _jsx(Badge, { style: base.badge, children: badge }), _jsx(RowBox, { style: cn(custom.title(), styles.title, styles.text), children: title }), subtitle && _jsx(RowBox, { style: cn(custom.subtitle(), styles.subtitle, styles.text), children: subtitle })] })] }));
@@ -1 +1,3 @@
1
+ import { ReactNode } from "react";
2
+ export declare const rn: (...elements: ReactNode[]) => import("react/jsx-runtime").JSX.Element;
1
3
  export declare const formatText: (text: string) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
2
3
  const delimiterConfig = [
3
4
  { delimiter: "**", render: (text, key) => _jsx("span", { className: "font-bold", children: text }, key) },
4
5
  { delimiter: "~~", render: (text, key) => _jsx("span", { className: "font-semibold", children: text }, key) },
@@ -8,6 +9,7 @@ const escapeRegex = (str) => str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
8
9
  const delimiters = delimiterConfig.map(({ delimiter }) => escapeRegex(delimiter) + ".*?" + escapeRegex(delimiter)).join("|");
9
10
  const WRAPPED_TEXT_REGEX = new RegExp(`(${delimiters})`, "g");
10
11
  const isWrapped = (x, wrapper) => x.startsWith(wrapper) && x.endsWith(wrapper);
12
+ export const rn = (...elements) => (_jsx(Fragment, { children: elements.map((x, i) => (_jsx(Fragment, { children: x }, i))) }));
11
13
  export const formatText = (text) => {
12
14
  const parts = text
13
15
  .split(WRAPPED_TEXT_REGEX)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/react",
4
- "version": "1.9.4",
4
+ "version": "1.9.5",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",